agents-inc 0.167.0 → 0.168.0

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 (134) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/{chunk-TZ2YJJKK.js → chunk-23DNVNFP.js} +5 -5
  3. package/dist/{chunk-ZXKBERQU.js → chunk-27AVGFXH.js} +2 -2
  4. package/dist/{chunk-SXVHSOTH.js → chunk-3DIDV6H3.js} +4 -4
  5. package/dist/{chunk-GE3WKJ6Q.js → chunk-3LZNY46H.js} +4 -4
  6. package/dist/{chunk-Y47EV74W.js → chunk-4DRFEYCE.js} +10 -13
  7. package/dist/chunk-4DRFEYCE.js.map +1 -0
  8. package/dist/{chunk-MPTNC32T.js → chunk-4HWOYYY7.js} +3 -3
  9. package/dist/{chunk-MAWNVT2C.js → chunk-4UKMQUAU.js} +4 -4
  10. package/dist/{chunk-G6UREQ4V.js → chunk-5JUQKGCP.js} +9 -9
  11. package/dist/{chunk-T6UWJAB3.js → chunk-6WGXTB2L.js} +2 -2
  12. package/dist/{chunk-SAYZWCH6.js → chunk-7PYXS2QU.js} +2 -2
  13. package/dist/{chunk-ENGYJCTF.js → chunk-AG3ZVM3B.js} +35 -45
  14. package/dist/{chunk-ENGYJCTF.js.map → chunk-AG3ZVM3B.js.map} +1 -1
  15. package/dist/{chunk-A4KDXNOT.js → chunk-C2UISKIM.js} +66 -104
  16. package/dist/chunk-C2UISKIM.js.map +1 -0
  17. package/dist/{chunk-RZDXDMT6.js → chunk-CMJBKQUH.js} +2 -2
  18. package/dist/{chunk-XZEVWPX6.js → chunk-DJEO3F2H.js} +7 -7
  19. package/dist/{chunk-V3I7VQ7N.js → chunk-EH2PGPLP.js} +5 -5
  20. package/dist/chunk-EH2PGPLP.js.map +1 -0
  21. package/dist/{chunk-PMJWD27C.js → chunk-GE7NUPMI.js} +3 -3
  22. package/dist/{chunk-PNB3524H.js → chunk-GRL73YPF.js} +5 -5
  23. package/dist/{chunk-Y3VIRVVE.js → chunk-H4ZKGGTE.js} +6 -6
  24. package/dist/{chunk-LFWLEDUG.js → chunk-HI6YB7XP.js} +6 -6
  25. package/dist/{chunk-SCOQ34YM.js → chunk-HL3GYRMR.js} +2 -2
  26. package/dist/{chunk-NBXXFIIW.js → chunk-HR7TK2XW.js} +3 -3
  27. package/dist/{chunk-ZR4YPKXQ.js → chunk-JIBCVXXL.js} +4 -4
  28. package/dist/{chunk-JQRJQ4SS.js → chunk-JPMV4E4E.js} +3 -3
  29. package/dist/{chunk-4NDBUJHK.js → chunk-JVUN6AOO.js} +8 -8
  30. package/dist/{chunk-RAHSOJQ2.js → chunk-KQ3PDARZ.js} +2 -2
  31. package/dist/{chunk-PXWG7KFO.js → chunk-KTLKR4YY.js} +2 -2
  32. package/dist/{chunk-6L75SQZU.js → chunk-L3W2JWBA.js} +2 -2
  33. package/dist/{chunk-TTY6DPJN.js → chunk-LFUJCRCT.js} +3 -3
  34. package/dist/{chunk-V5WXIM2F.js → chunk-NU2K5G54.js} +2 -2
  35. package/dist/{chunk-G4JK7WVO.js → chunk-P6I72PR3.js} +15 -15
  36. package/dist/{chunk-WWIFNPJG.js → chunk-PCFUXQJA.js} +12 -12
  37. package/dist/{chunk-DAIEQJIF.js → chunk-PLX2FLEQ.js} +3 -3
  38. package/dist/{chunk-2VUYFTUB.js → chunk-QWFG7Y3R.js} +6 -6
  39. package/dist/{chunk-WVUDLKIO.js → chunk-SLBL3WIP.js} +2 -2
  40. package/dist/{chunk-HWEKHVLE.js → chunk-TW35AEB4.js} +6 -6
  41. package/dist/{chunk-VAPTVR3J.js → chunk-VVRI35SK.js} +3 -3
  42. package/dist/{chunk-6LF4CQBY.js → chunk-W5KEYSOL.js} +2 -2
  43. package/dist/{chunk-TODCQFRB.js → chunk-W6GO2CYX.js} +2 -2
  44. package/dist/{chunk-7JNJ52CD.js → chunk-WNLF5EDZ.js} +7 -16
  45. package/dist/chunk-WNLF5EDZ.js.map +1 -0
  46. package/dist/{chunk-HHIYT3PI.js → chunk-X6ZZEYO3.js} +4 -4
  47. package/dist/{chunk-QHDPLLK6.js → chunk-YN3SWF53.js} +3 -3
  48. package/dist/{chunk-25MPBIK3.js → chunk-ZUGH4MQG.js} +3 -3
  49. package/dist/commands/build/marketplace.js +6 -6
  50. package/dist/commands/build/plugins.js +8 -8
  51. package/dist/commands/compile.js +14 -14
  52. package/dist/commands/doctor.js +13 -13
  53. package/dist/commands/edit.js +71 -242
  54. package/dist/commands/edit.js.map +1 -1
  55. package/dist/commands/eject.js +12 -12
  56. package/dist/commands/init.js +39 -39
  57. package/dist/commands/list.js +9 -9
  58. package/dist/commands/new/marketplace.js +6 -6
  59. package/dist/commands/search.js +11 -11
  60. package/dist/commands/share.js +11 -11
  61. package/dist/commands/uninstall.js +13 -13
  62. package/dist/commands/update.js +8 -8
  63. package/dist/components/common/removal-plan-confirm.js +2 -2
  64. package/dist/components/common/select-list.js +2 -2
  65. package/dist/components/wizard/category-grid.js +4 -4
  66. package/dist/components/wizard/checkbox-grid.js +4 -4
  67. package/dist/components/wizard/domain-selection.js +9 -9
  68. package/dist/components/wizard/run-wizard-session.js +26 -26
  69. package/dist/components/wizard/scroll-affordance.js +2 -2
  70. package/dist/components/wizard/skill-agent-summary.js +5 -5
  71. package/dist/components/wizard/source-grid.js +5 -5
  72. package/dist/components/wizard/stack-selection.js +7 -7
  73. package/dist/components/wizard/step-agents.js +8 -8
  74. package/dist/components/wizard/step-build.js +7 -7
  75. package/dist/components/wizard/step-confirm.js +9 -9
  76. package/dist/components/wizard/step-sources.js +8 -8
  77. package/dist/components/wizard/step-stack.js +8 -8
  78. package/dist/components/wizard/summary-panel.js +8 -8
  79. package/dist/components/wizard/toast.js +2 -2
  80. package/dist/components/wizard/wizard-layout.js +12 -12
  81. package/dist/components/wizard/wizard-tabs.js +2 -2
  82. package/dist/components/wizard/wizard.js +25 -25
  83. package/dist/hooks/init.js +39 -39
  84. package/dist/load-agent-defs-5XMVB3MU.js +14 -0
  85. package/dist/recompile-project-agents-7PQWYQ6B.js +18 -0
  86. package/dist/{source-loader-7KZ3MD5O.js → source-loader-FRJTCSDL.js} +4 -4
  87. package/dist/stores/wizard-store.js +4 -4
  88. package/package.json +5 -2
  89. package/dist/chunk-7JNJ52CD.js.map +0 -1
  90. package/dist/chunk-A4KDXNOT.js.map +0 -1
  91. package/dist/chunk-V3I7VQ7N.js.map +0 -1
  92. package/dist/chunk-Y47EV74W.js.map +0 -1
  93. package/dist/load-agent-defs-3C27ENC7.js +0 -14
  94. package/dist/recompile-project-agents-DGNBCU3N.js +0 -18
  95. /package/dist/{chunk-TZ2YJJKK.js.map → chunk-23DNVNFP.js.map} +0 -0
  96. /package/dist/{chunk-ZXKBERQU.js.map → chunk-27AVGFXH.js.map} +0 -0
  97. /package/dist/{chunk-SXVHSOTH.js.map → chunk-3DIDV6H3.js.map} +0 -0
  98. /package/dist/{chunk-GE3WKJ6Q.js.map → chunk-3LZNY46H.js.map} +0 -0
  99. /package/dist/{chunk-MPTNC32T.js.map → chunk-4HWOYYY7.js.map} +0 -0
  100. /package/dist/{chunk-MAWNVT2C.js.map → chunk-4UKMQUAU.js.map} +0 -0
  101. /package/dist/{chunk-G6UREQ4V.js.map → chunk-5JUQKGCP.js.map} +0 -0
  102. /package/dist/{chunk-T6UWJAB3.js.map → chunk-6WGXTB2L.js.map} +0 -0
  103. /package/dist/{chunk-SAYZWCH6.js.map → chunk-7PYXS2QU.js.map} +0 -0
  104. /package/dist/{chunk-RZDXDMT6.js.map → chunk-CMJBKQUH.js.map} +0 -0
  105. /package/dist/{chunk-XZEVWPX6.js.map → chunk-DJEO3F2H.js.map} +0 -0
  106. /package/dist/{chunk-PMJWD27C.js.map → chunk-GE7NUPMI.js.map} +0 -0
  107. /package/dist/{chunk-PNB3524H.js.map → chunk-GRL73YPF.js.map} +0 -0
  108. /package/dist/{chunk-Y3VIRVVE.js.map → chunk-H4ZKGGTE.js.map} +0 -0
  109. /package/dist/{chunk-LFWLEDUG.js.map → chunk-HI6YB7XP.js.map} +0 -0
  110. /package/dist/{chunk-SCOQ34YM.js.map → chunk-HL3GYRMR.js.map} +0 -0
  111. /package/dist/{chunk-NBXXFIIW.js.map → chunk-HR7TK2XW.js.map} +0 -0
  112. /package/dist/{chunk-ZR4YPKXQ.js.map → chunk-JIBCVXXL.js.map} +0 -0
  113. /package/dist/{chunk-JQRJQ4SS.js.map → chunk-JPMV4E4E.js.map} +0 -0
  114. /package/dist/{chunk-4NDBUJHK.js.map → chunk-JVUN6AOO.js.map} +0 -0
  115. /package/dist/{chunk-RAHSOJQ2.js.map → chunk-KQ3PDARZ.js.map} +0 -0
  116. /package/dist/{chunk-PXWG7KFO.js.map → chunk-KTLKR4YY.js.map} +0 -0
  117. /package/dist/{chunk-6L75SQZU.js.map → chunk-L3W2JWBA.js.map} +0 -0
  118. /package/dist/{chunk-TTY6DPJN.js.map → chunk-LFUJCRCT.js.map} +0 -0
  119. /package/dist/{chunk-V5WXIM2F.js.map → chunk-NU2K5G54.js.map} +0 -0
  120. /package/dist/{chunk-G4JK7WVO.js.map → chunk-P6I72PR3.js.map} +0 -0
  121. /package/dist/{chunk-WWIFNPJG.js.map → chunk-PCFUXQJA.js.map} +0 -0
  122. /package/dist/{chunk-DAIEQJIF.js.map → chunk-PLX2FLEQ.js.map} +0 -0
  123. /package/dist/{chunk-2VUYFTUB.js.map → chunk-QWFG7Y3R.js.map} +0 -0
  124. /package/dist/{chunk-WVUDLKIO.js.map → chunk-SLBL3WIP.js.map} +0 -0
  125. /package/dist/{chunk-HWEKHVLE.js.map → chunk-TW35AEB4.js.map} +0 -0
  126. /package/dist/{chunk-VAPTVR3J.js.map → chunk-VVRI35SK.js.map} +0 -0
  127. /package/dist/{chunk-6LF4CQBY.js.map → chunk-W5KEYSOL.js.map} +0 -0
  128. /package/dist/{chunk-TODCQFRB.js.map → chunk-W6GO2CYX.js.map} +0 -0
  129. /package/dist/{chunk-HHIYT3PI.js.map → chunk-X6ZZEYO3.js.map} +0 -0
  130. /package/dist/{chunk-QHDPLLK6.js.map → chunk-YN3SWF53.js.map} +0 -0
  131. /package/dist/{chunk-25MPBIK3.js.map → chunk-ZUGH4MQG.js.map} +0 -0
  132. /package/dist/{load-agent-defs-3C27ENC7.js.map → load-agent-defs-5XMVB3MU.js.map} +0 -0
  133. /package/dist/{recompile-project-agents-DGNBCU3N.js.map → recompile-project-agents-7PQWYQ6B.js.map} +0 -0
  134. /package/dist/{source-loader-7KZ3MD5O.js.map → source-loader-FRJTCSDL.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ Each release has detailed notes in its own file under [`changelogs/`](./changelo
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
8
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
+ ## [0.168.0] - 2026-10-14
11
+
12
+ **A sub-agent can pin a Codex model, share links are version 6 only, and the editor takes the v6 design with named saves**
13
+
14
+ - EDITOR-09: `config.ts` takes a per-agent `codexModel` (`gpt-6-astra`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`). A Codex role file writes it as `model` with `model_reasoning_effort`, Claude ignores it, and `init --from`, `edit` and `share` carry it. Seeds are version 6 only, so v5 links and saves must be re-shared. The editor is on the v6 design: providers first, sub-agent cards, filters in the search field, and named saves that must be unique.
15
+ - EDITOR-95: a save made signed out whose name the account already has opens the Save dialog at sign-in, saying names must be unique.
16
+ - The compile package's warnings reach the terminal again; since 0.161.0 the bundle had dropped the import that wires them.
17
+
18
+ See [changelogs/0.168.0.md](./changelogs/0.168.0.md) for full details.
19
+
10
20
  ## [0.167.0] - 2026-10-04
11
21
 
12
22
  **`.claude-src/` is retired: nothing reads or writes it, and a run that finds it says to move it**
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ScrollAffordance
4
- } from "./chunk-SAYZWCH6.js";
4
+ } from "./chunk-7PYXS2QU.js";
5
5
  import {
6
6
  useFocusedListItem
7
7
  } from "./chunk-XQHZPINL.js";
@@ -10,15 +10,15 @@ import {
10
10
  } from "./chunk-WTJ3AY33.js";
11
11
  import {
12
12
  useSectionScroll
13
- } from "./chunk-WVUDLKIO.js";
13
+ } from "./chunk-SLBL3WIP.js";
14
14
  import {
15
15
  getSkillById
16
- } from "./chunk-V5WXIM2F.js";
16
+ } from "./chunk-NU2K5G54.js";
17
17
  import {
18
18
  CLI_COLORS,
19
19
  INSTALL_MODE_CELL_LABELS,
20
20
  UI_SYMBOLS
21
- } from "./chunk-ENGYJCTF.js";
21
+ } from "./chunk-AG3ZVM3B.js";
22
22
 
23
23
  // src/cli/components/wizard/source-grid.tsx
24
24
  import { useCallback, useMemo } from "react";
@@ -289,4 +289,4 @@ export {
289
289
  isRowInert,
290
290
  SourceGrid
291
291
  };
292
- //# sourceMappingURL=chunk-TZ2YJJKK.js.map
292
+ //# sourceMappingURL=chunk-23DNVNFP.js.map
@@ -13,7 +13,7 @@ import {
13
13
  readFileOptional,
14
14
  unexpressibleOnCodexMessage,
15
15
  writeFile
16
- } from "./chunk-A4KDXNOT.js";
16
+ } from "./chunk-C2UISKIM.js";
17
17
 
18
18
  // src/cli/lib/hosts/claude-project-trust.ts
19
19
  import path from "path";
@@ -247,4 +247,4 @@ async function hostCompileNotices(provider, projectDir) {
247
247
  export {
248
248
  hostCompileNotices
249
249
  };
250
- //# sourceMappingURL=chunk-ZXKBERQU.js.map
250
+ //# sourceMappingURL=chunk-27AVGFXH.js.map
@@ -9,13 +9,13 @@ import {
9
9
  } from "./chunk-WTJ3AY33.js";
10
10
  import {
11
11
  useSectionScroll
12
- } from "./chunk-WVUDLKIO.js";
12
+ } from "./chunk-SLBL3WIP.js";
13
13
  import {
14
14
  getSkillById
15
- } from "./chunk-V5WXIM2F.js";
15
+ } from "./chunk-NU2K5G54.js";
16
16
  import {
17
17
  CLI_COLORS
18
- } from "./chunk-ENGYJCTF.js";
18
+ } from "./chunk-AG3ZVM3B.js";
19
19
 
20
20
  // src/cli/components/wizard/category-grid.tsx
21
21
  import { useCallback as useCallback2, useEffect as useEffect2 } from "react";
@@ -265,4 +265,4 @@ var CategoryGrid = ({
265
265
  export {
266
266
  CategoryGrid
267
267
  };
268
- //# sourceMappingURL=chunk-SXVHSOTH.js.map
268
+ //# sourceMappingURL=chunk-3DIDV6H3.js.map
@@ -29,12 +29,12 @@ import {
29
29
  sourceFolderName,
30
30
  verbose,
31
31
  writeFile
32
- } from "./chunk-A4KDXNOT.js";
32
+ } from "./chunk-C2UISKIM.js";
33
33
  import {
34
34
  typedEntries,
35
35
  typedFromEntries,
36
36
  typedKeys
37
- } from "./chunk-V5WXIM2F.js";
37
+ } from "./chunk-NU2K5G54.js";
38
38
  import {
39
39
  CLAUDE_DIR,
40
40
  DIRS,
@@ -42,7 +42,7 @@ import {
42
42
  STANDARD_DIRS,
43
43
  STANDARD_FILES,
44
44
  effectivelyExcludedSkillIds
45
- } from "./chunk-ENGYJCTF.js";
45
+ } from "./chunk-AG3ZVM3B.js";
46
46
 
47
47
  // src/cli/lib/agents/list-compiled-agents.ts
48
48
  import path from "path";
@@ -372,4 +372,4 @@ export {
372
372
  withoutExcludedAssignments,
373
373
  recompileAgents
374
374
  };
375
- //# sourceMappingURL=chunk-GE3WKJ6Q.js.map
375
+ //# sourceMappingURL=chunk-3LZNY46H.js.map
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  SEED_API_URL,
4
4
  SEED_USER_AGENT
5
- } from "./chunk-25MPBIK3.js";
5
+ } from "./chunk-ZUGH4MQG.js";
6
6
  import {
7
7
  withoutExcludedAssignments
8
- } from "./chunk-GE3WKJ6Q.js";
8
+ } from "./chunk-3LZNY46H.js";
9
9
  import {
10
10
  readCarriedSkills
11
- } from "./chunk-Y3VIRVVE.js";
11
+ } from "./chunk-H4ZKGGTE.js";
12
12
  import {
13
13
  ERROR_MESSAGES,
14
14
  directoryExists,
@@ -20,11 +20,11 @@ import {
20
20
  readForkedFromMetadata,
21
21
  resolveInstallPaths,
22
22
  truncateText
23
- } from "./chunk-A4KDXNOT.js";
23
+ } from "./chunk-C2UISKIM.js";
24
24
  import {
25
25
  typedEntries,
26
26
  typedValues
27
- } from "./chunk-V5WXIM2F.js";
27
+ } from "./chunk-NU2K5G54.js";
28
28
  import {
29
29
  CLI_INVOKE_COMMAND,
30
30
  DEFAULT_PUBLIC_SOURCE_NAME,
@@ -35,7 +35,7 @@ import {
35
35
  activeSkillScopeMap,
36
36
  installableSeedPayloadSchema,
37
37
  seedModelSchema
38
- } from "./chunk-ENGYJCTF.js";
38
+ } from "./chunk-AG3ZVM3B.js";
39
39
 
40
40
  // src/cli/lib/seed/installation-payload.ts
41
41
  import os from "os";
@@ -116,8 +116,7 @@ function readStack(stack, skillScopes, agentScopes) {
116
116
  }
117
117
  function toSeedSkill(skill, assignments) {
118
118
  return {
119
- // "eject" is the project's own copy; anything else is a plugin the marketplace serves, and
120
- // which marketplace that is has already had to be one the envelope's ref accounts for.
119
+ // A plugin's marketplace has already been checked against the envelope's ref.
121
120
  install: skill.origin === EJECT_SOURCE ? "eject" : "plugin",
122
121
  scope: skill.scope,
123
122
  assignments: assignments ?? {}
@@ -128,6 +127,7 @@ function toSeedAgent(agent) {
128
127
  on: true,
129
128
  scope: agent.scope,
130
129
  ...agent.model !== void 0 && isSeedModel(agent.model) && { model: agent.model },
130
+ ...agent.codexModel !== void 0 && { codexModel: agent.codexModel },
131
131
  ...agent.effort !== void 0 && { effort: agent.effort }
132
132
  };
133
133
  }
@@ -149,15 +149,12 @@ function configToSeedPayload(config, carried, inheritedFrom) {
149
149
  v: SEED_VERSION,
150
150
  matrixVersion: MATRIX_VERSION,
151
151
  stackId: null,
152
- // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its
153
- // body, so a key meaning what its absence already means would remint every ordinary payload.
152
+ // Absent rather than empty: an id is the hash of its body.
154
153
  ...config.description !== void 0 && { description: config.description },
155
154
  ...marketplace.ref !== void 0 && { marketplace: marketplace.ref },
156
155
  skills: Object.fromEntries(
157
156
  skills.map((skill) => [skill.id, toSeedSkill(skill, assignments.get(skill.id))])
158
157
  ),
159
- // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its
160
- // body, so a key meaning what its absence already means would remint every ordinary payload.
161
158
  ...Object.keys(carried.external).length > 0 && { external: carried.external },
162
159
  agents: Object.fromEntries(agents.map((agent) => [agent.name, toSeedAgent(agent)]))
163
160
  });
@@ -349,4 +346,4 @@ export {
349
346
  skillsAuthoredHere,
350
347
  publishSeedConfig
351
348
  };
352
- //# sourceMappingURL=chunk-Y47EV74W.js.map
349
+ //# sourceMappingURL=chunk-4DRFEYCE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/seed/installation-payload.ts","../src/cli/lib/seed/config-to-seed.ts","../src/cli/lib/seed/publish-seed.ts"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\n\nimport {\n configToSeedPayload,\n isInstalled,\n skillsItsMarketplaceLeavesBehind,\n} from \"./config-to-seed.js\";\nimport { readCarriedSkills } from \"./external-skills.js\";\nimport { EJECT_SOURCE } from \"../../consts.js\";\nimport { withoutExcludedAssignments } from \"../agents/agent-recompiler.js\";\nimport { loadProjectConfig, loadProjectConfigFromDir } from \"../configuration/project-config.js\";\nimport { activeAgentScopeMap, activeSkillScopeMap } from \"../configuration/scope-predicates.js\";\nimport { getProjectConfigPath, resolveInstallPaths } from \"../installation/install-base-dir.js\";\nimport { readForkedFromMetadata } from \"../skills/skill-metadata.js\";\nimport { getErrorMessage } from \"../../utils/errors.js\";\nimport { directoryExists } from \"../../utils/fs.js\";\nimport { ERROR_MESSAGES } from \"../../utils/messages.js\";\nimport { typedEntries } from \"../../utils/typed-object.js\";\n\nimport type { ContentReading, OwnedSkillDir } from \"./external-skills.js\";\nimport type { LoadedProjectConfig } from \"../configuration/project-config.js\";\nimport type { AgentScopeConfig, ProjectConfig, SkillConfig, SkillId } from \"../../types/index.js\";\nimport type { SeedPayload } from \"@workspace/matrix/seed\";\n\n/**\n * A payload ready to post, and what it will install — counted the way the sharer's own screens\n * count it, off the payload rather than off the config, so what a caller announces and what it\n * posts cannot disagree.\n *\n * `leftBehind` names the skills the payload carries that the one marketplace it names does not\n * serve: they travel, and an install anywhere else skips them. Empty for an installation read\n * from a single marketplace.\n */\nexport type InstallationPayload =\n | { ok: true; payload: SeedPayload; skills: number; agents: number; leftBehind: SkillId[] }\n | { ok: false; error: string };\n\n/**\n * The config to map, or the sentence explaining why there is none to map.\n *\n * `inheritedFrom` is the global configuration a project's own config inherits from, and absent\n * when the config read is the global one already.\n */\ntype InstalledConfig =\n | { ok: true; config: ProjectConfig; inheritedFrom: ProjectConfig | undefined }\n | { ok: false; error: string };\n\n/** The mapped payload, or every line naming something the contract cannot carry. */\ntype MappedPayload = { ok: true; payload: SeedPayload } | { ok: false; error: string };\n\n/** The installation as the round trip sees it: what it owns, and what it has to carry with it. */\ntype RoundTrip = { config: ProjectConfig; content: ContentReading };\n\n/**\n * What the round trip makes of one installed entry: whether it travels at all, and whether its\n * bytes travel with it.\n */\ntype SkillJudgement = { skill: SkillConfig; owned: boolean; carried: OwnedSkillDir | null };\n\n/**\n * Read, map, refuse — everything that can fail locally, failing before anybody spends a write.\n *\n * Shared by the two commands that mint an id for what is installed here: `share`, which reports\n * the id, and `edit --ui`, which opens it. They are one operation with two endings, and this is\n * the half that has to be identical — two spellings of \"the installation in this directory\"\n * would mint two different ids for one project, and only one of them would be true.\n *\n * Every failure is a message rather than a throw, because nothing has been written by the time\n * it runs: the caller's only job is to explain, and both callers explain the same way.\n */\nexport async function seedPayloadForInstallation(projectDir: string): Promise<InstallationPayload> {\n const installed = await readInstalledConfig(projectDir);\n if (!installed.ok) return installed;\n\n const roundTrip = await readRoundTrip(installed.config, projectDir);\n const mapped = mapOrRefuse(roundTrip, installed.inheritedFrom);\n if (!mapped.ok) return mapped;\n\n const { payload } = mapped;\n const skills = Object.keys(payload.skills).length;\n const agents = Object.keys(payload.agents).length;\n\n // The same guard `init --from` applies on arrival, applied here before the write instead of\n // there after it. A sub-agent is installable on its own — it has front-matter, a prompt and a\n // compiled file without owning a single skill — so only a configuration with neither skills\n // nor sub-agents is nothing to carry.\n if (skills === 0 && agents === 0) return { ok: false, error: ERROR_MESSAGES.NO_INSTALLATION };\n\n const leftBehind = skillsItsMarketplaceLeavesBehind(roundTrip.config, payload);\n return { ok: true, payload, skills, agents, leftBehind };\n}\n\n/**\n * The installation this directory has: its own configuration, or the global one it inherits.\n *\n * That is the config every other command reads here, and its skills and sub-agents are those of\n * BOTH scopes with each entry's own scope on it — which is exactly what the wire keys by. Its\n * `stack` is not: see {@link withInheritedCuration}, which is what makes a payload minted from a\n * project describe the whole of what is installed for it rather than half of it.\n *\n * A config file that exists but cannot be loaded is a fault, not an absence, so its own message\n * is reported rather than read as \"not installed\" — HOME's included, because minting without\n * the rows it holds would mint the thinner configuration this module refuses to.\n */\nasync function readInstalledConfig(projectDir: string): Promise<InstalledConfig> {\n try {\n const loaded = await loadProjectConfig(projectDir);\n if (!loaded) return { ok: false, error: ERROR_MESSAGES.NO_INSTALLATION };\n const inheritedFrom = await readInheritedConfig(loaded);\n return { ok: true, config: withInheritedCuration(loaded.config, inheritedFrom), inheritedFrom };\n } catch (error) {\n return { ok: false, error: getErrorMessage(error) };\n }\n}\n\n/**\n * The global configuration a project's own config inherits from — the SAME provider's, since each\n * provider inherits only within itself. None when the config read is the global one already.\n */\nasync function readInheritedConfig(\n loaded: LoadedProjectConfig,\n): Promise<ProjectConfig | undefined> {\n if (isGlobalConfig(loaded)) return undefined;\n\n const home = await loadProjectConfigFromDir(os.homedir(), loaded.provider);\n return home?.config;\n}\n\n/** Whether the config read is the global one: at `$HOME`, or in a directory without its own. */\nfunction isGlobalConfig(loaded: LoadedProjectConfig): boolean {\n return loaded.configPath === getProjectConfigPath(os.homedir(), loaded.provider);\n}\n\n/**\n * The project's configuration with the rows of the sub-agents it inherits, read from the file that\n * compiles them.\n *\n * A project's file inlines the global skills and sub-agents but keeps rows for its own sub-agents\n * only: a global sub-agent is compiled from the global config, so its row is written there alone\n * (`partitionInlinedConfigEntries` in `@workspace/compile`). Read by itself, the project file hands\n * every inherited sub-agent to the mapping with no row, and the id it mints installs them bare.\n *\n * The global config's row for an inherited sub-agent wins over one the project file holds, which\n * only a hand edit puts there: the global config is the one that compiles that sub-agent.\n */\nfunction withInheritedCuration(\n config: ProjectConfig,\n inheritedFrom: ProjectConfig | undefined,\n): ProjectConfig {\n if (inheritedFrom?.stack === undefined) return config;\n\n return { ...config, stack: { ...config.stack, ...inheritedRows(config, inheritedFrom.stack) } };\n}\n\n/**\n * The global config's rows for the sub-agents this project inherits, each narrowed to the skills\n * it inherits too — read through the scopes the mapping itself reads, so no row taken here can\n * land on a sub-agent or skill the payload carries at project scope.\n *\n * A sub-agent or skill the project masks with a half of its own is the project's here, and the\n * global row naming it describes an install this project does not use: on the project's own\n * sub-agent it would hand over another agent's load, and on a project skill it would ask a global\n * sub-agent for a pair the wire cannot carry, refusing a share that never named it.\n */\nfunction inheritedRows(\n config: ProjectConfig,\n globalStack: NonNullable<ProjectConfig[\"stack\"]>,\n): NonNullable<ProjectConfig[\"stack\"]> {\n const agents = inheritedAgents(config.agents);\n const rows = Object.fromEntries(typedEntries(globalStack).filter(([agent]) => agents.has(agent)));\n return withoutExcludedAssignments(rows, skillsNotInherited(config.skills));\n}\n\n/** The sub-agents this project takes from the global config: those resting at global scope here. */\nfunction inheritedAgents(agents: AgentScopeConfig[]): Set<string> {\n const scopes = activeAgentScopeMap(agents);\n return new Set(agents.map((agent) => agent.name).filter((name) => scopes.get(name) === \"global\"));\n}\n\n/**\n * The skills this project names but does not take from the global config: its own, and the global\n * installs it masks.\n */\nfunction skillsNotInherited(skills: SkillConfig[]): Set<SkillId> {\n const scopes = activeSkillScopeMap(skills);\n return new Set(skills.map((skill) => skill.id).filter((id) => scopes.get(id) !== \"global\"));\n}\n\n/**\n * The installation minus what the round trip does not own, plus the content it has to take along.\n *\n * `forkedFrom` decides ownership, and the round trip leaves what it does not own alone. The CLI\n * stamps that key into every skill directory it writes — an ejected catalogue skill, and a skill\n * a payload carried inline — while a skill the user wrote by hand into `.claude/skills/` carries\n * none. So absence of the key is not the whole answer and provenance is: what the CLI put there\n * says so on disk, and what a person put there says nothing because nothing forked it.\n *\n * A user-authored skill is therefore neither carried nor refused — it is simply outside the\n * round trip, and nothing about leaving it home is lossy because it was never in scope. Dropping\n * it here rather than in a command is what keeps `share` and `edit --ui`, which mint an id from\n * the same directory, from disagreeing about a single project.\n *\n * The stack rows naming a dropped skill go with it: `configToSeedPayload` keys assignments by\n * the skills it carries, so a row whose skill is gone is gone too.\n *\n * One walk answers both questions, because they are asked of the same file: whether the CLI put\n * this directory here, and — for the one kind of skill no catalogue can resolve — where its bytes\n * came from, so they can travel a second time.\n */\nasync function readRoundTrip(config: ProjectConfig, projectDir: string): Promise<RoundTrip> {\n const owned = (await judgeSkills(config, projectDir)).filter((entry) => entry.owned);\n\n return {\n config: { ...config, skills: owned.map((entry) => entry.skill) },\n content: await readCarriedSkills(owned.flatMap((entry) => entry.carried ?? [])),\n };\n}\n\n/** Every installed entry, judged. One walk of the disk, whichever half of the trip is asking. */\nfunction judgeSkills(config: ProjectConfig, projectDir: string): Promise<SkillJudgement[]> {\n return Promise.all(config.skills.map((skill) => judgeSkill(skill, projectDir)));\n}\n\n/**\n * The installed skills the round trip does NOT own — the user's own work, sitting in\n * `.claude/skills/` with no `forkedFrom` to say the CLI put it there.\n *\n * The producer already drops these on the way out, so no payload minted here ever named one.\n * This is the same judgement read by the other half: `edit --from` applies a payload\n * destructively, and a payload that made no statement about a skill cannot be read as an\n * instruction to delete it. Both halves ask {@link judgeSkill}, so \"outside the round trip\" has\n * one definition and cannot come to mean two things on one machine.\n */\nexport async function skillsAuthoredHere(\n config: ProjectConfig,\n projectDir: string,\n): Promise<Set<SkillId>> {\n const judged = await judgeSkills(config, projectDir);\n return new Set(judged.filter((entry) => !entry.owned).map((entry) => entry.skill.id));\n}\n\n/** The entry travels and no directory is read for it: a row naming an id is the whole of it. */\nfunction travelsAsAnId(skill: SkillConfig): SkillJudgement {\n return { skill, owned: true, carried: null };\n}\n\n/**\n * How one installed entry answers to the round trip — asked of the disk, offline, exactly as\n * `uninstall` asks it before removing anything.\n *\n * Only a directory that EXISTS and carries no provenance is somebody's own work, and that is the\n * one thing this excludes; each guard below says why the case above it never gets that far.\n */\nasync function judgeSkill(skill: SkillConfig, projectDir: string): Promise<SkillJudgement> {\n // A marketplace skill has no local directory to hold provenance and needs none: the marketplace\n // is what installs it again.\n if (skill.origin !== EJECT_SOURCE) return travelsAsAnId(skill);\n // A tombstone is a statement about something that is NOT installed here, so there are no bytes\n // of it to carry — and a refusal raised over them would refuse a share for a skill it is not\n // sharing.\n if (!isInstalled(skill)) return travelsAsAnId(skill);\n\n const skillsDir = resolveInstallPaths(projectDir, skill.scope).skillsDir;\n const skillDir = path.join(skillsDir, skill.id);\n // A configuration recording an install that is not there is evidence of nothing rather than\n // evidence of authorship, so it travels as the configuration records it.\n if (!(await directoryExists(skillDir))) return travelsAsAnId(skill);\n\n const provenance = await readForkedFromMetadata(skillDir);\n if (provenance === null) return { skill, owned: false, carried: null };\n\n return { skill, owned: true, carried: { id: skill.id, skillDir, provenance } };\n}\n\n/**\n * The mapping, with its refusals turned into this module's own currency.\n *\n * `configToSeedPayload` throws, and what it throws is a list: every line names something this\n * installation has that a shared configuration cannot say. That is a message for the user, not a\n * fault to propagate — the alternative is worse than a failed command, because a payload quietly\n * missing what it could not say still mints an id, and that id installs a configuration nobody\n * chose.\n */\nfunction mapOrRefuse(\n { config, content }: RoundTrip,\n inheritedFrom: ProjectConfig | undefined,\n): MappedPayload {\n try {\n return { ok: true, payload: configToSeedPayload(config, content, inheritedFrom) };\n } catch (error) {\n return { ok: false, error: getErrorMessage(error) };\n }\n}\n","import { MATRIX_VERSION } from \"@workspace/matrix\";\nimport {\n SEED_VERSION,\n installableSeedPayloadSchema,\n seedModelSchema,\n} from \"@workspace/matrix/seed\";\n\nimport { DEFAULT_PUBLIC_SOURCE_NAME, EJECT_SOURCE } from \"../../consts.js\";\nimport { isScopePairCompatible } from \"../configuration/config-generator.js\";\nimport { typedEntries, typedValues } from \"../../utils/typed-object.js\";\n\nimport type { ContentReading } from \"./external-skills.js\";\nimport type {\n AgentScopeConfig,\n ProjectConfig,\n SkillConfig,\n SkillScope,\n} from \"../../types/config.js\";\nimport type { ModelName } from \"../../types/matrix.js\";\nimport type { SkillId } from \"../../types/skills.js\";\nimport type {\n SeedAgent,\n SeedLoadState,\n SeedModel,\n SeedPayload,\n SeedSkill,\n} from \"@workspace/matrix/seed\";\n\ntype SeedAssignments = Record<string, SeedLoadState>;\n\ntype StackReading = {\n assignments: Map<SkillId, SeedAssignments>;\n unwritable: string[];\n};\n\n/**\n * A tombstone describes something NOT installed, so it has nothing to say on the wire. Exported so\n * the reader of carried content agrees with the mapper about what is installed.\n */\nexport function isInstalled(entry: { excluded?: boolean }): boolean {\n return !entry.excluded;\n}\n\n/** An ejected copy travels with the project, and the default catalogue is what no ref means. */\nfunction needsMarketplaceNamed(origin: string): boolean {\n return origin !== EJECT_SOURCE && origin !== DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\n/** The contract's own enum, so widening `MODEL_NAMES` alone cannot silently drop a pin. */\nfunction isSeedModel(model: ModelName): model is SeedModel {\n return seedModelSchema.safeParse(model).success;\n}\n\n/** An absent flag is lazy. */\nfunction seedLoadState(preloaded: boolean | undefined): SeedLoadState {\n return preloaded === true ? \"preloaded\" : \"lazy\";\n}\n\nfunction unnameableOriginMessage(skill: SkillConfig): string {\n return `${skill.id} comes from the marketplace '${skill.origin}', and this installation does not record where that marketplace is fetched from`;\n}\n\nfunction unnameableModelMessage(agent: AgentScopeConfig[\"name\"], model: ModelName): string {\n return `${agent} pins model '${model}', which this contract has no word for — leaving it out would say \"keep the sub-agent's own metadata\", which is a different instruction`;\n}\n\nfunction unwritablePairMessage(skillId: SkillId, agent: string): string {\n return `${skillId} -> ${agent}: a project-scoped skill never reaches a sub-agent that rests at global scope`;\n}\n\n/**\n * Names everything at once. A payload quietly missing what it could not say would mint an id that\n * installs a configuration nobody chose.\n */\nfunction unshareableConfigError(unshareable: string[]): string {\n return [\n \"This installation cannot be shared as it stands — a shared configuration has no way to carry:\",\n ...unshareable.map((line) => ` ${line}`),\n \"Sharing it anyway would mint an id that installs something else.\",\n ].join(\"\\n\");\n}\n\ntype MarketplaceReading = {\n ref: string | undefined;\n unnameable: string[];\n};\n\ntype MarketplaceRecord = Pick<ProjectConfig, \"marketplace\" | \"marketplaceName\">;\n\n/**\n * `origin` is a marketplace NAME, `marketplace` its ref and `marketplaceName` joins them; without\n * both agreeing the ref would point the receiver at a repository that never served the skill.\n */\nfunction isRecordedMarketplace(record: MarketplaceRecord | undefined, skill: SkillConfig): boolean {\n return record?.marketplace !== undefined && skill.origin === record.marketplaceName;\n}\n\n/**\n * A payload names ONE marketplace: this configuration's own whenever a shared skill comes from it.\n * A global installation's other-marketplace skills travel and are named by\n * {@link skillsItsMarketplaceLeavesBehind}. Only a skill whose marketplace neither config records\n * is refused.\n */\nfunction readMarketplace(\n config: ProjectConfig,\n skills: SkillConfig[],\n inheritedFrom: MarketplaceRecord | undefined,\n): MarketplaceReading {\n const served = skills.filter((skill) => needsMarketplaceNamed(skill.origin));\n const unaccounted = served.filter(\n (skill) =>\n !isRecordedMarketplace(config, skill) && !isRecordedMarketplace(inheritedFrom, skill),\n );\n if (unaccounted.length > 0) {\n return { ref: undefined, unnameable: unaccounted.map(unnameableOriginMessage) };\n }\n\n const servesItsOwn = served.some((skill) => isRecordedMarketplace(config, skill));\n return { ref: servesItsOwn ? config.marketplace : undefined, unnameable: [] };\n}\n\n/**\n * An install reads the one marketplace a payload names, so a plugin from another is skipped. A\n * stopgap rather than a refusal: the sharer is told which skills it leaves behind.\n */\nexport function skillsItsMarketplaceLeavesBehind(\n config: ProjectConfig,\n payload: SeedPayload,\n): SkillId[] {\n const namedMarketplace =\n payload.marketplace === undefined ? DEFAULT_PUBLIC_SOURCE_NAME : config.marketplaceName;\n const isPluginFromElsewhere = (skill: SkillConfig): boolean =>\n skill.origin !== EJECT_SOURCE && skill.origin !== namedMarketplace;\n\n return config.skills\n .filter(isInstalled)\n .filter(isPluginFromElsewhere)\n .map((skill) => skill.id);\n}\n\nfunction unnameableModels(agents: AgentScopeConfig[]): string[] {\n return agents.flatMap((agent) =>\n agent.model !== undefined && !isSeedModel(agent.model)\n ? [unnameableModelMessage(agent.name, agent.model)]\n : [],\n );\n}\n\n/**\n * `config.stack` is keyed by sub-agent; the contract by skill. Rows for uninstalled sub-agents or\n * skills are dropped (`compile` ignores them too); rows the config model cannot write are\n * collected for the refusal, since the decoder would turn them away.\n */\nfunction readStack(\n stack: ProjectConfig[\"stack\"],\n skillScopes: Map<SkillId, SkillScope>,\n agentScopes: Map<string, SkillScope>,\n): StackReading {\n const assignments = new Map<SkillId, SeedAssignments>();\n const unwritable: string[] = [];\n\n for (const [agent, agentStack] of typedEntries(stack ?? {})) {\n const agentScope = agentScopes.get(agent);\n if (agentScope === undefined) continue;\n\n for (const { id, preloaded } of typedValues(agentStack).flat()) {\n const skillScope = skillScopes.get(id);\n if (skillScope === undefined) continue;\n\n if (!isScopePairCompatible(skillScope, agentScope)) {\n unwritable.push(unwritablePairMessage(id, agent));\n continue;\n }\n\n const forSkill = assignments.get(id) ?? {};\n forSkill[agent] = seedLoadState(preloaded);\n assignments.set(id, forSkill);\n }\n }\n\n return { assignments, unwritable };\n}\n\nfunction toSeedSkill(skill: SkillConfig, assignments: SeedAssignments | undefined): SeedSkill {\n return {\n // A plugin's marketplace has already been checked against the envelope's ref.\n install: skill.origin === EJECT_SOURCE ? \"eject\" : \"plugin\",\n scope: skill.scope,\n assignments: assignments ?? {},\n };\n}\n\n/** Always `on`: it carries a sub-agent that owns no skill, which assignments cannot. */\nfunction toSeedAgent(agent: AgentScopeConfig): SeedAgent {\n return {\n on: true,\n scope: agent.scope,\n ...(agent.model !== undefined && isSeedModel(agent.model) && { model: agent.model }),\n ...(agent.codexModel !== undefined && { codexModel: agent.codexModel }),\n ...(agent.effort !== undefined && { effort: agent.effort }),\n };\n}\n\n/**\n * The inverse of `seedToWizardResult`; anything the contract cannot state is refused by name.\n * `stackId` is always null: assignments carry the expansion, `description` the rest.\n */\nexport function configToSeedPayload(\n config: ProjectConfig,\n carried: ContentReading,\n inheritedFrom?: MarketplaceRecord,\n): SeedPayload {\n const skills = config.skills.filter(isInstalled);\n const agents = config.agents.filter(isInstalled);\n const skillScopes = new Map(skills.map((skill) => [skill.id, skill.scope]));\n const agentScopes = new Map<string, SkillScope>(agents.map((agent) => [agent.name, agent.scope]));\n\n const { assignments, unwritable } = readStack(config.stack, skillScopes, agentScopes);\n const marketplace = readMarketplace(config, skills, inheritedFrom);\n\n const unshareable = [\n ...marketplace.unnameable,\n ...unnameableModels(agents),\n ...unwritable,\n ...carried.uncarryable,\n ];\n if (unshareable.length > 0) throw new Error(unshareableConfigError(unshareable));\n\n // Parsed against the store's installable schema, so drift fails the mint here.\n return installableSeedPayloadSchema.parse({\n v: SEED_VERSION,\n matrixVersion: MATRIX_VERSION,\n stackId: null,\n // Absent rather than empty: an id is the hash of its body.\n ...(config.description !== undefined && { description: config.description }),\n ...(marketplace.ref !== undefined && { marketplace: marketplace.ref }),\n skills: Object.fromEntries(\n skills.map((skill) => [skill.id, toSeedSkill(skill, assignments.get(skill.id))]),\n ),\n ...(Object.keys(carried.external).length > 0 && { external: carried.external }),\n agents: Object.fromEntries(agents.map((agent) => [agent.name, toSeedAgent(agent)])),\n });\n}\n","import { STATUS_CODES } from \"node:http\";\n\nimport { z } from \"zod\";\n\nimport { SEED_API_URL, SEED_USER_AGENT } from \"./fetch-seed.js\";\nimport { CLI_INVOKE_COMMAND } from \"../../consts.js\";\nimport { truncateText } from \"../../utils/string.js\";\n\nimport type { SeedPayload } from \"@workspace/matrix/seed\";\n\n/**\n * The store answers a stored configuration with its content-addressed id and nothing else.\n * Revalidated rather than read off the response type, because that type describes the worker this\n * CLI was built against and what answers is whatever is deployed.\n */\nconst mintedSchema = z.object({ id: z.string().min(1) });\n\n/**\n * The envelope a refused POST arrives in.\n *\n * `apps/server` registers no `defaultHook` and its own hook narrows only the seed-version case,\n * so every other refused body falls through to `@hono/zod-validator`, which answers\n * `c.json(result, 400)` — the whole `safeParse` result. A `ZodError` has no own enumerable fields\n * beyond `name` and `message`, so `{ success: false, error: { name, message } }` is what crosses\n * the wire. Only that string is read here; everything else is shape to match against.\n */\nconst refusalSchema = z.object({ error: z.object({ message: z.string() }) });\n\n/**\n * What that string really is, which is the part worth knowing: Zod renders its ISSUES into\n * `message` as a JSON document, so the field named `message` is not something to show a person.\n * The sentences the store's own schema wrote are one level further in, and reading them back out\n * is the whole difference between a bare `HTTP 400` and a refusal that names what is wrong.\n */\nconst refusedIssuesSchema = z\n .array(\n z.object({\n path: z.array(z.union([z.string(), z.number()])),\n message: z.string().min(1),\n }),\n )\n .min(1);\n\n/**\n * How much of the store's account of a refusal to quote back.\n *\n * The refusal it really writes is one sentence naming a skill and a sub-agent — around 150\n * characters — so this holds that whole, and a second beside it. Past that a body has stopped\n * being an explanation, and a store replaced by a proxy, a captive portal or something worse must\n * not get to paint the terminal. The same reasoning as `EXCERPT` in `read-piped-payload.ts`, at\n * the length this quote needs: that one bounds unreadable bytes shown so a user recognises them,\n * where this one bounds prose the user has to be able to finish reading.\n *\n * ONE budget for both shapes this route answers in, rather than one apiece, because a budget is a\n * measurement of a ROUTE and both are `POST /configs`. The plain-text refusals it writes are far\n * shorter than a list of schema issues — the longest is `Could not store this config` — so the\n * number sized on the longer shape holds the shorter one with room to spare. `fetch-seed.ts` sets\n * 120 for its own route and neither number travels between them; see the 2026-09-01 finding on\n * quoting a refusal's body.\n */\nconst EXPLANATION_BUDGET = 300;\n\n/** The content type the store's own sentences arrive as — the only one worth reading as prose. */\nconst QUOTABLE_TYPE = \"text/plain\";\n\n/** The status the store spends on a payload naming a version of the contract it does not serve. */\nconst CONTRACT_MISMATCH = 409;\n\n/**\n * What a 409 means from a terminal, said in the CLI's own words rather than the store's.\n *\n * This is the one refusal whose entire purpose is naming a remedy, and the store's body names one\n * a terminal cannot carry out: `refuseAnotherSeedVersion` in `apps/server/src/index.ts` answers\n * `Reload the page: ...`, written for the caller that refusal was designed around — a browser tab\n * minting from a bundle older than the last deploy, for which one reload really is the whole fix.\n * There is no page here. Quoting it would be worse than the bare status it replaced, because the\n * bare status at least does not send the reader somewhere that does not exist.\n *\n * The fact underneath is the same one, and from a terminal it is actionable: `SEED_VERSION` is a\n * `z.literal` imported from `@workspace/matrix/seed` and bundled into this binary, so the version\n * written here travels INSIDE the CLI. Nothing about the configuration, the directory it was read\n * from or the pipe it arrived on can change it, and a newer CLI is the only thing that can.\n *\n * It cannot be the payload's fault by either door: `read-piped-payload.ts` validates a piped\n * configuration against `installableSeedPayloadSchema` before this runs, and `config-to-seed.ts`\n * writes `SEED_VERSION` into one it builds — so a `v` this CLI does not itself name never reaches\n * the wire, and a 409 can only be the two ends disagreeing.\n *\n * It names no sub-command, which is deliberate twice over. `publishSeedConfig` is called by both\n * `share` and `edit --ui`, so there is no one command to re-run; and an invocation written after\n * `@latest` is invisible to `handed-out-invocations.ts`, whose reader matches\n * `${CLI_INVOKE_COMMAND}` followed by a SPACE — so naming one here would hand out a command the\n * gate that runs every handed-out command could not see.\n */\nconst OUT_OF_DATE_AGAINST_STORE =\n `This CLI is out of date against the configuration store: it writes a version of the sharing ` +\n `contract the store does not serve, and that version travels inside the CLI rather than with ` +\n `the configuration. Re-run this command through '${CLI_INVOKE_COMMAND}@latest'.`;\n\nexport type PublishSeedResult = { ok: true; id: string } | { ok: false; error: string };\n\n/**\n * Stores a configuration and returns the id it was given.\n *\n * The outbound half of the boundary `fetchSeedConfig` in `fetch-seed.ts` owns the inbound half\n * of, and it keeps the same posture: every failure is a message rather than a throw.\n * Nothing local has been written by the time this runs, so there is nothing to roll back and the\n * caller's only job is to explain.\n *\n * The id is the payload's own hash, so re-sharing an unchanged configuration returns the id it\n * had — the store spends no write, and a caller can share as often as it likes.\n */\nexport async function publishSeedConfig(payload: SeedPayload): Promise<PublishSeedResult> {\n const url = `${SEED_API_URL}/configs`;\n\n let response: Response;\n try {\n response = await fetch(url, {\n method: \"POST\",\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n // The same signal the fetch half sends: it is the only thing that tells the store a\n // configuration came from the CLI rather than from a browser.\n \"user-agent\": SEED_USER_AGENT,\n },\n body: JSON.stringify(payload),\n });\n } catch {\n return { ok: false, error: `Could not reach ${SEED_API_URL} — check your connection.` };\n }\n\n if (!response.ok) return { ok: false, error: await refusalMessage(response) };\n\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return { ok: false, error: \"The configuration store returned something that is not JSON.\" };\n }\n\n const minted = mintedSchema.safeParse(body);\n if (!minted.success) {\n // Reporting success here would print an id nobody can install and tell the user to use it.\n return { ok: false, error: \"The configuration store did not return an id for this share.\" };\n }\n\n return { ok: true, id: minted.data.id };\n}\n\n/**\n * A refusal, carrying the store's own account of it wherever there is one to have.\n *\n * The status is never given up, because it is the only thing that separates a bad payload (400)\n * from a stale contract (409), a body over the cap (413), a rate limit (429) and a store that\n * refused the write (503). What it cannot do is say WHY a payload was bad, and the store already\n * knows: a refused POST answers with the issues its own schema raised, in plain English, naming\n * the skill and the sub-agent. Discarding that cost a real user a debugging session for a fault\n * the store had already described.\n *\n * Read for every status rather than for 400 alone — except the one status whose body is answering\n * somebody else. Which statuses carry which shape is the deployed worker's business, so both\n * shapes are tried against every body, and one that is neither degrades to the status anyway.\n */\nasync function refusalMessage(response: Response): Promise<string> {\n const refused = `Sharing this configuration failed (HTTP ${response.status}).`;\n\n // Branched on the status rather than on the body, because the status is the whole of the fact:\n // what a 409 says is that the two ends name different contract versions, and no body the store\n // could send makes that any more actionable from a terminal than the sentence above does.\n if (response.status === CONTRACT_MISMATCH) return `${refused} ${OUT_OF_DATE_AGAINST_STORE}`;\n\n const explanation = explanationOf(response, await refusalBody(response));\n\n return explanation === undefined ? refused : `${refused} The store said: ${explanation}`;\n}\n\n/**\n * Whatever the store sent, as text and unjudged.\n *\n * Deliberately NOT gated on the content type the way the function of this name in `fetch-seed.ts`\n * is, and the difference is the routes rather than a disagreement: that one answers every refusal\n * with `c.text`, where this one answers in two shapes under two types — the validator's envelope\n * as `application/json`, the worker's own sentences as `text/plain`. A gate here would throw one\n * of them away. It belongs on the prose arm alone, which is where {@link arrivedAsText} is.\n *\n * Nothing below this line is worth failing over: the message being assembled is already a\n * failure, and a body that cannot be read is one more thing the status will have to cover on its\n * own. Draining the stream can throw in its own right — a connection dropped mid-body — which is\n * why this is a `try` around the read.\n */\nasync function refusalBody(response: Response): Promise<string | undefined> {\n try {\n return await response.text();\n } catch {\n return undefined;\n }\n}\n\n/** `JSON.parse` as a value rather than a throw, since a body that is not JSON is expected here. */\nfunction jsonOf(text: string): unknown {\n try {\n return JSON.parse(text);\n } catch {\n return undefined;\n }\n}\n\n/**\n * The store's account of a refusal, in whichever of the two shapes this route answers in.\n *\n * The envelope is read first because it is the more specific of the two, and the order costs\n * nothing either way: an envelope arrives as JSON and could never satisfy the prose arm's\n * content-type gate, and prose has no shape for `refusalSchema` to match.\n *\n * The budget is spent here rather than inside either arm, so that whatever leaves this module is\n * bounded once, by one number belonging to one route.\n *\n * The body travels beside the response it came from rather than being taken off it, because by\n * the time this runs the stream has been drained and a second read would answer nothing.\n */\nfunction explanationOf(response: Response, body: string | undefined): string | undefined {\n if (body === undefined) return undefined;\n\n const said = schemaIssuesIn(body) ?? quotableProseIn(response, body);\n\n return said === undefined ? undefined : truncateText(said, EXPLANATION_BUDGET);\n}\n\n/** The sentences the store's own schema wrote, read back out of the validator's envelope. */\nfunction schemaIssuesIn(body: string): string | undefined {\n const refusal = refusalSchema.safeParse(jsonOf(body));\n if (!refusal.success) return undefined;\n\n const issues = refusedIssuesSchema.safeParse(jsonOf(refusal.data.error.message));\n if (!issues.success) return undefined;\n\n return issues.data.map(sentenceOf).join(\"; \");\n}\n\n/**\n * The store's own words, where the wire says the store wrote them and they say something.\n *\n * The three refusals this route writes with `c.text` — 413, 429 and 503 — reach a terminal by no\n * other arm, and before this they reached it by none at all. Two of the three are then discarded\n * again by {@link restatesItsOwnStatus}, which is the whole shape of the rule: what earns a quote\n * is not a body, it is a body that adds something to the status printed beside it.\n */\nfunction quotableProseIn(response: Response, body: string): string | undefined {\n if (!arrivedAsText(response)) return undefined;\n\n const said = body.trim();\n if (said === \"\") return undefined;\n if (restatesItsOwnStatus(said, response.status)) return undefined;\n\n return said;\n}\n\n/**\n * Whether what arrived is the store speaking, as far as the wire says it is.\n *\n * `c.text(...)` is how this route writes every refusal that is not the validator's, so `text/plain`\n * is the shape the store's own words take. What arrives as anything else did not come from it: a\n * proxy, a WAF, a captive portal or a gateway answering in its place — and their answer is markup\n * rather than prose, which quoted into a terminal is a screenful of tags that explains nothing and\n * buries the status that does.\n *\n * A sentence has no shape to validate, so the wire's own statement of what it sent is the only\n * discriminator prose has — where the envelope beside it has `refusalSchema`, a shape a foreign\n * body fails to be. It is not proof, since a hostile answer may claim any type it likes, which is\n * what {@link EXPLANATION_BUDGET} is for and why what survives both is attributed to the store\n * rather than spoken in the CLI's own voice.\n */\nfunction arrivedAsText(response: Response): boolean {\n return (response.headers.get(\"content-type\") ?? \"\").startsWith(QUOTABLE_TYPE);\n}\n\n/**\n * Whether the body says only what the status line printed beside it has already said.\n *\n * `node:http`'s `STATUS_CODES` is the registry of reason phrases a status line carries, so holding\n * a body against it is a rule about the whole class rather than a list of the statuses it happens\n * to catch today. It catches two: `Too many requests` is 429's `Too Many Requests` re-cased and\n * `Payload too large` is 413's, so neither is named here and a fourth refusal written the same way\n * is suppressed the day it ships. `Could not store this config` is not `Service Unavailable`, which\n * is why the one refusal on this route that names a cause is the one that survives.\n *\n * Compared case-insensitively, and against the trimmed body, because the worker writes sentence\n * case where the registry writes title case and that is not a difference in meaning.\n */\nfunction restatesItsOwnStatus(said: string, status: number): boolean {\n const reason = STATUS_CODES[status];\n\n return reason !== undefined && said.toLowerCase() === reason.toLowerCase();\n}\n\n/** One issue as it arrives, read off the schema above so the two cannot drift apart. */\ntype RefusedIssue = z.infer<typeof refusedIssuesSchema>[number];\n\n/**\n * One issue, path first — the same rendering `formatZodIssue` in `lib/schema-validator.ts` gives\n * a local one, and deliberately the same sentence a user sees from `share --stdin`.\n *\n * It cannot call that function: this issue was read off a wire and is a plain object, where\n * `formatZodIssue` takes a `z.ZodIssue`, a discriminated union nothing arriving over HTTP can be\n * narrowed to without a cast. The path is what the sentence itself cannot carry — the store's\n * message names the sub-agent and the path names the skill.\n */\nfunction sentenceOf(issue: RefusedIssue): string {\n const path = issue.path.join(\".\");\n return path === \"\" ? issue.message : `${path}: ${issue.message}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;;;ACsCV,SAAS,YAAY,OAAwC;AAClE,SAAO,CAAC,MAAM;AAChB;AAGA,SAAS,sBAAsB,QAAyB;AACtD,SAAO,WAAW,gBAAgB,WAAW;AAC/C;AAGA,SAAS,YAAY,OAAsC;AACzD,SAAO,gBAAgB,UAAU,KAAK,EAAE;AAC1C;AAGA,SAAS,cAAc,WAA+C;AACpE,SAAO,cAAc,OAAO,cAAc;AAC5C;AAEA,SAAS,wBAAwB,OAA4B;AAC3D,SAAO,GAAG,MAAM,EAAE,gCAAgC,MAAM,MAAM;AAChE;AAEA,SAAS,uBAAuB,OAAiC,OAA0B;AACzF,SAAO,GAAG,KAAK,gBAAgB,KAAK;AACtC;AAEA,SAAS,sBAAsB,SAAkB,OAAuB;AACtE,SAAO,GAAG,OAAO,OAAO,KAAK;AAC/B;AAMA,SAAS,uBAAuB,aAA+B;AAC7D,SAAO;AAAA,IACL;AAAA,IACA,GAAG,YAAY,IAAI,CAAC,SAAS,KAAK,IAAI,EAAE;AAAA,IACxC;AAAA,EACF,EAAE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eAAe,IAAI,KAAK,gBAAgB,UAAU,IAAI;AAEnE,SAAO,SAAS,SAAY,SAAY,aAAa,MAAM,kBAAkB;AAC/E;AAGA,SAAS,eAAe,MAAkC;AACxD,QAAM,UAAU,cAAc,UAAU,OAAO,IAAI,CAAC;AACpD,MAAI,CAAC,QAAQ,QAAS,QAAO;AAE7B,QAAM,SAAS,oBAAoB,UAAU,OAAO,QAAQ,KAAK,MAAM,OAAO,CAAC;AAC/E,MAAI,CAAC,OAAO,QAAS,QAAO;AAE5B,SAAO,OAAO,KAAK,IAAI,UAAU,EAAE,KAAK,IAAI;AAC9C;AAUA,SAAS,gBAAgB,UAAoB,MAAkC;AAC7E,MAAI,CAAC,cAAc,QAAQ,EAAG,QAAO;AAErC,QAAM,OAAO,KAAK,KAAK;AACvB,MAAI,SAAS,GAAI,QAAO;AACxB,MAAI,qBAAqB,MAAM,SAAS,MAAM,EAAG,QAAO;AAExD,SAAO;AACT;AAiBA,SAAS,cAAc,UAA6B;AAClD,UAAQ,SAAS,QAAQ,IAAI,cAAc,KAAK,IAAI,WAAW,aAAa;AAC9E;AAeA,SAAS,qBAAqB,MAAc,QAAyB;AACnE,QAAM,SAAS,aAAa,MAAM;AAElC,SAAO,WAAW,UAAa,KAAK,YAAY,MAAM,OAAO,YAAY;AAC3E;AAcA,SAAS,WAAW,OAA6B;AAC/C,QAAMA,QAAO,MAAM,KAAK,KAAK,GAAG;AAChC,SAAOA,UAAS,KAAK,MAAM,UAAU,GAAGA,KAAI,KAAK,MAAM,OAAO;AAChE;","names":["path"]}
@@ -4,11 +4,11 @@ import {
4
4
  } from "./chunk-TSIU7DME.js";
5
5
  import {
6
6
  CategoryGrid
7
- } from "./chunk-SXVHSOTH.js";
7
+ } from "./chunk-3DIDV6H3.js";
8
8
  import {
9
9
  buildCategoriesForDomain,
10
10
  useWizardStore
11
- } from "./chunk-7JNJ52CD.js";
11
+ } from "./chunk-WNLF5EDZ.js";
12
12
 
