sneakoscope 4.2.1 → 4.4.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.
Files changed (34) hide show
  1. package/README.md +7 -6
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/crates/sks-core/src/main.rs +1 -1
  5. package/dist/bin/sks.js +1 -1
  6. package/dist/cli/command-registry.js +2 -1
  7. package/dist/cli/ultra-search-command.js +163 -0
  8. package/dist/cli/xai-command.js +28 -168
  9. package/dist/core/agents/agent-codex-cockpit.js +3 -3
  10. package/dist/core/agents/agent-wrongness.js +1 -1
  11. package/dist/core/fsx.js +1 -1
  12. package/dist/core/release-parallel-full-coverage.js +1 -1
  13. package/dist/core/routes.js +3 -2
  14. package/dist/core/source-intelligence/source-intelligence-policy.js +45 -26
  15. package/dist/core/source-intelligence/source-intelligence-proof.js +10 -16
  16. package/dist/core/source-intelligence/source-intelligence-runner.js +56 -42
  17. package/dist/core/trust-kernel/trust-report.js +3 -5
  18. package/dist/core/ultra-search/index.js +3 -0
  19. package/dist/core/ultra-search/runtime.js +502 -0
  20. package/dist/core/ultra-search/types.js +3 -0
  21. package/dist/core/version.js +1 -1
  22. package/dist/scripts/agent-visual-consistency-check.js +1 -1
  23. package/dist/scripts/release-metadata-1-19-check.js +2 -2
  24. package/dist/scripts/release-parallel-check.js +2 -2
  25. package/dist/scripts/release-parallel-full-coverage-check.js +1 -1
  26. package/dist/scripts/release-readiness-report.js +6 -6
  27. package/dist/scripts/sks-1-18-gate-lib.js +2 -2
  28. package/dist/scripts/source-intelligence-all-modes-check.js +9 -19
  29. package/dist/scripts/source-intelligence-policy-check.js +6 -6
  30. package/dist/scripts/ultra-search-provider-interface-check.js +27 -0
  31. package/package.json +2 -2
  32. package/dist/core/mcp/xai-mcp-detector.js +0 -157
  33. package/dist/core/mcp/xai-search-adapter.js +0 -100
  34. package/dist/scripts/xai-mcp-capability-check.js +0 -14
package/README.md CHANGED
@@ -11,6 +11,8 @@
11
11
 
12
12
  `npm i -g sneakoscope` → `sks --mad` → watch up to **100 shadow-clone workers** code in parallel,<br/>each in a live Zellij pane, every claim backed by Completion Proof.
13
13
 
14
+ Current package release: **4.4.0**.
15
+
14
16
  </div>
15
17
 
16
18
  ---
@@ -182,13 +184,12 @@ Change-aware release checks live behind `npm run release:check`; publish-authori
182
184
 
183
185
  - **Image generation under codex-lb.** `gpt-image-2` routes through the same Codex `/responses` backend the load balancer already proxies, so `$imagegen` works when you are authenticated only through codex-lb (no direct `OPENAI_API_KEY`). The official Codex App `$imagegen` surface stays primary; the codex-lb/OpenAI API path is the fallback. Opt out with `SKS_IMAGEGEN_ALLOW_CODEX_LB_API_FALLBACK=0`.
184
186
 
185
- - **xAI / Grok search.** Wire xAI Live Search into source intelligence as an MCP provider:
187
+ - **UltraSearch source intelligence.** Run provider-independent source acquisition without requiring xAI/Grok credentials:
186
188
 
187
189
  ```bash
188
- sks xai check
189
- sks xai setup --scope project --command "npx" --arg "-y" --arg "<your-grok-search-mcp>"
190
- export XAI_API_KEY=xai-...
191
- sks xai docs
190
+ sks ultra-search doctor
191
+ sks ultra-search run "current package release notes" --mode balanced
192
+ sks ultra-search x "site:x.com product launch"
192
193
  ```
193
194
 
194
195
  - **CLI-only SKS update notices.** Codex App hooks no longer stop normal work to ask for an SKS update. CLI launch surfaces such as `sks --mad` print a non-blocking latest-version notice, `sks update-check` / `sks update check` show the explicit status, and `sks doctor --fix` runs the guarded global SKS update path before repair.
@@ -274,7 +275,7 @@ The cleanup contract is policy-backed in `.sneakoscope/policy.json`, but the def
274
275
  - Codex App Hooks/PAT: [docs/hooks-pat.md](docs/hooks-pat.md)
275
276
  - codex-lb: [docs/codex-lb.md](docs/codex-lb.md)
