Repository navigation
LOU-U13, LOU-U16: bind flow placeholders as values; flow and adapter types match the runtime - #48
Merged
Merged
Conversation
…types match the runtime
U13: FlowExecutor no longer pastes {{var}} text into condition/evaluator
expressions. evaluateSafeExpression takes { bindPlaceholders: true }: a bare
{{x}} becomes the variable's value token, and {{x}} inside a string literal
is interpolated into that literal's value after tokenizing, so quotes,
backslashes and operators in a value are data. Missing/null variables behave
as before ('' in a literal, nothing when bare).
U16: EditorStep is now a union covering every node kind the executor handles
(llmCall, toolCall, setVariable, return, end, throw, and the options/items/
expression shapes of oneOf/forEach/evaluator); editor shapes are unchanged.
FileSystemAdapter takes the 'utf8' encoding StorageService passes, so
node:fs is assignable without a cast. Add tsconfig.test-d.json and run it in
test:types (test-d files were excluded from tsc, so type tests were vacuous).
README casts removed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
{{var}}placeholders are bound as values, not pasted into the expression text.EditorStepcovers every node kindFlowExecutorruns;FileSystemAdapteraccepts the realnode:fs. Both README casts are gone.Why
x' === 'x' || 'ainside'{{input}}' === 'admin'could rewrite a condition's logic (no code execution, but still injection).as unknown ascasts for the flow example and forfs.How verified
npx tsc --noEmit: clean.npm run lint: 0 errors (440 warnings, none new in touched code).npm run test:coverage: 95 files passed, 1175 tests passed, 3 skipped, thresholds met.npm run fallow: exit 0 ("0 above threshold").npm run docs:verify-snippets: "all 32 snippet(s) type-check against src/; 5 also run cleanly".npm run test:types: 10 passed, no type errors.typecheckandtypecheck:serverclean;npx vitest run108 passed;npm run test:server105 passed.Notes for reviewer
evaluateSafeExpression(expr, scope, { bindPlaceholders: true }). Bare{{x}}is a value token; inside a literal it interpolatesString(value)(missing/null become'', like before). A bare missing variable yields no token, so{{x}} >= 90is still a syntax error (false) and{{x}}alone isundefined, matching the old text substitution. Bare string values are now string literals rather than re-parsed identifiers. Inherited properties (e.g.{{toString}}) are no longer read.llmCallprompts, toolargumentsandthrowmessages still use plain text interpolation (not expressions).oneOf,forEachandevaluatorexist in editor shape (branches/inputFlow/subFlow) and executor shape (options/items/expression), so the union has two members per type.convertToFlowDefinitionmaps executor-shaped nodes to theunknownAgentplaceholder instead of throwing.FileSystemAdapterencodings narrowed to'utf8', which hand-written adapters withstringstill satisfy.test:typeswas vacuous:tsconfig.jsonexcludes*.test-d.tsand vitest's typecheck reported no errors even for an obvious type error. Addedtsconfig.test-d.jsonand runtsc -pon it first intest:types. I confirmed the newnode:fstest fails against the old adapter type.🤖 Generated with Claude Code