pi-harness-runtime 0.10.43 → 1.1.1
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/harness/e2e/chatgpt-quota-scraper.ts +478 -0
- package/harness/e2e/glm-quota-scraper.ts +449 -0
- package/index.ts +2 -0
- package/package.json +1 -1
- package/packages/a2a-adapter/README.md +35 -0
- package/packages/a2a-adapter/package.json +21 -0
- package/packages/a2a-adapter/test/a2a.test.ts +151 -0
- package/packages/architecture-generator/package.json +21 -0
- package/packages/auth/README.md +60 -0
- package/packages/auth/package.json +22 -0
- package/packages/auth/test/auth.test.ts +238 -0
- package/packages/autonomous-refactor/package.json +21 -0
- package/packages/autonomous-refactor/test/refactor.test.ts +202 -0
- package/packages/autonomous-runtime/README.md +48 -0
- package/packages/autonomous-runtime/package.json +34 -0
- package/packages/autonomous-runtime/test/autonomous-runtime.test.ts +194 -0
- package/packages/autonomous-runtime/test/inbox.test.ts +80 -0
- package/packages/autonomous-runtime/test/types.test.ts +68 -0
- package/packages/cache-strategy/package.json +21 -0
- package/packages/cache-strategy/test/cache.test.ts +137 -0
- package/packages/capability-registry/package.json +41 -0
- package/packages/capability-registry/test/registry.test.ts +204 -0
- package/packages/checkpoint/README.md +206 -0
- package/packages/checkpoint/package.json +33 -0
- package/packages/checkpoint/test/engine.test.ts +265 -0
- package/packages/cli-plugin-sdk/README.md +48 -0
- package/packages/cli-plugin-sdk/package.json +24 -0
- package/packages/cli-plugin-sdk/test/cli.test.ts +45 -0
- package/packages/clipboard/package.json +12 -0
- package/packages/clipboard-plugin/package.json +17 -0
- package/packages/code-generation/README.md +302 -0
- package/packages/code-generation/package.json +38 -0
- package/packages/code-generation/test/generator.test.ts +238 -0
- package/packages/code-review/README.md +312 -0
- package/packages/code-review/package.json +38 -0
- package/packages/code-review/test/engine.test.ts +302 -0
- package/packages/codex-adapter/package.json +24 -0
- package/packages/codex-adapter/test/provider.test.ts +142 -0
- package/packages/config-capture/package.json +23 -0
- package/packages/context-compiler/package.json +28 -0
- package/packages/context-compiler/test/context-compiler.test.ts +746 -0
- package/packages/context-discovery/package.json +12 -0
- package/packages/context-manager/package.json +21 -0
- package/packages/context-manager/test/context.test.ts +198 -0
- package/packages/cookie-sanitizer/README.md +141 -0
- package/packages/cookie-sanitizer/package.json +27 -0
- package/packages/cookie-sanitizer/test/infer.test.ts +110 -0
- package/packages/cookie-sanitizer/test/normalize.test.ts +113 -0
- package/packages/cookie-sanitizer/test/parse.test.ts +204 -0
- package/packages/cookie-sanitizer/test/sync.test.ts +231 -0
- package/packages/cookie-sanitizer/test/watcher.test.ts +27 -0
- package/packages/cost-optimizer/package.json +41 -0
- package/packages/cost-optimizer/test/cost-optimizer.test.ts +438 -0
- package/packages/dependency-analyzer/package.json +12 -0
- package/packages/dependency-analyzer/test/analyzer.test.ts +48 -0
- package/packages/django-plugin/README.md +1 -0
- package/packages/django-plugin/package.json +20 -0
- package/packages/django-plugin/test/analyzer.test.ts +195 -0
- package/packages/doc-generator/package.json +21 -0
- package/packages/doc-generator/test/docs.test.ts +168 -0
- package/packages/evaluation-engine/package.json +23 -0
- package/packages/evaluation-engine/test/engine.test.ts +277 -0
- package/packages/evaluation-runner/package.json +21 -0
- package/packages/evaluation-runner/test/runner.test.ts +168 -0
- package/packages/event-bus/package.json +12 -0
- package/packages/event-bus/test/bus.test.ts +88 -0
- package/packages/event-store/package.json +12 -0
- package/packages/event-store/test/store.test.ts +115 -0
- package/packages/experience-replay/package.json +23 -0
- package/packages/experience-replay/test/replay.test.ts +267 -0
- package/packages/feedback-collector/package.json +21 -0
- package/packages/feedback-collector/test/collector.test.ts +142 -0
- package/packages/file-copy-helper/package.json +17 -0
- package/packages/framework-detector/README.md +283 -0
- package/packages/framework-detector/package.json +38 -0
- package/packages/framework-detector/test/detector.test.ts +75 -0
- package/packages/framework-plugin-sdk/README.md +399 -0
- package/packages/framework-plugin-sdk/package.json +39 -0
- package/packages/framework-plugin-sdk/test/manager.test.ts +320 -0
- package/packages/frappe-plugin/package.json +20 -0
- package/packages/frappe-plugin/test/analyzer.test.ts +250 -0
- package/packages/generic-web-plugin/package.json +20 -0
- package/packages/generic-web-plugin/test/analyzer.test.ts +134 -0
- package/packages/health-monitor/package.json +21 -0
- package/packages/health-monitor/test/health.test.ts +231 -0
- package/packages/intent-analyzer/package.json +12 -0
- package/packages/intent-analyzer/test/analyzer.test.ts +72 -0
- package/packages/knowledge-graph/package.json +24 -0
- package/packages/knowledge-retrieval/package.json +25 -0
- package/packages/laravel-plugin/README.md +1 -0
- package/packages/laravel-plugin/package.json +20 -0
- package/packages/laravel-plugin/test/analyzer.test.ts +220 -0
- package/packages/learning-engine/package.json +23 -0
- package/packages/learning-engine/test/engine.test.ts +331 -0
- package/packages/mcp-adapter/README.md +47 -0
- package/packages/mcp-adapter/package.json +21 -0
- package/packages/mcp-adapter/test/server.test.ts +91 -0
- package/packages/memory-engine/package.json +23 -0
- package/packages/memory-engine/test/engine.test.ts +456 -0
- package/packages/milestone-manager/package.json +21 -0
- package/packages/model-registry/package.json +41 -0
- package/packages/model-registry/test/registry.test.ts +342 -0
- package/packages/nextjs-plugin/README.md +1 -0
- package/packages/nextjs-plugin/package.json +30 -0
- package/packages/nextjs-plugin/test/analyzer.test.ts +149 -0
- package/packages/notification/adapters/email-adapter.ts +126 -0
- package/packages/notification/adapters/ntfy-adapter.ts +100 -0
- package/packages/notification/adapters/telegram-adapter.ts +107 -0
- package/packages/notification/adapters/webhook-adapter.ts +75 -0
- package/packages/notification/base-adapter.ts +75 -0
- package/packages/notification/index.ts +51 -0
- package/packages/notification/notification-center.ts +286 -0
- package/packages/notification/package.json +22 -0
- package/packages/notification/test/notification.test.ts +372 -0
- package/packages/notification/types.ts +89 -0
- package/packages/observability/README.md +241 -0
- package/packages/observability/package.json +34 -0
- package/packages/observability/test/observability.test.ts +1350 -0
- package/packages/okf-indexer/package.json +12 -0
- package/packages/performance-optimizer/package.json +23 -0
- package/packages/performance-optimizer/test/optimizer.test.ts +267 -0
- package/packages/privilege-broker/README.md +45 -0
- package/packages/privilege-broker/package.json +35 -0
- package/packages/project-analyzer/package.json +43 -0
- package/packages/project-analyzer/test/index.test.ts +1719 -0
- package/packages/project-bootstrap/package.json +24 -0
- package/packages/projection-engine/package.json +12 -0
- package/packages/prompt-compiler/package.json +28 -0
- package/packages/prompt-compiler/test/prompt-compiler.test.ts +813 -0
- package/packages/prompt-versioning/package.json +21 -0
- package/packages/prompt-versioning/test/versioning.test.ts +112 -0
- package/packages/provider-adapter-sdk/README.md +221 -0
- package/packages/provider-adapter-sdk/examples/custom-adapter.ts +353 -0
- package/packages/provider-adapter-sdk/package.json +36 -0
- package/packages/provider-adapter-sdk/test/sdk.test.ts +220 -0
- package/packages/provider-router/package.json +41 -0
- package/packages/provider-router/test/provider-router.test.ts +405 -0
- package/packages/provider-selector/package.json +21 -0
- package/packages/provider-selector/test/selector.test.ts +192 -0
- package/packages/providers/README.md +3 -0
- package/packages/providers/adapters.ts +362 -0
- package/packages/providers/deepagents-adapter.ts +458 -0
- package/packages/providers/glm-usage.ts +248 -0
- package/packages/providers/index.ts +85 -0
- package/packages/providers/openai-usage.ts +263 -0
- package/packages/providers/package.json +22 -0
- package/packages/providers/test/providers.test.ts +225 -0
- package/packages/quota-manager/README.md +3 -0
- package/packages/quota-manager/{dist/examples/tui-usage-integration.js → examples/tui-usage-integration.ts} +16 -17
- package/packages/quota-manager/index.ts +28 -0
- package/packages/quota-manager/package.json +22 -0
- package/packages/quota-manager/quota-manager.ts +339 -0
- package/packages/quota-manager/test/quota.test.ts +432 -0
- package/packages/quota-manager/tui-usage-monitor.ts +355 -0
- package/packages/rate-limiter/package.json +21 -0
- package/packages/rate-limiter/test/limiter.test.ts +128 -0
- package/packages/react-vite-plugin/README.md +1 -0
- package/packages/react-vite-plugin/package.json +20 -0
- package/packages/react-vite-plugin/test/analyzer.test.ts +139 -0
- package/packages/release-manager/package.json +21 -0
- package/packages/release-manager/test/release.test.ts +215 -0
- package/packages/requirement-compiler/package.json +25 -0
- package/packages/requirement-compiler/test/requirement-compiler.test.ts +743 -0
- package/packages/runtime/README.md +3 -0
- package/packages/runtime/command-executor.ts +523 -0
- package/packages/runtime/index.ts +50 -0
- package/packages/runtime/local-runtime-agent.ts +480 -0
- package/packages/runtime/package.json +22 -0
- package/packages/runtime/policy-engine.ts +813 -0
- package/packages/runtime/runtime-api.ts +665 -0
- package/packages/runtime/test/runtime.test.ts +297 -0
- package/packages/runtime/workspace-manager.ts +591 -0
- package/packages/scheduler/README.md +3 -0
- package/packages/scheduler/package.json +22 -0
- package/packages/scheduler/test/scheduler.test.ts +125 -0
- package/packages/scheduler-adapter/README.md +36 -0
- package/packages/scheduler-adapter/package.json +32 -0
- package/packages/session/README.md +273 -0
- package/packages/session/package.json +38 -0
- package/packages/session/test/manager.test.ts +233 -0
- package/packages/session-api/package.json +12 -0
- package/packages/session-export/package.json +12 -0
- package/packages/shared-context/README.md +3 -0
- package/packages/shared-context/package.json +22 -0
- package/packages/shared-context/test/shared-context.test.ts +114 -0
- package/packages/skill-registry/package.json +41 -0
- package/packages/skill-registry/test/registry.test.ts +508 -0
- package/packages/sprint-planner/package.json +21 -0
- package/packages/sprint-planner/test/planner.test.ts +187 -0
- package/packages/subscription-engine/package.json +12 -0
- package/packages/task-compiler/package.json +43 -0
- package/packages/task-compiler/test/task-compiler.test.ts +628 -0
- package/packages/tencentdb-memory/package.json +23 -0
- package/packages/tencentdb-sync/package.json +26 -0
- package/packages/test-data-generator/README.md +365 -0
- package/packages/test-data-generator/package.json +39 -0
- package/packages/test-data-generator/test/generator.test.ts +265 -0
- package/packages/test-generator/package.json +21 -0
- package/packages/test-generator/test/generator.test.ts +156 -0
- package/packages/todo-bd-sync/package.json +22 -0
- package/packages/token-estimation/package.json +22 -0
- package/packages/token-estimation/test/token-estimation.test.ts +207 -0
- package/packages/token-optimizer/package.json +21 -0
- package/packages/token-optimizer/test/optimizer.test.ts +141 -0
- package/packages/tui/README.md +3 -0
- package/packages/tui/package.json +22 -0
- package/packages/types/package.json +25 -0
- package/packages/workflow-events/package.json +12 -0
- package/packages/workspace-scanner/package.json +12 -0
- package/packages/workspace-scanner/test/scanner.test.ts +42 -0
- package/packages/worktree/README.md +3 -0
- package/packages/worktree/package.json +22 -0
- package/packages/worktree/test/worktree.test.ts +163 -0
- package/packages/worktree/worktree.ts +293 -0
- package/packages/write-review/package.json +22 -0
- package/packages/a2a-adapter/dist/discovery.d.ts +0 -52
- package/packages/a2a-adapter/dist/discovery.d.ts.map +0 -1
- package/packages/a2a-adapter/dist/discovery.js +0 -76
- package/packages/a2a-adapter/dist/discovery.js.map +0 -1
- package/packages/architecture-generator/dist/adr.d.ts +0 -15
- package/packages/architecture-generator/dist/adr.d.ts.map +0 -1
- package/packages/architecture-generator/dist/adr.js +0 -42
- package/packages/architecture-generator/dist/adr.js.map +0 -1
- package/packages/architecture-generator/dist/index.d.ts +0 -9
- package/packages/architecture-generator/dist/index.d.ts.map +0 -1
- package/packages/architecture-generator/dist/index.js +0 -9
- package/packages/architecture-generator/dist/index.js.map +0 -1
- package/packages/architecture-generator/dist/mermaid.d.ts +0 -30
- package/packages/architecture-generator/dist/mermaid.d.ts.map +0 -1
- package/packages/architecture-generator/dist/mermaid.js +0 -58
- package/packages/architecture-generator/dist/mermaid.js.map +0 -1
- package/packages/architecture-generator/dist/types.d.ts +0 -30
- package/packages/architecture-generator/dist/types.d.ts.map +0 -1
- package/packages/architecture-generator/dist/types.js +0 -7
- package/packages/architecture-generator/dist/types.js.map +0 -1
- 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/capability-registry/src/types.js +0 -10
- 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 -212
- 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 -5
- package/packages/clipboard/dist/src/index.d.ts.map +0 -1
- package/packages/clipboard/dist/src/index.js +0 -4
- package/packages/clipboard/dist/src/index.js.map +0 -1
- package/packages/clipboard/dist/src/paste-bridge.d.ts +0 -19
- package/packages/clipboard/dist/src/paste-bridge.d.ts.map +0 -1
- package/packages/clipboard/dist/src/paste-bridge.js +0 -78
- package/packages/clipboard/dist/src/paste-bridge.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-plugin/dist/index.d.ts +0 -28
- package/packages/clipboard-plugin/dist/index.d.ts.map +0 -1
- package/packages/clipboard-plugin/dist/index.js +0 -64
- package/packages/clipboard-plugin/dist/index.js.map +0 -1
- package/packages/clipboard-plugin/dist/types.d.ts +0 -30
- package/packages/clipboard-plugin/dist/types.d.ts.map +0 -1
- package/packages/clipboard-plugin/dist/types.js +0 -5
- package/packages/clipboard-plugin/dist/types.js.map +0 -1
- 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/dependency-analyzer/dist/analyzer.d.ts +0 -17
- package/packages/dependency-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/analyzer.js +0 -106
- package/packages/dependency-analyzer/dist/analyzer.js.map +0 -1
- package/packages/dependency-analyzer/dist/imports.d.ts +0 -12
- package/packages/dependency-analyzer/dist/imports.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/imports.js +0 -73
- package/packages/dependency-analyzer/dist/imports.js.map +0 -1
- package/packages/dependency-analyzer/dist/index.d.ts +0 -4
- package/packages/dependency-analyzer/dist/index.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/index.js +0 -3
- package/packages/dependency-analyzer/dist/index.js.map +0 -1
- 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/dist/test/analyzer.test.js +0 -37
- package/packages/dependency-analyzer/dist/types.d.ts +0 -28
- package/packages/dependency-analyzer/dist/types.d.ts.map +0 -1
- package/packages/dependency-analyzer/dist/types.js +0 -5
- package/packages/dependency-analyzer/dist/types.js.map +0 -1
- 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 -324
- 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-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/file-copy-helper/dist/src/extension.js +0 -121
- package/packages/file-copy-helper/src/extension.js +0 -149
- package/packages/intent-analyzer/dist/analyzer.d.ts +0 -13
- package/packages/intent-analyzer/dist/analyzer.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/analyzer.js +0 -72
- package/packages/intent-analyzer/dist/analyzer.js.map +0 -1
- package/packages/intent-analyzer/dist/index.d.ts +0 -3
- package/packages/intent-analyzer/dist/index.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/index.js +0 -2
- package/packages/intent-analyzer/dist/index.js.map +0 -1
- 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/dist/test/analyzer.test.js +0 -56
- package/packages/intent-analyzer/dist/types.d.ts +0 -26
- package/packages/intent-analyzer/dist/types.d.ts.map +0 -1
- package/packages/intent-analyzer/dist/types.js +0 -7
- package/packages/intent-analyzer/dist/types.js.map +0 -1
- package/packages/knowledge-graph/dist/graph-extractor.d.ts +0 -27
- package/packages/knowledge-graph/dist/graph-extractor.d.ts.map +0 -1
- package/packages/knowledge-graph/dist/graph-extractor.js +0 -276
- package/packages/knowledge-graph/dist/graph-extractor.js.map +0 -1
- package/packages/knowledge-graph/dist/index.d.ts +0 -27
- package/packages/knowledge-graph/dist/index.d.ts.map +0 -1
- package/packages/knowledge-graph/dist/index.js +0 -27
- package/packages/knowledge-graph/dist/index.js.map +0 -1
- package/packages/knowledge-graph/dist/mcp-client.d.ts +0 -38
- package/packages/knowledge-graph/dist/mcp-client.d.ts.map +0 -1
- package/packages/knowledge-graph/dist/mcp-client.js +0 -157
- package/packages/knowledge-graph/dist/mcp-client.js.map +0 -1
- package/packages/knowledge-graph/dist/provenance-linker.d.ts +0 -19
- package/packages/knowledge-graph/dist/provenance-linker.d.ts.map +0 -1
- package/packages/knowledge-graph/dist/provenance-linker.js +0 -91
- package/packages/knowledge-graph/dist/provenance-linker.js.map +0 -1
- package/packages/knowledge-graph/dist/types.d.ts +0 -53
- package/packages/knowledge-graph/dist/types.d.ts.map +0 -1
- package/packages/knowledge-graph/dist/types.js +0 -7
- package/packages/knowledge-graph/dist/types.js.map +0 -1
- package/packages/knowledge-retrieval/dist/index.d.ts +0 -8
- package/packages/knowledge-retrieval/dist/index.d.ts.map +0 -1
- package/packages/knowledge-retrieval/dist/index.js +0 -7
- package/packages/knowledge-retrieval/dist/index.js.map +0 -1
- package/packages/knowledge-retrieval/dist/mcp-client.d.ts +0 -61
- package/packages/knowledge-retrieval/dist/mcp-client.d.ts.map +0 -1
- package/packages/knowledge-retrieval/dist/mcp-client.js +0 -132
- package/packages/knowledge-retrieval/dist/mcp-client.js.map +0 -1
- package/packages/knowledge-retrieval/dist/types.d.ts +0 -105
- package/packages/knowledge-retrieval/dist/types.d.ts.map +0 -1
- package/packages/knowledge-retrieval/dist/types.js +0 -7
- package/packages/knowledge-retrieval/dist/types.js.map +0 -1
- package/packages/milestone-manager/dist/engine.d.ts +0 -27
- package/packages/milestone-manager/dist/engine.d.ts.map +0 -1
- package/packages/milestone-manager/dist/engine.js +0 -78
- package/packages/milestone-manager/dist/engine.js.map +0 -1
- package/packages/milestone-manager/dist/index.d.ts +0 -6
- package/packages/milestone-manager/dist/index.d.ts.map +0 -1
- package/packages/milestone-manager/dist/index.js +0 -6
- package/packages/milestone-manager/dist/index.js.map +0 -1
- package/packages/milestone-manager/dist/types.d.ts +0 -25
- package/packages/milestone-manager/dist/types.d.ts.map +0 -1
- package/packages/milestone-manager/dist/types.js +0 -7
- package/packages/milestone-manager/dist/types.js.map +0 -1
- 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/line-adapter.d.ts +0 -17
- package/packages/notification/dist/adapters/line-adapter.d.ts.map +0 -1
- package/packages/notification/dist/adapters/line-adapter.js +0 -99
- package/packages/notification/dist/adapters/line-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 -10
- package/packages/notification/dist/index.d.ts.map +0 -1
- package/packages/notification/dist/index.js +0 -10
- 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 -232
- package/packages/notification/dist/notification-center.js.map +0 -1
- package/packages/notification/dist/types.d.ts +0 -69
- 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/okf-indexer/dist/cli.d.ts +0 -8
- package/packages/okf-indexer/dist/cli.d.ts.map +0 -1
- package/packages/okf-indexer/dist/cli.js +0 -23
- package/packages/okf-indexer/dist/cli.js.map +0 -1
- package/packages/okf-indexer/dist/indexer.d.ts +0 -55
- package/packages/okf-indexer/dist/indexer.d.ts.map +0 -1
- package/packages/okf-indexer/dist/indexer.js +0 -147
- package/packages/okf-indexer/dist/indexer.js.map +0 -1
- package/packages/project-bootstrap/dist/bootstrap.d.ts +0 -23
- package/packages/project-bootstrap/dist/bootstrap.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/bootstrap.js +0 -128
- package/packages/project-bootstrap/dist/bootstrap.js.map +0 -1
- package/packages/project-bootstrap/dist/frappe.d.ts +0 -8
- package/packages/project-bootstrap/dist/frappe.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/frappe.js +0 -82
- package/packages/project-bootstrap/dist/frappe.js.map +0 -1
- package/packages/project-bootstrap/dist/index.d.ts +0 -27
- package/packages/project-bootstrap/dist/index.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/index.js +0 -27
- package/packages/project-bootstrap/dist/index.js.map +0 -1
- package/packages/project-bootstrap/dist/minimal.d.ts +0 -8
- package/packages/project-bootstrap/dist/minimal.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/minimal.js +0 -35
- package/packages/project-bootstrap/dist/minimal.js.map +0 -1
- package/packages/project-bootstrap/dist/types.d.ts +0 -61
- package/packages/project-bootstrap/dist/types.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/types.js +0 -7
- package/packages/project-bootstrap/dist/types.js.map +0 -1
- package/packages/project-bootstrap/dist/typescript.d.ts +0 -8
- package/packages/project-bootstrap/dist/typescript.d.ts.map +0 -1
- package/packages/project-bootstrap/dist/typescript.js +0 -103
- package/packages/project-bootstrap/dist/typescript.js.map +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/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/dist/src/adapters.d.ts +0 -133
- package/packages/providers/dist/src/adapters.d.ts.map +0 -1
- package/packages/providers/dist/src/adapters.js +0 -236
- package/packages/providers/dist/src/adapters.js.map +0 -1
- package/packages/providers/dist/src/deepagents-adapter.d.ts +0 -78
- package/packages/providers/dist/src/deepagents-adapter.d.ts.map +0 -1
- package/packages/providers/dist/src/deepagents-adapter.js +0 -323
- package/packages/providers/dist/src/deepagents-adapter.js.map +0 -1
- package/packages/providers/dist/src/glm-usage.d.ts +0 -102
- package/packages/providers/dist/src/glm-usage.d.ts.map +0 -1
- package/packages/providers/dist/src/glm-usage.js +0 -197
- package/packages/providers/dist/src/glm-usage.js.map +0 -1
- package/packages/providers/dist/src/index.d.ts +0 -11
- package/packages/providers/dist/src/index.d.ts.map +0 -1
- package/packages/providers/dist/src/index.js +0 -11
- package/packages/providers/dist/src/index.js.map +0 -1
- package/packages/providers/dist/src/openai-usage.d.ts +0 -103
- package/packages/providers/dist/src/openai-usage.d.ts.map +0 -1
- package/packages/providers/dist/src/openai-usage.js +0 -208
- package/packages/providers/dist/src/openai-usage.js.map +0 -1
- package/packages/providers/dist/src/provider-id.d.ts +0 -46
- package/packages/providers/dist/src/provider-id.d.ts.map +0 -1
- package/packages/providers/dist/src/provider-id.js +0 -113
- package/packages/providers/dist/src/provider-id.js.map +0 -1
- 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.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/src/examples/tui-usage-integration.d.ts +0 -35
- package/packages/quota-manager/dist/src/examples/tui-usage-integration.d.ts.map +0 -1
- package/packages/quota-manager/dist/src/examples/tui-usage-integration.js +0 -73
- package/packages/quota-manager/dist/src/examples/tui-usage-integration.js.map +0 -1
- package/packages/quota-manager/dist/src/index.d.ts +0 -8
- package/packages/quota-manager/dist/src/index.d.ts.map +0 -1
- package/packages/quota-manager/dist/src/index.js +0 -8
- package/packages/quota-manager/dist/src/index.js.map +0 -1
- package/packages/quota-manager/dist/src/quota-manager.d.ts +0 -70
- package/packages/quota-manager/dist/src/quota-manager.d.ts.map +0 -1
- package/packages/quota-manager/dist/src/quota-manager.js +0 -260
- package/packages/quota-manager/dist/src/quota-manager.js.map +0 -1
- package/packages/quota-manager/dist/src/tui-usage-monitor.d.ts +0 -96
- package/packages/quota-manager/dist/src/tui-usage-monitor.d.ts.map +0 -1
- package/packages/quota-manager/dist/src/tui-usage-monitor.js +0 -268
- package/packages/quota-manager/dist/src/tui-usage-monitor.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/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/src/command-executor.d.ts +0 -129
- package/packages/runtime/dist/src/command-executor.d.ts.map +0 -1
- package/packages/runtime/dist/src/command-executor.js +0 -383
- package/packages/runtime/dist/src/command-executor.js.map +0 -1
- package/packages/runtime/dist/src/index.d.ts +0 -11
- package/packages/runtime/dist/src/index.d.ts.map +0 -1
- package/packages/runtime/dist/src/index.js +0 -11
- package/packages/runtime/dist/src/index.js.map +0 -1
- package/packages/runtime/dist/src/local-runtime-agent.d.ts +0 -111
- package/packages/runtime/dist/src/local-runtime-agent.d.ts.map +0 -1
- package/packages/runtime/dist/src/local-runtime-agent.js +0 -356
- package/packages/runtime/dist/src/local-runtime-agent.js.map +0 -1
- package/packages/runtime/dist/src/policy-engine.d.ts +0 -203
- package/packages/runtime/dist/src/policy-engine.d.ts.map +0 -1
- package/packages/runtime/dist/src/policy-engine.js +0 -592
- package/packages/runtime/dist/src/policy-engine.js.map +0 -1
- package/packages/runtime/dist/src/runtime-api.d.ts +0 -137
- package/packages/runtime/dist/src/runtime-api.d.ts.map +0 -1
- package/packages/runtime/dist/src/runtime-api.js +0 -454
- package/packages/runtime/dist/src/runtime-api.js.map +0 -1
- package/packages/runtime/dist/src/workspace-manager.d.ts +0 -162
- package/packages/runtime/dist/src/workspace-manager.d.ts.map +0 -1
- package/packages/runtime/dist/src/workspace-manager.js +0 -451
- package/packages/runtime/dist/src/workspace-manager.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/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-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/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/tencentdb-sync/dist/cli.d.ts +0 -7
- package/packages/tencentdb-sync/dist/cli.d.ts.map +0 -1
- package/packages/tencentdb-sync/dist/cli.js +0 -311
- package/packages/tencentdb-sync/dist/cli.js.map +0 -1
- package/packages/tencentdb-sync/dist/client.d.ts +0 -141
- package/packages/tencentdb-sync/dist/client.d.ts.map +0 -1
- package/packages/tencentdb-sync/dist/client.js +0 -166
- package/packages/tencentdb-sync/dist/client.js.map +0 -1
- package/packages/tencentdb-sync/dist/config.d.ts +0 -32
- package/packages/tencentdb-sync/dist/config.d.ts.map +0 -1
- package/packages/tencentdb-sync/dist/config.js +0 -102
- package/packages/tencentdb-sync/dist/config.js.map +0 -1
- package/packages/tencentdb-sync/dist/index.d.ts +0 -9
- package/packages/tencentdb-sync/dist/index.d.ts.map +0 -1
- package/packages/tencentdb-sync/dist/index.js +0 -8
- package/packages/tencentdb-sync/dist/index.js.map +0 -1
- package/packages/todo-bd-sync/dist/src/detector.js +0 -108
- package/packages/todo-bd-sync/dist/src/extension.js +0 -9
- package/packages/types/dist/ai-providers.d.ts +0 -36
- package/packages/types/dist/ai-providers.d.ts.map +0 -1
- package/packages/types/dist/ai-providers.js +0 -66
- package/packages/types/dist/ai-providers.js.map +0 -1
- package/packages/types/src/agent-worker-types.js +0 -41
- package/packages/types/src/ai-providers.js +0 -66
- package/packages/types/src/runtime-types.js +0 -3
- 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/workspace-scanner/dist/detect.d.ts +0 -3
- package/packages/workspace-scanner/dist/detect.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/detect.js +0 -58
- package/packages/workspace-scanner/dist/detect.js.map +0 -1
- package/packages/workspace-scanner/dist/git.d.ts +0 -7
- package/packages/workspace-scanner/dist/git.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/git.js +0 -75
- package/packages/workspace-scanner/dist/git.js.map +0 -1
- package/packages/workspace-scanner/dist/index.d.ts +0 -5
- package/packages/workspace-scanner/dist/index.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/index.js +0 -4
- package/packages/workspace-scanner/dist/index.js.map +0 -1
- package/packages/workspace-scanner/dist/scanner.d.ts +0 -11
- package/packages/workspace-scanner/dist/scanner.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/scanner.js +0 -46
- package/packages/workspace-scanner/dist/scanner.js.map +0 -1
- 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/dist/test/scanner.test.js +0 -34
- package/packages/workspace-scanner/dist/types.d.ts +0 -35
- package/packages/workspace-scanner/dist/types.d.ts.map +0 -1
- package/packages/workspace-scanner/dist/types.js +0 -5
- package/packages/workspace-scanner/dist/types.js.map +0 -1
- 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/src/index.d.ts +0 -7
- package/packages/worktree/dist/src/index.d.ts.map +0 -1
- package/packages/worktree/dist/src/index.js +0 -7
- package/packages/worktree/dist/src/index.js.map +0 -1
- package/packages/worktree/dist/src/worktree.d.ts +0 -88
- package/packages/worktree/dist/src/worktree.d.ts.map +0 -1
- package/packages/worktree/dist/src/worktree.js +0 -239
- package/packages/worktree/dist/src/worktree.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 -239
- package/packages/worktree/dist/worktree.js.map +0 -1
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Compiler - Tests
|
|
3
|
+
*
|
|
4
|
+
* Tests cover acceptance criteria from RFC-0042:
|
|
5
|
+
* 1. Required project rules are always included.
|
|
6
|
+
* 2. .env content is denied.
|
|
7
|
+
* 3. Broken optional OKF link does not fail compilation.
|
|
8
|
+
* 4. Broken required source does fail compilation.
|
|
9
|
+
* 5. Duplicate source slices are merged.
|
|
10
|
+
* 6. Context remains under requested token budget.
|
|
11
|
+
* 7. Changed file hash invalidates cache.
|
|
12
|
+
* 8. Identical repository state produces identical compiled context.
|
|
13
|
+
* 9. Omitted items include explicit reasons.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import assert from "node:assert";
|
|
17
|
+
import { describe, it } from "node:test";
|
|
18
|
+
|
|
19
|
+
import { estimateTokens } from "../src/budget.js";
|
|
20
|
+
import {
|
|
21
|
+
extractItemHashes,
|
|
22
|
+
generateCacheKey,
|
|
23
|
+
shouldInvalidate,
|
|
24
|
+
} from "../src/cache.js";
|
|
25
|
+
import { compileContext } from "../src/compiler.js";
|
|
26
|
+
import { deduplicateCandidates, mergeFileSlices } from "../src/deduplicate.js";
|
|
27
|
+
import { applyPolicyFilter, mergePolicy } from "../src/filter.js";
|
|
28
|
+
import { mergeWeights, rankCandidates } from "../src/score.js";
|
|
29
|
+
import { ContextCompileError } from "../src/types.js";
|
|
30
|
+
import type {
|
|
31
|
+
ContextCandidate,
|
|
32
|
+
ContextCompileRequest,
|
|
33
|
+
ContextPolicy,
|
|
34
|
+
} from "../src/types.js";
|
|
35
|
+
|
|
36
|
+
// --- Test fixtures -------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
function makeCandidate(
|
|
39
|
+
overrides?: Partial<ContextCandidate>,
|
|
40
|
+
): ContextCandidate {
|
|
41
|
+
return {
|
|
42
|
+
id: "ctx-001",
|
|
43
|
+
kind: "source_file",
|
|
44
|
+
content: "function hello() { return 'world'; }",
|
|
45
|
+
source: "src/hello.ts",
|
|
46
|
+
priority: 1,
|
|
47
|
+
required: false,
|
|
48
|
+
trust: "unverified",
|
|
49
|
+
...overrides,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function makeRequest(
|
|
54
|
+
overrides?: Partial<ContextCompileRequest>,
|
|
55
|
+
): ContextCompileRequest {
|
|
56
|
+
return {
|
|
57
|
+
jobId: "job-001",
|
|
58
|
+
taskId: "task-001",
|
|
59
|
+
taskObjective: "Add login feature",
|
|
60
|
+
maximumTokens: 50_000,
|
|
61
|
+
worktreePath: "/tmp/test-worktree",
|
|
62
|
+
candidates: [],
|
|
63
|
+
...overrides,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// --- AC-1: Required project rules always included ------------------------
|
|
68
|
+
|
|
69
|
+
describe("AC-1: Required project rules always included", () => {
|
|
70
|
+
it("includes required project_rule even when budget is tiny", async () => {
|
|
71
|
+
const required = makeCandidate({
|
|
72
|
+
id: "rule-auth",
|
|
73
|
+
kind: "project_rule",
|
|
74
|
+
source: "src/auth/permissions.ts",
|
|
75
|
+
content: "Auth permission rules",
|
|
76
|
+
required: true,
|
|
77
|
+
priority: 3,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const result = await compileContext(
|
|
81
|
+
makeRequest({
|
|
82
|
+
taskId: "task-ac1",
|
|
83
|
+
maximumTokens: 1, // Tiny budget
|
|
84
|
+
candidates: [required],
|
|
85
|
+
}),
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
assert.ok(result.items.some((i) => i.id === "rule-auth"));
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("excludes non-required items when budget is exceeded", async () => {
|
|
92
|
+
const optional = makeCandidate({
|
|
93
|
+
id: "opt-001",
|
|
94
|
+
kind: "source_file",
|
|
95
|
+
source: "src/other.ts",
|
|
96
|
+
content: "x".repeat(10_000),
|
|
97
|
+
required: false,
|
|
98
|
+
priority: 1,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const result = await compileContext(
|
|
102
|
+
makeRequest({
|
|
103
|
+
taskId: "task-ac1b",
|
|
104
|
+
maximumTokens: 100, // Tiny budget
|
|
105
|
+
candidates: [optional],
|
|
106
|
+
}),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
assert.ok(result.items.length === 0);
|
|
110
|
+
assert.ok(result.omitted.some((o) => o.reason === "budget"));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// --- AC-2: .env content denied ------------------------------------------
|
|
115
|
+
|
|
116
|
+
describe("AC-2: .env content denied by policy", () => {
|
|
117
|
+
it("denies .env file content", () => {
|
|
118
|
+
const candidates = [
|
|
119
|
+
makeCandidate({
|
|
120
|
+
id: "env-001",
|
|
121
|
+
kind: "source_file",
|
|
122
|
+
source: ".env",
|
|
123
|
+
content: "SECRET=abc123",
|
|
124
|
+
required: false,
|
|
125
|
+
}),
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
const { denied } = applyPolicyFilter(candidates, mergePolicy(undefined));
|
|
129
|
+
assert.ok(denied.some((d) => d.candidate.id === "env-001"));
|
|
130
|
+
assert.ok(denied.some((d) => d.reason.includes(".env")));
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("denies .env.local file content", () => {
|
|
134
|
+
const candidates = [
|
|
135
|
+
makeCandidate({
|
|
136
|
+
id: "env-local",
|
|
137
|
+
kind: "source_file",
|
|
138
|
+
source: ".env.local",
|
|
139
|
+
content: "DATABASE_URL=postgres://...",
|
|
140
|
+
required: false,
|
|
141
|
+
}),
|
|
142
|
+
];
|
|
143
|
+
|
|
144
|
+
const { denied } = applyPolicyFilter(candidates, mergePolicy(undefined));
|
|
145
|
+
assert.ok(denied.some((d) => d.candidate.id === "env-local"));
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it("allows non-secret files", () => {
|
|
149
|
+
const candidates = [
|
|
150
|
+
makeCandidate({
|
|
151
|
+
id: "src-main",
|
|
152
|
+
kind: "source_file",
|
|
153
|
+
source: "src/main.ts",
|
|
154
|
+
content: "console.log('hello')",
|
|
155
|
+
required: false,
|
|
156
|
+
}),
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
const { passed } = applyPolicyFilter(candidates, mergePolicy(undefined));
|
|
160
|
+
assert.ok(passed.some((c) => c.id === "src-main"));
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// --- AC-3: Broken optional OKF link does not fail compilation -------------
|
|
165
|
+
|
|
166
|
+
describe("AC-3: Broken optional OKF link does not fail compilation", () => {
|
|
167
|
+
it("does not throw when optional OKF has no content", async () => {
|
|
168
|
+
const broken = makeCandidate({
|
|
169
|
+
id: "okf-001",
|
|
170
|
+
kind: "okf_concept",
|
|
171
|
+
source: "okfs/missing.okf",
|
|
172
|
+
content: "", // empty = broken
|
|
173
|
+
required: false,
|
|
174
|
+
priority: 1,
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
const result = await compileContext(
|
|
178
|
+
makeRequest({
|
|
179
|
+
taskId: "task-ac3",
|
|
180
|
+
maximumTokens: 50_000,
|
|
181
|
+
candidates: [broken],
|
|
182
|
+
}),
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
// Should succeed without throwing
|
|
186
|
+
assert.ok(result.taskId === "task-ac3");
|
|
187
|
+
// Broken optional should be omitted (no content means 0 tokens, but still empty)
|
|
188
|
+
assert.ok(result.items.every((i) => i.id !== "okf-001"));
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// --- AC-4: Broken required source fails compilation ----------------------
|
|
193
|
+
|
|
194
|
+
describe("AC-4: Broken required source fails compilation", () => {
|
|
195
|
+
it("throws MISSING_REQUIRED_SOURCE when required source has no content", async () => {
|
|
196
|
+
const broken = makeCandidate({
|
|
197
|
+
id: "req-001",
|
|
198
|
+
kind: "okf_concept",
|
|
199
|
+
source: "okfs/required.okf",
|
|
200
|
+
content: "", // empty = broken
|
|
201
|
+
required: true,
|
|
202
|
+
priority: 3,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
await assert.rejects(
|
|
206
|
+
() =>
|
|
207
|
+
compileContext(
|
|
208
|
+
makeRequest({
|
|
209
|
+
taskId: "task-ac4",
|
|
210
|
+
maximumTokens: 50_000,
|
|
211
|
+
candidates: [broken],
|
|
212
|
+
}),
|
|
213
|
+
),
|
|
214
|
+
(err: unknown) => {
|
|
215
|
+
if (err instanceof ContextCompileError) {
|
|
216
|
+
const details = err.details as
|
|
217
|
+
| { missingSources?: string[] }
|
|
218
|
+
| undefined;
|
|
219
|
+
return (
|
|
220
|
+
err.code === "MISSING_REQUIRED_SOURCE" &&
|
|
221
|
+
details?.missingSources?.includes("okfs/required.okf")
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
return false;
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// --- AC-5: Duplicate source slices merged -------------------------------
|
|
231
|
+
|
|
232
|
+
describe("AC-5: Duplicate source slices merged", () => {
|
|
233
|
+
it("merges slices from the same file", () => {
|
|
234
|
+
const slice1 = makeCandidate({
|
|
235
|
+
id: "slice-1",
|
|
236
|
+
kind: "source_file",
|
|
237
|
+
source: "src/main.ts",
|
|
238
|
+
content: "function a() {}",
|
|
239
|
+
filePath: "src/main.ts",
|
|
240
|
+
startLine: 1,
|
|
241
|
+
endLine: 5,
|
|
242
|
+
priority: 1,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const slice2 = makeCandidate({
|
|
246
|
+
id: "slice-2",
|
|
247
|
+
kind: "source_file",
|
|
248
|
+
source: "src/main.ts",
|
|
249
|
+
content: "function b() {}",
|
|
250
|
+
filePath: "src/main.ts",
|
|
251
|
+
startLine: 10,
|
|
252
|
+
endLine: 15,
|
|
253
|
+
priority: 2,
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
const result = mergeFileSlices([slice1, slice2]);
|
|
257
|
+
assert.ok(result.length === 1);
|
|
258
|
+
const merged = result[0];
|
|
259
|
+
if (!merged) return;
|
|
260
|
+
assert.ok(merged.filePath === "src/main.ts");
|
|
261
|
+
assert.ok(merged.startLine === 1);
|
|
262
|
+
assert.ok(merged.endLine === 15);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
it("keeps separate files separate", () => {
|
|
266
|
+
const file1 = makeCandidate({
|
|
267
|
+
id: "file-1",
|
|
268
|
+
kind: "source_file",
|
|
269
|
+
source: "src/a.ts",
|
|
270
|
+
content: "// a",
|
|
271
|
+
filePath: "src/a.ts",
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const file2 = makeCandidate({
|
|
275
|
+
id: "file-2",
|
|
276
|
+
kind: "source_file",
|
|
277
|
+
source: "src/b.ts",
|
|
278
|
+
content: "// b",
|
|
279
|
+
filePath: "src/b.ts",
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
const result = mergeFileSlices([file1, file2]);
|
|
283
|
+
assert.ok(result.length === 2);
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
it("deduplicates exact duplicate content", () => {
|
|
287
|
+
const dup1 = makeCandidate({
|
|
288
|
+
id: "dup-1",
|
|
289
|
+
content: "same content",
|
|
290
|
+
source: "src/same.ts",
|
|
291
|
+
});
|
|
292
|
+
const dup2 = makeCandidate({
|
|
293
|
+
id: "dup-2",
|
|
294
|
+
content: "same content",
|
|
295
|
+
source: "src/same.ts",
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
const { unique, duplicates } = deduplicateCandidates([dup1, dup2]);
|
|
299
|
+
assert.ok(unique.length === 1);
|
|
300
|
+
assert.ok(duplicates.includes("dup-2"));
|
|
301
|
+
assert.ok(!duplicates.includes("dup-1")); // first occurrence kept
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
it("required items are never deduplicated", () => {
|
|
305
|
+
const req1 = makeCandidate({
|
|
306
|
+
id: "req-1",
|
|
307
|
+
content: "same",
|
|
308
|
+
required: true,
|
|
309
|
+
});
|
|
310
|
+
const req2 = makeCandidate({
|
|
311
|
+
id: "req-2",
|
|
312
|
+
content: "same",
|
|
313
|
+
required: true,
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
const { unique, duplicates } = deduplicateCandidates([req1, req2]);
|
|
317
|
+
assert.ok(unique.length === 2);
|
|
318
|
+
assert.ok(duplicates.length === 0);
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
// --- AC-6: Context under token budget -----------------------------------
|
|
323
|
+
|
|
324
|
+
describe("AC-6: Context remains under requested token budget", () => {
|
|
325
|
+
it("fits within budget when content is small enough", async () => {
|
|
326
|
+
const small = makeCandidate({
|
|
327
|
+
id: "small-001",
|
|
328
|
+
kind: "source_file",
|
|
329
|
+
content: "const x = 1;",
|
|
330
|
+
required: true,
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
const result = await compileContext(
|
|
334
|
+
makeRequest({
|
|
335
|
+
taskId: "task-ac6",
|
|
336
|
+
maximumTokens: 1_000_000, // generous
|
|
337
|
+
candidates: [small],
|
|
338
|
+
}),
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
assert.ok(result.estimatedTokens <= 1_000_000);
|
|
342
|
+
assert.ok(result.items.some((i) => i.id === "small-001"));
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it("omits items that exceed remaining budget", async () => {
|
|
346
|
+
const tiny = makeCandidate({
|
|
347
|
+
id: "tiny",
|
|
348
|
+
kind: "source_file",
|
|
349
|
+
content: "a",
|
|
350
|
+
required: true,
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
const large = makeCandidate({
|
|
354
|
+
id: "large",
|
|
355
|
+
kind: "source_file",
|
|
356
|
+
content: "x".repeat(10_000),
|
|
357
|
+
required: false,
|
|
358
|
+
priority: 1,
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
const result = await compileContext(
|
|
362
|
+
makeRequest({
|
|
363
|
+
taskId: "task-ac6b",
|
|
364
|
+
maximumTokens: 5, // very small
|
|
365
|
+
candidates: [tiny, large],
|
|
366
|
+
}),
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
assert.ok(
|
|
370
|
+
result.omitted.some((o) => o.id === "large" && o.reason === "budget"),
|
|
371
|
+
);
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
it("token estimation uses 4-char-per-token", () => {
|
|
375
|
+
const content = "1234"; // 4 chars = 1 token
|
|
376
|
+
assert.ok(estimateTokens(content) === 1);
|
|
377
|
+
|
|
378
|
+
const long = "a".repeat(100);
|
|
379
|
+
assert.ok(estimateTokens(long) === 25);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
// --- AC-7: Changed file hash invalidates cache ---------------------------
|
|
384
|
+
|
|
385
|
+
describe("AC-7: Changed file hash invalidates cache", () => {
|
|
386
|
+
it("source_hash_changed invalidates when hash differs", () => {
|
|
387
|
+
const prevItems = [
|
|
388
|
+
{
|
|
389
|
+
id: "ctx-001",
|
|
390
|
+
kind: "source_file" as const,
|
|
391
|
+
content: "original content",
|
|
392
|
+
source: "src/a.ts",
|
|
393
|
+
priority: 1 as const,
|
|
394
|
+
required: false,
|
|
395
|
+
trust: "unverified" as const,
|
|
396
|
+
estimatedTokens: 1,
|
|
397
|
+
contentHash: "abc123",
|
|
398
|
+
},
|
|
399
|
+
];
|
|
400
|
+
|
|
401
|
+
const currentHashes = new Map([["src/a.ts", "xyz789"]]);
|
|
402
|
+
|
|
403
|
+
const result = shouldInvalidate(
|
|
404
|
+
{
|
|
405
|
+
taskId: "task-001",
|
|
406
|
+
items: prevItems,
|
|
407
|
+
omitted: [],
|
|
408
|
+
estimatedTokens: 1,
|
|
409
|
+
sourceGraph: [],
|
|
410
|
+
generatedAt: "",
|
|
411
|
+
mapping: {},
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
reason: "source_hash_changed",
|
|
415
|
+
details: { sourcePath: "src/a.ts" },
|
|
416
|
+
taskId: "task-001",
|
|
417
|
+
},
|
|
418
|
+
currentHashes,
|
|
419
|
+
);
|
|
420
|
+
|
|
421
|
+
assert.ok(result === true);
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
it("source_hash_changed does not invalidate when hash unchanged", () => {
|
|
425
|
+
const prevItems = [
|
|
426
|
+
{
|
|
427
|
+
id: "ctx-001",
|
|
428
|
+
kind: "source_file" as const,
|
|
429
|
+
content: "original content",
|
|
430
|
+
source: "src/a.ts",
|
|
431
|
+
priority: 1 as const,
|
|
432
|
+
required: false,
|
|
433
|
+
trust: "unverified" as const,
|
|
434
|
+
estimatedTokens: 1,
|
|
435
|
+
contentHash: "abc123",
|
|
436
|
+
},
|
|
437
|
+
];
|
|
438
|
+
|
|
439
|
+
const currentHashes = new Map([["src/a.ts", "abc123"]]);
|
|
440
|
+
|
|
441
|
+
const result = shouldInvalidate(
|
|
442
|
+
{
|
|
443
|
+
taskId: "task-001",
|
|
444
|
+
items: prevItems,
|
|
445
|
+
omitted: [],
|
|
446
|
+
estimatedTokens: 1,
|
|
447
|
+
sourceGraph: [],
|
|
448
|
+
generatedAt: "",
|
|
449
|
+
mapping: {},
|
|
450
|
+
},
|
|
451
|
+
{
|
|
452
|
+
reason: "source_hash_changed",
|
|
453
|
+
details: { sourcePath: "src/a.ts" },
|
|
454
|
+
taskId: "task-001",
|
|
455
|
+
},
|
|
456
|
+
currentHashes,
|
|
457
|
+
);
|
|
458
|
+
|
|
459
|
+
assert.ok(result === false);
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
it("task_objective_changed always invalidates", () => {
|
|
463
|
+
const result = shouldInvalidate(
|
|
464
|
+
{
|
|
465
|
+
taskId: "task-001",
|
|
466
|
+
items: [],
|
|
467
|
+
omitted: [],
|
|
468
|
+
estimatedTokens: 0,
|
|
469
|
+
sourceGraph: [],
|
|
470
|
+
generatedAt: "",
|
|
471
|
+
mapping: {},
|
|
472
|
+
},
|
|
473
|
+
{ reason: "task_objective_changed", taskId: "task-001" },
|
|
474
|
+
new Map(),
|
|
475
|
+
);
|
|
476
|
+
|
|
477
|
+
assert.ok(result === true);
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// --- AC-8: Identical repo state → identical compiled context -------------
|
|
482
|
+
|
|
483
|
+
describe("AC-8: Identical repository state produces identical compiled context", () => {
|
|
484
|
+
it("same candidates produce same cache key", () => {
|
|
485
|
+
const items = [
|
|
486
|
+
{
|
|
487
|
+
id: "ctx-001",
|
|
488
|
+
kind: "source_file" as const,
|
|
489
|
+
content: "const x = 1;",
|
|
490
|
+
source: "src/main.ts",
|
|
491
|
+
priority: 1 as const,
|
|
492
|
+
required: false,
|
|
493
|
+
trust: "unverified" as const,
|
|
494
|
+
estimatedTokens: 1,
|
|
495
|
+
contentHash: "hash123",
|
|
496
|
+
},
|
|
497
|
+
];
|
|
498
|
+
|
|
499
|
+
const key1 = generateCacheKey("task-001", items, "Add login");
|
|
500
|
+
const key2 = generateCacheKey("task-001", items, "Add login");
|
|
501
|
+
|
|
502
|
+
assert.ok(key1 === key2);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("different objectives produce different cache keys", () => {
|
|
506
|
+
const items = [
|
|
507
|
+
{
|
|
508
|
+
id: "ctx-001",
|
|
509
|
+
kind: "source_file" as const,
|
|
510
|
+
content: "const x = 1;",
|
|
511
|
+
source: "src/main.ts",
|
|
512
|
+
priority: 1 as const,
|
|
513
|
+
required: false,
|
|
514
|
+
trust: "unverified" as const,
|
|
515
|
+
estimatedTokens: 1,
|
|
516
|
+
contentHash: "hash123",
|
|
517
|
+
},
|
|
518
|
+
];
|
|
519
|
+
|
|
520
|
+
const key1 = generateCacheKey("task-001", items, "Add login");
|
|
521
|
+
const key2 = generateCacheKey("task-001", items, "Fix logout bug");
|
|
522
|
+
|
|
523
|
+
assert.ok(key1 !== key2);
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
it("compileContext is deterministic", async () => {
|
|
527
|
+
const c1 = makeCandidate({
|
|
528
|
+
id: "c1",
|
|
529
|
+
kind: "source_file",
|
|
530
|
+
content: "const x = 1;",
|
|
531
|
+
source: "src/a.ts",
|
|
532
|
+
});
|
|
533
|
+
const c2 = makeCandidate({
|
|
534
|
+
id: "c2",
|
|
535
|
+
kind: "okf_concept",
|
|
536
|
+
content: "Authentication concepts",
|
|
537
|
+
source: "okfs/auth.okf",
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
const req = makeRequest({ taskId: "task-det", candidates: [c1, c2] });
|
|
541
|
+
|
|
542
|
+
const [result1, result2] = await Promise.all([
|
|
543
|
+
compileContext(req),
|
|
544
|
+
compileContext(req),
|
|
545
|
+
]);
|
|
546
|
+
|
|
547
|
+
assert.ok(result1.cacheKey === result2.cacheKey);
|
|
548
|
+
assert.ok(result1.estimatedTokens === result2.estimatedTokens);
|
|
549
|
+
assert.ok(result1.items.length === result2.items.length);
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
// --- AC-9: Omitted items include explicit reasons ----------------------
|
|
554
|
+
|
|
555
|
+
describe("AC-9: Omitted items include explicit reasons", () => {
|
|
556
|
+
it("policy denied items have reason=policy_denied", async () => {
|
|
557
|
+
const env = makeCandidate({
|
|
558
|
+
id: "env",
|
|
559
|
+
source: ".env",
|
|
560
|
+
content: "SECRET=123",
|
|
561
|
+
required: false,
|
|
562
|
+
});
|
|
563
|
+
const normal = makeCandidate({
|
|
564
|
+
id: "src",
|
|
565
|
+
source: "src/a.ts",
|
|
566
|
+
content: "const x = 1;",
|
|
567
|
+
required: false,
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
const result = await compileContext(
|
|
571
|
+
makeRequest({ taskId: "task-ac9", candidates: [env, normal] }),
|
|
572
|
+
);
|
|
573
|
+
|
|
574
|
+
const envOmission = result.omitted.find((o) => o.id === "env");
|
|
575
|
+
assert.ok(envOmission);
|
|
576
|
+
assert.ok(envOmission.reason === "policy_denied");
|
|
577
|
+
assert.ok(envOmission.deniedBy !== undefined);
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
it("duplicate items have reason=duplicate", () => {
|
|
581
|
+
const d1 = makeCandidate({
|
|
582
|
+
id: "d1",
|
|
583
|
+
content: "same",
|
|
584
|
+
source: "src/s.ts",
|
|
585
|
+
});
|
|
586
|
+
const d2 = makeCandidate({
|
|
587
|
+
id: "d2",
|
|
588
|
+
content: "same",
|
|
589
|
+
source: "src/s.ts",
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
const { unique, duplicates } = deduplicateCandidates([d1, d2]);
|
|
593
|
+
assert.ok(unique.length === 1);
|
|
594
|
+
assert.ok(duplicates.length === 1);
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
it("budget-omitted items have reason=budget", async () => {
|
|
598
|
+
const large = makeCandidate({
|
|
599
|
+
id: "large",
|
|
600
|
+
content: "x".repeat(50_000),
|
|
601
|
+
source: "src/large.ts",
|
|
602
|
+
required: false,
|
|
603
|
+
priority: 1,
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
const result = await compileContext(
|
|
607
|
+
makeRequest({
|
|
608
|
+
taskId: "task-ac9b",
|
|
609
|
+
maximumTokens: 100,
|
|
610
|
+
candidates: [large],
|
|
611
|
+
}),
|
|
612
|
+
);
|
|
613
|
+
|
|
614
|
+
const omit = result.omitted.find((o) => o.id === "large");
|
|
615
|
+
assert.ok(omit);
|
|
616
|
+
assert.ok(omit.reason === "budget");
|
|
617
|
+
assert.ok(omit.estimatedTokens !== undefined);
|
|
618
|
+
assert.ok(omit.estimatedTokens > 0);
|
|
619
|
+
});
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
// --- Additional coverage -------------------------------------------------
|
|
623
|
+
|
|
624
|
+
describe("mergePolicy", () => {
|
|
625
|
+
it("merges user policy with defaults", () => {
|
|
626
|
+
const userPolicy: ContextPolicy = {
|
|
627
|
+
deny: ["secrets/**"],
|
|
628
|
+
allowLargeFiles: false,
|
|
629
|
+
maxFileBytes: 1_000_000,
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
const merged = mergePolicy(userPolicy);
|
|
633
|
+
assert.ok(merged.deny.includes("secrets/**"));
|
|
634
|
+
assert.ok(merged.maxFileBytes === 1_000_000);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
it("returns defaults when no user policy", () => {
|
|
638
|
+
const merged = mergePolicy(undefined);
|
|
639
|
+
assert.ok(merged.deny.length > 0);
|
|
640
|
+
assert.ok(merged.maxFileBytes > 0);
|
|
641
|
+
});
|
|
642
|
+
});
|
|
643
|
+
|
|
644
|
+
describe("mergeWeights", () => {
|
|
645
|
+
it("applies partial user weights", () => {
|
|
646
|
+
const w = mergeWeights({ priority: 10 });
|
|
647
|
+
assert.ok(w.priority === 10);
|
|
648
|
+
assert.ok(w.directFileReference > 0); // default
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
it("returns defaults when no user weights", () => {
|
|
652
|
+
const w = mergeWeights(undefined);
|
|
653
|
+
assert.ok(w.priority > 0);
|
|
654
|
+
assert.ok(w.directFileReference > 0);
|
|
655
|
+
});
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
describe("rankCandidates", () => {
|
|
659
|
+
it("required items always rank first", () => {
|
|
660
|
+
const opt = makeCandidate({
|
|
661
|
+
id: "opt",
|
|
662
|
+
required: false,
|
|
663
|
+
priority: 3,
|
|
664
|
+
});
|
|
665
|
+
const req = makeCandidate({
|
|
666
|
+
id: "req",
|
|
667
|
+
required: true,
|
|
668
|
+
priority: 1,
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
const ranked = rankCandidates([opt, req], mergeWeights(), {
|
|
672
|
+
directFileReferences: new Set(),
|
|
673
|
+
taskDependencies: [],
|
|
674
|
+
});
|
|
675
|
+
|
|
676
|
+
assert.ok(ranked[0]?.candidate.id === "req");
|
|
677
|
+
assert.ok(
|
|
678
|
+
ranked[0]?.score != null &&
|
|
679
|
+
ranked[1]?.score != null &&
|
|
680
|
+
ranked[0]?.score > ranked[1]?.score,
|
|
681
|
+
);
|
|
682
|
+
});
|
|
683
|
+
|
|
684
|
+
it("higher priority scores higher", () => {
|
|
685
|
+
const lo = makeCandidate({ id: "lo", priority: 1 });
|
|
686
|
+
const hi = makeCandidate({ id: "hi", priority: 3 });
|
|
687
|
+
|
|
688
|
+
const ranked = rankCandidates([lo, hi], mergeWeights(), {
|
|
689
|
+
directFileReferences: new Set(),
|
|
690
|
+
taskDependencies: [],
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
assert.ok(ranked[0]?.candidate.id === "hi");
|
|
694
|
+
});
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
describe("extractItemHashes", () => {
|
|
698
|
+
it("extracts hashes from items", () => {
|
|
699
|
+
const items = [
|
|
700
|
+
{
|
|
701
|
+
id: "ctx-1",
|
|
702
|
+
kind: "source_file" as const,
|
|
703
|
+
content: "a",
|
|
704
|
+
source: "src/a.ts",
|
|
705
|
+
priority: 1 as const,
|
|
706
|
+
required: false,
|
|
707
|
+
trust: "unverified" as const,
|
|
708
|
+
estimatedTokens: 1,
|
|
709
|
+
contentHash: "hash-a",
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
id: "ctx-2",
|
|
713
|
+
kind: "okf_concept" as const,
|
|
714
|
+
content: "b",
|
|
715
|
+
source: "okfs/b.okf",
|
|
716
|
+
priority: 1 as const,
|
|
717
|
+
required: false,
|
|
718
|
+
trust: "unverified" as const,
|
|
719
|
+
estimatedTokens: 1,
|
|
720
|
+
contentHash: undefined,
|
|
721
|
+
},
|
|
722
|
+
];
|
|
723
|
+
|
|
724
|
+
const hashes = extractItemHashes(items);
|
|
725
|
+
assert.ok(hashes.get("src/a.ts") === "hash-a");
|
|
726
|
+
assert.ok(hashes.get("okfs/b.okf") === undefined);
|
|
727
|
+
});
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
describe("ContextCompileError", () => {
|
|
731
|
+
it("has code, message, and details", () => {
|
|
732
|
+
const err = new ContextCompileError(
|
|
733
|
+
"MISSING_REQUIRED_SOURCE",
|
|
734
|
+
"Source not found",
|
|
735
|
+
{ missingSources: ["src/a.ts"] },
|
|
736
|
+
);
|
|
737
|
+
|
|
738
|
+
assert.ok(err.code === "MISSING_REQUIRED_SOURCE");
|
|
739
|
+
assert.ok(err.message === "Source not found");
|
|
740
|
+
assert.ok(
|
|
741
|
+
(err.details as { missingSources?: string[] })?.missingSources?.[0] ===
|
|
742
|
+
"src/a.ts",
|
|
743
|
+
);
|
|
744
|
+
assert.ok(err instanceof Error);
|
|
745
|
+
});
|
|
746
|
+
});
|