@skaile/workspaces 3.1.0 → 3.2.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 +66 -0
- package/README.md +5 -1
- package/dist/{asset-feeds-3XCKB542.js → asset-feeds-SEYSNNEM.js} +5 -5
- package/dist/{asset-feeds-3XCKB542.js.map → asset-feeds-SEYSNNEM.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +1 -1
- package/dist/asset-manager/index.js +2 -2
- package/dist/asset-manager/installer.js +1 -1
- package/dist/bridge/drivers/claude-sdk.js +2 -2
- 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 -3
- package/dist/{chunk-5QGMEPUX.js → chunk-B4J6TV4G.js} +21 -5
- package/dist/chunk-B4J6TV4G.js.map +1 -0
- package/dist/{chunk-H26KDA7J.js → chunk-BEA7RXI3.js} +73 -36
- package/dist/chunk-BEA7RXI3.js.map +1 -0
- package/dist/{chunk-X73AMPOT.js → chunk-BKUANJB7.js} +5 -5
- package/dist/{chunk-X73AMPOT.js.map → chunk-BKUANJB7.js.map} +1 -1
- package/dist/{chunk-BENN6MO4.js → chunk-CH3UTJBT.js} +4 -4
- package/dist/{chunk-BENN6MO4.js.map → chunk-CH3UTJBT.js.map} +1 -1
- package/dist/{chunk-PUEHYNBT.js → chunk-DNYE3SSL.js} +3 -3
- package/dist/{chunk-PUEHYNBT.js.map → chunk-DNYE3SSL.js.map} +1 -1
- package/dist/{chunk-7KFN2EPR.js → chunk-FLBDLF3I.js} +4 -4
- package/dist/{chunk-7KFN2EPR.js.map → chunk-FLBDLF3I.js.map} +1 -1
- package/dist/{chunk-ZGTM4BOU.js → chunk-HCNVX34E.js} +2 -2
- package/dist/{chunk-ZGTM4BOU.js.map → chunk-HCNVX34E.js.map} +1 -1
- package/dist/{chunk-N4GFUWWC.js → chunk-HNBWU5RA.js} +3 -3
- package/dist/{chunk-N4GFUWWC.js.map → chunk-HNBWU5RA.js.map} +1 -1
- package/dist/{chunk-7HXS7WZF.js → chunk-HWEW3VII.js} +2 -2
- package/dist/{chunk-7HXS7WZF.js.map → chunk-HWEW3VII.js.map} +1 -1
- package/dist/{chunk-FP7DNGX6.js → chunk-I7MKEZ6J.js} +3 -3
- package/dist/{chunk-FP7DNGX6.js.map → chunk-I7MKEZ6J.js.map} +1 -1
- package/dist/{chunk-S5FV6ISY.js → chunk-I7S6DFRU.js} +120 -30
- package/dist/chunk-I7S6DFRU.js.map +1 -0
- package/dist/{chunk-MJ6EME7A.js → chunk-IAIHZRG7.js} +6 -6
- package/dist/{chunk-MJ6EME7A.js.map → chunk-IAIHZRG7.js.map} +1 -1
- package/dist/{chunk-HA2H3FLE.js → chunk-KPZZI2KG.js} +3 -3
- package/dist/{chunk-HA2H3FLE.js.map → chunk-KPZZI2KG.js.map} +1 -1
- package/dist/{chunk-TARN55L3.js → chunk-NLZYBWVH.js} +6 -6
- package/dist/{chunk-TARN55L3.js.map → chunk-NLZYBWVH.js.map} +1 -1
- package/dist/{chunk-HNR2IT34.js → chunk-NWFZUQPF.js} +10 -10
- package/dist/{chunk-HNR2IT34.js.map → chunk-NWFZUQPF.js.map} +1 -1
- package/dist/{chunk-2U4ISGE2.js → chunk-O6B3ZZ5S.js} +4 -4
- package/dist/{chunk-2U4ISGE2.js.map → chunk-O6B3ZZ5S.js.map} +1 -1
- package/dist/{chunk-PT2ZUW2E.js → chunk-PTAUN5CY.js} +2 -2
- package/dist/{chunk-PT2ZUW2E.js.map → chunk-PTAUN5CY.js.map} +1 -1
- package/dist/{chunk-ZAP2BDHG.js → chunk-QVZA2MDT.js} +2 -2
- package/dist/chunk-QVZA2MDT.js.map +1 -0
- package/dist/{chunk-QFO4IYBZ.js → chunk-VT6HDD2L.js} +2 -2
- package/dist/{chunk-QFO4IYBZ.js.map → chunk-VT6HDD2L.js.map} +1 -1
- package/dist/{chunk-VBMY3VCW.js → chunk-XVIFPGYH.js} +3 -3
- package/dist/{chunk-VBMY3VCW.js.map → chunk-XVIFPGYH.js.map} +1 -1
- package/dist/cli/index.js +278 -269
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/src/flow-discovery.d.ts +18 -8
- package/dist/cli/src/flow-discovery.d.ts.map +1 -1
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +7 -7
- package/dist/core/discovery.js +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/src/discovery.d.ts +4 -1
- package/dist/core/src/discovery.d.ts.map +1 -1
- package/dist/deploy/index.js +1 -1
- package/dist/{ensure-sources-AST427RF.js → ensure-sources-IM3JMW2L.js} +5 -5
- package/dist/{ensure-sources-AST427RF.js.map → ensure-sources-IM3JMW2L.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +7 -7
- package/dist/factory-assets/connectors/deploy.js +7 -7
- package/dist/factory-assets/connectors/devserver.js +7 -7
- package/dist/factory-assets/connectors/flow/CONNECTOR.md +26 -9
- package/dist/factory-assets/connectors/flow/adapter.d.ts +15 -7
- package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/adapter.js +7 -7
- package/dist/factory-assets/connectors/flow/contract/expression.d.ts +3 -1
- package/dist/factory-assets/connectors/flow/contract/expression.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/contract.js +2 -2
- package/dist/factory-assets/connectors/flow/engine/bindings.d.ts +12 -0
- package/dist/factory-assets/connectors/flow/engine/bindings.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/check-provenance.d.ts +13 -2
- package/dist/factory-assets/connectors/flow/engine/check-provenance.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/engine.d.ts +5 -1
- package/dist/factory-assets/connectors/flow/engine/engine.d.ts.map +1 -1
- 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/loader.d.ts +63 -9
- package/dist/factory-assets/connectors/flow/engine/loader.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/optional-failure.d.ts +24 -0
- package/dist/factory-assets/connectors/flow/engine/optional-failure.d.ts.map +1 -0
- package/dist/factory-assets/connectors/flow/engine/router-settlement.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine/types.d.ts +3 -1
- package/dist/factory-assets/connectors/flow/engine/types.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow/engine.js +3 -3
- package/dist/factory-assets/connectors/flow/prompt-fragments.js +1 -1
- package/dist/factory-assets/connectors/flow/run-flow.js +8 -8
- package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts +9 -1
- package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts.map +1 -1
- package/dist/factory-assets/connectors/flow.js +7 -7
- package/dist/factory-assets/connectors/git.js +7 -7
- package/dist/factory-assets/connectors/gmail.js +7 -7
- package/dist/factory-assets/connectors/googledrive.js +7 -7
- package/dist/factory-assets/connectors/local.js +7 -7
- package/dist/factory-assets/connectors/mattermost.js +7 -7
- package/dist/factory-assets/connectors/memory.js +7 -7
- package/dist/factory-assets/connectors/minio.js +7 -7
- package/dist/factory-assets/connectors/postgres.js +7 -7
- package/dist/factory-assets/connectors/s3.js +7 -7
- package/dist/factory-assets/connectors/sharepoint.js +7 -7
- package/dist/factory-assets/connectors/sqlite.js +7 -7
- package/dist/factory-assets/connectors/static-server.js +7 -7
- package/dist/factory-assets/connectors/tunnel.js +7 -7
- package/dist/factory-assets/connectors/webdav.js +7 -7
- package/dist/factory-assets/connectors/xstate-store.js +7 -7
- package/dist/factory-assets/connectors/xstate.js +7 -7
- package/dist/{flows-LQSVM45J.js → flows-PBNW6BEH.js} +4 -4
- package/dist/{flows-LQSVM45J.js.map → flows-PBNW6BEH.js.map} +1 -1
- package/dist/{helpers-IZDG57TR.js → helpers-LJFOH4RB.js} +5 -5
- package/dist/{helpers-IZDG57TR.js.map → helpers-LJFOH4RB.js.map} +1 -1
- package/dist/library/index.js +1 -1
- package/dist/library/install.js +1 -1
- package/dist/{library-publish-XGJ7IOU2.js → library-publish-BEFA7OCS.js} +9 -9
- package/dist/{library-publish-XGJ7IOU2.js.map → library-publish-BEFA7OCS.js.map} +1 -1
- package/dist/{open-library-YDS66KLH.js → open-library-WJ7P7B4N.js} +8 -8
- package/dist/{open-library-YDS66KLH.js.map → open-library-WJ7P7B4N.js.map} +1 -1
- package/dist/{paths-ZLX4ITAQ.js → paths-2ZZMB7HU.js} +3 -3
- package/dist/{paths-ZLX4ITAQ.js.map → paths-2ZZMB7HU.js.map} +1 -1
- package/dist/{plugin-store-YIMNH2FH.js → plugin-store-EOP3S7OU.js} +3 -3
- package/dist/{plugin-store-YIMNH2FH.js.map → plugin-store-EOP3S7OU.js.map} +1 -1
- package/dist/{project-NR53RZOT.js → project-6RXDBSRV.js} +6 -6
- package/dist/{project-NR53RZOT.js.map → project-6RXDBSRV.js.map} +1 -1
- package/dist/resolver/index.js +1 -1
- package/dist/runner/index.js +11 -11
- package/dist/sdk/asset-manager.js +2 -2
- package/dist/sdk/bridge.js +3 -3
- package/dist/sdk/core.js +1 -1
- package/dist/sdk/flow.js +3 -3
- package/dist/sdk/index.js +11 -11
- package/dist/sdk/resolver.js +1 -1
- package/dist/sdk/runner.js +11 -11
- package/dist/{setup-I5SLLHRA.js → setup-XI7TCIGF.js} +5 -5
- package/dist/{setup-I5SLLHRA.js.map → setup-XI7TCIGF.js.map} +1 -1
- package/dist/{skills-HGVH6UTA.js → skills-5PJ6YVM7.js} +3 -3
- package/dist/{skills-HGVH6UTA.js.map → skills-5PJ6YVM7.js.map} +1 -1
- package/dist/{source-DDZKKQH2.js → source-TJ457ZRQ.js} +9 -9
- package/dist/{source-DDZKKQH2.js.map → source-TJ457ZRQ.js.map} +1 -1
- package/dist/{source-manifest-publish-OTVKHRX3.js → source-manifest-publish-R3Q4MT5W.js} +10 -10
- package/dist/{source-manifest-publish-OTVKHRX3.js.map → source-manifest-publish-R3Q4MT5W.js.map} +1 -1
- package/dist/tui/index.js +11 -11
- package/dist/types/src/flow.d.ts +38 -12
- package/dist/types/src/flow.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +2 -2
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-5QGMEPUX.js.map +0 -1
- package/dist/chunk-H26KDA7J.js.map +0 -1
- package/dist/chunk-S5FV6ISY.js.map +0 -1
- package/dist/chunk-ZAP2BDHG.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#524](https://github.com/skaile-ai/workspaces/pull/524) [`aa41b03`](https://github.com/skaile-ai/workspaces/commit/aa41b036e4952cf13835f3a51d67f52ca674e485) Thanks [@peteralbert](https://github.com/peteralbert)! - Discover flows in a per-flow directory, and resolve them by declared id everywhere.
|
|
8
|
+
|
|
9
|
+
`loadFlowsFromDir` was a single flat `readdirSync`, so a flow at `flows/<id>/<id>.flow.yaml` —
|
|
10
|
+
the natural layout once a flow keeps assets beside it — was invisible to `skaile flow list` and
|
|
11
|
+
`skaile run` with no error. It now also loads `flows/<sub>/<sub>.flow.{yaml,yml,json}` and
|
|
12
|
+
`flows/<sub>/<sub>.json`, where the file must be named after its directory so sibling assets are
|
|
13
|
+
never parsed as flows. A subdirectory holding something flow-shaped that the convention cannot
|
|
14
|
+
reach is now reported on stderr with its path and the expected name instead of dropped silently;
|
|
15
|
+
`_`-prefixed files and directories remain the silent opt-out.
|
|
16
|
+
|
|
17
|
+
`findFlowFile` resolved by filename while `flow list`, `flow show`, and the workspace-plugin MCP
|
|
18
|
+
tools resolve by the declared `id`, so a flow whose filename differed from its id was listable but
|
|
19
|
+
not runnable (and runnable under a name that was never listed). Resolution now goes through the
|
|
20
|
+
same enumeration listing uses, keyed on the declared `id`, so the two surfaces agree by
|
|
21
|
+
construction. `.flow.yml` — parsed by `loadFlow` but absent from both discovery filters — is now
|
|
22
|
+
accepted by both.
|
|
23
|
+
|
|
24
|
+
## 3.2.0
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- [#520](https://github.com/skaile-ai/workspaces/pull/520) [`04a0b61`](https://github.com/skaile-ai/workspaces/commit/04a0b61fada3da62a78bb1e35e491a7d0155be1e) Thanks [@peteralbert](https://github.com/peteralbert)! - Resolve an optional flow node's exhausted failure to `skipped` uniformly, instead of only for `sub-flow` and `subprompt`.
|
|
29
|
+
|
|
30
|
+
`isBlocking` admits a hard `flow` edge only for `complete` and `skipped`, so an optional `agent` (deadline expiry or `fail_node(recoverable: false)`), `function`, or `check` node that ran out of retry budget ended `failed` and blocked every hard-edge dependent forever — a permanent stall at the node the author explicitly marked expendable, which is the opposite of what `control.optional` means. The rule was stated at four terminal-failure sites and implemented at two; all nine now route through one pure `resolveTerminalFailureStatus(node)` in `engine/optional-failure.ts`. `agent`, `subprompt`, `function`, and `sub-flow` are the kinds this can change; `check` routes through the same helper but is inert, because `control.optional` on a check is refused at parse time. `outputHistory` is untouched — every degraded attempt still records `result: "failed"`, so the skip is a compatibility status, not a rewritten history.
|
|
31
|
+
|
|
32
|
+
A `router` is the one deliberate exception and still fails when optional. `unsettledRouterBranchIds` excludes a `skipped` router from the gated set while every outgoing hard edge counts as satisfied, so skipping a router admits _all_ of its branches at once — the opposite of selecting one. Optional routers are not hypothetical: v1 normalization maps legacy groups and unknown node kinds onto exactly that shape.
|
|
33
|
+
|
|
34
|
+
Two consequences worth knowing before upgrading. A node about to be written `skipped` no longer reports `error.recoverable: true`, and `retryNode` still refuses `skipped` — so an optional `function`/`agent` node that declared `control.retries` loses the manual operator-retry escape hatch it had while it ended `failed`. That is the intended trade: recovery from a skip is deliberately one-way, because a skip has already released the graph (dependents typically become available in the same drain) and `retryNode` owns no cascade or invalidation machinery, whereas a `failed` node still blocks its dependents and leaves nothing downstream to unwind. `skipped` is also not only a failure resolution — `skip_node` and router loser-pruning produce it — so accepting it would quietly turn `retryNode` into an un-skip and a way to resurrect a pruned router branch. `retryNode`'s refusal message now names the skip instead of reporting a generic non-recoverable failure.
|
|
35
|
+
|
|
36
|
+
Binding a skipped producer's output is now legible. `FlowExpressionError` gains `skippedProducer`, and a `nodes.<id>.output.fields.<name>` read over a `skipped` producer raises `Flow expression cannot read <path>: producer node <id> was skipped and produced no output` instead of the bare `path does not exist`, which said nothing about the upstream skip. `missingPath` is still set, so router settlement classifies it unchanged. Only `skipped` is narrowed this way — `not_started`, `running`, `failed`, and complete-but-fieldless producers keep the generic message.
|
|
37
|
+
|
|
38
|
+
Finally, router settlement no longer waits on a terminal producer: `pendingProducerOutput` treated anything other than `complete` as "not ready yet", so a router reading a skipped (or failed) producer's declared output parked forever. Only a genuinely non-terminal producer is pending now; an unreadable route expression propagates on the path it already took, carrying the message that names the skipped producer.
|
|
39
|
+
|
|
40
|
+
- [#523](https://github.com/skaile-ai/workspaces/pull/523) [`d5d3c31`](https://github.com/skaile-ai/workspaces/commit/d5d3c31d6e98cedba1556564dc139a7620fc400f) Thanks [@peteralbert](https://github.com/peteralbert)! - Make flow binding provenance transitive, so a passthrough node cannot launder it.
|
|
41
|
+
|
|
42
|
+
`BindingOrigin.obtainedBy` was computed one hop from the producing node's kind alone. A
|
|
43
|
+
three-line passthrough `function` node that read an agent's output and re-emitted it as its own
|
|
44
|
+
output relabelled that value `obtainedBy: "runtime"`, and a downstream `check` then reported
|
|
45
|
+
`provenance: "verified"` over it — with `(verified)` shown to the human approver in the escalation
|
|
46
|
+
summary. A value is now runtime-obtained only when no agent-produced value contributed to it
|
|
47
|
+
anywhere in its ancestry, restoring the full claim that provenance is derived and cannot be
|
|
48
|
+
asserted by flow configuration.
|
|
49
|
+
|
|
50
|
+
**Persisted shape (additive).** `NodeExecution` and `NodeExecutionSnapshot` gain an optional
|
|
51
|
+
`inputOrigins?: Record<string, BindingOrigin[]>` — the origins resolved for the attempt that
|
|
52
|
+
produced `output`, a latest-pointer that moves with it. `function`, `check`, `subprompt`, and
|
|
53
|
+
`sub-flow` nodes write it in the same mutation that writes `output`; `agent` nodes record it at
|
|
54
|
+
`start_node` for auditability (their output is agent-obtained by kind, so nothing reads it back);
|
|
55
|
+
`gate` and `router` nodes record nothing, because neither resolves bindings and neither emits
|
|
56
|
+
`output.fields` a downstream binding could read. Classification stays one lookup rather than an
|
|
57
|
+
ancestry walk: a producer's persisted origins were themselves classified under this rule when it
|
|
58
|
+
ran, so they already carry any upstream taint.
|
|
59
|
+
|
|
60
|
+
**Runs that were mid-flight when the field did not exist** have completed nodes with no
|
|
61
|
+
`inputOrigins`. Absence is read **fail-closed** — as agent-obtained, never as clean — so those
|
|
62
|
+
runs' checks report the weaker `"asserted"` instead of a possibly false `"verified"`. Nothing
|
|
63
|
+
throws, and a run self-heals as its nodes re-run and as new runs start. `{}` (a node that
|
|
64
|
+
genuinely bound nothing) is distinct from absence and reads as runtime-obtained, and a malformed
|
|
65
|
+
persisted entry is read fail-closed rather than thrown on. Hosts that persist and rehydrate
|
|
66
|
+
`FlowExecution` should store the new field; a host that drops it degrades that run's checks to
|
|
67
|
+
`"asserted"` rather than misreporting them.
|
|
68
|
+
|
|
3
69
|
## 3.1.0
|
|
4
70
|
|
|
5
71
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -120,7 +120,11 @@ response parsing through the same consumed-output validation every kind uses;
|
|
|
120
120
|
there is no corrective reprompt, so a parse or validation failure is an
|
|
121
121
|
ordinary node failure. A subprompt's output is classified agent-obtained, so a
|
|
122
122
|
downstream check always derives "asserted" provenance over it, never
|
|
123
|
-
"verified".
|
|
123
|
+
"verified". That classification is transitive — every executed node persists
|
|
124
|
+
the origins it resolved on `NodeExecution.inputOrigins`, so a deterministic
|
|
125
|
+
node that carries an agent's value forward cannot launder it to
|
|
126
|
+
runtime-obtained, and a producer with no persisted origins (a run predating
|
|
127
|
+
the field) is read as agent-obtained rather than clean. Gate nodes
|
|
124
128
|
park immediately through the durable approval state, complete on approval, and
|
|
125
129
|
preserve rejection feedback for revision and a later approval re-request.
|
|
126
130
|
Router nodes evaluate ordered bounded expressions only after admission. The first
|
|
@@ -3,7 +3,7 @@ import './chunk-JXT46QFC.js';
|
|
|
3
3
|
import './chunk-P43HBWKK.js';
|
|
4
4
|
import './chunk-F3HNW354.js';
|
|
5
5
|
import './chunk-K5GBV4SA.js';
|
|
6
|
-
import './chunk-
|
|
6
|
+
import './chunk-QVZA2MDT.js';
|
|
7
7
|
import { factoryAssetRoots } from './chunk-UFY2HFLO.js';
|
|
8
8
|
import { scanRepo } from './chunk-Q26C5GLO.js';
|
|
9
9
|
import './chunk-MENCWIHW.js';
|
|
@@ -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-WJ7P7B4N.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-WJ7P7B4N.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
|
+
//# sourceMappingURL=asset-feeds-SEYSNNEM.js.map
|
|
206
|
+
//# sourceMappingURL=asset-feeds-SEYSNNEM.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,eAAe,cAAc,IAAA,EAAmC;AAC9D,EAAA,MAAM,MAAkB,EAAC;AACzB,EAAA,WAAA,MAAiB,EAAE,IAAA,EAAM,QAAA,EAAU,MAAK,IAAK,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC1D,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,IAAC;AAAA,EACX;AACA,EAAA,OAAO,GAAA;AACT;AAcA,eAAe,YAAA,CACb,IAAA,EACA,YAAA,EACA,OAAA,EACA,qBAAqB,IAAA,EACK;AAC1B,EAAA,MAAM,SAAA,GAAY,MAAM,aAAA,CAAc,IAAI,CAAA;AAC1C,EAAA,MAAM,WAA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GAAA,CAAI,CAAC,aAAA,EAAc,EAAG,WAAA,CAAY,UAAU,CAAC,CAAC,CAAA;AAClF,EAAA,MAAM,OAAA,GAAU,MAAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,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-3XCKB542.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
|
+
{"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,eAAe,cAAc,IAAA,EAAmC;AAC9D,EAAA,MAAM,MAAkB,EAAC;AACzB,EAAA,WAAA,MAAiB,EAAE,IAAA,EAAM,QAAA,EAAU,MAAK,IAAK,OAAA,CAAQ,IAAI,CAAA,EAAG;AAC1D,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,IAAC;AAAA,EACX;AACA,EAAA,OAAO,GAAA;AACT;AAcA,eAAe,YAAA,CACb,IAAA,EACA,YAAA,EACA,OAAA,EACA,qBAAqB,IAAA,EACK;AAC1B,EAAA,MAAM,SAAA,GAAY,MAAM,aAAA,CAAc,IAAI,CAAA;AAC1C,EAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,GAAA,CAAI,CAAC,KAAA,MAAW;AAAA,IAC1C,KAAA;AAAA,IACA,KAAK,CAAA,EAAG,KAA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AAM,aAAA,EAAc;AACpC,EAAA,MAAM,GAAA,GAAM,MAAM,YAAA,CAAa,EAAE,CAAA;AACjC,EAAA,OAAO;AAAA,IACL,OAAA,EAAS;AAAA,MACP,GAAG,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-SEYSNNEM.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"]}
|
|
@@ -2,7 +2,7 @@ export { WORKSPACE_MOUNT_ENV_VAR, deployAll, deployCatalogEntry, findAiAssetsRoo
|
|
|
2
2
|
import '../chunk-P43HBWKK.js';
|
|
3
3
|
import '../chunk-F3HNW354.js';
|
|
4
4
|
import '../chunk-K5GBV4SA.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-QVZA2MDT.js';
|
|
6
6
|
import '../chunk-UFY2HFLO.js';
|
|
7
7
|
import '../chunk-Q26C5GLO.js';
|
|
8
8
|
import '../chunk-MENCWIHW.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-
|
|
1
|
+
export { AssetManager, FACTORY_SOURCE_URL, MissingManifestError, NON_DEPLOYABLE_KINDS, normalizeRepoUrl, parseCanonicalLockKey, parseRefTolerant, renderMcpServerConfig, softDepName } from '../chunk-HCNVX34E.js';
|
|
2
2
|
import '../chunk-3HVASHBF.js';
|
|
3
3
|
import '../chunk-NU4E7C5I.js';
|
|
4
4
|
import '../chunk-UKJMQZV6.js';
|
|
@@ -9,7 +9,7 @@ export { BUILT_IN_FRAGMENTS, loadPromptExtensions, resolveFragments } from '../c
|
|
|
9
9
|
import '../chunk-P43HBWKK.js';
|
|
10
10
|
import '../chunk-F3HNW354.js';
|
|
11
11
|
import '../chunk-K5GBV4SA.js';
|
|
12
|
-
import '../chunk-
|
|
12
|
+
import '../chunk-QVZA2MDT.js';
|
|
13
13
|
import '../chunk-UFY2HFLO.js';
|
|
14
14
|
import '../chunk-Q26C5GLO.js';
|
|
15
15
|
import '../chunk-MENCWIHW.js';
|
|
@@ -3,7 +3,7 @@ import '../chunk-CGYEHQOX.js';
|
|
|
3
3
|
import '../chunk-P43HBWKK.js';
|
|
4
4
|
import '../chunk-F3HNW354.js';
|
|
5
5
|
import '../chunk-K5GBV4SA.js';
|
|
6
|
-
import '../chunk-
|
|
6
|
+
import '../chunk-QVZA2MDT.js';
|
|
7
7
|
import '../chunk-UFY2HFLO.js';
|
|
8
8
|
import '../chunk-Q26C5GLO.js';
|
|
9
9
|
import '../chunk-MENCWIHW.js';
|
|
@@ -2,12 +2,12 @@ import { scrubPoisonedTranscript, resolveClaudeConfigDir, SUPPORTED_CLOUDS, buil
|
|
|
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-VT6HDD2L.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
7
|
import '../../chunk-P43HBWKK.js';
|
|
8
8
|
import '../../chunk-F3HNW354.js';
|
|
9
9
|
import '../../chunk-K5GBV4SA.js';
|
|
10
|
-
import '../../chunk-
|
|
10
|
+
import '../../chunk-QVZA2MDT.js';
|
|
11
11
|
import '../../chunk-UFY2HFLO.js';
|
|
12
12
|
import '../../chunk-Q26C5GLO.js';
|
|
13
13
|
import '../../chunk-MENCWIHW.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
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-VT6HDD2L.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
5
|
import '../../chunk-U5POE4BA.js';
|
|
6
6
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-I7MKEZ6J.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-VT6HDD2L.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
5
|
import '../../chunk-U5POE4BA.js';
|
|
6
6
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
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-VT6HDD2L.js';
|
|
3
3
|
import '../../chunk-6E6PKKAD.js';
|
|
4
4
|
import '../../chunk-U5POE4BA.js';
|
|
5
5
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
export { GeminiDriver, GeminiFamilyDriver, geminiDriverTarget } from '../../chunk-O6B3ZZ5S.js';
|
|
2
|
+
import '../../chunk-I7MKEZ6J.js';
|
|
3
3
|
import '../../chunk-V34ZEXSE.js';
|
|
4
4
|
import '../../chunk-GAH4YRCI.js';
|
|
5
|
-
import '../../chunk-
|
|
5
|
+
import '../../chunk-VT6HDD2L.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
7
|
import '../../chunk-U5POE4BA.js';
|
|
8
8
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-I7MKEZ6J.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-VT6HDD2L.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
5
|
import '../../chunk-U5POE4BA.js';
|
|
6
6
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
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-VT6HDD2L.js';
|
|
3
3
|
import '../../chunk-6E6PKKAD.js';
|
|
4
4
|
import '../../chunk-U5POE4BA.js';
|
|
5
5
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-
|
|
1
|
+
import { SubprocessCliDriver, mapApiKeysToEnv, extractText, extractCost, extractTokens } from '../../chunk-I7MKEZ6J.js';
|
|
2
2
|
import '../../chunk-GAH4YRCI.js';
|
|
3
|
-
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-
|
|
3
|
+
import { BUILTIN_DRIVER_CATALOG, getBridgeLogger } from '../../chunk-VT6HDD2L.js';
|
|
4
4
|
import '../../chunk-6E6PKKAD.js';
|
|
5
5
|
import '../../chunk-U5POE4BA.js';
|
|
6
6
|
import '../../chunk-7GOCNYUV.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { GeminiFamilyDriver } from '../../chunk-
|
|
2
|
-
import '../../chunk-
|
|
1
|
+
import { GeminiFamilyDriver } from '../../chunk-O6B3ZZ5S.js';
|
|
2
|
+
import '../../chunk-I7MKEZ6J.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-VT6HDD2L.js';
|
|
6
6
|
import '../../chunk-6E6PKKAD.js';
|
|
7
7
|
import '../../chunk-U5POE4BA.js';
|
|
8
8
|
import '../../chunk-7GOCNYUV.js';
|
package/dist/bridge/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-
|
|
1
|
+
export { BridgeRuntime, EventNormalizer, createRuntime, detectFileChange, detectFileChanges, summarizeToolCall, summarizeToolResult, validateApiKey } from '../chunk-KPZZI2KG.js';
|
|
2
2
|
export { CLOUD_SECRET_ENV_KEYS, SUPPORTED_CLOUDS, buildClaudeCloudEnv, probeResumeTranscript, resolveClaudeConfigDir } from '../chunk-46LE3GNY.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-VT6HDD2L.js';
|
|
7
7
|
import '../chunk-6E6PKKAD.js';
|
|
8
8
|
import '../chunk-P43HBWKK.js';
|
|
9
9
|
import '../chunk-F3HNW354.js';
|
|
10
10
|
import '../chunk-K5GBV4SA.js';
|
|
11
|
-
import '../chunk-
|
|
11
|
+
import '../chunk-QVZA2MDT.js';
|
|
12
12
|
import '../chunk-UFY2HFLO.js';
|
|
13
13
|
import '../chunk-Q26C5GLO.js';
|
|
14
14
|
import '../chunk-MENCWIHW.js';
|
|
@@ -22,15 +22,19 @@ var FlowExpressionError = class extends Error {
|
|
|
22
22
|
name = "FlowExpressionError";
|
|
23
23
|
/** Runtime path that was grammar-valid but absent from the supplied context. */
|
|
24
24
|
missingPath;
|
|
25
|
-
|
|
25
|
+
/** Producer node whose `skipped` status is why {@link missingPath} is absent. */
|
|
26
|
+
skippedProducer;
|
|
27
|
+
constructor(message, missingPath, skippedProducer) {
|
|
26
28
|
super(message);
|
|
27
29
|
this.missingPath = missingPath;
|
|
30
|
+
this.skippedProducer = skippedProducer;
|
|
28
31
|
}
|
|
29
32
|
};
|
|
30
|
-
function expressionError(message, position, missingPath) {
|
|
33
|
+
function expressionError(message, position, missingPath, skippedProducer) {
|
|
31
34
|
return new FlowExpressionError(
|
|
32
35
|
position === void 0 ? `Flow expression ${message}` : `Flow expression ${message} at ${position}`,
|
|
33
|
-
missingPath
|
|
36
|
+
missingPath,
|
|
37
|
+
skippedProducer
|
|
34
38
|
);
|
|
35
39
|
}
|
|
36
40
|
function parseString(source, start) {
|
|
@@ -159,6 +163,7 @@ function resolvePath(raw, context, position, traverse) {
|
|
|
159
163
|
if (forbidden) throw expressionError(`contains forbidden path segment ${forbidden}`, position);
|
|
160
164
|
let value;
|
|
161
165
|
let remaining;
|
|
166
|
+
let skippedProducer;
|
|
162
167
|
if (segments[0] === "flow" && segments[1] === "input") {
|
|
163
168
|
if (segments.length === 2) {
|
|
164
169
|
throw expressionError("path requires a JSON property suffix", position);
|
|
@@ -175,12 +180,23 @@ function resolvePath(raw, context, position, traverse) {
|
|
|
175
180
|
if (segments.length === 4) {
|
|
176
181
|
throw expressionError("path requires a JSON property suffix", position);
|
|
177
182
|
}
|
|
183
|
+
if (Object.hasOwn(context.nodes, segments[1]) && context.nodes[segments[1]].status === "skipped") {
|
|
184
|
+
skippedProducer = segments[1];
|
|
185
|
+
}
|
|
178
186
|
value = context.nodes;
|
|
179
187
|
remaining = segments.slice(1);
|
|
180
188
|
} else {
|
|
181
189
|
throw expressionError(`contains unsupported path ${raw}`, position);
|
|
182
190
|
}
|
|
183
191
|
if (!traverse) return void 0;
|
|
192
|
+
if (skippedProducer !== void 0) {
|
|
193
|
+
throw expressionError(
|
|
194
|
+
`cannot read ${raw}: producer node ${skippedProducer} was skipped and produced no output`,
|
|
195
|
+
position,
|
|
196
|
+
raw,
|
|
197
|
+
skippedProducer
|
|
198
|
+
);
|
|
199
|
+
}
|
|
184
200
|
for (const segment of remaining) value = ownValue(value, segment, position, raw);
|
|
185
201
|
return value;
|
|
186
202
|
}
|
|
@@ -1252,5 +1268,5 @@ function parseFlowDefinition(data) {
|
|
|
1252
1268
|
}
|
|
1253
1269
|
|
|
1254
1270
|
export { FLOW_EXPRESSION_LIMITS, FlowDefinitionSchema, FlowExpressionError, collectFlowBindingExpressions, evaluate, evaluateFlowExpression, inspectFlowExpression, normalizeV1, parseFlowDefinition, resolveFlowBindings, stableFlowJson };
|
|
1255
|
-
//# sourceMappingURL=chunk-
|
|
1256
|
-
//# sourceMappingURL=chunk-
|
|
1271
|
+
//# sourceMappingURL=chunk-B4J6TV4G.js.map
|
|
1272
|
+
//# sourceMappingURL=chunk-B4J6TV4G.js.map
|