@w6w/embed 0.2.1 → 0.2.19

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 (185) hide show
  1. package/README.md +22 -5
  2. package/dist/ConfirmModal-Pv2-A_3U.js +186 -0
  3. package/dist/ConfirmModal-Pv2-A_3U.js.map +1 -0
  4. package/dist/{CreateFunctionModal-DRsFx-FB.js → CreateFunctionModal-DScxp_LN.js} +25 -25
  5. package/dist/{CreateFunctionModal-DRsFx-FB.js.map → CreateFunctionModal-DScxp_LN.js.map} +1 -1
  6. package/dist/{DocumentFormModal-BExK1V-B.js → DocumentFormModal-Br4s8wmi.js} +5 -5
  7. package/dist/{DocumentFormModal-BExK1V-B.js.map → DocumentFormModal-Br4s8wmi.js.map} +1 -1
  8. package/dist/ImportSpecModal-Cpzp8ndt.js +251 -0
  9. package/dist/ImportSpecModal-Cpzp8ndt.js.map +1 -0
  10. package/dist/ModelRoutesManager-1Ac5wcas.js +345 -0
  11. package/dist/ModelRoutesManager-1Ac5wcas.js.map +1 -0
  12. package/dist/WorkflowEditor-CmhXHRxi.js +1109 -0
  13. package/dist/WorkflowEditor-CmhXHRxi.js.map +1 -0
  14. package/dist/apps-ItBvnWX3.js +92 -0
  15. package/dist/apps-ItBvnWX3.js.map +1 -0
  16. package/dist/{callables-3mFrMVG_.js → callables-tOlflvbl.js} +11 -11
  17. package/dist/{callables-3mFrMVG_.js.map → callables-tOlflvbl.js.map} +1 -1
  18. package/dist/chrome/ConfirmModal.d.ts +4 -1
  19. package/dist/chrome/DangerZone.d.ts +4 -3
  20. package/dist/chrome/ExecutionProfileHeader.d.ts +3 -3
  21. package/dist/chrome/JsonToggle.d.ts +29 -20
  22. package/dist/chrome/Modal.d.ts +3 -1
  23. package/dist/chrome/RightRail.d.ts +6 -1
  24. package/dist/chrome/VersionHistoryModal.d.ts +2 -0
  25. package/dist/chrome/index.d.ts +1 -0
  26. package/dist/chrome/workspace.d.ts +36 -1
  27. package/dist/coerce-input-DFJ4n_wc.js +150 -0
  28. package/dist/coerce-input-DFJ4n_wc.js.map +1 -0
  29. package/dist/connections-CzsCyIxY.js +119 -0
  30. package/dist/connections-CzsCyIxY.js.map +1 -0
  31. package/dist/credentials-Cn92LGhJ.js +171 -0
  32. package/dist/credentials-Cn92LGhJ.js.map +1 -0
  33. package/dist/data-stores-UeQvwVCa.js +170 -0
  34. package/dist/data-stores-UeQvwVCa.js.map +1 -0
  35. package/dist/document-sources-DNmBojx6.js +169 -0
  36. package/dist/document-sources-DNmBojx6.js.map +1 -0
  37. package/dist/draft/use-workflow-draft.d.ts +2 -0
  38. package/dist/draft.mjs +2 -2
  39. package/dist/editor/BindingBanner.d.ts +13 -0
  40. package/dist/editor/CallableEditorFrame.d.ts +7 -0
  41. package/dist/editor/EndpointCards.d.ts +4 -1
  42. package/dist/editor/PublishControl.d.ts +19 -0
  43. package/dist/editor/PublishTooltip.d.ts +7 -0
  44. package/dist/editor/SetupIncompleteBanner.d.ts +12 -0
  45. package/dist/editor/StartingStateModal.d.ts +14 -0
  46. package/dist/editor/TargetSelector.d.ts +15 -0
  47. package/dist/editor/TargetSelector.types.d.ts +2 -0
  48. package/dist/editor/WorkflowSettingsModal.d.ts +6 -1
  49. package/dist/editor/WorkflowVariablesEditor.d.ts +6 -0
  50. package/dist/editor/definition.d.ts +6 -0
  51. package/dist/editor/json-apply.d.ts +29 -0
  52. package/dist/editor/step-problems-feed.d.ts +5 -0
  53. package/dist/editor/types.d.ts +2 -2
  54. package/dist/editor-apps-DkkC7wOQ.js +152 -0
  55. package/dist/editor-apps-DkkC7wOQ.js.map +1 -0
  56. package/dist/editor-tools-BR27RGto.js +1683 -0
  57. package/dist/editor-tools-BR27RGto.js.map +1 -0
  58. package/dist/editor.mjs +1 -1
  59. package/dist/editors.mjs +855 -650
  60. package/dist/editors.mjs.map +1 -1
  61. package/dist/{endpoints-B2ynbZo-.js → endpoints-DSRo1Lc5.js} +113 -107
  62. package/dist/endpoints-DSRo1Lc5.js.map +1 -0
  63. package/dist/fields-DvS8XZFc.js +21 -0
  64. package/dist/fields-DvS8XZFc.js.map +1 -0
  65. package/dist/forms/ModelBudgetsManager.d.ts +9 -0
  66. package/dist/forms/ModelRoutesManager.d.ts +14 -0
  67. package/dist/forms.d.ts +4 -0
  68. package/dist/forms.mjs +611 -212
  69. package/dist/forms.mjs.map +1 -1
  70. package/dist/{rail-settings-XYGToh00.js → import-bindings-EUtxZ9Ti.js} +90 -24
  71. package/dist/import-bindings-EUtxZ9Ti.js.map +1 -0
  72. package/dist/index.mjs +154 -117
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/lib/binding-problems.d.ts +42 -0
  75. package/dist/lib/code-rail.d.ts +4 -2
  76. package/dist/lib/history-query.d.ts +45 -0
  77. package/dist/lib/import-bindings.d.ts +89 -0
  78. package/dist/lib/index.d.ts +4 -0
  79. package/dist/lib/invoke-error.d.ts +1 -0
  80. package/dist/lib/rail-settings.d.ts +1 -1
  81. package/dist/lib/sdk-snippets.d.ts +1 -1
  82. package/dist/lib/setup-incomplete.d.ts +22 -0
  83. package/dist/lib/starting-data.d.ts +31 -0
  84. package/dist/lib/state-panel.d.ts +29 -0
  85. package/dist/lib/target-fields.d.ts +11 -15
  86. package/dist/lib/trigger-preview.d.ts +1 -0
  87. package/dist/lib/workflow-live-run.d.ts +93 -8
  88. package/dist/lib/workflow-nodes.d.ts +5 -0
  89. package/dist/lib/workflow-validity.d.ts +65 -16
  90. package/dist/lib/workflow-variables.d.ts +1 -1
  91. package/dist/lib/workflow-version.d.ts +2 -0
  92. package/dist/lib.mjs +86 -69
  93. package/dist/lists/ConnectionDependents.d.ts +31 -0
  94. package/dist/lists/ConnectionDetail.d.ts +4 -1
  95. package/dist/lists/ConnectionList.d.ts +4 -1
  96. package/dist/lists/CredentialDetail.d.ts +15 -0
  97. package/dist/lists/CredentialList.d.ts +14 -0
  98. package/dist/lists/DataStoreList.d.ts +17 -0
  99. package/dist/lists/DataStoreView.d.ts +19 -0
  100. package/dist/lists/Logs.d.ts +19 -0
  101. package/dist/lists/ModelCatalog.d.ts +12 -0
  102. package/dist/lists/ModelUsage.d.ts +12 -0
  103. package/dist/lists.d.ts +14 -0
  104. package/dist/lists.mjs +1766 -609
  105. package/dist/lists.mjs.map +1 -1
  106. package/dist/models-bAayQPJ_.js +270 -0
  107. package/dist/models-bAayQPJ_.js.map +1 -0
  108. package/dist/{project-context-BiCjv_E3.js → project-context-Tvp-La7A.js} +3 -3
  109. package/dist/{project-context-BiCjv_E3.js.map → project-context-Tvp-La7A.js.map} +1 -1
  110. package/dist/rail/ConnectionsTool.d.ts +2 -0
  111. package/dist/rail/HistoryTool.d.ts +2 -0
  112. package/dist/rail/StartingStateTool.d.ts +2 -0
  113. package/dist/rail/settings-sections.d.ts +4 -1
  114. package/dist/rail.mjs +4 -4
  115. package/dist/repos/agents-studio-agents.d.ts +52 -0
  116. package/dist/repos/agents-studio-assets.d.ts +68 -0
  117. package/dist/repos/connections.d.ts +30 -12
  118. package/dist/repos/constants.d.ts +12 -0
  119. package/dist/repos/credentials.d.ts +83 -0
  120. package/dist/repos/data-stores.d.ts +84 -0
  121. package/dist/repos/endpoints.d.ts +9 -3
  122. package/dist/repos/fields.d.ts +34 -0
  123. package/dist/repos/functions.d.ts +7 -5
  124. package/dist/repos/history.d.ts +9 -0
  125. package/dist/repos/index.d.ts +7 -0
  126. package/dist/repos/models.d.ts +289 -0
  127. package/dist/repos/spec-export.d.ts +3 -3
  128. package/dist/repos/spec-import.d.ts +30 -1
  129. package/dist/repos/step-tests.d.ts +2 -0
  130. package/dist/repos/webhook-listen.d.ts +35 -0
  131. package/dist/repos/workflows.d.ts +105 -2
  132. package/dist/repos.mjs +655 -176
  133. package/dist/repos.mjs.map +1 -1
  134. package/dist/setup-incomplete-BHs3Lpfy.js +199 -0
  135. package/dist/setup-incomplete-BHs3Lpfy.js.map +1 -0
  136. package/dist/{slug-C4ktDPdy.js → slug-BVdgiP_L.js} +64 -60
  137. package/dist/slug-BVdgiP_L.js.map +1 -0
  138. package/dist/{spec-export-Cf3VQSQS.js → spec-export-DGy5ijps.js} +73 -60
  139. package/dist/spec-export-DGy5ijps.js.map +1 -0
  140. package/dist/spec-import-SWOonsNr.js +116 -0
  141. package/dist/spec-import-SWOonsNr.js.map +1 -0
  142. package/dist/{step-tests-CivICmTq.js → step-tests-B4E4W3ly.js} +8 -7
  143. package/dist/step-tests-B4E4W3ly.js.map +1 -0
  144. package/dist/theme-context-E2ZhlXDX.js +6 -0
  145. package/dist/theme-context-E2ZhlXDX.js.map +1 -0
  146. package/dist/theme-context.d.ts +2 -0
  147. package/dist/{use-callable-draft-zHLpcr-b.js → use-callable-draft-DCauHt5o.js} +23 -23
  148. package/dist/{use-callable-draft-zHLpcr-b.js.map → use-callable-draft-DCauHt5o.js.map} +1 -1
  149. package/dist/use-workflow-draft-l3P5KZzw.js +338 -0
  150. package/dist/use-workflow-draft-l3P5KZzw.js.map +1 -0
  151. package/dist/{workflow-blank-DyL3_RUA.js → workflow-blank-DFpGObrn.js} +6 -6
  152. package/dist/{workflow-blank-DyL3_RUA.js.map → workflow-blank-DFpGObrn.js.map} +1 -1
  153. package/dist/workflows-BZN4Hyz1.js +623 -0
  154. package/dist/workflows-BZN4Hyz1.js.map +1 -0
  155. package/package.json +3 -2
  156. package/src/styles.css +155 -7
  157. package/dist/ConfirmModal-RLbZT5_k.js +0 -181
  158. package/dist/ConfirmModal-RLbZT5_k.js.map +0 -1
  159. package/dist/ImportSpecModal-BDQIf6rg.js +0 -136
  160. package/dist/ImportSpecModal-BDQIf6rg.js.map +0 -1
  161. package/dist/WorkflowEditor-DlbVv6Fs.js +0 -854
  162. package/dist/WorkflowEditor-DlbVv6Fs.js.map +0 -1
  163. package/dist/apps-1FNUwbGv.js +0 -77
  164. package/dist/apps-1FNUwbGv.js.map +0 -1
  165. package/dist/coerce-input-BicYr7nc.js +0 -139
  166. package/dist/coerce-input-BicYr7nc.js.map +0 -1
  167. package/dist/connections-CjjYeRqb.js +0 -78
  168. package/dist/connections-CjjYeRqb.js.map +0 -1
  169. package/dist/document-sources-C0grrtdq.js +0 -86
  170. package/dist/document-sources-C0grrtdq.js.map +0 -1
  171. package/dist/editor-apps-BdenSV1o.js +0 -95
  172. package/dist/editor-apps-BdenSV1o.js.map +0 -1
  173. package/dist/editor-tools-RxmY5iyi.js +0 -1279
  174. package/dist/editor-tools-RxmY5iyi.js.map +0 -1
  175. package/dist/endpoints-B2ynbZo-.js.map +0 -1
  176. package/dist/rail-settings-XYGToh00.js.map +0 -1
  177. package/dist/slug-C4ktDPdy.js.map +0 -1
  178. package/dist/spec-export-Cf3VQSQS.js.map +0 -1
  179. package/dist/spec-import-CjmxyZDR.js +0 -465
  180. package/dist/spec-import-CjmxyZDR.js.map +0 -1
  181. package/dist/step-tests-CivICmTq.js.map +0 -1
  182. package/dist/trigger-preview-VPkrryDl.js +0 -120
  183. package/dist/trigger-preview-VPkrryDl.js.map +0 -1
  184. package/dist/use-workflow-draft-DzAyUeA6.js +0 -316
  185. package/dist/use-workflow-draft-DzAyUeA6.js.map +0 -1
