@w6w/embed 0.2.33 → 0.2.35

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 (82) hide show
  1. package/dist/{CreateFunctionModal-glk2zg1r.js → CreateFunctionModal-CYNHJUGJ.js} +3 -3
  2. package/dist/{CreateFunctionModal-glk2zg1r.js.map → CreateFunctionModal-CYNHJUGJ.js.map} +1 -1
  3. package/dist/{DocumentFormModal-Cw85R4wk.js → DocumentFormModal-CLmdGx34.js} +2 -2
  4. package/dist/{DocumentFormModal-Cw85R4wk.js.map → DocumentFormModal-CLmdGx34.js.map} +1 -1
  5. package/dist/ImportSpecModal-BzEyiNWD.js +378 -0
  6. package/dist/ImportSpecModal-BzEyiNWD.js.map +1 -0
  7. package/dist/WorkflowEditor-CxTuK8_d.js +1272 -0
  8. package/dist/WorkflowEditor-CxTuK8_d.js.map +1 -0
  9. package/dist/apps-CyEszfIu.js +106 -0
  10. package/dist/apps-CyEszfIu.js.map +1 -0
  11. package/dist/callable-row-actions-BPBPflMn.js +56 -0
  12. package/dist/callable-row-actions-BPBPflMn.js.map +1 -0
  13. package/dist/callables-dLF2IcwA.js +317 -0
  14. package/dist/callables-dLF2IcwA.js.map +1 -0
  15. package/dist/chrome/HistoryView.d.ts +3 -0
  16. package/dist/chrome/TagEditor.d.ts +6 -1
  17. package/dist/chrome/workspace.d.ts +16 -0
  18. package/dist/documents-hgltn0xe.js +1017 -0
  19. package/dist/documents-hgltn0xe.js.map +1 -0
  20. package/dist/draft.mjs +1 -1
  21. package/dist/editor/WaitingForm.d.ts +19 -0
  22. package/dist/editor-apps-DsGrGKfe.js +178 -0
  23. package/dist/editor-apps-DsGrGKfe.js.map +1 -0
  24. package/dist/{editor-tools-Dn7TgCP4.js → editor-tools-Ct7YPPj8.js} +681 -783
  25. package/dist/editor-tools-Ct7YPPj8.js.map +1 -0
  26. package/dist/editor.mjs +1 -1
  27. package/dist/editors.mjs +18 -18
  28. package/dist/{endpoints-zOuwci2U.js → endpoints-DJxXRh-I.js} +12 -12
  29. package/dist/{endpoints-zOuwci2U.js.map → endpoints-DJxXRh-I.js.map} +1 -1
  30. package/dist/forms.mjs +1 -1
  31. package/dist/index.mjs +140 -115
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/lib/callable-row-actions.d.ts +17 -0
  34. package/dist/lib/history-query.d.ts +22 -1
  35. package/dist/lib/index.d.ts +2 -0
  36. package/dist/lib/run-event-stream.d.ts +122 -0
  37. package/dist/lib/run-log-nodes.d.ts +43 -0
  38. package/dist/lib/tag-editor.d.ts +6 -0
  39. package/dist/lib/workflow-live-run.d.ts +7 -0
  40. package/dist/lib/workflow-validity.d.ts +7 -1
  41. package/dist/lib.mjs +52 -47
  42. package/dist/lists/CallableKindList.d.ts +12 -0
  43. package/dist/lists/CallableRowParts.d.ts +8 -1
  44. package/dist/lists/EndpointList.d.ts +3 -0
  45. package/dist/lists/FunctionList.d.ts +3 -0
  46. package/dist/lists/WorkflowList.d.ts +3 -0
  47. package/dist/lists.d.ts +1 -0
  48. package/dist/lists.mjs +1589 -1513
  49. package/dist/lists.mjs.map +1 -1
  50. package/dist/rail.mjs +1 -1
  51. package/dist/repos/callables.d.ts +25 -0
  52. package/dist/repos/documents.d.ts +9 -1
  53. package/dist/repos/history.d.ts +5 -1
  54. package/dist/repos/saved-file-names.d.ts +10 -0
  55. package/dist/repos/workflows.d.ts +19 -13
  56. package/dist/repos.mjs +338 -329
  57. package/dist/{setup-incomplete-BHs3Lpfy.js → setup-incomplete-6PAbN0EW.js} +50 -49
  58. package/dist/setup-incomplete-6PAbN0EW.js.map +1 -0
  59. package/dist/spec-import-BKyfhTYG.js +200 -0
  60. package/dist/spec-import-BKyfhTYG.js.map +1 -0
  61. package/dist/{use-callable-draft-w4tDTYcb.js → use-callable-draft-7HwfTuYQ.js} +3 -3
  62. package/dist/{use-callable-draft-w4tDTYcb.js.map → use-callable-draft-7HwfTuYQ.js.map} +1 -1
  63. package/package.json +3 -3
  64. package/src/styles.css +43 -0
  65. package/dist/ImportSpecModal-fU5RsVTa.js +0 -252
  66. package/dist/ImportSpecModal-fU5RsVTa.js.map +0 -1
  67. package/dist/WorkflowEditor-C7oudiIb.js +0 -1169
  68. package/dist/WorkflowEditor-C7oudiIb.js.map +0 -1
  69. package/dist/apps-FMcQfyL2.js +0 -92
  70. package/dist/apps-FMcQfyL2.js.map +0 -1
  71. package/dist/callable-record-Bhxim8C1.js +0 -14
  72. package/dist/callable-record-Bhxim8C1.js.map +0 -1
  73. package/dist/callables-B49tS2vv.js +0 -297
  74. package/dist/callables-B49tS2vv.js.map +0 -1
  75. package/dist/editor-apps-HEOclsxL.js +0 -152
  76. package/dist/editor-apps-HEOclsxL.js.map +0 -1
  77. package/dist/editor-tools-Dn7TgCP4.js.map +0 -1
  78. package/dist/setup-incomplete-BHs3Lpfy.js.map +0 -1
  79. package/dist/spec-import-CGPqUUjN.js +0 -272
  80. package/dist/spec-import-CGPqUUjN.js.map +0 -1
  81. package/dist/workflows-Dz8LMjnt.js +0 -626
  82. package/dist/workflows-Dz8LMjnt.js.map +0 -1
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-Dn7TgCP4.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-Ct7YPPj8.js";
5
5
  import { r as P, a as j } from "./project-context-Tvp-La7A.js";
