@skaile/workspaces 2.3.0 → 2.5.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 (217) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +32 -13
  3. package/dist/app-sdk/index.js +1 -1
  4. package/dist/{asset-feeds-DKNYRLED.js → asset-feeds-4AWAT5PW.js} +6 -6
  5. package/dist/{asset-feeds-DKNYRLED.js.map → asset-feeds-4AWAT5PW.js.map} +1 -1
  6. package/dist/asset-manager/catalog-deployer.js +1 -1
  7. package/dist/asset-manager/index.js +5 -5
  8. package/dist/asset-manager/installer.js +2 -2
  9. package/dist/bridge/drivers/claude-sdk.js +108 -5
  10. package/dist/bridge/drivers/claude-sdk.js.map +1 -1
  11. package/dist/bridge/drivers/codex.js +1 -1
  12. package/dist/bridge/drivers/continue.js +2 -2
  13. package/dist/bridge/drivers/echo.js +1 -1
  14. package/dist/bridge/drivers/gemini.js +3 -3
  15. package/dist/bridge/drivers/goose.js +2 -2
  16. package/dist/bridge/drivers/omp.js +1 -1
  17. package/dist/bridge/drivers/opencode.js +2 -2
  18. package/dist/bridge/drivers/qwen.js +3 -3
  19. package/dist/bridge/index.js +2 -2
  20. package/dist/bridge/src/drivers/claude-sdk.d.ts +33 -0
  21. package/dist/bridge/src/drivers/claude-sdk.d.ts.map +1 -1
  22. package/dist/{chunk-CERGXDGG.js → chunk-2OCYS5EP.js} +3 -3
  23. package/dist/{chunk-CERGXDGG.js.map → chunk-2OCYS5EP.js.map} +1 -1
  24. package/dist/{chunk-W3Q37HEF.js → chunk-3HVASHBF.js} +3 -3
  25. package/dist/{chunk-W3Q37HEF.js.map → chunk-3HVASHBF.js.map} +1 -1
  26. package/dist/{chunk-UQ3RJKDD.js → chunk-4O2RAXKJ.js} +179 -52
  27. package/dist/chunk-4O2RAXKJ.js.map +1 -0
  28. package/dist/{chunk-DZM33LQO.js → chunk-4QROZZ5Z.js} +15 -3
  29. package/dist/chunk-4QROZZ5Z.js.map +1 -0
  30. package/dist/{chunk-G2ILW47R.js → chunk-57RFYEVM.js} +3 -3
  31. package/dist/{chunk-G2ILW47R.js.map → chunk-57RFYEVM.js.map} +1 -1
  32. package/dist/{chunk-BLWNI5KW.js → chunk-AKVAZ5CB.js} +2 -2
  33. package/dist/{chunk-BLWNI5KW.js.map → chunk-AKVAZ5CB.js.map} +1 -1
  34. package/dist/{chunk-BFIK6NPZ.js → chunk-AM5LFRXJ.js} +3 -3
  35. package/dist/{chunk-BFIK6NPZ.js.map → chunk-AM5LFRXJ.js.map} +1 -1
  36. package/dist/{chunk-RDE43ORT.js → chunk-D4VHBAJC.js} +4 -4
  37. package/dist/{chunk-RDE43ORT.js.map → chunk-D4VHBAJC.js.map} +1 -1
  38. package/dist/{chunk-PTS3QN5P.js → chunk-EEHOMCRU.js} +1021 -115
  39. package/dist/chunk-EEHOMCRU.js.map +1 -0
  40. package/dist/{chunk-CXX3UGJP.js → chunk-ENBTXMPL.js} +7 -7
  41. package/dist/{chunk-CXX3UGJP.js.map → chunk-ENBTXMPL.js.map} +1 -1
  42. package/dist/{chunk-LD6YGIKZ.js → chunk-EUWN4EK4.js} +60 -21
  43. package/dist/chunk-EUWN4EK4.js.map +1 -0
  44. package/dist/{chunk-FB4GPWYC.js → chunk-FKBQRV4J.js} +57 -16
  45. package/dist/chunk-FKBQRV4J.js.map +1 -0
  46. package/dist/{chunk-WG3L5VHF.js → chunk-HY3MBSNC.js} +2 -2
  47. package/dist/{chunk-WG3L5VHF.js.map → chunk-HY3MBSNC.js.map} +1 -1
  48. package/dist/{chunk-7IRH7MGV.js → chunk-IHX2SN35.js} +9 -9
  49. package/dist/{chunk-7IRH7MGV.js.map → chunk-IHX2SN35.js.map} +1 -1
  50. package/dist/{chunk-3F54MH2T.js → chunk-JAFEMG7W.js} +4 -4
  51. package/dist/{chunk-3F54MH2T.js.map → chunk-JAFEMG7W.js.map} +1 -1
  52. package/dist/{chunk-X6BPVUV2.js → chunk-L3TS7ZO4.js} +3 -3
  53. package/dist/{chunk-X6BPVUV2.js.map → chunk-L3TS7ZO4.js.map} +1 -1
  54. package/dist/{chunk-RIEXN7WA.js → chunk-MADO7PH5.js} +2 -2
  55. package/dist/{chunk-RIEXN7WA.js.map → chunk-MADO7PH5.js.map} +1 -1
  56. package/dist/{chunk-BCTU4TN7.js → chunk-MWFYXUFK.js} +3 -3
  57. package/dist/{chunk-BCTU4TN7.js.map → chunk-MWFYXUFK.js.map} +1 -1
  58. package/dist/{chunk-TK66CMXV.js → chunk-NU4E7C5I.js} +7 -3
  59. package/dist/chunk-NU4E7C5I.js.map +1 -0
  60. package/dist/{chunk-ZE2KEPE2.js → chunk-OEGHKO5N.js} +258 -24
  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-7UZGKVSK.js → chunk-PJ6INYDD.js} +3 -3
  65. package/dist/{chunk-7UZGKVSK.js.map → chunk-PJ6INYDD.js.map} +1 -1
  66. package/dist/{chunk-CA5CWLGN.js → chunk-PKEAYYEJ.js} +7 -4
  67. package/dist/chunk-PKEAYYEJ.js.map +1 -0
  68. package/dist/{chunk-ETFETLLB.js → chunk-UZYTSIX6.js} +6 -6
  69. package/dist/{chunk-ETFETLLB.js.map → chunk-UZYTSIX6.js.map} +1 -1
  70. package/dist/{chunk-SIF5F5SN.js → chunk-V4ZLZJFN.js} +3 -3
  71. package/dist/{chunk-SIF5F5SN.js.map → chunk-V4ZLZJFN.js.map} +1 -1
  72. package/dist/{chunk-ZR5Q4KZK.js → chunk-VNIKF66R.js} +3 -3
  73. package/dist/{chunk-ZR5Q4KZK.js.map → chunk-VNIKF66R.js.map} +1 -1
  74. package/dist/{chunk-CILACPUC.js → chunk-WSARNOPP.js} +5 -5
  75. package/dist/{chunk-CILACPUC.js.map → chunk-WSARNOPP.js.map} +1 -1
  76. package/dist/{chunk-TAJBFYCT.js → chunk-YWPEDILM.js} +83 -36
  77. package/dist/chunk-YWPEDILM.js.map +1 -0
  78. package/dist/{chunk-UNP4M5ZZ.js → chunk-ZR2X4SIG.js} +4 -4
  79. package/dist/{chunk-UNP4M5ZZ.js.map → chunk-ZR2X4SIG.js.map} +1 -1
  80. package/dist/cli/index.js +50 -50
  81. package/dist/connectors/config.js +1 -1
  82. package/dist/connectors/index.js +6 -6
  83. package/dist/core/index.js +1 -1
  84. package/dist/core/src/subprocess.d.ts +5 -1
  85. package/dist/core/src/subprocess.d.ts.map +1 -1
  86. package/dist/deploy/index.js +1 -1
  87. package/dist/discovery/index.js +1 -1
  88. package/dist/{ensure-sources-R6KW7K3M.js → ensure-sources-QF72HVUM.js} +8 -8
  89. package/dist/{ensure-sources-R6KW7K3M.js.map → ensure-sources-QF72HVUM.js.map} +1 -1
  90. package/dist/factory-assets/connectors/box.js +6 -6
  91. package/dist/factory-assets/connectors/deploy.js +6 -6
  92. package/dist/factory-assets/connectors/devserver.js +6 -6
  93. package/dist/factory-assets/connectors/flow/CONNECTOR.md +61 -14
  94. package/dist/factory-assets/connectors/flow/adapter.d.ts +78 -34
  95. package/dist/factory-assets/connectors/flow/adapter.d.ts.map +1 -1
  96. package/dist/factory-assets/connectors/flow/adapter.js +6 -6
  97. package/dist/factory-assets/connectors/flow/contract/expression.d.ts +55 -0
  98. package/dist/factory-assets/connectors/flow/contract/expression.d.ts.map +1 -1
  99. package/dist/factory-assets/connectors/flow/contract/flow.v2.schema.json +61 -134
  100. package/dist/factory-assets/connectors/flow/contract/index.d.ts +1 -1
  101. package/dist/factory-assets/connectors/flow/contract/index.d.ts.map +1 -1
  102. package/dist/factory-assets/connectors/flow/contract/normalize.d.ts.map +1 -1
  103. package/dist/factory-assets/connectors/flow/contract/schema.d.ts +14 -2
  104. package/dist/factory-assets/connectors/flow/contract/schema.d.ts.map +1 -1
  105. package/dist/factory-assets/connectors/flow/contract.js +2 -2
  106. package/dist/factory-assets/connectors/flow/engine/bindings.d.ts +9 -0
  107. package/dist/factory-assets/connectors/flow/engine/bindings.d.ts.map +1 -0
  108. package/dist/factory-assets/connectors/flow/engine/engine.d.ts +11 -6
  109. package/dist/factory-assets/connectors/flow/engine/engine.d.ts.map +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/node-shape.d.ts +22 -0
  114. package/dist/factory-assets/connectors/flow/engine/node-shape.d.ts.map +1 -1
  115. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts +18 -0
  116. package/dist/factory-assets/connectors/flow/engine/output-schema.d.ts.map +1 -0
  117. package/dist/factory-assets/connectors/flow/engine/types.d.ts +21 -15
  118. package/dist/factory-assets/connectors/flow/engine/types.d.ts.map +1 -1
  119. package/dist/factory-assets/connectors/flow/engine.js +4 -4
  120. package/dist/factory-assets/connectors/flow/index.d.ts +3 -0
  121. package/dist/factory-assets/connectors/flow/index.d.ts.map +1 -1
  122. package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts +48 -0
  123. package/dist/factory-assets/connectors/flow/inline-sub-flow-host.d.ts.map +1 -0
  124. package/dist/factory-assets/connectors/flow/node-executor.d.ts +45 -0
  125. package/dist/factory-assets/connectors/flow/node-executor.d.ts.map +1 -0
  126. package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts +3 -2
  127. package/dist/factory-assets/connectors/flow/prompt-fragments.d.ts.map +1 -1
  128. package/dist/factory-assets/connectors/flow/prompt-fragments.js +2 -2
  129. package/dist/factory-assets/connectors/flow/run-flow.d.ts +10 -9
  130. package/dist/factory-assets/connectors/flow/run-flow.d.ts.map +1 -1
  131. package/dist/factory-assets/connectors/flow/run-flow.js +7 -7
  132. package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts +73 -0
  133. package/dist/factory-assets/connectors/flow/sub-flow-runner.d.ts.map +1 -0
  134. package/dist/factory-assets/connectors/flow.js +6 -6
  135. package/dist/factory-assets/connectors/git.js +6 -6
  136. package/dist/factory-assets/connectors/gmail.js +6 -6
  137. package/dist/factory-assets/connectors/googledrive.js +6 -6
  138. package/dist/factory-assets/connectors/local.js +6 -6
  139. package/dist/factory-assets/connectors/mattermost.js +6 -6
  140. package/dist/factory-assets/connectors/memory.js +6 -6
  141. package/dist/factory-assets/connectors/minio.js +6 -6
  142. package/dist/factory-assets/connectors/postgres.js +6 -6
  143. package/dist/factory-assets/connectors/s3.js +6 -6
  144. package/dist/factory-assets/connectors/sharepoint.js +6 -6
  145. package/dist/factory-assets/connectors/sqlite.js +6 -6
  146. package/dist/factory-assets/connectors/static-server.js +6 -6
  147. package/dist/factory-assets/connectors/tunnel.js +6 -6
  148. package/dist/factory-assets/connectors/webdav.js +6 -6
  149. package/dist/factory-assets/connectors/xstate-store.js +6 -6
  150. package/dist/factory-assets/connectors/xstate.js +6 -6
  151. package/dist/{flows-F3CJNMK6.js → flows-YIW4HL3L.js} +4 -4
  152. package/dist/{flows-F3CJNMK6.js.map → flows-YIW4HL3L.js.map} +1 -1
  153. package/dist/{helpers-KPOLCGKX.js → helpers-LURCZHA4.js} +8 -8
  154. package/dist/{helpers-KPOLCGKX.js.map → helpers-LURCZHA4.js.map} +1 -1
  155. package/dist/library/index.js +3 -3
  156. package/dist/library/install.js +1 -1
  157. package/dist/{library-publish-ZAPZS64O.js → library-publish-2GMJM3NZ.js} +14 -14
  158. package/dist/{library-publish-ZAPZS64O.js.map → library-publish-2GMJM3NZ.js.map} +1 -1
  159. package/dist/{open-library-I4F2UNOY.js → open-library-POFOXZWH.js} +12 -12
  160. package/dist/{open-library-I4F2UNOY.js.map → open-library-POFOXZWH.js.map} +1 -1
  161. package/dist/{paths-KBACHM5B.js → paths-ZLX4ITAQ.js} +6 -6
  162. package/dist/{paths-KBACHM5B.js.map → paths-ZLX4ITAQ.js.map} +1 -1
  163. package/dist/{plugin-store-CYSNVZIX.js → plugin-store-YIMNH2FH.js} +3 -3
  164. package/dist/{plugin-store-CYSNVZIX.js.map → plugin-store-YIMNH2FH.js.map} +1 -1
  165. package/dist/{project-SIHZBTGB.js → project-GVOPZEJZ.js} +9 -9
  166. package/dist/{project-SIHZBTGB.js.map → project-GVOPZEJZ.js.map} +1 -1
  167. package/dist/resolver/index.js +1 -1
  168. package/dist/runner/index.js +15 -12
  169. package/dist/runner/src/serve.d.ts +3 -1
  170. package/dist/runner/src/serve.d.ts.map +1 -1
  171. package/dist/sdk/asset-manager.js +5 -5
  172. package/dist/sdk/bridge.js +2 -2
  173. package/dist/sdk/core.js +1 -1
  174. package/dist/sdk/flow.js +4 -4
  175. package/dist/sdk/index.js +15 -12
  176. package/dist/sdk/index.js.map +1 -1
  177. package/dist/sdk/resolver.js +1 -1
  178. package/dist/sdk/runner.js +15 -12
  179. package/dist/sdk/session.js +2 -2
  180. package/dist/sdk/types.js +1 -1
  181. package/dist/session/index.js +2 -2
  182. package/dist/session/src/dispatcher.d.ts.map +1 -1
  183. package/dist/{setup-KMBXMV25.js → setup-RHWARBBB.js} +5 -5
  184. package/dist/{setup-KMBXMV25.js.map → setup-RHWARBBB.js.map} +1 -1
  185. package/dist/{skills-LHS4TOKK.js → skills-HGVH6UTA.js} +5 -5
  186. package/dist/{skills-LHS4TOKK.js.map → skills-HGVH6UTA.js.map} +1 -1
  187. package/dist/{source-X226ZJPR.js → source-FB3T4IHP.js} +13 -13
  188. package/dist/{source-X226ZJPR.js.map → source-FB3T4IHP.js.map} +1 -1
  189. package/dist/{source-manifest-publish-N2QVUR5U.js → source-manifest-publish-XTRDVPSC.js} +15 -15
  190. package/dist/{source-manifest-publish-N2QVUR5U.js.map → source-manifest-publish-XTRDVPSC.js.map} +1 -1
  191. package/dist/tui/index.js +15 -12
  192. package/dist/tui/index.js.map +1 -1
  193. package/dist/types/index.js +1 -1
  194. package/dist/types/src/events.d.ts +20 -1
  195. package/dist/types/src/events.d.ts.map +1 -1
  196. package/dist/types/src/flow.d.ts +26 -0
  197. package/dist/types/src/flow.d.ts.map +1 -1
  198. package/dist/types/src/index.d.ts +1 -1
  199. package/dist/types/src/index.d.ts.map +1 -1
  200. package/dist/types/src/protocol.d.ts +1 -0
  201. package/dist/types/src/protocol.d.ts.map +1 -1
  202. package/dist/types/src/version.d.ts +12 -1
  203. package/dist/types/src/version.d.ts.map +1 -1
  204. package/dist/workspace-plugin/adapters/mcp.js +4 -4
  205. package/dist/workspace-plugin/adapters/omp.js +7 -7
  206. package/dist/workspace-plugin/index.js +1 -1
  207. package/package.json +1 -1
  208. package/dist/chunk-63ZPKREA.js.map +0 -1
  209. package/dist/chunk-CA5CWLGN.js.map +0 -1
  210. package/dist/chunk-DZM33LQO.js.map +0 -1
  211. package/dist/chunk-FB4GPWYC.js.map +0 -1
  212. package/dist/chunk-LD6YGIKZ.js.map +0 -1
  213. package/dist/chunk-PTS3QN5P.js.map +0 -1
  214. package/dist/chunk-TAJBFYCT.js.map +0 -1
  215. package/dist/chunk-TK66CMXV.js.map +0 -1
  216. package/dist/chunk-UQ3RJKDD.js.map +0 -1
  217. package/dist/chunk-ZE2KEPE2.js.map +0 -1