@@ -0,0 +1,35 @@
1
+ import { W6WClient } from '@w6w/sdk';
2
+ /**
3
+ * "Listen for test event" on a `@w6w/webhook` subscription — `/subscriptions/:id/listen` over
4
+ * `client.request()`. Not in the SDK's stable contract (Studio reaches it the same way, its
5
+ * `repos/subscriptions.ts`), and `createW6WUiAdapter` carries none of it, so without these the
6
+ * embedded editor's webhook Test tab fell back to the paste-a-payload form.
7
+ */
8
+ /**
9
+ * Structural mirror of ui's `WebhookListenSession` (this barrel may not import `@w6w/ui`); the
10
+ * UiBridge assignment typechecks against W6WApi structurally.
11
+ */
12
+ export interface WebhookListenSession {
13
+ id: string;
14
+ subscriptionId: string;
15
+ nodeId: string | null;
16
+ expiresAt: string;
17
+ status: "waiting" | "captured" | "expired";
18
+ request?: {
19
+ method: string;
20
+ path: string;
21
+ query: Record<string, string>;
22
+ headers: Record<string, string>;
23
+ body: unknown;
24
+ };
25
+ receivedAt?: string;
26
+ }
27
+ export declare function startWebhookListen(client: W6WClient, subscriptionId: string): Promise<{
28
+ session: WebhookListenSession;
29
+ webhookUrl: string;
30
+ }>;
31
+ export declare function pollWebhookListen(client: W6WClient, subscriptionId: string, sessionId: string, opts?: {
32
+ waitSeconds?: number;
33
+ signal?: AbortSignal;
34
+ }): Promise<WebhookListenSession>;
35
+ export declare function stopWebhookListen(client: W6WClient, subscriptionId: string, sessionId: string): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { UseMutationResult } from '@tanstack/react-query';
2
- import { W6WClient, WorkflowRunResult } from '@w6w/sdk';
2
+ import { StateLogRow } from '@w6w/expr';
3
+ import { RunStatus, W6WClient, WorkflowRunResult } from '@w6w/sdk';
3
4
  import { RunState } from '@w6w/sdk/console';
