Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions packages/engine-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@ruminaider/flowprint-engine-core",
"version": "0.0.0",
"description": "Expression parser, dev runner, and code generator for Flowprint execution engine",
Comment on lines +1 to +4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package name "@ruminaider/flowprint-engine-core" isn't in CLAUDE.md's canonical package list — should we rename it to an allowed name or update the guidelines to permit it?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In packages/engine-core/package.json around lines 1-4, the "name" field is set to
"@ruminaider/flowprint-engine-core", which violates the repository's canonical package
naming policy. Either (A) rename the package to one of the allowed canonical names (for
example replace the value with "@ruminaider/flowprint-engine"), update any references in
build/publish configs or workspace entries, and ensure package files
(main/module/exports) still point to the correct output; OR (B) update the team
guideline file (CLAUDE.md) to explicitly permit "@ruminaider/flowprint-engine-core" and
add a short justification and versioning/publishing rules. Make the chosen change
consistently across the repo (package.json, workspace references, and documentation) and
return the modified files and a brief commit message explaining the decision.

Heads up!

Your free trial ends tomorrow.
To keep getting your PRs reviewed by Baz, update your team's subscription

Comment on lines +1 to +4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New engine-core package and engine umbrella refactor lack a .changeset entry — should we add one announcing these package changes?

Finding type: AI Coding Guidelines | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In packages/engine-core/package.json around lines 1-4, a new package
@ruminaider/flowprint-engine-core was added but there is no .changeset entry for this
PR. Add a new changeset file under .changeset (e.g.
.changeset/<short-descriptive-name>.md) that declares the new package should be released
(use a minor or appropriate bump for a new package) and also documents the change to the
umbrella package @ruminaider/flowprint-engine (use patch/minor as appropriate). In the
changeset file include a brief human-readable summary: announce the new engine-core
package and the umbrella refactor so the release tooling will pick up both package-level
changes.

Heads up!

Your free trial ends tomorrow.
To keep getting your PRs reviewed by Baz, update your team's subscription

"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./browser": {
"import": {
"types": "./dist/rules/evaluator-browser.d.ts",
"default": "./dist/rules/evaluator-browser.js"
},
"require": {
"types": "./dist/rules/evaluator-browser.d.cts",
"default": "./dist/rules/evaluator-browser.cjs"
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"build": "tsup",
"test": "vitest run",
"lint": "eslint src/",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist"
},
"dependencies": {
"@ruminaider/flowprint-schema": "workspace:*",
"acorn": "^8.14.0",
"yaml": "^2.8.2"
},
"devDependencies": {
"@types/node": "^25.2.2",
"tsup": "^8.3.6",
"typescript": "^5.7.3",
"vitest": "^4.0.18"
},
"license": "MIT"
}
72 changes: 72 additions & 0 deletions packages/engine-core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Expressions
export {
parseExpression,
clearParseCache,
validateExpressions,
interpretExpression,
InterpreterError,
LRUCache,
} from './expressions/index.js'
export type {
ParseResult,
ExpressionError,
ParsedExpression,
ExpressionValidationResult,
ExpressionValidationError,
InterpreterContext,
} from './expressions/index.js'

// Runner
export {
runGraph,
formatTrace,
evaluateExpression,
ExpressionTimeoutError,
loadEntryPoint,
loadFixtures,
} from './runner/index.js'
export type { RunOptions, ExecutionTrace, StepResult, ExecutionContext } from './runner/index.js'

// Rules
export { loadRulesFile, evaluateRules, runRulesTests } from './rules/index.js'
export type {
RulesDocument,
HitPolicy,
InputDef,
LabeledInput,
Rule,
Condition,
OperatorCondition,
RulesEvaluationResult,
RulesTestCase,
RulesTestResult,
} from './rules/index.js'

// Walker (generic graph walker + types)
export { walkGraph, walkBranch, runCompensationStack } from './walker/index.js'
export type {
ExecutionContext as WalkerExecutionContext,
NodeExecutionRecord,
WalkerCallbacks,
WalkOptions,
WalkResult,
WalkGraphCallbacks,
CompensationEntry,
CompensationResult,
BranchResult,
} from './walker/index.js'

// Security
export { assertWithinProject } from './security/index.js'

// Engine
export { FlowprintEngine, CompiledFlow, ExecutionError } from './engine/index.js'
export type { EngineOptions, EngineHooks, ExecutionResult } from './engine/index.js'