@@ -10,17 +10,20 @@ keywords:
10
10
  ---
11
11
 
12
12
  The flow connector holds the live `FlowExecution` snapshot for one run and
13
- bridges three driving parties:
13
+ bridges three ownership roles:
14
14
 
15
15
  - **Agent** — drives nodes by calling tools (`start_node`, `request_approval`,
16
16
  `request_input`, `complete_node`, `skip_node`, `fail_node`, plus the
17
17
  read-only `get_state`, `get_globals`, `get_available`, `validate_node`,
18
18
  `build_handoff`).
19
- - **Host (runner)** — applies out-of-turn mutations through direct adapter
19
+ - **Runtime** — drains available `function` nodes through `NodeExecutor`, parks
20
+ available `gate` nodes through durable approval state, and drives available
21
+ `sub-flow` nodes inline before an agent turn is considered.
22
+ - **Host** — the runner applies out-of-turn mutations through direct adapter
20
23
  methods (`applyApproval`, `applyInput`, `retryNode`, `setAutonomousMode`,
21
- `cancel`, `hydrate`) in response to user actions on the platform side.
22
- - **Orchestrator** — subscribes via `onStateChange` and forwards
23
- `state_changed` events / kicks new turns after host-driven mutations.
24
+ `cancel`, `hydrate`) in response to platform actions, forwards persistence
25
+ snapshots through `onStateChange`, and serializes permitted agent turns via
26
+ `SessionStimulusBus`.
24
27
 
