@engenty/wizards-runtime 0.20.6 → 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 +4 -17
- 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 +1 -179
- package/apps/runtime/dist/cli/setup.js +8 -6
- package/apps/runtime/dist/docs/dev/licensing.md +15 -9
- package/apps/runtime/dist/docs/user-guide/command-line.md +3 -0
- 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/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/clients.js +10 -1
- package/apps/runtime/dist/harness/index.js +15 -69
- package/apps/runtime/dist/harness/types.js +3 -2
- package/apps/runtime/dist/local-call.js +6 -0
- package/apps/runtime/dist/local-models.js +53 -157
- 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 +74 -27
- 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 +10 -4
- 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-CO3ndR23.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/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 +68 -17
- package/node_modules/@engenty/local-models/dist/clients/claude.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +3 -1
- package/node_modules/@engenty/local-models/dist/clients/client.js +1 -1
- package/node_modules/@engenty/local-models/dist/clients/codex.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +13 -1
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/clients/index.js +4 -2
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +4 -1
- package/node_modules/@engenty/local-models/dist/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/index.js +2 -1
- 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 +4 -37
- package/node_modules/@engenty/local-models/dist/ollama/api.js +1 -18
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +1 -1
- 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 +11 -8
- package/node_modules/@engenty/local-models/dist/probe.js +16 -32
- 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 +5 -1
- 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 +11 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/harness/terminal.js +0 -201
- package/apps/web/dist/assets/AboutDialog-BRUwrfQH.js +0 -1
- package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-C30knXsS.js +0 -2
- package/apps/web/dist/assets/ChangelogDialog-BkZQOAdl.js +0 -1
- package/apps/web/dist/assets/ConnectorsSection-CmXQD7zu.js +0 -1
- package/apps/web/dist/assets/EditorPage-LEbyNWmG.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-CSn-9zHr.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-B4wPfClS.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
- package/apps/web/dist/assets/ProtocolSection-s4mEL_pu.js +0 -1
- package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
- package/apps/web/dist/assets/Results-CC1-mElv.js +0 -1
- package/apps/web/dist/assets/RunDrawer-DkmSXhad.js +0 -1
- package/apps/web/dist/assets/SettingsPage-DKs_fkNL.js +0 -2
- package/apps/web/dist/assets/SetupPage-RvmKCzF2.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-aZqYFttF.js +0 -2
- package/apps/web/dist/assets/StudioHome-Doua9Lyl.js +0 -1
- package/apps/web/dist/assets/TableEditor-Dbq3HZZS.js +0 -7
- package/apps/web/dist/assets/UpdateCheck-B7etUbUf.js +0 -2
- package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
- package/apps/web/dist/assets/changelog-BW79cVbx.js +0 -1
- package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
- package/apps/web/dist/assets/host-BXSxBoOH.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-kDKA6ddy.js +0 -102
- package/apps/web/dist/assets/oss-credits-B3PXhamW.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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { readNumber } from "@engenty/chatviews/numbers";
|
|
1
2
|
import { isDecidedField, isLang, isLocationValue, MAX_FILES, offeredSlot, shownFields, } from "@engenty/wizards-shared/definition";
|
|
2
|
-
import { readNumber } from "@engenty/wizards-shared/numbers";
|
|
3
3
|
import { note, saidText } from "@engenty/wizards-shared/run";
|
|
4
4
|
/** The field errors in a language, for whoever reads them. */
|
|
5
5
|
export function fieldErrorsIn(errors, lang) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
+
import { fitData } from "@engenty/chatviews/shape";
|
|
3
4
|
import { marginOf, } from "@engenty/wizards-shared/decision";
|
|
4
5
|
import { allFields, branchValues, cardsFromData, conditionMatches, dataRef, followRules, formatsFor, formNeeds, isDataStep, isDecidedField, LIST_FORMATS, listRef, MAX_SHOWN_FIELDS, optionsFromData, outputOf, RUN_DONE_SIGNAL, sectionOf, sectionsOf, signalMissing, textLang, waitDurationMs, whenCalc, whenNames, whenValue, wizardLang, } from "@engenty/wizards-shared/definition";
|
|
5
6
|
import { agentsMismatch, requiresOf, withRequires } from "@engenty/wizards-shared/requires";
|
|
6
7
|
import { CAN_GO_BACK, isNoteTime, note, RUN_ENDED, saidText, } from "@engenty/wizards-shared/run";
|
|
7
8
|
import { CONVERSATION_RUNNERS, DEFAULT_RUNNER_SETTINGS } from "@engenty/wizards-shared/runners";
|
|
8
|
-
import { fitData } from "@engenty/wizards-shared/shape";
|
|
9
9
|
import { FlowRefused, transition, } from "@engenty/wizards-shared/transition";
|
|
10
10
|
import { machineTranslated, translateDefinition } from "@engenty/wizards-shared/translation";
|
|
11
11
|
import { wizardAgentsUsed } from "@engenty/wizards-shared/wizard-code";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import { fitData, labelOf, recordsOf, shapeJsonSchema, shapeLines, shapeZod, titleKey, } from "@engenty/chatviews/shape";
|
|
2
|
+
import { validateSurface } from "@engenty/chatviews/surface";
|
|
1
3
|
import { pOf } from "@engenty/wizards-shared/decision";
|
|
2
4
|
import { allFields, classIdOf, dataRef, decisionAsAgent, langNameEn, localeOf, stepShape, templateRefs, textClassOf, wizardLang, } from "@engenty/wizards-shared/definition";
|
|
3
5
|
import { note as runNote } from "@engenty/wizards-shared/run";
|
|
4
|
-
import { fitData, labelOf, recordsOf, shapeJsonSchema, shapeLines, shapeZod, titleKey, } from "@engenty/wizards-shared/shape";
|
|
5
6
|
import { mainLogo, ruleLines, runTheme } from "@engenty/wizards-shared/spaces";
|
|
6
|
-
import { validateSurface, } from "@engenty/wizards-shared/surface";
|
|
7
7
|
import { Agent } from "@mastra/core/agent";
|
|
8
8
|
import { generateText, jsonSchema, Output, parsePartialJson } from "ai";
|
|
9
9
|
import { subjectsOf } from "../broker/rwx.js";
|
|
10
10
|
import { extFor, loadAsset, loadAssetText } from "../files/storage.js";
|
|
11
11
|
import { snapshotHtmlImages } from "../files/web-images.js";
|
|
12
|
+
import { withLocalCall } from "../local-call.js";
|
|
12
13
|
import { generateImageMedia, generateSpeechMedia, generateVideoMedia, } from "../media/generate.js";
|
|
13
14
|
import { markMedia } from "../media/marking.js";
|
|
14
15
|
import { agentModel, attachTools, costOf, isHarnessVendor, keepsOwnLoop, takesTools, textModel, totalUsage, } from "../models.js";
|
|
@@ -222,6 +223,23 @@ function foundLines(step, ctx) {
|
|
|
222
223
|
},
|
|
223
224
|
};
|
|
224
225
|
}
|
|
226
|
+
/** From how many tokens on a run says that a local model reads them: below, it takes a moment. */
|
|
227
|
+
const LONG_READ = 1_500;
|
|
228
|
+
/** Says in the run's log once what a local model does before it answers: it can take a minute. */
|
|
229
|
+
function waitingLines(ctx) {
|
|
230
|
+
const told = new Set();
|
|
231
|
+
return (waiting) => {
|
|
232
|
+
const code = waiting?.state === "loading"
|
|
233
|
+
? "loadsModel"
|
|
234
|
+
: waiting?.state === "reading" && (waiting.total ?? 0) >= LONG_READ
|
|
235
|
+
? "modelReads"
|
|
236
|
+
: null;
|
|
237
|
+
if (code && !told.has(code)) {
|
|
238
|
+
told.add(code);
|
|
239
|
+
void ctx.emit("info", { code }).catch(() => undefined);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
}
|
|
225
243
|
/** Runs a json step's agent as a stream, with `foundLines`. Returns what `generate` would: the text, the steps and the usage. */
|
|
226
244
|
async function streamWithProgress(agent, message, options, step, ctx) {
|
|
227
245
|
const found = foundLines(step, ctx);
|
|
@@ -631,8 +649,9 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
|
|
|
631
649
|
]
|
|
632
650
|
: request;
|
|
633
651
|
let result;
|
|
652
|
+
const local = { onWaiting: waitingLines(ctx) };
|
|
634
653
|
if (turn) {
|
|
635
|
-
const end = await durableTurn(turn, ctx, {
|
|
654
|
+
const end = await withLocalCall(local, () => durableTurn(turn, ctx, {
|
|
636
655
|
instructions: system,
|
|
637
656
|
model: agentModel(resolved),
|
|
638
657
|
tools,
|
|
@@ -642,7 +661,7 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
|
|
|
642
661
|
// Each model step is booked as it ends: a crash neither repeats nor loses the ones before it.
|
|
643
662
|
onStepUsage: (usage) => ctx.chargeUsd(costOf(resolved, usage)),
|
|
644
663
|
onText: step.output.format === "json" ? foundLines(step, ctx).text : undefined,
|
|
645
|
-
});
|
|
664
|
+
}));
|
|
646
665
|
assets.splice(0, assets.length, ...end.assets);
|
|
647
666
|
result = { text: end.text, steps: [{ text: end.closing }] };
|
|
648
667
|
}
|
|
@@ -655,10 +674,10 @@ export async function runAgentStep(step, ctx, decision = false, agentPart) {
|
|
|
655
674
|
tools,
|
|
656
675
|
});
|
|
657
676
|
// A json step streams, so the person sees its entries as they are written (`found`).
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
677
|
+
const options = { maxSteps, abortSignal: ctx.signal };
|
|
678
|
+
result = await withLocalCall(local, () => step.output.format === "json"
|
|
679
|
+
? streamWithProgress(agent, message, options, step, ctx)
|
|
680
|
+
: agent.generate(message, options));
|
|
662
681
|
await ctx.chargeUsd(costOf(resolved, await totalUsage(result)));
|
|
663
682
|
}
|
|
664
683
|
// `result.text` strings together what the model said between tool calls ("I open the page …").
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { validateSurface } from "@engenty/chatviews/surface";
|
|
1
2
|
import { assembleSurface, dataRef, listRef, } from "@engenty/wizards-shared/definition";
|
|
2
3
|
import { note } from "@engenty/wizards-shared/run";
|
|
3
|
-
import { validateSurface } from "@engenty/wizards-shared/surface";
|
|
4
4
|
import { decide } from "./decide.js";
|
|
5
5
|
import { answersAsText, resolveRef } from "./template.js";
|
|
6
6
|
import { StepError } from "./types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { formatMoney } from "@engenty/chatviews/numbers";
|
|
1
2
|
import { allFields, isAudioValue, isLocationValue, itemsTotals, localeOf, locationText, wizardLang, } from "@engenty/wizards-shared/definition";
|
|
2
|
-
import { formatMoney } from "@engenty/wizards-shared/numbers";
|
|
3
3
|
import { fontLicenseWords, gradientCss, textStyleLine, } from "@engenty/wizards-shared/spaces";
|
|
4
4
|
import { listAsMarkdown } from "@engenty/wizards-shared/store";
|
|
5
5
|
import { prompt } from "../prompts.js";
|
package/apps/runtime/dist/env.js
CHANGED
|
@@ -216,6 +216,7 @@ export const env = {
|
|
|
216
216
|
*/
|
|
217
217
|
browserFastLoop: str("BROWSER_FAST_LOOP") !== "off",
|
|
218
218
|
ollamaUrl: str("OLLAMA_URL", "http://127.0.0.1:11434/v1"),
|
|
219
|
+
lmstudioUrl: str("LMSTUDIO_URL", "http://127.0.0.1:1234/v1"),
|
|
219
220
|
/** What each model class runs on when this runtime resolves classes itself (own keys, Ollama). */
|
|
220
221
|
models: {
|
|
221
222
|
classifier: str("MODEL_CLASSIFIER", "deepseek/deepseek-v4.1-flash"),
|
|
@@ -6,7 +6,7 @@ import { note } from "@engenty/wizards-shared/run";
|
|
|
6
6
|
import { prompt } from "../prompts.js";
|
|
7
7
|
import { modelOptions } from "./model.js";
|
|
8
8
|
/**
|
|
9
|
-
* Claude Code, Codex and Cursor Agent as the runtime runs them: the clients of
|
|
9
|
+
* Claude Code, Codex, Antigravity and Cursor Agent as the runtime runs them: the clients of
|
|
10
10
|
* @engenty/local-models/clients with the model each text class runs on, what the person reads
|
|
11
11
|
* when the account cannot pay, and Codex's images.
|
|
12
12
|
*/
|
|
@@ -102,6 +102,15 @@ export const codex = harnessOf(CLIENTS.codex, {
|
|
|
102
102
|
model: (alias) => new CodexImageModel(codex, alias || "image", modelOptions(codex)),
|
|
103
103
|
},
|
|
104
104
|
});
|
|
105
|
+
/** The models carry their effort in the name (`withEffort`). */
|
|
106
|
+
export const antigravity = harnessOf(CLIENTS.antigravity, {
|
|
107
|
+
classes: {
|
|
108
|
+
classifier: "gemini-3.8-flash-low",
|
|
109
|
+
low: "gemini-3.8-flash-medium",
|
|
110
|
+
standard: "gemini-3.8-flash-high",
|
|
111
|
+
high: "gemini-3.8-flash-high",
|
|
112
|
+
},
|
|
113
|
+
});
|
|
105
114
|
/** "auto" = the model the client picks itself; a binding `cursor/<model>` names one. */
|
|
106
115
|
export const cursor = harnessOf(CLIENTS.cursor, {
|
|
107
116
|
classes: { classifier: "auto", low: "auto", standard: "auto", high: "auto" },
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { mkdirSync } from "node:fs";
|
|
2
1
|
import { join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { setClientFolders } from "@engenty/local-models/clients";
|
|
3
|
+
import { ClientSetup } from "@engenty/model-setup/server";
|
|
5
4
|
import { inherited, runtimePath } from "../cli/environment.js";
|
|
6
5
|
import { layout } from "../cli/home.js";
|
|
7
|
-
import {
|
|
8
|
-
import { antigravity } from "./antigravity.js";
|
|
9
|
-
import { claude, codex, cursor } from "./clients.js";
|
|
6
|
+
import { antigravity, claude, codex, cursor } from "./clients.js";
|
|
10
7
|
export { HARNESS_IDS } from "./types.js";
|
|
11
8
|
/**
|
|
12
9
|
* Where the setup installs clients, whoever started this runtime: npm's prefix (on Windows the
|
|
@@ -36,71 +33,20 @@ export function harness(id) {
|
|
|
36
33
|
export function isHarnessVendor(vendor) {
|
|
37
34
|
return HARNESSES.some((h) => h.id === vendor);
|
|
38
35
|
}
|
|
39
|
-
/** The
|
|
40
|
-
const
|
|
36
|
+
/** The clients as the setup finds, installs and signs them in. */
|
|
37
|
+
export const clientSetup = new ClientSetup({
|
|
38
|
+
clients: HARNESSES,
|
|
39
|
+
folder: () => layout().clients,
|
|
40
|
+
env: (shellPath) => ({
|
|
41
|
+
...inherited(process.env),
|
|
42
|
+
PATH: runtimePath(layout(), shellPath ? { ...process.env, PATH: shellPath } : process.env),
|
|
43
|
+
}),
|
|
44
|
+
});
|
|
41
45
|
/** One client, as it is now; asked again after a minute — it may get installed or signed in meanwhile. */
|
|
42
|
-
export
|
|
43
|
-
|
|
44
|
-
if (!h) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
const status = await detectClient(h, force);
|
|
48
|
-
const kept = statuses.get(id);
|
|
49
|
-
if (kept?.of === status) {
|
|
50
|
-
return kept.value;
|
|
51
|
-
}
|
|
52
|
-
const client = CLIENTS.find((c) => c.id === id);
|
|
53
|
-
const value = {
|
|
54
|
-
id,
|
|
55
|
-
name: h.name,
|
|
56
|
-
install: client ? installCommand(client, layout()) : "",
|
|
57
|
-
app: client ? vendorApp(client) : null,
|
|
58
|
-
version: status.version,
|
|
59
|
-
auth: status.auth,
|
|
60
|
-
interactiveLogin: h.login.interactive,
|
|
61
|
-
images: Boolean(h.image),
|
|
62
|
-
};
|
|
63
|
-
statuses.set(id, { of: status, value });
|
|
64
|
-
return value;
|
|
46
|
+
export function detectHarness(id, force = false) {
|
|
47
|
+
return clientSetup.detect(id, force);
|
|
65
48
|
}
|
|
66
49
|
/** Every client this runtime knows, installed or not. */
|
|
67
50
|
export function detectHarnesses(force = false) {
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* What the inline terminal runs to install a client: the command the terminal setup runs, shown
|
|
72
|
-
* first. A client from npm goes into the install's own prefix with the npm of its own Node.
|
|
73
|
-
*/
|
|
74
|
-
export async function installSpec(id) {
|
|
75
|
-
const client = CLIENTS.find((c) => c.id === id);
|
|
76
|
-
if (!client) {
|
|
77
|
-
return null;
|
|
78
|
-
}
|
|
79
|
-
const paths = layout();
|
|
80
|
-
mkdirSync(paths.clients, { recursive: true });
|
|
81
|
-
const shell = await loginShellEnv();
|
|
82
|
-
if (process.platform === "win32") {
|
|
83
|
-
const [bin, ...args] = POWERSHELL;
|
|
84
|
-
const command = installCommand(client, paths);
|
|
85
|
-
return {
|
|
86
|
-
bin,
|
|
87
|
-
args: [...args, `Write-Host "$ ${command.replaceAll('"', '`"')}\`n"; ${command}`],
|
|
88
|
-
env: { ...inherited(process.env), PATH: runtimePath(paths, process.env) },
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
return {
|
|
92
|
-
bin: "bash",
|
|
93
|
-
args: [
|
|
94
|
-
"-c",
|
|
95
|
-
'printf "\\033[2m$ %s\\033[0m\\n\\n" "$1"; set -o pipefail; eval "$1"',
|
|
96
|
-
"install",
|
|
97
|
-
installCommand(client, paths),
|
|
98
|
-
],
|
|
99
|
-
env: {
|
|
100
|
-
...inherited(process.env),
|
|
101
|
-
PATH: runtimePath(paths, { ...process.env, PATH: shell.PATH || process.env.PATH }),
|
|
102
|
-
TERM: "xterm-256color",
|
|
103
|
-
COLORTERM: "truecolor",
|
|
104
|
-
},
|
|
105
|
-
};
|
|
51
|
+
return clientSetup.detectAll(force);
|
|
106
52
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { CLIENT_IDS } from "@engenty/model-setup";
|
|
1
2
|
/**
|
|
2
3
|
* A harness is an AI client installed on this machine — Claude Code, Codex, Antigravity, Cursor
|
|
3
4
|
* Agent — that answers on the person's own subscription or sign-in. The runtime runs it headless
|
|
4
5
|
* as a model (@engenty/local-models/clients, ./model.ts) and signs it in through the inline
|
|
5
|
-
* terminal (
|
|
6
|
+
* terminal (@engenty/model-setup). Nothing of this process reaches it: no key of ours, no session of a
|
|
6
7
|
* parent client.
|
|
7
8
|
*/
|
|
8
|
-
export const HARNESS_IDS =
|
|
9
|
+
export const HARNESS_IDS = CLIENT_IDS;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
const calls = new AsyncLocalStorage();
|
|
3
|
+
/** What the call being made now is told. */
|
|
4
|
+
export const localCall = () => calls.getStore() ?? {};
|
|
5
|
+
/** Runs `make`, and the calls of a local model in it with `call`. */
|
|
6
|
+
export const withLocalCall = (call, make) => calls.run(call, make);
|
|
@@ -1,172 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { SERVERS, serversHere } from "@engenty/local-models/servers";
|
|
2
|
+
import { MODEL_JOBS, OFFERED_MODELS } from "@engenty/model-setup";
|
|
3
|
+
import { LocalModels } from "@engenty/model-setup/server";
|
|
4
|
+
import { layout } from "./cli/home.js";
|
|
3
5
|
import { env } from "./env.js";
|
|
4
|
-
import { forgetLocalModels,
|
|
6
|
+
import { embeddingModel, forgetLocalModels, localServerUrl } from "./models.js";
|
|
5
7
|
/**
|
|
6
|
-
* The
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* starts. Text, search and decisions each pick their model from it.
|
|
8
|
+
* The servers for open models on this computer (@engenty/model-setup). Ollama's models come with
|
|
9
|
+
* the ones the Manage-App offers per job (`GET /v1/local-models` of the account's Manage-App):
|
|
10
|
+
* text, search and decisions each pick their model from it. LM Studio's and MLX's are for text.
|
|
10
11
|
*/
|
|
11
|
-
/** What a model does in the studio: a text class, the search of a space's knowledge, decisions. */
|
|
12
|
-
export const LOCAL_JOBS = ["text", "search", "decision"];
|
|
13
12
|
/** The share of the computer's memory a model may take and still leave room for the rest. */
|
|
14
13
|
const MEMORY_SHARE = 0.7;
|
|
15
|
-
/** The job a capability of Ollama's serves. */
|
|
16
|
-
const JOB_OF = {
|
|
17
|
-
completion: "text",
|
|
18
|
-
embedding: "search",
|
|
19
|
-
decision: "decision",
|
|
20
|
-
};
|
|
21
|
-
const gb = (bytes) => Math.round((bytes / 1e9) * 10) / 10;
|
|
22
|
-
async function getJson(url, timeoutMs) {
|
|
23
|
-
try {
|
|
24
|
-
const res = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
|
|
25
|
-
return res.ok ? (await res.json()) : null;
|
|
26
|
-
}
|
|
27
|
-
catch {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/** The models Ollama holds, with the jobs each can do here. */
|
|
32
|
-
async function installedModels(root) {
|
|
33
|
-
return (await ollamaModels(root)).map((m) => ({
|
|
34
|
-
name: m.name,
|
|
35
|
-
size: gb(m.size),
|
|
36
|
-
jobs: LOCAL_JOBS.filter((job) => m.capabilities.some((c) => JOB_OF[c] === job)),
|
|
37
|
-
capabilities: m.capabilities,
|
|
38
|
-
runner: m.runner,
|
|
39
|
-
quantization: m.quantization,
|
|
40
|
-
loaded: m.running,
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
14
|
/** The Manage-App's list at the last look: kept for an hour, asked again after five minutes when it did not answer. */
|
|
44
15
|
let offered = null;
|
|
45
16
|
async function offeredModels() {
|
|
46
17
|
if (offered && Date.now() < offered.at) {
|
|
47
18
|
return offered.models;
|
|
48
19
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
let ollamaStart = null;
|
|
57
|
-
/** Ollama on this computer, its models and the ones to download, for the settings page. */
|
|
58
|
-
export async function localModels() {
|
|
59
|
-
const url = await localOllamaUrl();
|
|
60
|
-
const root = ollamaRoot(url);
|
|
61
|
-
const { findOllama, freeGb } = await import("./cli/ollama.js");
|
|
62
|
-
const { version } = await ollamaState(root);
|
|
63
|
-
const memory = Math.round(totalmem() / 2 ** 30);
|
|
64
|
-
const installed = version ? await installedModels(root) : [];
|
|
65
|
-
const held = new Set(installed.map((m) => m.name));
|
|
66
|
-
const list = await offeredModels();
|
|
67
|
-
return {
|
|
68
|
-
ollama: {
|
|
69
|
-
url,
|
|
70
|
-
/** Null: Ollama does not answer at the address. */
|
|
71
|
-
version,
|
|
72
|
-
/** The `ollama` command is on this computer, though it may not run. */
|
|
73
|
-
installed: Boolean(version || findOllama()),
|
|
74
|
-
/** The studio can install Ollama itself: on a Mac, as the setup does. */
|
|
75
|
-
canInstall: process.platform === "darwin",
|
|
76
|
-
start: ollamaStart,
|
|
77
|
-
},
|
|
78
|
-
/** The computer's memory and the free space for models, in GB. */
|
|
79
|
-
memory,
|
|
80
|
-
free: await freeGb(),
|
|
81
|
-
installed,
|
|
82
|
-
/** Null: the Manage-App did not answer, the list shows the installed models alone. */
|
|
83
|
-
offered: list?.map((m) => ({
|
|
84
|
-
...m,
|
|
85
|
-
installed: held.has(m.name) || held.has(`${m.name}:latest`),
|
|
86
|
-
fits: fits(m.memory, memory, MEMORY_SHARE),
|
|
87
|
-
})) ?? null,
|
|
88
|
-
downloads: [...downloads.values()],
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Pulls a model into Ollama in the background; `then` runs once it ended well. A download of
|
|
93
|
-
* the same model that runs already is left to finish.
|
|
94
|
-
*/
|
|
95
|
-
export async function downloadLocalModel(model, then) {
|
|
96
|
-
const running = downloads.get(model);
|
|
97
|
-
if (running && !running.finished) {
|
|
98
|
-
return;
|
|
20
|
+
let models = null;
|
|
21
|
+
try {
|
|
22
|
+
const res = await fetch(`${env.local.accountUrl}/v1/local-models`, {
|
|
23
|
+
signal: AbortSignal.timeout(3000),
|
|
24
|
+
});
|
|
25
|
+
const body = res.ok ? (await res.json()) : null;
|
|
26
|
+
models = body?.models?.filter((m) => MODEL_JOBS.includes(m.job)) ?? null;
|
|
99
27
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
void pullModel(await localOllamaUrl(), model, (done, total) => {
|
|
103
|
-
state.done = done;
|
|
104
|
-
state.total = total;
|
|
105
|
-
})
|
|
106
|
-
.then(async () => {
|
|
107
|
-
forgetLocalModels();
|
|
108
|
-
state.finished = true;
|
|
109
|
-
// A finished download is done; the list shows the model itself now.
|
|
110
|
-
downloads.delete(model);
|
|
111
|
-
await then?.();
|
|
112
|
-
})
|
|
113
|
-
.catch((err) => {
|
|
114
|
-
const unreachable = /fetch failed|ECONNREFUSED/i.test(`${err.message} ${err.cause ?? ""}`);
|
|
115
|
-
state.error = unreachable ? "ollama" : err.message;
|
|
116
|
-
state.finished = true;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/** Removes a model from Ollama, and a download of it that failed; Ollama's reason where it refuses. */
|
|
120
|
-
export async function removeLocalModel(model) {
|
|
121
|
-
downloads.delete(model);
|
|
122
|
-
forgetLocalModels();
|
|
123
|
-
const res = await fetch(`${ollamaRoot(await localOllamaUrl())}/api/delete`, {
|
|
124
|
-
method: "DELETE",
|
|
125
|
-
headers: { "content-type": "application/json" },
|
|
126
|
-
body: JSON.stringify({ model }),
|
|
127
|
-
signal: AbortSignal.timeout(10_000),
|
|
128
|
-
});
|
|
129
|
-
if (!res.ok) {
|
|
130
|
-
const text = (await res.text()).trim();
|
|
131
|
-
let reason = text;
|
|
132
|
-
try {
|
|
133
|
-
reason = JSON.parse(text).error ?? text;
|
|
134
|
-
}
|
|
135
|
-
catch { }
|
|
136
|
-
throw new Error(reason || `Ollama answered ${res.status}.`);
|
|
28
|
+
catch {
|
|
29
|
+
// Asked again in five minutes.
|
|
137
30
|
}
|
|
31
|
+
offered = { models, at: Date.now() + (models ? 60 : 5) * 60_000 };
|
|
32
|
+
return models;
|
|
138
33
|
}
|
|
139
|
-
/**
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const outcome = await installOllama(paths, () => undefined);
|
|
156
|
-
if (!outcome.ok) {
|
|
157
|
-
throw new Error(outcome.message);
|
|
34
|
+
/** The model the spaces are indexed with now. */
|
|
35
|
+
const embeddedBy = async () => (await embeddingModel().catch(() => null))?.ref ?? null;
|
|
36
|
+
const ollama = new LocalModels({
|
|
37
|
+
server: SERVERS.ollama,
|
|
38
|
+
url: () => localServerUrl("ollama"),
|
|
39
|
+
offered: offeredModels,
|
|
40
|
+
share: MEMORY_SHARE,
|
|
41
|
+
logs: () => layout().logs,
|
|
42
|
+
changed: forgetLocalModels,
|
|
43
|
+
// Where the pulled model is the embedding model now, the spaces are indexed with it after.
|
|
44
|
+
async pulling() {
|
|
45
|
+
const before = await embeddedBy();
|
|
46
|
+
return async () => {
|
|
47
|
+
if ((await embeddedBy()) !== before) {
|
|
48
|
+
const { reindexAll } = await import("./services/space-index.js");
|
|
49
|
+
await reindexAll();
|
|
158
50
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
const lmStudio = new LocalModels({
|
|
55
|
+
server: SERVERS.lmstudio,
|
|
56
|
+
url: () => localServerUrl("lmstudio"),
|
|
57
|
+
offered: () => OFFERED_MODELS.lmstudio,
|
|
58
|
+
share: MEMORY_SHARE,
|
|
59
|
+
logs: () => layout().logs,
|
|
60
|
+
});
|
|
61
|
+
const mlx = new LocalModels({
|
|
62
|
+
server: SERVERS.mlx,
|
|
63
|
+
url: () => localServerUrl("mlx"),
|
|
64
|
+
offered: () => OFFERED_MODELS.mlx,
|
|
65
|
+
share: MEMORY_SHARE,
|
|
66
|
+
logs: () => layout().logs,
|
|
67
|
+
});
|
|
68
|
+
export const localServers = [ollama, lmStudio, mlx].filter((server) => serversHere().includes(server.id));
|
|
@@ -1,59 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { randomBytes } from "node:crypto";
|
|
3
|
-
import { createMcpHandler, fromJsonSchema, McpServer, } from "@modelcontextprotocol/server";
|
|
1
|
+
import { Bridges } from "@engenty/local-models/bridge";
|
|
4
2
|
import { env } from "../env.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return { content: [{ type: "text", text: textOf(shaped ? shaped.value : output) }] };
|
|
18
|
-
}
|
|
19
|
-
export function openBridge(tools) {
|
|
20
|
-
const token = randomBytes(24).toString("base64url");
|
|
21
|
-
// The client's requests arrive on their own; the tools run as the call that opened the bridge —
|
|
22
|
-
// in its tenant, as its person.
|
|
23
|
-
const inCall = AsyncLocalStorage.snapshot();
|
|
24
|
-
const handler = createMcpHandler(() => {
|
|
25
|
-
const server = new McpServer({ name: "step", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
26
|
-
for (const tool of tools) {
|
|
27
|
-
server.registerTool(tool.name, {
|
|
28
|
-
description: tool.description,
|
|
29
|
-
inputSchema: fromJsonSchema(tool.inputSchema),
|
|
30
|
-
}, (async (args) => {
|
|
31
|
-
try {
|
|
32
|
-
return contentOf(tool, await inCall(() => tool.execute(args)));
|
|
33
|
-
}
|
|
34
|
-
catch (err) {
|
|
35
|
-
return {
|
|
36
|
-
isError: true,
|
|
37
|
-
content: [{ type: "text", text: err?.message ?? String(err) }],
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
return server;
|
|
43
|
-
}, { legacy: "stateless" });
|
|
44
|
-
bridges.set(token, handler);
|
|
45
|
-
return {
|
|
46
|
-
url: `http://127.0.0.1:${env.port}/api/mcp/bridge/${token}`,
|
|
47
|
-
close: () => {
|
|
48
|
-
bridges.delete(token);
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
3
|
+
/**
|
|
4
|
+
* The tools of one model call, served over MCP to the AI client installed on this machine while
|
|
5
|
+
* it answers that call (@engenty/local-models/bridge). A bridge lives as long as the call: it
|
|
6
|
+
* opens with it, is reached through a random path on the loopback address, and closes with it.
|
|
7
|
+
* Nothing but this process knows the path; the client works through the tools itself and comes
|
|
8
|
+
* back with the answer.
|
|
9
|
+
*/
|
|
10
|
+
const bridges = new Bridges({ name: "step" });
|
|
11
|
+
/** Opens a call's tools; the client reaches them at the URL until `close`. */
|
|
12
|
+
export const openBridge = (tools) => bridges.at(`http://127.0.0.1:${env.port}/api/mcp/bridge`)(tools);
|
|
52
13
|
/** Answers an MCP request of an open bridge; a closed or unknown one is not found. */
|
|
53
14
|
export function bridgeRequest(token, request) {
|
|
54
|
-
|
|
55
|
-
if (!handler) {
|
|
56
|
-
return Promise.resolve(new Response("not found", { status: 404 }));
|
|
57
|
-
}
|
|
58
|
-
return handler.fetch(request);
|
|
15
|
+
return bridges.fetch(request, token);
|
|
59
16
|
}
|
|
@@ -3,6 +3,8 @@ import { callOutside, RUN_COMMAND } from "../elements/outside.js";
|
|
|
3
3
|
import { ELEMENT_SPECS, ELEMENT_TOOL_NAMES } from "../elements/specs.js";
|
|
4
4
|
import { prompt } from "../prompts.js";
|
|
5
5
|
import { listSpaces, spaceIs } from "../services/spaces.js";
|
|
6
|
+
import { FLOW_VIEW_KEY, flowAppMeta, flowView } from "./flow-app.js";
|
|
7
|
+
import { withPages } from "./run-pages.js";
|
|
6
8
|
/**
|
|
7
9
|
* The space's elements as MCP tools (docs/plans/modular.md, phase 2): what a Work chat uses,
|
|
8
10
|
* for Claude Code, Codex or any MCP client signed in as a person. Made from the catalogue's specs
|
|
@@ -26,7 +28,29 @@ const READ_ONLY = new Set([
|
|
|
26
28
|
"connection_list",
|
|
27
29
|
"wizard_list",
|
|
28
30
|
]);
|
|
29
|
-
|
|
31
|
+
/**
|
|
32
|
+
* A run `wizard_run` started, with the flow widget's data: hosts that render MCP Apps show the
|
|
33
|
+
* run and the person answers its pages there. Without a view (a wizard the person can't open
|
|
34
|
+
* as a diagram) the run comes back as text alone.
|
|
35
|
+
*/
|
|
36
|
+
export async function withFlow(userId, answered, result) {
|
|
37
|
+
const report = result;
|
|
38
|
+
if (answered.isError || !report?.runId || !report.wizardId) {
|
|
39
|
+
return answered;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const view = await flowView(userId, report.wizardId, { run: report });
|
|
43
|
+
return {
|
|
44
|
+
...answered,
|
|
45
|
+
structuredContent: report,
|
|
46
|
+
_meta: { [FLOW_VIEW_KEY]: view },
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return answered;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export function answer(result) {
|
|
30
54
|
const body = result.ok
|
|
31
55
|
? result.result
|
|
32
56
|
: { error: result.error, ...(result.data ? { data: result.data } : {}) };
|
|
@@ -48,10 +72,13 @@ export function registerElementTools(server, who) {
|
|
|
48
72
|
return;
|
|
49
73
|
}
|
|
50
74
|
const withSpace = input.extend({ spaceId });
|
|
75
|
+
const runs = name === "wizard_run";
|
|
51
76
|
server.registerTool(name, {
|
|
52
77
|
title: name.replace(/_/g, " "),
|
|
53
|
-
|
|
78
|
+
// Over MCP the client answers the run's pages itself, with the run tools (mcp/runs.ts).
|
|
79
|
+
description: runs ? prompt("mcp", "tool.wizard_run") : description,
|
|
54
80
|
inputSchema: withSpace,
|
|
81
|
+
...(runs ? { _meta: flowAppMeta } : {}),
|
|
55
82
|
annotations: {
|
|
56
83
|
readOnlyHint: READ_ONLY.has(name),
|
|
57
84
|
// A connection's action may write, send or delete in a connected account.
|
|
@@ -59,9 +86,17 @@ export function registerElementTools(server, who) {
|
|
|
59
86
|
// Running a wizard or a command reaches past the person's own data.
|
|
60
87
|
openWorldHint: !READ_ONLY.has(name),
|
|
61
88
|
},
|
|
62
|
-
}, (async (args) => {
|
|
89
|
+
}, (async (args, ctx) => {
|
|
63
90
|
const { spaceId: space, ...rest } = args;
|
|
64
|
-
|
|
91
|
+
const call = () => callOutside(outside, typeof space === "string" ? space : undefined, name, rest, AbortSignal.timeout(10 * 60_000));
|
|
92
|
+
if (!runs) {
|
|
93
|
+
return answer(await call());
|
|
94
|
+
}
|
|
95
|
+
// The run's pages go to the person where the client asks them, then the run's report.
|
|
96
|
+
return withPages(ctx, who, async () => {
|
|
97
|
+
const result = await call();
|
|
98
|
+
return result.ok ? result.result : { failed: answer(result) };
|
|
99
|
+
}, (report) => withFlow(who.userId, answer({ ok: true, result: report }), report));
|
|
65
100
|
}));
|
|
66
101
|
};
|
|
67
102
|
for (const name of ELEMENT_TOOL_NAMES) {
|