@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,66 @@
|
|
|
1
|
+
/** The studio's vivid ground and the text on white, as on the landing page. */
|
|
2
|
+
export const SETUP_GROUND = "oklch(50% 0.2 262)";
|
|
3
|
+
export const SETUP_GROUND_INK = "oklch(32% 0.15 262)";
|
|
4
|
+
const CREAM = "oklch(90% 0.1 80)";
|
|
5
|
+
/**
|
|
6
|
+
* The setup's own colours, set on an element around it. On the vivid ground: white on it, and
|
|
7
|
+
* secondary text, checks and errors a step brighter than the dark theme's.
|
|
8
|
+
*/
|
|
9
|
+
export const SETUP_ON_GROUND = {
|
|
10
|
+
"--on": "white",
|
|
11
|
+
"--tile": "rgb(255 255 255 / 0.1)",
|
|
12
|
+
"--tile-hover": "rgb(255 255 255 / 0.15)",
|
|
13
|
+
"--tile-ring": "rgb(255 255 255 / 0.15)",
|
|
14
|
+
"--panel": "rgb(255 255 255 / 0.07)",
|
|
15
|
+
"--panel-ring": "rgb(255 255 255 / 0.12)",
|
|
16
|
+
"--pick": "white",
|
|
17
|
+
"--pick-ink": SETUP_GROUND_INK,
|
|
18
|
+
"--pick-mark": SETUP_GROUND_INK,
|
|
19
|
+
"--badge": CREAM,
|
|
20
|
+
"--badge-ink": SETUP_GROUND_INK,
|
|
21
|
+
"--dot": CREAM,
|
|
22
|
+
"--step-done": "oklch(88% 0.17 150)",
|
|
23
|
+
"--step-now": "oklch(88% 0.14 80)",
|
|
24
|
+
"--ready-ink": "oklch(27% 0.09 150)",
|
|
25
|
+
"--ink-2": "oklch(96% 0.02 262)",
|
|
26
|
+
"--ink-3": "oklch(90% 0.035 262)",
|
|
27
|
+
"--ink-4": "oklch(82% 0.05 262)",
|
|
28
|
+
"--moss": "oklch(90% 0.14 150)",
|
|
29
|
+
"--rose": "oklch(89% 0.09 45)",
|
|
30
|
+
};
|
|
31
|
+
/** On the theme's light paper: the ground's blue marks the pick. */
|
|
32
|
+
export const SETUP_ON_PAPER = {
|
|
33
|
+
"--on": "var(--ink)",
|
|
34
|
+
"--tile": "var(--card)",
|
|
35
|
+
"--tile-hover": "var(--paper-2)",
|
|
36
|
+
"--tile-ring": "var(--border-soft)",
|
|
37
|
+
"--panel": "var(--card)",
|
|
38
|
+
"--panel-ring": "var(--border-soft)",
|
|
39
|
+
"--pick": SETUP_GROUND,
|
|
40
|
+
"--pick-ink": "white",
|
|
41
|
+
"--pick-mark": "white",
|
|
42
|
+
"--badge": CREAM,
|
|
43
|
+
"--badge-ink": SETUP_GROUND_INK,
|
|
44
|
+
"--dot": SETUP_GROUND,
|
|
45
|
+
"--step-done": "oklch(52% 0.15 150)",
|
|
46
|
+
"--step-now": "oklch(60% 0.15 65)",
|
|
47
|
+
"--ready-ink": "white",
|
|
48
|
+
};
|
|
49
|
+
/** On whatever ground the theme has: the pick stands in the theme's ink. */
|
|
50
|
+
export const SETUP_ON_THEME = {
|
|
51
|
+
"--on": "var(--ink)",
|
|
52
|
+
"--tile": "var(--card)",
|
|
53
|
+
"--tile-hover": "var(--paper-2)",
|
|
54
|
+
"--tile-ring": "transparent",
|
|
55
|
+
"--panel": "var(--card)",
|
|
56
|
+
"--panel-ring": "transparent",
|
|
57
|
+
"--pick": "var(--ink)",
|
|
58
|
+
"--pick-ink": "var(--background)",
|
|
59
|
+
"--pick-mark": "var(--background)",
|
|
60
|
+
"--badge": "var(--primary)",
|
|
61
|
+
"--badge-ink": "var(--primary-foreground)",
|
|
62
|
+
"--dot": "var(--primary)",
|
|
63
|
+
"--step-done": "var(--moss)",
|
|
64
|
+
"--step-now": "var(--primary)",
|
|
65
|
+
"--ready-ink": "var(--background)",
|
|
66
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ClientEntry } from "../catalog.js";
|
|
2
|
+
/** Whether `<name>.app` is in one of the Mac's Applications folders. */
|
|
3
|
+
export declare function macAppPresent(name: string, roots?: string[]): boolean;
|
|
4
|
+
/** The client's desktop app, when it is on this Mac: its name, e.g. "Claude". */
|
|
5
|
+
export declare function vendorApp(client: ClientEntry, roots?: string[]): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* The client the setup suggests among those not installed: the one whose app is on this Mac,
|
|
8
|
+
* as its subscription is most likely already paid for, else the first.
|
|
9
|
+
*/
|
|
10
|
+
export declare function suggestedClient<T extends {
|
|
11
|
+
client: ClientEntry;
|
|
12
|
+
}>(missing: T[]): T | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
const APP_ROOTS = ["/Applications", join(homedir(), "Applications")];
|
|
5
|
+
/** Whether `<name>.app` is in one of the Mac's Applications folders. */
|
|
6
|
+
export function macAppPresent(name, roots = APP_ROOTS) {
|
|
7
|
+
return roots.some((root) => existsSync(join(root, `${name}.app`)));
|
|
8
|
+
}
|
|
9
|
+
/** The client's desktop app, when it is on this Mac: its name, e.g. "Claude". */
|
|
10
|
+
export function vendorApp(client, roots = APP_ROOTS) {
|
|
11
|
+
if (process.platform !== "darwin" || !client.app) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return macAppPresent(client.app, roots) ? client.app : null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The client the setup suggests among those not installed: the one whose app is on this Mac,
|
|
18
|
+
* as its subscription is most likely already paid for, else the first.
|
|
19
|
+
*/
|
|
20
|
+
export function suggestedClient(missing) {
|
|
21
|
+
return missing.find((state) => vendorApp(state.client)) ?? missing[0] ?? null;
|
|
22
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type Detectable } from "@engenty/local-models/clients";
|
|
2
|
+
import { type ClientId } from "../catalog.js";
|
|
3
|
+
import type { ClientSetupStatus } from "../types.js";
|
|
4
|
+
/** A client as the host runs it. */
|
|
5
|
+
export interface SetupClient extends Detectable {
|
|
6
|
+
id: ClientId;
|
|
7
|
+
name: string;
|
|
8
|
+
bin: string;
|
|
9
|
+
/**
|
|
10
|
+
* What the terminal runs to sign the client in. `interactive`: the client's own app opens and
|
|
11
|
+
* the person ends it; the terminal closes by itself once the sign-in is there.
|
|
12
|
+
*/
|
|
13
|
+
login: {
|
|
14
|
+
args: string[];
|
|
15
|
+
env?: Record<string, string>;
|
|
16
|
+
interactive: boolean;
|
|
17
|
+
};
|
|
18
|
+
/** Set where the host makes images with it. */
|
|
19
|
+
image?: unknown;
|
|
20
|
+
}
|
|
21
|
+
/** A command for a terminal. */
|
|
22
|
+
export interface TerminalCommand {
|
|
23
|
+
bin: string;
|
|
24
|
+
args: string[];
|
|
25
|
+
env: NodeJS.ProcessEnv;
|
|
26
|
+
}
|
|
27
|
+
export interface ClientSetupOptions {
|
|
28
|
+
/** The host's clients, in the order the setup offers them. */
|
|
29
|
+
clients: readonly SetupClient[];
|
|
30
|
+
/** Where the host keeps the clients it installs: npm's prefix. Asked at each use. */
|
|
31
|
+
folder: () => string;
|
|
32
|
+
/** The environment an install starts with; `shellPath` is the login shell's PATH, if it has one. */
|
|
33
|
+
env: (shellPath: string | undefined) => NodeJS.ProcessEnv;
|
|
34
|
+
}
|
|
35
|
+
/** The AI clients on this computer: how each stands, how it is installed and signed in. */
|
|
36
|
+
export declare class ClientSetup {
|
|
37
|
+
private readonly options;
|
|
38
|
+
/** The status last made of each client's detection, kept while the detection holds. */
|
|
39
|
+
private readonly statuses;
|
|
40
|
+
constructor(options: ClientSetupOptions);
|
|
41
|
+
client(id: string): SetupClient | null;
|
|
42
|
+
/** One client, as it is now; asked again after a minute, as it may get installed or signed in meanwhile. */
|
|
43
|
+
detect(id: string, force?: boolean): Promise<ClientSetupStatus<ClientId> | null>;
|
|
44
|
+
/** Every client of the host, installed or not. */
|
|
45
|
+
detectAll(force?: boolean): Promise<ClientSetupStatus<ClientId>[]>;
|
|
46
|
+
/**
|
|
47
|
+
* What the terminal runs to install a client: the command of the catalog, shown first. A
|
|
48
|
+
* client from npm goes into the host's own prefix.
|
|
49
|
+
*/
|
|
50
|
+
install(id: string): Promise<TerminalCommand | null>;
|
|
51
|
+
/** What the terminal runs to sign a client in. */
|
|
52
|
+
login(id: string): Promise<TerminalCommand | null>;
|
|
53
|
+
/** Whether the client is signed in, asked of the client itself. */
|
|
54
|
+
signedIn(id: string): Promise<boolean>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { mkdirSync } from "node:fs";
|
|
2
|
+
import { detectClient, freshAuth, loginEnv, loginShellEnv, } from "@engenty/local-models/clients";
|
|
3
|
+
import { clientEntry, installCommand, POWERSHELL } from "../catalog.js";
|
|
4
|
+
import { vendorApp } from "./apps.js";
|
|
5
|
+
/** The AI clients on this computer: how each stands, how it is installed and signed in. */
|
|
6
|
+
export class ClientSetup {
|
|
7
|
+
options;
|
|
8
|
+
/** The status last made of each client's detection, kept while the detection holds. */
|
|
9
|
+
statuses = new Map();
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.options = options;
|
|
12
|
+
}
|
|
13
|
+
client(id) {
|
|
14
|
+
return this.options.clients.find((client) => client.id === id) ?? null;
|
|
15
|
+
}
|
|
16
|
+
/** One client, as it is now; asked again after a minute, as it may get installed or signed in meanwhile. */
|
|
17
|
+
async detect(id, force = false) {
|
|
18
|
+
const client = this.client(id);
|
|
19
|
+
if (!client) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const status = await detectClient(client, force);
|
|
23
|
+
const kept = this.statuses.get(client.id);
|
|
24
|
+
if (kept?.of === status) {
|
|
25
|
+
return kept.value;
|
|
26
|
+
}
|
|
27
|
+
const entry = clientEntry(client.id);
|
|
28
|
+
const value = {
|
|
29
|
+
id: client.id,
|
|
30
|
+
name: client.name,
|
|
31
|
+
label: entry?.label ?? client.name,
|
|
32
|
+
install: entry ? installCommand(entry, this.options.folder(), process.platform) : "",
|
|
33
|
+
app: entry ? vendorApp(entry) : null,
|
|
34
|
+
version: status.version,
|
|
35
|
+
auth: status.auth,
|
|
36
|
+
interactiveLogin: client.login.interactive,
|
|
37
|
+
images: Boolean(client.image),
|
|
38
|
+
};
|
|
39
|
+
this.statuses.set(client.id, { of: status, value });
|
|
40
|
+
return value;
|
|
41
|
+
}
|
|
42
|
+
/** Every client of the host, installed or not. */
|
|
43
|
+
detectAll(force = false) {
|
|
44
|
+
return Promise.all(this.options.clients.map((client) => this.detect(client.id, force)));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* What the terminal runs to install a client: the command of the catalog, shown first. A
|
|
48
|
+
* client from npm goes into the host's own prefix.
|
|
49
|
+
*/
|
|
50
|
+
async install(id) {
|
|
51
|
+
const entry = this.client(id) ? clientEntry(id) : null;
|
|
52
|
+
if (!entry) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const folder = this.options.folder();
|
|
56
|
+
mkdirSync(folder, { recursive: true });
|
|
57
|
+
const command = installCommand(entry, folder, process.platform);
|
|
58
|
+
if (process.platform === "win32") {
|
|
59
|
+
const [bin = "", ...args] = POWERSHELL;
|
|
60
|
+
return {
|
|
61
|
+
bin,
|
|
62
|
+
args: [...args, `Write-Host "$ ${command.replaceAll('"', '`"')}\`n"; ${command}`],
|
|
63
|
+
env: this.options.env(undefined),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const shell = await loginShellEnv();
|
|
67
|
+
return {
|
|
68
|
+
bin: "bash",
|
|
69
|
+
args: [
|
|
70
|
+
"-c",
|
|
71
|
+
'printf "\\033[2m$ %s\\033[0m\\n\\n" "$1"; set -o pipefail; eval "$1"',
|
|
72
|
+
"install",
|
|
73
|
+
command,
|
|
74
|
+
],
|
|
75
|
+
env: {
|
|
76
|
+
...this.options.env(shell.PATH),
|
|
77
|
+
TERM: "xterm-256color",
|
|
78
|
+
COLORTERM: "truecolor",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/** What the terminal runs to sign a client in. */
|
|
83
|
+
async login(id) {
|
|
84
|
+
const client = this.client(id);
|
|
85
|
+
return (client && {
|
|
86
|
+
bin: client.bin,
|
|
87
|
+
args: client.login.args,
|
|
88
|
+
env: { ...(await loginEnv(client)), ...client.login.env },
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/** Whether the client is signed in, asked of the client itself. */
|
|
92
|
+
async signedIn(id) {
|
|
93
|
+
const client = this.client(id);
|
|
94
|
+
return client ? (await freshAuth(client)) !== "none" : false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { macAppPresent, suggestedClient, vendorApp } from "./apps.js";
|
|
2
|
+
export { ClientSetup, type ClientSetupOptions, type SetupClient, type TerminalCommand, } from "./clients.js";
|
|
3
|
+
export { freeGb, type Outcome } from "./install.js";
|
|
4
|
+
export { LocalModels, type LocalModelsOptions } from "./local-models.js";
|
|
5
|
+
export { Tested, type TestedStore } from "./models.js";
|
|
6
|
+
export { appAsksForPassword, findOllama, installOllama, startOllama, } from "./ollama.js";
|
|
7
|
+
export { type SetupHost, type SetupModels, type SourceOutcome, setupRoutes } from "./routes.js";
|
|
8
|
+
export { TerminalError, type TerminalOptions, Terminals } from "./terminal.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { macAppPresent, suggestedClient, vendorApp } from "./apps.js";
|
|
2
|
+
export { ClientSetup, } from "./clients.js";
|
|
3
|
+
export { freeGb } from "./install.js";
|
|
4
|
+
export { LocalModels } from "./local-models.js";
|
|
5
|
+
export { Tested } from "./models.js";
|
|
6
|
+
export { appAsksForPassword, findOllama, installOllama, startOllama, } from "./ollama.js";
|
|
7
|
+
export { setupRoutes } from "./routes.js";
|
|
8
|
+
export { TerminalError, Terminals } from "./terminal.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** What installing came to. */
|
|
2
|
+
export interface Outcome {
|
|
3
|
+
ok: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function executable(file: string): boolean;
|
|
7
|
+
/** The first file of that name on a PATH that may be run. */
|
|
8
|
+
export declare function findOnPath(name: string, path: string): string | null;
|
|
9
|
+
interface Ran {
|
|
10
|
+
code: number;
|
|
11
|
+
/** The end of what the command printed. */
|
|
12
|
+
tail: string;
|
|
13
|
+
}
|
|
14
|
+
/** Runs a command, what it prints into the log file; never rejects. */
|
|
15
|
+
export declare function logged(command: string, args: string[], { logs, onLine }: {
|
|
16
|
+
logs: string;
|
|
17
|
+
onLine?: (line: string) => void;
|
|
18
|
+
}): Promise<Ran>;
|
|
19
|
+
export declare const lastLine: (text: string) => string;
|
|
20
|
+
/** Asks every half second until it is true or the time is over. */
|
|
21
|
+
export declare function until(ready: () => Promise<boolean>, ms: number): Promise<boolean>;
|
|
22
|
+
/** Free space where the models are kept (the home folder), in GB. */
|
|
23
|
+
export declare function freeGb(dir?: string): Promise<number | null>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { accessSync, appendFileSync, constants, mkdirSync } from "node:fs";
|
|
3
|
+
import { statfs } from "node:fs/promises";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { delimiter, join } from "node:path";
|
|
6
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
7
|
+
export function executable(file) {
|
|
8
|
+
try {
|
|
9
|
+
accessSync(file, constants.X_OK);
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/** The first file of that name on a PATH that may be run. */
|
|
17
|
+
export function findOnPath(name, path) {
|
|
18
|
+
const file = process.platform === "win32" ? `${name}.exe` : name;
|
|
19
|
+
return (path
|
|
20
|
+
.split(delimiter)
|
|
21
|
+
.filter(Boolean)
|
|
22
|
+
.map((dir) => join(dir, file))
|
|
23
|
+
.find(executable) ?? null);
|
|
24
|
+
}
|
|
25
|
+
/** Runs a command, what it prints into the log file; never rejects. */
|
|
26
|
+
export function logged(command, args, { logs, onLine }) {
|
|
27
|
+
mkdirSync(logs, { recursive: true });
|
|
28
|
+
const file = join(logs, "install.log");
|
|
29
|
+
appendFileSync(file, `\n$ ${command} ${args.join(" ")}\n`);
|
|
30
|
+
return new Promise((resolve) => {
|
|
31
|
+
let tail = "";
|
|
32
|
+
const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
33
|
+
for (const stream of [child.stdout, child.stderr]) {
|
|
34
|
+
stream.on("data", (chunk) => {
|
|
35
|
+
const text = chunk.toString("utf8");
|
|
36
|
+
tail = (tail + text).slice(-4000);
|
|
37
|
+
appendFileSync(file, text);
|
|
38
|
+
for (const line of text.split("\n").filter((l) => l.trim())) {
|
|
39
|
+
onLine?.(line);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
child.on("error", (err) => resolve({ code: 127, tail: err.message }));
|
|
44
|
+
child.on("close", (code) => resolve({ code: code ?? 1, tail: tail.trim() }));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export const lastLine = (text) => text.split("\n").pop() ?? "";
|
|
48
|
+
/** Asks every half second until it is true or the time is over. */
|
|
49
|
+
export async function until(ready, ms) {
|
|
50
|
+
const deadline = Date.now() + ms;
|
|
51
|
+
while (Date.now() < deadline) {
|
|
52
|
+
if (await ready()) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
await sleep(500);
|
|
56
|
+
}
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
/** Free space where the models are kept (the home folder), in GB. */
|
|
60
|
+
export async function freeGb(dir = homedir()) {
|
|
61
|
+
try {
|
|
62
|
+
const stats = await statfs(dir);
|
|
63
|
+
return Math.floor((stats.bavail * stats.bsize) / 2 ** 30);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** LM Studio's `lms` command: there once the app ran for the first time, or with `llmster`. */
|
|
2
|
+
export declare function findLms(env?: NodeJS.ProcessEnv): string | null;
|
|
3
|
+
/** LM Studio on this computer: its command, or the app that brings it. */
|
|
4
|
+
export declare function findLmStudio(): string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Starts LM Studio's server. The app was never opened: it opens, and once the person is through
|
|
7
|
+
* its first start, its command is there and starts the server.
|
|
8
|
+
*/
|
|
9
|
+
export declare function startLmStudio(logs: string, answers: () => Promise<boolean>): Promise<boolean>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { executable, findOnPath, logged, until } from "./install.js";
|
|
5
|
+
/** The LM Studio app on a Mac. */
|
|
6
|
+
const MAC_APPS = ["/Applications/LM Studio.app", join(homedir(), "Applications", "LM Studio.app")];
|
|
7
|
+
const WINDOWS_APPS = ["LM Studio", join("Programs", "LM Studio")];
|
|
8
|
+
/** LM Studio's `lms` command: there once the app ran for the first time, or with `llmster`. */
|
|
9
|
+
export function findLms(env = process.env) {
|
|
10
|
+
const own = join(homedir(), ".lmstudio", "bin", process.platform === "win32" ? "lms.exe" : "lms");
|
|
11
|
+
return executable(own) ? own : findOnPath("lms", env.PATH ?? "");
|
|
12
|
+
}
|
|
13
|
+
/** The app on this computer. */
|
|
14
|
+
function findApp() {
|
|
15
|
+
if (process.platform === "darwin") {
|
|
16
|
+
return MAC_APPS.find((app) => existsSync(app)) ?? null;
|
|
17
|
+
}
|
|
18
|
+
const local = process.env.LOCALAPPDATA;
|
|
19
|
+
if (process.platform === "win32" && local) {
|
|
20
|
+
return (WINDOWS_APPS.map((dir) => join(local, dir, "LM Studio.exe")).find((app) => existsSync(app)) ??
|
|
21
|
+
null);
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
/** LM Studio on this computer: its command, or the app that brings it. */
|
|
26
|
+
export function findLmStudio() {
|
|
27
|
+
return findLms() ?? findApp();
|
|
28
|
+
}
|
|
29
|
+
/** The app's first start has its own pages, which the person goes through. */
|
|
30
|
+
const FIRST_START = 300_000;
|
|
31
|
+
/**
|
|
32
|
+
* Starts LM Studio's server. The app was never opened: it opens, and once the person is through
|
|
33
|
+
* its first start, its command is there and starts the server.
|
|
34
|
+
*/
|
|
35
|
+
export async function startLmStudio(logs, answers) {
|
|
36
|
+
if (!findLms()) {
|
|
37
|
+
const app = findApp();
|
|
38
|
+
if (process.platform !== "darwin" || !app) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
await logged("open", [app], { logs });
|
|
42
|
+
const ready = async () => findLms() !== null || (await answers());
|
|
43
|
+
if (!(await until(ready, FIRST_START))) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const lms = findLms();
|
|
48
|
+
if (lms && !(await answers())) {
|
|
49
|
+
await logged(lms, ["server", "start"], { logs });
|
|
50
|
+
}
|
|
51
|
+
return until(answers, 60_000);
|
|
52
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type LocalServer } from "@engenty/local-models/servers";
|
|
2
|
+
import { type LocalModelsState, type OfferedModel, type ServerStatus } from "../types.js";
|
|
3
|
+
export interface LocalModelsOptions {
|
|
4
|
+
server: LocalServer;
|
|
5
|
+
/** Where the server answers: a root or `…/v1`. */
|
|
6
|
+
url: () => Promise<string> | string;
|
|
7
|
+
/** The models to download; null: the list is not reachable. */
|
|
8
|
+
offered: () => Promise<readonly OfferedModel[] | null> | readonly OfferedModel[] | null;
|
|
9
|
+
/** The share of the memory a model may take and still leave room for the rest. */
|
|
10
|
+
share: number;
|
|
11
|
+
/** A folder for the logs of an install. */
|
|
12
|
+
logs: () => string;
|
|
13
|
+
/** A model came or went, or the server started. */
|
|
14
|
+
changed?: () => void;
|
|
15
|
+
/** A download begins; what it answers runs once the download ended well. */
|
|
16
|
+
pulling?: (model: string) => Promise<() => Promise<void> | void>;
|
|
17
|
+
/** This computer's memory in bytes. */
|
|
18
|
+
memory?: () => number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The models of a server on this computer: what is there and what each can do, what to download,
|
|
22
|
+
* the downloads and removals a page starts, and the server itself installed and started. Nothing
|
|
23
|
+
* here loads a model.
|
|
24
|
+
*/
|
|
25
|
+
export declare class LocalModels {
|
|
26
|
+
private readonly options;
|
|
27
|
+
private readonly downloads;
|
|
28
|
+
/** While the server is being installed or started, and how that ended. */
|
|
29
|
+
private starting;
|
|
30
|
+
constructor(options: LocalModelsOptions);
|
|
31
|
+
get id(): "lmstudio" | "mlx" | "ollama";
|
|
32
|
+
private get app();
|
|
33
|
+
/** Whether it is on this computer, and whether it runs. */
|
|
34
|
+
status(): Promise<ServerStatus>;
|
|
35
|
+
state(): Promise<LocalModelsState>;
|
|
36
|
+
/** The models the server holds, with the jobs each can do here. */
|
|
37
|
+
private held;
|
|
38
|
+
/**
|
|
39
|
+
* Downloads a model in the background. A download of the same model that runs already is left
|
|
40
|
+
* to finish.
|
|
41
|
+
*/
|
|
42
|
+
pull(model: string): Promise<void>;
|
|
43
|
+
/** Removes a model, and a download of it that failed; the server's reason where it refuses. */
|
|
44
|
+
remove(model: string): Promise<void>;
|
|
45
|
+
/** Installs the server where it is missing and the host can, and starts it, in the background. */
|
|
46
|
+
start(): void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { totalmem } from "node:os";
|
|
2
|
+
import { fits } from "@engenty/local-models/servers";
|
|
3
|
+
import { MODEL_JOBS, } from "../types.js";
|
|
4
|
+
import { freeGb } from "./install.js";
|
|
5
|
+
import { SERVER_APPS } from "./server-apps.js";
|
|
6
|
+
/** The job a capability serves. */
|
|
7
|
+
const JOB_OF = {
|
|
8
|
+
completion: "text",
|
|
9
|
+
embedding: "search",
|
|
10
|
+
decision: "decision",
|
|
11
|
+
};
|
|
12
|
+
const gb = (bytes) => Math.round((bytes / 1e9) * 10) / 10;
|
|
13
|
+
/**
|
|
14
|
+
* The models of a server on this computer: what is there and what each can do, what to download,
|
|
15
|
+
* the downloads and removals a page starts, and the server itself installed and started. Nothing
|
|
16
|
+
* here loads a model.
|
|
17
|
+
*/
|
|
18
|
+
export class LocalModels {
|
|
19
|
+
options;
|
|
20
|
+
downloads = new Map();
|
|
21
|
+
/** While the server is being installed or started, and how that ended. */
|
|
22
|
+
starting = null;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
this.options = options;
|
|
25
|
+
}
|
|
26
|
+
get id() {
|
|
27
|
+
return this.options.server.id;
|
|
28
|
+
}
|
|
29
|
+
get app() {
|
|
30
|
+
return SERVER_APPS[this.id];
|
|
31
|
+
}
|
|
32
|
+
/** Whether it is on this computer, and whether it runs. */
|
|
33
|
+
async status() {
|
|
34
|
+
const { server, url } = this.options;
|
|
35
|
+
const { running } = await server.state(await url());
|
|
36
|
+
return {
|
|
37
|
+
id: server.id,
|
|
38
|
+
name: server.name,
|
|
39
|
+
installed: running || this.app.find() !== null,
|
|
40
|
+
running,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
async state() {
|
|
44
|
+
const { options } = this;
|
|
45
|
+
const { server } = options;
|
|
46
|
+
const url = await options.url();
|
|
47
|
+
const { running, version, trouble } = await server.state(url);
|
|
48
|
+
const bytes = options.memory?.() ?? totalmem();
|
|
49
|
+
const memory = Math.round(bytes / 2 ** 30);
|
|
50
|
+
const installed = running ? await this.held(url, bytes) : [];
|
|
51
|
+
const names = new Set(installed.map((m) => m.name));
|
|
52
|
+
const list = await options.offered();
|
|
53
|
+
return {
|
|
54
|
+
server: {
|
|
55
|
+
id: server.id,
|
|
56
|
+
name: server.name,
|
|
57
|
+
installed: running || this.app.find() !== null,
|
|
58
|
+
running,
|
|
59
|
+
url,
|
|
60
|
+
version,
|
|
61
|
+
trouble,
|
|
62
|
+
canInstall: this.app.install !== undefined,
|
|
63
|
+
download: this.app.download,
|
|
64
|
+
removes: server.remove !== undefined,
|
|
65
|
+
start: this.starting,
|
|
66
|
+
},
|
|
67
|
+
memory,
|
|
68
|
+
free: await freeGb(),
|
|
69
|
+
installed,
|
|
70
|
+
offered: list?.map((m) => ({
|
|
71
|
+
...m,
|
|
72
|
+
installed: names.has(m.name) || names.has(`${m.name}:latest`),
|
|
73
|
+
fits: fits(m.memory, memory, options.share),
|
|
74
|
+
})) ?? null,
|
|
75
|
+
downloads: [...this.downloads.values()],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** The models the server holds, with the jobs each can do here. */
|
|
79
|
+
async held(url, memory) {
|
|
80
|
+
return (await this.options.server.models(url)).map((m) => ({
|
|
81
|
+
name: m.name,
|
|
82
|
+
size: gb(m.size),
|
|
83
|
+
jobs: MODEL_JOBS.filter((job) => m.capabilities.some((c) => JOB_OF[c] === job)),
|
|
84
|
+
capabilities: m.capabilities,
|
|
85
|
+
runner: m.runner,
|
|
86
|
+
quantization: m.quantization,
|
|
87
|
+
fits: fits(m.size, memory, this.options.share),
|
|
88
|
+
loaded: m.running,
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Downloads a model in the background. A download of the same model that runs already is left
|
|
93
|
+
* to finish.
|
|
94
|
+
*/
|
|
95
|
+
async pull(model) {
|
|
96
|
+
const running = this.downloads.get(model);
|
|
97
|
+
if (running && !running.finished) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
const state = { model, done: 0, total: 0, error: null, finished: false };
|
|
101
|
+
this.downloads.set(model, state);
|
|
102
|
+
const pulled = await this.options.pulling?.(model);
|
|
103
|
+
void this.options.server
|
|
104
|
+
.download(await this.options.url(), model, (done, total) => {
|
|
105
|
+
state.done = done;
|
|
106
|
+
state.total = total;
|
|
107
|
+
})
|
|
108
|
+
.then(async () => {
|
|
109
|
+
this.options.changed?.();
|
|
110
|
+
state.finished = true;
|
|
111
|
+
// A finished download is done; the list shows the model itself now.
|
|
112
|
+
this.downloads.delete(model);
|
|
113
|
+
await pulled?.();
|
|
114
|
+
})
|
|
115
|
+
.catch((err) => {
|
|
116
|
+
const unreachable = /fetch failed|ECONNREFUSED/i.test(`${err.message} ${err.cause ?? ""}`);
|
|
117
|
+
state.error = unreachable ? "unreachable" : err.message;
|
|
118
|
+
state.finished = true;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/** Removes a model, and a download of it that failed; the server's reason where it refuses. */
|
|
122
|
+
async remove(model) {
|
|
123
|
+
const { server, url } = this.options;
|
|
124
|
+
this.downloads.delete(model);
|
|
125
|
+
this.options.changed?.();
|
|
126
|
+
if (!server.remove) {
|
|
127
|
+
throw new Error(`${server.name} removes its models itself.`);
|
|
128
|
+
}
|
|
129
|
+
await server.remove(await url(), model);
|
|
130
|
+
}
|
|
131
|
+
/** Installs the server where it is missing and the host can, and starts it, in the background. */
|
|
132
|
+
start() {
|
|
133
|
+
if (this.starting?.running) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const state = { running: true, error: null };
|
|
137
|
+
this.starting = state;
|
|
138
|
+
const { server, url, logs, changed } = this.options;
|
|
139
|
+
const folder = logs();
|
|
140
|
+
void (async () => {
|
|
141
|
+
if (!this.app.find()) {
|
|
142
|
+
if (!this.app.install) {
|
|
143
|
+
throw new Error(`${server.name} isn’t on this computer.`);
|
|
144
|
+
}
|
|
145
|
+
const outcome = await this.app.install(folder, () => undefined);
|
|
146
|
+
if (!outcome.ok) {
|
|
147
|
+
throw new Error(outcome.message);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const address = await url();
|
|
151
|
+
const answers = async () => (await server.state(address)).running;
|
|
152
|
+
if (!(await this.app.start(folder, answers))) {
|
|
153
|
+
throw new Error(`${server.name} isn’t answering.`);
|
|
154
|
+
}
|
|
155
|
+
changed?.();
|
|
156
|
+
})()
|
|
157
|
+
.catch((err) => {
|
|
158
|
+
state.error = err.message;
|
|
159
|
+
})
|
|
160
|
+
.finally(() => {
|
|
161
|
+
state.running = false;
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Where a host keeps which sources a test call has worked on. */
|
|
2
|
+
export interface TestedStore {
|
|
3
|
+
read(): Promise<readonly string[]>;
|
|
4
|
+
write(sources: string[]): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
/** The sources a test call has worked on: the setup is done for those, not for the others. */
|
|
7
|
+
export declare class Tested {
|
|
8
|
+
private readonly store;
|
|
9
|
+
constructor(store: TestedStore);
|
|
10
|
+
has(source: string): Promise<boolean>;
|
|
11
|
+
mark(source: string): Promise<void>;
|
|
12
|
+
}
|