25
28
  Every state mutation runs through a single `mutate()` pipeline that clones
26
29
  the current snapshot, applies the change, recomputes derived fields via
@@ -33,23 +36,67 @@ declared in `skaile.yaml` — it is constructed by the runner per session
33
36
  and bound to the active `FlowDefinition`.
34
37
 
35
38
  The adapter normalizes authored definitions at its connect/start boundary.
36
- Strict v2 `run.kind: agent` nodes are active; among legacy definitions, only
37
- explicit `type: skill` nodes normalize into that active shape. A selected
38
- available or running agent receives its instruction, supplied bindings, asset
39
- requirements, and completed predecessor context through `build_handoff`.
39
+ Strict v2 `run.kind: agent`, `run.kind: function`, `run.kind: gate`, and
40
+ `run.kind: sub-flow` nodes are active. Among legacy definitions, explicit
41
+ `type: skill` nodes normalize into the agent shape and exact `type: sub-flow`
42
+ nodes with `data.flow` normalize into the active inline-child shape. A selected
43
+ available or running agent receives its instruction, resolved
44
+ bindings with origins, asset requirements, and completed predecessor
45
+ context through `build_handoff`. Functions receive resolved raw values as
46
+ environment variables while provenance remains on the executor request. They
47
+ inherit the session environment and run from the session workspace.
48
+ Configured stdout/stderr captures map only to `fields.<name>` output keys and
49
+ remain attached to both completed and failed node executions.
50
+
51
+ A first-class gate never enters the agent mutation surface and never calls
52
+ `NodeExecutor`. Admission parks it at `awaiting_approval` with `run.prompt` as
53
+ the initial summary. Approval completes it directly and unblocks successors;
54
+ rejection keeps the decided record and feedback parked, stimulates one revision
55
+ conversation, and lets the agent replace it with a fresh `request_approval`.
56
+ Autonomous mode does not bypass a first-class gate. The authored `run.schema`
57
+ remains part of the strict contract; richer free-text response transport is
58
+ tracked separately in [platform #2097](https://github.com/skaile-ai/platform/issues/2097).
59
+
60
+ An inline sub-flow is runtime-owned coordination. The host resolves the child
61
+ definition and creates a transient child `FlowAdapter` in the materialized
62
+ session, reusing the session driver for agent nodes, the existing `NodeExecutor`
63
+ for functions, and the same host approval/input operations for gates. Each parent
64
+ sub-flow node keeps its own transient child across parked/no-op turns. Agent
65
+ operations route only during that child's active turn; parent-scoped and
66
+ unrelated parent operations stay parent-owned. Child gate/input interactions are
67
+ projected onto the parent node and settled by its parent node ID, so the child
68
+ snapshot is never published. Child completion completes the parent node;
69
+ required failure fails it and optional failure skips it. `passContext: true`
70
+ merges parent run input before explicit node bindings, while the separate origin
71
+ map preserves agent-produced provenance. Inline sub-flows run once and own no run
72
+ group, loop, alternate executor, or new durable-state field.
73
+ Canonical child identities resolve inside host lookup roots; in-memory ancestry
74
+ rejects cycles and nesting deeper than 16 flow identities. Live hydrate cancels
75
+ transient children first. Cold hydrate returns a running or projected-waiting
76
+ sub-flow to admission and restarts it from the durable parent boundary.
77
+
78
+ The pure engine evaluates `contract.requires` before admission and reports failed
79
+ conditions separately from hard-edge blockers. Output schemas are enforced only
80
+ when another node reads the producer through a precondition, binding, or router.
81
+ The first invalid agent completion persists and publishes one correction request;
82
+ the second fails. Function output fails directly, with captured diagnostics kept.
83
+ Valid JSON-object fields are cloned before storage. Structural field errors enter
84
+ the correction lifecycle only for consumed producers; malformed fields on an
85
+ unconsumed prose node are omitted. `connect` and `hydrate` clone incoming snapshots
86
+ and atomically reject invalid complete output for a consumed producer.
40
87
 
41
88
  ## Operations
42
89
 
43
90
  | Operation | Access | Description |
44
91
  |-----------|--------|-------------|
45
- | `get_available` | read | Node IDs ready to run |
92
+ | `get_available` | read | Agent node IDs ready for an agent turn |
46
93
  | `get_state` | read | Full flow execution snapshot |
47
94
  | `get_globals` | read | Run-scoped flow globals (`run_input` etc.) |
48
- | `validate_node` | read | Is this node currently runnable |
49
- | `build_handoff` | read | Selected agent instruction, bindings, assets, and upstream context |
95
+ | `validate_node` | read | Is this node currently runnable, including failed preconditions |
96
+ | `build_handoff` | read | Selected agent instruction, resolved bindings/origins, correction issues, assets, and upstream context |
50
97
  | `start_node` | write | Mark a node `running` |
51
- | `request_approval` | write | Pause for human sign-off |
98
+ | `request_approval` | write | Pause a running agent node, or re-request a rejected first-class gate, for human sign-off |
52
99
  | `request_input` | write | Pause for typed input |
53
- | `complete_node` | write | Finalise a node with output |
100
+ | `complete_node` | write | Finalise a node with optional JSON fields; consumed schemas get one agent correction |
54
101
  | `skip_node` | write | Skip an optional node |
55
102
  | `fail_node` | write | Mark a node failed (recoverable or not) |
@@ -2,29 +2,35 @@
2
2
  * FlowAdapter — live flow execution state exposed as a connector resource.
3
3
  *
4
4
  * Holds the canonical `FlowExecution` snapshot for a single run and bridges
5
- * three driving parties:
5
+ * three ownership roles:
6
6
  *
7
7
  * - The **agent** drives nodes to completion by calling tools (`start_node`,
8
8
  * `request_approval`, `request_input`, `complete_node`, `skip_node`,
9
9
  * `fail_node`, plus read-only `get_state` / `get_available` / `get_globals` /
10
10
  * `build_handoff`).
11
- * - The **host** (runner serve.ts platform) applies out-of-turn
11
+ * - The **runtime** drains functions through `NodeExecutor` and parks first-class
12
+ * gates without executing a node or starting a model.
13
+ * - The **host** runner applies out-of-turn
12
14
  * mutations (`applyApproval`, `applyInput`, `retryNode`,
13
- * `setAutonomousMode`, `cancel`, `hydrate`) in response to user actions.
14
- * - The **runner's FlowOrchestrator** subscribes to `onChange` to forward
15
- * `state_changed` events and kick new turns after host-driven mutations.
15
+ * `setAutonomousMode`, `cancel`, `hydrate`) in response to platform actions,
16
+ * subscribes to `onChange` for persistence, and uses the session stimulus bus
17
+ * to serialize permitted model turns.
16
18
  *
