pi-harness-runtime 1.1.0 ā 1.1.2
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/.pi/plugins/herdr-clipboard/herdr-plugin.toml +22 -0
- package/.pi/plugins/herdr-clipboard/start-bridge.sh +29 -0
- package/.pi/plugins/herdr-clipboard/tmux-watch.sh +39 -0
- package/CHANGELOG.md +175 -13
- package/README.md +87 -1
- package/config.toml.example +35 -0
- package/harness/autonomous-review.ts +5 -2
- package/harness/e2e/chatgpt-quota-scraper.ts +478 -0
- package/harness/e2e/glm-quota-scraper.ts +449 -0
- package/harness/herdr-agents.ts +6 -2
- package/harness/loop-code-agent.ts +4 -1
- package/harness/loop-review-agent.ts +5 -6
- package/harness/notification-events.ts +2 -2
- package/harness/task-graph.d.ts +51 -0
- package/index.ts +147 -2
- package/package.json +17 -16
- package/packages/a2a-adapter/dist/index.d.ts +1 -0
- package/packages/a2a-adapter/dist/index.d.ts.map +1 -1
- package/packages/a2a-adapter/dist/index.js +1 -0
- package/packages/a2a-adapter/dist/index.js.map +1 -1
- package/packages/a2a-adapter/package.json +1 -1
- package/packages/a2a-adapter/src/discovery.ts +106 -0
- package/packages/a2a-adapter/src/index.ts +8 -0
- package/packages/architecture-generator/package.json +21 -0
- package/packages/architecture-generator/src/adr.ts +51 -0
- package/packages/architecture-generator/src/index.ts +9 -0
- package/packages/architecture-generator/src/mermaid.ts +76 -0
- package/packages/architecture-generator/src/types.ts +30 -0
- package/packages/auth/package.json +1 -1
- package/packages/autonomous-refactor/package.json +1 -1
- package/packages/autonomous-runtime/package.json +1 -1
- package/packages/cache-strategy/package.json +1 -1
- package/packages/capability-registry/package.json +1 -1
- package/packages/checkpoint/package.json +1 -1
- package/packages/cli-plugin-sdk/package.json +2 -2
- package/packages/clipboard/package.json +1 -1
- package/packages/clipboard/src/copy-sync.ts +52 -3
- package/packages/clipboard/src/index.ts +1 -0
- package/packages/clipboard/src/paste-bridge.ts +86 -0
- package/packages/clipboard-plugin/package.json +17 -0
- package/packages/clipboard-plugin/src/index.ts +74 -0
- package/packages/clipboard-plugin/src/types.ts +30 -0
- package/packages/code-generation/package.json +1 -1
- package/packages/code-review/package.json +1 -1
- package/packages/codex-adapter/package.json +2 -2
- package/packages/config-capture/package.json +23 -0
- package/packages/config-capture/src/index.ts +357 -0
- package/packages/context-compiler/package.json +1 -1
- package/packages/context-discovery/package.json +1 -1
- package/packages/context-manager/package.json +1 -1
- package/packages/cookie-sanitizer/package.json +1 -1
- package/packages/cost-optimizer/package.json +1 -1
- package/packages/dependency-analyzer/package.json +1 -1
- package/packages/django-plugin/package.json +1 -1
- package/packages/doc-generator/package.json +1 -1
- package/packages/evaluation-engine/package.json +1 -1
- package/packages/evaluation-runner/package.json +1 -1
- package/packages/event-bus/package.json +1 -1
- package/packages/event-bus/src/herdr-bus.ts +4 -1
- package/packages/event-store/package.json +1 -1
- package/packages/experience-replay/package.json +1 -1
- package/packages/feedback-collector/package.json +1 -1
- package/packages/file-copy-helper/package.json +17 -0
- package/packages/file-copy-helper/src/extension.debug.ts +226 -0
- package/packages/file-copy-helper/src/extension.ts +226 -0
- package/packages/file-copy-helper/src/index.ts +1 -0
- package/packages/framework-detector/package.json +1 -1
- package/packages/framework-plugin-sdk/package.json +1 -1
- package/packages/frappe-plugin/package.json +1 -1
- package/packages/generic-web-plugin/package.json +1 -1
- package/packages/health-monitor/package.json +1 -1
- package/packages/intent-analyzer/package.json +1 -1
- package/packages/knowledge-graph/package.json +24 -0
- package/packages/knowledge-graph/src/graph-extractor.ts +338 -0
- package/packages/knowledge-graph/src/index.ts +27 -0
- package/packages/knowledge-graph/src/mcp-client.ts +237 -0
- package/packages/knowledge-graph/src/provenance-linker.ts +101 -0
- package/packages/knowledge-graph/src/types.ts +86 -0
- package/packages/knowledge-retrieval/package.json +25 -0
- package/packages/knowledge-retrieval/src/index.ts +18 -0
- package/packages/knowledge-retrieval/src/mcp-client.ts +212 -0
- package/packages/knowledge-retrieval/src/types.ts +112 -0
- package/packages/laravel-plugin/package.json +1 -1
- package/packages/learning-engine/package.json +1 -1
- package/packages/mcp-adapter/package.json +1 -1
- package/packages/memory-engine/package.json +1 -1
- package/packages/milestone-manager/package.json +21 -0
- package/packages/milestone-manager/src/engine.ts +105 -0
- package/packages/milestone-manager/src/index.ts +6 -0
- package/packages/milestone-manager/src/types.ts +28 -0
- package/packages/model-registry/package.json +1 -1
- package/packages/nextjs-plugin/package.json +1 -1
- package/packages/notification/package.json +1 -1
- package/packages/notification/src/adapters/line-adapter.ts +119 -0
- package/packages/notification/src/index.ts +1 -0
- package/packages/notification/src/notification-center.ts +6 -0
- package/packages/notification/src/types.ts +7 -2
- package/packages/observability/package.json +1 -1
- package/packages/okf-indexer/package.json +12 -0
- package/packages/okf-indexer/src/cli.ts +25 -0
- package/packages/okf-indexer/src/indexer.ts +186 -0
- package/packages/performance-optimizer/package.json +1 -1
- package/packages/privilege-broker/package.json +1 -1
- package/packages/project-analyzer/package.json +1 -1
- package/packages/project-bootstrap/package.json +24 -0
- package/packages/project-bootstrap/src/bootstrap.ts +166 -0
- package/packages/project-bootstrap/src/frappe.ts +97 -0
- package/packages/project-bootstrap/src/index.ts +27 -0
- package/packages/project-bootstrap/src/minimal.ts +45 -0
- package/packages/project-bootstrap/src/types.ts +66 -0
- package/packages/project-bootstrap/src/typescript.ts +114 -0
- package/packages/projection-engine/package.json +1 -1
- package/packages/prompt-compiler/package.json +1 -1
- package/packages/prompt-versioning/package.json +1 -1
- package/packages/provider-adapter-sdk/package.json +1 -1
- package/packages/provider-router/dist/src/types.js +1 -1
- package/packages/provider-router/package.json +1 -1
- package/packages/provider-selector/package.json +1 -1
- package/packages/providers/package.json +1 -1
- package/packages/providers/src/adapters.ts +1 -1
- package/packages/providers/src/deepagents-adapter.ts +2 -2
- package/packages/quota-manager/package.json +1 -1
- package/packages/quota-manager/src/quota-manager.ts +1 -4
- package/packages/rate-limiter/package.json +1 -1
- package/packages/react-vite-plugin/package.json +1 -1
- package/packages/release-manager/package.json +1 -1
- package/packages/requirement-compiler/package.json +1 -1
- package/packages/runtime/package.json +1 -1
- package/packages/runtime/src/runtime-api.ts +16 -16
- package/packages/scheduler/package.json +1 -1
- package/packages/scheduler-adapter/package.json +1 -1
- package/packages/session/dist/manager.d.ts.map +1 -1
- package/packages/session/dist/manager.js +3 -1
- package/packages/session/dist/manager.js.map +1 -1
- package/packages/session/package.json +1 -1
- package/packages/session/src/manager.ts +4 -1
- package/packages/session-api/package.json +1 -1
- package/packages/session-export/package.json +1 -1
- package/packages/shared-context/package.json +1 -1
- package/packages/skill-registry/package.json +1 -1
- package/packages/sprint-planner/package.json +1 -1
- package/packages/subscription-engine/package.json +1 -1
- package/packages/task-compiler/package.json +1 -1
- package/packages/tencentdb-memory/package.json +23 -0
- package/packages/tencentdb-memory/src/client.ts +130 -0
- package/packages/tencentdb-memory/src/index.ts +32 -0
- package/packages/tencentdb-memory/src/loader.ts +150 -0
- package/packages/tencentdb-memory/src/mcp-tools.ts +213 -0
- package/packages/tencentdb-memory/src/types.ts +101 -0
- package/packages/tencentdb-sync/package.json +26 -0
- package/packages/tencentdb-sync/src/cli.ts +363 -0
- package/packages/tencentdb-sync/src/client.ts +268 -0
- package/packages/tencentdb-sync/src/config.ts +139 -0
- package/packages/tencentdb-sync/src/index.ts +15 -0
- package/packages/test-data-generator/package.json +1 -1
- package/packages/test-generator/package.json +1 -1
- package/packages/todo-bd-sync/package.json +1 -1
- package/packages/todo-bd-sync/src/detector.ts +25 -4
- package/packages/todo-bd-sync/src/extension.ts +8 -86
- package/packages/todo-bd-sync/src/task-analyzer.ts +314 -0
- package/packages/token-estimation/package.json +1 -1
- package/packages/token-optimizer/package.json +1 -1
- package/packages/tui/package.json +1 -1
- package/packages/types/package.json +1 -1
- package/packages/types/src/agent-worker-types.d.ts +206 -0
- package/packages/types/src/ai-providers.d.ts +36 -0
- package/packages/types/src/runtime-types.d.ts +6 -0
- package/packages/workflow-events/package.json +1 -1
- package/packages/workspace-scanner/package.json +1 -1
- package/packages/worktree/package.json +1 -1
- package/packages/worktree/src/worktree.ts +1 -4
- package/packages/write-review/package.json +22 -0
- package/packages/write-review/src/blackboard.ts +249 -0
- package/packages/write-review/src/gate.ts +169 -0
- package/packages/write-review/src/index.ts +65 -0
- package/packages/write-review/src/injection.ts +190 -0
- package/packages/write-review/src/review.ts +206 -0
- package/packages/write-review/src/trigger.ts +133 -0
- package/packages/write-review/src/types.ts +90 -0
- package/prompts/agents/reviewer.md +57 -0
- package/prompts/agents/writer.md +42 -0
- package/prompts/slash-commands.md +40 -0
- package/prompts/tencentdb-connect.md +35 -0
- package/prompts/tencentdb-setup.md +101 -0
- package/prompts/tencentdb.md +88 -0
- package/prompts/write-review.md +50 -0
- package/scripts/check-version-sync.ts +80 -0
- package/scripts/convert-skills-to-okf.ts +168 -0
- package/scripts/copy-plugins.js +56 -0
- package/scripts/gist-auth.ts +64 -0
- package/scripts/gist-poll.sh +127 -0
- package/scripts/release/actions-monitor.ts +357 -0
- package/scripts/release/adapters/base.ts +95 -0
- package/scripts/release/adapters/detector.ts +181 -0
- package/scripts/release/adapters/node-workspace.ts +230 -0
- package/scripts/release/adapters/python.ts +236 -0
- package/scripts/release/adapters/rust.ts +129 -0
- package/scripts/release/adapters/tauri.ts +298 -0
- package/scripts/release/orchestrator.ts +278 -0
- package/scripts/release-all.ts +211 -0
- package/scripts/scan-secrets.sh +68 -0
- package/scripts/skills-sync.ts +487 -0
- package/packages/a2a-adapter/tsconfig.json +0 -5
- package/packages/auth/dist/minimax-browser-auth.d.ts +0 -89
- package/packages/auth/dist/minimax-browser-auth.d.ts.map +0 -1
- package/packages/auth/dist/minimax-browser-auth.js +0 -890
- package/packages/auth/dist/minimax-browser-auth.js.map +0 -1
- package/packages/auth/dist/run-minimax-auth.d.ts +0 -19
- package/packages/auth/dist/run-minimax-auth.d.ts.map +0 -1
- package/packages/auth/dist/run-minimax-auth.js +0 -112
- package/packages/auth/dist/run-minimax-auth.js.map +0 -1
- package/packages/auth/tsconfig.json +0 -9
- package/packages/autonomous-refactor/tsconfig.json +0 -5
- package/packages/autonomous-runtime/test/inbox.test.mjs +0 -266
- package/packages/autonomous-runtime/tsconfig.json +0 -22
- package/packages/autonomous-runtime/tsconfig.tsbuildinfo +0 -1
- package/packages/cache-strategy/tsconfig.json +0 -5
- package/packages/capability-registry/src/types.d.ts.map +0 -1
- package/packages/capability-registry/src/types.js +0 -10
- package/packages/capability-registry/src/types.js.map +0 -1
- package/packages/capability-registry/tsconfig.json +0 -22
- package/packages/checkpoint/tsconfig.json +0 -33
- package/packages/checkpoint/tsconfig.tsbuildinfo +0 -1
- package/packages/cli-plugin-sdk/tsconfig.json +0 -11
- package/packages/clipboard/dist/src/clipboard.d.ts +0 -11
- package/packages/clipboard/dist/src/clipboard.d.ts.map +0 -1
- package/packages/clipboard/dist/src/clipboard.js +0 -51
- package/packages/clipboard/dist/src/clipboard.js.map +0 -1
- package/packages/clipboard/dist/src/copy-sync.d.ts +0 -27
- package/packages/clipboard/dist/src/copy-sync.d.ts.map +0 -1
- package/packages/clipboard/dist/src/copy-sync.js +0 -170
- package/packages/clipboard/dist/src/copy-sync.js.map +0 -1
- package/packages/clipboard/dist/src/gist-relay.d.ts +0 -48
- package/packages/clipboard/dist/src/gist-relay.d.ts.map +0 -1
- package/packages/clipboard/dist/src/gist-relay.js +0 -186
- package/packages/clipboard/dist/src/gist-relay.js.map +0 -1
- package/packages/clipboard/dist/src/github-login.d.ts +0 -16
- package/packages/clipboard/dist/src/github-login.d.ts.map +0 -1
- package/packages/clipboard/dist/src/github-login.js +0 -69
- package/packages/clipboard/dist/src/github-login.js.map +0 -1
- package/packages/clipboard/dist/src/index.d.ts +0 -4
- package/packages/clipboard/dist/src/index.d.ts.map +0 -1
- package/packages/clipboard/dist/src/index.js +0 -3
- package/packages/clipboard/dist/src/index.js.map +0 -1
- package/packages/clipboard/dist/src/types.d.ts +0 -13
- package/packages/clipboard/dist/src/types.d.ts.map +0 -1
- package/packages/clipboard/dist/src/types.js +0 -5
- package/packages/clipboard/dist/src/types.js.map +0 -1
- package/packages/clipboard/test/mojibake.test.mjs +0 -143
- package/packages/clipboard/tsconfig.json +0 -10
- package/packages/code-generation/tsconfig.json +0 -33
- package/packages/code-generation/tsconfig.tsbuildinfo +0 -1
- package/packages/code-review/tsconfig.json +0 -33
- package/packages/code-review/tsconfig.tsbuildinfo +0 -1
- package/packages/codex-adapter/tsconfig.json +0 -5
- package/packages/context-compiler/tsconfig.json +0 -17
- package/packages/context-discovery/dist/src/discover.d.ts +0 -3
- package/packages/context-discovery/dist/src/discover.d.ts.map +0 -1
- package/packages/context-discovery/dist/src/discover.js +0 -42
- package/packages/context-discovery/dist/src/discover.js.map +0 -1
- package/packages/context-discovery/dist/src/discovery.d.ts +0 -28
- package/packages/context-discovery/dist/src/discovery.d.ts.map +0 -1
- package/packages/context-discovery/dist/src/discovery.js +0 -21
- package/packages/context-discovery/dist/src/discovery.js.map +0 -1
- package/packages/context-discovery/dist/src/index.d.ts +0 -3
- package/packages/context-discovery/dist/src/index.d.ts.map +0 -1
- package/packages/context-discovery/dist/src/index.js +0 -2
- package/packages/context-discovery/dist/src/index.js.map +0 -1
- package/packages/context-discovery/dist/src/types.d.ts +0 -16
- package/packages/context-discovery/dist/src/types.d.ts.map +0 -1
- package/packages/context-discovery/dist/src/types.js +0 -2
- package/packages/context-discovery/dist/src/types.js.map +0 -1
- package/packages/context-discovery/tsconfig.json +0 -10
- package/packages/context-manager/tsconfig.json +0 -6
- package/packages/cookie-sanitizer/tsconfig.json +0 -8
- package/packages/cost-optimizer/tsconfig.json +0 -22
- package/packages/dependency-analyzer/dist/src/analyzer.d.ts +0 -17
- package/packages/dependency-analyzer/dist/src/analyzer.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/src/analyzer.js +0 -119
- package/packages/dependency-analyzer/dist/src/analyzer.js.map +0 -1
- package/packages/dependency-analyzer/dist/src/imports.d.ts +0 -12
- package/packages/dependency-analyzer/dist/src/imports.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/src/imports.js +0 -73
- package/packages/dependency-analyzer/dist/src/imports.js.map +0 -1
- package/packages/dependency-analyzer/dist/src/index.d.ts +0 -4
- package/packages/dependency-analyzer/dist/src/index.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/src/index.js +0 -3
- package/packages/dependency-analyzer/dist/src/index.js.map +0 -1
- package/packages/dependency-analyzer/dist/src/types.d.ts +0 -28
- package/packages/dependency-analyzer/dist/src/types.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/src/types.js +0 -5
- package/packages/dependency-analyzer/dist/src/types.js.map +0 -1
- package/packages/dependency-analyzer/test/analyzer.test.js +0 -37
- package/packages/dependency-analyzer/tsconfig.json +0 -10
- package/packages/django-plugin/tsconfig.json +0 -12
- package/packages/doc-generator/tsconfig.json +0 -6
- package/packages/evaluation-engine/tsconfig.json +0 -8
- package/packages/evaluation-runner/tsconfig.json +0 -5
- package/packages/event-bus/dist/src/bus.d.ts +0 -15
- package/packages/event-bus/dist/src/bus.d.ts.map +0 -1
- package/packages/event-bus/dist/src/bus.js +0 -98
- package/packages/event-bus/dist/src/bus.js.map +0 -1
- package/packages/event-bus/dist/src/herdr-bus.d.ts +0 -121
- package/packages/event-bus/dist/src/herdr-bus.d.ts.map +0 -1
- package/packages/event-bus/dist/src/herdr-bus.js +0 -322
- package/packages/event-bus/dist/src/herdr-bus.js.map +0 -1
- package/packages/event-bus/dist/src/index.d.ts +0 -6
- package/packages/event-bus/dist/src/index.d.ts.map +0 -1
- package/packages/event-bus/dist/src/index.js +0 -4
- package/packages/event-bus/dist/src/index.js.map +0 -1
- package/packages/event-bus/dist/src/types.d.ts +0 -27
- package/packages/event-bus/dist/src/types.d.ts.map +0 -1
- package/packages/event-bus/dist/src/types.js +0 -10
- package/packages/event-bus/dist/src/types.js.map +0 -1
- package/packages/event-bus/tsconfig.json +0 -10
- package/packages/event-store/dist/src/index.d.ts +0 -3
- package/packages/event-store/dist/src/index.d.ts.map +0 -1
- package/packages/event-store/dist/src/index.js +0 -2
- package/packages/event-store/dist/src/index.js.map +0 -1
- package/packages/event-store/dist/src/store.d.ts +0 -15
- package/packages/event-store/dist/src/store.d.ts.map +0 -1
- package/packages/event-store/dist/src/store.js +0 -139
- package/packages/event-store/dist/src/store.js.map +0 -1
- package/packages/event-store/dist/src/types.d.ts +0 -48
- package/packages/event-store/dist/src/types.d.ts.map +0 -1
- package/packages/event-store/dist/src/types.js +0 -5
- package/packages/event-store/dist/src/types.js.map +0 -1
- package/packages/event-store/src/types.d.ts.map +0 -1
- package/packages/event-store/src/types.js +0 -5
- package/packages/event-store/src/types.js.map +0 -1
- package/packages/event-store/tsconfig.json +0 -10
- package/packages/experience-replay/tsconfig.json +0 -8
- package/packages/feedback-collector/tsconfig.json +0 -5
- package/packages/framework-detector/tsconfig.json +0 -33
- package/packages/framework-detector/tsconfig.tsbuildinfo +0 -1
- package/packages/framework-plugin-sdk/tsconfig.json +0 -33
- package/packages/framework-plugin-sdk/tsconfig.tsbuildinfo +0 -1
- package/packages/frappe-plugin/tsconfig.json +0 -12
- package/packages/generic-web-plugin/tsconfig.json +0 -12
- package/packages/health-monitor/tsconfig.json +0 -5
- package/packages/intent-analyzer/dist/src/analyzer.d.ts +0 -13
- package/packages/intent-analyzer/dist/src/analyzer.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/src/analyzer.js +0 -239
- package/packages/intent-analyzer/dist/src/analyzer.js.map +0 -1
- package/packages/intent-analyzer/dist/src/index.d.ts +0 -3
- package/packages/intent-analyzer/dist/src/index.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/src/index.js +0 -2
- package/packages/intent-analyzer/dist/src/index.js.map +0 -1
- package/packages/intent-analyzer/dist/src/types.d.ts +0 -26
- package/packages/intent-analyzer/dist/src/types.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/src/types.js +0 -7
- package/packages/intent-analyzer/dist/src/types.js.map +0 -1
- package/packages/intent-analyzer/tsconfig.json +0 -10
- package/packages/laravel-plugin/tsconfig.json +0 -12
- package/packages/learning-engine/tsconfig.json +0 -8
- package/packages/mcp-adapter/tsconfig.json +0 -8
- package/packages/memory-engine/tsconfig.json +0 -8
- package/packages/model-registry/src/types.d.ts.map +0 -1
- package/packages/model-registry/src/types.js +0 -5
- package/packages/model-registry/src/types.js.map +0 -1
- package/packages/model-registry/tsconfig.json +0 -22
- package/packages/nextjs-plugin/tsconfig.json +0 -12
- package/packages/notification/dist/adapters/email-adapter.d.ts +0 -17
- package/packages/notification/dist/adapters/email-adapter.d.ts.map +0 -1
- package/packages/notification/dist/adapters/email-adapter.js +0 -89
- package/packages/notification/dist/adapters/email-adapter.js.map +0 -1
- package/packages/notification/dist/adapters/ntfy-adapter.d.ts +0 -17
- package/packages/notification/dist/adapters/ntfy-adapter.d.ts.map +0 -1
- package/packages/notification/dist/adapters/ntfy-adapter.js +0 -84
- package/packages/notification/dist/adapters/ntfy-adapter.js.map +0 -1
- package/packages/notification/dist/adapters/telegram-adapter.d.ts +0 -17
- package/packages/notification/dist/adapters/telegram-adapter.d.ts.map +0 -1
- package/packages/notification/dist/adapters/telegram-adapter.js +0 -88
- package/packages/notification/dist/adapters/telegram-adapter.js.map +0 -1
- package/packages/notification/dist/adapters/webhook-adapter.d.ts +0 -15
- package/packages/notification/dist/adapters/webhook-adapter.d.ts.map +0 -1
- package/packages/notification/dist/adapters/webhook-adapter.js +0 -64
- package/packages/notification/dist/adapters/webhook-adapter.js.map +0 -1
- package/packages/notification/dist/base-adapter.d.ts +0 -36
- package/packages/notification/dist/base-adapter.d.ts.map +0 -1
- package/packages/notification/dist/base-adapter.js +0 -39
- package/packages/notification/dist/base-adapter.js.map +0 -1
- package/packages/notification/dist/index.d.ts +0 -9
- package/packages/notification/dist/index.d.ts.map +0 -1
- package/packages/notification/dist/index.js +0 -9
- package/packages/notification/dist/index.js.map +0 -1
- package/packages/notification/dist/notification-center.d.ts +0 -46
- package/packages/notification/dist/notification-center.d.ts.map +0 -1
- package/packages/notification/dist/notification-center.js +0 -228
- package/packages/notification/dist/notification-center.js.map +0 -1
- package/packages/notification/dist/types.d.ts +0 -65
- package/packages/notification/dist/types.d.ts.map +0 -1
- package/packages/notification/dist/types.js +0 -7
- package/packages/notification/dist/types.js.map +0 -1
- package/packages/notification/tsconfig.json +0 -8
- package/packages/observability/tsconfig.json +0 -33
- package/packages/observability/tsconfig.tsbuildinfo +0 -1
- package/packages/performance-optimizer/tsconfig.json +0 -8
- package/packages/privilege-broker/config/privileges.yaml.example +0 -172
- package/packages/privilege-broker/tsconfig.json +0 -22
- package/packages/privilege-broker/tsconfig.tsbuildinfo +0 -1
- package/packages/project-analyzer/tsconfig.json +0 -33
- package/packages/project-analyzer/tsconfig.tsbuildinfo +0 -1
- package/packages/projection-engine/dist/src/engine.d.ts +0 -61
- package/packages/projection-engine/dist/src/engine.d.ts.map +0 -1
- package/packages/projection-engine/dist/src/engine.js +0 -87
- package/packages/projection-engine/dist/src/engine.js.map +0 -1
- package/packages/projection-engine/dist/src/index.d.ts +0 -2
- package/packages/projection-engine/dist/src/index.d.ts.map +0 -1
- package/packages/projection-engine/dist/src/index.js +0 -2
- package/packages/projection-engine/dist/src/index.js.map +0 -1
- package/packages/projection-engine/dist/src/project.d.ts +0 -3
- package/packages/projection-engine/dist/src/project.d.ts.map +0 -1
- package/packages/projection-engine/dist/src/project.js +0 -24
- package/packages/projection-engine/dist/src/project.js.map +0 -1
- package/packages/projection-engine/dist/src/types.d.ts +0 -55
- package/packages/projection-engine/dist/src/types.d.ts.map +0 -1
- package/packages/projection-engine/dist/src/types.js +0 -5
- package/packages/projection-engine/dist/src/types.js.map +0 -1
- package/packages/projection-engine/src/types.d.ts.map +0 -1
- package/packages/projection-engine/src/types.js +0 -5
- package/packages/projection-engine/src/types.js.map +0 -1
- package/packages/projection-engine/tsconfig.json +0 -10
- package/packages/prompt-compiler/tsconfig.json +0 -19
- package/packages/prompt-versioning/tsconfig.json +0 -5
- package/packages/provider-adapter-sdk/dist/tsconfig.tsbuildinfo +0 -1
- package/packages/provider-adapter-sdk/tsconfig.json +0 -34
- package/packages/provider-adapter-sdk/tsconfig.tsbuildinfo +0 -1
- package/packages/provider-router/tsconfig.json +0 -20
- package/packages/provider-selector/tsconfig.json +0 -6
- package/packages/providers/dist/adapters.d.ts +0 -133
- package/packages/providers/dist/adapters.d.ts.map +0 -1
- package/packages/providers/dist/adapters.js +0 -236
- package/packages/providers/dist/adapters.js.map +0 -1
- package/packages/providers/dist/deepagents-adapter.d.ts +0 -78
- package/packages/providers/dist/deepagents-adapter.d.ts.map +0 -1
- package/packages/providers/dist/deepagents-adapter.js +0 -323
- package/packages/providers/dist/deepagents-adapter.js.map +0 -1
- package/packages/providers/dist/glm-usage.d.ts +0 -102
- package/packages/providers/dist/glm-usage.d.ts.map +0 -1
- package/packages/providers/dist/glm-usage.js +0 -197
- package/packages/providers/dist/glm-usage.js.map +0 -1
- package/packages/providers/dist/index.d.ts +0 -11
- package/packages/providers/dist/index.d.ts.map +0 -1
- package/packages/providers/dist/index.js +0 -11
- package/packages/providers/dist/index.js.map +0 -1
- package/packages/providers/dist/openai-usage.d.ts +0 -103
- package/packages/providers/dist/openai-usage.d.ts.map +0 -1
- package/packages/providers/dist/openai-usage.js +0 -208
- package/packages/providers/dist/openai-usage.js.map +0 -1
- package/packages/providers/dist/provider-id.d.ts +0 -46
- package/packages/providers/dist/provider-id.d.ts.map +0 -1
- package/packages/providers/dist/provider-id.js +0 -113
- package/packages/providers/dist/provider-id.js.map +0 -1
- package/packages/providers/tsconfig.json +0 -8
- package/packages/quota-manager/dist/examples/tui-usage-integration.d.ts +0 -35
- package/packages/quota-manager/dist/examples/tui-usage-integration.d.ts.map +0 -1
- package/packages/quota-manager/dist/examples/tui-usage-integration.js +0 -73
- package/packages/quota-manager/dist/examples/tui-usage-integration.js.map +0 -1
- package/packages/quota-manager/dist/index.d.ts +0 -8
- package/packages/quota-manager/dist/index.d.ts.map +0 -1
- package/packages/quota-manager/dist/index.js +0 -8
- package/packages/quota-manager/dist/index.js.map +0 -1
- package/packages/quota-manager/dist/quota-manager.d.ts +0 -70
- package/packages/quota-manager/dist/quota-manager.d.ts.map +0 -1
- package/packages/quota-manager/dist/quota-manager.js +0 -260
- package/packages/quota-manager/dist/quota-manager.js.map +0 -1
- package/packages/quota-manager/dist/tui-usage-monitor.d.ts +0 -96
- package/packages/quota-manager/dist/tui-usage-monitor.d.ts.map +0 -1
- package/packages/quota-manager/dist/tui-usage-monitor.js +0 -268
- package/packages/quota-manager/dist/tui-usage-monitor.js.map +0 -1
- package/packages/quota-manager/tsconfig.json +0 -8
- package/packages/rate-limiter/tsconfig.json +0 -5
- package/packages/react-vite-plugin/tsconfig.json +0 -12
- package/packages/release-manager/tsconfig.json +0 -5
- package/packages/requirement-compiler/tsconfig.json +0 -22
- package/packages/runtime/dist/command-executor.d.ts +0 -129
- package/packages/runtime/dist/command-executor.d.ts.map +0 -1
- package/packages/runtime/dist/command-executor.js +0 -383
- package/packages/runtime/dist/command-executor.js.map +0 -1
- package/packages/runtime/dist/index.d.ts +0 -11
- package/packages/runtime/dist/index.d.ts.map +0 -1
- package/packages/runtime/dist/index.js +0 -11
- package/packages/runtime/dist/index.js.map +0 -1
- package/packages/runtime/dist/local-runtime-agent.d.ts +0 -111
- package/packages/runtime/dist/local-runtime-agent.d.ts.map +0 -1
- package/packages/runtime/dist/local-runtime-agent.js +0 -356
- package/packages/runtime/dist/local-runtime-agent.js.map +0 -1
- package/packages/runtime/dist/policy-engine.d.ts +0 -203
- package/packages/runtime/dist/policy-engine.d.ts.map +0 -1
- package/packages/runtime/dist/policy-engine.js +0 -592
- package/packages/runtime/dist/policy-engine.js.map +0 -1
- package/packages/runtime/dist/runtime-api.d.ts +0 -137
- package/packages/runtime/dist/runtime-api.d.ts.map +0 -1
- package/packages/runtime/dist/runtime-api.js +0 -454
- package/packages/runtime/dist/runtime-api.js.map +0 -1
- package/packages/runtime/dist/workspace-manager.d.ts +0 -162
- package/packages/runtime/dist/workspace-manager.d.ts.map +0 -1
- package/packages/runtime/dist/workspace-manager.js +0 -451
- package/packages/runtime/dist/workspace-manager.js.map +0 -1
- package/packages/runtime/tsconfig.json +0 -8
- package/packages/scheduler-adapter/tsconfig.json +0 -22
- package/packages/scheduler-adapter/tsconfig.tsbuildinfo +0 -1
- package/packages/session/tsconfig.json +0 -33
- package/packages/session/tsconfig.tsbuildinfo +0 -1
- package/packages/session-api/dist/src/api.d.ts +0 -83
- package/packages/session-api/dist/src/api.d.ts.map +0 -1
- package/packages/session-api/dist/src/api.js +0 -49
- package/packages/session-api/dist/src/api.js.map +0 -1
- package/packages/session-api/dist/src/index.d.ts +0 -2
- package/packages/session-api/dist/src/index.d.ts.map +0 -1
- package/packages/session-api/dist/src/index.js +0 -2
- package/packages/session-api/dist/src/index.js.map +0 -1
- package/packages/session-api/dist/src/types.d.ts +0 -22
- package/packages/session-api/dist/src/types.d.ts.map +0 -1
- package/packages/session-api/dist/src/types.js +0 -5
- package/packages/session-api/dist/src/types.js.map +0 -1
- package/packages/session-api/tsconfig.json +0 -10
- package/packages/session-export/dist/src/exporter.d.ts +0 -28
- package/packages/session-export/dist/src/exporter.d.ts.map +0 -1
- package/packages/session-export/dist/src/exporter.js +0 -42
- package/packages/session-export/dist/src/exporter.js.map +0 -1
- package/packages/session-export/dist/src/index.d.ts +0 -2
- package/packages/session-export/dist/src/index.d.ts.map +0 -1
- package/packages/session-export/dist/src/index.js +0 -2
- package/packages/session-export/dist/src/index.js.map +0 -1
- package/packages/session-export/dist/src/types.d.ts +0 -20
- package/packages/session-export/dist/src/types.d.ts.map +0 -1
- package/packages/session-export/dist/src/types.js +0 -5
- package/packages/session-export/dist/src/types.js.map +0 -1
- package/packages/session-export/tsconfig.json +0 -10
- package/packages/skill-registry/tsconfig.json +0 -22
- package/packages/sprint-planner/tsconfig.json +0 -5
- package/packages/subscription-engine/dist/src/engine.d.ts +0 -13
- package/packages/subscription-engine/dist/src/engine.d.ts.map +0 -1
- package/packages/subscription-engine/dist/src/engine.js +0 -40
- package/packages/subscription-engine/dist/src/engine.js.map +0 -1
- package/packages/subscription-engine/dist/src/index.d.ts +0 -2
- package/packages/subscription-engine/dist/src/index.d.ts.map +0 -1
- package/packages/subscription-engine/dist/src/index.js +0 -2
- package/packages/subscription-engine/dist/src/index.js.map +0 -1
- package/packages/subscription-engine/dist/src/subscriptions.d.ts +0 -19
- package/packages/subscription-engine/dist/src/subscriptions.d.ts.map +0 -1
- package/packages/subscription-engine/dist/src/subscriptions.js +0 -39
- package/packages/subscription-engine/dist/src/subscriptions.js.map +0 -1
- package/packages/subscription-engine/dist/src/types.d.ts +0 -24
- package/packages/subscription-engine/dist/src/types.d.ts.map +0 -1
- package/packages/subscription-engine/dist/src/types.js +0 -5
- package/packages/subscription-engine/dist/src/types.js.map +0 -1
- package/packages/subscription-engine/tsconfig.json +0 -10
- package/packages/task-compiler/tsconfig.json +0 -24
- package/packages/test-data-generator/tsconfig.json +0 -33
- package/packages/test-data-generator/tsconfig.tsbuildinfo +0 -1
- package/packages/test-generator/tsconfig.json +0 -6
- package/packages/token-optimizer/tsconfig.json +0 -6
- package/packages/tui/tsconfig.json +0 -8
- package/packages/types/src/runtime-types.d.ts.map +0 -1
- package/packages/types/src/runtime-types.js +0 -2
- package/packages/types/src/runtime-types.js.map +0 -1
- package/packages/types/tsconfig.json +0 -21
- package/packages/types/tsconfig.tsbuildinfo +0 -1
- package/packages/workflow-events/dist/src/events.d.ts +0 -38
- package/packages/workflow-events/dist/src/events.d.ts.map +0 -1
- package/packages/workflow-events/dist/src/events.js +0 -55
- package/packages/workflow-events/dist/src/events.js.map +0 -1
- package/packages/workflow-events/dist/src/index.d.ts +0 -2
- package/packages/workflow-events/dist/src/index.d.ts.map +0 -1
- package/packages/workflow-events/dist/src/index.js +0 -2
- package/packages/workflow-events/dist/src/index.js.map +0 -1
- package/packages/workflow-events/dist/src/pipeline.d.ts +0 -21
- package/packages/workflow-events/dist/src/pipeline.d.ts.map +0 -1
- package/packages/workflow-events/dist/src/pipeline.js +0 -36
- package/packages/workflow-events/dist/src/pipeline.js.map +0 -1
- package/packages/workflow-events/dist/src/types.d.ts +0 -110
- package/packages/workflow-events/dist/src/types.d.ts.map +0 -1
- package/packages/workflow-events/dist/src/types.js +0 -5
- package/packages/workflow-events/dist/src/types.js.map +0 -1
- package/packages/workflow-events/src/types.d.ts.map +0 -1
- package/packages/workflow-events/src/types.js +0 -5
- package/packages/workflow-events/src/types.js.map +0 -1
- package/packages/workflow-events/tsconfig.json +0 -10
- package/packages/workspace-scanner/dist/src/detect.d.ts +0 -3
- package/packages/workspace-scanner/dist/src/detect.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/src/detect.js +0 -60
- package/packages/workspace-scanner/dist/src/detect.js.map +0 -1
- package/packages/workspace-scanner/dist/src/git.d.ts +0 -7
- package/packages/workspace-scanner/dist/src/git.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/src/git.js +0 -75
- package/packages/workspace-scanner/dist/src/git.js.map +0 -1
- package/packages/workspace-scanner/dist/src/index.d.ts +0 -5
- package/packages/workspace-scanner/dist/src/index.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/src/index.js +0 -4
- package/packages/workspace-scanner/dist/src/index.js.map +0 -1
- package/packages/workspace-scanner/dist/src/scanner.d.ts +0 -11
- package/packages/workspace-scanner/dist/src/scanner.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/src/scanner.js +0 -59
- package/packages/workspace-scanner/dist/src/scanner.js.map +0 -1
- package/packages/workspace-scanner/dist/src/types.d.ts +0 -35
- package/packages/workspace-scanner/dist/src/types.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/src/types.js +0 -5
- package/packages/workspace-scanner/dist/src/types.js.map +0 -1
- package/packages/workspace-scanner/test/scanner.test.js +0 -31
- package/packages/workspace-scanner/tsconfig.json +0 -10
- package/packages/worktree/dist/index.d.ts +0 -7
- package/packages/worktree/dist/index.d.ts.map +0 -1
- package/packages/worktree/dist/index.js +0 -7
- package/packages/worktree/dist/index.js.map +0 -1
- package/packages/worktree/dist/worktree.d.ts +0 -88
- package/packages/worktree/dist/worktree.d.ts.map +0 -1
- package/packages/worktree/dist/worktree.js +0 -242
- package/packages/worktree/dist/worktree.js.map +0 -1
- package/packages/worktree/tsconfig.json +0 -8
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tauri adapter.
|
|
3
|
+
*
|
|
4
|
+
* Handles version synchronization for Tauri desktop apps across:
|
|
5
|
+
* - package.json (npm frontend version)
|
|
6
|
+
* - src-tauri/Cargo.toml (Rust backend version)
|
|
7
|
+
* - src-tauri/tauri.conf.json (Tauri app version)
|
|
8
|
+
*
|
|
9
|
+
* Source of truth: whichever file has the version that was bumped,
|
|
10
|
+
* typically package.json. Other files are synchronized to match.
|
|
11
|
+
*
|
|
12
|
+
* Detection: repo has src-tauri/Cargo.toml AND src-tauri/tauri.conf.json
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
AdapterContext,
|
|
17
|
+
BumpResult,
|
|
18
|
+
ReleaseAdapter,
|
|
19
|
+
VerificationResult,
|
|
20
|
+
VersionManifest,
|
|
21
|
+
} from "./base.ts";
|
|
22
|
+
import { readFile } from "node:fs/promises";
|
|
23
|
+
import { existsSync } from "node:fs";
|
|
24
|
+
import { join } from "path";
|
|
25
|
+
|
|
26
|
+
const MANIFESTS = [
|
|
27
|
+
"package.json",
|
|
28
|
+
"src-tauri/Cargo.toml",
|
|
29
|
+
"src-tauri/tauri.conf.json",
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
type TauriManifest = (typeof MANIFESTS)[number];
|
|
33
|
+
|
|
34
|
+
function parsePackageJson(content: string): string | null {
|
|
35
|
+
try {
|
|
36
|
+
const pkg = JSON.parse(content);
|
|
37
|
+
return typeof pkg.version === "string" ? pkg.version : null;
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function parseCargoToml(content: string): string | null {
|
|
44
|
+
// Cargo.toml version: version = "1.2.3"
|
|
45
|
+
const match = content.match(/^\s*version\s*=\s*"([^"]+)"/m);
|
|
46
|
+
return match ? match[1] : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function parseTauriConf(content: string): string | null {
|
|
50
|
+
try {
|
|
51
|
+
const conf = JSON.parse(content);
|
|
52
|
+
return typeof conf.version === "string" ? conf.version : null;
|
|
53
|
+
} catch {
|
|
54
|
+
// Try toml format
|
|
55
|
+
const match = content.match(/^\s*version\s*=\s*"([^"]+)"/m);
|
|
56
|
+
return match ? match[1] : null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function parseVersion(path: TauriManifest, content: string): string | null {
|
|
61
|
+
switch (path) {
|
|
62
|
+
case "package.json":
|
|
63
|
+
return parsePackageJson(content);
|
|
64
|
+
case "src-tauri/Cargo.toml":
|
|
65
|
+
return parseCargoToml(content);
|
|
66
|
+
case "src-tauri/tauri.conf.json":
|
|
67
|
+
return parseTauriConf(content);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function writePackageJson(
|
|
72
|
+
ctx: AdapterContext,
|
|
73
|
+
relPath: string,
|
|
74
|
+
version: string,
|
|
75
|
+
): Promise<void> {
|
|
76
|
+
if (ctx.dryRun) return;
|
|
77
|
+
const { readFile, writeFile } = await import("node:fs/promises");
|
|
78
|
+
const absPath = join(ctx.repoRoot, relPath);
|
|
79
|
+
let pkg: Record<string, unknown>;
|
|
80
|
+
try {
|
|
81
|
+
pkg = JSON.parse(await readFile(absPath, "utf-8"));
|
|
82
|
+
} catch {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
pkg.version = version;
|
|
86
|
+
await writeFile(absPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
async function writeCargoToml(
|
|
90
|
+
ctx: AdapterContext,
|
|
91
|
+
relPath: string,
|
|
92
|
+
version: string,
|
|
93
|
+
): Promise<void> {
|
|
94
|
+
if (ctx.dryRun) return;
|
|
95
|
+
const { readFile, writeFile } = await import("node:fs/promises");
|
|
96
|
+
const absPath = join(ctx.repoRoot, relPath);
|
|
97
|
+
let content: string;
|
|
98
|
+
try {
|
|
99
|
+
content = await readFile(absPath, "utf-8");
|
|
100
|
+
} catch {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
// Replace version = "x.y.z" with new version
|
|
104
|
+
content = content.replace(
|
|
105
|
+
/^(\s*version\s*=\s*")([^"]+)(")/m,
|
|
106
|
+
`$1${version}$3`,
|
|
107
|
+
);
|
|
108
|
+
await writeFile(absPath, content);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function writeTauriConf(
|
|
112
|
+
ctx: AdapterContext,
|
|
113
|
+
relPath: string,
|
|
114
|
+
version: string,
|
|
115
|
+
): Promise<void> {
|
|
116
|
+
if (ctx.dryRun) return;
|
|
117
|
+
const { readFile, writeFile } = await import("node:fs/promises");
|
|
118
|
+
const absPath = join(ctx.repoRoot, relPath);
|
|
119
|
+
let content: string;
|
|
120
|
+
try {
|
|
121
|
+
content = await readFile(absPath, "utf-8");
|
|
122
|
+
} catch {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Try JSON first
|
|
127
|
+
try {
|
|
128
|
+
const conf = JSON.parse(content);
|
|
129
|
+
conf.version = version;
|
|
130
|
+
await writeFile(absPath, JSON.stringify(conf, null, 2) + "\n");
|
|
131
|
+
return;
|
|
132
|
+
} catch {
|
|
133
|
+
// Not JSON, try TOML
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// TOML format: version = "1.2.3"
|
|
137
|
+
content = content.replace(
|
|
138
|
+
/^(\s*version\s*=\s*")([^"]+)(")/m,
|
|
139
|
+
`$1${version}$3`,
|
|
140
|
+
);
|
|
141
|
+
await writeFile(absPath, content);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
async function writeManifest(
|
|
145
|
+
ctx: AdapterContext,
|
|
146
|
+
relPath: string,
|
|
147
|
+
version: string,
|
|
148
|
+
): Promise<void> {
|
|
149
|
+
if (relPath === "package.json") {
|
|
150
|
+
await writePackageJson(ctx, relPath, version);
|
|
151
|
+
} else if (relPath === "src-tauri/Cargo.toml") {
|
|
152
|
+
await writeCargoToml(ctx, relPath, version);
|
|
153
|
+
} else if (relPath === "src-tauri/tauri.conf.json") {
|
|
154
|
+
await writeTauriConf(ctx, relPath, version);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const tauriAdapter: ReleaseAdapter = {
|
|
159
|
+
id: "tauri",
|
|
160
|
+
name: "Tauri Desktop App",
|
|
161
|
+
|
|
162
|
+
detect(ctx: AdapterContext): number {
|
|
163
|
+
const hasCargo = existsSync(join(ctx.repoRoot, "src-tauri", "Cargo.toml"));
|
|
164
|
+
const hasTauriConf = existsSync(
|
|
165
|
+
join(ctx.repoRoot, "src-tauri", "tauri.conf.json"),
|
|
166
|
+
);
|
|
167
|
+
const hasPackageJson = existsSync(join(ctx.repoRoot, "package.json"));
|
|
168
|
+
|
|
169
|
+
if (hasCargo && hasTauriConf && hasPackageJson) return 0.95;
|
|
170
|
+
if (hasCargo && hasTauriConf) return 0.9;
|
|
171
|
+
return 0;
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
async readManifests(ctx: AdapterContext): Promise<VersionManifest[]> {
|
|
175
|
+
const manifests: VersionManifest[] = [];
|
|
176
|
+
for (const relPath of MANIFESTS) {
|
|
177
|
+
const absPath = join(ctx.repoRoot, relPath);
|
|
178
|
+
if (!existsSync(absPath)) continue;
|
|
179
|
+
try {
|
|
180
|
+
const content = await readFile(absPath, "utf-8");
|
|
181
|
+
const version = parseVersion(relPath, content);
|
|
182
|
+
if (version) {
|
|
183
|
+
manifests.push({ path: relPath, version, content });
|
|
184
|
+
}
|
|
185
|
+
} catch {
|
|
186
|
+
// ignore unreadable files
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return manifests;
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
async bump(
|
|
193
|
+
ctx: AdapterContext,
|
|
194
|
+
bumpType: "patch" | "minor" | "major" | "prerelease",
|
|
195
|
+
newVersion?: string,
|
|
196
|
+
): Promise<BumpResult> {
|
|
197
|
+
// Determine canonical version
|
|
198
|
+
let finalVersion: string;
|
|
199
|
+
|
|
200
|
+
if (newVersion) {
|
|
201
|
+
finalVersion = newVersion;
|
|
202
|
+
} else {
|
|
203
|
+
// Read all manifests to determine current base version
|
|
204
|
+
const manifests = await this.readManifests(ctx);
|
|
205
|
+
const versions = manifests.map((m) => m.version);
|
|
206
|
+
const canonical = versions[0] ?? "0.0.0";
|
|
207
|
+
|
|
208
|
+
const parts = canonical.split("-")[0].split(".").map(Number);
|
|
209
|
+
const [major = 0, minor = 0, patch = 0] = parts;
|
|
210
|
+
switch (bumpType) {
|
|
211
|
+
case "major":
|
|
212
|
+
finalVersion = `${major + 1}.0.0`;
|
|
213
|
+
break;
|
|
214
|
+
case "minor":
|
|
215
|
+
finalVersion = `${major}.${minor + 1}.0`;
|
|
216
|
+
break;
|
|
217
|
+
case "prerelease":
|
|
218
|
+
finalVersion = canonical;
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
finalVersion = `${major}.${minor}.${patch + 1}`;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const actions: string[] = [];
|
|
226
|
+
const updated: VersionManifest[] = [];
|
|
227
|
+
|
|
228
|
+
// Write to all three manifests
|
|
229
|
+
for (const relPath of MANIFESTS) {
|
|
230
|
+
const absPath = join(ctx.repoRoot, relPath);
|
|
231
|
+
if (!existsSync(absPath)) continue;
|
|
232
|
+
|
|
233
|
+
if (ctx.verbose || ctx.dryRun) {
|
|
234
|
+
actions.push(
|
|
235
|
+
`Update ${relPath}: ${parseVersion(relPath, await readFile(absPath, "utf-8").catch(() => "")) ?? "?"} -> ${finalVersion}`,
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
await writeManifest(ctx, relPath, finalVersion);
|
|
240
|
+
updated.push({ path: relPath, version: finalVersion, content: "" });
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return { newVersion: finalVersion, updated, actions };
|
|
244
|
+
},
|
|
245
|
+
|
|
246
|
+
async verify(
|
|
247
|
+
ctx: AdapterContext,
|
|
248
|
+
expectedVersion: string,
|
|
249
|
+
): Promise<VerificationResult> {
|
|
250
|
+
const errors: string[] = [];
|
|
251
|
+
const warnings: string[] = [];
|
|
252
|
+
|
|
253
|
+
const manifests = await this.readManifests(ctx);
|
|
254
|
+
const missing = MANIFESTS.filter(
|
|
255
|
+
(p) => !manifests.find((m) => m.path === p),
|
|
256
|
+
);
|
|
257
|
+
if (missing.length > 0) {
|
|
258
|
+
warnings.push(
|
|
259
|
+
`Missing manifest files (may be intentional): ${missing.join(", ")}`,
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const versions = manifests.map((m) => m.version);
|
|
264
|
+
const unique = [...new Set(versions)];
|
|
265
|
+
|
|
266
|
+
if (unique.length > 1) {
|
|
267
|
+
errors.push(
|
|
268
|
+
`Version mismatch across Tauri manifests: ${JSON.stringify(
|
|
269
|
+
Object.fromEntries(manifests.map((m) => [m.path, m.version])),
|
|
270
|
+
)}`,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (
|
|
275
|
+
expectedVersion &&
|
|
276
|
+
unique.length === 1 &&
|
|
277
|
+
unique[0] !== expectedVersion
|
|
278
|
+
) {
|
|
279
|
+
errors.push(
|
|
280
|
+
`Version ${unique[0]} does not match expected ${expectedVersion}`,
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return { ok: errors.length === 0, errors, warnings };
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
async getCanonicalVersion(ctx: AdapterContext): Promise<string | null> {
|
|
288
|
+
// package.json is the canonical source for Tauri apps (npm frontend)
|
|
289
|
+
const root = join(ctx.repoRoot, "package.json");
|
|
290
|
+
if (!existsSync(root)) return null;
|
|
291
|
+
try {
|
|
292
|
+
const content = await readFile(root, "utf-8");
|
|
293
|
+
return parsePackageJson(content);
|
|
294
|
+
} catch {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
};
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Release orchestrator ā picks the best adapter and runs the release.
|
|
3
|
+
*
|
|
4
|
+
* Architecture:
|
|
5
|
+
* 1. Detect which stack(s) apply to the repo (detector)
|
|
6
|
+
* 2. Select the best adapter (highest confidence, or compose multiple)
|
|
7
|
+
* 3. Run standard-version to create the git tag
|
|
8
|
+
* 4. Sync versions across all manifest files
|
|
9
|
+
* 5. Amend commit, push, and publish
|
|
10
|
+
*
|
|
11
|
+
* The adapter handles all manifest-specific logic.
|
|
12
|
+
* The orchestrator handles the git/npm plumbing.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { execSync } from "node:child_process";
|
|
16
|
+
import { existsSync } from "node:fs";
|
|
17
|
+
import { resolve } from "path";
|
|
18
|
+
import { detectStacks, formatProfile } from "./adapters/detector.ts";
|
|
19
|
+
import { nodeWorkspaceAdapter } from "./adapters/node-workspace.ts";
|
|
20
|
+
import { tauriAdapter } from "./adapters/tauri.ts";
|
|
21
|
+
import { rustAdapter } from "./adapters/rust.ts";
|
|
22
|
+
import { pythonAdapter } from "./adapters/python.ts";
|
|
23
|
+
import type { AdapterContext, ReleaseAdapter } from "./adapters/base.ts";
|
|
24
|
+
|
|
25
|
+
const ADAPTERS: ReleaseAdapter[] = [
|
|
26
|
+
nodeWorkspaceAdapter,
|
|
27
|
+
tauriAdapter,
|
|
28
|
+
rustAdapter,
|
|
29
|
+
pythonAdapter,
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
/** All adapters, sorted by confidence for this repo */
|
|
33
|
+
function rankedAdapters(ctx: AdapterContext): Array<{
|
|
34
|
+
adapter: ReleaseAdapter;
|
|
35
|
+
confidence: number;
|
|
36
|
+
}> {
|
|
37
|
+
return ADAPTERS.map((a) => ({ adapter: a, confidence: a.detect(ctx) }))
|
|
38
|
+
.filter((r) => r.confidence > 0)
|
|
39
|
+
.sort((a, b) => b.confidence - a.confidence);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Run a git command, return trimmed stdout */
|
|
43
|
+
function git(args: string[], cwd: string): string {
|
|
44
|
+
try {
|
|
45
|
+
return execSync(`git ${args.join(" ")}`, { cwd, encoding: "utf-8" }).trim();
|
|
46
|
+
} catch {
|
|
47
|
+
return "";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Run a git command, ignore errors */
|
|
52
|
+
function gitQuiet(args: string[], cwd: string): void {
|
|
53
|
+
try {
|
|
54
|
+
execSync(`git ${args.join(" ")}`, { cwd, encoding: "utf-8" });
|
|
55
|
+
} catch {
|
|
56
|
+
// ignore
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ReleaseOptions {
|
|
61
|
+
repoRoot?: string;
|
|
62
|
+
dryRun?: boolean;
|
|
63
|
+
verbose?: boolean;
|
|
64
|
+
bumpType?: "patch" | "minor" | "major" | "prerelease";
|
|
65
|
+
newVersion?: string;
|
|
66
|
+
skipGit?: boolean;
|
|
67
|
+
skipNpm?: boolean;
|
|
68
|
+
skipPublish?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Skip running standard-version (tag creation).
|
|
71
|
+
* Set to true when running locally - CI handles standard-version.
|
|
72
|
+
*/
|
|
73
|
+
skipStandardVersion?: boolean;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Detect the best adapter for a repo without running any changes.
|
|
78
|
+
*/
|
|
79
|
+
export function detect(options: ReleaseOptions = {}): string {
|
|
80
|
+
const repoRoot = resolve(options.repoRoot ?? process.cwd());
|
|
81
|
+
const ctx: AdapterContext = {
|
|
82
|
+
repoRoot,
|
|
83
|
+
dryRun: options.dryRun ?? false,
|
|
84
|
+
verbose: options.verbose ?? false,
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const profile = detectStacks(ctx);
|
|
88
|
+
return formatProfile(profile);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Run the full release flow with the best adapter.
|
|
93
|
+
*/
|
|
94
|
+
export async function release(options: ReleaseOptions = {}): Promise<void> {
|
|
95
|
+
const repoRoot = resolve(options.repoRoot ?? process.cwd());
|
|
96
|
+
const dryRun = options.dryRun ?? false;
|
|
97
|
+
const verbose = options.verbose ?? false;
|
|
98
|
+
const ctx: AdapterContext = { repoRoot, dryRun, verbose };
|
|
99
|
+
|
|
100
|
+
// āā Step 0: Detect stacks āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
101
|
+
const profile = detectStacks(ctx);
|
|
102
|
+
if (verbose) {
|
|
103
|
+
console.log(formatProfile(profile));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (profile.unknown) {
|
|
107
|
+
console.warn(
|
|
108
|
+
"\nā ļø No known stack detected. Run with --verbose to see detection results.",
|
|
109
|
+
);
|
|
110
|
+
console.warn(" Falling back to Node workspace adapter...\n");
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Pick the best adapter
|
|
114
|
+
const ranked = rankedAdapters(ctx);
|
|
115
|
+
const adapter = ranked[0]?.adapter ?? nodeWorkspaceAdapter;
|
|
116
|
+
|
|
117
|
+
if (verbose) {
|
|
118
|
+
console.log(`\nš¦ Using adapter: ${adapter.name} (${adapter.id})`);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// āā Step 1: Run standard-version (only in CI, not locally) āāāāāāāāāāā
|
|
122
|
+
// Local runs: skip standard-version, just bump versions
|
|
123
|
+
// CI runs: run standard-version to create tags
|
|
124
|
+
if (options.skipStandardVersion) {
|
|
125
|
+
console.log(`\nš Release (${adapter.name})\n`);
|
|
126
|
+
console.log(`š¦ Step 1: Skipping standard-version (run locally)`);
|
|
127
|
+
console.log(` CI will run standard-version on tag push\n`);
|
|
128
|
+
} else {
|
|
129
|
+
const bumpArg = options.newVersion ?? options.bumpType ?? "patch";
|
|
130
|
+
const stdCmd = dryRun
|
|
131
|
+
? `npx standard-version --dry-run --release-as ${bumpArg}`
|
|
132
|
+
: `npx standard-version --release-as ${bumpArg}`;
|
|
133
|
+
|
|
134
|
+
console.log(`\nš Release (${adapter.name})\n`);
|
|
135
|
+
if (!options.skipGit) {
|
|
136
|
+
console.log(`š¦ Step 1: Running standard-version...`);
|
|
137
|
+
console.log(` $ ${stdCmd}`);
|
|
138
|
+
if (!dryRun) {
|
|
139
|
+
try {
|
|
140
|
+
execSync(stdCmd, { cwd: repoRoot, stdio: "inherit" });
|
|
141
|
+
} catch {
|
|
142
|
+
console.error("standard-version failed.");
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// āā Step 2: Read new version from git tag āāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
150
|
+
let newVersion: string | undefined;
|
|
151
|
+
|
|
152
|
+
// Only read from git tag if NOT skipping standard-version (i.e., in CI)
|
|
153
|
+
// When skipping standard-version (local runs), adapter.bump() calculates the next version
|
|
154
|
+
if (!options.skipStandardVersion && !options.skipGit) {
|
|
155
|
+
try {
|
|
156
|
+
const tags = git(["tag", "--sort=-v:refname"], repoRoot);
|
|
157
|
+
const latestTag = tags.split("\n")[0];
|
|
158
|
+
newVersion = latestTag.startsWith("v") ? latestTag.slice(1) : latestTag;
|
|
159
|
+
} catch {
|
|
160
|
+
// Fallback: read from adapter
|
|
161
|
+
newVersion = (await adapter.getCanonicalVersion(ctx)) ?? "0.0.0";
|
|
162
|
+
}
|
|
163
|
+
} else if (!options.skipGit) {
|
|
164
|
+
// skipStandardVersion=true (local): let adapter calculate next version
|
|
165
|
+
newVersion = undefined;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Explicit --release-as=X.Y.Z always wins
|
|
169
|
+
if (options.newVersion) {
|
|
170
|
+
newVersion = options.newVersion;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const displayVersion = newVersion ?? `(calculated from ${options.bumpType ?? "patch"})`;
|
|
174
|
+
console.log(`\nš Step 2: Release version is ${displayVersion}`);
|
|
175
|
+
|
|
176
|
+
// āā Step 3: Sync all manifest versions āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
177
|
+
const manifests = await adapter.readManifests(ctx);
|
|
178
|
+
console.log(
|
|
179
|
+
`\nš¦ Step 3: Syncing ${manifests.length} manifest(s)...`,
|
|
180
|
+
);
|
|
181
|
+
if (verbose) {
|
|
182
|
+
for (const m of manifests) {
|
|
183
|
+
console.log(` ${m.path}: ${m.version} -> (calculated)`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const bumpResult = await adapter.bump(
|
|
188
|
+
ctx,
|
|
189
|
+
options.bumpType ?? "patch",
|
|
190
|
+
newVersion,
|
|
191
|
+
);
|
|
192
|
+
for (const action of bumpResult.actions) {
|
|
193
|
+
console.log(` ${action}`);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Get the actual new version (either provided or calculated by bump)
|
|
197
|
+
const actualVersion = bumpResult.newVersion;
|
|
198
|
+
|
|
199
|
+
// āā Step 4: Verify āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
200
|
+
console.log(`\nš Step 4: Verifying...`);
|
|
201
|
+
const verifyResult = await adapter.verify(ctx, actualVersion);
|
|
202
|
+
|
|
203
|
+
for (const warning of verifyResult.warnings) {
|
|
204
|
+
console.warn(` ā ${warning}`);
|
|
205
|
+
}
|
|
206
|
+
for (const error of verifyResult.errors) {
|
|
207
|
+
console.error(` ā ${error}`);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (!verifyResult.ok && !dryRun) {
|
|
211
|
+
// In dry-run, versions aren't actually bumped yet, so mismatch is expected
|
|
212
|
+
console.error(
|
|
213
|
+
"\nā Verification failed. Fix the errors above before releasing.\n",
|
|
214
|
+
);
|
|
215
|
+
process.exit(1);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (verifyResult.ok) {
|
|
219
|
+
console.log(` ā All manifests synchronized to ${actualVersion}`);
|
|
220
|
+
} else if (dryRun) {
|
|
221
|
+
console.log(
|
|
222
|
+
` ā Verification skipped in dry-run (versions not yet bumped)`,
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// āā Step 5: Git amend (include manifest changes in the tag commit) āāā
|
|
227
|
+
if (!options.skipGit && !dryRun) {
|
|
228
|
+
console.log(`\nš§ Step 5: Amending commit with manifest changes...`);
|
|
229
|
+
gitQuiet(["add", "-A"], repoRoot);
|
|
230
|
+
const status = git(["status", "--short"], repoRoot);
|
|
231
|
+
if (status) {
|
|
232
|
+
console.log(` Staged:\n${status}`);
|
|
233
|
+
try {
|
|
234
|
+
gitQuiet(["commit", "--amend", "--no-edit"], repoRoot);
|
|
235
|
+
console.log(` ā Committed (amended)`);
|
|
236
|
+
} catch {
|
|
237
|
+
console.warn(` ā Could not amend commit`);
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
console.log(` No changes to commit`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// āā Step 6: Push āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
245
|
+
if (!options.skipGit && !dryRun) {
|
|
246
|
+
console.log(`\nš Step 6: Pushing to origin...`);
|
|
247
|
+
try {
|
|
248
|
+
execSync("git push --follow-tags origin develop", {
|
|
249
|
+
cwd: repoRoot,
|
|
250
|
+
stdio: "inherit",
|
|
251
|
+
});
|
|
252
|
+
} catch {
|
|
253
|
+
console.error("Git push failed.");
|
|
254
|
+
process.exit(1);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// āā Step 7: Publish to npm āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
259
|
+
if (!options.skipNpm && !options.skipPublish && !dryRun) {
|
|
260
|
+
const hasNpmPkg = existsSync(resolve(repoRoot, "package.json"));
|
|
261
|
+
if (hasNpmPkg) {
|
|
262
|
+
console.log(`\nš¦ Step 7: Publishing to npm...`);
|
|
263
|
+
try {
|
|
264
|
+
execSync("npm publish --workspaces=false", {
|
|
265
|
+
cwd: repoRoot,
|
|
266
|
+
stdio: "inherit",
|
|
267
|
+
});
|
|
268
|
+
} catch {
|
|
269
|
+
console.error(
|
|
270
|
+
"npm publish failed. Check that you're logged in (npm login).",
|
|
271
|
+
);
|
|
272
|
+
process.exit(1);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
console.log(`\nā
Release ${actualVersion} complete (${adapter.name})\n`);
|
|
278
|
+
}
|