13
13
  // src/cli/components/wizard/step-build.tsx
14
14
  import { Box, useInput } from "ink";
@@ -89,4 +89,4 @@ var StepBuild = ({
89
89
  export {
90
90
  StepBuild
91
91
  };
92
- //# sourceMappingURL=chunk-MPTNC32T.js.map
92
+ //# sourceMappingURL=chunk-4HWOYYY7.js.map
@@ -2,15 +2,15 @@
2
2
  import {
3
3
  computeScopeDiff,
4
4
  useWizardStore
5
- } from "./chunk-7JNJ52CD.js";
5
+ } from "./chunk-WNLF5EDZ.js";
6
6
  import {
7
7
  getSkillDisplayName
8
- } from "./chunk-V5WXIM2F.js";
8
+ } from "./chunk-NU2K5G54.js";
9
9
  import {
10
10
  CLI_COLORS,
11
11
  EJECT_SOURCE,
12
12
  UI_SYMBOLS
13
- } from "./chunk-ENGYJCTF.js";
13
+ } from "./chunk-AG3ZVM3B.js";
14
14
 
15
15
  // src/cli/components/wizard/skill-agent-summary.tsx
16
16
  import { Box, Text } from "ink";
@@ -106,4 +106,4 @@ var SkillAgentSummary = ({
106
106
  export {
107
107
  SkillAgentSummary
108
108
  };
109
- //# sourceMappingURL=chunk-MAWNVT2C.js.map
109
+ //# sourceMappingURL=chunk-4UKMQUAU.js.map
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  compileAgents,
4
4
  withCatalogueSeatedFor
5
- } from "./chunk-HWEKHVLE.js";
5
+ } from "./chunk-TW35AEB4.js";
6
6
  import {
7
7
  loadAgentDefs
8
- } from "./chunk-PMJWD27C.js";
8
+ } from "./chunk-GE7NUPMI.js";
9
9
  import {
10
10
  ConfigLoadError,
11
11
  GlobalPairWriteViolation,
@@ -47,12 +47,12 @@ import {
47
47
  warn,
48
48
  withGateToken,
49
49
  writeFile
50
- } from "./chunk-A4KDXNOT.js";
50
+ } from "./chunk-C2UISKIM.js";
51
51
  import {
52
52
  matrix,
53
53
  typedEntries,
54
54
  typedKeys
55
- } from "./chunk-V5WXIM2F.js";
55
+ } from "./chunk-NU2K5G54.js";
56
56
  import {
57
57
  CLI_INVOKE_COMMAND,
58
58
  GLOBAL_CONFIG_NAME,
@@ -63,7 +63,7 @@ import {
63
63
  isActiveAt,
64
64
  isGlobalTombstone,
65
65
  skillDomain
66
- } from "./chunk-ENGYJCTF.js";
66
+ } from "./chunk-AG3ZVM3B.js";
67
67
 
