@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,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* matchAuthorFolders — pure filter/match helper (PLAN §P2a). Given a GitHub
|
|
3
|
+
* repo's flattened tree listing + an author's `folders` mapping, returns the
|
|
4
|
+
* exact set of `{ bucket, relPath }` candidates to fetch content for. Pure
|
|
5
|
+
* data-in/data-out, fully unit-testable without any network call.
|
|
6
|
+
*
|
|
7
|
+
* Two supported shapes only (PLAN §P10.4 — not a generic glob engine):
|
|
8
|
+
* - "*.md": exactly one path segment below `folder.path`, ending in ".md".
|
|
9
|
+
* Excludes any nested subfolder (e.g. `agents/sub/foo.md` does NOT match).
|
|
10
|
+
* - "*\/SKILL.md": exactly one path segment between `folder.path` and the
|
|
11
|
+
* trailing literal filename "SKILL.md". Excludes helper files inside the
|
|
12
|
+
* same item folder (e.g. `skills/foo/examples/bar.md`) and excludes a
|
|
13
|
+
* missing/extra nesting level.
|
|
14
|
+
*
|
|
15
|
+
* Tree entries of `type !== "blob"` (directories) are never returned, even
|
|
16
|
+
* if their `path` happens to match a pattern textually.
|
|
17
|
+
*/
|
|
18
|
+
export function matchAuthorFolders(treeEntries, folders) {
|
|
19
|
+
const candidates = [];
|
|
20
|
+
for (const entry of treeEntries) {
|
|
21
|
+
if (entry.type !== "blob")
|
|
22
|
+
continue;
|
|
23
|
+
for (const folder of folders) {
|
|
24
|
+
const prefix = `${folder.path}/`;
|
|
25
|
+
if (!entry.path.startsWith(prefix))
|
|
26
|
+
continue;
|
|
27
|
+
const rest = entry.path.slice(prefix.length);
|
|
28
|
+
if (rest.length === 0)
|
|
29
|
+
continue;
|
|
30
|
+
if (folder.filePattern === "*.md") {
|
|
31
|
+
if (!rest.endsWith(".md"))
|
|
32
|
+
continue;
|
|
33
|
+
// Exactly one path segment below the folder — no further "/" in rest.
|
|
34
|
+
if (rest.indexOf("/") !== -1)
|
|
35
|
+
continue;
|
|
36
|
+
candidates.push({ bucket: folder.bucket, relPath: entry.path });
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// "*/SKILL.md": exactly one segment then the literal filename "SKILL.md".
|
|
40
|
+
const SUFFIX = "/SKILL.md";
|
|
41
|
+
if (!rest.endsWith(SUFFIX))
|
|
42
|
+
continue;
|
|
43
|
+
const segment = rest.slice(0, rest.length - SUFFIX.length);
|
|
44
|
+
if (segment.length === 0)
|
|
45
|
+
continue; // skills/SKILL.md (missing subfolder)
|
|
46
|
+
if (segment.indexOf("/") !== -1)
|
|
47
|
+
continue; // skills/foo/bar/SKILL.md (nested 2 levels)
|
|
48
|
+
candidates.push({ bucket: folder.bucket, relPath: entry.path });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return candidates;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=matchAuthorFolders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchAuthorFolders.js","sourceRoot":"","sources":["../../src/templates/matchAuthorFolders.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;GAgBG;A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CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;oBAAE,SAAS,CAAC,4CAA4C;gBACvF,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Three-valued kind for the template GALLERY only — deliberately separate from
|
|
2
|
+
* `ArtifactKind` ("agent" | "command"), which stays unchanged (PLAN §5 assumption #5).
|
|
3
|
+
* Do not conflate these two types: one is the persisted IR's artifact kind, the
|
|
4
|
+
* other is the template gallery's display/eligibility category. */
|
|
5
|
+
export type TemplateKind = "agent" | "command" | "skill";
|
|
6
|
+
export interface ParsedTemplateContent {
|
|
7
|
+
kind: TemplateKind;
|
|
8
|
+
/**
|
|
9
|
+
* Frontmatter `name` for agent/skill templates. Deliberately ABSENT for
|
|
10
|
+
* command templates — matching the existing IR convention (see
|
|
11
|
+
* render/frontmatter.ts `artifactToFrontmatterFields` and parse/scan.ts's
|
|
12
|
+
* documented contract): command name is always derived from the filename
|
|
13
|
+
* (here: the manifest's template id slug), never frontmatter. Callers that
|
|
14
|
+
* need a display name for a command template must derive it themselves
|
|
15
|
+
* (the manifest loader does this from `source.mod.id`).
|
|
16
|
+
*/
|
|
17
|
+
name?: string;
|
|
18
|
+
description: string;
|
|
19
|
+
tools?: string[];
|
|
20
|
+
body: string;
|
|
21
|
+
}
|
|
22
|
+
export type ParseTemplateResult = {
|
|
23
|
+
ok: true;
|
|
24
|
+
parsed: ParsedTemplateContent;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* parseTemplateMarkdown — parses ONE bundled template file's raw text
|
|
31
|
+
* (frontmatter + body) into a ParsedTemplateContent. Pure, throws never —
|
|
32
|
+
* same "skip with reason" discipline as parseClaudeDir/parseClaudeFile.
|
|
33
|
+
*
|
|
34
|
+
* `expectedKind` comes from the template's manifest folder (skills/agents/commands),
|
|
35
|
+
* not re-derived from content, so a misplaced file fails loudly via a mismatch
|
|
36
|
+
* reason rather than silently filing under the wrong section.
|
|
37
|
+
*
|
|
38
|
+
* Reuses the existing `parseFrontmatter` primitive from render/frontmatter.ts —
|
|
39
|
+
* no second YAML-ish parser invented for this smaller, marker-free shape.
|
|
40
|
+
*/
|
|
41
|
+
export declare function parseTemplateMarkdown(raw: string, expectedKind: TemplateKind): ParseTemplateResult;
|
|
42
|
+
//# sourceMappingURL=parseTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseTemplate.d.ts","sourceRoot":"","sources":["../../src/templates/parseTemplate.ts"],"names":[],"mappings":"AAEA;;;oEAGoE;AACpE,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,YAAY,CAAC;IACnB;;;;;;;;OAQG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,qBAAqB,CAAA;CAAE,GAC3C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAIlC;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,mBAAmB,CA4ClG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { parseFrontmatter } from "../render/frontmatter.js";
|
|
2
|
+
const FRONTMATTER_RE = /^---\n([\s\S]*?)\n---\n?([\s\S]*)$/;
|
|
3
|
+
/**
|
|
4
|
+
* parseTemplateMarkdown — parses ONE bundled template file's raw text
|
|
5
|
+
* (frontmatter + body) into a ParsedTemplateContent. Pure, throws never —
|
|
6
|
+
* same "skip with reason" discipline as parseClaudeDir/parseClaudeFile.
|
|
7
|
+
*
|
|
8
|
+
* `expectedKind` comes from the template's manifest folder (skills/agents/commands),
|
|
9
|
+
* not re-derived from content, so a misplaced file fails loudly via a mismatch
|
|
10
|
+
* reason rather than silently filing under the wrong section.
|
|
11
|
+
*
|
|
12
|
+
* Reuses the existing `parseFrontmatter` primitive from render/frontmatter.ts —
|
|
13
|
+
* no second YAML-ish parser invented for this smaller, marker-free shape.
|
|
14
|
+
*/
|
|
15
|
+
export function parseTemplateMarkdown(raw, expectedKind) {
|
|
16
|
+
const match = FRONTMATTER_RE.exec(raw);
|
|
17
|
+
if (!match) {
|
|
18
|
+
return { ok: false, reason: "File thiếu frontmatter (--- ... ---)." };
|
|
19
|
+
}
|
|
20
|
+
const [, fmRaw, bodyRaw] = match;
|
|
21
|
+
let fm;
|
|
22
|
+
try {
|
|
23
|
+
fm = parseFrontmatter(fmRaw ?? "");
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
return { ok: false, reason: err.message };
|
|
27
|
+
}
|
|
28
|
+
// Only agent (and skill) templates require frontmatter `name`. Command
|
|
29
|
+
// templates never carry `name` in frontmatter — the command's name is
|
|
30
|
+
// always derived from its filename/manifest id, per the existing IR
|
|
31
|
+
// convention (render/frontmatter.ts, parse/scan.ts). Requiring it here for
|
|
32
|
+
// commands would reject every correctly-authored command template.
|
|
33
|
+
if (expectedKind === "agent" && (!fm.name || fm.name.trim().length === 0)) {
|
|
34
|
+
return { ok: false, reason: "Frontmatter thiếu 'name'." };
|
|
35
|
+
}
|
|
36
|
+
if (!fm.description || fm.description.trim().length === 0) {
|
|
37
|
+
return { ok: false, reason: "Frontmatter thiếu 'description'." };
|
|
38
|
+
}
|
|
39
|
+
const body = (bodyRaw ?? "").replace(/\n+$/, "").replace(/^\n+/, "");
|
|
40
|
+
if (body.length === 0) {
|
|
41
|
+
return { ok: false, reason: "Body (nội dung sau frontmatter) trống." };
|
|
42
|
+
}
|
|
43
|
+
const parsed = {
|
|
44
|
+
kind: expectedKind,
|
|
45
|
+
description: fm.description.trim(),
|
|
46
|
+
body,
|
|
47
|
+
};
|
|
48
|
+
if (fm.name && fm.name.trim().length > 0) {
|
|
49
|
+
parsed.name = fm.name.trim();
|
|
50
|
+
}
|
|
51
|
+
if (expectedKind === "agent" && fm.tools && fm.tools.length > 0) {
|
|
52
|
+
parsed.tools = fm.tools;
|
|
53
|
+
}
|
|
54
|
+
return { ok: true, parsed };
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=parseTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseTemplate.js","sourceRoot":"","sources":["../../src/templates/parseTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA6B5D,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW,EAAE,YAA0B;IAC3E,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,uCAAuC,EAAE,CAAC;IACxE,CAAC;IACD,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;IAEjC,IAAI,EAAE,CAAC;IACP,IAAI,CAAC;QACH,EAAE,GAAG,gBAAgB,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,EAAE,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,CAAC,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAChE,MAAM,CAAC,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC;IAC1B,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TemplateKind } from "./parseTemplate.js";
|
|
2
|
+
/**
|
|
3
|
+
* TemplateListItem — the shared shape both the bundled (Symbion) gallery and
|
|
4
|
+
* the live-fetched (GitHub-backed) author paths produce, consumed identically
|
|
5
|
+
* by TemplateCard/TemplateSection/TemplatePreviewModal regardless of source
|
|
6
|
+
* (templates-authors-STATE.md PLAN §P2, FR4: "the modal doesn't need to know
|
|
7
|
+
* or care where that string came from").
|
|
8
|
+
*
|
|
9
|
+
* Moved here (was previously hand-declared in
|
|
10
|
+
* apps/web/src/data/templates/manifest.ts) so apps/daemon's
|
|
11
|
+
* fetchAuthorTemplates handler and apps/web's bundled-manifest loader share
|
|
12
|
+
* the exact same type, not a hand-duplicated shape — PLAN §P9.
|
|
13
|
+
*/
|
|
14
|
+
export interface TemplateListItem {
|
|
15
|
+
/**
|
|
16
|
+
* stable slug, used as sourceTemplateId on Apply. Format differs by author
|
|
17
|
+
* (PLAN §P5): Symbion-bundled items keep their pre-existing
|
|
18
|
+
* "agent:code-reviewer" shape (unchanged, not retrofixed); GitHub-backed
|
|
19
|
+
* items use "{authorId}:{repoRelativePath}", e.g.
|
|
20
|
+
* "ecc:agents/code-reviewer.md". Opaque to the daemon either way — never
|
|
21
|
+
* parsed/interpreted server-side, only stored verbatim.
|
|
22
|
+
*/
|
|
23
|
+
id: string;
|
|
24
|
+
kind: TemplateKind;
|
|
25
|
+
/** becomes CanonicalArtifact.name on Apply. */
|
|
26
|
+
name: string;
|
|
27
|
+
/** one-line, shown on card + becomes CanonicalArtifact.description. */
|
|
28
|
+
description: string;
|
|
29
|
+
tools?: string[];
|
|
30
|
+
/** exact bytes of the .md-equivalent source — what "Copy markdown" copies verbatim. */
|
|
31
|
+
raw: string;
|
|
32
|
+
/** "symbion" | "ecc" | future AUTHOR_REGISTRY ids. */
|
|
33
|
+
authorId: string;
|
|
34
|
+
/** denormalized for the UI, avoids a registry lookup in every card. */
|
|
35
|
+
authorDisplayName: string;
|
|
36
|
+
/** present iff this item's author source kind === "github", e.g. "affaan-m/ecc". */
|
|
37
|
+
authorRepoLabel?: string;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=templateListItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateListItem.d.ts","sourceRoot":"","sources":["../../src/templates/templateListItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;OAOG;IACH,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,uFAAuF;IACvF,GAAG,EAAE,MAAM,CAAC;IACZ,sDAAsD;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateListItem.js","sourceRoot":"","sources":["../../src/templates/templateListItem.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS SHA-256 implementation. No Node `crypto` import — keeps `packages/core`
|
|
3
|
+
* free of Node-only APIs so it can run in any JS runtime (browser, daemon, tests).
|
|
4
|
+
*
|
|
5
|
+
* Reference: FIPS 180-4. Implementation kept dependency-free and deterministic.
|
|
6
|
+
*/
|
|
7
|
+
/** Compute SHA-256 of a UTF-8 string; returns lowercase hex digest. */
|
|
8
|
+
export declare function sha256Hex(input: string): string;
|
|
9
|
+
//# sourceMappingURL=sha256.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../src/util/sha256.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA+BH,uEAAuE;AACvE,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAwE/C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure-JS SHA-256 implementation. No Node `crypto` import — keeps `packages/core`
|
|
3
|
+
* free of Node-only APIs so it can run in any JS runtime (browser, daemon, tests).
|
|
4
|
+
*
|
|
5
|
+
* Reference: FIPS 180-4. Implementation kept dependency-free and deterministic.
|
|
6
|
+
*/
|
|
7
|
+
const K = [
|
|
8
|
+
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,
|
|
9
|
+
0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
|
10
|
+
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,
|
|
11
|
+
0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
|
12
|
+
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
|
|
13
|
+
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
|
14
|
+
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,
|
|
15
|
+
0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
|
16
|
+
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,
|
|
17
|
+
0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
|
18
|
+
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
|
19
|
+
];
|
|
20
|
+
const H0 = [
|
|
21
|
+
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
|
22
|
+
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
|
23
|
+
];
|
|
24
|
+
function rotr(x, n) {
|
|
25
|
+
return (x >>> n) | (x << (32 - n));
|
|
26
|
+
}
|
|
27
|
+
function toUtf8Bytes(str) {
|
|
28
|
+
// Minimal UTF-8 encoder (avoids relying on TextEncoder availability assumptions,
|
|
29
|
+
// though TextEncoder is standard in Node 18+/browsers — used here for simplicity).
|
|
30
|
+
return new TextEncoder().encode(str);
|
|
31
|
+
}
|
|
32
|
+
/** Compute SHA-256 of a UTF-8 string; returns lowercase hex digest. */
|
|
33
|
+
export function sha256Hex(input) {
|
|
34
|
+
const msg = toUtf8Bytes(input);
|
|
35
|
+
const bitLen = msg.length * 8;
|
|
36
|
+
// Padding: append 0x80, then zeros, then 64-bit big-endian length, to multiple of 64 bytes.
|
|
37
|
+
const padLen = (((msg.length + 8) >> 6) + 1) << 6;
|
|
38
|
+
const padded = new Uint8Array(padLen);
|
|
39
|
+
padded.set(msg);
|
|
40
|
+
padded[msg.length] = 0x80;
|
|
41
|
+
// 64-bit length (we only ever hash << 2^53 bytes; high 32 bits effectively 0 for our use)
|
|
42
|
+
const view = new DataView(padded.buffer);
|
|
43
|
+
view.setUint32(padLen - 4, bitLen >>> 0, false);
|
|
44
|
+
view.setUint32(padLen - 8, Math.floor(bitLen / 0x100000000), false);
|
|
45
|
+
let [h0, h1, h2, h3, h4, h5, h6, h7] = H0;
|
|
46
|
+
const w = new Int32Array(64);
|
|
47
|
+
for (let offset = 0; offset < padded.length; offset += 64) {
|
|
48
|
+
for (let i = 0; i < 16; i++) {
|
|
49
|
+
w[i] =
|
|
50
|
+
(padded[offset + i * 4] << 24) |
|
|
51
|
+
(padded[offset + i * 4 + 1] << 16) |
|
|
52
|
+
(padded[offset + i * 4 + 2] << 8) |
|
|
53
|
+
padded[offset + i * 4 + 3];
|
|
54
|
+
}
|
|
55
|
+
for (let i = 16; i < 64; i++) {
|
|
56
|
+
const s0 = rotr(w[i - 15], 7) ^ rotr(w[i - 15], 18) ^ (w[i - 15] >>> 3);
|
|
57
|
+
const s1 = rotr(w[i - 2], 17) ^ rotr(w[i - 2], 19) ^ (w[i - 2] >>> 10);
|
|
58
|
+
w[i] = (w[i - 16] + s0 + w[i - 7] + s1) | 0;
|
|
59
|
+
}
|
|
60
|
+
let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7;
|
|
61
|
+
for (let i = 0; i < 64; i++) {
|
|
62
|
+
const S1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);
|
|
63
|
+
const ch = (e & f) ^ (~e & g);
|
|
64
|
+
const temp1 = (h + S1 + ch + K[i] + w[i]) | 0;
|
|
65
|
+
const S0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);
|
|
66
|
+
const maj = (a & b) ^ (a & c) ^ (b & c);
|
|
67
|
+
const temp2 = (S0 + maj) | 0;
|
|
68
|
+
h = g;
|
|
69
|
+
g = f;
|
|
70
|
+
f = e;
|
|
71
|
+
e = (d + temp1) | 0;
|
|
72
|
+
d = c;
|
|
73
|
+
c = b;
|
|
74
|
+
b = a;
|
|
75
|
+
a = (temp1 + temp2) | 0;
|
|
76
|
+
}
|
|
77
|
+
h0 = (h0 + a) | 0;
|
|
78
|
+
h1 = (h1 + b) | 0;
|
|
79
|
+
h2 = (h2 + c) | 0;
|
|
80
|
+
h3 = (h3 + d) | 0;
|
|
81
|
+
h4 = (h4 + e) | 0;
|
|
82
|
+
h5 = (h5 + f) | 0;
|
|
83
|
+
h6 = (h6 + g) | 0;
|
|
84
|
+
h7 = (h7 + h) | 0;
|
|
85
|
+
}
|
|
86
|
+
const out = [h0, h1, h2, h3, h4, h5, h6, h7]
|
|
87
|
+
.map((x) => (x >>> 0).toString(16).padStart(8, "0"))
|
|
88
|
+
.join("");
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=sha256.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/util/sha256.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,GAAsB;IAC3B,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU;IACtE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAA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QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;SACpD,IAAI,CAAC,EAAE,CAAC,CAAC;IACZ,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type BumpKind = "patch" | "minor" | "major";
|
|
2
|
+
export interface ParsedVersion {
|
|
3
|
+
major: number;
|
|
4
|
+
minor: number;
|
|
5
|
+
patch: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function validateVersion(version: string): boolean;
|
|
8
|
+
/** Parses "vMAJOR.MINOR.PATCH" into a numeric tuple, or null if malformed.
|
|
9
|
+
* Shared by daemon/web/core so version comparisons never degrade into
|
|
10
|
+
* naive string comparison (e.g. "v0.10.0" < "v0.2.0" lexicographically
|
|
11
|
+
* but not numerically). */
|
|
12
|
+
export declare function parseVersion(version: string): ParsedVersion | null;
|
|
13
|
+
/** Numeric comparison: negative if a < b, 0 if equal, positive if a > b.
|
|
14
|
+
* Malformed versions sort as lower than any valid version. */
|
|
15
|
+
export declare function compareVersions(a: string, b: string): number;
|
|
16
|
+
/** bump("v0.2.0","patch"|"minor"|"major") -> "v0.2.1" / "v0.3.0" / "v1.0.0". Throws on malformed input. */
|
|
17
|
+
export declare function bump(version: string, kind: BumpKind): string;
|
|
18
|
+
//# sourceMappingURL=semver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.d.ts","sourceRoot":"","sources":["../../src/version/semver.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;4BAG4B;AAC5B,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAIlE;AAED;+DAC+D;AAC/D,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED,2GAA2G;AAC3G,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,MAAM,CAmB5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const VERSION_RE = /^v(\d+)\.(\d+)\.(\d+)$/;
|
|
2
|
+
export function validateVersion(version) {
|
|
3
|
+
return VERSION_RE.test(version);
|
|
4
|
+
}
|
|
5
|
+
/** Parses "vMAJOR.MINOR.PATCH" into a numeric tuple, or null if malformed.
|
|
6
|
+
* Shared by daemon/web/core so version comparisons never degrade into
|
|
7
|
+
* naive string comparison (e.g. "v0.10.0" < "v0.2.0" lexicographically
|
|
8
|
+
* but not numerically). */
|
|
9
|
+
export function parseVersion(version) {
|
|
10
|
+
const match = VERSION_RE.exec(version);
|
|
11
|
+
if (!match)
|
|
12
|
+
return null;
|
|
13
|
+
return { major: Number(match[1]), minor: Number(match[2]), patch: Number(match[3]) };
|
|
14
|
+
}
|
|
15
|
+
/** Numeric comparison: negative if a < b, 0 if equal, positive if a > b.
|
|
16
|
+
* Malformed versions sort as lower than any valid version. */
|
|
17
|
+
export function compareVersions(a, b) {
|
|
18
|
+
const pa = parseVersion(a);
|
|
19
|
+
const pb = parseVersion(b);
|
|
20
|
+
if (!pa && !pb)
|
|
21
|
+
return 0;
|
|
22
|
+
if (!pa)
|
|
23
|
+
return -1;
|
|
24
|
+
if (!pb)
|
|
25
|
+
return 1;
|
|
26
|
+
if (pa.major !== pb.major)
|
|
27
|
+
return pa.major - pb.major;
|
|
28
|
+
if (pa.minor !== pb.minor)
|
|
29
|
+
return pa.minor - pb.minor;
|
|
30
|
+
return pa.patch - pb.patch;
|
|
31
|
+
}
|
|
32
|
+
/** bump("v0.2.0","patch"|"minor"|"major") -> "v0.2.1" / "v0.3.0" / "v1.0.0". Throws on malformed input. */
|
|
33
|
+
export function bump(version, kind) {
|
|
34
|
+
const match = VERSION_RE.exec(version);
|
|
35
|
+
if (!match) {
|
|
36
|
+
throw new Error(`Phiên bản không hợp lệ: "${version}" (cần dạng vMAJOR.MINOR.PATCH).`);
|
|
37
|
+
}
|
|
38
|
+
let [major, minor, patch] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
39
|
+
if (kind === "patch") {
|
|
40
|
+
patch += 1;
|
|
41
|
+
}
|
|
42
|
+
else if (kind === "minor") {
|
|
43
|
+
minor += 1;
|
|
44
|
+
patch = 0;
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
major += 1;
|
|
48
|
+
minor = 0;
|
|
49
|
+
patch = 0;
|
|
50
|
+
}
|
|
51
|
+
return `v${major}.${minor}.${patch}`;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=semver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semver.js","sourceRoot":"","sources":["../../src/version/semver.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,wBAAwB,CAAC;AAU5C,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC;AAED;;;4BAG4B;AAC5B,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACv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