@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.
Files changed (180) hide show
  1. package/README.md +1 -1
  2. package/agentic/code/addons/aiwg-hooks/hooks/aiwg-prompt-discovery.cjs +3 -2
  3. package/agentic/code/providers/capability-matrix.yaml +4 -4
  4. package/agentic/code/providers/model-capabilities.v1.json +169 -46
  5. package/agentic/code/providers/model-catalog.v1.json +17 -15
  6. package/bin/aiwg.mjs +3 -1
  7. package/dist/src/agents/agent-packager.js +3 -3
  8. package/dist/src/artifacts/cli.js +6 -2
  9. package/dist/src/artifacts/fortemi-core-sync.js +2 -0
  10. package/dist/src/artifacts/index-query-help.js +27 -0
  11. package/dist/src/artifacts/query-engine-installation.js +17 -4
  12. package/dist/src/artifacts/query-engine-name-intent.js +56 -0
  13. package/dist/src/artifacts/query-engine-scoring.js +14 -8
  14. package/dist/src/artifacts/query-engine-show-card.js +3 -3
  15. package/dist/src/cli/agent-spawn.js +4 -4
  16. package/dist/src/cli/handlers/best-practices-audit.js +1 -1
  17. package/dist/src/cli/handlers/bundle-deployment-mode.js +26 -13
  18. package/dist/src/cli/handlers/bundle-reconciliation.js +2 -2
  19. package/dist/src/cli/handlers/init.js +1 -1
  20. package/dist/src/cli/handlers/issues.js +5 -0
  21. package/dist/src/cli/handlers/marketplace-plugin-search.js +6 -5
  22. package/dist/src/cli/handlers/marketplace.js +1 -1
  23. package/dist/src/cli/handlers/models-muse-wrapper.js +32 -0
  24. package/dist/src/cli/handlers/models.js +5 -4
  25. package/dist/src/cli/handlers/refresh-artifact-freshness.js +51 -0
  26. package/dist/src/cli/handlers/refresh-bundles.js +3 -0
  27. package/dist/src/cli/handlers/refresh-managed-deployment.js +19 -7
  28. package/dist/src/cli/handlers/refresh-user-hooks.js +102 -0
  29. package/dist/src/cli/handlers/refresh.js +9 -3
  30. package/dist/src/cli/handlers/repo-access.js +15 -2
  31. package/dist/src/cli/handlers/sdlc-accelerate.js +1 -1
  32. package/dist/src/cli/handlers/steward.js +1 -1
  33. package/dist/src/cli/handlers/subcommands-bundles.js +1 -1
  34. package/dist/src/cli/handlers/subcommands-discovery.js +5 -0
  35. package/dist/src/cli/handlers/subcommands-list.js +1 -1
  36. package/dist/src/cli/handlers/subcommands-plugins.js +1 -1
  37. package/dist/src/cli/handlers/subcommands-storage.js +11 -0
  38. package/dist/src/cli/handlers/team.js +1 -1
  39. package/dist/src/cli/handlers/use-additive-bundles.js +9 -2
  40. package/dist/src/cli/handlers/use-bundle-counts.js +1 -1
  41. package/dist/src/cli/handlers/use-copy-selection.js +42 -0
  42. package/dist/src/cli/handlers/use.js +33 -38
  43. package/dist/src/cli/handlers/workspace-context.js +4 -0
  44. package/dist/src/cli/help-generator.js +1 -1
  45. package/dist/src/cli/new-project-options.js +46 -0
  46. package/dist/src/cli/router.js +15 -4
  47. package/dist/src/cli/scope-resolver.js +6 -6
  48. package/dist/src/cli/services/deployment-probe-scope.js +11 -0
  49. package/dist/src/cli/services/deployment-staleness.js +83 -0
  50. package/dist/src/cli/services/deployment-verification.js +20 -11
  51. package/dist/src/config/aiwg-config.js +1 -1
  52. package/dist/src/config/authorization-cli.js +36 -1
  53. package/dist/src/config/config-normalization.js +3 -1
  54. package/dist/src/config/worker-guidance-warning.js +8 -0
  55. package/dist/src/data/community.yaml +3 -3
  56. package/dist/src/extensions/commands/definitions.js +2 -2
  57. package/dist/src/extensions/manifest.js +27 -1
  58. package/dist/src/extensions/user-hook-diagnostics.js +18 -1
  59. package/dist/src/extensions/verified-hook-command.js +9 -0
  60. package/dist/src/features/catalog.js +2 -2
  61. package/dist/src/issues/cli.js +10 -2
  62. package/dist/src/marketplace/cache.js +31 -0
  63. package/dist/src/marketplace/plugin-search.js +39 -20
  64. package/dist/src/marketplace/public-search.js +122 -0
  65. package/dist/src/marketplace/registry.js +2 -0
  66. package/dist/src/marketplace/search-contract.js +19 -0
  67. package/dist/src/marketplace/sources/public-search.js +81 -0
  68. package/dist/src/mcp/cli.mjs +8 -7
  69. package/dist/src/mcp/credentials.mjs +1 -1
  70. package/dist/src/mcp/registry.js +6 -2
  71. package/dist/src/mcp/tool-filters.mjs +1 -1
  72. package/dist/src/memory/provider-memory-adapter.js +1 -1
  73. package/dist/src/models/catalog-policy.js +2 -1
  74. package/dist/src/models/config-loader.js +2 -1
  75. package/dist/src/models/cursor-models.js +92 -0
  76. package/dist/src/models/cursor-worker-version.d.mts +2 -0
  77. package/dist/src/models/cursor-worker-version.mjs +27 -0
  78. package/dist/src/models/model-capabilities.v1.json +169 -46
  79. package/dist/src/models/model-catalog.v1.json +17 -15
  80. package/dist/src/models/model-discovery.js +7 -6
  81. package/dist/src/models/policy-resources.js +1 -1
  82. package/dist/src/models/provider-policy.js +1 -1
  83. package/dist/src/models/worker-direct-readiness.js +8 -5
  84. package/dist/src/models/worker-health-readiness.js +4 -0
  85. package/dist/src/models/worker-installation.d.mts +5 -2
  86. package/dist/src/models/worker-installation.mjs +20 -12
  87. package/dist/src/models/worker-invocation-policy.js +22 -2
  88. package/dist/src/models/worker-plan.js +3 -1
  89. package/dist/src/models/worker-wiring-diagnostics.js +25 -0
  90. package/dist/src/models/wrapper-deployment.js +1 -1
  91. package/dist/src/models/wrapper-enforcement.js +6 -2
  92. package/dist/src/plugin/skill-command-frontmatter.js +1 -1
  93. package/dist/src/plugin/skill-command-translator.js +1 -1
  94. package/dist/src/policy/repo-access-workspace-spec.js +63 -0
  95. package/dist/src/policy/repo-access.js +22 -0
  96. package/dist/src/providers/capability-matrix.yaml +4 -4
  97. package/dist/src/providers/deployment-ownership.mjs +1 -1
  98. package/dist/src/providers/deployment-preservation.mjs +10 -5
  99. package/dist/src/providers/deployment-removal.js +1 -1
  100. package/dist/src/providers/devin-compat.d.mts +4 -0
  101. package/dist/src/providers/devin-compat.mjs +29 -0
  102. package/dist/src/providers/grok-build-acp.js +39 -9
  103. package/dist/src/providers/grok-build-paths.js +8 -7
  104. package/dist/src/providers/provider-context-contracts.js +7 -3
  105. package/dist/src/providers/provider-definition-schema.js +1 -1
  106. package/dist/src/providers/provider-definitions.js +1 -1
  107. package/dist/src/providers/provider-definitions.mjs +3 -3
  108. package/dist/src/providers/provider-inventory.js +13 -1
  109. package/dist/src/providers/provider-seeds-1.js +1 -1
  110. package/dist/src/providers/provider-seeds-3.js +10 -9
  111. package/dist/src/providers/transformation-receipt-integration.js +1 -1
  112. package/dist/src/sessions/adapters/windsurf.js +7 -7
  113. package/dist/src/sessions/grok-build-cli-output.js +1 -1
  114. package/dist/src/sessions/grok-build-cli.js +7 -1
  115. package/dist/src/skills/bundle-import-cli.js +61 -0
  116. package/dist/src/skills/bundle-import-plan.js +108 -0
  117. package/dist/src/skills/bundle-import.js +192 -0
  118. package/dist/src/skills/cli.js +5 -0
  119. package/dist/src/skills/deployment-policy.js +1 -1
  120. package/dist/src/skills/importer.js +4 -4
  121. package/dist/src/smiths/agentsmith/demo.js +1 -1
  122. package/dist/src/smiths/agentsmith/examples.js +6 -6
  123. package/dist/src/smiths/commandsmith/generator.js +1 -1
  124. package/dist/src/smiths/context-pipeline/allowlist.js +1 -1
  125. package/dist/src/smiths/context-pipeline/muse-bridge.js +7 -4
  126. package/dist/src/smiths/context-pipeline/parallelism-section.js +2 -2
  127. package/dist/src/smiths/context-pipeline/workspace-audit.js +37 -6
  128. package/dist/src/smiths/context-pipeline/workspace-bootstrap.js +3 -1
  129. package/dist/src/smiths/context-pipeline/workspace-doctor.js +16 -4
  130. package/dist/src/smiths/context-pipeline/workspace-document.js +4 -2
  131. package/dist/src/smiths/hook-bridge/codex-trust.js +56 -7
  132. package/dist/src/smiths/hook-bridge/cursor-translator.js +89 -0
  133. package/dist/src/smiths/hook-bridge/index.js +4 -1
  134. package/dist/src/smiths/skillsmith/collision-detector.js +1 -1
  135. package/dist/src/smiths/skillsmith/namespace-adapter.js +1 -1
  136. package/dist/src/smiths/skillsmith/platform-resolver.js +2 -2
  137. package/dist/src/writing/campaign-report.js +4 -3
  138. package/dist/src/writing/contextual-diagnostics.js +29 -3
  139. package/dist/src/writing/current-patterns.catalogue.json +4 -4
  140. package/dist/src/writing/current-patterns.js +3 -2
  141. package/dist/src/writing/structural-judgment.catalogue.json +17 -0
  142. package/dist/src/writing/structural-judgment.js +33 -0
  143. package/dist/src/writing/structural-patterns.js +78 -6
  144. package/dist/src/writing/validation-campaign.js +3 -0
  145. package/dist/src/writing/validation-engine.js +7 -4
  146. package/package.json +4 -2
  147. package/schemas/models/model-config-compatibility.v1.schema.json +1 -1
  148. package/tools/agents/deploy-agents.mjs +12 -10
  149. package/tools/agents/deploy-options.mjs +1 -0
  150. package/tools/agents/providers/base-behaviors.mjs +1 -1
  151. package/tools/agents/providers/base-contract.mjs +1 -1
  152. package/tools/agents/providers/base-kernel-skills.mjs +1 -1
  153. package/tools/agents/providers/base-models-platforms.mjs +9 -7
  154. package/tools/agents/providers/base-rule-index.mjs +1 -1
  155. package/tools/agents/providers/codex.mjs +1 -0
  156. package/tools/agents/providers/cursor-prompt-discovery.mjs +13 -0
  157. package/tools/agents/providers/cursor.mjs +2 -0
  158. package/tools/agents/providers/devin.mjs +3 -0
  159. package/tools/agents/providers/grok-build.mjs +14 -19
  160. package/tools/agents/providers/hook-capabilities.mjs +1 -1
  161. package/tools/agents/providers/model-wrapper.mjs +1 -1
  162. package/tools/agents/providers/openclaw-context.mjs +6 -0
  163. package/tools/agents/providers/openclaw.mjs +14 -12
  164. package/tools/agents/providers/rule-delivery-surface.mjs +15 -11
  165. package/tools/agents/providers/rule-deployment-prepare.mjs +9 -8
  166. package/tools/agents/providers/rule-presentation.mjs +1 -1
  167. package/tools/agents/providers/rule-projection.mjs +5 -5
  168. package/tools/agents/providers/rule-startup.mjs +4 -2
  169. package/tools/agents/providers/skill-copy-prune.mjs +5 -1
  170. package/tools/agents/providers/windsurf.mjs +26 -26
  171. package/tools/agents/use-rule-selection.mjs +1 -1
  172. package/tools/cli/workspace-deployment-health.mjs +38 -0
  173. package/tools/cli/workspace-status.mjs +5 -2
  174. package/tools/daemon/provider-watcher.mjs +3 -3
  175. package/tools/plugin/package-plugins.mjs +16 -2
  176. package/tools/ralph-external/lib/deepseek-harness-adapter.mjs +36 -22
  177. package/tools/ralph-external/lib/factory-adapter.mjs +13 -28
  178. package/tools/ralph-external/lib/factory-stream-final.mjs +31 -0
  179. package/tools/skills/deploy-skills-codex.mjs +2 -1
  180. package/vscode-extension/schemas/aiwg.config.v1.json +15 -1
