-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: split engine into umbrella + engine-core packages #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/engine-pr8-gorules-zen
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New Finding type: Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents: Heads up! Your free trial ends tomorrow. |
||
| "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" | ||
| } | ||
| 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' |
| 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" }] | ||
| } |
| 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, | ||
| }) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export * from '@ruminaider/flowprint-engine-core/browser' |
| 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' |
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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: Want Baz to fix this for you? Activate Fixer Other fix methodsPrompt for AI Agents: Heads up! Your free trial ends tomorrow. |
||
There was a problem hiding this comment.
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: 🟢 LowWant Baz to fix this for you? Activate Fixer
Other fix methods
Prompt for AI Agents:
Heads up!
Your free trial ends tomorrow.
To keep getting your PRs reviewed by Baz, update your team's subscription