17
19
  * Every state mutation runs through a single `mutate()` helper that clones
18
20
  * the current snapshot, applies the change, recomputes derived fields via
19
21
  * `computeFlowStateFromSnapshots`, and fires the onChange callback with
20
22
  * the full FlowExecution shape. Consumers downstream (platform gateway,
21
- * frontend hook) see latest-wins snapshots — F4 in the decision log.
23
+ * frontend hook) see latest-wins snapshots.
22
24
  *
23
25
  * See `docs/flow-execution.md` for the universal model.
24
26
  */
25
27
  import { AbstractConnector, type ConnectContext, type ConnectorDeclaration, type ConnectorHandle, type ToolFace } from "@skaile/workspaces/connectors";
26
28
  import type { FlowExecution } from "@skaile/workspaces/types";
29
+ import type { BindingOrigin } from "./contract/expression.js";
27
30
  import { type FlowDefinition, isBlocking } from "./engine/index.js";
31
+ import type { NodeExecutor } from "./node-executor.js";
32
+ import type { InlineSubFlowOperationTarget, InlineSubFlowRunner } from "./sub-flow-runner.js";
33
+ import { type TurnStimulus } from "./prompt-fragments.js";
28
34
  /**
29
35
  * Minimal structural shape of the runner's `SessionStimulusBus`. Declared
30
36
  * locally so the adapter doesn't pull in a runtime dep on
@@ -50,14 +56,13 @@ export interface FlowAdapterState {
50
56
  flowDef: FlowDefinition;
51
57
  /** Current execution snapshot (authoritative; mutated in place by `mutate()`). */