276
277
  - Source Intelligence Layer: [docs/source-intelligence-layer.md](docs/source-intelligence-layer.md)
277
- - X AI / Context7 / Codex Web policy: [docs/xai-context7-codex-web-policy.md](docs/xai-context7-codex-web-policy.md)
278
+ - UltraSearch / Context7 / Codex Web policy: [docs/ultra-search-source-intelligence-policy.md](docs/ultra-search-source-intelligence-policy.md)
278
279
  - Main no-Scout / worker Scout policy: [docs/main-no-scout-worker-scout-policy.md](docs/main-no-scout-worker-scout-policy.md)
279
280
  - Real Codex dynamic smoke: [docs/real-codex-dynamic-smoke.md](docs/real-codex-dynamic-smoke.md)
280
281
  - Appshots pipeline: [docs/appshots-pipeline.md](docs/appshots-pipeline.md)
@@ -76,7 +76,7 @@ dependencies = [
76
76
 
77
77
  [[package]]
78
78
  name = "sks-core"
79
- version = "4.2.1"
79
+ version = "4.4.0"
80
80
  dependencies = [
81
81
  "serde_json",
82
82
  ]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "4.2.1"
3
+ version = "4.4.0"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
4
4
  fn main() {
5
5
  let mut args = std::env::args().skip(1);
6
6
  match args.next().as_deref() {
7
- Some("--version") => println!("sks-rs 4.2.1"),
7
+ Some("--version") => println!("sks-rs 4.4.0"),
8
8
  Some("compact-info") => {
9
9
  let mut input = String::new();
10
10
  let _ = io::stdin().read_to_string(&mut input);
package/dist/bin/sks.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const FAST_PACKAGE_VERSION = '4.2.1';
2
+ const FAST_PACKAGE_VERSION = '4.4.0';
3
3
  const args = process.argv.slice(2);
4
4
  try {
5
5
  if (args[0] === '--agent' && args[1] === 'worker') {
@@ -132,7 +132,8 @@ export const COMMANDS = {
132
132
  'image-ux-review': entry('labs', 'Inspect image UX artifacts', 'dist/core/commands/image-ux-review-command.js', commandArgsCommand(() => import('../core/commands/image-ux-review-command.js'), 'imageUxReviewCommand', 'dist/core/commands/image-ux-review-command.js')),
133
133
  'computer-use': entry('beta', 'Record native Mac/non-web Computer Use visual evidence', 'dist/core/commands/computer-use-command.js', commandArgsCommand(() => import('../core/commands/computer-use-command.js'), 'computerUseCommand', 'dist/core/commands/computer-use-command.js')),
134
134
  context7: entry('beta', 'Context7 checks and docs', 'dist/cli/context7-command.js', subcommand(() => import('./context7-command.js'), 'context7Command', 'dist/cli/context7-command.js', 'check')),
135
- xai: entry('beta', 'Set up and check xAI/Grok search MCP integration', 'dist/cli/xai-command.js', subcommand(() => import('./xai-command.js'), 'xaiCommand', 'dist/cli/xai-command.js', 'check')),
135
+ 'ultra-search': entry('beta', 'Run provider-independent UltraSearch source intelligence', 'dist/cli/ultra-search-command.js', subcommand(() => import('./ultra-search-command.js'), 'ultraSearchCommand', 'dist/cli/ultra-search-command.js', 'doctor')),
136
+ xai: entry('beta', 'Deprecated compatibility notice for removed xAI/Grok setup', 'dist/cli/xai-command.js', subcommand(() => import('./xai-command.js'), 'xaiCommand', 'dist/cli/xai-command.js', 'check')),
136
137
  recallpulse: entry('labs', 'RecallPulse evidence route', 'dist/commands/recallpulse.js', directCommand(() => import('../commands/recallpulse.js'), 'dist/commands/recallpulse.js')),
137
138
  pipeline: entry('beta', 'Inspect pipeline missions', 'dist/commands/pipeline.js', directCommand(() => import('../commands/pipeline.js'), 'dist/commands/pipeline.js')),
138
139
  guard: entry('beta', 'Check harness guard', 'dist/commands/guard.js', directCommand(() => import('../commands/guard.js'), 'dist/commands/guard.js')),
@@ -0,0 +1,163 @@
1
+ import fs from 'node:fs/promises';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { runUltraSearch } from '../core/ultra-search/index.js';
5
+ export async function ultraSearchCommand(sub = 'help', args = []) {
6
+ const action = sub || 'help';
7
+ if (action === 'run')
8
+ return runCommand(args);
9
+ if (action === 'x')
10
+ return runCommand(['--mode', 'x_search', ...args]);
11
+ if (action === 'fetch')
12
+ return runCommand(['--mode', 'url_acquisition', ...args]);
13
+ if (action === 'doctor')
14
+ return doctorCommand(args);
15
+ if (action === 'status' || action === 'inspect' || action === 'sources' || action === 'claims')
16
+ return inspectCommand(action, args);
17
+ if (action === 'cache')
18
+ return cacheCommand(args);
19
+ if (action === 'bench')
20
+ return benchCommand(args);
21
+ if (action === 'migrate-xai')
22
+ return migrateXaiCommand(args);
23
+ return helpCommand();
24
+ }
25
+ async function runCommand(args) {
26
+ const json = args.includes('--json');
27
+ const mode = readOption(args, '--mode');
28
+ const query = positional(args).join(' ').trim();
29
+ if (!query)
30
+ throw new Error('Usage: sks ultra-search run "<query>" [--mode fast|balanced|deep|exhaustive|x_search|url_acquisition] [--json]');
31
+ const missionDir = await mkMissionDir();
32
+ const result = await runUltraSearch({
33
+ missionDir,
34
+ query,
35
+ ...(mode ? { mode } : {})
36
+ });
37
+ if (json)
38
+ console.log(JSON.stringify(result, null, 2));
39
+ else {
40
+ console.log(`UltraSearch ${result.ok ? 'completed' : 'partial/blocked'}: ${result.mode}`);
41
+ console.log(`Mission: ${missionDir}`);
42
+ console.log(`Sources: ${result.sources.length}, verified: ${result.proof.verified_source_count}`);
43
+ if (result.blockers.length)
44
+ console.log(`Blockers: ${result.blockers.join(', ')}`);
45
+ }
46
+ return result;
47
+ }
48
+ async function doctorCommand(args) {
49
+ const json = args.includes('--json');
50
+ const report = {
51
+ schema: 'sks.ultra-search-doctor.v1',
52
+ ok: true,
53
+ core_ready: true,
54
+ xai_required: false,
55
+ optional: {
56
+ context7: 'external_runtime_optional_by_intent',
57
+ codex_web: process.env.SKS_CODEX_WEB_SEARCH_AVAILABLE === '1' || process.env.CODEX_WEB_SEARCH_AVAILABLE === '1' ? 'available' : 'not_bound',
58
+ authenticated_chrome: 'operator_consented_optional',
59
+ official_x_api: 'credentials_optional_not_required'
60
+ },
61
+ blockers: [],
62
+ warnings: []
63
+ };
64
+ if (json)
65
+ console.log(JSON.stringify(report, null, 2));
66
+ else
67
+ console.log('UltraSearch doctor: core ready; xAI/Grok is not required.');
68
+ return report;
69
+ }
70
+ async function inspectCommand(action, args) {
71
+ const json = args.includes('--json');
72
+ const mission = positional(args)[0] || 'latest';
73
+ const target = mission === 'latest' ? await latestMissionDir() : mission;
74
+ const file = path.join(target, 'ultra-search', action === 'sources' ? 'source-ledger.json' : action === 'claims' ? 'claim-ledger.json' : 'ultra-search-result.json');
75
+ const text = await fs.readFile(file, 'utf8');
76
+ if (json)
77
+ console.log(text.trim());
78
+ else
79
+ console.log(text);
80
+ return JSON.parse(text);
81
+ }
82
+ async function cacheCommand(args) {
83
+ const sub = positional(args)[0] || 'status';
84
+ const report = { schema: 'sks.ultra-search-cache.v1', ok: true, action: sub, local_only: true };
85
+ console.log(JSON.stringify(report, null, 2));
86
+ return report;
87
+ }
88
+ async function benchCommand(args) {
89
+ const report = {
90
+ schema: 'sks.ultra-search-bench.v1',
91
+ ok: false,
92
+ suite: readOption(args, '--suite') || 'all',
93
+ status: 'real_benchmark_not_run',
94
+ blockers: ['real_web_or_x_parity_corpus_required']
95
+ };
96
+ console.log(JSON.stringify(report, null, 2));
97
+ return report;
98
+ }
99
+ async function migrateXaiCommand(args) {
100
+ const apply = args.includes('--apply');
101
+ const report = {
102
+ schema: apply ? 'sks.ultra-search-xai-migration-result.v1' : 'sks.ultra-search-xai-migration-plan.v1',
103
+ ok: true,
104
+ applied: false,
105
+ managed_candidates: [],
106
+ unowned_preserved: true,
107
+ note: 'No automatic MCP config deletion is performed without an owned managed marker and explicit --apply.'
108
+ };
109
+ console.log(JSON.stringify(report, null, 2));
110
+ return report;
111
+ }
112
+ function helpCommand() {
113
+ console.log([
114
+ 'Usage:',
115
+ ' sks ultra-search doctor [--json]',
116
+ ' sks ultra-search run "<query>" [--mode fast|balanced|deep|exhaustive]',
117
+ ' sks ultra-search x "<query>"',
118
+ ' sks ultra-search fetch "<url>"',
119
+ ' sks ultra-search status|inspect|sources|claims <mission|latest>',
120
+ ' sks ultra-search cache status|prune|clear',
121
+ ' sks ultra-search bench [--suite all|x|web|docs|blocked]',
122
+ ' sks ultra-search migrate-xai [--apply]'
123
+ ].join('\n'));
124
+ return { ok: true, status: 'help' };
125
+ }
126
+ function readOption(args, flag) {
127
+ const index = args.indexOf(flag);
128
+ const value = index >= 0 ? args[index + 1] : undefined;
129
+ return value || null;
130
+ }
131
+ function positional(args) {
132
+ const out = [];
133
+ for (let i = 0; i < args.length; i++) {
134
+ const value = args[i];
135
+ if (!value)
136
+ continue;
137
+ if (value.startsWith('--')) {
138
+ if (value !== '--json')
139
+ i++;
140
+ continue;
141
+ }
142
+ out.push(value);
143
+ }
144
+ return out;
145
+ }
146
+ async function mkMissionDir() {
147
+ const dir = path.join(process.cwd(), '.sneakoscope', 'missions', `ultra-${Date.now().toString(36)}`);
148
+ await fs.mkdir(dir, { recursive: true });
149
+ return dir;
150
+ }
151
+ async function latestMissionDir() {
152
+ const root = path.join(process.cwd(), '.sneakoscope', 'missions');
153
+ const entries = await fs.readdir(root, { withFileTypes: true }).catch(() => []);
154
+ const dirs = entries.filter((entry) => entry.isDirectory()).map((entry) => path.join(root, entry.name)).sort();
155
+ const latest = dirs.reverse().find(asyncDirLikelyUltra);
156
+ if (!latest)
157
+ return path.join(os.tmpdir(), 'sks-ultra-search-missing');
158
+ return latest;
159
+ }
160
+ function asyncDirLikelyUltra(dir) {
161
+ return Boolean(dir);
162
+ }
163
+ //# sourceMappingURL=ultra-search-command.js.map
@@ -1,175 +1,35 @@
1
- import path from 'node:path';
2
- import { ensureDir, projectRoot, readText, runProcess, sksRoot, writeTextAtomic } from '../core/fsx.js';
3
- import { getCodexInfo } from '../core/codex-adapter.js';
4
- import { detectXaiMcp } from '../core/mcp/xai-mcp-detector.js';
5
- // `sks xai` — wire up xAI/Grok web search (Live Search) as a Codex MCP server so
6
- // SKS source-intelligence can fan out to Grok alongside Context7 and Codex web
7
- // search. SKS detects xAI via an MCP server whose name matches xai/grok/x-ai and
8
- // that exposes a search/web/query tool (see core/mcp/xai-mcp-detector.ts), so
9
- // `setup` registers that MCP server and points the operator at XAI_API_KEY.
10
- //
11
- // xAI reference (https://api.x.ai/v1): OpenAI-compatible Responses API with the
12
- // `web_search` / `x_search` tools, model family `grok-4.x`, auth via XAI_API_KEY.
13
- const XAI_DOCS_URL = 'https://docs.x.ai/developers/tools/web-search';
14
- const XAI_API_BASE = 'https://api.x.ai/v1';
15
- const DEFAULT_SERVER_NAME = 'grok-search';
16
- const flag = (args, name) => args.includes(name);
17
1
  export async function xaiCommand(sub = 'check', args = []) {
2
+ const json = args.includes('--json');
18
3
  const action = sub || 'check';
19
- if (action === 'check' || action === 'status')
20
- return xaiCheck(args);
21
- if (action === 'setup')
22
- return xaiSetup(args);
23
- if (action === 'docs' || action === 'help' || action === '--help' || action === '-h')
24
- return xaiDocs(args);
25
- throw new Error(`Unknown xai command: ${action}. Use: sks xai check | setup | status | docs`);
26
- }
27
- async function xaiCheck(args) {
28
- const root = await projectRoot().catch(() => process.cwd());
29
- const detection = await detectXaiMcp({ root });
30
- if (flag(args, '--json'))
31
- return console.log(JSON.stringify(detection, null, 2));
32
- console.log('SKS xAI / Grok search MCP\n');
33
- console.log(`Status: ${describeStatus(detection.status)}`);
34
- console.log(`Configured: ${detection.configured ? 'yes' : 'no'}`);
35
- console.log(`Search-capable: ${detection.search_capable ? 'yes' : detection.configured_but_unverified ? 'configured (tools unverified at runtime)' : 'no'}`);
36
- if (detection.servers.length) {
37
- for (const server of detection.servers) {
38
- console.log(` • ${server.raw_name} (${server.source})${server.tools.length ? ` tools: ${server.tools.join(', ')}` : ''}`);
39
- }
40
- }
41
- console.log(`Checked: ${detection.config_paths_checked.join(', ') || 'none'}`);
42
- if (!detection.configured) {
43
- console.log('\nNot configured. Run: sks xai setup --scope project --command "<your-xai-mcp-server>"');
44
- console.log('Then export your key: export XAI_API_KEY=xai-...');
45
- console.log(`Docs: ${XAI_DOCS_URL}`);
46
- }
47
- else if (detection.status === 'configured_but_unverified') {
48
- console.log('\nServer is registered; tool capability is verified when Codex lists its tools at runtime.');
49
- }
50
- }
51
- async function xaiSetup(args) {
52
- const scope = readOption(args, '--scope', flag(args, '--global') ? 'global' : 'project');
53
- if (!['project', 'global'].includes(scope))
54
- throw new Error('Invalid xAI scope. Use --scope project or --scope global.');
55
- const name = sanitizeServerName(readOption(args, '--name', DEFAULT_SERVER_NAME));
56
- const url = readOption(args, '--url', null);
57
- const command = readOption(args, '--command', null);
58
- const commandArgs = readRepeatedOption(args, '--arg');
59
- const envKey = readOption(args, '--api-key-env', 'XAI_API_KEY');
60
- if (!url && !command) {
61
- // Nothing to install yet: print a ready-to-paste config + the exact next steps
62
- // instead of writing a broken/guessed server entry.
63
- printSetupGuidance(scope, name, envKey);
64
- return;
65
- }
66
- if (scope === 'global') {
67
- const codex = await getCodexInfo();
68
- if (!codex.bin)
69
- throw new Error('Codex CLI missing. Install @openai/codex or set SKS_CODEX_BIN, then re-run.');
70
- const cmdArgs = url
71
- ? ['mcp', 'add', name, '--url', url]
72
- : ['mcp', 'add', name, '--', command, ...commandArgs];
73
- const result = await runProcess(codex.bin, cmdArgs, { timeoutMs: 30000, maxOutputBytes: 64 * 1024 });
74
- if (flag(args, '--json'))
75
- return console.log(JSON.stringify({ scope, name, command: `${codex.bin} ${cmdArgs.join(' ')}`, result }, null, 2));
76
- if (result.code !== 0)
77
- throw new Error(result.stderr || result.stdout || 'codex mcp add failed');
78
- console.log(`xAI/Grok MCP "${name}" registered globally.`);
79
- console.log(`Set your key: export ${envKey}=xai-... (docs: ${XAI_DOCS_URL})`);
80
- return;
81
- }
82
- const root = await projectRoot().catch(() => sksRoot());
83
- const changed = await ensureProjectXaiMcpConfig(root, { name, url, command, commandArgs, envKey });
84
- const detection = await detectXaiMcp({ root });
85
- if (flag(args, '--json'))
86
- return console.log(JSON.stringify({ scope, name, changed, detection }, null, 2));
87
- console.log(`xAI/Grok MCP "${name}" ${changed ? 'configured' : 'already configured'} in .codex/config.toml`);
88
- console.log(`Detected: ${detection.configured ? 'yes' : 'no'} (${detection.status})`);
89
- console.log(`Set your key: export ${envKey}=xai-... (docs: ${XAI_DOCS_URL})`);
90
- }
91
- async function xaiDocs(_args) {
92
- console.log('SKS xAI / Grok search integration\n');
93
- console.log(`API base: ${XAI_API_BASE}`);
94
- console.log('Auth: XAI_API_KEY (Bearer)');
95
- console.log('Model: grok-4.x (OpenAI-compatible Responses API)');
96
- console.log('Tools: web_search, x_search (agentic Live Search)');
97
- console.log(`Reference: ${XAI_DOCS_URL}\n`);
98
- console.log('Wire it into SKS source-intelligence with an MCP server:');
99
- console.log(' sks xai setup --scope project --command "npx" --arg "-y" --arg "<your-grok-search-mcp>"');
100
- console.log(' sks xai setup --scope global --url "https://<your-grok-mcp-endpoint>"');
101
- console.log(' export XAI_API_KEY=xai-...');
102
- console.log(' sks xai check');
103
- }
104
- function printSetupGuidance(scope, name, envKey) {
105
- console.log('SKS xAI / Grok search setup\n');
106
- console.log('Specify the MCP server to register. Examples:');
107
- console.log(` sks xai setup --scope ${scope} --command "npx" --arg "-y" --arg "<your-grok-search-mcp>"`);
108
- console.log(` sks xai setup --scope ${scope} --url "https://<your-grok-mcp-endpoint>"`);
109
- console.log('\nReady-to-paste .codex/config.toml block (edit command/args for your server):\n');
110
- console.log(xaiMcpToml({ name, command: 'npx', commandArgs: ['-y', '<your-grok-search-mcp>'], envKey }).trim());
111
- console.log(`\nThen set your key: export ${envKey}=xai-...`);
112
- console.log(`Docs: ${XAI_DOCS_URL}`);
113
- }
114
- export function xaiMcpToml(opts) {
115
- const name = sanitizeServerName(opts.name || DEFAULT_SERVER_NAME);
116
- const envKey = opts.envKey || 'XAI_API_KEY';
117
- const lines = [`[mcp_servers.${name}]`];
118
- if (opts.url) {
119
- lines.push(`url = ${JSON.stringify(opts.url)}`);
120
- }
4
+ const result = {
5
+ schema: 'sks.xai-compat.v1',
6
+ ok: action !== 'setup',
7
+ status: 'deprecated',
8
+ action,
9
+ setup_performed: false,
10
+ xai_required: false,
11
+ replacement: {
12
+ doctor: 'sks ultra-search doctor',
13
+ x_search: 'sks ultra-search x "<query>"',
14
+ migration: 'sks ultra-search migrate-xai [--apply]'
15
+ },
16
+ blockers: action === 'setup' ? ['xai_setup_removed_use_ultra_search'] : [],
17
+ warnings: ['sks_xai_is_deprecated_and_does_not_configure_mcp_or_require_XAI_API_KEY']
18
+ };
19
+ if (json)
20
+ console.log(JSON.stringify(result, null, 2));
121
21
  else {
122
- lines.push(`command = ${JSON.stringify(opts.command || 'npx')}`);
123
- const argv = (opts.commandArgs && opts.commandArgs.length) ? opts.commandArgs : ['-y', '<your-grok-search-mcp>'];
124
- lines.push(`args = [${argv.map((a) => JSON.stringify(a)).join(', ')}]`);
125
- }
126
- lines.push(`env = { ${envKey} = ${JSON.stringify(`\${${envKey}}`)} }`);
127
- lines.push('');
128
- return lines.join('\n');
129
- }
130
- async function ensureProjectXaiMcpConfig(root, opts) {
131
- const configPath = path.join(root, '.codex', 'config.toml');
132
- await ensureDir(path.dirname(configPath));
133
- const current = await readText(configPath, '');
134
- const block = xaiMcpToml(opts).trim();
135
- const existingRe = new RegExp(`(^|\\n)\\[mcp_servers\\.${escapeRegExp(opts.name)}\\]\\n[\\s\\S]*?(?=\\n\\[[^\\]]+\\]|\\s*$)`);
136
- if (existingRe.test(current)) {
137
- const next = current.replace(existingRe, `$1${block}\n`);
138
- if (next === current)
139
- return false;
140
- await writeTextAtomic(configPath, next.endsWith('\n') ? next : `${next}\n`);
141
- return true;
142
- }
143
- const text = String(current);
144
- await writeTextAtomic(configPath, `${text.trimEnd()}${text.trim() ? '\n\n' : ''}${block}\n`);
145
- return true;
146
- }
147
- function describeStatus(status) {
148
- switch (status) {
149
- case 'search_capable': return 'search-capable (ready)';
150
- case 'configured_but_unverified': return 'configured (verify tools at runtime)';
151
- case 'configured_no_search': return 'configured but no search tool detected';
152
- case 'missing': return 'not configured';
153
- default: return status;
154
- }
155
- }
156
- function sanitizeServerName(value) {
157
- const cleaned = String(value || DEFAULT_SERVER_NAME).trim().replace(/[^A-Za-z0-9._-]+/g, '-').replace(/^-+|-+$/g, '');
158
- return cleaned || DEFAULT_SERVER_NAME;
159
- }
160
- function readOption(args, name, fallback) {
161
- const i = args.indexOf(name);
162
- return i >= 0 && args[i + 1] && !String(args[i + 1]).startsWith('--') ? args[i + 1] : fallback;
163
- }
164
- function readRepeatedOption(args, name) {
165
- const out = [];
166
- for (let i = 0; i < args.length; i += 1) {
167
- if (args[i] === name && args[i + 1])
168
- out.push(String(args[i + 1]));
22
+ console.log('`sks xai` is deprecated. UltraSearch no longer requires xAI/Grok or XAI_API_KEY.');
23
+ console.log('Use: sks ultra-search doctor');
24
+ console.log('Use: sks ultra-search x "<query>"');
25
+ if (action === 'setup') {
26
+ console.log('No MCP setup was performed.');
27
+ process.exitCode = 1;
28
+ }
169
29
  }
170
- return out;
30
+ return result;
171
31
  }
172
- function escapeRegExp(value) {
173
- return String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
32
+ export function xaiMcpToml() {
33
+ return '';
174
34
  }
175
35
  //# sourceMappingURL=xai-command.js.map
@@ -72,7 +72,7 @@ export async function buildAgentCodexCockpitState(missionDir, opts = {}) {
72
72
  janitor_ok: janitor?.ok ?? null,
73
73
  proof_status: proof?.status || (proof?.ok ? 'passed' : proof ? 'blocked' : null),
74
74
  source_intelligence_status: sourceIntelligence?.ok === true ? sourceIntelligence.mode || 'ok' : sourceIntelligence ? 'blocked' : null,
75
- xai_status: sourceIntelligence?.xai_search?.status || sourceIntelligence?.policy?.xai_mcp?.status || null,
75
+ ultra_search_status: sourceIntelligence?.ultra_search?.proof?.ok === true ? 'verified' : sourceIntelligence?.ultra_search ? 'partial' : null,
76
76
  codex_web_search_status: sourceIntelligence?.codex_web_search?.status || sourceIntelligence?.policy?.codex_web_search?.status || null,
77
77
  goal_mode_status: goalMode?.mode || null,
78
78
  terminal_session_status: terminalClosed ? 'closed' : proof ? 'blocked_or_unverified' : null,
@@ -115,7 +115,7 @@ export function renderAgentCodexDashboard(state) {
115
115
  `- Concurrency: ${state.concurrency ?? 'unknown'}`,
116
116
  `- Proof: ${state.proof_status || 'unknown'}`,
117
117
  `- Source intelligence: ${state.source_intelligence_status || 'unknown'}`,
118
- `- X AI: ${state.xai_status || 'unknown'}`,
118
+ `- UltraSearch: ${state.ultra_search_status || 'unknown'}`,
119
119
  `- Codex Web Search: ${state.codex_web_search_status || 'unknown'}`,
120
120
  `- Goal mode: ${state.goal_mode_status || 'unknown'}`,
121
121
  `- Terminal sessions: ${state.terminal_session_status || 'unknown'}`,
@@ -195,7 +195,7 @@ function summarizeLiveState(state) {
195
195
  session_generation_count: state.session_generations.length,
196
196
  proof_status: state.proof_status,
197
197
  source_intelligence_status: state.source_intelligence_status,
198
- xai_status: state.xai_status,
198
+ ultra_search_status: state.ultra_search_status,
199
199
  codex_web_search_status: state.codex_web_search_status,
200
200
  goal_mode_status: state.goal_mode_status,
201
201
  terminal_session_status: state.terminal_session_status,
@@ -11,7 +11,7 @@ const WRONGNESS_MAP = [
11
11
  ['missing_follow_up_schema', /follow_up_work_item|follow_up_work_items|schema_invalid:.*follow_up/],
12
12
  ['session_generation_missing', /session_generation_open|terminal_close_report_missing|source_intelligence_missing_for_generation|goal_mode_missing_for_generation/],
13
13
  ['schema_invalid_output', /^schema_invalid:/],
14
- ['xai_available_not_used', /xai_available_not_used/],
14
+ ['ultra_search_provider_independent_proof_missing', /ultra_search_provider_independent_proof_missing/],
15
15
  ['codex_web_search_missing', /codex_web_search_missing/],
16
16
  ['context7_missing', /context7_missing|docs_context_missing/],
17
17
  ['stale_heartbeat', /stale_heartbeat/],
package/dist/core/fsx.js CHANGED
@@ -5,7 +5,7 @@ import os from 'node:os';
5
5
  import crypto from 'node:crypto';
6
6
  import { spawn } from 'node:child_process';
7
7
  import { fileURLToPath } from 'node:url';
8
- export const PACKAGE_VERSION = '4.2.1';
8
+ export const PACKAGE_VERSION = '4.4.0';
9
9
  export const DEFAULT_PROCESS_TAIL_BYTES = 256 * 1024;
10
10
  export const DEFAULT_PROCESS_TIMEOUT_MS = 30 * 60 * 1000;
11
11
  export function nowIso() {
@@ -17,7 +17,7 @@ export const RELEASE_1_17_GATE_SNAPSHOT = Object.freeze([
17
17
  'release:readiness'
18
18
  ]);
19
19
  export const RELEASE_1_18_REQUIRED_GATES = Object.freeze([
20
- 'xai-mcp:capability',
20
+ 'ultra-search:provider-interface',
21
21
  'source-intelligence:policy',
22
22
  'source-intelligence:all-modes',
23
23
  'codex-web:adapter',
@@ -30,7 +30,7 @@ export const FROM_CHAT_IMG_CHECKLIST_ARTIFACT = 'from-chat-img-checklist.md';
30
30
  export const FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT = 'from-chat-img-temp-triwiki.json';
31
31
  export const FROM_CHAT_IMG_QA_LOOP_ARTIFACT = 'from-chat-img-qa-loop.json';
32
32
  export const FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS = 5;
33
- export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|zellij|tmux|auto-review|team|qa-loop|ppt|image-ux-review|computer-use|goal|fast-mode|research|db|git|codex|codex-app|codex-native|hooks|features|all-features|dfix|commit|commit-and-push|design|imagegen|dollar|context7|xai|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|wrongness|code-structure|proof-field|skill-dream|rust';
33
+ export const USAGE_TOPICS = 'install|setup|bootstrap|root|deps|zellij|tmux|auto-review|team|qa-loop|ppt|image-ux-review|computer-use|goal|fast-mode|research|db|git|codex|codex-app|codex-native|hooks|features|all-features|dfix|commit|commit-and-push|design|imagegen|dollar|context7|ultra-search|xai|pipeline|reasoning|guard|conflicts|versioning|eval|harness|hproof|gx|wiki|wrongness|code-structure|proof-field|skill-dream|rust';
34
34
  export const CODEX_COMPUTER_USE_EVIDENCE_SOURCE = 'codex_computer_use';
35
35
  export const CODEX_IN_APP_BROWSER_EVIDENCE_SOURCE = 'codex_in_app_browser';
36
36
  export const CODEX_CHROME_EXTENSION_EVIDENCE_SOURCE = 'codex_chrome_extension';
@@ -688,7 +688,8 @@ export const COMMAND_CATALOG = [
688
688
  { name: 'image-ux-review', usage: 'sks ux-review run --image <path> --fix --json | sks image-ux-review status <mission-id|latest> [--json]', description: 'Run or inspect $Image-UX-Review gpt-image-2/imagegen annotated UI/UX review artifacts, issue ledgers, safe fix loops, recapture, and proof gates.' },
689
689
  { name: 'computer-use', usage: 'sks computer-use import|status|smoke|require ... [--json]', description: 'Record native Mac/non-web Computer Use visual evidence while keeping web verification on the Chrome Extension path.' },
690
690
  { name: 'context7', usage: 'sks context7 check|setup|tools|resolve|docs|evidence ...', description: 'Check, configure, and call the local Context7 MCP requirement.' },
691
- { name: 'xai', usage: 'sks xai check|setup|status|docs [--scope project|global] [--url <u>|--command <c>] ...', description: 'Set up and check the optional xAI/Grok Live Search MCP provider for source intelligence.' },
691
+ { name: 'ultra-search', usage: 'sks ultra-search doctor|run|x|fetch|status|inspect|sources|claims|cache|bench|migrate-xai', description: 'Run provider-independent UltraSearch source intelligence.' },
692
+ { name: 'xai', usage: 'sks xai check|status|docs', description: 'Deprecated compatibility notice; use sks ultra-search.' },
692
693
  { name: 'recallpulse', usage: 'sks recallpulse run|status|eval|governance|checklist <mission-id|latest>', description: 'Run report-only RecallPulse active recall, durable status, proof capsule, evidence envelope, and governance checks.' },
693
694
  { name: 'pipeline', usage: 'sks pipeline status|resume|plan|answer ...', description: 'Inspect the active skill-first route, materialized execution plan, ambiguity gates, and completion gates.' },
694
695
  { name: 'guard', usage: 'sks guard check [--json]', description: 'Check SKS harness self-protection lock, fingerprints, and source-repo exception state.' },