agents-inc 0.176.0 → 0.177.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 (104) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +2 -2
  3. package/dist/{chunk-FACDJH6O.js → chunk-2FE4AJNC.js} +20 -26
  4. package/dist/chunk-2FE4AJNC.js.map +1 -0
  5. package/dist/{chunk-U46LYYRA.js → chunk-4SIBDIIO.js} +49 -13
  6. package/dist/chunk-4SIBDIIO.js.map +1 -0
  7. package/dist/chunk-5ZK4IND4.js +30 -0
  8. package/dist/chunk-5ZK4IND4.js.map +1 -0
  9. package/dist/{chunk-MQZNDK5F.js → chunk-77SHXTDD.js} +137 -56
  10. package/dist/chunk-77SHXTDD.js.map +1 -0
  11. package/dist/{chunk-U672FZVC.js → chunk-7OJ2SS4E.js} +10 -86
  12. package/dist/chunk-7OJ2SS4E.js.map +1 -0
  13. package/dist/{chunk-C2BSCEDN.js → chunk-7WN6TUZP.js} +7 -8
  14. package/dist/chunk-7WN6TUZP.js.map +1 -0
  15. package/dist/chunk-AVKX3IXF.js +117 -0
  16. package/dist/chunk-AVKX3IXF.js.map +1 -0
  17. package/dist/{chunk-ENET4IF6.js → chunk-D2PC7NIR.js} +1653 -1734
  18. package/dist/chunk-D2PC7NIR.js.map +1 -0
  19. package/dist/{chunk-JTMSFBCA.js → chunk-E6W3PYGF.js} +823 -72
  20. package/dist/chunk-E6W3PYGF.js.map +1 -0
  21. package/dist/chunk-H33ZAEKH.js +147 -0
  22. package/dist/chunk-H33ZAEKH.js.map +1 -0
  23. package/dist/{chunk-B7AVWSK2.js → chunk-JEFVFZAR.js} +39 -151
  24. package/dist/chunk-JEFVFZAR.js.map +1 -0
  25. package/dist/{chunk-UE4Z3YMB.js → chunk-KKGJH46C.js} +3 -21
  26. package/dist/chunk-KKGJH46C.js.map +1 -0
  27. package/dist/chunk-OIQKRXHH.js +142 -0
  28. package/dist/chunk-OIQKRXHH.js.map +1 -0
  29. package/dist/{chunk-CKBWEWHZ.js → chunk-TNN72UL6.js} +264 -247
  30. package/dist/chunk-TNN72UL6.js.map +1 -0
  31. package/dist/{chunk-XMQIWPIR.js → chunk-V3WJMNBF.js} +45 -18
  32. package/dist/chunk-V3WJMNBF.js.map +1 -0
  33. package/dist/chunk-VFD2XYM7.js +14 -0
  34. package/dist/chunk-VFD2XYM7.js.map +1 -0
  35. package/dist/{chunk-XYBHH3M5.js → chunk-WH7JXGDA.js} +2 -2
  36. package/dist/{chunk-JNRACLNS.js → chunk-XSR4WRXJ.js} +3 -3
  37. package/dist/{chunk-3F5LT433.js → chunk-Y5VMB73R.js} +202 -116
  38. package/dist/chunk-Y5VMB73R.js.map +1 -0
  39. package/dist/chunk-ZIBWVTLN.js +18 -0
  40. package/dist/chunk-ZIBWVTLN.js.map +1 -0
  41. package/dist/commands/build/marketplace.js +6 -10
  42. package/dist/commands/build/marketplace.js.map +1 -1
  43. package/dist/commands/build/plugins.js +10 -39
  44. package/dist/commands/build/plugins.js.map +1 -1
  45. package/dist/commands/compile.js +60 -81
  46. package/dist/commands/compile.js.map +1 -1
  47. package/dist/commands/doctor.js +234 -145
  48. package/dist/commands/doctor.js.map +1 -1
  49. package/dist/commands/edit.js +64 -159
  50. package/dist/commands/edit.js.map +1 -1
  51. package/dist/commands/eject.js +64 -54
  52. package/dist/commands/eject.js.map +1 -1
  53. package/dist/commands/init.js +19 -17
  54. package/dist/commands/list.js +10 -12
  55. package/dist/commands/list.js.map +1 -1
  56. package/dist/commands/new/marketplace.js +5 -5
  57. package/dist/commands/search.js +14 -13
  58. package/dist/commands/search.js.map +1 -1
  59. package/dist/commands/share.js +21 -44
  60. package/dist/commands/share.js.map +1 -1
  61. package/dist/commands/uninstall.js +139 -56
  62. package/dist/commands/uninstall.js.map +1 -1
  63. package/dist/commands/update.js +22 -37
  64. package/dist/commands/update.js.map +1 -1
  65. package/dist/components/common/header-row.js +9 -0
  66. package/dist/components/common/select-list.js +2 -2
  67. package/dist/components/common/skill-agent-summary.js +4 -4
  68. package/dist/components/common/summary-panel.js +6 -5
  69. package/dist/hooks/init.js +35 -22
  70. package/dist/hooks/init.js.map +1 -1
  71. package/dist/load-agent-defs-OCFWOZD2.js +14 -0
  72. package/dist/{recompile-project-agents-U3UGHPWG.js → recompile-project-agents-CXZBPIUS.js} +9 -9
  73. package/dist/{recompile-project-agents-U3UGHPWG.js.map → recompile-project-agents-CXZBPIUS.js.map} +1 -1
  74. package/dist/{source-loader-E2Y5MMN5.js → source-loader-GGDQDMN4.js} +6 -4
  75. package/dist/source-loader-GGDQDMN4.js.map +1 -0
  76. package/package.json +1 -1
  77. package/src/schemas/stacks.schema.json +105 -1
  78. package/dist/chunk-3F5LT433.js.map +0 -1
  79. package/dist/chunk-5CFHP6Z5.js +0 -109
  80. package/dist/chunk-5CFHP6Z5.js.map +0 -1
  81. package/dist/chunk-B7AVWSK2.js.map +0 -1
  82. package/dist/chunk-C2BSCEDN.js.map +0 -1
  83. package/dist/chunk-CKBWEWHZ.js.map +0 -1
  84. package/dist/chunk-EC3JXT23.js +0 -160
  85. package/dist/chunk-EC3JXT23.js.map +0 -1
  86. package/dist/chunk-ENET4IF6.js.map +0 -1
  87. package/dist/chunk-FACDJH6O.js.map +0 -1
  88. package/dist/chunk-H6WUOW5F.js +0 -35
  89. package/dist/chunk-H6WUOW5F.js.map +0 -1
  90. package/dist/chunk-JTMSFBCA.js.map +0 -1
  91. package/dist/chunk-MQZNDK5F.js.map +0 -1
  92. package/dist/chunk-SN64WNWE.js +0 -428
  93. package/dist/chunk-SN64WNWE.js.map +0 -1
  94. package/dist/chunk-U46LYYRA.js.map +0 -1
  95. package/dist/chunk-U672FZVC.js.map +0 -1
  96. package/dist/chunk-UE4Z3YMB.js.map +0 -1
  97. package/dist/chunk-XMQIWPIR.js.map +0 -1
  98. package/dist/chunk-ZBI6GFJD.js +0 -39
  99. package/dist/chunk-ZBI6GFJD.js.map +0 -1
  100. package/dist/load-agent-defs-5BSECHE6.js +0 -14
  101. /package/dist/{chunk-XYBHH3M5.js.map → chunk-WH7JXGDA.js.map} +0 -0
  102. /package/dist/{chunk-JNRACLNS.js.map → chunk-XSR4WRXJ.js.map} +0 -0
  103. /package/dist/{load-agent-defs-5BSECHE6.js.map → components/common/header-row.js.map} +0 -0
  104. /package/dist/{source-loader-E2Y5MMN5.js.map → load-agent-defs-OCFWOZD2.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,71 @@ 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.177.0] - 2026-11-04
