@uniqbit/mate-core 0.20.0 → 0.21.1
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/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
- package/claude-plugin/hooks/hooks.json +10 -1
- package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
- package/opencode-plugin/src/server.ts +9 -2
- package/package.json +2 -1
- package/src/cli/commands/artifact/delivery/environment.ts +28 -8
- package/src/cli/commands/artifact/delivery/link.ts +28 -9
- package/src/cli/commands/artifact/delivery/output.ts +7 -0
- package/src/cli/commands/companion/update.ts +2 -19
- package/src/cli/commands/factory/factory.ts +11 -1
- package/src/cli/commands/install.ts +47 -36
- package/src/cli/commands/launch/claude.ts +2 -0
- package/src/cli/commands/launch/shared.ts +33 -6
- package/src/cli/commands/plugin/install.ts +27 -11
- package/src/cli/commands/report/index.ts +180 -184
- package/src/cli/commands/report/markdown.ts +67 -72
- package/src/cli/commands/shared/companion-selection.ts +3 -1
- package/src/cli/commands/studio/access.ts +6 -14
- package/src/cli/commands/studio/areas.ts +112 -33
- package/src/cli/commands/studio/companion-add.ts +87 -0
- package/src/cli/commands/studio/companion-removal.ts +15 -8
- package/src/cli/commands/studio/factory-credential.ts +1 -15
- package/src/cli/commands/studio/factory-git-tokens.ts +40 -0
- package/src/cli/commands/studio/factory-relay.ts +18 -0
- package/src/cli/commands/studio/graph-model.ts +61 -0
- package/src/cli/commands/studio/graph.ts +336 -0
- package/src/cli/commands/studio/index.ts +4 -4
- package/src/cli/commands/studio/payload.ts +42 -15
- package/src/cli/commands/studio/repository-add.ts +116 -0
- package/src/cli/commands/studio/routes.ts +6 -0
- package/src/cli/commands/studio/selection.ts +12 -3
- package/src/cli/commands/studio/server.ts +127 -5
- package/src/cli/commands/studio/services.ts +40 -0
- package/src/cli/commands/studio/terminal.ts +45 -3
- package/src/cli/commands/studio/views/vault/markdown-tree.ts +84 -3
- package/src/cli/commands/studio/workset-session.ts +47 -14
- package/src/cli/commands/unwrap.ts +3 -0
- package/src/cli/commands/update.ts +2 -0
- package/src/cli/commands/vscode/release-vsix.json +4 -0
- package/src/cli/commands/vscode/setup.ts +71 -13
- package/src/cli/commands/vscode/vsix.ts +48 -7
- package/src/cli/commands/working/cleanup.ts +40 -8
- package/src/cli/commands/working/worktree.ts +176 -35
- package/src/cli/main.ts +17 -2
- package/src/cli/usage.ts +1 -1
- package/src/hooks/rtk-worktree-git.ts +48 -0
- package/src/hooks/validate-artifact-path.ts +38 -7
- package/src/lib/delivery/branch-template.ts +122 -0
- package/src/lib/delivery/branches.ts +21 -16
- package/src/lib/delivery/checkout.ts +102 -0
- package/src/lib/delivery/environment.ts +2 -0
- package/src/lib/delivery/merge-git.ts +13 -1
- package/src/lib/delivery/record-delivery.ts +83 -29
- package/src/lib/delivery/record.ts +15 -3
- package/src/lib/delivery/resolve-branch.ts +157 -110
- package/src/lib/factory/attach-client.ts +11 -1
- package/src/lib/factory/broker.ts +37 -40
- package/src/lib/factory/client.ts +22 -1
- package/src/lib/factory/clone-url.ts +39 -0
- package/src/lib/factory/command.ts +21 -5
- package/src/lib/factory/git-auth.ts +61 -0
- package/src/lib/factory/git-credential-store.ts +181 -0
- package/src/lib/factory/ids.ts +12 -2
- package/src/lib/factory/outcomes/actions.ts +20 -4
- package/src/lib/factory/outcomes/index.ts +77 -11
- package/src/lib/factory/outcomes/lifecycle.ts +9 -2
- package/src/lib/factory/outcomes/sessions.ts +23 -1
- package/src/lib/factory/prepare.ts +9 -3
- package/src/lib/factory/runner/scheduler.ts +96 -14
- package/src/lib/factory/runner/workflow.ts +5 -1
- package/src/lib/factory/runtime.ts +143 -43
- package/src/lib/orchestrator/companion-hub.ts +6 -1
- package/src/lib/orchestrator/engine-floor.ts +48 -0
- package/src/lib/orchestrator/launcher.ts +34 -1
- package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
- package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
- package/src/lib/orchestrator/projection-claude-links.ts +32 -8
- package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
- package/src/lib/orchestrator/projection-entries.ts +22 -18
- package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
- package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
- package/src/lib/orchestrator/projection-types.ts +28 -1
- package/src/lib/orchestrator/refresh-working-claude-links.ts +3 -1
- package/src/lib/orchestrator/session-prepare.ts +6 -1
- package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
- package/src/lib/orchestrator/types.ts +4 -0
- package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
- package/src/lib/orchestrator/working-repo-projection.ts +24 -4
- package/src/lib/orchestrator/wrap-pass.ts +1 -0
- package/src/lib/public-npm.ts +95 -50
- package/src/lib/session-state.ts +72 -2
- package/src/lib/update-checker.ts +7 -1
- package/src/lib/usage/aggregate.ts +202 -0
- package/src/lib/usage/cache.ts +87 -0
- package/src/lib/usage/claude-pricing.ts +71 -0
- package/src/lib/usage/claude.ts +189 -0
- package/src/lib/usage/collect.ts +56 -0
- package/src/lib/usage/opencode.ts +188 -0
- package/src/lib/usage/records.ts +80 -0
- package/src/lib/usage/rtk-database.ts +72 -0
- package/src/lib/usage/savings.ts +209 -0
- package/src/lib/usage/scope.ts +182 -0
- package/src/lib/usage/source.ts +102 -0
- package/src/lib/usage/types.ts +143 -0
- package/src/lib/usage/window.ts +37 -0
- package/src/lib/workset/factory-local.ts +157 -0
- package/src/lib/workset/record.ts +25 -11
- package/src/lib/workset/repositories.ts +118 -25
- package/src/lib/workset/worktree-include.ts +161 -0
- package/src/lib/workset/worktree-index.ts +6 -2
- package/src/lib/workset/worktree.ts +591 -101
- package/src/opencode/companion-hooks.ts +46 -8
- package/src/opencode/companion-policy.ts +18 -5
- package/src/opencode/enter-worktree.ts +254 -6
- package/src/opencode/session-register.ts +2 -2
- package/src/runtime/claude-bg-isolation.ts +138 -0
- package/src/runtime/companion-git.ts +10 -2
- package/src/runtime/companion-guidance.ts +17 -4
- package/src/runtime/current-branch.ts +16 -2
- package/src/runtime/entered-worktree.ts +24 -0
- package/src/runtime/git-tracked.ts +60 -0
- package/src/runtime/repo-destination.ts +72 -0
- package/src/runtime/repo-local.ts +25 -3
- package/src/runtime/rtk-git-guard.ts +66 -0
- package/src/runtime/runtime-document-manifest.ts +229 -19
- package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
- package/src/runtime/secret-guard.ts +9 -2
- package/src/runtime/secret-policy-weakening.ts +122 -0
- package/src/runtime/serving-claude-wrap.ts +15 -2
- package/src/runtime/umbrella-folder.ts +56 -0
- package/src/runtime/wrap-state.ts +5 -13
- package/src/studio.ts +37 -0
- package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +61 -6
- package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +8 -4
- package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +9 -5
- package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +5 -4
- package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +10 -4
- package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +5 -1
- package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +61 -6
- package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +8 -4
- package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +9 -5
- package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +5 -4
- package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +10 -4
- package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +5 -1
- package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +307 -42
- package/src/tools/setup/capabilities/rtk.ts +93 -1
- package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
- package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
- package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
- package/src/tools/setup/dynamic-plugins/install.ts +24 -22
- package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
- package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
- package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
- package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
- package/src/tools/setup/mate.ts +3 -3
- package/src/tools/setup/plugins/gitignore.ts +15 -9
- package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
- package/src/tools/setup/providers/claude.ts +25 -3
- package/src/tools/setup/utils.ts +4 -2
- package/src/tools/setup/working-repo-cleanup.ts +2 -2
- package/src/tools/setup/working-repo-local-state.ts +2 -0
- package/src/tools/setup.ts +25 -14
- package/studio-dist/client/assets/app-D9cw6szy.css +2 -0
- package/studio-dist/client/assets/artifacts-WD2ZXYrx.js +1 -0
- package/studio-dist/client/assets/button-Br0O1sXw.js +1 -0
- package/studio-dist/client/assets/combobox-DA7RAUUZ.js +1 -0
- package/studio-dist/client/assets/companion-view-CrabvxS8.js +1 -0
- package/studio-dist/client/assets/factory-DGS0E16C.js +6 -0
- package/studio-dist/client/assets/fields-6aXBpFhJ.js +1 -0
- package/studio-dist/client/assets/getting-started-Clde4w6P.js +1 -0
- package/studio-dist/client/assets/getting-started-D6kgWwWZ.js +1 -0
- package/studio-dist/client/assets/getting-started._topic-BiunccbT.js +1 -0
- package/studio-dist/client/assets/getting-started.index-DpiNoGw8.js +1 -0
- package/studio-dist/client/assets/graph-B_TCBVbu.js +2 -0
- package/studio-dist/client/assets/graph-canvas-Ba37Y5AE.js +3242 -0
- package/studio-dist/client/assets/guides-Du_RtJxP.js +1 -0
- package/studio-dist/client/assets/index-Df8L1LQa.js +40 -0
- package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
- package/studio-dist/client/assets/markdown-view-BOX6x0rL.js +1 -0
- package/studio-dist/client/assets/panel-dbmCx7Mx.js +1 -0
- package/studio-dist/client/assets/queries-RvHeXY12.js +1 -0
- package/studio-dist/client/assets/react-3QStrcDO.js +27 -0
- package/studio-dist/client/assets/report-url-XRL0x1SY.js +1 -0
- package/studio-dist/client/assets/reports-r3IK7Doz.js +1 -0
- package/studio-dist/client/assets/routes-C0A5LTFc.js +1 -0
- package/studio-dist/client/assets/select-CnaMd617.js +1 -0
- package/studio-dist/client/assets/skills-CzjzHpBT.js +1 -0
- package/studio-dist/client/assets/specs-B0ldF_6J.js +1 -0
- package/studio-dist/client/assets/specs-view-BnCLA0gW.js +1 -0
- package/studio-dist/client/assets/spinner-Dcm3fqK1.js +1 -0
- package/studio-dist/client/assets/steps-C0p2N1Pb.js +1 -0
- package/studio-dist/client/assets/store-Dw34catY.js +1 -0
- package/studio-dist/client/assets/studio-Cpz_HRHp.js +100 -0
- package/studio-dist/client/assets/studio-queries-ibmpFo6R.js +2 -0
- package/studio-dist/client/assets/usage-C2QJ_0IZ.js +55 -0
- package/studio-dist/client/assets/useAnchoredPopupScrollLock-Bj-FWb8z.js +1 -0
- package/studio-dist/client/assets/useMutation-aAr2uiay.js +1 -0
- package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
- package/studio-dist/client/assets/vault-BGcxkSIY.js +1 -0
- package/studio-dist/client/assets/warnings-R1cE1rLf.js +1 -0
- package/studio-dist/client/assets/workflow-C2qTrMDH.js +1 -0
- package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-Bn896ZYj.js +122 -0
- package/studio-dist/server/assets/_tanstack-start-manifest_v.js +102 -35
- package/studio-dist/server/assets/{actions-Bvgj9eb8.js → actions-DYSv-9VV.js} +10 -4
- package/studio-dist/server/assets/artifacts-DnF9L3dZ.js +216 -0
- package/studio-dist/server/assets/{button-CIJqAhni.js → button-CgOIVdmD.js} +13 -1702
- package/studio-dist/server/assets/combobox-DV_s9W0s.js +483 -0
- package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-BKVXD3TO.js} +3 -3
- package/studio-dist/server/assets/companions-C7fctnU9.js +31 -0
- package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
- package/studio-dist/server/assets/{factory-DUTa0eDs.js → factory-C7Ybg0xG.js} +1256 -353
- package/studio-dist/server/assets/{factory-DGPmNGbo.js → factory-Df5uAHjb.js} +53 -6
- package/studio-dist/server/assets/fields-BbieQTD0.js +1190 -0
- package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
- package/studio-dist/server/assets/getting-started-CRxMWorQ.js +67 -0
- package/studio-dist/server/assets/getting-started._topic-DJKQAzYl.js +13 -0
- package/studio-dist/server/assets/getting-started.index-D84gec1t.js +13 -0
- package/studio-dist/server/assets/graph-CSje3029.js +801 -0
- package/studio-dist/server/assets/graph-DDZzXM1L.js +16 -0
- package/studio-dist/server/assets/graph-canvas-22bWB5-2.js +21066 -0
- package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
- package/studio-dist/server/assets/guides-D9dk1Frq.js +13 -0
- package/studio-dist/server/assets/guides-IE-19POz.js +5 -0
- package/studio-dist/server/assets/guides.server-vcYRY5wx.js +66 -0
- package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
- package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-BR8dJ7aR.js} +28 -9
- package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-BR_t9iMM.js} +4 -4
- package/studio-dist/server/assets/queries-DWoTin-q.js +32 -0
- package/studio-dist/server/assets/react-CdqSUhaL.js +89 -0
- package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
- package/studio-dist/server/assets/report-url-BUXPcE_8.js +9 -0
- package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CQ9qQ1-n.js} +9 -10
- package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-dYDEoBeq.js} +3 -3
- package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DkRHNTpE.js} +787 -2862
- package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-B6GfOew4.js} +22 -171
- package/studio-dist/server/assets/{search-JAKurDNh.js → search-BJnWLfkG.js} +21 -2
- package/studio-dist/server/assets/select-Af7Wibii.js +1609 -0
- package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-Hq-hXgnT.js} +6 -5
- package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-B7nEuVbx.js} +9 -8
- package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-B_YYL7q8.js} +3 -3
- package/studio-dist/server/assets/specs-BpLUFntA.js +51 -0
- package/studio-dist/server/assets/specs-view-0peMVd22.js +426 -0
- package/studio-dist/server/assets/spinner-CdwJW4VB.js +20 -0
- package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D56DApvK.js} +1 -1
- package/studio-dist/server/assets/store-Cs17okNG.js +280 -0
- package/studio-dist/server/assets/studio-CAcKp3bM.js +10340 -0
- package/studio-dist/server/assets/studio-queries-BtRGzDdh.js +1451 -0
- package/studio-dist/server/assets/usage-COdjd1gD.js +25570 -0
- package/studio-dist/server/assets/usage-f6pqE1tm.js +24 -0
- package/studio-dist/server/assets/useAnchoredPopupScrollLock-DlBKHRw7.js +756 -0
- package/studio-dist/server/assets/useMutation-DzTZGenE.js +690 -0
- package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
- package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-BDuIUq0F.js} +8 -5
- package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-BVLp6zu3.js} +3 -3
- package/studio-dist/server/assets/{views-BgYa-za2.js → views-flRUr21z.js} +4 -4
- package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-CDy9pdgL.js} +3 -2
- package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-D9GKI2EV.js} +132 -106
- package/studio-dist/server/server.js +582 -8
- package/src/cli/commands/report/collector.ts +0 -288
- package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
- package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
- package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
- package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
- package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
- package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
- package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
- package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
- package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
- package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
- package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
- package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
- package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
- package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
- package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
- package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
- package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
- package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
- package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
- package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
- package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
- package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
- package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
- package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
- package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
- package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
- package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
|
@@ -1,459 +0,0 @@
|
|
|
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 };
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { l as COMPANION_DIGEST_PATTERN, u as COMPANION_PARAM } from "./studio-BeltxxKt.js";
|
|
2
|
-
// src/shell/prepaint.ts
|
|
3
|
-
var THEME_STORAGE_KEY = "mate-studio-theme";
|
|
4
|
-
var COMPANION_STORAGE_KEY = "mate-studio-companion";
|
|
5
|
-
var VAULT_TREE_STORAGE_KEY = "mate-studio-vault-tree";
|
|
6
|
-
var RAIL_STORAGE_KEY = "mate-studio-rail";
|
|
7
|
-
/**
|
|
8
|
-
* Runs in `<head>` before first paint. A server-rendered document arrives with
|
|
9
|
-
* its markup already in place, so a remembered appearance applied after load
|
|
10
|
-
* would paint the other one first and then repaint (so would a collapsed sidebar), and a remembered companion
|
|
11
|
-
* restored after load would paint the picker before leaving it.
|
|
12
|
-
*
|
|
13
|
-
* The restore names the companion in the URL and reloads, because the URL is
|
|
14
|
-
* what the server answers. A companion parameter that is present and empty is
|
|
15
|
-
* a deliberate "no companion" and is left alone, so the redirect cannot loop
|
|
16
|
-
* and the picker stays reachable.
|
|
17
|
-
*/
|
|
18
|
-
var STUDIO_PREPAINT_SCRIPT = `(function () {
|
|
19
|
-
try {
|
|
20
|
-
var chosen = localStorage.getItem(${JSON.stringify(THEME_STORAGE_KEY)});
|
|
21
|
-
if (chosen === "dark" || chosen === "light") {
|
|
22
|
-
document.documentElement.setAttribute("data-theme", chosen);
|
|
23
|
-
}
|
|
24
|
-
if (localStorage.getItem(${JSON.stringify(VAULT_TREE_STORAGE_KEY)}) === "hidden") {
|
|
25
|
-
document.documentElement.setAttribute("data-vault-tree", "hidden");
|
|
26
|
-
}
|
|
27
|
-
if (localStorage.getItem(${JSON.stringify(RAIL_STORAGE_KEY)}) === "min") {
|
|
28
|
-
document.documentElement.setAttribute("data-rail", "min");
|
|
29
|
-
}
|
|
30
|
-
} catch (error) {
|
|
31
|
-
/* a blocked web store only costs the preference, never the page */
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
try {
|
|
35
|
-
var params = new URLSearchParams(location.search);
|
|
36
|
-
var last = localStorage.getItem(${JSON.stringify(COMPANION_STORAGE_KEY)});
|
|
37
|
-
if (!params.has(${JSON.stringify(COMPANION_PARAM)}) && ${String(COMPANION_DIGEST_PATTERN)}.test(last || "")) {
|
|
38
|
-
params.set(${JSON.stringify(COMPANION_PARAM)}, last);
|
|
39
|
-
location.replace(location.pathname + "?" + params.toString());
|
|
40
|
-
}
|
|
41
|
-
} catch (error) {
|
|
42
|
-
/* a blocked web store only costs the restore, never the page */
|
|
43
|
-
}
|
|
44
|
-
})();`;
|
|
45
|
-
export { VAULT_TREE_STORAGE_KEY as a, THEME_STORAGE_KEY as i, RAIL_STORAGE_KEY as n, STUDIO_PREPAINT_SCRIPT as r, COMPANION_STORAGE_KEY as t };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
|
|
2
|
-
import { j as require_react } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
|
|
3
|
-
// ../../node_modules/.bun/zustand@5.0.16+d485e2f7e55e3bff/node_modules/zustand/esm/vanilla.mjs
|
|
4
|
-
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
|
-
var createStoreImpl = (createState) => {
|
|
6
|
-
let state;
|
|
7
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
8
|
-
const setState = (partial, replace) => {
|
|
9
|
-
const nextState = typeof partial === "function" ? partial(state) : partial;
|
|
10
|
-
if (!Object.is(nextState, state)) {
|
|
11
|
-
const previousState = state;
|
|
12
|
-
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
|
13
|
-
listeners.forEach((listener) => listener(state, previousState));
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
const getState = () => state;
|
|
17
|
-
const getInitialState = () => initialState;
|
|
18
|
-
const subscribe = (listener) => {
|
|
19
|
-
listeners.add(listener);
|
|
20
|
-
return () => listeners.delete(listener);
|
|
21
|
-
};
|
|
22
|
-
const api = {
|
|
23
|
-
setState,
|
|
24
|
-
getState,
|
|
25
|
-
getInitialState,
|
|
26
|
-
subscribe
|
|
27
|
-
};
|
|
28
|
-
const initialState = state = createState(setState, getState, api);
|
|
29
|
-
return api;
|
|
30
|
-
};
|
|
31
|
-
var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
|
|
32
|
-
// ../../node_modules/.bun/zustand@5.0.16+d485e2f7e55e3bff/node_modules/zustand/esm/react.mjs
|
|
33
|
-
var identity = (arg) => arg;
|
|
34
|
-
function useStore(api, selector = identity) {
|
|
35
|
-
const slice = import_react.useSyncExternalStore(api.subscribe, import_react.useCallback(() => selector(api.getState()), [api, selector]), () => selector(api.getInitialState()));
|
|
36
|
-
import_react.useDebugValue(slice);
|
|
37
|
-
return slice;
|
|
38
|
-
}
|
|
39
|
-
var createImpl = (createState) => {
|
|
40
|
-
const api = createStore(createState);
|
|
41
|
-
const useBoundStore = (selector) => useStore(api, selector);
|
|
42
|
-
Object.assign(useBoundStore, api);
|
|
43
|
-
return useBoundStore;
|
|
44
|
-
};
|
|
45
|
-
var create = ((createState) => createState ? createImpl(createState) : createImpl);
|
|
46
|
-
export { create as t };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
// \0rolldown/runtime.js
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod, mod.exports), cb = null), mod.exports);
|
|
10
|
-
var __exportAll = (all, no_symbols) => {
|
|
11
|
-
let target = {};
|
|
12
|
-
for (var name in all) __defProp(target, name, {
|
|
13
|
-
get: all[name],
|
|
14
|
-
enumerable: true
|
|
15
|
-
});
|
|
16
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
17
|
-
return target;
|
|
18
|
-
};
|
|
19
|
-
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
21
|
-
key = keys[i];
|
|
22
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
23
|
-
get: ((k) => from[k]).bind(null, key),
|
|
24
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
return to;
|
|
28
|
-
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
32
|
-
}) : target, mod));
|
|
33
|
-
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
34
|
-
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|