@skaile/workspaces 1.1.0 → 1.3.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 +52 -0
- package/dist/{asset-feeds-NIAABO6U.js → asset-feeds-NEZKG6YS.js} +9 -9
- package/dist/{asset-feeds-NIAABO6U.js.map → asset-feeds-NEZKG6YS.js.map} +1 -1
- package/dist/asset-manager/index.js +7 -7
- package/dist/asset-manager/installer.js +6 -6
- package/dist/asset-manager/renderers.js +2 -2
- package/dist/bridge/drivers/claude-sdk.js +40 -5
- package/dist/bridge/drivers/claude-sdk.js.map +1 -1
- package/dist/bridge/drivers/codex.js +1 -1
- package/dist/bridge/drivers/continue.js +2 -2
- package/dist/bridge/drivers/echo.js +1 -1
- package/dist/bridge/drivers/gemini.js +3 -3
- package/dist/bridge/drivers/goose.js +2 -2
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +2 -2
- package/dist/bridge/drivers/qwen.js +3 -3
- package/dist/bridge/index.js +3 -2
- package/dist/bridge/src/cloud.d.ts +89 -0
- package/dist/bridge/src/cloud.d.ts.map +1 -0
- package/dist/bridge/src/drivers/claude-sdk.d.ts +12 -1
- package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
- package/dist/bridge/src/index.d.ts +1 -0
- package/dist/bridge/src/index.d.ts.map +1 -1
- package/dist/bridge/src/types.d.ts +31 -0
- package/dist/bridge/src/types.d.ts.map +1 -1
- package/dist/{chunk-7X53KHQ4.js → chunk-4OVPB7SI.js} +4 -2
- package/dist/chunk-4OVPB7SI.js.map +1 -0
- package/dist/{chunk-SHOKXRL4.js → chunk-5XS3BFJS.js} +8 -4
- package/dist/chunk-5XS3BFJS.js.map +1 -0
- package/dist/{chunk-EE4NL25D.js → chunk-7CNIRF42.js} +111 -45
- package/dist/chunk-7CNIRF42.js.map +1 -0
- package/dist/{chunk-MG6UIS7G.js → chunk-AZAS3FKN.js} +6 -3
- package/dist/chunk-AZAS3FKN.js.map +1 -0
- package/dist/{chunk-BCJL2UNH.js → chunk-BDUANIAR.js} +3 -3
- package/dist/{chunk-BCJL2UNH.js.map → chunk-BDUANIAR.js.map} +1 -1
- package/dist/{chunk-KVZ6XKVN.js → chunk-BZMTR5WW.js} +3 -3
- package/dist/{chunk-KVZ6XKVN.js.map → chunk-BZMTR5WW.js.map} +1 -1
- package/dist/{chunk-INUQVXUE.js → chunk-ETYDLXI5.js} +2 -2
- package/dist/{chunk-INUQVXUE.js.map → chunk-ETYDLXI5.js.map} +1 -1
- package/dist/{chunk-CU5Z7GH3.js → chunk-GB4SEEK4.js} +13 -5
- package/dist/chunk-GB4SEEK4.js.map +1 -0
- package/dist/chunk-ISQWMBKD.js +74 -0
- package/dist/chunk-ISQWMBKD.js.map +1 -0
- package/dist/{chunk-ZUE2PIJ5.js → chunk-JQMIG7D3.js} +3 -3
- package/dist/{chunk-ZUE2PIJ5.js.map → chunk-JQMIG7D3.js.map} +1 -1
- package/dist/{chunk-UY5Q2NZH.js → chunk-K5SD7FSF.js} +3 -3
- package/dist/{chunk-UY5Q2NZH.js.map → chunk-K5SD7FSF.js.map} +1 -1
- package/dist/{chunk-L3SLC3S4.js → chunk-OBSSORCE.js} +6 -6
- package/dist/{chunk-L3SLC3S4.js.map → chunk-OBSSORCE.js.map} +1 -1
- package/dist/{chunk-5AGARSQT.js → chunk-OUWNTFDG.js} +31 -3
- package/dist/chunk-OUWNTFDG.js.map +1 -0
- package/dist/{chunk-VYIK5IE5.js → chunk-P3MJYPZE.js} +24 -5
- package/dist/chunk-P3MJYPZE.js.map +1 -0
- package/dist/{chunk-B4IOSXRZ.js → chunk-PSMW5HLX.js} +19 -8
- package/dist/chunk-PSMW5HLX.js.map +1 -0
- package/dist/{chunk-U5J77IIZ.js → chunk-QK5JDAFF.js} +4 -4
- package/dist/{chunk-U5J77IIZ.js.map → chunk-QK5JDAFF.js.map} +1 -1
- package/dist/{chunk-DMHVL5MC.js → chunk-RHMQPLIK.js} +5 -5
- package/dist/{chunk-DMHVL5MC.js.map → chunk-RHMQPLIK.js.map} +1 -1
- package/dist/{chunk-52XHXSBN.js → chunk-RJ3HUSBC.js} +3 -3
- package/dist/{chunk-52XHXSBN.js.map → chunk-RJ3HUSBC.js.map} +1 -1
- package/dist/{chunk-Z4EJOBEL.js → chunk-RYRJEVQ4.js} +7 -7
- package/dist/{chunk-Z4EJOBEL.js.map → chunk-RYRJEVQ4.js.map} +1 -1
- package/dist/{chunk-QVE3ILCY.js → chunk-SUOGVHGJ.js} +2 -2
- package/dist/chunk-SUOGVHGJ.js.map +1 -0
- package/dist/{chunk-BM37QD6U.js → chunk-TJRWGMD2.js} +3 -3
- package/dist/{chunk-BM37QD6U.js.map → chunk-TJRWGMD2.js.map} +1 -1
- package/dist/{chunk-35TLBMHX.js → chunk-WFEPI5LA.js} +5 -5
- package/dist/{chunk-35TLBMHX.js.map → chunk-WFEPI5LA.js.map} +1 -1
- package/dist/{chunk-OIGYDVCM.js → chunk-XBG2YDQQ.js} +3 -3
- package/dist/{chunk-OIGYDVCM.js.map → chunk-XBG2YDQQ.js.map} +1 -1
- package/dist/{chunk-WRBF34YE.js → chunk-XKARS6EE.js} +3 -3
- package/dist/{chunk-WRBF34YE.js.map → chunk-XKARS6EE.js.map} +1 -1
- package/dist/{chunk-YI5OZ7QO.js → chunk-YOPSHV7V.js} +2 -2
- package/dist/{chunk-YI5OZ7QO.js.map → chunk-YOPSHV7V.js.map} +1 -1
- package/dist/{chunk-G2X3THJV.js → chunk-YXEPZ7LP.js} +5 -5
- package/dist/{chunk-G2X3THJV.js.map → chunk-YXEPZ7LP.js.map} +1 -1
- package/dist/cli/index.js +104 -62
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/catalog.d.ts +20 -0
- package/dist/cli/src/commands/catalog.d.ts.map +1 -1
- package/dist/cli/src/commands/project.d.ts +9 -0
- package/dist/cli/src/commands/project.d.ts.map +1 -1
- package/dist/cli/src/helpers.d.ts +10 -0
- package/dist/cli/src/helpers.d.ts.map +1 -1
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +5 -5
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +2 -2
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/settings.d.ts +18 -0
- package/dist/core/src/settings.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +45 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/discovery/index.js +2 -2
- package/dist/{ensure-sources-MJYHZ77Y.js → ensure-sources-4BAJGJRK.js} +10 -10
- package/dist/{ensure-sources-MJYHZ77Y.js.map → ensure-sources-4BAJGJRK.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +5 -5
- package/dist/factory-assets/connectors/deploy.js +5 -5
- package/dist/factory-assets/connectors/devserver.js +5 -5
- package/dist/factory-assets/connectors/flow/adapter.js +5 -5
- package/dist/factory-assets/connectors/flow/engine.js +3 -3
- package/dist/factory-assets/connectors/flow/run-flow.js +6 -6
- package/dist/factory-assets/connectors/flow.js +5 -5
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +5 -5
- package/dist/factory-assets/connectors/gmail.js +5 -5
- package/dist/factory-assets/connectors/googledrive.js +5 -5
- package/dist/factory-assets/connectors/local.js +5 -5
- package/dist/factory-assets/connectors/mattermost.js +5 -5
- package/dist/factory-assets/connectors/memory.js +5 -5
- package/dist/factory-assets/connectors/minio.js +5 -5
- package/dist/factory-assets/connectors/postgres.js +5 -5
- package/dist/factory-assets/connectors/s3.js +5 -5
- package/dist/factory-assets/connectors/sharepoint.js +5 -5
- package/dist/factory-assets/connectors/sqlite.js +5 -5
- package/dist/factory-assets/connectors/static-server.js +5 -5
- package/dist/factory-assets/connectors/tunnel.js +5 -5
- package/dist/factory-assets/connectors/webdav.js +5 -5
- package/dist/factory-assets/connectors/xstate-store.js +5 -5
- package/dist/factory-assets/connectors/xstate.js +5 -5
- package/dist/{flows-4Z74KY2H.js → flows-UFCOGAAM.js} +3 -3
- package/dist/{flows-4Z74KY2H.js.map → flows-UFCOGAAM.js.map} +1 -1
- package/dist/helpers-2OL4FRFB.js +22 -0
- package/dist/{helpers-7KOVCMHW.js.map → helpers-2OL4FRFB.js.map} +1 -1
- package/dist/library/index.js +6 -6
- package/dist/library/install.js +3 -3
- package/dist/{open-library-PGTL332T.js → open-library-RPV2LIKL.js} +13 -13
- package/dist/{open-library-PGTL332T.js.map → open-library-RPV2LIKL.js.map} +1 -1
- package/dist/{paths-S7QNXYMB.js → paths-ML33B5SB.js} +6 -6
- package/dist/{paths-S7QNXYMB.js.map → paths-ML33B5SB.js.map} +1 -1
- package/dist/{plugin-store-3DAVGKHN.js → plugin-store-G4HKWCTU.js} +5 -5
- package/dist/{plugin-store-3DAVGKHN.js.map → plugin-store-G4HKWCTU.js.map} +1 -1
- package/dist/plugins/src/catalog-source.d.ts +7 -0
- package/dist/plugins/src/catalog-source.d.ts.map +1 -1
- package/dist/runner/index.js +10 -9
- package/dist/runner/src/cloud-bundle.d.ts +36 -0
- package/dist/runner/src/cloud-bundle.d.ts.map +1 -0
- 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 +32 -0
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +7 -7
- package/dist/sdk/bridge.js +3 -2
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +3 -3
- package/dist/sdk/index.js +10 -9
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runner.js +10 -9
- package/dist/sdk/store.js +1 -1
- package/dist/{setup-WBGDT2WY.js → setup-WS6PF6JQ.js} +8 -7
- package/dist/setup-WS6PF6JQ.js.map +1 -0
- package/dist/{source-FJXRQ2NU.js → source-22U5NOY4.js} +14 -14
- package/dist/{source-FJXRQ2NU.js.map → source-22U5NOY4.js.map} +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/src/store.d.ts.map +1 -1
- package/dist/{store-client-YGDN4L2G.js → store-client-YLMBH5MF.js} +6 -6
- package/dist/{store-client-YGDN4L2G.js.map → store-client-YLMBH5MF.js.map} +1 -1
- package/dist/tui/index.js +10 -9
- package/dist/tui/index.js.map +1 -1
- package/dist/types/manifests.js +1 -1
- package/dist/types/src/manifests/agent.d.ts +47 -8
- package/dist/types/src/manifests/agent.d.ts.map +1 -1
- package/dist/types/src/manifests/index.d.ts +1 -1
- package/dist/types/src/manifests/index.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +1 -1
- package/dist/workspace-plugin/adapters/omp.js +3 -3
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5AGARSQT.js.map +0 -1
- package/dist/chunk-7X53KHQ4.js.map +0 -1
- package/dist/chunk-B4IOSXRZ.js.map +0 -1
- package/dist/chunk-CU5Z7GH3.js.map +0 -1
- package/dist/chunk-EE4NL25D.js.map +0 -1
- package/dist/chunk-MG6UIS7G.js.map +0 -1
- package/dist/chunk-QVE3ILCY.js.map +0 -1
- package/dist/chunk-SHOKXRL4.js.map +0 -1
- package/dist/chunk-VYIK5IE5.js.map +0 -1
- package/dist/helpers-7KOVCMHW.js +0 -22
- package/dist/setup-WBGDT2WY.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#307](https://github.com/skaile-ai/workspaces/pull/307) [`122caeb`](https://github.com/skaile-ai/workspaces/commit/122caeb3d6d3fd8409fb451764e36d4ea0f595ae) Thanks [@peteralbert](https://github.com/peteralbert)! - Add AI cloud-provider support (`cloud` dimension) for the `claude-sdk` driver: skaile.yaml `agent-config.<profile>.cloud` (`default|bedrock|vertex|azure|gateway`) + non-secret `cloud_config`, runner-side credential env bundles from `session_init` secrets (incl. Vertex service-account JSON materialization to a 0600 file), and per-cloud SDK child-env assembly (`CLAUDE_CODE_USE_BEDROCK|VERTEX|FOUNDRY`, gateway `ANTHROPIC_BASE_URL`). `cloud: default`/absent is unchanged behavior. Model-ID validation now accepts Bedrock (`[us.]anthropic.claude-…-vN[:M]`) and Vertex (`@YYYYMMDD`) forms, with free-form IDs under `cloud: gateway` via `modelIdSchemaForCloud`.
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#291](https://github.com/skaile-ai/workspaces/pull/291) [`aff3ab4`](https://github.com/skaile-ai/workspaces/commit/aff3ab4fdd0046987943f79bb417a52efe6ed7aa) Thanks [@P1umPudding](https://github.com/P1umPudding)! - Catalog clients now carry report-only soft-dep refs across the wire boundary:
|
|
14
|
+
`CatalogAsset` gains an optional `softDeps: string[]`, and both
|
|
15
|
+
`RemoteCatalogSource` (tRPC) and `RestCatalogSource` (REST) lift the store's
|
|
16
|
+
`softDepsJson` (`{ refs: string[] }` or a bare `string[]`) onto it. Forward-
|
|
17
|
+
compatible: absent → `undefined`, so nothing changes until a store serves the
|
|
18
|
+
field. This is the client-read half of store-side soft-dep parity ([#290](https://github.com/skaile-ai/workspaces/issues/290)); the
|
|
19
|
+
store→index write that surfaces these for a store-installed asset is tracked
|
|
20
|
+
separately.
|
|
21
|
+
|
|
22
|
+
- [#297](https://github.com/skaile-ai/workspaces/pull/297) [`e329cc8`](https://github.com/skaile-ai/workspaces/commit/e329cc8cd1ad236cb6e0752720f8b1dbbdd2d3b9) Thanks [@P1umPudding](https://github.com/P1umPudding)! - `skaile install` now surfaces the report-only body-link soft deps that its
|
|
23
|
+
declared assets reference but that aren't present in the project — the batch
|
|
24
|
+
counterpart to the `add`-time soft-dep surface, closing the last "surface at
|
|
25
|
+
every lifecycle point" gap. It only ever prints a hint (never a prompt), since
|
|
26
|
+
`install` is a batch / CI / clone-restore path; pulling stays an explicit
|
|
27
|
+
`skaile add`. Best-effort — a soft-dep report never fails an install that
|
|
28
|
+
otherwise succeeded. Applies to the project (`skaile.yaml`) install path.
|
|
29
|
+
|
|
30
|
+
- [#289](https://github.com/skaile-ai/workspaces/pull/289) [`92223ad`](https://github.com/skaile-ai/workspaces/commit/92223ad42169ffd85ea17b53c4da51828e85fc50) Thanks [@P1umPudding](https://github.com/P1umPudding)! - Soft-dep prompt controls on `skaile add` / `skaile remove`:
|
|
31
|
+
|
|
32
|
+
- `skaile add <ref> --with-soft-deps` — opt-in one-shot pull of the asset's
|
|
33
|
+
report-only soft (body-link) deps, without prompting (CI/scripts). One level
|
|
34
|
+
only (a pulled dep's own soft deps are not followed), matching the report.
|
|
35
|
+
- `skaile add <ref> --no-soft-deps` and `skaile remove <ref> --no-soft-deps` —
|
|
36
|
+
skip the soft-dep step entirely (no prompt, no hint), so you don't dismiss N
|
|
37
|
+
prompts when you only want the primary op.
|
|
38
|
+
- `skaile remove` now has a no-TTY fallback for the orphaned-soft-dep prompt: a
|
|
39
|
+
piped run prints a hint listing the orphans instead of blocking on a prompt
|
|
40
|
+
(symmetric with `add`). There is deliberately no batch `--with-soft-deps` on
|
|
41
|
+
remove — removing on a heuristic is the dangerous direction, so orphan removal
|
|
42
|
+
stays interactive (or explicitly skipped).
|
|
43
|
+
|
|
44
|
+
Default behaviour is unchanged: soft deps stay report-only (interactive prompt on
|
|
45
|
+
a TTY, printed hint otherwise).
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [#305](https://github.com/skaile-ai/workspaces/pull/305) [`5b793ab`](https://github.com/skaile-ai/workspaces/commit/5b793ab6a7f5c52427b24f231d503b3e80008137) Thanks [@peteralbert](https://github.com/peteralbert)! - Allow runner resource setup to continue after required connector startup failures so unrelated external MCP servers still start.
|
|
50
|
+
|
|
51
|
+
- [#304](https://github.com/skaile-ai/workspaces/pull/304) [`456a125`](https://github.com/skaile-ai/workspaces/commit/456a125de04f182e886a046af15cc775505632e6) Thanks [@peteralbert](https://github.com/peteralbert)! - Pass the mounted checkout as Git safe.directory for git connector operations.
|
|
52
|
+
|
|
53
|
+
- [#295](https://github.com/skaile-ai/workspaces/pull/295) [`44d764f`](https://github.com/skaile-ai/workspaces/commit/44d764f694e2fdbe51de8d93633ec250ba75e2b2) Thanks [@Frozen666](https://github.com/Frozen666)! - AgentStore: reset `phase` to `idle` when a `question` event arrives (a pending question is a human-in-the-loop pause, not active work) and restore `phase` to `thinking` in `reply()`. Fixes the chat "AI is thinking…" indicator staying visible while the agent is idle, waiting for the user to answer.
|
|
54
|
+
|
|
3
55
|
## 1.1.0
|
|
4
56
|
|
|
5
57
|
### Minor Changes
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { assignDomain, buildDomainIndex, DOMAIN_MD_FILENAME, parseDomainMd } from './chunk-
|
|
1
|
+
import { assignDomain, buildDomainIndex, DOMAIN_MD_FILENAME, parseDomainMd } from './chunk-BZMTR5WW.js';
|
|
2
2
|
import './chunk-JXT46QFC.js';
|
|
3
|
-
import './chunk-
|
|
4
|
-
import { factoryAssetRoots } from './chunk-
|
|
5
|
-
import { scanRepo } from './chunk-
|
|
3
|
+
import './chunk-AZAS3FKN.js';
|
|
4
|
+
import { factoryAssetRoots } from './chunk-TJRWGMD2.js';
|
|
5
|
+
import { scanRepo } from './chunk-OUWNTFDG.js';
|
|
6
6
|
import './chunk-DZCK7GRW.js';
|
|
7
7
|
import { walkDir, parseFrontmatter } from './chunk-BQCGFPHW.js';
|
|
8
8
|
import './chunk-GEEW6SY2.js';
|
|
@@ -11,7 +11,7 @@ import './chunk-MENCWIHW.js';
|
|
|
11
11
|
import './chunk-K5GBV4SA.js';
|
|
12
12
|
import './chunk-ZAP2BDHG.js';
|
|
13
13
|
import './chunk-JB35MVBN.js';
|
|
14
|
-
import './chunk-
|
|
14
|
+
import './chunk-GB4SEEK4.js';
|
|
15
15
|
import './chunk-NSBPE2FW.js';
|
|
16
16
|
import { existsSync, readFileSync } from 'fs';
|
|
17
17
|
import * as path from 'path';
|
|
@@ -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-RPV2LIKL.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-RPV2LIKL.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-NEZKG6YS.js.map
|
|
205
|
+
//# sourceMappingURL=asset-feeds-NEZKG6YS.js.map
|
|
@@ -1 +1 @@
|
|
|
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;AAC/C,EAAA,MAAM,MAAkB,E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AAK;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-NIAABO6U.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 tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{\n entries: CatalogEntry[];\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: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n const libEntries = [...scanRepo(lib.path, `library:${lib.name}`)];\n domains.push(...stampDomains(lib.path, `library:${lib.name}`, libEntries));\n entries.push(...libEntries);\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 ...tag(\"library\", 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;AAC/C,EAAA,MAAM,MAAkB,EAAC;AACzB,EAAA,KAAA,MAAW,EAAE,IAAA,EAAM,QAAA,EAAU,MAAK,IAAK,OAAA,CAAQ,IAAI,CAAA,EAAG;AACpD,IAAA,IAAI,SAAS,kBAAA,EAAoB;AACjC,IAAA,IAAI;AACF,MAAA,MAAM,EAAE,IAAA,EAAK,GAAI,iBAAiB,YAAA,CAAa,QAAA,EAAU,MAAM,CAAC,CAAA;AAChE,MAAA,GAAA,CAAI,IAAA,CAAK,cAAc,OAAA,CAAa,IAAA,CAAA,QAAA,CAAS,MAAM,QAAQ,CAAC,CAAA,EAAG,IAAI,CAAC,CAAA;AAAA,IACtE,CAAA,CAAA,MAAQ;AAAA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["/**\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 tagged with\n * `repository = \"library:<name>\"` so the manage TUI groups them into their\n * own headers.\n */\nasync function libraryAssets(): Promise<{\n entries: CatalogEntry[];\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: CatalogEntry[] = [];\n for (const lib of libs) {\n if (!existsSync(lib.path)) continue;\n const libEntries = [...scanRepo(lib.path, `library:${lib.name}`)];\n domains.push(...stampDomains(lib.path, `library:${lib.name}`, libEntries));\n entries.push(...libEntries);\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 ...tag(\"library\", 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,8 +1,8 @@
|
|
|
1
|
-
export { AssetManager, MissingManifestError, NON_DEPLOYABLE_KINDS, parseCanonicalLockKey, softDepName } from '../chunk-
|
|
2
|
-
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
1
|
+
export { AssetManager, MissingManifestError, NON_DEPLOYABLE_KINDS, parseCanonicalLockKey, softDepName } from '../chunk-OBSSORCE.js';
|
|
2
|
+
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-WFEPI5LA.js';
|
|
3
|
+
import '../chunk-AZAS3FKN.js';
|
|
4
|
+
import '../chunk-TJRWGMD2.js';
|
|
5
|
+
import '../chunk-OUWNTFDG.js';
|
|
6
6
|
import '../chunk-DZCK7GRW.js';
|
|
7
7
|
import '../chunk-BQCGFPHW.js';
|
|
8
8
|
import '../chunk-GEEW6SY2.js';
|
|
@@ -13,8 +13,8 @@ import '../chunk-ZAP2BDHG.js';
|
|
|
13
13
|
import '../chunk-JB35MVBN.js';
|
|
14
14
|
export { appendHistory, clearHistory, getRecentHistory, loadHistory } from '../chunk-KTBKW2FI.js';
|
|
15
15
|
import '../chunk-UQ6LFBPZ.js';
|
|
16
|
-
export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, driverTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-
|
|
17
|
-
import '../chunk-
|
|
16
|
+
export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, driverTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-XKARS6EE.js';
|
|
17
|
+
import '../chunk-GB4SEEK4.js';
|
|
18
18
|
export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../chunk-CGYEHQOX.js';
|
|
19
19
|
import '../chunk-NSBPE2FW.js';
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-WFEPI5LA.js';
|
|
2
|
+
import '../chunk-AZAS3FKN.js';
|
|
3
|
+
import '../chunk-TJRWGMD2.js';
|
|
4
|
+
import '../chunk-OUWNTFDG.js';
|
|
5
5
|
import '../chunk-DZCK7GRW.js';
|
|
6
6
|
import '../chunk-BQCGFPHW.js';
|
|
7
7
|
import '../chunk-GEEW6SY2.js';
|
|
@@ -10,8 +10,8 @@ import '../chunk-MENCWIHW.js';
|
|
|
10
10
|
import '../chunk-K5GBV4SA.js';
|
|
11
11
|
import '../chunk-ZAP2BDHG.js';
|
|
12
12
|
import '../chunk-JB35MVBN.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-XKARS6EE.js';
|
|
14
|
+
import '../chunk-GB4SEEK4.js';
|
|
15
15
|
import '../chunk-CGYEHQOX.js';
|
|
16
16
|
import '../chunk-NSBPE2FW.js';
|
|
17
17
|
//# sourceMappingURL=installer.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, driverTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, driverTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-XKARS6EE.js';
|
|
2
|
+
import '../chunk-GB4SEEK4.js';
|
|
3
3
|
import '../chunk-NSBPE2FW.js';
|
|
4
4
|
//# sourceMappingURL=renderers.js.map
|
|
5
5
|
//# sourceMappingURL=renderers.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { SUPPORTED_CLOUDS, buildClaudeCloudEnv } from '../../chunk-ISQWMBKD.js';
|
|
1
2
|
import { fetchProviderModels } from '../../chunk-BMQKMOQY.js';
|
|
2
3
|
import { AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError } from '../../chunk-GAH4YRCI.js';
|
|
3
4
|
import { dispatchCapability } from '../../chunk-RRVQAE5D.js';
|
|
4
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
5
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-SUOGVHGJ.js';
|
|
5
6
|
import '../../chunk-6E6PKKAD.js';
|
|
6
7
|
import '../../chunk-JB35MVBN.js';
|
|
7
8
|
import '../../chunk-NSBPE2FW.js';
|
|
@@ -385,7 +386,11 @@ var ClaudeSdkDriver = class extends AgentDriver {
|
|
|
385
386
|
* @param config - Driver configuration. Claude SDK-relevant fields:
|
|
386
387
|
* - `cwd` — working directory; SDK session files and agent definitions are read from here.
|
|
387
388
|
* - `model` — Anthropic model identifier (e.g. `"claude-sonnet-4-5"`). Defaults to `"sonnet"`.
|
|
388
|
-
* - `apiKeys.anthropic` / `env.ANTHROPIC_API_KEY` — API key forwarded to the SDK query
|
|
389
|
+
* - `apiKeys.anthropic` / `env.ANTHROPIC_API_KEY` — API key forwarded to the SDK query
|
|
390
|
+
* (`cloud: default` only; no key falls back to OAuth credentials).
|
|
391
|
+
* - `cloud` / `cloudConfig` / `cloudSecrets` — non-default clouds (bedrock/vertex/azure/
|
|
392
|
+
* gateway) route through `buildClaudeCloudEnv` instead: exactly one `CLAUDE_CODE_USE_*`
|
|
393
|
+
* flag plus the resolved credential bundle, never `queryArgs.apiKey`.
|
|
389
394
|
* - `agentName` — name of a `.claude/agents/<name>.md` agent definition to use as identity.
|
|
390
395
|
* - `mcpServers` — in-process MCP server instances injected as native `tool_use` tools.
|
|
391
396
|
* - `systemPrompt` — appended to the `claude_code` preset system prompt.
|
|
@@ -677,11 +682,25 @@ var ClaudeSdkDriver = class extends AgentDriver {
|
|
|
677
682
|
});
|
|
678
683
|
}
|
|
679
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* Resolve the effective cloud transport for this query. Unrecognized
|
|
687
|
+
* non-default values fall back to `default` (today's behavior) with a
|
|
688
|
+
* warning — old-runner tolerance per the cloud-provider contract; the
|
|
689
|
+
* platform gates runner versions for real non-default sessions.
|
|
690
|
+
*/
|
|
691
|
+
resolveCloud() {
|
|
692
|
+
const raw = this.config.cloud;
|
|
693
|
+
if (!raw || raw === "default") return "default";
|
|
694
|
+
if (SUPPORTED_CLOUDS.includes(raw)) return raw;
|
|
695
|
+
this.log.warn("unknown cloud value \u2014 falling back to the default transport", { cloud: raw });
|
|
696
|
+
return "default";
|
|
697
|
+
}
|
|
680
698
|
async startQuery(message) {
|
|
681
699
|
this.abortController = new AbortController();
|
|
682
700
|
this.preventivelyScrubTranscript();
|
|
683
|
-
const
|
|
684
|
-
this.
|
|
701
|
+
const cloud = this.resolveCloud();
|
|
702
|
+
const apiKey = cloud === "default" ? this.config.apiKeys?.anthropic || this.config.env?.ANTHROPIC_API_KEY || process.env.ANTHROPIC_API_KEY : void 0;
|
|
703
|
+
this.usingOauthCredential = cloud === "default" && !apiKey;
|
|
685
704
|
const claudePath = this.findClaudeBinary();
|
|
686
705
|
const options = {
|
|
687
706
|
cwd: this.config.cwd,
|
|
@@ -750,7 +769,22 @@ var ClaudeSdkDriver = class extends AgentDriver {
|
|
|
750
769
|
model: this.config.model || "default",
|
|
751
770
|
session: this.config.resumeSessionId || this.sessionId || this.config.sessionId || "new"
|
|
752
771
|
});
|
|
753
|
-
if (
|
|
772
|
+
if (cloud !== "default") {
|
|
773
|
+
const baseEnv = {};
|
|
774
|
+
for (const [k, v] of Object.entries(process.env)) {
|
|
775
|
+
if (v !== void 0) baseEnv[k] = v;
|
|
776
|
+
}
|
|
777
|
+
options.env = buildClaudeCloudEnv({
|
|
778
|
+
cloud,
|
|
779
|
+
cloudConfig: this.config.cloudConfig,
|
|
780
|
+
cloudSecrets: this.config.cloudSecrets,
|
|
781
|
+
baseEnv,
|
|
782
|
+
configEnv: this.config.env,
|
|
783
|
+
// Gateway-only auth fallback so standalone sessions (settings-resolved
|
|
784
|
+
// apiKeys, no platform bundle) still reach the proxy authenticated.
|
|
785
|
+
fallbackApiKey: this.config.apiKeys?.anthropic
|
|
786
|
+
});
|
|
787
|
+
} else if (apiKey) {
|
|
754
788
|
const baseEnv = {};
|
|
755
789
|
for (const [k, v] of Object.entries(process.env)) {
|
|
756
790
|
if (v !== void 0) baseEnv[k] = v;
|
|
@@ -1395,6 +1429,7 @@ var ClaudeSdkDriver = class extends AgentDriver {
|
|
|
1395
1429
|
this.hasSession = false;
|
|
1396
1430
|
}
|
|
1397
1431
|
async listModels() {
|
|
1432
|
+
if (this.resolveCloud() !== "default") return [];
|
|
1398
1433
|
const apiKey = this.config.apiKeys?.anthropic || this.config.env?.ANTHROPIC_API_KEY || process.env.ANTHROPIC_API_KEY;
|
|
1399
1434
|
if (!apiKey) return [];
|
|
1400
1435
|
const result = await fetchProviderModels("anthropic", apiKey);
|