6
6
  const R = () => {
7
7
  };
@@ -1,6 +1,7 @@
1
1
  import { W6WClient } from '@w6w/sdk';
2
2
  import { DuplicateSiblings } from '../lib/callable-duplicate.ts';
3
3
  import { CallableKind } from '../lib/callable-kind.ts';
4
+ import { CallableSettingsEdit } from '../lib/callable-row-actions.ts';
4
5
  /**
5
6
  * The structural minimum every list row of every kind satisfies — what the shared list chrome
6
7
  * (`pages/CallablePage.tsx`) renders and the Settings rail reads by id. Kind-specific widening
@@ -77,6 +78,20 @@ export declare function duplicateCallable(client: W6WClient, kind: CallableKind,
77
78
  id: string;
78
79
  key: string;
79
80
  }>;
81
+ /**
82
+ * A row menu's Rename…: read the record now, lay the modal's edit on it ({@link applySettingsEdit}:
83
+ * only the fields the edit changes), and save it guarded by that read's `updatedAt`, so a save
84
+ * racing another writer answers 409 instead of overwriting it. `openedTags` are the tags the modal
85
+ * opened with. A Workflow saves into `project`, the list's own, and refuses without one.
86
+ */
87
+ export declare function updateCallableSettings(client: W6WClient, kind: CallableKind, id: string, edit: CallableSettingsEdit, openedTags: readonly string[], options?: {
88
+ project?: string;
89
+ }): Promise<void>;
90
+ /**
91
+ * `GET /<coll>/:id/spec`: the portable document Import accepts (the rail's Export shows the same
92
+ * one). Secrets never ride in it — the server strips sealed envelopes (spec-documents.md).
93
+ */
94
+ export declare function exportCallableSpec(client: W6WClient, kind: CallableKind, id: string): Promise<unknown>;
80
95
  /**
81
96
  * `useQuery` over {@link listCallables}, keyed by {@link callableListKey}. Generic over the row
82
97
  * type so a kind's own facade can narrow it to that kind's widened summary (Function's
@@ -112,3 +127,13 @@ export declare function useDuplicateCallableMutation(kind: CallableKind, options
112
127
  id: string;
113
128
  siblings: DuplicateSiblings;
114
129
  }, unknown>;
130
+ /** `useMutation` over {@link updateCallableSettings}; refreshes the list and the record. */
131
+ export declare function useCallableSettingsMutation(kind: CallableKind, options?: {
132
+ project?: string;
133
+ }): import('@tanstack/react-query').UseMutationResult<void, Error, {
134
+ id: string;
135
+ edit: CallableSettingsEdit;
136
+ openedTags: readonly string[];
137
+ }, unknown>;
138
+ /** `useMutation` over {@link exportCallableSpec}: read-only, nothing to invalidate. */
139
+ export declare function useExportCallableSpecMutation(kind: CallableKind): import('@tanstack/react-query').UseMutationResult<unknown, Error, string, unknown>;
@@ -1,4 +1,4 @@
1
- import { Doc, DocumentCreateInput, DocumentPatch } from '@w6w/sdk';
1
+ import { Doc, DocumentCreateInput, DocumentPatch, W6WClient } from '@w6w/sdk';
2
2
  /**
3
3
  * T1.1.1's wire shape for one document, pinned here ahead of that node
4
4
  * merging (this node is dispatched speculatively against it — see this
@@ -100,3 +100,11 @@ export declare function useSyncDocumentMutation(): import('@tanstack/react-query
100
100
  id: string;
101
101
  project?: string;
102
102
  }, unknown>;
103
+ /**
104
+ * The project's document keys and formats, for the ui's `document` step-param picker
105
+ * (`W6WApi.listDocuments`, `@w6w/document · get`). Hook-less so that seam can call it.
106
+ */
107
+ export declare function listDocumentKeys(client: W6WClient, project: string): Promise<{
108
+ key: string;
109
+ format: string;
110
+ }[]>;
@@ -1,4 +1,4 @@
1
- import { ExecutionSummary, HistoryFilters, HistoryScope } from '../lib/history-query.ts';
1
+ import { ExecutionSummary, HistoryFilters, HistoryScope, WorkflowTrigger } from '../lib/history-query.ts';
2
2
  /** The project-wide or per-callable execution list, one page at a time.
3
3
  * Disabled while `scope` is `null` (no project/callable selected yet).
4
4
  * `placeholderData: keepPreviousData` keeps the previous page's rows on
@@ -31,3 +31,7 @@ export declare function useRerunExecutionMutation(): import('@tanstack/react-que
31
31
  * re-run's "Re-run of <id>". A plain function over the embed client, not a query: it runs once per
32
32
  * click, and the opened detail has its own query. */
