0xray 3.5.4 → 4.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/.mcp.json +51 -7
- package/.opencode/skills/api-design/SKILL.md +1 -1
- package/.opencode/skills/architect-tools/SKILL.md +1 -1
- package/.opencode/skills/architecture-patterns/SKILL.md +1 -1
- package/.opencode/skills/auto-format/SKILL.md +1 -1
- package/.opencode/skills/boot-orchestrator/SKILL.md +2 -6
- package/.opencode/skills/bug-triage/SKILL.md +1 -1
- package/.opencode/skills/code-analyzer/SKILL.md +1 -1
- package/.opencode/skills/code-review/SKILL.md +1 -1
- package/.opencode/skills/enforcer/SKILL.md +1 -1
- package/.opencode/skills/framework-compliance-audit/SKILL.md +1 -1
- package/.opencode/skills/git-workflow/SKILL.md +1 -1
- package/.opencode/skills/hermes-agent/SKILL.md +36 -36
- package/.opencode/skills/inference-improve/SKILL.md +1 -1
- package/.opencode/skills/lint/SKILL.md +1 -1
- package/.opencode/skills/log-monitor/SKILL.md +1 -1
- package/.opencode/skills/model-health-check/SKILL.md +1 -1
- package/.opencode/skills/multimodal-looker/SKILL.md +1 -1
- package/.opencode/skills/orchestrator/SKILL.md +38 -14
- package/.opencode/skills/performance-analysis/SKILL.md +1 -1
- package/.opencode/skills/performance-optimization/SKILL.md +1 -1
- package/.opencode/skills/processor-pipeline/SKILL.md +1 -1
- package/.opencode/skills/project-analysis/SKILL.md +1 -1
- package/.opencode/skills/refactoring-strategies/SKILL.md +1 -1
- package/.opencode/skills/registry.json +65 -0
- package/.opencode/skills/researcher/SKILL.md +18 -5
- package/.opencode/skills/security-audit/SKILL.md +1 -1
- package/.opencode/skills/security-scan/SKILL.md +1 -1
- package/.opencode/skills/session-management/SKILL.md +1 -1
- package/.opencode/skills/state-manager/SKILL.md +1 -1
- package/.opencode/skills/storyteller/SKILL.md +1 -1
- package/.opencode/skills/strategist/SKILL.md +12 -0
- package/.opencode/skills/testing-best-practices/SKILL.md +37 -0
- package/.opencode/skills/testing-strategy/SKILL.md +14 -3
- package/.opencode/skills/ui-ux-design/SKILL.md +1 -1
- package/.opencode/skills/xray-orchestrator/index.ts +267 -0
- package/.xray/codex.json +12 -3
- package/.xray/features.json +32 -6
- package/.xray/features.schema.json +87 -0
- package/AGENTS-consumer.md +16 -6
- package/AGENTS.md +21 -3
- package/README.md +13 -10
- package/SKILLS.md +1 -1
- package/dist/AGENTS.md +21 -3
- package/dist/CHANGELOG.md +98 -0
- package/dist/README.md +13 -10
- package/dist/SKILLS.md +1 -1
- package/dist/cli/commands/hermes-install.js +6 -1
- package/dist/cli/commands/openclaw-install.js +14 -0
- package/dist/cli/index.js +0 -0
- package/dist/core/features-config.d.ts +30 -2
- package/dist/governance/governance-service.d.ts +1 -0
- package/dist/governance/governance-service.js +81 -6
- package/dist/infrastructure/schemas/cloud-schemas.d.ts +1 -1
- package/dist/integrations/enforcement-gate.js +15 -5
- package/dist/integrations/grok/grok-cli.d.ts +3 -0
- package/dist/integrations/grok/grok-cli.js +92 -13
- package/dist/integrations/grok/hooks/grok-hook-utils.js +99 -9
- package/dist/integrations/grok/hooks/post-tool-use.js +68 -25
- package/dist/integrations/grok/hooks/pre-tool-use.js +17 -14
- package/dist/integrations/grok/hooks/session-start.js +114 -4
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +31 -24
- package/dist/integrations/hermes-agent/__init__.py +11 -1
- package/dist/integrations/hermes-agent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/schemas.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/__pycache__/tools.cpython-313.pyc +0 -0
- package/dist/integrations/hermes-agent/bridge.mjs +92 -11
- package/dist/integrations/hooks/confer-hook-runtime.mjs +49 -0
- package/dist/integrations/hooks/delegation-gate-runtime.mjs +32 -3
- package/dist/integrations/hooks/pipeline-hook-runtime.mjs +211 -0
- package/dist/integrations/hooks/plan-hook-runtime.mjs +68 -0
- package/dist/integrations/hooks/station-hook-runtime.cjs +421 -0
- package/dist/integrations/hooks/station-hook-runtime.mjs +24 -0
- package/dist/integrations/hooks/station-memory-ingest.mjs +45 -0
- package/dist/integrations/hooks/station-memory-match.mjs +47 -0
- package/dist/integrations/hooks/user-aside-hook-runtime.mjs +49 -0
- package/dist/integrations/openclaw/client.d.ts +5 -1
- package/dist/integrations/openclaw/client.js +17 -9
- package/dist/integrations/openclaw/config.js +0 -1
- package/dist/integrations/openclaw/hooks/pre-tool-gate-runtime.mjs +102 -0
- package/dist/integrations/openclaw/index.js +17 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/index.js +75 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/openclaw.plugin.json +10 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +10 -0
- package/dist/integrations/openclaw/pre-tool-gate.d.ts +19 -0
- package/dist/integrations/openclaw/pre-tool-gate.js +39 -0
- package/dist/mcps/architect-tools.server.js +6 -1
- package/dist/mcps/orchestrator/handlers/complexity-handler.d.ts +7 -0
- package/dist/mcps/orchestrator/handlers/complexity-handler.js +107 -8
- package/dist/mcps/orchestrator/handlers/task-handler.d.ts +6 -0
- package/dist/mcps/orchestrator/handlers/task-handler.js +75 -0
- package/dist/mcps/orchestrator/server.js +54 -5
- package/dist/memory-routing/index.d.ts +1 -1
- package/dist/memory-routing/index.js +1 -1
- package/dist/memory-routing/provider-loader.d.ts +4 -0
- package/dist/memory-routing/provider-loader.js +74 -4
- package/dist/memory-routing/provider-registry.js +3 -2
- package/dist/nucleus/aside-worktree.d.ts +41 -0
- package/dist/nucleus/aside-worktree.js +164 -0
- package/dist/nucleus/autonomy-kernel.d.ts +2 -2
- package/dist/nucleus/autonomy-kernel.js +17 -6
- package/dist/nucleus/confer.d.ts +57 -0
- package/dist/nucleus/confer.js +322 -0
- package/dist/nucleus/delegation-gate.d.ts +18 -8
- package/dist/nucleus/delegation-gate.js +234 -20
- package/dist/nucleus/lead-dev-plan-persistence.d.ts +27 -3
- package/dist/nucleus/lead-dev-plan-persistence.js +201 -19
- package/dist/nucleus/spawn-plan-resolution.d.ts +20 -0
- package/dist/nucleus/spawn-plan-resolution.js +42 -0
- package/dist/nucleus/suit-temperament.d.ts +40 -0
- package/dist/nucleus/suit-temperament.js +157 -0
- package/dist/nucleus/synthesis-consult-receipt.js +18 -2
- package/dist/nucleus/synthesis-context.js +1 -1
- package/dist/nucleus/user-aside.d.ts +70 -0
- package/dist/nucleus/user-aside.js +393 -0
- package/dist/plugin/xray-codex-injection.js +14 -3
- package/dist/postprocessor/PostProcessor.d.ts +1 -0
- package/dist/postprocessor/PostProcessor.js +11 -0
- package/dist/postprocessor/triggers/GitHookTrigger.js +11 -5
- package/dist/processors/implementations/session-summary-processor.d.ts +1 -1
- package/dist/processors/implementations/session-summary-processor.js +9 -6
- package/opencode.json +88 -0
- package/package.json +25 -6
- package/scripts/hooks/install-hooks.cjs +21 -6
- package/scripts/hooks/run-hook.js +237 -88
- package/scripts/mjs/run-repertoire-mcp.mjs +39 -0
- package/scripts/mjs/verify-confer-core.mjs +103 -0
- package/scripts/mjs/verify-delegation-gate-core.mjs +76 -3
- package/scripts/mjs/verify-four-floor-compact.mjs +524 -0
- package/scripts/mjs/verify-hermes-session-start.mjs +137 -0
- package/scripts/mjs/verify-pipeline-facets.mjs +215 -0
- package/scripts/mjs/verify-pre-push-diff-core.mjs +87 -0
- package/scripts/mjs/verify-temperament-live.mjs +261 -0
- package/scripts/mjs/verify-user-aside-core.mjs +137 -0
- package/scripts/node/bridge-mcp-wiring.cjs +287 -29
- package/scripts/node/install-bridges.cjs +198 -44
- package/scripts/node/load-reflection-config.mjs +2 -2
- package/scripts/node/postinstall.cjs +50 -27
- package/scripts/node/release-gate.mjs +8 -4
- package/scripts/node/release.mjs +2 -2
- package/scripts/node/validate-release-docs.mjs +20 -33
- package/scripts/node/version-manager.mjs +25 -10
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +31 -24
- package/src/integrations/openclaw/README.md +134 -0
- package/src/integrations/openclaw/plugin/xray-pre-tool/index.js +75 -0
- package/src/integrations/openclaw/plugin/xray-pre-tool/openclaw.plugin.json +10 -0
- package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +10 -0
- package/src/mcps/architect-tools.server.ts +6 -1
- package/src/mcps/orchestrator/handlers/complexity-handler.ts +180 -21
- package/src/mcps/orchestrator/handlers/task-handler.ts +99 -0
- package/src/mcps/orchestrator/server.ts +56 -5
- package/vendor/@0xray/repertoire/AGENTS.md +163 -0
- package/vendor/@0xray/repertoire/LICENSE +21 -0
- package/vendor/@0xray/repertoire/README.md +120 -0
- package/vendor/@0xray/repertoire/data/curated_signals.json +208 -0
- package/vendor/@0xray/repertoire/dist/RepertoireService.d.ts +78 -0
- package/vendor/@0xray/repertoire/dist/RepertoireService.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/RepertoireService.js +153 -0
- package/vendor/@0xray/repertoire/dist/RepertoireService.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/governance/ontological-trap-enforcer.d.ts +39 -0
- package/vendor/@0xray/repertoire/dist/governance/ontological-trap-enforcer.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/governance/ontological-trap-enforcer.js +60 -0
- package/vendor/@0xray/repertoire/dist/governance/ontological-trap-enforcer.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/index.d.ts +14 -0
- package/vendor/@0xray/repertoire/dist/index.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/index.js +14 -0
- package/vendor/@0xray/repertoire/dist/index.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-ingester.d.ts +26 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-ingester.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-ingester.js +109 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-ingester.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-parser.d.ts +18 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-parser.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-parser.js +94 -0
- package/vendor/@0xray/repertoire/dist/ingestion/groover-log-parser.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/orchestrator-feedback-ingester.d.ts +7 -0
- package/vendor/@0xray/repertoire/dist/ingestion/orchestrator-feedback-ingester.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/orchestrator-feedback-ingester.js +18 -0
- package/vendor/@0xray/repertoire/dist/ingestion/orchestrator-feedback-ingester.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/xray-session-ingester.d.ts +31 -0
- package/vendor/@0xray/repertoire/dist/ingestion/xray-session-ingester.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/ingestion/xray-session-ingester.js +83 -0
- package/vendor/@0xray/repertoire/dist/ingestion/xray-session-ingester.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/mcp/server.d.ts +6 -0
- package/vendor/@0xray/repertoire/dist/mcp/server.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/mcp/server.js +173 -0
- package/vendor/@0xray/repertoire/dist/mcp/server.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/RepertoireOrchestratorBridge.d.ts +27 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/RepertoireOrchestratorBridge.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/RepertoireOrchestratorBridge.js +107 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/RepertoireOrchestratorBridge.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/capability-enhancer.d.ts +11 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/capability-enhancer.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/capability-enhancer.js +32 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/capability-enhancer.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/confidence-gate.d.ts +9 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/confidence-gate.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/confidence-gate.js +72 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/confidence-gate.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-agent-affinity.d.ts +5 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-agent-affinity.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-agent-affinity.js +18 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-agent-affinity.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-injector.d.ts +31 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-injector.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-injector.js +218 -0
- package/vendor/@0xray/repertoire/dist/orchestrator-bridge/signal-injector.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/paths.d.ts +24 -0
- package/vendor/@0xray/repertoire/dist/paths.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/paths.js +74 -0
- package/vendor/@0xray/repertoire/dist/paths.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/provider/memory-routing-provider.d.ts +141 -0
- package/vendor/@0xray/repertoire/dist/provider/memory-routing-provider.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/provider/memory-routing-provider.js +210 -0
- package/vendor/@0xray/repertoire/dist/provider/memory-routing-provider.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/CuratedSignalsManager.d.ts +48 -0
- package/vendor/@0xray/repertoire/dist/registry/CuratedSignalsManager.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/CuratedSignalsManager.js +221 -0
- package/vendor/@0xray/repertoire/dist/registry/CuratedSignalsManager.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/InferenceStateManager.d.ts +11 -0
- package/vendor/@0xray/repertoire/dist/registry/InferenceStateManager.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/InferenceStateManager.js +43 -0
- package/vendor/@0xray/repertoire/dist/registry/InferenceStateManager.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/signal-prune.d.ts +15 -0
- package/vendor/@0xray/repertoire/dist/registry/signal-prune.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/registry/signal-prune.js +35 -0
- package/vendor/@0xray/repertoire/dist/registry/signal-prune.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/concrete-sections.d.ts +3 -0
- package/vendor/@0xray/repertoire/dist/synthesis/concrete-sections.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/concrete-sections.js +24 -0
- package/vendor/@0xray/repertoire/dist/synthesis/concrete-sections.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/meta-inference-engine.d.ts +24 -0
- package/vendor/@0xray/repertoire/dist/synthesis/meta-inference-engine.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/meta-inference-engine.js +148 -0
- package/vendor/@0xray/repertoire/dist/synthesis/meta-inference-engine.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/primitive-confidence-aggregator.d.ts +4 -0
- package/vendor/@0xray/repertoire/dist/synthesis/primitive-confidence-aggregator.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/primitive-confidence-aggregator.js +44 -0
- package/vendor/@0xray/repertoire/dist/synthesis/primitive-confidence-aggregator.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/synthesis-prompt-builder.d.ts +22 -0
- package/vendor/@0xray/repertoire/dist/synthesis/synthesis-prompt-builder.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/synthesis/synthesis-prompt-builder.js +66 -0
- package/vendor/@0xray/repertoire/dist/synthesis/synthesis-prompt-builder.js.map +1 -0
- package/vendor/@0xray/repertoire/dist/types.d.ts +210 -0
- package/vendor/@0xray/repertoire/dist/types.d.ts.map +1 -0
- package/vendor/@0xray/repertoire/dist/types.js +2 -0
- package/vendor/@0xray/repertoire/dist/types.js.map +1 -0
- package/vendor/@0xray/repertoire/docs/MEMORY-ROUTING-PROVIDER.md +54 -0
- package/vendor/@0xray/repertoire/hermes-mcp.example.json +20 -0
- package/vendor/@0xray/repertoire/mcp-config.example.json +11 -0
- package/vendor/@0xray/repertoire/package.json +124 -0
- package/vendor/@0xray/repertoire/schemas/curated-signal.schema.json +68 -0
- package/vendor/@0xray/repertoire/schemas/inference-log.schema.json +82 -0
- package/vendor/@0xray/repertoire/scripts/confirm-suit-all.mjs +253 -0
- package/vendor/@0xray/repertoire/scripts/confirm-suit-harness.mjs +220 -0
- package/vendor/@0xray/repertoire/scripts/run-live-synthesis-checkpoint.mjs +215 -0
- package/vendor/@0xray/repertoire/scripts/suit-bridge-shared.mjs +139 -0
- package/vendor/@0xray/repertoire/scripts/verify-grok-suit.mjs +304 -0
- package/vendor/@0xray/repertoire/scripts/verify-hermes-suit.mjs +163 -0
- package/vendor/@0xray/repertoire/scripts/verify-openclaw-suit.mjs +125 -0
- package/vendor/@0xray/repertoire/scripts/verify-opencode-suit.mjs +127 -0
- package/vendor/@0xray/repertoire/scripts/verify-synthesis-dogfood.mjs +207 -0
- package/vendor/@0xray/repertoire/skills/repertoire-trap-handling/SKILL.md +206 -0
- package/xray/codex.json +12 -3
- package/xray/features.json +32 -6
- package/xray/features.schema.json +87 -0
|
@@ -166,7 +166,8 @@ export function getFrameworkCounts(baseDir = rootDir) {
|
|
|
166
166
|
const counts = {
|
|
167
167
|
agents: 0,
|
|
168
168
|
mcps: 0,
|
|
169
|
-
skills: 0
|
|
169
|
+
skills: 0,
|
|
170
|
+
codexTerms: 68,
|
|
170
171
|
};
|
|
171
172
|
|
|
172
173
|
// Count agents (.yml files in src/opencode/agents/ — source of truth)
|
|
@@ -183,7 +184,8 @@ export function getFrameworkCounts(baseDir = rootDir) {
|
|
|
183
184
|
try {
|
|
184
185
|
const mcpJson = JSON.parse(fs.readFileSync(mcpJsonPath, 'utf-8'));
|
|
185
186
|
const servers = mcpJson.mcpServers || mcpJson.servers || {};
|
|
186
|
-
|
|
187
|
+
const xrayServers = Object.keys(servers).filter((name) => name.startsWith('xray-'));
|
|
188
|
+
counts.mcps = xrayServers.length || 7;
|
|
187
189
|
} catch {
|
|
188
190
|
counts.mcps = 7;
|
|
189
191
|
}
|
|
@@ -199,6 +201,17 @@ export function getFrameworkCounts(baseDir = rootDir) {
|
|
|
199
201
|
.filter(f => fs.existsSync(path.join(skillsDir, f, 'SKILL.md')))
|
|
200
202
|
.length;
|
|
201
203
|
}
|
|
204
|
+
|
|
205
|
+
const codexPath = path.join(baseDir, 'xray/codex.json');
|
|
206
|
+
if (fs.existsSync(codexPath)) {
|
|
207
|
+
try {
|
|
208
|
+
const codex = JSON.parse(fs.readFileSync(codexPath, 'utf-8'));
|
|
209
|
+
const terms = codex.terms && typeof codex.terms === 'object' ? Object.keys(codex.terms) : [];
|
|
210
|
+
if (terms.length > 0) counts.codexTerms = terms.length;
|
|
211
|
+
} catch {
|
|
212
|
+
/* keep default */
|
|
213
|
+
}
|
|
214
|
+
}
|
|
202
215
|
|
|
203
216
|
return counts;
|
|
204
217
|
}
|
|
@@ -271,10 +284,11 @@ function updateReadme(counts, newVersion) {
|
|
|
271
284
|
|
|
272
285
|
let readme = fs.readFileSync(readmePath, 'utf-8');
|
|
273
286
|
|
|
274
|
-
//
|
|
287
|
+
// Kernel header (4.0): exo, not catalog counts
|
|
288
|
+
const kernel = buildDocsHeader(counts, newVersion);
|
|
275
289
|
readme = readme.replace(
|
|
276
|
-
/^\*\*v[\d.]+\*\* —
|
|
277
|
-
|
|
290
|
+
/^\*\*v[\d.]+\*\* — (?:\d+ agents · \d+ skills · \d+ MCP servers? · \d+ codex terms(?: · [\d,]+ tests)?|a suit that survives the context window.*)$/m,
|
|
291
|
+
kernel,
|
|
278
292
|
);
|
|
279
293
|
|
|
280
294
|
// Update version badge: []
|
|
@@ -313,13 +327,14 @@ export const DOCS_SITE_HEADER_FILES = [
|
|
|
313
327
|
'docs-site/docs/full-reference.md',
|
|
314
328
|
];
|
|
315
329
|
|
|
316
|
-
export function buildDocsHeader(
|
|
317
|
-
return `**v${newVersion}** —
|
|
330
|
+
export function buildDocsHeader(_counts, newVersion) {
|
|
331
|
+
return `**v${newVersion}** — a suit that survives the context window`;
|
|
318
332
|
}
|
|
319
333
|
|
|
320
334
|
function syncDocsSiteHeaders(counts, newVersion) {
|
|
321
335
|
const header = buildDocsHeader(counts, newVersion);
|
|
322
|
-
const headerRe =
|
|
336
|
+
const headerRe =
|
|
337
|
+
/^\*{0,2}v?[\d.]*\*{0,2}\s*—?\s*(?:\d+ agents · \d+ skills · \d+ MCP servers? · \d+ codex terms(?: · [\d,]+ tests)?|a suit that survives the context window.*|exo, not toolset.*|wear the exo.*)/im;
|
|
323
338
|
for (const rel of DOCS_SITE_HEADER_FILES) {
|
|
324
339
|
const filePath = path.join(rootDir, rel);
|
|
325
340
|
if (!fs.existsSync(filePath)) continue;
|
|
@@ -346,8 +361,8 @@ function updateConsumerAgentsHeader(newVersion, counts) {
|
|
|
346
361
|
if (!fs.existsSync(consumerPath)) return;
|
|
347
362
|
let content = fs.readFileSync(consumerPath, 'utf-8');
|
|
348
363
|
content = content.replace(
|
|
349
|
-
/^\*\*v[\d.]+\*\* —
|
|
350
|
-
|
|
364
|
+
/^\*\*v[\d.]+\*\* — .+$/m,
|
|
365
|
+
buildDocsHeader(counts, newVersion),
|
|
351
366
|
);
|
|
352
367
|
fs.writeFileSync(consumerPath, content);
|
|
353
368
|
console.log(`✅ Updated AGENTS-consumer.md version header`);
|
|
@@ -2,15 +2,11 @@
|
|
|
2
2
|
"hooks": {
|
|
3
3
|
"PreToolUse": [
|
|
4
4
|
{
|
|
5
|
-
"matcher": ".*",
|
|
6
5
|
"hooks": [
|
|
7
6
|
{
|
|
8
7
|
"type": "command",
|
|
9
|
-
"command": "node",
|
|
10
|
-
"
|
|
11
|
-
"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/pre-tool-use.js"
|
|
12
|
-
],
|
|
13
|
-
"timeout": 30000
|
|
8
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/pre-tool-use.js\"",
|
|
9
|
+
"timeout": 30
|
|
14
10
|
}
|
|
15
11
|
]
|
|
16
12
|
}
|
|
@@ -20,11 +16,8 @@
|
|
|
20
16
|
"hooks": [
|
|
21
17
|
{
|
|
22
18
|
"type": "command",
|
|
23
|
-
"command": "node",
|
|
24
|
-
"
|
|
25
|
-
"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js"
|
|
26
|
-
],
|
|
27
|
-
"timeout": 15000
|
|
19
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js\"",
|
|
20
|
+
"timeout": 30
|
|
28
21
|
}
|
|
29
22
|
]
|
|
30
23
|
}
|
|
@@ -34,30 +27,44 @@
|
|
|
34
27
|
"hooks": [
|
|
35
28
|
{
|
|
36
29
|
"type": "command",
|
|
37
|
-
"command": "node",
|
|
38
|
-
"
|
|
39
|
-
"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js",
|
|
40
|
-
"--hook-event=user_prompt_submit"
|
|
41
|
-
],
|
|
42
|
-
"timeout": 15000
|
|
30
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js\" --hook-event=user_prompt_submit",
|
|
31
|
+
"timeout": 30
|
|
43
32
|
}
|
|
44
33
|
]
|
|
45
34
|
}
|
|
46
35
|
],
|
|
47
36
|
"PostToolUse": [
|
|
48
37
|
{
|
|
49
|
-
"matcher": ".*",
|
|
50
38
|
"hooks": [
|
|
51
39
|
{
|
|
52
40
|
"type": "command",
|
|
53
|
-
"command": "node",
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
41
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/post-tool-use.js\"",
|
|
42
|
+
"timeout": 30
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"PreCompact": [
|
|
48
|
+
{
|
|
49
|
+
"hooks": [
|
|
50
|
+
{
|
|
51
|
+
"type": "command",
|
|
52
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js\" --hook-event=pre_compact",
|
|
53
|
+
"timeout": 30
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"PostCompact": [
|
|
59
|
+
{
|
|
60
|
+
"hooks": [
|
|
61
|
+
{
|
|
62
|
+
"type": "command",
|
|
63
|
+
"command": "XRAY_AI_PATH=\"${XRAY_AI_PATH:-node_modules/0xray}\" node \"${XRAY_AI_PATH:-node_modules/0xray}/dist/integrations/grok/hooks/session-start.js\" --hook-event=post_compact",
|
|
64
|
+
"timeout": 30
|
|
58
65
|
}
|
|
59
66
|
]
|
|
60
67
|
}
|
|
61
68
|
]
|
|
62
69
|
}
|
|
63
|
-
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# OpenClaw Integration
|
|
2
|
+
|
|
3
|
+
0xray integration for OpenClaw - a self-hosted AI gateway that connects messaging platforms to AI coding agents.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This integration allows 0xray to:
|
|
8
|
+
- Connect to OpenClaw Gateway via WebSocket
|
|
9
|
+
- Expose 0xray capabilities through OpenClaw skills
|
|
10
|
+
- Send tool execution events to OpenClaw for real-time tracking
|
|
11
|
+
- Receive commands from OpenClaw channels (WhatsApp, Telegram, Discord, etc.)
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
17
|
+
│ User │────▶│ OpenClaw │────▶│ 0xray │
|
|
18
|
+
│ (WhatsApp, │ │ Gateway │ │ Skills │
|
|
19
|
+
│ Discord, │ │ │ │ │
|
|
20
|
+
│ Telegram) │◀────│ │◀────│ │
|
|
21
|
+
└──────────────┘ └──────────────┘ └──────────────┘
|
|
22
|
+
│
|
|
23
|
+
▼
|
|
24
|
+
┌──────────────┐
|
|
25
|
+
│ WebSocket │
|
|
26
|
+
│ Client │
|
|
27
|
+
└──────────────┘
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
### 1. Install Dependencies
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install ws
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. Configure OpenClaw
|
|
39
|
+
|
|
40
|
+
Create `.xray/config/openclaw.json`:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"gatewayUrl": "ws://127.0.0.1:18789",
|
|
45
|
+
"authToken": "your-auth-token",
|
|
46
|
+
"deviceId": "your-device-id",
|
|
47
|
+
"apiServer": {
|
|
48
|
+
"enabled": true,
|
|
49
|
+
"port": 18431,
|
|
50
|
+
"host": "127.0.0.1",
|
|
51
|
+
"apiKey": "your-api-key"
|
|
52
|
+
},
|
|
53
|
+
"hooks": {
|
|
54
|
+
"enabled": true
|
|
55
|
+
},
|
|
56
|
+
"enabled": true
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 3. Install OpenClaw Skills
|
|
61
|
+
|
|
62
|
+
Copy skills to your OpenClaw skills directory:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cp -r skills/* ~/.openclaw/skills/
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
### Initialize Integration
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { initializeOpenClawIntegration } from './src/integrations/openclaw/index.js';
|
|
74
|
+
|
|
75
|
+
const integration = await initializeOpenClawIntegration();
|
|
76
|
+
|
|
77
|
+
// Or with custom agent invoker
|
|
78
|
+
const integration = await initializeOpenClawIntegration('/path/to/config.json', myAgentInvoker);
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Using OpenClaw Commands
|
|
82
|
+
|
|
83
|
+
After installation, use these commands in any OpenClaw channel:
|
|
84
|
+
|
|
85
|
+
- `/xray` - Show status
|
|
86
|
+
- `/xray-analyze <file>` - Analyze code
|
|
87
|
+
- `/xray-code <file>` - Code review
|
|
88
|
+
- `/xray-file <file>` - Read file
|
|
89
|
+
- `/xray-exec <command>` - Execute command
|
|
90
|
+
|
|
91
|
+
## Configuration
|
|
92
|
+
|
|
93
|
+
| Option | Type | Default | Description |
|
|
94
|
+
|--------|------|---------|-------------|
|
|
95
|
+
| `gatewayUrl` | string | `ws://127.0.0.1:18789` | OpenClaw WebSocket URL |
|
|
96
|
+
| `authToken` | string | - | Authentication token |
|
|
97
|
+
| `deviceId` | string | - | Device ID for pairing |
|
|
98
|
+
| `apiServer.enabled` | boolean | `true` | Enable HTTP API server |
|
|
99
|
+
| `apiServer.port` | number | `18431` | API server port |
|
|
100
|
+
| `apiServer.host` | string | `127.0.0.1` | API server host |
|
|
101
|
+
| `apiServer.apiKey` | string | - | API key for auth |
|
|
102
|
+
| `hooks.enabled` | boolean | `true` | Enable tool hooks |
|
|
103
|
+
| `autoReconnect` | boolean | `true` | Auto reconnect |
|
|
104
|
+
| `enabled` | boolean | `true` | Enable integration |
|
|
105
|
+
|
|
106
|
+
## API Server
|
|
107
|
+
|
|
108
|
+
The integration exposes a local HTTP API on port 18431:
|
|
109
|
+
|
|
110
|
+
- `GET /health` - Health check
|
|
111
|
+
- `POST /api/agent/invoke` - Invoke agent
|
|
112
|
+
- `GET /api/agent/status` - Agent status
|
|
113
|
+
|
|
114
|
+
## Skills
|
|
115
|
+
|
|
116
|
+
### 0xray-orchestrator
|
|
117
|
+
|
|
118
|
+
Main skill providing 0xray commands:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
/xray - Show status
|
|
122
|
+
/xray-analyze <file> - Analyze code
|
|
123
|
+
/xray-code <file> - Code review
|
|
124
|
+
/xray-file <file> - Read file
|
|
125
|
+
/xray-exec <command> - Execute command
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
See `docs/research/openclaw/` for detailed documentation.
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import { definePluginEntry } from 'openclaw/plugin-sdk/plugin-entry';
|
|
7
|
+
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const pluginDir = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
function hasGate(root) {
|
|
12
|
+
return Boolean(root) && existsSync(join(root, 'dist/nucleus/delegation-gate.js'));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function resolveXrayRoot() {
|
|
16
|
+
if (hasGate(process.env.XRAY_AI_PATH || '')) {
|
|
17
|
+
return process.env.XRAY_AI_PATH;
|
|
18
|
+
}
|
|
19
|
+
const marker = join(homedir(), '.openclaw', 'xray-consumer-root.txt');
|
|
20
|
+
const marked = existsSync(marker) ? readFileSync(marker, 'utf8').trim() : '';
|
|
21
|
+
const candidates = [
|
|
22
|
+
marked,
|
|
23
|
+
marked ? join(marked, 'node_modules', '0xray') : '',
|
|
24
|
+
marked ? join(marked, '..', 'xray') : '',
|
|
25
|
+
// Linked plugin lives at src/integrations/openclaw/plugin/xray-pre-tool
|
|
26
|
+
join(pluginDir, '..', '..', '..', '..', '..'),
|
|
27
|
+
].filter(Boolean);
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
if (hasGate(candidate)) {
|
|
30
|
+
return candidate;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return '';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default definePluginEntry({
|
|
37
|
+
id: 'xray-pre-tool',
|
|
38
|
+
name: '0xRay PreToolUse',
|
|
39
|
+
register(api) {
|
|
40
|
+
api.on(
|
|
41
|
+
'before_tool_call',
|
|
42
|
+
(event, ctx) => {
|
|
43
|
+
try {
|
|
44
|
+
const xrayRoot = resolveXrayRoot();
|
|
45
|
+
if (!xrayRoot) {
|
|
46
|
+
return { block: true, blockReason: '0xRay dist missing — set XRAY_AI_PATH' };
|
|
47
|
+
}
|
|
48
|
+
const gate = require(join(xrayRoot, 'dist/nucleus/delegation-gate.js'));
|
|
49
|
+
const projectRoot =
|
|
50
|
+
process.env.XRAY_ROOT ||
|
|
51
|
+
ctx?.workspaceDir ||
|
|
52
|
+
ctx?.cwd ||
|
|
53
|
+
process.cwd();
|
|
54
|
+
const features = gate.loadDelegationGateFeatures(projectRoot, 'openclaw');
|
|
55
|
+
const outcome = gate.evaluatePreToolGate(event.toolName, event.params || {}, {
|
|
56
|
+
projectRoot,
|
|
57
|
+
sessionId: ctx?.sessionId || ctx?.sessionKey || 'openclaw',
|
|
58
|
+
features,
|
|
59
|
+
host: 'openclaw',
|
|
60
|
+
});
|
|
61
|
+
if (!outcome.allow) {
|
|
62
|
+
return { block: true, blockReason: outcome.reason || '0xRay constitution' };
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
} catch (err) {
|
|
66
|
+
return {
|
|
67
|
+
block: true,
|
|
68
|
+
blockReason: err instanceof Error ? err.message : String(err),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{ priority: 80 },
|
|
73
|
+
);
|
|
74
|
+
},
|
|
75
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "xray-pre-tool",
|
|
3
|
+
"name": "0xRay PreToolUse",
|
|
4
|
+
"description": "Constitution and temperament gate for OpenClaw tool calls (Codex 11/29/69, spawn plan).",
|
|
5
|
+
"configSchema": {
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"properties": {}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -235,16 +235,21 @@ class XrayArchitectToolsServer extends XrayKnowledgeSkillBase {
|
|
|
235
235
|
private async architectureAssessment(args: Record<string, unknown> | undefined) {
|
|
236
236
|
const projectRoot = (args?.projectRoot as string) || "";
|
|
237
237
|
const assessmentType = (args?.assessmentType as "quick" | "comprehensive") || "comprehensive";
|
|
238
|
+
const conferPrompt = typeof args?.conferPrompt === "string" ? args.conferPrompt : "";
|
|
238
239
|
|
|
239
240
|
frameworkLogger.log("mcps/architect-tools", "architecture-assessment", "info", { projectRoot });
|
|
240
241
|
|
|
241
242
|
const result = await architectArchitectureAssessment(projectRoot, assessmentType);
|
|
243
|
+
const assessmentJson = JSON.stringify(result, null, 2);
|
|
244
|
+
const text = conferPrompt.trim()
|
|
245
|
+
? `${conferPrompt.trim()}\n\n## Architecture assessment\n${assessmentJson}\n\nVerdict: CONDITIONAL\nTop risks: review assessment metrics above\nHardening: address high-complexity or coupling findings before resuming`
|
|
246
|
+
: assessmentJson;
|
|
242
247
|
|
|
243
248
|
return {
|
|
244
249
|
content: [
|
|
245
250
|
{
|
|
246
251
|
type: "text",
|
|
247
|
-
text
|
|
252
|
+
text,
|
|
248
253
|
},
|
|
249
254
|
],
|
|
250
255
|
};
|
|
@@ -11,8 +11,27 @@ import {
|
|
|
11
11
|
isLeadDevModeActive,
|
|
12
12
|
persistLeadDevPlan,
|
|
13
13
|
} from '../../../nucleus/autonomy-kernel.js';
|
|
14
|
+
import {
|
|
15
|
+
formatConferQuorumReport,
|
|
16
|
+
isConferEnabled,
|
|
17
|
+
runConferQuorum,
|
|
18
|
+
} from '../../../nucleus/confer.js';
|
|
14
19
|
import { bindPlanToSession } from '../../../nucleus/lead-dev-plan-persistence.js';
|
|
15
20
|
import { clearPendingDelegations } from '../../../nucleus/pending-delegations.js';
|
|
21
|
+
import {
|
|
22
|
+
isAutoProvisionWorktreeEnabled,
|
|
23
|
+
provisionGitWorktree,
|
|
24
|
+
} from '../../../nucleus/aside-worktree.js';
|
|
25
|
+
import {
|
|
26
|
+
buildUserAsidePlan,
|
|
27
|
+
formatUserAsideSummary,
|
|
28
|
+
isUserAsidesEnabled,
|
|
29
|
+
loadUserAside,
|
|
30
|
+
mergeUserAsideIntake,
|
|
31
|
+
saveUserAside,
|
|
32
|
+
setActiveAsideId,
|
|
33
|
+
UserAsideValidationError,
|
|
34
|
+
} from '../../../nucleus/user-aside.js';
|
|
16
35
|
import { getExecutionPlanner } from '../execution/execution-planner.js';
|
|
17
36
|
import { addObservations, extractComplexityObservations } from '../aside-context.js';
|
|
18
37
|
import type { OrchestrationTask, ComplexityAnalysis } from '../types.js';
|
|
@@ -73,6 +92,13 @@ export class ComplexityHandler {
|
|
|
73
92
|
sessionId?: string;
|
|
74
93
|
synthesisCheckpoint?: boolean;
|
|
75
94
|
synthesisDueReason?: string | null;
|
|
95
|
+
collocatedText?: string | null;
|
|
96
|
+
conferFixture?: boolean;
|
|
97
|
+
userAsideId?: string;
|
|
98
|
+
userAsideTitle?: string;
|
|
99
|
+
worktree?: string;
|
|
100
|
+
branch?: string;
|
|
101
|
+
setActiveAside?: boolean;
|
|
76
102
|
},
|
|
77
103
|
asideId?: string,
|
|
78
104
|
): Promise<{ content: Array<{ type: string; text: string }>; ok: boolean }> {
|
|
@@ -99,20 +125,121 @@ export class ComplexityHandler {
|
|
|
99
125
|
.filter((t) => t.description?.trim())
|
|
100
126
|
.map((t) => ({ description: t.description, type: t.type }));
|
|
101
127
|
const synthesisCheckpoint = args.synthesisCheckpoint === true;
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
128
|
+
const projectRoot = process.cwd();
|
|
129
|
+
const userAsideIntake =
|
|
130
|
+
!synthesisCheckpoint &&
|
|
131
|
+
Boolean(args.userAsideId?.trim()) &&
|
|
132
|
+
isUserAsidesEnabled(projectRoot);
|
|
133
|
+
|
|
134
|
+
let userAsideReport = '';
|
|
135
|
+
let leadDevPlan = synthesisCheckpoint
|
|
136
|
+
? buildSynthesisCheckpointPlan(args.synthesisDueReason ?? null, projectRoot)
|
|
137
|
+
: userAsideIntake
|
|
138
|
+
? null
|
|
139
|
+
: isLeadDevModeActive() && (primaryDescription || planTaskInputs.length > 0)
|
|
140
|
+
? buildLeadDevPlan(
|
|
141
|
+
primaryDescription,
|
|
142
|
+
taskTypes.length ? taskTypes : ['implement'],
|
|
143
|
+
planTaskInputs,
|
|
144
|
+
analysis.overallComplexity,
|
|
145
|
+
projectRoot,
|
|
146
|
+
)
|
|
147
|
+
: null;
|
|
148
|
+
|
|
149
|
+
let planPersisted = synthesisCheckpoint
|
|
150
|
+
? leadDevPlan !== null
|
|
151
|
+
: userAsideIntake
|
|
152
|
+
? false
|
|
153
|
+
: !leadDevPlan;
|
|
154
|
+
|
|
155
|
+
if (userAsideIntake && args.userAsideId) {
|
|
156
|
+
try {
|
|
157
|
+
const asideId = args.userAsideId.trim();
|
|
158
|
+
const title = args.userAsideTitle?.trim() || asideId;
|
|
159
|
+
const existing = loadUserAside(asideId, projectRoot);
|
|
160
|
+
const userAside = existing
|
|
161
|
+
? mergeUserAsideIntake(
|
|
162
|
+
existing,
|
|
163
|
+
primaryDescription || existing.description,
|
|
164
|
+
planTaskInputs,
|
|
165
|
+
analysis.overallComplexity,
|
|
166
|
+
projectRoot,
|
|
167
|
+
)
|
|
168
|
+
: buildUserAsidePlan(
|
|
169
|
+
asideId,
|
|
170
|
+
title,
|
|
171
|
+
primaryDescription || title,
|
|
172
|
+
planTaskInputs,
|
|
173
|
+
analysis.overallComplexity,
|
|
174
|
+
projectRoot,
|
|
175
|
+
);
|
|
176
|
+
if (!userAside) {
|
|
177
|
+
planPersisted = false;
|
|
178
|
+
} else {
|
|
179
|
+
if (args.worktree) userAside.worktree = args.worktree;
|
|
180
|
+
if (args.branch) userAside.branch = args.branch;
|
|
181
|
+
if (args.sessionId) userAside.sessionId = args.sessionId;
|
|
182
|
+
if (args.userAsideTitle) userAside.title = title;
|
|
183
|
+
|
|
184
|
+
let worktreeProvisionNote = '';
|
|
185
|
+
if (
|
|
186
|
+
args.worktree?.trim() &&
|
|
187
|
+
args.branch?.trim() &&
|
|
188
|
+
isAutoProvisionWorktreeEnabled(projectRoot)
|
|
189
|
+
) {
|
|
190
|
+
const provision = provisionGitWorktree({
|
|
191
|
+
projectRoot,
|
|
192
|
+
worktree: args.worktree.trim(),
|
|
193
|
+
branch: args.branch.trim(),
|
|
194
|
+
});
|
|
195
|
+
if (!provision.ok) {
|
|
196
|
+
throw new UserAsideValidationError(
|
|
197
|
+
`Worktree auto-provision failed: ${provision.message}`,
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
worktreeProvisionNote = provision.created
|
|
201
|
+
? `\n\n**Worktree provisioned:** \`${provision.path}\` (branch \`${args.branch.trim()}\`)`
|
|
202
|
+
: `\n\n**Worktree ready:** \`${provision.path}\``;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const asidePath = saveUserAside(userAside, projectRoot);
|
|
206
|
+
const activate = args.setActiveAside !== false;
|
|
207
|
+
if (activate) {
|
|
208
|
+
clearPendingDelegations(projectRoot);
|
|
209
|
+
setActiveAsideId(asideId, projectRoot, args.sessionId ?? null);
|
|
210
|
+
}
|
|
211
|
+
planPersisted = true;
|
|
212
|
+
userAsideReport = `\n\n## User aside\n\n${formatUserAsideSummary(userAside)}${worktreeProvisionNote}`;
|
|
213
|
+
if (activate) {
|
|
214
|
+
userAsideReport += `\n\n**Active aside:** \`${asideId}\` — spawns route to \`${asideId}.a.*\` todos.`;
|
|
215
|
+
}
|
|
216
|
+
await frameworkLogger.log(
|
|
217
|
+
'orchestrator.server',
|
|
218
|
+
'user-aside-persisted',
|
|
219
|
+
'info',
|
|
220
|
+
{
|
|
221
|
+
asidePath,
|
|
222
|
+
asideId,
|
|
223
|
+
todoCount: userAside.plan.phases.reduce((n, p) => n + p.todos.length, 0),
|
|
224
|
+
activated: activate,
|
|
225
|
+
},
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
} catch (err) {
|
|
229
|
+
planPersisted = false;
|
|
230
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
231
|
+
userAsideReport = `\n\n❌ User aside intake failed: ${message}`;
|
|
232
|
+
await frameworkLogger.log(
|
|
233
|
+
'orchestrator.server',
|
|
234
|
+
'user-aside-persist-failed',
|
|
235
|
+
'warning',
|
|
236
|
+
{
|
|
237
|
+
error: message,
|
|
238
|
+
validation: err instanceof UserAsideValidationError,
|
|
239
|
+
},
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
} else if (leadDevPlan) {
|
|
116
243
|
try {
|
|
117
244
|
const sessionId = args.sessionId ?? `analyze-${Date.now()}`;
|
|
118
245
|
if (!synthesisCheckpoint) {
|
|
@@ -145,6 +272,37 @@ export class ComplexityHandler {
|
|
|
145
272
|
}
|
|
146
273
|
}
|
|
147
274
|
|
|
275
|
+
let conferReport = '';
|
|
276
|
+
if (
|
|
277
|
+
synthesisCheckpoint &&
|
|
278
|
+
leadDevPlan &&
|
|
279
|
+
planPersisted &&
|
|
280
|
+
isConferEnabled() &&
|
|
281
|
+
args.sessionId
|
|
282
|
+
) {
|
|
283
|
+
const conferOpts: {
|
|
284
|
+
dueReason?: string | null;
|
|
285
|
+
fixture?: boolean;
|
|
286
|
+
collocatedText?: string;
|
|
287
|
+
} = {
|
|
288
|
+
dueReason: args.synthesisDueReason ?? null,
|
|
289
|
+
fixture: args.conferFixture === true,
|
|
290
|
+
};
|
|
291
|
+
if (args.collocatedText) conferOpts.collocatedText = args.collocatedText;
|
|
292
|
+
const conferResult = await runConferQuorum(process.cwd(), args.sessionId, conferOpts);
|
|
293
|
+
conferReport = `\n\n${formatConferQuorumReport(conferResult)}`;
|
|
294
|
+
await frameworkLogger.log(
|
|
295
|
+
'orchestrator.server',
|
|
296
|
+
'confer-quorum',
|
|
297
|
+
conferResult.status === 'completed' ? 'info' : 'warning',
|
|
298
|
+
{
|
|
299
|
+
status: conferResult.status,
|
|
300
|
+
agentCount: conferResult.agents.length,
|
|
301
|
+
sessionId: args.sessionId,
|
|
302
|
+
},
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
148
306
|
const ok = planPersisted;
|
|
149
307
|
|
|
150
308
|
return {
|
|
@@ -152,13 +310,14 @@ export class ComplexityHandler {
|
|
|
152
310
|
content: [
|
|
153
311
|
{
|
|
154
312
|
type: 'text',
|
|
155
|
-
text:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
313
|
+
text:
|
|
314
|
+
this.formatComplexityResponse(
|
|
315
|
+
analysis,
|
|
316
|
+
recommendations,
|
|
317
|
+
tasks.length,
|
|
318
|
+
leadDevPlan,
|
|
319
|
+
synthesisCheckpoint,
|
|
320
|
+
) + conferReport + userAsideReport,
|
|
162
321
|
},
|
|
163
322
|
],
|
|
164
323
|
};
|