agents-inc 0.166.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.
- package/CHANGELOG.md +18 -0
- package/dist/{chunk-TZ2YJJKK.js → chunk-23DNVNFP.js} +5 -5
- package/dist/{chunk-ZXKBERQU.js → chunk-27AVGFXH.js} +2 -2
- package/dist/{chunk-SXVHSOTH.js → chunk-3DIDV6H3.js} +4 -4
- package/dist/{chunk-GE3WKJ6Q.js → chunk-3LZNY46H.js} +4 -4
- package/dist/{chunk-Y47EV74W.js → chunk-4DRFEYCE.js} +10 -13
- package/dist/chunk-4DRFEYCE.js.map +1 -0
- package/dist/{chunk-MPTNC32T.js → chunk-4HWOYYY7.js} +3 -3
- package/dist/{chunk-MAWNVT2C.js → chunk-4UKMQUAU.js} +4 -4
- package/dist/{chunk-G6UREQ4V.js → chunk-5JUQKGCP.js} +9 -9
- package/dist/{chunk-T6UWJAB3.js → chunk-6WGXTB2L.js} +2 -2
- package/dist/{chunk-SAYZWCH6.js → chunk-7PYXS2QU.js} +2 -2
- package/dist/{chunk-ENGYJCTF.js → chunk-AG3ZVM3B.js} +35 -45
- package/dist/{chunk-ENGYJCTF.js.map → chunk-AG3ZVM3B.js.map} +1 -1
- package/dist/{chunk-A4KDXNOT.js → chunk-C2UISKIM.js} +66 -104
- package/dist/chunk-C2UISKIM.js.map +1 -0
- package/dist/{chunk-RZDXDMT6.js → chunk-CMJBKQUH.js} +2 -2
- package/dist/{chunk-XZEVWPX6.js → chunk-DJEO3F2H.js} +7 -7
- package/dist/{chunk-V3I7VQ7N.js → chunk-EH2PGPLP.js} +5 -5
- package/dist/chunk-EH2PGPLP.js.map +1 -0
- package/dist/{chunk-PMJWD27C.js → chunk-GE7NUPMI.js} +3 -3
- package/dist/{chunk-PNB3524H.js → chunk-GRL73YPF.js} +5 -5
- package/dist/{chunk-Y3VIRVVE.js → chunk-H4ZKGGTE.js} +6 -6
- package/dist/{chunk-LFWLEDUG.js → chunk-HI6YB7XP.js} +6 -6
- package/dist/{chunk-SCOQ34YM.js → chunk-HL3GYRMR.js} +2 -2
- package/dist/{chunk-NBXXFIIW.js → chunk-HR7TK2XW.js} +3 -3
- package/dist/{chunk-ZR4YPKXQ.js → chunk-JIBCVXXL.js} +4 -4
- package/dist/{chunk-JQRJQ4SS.js → chunk-JPMV4E4E.js} +3 -3
- package/dist/{chunk-4NDBUJHK.js → chunk-JVUN6AOO.js} +8 -8
- package/dist/{chunk-RAHSOJQ2.js → chunk-KQ3PDARZ.js} +2 -2
- package/dist/{chunk-PXWG7KFO.js → chunk-KTLKR4YY.js} +2 -2
- package/dist/{chunk-6L75SQZU.js → chunk-L3W2JWBA.js} +2 -2
- package/dist/{chunk-TTY6DPJN.js → chunk-LFUJCRCT.js} +3 -3
- package/dist/{chunk-V5WXIM2F.js → chunk-NU2K5G54.js} +2 -2
- package/dist/{chunk-G4JK7WVO.js → chunk-P6I72PR3.js} +15 -15
- package/dist/{chunk-WWIFNPJG.js → chunk-PCFUXQJA.js} +12 -12
- package/dist/{chunk-DAIEQJIF.js → chunk-PLX2FLEQ.js} +3 -3
- package/dist/{chunk-2VUYFTUB.js → chunk-QWFG7Y3R.js} +6 -6
- package/dist/{chunk-WVUDLKIO.js → chunk-SLBL3WIP.js} +2 -2
- package/dist/{chunk-HWEKHVLE.js → chunk-TW35AEB4.js} +6 -6
- package/dist/{chunk-VAPTVR3J.js → chunk-VVRI35SK.js} +3 -3
- package/dist/{chunk-6LF4CQBY.js → chunk-W5KEYSOL.js} +2 -2
- package/dist/{chunk-TODCQFRB.js → chunk-W6GO2CYX.js} +2 -2
- package/dist/{chunk-7JNJ52CD.js → chunk-WNLF5EDZ.js} +7 -16
- package/dist/chunk-WNLF5EDZ.js.map +1 -0
- package/dist/{chunk-HHIYT3PI.js → chunk-X6ZZEYO3.js} +4 -4
- package/dist/{chunk-QHDPLLK6.js → chunk-YN3SWF53.js} +3 -3
- package/dist/{chunk-25MPBIK3.js → chunk-ZUGH4MQG.js} +3 -3
- package/dist/commands/build/marketplace.js +6 -6
- package/dist/commands/build/plugins.js +8 -8
- package/dist/commands/compile.js +14 -14
- package/dist/commands/doctor.js +13 -13
- package/dist/commands/edit.js +71 -242
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +12 -12
- package/dist/commands/init.js +39 -39
- package/dist/commands/list.js +9 -9
- package/dist/commands/new/marketplace.js +6 -6
- package/dist/commands/search.js +11 -11
- package/dist/commands/share.js +11 -11
- package/dist/commands/uninstall.js +13 -13
- package/dist/commands/update.js +8 -8
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/wizard/category-grid.js +4 -4
- package/dist/components/wizard/checkbox-grid.js +4 -4
- package/dist/components/wizard/domain-selection.js +9 -9
- package/dist/components/wizard/run-wizard-session.js +26 -26
- package/dist/components/wizard/scroll-affordance.js +2 -2
- package/dist/components/wizard/skill-agent-summary.js +5 -5
- package/dist/components/wizard/source-grid.js +5 -5
- package/dist/components/wizard/stack-selection.js +7 -7
- package/dist/components/wizard/step-agents.js +8 -8
- package/dist/components/wizard/step-build.js +7 -7
- package/dist/components/wizard/step-confirm.js +9 -9
- package/dist/components/wizard/step-sources.js +8 -8
- package/dist/components/wizard/step-stack.js +8 -8
- package/dist/components/wizard/summary-panel.js +8 -8
- package/dist/components/wizard/toast.js +2 -2
- package/dist/components/wizard/wizard-layout.js +12 -12
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard.js +25 -25
- package/dist/hooks/init.js +39 -39
- package/dist/load-agent-defs-5XMVB3MU.js +14 -0
- package/dist/recompile-project-agents-7PQWYQ6B.js +18 -0
- package/dist/{source-loader-7KZ3MD5O.js → source-loader-FRJTCSDL.js} +4 -4
- package/dist/stores/wizard-store.js +4 -4
- package/package.json +5 -2
- package/dist/chunk-7JNJ52CD.js.map +0 -1
- package/dist/chunk-A4KDXNOT.js.map +0 -1
- package/dist/chunk-V3I7VQ7N.js.map +0 -1
- package/dist/chunk-Y47EV74W.js.map +0 -1
- package/dist/load-agent-defs-3C27ENC7.js +0 -14
- package/dist/recompile-project-agents-DGNBCU3N.js +0 -18
- /package/dist/{chunk-TZ2YJJKK.js.map → chunk-23DNVNFP.js.map} +0 -0
- /package/dist/{chunk-ZXKBERQU.js.map → chunk-27AVGFXH.js.map} +0 -0
- /package/dist/{chunk-SXVHSOTH.js.map → chunk-3DIDV6H3.js.map} +0 -0
- /package/dist/{chunk-GE3WKJ6Q.js.map → chunk-3LZNY46H.js.map} +0 -0
- /package/dist/{chunk-MPTNC32T.js.map → chunk-4HWOYYY7.js.map} +0 -0
- /package/dist/{chunk-MAWNVT2C.js.map → chunk-4UKMQUAU.js.map} +0 -0
- /package/dist/{chunk-G6UREQ4V.js.map → chunk-5JUQKGCP.js.map} +0 -0
- /package/dist/{chunk-T6UWJAB3.js.map → chunk-6WGXTB2L.js.map} +0 -0
- /package/dist/{chunk-SAYZWCH6.js.map → chunk-7PYXS2QU.js.map} +0 -0
- /package/dist/{chunk-RZDXDMT6.js.map → chunk-CMJBKQUH.js.map} +0 -0
- /package/dist/{chunk-XZEVWPX6.js.map → chunk-DJEO3F2H.js.map} +0 -0
- /package/dist/{chunk-PMJWD27C.js.map → chunk-GE7NUPMI.js.map} +0 -0
- /package/dist/{chunk-PNB3524H.js.map → chunk-GRL73YPF.js.map} +0 -0
- /package/dist/{chunk-Y3VIRVVE.js.map → chunk-H4ZKGGTE.js.map} +0 -0
- /package/dist/{chunk-LFWLEDUG.js.map → chunk-HI6YB7XP.js.map} +0 -0
- /package/dist/{chunk-SCOQ34YM.js.map → chunk-HL3GYRMR.js.map} +0 -0
- /package/dist/{chunk-NBXXFIIW.js.map → chunk-HR7TK2XW.js.map} +0 -0
- /package/dist/{chunk-ZR4YPKXQ.js.map → chunk-JIBCVXXL.js.map} +0 -0
- /package/dist/{chunk-JQRJQ4SS.js.map → chunk-JPMV4E4E.js.map} +0 -0
- /package/dist/{chunk-4NDBUJHK.js.map → chunk-JVUN6AOO.js.map} +0 -0
- /package/dist/{chunk-RAHSOJQ2.js.map → chunk-KQ3PDARZ.js.map} +0 -0
- /package/dist/{chunk-PXWG7KFO.js.map → chunk-KTLKR4YY.js.map} +0 -0
- /package/dist/{chunk-6L75SQZU.js.map → chunk-L3W2JWBA.js.map} +0 -0
- /package/dist/{chunk-TTY6DPJN.js.map → chunk-LFUJCRCT.js.map} +0 -0
- /package/dist/{chunk-V5WXIM2F.js.map → chunk-NU2K5G54.js.map} +0 -0
- /package/dist/{chunk-G4JK7WVO.js.map → chunk-P6I72PR3.js.map} +0 -0
- /package/dist/{chunk-WWIFNPJG.js.map → chunk-PCFUXQJA.js.map} +0 -0
- /package/dist/{chunk-DAIEQJIF.js.map → chunk-PLX2FLEQ.js.map} +0 -0
- /package/dist/{chunk-2VUYFTUB.js.map → chunk-QWFG7Y3R.js.map} +0 -0
- /package/dist/{chunk-WVUDLKIO.js.map → chunk-SLBL3WIP.js.map} +0 -0
- /package/dist/{chunk-HWEKHVLE.js.map → chunk-TW35AEB4.js.map} +0 -0
- /package/dist/{chunk-VAPTVR3J.js.map → chunk-VVRI35SK.js.map} +0 -0
- /package/dist/{chunk-6LF4CQBY.js.map → chunk-W5KEYSOL.js.map} +0 -0
- /package/dist/{chunk-TODCQFRB.js.map → chunk-W6GO2CYX.js.map} +0 -0
- /package/dist/{chunk-HHIYT3PI.js.map → chunk-X6ZZEYO3.js.map} +0 -0
- /package/dist/{chunk-QHDPLLK6.js.map → chunk-YN3SWF53.js.map} +0 -0
- /package/dist/{chunk-25MPBIK3.js.map → chunk-ZUGH4MQG.js.map} +0 -0
- /package/dist/{load-agent-defs-3C27ENC7.js.map → load-agent-defs-5XMVB3MU.js.map} +0 -0
- /package/dist/{recompile-project-agents-DGNBCU3N.js.map → recompile-project-agents-7PQWYQ6B.js.map} +0 -0
- /package/dist/{source-loader-7KZ3MD5O.js.map → source-loader-FRJTCSDL.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/seed/seed-apply.ts","../src/cli/utils/open-url.ts"],"sourcesContent":["import os from \"os\";\n\nimport { isDeepEqual, omit, partition, pick } from \"remeda\";\n\nimport { loadProjectConfigFromDir } from \"../configuration/project-config.js\";\nimport { isActiveAt } from \"../configuration/scope-predicates.js\";\nimport { providerInUse } from \"../installation/install-layout.js\";\nimport { getCategoryDomain, getSkillDisplayName, matrix } from \"../matrix/matrix-provider.js\";\nimport { orderDomains } from \"../wizard/domain-order.js\";\nimport { SHARED_CONFIG_APPLY, SHARED_CONFIG_ARRIVALS } from \"../../utils/messages.js\";\nimport { typedEntries, typedKeys, typedValues } from \"../../utils/typed-object.js\";\n\nimport type { WizardResultV2 } from \"../../components/wizard/wizard.js\";\nimport type { AgentName } from \"../../types/agents.js\";\nimport type {\n AgentScopeConfig,\n ProjectConfig,\n SkillConfig,\n SkillScope,\n} from \"../../types/config.js\";\nimport type { Category, Domain } from \"../../types/matrix.js\";\nimport type { SkillAssignment, SkillId } from \"../../types/skills.js\";\nimport type { StackAgentConfig } from \"../../types/stacks.js\";\nimport type { SeedPayload, SeedSkill } from \"@workspace/matrix/seed\";\n\n/**\n * What applying a shared configuration here is not allowed to take away, split by the reason —\n * because the reasons have different remedies and only the user knows which they meant.\n */\nexport type KeptFromRoundTrip = {\n /** Written here rather than installed, so no shared configuration ever carried them. */\n authoredSkillIds: SkillId[];\n /** Named by the configuration and unplaceable by this catalogue, so nothing here applied. */\n unplaceableSkillIds: SkillId[];\n};\n\n/**\n * A kept skill's installed row that the payload's own skill displaced: the category holds one\n * skill, and the payload fills it on that sub-agent. The skill stays installed; the row goes.\n */\nexport type UnassignedRow = { skillId: SkillId; agentName: AgentName; category: Category };\n\nexport type ReconciledSharedConfig = {\n /** The decoded payload with everything above put back into it. */\n result: WizardResultV2;\n kept: KeptFromRoundTrip;\n /** The kept skills' rows left out, each because the payload's own skill takes its slot. */\n unassigned: UnassignedRow[];\n};\n\nexport type ReconcileOptions = {\n /** The payload as `seedToWizardResult` decoded it. */\n decoded: WizardResultV2;\n /** This directory's installation — its own config, or the global one it inherits. */\n installed: ProjectConfig | null;\n /** Ids outside the round trip, from `skillsAuthoredHere` — one definition, both halves. */\n authoredHere: ReadonlySet<SkillId>;\n /**\n * Ids the payload NAMED that the decode could not place — `SeedMapping.skippedSkillIds`,\n * which is why they are ids off the wire rather than `SkillId`s of this catalogue.\n *\n * Stated by the caller rather than recomputed here: the decode already answered it, and a\n * second derivation could disagree with the skips the same run reported.\n */\n unplaceable: ReadonlySet<string>;\n};\n\nconst NOTHING_KEPT: KeptFromRoundTrip = {\n authoredSkillIds: [],\n unplaceableSkillIds: [],\n};\n\n/**\n * Puts back what this run may not remove, so the destructive apply removes only what it may.\n *\n * `edit --from` makes the project MATCH the payload: a skill the previous configuration\n * installed and this one omits is removed. Two kinds of installed entry are outside that\n * authority, and each is outside it for its own reason.\n *\n * A skill written here, because `forkedFrom` decides ownership and the producer drops a\n * directory carrying none: the payload never named it, so reading its absence as an instruction\n * to delete it would be this command inventing an instruction nobody gave. And an id the payload\n * DID name that this catalogue could not place, because there the instruction exists and the run\n * failed to carry it out — a destructive command removes on intent, never on its own inability.\n *\n * Scope is the third reason, and it is answered apart, by {@link restoreInstalledGlobal}: from a\n * project the global install is not this run's to remove from or change at all, so it is put back\n * whole rather than entry by entry, and nothing about it is a disclosure of something kept.\n *\n * Both are put back into the RESULT rather than excused at the writer, and that is the whole\n * point of this module. `authoritativeScope` decides whether the merger preserves a config row;\n * it does not protect the files, because the removal DIFF is what drives the plugin uninstall\n * and the `deleteLocalSkill` call. An entry left in the removal set is deleted from disk\n * whatever the merger later does with its row.\n *\n * What comes back with an entry matters as much as the entry. A kept skill with no stack row is\n * installed and loaded by no sub-agent; a kept skill whose domain fell off `selectedDomains` is\n * hidden from the next wizard, deselected by not being shown, and deleted by the run after this\n * one — a removal this one promised not to make.\n */\nexport function reconcileSharedConfig(options: ReconcileOptions): ReconciledSharedConfig {\n const { decoded, installed } = options;\n if (!installed) return nothingToReconcile(decoded);\n\n const keptSkills = skillsToKeep(options, installed);\n if (keptSkills.length === 0) return nothingToReconcile(decoded);\n\n const { result, unassigned } = withKeptEntries(decoded, installed, keptSkills);\n return { result, kept: describeKept(options, keptSkills), unassigned };\n}\n\nfunction nothingToReconcile(decoded: WizardResultV2): ReconciledSharedConfig {\n return { result: decoded, kept: NOTHING_KEPT, unassigned: [] };\n}\n\n/**\n * The installed skills this run has to leave alone: absent from what the payload placed here,\n * and immune to removal by authorship, or because this catalogue could not place the id the\n * payload named.\n *\n * A tombstone is neither. It is a statement about something that is NOT installed here, so\n * there are no files to protect and nothing to tell the user is staying.\n */\nfunction skillsToKeep(options: ReconcileOptions, installed: ProjectConfig): SkillConfig[] {\n const named = new Set(options.decoded.skills.map((skill) => skill.id));\n\n return installed.skills.filter(\n (skill) => !skill.excluded && !named.has(skill.id) && mayNotRemove(skill, options),\n );\n}\n\n/** Whether either reason covers this entry — the question the split below refines. */\nfunction mayNotRemove(skill: SkillConfig, options: ReconcileOptions): boolean {\n return options.authoredHere.has(skill.id) || options.unplaceable.has(skill.id);\n}\n\ntype KeptReason = \"authored\" | \"unplaceable\";\n\nfunction describeKept(options: ReconcileOptions, keptSkills: SkillConfig[]): KeptFromRoundTrip {\n const idsKeptFor = (reason: KeptReason): SkillId[] =>\n keptSkills.filter((skill) => reasonKept(skill, options) === reason).map((skill) => skill.id);\n\n return {\n authoredSkillIds: idsKeptFor(\"authored\"),\n unplaceableSkillIds: idsKeptFor(\"unplaceable\"),\n };\n}\n\n/**\n * Which of the two an entry is disclosed as, where both are true — judged from the more\n * permanent claim to the less, because each statement carries its own remedy and only the one\n * that is true of the whole entry is worth naming.\n *\n * A skill nobody installed cannot be removed by any shared configuration from anywhere. An id\n * this catalogue cannot place is inert only for as long as this installation reads this\n * catalogue, so `update` is a real way out of it and nothing is a way out of the other.\n */\nfunction reasonKept(skill: SkillConfig, options: ReconcileOptions): KeptReason {\n return options.authoredHere.has(skill.id) ? \"authored\" : \"unplaceable\";\n}\n\n/**\n * The payload, plus the entries it was never entitled to speak about — and the kept rows its own\n * skills left no room for.\n */\nfunction withKeptEntries(\n decoded: WizardResultV2,\n installed: ProjectConfig,\n keptSkills: SkillConfig[],\n): Pick<ReconciledSharedConfig, \"result\" | \"unassigned\"> {\n const withSkills: WizardResultV2 = {\n ...decoded,\n skills: [...decoded.skills, ...keptSkills],\n selectedDomains: withKeptDomains(decoded.selectedDomains, keptSkills),\n };\n if (decoded.assignedStack === undefined) return { result: withSkills, unassigned: [] };\n\n const { assignedStack, unassigned } = withKeptStackRows(decoded.assignedStack, installed.stack, {\n keptSkillIds: new Set(keptSkills.map((skill) => skill.id)),\n survivingAgents: new Set(decoded.selectedAgents),\n });\n return { result: { ...withSkills, assignedStack }, unassigned };\n}\n\n/** The domains the payload chose, plus the ones its kept entries still need a tab for. */\nfunction withKeptDomains(selected: Domain[], keptSkills: SkillConfig[]): Domain[] {\n const keptDomains = keptSkills.flatMap((skill) => domainOfSkill(skill.id) ?? []);\n const missing = keptDomains.filter((domain) => !selected.includes(domain));\n if (missing.length === 0) return selected;\n\n return orderDomains([...selected, ...new Set(missing)]);\n}\n\n/**\n * A kept skill's domain, where this catalogue knows the skill. Optional by nature rather than by\n * caution: a config entry the loaded source cannot resolve has no category to place, and\n * `edit`'s own unresolvable-entry path is what speaks about those.\n */\nfunction domainOfSkill(skillId: SkillId): Domain | undefined {\n const category = matrix.skills[skillId]?.category;\n return category === undefined ? undefined : getCategoryDomain(category);\n}\n\ntype KeptRowFilter = {\n keptSkillIds: ReadonlySet<SkillId>;\n survivingAgents: ReadonlySet<AgentName>;\n};\n\n/** The payload's stack with the kept rows folded in, and the kept rows it had no room for. */\ntype KeptRows = {\n assignedStack: Partial<Record<AgentName, StackAgentConfig>>;\n unassigned: UnassignedRow[];\n};\n\n/**\n * The installed stack rows a kept skill needs, folded into the payload's own.\n *\n * `assignedStack` REPLACES the ownership-derived stack rather than merging with it, so a row\n * this reconcile does not carry is a row nothing downstream re-derives. A kept skill is kept\n * because the payload never spoke about it, and a row naming it is the same silence one layer\n * down — so the row the installation already had is the only statement there is about it.\n *\n * A row under a sub-agent this configuration removes is dropped with it. That sub-agent IS this\n * run's to remove, and a stack row naming one no configuration installs is what `compile` warns\n * about and leaves out of the agents it writes.\n *\n * A kept row JOINS the payload's rows under its category rather than replacing them: the payload\n * may assign a skill of its own to the same category of the same sub-agent, and a replaced array\n * leaves that skill installed and loaded by no sub-agent. Except where the category holds one\n * skill and the payload already fills it: the two cannot both be written there, so the payload's\n * skill takes the slot — the same rule {@link arrivingRows} keeps for a global sub-agent — and the\n * kept row is handed back as unassigned for the plan to name.\n */\nfunction withKeptStackRows(\n assigned: Partial<Record<AgentName, StackAgentConfig>>,\n installedStack: Partial<Record<AgentName, StackAgentConfig>> | undefined,\n filter: KeptRowFilter,\n): KeptRows {\n const isKept = (_category: Category, row: SkillAssignment): boolean =>\n filter.keptSkillIds.has(row.id);\n\n return typedEntries<AgentName, StackAgentConfig>(installedStack ?? {})\n .filter(([agent]) => filter.survivingAgents.has(agent))\n .reduce<KeptRows>(\n (carried, [agent, agentStack]) =>\n withAgentKeptRows(carried, agent, rowsWhere(agentStack, isKept), assigned[agent]),\n { assignedStack: assigned, unassigned: [] },\n );\n}\n\n/**\n * One sub-agent's kept rows, folded in: each joins the payload's rows under its category, unless\n * that category holds one skill the payload already gives this sub-agent.\n */\nfunction withAgentKeptRows(\n carried: KeptRows,\n agent: AgentName,\n keptRows: [Category, SkillAssignment][],\n payloadRows: StackAgentConfig | undefined,\n): KeptRows {\n const filled = filledExclusiveCategories(payloadRows);\n const [displaced, joining] = partition(keptRows, ([category]) => filled.has(category));\n\n return {\n assignedStack: withAppendedRows(carried.assignedStack, agent, joining),\n unassigned: [\n ...carried.unassigned,\n ...displaced.map(([category, row]) => ({ skillId: row.id, agentName: agent, category })),\n ],\n };\n}\n\n/**\n * The decode, plus each installed sub-agent the payload assigns a skill this catalogue cannot place\n * and this installation still holds — each as installed.\n *\n * The decode carries a sub-agent in by the skills it places, so one whose only skill it skipped is\n * left out, and the destructive apply would remove it. That is the removal\n * {@link reconcileSharedConfig} refuses for the skill, for the same reason: the payload named this\n * sub-agent, so its absence is this catalogue's limit rather than an instruction. Put back before\n * the reconcile, it survives it, and the reconcile carries the kept skill's rows onto it.\n */\nexport function withUnplaceableAssignees(\n decoded: WizardResultV2,\n installed: ProjectConfig | null,\n payload: SeedPayload,\n unplaceable: ReadonlySet<string>,\n): WizardResultV2 {\n if (!installed) return decoded;\n\n const assigned = assigneesOfHeld(payload, installed, unplaceable);\n const selected = new Set(decoded.selectedAgents);\n const leftOutThoughAssigned = (agent: AgentScopeConfig): boolean =>\n !agent.excluded && assigned.has(agent.name) && !selected.has(agent.name);\n\n const assignees = installed.agents.filter(leftOutThoughAssigned);\n if (assignees.length === 0) return decoded;\n\n return {\n ...decoded,\n selectedAgents: [...decoded.selectedAgents, ...assignees.map((agent) => agent.name)],\n agentConfigs: [...decoded.agentConfigs, ...assignees],\n };\n}\n\n/**\n * The sub-agents the payload assigns an unplaceable skill the installation holds, less any it\n * switches off — whose rows the decode ignores even for a skill it places.\n */\nfunction assigneesOfHeld(\n payload: SeedPayload,\n installed: ProjectConfig,\n unplaceable: ReadonlySet<string>,\n): Set<string> {\n const held = new Set<string>(\n installed.skills.filter((skill) => !skill.excluded).map((skill) => skill.id),\n );\n const isHeldUnplaceable = ([id]: [string, SeedSkill]): boolean =>\n unplaceable.has(id) && held.has(id);\n const isNotSwitchedOff = (name: string): boolean => payload.agents[name]?.on !== false;\n\n return new Set(\n typedEntries<string, SeedSkill>(payload.skills)\n .filter(isHeldUnplaceable)\n .flatMap(([, skill]) => typedKeys<string>(skill.assignments))\n .filter(isNotSwitchedOff),\n );\n}\n\n/** The parts of the global installation's config a project run must leave as they are. */\nexport type InstalledGlobal = Pick<ProjectConfig, \"skills\" | \"agents\" | \"stack\">;\n\n/**\n * The global installation a run in `projectDir` inherits, as its own config states it — or `null`\n * when there is none.\n *\n * Read from the global config rather than from the rows a project's own file inlines: the global\n * config is what the gate writes and what every other registered project inherits, and an inlined\n * copy can be older than it. Through the project's own provider, because a project inherits only\n * from the global installation of its provider. Called only from a project — at the home directory\n * the run IS the global installation, and there is nothing to leave alone.\n */\nexport async function readInstalledGlobal(projectDir: string): Promise<InstalledGlobal | null> {\n const loaded = await loadProjectConfigFromDir(os.homedir(), providerInUse(projectDir));\n return loaded?.config ?? null;\n}\n\n/** Global entries a configuration names, by what a project run does with each. */\ntype GlobalEntries = { skillIds: SkillId[]; agentNames: AgentName[] };\n\n/** What a run from a project does with the global install above it: adds to it, and nothing else. */\nexport type HeldGlobal = {\n /** The configuration, with every global entry the global install holds stated as it holds it. */\n result: WizardResultV2;\n /**\n * The global entries the configuration names that the global install already holds. Its skills\n * are skipped — neither installed nor given a row — and listed as skipped.\n */\n installed: GlobalEntries;\n /**\n * Of those, the ones the configuration states otherwise — a skill's install mode, a sub-agent's\n * tuning, or rows other than the ones it ends up with — disclosed as kept as installed. From\n * {@link restoreInstalledGlobal}, also every global skill and sub-agent the configuration leaves\n * out.\n */\n keptAsInstalled: GlobalEntries;\n};\n\nconst NO_GLOBAL_ENTRIES: GlobalEntries = { skillIds: [], agentNames: [] };\n\n/**\n * Restates every global entry the configuration names that the global install already holds, as\n * the global install holds it: the skill's install mode, the sub-agent's tuning, and the rows\n * that sub-agent already has.\n *\n * From a project, `--from` only ADDS to the global install (owner ruling 2026-10-02). It is one\n * installation every project on the machine reads, and a run started in one of them is not a\n * decision about the rest — so an entry it already holds is not this run's to reinstall, retune or\n * reassign, however the configuration states it. Restated in the RESULT rather than excused at\n * the writer, for the reason {@link reconcileSharedConfig} gives: the result is what the diff, the\n * install steps and the writer all read, so an entry left as the payload stated it is one of them\n * acting on it.\n *\n * What the global install lacks arrives whole, and a skill's assignment is part of it: a new\n * global skill assigned to a global sub-agent the global install already holds adds its row to\n * that sub-agent, beside the rows it has (owner ruling, later on 2026-10-02). A skill the global\n * install already holds is skipped outright, so it brings no row with it either.\n *\n * `installed` is `null` where there is nothing to hold: at the home directory, where the run IS\n * the global install, and on a machine with none.\n */\nexport function holdInstalledGlobal(\n decoded: WizardResultV2,\n installed: InstalledGlobal | null,\n): HeldGlobal {\n if (!installed) {\n return { result: decoded, installed: NO_GLOBAL_ENTRIES, keptAsInstalled: NO_GLOBAL_ENTRIES };\n }\n\n const heldSkills = activeGlobalById(installed.skills, (skill) => skill.id);\n const heldAgents = activeGlobalById(installed.agents, (agent) => agent.name);\n const skills = pairWithHeld(decoded.skills, heldSkills, (skill) => skill.id);\n const agents = pairWithHeld(decoded.agentConfigs, heldAgents, (agent) => agent.name);\n const namedSkillIds = skills.map(({ named }) => named.id);\n const namedAgentNames = agents.map(({ named }) => named.name);\n const assignedStack =\n decoded.assignedStack &&\n withHeldRows(decoded.assignedStack, installed.stack, {\n agentNames: namedAgentNames,\n skippedSkillIds: new Set(namedSkillIds),\n });\n\n const restatesSkill = ({ named, held }: Held<SkillConfig>): boolean =>\n named.origin === held.origin;\n const restatesAgent = ({ named, held }: Held<AgentScopeConfig>): boolean =>\n named.model === held.model &&\n named.effort === held.effort &&\n sameAssignments(decoded.assignedStack?.[named.name], assignedStack?.[named.name]);\n\n return {\n result: {\n ...decoded,\n skills: decoded.skills.map(asHeld(skills)),\n agentConfigs: decoded.agentConfigs.map(asHeld(agents)),\n ...(assignedStack !== undefined && { assignedStack }),\n },\n installed: { skillIds: namedSkillIds, agentNames: namedAgentNames },\n keptAsInstalled: {\n skillIds: skills.filter((pair) => !restatesSkill(pair)).map(({ named }) => named.id),\n agentNames: agents.filter((pair) => !restatesAgent(pair)).map(({ named }) => named.name),\n },\n };\n}\n\n/**\n * {@link holdInstalledGlobal}, plus every global entry the configuration leaves out, put back as\n * installed — what `edit --from` needs from a project.\n *\n * That apply is destructive: an installed entry absent from the result is removed, files and\n * all. The project's own entries are its to remove; the global install's are not, so they are put\n * back whole — skills, sub-agents and those sub-agents' rows — and the removal plan never holds\n * one. A global skill or sub-agent put back is one the configuration leaves out, so it is named as\n * kept.\n */\nexport function restoreInstalledGlobal(\n decoded: WizardResultV2,\n installed: InstalledGlobal | null,\n): HeldGlobal {\n const held = holdInstalledGlobal(decoded, installed);\n if (!installed) return held;\n\n const omitted = omittedGlobal(held.result, installed);\n const { skillIds, agentNames } = held.keptAsInstalled;\n return {\n ...held,\n result: withOmittedGlobal(held.result, installed, omitted),\n keptAsInstalled: {\n skillIds: [...skillIds, ...omitted.skills.map((skill) => skill.id)],\n agentNames: [...agentNames, ...omitted.agents.map((agent) => agent.name)],\n },\n };\n}\n\n/** A config roster's active global entries, by the key the result names them with. */\nfunction activeGlobalById<Entry extends SkillConfig | AgentScopeConfig, Key extends string>(\n entries: Entry[],\n keyOf: (entry: Entry) => Key,\n): Map<Key, Entry> {\n return new Map(\n entries.filter((entry) => isActiveAt(entry, \"global\")).map((entry) => [keyOf(entry), entry]),\n );\n}\n\n/** A decoded global entry, beside the entry the global install already holds under its name. */\ntype Held<Entry> = { named: Entry; held: Entry };\n\n/** Each decoded entry as the global install holds it, where it names one; otherwise unchanged. */\nfunction asHeld<Entry>(pairs: Held<Entry>[]): (entry: Entry) => Entry {\n const heldFor = new Map(pairs.map(({ named, held }) => [named, held]));\n return (entry) => heldFor.get(entry) ?? entry;\n}\n\n/** The decoded entries that name, at global scope, one the global install already holds. */\nfunction pairWithHeld<Entry extends SkillConfig | AgentScopeConfig, Key extends string>(\n decoded: Entry[],\n heldByKey: ReadonlyMap<Key, Entry>,\n keyOf: (entry: Entry) => Key,\n): Held<Entry>[] {\n return decoded.flatMap((named) => {\n const held = heldByKey.get(keyOf(named));\n return held !== undefined && isActiveAt(named, \"global\") ? [{ named, held }] : [];\n });\n}\n\n/**\n * Whether two sub-agent stacks hold the same skills under the same categories at the same load\n * state — the order rows were written in is not part of what a sub-agent loads.\n */\nexport function sameAssignments(\n left: StackAgentConfig | undefined,\n right: StackAgentConfig | undefined,\n): boolean {\n return isDeepEqual(assignmentKeys(left), assignmentKeys(right));\n}\n\n/** One stack's rows as comparable strings, in a fixed order. */\nfunction assignmentKeys(agentStack: StackAgentConfig | undefined): string[] {\n return typedEntries<Category, SkillAssignment[]>(agentStack ?? {})\n .flatMap(([category, assignments]) =>\n assignments.map((row) => `${category}/${row.id}/${row.preloaded === true}`),\n )\n .sort();\n}\n\n/**\n * The payload's stack, with each named sub-agent's rows replaced by the ones it is installed\n * with — none, where the global install gives it none.\n */\nfunction withInstalledRows(\n assigned: Partial<Record<AgentName, StackAgentConfig>>,\n installedStack: InstalledGlobal[\"stack\"],\n agentNames: AgentName[],\n): Partial<Record<AgentName, StackAgentConfig>> {\n return { ...omit(assigned, agentNames), ...pick(installedStack ?? {}, agentNames) };\n}\n\n/** The held sub-agents, and the skills whose rows stay out because the skill is skipped. */\ntype HeldRows = { agentNames: AgentName[]; skippedSkillIds: ReadonlySet<SkillId> };\n\n/**\n * {@link withInstalledRows}, plus the configuration's rows on those sub-agents for the skills the\n * global install lacks — a skill arrives together with its assignment. A row the sub-agent\n * already has stays first and as it is, so what it loads now it still loads, in the same order.\n */\nfunction withHeldRows(\n assigned: Partial<Record<AgentName, StackAgentConfig>>,\n installedStack: InstalledGlobal[\"stack\"],\n held: HeldRows,\n): Partial<Record<AgentName, StackAgentConfig>> {\n const asInstalled = withInstalledRows(assigned, installedStack, held.agentNames);\n\n return held.agentNames.reduce(\n (stack, agentName) =>\n withAppendedRows(\n stack,\n agentName,\n arrivingRows(assigned[agentName], stack[agentName], held.skippedSkillIds),\n ),\n asInstalled,\n );\n}\n\n/**\n * The configuration's rows for one held sub-agent that bring something with them: a skill the\n * global install lacks, which that sub-agent does not already load, under a category with room for\n * it. A category that holds one skill, which the sub-agent already fills, keeps the skill it has —\n * the arriving one is installed without that row, rather than written as a second skill where the\n * config can hold only one.\n */\nfunction arrivingRows(\n stated: StackAgentConfig | undefined,\n installed: StackAgentConfig | undefined,\n skippedSkillIds: ReadonlySet<SkillId>,\n): [Category, SkillAssignment][] {\n const alreadyLoaded = new Set(rowIds(installed));\n const filled = filledExclusiveCategories(installed);\n const arrives = (category: Category, row: SkillAssignment): boolean =>\n !skippedSkillIds.has(row.id) && !alreadyLoaded.has(row.id) && !filled.has(category);\n\n return rowsWhere(stated, arrives);\n}\n\n/** One sub-agent's rows, as the skill ids they load. */\nfunction rowIds(agentStack: StackAgentConfig | undefined): SkillId[] {\n return typedValues<Category, SkillAssignment[]>(agentStack ?? {}).flatMap((rows) =>\n rows.map((row) => row.id),\n );\n}\n\n/**\n * The categories this sub-agent already fills that hold one skill at most — declared so by the\n * catalogue, because a category it does not declare is not exclusive (see `propagate.ts`).\n */\nfunction filledExclusiveCategories(agentStack: StackAgentConfig | undefined): Set<Category> {\n const isExclusive = (category: Category): boolean =>\n matrix.categories[category]?.exclusive === true;\n\n return new Set(\n typedEntries<Category, SkillAssignment[]>(agentStack ?? {})\n .filter(([category, rows]) => rows.length > 0 && isExclusive(category))\n .map(([category]) => category),\n );\n}\n\n/** The stack, with `added` appended to one sub-agent's rows — as it was where nothing is added. */\nfunction withAppendedRows(\n stack: Partial<Record<AgentName, StackAgentConfig>>,\n agentName: AgentName,\n added: [Category, SkillAssignment][],\n): Partial<Record<AgentName, StackAgentConfig>> {\n if (added.length === 0) return stack;\n return { ...stack, [agentName]: appendRows(stack[agentName] ?? {}, added) };\n}\n\n/** The rows of one sub-agent's stack that pass `keep`, each beside the category it sits under. */\nfunction rowsWhere(\n agentStack: StackAgentConfig | undefined,\n keep: (category: Category, row: SkillAssignment) => boolean,\n): [Category, SkillAssignment][] {\n return typedEntries<Category, SkillAssignment[]>(agentStack ?? {}).flatMap(([category, rows]) =>\n rows\n .filter((row) => keep(category, row))\n .map((row): [Category, SkillAssignment] => [category, row]),\n );\n}\n\n/** A sub-agent's stack with `added` appended, each row after those already under its category. */\nfunction appendRows(\n agentStack: StackAgentConfig,\n added: [Category, SkillAssignment][],\n): StackAgentConfig {\n return added.reduce<StackAgentConfig>(\n (rows, [category, row]) => ({ ...rows, [category]: [...(rows[category] ?? []), row] }),\n agentStack,\n );\n}\n\n/** The global install's active entries a result does not name. */\ntype OmittedGlobal = { skills: SkillConfig[]; agents: AgentScopeConfig[] };\n\nfunction omittedGlobal(result: WizardResultV2, installed: InstalledGlobal): OmittedGlobal {\n const namedSkillIds = new Set(result.skills.map((skill) => skill.id));\n const namedAgentNames = new Set(result.agentConfigs.map((agent) => agent.name));\n\n return {\n skills: [...activeGlobalById(installed.skills, (skill) => skill.id).values()].filter(\n (skill) => !namedSkillIds.has(skill.id),\n ),\n agents: [...activeGlobalById(installed.agents, (agent) => agent.name).values()].filter(\n (agent) => !namedAgentNames.has(agent.name),\n ),\n };\n}\n\n/** The result, plus every global entry it does not name, each as the global install holds it. */\nfunction withOmittedGlobal(\n result: WizardResultV2,\n installed: InstalledGlobal,\n omitted: OmittedGlobal,\n): WizardResultV2 {\n const omittedAgentNames = omitted.agents.map((agent) => agent.name);\n\n return {\n ...result,\n skills: [...result.skills, ...omitted.skills],\n agentConfigs: [...result.agentConfigs, ...omitted.agents],\n selectedAgents: [...new Set([...result.selectedAgents, ...omittedAgentNames])],\n selectedDomains: withKeptDomains(result.selectedDomains, omitted.skills),\n ...(result.assignedStack !== undefined && {\n assignedStack: withInstalledRows(result.assignedStack, installed.stack, omittedAgentNames),\n }),\n };\n}\n\n/**\n * The entries a run writes, less those the global install already holds: a carried skill's bytes\n * written over a global skill directory would change it as surely as a reinstall.\n */\nexport function notInstalledGlobally<Entry extends { id: SkillId }>(\n entries: Entry[],\n held: HeldGlobal,\n): Entry[] {\n const installed = new Set(held.installed.skillIds);\n return entries.filter((entry) => !installed.has(entry.id));\n}\n\n/** What a `--from` install puts into one scope, as its list names them. */\nexport type ArrivingEntries = { skillIds: SkillId[]; agentNames: AgentName[] };\n\n/** What a `--from` install puts where — the two lists it prints before it writes. */\nexport type Arrivals = Record<SkillScope, ArrivingEntries>;\n\n/** The active skills and sub-agents given, split by the scope each one lands at. */\nexport function arrivalsByScope(skills: SkillConfig[], agents: AgentScopeConfig[]): Arrivals {\n const landingAt = (scope: SkillScope): ArrivingEntries => ({\n skillIds: skills.filter((skill) => isActiveAt(skill, scope)).map((skill) => skill.id),\n agentNames: agents.filter((agent) => isActiveAt(agent, scope)).map((agent) => agent.name),\n });\n return { project: landingAt(\"project\"), global: landingAt(\"global\") };\n}\n\n/**\n * Everything `init --from` installs, by scope: the whole configuration, less what the global\n * install already holds — that is not arriving anywhere.\n */\nfunction installArrivals(held: HeldGlobal): Arrivals {\n const installedSkillIds = new Set(held.installed.skillIds);\n const installedAgentNames = new Set(held.installed.agentNames);\n return arrivalsByScope(\n held.result.skills.filter((skill) => !installedSkillIds.has(skill.id)),\n held.result.agentConfigs.filter((agent) => !installedAgentNames.has(agent.name)),\n );\n}\n\n/**\n * What `init --from` prints before it writes: the two lists of what it installs where, then the\n * global skills it skips because the global install above the project already holds them. A\n * skipped skill is named rather than left out, so a configuration's skill that does not arrive is\n * never one the user was not told about.\n */\nexport function installPlanLines(held: HeldGlobal): string[] {\n return [\n ...arrivalLines(installArrivals(held)),\n ...scopeLines(SHARED_CONFIG_ARRIVALS.SKIPPED_HEADING, {\n skillIds: held.installed.skillIds,\n agentNames: [],\n }),\n ];\n}\n\n/** How a skill reads in a shared-config plan: the name it was picked by, with the id behind it. */\nexport function skillLabel(skillId: SkillId): string {\n const displayName = getSkillDisplayName(skillId);\n return displayName === skillId ? skillId : `${displayName} (${skillId})`;\n}\n\n/**\n * The two lists, as printed: project first, then global, each omitted when nothing lands there,\n * and each split into skills and sub-agents under the headings the removal plan uses.\n */\nexport function arrivalLines(arrivals: Arrivals): string[] {\n return [\n ...scopeLines(SHARED_CONFIG_ARRIVALS.PROJECT_HEADING, arrivals.project),\n ...scopeLines(SHARED_CONFIG_ARRIVALS.GLOBAL_HEADING, arrivals.global),\n ];\n}\n\n/** One scope's list, or nothing when nothing lands there. */\nfunction scopeLines(heading: string, entries: ArrivingEntries): string[] {\n const groups = [\n { label: SHARED_CONFIG_APPLY.SKILLS_HEADING, items: entries.skillIds.map(skillLabel) },\n { label: SHARED_CONFIG_APPLY.AGENTS_HEADING, items: entries.agentNames },\n ].filter((group) => group.items.length > 0);\n if (groups.length === 0) return [];\n\n return [\n heading,\n ...groups.flatMap((group) => [` ${group.label}`, ...group.items.map((item) => ` ${item}`)]),\n ];\n}\n","import { execCommand } from \"./exec.js\";\nimport { getErrorMessage } from \"./errors.js\";\n\n/** The shell-out one platform answers \"open this with whatever handles it\" with. */\nexport type OpenerCommand = { command: string; args: string[] };\n\n/**\n * Never a throw. A machine with no browser, no desktop session or no opener at all is a\n * legitimate place to run this CLI, so failing to open a link is something to say rather than\n * something to fail on — the same posture the seed boundaries take, and for the same reason:\n * the link is already printed by the time this runs, so nothing is lost by it not working.\n */\nexport type OpenUrlResult = { ok: true } | { ok: false; error: string };\n\n/**\n * The command a platform opens a link with.\n *\n * There is no dependency for this. All three are one-line shell-outs to something the operating\n * system already ships, and a package for it would be a fourth thing to keep current for no\n * behaviour this does not have.\n *\n * Windows goes through `cmd` because `start` is a shell builtin rather than a program, and the\n * empty string after it is its TITLE argument: without one, `start` reads the first quoted\n * argument it is given as the window title and opens nothing.\n */\nexport function browserOpenerCommand(platform: NodeJS.Platform, url: string): OpenerCommand {\n if (platform === \"darwin\") return { command: \"open\", args: [url] };\n if (platform === \"win32\") return { command: \"cmd\", args: [\"/c\", \"start\", \"\", url] };\n return { command: \"xdg-open\", args: [url] };\n}\n\nfunction openerRefusedMessage(command: string, exitCode: number): string {\n return `Could not open your browser — '${command}' exited ${exitCode}.`;\n}\n\nfunction openerUnavailableMessage(command: string, reason: string): string {\n return `Could not open your browser — '${command}' could not be run: ${reason}`;\n}\n\n/**\n * Hands a link to whatever this platform opens links with.\n *\n * The URL travels as its own argument rather than inside a command line: `execCommand` spawns\n * without a shell, so the argument vector is the whole of the injection guard — there is no\n * string for a link to break out of.\n */\nexport async function openUrl(url: string): Promise<OpenUrlResult> {\n const { command, args } = browserOpenerCommand(process.platform, url);\n\n try {\n const result = await execCommand(command, args);\n if (result.exitCode !== 0) {\n return { ok: false, error: openerRefusedMessage(command, result.exitCode) };\n }\n return { ok: true };\n } catch (error) {\n return { ok: false, error: openerUnavailableMessage(command, getErrorMessage(error)) };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AAEf,SAAS,aAAa,MAAM,WAAW,YAAY;AAiEnD,IAAM,eAAkC;AAAA,EACtC,kBAAkB,CAAC;AAAA,EACnB,qBAAqB,CAAC;AACxB;AA8BO,SAAS,sBAAsB,SAAmD;AACvF,QAAM,EAAE,SAAS,UAAU,IAAI;AAC/B,MAAI,CAAC,UAAW,QAAO,mBAAmB,OAAO;AAEjD,QAAM,aAAa,aAAa,SAAS,SAAS;AAClD,MAAI,WAAW,WAAW,EAAG,QAAO,mBAAmB,OAAO;AAE9D,QAAM,EAAE,QAAQ,WAAW,IAAI,gBAAgB,SAAS,WAAW,UAAU;AAC7E,SAAO,EAAE,QAAQ,MAAM,aAAa,SAAS,UAAU,GAAG,WAAW;AACvE;AAEA,SAAS,mBAAmB,SAAiD;AAC3E,SAAO,EAAE,QAAQ,SAAS,MAAM,cAAc,YAAY,CAAC,EAAE;AAC/D;AAUA,SAAS,aAAa,SAA2B,WAAyC;AACxF,QAAM,QAAQ,IAAI,IAAI,QAAQ,QAAQ,OAAO,IAAI,CAAC,UAAU,MAAM,EAAE,CAAC;AAErE,SAAO,UAAU,OAAO;AAAA,IACtB,CAAC,UAAU,CAAC,MAAM,YAAY,CAAC,MAAM,IAAI,MAAM,EAAE,KAAK,aAAa,OAAO,OAAO;AAAA,EACnF;AACF;AAGA,SAAS,aAAa,OAAoB,SAAoC;AAC5E,SAAO,QAAQ,aAAa,IAAI,MAAM,EAAE,KAAK,QAAQ,YAAY,IAAI,MAAM,EAAE;AAC/E;AAIA,SAAS,aAAa,SAA2B,YAA8C;AAC7F,QAAM,aAAa,CAAC,WAClB,W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BAAqB,SAAiB,UAA0B;AACvE,SAAO,uCAAkC,OAAO,YAAY,QAAQ;AACtE;AAEA,SAAS,yBAAyB,SAAiB,QAAwB;AACzE,SAAO,uCAAkC,OAAO,uBAAuB,MAAM;AAC/E;AASA,eAAsB,QAAQ,KAAqC;AACjE,QAAM,EAAE,SAAS,KAAK,IAAI,qBAAqB,QAAQ,UAAU,GAAG;AAEpE,MAAI;AACF,UAAM,SAAS,MAAM,YAAY,SAAS,IAAI;AAC9C,QAAI,OAAO,aAAa,GAAG;AACzB,aAAO,EAAE,IAAI,OAAO,OAAO,qBAAqB,SAAS,OAAO,QAAQ,EAAE;AAAA,IAC5E;AACA,WAAO,EAAE,IAAI,KAAK;AAAA,EACpB,SAAS,OAAO;AACd,WAAO,EAAE,IAAI,OAAO,OAAO,yBAAyB,SAAS,gBAAgB,KAAK,CAAC,EAAE;AAAA,EACvF;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
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\n/** Sub-agent name -> load state for one skill: the shape the wire keys by skill. */\ntype SeedAssignments = Record<string, SeedLoadState>;\n\n/** What one walk of `config.stack` yields: the wire's assignments, and the rows that cannot be one. */\ntype StackReading = {\n assignments: Map<SkillId, SeedAssignments>;\n /** Pairs the config model has nowhere to write, worded for the refusal. */\n unwritable: string[];\n};\n\n/**\n * An installed entry. An excluded one is a tombstone — a statement about something that is NOT\n * installed here — and presence is selection on the wire, so it has nothing to say. Nothing is\n * lost by leaving it home either: `init --from` installs into a clean setup, where there is no\n * global install for a tombstone to mask.\n *\n * Exported because the reader that gathers what an installation CARRIES has to agree with the\n * mapper about what it installs: content read for an entry this payload will not name is content\n * paid for by nobody, and a refusal raised over it would refuse a share for a skill it is not\n * sharing.\n */\nexport function isInstalled(entry: { excluded?: boolean }): boolean {\n return !entry.excluded;\n}\n\n/**\n * Whether a skill from this origin obliges the payload to name a marketplace.\n *\n * Two do not. An ejected copy travels with the project, and the default public catalogue is what\n * an absent ref already means — so neither puts a ref on the wire, and two identical selections\n * cannot mint two different ids over one.\n */\nfunction needsMarketplaceNamed(origin: string): boolean {\n return origin !== EJECT_SOURCE && origin !== DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\n/**\n * Asked of the contract's own enum rather than spelled out here, so widening `MODEL_NAMES`\n * without widening the wire cannot slip past as a silently dropped pin.\n */\nfunction isSeedModel(model: ModelName): model is SeedModel {\n return seedModelSchema.safeParse(model).success;\n}\n\n/** The wire spells as an enum what a stack entry spells as a boolean, and 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 the contract cannot carry at once, not one thing at a time: a sharer who fixes\n * one only to be refused for the next learns nothing the first message could not have told them.\n *\n * The refusal exists because the alternative is worse than a failed command. A payload quietly\n * missing what it could not say still mints an id, and that id installs a configuration nobody\n * chose — with nothing on either side saying so.\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\n/** The ref a payload has to carry, and the skills no ref this config holds can account for. */\ntype MarketplaceReading = {\n ref: string | undefined;\n unnameable: string[];\n};\n\n/** Where a configuration fetches its marketplace from, and the name that joins it to skills. */\ntype MarketplaceRecord = Pick<ProjectConfig, \"marketplace\" | \"marketplaceName\">;\n\n/**\n * Whether `record` is the marketplace `skill` came from, and says where it is fetched from. No\n * record, as for a configuration that inherits from none, records nothing.\n *\n * A skill's `origin` is a marketplace's NAME, `marketplace` is the ref it was fetched from, and\n * `marketplaceName` is what joins them — the name the install read out of that repository's own\n * manifest. Without both halves agreeing, the ref would send the receiver to a repository that\n * never served this skill, which is the same silent swap under a different spelling.\n */\nfunction isRecordedMarketplace(record: MarketplaceRecord | undefined, skill: SkillConfig): boolean {\n return record?.marketplace !== undefined && skill.origin === record.marketplaceName;\n}\n\n/**\n * Which marketplace the payload names, decided by the skills that oblige it to name one.\n *\n * A payload names ONE marketplace, and it is this configuration's own whenever a skill shared here\n * comes from it. A project under a global installation from another marketplace carries that\n * one's skills too: they travel, the receiver loading this ref alone leaves them behind, and\n * {@link skillsItsMarketplaceLeavesBehind} names them for the sharer. Only a skill whose\n * marketplace neither configuration records is refused — no payload could ever name where it is.\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 * The plugin skills `payload` carries that the marketplace it names does not serve.\n *\n * An install reads the one marketplace a payload names — the public catalogue when it names none —\n * so a plugin from any other is skipped wherever the id is installed. That is a stopgap rather\n * than a refusal: the id still installs everything else, and the sharer is told which skills it\n * leaves behind. An ejected copy is not a plugin and is not asked about here.\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 * Turns `config.stack` inside out: it is keyed by sub-agent and this contract is keyed by skill.\n *\n * Rows naming a sub-agent or a skill this configuration does not install are dropped rather than\n * refused, because they are already no part of what is installed — `compile` warns about exactly\n * those and leaves them out of the agents it writes, so carrying them would share more than this\n * project has.\n *\n * A row the config model cannot write is the opposite case and is collected for the refusal: the\n * decoder turns the same pair away on the way back in, so minting it would produce an id that\n * cannot be installed.\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 // \"eject\" is the project's own copy; anything else is a plugin the marketplace serves, and\n // which marketplace that is has already had to be one the envelope's ref accounts for.\n install: skill.origin === EJECT_SOURCE ? \"eject\" : \"plugin\",\n scope: skill.scope,\n assignments: assignments ?? {},\n };\n}\n\n/**\n * A sub-agent's own row, and it always says `on`.\n *\n * The web app pins `on` only where a person did, because there an agent switched on by its rows is\n * already implied by them. An installed config is not an inference — every sub-agent it names was\n * chosen and has a compiled file on disk — so saying so outright is what carries the one that owns\n * no skill, which is the only thing the agents map can do that assignments cannot.\n */\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.effort !== undefined && { effort: agent.effort }),\n };\n}\n\n/**\n * Turns the installation this directory records into the payload the config store holds, so the\n * CLI can mint an id rather than only consume one.\n *\n * The inverse of `seedToWizardResult` in `seed-to-wizard.ts`, and held to it: a\n * payload minted here and decoded there has to describe the same install. That is why the scope\n * of every skill and sub-agent travels per entry rather than being implied, why the whole stack\n * is carried as per-`(skill, sub-agent)` assignments, and why nothing here leans on a wire default\n * the decoder would have to guess back.\n *\n * What it will not do is share a thinner configuration than the one installed. Anything the\n * contract cannot state is refused by name — see {@link unshareableConfigError} — because the\n * failure mode of the alternative is an id that silently installs something else.\n *\n * `stackId` is always null. A saved config records a stack's expansion and never the id it came\n * from, and the assignments above carry that expansion in full; naming an id this module invented\n * would make the receiver overlay a stack's own preload flags over the curation being shared.\n *\n * `description` is what a resolvable id would have supplied that the assignments do not, so it is\n * carried directly instead. That is the whole of the trade: the sentence travels, the roster the id\n * would have dragged behind it does not.\n *\n * `marketplace` is the one field carried for the payload rather than for an entry, because the\n * receiver loads one catalogue before it reads a single skill row — see {@link readMarketplace}.\n *\n * `carried` arrives as an argument because it is read off disk and this mapping touches none:\n * every id above is resolved by the receiver against a catalogue it already has, and the entries\n * in `carried` are the ones that answer to no catalogue in either direction. Stated rather than\n * defaulted, because a producer that forgot the content is exactly the defect this closed.\n *\n * `inheritedFrom` is the global configuration a project's own inherits from, absent when `config`\n * is the global one. It is read for one thing: the marketplace the inherited skills came from,\n * which this configuration does not record but the global one does.\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 rather than merely assembled, exactly as the web app's encoder is: it makes \"the JSON\n // the store will hold\" literal, and it is the one gate that catches a field whose values have\n // drifted out of the wire's enums since this module last named them.\n //\n // The INSTALLABLE half of the contract, which is the schema the store's POST route declares —\n // the lenient one exists for READING links already out in the world, and this module only ever\n // mints. It refuses nothing the refusal above permits, and that is the point: it is the belt\n // over those braces, so the day this module's own rule and the wire's disagree, the mint fails\n // loudly here instead of minting an id that cannot be installed.\n return installableSeedPayloadSchema.parse({\n v: SEED_VERSION,\n matrixVersion: MATRIX_VERSION,\n stackId: null,\n // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its\n // body, so a key meaning what its absence already means would remint every ordinary payload.\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 // Absent rather than empty, for the reason the marketplace ref is: an id is the hash of its\n // body, so a key meaning what its absence already means would remint every ordinary payload.\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;;;ACgDV,SAAS,YAAY,OAAwC;AAClE,SAAO,CAAC,MAAM;AAChB;AASA,SAAS,sBAAsB,QAAyB;AACtD,SAAO,WAAW,gBAAgB,WAAW;AAC/C;AAMA,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;AA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
|
6
|
-
import "./chunk-GE3WKJ6Q.js";
|
|
7
|
-
import "./chunk-A4KDXNOT.js";
|
|
8
|
-
import "./chunk-V5WXIM2F.js";
|
|
9
|
-
import "./chunk-ENGYJCTF.js";
|
|
10
|
-
import "./chunk-OI2H6M5I.js";
|
|
11
|
-
export {
|
|
12
|
-
loadAgentDefs
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=load-agent-defs-3C27ENC7.js.map
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
recompilePropagatedProjectAgents,
|
|
4
|
-
recompileRegisteredProjectAgents
|
|
5
|
-
} from "./chunk-HWEKHVLE.js";
|
|
6
|
-
import "./chunk-PMJWD27C.js";
|
|
7
|
-
import "./chunk-ZR4YPKXQ.js";
|
|
8
|
-
import "./chunk-GE3WKJ6Q.js";
|
|
9
|
-
import "./chunk-VAPTVR3J.js";
|
|
10
|
-
import "./chunk-A4KDXNOT.js";
|
|
11
|
-
import "./chunk-V5WXIM2F.js";
|
|
12
|
-
import "./chunk-ENGYJCTF.js";
|
|
13
|
-
import "./chunk-OI2H6M5I.js";
|
|
14
|
-
export {
|
|
15
|
-
recompilePropagatedProjectAgents,
|
|
16
|
-
recompileRegisteredProjectAgents
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=recompile-project-agents-DGNBCU3N.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{recompile-project-agents-DGNBCU3N.js.map → recompile-project-agents-7PQWYQ6B.js.map}
RENAMED
|
File without changes
|
|
File without changes
|