11
+
12
+ **A refused `init --from` takes back every file, folder and marketplace registration it created and left empty, `uninstall` leaves what the global installation still holds and removes the trust and empty files its install added, `doctor`'s tip for a missing skill names only ways out that work, `edit` hands out the link it mints as `edit --from`, a switched-off Codex plugin left switched on exits 5, and `build plugins --agents-dir` is removed**
13
+
14
+ - CLI-1079: `build plugins` no longer builds agent plugins, and its `--agents-dir` (`-a`) flag is gone; either spelling exits 2 and writes nothing.
15
+ - CLI-1016: `init --from`, `edit --from` and `update` exit 5, not 1, when a Codex plugin you switched off is left switched on, naming the `enabled = false` fix.
16
+ - CLI-1058: a link `edit` or `edit --ui` mints from an installation is handed out as `edit --from <id>`; `share` keeps `init --from`.
17
+ - CLI-1078: `doctor`'s tip for a missing ejected skill names both ways out, `edit` to take it out and `eject skills` to bring it back.
18
+ - CLI-1095: the tip names only ways out that work.
19
+ - CLI-1098: with skills missing in both places, `doctor` gives the project's tip, then the home folder's.
20
+ - CLI-1099: a missing project skill the marketplace no longer publishes gets only the `edit` take-out.
21
+ - CLI-1102: so does a missing global skill the marketplace no longer publishes.
22
+ - CLI-1107: `doctor` reads the marketplace's own skill list to judge what it still publishes, not the loaded one.
23
+ - CLI-1108: from a project, a tip to run a command in your home folder names `--provider` exactly when home holds more than one installation.
24
+ - CLI-1026: `compile` and `doctor` say a Codex plugin you switched off is switched off, not missing.
25
+ - CLI-1029: `doctor` fails Codex's Config Valid row for a global Codex config that cannot be loaded, and exits 1.
26
+ - CLI-1085: `compile` and `edit --from` count a sub-agent file the run created as created.
27
+ - CLI-1028: in a Claude project under a home holding Codex, `init --from` reads Claude's global installation at every step.
28
+ - CLI-1030: a refused `init --from` leaves no blank global config and no empty folder it created.
29
+ - CLI-1035: a refused `init --from` removes the marketplace it registered with Claude, and says so.
30
+ - CLI-1048: on Codex too.
31
+ - CLI-1047: it deletes the Claude settings files it created and left empty.
32
+ - CLI-1077: and Claude's empty plugin registry and marketplaces folder, when it created them.
33
+ - CLI-1076: on Codex it leaves `$CODEX_HOME` as it found it, and a Codex project uninstall removes what it emptied.
34
+ - CLI-1074: it keeps a plugin it cannot tell it held, and says so.
35
+ - CLI-1087: and that plugin's marketplace, so the plugin stays on Claude.
36
+ - CLI-1088: Codex's can-not-list warnings no longer say it treats the list as empty.
37
+ - CLI-1031: a project `uninstall` leaves a plugin the global installation still holds.
38
+ - CLI-1032: a Codex `uninstall` leaves the project's `.claude/` alone.
39
+ - CLI-1024: a Codex project `uninstall` removes the project's trust from `$CODEX_HOME/config.toml`, and says so.
40
+ - CLI-1025: a Claude `uninstall` deletes a `.claude/settings.json` left holding an empty plugin list.
41
+ - CLI-1086: a project `uninstall` deletes a home config left listing nothing, and `~/.agents-inc/` once empty.
42
+ - CLI-1033: `list`'s ⏏ eject mark stays beside the name at 80 columns.
43
+ - CLI-1019: `share --stdin` refuses a carried skill whose id does not start with `external-`, before sending anything.
44
+ - CLI-1023: `stacks.schema.json` lists the built-in categories.
45
+ - CLI-1022: CI's CLI e2e job runs at a long `.claude` temp path, and the docs say `update` may be run again after exit 1.
46
+ - CLI-1027: CI's CLI unit job runs at the same path.
47
+ - CLI-1018: CI's CLI e2e job runs with a symlinked temp folder.
48
+ - CLI-1021: specs pin the success lines withheld when a switched-off Codex plugin is left switched on.
49
+ - CLI-1053: every plugin host must carry a take-back, by type and contract test.
50
+ - CLI-1075: a stand-in Claude case covers the settings files a refused `init --from` empties.
51
+ - CLI-1061: the journey page gains rows 86–99.
52
+ - CLI-1034: journey rows and the docs match the tree.
53
+ - CLI-1105: journey 13a's way out and journeys 2, 13, 38 and 51 are corrected.
54
+ - CLI-1083: the journey page names the spec behind each changed row.
55
+ - EDITOR-82: the Install dialog hands out `edit --from` for a link minted inside a project.
56
+ - EDITOR-127: and for a link from the global installation, to run in your home folder.
57
+ - EDITOR-88: step 02 no longer says it links plugins when there are none.
58
+ - EDITOR-128: with no id, a project link's step 02 says the bare `init` shows the dashboard.
59
+ - EDITOR-134: with no id elsewhere, it says the bare `init` opens the editor or shows the dashboard.
60
+ - EDITOR-135: the Codex no-id note wraps only between its parts.
61
+ - EDITOR-80: Tab onto the rail's buttons no longer scrolls the catalogue.
62
+ - EDITOR-81: typing in the composer or the stuck search no longer scrolls it.
63
+ - EDITOR-87: the docked composer sits on the bottom edge of a short page.
64
+ - EDITOR-84: search takes a space and matches each word.
65
+ - EDITOR-86: Enter in the Marketplace dialog loads the marketplace.
66
+ - EDITOR-83: the rail's marketplace name lines up and shows in full on hover.
67
+ - WWW-18: the docs site corrects three false claims about sub-agents, custom skills and `init`'s marketplace order.
68
+ - REPO-55: shared code across the repository, and the fixes its rounds found: `1 skill`, no home folder in Codex's trusted projects, `eject skills` naming what it leaves.
69
+ - REPO-50: comments added since 0.175.0 are trimmed, with no change in behaviour.
70
+ - REPO-57: git ignores `bun/` and `workboard-export.json`.
71
+ - REPO-60: the docs say when to raise `SEED_VERSION`; it stays 7.
72
+
73
+ See [changelogs/0.177.0.md](./changelogs/0.177.0.md) for full details.
74
+
10
75
  ## [0.176.0] - 2026-10-31
