@aiwg/cli 2026.8.8 → 2026.8.10

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 (68) hide show
  1. package/README.md +23 -8
  2. package/THIRD_PARTY_NOTICES.md +35 -0
  3. package/agentic/code/providers/capability-matrix.yaml +3 -3
  4. package/bin/aiwg.mjs +125 -0
  5. package/dist/src/artifacts/backends/graphology-backend.js +4 -3
  6. package/dist/src/artifacts/backends/sqlite-backend.js +4 -5
  7. package/dist/src/artifacts/cli.js +2 -2
  8. package/dist/src/artifacts/corpus-tools/cli.js +27 -0
  9. package/dist/src/artifacts/corpus-tools/profile-embed.js +3 -2
  10. package/dist/src/artifacts/corpus-tools/retrieval-lab.js +356 -0
  11. package/dist/src/artifacts/discover-facets.js +2 -2
  12. package/dist/src/artifacts/embedding-index.js +9 -8
  13. package/dist/src/artifacts/graph-backend.js +2 -2
  14. package/dist/src/artifacts/query-engine.js +21 -7
  15. package/dist/src/artifacts/repair.js +47 -0
  16. package/dist/src/artifacts/types.js +3 -3
  17. package/dist/src/cli/command-log.js +2 -2
  18. package/dist/src/cli/handlers/artifacts.js +50 -1
  19. package/dist/src/cli/handlers/cost-report.js +71 -0
  20. package/dist/src/cli/handlers/evidence.js +78 -0
  21. package/dist/src/cli/handlers/help.js +9 -0
  22. package/dist/src/cli/handlers/index.js +8 -3
  23. package/dist/src/cli/handlers/local-executor.js +4 -3
  24. package/dist/src/cli/handlers/refresh.js +20 -8
  25. package/dist/src/cli/handlers/regenerate.js +3 -3
  26. package/dist/src/cli/handlers/serve.js +15 -36
  27. package/dist/src/cli/handlers/setup-manifest.js +8 -1
  28. package/dist/src/cli/handlers/use.js +256 -70
  29. package/dist/src/cli/handlers/utilities.js +149 -0
  30. package/dist/src/cli/handlers/workspace.js +10 -0
  31. package/dist/src/cli/help-generator.js +2 -1
  32. package/dist/src/cli/router.js +4 -1
  33. package/dist/src/cli/services/deployment-verification.js +596 -0
  34. package/dist/src/cli/skill-usage.js +2 -2
  35. package/dist/src/cli/workflow-orchestrator.js +1 -1
  36. package/dist/src/cli/workspace-signals.js +2 -2
  37. package/dist/src/config/aiwg-config.js +54 -27
  38. package/dist/src/config/cli.js +3 -3
  39. package/dist/src/config/project-artifacts-health.js +2 -0
  40. package/dist/src/config/project-artifacts-health.mjs +123 -0
  41. package/dist/src/config/project-artifacts-runtime.mjs +16 -0
  42. package/dist/src/config/project-artifacts.js +2 -1
  43. package/dist/src/cost/fleet-report.js +329 -0
  44. package/dist/src/evidence/bundle.js +256 -0
  45. package/dist/src/extensions/commands/definitions.js +77 -25
  46. package/dist/src/extensions/deployment-registration.js +6 -4
  47. package/dist/src/features/catalog.js +26 -0
  48. package/dist/src/features/cli.js +1 -3
  49. package/dist/src/features/runtime.js +17 -1
  50. package/dist/src/issues/cli.js +91 -7
  51. package/dist/src/mcp/server.mjs +1 -1
  52. package/dist/src/ops/registry.js +2 -2
  53. package/dist/src/policy/authorization.js +2 -2
  54. package/dist/src/providers/capability-matrix.yaml +3 -3
  55. package/dist/src/providers/provider-definitions.js +7 -5
  56. package/dist/src/providers/provider-definitions.mjs +1 -1
  57. package/dist/src/serve/pty-bridge.js +2 -8
  58. package/dist/src/serve/screen-reader.js +3 -6
  59. package/dist/src/smiths/context-pipeline/aiwg-md.js +2 -2
  60. package/dist/src/smiths/context-pipeline/finalization.js +18 -5
  61. package/dist/src/smiths/context-pipeline/generator.js +2 -2
  62. package/dist/src/smiths/context-pipeline/workspace-context.js +16 -17
  63. package/package.json +2 -1
  64. package/tools/agents/deploy-agents.mjs +10 -11
  65. package/tools/agents/providers/base.mjs +47 -5
  66. package/tools/agents/providers/openclaw.mjs +5 -2
  67. package/tools/agents/providers/windsurf.mjs +13 -24
  68. package/tools/skills/deploy-skills-codex.mjs +21 -5