// Adapters
export { PlainAdapter, ActionTimeoutError } from './adapters/index.js'
export type { ExecutionAdapter, ActionConfig } from './adapters/index.js'

// Codegen
export { generateCode } from './codegen/index.js'
export type { GenerateResult, GenerateOptions, GeneratedFile } from './codegen/index.js'
10 changes: 10 additions & 0 deletions packages/engine-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "dist",
"rootDir": "src"
},
"include": ["src"],
"references": [{ "path": "../schema" }]
}
13 changes: 13 additions & 0 deletions packages/engine-core/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/index.ts', 'src/rules/evaluator-browser.ts', 'src/rules/core.ts'],
format: ['esm', 'cjs'],
dts: {
compilerOptions: {
composite: false,
},
},
clean: true,
sourcemap: true,
})
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/engine-gorules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"dependencies": {
"@gorules/zen-engine": "^0.54.0",
"@ruminaider/flowprint-engine": "workspace:*"
"@ruminaider/flowprint-engine-core": "workspace:*"
},
"devDependencies": {
"tsup": "^8.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, afterAll } from 'vitest'
import { evaluateRulesViaZen, disposeZenEngine } from '../rules-evaluator.js'
import type { RulesDocument } from '@ruminaider/flowprint-engine'
import type { RulesDocument } from '@ruminaider/flowprint-engine-core'

afterAll(() => {
disposeZenEngine()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest'
import { translateToJDM, conditionToUnary } from '../rules-translator.js'
import type { RulesDocument } from '@ruminaider/flowprint-engine'
import type { RulesDocument } from '@ruminaider/flowprint-engine-core'

function makeDoc(overrides: Partial<RulesDocument> = {}): RulesDocument {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-gorules/src/rules-evaluator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ZenEngine } from '@gorules/zen-engine'
import type { RulesDocument } from '@ruminaider/flowprint-engine'
import type { RulesDocument } from '@ruminaider/flowprint-engine-core'
import { translateToJDM } from './rules-translator.js'

/** Result of evaluating a rules document via GoRules ZEN */
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-gorules/src/rules-translator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
Rule,
Condition,
OperatorCondition,
} from '@ruminaider/flowprint-engine'
} from '@ruminaider/flowprint-engine-core'

/** JDM decision table input column */
interface JDMInput {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-gorules/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"rootDir": "src"
},
"include": ["src"],
"references": [{ "path": "../engine" }]
"references": [{ "path": "../engine-core" }]
}
29 changes: 10 additions & 19 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ruminaider/flowprint-engine",
"version": "0.0.0",
"description": "Expression parser, dev runner, and code generator for Flowprint execution engine",
"version": "0.0.1",
"description": "Umbrella package re-exporting engine-core and engine-gorules",
"type": "module",
"exports": {
".": {
Expand All @@ -16,12 +16,12 @@
},
"./browser": {
"import": {
"types": "./dist/rules/evaluator-browser.d.ts",
"default": "./dist/rules/evaluator-browser.js"
"types": "./dist/browser.d.ts",
"default": "./dist/browser.js"
},
"require": {
"types": "./dist/rules/evaluator-browser.d.cts",
"default": "./dist/rules/evaluator-browser.cjs"
"types": "./dist/browser.d.cts",
"default": "./dist/browser.cjs"
}
}
},
Expand All @@ -31,26 +31,17 @@
"files": [
"dist"
],
"engines": {
"node": ">=22.0.0"
},
"scripts": {
"build": "tsup",
"test": "vitest run",
"lint": "eslint src/",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist"
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@ruminaider/flowprint-schema": "workspace:*",
"acorn": "^8.14.0",
"yaml": "^2.8.2"
"@ruminaider/flowprint-engine-core": "workspace:*",
"@ruminaider/flowprint-engine-gorules": "workspace:*"
},
"devDependencies": {
"@types/node": "^25.2.2",
"tsup": "^8.3.6",
"typescript": "^5.7.3",
"vitest": "^4.0.18"
"typescript": "^5.7.3"
},
"license": "MIT"
}
1 change: 1 addition & 0 deletions packages/engine/src/browser.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@ruminaider/flowprint-engine-core/browser'
80 changes: 10 additions & 70 deletions packages/engine/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,72 +1,12 @@
// Expressions
export {
parseExpression,
clearParseCache,
validateExpressions,
interpretExpression,
InterpreterError,
LRUCache,
} from './expressions/index.js'
export type {
ParseResult,
ExpressionError,
ParsedExpression,
ExpressionValidationResult,
ExpressionValidationError,
InterpreterContext,
} from './expressions/index.js'
export * from '@ruminaider/flowprint-engine-core'

