@skaile/workspaces 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +35 -12
  3. package/dist/{asset-feeds-D2LOXTOS.js → asset-feeds-4AWAT5PW.js} +6 -6
  4. package/dist/{asset-feeds-D2LOXTOS.js.map → asset-feeds-4AWAT5PW.js.map} +1 -1
  5. package/dist/asset-manager/catalog-deployer.js +1 -1
  6. package/dist/asset-manager/index.js +5 -5
  7. package/dist/asset-manager/installer.js +2 -2
  8. package/dist/bridge/drivers/claude-sdk.js +5 -2
  9. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  10. package/dist/bridge/drivers/codex.js +1 -1
  11. package/dist/bridge/drivers/continue.js +2 -2
  12. package/dist/bridge/drivers/echo.js +1 -1
  13. package/dist/bridge/drivers/gemini.js +3 -3
  14. package/dist/bridge/drivers/goose.js +2 -2
  15. package/dist/bridge/drivers/omp.js +1 -1
  16. package/dist/bridge/drivers/opencode.js +2 -2
  17. package/dist/bridge/drivers/qwen.js +3 -3
  18. package/dist/bridge/index.js +2 -2
  19. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  20. package/dist/{chunk-CERGXDGG.js → chunk-2OCYS5EP.js} +3 -3
  21. package/dist/{chunk-CERGXDGG.js.map → chunk-2OCYS5EP.js.map} +1 -1
  22. package/dist/{chunk-TQIU4HQG.js → chunk-2QVPCZTL.js} +101 -40
  23. package/dist/chunk-2QVPCZTL.js.map +1 -0
  24. package/dist/{chunk-A67FJ4YT.js → chunk-3HVASHBF.js} +3 -3
  25. package/dist/{chunk-A67FJ4YT.js.map → chunk-3HVASHBF.js.map} +1 -1
  26. package/dist/chunk-4O2RAXKJ.js +446 -0
  27. package/dist/chunk-4O2RAXKJ.js.map +1 -0
  28. package/dist/chunk-4QROZZ5Z.js +50 -0
  29. package/dist/chunk-4QROZZ5Z.js.map +1 -0
  30. package/dist/{chunk-VSSAJYFK.js → chunk-57RFYEVM.js} +3 -3
  31. package/dist/{chunk-VSSAJYFK.js.map → chunk-57RFYEVM.js.map} +1 -1
  32. package/dist/{chunk-SZJCUC52.js → chunk-6BV5NAPD.js} +156 -28
  33. package/dist/chunk-6BV5NAPD.js.map +1 -0
  34. package/dist/{chunk-MAIKGYFR.js → chunk-AKVAZ5CB.js} +2 -2
  35. package/dist/{chunk-MAIKGYFR.js.map → chunk-AKVAZ5CB.js.map} +1 -1
  36. package/dist/{chunk-BFIK6NPZ.js → chunk-AM5LFRXJ.js} +3 -3
  37. package/dist/{chunk-BFIK6NPZ.js.map → chunk-AM5LFRXJ.js.map} +1 -1
  38. package/dist/{chunk-6QSGCHE5.js → chunk-EEHOMCRU.js} +1071 -123
  39. package/dist/chunk-EEHOMCRU.js.map +1 -0
  40. package/dist/{chunk-6I5VRIX3.js → chunk-ENBTXMPL.js} +7 -7
  41. package/dist/{chunk-6I5VRIX3.js.map → chunk-ENBTXMPL.js.map} +1 -1
  42. package/dist/{chunk-Y662DNQQ.js → chunk-FKBQRV4J.js} +68 -24
  43. package/dist/chunk-FKBQRV4J.js.map +1 -0
  44. package/dist/{chunk-BUPFJFGP.js → chunk-G5V6YCHF.js} +3 -3
  45. package/dist/{chunk-BUPFJFGP.js.map → chunk-G5V6YCHF.js.map} +1 -1
  46. package/dist/{chunk-KGIVZOLU.js → chunk-GM2X24Q6.js} +2 -2
  47. package/dist/{chunk-KGIVZOLU.js.map → chunk-GM2X24Q6.js.map} +1 -1
  48. package/dist/{chunk-5BH6ZEGC.js → chunk-IHX2SN35.js} +9 -9
  49. package/dist/{chunk-5BH6ZEGC.js.map → chunk-IHX2SN35.js.map} +1 -1
  50. package/dist/{chunk-6HPTB6KT.js → chunk-JAFEMG7W.js} +4 -4
  51. package/dist/{chunk-6HPTB6KT.js.map → chunk-JAFEMG7W.js.map} +1 -1
  52. package/dist/{chunk-I5ESMJMW.js → chunk-MADO7PH5.js} +2 -2
  53. package/dist/{chunk-I5ESMJMW.js.map → chunk-MADO7PH5.js.map} +1 -1
  54. package/dist/{chunk-BCTU4TN7.js → chunk-MWFYXUFK.js} +3 -3
  55. package/dist/{chunk-BCTU4TN7.js.map → chunk-MWFYXUFK.js.map} +1 -1
  56. package/dist/{chunk-MAN7AGQJ.js → chunk-NU4E7C5I.js} +25 -6
  57. package/dist/chunk-NU4E7C5I.js.map +1 -0
  58. package/dist/{chunk-RKMXBOIO.js → chunk-O7ROIKTF.js} +3 -3
  59. package/dist/{chunk-RKMXBOIO.js.map → chunk-O7ROIKTF.js.map} +1 -1
  60. package/dist/chunk-OEGHKO5N.js +1236 -0
  61. package/dist/chunk-OEGHKO5N.js.map +1 -0
  62. package/dist/{chunk-63ZPKREA.js → chunk-P43HBWKK.js} +11 -4
  63. package/dist/chunk-P43HBWKK.js.map +1 -0
  64. package/dist/{chunk-IR6VPAVH.js → chunk-PJ6INYDD.js} +3 -3
  65. package/dist/{chunk-IR6VPAVH.js.map → chunk-PJ6INYDD.js.map} +1 -1
  66. package/dist/{chunk-DHGMYXOY.js → chunk-UGKOWIRP.js} +4 -4
  67. package/dist/{chunk-DHGMYXOY.js.map → chunk-UGKOWIRP.js.map} +1 -1
  68. package/dist/{chunk-WA7ADYSA.js → chunk-UZYTSIX6.js} +6 -6
  69. package/dist/{chunk-WA7ADYSA.js.map → chunk-UZYTSIX6.js.map} +1 -1
  70. package/dist/chunk-V4ZLZJFN.js +86 -0
  71. package/dist/chunk-V4ZLZJFN.js.map +1 -0
  72. package/dist/{chunk-GPMIXOJJ.js → chunk-WSARNOPP.js} +5 -5
  73. package/dist/{chunk-GPMIXOJJ.js.map → chunk-WSARNOPP.js.map} +1 -1
  74. package/dist/cli/index.js +49 -46
  75. package/dist/cli/index.js.map +1 -1
  76. package/dist/connectors/config.js +1 -1
  77. package/dist/connectors/index.js +6 -4
  78. package/dist/core/index.js +1 -1
  79. package/dist/core/src/subprocess.d.ts +5 -1
  80. package/dist/core/src/subprocess.d.ts.map +1 -1
  81. package/dist/deploy/index.js +1 -1
  82. package/dist/discovery/index.js +1 -1
  83. package/dist/discovery/src/requires-graph.d.ts +1 -1
  84. package/dist/discovery/src/requires-graph.d.ts.map +1 -1
  85. package/dist/{ensure-sources-6QMXRI6D.js → ensure-sources-QF72HVUM.js} +8 -8
  86. package/dist/{ensure-sources-6QMXRI6D.js.map → ensure-sources-QF72HVUM.js.map} +1 -1
  87. package/dist/factory-assets/connectors/box.js +6 -4
  88. package/dist/factory-assets/connectors/deploy.js +6 -4
  89. package/dist/factory-assets/connectors/devserver.js +6 -4
  90. package/dist/factory-assets/connectors/flow/CONNECTOR.md +63 -10
  91. package/dist/factory-assets/connectors/flow/adapter.d.ts +79 -36
  92. package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
  93. package/dist/factory-assets/connectors/flow/adapter.js +6 -4
  94. package/dist/factory-assets/connectors/flow/contract/expression.d.ts +55 -0
  95. package/dist/factory-assets/connectors/flow/contract/expression.d.ts.map +1 -1
  96. package/dist/factory-assets/connectors/flow/contract/flow.v2.schema.json +61 -134
  97. package/dist/factory-assets/connectors/flow/contract/index.d.ts +1 -1
  98. package/dist/factory-assets/connectors/flow/contract/index.d.ts.map +1 -1
  99. package/dist/factory-assets/connectors/flow/contract/normalize.d.ts +4 -1
  100. package/dist/factory-assets/connectors/flow/contract/normalize.d.ts.map +1 -1
  101. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +20 -8
  102. package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
  103. package/dist/factory-assets/connectors/flow/contract.js +2 -1024
  104. package/dist/factory-assets/connectors/flow/contract.js.map +1 -1
  105. package/dist/factory-assets/connectors/flow/engine/bindings.d.ts +9 -0
  106. package/dist/factory-assets/connectors/flow/engine/bindings.d.ts.map +1 -0
  107. package/dist/factory-assets/connectors/flow/engine/engine.d.ts +11 -6
  108. package/dist/factory-assets/connectors/flow/engine/engine.d.ts.map +1 -1
  109. package/dist/factory-assets/connectors/flow/engine/flow-kind-provider.d.ts +1 -1
  110. package/dist/factory-assets/connectors/flow/engine/flow-kind-provider.d.ts.map +1 -1
  111. package/dist/factory-assets/connectors/flow/engine/index.d.ts +2 -0
  112. package/dist/factory-assets/connectors/flow/engine/index.d.ts.map +1 -1
  113. package/dist/factory-assets/connectors/flow/engine/loader.d.ts.map +1 -1
  114. package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts +42 -0
  115. package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts.map +1 -0
  116. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts +18 -0
  117. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts.map +1 -0
  118. package/dist/factory-assets/connectors/flow/engine/types.d.ts +67 -33
  119. package/dist/factory-assets/connectors/flow/engine/types.d.ts.map +1 -1
  120. package/dist/factory-assets/connectors/flow/engine.js +4 -2
  121. package/dist/factory-assets/connectors/flow/index.d.ts +3 -0
  122. package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
  123. package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts +48 -0
  124. package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts.map +1 -0
  125. package/dist/factory-assets/connectors/flow/node-executor.d.ts +45 -0
  126. package/dist/factory-assets/connectors/flow/node-executor.d.ts.map +1 -0
  127. package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts +5 -6
  128. package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts.map +1 -1
  129. package/dist/factory-assets/connectors/flow/prompt-fragments.js +2 -1
  130. package/dist/factory-assets/connectors/flow/run-flow.d.ts +10 -9
  131. package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
  132. package/dist/factory-assets/connectors/flow/run-flow.js +7 -5
  133. package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts +73 -0
  134. package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts.map +1 -0
  135. package/dist/factory-assets/connectors/flow.js +6 -4
  136. package/dist/factory-assets/connectors/git.js +6 -4
  137. package/dist/factory-assets/connectors/gmail.js +6 -4
  138. package/dist/factory-assets/connectors/googledrive.js +6 -4
  139. package/dist/factory-assets/connectors/local.js +6 -4
  140. package/dist/factory-assets/connectors/mattermost.js +6 -4
  141. package/dist/factory-assets/connectors/memory.js +6 -4
  142. package/dist/factory-assets/connectors/minio.js +6 -4
  143. package/dist/factory-assets/connectors/postgres.js +6 -4
  144. package/dist/factory-assets/connectors/s3.js +6 -4
  145. package/dist/factory-assets/connectors/sharepoint.js +6 -4
  146. package/dist/factory-assets/connectors/sqlite.js +6 -4
  147. package/dist/factory-assets/connectors/static-server.js +6 -4
  148. package/dist/factory-assets/connectors/tunnel.js +6 -4
  149. package/dist/factory-assets/connectors/webdav.js +6 -4
  150. package/dist/factory-assets/connectors/xstate-store.js +6 -4
  151. package/dist/factory-assets/connectors/xstate.js +6 -4
  152. package/dist/{flows-TDDBCLNF.js → flows-YIW4HL3L.js} +4 -4
  153. package/dist/{flows-TDDBCLNF.js.map → flows-YIW4HL3L.js.map} +1 -1
  154. package/dist/{helpers-COQ7TDD4.js → helpers-LURCZHA4.js} +8 -8
  155. package/dist/{helpers-COQ7TDD4.js.map → helpers-LURCZHA4.js.map} +1 -1
  156. package/dist/library/index.js +3 -3
  157. package/dist/library/install.js +1 -1
  158. package/dist/{library-publish-SNPER6PO.js → library-publish-2GMJM3NZ.js} +14 -12
  159. package/dist/library-publish-2GMJM3NZ.js.map +1 -0
  160. package/dist/{open-library-VH2VEYQ7.js → open-library-POFOXZWH.js} +12 -10
  161. package/dist/{open-library-VH2VEYQ7.js.map → open-library-POFOXZWH.js.map} +1 -1
  162. package/dist/{paths-XZA22IB4.js → paths-ZLX4ITAQ.js} +6 -6
  163. package/dist/{paths-XZA22IB4.js.map → paths-ZLX4ITAQ.js.map} +1 -1
  164. package/dist/{plugin-store-CYSNVZIX.js → plugin-store-YIMNH2FH.js} +3 -3
  165. package/dist/{plugin-store-CYSNVZIX.js.map → plugin-store-YIMNH2FH.js.map} +1 -1
  166. package/dist/{project-FKL7PMJV.js → project-GVOPZEJZ.js} +9 -9
  167. package/dist/{project-FKL7PMJV.js.map → project-GVOPZEJZ.js.map} +1 -1
  168. package/dist/resolver/index.js +1 -1
  169. package/dist/runner/index.js +14 -8
  170. package/dist/runner/src/serve.d.ts +3 -1
  171. package/dist/runner/src/serve.d.ts.map +1 -1
  172. package/dist/sdk/asset-manager.js +5 -5
  173. package/dist/sdk/bridge.js +2 -2
  174. package/dist/sdk/core.js +1 -1
  175. package/dist/sdk/flow.js +4 -2
  176. package/dist/sdk/index.js +14 -8
  177. package/dist/sdk/index.js.map +1 -1
  178. package/dist/sdk/resolver.js +1 -1
  179. package/dist/sdk/runner.js +14 -8
  180. package/dist/{setup-BM6HMYJJ.js → setup-TJYLYT2A.js} +5 -5
  181. package/dist/{setup-BM6HMYJJ.js.map → setup-TJYLYT2A.js.map} +1 -1
  182. package/dist/{skills-LHS4TOKK.js → skills-HGVH6UTA.js} +5 -5
  183. package/dist/{skills-LHS4TOKK.js.map → skills-HGVH6UTA.js.map} +1 -1
  184. package/dist/{source-JIUBJC4F.js → source-FB3T4IHP.js} +13 -11
  185. package/dist/{source-JIUBJC4F.js.map → source-FB3T4IHP.js.map} +1 -1
  186. package/dist/{source-manifest-publish-TLH6UWWU.js → source-manifest-publish-XTRDVPSC.js} +15 -13
  187. package/dist/source-manifest-publish-XTRDVPSC.js.map +1 -0
  188. package/dist/tui/index.js +14 -8
  189. package/dist/tui/index.js.map +1 -1
  190. package/dist/types/src/flow.d.ts +26 -0
  191. package/dist/types/src/flow.d.ts.map +1 -1
  192. package/dist/types/src/index.d.ts +1 -1
  193. package/dist/types/src/index.d.ts.map +1 -1
  194. package/dist/workspace-plugin/adapters/mcp.js +4 -4
  195. package/dist/workspace-plugin/adapters/omp.js +7 -7
  196. package/dist/workspace-plugin/index.js +1 -1
  197. package/package.json +1 -1
  198. package/dist/chunk-63ZPKREA.js.map +0 -1
  199. package/dist/chunk-6QSGCHE5.js.map +0 -1
  200. package/dist/chunk-HPGV54O4.js +0 -301
  201. package/dist/chunk-HPGV54O4.js.map +0 -1
  202. package/dist/chunk-MAN7AGQJ.js.map +0 -1
  203. package/dist/chunk-SZJCUC52.js.map +0 -1
  204. package/dist/chunk-TQIU4HQG.js.map +0 -1
  205. package/dist/chunk-Y662DNQQ.js.map +0 -1
  206. package/dist/library-publish-SNPER6PO.js.map +0 -1
  207. package/dist/source-manifest-publish-TLH6UWWU.js.map +0 -1