52
58
  execution: FlowExecution;
53
- /** Callback fired after every state mutation. Set by `FlowOrchestrator` via `onStateChange()`. */
59
+ /** Callback fired after every state mutation for host persistence and event forwarding. */
54
60
  onChange?: (state: FlowExecution) => void;
55
61
  /**
56
62
  * Optional `SessionStimulusBus` reference. When provided AND
57
63
  * `useBusForStimulus` is true, the adapter computes a `TurnStimulus`
58
64
  * after every mutation and fires `bus.signal()` to wake the agent.
59
- * Phase 3 wiring (2026-05-08): the flag defaults to false everywhere so
60
- * the legacy orchestrator path remains the only turn driver until Phase 4.
65
+ * The runner enables this for the serialized session-stimulus turn driver.
61
66
  */
62
67
  stimulusBus?: FlowAdapterStimulusBus;
63
68
  /**
@@ -66,7 +71,7 @@ export interface FlowAdapterState {
66
71
  * `flow` in CLI mode).
67
72
  */
68
73
  connectorId?: string;
69
- /** Phase 3 feature flag — see {@link FlowAdapterConnectOptions.useBusForStimulus}. */
74
+ /** See {@link FlowAdapterConnectOptions.useBusForStimulus}. */
70
75
  useBusForStimulus?: boolean;
