0xray 4.0.42 → 4.1.1

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 (138) hide show
  1. package/.gitignore.default +4 -1
  2. package/.grok-plugin/plugin.json +1 -1
  3. package/.opencode/skills/orchestrator/SKILL.md +1 -7
  4. package/.plugin/plugin.json +1 -1
  5. package/.xray/features.json +8 -5
  6. package/.xray/features.schema.json +8 -0
  7. package/AGENTS-consumer.md +9 -7
  8. package/AGENTS.md +19 -10
  9. package/LICENSE +1 -1
  10. package/README.md +15 -9
  11. package/SKILLS.md +3 -1
  12. package/dist/.gitignore.default +4 -1
  13. package/dist/AGENTS.md +19 -10
  14. package/dist/CHANGELOG.md +109 -11
  15. package/dist/LICENSE +1 -1
  16. package/dist/README.md +15 -9
  17. package/dist/SKILLS.md +3 -1
  18. package/dist/cli/commands/opencode-install.js +3 -9
  19. package/dist/cli/commands/plugin-commands.d.ts +4 -0
  20. package/dist/cli/commands/plugin-commands.js +84 -41
  21. package/dist/cli/commands/skill-install.js +10 -5
  22. package/dist/cli/goggles-status.d.ts +2 -5
  23. package/dist/cli/goggles-status.js +5 -53
  24. package/dist/cli/index.js +2 -2
  25. package/dist/core/config-loader.js +4 -4
  26. package/dist/core/features-config.d.ts +1 -1
  27. package/dist/core/features-config.js +3 -3
  28. package/dist/enforcement/enforcer-tools.d.ts +1 -1
  29. package/dist/enforcement/enforcer-tools.js +1 -1
  30. package/dist/integrations/cursor/README.md +1 -1
  31. package/dist/integrations/cursor/hooks/hooks.json +6 -3
  32. package/dist/integrations/cursor/hooks/pre-tool-use.js +104 -37
  33. package/dist/integrations/cursor/hooks/xray-cloud-hook.sh +9 -1
  34. package/dist/integrations/grok/grok-cli.js +5 -7
  35. package/dist/integrations/grok/hooks/grok-hook-utils.js +4 -1
  36. package/dist/integrations/grok/hooks/pre-tool-use.js +6 -76
  37. package/dist/integrations/grok/hooks/session-start.js +4 -2
  38. package/dist/integrations/hermes-agent/bridge.mjs +17 -1
  39. package/dist/integrations/hooks/delegation-gate-runtime.mjs +3 -2
  40. package/dist/integrations/hooks/goggles-mcp.mjs +23 -181
  41. package/dist/integrations/hooks/goggles-pipeline.mjs +606 -571
  42. package/dist/integrations/hooks/goggles-planes.json +95 -46
  43. package/dist/integrations/hooks/plates.cjs +84 -0
  44. package/dist/integrations/hooks/pre-tool-speak.mjs +74 -0
  45. package/dist/integrations/hooks/skill-seek.mjs +115 -0
  46. package/dist/integrations/hooks/station-hook-runtime.cjs +4 -1
  47. package/dist/integrations/openclaw/hooks/pre-tool-gate-runtime.mjs +24 -7
  48. package/dist/integrations/openclaw/plugin/xray-pre-tool/index.js +26 -2
  49. package/dist/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  50. package/dist/memory-routing/plates.d.ts +1 -1
  51. package/dist/memory-routing/plates.js +14 -0
  52. package/dist/monitoring/{nudge-watchdog.d.ts → nudge-monitor.d.ts} +14 -5
  53. package/dist/monitoring/{nudge-watchdog.js → nudge-monitor.js} +42 -17
  54. package/dist/nucleus/thin-dispatch.d.ts +1 -1
  55. package/dist/nucleus/thin-dispatch.js +1 -1
  56. package/dist/nucleus/work-freshness.mjs +10 -0
  57. package/dist/plugin/xray-codex-injection.js +20 -0
  58. package/dist/processors/implementations/nudge-processor.d.ts +1 -1
  59. package/dist/processors/implementations/nudge-processor.js +4 -4
  60. package/dist/skills/orchestrator/SKILL.md +1 -7
  61. package/docs-site/docs/plates/activity-log.md +1 -1
  62. package/docs-site/docs/plates/asides.md +35 -0
  63. package/docs-site/docs/plates/bifrost.md +48 -0
  64. package/docs-site/docs/plates/boot.md +2 -2
  65. package/docs-site/docs/plates/centrifuge.md +1 -1
  66. package/docs-site/docs/plates/confer.md +35 -0
  67. package/docs-site/docs/plates/consumer-mcp.md +35 -0
  68. package/docs-site/docs/plates/cursor-compact.md +1 -1
  69. package/docs-site/docs/plates/delegation-gate.md +35 -0
  70. package/docs-site/docs/plates/dynamo.md +35 -0
  71. package/docs-site/docs/plates/foundry.md +35 -0
  72. package/docs-site/docs/plates/glossary.md +7 -3
  73. package/docs-site/docs/plates/goggles.md +12 -1
  74. package/docs-site/docs/plates/governance.md +1 -1
  75. package/docs-site/docs/plates/grok-compact.md +1 -1
  76. package/docs-site/docs/plates/grokbot.md +3 -1
  77. package/docs-site/docs/plates/ground.md +35 -0
  78. package/docs-site/docs/plates/hermes.md +35 -0
  79. package/docs-site/docs/plates/host-pack.md +1 -1
  80. package/docs-site/docs/plates/house.md +1 -1
  81. package/docs-site/docs/plates/index.md +16 -7
  82. package/docs-site/docs/plates/inference-cycle.md +35 -0
  83. package/docs-site/docs/plates/inference-files.md +1 -1
  84. package/docs-site/docs/plates/kept-line.md +1 -1
  85. package/docs-site/docs/plates/kits.md +1 -1
  86. package/docs-site/docs/plates/lens-gate.md +8 -6
  87. package/docs-site/docs/plates/lens-page.md +1 -1
  88. package/docs-site/docs/plates/memory-recall.md +1 -1
  89. package/docs-site/docs/plates/notes-page.md +2 -2
  90. package/docs-site/docs/plates/openclaw.md +35 -0
  91. package/docs-site/docs/plates/opencode.md +35 -0
  92. package/docs-site/docs/plates/orchestration.md +1 -1
  93. package/docs-site/docs/plates/package-face.md +1 -1
  94. package/docs-site/docs/plates/payload-heat.md +1 -1
  95. package/docs-site/docs/plates/pickup-stamp.md +1 -1
  96. package/docs-site/docs/plates/pre-tool.md +1 -1
  97. package/docs-site/docs/plates/processor.md +1 -1
  98. package/docs-site/docs/plates/record-map.md +1 -1
  99. package/docs-site/docs/plates/reflection-page.md +1 -1
  100. package/docs-site/docs/plates/repertoire.md +35 -0
  101. package/docs-site/docs/plates/reporting.md +1 -1
  102. package/docs-site/docs/plates/review.md +1 -1
  103. package/docs-site/docs/plates/routing.md +1 -1
  104. package/docs-site/docs/plates/session-capture.md +1 -1
  105. package/docs-site/docs/plates/site-manual.md +1 -1
  106. package/docs-site/docs/plates/stamp-plate.md +1 -1
  107. package/docs-site/docs/plates/station-card.md +1 -1
  108. package/docs-site/docs/plates/station-heat.md +1 -1
  109. package/docs-site/docs/plates/suit-organs.md +1 -1
  110. package/docs-site/docs/plates/suit-settings.md +1 -1
  111. package/docs-site/docs/plates/suit-wear.md +1 -1
  112. package/docs-site/docs/plates/suit.md +3 -3
  113. package/docs-site/docs/plates/synthesis.md +35 -0
  114. package/docs-site/docs/plates/temperament.md +35 -0
  115. package/docs-site/docs/plates/trail-state.md +2 -2
  116. package/docs-site/docs/plates/work-fresh.md +1 -1
  117. package/docs-site/docs/plates/write-home.md +1 -1
  118. package/llms.txt +14 -6
  119. package/package.json +3 -3
  120. package/scripts/foundry/README.md +5 -3
  121. package/scripts/foundry/mint-suit.cjs +120 -2
  122. package/scripts/foundry/plant/skills/mill/SKILL.md +1 -1
  123. package/scripts/foundry/reconcile-version.mjs +10 -3
  124. package/scripts/foundry/release-gate.mjs +111 -15
  125. package/scripts/foundry/release.mjs +9 -1
  126. package/scripts/foundry/validate-release-docs.mjs +2 -2
  127. package/scripts/foundry/version-manager.mjs +12 -4
  128. package/scripts/mjs/verify-pipeline-facets.mjs +1 -1
  129. package/scripts/node/install-bridges.cjs +91 -46
  130. package/scripts/node/pack-tmp-suit-proof.mjs +37 -10
  131. package/src/integrations/openclaw/plugin/xray-pre-tool/index.js +26 -2
  132. package/src/integrations/openclaw/plugin/xray-pre-tool/package.json +1 -1
  133. package/src/skills/orchestrator/SKILL.md +1 -7
  134. package/vendor/@0xray/repertoire/README.md +1 -1
  135. package/xray/agents_template.md +2 -2
  136. package/xray/features.json +8 -5
  137. package/xray/features.schema.json +8 -0
  138. package/docs-site/docs/plates/live-mesh.md +0 -41