// Runner
// Re-export engine-gorules, renaming colliding symbols
export {
runGraph,
formatTrace,
evaluateExpression,
ExpressionTimeoutError,
loadEntryPoint,
loadFixtures,
} from './runner/index.js'
export type { RunOptions, ExecutionTrace, StepResult, ExecutionContext } from './runner/index.js'

// Rules
export { loadRulesFile, evaluateRules, runRulesTests } from './rules/index.js'
export type {
RulesDocument,
HitPolicy,
InputDef,
LabeledInput,
Rule,
Condition,
OperatorCondition,
RulesEvaluationResult,
RulesTestCase,
RulesTestResult,
} from './rules/index.js'

// Walker (generic graph walker + types)
export { walkGraph, walkBranch, runCompensationStack } from './walker/index.js'
export type {
ExecutionContext as WalkerExecutionContext,
NodeExecutionRecord,
WalkerCallbacks,
WalkOptions,
WalkResult,
WalkGraphCallbacks,
CompensationEntry,
CompensationResult,
BranchResult,
} from './walker/index.js'

// Security
export { assertWithinProject } from './security/index.js'

// Engine
export { FlowprintEngine, CompiledFlow, ExecutionError } from './engine/index.js'
export type { EngineOptions, EngineHooks, ExecutionResult } from './engine/index.js'

// Adapters
export { PlainAdapter, ActionTimeoutError } from './adapters/index.js'
export type { ExecutionAdapter, ActionConfig } from './adapters/index.js'

// Codegen
export { generateCode } from './codegen/index.js'
export type { GenerateResult, GenerateOptions, GeneratedFile } from './codegen/index.js'
evaluateExpression as zenEvaluateExpression,
evaluateExpressions as zenEvaluateExpressions,
evaluateRulesViaZen,
disposeZenEngine,
translateToJDM,
conditionToUnary,
} from '@ruminaider/flowprint-engine-gorules'
export type { ZenRulesResult, JDMDocument } from '@ruminaider/flowprint-engine-gorules'
5 changes: 4 additions & 1 deletion packages/engine/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"rootDir": "src"
},
"include": ["src"],
"references": [{ "path": "../schema" }]
"references": [
{ "path": "../engine-core" },
{ "path": "../engine-gorules" }
]
}
10 changes: 3 additions & 7 deletions packages/engine/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { defineConfig } from 'tsup'

export default defineConfig({
entry: ['src/index.ts', 'src/rules/evaluator-browser.ts', 'src/rules/core.ts'],
entry: ['src/index.ts', 'src/browser.ts'],
format: ['esm', 'cjs'],
dts: {
compilerOptions: {
composite: false,
},
},
clean: true,
dts: true,
sourcemap: true,
clean: true,
})
Comment on lines 1 to 9
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tsup no longer emits dist/rules/evaluator-browser.*, so the deep import @ruminaider/flowprint-engine/rules/evaluator-browser fails — should we re-add that entry and re-export it or add an alias?

Finding type: Breaking Changes | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

In packages/engine/tsup.config.ts around lines 1-9, the tsup entry array removed
src/rules/evaluator-browser.ts (now ['src/index.ts','src/browser.ts']), which prevents
emitting dist/rules/evaluator-browser.* and breaks callers importing the deep path
@ruminaider/flowprint-engine/rules/evaluator-browser. Restore backward compatibility by
re-adding 'src/rules/evaluator-browser.ts' to the entry array so tsup emits that file,
and/or add a compatibility re-export: either add an explicit package export/subpath in
packages/engine package.json that maps './rules/evaluator-browser' to
'./dist/rules/evaluator-browser.js' (and .d.ts), or create a small source re-export file
(e.g., src/rules/evaluator-browser.ts) that re-exports from src/browser.ts and ensure
it's included in entries. Make this change so previous deep imports continue to resolve
without runtime module-not-found errors.

Heads up!

Your free trial ends tomorrow.
To keep getting your PRs reviewed by Baz, update your team's subscription

Loading