@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,13 @@
1
+ export interface BindingBannerProps {
2
+ kind: "workflow" | "function" | "endpoint";
3
+ problemCount: number;
4
+ canEnable: boolean;
5
+ onEnable: () => void;
6
+ pending?: boolean;
7
+ }
8
+ /** The one "disabled because a connection is gone" banner all three editors render. */
9
+ export declare function BindingBanner(props: BindingBannerProps): import('react').DetailedReactHTMLElement<{
10
+ role: "alert";
11
+ className: string;
12
+ "data-testid": string;
13
+ }, HTMLElement>;
@@ -1,5 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CallableKind } from '../lib/callable-kind.ts';
3
+ import { PublishControlProps } from './PublishControl.tsx';
3
4
  import { CallableEditorNavigation, CallableEditorSlots } from './types.ts';
4
5
  export interface CallableEditorFrameProps {
5
6
  /** Which kind's copy (back/save labels, not-found heading) the frame shows. */
@@ -22,6 +23,9 @@ export interface CallableEditorFrameProps {
22
23
  banners?: ReactNode;
23
24
  /** Rendered as the FIRST child of the header action row, before Save (e.g. a JSON toggle). */
24
25
  headerActions?: ReactNode;
26
+ /** The header Publish (save-then-publish). Omitted ⇒ no control; ignored when `slots.header`
27
+ * replaces the header, since the host then owns the run/publish row. */
28
+ publish?: Omit<PublishControlProps, "kind" | "onError">;
25
29
  children: ReactNode;
26
30
  }
27
31
  /**
@@ -29,5 +33,8 @@ export interface CallableEditorFrameProps {
29
33
  * `incomplete` badge, Save, the error banner and the body (or the not-found card). Router-free —
30
34
  * it asks the host to navigate through `onNavigate` and sets no document title. It publishes
31
35
  * nothing to the rail workspace either: each editor body does that itself (`useWorkspace`).
36
+ *
37
+ * The body is a `.w6w-card-stack` (@w6w/ui's shared rule): the cards an editor renders are ONE
38
+ * vertical column, so the gap between them comes from that rule and never from the caller.
32
39
  */
33
40
  export declare function CallableEditorFrame(props: CallableEditorFrameProps): import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ import { FlushOutcome } from '../draft/use-workflow-draft.ts';
1
2
  import { UrlForm } from '../lib/endpoint-editor.ts';
2
3
  import { EndpointInput, EndpointSecurity, InvokeUrlOption } from '../repos/endpoints.ts';
3
4
  /**
@@ -46,11 +47,13 @@ export declare function SecretField(props: {
46
47
  }): import("react").JSX.Element;
47
48
  /**
48
49
  * Test-invoke panel: one field per declared input, POSTed to /endpoints/:id/invoke. The server
49
- * invokes the STORED definition, so unsaved edits are not what runs. The result is the
50
+ * invokes the STORED draft without publishing (`allowUnpublished`); unsaved edits are saved first
51
+ * via `saveFirst`, so what runs is what the editor shows. The result is the
50
52
  * `kind`-tagged envelope: an Action or Function target answers with an inline `output`; a Workflow
51
53
  * target answers with a `runId` to poll.
52
54
  */
53
55
  export declare function EndpointTestInvoke(props: {
54
56
  id: string;
55
57
  inputs: EndpointInput[];
58
+ saveFirst: () => Promise<FlushOutcome>;
56
59
  }): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ReactNode } from 'react';