@@ -2,8 +2,8 @@
2
2
  * Goggles MCP. Stdio. Server name `goggles`.
3
3
  * Tools: look, status_lens. Same organ as the CLI.
4
4
  */
5
- import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
6
- import { basename, dirname, join, resolve } from 'node:path';
5
+ import { existsSync, readFileSync, realpathSync } from 'node:fs';
6
+ import { dirname, join, resolve } from 'node:path';
7
7
  import { pathToFileURL, fileURLToPath } from 'node:url';
8
8
  import { Server } from '@modelcontextprotocol/sdk/server/index.js';
9
9
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
@@ -12,42 +12,16 @@ 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 CARD_PLANES = [
16
- 'ground',
17
- 'routing',
18
- 'house',
19
- 'boot',
20
- 'governance',
21
- 'memory-recall',
22
- 'orchestration',
23
- 'processor',
24
- 'reporting',
25
- ];
26
- const SCOPES = ['ecosystem', 'part', 'one flow', 'one artifact'];
15
+ /** Card planes come from the organ, not a hand-kept copy. */
16
+ const CARD_PLANES = Array.isArray(bundled.CARD_PLANES) ? bundled.CARD_PLANES : [];
27
17
 
28
18
  const LOOK_SCHEMA = {
29
19
  type: 'object',
30
20
  additionalProperties: false,
31
21
  properties: {
32
- kind: {
33
- type: 'string',
34
- description: 'Optional. Use "0" or "actuality" for the lens. Omit when naming an outer.',
35
- enum: ['0', 'actuality'],
36
- },
37
- outer: {
38
- type: 'string',
39
- description: 'One outer name. digest and triage return a card. The others return a reading.',
40
- enum: ['dichotomy', 'syncopate', 'synthesis', 'digest', 'triage', 'loop'],
41
- },
42
- scope: {
43
- type: 'string',
44
- description: 'Zoom only. Not a kind. One level.',
45
- enum: SCOPES,
46
- },
47
22
  plane: {
48
23
  type: 'string',
49
- description: 'Card plane for digest or triage only. Not the lens.',
50
- enum: CARD_PLANES,
24
+ description: 'A plane, or the card for one thing. Omit it to read the current card.',
51
25
  },
52
26
  },
53
27
  };
