0xray 4.0.32 → 4.0.33
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/.opencode/agents/api-design.yml +31 -0
- package/.opencode/agents/architect.yml +15 -0
- package/.opencode/agents/architecture-patterns.yml +14 -0
- package/.opencode/agents/auto-format.yml +14 -0
- package/.opencode/agents/backend-engineer.yml +12 -0
- package/.opencode/agents/boot-orchestrator.yml +14 -0
- package/.opencode/agents/bug-triage-specialist.yml +15 -0
- package/.opencode/agents/code-analyzer.yml +12 -0
- package/.opencode/agents/code-reviewer.yml +14 -0
- package/.opencode/agents/content-creator.yml +12 -0
- package/.opencode/agents/database-engineer.yml +12 -0
- package/.opencode/agents/devops-engineer.yml +12 -0
- package/.opencode/agents/framework-compliance-audit.yml +14 -0
- package/.opencode/agents/frontend-engineer.yml +12 -0
- package/.opencode/agents/frontend-ui-ux-engineer.yml +12 -0
- package/.opencode/agents/git-workflow.yml +15 -0
- package/.opencode/agents/growth-strategist.yml +12 -0
- package/.opencode/agents/hermes-agent.yml +12 -0
- package/.opencode/agents/inference-improve.yml +12 -0
- package/.opencode/agents/lint.yml +14 -0
- package/.opencode/agents/log-monitor.yml +12 -0
- package/.opencode/agents/mobile-developer.yml +12 -0
- package/.opencode/agents/model-health-check.yml +12 -0
- package/.opencode/agents/multimodal-looker.yml +12 -0
- package/.opencode/agents/performance-analysis.yml +12 -0
- package/.opencode/agents/performance-engineer.yml +12 -0
- package/.opencode/agents/performance-optimization.yml +12 -0
- package/.opencode/agents/processor-pipeline.yml +14 -0
- package/.opencode/agents/project-analysis.yml +12 -0
- package/.opencode/agents/refactorer.yml +12 -0
- package/.opencode/agents/researcher.yml +12 -0
- package/.opencode/agents/security-auditor.yml +12 -0
- package/.opencode/agents/security-scan.yml +12 -0
- package/.opencode/agents/seo-consultant.yml +12 -0
- package/.opencode/agents/session-management.yml +12 -0
- package/.opencode/agents/state-manager.yml +12 -0
- package/.opencode/agents/storyteller.yml +12 -0
- package/.opencode/agents/strategist.yml +12 -0
- package/.opencode/agents/tech-writer.yml +12 -0
- package/.opencode/agents/testing-best-practices.yml +12 -0
- package/.opencode/agents/testing-lead.yml +12 -0
- package/.opencode/agents/ui-ux-design.yml +12 -0
- package/.opencode/codex.codex +8 -0
- package/.opencode/commands/auto-format.md +99 -0
- package/.opencode/commands/auto-summary-capture.md +90 -0
- package/.opencode/commands/dependency-audit.md +184 -0
- package/.opencode/commands/enforcer-daily-scan.md +137 -0
- package/.opencode/commands/framework-compliance-audit.md +205 -0
- package/.opencode/commands/interactive-validator.md +75 -0
- package/.opencode/commands/job-summary-logger.md +68 -0
- package/.opencode/commands/lint.md +11 -0
- package/.opencode/commands/mode-switch.md +95 -0
- package/.opencode/commands/model-health-check.md +186 -0
- package/.opencode/commands/performance-analysis.md +144 -0
- package/.opencode/commands/pre-commit-introspection.md +185 -0
- package/.opencode/commands/pre-commit-introspection.sh +133 -0
- package/.opencode/commands/security-scan.md +157 -0
- package/.opencode/commands/sisyphus-validation.md +128 -0
- package/.opencode/commands/summary-logger.md +83 -0
- package/.opencode/enforcer-config.json +282 -0
- package/.opencode/skills/orchestrator/SKILL.md +3 -3
- package/.opencode/workflows/post-deployment-audit.yml +123 -0
- package/.xray/features.json +1 -1
- package/dist/CHANGELOG.md +8 -0
- package/dist/cli/goggles-status.js +1 -1
- package/dist/governance/governance-service.js +11 -1
- package/dist/integrations/grok/hooks/grok-hook-utils.js +7 -4
- package/dist/integrations/grok/hooks/pre-tool-use.js +7 -1
- package/dist/integrations/grok/hooks/session-start.js +5 -2
- package/dist/integrations/hooks/goggles-mcp.mjs +3 -36
- package/dist/integrations/hooks/goggles-pipeline.d.mts +2 -0
- package/dist/integrations/hooks/goggles-pipeline.mjs +393 -72
- package/dist/integrations/hooks/plates.cjs +15 -1
- package/dist/integrations/hooks/station-hook-runtime.cjs +53 -5
- package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/dist/mcps/orchestrator/config/agent-capabilities.js +5 -0
- package/dist/nucleus/thin-dispatch.d.ts +4 -0
- package/dist/nucleus/thin-dispatch.js +9 -1
- package/dist/skills/orchestrator/SKILL.md +3 -3
- package/package.json +1 -1
- package/scripts/foundry/mint-suit.cjs +6 -1
- package/scripts/node/install-bridges.cjs +24 -7
- package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
- package/src/mcps/orchestrator/config/agent-capabilities.ts +4 -0
- package/src/skills/orchestrator/SKILL.md +3 -3
- package/xray/features.json +1 -1
|
@@ -21,6 +21,7 @@ import { getGovernanceIntegration, } from '../integrations/governance/index.js';
|
|
|
21
21
|
import { applyDecisionMatrix, calculateMetamorphosisScore, mergeVotes, } from './governance-core.js';
|
|
22
22
|
import { frameworkLogger } from '../core/framework-logger.js';
|
|
23
23
|
import { featuresConfigLoader } from '../core/features-config.js';
|
|
24
|
+
import { lensPlane } from '../integrations/hooks/goggles-pipeline.mjs';
|
|
24
25
|
export class GovernanceService {
|
|
25
26
|
constructor() {
|
|
26
27
|
// We deliberately do *not* cache the integration here.
|
|
@@ -187,12 +188,21 @@ export class GovernanceService {
|
|
|
187
188
|
finalDecision = 'needs_revision';
|
|
188
189
|
}
|
|
189
190
|
}
|
|
191
|
+
const plane = lensPlane(`${proposal.title} ${proposal.description}`);
|
|
192
|
+
const about = [proposal.title, proposal.description, ...(proposal.evidence ?? [])].join('\n');
|
|
193
|
+
let reasoningSummary = merged.reasoningSummary;
|
|
194
|
+
if (plane.files.length > 0 &&
|
|
195
|
+
finalDecision === 'approve' &&
|
|
196
|
+
!plane.files.some((file) => about.includes(file))) {
|
|
197
|
+
finalDecision = 'needs_revision';
|
|
198
|
+
reasoningSummary = `${reasoningSummary} Not about ${plane.files[0]}.`.trim();
|
|
199
|
+
}
|
|
190
200
|
return {
|
|
191
201
|
proposalId: proposal.id,
|
|
192
202
|
finalDecision,
|
|
193
203
|
averageConfidence,
|
|
194
204
|
votes,
|
|
195
|
-
reasoningSummary
|
|
205
|
+
reasoningSummary,
|
|
196
206
|
moralOverride,
|
|
197
207
|
...(metamorphosisScore != null ? { metamorphosisScore } : {}),
|
|
198
208
|
};
|
|
@@ -330,10 +330,13 @@ export function writeSessionBoot(root, payload) {
|
|
|
330
330
|
fs.mkdirSync(stateDir, { recursive: true });
|
|
331
331
|
fs.writeFileSync(sessionBootPath(root), JSON.stringify(payload, null, 2));
|
|
332
332
|
writeStationMarkdown(root, payload);
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
333
|
+
const hook = String((payload && (payload.hookEvent || payload.source)) || "");
|
|
334
|
+
if (!/compact/i.test(hook)) {
|
|
335
|
+
try {
|
|
336
|
+
handCard(root, payload && (payload.cardText || payload.intent));
|
|
337
|
+
} catch {
|
|
338
|
+
/* a missed card must not fail the boot */
|
|
339
|
+
}
|
|
337
340
|
}
|
|
338
341
|
return sessionBootPath(root);
|
|
339
342
|
} catch {
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
workspaceRoot,
|
|
22
22
|
} from './grok-hook-utils.js';
|
|
23
23
|
import { appendHookActivity } from './grok-hook-activity.js';
|
|
24
|
-
import { cardStop } from '../../hooks/goggles-pipeline.mjs';
|
|
24
|
+
import { cardStop, lensBeforeResearch } from '../../hooks/goggles-pipeline.mjs';
|
|
25
25
|
import { createRequire } from 'node:module';
|
|
26
26
|
import { existsSync } from 'node:fs';
|
|
27
27
|
import { dirname, join } from 'node:path';
|
|
@@ -154,6 +154,12 @@ async function main() {
|
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
const spoken = [cmd, content, toolInput.pattern, toolInput.query, ...(ctx.paths || [])].filter(Boolean).join('\n');
|
|
158
|
+
const lensStop = lensBeforeResearch(eventRoot, toolName, spoken);
|
|
159
|
+
if (lensStop?.decision === 'deny') {
|
|
160
|
+
finish(eventRoot, 'deny', lensStop.reason, null, toolName, { gate: lensStop.gate });
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
const route = repertoireRoute([toolName, cmd, content].filter(Boolean).join(' '));
|
|
158
164
|
|
|
159
165
|
if (isShellTool(toolName) && cmd) {
|
|
@@ -147,11 +147,14 @@ async function main() {
|
|
|
147
147
|
: '0xray/grok-session-start';
|
|
148
148
|
|
|
149
149
|
const intent = extractIntent(event);
|
|
150
|
-
const matchedSignals =
|
|
150
|
+
const matchedSignals =
|
|
151
|
+
HOOK_EVENT === 'user_prompt_submit' ? [] : await matchStationSignals(eventRoot, intent);
|
|
152
|
+
const compact = COMPACT_EVENTS.has(HOOK_EVENT);
|
|
151
153
|
const payload = buildSessionBootPayload(eventRoot, source, {
|
|
152
154
|
hookEvent: HOOK_EVENT,
|
|
153
155
|
sessionId: event.sessionId || process.env.GROK_SESSION_ID || null,
|
|
154
|
-
...(intent ? { intent
|
|
156
|
+
...(intent ? { intent } : {}),
|
|
157
|
+
...(!compact && intent ? { cardText: intent } : {}),
|
|
155
158
|
...(matchedSignals.length ? { matchedSignals } : {}),
|
|
156
159
|
});
|
|
157
160
|
|
|
@@ -12,7 +12,6 @@ import * as bundled from './goggles-pipeline.mjs';
|
|
|
12
12
|
|
|
13
13
|
const HERE = fileURLToPath(new URL('.', import.meta.url));
|
|
14
14
|
const SERVER_NAME = 'goggles';
|
|
15
|
-
const DRAWING = /docs-site\/docs\/plates\/[a-z0-9-]+\.md/i;
|
|
16
15
|
const CARD_PLANES = [
|
|
17
16
|
'ground',
|
|
18
17
|
'routing',
|
|
@@ -105,32 +104,6 @@ function projectRoot(root) {
|
|
|
105
104
|
return process.cwd();
|
|
106
105
|
}
|
|
107
106
|
|
|
108
|
-
function heldReading(root) {
|
|
109
|
-
try {
|
|
110
|
-
const data = JSON.parse(readFileSync(join(root, '.xray', 'state', 'goggles-reading.json'), 'utf8'));
|
|
111
|
-
if (!data || typeof data !== 'object') return null;
|
|
112
|
-
if (typeof data.drift === 'string' && data.drift) return { drift: data.drift };
|
|
113
|
-
if (typeof data.plane !== 'string' || !data.plane) return null;
|
|
114
|
-
return { plane: data.plane, scope: typeof data.scope === 'string' ? data.scope : '' };
|
|
115
|
-
} catch {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
function denyCode(reason) {
|
|
121
|
-
if (/wider|crosses parts|not one flow/i.test(reason)) return 'scope_wider';
|
|
122
|
-
if (/Name one plane/i.test(reason)) return 'name_one';
|
|
123
|
-
return 'leave_plane';
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function drawingPaths(args) {
|
|
127
|
-
const hits = [];
|
|
128
|
-
for (const value of Object.values(args)) {
|
|
129
|
-
if (typeof value === 'string' && DRAWING.test(value)) hits.push(value);
|
|
130
|
-
}
|
|
131
|
-
return hits;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
107
|
function argvFrom(args) {
|
|
135
108
|
const words = [];
|
|
136
109
|
if (args.kind === '0') words.push('kind', '0');
|
|
@@ -139,7 +112,7 @@ function argvFrom(args) {
|
|
|
139
112
|
else if (typeof args.kind === 'string') words.push(args.kind);
|
|
140
113
|
if (args.outer === 'outer loop') words.push('outer', 'loop');
|
|
141
114
|
else if (typeof args.outer === 'string') words.push(args.outer);
|
|
142
|
-
if (typeof args.plane === 'string'
|
|
115
|
+
if (typeof args.plane === 'string') words.push(args.plane);
|
|
143
116
|
if (args.scope === 'one flow') words.push('one', 'flow');
|
|
144
117
|
else if (args.scope === 'one artifact') words.push('one', 'artifact');
|
|
145
118
|
else if (typeof args.scope === 'string') words.push(args.scope);
|
|
@@ -176,7 +149,7 @@ function checkArgs(args) {
|
|
|
176
149
|
if (args.scope != null && !SCOPES.includes(args.scope)) {
|
|
177
150
|
return deny('invalid_args', 'scope is one zoom level.');
|
|
178
151
|
}
|
|
179
|
-
if (args.plane != null && !CARD_PLANES.includes(args.plane)
|
|
152
|
+
if (args.plane != null && !CARD_PLANES.includes(args.plane)) {
|
|
180
153
|
return deny('invalid_args', 'plane is a card plane.');
|
|
181
154
|
}
|
|
182
155
|
return null;
|
|
@@ -225,12 +198,6 @@ export async function answerLook(raw, root) {
|
|
|
225
198
|
const api = await organApi();
|
|
226
199
|
if (!api) return deny('invalid_args', 'Goggles organ not found.');
|
|
227
200
|
const here = projectRoot(root);
|
|
228
|
-
const drawings = drawingPaths(args);
|
|
229
|
-
if (drawings.length) {
|
|
230
|
-
const stop = api.organStop(heldReading(here), { text: drawings.join('\n'), paths: drawings, tool: 'look' });
|
|
231
|
-
if (stop && stop.reason) return deny(denyCode(stop.reason), stop.reason);
|
|
232
|
-
return quiet('reading');
|
|
233
|
-
}
|
|
234
201
|
if (pureKind0(args)) {
|
|
235
202
|
api.maintainLens(here);
|
|
236
203
|
const line = api.actualityLine();
|
|
@@ -294,7 +261,7 @@ export async function answerStatus(root) {
|
|
|
294
261
|
const lens = lensBody(here);
|
|
295
262
|
let kind0 = 'none';
|
|
296
263
|
let kind0Text = '';
|
|
297
|
-
if (lens.found && !lens.text) kind0 = 'quiet';
|
|
264
|
+
if (lens.found && (!lens.text || lens.text === 'quiet (match)')) kind0 = 'quiet';
|
|
298
265
|
else if (lens.found) {
|
|
299
266
|
kind0 = 'drift';
|
|
300
267
|
kind0Text = lens.text;
|