@engenty/wizards-runtime 0.20.5 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/apps/runtime/dist/agents/studio-assistant.js +7 -3
- package/apps/runtime/dist/agents/subscription.js +20 -25
- package/apps/runtime/dist/app.js +4 -1
- package/apps/runtime/dist/cli/clients.js +6 -24
- package/apps/runtime/dist/cli/connect.js +2 -1
- package/apps/runtime/dist/cli/environment.js +3 -0
- package/apps/runtime/dist/cli/machine.js +1 -70
- package/apps/runtime/dist/cli/main.js +2 -1
- package/apps/runtime/dist/cli/ollama.js +7 -254
- package/apps/runtime/dist/cli/setup.js +12 -9
- package/apps/runtime/dist/decision-model.js +1 -4
- package/apps/runtime/dist/docs/dev/licensing.md +20 -9
- package/apps/runtime/dist/docs/user-guide/command-line.md +5 -2
- package/apps/runtime/dist/elements/outside.js +2 -1
- package/apps/runtime/dist/engine/code-step.js +1 -1
- package/apps/runtime/dist/engine/decide.js +2 -2
- package/apps/runtime/dist/engine/device.js +3 -2
- package/apps/runtime/dist/engine/input.js +1 -1
- package/apps/runtime/dist/engine/runner.js +1 -1
- package/apps/runtime/dist/engine/steps.js +27 -8
- package/apps/runtime/dist/engine/surface.js +1 -1
- package/apps/runtime/dist/engine/template.js +1 -1
- package/apps/runtime/dist/env.js +1 -0
- package/apps/runtime/dist/harness/apple.js +4 -3
- package/apps/runtime/dist/harness/clients.js +117 -0
- package/apps/runtime/dist/harness/index.js +32 -87
- package/apps/runtime/dist/harness/model.js +32 -270
- package/apps/runtime/dist/harness/prompt.js +6 -120
- package/apps/runtime/dist/harness/types.js +5 -3
- package/apps/runtime/dist/local-call.js +6 -0
- package/apps/runtime/dist/local-models.js +53 -177
- package/apps/runtime/dist/mcp/bridge.js +12 -55
- package/apps/runtime/dist/mcp/elements.js +39 -4
- package/apps/runtime/dist/mcp/handler.js +12 -0
- package/apps/runtime/dist/mcp/run-pages.js +238 -0
- package/apps/runtime/dist/mcp/run-tasks.js +157 -0
- package/apps/runtime/dist/mcp/runs.js +129 -0
- package/apps/runtime/dist/mcp/tools.js +4 -95
- package/apps/runtime/dist/models.js +82 -32
- package/apps/runtime/dist/motion-graphics/step.js +2 -2
- package/apps/runtime/dist/prompts/mcp.md +4 -1
- package/apps/runtime/dist/render/downloads.js +1 -1
- package/apps/runtime/dist/render/shaped.js +1 -1
- package/apps/runtime/dist/routes/model-setup.js +77 -0
- package/apps/runtime/dist/routes/studio.js +8 -251
- package/apps/runtime/dist/services/space-categories.js +1 -1
- package/apps/runtime/dist/services/work-ai.js +11 -5
- package/apps/runtime/dist/texts.js +4 -6
- package/apps/runtime/dist/tools/connections.js +3 -0
- package/apps/runtime/dist/tools/harness.js +124 -0
- package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
- package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
- package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
- package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
- package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
- package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
- package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
- package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
- package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
- package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
- package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
- package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
- package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-CbvEK0rz.js → ReadOnly-13stkvNz.js} +1 -1
- package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
- package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
- package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
- package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
- package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
- package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
- package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
- package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
- package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
- package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
- package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
- package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
- package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
- package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
- package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
- package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
- package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
- package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
- package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
- package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
- package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
- package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
- package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
- package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
- package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
- package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
- package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
- package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
- package/apps/web/dist/index.html +18 -16
- package/apps/web/dist/mcp/flow.html +129 -129
- package/bin/bot-tunnel.mjs +375 -0
- package/bin/bot.mjs +494 -69
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
- package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
- package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
- package/node_modules/@engenty/chatviews/package.json +19 -0
- package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
- package/node_modules/@engenty/decision-model/dist/client.js +188 -0
- package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
- package/node_modules/@engenty/decision-model/dist/index.js +5 -0
- package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
- package/node_modules/@engenty/decision-model/dist/local.js +116 -0
- package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
- package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
- package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
- package/node_modules/@engenty/decision-model/dist/types.js +6 -0
- package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
- package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
- package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
- package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
- package/node_modules/@engenty/decision-model/package.json +9 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
- package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +72 -17
- package/node_modules/@engenty/local-models/dist/clients/chat.d.ts +89 -0
- package/node_modules/@engenty/local-models/dist/clients/chat.js +22 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.d.ts +32 -0
- package/node_modules/@engenty/local-models/dist/clients/claude.js +239 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +31 -0
- package/node_modules/@engenty/local-models/dist/clients/client.js +2 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.d.ts +35 -0
- package/node_modules/@engenty/local-models/dist/clients/codex.js +254 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +35 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +192 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.d.ts +18 -0
- package/node_modules/@engenty/local-models/dist/clients/detect.js +34 -0
- package/node_modules/@engenty/local-models/dist/clients/env.d.ts +66 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/env.js +62 -31
- package/node_modules/@engenty/local-models/dist/clients/failure.d.ts +26 -0
- package/node_modules/@engenty/local-models/dist/clients/failure.js +35 -0
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +15 -0
- package/node_modules/@engenty/local-models/dist/clients/index.js +18 -0
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +129 -0
- package/node_modules/@engenty/local-models/dist/clients/model.js +225 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.d.ts +36 -0
- package/node_modules/@engenty/local-models/dist/clients/prompt.js +123 -0
- package/node_modules/@engenty/local-models/dist/clients/run.d.ts +15 -0
- package/node_modules/@engenty/local-models/dist/clients/run.js +41 -0
- package/node_modules/@engenty/local-models/dist/index.d.ts +4 -0
- package/node_modules/@engenty/local-models/dist/index.js +4 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +37 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.js +147 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +302 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
- package/node_modules/@engenty/local-models/dist/probe.d.ts +57 -0
- package/node_modules/@engenty/local-models/dist/probe.js +174 -0
- package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
- package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
- package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
- package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
- package/node_modules/@engenty/local-models/package.json +16 -0
- package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
- package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
- package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
- package/node_modules/@engenty/model-setup/dist/index.js +3 -0
- package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
- package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
- package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
- package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
- package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
- package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
- package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
- package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
- package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
- package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
- package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
- package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
- package/node_modules/@engenty/model-setup/dist/types.js +2 -0
- package/node_modules/@engenty/model-setup/package.json +12 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
- package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
- package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
- package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
- package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
- package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
- package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
- package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/index.js +10 -0
- package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
- package/node_modules/@engenty/search-index/dist/payload.js +51 -0
- package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
- package/node_modules/@engenty/search-index/dist/registry.js +56 -0
- package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
- package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
- package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
- package/node_modules/@engenty/search-index/package.json +10 -0
- package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
- package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
- package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
- package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
- package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
- package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
- package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
- package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
- package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
- package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
- package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
- package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
- package/node_modules/@engenty/tool-harness/package.json +9 -0
- package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
- package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
- package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
- package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
- package/package.json +13 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/agents/chat-clients.js +0 -344
- package/apps/runtime/dist/harness/claude.js +0 -141
- package/apps/runtime/dist/harness/codex.js +0 -222
- package/apps/runtime/dist/harness/cursor.js +0 -89
- package/apps/runtime/dist/harness/terminal.js +0 -201
- package/apps/web/dist/assets/AboutDialog-DM_2-iLP.js +0 -1
- package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-DxRUERr-.js +0 -2
- package/apps/web/dist/assets/ChangelogDialog-Cyn3LAch.js +0 -1
- package/apps/web/dist/assets/ConnectorsSection-BYOrwccO.js +0 -1
- package/apps/web/dist/assets/EditorPage-BFUQzJpN.js +0 -3
- package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
- package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
- package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-DhmYe2C8.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-MGKJVDp2.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
- package/apps/web/dist/assets/ProtocolSection-B1MshkAx.js +0 -1
- package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
- package/apps/web/dist/assets/Results-DI4EHtkh.js +0 -1
- package/apps/web/dist/assets/RunDrawer-xXcbQ9wP.js +0 -1
- package/apps/web/dist/assets/SettingsPage-BcqqYDqw.js +0 -2
- package/apps/web/dist/assets/SetupPage-DG3fJ6fk.js +0 -1
- package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
- package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
- package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
- package/apps/web/dist/assets/SpacePage-CzQAEQj8.js +0 -2
- package/apps/web/dist/assets/StudioHome-DWTDTslp.js +0 -1
- package/apps/web/dist/assets/TableEditor-DirMDIGk.js +0 -7
- package/apps/web/dist/assets/UpdateCheck-C6GlE6Am.js +0 -2
- package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
- package/apps/web/dist/assets/changelog-CMovB3yB.js +0 -1
- package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
- package/apps/web/dist/assets/host-DNvnJXoi.js +0 -69
- package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
- package/apps/web/dist/assets/index-D1iL3986.css +0 -1
- package/apps/web/dist/assets/index-DOq0CvXM.js +0 -102
- package/apps/web/dist/assets/oss-credits-C4SGbRkz.js +0 -1
- package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
- package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
- package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
- /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The ways to a decision model. All of them take the same System One request
|
|
2
|
+
// and differ only in address, key and model name: Jev through the Vercel AI
|
|
3
|
+
// Gateway, Jev on TypeSafe's own API, or Clef-flash (or Clef) in Ollama.
|
|
4
|
+
import { AI_GATEWAY_API_KEY_ENV, DEFAULT_TYPESAFE_BASE_URL, DEFAULT_TYPESAFE_MODEL, TYPESAFE_API_KEY_ENV, TypeSafeClient, VERCEL_JEV_MODEL, VERCEL_TYPESAFE_BASE_URL, } from "./client.js";
|
|
5
|
+
import { localWay } from "./local.js";
|
|
6
|
+
export const OLLAMA_BASE_URL_ENV = "OLLAMA_BASE_URL";
|
|
7
|
+
/** The ways, in the order `auto` tries them. */
|
|
8
|
+
export const DECISION_WAYS = ["gateway", "typesafe", "local"];
|
|
9
|
+
export const DECISION_CHOICES = ["auto", ...DECISION_WAYS, "off"];
|
|
10
|
+
/** The env slice the package reads, from a `process.env`-like reader. */
|
|
11
|
+
export function decisionEnvFrom(readEnv = (key) => globalThis.process?.env?.[key]) {
|
|
12
|
+
return {
|
|
13
|
+
gatewayKey: readEnv(AI_GATEWAY_API_KEY_ENV),
|
|
14
|
+
ollamaUrl: readEnv(OLLAMA_BASE_URL_ENV),
|
|
15
|
+
typesafeKey: readEnv(TYPESAFE_API_KEY_ENV),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function keyed(way, key, baseUrl, model) {
|
|
19
|
+
return (_env, options = {}) => {
|
|
20
|
+
const apiKey = key?.trim();
|
|
21
|
+
if (!apiKey) {
|
|
22
|
+
return Promise.resolve(null);
|
|
23
|
+
}
|
|
24
|
+
const client = new TypeSafeClient({ apiKey, baseUrl, model, ...options });
|
|
25
|
+
return Promise.resolve({
|
|
26
|
+
way,
|
|
27
|
+
model,
|
|
28
|
+
systemOne: (request) => client.systemOne(request),
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const gatewayWay = {
|
|
33
|
+
way: "gateway",
|
|
34
|
+
open: (env, options) => keyed("gateway", env.gatewayKey, VERCEL_TYPESAFE_BASE_URL, VERCEL_JEV_MODEL)(env, options),
|
|
35
|
+
};
|
|
36
|
+
const typesafeWay = {
|
|
37
|
+
way: "typesafe",
|
|
38
|
+
open: (env, options) => keyed("typesafe", env.typesafeKey, DEFAULT_TYPESAFE_BASE_URL, DEFAULT_TYPESAFE_MODEL)(env, options),
|
|
39
|
+
};
|
|
40
|
+
const BUILT_IN = {
|
|
41
|
+
gateway: gatewayWay,
|
|
42
|
+
local: localWay,
|
|
43
|
+
typesafe: typesafeWay,
|
|
44
|
+
};
|
|
45
|
+
/** The decision model one way reaches; null where that way has none. */
|
|
46
|
+
export function decisionBy(way, env, options) {
|
|
47
|
+
return BUILT_IN[way].open(env, options);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The decision model a choice names: `auto` is the first way that opens, the
|
|
51
|
+
* built-in ones in order, then the host's `extra`; `off` and a way that has
|
|
52
|
+
* none are null. What follows null is the host's.
|
|
53
|
+
*/
|
|
54
|
+
export async function decisionOf(choice, env, extra = [], options) {
|
|
55
|
+
if (choice === "off") {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const ways = [...DECISION_WAYS.map((w) => BUILT_IN[w]), ...extra];
|
|
59
|
+
for (const way of choice === "auto" ? ways : ways.filter((w) => w.way === choice)) {
|
|
60
|
+
const found = await way.open(env, options);
|
|
61
|
+
if (found) {
|
|
62
|
+
return found;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/** Which ways have a decision model now: for a settings page. */
|
|
68
|
+
export async function decisionReady(env, extra = [], options) {
|
|
69
|
+
const ways = [...DECISION_WAYS.map((w) => BUILT_IN[w]), ...extra];
|
|
70
|
+
const found = await Promise.all(ways.map(async (w) => [w.way, Boolean(await w.open(env, options))]));
|
|
71
|
+
return Object.fromEntries(found);
|
|
72
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type CallToolResult } from "@modelcontextprotocol/server";
|
|
2
|
+
import type { Bridge, BridgeTool } from "../clients/model.js";
|
|
3
|
+
/**
|
|
4
|
+
* The tools of one model call or one turn, served over MCP to an installed client (Claude Code,
|
|
5
|
+
* Codex, Cursor Agent) while it answers. Each open bridge has a token; the host mounts one route
|
|
6
|
+
* that answers them all and takes the token from the path or from the bearer header. A bridge
|
|
7
|
+
* opens with its call or turn and closes with it: a closed token is not found.
|
|
8
|
+
*
|
|
9
|
+
* Only MCP happens here: list the tools, call one, turn its result into MCP content. What a person
|
|
10
|
+
* sees of a call (an activity line, a card that asks, a held approval) is the host's, in the
|
|
11
|
+
* tool's `execute`.
|
|
12
|
+
*/
|
|
13
|
+
export type { Bridge, BridgeTool } from "../clients/model.js";
|
|
14
|
+
/** One open bridge: its token and how to close it. */
|
|
15
|
+
export interface OpenBridge {
|
|
16
|
+
token: string;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A tool's result as MCP content. With `toModelOutput`, what it shapes: `text`, `json`, `content`
|
|
21
|
+
* (text and pictures), `error-text` and `error-json` as a failed result. Without it, a string as
|
|
22
|
+
* text and anything else as JSON.
|
|
23
|
+
*/
|
|
24
|
+
export declare function contentOf(tool: Pick<BridgeTool, "toModelOutput">, output: unknown): CallToolResult;
|
|
25
|
+
/** The bearer token of a request, or an empty string. */
|
|
26
|
+
export declare function bearerOf(request: Request): string;
|
|
27
|
+
/** The bridges a host has open, and the one route that answers them all. */
|
|
28
|
+
export declare class Bridges {
|
|
29
|
+
private readonly open_;
|
|
30
|
+
private readonly name;
|
|
31
|
+
private readonly version;
|
|
32
|
+
constructor(options?: {
|
|
33
|
+
name?: string;
|
|
34
|
+
version?: string;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Opens the tools of one call or turn. `token`: the host's own; left out, 24 random bytes. The
|
|
38
|
+
* tools run in the async context of the code that opens the bridge (its tenant, its person),
|
|
39
|
+
* however the client's requests arrive.
|
|
40
|
+
*/
|
|
41
|
+
open(tools: BridgeTool[], options?: {
|
|
42
|
+
token?: string;
|
|
43
|
+
}): OpenBridge;
|
|
44
|
+
/**
|
|
45
|
+
* Answers one MCP request of an open bridge. The token is `token` where the host took it from
|
|
46
|
+
* the path, else the request's bearer. A closed or unknown token is not found.
|
|
47
|
+
*/
|
|
48
|
+
fetch(request: Request, token?: string): Promise<Response>;
|
|
49
|
+
/**
|
|
50
|
+
* The `bridge` of ClientModel: each call opens its tools at `<baseUrl>/<token>`, for clients
|
|
51
|
+
* that take a URL and no header. The host routes `<baseUrl>/:token` to `fetch`.
|
|
52
|
+
*/
|
|
53
|
+
at(baseUrl: string): Bridge;
|
|
54
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { createMcpHandler, fromJsonSchema, McpServer, } from "@modelcontextprotocol/server";
|
|
4
|
+
const textOf = (value) => typeof value === "string" ? value : JSON.stringify(value ?? null);
|
|
5
|
+
/** One part of a tool's `content` output as an MCP block: text, or a picture. */
|
|
6
|
+
function blockOf(part) {
|
|
7
|
+
if (part.type === "text") {
|
|
8
|
+
return { type: "text", text: part.text ?? "" };
|
|
9
|
+
}
|
|
10
|
+
if ((part.type === "image-data" || part.type === "file-data" || part.type === "media") &&
|
|
11
|
+
(part.type === "image-data" || part.mediaType?.startsWith("image/"))) {
|
|
12
|
+
return { type: "image", data: part.data ?? "", mimeType: part.mediaType ?? "image/png" };
|
|
13
|
+
}
|
|
14
|
+
return { type: "text", text: textOf(part) };
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A tool's result as MCP content. With `toModelOutput`, what it shapes: `text`, `json`, `content`
|
|
18
|
+
* (text and pictures), `error-text` and `error-json` as a failed result. Without it, a string as
|
|
19
|
+
* text and anything else as JSON.
|
|
20
|
+
*/
|
|
21
|
+
export function contentOf(tool, output) {
|
|
22
|
+
const shaped = (tool.toModelOutput?.(output) ?? undefined);
|
|
23
|
+
if (!shaped || typeof shaped !== "object" || !("type" in shaped)) {
|
|
24
|
+
return { content: [{ type: "text", text: textOf(output) }] };
|
|
25
|
+
}
|
|
26
|
+
switch (shaped.type) {
|
|
27
|
+
case "content":
|
|
28
|
+
return { content: (shaped.value ?? []).map(blockOf) };
|
|
29
|
+
case "error-text":
|
|
30
|
+
case "error-json":
|
|
31
|
+
return { isError: true, content: [{ type: "text", text: textOf(shaped.value) }] };
|
|
32
|
+
case "text":
|
|
33
|
+
case "json":
|
|
34
|
+
return { content: [{ type: "text", text: textOf(shaped.value) }] };
|
|
35
|
+
default:
|
|
36
|
+
return { content: [{ type: "text", text: textOf(output) }] };
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const notFound = () => Response.json({ jsonrpc: "2.0", id: null, error: { code: -32001, message: "This call is over." } }, { status: 404 });
|
|
40
|
+
/** The bearer token of a request, or an empty string. */
|
|
41
|
+
export function bearerOf(request) {
|
|
42
|
+
const header = request.headers.get("authorization") ?? "";
|
|
43
|
+
return /^bearer\s+/i.test(header) ? header.replace(/^bearer\s+/i, "").trim() : "";
|
|
44
|
+
}
|
|
45
|
+
/** The bridges a host has open, and the one route that answers them all. */
|
|
46
|
+
export class Bridges {
|
|
47
|
+
open_ = new Map();
|
|
48
|
+
name;
|
|
49
|
+
version;
|
|
50
|
+
constructor(options = {}) {
|
|
51
|
+
this.name = options.name ?? "step";
|
|
52
|
+
this.version = options.version ?? "1";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Opens the tools of one call or turn. `token`: the host's own; left out, 24 random bytes. The
|
|
56
|
+
* tools run in the async context of the code that opens the bridge (its tenant, its person),
|
|
57
|
+
* however the client's requests arrive.
|
|
58
|
+
*/
|
|
59
|
+
open(tools, options = {}) {
|
|
60
|
+
const token = options.token ?? randomBytes(24).toString("base64url");
|
|
61
|
+
const inCall = AsyncLocalStorage.snapshot();
|
|
62
|
+
const closed = new AbortController();
|
|
63
|
+
const handler = createMcpHandler(() => {
|
|
64
|
+
const server = new McpServer({ name: this.name, version: this.version }, { capabilities: { tools: {} } });
|
|
65
|
+
for (const tool of tools) {
|
|
66
|
+
server.registerTool(tool.name, {
|
|
67
|
+
description: tool.description,
|
|
68
|
+
inputSchema: fromJsonSchema(tool.inputSchema),
|
|
69
|
+
}, (async (args, ctx) => {
|
|
70
|
+
const signal = ctx?.mcpReq?.signal
|
|
71
|
+
? AbortSignal.any([closed.signal, ctx.mcpReq.signal])
|
|
72
|
+
: closed.signal;
|
|
73
|
+
try {
|
|
74
|
+
return contentOf(tool, await inCall(() => tool.execute(args, { signal })));
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
return {
|
|
78
|
+
isError: true,
|
|
79
|
+
content: [{ type: "text", text: err?.message ?? String(err) }],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
return server;
|
|
85
|
+
}, { legacy: "stateless" });
|
|
86
|
+
this.open_.set(token, { handler, closed });
|
|
87
|
+
return {
|
|
88
|
+
token,
|
|
89
|
+
close: () => {
|
|
90
|
+
const entry = this.open_.get(token);
|
|
91
|
+
if (entry) {
|
|
92
|
+
this.open_.delete(token);
|
|
93
|
+
entry.closed.abort();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Answers one MCP request of an open bridge. The token is `token` where the host took it from
|
|
100
|
+
* the path, else the request's bearer. A closed or unknown token is not found.
|
|
101
|
+
*/
|
|
102
|
+
fetch(request, token) {
|
|
103
|
+
const entry = this.open_.get(token ?? bearerOf(request));
|
|
104
|
+
return entry ? entry.handler.fetch(request) : Promise.resolve(notFound());
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The `bridge` of ClientModel: each call opens its tools at `<baseUrl>/<token>`, for clients
|
|
108
|
+
* that take a URL and no header. The host routes `<baseUrl>/:token` to `fetch`.
|
|
109
|
+
*/
|
|
110
|
+
at(baseUrl) {
|
|
111
|
+
const base = baseUrl.replace(/\/+$/, "");
|
|
112
|
+
return (tools) => {
|
|
113
|
+
const bridge = this.open(tools);
|
|
114
|
+
return { url: `${base}/${bridge.token}`, close: bridge.close };
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Client } from "./client.js";
|
|
2
|
+
import { type Effort } from "./model.js";
|
|
3
|
+
/**
|
|
4
|
+
* Antigravity CLI: `agy` answers on the Google sign-in it cached — the Google AI subscription,
|
|
5
|
+
* which Gemini CLI no longer serves. The prompt goes on stdin as one stream-json message, the
|
|
6
|
+
* instructions in front of it: the client reads no system prompt and no rules of a folder it
|
|
7
|
+
* does not trust. It searches the web and reads the call's files with its own tools; the step's
|
|
8
|
+
* tools it cannot take, as it reads MCP servers only from the person's own config. The answer
|
|
9
|
+
* is checked against the schema by the client itself.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AGY_BIN: string;
|
|
12
|
+
/**
|
|
13
|
+
* The model of that name at the effort a call asks for: the models carry their effort in the
|
|
14
|
+
* name, `gemini-3.8-flash-<low|medium|high>`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function withEffort(model: string, effort?: Effort): string;
|
|
17
|
+
/** The `result` event of `agy --output-format stream-json`. */
|
|
18
|
+
export interface AntigravityResult {
|
|
19
|
+
conversation_id?: string;
|
|
20
|
+
status?: string;
|
|
21
|
+
response?: string;
|
|
22
|
+
error?: string;
|
|
23
|
+
structured_output?: unknown;
|
|
24
|
+
num_turns?: number;
|
|
25
|
+
duration_seconds?: number;
|
|
26
|
+
usage?: {
|
|
27
|
+
input_tokens?: number;
|
|
28
|
+
output_tokens?: number;
|
|
29
|
+
thinking_tokens?: number;
|
|
30
|
+
cache_read_tokens?: number;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/** The client's result among the events it prints; null when it printed none. */
|
|
34
|
+
export declare function antigravityAnswer(stdout: string): AntigravityResult | null;
|
|
35
|
+
/** The instructions in front of the prompt: the client takes one message and nothing besides. */
|
|
36
|
+
export declare function antigravityMessage(system: string, request: string): string;
|
|
37
|
+
export declare const antigravity: Client;
|
package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js
RENAMED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
+
import { parseLine } from "./chat.js";
|
|
3
4
|
import { probeVersion, resolveEnv, run } from "./env.js";
|
|
4
|
-
import {
|
|
5
|
+
import { clientFailure } from "./failure.js";
|
|
6
|
+
import { ClientModel } from "./model.js";
|
|
7
|
+
import { runClient } from "./run.js";
|
|
5
8
|
/**
|
|
6
9
|
* Antigravity CLI: `agy` answers on the Google sign-in it cached — the Google AI subscription,
|
|
7
10
|
* which Gemini CLI no longer serves. The prompt goes on stdin as one stream-json message, the
|
|
@@ -11,14 +14,10 @@ import { failureOf, HarnessModel, runClient, } from "./model.js";
|
|
|
11
14
|
* is checked against the schema by the client itself.
|
|
12
15
|
*/
|
|
13
16
|
export const AGY_BIN = process.env.AGY_BIN?.trim() || "agy";
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
standard: "gemini-3.8-flash-high",
|
|
19
|
-
high: "gemini-3.8-flash-high",
|
|
20
|
-
};
|
|
21
|
-
/** The model of that name at the effort a step asks for, where the name carries one. */
|
|
17
|
+
/**
|
|
18
|
+
* The model of that name at the effort a call asks for: the models carry their effort in the
|
|
19
|
+
* name, `gemini-3.8-flash-<low|medium|high>`.
|
|
20
|
+
*/
|
|
22
21
|
export function withEffort(model, effort) {
|
|
23
22
|
return effort ? model.replace(/-(low|medium|high)$/, `-${effort}`) : model;
|
|
24
23
|
}
|
|
@@ -58,22 +57,21 @@ export function antigravityMessage(system, request) {
|
|
|
58
57
|
const content = system ? `<instructions>\n${system}\n</instructions>\n\n${request}` : request;
|
|
59
58
|
return `${JSON.stringify({ event: "user", message: { content } })}\n`;
|
|
60
59
|
}
|
|
61
|
-
class AntigravityModel extends
|
|
60
|
+
class AntigravityModel extends ClientModel {
|
|
62
61
|
provider = "antigravity";
|
|
63
62
|
nativeSchema = true;
|
|
64
63
|
usesTools = false;
|
|
65
64
|
async invoke(call) {
|
|
66
65
|
const { env, auth } = await resolveEnv(spec);
|
|
67
66
|
if (auth === "none") {
|
|
68
|
-
throw
|
|
67
|
+
throw clientFailure(this.client, "not logged in");
|
|
69
68
|
}
|
|
70
69
|
const args = [
|
|
71
70
|
"--input-format",
|
|
72
71
|
"stream-json",
|
|
73
72
|
"--output-format",
|
|
74
73
|
"stream-json",
|
|
75
|
-
"--model",
|
|
76
|
-
withEffort(this.modelId, call.effort),
|
|
74
|
+
...(this.modelId === "default" ? [] : ["--model", withEffort(this.modelId, call.effort)]),
|
|
77
75
|
"--disable-slash-commands",
|
|
78
76
|
];
|
|
79
77
|
if (call.schema) {
|
|
@@ -89,10 +87,10 @@ class AntigravityModel extends HarnessModel {
|
|
|
89
87
|
});
|
|
90
88
|
const result = antigravityAnswer(stdout);
|
|
91
89
|
if (!result) {
|
|
92
|
-
throw
|
|
90
|
+
throw clientFailure(this.client, stderr.trim() || `exit ${code}`);
|
|
93
91
|
}
|
|
94
92
|
if (result.status !== "SUCCESS") {
|
|
95
|
-
throw
|
|
93
|
+
throw clientFailure(this.client, result.error || stderr.trim() || result.status || "error");
|
|
96
94
|
}
|
|
97
95
|
const u = result.usage ?? {};
|
|
98
96
|
return {
|
|
@@ -109,13 +107,70 @@ class AntigravityModel extends HarnessModel {
|
|
|
109
107
|
};
|
|
110
108
|
}
|
|
111
109
|
}
|
|
110
|
+
/** In a chat it only writes: no command, no file, no page, none of the person's own MCP servers. */
|
|
111
|
+
const CHAT_SETTINGS = JSON.stringify({
|
|
112
|
+
permissions: {
|
|
113
|
+
deny: [
|
|
114
|
+
"command(*)",
|
|
115
|
+
"read_file(*)",
|
|
116
|
+
"write_file(*)",
|
|
117
|
+
"read_url(*)",
|
|
118
|
+
"execute_url(*)",
|
|
119
|
+
"download_url(*)",
|
|
120
|
+
"mcp(*)",
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
});
|
|
112
124
|
export const antigravity = {
|
|
113
125
|
...spec,
|
|
126
|
+
id: "antigravity",
|
|
114
127
|
name: "Antigravity",
|
|
115
128
|
bin: AGY_BIN,
|
|
116
|
-
|
|
129
|
+
tools: false,
|
|
117
130
|
version: (env) => probeVersion(AGY_BIN, env, (stdout) => stdout.trim().split("\n").pop()?.trim() || null),
|
|
118
131
|
// No login command: the client asks for the Google sign-in when it starts without one.
|
|
119
132
|
login: { args: [], interactive: true },
|
|
120
|
-
model: (alias,
|
|
133
|
+
model: (alias, options) => new AntigravityModel(antigravity, alias || "default", options),
|
|
134
|
+
args: (call) => [
|
|
135
|
+
"--input-format",
|
|
136
|
+
"stream-json",
|
|
137
|
+
"--output-format",
|
|
138
|
+
"stream-json",
|
|
139
|
+
"--disable-slash-commands",
|
|
140
|
+
"--mode",
|
|
141
|
+
"plan",
|
|
142
|
+
"--settings",
|
|
143
|
+
CHAT_SETTINGS,
|
|
144
|
+
...(call.model ? ["--model", call.model] : []),
|
|
145
|
+
...(call.session ? ["--conversation", call.session] : []),
|
|
146
|
+
],
|
|
147
|
+
// A conversation it continues has read the instructions.
|
|
148
|
+
stdin: (call) => antigravityMessage(call.session ? "" : call.system, call.message),
|
|
149
|
+
events(line) {
|
|
150
|
+
const event = parseLine(line);
|
|
151
|
+
const out = [];
|
|
152
|
+
if (event?.event === "init" && event.conversation_id) {
|
|
153
|
+
out.push({ kind: "session", id: event.conversation_id });
|
|
154
|
+
}
|
|
155
|
+
else if (event?.event === "step_update") {
|
|
156
|
+
const { step_type, text_delta } = event.step_update ?? {};
|
|
157
|
+
if (step_type === "agent_response" && text_delta) {
|
|
158
|
+
out.push({ kind: "writing", text: text_delta });
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
else if (event?.event === "result" && event.result) {
|
|
162
|
+
const { conversation_id, status, error, response } = event.result;
|
|
163
|
+
if (conversation_id) {
|
|
164
|
+
out.push({ kind: "session", id: conversation_id });
|
|
165
|
+
}
|
|
166
|
+
if (status !== "SUCCESS") {
|
|
167
|
+
out.push({ kind: "failure", detail: error || status || "error" });
|
|
168
|
+
}
|
|
169
|
+
else if (response) {
|
|
170
|
+
out.push({ kind: "result", text: response });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
return out;
|
|
174
|
+
},
|
|
175
|
+
signedOut: (detail) => /authenticat|log ?in|logged in|sign in|unauthori[sz]ed|\b401\b/i.test(detail),
|
|
121
176
|
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an installed client answers one turn of a chat: the command line, what goes on stdin, and
|
|
3
|
+
* what its output lines mean. The client reaches only the host's MCP server, under the name the
|
|
4
|
+
* host gives it, and keeps the conversation itself; the host keeps the id it reports.
|
|
5
|
+
*/
|
|
6
|
+
/** The host's MCP server for a turn. */
|
|
7
|
+
export interface ChatMcp {
|
|
8
|
+
/** The name the client knows the server by: its tools are `mcp__<name>__…` to Claude Code. */
|
|
9
|
+
name: string;
|
|
10
|
+
url: string;
|
|
11
|
+
/** Codex: the environment variable it reads the bearer key from; the host sets it for the turn. */
|
|
12
|
+
keyVar: string;
|
|
13
|
+
/** Claude Code: the MCP config file with the server and its key. */
|
|
14
|
+
configFile?: string;
|
|
15
|
+
}
|
|
16
|
+
/** What one turn hands the client. */
|
|
17
|
+
export interface ChatCall {
|
|
18
|
+
/** The instructions the client works by. */
|
|
19
|
+
system: string;
|
|
20
|
+
message: string;
|
|
21
|
+
/** The conversation to continue, as the client named it last time. */
|
|
22
|
+
session: string | null;
|
|
23
|
+
/** The folder the client runs in: Claude's MCP config, Cursor's workspace. */
|
|
24
|
+
dir: string;
|
|
25
|
+
/** The model the client runs, by its own name: left out, the client picks. */
|
|
26
|
+
model?: string;
|
|
27
|
+
/** The host's MCP server. Left out, the turn has no tools at all: a call that only writes text. */
|
|
28
|
+
mcp?: ChatMcp;
|
|
29
|
+
/** The pictures pasted with the message: base64 for Claude, files for Codex. */
|
|
30
|
+
images: {
|
|
31
|
+
mime: string;
|
|
32
|
+
base64: string;
|
|
33
|
+
file: string;
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
36
|
+
/** What one line of the client's output says. */
|
|
37
|
+
export type ChatEvent = {
|
|
38
|
+
kind: "text";
|
|
39
|
+
text: string;
|
|
40
|
+
} | {
|
|
41
|
+
kind: "tool";
|
|
42
|
+
name: string;
|
|
43
|
+
args: Record<string, unknown>;
|
|
44
|
+
started: boolean;
|
|
45
|
+
}
|
|
46
|
+
/** A tool has answered; `issues` is how many it found, if its answer speaks of them. */
|
|
47
|
+
| {
|
|
48
|
+
kind: "toolDone";
|
|
49
|
+
issues?: number;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The model is writing text this client hands over whole later on: for the turn's clock, and
|
|
53
|
+
* the piece itself where the client streams it.
|
|
54
|
+
*/
|
|
55
|
+
| {
|
|
56
|
+
kind: "writing";
|
|
57
|
+
text?: string;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "thinkingStart";
|
|
60
|
+
}
|
|
61
|
+
/** `whole`: the client gives its reasoning once that is done, not as it streams. */
|
|
62
|
+
| {
|
|
63
|
+
kind: "thinking";
|
|
64
|
+
text: string;
|
|
65
|
+
whole?: boolean;
|
|
66
|
+
} | {
|
|
67
|
+
kind: "session";
|
|
68
|
+
id: string;
|
|
69
|
+
} | {
|
|
70
|
+
kind: "failure";
|
|
71
|
+
detail: string;
|
|
72
|
+
}
|
|
73
|
+
/** The client's own summary of the answer, used where no text came before it. */
|
|
74
|
+
| {
|
|
75
|
+
kind: "result";
|
|
76
|
+
text: string;
|
|
77
|
+
};
|
|
78
|
+
/** A client as a chat: its command line and how to read it. */
|
|
79
|
+
export interface ChatClient {
|
|
80
|
+
args(call: ChatCall): string[];
|
|
81
|
+
stdin(call: ChatCall): string;
|
|
82
|
+
events(line: string): ChatEvent[];
|
|
83
|
+
/** Whether a failure the client reports means its sign-in is missing or expired. */
|
|
84
|
+
signedOut(detail: string): boolean;
|
|
85
|
+
}
|
|
86
|
+
export declare function parseLine(line: string): any;
|
|
87
|
+
export declare const record: (v: unknown) => Record<string, unknown>;
|
|
88
|
+
/** How many issues a tool's answer names; nothing where the answer does not speak of them. */
|
|
89
|
+
export declare function issuesIn(text: unknown): number | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How an installed client answers one turn of a chat: the command line, what goes on stdin, and
|
|
3
|
+
* what its output lines mean. The client reaches only the host's MCP server, under the name the
|
|
4
|
+
* host gives it, and keeps the conversation itself; the host keeps the id it reports.
|
|
5
|
+
*/
|
|
6
|
+
export function parseLine(line) {
|
|
7
|
+
try {
|
|
8
|
+
return JSON.parse(line);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export const record = (v) => v && typeof v === "object" ? v : {};
|
|
15
|
+
/** How many issues a tool's answer names; nothing where the answer does not speak of them. */
|
|
16
|
+
export function issuesIn(text) {
|
|
17
|
+
if (typeof text !== "string" || !text.includes('"issues"')) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const issues = parseLine(text)?.issues;
|
|
21
|
+
return Array.isArray(issues) ? issues.length : undefined;
|
|
22
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Client } from "./client.js";
|
|
2
|
+
import { type ClientAnswer } from "./model.js";
|
|
3
|
+
/**
|
|
4
|
+
* Claude Code: `claude -p` answers on the person's sign-in — the client's keychain, or the key
|
|
5
|
+
* or token their login shell sets. Tools go over MCP; structured output is validated by the
|
|
6
|
+
* client (`--json-schema`); web search is its own tool.
|
|
7
|
+
*/
|
|
8
|
+
export declare const CLAUDE_BIN: string;
|
|
9
|
+
/** What the client prints last with `--output-format json`. */
|
|
10
|
+
export interface ClaudeResult {
|
|
11
|
+
type?: string;
|
|
12
|
+
/** On a failure: why, e.g. error_max_turns, error_during_execution. */
|
|
13
|
+
subtype?: string;
|
|
14
|
+
is_error?: boolean;
|
|
15
|
+
/** On a failure: what went wrong, where the client says. */
|
|
16
|
+
errors?: unknown[];
|
|
17
|
+
result?: unknown;
|
|
18
|
+
structured_output?: unknown;
|
|
19
|
+
session_id?: string;
|
|
20
|
+
stop_reason?: string;
|
|
21
|
+
total_cost_usd?: number;
|
|
22
|
+
num_turns?: number;
|
|
23
|
+
usage?: {
|
|
24
|
+
input_tokens?: number;
|
|
25
|
+
output_tokens?: number;
|
|
26
|
+
cache_read_input_tokens?: number;
|
|
27
|
+
cache_creation_input_tokens?: number;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/** The client's result as the model call wants it: text (or the structured output as JSON) and usage. */
|
|
31
|
+
export declare function claudeAnswer(event: ClaudeResult): ClientAnswer;
|
|
32
|
+
export declare const claude: Client;
|