build(coding-agent): embedded assets into binary to eliminate runtime reads

- Embedded assets (themes, templates, agents, commands) directly into binary at compile time using Bun imports.
- Removed runtime filesystem reads for bundled assets in favor of static build-time imports.
- Simplified build scripts by removing copy-assets steps and compiling directly from TypeScript source.
- Updated publish workflow to use bun publish with NPM_CONFIG_TOKEN environment variable.
- Added TypeScript declarations for importing .md, .css, .html, and .js files as text strings.
This commit is contained in:
can1357
2026-01-03 13:45:38 +01:00
parent d657e2cf04
commit a6715fb8f0
14 changed files with 140 additions and 161 deletions
+3 -5
View File
@@ -31,11 +31,9 @@
"scripts": {
"check": "tsgo --noEmit",
"clean": "rm -rf dist",
"build": "tsgo -p tsconfig.build.json && chmod +x dist/cli.js && npm run copy-assets",
"build:binary": "npm run build && bun build --compile ./dist/cli.js --outfile dist/pi && npm run copy-binary-assets",
"copy-assets": "mkdir -p dist/modes/interactive/theme && cp src/modes/interactive/theme/*.json dist/modes/interactive/theme/ && mkdir -p dist/core/export-html && cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/core/export-html/ && mkdir -p dist/core/tools/task/bundled-agents && cp src/core/tools/task/bundled-agents/*.md dist/core/tools/task/bundled-agents/",
"copy-binary-assets": "cp package.json dist/ && cp README.md dist/ && cp CHANGELOG.md dist/ && mkdir -p dist/theme && cp src/modes/interactive/theme/*.json dist/theme/ && mkdir -p dist/export-html && cp src/core/export-html/template.html src/core/export-html/template.css src/core/export-html/template.js dist/export-html/ && cp -r docs dist/ && cp -r examples dist/",
"test": "vitest --run",
"build": "tsgo -p tsconfig.build.json && chmod +x dist/cli.js",
"build:binary": "bun build --compile ./src/cli.ts --outfile dist/pi",
"test": "bun test",
"prepublishOnly": "npm run clean && npm run build"
},
"dependencies": {