33
33
  export declare function useFindExecution(): (callableId: string, id: string) => Promise<ExecutionSummary | null>;
34
+ /** Each listed workflow's triggers (node id → display name), so a History row can say which
35
+ * trigger started it and a workflow's History can filter by one. Best-effort: a workflow whose
36
+ * definition cannot be read maps to `[]`, and its rows fall back to the run kind. */
37
+ export declare function useWorkflowTriggers(workflowIds: string[]): Map<string, WorkflowTrigger[]>;
@@ -0,0 +1,10 @@
1
+ import { W6WClient } from '@w6w/sdk';
2
+ /**
3
+ * The project's saved files as `{ path, size }`, for the ui's `saved-file` step-param picker
4
+ * (`W6WApi.listSavedFiles`, `@w6w/files` save/read): `GET /assets?kind=saved_file`, walked page
5
+ * by page. A saved file's `name` IS its canonical path; `size` is the latest version's bytes.
6
+ */
7
+ export declare function listSavedFiles(client: Pick<W6WClient, "request">, project: string): Promise<{
8
+ path: string;
9
+ size?: number;
10
+ }[]>;
@@ -207,15 +207,19 @@ export declare function getRunState(client: W6WClient, runId: string): Promise<R
207
207
  * is the workflow's run LIST. */