@@ -55,12 +29,12 @@ const LOOK_SCHEMA = {
55
29
  export const TOOLS = [
56
30
  {
57
31
  name: 'look',
58
- description: 'Kind 0 is quiet on a match. It checks the six outer names. One outer is a reading. digest and triage return a card.',
32
+ description: 'The card for this plane, or for one thing on it. Entry and Exit, and the other rows, are in LENS.md. A missing plate names the stamp-plate skill.',
59
33
  inputSchema: LOOK_SCHEMA,
60
34
  },
61
35
  {
62
36
  name: 'status_lens',
63
- description: 'Whether the organ is worn, and the last Kind 0. Quiet is a match. A missing organ is not drift.',
37
+ description: 'Whether the organ is worn. A missing organ is not a card.',
64
38
  inputSchema: { type: 'object', additionalProperties: false, properties: {} },
65
39
  },
66
40
  ];
@@ -84,9 +58,6 @@ function deny(code, reason) {
84
58
  };
85
59
  }
86
60
 
87
- function quiet(mode) {
88
- return { ok: true, quiet: true, mode, content: '' };
89
- }
90
61
 
91
62
  async function organApi() {
92
63
  const override = typeof process.env.GOGGLES_ORGAN_PATH === 'string'
@@ -104,114 +75,38 @@ function projectRoot(root) {
104
75
  return process.cwd();
105
76
  }
106
77
 
107
- function argvFrom(args) {
108
- const words = [];
109
- if (args.kind === '0') words.push('kind', '0');
110
- else if (args.kind === 'actuality') words.push('actuality');
111
- else if (args.kind === '1' || args.kind === '2') words.push('kind', String(args.kind));
112
- else if (typeof args.kind === 'string') words.push(args.kind);
113
- if (args.outer === 'outer loop') words.push('outer', 'loop');
114
- else if (typeof args.outer === 'string') words.push(args.outer);
115
- if (typeof args.plane === 'string') words.push(args.plane);
116
- if (args.scope === 'one flow') words.push('one', 'flow');
117
- else if (args.scope === 'one artifact') words.push('one', 'artifact');
118
- else if (typeof args.scope === 'string') words.push(args.scope);
119
- return words;
120
- }
121
-
122
- function pureKind0(args) {
123
- return (args.kind === '0' || args.kind === 'actuality')
124
- && args.outer == null
125
- && args.plane == null
126
- && args.scope == null;
127
- }
128
-
129
78
  function checkArgs(args) {
130
79
  if (!args || typeof args !== 'object' || Array.isArray(args)) {
131
80
  return deny('invalid_args', 'look takes an object.');
132
81
  }
133
- const allowed = new Set(['kind', 'outer', 'scope', 'plane']);
82
+ const allowed = new Set(['plane']);
134
83
  for (const key of Object.keys(args)) {
135
84
  if (!allowed.has(key)) return deny('invalid_args', 'Unknown argument.');
136
85
  }
137
- for (const key of ['kind', 'outer', 'scope', 'plane']) {
138
- if (args[key] != null && typeof args[key] !== 'string') {
139
- return deny('invalid_args', `${key} must be a string.`);
140
- }
141
- }
142
- if (args.kind != null && !['0', 'actuality', '1', '2'].includes(args.kind)) {
143
- return deny('invalid_args', 'kind is 0 or actuality.');
144
- }
145
- if (args.outer != null && !LOOK_SCHEMA.properties.outer.enum.includes(args.outer)) {
146
- const setName = args.outer === 'outer' || args.outer === 'outer-loop' || args.outer === 'outer loop';
147
- if (!setName) return deny('invalid_args', 'Name one outer.');
148
- }
149
- if (args.scope != null && !SCOPES.includes(args.scope)) {
150
- return deny('invalid_args', 'scope is one zoom level.');
151
- }
152
- if (args.plane != null && !CARD_PLANES.includes(args.plane)) {
153
- return deny('invalid_args', 'plane is a card plane.');
154
- }
86
+ if (args.plane == null) return null;
87
+ if (typeof args.plane !== 'string') return deny('invalid_args', 'plane must be a string.');
88
+ if (typeof bundled.isCardName !== 'function' || !bundled.isCardName(args.plane)) return deny('invalid_args', 'Name one plane.');
155
89
  return null;
156
90
  }
157
91
 
158
92
  function publicCard(view) {
159
93
  const notes = [];
160
- if (view.flavor === 'triage') {
161
- if (Array.isArray(view.empty) && view.empty.length) notes.push(`Empty: ${view.empty.join(', ')}`);
162
- if (view.exam) notes.push(view.exam);
163
- }
164
- const skills = view.skills ? basename(String(view.skills)) : '';
165
- const cascade = view.cascade
166
- ? {
167
- plane: view.cascade.plane,
168
- station: view.cascade.station,
169
- notesPage: view.cascade.notesPage,
170
- index: view.cascade.index,
171
- laws: Array.isArray(view.cascade.laws) ? view.cascade.laws : [],
172
- notes: Array.isArray(view.cascade.notes) ? view.cascade.notes : [],
173
- }
174
- : null;
175
- const sleeve = view.sleeve
176
- ? {
177
- on: Boolean(view.sleeve.on),
178
- missing: Array.isArray(view.sleeve.missing) ? view.sleeve.missing : [],
179
- stitches: Array.isArray(view.sleeve.stitches)
180
- ? view.sleeve.stitches.map((row) => ({
181
- name: String(row && row.name || ''),
182
- on: Boolean(row && row.on),
183
- at: Array.isArray(row && row.at) ? row.at.map((item) => String(item)) : [],
184
- }))
185
- : [],
186
- }
187
- : null;
188
- if (view.narrow) {
189
- return {
190
- plane: view.plane,
191
- flavor: view.flavor,
192
- digest: view.digest || '',
193
- files: Array.isArray(view.files) ? view.files : [],
194
- notes,
195
- ...(cascade ? { cascade } : {}),
196
- ...(sleeve ? { sleeve } : {}),
197
- };
198
- }
94
+ if (typeof view.exam === 'string' && view.exam.startsWith('Drift:')) notes.push(view.exam);
199
95
  return {
200
96
  plane: view.plane,
201
- flavor: view.flavor,
202
97
  from: view.from || '',
203
98
  digest: view.digest || '',
204
99
  plate: view.plate || '',
205
100
  entry: view.entry || '',
206
101
  exit: view.exit || '',
207
102
  files: Array.isArray(view.files) ? view.files : [],
208
- skills,
103
+ skills: view.skills ? String(view.skills) : '',
209
104
  setup: view.setup || '',
210
105
  teardown: view.teardown || '',
211
106
  worn: view.worn || '',
107
+ card: view.card || view.plane || '',
108
+ stamp: view.stamp || '',
212
109
  notes,
213
- ...(cascade ? { cascade } : {}),
214
- ...(sleeve ? { sleeve } : {}),
215
110
  };
216
111
  }
217
112
 
@@ -225,60 +120,24 @@ export async function answerLook(raw, root) {
225
120
  const api = await organApi();
226
121
  if (!api) return deny('invalid_args', 'Goggles organ not found.');
227
122
  const here = projectRoot(root);
228
- if (pureKind0(args)) {
229
- api.maintainLens(here);
230
- const line = api.actualityLine();
231
- if (!line) return quiet('kind0');
232
- return { ok: true, quiet: false, mode: 'kind0', content: line };
233
- }
234
- const argv = argvFrom(args);
123
+ const argv = args.plane == null ? [] : [args.plane];
235
124
  const text = api.look(argv, here).text;
236
125
  if (text === 'Name one plane.') return deny('name_one', 'Name one plane.');
237
126
  const cards = api.lookCards(argv, here);
238
- if (Array.isArray(cards) && cards.length) {
239
- const shown = cards.map(publicCard);
240
- if (shown.length === 1 && shown[0] && typeof shown[0].plane === 'string') {
241
- const dest = join(here, '.xray', 'state', 'goggles-plane.json');
242
- mkdirSync(dirname(dest), { recursive: true });
243
- writeFileSync(dest, `${JSON.stringify({ plane: shown[0].plane })}\n`);
244
- }
245
- return {
246
- ok: true,
247
- quiet: false,
248
- mode: 'card',
249
- content: shown.length === 1 ? shown[0] : shown,
250
- outer: args.outer,
251
- scope: args.scope || null,
252
- };
253
- }
254
- if (!text) {
255
- if (args.kind === '0' || args.kind === 'actuality') return quiet('kind0');
256
- if (args.outer === 'digest' || args.outer === 'triage') return quiet('card');
257
- return quiet('reading');
258
- }
259
- if (text.startsWith('Actuality. Drift:')) {
260
- return { ok: true, quiet: false, mode: 'kind0', content: text };
127
+ if (!Array.isArray(cards) || !cards.length) return deny('name_one', 'Name one plane.');
128
+ const shown = cards.map(publicCard);
129
+ if (shown.length === 1 && shown[0]) {
130
+ const heldName = shown[0].card || shown[0].plane;
131
+ if (heldName) api.holdPlane(here, heldName);
261
132
  }
262
133
  return {
263
134
  ok: true,
264
135
  quiet: false,
265
- mode: 'reading',
266
- content: text,
267
- outer: args.outer ?? null,
268
- scope: args.scope || null,
136
+ mode: 'card',
137
+ content: shown.length === 1 ? shown[0] : shown,
269
138
  };
270
139
  }
271
140
 
272
- function lensBody(root) {
273
- const file = join(root, '.xray', 'state', 'LENS.md');
274
- if (!existsSync(file)) return { found: false, text: '' };
275
- try {
276
- return { found: true, text: readFileSync(file, 'utf8').trim() };
277
- } catch {
278
- return { found: false, text: '' };
279
- }
280
- }
281
-
282
141
  export async function answerStatus(root) {
283
142
  const api = await organApi();
284
143
  const override = typeof process.env.GOGGLES_ORGAN_PATH === 'string'
@@ -289,28 +148,11 @@ export async function answerStatus(root) {
289
148
  const organOk = existsSync(organPath);
290
149
  const planesOk = Boolean(planesPath) && existsSync(planesPath);
291
150
  const worn = Boolean(api) && organOk && planesOk;
292
- const here = projectRoot(root);
293
- const lens = lensBody(here);
294
- let kind0 = 'none';
295
- let kind0Text = '';
296
- if (lens.found && (!lens.text || lens.text === 'quiet (match)')) kind0 = 'quiet';
297
- else if (lens.found) {
298
- kind0 = 'drift';
299
- kind0Text = lens.text;
300
- } else if (worn) {
301
- const line = api.actualityLine();
302
- if (line) {
303
- kind0 = 'drift';
304
- kind0Text = line;
305
- }
306
- }
307
151
  return {
308
152
  ok: true,
309
153
  organ: worn ? 'worn' : 'not_found',
310
154
  organPath: organOk ? organPath : '',
311
155
  planesPath: planesOk ? planesPath : '',
312
- kind0,
313
- kind0Text,
314
156
  lensPath: '.xray/state/LENS.md',
315
157
  };
316
158
  }