@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,99 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, cn } from "@engenty/chatviews/react/ui";
|
|
3
|
+
import { ArrowLeft, ArrowRight, Check, ChevronDown, RefreshCw } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { useText } from "./host.js";
|
|
6
|
+
const EASE = "ease-[cubic-bezier(0.3,0.7,0.2,1)]";
|
|
7
|
+
/**
|
|
8
|
+
* A line of the list's heading: as wide as its text and shifted, not laid out, to the middle,
|
|
9
|
+
* so it keeps the column's full width and can travel to the left edge.
|
|
10
|
+
*/
|
|
11
|
+
const LINE = "relative w-fit max-w-full transition-[left,translate] duration-700 ease-[cubic-bezier(0.3,0.7,0.2,1)] motion-reduce:transition-none";
|
|
12
|
+
const LINE_MIDDLE = "left-1/2 -translate-x-1/2 text-center";
|
|
13
|
+
/** Beside an opened choice the lines stand at the left edge; on a narrow page the list is alone again and they stay in the middle. */
|
|
14
|
+
const LINE_LEFT = "max-lg:left-1/2 max-lg:-translate-x-1/2 max-lg:text-center lg:left-0 lg:translate-x-0 lg:text-left";
|
|
15
|
+
/** A step by its state: reached, the one to do now, still ahead. */
|
|
16
|
+
const STEP_DONE = "var(--step-done)";
|
|
17
|
+
const STEP_NOW = "var(--step-now)";
|
|
18
|
+
const STEP_LATER = "color-mix(in oklab, var(--on) 38%, transparent)";
|
|
19
|
+
export function Choice({ choice, selected, onPick, }) {
|
|
20
|
+
const { title, description, badge, note } = choice;
|
|
21
|
+
return (_jsxs("button", { type: "button", onClick: onPick, "aria-pressed": selected, className: cn("group relative flex w-full items-center gap-3 rounded-2xl px-4 py-3 text-left transition-[background-color,color,box-shadow] duration-300", selected
|
|
22
|
+
? "bg-(color:--pick) text-(color:--pick-ink) shadow-elevated"
|
|
23
|
+
: "bg-(color:--tile) ring-(color:--tile-ring) ring-1 hover:bg-(color:--tile-hover)"), children: [badge ? (_jsx("span", { className: "absolute -top-2.5 right-4 rounded-full bg-(color:--badge) px-2.5 py-[3px] font-semibold text-(color:--badge-ink) text-[0.6875rem] leading-none tracking-wide shadow-[0_2px_8px_oklch(0%_0_0/0.22)]", children: badge })) : null, _jsx("span", { className: cn("flex size-5 shrink-0 items-center justify-center rounded-full border transition-colors duration-300", selected ? "border-transparent bg-(color:--pick-mark)" : "border-(color:--on)/40"), children: selected ? _jsx(Check, { className: "size-3.5 text-(color:--pick)" }) : null }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block font-medium text-[0.9375rem]", children: title }), _jsx("span", { className: cn("mt-0.5 block truncate text-[0.8125rem]", selected ? "opacity-70" : "text-(color:--on)/65"), children: description })] }), note ? (_jsx("span", { className: cn("shrink-0 text-[0.75rem]", selected ? "opacity-70" : "text-(color:--on)/65"), children: note })) : null, _jsx(ArrowRight, { className: cn("size-4 shrink-0 transition", selected
|
|
24
|
+
? "opacity-70"
|
|
25
|
+
: "text-(color:--on)/40 group-hover:translate-x-0.5 group-hover:text-(color:--on)/80") })] }));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Where the setup stands: what is chosen, its steps by name, then one dash per step. A step
|
|
29
|
+
* reached is green and checked, the one to do now amber, the ones ahead dim. The dashes fill
|
|
30
|
+
* like a strength meter: as many as the step the setup is on, amber on the way, all green once
|
|
31
|
+
* it works.
|
|
32
|
+
*/
|
|
33
|
+
export function Stages({ name, at, done }) {
|
|
34
|
+
const t = useText();
|
|
35
|
+
const stages = [t("setup.stage.connect"), t("setup.stage.test"), t("setup.stage.done")];
|
|
36
|
+
const level = done ? stages.length : at + 1;
|
|
37
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-x-4 gap-y-2 font-medium text-[0.75rem] uppercase tracking-[0.14em]", children: [_jsx("span", { className: "text-(color:--on)/70", children: name }), _jsx("ol", { className: "flex flex-wrap items-center gap-x-3 gap-y-2", children: stages.map((stage, i) => {
|
|
38
|
+
const reached = done || i < at;
|
|
39
|
+
return (_jsxs("li", { "aria-current": !reached && i === at ? "step" : undefined, className: "flex items-center gap-1 transition-colors duration-500", style: { color: reached ? STEP_DONE : i === at ? STEP_NOW : STEP_LATER }, children: [reached ? _jsx(Check, { className: "size-3.5", strokeWidth: 3 }) : null, stage] }, stage));
|
|
40
|
+
}) }), _jsx("span", { "aria-hidden": "true", className: "flex gap-1.5", children: stages.map((stage, i) => (_jsx("span", { className: "h-[3px] w-5 rounded-full transition-colors duration-500", style: {
|
|
41
|
+
background: i < level
|
|
42
|
+
? done
|
|
43
|
+
? STEP_DONE
|
|
44
|
+
: STEP_NOW
|
|
45
|
+
: "color-mix(in oklab, var(--on) 22%, transparent)",
|
|
46
|
+
} }, stage))) })] }));
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* On a narrow page the choices and the opened choice take turns; each starts at the top of
|
|
50
|
+
* whatever scrolls around them.
|
|
51
|
+
*/
|
|
52
|
+
function toTop(from) {
|
|
53
|
+
if (window.matchMedia("(max-width: 1023px)").matches) {
|
|
54
|
+
for (let el = from; el; el = el.parentElement) {
|
|
55
|
+
el.scrollTop = 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The setup: first only the question what the app thinks with, in the middle of the page. A
|
|
61
|
+
* choice steps the list aside and opens what that choice needs (the sign-in, the keys, the test
|
|
62
|
+
* call), its rows level with the list's.
|
|
63
|
+
*/
|
|
64
|
+
export function SetupColumns({ eyebrow, title, sub, figure, top, divider, choices, selected, marked, onPick, recheck, panel, hidden = false, }) {
|
|
65
|
+
const t = useText();
|
|
66
|
+
const root = useRef(null);
|
|
67
|
+
// A narrow page shows the opened choice alone; the person goes back to the choices from there.
|
|
68
|
+
const [listOpen, setListOpen] = useState(false);
|
|
69
|
+
const [moreOpen, setMoreOpen] = useState(false);
|
|
70
|
+
const rest = choices.filter((choice) => choice.more && choice.id !== marked);
|
|
71
|
+
const first = choices.filter((choice) => !rest.includes(choice));
|
|
72
|
+
// The rest comes after what stood there already: no row moves.
|
|
73
|
+
const shown = moreOpen ? [...first, ...rest] : first;
|
|
74
|
+
/** On a narrow page: the opened choice is all there is to see. */
|
|
75
|
+
const panelOnly = selected !== null && !listOpen;
|
|
76
|
+
const pick = async (id) => {
|
|
77
|
+
try {
|
|
78
|
+
await onPick(id);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
setListOpen(false);
|
|
84
|
+
toTop(root.current);
|
|
85
|
+
};
|
|
86
|
+
return (_jsxs(_Fragment, { children: [figure ? (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": "true", className: cn("absolute top-6 left-1/2 z-10 origin-top -translate-x-1/2 transition-[opacity,scale,left] duration-500 motion-reduce:transition-none lg:top-[calc(6vh+5.25rem)] lg:origin-center lg:translate-x-0", EASE, selected
|
|
87
|
+
? "lg:pointer-events-none lg:left-[calc(50%-560px)] lg:scale-75 lg:opacity-0"
|
|
88
|
+
: "lg:left-[calc(50%-508px)] lg:scale-100 lg:opacity-100", panelOnly
|
|
89
|
+
? "max-lg:pointer-events-none max-lg:scale-[0.4] max-lg:opacity-0"
|
|
90
|
+
: "max-lg:scale-[0.6] max-lg:opacity-100"), children: _jsx("div", { className: "animate-rise", children: figure }) }), _jsx("div", { "aria-hidden": "true", className: cn("shrink-0 transition-[height] duration-500 motion-reduce:transition-none lg:h-0", EASE, panelOnly ? "max-lg:h-0" : "max-lg:h-[148px]") })] })) : null, _jsxs("div", { ref: root, className: cn("flex flex-col gap-10 lg:flex-row lg:items-start lg:gap-14", hidden ? "hidden" : ""), children: [_jsxs("section", { className: cn("flex w-full shrink-0 animate-rise flex-col lg:w-[32rem] lg:transition-[margin] lg:duration-700 motion-reduce:transition-none", EASE, selected ? "lg:ml-0" : "lg:ml-[calc(50%-16rem)]", panelOnly ? "max-lg:hidden" : ""), children: [_jsxs("div", { className: "flex flex-col lg:min-h-[6.5rem]", children: [eyebrow ? (_jsx("p", { className: cn(LINE, "font-medium text-(color:--on)/70 text-[0.75rem] uppercase tracking-[0.16em]", selected ? LINE_LEFT : LINE_MIDDLE), children: eyebrow })) : null, _jsx("h1", { className: cn(LINE, "mt-2 font-display font-semibold text-[1.625rem] leading-[1.08] tracking-[-0.02em] sm:text-[1.75rem]", selected ? LINE_LEFT : LINE_MIDDLE), children: title }), _jsx("p", { className: cn(LINE, "mt-2.5 text-(color:--on)/75 text-[0.9375rem] leading-relaxed", selected ? LINE_LEFT : LINE_MIDDLE), children: sub })] }), top?.((id) => void pick(id)), divider ? (_jsxs("div", { className: "mt-7", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("span", { className: "h-px flex-1 bg-(color:--on)/25" }), _jsx("span", { className: "font-medium text-(color:--on)/80 text-[0.75rem] uppercase tracking-[0.14em]", children: divider.label }), _jsx("span", { className: "h-px flex-1 bg-(color:--on)/25" })] }), _jsx("p", { className: "mt-2 text-center text-(color:--on)/65 text-[0.8125rem] leading-snug", children: divider.note })] })) : null, _jsx("div", { className: "mt-5 flex flex-col gap-2.5", children: shown.map((choice) => (_jsx(Choice, { choice: choice, selected: marked === choice.id, onPick: () => void pick(choice.id) }, choice.id))) }), rest.length ? (_jsx("div", { className: "mt-3 flex justify-center", children: _jsxs(Button, { variant: "ghost", size: "sm", "aria-expanded": moreOpen, onClick: () => setMoreOpen(!moreOpen), children: [_jsx(ChevronDown, { className: cn("size-3.5 transition-transform", moreOpen ? "rotate-180" : "") }), moreOpen ? t("setup.less") : t("setup.more")] }) })) : null, recheck ? (_jsxs("div", { className: "mt-1 flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-(color:--on)/60 text-[0.8125rem]", children: [_jsx("span", { children: recheck.note }), _jsxs(Button, { variant: "ghost", size: "sm", busy: recheck.busy, onClick: recheck.run, children: [_jsx(RefreshCw, { className: "size-3.5" }), " ", t("local.recheck")] })] })) : null] }), selected && panel ? (_jsxs("section", { className: cn("min-w-0 flex-1 animate-settle", listOpen ? "max-lg:hidden" : ""), children: [_jsxs("button", { type: "button", onClick: () => {
|
|
91
|
+
setListOpen(true);
|
|
92
|
+
toTop(root.current);
|
|
93
|
+
}, className: "-ml-1.5 mb-5 inline-flex items-center gap-1.5 rounded-full px-1.5 py-1 text-(color:--on)/80 text-[0.875rem] transition hover:text-(color:--on) lg:hidden", children: [_jsx(ArrowLeft, { className: "size-4" }), " ", t("setup.back")] }), _jsxs("div", { className: "relative", children: [panel.figure ? (_jsx("div", { "aria-hidden": "true", className: "absolute top-6 right-2 z-10", children: panel.figure })) : null, _jsxs("div", { className: "min-h-[6.5rem]", children: [_jsx(Stages, { name: panel.name, at: panel.stage, done: panel.works }), _jsx("h2", { className: cn("mt-2 animate-rise font-display font-semibold text-[clamp(28px,3vw,40px)] leading-[1.06] tracking-[-0.03em]", panel.figure ? "pr-32" : ""), children: panel.heading }, panel.heading)] }), _jsx("div", { className: "mt-5 rounded-2xl bg-(color:--panel) p-5 ring-(color:--panel-ring) ring-1 sm:p-6", children: panel.content }), panel.footer ? _jsx("div", { className: "mt-9", children: panel.footer }) : null] })] }, selected)) : null] })] }));
|
|
94
|
+
}
|
|
95
|
+
/** Said once the test worked, above the way on. */
|
|
96
|
+
export function SetupReady() {
|
|
97
|
+
const t = useText();
|
|
98
|
+
return (_jsxs("p", { className: "mb-3 flex animate-rise items-center gap-2 font-medium text-[0.9375rem]", style: { color: STEP_DONE }, children: [_jsx(Check, { className: "size-4", strokeWidth: 3 }), t("setup.ready")] }));
|
|
99
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type SetupText, type SetupVars } from "../texts.js";
|
|
3
|
+
import type { TerminalEvent } from "../types.js";
|
|
4
|
+
/** What the setup's parts need of the app that shows them. Paths are below the setup's routes. */
|
|
5
|
+
export interface SetupHostApi {
|
|
6
|
+
lang: "en" | "de";
|
|
7
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
8
|
+
put<T>(path: string, body: unknown): Promise<T>;
|
|
9
|
+
del(path: string): Promise<unknown>;
|
|
10
|
+
/** Follows a terminal until its end; the answer stops following. */
|
|
11
|
+
follow(terminal: string, on: (event: TerminalEvent) => void): () => void;
|
|
12
|
+
/** Opens a page in the person's own browser. */
|
|
13
|
+
open(url: string): void;
|
|
14
|
+
/** Something changed: a client was looked at again, a test worked, a key was kept. */
|
|
15
|
+
changed(): unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare function SetupProvider({ host, children }: {
|
|
18
|
+
host: SetupHostApi;
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function useSetupHost(): SetupHostApi;
|
|
22
|
+
/** The setup's words in the host's language. */
|
|
23
|
+
export declare function useText(): (key: SetupText, vars?: SetupVars) => string;
|
|
24
|
+
/** A call the person starts: whether it runs, what came of it. A newer call replaces an older one. */
|
|
25
|
+
export declare function useCall<A extends unknown[], T>(call: (...args: A) => Promise<T>): {
|
|
26
|
+
busy: boolean;
|
|
27
|
+
data?: T;
|
|
28
|
+
error?: string;
|
|
29
|
+
run: (...args: A) => Promise<T | undefined>;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
3
|
+
import { setupText } from "../texts.js";
|
|
4
|
+
const Host = createContext(null);
|
|
5
|
+
export function SetupProvider({ host, children }) {
|
|
6
|
+
return _jsx(Host.Provider, { value: host, children: children });
|
|
7
|
+
}
|
|
8
|
+
export function useSetupHost() {
|
|
9
|
+
const host = useContext(Host);
|
|
10
|
+
if (!host) {
|
|
11
|
+
throw new Error("The setup's parts need a SetupProvider.");
|
|
12
|
+
}
|
|
13
|
+
return host;
|
|
14
|
+
}
|
|
15
|
+
/** The setup's words in the host's language. */
|
|
16
|
+
export function useText() {
|
|
17
|
+
const { lang } = useSetupHost();
|
|
18
|
+
return useCallback((key, vars) => setupText(lang, key, vars), [lang]);
|
|
19
|
+
}
|
|
20
|
+
/** A call the person starts: whether it runs, what came of it. A newer call replaces an older one. */
|
|
21
|
+
export function useCall(call) {
|
|
22
|
+
const [state, setState] = useState({ busy: false });
|
|
23
|
+
const latest = useRef(call);
|
|
24
|
+
latest.current = call;
|
|
25
|
+
const round = useRef(0);
|
|
26
|
+
const run = useCallback(async (...args) => {
|
|
27
|
+
const mine = ++round.current;
|
|
28
|
+
setState({ busy: true });
|
|
29
|
+
try {
|
|
30
|
+
const data = await latest.current(...args);
|
|
31
|
+
if (mine === round.current) {
|
|
32
|
+
setState({ busy: false, data });
|
|
33
|
+
}
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
if (mine === round.current) {
|
|
38
|
+
setState({ busy: false, error: err.message });
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}, []);
|
|
43
|
+
const reset = useCallback(() => {
|
|
44
|
+
round.current++;
|
|
45
|
+
setState({ busy: false });
|
|
46
|
+
}, []);
|
|
47
|
+
return { ...state, run, reset };
|
|
48
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ClientPanel, ModelTest, rankClients, type TestResult, useClientChoices, useClientStage, } from "./client.js";
|
|
2
|
+
export { Choice, type SetupChoice, SetupColumns, type SetupPanel, SetupReady, Stages, } from "./columns.js";
|
|
3
|
+
export { type SetupHostApi, SetupProvider, useCall, useSetupHost, useText } from "./host.js";
|
|
4
|
+
export { type KeyProvider, OwnKeys, ServerAddress, type SourceResult } from "./keys.js";
|
|
5
|
+
export { LocalModels, modelsMoving } from "./local-models.js";
|
|
6
|
+
export { useServerChoices } from "./servers.js";
|
|
7
|
+
export { SETUP_GROUND, SETUP_GROUND_INK, SETUP_ON_GROUND, SETUP_ON_PAPER, SETUP_ON_THEME, } from "./tone.js";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { ClientPanel, ModelTest, rankClients, useClientChoices, useClientStage, } from "./client.js";
|
|
2
|
+
export { Choice, SetupColumns, SetupReady, Stages, } from "./columns.js";
|
|
3
|
+
export { SetupProvider, useCall, useSetupHost, useText } from "./host.js";
|
|
4
|
+
export { OwnKeys, ServerAddress } from "./keys.js";
|
|
5
|
+
export { LocalModels, modelsMoving } from "./local-models.js";
|
|
6
|
+
export { useServerChoices } from "./servers.js";
|
|
7
|
+
export { SETUP_GROUND, SETUP_GROUND_INK, SETUP_ON_GROUND, SETUP_ON_PAPER, SETUP_ON_THEME, } from "./tone.js";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ServerId } from "@engenty/local-models/servers";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
/** What the test of a key or of a server answered. */
|
|
4
|
+
export interface SourceResult {
|
|
5
|
+
ok: boolean;
|
|
6
|
+
message: string | null;
|
|
7
|
+
/** The model the app now writes with; null where none does. */
|
|
8
|
+
text: string | null;
|
|
9
|
+
}
|
|
10
|
+
/** A provider whose key the setup takes. */
|
|
11
|
+
export interface KeyProvider {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
keyUrl: string;
|
|
15
|
+
keyPlaceholder: string;
|
|
16
|
+
/** A key is stored. */
|
|
17
|
+
stored: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface Names {
|
|
20
|
+
/** A model's name as the person reads it. */
|
|
21
|
+
modelName?: (ref: string) => string;
|
|
22
|
+
/** Whether the model a test answered with runs on this row. */
|
|
23
|
+
mine: (ref: string) => boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Own keys, each tested on its own: a key that works is stored and put to use, and the first one
|
|
27
|
+
* ends the setup.
|
|
28
|
+
*/
|
|
29
|
+
export declare function OwnKeys({ providers, isOf, modelName, onRemove, hint, later, children, }: {
|
|
30
|
+
providers: readonly KeyProvider[];
|
|
31
|
+
/** Whether a model runs on a provider's key. */
|
|
32
|
+
isOf: (ref: string, provider: string) => boolean;
|
|
33
|
+
modelName?: (ref: string) => string;
|
|
34
|
+
onRemove: (provider: string) => Promise<unknown>;
|
|
35
|
+
hint?: string;
|
|
36
|
+
/** Below the rows: where to change it later. */
|
|
37
|
+
later?: string;
|
|
38
|
+
/** More rows. */
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
/** A server for open models at an address of the person's. */
|
|
42
|
+
export declare function ServerAddress({ id, name, url: saved, modelName, }: {
|
|
43
|
+
id: ServerId;
|
|
44
|
+
name: string;
|
|
45
|
+
url: string;
|
|
46
|
+
modelName?: Names["modelName"];
|
|
47
|
+
}): import("react").JSX.Element;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, cn, Input, Label } from "@engenty/chatviews/react/ui";
|
|
3
|
+
import { Check, ExternalLink } from "lucide-react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useCall, useSetupHost, useText } from "./host.js";
|
|
6
|
+
/**
|
|
7
|
+
* Own keys, each tested on its own: a key that works is stored and put to use, and the first one
|
|
8
|
+
* ends the setup.
|
|
9
|
+
*/
|
|
10
|
+
export function OwnKeys({ providers, isOf, modelName, onRemove, hint, later, children, }) {
|
|
11
|
+
const t = useText();
|
|
12
|
+
return (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsxs("div", { children: [_jsx(Label, { children: t("local.keys") }), _jsx("p", { className: "text-[0.8125rem] text-ink-3", children: hint ?? t("local.keysHint") })] }), _jsxs("div", { className: "flex flex-col", children: [providers.map((provider) => (_jsx(KeyRow, { provider: provider, modelName: modelName, mine: (ref) => isOf(ref, provider.id), onRemove: () => onRemove(provider.id) }, provider.id))), children] }), later ? _jsx("p", { className: "text-[0.8125rem] text-ink-3", children: later }) : null] }));
|
|
13
|
+
}
|
|
14
|
+
function useSourceTest(path) {
|
|
15
|
+
const host = useSetupHost();
|
|
16
|
+
return useCall(async (body) => {
|
|
17
|
+
const result = await host.post(path, body);
|
|
18
|
+
// A working key ends the setup: the page learns it.
|
|
19
|
+
await host.changed();
|
|
20
|
+
return result;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function KeyRow({ provider, onRemove, ...names }) {
|
|
24
|
+
const host = useSetupHost();
|
|
25
|
+
const t = useText();
|
|
26
|
+
const [value, setValue] = useState("");
|
|
27
|
+
const test = useSourceTest(`/keys/${provider.id}`);
|
|
28
|
+
// A stored key is tested again with an empty field; a working new one leaves the field.
|
|
29
|
+
const run = async () => {
|
|
30
|
+
const result = await test.run(value.trim() ? { key: value.trim() } : {});
|
|
31
|
+
if (result?.ok) {
|
|
32
|
+
setValue("");
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const remove = useCall(async () => {
|
|
36
|
+
await onRemove();
|
|
37
|
+
test.reset();
|
|
38
|
+
await host.changed();
|
|
39
|
+
});
|
|
40
|
+
return (_jsx(Row, { label: provider.name, sub: _jsxs("button", { type: "button", onClick: () => host.open(provider.keyUrl), className: "inline-flex items-center gap-1 text-left hover:text-ink-2 hover:underline", children: [t("local.keyGet"), " ", _jsx(ExternalLink, { className: "size-3" })] }), input: _jsx(Input, { type: "password", autoComplete: "off", "aria-label": provider.name, className: "min-w-0 flex-1 font-mono text-[0.8125rem]", placeholder: provider.stored ? t("local.keySet") : provider.keyPlaceholder, value: value, onChange: (e) => setValue(e.target.value), onKeyDown: (e) => {
|
|
41
|
+
if (e.key === "Enter" && value.trim()) {
|
|
42
|
+
void run();
|
|
43
|
+
}
|
|
44
|
+
} }), actions: _jsxs(_Fragment, { children: [_jsx(Button, { variant: "secondary", busy: test.busy, disabled: !provider.stored && !value.trim(), onClick: () => void run(), children: t("local.test") }), provider.stored ? (_jsx(Button, { variant: "ghost", size: "sm", busy: remove.busy, onClick: () => void remove.run(), children: t("local.keyRemove") })) : null] }), said: useSaid(test, names) }));
|
|
45
|
+
}
|
|
46
|
+
/** A server for open models at an address of the person's. */
|
|
47
|
+
export function ServerAddress({ id, name, url: saved, modelName, }) {
|
|
48
|
+
const t = useText();
|
|
49
|
+
const [url, setUrl] = useState(saved);
|
|
50
|
+
const test = useSourceTest(`/servers/${id}/address`);
|
|
51
|
+
return (_jsx(Row, { label: t("local.address"), sub: t("local.serverWhere"), input: _jsx(Input, { "aria-label": name, className: "min-w-0 flex-1 font-mono text-[0.8125rem]", value: url, onChange: (e) => setUrl(e.target.value) }), actions: _jsx(Button, { variant: "secondary", busy: test.busy, disabled: !url.trim(), onClick: () => void test.run({ url: url.trim() }), children: t("local.test") }), said: useSaid(test, { modelName, mine: (ref) => ref.startsWith(`${id}:`) }) }));
|
|
52
|
+
}
|
|
53
|
+
/** The line under a row once its test answered. */
|
|
54
|
+
function useSaid(test, { mine, modelName }) {
|
|
55
|
+
const t = useText();
|
|
56
|
+
if (test.error) {
|
|
57
|
+
return { ok: false, text: test.error };
|
|
58
|
+
}
|
|
59
|
+
const r = test.data;
|
|
60
|
+
if (!r) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
if (!r.ok) {
|
|
64
|
+
return { ok: false, text: r.message ?? t("setup.keyBad") };
|
|
65
|
+
}
|
|
66
|
+
if (!r.text) {
|
|
67
|
+
return { ok: true, text: t("local.keyWorksPlain") };
|
|
68
|
+
}
|
|
69
|
+
const model = modelName?.(r.text) ?? r.text;
|
|
70
|
+
return { ok: true, text: t(mine(r.text) ? "local.keyWorks" : "local.keyWorksOther", { model }) };
|
|
71
|
+
}
|
|
72
|
+
function Row({ label, sub, input, actions, said, }) {
|
|
73
|
+
return (_jsxs("div", { className: "grid gap-x-3 gap-y-1.5 border-border-soft border-t py-3 sm:grid-cols-[10rem_minmax(0,1fr)]", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[0.875rem] text-ink-2", children: label }), _jsx("div", { className: "text-[0.75rem] text-ink-4", children: sub })] }), _jsxs("div", { className: "flex min-w-0 flex-col gap-1.5", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [input, actions] }), said ? (_jsxs("p", { className: cn("flex items-start gap-1.5 text-[0.8125rem]", said.ok ? "text-moss" : "text-rose"), children: [said.ok ? _jsx(Check, { className: "mt-0.5 size-3.5 shrink-0", strokeWidth: 3 }) : null, said.text] })) : null] })] }));
|
|
74
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type LocalModelsState, type ModelJob } from "../types.js";
|
|
2
|
+
/** Whether the state is still changing: a download runs, or the server starts. */
|
|
3
|
+
export declare function modelsMoving(state: LocalModelsState | undefined): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* The models of a server on this computer. For one job: the ones there (to use or remove), the
|
|
6
|
+
* ones offered (to download and use), and any other name the server knows. Without a job, all of
|
|
7
|
+
* them with the jobs each serves, to download or remove. Where the server does not run, a way to
|
|
8
|
+
* start it — or to get it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function LocalModels({ state, onState, job, inUse, disabled, onChoose, onlyHeld, }: {
|
|
11
|
+
/** As `GET /servers/:id` answers it; asked again while `modelsMoving`. */
|
|
12
|
+
state: LocalModelsState | undefined;
|
|
13
|
+
/** What a change answered. */
|
|
14
|
+
onState: (next: LocalModelsState) => void;
|
|
15
|
+
/** Absent: every job, and nothing to choose. */
|
|
16
|
+
job?: ModelJob;
|
|
17
|
+
/** The models in use; they are not removed. */
|
|
18
|
+
inUse: string[];
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onChoose?: (model: string) => void;
|
|
21
|
+
/** Only a model that is there is chosen; a download only downloads. */
|
|
22
|
+
onlyHeld?: boolean;
|
|
23
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button, cn, Input } from "@engenty/chatviews/react/ui";
|
|
3
|
+
import { ExternalLink, Trash2 } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { MODEL_JOBS } from "../types.js";
|
|
6
|
+
import { useCall, useSetupHost, useText } from "./host.js";
|
|
7
|
+
/** Ollama's own installer on Linux, which asks for a password in a terminal. */
|
|
8
|
+
const OLLAMA_ON_LINUX = "curl -fsSL https://ollama.com/install.sh | sh";
|
|
9
|
+
/** What the free field takes, by server. */
|
|
10
|
+
const EXAMPLE = {
|
|
11
|
+
ollama: "llama3.2:3b",
|
|
12
|
+
lmstudio: "openai/gpt-oss-20b",
|
|
13
|
+
mlx: "mlx-community/Qwen3-8B-4bit",
|
|
14
|
+
};
|
|
15
|
+
/** A job's name. */
|
|
16
|
+
const JOB_LABEL = {
|
|
17
|
+
text: "models.cap.text",
|
|
18
|
+
search: "models.cap.search",
|
|
19
|
+
decision: "models.cap.decision",
|
|
20
|
+
};
|
|
21
|
+
/** Whether the state is still changing: a download runs, or the server starts. */
|
|
22
|
+
export function modelsMoving(state) {
|
|
23
|
+
return Boolean(state && (state.downloads.some((d) => !d.finished) || state.server.start?.running));
|
|
24
|
+
}
|
|
25
|
+
/** What a model can do beyond its job, as chips. */
|
|
26
|
+
const CAP_CHIPS = ["vision", "audio", "tools"];
|
|
27
|
+
/** Numbers as the host's language writes them. */
|
|
28
|
+
function useNumbers() {
|
|
29
|
+
const { lang } = useSetupHost();
|
|
30
|
+
return {
|
|
31
|
+
mb: (bytes) => Math.round(bytes / 1e6).toLocaleString(lang),
|
|
32
|
+
gb: (n) => n.toLocaleString(lang, { maximumFractionDigits: 1 }),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Ollama names a model without a tag as `name:latest`. */
|
|
36
|
+
const sameModel = (a, b) => a === b || a === `${b}:latest` || `${a}:latest` === b;
|
|
37
|
+
function Chip({ children, tone }) {
|
|
38
|
+
return (_jsx("span", { className: cn("inline-flex min-h-5 items-center rounded-full px-2 py-[3px] text-[0.6875rem] leading-tight", tone === "done" ? "bg-moss-tint text-moss" : "bg-paper-2 text-ink-3"), children: children }));
|
|
39
|
+
}
|
|
40
|
+
function Group({ title, children }) {
|
|
41
|
+
return (_jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[0.75rem] text-ink-3", children: title }), _jsx("div", { className: "flex flex-col divide-y divide-border-soft rounded-xl border border-border-soft", children: children })] }));
|
|
42
|
+
}
|
|
43
|
+
function Row({ children, actions }) {
|
|
44
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-2 px-3 py-2.5", children: [_jsx("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: children }), _jsx("div", { className: "flex shrink-0 items-center gap-2", children: actions })] }));
|
|
45
|
+
}
|
|
46
|
+
function DownloadState({ download, server }) {
|
|
47
|
+
const t = useText();
|
|
48
|
+
const { mb } = useNumbers();
|
|
49
|
+
if (download.error) {
|
|
50
|
+
return (_jsx("p", { className: "text-[0.8125rem] text-rose", children: download.error === "unreachable"
|
|
51
|
+
? t("models.local.downloadUnreachable", { name: server })
|
|
52
|
+
: t("models.local.downloadFailed", { error: download.error }) }));
|
|
53
|
+
}
|
|
54
|
+
return (_jsx("span", { className: "text-[0.8125rem] text-ink-2 tabular-nums", children: download.total
|
|
55
|
+
? t("models.local.progress", { done: mb(download.done), total: mb(download.total) })
|
|
56
|
+
: t("models.local.starting") }));
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The models of a server on this computer. For one job: the ones there (to use or remove), the
|
|
60
|
+
* ones offered (to download and use), and any other name the server knows. Without a job, all of
|
|
61
|
+
* them with the jobs each serves, to download or remove. Where the server does not run, a way to
|
|
62
|
+
* start it — or to get it.
|
|
63
|
+
*/
|
|
64
|
+
export function LocalModels({ state, onState, job, inUse, disabled, onChoose, onlyHeld = false, }) {
|
|
65
|
+
const host = useSetupHost();
|
|
66
|
+
const t = useText();
|
|
67
|
+
const { gb } = useNumbers();
|
|
68
|
+
const path = `/servers/${state?.server.id}`;
|
|
69
|
+
const [other, setOther] = useState("");
|
|
70
|
+
/** The model whose removal waits for a yes. */
|
|
71
|
+
const [asking, setAsking] = useState(null);
|
|
72
|
+
const pull = useCall(async (model) => onState(await host.post(`${path}/pull`, { model })));
|
|
73
|
+
const remove = useCall(async (model) => onState((await host.del(`${path}/models?model=${encodeURIComponent(model)}`))));
|
|
74
|
+
const start = useCall(async () => onState(await host.post(`${path}/start`, {})));
|
|
75
|
+
// A model that arrived or went changes what can answer.
|
|
76
|
+
const held = state?.installed.map((m) => m.name).join(" ");
|
|
77
|
+
const known = useRef(held);
|
|
78
|
+
const changed = useRef(host.changed);
|
|
79
|
+
changed.current = host.changed;
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (known.current !== undefined && held !== undefined && known.current !== held) {
|
|
82
|
+
void changed.current();
|
|
83
|
+
}
|
|
84
|
+
known.current = held;
|
|
85
|
+
}, [held]);
|
|
86
|
+
if (!state) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
const { server } = state;
|
|
90
|
+
const { name } = server;
|
|
91
|
+
if (!server.running) {
|
|
92
|
+
const starting = Boolean(server.start?.running) || start.busy;
|
|
93
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("p", { className: "text-[0.8125rem] text-ink-2", children: t(server.installed ? "models.local.stopped" : "models.local.notHere", { name }) }), server.installed || server.canInstall ? (_jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsx(Button, { busy: starting, disabled: disabled || starting, onClick: () => void start.run(), children: t(server.installed ? "models.local.start" : "models.local.install", { name }) }), starting ? (_jsx("span", { className: "text-[0.8125rem] text-ink-2", children: server.id === "mlx" ? null : t(`models.local.starts.${server.id}`) })) : null] })) : (_jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [_jsxs(Button, { onClick: () => host.open(server.download), children: [t("models.local.get", { name }), " ", _jsx(ExternalLink, { className: "size-3.5" })] }), server.id === "ollama" ? (_jsxs("span", { className: "text-[0.8125rem] text-ink-2", children: [t("harness.install"), " ", _jsx("code", { className: "font-mono text-[0.75rem]", children: OLLAMA_ON_LINUX })] })) : null] })), server.start?.error ? (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t("models.local.startFailed", { name, error: server.start.error }) })) : null] }));
|
|
94
|
+
}
|
|
95
|
+
if (server.trouble) {
|
|
96
|
+
return (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t(`models.local.trouble.${server.trouble}`, { name }) }));
|
|
97
|
+
}
|
|
98
|
+
const downloadOf = (model) => state.downloads.find((d) => sameModel(d.model, model));
|
|
99
|
+
const use = (model) => {
|
|
100
|
+
if (!state.installed.some((m) => sameModel(m.name, model))) {
|
|
101
|
+
void pull.run(model);
|
|
102
|
+
if (onlyHeld) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
onChoose?.(model);
|
|
107
|
+
};
|
|
108
|
+
const choosesNew = Boolean(onChoose) && !onlyHeld;
|
|
109
|
+
const here = job ? state.installed.filter((m) => m.jobs.includes(job)) : state.installed;
|
|
110
|
+
const offered = state.offered?.filter((m) => (job ? m.job === job : true) && !m.installed) ?? null;
|
|
111
|
+
// Per job, the first one that fits this computer.
|
|
112
|
+
const suggested = new Set(MODEL_JOBS.map((j) => offered?.find((m) => m.job === j && m.fits)?.name));
|
|
113
|
+
// Downloads of names from the free field, which no list shows.
|
|
114
|
+
const others = state.downloads.filter((d) => !(here.some((m) => sameModel(m.name, d.model)) || offered?.some((m) => m.name === d.model)));
|
|
115
|
+
return (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Group, { title: [t("models.local.here"), [name, server.version].filter(Boolean).join(" ")].join(" · "), children: here.length ? (here.map((m) => {
|
|
116
|
+
const used = inUse.some((name) => sameModel(m.name, name));
|
|
117
|
+
return (_jsxs(Row, { actions: _jsxs(_Fragment, { children: [used ? (_jsx(Chip, { tone: "done", children: t("models.local.inUse") })) : !onChoose ? null : (_jsx(Button, { variant: "secondary", size: "sm", disabled: disabled, onClick: () => onChoose(m.name), children: t("models.local.use") })), asking === m.name || !server.removes ? null : (_jsx("button", { type: "button", className: "grid size-8 place-items-center rounded-lg text-ink-3 hover:bg-paper-2 hover:text-rose disabled:opacity-50", title: t("models.local.remove", { name }), "aria-label": t("models.local.remove", { name }), disabled: disabled || used || remove.busy, onClick: () => setAsking(m.name), children: _jsx(Trash2, { className: "size-4" }) }))] }), children: [_jsx("span", { className: "break-all font-mono text-[0.8125rem]", children: m.name }), _jsxs("span", { className: "flex flex-wrap gap-1", children: [job ? null : m.jobs.map((j) => _jsx(Chip, { children: t(JOB_LABEL[j]) }, j)), _jsx(Chip, { children: t("models.local.size", { size: gb(m.size) }) }), m.runner === "mlx" ? _jsx(Chip, { children: "MLX" }) : null, CAP_CHIPS.filter((c) => m.capabilities.includes(c)).map((c) => (_jsx(Chip, { children: t(`models.local.cap.${c}`) }, c))), m.loaded ? _jsx(Chip, { tone: "done", children: t("models.local.loaded") }) : null, m.fits ? null : _jsx(Chip, { children: t("models.local.tooBig", { memory: gb(m.size) }) })] }), asking === m.name ? (_jsxs("span", { className: "flex flex-wrap items-center gap-2 text-[0.8125rem] text-ink-2", children: [t("models.local.removeConfirm", {
|
|
118
|
+
name: m.name,
|
|
119
|
+
server: name,
|
|
120
|
+
size: gb(m.size),
|
|
121
|
+
}), _jsx(Button, { variant: "danger", size: "sm", busy: remove.busy, onClick: async () => {
|
|
122
|
+
await remove.run(m.name);
|
|
123
|
+
setAsking(null);
|
|
124
|
+
}, children: t("models.local.removeYes") }), _jsx(Button, { variant: "ghost", size: "sm", onClick: () => setAsking(null), children: t("setup.cancel") })] })) : null] }, m.name));
|
|
125
|
+
})) : (_jsx("p", { className: "px-3 py-2.5 text-[0.8125rem] text-ink-3", children: t("models.local.hereNone") })) }), remove.error ? (_jsx("p", { className: "text-[0.8125rem] text-rose", children: t("models.local.removeFailed", { name, error: remove.error }) })) : null, server.removes || !here.length ? null : (_jsx("p", { className: "text-[0.8125rem] text-ink-3", children: t("models.local.removeThere", { name }) })), offered === null ? (_jsx("p", { className: "text-[0.8125rem] text-ink-3", children: t("models.local.offeredNone") })) : offered.length ? (_jsx(Group, { title: t("models.local.offered"), children: offered.map((m) => {
|
|
126
|
+
const download = downloadOf(m.name);
|
|
127
|
+
const running = Boolean(download && !download.finished);
|
|
128
|
+
return (_jsxs(Row, { actions: running && download ? (_jsx(DownloadState, { download: download, server: name })) : (_jsx(Button, { variant: suggested.has(m.name) ? "primary" : "secondary", size: "sm", disabled: disabled, onClick: () => use(m.name), children: choosesNew ? t("models.local.download") : t("models.local.downloadOnly") })), children: [_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "break-all font-mono text-[0.8125rem]", children: m.name }), suggested.has(m.name) ? (_jsx(Chip, { tone: "done", children: t("models.local.suggested") })) : null] }), _jsx("span", { className: "text-[0.8125rem] text-ink-2", children: m.note[host.lang] }), _jsxs("span", { className: "flex flex-wrap gap-1", children: [job ? null : _jsx(Chip, { children: t(JOB_LABEL[m.job]) }), _jsx(Chip, { children: t("models.local.size", { size: gb(m.size) }) }), m.fits ? null : (_jsx(Chip, { children: t("models.local.tooBig", { memory: gb(m.memory) }) }))] }), download?.error ? _jsx(DownloadState, { download: download, server: name }) : null] }, m.name));
|
|
129
|
+
}) })) : null, _jsxs("div", { className: "flex flex-col gap-1.5", children: [_jsx("span", { className: "text-[0.75rem] text-ink-3", children: t("models.local.other", { name }) }), _jsxs("form", { className: "grid gap-2 sm:grid-cols-[minmax(0,1fr)_auto]", onSubmit: (e) => {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
use(other.trim());
|
|
132
|
+
setOther("");
|
|
133
|
+
}, children: [_jsx(Input, { className: "font-mono text-[0.8125rem]", value: other, placeholder: t("models.local.example", { model: EXAMPLE[server.id] }), disabled: disabled, onChange: (e) => setOther(e.target.value) }), _jsx(Button, { type: "submit", variant: "secondary", disabled: disabled || !other.trim(), children: choosesNew ? t("models.local.use") : t("models.local.downloadOnly") })] }), others.map((d) => (_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: "font-mono text-[0.8125rem]", children: d.model }), _jsx(DownloadState, { download: d, server: name })] }, d.model)))] })] }));
|
|
134
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ServerStatus } from "../types.js";
|
|
2
|
+
import type { SetupChoice } from "./columns.js";
|
|
3
|
+
/** The servers for open models as rows of the list; one that is not on this computer is among the rest. */
|
|
4
|
+
export declare function useServerChoices(servers: readonly ServerStatus[]): SetupChoice[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useText } from "./host.js";
|
|
2
|
+
/** The servers for open models as rows of the list; one that is not on this computer is among the rest. */
|
|
3
|
+
export function useServerChoices(servers) {
|
|
4
|
+
const t = useText();
|
|
5
|
+
return servers.map((server) => ({
|
|
6
|
+
id: server.id,
|
|
7
|
+
title: server.name,
|
|
8
|
+
description: t("server.desc"),
|
|
9
|
+
...(server.installed
|
|
10
|
+
? { note: t("server.here") }
|
|
11
|
+
: { note: t("harness.notInstalled"), more: true }),
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "@xterm/xterm/css/xterm.css";
|
|
2
|
+
/**
|
|
3
|
+
* A terminal of the host, shown inline: what the command prints arrives as a stream, every key
|
|
4
|
+
* goes back to it. The host keeps the session; this is its screen and keyboard.
|
|
5
|
+
*/
|
|
6
|
+
export default function Terminal({ id, onExit, onDone, className, }: {
|
|
7
|
+
id: string;
|
|
8
|
+
/** The command ended with this exit code. */
|
|
9
|
+
onExit?: (code: number) => void;
|
|
10
|
+
/** The command did what it was started for; it may still be running. */
|
|
11
|
+
onDone?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FitAddon } from "@xterm/addon-fit";
|
|
3
|
+
import { WebLinksAddon } from "@xterm/addon-web-links";
|
|
4
|
+
import { Terminal as Xterm } from "@xterm/xterm";
|
|
5
|
+
import "@xterm/xterm/css/xterm.css";
|
|
6
|
+
import { cn } from "@engenty/chatviews/react/ui";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
8
|
+
import { useSetupHost } from "./host.js";
|
|
9
|
+
/**
|
|
10
|
+
* A terminal of the host, shown inline: what the command prints arrives as a stream, every key
|
|
11
|
+
* goes back to it. The host keeps the session; this is its screen and keyboard.
|
|
12
|
+
*/
|
|
13
|
+
export default function Terminal({ id, onExit, onDone, className, }) {
|
|
14
|
+
const el = useRef(null);
|
|
15
|
+
const api = useRef(useSetupHost());
|
|
16
|
+
const exit = useRef(onExit);
|
|
17
|
+
exit.current = onExit;
|
|
18
|
+
const done = useRef(onDone);
|
|
19
|
+
done.current = onDone;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const at = el.current;
|
|
22
|
+
if (!at) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const host = api.current;
|
|
26
|
+
const term = new Xterm({
|
|
27
|
+
fontSize: 13,
|
|
28
|
+
lineHeight: 1.2,
|
|
29
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
|
|
30
|
+
cursorBlink: true,
|
|
31
|
+
scrollback: 3000,
|
|
32
|
+
theme: {
|
|
33
|
+
background: "#0f1424",
|
|
34
|
+
foreground: "#e6e9f2",
|
|
35
|
+
cursor: "#f0b35b",
|
|
36
|
+
selectionBackground: "#2f3a5f",
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const fit = new FitAddon();
|
|
40
|
+
term.loadAddon(fit);
|
|
41
|
+
// A sign-in link the browser did not open by itself: a click opens it.
|
|
42
|
+
term.loadAddon(new WebLinksAddon((_event, uri) => host.open(uri)));
|
|
43
|
+
term.open(at);
|
|
44
|
+
const path = `/terminal/${id}`;
|
|
45
|
+
const quiet = () => undefined;
|
|
46
|
+
const sync = () => {
|
|
47
|
+
try {
|
|
48
|
+
fit.fit();
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// not laid out yet
|
|
52
|
+
}
|
|
53
|
+
void host.post(`${path}/resize`, { cols: term.cols, rows: term.rows }).catch(quiet);
|
|
54
|
+
};
|
|
55
|
+
sync();
|
|
56
|
+
const observer = new ResizeObserver(sync);
|
|
57
|
+
observer.observe(at);
|
|
58
|
+
const input = term.onData((data) => void host.post(`${path}/input`, { data }).catch(quiet));
|
|
59
|
+
const stop = host.follow(id, (event) => {
|
|
60
|
+
if (event.type === "data") {
|
|
61
|
+
term.write(event.data);
|
|
62
|
+
}
|
|
63
|
+
else if (event.type === "done") {
|
|
64
|
+
done.current?.();
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
exit.current?.(event.code);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
term.focus();
|
|
71
|
+
return () => {
|
|
72
|
+
stop();
|
|
73
|
+
observer.disconnect();
|
|
74
|
+
input.dispose();
|
|
75
|
+
term.dispose();
|
|
76
|
+
};
|
|
77
|
+
}, [id]);
|
|
78
|
+
return (_jsx("div", { ref: el, className: cn("h-[28rem] max-h-[60dvh] w-full overflow-hidden rounded-lg bg-[#0f1424] p-2", className) }));
|
|
79
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
/** The studio's vivid ground and the text on white, as on the landing page. */
|
|
3
|
+
export declare const SETUP_GROUND = "oklch(50% 0.2 262)";
|
|
4
|
+
export declare const SETUP_GROUND_INK = "oklch(32% 0.15 262)";
|
|
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 declare const SETUP_ON_GROUND: CSSProperties;
|
|
10
|
+
/** On the theme's light paper: the ground's blue marks the pick. */
|
|
11
|
+
export declare const SETUP_ON_PAPER: CSSProperties;
|
|
12
|
+
/** On whatever ground the theme has: the pick stands in the theme's ink. */
|
|
13
|
+
export declare const SETUP_ON_THEME: CSSProperties;
|