@aiwg/cli 2026.9.2 → 2026.9.3

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 (67) hide show
  1. package/agentic/code/providers/antigravity/provider-contract.v1.json +121 -0
  2. package/agentic/code/providers/capability-matrix.yaml +87 -1
  3. package/agentic/code/providers/model-capabilities.v1.json +31 -0
  4. package/agentic/code/providers/model-catalog.v1.json +29 -0
  5. package/agentic/code/providers/omp/README.md +58 -0
  6. package/agentic/code/providers/omp/aiwg-bridge.ts +52 -0
  7. package/dist/src/agents/agent-deployer.js +18 -0
  8. package/dist/src/agents/agent-packager.js +25 -0
  9. package/dist/src/artifacts/backends/sqlite-backend.js +18 -10
  10. package/dist/src/artifacts/query-engine.js +30 -0
  11. package/dist/src/cli/agent-spawn.js +13 -2
  12. package/dist/src/cli/handlers/help.js +3 -1
  13. package/dist/src/cli/handlers/init.js +2 -0
  14. package/dist/src/cli/handlers/models.js +1 -1
  15. package/dist/src/cli/handlers/runtime-info.js +8 -1
  16. package/dist/src/cli/handlers/session.js +5 -4
  17. package/dist/src/cli/handlers/sessions.js +26 -9
  18. package/dist/src/cli/handlers/setup.js +9 -2
  19. package/dist/src/cli/handlers/steward.js +13 -2
  20. package/dist/src/cli/handlers/subcommands.js +11 -0
  21. package/dist/src/cli/handlers/team.js +68 -7
  22. package/dist/src/cli/handlers/use.js +121 -9
  23. package/dist/src/cli/scope-resolver.js +7 -0
  24. package/dist/src/config/aiwg-config.js +1 -0
  25. package/dist/src/dataset/fortemi-live-qualification.d.ts +53 -0
  26. package/dist/src/dataset/fortemi-live-qualification.js +297 -0
  27. package/dist/src/dataset/index.d.ts +1 -0
  28. package/dist/src/dataset/index.js +1 -0
  29. package/dist/src/mcp/cli.mjs +30 -1
  30. package/dist/src/mcp/omp-config.mjs +128 -0
  31. package/dist/src/mcp/registry.js +45 -5
  32. package/dist/src/mcp/registry.mjs +29 -6
  33. package/dist/src/models/model-capabilities.v1.json +31 -0
  34. package/dist/src/models/model-catalog.v1.json +29 -0
  35. package/dist/src/models/model-discovery.js +46 -5
  36. package/dist/src/models/provider-policy.js +5 -3
  37. package/dist/src/plugin/skill-command-translator.js +2 -0
  38. package/dist/src/providers/capability-matrix.yaml +87 -1
  39. package/dist/src/providers/omp-agent.mjs +40 -0
  40. package/dist/src/providers/omp-diagnostics.mjs +15 -0
  41. package/dist/src/providers/omp-paths.mjs +38 -0
  42. package/dist/src/providers/provider-definitions.js +83 -0
  43. package/dist/src/providers/provider-definitions.mjs +25 -1
  44. package/dist/src/providers/provider-inventory.js +2 -0
  45. package/dist/src/sessions/adapters/omp.js +203 -0
  46. package/dist/src/sessions/batch-import.js +7 -0
  47. package/dist/src/sessions/contracts.js +1 -1
  48. package/dist/src/sessions/importer.js +4 -3
  49. package/dist/src/sessions/index.js +1 -0
  50. package/dist/src/sessions/readers.js +4 -3
  51. package/dist/src/sessions/workspace-discovery.js +12 -2
  52. package/dist/src/skills/deployer.js +21 -1
  53. package/dist/src/smiths/agentsmith/generator.js +1 -0
  54. package/dist/src/smiths/context-pipeline/parallelism-section.js +2 -0
  55. package/dist/src/smiths/context-pipeline/provider-policy.js +2 -2
  56. package/dist/src/smiths/context-pipeline/workspace-context.js +2 -2
  57. package/dist/src/storage/backends/fortemi.js +142 -17
  58. package/dist/src/storage/fortemi-qualification-receipt.js +206 -0
  59. package/dist/src/storage/fortemi-qualification.js +67 -6
  60. package/dist/src/storage/index.js +1 -0
  61. package/package.json +2 -1
  62. package/schemas/dataset/fortemi-live-qualification-receipt.v1.schema.json +132 -0
  63. package/tools/agents/deploy-agents.mjs +6 -3
  64. package/tools/agents/providers/antigravity.mjs +147 -0
  65. package/tools/agents/providers/omp.d.mts +4 -0
  66. package/tools/agents/providers/omp.mjs +256 -0
  67. package/tools/providers/antigravity-transport.mjs +124 -0
