Repository navigation
feat(myra): deploy source is a bundled entry carrying her tool factories (CL-8457) - #889
Merged
Merged
Conversation
…ers parse (CL-8457) A bundled entry is code no reader can slice back apart, so every rendered tree now writes the definition's JSON projection beside workflow.js and readers parse that file instead of the entry module.
…ies (CL-8457) The stock deployments route passes no toolPackagePins, so the sidecar's source lineage resolves no manifest and runs only the step agent's own evaluated toolFactories - which were empty, leaving Myra with no tools at all. Her workflow entry now imports the eight pinned tool packages directly and is bundled into one self-contained ESM module the deploy pushes as workflow.js, with a trailing call supplying the per-deploy trigger address, prompt and inference sources.
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.
Why
Myra never gets tools. The stock
POST /workflows/deploymentsroute passes notoolPackagePins, soworkflow_run_launch_spec.tool_package_pinsis null, thesession service resolves no manifest, and the sidecar's source-deploy path
(
sourceTools === true) runs onlyreq.agent.toolFactoriesevaluated from thepushed
workflow.js. That entry was pure JSON withtoolFactories: []and pinsnothing ever read — an assistant with an empty tool surface.
What changed
agents/myra/src/index.tsis now the workflow entry: it imports the realfactories from the eight pinned tool packages (memory add/search/list,
capability, agent-directory, catalog, skills query + manage, interaction,
workflow-authoring, access) and builds the definition with
toolPackagePins: [].buildMyraWorkflowtakes the per-deploy values(trigger address, prompt, inference sources, turn timeout).
agents/myra/scripts/build-bundle.tsbundles that entry withBun.build(target bun, ESM, no externals, no minify, no sourcemaps) into
agents/myra/bundle/workflow-bundle.js(gitignored). It fails loud if anynon-builtin bare import survives. Wired as the package's
buildscript andrun from an
apps/webVite plugin'sbuildStart, sobun run dev,vite buildand the rootbun run buildall produce it before it is needed.@corbits/myra/bundleexposes the bundle text via Vite?raw;apps/web/src/myra-deploy.tsdynamic-imports it during setup only, so the~520 KB of entry text lands in its own lazy chunk rather than the app entry.
packages/workflowsgrowsrenderBundledWorkflowSourceTree: the entry is<bundle>\nexport default buildMyraWorkflow({...});. Every rendered tree(bundled or JSON) now also writes
definition.json, the function-freeprojection, and
readWorkflowSourceDefinition/parseWorkflowSourceDefinitionread that file.parseWorkflowSourceEntry(the strict entry slice) is gone — a bundle cannot be sliced.
apps/web/src/agent-source-read.tsandpackages/agent-directory(AGENT_DEFINITION_ENTRY_PATH→AGENT_DEFINITION_JSON_PATH,parseAgentDefinitionEntry→parseAgentDefinitionJson).apps/web/src/agent-deploy.ts) keep the JSON path.agents/myra/src/boundary.test.ts: its premise (shipped sourcesimport only
@intx/*) is false by design now that the entry imports toolpackages to be bundled.
definition.test.tsis rewritten to the two facts adeploy depends on — factories present and namespaced, still single-step.
Verification done
bunx tsc -p apps/web --noEmit,bun run typecheck,bun run lint,bun run fmt:check— clean.cd apps/web && bun run build— green; bundle lands in its ownbundle-*.jschunk, entry chunk unchanged.bun testforagents/myra,packages/workflows,packages/agent-directory,apps/web/src— all green.stepOrder: ["assistant"],toolPackagePins: [], and 11 tool factories(
@corbits/memory/add,…/search,…/list,@corbits/capability-tools/cap,@corbits/agent-directory-tools/ad,@corbits/catalog-tools/catalog,@corbits/skills-tools/skills-query,@corbits/skills-tools/skills,@corbits/interaction-tools/ask-user,@corbits/workflow_authoring/wf,@corbits/access-tools/access).How to verify live after merge
The running dev stack was not restarted (it serves
main), so this was notexercised against a live hub. After merge:
bun run dev, sign in, let the web client set the workbench up — the deploypushes the bundled
workflow.js.workflow.jsis ~520 KB of bundle endingin
export default buildMyraWorkflow({...}), withdefinition.jsonbeside it.tools?" (drives
request_capability) or "what do you remember about X?"(drives
memory_search).turn_partrows for a tool-call part — previously therewould be none for any prompt.