@andrew.ng/symbion 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +125 -0
- package/apps/daemon/dist/boot/menu.d.ts +11 -0
- package/apps/daemon/dist/boot/menu.d.ts.map +1 -0
- package/apps/daemon/dist/boot/menu.js +32 -0
- package/apps/daemon/dist/boot/menu.js.map +1 -0
- package/apps/daemon/dist/fs/folderPick.d.ts +13 -0
- package/apps/daemon/dist/fs/folderPick.d.ts.map +1 -0
- package/apps/daemon/dist/fs/folderPick.js +4 -0
- package/apps/daemon/dist/fs/folderPick.js.map +1 -0
- package/apps/daemon/dist/fs/listDir.d.ts +13 -0
- package/apps/daemon/dist/fs/listDir.d.ts.map +1 -0
- package/apps/daemon/dist/fs/listDir.js +121 -0
- package/apps/daemon/dist/fs/listDir.js.map +1 -0
- package/apps/daemon/dist/fs/readTargetFiles.d.ts +20 -0
- package/apps/daemon/dist/fs/readTargetFiles.d.ts.map +1 -0
- package/apps/daemon/dist/fs/readTargetFiles.js +76 -0
- package/apps/daemon/dist/fs/readTargetFiles.js.map +1 -0
- package/apps/daemon/dist/fs/writeFiles.d.ts +32 -0
- package/apps/daemon/dist/fs/writeFiles.d.ts.map +1 -0
- package/apps/daemon/dist/fs/writeFiles.js +93 -0
- package/apps/daemon/dist/fs/writeFiles.js.map +1 -0
- package/apps/daemon/dist/git/status.d.ts +11 -0
- package/apps/daemon/dist/git/status.d.ts.map +1 -0
- package/apps/daemon/dist/git/status.js +30 -0
- package/apps/daemon/dist/git/status.js.map +1 -0
- package/apps/daemon/dist/index.d.ts +2 -0
- package/apps/daemon/dist/index.d.ts.map +1 -0
- package/apps/daemon/dist/index.js +69 -0
- package/apps/daemon/dist/index.js.map +1 -0
- package/apps/daemon/dist/llm/anthropicProvider.d.ts +26 -0
- package/apps/daemon/dist/llm/anthropicProvider.d.ts.map +1 -0
- package/apps/daemon/dist/llm/anthropicProvider.js +90 -0
- package/apps/daemon/dist/llm/anthropicProvider.js.map +1 -0
- package/apps/daemon/dist/llm/geminiProvider.d.ts +25 -0
- package/apps/daemon/dist/llm/geminiProvider.d.ts.map +1 -0
- package/apps/daemon/dist/llm/geminiProvider.js +89 -0
- package/apps/daemon/dist/llm/geminiProvider.js.map +1 -0
- package/apps/daemon/dist/llm/installInstructions.d.ts +40 -0
- package/apps/daemon/dist/llm/installInstructions.d.ts.map +1 -0
- package/apps/daemon/dist/llm/installInstructions.js +80 -0
- package/apps/daemon/dist/llm/installInstructions.js.map +1 -0
- package/apps/daemon/dist/llm/ollamaProvider.d.ts +55 -0
- package/apps/daemon/dist/llm/ollamaProvider.d.ts.map +1 -0
- package/apps/daemon/dist/llm/ollamaProvider.js +213 -0
- package/apps/daemon/dist/llm/ollamaProvider.js.map +1 -0
- package/apps/daemon/dist/llm/openaiProvider.d.ts +25 -0
- package/apps/daemon/dist/llm/openaiProvider.d.ts.map +1 -0
- package/apps/daemon/dist/llm/openaiProvider.js +90 -0
- package/apps/daemon/dist/llm/openaiProvider.js.map +1 -0
- package/apps/daemon/dist/llm/providerStatus.d.ts +60 -0
- package/apps/daemon/dist/llm/providerStatus.d.ts.map +1 -0
- package/apps/daemon/dist/llm/providerStatus.js +88 -0
- package/apps/daemon/dist/llm/providerStatus.js.map +1 -0
- package/apps/daemon/dist/llm/registry.d.ts +14 -0
- package/apps/daemon/dist/llm/registry.d.ts.map +1 -0
- package/apps/daemon/dist/llm/registry.js +35 -0
- package/apps/daemon/dist/llm/registry.js.map +1 -0
- package/apps/daemon/dist/llm/remoteProvider.d.ts +25 -0
- package/apps/daemon/dist/llm/remoteProvider.d.ts.map +1 -0
- package/apps/daemon/dist/llm/remoteProvider.js +88 -0
- package/apps/daemon/dist/llm/remoteProvider.js.map +1 -0
- package/apps/daemon/dist/llm/secrets.d.ts +55 -0
- package/apps/daemon/dist/llm/secrets.d.ts.map +1 -0
- package/apps/daemon/dist/llm/secrets.js +167 -0
- package/apps/daemon/dist/llm/secrets.js.map +1 -0
- package/apps/daemon/dist/llm/types.d.ts +50 -0
- package/apps/daemon/dist/llm/types.d.ts.map +1 -0
- package/apps/daemon/dist/llm/types.js +16 -0
- package/apps/daemon/dist/llm/types.js.map +1 -0
- package/apps/daemon/dist/net/findOpenPort.d.ts +26 -0
- package/apps/daemon/dist/net/findOpenPort.d.ts.map +1 -0
- package/apps/daemon/dist/net/findOpenPort.js +37 -0
- package/apps/daemon/dist/net/findOpenPort.js.map +1 -0
- package/apps/daemon/dist/rpc/contract.d.ts +10 -0
- package/apps/daemon/dist/rpc/contract.d.ts.map +1 -0
- package/apps/daemon/dist/rpc/contract.js +2 -0
- package/apps/daemon/dist/rpc/contract.js.map +1 -0
- package/apps/daemon/dist/rpc/guard.d.ts +18 -0
- package/apps/daemon/dist/rpc/guard.d.ts.map +1 -0
- package/apps/daemon/dist/rpc/guard.js +75 -0
- package/apps/daemon/dist/rpc/guard.js.map +1 -0
- package/apps/daemon/dist/rpc/handlers.d.ts +118 -0
- package/apps/daemon/dist/rpc/handlers.d.ts.map +1 -0
- package/apps/daemon/dist/rpc/handlers.js +694 -0
- package/apps/daemon/dist/rpc/handlers.js.map +1 -0
- package/apps/daemon/dist/rpc/pathStyle.d.ts +27 -0
- package/apps/daemon/dist/rpc/pathStyle.d.ts.map +1 -0
- package/apps/daemon/dist/rpc/pathStyle.js +43 -0
- package/apps/daemon/dist/rpc/pathStyle.js.map +1 -0
- package/apps/daemon/dist/rpc/rpcError.d.ts +13 -0
- package/apps/daemon/dist/rpc/rpcError.d.ts.map +1 -0
- package/apps/daemon/dist/rpc/rpcError.js +16 -0
- package/apps/daemon/dist/rpc/rpcError.js.map +1 -0
- package/apps/daemon/dist/server.d.ts +18 -0
- package/apps/daemon/dist/server.d.ts.map +1 -0
- package/apps/daemon/dist/server.js +208 -0
- package/apps/daemon/dist/server.js.map +1 -0
- package/apps/daemon/dist/store/publishLog.d.ts +6 -0
- package/apps/daemon/dist/store/publishLog.d.ts.map +1 -0
- package/apps/daemon/dist/store/publishLog.js +27 -0
- package/apps/daemon/dist/store/publishLog.js.map +1 -0
- package/apps/daemon/dist/store/store.d.ts +35 -0
- package/apps/daemon/dist/store/store.d.ts.map +1 -0
- package/apps/daemon/dist/store/store.js +129 -0
- package/apps/daemon/dist/store/store.js.map +1 -0
- package/apps/daemon/dist/templates/githubFetch.d.ts +49 -0
- package/apps/daemon/dist/templates/githubFetch.d.ts.map +1 -0
- package/apps/daemon/dist/templates/githubFetch.js +168 -0
- package/apps/daemon/dist/templates/githubFetch.js.map +1 -0
- package/apps/web/out/404.html +1 -0
- package/apps/web/out/_next/static/IIw50lkv8jQuwHOBZJifS/_buildManifest.js +1 -0
- package/apps/web/out/_next/static/IIw50lkv8jQuwHOBZJifS/_ssgManifest.js +1 -0
- package/apps/web/out/_next/static/chunks/1dd3208c-6a745fea7bd2124a.js +1 -0
- package/apps/web/out/_next/static/chunks/426-deb95a16531d3b4b.js +25 -0
- package/apps/web/out/_next/static/chunks/528-6e64508688610bfe.js +2 -0
- package/apps/web/out/_next/static/chunks/656-fd1628581ad77b01.js +1 -0
- package/apps/web/out/_next/static/chunks/777-d587bc7cc0fc6be8.js +1 -0
- package/apps/web/out/_next/static/chunks/990-f2445c68c17fa077.js +1 -0
- package/apps/web/out/_next/static/chunks/app/_not-found/page-e0d77774c4eb9aef.js +1 -0
- package/apps/web/out/_next/static/chunks/app/layout-e5023aba6634ce53.js +1 -0
- package/apps/web/out/_next/static/chunks/app/page-a545c902535ac2e3.js +1 -0
- package/apps/web/out/_next/static/chunks/app/settings/page-a68ed4ae2ccb8840.js +1 -0
- package/apps/web/out/_next/static/chunks/app/templates/page-e5f0cefb905e5b72.js +1 -0
- package/apps/web/out/_next/static/chunks/baeaa4ff-28d2e32e4dd119b9.js +1 -0
- package/apps/web/out/_next/static/chunks/eb0351e1-329719bc902eaf71.js +1 -0
- package/apps/web/out/_next/static/chunks/framework-3664cab31236a9fa.js +1 -0
- package/apps/web/out/_next/static/chunks/main-app-d515c42ecb17b8e8.js +1 -0
- package/apps/web/out/_next/static/chunks/main-ff24788874d4ec1b.js +1 -0
- package/apps/web/out/_next/static/chunks/pages/_app-10a93ab5b7c32eb3.js +1 -0
- package/apps/web/out/_next/static/chunks/pages/_error-2d792b2a41857be4.js +1 -0
- package/apps/web/out/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/apps/web/out/_next/static/chunks/webpack-ae7ee8fe97fdceba.js +1 -0
- package/apps/web/out/_next/static/css/0a42edcfc2beb916.css +3 -0
- package/apps/web/out/_next/static/css/a275cc2b185e04f8.css +1 -0
- package/apps/web/out/_next/static/media/011e180705008d6f-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/20535187d867b7b9-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/26d4368bf94c0ec4-s.p.woff2 +0 -0
- package/apps/web/out/_next/static/media/2801417b65625cf5-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/28793f5c5e3d822d-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/5356a6a4f2c8c8d8-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/58f386aa6b1a2a92-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/73cb51aac9c97f90-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/7b19b489dc6743ba-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/7ba5fb2a8c88521c-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/92eeb95d069020cc-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/98e207f02528a563-s.p.woff2 +0 -0
- package/apps/web/out/_next/static/media/99dcf268bda04fe5-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/b3bf17a9041d9433-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/c9c3823090ec8b55-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/d26bbd13d6b70f89-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/d29838c109ef09b4-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/d3ebbfd689654d3a-s.p.woff2 +0 -0
- package/apps/web/out/_next/static/media/db96af6b531dc71f-s.p.woff2 +0 -0
- package/apps/web/out/_next/static/media/e40af3453d7c920a-s.woff2 +0 -0
- package/apps/web/out/_next/static/media/ef4d5661765d0e49-s.woff2 +0 -0
- package/apps/web/out/index.html +1 -0
- package/apps/web/out/index.txt +6 -0
- package/apps/web/out/settings.html +1 -0
- package/apps/web/out/settings.txt +6 -0
- package/apps/web/out/templates.html +1 -0
- package/apps/web/out/templates.txt +6 -0
- package/bin/symbion.mjs +41 -0
- package/node_modules/@symbion/core/dist/adapters/claude.d.ts +3 -0
- package/node_modules/@symbion/core/dist/adapters/claude.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/claude.js +43 -0
- package/node_modules/@symbion/core/dist/adapters/claude.js.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/codex.d.ts +3 -0
- package/node_modules/@symbion/core/dist/adapters/codex.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/codex.js +58 -0
- package/node_modules/@symbion/core/dist/adapters/codex.js.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/registry.d.ts +5 -0
- package/node_modules/@symbion/core/dist/adapters/registry.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/registry.js +14 -0
- package/node_modules/@symbion/core/dist/adapters/registry.js.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/types.d.ts +34 -0
- package/node_modules/@symbion/core/dist/adapters/types.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/adapters/types.js +2 -0
- package/node_modules/@symbion/core/dist/adapters/types.js.map +1 -0
- package/node_modules/@symbion/core/dist/diff/conflict.d.ts +19 -0
- package/node_modules/@symbion/core/dist/diff/conflict.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/diff/conflict.js +20 -0
- package/node_modules/@symbion/core/dist/diff/conflict.js.map +1 -0
- package/node_modules/@symbion/core/dist/diff/diff.d.ts +44 -0
- package/node_modules/@symbion/core/dist/diff/diff.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/diff/diff.js +124 -0
- package/node_modules/@symbion/core/dist/diff/diff.js.map +1 -0
- package/node_modules/@symbion/core/dist/generate/bodyPrompt.d.ts +27 -0
- package/node_modules/@symbion/core/dist/generate/bodyPrompt.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/generate/bodyPrompt.js +55 -0
- package/node_modules/@symbion/core/dist/generate/bodyPrompt.js.map +1 -0
- package/node_modules/@symbion/core/dist/generate/description.d.ts +18 -0
- package/node_modules/@symbion/core/dist/generate/description.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/generate/description.js +164 -0
- package/node_modules/@symbion/core/dist/generate/description.js.map +1 -0
- package/node_modules/@symbion/core/dist/index.d.ts +23 -0
- package/node_modules/@symbion/core/dist/index.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/index.js +24 -0
- package/node_modules/@symbion/core/dist/index.js.map +1 -0
- package/node_modules/@symbion/core/dist/ir/refs.d.ts +11 -0
- package/node_modules/@symbion/core/dist/ir/refs.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/ir/refs.js +25 -0
- package/node_modules/@symbion/core/dist/ir/refs.js.map +1 -0
- package/node_modules/@symbion/core/dist/ir/types.d.ts +107 -0
- package/node_modules/@symbion/core/dist/ir/types.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/ir/types.js +19 -0
- package/node_modules/@symbion/core/dist/ir/types.js.map +1 -0
- package/node_modules/@symbion/core/dist/ir/validate.d.ts +13 -0
- package/node_modules/@symbion/core/dist/ir/validate.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/ir/validate.js +114 -0
- package/node_modules/@symbion/core/dist/ir/validate.js.map +1 -0
- package/node_modules/@symbion/core/dist/parse/scan.d.ts +47 -0
- package/node_modules/@symbion/core/dist/parse/scan.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/parse/scan.js +109 -0
- package/node_modules/@symbion/core/dist/parse/scan.js.map +1 -0
- package/node_modules/@symbion/core/dist/render/frontmatter.d.ts +29 -0
- package/node_modules/@symbion/core/dist/render/frontmatter.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/render/frontmatter.js +99 -0
- package/node_modules/@symbion/core/dist/render/frontmatter.js.map +1 -0
- package/node_modules/@symbion/core/dist/render/marker.d.ts +30 -0
- package/node_modules/@symbion/core/dist/render/marker.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/render/marker.js +48 -0
- package/node_modules/@symbion/core/dist/render/marker.js.map +1 -0
- package/node_modules/@symbion/core/dist/render/render.d.ts +12 -0
- package/node_modules/@symbion/core/dist/render/render.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/render/render.js +10 -0
- package/node_modules/@symbion/core/dist/render/render.js.map +1 -0
- package/node_modules/@symbion/core/dist/runcommand/render.d.ts +13 -0
- package/node_modules/@symbion/core/dist/runcommand/render.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/runcommand/render.js +19 -0
- package/node_modules/@symbion/core/dist/runcommand/render.js.map +1 -0
- package/node_modules/@symbion/core/dist/templates/authorSource.d.ts +55 -0
- package/node_modules/@symbion/core/dist/templates/authorSource.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/templates/authorSource.js +24 -0
- package/node_modules/@symbion/core/dist/templates/authorSource.js.map +1 -0
- package/node_modules/@symbion/core/dist/templates/matchAuthorFolders.d.ts +28 -0
- package/node_modules/@symbion/core/dist/templates/matchAuthorFolders.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/templates/matchAuthorFolders.js +54 -0
- package/node_modules/@symbion/core/dist/templates/matchAuthorFolders.js.map +1 -0
- package/node_modules/@symbion/core/dist/templates/parseTemplate.d.ts +42 -0
- package/node_modules/@symbion/core/dist/templates/parseTemplate.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/templates/parseTemplate.js +56 -0
- package/node_modules/@symbion/core/dist/templates/parseTemplate.js.map +1 -0
- package/node_modules/@symbion/core/dist/templates/templateListItem.d.ts +39 -0
- package/node_modules/@symbion/core/dist/templates/templateListItem.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/templates/templateListItem.js +2 -0
- package/node_modules/@symbion/core/dist/templates/templateListItem.js.map +1 -0
- package/node_modules/@symbion/core/dist/util/sha256.d.ts +9 -0
- package/node_modules/@symbion/core/dist/util/sha256.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/util/sha256.js +91 -0
- package/node_modules/@symbion/core/dist/util/sha256.js.map +1 -0
- package/node_modules/@symbion/core/dist/version/semver.d.ts +18 -0
- package/node_modules/@symbion/core/dist/version/semver.d.ts.map +1 -0
- package/node_modules/@symbion/core/dist/version/semver.js +53 -0
- package/node_modules/@symbion/core/dist/version/semver.js.map +1 -0
- package/node_modules/@symbion/core/package.json +14 -0
- package/node_modules/@symbion/rpc-types/dist/index.d.ts +444 -0
- package/node_modules/@symbion/rpc-types/dist/index.d.ts.map +1 -0
- package/node_modules/@symbion/rpc-types/dist/index.js +2 -0
- package/node_modules/@symbion/rpc-types/dist/index.js.map +1 -0
- package/node_modules/@symbion/rpc-types/package.json +11 -0
- package/node_modules/yaml/dist/cli.d.ts +8 -0
- package/node_modules/yaml/dist/cli.mjs +201 -0
- package/node_modules/yaml/dist/compose/compose-collection.d.ts +11 -0
- package/node_modules/yaml/dist/compose/compose-collection.js +90 -0
- package/node_modules/yaml/dist/compose/compose-doc.d.ts +7 -0
- package/node_modules/yaml/dist/compose/compose-doc.js +45 -0
- package/node_modules/yaml/dist/compose/compose-node.d.ts +29 -0
- package/node_modules/yaml/dist/compose/compose-node.js +112 -0
- package/node_modules/yaml/dist/compose/compose-scalar.d.ts +5 -0
- package/node_modules/yaml/dist/compose/compose-scalar.js +88 -0
- package/node_modules/yaml/dist/compose/composer.d.ts +63 -0
- package/node_modules/yaml/dist/compose/composer.js +224 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-map.js +117 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.d.ts +11 -0
- package/node_modules/yaml/dist/compose/resolve-block-scalar.js +200 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-block-seq.js +51 -0
- package/node_modules/yaml/dist/compose/resolve-end.d.ts +6 -0
- package/node_modules/yaml/dist/compose/resolve-end.js +39 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.d.ts +7 -0
- package/node_modules/yaml/dist/compose/resolve-flow-collection.js +209 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.d.ts +10 -0
- package/node_modules/yaml/dist/compose/resolve-flow-scalar.js +227 -0
- package/node_modules/yaml/dist/compose/resolve-props.d.ts +23 -0
- package/node_modules/yaml/dist/compose/resolve-props.js +148 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-contains-newline.js +36 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.d.ts +2 -0
- package/node_modules/yaml/dist/compose/util-empty-scalar-position.js +28 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.d.ts +3 -0
- package/node_modules/yaml/dist/compose/util-flow-indent-check.js +17 -0
- package/node_modules/yaml/dist/compose/util-map-includes.d.ts +4 -0
- package/node_modules/yaml/dist/compose/util-map-includes.js +15 -0
- package/node_modules/yaml/dist/doc/Document.d.ts +141 -0
- package/node_modules/yaml/dist/doc/Document.js +337 -0
- package/node_modules/yaml/dist/doc/anchors.d.ts +24 -0
- package/node_modules/yaml/dist/doc/anchors.js +76 -0
- package/node_modules/yaml/dist/doc/applyReviver.d.ts +9 -0
- package/node_modules/yaml/dist/doc/applyReviver.js +57 -0
- package/node_modules/yaml/dist/doc/createNode.d.ts +17 -0
- package/node_modules/yaml/dist/doc/createNode.js +90 -0
- package/node_modules/yaml/dist/doc/directives.d.ts +49 -0
- package/node_modules/yaml/dist/doc/directives.js +178 -0
- package/node_modules/yaml/dist/errors.d.ts +21 -0
- package/node_modules/yaml/dist/errors.js +62 -0
- package/node_modules/yaml/dist/index.d.ts +25 -0
- package/node_modules/yaml/dist/index.js +50 -0
- package/node_modules/yaml/dist/log.d.ts +3 -0
- package/node_modules/yaml/dist/log.js +19 -0
- package/node_modules/yaml/dist/nodes/Alias.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/Alias.js +118 -0
- package/node_modules/yaml/dist/nodes/Collection.d.ts +73 -0
- package/node_modules/yaml/dist/nodes/Collection.js +151 -0
- package/node_modules/yaml/dist/nodes/Node.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/Node.js +40 -0
- package/node_modules/yaml/dist/nodes/Pair.d.ts +22 -0
- package/node_modules/yaml/dist/nodes/Pair.js +39 -0
- package/node_modules/yaml/dist/nodes/Scalar.d.ts +47 -0
- package/node_modules/yaml/dist/nodes/Scalar.js +27 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.d.ts +53 -0
- package/node_modules/yaml/dist/nodes/YAMLMap.js +147 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.d.ts +60 -0
- package/node_modules/yaml/dist/nodes/YAMLSeq.js +115 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.d.ts +4 -0
- package/node_modules/yaml/dist/nodes/addPairToJSMap.js +65 -0
- package/node_modules/yaml/dist/nodes/identity.d.ts +23 -0
- package/node_modules/yaml/dist/nodes/identity.js +53 -0
- package/node_modules/yaml/dist/nodes/toJS.d.ts +29 -0
- package/node_modules/yaml/dist/nodes/toJS.js +39 -0
- package/node_modules/yaml/dist/options.d.ts +350 -0
- package/node_modules/yaml/dist/parse/cst-scalar.d.ts +64 -0
- package/node_modules/yaml/dist/parse/cst-scalar.js +218 -0
- package/node_modules/yaml/dist/parse/cst-stringify.d.ts +8 -0
- package/node_modules/yaml/dist/parse/cst-stringify.js +63 -0
- package/node_modules/yaml/dist/parse/cst-visit.d.ts +39 -0
- package/node_modules/yaml/dist/parse/cst-visit.js +99 -0
- package/node_modules/yaml/dist/parse/cst.d.ts +109 -0
- package/node_modules/yaml/dist/parse/cst.js +112 -0
- package/node_modules/yaml/dist/parse/lexer.d.ts +87 -0
- package/node_modules/yaml/dist/parse/lexer.js +723 -0
- package/node_modules/yaml/dist/parse/line-counter.d.ts +22 -0
- package/node_modules/yaml/dist/parse/line-counter.js +41 -0
- package/node_modules/yaml/dist/parse/parser.d.ts +84 -0
- package/node_modules/yaml/dist/parse/parser.js +980 -0
- package/node_modules/yaml/dist/public-api.d.ts +44 -0
- package/node_modules/yaml/dist/public-api.js +107 -0
- package/node_modules/yaml/dist/schema/Schema.d.ts +17 -0
- package/node_modules/yaml/dist/schema/Schema.js +39 -0
- package/node_modules/yaml/dist/schema/common/map.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/map.js +19 -0
- package/node_modules/yaml/dist/schema/common/null.d.ts +4 -0
- package/node_modules/yaml/dist/schema/common/null.js +17 -0
- package/node_modules/yaml/dist/schema/common/seq.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/seq.js +19 -0
- package/node_modules/yaml/dist/schema/common/string.d.ts +2 -0
- package/node_modules/yaml/dist/schema/common/string.js +16 -0
- package/node_modules/yaml/dist/schema/core/bool.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/bool.js +21 -0
- package/node_modules/yaml/dist/schema/core/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/float.js +47 -0
- package/node_modules/yaml/dist/schema/core/int.d.ts +4 -0
- package/node_modules/yaml/dist/schema/core/int.js +42 -0
- package/node_modules/yaml/dist/schema/core/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/core/schema.js +25 -0
- package/node_modules/yaml/dist/schema/json/schema.d.ts +2 -0
- package/node_modules/yaml/dist/schema/json/schema.js +64 -0
- package/node_modules/yaml/dist/schema/json-schema.d.ts +69 -0
- package/node_modules/yaml/dist/schema/tags.d.ts +48 -0
- package/node_modules/yaml/dist/schema/tags.js +99 -0
- package/node_modules/yaml/dist/schema/types.d.ts +92 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.d.ts +2 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/binary.js +70 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.d.ts +7 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/bool.js +29 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.d.ts +4 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/float.js +50 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.d.ts +5 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/int.js +76 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.d.ts +9 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/merge.js +71 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.d.ts +22 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/omap.js +77 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.d.ts +10 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/pairs.js +82 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.d.ts +1 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/schema.js +41 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.d.ts +28 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/set.js +96 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.d.ts +6 -0
- package/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js +105 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.d.ts +34 -0
- package/node_modules/yaml/dist/stringify/foldFlowLines.js +151 -0
- package/node_modules/yaml/dist/stringify/stringify.d.ts +21 -0
- package/node_modules/yaml/dist/stringify/stringify.js +132 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.d.ts +17 -0
- package/node_modules/yaml/dist/stringify/stringifyCollection.js +155 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.d.ts +10 -0
- package/node_modules/yaml/dist/stringify/stringifyComment.js +24 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.d.ts +4 -0
- package/node_modules/yaml/dist/stringify/stringifyDocument.js +87 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.d.ts +2 -0
- package/node_modules/yaml/dist/stringify/stringifyNumber.js +27 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.d.ts +3 -0
- package/node_modules/yaml/dist/stringify/stringifyPair.js +152 -0
- package/node_modules/yaml/dist/stringify/stringifyString.d.ts +9 -0
- package/node_modules/yaml/dist/stringify/stringifyString.js +338 -0
- package/node_modules/yaml/dist/test-events.d.ts +4 -0
- package/node_modules/yaml/dist/test-events.js +134 -0
- package/node_modules/yaml/dist/util.d.ts +16 -0
- package/node_modules/yaml/dist/util.js +28 -0
- package/node_modules/yaml/dist/visit.d.ts +102 -0
- package/node_modules/yaml/dist/visit.js +236 -0
- package/node_modules/yaml/package.json +20 -0
- package/node_modules/yaml/util.js +2 -0
- package/package.json +39 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/rpc/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,eAAe,EACf,WAAW,IAAI,eAAe,EAC9B,cAAc,EACd,eAAe,EACf,gBAAgB,IAAI,oBAAoB,EACxC,oBAAoB,GAMrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D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MAAM;YACT,OAAO,sDAAsD,CAAC;QAChE,KAAK,YAAY;YACf,OAAO,yCAAyC,CAAC;QACnD,KAAK,gBAAgB;YACnB,OAAO,0DAA0D,CAAC;QACpE,KAAK,kBAAkB;YACrB,OAAO,GAAG,CAAC,OAAO,IAAI,mCAAmC,CAAC;QAC5D,KAAK,SAAS,CAAC;QACf,KAAK,SAAS,CAAC;QACf;YACE,OAAO,GAAG,CAAC,OAAO,IAAI,8BAA8B,CAAC;IACzD,CAAC;AACH,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pathStyle.ts — Windows-style path-string detection, used by validatePath
|
|
3
|
+
* and the path-confinement guard to recognize drive-letter/backslash/UNC
|
|
4
|
+
* path shapes regardless of which OS/path-mode Node itself is running in.
|
|
5
|
+
* Pure string logic — does not touch the filesystem.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isWindowsDriveAbsolute(p: string): boolean;
|
|
8
|
+
export declare function isUncPath(p: string): boolean;
|
|
9
|
+
/** True for ANY Windows-style absolute shape (drive-letter OR UNC) — used to decide
|
|
10
|
+
* "should this be treated as absolute" before any node:path call, since node:path's
|
|
11
|
+
* own isAbsolute() is POSIX-mode and blind to both shapes on a Linux/WSL process. */
|
|
12
|
+
export declare function isWindowsStyleAbsolute(p: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Splits a path string on BOTH separators (\ and /), for traversal-segment
|
|
15
|
+
* checking and mixed-separator normalization. Does not collapse empty
|
|
16
|
+
* segments from a leading drive-prefix or UNC double-backslash — callers
|
|
17
|
+
* that need that behavior strip the prefix first (see normalizeWindowsPath).
|
|
18
|
+
*/
|
|
19
|
+
export declare function splitAnySeparator(p: string): string[];
|
|
20
|
+
/**
|
|
21
|
+
* normalizeWindowsPath — for a confirmed drive-absolute path, rewrites to a
|
|
22
|
+
* canonical forward-slash form with an UPPERCASE drive letter, so
|
|
23
|
+
* `c:\Users\me` and `C:/Users/me` compare/resolve identically (EC-3.2).
|
|
24
|
+
* Caller must have already confirmed isWindowsDriveAbsolute(p) is true.
|
|
25
|
+
*/
|
|
26
|
+
export declare function normalizeWindowsPath(p: string): string;
|
|
27
|
+
//# sourceMappingURL=pathStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathStyle.d.ts","sourceRoot":"","sources":["../../src/rpc/pathStyle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAE5C;AAED;;sFAEsF;AACtF,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAItD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pathStyle.ts — Windows-style path-string detection, used by validatePath
|
|
3
|
+
* and the path-confinement guard to recognize drive-letter/backslash/UNC
|
|
4
|
+
* path shapes regardless of which OS/path-mode Node itself is running in.
|
|
5
|
+
* Pure string logic — does not touch the filesystem.
|
|
6
|
+
*/
|
|
7
|
+
/** Drive-letter absolute: C:\... or C:/... or c:\... (case-insensitive). */
|
|
8
|
+
const WINDOWS_DRIVE_ABSOLUTE_RE = /^[A-Za-z]:[\\/]/;
|
|
9
|
+
/** UNC: \\server\share\... (exactly two leading backslashes, then a host segment). */
|
|
10
|
+
const UNC_RE = /^\\\\[^\\/]+[\\/]/;
|
|
11
|
+
export function isWindowsDriveAbsolute(p) {
|
|
12
|
+
return WINDOWS_DRIVE_ABSOLUTE_RE.test(p);
|
|
13
|
+
}
|
|
14
|
+
export function isUncPath(p) {
|
|
15
|
+
return UNC_RE.test(p);
|
|
16
|
+
}
|
|
17
|
+
/** True for ANY Windows-style absolute shape (drive-letter OR UNC) — used to decide
|
|
18
|
+
* "should this be treated as absolute" before any node:path call, since node:path's
|
|
19
|
+
* own isAbsolute() is POSIX-mode and blind to both shapes on a Linux/WSL process. */
|
|
20
|
+
export function isWindowsStyleAbsolute(p) {
|
|
21
|
+
return isWindowsDriveAbsolute(p) || isUncPath(p);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Splits a path string on BOTH separators (\ and /), for traversal-segment
|
|
25
|
+
* checking and mixed-separator normalization. Does not collapse empty
|
|
26
|
+
* segments from a leading drive-prefix or UNC double-backslash — callers
|
|
27
|
+
* that need that behavior strip the prefix first (see normalizeWindowsPath).
|
|
28
|
+
*/
|
|
29
|
+
export function splitAnySeparator(p) {
|
|
30
|
+
return p.split(/[\\/]+/);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* normalizeWindowsPath — for a confirmed drive-absolute path, rewrites to a
|
|
34
|
+
* canonical forward-slash form with an UPPERCASE drive letter, so
|
|
35
|
+
* `c:\Users\me` and `C:/Users/me` compare/resolve identically (EC-3.2).
|
|
36
|
+
* Caller must have already confirmed isWindowsDriveAbsolute(p) is true.
|
|
37
|
+
*/
|
|
38
|
+
export function normalizeWindowsPath(p) {
|
|
39
|
+
const drive = (p[0] ?? "").toUpperCase();
|
|
40
|
+
const rest = p.slice(2).replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
41
|
+
return `${drive}:${rest.startsWith("/") ? rest : "/" + rest}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=pathStyle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathStyle.js","sourceRoot":"","sources":["../../src/rpc/pathStyle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAEpD,sFAAsF;AACtF,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,MAAM,UAAU,sBAAsB,CAAC,CAAS;IAC9C,OAAO,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC;AAED;;sFAEsF;AACtF,MAAM,UAAU,sBAAsB,CAAC,CAAS;IAC9C,OAAO,sBAAsB,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,CAAS;IACzC,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,CAAS;IAC5C,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjE,OAAO,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RpcError — the single error type every RPC handler throws to signal a
|
|
3
|
+
* clean, mapped error (server.ts catches it and emits {code, message} as a
|
|
4
|
+
* 400 response body; anything else falls through to a generic 500). Lives in
|
|
5
|
+
* its own module (rather than rpc/handlers.ts, where it was originally
|
|
6
|
+
* defined) so non-handler fs modules (e.g. fs/listDir.ts) can throw it
|
|
7
|
+
* without creating a circular import with rpc/handlers.ts.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RpcError extends Error {
|
|
10
|
+
code: string;
|
|
11
|
+
constructor(code: string, message: string);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=rpcError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcError.d.ts","sourceRoot":"","sources":["../../src/rpc/rpcError.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACd,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAGjD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RpcError — the single error type every RPC handler throws to signal a
|
|
3
|
+
* clean, mapped error (server.ts catches it and emits {code, message} as a
|
|
4
|
+
* 400 response body; anything else falls through to a generic 500). Lives in
|
|
5
|
+
* its own module (rather than rpc/handlers.ts, where it was originally
|
|
6
|
+
* defined) so non-handler fs modules (e.g. fs/listDir.ts) can throw it
|
|
7
|
+
* without creating a circular import with rpc/handlers.ts.
|
|
8
|
+
*/
|
|
9
|
+
export class RpcError extends Error {
|
|
10
|
+
code;
|
|
11
|
+
constructor(code, message) {
|
|
12
|
+
super(message);
|
|
13
|
+
this.code = code;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=rpcError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcError.js","sourceRoot":"","sources":["../../src/rpc/rpcError.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACd;IAAnB,YAAmB,IAAY,EAAE,OAAe;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;QADE,SAAI,GAAJ,IAAI,CAAQ;IAE/B,CAAC;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface DaemonServerOptions {
|
|
2
|
+
port: number;
|
|
3
|
+
version: string;
|
|
4
|
+
/** absolute path to the built apps/web static export (`apps/web/out`); undefined in dev/test. */
|
|
5
|
+
webStaticRoot?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DaemonServerHandle {
|
|
8
|
+
port: number;
|
|
9
|
+
token: string;
|
|
10
|
+
close: () => Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* startServer — binds 127.0.0.1 ONLY (never 0.0.0.0). Every mutating RPC requires
|
|
14
|
+
* the per-boot session token; Origin/Host are allowlisted as defense-in-depth
|
|
15
|
+
* against DNS-rebinding (STATE §1.4 / CLAUDE.md filesystem-safety mandate).
|
|
16
|
+
*/
|
|
17
|
+
export declare function startServer(opts: DaemonServerOptions): Promise<DaemonServerHandle>;
|
|
18
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAiGA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,iGAAiG;IACjG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAoCD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyFlF"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { randomBytes } from "node:crypto";
|
|
3
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
4
|
+
import { extname, join, normalize, resolve } from "node:path";
|
|
5
|
+
import { handlers, RpcError } from "./rpc/handlers.js";
|
|
6
|
+
const MIME_TYPES = {
|
|
7
|
+
".html": "text/html; charset=utf-8",
|
|
8
|
+
".js": "text/javascript; charset=utf-8",
|
|
9
|
+
".css": "text/css; charset=utf-8",
|
|
10
|
+
".json": "application/json; charset=utf-8",
|
|
11
|
+
".svg": "image/svg+xml",
|
|
12
|
+
".png": "image/png",
|
|
13
|
+
".ico": "image/x-icon",
|
|
14
|
+
".txt": "text/plain; charset=utf-8",
|
|
15
|
+
".woff2": "font/woff2",
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* serveStaticFile — serves the built `apps/web` static export (STATE §1.3: "daemon
|
|
19
|
+
* ... serves the built apps/web static export"). Path-confined to `webRoot`; only
|
|
20
|
+
* ever reads, never writes. Falls back to index.html for SPA-style routes.
|
|
21
|
+
*/
|
|
22
|
+
function serveStaticFile(webRoot, urlPath, res) {
|
|
23
|
+
const cleanPath = urlPath.split("?")[0] ?? "/";
|
|
24
|
+
const relPath = cleanPath === "/" ? "index.html" : cleanPath.replace(/^\//, "");
|
|
25
|
+
const root = resolve(webRoot);
|
|
26
|
+
let absPath = normalize(join(root, relPath));
|
|
27
|
+
if (!absPath.startsWith(root)) {
|
|
28
|
+
res.writeHead(403);
|
|
29
|
+
res.end("Forbidden");
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
if (!existsSync(absPath) || statSync(absPath).isDirectory()) {
|
|
33
|
+
// Next.js static export emits one .html file per route (e.g. `templates.html`,
|
|
34
|
+
// `settings.html`) rather than nested `index.html` per directory. For an
|
|
35
|
+
// extensionless request whose literal path doesn't exist, try `<path>.html`
|
|
36
|
+
// first so each route resolves to its own page bundle; only fall back to the
|
|
37
|
+
// app shell's index.html (SPA-style) if that also doesn't exist.
|
|
38
|
+
const htmlPath = join(root, `${relPath}.html`);
|
|
39
|
+
absPath = existsSync(htmlPath) ? htmlPath : join(root, "index.html");
|
|
40
|
+
}
|
|
41
|
+
if (!existsSync(absPath))
|
|
42
|
+
return false;
|
|
43
|
+
const ext = extname(absPath);
|
|
44
|
+
res.writeHead(200, { "Content-Type": MIME_TYPES[ext] ?? "application/octet-stream" });
|
|
45
|
+
res.end(readFileSync(absPath));
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
const READ_ONLY_METHODS = new Set([
|
|
49
|
+
"ping",
|
|
50
|
+
"browseFolder",
|
|
51
|
+
"validatePath",
|
|
52
|
+
"listDir",
|
|
53
|
+
"listProjects",
|
|
54
|
+
"loadProject",
|
|
55
|
+
"scanClaudeDir",
|
|
56
|
+
"render",
|
|
57
|
+
"computeDiff",
|
|
58
|
+
"gitStatus",
|
|
59
|
+
"renderRunCommand",
|
|
60
|
+
// listModels does not write to the project's managed files (no fs mutation). For the 3
|
|
61
|
+
// cloud providers it is still a synchronous, instant, zero-network-call lookup of a
|
|
62
|
+
// hardcoded list; for Ollama it now performs a real, timeout-bounded `GET /api/tags`
|
|
63
|
+
// network call against the local Ollama instance (docs/loops/ollama-dynamic-models-STATE.md
|
|
64
|
+
// §6.5) — "read-only" here means "no fs mutation," not "free"/"local-only"/"synchronous,"
|
|
65
|
+
// same conceptual category checkProviderStatus/generateBody already occupy below.
|
|
66
|
+
"listModels",
|
|
67
|
+
// generateBody is deliberately NOT in this set: it performs an outbound network call
|
|
68
|
+
// (real-world side effect with cost), even though it does not touch the filesystem.
|
|
69
|
+
// This only affects which methods are conceptually labeled "read-only" for future use,
|
|
70
|
+
// not auth — every non-ping method already requires the token regardless of this set's
|
|
71
|
+
// membership (see the `method !== "ping"` check below). STATE §10.1.
|
|
72
|
+
// checkProviderStatus also performs an outbound network call (a liveness ping to
|
|
73
|
+
// Ollama's loopback port, or an authenticated cheap call to a cloud provider), same
|
|
74
|
+
// rationale as generateBody — labeled here as conceptually read-only (no fs mutation)
|
|
75
|
+
// even though it's not "free" like listModels.
|
|
76
|
+
"checkProviderStatus",
|
|
77
|
+
// listProviders reads providers.json but performs no mutation — same rationale as
|
|
78
|
+
// listModels's membership here (docs/loops/multi-provider-settings-STATE.md §3.2).
|
|
79
|
+
// saveProviderKey/clearProviderKey/setActiveProvider are deliberately NOT in this set —
|
|
80
|
+
// they mutate providers.json and still require the session token like every other
|
|
81
|
+
// non-ping/non-read-only method (no change to the auth gate itself, just correct set
|
|
82
|
+
// membership for the new methods).
|
|
83
|
+
"listProviders",
|
|
84
|
+
// fetchAuthorTemplates (templates-authors v2) performs outbound network calls
|
|
85
|
+
// (GitHub tree API + per-file raw.githubusercontent.com fetches) but writes
|
|
86
|
+
// nothing to disk — same "outbound-network-but-no-disk-write" classification
|
|
87
|
+
// as listModels/checkProviderStatus above (docs/loops/templates-authors-STATE.md
|
|
88
|
+
// PLAN §P2).
|
|
89
|
+
"fetchAuthorTemplates",
|
|
90
|
+
]);
|
|
91
|
+
function generateToken() {
|
|
92
|
+
return randomBytes(32).toString("hex");
|
|
93
|
+
}
|
|
94
|
+
function isAllowedHost(headerValue, port) {
|
|
95
|
+
if (!headerValue)
|
|
96
|
+
return false;
|
|
97
|
+
// Accept bare "127.0.0.1:<port>" / "localhost:<port>" Origin or Host headers only.
|
|
98
|
+
const allowed = new Set([
|
|
99
|
+
`127.0.0.1:${port}`,
|
|
100
|
+
`localhost:${port}`,
|
|
101
|
+
`http://127.0.0.1:${port}`,
|
|
102
|
+
`http://localhost:${port}`,
|
|
103
|
+
]);
|
|
104
|
+
return allowed.has(headerValue);
|
|
105
|
+
}
|
|
106
|
+
function readBody(req) {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
let data = "";
|
|
109
|
+
req.on("data", (chunk) => (data += chunk));
|
|
110
|
+
req.on("end", () => resolve(data));
|
|
111
|
+
req.on("error", reject);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function sendJson(res, status, body) {
|
|
115
|
+
const payload = JSON.stringify(body);
|
|
116
|
+
res.writeHead(status, {
|
|
117
|
+
"Content-Type": "application/json",
|
|
118
|
+
"Content-Length": Buffer.byteLength(payload),
|
|
119
|
+
});
|
|
120
|
+
res.end(payload);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* startServer — binds 127.0.0.1 ONLY (never 0.0.0.0). Every mutating RPC requires
|
|
124
|
+
* the per-boot session token; Origin/Host are allowlisted as defense-in-depth
|
|
125
|
+
* against DNS-rebinding (STATE §1.4 / CLAUDE.md filesystem-safety mandate).
|
|
126
|
+
*/
|
|
127
|
+
export function startServer(opts) {
|
|
128
|
+
const token = generateToken();
|
|
129
|
+
const server = createServer(async (req, res) => {
|
|
130
|
+
if (req.method === "GET" && opts.webStaticRoot) {
|
|
131
|
+
const served = serveStaticFile(opts.webStaticRoot, req.url ?? "/", res);
|
|
132
|
+
if (served)
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (req.method !== "POST" || req.url !== "/rpc") {
|
|
136
|
+
sendJson(res, 404, { error: { code: "not-found", message: "Not found" } });
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const origin = req.headers["origin"];
|
|
140
|
+
const host = req.headers["host"];
|
|
141
|
+
if (origin !== undefined && !isAllowedHost(origin, opts.port)) {
|
|
142
|
+
sendJson(res, 403, { error: { code: "origin-rejected", message: "Origin không hợp lệ." } });
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (!isAllowedHost(host, opts.port)) {
|
|
146
|
+
sendJson(res, 403, { error: { code: "host-rejected", message: "Host không hợp lệ." } });
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
let body;
|
|
150
|
+
try {
|
|
151
|
+
body = JSON.parse(await readBody(req));
|
|
152
|
+
}
|
|
153
|
+
catch {
|
|
154
|
+
sendJson(res, 400, { error: { code: "bad-json", message: "JSON không hợp lệ." } });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const method = body.method;
|
|
158
|
+
if (!method || !(method in handlers)) {
|
|
159
|
+
sendJson(res, 400, { error: { code: "unknown-method", message: `Unknown method: ${method}` } });
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const isReadOnly = READ_ONLY_METHODS.has(method);
|
|
163
|
+
const authHeader = req.headers["x-symbion-token"];
|
|
164
|
+
if (!isReadOnly || method !== "ping") {
|
|
165
|
+
// ping is allowed without a token (used for initial connectivity probing);
|
|
166
|
+
// every other method — including all read-only ones — requires the token,
|
|
167
|
+
// since even read methods can read arbitrary filesystem paths.
|
|
168
|
+
if (authHeader !== token) {
|
|
169
|
+
sendJson(res, 401, { error: { code: "unauthorized", message: "Thiếu hoặc sai session token." } });
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const handlerFn = handlers[method];
|
|
175
|
+
// Default params to {} when the client omits the `params` key entirely
|
|
176
|
+
// (not just when params.path is missing/wrong-type) — every handler
|
|
177
|
+
// destructures/accesses fields off `params` directly, so an `undefined`
|
|
178
|
+
// params object throws a bare TypeError before any handler-level
|
|
179
|
+
// invalid-params validation runs, producing a misleading 500
|
|
180
|
+
// internal-error instead of 400 invalid-params. `ping`'s `_params` is
|
|
181
|
+
// unused so this default is a no-op for it.
|
|
182
|
+
const params = body.params ?? {};
|
|
183
|
+
const result = await handlerFn(params, { port: opts.port, version: opts.version });
|
|
184
|
+
sendJson(res, 200, result);
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
if (err instanceof RpcError) {
|
|
188
|
+
sendJson(res, 400, { error: { code: err.code, message: err.message } });
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
sendJson(res, 500, { error: { code: "internal-error", message: err.message } });
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return new Promise((resolve, reject) => {
|
|
195
|
+
server.once("error", reject);
|
|
196
|
+
// Bind 127.0.0.1 ONLY — never 0.0.0.0 (no LAN exposure).
|
|
197
|
+
server.listen(opts.port, "127.0.0.1", () => {
|
|
198
|
+
resolve({
|
|
199
|
+
port: opts.port,
|
|
200
|
+
token,
|
|
201
|
+
close: () => new Promise((res) => {
|
|
202
|
+
server.close(() => res());
|
|
203
|
+
}),
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA6C,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGvD,MAAM,UAAU,GAA2B;IACzC,OAAO,EAAE,0BAA0B;IACnC,KAAK,EAAE,gCAAgC;IACvC,MAAM,EAAE,yBAAyB;IACjC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,eAAe;IACvB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,2BAA2B;IACnC,QAAQ,EAAE,YAAY;CACvB,CAAC;AAEF;;;;GAIG;AACH,SAAS,eAAe,CAAC,OAAe,EAAE,OAAe,EAAE,GAAmB;IAC5E,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC/C,MAAM,OAAO,GAAG,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChF,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,IAAI,OAAO,GAAG,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,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC7B,yDAAyD;QACzD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;YACzC,OAAO,CAAC;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,KAAK;gBACL,KAAK,EAAE,GAAG,EAAE,CACV,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,EAAE;oBACxB,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;gBAC5B,CAAC,CAAC;aACL,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PublishLogEntry } from "@symbion/core";
|
|
2
|
+
export declare function publishLogPath(projectRoot: string): string;
|
|
3
|
+
export declare function readPublishLog(projectRoot: string): PublishLogEntry[];
|
|
4
|
+
/** append-only: read existing log, push the new entry, atomic-write back. */
|
|
5
|
+
export declare function appendPublishLogEntry(projectRoot: string, entry: PublishLogEntry): void;
|
|
6
|
+
//# sourceMappingURL=publishLog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishLog.d.ts","sourceRoot":"","sources":["../../src/store/publishLog.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,EAAE,CAQrE;AAED,6EAA6E;AAC7E,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,IAAI,CASvF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
export function publishLogPath(projectRoot) {
|
|
4
|
+
return join(projectRoot, ".symbion", "publish-log.json");
|
|
5
|
+
}
|
|
6
|
+
export function readPublishLog(projectRoot) {
|
|
7
|
+
const absPath = publishLogPath(projectRoot);
|
|
8
|
+
if (!existsSync(absPath))
|
|
9
|
+
return [];
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(readFileSync(absPath, "utf-8"));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** append-only: read existing log, push the new entry, atomic-write back. */
|
|
18
|
+
export function appendPublishLogEntry(projectRoot, entry) {
|
|
19
|
+
const absPath = publishLogPath(projectRoot);
|
|
20
|
+
const existing = readPublishLog(projectRoot);
|
|
21
|
+
existing.push(entry);
|
|
22
|
+
mkdirSync(dirname(absPath), { recursive: true });
|
|
23
|
+
const tempPath = `${absPath}.symbion-tmp-${process.pid}-${Date.now()}`;
|
|
24
|
+
writeFileSync(tempPath, JSON.stringify(existing, null, 2), "utf-8");
|
|
25
|
+
renameSync(tempPath, absPath);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=publishLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishLog.js","sourceRoot":"","sources":["../../src/store/publishLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,OAAO,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,kBAAkB,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAsB,CAAC;IACzE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,qBAAqB,CAAC,WAAmB,EAAE,KAAsB;IAC/E,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,cAAc,CAAC,WAAW,CAAC,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAErB,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,GAAG,OAAO,gBAAgB,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACvE,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACpE,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type GlobalConfig, type ProjectStore } from "@symbion/core";
|
|
2
|
+
export declare class UnsupportedSchemaVersionError extends Error {
|
|
3
|
+
constructor(found: number);
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* atomicWriteJson — mkdir-recursive + temp-file write + rename. Exported (not
|
|
7
|
+
* just module-local) so other daemon-only modules that own their own JSON
|
|
8
|
+
* file under globalConfigDir() (e.g. llm/secrets.ts's providers.json) reuse
|
|
9
|
+
* this exact primitive instead of re-implementing temp->rename semantics —
|
|
10
|
+
* one write-primitive, not two (docs/loops/multi-provider-settings-STATE.md §3.2).
|
|
11
|
+
*
|
|
12
|
+
* `mode` (optional) chmods the temp file BEFORE the rename so the final file
|
|
13
|
+
* never has a window where it's readable by more than the intended mode
|
|
14
|
+
* (e.g. 0o600 for secrets) — chmod-after-rename would leave a brief window
|
|
15
|
+
* with default (typically 0o644) permissions.
|
|
16
|
+
*
|
|
17
|
+
* `dirMode` (optional) additionally chmods the containing directory — used
|
|
18
|
+
* by secrets.ts so `~/.config/symbion/` itself isn't left world-readable
|
|
19
|
+
* (0o755 from the process umask) even though the secrets file inside it is
|
|
20
|
+
* 0o600, per the /cso review's directory-permissions finding.
|
|
21
|
+
*/
|
|
22
|
+
export declare function atomicWriteJson(absPath: string, data: unknown, opts?: {
|
|
23
|
+
mode?: number;
|
|
24
|
+
dirMode?: number;
|
|
25
|
+
}): void;
|
|
26
|
+
export declare function projectStorePath(projectRoot: string): string;
|
|
27
|
+
export declare function projectStoreExists(projectRoot: string): boolean;
|
|
28
|
+
export declare function loadProjectStore(projectRoot: string): ProjectStore;
|
|
29
|
+
export declare function saveProjectStore(projectRoot: string, store: ProjectStore): void;
|
|
30
|
+
export declare function createProjectStore(projectRoot: string, name: string, id: string): ProjectStore;
|
|
31
|
+
export declare function globalConfigDir(): string;
|
|
32
|
+
export declare function globalConfigPath(): string;
|
|
33
|
+
export declare function loadGlobalConfig(): GlobalConfig;
|
|
34
|
+
export declare function saveGlobalConfig(config: GlobalConfig): void;
|
|
35
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store/store.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAIvB,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,KAAK,EAAE,MAAM;CAI1B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,EACb,IAAI,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACzC,IAAI,CAYN;AASD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAE/D;AAkBD,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,CAKlE;AAED,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,CAE/E;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAY9F;AAID,wBAAgB,eAAe,IAAI,MAAM,CAOxC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAgBD,wBAAgB,gBAAgB,IAAI,YAAY,CAU/C;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAE3D"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { DEFAULT_GLOBAL_CONFIG, DEFAULT_PROJECT_SETTINGS, } from "@symbion/core";
|
|
5
|
+
const CURRENT_SCHEMA_VERSION = 1;
|
|
6
|
+
export class UnsupportedSchemaVersionError extends Error {
|
|
7
|
+
constructor(found) {
|
|
8
|
+
super(`store.json được tạo bởi phiên bản Symbion mới hơn (schemaVersion=${found}). Từ chối ghi đè.`);
|
|
9
|
+
this.name = "UnsupportedSchemaVersionError";
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* atomicWriteJson — mkdir-recursive + temp-file write + rename. Exported (not
|
|
14
|
+
* just module-local) so other daemon-only modules that own their own JSON
|
|
15
|
+
* file under globalConfigDir() (e.g. llm/secrets.ts's providers.json) reuse
|
|
16
|
+
* this exact primitive instead of re-implementing temp->rename semantics —
|
|
17
|
+
* one write-primitive, not two (docs/loops/multi-provider-settings-STATE.md §3.2).
|
|
18
|
+
*
|
|
19
|
+
* `mode` (optional) chmods the temp file BEFORE the rename so the final file
|
|
20
|
+
* never has a window where it's readable by more than the intended mode
|
|
21
|
+
* (e.g. 0o600 for secrets) — chmod-after-rename would leave a brief window
|
|
22
|
+
* with default (typically 0o644) permissions.
|
|
23
|
+
*
|
|
24
|
+
* `dirMode` (optional) additionally chmods the containing directory — used
|
|
25
|
+
* by secrets.ts so `~/.config/symbion/` itself isn't left world-readable
|
|
26
|
+
* (0o755 from the process umask) even though the secrets file inside it is
|
|
27
|
+
* 0o600, per the /cso review's directory-permissions finding.
|
|
28
|
+
*/
|
|
29
|
+
export function atomicWriteJson(absPath, data, opts) {
|
|
30
|
+
const dir = dirname(absPath);
|
|
31
|
+
mkdirSync(dir, { recursive: true });
|
|
32
|
+
if (opts?.dirMode !== undefined) {
|
|
33
|
+
chmodSync(dir, opts.dirMode);
|
|
34
|
+
}
|
|
35
|
+
const tempPath = `${absPath}.symbion-tmp-${process.pid}-${Date.now()}`;
|
|
36
|
+
writeFileSync(tempPath, JSON.stringify(data, null, 2), "utf-8");
|
|
37
|
+
if (opts?.mode !== undefined) {
|
|
38
|
+
chmodSync(tempPath, opts.mode);
|
|
39
|
+
}
|
|
40
|
+
renameSync(tempPath, absPath);
|
|
41
|
+
}
|
|
42
|
+
function backupBeforeMigrate(absPath, raw) {
|
|
43
|
+
const backupPath = `${absPath}.bak-pre-migrate-${Date.now()}`;
|
|
44
|
+
writeFileSync(backupPath, raw, "utf-8");
|
|
45
|
+
}
|
|
46
|
+
// ---------- Per-project store ----------
|
|
47
|
+
export function projectStorePath(projectRoot) {
|
|
48
|
+
return join(projectRoot, ".symbion", "store.json");
|
|
49
|
+
}
|
|
50
|
+
export function projectStoreExists(projectRoot) {
|
|
51
|
+
return existsSync(projectStorePath(projectRoot));
|
|
52
|
+
}
|
|
53
|
+
function migrateProjectStore(raw, absPath, rawText) {
|
|
54
|
+
const schemaVersion = raw["schemaVersion"];
|
|
55
|
+
if (typeof schemaVersion !== "number") {
|
|
56
|
+
throw new Error("store.json thiếu schemaVersion.");
|
|
57
|
+
}
|
|
58
|
+
if (schemaVersion > CURRENT_SCHEMA_VERSION) {
|
|
59
|
+
throw new UnsupportedSchemaVersionError(schemaVersion);
|
|
60
|
+
}
|
|
61
|
+
if (schemaVersion < CURRENT_SCHEMA_VERSION) {
|
|
62
|
+
backupBeforeMigrate(absPath, rawText);
|
|
63
|
+
// No migrate_v(n->n+1) transforms defined yet (schemaVersion is still 1 in v1) —
|
|
64
|
+
// chain point reserved here for future schema bumps.
|
|
65
|
+
}
|
|
66
|
+
return raw;
|
|
67
|
+
}
|
|
68
|
+
export function loadProjectStore(projectRoot) {
|
|
69
|
+
const absPath = projectStorePath(projectRoot);
|
|
70
|
+
const rawText = readFileSync(absPath, "utf-8");
|
|
71
|
+
const raw = JSON.parse(rawText);
|
|
72
|
+
return migrateProjectStore(raw, absPath, rawText);
|
|
73
|
+
}
|
|
74
|
+
export function saveProjectStore(projectRoot, store) {
|
|
75
|
+
atomicWriteJson(projectStorePath(projectRoot), store);
|
|
76
|
+
}
|
|
77
|
+
export function createProjectStore(projectRoot, name, id) {
|
|
78
|
+
const store = {
|
|
79
|
+
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
80
|
+
id,
|
|
81
|
+
name,
|
|
82
|
+
path: projectRoot,
|
|
83
|
+
createdAt: new Date().toISOString(),
|
|
84
|
+
artifacts: [],
|
|
85
|
+
settings: { ...DEFAULT_PROJECT_SETTINGS },
|
|
86
|
+
};
|
|
87
|
+
saveProjectStore(projectRoot, store);
|
|
88
|
+
return store;
|
|
89
|
+
}
|
|
90
|
+
// ---------- User-level global config ----------
|
|
91
|
+
export function globalConfigDir() {
|
|
92
|
+
// SYMBION_CONFIG_DIR override exists solely for test isolation (Vitest integration
|
|
93
|
+
// tests run against temp dirs, never the real ~/.config/symbion).
|
|
94
|
+
if (process.env["SYMBION_CONFIG_DIR"]) {
|
|
95
|
+
return process.env["SYMBION_CONFIG_DIR"];
|
|
96
|
+
}
|
|
97
|
+
return join(homedir(), ".config", "symbion");
|
|
98
|
+
}
|
|
99
|
+
export function globalConfigPath() {
|
|
100
|
+
return join(globalConfigDir(), "config.json");
|
|
101
|
+
}
|
|
102
|
+
function migrateGlobalConfig(raw, absPath, rawText) {
|
|
103
|
+
const schemaVersion = raw["schemaVersion"];
|
|
104
|
+
if (typeof schemaVersion !== "number") {
|
|
105
|
+
throw new Error("config.json thiếu schemaVersion.");
|
|
106
|
+
}
|
|
107
|
+
if (schemaVersion > CURRENT_SCHEMA_VERSION) {
|
|
108
|
+
throw new UnsupportedSchemaVersionError(schemaVersion);
|
|
109
|
+
}
|
|
110
|
+
if (schemaVersion < CURRENT_SCHEMA_VERSION) {
|
|
111
|
+
backupBeforeMigrate(absPath, rawText);
|
|
112
|
+
}
|
|
113
|
+
return raw;
|
|
114
|
+
}
|
|
115
|
+
export function loadGlobalConfig() {
|
|
116
|
+
const absPath = globalConfigPath();
|
|
117
|
+
if (!existsSync(absPath)) {
|
|
118
|
+
const fresh = { ...DEFAULT_GLOBAL_CONFIG, projects: [] };
|
|
119
|
+
atomicWriteJson(absPath, fresh);
|
|
120
|
+
return fresh;
|
|
121
|
+
}
|
|
122
|
+
const rawText = readFileSync(absPath, "utf-8");
|
|
123
|
+
const raw = JSON.parse(rawText);
|
|
124
|
+
return migrateGlobalConfig(raw, absPath, rawText);
|
|
125
|
+
}
|
|
126
|
+
export function saveGlobalConfig(config) {
|
|
127
|
+
atomicWriteJson(globalConfigPath(), config);
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=store.js.map
|