11
76
 
12
77
  **`update` moves every installed plugin to its newest version, every command checks a saved marketplace copy with no version stamp and falls back to it with a warning when a download fails, `init --from` takes back the skills and plugins it installed when it cannot save its configuration, a skill carried in a shared link must be named `external-…`, and the docs site gains a Releases section**
package/README.md CHANGED
@@ -106,7 +106,7 @@ Each subagent is composed from modular partials (role, workflow, output format)
106
106
  | `init` | Build a configuration in agentsinc.sh/editor, or install one by id with `--from` |
107
107
  | `edit` | Open this installation in agentsinc.sh/editor, or apply a configuration built there with `--from` |
108
108
  | `compile` | Recompile subagents after changes |
109
- | `update` | Refresh the marketplaces this installation uses (ejected skills are yours) |
109
+ | `update` | Refresh the marketplaces and move every plugin to its newest version (ejected skills are yours) |
110
110
  | `search` | Search this installation's marketplace and your local skills |
111
111
  | `share` | Share this installation as an id anyone can install |
112
112
 
@@ -121,7 +121,7 @@ Each subagent is composed from modular partials (role, workflow, output format)
121
121
  | Command | Description |
122
122
  | ------------------- | ---------------------------------------------- |
123
123
  | `build marketplace` | Generate `marketplace.json` from built plugins |
124
- | `build plugins` | Build skill and agent plugins for distribution |
124
+ | `build plugins` | Build skill plugins for distribution |
125
125
  | `new marketplace` | Scaffold a marketplace of your own |
126
126
 
127
127
  ### Diagnostics
@@ -1,28 +1,23 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- typedValues
4
- } from "./chunk-UE4Z3YMB.js";
5
2
  import {
6
3
  isActiveAt,
7
- isGlobalTombstone
8
- } from "./chunk-U46LYYRA.js";
4
+ isGlobalTombstone,
5
+ typedValues
6
+ } from "./chunk-4SIBDIIO.js";
9
7
 
10
8
  // src/cli/lib/configuration/scope-diff.ts
11
9
  import { difference, indexBy, partition, unique } from "remeda";
12
10
  var NOTHING = /* @__PURE__ */ new Set();
