@aiwg/cli 2026.11.8 → 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/providers/capability-matrix.yaml +4 -4
- package/agentic/code/providers/model-capabilities.v1.json +150 -28
- package/agentic/code/providers/model-catalog.v1.json +6 -5
- 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 +6 -4
- package/dist/src/cli/handlers/refresh.js +7 -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/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 +6 -4
- package/dist/src/extensions/verified-hook-command.js +7 -5
- 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-worker-version.d.mts +2 -0
- package/dist/src/models/cursor-worker-version.mjs +27 -0
- package/dist/src/models/model-capabilities.v1.json +150 -28
- package/dist/src/models/model-catalog.v1.json +6 -5
- package/dist/src/models/model-discovery.js +3 -3
- package/dist/src/models/policy-resources.js +1 -1
- package/dist/src/models/worker-direct-readiness.js +8 -5
- package/dist/src/models/worker-installation.d.mts +3 -2
- package/dist/src/models/worker-installation.mjs +12 -10
- package/dist/src/models/worker-invocation-policy.js +1 -1
- 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 +4 -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-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/parallelism-section.js +2 -2
- 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 +27 -2
- package/dist/src/writing/current-patterns.js +1 -0
- 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 +55 -0
- 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/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/rule-delivery-surface.mjs +14 -10
- package/tools/agents/providers/rule-deployment-prepare.mjs +8 -8
- package/tools/agents/providers/rule-projection.mjs +5 -5
- package/tools/agents/providers/rule-startup.mjs +1 -1
- 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 +2 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export function skillNameIntent(name, text, tokenize) {
|
|
2
|
+
const identityTokens = (value) => [...new Set([
|
|
3
|
+
...tokenize(value), ...(/\baiwg\b/i.test(value) ? ['aiwg'] : []),
|
|
4
|
+
])];
|
|
5
|
+
const nameTokens = identityTokens(name);
|
|
6
|
+
// Single generic words are too ambiguous to bypass query coverage scoring.
|
|
7
|
+
if (nameTokens.length < 2)
|
|
8
|
+
return [];
|
|
9
|
+
const leading = text.replace(/(`+)[\s\S]*?\1/g, ' ').split(/[.!?;:\n]/, 1)[0];
|
|
10
|
+
const queryTokens = identityTokens(leading);
|
|
11
|
+
const matches = nameTokens.map(token => queryTokens.find(query => token === query
|
|
12
|
+
// An agent noun may name the action: post-scorer -> score ... post.
|
|
13
|
+
|| (token.length >= 6 && token.endsWith('er')
|
|
14
|
+
&& (query === token.slice(0, -1) || query === token.slice(0, -2)))));
|
|
15
|
+
return matches.every((token) => token !== undefined) ? matches : [];
|
|
16
|
+
}
|
|
17
|
+
/** Combine explicit product identity with bounded metadata evidence, even in a long request. */
|
|
18
|
+
export function productNameEvidence(entry, text, tokenize, near) {
|
|
19
|
+
if (!['skill', 'agent'].includes(entry.type) || !/^aiwg[-_]/i.test(entry.name ?? ''))
|
|
20
|
+
return;
|
|
21
|
+
const leading = text.replace(/(`+)[\s\S]*?\1/g, ' ').split(/[.!?;:\n]/, 1)[0];
|
|
22
|
+
if (!/\baiwg\b/i.test(leading))
|
|
23
|
+
return;
|
|
24
|
+
const query = [...new Set(tokenize(leading))];
|
|
25
|
+
const vocabulary = [...new Set(tokenize([
|
|
26
|
+
entry.title, entry.capability ?? '', ...(entry.triggers ?? []),
|
|
27
|
+
].join(' ')))].filter(token => !['use', 'make', 'as'].includes(token));
|
|
28
|
+
const hits = new Set();
|
|
29
|
+
const targets = new Set();
|
|
30
|
+
const match = (word) => vocabulary.find(target => target === word)
|
|
31
|
+
?? vocabulary.find(target => word.length >= 5 && target.length >= 5 && near(word, target));
|
|
32
|
+
for (let i = 0; i < query.length; i++) {
|
|
33
|
+
const target = match(query[i]);
|
|
34
|
+
if (target) {
|
|
35
|
+
hits.add(query[i]);
|
|
36
|
+
targets.add(target);
|
|
37
|
+
}
|
|
38
|
+
// Recover a split compound or a punctuation typo (work space, deploy,ent).
|
|
39
|
+
const compound = i + 1 < query.length ? match(query[i] + query[i + 1]) : undefined;
|
|
40
|
+
if (compound) {
|
|
41
|
+
hits.add(query[i]);
|
|
42
|
+
hits.add(query[i + 1]);
|
|
43
|
+
targets.add(compound);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!hits.size)
|
|
47
|
+
return;
|
|
48
|
+
return {
|
|
49
|
+
field: 'capability', match: 'token-overlap', value: entry.capability,
|
|
50
|
+
matched_tokens: [...hits], query_token_coverage: hits.size / Math.max(1, tokenize(text).length),
|
|
51
|
+
// Product identity and capability jointly outweigh incidental generic hits.
|
|
52
|
+
// Keep exact names, complete triggers and named subjects stronger.
|
|
53
|
+
contribution: 0.6 + Math.min(0.24, targets.size * 0.06),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=query-engine-name-intent.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { diagnoseFacetActivations } from './discover-facets.js';
|
|
3
3
|
import { matchTemplateOutputKind } from './template-output-kind.js';
|
|
4
4
|
import { verboseQueryProfile } from './query-engine-verbose.js';
|
|
5
|
+
import { productNameEvidence, skillNameIntent } from './query-engine-name-intent.js';
|
|
5
6
|
export function containsTokenSequence(haystack, needle) {
|
|
6
7
|
if (needle.length === 0 || haystack.length < needle.length)
|
|
7
8
|
return false;
|
|
@@ -30,14 +31,8 @@ export function containsTokenSequence(haystack, needle) {
|
|
|
30
31
|
// ceil(n/2), so a verbose query raises the bar above what the genuinely
|
|
31
32
|
// relevant short-match artifact can clear, and the (hits/n) term dilutes
|
|
32
33
|
// every score. Dropping filler collapses the query to its content tokens.
|
|
33
|
-
// 2. AIWG meta-type nouns
|
|
34
|
-
//
|
|
35
|
-
// signal (every result IS an aiwg skill/agent/…; the TYPE is filtered via
|
|
36
|
-
// --type). The content word after them is what matters
|
|
37
|
-
// ("…skill that handles >intake forms<"). Keeping them surfaces incidental
|
|
38
|
-
// junk matches (any artifact mentioning "skill"/"aiwg") above the real one.
|
|
39
|
-
// Only the query is tokenized here — entry fields are substring-matched — so this
|
|
40
|
-
// never changes what text an artifact exposes, only how the query is reduced.
|
|
34
|
+
// 2. AIWG meta-type nouns are incidental in general field matching.
|
|
35
|
+
// Compound skill-name intent separately preserves discriminating AIWG names.
|
|
41
36
|
export const SCORE_STOPWORDS = new Set([
|
|
42
37
|
// articles / conjunctions / prepositions / copula
|
|
43
38
|
'the', 'a', 'an', 'and', 'or', 'of', 'for', 'to', 'in', 'on',
|
|
@@ -330,6 +325,12 @@ export function scoreEntryDetailed(entry, text, opts = {}) {
|
|
|
330
325
|
}
|
|
331
326
|
}
|
|
332
327
|
}
|
|
328
|
+
const nameIntent = entry.type === 'skill' && entry.name ? skillNameIntent(entry.name, text, tokenize) : [];
|
|
329
|
+
if (nameIntent.length && (!verbose || verbose.weight(nameIntent.filter(token => tokens.includes(token))) === 1)) {
|
|
330
|
+
matches.push({ field: 'name', match: 'token-overlap', value: entry.name, contribution: 1.0006,
|
|
331
|
+
matched_tokens: nameIntent, query_token_coverage: nameIntent.filter(token => tokens.includes(token)).length / Math.max(1, tokens.length) });
|
|
332
|
+
return finish(1.0006, 1.0006);
|
|
333
|
+
}
|
|
333
334
|
// Capability description (2x weight) — full phrase first, then tokens
|
|
334
335
|
if (capabilityLower) {
|
|
335
336
|
if (fieldContainsQuery(capabilityLower, tokens)) {
|
|
@@ -441,6 +442,11 @@ export function scoreEntryDetailed(entry, text, opts = {}) {
|
|
|
441
442
|
if (fieldContainsQuery(typeLower, tokens)) {
|
|
442
443
|
addMatch(0.1, { field: 'type', match: 'contained-phrase', value: entry.type });
|
|
443
444
|
}
|
|
445
|
+
const product = productNameEvidence(entry, text, tokenize, damerauLevenshteinAtMostOne);
|
|
446
|
+
if (product) {
|
|
447
|
+
matches.push(product);
|
|
448
|
+
return finish(Math.max(score, product.contribution), Math.max(verbose?.coverage(matches) ?? 1, product.contribution));
|
|
449
|
+
}
|
|
444
450
|
return finish();
|
|
445
451
|
}
|
|
446
452
|
export function scoreEntry(entry, text, opts = {}) {
|
|
@@ -117,8 +117,8 @@ export async function emitShowCard(cwd, aiwgRoot, entry, filePath, source, param
|
|
|
117
117
|
throw new Error(`${matches.length ? 'Ambiguous' : 'Unknown'} heading "${heading}". Headings: ${sections.map(section => section.heading).join(', ') || '(none)'}`);
|
|
118
118
|
return matches[0].text;
|
|
119
119
|
});
|
|
120
|
-
const owner = normalizeIndexedPath(entry.path).match(/(?:^|\/)(?:agentic\/code|\.aiwg)\/(frameworks|addons|extensions)\/([^/]+)\//);
|
|
121
|
-
const kind = owner ? { frameworks: 'framework', addons: 'addon', extensions: 'extension' }[owner[1]] : null;
|
|
120
|
+
const owner = normalizeIndexedPath(entry.path).match(/(?:^|\/)(?:agentic\/code|\.aiwg)\/(frameworks|addons|extensions|plugins)\/([^/]+)\//);
|
|
121
|
+
const kind = owner ? { frameworks: 'framework', addons: 'addon', extensions: 'extension', plugins: 'plugin' }[owner[1]] : null;
|
|
122
122
|
const installed = local && (owner && aiwgRoot
|
|
123
123
|
? await isArtifactInstalled(cwd, aiwgRoot, entry, kind, owner[2]) : true);
|
|
124
124
|
const resources = local || release ? showResources(filePath, source, release) : [];
|
|
@@ -164,7 +164,7 @@ export async function emitShowCard(cwd, aiwgRoot, entry, filePath, source, param
|
|
|
164
164
|
body: `${command} --body`,
|
|
165
165
|
},
|
|
166
166
|
...(!installed ? { load_hint: `Read the component with \`${command} --body\`.`
|
|
167
|
-
+ (owner ? `
|
|
167
|
+
+ (owner ? ` Request provider copies with \`aiwg use ${owner[2]} --copy\`.` : '') } : {}),
|
|
168
168
|
...extra,
|
|
169
169
|
...(params.body || selected.length ? { content: params.body ? source : selected.join('\n') } : {}),
|
|
170
170
|
...(resource ? { resource: { ...resource, body: resourceBody } } : {}),
|
|
@@ -85,13 +85,13 @@ export const PROVIDER_CONFIGS = {
|
|
|
85
85
|
' aiwg mcp install warp && aiwg mcp serve\n' +
|
|
86
86
|
'See: docs/integrations/warp-mcp-sidecar.md',
|
|
87
87
|
},
|
|
88
|
-
|
|
88
|
+
devin: {
|
|
89
89
|
binary: null,
|
|
90
90
|
dangerousFlag: null,
|
|
91
|
-
name: '
|
|
92
|
-
guidanceMessage: '
|
|
91
|
+
name: 'Devin Desktop',
|
|
92
|
+
guidanceMessage: 'Devin Desktop is IDE-integrated and cannot be spawned from the CLI.\n' +
|
|
93
93
|
'For unrestricted AIWG tool access, use the MCP sidecar:\n' +
|
|
94
|
-
' aiwg mcp install
|
|
94
|
+
' aiwg mcp install devin && aiwg mcp serve\n' +
|
|
95
95
|
'See: docs/integrations/windsurf-mcp-sidecar.md',
|
|
96
96
|
},
|
|
97
97
|
};
|
|
@@ -252,7 +252,7 @@ REPORTING:
|
|
|
252
252
|
AGENT OPTIONS:
|
|
253
253
|
--provider <name> Agent system to use (default: claude)
|
|
254
254
|
Spawnable: ${spawnable}
|
|
255
|
-
IDE-integrated (guidance only): copilot, cursor, factory, warp,
|
|
255
|
+
IDE-integrated (guidance only): copilot, cursor, factory, warp, devin
|
|
256
256
|
--dangerous Enable unrestricted mode (passes provider's native flag).
|
|
257
257
|
--params "<args>" Pass arbitrary args verbatim to the agent binary.
|
|
258
258
|
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// Retain per-provider deployment intent in the existing project ownership receipt.
|
|
2
2
|
import { writeContextFileSync } from '../../smiths/context-pipeline/context-file-safety.js';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
|
+
import { canonicalDesktopProviderId, canonicalizeDesktopProviderKeys } from '../../providers/devin-compat.mjs';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { readAiwgConfig } from '../../config/aiwg-config.js';
|
|
6
7
|
import { frameworkRegistryId } from '../../config/framework-aliases.js';
|
|
7
8
|
const receiptPath = (project) => path.join(project, '.aiwg/.aiwg-manifest.json');
|
|
8
9
|
export function bundleDeploymentHistory(project) {
|
|
9
10
|
try {
|
|
10
|
-
return JSON.parse(fs.readFileSync(receiptPath(project), 'utf8')).bundleDeployments ?? {};
|
|
11
|
+
return canonicalizeDesktopProviderKeys(JSON.parse(fs.readFileSync(receiptPath(project), 'utf8')).bundleDeployments ?? {});
|
|
11
12
|
}
|
|
12
13
|
catch (error) {
|
|
13
14
|
if (error.code === 'ENOENT')
|
|
@@ -17,11 +18,11 @@ export function bundleDeploymentHistory(project) {
|
|
|
17
18
|
}
|
|
18
19
|
export function bundleCopyArgs(installed, id, provider) {
|
|
19
20
|
const entry = Object.entries(installed).find(([key]) => frameworkRegistryId(key) === frameworkRegistryId(id))?.[1];
|
|
20
|
-
const flags = entry?.deployedTo[provider];
|
|
21
|
+
const flags = canonicalizeDesktopProviderKeys(entry?.deployedTo ?? {})[canonicalDesktopProviderId(provider)];
|
|
21
22
|
return [...(flags?.copy === true ? ['--copy-all'] : []), ...(flags?.skipUtils === true ? ['--no-utils'] : []),
|
|
22
23
|
...(provider === 'flue' && flags?.package === true ? ['--package'] : [])];
|
|
23
24
|
}
|
|
24
|
-
export async function recordBundleDeployment(project, id, provider, args, frameworkRoot) {
|
|
25
|
+
export async function recordBundleDeployment(project, id, provider, args, frameworkRoot, previousConfig) {
|
|
25
26
|
const { expectedBundleOwners } = await import('./bundle-reconciliation.js');
|
|
26
27
|
const { getFrameworkRoot } = await import('../../channel/manager.mjs');
|
|
27
28
|
const flags = bundleDeploymentScope(id, provider, args);
|
|
@@ -29,9 +30,18 @@ export async function recordBundleDeployment(project, id, provider, args, framew
|
|
|
29
30
|
const produces = [...await expectedBundleOwners(selected, provider, frameworkRoot ?? await getFrameworkRoot())].sort();
|
|
30
31
|
const file = receiptPath(project);
|
|
31
32
|
const receipt = fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, 'utf8')) : { scope: 'project', managed: {} };
|
|
32
|
-
|
|
33
|
+
provider = canonicalDesktopProviderId(provider);
|
|
34
|
+
receipt.bundleDeployments = canonicalizeDesktopProviderKeys(receipt.bundleDeployments ?? {});
|
|
33
35
|
receipt.bundleDeployments[provider] ??= {};
|
|
34
|
-
|
|
36
|
+
const copy = args.includes('--copy-all') || args.includes('--copy-standard-skills');
|
|
37
|
+
if (!copy) {
|
|
38
|
+
// Preserve the prior footprint until the operator reviews removal, including pre-receipt installs.
|
|
39
|
+
produces.push(...receipt.bundleDeployments[provider][frameworkRegistryId(id)]?.produces ?? []);
|
|
40
|
+
const prior = Object.entries(previousConfig?.installed ?? {}).find(([key]) => frameworkRegistryId(key) === frameworkRegistryId(id));
|
|
41
|
+
if (prior)
|
|
42
|
+
produces.push(...await expectedBundleOwners({ installed: { [prior[0]]: prior[1] } }, provider, frameworkRoot ?? await getFrameworkRoot()));
|
|
43
|
+
}
|
|
44
|
+
receipt.bundleDeployments[provider][frameworkRegistryId(id)] = { copy, ...flags, ...(provider === 'flue' ? { package: args.includes('--package') } : {}), produces: [...new Set(produces)].sort() };
|
|
35
45
|
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
36
46
|
writeContextFileSync(file, `${JSON.stringify(receipt, null, 2)}\n`);
|
|
37
47
|
}
|
|
@@ -41,31 +51,34 @@ export function markBundleReconciled(project, id, provider) {
|
|
|
41
51
|
if (!fs.existsSync(file))
|
|
42
52
|
return;
|
|
43
53
|
const receipt = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
54
|
+
provider = canonicalDesktopProviderId(provider);
|
|
55
|
+
receipt.bundleDeployments = canonicalizeDesktopProviderKeys(receipt.bundleDeployments ?? {});
|
|
44
56
|
if (!receipt.bundleDeployments?.[provider]?.[frameworkRegistryId(id)])
|
|
45
57
|
return;
|
|
46
58
|
receipt.bundleDeployments[provider][frameworkRegistryId(id)].reconciled = true;
|
|
47
59
|
writeContextFileSync(file, `${JSON.stringify(receipt, null, 2)}\n`);
|
|
48
60
|
}
|
|
49
|
-
//
|
|
50
|
-
export function
|
|
51
|
-
return args.includes('--copy-all') || args.includes('--copy-standard-skills') ? [] : ['--
|
|
61
|
+
// Resolve each provider pass from explicit or recorded bundle intent.
|
|
62
|
+
export function bundleProviderCopyArgs(args) {
|
|
63
|
+
return args.includes('--copy-all') || args.includes('--copy-standard-skills') ? ['--copy-all'] : ['--discovery-only'];
|
|
52
64
|
}
|
|
53
65
|
// Framework passes retain a separately declared local bundle's provider mode.
|
|
54
66
|
export async function projectLocalDeploymentContext(ctx, project, id, provider, explicit) {
|
|
55
67
|
if (explicit)
|
|
56
68
|
return ctx;
|
|
69
|
+
provider = canonicalDesktopProviderId(provider);
|
|
57
70
|
const installed = (await readAiwgConfig(project))?.installed;
|
|
58
|
-
if (
|
|
71
|
+
if (installed?.[id]?.deployedTo[provider]?.copy === undefined)
|
|
59
72
|
return ctx;
|
|
60
73
|
return { ...ctx, args: [...ctx.args.filter(arg => !['--copy-all', '--copy-standard-skills'].includes(arg)), ...bundleCopyArgs(installed, id, provider)] };
|
|
61
74
|
}
|
|
62
75
|
export function projectLocalCopyMode(config, id, provider, args, explicit) {
|
|
63
76
|
const requested = args.includes('--copy-all') || args.includes('--copy-standard-skills');
|
|
64
|
-
|
|
77
|
+
const deployed = canonicalizeDesktopProviderKeys(config.installed[id]?.deployedTo ?? {})[canonicalDesktopProviderId(provider)];
|
|
78
|
+
return explicit ? requested : deployed?.copy ?? requested;
|
|
65
79
|
}
|
|
66
80
|
// Match the effective framework gates used by the deployment pass.
|
|
67
|
-
export function bundleDeploymentScope(
|
|
68
|
-
return { skipUtils: args.includes('--no-utils'), kernelOnly:
|
|
69
|
-
&& !args.includes('--copy-all') && !args.includes('--copy-standard-skills') };
|
|
81
|
+
export function bundleDeploymentScope(_id, _provider, args) {
|
|
82
|
+
return { skipUtils: args.includes('--no-utils'), kernelOnly: !args.includes('--copy-all') && !args.includes('--copy-standard-skills') };
|
|
70
83
|
}
|
|
71
84
|
//# sourceMappingURL=bundle-deployment-mode.js.map
|
|
@@ -36,7 +36,7 @@ export async function expectedBundleOwners(config, provider, frameworkRoot) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
// Unknown history must retain the broader additive surface.
|
|
39
|
-
const { addons, extensions } = await frameworkAdditiveBundles(frameworkRoot, provider, flags.skipUtils === true, flags.kernelOnly === true);
|
|
39
|
+
const { addons, extensions } = await frameworkAdditiveBundles(frameworkRoot, provider, flags.skipUtils === true, flags.kernelOnly === true, id);
|
|
40
40
|
for (const owner of [...addons, ...extensions])
|
|
41
41
|
expected.add(frameworkRegistryId(owner));
|
|
42
42
|
}
|
|
@@ -91,7 +91,7 @@ export async function pruneUndeclaredBundles(project, config, requested, dryRun
|
|
|
91
91
|
const hashPruned = await pruneUndeclaredHashes(project, config, requested, dryRun);
|
|
92
92
|
let failures = 0;
|
|
93
93
|
const knownProviders = [...new Set([...Object.keys(history), ...(config.providers ?? []), ...Object.values(config.installed).flatMap(entry => Object.keys(entry.deployedTo ?? {})),
|
|
94
|
-
...PROVIDER_IDS.filter(provider => fs.existsSync(path.join(project, `.${provider}`)))])];
|
|
94
|
+
...PROVIDER_IDS.filter(provider => fs.existsSync(path.join(project, `.${provider === 'devin' ? 'windsurf' : provider}`)))])];
|
|
95
95
|
const providers = requested ? requested.split(',') : knownProviders;
|
|
96
96
|
const root = frameworkRoot ?? await getFrameworkRoot();
|
|
97
97
|
const expected = new Map();
|
|
@@ -46,7 +46,7 @@ const PROVIDER_LABELS = {
|
|
|
46
46
|
cursor: 'Cursor .cursor/',
|
|
47
47
|
opencode: 'OpenCode .opencode/',
|
|
48
48
|
warp: 'Warp Terminal .warp/',
|
|
49
|
-
|
|
49
|
+
devin: 'Devin Desktop AGENTS.md',
|
|
50
50
|
factory: 'Factory AI .factory/',
|
|
51
51
|
codex: 'OpenAI Codex ~/.codex/',
|
|
52
52
|
openclaw: 'OpenClaw ~/.openclaw/',
|
|
@@ -13,6 +13,11 @@ export const issueHandler = {
|
|
|
13
13
|
description: 'Local issue storage commands under .aiwg/issues/',
|
|
14
14
|
category: 'project',
|
|
15
15
|
aliases: ['issues'],
|
|
16
|
+
async help() {
|
|
17
|
+
const { printUsage } = await import('../../issues/cli.js');
|
|
18
|
+
printUsage();
|
|
19
|
+
return { exitCode: 0 };
|
|
20
|
+
},
|
|
16
21
|
async execute(ctx) {
|
|
17
22
|
try {
|
|
18
23
|
const { main } = await import('../../issues/cli.js');
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
// Handle
|
|
2
|
-
import { formatPluginSearch,
|
|
3
|
-
export function handlePluginSearch(ctx) {
|
|
1
|
+
// Handle offline plugin discovery and explicitly requested public cache refresh.
|
|
2
|
+
import { formatPluginSearch, searchMarketplacePlugins } from '../../marketplace/plugin-search.js';
|
|
3
|
+
export async function handlePluginSearch(ctx) {
|
|
4
4
|
try {
|
|
5
5
|
const values = {};
|
|
6
6
|
const query = [];
|
|
7
7
|
for (let index = 1; index < ctx.args.length; index++) {
|
|
8
8
|
const arg = ctx.args[index];
|
|
9
|
-
if (arg === '--plugins' || arg === '--json')
|
|
9
|
+
if (arg === '--plugins' || arg === '--json' || arg === '--refresh')
|
|
10
10
|
continue;
|
|
11
11
|
if (arg === '--provider' || arg === '--max-age-days') {
|
|
12
12
|
const value = ctx.args[++index];
|
|
@@ -21,8 +21,9 @@ export function handlePluginSearch(ctx) {
|
|
|
21
21
|
}
|
|
22
22
|
if (!query.join(' ').trim())
|
|
23
23
|
throw new Error('Query required for plugin search');
|
|
24
|
-
const report =
|
|
24
|
+
const report = await searchMarketplacePlugins(query.join(' '), {
|
|
25
25
|
provider: values['--provider'],
|
|
26
|
+
refresh: ctx.args.includes('--refresh'),
|
|
26
27
|
maxAgeDays: values['--max-age-days'] === undefined ? undefined : Number(values['--max-age-days']),
|
|
27
28
|
});
|
|
28
29
|
for (const warning of report.warnings)
|
|
@@ -21,7 +21,7 @@ const USAGE = [
|
|
|
21
21
|
'Usage:',
|
|
22
22
|
' aiwg marketplace add <catalog-git-url> [--ref <tag-or-sha>]',
|
|
23
23
|
' aiwg marketplace search <query> Search packages and signed catalogs',
|
|
24
|
-
' aiwg marketplace search <query> --plugins [--provider all|claude|codex] [--max-age-days 30] [--json]',
|
|
24
|
+
' aiwg marketplace search <query> --plugins [--provider all|claude|codex] [--max-age-days 30] [--refresh] [--json]',
|
|
25
25
|
' aiwg marketplace info <package> Show provenance and catalog observations',
|
|
26
26
|
' aiwg marketplace install <url|package> Install and lock direct Git or catalog package',
|
|
27
27
|
' aiwg marketplace verify <package|lock> Verify cached content and receipts offline',
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Resolve built-in Muse wrappers even when no source artifacts are deployed.
|
|
2
|
+
import { MODEL_WRAPPER_DEFINITIONS } from '../../models/wrapper-definitions.js';
|
|
3
|
+
import { loadProviderModelCatalog } from '../../models/catalog-policy.js';
|
|
4
|
+
import { normalizeModelTier } from '../../models/tiers.js';
|
|
5
|
+
export function museWrapperArtifacts(artifacts, provider, parsed) {
|
|
6
|
+
if (provider !== 'muse' || parsed.subcommand !== 'resolve')
|
|
7
|
+
return artifacts;
|
|
8
|
+
const wrapper = MODEL_WRAPPER_DEFINITIONS.find(item => item.name === parsed.flags.get('agent'));
|
|
9
|
+
if (!wrapper)
|
|
10
|
+
return artifacts;
|
|
11
|
+
const existing = artifacts.find(item => item.kind === 'agent' && item.name === wrapper.name);
|
|
12
|
+
const tier = parsed.flags.get('tier');
|
|
13
|
+
// These virtual artifacts are used only by read-only resolve, never by set/migrate.
|
|
14
|
+
return [...artifacts.filter(item => item.kind !== 'agent' || item.name !== wrapper.name), {
|
|
15
|
+
...existing, kind: 'agent', name: wrapper.name, file: existing?.file ?? '',
|
|
16
|
+
relative: existing?.relative ?? 'built-in model wrapper',
|
|
17
|
+
role: existing?.role ?? wrapper.role,
|
|
18
|
+
tier: typeof tier === 'string' ? tier : existing?.tier ?? wrapper.tier,
|
|
19
|
+
effort: existing?.effort ?? wrapper.effort,
|
|
20
|
+
}];
|
|
21
|
+
}
|
|
22
|
+
export function museWrapperCompilation(item, compiled, policy, catalog = loadProviderModelCatalog()) {
|
|
23
|
+
if (compiled.provider !== 'muse' || item.kind !== 'agent'
|
|
24
|
+
|| !MODEL_WRAPPER_DEFINITIONS.some(wrapper => wrapper.name === item.name))
|
|
25
|
+
return compiled;
|
|
26
|
+
const provider = catalog.providers.muse;
|
|
27
|
+
const tier = normalizeModelTier(policy.tier);
|
|
28
|
+
const role = policy.tier === 'economy' ? 'efficiency' : policy.tier === 'premium' ? 'reasoning' : policy.role;
|
|
29
|
+
// Report the session model candidate while retaining unsupported agent controls and empty fields.
|
|
30
|
+
return { ...compiled, effectiveModel: (provider.tiers?.[tier] ?? provider.roles[role]).id };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=models-muse-wrapper.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MODELS_HELP } from './models-help.js';
|
|
2
|
+
import { museWrapperArtifacts, museWrapperCompilation } from './models-muse-wrapper.js';
|
|
2
3
|
import { shellRefusalDiagnostics } from './models-refusal.js';
|
|
3
4
|
import { updateJson } from '../../models/config-writer.js';
|
|
4
5
|
import { atomicConfigWrite as atomicWrite } from '../../config/worker-write.js';
|
|
@@ -251,19 +252,19 @@ function resolved(item, provider, catalog) {
|
|
|
251
252
|
tier: normalizedTier(item.tier),
|
|
252
253
|
...(item.effort ? { effort: item.effort } : {}),
|
|
253
254
|
};
|
|
254
|
-
return { ...item, policy, compiled: compileModelPolicy({
|
|
255
|
+
return { ...item, policy, compiled: museWrapperCompilation(item, compileModelPolicy({
|
|
255
256
|
provider: provider,
|
|
256
257
|
artifact: item.kind,
|
|
257
258
|
policy,
|
|
258
259
|
...(catalog ? { catalog } : {}),
|
|
259
|
-
}) };
|
|
260
|
+
}), policy, catalog) };
|
|
260
261
|
}
|
|
261
262
|
function print(value, json) {
|
|
262
263
|
if (json)
|
|
263
264
|
console.log(JSON.stringify(value, null, 2));
|
|
264
265
|
else if (Array.isArray(value) && value.every(item => item?.kind && item?.relative)) {
|
|
265
266
|
for (const item of value) {
|
|
266
|
-
const outcome = item.compiled?.outcome ? `\t${item.compiled.outcome}` : '';
|
|
267
|
+
const outcome = item.compiled?.outcome ? `\t${item.compiled.outcome}${item.compiled.provider === 'muse' && item.compiled.effectiveModel ? `\t${item.compiled.effectiveModel}` : ''}` : '';
|
|
267
268
|
console.log(`${item.kind}\t${item.name}\t${item.role}/${item.tier}${outcome}\t${item.relative}`);
|
|
268
269
|
for (const diagnostic of item.compiled?.diagnostics ?? []) {
|
|
269
270
|
console.log(` ${diagnostic.code}: ${diagnostic.message}`);
|
|
@@ -378,7 +379,7 @@ async function execute(ctx, services = { load: loadWorkerInputs }) {
|
|
|
378
379
|
return { exitCode: 0 };
|
|
379
380
|
}
|
|
380
381
|
const discovered = await discover(target);
|
|
381
|
-
const artifacts = select(discovered, parsed, parsed.subcommand !== 'set');
|
|
382
|
+
const artifacts = select(museWrapperArtifacts(discovered, provider, parsed), parsed, parsed.subcommand !== 'set');
|
|
382
383
|
if (parsed.subcommand === 'list') {
|
|
383
384
|
print(artifacts, json);
|
|
384
385
|
return { exitCode: 0 };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Verify retained provider copies against both their deployment receipt and current bundled source.
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { createHash } from 'node:crypto';
|
|
5
|
+
import { stripManagedMarker } from '../../extensions/managed-marker.js';
|
|
6
|
+
import { generateCommandContent, parseFrontmatter, resolveSkillModelPolicy } from '../../plugin/skill-command-translator.js';
|
|
7
|
+
const hash = (bytes) => `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
|
|
8
|
+
function currentLegacySkillCommand(deployed, canonical, source) {
|
|
9
|
+
const { frontmatter, body } = parseFrontmatter(canonical);
|
|
10
|
+
const name = path.basename(path.dirname(source));
|
|
11
|
+
const policy = resolveSkillModelPolicy(frontmatter.commandHint);
|
|
12
|
+
const fields = policy ? [`aiwg-model-role: ${policy.modelRole}`, `aiwg-model-tier: ${policy.modelTier}`,
|
|
13
|
+
...(policy.modelEffort ? [`aiwg-model-effort: ${policy.modelEffort}`] : []),
|
|
14
|
+
...(frontmatter.commandHint?.modelRationale ? [`aiwg-model-rationale: ${frontmatter.commandHint.modelRationale}`] : [])] : [];
|
|
15
|
+
const mirrored = `---\nname: ${name}\ndescription: ${frontmatter.description || `Run AIWG skill ${name}`}\n${fields.length ? fields.join('\n') + '\n' : ''}---\n\n${body.trim()}\n`;
|
|
16
|
+
const clean = stripManagedMarker(deployed).replace(/\n?<!-- AIWG:bound-rules:start -->[\s\S]*?<!-- AIWG:bound-rules:end -->\n?/g, '').trimEnd();
|
|
17
|
+
return [mirrored, generateCommandContent(name, frontmatter, body)]
|
|
18
|
+
.some(expected => expected.trimEnd() === clean);
|
|
19
|
+
}
|
|
20
|
+
export async function hasCurrentBundledArtifact(file, frameworkRoot) {
|
|
21
|
+
try {
|
|
22
|
+
const receipt = JSON.parse(await fs.readFile(path.join(path.dirname(file), '.aiwg-manifest.json'), 'utf8'));
|
|
23
|
+
const record = receipt.managed?.[path.basename(file)];
|
|
24
|
+
if (typeof record?.hash !== 'string' || typeof record.sourcePath !== 'string')
|
|
25
|
+
return false;
|
|
26
|
+
// Installation paths can change between releases. Resolve the recorded
|
|
27
|
+
// bundled suffix against this package, never against the old installation.
|
|
28
|
+
const suffix = record.sourcePath.replaceAll('\\', '/').match(/(?:^|\/)(agentic\/code\/.+)$/)?.[1];
|
|
29
|
+
if (!suffix)
|
|
30
|
+
return false;
|
|
31
|
+
const source = path.resolve(frameworkRoot, suffix);
|
|
32
|
+
const relative = path.relative(path.join(frameworkRoot, 'agentic/code'), source);
|
|
33
|
+
if (relative.startsWith('..') || path.isAbsolute(relative))
|
|
34
|
+
return false;
|
|
35
|
+
const [deployed, canonical] = await Promise.all([fs.readFile(file), fs.readFile(source)]);
|
|
36
|
+
if (record.hash !== hash(deployed))
|
|
37
|
+
return false;
|
|
38
|
+
if (typeof record.sourceHash === 'string')
|
|
39
|
+
return record.sourceHash === hash(canonical);
|
|
40
|
+
// Historical skill-command receipts recorded only the output digest.
|
|
41
|
+
// Compare their known generated formats, including metadata and body.
|
|
42
|
+
if (record.sourceHash !== undefined || record.kind !== 'skill-command' || path.basename(source) !== 'SKILL.md')
|
|
43
|
+
return false;
|
|
44
|
+
return currentLegacySkillCommand(deployed.toString('utf8'), canonical.toString('utf8'), source);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Legacy, unreadable, or incomplete receipts retain the conservative stamp check.
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=refresh-artifact-freshness.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Redeploy each selected bundle only to its declared providers.
|
|
2
2
|
import { bundleCopyArgs } from './bundle-deployment-mode.js';
|
|
3
|
+
import { discoveryMessage } from './use-copy-selection.js';
|
|
3
4
|
import { withInstalledSelection } from '../../config/installed-selection.js';
|
|
4
5
|
import { bundleProviders, bundleUseName, pruneUndeclaredBundles, pruneAfterScopedDeployments } from './bundle-reconciliation.js';
|
|
5
6
|
export async function refreshDeclaredBundles(ctx, config, frameworks, requested, opts) {
|
|
@@ -11,6 +12,8 @@ export async function refreshDeclaredBundles(ctx, config, frameworks, requested,
|
|
|
11
12
|
for (const fw of frameworks)
|
|
12
13
|
for (const provider of bundleProviders(config?.installed ?? {}, fw, requested)) {
|
|
13
14
|
const copyArgs = bundleCopyArgs(config?.installed ?? {}, fw, provider);
|
|
15
|
+
if (!opts.quiet && !copyArgs.includes('--copy-all'))
|
|
16
|
+
console.log(discoveryMessage(bundleUseName(fw), opts.dryRun));
|
|
14
17
|
if (opts.dryRun) {
|
|
15
18
|
if (!opts.quiet)
|
|
16
19
|
console.log(` Would re-deploy: ${fw} for ${provider} — aiwg use ${bundleUseName(fw)} --provider ${provider}${copyArgs.length ? ` ${copyArgs.join(' ')}` : ''}`);
|
|
@@ -42,7 +42,7 @@ function groups(doc, event) {
|
|
|
42
42
|
const hooks = doc.hooks;
|
|
43
43
|
return Array.isArray(hooks?.[event]) ? hooks[event] : [];
|
|
44
44
|
}
|
|
45
|
-
async function staleHooks(projectRoot, frameworkRoot, provider) {
|
|
45
|
+
async function staleHooks(projectRoot, frameworkRoot, provider, scope) {
|
|
46
46
|
if (!['claude', 'muse', 'factory', 'codex', 'cursor'].includes(provider))
|
|
47
47
|
return [];
|
|
48
48
|
const file = provider === 'claude' ? '.claude/settings.json' : `.${provider}/hooks.json`;
|
|
@@ -69,7 +69,9 @@ async function staleHooks(projectRoot, frameworkRoot, provider) {
|
|
|
69
69
|
const source = sources.find(hook => hook.id === 'aiwg-prompt-discovery');
|
|
70
70
|
if (!source?.args?.[0])
|
|
71
71
|
return [];
|
|
72
|
-
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);
|
|
73
75
|
const candidates = groups(doc, 'UserPromptSubmit').flatMap(group => group.hooks || [])
|
|
74
76
|
.filter(hook => hook._aiwg_id === source.id);
|
|
75
77
|
if (!candidates.some(hook => hook.command === expected && hook.statusMessage === 'AIWG prompt discovery'))
|
|
@@ -200,10 +202,10 @@ async function staleHookScripts(projectRoot, frameworkRoot, provider) {
|
|
|
200
202
|
return stale;
|
|
201
203
|
}
|
|
202
204
|
export async function checkManagedDeployment(options) {
|
|
203
|
-
const { projectRoot, frameworkRoot, provider, quiet } = options;
|
|
205
|
+
const { projectRoot, frameworkRoot, provider, quiet, scope = 'project' } = options;
|
|
204
206
|
const pkg = await readJson(path.join(frameworkRoot, 'package.json'));
|
|
205
207
|
const [hooks, scripts, rules] = await Promise.all([
|
|
206
|
-
staleHooks(projectRoot, frameworkRoot, provider),
|
|
208
|
+
staleHooks(projectRoot, frameworkRoot, provider, scope),
|
|
207
209
|
staleHookScripts(projectRoot, frameworkRoot, provider),
|
|
208
210
|
typeof pkg.version === 'string' ? staleRules(projectRoot, provider, pkg.version) : [],
|
|
209
211
|
]);
|
|
@@ -23,6 +23,7 @@ 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';
|
|
26
27
|
import { refreshUserHooksOrWarn } from './refresh-user-hooks.js';
|
|
27
28
|
import { getFrameworkRoot } from '../../channel/manager.mjs';
|
|
28
29
|
import { refreshAllPackages } from '../../packages/registry.js';
|
|
@@ -41,7 +42,7 @@ const PROVIDER_AGENT_DIRS = {
|
|
|
41
42
|
factory: '.factory/droids',
|
|
42
43
|
opencode: '.opencode/agent',
|
|
43
44
|
warp: '.warp/agents',
|
|
44
|
-
|
|
45
|
+
devin: '.windsurf/agents',
|
|
45
46
|
};
|
|
46
47
|
export async function currentBundledAgentBasenames(frameworkRoot) {
|
|
47
48
|
return new Set((await collectPackagedAgentInventory(frameworkRoot)).keys());
|
|
@@ -158,7 +159,7 @@ async function collectManagedProviderArtifacts(projectRoot, provider, kinds) {
|
|
|
158
159
|
continue;
|
|
159
160
|
}
|
|
160
161
|
for (const entry of entries) {
|
|
161
|
-
if (!entry.isFile() || !entry.name.endsWith('.md'))
|
|
162
|
+
if (!entry.isFile() || !(entry.name.endsWith('.md') || provider === 'codex' && kind === 'agents' && entry.name.endsWith('.toml')))
|
|
162
163
|
continue;
|
|
163
164
|
// Generated indexes are rewritten on every deploy, never orphaned.
|
|
164
165
|
if (entry.name === 'RULES-INDEX.md' || entry.name === 'RULES-ONDEMAND.md')
|
|
@@ -193,8 +194,11 @@ export async function detectStaleProviderTrees(options) {
|
|
|
193
194
|
for (const provider of Object.keys(PROVIDER_AGENT_DIRS)) {
|
|
194
195
|
if (provider === options.provider)
|
|
195
196
|
continue;
|
|
196
|
-
const
|
|
197
|
+
const candidates = (await collectManagedProviderArtifacts(options.projectRoot, provider, PRUNABLE_ARTIFACT_KINDS))
|
|
197
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);
|
|
198
202
|
if (hits.length === 0)
|
|
199
203
|
continue;
|
|
200
204
|
const counts = { agents: 0, commands: 0, rules: 0 };
|
|
@@ -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
|