@uniqbit/mate-core 1.0.0-canary.8 → 1.0.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/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
- package/package.json +5 -4
- package/src/cli/commands/artifact/delivery/link.ts +1 -1
- package/src/cli/commands/artifact/delivery/output.ts +10 -1
- package/src/cli/commands/artifact/delivery/resolve.ts +3 -2
- package/src/cli/commands/artifact/delivery/submit.ts +9 -4
- package/src/cli/commands/artifact/delivery/take.ts +12 -9
- package/src/cli/commands/artifact/finish/command.ts +16 -14
- package/src/cli/commands/artifact/finish/engine.ts +8 -8
- package/src/cli/commands/artifact/project/command.ts +2 -3
- package/src/cli/commands/companion/hub.ts +11 -6
- package/src/cli/commands/companion/link.ts +173 -46
- package/src/cli/commands/doctor.ts +17 -0
- package/src/cli/commands/report/contract.ts +0 -17
- package/src/cli/commands/studio/access.ts +4 -0
- package/src/cli/commands/studio/actions.ts +35 -2
- package/src/cli/commands/studio/mcp-manager.ts +162 -0
- package/src/cli/commands/studio/routes.ts +12 -0
- package/src/cli/commands/studio/selection.ts +44 -11
- package/src/cli/commands/studio/server.ts +246 -2
- package/src/cli/commands/studio/services.ts +26 -0
- package/src/cli/commands/studio/terminal-launch.ts +21 -4
- package/src/cli/commands/studio/terminal.ts +3 -14
- package/src/cli/commands/studio/work-requests.ts +9 -0
- package/src/cli/commands/studio/work.ts +473 -0
- package/src/cli/commands/vscode/release-vsix.json +2 -2
- package/src/cli/commands/working/cleanup.ts +1 -18
- package/src/cli/companion-link-wizard.tsx +158 -91
- package/src/cli/usage.ts +1 -1
- package/src/create-mate.ts +4 -1
- package/src/lib/agent-credential.ts +131 -0
- package/src/lib/credential-kinds.ts +7 -0
- package/src/lib/delivery/merge-git.ts +16 -0
- package/src/lib/delivery/record-delivery.ts +12 -6
- package/src/lib/delivery/record.ts +5 -0
- package/src/lib/delivery/refresh.ts +34 -6
- package/src/lib/delivery/staging/refs.ts +9 -4
- package/src/lib/delivery/staging/submit.ts +81 -22
- package/src/lib/mcp-manager/resolve.ts +88 -0
- package/src/lib/mcp-manager/store.ts +133 -0
- package/src/lib/mcp-manager/types.ts +72 -0
- package/src/lib/mcp-manager/validate.ts +242 -0
- package/src/lib/opencode-server.ts +2 -17
- package/src/lib/orchestrator/config-store.ts +30 -7
- package/src/lib/orchestrator/engine-floor.ts +16 -4
- package/src/lib/orchestrator/engine-guard.ts +7 -1
- package/src/lib/orchestrator/repo-local-store.ts +14 -0
- package/src/lib/orchestrator/repository-link.ts +80 -52
- package/src/lib/orchestrator/root-context.ts +17 -1
- package/src/lib/orchestrator/types.ts +4 -0
- package/src/lib/studio-chat/agent.ts +139 -0
- package/src/lib/studio-chat/companion-context.ts +136 -0
- package/src/lib/studio-chat/credential.ts +79 -0
- package/src/lib/studio-chat/harness-chat-agent.ts +334 -0
- package/src/lib/studio-chat/host-sandbox.ts +578 -0
- package/src/lib/studio-chat/prepare-bridges.ts +95 -0
- package/src/lib/studio-chat/session.ts +15 -0
- package/src/lib/studio-chat/turns.ts +112 -0
- package/src/lib/workset/claims.ts +85 -0
- package/src/lib/workset/execution.ts +71 -0
- package/src/lib/workset/git-transaction.ts +74 -0
- package/src/lib/workset/groups.ts +176 -0
- package/src/lib/workset/inventory.ts +196 -0
- package/src/lib/workset/projection.ts +237 -0
- package/src/lib/workset/record.ts +101 -36
- package/src/lib/workset/repositories.ts +24 -0
- package/src/lib/workset/sharing.ts +951 -0
- package/src/lib/workset/stages.ts +50 -14
- package/src/lib/workset/transactions.ts +158 -0
- package/src/runtime/companion-git-state.ts +1 -0
- package/src/runtime/companion-guidance.ts +2 -2
- package/src/runtime/forge-remote.ts +6 -0
- package/src/runtime/host-process.ts +28 -0
- package/src/runtime/secret-guard.ts +18 -1
- package/src/runtime/secret-patterns.ts +4 -3
- package/src/runtime/submitted-arrivals.ts +28 -2
- package/src/runtime/workflow/turn.ts +14 -12
- package/src/runtime/write-atomic.ts +2 -2
- package/src/studio.ts +61 -0
- package/src/templates/capabilities/openspec-cap/mate-full/schema.yaml +1 -1
- package/src/templates/capabilities/openspec-cap/mate-full/templates/proposal.md +1 -1
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +5 -3
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +3 -2
- package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +5 -3
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +12 -12
- package/src/tools/setup/capabilities/mcp-manager.ts +73 -0
- package/src/tools/setup/context-services.ts +35 -6
- package/src/tools/setup/dynamic-plugins/audiences.ts +3 -2
- package/src/tools/setup/dynamic-plugins/declarations.ts +0 -26
- package/src/tools/setup/engine.ts +55 -3
- package/src/tools/setup/plugin.ts +14 -0
- package/src/tools/setup/plugins/gitignore.ts +1 -0
- package/src/tools/setup/providers/claude-format.ts +40 -7
- package/src/tools/setup/providers/claude.ts +38 -3
- package/src/tools/setup/providers/opencode-format.ts +13 -3
- package/src/tools/setup/providers/opencode.ts +7 -18
- package/src/tools/setup/providers/relative-path-warnings.ts +26 -0
- package/studio-dist/THIRD-PARTY-NOTICES.md +297 -0
- package/studio-dist/client/THIRD-PARTY-LICENSES.md +4294 -0
- package/studio-dist/client/assets/DialogTitle-DOhjDa7H.js +1 -0
- package/studio-dist/client/assets/app-CG3vCgyA.css +2 -0
- package/studio-dist/client/assets/bundle-mjs-CdK3cBzO.js +1 -0
- package/studio-dist/client/assets/button-upSzkd-q.js +1 -0
- package/studio-dist/client/assets/chat-DbaMXb8H.js +157 -0
- package/studio-dist/client/assets/cn-BCnYnarL.js +1 -0
- package/studio-dist/client/assets/combobox-cP9OsRf2.js +1 -0
- package/studio-dist/client/assets/{companion-view-C_N237bf.js → companion-view-B54_Lj0S.js} +1 -1
- package/studio-dist/client/assets/fields-DNZ4a89M.js +1 -0
- package/studio-dist/client/assets/friction-DgEimeDB.js +1 -0
- package/studio-dist/client/assets/getting-started-BTfYCt5s.js +1 -0
- package/studio-dist/client/assets/{getting-started-djaQeWlu.js → getting-started-CAszmdDJ.js} +1 -1
- package/studio-dist/client/assets/getting-started._topic-CHJMf0pa.js +1 -0
- package/studio-dist/client/assets/getting-started.index-MR6HftWs.js +1 -0
- package/studio-dist/client/assets/{graph-canvas-ySGKMhmk.js → graph-canvas-BdNk2F9O.js} +1 -1
- package/studio-dist/client/assets/graph-hRijsC89.js +2 -0
- package/studio-dist/client/assets/guides-CwFnh08E.js +1 -0
- package/studio-dist/client/assets/highlighted-body-JLMTFACH-BcroQey-.js +1 -0
- package/studio-dist/client/assets/index-D5oGyvG8.js +41 -0
- package/studio-dist/client/assets/{markdown-view-jMiaBTSO.js → markdown-view-CJ8JsLb7.js} +1 -1
- package/studio-dist/client/assets/marked.esm-vFuq1cCd.js +65 -0
- package/studio-dist/client/assets/mcp-BE9M-bkO.js +4 -0
- package/studio-dist/client/assets/mermaid-WFAXDIZX-BjSsakrn.js +1 -0
- package/studio-dist/client/assets/panel-CDQ6Lryw.js +1 -0
- package/studio-dist/client/assets/plugins._service._view-DRVPUAWN.js +1 -0
- package/studio-dist/client/assets/{prepaint-CKsXyJOR.js → prepaint-sD_LlrDN.js} +1 -1
- package/studio-dist/client/assets/{queries-Dfp5deWj.js → queries-COL925ML.js} +1 -1
- package/studio-dist/client/assets/react-dom-K3Hp2Cdj.js +1 -0
- package/studio-dist/client/assets/{react-BYUSgtBs.js → react-h2xQ_NSp.js} +1 -1
- package/studio-dist/client/assets/reports-BClsojkb.js +1 -0
- package/studio-dist/client/assets/routes-CJQ2MAej.js +1 -0
- package/studio-dist/client/assets/search-DhWdEiKT.js +1 -0
- package/studio-dist/client/assets/select-B2FsN9FY.js +1 -0
- package/studio-dist/client/assets/skills-SoUHk77W.js +1 -0
- package/studio-dist/client/assets/{specs-BrCOjOch.js → specs-C_tZnAvF.js} +1 -1
- package/studio-dist/client/assets/specs-view-C6t3Y5IT.js +1 -0
- package/studio-dist/client/assets/steps-CF3-Zpmh.js +1 -0
- package/studio-dist/client/assets/{store-C3vJq8Wj.js → store-pY9gU4uS.js} +1 -1
- package/studio-dist/client/assets/studio-X7bnFrRe.js +36 -0
- package/studio-dist/client/assets/studio-queries-CKtAnIKP.js +2 -0
- package/studio-dist/client/assets/usage-BaaqUpTG.js +55 -0
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-BspHR7Wt.js +1 -0
- package/studio-dist/client/assets/useBlocker-BQOfcu_f.js +1 -0
- package/studio-dist/client/assets/useMutation-DKeEoP5S.js +1 -0
- package/studio-dist/client/assets/useOpenInteractionType-CtaZCaFT.js +1 -0
- package/studio-dist/client/assets/usePopupHandleStore-Bc7Q4bnF.js +1 -0
- package/studio-dist/client/assets/vault-sAPFUnPN.js +1 -0
- package/studio-dist/client/assets/{warnings-CqOOGlPD.js → warnings-D7YY1HSG.js} +1 -1
- package/studio-dist/client/assets/work-BZek_LGB.js +5 -0
- package/studio-dist/client/assets/workflow-N5boHXFz.js +1 -0
- package/studio-dist/server/THIRD-PARTY-LICENSES.md +4371 -0
- package/studio-dist/server/assets/DialogTitle-DnKSl2V0.js +421 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-gVfW5vIV.js → __23tanstack-start-server-fn-resolver-Bli9bpSB.js} +38 -18
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +91 -59
- package/studio-dist/server/assets/{actions-D8erOphH.js → actions-CHEFA1i9.js} +33 -1
- package/studio-dist/server/assets/{cn-FXJAM0KO.js → bundle-mjs-Ot6dQ8Pq.js} +1 -2056
- package/studio-dist/server/assets/{button-D6bvrFmm.js → button-BqA1urbl.js} +14 -7
- package/studio-dist/server/assets/chat-zl332Tvu.js +49486 -0
- package/studio-dist/server/assets/cn-B0fl6NWK.js +2057 -0
- package/studio-dist/server/assets/{combobox-D2MbYV1O.js → combobox-iTjvPCtS.js} +7 -6
- package/studio-dist/server/assets/{companion-view-Mf1ANbMb.js → companion-view-DIQ6AFIY.js} +2 -2
- package/studio-dist/server/assets/{companions-Dr6IpNAb.js → companions-aVwjRL8j.js} +1 -1
- package/studio-dist/server/assets/{fields-B4mAPETz.js → fields-BMap2_Ju.js} +10 -3
- package/studio-dist/server/assets/{friction-CWOTjpCV.js → friction-BER50hoD.js} +2 -2
- package/studio-dist/server/assets/{friction-9a5S1m7U.js → friction-BPs9KWdq.js} +8 -8
- package/studio-dist/server/assets/{getting-started-RU6tYU2Q.js → getting-started-DGfRVmZ_.js} +2 -2
- package/studio-dist/server/assets/{getting-started._topic-C02HGrC6.js → getting-started._topic-BgrBA4Vj.js} +2 -2
- package/studio-dist/server/assets/{getting-started.index-EzLRosbb.js → getting-started.index-BaFfQ9Mn.js} +2 -2
- package/studio-dist/server/assets/{graph-CZ2H9Fzr.js → graph-Cgzlrv3P.js} +8 -8
- package/studio-dist/server/assets/{graph-B11ITte0.js → graph-DODpuOy_.js} +1 -1
- package/studio-dist/server/assets/{graph-canvas-rP5TT14Z.js → graph-canvas-DW_zU1nA.js} +2 -2
- package/studio-dist/server/assets/{guides-BGftp4wf.js → guides-CA_EMG7E.js} +1 -1
- package/studio-dist/server/assets/{guides-B8HdeK_C.js → guides-D0SpoD32.js} +1 -1
- package/studio-dist/server/assets/{guides.server-DqFQAStf.js → guides.server-DJjQuy03.js} +1 -1
- package/studio-dist/server/assets/highlighted-body-JLMTFACH-BeHllu-r.js +41 -0
- package/studio-dist/server/assets/{markdown-view-CArpV-CS.js → markdown-view-CvVBGMZV.js} +1 -1
- package/studio-dist/server/assets/mcp-BU0fLYyJ.js +1103 -0
- package/studio-dist/server/assets/mcp-manager-D9YctTQe.js +50 -0
- package/studio-dist/server/assets/mermaid-WFAXDIZX-B1yDN6vG.js +1 -0
- package/studio-dist/server/assets/{panel-DR0iq46J.js → panel-D1K6Bsux.js} +4 -32
- package/studio-dist/server/assets/{plugins._service._view-n7u2k5dF.js → plugins._service._view-DdO1nELF.js} +4 -4
- package/studio-dist/server/assets/{prepaint-B28ClcPN.js → prepaint-BB3dwSmz.js} +1 -1
- package/studio-dist/server/assets/{queries-D-yVP9i0.js → queries-BwiDxQy5.js} +1 -1
- package/studio-dist/server/assets/{react-CiBZPDs8.js → react-B2cLiz-i.js} +1 -1
- package/studio-dist/server/assets/{reports-C2SmTgqh.js → reports-9Pr7Bz6o.js} +7 -7
- package/studio-dist/server/assets/{reports-B9k98oE6.js → reports-Cc9M3phM.js} +1 -1
- package/studio-dist/server/assets/{router-CPt0TAk_.js → router-DcWe0J7Y.js} +827 -548
- package/studio-dist/server/assets/{routes-CwH8LEy2.js → routes-BEXxl0py.js} +8 -8
- package/studio-dist/server/assets/{search-b-yQesv3.js → search-bltT7gwy.js} +39 -7
- package/studio-dist/server/assets/{select-C3i6TTX-.js → select-CZvHgGCi.js} +7 -6
- package/studio-dist/server/assets/{shell-CagqZZMZ.js → shell-BQ0vMKXN.js} +13 -4
- package/studio-dist/server/assets/{skills-DGg0mWDM.js → skills-Be_52h0i.js} +1 -1
- package/studio-dist/server/assets/{skills-C21Mg_8-.js → skills-BpGGUl6L.js} +8 -8
- package/studio-dist/server/assets/{specs-DetoMiaB.js → specs-CCGgXE-V.js} +5 -5
- package/studio-dist/server/assets/{specs-view-CmbfLDwN.js → specs-view-DtL5JxYM.js} +12 -11
- package/studio-dist/server/assets/{steps-D1tYAyWZ.js → steps-BWFSO6dM.js} +1 -1
- package/studio-dist/server/assets/{store-aC-I6f6o.js → store-X7yLPp7v.js} +1 -1
- package/studio-dist/server/assets/{studio-queries-Dqf-3nzj.js → studio-queries-ur1ygXi3.js} +117 -13
- package/studio-dist/server/assets/{studio-qRvQjRpz.js → studio-qzH-UETC.js} +1555 -179
- package/studio-dist/server/assets/{usage-Cwle9-xY.js → usage-C1o0DLzS.js} +1 -1
- package/studio-dist/server/assets/{usage-CS4CBK9D.js → usage-DWbSPrPD.js} +10 -9
- package/studio-dist/server/assets/{useAnchoredPopupScrollLock-BjMNgXv9.js → useAnchoredPopupScrollLock-DLDmv6kM.js} +4 -135
- package/studio-dist/server/assets/useBlocker-CQtANHK8.js +111 -0
- package/studio-dist/server/assets/{useMutation-DpBIuWXt.js → useMutation-NjlA8oFY.js} +2 -2
- package/studio-dist/server/assets/useOpenInteractionType-CZYscfOb.js +136 -0
- package/studio-dist/server/assets/usePopupHandleStore-DEEXJYv0.js +26 -0
- package/studio-dist/server/assets/{vault-CEBBRLMb.js → vault-B_kfi1h-.js} +1 -1
- package/studio-dist/server/assets/{vault-DVQidlId.js → vault-dL79JlKH.js} +8 -115
- package/studio-dist/server/assets/{views-UgO0Qz_g.js → views-BSGH56lb.js} +3 -3
- package/studio-dist/server/assets/{warnings-C7hgXpdk.js → warnings-DtUVPV-k.js} +2 -2
- package/studio-dist/server/assets/work-D789VXGH.js +110 -0
- package/studio-dist/server/assets/work-DsCEfhmK.js +3817 -0
- package/studio-dist/server/assets/work-requests-BLhOmQFO.js +11 -0
- package/studio-dist/server/assets/{workflow-6dZZ1ofw.js → workflow-BOZ2sRYg.js} +9 -9
- package/studio-dist/server/server.js +3 -3
- package/wrappers/bin/openspec +87 -2
- package/studio-dist/client/assets/app-ggXJ_QVh.css +0 -2
- package/studio-dist/client/assets/button-amJ3g5oD.js +0 -1
- package/studio-dist/client/assets/cn-BQPKiwI4.js +0 -1
- package/studio-dist/client/assets/combobox-CJ7aGFid.js +0 -1
- package/studio-dist/client/assets/fields-BAiGkJ5N.js +0 -1
- package/studio-dist/client/assets/friction-DqOU59v7.js +0 -1
- package/studio-dist/client/assets/getting-started-yp42dj5S.js +0 -1
- package/studio-dist/client/assets/getting-started._topic-C9zVXz_m.js +0 -1
- package/studio-dist/client/assets/getting-started.index-DWbDKICP.js +0 -1
- package/studio-dist/client/assets/graph-BYaD_5Bq.js +0 -2
- package/studio-dist/client/assets/guides-D6T6W_jV.js +0 -1
- package/studio-dist/client/assets/index-Qx7reRPD.js +0 -40
- package/studio-dist/client/assets/panel-C4bf_h2W.js +0 -1
- package/studio-dist/client/assets/plugins._service._view-y6f2FDAB.js +0 -1
- package/studio-dist/client/assets/reports-JFSwSueq.js +0 -1
- package/studio-dist/client/assets/routes-BdOWSgzK.js +0 -1
- package/studio-dist/client/assets/search-CXosfvYh.js +0 -1
- package/studio-dist/client/assets/select-BHYYWPhK.js +0 -1
- package/studio-dist/client/assets/skills-Bo9FLsBd.js +0 -1
- package/studio-dist/client/assets/specs-view-CdE2rlli.js +0 -1
- package/studio-dist/client/assets/steps-CKUno4lh.js +0 -1
- package/studio-dist/client/assets/studio-0ueISxwP.js +0 -100
- package/studio-dist/client/assets/studio-queries-BflKt9va.js +0 -2
- package/studio-dist/client/assets/usage-BLsLy0nN.js +0 -55
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-DC7f8GOp.js +0 -1
- package/studio-dist/client/assets/useMutation-uJUrejsi.js +0 -1
- package/studio-dist/client/assets/vault-BB1B_OhR.js +0 -1
- package/studio-dist/client/assets/workflow-BFzmI-06.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as CompanionView } from "./companion-view-
|
|
2
|
-
import {
|
|
1
|
+
import { t as CompanionView } from "./companion-view-DIQ6AFIY.js";
|
|
2
|
+
import { dt as useNavigate, h as vaultQuery, p as vaultChildrenQuery, ut as Link } from "./studio-queries-ur1ygXi3.js";
|
|
3
3
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
4
|
-
import { $ as Age,
|
|
5
|
-
import { t as cn } from "./cn-
|
|
6
|
-
import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-
|
|
7
|
-
import { t as Warnings } from "./warnings-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { $ as Age, ct as ROW, et as CommandLine, it as PAGE_PAD, lt as StatusWord, nt as EmptyNote, ot as Pills, r as Icon, rt as ListCard, st as Progress, t as Button, tt as Count } from "./button-BqA1urbl.js";
|
|
5
|
+
import { t as cn } from "./cn-B0fl6NWK.js";
|
|
6
|
+
import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-D1K6Bsux.js";
|
|
7
|
+
import { t as Warnings } from "./warnings-DtUVPV-k.js";
|
|
8
|
+
import { G as changeGroup, H as CHANGE_GROUPS, J as changeStep, K as changePath, Rt as useQuery, U as GROUP_TITLES, W as activeChanges, Y as groupChanges, q as changeProgress, y as Route } from "./router-DcWe0J7Y.js";
|
|
9
|
+
import { t as MarkdownView } from "./markdown-view-CvVBGMZV.js";
|
|
10
10
|
// src/views/overview/changed-specs.ts
|
|
11
11
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
12
12
|
/** Each capability once, at the newest shipped change that touched it. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as COMPANION_PARAM, F as viewsFor, O as LEGACY_ROLE_PARAM, P as requestedMode, S as SUBJECT_TYPES, T as COMPANION_DIGEST_PATTERN, b as REPORT_KINDS, j as STUDIO_MODE_PARAM, x as STATE_FILTERS } from "./studio-qzH-UETC.js";
|
|
2
2
|
// ../mate-core/src/lib/friction/view/model.ts
|
|
3
3
|
var FRICTION_VIEW_DAYS = [
|
|
4
4
|
7,
|
|
@@ -40,10 +40,42 @@ function validateStudioSearch(raw) {
|
|
|
40
40
|
if (frictionSort) search.frictionSort = frictionSort;
|
|
41
41
|
return search;
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The router's search parser: each value stays the text of the address. The default
|
|
45
|
+
* JSON-parses values, so a digest such as `647426e241` became a number and was dropped.
|
|
46
|
+
*/
|
|
47
|
+
function parseStudioSearch(searchStr) {
|
|
48
|
+
const first = /* @__PURE__ */ new Map();
|
|
49
|
+
for (const [key, value] of new URLSearchParams(searchStr)) if (!first.has(key)) first.set(key, unquoted(value));
|
|
50
|
+
return Object.fromEntries(first);
|
|
51
|
+
}
|
|
52
|
+
/** Addresses written before {@link parseStudioSearch} quote a value that reads as JSON. */
|
|
53
|
+
function unquoted(value) {
|
|
54
|
+
if (!value.startsWith("\"")) return value;
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(value);
|
|
57
|
+
return typeof parsed === "string" ? parsed : value;
|
|
58
|
+
} catch {
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Writes each value as plain text, as {@link parseStudioSearch} reads it back. A string
|
|
64
|
+
* starting with `"` is JSON-quoted so {@link unquoted} strips only the quotes added here.
|
|
65
|
+
* An object or array is written as JSON, not `[object Object]`, and read back as that text.
|
|
66
|
+
*/
|
|
67
|
+
function stringifyStudioSearch(search) {
|
|
68
|
+
const params = new URLSearchParams();
|
|
69
|
+
for (const [key, value] of Object.entries(search)) {
|
|
70
|
+
if (value === void 0 || value === null) continue;
|
|
71
|
+
const asJson = typeof value === "object" || typeof value === "string" && value.startsWith("\"");
|
|
72
|
+
params.set(key, asJson ? JSON.stringify(value) : String(value));
|
|
73
|
+
}
|
|
74
|
+
const text = params.toString();
|
|
75
|
+
return text ? `?${text}` : "";
|
|
76
|
+
}
|
|
44
77
|
function searchText(value) {
|
|
45
|
-
|
|
46
|
-
return String(value).trim() || void 0;
|
|
78
|
+
return typeof value === "string" ? value.trim() || void 0 : void 0;
|
|
47
79
|
}
|
|
48
80
|
/** Values naming nothing in the companion's specs are dropped by the view, not here. */
|
|
49
81
|
function validateSpecsSearch(raw) {
|
|
@@ -60,9 +92,9 @@ function validateSpecsSearch(raw) {
|
|
|
60
92
|
* The address to replace this one with so it names the effective mode and no legacy `role`,
|
|
61
93
|
* or `null` when it already does. A view the mode is not offered lands on the Overview.
|
|
62
94
|
*/
|
|
63
|
-
function canonicalHref(pathname, searchStr, view, studioMode) {
|
|
95
|
+
function canonicalHref(pathname, searchStr, view, studioMode, offers = {}) {
|
|
64
96
|
const params = new URLSearchParams(searchStr);
|
|
65
|
-
const offered = view === void 0 || viewsFor(studioMode).includes(view);
|
|
97
|
+
const offered = view === void 0 || viewsFor(studioMode, offers).includes(view);
|
|
66
98
|
if (params.get("studioMode") === studioMode && !params.has("role") && offered) return null;
|
|
67
99
|
if (!offered) {
|
|
68
100
|
const landing = new URLSearchParams();
|
|
@@ -75,4 +107,4 @@ function canonicalHref(pathname, searchStr, view, studioMode) {
|
|
|
75
107
|
params.set(STUDIO_MODE_PARAM, studioMode);
|
|
76
108
|
return `${pathname}?${params}`;
|
|
77
109
|
}
|
|
78
|
-
export {
|
|
110
|
+
export { validateSpecsSearch as a, frictionViewDays as c, stringifyStudioSearch as i, oneOf as n, validateStudioSearch as o, parseStudioSearch as r, FRICTION_VIEW_DAYS as s, canonicalHref as t };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
2
|
-
import { t as cn } from "./cn-
|
|
3
|
-
import {
|
|
4
|
-
import { _ as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { t as cn } from "./cn-B0fl6NWK.js";
|
|
3
|
+
import { Dn as contains, Dt as isElementVisible, Fn as isElementDisabled, Fr as useMergedRefs, G as useValueAsRef, H as visuallyHiddenInput, Hn as imperativeAction, In as CompositeList, Ir as useRefWithInit, Kn as itemPress, L as DROPDOWN_COLLISION_AVOIDANCE, Ln as cancelOpen, M as FloatingPortal, Mr as EMPTY_OBJECT, Nr as NOOP, Or as useRenderElement, Qt as stopEvent, S as useOpenChangeComplete, T as useDismiss, V as visuallyHidden, W as useAnimationFrame, Xt as isVirtualClick, Y as useTimeout, Yn as none, a as ReactStore, ar as useButton, cn as popupStateMapping, cr as useIsoLayoutEffect, dn as triggerOpenStateMapping, f as attachPreventUnmountOnClose, ht as COMPOSITE_KEYS, ir as useCompositeListItem, jn as webkit, jr as EMPTY_ARRAY, kn as jsdom, kr as mergeProps, kt as isListIndexDisabled, l as FOCUSABLE_POPUP_PROPS, lr as useStableCallback, mt as useDirection, nr as createChangeEventDetails, or as ownerDocument, pt as useToolbarRootContext, q as addEventListener, qt as rectToClientRect, r as Icon, sr as formatErrorMessage, tn as getFloatingFocusElement, tr as windowResize, un as pressableTriggerOpenStateMapping, vn as transitionStatusMapping, vr as getWindow, w as useTransitionStatus, x as useUnmountAfterClose, zr as useControlled } from "./button-BqA1urbl.js";
|
|
4
|
+
import { _ as fieldValidityMapping, c as useValueChanged, d as useFormContext, f as useRegisterFieldControl, h as useFieldRootContext, l as useLabelableId, o as InternalBackdrop, s as useSetFieldFocused, u as useLabelableContext, v as inertValue, y as FloatingFocusManager } from "./fields-BMap2_Ju.js";
|
|
5
|
+
import { r as useClick, t as useOpenInteractionType } from "./useOpenInteractionType-CZYscfOb.js";
|
|
6
|
+
import { _ as useOnFirstRender, a as resolveMultipleLabels, c as stringifyAsValue, d as findItemIndex, f as findSelectionIndex, h as resolveSelectedIndex, l as compareItemEquality, m as removeItem, o as resolveSelectedLabel, p as isSelectedValueDirty, r as hasNullItemLabel, s as stringifyAsLabel, t as useAnchoredPopupScrollLock, u as defaultItemEquality, v as useListNavigation, y as useFloatingRootContext } from "./useAnchoredPopupScrollLock-DLDmv6kM.js";
|
|
7
|
+
import { Dt as platform, Et as useAnchorPositioning, Tt as getDisabledMountTransitionStyles, wt as usePositioner } from "./router-DcWe0J7Y.js";
|
|
7
8
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
|
|
8
9
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
9
10
|
/**
|
|
@@ -1607,4 +1608,4 @@ function SelectItem({ className, children, ...props }) {
|
|
|
1607
1608
|
})]
|
|
1608
1609
|
});
|
|
1609
1610
|
}
|
|
1610
|
-
export { Select as a, SelectTrigger as c,
|
|
1611
|
+
export { useTypeahead as C, isMouseWithinBounds as S, SelectPortal as _, Select as a, SelectRoot as b, SelectTrigger as c, SelectItemText as d, SelectItemIndicator as f, SelectPositioner as g, SelectPopup as h, POPUP as i, SelectValue as l, SelectItem$1 as m, ITEM as n, SelectContent as o, ItemIndicator as p, ITEM_CHECK as r, SelectItem as s, CHEVRON as t, TRIGGER as u, SelectIcon as v, resolveAriaLabelledBy as x, SelectTrigger$1 as y };
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
|
|
2
|
-
import { n as healthNote } from "./model-PyPALjii.js";
|
|
3
2
|
import { n as createServerFn } from "../server.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { n as healthNote } from "./model-PyPALjii.js";
|
|
4
|
+
import { E as COMPANION_PARAM, N as companionDigest, j as STUDIO_MODE_PARAM } from "./studio-qzH-UETC.js";
|
|
5
|
+
import { o as validateStudioSearch } from "./search-bltT7gwy.js";
|
|
6
6
|
// src/server/shell.ts?tss-serverfn-split
|
|
7
|
+
function withRealPath(companion, realPath) {
|
|
8
|
+
return realPath === companion.path ? companion : {
|
|
9
|
+
...companion,
|
|
10
|
+
realPath
|
|
11
|
+
};
|
|
12
|
+
}
|
|
7
13
|
/** `refresh` collects the companion again; every other call reads the held snapshot. */
|
|
8
14
|
var getShell_createServerFn_handler = createServerRpc({
|
|
9
15
|
id: "b4cd58adfccec803b6c97478c78656e3acf554351ec97ef0ce550a10e235ebce",
|
|
@@ -29,9 +35,11 @@ var getShell = createServerFn({ method: "GET" }).validator((input) => ({
|
|
|
29
35
|
...context.studio.keepsFolder(companion.path) ? { keepsFolder: true } : {}
|
|
30
36
|
}));
|
|
31
37
|
const payload = page.payload;
|
|
38
|
+
const selected = page.companion ? companions.find((entry) => entry.path === page.companion.path) ?? null : null;
|
|
39
|
+
const chat = context.studio.modePolicy.chat;
|
|
32
40
|
return {
|
|
33
41
|
companions,
|
|
34
|
-
selected:
|
|
42
|
+
selected: selected && chat ? withRealPath(selected, context.studio.physicalPath(selected.path)) : selected,
|
|
35
43
|
studioMode: page.selection.studioMode,
|
|
36
44
|
enabledModes: [...context.studio.modePolicy.enabled],
|
|
37
45
|
profile: context.studio.modePolicy.profile,
|
|
@@ -42,6 +50,7 @@ var getShell = createServerFn({ method: "GET" }).validator((input) => ({
|
|
|
42
50
|
specs: payload.specs.length
|
|
43
51
|
} : null,
|
|
44
52
|
writable: page.writable,
|
|
53
|
+
chat,
|
|
45
54
|
addsCompanions: context.studio.addsCompanions(),
|
|
46
55
|
pluginViews: context.studio.services().flatMap((service) => service.views.flatMap((view) => view.moduleUrl ? [{
|
|
47
56
|
service: service.id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
|
|
2
2
|
import { n as createServerFn } from "../server.js";
|
|
3
|
-
import {
|
|
3
|
+
import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
|
|
4
4
|
// src/server/skills.ts?tss-serverfn-split
|
|
5
5
|
var AGENTS = /* @__PURE__ */ new Set([
|
|
6
6
|
"claude",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { t as CompanionView } from "./companion-view-
|
|
1
|
+
import { t as CompanionView } from "./companion-view-DIQ6AFIY.js";
|
|
2
2
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as cn } from "./cn-
|
|
5
|
-
import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-
|
|
6
|
-
import { i as workflowPlan } from "./steps-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
3
|
+
import { ct as ROW, et as CommandLine, it as PAGE_PAD, nt as EmptyNote, ot as Pills, r as Icon, rt as ListCard } from "./button-BqA1urbl.js";
|
|
4
|
+
import { t as cn } from "./cn-B0fl6NWK.js";
|
|
5
|
+
import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-D1K6Bsux.js";
|
|
6
|
+
import { i as workflowPlan } from "./steps-BWFSO6dM.js";
|
|
7
|
+
import { K as keepPreviousData, f as skillPreviewQuery } from "./studio-queries-ur1ygXi3.js";
|
|
8
|
+
import { Rt as useQuery, u as Route } from "./router-DcWe0J7Y.js";
|
|
9
|
+
import { t as MarkdownView } from "./markdown-view-CvVBGMZV.js";
|
|
10
10
|
// src/views/skills/skill-files.tsx
|
|
11
11
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
12
12
|
var import_jsx_runtime = require_jsx_runtime();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./studio-
|
|
2
|
-
import { t as CompanionView } from "./companion-view-
|
|
3
|
-
import { n as Specs } from "./specs-view-
|
|
4
|
-
import { n as findAction } from "./actions-
|
|
5
|
-
import {
|
|
1
|
+
import "./studio-qzH-UETC.js";
|
|
2
|
+
import { t as CompanionView } from "./companion-view-DIQ6AFIY.js";
|
|
3
|
+
import { n as Specs } from "./specs-view-DtL5JxYM.js";
|
|
4
|
+
import { n as findAction } from "./actions-CHEFA1i9.js";
|
|
5
|
+
import { l as Route } from "./router-DcWe0J7Y.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
7
7
|
// src/lib/spec-offers.ts
|
|
8
8
|
/** Spec offers as the view renders them: prompts rebuilt from core's action list. */
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import {
|
|
7
|
-
import { t as Input } from "./fields-
|
|
8
|
-
import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-
|
|
9
|
-
import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as
|
|
2
|
+
import { h as vaultQuery, ut as Link } from "./studio-queries-ur1ygXi3.js";
|
|
3
|
+
import "./studio-qzH-UETC.js";
|
|
4
|
+
import { t as cn } from "./cn-B0fl6NWK.js";
|
|
5
|
+
import { t as SUBJECT_PATTERN } from "./actions-CHEFA1i9.js";
|
|
6
|
+
import { ct as ROW, it as PAGE_PAD, lt as StatusWord, nt as EmptyNote, r as Icon, rt as ListCard } from "./button-BqA1urbl.js";
|
|
7
|
+
import { t as Input } from "./fields-BMap2_Ju.js";
|
|
8
|
+
import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-CZvHgGCi.js";
|
|
9
|
+
import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-iTjvPCtS.js";
|
|
10
|
+
import { Rt as useQuery } from "./router-DcWe0J7Y.js";
|
|
11
|
+
import { t as MarkdownView } from "./markdown-view-CvVBGMZV.js";
|
|
12
|
+
import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-D1K6Bsux.js";
|
|
13
|
+
import { t as Warnings } from "./warnings-DtUVPV-k.js";
|
|
13
14
|
// ../mate-core/src/cli/commands/studio/graph-model.ts
|
|
14
15
|
/** Edge kinds by wire code: an edge's kind is its index here. */
|
|
15
16
|
var GRAPH_EDGE_KINDS = [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { D as IDEA_PLACEHOLDER, d as canonicalSchema, f as deliveryPath, g as defaultWorkflow, h as WORKFLOW_FILE, l as SCHEMA_ARTIFACTS, m as BUILTIN_ARTIFACT_TYPE, p as isMateSchema, u as SHIPPED_SCHEMAS, w as CHANGE_PLACEHOLDER } from "./studio-qzH-UETC.js";
|
|
2
2
|
// src/views/workflow/steps.ts
|
|
3
3
|
var DEFAULT_WORKFLOW = defaultWorkflow();
|
|
4
4
|
/** The graph node of a review stage: `reviews` for the default one. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Mr as EMPTY_OBJECT, i as FloatingRootStore } from "./button-BqA1urbl.js";
|
|
2
2
|
// ../../node_modules/.bun/@base-ui+react@1.9.0+9e489665888c9e4a/node_modules/@base-ui/react/utils/popups/store.mjs
|
|
3
3
|
/**
|
|
4
4
|
* State common to all popup stores.
|
|
@@ -2,10 +2,11 @@ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./js
|
|
|
2
2
|
import { C as rootRouteId, S as trimPathRight, _ as invariant, a as useRouter, b as removeTrailingSlash, x as trimPathLeft, y as cleanPath } from "./useSelector-DUmCUXAs.js";
|
|
3
3
|
import { r as redirect } from "./redirect-BaZ_QyqF.js";
|
|
4
4
|
import { a as deepEqual, c as functionalUpdate$1, f as isDangerousProtocol, l as getUrlScheme, p as isModuleNotFoundError } from "./utils-C9CX1kcy.js";
|
|
5
|
-
import { i as reactUse, n as useMatch, t as getServerFnById } from "./__23tanstack-start-server-fn-resolver-
|
|
5
|
+
import { i as reactUse, n as useMatch, t as getServerFnById } from "./__23tanstack-start-server-fn-resolver-Bli9bpSB.js";
|
|
6
6
|
import { n as createServerFn, r as TSS_SERVER_FUNCTION } from "../server.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { T as COMPANION_DIGEST_PATTERN } from "./studio-qzH-UETC.js";
|
|
8
|
+
import { t as WORK_REQUEST_ACTIONS } from "./work-requests-BLhOmQFO.js";
|
|
9
|
+
import { o as validateStudioSearch } from "./search-bltT7gwy.js";
|
|
9
10
|
import { n as unpackGraph } from "./graph-wire-BdSUx0G5.js";
|
|
10
11
|
// ../../node_modules/.bun/@tanstack+router-core@1.171.39/node_modules/@tanstack/router-core/dist/esm/route.js
|
|
11
12
|
var BaseRoute = class {
|
|
@@ -1071,6 +1072,15 @@ var REPORT_VIEW_PREFIX = "/studio/reports/";
|
|
|
1071
1072
|
var SERVICE_ROUTE_PREFIX = "/api/plugins/";
|
|
1072
1073
|
/** Answers 204 to any reader; the page probes its connection here. */
|
|
1073
1074
|
var STUDIO_PING_ROUTE = "/api/ping";
|
|
1075
|
+
/**
|
|
1076
|
+
* The Analysis chat: `POST {companion, messages}` streams one read-only agent turn as an
|
|
1077
|
+
* AI SDK UI message stream. Only on a localhost-only Studio, or in the appliance.
|
|
1078
|
+
*/
|
|
1079
|
+
var CHAT_ROUTE = "/api/chat";
|
|
1080
|
+
/** `GET` with the selected companion: what a chat turn for it can use; starts no agent. */
|
|
1081
|
+
var CHAT_SESSION_ROUTE = "/api/chat/session";
|
|
1082
|
+
/** `GET` which credential answers chat turns (never its value); `PUT {kind, value}` sets one in Studio; `DELETE` clears it. */
|
|
1083
|
+
var CHAT_CREDENTIAL_ROUTE = "/api/chat/credential";
|
|
1074
1084
|
/** One event stream per page: board, reports and markdown tree changes for a companion. */
|
|
1075
1085
|
var STUDIO_EVENTS_ROUTE = "/api/events";
|
|
1076
1086
|
/** The terminal's WASM core, loaded by Studio's bundled terminal from Studio itself. */
|
|
@@ -1181,17 +1191,17 @@ function companionOf(input) {
|
|
|
1181
1191
|
if (typeof input?.companion !== "string" || !COMPANION_DIGEST_PATTERN.test(input.companion)) throw new Error("no registered companion was selected");
|
|
1182
1192
|
return input.companion;
|
|
1183
1193
|
}
|
|
1184
|
-
var text = (value) => typeof value === "string" && value.length > 0 && value.length <= 4096 ? value : void 0;
|
|
1194
|
+
var text$1 = (value) => typeof value === "string" && value.length > 0 && value.length <= 4096 ? value : void 0;
|
|
1185
1195
|
/** The vault page; core resolves every path against the selected companion. */
|
|
1186
1196
|
var getVault = createServerFn({ method: "GET" }).validator((input) => ({
|
|
1187
1197
|
companion: companionOf(input),
|
|
1188
|
-
path: text(input.path),
|
|
1189
|
-
dir: text(input.dir),
|
|
1198
|
+
path: text$1(input.path),
|
|
1199
|
+
dir: text$1(input.dir),
|
|
1190
1200
|
refresh: input.refresh === true,
|
|
1191
1201
|
wait: input.wait === true
|
|
1192
1202
|
})).handler(createSsrRpc("cc0685774bfb5205a762c25bdd4b959c1f541584df4b67aac816fe529fa37c87"));
|
|
1193
1203
|
var getVaultChildren = createServerFn({ method: "GET" }).validator((input) => {
|
|
1194
|
-
const dir = text(input.dir);
|
|
1204
|
+
const dir = text$1(input.dir);
|
|
1195
1205
|
if (!dir) throw new Error("the request names no folder");
|
|
1196
1206
|
return {
|
|
1197
1207
|
companion: companionOf(input),
|
|
@@ -1204,7 +1214,7 @@ var getVaultMatches = createServerFn({ method: "GET" }).validator((input) => ({
|
|
|
1204
1214
|
})).handler(createSsrRpc("99f4d57911b5959a331ed18424ab13369de22f8b2b142a146ea967742dfbc997"));
|
|
1205
1215
|
/** Unsaved editor text rendered as a saved file would be; nothing is read or written. */
|
|
1206
1216
|
var previewVaultFile = createServerFn({ method: "POST" }).validator((input) => {
|
|
1207
|
-
const path = text(input.path);
|
|
1217
|
+
const path = text$1(input.path);
|
|
1208
1218
|
if (!path) throw new Error("the preview names no file");
|
|
1209
1219
|
if (typeof input.content !== "string" || input.content.length > MAX_CONTENT) throw new Error("preview requires content within the size limit");
|
|
1210
1220
|
return {
|
|
@@ -1215,16 +1225,101 @@ var previewVaultFile = createServerFn({ method: "POST" }).validator((input) => {
|
|
|
1215
1225
|
}).handler(createSsrRpc("c9e07976b298f1d1353d3422b03638f260b66975d28a1c8b07919923be8c488d"));
|
|
1216
1226
|
/** A save; a stale token comes back as a conflict carrying the current content and token. */
|
|
1217
1227
|
var saveVaultFile = createServerFn({ method: "POST" }).validator((input) => {
|
|
1218
|
-
const path = text(input.path);
|
|
1228
|
+
const path = text$1(input.path);
|
|
1219
1229
|
if (!path) throw new Error("save requires a path");
|
|
1220
1230
|
if (typeof input.content !== "string" || input.content.length > MAX_CONTENT) throw new Error("save requires content within the size limit");
|
|
1221
1231
|
return {
|
|
1222
1232
|
companion: companionOf(input),
|
|
1223
1233
|
path,
|
|
1224
1234
|
content: input.content,
|
|
1225
|
-
token: text(input.token)
|
|
1235
|
+
token: text$1(input.token)
|
|
1226
1236
|
};
|
|
1227
1237
|
}).handler(createSsrRpc("63d1e2171062e2d082e16522c162963c4da2a71c447f69f0937bd6e5e10b73ba"));
|
|
1238
|
+
// src/server/work.ts
|
|
1239
|
+
var MAX_TEXT = 65536;
|
|
1240
|
+
var MAX_NAME = 128;
|
|
1241
|
+
var MAX_LIST = 64;
|
|
1242
|
+
var NAME = /^[a-z0-9][a-z0-9-]{0,127}$/;
|
|
1243
|
+
var KEY = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/;
|
|
1244
|
+
function fail(reason) {
|
|
1245
|
+
throw new Error(reason);
|
|
1246
|
+
}
|
|
1247
|
+
function text(value, field, max = MAX_TEXT) {
|
|
1248
|
+
if (typeof value !== "string" || value.length > max) fail(`${field} is missing or too long`);
|
|
1249
|
+
return value;
|
|
1250
|
+
}
|
|
1251
|
+
function optionalText(value, field, max = MAX_NAME) {
|
|
1252
|
+
return value === void 0 || value === "" ? void 0 : text(value, field, max);
|
|
1253
|
+
}
|
|
1254
|
+
function name(value, field) {
|
|
1255
|
+
const candidate = text(value, field, MAX_NAME);
|
|
1256
|
+
if (!NAME.test(candidate)) fail(`${field} is not a valid name`);
|
|
1257
|
+
return candidate;
|
|
1258
|
+
}
|
|
1259
|
+
function names(value, field) {
|
|
1260
|
+
if (value === void 0) return [];
|
|
1261
|
+
if (!Array.isArray(value) || value.length > MAX_LIST) fail(`${field} must be a short list`);
|
|
1262
|
+
return value.map((entry) => name(entry, field));
|
|
1263
|
+
}
|
|
1264
|
+
function key(value) {
|
|
1265
|
+
const candidate = text(value, "key", MAX_NAME);
|
|
1266
|
+
if (!KEY.test(candidate)) fail("key is not valid");
|
|
1267
|
+
return candidate;
|
|
1268
|
+
}
|
|
1269
|
+
function validateWorkAction(input) {
|
|
1270
|
+
if (typeof input?.companion !== "string" || !COMPANION_DIGEST_PATTERN.test(input.companion)) fail("no registered companion was selected");
|
|
1271
|
+
const raw = input.request ?? {};
|
|
1272
|
+
const action = raw.action;
|
|
1273
|
+
if (!WORK_REQUEST_ACTIONS.includes(action)) fail(`unknown Work action ${JSON.stringify(action)}`);
|
|
1274
|
+
const request = (() => {
|
|
1275
|
+
switch (action) {
|
|
1276
|
+
case "capture": {
|
|
1277
|
+
const repository = optionalText(raw.repository, "repository");
|
|
1278
|
+
const ticket = optionalText(raw.ticket, "ticket");
|
|
1279
|
+
return {
|
|
1280
|
+
action: "capture",
|
|
1281
|
+
text: text(raw.text, "text"),
|
|
1282
|
+
...repository ? { repository } : {},
|
|
1283
|
+
...ticket ? { ticket } : {}
|
|
1284
|
+
};
|
|
1285
|
+
}
|
|
1286
|
+
case "refresh": return { action: "refresh" };
|
|
1287
|
+
case "share-preview": return {
|
|
1288
|
+
action: "share-preview",
|
|
1289
|
+
workset: name(raw.workset, "workset"),
|
|
1290
|
+
include: names(raw.include, "include")
|
|
1291
|
+
};
|
|
1292
|
+
case "share": return {
|
|
1293
|
+
action: "share",
|
|
1294
|
+
workset: name(raw.workset, "workset"),
|
|
1295
|
+
hash: text(raw.hash, "hash", 128),
|
|
1296
|
+
include: names(raw.include, "include"),
|
|
1297
|
+
key: key(raw.key)
|
|
1298
|
+
};
|
|
1299
|
+
case "claim":
|
|
1300
|
+
case "release": return {
|
|
1301
|
+
action,
|
|
1302
|
+
workset: name(raw.workset, "workset"),
|
|
1303
|
+
members: names(raw.members, "members"),
|
|
1304
|
+
key: key(raw.key)
|
|
1305
|
+
};
|
|
1306
|
+
case "start-manual": return {
|
|
1307
|
+
action: "start-manual",
|
|
1308
|
+
workset: name(raw.workset, "workset"),
|
|
1309
|
+
members: names(raw.members, "members")
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
})();
|
|
1313
|
+
return {
|
|
1314
|
+
companion: input.companion,
|
|
1315
|
+
request
|
|
1316
|
+
};
|
|
1317
|
+
}
|
|
1318
|
+
var runWorkAction = createServerFn({ method: "POST" }).validator(validateWorkAction).handler(createSsrRpc("2f3eced1468babf8294739be48f34818b4189b771668c04e754eb22128ea7716"));
|
|
1319
|
+
var getWork = createServerFn({ method: "GET" }).validator((input) => {
|
|
1320
|
+
if (!COMPANION_DIGEST_PATTERN.test(input?.companion ?? "")) throw new Error("no registered companion was selected");
|
|
1321
|
+
return { companion: input.companion };
|
|
1322
|
+
}).handler(createSsrRpc("1dab3c85a3251673fabaefdaf700b9bf8dd0f97f4fa9676bfcd8cca6563a44a8"));
|
|
1228
1323
|
// src/server/views.ts
|
|
1229
1324
|
var VIEWS = /* @__PURE__ */ new Set([
|
|
1230
1325
|
"dashboard",
|
|
@@ -1251,6 +1346,7 @@ var keys = {
|
|
|
1251
1346
|
shell: (companion) => [companion, "shell"],
|
|
1252
1347
|
views: (companion) => [companion, "view"],
|
|
1253
1348
|
skills: (companion) => [companion, "skills"],
|
|
1349
|
+
work: (companion) => [companion, "work"],
|
|
1254
1350
|
vault: (companion) => [companion, "vault"],
|
|
1255
1351
|
vaultViews: (companion) => [
|
|
1256
1352
|
companion,
|
|
@@ -1321,6 +1417,11 @@ var pluginAttentionQuery = (companion, url) => queryOptions({
|
|
|
1321
1417
|
},
|
|
1322
1418
|
refetchInterval: 3e4
|
|
1323
1419
|
});
|
|
1420
|
+
var workQuery = (companion) => queryOptions({
|
|
1421
|
+
queryKey: keys.work(companion),
|
|
1422
|
+
queryFn: () => getWork({ data: { companion } }),
|
|
1423
|
+
refetchInterval: 3e4
|
|
1424
|
+
});
|
|
1324
1425
|
var vaultQuery = (companion, search, wait = false) => queryOptions({
|
|
1325
1426
|
queryKey: [
|
|
1326
1427
|
...keys.vaultViews(companion),
|
|
@@ -1373,9 +1474,12 @@ async function stale(queryClient, ...queryKeys) {
|
|
|
1373
1474
|
}
|
|
1374
1475
|
/** After a server event for `companion`; views refetch in place (design D7). */
|
|
1375
1476
|
async function afterEvent(queryClient, companion, type) {
|
|
1376
|
-
if (type === "board")
|
|
1377
|
-
|
|
1477
|
+
if (type === "board") {
|
|
1478
|
+
await stale(queryClient, keys.work(companion));
|
|
1479
|
+
await stale(queryClient, keys.shell(companion), keys.views(companion));
|
|
1480
|
+
} else if (type === "reports") await stale(queryClient, keys.reports(companion));
|
|
1378
1481
|
}
|
|
1482
|
+
var afterWorkAction = (queryClient, companion) => stale(queryClient, keys.work(companion), keys.views(companion));
|
|
1379
1483
|
/** The refresh answer is shown at once; the companion's other vault reads follow. */
|
|
1380
1484
|
function afterVaultRefresh(queryClient, companion, search, fresh) {
|
|
1381
1485
|
const shown = vaultQuery(companion, search).queryKey;
|
|
@@ -1390,4 +1494,4 @@ function afterVaultRefresh(queryClient, companion, search, fresh) {
|
|
|
1390
1494
|
var afterVaultFileChange = (queryClient, companion) => stale(queryClient, keys.vaultViews(companion));
|
|
1391
1495
|
/** After Refresh collected `companion` again; other companions keep what they hold. */
|
|
1392
1496
|
var afterRefresh = (queryClient, companion) => stale(queryClient, keys.companion(companion ?? null));
|
|
1393
|
-
export {
|
|
1497
|
+
export { resolveQueryValue as $, STUDIO_EVENTS_ROUTE as A, fetchSignal as B, studioFetch as C, CHAT_SESSION_ROUTE as D, CHAT_ROUTE as E, queryOptions as F, isValidTimeout as G, hashKey as H, addConsumeAwareSignal as I, matchQuery as J, keepPreviousData as K, addToEnd as L, TERMINAL_SESSIONS_ROUTE as M, TERMINAL_SOCKET_ROUTE as N, REPORT_VIEW_PREFIX as O, TERMINAL_WASM as P, replaceEqualDeep as Q, addToStart as R, createSsrRpc as S, CHAT_CREDENTIAL_ROUTE as T, hashQueryKeyByOptions as U, functionalUpdate as V, isServer as W, partialMatchKey as X, noop as Y, replaceData as Z, runWorkAction as _, afterWorkAction as a, systemSetTimeoutZero as at, saveVaultFile as b, holdShellForMode as c, createFileRoute as ct, shellQuery as d, useNavigate as dt, shallowEqualObjects as et, skillPreviewQuery as f, useParams as ft, workQuery as g, vaultQuery as h, afterVaultRefresh as i, timeUntilStale as it, TERMINAL_SESSIONS_END_ROUTE as j, SERVICE_ROUTE_PREFIX as k, pluginAttentionQuery as l, createRootRouteWithContext as lt, vaultMatchesQuery as m, afterRefresh as n, skipToken as nt, companionViewQuery as o, timeoutManager as ot, vaultChildrenQuery as p, matchMutation as q, afterVaultFileChange as r, sleep as rt, graphQuery as s, lazyRouteComponent as st, afterEvent as t, shouldThrowError as tt, reportsQuery as u, Link as ut, getVault as v, probeStudio as w, getShell as x, previewVaultFile as y, ensureQueryFn as z };
|