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,268 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TencentDB Knowledge Service Client (RFC-0105/0106)
|
|
3
|
+
*
|
|
4
|
+
* Client for TencentDB-Agent-Memory Knowledge Service
|
|
5
|
+
* Base URL: https://your-memory-server.example.com/v3/
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ApiResponse<T> {
|
|
9
|
+
code: number;
|
|
10
|
+
message: string;
|
|
11
|
+
request_id?: string;
|
|
12
|
+
data?: T;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Skill {
|
|
16
|
+
skill_id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
version: number;
|
|
20
|
+
is_head: boolean;
|
|
21
|
+
status: string;
|
|
22
|
+
owner_user_id: string;
|
|
23
|
+
owner_agent_id: string;
|
|
24
|
+
team_id: string;
|
|
25
|
+
task_id: string;
|
|
26
|
+
created_at_ms: number;
|
|
27
|
+
updated_at_ms: number;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SkillSearchResult extends Skill {
|
|
31
|
+
score: number;
|
|
32
|
+
snippet?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Knowledge {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
content: string;
|
|
39
|
+
team_id: string;
|
|
40
|
+
created_at_ms: number;
|
|
41
|
+
updated_at_ms: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface HealthStatus {
|
|
45
|
+
status: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
uptime?: number;
|
|
48
|
+
stores?: { vectorStore?: boolean };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* TencentDB Knowledge Service API Client
|
|
53
|
+
*/
|
|
54
|
+
export class TencentDBClient {
|
|
55
|
+
private baseUrl: string;
|
|
56
|
+
private userKey: string;
|
|
57
|
+
private serviceId: string;
|
|
58
|
+
|
|
59
|
+
constructor(options: {
|
|
60
|
+
serverUrl: string;
|
|
61
|
+
userKey: string;
|
|
62
|
+
serviceId?: string;
|
|
63
|
+
}) {
|
|
64
|
+
// Remove trailing slash and ensure /v3/ path
|
|
65
|
+
this.baseUrl = options.serverUrl.replace(/\/$/, "") + "/v3";
|
|
66
|
+
this.userKey = options.userKey;
|
|
67
|
+
this.serviceId = options.serviceId || "default";
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
private headers(): Record<string, string> {
|
|
71
|
+
return {
|
|
72
|
+
"Content-Type": "application/json",
|
|
73
|
+
"Authorization": `Bearer ${this.userKey}`,
|
|
74
|
+
"x-tdai-service-id": this.serviceId,
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
private async request<T>(
|
|
79
|
+
method: string,
|
|
80
|
+
path: string,
|
|
81
|
+
body?: unknown,
|
|
82
|
+
): Promise<T> {
|
|
83
|
+
const url = `${this.baseUrl}${path}`;
|
|
84
|
+
const response = await fetch(url, {
|
|
85
|
+
method,
|
|
86
|
+
headers: this.headers(),
|
|
87
|
+
body: body ? JSON.stringify(body) : undefined,
|
|
88
|
+
signal: AbortSignal.timeout(30000),
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const result = await response.json() as ApiResponse<T>;
|
|
92
|
+
|
|
93
|
+
if (result.code !== 0) {
|
|
94
|
+
throw new Error(`API error ${result.code}: ${result.message}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return result.data as T;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Health check
|
|
102
|
+
*/
|
|
103
|
+
async health(): Promise<HealthStatus> {
|
|
104
|
+
// Try /v3/health first, then fall back to root /health
|
|
105
|
+
try {
|
|
106
|
+
return await this.request<HealthStatus>("GET", "/health");
|
|
107
|
+
} catch {
|
|
108
|
+
// If that fails, try the root endpoint
|
|
109
|
+
const url = `${this.baseUrl.replace("/v3", "")}/health`;
|
|
110
|
+
const response = await fetch(url, {
|
|
111
|
+
headers: this.headers(),
|
|
112
|
+
signal: AbortSignal.timeout(5000),
|
|
113
|
+
});
|
|
114
|
+
if (!response.ok) {
|
|
115
|
+
return { status: "error" };
|
|
116
|
+
}
|
|
117
|
+
return response.json() as Promise<HealthStatus>;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ==================== Skills API ====================
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* List all skills
|
|
125
|
+
*/
|
|
126
|
+
async skillList(): Promise<{ items: Skill[]; total: number }> {
|
|
127
|
+
const result = await this.request<{ items: Skill[]; total: number }>(
|
|
128
|
+
"POST",
|
|
129
|
+
"/skill/list",
|
|
130
|
+
{},
|
|
131
|
+
);
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Get skill by name
|
|
137
|
+
*/
|
|
138
|
+
async skillGet(name: string): Promise<Skill | null> {
|
|
139
|
+
try {
|
|
140
|
+
return await this.request<Skill>("POST", "/skill/get", { name });
|
|
141
|
+
} catch {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Create or update skill
|
|
148
|
+
*/
|
|
149
|
+
async skillCreate(options: {
|
|
150
|
+
name: string;
|
|
151
|
+
content: string;
|
|
152
|
+
description?: string;
|
|
153
|
+
tags?: string[];
|
|
154
|
+
}): Promise<Skill> {
|
|
155
|
+
return this.request<Skill>("POST", "/skill/create", {
|
|
156
|
+
name: options.name,
|
|
157
|
+
content: options.content,
|
|
158
|
+
description: options.description,
|
|
159
|
+
tags: options.tags,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Update skill
|
|
165
|
+
*/
|
|
166
|
+
async skillUpdate(options: {
|
|
167
|
+
name: string;
|
|
168
|
+
content: string;
|
|
169
|
+
description?: string;
|
|
170
|
+
}): Promise<Skill> {
|
|
171
|
+
return this.request<Skill>("POST", "/skill/update", {
|
|
172
|
+
name: options.name,
|
|
173
|
+
content: options.content,
|
|
174
|
+
description: options.description,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Delete skill
|
|
180
|
+
*/
|
|
181
|
+
async skillDelete(name: string): Promise<void> {
|
|
182
|
+
await this.request("POST", "/skill/delete", { name });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Search skills
|
|
187
|
+
*/
|
|
188
|
+
async skillSearch(query: string, limit = 10): Promise<SkillSearchResult[]> {
|
|
189
|
+
const result = await this.request<{ items: SkillSearchResult[] }>(
|
|
190
|
+
"POST",
|
|
191
|
+
"/skill/search",
|
|
192
|
+
{ query, limit },
|
|
193
|
+
);
|
|
194
|
+
return result?.items || [];
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ==================== Knowledge API ====================
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* List knowledge items
|
|
201
|
+
*/
|
|
202
|
+
async knowledgeList(teamId?: string): Promise<{ items: Knowledge[]; total: number }> {
|
|
203
|
+
return this.request<{ items: Knowledge[]; total: number }>(
|
|
204
|
+
"POST",
|
|
205
|
+
"/knowledge/list",
|
|
206
|
+
{ team_id: teamId || this.serviceId },
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Get knowledge by ID
|
|
212
|
+
*/
|
|
213
|
+
async knowledgeGet(id: string): Promise<Knowledge | null> {
|
|
214
|
+
try {
|
|
215
|
+
return await this.request<Knowledge>("POST", "/knowledge/get", { id });
|
|
216
|
+
} catch {
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Create knowledge
|
|
223
|
+
*/
|
|
224
|
+
async knowledgeCreate(options: {
|
|
225
|
+
title: string;
|
|
226
|
+
content: string;
|
|
227
|
+
teamId?: string;
|
|
228
|
+
}): Promise<Knowledge> {
|
|
229
|
+
return this.request<Knowledge>("POST", "/knowledge/create", {
|
|
230
|
+
title: options.title,
|
|
231
|
+
content: options.content,
|
|
232
|
+
team_id: options.teamId || this.serviceId,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Update knowledge
|
|
238
|
+
*/
|
|
239
|
+
async knowledgeUpdate(options: {
|
|
240
|
+
id: string;
|
|
241
|
+
title?: string;
|
|
242
|
+
content?: string;
|
|
243
|
+
}): Promise<Knowledge> {
|
|
244
|
+
return this.request<Knowledge>("POST", "/knowledge/update", {
|
|
245
|
+
id: options.id,
|
|
246
|
+
title: options.title,
|
|
247
|
+
content: options.content,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Delete knowledge
|
|
253
|
+
*/
|
|
254
|
+
async knowledgeDelete(id: string): Promise<void> {
|
|
255
|
+
await this.request("POST", "/knowledge/delete", { id });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Create TencentDB client
|
|
261
|
+
*/
|
|
262
|
+
export function createTencentDBClient(options: {
|
|
263
|
+
serverUrl: string;
|
|
264
|
+
userKey: string;
|
|
265
|
+
serviceId?: string;
|
|
266
|
+
}): TencentDBClient {
|
|
267
|
+
return new TencentDBClient(options);
|
|
268
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TencentDB Sync Config (RFC-0105/0106)
|
|
3
|
+
*
|
|
4
|
+
* Loads configuration from env vars or .pi/settings.json
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export interface SyncConfig {
|
|
8
|
+
// Server connection
|
|
9
|
+
serverUrl: string; // e.g., "https://your-memory-server.example.com"
|
|
10
|
+
knowledgeUrl: string; // e.g., "https://your-memory-server.example.com:8424"
|
|
11
|
+
userKey: string; // sk-mem-xxx
|
|
12
|
+
serviceId: string; // default
|
|
13
|
+
|
|
14
|
+
// Skills source
|
|
15
|
+
skillsSource: string; // e.g., "~/frappe-bench/.claude-plugins/moocoding-skills/skills"
|
|
16
|
+
|
|
17
|
+
// Sync options
|
|
18
|
+
autoSync: boolean;
|
|
19
|
+
syncIntervalMs: number;
|
|
20
|
+
watchMode: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const DEFAULT_CONFIG: Partial<SyncConfig> = {
|
|
24
|
+
serviceId: "default",
|
|
25
|
+
autoSync: false,
|
|
26
|
+
syncIntervalMs: 3600000, // 1 hour
|
|
27
|
+
watchMode: false,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Load config from environment variables
|
|
32
|
+
*/
|
|
33
|
+
export function loadConfigFromEnv(): Partial<SyncConfig> {
|
|
34
|
+
return {
|
|
35
|
+
serverUrl: process.env.TENANTDB_URL || process.env.MEMORY_SERVER_URL,
|
|
36
|
+
knowledgeUrl: process.env.TENANTDB_KNOWLEDGE_URL,
|
|
37
|
+
userKey: process.env.TENANTDB_USER_KEY || process.env.TENANTDB_KEY,
|
|
38
|
+
serviceId: process.env.TENANTDB_SERVICE_ID || "default",
|
|
39
|
+
skillsSource: process.env.TENANTDB_SKILLS_SOURCE,
|
|
40
|
+
autoSync: process.env.TENANTDB_AUTO_SYNC === "true",
|
|
41
|
+
syncIntervalMs: process.env.TENANTDB_SYNC_INTERVAL
|
|
42
|
+
? parseInt(process.env.TENANTDB_SYNC_INTERVAL) * 1000
|
|
43
|
+
: undefined,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Load config from .pi/settings.json
|
|
49
|
+
*/
|
|
50
|
+
export async function loadConfigFromSettings(): Promise<Partial<SyncConfig>> {
|
|
51
|
+
const fs = await import("node:fs");
|
|
52
|
+
const path = await import("node:path");
|
|
53
|
+
const homedir = process.env.HOME || process.env.USERPROFILE || "~";
|
|
54
|
+
|
|
55
|
+
const settingsPath = path.join(homedir, ".pi", "settings.json");
|
|
56
|
+
|
|
57
|
+
if (!fs.existsSync(settingsPath)) {
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
try {
|
|
62
|
+
const content = fs.readFileSync(settingsPath, "utf-8");
|
|
63
|
+
const settings = JSON.parse(content);
|
|
64
|
+
|
|
65
|
+
if (settings.tencentdb) {
|
|
66
|
+
return {
|
|
67
|
+
serverUrl: settings.tencentdb.url || settings.tencentdb.serverUrl,
|
|
68
|
+
knowledgeUrl: settings.tencentdb.knowledgeUrl,
|
|
69
|
+
userKey: settings.tencentdb.userKey || settings.tencentdb.key,
|
|
70
|
+
serviceId: settings.tencentdb.serviceId || "default",
|
|
71
|
+
skillsSource: settings.tencentdb.skillsSource,
|
|
72
|
+
autoSync: settings.tencentdb.autoSync,
|
|
73
|
+
syncIntervalMs: settings.tencentdb.syncIntervalMs
|
|
74
|
+
? settings.tencentdb.syncIntervalMs * 1000
|
|
75
|
+
: undefined,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
} catch {
|
|
79
|
+
// Ignore parse errors
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Merge configs (env > settings > defaults)
|
|
87
|
+
*/
|
|
88
|
+
export async function loadConfig(): Promise<SyncConfig> {
|
|
89
|
+
const defaults = DEFAULT_CONFIG;
|
|
90
|
+
const fromSettings = await loadConfigFromSettings();
|
|
91
|
+
const fromEnv = loadConfigFromEnv();
|
|
92
|
+
|
|
93
|
+
// Knowledge URL defaults to serverUrl if not specified
|
|
94
|
+
const serverUrl = fromEnv.serverUrl || fromSettings.serverUrl || "";
|
|
95
|
+
const knowledgeUrl =
|
|
96
|
+
fromEnv.knowledgeUrl ||
|
|
97
|
+
fromSettings.knowledgeUrl ||
|
|
98
|
+
`${serverUrl.replace(/:\d+$/, "")}:8424`;
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
serverUrl,
|
|
102
|
+
knowledgeUrl,
|
|
103
|
+
userKey: fromEnv.userKey || fromSettings.userKey || "",
|
|
104
|
+
serviceId: fromEnv.serviceId || fromSettings.serviceId || "default",
|
|
105
|
+
skillsSource: fromEnv.skillsSource || fromSettings.skillsSource || "",
|
|
106
|
+
autoSync: fromEnv.autoSync ?? fromSettings.autoSync ?? defaults.autoSync!,
|
|
107
|
+
syncIntervalMs:
|
|
108
|
+
fromEnv.syncIntervalMs ||
|
|
109
|
+
fromSettings.syncIntervalMs ||
|
|
110
|
+
defaults.syncIntervalMs!,
|
|
111
|
+
watchMode:
|
|
112
|
+
fromEnv.watchMode ?? fromSettings.watchMode ?? defaults.watchMode!,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Validate config
|
|
118
|
+
*/
|
|
119
|
+
export function validateConfig(config: SyncConfig): string[] {
|
|
120
|
+
const errors: string[] = [];
|
|
121
|
+
|
|
122
|
+
if (!config.serverUrl) {
|
|
123
|
+
errors.push("TENANTDB_URL is required (set env var or .pi/settings.json)");
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (!config.userKey) {
|
|
127
|
+
errors.push(
|
|
128
|
+
"TENANTDB_USER_KEY is required (set env var or .pi/settings.json)",
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!config.skillsSource) {
|
|
133
|
+
errors.push(
|
|
134
|
+
"TENANTDB_SKILLS_SOURCE is required (set env var or .pi/settings.json)",
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return errors;
|
|
139
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TencentDB Sync (RFC-0105/0106)
|
|
3
|
+
*
|
|
4
|
+
* Syncs SKILL.md files to TencentDB-Agent-Memory server.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { createTencentDBClient, TencentDBClient } from "./client.js";
|
|
8
|
+
export type {
|
|
9
|
+
Skill,
|
|
10
|
+
SkillSearchResult,
|
|
11
|
+
Knowledge,
|
|
12
|
+
HealthStatus,
|
|
13
|
+
} from "./client.js";
|
|
14
|
+
|
|
15
|
+
export { loadConfig, validateConfig, type SyncConfig } from "./config.js";
|
|
@@ -91,6 +91,16 @@ export function isBdInstalled(): boolean {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Check if bd is initialized in the current project
|
|
96
|
+
* (i.e., .beads/ directory exists)
|
|
97
|
+
*/
|
|
98
|
+
export function isBdInitialized(cwd?: string): boolean {
|
|
99
|
+
const projectDir = cwd || process.cwd();
|
|
100
|
+
const beadsDir = join(projectDir, ".beads");
|
|
101
|
+
return existsSync(beadsDir);
|
|
102
|
+
}
|
|
103
|
+
|
|
94
104
|
/**
|
|
95
105
|
* Get the version of bd CLI if installed
|
|
96
106
|
*/
|
|
@@ -106,6 +116,9 @@ export function getBdVersion(): string | null {
|
|
|
106
116
|
}
|
|
107
117
|
}
|
|
108
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Get installation status of both dependencies
|
|
121
|
+
*/
|
|
109
122
|
/**
|
|
110
123
|
* Get installation status of both dependencies
|
|
111
124
|
*/
|
|
@@ -118,10 +131,13 @@ export interface DependencyStatus {
|
|
|
118
131
|
bd: {
|
|
119
132
|
installed: boolean;
|
|
120
133
|
version: string | null;
|
|
134
|
+
initialized: boolean;
|
|
135
|
+
installUrl: string;
|
|
121
136
|
};
|
|
122
137
|
}
|
|
123
138
|
|
|
124
|
-
export function getDependencyStatus(): DependencyStatus {
|
|
139
|
+
export function getDependencyStatus(cwd?: string): DependencyStatus {
|
|
140
|
+
const installed = isBdInstalled();
|
|
125
141
|
return {
|
|
126
142
|
rpivTodo: {
|
|
127
143
|
installed: isRpivTodoInstalled(),
|
|
@@ -129,8 +145,10 @@ export function getDependencyStatus(): DependencyStatus {
|
|
|
129
145
|
loaded: isRpivTodoLoaded(),
|
|
130
146
|
},
|
|
131
147
|
bd: {
|
|
132
|
-
installed
|
|
133
|
-
version: getBdVersion(),
|
|
148
|
+
installed,
|
|
149
|
+
version: installed ? getBdVersion() : null,
|
|
150
|
+
initialized: installed ? isBdInitialized(cwd) : false,
|
|
151
|
+
installUrl: "https://github.com/beads/bd#installation",
|
|
134
152
|
},
|
|
135
153
|
};
|
|
136
154
|
}
|
|
@@ -145,6 +163,9 @@ export function logDependencyStatus(): void {
|
|
|
145
163
|
` rpiv-todo: installed=${status.rpivTodo.installed}, version=${status.rpivTodo.version}, loaded=${status.rpivTodo.loaded}`,
|
|
146
164
|
);
|
|
147
165
|
console.log(
|
|
148
|
-
` bd: installed=${status.bd.installed}, version=${status.bd.version}`,
|
|
166
|
+
` bd: installed=${status.bd.installed}, version=${status.bd.version}, initialized=${status.bd.initialized}`,
|
|
149
167
|
);
|
|
168
|
+
if (!status.bd.installed) {
|
|
169
|
+
console.log(` bd install: ${status.bd.installUrl}`);
|
|
170
|
+
}
|
|
150
171
|
}
|
|
@@ -1,101 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* todo-bd-sync extension entry point
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 2. Sets up two-way sync between rpiv-todo and bd
|
|
7
|
-
* 3. Loads existing bd issues on session start
|
|
8
|
-
*
|
|
9
|
-
* To use this extension:
|
|
10
|
-
* 1. Install dependencies:
|
|
11
|
-
* pi install npm:@juicesharp/rpiv-todo
|
|
12
|
-
* (bd should already be installed)
|
|
13
|
-
*
|
|
14
|
-
* 2. The extension auto-enables when rpiv-todo is detected
|
|
4
|
+
* NOTE: Auto-injection disabled - was causing noisy output.
|
|
5
|
+
* Only provides dependency detection status.
|
|
15
6
|
*/
|
|
16
7
|
|
|
17
8
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
18
|
-
import {
|
|
19
|
-
createTodoBdSync,
|
|
20
|
-
type TodoBdSync,
|
|
21
|
-
type TodoBdSyncConfig,
|
|
22
|
-
} from "./index.js";
|
|
23
|
-
import { getDependencyStatus, logDependencyStatus } from "./detector.js";
|
|
24
|
-
import { createCustomReminder } from "./todo-reminder.js";
|
|
25
|
-
import { getOpenBdIssues } from "./sync.js";
|
|
26
9
|
|
|
27
10
|
/**
|
|
28
11
|
* Register the todo-bd-sync extension
|
|
12
|
+
*
|
|
13
|
+
* NOTE: Auto-injection disabled - was causing issues with bd working.
|
|
14
|
+
* The todo tool call injection has been removed.
|
|
29
15
|
*/
|
|
30
|
-
export function registerTodoBdSync(
|
|
31
|
-
|
|
32
|
-
config?: TodoBdSyncConfig,
|
|
33
|
-
): TodoBdSync | null {
|
|
34
|
-
const deps = getDependencyStatus();
|
|
35
|
-
|
|
36
|
-
// Check if bd is installed
|
|
37
|
-
if (!deps.bd.installed) {
|
|
38
|
-
console.log("[DEBUG todo-bd-sync] bd CLI not found - skipping todo sync");
|
|
39
|
-
console.log(
|
|
40
|
-
"[todo-bd-sync] Install bd: see https://github.com/gastownhall/beads",
|
|
41
|
-
);
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Log dependency status for debugging
|
|
46
|
-
if (config?.debug) {
|
|
47
|
-
logDependencyStatus();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Check if rpiv-todo is installed
|
|
51
|
-
const rpivTodoStatus = deps.rpivTodo.installed
|
|
52
|
-
? "installed"
|
|
53
|
-
: "not installed (using fallback)";
|
|
54
|
-
|
|
55
|
-
console.log(`[todo-bd-sync] rpiv-todo: ${rpivTodoStatus}`);
|
|
56
|
-
console.log("[DEBUG todo-bd-sync] bd CLI: installed");
|
|
57
|
-
|
|
58
|
-
// Create and start sync
|
|
59
|
-
const sync = createTodoBdSync(pi, {
|
|
60
|
-
autoInjectPrompt: true,
|
|
61
|
-
syncDirection: "both",
|
|
62
|
-
loadOnSessionStart: true,
|
|
63
|
-
...config,
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
sync.start();
|
|
67
|
-
|
|
68
|
-
// Start todo reminder (DISABLED by default — Phase 1 emergency containment)
|
|
69
|
-
// Reminder spam was causing transcript growth. Enable only after proper task scoping.
|
|
70
|
-
const reminder = createCustomReminder(
|
|
71
|
-
pi,
|
|
72
|
-
() => {
|
|
73
|
-
// Get remaining todos from bd
|
|
74
|
-
const issues = getOpenBdIssues();
|
|
75
|
-
return issues
|
|
76
|
-
.filter((i) => i.status !== "closed")
|
|
77
|
-
.map((i) => ({
|
|
78
|
-
id: i.id,
|
|
79
|
-
title: i.title,
|
|
80
|
-
status: i.status,
|
|
81
|
-
}));
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
autoRemind: false, // DISABLED — fix reminder spam before re-enabling
|
|
85
|
-
minPendingTasks: 1,
|
|
86
|
-
},
|
|
87
|
-
);
|
|
88
|
-
reminder.start();
|
|
89
|
-
|
|
90
|
-
console.log("[DEBUG todo-bd-sync] Enabled - two-way sync active");
|
|
91
|
-
console.log(
|
|
92
|
-
"[todo-bd-sync] Reminder DISABLED — set autoRemind: true to enable",
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
return sync;
|
|
16
|
+
export function registerTodoBdSync(_pi: ExtensionAPI): void {
|
|
17
|
+
// Silent - no registration, no injection, no console output
|
|
96
18
|
}
|
|
97
19
|
|
|
98
20
|
// Default export for pi extension loading
|
|
99
21
|
export default function todoBdSyncExtension(pi: ExtensionAPI): void {
|
|
100
|
-
registerTodoBdSync(pi
|
|
22
|
+
registerTodoBdSync(pi);
|
|
101
23
|
}
|