nexus-prime 4.10.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -7
- package/dist/agents/adapters/ide-compat.d.ts +31 -0
- package/dist/agents/adapters/ide-compat.d.ts.map +1 -0
- package/dist/agents/adapters/ide-compat.js +150 -0
- package/dist/agents/adapters/ide-compat.js.map +1 -0
- package/dist/agents/adapters/mcp.d.ts.map +1 -1
- package/dist/agents/adapters/mcp.js +97 -14
- package/dist/agents/adapters/mcp.js.map +1 -1
- package/dist/architects/convergence/queue.d.ts.map +1 -1
- package/dist/architects/convergence/queue.js +4 -0
- package/dist/architects/convergence/queue.js.map +1 -1
- package/dist/cli/install-wizard.d.ts +29 -0
- package/dist/cli/install-wizard.d.ts.map +1 -0
- package/dist/cli/install-wizard.js +125 -0
- package/dist/cli/install-wizard.js.map +1 -0
- package/dist/cli.js +15 -1
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/index.html +56 -4
- package/dist/dashboard/routes/assets.d.ts +3 -0
- package/dist/dashboard/routes/assets.d.ts.map +1 -0
- package/dist/dashboard/routes/assets.js +228 -0
- package/dist/dashboard/routes/assets.js.map +1 -0
- package/dist/dashboard/routes/events.d.ts +3 -0
- package/dist/dashboard/routes/events.d.ts.map +1 -0
- package/dist/dashboard/routes/events.js +61 -0
- package/dist/dashboard/routes/events.js.map +1 -0
- package/dist/dashboard/routes/governance.d.ts +3 -0
- package/dist/dashboard/routes/governance.d.ts.map +1 -0
- package/dist/dashboard/routes/governance.js +89 -0
- package/dist/dashboard/routes/governance.js.map +1 -0
- package/dist/dashboard/routes/health.d.ts +3 -0
- package/dist/dashboard/routes/health.d.ts.map +1 -0
- package/dist/dashboard/routes/health.js +22 -0
- package/dist/dashboard/routes/health.js.map +1 -0
- package/dist/dashboard/routes/memory.d.ts +3 -0
- package/dist/dashboard/routes/memory.d.ts.map +1 -0
- package/dist/dashboard/routes/memory.js +258 -0
- package/dist/dashboard/routes/memory.js.map +1 -0
- package/dist/dashboard/routes/runtime.d.ts +3 -0
- package/dist/dashboard/routes/runtime.d.ts.map +1 -0
- package/dist/dashboard/routes/runtime.js +131 -0
- package/dist/dashboard/routes/runtime.js.map +1 -0
- package/dist/dashboard/routes/summary.d.ts +3 -0
- package/dist/dashboard/routes/summary.d.ts.map +1 -0
- package/dist/dashboard/routes/summary.js +21 -0
- package/dist/dashboard/routes/summary.js.map +1 -0
- package/dist/dashboard/routes/surfaces.d.ts +3 -0
- package/dist/dashboard/routes/surfaces.d.ts.map +1 -0
- package/dist/dashboard/routes/surfaces.js +26 -0
- package/dist/dashboard/routes/surfaces.js.map +1 -0
- package/dist/dashboard/selectors/assets-selector.d.ts +3 -0
- package/dist/dashboard/selectors/assets-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/assets-selector.js +36 -0
- package/dist/dashboard/selectors/assets-selector.js.map +1 -0
- package/dist/dashboard/selectors/memory-selector.d.ts +3 -0
- package/dist/dashboard/selectors/memory-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/memory-selector.js +34 -0
- package/dist/dashboard/selectors/memory-selector.js.map +1 -0
- package/dist/dashboard/selectors/operate-selector.d.ts +3 -0
- package/dist/dashboard/selectors/operate-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/operate-selector.js +31 -0
- package/dist/dashboard/selectors/operate-selector.js.map +1 -0
- package/dist/dashboard/selectors/runs-selector.d.ts +3 -0
- package/dist/dashboard/selectors/runs-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/runs-selector.js +25 -0
- package/dist/dashboard/selectors/runs-selector.js.map +1 -0
- package/dist/dashboard/selectors/summary-selector.d.ts +19 -0
- package/dist/dashboard/selectors/summary-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/summary-selector.js +85 -0
- package/dist/dashboard/selectors/summary-selector.js.map +1 -0
- package/dist/dashboard/selectors/trust-selector.d.ts +3 -0
- package/dist/dashboard/selectors/trust-selector.d.ts.map +1 -0
- package/dist/dashboard/selectors/trust-selector.js +37 -0
- package/dist/dashboard/selectors/trust-selector.js.map +1 -0
- package/dist/dashboard/serializers/memory-serializer.d.ts +5 -0
- package/dist/dashboard/serializers/memory-serializer.d.ts.map +1 -0
- package/dist/dashboard/serializers/memory-serializer.js +22 -0
- package/dist/dashboard/serializers/memory-serializer.js.map +1 -0
- package/dist/dashboard/serializers/proof-serializer.d.ts +4 -0
- package/dist/dashboard/serializers/proof-serializer.d.ts.map +1 -0
- package/dist/dashboard/serializers/proof-serializer.js +34 -0
- package/dist/dashboard/serializers/proof-serializer.js.map +1 -0
- package/dist/dashboard/serializers/run-serializer.d.ts +9 -0
- package/dist/dashboard/serializers/run-serializer.d.ts.map +1 -0
- package/dist/dashboard/serializers/run-serializer.js +32 -0
- package/dist/dashboard/serializers/run-serializer.js.map +1 -0
- package/dist/dashboard/server.d.ts +3 -69
- package/dist/dashboard/server.d.ts.map +1 -1
- package/dist/dashboard/server.js +84 -1312
- package/dist/dashboard/server.js.map +1 -1
- package/dist/dashboard/stream/sse-broker.d.ts +20 -0
- package/dist/dashboard/stream/sse-broker.d.ts.map +1 -0
- package/dist/dashboard/stream/sse-broker.js +316 -0
- package/dist/dashboard/stream/sse-broker.js.map +1 -0
- package/dist/dashboard/types.d.ts +326 -0
- package/dist/dashboard/types.d.ts.map +1 -0
- package/dist/dashboard/types.js +2 -0
- package/dist/dashboard/types.js.map +1 -0
- package/dist/engines/bootstrap/bootstrap-deep.d.ts +48 -0
- package/dist/engines/bootstrap/bootstrap-deep.d.ts.map +1 -0
- package/dist/engines/bootstrap/bootstrap-deep.js +58 -0
- package/dist/engines/bootstrap/bootstrap-deep.js.map +1 -0
- package/dist/engines/bootstrap/bootstrap-fast.d.ts +55 -0
- package/dist/engines/bootstrap/bootstrap-fast.d.ts.map +1 -0
- package/dist/engines/bootstrap/bootstrap-fast.js +68 -0
- package/dist/engines/bootstrap/bootstrap-fast.js.map +1 -0
- package/dist/engines/bootstrap/bootstrap-registry.d.ts +38 -0
- package/dist/engines/bootstrap/bootstrap-registry.d.ts.map +1 -0
- package/dist/engines/bootstrap/bootstrap-registry.js +95 -0
- package/dist/engines/bootstrap/bootstrap-registry.js.map +1 -0
- package/dist/engines/bootstrap/index.d.ts +16 -0
- package/dist/engines/bootstrap/index.d.ts.map +1 -0
- package/dist/engines/bootstrap/index.js +12 -0
- package/dist/engines/bootstrap/index.js.map +1 -0
- package/dist/engines/bootstrap/run-prepare.d.ts +44 -0
- package/dist/engines/bootstrap/run-prepare.d.ts.map +1 -0
- package/dist/engines/bootstrap/run-prepare.js +37 -0
- package/dist/engines/bootstrap/run-prepare.js.map +1 -0
- package/dist/engines/bootstrap/types.d.ts +168 -0
- package/dist/engines/bootstrap/types.d.ts.map +1 -0
- package/dist/engines/bootstrap/types.js +14 -0
- package/dist/engines/bootstrap/types.js.map +1 -0
- package/dist/engines/governance-boundary.d.ts +41 -0
- package/dist/engines/governance-boundary.d.ts.map +1 -0
- package/dist/engines/governance-boundary.js +79 -0
- package/dist/engines/governance-boundary.js.map +1 -0
- package/dist/engines/learning-compiler.d.ts +32 -0
- package/dist/engines/learning-compiler.d.ts.map +1 -0
- package/dist/engines/learning-compiler.js +51 -0
- package/dist/engines/learning-compiler.js.map +1 -0
- package/dist/engines/machine-efficiency/governor.d.ts +70 -0
- package/dist/engines/machine-efficiency/governor.d.ts.map +1 -0
- package/dist/engines/machine-efficiency/governor.js +180 -0
- package/dist/engines/machine-efficiency/governor.js.map +1 -0
- package/dist/engines/machine-efficiency/index.d.ts +8 -0
- package/dist/engines/machine-efficiency/index.d.ts.map +1 -0
- package/dist/engines/machine-efficiency/index.js +7 -0
- package/dist/engines/machine-efficiency/index.js.map +1 -0
- package/dist/engines/machine-efficiency/pressure-detector.d.ts +20 -0
- package/dist/engines/machine-efficiency/pressure-detector.d.ts.map +1 -0
- package/dist/engines/machine-efficiency/pressure-detector.js +93 -0
- package/dist/engines/machine-efficiency/pressure-detector.js.map +1 -0
- package/dist/engines/machine-efficiency/types.d.ts +37 -0
- package/dist/engines/machine-efficiency/types.d.ts.map +1 -0
- package/dist/engines/machine-efficiency/types.js +16 -0
- package/dist/engines/machine-efficiency/types.js.map +1 -0
- package/dist/engines/memory-classes.d.ts +36 -0
- package/dist/engines/memory-classes.d.ts.map +1 -0
- package/dist/engines/memory-classes.js +56 -0
- package/dist/engines/memory-classes.js.map +1 -0
- package/dist/engines/memory-promotion.d.ts +34 -0
- package/dist/engines/memory-promotion.d.ts.map +1 -0
- package/dist/engines/memory-promotion.js +71 -0
- package/dist/engines/memory-promotion.js.map +1 -0
- package/dist/engines/orchestrator.d.ts.map +1 -1
- package/dist/engines/orchestrator.js +36 -0
- package/dist/engines/orchestrator.js.map +1 -1
- package/dist/engines/priors/file-priors.d.ts +27 -0
- package/dist/engines/priors/file-priors.d.ts.map +1 -0
- package/dist/engines/priors/file-priors.js +47 -0
- package/dist/engines/priors/file-priors.js.map +1 -0
- package/dist/engines/priors/selector-precedence.d.ts +33 -0
- package/dist/engines/priors/selector-precedence.d.ts.map +1 -0
- package/dist/engines/priors/selector-precedence.js +48 -0
- package/dist/engines/priors/selector-precedence.js.map +1 -0
- package/dist/engines/priors/topology-priors.d.ts +20 -0
- package/dist/engines/priors/topology-priors.d.ts.map +1 -0
- package/dist/engines/priors/topology-priors.js +37 -0
- package/dist/engines/priors/topology-priors.js.map +1 -0
- package/dist/engines/priors/verifier-priors.d.ts +18 -0
- package/dist/engines/priors/verifier-priors.d.ts.map +1 -0
- package/dist/engines/priors/verifier-priors.js +35 -0
- package/dist/engines/priors/verifier-priors.js.map +1 -0
- package/dist/engines/priors/workflow-priors.d.ts +18 -0
- package/dist/engines/priors/workflow-priors.d.ts.map +1 -0
- package/dist/engines/priors/workflow-priors.js +29 -0
- package/dist/engines/priors/workflow-priors.js.map +1 -0
- package/dist/engines/proofs/index.d.ts +11 -0
- package/dist/engines/proofs/index.d.ts.map +1 -0
- package/dist/engines/proofs/index.js +9 -0
- package/dist/engines/proofs/index.js.map +1 -0
- package/dist/engines/proofs/proof-builder.d.ts +69 -0
- package/dist/engines/proofs/proof-builder.d.ts.map +1 -0
- package/dist/engines/proofs/proof-builder.js +66 -0
- package/dist/engines/proofs/proof-builder.js.map +1 -0
- package/dist/engines/proofs/proof-store.d.ts +27 -0
- package/dist/engines/proofs/proof-store.d.ts.map +1 -0
- package/dist/engines/proofs/proof-store.js +116 -0
- package/dist/engines/proofs/proof-store.js.map +1 -0
- package/dist/engines/proofs/types.d.ts +80 -0
- package/dist/engines/proofs/types.d.ts.map +1 -0
- package/dist/engines/proofs/types.js +9 -0
- package/dist/engines/proofs/types.js.map +1 -0
- package/dist/engines/simulation-sandbox.d.ts +87 -0
- package/dist/engines/simulation-sandbox.d.ts.map +1 -0
- package/dist/engines/simulation-sandbox.js +221 -0
- package/dist/engines/simulation-sandbox.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/phantom/context/context-assembler-runtime.d.ts +19 -0
- package/dist/phantom/context/context-assembler-runtime.d.ts.map +1 -0
- package/dist/phantom/context/context-assembler-runtime.js +31 -0
- package/dist/phantom/context/context-assembler-runtime.js.map +1 -0
- package/dist/phantom/execution/execution-coordinator.d.ts +23 -0
- package/dist/phantom/execution/execution-coordinator.d.ts.map +1 -0
- package/dist/phantom/execution/execution-coordinator.js +50 -0
- package/dist/phantom/execution/execution-coordinator.js.map +1 -0
- package/dist/phantom/mutation/mutation-engine.d.ts +41 -0
- package/dist/phantom/mutation/mutation-engine.d.ts.map +1 -0
- package/dist/phantom/mutation/mutation-engine.js +51 -0
- package/dist/phantom/mutation/mutation-engine.js.map +1 -0
- package/dist/phantom/projection/run-projector.d.ts +27 -0
- package/dist/phantom/projection/run-projector.d.ts.map +1 -0
- package/dist/phantom/projection/run-projector.js +45 -0
- package/dist/phantom/projection/run-projector.js.map +1 -0
- package/dist/phantom/topology/worker-topology-planner.d.ts +18 -0
- package/dist/phantom/topology/worker-topology-planner.d.ts.map +1 -0
- package/dist/phantom/topology/worker-topology-planner.js +31 -0
- package/dist/phantom/topology/worker-topology-planner.js.map +1 -0
- package/dist/phantom/types/execution.d.ts +70 -0
- package/dist/phantom/types/execution.d.ts.map +1 -0
- package/dist/phantom/types/execution.js +8 -0
- package/dist/phantom/types/execution.js.map +1 -0
- package/dist/phantom/types/proofs.d.ts +8 -0
- package/dist/phantom/types/proofs.d.ts.map +1 -0
- package/dist/phantom/types/proofs.js +7 -0
- package/dist/phantom/types/proofs.js.map +1 -0
- package/dist/phantom/verification/verification-engine.d.ts +20 -0
- package/dist/phantom/verification/verification-engine.d.ts.map +1 -0
- package/dist/phantom/verification/verification-engine.js +80 -0
- package/dist/phantom/verification/verification-engine.js.map +1 -0
- package/dist/postinstall-bootstrap.js +7 -2
- package/dist/postinstall-bootstrap.js.map +1 -1
- package/dist/synapse/field-reports/ledger.js +1 -1
- package/dist/synapse/field-reports/ledger.js.map +1 -1
- package/dist/utils/ascii-art.d.ts +2 -0
- package/dist/utils/ascii-art.d.ts.map +1 -1
- package/dist/utils/ascii-art.js +63 -0
- package/dist/utils/ascii-art.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ Every coding agent eventually hits the same ceiling. Not model quality — infra
|
|
|
65
65
|
**Nexus Prime** is a local-first MCP control plane for coding agents. It gives clients a default path that starts with bootstrap context, flows through orchestrated execution, and ends with persisted runtime truth instead of ad-hoc tool chaining.
|
|
66
66
|
|
|
67
67
|
**Website:** [nexus-prime.cfd](https://nexus-prime.cfd/)<br>
|
|
68
|
-
**Documentation:** [Catalog](https://
|
|
68
|
+
**Documentation:** [Catalog](https://nexus-prime.cfd/catalog.html) · [Comparison](https://nexus-prime.cfd/comparison.html) · [Knowledge Base](https://nexus-prime.cfd/knowledge-base.html) · [Integrations](https://nexus-prime.cfd/integrations.html) · [Architecture Diagrams](https://nexus-prime.cfd/architecture-diagrams.html)
|
|
69
69
|
|
|
70
70
|
## ⚡ Quick Install
|
|
71
71
|
|
|
@@ -174,11 +174,11 @@ Use `nexus_plan_execution` only when you explicitly want the ledger before mutat
|
|
|
174
174
|
<i>Knowledge and token trace view: Nexus shows what attached collections contributed, what token budgeting kept, and what the runtime dropped.</i>
|
|
175
175
|
</div>
|
|
176
176
|
|
|
177
|
-
- [Catalog](https://
|
|
178
|
-
- [Comparison](https://
|
|
179
|
-
- [Knowledge Base](https://
|
|
180
|
-
- [Integrations](https://
|
|
181
|
-
- [Architecture Diagrams](https://
|
|
177
|
+
- [Catalog](https://nexus-prime.cfd/catalog.html): generated registry for MCP surfaces, client targets, dashboard capabilities, runtime subsystems, and release gates.
|
|
178
|
+
- [Comparison](https://nexus-prime.cfd/comparison.html): tiered market map for direct developer orchestrators, broader multi-agent frameworks, and adjacent specialist stacks.
|
|
179
|
+
- [Knowledge Base](https://nexus-prime.cfd/knowledge-base.html): runtime contract, packets, ledgers, memory, token telemetry, and guardrails.
|
|
180
|
+
- [Integrations](https://nexus-prime.cfd/integrations.html): verified setup for Codex, Cursor, Claude Code, Opencode, Windsurf, and Antigravity/OpenClaw.
|
|
181
|
+
- [Architecture Diagrams](https://nexus-prime.cfd/architecture-diagrams.html): shipped diagrams for the control plane, worktree lifecycle, memory fabric, RAG gate, token budget, runtime truth, and release pipeline.
|
|
182
182
|
|
|
183
183
|
<details>
|
|
184
184
|
<summary><b>📐 Diagram: bootstrap → orchestrate → runtime → truth</b></summary>
|
|
@@ -285,7 +285,7 @@ The entire category treats memory as a local storage problem rather than a knowl
|
|
|
285
285
|
|
|
286
286
|
Nexus Prime is not a memory layer. It is the control plane that sits between the client and the repo — owning bootstrap, orchestration, worktree execution, and persisted runtime truth. Memory is one subsystem within it, not the product.
|
|
287
287
|
|
|
288
|
-
Read the full tiered market map: [Comparison](https://
|
|
288
|
+
Read the full tiered market map: [Comparison](https://nexus-prime.cfd/comparison.html)
|
|
289
289
|
|
|
290
290
|
<!-- feature-registry:start -->
|
|
291
291
|
<details>
|
|
@@ -630,6 +630,20 @@ Inventory Snapshot: 109 skills · 64 workflows · 9 hooks · 5 automations · 7
|
|
|
630
630
|
## 📜 Release History
|
|
631
631
|
|
|
632
632
|
<details open>
|
|
633
|
+
<summary><b>v5.0.0</b> · 2026-04-04 · Phantom Sovereignty — proof-carrying execution, governance boundaries, machine efficiency, and dashboard revamp</summary>
|
|
634
|
+
|
|
635
|
+
- **Proof-carrying execution**: 5 proof types (Selection, Worker, Verification, MemoryPromotion, Apply) with tri-state run model and bounded simulation sandbox.
|
|
636
|
+
- **Phantom modularization**: Runtime decomposed into 6 focused service modules — ExecutionCoordinator, MutationEngine, VerificationEngine, WorkerTopologyPlanner, RuntimeContextAssembler, and RunProjector.
|
|
637
|
+
- **Governance boundary enforcement**: Central `assertGovernanceBoundary()` blocks Synapse and Architects from file/worktree/git mutations. MutationEngine is sole mutation authority.
|
|
638
|
+
- **Machine Efficiency Governor**: Pressure-aware degradation (nominal/elevated/critical) with hard caps on worktrees, dashboard listeners, and cache sizes.
|
|
639
|
+
- **Memory class hierarchy**: 4-tier classification with strict promotion rules, prior system, and learning compiler.
|
|
640
|
+
- **Dashboard revamp**: Backend split into routes/selectors/serializers/DTOs, SSE broker, machine pressure badge, and governor panel on trust surface.
|
|
641
|
+
- **Staged bootstrap**: 3-phase bootstrap with durable receipt persistence, orchestrator self-heal, and ASCII sci-fi install experience.
|
|
642
|
+
|
|
643
|
+
Full history: [CHANGELOG.md](./CHANGELOG.md)
|
|
644
|
+
</details>
|
|
645
|
+
|
|
646
|
+
<details>
|
|
633
647
|
<summary><b>v4.10.2</b> · 2026-04-02 · Company Control Plane — runtime-scoped hiring, repo-truth MCP, and dashboard alignment</summary>
|
|
634
648
|
|
|
635
649
|
- **Real employee control plane**: Synapse now supports direct and approval-backed hires, operative lifecycle updates, and heartbeat triggers instead of keeping hiring behind internal-only mandate plumbing.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nexus Prime — IDE Compatibility Utilities
|
|
3
|
+
* Provides MCP config templates and detection logic for all supported IDEs.
|
|
4
|
+
*
|
|
5
|
+
* Supported: VS Code (Claude Code ext), JetBrains, Cursor, Windsurf, Zed, Continue.dev, Aider, Cline, Codex
|
|
6
|
+
*/
|
|
7
|
+
export type IDEId = 'claude-code' | 'cursor' | 'windsurf' | 'continue' | 'cline' | 'zed' | 'codex';
|
|
8
|
+
export interface McpConfigOutput {
|
|
9
|
+
/** Absolute path where the config should be written */
|
|
10
|
+
configPath: string | null;
|
|
11
|
+
/** JSON string content to write */
|
|
12
|
+
content: string;
|
|
13
|
+
/** If true, attempt to merge into existing file rather than overwrite */
|
|
14
|
+
merge: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Detect which IDEs are present in the workspace or home directory. */
|
|
17
|
+
export declare function detectInstalledIDEs(workspaceRoot: string): IDEId[];
|
|
18
|
+
/** Get the MCP config content and target path for a given IDE. */
|
|
19
|
+
export declare function getMcpConfigForIDE(ide: IDEId, workspaceRoot: string): McpConfigOutput;
|
|
20
|
+
/**
|
|
21
|
+
* Normalise MCP tool response content for cross-client compatibility.
|
|
22
|
+
* Some clients have subtle differences in how they render multi-part content.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeMcpContent(content: Array<{
|
|
25
|
+
type: string;
|
|
26
|
+
text?: string;
|
|
27
|
+
}>): Array<{
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=ide-compat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-compat.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/ide-compat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,MAAM,KAAK,GACb,aAAa,GACb,QAAQ,GACR,UAAU,GACV,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,CAAC;AAEZ,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,KAAK,EAAE,OAAO,CAAC;CAChB;AAWD,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,KAAK,EAAE,CAoDlE;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,GAAG,eAAe,CA2FrF;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9C,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAIvC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nexus Prime — IDE Compatibility Utilities
|
|
3
|
+
* Provides MCP config templates and detection logic for all supported IDEs.
|
|
4
|
+
*
|
|
5
|
+
* Supported: VS Code (Claude Code ext), JetBrains, Cursor, Windsurf, Zed, Continue.dev, Aider, Cline, Codex
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync } from 'fs';
|
|
8
|
+
import { homedir } from 'os';
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
/** Nexus Prime MCP server entry (stdio transport). */
|
|
11
|
+
function nexusMcpServerEntry(workspaceRoot) {
|
|
12
|
+
return {
|
|
13
|
+
command: 'node',
|
|
14
|
+
args: [join(workspaceRoot, 'node_modules', 'nexus-prime', 'dist', 'cli.js'), 'mcp'],
|
|
15
|
+
env: {},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/** Detect which IDEs are present in the workspace or home directory. */
|
|
19
|
+
export function detectInstalledIDEs(workspaceRoot) {
|
|
20
|
+
const detected = [];
|
|
21
|
+
const home = homedir();
|
|
22
|
+
// Claude Code: reads from ~/.claude/settings.json or project .claude/settings.json
|
|
23
|
+
if (existsSync(join(home, '.claude')) ||
|
|
24
|
+
existsSync(join(workspaceRoot, '.claude'))) {
|
|
25
|
+
detected.push('claude-code');
|
|
26
|
+
}
|
|
27
|
+
// Cursor: .cursor/ directory in workspace or home
|
|
28
|
+
if (existsSync(join(workspaceRoot, '.cursor')) ||
|
|
29
|
+
existsSync(join(home, '.cursor'))) {
|
|
30
|
+
detected.push('cursor');
|
|
31
|
+
}
|
|
32
|
+
// Windsurf: .windsurf/ directory
|
|
33
|
+
if (existsSync(join(workspaceRoot, '.windsurf')) ||
|
|
34
|
+
existsSync(join(home, '.windsurf'))) {
|
|
35
|
+
detected.push('windsurf');
|
|
36
|
+
}
|
|
37
|
+
// Continue.dev: .continue/ directory
|
|
38
|
+
if (existsSync(join(workspaceRoot, '.continue')) ||
|
|
39
|
+
existsSync(join(home, '.continue'))) {
|
|
40
|
+
detected.push('continue');
|
|
41
|
+
}
|
|
42
|
+
// Cline: VS Code extension — detected via .vscode/cline.json or cline settings
|
|
43
|
+
if (existsSync(join(workspaceRoot, '.vscode', 'cline.json'))) {
|
|
44
|
+
detected.push('cline');
|
|
45
|
+
}
|
|
46
|
+
// Zed: ~/.config/zed/
|
|
47
|
+
if (existsSync(join(home, '.config', 'zed'))) {
|
|
48
|
+
detected.push('zed');
|
|
49
|
+
}
|
|
50
|
+
// Codex: CODEX_HOME env or ~/.codex/
|
|
51
|
+
if (process.env.CODEX_HOME || existsSync(join(home, '.codex'))) {
|
|
52
|
+
detected.push('codex');
|
|
53
|
+
}
|
|
54
|
+
return detected;
|
|
55
|
+
}
|
|
56
|
+
/** Get the MCP config content and target path for a given IDE. */
|
|
57
|
+
export function getMcpConfigForIDE(ide, workspaceRoot) {
|
|
58
|
+
const home = homedir();
|
|
59
|
+
const entry = nexusMcpServerEntry(workspaceRoot);
|
|
60
|
+
switch (ide) {
|
|
61
|
+
case 'claude-code': {
|
|
62
|
+
// Claude Code reads mcpServers from project .claude/settings.json
|
|
63
|
+
const configPath = join(workspaceRoot, '.claude', 'settings.json');
|
|
64
|
+
const content = JSON.stringify({
|
|
65
|
+
mcpServers: {
|
|
66
|
+
'nexus-prime': entry,
|
|
67
|
+
},
|
|
68
|
+
}, null, 2);
|
|
69
|
+
return { configPath, content, merge: true };
|
|
70
|
+
}
|
|
71
|
+
case 'cursor': {
|
|
72
|
+
// Cursor uses .cursor/mcp.json in the workspace
|
|
73
|
+
const configPath = join(workspaceRoot, '.cursor', 'mcp.json');
|
|
74
|
+
const content = JSON.stringify({
|
|
75
|
+
mcpServers: {
|
|
76
|
+
'nexus-prime': entry,
|
|
77
|
+
},
|
|
78
|
+
}, null, 2);
|
|
79
|
+
return { configPath, content, merge: true };
|
|
80
|
+
}
|
|
81
|
+
case 'windsurf': {
|
|
82
|
+
// Windsurf uses ~/.windsurf/mcp.json (global) or workspace .windsurf/mcp.json
|
|
83
|
+
const configPath = existsSync(join(workspaceRoot, '.windsurf'))
|
|
84
|
+
? join(workspaceRoot, '.windsurf', 'mcp.json')
|
|
85
|
+
: join(home, '.windsurf', 'mcp.json');
|
|
86
|
+
const content = JSON.stringify({
|
|
87
|
+
mcpServers: {
|
|
88
|
+
'nexus-prime': entry,
|
|
89
|
+
},
|
|
90
|
+
}, null, 2);
|
|
91
|
+
return { configPath, content, merge: true };
|
|
92
|
+
}
|
|
93
|
+
case 'continue': {
|
|
94
|
+
// Continue.dev uses ~/.continue/config.json
|
|
95
|
+
const configPath = join(home, '.continue', 'config.json');
|
|
96
|
+
const content = JSON.stringify({
|
|
97
|
+
mcpServers: {
|
|
98
|
+
'nexus-prime': entry,
|
|
99
|
+
},
|
|
100
|
+
}, null, 2);
|
|
101
|
+
return { configPath, content, merge: true };
|
|
102
|
+
}
|
|
103
|
+
case 'cline': {
|
|
104
|
+
// Cline: .vscode/cline.json or global VS Code settings
|
|
105
|
+
const configPath = join(workspaceRoot, '.vscode', 'cline.json');
|
|
106
|
+
const content = JSON.stringify({
|
|
107
|
+
mcpServers: {
|
|
108
|
+
'nexus-prime': entry,
|
|
109
|
+
},
|
|
110
|
+
}, null, 2);
|
|
111
|
+
return { configPath, content, merge: true };
|
|
112
|
+
}
|
|
113
|
+
case 'zed': {
|
|
114
|
+
// Zed: ~/.config/zed/settings.json
|
|
115
|
+
const configPath = join(home, '.config', 'zed', 'settings.json');
|
|
116
|
+
const content = JSON.stringify({
|
|
117
|
+
context_servers: {
|
|
118
|
+
'nexus-prime': {
|
|
119
|
+
command: entry.command,
|
|
120
|
+
args: entry.args,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
}, null, 2);
|
|
124
|
+
return { configPath, content, merge: true };
|
|
125
|
+
}
|
|
126
|
+
case 'codex': {
|
|
127
|
+
// Codex: ~/.codex/config.json or CODEX_HOME
|
|
128
|
+
const codexHome = process.env.CODEX_HOME ?? join(home, '.codex');
|
|
129
|
+
const configPath = join(codexHome, 'config.json');
|
|
130
|
+
const content = JSON.stringify({
|
|
131
|
+
mcpServers: {
|
|
132
|
+
'nexus-prime': entry,
|
|
133
|
+
},
|
|
134
|
+
}, null, 2);
|
|
135
|
+
return { configPath, content, merge: true };
|
|
136
|
+
}
|
|
137
|
+
default:
|
|
138
|
+
return { configPath: null, content: '{}', merge: false };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Normalise MCP tool response content for cross-client compatibility.
|
|
143
|
+
* Some clients have subtle differences in how they render multi-part content.
|
|
144
|
+
*/
|
|
145
|
+
export function normalizeMcpContent(content) {
|
|
146
|
+
return content
|
|
147
|
+
.filter((c) => c.type === 'text' && c.text != null)
|
|
148
|
+
.map((c) => ({ type: 'text', text: String(c.text ?? '') }));
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=ide-compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ide-compat.js","sourceRoot":"","sources":["../../../src/agents/adapters/ide-compat.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH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AAC;QAED;YACE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC7D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CACjC,OAA+C;IAE/C,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC;SAClD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../../src/agents/adapters/mcp.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAmG5C,KAAK,cAAc,GAAG,YAAY,GAAG,MAAM,CAAC;AAK5C,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC,CAAC;AA8ZF,qBAAa,UAAW,YAAW,OAAO;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAG,KAAK,CAAU;I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AAC,OAAO,GAAE,cAAsC,GAAG,iBAAiB,EAAE;IAIpF,OAAO,CAAC,oBAAoB;IAg/B5B,OAAO,CAAC,iBAAiB;YAmHX,cAAc;IA8gF5B,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAItC,OAAO,CAAC,IAAI;IAmBN,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAoB3B,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAYlD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;CAOzC"}
|
|
@@ -5,7 +5,7 @@ import { statSync, readdirSync } from 'fs';
|
|
|
5
5
|
import * as path from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
7
|
import { execSync } from 'child_process';
|
|
8
|
-
import { createHash } from 'crypto';
|
|
8
|
+
import { createHash, randomUUID } from 'crypto';
|
|
9
9
|
import { TokenSupremacyEngine, formatReadingPlan } from '../../engines/token-supremacy.js';
|
|
10
10
|
import { GhostPass, createSubAgentRuntime, summarizeExecution, } from '../../phantom/index.js';
|
|
11
11
|
import { GuardrailEngine } from '../../engines/guardrails-bridge.js';
|
|
@@ -32,6 +32,7 @@ import { MiddlewarePipeline } from '../../engines/middleware-pipeline.js';
|
|
|
32
32
|
import { applyExecutionPreset, listExecutionPresets, resolveExecutionPreset } from '../../engines/execution-presets.js';
|
|
33
33
|
import { ensureBootstrap } from '../../engines/client-bootstrap.js';
|
|
34
34
|
import { resolveWorkspaceContext, resolveWorkspaceStateRoot } from '../../engines/workspace-resolver.js';
|
|
35
|
+
import { hasValidBootstrapReceipt } from '../../engines/bootstrap/index.js';
|
|
35
36
|
import { synapseToolDefinitions, handleSynapseToolCall } from '../../synapse/index.js';
|
|
36
37
|
import { architectsToolDefinitions, handleArchitectsToolCall } from '../../architects/index.js';
|
|
37
38
|
const tokenEngine = new TokenSupremacyEngine();
|
|
@@ -448,6 +449,46 @@ function buildResultPreview(result) {
|
|
|
448
449
|
textPreview: truncateText(text, 900),
|
|
449
450
|
};
|
|
450
451
|
}
|
|
452
|
+
/**
|
|
453
|
+
* Recursively collect files under `folderAbs`, optionally filtered by extension.
|
|
454
|
+
* Only descends into directories within the same workspace root (caller must pre-validate root).
|
|
455
|
+
* Skips hidden directories and node_modules to stay bounded.
|
|
456
|
+
*/
|
|
457
|
+
function collectFolderFiles(folderAbs, folderGlob) {
|
|
458
|
+
const extFilter = folderGlob ? folderGlob.replace(/^\*/, '') : null; // "*.ts" → ".ts"
|
|
459
|
+
const results = [];
|
|
460
|
+
const walk = (dir, depth) => {
|
|
461
|
+
if (depth > 12)
|
|
462
|
+
return; // hard depth cap
|
|
463
|
+
let entries;
|
|
464
|
+
try {
|
|
465
|
+
entries = readdirSync(dir);
|
|
466
|
+
}
|
|
467
|
+
catch {
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
for (const entry of entries) {
|
|
471
|
+
if (entry.startsWith('.') || entry === 'node_modules' || entry === 'dist')
|
|
472
|
+
continue;
|
|
473
|
+
const full = path.join(dir, entry);
|
|
474
|
+
let st;
|
|
475
|
+
try {
|
|
476
|
+
st = statSync(full);
|
|
477
|
+
}
|
|
478
|
+
catch {
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
if (st.isDirectory()) {
|
|
482
|
+
walk(full, depth + 1);
|
|
483
|
+
}
|
|
484
|
+
else if (!extFilter || full.endsWith(extFilter)) {
|
|
485
|
+
results.push(full);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
walk(folderAbs, 0);
|
|
490
|
+
return results;
|
|
491
|
+
}
|
|
451
492
|
export class MCPAdapter {
|
|
452
493
|
name;
|
|
453
494
|
type = 'mcp';
|
|
@@ -589,7 +630,7 @@ export class MCPAdapter {
|
|
|
589
630
|
constructor() {
|
|
590
631
|
this.name = this.detectCallerName();
|
|
591
632
|
this.server = new Server({ name: 'nexus-prime-mcp', version: '0.4.0' }, { capabilities: { tools: {} } });
|
|
592
|
-
this.sessionDNA = new SessionDNAManager(
|
|
633
|
+
this.sessionDNA = new SessionDNAManager(randomUUID());
|
|
593
634
|
this.middlewarePipeline = new MiddlewarePipeline();
|
|
594
635
|
this.registerBuiltInMiddleware();
|
|
595
636
|
this.setupToolHandlers();
|
|
@@ -2046,7 +2087,22 @@ export class MCPAdapter {
|
|
|
2046
2087
|
this.telemetry.bootstrapped = true;
|
|
2047
2088
|
}
|
|
2048
2089
|
const args = request.params.arguments ?? (request.params.arguments = {});
|
|
2049
|
-
// Gate: block non-bootstrap tools BEFORE executing them to avoid wasted work and side effects
|
|
2090
|
+
// Gate: block non-bootstrap tools BEFORE executing them to avoid wasted work and side effects.
|
|
2091
|
+
// Check both the in-memory flag AND the durable bootstrap receipt (survives restarts).
|
|
2092
|
+
const hasDurableReceipt = (() => {
|
|
2093
|
+
try {
|
|
2094
|
+
const ws = resolveWorkspaceContext();
|
|
2095
|
+
const stateRoot = resolveWorkspaceStateRoot(ws.workspaceRoot);
|
|
2096
|
+
return hasValidBootstrapReceipt(stateRoot);
|
|
2097
|
+
}
|
|
2098
|
+
catch {
|
|
2099
|
+
return false;
|
|
2100
|
+
}
|
|
2101
|
+
})();
|
|
2102
|
+
if (hasDurableReceipt && !this.telemetry.bootstrapped) {
|
|
2103
|
+
// Restore in-memory flag from durable receipt
|
|
2104
|
+
this.telemetry.bootstrapped = true;
|
|
2105
|
+
}
|
|
2050
2106
|
if (!this.telemetry.bootstrapped &&
|
|
2051
2107
|
!PRE_BOOTSTRAP_ALLOWED_TOOLS.has(toolName) &&
|
|
2052
2108
|
!toolName.startsWith('nexus_list_')) {
|
|
@@ -2283,7 +2339,7 @@ export class MCPAdapter {
|
|
|
2283
2339
|
summary: {
|
|
2284
2340
|
clientBootstrapClients: bootstrap.clientBootstrapStatus?.clients?.length ?? 0,
|
|
2285
2341
|
taskGraphPhases: bootstrap.taskGraphPreview?.phases?.length ?? 0,
|
|
2286
|
-
|
|
2342
|
+
totalWorkers: bootstrap.workerPlanPreview?.totalWorkers ?? 0,
|
|
2287
2343
|
selectedArtifacts: bootstrap.artifactSelectionAudit?.selected?.length ?? 0,
|
|
2288
2344
|
},
|
|
2289
2345
|
};
|
|
@@ -2305,7 +2361,7 @@ export class MCPAdapter {
|
|
|
2305
2361
|
`Knowledge fabric: ${bootstrap.sourceMixRecommendation?.dominantSource || bootstrap.knowledgeFabric?.dominantSource || 'awaiting source mix'}`,
|
|
2306
2362
|
`RAG: ${bootstrap.ragCandidateStatus?.attachedCollections || 0} attached · ${bootstrap.ragCandidateStatus?.retrievedChunks || 0} retrieved`,
|
|
2307
2363
|
`Task graph: ${bootstrap.taskGraphPreview?.phases?.length || 0} phases · ${bootstrap.taskGraphPreview?.independentBranches || 0} branches`,
|
|
2308
|
-
`Worker plan: ${bootstrap.workerPlanPreview?.totalWorkers || 0}
|
|
2364
|
+
`Worker plan: ${bootstrap.workerPlanPreview?.totalWorkers || 0} workers planned`,
|
|
2309
2365
|
`Payload ref: ${workspace.stateKey} · ${detailLevel}`,
|
|
2310
2366
|
`Session summary: ${bootstrap.sessionSummaryBootstrap?.savedTokens ? `reused ${Number(bootstrap.sessionSummaryBootstrap.savedTokens || 0).toLocaleString()} tokens from the previous visit` : 'none available yet'}`,
|
|
2311
2367
|
bootstrap.projectMemoryBootstrap?.count
|
|
@@ -2491,7 +2547,7 @@ export class MCPAdapter {
|
|
|
2491
2547
|
`Crew: ${execution.plannerState?.selectedCrew?.name || 'baseline path'}`,
|
|
2492
2548
|
`Specialists: ${execution.plannerState?.selectedSpecialists.map((specialist) => specialist.name).slice(0, 4).join(', ') || 'none selected'}`,
|
|
2493
2549
|
`Assets: ${(execution.activeSkills || []).length} skills · ${(execution.activeWorkflows || []).length} workflows · ${(runtimeUsage.artifactSelectionAudit?.selected?.length || 0)} audited selections`,
|
|
2494
|
-
`Task graph: ${runtimeUsage.taskGraph?.phases?.length || execution.taskGraph?.phases?.length || 0} phases · ${runtimeUsage.workerPlan?.totalWorkers || execution.workerPlan?.totalWorkers || 0}
|
|
2550
|
+
`Task graph: ${runtimeUsage.taskGraph?.phases?.length || execution.taskGraph?.phases?.length || 0} phases · ${runtimeUsage.workerPlan?.totalWorkers || execution.workerPlan?.totalWorkers || 0} workers`,
|
|
2495
2551
|
`Catalog health: ${runtimeUsage.catalogHealth?.overall || 'unknown'}`,
|
|
2496
2552
|
preset ? `Preset: ${preset.name} (${preset.id})` : null,
|
|
2497
2553
|
`Verification: ${verifiedWorkers}/${execution.workerResults.length} worker(s) verified`,
|
|
@@ -3986,15 +4042,42 @@ export class MCPAdapter {
|
|
|
3986
4042
|
}
|
|
3987
4043
|
case 'nexus_rag_ingest_collection': {
|
|
3988
4044
|
const collectionId = String(request.params.arguments?.collectionId ?? '');
|
|
3989
|
-
const
|
|
3990
|
-
? request.params.arguments.inputs
|
|
3991
|
-
filePath: entry?.filePath ? String(entry.filePath) : undefined,
|
|
3992
|
-
url: entry?.url ? String(entry.url) : undefined,
|
|
3993
|
-
text: entry?.text ? String(entry.text) : undefined,
|
|
3994
|
-
label: entry?.label ? String(entry.label) : undefined,
|
|
3995
|
-
tags: Array.isArray(entry?.tags) ? entry.tags.map(String) : [],
|
|
3996
|
-
}))
|
|
4045
|
+
const rawInputs = Array.isArray(request.params.arguments?.inputs)
|
|
4046
|
+
? request.params.arguments.inputs
|
|
3997
4047
|
: [];
|
|
4048
|
+
const inputs = [];
|
|
4049
|
+
for (const entry of rawInputs) {
|
|
4050
|
+
if (entry?.folderPath) {
|
|
4051
|
+
// Expand folder into individual file entries (bounded to workspace root)
|
|
4052
|
+
const folderAbs = path.resolve(String(entry.folderPath));
|
|
4053
|
+
if (!this.isPackageLikeWorkspace(folderAbs)) {
|
|
4054
|
+
inputs.push({
|
|
4055
|
+
text: `[skipped] folder path outside workspace root: ${folderAbs}`,
|
|
4056
|
+
label: 'security-skip',
|
|
4057
|
+
tags: ['skipped'],
|
|
4058
|
+
});
|
|
4059
|
+
continue;
|
|
4060
|
+
}
|
|
4061
|
+
const folderGlob = entry?.folderGlob ? String(entry.folderGlob) : undefined;
|
|
4062
|
+
const files = collectFolderFiles(folderAbs, folderGlob);
|
|
4063
|
+
for (const f of files) {
|
|
4064
|
+
inputs.push({
|
|
4065
|
+
filePath: f,
|
|
4066
|
+
label: entry?.label ? String(entry.label) : undefined,
|
|
4067
|
+
tags: Array.isArray(entry?.tags) ? entry.tags.map(String) : [],
|
|
4068
|
+
});
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
else {
|
|
4072
|
+
inputs.push({
|
|
4073
|
+
filePath: entry?.filePath ? String(entry.filePath) : undefined,
|
|
4074
|
+
url: entry?.url ? String(entry.url) : undefined,
|
|
4075
|
+
text: entry?.text ? String(entry.text) : undefined,
|
|
4076
|
+
label: entry?.label ? String(entry.label) : undefined,
|
|
4077
|
+
tags: Array.isArray(entry?.tags) ? entry.tags.map(String) : [],
|
|
4078
|
+
});
|
|
4079
|
+
}
|
|
4080
|
+
}
|
|
3998
4081
|
const result = await this.getOrchestrator().ingestRagCollection(collectionId, inputs);
|
|
3999
4082
|
return {
|
|
4000
4083
|
content: [{
|