4
5
  export type { RunState, RunSummary } from '@w6w/sdk/console';
5
6
  export type { WorkflowStatus, WorkflowSummary } from '@w6w/sdk';
@@ -51,7 +52,7 @@ export declare function useRunsQuery(workflowId: string): import('@tanstack/reac
51
52
  * resolve in a real run. Omitted, that node outputs `{}` and every reference to
52
53
  * a trigger field resolves to the empty string — the failure mode filed as
53
54
  * `.ai/projects/backlog/26-07-29-01-trigger-run-payload.md`, where a step tests
54
- * green and then does nothing in production. `variables` seeds `vars.*` and
55
+ * green and then does nothing in production. `variables` seeds `var.*` and
55
56
  * reaches the trigger node not at all.
56
57
  *
57
58
  * Goes through the typed `client.workflows.run()` with
@@ -95,6 +96,87 @@ export declare function runWorkflowSync(client: W6WClient, id: string, variables
95
96
  export declare function startWorkflowRun(client: W6WClient, id: string, variables: Record<string, unknown>, input?: Record<string, unknown>): Promise<{
96
97
  runId: string;
97
98
  }>;
99
+ /** What {@link startRunFromNode} sends: the paused nodes to stop before, and the start seed. */
100
+ export interface RunFromNodeBody {
101
+ /** Node ids the run stops BEFORE (they do not execute) — the editor's paused nodes. */
102
+ stopAt: string[];
103
+ /** Upstream outputs keyed by node id, seeded from saved step tests / the last run. */
104
+ nodes?: Record<string, {
105
+ output?: unknown;
106
+ meta?: unknown;
107
+ }>;
108
+ /** The trigger's filled values, when the run starts at a trigger node. */
109
+ input?: Record<string, unknown>;
110
+ }
111
+ /**
112
+ * Run from a node — `POST /workflows/:id/nodes/:nodeId/run` with `continue: true`: a REAL run
113
+ * that executes `nodeId`, continues through every node downstream of it the way a run follows
114
+ * its edges, and stops before each `stopAt` node. Answers `202 { runId }` at once, like
115
+ * {@link startWorkflowRun}, so the caller polls it live ({@link useLiveRunQuery}). The run
116
+ * executes the STORED definition, so a caller flushes its draft first.
117
+ *
118
+ * The plain `client.request()` escape hatch, not a typed `@w6w/sdk` method: the route is a
119
+ * console authoring aid, and a typed method would pull `packages/wrappers` (every language, in
120
+ * lockstep) into an editor-only change.
121
+ */
122
+ export declare function startRunFromNode(client: W6WClient, id: string, nodeId: string, body: RunFromNodeBody): Promise<{
123
+ runId: string;
124
+ }>;
125
+ /** A node output's structural shape, as the server records it (structural mirror of `@w6w/ui`'s). */
126
+ export type NodeSampleShape = {
127
+ type: "string" | "number" | "boolean" | "null" | "unknown";
128
+ } | {
129
+ type: "object";
130
+ fields: Record<string, NodeSampleShape>;
131
+ } | {
132
+ type: "array";
133
+ items?: NodeSampleShape;
134
+ };
135
+ /**
136
+ * One persisted node sample — structural mirror of `@w6w/ui`'s `NodeSample` (this barrel may not
137
+ * import `@w6w/ui`; the facade/UiBridge assignment typechecks against `W6WApi` structurally).
138
+ */
139
+ export interface NodeSample {
140
+ nodeId: string;
141
+ shape: NodeSampleShape;
142
+ sample?: unknown;
143
+ sampleOmitted?: true;
144
+ source: "step_test" | "node_run" | "run";
145
+ runId?: string;
146
+ updatedAt: string;
147
+ }
148
+ /**
149
+ * The workflow's persisted node samples — `GET /workflows/:id/node-samples` → `{ nodeSamples }`:
150
+ * each node's last output shape (and value, when kept), written server-side on every Test, node
151
+ * run and run. Backs `W6WApi.loadNodeSamples`, so the editor's picker keeps upstream keys across a
152
+ * reload. The plain `client.request()` escape hatch, for the same reason as {@link startRunFromNode}.
153
+ */
154
+ export declare function listNodeSamples(client: W6WClient, id: string): Promise<NodeSample[]>;
155
+ /** One remembered node test input — structural mirror of `@w6w/ui`'s `NodeTestInput`. */
156
+ export interface NodeTestInput {
157
+ nodeId: string;
158
+ input: Record<string, unknown>;
159
+ updatedAt: string;
160
+ }
161
+ /**
162
+ * The test input each node of the workflow last ran with in the editor —
163
+ * `GET /workflows/:id/test-inputs` → `{ testInputs }` (`node_test_inputs`, 0160). Backs
164
+ * `W6WApi.loadTestInputs`, so the Run node modal, the Test tabs and the header Run reopen
165
+ * prefilled. The plain `client.request()` escape hatch, for the same reason as {@link startRunFromNode}.
166
+ */
167
+ export declare function listTestInputs(client: W6WClient, id: string): Promise<NodeTestInput[]>;
168
+ /**
169
+ * Remember a node's test input (`{}` clears it) — `PUT /workflows/:id/nodes/:nodeId/test-input`.
170
+ * Backs `W6WApi.saveTestInput`; the server drops sealed envelopes before the write.
171
+ */
172
+ export declare function saveTestInput(client: W6WClient, id: string, nodeId: string, input: Record<string, unknown>): Promise<void>;
173
+ export declare function useRunFromNodeMutation(): UseMutationResult<{
174
+ runId: string;
175
+ }, Error, {
176
+ id: string;
177
+ nodeId: string;
178
+ body: RunFromNodeBody;
179
+ }, unknown>;
98
180
  export declare function useStartRunMutation(): UseMutationResult<{
99
181
  runId: string;
100
182
  }, Error, {
@@ -136,3 +218,24 @@ export declare const runStateKey: (runId: string) => readonly ["run", string];
136
218
  * run started yet, or the page navigated to a different workflow).
137
219
  */
138
220
  export declare function useLiveRunQuery(runId: string | null): import('@tanstack/react-query').UseQueryResult<NoInfer<RunState>, Error>;
221
+ /** `GET /runs/:id/state-writes` — the run's state-write log (plan §2.4). */
222
+ export interface RunStateWrites {
223
+ writes: StateLogRow[];
224
+ truncated: boolean;
225
+ }
226
+ /**
227
+ * One run's state-write log, read for the run log's State block ("state after this
228
+ * step"). The plain `client.request()` escape hatch, for the same reason as
229
+ * {@link listNodeSamples}: the route has no typed `@w6w/sdk` method.
230
+ */
231
+ export declare function getRunStateWrites(client: W6WClient, runId: string): Promise<RunStateWrites>;
232
+ /** Query key for one run's state-write log. The last segment flips from `"live"` to
233
+ * `"final"` when the run turns terminal, so the final log is fetched exactly once more. */
234
+ export declare function runStateWritesKey(runId: string, status: RunStatus | undefined): readonly ["run", string, "state-writes", "live" | "final"];
235
+ /**
236
+ * Poll one run's state-write log beside {@link useLiveRunQuery}: the same 500ms cadence
237
+ * while the run (as `status`, the live run query's answer) is in flight, no polling once
238
+ * terminal. `retry: false` — a failed read only leaves the run log without its State
239
+ * block; it never touches the run poll.
240
+ */
241
+ export declare function useRunStateWritesQuery(runId: string | null, status: RunStatus | undefined): import('@tanstack/react-query').UseQueryResult<NoInfer<RunStateWrites>, Error>;