@@ -1,5 +1,6 @@
1
- import type { Approval, InputRequest, NodeError, NodeOutput, NodeStatus } from "@skaile/workspaces/types";
2
- export type { Approval, ArtifactRef, FlowExecution, FlowExecutionStatus, FormField, InputChoice, InputRequest, InputSchema, NodeError, NodeExecution, NodeExecutionSnapshot, NodeOutput, NodeStatus, } from "@skaile/workspaces/types";
1
+ import type { Approval, InputRequest, NodeError, NodeOutput, NodePreconditionFailure, NodeStatus } from "@skaile/workspaces/types";
2
+ import type { FlowDefinition as AuthoredFlowDefinition, FlowNodeContract, FlowNodeControl, FlowNodeRun } from "../contract/schema.js";
3
+ export type { Approval, ArtifactRef, FlowExecution, FlowExecutionStatus, FormField, InputChoice, InputRequest, InputSchema, NodeError, NodeExecution, NodeExecutionSnapshot, NodeOutput, NodePreconditionFailure, NodeStatus, } from "@skaile/workspaces/types";
3
4
  /**
4
5
  * Discriminates the three edge semantics used by the flow engine:
5
6
  * - `'flow'` — hard dependency: target cannot start until source is complete or skipped.
@@ -14,29 +15,33 @@ export type EdgeType = "flow" | "parallel" | "optional";
14
15
  /**
15
16
  * A single node in a flow definition.
16
17
  *
17
- * Four node kinds exist:
18
- * - `'skill'` — executed: the runner invokes `data.skill`; completion is reported via
19
- * the standard `complete_node` tool call. The only kind the engine tracks
20
- * in {@link NodeState} today (see below).
21
- * - `'sub-flow'` non-executable: no skill runs. Conceptually completes when the delegated
22
- * flow named by `data.flow` finishes driving that nested run is entirely
23
- * a host/orchestrator concern, not something this package implements.
18
+ * Runtime-compatible node shape for strict v2 and legacy definitions.
19
+ *
20
+ * Strict v2 nodes enter runtime state when `run.kind` is `'agent'`, `'function'`, `'gate'`,
21
+ * or `'sub-flow'`. Agents use the session conversation, functions use `NodeExecutor`, gates
22
+ * park around a human decision, and sub-flows delegate once to an inline child run. Exact
23
+ * legacy sub-flow nodes normalize to the strict active shape before runtime. Of the
24
+ * shapes that remain legacy, only `type: 'skill'` is executable; absent, unknown, group,
25
+ * and router kinds remain inert. The remaining authored v2 kinds are accepted but stay inert
26
+ * until their dedicated runtime implementations ship.
27
+ *
28
+ * Legacy node kinds:
29
+ * - `'skill'` — executed through the same agent-turn path as a strict v2 agent node.
30
+ * - `'sub-flow'` — executable after compatibility normalization to strict v2; the host drives
31
+ * the delegated child through the existing FlowAdapter lifecycle.
24
32
  * - `'router'` — non-executable: no skill runs. Conceptually completes when a route from
25
33
  * `data.routes` is chosen. `data.routes` is evaluated in order — the first
26
34
  * entry whose `condition` holds wins; `condition: "default"` is a
27
35
  * catch-all; `target: null` means "choose to skip".
28
36
  * - `'group'` — visual only: a canvas container used by the flow editor.
29
37
  *
30
- * Today the engine (`computeFlowState`, `computeFlowStateFromSnapshots`,
31
- * `computeSkippable`) tracks only `'skill'` nodes `'sub-flow'`, `'router'`, and `'group'`
32
- * are all excluded from {@link NodeState}, edge computation, and dependency blocking, the
33
- * same as pure visual containers. `'sub-flow'` and `'router'` are recognized node kinds so
34
- * consumers don't need to cast around the type, and their intended completion semantics are
35
- * documented here, but wiring them into the engine's dependency graph (so dependents
36
- * actually wait on them) is downstream/future work.
38
+ * The engine tracks strict v2 agent/function/gate/sub-flow nodes and explicit legacy skill nodes.
39
+ * Every other kind is excluded from {@link NodeState} and terminal-state computation. Hard
40
+ * `flow` edges sourced from inert nodes are nevertheless preserved as blockers, matching
41
+ * legacy behavior.
37
42
  *
38
- * Note: `node.id` is the canvas identifier; `node.data.skill` is the skill that runs.
39
- * They may differ when the same skill is aliased to multiple canvas positions.
43
+ * `node.id` remains the execution identity. Skills are reusable requirements and may be
44
+ * shared by several nodes without changing those node IDs.
40
45
  *
41
46
  * @docLink packages/flow-engine/concepts#flow-node
42
47
  */
