@skaile/workspaces 3.3.0 → 3.4.1
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 +108 -0
- package/dist/{asset-feeds-AGAH5OHC.js → asset-feeds-SILUSNAL.js} +11 -11
- package/dist/{asset-feeds-AGAH5OHC.js.map → asset-feeds-SILUSNAL.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +7 -7
- package/dist/asset-manager/index.js +10 -10
- package/dist/asset-manager/installer.js +7 -7
- package/dist/bridge/drivers/claude-sdk.js +8 -8
- package/dist/bridge/drivers/codex.js +3 -3
- package/dist/bridge/drivers/continue.js +4 -4
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +4 -4
- package/dist/bridge/drivers/omp.js +3 -3
- package/dist/bridge/drivers/opencode.js +4 -4
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +9 -9
- package/dist/{chunk-4GJLRYMB.js → chunk-33ZEIMFJ.js} +3 -3
- package/dist/{chunk-4GJLRYMB.js.map → chunk-33ZEIMFJ.js.map} +1 -1
- package/dist/{chunk-7GOCNYUV.js → chunk-3A5IKBHQ.js} +47 -47
- package/dist/{chunk-7GOCNYUV.js.map → chunk-3A5IKBHQ.js.map} +1 -1
- package/dist/{chunk-ZNIHTT22.js → chunk-3UU3D2Q3.js} +5 -5
- package/dist/{chunk-ZNIHTT22.js.map → chunk-3UU3D2Q3.js.map} +1 -1
- package/dist/{chunk-E5S2WGTS.js → chunk-4GYL5TCP.js} +103 -33
- package/dist/chunk-4GYL5TCP.js.map +1 -0
- package/dist/{chunk-CZZRDYT4.js → chunk-4VTBZ2MF.js} +4 -4
- package/dist/{chunk-CZZRDYT4.js.map → chunk-4VTBZ2MF.js.map} +1 -1
- package/dist/{chunk-VT6HDD2L.js → chunk-4YYJV6TW.js} +3 -3
- package/dist/{chunk-VT6HDD2L.js.map → chunk-4YYJV6TW.js.map} +1 -1
- package/dist/{chunk-S6GKHEMN.js → chunk-5JP7ZF5I.js} +10 -10
- package/dist/{chunk-S6GKHEMN.js.map → chunk-5JP7ZF5I.js.map} +1 -1
- package/dist/{chunk-U5POE4BA.js → chunk-5Q7HA4JP.js} +3 -3
- package/dist/{chunk-U5POE4BA.js.map → chunk-5Q7HA4JP.js.map} +1 -1
- package/dist/{chunk-I7MKEZ6J.js → chunk-7EUW3BBR.js} +3 -3
- package/dist/{chunk-I7MKEZ6J.js.map → chunk-7EUW3BBR.js.map} +1 -1
- package/dist/{chunk-P43HBWKK.js → chunk-AZPXCHDK.js} +36 -7
- package/dist/chunk-AZPXCHDK.js.map +1 -0
- package/dist/{chunk-PKEAYYEJ.js → chunk-BCXI27BH.js} +219 -4
- package/dist/chunk-BCXI27BH.js.map +1 -0
- package/dist/{chunk-PRKLFKNC.js → chunk-BSPOMUA7.js} +4 -4
- package/dist/{chunk-PRKLFKNC.js.map → chunk-BSPOMUA7.js.map} +1 -1
- package/dist/{chunk-MWFYXUFK.js → chunk-G2CXWUO5.js} +4 -4
- package/dist/{chunk-MWFYXUFK.js.map → chunk-G2CXWUO5.js.map} +1 -1
- package/dist/{chunk-BEAIJRVF.js → chunk-GHWJHOYX.js} +4 -4
- package/dist/{chunk-BEAIJRVF.js.map → chunk-GHWJHOYX.js.map} +1 -1
- package/dist/{chunk-5FLEP4X6.js → chunk-HBF7A7JB.js} +45 -5
- package/dist/chunk-HBF7A7JB.js.map +1 -0
- package/dist/{chunk-MJ77WSJC.js → chunk-HIFLMPNV.js} +6 -6
- package/dist/{chunk-MJ77WSJC.js.map → chunk-HIFLMPNV.js.map} +1 -1
- package/dist/{chunk-KPZZI2KG.js → chunk-HV3ZCE4M.js} +3 -3
- package/dist/{chunk-KPZZI2KG.js.map → chunk-HV3ZCE4M.js.map} +1 -1
- package/dist/{chunk-Q26C5GLO.js → chunk-IP3GXHOB.js} +3 -4
- package/dist/chunk-IP3GXHOB.js.map +1 -0
- package/dist/{chunk-RRCNMURJ.js → chunk-J7HJUX4W.js} +29 -21
- package/dist/chunk-J7HJUX4W.js.map +1 -0
- package/dist/{chunk-BK3WL3QK.js → chunk-JAHHMZWG.js} +3 -3
- package/dist/{chunk-BK3WL3QK.js.map → chunk-JAHHMZWG.js.map} +1 -1
- package/dist/{chunk-BOH6AG6Q.js → chunk-KHLEQB4F.js} +47 -37
- package/dist/chunk-KHLEQB4F.js.map +1 -0
- package/dist/chunk-M5D2QNTY.js +23 -0
- package/dist/chunk-M5D2QNTY.js.map +1 -0
- package/dist/{chunk-2OCYS5EP.js → chunk-O7WKKINT.js} +4 -4
- package/dist/{chunk-2OCYS5EP.js.map → chunk-O7WKKINT.js.map} +1 -1
- package/dist/{chunk-3HVASHBF.js → chunk-OCLCDB7G.js} +6 -15
- package/dist/chunk-OCLCDB7G.js.map +1 -0
- package/dist/{chunk-NU4E7C5I.js → chunk-PW4SJE3X.js} +3 -3
- package/dist/{chunk-NU4E7C5I.js.map → chunk-PW4SJE3X.js.map} +1 -1
- package/dist/{chunk-O6B3ZZ5S.js → chunk-QAH2DYIP.js} +4 -4
- package/dist/{chunk-O6B3ZZ5S.js.map → chunk-QAH2DYIP.js.map} +1 -1
- package/dist/{chunk-33GWB3RB.js → chunk-QEQ5I47S.js} +3 -3
- package/dist/{chunk-33GWB3RB.js.map → chunk-QEQ5I47S.js.map} +1 -1
- package/dist/{chunk-EP7VBFMN.js → chunk-R4BUI5BU.js} +7 -7
- package/dist/{chunk-EP7VBFMN.js.map → chunk-R4BUI5BU.js.map} +1 -1
- package/dist/{chunk-46LE3GNY.js → chunk-RUFTB7QN.js} +3 -3
- package/dist/{chunk-46LE3GNY.js.map → chunk-RUFTB7QN.js.map} +1 -1
- package/dist/{chunk-UFY2HFLO.js → chunk-SH572OBN.js} +4 -4
- package/dist/{chunk-UFY2HFLO.js.map → chunk-SH572OBN.js.map} +1 -1
- package/dist/{chunk-OD3ABXUO.js → chunk-UEH5XAQR.js} +8 -8
- package/dist/{chunk-OD3ABXUO.js.map → chunk-UEH5XAQR.js.map} +1 -1
- package/dist/{chunk-DYMWJAL4.js → chunk-VQ4P7UYE.js} +3 -3
- package/dist/{chunk-DYMWJAL4.js.map → chunk-VQ4P7UYE.js.map} +1 -1
- package/dist/{chunk-AM5LFRXJ.js → chunk-WAFHQDLK.js} +3 -3
- package/dist/{chunk-AM5LFRXJ.js.map → chunk-WAFHQDLK.js.map} +1 -1
- package/dist/{chunk-3KEJ2HJY.js → chunk-WC7Q6GMC.js} +3 -3
- package/dist/{chunk-3KEJ2HJY.js.map → chunk-WC7Q6GMC.js.map} +1 -1
- package/dist/cli/index.js +145 -170
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/commands/run.d.ts.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +9 -9
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/cli/src/paths.d.ts +9 -33
- package/dist/cli/src/paths.d.ts.map +1 -1
- package/dist/connectors/config.js +7 -7
- package/dist/connectors/index.js +12 -12
- package/dist/core/index.js +6 -6
- package/dist/core/logging.js +2 -2
- package/dist/core/manifest.js +2 -2
- package/dist/core/runtime-assets.js +4 -4
- package/dist/core/src/asset-roots.d.ts +74 -0
- package/dist/core/src/asset-roots.d.ts.map +1 -0
- package/dist/core/src/index.d.ts +1 -0
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +0 -2
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +3 -3
- package/dist/deploy/index.js +6 -6
- package/dist/discovery/index.js +3 -3
- package/dist/{ensure-sources-L2276FYP.js → ensure-sources-SZABN3WG.js} +13 -13
- package/dist/{ensure-sources-L2276FYP.js.map → ensure-sources-SZABN3WG.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +12 -12
- package/dist/factory-assets/connectors/deploy.js +12 -12
- package/dist/factory-assets/connectors/devserver.js +12 -12
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +22 -2
- package/dist/factory-assets/connectors/flow/adapter.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +12 -12
- package/dist/factory-assets/connectors/flow/engine/index.d.ts +1 -0
- package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/locate.d.ts +75 -0
- package/dist/factory-assets/connectors/flow/engine/locate.d.ts.map +1 -0
- package/dist/factory-assets/connectors/flow/engine.js +7 -7
- package/dist/factory-assets/connectors/flow/index.d.ts +1 -1
- package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/node-executor.d.ts +23 -3
- package/dist/factory-assets/connectors/flow/node-executor.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts +9 -1
- package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +14 -14
- package/dist/factory-assets/connectors/flow.js +12 -12
- package/dist/factory-assets/connectors/git.js +12 -12
- package/dist/factory-assets/connectors/gmail.js +12 -12
- package/dist/factory-assets/connectors/googledrive.js +12 -12
- package/dist/factory-assets/connectors/local.js +12 -12
- package/dist/factory-assets/connectors/mattermost.js +12 -12
- package/dist/factory-assets/connectors/memory.js +12 -12
- package/dist/factory-assets/connectors/minio.js +12 -12
- package/dist/factory-assets/connectors/postgres.js +12 -12
- package/dist/factory-assets/connectors/s3.js +12 -12
- package/dist/factory-assets/connectors/sharepoint.js +12 -12
- package/dist/factory-assets/connectors/sqlite.js +12 -12
- package/dist/factory-assets/connectors/static-server.js +12 -12
- package/dist/factory-assets/connectors/tunnel.js +12 -12
- package/dist/factory-assets/connectors/webdav.js +12 -12
- package/dist/factory-assets/connectors/xstate-store.js +12 -12
- package/dist/factory-assets/connectors/xstate.js +12 -12
- package/dist/flows-4PIPK2S6.js +20 -0
- package/dist/{flows-7CZKSC64.js.map → flows-4PIPK2S6.js.map} +1 -1
- package/dist/{helpers-ZWHB5JHQ.js → helpers-XDIMXDTI.js} +13 -13
- package/dist/{helpers-ZWHB5JHQ.js.map → helpers-XDIMXDTI.js.map} +1 -1
- package/dist/library/index.js +8 -8
- package/dist/library/install.js +6 -6
- package/dist/library/src/config.d.ts +6 -6
- package/dist/library/src/config.d.ts.map +1 -1
- package/dist/{library-publish-CVYFMVGR.js → library-publish-HDYBQF46.js} +17 -17
- package/dist/{library-publish-CVYFMVGR.js.map → library-publish-HDYBQF46.js.map} +1 -1
- package/dist/{open-library-XB65LU3M.js → open-library-LAUJOTYJ.js} +15 -15
- package/dist/{open-library-XB65LU3M.js.map → open-library-LAUJOTYJ.js.map} +1 -1
- package/dist/paths-S7UESJKT.js +16 -0
- package/dist/{paths-B52KTS7N.js.map → paths-S7UESJKT.js.map} +1 -1
- package/dist/{plugin-store-EOP3S7OU.js → plugin-store-5SJX2PRR.js} +8 -8
- package/dist/{plugin-store-EOP3S7OU.js.map → plugin-store-5SJX2PRR.js.map} +1 -1
- package/dist/{project-E5LKCE7R.js → project-6IW2N3MX.js} +14 -14
- package/dist/{project-E5LKCE7R.js.map → project-6IW2N3MX.js.map} +1 -1
- package/dist/resolver/index.js +7 -7
- package/dist/runner/index.js +17 -17
- package/dist/runner/src/compaction/orchestrator.d.ts +14 -2
- package/dist/runner/src/compaction/orchestrator.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +10 -10
- package/dist/sdk/bridge.js +9 -9
- package/dist/sdk/core.js +6 -6
- package/dist/sdk/flow.js +7 -7
- package/dist/sdk/index.js +17 -17
- package/dist/sdk/resolver.js +7 -7
- package/dist/sdk/runner.js +17 -17
- package/dist/sdk/session.js +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/src/dispatcher.d.ts +15 -0
- package/dist/session/src/dispatcher.d.ts.map +1 -1
- package/dist/session/src/workspace-change-digest.d.ts +34 -0
- package/dist/session/src/workspace-change-digest.d.ts.map +1 -0
- package/dist/{setup-XI7TCIGF.js → setup-YA2QHQ2N.js} +11 -11
- package/dist/{setup-XI7TCIGF.js.map → setup-YA2QHQ2N.js.map} +1 -1
- package/dist/skills-OBJX3VYG.js +20 -0
- package/dist/{skills-5PJ6YVM7.js.map → skills-OBJX3VYG.js.map} +1 -1
- package/dist/{source-7BNREKGK.js → source-FIE5KQS2.js} +16 -16
- package/dist/{source-7BNREKGK.js.map → source-FIE5KQS2.js.map} +1 -1
- package/dist/{source-manifest-publish-JGMHNADH.js → source-manifest-publish-64PTOEP2.js} +18 -18
- package/dist/{source-manifest-publish-JGMHNADH.js.map → source-manifest-publish-64PTOEP2.js.map} +1 -1
- package/dist/tui/index.js +17 -17
- package/dist/types/src/events.d.ts +1 -1
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +11 -11
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3HVASHBF.js.map +0 -1
- package/dist/chunk-5FLEP4X6.js.map +0 -1
- package/dist/chunk-6OMKIPIE.js +0 -42
- package/dist/chunk-6OMKIPIE.js.map +0 -1
- package/dist/chunk-BOH6AG6Q.js.map +0 -1
- package/dist/chunk-E5S2WGTS.js.map +0 -1
- package/dist/chunk-P43HBWKK.js.map +0 -1
- package/dist/chunk-PKEAYYEJ.js.map +0 -1
- package/dist/chunk-Q26C5GLO.js.map +0 -1
- package/dist/chunk-RRCNMURJ.js.map +0 -1
- package/dist/flows-7CZKSC64.js +0 -20
- package/dist/paths-B52KTS7N.js +0 -22
- package/dist/skills-5PJ6YVM7.js +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,113 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#547](https://github.com/skaile-ai/workspaces/pull/547) [`28d6d27`](https://github.com/skaile-ai/workspaces/commit/28d6d27d8504e751e60a4a6dbdbf013de6fedc6c) Thanks [@peteralbert](https://github.com/peteralbert)! - Count cached prompt tokens toward context fill, so automatic compaction can
|
|
8
|
+
actually fire. `CompactionOrchestrator.shouldCompact()` derived fill from
|
|
9
|
+
`usage.inputTokens` alone, but on a cached Anthropic conversation `input_tokens`
|
|
10
|
+
is ~2-10 while the real context sits in `cache_read_input_tokens` — fill computed
|
|
11
|
+
as ~0.005% and the 80% threshold was unreachable. The same field fed
|
|
12
|
+
`tokensBefore`, so a manual compaction's real summary was compared against a
|
|
13
|
+
~10-token baseline and discarded as `poor_ratio`.
|
|
14
|
+
|
|
15
|
+
Both now read a new exported `contextTokens()` helper:
|
|
16
|
+
`max(inputTokens, cacheReadTokens) + cacheCreationTokens`. The `max` rather than a
|
|
17
|
+
sum is deliberate — Anthropic reports fresh input separately from cache reads, but
|
|
18
|
+
OpenAI's `inputTokens` already includes them, and summing would double-count that
|
|
19
|
+
driver into permanent compaction.
|
|
20
|
+
|
|
21
|
+
A driver that reports no context window now falls back to a 200_000 default
|
|
22
|
+
instead of returning `false`: a missing window silently disabling compaction is
|
|
23
|
+
strictly worse than compacting somewhat early. A real per-model window table is
|
|
24
|
+
follow-up work.
|
|
25
|
+
|
|
26
|
+
Also removes the dead `compaction.compactOnHibernate` config key — nothing reads
|
|
27
|
+
it and no code path invokes `compact("hibernate")`. The `CompactionTrigger` union
|
|
28
|
+
keeps `"hibernate"`, so hosts calling `compact("hibernate")` are unaffected. See
|
|
29
|
+
`MIGRATION.md`.
|
|
30
|
+
|
|
31
|
+
## 3.4.0
|
|
32
|
+
|
|
33
|
+
### Minor Changes
|
|
34
|
+
|
|
35
|
+
- [#540](https://github.com/skaile-ai/workspaces/pull/540) [`876318e`](https://github.com/skaile-ai/workspaces/commit/876318e3cf0e69249b61f95725509e8f7725f507) Thanks [@peteralbert](https://github.com/peteralbert)! - Abort a `function`/`check` node's spawned process when its `control.timeoutSec`
|
|
36
|
+
fires. `NodeExecutor.execute` gains an optional second parameter carrying an
|
|
37
|
+
`AbortSignal`; `SessionNodeExecutor` honors it by killing the spawned process
|
|
38
|
+
_group_ with `SIGTERM`, escalating to `SIGKILL` after a 2s grace, and settling
|
|
39
|
+
only once the child has exited. The drain then gates the next deterministic
|
|
40
|
+
spawn on that settlement, because `abort()` only _starts_ a kill — without the
|
|
41
|
+
gate a retry is spawned during the escalation grace and, for a command that
|
|
42
|
+
traps `SIGTERM`, all `N + 1` attempts run at once. Previously the timeout only
|
|
43
|
+
stopped the adapter _waiting_: with `control.retries: N` up to N+1 orphaned
|
|
44
|
+
processes could run at once, all producing results guaranteed to be discarded.
|
|
45
|
+
|
|
46
|
+
The seam change is additive. An executor that declares only `(request)` still
|
|
47
|
+
satisfies the interface and keeps today's behavior — the node still fails on
|
|
48
|
+
timeout and a late settlement is still rejected; only the abandoned work goes
|
|
49
|
+
unreaped. One behavioral note for such an executor: because the retry gate waits
|
|
50
|
+
for the aborted attempt to settle, an executor that never honors the abort now
|
|
51
|
+
delays its own retry by that bounded budget. A timed-out node with no retry left
|
|
52
|
+
is never waited on, so a hung executor still cannot stall the drain's return.
|
|
53
|
+
|
|
54
|
+
Deterministic nodes now spawn `detached`, which is what makes the kill reach the
|
|
55
|
+
command's own children; the executor group-kills anything still live at process
|
|
56
|
+
exit to compensate for the child no longer inheriting the runtime's group
|
|
57
|
+
signals. Timeout computation, retry budgeting, and late-settlement rejection are
|
|
58
|
+
unchanged, and the `subprompt` seam still has no cancellation.
|
|
59
|
+
|
|
60
|
+
### Patch Changes
|
|
61
|
+
|
|
62
|
+
- [#545](https://github.com/skaile-ai/workspaces/pull/545) [`3ab5535`](https://github.com/skaile-ai/workspaces/commit/3ab553531f2c0300e3a32df22e703936a86ad5b2) Thanks [@peteralbert](https://github.com/peteralbert)! - Deliver watched workspace changes that arrive while an agent is idle as one
|
|
63
|
+
bounded, escaped digest on the next agent-visible message. The digest is never
|
|
64
|
+
persisted as user-authored chat, active-turn file events are suppressed, and a
|
|
65
|
+
failed client send restores pending changes for the next eligible delivery.
|
|
66
|
+
|
|
67
|
+
- [#543](https://github.com/skaile-ai/workspaces/pull/543) [`12c03ca`](https://github.com/skaile-ai/workspaces/commit/12c03ca69f632a704afe8efcc9378c085a4e9fa4) Thanks [@peteralbert](https://github.com/peteralbert)! - Make `resolveFlowPath` accept every flow file discovery accepts, so a flow
|
|
68
|
+
`skaile flow list` shows is one `skaile resume`, a sub-flow `run.flow` target and
|
|
69
|
+
`skaile serve` can actually find. `resolveFlowPath` had its own hard-coded
|
|
70
|
+
candidate list — `.flow.yaml` plus a legacy bare `.json` under `ai-assets/` — and
|
|
71
|
+
its own root walk, while discovery had grown to `.flow.yaml` / `.flow.yml` /
|
|
72
|
+
`.flow.json` / `.json` across flat and per-flow-directory layouts and every
|
|
73
|
+
content root. Nobody widened the second list when the first grew, so
|
|
74
|
+
`.skaile/flows/<id>/<id>.flow.json`, `.skaile/flows/<id>.flow.json` and any
|
|
75
|
+
`.flow.yml` reported `Flow not found: <id>` for a file that was present, parsed,
|
|
76
|
+
and had been listed one command earlier.
|
|
77
|
+
|
|
78
|
+
Both surfaces now go through one definition: `flowLookupRoots` (root policy) and
|
|
79
|
+
`findFlowFileInRoots` (filename policy), exported from the flow engine. The root
|
|
80
|
+
policy itself moved down into `@skaile/workspaces/core` as `aiResourceRoots` /
|
|
81
|
+
`skaileHomeDir` / `resolveLibraryDir`, because both layers that need it already
|
|
82
|
+
depend on `core` while a `factory-assets → cli` import would be a module cycle.
|
|
83
|
+
`@skaile/workspaces/library` and the CLI's `paths` module re-export the same
|
|
84
|
+
symbols, so no public API changed.
|
|
85
|
+
|
|
86
|
+
Two behaviour changes worth knowing:
|
|
87
|
+
|
|
88
|
+
1. **Resolution is by declared id, not filename.** `resolveFlowPath` used to
|
|
89
|
+
accept `<id>.flow.yaml` on its name alone and let `loadFlow` throw afterwards.
|
|
90
|
+
It now matches the declared `id`, like `run` and `flow list` already did. A
|
|
91
|
+
file whose declared id disagrees with its name is reported by path and
|
|
92
|
+
declared id instead of resolving — and `Flow not found` now names the roots
|
|
93
|
+
searched, the accepted filenames, and any such near miss.
|
|
94
|
+
2. **`resume` / sub-flow targets / `serve` reach the same roots `run` does** —
|
|
95
|
+
factory assets, user libraries and the global `~/.skaile/` install root, in
|
|
96
|
+
addition to the project's `.skaile/` and `ai-assets/`. That is the point of
|
|
97
|
+
the fix (resume must find what run ran), not an escalation: those are the
|
|
98
|
+
roots `skaile run` already executes from.
|
|
99
|
+
3. **Root precedence follows `run` too.** `resolveFlowPath` used to probe
|
|
100
|
+
`<project>/.skaile/flows/` before walking up to `ai-assets/`; it now searches
|
|
101
|
+
the authored `ai-assets/` tree first, which is the order `skaile run` has
|
|
102
|
+
always used so a workspace can shadow a built-in flow. For a flow id present
|
|
103
|
+
in _both_, a resumed session therefore executes the authored source rather
|
|
104
|
+
than the deployed, `patches:`-applied copy under `.skaile/` — the same bytes
|
|
105
|
+
`run` would have executed for that id.
|
|
106
|
+
|
|
107
|
+
The `isValidAssetName` identity guard and the "Flow path escapes its lookup root"
|
|
108
|
+
containment guard are unchanged; widening the accepted extensions does not widen
|
|
109
|
+
which paths are reachable.
|
|
110
|
+
|
|
3
111
|
## 3.3.0
|
|
4
112
|
|
|
5
113
|
### Minor Changes
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { assignDomain, buildDomainIndex, DOMAIN_MD_FILENAME, parseDomainMd } from './chunk-
|
|
1
|
+
import { assignDomain, buildDomainIndex, DOMAIN_MD_FILENAME, parseDomainMd } from './chunk-PW4SJE3X.js';
|
|
2
2
|
import './chunk-JXT46QFC.js';
|
|
3
|
-
import './chunk-
|
|
3
|
+
import './chunk-AZPXCHDK.js';
|
|
4
4
|
import './chunk-F3HNW354.js';
|
|
5
5
|
import './chunk-K5GBV4SA.js';
|
|
6
6
|
import './chunk-QVZA2MDT.js';
|
|
7
|
-
import { factoryAssetRoots } from './chunk-
|
|
8
|
-
import { scanRepo } from './chunk-
|
|
7
|
+
import { factoryAssetRoots } from './chunk-SH572OBN.js';
|
|
8
|
+
import { scanRepo } from './chunk-IP3GXHOB.js';
|
|
9
9
|
import './chunk-MENCWIHW.js';
|
|
10
10
|
import './chunk-P4VHQA4N.js';
|
|
11
|
-
import { walkDir, parseFrontmatter } from './chunk-
|
|
11
|
+
import { walkDir, parseFrontmatter } from './chunk-VQ4P7UYE.js';
|
|
12
12
|
import './chunk-GEEW6SY2.js';
|
|
13
|
-
import './chunk-
|
|
14
|
-
import './chunk-
|
|
13
|
+
import './chunk-5Q7HA4JP.js';
|
|
14
|
+
import './chunk-3A5IKBHQ.js';
|
|
15
15
|
import './chunk-IRORTHGA.js';
|
|
16
16
|
import './chunk-NSBPE2FW.js';
|
|
17
17
|
import { existsSync, readFileSync } from 'fs';
|
|
@@ -65,7 +65,7 @@ async function libraryAssets() {
|
|
|
65
65
|
const domains = [];
|
|
66
66
|
try {
|
|
67
67
|
const [{ openLibraryManager }, { skaileHomeDir }, { getGlobalCacheDir }] = await Promise.all([
|
|
68
|
-
import('./open-library-
|
|
68
|
+
import('./open-library-LAUJOTYJ.js'),
|
|
69
69
|
import('./library/index.js'),
|
|
70
70
|
import('./core/index.js')
|
|
71
71
|
]);
|
|
@@ -98,7 +98,7 @@ async function libraryAssets() {
|
|
|
98
98
|
async function storeAssets(projectDir) {
|
|
99
99
|
const notes = [];
|
|
100
100
|
try {
|
|
101
|
-
const { resolveCatalogSource } = await import('./open-library-
|
|
101
|
+
const { resolveCatalogSource } = await import('./open-library-LAUJOTYJ.js');
|
|
102
102
|
const { source, close } = await resolveCatalogSource({ projectDir });
|
|
103
103
|
try {
|
|
104
104
|
const assets = await source.listAssets();
|
|
@@ -202,5 +202,5 @@ function dedupeBySlug(domains) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
export { gatherAssetFeeds };
|
|
205
|
-
//# sourceMappingURL=asset-feeds-
|
|
206
|
-
//# sourceMappingURL=asset-feeds-
|
|
205
|
+
//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,GAAA,CAAI,OAAA;AAAA,MACP,GAAG,IAAA,CAAK,OAAA;AAAA,MACR,GAAG,GAAA,CAAI,SAAA,EAAW,OAAA,CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;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-AGAH5OHC.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}. */\nasync function loadDomainMds(root: string): Promise<DomainMd[]> {\n const out: DomainMd[] = [];\n for await (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 */\nasync function stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): Promise<CatalogDomain[]> {\n const domainMds = await 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 = [...(await scanRepo(lib.path, lib.name))];\n domains.push(...(await 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: () => Promise<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 */\nasync function sourceAssets(\n am: AssetManagerLike,\n): Promise<{ 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 = (await 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(...(await 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). Local disk only, 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 */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...(await scanRepo(root, \"skaile-factory\"))];\n domains.push(...(await 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 disk only, 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 = await factoryAssets();\n const src = await 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"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CAAQ,OAAO,CAAA;AAAA,MACjC,GAAG,GAAA,CAAI,OAAA,EAAS,KAAA,CAAM,OAAO;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-SILUSNAL.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}. */\nasync function loadDomainMds(root: string): Promise<DomainMd[]> {\n const out: DomainMd[] = [];\n for await (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 */\nasync function stampDomains(\n root: string,\n fallbackSlug: string,\n entries: CatalogEntry[],\n synthesizeFallback = true,\n): Promise<CatalogDomain[]> {\n const domainMds = await 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 = [...(await scanRepo(lib.path, lib.name))];\n domains.push(...(await 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: () => Promise<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 */\nasync function sourceAssets(\n am: AssetManagerLike,\n): Promise<{ 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 = (await 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(...(await 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). Local disk only, 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 */\nasync function factoryAssets(): Promise<{\n entries: CatalogEntry[];\n domains: CatalogDomain[];\n notes: FeedNote[];\n}> {\n const notes: FeedNote[] = [];\n const domains: CatalogDomain[] = [];\n try {\n const entries: CatalogEntry[] = [];\n for (const root of factoryAssetRoots()) {\n const rootEntries = [...(await scanRepo(root, \"skaile-factory\"))];\n domains.push(...(await 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 disk only, 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 = await factoryAssets();\n const src = await 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,16 +1,16 @@
|
|
|
1
|
-
export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoot, isUnderWorkspaceMount, resolveFlowSkills, undeployCatalogEntry, workspaceMountDirs } from '../chunk-GHWJHOYX.js';
|
|
2
|
+
import '../chunk-AZPXCHDK.js';
|
|
3
3
|
import '../chunk-F3HNW354.js';
|
|
4
4
|
import '../chunk-K5GBV4SA.js';
|
|
5
5
|
import '../chunk-QVZA2MDT.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-SH572OBN.js';
|
|
7
|
+
import '../chunk-IP3GXHOB.js';
|
|
8
8
|
import '../chunk-MENCWIHW.js';
|
|
9
9
|
import '../chunk-P4VHQA4N.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-VQ4P7UYE.js';
|
|
11
11
|
import '../chunk-GEEW6SY2.js';
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-5Q7HA4JP.js';
|
|
13
|
+
import '../chunk-3A5IKBHQ.js';
|
|
14
14
|
import '../chunk-NSBPE2FW.js';
|
|
15
15
|
//# sourceMappingURL=catalog-deployer.js.map
|
|
16
16
|
//# sourceMappingURL=catalog-deployer.js.map
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-UEH5XAQR.js';
|
|
2
|
+
import '../chunk-OCLCDB7G.js';
|
|
3
|
+
import '../chunk-PW4SJE3X.js';
|
|
4
4
|
import '../chunk-UKJMQZV6.js';
|
|
5
5
|
import '../chunk-R7FOF242.js';
|
|
6
6
|
import '../chunk-JXT46QFC.js';
|
|
7
|
-
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-
|
|
7
|
+
export { createScaffold, deployAll, installAgent, removeAsset } from '../chunk-O7WKKINT.js';
|
|
8
8
|
export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../chunk-CGYEHQOX.js';
|
|
9
|
-
import '../chunk-
|
|
9
|
+
import '../chunk-AZPXCHDK.js';
|
|
10
10
|
import '../chunk-F3HNW354.js';
|
|
11
11
|
import '../chunk-K5GBV4SA.js';
|
|
12
12
|
import '../chunk-QVZA2MDT.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-SH572OBN.js';
|
|
14
|
+
import '../chunk-IP3GXHOB.js';
|
|
15
15
|
import '../chunk-MENCWIHW.js';
|
|
16
16
|
import '../chunk-P4VHQA4N.js';
|
|
17
|
-
import '../chunk-
|
|
17
|
+
import '../chunk-VQ4P7UYE.js';
|
|
18
18
|
import '../chunk-GEEW6SY2.js';
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
19
|
+
import '../chunk-5Q7HA4JP.js';
|
|
20
|
+
import '../chunk-3A5IKBHQ.js';
|
|
21
21
|
export { appendHistory, clearHistory, getRecentHistory, loadHistory } from '../chunk-KTBKW2FI.js';
|
|
22
22
|
import '../chunk-UQ6LFBPZ.js';
|
|
23
23
|
export { AGENT_RENDERERS, claudeCodeRenderer, codexRenderer, driverTargetSupportsAgents, ompRenderer, renderAgentToFramework } from '../chunk-IEX5YV4R.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-
|
|
1
|
+
export { createScaffold, deployAll, deployAsset, removeAsset } from '../chunk-O7WKKINT.js';
|
|
2
2
|
import '../chunk-CGYEHQOX.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-AZPXCHDK.js';
|
|
4
4
|
import '../chunk-F3HNW354.js';
|
|
5
5
|
import '../chunk-K5GBV4SA.js';
|
|
6
6
|
import '../chunk-QVZA2MDT.js';
|
|
7
|
-
import '../chunk-
|
|
8
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-SH572OBN.js';
|
|
8
|
+
import '../chunk-IP3GXHOB.js';
|
|
9
9
|
import '../chunk-MENCWIHW.js';
|
|
10
10
|
import '../chunk-P4VHQA4N.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-VQ4P7UYE.js';
|
|
12
12
|
import '../chunk-GEEW6SY2.js';
|
|
13
|
-
import '../chunk-
|
|
14
|
-
import '../chunk-
|
|
13
|
+
import '../chunk-5Q7HA4JP.js';
|
|
14
|
+
import '../chunk-3A5IKBHQ.js';
|
|
15
15
|
import '../chunk-IEX5YV4R.js';
|
|
16
16
|
import '../chunk-IRORTHGA.js';
|
|
17
17
|
import '../chunk-NSBPE2FW.js';
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { scrubPoisonedTranscript, resolveClaudeConfigDir, SUPPORTED_CLOUDS, buildClaudeCloudEnv } from '../../chunk-
|
|
1
|
+
import { scrubPoisonedTranscript, resolveClaudeConfigDir, SUPPORTED_CLOUDS, buildClaudeCloudEnv } from '../../chunk-RUFTB7QN.js';
|
|
2
2
|
import { dispatchCapability } from '../../chunk-RRVQAE5D.js';
|
|
3
3
|
import { fetchProviderModels } from '../../chunk-V34ZEXSE.js';
|
|
4
4
|
import { AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable, AccountUnavailableError } from '../../chunk-GAH4YRCI.js';
|
|
5
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
5
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-AZPXCHDK.js';
|
|
8
8
|
import '../../chunk-F3HNW354.js';
|
|
9
9
|
import '../../chunk-K5GBV4SA.js';
|
|
10
10
|
import '../../chunk-QVZA2MDT.js';
|
|
11
|
-
import '../../chunk-
|
|
12
|
-
import '../../chunk-
|
|
11
|
+
import '../../chunk-SH572OBN.js';
|
|
12
|
+
import '../../chunk-IP3GXHOB.js';
|
|
13
13
|
import '../../chunk-MENCWIHW.js';
|
|
14
14
|
import '../../chunk-P4VHQA4N.js';
|
|
15
|
-
import '../../chunk-
|
|
15
|
+
import '../../chunk-VQ4P7UYE.js';
|
|
16
16
|
import '../../chunk-GEEW6SY2.js';
|
|
17
|
-
import '../../chunk-
|
|
18
|
-
import '../../chunk-
|
|
17
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
18
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
19
19
|
import '../../chunk-NSBPE2FW.js';
|
|
20
20
|
import { spawnSync, spawn } from 'child_process';
|
|
21
21
|
import { readFileSync, existsSync } from 'fs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { fetchProviderModels } from '../../chunk-V34ZEXSE.js';
|
|
2
2
|
import { classifyGenericErrorMessage } from '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
6
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
9
9
|
import { join, dirname } from 'path';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-7EUW3BBR.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
6
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import * as z from 'zod';
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { dispatchCapability } from '../../chunk-RRVQAE5D.js';
|
|
2
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
2
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
3
3
|
import '../../chunk-6E6PKKAD.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
5
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
import * as z from 'zod';
|
|
8
8
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-QAH2DYIP.js';
|
|
2
|
+
import '../../chunk-7EUW3BBR.js';
|
|
3
3
|
import '../../chunk-V34ZEXSE.js';
|
|
4
4
|
import '../../chunk-GAH4YRCI.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-4YYJV6TW.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
8
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
9
9
|
import '../../chunk-NSBPE2FW.js';
|
|
10
10
|
//# sourceMappingURL=gemini.js.map
|
|
11
11
|
//# sourceMappingURL=gemini.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-7EUW3BBR.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
6
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import * as z from 'zod';
|
|
9
9
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { classifyGenericErrorMessage } from '../../chunk-GAH4YRCI.js';
|
|
2
|
-
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-
|
|
2
|
+
import { BUILTIN_DRIVER_CATALOG, AgentDriver, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
3
3
|
import '../../chunk-6E6PKKAD.js';
|
|
4
|
-
import '../../chunk-
|
|
5
|
-
import '../../chunk-
|
|
4
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
5
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
6
6
|
import '../../chunk-NSBPE2FW.js';
|
|
7
7
|
import { spawn, execFile } from 'child_process';
|
|
8
8
|
import fs from 'fs/promises';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-7EUW3BBR.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
|
-
import '../../chunk-
|
|
6
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
6
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
7
7
|
import '../../chunk-NSBPE2FW.js';
|
|
8
8
|
import * as z from 'zod';
|
|
9
9
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { GeminiFamilyDriver } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { GeminiFamilyDriver } from '../../chunk-QAH2DYIP.js';
|
|
2
|
+
import '../../chunk-7EUW3BBR.js';
|
|
3
3
|
import { fetchProviderModels } from '../../chunk-V34ZEXSE.js';
|
|
4
4
|
import '../../chunk-GAH4YRCI.js';
|
|
5
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
5
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-4YYJV6TW.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
|
-
import '../../chunk-
|
|
8
|
-
import '../../chunk-
|
|
7
|
+
import '../../chunk-5Q7HA4JP.js';
|
|
8
|
+
import '../../chunk-3A5IKBHQ.js';
|
|
9
9
|
import '../../chunk-NSBPE2FW.js';
|
|
10
10
|
import * as z from 'zod';
|
|
11
11
|
|
package/dist/bridge/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-
|
|
2
|
-
export { CLOUD_SECRET_ENV_KEYS, SUPPORTED_CLOUDS, buildClaudeCloudEnv, probeResumeTranscript, resolveClaudeConfigDir } from '../chunk-
|
|
1
|
+
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-HV3ZCE4M.js';
|
|
2
|
+
export { CLOUD_SECRET_ENV_KEYS, SUPPORTED_CLOUDS, buildClaudeCloudEnv, probeResumeTranscript, resolveClaudeConfigDir } from '../chunk-RUFTB7QN.js';
|
|
3
3
|
export { dispatchCapability, filterRenderCapabilities, renderFallback } from '../chunk-RRVQAE5D.js';
|
|
4
4
|
export { ModelTierResolutionError, PROVIDER_MODEL_TIERS, STATIC_MODELS, fetchProviderModels, getModels, getStaticModels, resolveModelTier } from '../chunk-V34ZEXSE.js';
|
|
5
5
|
export { AccountUnavailableError, AuthError, classifyClaudeSdkError, reclassifyAuthAsAccountUnavailable } from '../chunk-GAH4YRCI.js';
|
|
6
|
-
export { AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, registerBuiltinDrivers } from '../chunk-
|
|
6
|
+
export { AgentDriver, BUILTIN_DRIVER_CATALOG, DRIVER_CATALOG, createDriver, getBridgeLogger, listDrivers, listModelsForDriver, registerBuiltinDrivers } from '../chunk-4YYJV6TW.js';
|
|
7
7
|
import '../chunk-6E6PKKAD.js';
|
|
8
|
-
import '../chunk-
|
|
8
|
+
import '../chunk-AZPXCHDK.js';
|
|
9
9
|
import '../chunk-F3HNW354.js';
|
|
10
10
|
import '../chunk-K5GBV4SA.js';
|
|
11
11
|
import '../chunk-QVZA2MDT.js';
|
|
12
|
-
import '../chunk-
|
|
13
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-SH572OBN.js';
|
|
13
|
+
import '../chunk-IP3GXHOB.js';
|
|
14
14
|
import '../chunk-MENCWIHW.js';
|
|
15
15
|
import '../chunk-P4VHQA4N.js';
|
|
16
|
-
import '../chunk-
|
|
16
|
+
import '../chunk-VQ4P7UYE.js';
|
|
17
17
|
import '../chunk-GEEW6SY2.js';
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-5Q7HA4JP.js';
|
|
19
|
+
import '../chunk-3A5IKBHQ.js';
|
|
20
20
|
import '../chunk-NSBPE2FW.js';
|
|
21
21
|
//# sourceMappingURL=index.js.map
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { readAllSessions } from './chunk-R6O6YWU7.js';
|
|
2
|
-
import { findAiAssetsRoot } from './chunk-
|
|
2
|
+
import { findAiAssetsRoot } from './chunk-JAHHMZWG.js';
|
|
3
3
|
import { okJson, err } from './chunk-X5YPJV4N.js';
|
|
4
4
|
|
|
5
5
|
// workspace-plugin/src/tools/flows.ts
|
|
@@ -68,5 +68,5 @@ async function flowFindFlowForSession(projectDir, runId) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
export { flowFindFlowForSession, flowGetSession, flowList, flowListSessions, flowShow };
|
|
71
|
-
//# sourceMappingURL=chunk-
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
71
|
+
//# sourceMapp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AAA,4BAAA,EAA+B,KAAK,CAAA,oBAAA,CAAsB,CAAA;AAEtF,IAAA,MAAM,EAAE,YAAA,EAAa,GAAI,MAAM,OAC7B,4CACF,CAAA;AACA,IAAA,MAAM,KAAA,GAAQ,aAAa,UAAU,CAAA;AACrC,IAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,CAAC,MAAW,CAAA,CAAE,EAAA,KAAO,QAAQ,MAAM,CAAA;AAC3D,IAAA,IAAI,CAAC,IAAA,EAAM,OAAO,IAAI,CAAA,gBAAA,EAAmB,OAAA,CAAQ,MAAM,CAAA,CAAE,CAAA;AACzD,IAAA,OAAO,OAAO,IAAI,CAAA;AAAA,EACpB,SAAS,CAAA,EAAY;AACnB,IAAA,OAAO,IAAI,CAAA,YAAa,KAAA,GAAQ,EAAE,OAAA,GAAU,MAAA,CAAO,CAAC,CAAC,CAAA;AAAA,EACvD;AACF","file":"chunk-33ZEIMFJ.js","sourcesContent":["// src/tools/flows.ts\n\nimport type { ToolResult } from \"../types.js\";\nimport { err, okJson } from \"../types.js\";\nimport { findAiAssetsRoot } from \"../utils/ai-assets.js\";\nimport { readAllSessions } from \"./sessions.js\";\n\n// ── Flow tools ────────────────────────────────────────────────────────────────\n\n/**\n * List all flow definitions available in the project's `ai-assets` directory.\n *\n * Returns a JSON array of summary objects `{ id, name, nodeCount }`.\n * Returns an empty array when no `ai-assets` root is found.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowList(projectDir: string): Promise<ToolResult> {\n try {\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return okJson([]);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const summary = flows.map((f: any) => ({\n id: f.id,\n name: f.name ?? f.id,\n nodeCount: f.nodes?.length ?? 0,\n }));\n return okJson(summary);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Show the full flow definition (nodes, edges, metadata) for a specific flow.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param flowId - Flow ID as returned by {@link flowList}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowShow(projectDir: string, flowId: string): Promise<ToolResult> {\n try {\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found: ${flowId}`);\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === flowId);\n if (!flow) return err(`Flow not found: ${flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * List all past and active flow run sessions for the workspace.\n *\n * Delegates to {@link readAllSessions} (reads `.skaile/sessions/*.json`),\n * sorted newest-first by `updatedAt`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowListSessions(projectDir: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n return okJson(sessions);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Get driver metadata for a specific flow run session.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowGetSession(projectDir: string, runId: string): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n return okJson(session);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n\n/**\n * Resolve and return the flow definition that was used in a past session.\n *\n * Looks up the session by `runId`, reads its `flowId`, then returns the full\n * flow definition from `ai-assets`.\n *\n * @param projectDir - Absolute path to the skaile project root.\n * @param runId - Run ID from {@link flowListSessions}.\n *\n * @docLink packages/workspace-plugin/concepts#tool-delivery\n */\nexport async function flowFindFlowForSession(\n projectDir: string,\n runId: string,\n): Promise<ToolResult> {\n try {\n const sessions = await readAllSessions(projectDir);\n const session = sessions.find((s) => s.runId === runId);\n if (!session) return err(`Session not found: ${runId}`);\n\n const assetsRoot = await findAiAssetsRoot(projectDir);\n if (!assetsRoot) return err(`Flow not found for session: ${runId} (no ai-assets root)`);\n\n const { loadAllFlows } = await import(\n \"@skaile/workspaces/factory-assets/connectors/flow/engine\"\n );\n const flows = loadAllFlows(assetsRoot);\n const flow = flows.find((f: any) => f.id === session.flowId);\n if (!flow) return err(`Flow not found: ${session.flowId}`);\n return okJson(flow);\n } catch (e: unknown) {\n return err(e instanceof Error ? e.message : String(e));\n }\n}\n"]}
|