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.
Files changed (87) hide show
  1. package/.grok-plugin/plugin.json +1 -1
  2. package/.opencode/agents/api-design.yml +31 -0
  3. package/.opencode/agents/architect.yml +15 -0
  4. package/.opencode/agents/architecture-patterns.yml +14 -0
  5. package/.opencode/agents/auto-format.yml +14 -0
  6. package/.opencode/agents/backend-engineer.yml +12 -0
  7. package/.opencode/agents/boot-orchestrator.yml +14 -0
  8. package/.opencode/agents/bug-triage-specialist.yml +15 -0
  9. package/.opencode/agents/code-analyzer.yml +12 -0
  10. package/.opencode/agents/code-reviewer.yml +14 -0
  11. package/.opencode/agents/content-creator.yml +12 -0
  12. package/.opencode/agents/database-engineer.yml +12 -0
  13. package/.opencode/agents/devops-engineer.yml +12 -0
  14. package/.opencode/agents/framework-compliance-audit.yml +14 -0
  15. package/.opencode/agents/frontend-engineer.yml +12 -0
  16. package/.opencode/agents/frontend-ui-ux-engineer.yml +12 -0
  17. package/.opencode/agents/git-workflow.yml +15 -0
  18. package/.opencode/agents/growth-strategist.yml +12 -0
  19. package/.opencode/agents/hermes-agent.yml +12 -0
  20. package/.opencode/agents/inference-improve.yml +12 -0
  21. package/.opencode/agents/lint.yml +14 -0
  22. package/.opencode/agents/log-monitor.yml +12 -0
  23. package/.opencode/agents/mobile-developer.yml +12 -0
  24. package/.opencode/agents/model-health-check.yml +12 -0
  25. package/.opencode/agents/multimodal-looker.yml +12 -0
  26. package/.opencode/agents/performance-analysis.yml +12 -0
  27. package/.opencode/agents/performance-engineer.yml +12 -0
  28. package/.opencode/agents/performance-optimization.yml +12 -0
  29. package/.opencode/agents/processor-pipeline.yml +14 -0
  30. package/.opencode/agents/project-analysis.yml +12 -0
  31. package/.opencode/agents/refactorer.yml +12 -0
  32. package/.opencode/agents/researcher.yml +12 -0
  33. package/.opencode/agents/security-auditor.yml +12 -0
  34. package/.opencode/agents/security-scan.yml +12 -0
  35. package/.opencode/agents/seo-consultant.yml +12 -0
  36. package/.opencode/agents/session-management.yml +12 -0
  37. package/.opencode/agents/state-manager.yml +12 -0
  38. package/.opencode/agents/storyteller.yml +12 -0
  39. package/.opencode/agents/strategist.yml +12 -0
  40. package/.opencode/agents/tech-writer.yml +12 -0
  41. package/.opencode/agents/testing-best-practices.yml +12 -0
  42. package/.opencode/agents/testing-lead.yml +12 -0
  43. package/.opencode/agents/ui-ux-design.yml +12 -0
  44. package/.opencode/codex.codex +8 -0
  45. package/.opencode/commands/auto-format.md +99 -0
  46. package/.opencode/commands/auto-summary-capture.md +90 -0
  47. package/.opencode/commands/dependency-audit.md +184 -0
  48. package/.opencode/commands/enforcer-daily-scan.md +137 -0
  49. package/.opencode/commands/framework-compliance-audit.md +205 -0
  50. package/.opencode/commands/interactive-validator.md +75 -0
  51. package/.opencode/commands/job-summary-logger.md +68 -0
  52. package/.opencode/commands/lint.md +11 -0
  53. package/.opencode/commands/mode-switch.md +95 -0
  54. package/.opencode/commands/model-health-check.md +186 -0
  55. package/.opencode/commands/performance-analysis.md +144 -0
  56. package/.opencode/commands/pre-commit-introspection.md +185 -0
  57. package/.opencode/commands/pre-commit-introspection.sh +133 -0
  58. package/.opencode/commands/security-scan.md +157 -0
  59. package/.opencode/commands/sisyphus-validation.md +128 -0
  60. package/.opencode/commands/summary-logger.md +83 -0
  61. package/.opencode/enforcer-config.json +282 -0
  62. package/.opencode/skills/orchestrator/SKILL.md +3 -3
  63. package/.opencode/workflows/post-deployment-audit.yml +123 -0
  64. package/.xray/features.json +1 -1
  65. package/dist/CHANGELOG.md +8 -0
  66. package/dist/cli/goggles-status.js +1 -1
  67. package/dist/governance/governance-service.js +11 -1
  68. package/dist/integrations/grok/hooks/grok-hook-utils.js +7 -4
  69. package/dist/integrations/grok/hooks/pre-tool-use.js +7 -1
  70. package/dist/integrations/grok/hooks/session-start.js +5 -2
  71. package/dist/integrations/hooks/goggles-mcp.mjs +3 -36
  72. package/dist/integrations/hooks/goggles-pipeline.d.mts +2 -0
  73. package/dist/integrations/hooks/goggles-pipeline.mjs +393 -72
  74. package/dist/integrations/hooks/plates.cjs +15 -1
  75. package/dist/integrations/hooks/station-hook-runtime.cjs +53 -5
  76. package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  77. package/dist/mcps/orchestrator/config/agent-capabilities.js +5 -0
  78. package/dist/nucleus/thin-dispatch.d.ts +4 -0
  79. package/dist/nucleus/thin-dispatch.js +9 -1
  80. package/dist/skills/orchestrator/SKILL.md +3 -3
  81. package/package.json +1 -1
  82. package/scripts/foundry/mint-suit.cjs +6 -1
  83. package/scripts/node/install-bridges.cjs +24 -7
  84. package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  85. package/src/mcps/orchestrator/config/agent-capabilities.ts +4 -0
  86. package/src/skills/orchestrator/SKILL.md +3 -3
  87. 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: merged.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
- try {
334
- handCard(root, payload && (payload.cardText || payload.intent));
335
- } catch {
336
- /* a missed card must not fail the boot */
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 = await matchStationSignals(eventRoot, intent);
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, cardText: 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' && !DRAWING.test(args.plane)) words.push(args.plane);
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) && !DRAWING.test(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;
@@ -0,0 +1,2 @@
1
+ export function suitHint(text: string): string;
2
+ export function lensPlane(text: string): { stop: boolean; files: string[] };