2
+ import { FlushOutcome } from '../draft/use-workflow-draft.ts';
3
+ import { CallableKind } from '../lib/callable-kind.ts';
4
+ export interface PublishControlProps {
5
+ kind: Extract<CallableKind, "function" | "endpoint">;
6
+ id: string;
7
+ /** The editor's `saveFirst`: publish runs only on `clean | saved`. */
8
+ saveFirst: () => Promise<FlushOutcome>;
9
+ /** The editor's own gate (`!canSave || incomplete`). */
10
+ disabled: boolean;
11
+ /** Where a `blocked` reason or a failed publish shows (the frame's banner). */
12
+ onError: (message: string | null) => void;
13
+ }
14
+ /**
15
+ * The header Publish of the Function and Endpoint editors, a copy of WorkflowEditor's `wf-publish`:
16
+ * `Publish` → `● Published`, save-then-publish. Same versions cache key as the Settings rail, so
17
+ * a publish from either surface refreshes both.
18
+ */
19
+ export declare function PublishControl(props: PublishControlProps): ReactNode;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ /** Immediate, keyboard-accessible publish help; no native title delay. */
3
+ export declare function PublishTooltip({ message, disabled, children, }: {
4
+ message: string;
5
+ disabled?: boolean;
6
+ children: (descriptionId: string) => ReactNode;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export interface SetupIncompleteBannerProps {
2
+ /** Node id -> what is missing there (the detector's output). */
3
+ problems: Record<string, string[]>;
4
+ /** Node id -> display label; falls back to the id. */
5
+ nodeLabel?: (nodeId: string) => string;
6
+ }
7
+ /** Non-blocking "Setup incomplete" banner; renders nothing when no node has a problem. */
8
+ export declare function SetupIncompleteBanner(props: SetupIncompleteBannerProps): import('react').DetailedReactHTMLElement<{
9
+ role: "status";
10
+ className: string;
11
+ "data-testid": string;
12
+ }, HTMLElement> | null;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * The one editor for a workflow's starting state (`Workflow.initialState`), opened from the
3
+ * rail's State tool (`rail/StartingStateTool.tsx`) and from Settings → Starting data: the expression manager in its
4
+ * starting-state mode. Its `{{ }}` references are resolved once when a run starts, before any
5
+ * step, so the rail has no Previous steps or State section, and no Secrets (a secret never
6
+ * enters state). A click inserts a reference or, with "Value", the source's current value. Save
7
+ * goes through `startingDataForSave` and `validateInitialState` (the server's own check); `{}`
8
+ * or empty drops the key.
9
+ */
10
+ export declare function StartingStateModal(props: {
11
+ initialState: Record<string, unknown> | undefined;
12
+ onChange: (next: Record<string, unknown> | undefined) => void;
13
+ onClose: () => void;
14
+ }): import("react").JSX.Element;
@@ -1,4 +1,19 @@
1
+ import { ReactNode } from 'react';
1
2
  import { TargetKind, TargetSelectorProps } from './TargetSelector.types.ts';
3
+ /**
4
+ * The disabled-callable banner for a Function/Endpoint whose action target binds a connection the
5
+ * account no longer has (R5). Shares the connections cache entry with `TargetSelector`; returns
6
+ * `null` unless the callable is disabled and (has, or had this mount) a missing binding.
7
+ */
8
+ export declare function useBindingBanner(args: {
9
+ kind: "function" | "endpoint";
10
+ id: string;
11
+ uses: {
12
+ app?: string;
13
+ connection?: string | null;
14
+ } | undefined;
15
+ dirty: boolean;
16
+ }): ReactNode;
2
17
  /**
3
18
  * One `target` picker for both the Functions editor's Implementation card and
4
19
  * the Endpoints editor's Target card (rfcs/endpoint.md:339-347,
@@ -16,6 +16,8 @@ export interface TargetMeta {
16
16
  export interface TargetSelectorProps<K extends TargetKind> {
17
17
  /** Which kinds the caller may construct. A single-element array offers no kind control at all (A2). */
18
18
  allowedKinds: readonly K[];
19
+ /** Callable ids (`fn_…` / `wf_…`) the opened picker never offers - a Function editor passes its own id so it cannot bind itself. */
20
+ excludeCallableIds?: readonly string[];
19
21
  value: TargetValue<NoInfer<K>>;
20
22
  onChange: (next: TargetValue<NoInfer<K>>) => void;
21
23
  /** Fired whenever the picked target resolves to a normalized field list (A5/A7). */
@@ -5,13 +5,18 @@ import { WorkflowVariableRow } from '../lib/index.ts';
5
5
  * Both General flags are on unless the workflow says otherwise and persist
6
6
  * immediately (`saveMeta`, via `onChange`); every Variables edit instead goes
7
7
  * through the auto-saver (`onVariablesChange` → `patchMeta`, never an
8
- * immediate save — see the module docstring's Save path decision).
8
+ * immediate save — see the module docstring's Save path decision). The
9
+ * Starting data tab (`Workflow.initialState`, the state tree's seed) shows what
10
+ * is set and how it layers with variables; its editor is the one the rail's
11
+ * State tool opens (`StartingStateModal`), reached through `onEditStartingData`.
9
12
  */
10
13
  export declare function WorkflowSettingsModal(props: {
11
14
  autoSave: boolean;
12
15
  savePosition: boolean;
13
16
  variables: WorkflowVariableRow[];
17
+ initialState: Record<string, unknown> | undefined;
14
18
  onClose: () => void;
15
19
  onChange: (key: "autoSave" | "savePosition", value: boolean) => void;
16
20
  onVariablesChange: (next: WorkflowVariableRow[]) => void;
21
+ onEditStartingData: () => void;
17
22
  }): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { WorkflowVariableRow } from '../lib/index.ts';
2
+ /** Shared workflow input editor, used in the Data rail and the legacy settings dialog. */
3
+ export declare function WorkflowVariablesEditor({ variables, onVariablesChange, }: {
4
+ variables: WorkflowVariableRow[];
5
+ onVariablesChange: (next: WorkflowVariableRow[]) => void;
6
+ }): import("react").JSX.Element;
@@ -8,6 +8,12 @@ export type Parsed = Record<string, unknown> & {
8
8
  * (D-3). The rail's Key control (`SettingsTool.tsx`) is the only place
9
9
  * this is ever ASSIGNED; this page only ever reads it back. */
10
10
  key?: string | null;
11
+ nodes?: unknown[];
12
+ connections?: Record<string, {
13
+ app: string;
14
+ connection: string | null;
15
+ }>;
16
+ /** Legacy name for `nodes`; read via `workflowNodes`. */
11
17
  steps?: unknown[];
12
18
  status?: WorkflowStatus;
13
19
  tags?: string[];
@@ -0,0 +1,29 @@
1
+ import { JsonApplyCheck } from '../chrome/JsonToggle.tsx';
2
+ import { Parsed } from './definition.ts';
3
+ /**
4
+ * The top-level fields the raw-JSON dialog may not change: `id` names the row the save writes to,
5
+ * `key` is assigned only by the rail's Settings → Key control (`workflowKeyEditAllowed`), and
6
+ * `manifestVersion` is the one value the server's `parseWorkflowDefinition` accepts. An edit that
7
+ * alters or deletes one is not refused: Apply puts the loaded value back and says so.
8
+ */
9
+ export declare const PROTECTED_WORKFLOW_FIELDS: readonly ["id", "key", "manifestVersion"];
10
+ /**
11
+ * The offset of the first character that makes `text` invalid JSON, or `null` when it is valid.
12
+ * Engines disagree on whether `JSON.parse` reports a position at all (current V8 quotes a snippet
13
+ * instead), so the dialog finds it itself with this small strict scanner.
14
+ */
15
+ export declare function jsonErrorOffset(text: string): number | null;
16
+ /** `JSON.parse`'s message, prefixed with the 1-based line and column of the first bad character. */
17
+ export declare function jsonSyntaxError(text: string, e: unknown): string;
18
+ /**
19
+ * The save-time shape rules the server applies (`parseWorkflowDefinition` + the step-id gate),
20
+ * restated for the fields the canvas reads, plus the one the canvas needs on top: every edge names
21
+ * a node that exists, or React Flow drops it silently and the next canvas edit deletes it.
22
+ */
23
+ export declare function workflowShapeError(def: Record<string, unknown>): string | null;
24
+ /**
25
+ * Everything Apply checks, in order: the text parses, it is an object, the protected fields carry
26
+ * the loaded values (restored when not), and the result has a shape the canvas and the save accept.
27
+ * `ok` hands back the text to apply — re-serialized when a field was restored, verbatim otherwise.
28
+ */
29
+ export declare function prepareWorkflowJsonApply(text: string, loaded: Parsed | null): JsonApplyCheck;
@@ -0,0 +1,5 @@
1
+ import { StepProblems } from '@w6w/ui/flow';
2
+ import { BindingProblem } from '../lib/binding-problems.ts';
3
+ /** Per step: its connection problem first, then its loop problems, then its state
4
+ * problems, then its setup-incomplete problem; all kept, empty lists skipped. */
5
+ export declare function mergeStepProblems(bindingProblems: readonly BindingProblem[], loopProblems: StepProblems | undefined, stateProblems?: StepProblems, setupProblems?: StepProblems): StepProblems;
@@ -17,8 +17,8 @@ export interface WorkflowEditorSlots {
17
17
  header?: ReactNode;
18
18
  /** Rendered after the built-in header actions. Ignored when `header` replaces the header. */
19
19
  headerActions?: ReactNode;
20
- /** Label of the back control. Default `"← Workflows"`. */
21
- backLabel?: string;
20
+ /** Label of the back control. Default `"← Workflows"`. `null` hides the back control. */
21
+ backLabel?: string | null;
22
22
  }
23
23
  export interface WorkflowEditorProps {
24
24
  workflowId: string;
@@ -0,0 +1,152 @@
1
+ import { jsxs as C, jsx as f, Fragment as X } from "react/jsx-runtime";
2
+ import { u as ee, a as te, b as ne, c as re, d as oe } from "./apps-ItBvnWX3.js";
3
+ import { H as _ } from "./workflows-BZN4Hyz1.js";
4
+ import { ExecutionDetail as se, ExecutionStats as ie, ExecutionFilters as le, ExecutionList as ce, useW6WApi as ue } from "@w6w/ui";
5
+ import { useRef as E, useState as R, useEffect as B, useLayoutEffect as ae, useCallback as L, useMemo as fe } from "react";
6
+ import { useQuery as de } from "@tanstack/react-query";
7
+ const pe = 300;
8
+ function Y(o) {
9
+ for (let r = (o == null ? void 0 : o.parentElement) ?? null; r; r = r.parentElement) {
10
+ const l = getComputedStyle(r).overflowY;
11
+ if ((l === "auto" || l === "scroll") && r.scrollHeight > r.clientHeight)
12
+ return r;
13
+ }
14
+ return null;
15
+ }
16
+ function Se(o) {
17
+ var A, F, N;
18
+ const { scope: r, showKind: l, filters: n, onFiltersChange: m, onOpenInEditor: d } = o, S = E(n);
19
+ S.current = n;
20
+ const [u, a] = R(n.q), p = E(null), [s, b] = R(null);
21
+ B(() => {
22
+ a(n.q);
23
+ }, [n.q]), B(
24
+ () => () => {
25
+ p.current && clearTimeout(p.current);
26
+ },
27
+ []
28
+ );
29
+ const h = ee(r, n), j = te(r, n), I = ne(s), c = re(), D = oe(), [T, y] = R(null), g = E(null), w = E(null), H = (s == null ? void 0 : s.id) ?? null;
30
+ ae(() => {
31
+ var t;
32
+ const e = g.current;
33
+ if (e) {
34
+ if (H !== null) {
35
+ const i = Y(e);
36
+ i ? i.scrollTop = 0 : e.getBoundingClientRect().top < 0 && ((t = e.scrollIntoView) == null || t.call(e, { block: "start" }));
37
+ } else if (w.current) {
38
+ const { parent: i, top: O } = w.current;
39
+ w.current = null, i ? i.scrollTop = O : window.scrollTo(0, O);
40
+ }
41
+ }
42
+ }, [H]);
43
+ const M = E(s);
44
+ M.current = s;
45
+ const x = L((e) => {
46
+ if (M.current === null) {
47
+ const t = Y(g.current);
48
+ w.current = { parent: t, top: t ? t.scrollTop : window.scrollY };
49
+ }
50
+ b(e);
51
+ }, []), v = ((A = h.data) == null ? void 0 : A.executions) ?? [], q = n.offset, V = ((F = h.data) == null ? void 0 : F.hasMore) ?? !1, K = (e) => {
52
+ m({ ...e, offset: 0 });
53
+ }, W = (e) => {
54
+ if (e.q === u) {
55
+ K(e);
56
+ return;
57
+ }
58
+ a(e.q), p.current && clearTimeout(p.current), p.current = setTimeout(() => {
59
+ p.current = null, m({ ...S.current, q: e.q, offset: 0 });
60
+ }, pe);
61
+ }, $ = () => m({ ...n, q: u, offset: Math.max(0, q - _) }), G = () => m({ ...n, q: u, offset: q + _ }), U = L(
62
+ (e) => {
63
+ const t = v.find((i) => i.id === e);
64
+ t && x(t);
65
+ },
66
+ [v, x]
67
+ ), k = (e) => {
68
+ c.mutate(e, {
69
+ onSuccess: (t) => {
70
+ t ? x(t) : b(null);
71
+ }
72
+ });
73
+ }, P = c.isPending ? ((N = c.variables) == null ? void 0 : N.id) ?? null : null, Z = (e, t) => {
74
+ y(null), D(e, t).then((i) => {
75
+ i ? x(i) : y(`${t} is no longer available.`);
76
+ }).catch(() => y(`Couldn't open ${t}.`));
77
+ }, Q = c.isError ? /* @__PURE__ */ C("p", { className: "error", "data-testid": "history-rerun-error", children: [
78
+ "Couldn't re-run: ",
79
+ c.error instanceof Error ? c.error.message : String(c.error)
80
+ ] }) : null, z = {
81
+ status: n.status,
82
+ kind: n.kind,
83
+ from: n.from,
84
+ to: n.to,
85
+ q: u
86
+ }, J = (s == null ? void 0 : s.kind) === "workflow" && d ? () => d(s) : void 0;
87
+ return s ? /* @__PURE__ */ C("div", { ref: g, children: [
88
+ Q,
89
+ T && /* @__PURE__ */ f("p", { className: "error", "data-testid": "history-find-error", children: T }),
90
+ /* @__PURE__ */ f(
91
+ se,
92
+ {
93
+ execution: I.data ?? null,
94
+ loading: I.isLoading,
95
+ errorMessage: I.isError ? "This execution is no longer available." : void 0,
96
+ onBack: () => {
97
+ c.reset(), y(null), b(null);
98
+ },
99
+ onOpenExecution: (e) => Z(s.callableId, e),
100
+ onRerun: () => k(s),
101
+ rerunning: P !== null,
102
+ onOpenInEditor: J
103
+ }
104
+ )
105
+ ] }) : /* @__PURE__ */ C(X, { children: [
106
+ /* @__PURE__ */ f(ie, { stats: j.data ?? null }),
107
+ /* @__PURE__ */ f(le, { showKind: l, value: z, onChange: W }),
108
+ h.isError && /* @__PURE__ */ f("p", { className: "error", "data-testid": "history-error", children: "Couldn't load execution history." }),
109
+ Q,
110
+ /* @__PURE__ */ f("div", { ref: g, children: /* @__PURE__ */ f(
111
+ ce,
112
+ {
113
+ items: v,
114
+ showCallable: l,
115
+ loading: h.isLoading,
116
+ hasPrev: q > 0,
117
+ hasNext: V,
118
+ onPrev: $,
119
+ onNext: G,
120
+ onSelect: U,
121
+ onRerun: (e) => {
122
+ const t = v.find((i) => i.id === e);
123
+ t && k(t);
124
+ },
125
+ rerunningId: P
126
+ }
127
+ ) })
128
+ ] });
129
+ }
130
+ const me = /* @__PURE__ */ new Map();
131
+ function Ee(o) {
132
+ var u;
133
+ const r = ue(), l = (u = r.listAppsByIds) == null ? void 0 : u.bind(r), n = [...o].sort().join(","), d = de({
134
+ queryKey: ["editor-apps", n],
135
+ queryFn: ({ signal: a }) => l ? l(o, { signal: a }) : Promise.resolve([]),
136
+ enabled: o.length > 0 && typeof l == "function"
137
+ }).data;
138
+ return { byId: fe(
139
+ () => d ? new Map(d.map((a) => [a.id, a])) : me,
140
+ [d]
141
+ ) };
142
+ }
143
+ function be(o) {
144
+ const { byId: r } = Ee(o ? [o] : []);
145
+ return o ? r.get(o) : void 0;
146
+ }
147
+ export {
148
+ Se as H,
149
+ Ee as a,
150
+ be as u
151
+ };
152
+ //# sourceMappingURL=editor-apps-DkkC7wOQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-apps-DkkC7wOQ.js","sources":["../src/chrome/HistoryView.tsx","../src/editor/editor-apps.ts"],"sourcesContent":["/**\n * `HistoryView` — the execution-history view body (T3.2.1, extracted from\n * `HistoryPage.tsx`'s T2.4.1 shape): stats + filters + paged list, OR the\n * selected execution's detail — never both. Opening a row swaps the list for\n * that execution (with a Back control to return to the list where it was\n * left); it does not stack the detail under a long list, where it lands\n * off-screen. Two hosts mount it — `HistoryPage` (the\n * project-wide and per-callable routes, filters URL-backed) and\n * `HistoryModal` (R-2's in-place modal, filters kept in local state) — so\n * this component owns every judgment call about HOW the view behaves, and\n * takes no position on WHERE its filters live: the host hands down\n * `filters` and gets every change back through `onFiltersChange`, exactly\n * the controlled-value shape `filtersToSearch`/`filtersFromSearch` already\n * assume on the URL-backed side.\n *\n * What stays here, same as it was in `HistoryPage` before the extraction:\n * - the search box's text, debounced, so a keystroke does not re-key and\n * re-issue both queries on every character (`onFiltersChange` — and so\n * the host's own write, URL or local state — fires only once typing\n * settles);\n * - which list row is selected, which is not shareable state and resets on\n * every mount;\n * - re-running an execution (a control on every row and in the detail): the\n * same input, against the callable's current definition. The view then\n * opens the NEW execution, so the outcome is what the author sees next;\n * - every filter change but paging snapping the page back to the first\n * (`offset` 0), because a narrowed result set has no meaningful \"page 3\".\n *\n * `onOpenInEditor`, when given, is called with the selected execution ONLY\n * while it is a workflow run (a function/endpoint invocation has no visual\n * editor to open) — the same gate `HistoryPage.tsx` applied inline before\n * this extraction. A host that never passes it (none of today's two do)\n * simply never sees the call.\n */\nimport {\n type ExecutionSummary,\n HISTORY_PAGE_SIZE,\n type HistoryFilters,\n type HistoryScope,\n useExecutionDetailQuery,\n useFindExecution,\n useHistoryQuery,\n useHistoryStatsQuery,\n useRerunExecutionMutation,\n} from \"@w6w/embed/repos\";\nimport {\n ExecutionDetail,\n type ExecutionFilterValue,\n ExecutionFilters,\n ExecutionList,\n ExecutionStats,\n} from \"@w6w/ui\";\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\n/** How long to wait after the last keystroke before `onFiltersChange` fires\n * with the new `q` (and so before either query re-issues with it). */\nconst SEARCH_DEBOUNCE_MS = 300;\n\n/** The nearest ancestor that actually scrolls (the modal body, the app's main\n * pane), or `null` when the document itself does. */\nfunction scrollParent(el: HTMLElement | null): HTMLElement | null {\n for (let p = el?.parentElement ?? null; p; p = p.parentElement) {\n const overflowY = getComputedStyle(p).overflowY;\n if ((overflowY === \"auto\" || overflowY === \"scroll\") && p.scrollHeight > p.clientHeight) {\n return p;\n }\n }\n return null;\n}\n\nexport interface HistoryViewProps {\n /** `null` ⇒ no scope known yet (the project-wide host, before its project\n * resolves) — both queries stay disabled, mirroring `repos/history.ts`'s\n * own `enabled: scope !== null`. */\n scope: HistoryScope | null;\n /** Project-wide chrome: the Kind filter, and the Callable column on every\n * row. A per-callable host (every callable already knows its own kind)\n * passes `false`. */\n showKind: boolean;\n filters: HistoryFilters;\n onFiltersChange: (next: HistoryFilters) => void;\n onOpenInEditor?: (execution: ExecutionSummary) => void;\n}\n\nexport function HistoryView(props: HistoryViewProps) {\n const { scope, showKind, filters, onFiltersChange, onOpenInEditor } = props;\n\n // The debounce below fires outside any render, so it needs the LATEST\n // filters (a status picked while a `q` write was still pending must\n // survive it) rather than the ones captured when typing started.\n const filtersRef = useRef(filters);\n filtersRef.current = filters;\n\n const [q, setQ] = useState(filters.q);\n const searchTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [selected, setSelected] = useState<ExecutionSummary | null>(null);\n\n // Keep the search box in step with `filters.q` when IT moves from outside\n // (Back/Forward or a shared link on the URL-backed host). This never\n // fights a keystroke: an outside `q` only changes once typing has\n // settled, by which point `q` already equals it.\n useEffect(() => {\n setQ(filters.q);\n }, [filters.q]);\n\n // Drop a pending debounce on unmount.\n useEffect(\n () => () => {\n if (searchTimer.current) clearTimeout(searchTimer.current);\n },\n [],\n );\n\n const listQuery = useHistoryQuery(scope, filters);\n const statsQuery = useHistoryStatsQuery(scope, filters);\n const detailQuery = useExecutionDetailQuery(selected);\n const rerun = useRerunExecutionMutation();\n const findExecution = useFindExecution();\n const [findError, setFindError] = useState<string | null>(null);\n\n // Swapping list ⇄ detail keeps the scroll offset of whatever scrolls around\n // this view, which would open a detail scrolled past its own top (the row\n // was clicked far down the list). So: remember the list's offset on the\n // way in, show the detail from its top, and put the list back on the way out.\n const viewRef = useRef<HTMLDivElement>(null);\n const listScroll = useRef<{ parent: HTMLElement | null; top: number } | null>(null);\n const selectedId = selected?.id ?? null;\n useLayoutEffect(() => {\n const el = viewRef.current;\n if (!el) return;\n if (selectedId !== null) {\n const parent = scrollParent(el);\n if (parent) parent.scrollTop = 0;\n else if (el.getBoundingClientRect().top < 0) el.scrollIntoView?.({ block: \"start\" });\n } else if (listScroll.current) {\n const { parent, top } = listScroll.current;\n listScroll.current = null;\n if (parent) parent.scrollTop = top;\n else window.scrollTo(0, top);\n }\n }, [selectedId]);\n\n const selectedRef = useRef(selected);\n selectedRef.current = selected;\n const open = useCallback((next: ExecutionSummary) => {\n // Leaving the LIST (not one detail for another, as a re-run from the detail does).\n if (selectedRef.current === null) {\n const parent = scrollParent(viewRef.current);\n listScroll.current = { parent, top: parent ? parent.scrollTop : window.scrollY };\n }\n setSelected(next);\n }, []);\n\n const executions = listQuery.data?.executions ?? [];\n const offset = filters.offset;\n const hasMore = listQuery.data?.hasMore ?? false;\n\n /** Every filter change but paging reports a fresh filter set and resets\n * the page to the first. */\n const applyFilters = (next: ExecutionFilterValue) => {\n onFiltersChange({ ...next, offset: 0 });\n };\n\n const onChange = (next: ExecutionFilterValue) => {\n if (next.q === q) {\n applyFilters(next);\n return;\n }\n setQ(next.q);\n if (searchTimer.current) clearTimeout(searchTimer.current);\n searchTimer.current = setTimeout(() => {\n searchTimer.current = null;\n onFiltersChange({ ...filtersRef.current, q: next.q, offset: 0 });\n }, SEARCH_DEBOUNCE_MS);\n };\n\n const onPrev = () =>\n onFiltersChange({ ...filters, q, offset: Math.max(0, offset - HISTORY_PAGE_SIZE) });\n const onNext = () => onFiltersChange({ ...filters, q, offset: offset + HISTORY_PAGE_SIZE });\n\n const onSelect = useCallback(\n (executionId: string) => {\n const row = executions.find((r) => r.id === executionId);\n if (row) open(row);\n },\n [executions, open],\n );\n\n /** Re-run one execution, then open the new one — or, when it is not listed\n * yet, fall back to the (refreshed) list. */\n const startRerun = (summary: ExecutionSummary) => {\n rerun.mutate(summary, {\n onSuccess: (next) => {\n if (next) open(next);\n else setSelected(null);\n },\n });\n };\n const rerunningId = rerun.isPending ? (rerun.variables?.id ?? null) : null;\n\n /** \"Re-run of <id>\": open the original, from the callable this one belongs to. */\n const openOriginal = (callableId: string, id: string) => {\n setFindError(null);\n findExecution(callableId, id)\n .then((row) => {\n if (row) open(row);\n else setFindError(`${id} is no longer available.`);\n })\n .catch(() => setFindError(`Couldn't open ${id}.`));\n };\n const rerunError = rerun.isError ? (\n <p className=\"error\" data-testid=\"history-rerun-error\">\n Couldn't re-run: {rerun.error instanceof Error ? rerun.error.message : String(rerun.error)}\n </p>\n ) : null;\n\n const filterValue: ExecutionFilterValue = {\n status: filters.status,\n kind: filters.kind,\n from: filters.from,\n to: filters.to,\n q,\n };\n\n // A workflow run is the only execution with a visual editor to jump into\n // — a function/endpoint invocation has no such surface.\n const openInEditor =\n selected?.kind === \"workflow\" && onOpenInEditor ? () => onOpenInEditor(selected) : undefined;\n\n if (selected) {\n return (\n <div ref={viewRef}>\n {rerunError}\n {findError && (\n <p className=\"error\" data-testid=\"history-find-error\">\n {findError}\n </p>\n )}\n <ExecutionDetail\n execution={detailQuery.data ?? null}\n loading={detailQuery.isLoading}\n errorMessage={detailQuery.isError ? \"This execution is no longer available.\" : undefined}\n onBack={() => {\n rerun.reset();\n setFindError(null);\n setSelected(null);\n }}\n onOpenExecution={(id) => openOriginal(selected.callableId, id)}\n onRerun={() => startRerun(selected)}\n rerunning={rerunningId !== null}\n onOpenInEditor={openInEditor}\n />\n </div>\n );\n }\n\n return (\n <>\n <ExecutionStats stats={statsQuery.data ?? null} />\n\n <ExecutionFilters showKind={showKind} value={filterValue} onChange={onChange} />\n\n {listQuery.isError && (\n <p className=\"error\" data-testid=\"history-error\">\n Couldn't load execution history.\n </p>\n )}\n\n {rerunError}\n\n <div ref={viewRef}>\n <ExecutionList\n items={executions}\n showCallable={showKind}\n loading={listQuery.isLoading}\n hasPrev={offset > 0}\n hasNext={hasMore}\n onPrev={onPrev}\n onNext={onNext}\n onSelect={onSelect}\n onRerun={(id) => {\n const row = executions.find((r) => r.id === id);\n if (row) startRerun(row);\n }}\n rerunningId={rerunningId}\n />\n </div>\n </>\n );\n}\n","/**\n * The canvas's app lookups, through the host-provided `W6WApi` (`useW6WApi()` — in an embed that\n * is `createW6WUiAdapter`'s, in Studio the facade, which delegates to the same store/repo).\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport { type AppSummary, useW6WApi } from \"@w6w/ui\";\nimport { useMemo } from \"react\";\n\n/** The per-app actions query key — the repos export itself (one declaration, no copy). */\nexport { appActionsKey } from \"../repos/apps.ts\";\n\nconst NO_APPS: ReadonlyMap<string, AppSummary> = new Map();\n\n/** A bounded set of app records by id. Empty when the host's API has no `listAppsByIds`. */\nexport function useEditorApps(ids: readonly string[]): { byId: ReadonlyMap<string, AppSummary> } {\n const api = useW6WApi();\n const list = api.listAppsByIds?.bind(api);\n const key = [...ids].sort().join(\",\");\n const q = useQuery({\n queryKey: [\"editor-apps\", key],\n queryFn: ({ signal }) => (list ? list(ids, { signal }) : Promise.resolve([] as AppSummary[])),\n enabled: ids.length > 0 && typeof list === \"function\",\n });\n const data = q.data;\n const byId = useMemo(\n () => (data ? new Map(data.map((a) => [a.id, a] as const)) : NO_APPS),\n [data],\n );\n return { byId };\n}\n\n/**\n * One app record by id, over {@link useEditorApps} (same `/apps` request, same cache entry as the\n * canvas's batch lookup). `undefined` while loading, for an empty id (which issues no request),\n * or when the host's API cannot look apps up by id.\n */\nexport function useEditorApp(id: string): AppSummary | undefined {\n const { byId } = useEditorApps(id ? [id] : []);\n return id ? byId.get(id) : undefined;\n}\n"],"names":["SEARCH_DEBOUNCE_MS","scrollParent","el","p","overflowY","HistoryView","props","scope","showKind","filters","onFiltersChange","onOpenInEditor","filtersRef","useRef","q","setQ","useState","searchTimer","selected","setSelected","useEffect","listQuery","useHistoryQuery","statsQuery","useHistoryStatsQuery","detailQuery","useExecutionDetailQuery","rerun","useRerunExecutionMutation","findExecution","useFindExecution","findError","setFindError","viewRef","listScroll","selectedId","useLayoutEffect","parent","top","selectedRef","open","useCallback","next","executions","_a","offset","hasMore","_b","applyFilters","onChange","onPrev","HISTORY_PAGE_SIZE","onNext","onSelect","executionId","row","r","startRerun","summary","rerunningId","_c","openOriginal","callableId","id","rerunError","jsxs","filterValue","openInEditor","jsx","ExecutionDetail","Fragment","ExecutionStats","ExecutionFilters","ExecutionList","NO_APPS","useEditorApps","ids","api","useW6WApi","list","key","data","useQuery","signal","useMemo","useEditorApp","byId"],"mappings":";;;;;;AAwDA,MAAMA,KAAqB;AAI3B,SAASC,EAAaC,GAA4C;AAChE,WAASC,KAAID,KAAA,gBAAAA,EAAI,kBAAiB,MAAMC,GAAGA,IAAIA,EAAE,eAAe;AAC9D,UAAMC,IAAY,iBAAiBD,CAAC,EAAE;AACtC,SAAKC,MAAc,UAAUA,MAAc,aAAaD,EAAE,eAAeA,EAAE;AACzE,aAAOA;AAAA,EAEX;AACA,SAAO;AACT;AAgBO,SAASE,GAAYC,GAAyB;;AACnD,QAAM,EAAE,OAAAC,GAAO,UAAAC,GAAU,SAAAC,GAAS,iBAAAC,GAAiB,gBAAAC,MAAmBL,GAKhEM,IAAaC,EAAOJ,CAAO;AACjC,EAAAG,EAAW,UAAUH;AAErB,QAAM,CAACK,GAAGC,CAAI,IAAIC,EAASP,EAAQ,CAAC,GAC9BQ,IAAcJ,EAA6C,IAAI,GAC/D,CAACK,GAAUC,CAAW,IAAIH,EAAkC,IAAI;AAMtE,EAAAI,EAAU,MAAM;AACd,IAAAL,EAAKN,EAAQ,CAAC;AAAA,EAChB,GAAG,CAACA,EAAQ,CAAC,CA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