@aiwg/cli 2026.11.7 → 2026.11.9
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/README.md +1 -1
- package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +3 -2
- package/agentic/code/providers/capability-matrix.yaml +4 -4
- package/agentic/code/providers/model-capabilities.v1.json +169 -46
- package/agentic/code/providers/model-catalog.v1.json +17 -15
- package/bin/aiwg.mjs +3 -1
- package/dist/src/agents/agent-packager.js +3 -3
- package/dist/src/artifacts/cli.js +6 -2
- package/dist/src/artifacts/fortemi-core-sync.js +2 -0
- package/dist/src/artifacts/index-query-help.js +27 -0
- package/dist/src/artifacts/query-engine-installation.js +17 -4
- package/dist/src/artifacts/query-engine-name-intent.js +56 -0
- package/dist/src/artifacts/query-engine-scoring.js +14 -8
- package/dist/src/artifacts/query-engine-show-card.js +3 -3
- package/dist/src/cli/agent-spawn.js +4 -4
- package/dist/src/cli/handlers/best-practices-audit.js +1 -1
- package/dist/src/cli/handlers/bundle-deployment-mode.js +26 -13
- package/dist/src/cli/handlers/bundle-reconciliation.js +2 -2
- package/dist/src/cli/handlers/init.js +1 -1
- package/dist/src/cli/handlers/issues.js +5 -0
- package/dist/src/cli/handlers/marketplace-plugin-search.js +6 -5
- package/dist/src/cli/handlers/marketplace.js +1 -1
- package/dist/src/cli/handlers/models-muse-wrapper.js +32 -0
- package/dist/src/cli/handlers/models.js +5 -4
- package/dist/src/cli/handlers/refresh-artifact-freshness.js +51 -0
- package/dist/src/cli/handlers/refresh-bundles.js +3 -0
- package/dist/src/cli/handlers/refresh-managed-deployment.js +19 -7
- package/dist/src/cli/handlers/refresh-user-hooks.js +102 -0
- package/dist/src/cli/handlers/refresh.js +9 -3
- package/dist/src/cli/handlers/repo-access.js +15 -2
- package/dist/src/cli/handlers/sdlc-accelerate.js +1 -1
- package/dist/src/cli/handlers/steward.js +1 -1
- package/dist/src/cli/handlers/subcommands-bundles.js +1 -1
- package/dist/src/cli/handlers/subcommands-discovery.js +5 -0
- package/dist/src/cli/handlers/subcommands-list.js +1 -1
- package/dist/src/cli/handlers/subcommands-plugins.js +1 -1
- package/dist/src/cli/handlers/subcommands-storage.js +11 -0
- package/dist/src/cli/handlers/team.js +1 -1
- package/dist/src/cli/handlers/use-additive-bundles.js +9 -2
- package/dist/src/cli/handlers/use-bundle-counts.js +1 -1
- package/dist/src/cli/handlers/use-copy-selection.js +42 -0
- package/dist/src/cli/handlers/use.js +33 -38
- package/dist/src/cli/handlers/workspace-context.js +4 -0
- package/dist/src/cli/help-generator.js +1 -1
- package/dist/src/cli/new-project-options.js +46 -0
- package/dist/src/cli/router.js +15 -4
- package/dist/src/cli/scope-resolver.js +6 -6
- package/dist/src/cli/services/deployment-probe-scope.js +11 -0
- package/dist/src/cli/services/deployment-staleness.js +83 -0
- package/dist/src/cli/services/deployment-verification.js +20 -11
- package/dist/src/config/aiwg-config.js +1 -1
- package/dist/src/config/authorization-cli.js +36 -1
- package/dist/src/config/config-normalization.js +3 -1
- package/dist/src/config/worker-guidance-warning.js +8 -0
- package/dist/src/data/community.yaml +3 -3
- package/dist/src/extensions/commands/definitions.js +2 -2
- package/dist/src/extensions/manifest.js +27 -1
- package/dist/src/extensions/user-hook-diagnostics.js +18 -1
- package/dist/src/extensions/verified-hook-command.js +9 -0
- package/dist/src/features/catalog.js +2 -2
- package/dist/src/issues/cli.js +10 -2
- package/dist/src/marketplace/cache.js +31 -0
- package/dist/src/marketplace/plugin-search.js +39 -20
- package/dist/src/marketplace/public-search.js +122 -0
- package/dist/src/marketplace/registry.js +2 -0
- package/dist/src/marketplace/search-contract.js +19 -0
- package/dist/src/marketplace/sources/public-search.js +81 -0
- package/dist/src/mcp/cli.mjs +8 -7
- package/dist/src/mcp/credentials.mjs +1 -1
- package/dist/src/mcp/registry.js +6 -2
- package/dist/src/mcp/tool-filters.mjs +1 -1
- package/dist/src/memory/provider-memory-adapter.js +1 -1
- package/dist/src/models/catalog-policy.js +2 -1
- package/dist/src/models/config-loader.js +2 -1
- package/dist/src/models/cursor-models.js +92 -0
- package/dist/src/models/cursor-worker-version.d.mts +2 -0
- package/dist/src/models/cursor-worker-version.mjs +27 -0
- package/dist/src/models/model-capabilities.v1.json +169 -46
- package/dist/src/models/model-catalog.v1.json +17 -15
- package/dist/src/models/model-discovery.js +7 -6
- package/dist/src/models/policy-resources.js +1 -1
- package/dist/src/models/provider-policy.js +1 -1
- package/dist/src/models/worker-direct-readiness.js +8 -5
- package/dist/src/models/worker-health-readiness.js +4 -0
- package/dist/src/models/worker-installation.d.mts +5 -2
- package/dist/src/models/worker-installation.mjs +20 -12
- package/dist/src/models/worker-invocation-policy.js +22 -2
- package/dist/src/models/worker-plan.js +3 -1
- package/dist/src/models/worker-wiring-diagnostics.js +25 -0
- package/dist/src/models/wrapper-deployment.js +1 -1
- package/dist/src/models/wrapper-enforcement.js +6 -2
- package/dist/src/plugin/skill-command-frontmatter.js +1 -1
- package/dist/src/plugin/skill-command-translator.js +1 -1
- package/dist/src/policy/repo-access-workspace-spec.js +63 -0
- package/dist/src/policy/repo-access.js +22 -0
- package/dist/src/providers/capability-matrix.yaml +4 -4
- package/dist/src/providers/deployment-ownership.mjs +1 -1
- package/dist/src/providers/deployment-preservation.mjs +10 -5
- package/dist/src/providers/deployment-removal.js +1 -1
- package/dist/src/providers/devin-compat.d.mts +4 -0
- package/dist/src/providers/devin-compat.mjs +29 -0
- package/dist/src/providers/grok-build-acp.js +39 -9
- package/dist/src/providers/grok-build-paths.js +8 -7
- package/dist/src/providers/provider-context-contracts.js +7 -3
- package/dist/src/providers/provider-definition-schema.js +1 -1
- package/dist/src/providers/provider-definitions.js +1 -1
- package/dist/src/providers/provider-definitions.mjs +3 -3
- package/dist/src/providers/provider-inventory.js +13 -1
- package/dist/src/providers/provider-seeds-1.js +1 -1
- package/dist/src/providers/provider-seeds-3.js +10 -9
- package/dist/src/providers/transformation-receipt-integration.js +1 -1
- package/dist/src/sessions/adapters/windsurf.js +7 -7
- package/dist/src/sessions/grok-build-cli-output.js +1 -1
- package/dist/src/sessions/grok-build-cli.js +7 -1
- package/dist/src/skills/bundle-import-cli.js +61 -0
- package/dist/src/skills/bundle-import-plan.js +108 -0
- package/dist/src/skills/bundle-import.js +192 -0
- package/dist/src/skills/cli.js +5 -0
- package/dist/src/skills/deployment-policy.js +1 -1
- package/dist/src/skills/importer.js +4 -4
- package/dist/src/smiths/agentsmith/demo.js +1 -1
- package/dist/src/smiths/agentsmith/examples.js +6 -6
- package/dist/src/smiths/commandsmith/generator.js +1 -1
- package/dist/src/smiths/context-pipeline/allowlist.js +1 -1
- package/dist/src/smiths/context-pipeline/muse-bridge.js +7 -4
- package/dist/src/smiths/context-pipeline/parallelism-section.js +2 -2
- package/dist/src/smiths/context-pipeline/workspace-audit.js +37 -6
- package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +3 -1
- package/dist/src/smiths/context-pipeline/workspace-doctor.js +16 -4
- package/dist/src/smiths/context-pipeline/workspace-document.js +4 -2
- package/dist/src/smiths/hook-bridge/codex-trust.js +56 -7
- package/dist/src/smiths/hook-bridge/cursor-translator.js +89 -0
- package/dist/src/smiths/hook-bridge/index.js +4 -1
- package/dist/src/smiths/skillsmith/collision-detector.js +1 -1
- package/dist/src/smiths/skillsmith/namespace-adapter.js +1 -1
- package/dist/src/smiths/skillsmith/platform-resolver.js +2 -2
- package/dist/src/writing/campaign-report.js +4 -3
- package/dist/src/writing/contextual-diagnostics.js +29 -3
- package/dist/src/writing/current-patterns.catalogue.json +4 -4
- package/dist/src/writing/current-patterns.js +3 -2
- package/dist/src/writing/structural-judgment.catalogue.json +17 -0
- package/dist/src/writing/structural-judgment.js +33 -0
- package/dist/src/writing/structural-patterns.js +78 -6
- package/dist/src/writing/validation-campaign.js +3 -0
- package/dist/src/writing/validation-engine.js +7 -4
- package/package.json +4 -2
- package/schemas/models/model-config-compatibility.v1.schema.json +1 -1
- package/tools/agents/deploy-agents.mjs +12 -10
- package/tools/agents/deploy-options.mjs +1 -0
- package/tools/agents/providers/base-behaviors.mjs +1 -1
- package/tools/agents/providers/base-contract.mjs +1 -1
- package/tools/agents/providers/base-kernel-skills.mjs +1 -1
- package/tools/agents/providers/base-models-platforms.mjs +9 -7
- package/tools/agents/providers/base-rule-index.mjs +1 -1
- package/tools/agents/providers/codex.mjs +1 -0
- package/tools/agents/providers/cursor-prompt-discovery.mjs +13 -0
- package/tools/agents/providers/cursor.mjs +2 -0
- package/tools/agents/providers/devin.mjs +3 -0
- package/tools/agents/providers/grok-build.mjs +14 -19
- package/tools/agents/providers/hook-capabilities.mjs +1 -1
- package/tools/agents/providers/model-wrapper.mjs +1 -1
- package/tools/agents/providers/openclaw-context.mjs +6 -0
- package/tools/agents/providers/openclaw.mjs +14 -12
- package/tools/agents/providers/rule-delivery-surface.mjs +15 -11
- package/tools/agents/providers/rule-deployment-prepare.mjs +9 -8
- package/tools/agents/providers/rule-presentation.mjs +1 -1
- package/tools/agents/providers/rule-projection.mjs +5 -5
- package/tools/agents/providers/rule-startup.mjs +4 -2
- package/tools/agents/providers/skill-copy-prune.mjs +5 -1
- package/tools/agents/providers/windsurf.mjs +26 -26
- package/tools/agents/use-rule-selection.mjs +1 -1
- package/tools/cli/workspace-deployment-health.mjs +38 -0
- package/tools/cli/workspace-status.mjs +5 -2
- package/tools/daemon/provider-watcher.mjs +3 -3
- package/tools/plugin/package-plugins.mjs +16 -2
- package/tools/ralph-external/lib/deepseek-harness-adapter.mjs +36 -22
- package/tools/ralph-external/lib/factory-adapter.mjs +13 -28
- package/tools/ralph-external/lib/factory-stream-final.mjs +31 -0
- package/tools/skills/deploy-skills-codex.mjs +2 -1
- package/vscode-extension/schemas/aiwg.config.v1.json +15 -1
|
@@ -7,6 +7,7 @@ import { managedClaudeHooks } from '../../extensions/claude-hooks-installer.js';
|
|
|
7
7
|
import { verifiedHookCommand } from '../../extensions/verified-hook-command.js';
|
|
8
8
|
import { managedMuseHooks } from '../../extensions/muse-managed-hooks.js';
|
|
9
9
|
import { managedHookScriptState } from '../../extensions/managed-hook-script-state.js';
|
|
10
|
+
import { managedCursorPromptHook } from '../../smiths/hook-bridge/cursor-translator.js';
|
|
10
11
|
import { managedFactoryHooks } from '../../smiths/hook-bridge/factory-translator.js';
|
|
11
12
|
import { readFactoryDocument } from '../../smiths/hook-bridge/factory-hook-config.js';
|
|
12
13
|
import { loadHookSources } from '../../smiths/hook-bridge/loader.js';
|
|
@@ -41,8 +42,8 @@ function groups(doc, event) {
|
|
|
41
42
|
const hooks = doc.hooks;
|
|
42
43
|
return Array.isArray(hooks?.[event]) ? hooks[event] : [];
|
|
43
44
|
}
|
|
44
|
-
async function staleHooks(projectRoot, frameworkRoot, provider) {
|
|
45
|
-
if (!['claude', 'muse', 'factory', 'codex'].includes(provider))
|
|
45
|
+
async function staleHooks(projectRoot, frameworkRoot, provider, scope) {
|
|
46
|
+
if (!['claude', 'muse', 'factory', 'codex', 'cursor'].includes(provider))
|
|
46
47
|
return [];
|
|
47
48
|
const file = provider === 'claude' ? '.claude/settings.json' : `.${provider}/hooks.json`;
|
|
48
49
|
let doc;
|
|
@@ -54,12 +55,23 @@ async function staleHooks(projectRoot, frameworkRoot, provider) {
|
|
|
54
55
|
return [{ name: `${provider} managed hooks`, file, reason: 'unreadable' }];
|
|
55
56
|
}
|
|
56
57
|
const stale = [];
|
|
57
|
-
if (provider === '
|
|
58
|
+
if (provider === 'cursor') {
|
|
59
|
+
const expected = managedCursorPromptHook(projectRoot, await fs.readFile(path.join(frameworkRoot, 'agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs')));
|
|
60
|
+
const hooks = doc.hooks?.beforeSubmitPrompt;
|
|
61
|
+
const candidates = Array.isArray(hooks) ? hooks.filter(hook => hook?._aiwg_id === expected._aiwg_id) : [];
|
|
62
|
+
if (!candidates.some(hook => hook.type === expected.type && hook.command === expected.command
|
|
63
|
+
&& hook.timeout === expected.timeout && hook._aiwg_managed === true)) {
|
|
64
|
+
stale.push({ name: `beforeSubmitPrompt → ${expected._aiwg_id}`, file, reason: candidates.length ? 'outdated' : 'missing' });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
else if (provider === 'codex') {
|
|
58
68
|
const { sources } = await loadHookSources(frameworkRoot);
|
|
59
69
|
const source = sources.find(hook => hook.id === 'aiwg-prompt-discovery');
|
|
60
70
|
if (!source?.args?.[0])
|
|
61
71
|
return [];
|
|
62
|
-
const
|
|
72
|
+
const anchor = scope === 'user' ? path.join(projectRoot, '.codex') : projectRoot;
|
|
73
|
+
const script = scope === 'user' ? 'hooks/aiwg-prompt-discovery.cjs' : '.codex/hooks/aiwg-prompt-discovery.cjs';
|
|
74
|
+
const expected = verifiedHookCommand(anchor, script, await fs.readFile(source.args[0]), [], scope);
|
|
63
75
|
const candidates = groups(doc, 'UserPromptSubmit').flatMap(group => group.hooks || [])
|
|
64
76
|
.filter(hook => hook._aiwg_id === source.id);
|
|
65
77
|
if (!candidates.some(hook => hook.command === expected && hook.statusMessage === 'AIWG prompt discovery'))
|
|
@@ -169,7 +181,7 @@ async function staleHookScripts(projectRoot, frameworkRoot, provider) {
|
|
|
169
181
|
else if (provider === 'muse') {
|
|
170
182
|
scripts.set('.muse/hooks/aiwg-prompt-discovery.cjs', path.join(source, 'aiwg-prompt-discovery.cjs'));
|
|
171
183
|
}
|
|
172
|
-
else if (provider === 'codex' || provider === 'factory') {
|
|
184
|
+
else if (provider === 'codex' || provider === 'factory' || provider === 'cursor') {
|
|
173
185
|
// Match installCodexPromptDiscovery: resolve packaged canonical arguments,
|
|
174
186
|
// not the portable launcher command emitted into hooks.json.
|
|
175
187
|
const { sources, errors } = await loadHookSources(frameworkRoot);
|
|
@@ -190,10 +202,10 @@ async function staleHookScripts(projectRoot, frameworkRoot, provider) {
|
|
|
190
202
|
return stale;
|
|
191
203
|
}
|
|
192
204
|
export async function checkManagedDeployment(options) {
|
|
193
|
-
const { projectRoot, frameworkRoot, provider, quiet } = options;
|
|
205
|
+
const { projectRoot, frameworkRoot, provider, quiet, scope = 'project' } = options;
|
|
194
206
|
const pkg = await readJson(path.join(frameworkRoot, 'package.json'));
|
|
195
207
|
const [hooks, scripts, rules] = await Promise.all([
|
|
196
|
-
staleHooks(projectRoot, frameworkRoot, provider),
|
|
208
|
+
staleHooks(projectRoot, frameworkRoot, provider, scope),
|
|
197
209
|
staleHookScripts(projectRoot, frameworkRoot, provider),
|
|
198
210
|
typeof pkg.version === 'string' ? staleRules(projectRoot, provider, pkg.version) : [],
|
|
199
211
|
]);
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// Migrate only existing legacy user hook registrations, preserving operator settings.
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import { managedClaudeHooks } from '../../extensions/claude-hooks-installer.js';
|
|
6
|
+
import { managedMuseHooks } from '../../extensions/muse-managed-hooks.js';
|
|
7
|
+
import { managedHookScriptState } from '../../extensions/managed-hook-script-state.js';
|
|
8
|
+
import { diagnoseUserHookCommands } from '../../extensions/user-hook-diagnostics.js';
|
|
9
|
+
import { captureDeploymentOutputs, recordDeploymentOutputs } from '../../providers/deployment-ownership.mjs';
|
|
10
|
+
import * as ui from '../ui.js';
|
|
11
|
+
function relativeCommand(command) {
|
|
12
|
+
if (typeof command !== 'string')
|
|
13
|
+
return;
|
|
14
|
+
const match = /^node\s+(?:"([^"]+)"|'([^']+)'|(\S+))(?:\s+(start|stop))?\s*$/.exec(command);
|
|
15
|
+
if (!match)
|
|
16
|
+
return;
|
|
17
|
+
const script = (match[1] || match[2] || match[3]).replace(/\\/g, '/').replace(/\.js$/, '.cjs');
|
|
18
|
+
return `node ${script}${match[4] ? ` ${match[4]}` : ''}`;
|
|
19
|
+
}
|
|
20
|
+
export async function refreshUserHooks(options) {
|
|
21
|
+
const { frameworkRoot, provider, dryRun, quiet } = options;
|
|
22
|
+
if (!['claude', 'muse'].includes(provider))
|
|
23
|
+
return;
|
|
24
|
+
const home = os.homedir();
|
|
25
|
+
const directory = path.join(home, `.${provider}`);
|
|
26
|
+
const file = path.join(directory, provider === 'claude' ? 'settings.json' : 'hooks.json');
|
|
27
|
+
const diagnostics = await diagnoseUserHookCommands();
|
|
28
|
+
if (!diagnostics.some(diagnostic => diagnostic.path === file))
|
|
29
|
+
return;
|
|
30
|
+
const doc = JSON.parse(await fs.readFile(file, 'utf8'));
|
|
31
|
+
const source = path.join(frameworkRoot, 'agentic/code/addons/aiwg-hooks/hooks');
|
|
32
|
+
const files = await fs.readdir(source);
|
|
33
|
+
const canonical = provider === 'claude'
|
|
34
|
+
? managedClaudeHooks(files, home, source, 'user').map((hook, i) => ({ ...hook,
|
|
35
|
+
relativeCommand: managedClaudeHooks(files)[i].command }))
|
|
36
|
+
: managedMuseHooks(home, await fs.readFile(path.join(source, 'aiwg-prompt-discovery.cjs')), 'user')
|
|
37
|
+
.filter(hook => hook.id === 'aiwg-prompt-discovery').map(hook => ({ event: hook.event,
|
|
38
|
+
script: '.muse/hooks/aiwg-prompt-discovery.cjs', command: hook.group.hooks[0].command,
|
|
39
|
+
relativeCommand: 'node .muse/hooks/aiwg-prompt-discovery.cjs' }));
|
|
40
|
+
const scripts = new Map();
|
|
41
|
+
let count = 0;
|
|
42
|
+
for (const hook of canonical) {
|
|
43
|
+
const groups = doc.hooks?.[hook.event];
|
|
44
|
+
if (!Array.isArray(groups))
|
|
45
|
+
continue;
|
|
46
|
+
for (const group of groups) {
|
|
47
|
+
for (const entry of Array.isArray(group?.hooks) ? group.hooks : []) {
|
|
48
|
+
if (entry?.type !== 'command' || relativeCommand(entry.command) !== hook.relativeCommand)
|
|
49
|
+
continue;
|
|
50
|
+
entry.command = hook.command;
|
|
51
|
+
scripts.set(hook.script, await fs.readFile(path.join(source, path.basename(hook.script))));
|
|
52
|
+
count++;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!count)
|
|
57
|
+
return;
|
|
58
|
+
// Validate every script before making any writes or blessing a new digest.
|
|
59
|
+
for (const [script, bytes] of scripts) {
|
|
60
|
+
const state = await managedHookScriptState(home, script, bytes);
|
|
61
|
+
if (state === 'operator-edited' || state === 'unreadable')
|
|
62
|
+
throw new Error(`${script}: kept (${state}); user hook migration needs review`);
|
|
63
|
+
}
|
|
64
|
+
if (dryRun) {
|
|
65
|
+
if (!quiet)
|
|
66
|
+
ui.info(`Would anchor ${count} ${provider} user hook(s) — ${file} (with backup)`);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const before = captureDeploymentOutputs([directory]);
|
|
70
|
+
const backup = `${file}.bak.${new Date().toISOString().replace(/[:.]/g, '-')}`;
|
|
71
|
+
await fs.copyFile(file, backup, fs.constants.COPYFILE_EXCL);
|
|
72
|
+
for (const [script, bytes] of scripts) {
|
|
73
|
+
const target = path.join(home, script);
|
|
74
|
+
await fs.mkdir(path.dirname(target), { recursive: true });
|
|
75
|
+
await fs.writeFile(target, bytes);
|
|
76
|
+
}
|
|
77
|
+
const temporary = `${file}.tmp.${process.pid}`;
|
|
78
|
+
try {
|
|
79
|
+
await fs.writeFile(temporary, JSON.stringify(doc, null, 2) + '\n');
|
|
80
|
+
await fs.rename(temporary, file);
|
|
81
|
+
}
|
|
82
|
+
finally {
|
|
83
|
+
await fs.rm(temporary, { force: true });
|
|
84
|
+
}
|
|
85
|
+
recordDeploymentOutputs(before, [directory], { frameworkSlug: 'aiwg-hooks',
|
|
86
|
+
writtenFiles: [file, ...[...scripts.keys()].map(script => path.join(home, script))] });
|
|
87
|
+
if (!quiet)
|
|
88
|
+
ui.info(`Anchored ${count} ${provider} user hook(s) — backup: ${backup}`);
|
|
89
|
+
}
|
|
90
|
+
/** Run the user-hook migration without letting a review-needed hook abort `aiwg refresh`. */
|
|
91
|
+
export async function refreshUserHooksOrWarn(options, migrate = refreshUserHooks) {
|
|
92
|
+
try {
|
|
93
|
+
await migrate(options);
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const message = `User hook migration skipped: ${error instanceof Error ? error.message : String(error)}`;
|
|
98
|
+
ui.warn(message);
|
|
99
|
+
return message;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=refresh-user-hooks.js.map
|
|
@@ -23,6 +23,8 @@ import { automaticRemovalAllowed } from '../../providers/deployment-preservation
|
|
|
23
23
|
import { refreshDeclaredBundles } from './refresh-bundles.js';
|
|
24
24
|
import { bundledRuleOutputNames } from './refresh-rule-inventory.js';
|
|
25
25
|
import { checkManagedDeployment, sourcePrebuiltIndexRepairHint } from './refresh-managed-deployment.js';
|
|
26
|
+
import { hasCurrentBundledArtifact } from './refresh-artifact-freshness.js';
|
|
27
|
+
import { refreshUserHooksOrWarn } from './refresh-user-hooks.js';
|
|
26
28
|
import { getFrameworkRoot } from '../../channel/manager.mjs';
|
|
27
29
|
import { refreshAllPackages } from '../../packages/registry.js';
|
|
28
30
|
import { resolveActiveProvider } from '../provider-resolution.js';
|
|
@@ -40,7 +42,7 @@ const PROVIDER_AGENT_DIRS = {
|
|
|
40
42
|
factory: '.factory/droids',
|
|
41
43
|
opencode: '.opencode/agent',
|
|
42
44
|
warp: '.warp/agents',
|
|
43
|
-
|
|
45
|
+
devin: '.windsurf/agents',
|
|
44
46
|
};
|
|
45
47
|
export async function currentBundledAgentBasenames(frameworkRoot) {
|
|
46
48
|
return new Set((await collectPackagedAgentInventory(frameworkRoot)).keys());
|
|
@@ -157,7 +159,7 @@ async function collectManagedProviderArtifacts(projectRoot, provider, kinds) {
|
|
|
157
159
|
continue;
|
|
158
160
|
}
|
|
159
161
|
for (const entry of entries) {
|
|
160
|
-
if (!entry.isFile() || !entry.name.endsWith('.md'))
|
|
162
|
+
if (!entry.isFile() || !(entry.name.endsWith('.md') || provider === 'codex' && kind === 'agents' && entry.name.endsWith('.toml')))
|
|
161
163
|
continue;
|
|
162
164
|
// Generated indexes are rewritten on every deploy, never orphaned.
|
|
163
165
|
if (entry.name === 'RULES-INDEX.md' || entry.name === 'RULES-ONDEMAND.md')
|
|
@@ -192,8 +194,11 @@ export async function detectStaleProviderTrees(options) {
|
|
|
192
194
|
for (const provider of Object.keys(PROVIDER_AGENT_DIRS)) {
|
|
193
195
|
if (provider === options.provider)
|
|
194
196
|
continue;
|
|
195
|
-
const
|
|
197
|
+
const candidates = (await collectManagedProviderArtifacts(options.projectRoot, provider, PRUNABLE_ARTIFACT_KINDS))
|
|
196
198
|
.filter((hit) => isOlderManagedVersion(hit.version, currentVersion));
|
|
199
|
+
const hits = (await Promise.all(candidates.map(async (hit) => ['claude', 'codex'].includes(provider) && hit.kind !== 'rules'
|
|
200
|
+
&& await hasCurrentBundledArtifact(hit.absolutePath, options.frameworkRoot) ? null : hit)))
|
|
201
|
+
.filter((hit) => hit !== null);
|
|
197
202
|
if (hits.length === 0)
|
|
198
203
|
continue;
|
|
199
204
|
const counts = { agents: 0, commands: 0, rules: 0 };
|
|
@@ -545,6 +550,7 @@ export const refreshHandler = {
|
|
|
545
550
|
if (!quiet)
|
|
546
551
|
ui.dim(' Skipping package update (--skip-update)');
|
|
547
552
|
}
|
|
553
|
+
await refreshUserHooksOrWarn({ frameworkRoot, provider: detectedProvider, dryRun, quiet });
|
|
548
554
|
// Step 4: Re-deploy frameworks. Both the default form and --all mean
|
|
549
555
|
// "all installed", never the `aiwg use all` expansion meta-target. This
|
|
550
556
|
// preserves the operator's selected footprint and removal symmetry.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { checkRepoAccess, findRepoEntry, formatRepoAccessEntry, loadRepoAccessManifest, } from '../../policy/repo-access.js';
|
|
1
|
+
import { checkRepoAccess, findRepoEntry, findRepoAccessManifest, formatRepoAccessEntry, loadRepoAccessManifest, } from '../../policy/repo-access.js';
|
|
2
|
+
import { workspaceSpecEdit, WORKSPACE_SPEC_PATH } from '../../policy/repo-access-workspace-spec.js';
|
|
2
3
|
import { resolveWorkspace } from '../../config/workspace.js';
|
|
3
4
|
import { getProjectDir, readAiwgConfig, writeAiwgConfig, WORKSPACE_REPO_ACTIONS, } from '../../config/aiwg-config.js';
|
|
4
5
|
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
@@ -24,6 +25,7 @@ function usage() {
|
|
|
24
25
|
|
|
25
26
|
Manifest:
|
|
26
27
|
.aiwg/aiwg.config workspace + repos blocks (preferred)
|
|
28
|
+
config/workspace.yaml + config/repository-routing.yaml (itops)
|
|
27
29
|
.aiwg/ops/security/repo-access.manifest.yaml
|
|
28
30
|
.aiwg/security/repo-access.manifest.yaml (fallback)
|
|
29
31
|
`;
|
|
@@ -60,6 +62,10 @@ async function addRepo(ctx, args) {
|
|
|
60
62
|
return { exitCode: 2, message: `Unknown provider: ${provider}. Valid: gitea, github, gitlab` };
|
|
61
63
|
}
|
|
62
64
|
const projectDir = getProjectDir(ctx, args);
|
|
65
|
+
const manifestPath = findRepoAccessManifest(projectDir);
|
|
66
|
+
if (manifestPath?.replace(/\\/g, '/').endsWith(`/${WORKSPACE_SPEC_PATH}`)) {
|
|
67
|
+
return { exitCode: 2, message: workspaceSpecEdit(manifestPath, name, nodePath.resolve(projectDir, repoPath), allowed) };
|
|
68
|
+
}
|
|
63
69
|
const config = await readAiwgConfig(projectDir);
|
|
64
70
|
if (!config)
|
|
65
71
|
return { exitCode: 2, message: `No .aiwg/aiwg.config found in ${projectDir}` };
|
|
@@ -87,6 +93,10 @@ async function removeRepo(ctx, args) {
|
|
|
87
93
|
if (!name)
|
|
88
94
|
return { exitCode: 2, message: 'repo-access remove requires --name <name>' };
|
|
89
95
|
const projectDir = getProjectDir(ctx, args);
|
|
96
|
+
const manifestPath = findRepoAccessManifest(projectDir);
|
|
97
|
+
if (manifestPath?.replace(/\\/g, '/').endsWith(`/${WORKSPACE_SPEC_PATH}`)) {
|
|
98
|
+
return { exitCode: 2, message: workspaceSpecEdit(manifestPath, name) };
|
|
99
|
+
}
|
|
90
100
|
const config = await readAiwgConfig(projectDir);
|
|
91
101
|
if (!config)
|
|
92
102
|
return { exitCode: 2, message: `No .aiwg/aiwg.config found in ${projectDir}` };
|
|
@@ -125,6 +135,9 @@ async function auditRepos(ctx, args) {
|
|
|
125
135
|
let children = [];
|
|
126
136
|
try {
|
|
127
137
|
children = readdirSync(root);
|
|
138
|
+
if (manifest?.source === 'workspace-spec' && existsSync(nodePath.join(root, 'repos'))) {
|
|
139
|
+
children.push(...readdirSync(nodePath.join(root, 'repos')).map(child => nodePath.join('repos', child)));
|
|
140
|
+
}
|
|
128
141
|
}
|
|
129
142
|
catch {
|
|
130
143
|
return { exitCode: 2, message: `Cannot read workspace root: ${root}` };
|
|
@@ -168,7 +181,7 @@ async function handleRepoAccess(ctx) {
|
|
|
168
181
|
printHelp();
|
|
169
182
|
return { exitCode: 0 };
|
|
170
183
|
}
|
|
171
|
-
// add/remove
|
|
184
|
+
// Canonical add/remove must work before any manifest
|
|
172
185
|
// exists — registering the first repo is exactly the bootstrap case (#2531).
|
|
173
186
|
if (subcommand === 'add')
|
|
174
187
|
return await addRepo(ctx, args);
|
|
@@ -120,7 +120,7 @@ PIPELINE OPTIONS:
|
|
|
120
120
|
AGENT OPTIONS:
|
|
121
121
|
--provider <name> Agent system to use (default: claude)
|
|
122
122
|
Spawnable: ${spawnable}
|
|
123
|
-
IDE-integrated (guidance only): copilot, cursor, factory, warp,
|
|
123
|
+
IDE-integrated (guidance only): copilot, cursor, factory, warp, devin
|
|
124
124
|
--dangerous Enable unrestricted mode (skips permission prompts).
|
|
125
125
|
Maps to the provider's native flag — e.g. claude gets
|
|
126
126
|
--dangerously-skip-permissions, codex gets
|
|
@@ -117,7 +117,7 @@ async function handleSteward(args, ctx) {
|
|
|
117
117
|
aiwg steward permissions migrate --apply Back up and atomically normalize config
|
|
118
118
|
|
|
119
119
|
Providers:
|
|
120
|
-
antigravity (agy), claude-code, codex, copilot, cursor, deepseek-harness (dsh), factory, opencode, pi, omp, warp,
|
|
120
|
+
antigravity (agy), claude-code, codex, copilot, cursor, deepseek-harness (dsh), factory, opencode, pi, omp, warp, devin, hermes, openclaw
|
|
121
121
|
|
|
122
122
|
Features:
|
|
123
123
|
cron, agent_teams, tasks, mcp, behaviors, mission_control, daemon
|
|
@@ -243,7 +243,7 @@ export const newBundleHandler = {
|
|
|
243
243
|
console.log(` then sync search cache: aiwg index sync --graph project`);
|
|
244
244
|
console.log(` then: aiwg discover "${positional}"`);
|
|
245
245
|
}
|
|
246
|
-
console.log(` 4.
|
|
246
|
+
console.log(` 4. Bundle ${indexedOk ? 'indexed' : 'created'}; run aiwg use ${positional} --copy only if you want provider copies.`);
|
|
247
247
|
console.log(` 5. Inspect: aiwg doctor --project-local`);
|
|
248
248
|
console.log(` 6. When mature, promote: aiwg promote ${positional}`);
|
|
249
249
|
return { exitCode: 0 };
|
|
@@ -8,6 +8,11 @@ export const indexHandler = {
|
|
|
8
8
|
async help(ctx) {
|
|
9
9
|
if (ctx.args[0] === "discover")
|
|
10
10
|
return discoverHandler.help(ctx);
|
|
11
|
+
if (ctx.args[0] === "query") {
|
|
12
|
+
const { printIndexQueryHelp } = await import("../../artifacts/index-query-help.js");
|
|
13
|
+
printIndexQueryHelp();
|
|
14
|
+
return { exitCode: 0 };
|
|
15
|
+
}
|
|
11
16
|
const { printIndexUsage } = await import("../../artifacts/cli.js");
|
|
12
17
|
printIndexUsage();
|
|
13
18
|
return { exitCode: 0 };
|
|
@@ -16,7 +16,7 @@ const LIST_PROVIDER_TARGETS = [
|
|
|
16
16
|
{ name: 'opencode', root: '.opencode', agentsPath: '.opencode/agent', skillsPath: '.opencode/skill', commandsPath: '.opencode/command' },
|
|
17
17
|
{ name: 'warp', root: '.warp', agentsPath: '.warp/agents', skillsPath: '.warp/skills', commandsPath: '.warp/commands' },
|
|
18
18
|
{ name: 'factory', root: '.factory', agentsPath: '.factory/droids', skillsPath: '.factory/skills', commandsPath: '.factory/commands' },
|
|
19
|
-
{ name: '
|
|
19
|
+
{ name: 'devin', root: '.windsurf', agentsPath: '.windsurf/agents', skillsPath: '.windsurf/skills', commandsPath: '.windsurf/workflows' },
|
|
20
20
|
{ name: 'universal', root: '.agents', agentsPath: '.agents/agents', skillsPath: '.agents/skills', commandsPath: '.agents/commands' },
|
|
21
21
|
];
|
|
22
22
|
function hasAnyPopulated(cwd, p) {
|
|
@@ -18,7 +18,7 @@ export const newProjectHandler = {
|
|
|
18
18
|
const result = await runner.run("tools/install/new-project.mjs", ctx.args, {
|
|
19
19
|
cwd: ctx.cwd,
|
|
20
20
|
});
|
|
21
|
-
if (result.exitCode === 0) {
|
|
21
|
+
if (result.exitCode === 0 && !ctx.args.includes("--list-templates")) {
|
|
22
22
|
// The real scaffolder always runs in an existing target directory. Keep
|
|
23
23
|
// mocked/script-runner-only calls side-effect free when their synthetic
|
|
24
24
|
// cwd does not exist.
|
|
@@ -5,6 +5,17 @@ export const configHandler = {
|
|
|
5
5
|
description: "User config commands (get, set, list, validate, reset, path, edit)",
|
|
6
6
|
category: "config",
|
|
7
7
|
aliases: [],
|
|
8
|
+
async help(ctx) {
|
|
9
|
+
if (ctx.args[0] === 'authorization') {
|
|
10
|
+
const { authorizationUsage } = await import('../../config/authorization-cli.js');
|
|
11
|
+
console.log(authorizationUsage);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
const { printUsage } = await import('../../config/cli-help.js');
|
|
15
|
+
printUsage();
|
|
16
|
+
}
|
|
17
|
+
return { exitCode: 0 };
|
|
18
|
+
},
|
|
8
19
|
async execute(ctx) {
|
|
9
20
|
try {
|
|
10
21
|
const { main } = await import("../../config/cli.js");
|
|
@@ -345,7 +345,7 @@ function showTeamHelp() {
|
|
|
345
345
|
info <name> Show team definition and agent roster
|
|
346
346
|
|
|
347
347
|
${ui.bold('Options:')}
|
|
348
|
-
--provider <p> Override provider: antigravity|agy|claude|warp|copilot|cursor|
|
|
348
|
+
--provider <p> Override provider: antigravity|agy|claude|warp|copilot|cursor|devin|opencode|factory|codex|openclaw|omp|oh-my-pi
|
|
349
349
|
--objective "<text>" Set objective passed to mc dispatch agents
|
|
350
350
|
--body-file <file> OMP task JSON with explicit ownership and tools
|
|
351
351
|
--cwd <dir> OMP working directory (defaults to current workspace)
|
|
@@ -78,10 +78,17 @@ export async function getAllExtensions(frameworkRoot) {
|
|
|
78
78
|
}
|
|
79
79
|
return result;
|
|
80
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Only the bulk kernel surface (`use all` outside Pi/OMP) omits bundled extensions.
|
|
83
|
+
* Index-only framework passes keep them so extension rules still deliver (#4279).
|
|
84
|
+
*/
|
|
85
|
+
export function omitsExtensions(id, provider, kernelOnly) {
|
|
86
|
+
return kernelOnly && id === 'all' && !['pi', 'omp'].includes(provider);
|
|
87
|
+
}
|
|
81
88
|
/** The same provider and kernel gates govern use passes and expected receipt owners. */
|
|
82
|
-
export async function frameworkAdditiveBundles(frameworkRoot, provider, skipUtils = false, kernelOnly = false) {
|
|
89
|
+
export async function frameworkAdditiveBundles(frameworkRoot, provider, skipUtils = false, kernelOnly = false, id = 'all') {
|
|
83
90
|
const addons = skipUtils || provider === 'flue' ? [] : await getAllAddons(frameworkRoot);
|
|
84
|
-
const extensions = skipUtils || kernelOnly || provider === 'flue' ? [] : await getAllExtensions(frameworkRoot);
|
|
91
|
+
const extensions = skipUtils || omitsExtensions(id, provider, kernelOnly) || provider === 'flue' ? [] : await getAllExtensions(frameworkRoot);
|
|
85
92
|
return { addons, extensions };
|
|
86
93
|
}
|
|
87
94
|
//# sourceMappingURL=use-additive-bundles.js.map
|
|
@@ -9,7 +9,7 @@ export async function countDeployedBundleRules(bundlePath, target, deployPath, p
|
|
|
9
9
|
return 0;
|
|
10
10
|
// The shared rule projector uses this conventional directory even when a
|
|
11
11
|
// provider has no native rule loader (for example Pi).
|
|
12
|
-
const destination = path.resolve(target, deployPath || `.${provider}/rules`);
|
|
12
|
+
const destination = path.resolve(target, deployPath || `.${provider === 'devin' ? 'windsurf' : provider}/rules`);
|
|
13
13
|
let selected = [];
|
|
14
14
|
let managed = {};
|
|
15
15
|
try {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { frameworkRegistryId } from '../../config/framework-aliases.js';
|
|
2
|
+
export async function executeCopySelection(ctx, execute) {
|
|
3
|
+
const index = ctx.args.indexOf('--copy');
|
|
4
|
+
if (index < 0)
|
|
5
|
+
return undefined;
|
|
6
|
+
const selector = ctx.args[index + 1]?.startsWith('-') === false ? ctx.args[index + 1] : undefined;
|
|
7
|
+
const args = [...ctx.args];
|
|
8
|
+
args.splice(index, selector ? 2 : 1);
|
|
9
|
+
const target = args[0];
|
|
10
|
+
if (!target || target.startsWith('-'))
|
|
11
|
+
return { exitCode: 2, message: '--copy requires a use target.' };
|
|
12
|
+
if (!selector || frameworkRegistryId(selector) === frameworkRegistryId(target)) {
|
|
13
|
+
return execute({ ...ctx, args: [...args, '--copy-all'] });
|
|
14
|
+
}
|
|
15
|
+
if (target !== 'all')
|
|
16
|
+
return { exitCode: 2, message: `--copy ${selector} requires 'use all' or 'use ${selector}'.` };
|
|
17
|
+
// Validate and copy the selected bundle first so a typo cannot partially index all.
|
|
18
|
+
const copied = await execute({ ...ctx, args: [selector, ...args.slice(1), '--copy-all'] });
|
|
19
|
+
if (copied.exitCode)
|
|
20
|
+
return copied;
|
|
21
|
+
return execute({ ...ctx, args });
|
|
22
|
+
}
|
|
23
|
+
export function discoveryDeploymentArgs(args, indexOnly) {
|
|
24
|
+
const sourceIndex = args.indexOf('--deploy-source');
|
|
25
|
+
if (sourceIndex >= 0 && args[sourceIndex + 1] === 'project-local') {
|
|
26
|
+
indexOnly = !args.some(arg => ['--copy-all', '--copy-standard-skills'].includes(arg));
|
|
27
|
+
}
|
|
28
|
+
if (!indexOnly)
|
|
29
|
+
return args;
|
|
30
|
+
return [...args.filter(arg => !['--copy-all', '--copy-standard-skills', '--index-mode'].includes(arg)), '--discovery-only'];
|
|
31
|
+
}
|
|
32
|
+
export function discoveryMessage(target, dryRun = false) {
|
|
33
|
+
return `${dryRun ? 'Would index' : 'Indexed'} ${target}; find artifacts with aiwg discover "<capability>" and load them with aiwg show. Use aiwg use ${target} --copy (or --copy-all) for provider copies. Existing copies are retained; review aiwg remove ${target} --dry-run before choosing removal and re-indexing.`;
|
|
34
|
+
}
|
|
35
|
+
export function reportDiscovery(ctx, result, indexOnly) {
|
|
36
|
+
if (result.exitCode || !indexOnly || ctx.args[0] === 'cockpit'
|
|
37
|
+
|| ctx.args.some(arg => ['--json', '--help', '-h', '--workspace-signals'].includes(arg)))
|
|
38
|
+
return result;
|
|
39
|
+
// Lead with the discovery note so provider next steps (hook trust/acceptance) stay the last line.
|
|
40
|
+
return { ...result, message: [discoveryMessage(ctx.args[0] || 'all', ctx.args.includes('--dry-run')), result.message].filter(Boolean).join('\n') };
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=use-copy-selection.js.map
|