@uniqbit/mate-core 1.0.0-canary.0 → 1.0.0-canary.2
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/marketplace.json +14 -0
- package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +8 -0
- package/claude-capability-plugins/companion-mentions/hooks/companion.ts +457 -0
- package/claude-capability-plugins/companion-mentions/hooks/hooks.json +1 -0
- package/claude-capability-plugins/companion-mentions/hooks/register.ts +403 -0
- package/claude-plugin/hooks/hooks.json +10 -1
- package/claude-plugin/hooks/tokensave-route.mjs +52 -0
- package/opencode-plugin/src/server.ts +4 -0
- package/opencode-plugin/src/tui.tsx +2 -0
- package/opencode-plugin/tui.tsx +2 -0
- package/package.json +45 -16
- package/src/brand/terminal.ts +5 -0
- package/src/cli/commands/artifact/apply-context.ts +275 -0
- package/src/cli/commands/artifact/artifact.ts +4 -0
- package/src/cli/commands/artifact/delivery/archive.ts +13 -5
- package/src/cli/commands/artifact/delivery/environment.ts +36 -13
- package/src/cli/commands/artifact/delivery/link.ts +35 -15
- package/src/cli/commands/artifact/delivery/output.ts +31 -0
- package/src/cli/commands/artifact/finish/command.ts +50 -5
- package/src/cli/commands/artifact/finish/engine.ts +44 -11
- package/src/cli/commands/artifact/finish/git.ts +132 -19
- package/src/cli/commands/artifact/finish/openspec.ts +6 -1
- package/src/cli/commands/artifact/finish/worktree-cleanup.ts +92 -0
- package/src/cli/commands/cap/index-cmd.ts +64 -15
- package/src/cli/commands/cap/tokensave.ts +7 -5
- package/src/cli/commands/companion/link.ts +14 -1
- package/src/cli/commands/companion/open.ts +16 -11
- package/src/cli/commands/companion/sync.ts +10 -0
- package/src/cli/commands/companion/tui.ts +17 -7
- package/src/cli/commands/companion/update.ts +74 -12
- package/src/cli/commands/doctor.ts +20 -5
- package/src/cli/commands/factory/factory.ts +301 -0
- package/src/cli/commands/install.ts +133 -9
- package/src/cli/commands/launch/shared.ts +16 -11
- package/src/cli/commands/report/index.ts +20 -1
- package/src/cli/commands/session/context.ts +102 -0
- package/src/cli/commands/setup.ts +44 -10
- package/src/cli/commands/studio/factory-credential.ts +49 -0
- package/src/cli/commands/studio/index.ts +29 -2
- package/src/cli/commands/studio/payload.ts +249 -15
- package/src/cli/commands/studio/routes.ts +41 -8
- package/src/cli/commands/studio/selection.ts +142 -16
- package/src/cli/commands/studio/server.ts +403 -364
- package/src/cli/commands/studio/services.ts +60 -0
- package/src/cli/commands/studio/studio-app.ts +67 -0
- package/src/cli/commands/studio/terminal-assets.ts +21 -33
- package/src/cli/commands/studio/terminal.ts +85 -15
- package/src/cli/commands/studio/views/model.ts +18 -0
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +267 -0
- package/src/cli/commands/studio/views/vault/view.ts +185 -0
- package/src/cli/commands/studio/workset-session.ts +131 -0
- package/src/cli/commands/unwrap.ts +8 -0
- package/src/cli/commands/update.ts +27 -1
- package/src/cli/commands/working/cleanup.ts +10 -1
- package/src/cli/commands/working/link.ts +76 -0
- package/src/cli/commands/working/working.ts +10 -0
- package/src/cli/commands/working/worktree.ts +356 -0
- package/src/cli/companion-link-wizard.tsx +2 -0
- package/src/cli/companion-selector.tsx +2 -0
- package/src/cli/confirm.ts +2 -0
- package/src/cli/install-plan.tsx +127 -160
- package/src/cli/launch-selector.tsx +2 -0
- package/src/cli/main.ts +18 -0
- package/src/cli/parse-flags.ts +9 -1
- package/src/cli/repo-list-table.tsx +2 -0
- package/src/cli/setup-selector.tsx +79 -20
- package/src/cli/usage.ts +11 -1
- package/src/create-mate.ts +5 -4
- package/src/hooks/tokensave-route.ts +26 -0
- package/src/lib/apply-context/fingerprint.ts +174 -0
- package/src/lib/apply-context/protocol.ts +193 -0
- package/src/lib/components/confirm-prompt.tsx +21 -9
- package/src/lib/components/select-menu.tsx +10 -3
- package/src/lib/components/spinner.tsx +4 -2
- package/src/lib/components/startup-progress.tsx +227 -41
- package/src/lib/components/text-input-display.tsx +2 -0
- package/src/lib/components/wizard-footer.tsx +2 -0
- package/src/lib/components/wizard-header.tsx +13 -11
- package/src/lib/delivery/archive-change.ts +14 -2
- package/src/lib/delivery/branches.ts +29 -5
- package/src/lib/delivery/environment.ts +7 -1
- package/src/lib/delivery/forge.ts +2 -2
- package/src/lib/delivery/merge-git.ts +261 -0
- package/src/lib/delivery/overlap.ts +11 -4
- package/src/lib/delivery/record-delivery.ts +97 -10
- package/src/lib/delivery/record.ts +67 -7
- package/src/lib/delivery/refresh.ts +104 -10
- package/src/lib/delivery/repository-access.ts +46 -2
- package/src/lib/delivery/resolve-branch.ts +162 -0
- package/src/lib/delivery/token.ts +7 -41
- package/src/lib/factory/attach-client.ts +113 -0
- package/src/lib/factory/attach.ts +178 -0
- package/src/lib/factory/broker.ts +190 -0
- package/src/lib/factory/bun-commands.ts +39 -0
- package/src/lib/factory/client.ts +92 -0
- package/src/lib/factory/command.ts +61 -0
- package/src/lib/factory/credential-store.ts +153 -0
- package/src/lib/factory/frames.ts +77 -0
- package/src/lib/factory/ids.ts +58 -0
- package/src/lib/factory/keyed-serial.ts +27 -0
- package/src/lib/factory/outcomes/actions.ts +114 -0
- package/src/lib/factory/outcomes/index.ts +381 -0
- package/src/lib/factory/outcomes/lifecycle.ts +205 -0
- package/src/lib/factory/outcomes/runs.ts +81 -0
- package/src/lib/factory/outcomes/sessions.ts +38 -0
- package/src/lib/factory/prepare.ts +49 -0
- package/src/lib/factory/pty.ts +103 -0
- package/src/lib/factory/runner/companion-context.ts +178 -0
- package/src/lib/factory/runner/control.ts +92 -0
- package/src/lib/factory/runner/harness-agent.ts +250 -0
- package/src/lib/factory/runner/live.ts +159 -0
- package/src/lib/factory/runner/questions.ts +22 -0
- package/src/lib/factory/runner/rank.ts +26 -0
- package/src/lib/factory/runner/run-policy.ts +12 -0
- package/src/lib/factory/runner/run.ts +199 -0
- package/src/lib/factory/runner/scheduler.ts +416 -0
- package/src/lib/factory/runner/state.ts +233 -0
- package/src/lib/factory/runner/workflow.ts +542 -0
- package/src/lib/factory/runtime.ts +972 -0
- package/src/lib/factory/sandbox.ts +292 -0
- package/src/lib/factory/worktree-branch.ts +17 -0
- package/src/lib/install.ts +66 -14
- package/src/lib/live-progress.ts +36 -0
- package/src/lib/member-choices.ts +67 -0
- package/src/lib/orchestrator/adapters/base.ts +55 -22
- package/src/lib/orchestrator/adapters/claude.ts +6 -1
- package/src/lib/orchestrator/config-store.ts +3 -2
- package/src/lib/orchestrator/editor.ts +29 -23
- package/src/lib/orchestrator/projection-entries.ts +56 -21
- package/src/lib/orchestrator/projection-opencode-copies.ts +32 -15
- package/src/lib/orchestrator/projection-openspec-store.ts +54 -9
- package/src/lib/orchestrator/projection-types.ts +33 -1
- package/src/lib/orchestrator/session-context-link.ts +67 -0
- package/src/lib/orchestrator/setup-compatibilities.ts +55 -12
- package/src/lib/orchestrator/types.ts +5 -0
- package/src/lib/orchestrator/working-repo-projection.ts +50 -7
- package/src/lib/orchestrator/workspace-document.ts +105 -0
- package/src/lib/package-paths.ts +29 -0
- package/src/lib/runtime-directory-refresh.ts +17 -1
- package/src/lib/workset/record.ts +513 -0
- package/src/lib/workset/repositories.ts +55 -0
- package/src/lib/workset/stage.ts +148 -0
- package/src/lib/workset/stages.ts +113 -0
- package/src/lib/workset/worktree-index.ts +116 -0
- package/src/lib/workset/worktree.ts +830 -0
- package/src/opencode/companion-hooks.ts +45 -2
- package/src/opencode/enter-worktree.ts +72 -0
- package/src/opencode/tui.tsx +9 -4
- package/src/plugins.ts +1 -0
- package/src/runtime/claude-delivery-plan.ts +22 -5
- package/src/runtime/companion-git.ts +52 -10
- package/src/runtime/companion-guidance.ts +7 -7
- package/src/runtime/companion-lock.ts +30 -7
- package/src/runtime/env.ts +48 -3
- package/src/runtime/git-layout.ts +219 -0
- package/src/runtime/index.ts +24 -0
- package/src/runtime/physical-path.ts +111 -0
- package/src/runtime/policy.ts +36 -2
- package/src/runtime/runtime-directory.ts +5 -0
- package/src/runtime/secret-guard.ts +19 -5
- package/src/runtime/secret-patterns.ts +267 -34
- package/src/runtime/session-context.ts +98 -0
- package/src/runtime/tokensave-route.ts +152 -0
- package/src/runtime/wrap-state.ts +24 -16
- package/src/studio.ts +124 -0
- package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +10 -8
- package/src/templates/capabilities/openspec-cap/mate-v1/schema.yaml +16 -98
- package/src/templates/capabilities/openspec-cap/openspec-conventions.yaml +10 -2
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +76 -18
- package/src/templates/mate-skills/agents/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +2 -0
- package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +32 -5
- package/src/templates/mate-skills/agents/mate-backfill-spec/SKILL.md +8 -1
- package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +16 -1
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +22 -6
- package/src/templates/mate-skills/agents/mate-explore-change/references/openspec-explore.md +2 -0
- package/src/templates/mate-skills/agents/mate-grill-me/SKILL.md +8 -1
- package/src/templates/mate-skills/agents/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/agents/mate-interview-me/SKILL.md +7 -0
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +55 -50
- package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-propose.md +2 -0
- package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +2 -0
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +29 -10
- package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +4 -2
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +21 -0
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +13 -0
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +76 -18
- package/src/templates/mate-skills/claude/mate-apply-change/references/mate-compact-apply.md +47 -0
- package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +2 -0
- package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +32 -5
- package/src/templates/mate-skills/claude/mate-backfill-spec/SKILL.md +8 -1
- package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +16 -1
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +22 -6
- package/src/templates/mate-skills/claude/mate-explore-change/references/openspec-explore.md +2 -0
- package/src/templates/mate-skills/claude/mate-grill-me/SKILL.md +8 -1
- package/src/templates/mate-skills/claude/mate-grill-with-docs/SKILL.md +2 -2
- package/src/templates/mate-skills/claude/mate-interview-me/SKILL.md +7 -0
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +55 -50
- package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +47 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-propose.md +2 -0
- package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +2 -0
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +29 -10
- package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +4 -2
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +21 -0
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +13 -0
- package/src/templates/mate-skills/openspec-references.ts +2 -0
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +364 -224
- package/src/tools/setup/capabilities/companion-mentions.ts +27 -0
- package/src/tools/setup/capabilities/context-mode.ts +34 -5
- package/src/tools/setup/capabilities/graphify-secrets.ts +2 -14
- package/src/tools/setup/capabilities/graphify.ts +34 -7
- package/src/tools/setup/capabilities/openspec.ts +12 -2
- package/src/tools/setup/capabilities/react-doctor.ts +8 -1
- package/src/tools/setup/capabilities/rtk.ts +4 -0
- package/src/tools/setup/capabilities/tokensave.ts +77 -68
- package/src/tools/setup/engine.ts +3 -2
- package/src/tools/setup/install-contract.ts +8 -0
- package/src/tools/setup/mate-skill-copies.ts +51 -0
- package/src/tools/setup/package-managers/uv.ts +73 -11
- package/src/tools/setup/plugin.ts +5 -0
- package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
- package/src/tools/setup/providers/claude-worktree-plugins.ts +122 -0
- package/src/tools/setup/providers/claude.ts +11 -5
- package/src/tools/setup/utils.ts +4 -0
- package/src/tools/setup/working-repo-cleanup.ts +29 -1
- package/src/tools/setup/working-repo-local-state.ts +252 -75
- package/src/tools/setup.ts +57 -16
- package/studio-dist/client/assets/companion-view-Csva26Ir.js +1 -0
- package/studio-dist/client/assets/delivery-path-DJMpRmiY.js +1 -0
- package/studio-dist/client/assets/dist-Dm7MtyHc.js +5 -0
- package/studio-dist/client/assets/factory-B7l9ZQyx.js +4 -0
- package/studio-dist/client/assets/index-n6uo_92S.js +40 -0
- package/studio-dist/client/assets/preload-helper-BLdHbfdN.js +1 -0
- package/studio-dist/client/assets/prepaint-CD5OpmTM.js +24 -0
- package/studio-dist/client/assets/queries-CN3JwMBX.js +1 -0
- package/studio-dist/client/assets/react-CabXf2Ds.js +1 -0
- package/studio-dist/client/assets/report-time-Dc-KOqQu.js +1 -0
- package/studio-dist/client/assets/reports-C01RsnMA.js +1 -0
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +1 -0
- package/studio-dist/client/assets/routes-4pbC-2Hj.js +1 -0
- package/studio-dist/client/assets/skills-CihQganl.js +1 -0
- package/studio-dist/client/assets/spec-areas-C2L48N4C.js +1 -0
- package/studio-dist/client/assets/specs-D24_35_K.js +1 -0
- package/studio-dist/client/assets/studio-DKxfi691.css +1 -0
- package/studio-dist/client/assets/studio-queries-rvbJupCy.js +3 -0
- package/studio-dist/client/assets/terminal-eU5fzQzv.css +1 -0
- package/studio-dist/client/assets/vault-Bd4CQiTK.js +1 -0
- package/studio-dist/client/assets/warnings-V_Ys51wJ.js +1 -0
- package/studio-dist/client/assets/wasm-inline-C2en61B5.js +1 -0
- package/studio-dist/client/assets/workflow-BJejeVwQ.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-BQKuMdJW.js +3881 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +85 -0
- package/studio-dist/server/assets/actions-Bvgj9eb8.js +54 -0
- package/studio-dist/server/assets/actions-D8erOphH.js +44 -0
- package/studio-dist/server/assets/companion-view-aBady57v.js +33 -0
- package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +459 -0
- package/studio-dist/server/assets/createServerRpc-tK2lE9R2.js +11 -0
- package/studio-dist/server/assets/delivery-path-BkKNjgkf.js +778 -0
- package/studio-dist/server/assets/dist-DpJWKyCm.js +5582 -0
- package/studio-dist/server/assets/empty-plugin-adapters-Cipd4ZH4.js +4 -0
- package/studio-dist/server/assets/factory-D6xnjedJ.js +2385 -0
- package/studio-dist/server/assets/factory-DT3UzHlh.js +68 -0
- package/studio-dist/server/assets/model-PyPALjii.js +18 -0
- package/studio-dist/server/assets/prepaint-BMke0fo1.js +41 -0
- package/studio-dist/server/assets/queries-Ag2iL8q2.js +107 -0
- package/studio-dist/server/assets/react-COs0LHn-.js +51 -0
- package/studio-dist/server/assets/report-time-DAfzln-N.js +8 -0
- package/studio-dist/server/assets/reports-BnUNJVtx.js +126 -0
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +34 -0
- package/studio-dist/server/assets/router-BH--drIx.js +4298 -0
- package/studio-dist/server/assets/routes-khSDK1bV.js +361 -0
- package/studio-dist/server/assets/search-JAKurDNh.js +36 -0
- package/studio-dist/server/assets/shell-CboT2f66.js +51 -0
- package/studio-dist/server/assets/skills-MWYnWoKs.js +106 -0
- package/studio-dist/server/assets/spec-areas-DcnO6vW-.js +16 -0
- package/studio-dist/server/assets/specs-DE3w8hZP.js +155 -0
- package/studio-dist/server/assets/start-BW5ovN0k.js +33 -0
- package/studio-dist/server/assets/studio-BeltxxKt.js +216 -0
- package/studio-dist/server/assets/studio-queries-CLnP9kGu.js +3365 -0
- package/studio-dist/server/assets/utils-C9CX1kcy.js +221 -0
- package/studio-dist/server/assets/vault-BGulVoNh.js +70 -0
- package/studio-dist/server/assets/vault-CuyyhLyB.js +832 -0
- package/studio-dist/server/assets/views-Bd7cRr27.js +82 -0
- package/studio-dist/server/assets/warnings-BH05rOuG.js +15 -0
- package/studio-dist/server/assets/wasm-inline-CNeBKGwC.js +3 -0
- package/studio-dist/server/assets/workflow-BSuIKWqH.js +42 -0
- package/studio-dist/server/server.js +16220 -0
- package/src/cli/commands/studio/client-asset.ts +0 -16
- package/src/cli/commands/studio/views/client.ts +0 -44
- package/src/cli/commands/studio/views/companion-picker.tsx +0 -95
- package/src/cli/commands/studio/views/companion-selector.tsx +0 -94
- package/src/cli/commands/studio/views/dashboard/changes.tsx +0 -102
- package/src/cli/commands/studio/views/dashboard/index.tsx +0 -19
- package/src/cli/commands/studio/views/document.tsx +0 -910
- package/src/cli/commands/studio/views/error.tsx +0 -20
- package/src/cli/commands/studio/views/markdown.tsx +0 -250
- package/src/cli/commands/studio/views/palette.ts +0 -134
- package/src/cli/commands/studio/views/reports/index.tsx +0 -44
- package/src/cli/commands/studio/views/selection-fields.tsx +0 -14
- package/src/cli/commands/studio/views/skills/index.tsx +0 -68
- package/src/cli/commands/studio/views/specs/index.tsx +0 -149
- package/src/cli/commands/studio/views/studio-client/actions.ts +0 -51
- package/src/cli/commands/studio/views/studio-client/companion.ts +0 -13
- package/src/cli/commands/studio/views/studio-client/index.ts +0 -32
- package/src/cli/commands/studio/views/studio-client/keys.ts +0 -3
- package/src/cli/commands/studio/views/studio-client/main.ts +0 -3
- package/src/cli/commands/studio/views/studio-client/page.ts +0 -146
- package/src/cli/commands/studio/views/studio-client/panels.ts +0 -57
- package/src/cli/commands/studio/views/studio-client/reports.ts +0 -122
- package/src/cli/commands/studio/views/studio-client/theme.ts +0 -63
- package/src/cli/commands/studio/views/studio-client/vault-editor.ts +0 -166
- package/src/cli/commands/studio/views/studio-client/vault-pane.ts +0 -202
- package/src/cli/commands/studio/views/studio-client/vault-tree.ts +0 -258
- package/src/cli/commands/studio/views/studio-client.generated.ts +0 -2
- package/src/cli/commands/studio/views/styles.ts +0 -530
- package/src/cli/commands/studio/views/terminal.tsx +0 -484
- package/src/cli/commands/studio/views/vault/state.ts +0 -41
- package/src/cli/commands/studio/views/warnings.tsx +0 -21
- package/src/cli/commands/studio/views/workflow/delivery-path.tsx +0 -370
- package/src/cli/commands/studio/views/workflow/graph.ts +0 -220
- package/src/cli/commands/studio/views/workflow/index.tsx +0 -20
- package/src/cli/commands/studio/views/workflow/steps.ts +0 -278
- package/src/lib/components/theme.ts +0 -2
- package/src/tools/setup/git-utils.ts +0 -30
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// \0tanstack-start-manifest:v
|
|
2
|
+
var tsrStartManifest = () => ({ routes: {
|
|
3
|
+
__root__: {
|
|
4
|
+
filePath: "src/routes/__root.tsx",
|
|
5
|
+
children: [
|
|
6
|
+
"/",
|
|
7
|
+
"/factory",
|
|
8
|
+
"/reports",
|
|
9
|
+
"/skills",
|
|
10
|
+
"/specs",
|
|
11
|
+
"/vault",
|
|
12
|
+
"/workflow"
|
|
13
|
+
],
|
|
14
|
+
preloads: [
|
|
15
|
+
"/assets/index-n6uo_92S.js",
|
|
16
|
+
"/assets/rolldown-runtime-WkwZ5CU-.js",
|
|
17
|
+
"/assets/studio-queries-rvbJupCy.js",
|
|
18
|
+
"/assets/prepaint-CD5OpmTM.js",
|
|
19
|
+
"/assets/queries-CN3JwMBX.js",
|
|
20
|
+
"/assets/react-CabXf2Ds.js",
|
|
21
|
+
"/assets/preload-helper-BLdHbfdN.js"
|
|
22
|
+
],
|
|
23
|
+
scripts: [{ attrs: {
|
|
24
|
+
type: "module",
|
|
25
|
+
async: !0,
|
|
26
|
+
src: "/assets/index-n6uo_92S.js"
|
|
27
|
+
} }]
|
|
28
|
+
},
|
|
29
|
+
"/": {
|
|
30
|
+
filePath: "src/routes/index.tsx",
|
|
31
|
+
children: void 0,
|
|
32
|
+
preloads: [
|
|
33
|
+
"/assets/routes-4pbC-2Hj.js",
|
|
34
|
+
"/assets/companion-view-Csva26Ir.js",
|
|
35
|
+
"/assets/spec-areas-C2L48N4C.js",
|
|
36
|
+
"/assets/report-time-Dc-KOqQu.js",
|
|
37
|
+
"/assets/warnings-V_Ys51wJ.js"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"/factory": {
|
|
41
|
+
filePath: "src/routes/factory.tsx",
|
|
42
|
+
children: void 0,
|
|
43
|
+
preloads: [
|
|
44
|
+
"/assets/factory-B7l9ZQyx.js",
|
|
45
|
+
"/assets/warnings-V_Ys51wJ.js",
|
|
46
|
+
"/assets/delivery-path-DJMpRmiY.js"
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"/reports": {
|
|
50
|
+
filePath: "src/routes/reports.tsx",
|
|
51
|
+
children: void 0,
|
|
52
|
+
preloads: ["/assets/reports-C01RsnMA.js", "/assets/report-time-Dc-KOqQu.js"]
|
|
53
|
+
},
|
|
54
|
+
"/skills": {
|
|
55
|
+
filePath: "src/routes/skills.tsx",
|
|
56
|
+
children: void 0,
|
|
57
|
+
preloads: ["/assets/skills-CihQganl.js", "/assets/companion-view-Csva26Ir.js"]
|
|
58
|
+
},
|
|
59
|
+
"/specs": {
|
|
60
|
+
filePath: "src/routes/specs.tsx",
|
|
61
|
+
children: void 0,
|
|
62
|
+
preloads: [
|
|
63
|
+
"/assets/specs-D24_35_K.js",
|
|
64
|
+
"/assets/companion-view-Csva26Ir.js",
|
|
65
|
+
"/assets/warnings-V_Ys51wJ.js",
|
|
66
|
+
"/assets/spec-areas-C2L48N4C.js"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"/vault": {
|
|
70
|
+
filePath: "src/routes/vault.tsx",
|
|
71
|
+
children: void 0,
|
|
72
|
+
preloads: ["/assets/vault-Bd4CQiTK.js"]
|
|
73
|
+
},
|
|
74
|
+
"/workflow": {
|
|
75
|
+
filePath: "src/routes/workflow.tsx",
|
|
76
|
+
children: void 0,
|
|
77
|
+
preloads: [
|
|
78
|
+
"/assets/workflow-BJejeVwQ.js",
|
|
79
|
+
"/assets/companion-view-Csva26Ir.js",
|
|
80
|
+
"/assets/warnings-V_Ys51wJ.js",
|
|
81
|
+
"/assets/delivery-path-DJMpRmiY.js"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
} });
|
|
85
|
+
export { tsrStartManifest };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// ../mate-core/src/lib/factory/runner/run-policy.ts
|
|
2
|
+
/** Shared run predicates; safe for the browser's Outcome policy. */
|
|
3
|
+
function retryRefusal(id, state) {
|
|
4
|
+
return state === "failed" || state === "interrupted" ? null : `Workset ${id} has no failed or interrupted run to retry`;
|
|
5
|
+
}
|
|
6
|
+
// ../mate-core/src/lib/factory/outcomes/actions.ts
|
|
7
|
+
/** Every action a person can take on an Outcome. None sets a stage. */
|
|
8
|
+
var OUTCOME_ACTIONS = [
|
|
9
|
+
"start",
|
|
10
|
+
"later",
|
|
11
|
+
"answer",
|
|
12
|
+
"take-control",
|
|
13
|
+
"return",
|
|
14
|
+
"retry",
|
|
15
|
+
"cancel",
|
|
16
|
+
"feedback",
|
|
17
|
+
"regenerate",
|
|
18
|
+
"start-apply",
|
|
19
|
+
"publish"
|
|
20
|
+
];
|
|
21
|
+
/** Why an action needing the AFK runner is refused for a companion the factory does not run. */
|
|
22
|
+
var NO_RUNNER_REFUSAL = "the AFK runner needs the appliance's factory mode for this companion";
|
|
23
|
+
/**
|
|
24
|
+
* Why the factory refuses `action` on this Outcome now, or `null` when it accepts it. Checks
|
|
25
|
+
* the factory can only make at the time, such as a live terminal session, come on top.
|
|
26
|
+
*/
|
|
27
|
+
function outcomeRefusal(action, workset, run, companion) {
|
|
28
|
+
const { id, stage, stageLabel } = workset;
|
|
29
|
+
const state = run?.state ?? "idle";
|
|
30
|
+
switch (action) {
|
|
31
|
+
case "start":
|
|
32
|
+
case "later": return stage === "done" ? `Workset ${id} is done` : null;
|
|
33
|
+
}
|
|
34
|
+
if (!companion.runner) return NO_RUNNER_REFUSAL;
|
|
35
|
+
switch (action) {
|
|
36
|
+
case "answer": return state === "waiting" ? null : "this question was already answered";
|
|
37
|
+
case "take-control":
|
|
38
|
+
if (!run?.conversation) return "this Outcome has no factory conversation to take over";
|
|
39
|
+
if (run.control) return "a person already has, or asked for, this Outcome's conversation";
|
|
40
|
+
return stage === "done" ? `Workset ${id} is done` : null;
|
|
41
|
+
case "return": return run?.control && run.control.mode !== "automatic" ? null : "the factory already drives this Outcome";
|
|
42
|
+
case "retry": return retryRefusal(id, state);
|
|
43
|
+
case "cancel": return state === "queued" || state === "running" ? null : `Workset ${id} has no run to cancel`;
|
|
44
|
+
case "feedback": return stage === "human-review" || stage === "apply" || stage === "merge-wait" ? null : `Workset ${id} takes no feedback at ${stageLabel}; start a new outcome instead`;
|
|
45
|
+
case "regenerate":
|
|
46
|
+
case "start-apply": return stage === "human-review" ? null : `Workset ${id} is not in the Human Reviews; it is at ${stageLabel}`;
|
|
47
|
+
case "publish": return stage === "publish" ? null : `Workset ${id} is not merged and archived; it is at ${stageLabel}`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** The actions the factory accepts on this Outcome now; the board offers no others. */
|
|
51
|
+
function outcomeActions(workset, run, companion) {
|
|
52
|
+
return new Set(OUTCOME_ACTIONS.filter((action) => outcomeRefusal(action, workset, run, companion) === null));
|
|
53
|
+
}
|
|
54
|
+
export { outcomeActions as n, OUTCOME_ACTIONS as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// ../mate-core/src/cli/commands/studio/actions.ts
|
|
2
|
+
/** Lowercase letters, digits and hyphens, so a subject can never carry shell syntax or a flag. */
|
|
3
|
+
var SUBJECT_PATTERN = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
4
|
+
var STUDIO_ACTIONS = [{
|
|
5
|
+
id: "show-me",
|
|
6
|
+
skill: "mate-show-me",
|
|
7
|
+
label: "Show me",
|
|
8
|
+
subject: "spec",
|
|
9
|
+
prompts: {
|
|
10
|
+
claude: (subject) => `/mate-show-me ${subject}`,
|
|
11
|
+
opencode: (subject) => `Use the mate-show-me skill on spec ${subject}.`
|
|
12
|
+
}
|
|
13
|
+
}];
|
|
14
|
+
function findAction(id) {
|
|
15
|
+
return STUDIO_ACTIONS.find((action) => action.id === id) ?? null;
|
|
16
|
+
}
|
|
17
|
+
/** Skill trees each agent loads; Claude does not read the shared Agents tree. */
|
|
18
|
+
var SKILL_TREES = {
|
|
19
|
+
claude: ["claude"],
|
|
20
|
+
opencode: ["opencode", "agents"]
|
|
21
|
+
};
|
|
22
|
+
/** Availability only: a directory shows the skill is installed, not that Mate shipped it. */
|
|
23
|
+
function skillInstalledFor(inventory, skill, agent) {
|
|
24
|
+
return SKILL_TREES[agent].some((tree) => inventory[tree].includes(skill));
|
|
25
|
+
}
|
|
26
|
+
var AGENTS = ["claude", "opencode"];
|
|
27
|
+
/**
|
|
28
|
+
* Run needs a terminal targeting the displayed companion and a launchable
|
|
29
|
+
* agent with the skill; Copy needs only the installed skill.
|
|
30
|
+
*/
|
|
31
|
+
function specActionOffers(companionPath, inventory, terminal) {
|
|
32
|
+
if (!inventory) return [];
|
|
33
|
+
const targeted = terminal?.target?.path === companionPath;
|
|
34
|
+
return STUDIO_ACTIONS.flatMap((action) => {
|
|
35
|
+
const copyAgents = AGENTS.filter((agent) => skillInstalledFor(inventory, action.skill, agent));
|
|
36
|
+
if (copyAgents.length === 0) return [];
|
|
37
|
+
return [{
|
|
38
|
+
action,
|
|
39
|
+
runAgents: targeted ? copyAgents.filter((agent) => terminal?.agents.includes(agent)) : [],
|
|
40
|
+
copyAgents
|
|
41
|
+
}];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export { findAction as n, specActionOffers as r, SUBJECT_PATTERN as t };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { i as useSuspenseQuery } from "./queries-Ag2iL8q2.js";
|
|
2
|
+
import { o as companionViewQuery } from "./studio-queries-CLnP9kGu.js";
|
|
3
|
+
import { l as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-BQKuMdJW.js";
|
|
4
|
+
// src/shell/companion-error.tsx
|
|
5
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
6
|
+
/**
|
|
7
|
+
* A companion that could not be read costs its content, never the page: the
|
|
8
|
+
* selector stays rendered around this so another companion can be reached.
|
|
9
|
+
*/
|
|
10
|
+
function CompanionError({ companionPath, reason }) {
|
|
11
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
|
|
12
|
+
className: "panel error",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: "Could not read this companion" }),
|
|
15
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
|
|
16
|
+
className: "mono",
|
|
17
|
+
children: companionPath
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: reason })
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// src/shell/companion-view.tsx
|
|
24
|
+
/** A companion view's data, or the companion's error in its place; the rest of the page stays. */
|
|
25
|
+
function CompanionView({ view, search, children }) {
|
|
26
|
+
const { data } = useSuspenseQuery(companionViewQuery(view, search));
|
|
27
|
+
if (data.error) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionError, {
|
|
28
|
+
companionPath: data.error.companionPath,
|
|
29
|
+
reason: data.error.reason
|
|
30
|
+
});
|
|
31
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: children(data) });
|
|
32
|
+
}
|
|
33
|
+
export { CompanionView as t };
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
// ../../node_modules/.bun/@tanstack+router-core@1.171.39/node_modules/@tanstack/router-core/dist/esm/redirect.js
|
|
3
|
+
/**
|
|
4
|
+
* Create a redirect Response understood by TanStack Router.
|
|
5
|
+
*
|
|
6
|
+
* Use from route `loader`/`beforeLoad` or server functions to trigger a
|
|
7
|
+
* navigation. If `throw: true` is set, the redirect is thrown instead of
|
|
8
|
+
* returned. External `href` values are classified as full-document
|
|
9
|
+
* navigations when the router resolves the redirect.
|
|
10
|
+
*
|
|
11
|
+
* @param opts Options for the redirect. Common fields:
|
|
12
|
+
* - `href`: absolute URL for external redirects.
|
|
13
|
+
* - `statusCode`: HTTP status code to use (defaults to 307).
|
|
14
|
+
* - `headers`: additional headers to include on the Response.
|
|
15
|
+
* - Standard navigation options like `to`, `params`, `search`, `replace`,
|
|
16
|
+
* and `reloadDocument` for internal redirects.
|
|
17
|
+
* @returns A Response augmented with router navigation options.
|
|
18
|
+
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction
|
|
19
|
+
*/
|
|
20
|
+
function redirect(opts) {
|
|
21
|
+
opts.statusCode = opts.statusCode || opts.code || 307;
|
|
22
|
+
const headers = new Headers(opts.headers);
|
|
23
|
+
if (opts.href && headers.get("Location") === null) headers.set("Location", opts.href);
|
|
24
|
+
const response = new Response(null, {
|
|
25
|
+
status: opts.statusCode,
|
|
26
|
+
headers
|
|
27
|
+
});
|
|
28
|
+
response.options = opts;
|
|
29
|
+
if (opts.throw) throw response;
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
/** Check whether a value is a TanStack Router redirect Response. */
|
|
33
|
+
function isRedirect(obj) {
|
|
34
|
+
return obj instanceof Response && !!obj.options;
|
|
35
|
+
}
|
|
36
|
+
/** Parse a serialized redirect object back into a redirect Response. */
|
|
37
|
+
function parseRedirect(obj) {
|
|
38
|
+
if (obj !== null && typeof obj === "object" && obj.isSerializedRedirect) return redirect(obj);
|
|
39
|
+
}
|
|
40
|
+
// ../../node_modules/.bun/cookie-es@3.1.1/node_modules/cookie-es/dist/index.mjs
|
|
41
|
+
var COOKIE_MAX_AGE_LIMIT = 3456e4;
|
|
42
|
+
var maxAgeRegExp = /^-?\d+$/;
|
|
43
|
+
var _nullProto = /* @__PURE__ */ Object.getPrototypeOf({});
|
|
44
|
+
function parseSetCookie(str, options) {
|
|
45
|
+
const len = str.length;
|
|
46
|
+
let _endIdx = len;
|
|
47
|
+
let eqIdx = -1;
|
|
48
|
+
for (let i = 0; i < len; i++) {
|
|
49
|
+
const c = str.charCodeAt(i);
|
|
50
|
+
if (c === 59) {
|
|
51
|
+
_endIdx = i;
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
if (c === 61 && eqIdx === -1) eqIdx = i;
|
|
55
|
+
}
|
|
56
|
+
if (eqIdx >= _endIdx) eqIdx = -1;
|
|
57
|
+
const name = eqIdx === -1 ? "" : _trim(str, 0, eqIdx);
|
|
58
|
+
if (name && name in _nullProto) return void 0;
|
|
59
|
+
let value = eqIdx === -1 ? _trim(str, 0, _endIdx) : _trim(str, eqIdx + 1, _endIdx);
|
|
60
|
+
if (!name && !value) return void 0;
|
|
61
|
+
if (name.length + value.length > 4096) return void 0;
|
|
62
|
+
if (options?.decode !== false) value = _decode(value, options?.decode);
|
|
63
|
+
const setCookie = {
|
|
64
|
+
name,
|
|
65
|
+
value
|
|
66
|
+
};
|
|
67
|
+
let index = _endIdx + 1;
|
|
68
|
+
while (index < len) {
|
|
69
|
+
let endIdx = len;
|
|
70
|
+
let attrEqIdx = -1;
|
|
71
|
+
for (let i = index; i < len; i++) {
|
|
72
|
+
const c = str.charCodeAt(i);
|
|
73
|
+
if (c === 59) {
|
|
74
|
+
endIdx = i;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
if (c === 61 && attrEqIdx === -1) attrEqIdx = i;
|
|
78
|
+
}
|
|
79
|
+
if (attrEqIdx >= endIdx) attrEqIdx = -1;
|
|
80
|
+
const attr = attrEqIdx === -1 ? _trim(str, index, endIdx) : _trim(str, index, attrEqIdx);
|
|
81
|
+
const val = attrEqIdx === -1 ? void 0 : _trim(str, attrEqIdx + 1, endIdx);
|
|
82
|
+
if (val === void 0 || val.length <= 1024) switch (attr.toLowerCase()) {
|
|
83
|
+
case "httponly":
|
|
84
|
+
setCookie.httpOnly = true;
|
|
85
|
+
break;
|
|
86
|
+
case "secure":
|
|
87
|
+
setCookie.secure = true;
|
|
88
|
+
break;
|
|
89
|
+
case "partitioned":
|
|
90
|
+
setCookie.partitioned = true;
|
|
91
|
+
break;
|
|
92
|
+
case "domain":
|
|
93
|
+
if (val) setCookie.domain = (val.charCodeAt(0) === 46 ? val.slice(1) : val).toLowerCase();
|
|
94
|
+
break;
|
|
95
|
+
case "path":
|
|
96
|
+
setCookie.path = val;
|
|
97
|
+
break;
|
|
98
|
+
case "max-age":
|
|
99
|
+
if (val && maxAgeRegExp.test(val)) setCookie.maxAge = Math.min(Number(val), COOKIE_MAX_AGE_LIMIT);
|
|
100
|
+
break;
|
|
101
|
+
case "expires": {
|
|
102
|
+
if (!val) break;
|
|
103
|
+
const date = new Date(val);
|
|
104
|
+
if (Number.isFinite(date.valueOf())) {
|
|
105
|
+
const maxDate = new Date(Date.now() + COOKIE_MAX_AGE_LIMIT * 1e3);
|
|
106
|
+
setCookie.expires = date > maxDate ? maxDate : date;
|
|
107
|
+
}
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
case "priority": {
|
|
111
|
+
if (!val) break;
|
|
112
|
+
const priority = val.toLowerCase();
|
|
113
|
+
if (priority === "low" || priority === "medium" || priority === "high") setCookie.priority = priority;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
case "samesite": {
|
|
117
|
+
if (!val) break;
|
|
118
|
+
const sameSite = val.toLowerCase();
|
|
119
|
+
if (sameSite === "lax" || sameSite === "strict" || sameSite === "none") setCookie.sameSite = sameSite;
|
|
120
|
+
else setCookie.sameSite = "lax";
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
default: {
|
|
124
|
+
const attrLower = attr.toLowerCase();
|
|
125
|
+
if (attrLower && !(attrLower in _nullProto)) setCookie[attrLower] = val;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
index = endIdx + 1;
|
|
129
|
+
}
|
|
130
|
+
return setCookie;
|
|
131
|
+
}
|
|
132
|
+
function _trim(str, start, end) {
|
|
133
|
+
if (start === end) return "";
|
|
134
|
+
let s = start;
|
|
135
|
+
let e = end;
|
|
136
|
+
while (s < e && (str.charCodeAt(s) === 32 || str.charCodeAt(s) === 9)) s++;
|
|
137
|
+
while (e > s && (str.charCodeAt(e - 1) === 32 || str.charCodeAt(e - 1) === 9)) e--;
|
|
138
|
+
return str.slice(s, e);
|
|
139
|
+
}
|
|
140
|
+
function _decode(value, decode) {
|
|
141
|
+
if (!decode && !value.includes("%")) return value;
|
|
142
|
+
try {
|
|
143
|
+
return (decode || decodeURIComponent)(value);
|
|
144
|
+
} catch {
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function splitSetCookieString(cookiesString) {
|
|
149
|
+
if (Array.isArray(cookiesString)) return cookiesString.flatMap((c) => splitSetCookieString(c));
|
|
150
|
+
if (typeof cookiesString !== "string") return [];
|
|
151
|
+
const cookiesStrings = [];
|
|
152
|
+
let pos = 0;
|
|
153
|
+
let start;
|
|
154
|
+
let ch;
|
|
155
|
+
let lastComma;
|
|
156
|
+
let nextStart;
|
|
157
|
+
let cookiesSeparatorFound;
|
|
158
|
+
const skipWhitespace = () => {
|
|
159
|
+
while (pos < cookiesString.length && /\s/.test(cookiesString.charAt(pos))) pos += 1;
|
|
160
|
+
return pos < cookiesString.length;
|
|
161
|
+
};
|
|
162
|
+
const notSpecialChar = () => {
|
|
163
|
+
ch = cookiesString.charAt(pos);
|
|
164
|
+
return ch !== "=" && ch !== ";" && ch !== ",";
|
|
165
|
+
};
|
|
166
|
+
while (pos < cookiesString.length) {
|
|
167
|
+
start = pos;
|
|
168
|
+
cookiesSeparatorFound = false;
|
|
169
|
+
while (skipWhitespace()) {
|
|
170
|
+
ch = cookiesString.charAt(pos);
|
|
171
|
+
if (ch === ",") {
|
|
172
|
+
lastComma = pos;
|
|
173
|
+
pos += 1;
|
|
174
|
+
skipWhitespace();
|
|
175
|
+
nextStart = pos;
|
|
176
|
+
while (pos < cookiesString.length && notSpecialChar()) pos += 1;
|
|
177
|
+
if (pos < cookiesString.length && cookiesString.charAt(pos) === "=") {
|
|
178
|
+
cookiesSeparatorFound = true;
|
|
179
|
+
pos = nextStart;
|
|
180
|
+
cookiesStrings.push(cookiesString.slice(start, lastComma));
|
|
181
|
+
start = pos;
|
|
182
|
+
} else pos = lastComma + 1;
|
|
183
|
+
} else pos += 1;
|
|
184
|
+
}
|
|
185
|
+
if (!cookiesSeparatorFound || pos >= cookiesString.length) cookiesStrings.push(cookiesString.slice(start));
|
|
186
|
+
}
|
|
187
|
+
return cookiesStrings;
|
|
188
|
+
}
|
|
189
|
+
// ../../node_modules/.bun/@tanstack+router-core@1.171.39/node_modules/@tanstack/router-core/dist/esm/ssr/headers.js
|
|
190
|
+
function toHeadersInstance(init) {
|
|
191
|
+
if (init instanceof Headers) return init;
|
|
192
|
+
else if (Array.isArray(init)) return new Headers(init);
|
|
193
|
+
else if (typeof init === "object") return new Headers(init);
|
|
194
|
+
else return null;
|
|
195
|
+
}
|
|
196
|
+
function mergeHeaders(...headers) {
|
|
197
|
+
return headers.reduce((acc, header) => {
|
|
198
|
+
const headersInstance = toHeadersInstance(header);
|
|
199
|
+
if (!headersInstance) return acc;
|
|
200
|
+
for (const [key, value] of headersInstance.entries()) if (key === "set-cookie") splitSetCookieString(value).forEach((cookie) => acc.append("set-cookie", cookie));
|
|
201
|
+
else acc.set(key, value);
|
|
202
|
+
return acc;
|
|
203
|
+
}, new Headers());
|
|
204
|
+
}
|
|
205
|
+
// ../../node_modules/.bun/@tanstack+start-client-core@1.170.39/node_modules/@tanstack/start-client-core/dist/esm/constants.js
|
|
206
|
+
var TSS_FORMDATA_CONTEXT = "__TSS_CONTEXT";
|
|
207
|
+
var TSS_SERVER_FUNCTION = Symbol.for("TSS_SERVER_FUNCTION");
|
|
208
|
+
var TSS_SERVER_FUNCTION_FACTORY = Symbol.for("TSS_SERVER_FUNCTION_FACTORY");
|
|
209
|
+
var X_TSS_SERIALIZED = "x-tss-serialized";
|
|
210
|
+
var X_TSS_RAW_RESPONSE = "x-tss-raw";
|
|
211
|
+
/** Content-Type for multiplexed framed responses (RawStream support) */
|
|
212
|
+
var TSS_CONTENT_TYPE_FRAMED = "application/x-tss-framed";
|
|
213
|
+
/** Largest payload accepted by one framed-protocol record. */
|
|
214
|
+
var MAX_FRAME_PAYLOAD_SIZE = 16777216;
|
|
215
|
+
/** Largest number of raw streams accepted in one framed response. */
|
|
216
|
+
var MAX_FRAMED_STREAMS = 1024;
|
|
217
|
+
/** Full Content-Type header value with version parameter */
|
|
218
|
+
var TSS_CONTENT_TYPE_FRAMED_VERSIONED = `${TSS_CONTENT_TYPE_FRAMED}; v=1`;
|
|
219
|
+
// ../../node_modules/.bun/@tanstack+start-storage-context@1.167.41/node_modules/@tanstack/start-storage-context/dist/esm/async-local-storage.js
|
|
220
|
+
var GLOBAL_STORAGE_KEY = Symbol.for("tanstack-start:start-storage-context");
|
|
221
|
+
var globalObj = globalThis;
|
|
222
|
+
if (!globalObj[GLOBAL_STORAGE_KEY]) globalObj[GLOBAL_STORAGE_KEY] = new AsyncLocalStorage();
|
|
223
|
+
var startStorage = globalObj[GLOBAL_STORAGE_KEY];
|
|
224
|
+
function runWithStartContext(context, fn) {
|
|
225
|
+
return startStorage.run(context, fn);
|
|
226
|
+
}
|
|
227
|
+
function getStartContext(opts) {
|
|
228
|
+
const context = startStorage.getStore();
|
|
229
|
+
if (!context && opts?.throwIfNotFound !== false) throw new Error(`No Start context found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`);
|
|
230
|
+
return context;
|
|
231
|
+
}
|
|
232
|
+
// ../../node_modules/.bun/@tanstack+start-client-core@1.170.39/node_modules/@tanstack/start-client-core/dist/esm/getStartOptions.js
|
|
233
|
+
var getStartOptions = () => getStartContext().startOptions;
|
|
234
|
+
// ../../node_modules/.bun/@tanstack+start-client-core@1.170.39/node_modules/@tanstack/start-client-core/dist/esm/safeObjectMerge.js
|
|
235
|
+
function isSafeKey(key) {
|
|
236
|
+
return key !== "__proto__" && key !== "constructor" && key !== "prototype";
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Merge target and source into a new null-proto object, filtering dangerous keys.
|
|
240
|
+
*/
|
|
241
|
+
function safeObjectMerge(target, source) {
|
|
242
|
+
const result = Object.create(null);
|
|
243
|
+
if (target) {
|
|
244
|
+
const keys = Object.keys(target);
|
|
245
|
+
for (let i = 0; i < keys.length; i++) {
|
|
246
|
+
const key = keys[i];
|
|
247
|
+
if (isSafeKey(key)) result[key] = target[key];
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (source && typeof source === "object") {
|
|
251
|
+
const keys = Object.keys(source);
|
|
252
|
+
for (let i = 0; i < keys.length; i++) {
|
|
253
|
+
const key = keys[i];
|
|
254
|
+
if (isSafeKey(key)) result[key] = source[key];
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return result;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Create a null-prototype object, optionally copying from source.
|
|
261
|
+
*/
|
|
262
|
+
function createNullProtoObject(source) {
|
|
263
|
+
return source ? safeObjectMerge(source, void 0) : Object.create(null);
|
|
264
|
+
}
|
|
265
|
+
// ../../node_modules/.bun/@tanstack+start-client-core@1.170.39/node_modules/@tanstack/start-client-core/dist/esm/getStartContextServerOnly.js
|
|
266
|
+
var getStartContextServerOnly = getStartContext;
|
|
267
|
+
// ../../node_modules/.bun/@tanstack+start-client-core@1.170.39/node_modules/@tanstack/start-client-core/dist/esm/createServerFn.js
|
|
268
|
+
var createServerFn = (options, __opts) => {
|
|
269
|
+
const resolvedOptions = __opts || options || {};
|
|
270
|
+
if (typeof resolvedOptions.method === "undefined") resolvedOptions.method = "GET";
|
|
271
|
+
const res = {
|
|
272
|
+
options: resolvedOptions,
|
|
273
|
+
middleware: (middleware) => {
|
|
274
|
+
const newMiddleware = [...resolvedOptions.middleware || []];
|
|
275
|
+
middleware.forEach((item) => {
|
|
276
|
+
if (TSS_SERVER_FUNCTION_FACTORY in item) {
|
|
277
|
+
if (item.options.middleware) newMiddleware.push(...item.options.middleware);
|
|
278
|
+
} else newMiddleware.push(item);
|
|
279
|
+
});
|
|
280
|
+
const res = createServerFn(void 0, {
|
|
281
|
+
...resolvedOptions,
|
|
282
|
+
middleware: newMiddleware
|
|
283
|
+
});
|
|
284
|
+
res[TSS_SERVER_FUNCTION_FACTORY] = true;
|
|
285
|
+
return res;
|
|
286
|
+
},
|
|
287
|
+
validator: (validator) => {
|
|
288
|
+
return createServerFn(void 0, {
|
|
289
|
+
...resolvedOptions,
|
|
290
|
+
validator
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
handler: (...args) => {
|
|
294
|
+
const [extractedFn, serverFn] = args;
|
|
295
|
+
const newOptions = {
|
|
296
|
+
...resolvedOptions,
|
|
297
|
+
extractedFn,
|
|
298
|
+
serverFn
|
|
299
|
+
};
|
|
300
|
+
const resolvedMiddleware = [...newOptions.middleware || [], serverFnBaseToMiddleware(newOptions)];
|
|
301
|
+
extractedFn.method = resolvedOptions.method;
|
|
302
|
+
return Object.assign(async (opts) => {
|
|
303
|
+
const result = await executeMiddleware(resolvedMiddleware, "client", {
|
|
304
|
+
...extractedFn,
|
|
305
|
+
...newOptions,
|
|
306
|
+
data: opts?.data,
|
|
307
|
+
headers: opts?.headers,
|
|
308
|
+
signal: opts?.signal,
|
|
309
|
+
fetch: opts?.fetch,
|
|
310
|
+
context: createNullProtoObject()
|
|
311
|
+
});
|
|
312
|
+
if ("error" in result) throw parseRedirect(result.error) ?? result.error;
|
|
313
|
+
return result.result;
|
|
314
|
+
}, {
|
|
315
|
+
...extractedFn,
|
|
316
|
+
method: resolvedOptions.method,
|
|
317
|
+
__executeServer: async (opts) => {
|
|
318
|
+
const startContext = getStartContextServerOnly();
|
|
319
|
+
const serverContextAfterGlobalMiddlewares = startContext.contextAfterGlobalMiddlewares;
|
|
320
|
+
const ctx = {
|
|
321
|
+
...extractedFn,
|
|
322
|
+
data: opts.data,
|
|
323
|
+
method: opts.method ?? resolvedOptions.method,
|
|
324
|
+
serverFnMeta: extractedFn.serverFnMeta,
|
|
325
|
+
context: safeObjectMerge(opts.context, serverContextAfterGlobalMiddlewares),
|
|
326
|
+
request: startContext.request
|
|
327
|
+
};
|
|
328
|
+
const result = await executeMiddleware(resolvedMiddleware, "server", ctx);
|
|
329
|
+
if ("error" in result) return { error: result.error };
|
|
330
|
+
return result.sendContext === void 0 ? { result: result.result } : {
|
|
331
|
+
result: result.result,
|
|
332
|
+
context: result.sendContext
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const fun = (options) => {
|
|
339
|
+
return createServerFn(void 0, {
|
|
340
|
+
...resolvedOptions,
|
|
341
|
+
...options
|
|
342
|
+
});
|
|
343
|
+
};
|
|
344
|
+
return Object.assign(fun, res);
|
|
345
|
+
};
|
|
346
|
+
function mergeOptionalSendContext(target, source) {
|
|
347
|
+
return target === void 0 && source === void 0 ? void 0 : safeObjectMerge(target, source);
|
|
348
|
+
}
|
|
349
|
+
function mergeOptionalHeaders(target, source) {
|
|
350
|
+
return target || source ? mergeHeaders(target, source) : void 0;
|
|
351
|
+
}
|
|
352
|
+
async function executeMiddleware(middlewares, env, opts) {
|
|
353
|
+
const flattenedMiddlewares = flattenMiddlewares((getStartOptions()?.functionMiddleware || []).concat(middlewares), void 0, env === "server" ? new Set(getStartContextServerOnly({ throwIfNotFound: false })?.executedRequestMiddlewares) : void 0);
|
|
354
|
+
let index = 0;
|
|
355
|
+
const callNextMiddleware = async (callerCtx, userCtx) => {
|
|
356
|
+
let ctx = callerCtx;
|
|
357
|
+
if (userCtx !== void 0) {
|
|
358
|
+
ctx = {
|
|
359
|
+
...callerCtx,
|
|
360
|
+
...userCtx
|
|
361
|
+
};
|
|
362
|
+
ctx.context = safeObjectMerge(callerCtx.context, userCtx.context);
|
|
363
|
+
ctx.sendContext = mergeOptionalSendContext(callerCtx.sendContext, userCtx.sendContext);
|
|
364
|
+
ctx.headers = mergeOptionalHeaders(callerCtx.headers, userCtx.headers);
|
|
365
|
+
ctx._callSiteFetch = callerCtx._callSiteFetch;
|
|
366
|
+
ctx.fetch = callerCtx._callSiteFetch ?? userCtx.fetch ?? callerCtx.fetch;
|
|
367
|
+
ctx.result = userCtx.result !== void 0 ? userCtx.result : userCtx instanceof Response ? userCtx : callerCtx.result;
|
|
368
|
+
}
|
|
369
|
+
let result = ctx;
|
|
370
|
+
while (index < flattenedMiddlewares.length) {
|
|
371
|
+
const options = flattenedMiddlewares[index++].options;
|
|
372
|
+
const validator = options.validator;
|
|
373
|
+
if (validator && env === "server") ctx.data = await execValidator(validator, ctx.data);
|
|
374
|
+
const middlewareFn = env === "client" ? options.client : options.server;
|
|
375
|
+
if (middlewareFn) {
|
|
376
|
+
result = await middlewareFn({
|
|
377
|
+
...ctx,
|
|
378
|
+
next: (nextCtx = {}) => callNextMiddleware(ctx, nextCtx)
|
|
379
|
+
});
|
|
380
|
+
if (result instanceof Response) {
|
|
381
|
+
if (isRedirect(result)) throw result;
|
|
382
|
+
result = {
|
|
383
|
+
...ctx,
|
|
384
|
+
result
|
|
385
|
+
};
|
|
386
|
+
} else if (!result) throw new Error("User middleware returned undefined. You must call next() or return a result in your middlewares.");
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if ("error" in result) throw result.error;
|
|
391
|
+
return result;
|
|
392
|
+
};
|
|
393
|
+
const initialCtx = {
|
|
394
|
+
...opts,
|
|
395
|
+
headers: opts.headers || (env === "client" ? {} : void 0),
|
|
396
|
+
sendContext: opts.sendContext,
|
|
397
|
+
context: opts.context || createNullProtoObject(),
|
|
398
|
+
_callSiteFetch: opts.fetch
|
|
399
|
+
};
|
|
400
|
+
if (initialCtx.sendContext !== void 0) initialCtx.sendContext ||= {};
|
|
401
|
+
try {
|
|
402
|
+
return await callNextMiddleware(initialCtx);
|
|
403
|
+
} catch (error) {
|
|
404
|
+
return {
|
|
405
|
+
...initialCtx,
|
|
406
|
+
error
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function flattenMiddlewares(middlewares, maxDepth = 100, seen = /* @__PURE__ */ new Set()) {
|
|
411
|
+
const flattened = [];
|
|
412
|
+
const recurse = (middleware, depth) => {
|
|
413
|
+
if (depth > maxDepth) throw new Error(`Middleware nesting depth exceeded maximum of ${maxDepth}. Check for circular references.`);
|
|
414
|
+
middleware.forEach((m) => {
|
|
415
|
+
if (m.options.middleware) recurse(m.options.middleware, depth + 1);
|
|
416
|
+
if (!seen.has(m)) {
|
|
417
|
+
seen.add(m);
|
|
418
|
+
flattened.push(m);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
recurse(middlewares, 0);
|
|
423
|
+
return flattened;
|
|
424
|
+
}
|
|
425
|
+
async function execValidator(validator, input) {
|
|
426
|
+
if (validator == null) return {};
|
|
427
|
+
if ("~standard" in validator) {
|
|
428
|
+
const result = await validator["~standard"].validate(input);
|
|
429
|
+
if (result.issues) throw new Error(JSON.stringify(result.issues, void 0, 2));
|
|
430
|
+
return result.value;
|
|
431
|
+
}
|
|
432
|
+
if ("parse" in validator) return validator.parse(input);
|
|
433
|
+
if (typeof validator === "function") return validator(input);
|
|
434
|
+
throw new Error("Invalid validator type!");
|
|
435
|
+
}
|
|
436
|
+
function serverFnBaseToMiddleware(options) {
|
|
437
|
+
return {
|
|
438
|
+
"~types": void 0,
|
|
439
|
+
options: {
|
|
440
|
+
validator: options.validator,
|
|
441
|
+
client: async ({ next, sendContext, fetch, ...ctx }) => {
|
|
442
|
+
const payload = {
|
|
443
|
+
...ctx,
|
|
444
|
+
context: sendContext,
|
|
445
|
+
fetch
|
|
446
|
+
};
|
|
447
|
+
return next(await options.extractedFn?.(payload));
|
|
448
|
+
},
|
|
449
|
+
server: async ({ next: _next, ...ctx }) => {
|
|
450
|
+
const result = await options.serverFn?.(ctx);
|
|
451
|
+
return {
|
|
452
|
+
...ctx,
|
|
453
|
+
result
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
export { splitSetCookieString as _, getStartOptions as a, MAX_FRAMED_STREAMS as c, TSS_FORMDATA_CONTEXT as d, TSS_SERVER_FUNCTION as f, parseSetCookie as g, mergeHeaders as h, safeObjectMerge as i, MAX_FRAME_PAYLOAD_SIZE as l, X_TSS_SERIALIZED as m, flattenMiddlewares as n, getStartContext as o, X_TSS_RAW_RESPONSE as p, createNullProtoObject as r, runWithStartContext as s, createServerFn as t, TSS_CONTENT_TYPE_FRAMED_VERSIONED as u, isRedirect as v, redirect as y };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { f as TSS_SERVER_FUNCTION } from "./createServerFn-F5sAOF8V.js";
|
|
2
|
+
// ../../node_modules/.bun/@tanstack+start-server-core@1.169.45/node_modules/@tanstack/start-server-core/dist/esm/createServerRpc.js
|
|
3
|
+
var createServerRpc = (serverFnMeta, splitImportFn) => {
|
|
4
|
+
const url = "/_serverFn/" + serverFnMeta.id;
|
|
5
|
+
return Object.assign(splitImportFn, {
|
|
6
|
+
url,
|
|
7
|
+
serverFnMeta,
|
|
8
|
+
[TSS_SERVER_FUNCTION]: true
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export { createServerRpc as t };
|