68
68
  // src/cli/lib/operations/source/load-source.ts
69
69
  async function loadSource(options) {
@@ -745,7 +745,7 @@ var NOTHING_RECOMPILED = {
745
745
  };
746
746
  async function recompilePropagated(projectDirs) {
747
747
  if (projectDirs.length === 0) return NOTHING_RECOMPILED;
748
- const { recompilePropagatedProjectAgents: recompilePropagatedProjectAgents2 } = await import("./recompile-project-agents-DGNBCU3N.js");
748
+ const { recompilePropagatedProjectAgents: recompilePropagatedProjectAgents2 } = await import("./recompile-project-agents-7PQWYQ6B.js");
749
749
  return recompilePropagatedProjectAgents2(projectDirs);
750
750
  }
751
751
 
@@ -784,7 +784,7 @@ async function applyConsequences(globalConfig, changes, deps, provider, currentP
784
784
  function lazyGateDeps(projectDir) {
785
785
  return {
786
786
  loadMatrix: async () => {
787
- const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-7KZ3MD5O.js");
787
+ const { loadSkillsMatrixFromSource: loadSkillsMatrixFromSource2 } = await import("./source-loader-FRJTCSDL.js");
788
788
  const { matrix: matrix2 } = await loadSkillsMatrixFromSource2({
789
789
  projectDir,
790
790
  skipExtraSources: true,
@@ -793,7 +793,7 @@ function lazyGateDeps(projectDir) {
793
793
  return matrix2;
794
794
  },
795
795
  loadAgents: async () => {
796
- const { loadAgentDefs: loadAgentDefs2 } = await import("./load-agent-defs-3C27ENC7.js");
796
+ const { loadAgentDefs: loadAgentDefs2 } = await import("./load-agent-defs-5XMVB3MU.js");
797
797
  return (await loadAgentDefs2()).agents;
798
798
  }
799
799
  };
@@ -1133,4 +1133,4 @@ export {
1133
1133
  compileAgentsAllScopes,
1134
1134
  compileProjectScope
1135
1135
  };
1136
- //# sourceMappingURL=chunk-G6UREQ4V.js.map
1136
+ //# sourceMappingURL=chunk-5JUQKGCP.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CLI_COLORS
4
- } from "./chunk-ENGYJCTF.js";
4
+ } from "./chunk-AG3ZVM3B.js";
5
5
 
6
6
  // src/cli/components/wizard/toast.tsx
7
7
  import { Box, Text } from "ink";
@@ -25,4 +25,4 @@ var Toast = ({ children }) => {
25
25
  export {
26
26
  Toast
27
27
  };
28
- //# sourceMappingURL=chunk-T6UWJAB3.js.map
28
+ //# sourceMappingURL=chunk-6WGXTB2L.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  SCROLL_VIEWPORT
4
- } from "./chunk-ENGYJCTF.js";
4
+ } from "./chunk-AG3ZVM3B.js";
5
5
 
6
6
  // src/cli/components/wizard/scroll-affordance.tsx
7
7
  import { Box, Text } from "ink";
@@ -21,4 +21,4 @@ var ScrollAffordance = ({ hiddenAbove, hiddenBelow }) => {
21
21
  export {
22
22
  ScrollAffordance
23
23
  };
24
- //# sourceMappingURL=chunk-SAYZWCH6.js.map
24
+ //# sourceMappingURL=chunk-7PYXS2QU.js.map
@@ -10046,6 +10046,12 @@ import { z as z2 } from "zod";
10046
10046
 
10047
10047
  // ../matrix/src/vendor/matrix.ts
10048
10048
  var MODEL_NAMES = ["sonnet", "opus", "haiku", "fable", "inherit"];
10049
+ var CODEX_MODEL_NAMES = [
10050
+ "gpt-6-astra",
10051
+ "gpt-5.6-sol",
10052
+ "gpt-5.6-terra",
10053
+ "gpt-5.6-luna"
10054
+ ];
10049
10055
  var EFFORT_NAMES = ["low", "medium", "high", "xhigh", "max"];
10050
10056
 
10051
10057
  // ../matrix/src/built-in-agents.ts
@@ -10563,7 +10569,7 @@ var DISCOURAGED_PAIRS = Object.values(CATALOG.skillsById).flatMap(
10563
10569
 
10564
10570
  // ../matrix/src/seed.ts
10565
10571
  import { z as z3 } from "zod";
10566
- var SEED_VERSION = 5;
10572
+ var SEED_VERSION = 6;
10567
10573
  var seedModelSchema = z3.enum(["opus", "fable", "sonnet", "haiku"]);
10568
10574
  var seedEffortSchema = z3.enum([
10569
10575
  "low",
@@ -10584,11 +10590,13 @@ var seedSkillSchema = z3.object({
10584
10590
  var seedAgentSchema = z3.object({
10585
10591
  on: z3.boolean().exactOptional(),
10586
10592
  model: seedModelSchema.exactOptional(),
10593
+ // A string rather than the CLI's enum: Codex retires ids, and an enum would
10594
+ // turn each retirement into a version bump. Each consumer drops an id it does
10595
+ // not offer.
10596
+ codexModel: z3.string().min(1).exactOptional(),
10587
10597
  effort: seedEffortSchema.exactOptional(),
10588
- // Where this agent's front-matter is written: the project, or the user's own
10589
- // ~/.claude. Absent means the shared selection default — `global`, spelled
10590
- // once in `DEFAULT_SELECTION_OPTIONS` — so the resting choice never travels,
10591
- // exactly as a resting model does not.
10598
+ // Absent means `DEFAULT_SELECTION_OPTIONS.scope`, so the resting choice never
10599
+ // travels.
10592
10600
  scope: seedScopeSchema.exactOptional()
10593
10601
  });
10594
10602
  var MAX_EXTERNAL_SKILL_BYTES = 262144;
@@ -10608,10 +10616,7 @@ var seedSkillTreeSchema = z3.record(z3.string().min(1), z3.string()).refine((fil
10608
10616
  var seedExternalSkillSchema = z3.object({
10609
10617
  displayName: z3.string().min(1),
10610
10618
  description: z3.string(),
10611
- // A category of the catalogue this payload names — the placement the user
10612
- // confirmed. Without it the skill has nowhere to render and no sub-agent
10613
- // reach, which is the whole difference between a catalogue entry and an
10614
- // orphan section.
10619
+ // The placement the user confirmed at add time, never derived.
10615
10620
  categoryId: z3.string().min(1),
10616
10621
  // GitHub's own `owner/name`.
10617
10622
  repo: z3.string().min(1),
@@ -10625,45 +10630,18 @@ var seedPayloadSchema = z3.object({
10625
10630
  // decode — it explains why some ids were skipped.
10626
10631
  matrixVersion: z3.string(),
10627
10632
  stackId: z3.string().nullable(),
10628
- // The sentence the sharer's config records about itself, which on the CLI
10629
- // side is the description of whatever stack was applied. It travels because
10630
- // `stackId` deliberately does not: a saved config records a stack's
10631
- // EXPANSION and never the id it came from, so the receiver has no id to
10632
- // resolve one out of and the line is simply lost.
10633
- //
10634
- // Carrying the id instead would be worse rather than equivalent. A resolvable
10635
- // stack id does exactly two things on the way in — it supplies this
10636
- // description, and it overlays the stack YAML's own `preloaded` flags — and
10637
- // the assignments above already carry per-(skill, sub-agent) load state in
10638
- // full, so the second is redundant. What the id would ADD is the stack's
10639
- // whole roster: the receiving install spreads the loaded stack first and lets
10640
- // the saved stack win per agent, so a stack sub-agent the sharer REMOVED
10641
- // comes back wholesale. Absent means a config that describes itself with
10642
- // nothing, which is every payload the web app mints.
10633
+ // The sentence the sharer's config records about itself. It travels instead
10634
+ // of a stack id, which would bring back the stack's whole roster on install.
10643
10635
  description: z3.string().exactOptional(),
10644
- // Where the skills below are fetched from, in the form `--marketplace` takes
10645
- // one: `github:acme/skills`, a URL, a local path. The ref alone — the name
10646
- // its manifest gives it is read from the fetched marketplace.json, so
10647
- // carrying that too would let a payload disagree with the repository it
10648
- // names. Absent is the default public catalogue, which is why a payload that
10649
- // installs from it looks exactly as it did before this field existed.
10636
+ // Where the skills are fetched from, as `--marketplace` takes it. Absent is
10637
+ // the default public catalogue.
10650
10638
  marketplace: z3.string().exactOptional(),
10651
- // Sparse — presence is selection, exactly like the web store. `remembered`
10652
- // is deliberately absent: deselected setup never leaves the browser.
10639
+ // Sparse: presence is selection.
10653
10640
  skills: z3.record(z3.string(), seedSkillSchema),
10654
- // Skill id → its whole directory, for the ids above that no catalogue can
10655
- // resolve. Keyed by the same id `skills` uses, so a selection reads one map
10656
- // whichever kind of skill it names. Absent is the ordinary case — a payload
10657
- // built from the catalogue alone — which is why one looks exactly as it did
10658
- // before content travelled. Content is the expensive part of a payload, so an
10659
- // added skill nobody selected has no entry here either.
10641
+ // Skill id → its whole directory, for ids no catalogue can resolve.
10660
10642
  external: z3.record(z3.string(), seedExternalSkillSchema).exactOptional(),
10661
- // Sparse for the same reason: an agent resting on its own catalogue model
10662
- // with no pin has nothing to say, so it has no entry. Presence is a
10663
- // statement, not an install: what installs is decided by assignments and
10664
- // `on: true` alone, so a derived-off agent can still travel its overrides.
10665
- // Only an agent pinned *off* is omitted outright — with the assignment rows
10666
- // naming it, since the sharer's own counts exclude them.
10643
+ // Sparse: an agent with nothing to say has no entry. Presence is not an
10644
+ // install — assignments and `on: true` decide that.
10667
10645
  agents: z3.record(z3.string(), seedAgentSchema)
10668
10646
  });
10669
10647
  var isSeedScopePairWritable = (skillScope, agentScope) => !(skillScope === "project" && agentScope === "global");
@@ -10920,6 +10898,9 @@ var DISCARD = {
10920
10898
  verbose: () => void 0
10921
10899
  };
10922
10900
  var seated2 = DISCARD;
10901
+ function seatDiagnostics(diagnostics2) {
10902
+ seated2 = diagnostics2;
10903
+ }
10923
10904
  function diagnostics() {
10924
10905
  return seated2;
10925
10906
  }
@@ -10928,6 +10909,12 @@ function diagnostics() {
10928
10909
  function bytewise(a, b) {
10929
10910
  return a < b ? -1 : a > b ? 1 : 0;
10930
10911
  }
10912
+ function inAnEnglishList(items) {
10913
+ const last = items.at(-1);
10914
+ if (last === void 0) return "";
10915
+ if (items.length === 1) return last;
10916
+ return `${items.slice(0, -1).join(", ")} and ${last}`;
10917
+ }
10931
10918
 
10932
10919
  // ../compile/src/selection.ts
10933
10920
  import { groupBy as groupBy2 } from "remeda";
@@ -11186,6 +11173,7 @@ export {
11186
11173
  MATRIX_VERSION,
11187
11174
  DOMAIN_DESCRIPTIONS,
11188
11175
  MODEL_NAMES,
11176
+ CODEX_MODEL_NAMES,
11189
11177
  EFFORT_NAMES,
11190
11178
  resolveLoadState,
11191
11179
  resolveAssignment,
@@ -11199,9 +11187,11 @@ export {
11199
11187
  installableSeedPayloadSchema,
11200
11188
  seatCatalog,
11201
11189
  seatedCatalog,
11190
+ seatDiagnostics,
11202
11191
  diagnostics,
11203
11192
  orderDomains,
11204
11193
  bytewise,
11194
+ inAnEnglishList,
11205
11195
  CLAUDE_DIR,
11206
11196
  SOURCE_ROOT_DIR,
11207
11197
  SOURCE_SRC_DIR,
@@ -11275,4 +11265,4 @@ export {
11275
11265
  FALLBACK_DOMAIN,
11276
11266
  ASCII_LOGO
11277
11267
  };
11278
- //# sourceMappingURL=chunk-ENGYJCTF.js.map
11268
+ //# sourceMappingURL=chunk-AG3ZVM3B.js.map