@w6w/embed 0.0.0-stage → 0.1.1

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 (102) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +166 -2
  3. package/dist/W6WEmbedProvider.d.ts +29 -0
  4. package/dist/chrome/CallFromCodeButton.d.ts +155 -0
  5. package/dist/chrome/CallableSettingsModal.d.ts +17 -0
  6. package/dist/chrome/ConfirmModal.d.ts +20 -0
  7. package/dist/chrome/DangerZone.d.ts +19 -0
  8. package/dist/chrome/ExecutionProfileHeader.d.ts +69 -0
  9. package/dist/chrome/HistoryButton.d.ts +8 -0
  10. package/dist/chrome/HistoryModal.d.ts +9 -0
  11. package/dist/chrome/HistoryView.d.ts +15 -0
  12. package/dist/chrome/ImportSpecModal.d.ts +40 -0
  13. package/dist/chrome/JsonToggle.d.ts +51 -0
  14. package/dist/chrome/Modal.d.ts +20 -0
  15. package/dist/chrome/RightRail.d.ts +24 -0
  16. package/dist/chrome/TagEditor.d.ts +23 -0
  17. package/dist/chrome/VersionHistoryModal.d.ts +38 -0
  18. package/dist/chrome/history-open-run.d.ts +7 -0
  19. package/dist/chrome/index.d.ts +36 -0
  20. package/dist/chrome/workspace.d.ts +67 -0
  21. package/dist/client-context-CX61Bgw-.js +16 -0
  22. package/dist/client-context-CX61Bgw-.js.map +1 -0
  23. package/dist/draft/autosave-flush.d.ts +63 -0
  24. package/dist/draft/autosave.d.ts +68 -0
  25. package/dist/draft/client-context.d.ts +8 -0
  26. package/dist/draft/draft-registry.d.ts +14 -0
  27. package/dist/draft/index.d.ts +15 -0
  28. package/dist/draft/use-workflow-draft.d.ts +67 -0
  29. package/dist/draft/workflow-save.d.ts +48 -0
  30. package/dist/draft-registry-YF0tqNN0.js +49 -0
  31. package/dist/draft-registry-YF0tqNN0.js.map +1 -0
  32. package/dist/draft.d.ts +2 -0
  33. package/dist/draft.mjs +18 -0
  34. package/dist/draft.mjs.map +1 -0
  35. package/dist/editor/WorkflowEditor.d.ts +12 -0
  36. package/dist/editor/WorkflowSettingsModal.d.ts +17 -0
  37. package/dist/editor/definition.d.ts +31 -0
  38. package/dist/editor/editor-apps.d.ts +7 -0
  39. package/dist/editor/types.d.ts +34 -0
  40. package/dist/editor.d.ts +9 -0
  41. package/dist/editor.mjs +2170 -0
  42. package/dist/editor.mjs.map +1 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.mjs +67 -0
  45. package/dist/index.mjs.map +1 -0
  46. package/dist/lib/callable-descriptors.d.ts +77 -0
  47. package/dist/lib/callable-kind.d.ts +13 -0
  48. package/dist/lib/code-rail.d.ts +45 -0
  49. package/dist/lib/document-sources.d.ts +26 -0
  50. package/dist/lib/error-handler-self.d.ts +25 -0
  51. package/dist/lib/history-query.d.ts +135 -0
  52. package/dist/lib/import-paste.d.ts +41 -0
  53. package/dist/lib/index.d.ts +17 -0
  54. package/dist/lib/new-id.d.ts +10 -0
  55. package/dist/lib/rail-settings.d.ts +196 -0
  56. package/dist/lib/save-invalidation.d.ts +24 -0
  57. package/dist/lib/sdk-snippets.d.ts +96 -0
  58. package/dist/lib/settings-rail.d.ts +68 -0
  59. package/dist/lib/slug.d.ts +69 -0
  60. package/dist/lib/spec-import-invalidation.d.ts +48 -0
  61. package/dist/lib/tag-editor.d.ts +36 -0
  62. package/dist/lib/trigger-preview.d.ts +89 -0
  63. package/dist/lib/workflow-live-run.d.ts +165 -0
  64. package/dist/lib/workflow-poll.d.ts +8 -0
  65. package/dist/lib/workflow-route.d.ts +26 -0
  66. package/dist/lib/workflow-settings.d.ts +72 -0
  67. package/dist/lib/workflow-validity.d.ts +92 -0
  68. package/dist/lib/workflow-variables.d.ts +106 -0
  69. package/dist/lib.d.ts +2 -0
  70. package/dist/lib.mjs +62 -0
  71. package/dist/lib.mjs.map +1 -0
  72. package/dist/project-context-Dbk0Gr1K.js +16 -0
  73. package/dist/project-context-Dbk0Gr1K.js.map +1 -0
  74. package/dist/project-context.d.ts +11 -0
  75. package/dist/rail/CodeTool.d.ts +2 -0
  76. package/dist/rail/ErrorHandlingTool.d.ts +22 -0
  77. package/dist/rail/ExpressionScope.d.ts +21 -0
  78. package/dist/rail/SettingsTool.d.ts +27 -0
  79. package/dist/rail/editor-tools.d.ts +2 -0
  80. package/dist/rail/rail-env.d.ts +18 -0
  81. package/dist/rail/settings-sections.d.ts +93 -0
  82. package/dist/repos/documents.d.ts +102 -0
  83. package/dist/repos/history.d.ts +24 -0
  84. package/dist/repos/index.d.ts +22 -0
  85. package/dist/repos/spec-import.d.ts +44 -0
  86. package/dist/repos/step-tests.d.ts +19 -0
  87. package/dist/repos/vars.d.ts +25 -0
  88. package/dist/repos/vault.d.ts +24 -0
  89. package/dist/repos/versions.d.ts +112 -0
  90. package/dist/repos.d.ts +2 -0
  91. package/dist/repos.mjs +94 -0
  92. package/dist/repos.mjs.map +1 -0
  93. package/dist/slug-ByKQgxrf.js +642 -0
  94. package/dist/slug-ByKQgxrf.js.map +1 -0
  95. package/dist/spec-import-HgO7ZkLZ.js +898 -0
  96. package/dist/spec-import-HgO7ZkLZ.js.map +1 -0
  97. package/dist/spec-import-invalidation-D3retX4Q.js +18 -0
  98. package/dist/spec-import-invalidation-D3retX4Q.js.map +1 -0
  99. package/dist/use-workflow-draft-oI02dsP-.js +314 -0
  100. package/dist/use-workflow-draft-oI02dsP-.js.map +1 -0
  101. package/package.json +84 -3
  102. package/src/styles.css +829 -0