71
76
  /**
72
77
  * Last execution snapshot the adapter signaled to the bus. Used to compute
@@ -74,6 +79,18 @@ export interface FlowAdapterState {
74
79
  * leave the snapshot unchanged don't fire spurious turn kicks.
75
80
  */
76
81
  lastSignaledExecution?: FlowExecution;
82
+ /** Deterministic runtime backed by the already-materialized session workspace. */
83
+ nodeExecutor?: NodeExecutor;
84
+ /** Host-owned inline child lifecycle, backed by the existing materialized session. */
85
+ inlineSubFlowRunner?: InlineSubFlowRunner;
86
+ /** Transient child operation routes keyed by their owning parent sub-flow node. */
87
+ inlineOperationTargets: Map<string, InlineSubFlowOperationTarget>;
88
+ /** Non-durable provenance overrides for values received from a parent sub-flow binding. */
89
+ flowInputOrigins?: Record<string, BindingOrigin[]>;
90
+ /** Non-durable ancestry used to reject recursive inline delegation. */
91
+ inlineSubFlowAncestry: string[];
92
+ /** Non-durable ownership epoch for results returned by in-flight inline children. */
93
+ executionGeneration: number;
77
94
  }
78
95
  /**
79
96
  * Options the runner passes via `declaration.options` when connecting the `FlowAdapter`.
@@ -98,25 +115,32 @@ export interface FlowAdapterConnectOptions {
98
115
  * Optional `SessionStimulusBus` to which this adapter should fire
99
116
  * `signal()` calls on every mutation when `useBusForStimulus` is true.
100
117
  * Threaded through by the runner's session-construction code (`runFlow`
101
- * / `serve.ts`). Phase 3 of the flow-connector extraction (2026-05-08)
102
- * builds the path; Phase 4 flips the flag globally.
118
+ * / `serve.ts`).
103
119
  */
104
120
  stimulusBus?: FlowAdapterStimulusBus;
105
121
  /**
106
- * Phase 3 feature flag. When `true` AND `stimulusBus` is provided, the
122
+ * When `true` AND `stimulusBus` is provided, the
107
123
  * adapter computes a turn-kicking stimulus after every mutation and
108
124
  * calls `bus.signal()` (fire-and-forget). When `false` (the default),
109
- * only the legacy `onChange` callback fires the runner's existing
110
- * `FlowOrchestrator.onStateChange` subscription remains the only turn
111
- * driver. Default: `false`.
125
+ * only the `onChange` callback fires. Default: `false`.
112
126
  */
113
127
  useBusForStimulus?: boolean;
128
+ /** Runtime for function nodes. Required before deterministic nodes are drained. */
129
+ nodeExecutor?: NodeExecutor;
130
+ /** Host lifecycle used to resolve and drive inline child flows in the current session. */
131
+ inlineSubFlowRunner?: InlineSubFlowRunner;
132
+ /** @internal Provenance for child flow inputs, retained only in the live adapter. */
133
+ flowInputOrigins?: Record<string, BindingOrigin[]>;
134
+ /** @internal Flow identities from the root through this transient child. */
135
+ inlineSubFlowAncestry?: string[];
114
136
  }
115
137
  /**
116
- * Connector adapter that holds and drives a live `FlowExecution`. Bridges three parties:
117
- * the agent (via `executeOp` tools), the host runner (via direct methods like `applyApproval`),
118
- * and the orchestrator (via `onStateChange`). Every mutation runs through a single `mutate()`
119
- * pipeline that recomputes derived fields and fires `onChange`.
138
+ * Connector adapter that holds and drives a live `FlowExecution`.
139
+ *
140
+ * The agent owns agent-node tools, the runtime drains function nodes and parks first-class
141
+ * gates, the host applies durable human decisions, and the runner subscribes to state changes
142
+ * to decide whether a model turn is needed. Every mutation runs through one recomputation
143
+ * pipeline and publishes the resulting snapshot.
120
144
  * @docLink packages/connectors/concepts#flow-adapter
121
145
  */