@@ -0,0 +1,124 @@
1
+ import { spawn } from 'node:child_process';
2
+
3
+ export const ANTIGRAVITY_CONTRACT_VERSION = '1.0.0';
4
+ export const ANTIGRAVITY_QUALIFIED_CLI_VERSION = '1.1.26';
5
+
6
+ function nonEmptyString(value, name) {
7
+ if (typeof value !== 'string' || !value.trim()) throw new Error(`Antigravity ${name} must be a non-empty string`);
8
+ return value;
9
+ }
10
+
11
+ export function buildAntigravityArgs(prompt, options = {}) {
12
+ const args = ['-p', nonEmptyString(prompt, 'prompt')];
13
+ if (options.outputFormat === 'stream-json') {
14
+ args.push('--output-format', 'stream-json');
15
+ } else {
16
+ args.push('--output-format', 'json');
17
+ }
18
+ if (options.agent) args.push('--agent', String(options.agent));
19
+ if (options.model) args.push('--model', String(options.model));
20
+ if (options.effort) {
21
+ if (!['low', 'medium', 'high'].includes(options.effort)) throw new Error(`Unsupported Antigravity effort '${options.effort}'`);
22
+ args.push('--effort', options.effort);
23
+ }
24
+ if (options.mode) {
25
+ if (!['accept-edits', 'plan'].includes(options.mode)) throw new Error(`Unsupported Antigravity mode '${options.mode}'`);
26
+ args.push('--mode', options.mode);
27
+ }
28
+ if (options.sandbox) args.push('--sandbox');
29
+ if (options.continue === true) args.push('--continue');
30
+ if (options.conversation) args.push('--conversation', String(options.conversation));
31
+ if (options.dangerous === true) args.unshift('--dangerously-skip-permissions');
32
+ return args;
33
+ }
34
+
35
+ export function parseAntigravityJson(input) {
36
+ let value;
37
+ try { value = typeof input === 'string' ? JSON.parse(input) : input; }
38
+ catch (error) { throw new Error(`Invalid Antigravity JSON output: ${error.message}`); }
39
+ if (!value || typeof value !== 'object' || Array.isArray(value)) throw new Error('Invalid Antigravity JSON envelope: expected object');
40
+ nonEmptyString(value.conversation_id, 'conversation_id');
41
+ nonEmptyString(value.status, 'status');
42
+ if (typeof value.response !== 'string') throw new Error('Invalid Antigravity JSON envelope: response must be a string');
43
+ if (value.error !== undefined && typeof value.error !== 'string') throw new Error('Invalid Antigravity JSON envelope: error must be a string');
44
+ return value;
45
+ }
46
+
47
+ export function parseAntigravityStream(input) {
48
+ const lines = String(input).split(/\r?\n/).filter(line => line.trim());
49
+ if (!lines.length) throw new Error('Invalid Antigravity stream: no events');
50
+ const events = lines.map((line, index) => {
51
+ try { return JSON.parse(line); }
52
+ catch (error) { throw new Error(`Invalid Antigravity stream event ${index}: ${error.message}`); }
53
+ });
54
+ if (events[0]?.event !== 'init') throw new Error('Invalid Antigravity stream: first event must be init');
55
+ const results = events.filter(event => event?.event === 'result');
56
+ if (results.length !== 1 || events.at(-1)?.event !== 'result') throw new Error('Invalid Antigravity stream: exactly one terminal result is required');
57
+ for (const [index, event] of events.entries()) {
58
+ if (!['init', 'step_update', 'result'].includes(event?.event)) throw new Error(`Invalid Antigravity stream event ${index}: unknown event`);
59
+ if (event.event === 'init') {
60
+ nonEmptyString(event.conversation_id, 'conversation_id');
61
+ if (!event.init || typeof event.init !== 'object' || Array.isArray(event.init)) {
62
+ throw new Error(`Invalid Antigravity stream event ${index}: init payload must be an object`);
63
+ }
64
+ }
65
+ if (event.event === 'step_update') {
66
+ if (!event.step_update || typeof event.step_update !== 'object' || Array.isArray(event.step_update)) {
67
+ throw new Error(`Invalid Antigravity stream event ${index}: step_update payload must be an object`);
68
+ }
69
+ if (!['ACTIVE', 'DONE'].includes(event.step_update.state)) {
70
+ throw new Error(`Invalid Antigravity stream event ${index}: unknown state`);
71
+ }
72
+ }
73
+ }
74
+ parseAntigravityJson(results[0].result);
75
+ return events;
76
+ }
77
+
78
+ export function runAntigravity(prompt, options = {}) {
79
+ const timeoutMs = options.timeoutMs ?? 300_000;
80
+ if (!Number.isInteger(timeoutMs) || timeoutMs < 1) throw new Error('Antigravity timeoutMs must be a positive integer');
81
+ const binary = options.binary || 'agy';
82
+ const args = buildAntigravityArgs(prompt, options);
83
+ return new Promise((resolve, reject) => {
84
+ const child = (options.spawnImpl || spawn)(binary, args, {
85
+ cwd: options.cwd,
86
+ env: options.env || process.env,
87
+ stdio: ['pipe', 'pipe', 'pipe'],
88
+ shell: false,
89
+ });
90
+ let stdout = '';
91
+ let stderr = '';
92
+ let settled = false;
93
+ const timer = setTimeout(() => {
94
+ settled = true;
95
+ child.kill('SIGTERM');
96
+ reject(new Error(`Antigravity invocation timed out after ${timeoutMs}ms`));
97
+ }, timeoutMs);
98
+ child.stdout.on('data', chunk => { stdout += chunk; });
99
+ child.stderr.on('data', chunk => { stderr += chunk; });
100
+ child.on('error', error => {
101
+ if (settled) return;
102
+ settled = true;
103
+ clearTimeout(timer);
104
+ reject(new Error(`Unable to start Antigravity CLI (${binary}): ${error.message}`));
105
+ });
106
+ child.on('close', code => {
107
+ if (settled) return;
108
+ settled = true;
109
+ clearTimeout(timer);
110
+ if (code !== 0) {
111
+ const diagnostic = stderr.trim() || 'no diagnostic output';
112
+ reject(new Error(`Antigravity CLI exited ${code}: ${diagnostic}`));
113
+ return;
114
+ }
115
+ try {
116
+ const output = options.outputFormat === 'stream-json'
117
+ ? parseAntigravityStream(stdout)
118
+ : parseAntigravityJson(stdout);
119
+ resolve({ output, stderr, exitCode: code });
120
+ } catch (error) { reject(error); }
121
+ });
122
+ child.stdin.end();
123
+ });
124
+ }