13
11
  function computeScopeDiff(input) {
14
- const { currentSkills, currentAgents, installedSkillConfigs, installedAgentConfigs, isInitMode } = input;
12
+ const { currentSkills, currentAgents, isInitMode } = input;
13
+ const installedSkills = input.installedSkillConfigs ?? [];
14
+ const installedAgents = input.installedAgentConfigs ?? [];
15
15
  const overwritten = input.overwrittenSkillIds ?? NOTHING;
16
16
  const changed = input.changedAgentNames ?? NOTHING;
17
- const skills = diffRoster(currentSkills, installedSkillConfigs, (skill) => skill.id, isInitMode);
18
- const agents = diffRoster(
19
- currentAgents,
20
- installedAgentConfigs,
21
- (agent) => agent.name,
22
- isInitMode
23
- );
24
- const skillRow = skillRowClassifier(installedSkillConfigs, overwritten);
25
- const agentRow = agentRowClassifier(installedAgentConfigs, changed);
17
+ const skills = diffRoster(currentSkills, installedSkills, (skill) => skill.id, isInitMode);
18
+ const agents = diffRoster(currentAgents, installedAgents, (agent) => agent.name, isInitMode);
19
+ const skillRow = skillRowClassifier(installedSkills, overwritten);
20
+ const agentRow = agentRowClassifier(installedAgents, changed);
26
21
  const projectSkillRows = rowsOf(skills.project, skillRow, toRemovedSkillRow);
27
22
  const globalSkillRows = rowsOf(skills.global, skillRow, toRemovedSkillRow);
28
23
  const projectAgentRows = rowsOf(agents.project, agentRow, toRemovedAgentRow);
@@ -33,7 +28,7 @@ function computeScopeDiff(input) {
33
28
  return { projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows, hasContent };
34
29
  }
35
30
  function diffRoster(current, installed, identityOf, isInitMode) {
36
- const activeBaseline = (installed ?? []).filter((entry) => !entry.excluded);
31
+ const activeBaseline = installed.filter((entry) => !entry.excluded);
37
32
  const vacated = vacatedInstalls(activeBaseline, current, identityOf);
38
33
  const projectEntries = current.filter((entry) => isActiveAt(entry, "project"));
39
34
  const claimedByProject = new Set(projectEntries.map(identityOf));
@@ -71,10 +66,10 @@ function formatScopeTag(scope) {
71
66
  return scope === "global" ? "[G]" : "[P]";
72
67
  }
73
68
  function skillRowClassifier(installed, overwritten) {
74
- const installedSlots = installed ? new Set(installed.map((skill) => slotKey(skill.id, skill.scope))) : null;
75
- const installedOriginBySlot = installed ? new Map(
69
+ const installedSlots = new Set(installed.map((skill) => slotKey(skill.id, skill.scope)));
70
+ const installedOriginBySlot = new Map(
76
71
  installed.filter((skill) => !skill.excluded).map((skill) => [slotKey(skill.id, skill.scope), skill.origin])
77
- ) : null;
72
+ );
78
73
  return (skill) => ({
79
74
  id: skill.id,
80
75
  source: skill.origin,
@@ -86,20 +81,19 @@ function recordedNameOf(skill) {
86
81
  return skill.displayName === void 0 ? {} : { displayName: skill.displayName };
87
82
  }
88
83
  function agentRowClassifier(installed, changed) {
89
- const installedSlots = installed ? new Set(installed.map((agent) => slotKey(agent.name, agent.scope))) : null;
84
+ const installedSlots = new Set(installed.map((agent) => slotKey(agent.name, agent.scope)));
90
85
  return (agent) => ({ name: agent.name, status: agentStatus(agent, installedSlots, changed) });
91
86
  }
92
87
  function skillStatus(skill, installedSlots, installedOriginBySlot, overwritten) {
93
88
  const slot = slotKey(skill.id, skill.scope);
94
- if (installedSlots === null || !installedSlots.has(slot)) return "added";
89
+ if (!installedSlots.has(slot)) return "added";
95
90
  if (!skill.excluded && overwritten.has(skill.id)) return "overwritten";
96
- const installedOrigin = installedOriginBySlot?.get(slot);
97
- const modeChanged = installedOrigin != null && installedOrigin !== skill.origin;
91
+ const installedOrigin = installedOriginBySlot.get(slot);
92
+ const modeChanged = installedOrigin !== void 0 && installedOrigin !== skill.origin;
98
93
  return modeChanged ? "mode-changed" : "unchanged";
99
94
  }
100
95
  function agentStatus(agent, installedSlots, changed) {
101
- const isNew = installedSlots === null || !installedSlots.has(slotKey(agent.name, agent.scope));
102
- if (isNew) return "added";
96
+ if (!installedSlots.has(slotKey(agent.name, agent.scope))) return "added";
103
97
  return !agent.excluded && changed.has(agent.name) ? "changed" : "unchanged";
104
98
  }
105
99
  function toRemovedSkillRow(skill) {
@@ -167,4 +161,4 @@ export {
167
161
  namedByActiveEntries,
168
162
  agentChangesAmong
169
163
  };
170
- //# sourceMappingURL=chunk-FACDJH6O.js.map
164
+ //# sourceMappingURL=chunk-2FE4AJNC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli/lib/configuration/scope-diff.ts"],"sourcesContent":["import { difference, indexBy, partition, unique } from \"remeda\";\nimport type { AgentScopeConfig, SkillConfig, SkillScope } from \"../../types/config\";\nimport type { AgentName, SkillId, StackAgentConfig } from \"../../types/index\";\nimport { typedValues } from \"../../utils/typed-object\";\nimport { isActiveAt, isGlobalTombstone, type ScopedEntry } from \"./scope-predicates\";\n\nexport type ScopeDiffInput = {\n currentSkills: SkillConfig[];\n currentAgents: AgentScopeConfig[];\n installedSkillConfigs: SkillConfig[] | null;\n installedAgentConfigs: AgentScopeConfig[] | null;\n isInitMode: boolean;\n /** Skills whose files the run writes over where they stand. */\n overwrittenSkillIds?: ReadonlySet<SkillId>;\n /** Sub-agents that keep their slot and still change. */\n changedAgentNames?: ReadonlySet<AgentName>;\n};\n\nexport type DiffRowStatus =\n \"added\" | \"mode-changed\" | \"overwritten\" | \"changed\" | \"removed\" | \"unchanged\";\n\nexport type SkillDiffRow = {\n id: SkillId;\n source: string;\n status: Exclude<DiffRowStatus, \"changed\">;\n /** The name the entry the row was drawn from records; absent where it records none. */\n displayName?: string;\n};\n\nexport type AgentDiffRow = {\n name: AgentName;\n status: Exclude<DiffRowStatus, \"mode-changed\" | \"overwritten\">;\n};\n\nexport type ScopeDiff = {\n projectSkillRows: SkillDiffRow[];\n globalSkillRows: SkillDiffRow[];\n projectAgentRows: AgentDiffRow[];\n globalAgentRows: AgentDiffRow[];\n hasContent: boolean;\n};\n\nconst NOTHING: ReadonlySet<never> = new Set();\n\n/** One scope's share of a roster's diff: the entries listed with a status, then the removals. */\ntype ScopeEntries<Entry> = { listed: Entry[]; removed: Entry[] };\n\ntype RosterDiff<Entry> = Record<SkillScope, ScopeEntries<Entry>>;\n\n/**\n * A tombstone occupies its (id, scope) slot without filling it: it silences a global install at\n * project scope. Slot checks count tombstones; removal and `~` read the active baseline only.\n */\nexport function computeScopeDiff(input: ScopeDiffInput): ScopeDiff {\n const { currentSkills, currentAgents, isInitMode } = input;\n const installedSkills = input.installedSkillConfigs ?? [];\n const installedAgents = input.installedAgentConfigs ?? [];\n const overwritten = input.overwrittenSkillIds ?? NOTHING;\n const changed = input.changedAgentNames ?? NOTHING;\n\n const skills = diffRoster(currentSkills, installedSkills, (skill) => skill.id, isInitMode);\n const agents = diffRoster(currentAgents, installedAgents, (agent) => agent.name, isInitMode);\n const skillRow = skillRowClassifier(installedSkills, overwritten);\n const agentRow = agentRowClassifier(installedAgents, changed);\n\n const projectSkillRows = rowsOf(skills.project, skillRow, toRemovedSkillRow);\n const globalSkillRows = rowsOf(skills.global, skillRow, toRemovedSkillRow);\n const projectAgentRows = rowsOf(agents.project, agentRow, toRemovedAgentRow);\n const globalAgentRows = rowsOf(agents.global, agentRow, toRemovedAgentRow);\n\n const hasContent = [projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows].some(\n (rows) => rows.length > 0,\n );\n\n return { projectSkillRows, globalSkillRows, projectAgentRows, globalAgentRows, hasContent };\n}\n\nfunction diffRoster<Entry extends ScopedEntry>(\n current: Entry[],\n installed: Entry[],\n identityOf: (entry: Entry) => string,\n isInitMode: boolean,\n): RosterDiff<Entry> {\n // The installs the baseline actually records; tombstones are not installs.\n const activeBaseline = installed.filter((entry) => !entry.excluded);\n const vacated = vacatedInstalls(activeBaseline, current, identityOf);\n const projectEntries = current.filter((entry) => isActiveAt(entry, \"project\"));\n const claimedByProject = new Set(projectEntries.map(identityOf));\n // A vacated global the project claims is inherited: listed once under Global, never removed.\n const [inheritedGlobals, removedGlobals] = partition(\n vacated.filter((entry) => entry.scope === \"global\"),\n (entry) => claimedByProject.has(identityOf(entry)),\n );\n\n return {\n project: {\n listed: projectEntries,\n removed: vacated.filter((entry) => entry.scope === \"project\"),\n },\n global: {\n listed: [\n ...current.filter((entry) => isActiveAt(entry, \"global\")),\n ...inheritedGlobals,\n ...current.filter(isGlobalTombstone),\n ],\n removed: isInitMode ? [] : removedGlobals,\n },\n };\n}\n\n/** Baseline installs whose slot nothing in current, active or tombstone, occupies. */\nfunction vacatedInstalls<Entry extends ScopedEntry>(\n activeBaseline: Entry[],\n current: Entry[],\n identityOf: (entry: Entry) => string,\n): Entry[] {\n const slotOf = (entry: Entry) => slotKey(identityOf(entry), entry.scope);\n const occupiedSlots = new Set(current.map(slotOf));\n return activeBaseline.filter((install) => !occupiedSlots.has(slotOf(install)));\n}\n\nfunction rowsOf<Entry, Row>(\n entries: ScopeEntries<Entry>,\n toRow: (entry: Entry) => Row,\n toRemovedRow: (entry: Entry) => Row,\n): Row[] {\n return [...entries.listed.map(toRow), ...entries.removed.map(toRemovedRow)];\n}\n\n/** The `(id, scope)` SLOT key this module diffs on, rather than the id alone. */\nfunction slotKey(identity: string, scope: SkillScope | undefined): string {\n return `${identity}:${scope}`;\n}\n\nexport function formatScopeTag(scope: SkillScope): \"[G]\" | \"[P]\" {\n return scope === \"global\" ? \"[G]\" : \"[P]\";\n}\n\nfunction skillRowClassifier(\n installed: SkillConfig[],\n overwritten: ReadonlySet<SkillId>,\n): (skill: SkillConfig) => SkillDiffRow {\n const installedSlots = new Set(installed.map((skill) => slotKey(skill.id, skill.scope)));\n const installedOriginBySlot = new Map(\n installed\n .filter((skill) => !skill.excluded)\n .map((skill) => [slotKey(skill.id, skill.scope), skill.origin]),\n );\n return (skill) => ({\n id: skill.id,\n source: skill.origin,\n status: skillStatus(skill, installedSlots, installedOriginBySlot, overwritten),\n ...recordedNameOf(skill),\n });\n}\n\nfunction recordedNameOf(skill: SkillConfig): Pick<SkillDiffRow, \"displayName\"> {\n return skill.displayName === undefined ? {} : { displayName: skill.displayName };\n}\n\nfunction agentRowClassifier(\n installed: AgentScopeConfig[],\n changed: ReadonlySet<AgentName>,\n): (agent: AgentScopeConfig) => AgentDiffRow {\n const installedSlots = new Set(installed.map((agent) => slotKey(agent.name, agent.scope)));\n return (agent) => ({ name: agent.name, status: agentStatus(agent, installedSlots, changed) });\n}\n\n/**\n * Compares `origin`, which is where a skill's install mode is recorded. An overwrite outranks a\n * mode change: a copy its plugin replaces is deleted, not merely switched. A mask is never written.\n */\nfunction skillStatus(\n skill: SkillConfig,\n installedSlots: ReadonlySet<string>,\n installedOriginBySlot: ReadonlyMap<string, string>,\n overwritten: ReadonlySet<SkillId>,\n): SkillDiffRow[\"status\"] {\n const slot = slotKey(skill.id, skill.scope);\n if (!installedSlots.has(slot)) return \"added\";\n if (!skill.excluded && overwritten.has(skill.id)) return \"overwritten\";\n\n const installedOrigin = installedOriginBySlot.get(slot);\n const modeChanged = installedOrigin !== undefined && installedOrigin !== skill.origin;\n return modeChanged ? \"mode-changed\" : \"unchanged\";\n}\n\n/** A mask is never the sub-agent that changes: its active half is. */\nfunction agentStatus(\n agent: AgentScopeConfig,\n installedSlots: ReadonlySet<string>,\n changed: ReadonlySet<AgentName>,\n): AgentDiffRow[\"status\"] {\n if (!installedSlots.has(slotKey(agent.name, agent.scope))) return \"added\";\n return !agent.excluded && changed.has(agent.name) ? \"changed\" : \"unchanged\";\n}\n\nfunction toRemovedSkillRow(skill: SkillConfig): SkillDiffRow {\n return { id: skill.id, source: skill.origin, status: \"removed\", ...recordedNameOf(skill) };\n}\n\nfunction toRemovedAgentRow(agent: AgentScopeConfig): AgentDiffRow {\n return { name: agent.name, status: \"removed\" };\n}\n\n/** The entry each skill is named by, as a panel row drawn from that entry names it. */\nexport type NamedBy = Partial<Record<SkillId, Pick<SkillConfig, \"id\" | \"displayName\">>>;\n\nexport function namedByActiveEntries(\n entries: readonly Pick<SkillConfig, \"id\" | \"displayName\" | \"excluded\">[],\n): NamedBy {\n return indexBy(\n entries.filter((entry) => !entry.excluded),\n ({ id }) => id,\n );\n}\n\n/** A sub-agent that keeps its slot and still changes: the skills its rows gain and lose, and its retunes. */\nexport type AgentChange = {\n name: AgentName;\n scope: SkillScope;\n gains: SkillId[];\n loses: SkillId[];\n settings: SettingChange[];\n /** The run's entry for a skill it gains, the install's for one it loses. */\n namedBy?: NamedBy;\n};\n\n/** `undefined` where the setting is left to its default. */\nexport type SettingChange = {\n setting: AgentSetting;\n from: string | undefined;\n to: string | undefined;\n};\n\ntype AgentSetting = \"model\" | \"codex model\" | \"effort\";\n\nconst AGENT_SETTINGS: ReadonlyArray<\n [AgentSetting, (agent: AgentScopeConfig) => string | undefined]\n> = [\n [\"model\", (agent) => agent.model],\n [\"codex model\", (agent) => agent.codexModel],\n [\"effort\", (agent) => agent.effort],\n];\n\n/** One sub-agent as a config records it: its entry and its skill rows. */\nexport type AgentState = { agent: AgentScopeConfig; rows: StackAgentConfig | undefined };\n\ntype AgentsAndRows = {\n agents: AgentScopeConfig[];\n skills: SkillConfig[];\n stack?: Partial<Record<string, StackAgentConfig>>;\n};\n\n/** How each named sub-agent moves between two configs; one either config lacks is not named. */\nexport function agentChangesAmong(\n names: readonly AgentName[],\n before: AgentsAndRows,\n after: AgentsAndRows,\n): AgentChange[] {\n return names.flatMap((name) => {\n const was = agentStateIn(before, name);\n const is = agentStateIn(after, name);\n if (was === undefined || is === undefined) return [];\n return [namedByEntries(agentChange(was, is), before.skills, after.skills)];\n });\n}\n\nfunction namedByEntries(\n change: AgentChange,\n before: SkillConfig[],\n after: SkillConfig[],\n): AgentChange {\n const namedBy = {\n ...activeEntriesOf(change.loses, before),\n ...activeEntriesOf(change.gains, after),\n };\n return { ...change, namedBy };\n}\n\nfunction activeEntriesOf(skillIds: readonly SkillId[], skills: SkillConfig[]): NamedBy {\n return namedByActiveEntries(skills.filter((entry) => skillIds.includes(entry.id)));\n}\n\n/** Its active entry, never the mask a project's own copy leaves; `undefined` where none is. */\nfunction agentStateIn(config: AgentsAndRows, name: AgentName): AgentState | undefined {\n const agent = config.agents.find((entry) => entry.name === name && !entry.excluded);\n return agent === undefined ? undefined : { agent, rows: config.stack?.[name] };\n}\n\nexport function agentChange(before: AgentState, after: AgentState): AgentChange {\n const beforeIds = assignedSkillIds(before.rows);\n const afterIds = assignedSkillIds(after.rows);\n\n return {\n name: after.agent.name,\n scope: after.agent.scope,\n gains: difference(afterIds, beforeIds),\n loses: difference(beforeIds, afterIds),\n settings: settingChanges(before.agent, after.agent),\n };\n}\n\nfunction settingChanges(before: AgentScopeConfig, after: AgentScopeConfig): SettingChange[] {\n return AGENT_SETTINGS.filter(([, read]) => read(before) !== read(after)).map(\n ([setting, read]) => ({ setting, from: read(before), to: read(after) }),\n );\n}\n\nfunction assignedSkillIds(rows: StackAgentConfig | undefined): SkillId[] {\n return unique(typedValues(rows ?? {}).flatMap((assignments) => assignments.map(({ id }) => id)));\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,YAAY,SAAS,WAAW,cAAc;AA0CvD,IAAM,UAA8B,oBAAI,IAAI;AAWrC,SAAS,iBAAiB,OAAkC;AACjE,QAAM,EAAE,eAAe,eAAe,WAAW,IAAI;AACrD,QAAM,kBAAkB,MAAM,yBAAyB,CAAC;AACxD,QAAM,kBAAkB,MAAM,yBAAyB,CAAC;AACxD,QAAM,cAAc,MAAM,uBAAuB;AACjD,QAAM,UAAU,MAAM,qBAAqB;AAE3C,QAAM,SAAS,WAAW,eAAe,iBAAiB,CAAC,UAAU,MAAM,IAAI,UAAU;AACzF,QAAM,SAAS,WAAW,eAAe,iBAAiB,CAAC,UAAU,MAAM,MAAM,UAAU;AAC3F,QAAM,WAAW,mBAAmB,iBAAiB,WAAW;AAChE,QAAM,WAAW,mBAAmB,iBAAiB,OAAO;AAE5D,QAAM,mBAAmB,OAAO,OAAO,SAAS,UAAU,iBAAiB;AAC3E,QAAM,kBAAkB,OAAO,OAAO,QAAQ,UAAU,iBAAiB;AACzE,QAAM,mBAAmB,OAAO,OAAO,SAAS,UAAU,iBAAiB;AAC3E,QAAM,kBAAkB,OAAO,OAAO,QAAQ,UAAU,iBAAiB;AAEzE,QAAM,aAAa,CAAC,kBAAkB,iBAAiB,kBAAkB,eAAe,EAAE;AAAA,IACxF,CAAC,SAAS,KAAK,SAAS;AAAA,EAC1B;AAEA,SAAO,EAAE,kBAAkB,iBAAiB,kBAAkB,iBAAiB,WAAW;AAC5F;AAEA,SAAS,WACP,SACA,WACA,YACA,YACmB;AAEnB,QAAM,iBAAiB,UAAU,OAAO,CAAC,UAAU,CAAC,MAAM,QAAQ;AAClE,QAAM,UAAU,gBAAgB,gBAAgB,SAAS,UAAU;AACnE,QAAM,iBAAiB,QAAQ,O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AC,MAAM,QAAQ;AAClF,SAAO,UAAU,SAAY,SAAY,EAAE,OAAO,MAAM,OAAO,QAAQ,IAAI,EAAE;AAC/E;AAEO,SAAS,YAAY,QAAoB,OAAgC;AAC9E,QAAM,YAAY,iBAAiB,OAAO,IAAI;AAC9C,QAAM,WAAW,iBAAiB,MAAM,IAAI;AAE5C,SAAO;AAAA,IACL,MAAM,MAAM,MAAM;AAAA,IAClB,OAAO,MAAM,MAAM;AAAA,IACnB,OAAO,WAAW,UAAU,SAAS;AAAA,IACrC,OAAO,WAAW,WAAW,QAAQ;AAAA,IACrC,UAAU,eAAe,OAAO,OAAO,MAAM,KAAK;AAAA,EACpD;AACF;AAEA,SAAS,eAAe,QAA0B,OAA0C;AAC1F,SAAO,eAAe,OAAO,CAAC,CAAC,EAAE,IAAI,MAAM,KAAK,MAAM,MAAM,KAAK,KAAK,CAAC,EAAE;AAAA,IACvE,CAAC,CAAC,SAAS,IAAI,OAAO,EAAE,SAAS,MAAM,KAAK,MAAM,GAAG,IAAI,KAAK,KAAK,EAAE;AAAA,EACvE;AACF;AAEA,SAAS,iBAAiB,MAA+C;AACvE,SAAO,OAAO,YAAY,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,gBAAgB,YAAY,IAAI,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;AACjG;","names":[]}
@@ -1,5 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ // ../compile/src/typed-object.ts
4
+ function typedEntries(obj) {
5
+ return Object.entries(obj);
6
+ }
7
+ function typedKeys(obj) {
8
+ return Object.keys(obj);
9
+ }
10
+ function typedFromEntries(entries) {
11
+ return Object.fromEntries(entries);
12
+ }
13
+ function typedValues(obj) {
14
+ return Object.values(obj).filter((value) => value !== void 0);
15
+ }
16
+
3
17
  // ../compile/src/string.ts
4
18
  function bytewise(a, b) {
5
19
  return a < b ? -1 : a > b ? 1 : 0;
@@ -99,9 +113,20 @@ function effectivelyExcludedSkillIds(skills) {
99
113
  }
100
114
 
101
115
  // ../compile/src/catalog.ts
116
+ import { groupBy } from "remeda";
102
117
  function isExclusiveCategory(catalog, category) {
103
118
  return catalog.categories[category]?.exclusive === true;
104
119
  }
120
+ function isInCatalog(entry) {
121
+ return entry.skill != null;
122
+ }
123
+ function skillIdsByCategory(entries) {
124
+ return new Map(
125
+ typedEntries(groupBy(entries, (entry) => entry.category)).map(
126
+ ([category, grouped]) => [category, grouped.map((entry) => entry.skillId)]
127
+ )
128
+ );
129
+ }
105
130
  function categoryDomain(catalog, category) {
106
131
  return catalog.categories[category]?.domain;
107
132
  }
@@ -496,7 +521,7 @@ var AGENT_NAMES = [
496
521
  ];
497
522
 
498
523
  // ../matrix/src/read-model/collections.ts
499
- var groupBy = (items, keyOf) => {
524
+ var groupBy2 = (items, keyOf) => {
500
525
  const groups = /* @__PURE__ */ new Map();
501
526
  for (const item of items) {
502
527
  const key = keyOf(item);
@@ -9961,14 +9986,14 @@ var toCatalogDomain = (id, categories) => ({
9961
9986
  )
9962
9987
  });
9963
9988
  var buildCatalog = (matrix) => {
9964
- const skillsByCategory = groupBy(
9989
+ const skillsByCategory = groupBy2(
9965
9990
  Object.values(matrix.skills),
9966
9991
  (skill) => skill.category
9967
9992
  );
9968
9993
  const categories = placeableCategories(matrix.categories).sort(byDomainThenAuthoredOrder).map(
9969
9994
  (category) => toCatalogCategory(category, skillsByCategory.get(category.id) ?? [])
9970
9995
  );
9971
- const domains = [...groupBy(categories, (category) => category.domainId)].sort(([a], [b]) => compareDomains(a, b)).map(([id, domainCategories]) => toCatalogDomain(id, domainCategories));
9996
+ const domains = [...groupBy2(categories, (category) => category.domainId)].sort(([a], [b]) => compareDomains(a, b)).map(([id, domainCategories]) => toCatalogDomain(id, domainCategories));
9972
9997
  const allSkills = categories.flatMap((category) => category.skills);
9973
9998
  return {
9974
9999
  domains,
@@ -10394,7 +10419,7 @@ var buildSubAgentGroups = () => {
10394
10419
  const agents = Object.values(
10395
10420
  agentDefinitionsSchema.parse(AGENT_DEFINITIONS)
10396
10421
  ).map(toSubAgent);
10397
- return [...groupBy(agents, (agent) => agent.domainId)].sort(([a], [b]) => compareDomains(a, b)).map(([domainId, domainAgents]) => toSubAgentGroup(domainId, domainAgents));
10422
+ return [...groupBy2(agents, (agent) => agent.domainId)].sort(([a], [b]) => compareDomains(a, b)).map(([domainId, domainAgents]) => toSubAgentGroup(domainId, domainAgents));
10398
10423
  };
10399
10424
  var SUB_AGENT_GROUPS = buildSubAgentGroups();
10400
10425
  var SUB_AGENTS_BY_ID = indexById(
@@ -10512,20 +10537,24 @@ var DEFAULT_SELECTION_OPTIONS = {
10512
10537
  // ../matrix/src/read-model/selection-semantics.ts
10513
10538
  var isAmbiguous = (requirement) => requirement.needsAny && requirement.skillIds.length > 1;
10514
10539
  var reasonDiscouraging = (declarer, otherId) => declarer?.discourages.find((relation) => relation.skillId === otherId)?.reason;
10515
- var createSelectionSemantics = (catalog) => {
10516
- const skillsById = new Map(catalog.skills.map((skill) => [skill.id, skill]));
10540
+ var symmetricConflictsOf = (skills) => {
10517
10541
  const conflictIdsBySkill = /* @__PURE__ */ new Map();
10518
10542
  const noteConflict = (skillId, otherId) => {
10519
10543
  const held = conflictIdsBySkill.get(skillId);
10520
10544
  if (held) held.add(otherId);
10521
10545
  else conflictIdsBySkill.set(skillId, /* @__PURE__ */ new Set([otherId]));
10522
10546
  };
10523
- for (const skill of catalog.skills) {
10547
+ for (const skill of skills) {
10524
10548
  for (const otherId of skill.conflictsWith) {
10525
10549
  noteConflict(skill.id, otherId);
10526
10550
  noteConflict(otherId, skill.id);
10527
10551
  }
10528
10552
  }
10553
+ return conflictIdsBySkill;
10554
+ };
10555
+ var createSelectionSemantics = (catalog) => {
10556
+ const skillsById = new Map(catalog.skills.map((skill) => [skill.id, skill]));
10557
+ const conflictIdsBySkill = symmetricConflictsOf(catalog.skills);
10529
10558
  const mustHold = (skillId) => {
10530
10559
  const skill = skillsById.get(skillId);
10531
10560
  if (!skill) throw new Error(`Skill not found: ${skillId}`);
@@ -10737,6 +10766,8 @@ var seedPayloadSchema = z3.object({
10737
10766
  marketplace: z3.string().exactOptional(),
10738
10767
  // Minted inside a project, whose run adds to the global install but changes nothing it holds.
10739
10768
  fromProject: z3.literal(true).exactOptional(),
10769
+ // Minted from the global installation, which `edit --from` applies it back to; nothing is held.
10770
+ fromGlobal: z3.literal(true).exactOptional(),
10740
10771
  // Presence is selection.
10741
10772
  skills: z3.record(z3.string(), seedSkillSchema),
10742
10773
  // For ids no catalogue can resolve.
@@ -10883,7 +10914,7 @@ function orderDomains(domains) {
10883
10914
  }
10884
10915
 
10885
10916
  // ../compile/src/selection.ts
10886
- import { groupBy as groupBy2 } from "remeda";
10917
+ import { groupBy as groupBy3 } from "remeda";
10887
10918
  function skillOrThrow(catalog, id) {
10888
10919
  const skill = catalog.skills[id];
10889
10920
  if (!skill) throw new Error(`Skill not found: ${id}`);
@@ -10946,11 +10977,9 @@ function labelsOf(catalog, ids) {
10946
10977
  return ids.map((id) => labelOf2(catalog, id)).join(", ");
10947
10978
  }
10948
10979
  function validateExclusivity(catalog, selections) {
10949
- const resolved = selections.map((skillId) => ({ skillId, skill: catalog.skills[skillId] })).filter(
10950
- (entry) => entry.skill != null
10951
- );
10980
+ const resolved = selections.map((skillId) => ({ skillId, skill: catalog.skills[skillId] })).filter(isInCatalog);
10952
10981
  return Object.entries(
10953
- groupBy2(resolved, (entry) => entry.skill.category)
10982
+ groupBy3(resolved, (entry) => entry.skill.category)
10954
10983
  ).flatMap(
10955
10984
  ([categoryId, entries]) => exclusivityBreach(
10956
10985
  catalog,
@@ -11131,7 +11160,13 @@ var ASCII_LOGO = ` \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u258
11131
11160
  \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D`;
11132
11161
 
11133
11162
  export {
11163
+ typedEntries,
11164
+ typedKeys,
11165
+ typedFromEntries,
11166
+ typedValues,
11134
11167
  isExclusiveCategory,
11168
+ isInCatalog,
11169
+ skillIdsByCategory,
11135
11170
  categoryDomain,
11136
11171
  skillDomain,
11137
11172
  byCategoryDeclarationOrder,
@@ -11142,6 +11177,7 @@ export {
11142
11177
  CODEX_MODEL_NAMES,
11143
11178
  EFFORT_NAMES,
11144
11179
  resolveLoadState,
11180
+ isAgentName,
11145
11181
  resolveAssignment,
11146
11182
  SEED_VERSION,
11147
11183
  seedModelSchema,
@@ -11226,4 +11262,4 @@ export {
11226
11262
  CLI_COLORS,
11227
11263
  ASCII_LOGO
11228
11264
  };
11229
- //# sourceMappingURL=chunk-U46LYYRA.js.map
11265
+ //# sourceMappingURL=chunk-4SIBDIIO.js.map