@skaile/workspaces 1.6.1 → 1.8.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 +76 -0
- package/dist/{asset-feeds-PTZBWJEL.js → asset-feeds-Y66NCOQZ.js} +4 -4
- package/dist/{asset-feeds-PTZBWJEL.js.map → asset-feeds-Y66NCOQZ.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/asset-manager/src/index.d.ts.map +1 -1
- package/dist/chunk-34U5UC6G.js +284 -0
- package/dist/chunk-34U5UC6G.js.map +1 -0
- package/dist/{chunk-EA73UA42.js → chunk-35OWUKOD.js} +2 -2
- package/dist/{chunk-EA73UA42.js.map → chunk-35OWUKOD.js.map} +1 -1
- package/dist/{chunk-4OVPB7SI.js → chunk-6K6T2RBP.js} +6 -2
- package/dist/chunk-6K6T2RBP.js.map +1 -0
- package/dist/{chunk-M4UKIJ5K.js → chunk-M3Y5KM6F.js} +28 -13
- package/dist/chunk-M3Y5KM6F.js.map +1 -0
- package/dist/{chunk-Y5B5272E.js → chunk-MB6563TL.js} +16 -3
- package/dist/chunk-MB6563TL.js.map +1 -0
- package/dist/{chunk-SH55Z5QA.js → chunk-O3D4KYFG.js} +3 -3
- package/dist/{chunk-SH55Z5QA.js.map → chunk-O3D4KYFG.js.map} +1 -1
- package/dist/{chunk-SNN6O7ON.js → chunk-PP2LOT4W.js} +43 -7
- package/dist/chunk-PP2LOT4W.js.map +1 -0
- package/dist/{chunk-HIATVS2E.js → chunk-S74G7AZL.js} +3 -3
- package/dist/{chunk-HIATVS2E.js.map → chunk-S74G7AZL.js.map} +1 -1
- package/dist/{chunk-NTYCGPZ3.js → chunk-THJZ3JZE.js} +6 -6
- package/dist/{chunk-NTYCGPZ3.js.map → chunk-THJZ3JZE.js.map} +1 -1
- package/dist/{chunk-X7G2CCW4.js → chunk-TITPPC54.js} +3 -3
- package/dist/{chunk-X7G2CCW4.js.map → chunk-TITPPC54.js.map} +1 -1
- package/dist/{chunk-NRWDQBZ7.js → chunk-VBRXFLIP.js} +3 -3
- package/dist/{chunk-NRWDQBZ7.js.map → chunk-VBRXFLIP.js.map} +1 -1
- package/dist/{chunk-MY7TSVO7.js → chunk-Y3UCU4ZK.js} +6 -2
- package/dist/chunk-Y3UCU4ZK.js.map +1 -0
- package/dist/{chunk-OJ7G56I7.js → chunk-Y6FV73IH.js} +57 -3
- package/dist/chunk-Y6FV73IH.js.map +1 -0
- package/dist/cli/index.js +239 -387
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/library-cmd.d.ts.map +1 -1
- package/dist/cli/src/commands/library-index.d.ts +12 -2
- package/dist/cli/src/commands/library-index.d.ts.map +1 -1
- package/dist/cli/src/commands/library-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/manage.d.ts.map +1 -1
- package/dist/cli/src/commands/publish-core.d.ts +24 -0
- package/dist/cli/src/commands/publish-core.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-query.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/remote-tail.d.ts.map +1 -1
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts +12 -0
- package/dist/cli/src/commands/session-logs/superjson-transformer.d.ts.map +1 -0
- package/dist/cli/src/commands/source-manifest-publish.d.ts.map +1 -1
- package/dist/cli/src/commands/store.d.ts.map +1 -1
- package/dist/cli/src/store-auth.d.ts +11 -0
- package/dist/cli/src/store-auth.d.ts.map +1 -1
- package/dist/cli/src/store-publisher.d.ts +24 -1
- package/dist/cli/src/store-publisher.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/src/config.d.ts +21 -0
- package/dist/connectors/src/config.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/{ensure-sources-ORACQA4I.js → ensure-sources-NXBYK5GP.js} +4 -4
- package/dist/{ensure-sources-ORACQA4I.js.map → ensure-sources-NXBYK5GP.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +2 -2
- package/dist/factory-assets/connectors/deploy.js +2 -2
- package/dist/factory-assets/connectors/devserver.js +2 -2
- package/dist/factory-assets/connectors/flow/adapter.js +2 -2
- package/dist/factory-assets/connectors/flow/run-flow.js +3 -3
- package/dist/factory-assets/connectors/flow.js +2 -2
- package/dist/factory-assets/connectors/git.js +2 -2
- package/dist/factory-assets/connectors/gmail.js +2 -2
- package/dist/factory-assets/connectors/googledrive.js +2 -2
- package/dist/factory-assets/connectors/local.js +2 -2
- package/dist/factory-assets/connectors/mattermost.js +2 -2
- package/dist/factory-assets/connectors/memory.js +2 -2
- package/dist/factory-assets/connectors/minio.js +2 -2
- package/dist/factory-assets/connectors/postgres.js +2 -2
- package/dist/factory-assets/connectors/s3.js +2 -2
- package/dist/factory-assets/connectors/sharepoint.js +2 -2
- package/dist/factory-assets/connectors/sqlite.js +2 -2
- package/dist/factory-assets/connectors/static-server.js +2 -2
- package/dist/factory-assets/connectors/tunnel.js +2 -2
- package/dist/factory-assets/connectors/webdav.js +2 -2
- package/dist/factory-assets/connectors/xstate-store.js +2 -2
- package/dist/factory-assets/connectors/xstate.js +2 -2
- package/dist/{helpers-SXGIHFCF.js → helpers-DN4MWOHB.js} +4 -4
- package/dist/{helpers-SXGIHFCF.js.map → helpers-DN4MWOHB.js.map} +1 -1
- package/dist/{library-publish-NQQFPOUY.js → library-publish-TPWFSO3Q.js} +24 -8
- package/dist/library-publish-TPWFSO3Q.js.map +1 -0
- package/dist/{open-library-ODW2PJ2J.js → open-library-ST2VFQTK.js} +5 -5
- package/dist/{open-library-ODW2PJ2J.js.map → open-library-ST2VFQTK.js.map} +1 -1
- package/dist/project-4M6QXHCH.js +28 -0
- package/dist/project-4M6QXHCH.js.map +1 -0
- package/dist/run-group-engine/index.d.ts +2 -0
- package/dist/run-group-engine/index.js +68 -0
- package/dist/run-group-engine/index.js.map +1 -0
- package/dist/run-group-engine/src/admit.d.ts +13 -0
- package/dist/run-group-engine/src/admit.d.ts.map +1 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts +9 -0
- package/dist/run-group-engine/src/derive-instance-status.d.ts.map +1 -0
- package/dist/run-group-engine/src/index.d.ts +5 -0
- package/dist/run-group-engine/src/index.d.ts.map +1 -0
- package/dist/run-group-engine/src/plan-retry.d.ts +11 -0
- package/dist/run-group-engine/src/plan-retry.d.ts.map +1 -0
- package/dist/run-group-engine/src/rollup.d.ts +16 -0
- package/dist/run-group-engine/src/rollup.d.ts.map +1 -0
- package/dist/runner/index.js +4 -4
- package/dist/runner/src/resources.d.ts +8 -2
- package/dist/runner/src/resources.d.ts.map +1 -1
- package/dist/runner/src/serve.d.ts.map +1 -1
- package/dist/runner/src/session-builder.d.ts +10 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/index.js +4 -4
- package/dist/sdk/runner.js +4 -4
- package/dist/sdk/store.js +1 -1
- package/dist/{source-KPH66TXY.js → source-KUWAEJOO.js} +6 -6
- package/dist/{source-KPH66TXY.js.map → source-KUWAEJOO.js.map} +1 -1
- package/dist/{source-manifest-publish-HJ5G4CTH.js → source-manifest-publish-FTSKRYPI.js} +12 -10
- package/dist/source-manifest-publish-FTSKRYPI.js.map +1 -0
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/tui/index.js +4 -4
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/run-group.d.ts +148 -0
- package/dist/types/src/run-group.d.ts.map +1 -0
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +7 -1
- package/dist/chunk-4OVPB7SI.js.map +0 -1
- package/dist/chunk-M4UKIJ5K.js.map +0 -1
- package/dist/chunk-MY7TSVO7.js.map +0 -1
- package/dist/chunk-OJ7G56I7.js.map +0 -1
- package/dist/chunk-SNN6O7ON.js.map +0 -1
- package/dist/chunk-Y5B5272E.js.map +0 -1
- package/dist/library-publish-NQQFPOUY.js.map +0 -1
- package/dist/source-manifest-publish-HJ5G4CTH.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,81 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#378](https://github.com/skaile-ai/workspaces/pull/378) [`0c1104f`](https://github.com/skaile-ai/workspaces/commit/0c1104f46aab6e839f8ad14a4067f6818c906747) Thanks [@peteralbert](https://github.com/peteralbert)! - Add the run-group contract: shared types (`@skaile/workspaces/types`:
|
|
8
|
+
RunGroup, RunInstance, InputEnvelope, RunGroupPolicy, ...) and the pure
|
|
9
|
+
`@skaile/workspaces/run-group-engine` helpers (deriveInstanceStatus, admit,
|
|
10
|
+
rollup, planRetry) for the fan-out / dark-automation layer. Contract doc:
|
|
11
|
+
docs/run-group-execution.md. No runtime behavior changes.
|
|
12
|
+
|
|
13
|
+
- [#373](https://github.com/skaile-ai/workspaces/pull/373) [`2c2336b`](https://github.com/skaile-ai/workspaces/commit/2c2336bac1ffd45e9f6b314d818e98f9da3886e0) Thanks [@P1umPudding](https://github.com/P1umPudding)! - Wire `skaile store search <query>` and `skaile store show <ref>` (previously stubs).
|
|
14
|
+
|
|
15
|
+
- `store search` browses the remote catalog: `openCatalogSource` → `listAssets` (with a server-side `--kind` filter) → client-side `filterCatalogAssets` over name/description/publisher (same query semantics as `skaile search --store`), printing copyable `kind:@publisher/name#version` refs.
|
|
16
|
+
- `store show` prints a store asset's details plus provenance: `resolve(ref)` for the card (kind, publisher, version, description, category, license, soft-deps) and `getInstallManifest(ref)` for the pointer triple (tier, source repo + commit, per-file SHA256, composite integrity). Provenance is shown only for the tRPC `RemoteCatalogSource` (guarded by `supportsInstallManifest`); a `catalog.url: local` config surfaces a clear disabled message.
|
|
17
|
+
|
|
18
|
+
- [#377](https://github.com/skaile-ai/workspaces/pull/377) [`ce486a0`](https://github.com/skaile-ai/workspaces/commit/ce486a030b7e8305a9cda0300b8ebc7fe6ff4ca3) Thanks [@peteralbert](https://github.com/peteralbert)! - `AgentStore`: treat a mid-turn human message as a streaming boundary so the assistant's in-flight text finalizes as its own message instead of running on.
|
|
19
|
+
|
|
20
|
+
- `_handleEvent` now flushes streaming text on a `user_message` event (a peer's message broadcast while the agent streams), so observers see the current bubble close and the next `text` delta open a fresh one after the interjection.
|
|
21
|
+
- `prompt()` flushes any in-flight streaming text before appending the prompt, so a sender who interjects mid-turn doesn't merge the agent's partial reply into their own message.
|
|
22
|
+
|
|
23
|
+
Both are flush-only and idempotent (no-op at turn start). Fixes the run-on assistant bubble on interjection (skaile-ai/platform#1553).
|
|
24
|
+
|
|
25
|
+
## 1.7.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- [#371](https://github.com/skaile-ai/workspaces/pull/371) [`d7b6224`](https://github.com/skaile-ai/workspaces/commit/d7b62247e956af89ab5deae61c8919f1c2eba7ee) Thanks [@Frozen666](https://github.com/Frozen666)! - feat(runner): register connectors from the `session_init` resolvedConfig when disk declares none. New `resolvedConfigToDeclarations()` export in `@skaile/workspaces/connectors` maps the Protocol v3 wire mounts/connectors (flat `source`/`target`/`watch`) to `ConnectorDeclaration[]`; serve mode passes the result as the new optional `AgentSessionConfig.fallbackConnectorDeclarations`. Disk-first invariant: the fallback engages only when `skaile.yaml` + materialized assets yield zero declarations (broker mode, where no yaml file is bound into the container) — any disk declaration keeps behavior byte-identical to before. CLI/flow/REPL callers are unaffected.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- [#364](https://github.com/skaile-ai/workspaces/pull/364) [`53380bc`](https://github.com/skaile-ai/workspaces/commit/53380bc9dc836a4ae6ed994addc1be76458e58c9) Thanks [@Frozen666](https://github.com/Frozen666)! - fix(cli): configure the SuperJSON transformer on the remote `session logs` tRPC client (query + tail). The platform tRPC server uses SuperJSON, so without a matching transformer every remote call failed with "Unable to transform response from server", making `skaile session logs --platform-url …` unusable against the deployed platform.
|
|
34
|
+
|
|
35
|
+
- [#372](https://github.com/skaile-ai/workspaces/pull/372) [`8cea0fd`](https://github.com/skaile-ai/workspaces/commit/8cea0fde55ed5b9a91e84d31afa02f85b60a61d4) Thanks [@P1umPudding](https://github.com/P1umPudding)! - Fix four issues surfaced in a CLI test round:
|
|
36
|
+
|
|
37
|
+
- `source manifest publish` now defaults the publisher namespace to the verified GitHub handle (`githubLogin ?? username`), matching the `library create` / publish-preflight precedence. A user whose store login differs from their GitHub handle no longer defaults to a reserved `@<login>` namespace (`--as` still overrides).
|
|
38
|
+
- `install --locked` now restores bundled factory (`@skaile-ai/*`) assets. The bundled factory source shares the ai-assets identity URL but ships its bytes in the package; lock verification now resolves it to its bundled tree (and skips the fetch) instead of the ai-assets clone, whose tree never contained the bundled paths — which made `verifyLock` false-report every factory asset as `missing`.
|
|
39
|
+
- `skaile manage` now exits with a clear "requires an interactive terminal" message when stdin is not a TTY, instead of an uncaught `setRawMode` TypeError.
|
|
40
|
+
- The `preset init` template declares placeholders per-item (schema-valid) instead of at the top level, so authored placeholders resolve and `preset validate` counts them.
|
|
41
|
+
|
|
42
|
+
- [#357](https://github.com/skaile-ai/workspaces/pull/357) [`6b90565`](https://github.com/skaile-ai/workspaces/commit/6b905650ae8b8ea474dd8fff56f96695ee63c78c) Thanks [@P1umPudding](https://github.com/P1umPudding)! - `library publish --dry-run` now surfaces a namespace-availability status line
|
|
43
|
+
when you are signed in to the store. Before committing a publish you can see
|
|
44
|
+
whether the manifest's `publisher` namespace is yours, claimable-by-you,
|
|
45
|
+
already reserved, or freely available — reusing the store's own read-only
|
|
46
|
+
availability probe so the advisory can't drift from what a real publish
|
|
47
|
+
enforces. The check is best-effort: it makes a single read-only GET and is
|
|
48
|
+
silently skipped when offline or not signed in, so the dry-run stays fully
|
|
49
|
+
offline-safe.
|
|
50
|
+
|
|
51
|
+
- [#359](https://github.com/skaile-ai/workspaces/pull/359) [`ee301ed`](https://github.com/skaile-ai/workspaces/commit/ee301ed8d18d2f00e69f0f3ac3b4acc6c536871a) Thanks [@P1umPudding](https://github.com/P1umPudding)! - `library create` now stamps the author's verified store identity (GitHub handle,
|
|
52
|
+
else Keycloak username) as the asset publisher instead of the library name — the
|
|
53
|
+
library name was almost never a namespace the author could publish, so publishes
|
|
54
|
+
only failed at the store. `resolveLibraryPublisher` gains an injected store-identity
|
|
55
|
+
fallback (precedence: `--publisher` → domain → store identity → library name), and
|
|
56
|
+
a new `getStoreIdentity()` decodes it locally from the cached token (no network).
|
|
57
|
+
|
|
58
|
+
`library publish` / `register` now preflight the target namespace against the
|
|
59
|
+
store's availability probe **before** the public git push: a `reserved` or
|
|
60
|
+
`claimable-by-you` namespace aborts fast with guided next steps (claim it / connect
|
|
61
|
+
GitHub) instead of pushing bytes and then failing with a raw 422. The probe is
|
|
62
|
+
advisory — an offline failure never blocks a valid publish.
|
|
63
|
+
|
|
64
|
+
- [#355](https://github.com/skaile-ai/workspaces/pull/355) [`5cade1f`](https://github.com/skaile-ai/workspaces/commit/5cade1f812ea08d50cfccfff06e41aede9d794f1) Thanks [@P1umPudding](https://github.com/P1umPudding)! - `library publish` / `register` / `source manifest publish` now send the manifest's
|
|
65
|
+
`publisher` as the target `namespace` to the store's `sources.add`. When it
|
|
66
|
+
matches your store login the store takes the personal path (unchanged); when it's
|
|
67
|
+
a **claimed** namespace (e.g. `@P1umPudding` ≠ your login), the store resolves the
|
|
68
|
+
claimed Publisher, so you can publish under a namespace that isn't your login
|
|
69
|
+
username. Requires the namespace to be claimed in the storefront first.
|
|
70
|
+
|
|
71
|
+
- [#367](https://github.com/skaile-ai/workspaces/pull/367) [`9f86b3a`](https://github.com/skaile-ai/workspaces/commit/9f86b3a17146bbe9508eb79de132c9651bd23f77) Thanks [@P1umPudding](https://github.com/P1umPudding)! - `skaile store login` / `whoami` no longer conflate your login name with your
|
|
72
|
+
publisher namespace. Login showed `Signed in as @plumpudding` and `whoami`
|
|
73
|
+
labelled `@plumpudding` as your **Publisher** — but `@plumpudding` is your
|
|
74
|
+
Keycloak login, not a namespace you publish under (your namespace is your GitHub
|
|
75
|
+
handle, e.g. `@P1umPudding`). Now: login says `Signed in as plumpudding —
|
|
76
|
+
publishing as @P1umPudding`, and `whoami` shows `Login` and `Publisher` (the
|
|
77
|
+
connected GitHub handle, or "connect GitHub to publish") as separate lines.
|
|
78
|
+
|
|
3
79
|
## 1.6.1
|
|
4
80
|
|
|
5
81
|
### Patch Changes
|
|
@@ -64,7 +64,7 @@ async function libraryAssets() {
|
|
|
64
64
|
const domains = [];
|
|
65
65
|
try {
|
|
66
66
|
const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([
|
|
67
|
-
import('./open-library-
|
|
67
|
+
import('./open-library-ST2VFQTK.js'),
|
|
68
68
|
import('./library/index.js'),
|
|
69
69
|
import('./core/index.js')
|
|
70
70
|
]);
|
|
@@ -97,7 +97,7 @@ async function libraryAssets() {
|
|
|
97
97
|
async function storeAssets(projectDir) {
|
|
98
98
|
const notes = [];
|
|
99
99
|
try {
|
|
100
|
-
const { resolveCatalogSource } = await import('./open-library-
|
|
100
|
+
const { resolveCatalogSource } = await import('./open-library-ST2VFQTK.js');
|
|
101
101
|
const { source, close } = await resolveCatalogSource({ projectDir });
|
|
102
102
|
try {
|
|
103
103
|
const assets = await source.listAssets();
|
|
@@ -201,5 +201,5 @@ function dedupeBySlug(domains) {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
export { gatherAssetFeeds };
|
|
204
|
-
//# sourceMappingURL=asset-feeds-
|
|
205
|
-
//# sourceMappingURL=asset-feeds-
|
|
204
|
+
//# sourceMappingURL=asset-feeds-Y66NCOQZ.js.map
|
|
205
|
+
//# sourceMappingURL=asset-feeds-Y66NCOQZ.js.map
|
|
@@ -1 +1 @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O;AAAA,KAC/B;AAAA;AAAA;AAAA,IAGA,OAAA,EAAS,YAAA,CAAa,CAAC,GAAG,MAAM,OAAA,EAAS,GAAG,GAAA,CAAI,OAAA,EAAS,GAAG,IAAA,CAAK,OAAA,EAAS,GAAG,OAAA,CAAQ,OAAO,CAAC,CAAA;AAAA,IAC7F,KAAA,EAAO,CAAC,GAAG,IAAA,CAAK,KAAA,EAAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF;AAGA,SAAS,aAAa,OAAA,EAA2C;AAC/D,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,MAAM,MAAuB,EAAC;AAC9B,EAAA,KAAA,MAAW,KAAK,OAAA,EAAS;AACvB,IAAA,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,IAAI,CAAA,EAAG;AACtB,IAAA,IAAA,CAAK,GAAA,CAAI,EAAE,IAAI,CAAA;AACf,IAAA,GAAA,CAAI,KAAK,CAAC,CAAA;AAAA,EACZ;AACA,EAAA,OAAO,GAAA;AACT","file":"asset-feeds-PTZBWJEL.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n factoryAssetRoots,\n parseFrontmatter,\n scanRepo,\n walkDir,\n} from \"@skaile/workspaces/core\";\nimport {\n assignDomain,\n buildDomainIndex,\n DOMAIN_MD_FILENAME,\n type DomainMd,\n parseDomainMd,\n} from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n// ── Domain stamping (on-disk feeds) ──────────────────────────────────────────\n//\n// `scanRepo` (the source / library / factory scan path) does not read the\n// `DOMAIN.md` sidecars, so its entries arrive with no `domainSlug` and render\n// flat under their publisher band. We re-derive the grouping here from the\n// root's `DOMAIN.md` files (the same sidecars the remote store computes\n// server-side), and fall back to the repo/source name for any entry no domain\n// claims so it still groups instead of landing in the synthetic \"no domain\" pile.\n\n/** Repo-relative POSIX path (DOMAIN.md slugs are matched whole-segment, `/`-joined). */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** Parse every `DOMAIN.md` sidecar under `root` into a {@link DomainMd}. */\nfunction loadDomainMds(root: string): DomainMd[] {\n const out: DomainMd[] = [];\n for (const { path: filePath, name } of walkDir(root)) {\n if (name !== DOMAIN_MD_FILENAME) continue;\n try {\n const { data } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n out.push(parseDomainMd(toPosix(path.relative(root, filePath)), data));\n } catch {}\n }\n return out;\n}\n\n/**\n * Stamp `domainSlug` onto every entry scanned from `root` using the root's\n * `DOMAIN.md` sidecars. Returns the `CatalogDomain` registry for the real\n * domains, plus a synthetic fallback domain when any entry used the fallback.\n * Mutates `entries` in place (sets `entry.domainSlug`).\n *\n * `synthesizeFallback` (default true): entries no domain claims fall back to\n * `fallbackSlug` (the repo/source name). Pass `false` when the caller already\n * groups these entries one level up (e.g. the source feed groups by source\n * node) — unmatched entries then get no domain (`\"\"`) and hang directly under\n * that parent, instead of nesting under a same-named fallback domain.\n */\nfunction stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): CatalogDomain[] {\n const domainMds = loadDomainMds(root);\n const assignables = entries.map((entry) => ({\n entry,\n ref: `${entry.kind}:${entry.name}`,\n relativePath: toPosix(path.relative(root, entry.source)),\n }));\n\n let usedFallback = false;\n for (const a of assignables) {\n const slug = assignDomain(a.relativePath, domainMds);\n if (slug) a.entry.domainSlug = slug;\n else if (synthesizeFallback) {\n a.entry.domainSlug = fallbackSlug;\n usedFallback = true;\n } else a.entry.domainSlug = \"\";\n }\n\n const { index } = buildDomainIndex(assignables, domainMds);\n const catalog: CatalogDomain[] = Object.values(index).map((d) => ({\n slug: d.slug,\n title: d.title,\n ...(d.description ? { description: d.description } : {}),\n ...(d.relation ? { relation: d.relation } : {}),\n ...(d.order !== undefined ? { order: d.order } : {}),\n ...(d.recommended[0] ? { recommendedRef: d.recommended[0] } : {}),\n }));\n if (usedFallback) catalog.push({ slug: fallbackSlug, title: fallbackSlug });\n return catalog;\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and grouped under the bare library\n * name (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix and no redundant same-named fallback domain (mirrors the\n * source feed).\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n import(\"@skaile/workspaces/core\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n // Authoring libraries are the rows that are NOT source clones. index.db\n // rows predating the cache migration still carry the legacy\n // ~/.skaile/sources path, so exclude both roots.\n const newRoot = getGlobalCacheDir();\n const legacyRoot = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter(\n (l) => !l.path.startsWith(newRoot) && !l.path.startsWith(legacyRoot),\n );\n const entries: OriginEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n // Scan + group under the bare library name. `synthesizeFallback: false`\n // (as the source feed does) keeps domainless assets directly under the\n // library band instead of a redundant same-named fallback domain.\n const libEntries = [...scanRepo(lib.path, lib.name)];\n domains.push(...stampDomains(lib.path, lib.name, libEntries, false));\n for (const entry of libEntries) entries.push({ origin: \"library\", entry, group: lib.name });\n }\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => CatalogEntry[];\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map, then stamps\n * `DOMAIN.md`-derived domain grouping onto the scanned entries via\n * `searchRepoRoots()`.\n */\nfunction sourceAssets(am: AssetManagerLike): { entries: OriginEntry[]; domains: CatalogDomain[] } {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = am.search().filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n const domains: CatalogDomain[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group + stamp by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n // No synthetic fallback domain — the source node already groups these, so a\n // same-named fallback would just nest the source under itself.\n domains.push(...stampDomains(root, sourceName, owned, false));\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return { entries, domains };\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Synchronous, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nfunction factoryAssets(): { entries: CatalogEntry[]; domains: CatalogDomain[]; notes: FeedNote[] } {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...scanRepo(root, \"skaile-factory\")];\n domains.push(...stampDomains(root, \"skaile-factory\", rootEntries));\n entries.push(...rootEntries);\n }\n return { entries, domains, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local + synchronous, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = factoryAssets();\n const src = sourceAssets(am);\n return {\n entries: [\n ...src.entries,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n // Store domains first (server-curated), then the on-disk feeds; dedupe by\n // slug, first-wins, so a store-served domain shadows a same-slug local one.\n domains: dedupeBySlug([...store.domains, ...src.domains, ...libs.domains, ...factory.domains]),\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n\n/** First-wins dedupe of a domain list by `slug`. */\nfunction dedupeBySlug(domains: CatalogDomain[]): CatalogDomain[] {\n const seen = new Set<string>();\n const out: CatalogDomain[] = [];\n for (const d of domains) {\n if (seen.has(d.slug)) continue;\n seen.add(d.slug);\n out.push(d);\n }\n return out;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../cli/src/asset-feeds.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAqFA,SAAS,QAAQ,CAAA,EAAmB;AAClC,EAAA,OAAO,CAAA,CAAE,KAAA,CAAW,IAAA,CAAA,GAAG,CAAA,CAAE,KAAK,GAAG,CAAA;AACnC;AAGA,SAAS,cAAc,IAAA,EAA0B;AA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AAO,GAAG,KAAA,CAAM,KAAA,EAAO,GAAG,OAAA,CAAQ,KAAK;AAAA,GACzD;AACF;AAGA,SAAS,aAAa,OAAA,EAA2C;AAC/D,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,MAAM,MAAuB,EAAC;AAC9B,EAAA,KAAA,MAAW,KAAK,OAAA,EAAS;AACvB,IAAA,IAAI,IAAA,CAAK,GAAA,CAAI,CAAA,CAAE,IAAI,CAAA,EAAG;AACtB,IAAA,IAAA,CAAK,GAAA,CAAI,EAAE,IAAI,CAAA;AACf,IAAA,GAAA,CAAI,KAAK,CAAC,CAAA;AAAA,EACZ;AACA,EAAA,OAAO,GAAA;AACT","file":"asset-feeds-Y66NCOQZ.js","sourcesContent":["/**\n * asset-feeds.ts — gather installable assets from every feed the manage TUI\n * surfaces.\n *\n * Four feeds, normalized into `CatalogEntry`:\n * - **Project sources** — `skaile.yaml` `sources:` entries (scanned via\n * `AssetManager.search()`; the new `sources:` field is merged into the\n * legacy repositories map in `AssetManager.loadConfig`).\n * - **Local libraries** — user authoring places from `LocalIndex` (filesystem\n * scan of each library's `path`).\n * - **Factory assets** — the bundled first-party `factory-assets` tree\n * (`factoryAssetRoots()`), scanned from disk. Always present; no network.\n * - **Remote store** — the configured catalog source when `catalog.url` is\n * not `local`. Failures are non-fatal — they surface as notes.\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport * as path from \"node:path\";\nimport {\n type AssetKind,\n type CatalogDomain,\n type CatalogEntry,\n factoryAssetRoots,\n parseFrontmatter,\n scanRepo,\n walkDir,\n} from \"@skaile/workspaces/core\";\nimport {\n assignDomain,\n buildDomainIndex,\n DOMAIN_MD_FILENAME,\n type DomainMd,\n parseDomainMd,\n} from \"@skaile/workspaces/discovery\";\n\n/** One non-fatal note returned to the caller for surfacing in the UI. */\nexport interface FeedNote {\n feed: \"sources\" | \"libraries\" | \"store\" | \"factory\";\n message: string;\n}\n\n/**\n * Which feed an asset came from. This is the top-level grouping axis in the\n * manage TUI (\"where is this skill coming from?\") and is intentionally distinct\n * from `publisher` (asset-intrinsic identity): the same publisher can legitimately\n * appear under more than one origin (e.g. a github repo you added as a `source`\n * that is also listed in the remote `store`).\n */\nexport type AssetOrigin = \"source\" | \"library\" | \"factory\" | \"store\";\n\n/** A catalog entry tagged with the feed it was gathered from. */\nexport interface OriginEntry {\n origin: AssetOrigin;\n entry: CatalogEntry;\n /**\n * Second-level grouping label for the manage tree. Defaults (when unset) to the\n * entry's `publisher`; the source feed sets it to the source's short repo name\n * so the Sources band groups by source — \"which repo did this come from\" — not\n * by the asset-intrinsic publisher.\n */\n group?: string;\n}\n\nexport interface AssetFeedResult {\n entries: OriginEntry[];\n /**\n * Display-only domain metadata, keyed (by the consumer) on `slug`. Populated\n * from the store's `catalog.listDomains` when the connected catalog source\n * exposes it; empty otherwise. The manage TUI joins `entry.domainSlug` → a\n * domain for grouping headers, descriptions, and relation badges.\n */\n domains: CatalogDomain[];\n notes: FeedNote[];\n}\n\n// ── Domain stamping (on-disk feeds) ──────────────────────────────────────────\n//\n// `scanRepo` (the source / library / factory scan path) does not read the\n// `DOMAIN.md` sidecars, so its entries arrive with no `domainSlug` and render\n// flat under their publisher band. We re-derive the grouping here from the\n// root's `DOMAIN.md` files (the same sidecars the remote store computes\n// server-side), and fall back to the repo/source name for any entry no domain\n// claims so it still groups instead of landing in the synthetic \"no domain\" pile.\n\n/** Repo-relative POSIX path (DOMAIN.md slugs are matched whole-segment, `/`-joined). */\nfunction toPosix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\n/** Parse every `DOMAIN.md` sidecar under `root` into a {@link DomainMd}. */\nfunction loadDomainMds(root: string): DomainMd[] {\n const out: DomainMd[] = [];\n for (const { path: filePath, name } of walkDir(root)) {\n if (name !== DOMAIN_MD_FILENAME) continue;\n try {\n const { data } = parseFrontmatter(readFileSync(filePath, \"utf8\"));\n out.push(parseDomainMd(toPosix(path.relative(root, filePath)), data));\n } catch {}\n }\n return out;\n}\n\n/**\n * Stamp `domainSlug` onto every entry scanned from `root` using the root's\n * `DOMAIN.md` sidecars. Returns the `CatalogDomain` registry for the real\n * domains, plus a synthetic fallback domain when any entry used the fallback.\n * Mutates `entries` in place (sets `entry.domainSlug`).\n *\n * `synthesizeFallback` (default true): entries no domain claims fall back to\n * `fallbackSlug` (the repo/source name). Pass `false` when the caller already\n * groups these entries one level up (e.g. the source feed groups by source\n * node) — unmatched entries then get no domain (`\"\"`) and hang directly under\n * that parent, instead of nesting under a same-named fallback domain.\n */\nfunction stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): CatalogDomain[] {\n const domainMds = loadDomainMds(root);\n const assignables = entries.map((entry) => ({\n entry,\n ref: `${entry.kind}:${entry.name}`,\n relativePath: toPosix(path.relative(root, entry.source)),\n }));\n\n let usedFallback = false;\n for (const a of assignables) {\n const slug = assignDomain(a.relativePath, domainMds);\n if (slug) a.entry.domainSlug = slug;\n else if (synthesizeFallback) {\n a.entry.domainSlug = fallbackSlug;\n usedFallback = true;\n } else a.entry.domainSlug = \"\";\n }\n\n const { index } = buildDomainIndex(assignables, domainMds);\n const catalog: CatalogDomain[] = Object.values(index).map((d) => ({\n slug: d.slug,\n title: d.title,\n ...(d.description ? { description: d.description } : {}),\n ...(d.relation ? { relation: d.relation } : {}),\n ...(d.order !== undefined ? { order: d.order } : {}),\n ...(d.recommended[0] ? { recommendedRef: d.recommended[0] } : {}),\n }));\n if (usedFallback) catalog.push({ slug: fallbackSlug, title: fallbackSlug });\n return catalog;\n}\n\n/**\n * Pull assets from local libraries (the authoring places under\n * `~/.skaile/libraries/<name>/`, not the `~/.skaile/cache/sources/` cache). Each\n * library's `path` is scanned with `scanRepo` and grouped under the bare library\n * name (`group: <name>`) so the manage TUI shows a clean `<name>` band — no\n * `library:` prefix and no redundant same-named fallback domain (mirrors the\n * source feed).\n */\nasync function libraryAssets(): Promise<{\n entries: OriginEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([\n import(\"./open-library.ts\"),\n import(\"@skaile/workspaces/library\"),\n import(\"@skaile/workspaces/core\"),\n ]);\n const { manager, close } = await openLibraryManager();\n try {\n // Authoring libraries are the rows that are NOT source clones. index.db\n // rows predating the cache migration still carry the legacy\n // ~/.skaile/sources path, so exclude both roots.\n const newRoot = getGlobalCacheDir();\n const legacyRoot = path.join(skaileHomeDir(), \"sources\");\n const libs = (await manager.listLibraries()).filter(\n (l) => !l.path.startsWith(newRoot) && !l.path.startsWith(legacyRoot),\n );\n const entries: OriginEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n // Scan + group under the bare library name. `synthesizeFallback: false`\n // (as the source feed does) keeps domainless assets directly under the\n // library band instead of a redundant same-named fallback domain.\n const libEntries = [...scanRepo(lib.path, lib.name)];\n domains.push(...stampDomains(lib.path, lib.name, libEntries, false));\n for (const entry of libEntries) entries.push({ origin: \"library\", entry, group: lib.name });\n }\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n notes.push({\n feed: \"libraries\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/**\n * Pull a (best-effort) snapshot of the connected remote store catalog.\n *\n * - Returns no entries when the resolved catalog is local-only or the host\n * is unreachable (the failure becomes a note, not an exception).\n * - Maps `CatalogAsset` → `CatalogEntry`, carrying `publisher`, `repo`, and\n * `category` straight through and using `source = \"store://<id>\"`; per-file\n * `source` paths are not available for remote assets so the canonical ref is\n * a stable placeholder.\n */\nasync function storeAssets(projectDir: string): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n try {\n const { resolveCatalogSource } = await import(\"./open-library.ts\");\n const { source, close } = await resolveCatalogSource({ projectDir });\n try {\n const assets = await source.listAssets();\n const entries: CatalogEntry[] = assets.map((a) => ({\n name: a.name,\n kind: (a.kind as AssetKind) ?? \"skill\",\n description: a.description ?? \"\",\n source: `store://${a.id}`,\n publisher: a.publisher,\n repo: a.repo,\n domainSlug: a.domainSlug,\n category: a.category,\n version: a.version,\n requires: [],\n dependencies: [],\n }));\n // Domains are optional on the catalog source — only the store backend\n // (post Part 4 `catalog.listDomains`) exposes them. Duck-type the call so\n // older sources and the local catalog degrade to no domains, not an error.\n const domains = await loadDomains(source);\n return { entries, domains, notes };\n } finally {\n close();\n }\n } catch (err) {\n const msg = err instanceof Error ? err.message : String(err);\n // Local-only catalog throws a recognizable message — silence it; absence\n // is the user's choice, not an error.\n if (!/local/i.test(msg)) {\n notes.push({ feed: \"store\", message: msg });\n }\n return { entries: [], domains: [], notes };\n }\n}\n\n/** Optional `listDomains` capability — returns `[]` when the source lacks it. */\nasync function loadDomains(source: unknown): Promise<CatalogDomain[]> {\n const fn = (source as { listDomains?: () => Promise<CatalogDomain[]> }).listDomains;\n if (typeof fn !== \"function\") return [];\n const domains = await fn.call(source);\n return Array.isArray(domains) ? domains : [];\n}\n\n/** The slice of `AssetManager` the source feed needs (kept narrow for tests). */\ninterface AssetManagerLike {\n search: () => CatalogEntry[];\n searchRepoRoots: () => { repoName: string; root: string }[];\n}\n\n/**\n * Project-source feed: leans on `AssetManager.search()`, which now merges\n * `skaile.yaml`'s `sources:` field into the repositories map, then stamps\n * `DOMAIN.md`-derived domain grouping onto the scanned entries via\n * `searchRepoRoots()`.\n */\nfunction sourceAssets(am: AssetManagerLike): { entries: OriginEntry[]; domains: CatalogDomain[] } {\n // The bundled factory tree is injected into the repositories map as an implicit\n // source, so `am.search()` returns it too. It has its own `factory` origin band,\n // so drop it here — otherwise the same first-party skills list twice under Sources.\n const factoryPrefixes = factoryAssetRoots().map((r) => (r.endsWith(path.sep) ? r : r + path.sep));\n const isFactoryPath = (p: string) =>\n factoryPrefixes.some((fp) => p === fp.slice(0, -1) || p.startsWith(fp));\n\n const all = am.search().filter((e) => !isFactoryPath(e.source));\n const entries: OriginEntry[] = [];\n const domains: CatalogDomain[] = [];\n // Group each source's entries under the source node (its short repo name), not\n // the publisher: under Sources the navigational question is \"which repo did\n // this come from\". Each entry's `source` (absolute manifest path) lives under\n // exactly one declared root, so group + stamp by prefix. The cache slug is\n // URL-keyed `github.com/<org>/<repo>` — take the trailing segment.\n for (const { repoName, root } of am.searchRepoRoots()) {\n if (isFactoryPath(root)) continue;\n const prefix = root.endsWith(path.sep) ? root : root + path.sep;\n const owned = all.filter((e) => e.source === root || e.source.startsWith(prefix));\n if (owned.length === 0) continue;\n const sourceName = repoName.split(\"/\").pop() || repoName;\n // No synthetic fallback domain — the source node already groups these, so a\n // same-named fallback would just nest the source under itself.\n domains.push(...stampDomains(root, sourceName, owned, false));\n for (const entry of owned) entries.push({ origin: \"source\", entry, group: sourceName });\n }\n return { entries, domains };\n}\n\n/**\n * Factory-asset feed: scan the bundled first-party `factory-assets` tree(s)\n * resolved by `factoryAssetRoots()` (the `SKAILE_FACTORY_ASSETS_DIR` override\n * layer ahead of the bundled tree). Synchronous, no network — the entries are\n * the built-in skills / connectors / bundles that ship with `@skaile/workspaces`.\n * `factoryAssetRoots()` already dedupes, so the env override pointing at the\n * bundled dir collapses to one root.\n */\nfunction factoryAssets(): { entries: CatalogEntry[]; domains: CatalogDomain[]; notes: FeedNote[] } {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...scanRepo(root, \"skaile-factory\")];\n domains.push(...stampDomains(root, \"skaile-factory\", rootEntries));\n entries.push(...rootEntries);\n }\n return { entries, domains, notes };\n } catch (err) {\n notes.push({\n feed: \"factory\",\n message: err instanceof Error ? err.message : String(err),\n });\n return { entries: [], domains, notes };\n }\n}\n\n/** Tag a flat entry list with a single origin. */\nfunction tag(origin: AssetOrigin, entries: CatalogEntry[]): OriginEntry[] {\n return entries.map((entry) => ({ origin, entry }));\n}\n\n/**\n * Run all feeds and return a single normalized result.\n *\n * Feeds run in parallel where possible — the store fetch is the slow one\n * (one HTTP call) and is fired alongside the local library walk. The factory\n * scan is local + synchronous, so it runs inline.\n */\nexport async function gatherAssetFeeds(\n am: AssetManagerLike,\n projectDir: string,\n): Promise<AssetFeedResult> {\n const [libs, store] = await Promise.all([libraryAssets(), storeAssets(projectDir)]);\n const factory = factoryAssets();\n const src = sourceAssets(am);\n return {\n entries: [\n ...src.entries,\n ...libs.entries,\n ...tag(\"factory\", factory.entries),\n ...tag(\"store\", store.entries),\n ],\n // Store domains first (server-curated), then the on-disk feeds; dedupe by\n // slug, first-wins, so a store-served domain shadows a same-slug local one.\n domains: dedupeBySlug([...store.domains, ...src.domains, ...libs.domains, ...factory.domains]),\n notes: [...libs.notes, ...store.notes, ...factory.notes],\n };\n}\n\n/** First-wins dedupe of a domain list by `slug`. */\nfunction dedupeBySlug(domains: CatalogDomain[]): CatalogDomain[] {\n const seen = new Set<string>();\n const out: CatalogDomain[] = [];\n for (const d of domains) {\n if (seen.has(d.slug)) continue;\n seen.add(d.slug);\n out.push(d);\n }\n return out;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, softDepName } from '../chunk-
|
|
1
|
+
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, softDepName } from '../chunk-Y3UCU4ZK.js';
|
|
2
2
|
import '../chunk-MWE7DEGC.js';
|
|
3
3
|
import '../chunk-MZV6WCF3.js';
|
|
4
4
|
import '../chunk-JXT46QFC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../asset-manager/src/index.ts"],"names":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H,KAAK,CAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG;QAC/B,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,KAAK,CAAC;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAChD,SAAS,EAAE,MAAM,EAAE,CAAC;KACrB;IAYD;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IA2BjC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAoB9B,qFAAqF;IACrF,OAAO,CAAC,qBAAqB;IAyB7B;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAgB7B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IA2BlC,OAAO,CAAC,cAAc;CAqBvB;AAID,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,0BAA0B,EAC1B,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAIxB,YAAY,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,eAAe,EACf,UAAU,GACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { logErr, logOk, colorRef, logInfo, S, logWarn, formatSoftDepHint } from './chunk-O3D4KYFG.js';
|
|
2
|
+
import { AssetManager } from './chunk-Y3UCU4ZK.js';
|
|
3
|
+
import { readLock } from './chunk-5NZ56R63.js';
|
|
4
|
+
import { parseAssetRef } from './chunk-GEEW6SY2.js';
|
|
5
|
+
import { SUPPORTED_DRIVER_TARGETS } from './chunk-MENCWIHW.js';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import * as p from '@clack/prompts';
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
|
|
10
|
+
var REF_HINT = "kind:@<publisher>/<name>#<version> (e.g. skill:@skaile/use-exa#1.0.0)";
|
|
11
|
+
function isValidAssetRef(ref) {
|
|
12
|
+
try {
|
|
13
|
+
parseAssetRef(ref);
|
|
14
|
+
return true;
|
|
15
|
+
} catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function supportsInstallManifest(source) {
|
|
20
|
+
return typeof source?.getInstallManifest === "function";
|
|
21
|
+
}
|
|
22
|
+
async function runPointerOnlyInstall(ref, deps) {
|
|
23
|
+
let requested;
|
|
24
|
+
try {
|
|
25
|
+
requested = parseAssetRef(ref);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}: ${e instanceof Error ? e.message : String(e)}`
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const manifest = await deps.catalog.getInstallManifest(ref);
|
|
32
|
+
const got = parseAssetRef(manifest.ref);
|
|
33
|
+
if (got.kind !== requested.kind || got.publisher !== requested.publisher || got.name !== requested.name || got.pin !== requested.pin) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`catalog identity mismatch: requested '${ref}' but the catalog returned a manifest for '${manifest.ref}'`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const { installPath } = await deps.library.install(manifest);
|
|
39
|
+
return {
|
|
40
|
+
installPath,
|
|
41
|
+
commitSha: manifest.source.commitSha,
|
|
42
|
+
fileCount: manifest.files.length
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function makeInstallCommand() {
|
|
46
|
+
return new Command("install").description(`Install dependencies from skaile.yaml, or a single asset by ref (${REF_HINT})`).argument("[ref]", `Asset ref to install from the Catalog (${REF_HINT})`).option("--locked", "Install from lock file (CI mode \u2014 fails on drift)").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").option(
|
|
47
|
+
"--global",
|
|
48
|
+
"Install the global SSOT (~/.skaile/skaile.yaml), fanning out to every global backend"
|
|
49
|
+
).option(
|
|
50
|
+
"--backend <ids>",
|
|
51
|
+
"Comma-separated global backends to install into (default: all resolved); implies --global"
|
|
52
|
+
).option(
|
|
53
|
+
"--link",
|
|
54
|
+
"symlink local-path assets instead of copying (dev loop; machine-local, not for committing)"
|
|
55
|
+
).action(runInstallCommand);
|
|
56
|
+
}
|
|
57
|
+
function parseBackendFilter(raw) {
|
|
58
|
+
if (!raw) return void 0;
|
|
59
|
+
const ids = raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
60
|
+
const out = [];
|
|
61
|
+
for (const id of ids) {
|
|
62
|
+
if (!SUPPORTED_DRIVER_TARGETS.includes(id)) {
|
|
63
|
+
logErr(`unknown backend '${id}' \u2014 expected one of: ${SUPPORTED_DRIVER_TARGETS.join(", ")}`);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
out.push(id);
|
|
67
|
+
}
|
|
68
|
+
return out.length > 0 ? out : void 0;
|
|
69
|
+
}
|
|
70
|
+
async function runInstallCommand(ref, opts) {
|
|
71
|
+
if (ref !== void 0) {
|
|
72
|
+
await runRefInstall(ref, opts);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
await runYamlInstall(opts);
|
|
76
|
+
}
|
|
77
|
+
async function runRefInstall(ref, opts) {
|
|
78
|
+
if (!isValidAssetRef(ref)) {
|
|
79
|
+
logErr(`malformed asset ref '${ref}' \u2014 expected ${REF_HINT}`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
const spinner2 = p.spinner();
|
|
83
|
+
spinner2.start(`Installing ${ref}`);
|
|
84
|
+
try {
|
|
85
|
+
const { openCatalogSource, openLibrary } = await import('./open-library-ST2VFQTK.js');
|
|
86
|
+
const catalog = await openCatalogSource({ projectDir: path.resolve(opts.projectDir) });
|
|
87
|
+
if (!supportsInstallManifest(catalog)) {
|
|
88
|
+
throw new Error(
|
|
89
|
+
"pointer-only install (skaile install <ref>) requires a tRPC-framed Catalog. The configured catalog uses REST framing, which does not serve install manifests. Set catalog.url to https://skaile.store, or catalog.framing: trpc, in ~/.skaile/config.yaml."
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const library = await openLibrary();
|
|
93
|
+
try {
|
|
94
|
+
const result = await runPointerOnlyInstall(ref, { catalog, library });
|
|
95
|
+
spinner2.stop("Done");
|
|
96
|
+
logOk(`Installed ${colorRef(ref)}`);
|
|
97
|
+
logInfo(`Path: ${S.dim(result.installPath)}`);
|
|
98
|
+
logInfo(`Commit: ${S.dim(result.commitSha)}`);
|
|
99
|
+
logInfo(`Files: ${S.dim(String(result.fileCount))}`);
|
|
100
|
+
logInfo(
|
|
101
|
+
S.dim(`Installed globally (see Path above) \u2014 use \`skaile add ${ref}\` to deploy into this project.`)
|
|
102
|
+
);
|
|
103
|
+
} finally {
|
|
104
|
+
library.close();
|
|
105
|
+
}
|
|
106
|
+
} catch (err) {
|
|
107
|
+
spinner2.stop("Failed");
|
|
108
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
109
|
+
if (/unreachable/i.test(msg)) {
|
|
110
|
+
logErr(`asset uninstallable \u2014 source commit no longer available (${msg})`);
|
|
111
|
+
} else {
|
|
112
|
+
logErr(msg);
|
|
113
|
+
}
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
async function runYamlInstall(opts) {
|
|
118
|
+
const projectDir = path.resolve(opts.projectDir);
|
|
119
|
+
const backends = parseBackendFilter(opts.backend);
|
|
120
|
+
if (opts.global || backends) {
|
|
121
|
+
await runGlobalInstall(opts, backends);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
const { ensureSourcesCloned } = await import('./ensure-sources-NXBYK5GP.js');
|
|
126
|
+
const hydrate = ensureSourcesCloned(projectDir, { quiet: true });
|
|
127
|
+
if (hydrate.cloned.length > 0) {
|
|
128
|
+
logOk(`Cloned source(s): ${hydrate.cloned.join(", ")}`);
|
|
129
|
+
}
|
|
130
|
+
if (hydrate.failed.length > 0) {
|
|
131
|
+
logErr(`Failed to clone source(s): ${hydrate.failed.join(", ")}`);
|
|
132
|
+
}
|
|
133
|
+
} catch (err) {
|
|
134
|
+
logWarn(`source hydration skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
135
|
+
}
|
|
136
|
+
const am = new AssetManager({
|
|
137
|
+
projectDir,
|
|
138
|
+
driverTarget: opts.target
|
|
139
|
+
});
|
|
140
|
+
const spinner2 = p.spinner();
|
|
141
|
+
spinner2.start(opts.locked ? "Installing from lock file" : "Installing dependencies");
|
|
142
|
+
try {
|
|
143
|
+
const result = await am.install({ locked: opts.locked, link: opts.link });
|
|
144
|
+
spinner2.stop("Done");
|
|
145
|
+
if (result.deployed.length > 0) {
|
|
146
|
+
for (const d of result.deployed) logOk(d);
|
|
147
|
+
}
|
|
148
|
+
if (result.removed.length > 0) {
|
|
149
|
+
for (const r of result.removed) logWarn(`Removed: ${r}`);
|
|
150
|
+
}
|
|
151
|
+
if (result.deployed.length === 0 && result.removed.length === 0) {
|
|
152
|
+
logInfo("Nothing to install (already up to date).");
|
|
153
|
+
}
|
|
154
|
+
if (result.missing.length > 0) {
|
|
155
|
+
for (const m of result.missing) logErr(`Missing: ${m}`);
|
|
156
|
+
process.exitCode = 1;
|
|
157
|
+
}
|
|
158
|
+
if (result.lockWritten) {
|
|
159
|
+
logInfo(`Lock file written: ${S.dim("skaile.lock.yaml")}`);
|
|
160
|
+
}
|
|
161
|
+
if (!opts.locked) await reportInstalledSoftDeps(am);
|
|
162
|
+
} catch (err) {
|
|
163
|
+
spinner2.stop("Failed");
|
|
164
|
+
logErr(String(err));
|
|
165
|
+
process.exit(1);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
async function reportInstalledSoftDeps(am, onHint = (l) => logInfo(S.dim(l))) {
|
|
169
|
+
try {
|
|
170
|
+
const declared = am.listDeclared().map((d) => d.ref);
|
|
171
|
+
if (declared.length === 0) return;
|
|
172
|
+
const edges = await am.reportSoftDeps(declared);
|
|
173
|
+
for (const edge of edges) onHint(formatSoftDepHint(edge));
|
|
174
|
+
} catch {
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async function runGlobalInstall(opts, backends) {
|
|
178
|
+
const am = new AssetManager({
|
|
179
|
+
projectDir: path.resolve(opts.projectDir),
|
|
180
|
+
global: true,
|
|
181
|
+
backends
|
|
182
|
+
});
|
|
183
|
+
const spinner2 = p.spinner();
|
|
184
|
+
spinner2.start("Installing global dependencies");
|
|
185
|
+
try {
|
|
186
|
+
const result = await am.install({ locked: opts.locked, link: opts.link });
|
|
187
|
+
spinner2.stop("Done");
|
|
188
|
+
if (result.deployed.length > 0) for (const d of result.deployed) logOk(d);
|
|
189
|
+
if (result.removed.length > 0) for (const r of result.removed) logWarn(`Removed: ${r}`);
|
|
190
|
+
if (result.deployed.length === 0 && result.removed.length === 0)
|
|
191
|
+
logInfo("Nothing to install (already up to date).");
|
|
192
|
+
if (result.missing.length > 0) {
|
|
193
|
+
for (const m of result.missing) logErr(`Missing: ${m}`);
|
|
194
|
+
process.exitCode = 1;
|
|
195
|
+
}
|
|
196
|
+
if (result.lockWritten) logInfo(`Global lock written: ${S.dim("~/.skaile/skaile.lock.yaml")}`);
|
|
197
|
+
const state = am.globalState({});
|
|
198
|
+
const byBackend = /* @__PURE__ */ new Map();
|
|
199
|
+
for (const s of state)
|
|
200
|
+
if (s.state === "installed") byBackend.set(s.backend, (byBackend.get(s.backend) ?? 0) + 1);
|
|
201
|
+
for (const [backend, n] of byBackend) logInfo(`${backend}: ${n} installed`);
|
|
202
|
+
} catch (err) {
|
|
203
|
+
spinner2.stop("Failed");
|
|
204
|
+
logErr(String(err));
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function makeCheckCommand() {
|
|
209
|
+
return new Command("check").description("Check for unmet requirements").option("--project-dir <path>", "Project directory", process.cwd()).action((opts) => {
|
|
210
|
+
const am = new AssetManager({ projectDir: path.resolve(opts.projectDir) });
|
|
211
|
+
const issues = am.doctor();
|
|
212
|
+
if (issues.length === 0) {
|
|
213
|
+
logOk("All dependencies satisfied.");
|
|
214
|
+
} else {
|
|
215
|
+
for (const i of issues) {
|
|
216
|
+
logErr(
|
|
217
|
+
`${i.assetKind}:${i.assetName} requires ${i.depKind}:${i.depName} (${i.inRepos ? "fixable" : "not found"})`
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
process.exit(1);
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
function makeCleanCommand() {
|
|
225
|
+
return new Command("clean").description("Remove all skaile-managed assets from the workspace").option("--all", "Full reset: also remove history, patches, repos, and lock file").option("--dry-run", "Show what would be removed without doing it").option("-y, --yes", "Skip confirmation prompt").option("--project-dir <path>", "Project directory", process.cwd()).option("--target <agent>", "Agent framework", "claude-code").action(async (opts) => {
|
|
226
|
+
const am = new AssetManager({
|
|
227
|
+
projectDir: path.resolve(opts.projectDir),
|
|
228
|
+
driverTarget: opts.target
|
|
229
|
+
});
|
|
230
|
+
const lock = readLock(path.resolve(opts.projectDir, "skaile.lock.yaml"));
|
|
231
|
+
if (!lock || Object.keys(lock.assets).length === 0) {
|
|
232
|
+
logInfo("Nothing to clean (no skaile-managed assets found).");
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const assetRefs = Object.keys(lock.assets);
|
|
236
|
+
console.log();
|
|
237
|
+
console.log(` ${S.heading("Assets to remove:")} ${S.dim(`(${assetRefs.length})`)}`);
|
|
238
|
+
for (const ref of assetRefs) {
|
|
239
|
+
console.log(` ${colorRef(ref)}`);
|
|
240
|
+
}
|
|
241
|
+
if (opts.all) {
|
|
242
|
+
console.log();
|
|
243
|
+
console.log(` ${S.heading("Also removing:")}`);
|
|
244
|
+
console.log(` ${S.dim(".skaile/history.yaml")}`);
|
|
245
|
+
console.log(` ${S.dim(".skaile/patches/")}`);
|
|
246
|
+
console.log(` ${S.dim("skaile.lock.yaml")}`);
|
|
247
|
+
}
|
|
248
|
+
if (opts.dryRun) {
|
|
249
|
+
console.log();
|
|
250
|
+
logInfo("Dry run \u2014 no changes made.");
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (!opts.yes) {
|
|
254
|
+
const confirm2 = await p.confirm({ message: "Proceed?" });
|
|
255
|
+
if (p.isCancel(confirm2) || !confirm2) {
|
|
256
|
+
logInfo("Cancelled.");
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const result = am.clean({ all: opts.all });
|
|
261
|
+
console.log();
|
|
262
|
+
for (const r of result.removed) {
|
|
263
|
+
logOk(`Removed ${r}`);
|
|
264
|
+
}
|
|
265
|
+
for (const s of result.skipped) {
|
|
266
|
+
logWarn(`Skipped ${s.ref}: ${s.reason}`);
|
|
267
|
+
}
|
|
268
|
+
if (result.unmanaged.length > 0) {
|
|
269
|
+
console.log();
|
|
270
|
+
logInfo(`Kept ${result.unmanaged.length} unmanaged asset(s):`);
|
|
271
|
+
for (const u of result.unmanaged) {
|
|
272
|
+
console.log(` ${S.dim(u)}`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (opts.all) {
|
|
276
|
+
console.log();
|
|
277
|
+
logOk("Full reset complete.");
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export { makeCheckCommand, makeCleanCommand, makeInstallCommand, reportInstalledSoftDeps, runPointerOnlyInstall, supportsInstallManifest };
|
|
283
|
+
//# sourceMappingURL=chunk-34U5UC6G.js.map
|
|
284
|
+
//# sourceMappingURL=chunk-34U5UC6G.js.map
|