@engenty/wizards-runtime 0.20.6 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/apps/runtime/dist/agents/studio-assistant.js +7 -3
- package/apps/runtime/dist/agents/subscription.js +4 -17
- package/apps/runtime/dist/app.js +4 -1
- package/apps/runtime/dist/cli/clients.js +6 -24
- package/apps/runtime/dist/cli/connect.js +2 -1
- package/apps/runtime/dist/cli/environment.js +3 -0
- package/apps/runtime/dist/cli/machine.js +1 -70
- package/apps/runtime/dist/cli/main.js +2 -1
- package/apps/runtime/dist/cli/ollama.js +1 -179
- package/apps/runtime/dist/cli/setup.js +8 -6
- package/apps/runtime/dist/docs/dev/licensing.md +15 -9
- package/apps/runtime/dist/docs/user-guide/command-line.md +3 -0
- package/apps/runtime/dist/elements/outside.js +2 -1
- package/apps/runtime/dist/engine/code-step.js +1 -1
- package/apps/runtime/dist/engine/decide.js +2 -2
- package/apps/runtime/dist/engine/input.js +1 -1
- package/apps/runtime/dist/engine/runner.js +1 -1
- package/apps/runtime/dist/engine/steps.js +27 -8
- package/apps/runtime/dist/engine/surface.js +1 -1
- package/apps/runtime/dist/engine/template.js +1 -1
- package/apps/runtime/dist/env.js +1 -0
- package/apps/runtime/dist/harness/clients.js +10 -1
- package/apps/runtime/dist/harness/index.js +15 -69
- package/apps/runtime/dist/harness/types.js +3 -2
- package/apps/runtime/dist/local-call.js +6 -0
- package/apps/runtime/dist/local-models.js +53 -157
- package/apps/runtime/dist/mcp/bridge.js +12 -55
- package/apps/runtime/dist/mcp/elements.js +39 -4
- package/apps/runtime/dist/mcp/handler.js +12 -0
- package/apps/runtime/dist/mcp/run-pages.js +238 -0
- package/apps/runtime/dist/mcp/run-tasks.js +157 -0
- package/apps/runtime/dist/mcp/runs.js +129 -0
- package/apps/runtime/dist/mcp/tools.js +4 -95
- package/apps/runtime/dist/models.js +74 -27
- package/apps/runtime/dist/prompts/mcp.md +4 -1
- package/apps/runtime/dist/render/downloads.js +1 -1
- package/apps/runtime/dist/render/shaped.js +1 -1
- package/apps/runtime/dist/routes/model-setup.js +77 -0
- package/apps/runtime/dist/routes/studio.js +8 -251
- package/apps/runtime/dist/services/space-categories.js +1 -1
- package/apps/runtime/dist/services/work-ai.js +10 -4
- package/apps/runtime/dist/texts.js +4 -6
- package/apps/runtime/dist/tools/connections.js +3 -0
- package/apps/runtime/dist/tools/harness.js +124 -0
- package/apps/web/dist/assets/AboutDialog-BSdAA4Wi.js +1 -0
- package/apps/web/dist/assets/{BlockEditor-CgjXTWly.js → BlockEditor-0noqMcAl.js} +1 -1
- package/apps/web/dist/assets/Bundle-Ctrq7lHH.js +1 -0
- package/apps/web/dist/assets/CapabilitiesPage-CZlVhBmU.js +2 -0
- package/apps/web/dist/assets/ChangelogDialog-BLCYV4jT.js +1 -0
- package/apps/web/dist/assets/{CodeEditor-2LyHbSre.js → CodeEditor-CpRn9BZq.js} +1 -1
- package/apps/web/dist/assets/ConnectorsSection-B4rRDlFo.js +1 -0
- package/apps/web/dist/assets/EditorPage-CXN-_zzG.js +3 -0
- package/apps/web/dist/assets/FlowPreview-DjQvcWxs.js +1 -0
- package/apps/web/dist/assets/LangSwitch-BuzsLp16.js +1 -0
- package/apps/web/dist/assets/LocalModels-BDfP2v5-.js +1 -0
- package/apps/web/dist/assets/Marketplace-4baBNzEc.js +2 -0
- package/apps/web/dist/assets/NewWizardChannels-B_xHm-bI.js +1 -0
- package/apps/web/dist/assets/NewWizardPage-BmZAY4zi.js +7 -0
- package/apps/web/dist/assets/OnboardingPage-fZq3WiTk.js +1 -0
- package/apps/web/dist/assets/ProtocolSection-v9wIxisg.js +1 -0
- package/apps/web/dist/assets/PublicRunner-BCh0VzAT.js +1 -0
- package/apps/web/dist/assets/{ReadOnly-CO3ndR23.js → ReadOnly-13stkvNz.js} +1 -1
- package/apps/web/dist/assets/Results-4gmguYzH.js +1 -0
- package/apps/web/dist/assets/RunDrawer-CeEldWRn.js +1 -0
- package/apps/web/dist/assets/SettingsPage-BsKRRlfP.js +2 -0
- package/apps/web/dist/assets/SetupPage-FgA5Kl8z.js +1 -0
- package/apps/web/dist/assets/SharePage-BlBW4oxl.js +1 -0
- package/apps/web/dist/assets/SkillEditor-9QSskfmY.js +1 -0
- package/apps/web/dist/assets/Skills-DdUAyNhR.js +9 -0
- package/apps/web/dist/assets/SpacePage-CHkNPuqt.js +2 -0
- package/apps/web/dist/assets/StudioHome-BwPD-inc.js +1 -0
- package/apps/web/dist/assets/TableEditor-Du1DhbEC.js +7 -0
- package/apps/web/dist/assets/UpdateCheck-DPr9NXq_.js +2 -0
- package/apps/web/dist/assets/brand-DY3lzrOd.js +2 -0
- package/apps/web/dist/assets/changelog-BSdb22c3.js +1 -0
- package/apps/web/dist/assets/code-editor-Bep_LzQ5.js +2 -0
- package/apps/web/dist/assets/host-DiZQ_uws.js +1 -0
- package/apps/web/dist/assets/host-Dw-sMUSd.js +54 -0
- package/apps/web/dist/assets/i18n-DVrYWJaj.js +55 -0
- package/apps/web/dist/assets/index-C2gxK14s.css +1 -0
- package/apps/web/dist/assets/index-lQ4JYHYQ.js +102 -0
- package/apps/web/dist/assets/oss-credits-BHy69wkx.js +1 -0
- package/apps/web/dist/assets/{read-aloud-CRFt5q6k.js → read-aloud-CBycd8TA.js} +1 -1
- package/apps/web/dist/assets/{session-RDdtfee2.js → session-BYLtgklo.js} +1 -1
- package/apps/web/dist/assets/terminal-DmGdMags.js +16 -0
- package/apps/web/dist/assets/texts-ClKS2xhh.js +1 -0
- package/apps/web/dist/assets/theme-DFDOMsVo.js +14 -0
- package/apps/web/dist/assets/ui-CW2I3ecu.js +1 -0
- package/apps/web/dist/assets/ui-DfVpZYIW.js +16 -0
- package/apps/web/dist/assets/{useMutation-BSffqL6W.js → useMutation-BnkuLlQC.js} +1 -1
- package/apps/web/dist/assets/viewers-C6FfRwG1.js +2 -0
- package/apps/web/dist/index.html +18 -16
- package/apps/web/dist/mcp/flow.html +129 -129
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.js +1 -1
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.d.ts +48 -0
- package/node_modules/@engenty/chatviews/dist/chat/a2ui.js +514 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.d.ts +18 -0
- package/node_modules/@engenty/chatviews/dist/chat/check.js +97 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.d.ts +3 -0
- package/node_modules/@engenty/chatviews/dist/chat/index.js +4 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/chat/library.js +314 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.js +1 -1
- package/node_modules/@engenty/chatviews/dist/react/chat.d.ts +33 -0
- package/node_modules/@engenty/chatviews/dist/react/chat.js +150 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/field-looks.js +47 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.d.ts +5 -0
- package/node_modules/@engenty/chatviews/dist/react/markdown.js +11 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.d.ts +0 -0
- package/node_modules/@engenty/chatviews/dist/react/no-devtools.js +8 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/surface.js +552 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.d.ts +39 -0
- package/node_modules/@engenty/chatviews/dist/react/texts.js +42 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.d.ts +112 -0
- package/node_modules/@engenty/chatviews/dist/react/ui.js +212 -0
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.js +1 -1
- package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.js +1 -1
- package/node_modules/@engenty/chatviews/package.json +19 -0
- package/node_modules/@engenty/decision-model/dist/client.d.ts +76 -0
- package/node_modules/@engenty/decision-model/dist/client.js +188 -0
- package/node_modules/@engenty/decision-model/dist/index.d.ts +6 -0
- package/node_modules/@engenty/decision-model/dist/index.js +5 -0
- package/node_modules/@engenty/decision-model/dist/local.d.ts +11 -0
- package/node_modules/@engenty/decision-model/dist/local.js +116 -0
- package/node_modules/@engenty/decision-model/dist/resolve.d.ts +26 -0
- package/node_modules/@engenty/decision-model/dist/resolve.js +53 -0
- package/node_modules/@engenty/decision-model/dist/types.d.ts +80 -0
- package/node_modules/@engenty/decision-model/dist/types.js +6 -0
- package/node_modules/@engenty/decision-model/dist/validate.d.ts +9 -0
- package/node_modules/@engenty/decision-model/dist/validate.js +50 -0
- package/node_modules/@engenty/decision-model/dist/ways.d.ts +42 -0
- package/node_modules/@engenty/decision-model/dist/ways.js +72 -0
- package/node_modules/@engenty/decision-model/package.json +9 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/bridge/index.js +117 -0
- package/node_modules/@engenty/local-models/dist/clients/antigravity.d.ts +37 -0
- package/{apps/runtime/dist/harness → node_modules/@engenty/local-models/dist/clients}/antigravity.js +68 -17
- package/node_modules/@engenty/local-models/dist/clients/claude.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/client.d.ts +3 -1
- package/node_modules/@engenty/local-models/dist/clients/client.js +1 -1
- package/node_modules/@engenty/local-models/dist/clients/codex.js +1 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/clients/cursor.js +13 -1
- package/node_modules/@engenty/local-models/dist/clients/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/clients/index.js +4 -2
- package/node_modules/@engenty/local-models/dist/clients/model.d.ts +4 -1
- package/node_modules/@engenty/local-models/dist/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/index.js +2 -1
- package/node_modules/@engenty/local-models/dist/lmstudio/api.d.ts +49 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/api.js +101 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.d.ts +12 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/load.js +100 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/lmstudio/server.js +29 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.d.ts +54 -0
- package/node_modules/@engenty/local-models/dist/mlx/helper.js +149 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/index.js +3 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.d.ts +19 -0
- package/node_modules/@engenty/local-models/dist/mlx/server.js +82 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.d.ts +16 -0
- package/node_modules/@engenty/local-models/dist/mlx/store.js +153 -0
- package/node_modules/@engenty/local-models/dist/ollama/api.d.ts +4 -37
- package/node_modules/@engenty/local-models/dist/ollama/api.js +1 -18
- package/node_modules/@engenty/local-models/dist/ollama/index.d.ts +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/index.js +2 -1
- package/node_modules/@engenty/local-models/dist/ollama/model.d.ts +2 -0
- package/node_modules/@engenty/local-models/dist/ollama/model.js +1 -1
- package/node_modules/@engenty/local-models/dist/ollama/server.d.ts +3 -0
- package/node_modules/@engenty/local-models/dist/ollama/server.js +45 -0
- package/node_modules/@engenty/local-models/dist/probe.d.ts +11 -8
- package/node_modules/@engenty/local-models/dist/probe.js +16 -32
- package/node_modules/@engenty/local-models/dist/servers/index.d.ts +6 -0
- package/node_modules/@engenty/local-models/dist/servers/index.js +12 -0
- package/node_modules/@engenty/local-models/dist/servers/server.d.ts +84 -0
- package/node_modules/@engenty/local-models/dist/servers/server.js +38 -0
- package/node_modules/@engenty/local-models/package.json +5 -1
- package/node_modules/@engenty/model-setup/dist/catalog.d.ts +36 -0
- package/node_modules/@engenty/model-setup/dist/catalog.js +81 -0
- package/node_modules/@engenty/model-setup/dist/index.d.ts +3 -0
- package/node_modules/@engenty/model-setup/dist/index.js +3 -0
- package/node_modules/@engenty/model-setup/dist/offered.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/offered.js +64 -0
- package/node_modules/@engenty/model-setup/dist/react/client.d.ts +46 -0
- package/node_modules/@engenty/model-setup/dist/react/client.js +147 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.d.ts +78 -0
- package/node_modules/@engenty/model-setup/dist/react/columns.js +99 -0
- package/node_modules/@engenty/model-setup/dist/react/host.d.ts +31 -0
- package/node_modules/@engenty/model-setup/dist/react/host.js +48 -0
- package/node_modules/@engenty/model-setup/dist/react/index.d.ts +7 -0
- package/node_modules/@engenty/model-setup/dist/react/index.js +7 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.d.ts +48 -0
- package/node_modules/@engenty/model-setup/dist/react/keys.js +74 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.d.ts +23 -0
- package/node_modules/@engenty/model-setup/dist/react/local-models.js +134 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.d.ts +4 -0
- package/node_modules/@engenty/model-setup/dist/react/servers.js +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/terminal.js +79 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.d.ts +13 -0
- package/node_modules/@engenty/model-setup/dist/react/tone.js +66 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/apps.js +22 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.d.ts +55 -0
- package/node_modules/@engenty/model-setup/dist/server/clients.js +96 -0
- package/node_modules/@engenty/model-setup/dist/server/index.d.ts +8 -0
- package/node_modules/@engenty/model-setup/dist/server/index.js +8 -0
- package/node_modules/@engenty/model-setup/dist/server/install.d.ts +24 -0
- package/node_modules/@engenty/model-setup/dist/server/install.js +68 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.d.ts +9 -0
- package/node_modules/@engenty/model-setup/dist/server/lmstudio.js +52 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.d.ts +47 -0
- package/node_modules/@engenty/model-setup/dist/server/local-models.js +164 -0
- package/node_modules/@engenty/model-setup/dist/server/models.d.ts +12 -0
- package/node_modules/@engenty/model-setup/dist/server/models.js +16 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.d.ts +22 -0
- package/node_modules/@engenty/model-setup/dist/server/ollama.js +146 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.d.ts +51 -0
- package/node_modules/@engenty/model-setup/dist/server/routes.js +211 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.d.ts +14 -0
- package/node_modules/@engenty/model-setup/dist/server/server-apps.js +24 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.d.ts +43 -0
- package/node_modules/@engenty/model-setup/dist/server/terminal.js +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.d.ts +222 -0
- package/node_modules/@engenty/model-setup/dist/texts.js +222 -0
- package/node_modules/@engenty/model-setup/dist/types.d.ts +111 -0
- package/node_modules/@engenty/model-setup/dist/types.js +2 -0
- package/node_modules/@engenty/model-setup/package.json +12 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.d.ts +14 -0
- package/node_modules/@engenty/search-index/dist/catalog-lexical.js +165 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.d.ts +33 -0
- package/node_modules/@engenty/search-index/dist/catalog-rank.js +99 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.d.ts +40 -0
- package/node_modules/@engenty/search-index/dist/catalog-search.js +161 -0
- package/node_modules/@engenty/search-index/dist/chunks.d.ts +17 -0
- package/node_modules/@engenty/search-index/dist/chunks.js +164 -0
- package/node_modules/@engenty/search-index/dist/contracts.d.ts +135 -0
- package/node_modules/@engenty/search-index/dist/contracts.js +9 -0
- package/node_modules/@engenty/search-index/dist/embedder.d.ts +31 -0
- package/node_modules/@engenty/search-index/dist/embedder.js +82 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/gemini.js +54 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/index.js +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.d.ts +12 -0
- package/node_modules/@engenty/search-index/dist/embedders/ollama.js +43 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.d.ts +11 -0
- package/node_modules/@engenty/search-index/dist/embedders/openai.js +36 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.d.ts +5 -0
- package/node_modules/@engenty/search-index/dist/embedders/shared.js +26 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.d.ts +16 -0
- package/node_modules/@engenty/search-index/dist/embedders/ways.js +90 -0
- package/node_modules/@engenty/search-index/dist/index.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/index.js +10 -0
- package/node_modules/@engenty/search-index/dist/payload.d.ts +13 -0
- package/node_modules/@engenty/search-index/dist/payload.js +51 -0
- package/node_modules/@engenty/search-index/dist/registry.d.ts +25 -0
- package/node_modules/@engenty/search-index/dist/registry.js +56 -0
- package/node_modules/@engenty/search-index/dist/scoring.d.ts +10 -0
- package/node_modules/@engenty/search-index/dist/scoring.js +45 -0
- package/node_modules/@engenty/search-index/dist/strategy.d.ts +6 -0
- package/node_modules/@engenty/search-index/dist/strategy.js +25 -0
- package/node_modules/@engenty/search-index/package.json +10 -0
- package/node_modules/@engenty/tool-harness/dist/harness.d.ts +70 -0
- package/node_modules/@engenty/tool-harness/dist/harness.js +170 -0
- package/node_modules/@engenty/tool-harness/dist/index.d.ts +5 -0
- package/node_modules/@engenty/tool-harness/dist/index.js +5 -0
- package/node_modules/@engenty/tool-harness/dist/judge.d.ts +8 -0
- package/node_modules/@engenty/tool-harness/dist/judge.js +39 -0
- package/node_modules/@engenty/tool-harness/dist/levels.d.ts +18 -0
- package/node_modules/@engenty/tool-harness/dist/levels.js +47 -0
- package/node_modules/@engenty/tool-harness/dist/model.d.ts +6 -0
- package/node_modules/@engenty/tool-harness/dist/model.js +60 -0
- package/node_modules/@engenty/tool-harness/dist/schema.d.ts +26 -0
- package/node_modules/@engenty/tool-harness/dist/schema.js +57 -0
- package/node_modules/@engenty/tool-harness/package.json +9 -0
- package/node_modules/@engenty/wizards-shared/dist/catalog-prompt.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/definition.d.ts +10 -10
- package/node_modules/@engenty/wizards-shared/dist/definition.js +4 -4
- package/node_modules/@engenty/wizards-shared/dist/run-schema.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/run.d.ts +3 -1
- package/node_modules/@engenty/wizards-shared/dist/run.js +4 -0
- package/node_modules/@engenty/wizards-shared/dist/store.js +2 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.d.ts +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-agents.js +1 -1
- package/node_modules/@engenty/wizards-shared/dist/wizard-text.js +2 -2
- package/package.json +11 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/plugin.json +1 -1
- package/apps/runtime/dist/harness/terminal.js +0 -201
- package/apps/web/dist/assets/AboutDialog-BRUwrfQH.js +0 -1
- package/apps/web/dist/assets/Bundle-C0u5HUZL.js +0 -1
- package/apps/web/dist/assets/CapabilitiesPage-C30knXsS.js +0 -2
- package/apps/web/dist/assets/ChangelogDialog-BkZQOAdl.js +0 -1
- package/apps/web/dist/assets/ConnectorsSection-CmXQD7zu.js +0 -1
- package/apps/web/dist/assets/EditorPage-LEbyNWmG.js +0 -3
- package/apps/web/dist/assets/FlowPreview-BXf4EKjU.js +0 -1
- package/apps/web/dist/assets/LangSwitch-BLB7dDce.js +0 -1
- package/apps/web/dist/assets/Marketplace-B3NoH5Va.js +0 -2
- package/apps/web/dist/assets/NewWizardChannels-CSn-9zHr.js +0 -1
- package/apps/web/dist/assets/NewWizardPage-B4wPfClS.js +0 -7
- package/apps/web/dist/assets/OnboardingPage-RawpCO9J.js +0 -1
- package/apps/web/dist/assets/ProtocolSection-s4mEL_pu.js +0 -1
- package/apps/web/dist/assets/PublicRunner-COatyxMi.js +0 -1
- package/apps/web/dist/assets/Results-CC1-mElv.js +0 -1
- package/apps/web/dist/assets/RunDrawer-DkmSXhad.js +0 -1
- package/apps/web/dist/assets/SettingsPage-DKs_fkNL.js +0 -2
- package/apps/web/dist/assets/SetupPage-RvmKCzF2.js +0 -1
- package/apps/web/dist/assets/SharePage-Drntg_oj.js +0 -1
- package/apps/web/dist/assets/SkillEditor-Ca_bzmjD.js +0 -1
- package/apps/web/dist/assets/Skills-BcgxuD15.js +0 -9
- package/apps/web/dist/assets/SpacePage-aZqYFttF.js +0 -2
- package/apps/web/dist/assets/StudioHome-Doua9Lyl.js +0 -1
- package/apps/web/dist/assets/TableEditor-Dbq3HZZS.js +0 -7
- package/apps/web/dist/assets/UpdateCheck-B7etUbUf.js +0 -2
- package/apps/web/dist/assets/brand-BIT7AumL.js +0 -2
- package/apps/web/dist/assets/changelog-BW79cVbx.js +0 -1
- package/apps/web/dist/assets/code-editor-CufyaUFC.js +0 -2
- package/apps/web/dist/assets/host-BXSxBoOH.js +0 -69
- package/apps/web/dist/assets/i18n-WXeVnv7i.js +0 -55
- package/apps/web/dist/assets/index-D1iL3986.css +0 -1
- package/apps/web/dist/assets/index-kDKA6ddy.js +0 -102
- package/apps/web/dist/assets/oss-credits-B3PXhamW.js +0 -1
- package/apps/web/dist/assets/theme-23bNrOQh.js +0 -14
- package/apps/web/dist/assets/ui-DkEhb2Rt.js +0 -16
- package/apps/web/dist/assets/viewers-CmGDpBjn.js +0 -2
- /package/apps/web/dist/assets/{host-BrP-ENHg.css → terminal-BrP-ENHg.css} +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/calc.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/numbers.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/shape.d.ts +0 -0
- /package/node_modules/@engenty/{wizards-shared → chatviews}/dist/surface.d.ts +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { mkdirSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { freshAuth, loginEnv } from "@engenty/local-models/clients";
|
|
4
1
|
import { ASSISTANT_LAYOUTS, ASSISTANT_PAGE_BYTES, ASSISTANT_WIDTH, assistantSignalSchema, assistantTurnSchema, } from "@engenty/wizards-shared/assistant";
|
|
5
2
|
import { LANGS, MODEL_CLASSES, TEXT_CLASSES, } from "@engenty/wizards-shared/definition";
|
|
6
3
|
import { CATEGORY_TYPES, whereSchema } from "@engenty/wizards-shared/knowledge";
|
|
@@ -37,16 +34,14 @@ import { missingConnections, missingModels, stepsWithoutModel, unwatchedConnecti
|
|
|
37
34
|
import { env } from "../env.js";
|
|
38
35
|
import { feature, features, forgetAccountFeatures } from "../features.js";
|
|
39
36
|
import { appleStatus } from "../harness/apple.js";
|
|
40
|
-
import { detectHarness, detectHarnesses,
|
|
41
|
-
import { closeTerminal, openTerminal, resizeTerminal, subscribeTerminal, writeTerminal, } from "../harness/terminal.js";
|
|
37
|
+
import { detectHarness, detectHarnesses, harness } from "../harness/index.js";
|
|
42
38
|
import { connectorsView, filesView, spacesView, translationsView, wizardsView, wizardView, } from "../live/views.js";
|
|
43
|
-
import { downloadLocalModel, localModels, removeLocalModel, startLocalOllama, } from "../local-models.js";
|
|
44
39
|
import { installMail, ManageError, managed, renameTenant, saveModelPolicy, saveModelTier, saveOrganizationProfile, tenantInfo, tenantMembers, tryMasking, userInfo, } from "../manage.js";
|
|
45
40
|
import { checkedApps, seenApps } from "../mcp/seen.js";
|
|
46
41
|
import { generateImageMedia, generateSpeechMedia, generateVideoMedia } from "../media/generate.js";
|
|
47
42
|
import { transcribeAudio } from "../media/transcribe.js";
|
|
48
43
|
import { errorText, saidOf } from "../model-errors.js";
|
|
49
|
-
import { asGatewayBindings, blockedBinding, CHAT_WAYS, checkKey, classProblem, classWays,
|
|
44
|
+
import { asGatewayBindings, blockedBinding, CHAT_WAYS, checkKey, classProblem, classWays, embeddingModel, hasTextModel, LOCAL_KEYS, localModelSettings, ModelUnavailableError, modelSettings, ownKeysThroughGateway, saveLocalModels, saveModels, storedKey, textModel, } from "../models.js";
|
|
50
45
|
import { refreshPro } from "../plugins/pro.js";
|
|
51
46
|
import { HTML_RESPONSE_CSP } from "../render/guard.js";
|
|
52
47
|
import { isAdminRole, mayBuild, mayCreate, requireAdmin, requireWritable, spaceWritable, } from "../services/access.js";
|
|
@@ -82,7 +77,7 @@ import { deleteTranslation, editTranslation, isLangCode, publishedDefinition, }
|
|
|
82
77
|
import { draftWidgetPreview } from "../services/widgets.js";
|
|
83
78
|
import { wizardDatabase, wizardDatabaseCsv, wizardDatabaseRows } from "../services/wizard-data.js";
|
|
84
79
|
import { createWizard, deleteWizard, draftChanges, duplicateWizard, hasWizards, ownedWizard, rotateShareLink, setAnswerers, updateWizardSettings, writableWizard, writeDraft, } from "../services/wizards.js";
|
|
85
|
-
import { deleteTenantSetting,
|
|
80
|
+
import { deleteTenantSetting, writeTenantSetting } from "../settings.js";
|
|
86
81
|
import { sharePreview, spaceShareTargets } from "../sharing/index.js";
|
|
87
82
|
import { keepCloudForAll, mergesSeen, proposeMerge, resolveConflict, sendBeforeSwitch, startSpace, stopSpace, syncAll, syncView, undoMerge, } from "../sync/client.js";
|
|
88
83
|
import { codeOf } from "../tenants/control.js";
|
|
@@ -91,6 +86,7 @@ import { serverText } from "../texts.js";
|
|
|
91
86
|
import { applyUpdate, updateStatus } from "../update.js";
|
|
92
87
|
import { spaceFileResponse } from "./delivery.js";
|
|
93
88
|
import { notFoundAnswer, requestLang, say } from "./lang.js";
|
|
89
|
+
import { localSetup, modelsInput, testedSources } from "./model-setup.js";
|
|
94
90
|
import { addKey, changeKey, checkKeyOf, listKeys, removeKey, setFallback } from "./own-keys.js";
|
|
95
91
|
import { mayChangeRuntime } from "./runtime-settings.js";
|
|
96
92
|
const presenceSchema = z.object({
|
|
@@ -109,17 +105,6 @@ const reader = (c) => ({
|
|
|
109
105
|
lang: requestLang(c),
|
|
110
106
|
who: whoOf(c),
|
|
111
107
|
});
|
|
112
|
-
/** The model sources a test call has worked on: the setup is done for those, not for the others. */
|
|
113
|
-
async function testedSources() {
|
|
114
|
-
const tested = await readSetting("setup-done");
|
|
115
|
-
return Array.isArray(tested) ? tested : [];
|
|
116
|
-
}
|
|
117
|
-
async function markTested(source) {
|
|
118
|
-
const tested = await testedSources();
|
|
119
|
-
if (!tested.includes(source)) {
|
|
120
|
-
await writeSetting("setup-done", [...tested, source]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
108
|
/**
|
|
124
109
|
* The chosen source has passed a test call and can still answer: its client is there and signed
|
|
125
110
|
* in. Where Apple Intelligence thinks the short classes, the test ran there; a client behind
|
|
@@ -127,7 +112,7 @@ async function markTested(source) {
|
|
|
127
112
|
*/
|
|
128
113
|
async function setupDone() {
|
|
129
114
|
const { source, bindings } = localModelSettings();
|
|
130
|
-
if (!(await testedSources
|
|
115
|
+
if (!(await testedSources.has(source))) {
|
|
131
116
|
return false;
|
|
132
117
|
}
|
|
133
118
|
const client = bindings.low.startsWith("apple:") ? null : harness(source);
|
|
@@ -137,26 +122,8 @@ async function setupDone() {
|
|
|
137
122
|
}
|
|
138
123
|
return hasTextModel();
|
|
139
124
|
}
|
|
140
|
-
/** A model as Ollama names it: `name`, `name:tag`, `namespace/name:tag` or `hf.co/…`. */
|
|
141
|
-
const localModelName = z
|
|
142
|
-
.string()
|
|
143
|
-
.trim()
|
|
144
|
-
.min(1)
|
|
145
|
-
.max(120)
|
|
146
|
-
.regex(/^[\w.:/-]+$/);
|
|
147
125
|
/** The Manage-App's masking errors, passed on as it sends them: 502 labels, 503 the detector. */
|
|
148
126
|
const MASKING_CODES = new Set(["labels_unavailable", "masking_unavailable"]);
|
|
149
|
-
const modelsInput = z.object({
|
|
150
|
-
source: z.enum([...HARNESS_IDS, "account", "own"]).optional(),
|
|
151
|
-
bindings: z.partialRecord(z.enum(MODEL_CLASSES), z.string().max(160)).optional(),
|
|
152
|
-
ollamaUrl: z.string().max(200).optional(),
|
|
153
|
-
creditFallback: z.boolean().optional(),
|
|
154
|
-
decision: z.enum(DECISION_CHOICES).optional(),
|
|
155
|
-
embedding: z.enum(EMBEDDING_CHOICES).optional(),
|
|
156
|
-
decisionLocal: z.string().max(120).optional(),
|
|
157
|
-
embeddingLocal: z.string().max(120).optional(),
|
|
158
|
-
keys: z.partialRecord(z.enum(LOCAL_KEYS), z.string().max(400)).optional(),
|
|
159
|
-
});
|
|
160
127
|
/** Alone the person changes everything; in an organization its owner and admins. */
|
|
161
128
|
function mayChangeModels(user) {
|
|
162
129
|
return !managed || user.role === "owner" || user.role === "admin";
|
|
@@ -267,10 +234,6 @@ async function testClass(cls, lang) {
|
|
|
267
234
|
export async function assistantDevFor(user) {
|
|
268
235
|
return managed ? (await userInfo(user.id)).admin : env.assistantDev;
|
|
269
236
|
}
|
|
270
|
-
const terminalSize = z.object({
|
|
271
|
-
cols: z.number().int().min(10).max(500).optional(),
|
|
272
|
-
rows: z.number().int().min(4).max(200).optional(),
|
|
273
|
-
});
|
|
274
237
|
/** How the person settled a conflict: one side, a choice per place, or a version of their own. */
|
|
275
238
|
const resolutionSchema = z.union([
|
|
276
239
|
z.object({ take: z.enum(["local", "remote"]) }),
|
|
@@ -1713,14 +1676,8 @@ export const studio = new Hono()
|
|
|
1713
1676
|
}
|
|
1714
1677
|
return c.json({ apps: await checkedApps(user.tenantId) });
|
|
1715
1678
|
})
|
|
1716
|
-
|
|
1717
|
-
.
|
|
1718
|
-
if (managed) {
|
|
1719
|
-
return c.notFound();
|
|
1720
|
-
}
|
|
1721
|
-
await saveLocalModels(modelsInput.parse(await c.req.json()));
|
|
1722
|
-
return c.json(localModelSettings());
|
|
1723
|
-
})
|
|
1679
|
+
// The setup and the settings of the clients, keys and models on this machine.
|
|
1680
|
+
.route("/local", managed ? new Hono() : localSetup)
|
|
1724
1681
|
// --- models: where each class runs, own API keys, the credits behind them -----------------
|
|
1725
1682
|
// Alone for this machine; on a Manage-App's runtime for the organization, whose admins change it.
|
|
1726
1683
|
.get("/models", async (c) => c.json(await settingsFor(c)))
|
|
@@ -1745,6 +1702,7 @@ export const studio = new Hono()
|
|
|
1745
1702
|
if (managed &&
|
|
1746
1703
|
(input.source ||
|
|
1747
1704
|
input.ollamaUrl ||
|
|
1705
|
+
input.lmstudioUrl ||
|
|
1748
1706
|
Object.values(input.bindings ?? {}).some((ref) => ref && !cloudBinding(ref)))) {
|
|
1749
1707
|
return c.json({
|
|
1750
1708
|
error: say(c, "notAvailableCloud"),
|
|
@@ -1876,47 +1834,6 @@ export const studio = new Hono()
|
|
|
1876
1834
|
}
|
|
1877
1835
|
})
|
|
1878
1836
|
// Ollama on this computer: its models, what each can do, the ones to download, the downloads.
|
|
1879
|
-
.get("/models/local", async (c) => {
|
|
1880
|
-
if (managed) {
|
|
1881
|
-
return c.notFound();
|
|
1882
|
-
}
|
|
1883
|
-
return c.json(await localModels());
|
|
1884
|
-
})
|
|
1885
|
-
// A model pulled into Ollama. Where it is the embedding model now, the spaces are indexed with it after.
|
|
1886
|
-
.post("/models/local/pull", async (c) => {
|
|
1887
|
-
if (managed || !mayChangeModels(c.get("user"))) {
|
|
1888
|
-
return c.notFound();
|
|
1889
|
-
}
|
|
1890
|
-
const { model } = z.object({ model: localModelName }).parse(await c.req.json());
|
|
1891
|
-
const embeddedBy = (await embeddingModel().catch(() => null))?.ref ?? null;
|
|
1892
|
-
await downloadLocalModel(model, async () => {
|
|
1893
|
-
if (((await embeddingModel().catch(() => null))?.ref ?? null) !== embeddedBy) {
|
|
1894
|
-
await reindexAll();
|
|
1895
|
-
}
|
|
1896
|
-
});
|
|
1897
|
-
return c.json(await localModels());
|
|
1898
|
-
})
|
|
1899
|
-
.delete("/models/local", async (c) => {
|
|
1900
|
-
if (managed || !mayChangeModels(c.get("user"))) {
|
|
1901
|
-
return c.notFound();
|
|
1902
|
-
}
|
|
1903
|
-
const model = localModelName.parse(c.req.query("model"));
|
|
1904
|
-
try {
|
|
1905
|
-
await removeLocalModel(model);
|
|
1906
|
-
}
|
|
1907
|
-
catch (err) {
|
|
1908
|
-
return c.json({ error: say(c, "localModelNotRemoved", { error: err.message }) }, 400);
|
|
1909
|
-
}
|
|
1910
|
-
return c.json(await localModels());
|
|
1911
|
-
})
|
|
1912
|
-
// Ollama installed (on a Mac) and started, as `wizards setup` does.
|
|
1913
|
-
.post("/models/local/ollama", async (c) => {
|
|
1914
|
-
if (managed || !mayChangeModels(c.get("user"))) {
|
|
1915
|
-
return c.notFound();
|
|
1916
|
-
}
|
|
1917
|
-
await startLocalOllama();
|
|
1918
|
-
return c.json(await localModels());
|
|
1919
|
-
})
|
|
1920
1837
|
// The organization's own accounts at the providers, kept by the Manage-App (`ownKeysGateway`).
|
|
1921
1838
|
.get("/models/keys", listKeys)
|
|
1922
1839
|
.post("/models/keys", addKey)
|
|
@@ -1955,166 +1872,6 @@ export const studio = new Hono()
|
|
|
1955
1872
|
.object({ cls: z.enum(MODEL_CLASSES), lang: z.enum(LANGS).default("en") })
|
|
1956
1873
|
.parse(await c.req.json());
|
|
1957
1874
|
return c.json(await testClass(cls, lang));
|
|
1958
|
-
})
|
|
1959
|
-
// The setup's test of one key, or of Ollama: a working one is put to use and ends the setup.
|
|
1960
|
-
.post("/local/keys/:provider", async (c) => {
|
|
1961
|
-
if (managed) {
|
|
1962
|
-
return c.notFound();
|
|
1963
|
-
}
|
|
1964
|
-
const provider = z.enum(LOCAL_KEYS).parse(c.req.param("provider"));
|
|
1965
|
-
const { key } = z
|
|
1966
|
-
.object({ key: z.string().max(400).optional() })
|
|
1967
|
-
.parse(await c.req.json().catch(() => ({})));
|
|
1968
|
-
const result = await setUpKey(provider, key, requestLang(c));
|
|
1969
|
-
if (result.ok && result.text) {
|
|
1970
|
-
await markTested("own");
|
|
1971
|
-
}
|
|
1972
|
-
return c.json(result);
|
|
1973
|
-
})
|
|
1974
|
-
.post("/local/ollama", async (c) => {
|
|
1975
|
-
if (managed) {
|
|
1976
|
-
return c.notFound();
|
|
1977
|
-
}
|
|
1978
|
-
const { url } = z.object({ url: z.string().url().max(200) }).parse(await c.req.json());
|
|
1979
|
-
const result = await setUpOllama(url, requestLang(c));
|
|
1980
|
-
if (result.ok) {
|
|
1981
|
-
await markTested("own");
|
|
1982
|
-
}
|
|
1983
|
-
return c.json(result);
|
|
1984
|
-
})
|
|
1985
|
-
// One short call on a class, as a run would make it: shows that the way to the model is open.
|
|
1986
|
-
.post("/local/models/test", async (c) => {
|
|
1987
|
-
if (managed) {
|
|
1988
|
-
return c.notFound();
|
|
1989
|
-
}
|
|
1990
|
-
const { cls } = z
|
|
1991
|
-
.object({ cls: z.enum(TEXT_CLASSES).default("classifier") })
|
|
1992
|
-
.parse(await c.req.json().catch(() => ({})));
|
|
1993
|
-
const started = Date.now();
|
|
1994
|
-
// The source this call runs on: the person may pick another one while it is under way.
|
|
1995
|
-
const source = localModelSettings().source;
|
|
1996
|
-
try {
|
|
1997
|
-
const resolved = await textModel(cls);
|
|
1998
|
-
const result = await generateText({
|
|
1999
|
-
model: resolved.model,
|
|
2000
|
-
prompt: "Reply with the single word: OK",
|
|
2001
|
-
maxOutputTokens: 20,
|
|
2002
|
-
abortSignal: AbortSignal.timeout(120_000),
|
|
2003
|
-
});
|
|
2004
|
-
// A working call is what ends the setup — for the source it ran on.
|
|
2005
|
-
await markTested(source);
|
|
2006
|
-
return c.json({
|
|
2007
|
-
ok: true,
|
|
2008
|
-
ref: resolved.ref,
|
|
2009
|
-
reply: result.text.trim().slice(0, 200),
|
|
2010
|
-
ms: Date.now() - started,
|
|
2011
|
-
});
|
|
2012
|
-
}
|
|
2013
|
-
catch (err) {
|
|
2014
|
-
const message = err?.message ?? String(err);
|
|
2015
|
-
return c.json({ ok: false, error: message.slice(0, 500), ms: Date.now() - started });
|
|
2016
|
-
}
|
|
2017
|
-
})
|
|
2018
|
-
// --- the AI clients on this machine: looked at afresh, signed in through the inline terminal ----
|
|
2019
|
-
.post("/local/harness/:id/detect", async (c) => {
|
|
2020
|
-
const id = c.req.param("id");
|
|
2021
|
-
if (managed || !harness(id)) {
|
|
2022
|
-
return c.notFound();
|
|
2023
|
-
}
|
|
2024
|
-
return c.json({ harness: await detectHarness(id, true) });
|
|
2025
|
-
})
|
|
2026
|
-
.post("/local/harness/:id/install", async (c) => {
|
|
2027
|
-
const spec = managed ? null : await installSpec(c.req.param("id"));
|
|
2028
|
-
if (!spec) {
|
|
2029
|
-
return c.notFound();
|
|
2030
|
-
}
|
|
2031
|
-
const { cols, rows } = terminalSize.parse(await c.req.json().catch(() => ({})));
|
|
2032
|
-
const cwd = join(env.dataDir, "harness");
|
|
2033
|
-
mkdirSync(cwd, { recursive: true });
|
|
2034
|
-
// The page asks again once the command is over: then the client is there, or its output says why not.
|
|
2035
|
-
const terminal = await openTerminal({ ...spec, cwd, cols, rows });
|
|
2036
|
-
return c.json({ terminal });
|
|
2037
|
-
})
|
|
2038
|
-
.post("/local/harness/:id/login", async (c) => {
|
|
2039
|
-
const id = c.req.param("id");
|
|
2040
|
-
const client = harness(id);
|
|
2041
|
-
if (managed || !client) {
|
|
2042
|
-
return c.notFound();
|
|
2043
|
-
}
|
|
2044
|
-
const { cols, rows } = terminalSize.parse(await c.req.json().catch(() => ({})));
|
|
2045
|
-
const cwd = join(env.dataDir, "harness");
|
|
2046
|
-
mkdirSync(cwd, { recursive: true });
|
|
2047
|
-
const terminal = await openTerminal({
|
|
2048
|
-
bin: client.bin,
|
|
2049
|
-
args: client.login.args,
|
|
2050
|
-
cwd,
|
|
2051
|
-
env: { ...(await loginEnv(client)), ...client.login.env },
|
|
2052
|
-
cols,
|
|
2053
|
-
rows,
|
|
2054
|
-
// Signed in: the client says so on its own, and the settings learn it right away.
|
|
2055
|
-
until: async () => (await freshAuth(client)) !== "none",
|
|
2056
|
-
onDone: () => void detectHarness(id, true),
|
|
2057
|
-
});
|
|
2058
|
-
return c.json({ terminal });
|
|
2059
|
-
})
|
|
2060
|
-
.get("/local/terminal/:id/stream", (c) => {
|
|
2061
|
-
if (managed) {
|
|
2062
|
-
return c.notFound();
|
|
2063
|
-
}
|
|
2064
|
-
const id = c.req.param("id");
|
|
2065
|
-
return streamSSE(c, async (stream) => {
|
|
2066
|
-
let ended = false;
|
|
2067
|
-
// One write after the other, and all of them out before the stream ends: the last one is
|
|
2068
|
-
// the exit, and a page that comes after the end gets everything at once.
|
|
2069
|
-
let written = Promise.resolve();
|
|
2070
|
-
const done = new Promise((resolve) => {
|
|
2071
|
-
const unsubscribe = subscribeTerminal(id, (event) => {
|
|
2072
|
-
written = written.then(() => stream.writeSSE({ event: event.type, data: JSON.stringify(event) }));
|
|
2073
|
-
if (event.type === "exit") {
|
|
2074
|
-
ended = true;
|
|
2075
|
-
resolve();
|
|
2076
|
-
}
|
|
2077
|
-
});
|
|
2078
|
-
stream.onAbort(() => {
|
|
2079
|
-
unsubscribe();
|
|
2080
|
-
resolve();
|
|
2081
|
-
});
|
|
2082
|
-
});
|
|
2083
|
-
// The page keeps the stream open while the terminal lives; a heartbeat keeps proxies from closing it.
|
|
2084
|
-
const beat = setInterval(() => {
|
|
2085
|
-
if (!ended) {
|
|
2086
|
-
void stream.writeSSE({ event: "ping", data: "" });
|
|
2087
|
-
}
|
|
2088
|
-
}, 15_000);
|
|
2089
|
-
await done;
|
|
2090
|
-
clearInterval(beat);
|
|
2091
|
-
await written;
|
|
2092
|
-
});
|
|
2093
|
-
})
|
|
2094
|
-
.post("/local/terminal/:id/input", async (c) => {
|
|
2095
|
-
if (managed) {
|
|
2096
|
-
return c.notFound();
|
|
2097
|
-
}
|
|
2098
|
-
const { data } = z.object({ data: z.string().max(10_000) }).parse(await c.req.json());
|
|
2099
|
-
writeTerminal(c.req.param("id"), data);
|
|
2100
|
-
return c.json({ ok: true });
|
|
2101
|
-
})
|
|
2102
|
-
.post("/local/terminal/:id/resize", async (c) => {
|
|
2103
|
-
if (managed) {
|
|
2104
|
-
return c.notFound();
|
|
2105
|
-
}
|
|
2106
|
-
const { cols, rows } = z
|
|
2107
|
-
.object({ cols: z.number().int().min(10).max(500), rows: z.number().int().min(4).max(200) })
|
|
2108
|
-
.parse(await c.req.json());
|
|
2109
|
-
resizeTerminal(c.req.param("id"), cols, rows);
|
|
2110
|
-
return c.json({ ok: true });
|
|
2111
|
-
})
|
|
2112
|
-
.delete("/local/terminal/:id", (c) => {
|
|
2113
|
-
if (managed) {
|
|
2114
|
-
return c.notFound();
|
|
2115
|
-
}
|
|
2116
|
-
closeTerminal(c.req.param("id"));
|
|
2117
|
-
return c.json({ ok: true });
|
|
2118
1875
|
})
|
|
2119
1876
|
.put("/local/chat-models", async (c) => {
|
|
2120
1877
|
if (managed) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { readNumber } from "@engenty/chatviews/numbers";
|
|
1
2
|
import { CATEGORY_TYPES, dayOf, } from "@engenty/wizards-shared/knowledge";
|
|
2
|
-
import { readNumber } from "@engenty/wizards-shared/numbers";
|
|
3
3
|
import { note } from "@engenty/wizards-shared/run";
|
|
4
4
|
import { and, asc, eq, inArray, isNotNull, or, sql } from "drizzle-orm";
|
|
5
5
|
import { nanoid } from "nanoid";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
|
+
import { surfaceComponentsSchema, validateSurface } from "@engenty/chatviews/surface";
|
|
2
3
|
import { ClientModel } from "@engenty/local-models/clients";
|
|
3
|
-
import { surfaceComponentsSchema, validateSurface } from "@engenty/wizards-shared/surface";
|
|
4
4
|
import { createTool } from "@mastra/core/tools";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { sortedTools } from "../agents/space-agent.js";
|
|
@@ -14,6 +14,7 @@ import { pluginsOf } from "../plugins/registry.js";
|
|
|
14
14
|
import { prompt } from "../prompts.js";
|
|
15
15
|
import { sandboxCapabilities, shellToolDescription } from "../sandbox/index.js";
|
|
16
16
|
import { currentTenant } from "../tenants/tenant.js";
|
|
17
|
+
import { harnessed, harnessedModel, oneOfMany } from "../tools/harness.js";
|
|
17
18
|
import { assistantToolPlugin, assistantToolRisk, assistantToolsOf } from "../tools/plugin.js";
|
|
18
19
|
import { clip } from "../tools/shared.js";
|
|
19
20
|
import { skillsBlock } from "../tools/skills.js";
|
|
@@ -266,8 +267,13 @@ export async function workTurn(turn, signal, steps, choice = {}) {
|
|
|
266
267
|
choice.web !== false ? toolAccess() : null,
|
|
267
268
|
]);
|
|
268
269
|
const client = turn.role === "client";
|
|
269
|
-
const
|
|
270
|
-
|
|
270
|
+
const all = await toolsFor(resolved, turn.space, turn.userId, signal, choice, turn.chatId, null, turn.role ?? null, web);
|
|
271
|
+
// The connections' actions and the plugins' tools: many, and few of them in one chat.
|
|
272
|
+
const many = new Set(Object.keys(all).filter((name) => oneOfMany(all[name])));
|
|
273
|
+
const made = gated(all, turn);
|
|
274
|
+
const tools = resolved.model instanceof ClientModel
|
|
275
|
+
? steps.wrap(made)
|
|
276
|
+
: sortedTools(harnessed(made, resolved, (name) => many.has(name)).tools);
|
|
271
277
|
attachTools(resolved, tools);
|
|
272
278
|
const skills = client ? null : await spaceSkills(turn.space.id);
|
|
273
279
|
const block = skills
|
|
@@ -289,7 +295,7 @@ export async function workTurn(turn, signal, steps, choice = {}) {
|
|
|
289
295
|
.join("\n")
|
|
290
296
|
: "";
|
|
291
297
|
return {
|
|
292
|
-
resolved,
|
|
298
|
+
resolved: harnessedModel(resolved),
|
|
293
299
|
tools,
|
|
294
300
|
instructions: [
|
|
295
301
|
instructionsFor(turn.space.name, block, "space_search" in tools, client),
|
|
@@ -9,8 +9,8 @@ const EN = {
|
|
|
9
9
|
schemaMismatch: "The wizard doesn’t match the schema.",
|
|
10
10
|
providerError: "The provider answered with error {status}.",
|
|
11
11
|
providerUnreachable: "The provider cannot be reached right now.",
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
serverUnreachable: "Nothing answers at this address. Is {name} running?",
|
|
13
|
+
serverNoModel: "{name} runs, but has no model that writes yet.",
|
|
14
14
|
importedFrom: "Imported from “{name}”: {steps}, {files}.",
|
|
15
15
|
imported: "Imported: {steps}, {files}.",
|
|
16
16
|
stepCount: { one: "{count} step", other: "{count} steps" },
|
|
@@ -120,7 +120,6 @@ const EN = {
|
|
|
120
120
|
somethingWentWrongTry: "Something went wrong. Try again.",
|
|
121
121
|
unknownApp: "Unknown app.",
|
|
122
122
|
onlyOrganizationAdminsChange: "Only organization admins can change its models.",
|
|
123
|
-
localModelNotRemoved: "Ollama didn’t remove the model: {error}",
|
|
124
123
|
modelLacksForClass: "{model} lacks what the class {cls} can’t work without: {needs}. Choose another model for it.",
|
|
125
124
|
"need.tools": "tool calls",
|
|
126
125
|
"need.json": "JSON output",
|
|
@@ -280,8 +279,8 @@ const DE = {
|
|
|
280
279
|
keyUnknown: "Der Anbieter kennt diesen API-Key nicht.",
|
|
281
280
|
providerError: "Der Anbieter antwortet mit Fehler {status}.",
|
|
282
281
|
providerUnreachable: "Der Anbieter ist gerade nicht erreichbar.",
|
|
283
|
-
|
|
284
|
-
|
|
282
|
+
serverUnreachable: "Unter dieser Adresse antwortet nichts. Läuft {name}?",
|
|
283
|
+
serverNoModel: "{name} läuft, hat aber noch kein Modell, das schreibt.",
|
|
285
284
|
importedFrom: "Importiert aus „{name}“: {steps}, {files}.",
|
|
286
285
|
imported: "Importiert: {steps}, {files}.",
|
|
287
286
|
stepCount: { one: "{count} Schritt", other: "{count} Schritte" },
|
|
@@ -378,7 +377,6 @@ const DE = {
|
|
|
378
377
|
somethingWentWrongTry: "Da ist etwas schiefgelaufen. Versuch es noch einmal.",
|
|
379
378
|
unknownApp: "Diese App gibt es nicht.",
|
|
380
379
|
onlyOrganizationAdminsChange: "Nur Admins der Organisation ändern ihre Modelle.",
|
|
381
|
-
localModelNotRemoved: "Ollama hat das Modell nicht entfernt: {error}",
|
|
382
380
|
modelLacksForClass: "{model} fehlt, was die Klasse {cls} unbedingt braucht: {needs}. Wähle dafür ein anderes Modell.",
|
|
383
381
|
"need.tools": "Tool-Aufrufe",
|
|
384
382
|
"need.json": "JSON-Ausgabe",
|
|
@@ -3,6 +3,8 @@ import { brokerCall, inAudience, kindOf, reachesOutside, } from "../broker/index
|
|
|
3
3
|
import { resolveConnector } from "../connectors/external.js";
|
|
4
4
|
import { prompt } from "../prompts.js";
|
|
5
5
|
import { attempt, clip } from "./shared.js";
|
|
6
|
+
/** The tools that are a connection's action. */
|
|
7
|
+
export const connectionTools = new WeakSet();
|
|
6
8
|
const TOOL_NAME = /^[a-zA-Z0-9_-]{1,64}$/;
|
|
7
9
|
/** A tool's name: the connector's prefix, the connection (two of one service in a space are two), the action. */
|
|
8
10
|
export const connectionToolName = (connector, row, actionId) => `${connector.toolPrefix}_${row.id}_${actionId}`;
|
|
@@ -111,6 +113,7 @@ export function makeConnectionTools(options) {
|
|
|
111
113
|
? attempt(async () => connectionResult(await callConnection(tool, options.who, options.where(tool), input), service))
|
|
112
114
|
: options.write(tool, input),
|
|
113
115
|
});
|
|
116
|
+
connectionTools.add(tools[name]);
|
|
114
117
|
if (!read) {
|
|
115
118
|
writes.add(name);
|
|
116
119
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { createCatalogSearch, defineEmbedder, memoryVectors, } from "@engenty/search-index";
|
|
2
|
+
import { createToolHarness, levelOf, TOOL_CALL, TOOL_SEARCH, throughHarness, toolJudge, } from "@engenty/tool-harness";
|
|
3
|
+
import { createTool } from "@mastra/core/tools";
|
|
4
|
+
import { embedMany } from "ai";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { decide } from "../engine/decide.js";
|
|
7
|
+
import { embeddingModel, keepsOwnLoop, systemOneAccess } from "../models.js";
|
|
8
|
+
import { currentTenant } from "../tenants/tenant.js";
|
|
9
|
+
import { connectionTools } from "./connections.js";
|
|
10
|
+
import { assistantToolPlugin } from "./plugin.js";
|
|
11
|
+
import { attempt } from "./shared.js";
|
|
12
|
+
/** Vectors of a model that says no length of its own: their first call tells it. */
|
|
13
|
+
const DIMENSIONS = 1;
|
|
14
|
+
async function embedder() {
|
|
15
|
+
const resolved = await embeddingModel().catch(() => null);
|
|
16
|
+
return resolved
|
|
17
|
+
? defineEmbedder(async (texts) => (await embedMany({ model: resolved.model, values: texts })).embeddings.map((v) => Array.from(v)), { dimensions: DIMENSIONS, modelId: resolved.ref })
|
|
18
|
+
: null;
|
|
19
|
+
}
|
|
20
|
+
/** Jev, where the runtime reaches it: never the decision model of the local Ollama. */
|
|
21
|
+
async function decision() {
|
|
22
|
+
const access = await systemOneAccess().catch(() => null);
|
|
23
|
+
if (!access || access.local) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
way: "runtime",
|
|
28
|
+
model: access.model ?? "classifier",
|
|
29
|
+
systemOne: async ({ state, questions }) => {
|
|
30
|
+
const made = await decide({
|
|
31
|
+
state,
|
|
32
|
+
questions: questions,
|
|
33
|
+
deadlineMs: 3000,
|
|
34
|
+
modelOnly: true,
|
|
35
|
+
});
|
|
36
|
+
return { model: access.model ?? "classifier", answers: made.answers };
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/** Vectors by their model and text, in this process: the same action's are the same everywhere. */
|
|
41
|
+
const vectors = memoryVectors();
|
|
42
|
+
/** One search per tenant: it embeds on the tenant's own model. */
|
|
43
|
+
const searches = new Map();
|
|
44
|
+
function search() {
|
|
45
|
+
const tenant = currentTenant();
|
|
46
|
+
const known = searches.get(tenant);
|
|
47
|
+
if (known) {
|
|
48
|
+
return known;
|
|
49
|
+
}
|
|
50
|
+
const made = createCatalogSearch({ embedder, store: vectors, judge: toolJudge(decision) });
|
|
51
|
+
searches.set(tenant, made);
|
|
52
|
+
return made;
|
|
53
|
+
}
|
|
54
|
+
function inputOf(tool) {
|
|
55
|
+
try {
|
|
56
|
+
return z.toJSONSchema(tool.inputSchema, { unrepresentable: "any" });
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** A connection's action or a plugin's tool: there are many, and one chat uses few of them. */
|
|
63
|
+
export const oneOfMany = (tool) => typeof tool === "object" &&
|
|
64
|
+
tool !== null &&
|
|
65
|
+
(connectionTools.has(tool) || assistantToolPlugin.has(tool));
|
|
66
|
+
/** The tools of a turn behind the harness. `folds`: the ones that need not be in every prompt. */
|
|
67
|
+
export function harnessed(tools, resolved, folds) {
|
|
68
|
+
const held = Object.entries(tools)
|
|
69
|
+
// A provider's own tool (web search) is the model's: nothing here runs it.
|
|
70
|
+
.filter(([, tool]) => typeof tool?.execute === "function")
|
|
71
|
+
.map(([name, tool]) => ({
|
|
72
|
+
name,
|
|
73
|
+
description: String(tool.description ?? ""),
|
|
74
|
+
input: inputOf(tool),
|
|
75
|
+
tool,
|
|
76
|
+
}));
|
|
77
|
+
const harness = createToolHarness({
|
|
78
|
+
tools: held,
|
|
79
|
+
core: ({ name, tool }) => keepsOwnLoop(resolved) || !folds(name, tool),
|
|
80
|
+
level: levelOf({ model: resolved.ref }),
|
|
81
|
+
search: search(),
|
|
82
|
+
});
|
|
83
|
+
if (!harness.meta.length) {
|
|
84
|
+
return { tools, hint: async () => "" };
|
|
85
|
+
}
|
|
86
|
+
const shown = new Set(harness.shown.map((tool) => tool.name));
|
|
87
|
+
const about = (name) => harness.meta.find((tool) => tool.name === name)?.description ?? "";
|
|
88
|
+
return {
|
|
89
|
+
tools: {
|
|
90
|
+
...Object.fromEntries(Object.entries(tools).filter(([name, tool]) => shown.has(name) || typeof tool?.execute !== "function")),
|
|
91
|
+
[TOOL_SEARCH]: createTool({
|
|
92
|
+
id: TOOL_SEARCH,
|
|
93
|
+
description: about(TOOL_SEARCH),
|
|
94
|
+
inputSchema: z.object({ query: z.string().describe("What you need to do.") }),
|
|
95
|
+
execute: async ({ query }) => ({ found: await harness.find(query) }),
|
|
96
|
+
}),
|
|
97
|
+
[TOOL_CALL]: createTool({
|
|
98
|
+
id: TOOL_CALL,
|
|
99
|
+
description: about(TOOL_CALL),
|
|
100
|
+
inputSchema: z.looseObject({
|
|
101
|
+
name: z.string().describe("The tool's name."),
|
|
102
|
+
input: z.record(z.string(), z.unknown()).optional().describe("Its input."),
|
|
103
|
+
}),
|
|
104
|
+
execute: (raw, context) => attempt(async () => {
|
|
105
|
+
const meant = harness.resolve(raw);
|
|
106
|
+
if (!meant.ok) {
|
|
107
|
+
return { error: meant.say };
|
|
108
|
+
}
|
|
109
|
+
const schema = meant.tool.tool.inputSchema;
|
|
110
|
+
const read = schema?.safeParse?.(meant.input);
|
|
111
|
+
if (read && !read.success) {
|
|
112
|
+
return { error: `Nothing was done. ${z.prettifyError(read.error)}` };
|
|
113
|
+
}
|
|
114
|
+
return meant.tool.tool.execute?.(read ? read.data : meant.input, context);
|
|
115
|
+
}),
|
|
116
|
+
}),
|
|
117
|
+
},
|
|
118
|
+
hint: (message, signal) => harness.hint(message, { signal }).catch(() => ""),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** A model whose direct calls of tools outside the prompt go through the harness. */
|
|
122
|
+
export const harnessedModel = (resolved) => keepsOwnLoop(resolved) || typeof resolved.model !== "object" || !resolved.model
|
|
123
|
+
? resolved
|
|
124
|
+
: { ...resolved, model: throughHarness(resolved.model) };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{Rn as t}from"./ui-DfVpZYIW.js";import{c as n,n as r}from"./marked.esm-BfGIZK7F.js";import{n as i,t as a}from"./jsx-runtime-C3cWAN_r.js";import{t as o}from"./logo-xL-sneZz.js";import{s}from"./i18n-DVrYWJaj.js";import{_ as c,a as l,f as u,h as d,i as f,o as p,s as m}from"./ui-CW2I3ecu.js";import{g as h,h as g,m as _,t as v,u as y}from"./UpdateCheck-DPr9NXq_.js";import{ReleaseNotes as b,loadReleases as x,releaseDate as S,releaseLabel as C}from"./ChangelogDialog-BLCYV4jT.js";import{t as w}from"./preload-helper-Cj7BV335.js";var T=e(i(),1),E=[{name:`engenty wizards`,description:`credit.engenty-wizards`,homepage:`https://github.com/engenty/wizards`,license:`FSL-1.1-MIT`},{name:`engenty`,description:`credit.engenty`,homepage:`https://github.com/engenty/engenty`,license:`FSL-1.1-MIT`}],D=[{name:`Mastra`,description:`credit.mastra`,homepage:`https://github.com/mastra-ai/mastra`,license:`Apache-2.0`},{name:`AI SDK`,description:`credit.ai-sdk`,homepage:`https://github.com/vercel/ai`,license:`Apache-2.0`},{name:`Model Context Protocol`,description:`credit.model-context-protocol`,homepage:`https://github.com/modelcontextprotocol/typescript-sdk`,license:`MIT`},{name:`Hono`,description:`credit.hono`,homepage:`https://github.com/honojs/hono`,license:`MIT`},{name:`Drizzle ORM`,description:`credit.drizzle-orm`,homepage:`https://github.com/drizzle-team/drizzle-orm`,license:`Apache-2.0`},{name:`libSQL`,description:`credit.libsql`,homepage:`https://github.com/tursodatabase/libsql`,license:`MIT`},{name:`Playwright`,description:`credit.playwright`,homepage:`https://github.com/microsoft/playwright`,license:`Apache-2.0`},{name:`React`,description:`credit.react`,homepage:`https://github.com/facebook/react`,license:`MIT`},{name:`Vite`,description:`credit.vite`,homepage:`https://github.com/vitejs/vite`,license:`MIT`},{name:`Tailwind CSS`,description:`credit.tailwind-css`,homepage:`https://github.com/tailwindlabs/tailwindcss`,license:`MIT`},{name:`React Flow`,description:`credit.react-flow`,homepage:`https://github.com/xyflow/xyflow`,license:`MIT`},{name:`TanStack Query`,description:`credit.tanstack-query`,homepage:`https://github.com/TanStack/query`,license:`MIT`},{name:`xterm.js`,description:`credit.xterm-js`,homepage:`https://github.com/xtermjs/xterm.js`,license:`MIT`},{name:`Lucide`,description:`credit.lucide`,homepage:`https://github.com/lucide-icons/lucide`,license:`ISC`},{name:`Geist & Geist Mono`,description:`credit.geist-geist-mono`,homepage:`https://github.com/vercel/geist-font`,license:`OFL-1.1`},{name:`Space Grotesk`,description:`credit.space-grotesk`,homepage:`https://github.com/floriankarsten/space-grotesk`,license:`OFL-1.1`},{name:`git-cliff`,description:`credit.git-cliff`,homepage:`https://github.com/orhun/git-cliff`,license:`MIT OR Apache-2.0`}],O=e(a(),1),k=(e,...t)=>t.some(t=>t?.toLowerCase().includes(e));function A({name:e,homepage:t,version:r,license:i,description:a}){return(0,O.jsxs)(`li`,{className:`py-2.5`,children:[(0,O.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-0.5`,children:[t?(0,O.jsxs)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 font-medium text-[0.875rem] text-ink underline-offset-4 hover:underline`,children:[e,(0,O.jsx)(n,{"aria-hidden":!0,className:`size-3 text-ink-4`})]}):(0,O.jsx)(`span`,{className:`font-medium text-[0.875rem] text-ink`,children:e}),r?(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3 tabular-nums`,children:r}):null,(0,O.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:i})]}),a?(0,O.jsx)(`p`,{className:`mt-0.5 text-[0.8125rem] text-ink-3`,children:a}):null]})}function j({title:e,hint:t,children:n}){return(0,O.jsxs)(`section`,{className:`mt-6`,children:[(0,O.jsx)(`h3`,{className:`border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:e}),t?(0,O.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-ink-3`,children:t}):null,n]})}function M({credits:e}){return(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:e.map(e=>(0,O.jsx)(A,{name:e.name,homepage:e.homepage,license:e.license,description:s(e.description)},e.name))})}function N({label:e,packages:t}){return(0,O.jsxs)(`div`,{className:`mt-4`,children:[(0,O.jsx)(`h4`,{className:`font-medium text-[0.75rem] text-ink-3 tracking-wide`,children:e}),(0,O.jsx)(`ul`,{className:`divide-y divide-border-soft`,children:t.map(e=>(0,O.jsx)(A,{...e},e.name))})]})}function P({active:e}){let[t,n]=(0,T.useState)(null),[r,i]=(0,T.useState)(``);(0,T.useEffect)(()=>{if(!e||t)return;let r=!1;return w(()=>import(`./oss-credits-BHy69wkx.js`).then(e=>{r||n(e.default)}),[]),()=>{r=!0}},[e,t]),(0,T.useEffect)(()=>{e||i(``)},[e]);let a=r.trim().toLowerCase(),o=e=>a?e.filter(e=>k(a,e.name,e.license,s(e.description))):e,c=e=>a?e.filter(e=>k(a,e.name,e.license,e.version)):e,d=o(E),f=o(D),p=t?[{id:`shared`,label:s(`about.creditsShared`),packages:c(t.shared)},...t.groups.map(e=>({id:e.id,label:e.label,packages:c(e.packages)}))].filter(e=>e.packages.length>0):[],h=d.length===0&&f.length===0&&p.length===0;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`p`,{className:`mb-4 text-[0.875rem] text-ink-3`,children:s(`about.creditsHint`)}),(0,O.jsx)(m,{type:`search`,value:r,placeholder:s(`about.search`),onChange:e=>i(e.target.value)}),d.length>0?(0,O.jsx)(j,{title:s(`about.creditsProduct`),children:(0,O.jsx)(M,{credits:d})}):null,f.length>0?(0,O.jsx)(j,{title:s(`about.creditsBuiltWith`),children:(0,O.jsx)(M,{credits:f})}):null,t===null?(0,O.jsx)(`div`,{className:`flex justify-center py-10 text-ink-3`,children:(0,O.jsx)(u,{})}):p.length>0?(0,O.jsx)(j,{title:s(`about.creditsDeps`),hint:a?void 0:s(`about.creditsDepsHint`),children:p.map(e=>(0,O.jsx)(N,{label:e.label,packages:e.packages},e.id))}):null,t!==null&&h?(0,O.jsx)(l,{children:s(`about.noMatches`)}):null]})}var F=[`new`,`earlier`,`credits`],I=e=>s(e===`new`?`about.tab.new`:e===`earlier`?`about.tab.earlier`:`about.credits`),L=e=>e===1?s(`about.change`):s(`about.changes`,{n:e});function R({me:e,active:n,initialTab:r=`new`}){let i=e?.mode===`local`,{data:a,latest:l}=g(i&&n),[f,p]=(0,T.useState)(null),[m,w]=(0,T.useState)(r);(0,T.useEffect)(()=>w(r),[r]);let E=_(F.indexOf(m)),D=a?.newer&&l?l:h;(0,T.useEffect)(()=>{if(!n)return;let e=!1;return p(null),x(D===`0.21.0`?void 0:D).then(t=>{e||p(t)}),()=>{e=!0}},[n,D]);let k=f?.find(e=>e.version===`v${D}`)??f?.[0]??null,A=f?.filter(e=>e!==k)??[],j=i?a?.kind??null:`cloud`;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`flex flex-col items-center pt-4 text-center`,children:[(0,O.jsx)(o,{size:96}),(0,O.jsxs)(`div`,{className:`mt-4 font-display font-semibold text-[1.5rem] tracking-tight`,children:[`engenty`,(0,O.jsx)(`span`,{className:`text-ember`,children:`.`}),(0,O.jsx)(`span`,{className:`ml-1.5 font-normal text-ink-3`,children:`wizards`})]}),(0,O.jsxs)(`div`,{className:`mt-1 text-[0.9375rem] text-ink-3 tabular-nums`,children:[s(`about.version`,{v:h}),j?` · ${s(`about.kind.${j}`)}`:``]})]}),i?(0,O.jsx)(`div`,{className:`mt-5`,children:(0,O.jsx)(v,{enabled:n})}):null,(0,O.jsx)(`div`,{className:`mt-6 flex justify-center`,children:(0,O.jsx)(d,{value:m,onChange:w,options:F.map(e=>({id:e,label:I(e)})),label:s(`about.title`)})}),(0,O.jsxs)(`div`,{className:c(`mt-5`,y(E)),children:[m===`new`?f===null?(0,O.jsx)(`div`,{className:`flex justify-center py-6 text-ink-3`,children:(0,O.jsx)(u,{})}):k?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`h3`,{className:`flex items-baseline gap-3 border-border-soft border-b pb-2 font-display font-semibold text-[1rem]`,children:[C(k),(0,O.jsx)(`span`,{className:`font-normal font-sans text-[0.8125rem] text-ink-3 tabular-nums`,children:S(k)})]}),(0,O.jsx)(`div`,{className:`mt-3`,children:(0,O.jsx)(b,{release:k})})]}):(0,O.jsx)(`p`,{className:`text-[0.875rem] text-ink-3`,children:s(`about.changelogEmpty`)}):null,m===`earlier`?(0,O.jsx)(`div`,{className:`flex flex-col divide-y divide-border-soft`,children:A.map(e=>(0,O.jsxs)(`details`,{className:`group/r py-2`,children:[(0,O.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-baseline gap-3 text-[0.875rem] [&::-webkit-details-marker]:hidden`,children:[(0,O.jsx)(t,{className:`size-3.5 shrink-0 self-center text-ink-4 transition group-open/r:rotate-90`}),(0,O.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:C(e)}),(0,O.jsx)(`span`,{className:`text-[0.8125rem] text-ink-3 tabular-nums`,children:S(e)}),(0,O.jsx)(`span`,{className:`ml-auto text-[0.8125rem] text-ink-4`,children:L(e.commits.length)})]}),(0,O.jsx)(`div`,{className:`mt-2 pl-6`,children:(0,O.jsx)(b,{release:e})})]},e.version??`unreleased`))}):null,m===`credits`?(0,O.jsx)(P,{active:!0}):null]},m)]})}function z({open:e,onClose:t,me:n}){return(0,O.jsxs)(f,{open:e,onClose:t,wide:!0,height:`tall`,children:[(0,O.jsx)(`div`,{className:`-mt-2 -mr-2 sticky top-0 z-10 flex h-0 justify-end`,children:(0,O.jsx)(p,{label:s(`common.close`),onClick:t,children:(0,O.jsx)(r,{className:`size-4`})})}),(0,O.jsx)(R,{me:n,active:e})]})}export{z as AboutDialog,R as AboutPanel};
|