@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
@@ -8,9 +8,9 @@ channels:
8
8
  url: https://discord.gg/BuAusFMxdA
9
9
  cta: Join the Discord
10
10
  - id: telegram
11
- name: Telegram
12
- url: https://t.me/+oJg9w2lE6A5lOGFh
13
- cta: Join the Telegram
11
+ name: AIWG Telegram foyer
12
+ url: https://t.me/joinaiwg
13
+ cta: Visit the AIWG Telegram foyer (verify, then get an invite)
14
14
  star_cta:
15
15
  short: Star AIWG on GitHub
16
16
  long: If AIWG saved you time, a star at github.com/jmagly/aiwg helps others find it.
@@ -356,7 +356,7 @@ export const useCommand = {
356
356
  copilot: 'full',
357
357
  factory: 'full',
358
358
  cursor: 'full',
359
- windsurf: 'full',
359
+ devin: 'full',
360
360
  openclaw: 'full',
361
361
  generic: 'full',
362
362
  },
@@ -432,7 +432,7 @@ export const cockpitCommand = {
432
432
  copilot: 'full',
433
433
  factory: 'full',
434
434
  cursor: 'full',
435
- windsurf: 'full',
435
+ devin: 'full',
436
436
  openclaw: 'full',
437
437
  generic: 'full',
438
438
  },
@@ -140,7 +140,8 @@ export const ProviderConfigSchema = z.strictObject({
140
140
  'omp',
141
141
  'pi',
142
142
  'warp',
143
- 'windsurf',
143
+ 'devin',
144
+ 'windsurf', // Deprecated extends alias for existing provider bundles.
144
145
  ]),
145
146
  displayName: z.string().min(1).max(128).optional(),
146
147
  aliases: z.array(z.string().min(1).max(64)).max(20).optional(),