@@ -44,11 +49,26 @@ export interface FlowNode {
44
49
  /** Canvas-unique node identifier. Used as the key in completed/running/skipped sets. */
45
50
  id: string;
46
51
  /**
47
- * Node kind see the type-level doc above for the full semantics of each kind. Only
48
- * `'skill'` is tracked by the engine today; `'sub-flow'`, `'router'`, and `'group'` are
49
- * all ignored by `computeFlowState` / `computeFlowStateFromSnapshots` / `computeSkippable`.
52
+ * Legacy-authored node kind. Exact sub-flows are promoted during parsing; retained runtime
53
+ * shapes track explicit `'skill'`, while every other legacy value is inert.
50
54
  */
51
- type: "skill" | "group" | "sub-flow" | "router";
55
+ type?: "skill" | "group" | "sub-flow" | "router" | (string & {});
56
+ /** Strict v2 display label. */
57
+ label?: string;
58
+ /** Strict v2 human-readable description. */
59
+ description?: string;
60
+ /** Strict v2 logical phase label. */
61
+ phase?: string;
62
+ /** Strict v2 execution-owner declaration. Agent, function, gate, and sub-flow are active. */
63
+ run?: FlowNodeRun;
64
+ /** Strict v2 input, precondition, and output declaration. */
65
+ contract?: FlowNodeContract;
66
+ /** Strict v2 approval policy. */
67
+ gate?: {
68
+ approval: "none" | "optional" | "mandatory";
69
+ };
70
+ /** Strict v2 availability and failure policy. */
71
+ control?: FlowNodeControl;
52
72
  /** ID of the parent group node when this node is nested inside a group container. */
53
73
  parentNode?: string;
54
74
  /** Visual position on the canvas — not used by the engine. */
@@ -58,7 +78,7 @@ export interface FlowNode {
58
78
  };
59
79
  /** Inline CSS style applied by the canvas renderer — not used by the engine. */
60
80
  style?: Record<string, any>;
61
- /** Execution metadata for skill nodes. Absent on pure group nodes. */
81
+ /** Legacy execution metadata. Strict v2 nodes use `run`, `contract`, `gate`, and `control`. */
62
82
  data?: {
63
83
  /** Skill identifier passed to the runner. Falls back to `node.id` when absent. */
64
84
  skill?: string;
@@ -80,7 +100,7 @@ export interface FlowNode {
80
100
  approval?: {
81
101
  mandatory?: boolean;
82
102
  };
83
- /** Static input parameters forwarded to the skill at runtime. */
103
+ /** Legacy static input parameters forwarded to the agent node at runtime. */
84
104
  parameters?: Record<string, any>;
85
105
  /** Logical phase label used for grouping in the UI — not used by the engine. */
86
106
  phase?: string;
@@ -134,8 +154,8 @@ export interface FlowEdge {
134
154
  source: string;
135
155
  /** ID of the target (downstream) node. */
136
156
  target: string;
137
- /** Dependency semantics see {@link EdgeType}. */
138
- type: EdgeType;
157
+ /** Dependency semantics. Unknown legacy values are preserved and remain inert. */
158
+ type: EdgeType | (string & {});
139
159
  }
140
160
  /**
141
161
  * UI and catalog metadata attached to a flow definition. Not used by the engine.
@@ -149,16 +169,20 @@ export interface FlowMeta {
149
169
  category?: string;
150
170
  /** Free-form tags for filtering and search. */
151
171
  tags?: string[];
172
+ /** Authoring lifecycle stage shown in catalogs. */
173
+ stage?: string;
152
174
  /** Onboarding hints for the first-run experience. */
153
175
  onboarding?: {
154
176
  /** Whether the initial prompt is free-form text or a structured form. */
155
- input_style?: "freeform" | "structured";
177
+ input_style?: "freeform" | "structured" | "repo";
156
178
  /** Placeholder text shown in the input field before the user types. */
157
179
  placeholder?: string;
180
+ /** Named authored fields for structured onboarding. */
181
+ fields?: string[];
158
182
  };
159
183
  }
160
184
  /**
161
- * Default runtime parameters applied to every skill execution in the flow.
185
+ * Legacy runtime parameters applied to every agent-node execution in the flow.
162
186
  *
163
187
  * @docLink packages/flow-engine/concepts#flow-globals
164
188
  */
@@ -233,6 +257,8 @@ export interface NextFlow {
233
257
  export interface FlowDefinition {
234
258
  /** JSON Schema URL — present in authored files, stripped at runtime if desired. */
235
259
  $schema?: string;
260
+ /** Present and equal to `2` on strict authored v2 definitions. */
261
+ schemaVersion?: 2;
236
262
  /** Unique flow identifier used as the key in catalogs and routing. */
237
263
  id: string;
238
264
  /** Semantic version string (e.g. `"1.0.0"`). */
@@ -245,6 +271,12 @@ export interface FlowDefinition {
245
271
  meta?: FlowMeta;
246
272
  /** Default runtime parameters inherited by every node in the flow. */
247
273
  globals?: FlowGlobals;
274
+ /** Strict v2 defaults; normalized v1 globals are represented here. */
275
+ defaults?: AuthoredFlowDefinition["defaults"];
276
+ /** Strict v2 flow input contract. */
277
+ input?: AuthoredFlowDefinition["input"];
278
+ /** Strict v2 flow output contract. */
279
+ output?: AuthoredFlowDefinition["output"];
248
280
  /** Optional feature modes (research enrichment, standards injection). */
249
281
  modes?: FlowModes;
250
282
  /** All nodes in the flow, including visual group containers. */
@@ -270,9 +302,9 @@ export interface FlowDefinition {
270
302
  export interface NodeState {
271
303
  /** Canvas node ID — matches `FlowNode.id`. */
272
304
  nodeId: string;
273
- /** Effective skill identifier (`FlowNode.data.skill ?? FlowNode.id`). */
305
+ /** Compatibility display field: first skill requirement when present, otherwise `nodeId`. */
274
306
  skillId: string;
275
- /** Human-readable label for display (`FlowNode.data.label ?? skillId`). */
307
+ /** Human-readable strict v2 or legacy label. */
276
308
  label: string;
277
309
  /**
278
310
  * Current execution status. Possible values:
@@ -286,12 +318,14 @@ export interface NodeState {
286
318
  * - `'failed'` — unrecoverable error; blocks dependents unless `optional`.
287
319
  */
288
320
  status: NodeStatus;
289
- /** Whether this node is optional (`FlowNode.data.optional`). Optional nodes do not block the flow when skipped or failed. */
321
+ /** Whether strict v2 `control.optional` or legacy `data.optional` marks this node optional. */
290
322
  optional: boolean;
291
323
  /** `true` when all incoming `flow`-type edges have complete or skipped sources. */
292
324
  canRun: boolean;
293
325
  /** IDs of upstream nodes whose incomplete state currently blocks this node. Empty when `canRun` is `true`. */
294
326
  blockers: string[];
327
+ /** Authored deterministic conditions currently preventing admission. */
328
+ failedPreconditions?: NodePreconditionFailure[];
295
329
  /** Current or most recent approval request on this node. */
296
330
  approval?: Approval;
297
331
  /** Full history of approval requests on this node, oldest first. */
@@ -300,7 +334,7 @@ export interface NodeState {
300
334
  input?: InputRequest;
301
335
  /** Full history of input requests on this node, oldest first. */
302
336
  inputHistory?: InputRequest[];
303
- /** Structured output produced by the node once the skill executes. */
337
+ /** Structured output produced by the node once its agent turn executes. */
304
338
  output?: NodeOutput;
305
339
  /** Current error (if the node is `failed`) or the last error before a retry. */
306
340
  error?: NodeError;
@@ -322,7 +356,7 @@ export interface NodeState {
322
356
  export interface FlowState {
323
357
  /** ID of the flow this state was computed from (`FlowDefinition.id`). */
324
358
  flowId: string;
325
- /** Per-node state for every skill node in the flow (group, sub-flow, and router nodes excluded). */
359
+ /** Per-node state for strict v2 agents/functions and explicit legacy skill nodes. */
326
360
  nodes: NodeState[];
327
361
  /** IDs of nodes whose status is `'available'` — ready to be dispatched by the runner. */
328
362
  available: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../factory-assets/connectors/flow/engine/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,UAAU,EACX,MAAM,0BAA0B,CAAC;AAKlC,YAAY,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,EACT,aAAa,EACb,qBAAqB,EACrB,UAAU,EACV,UAAU,GACX,MAAM,0BAA0B,CAAC;AAMlC;;;;;;;;;GASG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,WAAW,QAAQ;IACvB,wFAAwF;IACxF,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAC;IAChD,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,C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AE,CAAC;IAKnB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,qDAAqD;IACrD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,sEAAsE;IACtE,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,gFAAgF;IAChF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wDAAwD;IACxD,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,oGAAoG;IACpG,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,yFAAyF;IACzF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iDAAiD;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../factory-assets/connectors/flow/engine/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,UAAU,EACV,uBAAuB,EACvB,UAAU,EACX,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,cAAc,IAAI,sBAAsB,EACxC,gBAAgB,EAChB,eAAe,EACf,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAK/B,YAAY,EACV,QAAQ,EACR,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,YA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,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,+FAA+F;IAC/F,QAAQ,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,MAAM,EAAE,OAAO,CAAC;IAChB,8GAA8G;IAC9G,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAKhD,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,oEAAoE;IACpE,eAAe,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC7B,qDAAqD;IACrD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,YAAY,CAAC,EAAE,YAAY,EAAE,CAAC;IAC9B,2EAA2E;IAC3E,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,gFAAgF;IAChF,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,wDAAwD;IACxD,YAAY,CAAC,EAAE,SAAS,EAAE,CAAC;IAC3B,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,yFAAyF;IACzF,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,iDAAiD;IACjD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf"}
@@ -1,5 +1,7 @@
1
- export { FlowManifestSchema, computeFlowState, computeFlowStateFromSnapshots, computeSkippable, flowKindProvider, isBlocking, loadAllFlows, loadFlow, loadFlowsFromDir, resolveNextNodes, validateFlow } from '../../../chunk-HPGV54O4.js';
2
- import '../../../chunk-63ZPKREA.js';
1
+ export { FlowManifestSchema, buildFlowExpressionContext, computeFlowState, computeFlowStateFromSnapshots, computeSkippable, flowKindProvider, getConsumedOutputSchema, interpolateNodeInstruction, isBlocking, loadAllFlows, loadFlow, loadFlowsFromDir, resolveNextNodes, resolveNodeBindings, validateConsumedNodeOutput, validateFlow } from '../../../chunk-4O2RAXKJ.js';
2
+ import '../../../chunk-OEGHKO5N.js';
3
+ import '../../../chunk-4QROZZ5Z.js';
4
+ import '../../../chunk-P43HBWKK.js';
3
5
  import '../../../chunk-F3HNW354.js';
4
6
  import '../../../chunk-K5GBV4SA.js';
5
7
  import '../../../chunk-ZAP2BDHG.js';
@@ -1,3 +1,6 @@
1
1
  export type { FlowAdapterConnectOptions, FlowAdapterState, FlowAdapterStimulusBus, } from "./adapter.js";
2
2
  export { createConnector, FlowAdapter } from "./adapter.js";
3
+ export { type InlineSubFlowAgentTurn, SessionInlineSubFlowRunner, type SessionInlineSubFlowRunnerOptions, } from "./inline-sub-flow-host.js";
4
+ export { SessionNodeExecutor, type FunctionFlowNode, type NodeExecutor, type NodeExecutorRequest, type NodeExecutorResult, type SessionNodeExecutorOptions, } from "./node-executor.js";
5
+ export type { InlineSubFlowOperationTarget, InlineSubFlowProjection, InlineSubFlowRequest, InlineSubFlowResult, InlineSubFlowRunner, SubFlowFlowNode, } from "./sub-flow-runner.js";
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EACL,KAAK,sBAAsB,EAC3B,0BAA0B,EAC1B,KAAK,iCAAiC,GACvC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,4BAA4B,EAC5B,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { ConnectorHandle } from "@skaile/workspaces/connectors";
2
+ import type { FlowExecution } from "@skaile/workspaces/types";
3
+ import { FlowAdapter } from "./adapter.js";
4
+ import type { FlowDefinition } from "./engine/types.js";
5
+ import type { NodeExecutor } from "./node-executor.js";
6
+ import type { TurnStimulus } from "./prompt-fragments.js";
7
+ import type { InlineSubFlowRequest, InlineSubFlowResult, InlineSubFlowRunner } from "./sub-flow-runner.js";
8
+ /** Maximum number of flow identities allowed in one transient inline ancestry. */
9
+ export declare const INLINE_SUB_FLOW_MAX_DEPTH = 16;
10
+ /** One agent turn driven by the already-materialized parent session. */
11
+ export interface InlineSubFlowAgentTurn {
12
+ /** Child adapter whose agent nodes use the parent session's connector tools. */
13
+ adapter: FlowAdapter;
14
+ /** Connected child handle. */
15
+ handle: ConnectorHandle;
16
+ /** Child definition with its resolved parent-bound input applied. */
17
+ flow: FlowDefinition;
18
+ /** Live child snapshot used to build the normal orchestrator prompt. */
19
+ execution: FlowExecution;
20
+ /** Child-local stimulus that initiated this turn. */
21
+ stimulus: TurnStimulus;
22
+ }
23
+ /** Host dependencies for driving an inline child through the existing FlowAdapter lifecycle. */
24
+ export interface SessionInlineSubFlowRunnerOptions {
25
+ /** Resolves a flow identity through the host's normal installed/manual/asset lookup. */
26
+ resolveFlow(flowId: string): FlowDefinition | Promise<FlowDefinition>;
27
+ /** Runs one child agent turn with the parent session's existing driver. */
28
+ driveAgentTurn(turn: InlineSubFlowAgentTurn): Promise<void>;
29
+ /** Reuses the materialized session workspace for deterministic child nodes. */
30
+ nodeExecutor?: NodeExecutor;
31
+ }
32
+ /**
33
+ * Drives delegated flows once, inline, through child FlowAdapters in the current session.
34
+ *
35
+ * Child sessions are transient and keyed by their owning parent node. A parked/no-op child stays
36
+ * connected in memory for the next parent stimulus, but no child snapshot is published or stored.
37
+ */
38
+ export declare class SessionInlineSubFlowRunner implements InlineSubFlowRunner {
39
+ private readonly options;
40
+ private readonly sessions;
41
+ constructor(options: SessionInlineSubFlowRunnerOptions);
42
+ private sessionKey;
43
+ private dispose;
44
+ private cancel;
45
+ private createSession;
46
+ run(request: InlineSubFlowRequest): Promise<InlineSubFlowResult>;
47
+ }
48
+ //# sourceMappingURL=inline-sub-flow-host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-sub-flow-host.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/inline-sub-flow-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,KAAK,EAGV,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACrC,gFAAgF;IAChF,OAAO,EAAE,WAAW,CAAC;IACrB,8BAA8B;IAC9B,MAAM,EAAE,eAAe,CAAC;IACxB,qEAAqE;IACrE,IAAI,EAAE,cAAc,CAAC;IACrB,wEAAwE;IACxE,SAAS,EAAE,aAAa,CAAC;IACzB,qDAAqD;IACrD,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,gGAAgG;AAChG,MAAM,WAAW,iCAAiC;IAChD,wFAAwF;IACxF,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACtE,2EAA2E;IAC3E,cAAc,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,+EAA+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAmGD;;;;;GAKG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAGxD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAFpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;gBAErC,OAAO,EAAE,iCAAiC;IAEvE,OAAO,CAAC,UAAU;YAIJ,OAAO;YAQP,MAAM;YASN,aAAa;IAoGrB,GAAG,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAsEvE"}
@@ -0,0 +1,45 @@
1
+ import type { BindingOrigin } from "./contract/expression.js";
2
+ import type { FlowNode } from "./engine/types.js";
3
+ /** Strict v2 function node accepted by the deterministic runtime. */
4
+ export type FunctionFlowNode = FlowNode & {
5
+ run: Extract<NonNullable<FlowNode["run"]>, {
6
+ kind: "function";
7
+ }>;
8
+ };
9
+ /** Resolved execution request handed across the flow engine's only I/O seam. */
10
+ export interface NodeExecutorRequest {
11
+ /** Available strict v2 function node selected by the pure engine. */
12
+ node: FunctionFlowNode;
13
+ /** Binding values already resolved at the node boundary. */
14
+ inputs: Record<string, unknown>;
15
+ /** Provenance retained separately from the values serialized for execution. */
16
+ inputOrigins: Record<string, BindingOrigin[]>;
17
+ }
18
+ /** Captured result of one deterministic node process. */
19
+ export interface NodeExecutorResult {
20
+ /** Process exit status, matched against the node's declared successful statuses. */
21
+ exitStatus: number;
22
+ /** Complete UTF-8 standard output from the process. */
23
+ stdout: string;
24
+ /** Complete UTF-8 standard error from the process. */
25
+ stderr: string;
26
+ }
27
+ /** Runtime seam for node kinds that execute outside an agent turn. */
28
+ export interface NodeExecutor {
29
+ /** Executes one available deterministic node with already-resolved inputs. */
30
+ execute(request: NodeExecutorRequest): Promise<NodeExecutorResult>;
31
+ }
32
+ /** Session workspace required to keep deterministic execution inside the active run. */
33
+ export interface SessionNodeExecutorOptions {
34
+ /** Root of the already-materialized session workspace. */
35
+ workspaceDir: string;
36
+ }
37
+ /** Runs deterministic nodes inside the existing session workspace and environment. */
38
+ export declare class SessionNodeExecutor implements NodeExecutor {
39
+ private readonly workspaceDir;
40
+ /** Creates an executor scoped to one already-materialized session workspace. */
41
+ constructor(options: SessionNodeExecutorOptions);
42
+ /** Runs one function node process with session environment and binding overrides. */
43
+ execute(request: NodeExecutorRequest): Promise<NodeExecutorResult>;
44
+ }
45
+ //# sourceMappingURL=node-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-executor.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/node-executor.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG;IACxC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAC;CAClE,CAAC;AAEF,gFAAgF;AAChF,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,IAAI,EAAE,gBAAgB,CAAC;IACvB,4DAA4D;IAC5D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,+EAA+E;IAC/E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;CAC/C;AAED,yDAAyD;AACzD,MAAM,WAAW,kBAAkB;IACjC,oFAAoF;IACpF,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,sEAAsE;AACtE,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACpE;AAED,wFAAwF;AACxF,MAAM,WAAW,0BAA0B;IACzC,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACtB;AAmCD,sFAAsF;AACtF,qBAAa,mBAAoB,YAAW,YAAY;IACtD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IAEtC,gFAAgF;gBACpE,OAAO,EAAE,0BAA0B;IAI/C,qFAAqF;IAC/E,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA8BzE"}
@@ -73,12 +73,11 @@ export declare function renderStimulusPrompt(stimulus: TurnStimulus): string;
73
73
  *
74
74
  * Originally a byte-identical lift of the (since-deleted)
75
75
  * `FlowOrchestrator.buildOrchestratorPrompt`; the contract now is simply
76
- * this function's own output. Two additions beyond the lift: when
77
- * `flowDef.globals` is a non-empty object, a `## Flow globals` section is
78
- * rendered between "Current state" and "Why this turn is happening" so the
79
- * agent can see run-scoped parameters like `run_input` (flows without
80
- * globals render no such section), and the tool list unconditionally
81
- * documents `get_globals()` since the operation exists for every flow.
76
+ * this function's own output. When strict v2 defaults or legacy globals are
77
+ * non-empty, a `## Flow globals` section exposes those run-scoped values. The
78
+ * flow-wide active-node table stays bounded to selection metadata; `build_handoff`
79
+ * supplies a selected agent node's execution payload. First-class gates appear
80
+ * as runtime-owned state but never as agent-executable work.
82
81
  * Pure — depends only on its inputs.
83
82
  *
84
83
  * @docLink packages/factory-assets/flow#build-orchestrator-prompt
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-fragments.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/prompt-fragments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IACE,IAAI,EAAE,mBAAmB,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,UAAU,GAAG,UAAU,CAAC;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,GACD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACjF;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,2BAA2B,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;I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IAAI,EAAE,2BAA2B,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,GACrB;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAyBnE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,aAAa,EACpB,QAAQ,EAAE,YAAY,GACrB,MAAM,CAoLR;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAmB/D"}
@@ -1,4 +1,5 @@
1
- export { buildOrchestratorPrompt, describeStimulus, renderStimulusPrompt } from '../../../chunk-Y662DNQQ.js';
1
+ export { buildOrchestratorPrompt, describeStimulus, renderStimulusPrompt } from '../../../chunk-FKBQRV4J.js';
2
+ import '../../../chunk-4QROZZ5Z.js';
2
3
  import '../../../chunk-NSBPE2FW.js';
3
4
  //# sourceMappingURL=prompt-fragments.js.map
4
5
  //# sourceMappingURL=prompt-fragments.js.map
@@ -26,8 +26,8 @@ export type SessionState = import("@skaile/workspaces/runner").SessionState;
26
26
  /**
27
27
  * Options for {@link runFlow}.
28
28
  *
29
- * Wraps `FlowOrchestrator` with autonomous mode turned on by default so
30
- * interactive approval/input gates don't block a terminal run.
29
+ * Wraps `FlowOrchestrator` with autonomous mode turned on by default. First-class
30
+ * gate nodes remain mandatory human decisions in every mode.
31
31
  *
32
32
  * @docLink packages/factory-assets/flow#run-flow
33
33
  */
@@ -71,7 +71,7 @@ export interface RunOptions {
71
71
  sessionTimeoutMs?: number;
72
72
  /** Optional human-readable label shown in the session list. */
73
73
  sessionLabel?: string;
74
- /** Autonomous mode for CLI runs defaults to true so interactive approval gates are skipped. */
74
+ /** Autonomous mode for CLI runs. Defaults to true; first-class gate nodes are never bypassed. */
75
75
  autonomousMode?: boolean;
76
76
  /**
77
77
  * Called for each {@link AgentEvent} emitted during the run
@@ -129,12 +129,11 @@ export interface ResumeOptions {
129
129
  /**
130
130
  * Start a new flow session from the CLI.
131
131
  *
132
- * Wraps `FlowOrchestrator` with autonomous mode turned on by default so
133
- * interactive approval/input gates don't block a terminal run. The
134
- * runner remains idle between turns for the CLI use case, a single
135
- * turn should carry the flow to completion in autonomous mode. Non-CLI
136
- * hosts (Skaile platform, Pichi) use the orchestrator directly via the
137
- * serve command surface and drive gates through user actions.
132
+ * Wraps `FlowOrchestrator` with autonomous mode turned on by default. The
133
+ * runner remains idle between turns; first-class gates always park for a human
134
+ * decision, including in autonomous mode. Non-CLI hosts (Skaile platform,
135
+ * Pichi) use the orchestrator directly via the serve command surface and drive
136
+ * gates through user actions.
138
137
  *
139
138
  * @docLink packages/factory-assets/flow#run-flow
140
139
  */
@@ -156,4 +155,6 @@ export declare function runFlow(opts: RunOptions): Promise<void>;
156
155
  * @docLink packages/factory-assets/flow#resume-flow
157
156
  */
158
157
  export declare function resumeFlow(opts: ResumeOptions): Promise<void>;
158
+ /** Resolve one flow identity through the CLI/serve host's normal lookup order. */
159
+ export declare function resolveFlowPath(flowId: string, projectDir: string): string;
159
160
  //# sourceMappingURL=run-flow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-flow.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/run-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAsC5D,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,OAAO,2BAA2B,EAAE,YAAY,CAAC;AAK5E;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ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DnE"}
1
+ {"version":3,"file":"run-flow.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/run-flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AA2C5D,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,OAAO,2BAA2B,EAAE,YAAY,CAAC;AAmB5E;;;;;;;GAOG;AACH,MAAM,WAAW,UAAU;IACzB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iGAAiG;IACjG,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;CAC7B;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkW7D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAuDnE;AAkED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAuC1E"}
@@ -1,13 +1,15 @@
1
- export { resumeFlow, runFlow } from '../../../chunk-SZJCUC52.js';
1
+ export { resolveFlowPath, resumeFlow, runFlow } from '../../../chunk-6BV5NAPD.js';
2
2
  import '../../../chunk-4R6DROGN.js';
3
3
  import '../../../chunk-CZZRDYT4.js';
4
- import '../../../chunk-6QSGCHE5.js';
4
+ import '../../../chunk-EEHOMCRU.js';
5
5
  import '../../../chunk-ZNIHTT22.js';
6
6
  import '../../../chunk-6E6PKKAD.js';
7
7
  import '../../../chunk-IFGTRL2I.js';
8
- import '../../../chunk-HPGV54O4.js';
9
- import '../../../chunk-Y662DNQQ.js';
10
- import '../../../chunk-63ZPKREA.js';
8
+ import '../../../chunk-4O2RAXKJ.js';
9
+ import '../../../chunk-OEGHKO5N.js';
10
+ import '../../../chunk-FKBQRV4J.js';
11
+ import '../../../chunk-4QROZZ5Z.js';
12
+ import '../../../chunk-P43HBWKK.js';
11
13
  import '../../../chunk-F3HNW354.js';
12
14
  import '../../../chunk-K5GBV4SA.js';
13
15
  import '../../../chunk-ZAP2BDHG.js';
@@ -0,0 +1,73 @@
1
+ import type { BindingOrigin } from "./contract/expression.js";
2
+ import type { FlowDefinition, FlowNode } from "./engine/types.js";
3
+ import type { Approval, FlowExecution, InputRequest, NodeError, NodeOutput } from "@skaile/workspaces/types";
4
+ /** Strict v2 sub-flow node admitted by the pure engine. */
5
+ export type SubFlowFlowNode = FlowNode & {
6
+ run: Extract<NonNullable<FlowNode["run"]>, {
7
+ kind: "sub-flow";
8
+ }>;
9
+ };
10
+ /** Live child surface temporarily exposed through the parent's existing connector tools. */
11
+ export interface InlineSubFlowOperationTarget {
12
+ /** Parent sub-flow node that owns this transient child. */
13
+ parentNodeId: string;
14
+ /** Whether this child currently owns the session agent's operation surface. */
15
+ isAgentTurnActive(): boolean;
16
+ /** Executes one agent operation against the live child. */
17
+ executeAgentOp(operation: string, args: Record<string, unknown>): Promise<string>;
18
+ /** Applies a host approval addressed to the parent sub-flow node. */
19
+ applyParentApproval(args: Record<string, unknown>): Promise<InlineSubFlowProjection>;
20
+ /** Applies host input addressed to the parent sub-flow node. */
21
+ applyParentInput(args: Record<string, unknown>): Promise<InlineSubFlowProjection>;
22
+ /** Cancels, disconnects, and forgets this transient child. */
23
+ cancel(): Promise<void>;
24
+ /** Returns the child snapshot visible to scripted and production agent drivers. */
25
+ getExecution(): FlowExecution;
26
+ /** Returns child agent nodes whose approval policy remains mandatory. */
27
+ getMandatoryAgentApprovalNodeIds(): string[];
28
+ }
29
+ /** Host-owned request to drive one delegated flow through the existing session lifecycle. */
30
+ export interface InlineSubFlowRequest {
31
+ /** Available parent node whose delegated flow is starting. */
32
+ node: SubFlowFlowNode;
33
+ /** Delegated flow identifier from the node's run declaration. */
34
+ flowId: string;
35
+ /** Values resolved at the parent node boundary. */
36
+ inputs: Record<string, unknown>;
37
+ /** Provenance retained separately from the values passed to the child. */
38
+ inputOrigins: Record<string, BindingOrigin[]>;
39
+ /** Whether the authored legacy/shared-context intent should be applied to child input. */
40
+ passContext: boolean;
41
+ /** Parent definition, used only to derive child run input when context passing is enabled. */
42
+ parentFlow: FlowDefinition;
43
+ /** Live parent snapshot; the child never mutates or persists it directly. */
44
+ parentExecution: FlowExecution;
45
+ /** In-memory flow ancestry used for cycle and depth checks. */
46
+ ancestry: string[];
47
+ /** Registers this parent node's transient child operation target. */
48
+ routeOperationsTo(target: InlineSubFlowOperationTarget | undefined): void;
49
+ }
50
+ /** Existing parent-node interaction fields projected from a transient parked child. */
51
+ export interface InlineSubFlowProjection {
52
+ status: "running" | "awaiting_approval" | "awaiting_input";
53
+ approval?: Approval;
54
+ input?: InputRequest;
55
+ }
56
+ /** Terminal or deliberately parked result reported by the host-owned inline lifecycle. */
57
+ export type InlineSubFlowResult = {
58
+ status: "complete";
59
+ output?: NodeOutput;
60
+ } | {
61
+ status: "failed";
62
+ error: NodeError;
63
+ output?: NodeOutput;
64
+ } | {
65
+ status: "paused";
66
+ projection: InlineSubFlowProjection;
67
+ };
68
+ /** Host seam for resolving and driving an inline child inside the materialized session. */
69
+ export interface InlineSubFlowRunner {
70
+ /** Drives one child until it completes, fails, or parks for unavailable host input. */
71
+ run(request: InlineSubFlowRequest): Promise<InlineSubFlowResult>;
72
+ }
73
+ //# sourceMappingURL=sub-flow-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sub-flow-runner.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/sub-flow-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACX,MAAM,0BAA0B,CAAC;AAElC,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG;IACvC,GAAG,EAAE,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QAAE,IAAI,EAAE,UAAU,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AAiB,CAAC,MAAM,EAAE,4BAA4B,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3E;AAED,uFAAuF;AACvF,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,SAAS,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;IAC3D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAED,0FAA0F;AAC1F,MAAM,MAAM,mBAAmB,GAC3B;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,GAC3C;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,GAC3D;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,uBAAuB,CAAA;CAAE,CAAC;AAE9D,2FAA2F;AAC3F,MAAM,WAAW,mBAAmB;IAClC,uFAAuF;IACvF,GAAG,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAClE"}
@@ -1,10 +1,12 @@
1
- export { FlowAdapter, createConnector } from '../../chunk-6QSGCHE5.js';
1
+ export { FlowAdapter, SessionInlineSubFlowRunner, SessionNodeExecutor, createConnector } from '../../chunk-EEHOMCRU.js';
2
2
  import '../../chunk-ZNIHTT22.js';
3
3
  import '../../chunk-6E6PKKAD.js';
4
4
  import '../../chunk-IFGTRL2I.js';
5
- import '../../chunk-HPGV54O4.js';
6
- import '../../chunk-Y662DNQQ.js';
7
- import '../../chunk-63ZPKREA.js';
5
+ import '../../chunk-4O2RAXKJ.js';
6
+ import '../../chunk-OEGHKO5N.js';
7
+ import '../../chunk-FKBQRV4J.js';
8
+ import '../../chunk-4QROZZ5Z.js';
9
+ import '../../chunk-P43HBWKK.js';
8
10
  import '../../chunk-F3HNW354.js';
9
11
  import '../../chunk-K5GBV4SA.js';
10
12
  import '../../chunk-ZAP2BDHG.js';
@@ -1,10 +1,12 @@
1
- export { GitConnector, __test, createConnector5 as createConnector, readGitSyncStatus } from '../../chunk-6QSGCHE5.js';
1
+ export { GitConnector, __test, createConnector5 as createConnector, readGitSyncStatus } from '../../chunk-EEHOMCRU.js';
2
2
  import '../../chunk-ZNIHTT22.js';
3
3
  import '../../chunk-6E6PKKAD.js';
4
4
  import '../../chunk-IFGTRL2I.js';
5
- import '../../chunk-HPGV54O4.js';
6
- import '../../chunk-Y662DNQQ.js';
7
- import '../../chunk-63ZPKREA.js';
5
+ import '../../chunk-4O2RAXKJ.js';
6
+ import '../../chunk-OEGHKO5N.js';
7
+ import '../../chunk-FKBQRV4J.js';
8
+ import '../../chunk-4QROZZ5Z.js';
9
+ import '../../chunk-P43HBWKK.js';
8
10
  import '../../chunk-F3HNW354.js';
9
11
  import '../../chunk-K5GBV4SA.js';
10
12
  import '../../chunk-ZAP2BDHG.js';