@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,47 @@
|
|
|
1
|
+
import type { ArtifactKind, CanonicalArtifact } from "../ir/types.js";
|
|
2
|
+
export interface ParsedClaudeFile {
|
|
3
|
+
artifact: CanonicalArtifact;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* parseClaudeFile — parse a single `.md` file's raw content into a CanonicalArtifact.
|
|
7
|
+
* `name` and `kind` are derived from the file's relative path (filename = name; directory
|
|
8
|
+
* (agents/ vs commands/) determines kind) per STATE §2.5 / E4 (filename always derived from name on render,
|
|
9
|
+
* but on import the filename IS the source of truth for name).
|
|
10
|
+
*
|
|
11
|
+
* Throws on invalid frontmatter — caller (scanClaudeDir / markdown-tab sync) catches this for E3.
|
|
12
|
+
*/
|
|
13
|
+
export declare function parseClaudeFile(raw: string, opts: {
|
|
14
|
+
name: string;
|
|
15
|
+
kind: ArtifactKind;
|
|
16
|
+
id?: string;
|
|
17
|
+
nowIso?: string;
|
|
18
|
+
}): CanonicalArtifact;
|
|
19
|
+
export interface SkippedFile {
|
|
20
|
+
relPath: string;
|
|
21
|
+
reason: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ParsedClaudeDir {
|
|
24
|
+
agents: CanonicalArtifact[];
|
|
25
|
+
commands: CanonicalArtifact[];
|
|
26
|
+
/** read-only in v1 — file contents passed through for display only. */
|
|
27
|
+
hooks: Array<{
|
|
28
|
+
relPath: string;
|
|
29
|
+
content: string;
|
|
30
|
+
}>;
|
|
31
|
+
settings?: {
|
|
32
|
+
relPath: string;
|
|
33
|
+
content: string;
|
|
34
|
+
};
|
|
35
|
+
skipped: SkippedFile[];
|
|
36
|
+
}
|
|
37
|
+
export interface ClaudeDirFileMap {
|
|
38
|
+
/** relPath (e.g. ".claude/agents/ba.md") -> file content */
|
|
39
|
+
[relPath: string]: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* parseClaudeDir — pure: given a filemap of relPath -> content (daemon reads disk
|
|
43
|
+
* and passes contents in), parse into IR. Unparseable files land in `skipped[]`
|
|
44
|
+
* with a human reason (E3), never thrown.
|
|
45
|
+
*/
|
|
46
|
+
export declare function parseClaudeDir(filemap: ClaudeDirFileMap): ParsedClaudeDir;
|
|
47
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/parse/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAMtE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACvE,iBAAiB,CAyCnB;AAgBD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,uEAAuE;IACvE,KAAK,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAC3B;AAOD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,eAAe,CAmCzE"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { parseFrontmatter } from "../render/frontmatter.js";
|
|
2
|
+
import { parseMarker } from "../render/marker.js";
|
|
3
|
+
const FRONTMATTER_RE = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;
|
|
4
|
+
/**
|
|
5
|
+
* parseClaudeFile — parse a single `.md` file's raw content into a CanonicalArtifact.
|
|
6
|
+
* `name` and `kind` are derived from the file's relative path (filename = name; directory
|
|
7
|
+
* (agents/ vs commands/) determines kind) per STATE §2.5 / E4 (filename always derived from name on render,
|
|
8
|
+
* but on import the filename IS the source of truth for name).
|
|
9
|
+
*
|
|
10
|
+
* Throws on invalid frontmatter — caller (scanClaudeDir / markdown-tab sync) catches this for E3.
|
|
11
|
+
*/
|
|
12
|
+
export function parseClaudeFile(raw, opts) {
|
|
13
|
+
const match = FRONTMATTER_RE.exec(raw);
|
|
14
|
+
if (!match) {
|
|
15
|
+
throw new Error("File thiếu frontmatter (--- ... ---).");
|
|
16
|
+
}
|
|
17
|
+
const [, fmRaw, bodyRaw] = match;
|
|
18
|
+
const fm = parseFrontmatter(fmRaw);
|
|
19
|
+
// Strip any trailing managed marker from the body before storing as IR body.
|
|
20
|
+
const marker = parseMarker(raw);
|
|
21
|
+
let body = (bodyRaw ?? "").replace(/\n*<!--\s*managed-by:[\s\S]*?-->\s*$/, "");
|
|
22
|
+
body = body.replace(/\n+$/, "").replace(/^\n+/, "");
|
|
23
|
+
const now = opts.nowIso ?? new Date().toISOString();
|
|
24
|
+
const artifact = {
|
|
25
|
+
id: marker?.id ?? opts.id ?? cryptoRandomId(),
|
|
26
|
+
kind: opts.kind,
|
|
27
|
+
name: opts.name,
|
|
28
|
+
description: fm.description,
|
|
29
|
+
body,
|
|
30
|
+
meta: {
|
|
31
|
+
version: marker?.version ?? "draft",
|
|
32
|
+
status: marker ? "published" : "draft",
|
|
33
|
+
createdAt: now,
|
|
34
|
+
updatedAt: now,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
if (opts.kind === "agent" && fm.tools) {
|
|
38
|
+
artifact.tools = fm.tools;
|
|
39
|
+
}
|
|
40
|
+
if (opts.kind === "command") {
|
|
41
|
+
artifact.usesArguments = body.includes("$ARGUMENTS");
|
|
42
|
+
}
|
|
43
|
+
if (fm.customFields.length > 0) {
|
|
44
|
+
artifact.customFields = fm.customFields;
|
|
45
|
+
}
|
|
46
|
+
return artifact;
|
|
47
|
+
}
|
|
48
|
+
/** Minimal dependency-free random id generator (UUID v4-ish) — pure, no Node `crypto`. */
|
|
49
|
+
function cryptoRandomId() {
|
|
50
|
+
const hex = () => Math.floor(Math.random() * 16).toString(16);
|
|
51
|
+
const tpl = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
|
52
|
+
let i = 0;
|
|
53
|
+
return tpl.replace(/[xy]/g, (c) => {
|
|
54
|
+
i++;
|
|
55
|
+
if (c === "y") {
|
|
56
|
+
return ((Math.floor(Math.random() * 4) + 8) % 16).toString(16);
|
|
57
|
+
}
|
|
58
|
+
return hex();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const AGENT_PATH_RE = /^\.claude\/agents\/([^/]+)\.md$/;
|
|
62
|
+
const COMMAND_PATH_RE = /^\.claude\/commands\/([^/]+)\.md$/;
|
|
63
|
+
const HOOK_PATH_RE = /^\.claude\/hooks\/(.+)$/;
|
|
64
|
+
const SETTINGS_PATH_RE = /^\.claude\/settings\.json$/;
|
|
65
|
+
/**
|
|
66
|
+
* parseClaudeDir — pure: given a filemap of relPath -> content (daemon reads disk
|
|
67
|
+
* and passes contents in), parse into IR. Unparseable files land in `skipped[]`
|
|
68
|
+
* with a human reason (E3), never thrown.
|
|
69
|
+
*/
|
|
70
|
+
export function parseClaudeDir(filemap) {
|
|
71
|
+
const agents = [];
|
|
72
|
+
const commands = [];
|
|
73
|
+
const hooks = [];
|
|
74
|
+
const skipped = [];
|
|
75
|
+
let settings;
|
|
76
|
+
for (const [relPath, content] of Object.entries(filemap)) {
|
|
77
|
+
const agentMatch = AGENT_PATH_RE.exec(relPath);
|
|
78
|
+
const commandMatch = COMMAND_PATH_RE.exec(relPath);
|
|
79
|
+
const hookMatch = HOOK_PATH_RE.exec(relPath);
|
|
80
|
+
const settingsMatch = SETTINGS_PATH_RE.exec(relPath);
|
|
81
|
+
if (agentMatch) {
|
|
82
|
+
try {
|
|
83
|
+
agents.push(parseClaudeFile(content, { name: agentMatch[1], kind: "agent" }));
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
skipped.push({ relPath, reason: err.message });
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else if (commandMatch) {
|
|
90
|
+
try {
|
|
91
|
+
commands.push(parseClaudeFile(content, { name: commandMatch[1], kind: "command" }));
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
skipped.push({ relPath, reason: err.message });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (hookMatch) {
|
|
98
|
+
hooks.push({ relPath, content });
|
|
99
|
+
}
|
|
100
|
+
else if (settingsMatch) {
|
|
101
|
+
settings = { relPath, content };
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
skipped.push({ relPath, reason: "Không nhận diện được loại file." });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return { agents, commands, hooks, settings, skipped };
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.js","sourceRoot":"","sources":["../../src/parse/scan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAM5D;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAW,EACX,IAAwE;IAExE,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IACD,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;IAEjC,MAAM,EAAE,GAAG,gBAAgB,CAAC,KAAM,CAAC,CAAC;IAEpC,6EAA6E;IAC7E,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,sCAAsC,EAAE,EAAE,CAAC,CAAC;IAC/E,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAEpD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,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AE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;YACjF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;aAAM,IAAI,YAAY,EAAE,CAAC;YACxB,IAAI,CAAC;gBACH,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;YACvF,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAG,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;aAAM,IAAI,SAAS,EAAE,CAAC;YACrB,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;QACnC,CAAC;aAAM,IAAI,aAAa,EAAE,CAAC;YACzB,QAAQ,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,iCAAiC,EAAE,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { CanonicalArtifact, CustomField } from "../ir/types.js";
|
|
2
|
+
export interface FrontmatterFields {
|
|
3
|
+
name?: string;
|
|
4
|
+
description: string;
|
|
5
|
+
tools?: string[];
|
|
6
|
+
customFields?: CustomField[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* serializeFrontmatter — deterministic stable key order:
|
|
10
|
+
* `name`? -> `description` -> `tools`? -> custom fields (insertion order).
|
|
11
|
+
* Returns the frontmatter block WITHOUT the surrounding `---` fences (caller wraps).
|
|
12
|
+
*/
|
|
13
|
+
export declare function serializeFrontmatter(fields: FrontmatterFields): string;
|
|
14
|
+
export interface ParsedFrontmatter {
|
|
15
|
+
name?: string;
|
|
16
|
+
description: string;
|
|
17
|
+
tools?: string[];
|
|
18
|
+
/** all keys outside the known set (name/description/tools), in source order. */
|
|
19
|
+
customFields: CustomField[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* parseFrontmatter — parse a YAML frontmatter block (no fences) into structured fields.
|
|
23
|
+
* Preserves unknown-key order for round-trip fidelity (customFields).
|
|
24
|
+
* Throws on invalid YAML — caller (scan/markdown-tab) catches and surfaces E3.
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseFrontmatter(raw: string): ParsedFrontmatter;
|
|
27
|
+
/** Build the FrontmatterFields view from a CanonicalArtifact (agent includes name+tools; command omits both). */
|
|
28
|
+
export declare function artifactToFrontmatterFields(artifact: CanonicalArtifact): FrontmatterFields;
|
|
29
|
+
//# sourceMappingURL=frontmatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../src/render/frontmatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAErE,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAetE;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,gFAAgF;IAChF,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAID;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CA8C/D;AAcD,iHAAiH;AACjH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,iBAAiB,GAAG,iBAAiB,CAa1F"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { parse as parseYaml } from "yaml";
|
|
2
|
+
/**
|
|
3
|
+
* serializeFrontmatter — deterministic stable key order:
|
|
4
|
+
* `name`? -> `description` -> `tools`? -> custom fields (insertion order).
|
|
5
|
+
* Returns the frontmatter block WITHOUT the surrounding `---` fences (caller wraps).
|
|
6
|
+
*/
|
|
7
|
+
export function serializeFrontmatter(fields) {
|
|
8
|
+
const lines = [];
|
|
9
|
+
if (fields.name !== undefined) {
|
|
10
|
+
lines.push(`name: ${fields.name}`);
|
|
11
|
+
}
|
|
12
|
+
lines.push(`description: ${fields.description}`);
|
|
13
|
+
if (fields.tools && fields.tools.length > 0) {
|
|
14
|
+
lines.push(`tools: ${fields.tools.join(", ")}`);
|
|
15
|
+
}
|
|
16
|
+
for (const cf of fields.customFields ?? []) {
|
|
17
|
+
lines.push(`${cf.key}: ${cf.value}`);
|
|
18
|
+
}
|
|
19
|
+
return lines.join("\n");
|
|
20
|
+
}
|
|
21
|
+
const KNOWN_KEYS = new Set(["name", "description", "tools"]);
|
|
22
|
+
/**
|
|
23
|
+
* parseFrontmatter — parse a YAML frontmatter block (no fences) into structured fields.
|
|
24
|
+
* Preserves unknown-key order for round-trip fidelity (customFields).
|
|
25
|
+
* Throws on invalid YAML — caller (scan/markdown-tab) catches and surfaces E3.
|
|
26
|
+
*/
|
|
27
|
+
export function parseFrontmatter(raw) {
|
|
28
|
+
const parsed = parseYaml(raw);
|
|
29
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
30
|
+
throw new Error("Frontmatter phải là một YAML object.");
|
|
31
|
+
}
|
|
32
|
+
const description = parsed["description"];
|
|
33
|
+
if (typeof description !== "string") {
|
|
34
|
+
throw new Error("Frontmatter thiếu key `description` (string).");
|
|
35
|
+
}
|
|
36
|
+
let name;
|
|
37
|
+
if (parsed["name"] !== undefined) {
|
|
38
|
+
if (typeof parsed["name"] !== "string") {
|
|
39
|
+
throw new Error("`name` phải là string.");
|
|
40
|
+
}
|
|
41
|
+
name = parsed["name"];
|
|
42
|
+
}
|
|
43
|
+
let tools;
|
|
44
|
+
if (parsed["tools"] !== undefined) {
|
|
45
|
+
const raw_ = parsed["tools"];
|
|
46
|
+
if (typeof raw_ === "string") {
|
|
47
|
+
tools = raw_
|
|
48
|
+
.split(",")
|
|
49
|
+
.map((s) => s.trim())
|
|
50
|
+
.filter((s) => s.length > 0);
|
|
51
|
+
}
|
|
52
|
+
else if (Array.isArray(raw_)) {
|
|
53
|
+
tools = raw_.map((t) => String(t));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
throw new Error("`tools` phải là CSV string hoặc array.");
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Preserve order of unknown keys by re-scanning raw lines (YAML parse loses
|
|
60
|
+
// original key order for some parsers; we rebuild order from the raw text).
|
|
61
|
+
const customFields = [];
|
|
62
|
+
const orderedKeys = extractTopLevelKeyOrder(raw);
|
|
63
|
+
for (const key of orderedKeys) {
|
|
64
|
+
if (KNOWN_KEYS.has(key))
|
|
65
|
+
continue;
|
|
66
|
+
const value = parsed[key];
|
|
67
|
+
if (value === undefined)
|
|
68
|
+
continue;
|
|
69
|
+
customFields.push({ key, value: String(value) });
|
|
70
|
+
}
|
|
71
|
+
return { name, description, tools, customFields };
|
|
72
|
+
}
|
|
73
|
+
/** Extract top-level YAML mapping keys in source order (simple line scan, sufficient for our flat schema). */
|
|
74
|
+
function extractTopLevelKeyOrder(raw) {
|
|
75
|
+
const keys = [];
|
|
76
|
+
for (const line of raw.split("\n")) {
|
|
77
|
+
const match = /^([A-Za-z0-9_-]+):/.exec(line);
|
|
78
|
+
if (match) {
|
|
79
|
+
keys.push(match[1]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return keys;
|
|
83
|
+
}
|
|
84
|
+
/** Build the FrontmatterFields view from a CanonicalArtifact (agent includes name+tools; command omits both). */
|
|
85
|
+
export function artifactToFrontmatterFields(artifact) {
|
|
86
|
+
if (artifact.kind === "agent") {
|
|
87
|
+
return {
|
|
88
|
+
name: artifact.name,
|
|
89
|
+
description: artifact.description,
|
|
90
|
+
tools: artifact.tools,
|
|
91
|
+
customFields: artifact.customFields,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
description: artifact.description,
|
|
96
|
+
customFields: artifact.customFields,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=frontmatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.js","sourceRoot":"","sources":["../../src/render/frontmatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAU1C;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAyB;IAC5D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,gBAAgB,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;IACjD,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,U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IAC1B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,iHAAiH;AACjH,MAAM,UAAU,2BAA2B,CAAC,QAA2B;IACrE,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,YAAY,EAAE,QAAQ,CAAC,YAAY;SACpC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,YAAY,EAAE,QAAQ,CAAC,YAAY;KACpC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ArtifactKind } from "../ir/types.js";
|
|
2
|
+
export interface ManagedMarker {
|
|
3
|
+
id: string;
|
|
4
|
+
kind: ArtifactKind;
|
|
5
|
+
version: string;
|
|
6
|
+
hash: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RegionMarker {
|
|
9
|
+
region: true;
|
|
10
|
+
version: string;
|
|
11
|
+
hash: string;
|
|
12
|
+
}
|
|
13
|
+
/** Truncate a full sha256 hex digest to the 12-char form stored in markers. */
|
|
14
|
+
export declare function truncateHash(fullHash: string): string;
|
|
15
|
+
/** Build the trailing per-file managed marker comment (single-file targets: Claude). */
|
|
16
|
+
export declare function buildMarker(id: string, kind: ArtifactKind, version: string, hash: string): string;
|
|
17
|
+
/** Parse a per-file managed marker out of file content. Returns null if absent (foreign file). */
|
|
18
|
+
export declare function parseMarker(content: string): ManagedMarker | null;
|
|
19
|
+
/** Build the region-fence start marker (merged targets: Codex/AGENTS.md). */
|
|
20
|
+
export declare function buildRegionStart(version: string, hash: string): string;
|
|
21
|
+
export declare function buildRegionEnd(): string;
|
|
22
|
+
/** Parse the region-fence markers out of file content. Returns null if no fence found. */
|
|
23
|
+
export declare function parseRegionMarker(content: string): RegionMarker | null;
|
|
24
|
+
/**
|
|
25
|
+
* computeContentHash — sha256 over canonical content EXCLUDING the hash token itself.
|
|
26
|
+
* Caller passes the content with the hash placeholder already stripped/blanked
|
|
27
|
+
* (e.g. render the marker with hash="" first, hash that, then rebuild marker with real hash).
|
|
28
|
+
*/
|
|
29
|
+
export declare function computeContentHash(canonicalContentWithoutHash: string): string;
|
|
30
|
+
//# sourceMappingURL=marker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../../src/render/marker.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,IAAI,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAQD,+EAA+E;AAC/E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjG;AAED,kGAAkG;AAClG,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAMjE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAMtE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,2BAA2B,EAAE,MAAM,GAAG,MAAM,CAE9E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { sha256Hex } from "../util/sha256.js";
|
|
2
|
+
const MARKER_RE = /<!--\s*managed-by:\s*symbion\s+id=(\S+)\s+kind=(\S+)\s+v=(\S+)\s+hash=(\S+)\s*-->/;
|
|
3
|
+
const REGION_START_RE = /<!--\s*managed-by:\s*symbion\s+region-start\s+v=(\S+)\s+hash=(\S+)\s*-->/;
|
|
4
|
+
const REGION_END_RE = /<!--\s*managed-by:\s*symbion\s+region-end\s*-->/;
|
|
5
|
+
/** Truncate a full sha256 hex digest to the 12-char form stored in markers. */
|
|
6
|
+
export function truncateHash(fullHash) {
|
|
7
|
+
return fullHash.slice(0, 12);
|
|
8
|
+
}
|
|
9
|
+
/** Build the trailing per-file managed marker comment (single-file targets: Claude). */
|
|
10
|
+
export function buildMarker(id, kind, version, hash) {
|
|
11
|
+
return `<!-- managed-by: symbion id=${id} kind=${kind} v=${version} hash=${truncateHash(hash)} -->`;
|
|
12
|
+
}
|
|
13
|
+
/** Parse a per-file managed marker out of file content. Returns null if absent (foreign file). */
|
|
14
|
+
export function parseMarker(content) {
|
|
15
|
+
const match = MARKER_RE.exec(content);
|
|
16
|
+
if (!match)
|
|
17
|
+
return null;
|
|
18
|
+
const [, id, kind, version, hash] = match;
|
|
19
|
+
if (kind !== "agent" && kind !== "command")
|
|
20
|
+
return null;
|
|
21
|
+
return { id: id, kind, version: version, hash: hash };
|
|
22
|
+
}
|
|
23
|
+
/** Build the region-fence start marker (merged targets: Codex/AGENTS.md). */
|
|
24
|
+
export function buildRegionStart(version, hash) {
|
|
25
|
+
return `<!-- managed-by: symbion region-start v=${version} hash=${truncateHash(hash)} -->`;
|
|
26
|
+
}
|
|
27
|
+
export function buildRegionEnd() {
|
|
28
|
+
return `<!-- managed-by: symbion region-end -->`;
|
|
29
|
+
}
|
|
30
|
+
/** Parse the region-fence markers out of file content. Returns null if no fence found. */
|
|
31
|
+
export function parseRegionMarker(content) {
|
|
32
|
+
const match = REGION_START_RE.exec(content);
|
|
33
|
+
if (!match)
|
|
34
|
+
return null;
|
|
35
|
+
const [, version, hash] = match;
|
|
36
|
+
if (!REGION_END_RE.test(content))
|
|
37
|
+
return null;
|
|
38
|
+
return { region: true, version: version, hash: hash };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* computeContentHash — sha256 over canonical content EXCLUDING the hash token itself.
|
|
42
|
+
* Caller passes the content with the hash placeholder already stripped/blanked
|
|
43
|
+
* (e.g. render the marker with hash="" first, hash that, then rebuild marker with real hash).
|
|
44
|
+
*/
|
|
45
|
+
export function computeContentHash(canonicalContentWithoutHash) {
|
|
46
|
+
return sha256Hex(canonicalContentWithoutHash);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.js","sourceRoot":"","sources":["../../src/render/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgB9C,MAAM,SAAS,GACb,mFAAmF,CAAC;AAEtF,MAAM,eAAe,GAAG,0EAA0E,CAAC;AACnG,MAAM,aAAa,GAAG,iDAAiD,CAAC;AAExE,+EAA+E;AAC/E,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC/B,CAAC;AAED,w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E,IAAI,EAAE,IAAK,EAAE,CAAC;AAC1D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,2BAAmC;IACpE,OAAO,SAAS,CAAC,2BAA2B,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CanonicalArtifact, TargetId } from "../ir/types.js";
|
|
2
|
+
import type { RenderedFile } from "../adapters/types.js";
|
|
3
|
+
export interface RenderArtifactsOptions {
|
|
4
|
+
version: string;
|
|
5
|
+
existingForeignContent?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* renderArtifacts — IR -> RenderedFile[] for a single target. Thin wrapper over
|
|
9
|
+
* the target's adapter; pure, no disk access.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderArtifacts(artifacts: CanonicalArtifact[], target: TargetId, opts: RenderArtifactsOptions): RenderedFile[];
|
|
12
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/render/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGzD,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,iBAAiB,EAAE,EAC9B,MAAM,EAAE,QAAQ,EAChB,IAAI,EAAE,sBAAsB,GAC3B,YAAY,EAAE,CAGhB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getAdapter } from "../adapters/registry.js";
|
|
2
|
+
/**
|
|
3
|
+
* renderArtifacts — IR -> RenderedFile[] for a single target. Thin wrapper over
|
|
4
|
+
* the target's adapter; pure, no disk access.
|
|
5
|
+
*/
|
|
6
|
+
export function renderArtifacts(artifacts, target, opts) {
|
|
7
|
+
const adapter = getAdapter(target);
|
|
8
|
+
return adapter.render(artifacts, opts);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/render/render.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAOrD;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,SAA8B,EAC9B,MAAgB,EAChB,IAA4B;IAE5B,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RenderRunCommandInput {
|
|
2
|
+
command: string;
|
|
3
|
+
requirements?: string;
|
|
4
|
+
model?: string;
|
|
5
|
+
option?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* renderRunCommand — pure string render of a structured "run command" prompt.
|
|
9
|
+
* `/autoplan Add emoji reactions [claude-opus-4-8] [--gate]`
|
|
10
|
+
* Empty model/option are omitted cleanly. No execution — string only (v1, STATE §8 #7).
|
|
11
|
+
*/
|
|
12
|
+
export declare function renderRunCommand(input: RenderRunCommandInput): string;
|
|
13
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../src/runcommand/render.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,CAcrE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* renderRunCommand — pure string render of a structured "run command" prompt.
|
|
3
|
+
* `/autoplan Add emoji reactions [claude-opus-4-8] [--gate]`
|
|
4
|
+
* Empty model/option are omitted cleanly. No execution — string only (v1, STATE §8 #7).
|
|
5
|
+
*/
|
|
6
|
+
export function renderRunCommand(input) {
|
|
7
|
+
const parts = [`/${input.command}`];
|
|
8
|
+
if (input.requirements && input.requirements.trim().length > 0) {
|
|
9
|
+
parts.push(input.requirements.trim());
|
|
10
|
+
}
|
|
11
|
+
if (input.model && input.model.trim().length > 0) {
|
|
12
|
+
parts.push(`[${input.model.trim()}]`);
|
|
13
|
+
}
|
|
14
|
+
if (input.option && input.option.trim().length > 0) {
|
|
15
|
+
parts.push(`[${input.option.trim()}]`);
|
|
16
|
+
}
|
|
17
|
+
return parts.join(" ");
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../src/runcommand/render.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA4B;IAC3D,MAAM,KAAK,GAAa,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAE9C,IAAI,KAAK,CAAC,YAAY,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/D,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnD,KAAK,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { TemplateKind } from "./parseTemplate.js";
|
|
2
|
+
/**
|
|
3
|
+
* authorSource.ts — the AuthorSource/AUTHOR_REGISTRY abstraction
|
|
4
|
+
* (docs/loops/templates-authors-STATE.md PLAN §P1). Pure data, zero fs/net —
|
|
5
|
+
* lives in packages/core so both apps/web (renders the Authors sub-nav
|
|
6
|
+
* labels) and apps/daemon (the fetchAuthorTemplates RPC handler) import the
|
|
7
|
+
* exact same registry, with no hand-duplication / drift risk.
|
|
8
|
+
*
|
|
9
|
+
* THINK #2 (templates-authors-STATE.md): a short, manually-reviewed,
|
|
10
|
+
* hardcoded list — NOT a user-facing "add any repo URL" self-service flow.
|
|
11
|
+
* Adding a new author is a reviewed code change to AUTHOR_REGISTRY, not a
|
|
12
|
+
* runtime/user action.
|
|
13
|
+
*/
|
|
14
|
+
/** Re-export under a more domain-specific name for this file's call sites —
|
|
15
|
+
* identical to TemplateKind (PLAN §P1: "== TemplateKind, reused not duplicated"). */
|
|
16
|
+
export type TemplateBucket = TemplateKind;
|
|
17
|
+
export interface GithubFolderMapping {
|
|
18
|
+
bucket: TemplateBucket;
|
|
19
|
+
/** repo-relative folder path, e.g. "agents" — no leading/trailing slash. */
|
|
20
|
+
path: string;
|
|
21
|
+
/**
|
|
22
|
+
* "star.md" (i.e. "*.md") = flat files directly under `path` (e.g.
|
|
23
|
+
* agents/<slug>.md). "star-slash-SKILL.md" (i.e. "*\/SKILL.md") = one
|
|
24
|
+
* level of subfolder then a fixed filename (e.g. skills/<slug>/SKILL.md).
|
|
25
|
+
* These are the only two shapes ECC's real, verified structure requires
|
|
26
|
+
* (PLAN §P0/§P10.4) — a future author needing a genuinely different shape
|
|
27
|
+
* requires a small, reviewed code change to this union + matchAuthorFolders,
|
|
28
|
+
* not just a registry edit (PLAN §P10.4's explicitly-flagged AC8 limitation).
|
|
29
|
+
*/
|
|
30
|
+
filePattern: "*.md" | "*/SKILL.md";
|
|
31
|
+
}
|
|
32
|
+
export type AuthorSource = {
|
|
33
|
+
id: string;
|
|
34
|
+
displayName: string;
|
|
35
|
+
kind: "bundled";
|
|
36
|
+
} | {
|
|
37
|
+
id: string;
|
|
38
|
+
displayName: string;
|
|
39
|
+
kind: "github";
|
|
40
|
+
owner: string;
|
|
41
|
+
repo: string;
|
|
42
|
+
/** branch/tag, e.g. "main" — pinned per author, not user-supplied. */
|
|
43
|
+
ref: string;
|
|
44
|
+
folders: GithubFolderMapping[];
|
|
45
|
+
/** shown in UI attribution/license-step copy, e.g. "affaan-m/ecc". */
|
|
46
|
+
repoLabel: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* AUTHOR_REGISTRY — the hardcoded, reviewed author list (PLAN §P1).
|
|
50
|
+
* "symbion" = the existing bundled gallery (zero network, THINK #1: kept,
|
|
51
|
+
* not replaced). "ecc" = the first GitHub-backed author, folder mapping
|
|
52
|
+
* verified against the real repo's tree during PLAN (PLAN §P0).
|
|
53
|
+
*/
|
|
54
|
+
export declare const AUTHOR_REGISTRY: AuthorSource[];
|
|
55
|
+
//# sourceMappingURL=authorSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorSource.d.ts","sourceRoot":"","sources":["../../src/templates/authorSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;GAWG;AAEH;sFACsF;AACtF,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,CAAC;IACvB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,WAAW,EAAE,MAAM,GAAG,YAAY,CAAC;CACpC;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GACpD;IACE,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC/B,sEAAsE;IACtE,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEN;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,YAAY,EAgBzC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTHOR_REGISTRY — the hardcoded, reviewed author list (PLAN §P1).
|
|
3
|
+
* "symbion" = the existing bundled gallery (zero network, THINK #1: kept,
|
|
4
|
+
* not replaced). "ecc" = the first GitHub-backed author, folder mapping
|
|
5
|
+
* verified against the real repo's tree during PLAN (PLAN §P0).
|
|
6
|
+
*/
|
|
7
|
+
export const AUTHOR_REGISTRY = [
|
|
8
|
+
{ id: "symbion", displayName: "Symbion", kind: "bundled" },
|
|
9
|
+
{
|
|
10
|
+
id: "ecc",
|
|
11
|
+
displayName: "ECC",
|
|
12
|
+
kind: "github",
|
|
13
|
+
owner: "affaan-m",
|
|
14
|
+
repo: "ecc",
|
|
15
|
+
ref: "main",
|
|
16
|
+
repoLabel: "affaan-m/ecc",
|
|
17
|
+
folders: [
|
|
18
|
+
{ bucket: "agent", path: "agents", filePattern: "*.md" },
|
|
19
|
+
{ bucket: "command", path: "commands", filePattern: "*.md" },
|
|
20
|
+
{ bucket: "skill", path: "skills", filePattern: "*/SKILL.md" },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
//# sourceMappingURL=authorSource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorSource.js","sourceRoot":"","sources":["../../src/templates/authorSource.ts"],"names":[],"mappings":"AAkDA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,EAAE,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IAC1D;QACE,EAAE,EAAE,KAAK;QACT,WAAW,EAAE,KAAK;QAClB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,UAAU;QACjB,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,MAAM;QACX,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE;YACP,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE;YACxD,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE;YAC5D,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE;SAC/D;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GithubFolderMapping, TemplateBucket } from "./authorSource.js";
|
|
2
|
+
export interface GithubTreeEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
type: "blob" | "tree" | string;
|
|
5
|
+
}
|
|
6
|
+
export interface AuthorFolderCandidate {
|
|
7
|
+
bucket: TemplateBucket;
|
|
8
|
+
relPath: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* matchAuthorFolders — pure filter/match helper (PLAN §P2a). Given a GitHub
|
|
12
|
+
* repo's flattened tree listing + an author's `folders` mapping, returns the
|
|
13
|
+
* exact set of `{ bucket, relPath }` candidates to fetch content for. Pure
|
|
14
|
+
* data-in/data-out, fully unit-testable without any network call.
|
|
15
|
+
*
|
|
16
|
+
* Two supported shapes only (PLAN §P10.4 — not a generic glob engine):
|
|
17
|
+
* - "*.md": exactly one path segment below `folder.path`, ending in ".md".
|
|
18
|
+
* Excludes any nested subfolder (e.g. `agents/sub/foo.md` does NOT match).
|
|
19
|
+
* - "*\/SKILL.md": exactly one path segment between `folder.path` and the
|
|
20
|
+
* trailing literal filename "SKILL.md". Excludes helper files inside the
|
|
21
|
+
* same item folder (e.g. `skills/foo/examples/bar.md`) and excludes a
|
|
22
|
+
* missing/extra nesting level.
|
|
23
|
+
*
|
|
24
|
+
* Tree entries of `type !== "blob"` (directories) are never returned, even
|
|
25
|
+
* if their `path` happens to match a pattern textually.
|
|
26
|
+
*/
|
|
27
|
+
export declare function matchAuthorFolders(treeEntries: GithubTreeEntry[], folders: GithubFolderMapping[]): AuthorFolderCandidate[];
|
|
28
|
+
//# sourceMappingURL=matchAuthorFolders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchAuthorFolders.d.ts","sourceRoot":"","sources":["../../src/templates/matchAuthorFolders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,eAAe,EAAE,EAC9B,OAAO,EAAE,mBAAmB,EAAE,GAC7B,qBAAqB,EAAE,CA8BzB"}
|