agents-inc 0.174.0 → 0.176.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 +115 -0
- package/dist/{chunk-APWMMZOK.js → chunk-3F5LT433.js} +157 -53
- package/dist/chunk-3F5LT433.js.map +1 -0
- package/dist/chunk-5CFHP6Z5.js +109 -0
- package/dist/chunk-5CFHP6Z5.js.map +1 -0
- package/dist/{chunk-3PJZ4QNJ.js → chunk-B7AVWSK2.js} +21 -11
- package/dist/chunk-B7AVWSK2.js.map +1 -0
- package/dist/{chunk-H5E6IO2L.js → chunk-C2BSCEDN.js} +9 -11
- package/dist/chunk-C2BSCEDN.js.map +1 -0
- package/dist/{chunk-R7GKQBZJ.js → chunk-CKBWEWHZ.js} +96 -52
- package/dist/chunk-CKBWEWHZ.js.map +1 -0
- package/dist/{chunk-IXVGBUWI.js → chunk-EC3JXT23.js} +5 -5
- package/dist/{chunk-E45IT3HC.js → chunk-ENET4IF6.js} +998 -472
- package/dist/chunk-ENET4IF6.js.map +1 -0
- package/dist/{chunk-FQF6VHO3.js → chunk-FACDJH6O.js} +12 -105
- package/dist/chunk-FACDJH6O.js.map +1 -0
- package/dist/{chunk-TVEDNGVP.js → chunk-H6WUOW5F.js} +2 -2
- package/dist/{chunk-7BHDKEGK.js → chunk-JNRACLNS.js} +3 -3
- package/dist/{chunk-IAQFZFWD.js → chunk-JTMSFBCA.js} +231 -24
- package/dist/chunk-JTMSFBCA.js.map +1 -0
- package/dist/{chunk-EFXVYQGT.js → chunk-MQZNDK5F.js} +39 -40
- package/dist/chunk-MQZNDK5F.js.map +1 -0
- package/dist/{chunk-QCX66KBM.js → chunk-SN64WNWE.js} +3 -3
- package/dist/{chunk-WUSEZFER.js → chunk-U46LYYRA.js} +3 -2
- package/dist/{chunk-WUSEZFER.js.map → chunk-U46LYYRA.js.map} +1 -1
- package/dist/{chunk-6PGXTLA4.js → chunk-U672FZVC.js} +2 -2
- package/dist/{chunk-AIBVAYHS.js → chunk-UE4Z3YMB.js} +2 -2
- package/dist/chunk-UE4Z3YMB.js.map +1 -0
- package/dist/{chunk-REHVGFJE.js → chunk-XMQIWPIR.js} +84 -32
- package/dist/chunk-XMQIWPIR.js.map +1 -0
- package/dist/{chunk-I3WF6L43.js → chunk-XYBHH3M5.js} +2 -2
- package/dist/{chunk-ECPFYHDX.js → chunk-ZBI6GFJD.js} +11 -11
- package/dist/chunk-ZBI6GFJD.js.map +1 -0
- package/dist/commands/build/marketplace.js +5 -4
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +7 -6
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +20 -16
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +106 -87
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +76 -48
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +31 -18
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -17
- package/dist/commands/list.js +10 -9
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +5 -4
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +14 -9
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +20 -22
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +24 -19
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +110 -31
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +4 -3
- package/dist/components/common/summary-panel.js +5 -4
- package/dist/hooks/init.js +24 -25
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-5BSECHE6.js +14 -0
- package/dist/{recompile-project-agents-KYK44C24.js → recompile-project-agents-U3UGHPWG.js} +8 -8
- package/dist/{source-loader-G5I4RNUP.js → source-loader-E2Y5MMN5.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-3PJZ4QNJ.js.map +0 -1
- package/dist/chunk-AIBVAYHS.js.map +0 -1
- package/dist/chunk-APWMMZOK.js.map +0 -1
- package/dist/chunk-E45IT3HC.js.map +0 -1
- package/dist/chunk-ECPFYHDX.js.map +0 -1
- package/dist/chunk-EFXVYQGT.js.map +0 -1
- package/dist/chunk-FQF6VHO3.js.map +0 -1
- package/dist/chunk-H5E6IO2L.js.map +0 -1
- package/dist/chunk-IAQFZFWD.js.map +0 -1
- package/dist/chunk-ORO2T4K2.js +0 -96
- package/dist/chunk-ORO2T4K2.js.map +0 -1
- package/dist/chunk-R7GKQBZJ.js.map +0 -1
- package/dist/chunk-REHVGFJE.js.map +0 -1
- package/dist/load-agent-defs-5U5KAURA.js +0 -14
- /package/dist/{chunk-IXVGBUWI.js.map → chunk-EC3JXT23.js.map} +0 -0
- /package/dist/{chunk-TVEDNGVP.js.map → chunk-H6WUOW5F.js.map} +0 -0
- /package/dist/{chunk-7BHDKEGK.js.map → chunk-JNRACLNS.js.map} +0 -0
- /package/dist/{chunk-QCX66KBM.js.map → chunk-SN64WNWE.js.map} +0 -0
- /package/dist/{chunk-6PGXTLA4.js.map → chunk-U672FZVC.js.map} +0 -0
- /package/dist/{chunk-I3WF6L43.js.map → chunk-XYBHH3M5.js.map} +0 -0
- /package/dist/{load-agent-defs-5U5KAURA.js.map → load-agent-defs-5BSECHE6.js.map} +0 -0
- /package/dist/{recompile-project-agents-KYK44C24.js.map → recompile-project-agents-U3UGHPWG.js.map} +0 -0
- /package/dist/{source-loader-G5I4RNUP.js.map → source-loader-E2Y5MMN5.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,121 @@ Each release has detailed notes in its own file under [`changelogs/`](./changelo
|
|
|
7
7
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
8
8
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
9
9
|
|
|
10
|
+
## [0.176.0] - 2026-10-31
|
|
11
|
+
|
|
12
|
+
**`update` moves every installed plugin to its newest version, every command checks a saved marketplace copy with no version stamp and falls back to it with a warning when a download fails, `init --from` takes back the skills and plugins it installed when it cannot save its configuration, a skill carried in a shared link must be named `external-…`, and the docs site gains a Releases section**
|
|
13
|
+
|
|
14
|
+
- CLI-918: `update` refreshes each marketplace, then moves every installed plugin to its newest version on Claude Code and Codex, naming any that fail.
|
|
15
|
+
- CLI-1002: on Codex, `update` switches a plugin you had switched off back off after updating it, or names it and ends with an error.
|
|
16
|
+
- CLI-1008: on Codex, `init --from` and `edit --from` name a switched-off plugin they could not switch back off and exit 1, instead of saying `continuing with cached version`.
|
|
17
|
+
- CLI-992: every command checks a saved marketplace copy with no version stamp, not only `doctor`.
|
|
18
|
+
- CLI-945: a failed download of a marketplace that moved on falls back to the saved copy and warns, for both kinds of source.
|
|
19
|
+
- CLI-982: `init --from` that cannot save its configuration removes the skill folders it copied and leaves home's config as it was.
|
|
20
|
+
- CLI-1001: it also uninstalls the plugins that run newly installed, and says how many copied and carried skills it removed.
|
|
21
|
+
- CLI-885: `init --from` and `edit --from` refuse carried skills whose ids do not start with `external-`.
|
|
22
|
+
- CLI-887: the marketplace a shared link names can no longer steer the carried-id guard.
|
|
23
|
+
- CLI-917: the refusal of a stack the marketplace does not ship ends `It ships: …`.
|
|
24
|
+
- CLI-916: `edit --from` says when an id names another marketplace than the installation's.
|
|
25
|
+
- CLI-921: declining `edit --from`'s question prints `Edit cancelled` once.
|
|
26
|
+
- CLI-971: in a project whose config declares nothing, each command says a line true for what it does there.
|
|
27
|
+
- CLI-1000: a project config naming nothing uses the global installation's marketplace in `compile`, `search`, `eject` and `doctor`.
|
|
28
|
+
- CLI-991: `list`, `compile`, `edit --from` and `doctor` read only the project's own tool's global installation.
|
|
29
|
+
- CLI-901: `uninstall` of a global Codex installation from home removes its ejected skills.
|
|
30
|
+
- CLI-979: `edit --from` at home removes a dropped plugin a project installed from another marketplace.
|
|
31
|
+
- CLI-995: `edit --from` moves a plugin from another marketplace between scopes under the marketplace it came from.
|
|
32
|
+
- CLI-911: under a custom-marketplace global, `init --from` with a public-catalogue id installs from the public catalogue.
|
|
33
|
+
- CLI-912: such a project records its marketplace as `agents-inc`.
|
|
34
|
+
- CLI-997: a public-catalogue project keeps its marketplace when a custom-marketplace global is installed afterwards.
|
|
35
|
+
- CLI-993: six more messages name skills as the `--from` summary does.
|
|
36
|
+
- CLI-996: skipped unregistered skill folders are reported in one line per skills folder.
|
|
37
|
+
- CLI-1004: the `Set category in …` warning names the absolute path of the skill's `metadata.yaml`.
|
|
38
|
+
- CLI-1007: `init --from` and `edit --from` install a stack from a declared `stacksFile`.
|
|
39
|
+
- CLI-1009: `doctor` checks a declared `stacksFile`.
|
|
40
|
+
- CLI-1011: `doctor` files a broken stacks file's warning against that file.
|
|
41
|
+
- CLI-1013: `doctor` files a broken `config/skill-rules.ts` against that file.
|
|
42
|
+
- CLI-1010: the config writer's unused import-the-global layout is gone.
|
|
43
|
+
- CLI-1012: what CLI-1010 left behind is gone.
|
|
44
|
+
- CLI-875: `packages/cli/CLAUDE.md` says a test reads an expected value from the file it comes from.
|
|
45
|
+
- CLI-845: the test helpers' config-types reader fails loudly, and two fixtures write config files byte for byte.
|
|
46
|
+
- CLI-1003: two more config layouts join the byte-for-byte check.
|
|
47
|
+
- CLI-994: two CLI e2e runs at once no longer break each other.
|
|
48
|
+
- CLI-1014: the CLI unit suite passes with a symlinked temp folder.
|
|
49
|
+
- CLI-1017: the CLI e2e suite passes with a long or symlinked temp path.
|
|
50
|
+
- EDITOR-58: the preview, a skill's contents, a long proposal and the Install dialog's lists scroll from the keyboard.
|
|
51
|
+
- EDITOR-61: a ruled-out skill's ••• button and switches show disabled.
|
|
52
|
+
- EDITOR-117: a ruled-out skill's open options panel closes, keeping its settings.
|
|
53
|
+
- EDITOR-62: a proposal with one change reads `1 change`.
|
|
54
|
+
- EDITOR-93: Tab across the stuck skills bar no longer throws the page up.
|
|
55
|
+
- EDITOR-96: the rename prompt no longer opens over a skill's Contents dialog.
|
|
56
|
+
- EDITOR-116: `ButtonGroupItem` no longer makes every option a Tab stop on `tabIndex={undefined}`.
|
|
57
|
+
- EDITOR-120: `SegmentedItem`, `LatticeRow` and `CommandBlock` no longer drop a Tab stop on `tabIndex={undefined}`.
|
|
58
|
+
- EDITOR-122: a failed editor build shows its own error.
|
|
59
|
+
- EDITOR-123: the Codex install dialog joins the two sub-agents it leaves out with "and".
|
|
60
|
+
- EDITOR-121: the editor's "or" list helper is renamed `inAnEnglishAlternative`.
|
|
61
|
+
- EDITOR-74: the editor's fake server gives every saved stack its own id.
|
|
62
|
+
- EDITOR-119: a spec pins a ruled-out cell's switches out of the Tab order.
|
|
63
|
+
- EDITOR-124: the editor's test gate runs its script tests.
|
|
64
|
+
- EDITOR-90: the design system's focus-outline checks are gone.
|
|
65
|
+
- EDITOR-118: the editor's eight focus-outline browser tests are gone.
|
|
66
|
+
- SERVER-13: every signed-in action renews the 90-day sign-in in the browser too.
|
|
67
|
+
- WWW-01: the docs site gains a Releases section, left out of search.
|
|
68
|
+
- REPO-49: CI runs each slow suite as two halves on two machines.
|
|
69
|
+
- REPO-52: `deps:check` refuses a test file its workspace never runs.
|
|
70
|
+
- REPO-53: a spec runs the real pre-commit hook.
|
|
71
|
+
- REPO-54: CI's CLI unit step runs with a symlinked temp folder.
|
|
72
|
+
- REPO-51: the briefing contract moved to `docs/briefing.md`.
|
|
73
|
+
- REPO-44: the CLI guide is condensed, and the standards, the journey page and the findings follow the code.
|
|
74
|
+
|
|
75
|
+
See [changelogs/0.176.0.md](./changelogs/0.176.0.md) for full details.
|
|
76
|
+
|
|
77
|
+
## [0.175.0] - 2026-10-27
|
|
78
|
+
|
|
79
|
+
**A project config that declares nothing is no longer an installation, a project under a home holding both tools reads only its own tool's global installation, `init --from` and `edit --from` refuse two more broken links before they ask, and an account refuses a second stack under a name it already holds**
|
|
80
|
+
|
|
81
|
+
- CLI-971: a project `config.ts` that declares nothing is not an installation; `compile`, `edit`, `list`, `share`, `update` and `doctor` say the global installation stands in, and `uninstall` leaves the file alone.
|
|
82
|
+
- CLI-984: a Codex project under a home holding both tools' global installations reads only the Codex one.
|
|
83
|
+
- CLI-934: a skill the marketplace ships and could not load is skipped as one it `could not load`, and a skill folder with no `SKILL.md` is warned on every load.
|
|
84
|
+
- CLI-972: the notices under the `init --from` and `edit --from` panel name each skill as the panel does.
|
|
85
|
+
- CLI-935: `init --from` and `edit --from` refuse a project-only skill on a global sub-agent whether or not the skill loads, writing nothing.
|
|
86
|
+
- CLI-936: they refuse a carried skill id longer than a folder name can be, before the panel, instead of crashing half-way.
|
|
87
|
+
- CLI-987: the confirm panel keeps its `Marketplace` and `Stack` labels whole beside a name too long for the line.
|
|
88
|
+
- CLI-988: a marketplace document's value written across lines stays on its one error line.
|
|
89
|
+
- CLI-933: `eject skills --force` and `eject all --force` restore every skill an earlier eject wrote.
|
|
90
|
+
- CLI-938: `doctor` keeps a download made in the same second as giget's saved copy, and other commands stop warning about a cached copy they just downloaded.
|
|
91
|
+
- CLI-930: a source checkout under a folder whose name starts with `dist` finds its own files.
|
|
92
|
+
- CLI-957: reading a marketplace folder no longer replaces the catalogue the rest of the run names skills from.
|
|
93
|
+
- CLI-939: the docs say a saved marketplace copy with no version stamp is checked only by `doctor`, and how to refresh it.
|
|
94
|
+
- CLI-941: `doctor`'s config check names every state of the config; its verdicts are unchanged.
|
|
95
|
+
- CLI-942: four metadata keys nothing read are gone.
|
|
96
|
+
- CLI-985: the detected installation no longer carries `skillsDir`.
|
|
97
|
+
- CLI-940: the e2e config writer accepts a project config carrying its global inline.
|
|
98
|
+
- CLI-981: the `edit --from` plugin-switch specs pin every plugin-host call, and the old-folder specs share one writer.
|
|
99
|
+
- CLI-983: `init --from`'s specs run behind a stand-in `claude`.
|
|
100
|
+
- CLI-989: no spec reaches the developer's real `claude`.
|
|
101
|
+
- CLI-986: a command spec's first Ink render in a test worker no longer fails its first attempt.
|
|
102
|
+
- CLI-990: `list` and the startup config check are pinned for a Codex project under a home holding both tools.
|
|
103
|
+
- SERVER-10: the worker refuses a stack save or rename under a name the account already holds, in any case, with a 409.
|
|
104
|
+
- SERVER-11: an editor sign-in lasts 90 days, renewed on use.
|
|
105
|
+
- SERVER-07: the worker's CORS check runs once per request.
|
|
106
|
+
- SERVER-09: the server dev spec no longer depends on the developer's `wrangler` cache.
|
|
107
|
+
- SERVER-12: the id-hashing spec finds its own qualifying stack id.
|
|
108
|
+
- EDITOR-111: while the account's stacks cannot be read, Save sends nothing and says `Saving needs your account's stacks first.`, with Retry; a name the account holds is refused in place.
|
|
109
|
+
- EDITOR-112: a failed read of the account's stack list reaches error monitoring.
|
|
110
|
+
- EDITOR-113: a sign-in that ends mid-read is treated as a list that could not be read.
|
|
111
|
+
- EDITOR-98: the Switch marketplace refusal reads as two sentences and offers a token only for 401, 403 or 404.
|
|
112
|
+
- EDITOR-100: the Switch marketplace dialog no longer says "loses nothing" when a waiting link or stack would replace the screen.
|
|
113
|
+
- EDITOR-114: leaving a shared link by loading another marketplace keeps the notice of what could not be placed.
|
|
114
|
+
- EDITOR-99: the accounts specs pass reliably, and the e2e dev server runs without live reload.
|
|
115
|
+
- EDITOR-115: the rail's six sign-in and sign-out refusal lines are pinned word for word.
|
|
116
|
+
- WWW-17: the site's tests fail on a new-tab link without `rel="noopener noreferrer"`.
|
|
117
|
+
- REPO-42: a spec runs the real pre-push hook and fails if it stops running a suite it must.
|
|
118
|
+
- REPO-46: CI's Node setup steps use `actions/setup-node@v7`.
|
|
119
|
+
- REPO-47: how two stack names compare has one definition, in `@workspace/matrix`.
|
|
120
|
+
- REPO-48: a change to a file outside `packages/cli` that a CLI spec reads reruns the CLI's tests.
|
|
121
|
+
- REPO-44: the standards, the journey page and the findings follow the code.
|
|
122
|
+
|
|
123
|
+
See [changelogs/0.175.0.md](./changelogs/0.175.0.md) for full details.
|
|
124
|
+
|
|
10
125
|
## [0.174.0] - 2026-10-24
|
|
11
126
|
|
|
12
127
|
**Every summary names a skill by the display name its install recorded, `init --from` and `edit --from` stop when a marketplace refuses the version check, every command says an old `.claude-src/` is ignored, and the editor says when an account's stacks could not be read, with Retry**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SelectList
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XYBHH3M5.js";
|
|
5
5
|
import {
|
|
6
6
|
openUrl
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-H6WUOW5F.js";
|
|
8
8
|
import {
|
|
9
9
|
fetchSeedConfig
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SN64WNWE.js";
|
|
11
11
|
import {
|
|
12
12
|
Confirm
|
|
13
13
|
} from "./chunk-OZXAJNLA.js";
|
|
@@ -18,10 +18,10 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
summaryPanelBlock,
|
|
20
20
|
useTerminalDimensions
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-C2BSCEDN.js";
|
|
22
22
|
import {
|
|
23
23
|
hostCompileNotices
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-U672FZVC.js";
|
|
25
25
|
import {
|
|
26
26
|
compileAgentsAllScopes,
|
|
27
27
|
compileProjectScope,
|
|
@@ -29,41 +29,44 @@ import {
|
|
|
29
29
|
movedGlobalAgentInputs,
|
|
30
30
|
sayCapturedWarnings,
|
|
31
31
|
writeProjectConfig
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-CKBWEWHZ.js";
|
|
33
33
|
import {
|
|
34
34
|
copyLocalSkills,
|
|
35
|
-
discoverInstalledSkills
|
|
36
|
-
|
|
35
|
+
discoverInstalledSkills,
|
|
36
|
+
removeSkillFoldersCreatedSince,
|
|
37
|
+
skillFoldersAt
|
|
38
|
+
} from "./chunk-XMQIWPIR.js";
|
|
37
39
|
import {
|
|
38
40
|
loadAgentDefs
|
|
39
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-JNRACLNS.js";
|
|
40
42
|
import {
|
|
41
43
|
render
|
|
42
44
|
} from "./chunk-KIK5EZYD.js";
|
|
43
|
-
import {
|
|
44
|
-
agentChangesAmong
|
|
45
|
-
} from "./chunk-FQF6VHO3.js";
|
|
46
|
-
import {
|
|
47
|
-
installationToName,
|
|
48
|
-
providerFlag,
|
|
49
|
-
providerNamedBy,
|
|
50
|
-
providerNeedsAConfigurationToInstall
|
|
51
|
-
} from "./chunk-ORO2T4K2.js";
|
|
52
45
|
import {
|
|
53
46
|
BaseCommand,
|
|
54
47
|
EXIT_CODES,
|
|
55
48
|
clearTerminalScreen,
|
|
56
49
|
holdInstalledGlobal,
|
|
50
|
+
installationToName,
|
|
57
51
|
installsAtHome,
|
|
58
52
|
joinedStatement,
|
|
59
53
|
notInstalledGlobally,
|
|
54
|
+
panelRowEntries,
|
|
55
|
+
providerFlag,
|
|
56
|
+
providerNamedBy,
|
|
57
|
+
providerNeedsAConfigurationToInstall,
|
|
60
58
|
readInstalledGlobal,
|
|
61
59
|
registerExternalSkills,
|
|
62
60
|
writeExternalSkills
|
|
63
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-JTMSFBCA.js";
|
|
62
|
+
import {
|
|
63
|
+
agentChangesAmong,
|
|
64
|
+
namedByActiveEntries
|
|
65
|
+
} from "./chunk-FACDJH6O.js";
|
|
64
66
|
import {
|
|
65
67
|
ERROR_MESSAGES,
|
|
66
68
|
INCOMPLETE_WORK_RECOVERY,
|
|
69
|
+
INFO_MESSAGES,
|
|
67
70
|
INSTALL_MODE_DESCRIPTIONS,
|
|
68
71
|
INSTALL_MODE_LABELS,
|
|
69
72
|
SHARED_CONFIG_ARRIVALS,
|
|
@@ -75,8 +78,11 @@ import {
|
|
|
75
78
|
applySharedConfigHere,
|
|
76
79
|
assertNamedSourceUsable,
|
|
77
80
|
buildAgentScopeMap,
|
|
81
|
+
buildMarketplacePluginRef,
|
|
82
|
+
carriedSkillsRemovedAfterRefusedSave,
|
|
78
83
|
carriedSkillsWritten,
|
|
79
84
|
chooseProviderForThisRun,
|
|
85
|
+
copiedSkillsRemovedAfterRefusedSave,
|
|
80
86
|
deriveInstallMode,
|
|
81
87
|
detectInstallation,
|
|
82
88
|
detectProjectInstallation,
|
|
@@ -87,11 +93,11 @@ import {
|
|
|
87
93
|
holdsItsOwnInstallation,
|
|
88
94
|
hostAt,
|
|
89
95
|
initSucceeded,
|
|
90
|
-
installBaseDir,
|
|
91
96
|
isHomeDirectory,
|
|
92
97
|
isLocalSource,
|
|
93
98
|
keptAsInstalledGlobally,
|
|
94
99
|
permissionFiles,
|
|
100
|
+
providerAtScope,
|
|
95
101
|
providerInUse,
|
|
96
102
|
providerToNameAt,
|
|
97
103
|
readFileSafe,
|
|
@@ -103,11 +109,12 @@ import {
|
|
|
103
109
|
sharedConfigExistingInstall,
|
|
104
110
|
stoppingOnARefusal,
|
|
105
111
|
subAgentChanged,
|
|
112
|
+
verbose,
|
|
106
113
|
warn
|
|
107
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-ENET4IF6.js";
|
|
108
115
|
import {
|
|
109
116
|
plural
|
|
110
|
-
} from "./chunk-
|
|
117
|
+
} from "./chunk-UE4Z3YMB.js";
|
|
111
118
|
import {
|
|
112
119
|
ASCII_LOGO,
|
|
113
120
|
CLI_COLORS,
|
|
@@ -119,12 +126,12 @@ import {
|
|
|
119
126
|
MAX_CONFIG_FILE_SIZE,
|
|
120
127
|
editorConfigUrl,
|
|
121
128
|
isActiveAt
|
|
122
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-U46LYYRA.js";
|
|
123
130
|
|
|
124
131
|
// src/cli/commands/init.tsx
|
|
125
132
|
import os from "os";
|
|
126
133
|
import "react";
|
|
127
|
-
import { Flags } from "@oclif/core";
|
|
134
|
+
import { Errors, Flags } from "@oclif/core";
|
|
128
135
|
import { Box as Box2, Text as Text2, useApp } from "ink";
|
|
129
136
|
import { partition } from "remeda";
|
|
130
137
|
|
|
@@ -356,6 +363,7 @@ var Init = class _Init extends BaseCommand {
|
|
|
356
363
|
const { flags } = await this.parse(_Init);
|
|
357
364
|
const projectDir = process.cwd();
|
|
358
365
|
this.settleTheProviderForThisRun(flags);
|
|
366
|
+
await this.sayWhenTheProjectsConfigDeclaresNothing(INFO_MESSAGES.DECLARES_NOTHING_TO_INIT_OVER);
|
|
359
367
|
if (opensTheEditor(flags)) {
|
|
360
368
|
return this.openEditor(
|
|
361
369
|
projectDir,
|
|
@@ -429,7 +437,7 @@ var Init = class _Init extends BaseCommand {
|
|
|
429
437
|
sourceResult
|
|
430
438
|
);
|
|
431
439
|
sayCapturedWarnings(startupMessages);
|
|
432
|
-
this.warnOfSkippedEntries(mapping);
|
|
440
|
+
this.warnOfSkippedEntries(mapping, sourceResult.unloadedSkillIds);
|
|
433
441
|
this.refuseAnEmptySelection(held.result, id);
|
|
434
442
|
const stackName = await this.stackNameOf(result.selectedStackId, sourceResult);
|
|
435
443
|
this.logWhatGoesWhere(held, installedGlobal, stackName, {
|
|
@@ -440,13 +448,16 @@ var Init = class _Init extends BaseCommand {
|
|
|
440
448
|
this.log("Setup cancelled");
|
|
441
449
|
return null;
|
|
442
450
|
}
|
|
451
|
+
const skillFoldersBefore = await skillFoldersAt(projectDir);
|
|
443
452
|
await this.writeCarriedSkills(arrivingCarried);
|
|
444
453
|
this.announceArrivingSkills(held, result.selectedAgents.length);
|
|
445
454
|
return {
|
|
446
455
|
result: held.result,
|
|
447
456
|
sourceResult,
|
|
448
457
|
sourceFlags,
|
|
449
|
-
installedAlready: new Set(held.installed.skillIds)
|
|
458
|
+
installedAlready: new Set(held.installed.skillIds),
|
|
459
|
+
skillFoldersBefore,
|
|
460
|
+
carriedSkillDirs: new Set(arrivingCarried.map(({ skillDir }) => skillDir))
|
|
450
461
|
};
|
|
451
462
|
}
|
|
452
463
|
/**
|
|
@@ -521,7 +532,13 @@ var Init = class _Init extends BaseCommand {
|
|
|
521
532
|
async writeCarriedSkills(carried) {
|
|
522
533
|
if (carried.length === 0) return;
|
|
523
534
|
await writeExternalSkills(carried);
|
|
524
|
-
|
|
535
|
+
const recorded = carried.map(({ id, skill }) => ({ id, displayName: skill.displayName }));
|
|
536
|
+
this.log(
|
|
537
|
+
carriedSkillsWritten(
|
|
538
|
+
carried.map(({ id }) => id),
|
|
539
|
+
namedByActiveEntries(recorded)
|
|
540
|
+
)
|
|
541
|
+
);
|
|
525
542
|
}
|
|
526
543
|
async loadSourceOrFail(flags, projectDir) {
|
|
527
544
|
try {
|
|
@@ -541,7 +558,14 @@ var Init = class _Init extends BaseCommand {
|
|
|
541
558
|
});
|
|
542
559
|
}
|
|
543
560
|
}
|
|
544
|
-
async handleInstallation({
|
|
561
|
+
async handleInstallation({
|
|
562
|
+
result,
|
|
563
|
+
sourceResult,
|
|
564
|
+
sourceFlags,
|
|
565
|
+
installedAlready,
|
|
566
|
+
skillFoldersBefore,
|
|
567
|
+
carriedSkillDirs
|
|
568
|
+
}, projectDir) {
|
|
545
569
|
const plan = planInstall(result, installedAlready);
|
|
546
570
|
this.logInstallPlan(plan);
|
|
547
571
|
const resolvedMarketplace = await this.marketplaceForPluginSkills(
|
|
@@ -550,21 +574,21 @@ var Init = class _Init extends BaseCommand {
|
|
|
550
574
|
projectDir
|
|
551
575
|
);
|
|
552
576
|
const copyResult = await this.copyEjectedSkills(plan, projectDir, sourceResult);
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
577
|
+
const pluginsNewlyInstalled = await this.installPluginSkillsNotingWhatWasHeld(
|
|
578
|
+
plan.pluginSkills,
|
|
579
|
+
resolvedMarketplace,
|
|
580
|
+
projectDir,
|
|
581
|
+
sourceResult.matrix
|
|
582
|
+
);
|
|
583
|
+
const configResult = await this.writeConfigReported(
|
|
584
|
+
result,
|
|
585
|
+
sourceResult,
|
|
586
|
+
sourceFlags,
|
|
587
|
+
projectDir,
|
|
588
|
+
{ skillFoldersBefore, carriedSkillDirs, copyResult, pluginsNewlyInstalled }
|
|
589
|
+
);
|
|
561
590
|
try {
|
|
562
|
-
const written = await this.
|
|
563
|
-
result,
|
|
564
|
-
sourceResult,
|
|
565
|
-
sourceFlags,
|
|
566
|
-
projectDir
|
|
567
|
-
);
|
|
591
|
+
const written = await this.compileWrittenConfig(configResult, projectDir);
|
|
568
592
|
this.reportSuccess(written, copyResult, projectDir);
|
|
569
593
|
await this.showPermissionNotice(projectDir);
|
|
570
594
|
} catch (error) {
|
|
@@ -599,8 +623,14 @@ var Init = class _Init extends BaseCommand {
|
|
|
599
623
|
this.log(skillsCopiedLine(copyResult, installMode, projectDir));
|
|
600
624
|
return copyResult;
|
|
601
625
|
}
|
|
602
|
-
|
|
603
|
-
|
|
626
|
+
/** Each plugin this run installed that the host did not already hold, at the scope it went to. */
|
|
627
|
+
async installPluginSkillsNotingWhatWasHeld(pluginSkills, marketplace, projectDir, matrix) {
|
|
628
|
+
if (marketplace === null) return [];
|
|
629
|
+
const heldBefore = await pluginRefsHeldAt(projectDir);
|
|
630
|
+
await this.installPluginSkillsReported(pluginSkills, marketplace, projectDir, matrix);
|
|
631
|
+
return pluginSkills.map(({ id, scope }) => ({ ref: buildMarketplacePluginRef(id, marketplace), scope })).filter(({ ref }) => !heldBefore(ref));
|
|
632
|
+
}
|
|
633
|
+
async compileWrittenConfig(configResult, projectDir) {
|
|
604
634
|
const agentScopeMap = buildAgentScopeMap(configResult.config);
|
|
605
635
|
const compileResult = await this.compileInstalledAgents(
|
|
606
636
|
configResult.propagation,
|
|
@@ -612,14 +642,18 @@ var Init = class _Init extends BaseCommand {
|
|
|
612
642
|
this.reportFanOut(configResult.propagation);
|
|
613
643
|
return { configResult, compileResult, agentScopeMap };
|
|
614
644
|
}
|
|
615
|
-
async writeConfigReported(result, sourceResult, flags, projectDir) {
|
|
645
|
+
async writeConfigReported(result, sourceResult, flags, projectDir, putDown) {
|
|
616
646
|
this.log("Generating configuration...");
|
|
617
|
-
const configResult = await
|
|
618
|
-
|
|
619
|
-
sourceResult,
|
|
647
|
+
const configResult = await this.takingBackOnFailure(
|
|
648
|
+
putDown,
|
|
620
649
|
projectDir,
|
|
621
|
-
|
|
622
|
-
|
|
650
|
+
() => writeProjectConfig({
|
|
651
|
+
selection: result,
|
|
652
|
+
sourceResult,
|
|
653
|
+
projectDir,
|
|
654
|
+
...flags.marketplace !== void 0 && { sourceFlag: flags.marketplace }
|
|
655
|
+
})
|
|
656
|
+
);
|
|
623
657
|
if (configResult.wasMerged) {
|
|
624
658
|
this.log(`Merged with existing config at ${configResult.existingConfigPath}`);
|
|
625
659
|
}
|
|
@@ -628,6 +662,27 @@ var Init = class _Init extends BaseCommand {
|
|
|
628
662
|
this.reportUnassignedSkills(configResult.config, result.skills);
|
|
629
663
|
return configResult;
|
|
630
664
|
}
|
|
665
|
+
/** Fails with the write's own cause once nothing this run put down is left with no config. */
|
|
666
|
+
async takingBackOnFailure(putDown, projectDir, write) {
|
|
667
|
+
try {
|
|
668
|
+
return await write();
|
|
669
|
+
} catch (error) {
|
|
670
|
+
const foldersRemoved = await removeNewSkillFolders(putDown.skillFoldersBefore, projectDir);
|
|
671
|
+
await uninstallEach(putDown.pluginsNewlyInstalled, projectDir);
|
|
672
|
+
this.failSayingWhatWasRemoved(error, skillsRemoved(putDown, foldersRemoved));
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
/** oclif prints a thrown error last, so this one is printed here and thrown already printed. */
|
|
676
|
+
failSayingWhatWasRemoved(error, removed) {
|
|
677
|
+
const lines = linesSayingWhatWasRemoved(removed);
|
|
678
|
+
if (lines.length === 0) this.handleError(error);
|
|
679
|
+
const message = getErrorMessage(error);
|
|
680
|
+
this.error(message, { exit: false });
|
|
681
|
+
for (const line of lines) this.log(line);
|
|
682
|
+
throw Object.assign(new Errors.CLIError(message, { exit: EXIT_CODES.ERROR }), {
|
|
683
|
+
skipOclifErrorHandling: true
|
|
684
|
+
});
|
|
685
|
+
}
|
|
631
686
|
async compileInstalledAgents(written, agentScopeMap, projectDir) {
|
|
632
687
|
this.log(STATUS_MESSAGES.COMPILING_AGENTS);
|
|
633
688
|
const agentDefs = await loadAgentDefs();
|
|
@@ -717,7 +772,15 @@ async function installedGlobalToHold(projectDir) {
|
|
|
717
772
|
function keptAsInstalledStatement(held, runFromHome) {
|
|
718
773
|
const { skillIds, agentNames } = held.keptAsInstalled;
|
|
719
774
|
if (skillIds.length === 0 && agentNames.length === 0) return [];
|
|
720
|
-
return [
|
|
775
|
+
return [
|
|
776
|
+
keptAsInstalledGlobally(
|
|
777
|
+
skillIds,
|
|
778
|
+
agentNames,
|
|
779
|
+
runFromHome.id,
|
|
780
|
+
runFromHome.provider,
|
|
781
|
+
panelRowEntries(held)
|
|
782
|
+
)
|
|
783
|
+
];
|
|
721
784
|
}
|
|
722
785
|
function inheritedGlobal(held, installedGlobal) {
|
|
723
786
|
if (installedGlobal === null) return { skills: [], agents: [] };
|
|
@@ -771,6 +834,47 @@ function installModeDescription({ installMode, ejectedSkills, pluginSkills }) {
|
|
|
771
834
|
if (installMode !== "mixed") return INSTALL_MODE_DESCRIPTIONS[installMode];
|
|
772
835
|
return `${INSTALL_MODE_LABELS.mixed} (${ejectedSkills.length} eject, ${pluginSkills.length} plugin)`;
|
|
773
836
|
}
|
|
837
|
+
async function pluginRefsHeldAt(projectDir) {
|
|
838
|
+
try {
|
|
839
|
+
const held = await hostAt(projectDir).listPlugins(projectDir);
|
|
840
|
+
const refs = new Set(held.map(({ pluginKey }) => pluginKey));
|
|
841
|
+
return (ref) => refs.has(ref);
|
|
842
|
+
} catch (error) {
|
|
843
|
+
verbose(`Could not read the plugins installed before this run: ${getErrorMessage(error)}`);
|
|
844
|
+
return () => true;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
async function removeNewSkillFolders(before, projectDir) {
|
|
848
|
+
try {
|
|
849
|
+
return await removeSkillFoldersCreatedSince(before, projectDir);
|
|
850
|
+
} catch (error) {
|
|
851
|
+
verbose(`Could not remove a skill folder this run made: ${getErrorMessage(error)}`);
|
|
852
|
+
return /* @__PURE__ */ new Set();
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
async function uninstallEach(plugins, projectDir) {
|
|
856
|
+
const host = hostAt(projectDir);
|
|
857
|
+
for (const { ref, scope } of plugins) {
|
|
858
|
+
await host.uninstallPlugin(ref, scope, projectDir).catch((error) => {
|
|
859
|
+
verbose(`Could not uninstall ${ref}, which this run installed: ${getErrorMessage(error)}`);
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
function skillsRemoved({ copyResult, carriedSkillDirs }, folders) {
|
|
864
|
+
const countRemoved = (dirs) => dirs.filter((dir) => folders.has(dir)).length;
|
|
865
|
+
const copies = copyDestinations(copyResult).filter((dir) => !carriedSkillDirs.has(dir));
|
|
866
|
+
return { copied: countRemoved(copies), carried: countRemoved([...carriedSkillDirs]) };
|
|
867
|
+
}
|
|
868
|
+
function copyDestinations(copyResult) {
|
|
869
|
+
if (copyResult === null) return [];
|
|
870
|
+
return [...copyResult.projectCopied, ...copyResult.globalCopied].map(({ destPath }) => destPath);
|
|
871
|
+
}
|
|
872
|
+
function linesSayingWhatWasRemoved({ copied, carried }) {
|
|
873
|
+
return [
|
|
874
|
+
...copied > 0 ? [copiedSkillsRemovedAfterRefusedSave(copied)] : [],
|
|
875
|
+
...carried > 0 ? [carriedSkillsRemovedAfterRefusedSave(carried)] : []
|
|
876
|
+
];
|
|
877
|
+
}
|
|
774
878
|
function compilesGlobalScope(cwd, written) {
|
|
775
879
|
return isHomeDirectory(cwd) || movedGlobalAgentInputs(written);
|
|
776
880
|
}
|
|
@@ -824,7 +928,7 @@ function agentsCompiledBlocks(projectDir, compiled, agentScopeMap) {
|
|
|
824
928
|
);
|
|
825
929
|
}
|
|
826
930
|
function compiledAgentsBlock(projectDir, scope, agents) {
|
|
827
|
-
const { extension } = agentCodec(
|
|
931
|
+
const { extension } = agentCodec(providerAtScope(projectDir, scope));
|
|
828
932
|
return {
|
|
829
933
|
dir: resolveInstallPaths(projectDir, scope).agentsDir,
|
|
830
934
|
entries: agents.map((name) => `${name}${extension}`)
|
|
@@ -868,4 +972,4 @@ export {
|
|
|
868
972
|
runDashboardFlow,
|
|
869
973
|
Init
|
|
870
974
|
};
|
|
871
|
-
//# sourceMappingURL=chunk-
|
|
975
|
+
//# sourceMappingURL=chunk-3F5LT433.js.map
|