@@ -205,6 +206,30 @@ export const CliCommandsSchema = z.strictObject({
205
206
  // ============================================
206
207
  // Top-level BundleManifestSchema
207
208
  // ============================================
209
+ /** Pinned, inert third-party skill sources; renames map upstream names to local names. */
210
+ const upstreamSkillName = z.string().max(64).regex(bundleNamePattern);
211
+ export const BundleUpstreamSchema = z.strictObject({
212
+ repo: z.string().min(1).max(2048).refine(value => {
213
+ if (/[\u0000-\u001f\u007f]/.test(value) || value.startsWith('-'))
214
+ return false;
215
+ try {
216
+ const locator = new URL(value);
217
+ return !locator.username && !locator.password && !locator.search && !locator.hash;
218
+ }
219
+ catch {
220
+ return !value.includes('::');
221
+ }
222
+ }, 'must be a credential-free repository locator'),
223
+ commit: z.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/, 'must be a full Git commit id'),
224
+ license: z.string().min(1).max(128),
225
+ skills: z.array(upstreamSkillName).min(1).max(500),
226
+ renames: z.record(upstreamSkillName, upstreamSkillName),
227
+ }).refine(value => {
228
+ const names = value.skills.map(name => value.renames[name] ?? name);
229
+ return new Set(value.skills).size === value.skills.length
230
+ && new Set(names).size === names.length
231
+ && Object.keys(value.renames).every(name => value.skills.includes(name));
232
+ }, 'skills and renamed names must be unique; rename keys must be upstream skills');
208
233
  export const BundleManifestSchema = z.strictObject({
209
234
  // Required core fields
210
235
  id: z.string()
@@ -223,6 +248,7 @@ export const BundleManifestSchema = z.strictObject({
223
248
  author: z.string().max(128).optional(),
224
249
  license: z.string().max(64).optional(),
225
250
  repository: url().max(512).optional(),
251
+ upstream: z.array(BundleUpstreamSchema).max(50).optional(),
226
252
  // Addon inventory/flags use the same top-level shape as validate-addon and
227
253
  // upstream manifests. Nested *Config declarations remain supported.
228
254
  ...ArtifactListsSchema.shape,
@@ -2,7 +2,14 @@
2
2
  import fs from 'node:fs/promises';
3
3
  import path from 'node:path';
4
4
  import os from 'node:os';
5
- export async function diagnoseUserHookCommands() {
5
+ import { CLAUDE_USER_PROMPT_DEFERRAL } from './verified-hook-command.js';
6
+ function hasPromptHook(doc, nonDeferringOnly = false) {
7
+ const groups = doc?.hooks?.UserPromptSubmit;
8
+ return Array.isArray(groups) && groups.some(group => Array.isArray(group?.hooks) && group.hooks.some((hook) => hook?.type === 'command' && hook._aiwg_managed === true && hook._aiwg_id === 'aiwg-prompt-discovery'
9
+ && typeof hook.command === 'string' && hook.command.trim()
10
+ && (!nonDeferringOnly || !hook.command.includes(CLAUDE_USER_PROMPT_DEFERRAL))));
11
+ }
12
+ export async function diagnoseUserHookCommands(projectRoot) {
6
13
  const diagnostics = [];
7
14
  for (const provider of ['claude', 'muse']) {
8
15
  const file = path.join(os.homedir(), `.${provider}`, provider === 'claude' ? 'settings.json' : 'hooks.json');
@@ -13,6 +20,16 @@ export async function diagnoseUserHookCommands() {
13
20
  catch {
14
21
  continue;
15
22
  } // Existing config diagnostics own unreadable documents.
23
+ if (provider === 'claude' && projectRoot && path.resolve(projectRoot) !== path.resolve(os.homedir()) && hasPromptHook(doc, true)) {
24
+ try {
25
+ const projectFile = path.join(projectRoot, '.claude/settings.json');
26
+ if (hasPromptHook(JSON.parse(await fs.readFile(projectFile, 'utf8')))) {
27
+ diagnostics.push({ severity: 'warning', code: 'duplicate-prompt-hook', path: projectFile,
28
+ message: 'Claude user and project settings both register AIWG prompt discovery, but a user hook does not defer to the project hook. Refresh the older global hook with aiwg use all --global --providers claude.' });
29
+ }
30
+ }
31
+ catch { /* Existing config diagnostics own unreadable project settings. */ }
32
+ }
16
33
  for (const [event, groups] of Object.entries(doc.hooks || {})) {
17
34
  if (!Array.isArray(groups))
18
35
  continue;
@@ -2,6 +2,12 @@
2
2
  import { createHash } from 'node:crypto';
3
3
  import path from 'node:path';
4
4
  import os from 'node:os';
5
+ // Also identifies the already-shipped defer-aware loader in read-only diagnostics.
6
+ export const CLAUDE_USER_PROMPT_DEFERRAL = [
7
+ "try{const project=p.resolve(process.env.CLAUDE_PROJECT_DIR||process.cwd());",
8
+ "if(project!==c.anchor){const groups=JSON.parse(fs.readFileSync(p.join(project,'.claude/settings.json'),'utf8')).hooks?.UserPromptSubmit;",
9
+ "if(Array.isArray(groups)&&groups.some(g=>Array.isArray(g?.hooks)&&g.hooks.some(h=>h?.type==='command'&&h._aiwg_managed===true&&h._aiwg_id==='aiwg-prompt-discovery'&&typeof h.command==='string'&&h.command.trim())))process.exit(0);}}catch{}",
10
+ ].join('');
5
11
  export function verifiedHookCommand(root, relative, bytes, args = [], scope) {
6
12
  if (relative.split('/').includes('..') || !/^[.\w/-]+\.(?:cjs|js)$/.test(relative))
7
13
  throw new Error('Invalid managed hook script path');
@@ -18,6 +24,9 @@ export function verifiedHookCommand(root, relative, bytes, args = [], scope) {
18
24
  const loader = [
19
25
  "const fs=require('node:fs'),p=require('node:path'),M=require('node:module');",
20
26
  `const c=JSON.parse(Buffer.from('${data}','base64').toString());`,
27
+ // Claude merges project and user hooks. The project registration wins;
28
+ // keep the global fallback active when this is the home settings itself.
29
+ ...(user && relative === '.claude/hooks/aiwg-prompt-discovery.cjs' ? [CLAUDE_USER_PROMPT_DEFERRAL] : []),
21
30
  'const root=c.projectEnv?process.env[c.projectEnv]||c.anchor:c.anchor;',
22
31
  `const script=p.resolve(root,'${relative}');`,
23
32
  "if(p.relative(fs.realpathSync(script),script)!==''||!fs.lstatSync(script).isFile())throw Error('Unsafe AIWG hook path');",
@@ -71,8 +71,8 @@ export const FEATURE_CATALOG = [
71
71
  description: 'HTTP/WebSocket server for the daemon web UI and ralph-external bridge',
72
72
  packages: ['hono', '@hono/node-server', 'ws'],
73
73
  packageSpecs: {
74
- hono: '4.12.31',
75
- '@hono/node-server': '2.1.5',
74
+ hono: '4.13.17',
75
+ '@hono/node-server': '2.1.6',
76
76
  ws: '8.21.1',
77
77
  },
78
78
  enables: [
@@ -408,7 +408,7 @@ function csvFlag(args, name) {
408
408
  const value = stringFlag(args, name);
409
409
  return value ? value.split(',').map((item) => item.trim()).filter(Boolean) : [];
410
410
  }
411
- function printUsage() {
411
+ export function printUsage() {
412
412
  console.log(`Usage:
413
413
  aiwg issues create --title "..." --body-file path (configured external tracker)
414
414
  aiwg issues comment|close <number> [--body-file path] (configured external tracker)
@@ -416,7 +416,7 @@ function printUsage() {
416
416
  aiwg issue init [--prefix KEY] [--padding N]
417
417
  aiwg issue plan --title "..." [--body "..."] [--body-file path] [--json]
418
418
  aiwg issue new --title "..." [--body "..."] [--body-file path] [--authorize-policy DIGEST]
419
- aiwg issue list [--status open] [--label bug] [--search text] [--limit 20] [--json]
419
+ aiwg issues list --provider local [--status open] [--label bug] [--search text] [--limit 20] [--json]
420
420
  aiwg issue show <KEY> [--comments last:10|all]
421
421
  aiwg issue import --from gitea|github --snapshot-file path [--json]
422
422
  aiwg issue export <KEY> --to gitea|github [--out path]
@@ -428,6 +428,14 @@ function printUsage() {
428
428
  aiwg issue close <KEY> [--reason "..."]
429
429
  aiwg issue index rebuild [--force]
430
430
 
431
+ Notes:
432
+ issue and issues are aliases; --help and -h show this reference for any subcommand.
433
+ list queries local storage only; initialize it with aiwg issues init.
434
+ External tracker queries require that tracker's tools, including duplicate searches.
435
+ create/new, comment and close use the configured external tracker and verified actor.
436
+ --provider local selects local storage; an external --provider must match project config.
437
+ --authorize-policy DIGEST authorizes a reviewed issue plan when policy requires it.
438
+
431
439
  Live token sources: --token-interactive, --token-stdin, --token-file <path>,
432
440
  --token-store <name>, --token-env <NAME> (see docs/cli/sensitive-values.md).`);
433
441
  }
@@ -7,6 +7,8 @@
7
7
  *
8
8
  * @implements #787
9
9
  */
10
+ import { createHash, randomUUID } from 'node:crypto';
11
+ import { validateSearchSnapshot } from './search-contract.js';
10
12
  import fs from 'fs';
11
13
  import path from 'path';
12
14
  import os from 'os';
@@ -107,4 +109,33 @@ export function uncachePackage(source, packageId, version) {
107
109
  fs.rmSync(pkgPath, { recursive: true, force: true });
108
110
  return true;
109
111
  }
112
+ /** Query-scoped discovery data lives alongside the existing package caches. */
113
+ export function getSearchCachePath(source, query, home) {
114
+ const root = home ? path.join(home, '.aiwg/marketplace-cache') : getCacheRoot();
115
+ return path.join(root, source, 'search', `${createHash('sha256').update(query).digest('hex')}.json`);
116
+ }
117
+ export function readSearchCache(source, query, home) {
118
+ const file = getSearchCachePath(source, query, home);
119
+ if (!fs.existsSync(file))
120
+ return null;
121
+ const value = JSON.parse(fs.readFileSync(file, 'utf8'));
122
+ if (!validateSearchSnapshot(value) || value.source !== source || value.query !== query) {
123
+ throw new Error('Invalid discovery cache');
124
+ }
125
+ return value;
126
+ }
127
+ export function writeSearchCache(snapshot, home) {
128
+ if (!validateSearchSnapshot(snapshot))
129
+ throw new Error('Invalid discovery snapshot');
130
+ const file = getSearchCachePath(snapshot.source, snapshot.query, home);
131
+ fs.mkdirSync(path.dirname(file), { recursive: true });
132
+ const temporary = `${file}.${randomUUID()}.tmp`;
133
+ try {
134
+ fs.writeFileSync(temporary, JSON.stringify(snapshot, null, 2) + '\n', { flag: 'wx', mode: 0o600 });
135
+ fs.renameSync(temporary, file);
136
+ }
137
+ finally {
138
+ fs.rmSync(temporary, { force: true });
139
+ }
140
+ }
110
141
  //# sourceMappingURL=cache.js.map
@@ -1,4 +1,5 @@
1
- // Read provider-owned plugin manifests and caches without fetching or changing state.
1
+ // Search local provider data and opt-in public snapshots through one ranking contract.
2
+ import { appendPublicSearch, rankPluginResults, REFRESH_COMMAND } from './public-search.js';
2
3
  import { normalizeDirectoryListing, pluginRepository, repositoryKey } from './plugin-directory.js';
3
4
  import fs from 'node:fs';
4
5
  import os from 'node:os';
@@ -25,15 +26,23 @@ export function searchProviderPlugins(query, options = {}) {
25
26
  throw new Error('--max-age-days must be a non-negative number');
26
27
  const report = {
27
28
  query, marketplaces: [], results: [], warnings: [],
28
- ranking: 'Matched terms, review tier (anthropic > partner > none/unknown), installs, cache date; descending. Signals are observations, not ratings or capability measurements.',
29
+ coverage: [
30
+ { source: 'codex', status: 'skipped', mode: 'none', asOf: null, reason: 'Local manifest contract deferred (#783)' },
31
+ ...['cursor', 'clawhub', 'hermes', 'pulsemcp', 'glama', 'docker-mcp'].map(source => ({
32
+ source, status: 'skipped', mode: 'none', asOf: null, reason: 'Public search adapter not implemented',
33
+ })),
34
+ ],
35
+ ranking: 'Matched terms, review tier (anthropic > partner > none/unknown), installs, cache date; descending. Stars, versions and other signals are displayed separately, never treated as installs or review tiers. Signals are observations, not ratings or capability measurements.',
29
36
  };
30
37
  const provider = options.provider ?? 'all';
31
38
  if (!['all', 'claude', 'codex'].includes(provider))
32
39
  throw new Error('Plugin search supports --provider all, claude or codex');
33
40
  if (provider !== 'claude')
34
- report.warnings.push('Codex marketplace.json search deferred pending a stable local manifest/configuration contract (#783). Other provider formats are not yet supported.');
35
- if (provider === 'codex')
41
+ report.warnings.push('Codex marketplace.json search deferred pending a stable local manifest/configuration contract (#783). See source coverage for public adapters and skipped provider formats.');
42
+ if (provider === 'codex') {
43
+ report.coverage.push({ source: 'claude', status: 'skipped', mode: 'none', asOf: null, reason: 'Excluded by --provider codex' });
36
44
  return report;
45
+ }
37
46
  const base = path.join(options.claudeConfigDir ?? process.env.CLAUDE_CONFIG_DIR
38
47
  ?? path.join(options.home ?? os.homedir(), '.claude'), 'plugins');
39
48
  const now = options.now ?? Date.now();
@@ -57,7 +66,7 @@ export function searchProviderPlugins(query, options = {}) {
57
66
  else if (Date.parse(timestamp) > now)
58
67
  report.warnings.push(`Cache date is in the future: ${file} (as of ${timestamp})`);
59
68
  else if (now - Date.parse(timestamp) > maxAgeDays * 86_400_000) {
60
- report.warnings.push(`Stale cache: ${file} (as of ${timestamp}; maximum age ${maxAgeDays} days)`);
69
+ report.warnings.push(`Stale cache: ${file} (as of ${timestamp}; maximum age ${maxAgeDays} days); run ${REFRESH_COMMAND}. Claude provider-owned caches require a refresh through Claude`);
61
70
  }
62
71
  }
63
72
  const results = new Map();
@@ -87,7 +96,7 @@ export function searchProviderPlugins(query, options = {}) {
87
96
  sources: [...new Set([...(previous?.sources ?? []), source])],
88
97
  cacheAsOf: observedAt ?? previous?.cacheAsOf ?? null,
89
98
  installs: previous?.installs ?? { value: null, asOf: null },
90
- review: review ? { value: review, asOf: observedAt } : previous?.review ?? { value: null, asOf: null },
99
+ review: review ? { value: review, asOf: observedAt, source } : previous?.review ?? { value: null, asOf: null },
91
100
  matchedTerms: [], installSkill: 'install-plugin',
92
101
  installHelp: 'aiwg show skill install-plugin',
93
102
  });
@@ -143,24 +152,26 @@ export function searchProviderPlugins(query, options = {}) {
143
152
  const result = results.get(id);
144
153
  const installs = entry.unique_installs;
145
154
  if (result && typeof installs === 'number' && Number.isSafeInteger(installs) && installs >= 0) {
146
- result.installs = { value: installs, asOf: asOf(entry) ?? timestamp };
155
+ result.installs = { value: installs, asOf: asOf(entry) ?? timestamp, source: countsFile };
147
156
  }
148
157
  }
149
158
  }
150
- const terms = [...new Set(query.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [])];
151
- const tier = (result) => ({ anthropic: 2, partner: 1, none: 0 })[result.review.value ?? 'none'];
152
- report.results = [...results.values()].filter(result => {
153
- const text = [result.name, result.description, result.category, ...result.keywords].join(' ').toLowerCase();
154
- result.matchedTerms = terms.filter(term => text.includes(term));
155
- return terms.length > 0 && result.matchedTerms.length > 0;
156
- }).sort((a, b) => b.matchedTerms.length - a.matchedTerms.length || tier(b) - tier(a)
157
- || (b.installs.value ?? -1) - (a.installs.value ?? -1)
158
- || Date.parse(b.cacheAsOf ?? '1970-01-01') - Date.parse(a.cacheAsOf ?? '1970-01-01')
159
- || a.id.localeCompare(b.id));
159
+ report.results = [...results.values()];
160
+ rankPluginResults(report);
161
+ report.coverage.push({ source: 'claude', status: registry || directory ? 'searched' : 'skipped', mode: 'local', asOf: null,
162
+ reason: registry || directory ? 'Local configured manifests and directory cache only; see marketplaces and warnings for unavailable files' : 'No local manifests or directory cache' });
160
163
  if (!registry && !directory)
161
164
  report.warnings.push('No local Claude marketplace manifests or directory cache found; nothing was fetched.');
162
165
  return report;
163
166
  }
167
+ export async function searchMarketplacePlugins(query, options = {}) {
168
+ const report = searchProviderPlugins(query, options);
169
+ if (options.refresh)
170
+ report.warnings = report.warnings.filter(warning => !warning.includes('nothing was fetched'));
171
+ await appendPublicSearch(report, options);
172
+ rankPluginResults(report);
173
+ return report;
174
+ }
164
175
  export function formatPluginSearch(report) {
165
176
  const clean = (value) => value.replace(/[\u0000-\u001f\u007f-\u009f]/g, ' ');
166
177
  const lines = [`Plugin marketplace search: ${clean(report.query)}`,
@@ -169,12 +180,20 @@ export function formatPluginSearch(report) {
169
180
  for (const result of report.results)
170
181
  lines.push([
171
182
  clean(result.marketplace ? result.id : `${result.name} / ${result.id}`), clean(result.marketplace ?? 'unknown'),
172
- `${result.installs.value ?? 'unknown'} (${result.installs.asOf ?? 'unknown'})`,
173
- `${result.review.value ?? 'unknown'} (${result.review.asOf ?? 'unknown'})`, result.cacheAsOf ?? 'unknown', clean(result.description),
183
+ `${result.installs.value ?? 'unknown'} (${result.installs.asOf ?? 'unknown'}; source ${clean(result.installs.source ?? 'unknown')})`,
184
+ `${result.review.value ?? 'unknown'} (${result.review.asOf ?? 'unknown'}; source ${clean(result.review.source ?? 'unknown')})`, result.cacheAsOf ?? 'unknown', clean(result.description),
174
185
  ].join(' | '));
175
186
  if (!report.results.length)
176
187
  lines.push('No results found.');
177
- lines.push(report.ranking, 'Installation guidance for a selected ID: aiwg show skill install-plugin');
188
+ lines.push('Source coverage:');
189
+ for (const source of report.coverage)
190
+ lines.push(`${clean(source.source)}: ${source.status} (${source.mode}, as of ${source.asOf ?? 'unknown'}): ${clean(source.reason)}`);
191
+ for (const result of report.results) {
192
+ for (const [name, signal] of Object.entries(result.signals ?? {})) {
193
+ lines.push(`${clean(result.id)} ${clean(name)}: ${clean(String(signal.value ?? 'unknown'))} (as of ${signal.asOf ?? 'unknown'}; source ${clean(signal.source)})`);
194
+ }
195
+ }
196
+ lines.push(report.ranking, 'Installation guidance for a selected Claude ID: aiwg show skill install-plugin. Public results: consult the source.');
178
197
  return lines.join('\n');
179
198
  }
180
199
  //# sourceMappingURL=plugin-search.js.map
@@ -0,0 +1,122 @@
1
+ // Refresh or reuse public adapter snapshots and report the precise query coverage.
2
+ import { marketplaceSearchAdapters } from './registry.js';
3
+ import { readSearchCache, writeSearchCache } from './cache.js';
4
+ export const REFRESH_COMMAND = 'aiwg marketplace search "<query>" --plugins --refresh';
5
+ async function responseBody(response) {
6
+ if (!response.ok)
7
+ throw new Error(`HTTP ${response.status}`);
8
+ const reader = response.body?.getReader();
9
+ if (!reader)
10
+ throw new Error('Empty response');
11
+ const buffers = [];
12
+ let bytes = 0;
13
+ try {
14
+ for (;;) {
15
+ const chunk = await reader.read();
16
+ if (chunk.done)
17
+ break;
18
+ bytes += chunk.value.byteLength;
19
+ if (bytes > 5 * 1024 * 1024)
20
+ throw new Error('Response exceeds 5 MiB');
21
+ buffers.push(chunk.value);
22
+ }
23
+ return JSON.parse(Buffer.concat(buffers).toString('utf8'));
24
+ }
25
+ finally {
26
+ await reader.cancel();
27
+ }
28
+ }
29
+ function results(snapshot) {
30
+ return snapshot.observations.map(entry => ({
31
+ ...entry, id: `${snapshot.source}:${entry.id}`, provider: snapshot.source,
32
+ marketplace: snapshot.source, category: null, sources: [snapshot.endpoint], cacheAsOf: snapshot.fetchedAt,
33
+ installs: typeof entry.signals.installs?.value === 'number'
34
+ ? { ...entry.signals.installs, value: entry.signals.installs.value } : { value: null, asOf: null },
35
+ review: { value: null, asOf: null }, matchedTerms: [],
36
+ installSkill: null, installHelp: 'Discovery only; consult the source for installation guidance.',
37
+ }));
38
+ }
39
+ export async function appendPublicSearch(report, options) {
40
+ const now = options.now ?? Date.now();
41
+ for (const adapter of marketplaceSearchAdapters) {
42
+ const coverage = {
43
+ source: adapter.source, status: 'skipped', mode: 'none', asOf: null,
44
+ reason: options.provider && options.provider !== 'all' ? `Excluded by --provider ${options.provider}` : `No cache for this query; run ${REFRESH_COMMAND}`,
45
+ };
46
+ report.coverage.push(coverage);
47
+ if (options.provider && options.provider !== 'all')
48
+ continue;
49
+ let snapshot = null;
50
+ try {
51
+ snapshot = readSearchCache(adapter.source, report.query, options.home);
52
+ }
53
+ catch {
54
+ report.warnings.push(`Invalid ${adapter.source} search cache; run ${REFRESH_COMMAND}`);
55
+ }
56
+ if (options.refresh) {
57
+ try {
58
+ const endpoint = adapter.endpoint(report.query);
59
+ const response = await (options.fetch ?? globalThis.fetch)(endpoint, {
60
+ headers: { accept: 'application/json', 'user-agent': 'aiwg-marketplace-search' },
61
+ redirect: 'error', signal: AbortSignal.timeout(10_000),
62
+ });
63
+ const normalized = adapter.normalize(await responseBody(response), endpoint, new Date(now).toISOString());
64
+ const fresh = { source: adapter.source, query: report.query, endpoint, fetchedAt: new Date(now).toISOString(), ...normalized };
65
+ writeSearchCache(fresh, options.home);
66
+ snapshot = fresh;
67
+ coverage.mode = 'refresh';
68
+ }
69
+ catch (error) {
70
+ // Do not expose provider response bodies or exception text that may contain remote data.
71
+ const reason = error instanceof Error && /^HTTP \d+$/.test(error.message) ? error.message : 'request, response validation or cache write failed';
72
+ coverage.reason = `Refresh failed (${reason})${snapshot ? '; retained cached observations' : ''}`;
73
+ report.warnings.push(`${adapter.source}: ${coverage.reason}; retry ${REFRESH_COMMAND}`);
74
+ }
75
+ }
76
+ if (!snapshot)
77
+ continue;
78
+ coverage.status = 'searched';
79
+ if (coverage.mode !== 'refresh')
80
+ coverage.mode = 'cache';
81
+ coverage.asOf = snapshot.fetchedAt;
82
+ if (!coverage.reason.startsWith('Refresh failed'))
83
+ coverage.reason = snapshot.limited
84
+ ? 'Bounded first page only; additional or incomplete results were reported by the source'
85
+ : 'Query-specific snapshot; source search may omit unindexed entries';
86
+ if (snapshot.limited)
87
+ report.warnings.push(`${adapter.source}: ${coverage.reason}`);
88
+ const age = now - Date.parse(snapshot.fetchedAt);
89
+ if (age < 0)
90
+ report.warnings.push(`Cache date is in the future: ${adapter.source} (as of ${snapshot.fetchedAt})`);
91
+ else if (age > (options.maxAgeDays ?? 30) * 86_400_000) {
92
+ report.warnings.push(`Stale cache: ${adapter.source} (as of ${snapshot.fetchedAt}); run ${REFRESH_COMMAND}`);
93
+ }
94
+ report.results.push(...results(snapshot));
95
+ }
96
+ if (options.refresh && (!options.provider || options.provider === 'all' || options.provider === 'claude')) {
97
+ report.coverage.push({ source: 'claude-refresh', status: 'skipped', mode: 'none', asOf: null,
98
+ reason: 'No established public Claude directory/count endpoint contract; provider-owned caches were not overwritten. Refresh them through Claude.' });
99
+ }
100
+ }
101
+ export function rankPluginResults(report) {
102
+ const terms = [...new Set(report.query.toLowerCase().match(/[\p{L}\p{N}]+/gu) ?? [])];
103
+ const tier = (result) => ({ anthropic: 2, partner: 1, none: 0 })[result.review.value ?? 'none'];
104
+ report.results = report.results.filter(result => {
105
+ const text = [result.name, result.description, result.category, ...result.keywords].join(' ').toLowerCase();
106
+ result.matchedTerms = terms.filter(term => text.includes(term));
107
+ return terms.length > 0 && result.matchedTerms.length > 0;
108
+ }).sort((a, b) => b.matchedTerms.length - a.matchedTerms.length || tier(b) - tier(a)
109
+ || (b.installs.value ?? -1) - (a.installs.value ?? -1)
110
+ || Date.parse(b.cacheAsOf ?? '1970-01-01') - Date.parse(a.cacheAsOf ?? '1970-01-01')
111
+ || a.id.localeCompare(b.id));
112
+ for (const result of report.results) {
113
+ if (result.installs.value === null || result.installs.value < 100_000 || !result.repository)
114
+ continue;
115
+ const github = report.results.find(candidate => candidate.provider === 'github' && candidate.repository === result.repository);
116
+ const stars = github?.signals?.stars?.value;
117
+ if (typeof stars === 'number' && result.installs.value > Math.max(stars, 1) * 1000) {
118
+ report.warnings.push(`Implausible signal: ${result.id} has ${result.installs.value} installs vs ${stars} GitHub stars for ${result.repository}; different metrics and dates, not proof of abuse.`);
119
+ }
120
+ }
121
+ }
122
+ //# sourceMappingURL=public-search.js.map
@@ -33,4 +33,6 @@ export function getSource(source) {
33
33
  export function listRegisteredSources() {
34
34
  return Array.from(adapters.keys());
35
35
  }
36
+ // Discovery-only sources share this registry; installing them is outside search's scope.
37
+ export { publicSearchAdapters as marketplaceSearchAdapters } from './sources/public-search.js';
36
38
  //# sourceMappingURL=registry.js.map
@@ -0,0 +1,19 @@
1
+ // Validate unsigned discovery snapshots against the existing marketplace catalog owner.
2
+ import fs from 'node:fs';
3
+ import Ajv2020 from 'ajv/dist/2020.js';
4
+ import addFormats from 'ajv-formats';
5
+ let validator;
6
+ export function validateSearchSnapshot(value) {
7
+ if (!validator) {
8
+ const owner = '../../schemas/marketplace/aiwg-marketplace-catalog.v1.schema.json';
9
+ const file = [new URL(owner, import.meta.url), new URL(`../${owner}`, import.meta.url)].find(url => fs.existsSync(url));
10
+ if (!file)
11
+ throw new Error('Marketplace catalog schema is unavailable');
12
+ const schema = JSON.parse(fs.readFileSync(file, 'utf8'));
13
+ const ajv = addFormats(new Ajv2020({ strict: true, allErrors: true }));
14
+ // Only compile the discovery definition; signed entries keep their own verifier.
15
+ validator = ajv.compile({ $defs: schema.$defs, $ref: '#/$defs/searchCache' });
16
+ }
17
+ return validator(value);
18
+ }
19
+ //# sourceMappingURL=search-contract.js.map
@@ -0,0 +1,81 @@
1
+ // Normalize public discovery responses without conflating installs, stars or review tiers.
2
+ import { repositoryKey } from '../plugin-directory.js';
3
+ const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v) ? v : {};
4
+ const text = (v) => typeof v === 'string' && v.trim() ? v : null;
5
+ const count = (v) => typeof v === 'number' && Number.isSafeInteger(v) && v >= 0 ? v : null;
6
+ const date = (v) => typeof v === 'string' && Number.isFinite(Date.parse(v)) ? new Date(v).toISOString() : null;
7
+ function signal(value, source, asOf) {
8
+ return { value, source, asOf: value === null ? null : asOf };
9
+ }
10
+ function records(body, key) {
11
+ const rows = object(body)[key];
12
+ if (!Array.isArray(rows) || rows.some(row => !row || typeof row !== 'object' || Array.isArray(row))) {
13
+ throw new Error(`Unrecognized response: expected ${key} array`);
14
+ }
15
+ return rows.map(object);
16
+ }
17
+ function observation(id, name, description, repository, signals, keywords = []) {
18
+ return {
19
+ id, name, description: text(description) ?? '', repository: repositoryKey(repository), signals,
20
+ keywords: Array.isArray(keywords) ? keywords.filter((item) => typeof item === 'string') : [],
21
+ };
22
+ }
23
+ function required(value) {
24
+ const result = text(value);
25
+ if (!result)
26
+ throw new Error('Unrecognized response: missing entry identity');
27
+ return result;
28
+ }
29
+ function endpoint(base, query, parameters) {
30
+ const url = new URL(base);
31
+ for (const [key, value] of Object.entries(parameters))
32
+ url.searchParams.set(key, value);
33
+ url.searchParams.set(base.includes('modelcontextprotocol') ? 'search' : 'q', query);
34
+ return url.href;
35
+ }
36
+ function adapter(source, base, parameters, normalize) {
37
+ return { source, endpoint: query => endpoint(base, query, parameters), normalize };
38
+ }
39
+ export const publicSearchAdapters = [
40
+ adapter('mcp-registry', 'https://registry.modelcontextprotocol.io/v0.1/servers', { limit: '100' }, (body, url, asOf) => ({
41
+ observations: records(body, 'servers').map(entry => {
42
+ const server = object(entry.server);
43
+ const meta = object(object(entry._meta)['io.modelcontextprotocol.registry/official']);
44
+ const name = required(server.name);
45
+ return observation(name, name, server.description, object(server.repository).url, {
46
+ version: signal(text(server.version), url, asOf),
47
+ publishedAt: signal(date(meta.publishedAt), url, asOf),
48
+ updatedAt: signal(date(meta.updatedAt), url, asOf),
49
+ });
50
+ }),
51
+ limited: Boolean(text(object(object(body).metadata).nextCursor)),
52
+ })),
53
+ adapter('github', 'https://api.github.com/search/repositories', { per_page: '100', sort: 'stars', order: 'desc' }, (body, url, asOf) => {
54
+ const rows = records(body, 'items');
55
+ return {
56
+ observations: rows.map(entry => {
57
+ const name = required(entry.full_name);
58
+ const license = text(object(entry.license).spdx_id);
59
+ return observation(name, name, entry.description, `https://github.com/${name}`, {
60
+ stars: signal(count(entry.stargazers_count), url, asOf),
61
+ license: signal(license === 'NOASSERTION' ? null : license, url, asOf),
62
+ lastPush: signal(date(entry.pushed_at), url, asOf),
63
+ }, entry.topics);
64
+ }),
65
+ limited: object(body).incomplete_results === true || Number(object(body).total_count) > rows.length || rows.length >= 100,
66
+ };
67
+ }),
68
+ adapter('skills.sh', 'https://skills.sh/api/search', { limit: '100' }, (body, url, asOf) => {
69
+ const rows = records(body, 'skills');
70
+ return {
71
+ observations: rows.map(entry => {
72
+ const id = required(entry.id);
73
+ return observation(id, text(entry.name) ?? required(entry.skillId), entry.description, entry.source, {
74
+ installs: signal(count(entry.installs), url, asOf),
75
+ }, [entry.skillId]);
76
+ }),
77
+ limited: Number(object(body).count) > rows.length || rows.length >= 100,
78
+ };
79
+ }),
80
+ ];
81
+ //# sourceMappingURL=public-search.js.map
@@ -30,7 +30,7 @@ import {
30
30
  resolveToolFilters,
31
31
  } from './tool-filters.mjs';
32
32
  import { assertCredentialPolicy, CREDENTIAL_POLICIES, credentialReferenceInput, validateCredentialReferences, hasSecretLookingLiterals, installPolicyCheckedServer, redactCredentialArgs, redactCredentialText, redactCredentialRecord, resolveCredentialPolicy } from './credentials.mjs';
33
- import { getMcpInjectionDefinition } from '../providers/provider-definitions.mjs';
33
+ import { getMcpInjectionDefinition, normalizeRuntimeProviderId } from '../providers/provider-definitions.mjs';
34
34
  import { manageOmpMcp } from './omp-config.mjs';
35
35
  import { claudeDesktopConfigPath, resolveClaudeInstallTarget, legacyClaudeMigration } from './claude-install.mjs';
36
36
  import { unmanageGrokBuildMcp } from './grok-build-config.mjs';
@@ -367,8 +367,8 @@ enabled_tools = [
367
367
  userScope: true,
368
368
  alias: 'codex'
369
369
  },
370
- windsurf: {
371
- // Windsurf stores MCP config at ~/.codeium/windsurf/mcp_config.json
370
+ devin: {
371
+ // Devin Desktop stores MCP config at ~/.codeium/windsurf/mcp_config.json
372
372
  path: path.join(homeDir, '.codeium/windsurf/mcp_config.json'),
373
373
  userScope: true,
374
374
  content: {
@@ -1027,13 +1027,13 @@ async function handleInject(args) {
1027
1027
 
1028
1028
  let providers;
1029
1029
  if (injectAll) {
1030
- providers = await registry.getInjectedProviders();
1030
+ providers = [...new Set((await registry.getInjectedProviders()).map(p => normalizeRuntimeProviderId(p) === 'devin' ? 'devin' : p))];
1031
1031
  if (providers.length === 0) {
1032
1032
  console.error('No providers have been injected before. Use --provider <name> first.');
1033
1033
  process.exit(1);
1034
1034
  }
1035
1035
  } else {
1036
- const normalized = provider === 'claude' ? 'claude-code' : provider;
1036
+ const normalized = normalizeRuntimeProviderId(provider) === 'devin' ? 'devin' : provider === 'claude' ? 'claude-code' : provider;
1037
1037
  if (!getMcpInjectionDefinition(normalized)) {
1038
1038
  console.error(`Unknown provider: ${provider}`);
1039
1039
  console.error(`Supported providers: ${SUPPORTED_PROVIDERS.join(', ')}`);
@@ -1667,7 +1667,8 @@ export async function main(args = process.argv.slice(2)) {
1667
1667
  if (!['project', 'user'].includes(scope)) throw new Error('Scope must be project or user');
1668
1668
  const installArgs = args.slice(1).filter((a, index, rest) => !a.startsWith('--') && !['--scope', '--project'].includes(rest[index - 1]));
1669
1669
  const requestedTarget = installArgs[0] || 'claude';
1670
- const target = resolveClaudeInstallTarget(requestedTarget, scope);
1670
+ const target = normalizeRuntimeProviderId(requestedTarget) === 'devin'
1671
+ ? 'devin' : resolveClaudeInstallTarget(requestedTarget, scope);
1671
1672
  if (requestedTarget === 'claude') {
1672
1673
  console.warn(`Deprecated MCP install target "claude" selected ${target}; use "aiwg mcp install ${target}" explicitly.`);
1673
1674
  }
@@ -1692,7 +1693,7 @@ export async function main(args = process.argv.slice(2)) {
1692
1693
  opencode: (projectDir === '.' || projectDir === 'global')
1693
1694
  ? 'opencode.json'
1694
1695
  : path.join(projectDir, 'opencode.json'),
1695
- windsurf: path.join(homeDir, '.codeium/windsurf/mcp_config.json'),
1696
+ devin: path.join(homeDir, '.codeium/windsurf/mcp_config.json'),
1696
1697
  warp: '(UI-based — Settings > AI > MCP Servers)'
1697
1698
  };
1698
1699
  console.log(`[DRY RUN] Config file: ${configPaths[target] || 'unknown'}`);
@@ -30,7 +30,7 @@ export const ENV_REFERENCE_SYNTAX = Object.freeze({
30
30
  'claude-code': '${NAME}',
31
31
  claude: '${NAME}',
32
32
  cursor: '${env:NAME}',
33
- windsurf: '${env:NAME}',
33
+ devin: '${env:NAME}',
34
34
  factory: '${NAME}',
35
35
  opencode: '{env:NAME}',
36
36
  omp: '${NAME}',