@@ -18,6 +18,7 @@ import { updateInstallation } from '../../update/service.mjs';
18
18
  import { useHandler as useFrameworkHandler } from './use.js';
19
19
  import { projectAiwgPath } from '../../config/project-artifacts.js';
20
20
  import { checkCollisions, } from '../../smiths/skillsmith/collision-detector.js';
21
+ import { renderUseDeploymentResult, verifyConfiguredDeployments, } from '../services/deployment-verification.js';
21
22
  /**
22
23
  * Maps framework registry IDs (e.g. 'sdlc-complete') to `aiwg use` names (e.g. 'sdlc').
23
24
  */
@@ -429,6 +430,24 @@ async function runUserScopeDoctor(verbose) {
429
430
  message: lines.join('\n') + '\n',
430
431
  };
431
432
  }
433
+ const DOCTOR_HELP = `aiwg doctor — check AIWG installation health
434
+
435
+ Usage:
436
+ aiwg doctor [options]
437
+ aiwg -doctor [options]
438
+ aiwg --doctor [options]
439
+
440
+ Options:
441
+ --deployment Verify configured provider deployments
442
+ --provider <name> Limit deployment verification to one provider
443
+ --bundle <name> Limit deployment verification to one bundle
444
+ --scope <scope> Verification scope: project or user
445
+ --user Alias for --scope user
446
+ --project-local Include project-local artifact diagnostics
447
+ --json Emit machine-readable deployment verification output
448
+ --verbose, -v Include verbose diagnostics
449
+ --help, -h Show this help
450
+ `;
432
451
  /**
433
452
  * Handler for doctor command
434
453
  *
@@ -448,6 +467,30 @@ export const doctorHandler = {
448
467
  category: 'maintenance',
449
468
  aliases: ['-doctor', '--doctor'],
450
469
  async execute(ctx) {
470
+ if (ctx.args.includes('--help') || ctx.args.includes('-h')) {
471
+ return { exitCode: 0, message: DOCTOR_HELP, rawOutput: true };
472
+ }
473
+ if (ctx.args.includes('--deployment')) {
474
+ const providerIndex = ctx.args.indexOf('--provider');
475
+ const bundleIndex = ctx.args.indexOf('--bundle');
476
+ const scopeIndex = ctx.args.indexOf('--scope');
477
+ const scopeValue = scopeIndex >= 0 ? ctx.args[scopeIndex + 1] : undefined;
478
+ if (scopeValue && scopeValue !== 'project' && scopeValue !== 'user') {
479
+ return { exitCode: 2, message: `Invalid deployment verification scope: ${scopeValue}` };
480
+ }
481
+ const result = await verifyConfiguredDeployments(ctx.cwd || process.cwd(), {
482
+ provider: providerIndex >= 0 ? ctx.args[providerIndex + 1] : undefined,
483
+ bundle: bundleIndex >= 0 ? ctx.args[bundleIndex + 1] : undefined,
484
+ scope: scopeValue,
485
+ }, ctx.frameworkRoot);
486
+ return {
487
+ exitCode: result.exitCode,
488
+ message: ctx.args.includes('--json')
489
+ ? JSON.stringify(result, null, 2)
490
+ : renderUseDeploymentResult(result),
491
+ rawOutput: ctx.args.includes('--json'),
492
+ };
493
+ }
451
494
  // #1156 Phase 1 — `aiwg doctor --scope user` / `aiwg doctor --user`
452
495
  // validates the per-user registry (~/.aiwg/installed.json) without
453
496
  // running the project-scope diagnostics. Operators need this to verify
@@ -584,6 +627,111 @@ export const doctorHandler = {
584
627
  : result;
585
628
  },
586
629
  };
630
+ const CONTEXT_FIREWALL_HELP = `aiwg context-firewall — inspect provider context and reviewed memory
631
+
632
+ Usage:
633
+ aiwg context-firewall [scan] [options]
634
+ aiwg context-firewall baseline [--plan]
635
+ aiwg context-firewall baseline --write --confirm-reviewed [--output <path>]
636
+
637
+ Actions:
638
+ scan Read-only inventory, trust, poisoning, drift, and budget checks (default)
639
+ baseline Plan or explicitly write the reviewed digest baseline
640
+
641
+ Options:
642
+ --root <path> Project root (default: current directory)
643
+ --provider <name> Limit to a provider; repeatable
644
+ --baseline <path> Existing reviewed baseline used by the scan
645
+ --output <path> Baseline destination (must remain within the project)
646
+ --budget-tokens <n> Portable provider-context budget
647
+ --warn-ratio <n> Warning threshold as a fraction of the budget
648
+ --strict Exit non-zero for violations or a missing baseline
649
+ --json Emit stable machine-readable output
650
+ --limit <n> Bound scan detail in human-readable output
651
+ --no-content-scan Skip poisoning classification
652
+ --plan Show every record; do not write (baseline default)
653
+ --write Write after review; requires --confirm-reviewed
654
+ --confirm-reviewed Confirm every record in the plan was reviewed
655
+ `;
656
+ function contextFirewallError(message) {
657
+ return { exitCode: 2, message: `${message}\n\n${CONTEXT_FIREWALL_HELP}` };
658
+ }
659
+ /**
660
+ * Public operator route for the context/memory firewall.
661
+ *
662
+ * The implementation remains a reusable packaged engine, while this handler
663
+ * owns stable command vocabulary and keeps internal script entrypoints out of
664
+ * user- and agent-facing remediation guidance.
665
+ */
666
+ export const contextFirewallHandler = {
667
+ id: 'context-firewall',
668
+ name: 'Context Firewall',
669
+ description: 'Audit provider context and manage its reviewed baseline',
670
+ category: 'maintenance',
671
+ aliases: ['-context-firewall', '--context-firewall'],
672
+ async execute(ctx) {
673
+ if (ctx.args.includes('--help') || ctx.args.includes('-h')) {
674
+ return { exitCode: 0, message: CONTEXT_FIREWALL_HELP };
675
+ }
676
+ const action = ctx.args[0] && !ctx.args[0].startsWith('-') ? ctx.args[0] : 'scan';
677
+ if (!['scan', 'baseline'].includes(action)) {
678
+ return contextFirewallError(`Unknown context-firewall action '${action}'.`);
679
+ }
680
+ const input = action === 'scan' ? ctx.args.slice(action === ctx.args[0] ? 1 : 0) : ctx.args.slice(1);
681
+ const forwarded = ['--package-root', ctx.frameworkRoot];
682
+ let output;
683
+ let plan = false;
684
+ let write = false;
685
+ let confirmed = false;
686
+ for (let index = 0; index < input.length; index += 1) {
687
+ const arg = input[index];
688
+ if (arg === '--output') {
689
+ output = input[index + 1];
690
+ if (!output)
691
+ return contextFirewallError('--output requires a path.');
692
+ index += 1;
693
+ }
694
+ else if (arg.startsWith('--output=')) {
695
+ output = arg.slice('--output='.length);
696
+ if (!output)
697
+ return contextFirewallError('--output requires a path.');
698
+ }
699
+ else if (arg === '--plan') {
700
+ plan = true;
701
+ }
702
+ else if (arg === '--write') {
703
+ write = true;
704
+ }
705
+ else if (arg === '--confirm-reviewed') {
706
+ confirmed = true;
707
+ }
708
+ else {
709
+ forwarded.push(arg);
710
+ }
711
+ }
712
+ if (action === 'scan' && (output || plan || write || confirmed)) {
713
+ return contextFirewallError('Baseline mutation options require the `baseline` action.');
714
+ }
715
+ if (plan && write)
716
+ return contextFirewallError('Choose either --plan or --write, not both.');
717
+ if (write && !confirmed) {
718
+ return contextFirewallError('Baseline writes require --confirm-reviewed after inspecting the plan.');
719
+ }
720
+ if (confirmed && !write) {
721
+ return contextFirewallError('--confirm-reviewed is only valid with --write.');
722
+ }
723
+ if (action === 'baseline') {
724
+ if (write) {
725
+ forwarded.push(output ? `--write-baseline=${output}` : '--write-baseline', '--confirm-reviewed');
726
+ }
727
+ else {
728
+ forwarded.push(output ? `--plan-baseline=${output}` : '--plan-baseline');
729
+ }
730
+ }
731
+ const runner = createScriptRunner(ctx.frameworkRoot);
732
+ return runner.run('tools/security/context-memory-firewall.mjs', forwarded, { cwd: ctx.cwd });
733
+ },
734
+ };
587
735
  /**
588
736
  * Handler for update command
589
737
  *
@@ -713,6 +861,7 @@ export const utilityHandlers = [
713
861
  contributeStartHandler,
714
862
  validateMetadataHandler,
715
863
  doctorHandler,
864
+ contextFirewallHandler,
716
865
  updateHandler,
717
866
  ];
718
867
  //# sourceMappingURL=utilities.js.map
@@ -11,6 +11,7 @@
11
11
  import { createScriptRunner } from './script-runner.js';
12
12
  import { getFrameworkRoot } from '../../channel/manager.mjs';
13
13
  import { maybePrintCommunityFooter } from '../../community/footer.js';
14
+ import { buildDeploymentStatusProbe } from '../services/deployment-verification.js';
14
15
  /**
15
16
  * Handler for workspace status command
16
17
  *
@@ -29,6 +30,15 @@ export const statusHandler = {
29
30
  category: 'workspace',
30
31
  aliases: ['-status', '--status'],
31
32
  async execute(ctx) {
33
+ if (ctx.args.includes('--probe')) {
34
+ const projectRoot = ctx.args.find((arg) => !arg.startsWith('-')) ?? ctx.cwd ?? process.cwd();
35
+ const probe = await buildDeploymentStatusProbe(projectRoot, ctx.frameworkRoot);
36
+ return {
37
+ exitCode: probe.status === 'needs-repair' ? 1 : 0,
38
+ message: JSON.stringify(probe, null, 2),
39
+ rawOutput: true,
40
+ };
41
+ }
32
42
  const frameworkRoot = await getFrameworkRoot();
33
43
  const runner = createScriptRunner(frameworkRoot);
34
44
  const result = await runner.run('tools/cli/workspace-status.mjs', ctx.args, {
@@ -89,7 +89,8 @@ export function generateHelp(registry) {
89
89
  lines.push(' cursor Cursor IDE');
90
90
  lines.push(' opencode OpenCode');
91
91
  lines.push(' warp Warp Terminal');
92
- lines.push(' windsurf Windsurf');
92
+ lines.push(' devin Devin Desktop');
93
+ lines.push(' windsurf Deprecated alias for devin');
93
94
  lines.push('');
94
95
  // Examples
95
96
  lines.push('Examples:');
@@ -201,7 +201,10 @@ export async function run(args, options = {}) {
201
201
  }
202
202
  // Output message if present
203
203
  if (result.message) {
204
- if (result.exitCode !== 0) {
204
+ if (result.rawOutput) {
205
+ process.stdout.write(result.message.endsWith('\n') ? result.message : `${result.message}\n`);
206
+ }
207
+ else if (result.exitCode !== 0) {
205
208
  ui.error(result.message);
206
209
  }
207
210
  else {