package/bin/aiwg.mjs CHANGED
@@ -268,7 +268,9 @@ maybeWarnUnbuiltDist();
268
268
  // Propagate the strict no-write contract through helpers that may resolve
269
269
  // installation/channel state before the command context exists.
270
270
  function isReadOnlyReport(args) {
271
- return (args[0] === 'memory' && (['audit', 'cost', 'recommend', 'plan', 'verify'].includes(args[1]) || args.includes('--preview') || args.includes('--help') || args.includes('-h')))
271
+ // Scaffolding validates its own writes; startup must leave rejected requests untouched.
272
+ return ['new', '-new', '--new'].includes(args[0])
273
+ || (args[0] === 'memory' && (['audit', 'cost', 'recommend', 'plan', 'verify'].includes(args[1]) || args.includes('--preview') || args.includes('--help') || args.includes('-h')))
272
274
  || (['marketplace', 'market'].includes(args[0]) && args[1] === 'search' && args.includes('--plugins'))
273
275
  || (args[0] === 'help' && args[1] === 'memory')
274
276
  || (args[0] === 'rules' && ['inventory', 'list'].includes(args[1]))
@@ -199,15 +199,15 @@ export class AgentPackager {
199
199
  return lines.join('\n');
200
200
  }
201
201
  /**
202
- * Convert to Windsurf format (plain markdown, no YAML frontmatter)
202
+ * Convert to Devin Desktop format (plain markdown, no YAML frontmatter)
203
203
  *
204
- * Windsurf uses AGENTS.md for directory-scoped instructions.
204
+ * Devin Desktop uses AGENTS.md for directory-scoped instructions.
205
205
  * Individual agent definitions use clean markdown sections.
206
206
  */
207
207
  convertToWindsurfFormat(agent) {
208
208
  const { metadata, content } = agent;
209
209
  const lines = [];
210
- // Windsurf prefers clean markdown without YAML frontmatter
210
+ // Devin Desktop prefers clean markdown without YAML frontmatter
211
211
  lines.push(`### ${metadata.name}`);
212
212
  lines.push('');
213
213
  // Only add description if present
@@ -668,6 +668,10 @@ async function validateIndexConfigOrExit(cwd) {
668
668
  * Stub — full implementation in #416
669
669
  */
670
670
  async function handleQuery(args) {
671
+ if (args.includes('--help') || args.includes('-h')) {
672
+ const { printIndexQueryHelp } = await import('./index-query-help.js');
673
+ return printIndexQueryHelp();
674
+ }
671
675
  const { queryIndex } = await import('./query-engine.js');
672
676
  const cwd = process.cwd();
673
677
  // Parse query text (positional args before any -- flags)
@@ -1169,7 +1173,7 @@ async function handleSync(args) {
1169
1173
  console.log(JSON.stringify({ manifests, failures }, null, 2));
1170
1174
  return;
1171
1175
  }
1172
- console.log(`Fortemi Core sync: ${manifests.length} graph(s) succeeded, ${failures.length} failed`);
1176
+ console.log(`Fortemi Core sync: ${manifests.length} graph(s) succeeded, ${failures.length} failed\nSource bodies: no size cap; 0 items omitted for size.`);
1173
1177
  for (const manifest of manifests) {
1174
1178
  console.log(` ${manifest.graph}: ${manifest.status}, ${manifest.item_count} item(s) → ${manifest.export_path}`);
1175
1179
  warnSyncTextQuality(manifest);
@@ -1187,7 +1191,7 @@ async function handleSync(args) {
1187
1191
  console.log(JSON.stringify(manifest, null, 2));
1188
1192
  return;
1189
1193
  }
1190
- console.log(`Fortemi Core ${manifest.status}: ${manifest.item_count} item(s) → ${manifest.export_path}`);
1194
+ console.log(`Fortemi Core ${manifest.status}: ${manifest.item_count} item(s) → ${manifest.export_path}\nSource bodies: no size cap; 0 items omitted for size.`);
1191
1195
  warnSyncTextQuality(manifest);
1192
1196
  }
1193
1197
  catch (err) {
@@ -199,6 +199,8 @@ export function syncFortemiCoreIndex(cwd, options = {}) {
199
199
  privacy: options.privacy,
200
200
  generatedAt,
201
201
  schemaVersion: "v2",
202
+ // Fulltext must include trailing tokens even beyond the standalone export cap (#4352).
203
+ maxSourceBodyBytes: Number.POSITIVE_INFINITY,
202
204
  });
203
205
  const checksum = writeExport(temporaryPath, exported, maxChars);
204
206
  const recordsWithConcepts = exported.items.filter((item) => (item.skos_concepts?.length ?? 0) > 0).length;
@@ -0,0 +1,27 @@
1
+ // Public query help, including the source-body size policy for each backend.
2
+ export function printIndexQueryHelp() {
3
+ console.log(`Usage: aiwg index query [text] [options]
4
+
5
+ Options:
6
+ --fulltext BM25 search over source bodies
7
+ --backend fortemi-core|local Search backend (default: fortemi-core)
8
+ --graph <name> Graph to search (default: project on Fortemi Core)
9
+ --type <type> Filter by artifact type
10
+ --phase <phase> Filter by phase
11
+ --tags <tag,...> Filter by tags
12
+ --path <glob> Filter by source path
13
+ --updated-after <date> Filter by update date
14
+ --limit <n> Maximum results (default: 20)
15
+ --semantic Semantic query mode
16
+ --hybrid Fortemi Core hybrid query mode
17
+ --json Machine-readable results
18
+ --help, -h Show this help
19
+
20
+ --fulltext source sizes:
21
+ Fortemi Core: searches text bodies captured at sync, without a size cap.
22
+ Binary and unreadable sources remain metadata-only. Re-run 'aiwg index sync'
23
+ to replace older caches that omitted bodies larger than 256 KiB.
24
+ local: reads current source files at query time, without a size cap.
25
+ Neither backend truncates text bodies by size during fulltext search.`);
26
+ }
27
+ //# sourceMappingURL=index-query-help.js.map
@@ -3,25 +3,38 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import os from 'node:os';
5
5
  import { isCorpusBundleInstalled } from './framework-capabilities.js';
6
+ import { readAiwgConfigCandidate } from '../config/aiwg-config.js';
7
+ import { frameworkRegistryId } from '../config/framework-aliases.js';
6
8
  export async function isArtifactInstalled(cwd, root, entry, kind, bundle) {
7
- if (entry.type === 'skill') {
9
+ if (['skill', 'agent', 'command'].includes(entry.type)) {
8
10
  const normalized = entry.path.replace(/\\/g, '/');
9
11
  const slug = path.posix.basename(normalized) === 'SKILL.md'
10
12
  ? path.posix.basename(path.posix.dirname(normalized)) : path.posix.basename(normalized, '.md');
11
13
  const { listProviderDeploymentLayouts, resolveProviderPathValue } = await import('../providers/provider-definitions.js');
12
14
  for (const provider of listProviderDeploymentLayouts()) {
13
- const roots = [provider.paths.kernelSkills, provider.paths.artifacts.skills, provider.paths.contextDiscovery?.skills,
14
- provider.smithPaths?.skills];
15
+ const roots = entry.type === 'skill'
16
+ ? [provider.paths.kernelSkills, provider.paths.artifacts.skills, provider.paths.contextDiscovery?.skills, provider.smithPaths?.skills]
17
+ : [provider.paths.artifacts[entry.type === 'agent' ? 'agents' : 'commands']];
15
18
  for (const base of [cwd, os.homedir()])
16
19
  for (const relative of roots) {
17
20
  if (!relative)
18
21
  continue;
19
22
  const directory = resolveProviderPathValue(relative, base);
20
- if (fs.existsSync(path.join(directory, slug, 'SKILL.md')))
23
+ const files = entry.type === 'skill' ? [path.join(slug, 'SKILL.md')]
24
+ : [slug + '.md', slug + '.toml', slug + '.yaml', slug + '.prompt.md'];
25
+ if (files.some(file => fs.existsSync(path.join(directory, file))))
21
26
  return true;
22
27
  }
23
28
  }
24
29
  }
30
+ if (bundle && ['skill', 'agent', 'command'].includes(entry.type)) {
31
+ const config = await readAiwgConfigCandidate(cwd);
32
+ const selected = Object.entries(config?.installed ?? {}).find(([id]) => frameworkRegistryId(id) === frameworkRegistryId(bundle))?.[1]
33
+ ?? config?.installed.all;
34
+ const deployments = Object.values(selected?.deployedTo ?? {});
35
+ if (deployments.length && deployments.every(flags => flags.copy === false && flags.kernelOnly !== false))
36
+ return false;
37
+ }
25
38
  return isCorpusBundleInstalled(cwd, root, kind, bundle);
26
39
  }
27
40
  //# sourceMappingURL=query-engine-installation.js.map
@@ -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 ('aiwg', 'skill', 'agent', 'command', 'rule',
34
- // 'flow', 'workflow') — in a discover query these carry zero discriminating
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 ? ` Deploy it with \`aiwg use ${owner[2]}\`.` : '') } : {}),
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
- windsurf: {
88
+ devin: {
89
89
  binary: null,
90
90
  dangerousFlag: null,
91
- name: 'Windsurf',
92
- guidanceMessage: 'Windsurf is IDE-integrated and cannot be spawned from the CLI.\n' +
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 windsurf && aiwg mcp serve\n' +
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, windsurf
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
- receipt.bundleDeployments ??= {};
33
+ provider = canonicalDesktopProviderId(provider);
34
+ receipt.bundleDeployments = canonicalizeDesktopProviderKeys(receipt.bundleDeployments ?? {});
33
35
  receipt.bundleDeployments[provider] ??= {};
34
- receipt.bundleDeployments[provider][frameworkRegistryId(id)] = { copy: args.includes('--copy-all') || args.includes('--copy-standard-skills'), ...flags, ...(provider === 'flue' ? { package: args.includes('--package') } : {}), produces };
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
- // Local/support bundles copy physically in index mode too; only operator flags prohibit cleanup.
50
- export function copyCleanupArgs(args) {
51
- return args.includes('--copy-all') || args.includes('--copy-standard-skills') ? [] : ['--index-mode'];
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 (!installed?.[id]?.deployedTo[provider])
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
- return explicit ? requested : config.installed[id]?.deployedTo[provider]?.copy ?? requested;
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(id, provider, args) {
68
- return { skipUtils: args.includes('--no-utils'), kernelOnly: id === 'all' && !['pi', 'omp'].includes(provider)
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
- windsurf: 'Windsurf AGENTS.md',
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 the read-only provider-plugin mode separately from remote skill catalogs.
2
- import { formatPluginSearch, searchProviderPlugins } from '../../marketplace/plugin-search.js';
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 = searchProviderPlugins(query.join(' '), {
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(' ')}` : ''}`);