208
208
  export declare const runStateKey: (runId: string) => readonly ["run", string];
209
209
  /**
210
- * T2.1.1/A2/A3 — poll one run's live state at a fixed 500ms interval,
211
- * stopping once it reaches a terminal status ({@link shouldContinuePolling},
212
- * `../lib/workflow-live-run.ts`). A genuine sibling of `pollRunToTerminal`
213
- * (`../lib/workflow-poll.ts`) using the SAME underlying SDK call
214
- * (`client.console.workflows.getRun`), but publishing every intermediate
215
- * `RunState` to its caller via TanStack Query's own `data` — unlike
216
- * `pollRunToTerminal`, which discards every non-terminal result and hands
217
- * back only the last one. `runId === null` disables the query entirely (no
218
- * run started yet, or the page navigated to a different workflow).
210
+ * One run's live state, PUSHED by the server while it is in flight: the hook opens
211
+ * `GET /runs/:id/events` (one stream per run, shared — {@link runStreamRegistry}) and every
212
+ * snapshot lands in this query's cache, so `data` updates the moment a step starts or finishes and
213
+ * nothing is fetched while the run is idle. The stream ends at a terminal status.
214
+ *
215
+ * POLLING IS THE FALLBACK, NEVER GONE. Whenever the stream is refused (an older server, an auth
216
+ * refusal, a buffering proxy that holds the first snapshot past 3 s) or down (reconnecting with
217
+ * backoff), the query polls exactly as it used to — every 500 ms until a terminal status
218
+ * ({@link shouldContinuePolling}, `../lib/workflow-live-run.ts`) — so a run never looks frozen;
219
+ * it stops polling again as soon as the stream is back. A client with nothing to stream with (a
220
+ * test double) only polls. `runId === null` disables the query entirely (no run started yet, or
221
+ * the page navigated to a different workflow). A run already cached as terminal is neither
222
+ * streamed nor refetched: nothing about it changes again.
219
223
  */
220
224
  export declare function useLiveRunQuery(runId: string | null): import('@tanstack/react-query').UseQueryResult<NoInfer<RunState>, Error>;
221
225
  /** `GET /runs/:id/state-writes` — the run's state-write log (plan §2.4). */
@@ -233,9 +237,11 @@ export declare function getRunStateWrites(client: W6WClient, runId: string): Pro
233
237
  * `"final"` when the run turns terminal, so the final log is fetched exactly once more. */
234
238
  export declare function runStateWritesKey(runId: string, status: RunStatus | undefined): readonly ["run", string, "state-writes", "live" | "final"];
235
239
  /**
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
+ * One run's state-write log beside {@link useLiveRunQuery}. While the run streams, it is re-read
241
+ * when a step's status changes ({@link runStreamRegistry} invalidates it) rather than on a timer;
242
+ * while the run polls instead (stream refused or down, or no stream at all), it polls on the same
243
+ * 500 ms cadence. Read once more, under the `"final"` key, when the run turns terminal. `retry:
244
+ * false` — a failed read only leaves the run log without its State block; it never touches the
245
+ * run read.
240
246
  */
241
247
  export declare function useRunStateWritesQuery(runId: string | null, status: RunStatus | undefined): import('@tanstack/react-query').UseQueryResult<NoInfer<RunStateWrites>, Error>;