122
146
  export declare class FlowAdapter extends AbstractConnector {
@@ -126,12 +150,14 @@ export declare class FlowAdapter extends AbstractConnector {
126
150
  constructor();
127
151
  connect(declaration: ConnectorDeclaration, _ctx: ConnectContext): Promise<ConnectorHandle>;
128
152
  disconnect(handle: ConnectorHandle): Promise<void>;
153
+ private cancelInlineTargets;
154
+ private projectInlineInteraction;
129
155
  onStateChange(handle: ConnectorHandle, cb: (state: FlowExecution) => void): void;
130
156
  /**
131
157
  * Replace the current execution snapshot with a host-provided one.
132
158
  * Used on container rehydration via the extended `configure` command.
133
- * Does NOT fire `onChange` the host already has the state; we don't
134
- * want to loop it back on startup.
159
+ * Publishes only when compatibility preparation changes the supplied snapshot,
160
+ * such as seeding a node kind activated after the snapshot was persisted.
135
161
  */
136
162
  hydrate(handle: ConnectorHandle, execution: FlowExecution): void;
137
163
  private read;
@@ -161,9 +187,8 @@ export declare class FlowAdapter extends AbstractConnector {
161
187
  private doFailNode;
162
188
  /**
163
189
  * Record an approval decision on a node currently `awaiting_approval`.
164
- * `approved` leaves the node in `awaiting_approval` the agent
165
- * transitions it to `complete` on the next turn. `rejected` drops the
166
- * node back to `available` so the agent can retry.
190
+ * A first-class gate completes directly when approved and remains parked when rejected.
191
+ * Agent-node approvals keep their existing resume behavior.
167
192
  */
168
193
  applyApproval(handle: ConnectorHandle, nodeId: string, decision: "approved" | "rejected", feedback: string | undefined, decidedBy: string): void;
169
194
  /**
@@ -183,20 +208,39 @@ export declare class FlowAdapter extends AbstractConnector {
183
208
  cancel(handle: ConnectorHandle): void;
184
209
  /** Read-only access to the current FlowExecution snapshot. */
185
210
  getExecution(handle: ConnectorHandle): FlowExecution;
186
- /** Node IDs marked as mandatory approval gates in strict v2 or legacy definitions. */
211
+ /** @internal Whether a nested inline descendant owns the current agent turn. */
212
+ hasActiveInlineAgentTurn(handle: ConnectorHandle): boolean;
213
+ /** Snapshot currently visible through agent-facing tools, including a live inline child. */
214
+ getAgentExecution(handle: ConnectorHandle): FlowExecution;
215
+ /** Agent node IDs whose approval policy remains mandatory in autonomous mode. */
216
+ getMandatoryAgentApprovalNodeIds(handle: ConnectorHandle): string[];
217
+ /** @deprecated Use {@link getMandatoryAgentApprovalNodeIds}. */
187
218
  getMandatoryGates(handle: ConnectorHandle): string[];
219
+ /**
220
+ * Decide whether the current state and stimulus require the session agent's conversation.
221
+ * Runtime-owned gates stay dark while pending; a rejected gate is the exception because the
222
+ * rejection starts the revision conversation promised by the gate lifecycle.
223
+ */
224
+ shouldDriveAgentTurn(handle: ConnectorHandle, stimulus: TurnStimulus): boolean;
225
+ /**
226
+ * Drain runtime-owned nodes in definition order until only agent work or a human decision
227
+ * remains. Function nodes use NodeExecutor, gates park, and sub-flows delegate to the host.
228
+ */
229
+ drainRuntimeNodes(handle: ConnectorHandle): Promise<FlowExecution>;
230
+ /**
231
+ * Run every currently available function node through the configured
232
+ * NodeExecutor. Newly-unblocked function nodes are drained in definition
233
+ * order before returning control to the runner's agent-turn decision.
234
+ */
235
+ executeAvailableFunctionNodes(handle: ConnectorHandle): Promise<FlowExecution>;
236
+ private drainAvailableRuntimeNodes;
188
237
  private s;
189
238
  /**
190
239
  * Central mutation pipeline: runs the mutator, recomputes derived
191
240
  * fields, updates the flow-level `status` if the mutation completed
192
- * or failed the flow, fires `onChange` once, and (Phase 3, 2026-05-08)
193
- * optionally signals the {@link FlowAdapterStimulusBus} so the runner
194
- * can kick a turn outside the legacy orchestrator path.
195
- *
196
- * The bus signal path is gated by the `useBusForStimulus` flag set at
197
- * connect time — Phase 3 builds the path; Phase 4 flips the default to
198
- * true globally and removes the orchestrator's onStateChange
199
- * subscription.
241
+ * or failed the flow, fires `onChange` once, and optionally signals the
242
+ * {@link FlowAdapterStimulusBus}. The signal path is gated by the
243
+ * `useBusForStimulus` flag set at connect time.
200
244
  */
201
245
  private mutate;
202
246
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../factory-assets/connectors/flow/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACL,iBAAiB,EACjB,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EAKpB,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAGV,aAAa,EASd,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,KAAK,cAAc,EAEnB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAgB3B;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,MAAM,CACJ,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAC9D,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB;AAID;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2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gEAAgE;IAChE,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,EAAE;IAIpD;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,GAAG,OAAO;IA8B9E;;;OAGG;IACG,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;IAIxE;;;;OAIG;IACG,6BAA6B,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;YAItE,0BAA0B;IAuPxC,OAAO,CAAC,CAAC;IAIT;;;;;;OAMG;IACH,OAAO,CAAC,MAAM;IA2Cd;;;;OAIG;IACH,OAAO,CAAC,SAAS;IAiDjB;;OAEG;IACH,OAAO,CAAC,YAAY;CAoErB;AA6GD,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,WAAW,CAE7C"}
@@ -1,12 +1,12 @@
1
- export { FlowAdapter, createConnector } from '../../../chunk-PTS3QN5P.js';
1
+ export { FlowAdapter, createConnector } from '../../../chunk-EEHOMCRU.js';
2
2
  import '../../../chunk-ZNIHTT22.js';
3
3
  import '../../../chunk-6E6PKKAD.js';
4
4
  import '../../../chunk-IFGTRL2I.js';
5
- export { isBlocking } from '../../../chunk-UQ3RJKDD.js';
6
- import '../../../chunk-ZE2KEPE2.js';
7
- import '../../../chunk-FB4GPWYC.js';
8
- import '../../../chunk-DZM33LQO.js';
9
- import '../../../chunk-63ZPKREA.js';
5
+ export { isBlocking } from '../../../chunk-4O2RAXKJ.js';
6
+ import '../../../chunk-OEGHKO5N.js';
7
+ import '../../../chunk-FKBQRV4J.js';
8
+ import '../../../chunk-4QROZZ5Z.js';
9
+ import '../../../chunk-P43HBWKK.js';
10
10
  import '../../../chunk-F3HNW354.js';
11
11
  import '../../../chunk-K5GBV4SA.js';
12
12
  import '../../../chunk-ZAP2BDHG.js';
@@ -22,6 +22,50 @@ export interface FlowExpressionContext {
22
22
  };
23
23
  }>;
24
24
  }
25
+ /** Runtime or agent provenance retained for one value used by a node binding. */
26
+ export type BindingOrigin = {
27
+ source: "literal";
28
+ path: string;
29
+ obtainedBy: "runtime";
30
+ } | {
31
+ source: "flow-input";
32
+ path: string;
33
+ obtainedBy: "runtime";
34
+ } | {
35
+ source: "default";
36
+ path: string;
37
+ obtainedBy: "runtime";
38
+ } | {
39
+ source: "node-status";
40
+ nodeId: string;
41
+ path: string;
42
+ obtainedBy: "runtime";
43
+ } | {
44
+ source: "node-output";
45
+ nodeId: string;
46
+ path: string;
47
+ obtainedBy: "agent" | "runtime";
48
+ };
49
+ /** A resolved JSON value together with every source that contributed to it. */
50
+ export interface ResolvedBinding {
51
+ /** Runtime value passed to the node executor. */
52
+ value: unknown;
53
+ /** Stable, de-duplicated provenance in authored traversal order. */
54
+ origins: BindingOrigin[];
55
+ }
56
+ /** All named node inputs, keeping executor values separate from provenance. */
57
+ export interface ResolvedNodeBindings {
58
+ /** Resolved values keyed by authored binding name. */
59
+ values: Record<string, unknown>;
60
+ /** Provenance keyed by authored binding name. */
61
+ origins: Record<string, BindingOrigin[]>;
62
+ }
63
+ /** How each producer node obtained its output fields. */
64
+ export type NodeOutputOrigin = Record<string, "agent" | "runtime">;
65
+ /** @internal Binding names excluded from both authored and direct typed inputs. */
66
+ export declare const FLOW_BINDING_NAME_PATTERN: RegExp;
67
+ /** @internal Collect bounded expressions embedded in a JSON binding value. */
68
+ export declare function collectFlowBindingExpressions(value: unknown): string[];
25
69
  /** Deterministic syntax, budget, or path failure raised by the Flow evaluator. */
26
70
  export declare class FlowExpressionError extends Error {
27
71
  /** Stable error name for callers that classify evaluator failures. */
@@ -43,4 +87,15 @@ export declare function inspectFlowExpression(expression: string, requireBoolean
43
87
  export declare function evaluateFlowExpression(expression: string, context: FlowExpressionContext): boolean;
44
88
  /** Proposal-compatible short name for {@link evaluateFlowExpression}. */
45
89
  export declare function evaluate(expression: string, context: FlowExpressionContext): boolean;
90
+ /** @internal Serialize a JSON-compatible value with deterministic object-key ordering. */
91
+ export declare function stableFlowJson(value: unknown): string;
92
+ /**
93
+ * Resolves authored node inputs through the bounded Flow expression grammar.
94
+ *
95
+ * Exact `${...}` placeholders retain their JSON type. Placeholders embedded in
96
+ * text use deterministic interpolation, while arrays and objects are traversed
97
+ * recursively. Runtime values and provenance remain separate so executors do not
98
+ * need to understand trust metadata.
99
+ */
100
+ export declare function resolveFlowBindings(bindings: Record<string, unknown> | undefined, context: FlowExpressionContext, nodeOutputOrigin?: NodeOutputOrigin, flowInputOrigins?: Record<string, BindingOrigin[]>): ResolvedNodeBindings;
46
101
  //# sourceMappingURL=expression.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../../../factory-assets/connectors/flow/contract/expression.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,sBAAsB;;;;;;EAMjC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;CAC3E;AAED,kFAAkF;AAClF,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,sEAAsE;IACtE,SAAkB,IAAI,yBAAyB;CAChD;AAwXD,+FAA+F;AAC/F,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,2GAA2G;AAC3G,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,EAClB,cAAc,UAAO,GACpB,uBAAuB,EAAE,CAkB3B;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAQT;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAEpF"}
1
+ {"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../../../factory-assets/connectors/flow/contract/expression.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,eAAO,MAAM,sBAAsB;;;;;;EAMjC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,wDAAwD;IACxD,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,CAAA;KAAE,CAAC;IACzB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;CAC3E;AAED,iFAAiF;AACjF,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,CAAA;CAAE,GAC1D;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,SAAS,CAAA;CAAE,GAC1D;IACE,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,E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