@w6w/embed 0.2.11 → 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 (132) 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-D6CQLpa_.js → CreateFunctionModal-DScxp_LN.js} +2 -2
  5. package/dist/{CreateFunctionModal-D6CQLpa_.js.map → CreateFunctionModal-DScxp_LN.js.map} +1 -1
  6. package/dist/{DocumentFormModal-YauVdolr.js → DocumentFormModal-Br4s8wmi.js} +3 -3
  7. package/dist/{DocumentFormModal-YauVdolr.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-BGESQahw.js → ModelRoutesManager-1Ac5wcas.js} +3 -3
  11. package/dist/{ModelRoutesManager-BGESQahw.js.map → ModelRoutesManager-1Ac5wcas.js.map} +1 -1
  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/chrome/DangerZone.d.ts +4 -3
  17. package/dist/chrome/ExecutionProfileHeader.d.ts +3 -3
  18. package/dist/chrome/JsonToggle.d.ts +29 -20
  19. package/dist/chrome/Modal.d.ts +3 -1
  20. package/dist/chrome/RightRail.d.ts +6 -1
  21. package/dist/chrome/VersionHistoryModal.d.ts +2 -0
  22. package/dist/chrome/index.d.ts +1 -0
  23. package/dist/chrome/workspace.d.ts +32 -1
  24. package/dist/{coerce-input-DttlcSdO.js → coerce-input-DFJ4n_wc.js} +68 -69
  25. package/dist/coerce-input-DFJ4n_wc.js.map +1 -0
  26. package/dist/{connections-D7cgXhDS.js → connections-CzsCyIxY.js} +10 -10
  27. package/dist/{connections-D7cgXhDS.js.map → connections-CzsCyIxY.js.map} +1 -1
  28. package/dist/{credentials-DaQU3Ca_.js → credentials-Cn92LGhJ.js} +4 -4
  29. package/dist/{credentials-DaQU3Ca_.js.map → credentials-Cn92LGhJ.js.map} +1 -1
  30. package/dist/data-stores-UeQvwVCa.js +170 -0
  31. package/dist/data-stores-UeQvwVCa.js.map +1 -0
  32. package/dist/document-sources-DNmBojx6.js +169 -0
  33. package/dist/document-sources-DNmBojx6.js.map +1 -0
  34. package/dist/draft/use-workflow-draft.d.ts +2 -0
  35. package/dist/draft.mjs +2 -2
  36. package/dist/editor/PublishTooltip.d.ts +7 -0
  37. package/dist/editor/SetupIncompleteBanner.d.ts +12 -0
  38. package/dist/editor/StartingStateModal.d.ts +14 -0
  39. package/dist/editor/WorkflowSettingsModal.d.ts +6 -1
  40. package/dist/editor/WorkflowVariablesEditor.d.ts +6 -0
  41. package/dist/editor/definition.d.ts +4 -0
  42. package/dist/editor/json-apply.d.ts +29 -0
  43. package/dist/editor/step-problems-feed.d.ts +5 -0
  44. package/dist/editor/types.d.ts +2 -2
  45. package/dist/editor-apps-DkkC7wOQ.js +152 -0
  46. package/dist/editor-apps-DkkC7wOQ.js.map +1 -0
  47. package/dist/editor-tools-BR27RGto.js +1683 -0
  48. package/dist/editor-tools-BR27RGto.js.map +1 -0
  49. package/dist/editor.mjs +1 -1
  50. package/dist/editors.mjs +536 -478
  51. package/dist/editors.mjs.map +1 -1
  52. package/dist/forms.mjs +3 -3
  53. package/dist/{rail-settings-XYGToh00.js → import-bindings-EUtxZ9Ti.js} +90 -24
  54. package/dist/import-bindings-EUtxZ9Ti.js.map +1 -0
  55. package/dist/index.mjs +138 -108
  56. package/dist/index.mjs.map +1 -1
  57. package/dist/lib/binding-problems.d.ts +5 -1
  58. package/dist/lib/history-query.d.ts +45 -0
  59. package/dist/lib/import-bindings.d.ts +89 -0
  60. package/dist/lib/index.d.ts +3 -0
  61. package/dist/lib/rail-settings.d.ts +1 -1
  62. package/dist/lib/setup-incomplete.d.ts +22 -0
  63. package/dist/lib/starting-data.d.ts +31 -0
  64. package/dist/lib/state-panel.d.ts +29 -0
  65. package/dist/lib/target-fields.d.ts +3 -15
  66. package/dist/lib/workflow-live-run.d.ts +84 -6
  67. package/dist/lib/workflow-validity.d.ts +64 -16
  68. package/dist/lib/workflow-variables.d.ts +1 -1
  69. package/dist/lib/workflow-version.d.ts +2 -0
  70. package/dist/lib.mjs +87 -72
  71. package/dist/lists/DataStoreList.d.ts +17 -0
  72. package/dist/lists/DataStoreView.d.ts +19 -0
  73. package/dist/lists/Logs.d.ts +19 -0
  74. package/dist/lists.d.ts +6 -0
  75. package/dist/lists.mjs +1255 -816
  76. package/dist/lists.mjs.map +1 -1
  77. package/dist/rail/ConnectionsTool.d.ts +2 -0
  78. package/dist/rail/HistoryTool.d.ts +2 -0
  79. package/dist/rail/StartingStateTool.d.ts +2 -0
  80. package/dist/rail/settings-sections.d.ts +4 -1
  81. package/dist/rail.mjs +1 -1
  82. package/dist/repos/constants.d.ts +12 -0
  83. package/dist/repos/data-stores.d.ts +84 -0
  84. package/dist/repos/history.d.ts +9 -0
  85. package/dist/repos/index.d.ts +2 -0
  86. package/dist/repos/spec-export.d.ts +3 -3
  87. package/dist/repos/spec-import.d.ts +30 -1
  88. package/dist/repos/step-tests.d.ts +2 -0
  89. package/dist/repos/webhook-listen.d.ts +35 -0
  90. package/dist/repos/workflows.d.ts +105 -2
  91. package/dist/repos.mjs +370 -328
  92. package/dist/repos.mjs.map +1 -1
  93. package/dist/setup-incomplete-BHs3Lpfy.js +199 -0
  94. package/dist/setup-incomplete-BHs3Lpfy.js.map +1 -0
  95. package/dist/{spec-export-CBbloO_n.js → spec-export-DGy5ijps.js} +72 -59
  96. package/dist/spec-export-DGy5ijps.js.map +1 -0
  97. package/dist/spec-import-SWOonsNr.js +116 -0
  98. package/dist/spec-import-SWOonsNr.js.map +1 -0
  99. package/dist/{step-tests-CivICmTq.js → step-tests-B4E4W3ly.js} +8 -7
  100. package/dist/step-tests-B4E4W3ly.js.map +1 -0
  101. package/dist/{use-callable-draft-DsALnSfF.js → use-callable-draft-DCauHt5o.js} +2 -2
  102. package/dist/{use-callable-draft-DsALnSfF.js.map → use-callable-draft-DCauHt5o.js.map} +1 -1
  103. package/dist/use-workflow-draft-l3P5KZzw.js +338 -0
  104. package/dist/use-workflow-draft-l3P5KZzw.js.map +1 -0
  105. package/dist/workflows-BZN4Hyz1.js +623 -0
  106. package/dist/workflows-BZN4Hyz1.js.map +1 -0
  107. package/package.json +3 -2
  108. package/src/styles.css +153 -1
  109. package/dist/ConfirmModal-BE-SdX-O.js +0 -185
  110. package/dist/ConfirmModal-BE-SdX-O.js.map +0 -1
  111. package/dist/ImportSpecModal-B7qd1Km2.js +0 -136
  112. package/dist/ImportSpecModal-B7qd1Km2.js.map +0 -1
  113. package/dist/WorkflowEditor-CwvmAGp2.js +0 -925
  114. package/dist/WorkflowEditor-CwvmAGp2.js.map +0 -1
  115. package/dist/apps-CboASBKr.js +0 -77
  116. package/dist/apps-CboASBKr.js.map +0 -1
  117. package/dist/coerce-input-DttlcSdO.js.map +0 -1
  118. package/dist/document-sources-UCwe8x77.js +0 -91
  119. package/dist/document-sources-UCwe8x77.js.map +0 -1
  120. package/dist/editor-apps-BUZWld-m.js +0 -95
  121. package/dist/editor-apps-BUZWld-m.js.map +0 -1
  122. package/dist/editor-tools-B_Lfx3kw.js +0 -1279
  123. package/dist/editor-tools-B_Lfx3kw.js.map +0 -1
  124. package/dist/rail-settings-XYGToh00.js.map +0 -1
  125. package/dist/spec-export-CBbloO_n.js.map +0 -1
  126. package/dist/spec-import-CW6R_Wk1.js +0 -469
  127. package/dist/spec-import-CW6R_Wk1.js.map +0 -1
  128. package/dist/step-tests-CivICmTq.js.map +0 -1
  129. package/dist/trigger-preview-DKxfjzUY.js +0 -145
  130. package/dist/trigger-preview-DKxfjzUY.js.map +0 -1
  131. package/dist/use-workflow-draft-DzAyUeA6.js +0 -316
  132. package/dist/use-workflow-draft-DzAyUeA6.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import { RailTool } from '../chrome/RightRail.tsx';
