0xray 4.0.34 → 4.0.36
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/.grok-plugin/plugin.json +1 -1
- package/.xray/codex.json +12 -4
- package/.xray/features.json +1 -1
- package/AGENTS-consumer.md +6 -6
- package/AGENTS.md +5 -5
- package/README.md +2 -2
- package/dist/AGENTS.md +5 -5
- package/dist/CHANGELOG.md +26 -0
- package/dist/README.md +2 -2
- package/dist/cli/index.js +2 -5
- package/dist/governance/governance-service.js +1 -1
- package/dist/integrations/base/README.md +1 -9
- package/dist/integrations/base/index.d.ts +0 -1
- package/dist/integrations/base/index.js +0 -2
- package/dist/integrations/governance/index.js +31 -8
- package/dist/integrations/grok/hooks/grok-hook-utils.js +1 -1
- package/dist/integrations/grok/hooks/session-start.js +12 -0
- package/dist/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
- package/dist/integrations/hooks/goggles-mcp.mjs +10 -3
- package/dist/integrations/hooks/goggles-pipeline.mjs +110 -23
- package/dist/integrations/hooks/host-truth.mjs +74 -0
- package/dist/integrations/hooks/station-hook-runtime.cjs +3 -0
- package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/dist/mcps/knowledge-skills/storyteller.server.js +0 -1
- package/dist/nucleus/delegation-gate.d.ts +2 -2
- package/dist/nucleus/delegation-gate.js +13 -2
- package/dist/nucleus/work-freshness.mjs +189 -0
- package/dist/processors/implementations/agents-md-validation-processor.js +1 -1
- package/docs-site/docs/plates/boot.md +17 -2
- package/docs-site/docs/plates/governance.md +3 -2
- package/docs-site/docs/plates/index.md +3 -1
- package/docs-site/docs/plates/memory-recall.md +26 -35
- package/docs-site/docs/plates/orchestration.md +39 -35
- package/docs-site/docs/plates/processor.md +34 -36
- package/docs-site/docs/plates/reporting.md +3 -8
- package/docs-site/docs/plates/routing.md +22 -11
- package/package.json +3 -2
- package/scripts/foundry/release.mjs +48 -5
- package/scripts/mjs/run-grok-hook.mjs +50 -0
- package/scripts/mjs/test-consumer-readiness.mjs +1 -0
- package/scripts/mjs/test-mcp-functionality.mjs +14 -9
- package/scripts/node/basic-security-audit.cjs +0 -1
- package/scripts/node/bridge-mcp-wiring.cjs +66 -3
- package/scripts/node/install-bridges.cjs +3 -3
- package/scripts/node/postinstall.cjs +1 -1
- package/scripts/node/prepare-consumer.cjs +11 -7
- package/scripts/node/setup-dev.cjs +18 -26
- package/scripts/node/validate-mcp-connectivity.js +2 -1
- package/src/integrations/grok/plugin/0xray/hooks/hooks.json +6 -6
- package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/src/mcps/knowledge-skills/storyteller.server.ts +0 -1
- package/xray/agents_template.md +5 -5
- package/xray/codex.json +12 -4
- package/xray/features.json +1 -1
- package/dist/agents/known-names.d.ts +0 -26
- package/dist/agents/known-names.js +0 -72
- package/dist/analytics/consent-manager.d.ts +0 -92
- package/dist/analytics/consent-manager.js +0 -257
- package/dist/benchmark/performance-benchmark.d.ts +0 -103
- package/dist/benchmark/performance-benchmark.js +0 -373
- package/dist/cli/commands/analytics-disable.d.ts +0 -9
- package/dist/cli/commands/analytics-disable.js +0 -72
- package/dist/cli/commands/analytics-enable-action.d.ts +0 -8
- package/dist/cli/commands/analytics-enable-action.js +0 -82
- package/dist/cli/commands/analytics-preview.d.ts +0 -9
- package/dist/cli/commands/analytics-preview.js +0 -106
- package/dist/cli/commands/analytics-status.d.ts +0 -9
- package/dist/cli/commands/analytics-status.js +0 -68
- package/dist/cli/commands/enforce.d.ts +0 -12
- package/dist/cli/commands/enforce.js +0 -78
- package/dist/cli/commands/govern.d.ts +0 -29
- package/dist/cli/commands/govern.js +0 -149
- package/dist/cli/commands/security-audit.d.ts +0 -23
- package/dist/cli/commands/security-audit.js +0 -219
- package/dist/cli/server.d.ts +0 -1
- package/dist/cli/server.js +0 -147
- package/dist/config/routing-mappings.d.ts +0 -26
- package/dist/config/routing-mappings.js +0 -151
- package/dist/core/bridge.mjs +0 -922
- package/dist/core/trace-context.d.ts +0 -12
- package/dist/core/trace-context.js +0 -33
- package/dist/enforcement/index.d.ts +0 -22
- package/dist/enforcement/index.js +0 -40
- package/dist/enforcement/loaders/index.d.ts +0 -36
- package/dist/enforcement/loaders/index.js +0 -39
- package/dist/enforcement/test-auto-healing.d.ts +0 -83
- package/dist/enforcement/test-auto-healing.js +0 -325
- package/dist/inference/index.d.ts +0 -10
- package/dist/inference/index.js +0 -5
- package/dist/infrastructure/iac-validator.d.ts +0 -150
- package/dist/infrastructure/iac-validator.js +0 -465
- package/dist/infrastructure/schemas/cloud-schemas.d.ts +0 -482
- package/dist/infrastructure/schemas/cloud-schemas.js +0 -488
- package/dist/integrations/base/ExampleIntegration.d.ts +0 -46
- package/dist/integrations/base/ExampleIntegration.js +0 -180
- package/dist/integrations/enforcement-gate.d.ts +0 -44
- package/dist/integrations/enforcement-gate.js +0 -348
- package/dist/mcps/connection/connection-manager.d.ts +0 -39
- package/dist/mcps/connection/connection-manager.js +0 -79
- package/dist/mcps/index.d.ts +0 -17
- package/dist/mcps/index.js +0 -65
- package/dist/mcps/orchestrator/index.d.ts +0 -6
- package/dist/mcps/orchestrator/index.js +0 -5
- package/dist/metrics/index.d.ts +0 -6
- package/dist/metrics/index.js +0 -6
- package/dist/orchestrator/self-direction-activation.d.ts +0 -108
- package/dist/orchestrator/self-direction-activation.js +0 -244
- package/dist/orchestrator/universal-registry-bridge.d.ts +0 -84
- package/dist/orchestrator/universal-registry-bridge.js +0 -246
- package/dist/performance/performance-budget-enforcer.d.ts +0 -157
- package/dist/performance/performance-budget-enforcer.js +0 -433
- package/dist/performance/performance-regression-tester.d.ts +0 -107
- package/dist/performance/performance-regression-tester.js +0 -341
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.d.ts +0 -11
- package/dist/postprocessor/analysis/CodeChangeAnalyzer.js +0 -50
- package/dist/postprocessor/config/ProcessorConfigLoader.d.ts +0 -44
- package/dist/postprocessor/config/ProcessorConfigLoader.js +0 -16
- package/dist/postprocessor/integration.d.ts +0 -156
- package/dist/postprocessor/integration.js +0 -194
- package/dist/postprocessor/metamorphosis/index.d.ts +0 -2
- package/dist/postprocessor/metamorphosis/index.js +0 -1
- package/dist/postprocessor/redeploy/RetryHandler.d.ts +0 -49
- package/dist/postprocessor/redeploy/RetryHandler.js +0 -118
- package/dist/processors/implementations/session-capture-processor.d.ts +0 -14
- package/dist/processors/implementations/session-capture-processor.js +0 -37
- package/dist/public/XrayService.d.ts +0 -17
- package/dist/public/XrayService.js +0 -40
- package/dist/public/index.d.ts +0 -4
- package/dist/public/index.js +0 -2
- package/dist/security/comprehensive-security-audit.d.ts +0 -157
- package/dist/security/comprehensive-security-audit.js +0 -1004
- package/dist/security/index.d.ts +0 -13
- package/dist/security/index.js +0 -13
- package/dist/security/security-agent-coordinator.d.ts +0 -71
- package/dist/security/security-agent-coordinator.js +0 -203
- package/dist/security/security-hardening-system.d.ts +0 -238
- package/dist/security/security-hardening-system.js +0 -726
- package/dist/security/security-orchestration-layer.d.ts +0 -118
- package/dist/security/security-orchestration-layer.js +0 -495
- package/dist/testing/memory-regression-suite.d.ts +0 -105
- package/dist/testing/memory-regression-suite.js +0 -258
- package/dist/tools/assess-complexity-tool.d.ts +0 -28
- package/dist/tools/assess-complexity-tool.js +0 -44
- package/dist/tools/query-routing-tool.d.ts +0 -17
- package/dist/tools/query-routing-tool.js +0 -59
- package/dist/utils/batch-operations.d.ts +0 -25
- package/dist/utils/batch-operations.js +0 -292
- package/dist/utils/task-graph.d.ts +0 -29
- package/dist/utils/task-graph.js +0 -106
- package/dist/utils/test-template-generator.d.ts +0 -25
- package/dist/utils/test-template-generator.js +0 -178
- package/dist/utils/token-manager.d.ts +0 -48
- package/dist/utils/token-manager.js +0 -163
- package/dist/validation/agent-config-validator.d.ts +0 -110
- package/dist/validation/agent-config-validator.js +0 -280
- package/dist/validation/orchestration-flow-validator.d.ts +0 -87
- package/dist/validation/orchestration-flow-validator.js +0 -606
- package/src/mcps/connection/connection-manager.ts +0 -91
- package/src/mcps/index.ts +0 -80
- package/src/mcps/orchestrator/index.ts +0 -29
|
@@ -5,45 +5,36 @@ sidebar_label: Memory recall
|
|
|
5
5
|
|
|
6
6
|
# Memory recall
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Intent names one plate. Equal top scores recall nothing. A missing worn copy is stamped from the docs plate. An edited copy stays.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
┌──────────────────────────────────────────────────────────────┐
|
|
12
12
|
│ INPUT LAYER │
|
|
13
13
|
│ │
|
|
14
|
-
│
|
|
15
|
-
│ │
|
|
16
|
-
│
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
│ PROCESSING LAYER │
|
|
21
|
-
│
|
|
22
|
-
│
|
|
23
|
-
│ │
|
|
24
|
-
│ │
|
|
25
|
-
│
|
|
26
|
-
│
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
│
|
|
38
|
-
│
|
|
39
|
-
│ ┌────────────────────────────┐ ┌─────────────────────┐ │
|
|
40
|
-
│ │ lesson on the signal │ │ stamp file │ │
|
|
41
|
-
│ │ an episode of what happened│ │ the schematic │ │
|
|
42
|
-
│ └────────────────────────────┘ │ docs-site/docs/ │ │
|
|
43
|
-
│ │ plates/<id>.md │ │
|
|
44
|
-
│ │ worn copy only when │ │
|
|
45
|
-
│ │ .xray/state/plates/ │ │
|
|
46
|
-
│ │ <id>.md is missing │ │
|
|
47
|
-
│ └─────────────────────┘ │
|
|
14
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
15
|
+
│ │ intent │ │
|
|
16
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
17
|
+
└──────────────────────────────┼──────────────────────────────┘
|
|
18
|
+
v
|
|
19
|
+
┌──────────────────────────────┼──────────────────────────────┐
|
|
20
|
+
│ PROCESSING LAYER v │
|
|
21
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
22
|
+
│ │ score cues │ │
|
|
23
|
+
│ │ one winner loads that plate │ │
|
|
24
|
+
│ │ a tie returns nothing │ │
|
|
25
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
26
|
+
│ v │
|
|
27
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
28
|
+
│ │ stampPlateIfMissing │ │
|
|
29
|
+
│ │ writes .xray/state/plates only when that file │ │
|
|
30
|
+
│ │ is missing │ │
|
|
31
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
32
|
+
└──────────────────────────────┼──────────────────────────────┘
|
|
33
|
+
v
|
|
34
|
+
┌──────────────────────────────┼──────────────────────────────┐
|
|
35
|
+
│ OUTPUT LAYER v │
|
|
36
|
+
│ ┌────────────────────┐ ┌────────────────────────┐ │
|
|
37
|
+
│ │ plate line │ │ stamp file │ │
|
|
38
|
+
│ └────────────────────┘ └────────────────────────┘ │
|
|
48
39
|
└──────────────────────────────────────────────────────────────┘
|
|
49
40
|
```
|
|
@@ -5,51 +5,55 @@ sidebar_label: Orchestration
|
|
|
5
5
|
|
|
6
6
|
# Orchestration
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Each tool is its own call. `spawnAside` opens around `orchestrate-task`, `analyze-complexity`, and `govern-and-apply`. `closeAside` runs when that call returns.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
┌────────────────────────────────────────────────────────────┐
|
|
12
12
|
│ INPUT LAYER │
|
|
13
13
|
│ │
|
|
14
|
-
│
|
|
15
|
-
│ │
|
|
16
|
-
│
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
│
|
|
22
|
-
│ ┌────────────────────────────────────────────────────┐
|
|
23
|
-
│ │
|
|
24
|
-
│ │
|
|
25
|
-
│ └──────────────────────────┬─────────────────────────┘
|
|
26
|
-
│ v
|
|
27
|
-
│ ┌────────────────────────────────────────────────────┐
|
|
28
|
-
│ │
|
|
29
|
-
│ │
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│ │
|
|
35
|
-
│ │
|
|
36
|
-
│ │
|
|
37
|
-
│ └──────────────────────────┬─────────────────────────┘
|
|
38
|
-
│ v
|
|
39
|
-
│ ┌────────────────────────────────────────────────────┐
|
|
40
|
-
│ │
|
|
41
|
-
│
|
|
42
|
-
│
|
|
43
|
-
│
|
|
44
|
-
│
|
|
45
|
-
│ │ closeAside
|
|
46
|
-
│ └──────────────────────────┬─────────────────────────┘
|
|
14
|
+
│ ┌──────────────────────┐ ┌──────────────────────┐ │
|
|
15
|
+
│ │ tool name │ │ arguments │ │
|
|
16
|
+
│ └──────────┬───────────┘ └──────────┬───────────┘ │
|
|
17
|
+
└──────────────┼─────────────────────────────┼──────────────┘
|
|
18
|
+
v v
|
|
19
|
+
┌──────────────┼─────────────────────────────┼──────────────┐
|
|
20
|
+
│ PROCESSING LAYER │ │
|
|
21
|
+
│ v v │
|
|
22
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
23
|
+
│ │ orchestrate-task │ │
|
|
24
|
+
│ │ spawnAside · handleOrchestrateTask · closeAside │ │
|
|
25
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
26
|
+
│ v │
|
|
27
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
28
|
+
│ │ analyze-complexity │ │
|
|
29
|
+
│ │ a due synthesis checkpoint can return first │ │
|
|
30
|
+
│ │ spawnAside · handleAnalyzeComplexity · closeAside │ │
|
|
31
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
32
|
+
│ v │
|
|
33
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
34
|
+
│ │ govern-and-apply │ │
|
|
35
|
+
│ │ a due synthesis checkpoint blocks first │ │
|
|
36
|
+
│ │ spawnAside · governExternalProposals · closeAside │ │
|
|
37
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
38
|
+
│ v │
|
|
39
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
40
|
+
│ │ get-orchestration-status │ │
|
|
41
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
42
|
+
│ v │
|
|
43
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
44
|
+
│ │ cancel-orchestration │ │
|
|
45
|
+
│ │ closeAside on a forced cancel or a matching session│ │
|
|
46
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
47
|
+
│ v │
|
|
48
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
49
|
+
│ │ optimize-orchestration │ │
|
|
50
|
+
│ └──────────────────────────┬─────────────────────────┘ │
|
|
47
51
|
└──────────────────────────────┼────────────────────────────┘
|
|
48
52
|
v
|
|
49
53
|
┌──────────────────────────────┼────────────────────────────┐
|
|
50
54
|
│ OUTPUT LAYER v │
|
|
51
55
|
│ ┌─────────────────────┐ ┌─────────────────────────┐ │
|
|
52
|
-
│ │
|
|
56
|
+
│ │ tool result │ │ aside id │ │
|
|
53
57
|
│ └─────────────────────┘ └─────────────────────────┘ │
|
|
54
58
|
└────────────────────────────────────────────────────────────┘
|
|
55
59
|
```
|
|
@@ -5,42 +5,40 @@ sidebar_label: Processor
|
|
|
5
5
|
|
|
6
6
|
# Processor
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
`ProcessorManager` runs the enabled pre processors, then the enabled post processors. Prompt text longer than 10 characters is checked inside the pre pass.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
|
-
|
|
12
|
-
│ INPUT LAYER
|
|
13
|
-
│
|
|
14
|
-
│
|
|
15
|
-
│ │ tool
|
|
16
|
-
│
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
│ PROCESSING LAYER
|
|
21
|
-
│
|
|
22
|
-
│
|
|
23
|
-
│
|
|
24
|
-
│
|
|
25
|
-
│
|
|
26
|
-
│
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
│
|
|
30
|
-
│
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
│
|
|
34
|
-
│
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
│
|
|
41
|
-
│
|
|
42
|
-
│
|
|
43
|
-
|
|
44
|
-
│ └──────────────────┘ └──────────────────┘ └────────────────────┘ │
|
|
45
|
-
└────────────────────────────────────────────────────────────────────────┘
|
|
11
|
+
┌──────────────────────────────────────────────────────────────┐
|
|
12
|
+
│ INPUT LAYER │
|
|
13
|
+
│ │
|
|
14
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
|
|
15
|
+
│ │ tool │ │ args │ │ operation │ │
|
|
16
|
+
│ └──────┬───────┘ └──────┬───────┘ └───────┬────────┘ │
|
|
17
|
+
└──────────┼──────────────────┼───────────────────┼───────────┘
|
|
18
|
+
v v v
|
|
19
|
+
┌──────────┼──────────────────┼───────────────────┼───────────┐
|
|
20
|
+
│ PROCESSING LAYER │ │ │
|
|
21
|
+
│ v v v │
|
|
22
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
23
|
+
│ │ executePreProcessors │ │
|
|
24
|
+
│ │ prompt-security-validator when the prompt is longer │ │
|
|
25
|
+
│ │ than 10 characters │ │
|
|
26
|
+
│ │ enabled pre processors, by priority │ │
|
|
27
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
28
|
+
│ v │
|
|
29
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
30
|
+
│ │ executePostProcessors │ │
|
|
31
|
+
│ │ enabled post processors, by priority │ │
|
|
32
|
+
│ │ a stagger waits out its minimum interval │ │
|
|
33
|
+
│ │ pre results are passed in │ │
|
|
34
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
35
|
+
└──────────────────────────────┼──────────────────────────────┘
|
|
36
|
+
v
|
|
37
|
+
┌──────────────────────────────┼──────────────────────────────┐
|
|
38
|
+
│ OUTPUT LAYER v │
|
|
39
|
+
│ ┌──────────────────────────┐ ┌───────────────────────┐ │
|
|
40
|
+
│ │ pre result │ │ post results │ │
|
|
41
|
+
│ │ success and results │ │ │ │
|
|
42
|
+
│ └──────────────────────────┘ └───────────────────────┘ │
|
|
43
|
+
└──────────────────────────────────────────────────────────────┘
|
|
46
44
|
```
|
|
@@ -5,7 +5,7 @@ sidebar_label: Reporting
|
|
|
5
5
|
|
|
6
6
|
# Reporting
|
|
7
7
|
|
|
8
|
-
Logs become a report.
|
|
8
|
+
Logs become a report. A valid cache returns the formatted report and does not write the file again.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
┌────────────────────────────────────────────────────────────┐
|
|
@@ -22,14 +22,9 @@ Logs become a report. Session start can also drop a schedule marker. The marker
|
|
|
22
22
|
│ ┌────────────────────────────────────────────────────┐ │
|
|
23
23
|
│ │ FrameworkReportingSystem │ │
|
|
24
24
|
│ │ collect logs → metrics → formatReport │ │
|
|
25
|
-
│ │ cache
|
|
25
|
+
│ │ cache the fresh report │ │
|
|
26
|
+
│ │ write the file when outputPath is set │ │
|
|
26
27
|
│ └──────────────────────────┬─────────────────────────┘ │
|
|
27
|
-
│ │ │
|
|
28
|
-
│ ┌──────────────────────────┼─────────────────────────┐ │
|
|
29
|
-
│ │ SessionStart marker │ │ │
|
|
30
|
-
│ │ autonomous-reporting │ side output │ │
|
|
31
|
-
│ │ scheduled flag │ │ │
|
|
32
|
-
│ └──────────────────────────┼─────────────────────────┘ │
|
|
33
28
|
└──────────────────────────────┼────────────────────────────┘
|
|
34
29
|
v
|
|
35
30
|
┌──────────────────────────────┼────────────────────────────┐
|
|
@@ -5,14 +5,14 @@ sidebar_label: Routing
|
|
|
5
5
|
|
|
6
6
|
# Routing
|
|
7
7
|
|
|
8
|
-
Task text becomes an agent.
|
|
8
|
+
Task text becomes an agent. `scoreAndRoute` scores the work, then `routeToAgent` picks the tier agent. Repertoire may replace that agent when a law matches. Naming no plane stops before that pick and returns nobody.
|
|
9
9
|
|
|
10
10
|
```
|
|
11
11
|
┌──────────────────────────────────────────────────────────────┐
|
|
12
12
|
│ INPUT LAYER │
|
|
13
13
|
│ │
|
|
14
14
|
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
|
|
15
|
-
│ │ task text │ │
|
|
15
|
+
│ │ task text │ │ context │ │ thresholds │ │
|
|
16
16
|
│ └──────┬───────┘ └──────┬───────┘ └───────┬────────┘ │
|
|
17
17
|
│ └──────────────────┴─────────┬─────────┘ │
|
|
18
18
|
└────────────────────────────────────────┼─────────────────────┘
|
|
@@ -21,22 +21,30 @@ Task text becomes an agent. thinDispatch scores the work. Repertoire may adjust
|
|
|
21
21
|
│ PROCESSING LAYER │ │
|
|
22
22
|
│ v │
|
|
23
23
|
│ ┌──────────────────────────────────────────────────────┐ │
|
|
24
|
-
│ │
|
|
25
|
-
│ │
|
|
24
|
+
│ │ scoreComplexity │ │
|
|
25
|
+
│ │ ≤15 simple · single-agent │ │
|
|
26
|
+
│ │ ≤25 moderate · multi-agent │ │
|
|
27
|
+
│ │ ≤50 complex · orchestrator-led │ │
|
|
28
|
+
│ │ >50 enterprise · orchestrator-led │ │
|
|
26
29
|
│ └──────────────────────────┬───────────────────────────┘ │
|
|
27
30
|
│ v │
|
|
28
31
|
│ ┌──────────────────────────────────────────────────────┐ │
|
|
29
|
-
│ │
|
|
30
|
-
│ │
|
|
31
|
-
│ │
|
|
32
|
-
│ │ ≤50 multi-agent │ │
|
|
33
|
-
│ │ >50 orchestrator-led │ │
|
|
32
|
+
│ │ lensPlane │ │
|
|
33
|
+
│ │ no plane named stops here and the agent is empty │ │
|
|
34
|
+
│ │ one plane attaches that file │ │
|
|
34
35
|
│ └──────────────────────────┬───────────────────────────┘ │
|
|
35
36
|
│ v │
|
|
36
37
|
│ ┌──────────────────────────────────────────────────────┐ │
|
|
37
|
-
│ │
|
|
38
|
-
│ │
|
|
38
|
+
│ │ routeToAgent │ │
|
|
39
|
+
│ │ simple → code-reviewer │ │
|
|
40
|
+
│ │ moderate, complex, enterprise → architect │ │
|
|
41
|
+
│ └──────────────────────────┬───────────────────────────┘ │
|
|
42
|
+
│ v │
|
|
43
|
+
│ ┌──────────────────────────────────────────────────────┐ │
|
|
44
|
+
│ │ resolveThinDispatch │ │
|
|
45
|
+
│ │ worn repertoire may change agent and score │ │
|
|
39
46
|
│ │ null provider leaves the score alone │ │
|
|
47
|
+
│ │ a stop never reaches this step │ │
|
|
40
48
|
│ └──────────────────────────┬───────────────────────────┘ │
|
|
41
49
|
└──────────────────────────────┼──────────────────────────────┘
|
|
42
50
|
v
|
|
@@ -45,5 +53,8 @@ Task text becomes an agent. thinDispatch scores the work. Repertoire may adjust
|
|
|
45
53
|
│ ┌────────────┐ ┌────────────────┐ ┌────────────────┐ │
|
|
46
54
|
│ │ agent │ │ strategy │ │ adjusted score │ │
|
|
47
55
|
│ └────────────┘ └────────────────┘ └────────────────┘ │
|
|
56
|
+
│ ┌────────────┐ │
|
|
57
|
+
│ │ file │ │
|
|
58
|
+
│ └────────────┘ │
|
|
48
59
|
└──────────────────────────────────────────────────────────────┘
|
|
49
60
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "0xray",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.36",
|
|
4
4
|
"description": "Multi-agent orchestration and Codex governance for OpenCode, Hermes, Grok Build, and OpenClaw",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"test": "vitest run",
|
|
74
74
|
"test:batch": "npm test",
|
|
75
75
|
"test:unit": "npm test -- src/__tests__/unit/config-loader.test.ts src/__tests__/unit/state-manager.test.ts src/__tests__/unit/state-manager-persistence.test.ts src/__tests__/unit/context-loader.test.ts src/__tests__/unit/pattern-analyzer.test.ts src/__tests__/unit/complexity-calibrator.test.ts",
|
|
76
|
-
"test:core-framework": "npm test -- src/__tests__/unit/
|
|
76
|
+
"test:core-framework": "npm test -- src/__tests__/unit/v2-deletion-protection.test.ts",
|
|
77
77
|
"test:security": "npm test -- src/__tests__/unit/security/security-hardener.test.ts src/__tests__/unit/security/security-headers.test.ts src/__tests__/unit/security/security-auditor.test.ts",
|
|
78
78
|
"test:performance": "npm test -- src/__tests__/unit/monitoring.test.ts src/__tests__/unit/benchmark.test.ts src/__tests__/unit/analytics.test.ts",
|
|
79
79
|
"test:session-management": "npm test -- src/__tests__/unit/session-state-manager.test.ts src/__tests__/unit/session-security-validator.test.ts src/__tests__/unit/session-coordination-validator.test.ts src/__tests__/unit/session-migration-validator.test.ts src/__tests__/unit/session-migration-logic.test.ts",
|
|
@@ -171,6 +171,7 @@
|
|
|
171
171
|
"scripts/mjs/verify-four-floor-compact.mjs",
|
|
172
172
|
"scripts/mjs/run-repertoire-mcp.mjs",
|
|
173
173
|
"scripts/mjs/run-goggles-mcp.mjs",
|
|
174
|
+
"scripts/mjs/run-grok-hook.mjs",
|
|
174
175
|
"scripts/mjs/verify-delegation-gate-core.mjs",
|
|
175
176
|
"scripts/mjs/delegation-gate-fixture.mjs",
|
|
176
177
|
"src/opencode/",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
* 4. Commit release artifacts → push
|
|
10
10
|
* 5. Verify gate (reconcile + git + release docs + smoke)
|
|
11
11
|
* 6. npm publish (idempotent — skip if version already on registry)
|
|
12
|
-
* 7.
|
|
12
|
+
* 7. Poll npm view until the registry lists that version
|
|
13
|
+
* 8. Tag → push tag (only after the registry lists it)
|
|
13
14
|
*
|
|
14
15
|
* Usage:
|
|
15
16
|
* npx @0xray/foundry release [patch|minor|major] --dry-run
|
|
@@ -90,9 +91,13 @@ function currentBranch() {
|
|
|
90
91
|
return execSync("git rev-parse --abbrev-ref HEAD", { cwd: rootDir, encoding: "utf-8" }).trim();
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
function say(line) {
|
|
95
|
+
process.stdout.write(`${line}\n`);
|
|
96
|
+
}
|
|
97
|
+
|
|
93
98
|
function npmVersionPublished(version) {
|
|
94
99
|
try {
|
|
95
|
-
const out = execSync(`npm view ${packageName()}@${version} version`, {
|
|
100
|
+
const out = execSync(`npm view ${packageName()}@${version} version --prefer-online`, {
|
|
96
101
|
cwd: rootDir,
|
|
97
102
|
encoding: "utf-8",
|
|
98
103
|
stdio: ["pipe", "pipe", "pipe"],
|
|
@@ -103,20 +108,58 @@ function npmVersionPublished(version) {
|
|
|
103
108
|
}
|
|
104
109
|
}
|
|
105
110
|
|
|
111
|
+
function sleepMs(ms) {
|
|
112
|
+
const seconds = Math.max(1, Math.round(Number(ms) / 1000));
|
|
113
|
+
execSync(`sleep ${seconds}`, { stdio: "ignore" });
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* npm publish exits 0 while the registry still says the version is processing.
|
|
118
|
+
* Tag only after npm view lists it. Returns false when the wait runs out.
|
|
119
|
+
* @param {string} version
|
|
120
|
+
* @param {object} [hooks]
|
|
121
|
+
*/
|
|
122
|
+
export function waitUntilListed(version, hooks = {}) {
|
|
123
|
+
const name = hooks.name ?? packageName();
|
|
124
|
+
const listed = hooks.listed ?? (() => npmVersionPublished(version));
|
|
125
|
+
const sleep = hooks.sleep ?? sleepMs;
|
|
126
|
+
const now = hooks.now ?? Date.now;
|
|
127
|
+
const log = hooks.log ?? say;
|
|
128
|
+
const fail = hooks.fail ?? ((line) => {
|
|
129
|
+
process.stderr.write(`${line}\n`);
|
|
130
|
+
process.exit(1);
|
|
131
|
+
});
|
|
132
|
+
const intervalMs = hooks.intervalMs ?? Number(process.env.FOUNDRY_PUBLISH_POLL_MS || 15000);
|
|
133
|
+
const timeoutMs = hooks.timeoutMs ?? Number(process.env.FOUNDRY_PUBLISH_TIMEOUT_MS || 20 * 60 * 1000);
|
|
134
|
+
const started = now();
|
|
135
|
+
let attempt = 0;
|
|
136
|
+
while (!listed()) {
|
|
137
|
+
if (now() - started >= timeoutMs) {
|
|
138
|
+
fail(`❌ ${name}@${version} was uploaded but the registry has not listed it. Tag not pushed.`);
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
attempt += 1;
|
|
142
|
+
log(`… registry has not listed ${name}@${version} yet (try ${attempt})`);
|
|
143
|
+
sleep(intervalMs);
|
|
144
|
+
}
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
|
|
106
148
|
function publishIdempotent(version) {
|
|
107
149
|
if (dryRun) {
|
|
108
|
-
|
|
150
|
+
say(` would: ${npmPublishCmd()} then poll npm view ${packageName()}@${version} until listed`);
|
|
109
151
|
return;
|
|
110
152
|
}
|
|
111
153
|
if (npmVersionPublished(version)) {
|
|
112
|
-
|
|
154
|
+
say(`ℹ️ ${packageName()}@${version} already on npm — skipping publish`);
|
|
113
155
|
return;
|
|
114
156
|
}
|
|
115
157
|
if (isXrayExoRepo(rootDir)) {
|
|
116
158
|
runMill("assert-packed-dist-cli.mjs", [], "packed dist/cli");
|
|
117
159
|
}
|
|
118
160
|
execSync(npmPublishCmd(), { cwd: rootDir, stdio: "inherit", encoding: "utf-8" });
|
|
119
|
-
|
|
161
|
+
if (!waitUntilListed(version)) process.exit(1);
|
|
162
|
+
say(`✅ Published ${packageName()}@${version}`);
|
|
120
163
|
}
|
|
121
164
|
|
|
122
165
|
async function main() {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Runs a Grok hook from dist, or from src when a rebuild has removed dist.
|
|
4
|
+
* The hook command stays on this file, which prebuild does not delete.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
7
|
+
import { dirname, join } from 'node:path';
|
|
8
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
9
|
+
|
|
10
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const root = join(here, '..', '..');
|
|
12
|
+
|
|
13
|
+
export function resolveGrokHook(packageRoot, name) {
|
|
14
|
+
const base = String(name || '');
|
|
15
|
+
if (!base || base.includes('/') || base.includes('..') || !base.endsWith('.js')) return '';
|
|
16
|
+
const candidates = [
|
|
17
|
+
join(packageRoot, 'dist', 'integrations', 'grok', 'hooks', base),
|
|
18
|
+
join(packageRoot, 'src', 'integrations', 'grok', 'hooks', base),
|
|
19
|
+
];
|
|
20
|
+
return candidates.find((file) => existsSync(file)) || '';
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function allow() {
|
|
24
|
+
process.stdout.write('{"decision":"allow"}\n');
|
|
25
|
+
process.exit(0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function main() {
|
|
29
|
+
const name = process.argv[2];
|
|
30
|
+
const hit = resolveGrokHook(root, name);
|
|
31
|
+
if (!hit) allow();
|
|
32
|
+
const extra = process.argv.slice(3);
|
|
33
|
+
process.argv = [process.argv[0], hit, ...extra];
|
|
34
|
+
try {
|
|
35
|
+
await import(pathToFileURL(hit).href);
|
|
36
|
+
} catch {
|
|
37
|
+
allow();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function samePath(left, right) {
|
|
42
|
+
try {
|
|
43
|
+
return realpathSync(left) === realpathSync(right);
|
|
44
|
+
} catch {
|
|
45
|
+
return left === right;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const invoked = Boolean(process.argv[1]) && samePath(process.argv[1], fileURLToPath(import.meta.url));
|
|
50
|
+
if (invoked) await main();
|
|
@@ -213,6 +213,7 @@ class ConsumerReadinessCheck {
|
|
|
213
213
|
async function runPathVerification() {
|
|
214
214
|
const isConsumerEnv = process.cwd().includes('test-') ||
|
|
215
215
|
process.cwd().includes('tmp') ||
|
|
216
|
+
fs.existsSync('node_modules/0xray') ||
|
|
216
217
|
fs.existsSync('node_modules/xray');
|
|
217
218
|
|
|
218
219
|
if (isConsumerEnv) {
|
|
@@ -14,10 +14,15 @@ import { fileURLToPath } from "url";
|
|
|
14
14
|
const __filename = fileURLToPath(import.meta.url);
|
|
15
15
|
const __dirname = path.dirname(__filename);
|
|
16
16
|
|
|
17
|
+
function isInstalledPackagePath(value) {
|
|
18
|
+
const normalized = String(value).replace(/\\/g, "/");
|
|
19
|
+
return normalized.includes("node_modules/0xray") || normalized.includes("node_modules/xray");
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
class MCPFunctionalityTest {
|
|
18
23
|
constructor() {
|
|
19
24
|
this.results = { passed: [], failed: [] };
|
|
20
|
-
this.isConsumerEnvironment = __dirname
|
|
25
|
+
this.isConsumerEnvironment = isInstalledPackagePath(__dirname);
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
async testMCPFunctionality() {
|
|
@@ -95,9 +100,9 @@ class MCPFunctionalityTest {
|
|
|
95
100
|
// Determine environment: dev vs consumer vs CI
|
|
96
101
|
// - Dev: running from project root with src/ directory
|
|
97
102
|
// - CI: running from project root but building first (has dist/)
|
|
98
|
-
// - Consumer: running from node_modules/xray/
|
|
103
|
+
// - Consumer: running from node_modules/0xray/ (legacy node_modules/xray/)
|
|
99
104
|
const cwd = process.cwd();
|
|
100
|
-
const isConsumerEnv = cwd
|
|
105
|
+
const isConsumerEnv = isInstalledPackagePath(cwd);
|
|
101
106
|
const hasPackageJson = fs.existsSync(path.join(cwd, "package.json"));
|
|
102
107
|
const hasDistDir = fs.existsSync(path.join(cwd, "dist"));
|
|
103
108
|
|
|
@@ -155,16 +160,16 @@ class MCPFunctionalityTest {
|
|
|
155
160
|
if (serverPath) {
|
|
156
161
|
// Handle various path formats:
|
|
157
162
|
// - ./dist/mcps/xxx.js (local dev)
|
|
158
|
-
// - node_modules/
|
|
163
|
+
// - node_modules/0xray/dist/mcps/xxx.js (consumer; legacy node_modules/xray/)
|
|
159
164
|
// - dist/mcps/xxx.js (after stripping ./)
|
|
160
165
|
let normalizedPath = serverPath.startsWith("./")
|
|
161
166
|
? serverPath.slice(2)
|
|
162
167
|
: serverPath;
|
|
163
168
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
169
|
+
normalizedPath = normalizedPath
|
|
170
|
+
.replace(/\\/g, "/")
|
|
171
|
+
.replace("node_modules/0xray/", "")
|
|
172
|
+
.replace("node_modules/xray/", "");
|
|
168
173
|
|
|
169
174
|
// In CI/build environment, files are in cwd/dist/, not in node_modules
|
|
170
175
|
// Try local paths first, then fall back to node_modules
|
|
@@ -249,7 +254,7 @@ class MCPFunctionalityTest {
|
|
|
249
254
|
try {
|
|
250
255
|
// Determine environment - reuse same logic
|
|
251
256
|
const cwd = process.cwd();
|
|
252
|
-
const isConsumerEnv = cwd
|
|
257
|
+
const isConsumerEnv = isInstalledPackagePath(cwd);
|
|
253
258
|
const hasPackageJson = fs.existsSync(path.join(cwd, "package.json"));
|
|
254
259
|
const isDevOrCi = hasPackageJson && !isConsumerEnv;
|
|
255
260
|
|