@aiwg/cli 2026.10.5 → 2026.10.7
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.
- package/agentic/code/addons/composition-engine/lib/runtime.mjs +1401 -0
- package/agentic/code/addons/composition-engine/lib/validator.mjs +513 -0
- package/agentic/code/addons/composition-engine/schemas/flow-graph.schema.json +372 -0
- package/agentic/code/providers/model-capabilities.v1.json +74 -50
- package/bin/aiwg.mjs +7 -3
- package/dist/src/a2a/agent-card.js +11 -0
- package/dist/src/api/index.d.ts +1 -0
- package/dist/src/api/index.js +1 -0
- package/dist/src/artifacts/browser-export.js +1 -0
- package/dist/src/artifacts/citation-parser.js +8 -1
- package/dist/src/artifacts/cli.js +57 -6
- package/dist/src/artifacts/fortemi-core-query-adapter.js +2 -0
- package/dist/src/artifacts/fortemi-core-sync.js +26 -8
- package/dist/src/artifacts/fortemi-shard-contract/2.2.0/contract.json +103 -0
- package/dist/src/artifacts/fortemi-shard-contract/2.2.0/full-v1-embedding-config.schema.json +212 -0
- package/dist/src/artifacts/fortemi-shard-contract/2.2.0/full-v1-embedding-set.schema.json +240 -0
- package/dist/src/artifacts/fortemi-shard-contract/2.2.0/full-v1-manifest.schema.json +451 -0
- package/dist/src/artifacts/fortemi-shard-export.js +284 -0
- package/dist/src/artifacts/graph-query.js +18 -8
- package/dist/src/artifacts/index-adapters.js +339 -0
- package/dist/src/artifacts/index-builder.js +143 -14
- package/dist/src/artifacts/index-files.js +15 -4
- package/dist/src/artifacts/index-preparation.js +2 -0
- package/dist/src/artifacts/index-reader.js +44 -0
- package/dist/src/artifacts/index-refresh.js +114 -55
- package/dist/src/artifacts/index-status.js +20 -5
- package/dist/src/artifacts/memory-maintenance.js +503 -0
- package/dist/src/artifacts/prebuilt-relations.js +3 -1
- package/dist/src/artifacts/query-engine.js +263 -108
- package/dist/src/artifacts/relations-builder.js +2 -2
- package/dist/src/artifacts/source-graph.js +2 -2
- package/dist/src/artifacts/types.js +9 -1
- package/dist/src/auth/client.js +5 -1
- package/dist/src/auth/credential-store.js +5 -1
- package/dist/src/auth/sensitive-input.js +151 -0
- package/dist/src/channel/manager.mjs +3 -0
- package/dist/src/cli/handlers/agentcard.js +47 -25
- package/dist/src/cli/handlers/auth.js +22 -2
- package/dist/src/cli/handlers/decision.js +22 -3
- package/dist/src/cli/handlers/effect.js +4 -84
- package/dist/src/cli/handlers/guided-setup.js +470 -0
- package/dist/src/cli/handlers/help.js +2 -2
- package/dist/src/cli/handlers/housekeeper.js +1110 -0
- package/dist/src/cli/handlers/index.js +4 -2
- package/dist/src/cli/handlers/init.js +41 -6
- package/dist/src/cli/handlers/install.js +6 -0
- package/dist/src/cli/handlers/local-executor.js +5 -3
- package/dist/src/cli/handlers/marketplace.js +15 -4
- package/dist/src/cli/handlers/mc.js +509 -53
- package/dist/src/cli/handlers/models.js +32 -2
- package/dist/src/cli/handlers/ralph-launcher.js +76 -4
- package/dist/src/cli/handlers/rules.js +1 -1
- package/dist/src/cli/handlers/script-runner.js +73 -2
- package/dist/src/cli/handlers/serve.js +5 -3
- package/dist/src/cli/handlers/sessions.js +1 -0
- package/dist/src/cli/handlers/setup.js +432 -1
- package/dist/src/cli/handlers/skill-lint.js +1 -1
- package/dist/src/cli/handlers/subcommands.js +118 -8
- package/dist/src/cli/handlers/use.js +335 -107
- package/dist/src/cli/handlers/workspace.js +3 -1
- package/dist/src/cli/prompt-utils.js +81 -0
- package/dist/src/cli/router.js +16 -1
- package/dist/src/config/aiwg-config.js +42 -0
- package/dist/src/config/cli.js +7 -3
- package/dist/src/config/decision-config.js +14 -1
- package/dist/src/config/gitignore.js +4 -0
- package/dist/src/config/native-sandbox-warnings.js +25 -0
- package/dist/src/config/workspace.js +2 -1
- package/dist/src/contributors/validation.js +6 -5
- package/dist/src/decision/adapters/jev.js +20 -31
- package/dist/src/decision/admission.js +7 -3
- package/dist/src/decision/ask.js +6 -1
- package/dist/src/decision/benchmark.js +482 -0
- package/dist/src/decision/ledger.js +22 -3
- package/dist/src/decision/pricing.js +147 -0
- package/dist/src/decision/qualification/gate-evidence.js +23 -18
- package/dist/src/decision/qualification/load-staged.js +576 -0
- package/dist/src/decision/qualification/load.js +109 -33
- package/dist/src/decision/qualification/runner.js +12 -5
- package/dist/src/decision/review/service.js +6 -4
- package/dist/src/decision/review/validate.js +23 -2
- package/dist/src/decision/savings.js +8 -3
- package/dist/src/discovery/index.js +492 -0
- package/dist/src/discovery/interview.js +238 -0
- package/dist/src/discovery/plan-apply.js +567 -0
- package/dist/src/discovery/plan-store.js +171 -0
- package/dist/src/discovery/plan-types.js +2 -0
- package/dist/src/discovery/plan-validation.js +139 -0
- package/dist/src/discovery/types.js +2 -0
- package/dist/src/effects/host.js +91 -0
- package/dist/src/extensions/commands/definitions.js +49 -9
- package/dist/src/extensions/manifest.js +71 -44
- package/dist/src/extensions/project-local-discovery.js +1 -1
- package/dist/src/extensions/project-local-gitignore.js +2 -0
- package/dist/src/extensions/project-quickref.js +18 -17
- package/dist/src/extensions/validation.js +32 -29
- package/dist/src/housekeeper/daemon-config.js +148 -0
- package/dist/src/housekeeper/ipc.js +84 -0
- package/dist/src/housekeeper/lifecycle.js +148 -0
- package/dist/src/housekeeper/platform.js +35 -0
- package/dist/src/housekeeper/status.js +70 -0
- package/dist/src/housekeeper/units.js +114 -0
- package/dist/src/issues/cli.js +16 -5
- package/dist/src/issues/live.js +44 -12
- package/dist/src/jobs/flow.js +22 -21
- package/dist/src/lint/rule-activation.js +20 -5
- package/dist/src/lint/runner.js +1 -1
- package/dist/src/marketplace/exchange.js +18 -6
- package/dist/src/marketplace/provenance.js +3 -2
- package/dist/src/mcp/adapters/codex-runtime.js +46 -76
- package/dist/src/mcp/cli.mjs +22 -96
- package/dist/src/mcp/config-file.mjs +6 -2
- package/dist/src/mcp/config-layers.mjs +23 -7
- package/dist/src/mcp/grok-build-config.mjs +2 -1
- package/dist/src/mcp/muse-native-config.mjs +2 -1
- package/dist/src/mcp/profiles.js +18 -31
- package/dist/src/mcp/profiles.mjs +18 -32
- package/dist/src/mcp/registry.js +7 -27
- package/dist/src/mcp/registry.mjs +7 -28
- package/dist/src/mcp/server.mjs +34 -1
- package/dist/src/mcp/tools/agentic-sandbox.mjs +8 -7
- package/dist/src/mcp/tools/command-run.mjs +3 -2
- package/dist/src/mcp/tools/decision.mjs +49 -48
- package/dist/src/mcp/tools/discovery.mjs +46 -21
- package/dist/src/mcp/tools/orchestration.mjs +22 -22
- package/dist/src/mcp/tools/subsystems.mjs +9 -8
- package/dist/src/mcp/tools/worker-invoke.mjs +30 -6
- package/dist/src/mcp/tools/writer-profiles.mjs +1 -1
- package/dist/src/memory/audit.js +719 -0
- package/dist/src/memory/canonical-context.js +392 -13
- package/dist/src/memory/canonical-maintenance.js +95 -0
- package/dist/src/memory/cli-result.js +22 -0
- package/dist/src/memory/cli.js +176 -0
- package/dist/src/memory/context-pack.js +57 -6
- package/dist/src/memory/cost.js +512 -0
- package/dist/src/memory/firewall-classification.d.mts +7 -0
- package/dist/src/memory/firewall-classification.mjs +32 -0
- package/dist/src/memory/index.js +8 -0
- package/dist/src/memory/line-maintenance.js +68 -0
- package/dist/src/memory/maintenance-cli.js +286 -0
- package/dist/src/memory/maintenance-contract.js +136 -0
- package/dist/src/memory/maintenance-index.js +18 -0
- package/dist/src/memory/maintenance-owner.js +2 -0
- package/dist/src/memory/maintenance-record.js +138 -0
- package/dist/src/memory/maintenance.js +254 -0
- package/dist/src/memory/project-registry.js +2 -1
- package/dist/src/memory/provider-memory-adapter.js +154 -0
- package/dist/src/memory/recommend-cli.js +83 -0
- package/dist/src/memory/recommend.js +269 -0
- package/dist/src/memory/scheduled.js +81 -0
- package/dist/src/memory/taxonomy.js +44 -0
- package/dist/src/mission-protocol/codecs.js +19 -9
- package/dist/src/mission-protocol/worker-status.js +91 -1
- package/dist/src/models/config-loader.js +11 -1
- package/dist/src/models/model-capabilities.v1.json +74 -50
- package/dist/src/models/provider-policy.js +125 -62
- package/dist/src/models/resolver.js +45 -8
- package/dist/src/models/worker-installation.d.mts +8 -1
- package/dist/src/models/worker-installation.mjs +231 -38
- package/dist/src/models/wrapper-route.js +1 -1
- package/dist/src/output-modes/registry.js +8 -7
- package/dist/src/packages/adapters/git.js +99 -23
- package/dist/src/packages/adapters/gitea.js +8 -27
- package/dist/src/packages/adapters/github.js +7 -25
- package/dist/src/packages/registry.js +4 -4
- package/dist/src/plugin/metadata-validator.js +1 -1
- package/dist/src/process/cli-command.d.mts +5 -0
- package/dist/src/process/cli-command.mjs +42 -0
- package/dist/src/providers/deploy-version.d.mts +1 -0
- package/dist/src/providers/deploy-version.mjs +17 -0
- package/dist/src/providers/provider-definitions.js +19 -16
- package/dist/src/providers/skill-ownership.d.mts +11 -2
- package/dist/src/providers/skill-ownership.mjs +35 -17
- package/dist/src/rules/activation.d.mts +11 -2
- package/dist/src/rules/activation.mjs +82 -6
- package/dist/src/rules/inventory.js +1 -1
- package/dist/src/rules/rule-frontmatter.schema.json +2 -0
- package/dist/src/schema/zod-validation.d.mts +6 -0
- package/dist/src/schema/zod-validation.mjs +50 -0
- package/dist/src/serve/executor-registry.js +297 -20
- package/dist/src/serve/executor-token.d.mts +1 -0
- package/dist/src/serve/executor-token.mjs +8 -0
- package/dist/src/serve/shared-host-scheduler.js +1102 -31
- package/dist/src/serve/worker-invocation.js +124 -15
- package/dist/src/sessions/adapters/claude.js +19 -18
- package/dist/src/sessions/adapters/codex.js +10 -9
- package/dist/src/sessions/adapters/copilot.js +14 -13
- package/dist/src/sessions/adapters/cursor.js +19 -18
- package/dist/src/sessions/adapters/deepseek-harness.js +9 -8
- package/dist/src/sessions/adapters/factory.js +11 -10
- package/dist/src/sessions/adapters/generic.js +32 -23
- package/dist/src/sessions/adapters/grokbot.js +35 -35
- package/dist/src/sessions/adapters/hermes.js +20 -19
- package/dist/src/sessions/adapters/muse.js +50 -49
- package/dist/src/sessions/adapters/omp.js +5 -4
- package/dist/src/sessions/adapters/openclaw.js +30 -29
- package/dist/src/sessions/adapters/opencode.js +26 -26
- package/dist/src/sessions/adapters/openhuman.js +24 -23
- package/dist/src/sessions/adapters/pi.js +5 -4
- package/dist/src/sessions/adapters/windsurf.js +8 -8
- package/dist/src/sessions/analytics.js +10 -9
- package/dist/src/sessions/candidates.js +7 -6
- package/dist/src/sessions/contracts.js +63 -53
- package/dist/src/sessions/output-registration.js +11 -10
- package/dist/src/sessions/workspace-discovery.js +3 -4
- package/dist/src/smiths/context-pipeline/aiwg-md.js +18 -1
- package/dist/src/smiths/context-pipeline/claude-hook.js +46 -10
- package/dist/src/smiths/context-pipeline/context-file-safety.js +330 -9
- package/dist/src/smiths/context-pipeline/finalization.js +3 -2
- package/dist/src/smiths/context-pipeline/generator.js +7 -19
- package/dist/src/smiths/context-pipeline/legacy-inject.js +3 -10
- package/dist/src/smiths/context-pipeline/managed-hook.js +5 -5
- package/dist/src/smiths/context-pipeline/parallelism-section.js +72 -5
- package/dist/src/smiths/context-pipeline/workspace-context.js +110 -22
- package/dist/src/tracker/project-inputs.js +2 -0
- package/dist/src/update/checker.d.mts +4 -0
- package/dist/src/update/checker.mjs +14 -0
- package/dist/src/update/notifier.mjs +2 -4
- package/dist/src/writing/exemplar-selection.js +6 -6
- package/dist/src/writing/voice-evaluation.js +24 -23
- package/dist/src/writing/writer-migration.js +14 -13
- package/dist/src/writing/writer-profile.js +19 -18
- package/dist/src/writing/writing-brief.js +18 -17
- package/dist/src/writing/writing-receipt.js +47 -46
- package/package.json +5 -2
- package/schemas/decision/DecisionReview.schema.json +78 -1
- package/schemas/mission-v1.schema.json +3 -0
- package/tools/agents/deploy-agents.mjs +67 -39
- package/tools/agents/providers/antigravity.mjs +6 -1
- package/tools/agents/providers/base.mjs +24 -14
- package/tools/agents/providers/claude.mjs +6 -3
- package/tools/agents/providers/codex.mjs +54 -57
- package/tools/agents/providers/context-write.mjs +28 -0
- package/tools/agents/providers/copilot.mjs +13 -4
- package/tools/agents/providers/cursor.mjs +1 -1
- package/tools/agents/providers/deepseek-harness.mjs +1 -1
- package/tools/agents/providers/factory.mjs +7 -1
- package/tools/agents/providers/grok-build.mjs +18 -2
- package/tools/agents/providers/grokbot.mjs +1 -1
- package/tools/agents/providers/hermes.mjs +12 -15
- package/tools/agents/providers/muse-hooks.mjs +21 -14
- package/tools/agents/providers/muse.mjs +7 -2
- package/tools/agents/providers/omp.mjs +31 -5
- package/tools/agents/providers/opencode.mjs +14 -5
- package/tools/agents/providers/openhuman.mjs +1 -1
- package/tools/agents/providers/pi.mjs +1 -1
- package/tools/agents/providers/provider-prepare-coordinator.mjs +29 -9
- package/tools/agents/providers/rule-delivery.mjs +289 -80
- package/tools/agents/providers/warp.mjs +4 -1
- package/tools/agents/providers/windsurf.mjs +13 -3
- package/tools/cli/workspace-status.mjs +5 -0
- package/tools/commands/deploy-prompts-codex.mjs +11 -8
- package/tools/ralph-external/lib/codex-adapter.mjs +6 -2
- package/tools/ralph-external/lib/consecutive-failure-circuit-breaker.mjs +26 -0
- package/tools/ralph-external/lib/launcher-recovery-evidence.mjs +7 -1
- package/tools/ralph-external/lib/muse-adapter.mjs +12 -2
- package/tools/ralph-external/lib/recovery-probe.mjs +14 -4
- package/tools/ralph-external/lib/worker-health.mjs +1 -1
- package/tools/ralph-external/lib/worker-isolation.mjs +65 -9
- package/tools/ralph-external/process-monitor.mjs +49 -8
- package/tools/ralph-external/session-launcher.mjs +405 -35
- package/tools/skills/deploy-skills-codex.mjs +11 -7
- package/vscode-extension/schemas/aiwg.config.v1.json +11 -1
|
@@ -701,6 +701,33 @@ async function removeUserScopeDeploy(args) {
|
|
|
701
701
|
message: linesOut.join('\n') + '\n',
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
+
/** List only unrecorded paths; recorded decisions come from the ownership plan. */
|
|
705
|
+
function previewUnrecordedSkillFiles(skillDir, owned, plan, skillRoots) {
|
|
706
|
+
// Some adapters (Hermes) put the bulk root directly inside the kernel root.
|
|
707
|
+
if (skillRoots.includes(skillDir))
|
|
708
|
+
return;
|
|
709
|
+
const recorded = new Set(plan.map(entry => entry.path));
|
|
710
|
+
const visit = (target) => {
|
|
711
|
+
if (recorded.has(path.resolve(target)))
|
|
712
|
+
return;
|
|
713
|
+
let reason = owned ? 'unrecorded operator file' : 'foreign or unverifiable ownership receipt';
|
|
714
|
+
try {
|
|
715
|
+
const stat = fsSync.lstatSync(target);
|
|
716
|
+
if (stat.isDirectory()) {
|
|
717
|
+
for (const name of fsSync.readdirSync(target).sort())
|
|
718
|
+
visit(path.join(target, name));
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
if (owned && stat.isSymbolicLink())
|
|
722
|
+
reason = 'symlink preserved';
|
|
723
|
+
}
|
|
724
|
+
catch {
|
|
725
|
+
reason = 'missing or unreadable path; cannot verify';
|
|
726
|
+
}
|
|
727
|
+
plan.push({ path: path.resolve(target), action: 'preserve', reason });
|
|
728
|
+
};
|
|
729
|
+
visit(skillDir);
|
|
730
|
+
}
|
|
704
731
|
/**
|
|
705
732
|
* Remove framework handler
|
|
706
733
|
*
|
|
@@ -712,6 +739,41 @@ export const removeHandler = {
|
|
|
712
739
|
description: "Remove installed framework, plugin, or project-local bundle",
|
|
713
740
|
category: "framework",
|
|
714
741
|
aliases: [],
|
|
742
|
+
async help() {
|
|
743
|
+
return { exitCode: 0, rawOutput: true, message: [
|
|
744
|
+
'Usage: aiwg remove <id> [options]',
|
|
745
|
+
'',
|
|
746
|
+
'Remove an installed framework, plugin, or project-local bundle by id (for example all or sdlc).',
|
|
747
|
+
'Project scope is the default; without --provider, process all recorded provider deployments.',
|
|
748
|
+
'"all" is an installed bundle id, not a wildcard for every installed entry.',
|
|
749
|
+
'Bundled deployments release skill ownership receipts and delete only unchanged recorded files.',
|
|
750
|
+
'Project-local removal reverts deployed artifacts using recorded hashes; bundle source is preserved.',
|
|
751
|
+
'',
|
|
752
|
+
'Options:',
|
|
753
|
+
' --dry-run List planned removals and preserved paths with reasons; write nothing.',
|
|
754
|
+
' --provider <p> Select one recorded provider deployment.',
|
|
755
|
+
' --keep-registry Keep project installed/deployedTo records after removal. By default,',
|
|
756
|
+
' remove selected deployment records and drop the id when none remain.',
|
|
757
|
+
' Project-local partial reverts retain their registry records.',
|
|
758
|
+
' --force Override project-local mutation refusal or legacy plugin dependency checks;',
|
|
759
|
+
' does not override bundled skill hash/ownership preservation.',
|
|
760
|
+
' --scope user Remove the user-scope mirror using ~/.aiwg/installed.json instead.',
|
|
761
|
+
' --user Alias for --scope user; user mirror removal updates its own registry.',
|
|
762
|
+
' --target <d> Target a project directory (alias: --prefix; default: cwd).',
|
|
763
|
+
' --help, -h Show this help.',
|
|
764
|
+
'',
|
|
765
|
+
'Bundled skill removal preserves modified files, unrecorded operator files, foreign skills,',
|
|
766
|
+
'and symlinks inside skill directories. Project-local bundle source is never deleted.',
|
|
767
|
+
'User-scope legacy records without artifact manifests require manual file cleanup.',
|
|
768
|
+
'Unregistered ids fall back to the legacy plugin uninstaller (also supports --keep-data).',
|
|
769
|
+
'',
|
|
770
|
+
'Examples:',
|
|
771
|
+
' aiwg remove all --dry-run',
|
|
772
|
+
' aiwg remove sdlc --provider claude --dry-run',
|
|
773
|
+
' aiwg remove my-bundle --keep-registry',
|
|
774
|
+
' aiwg remove sdlc --scope user --provider codex --dry-run',
|
|
775
|
+
].join('\n') };
|
|
776
|
+
},
|
|
715
777
|
async execute(ctx) {
|
|
716
778
|
// Explicit provider removal is separate from framework removal. The native
|
|
717
779
|
// adapter validates receipt hashes and preserves operator modifications.
|
|
@@ -798,13 +860,29 @@ export const removeHandler = {
|
|
|
798
860
|
return { exitCode: 1, message: `Error: '${positionalArg}' is not deployed for provider '${providerParse.provider}'.` };
|
|
799
861
|
}
|
|
800
862
|
let released = 0;
|
|
863
|
+
const lines = [];
|
|
801
864
|
for (const provider of providers) {
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
865
|
+
if (dryRun)
|
|
866
|
+
lines.push(` Provider ${provider}:`);
|
|
867
|
+
const providerStart = lines.length;
|
|
868
|
+
const skillRoots = deployedSkillRoots(projectDir, provider);
|
|
869
|
+
for (const root of skillRoots) {
|
|
870
|
+
for (const name of (await fs.readdir(root).catch(() => [])).sort()) {
|
|
871
|
+
const skillDir = path.join(root, name);
|
|
872
|
+
const plan = [];
|
|
873
|
+
const owned = releaseSkillOwnership(skillDir, { frameworkSlug }, { dryRun, plan }) !== null;
|
|
874
|
+
if (owned)
|
|
805
875
|
released++;
|
|
876
|
+
if (dryRun) {
|
|
877
|
+
previewUnrecordedSkillFiles(skillDir, owned, plan, skillRoots);
|
|
878
|
+
for (const entry of plan) {
|
|
879
|
+
lines.push(` Would ${entry.action} ${path.relative(projectDir, entry.path)} — ${entry.reason}`);
|
|
880
|
+
}
|
|
881
|
+
}
|
|
806
882
|
}
|
|
807
883
|
}
|
|
884
|
+
if (dryRun && lines.length === providerStart)
|
|
885
|
+
lines.push(' No deployed skill files found.');
|
|
808
886
|
if (!dryRun && !ctx.args.includes('--keep-registry'))
|
|
809
887
|
delete entry.deployedTo[provider];
|
|
810
888
|
}
|
|
@@ -813,7 +891,13 @@ export const removeHandler = {
|
|
|
813
891
|
delete config.installed[positionalArg];
|
|
814
892
|
await writeAiwgConfig(projectDir, config);
|
|
815
893
|
}
|
|
816
|
-
|
|
894
|
+
if (dryRun) {
|
|
895
|
+
lines.push(ctx.args.includes('--keep-registry')
|
|
896
|
+
? ' Registry preserved (--keep-registry).'
|
|
897
|
+
: ` Would update .aiwg/aiwg.config: release ${providers.join(', ')} deployment record(s) for '${positionalArg}'; drop the id if none remain.`);
|
|
898
|
+
}
|
|
899
|
+
lines.push(`${dryRun ? 'Would release' : 'Released'} ${released} skill ownership receipt(s); operator files preserved.`);
|
|
900
|
+
return { exitCode: 0, message: lines.join('\n') };
|
|
817
901
|
}
|
|
818
902
|
if (config && entry?.source === 'project-local') {
|
|
819
903
|
const force = ctx.args.includes('--force');
|
|
@@ -1461,7 +1545,7 @@ export const featuresHandler = {
|
|
|
1461
1545
|
export const showHandler = {
|
|
1462
1546
|
id: "show",
|
|
1463
1547
|
name: "Show",
|
|
1464
|
-
description: "
|
|
1548
|
+
description: "Show an AIWG metadata card; --section or --body fetches content",
|
|
1465
1549
|
category: "index",
|
|
1466
1550
|
aliases: [],
|
|
1467
1551
|
async execute(ctx) {
|
|
@@ -1700,17 +1784,43 @@ export const reflectionsHandler = {
|
|
|
1700
1784
|
export const memoryHandler = {
|
|
1701
1785
|
id: 'memory',
|
|
1702
1786
|
name: 'Memory',
|
|
1703
|
-
description: 'Memory
|
|
1787
|
+
description: 'Memory storage, project registry, read-only audit/cost/recommendations, and reviewed lifecycle operations',
|
|
1704
1788
|
category: 'utility',
|
|
1705
1789
|
aliases: [],
|
|
1790
|
+
async help(ctx) {
|
|
1791
|
+
if (ctx.args[0] === 'cost') {
|
|
1792
|
+
const { MEMORY_COST_USAGE } = await import('../../memory/cli.js');
|
|
1793
|
+
return { exitCode: 0, message: MEMORY_COST_USAGE, rawOutput: true };
|
|
1794
|
+
}
|
|
1795
|
+
if (ctx.args[0] === 'recommend') {
|
|
1796
|
+
const { MEMORY_RECOMMEND_USAGE } = await import('../../memory/recommend-cli.js');
|
|
1797
|
+
return { exitCode: 0, message: MEMORY_RECOMMEND_USAGE, rawOutput: true };
|
|
1798
|
+
}
|
|
1799
|
+
if (['plan', 'apply', 'verify', 'restore'].includes(ctx.args[0])) {
|
|
1800
|
+
const { MEMORY_MAINTENANCE_USAGE } = await import('../../memory/maintenance-cli.js');
|
|
1801
|
+
return { exitCode: 0, message: MEMORY_MAINTENANCE_USAGE, rawOutput: true };
|
|
1802
|
+
}
|
|
1803
|
+
const { MEMORY_AUDIT_USAGE } = await import('../../memory/cli.js');
|
|
1804
|
+
return { exitCode: 0, message: MEMORY_AUDIT_USAGE, rawOutput: true };
|
|
1805
|
+
},
|
|
1706
1806
|
async execute(ctx) {
|
|
1707
1807
|
try {
|
|
1708
1808
|
const { main } = await import('../../memory/cli.js');
|
|
1709
|
-
await main(ctx.args);
|
|
1710
|
-
return { exitCode: 0 };
|
|
1809
|
+
return { exitCode: (await main(ctx.args)) ?? 0 };
|
|
1711
1810
|
}
|
|
1712
1811
|
catch (error) {
|
|
1713
1812
|
const result = handlerResultFromError(error);
|
|
1813
|
+
if (['audit', 'cost', 'recommend', 'plan', 'apply', 'verify', 'restore'].includes(ctx.args[0])) {
|
|
1814
|
+
const { isAiwgError } = await import('../errors.js');
|
|
1815
|
+
const exitCode = isAiwgError(error) ? error.exitCode : 3;
|
|
1816
|
+
const receipt = error && typeof error === 'object' && 'receipt' in error ? error.receipt : undefined;
|
|
1817
|
+
if (ctx.args.includes('--json')) {
|
|
1818
|
+
console.log(JSON.stringify({ error: result.message, exitCode,
|
|
1819
|
+
...(receipt !== undefined ? { receipt } : {}) }, null, 2));
|
|
1820
|
+
return { exitCode };
|
|
1821
|
+
}
|
|
1822
|
+
return { ...result, exitCode, message: `memory command failed: ${result.message}${receipt !== undefined ? `\n${JSON.stringify({ receipt }, null, 2)}` : ''}` };
|
|
1823
|
+
}
|
|
1714
1824
|
return { ...result, message: `memory command failed: ${result.message}` };
|
|
1715
1825
|
}
|
|
1716
1826
|
},
|