2
+ export declare const connectionsTool: RailTool;
@@ -0,0 +1,2 @@
1
+ import { RailTool } from '../chrome/RightRail.tsx';
2
+ export declare const historyTool: RailTool;
@@ -0,0 +1,2 @@
1
+ import { RailTool } from '../chrome/RightRail.tsx';
2
+ export declare const startingStateTool: RailTool;
@@ -52,6 +52,8 @@ export declare function SpecChooserModal(props: {
52
52
  * "Published: vN" line and Publish / Enable-Disable stay in the main panel.
53
53
  */
54
54
  export declare function VersionSection(props: {
55
+ definitionStatus?: "published" | "draft" | "unpublished";
56
+ publishDisabled?: boolean;
55
57
  open: boolean;
56
58
  versions: VersionsEnvelope | undefined;
57
59
  publishing: boolean;
@@ -73,13 +75,14 @@ export declare function VersionListModal(props: {
73
75
  onClose: () => void;
74
76
  }): import("react").JSX.Element;
75
77
  /**
76
- * The bottom "danger zone": Archive (until archived) then Delete, with the two confirm modals.
78
+ * The bottom "danger zone": Archive and Delete for workflows; Archive then Delete for other kinds.
77
79
  * Per-kind variance (copy, test ids) is the table above; the caller owns the mutations and the
78
80
  * confirm/error state, and renders this only when `hasDelete(kind)`.
79
81
  */
80
82
  export declare function SettingsDangerZone(props: {
81
83
  kind: SettingsKind;
82
84
  archived: boolean;
85
+ pending?: boolean;
83
86
  deleteConfirming: boolean;
84
87
  archiveConfirming: boolean;
85
88
  deleteError: string | null;
package/dist/rail.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as r } from "react/jsx-runtime";
3
3
  import { useMemo as u } from "react";
4
- import { W as d, R as p, P as m, u as f, a as v, e as b, b as h } from "./editor-tools-B_Lfx3kw.js";
4
+ import { W as d, R as p, P as m, u as f, a as v, e as b, b as h } from "./editor-tools-BR27RGto.js";
5
5
  import { r as P, a as j } from "./project-context-Tvp-La7A.js";
6
6
  const R = () => {
7
7
  };
@@ -0,0 +1,12 @@
1
+ export interface Constant {
2
+ name: string;
3
+ type: "string" | "number" | "boolean" | "json";
4
+ value: unknown;
5
+ description: string;
6
+ /** Computed by the server (e.g. `account_id`), not stored. */
7
+ derived: boolean;
8
+ }
9
+ /** Query key for the constants list. */
10
+ export declare function constantsKey(): readonly ["constants"];
11
+ /** The account's constants (read-only). */
12
+ export declare function useConstantsQuery(): import('@tanstack/react-query').UseQueryResult<NoInfer<Constant[]>, Error>;
@@ -0,0 +1,84 @@
1
+ import { DataStore, DataStoreCreateInput, DataStoreEntry, DataStoreEntryPage, DataStoreKind, W6WClient } from '@w6w/sdk';
2
+ /** The most requests one "walk every page" read makes (200 stores a page). */
3
+ export declare const DATA_STORE_MAX_PAGES = 10;
4
+ /** Query key for a project's store list. */
5
+ export declare function dataStoresKey(projectId?: string): readonly ["data-stores", string | undefined, "list"];
6
+ /** Query key for one store. */
7
+ export declare function dataStoreKey(id: string, projectId?: string): readonly ["data-stores", string | undefined, "detail", string];
8
+ /** Query key for one store's entries under a key prefix (`""` = no filter). */
9
+ export declare function dataStoreEntriesKey(id: string, projectId: string | undefined, prefix: string): readonly ["data-stores", string | undefined, "entries", string, string];
10
+ /**
11
+ * The project's stores, walked page by page (at most {@link DATA_STORE_MAX_PAGES} requests),
12
+ * server order kept. Hook-less so the ui picker's `listDataStores` seam can call it too.
13
+ */
14
+ export declare function listAllDataStores(client: W6WClient, project: string): Promise<DataStore[]>;
15
+ /** The picker's shape: store names and kinds only. */
16
+ export declare function listDataStores(client: W6WClient, project: string): Promise<{
17
+ name: string;
18
+ kind: DataStoreKind;
19
+ }[]>;
20
+ /**
21
+ * ONE page of the entries of the project's store named `store`, for the ui's `data-store-key`
22
+ * picker (`W6WApi.listDataStoreEntries`): the name is resolved to its id (remembered), then
23
+ * `prefix` is the host's server-side key search and `limit` caps the page. An unknown name is an
24
+ * empty page; a failed entries read forgets the id (renamed or archived) and rethrows.
25
+ */
26
+ export declare function listDataStoreEntries(client: W6WClient, project: string, store: string, opts?: {
27
+ prefix?: string;
28
+ limit?: number;
29
+ signal?: AbortSignal;
30
+ }): Promise<{
31
+ items: {
32
+ key: string;
33
+ value: unknown;
34
+ updatedAt: string;
35
+ }[];
36
+ more: boolean;
37
+ }>;
38
+ export declare function useDataStoresQuery(projectId?: string): import('@tanstack/react-query').UseQueryResult<NoInfer<DataStore[]>, Error>;
39
+ export declare function useDataStoreQuery(id: string, projectId?: string): import('@tanstack/react-query').UseQueryResult<NoInfer<DataStore>, Error>;
40
+ export declare function useEntriesQuery(id: string, projectId: string | undefined, prefix: string): import('@tanstack/react-query').UseInfiniteQueryResult<import('@tanstack/react-query').InfiniteData<DataStoreEntryPage, unknown>, Error>;
41
+ /** One entry by key, read fresh (the conflict prompt's Reload). */
42
+ export declare function getEntry(client: W6WClient, id: string, key: string, project: string): Promise<DataStoreEntry>;
43
+ export declare function useCreateDataStoreMutation(): import('@tanstack/react-query').UseMutationResult<DataStore, Error, {
44
+ input: DataStoreCreateInput;
45
+ project: string;
46
+ }, unknown>;
47
+ export declare function useArchiveDataStoreMutation(): import('@tanstack/react-query').UseMutationResult<void, Error, {
48
+ id: string;
49
+ project: string;
50
+ }, unknown>;
51
+ /** `PUT` one entry. `ifVersion` is the optimistic-concurrency guard; `ttlSeconds` keeps an expiry. */
52
+ export declare function useSetEntryMutation(): import('@tanstack/react-query').UseMutationResult<DataStoreEntry, Error, {
53
+ id: string;
54
+ key: string;
55
+ value: unknown;
56
+ ifVersion?: number;
57
+ ttlSeconds?: number;
58
+ project: string;
59
+ }, unknown>;
60
+ /** `POST` one table row; the server generates the key. */
61
+ export declare function useInsertRowMutation(): import('@tanstack/react-query').UseMutationResult<DataStoreEntry, Error, {
62
+ id: string;
63
+ row: Record<string, unknown>;
64
+ ttlSeconds?: number;
65
+ project: string;
66
+ }, unknown>;
67
+ export declare function useDeleteEntryMutation(): import('@tanstack/react-query').UseMutationResult<void, Error, {
68
+ id: string;
69
+ key: string;
70
+ project: string;
71
+ }, unknown>;
72
+ /** Import CSV text verbatim (`text/csv`). Resolves `{imported}`; a refusal throws an `ApiError`. */
73
+ export declare function useImportCsvMutation(): import('@tanstack/react-query').UseMutationResult<{
74
+ imported: number;
75
+ }, Error, {
76
+ id: string;
77
+ csv: string;
78
+ project: string;
79
+ }, unknown>;
80
+ /** Export a table store as CSV text. Read-only: nothing is invalidated. */
81
+ export declare function useExportCsvMutation(): import('@tanstack/react-query').UseMutationResult<string, Error, {
82
+ id: string;
83
+ project: string;
84
+ }, unknown>;
@@ -22,3 +22,12 @@ export declare function useHasExecutedQuery(callableId: string): {
22
22
  /** One execution's full detail, opened from a list row. Disabled while
23
23
  * `summary` is `null` (no row selected). */
24
24
  export declare function useExecutionDetailQuery(summary: ExecutionSummary | null): import('@tanstack/react-query').UseQueryResult<NoInfer<import('./index.ts').ExecutionDetailData>, Error>;
25
+ /** Run a listed execution again with the same input (`rerunExecution`),
26
+ * resolving to the new execution's row (or `null` if not listed yet). Every
27
+ * history list, stat and probe is invalidated once it settles — a failed
28
+ * re-run is still a new execution — as is the workflow's own run list. */
29
+ export declare function useRerunExecutionMutation(): import('@tanstack/react-query').UseMutationResult<ExecutionSummary | null, Error, ExecutionSummary, unknown>;
30
+ /** Look one execution of a callable up by id (`findExecution`) — what opens the original from a
31
+ * re-run's "Re-run of <id>". A plain function over the embed client, not a query: it runs once per
32
+ * click, and the opened detail has its own query. */
33
+ export declare function useFindExecution(): (callableId: string, id: string) => Promise<ExecutionSummary | null>;
@@ -9,9 +9,11 @@ export * from './workflows.ts';
9
9
  export * from './versions.ts';
10
10
  export * from './step-tests.ts';
11
11
  export * from './history.ts';
12
+ export * from './constants.ts';
12
13
  export * from './vars.ts';
13
14
  export * from './vault.ts';
14
15
  export * from './documents.ts';
16
+ export * from './data-stores.ts';
15
17
  export * from '../lib/history-query.ts';
16
18
  export * from '../lib/workflow-live-run.ts';
17
19
  export * from '../lib/workflow-poll.ts';
@@ -1,6 +1,6 @@
1
1
  /** The collections that carry a `/spec` export route — `specCollectionForKind`
2
2
  * (`../lib/rail-settings.ts`) is the sole producer of this type's values. */
3
- export type SpecCollection = "functions" | "endpoints";
3
+ export type SpecCollection = "functions" | "endpoints" | "workflows";
4
4
  /**
5
5
  * Mirrors T2.1.1's `SpecDocument`, also mirrored by `repos/spec-import.ts`'s
6
6
  * `SpecImportDocument` for the sibling import route: the portable document a
@@ -16,8 +16,8 @@ export interface SpecDocument {
16
16
  }
17
17
  /**
18
18
  * `GET /<collection>/:id/spec`. `collection` is `null` for a kind the Export
19
- * button never renders on (`specCollectionForKind`'s `workflow`/`connection`
20
- * arms) — passing `null` disables the query regardless of `enabled`, so a
19
+ * button never renders on (`specCollectionForKind`'s `connection`
20
+ * arm) — passing `null` disables the query regardless of `enabled`, so a
21
21
  * caller need not re-derive that guard itself.
22
22
  */
23
23
  export declare function useSpecQuery(collection: SpecCollection | null, id: string, enabled: boolean): import('@tanstack/react-query').UseQueryResult<NoInfer<SpecDocument>, Error>;
@@ -1,3 +1,4 @@
1
+ import { PreviewDependency, Selection, SpecDependency } from '../lib/import-bindings.ts';
1
2
  import { SpecImportListKeys } from '../lib/spec-import-invalidation.ts';
2
3
  /**
3
4
  * Mirrors `T2.1.1`'s `SpecDocument` (`T2.1.1.contract.md:134-141`): the
@@ -30,7 +31,32 @@ export interface SpecImportResult {
30
31
  name?: string;
31
32
  };
32
33
  references: SpecImportReferenceReport[];
34
+ dependencies?: ImportDependencyStatus[];
33
35
  }
36
+ /** IF-1 `POST /spec/preview` result: one entry per dependency, with server options + suggestion. */
37
+ export interface PreviewResult {
38
+ kind: "function" | "endpoint" | "workflow";
39
+ dependencies: PreviewDependency[];
40
+ references?: SpecImportReferenceReport[];
41
+ }
42
+ /** One dependency's outcome in the import result (IF-1 `dependencies` status[]). */
43
+ export interface ImportDependencyStatus {
44
+ key: string;
45
+ kind?: SpecDependency["kind"];
46
+ name?: string;
47
+ status: "bound" | "created" | "unconfigured" | string;
48
+ boundTo?: string;
49
+ reason?: string;
50
+ }
51
+ /** The preview request body: the document plus the host project, sent explicitly. */
52
+ export declare function buildPreviewBody(document: Record<string, unknown>, project: string | undefined): Record<string, unknown>;
53
+ /** The import request body: the preview body plus the FULL selections map (`unconfigured` included). */
54
+ export declare function buildImportBody(document: Record<string, unknown>, project: string | undefined, selections: Record<string, Selection>): Record<string, unknown>;
55
+ /**
56
+ * `POST /spec/preview` (IF-1). Read-only on the server; a failure rejects the mutation and the
57
+ * caller blocks Create — there is NO fallback to posting the document verbatim to `/spec/import`.
58
+ */
59
+ export declare function useSpecPreviewMutation(project: string | undefined): import('@tanstack/react-query').UseMutationResult<PreviewResult, Error, Record<string, unknown>, unknown>;
34
60
  /**
35
61
  * `POST /spec/import`. Success is always `201` — including a partially
36
62
  * resolved import (T2.1.2 §E: "report, never fail silently"). This mutation
@@ -41,4 +67,7 @@ export interface SpecImportResult {
41
67
  * (`listKeys.workflowsKey(project)`), but every caller passes it uniformly rather than branching on kind itself; see
42
68
  * `../lib/spec-import-invalidation.ts` for why the key differs by kind.
43
69
  */
44
- export declare function useImportSpecMutation(project: string | undefined, listKeys: SpecImportListKeys): import('@tanstack/react-query').UseMutationResult<SpecImportResult, Error, Record<string, unknown>, unknown>;
70
+ export declare function useImportSpecMutation(project: string | undefined, listKeys: SpecImportListKeys): import('@tanstack/react-query').UseMutationResult<SpecImportResult, Error, {
71
+ document: Record<string, unknown>;
72
+ selections: Record<string, Selection>;
73
+ }, unknown>;
@@ -2,6 +2,8 @@ import { W6WClient } from '@w6w/sdk';
2
2
  import { StepTest } from '@w6w/sdk/console';
3
3
  export type { StepTest } from '@w6w/sdk/console';
4
4
  export declare const stepTestsKey: (workflowId: string, stepId: string) => readonly ["stepTests", string, string];
5
+ /** The prefix of every {@link stepTestsKey} of one workflow — invalidates all its steps at once. */
6
+ export declare const workflowStepTestsKey: (workflowId: string) => readonly ["stepTests", string];
5
7
  export declare function listStepTests(client: W6WClient, workflowId: string, stepId: string): Promise<StepTest[]>;
6
8
  export declare function saveStepTest(client: W6WClient, workflowId: string, stepId: string, body: {
7
9
  name?: string;
@@ -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>;