@@ -0,0 +1,2 @@
1
+ export * from './draft/index'
2
+ export {}
package/dist/draft.mjs ADDED
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { A as s, c as a, i as t, n as i, r as o, u } from "./use-workflow-draft-oI02dsP-.js";
3
+ import { E as n, u as l } from "./client-context-CX61Bgw-.js";
4
+ import { D as E, c, u as d } from "./draft-registry-YF0tqNN0.js";
5
+ export {
6
+ s as AUTOSAVE_DEBOUNCE_MS,
7
+ E as DraftRegistryProvider,
8
+ n as EmbedClientProvider,
9
+ a as createAutoSaver,
10
+ c as createDraftRegistry,
11
+ t as isStaleWrite,
12
+ i as nextSaveToken,
13
+ o as registerFlushOnHide,
14
+ d as useDraftRegistry,
15
+ l as useEmbedClient,
16
+ u as useWorkflowDraft
17
+ };
18
+ //# sourceMappingURL=draft.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,12 @@
1
+ import { ReactNode } from 'react';
2
+ import { WorkflowEditorProps } from './types.ts';
3
+ /**
4
+ * The managed workflow editor. The outermost element is `.w6w-embed-root` (pinned for the embed
5
+ * stylesheet); everything the editor renders — header, canvas, modals, rail — stays a descendant of
6
+ * it, and nothing goes through a portal. It fills its host container (`height: 100%`), so the host
7
+ * decides how tall the editor is.
8
+ *
9
+ * `useEditorProject(props.project)` is the ONLY project source: it feeds the draft, the expression
10
+ * scope, the rail environment and the canvas. `null` (no project) refuses — see `EditorBody`.
11
+ */
12
+ export declare function WorkflowEditor(props: WorkflowEditorProps): ReactNode;
@@ -0,0 +1,17 @@
1
+ import { WorkflowVariableRow } from '../lib/index.ts';
2
+ /**
3
+ * Per-workflow authoring settings (General) plus the Variables tab (T1.1.5) —
4
+ * the workflow's declared `variables` list, its public input schema (HITL-5).
5
+ * Both General flags are on unless the workflow says otherwise and persist
6
+ * immediately (`saveMeta`, via `onChange`); every Variables edit instead goes
7
+ * through the auto-saver (`onVariablesChange` → `patchMeta`, never an
8
+ * immediate save — see the module docstring's Save path decision).
9
+ */
10
+ export declare function WorkflowSettingsModal(props: {
11
+ autoSave: boolean;
12
+ savePosition: boolean;
13
+ variables: WorkflowVariableRow[];
14
+ onClose: () => void;
15
+ onChange: (key: "autoSave" | "savePosition", value: boolean) => void;
16
+ onVariablesChange: (next: WorkflowVariableRow[]) => void;
17
+ }): import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { WorkflowStatus } from '@w6w/sdk';
2
+ import { CallablePolicy, WorkflowSettings, WorkflowVariableRow } from '../lib/index.ts';
3
+ export type Parsed = Record<string, unknown> & {
4
+ id?: string;
5
+ name?: string;
6
+ /** D-1: nullable, no backfill; `undefined` when the field is absent from
7
+ * the text entirely — both mean "no key" to {@link workflowKeyEditAllowed}
8
+ * (D-3). The rail's Key control (`SettingsTool.tsx`) is the only place
9
+ * this is ever ASSIGNED; this page only ever reads it back. */
10
+ key?: string | null;
11
+ steps?: unknown[];
12
+ status?: WorkflowStatus;
13
+ tags?: string[];
14
+ /** Authoring presentation — rides in the definition, no column of its own. */
15
+ settings?: WorkflowSettings;
16
+ /** Declared public input schema (T1.1.5) — see `workflow-variables.ts`. */
17
+ variables?: WorkflowVariableRow[];
18
+ /**
19
+ * The RUN-level error policy (core Workflow RFC — *Amendment — 2026-08-21:
20
+ * the run-level error handler*). Authored from the right rail's Error
21
+ * handling tool, which this page hands a writer to rather than letting it
22
+ * save independently — see the `useWorkspace` call below.
23
+ */
24
+ retry?: CallablePolicy["retry"];
25
+ onError?: CallablePolicy["onError"];
26
+ reroute?: CallablePolicy["reroute"];
27
+ };
28
+ /** Workflow ids: start alphanumeric, then word chars / dots / dashes. */
29
+ export declare const ID_RE: RegExp;
30
+ /** Placeholder + minimum sizing basis for the inline title field. */
31
+ export declare const TITLE_PLACEHOLDER = "Untitled workflow";
@@ -0,0 +1,7 @@
1
+ import { AppSummary } from '@w6w/ui';
2
+ /** The per-app actions query key — byte-identical to Studio's `repos/apps.ts#appActionsKey`. */
3
+ export declare const appActionsKey: (id: string) => readonly ["app-actions", string];
4
+ /** A bounded set of app records by id. Empty when the host's API has no `listAppsByIds`. */
5
+ export declare function useEditorApps(ids: readonly string[]): {
6
+ byId: ReadonlyMap<string, AppSummary>;
7
+ };
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from 'react';
2
+ /** Where the host should take the user. The editor never touches a router: it asks. */
3
+ export type WorkflowEditorNavigation = {
4
+ type: "list";
5
+ } | {
6
+ type: "workflow";
7
+ id: string;
8
+ } | {
9
+ type: "run";
10
+ id: string;
11
+ runId: string;
12
+ };
13
+ export interface WorkflowEditorSlots {
14
+ /** Replaces the built-in execution-profile header wholesale (back, title, run/publish row). */
15
+ header?: ReactNode;
16
+ /** Rendered after the built-in header actions. Ignored when `header` replaces the header. */
17
+ headerActions?: ReactNode;
18
+ /** Label of the back control. Default `"← Workflows"`. */
19
+ backLabel?: string;
20
+ }
21
+ export interface WorkflowEditorProps {
22
+ workflowId: string;
23
+ /**
24
+ * The project this workflow is saved into. Omitted: the `<W6WEmbedProvider project>`. `null` or
25
+ * `""`: no project — the editor shows a notice and refuses to save or publish (it never falls
26
+ * back to the account default).
27
+ */
28
+ project?: string | null;
29
+ /** Open this run on the canvas at mount (and whenever it changes). */
30
+ initialRunId?: string;
31
+ /** Optional (a Next.js server component cannot pass a function); default is a no-op. */
32
+ onNavigate?: (to: WorkflowEditorNavigation) => void;
33
+ slots?: WorkflowEditorSlots;
34
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * `@w6w/embed/editor` — the managed workflow editor. Nothing else is exported from here.
3
+ *
4
+ * The canvas (`@w6w/ui/flow`, with `@xyflow/react`) is reached only through a dynamic `import()`
5
+ * inside `editor/WorkflowEditor.tsx`, so this entry stays light until an editor actually opens.
6
+ * (The built `dist/editor.mjs` carries `"use client";` from the build's entry banner.)
7
+ */
8
+ export { WorkflowEditor } from './editor/WorkflowEditor.tsx';
9
+ export type { WorkflowEditorNavigation, WorkflowEditorProps, WorkflowEditorSlots, } from './editor/types.ts';