@powerhousedao/workflow 6.2.3-dev.78 → 6.2.3-dev.80

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 (107) hide show
  1. package/dist/browser/BlockSelector-DFX-DZHl.js.map +1 -1
  2. package/dist/browser/document-models/index.js +2 -2
  3. package/dist/browser/document-models/workflow/index.js +3 -3
  4. package/dist/browser/{document-models-B2IDRvBZ.js → document-models-DUSvG-I2.js} +2 -2
  5. package/dist/browser/{document-models-B2IDRvBZ.js.map → document-models-DUSvG-I2.js.map} +1 -1
  6. package/dist/browser/{editor-B1-_KRbr.js → editor-BhHN0OWh.js} +2 -2
  7. package/dist/browser/{editor-B1-_KRbr.js.map → editor-BhHN0OWh.js.map} +1 -1
  8. package/dist/browser/{editor-DPGuck1V.js → editor-CnW8q20z.js} +8 -8
  9. package/dist/browser/editor-CnW8q20z.js.map +1 -0
  10. package/dist/browser/{editor-DBcq58Fr.js → editor-NLSJ5rWx.js} +10 -7
  11. package/dist/browser/editor-NLSJ5rWx.js.map +1 -0
  12. package/dist/browser/editors/connection-editor/module.js +1 -1
  13. package/dist/browser/editors/workflow-editor/module.js +1 -1
  14. package/dist/browser/editors/workflow-studio/module.js +1 -1
  15. package/dist/browser/index.js +2 -2
  16. package/dist/browser/{module-DFCANOuI.js → module-DxRdnkW2.js} +47 -5
  17. package/dist/browser/module-DxRdnkW2.js.map +1 -0
  18. package/dist/browser/reactor/index.js +2 -2
  19. package/dist/browser/{trigger-text-B2mo1fiB.js → trigger-text-BIeZ9W1H.js} +22 -2
  20. package/dist/browser/trigger-text-BIeZ9W1H.js.map +1 -0
  21. package/dist/browser/{upgrade-manifests-B62uqKVp.js → upgrade-manifests-bahiFXsr.js} +2 -2
  22. package/dist/browser/{upgrade-manifests-B62uqKVp.js.map → upgrade-manifests-bahiFXsr.js.map} +1 -1
  23. package/dist/browser/{workflow-DjTleFFO.js → workflow-DZt1eS1f.js} +4 -3
  24. package/dist/browser/workflow-DZt1eS1f.js.map +1 -0
  25. package/dist/node/{BlockSelector-DPkwGBjU.mjs → BlockSelector-DosVPXzD.mjs} +2 -2
  26. package/dist/node/BlockSelector-DosVPXzD.mjs.map +1 -0
  27. package/dist/node/{connection-form-BbZWaCDq.mjs → connection-form-Z-pLxxrT.mjs} +2 -2
  28. package/dist/node/{connection-form-BbZWaCDq.mjs.map → connection-form-Z-pLxxrT.mjs.map} +1 -1
  29. package/dist/node/{data-tree-D1JRJF6n.mjs → data-tree-CqBvXMpm.mjs} +2 -2
  30. package/dist/node/{data-tree-D1JRJF6n.mjs.map → data-tree-CqBvXMpm.mjs.map} +1 -1
  31. package/dist/node/document-models/index.mjs +2 -2
  32. package/dist/node/document-models/workflow/index.mjs +3 -3
  33. package/dist/node/{editor-DuVFY-uh.mjs → editor-C3OhQ_xs.mjs} +12 -9
  34. package/dist/node/editor-C3OhQ_xs.mjs.map +1 -0
  35. package/dist/node/{editor-_658x5Mq.mjs → editor-D4-ZHfHJ.mjs} +4 -4
  36. package/dist/node/{editor-_658x5Mq.mjs.map → editor-D4-ZHfHJ.mjs.map} +1 -1
  37. package/dist/node/{editor-Cn6gMioc.mjs → editor-D9S3pWvR.mjs} +9 -9
  38. package/dist/node/editor-D9S3pWvR.mjs.map +1 -0
  39. package/dist/node/editors/connection-editor/module.mjs +1 -1
  40. package/dist/node/editors/workflow-editor/module.mjs +1 -1
  41. package/dist/node/editors/workflow-studio/module.mjs +1 -1
  42. package/dist/node/index.mjs +2 -2
  43. package/dist/node/{module-DV3LLvxo.mjs → module-D9Zx5Zow.mjs} +47 -5
  44. package/dist/node/module-D9Zx5Zow.mjs.map +1 -0
  45. package/dist/node/pieces/reactor/descriptor.json +37 -2
  46. package/dist/node/pieces/reactor/index.mjs +35 -35
  47. package/dist/node/pieces/reactor/package.json +2 -2
  48. package/dist/node/{trigger-text-ByepkzE2.mjs → trigger-text-CmYejeFN.mjs} +24 -4
  49. package/dist/node/trigger-text-CmYejeFN.mjs.map +1 -0
  50. package/dist/node/{upgrade-manifests-CO9zzPnE.mjs → upgrade-manifests-VF8Jt_YR.mjs} +2 -2
  51. package/dist/node/{upgrade-manifests-CO9zzPnE.mjs.map → upgrade-manifests-VF8Jt_YR.mjs.map} +1 -1
  52. package/dist/node/{workflow-BS5m4jtr.mjs → workflow-DqF9VsBQ.mjs} +4 -3
  53. package/dist/node/workflow-DqF9VsBQ.mjs.map +1 -0
  54. package/dist/powerhouse.manifest.json +2 -2
  55. package/dist/style.css +1 -1
  56. package/dist/types/document-models/document-models.d.ts +1 -0
  57. package/dist/types/document-models/document-models.d.ts.map +1 -1
  58. package/dist/types/document-models/workflow/v1/actions.d.ts +1 -0
  59. package/dist/types/document-models/workflow/v1/actions.d.ts.map +1 -1
  60. package/dist/types/document-models/workflow/v1/gen/document-model.d.ts.map +1 -1
  61. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts +3 -0
  62. package/dist/types/document-models/workflow/v1/gen/document-schema.d.ts.map +1 -1
  63. package/dist/types/document-models/workflow/v1/gen/ph-factories.d.ts.map +1 -1
  64. package/dist/types/document-models/workflow/v1/gen/reducer.d.ts.map +1 -1
  65. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts +16 -0
  66. package/dist/types/document-models/workflow/v1/gen/schema/types.d.ts.map +1 -1
  67. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts +3 -1
  68. package/dist/types/document-models/workflow/v1/gen/schema/zod.d.ts.map +1 -1
  69. package/dist/types/document-models/workflow/v1/gen/utils.d.ts.map +1 -1
  70. package/dist/types/document-models/workflow/v1/gen/workflow/actions.d.ts +6 -2
  71. package/dist/types/document-models/workflow/v1/gen/workflow/actions.d.ts.map +1 -1
  72. package/dist/types/document-models/workflow/v1/gen/workflow/creators.d.ts +3 -2
  73. package/dist/types/document-models/workflow/v1/gen/workflow/creators.d.ts.map +1 -1
  74. package/dist/types/document-models/workflow/v1/gen/workflow/operations.d.ts +2 -1
  75. package/dist/types/document-models/workflow/v1/gen/workflow/operations.d.ts.map +1 -1
  76. package/dist/types/document-models/workflow/v1/module.d.ts +1 -0
  77. package/dist/types/document-models/workflow/v1/module.d.ts.map +1 -1
  78. package/dist/types/document-models/workflow/v1/src/reducers/workflow.d.ts.map +1 -1
  79. package/dist/types/document-models/workflow/v1/tests/managed-by.test.d.ts +2 -0
  80. package/dist/types/document-models/workflow/v1/tests/managed-by.test.d.ts.map +1 -0
  81. package/dist/types/editors/shared/DocumentErrorBoundary.d.ts.map +1 -1
  82. package/dist/types/editors/workflow-editor/document/useWorkflowModel.d.ts.map +1 -1
  83. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts +4 -0
  84. package/dist/types/editors/workflow-editor/ui/PublishControls.d.ts.map +1 -1
  85. package/dist/types/editors/workflow-editor/ui/WorkflowEditorApp.d.ts.map +1 -1
  86. package/dist/types/editors/workflow-editor/ui/model.d.ts +5 -0
  87. package/dist/types/editors/workflow-editor/ui/model.d.ts.map +1 -1
  88. package/dist/types/pieces/reactor/index.d.ts.map +1 -1
  89. package/dist/types/pieces/reactor/lib/actions/document-create.d.ts.map +1 -1
  90. package/dist/types/pieces/reactor/lib/actions/index-query.d.ts +12 -0
  91. package/dist/types/pieces/reactor/lib/actions/index-query.d.ts.map +1 -0
  92. package/dist/types/pieces/reactor/lib/documents.d.ts.map +1 -1
  93. package/dist/types/pieces/reactor/lib/documents.test.d.ts +2 -0
  94. package/dist/types/pieces/reactor/lib/documents.test.d.ts.map +1 -0
  95. package/dist/types/pieces/reactor/lib/input-schema.d.ts.map +1 -1
  96. package/package.json +8 -8
  97. package/dist/browser/editor-DBcq58Fr.js.map +0 -1
  98. package/dist/browser/editor-DPGuck1V.js.map +0 -1
  99. package/dist/browser/module-DFCANOuI.js.map +0 -1
  100. package/dist/browser/trigger-text-B2mo1fiB.js.map +0 -1
  101. package/dist/browser/workflow-DjTleFFO.js.map +0 -1
  102. package/dist/node/BlockSelector-DPkwGBjU.mjs.map +0 -1
  103. package/dist/node/editor-Cn6gMioc.mjs.map +0 -1
  104. package/dist/node/editor-DuVFY-uh.mjs.map +0 -1
  105. package/dist/node/module-DV3LLvxo.mjs.map +0 -1
  106. package/dist/node/trigger-text-ByepkzE2.mjs.map +0 -1
  107. package/dist/node/workflow-BS5m4jtr.mjs.map +0 -1
@@ -146,6 +146,26 @@ function ReactorDenialNote(props) {
146
146
  children: ["No reactor access: ", props.denial]
147
147
  });
148
148
  }
149
+ /** Instead of the draft banner on a managed workflow: who keeps it, and that edits here are not saved. */
150
+ function ManagedBanner(props) {
151
+ const manager = props.model.managedBy;
152
+ if (!manager) return null;
153
+ return /* @__PURE__ */ jsxs("div", {
154
+ role: "status",
155
+ className: "pointer-events-auto flex max-w-xl items-center gap-3 rounded-lg border border-solid border-foreground/10 bg-card px-3 py-1.5 text-[13px] shadow-sm",
156
+ children: [/* @__PURE__ */ jsx("span", {
157
+ className: "h-2 w-2 shrink-0 rounded-full bg-muted-foreground",
158
+ "aria-hidden": true
159
+ }), /* @__PURE__ */ jsxs("span", {
160
+ className: "text-foreground",
161
+ children: [
162
+ "Managed by ",
163
+ /* @__PURE__ */ jsx("strong", { children: manager.label || manager.documentType }),
164
+ ". Change it there: edits here are not saved."
165
+ ]
166
+ })]
167
+ });
168
+ }
149
169
  function DraftBanner(props) {
150
170
  if (!hasDraftChanges(props.model)) return null;
151
171
  const { readiness } = props;
@@ -488,6 +508,6 @@ function describeTrigger(trigger) {
488
508
  }
489
509
  }
490
510
  //#endregion
491
- export { StepError as a, PublishState as c, StatusToggle as d, usePublish as f, uniqueStepKey as g, hasDraftChanges as h, DataViewer as i, PublishedMissingNote as l, VARIABLES_VIEW as m, describeSchedule as n, DraftBanner as o, STEP_PARAM as p, describeTrigger as r, PublishButton as s, describeCron as t, ReactorDenialNote as u };
511
+ export { uniqueStepKey as _, StepError as a, PublishButton as c, ReactorDenialNote as d, StatusToggle as f, hasDraftChanges as g, VARIABLES_VIEW as h, DataViewer as i, PublishState as l, STEP_PARAM as m, describeSchedule as n, DraftBanner as o, usePublish as p, describeTrigger as r, ManagedBanner as s, describeCron as t, PublishedMissingNote as u };
492
512
 
493
- //# sourceMappingURL=trigger-text-B2mo1fiB.js.map
513
+ //# sourceMappingURL=trigger-text-BIeZ9W1H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trigger-text-BIeZ9W1H.js","names":[],"sources":["../../editors/workflow-editor/ui/model.ts","../../editors/workflow-editor/ui/PublishControls.tsx","../../editors/workflow-editor/ui/StepError.tsx","../../editors/shared/document-ref.tsx","../../editors/shared/data-viewer.tsx","../../editors/workflow-editor/ui/trigger-text.ts"],"sourcesContent":["// Plain view model + callbacks; no document-model imports so the UI layer\n// stays independent of Powerhouse document plumbing.\nimport type { AddedBlock } from \"./add-follow-up.js\";\nimport type { BlockForm } from \"./forms.js\";\n\nexport type WorkflowStatusValue = \"DRAFT\" | \"ENABLED\" | \"DISABLED\" | \"ARCHIVED\";\n\nexport interface PointModel {\n x: number;\n y: number;\n}\n\nexport type PropertyModeValue = \"MANUAL\" | \"EXPRESSION\";\n\nexport interface PropertySettingModel {\n prop: string;\n mode: PropertyModeValue;\n // A DYNAMIC prop's resolved children, options stripped.\n schema?: unknown;\n}\n\nexport interface TestRecordModel {\n runId: string;\n testedAt: string;\n}\n\n// Editor bookkeeping on a step or the trigger; absent on older documents.\nexport interface BlockStateModel {\n propertySettings?: PropertySettingModel[] | null;\n lastTest?: TestRecordModel | null;\n updatedAt?: string | null;\n}\n\nexport interface TriggerModel extends BlockStateModel {\n id: string;\n pieceName: string;\n pieceVersion: string;\n triggerName: string;\n config: unknown;\n connectionId: string | null;\n // A REACTOR connection, for a trigger that declares requireReactor.\n reactorConnectionId?: string | null;\n}\n\nexport type BackoffKindValue = \"FIXED\" | \"EXPONENTIAL\";\n\nexport interface RetryPolicyModel {\n maxAttempts: number;\n backoff: BackoffKindValue;\n initialDelaySeconds: number;\n maxDelaySeconds: number;\n retryOn: string[];\n}\n\nexport interface StepModel extends BlockStateModel {\n id: string;\n key: string;\n name: string;\n pieceName: string;\n pieceVersion: string;\n actionName: string;\n connectionId: string | null;\n // A REACTOR connection, for an action that declares requireReactor.\n reactorConnectionId?: string | null;\n config: unknown;\n retry: RetryPolicyModel | null;\n timeoutSeconds: number | null;\n idempotencyKeyExpression: string | null;\n position: PointModel | null;\n skip?: boolean;\n}\n\nexport interface EdgeModel {\n id: string;\n from: string;\n to: string;\n port: string;\n condition: string | null;\n}\n\nexport type VariableTypeValue =\n | \"TEXT\"\n | \"NUMBER\"\n | \"BOOLEAN\"\n | \"JSON\"\n | \"SECRET\";\n\nexport interface VariableModel {\n id: string;\n key: string;\n value: unknown;\n description: string | null;\n // Null means untyped: the type is inferred from the value.\n type?: VariableTypeValue | null;\n}\n\nexport interface PublishedBlockModel {\n id: string;\n // The step's name, or \"Trigger\".\n label: string;\n pieceName: string;\n pieceVersion: string;\n kind: \"action\" | \"trigger\";\n name: string;\n reactorConnectionId: string | null;\n}\n\nexport interface PublishedModel {\n version: number;\n publishedAt: string;\n // The snapshot's blocks, trigger first; what actually runs.\n blocks?: PublishedBlockModel[];\n}\n\nexport interface WorkflowModel {\n name: string;\n description?: string | null;\n status: WorkflowStatusValue;\n version: number;\n trigger: TriggerModel | null;\n steps: StepModel[];\n edges: EdgeModel[];\n variables: VariableModel[];\n published?: PublishedModel | null;\n // Writes nothing, bookkeeping included.\n readOnly?: boolean;\n // Kept by another document (an app's integration): shown read-only.\n managedBy?: {\n documentId: string;\n documentType: string;\n label: string;\n } | null;\n}\n\n// The side panel's id for the variables editor, beside step and trigger ids.\nexport const VARIABLES_VIEW = \"__variables\";\n\n/** Query params of the editor's view: the open panel and its tab. */\nexport const STEP_PARAM = \"step\";\nexport const TAB_PARAM = \"tab\";\n\n// Unpublished changes: never published, or edited since.\nexport function hasDraftChanges(\n model: Pick<WorkflowModel, \"version\" | \"published\">,\n): boolean {\n return !model.published || model.published.version !== model.version;\n}\n\nexport interface AddStepInputModel {\n key: string;\n name: string;\n pieceName: string;\n pieceVersion: string;\n actionName: string;\n config: unknown;\n position?: PointModel;\n}\n\nexport interface UpdateStepInputModel {\n id: string;\n key?: string;\n name?: string;\n // \"Update to vZ\" edits only pieceVersion.\n pieceName?: string;\n pieceVersion?: string;\n actionName?: string;\n // null clears the step's connection.\n connectionId?: string | null;\n reactorConnectionId?: string | null;\n config?: unknown;\n // null clears each of these; undefined leaves them unchanged.\n retry?: RetryPolicyModel | null;\n timeoutSeconds?: number | null;\n idempotencyKeyExpression?: string | null;\n position?: PointModel;\n skip?: boolean;\n}\n\n// Field modes and DYNAMIC schemas ride along with the config edit they\n// belong to; undefined leaves them as they are.\nexport interface ConfigExtras {\n propertySettings?: PropertySettingModel[];\n}\n\nexport interface WorkflowEditorCallbacks {\n setName: (name: string) => void;\n setDescription: (description: string) => void;\n setStatus: (status: WorkflowStatusValue) => void;\n setTrigger: (\n input: {\n pieceName: string;\n pieceVersion: string;\n triggerName: string;\n config: unknown;\n connectionId?: string | null;\n reactorConnectionId?: string | null;\n } & ConfigExtras,\n ) => AddedBlock;\n // Field-level trigger edits: each leaves the trigger's other fields alone.\n setTriggerConfig: (config: unknown, extras?: ConfigExtras) => void;\n // null clears a connection; undefined leaves it unchanged.\n setTriggerConnection: (input: {\n connectionId?: string | null;\n reactorConnectionId?: string | null;\n }) => void;\n setTriggerPieceVersion: (pieceVersion: string) => void;\n clearTrigger: () => void;\n addStep: (input: AddStepInputModel) => AddedBlock;\n updateStep: (input: UpdateStepInputModel) => void;\n setStepConfig: (id: string, config: unknown, extras?: ConfigExtras) => void;\n // Snapshots the draft and turns the workflow on; resolves once applied.\n publish: () => Promise<void>;\n discardChanges: () => void;\n removeStep: (id: string) => void;\n addEdge: (input: {\n from: string;\n to: string;\n port: string;\n condition?: string;\n }) => void;\n removeEdge: (id: string) => void;\n // Upserts by id; no id adds a variable. Keys are unique.\n setVariable: (input: {\n id?: string;\n key: string;\n value: unknown;\n description?: string;\n // Undefined leaves the type as is; null clears it.\n type?: VariableTypeValue | null;\n }) => void;\n removeVariable: (id: string) => void;\n // Composite operations backing the canvas add buttons.\n // `port` is the inserted block's own port the old edge's target hangs off.\n insertStepOnEdge: (\n edgeId: string,\n input: AddStepInputModel,\n port: string,\n ) => AddedBlock | undefined;\n appendStep: (\n fromId: string,\n port: string,\n input: AddStepInputModel,\n ) => AddedBlock;\n // Completes a block added before its form loaded: the defaults still unset\n // and the port it continues on. Nothing when the block is gone.\n completeBlock: (added: AddedBlock, form: BlockForm) => void;\n // Copies a step with its config and advanced settings, detached from the\n // graph so no port ends up with two edges.\n duplicateStep: (id: string) => void;\n // Re-parents a step onto a port, keeping whatever follows it.\n moveStep: (move: {\n stepId: string;\n toParentId: string;\n port: string;\n }) => void;\n}\n\n// Slugified step key derived from a label, suffixed until it is free.\nexport function uniqueStepKey(taken: string[], label: string): string {\n const base =\n label\n .toLowerCase()\n .replaceAll(/[^a-z0-9]+/g, \"_\")\n .replaceAll(/^_+|_+$/g, \"\") || \"step\";\n const keys = new Set(taken);\n let key = base;\n let suffix = 2;\n while (keys.has(key)) key = `${base}_${suffix++}`;\n return key;\n}\n","// Publishing, the Activepieces way: a draft that is always editable, a\n// Publish that snapshots it, and an on/off switch for the published flow.\nimport { useState } from \"react\";\nimport { Button, Toggle, Tooltip } from \"../../shared/controls.js\";\nimport {\n hasDraftChanges,\n type WorkflowEditorCallbacks,\n type WorkflowModel,\n type WorkflowStatusValue,\n} from \"./model.js\";\nimport type { WorkflowReadiness } from \"./validation.js\";\n\n// Under enforcement a publish must be signed, or its runs reach no documents.\nexport interface PublishSignIn {\n required: boolean;\n pending: boolean;\n login: () => void;\n}\n\nfunction blockedReason(readiness: WorkflowReadiness): string {\n if (!readiness.hasTrigger) return \"Add a trigger first\";\n if (readiness.firstIncomplete) return \"You have incomplete steps\";\n return \"Checking the steps…\";\n}\n\nexport function usePublish(callbacks: WorkflowEditorCallbacks) {\n const [publishing, setPublishing] = useState(false);\n const [error, setError] = useState<string | null>(null);\n const publish = () => {\n if (publishing) return;\n setPublishing(true);\n setError(null);\n callbacks\n .publish()\n .catch((cause: unknown) =>\n setError(cause instanceof Error ? cause.message : String(cause)),\n )\n .finally(() => setPublishing(false));\n };\n return { publishing, error, publish };\n}\n\nexport function PublishButton(props: {\n model: WorkflowModel;\n readiness: WorkflowReadiness;\n publishing: boolean;\n onPublish: () => void;\n onSelect: (id: string) => void;\n size?: \"sm\" | \"md\";\n signIn?: PublishSignIn;\n}) {\n const { model, readiness } = props;\n if (props.signIn?.required) {\n return (\n <Tooltip content=\"This Switchboard enforces document permissions, so a publish must be signed\">\n <Button\n size={props.size ?? \"sm\"}\n variant=\"primary\"\n disabled={props.signIn.pending}\n onClick={props.signIn.login}\n >\n Sign in to publish\n </Button>\n </Tooltip>\n );\n }\n const incomplete = !readiness.ready;\n const changes = hasDraftChanges(model);\n const target = readiness.firstIncomplete;\n const select = () => {\n if (target) props.onSelect(target);\n };\n return (\n <Tooltip\n enabled={incomplete}\n content={\n <button\n type=\"button\"\n className=\"font-medium text-wf-warn hover:underline\"\n onClick={select}\n >\n {blockedReason(readiness)}\n </button>\n }\n >\n {/* The disabled button passes clicks through to this wrapper. */}\n <span className=\"inline-flex\" onClick={incomplete ? select : undefined}>\n <Button\n size={props.size ?? \"sm\"}\n variant=\"primary\"\n disabled={incomplete || !changes || props.publishing}\n title={!changes && !incomplete ? \"No unpublished changes\" : undefined}\n onClick={props.onPublish}\n >\n {props.publishing ? \"Publishing…\" : \"Publish\"}\n </Button>\n </span>\n </Tooltip>\n );\n}\n\n// A dot and a word: Draft until first published, then Published, or\n// Unpublished changes once the draft moves on.\nexport function PublishState(props: {\n model: Pick<WorkflowModel, \"version\" | \"published\">;\n}) {\n const draft = hasDraftChanges(props.model);\n return (\n <span\n className=\"flex shrink-0 items-center gap-1.5 whitespace-nowrap text-xs text-muted-foreground\"\n title={\n props.model.published\n ? `Published ${new Date(props.model.published.publishedAt).toLocaleString()}`\n : \"Never published\"\n }\n >\n <span\n aria-hidden\n className={`h-2 w-2 rounded-full ${draft ? \"bg-wf-warn\" : \"bg-wf-ok\"}`}\n />\n <span>\n {!props.model.published\n ? \"Draft\"\n : draft\n ? \"Unpublished changes\"\n : \"Published\"}\n </span>\n {props.model.published && draft ? (\n <span className=\"text-muted-foreground/80\">\n · v{props.model.published.version} live\n </span>\n ) : null}\n </span>\n );\n}\n\nexport function StatusToggle(props: {\n published: boolean;\n status: WorkflowStatusValue;\n onChange: (status: WorkflowStatusValue) => void;\n tooltipSide?: \"below\" | \"left\";\n}) {\n // Nothing runs until the first publish.\n const allowed = props.published;\n const on = props.status === \"ENABLED\";\n return (\n <Tooltip\n enabled={!allowed}\n content=\"Publish the workflow first\"\n align=\"end\"\n side={props.tooltipSide}\n >\n <span className=\"flex items-center gap-2 text-xs text-muted-foreground\">\n <Toggle\n checked={on}\n disabled={!allowed}\n label={on ? \"Turn the workflow off\" : \"Turn the workflow on\"}\n onChange={(checked) =>\n props.onChange(checked ? \"ENABLED\" : \"DISABLED\")\n }\n />\n <span className=\"w-6\">{on ? \"On\" : \"Off\"}</span>\n </span>\n </Tooltip>\n );\n}\n\n// The live snapshot's blocks that need a reactor connection and bind none.\nexport function PublishedMissingNote(props: { missing: readonly string[] }) {\n if (props.missing.length === 0) return null;\n return (\n <span\n role=\"alert\"\n aria-label=\"Published version incomplete\"\n className=\"shrink-0 whitespace-nowrap rounded-full bg-wf-warn/12 px-2 py-0.5 text-xs text-wf-warn\"\n title={`The published version is missing a reactor connection on: ${props.missing.join(\", \")}`}\n >\n Live version incomplete\n </span>\n );\n}\n\n// Why the runtime won't give the published workflow reactor access.\nexport function ReactorDenialNote(props: { denial: string | null }) {\n if (!props.denial) return null;\n return (\n <span\n role=\"alert\"\n aria-label=\"Reactor access denied\"\n className=\"max-w-80 truncate rounded-full bg-wf-warn/12 px-2 py-0.5 text-xs text-wf-warn\"\n title={props.denial}\n >\n No reactor access: {props.denial}\n </span>\n );\n}\n\n/** Instead of the draft banner on a managed workflow: who keeps it, and that edits here are not saved. */\nexport function ManagedBanner(props: { model: WorkflowModel }) {\n const manager = props.model.managedBy;\n if (!manager) return null;\n return (\n <div\n role=\"status\"\n className=\"pointer-events-auto flex max-w-xl items-center gap-3 rounded-lg border border-solid border-foreground/10 bg-card px-3 py-1.5 text-[13px] shadow-sm\"\n >\n <span\n className=\"h-2 w-2 shrink-0 rounded-full bg-muted-foreground\"\n aria-hidden\n />\n <span className=\"text-foreground\">\n Managed by <strong>{manager.label || manager.documentType}</strong>.\n Change it there: edits here are not saved.\n </span>\n </div>\n );\n}\n\nexport function DraftBanner(props: {\n model: WorkflowModel;\n readiness: WorkflowReadiness;\n publishing: boolean;\n error: string | null;\n onPublish: () => void;\n onDiscard: () => void;\n onSelect: (id: string) => void;\n signIn?: PublishSignIn;\n}) {\n if (!hasDraftChanges(props.model)) return null;\n const { readiness } = props;\n const target = readiness.firstIncomplete;\n return (\n <div\n role=\"status\"\n className=\"pointer-events-auto flex items-center gap-3 rounded-lg border border-solid border-foreground/10 bg-card py-1.5 pl-3 pr-1.5 text-[13px] shadow-sm\"\n >\n <span className=\"h-2 w-2 shrink-0 rounded-full bg-wf-warn\" aria-hidden />\n <span className=\"text-foreground\">You have unpublished changes</span>\n {props.error ? (\n <span className=\"text-xs text-wf-fail\">{props.error}</span>\n ) : null}\n {!readiness.hasTrigger || target ? (\n <span className=\"flex items-center gap-1.5 text-xs text-wf-warn\">\n <span>{target ? \"Incomplete steps\" : \"No trigger yet\"}</span>\n {target ? (\n <button\n type=\"button\"\n className=\"font-medium underline underline-offset-2 hover:no-underline\"\n onClick={() => props.onSelect(target)}\n >\n Show\n </button>\n ) : null}\n </span>\n ) : null}\n <span className=\"flex items-center gap-1\">\n {props.model.published ? (\n <Button size=\"sm\" variant=\"ghost\" onClick={props.onDiscard}>\n Discard changes\n </Button>\n ) : null}\n <PublishButton\n model={props.model}\n readiness={readiness}\n publishing={props.publishing}\n onPublish={props.onPublish}\n onSelect={props.onSelect}\n signIn={props.signIn}\n />\n </span>\n </div>\n );\n}\n","// A step's error from a run.\nexport function StepError(props: { error: string }) {\n return (\n <pre className=\"overflow-auto whitespace-pre-wrap rounded-md bg-wf-fail/10 p-2.5 text-xs text-wf-fail\">\n {props.error}\n </pre>\n );\n}\n","// The documents a run's data references: the run journal keeps a reference\n// (id, type, branch, revision) in place of a document's state.\nimport type { DocumentReference } from \"@powerhousedao/pieces-framework/workflow\";\nimport { useSetSelectedNode } from \"@powerhousedao/reactor-browser\";\nimport { Button } from \"./controls.js\";\n\n// Beyond this many, the rest are counted.\nconst SHOWN = 3;\n\nfunction shortId(id: string): string {\n return id.length > 16 ? `${id.slice(0, 6)}…${id.slice(-6)}` : id;\n}\n\nfunction revisionText(reference: DocumentReference): string {\n const scopes = Object.entries(reference.revision)\n .map(([scope, count]) => `${scope} ${count}`)\n .join(\" · \");\n return reference.branch === \"main\"\n ? scopes\n : `${reference.branch}: ${scopes}`;\n}\n\nfunction DocumentRefRow(props: { reference: DocumentReference }) {\n const { reference } = props;\n const setSelectedNode = useSetSelectedNode();\n return (\n <li\n aria-label={`Document ${reference.documentId}`}\n className=\"flex items-center gap-2\"\n >\n <div className=\"min-w-0 flex-1 text-xs\">\n <div className=\"flex min-w-0 items-baseline gap-1.5\">\n <span className=\"truncate font-medium text-foreground\">\n {reference.documentType}\n </span>\n <span\n className=\"shrink-0 font-mono text-[11px] text-muted-foreground\"\n title={reference.documentId}\n >\n {shortId(reference.documentId)}\n </span>\n </div>\n <div className=\"truncate text-[11px] text-muted-foreground\">\n Revision {revisionText(reference)}\n </div>\n </div>\n <Button\n size=\"sm\"\n onClick={() => setSelectedNode(reference.documentId)}\n aria-label={`Open document ${reference.documentId}`}\n >\n Open document\n </Button>\n </li>\n );\n}\n\nexport function DocumentRefs(props: { references: DocumentReference[] }) {\n const { references } = props;\n const hidden = references.length - SHOWN;\n return (\n <div\n role=\"group\"\n aria-label=\"Document references\"\n className=\"flex flex-col gap-1.5\"\n >\n <ul className=\"m-0 flex list-none flex-col gap-1.5 p-0\">\n {references.slice(0, SHOWN).map((reference, index) => (\n <DocumentRefRow\n key={`${reference.documentId}-${index}`}\n reference={reference}\n />\n ))}\n </ul>\n {hidden > 0 ? (\n <p className=\"text-[11px] text-muted-foreground\">\n and {hidden} more in the data below\n </p>\n ) : null}\n <p className=\"text-[11px] text-muted-foreground\">\n The run kept a reference, not the state. Opening shows the document as\n it is now: past revisions can&apos;t be read yet (#3179).\n </p>\n </div>\n );\n}\n","// A run's data (a step's input or output, a trigger payload) as a foldable\n// tree, with a raw JSON view and, given a root, per-key {{references}}.\nimport {\n DOCUMENT_REF_KEY,\n documentRefsIn,\n isDocumentRefMarker,\n} from \"@powerhousedao/pieces-framework/workflow\";\nimport { lazy, Suspense, useState } from \"react\";\nimport { IconButton } from \"./controls.js\";\nimport { DocumentRefs } from \"./document-ref.js\";\n\nconst DataTree = lazy(() => import(\"./data-tree.js\"));\n\nfunction stringify(value: unknown): string {\n try {\n // undefined for functions and symbols, despite the typing.\n return (JSON.stringify(value, null, 2) as string | undefined) ?? \"\";\n } catch {\n return String(value as string);\n }\n}\n\nfunction isEmpty(value: unknown): boolean {\n if (value === undefined || value === null) return true;\n if (typeof value === \"object\") return Object.keys(value).length === 0;\n return false;\n}\n\nfunction RawJson(props: { text: string }) {\n return (\n <pre className=\"max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-xs text-foreground\">\n {props.text}\n </pre>\n );\n}\n\n// Stands in while the tree's chunk loads.\nfunction TreeSkeleton() {\n return (\n <div\n role=\"status\"\n aria-label=\"Loading data\"\n className=\"flex animate-pulse flex-col gap-2 py-1\"\n >\n {[\"w-2/5\", \"w-3/5\", \"w-1/2\", \"w-1/3\"].map((width, index) => (\n <span\n key={width}\n className={`h-2.5 rounded bg-muted ${width}`}\n style={{ marginLeft: index === 0 ? 0 : 16 }}\n />\n ))}\n </div>\n );\n}\n\nexport function DataViewer(props: {\n label: string;\n value: unknown;\n // Expression prefix for this value, e.g. \"steps.fetch.output\".\n root?: string;\n emptyText?: string;\n}) {\n const [raw, setRaw] = useState(false);\n const [copied, setCopied] = useState(false);\n const empty = isEmpty(props.value);\n const text = stringify(props.value);\n const tree = typeof props.value === \"object\" && props.value !== null;\n const references = tree ? documentRefsIn(props.value) : [];\n // A whole value that is a reference shows as one; its other keys stay a tree.\n const treeValue = isDocumentRefMarker(props.value)\n ? Object.fromEntries(\n Object.entries(props.value).filter(([key]) => key !== DOCUMENT_REF_KEY),\n )\n : props.value;\n\n return (\n <section\n aria-label={props.label}\n className=\"min-w-0 rounded-md border border-solid border-border bg-card\"\n >\n <header className=\"flex h-8 items-center gap-1 border-b border-solid border-border pl-3 pr-1\">\n <h4 className=\"mr-auto text-xs font-medium text-foreground\">\n {props.label}\n </h4>\n {!empty && tree ? (\n <button\n type=\"button\"\n aria-pressed={raw}\n className=\"rounded px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40\"\n onClick={() => setRaw((value) => !value)}\n >\n {raw ? \"Tree\" : \"JSON\"}\n </button>\n ) : null}\n {!empty ? (\n <IconButton\n icon={copied ? \"check\" : \"copy\"}\n label={`Copy ${props.label.toLowerCase()} as JSON`}\n onClick={() => {\n void navigator.clipboard.writeText(text).then(() => {\n setCopied(true);\n setTimeout(() => setCopied(false), 1500);\n });\n }}\n />\n ) : null}\n </header>\n <div className=\"px-3 py-2\">\n {empty ? (\n <p className=\"text-xs text-muted-foreground\">\n {props.emptyText ?? \"Nothing\"}\n </p>\n ) : !tree ? (\n <p className=\"break-words font-mono text-xs text-foreground\">\n {text}\n </p>\n ) : raw ? (\n <RawJson text={text} />\n ) : (\n <div className=\"flex flex-col gap-2\">\n {references.length > 0 ? (\n <DocumentRefs references={references} />\n ) : null}\n {isEmpty(treeValue) ? null : (\n <div className=\"max-h-72 overflow-auto\">\n <Suspense fallback={<TreeSkeleton />}>\n <DataTree value={treeValue as object} root={props.root} />\n </Suspense>\n </div>\n )}\n </div>\n )}\n </div>\n </section>\n );\n}\n","// Plain-language descriptions of when a workflow starts: \"Every day at\n// 08:00 UTC\" rather than \"0 8 * * *\". Unknown shapes fall back to the raw text.\nimport { blockKey } from \"@powerhousedao/pieces-framework/block-type\";\nimport { blockMeta } from \"./block-meta.js\";\nimport {\n MANUAL_TRIGGER,\n REACTOR_PIECE,\n SCHEDULE_TRIGGER,\n WEBHOOK_TRIGGER,\n} from \"./blocks.js\";\nimport { parseScheduleConfig } from \"@powerhousedao/pieces-framework/workflow\";\n\nconst WEEKDAYS = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\",\n];\n\nconst UNIT_LABEL: Record<string, [string, string]> = {\n minutes: [\"minute\", \"minutes\"],\n hours: [\"hour\", \"hours\"],\n days: [\"day\", \"days\"],\n};\n\nfunction isInt(field: string): boolean {\n return /^\\d+$/.test(field);\n}\n\nfunction clock(hour: string, minute: string): string {\n return `${hour.padStart(2, \"0\")}:${minute.padStart(2, \"0\")}`;\n}\n\nfunction dayList(field: string): string | undefined {\n if (field === \"1-5\") return \"on weekdays\";\n if (field === \"0,6\" || field === \"6,0\") return \"at weekends\";\n const days = field.split(\",\");\n if (!days.every((day) => isInt(day) && Number(day) <= 7)) return undefined;\n const names = days.map((day) => WEEKDAYS[Number(day) % 7]);\n if (names.length === 1) return `every ${names[0]}`;\n return `on ${names.slice(0, -1).join(\", \")} and ${names[names.length - 1]}`;\n}\n\n/** Describes a five-field cron expression, or returns undefined. */\nexport function describeCron(cron: string): string | undefined {\n const fields = cron.trim().split(/\\s+/);\n if (fields.length !== 5) return undefined;\n const [minute, hour, dayOfMonth, month, dayOfWeek] = fields;\n if (month !== \"*\") return undefined;\n\n const everyMinutes = /^\\*\\/(\\d+)$/.exec(minute);\n if (everyMinutes && hour === \"*\" && dayOfMonth === \"*\" && dayOfWeek === \"*\") {\n const n = Number(everyMinutes[1]);\n return n === 1 ? \"Every minute\" : `Every ${n} minutes`;\n }\n if (minute === \"*\" && hour === \"*\" && dayOfMonth === \"*\" && dayOfWeek === \"*\")\n return \"Every minute\";\n if (isInt(minute) && hour === \"*\" && dayOfMonth === \"*\" && dayOfWeek === \"*\")\n return minute === \"0\"\n ? \"Every hour, on the hour\"\n : `Every hour at ${minute.padStart(2, \"0\")} past`;\n\n const everyHours = /^\\*\\/(\\d+)$/.exec(hour);\n if (isInt(minute) && everyHours && dayOfMonth === \"*\" && dayOfWeek === \"*\") {\n return `Every ${everyHours[1]} hours`;\n }\n if (!isInt(minute) || !isInt(hour)) return undefined;\n const at = clock(hour, minute);\n\n if (dayOfMonth === \"*\" && dayOfWeek === \"*\") return `Every day at ${at}`;\n if (dayOfMonth === \"*\") {\n const days = dayList(dayOfWeek);\n return days\n ? `${days.charAt(0).toUpperCase()}${days.slice(1)} at ${at}`\n : undefined;\n }\n if (isInt(dayOfMonth) && dayOfWeek === \"*\") {\n return `Every month on day ${dayOfMonth} at ${at}`;\n }\n return undefined;\n}\n\nexport function describeSchedule(config: unknown): string {\n let schedule;\n try {\n schedule = parseScheduleConfig(config);\n } catch {\n return \"On a schedule that does not parse\";\n }\n if (schedule.mode === \"interval\") {\n const unit = UNIT_LABEL[schedule.unit];\n return schedule.every === 1\n ? `Every ${unit[0]}`\n : `Every ${schedule.every} ${unit[1]}`;\n }\n const described = describeCron(schedule.cron);\n return described\n ? `${described} ${schedule.timezone}`\n : `On schedule ${schedule.cron}`;\n}\n\n// A literal config value; an expression or a blank says nothing to show.\nfunction literal(config: unknown, key: string): string | undefined {\n if (!config || typeof config !== \"object\") return undefined;\n const value = (config as Record<string, unknown>)[key];\n if (typeof value !== \"string\") return undefined;\n const text = value.trim();\n return text && !text.includes(\"{{\") ? text : undefined;\n}\n\n// \"umh/production-ledger\" reads as \"Production Ledger\".\nfunction documentTypeLabel(documentType: string): string {\n const name = documentType.split(\"/\").pop() ?? documentType;\n return name\n .split(/[-_\\s]+/)\n .filter(Boolean)\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}\n\n// \"APPROVE_ORDER\" reads as \"Approve order\".\nfunction actionTypeLabel(actionType: string): string {\n const words = actionType\n .toLowerCase()\n .split(/[_\\s]+/)\n .filter(Boolean);\n const text = words.join(\" \");\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\n/** Describes a reactor document trigger by what it filters on. */\nexport function describeDocumentTrigger(\n triggerName: string,\n config: unknown,\n): string | undefined {\n const documentType = literal(config, \"documentType\");\n const label = documentType ? documentTypeLabel(documentType) : \"\";\n const subject = label\n ? `${/^[AEIOU]/.test(label) ? \"an\" : \"a\"} ${label}`\n : literal(config, \"documentId\")\n ? \"its document\"\n : \"a document\";\n switch (triggerName) {\n case \"document-event\": {\n const actionType = literal(config, \"actionType\");\n return actionType\n ? `When ${actionTypeLabel(actionType)} runs on ${subject}`\n : `When ${subject} changes`;\n }\n case \"document-created\":\n return `When ${subject} is created`;\n case \"document-deleted\":\n return `When ${subject} is deleted`;\n default:\n return undefined;\n }\n}\n\n/** When a workflow starts, from its trigger. */\nexport function describeTrigger(\n trigger:\n | { pieceName: string; triggerName: string; config: unknown }\n | null\n | undefined,\n): string {\n if (!trigger) return \"Never starts: no trigger\";\n const block = {\n pieceName: trigger.pieceName,\n kind: \"trigger\" as const,\n name: trigger.triggerName,\n };\n switch (blockKey(block)) {\n case blockKey(MANUAL_TRIGGER):\n return \"Manual\";\n case blockKey(WEBHOOK_TRIGGER):\n return \"When its webhook is called\";\n case blockKey(SCHEDULE_TRIGGER):\n return describeSchedule(trigger.config);\n default: {\n if (trigger.pieceName === REACTOR_PIECE) {\n const described = describeDocumentTrigger(\n trigger.triggerName,\n trigger.config,\n );\n if (described) return described;\n }\n const meta = blockMeta(block);\n const piece = meta.subtitle.replace(/ · Trigger$/, \"\");\n return `${meta.displayName} in ${piece}`;\n }\n }\n}\n"],"mappings":";;;;;;;;AAuIA,MAAa,iBAAiB;;AAG9B,MAAa,aAAa;AAI1B,SAAgB,gBACd,OACS;CACT,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,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC;AACpD;;AAGA,SAAgB,wBACd,aACA,QACoB;CACpB,MAAM,eAAe,QAAQ,QAAQ,cAAc;CACnD,MAAM,QAAQ,eAAe,kBAAkB,YAAY,IAAI;CAC/D,MAAM,UAAU,QACZ,GAAG,WAAW,KAAK,KAAK,IAAI,OAAO,IAAI,GAAG,UAC1C,QAAQ,QAAQ,YAAY,IAC1B,iBACA;CACN,QAAQ,aAAR;EACE,KAAK,kBAAkB;GACrB,MAAM,aAAa,QAAQ,QAAQ,YAAY;GAC/C,OAAO,aACH,QAAQ,gBAAgB,UAAU,EAAE,WAAW,YAC/C,QAAQ,QAAQ;EACtB;EACA,KAAK,oBACH,OAAO,QAAQ,QAAQ;EACzB,KAAK,oBACH,OAAO,QAAQ,QAAQ;EACzB,SACE;CACJ;AACF;;AAGA,SAAgB,gBACd,SAIQ;CACR,IAAI,CAAC,SAAS,OAAO;CACrB,MAAM,QAAQ;EACZ,WAAW,QAAQ;EACnB,MAAM;EACN,MAAM,QAAQ;CAChB;CACA,QAAQ,SAAS,KAAK,GAAtB;EACE,KAAK,SAAS,cAAc,GAC1B,OAAO;EACT,KAAK,SAAS,eAAe,GAC3B,OAAO;EACT,KAAK,SAAS,gBAAgB,GAC5B,OAAO,iBAAiB,QAAQ,MAAM;EACxC,SAAS;GACP,IAAI,QAAQ,cAAA,gCAA6B;IACvC,MAAM,YAAY,wBAChB,QAAQ,aACR,QAAQ,MACV;IACA,IAAI,WAAW,OAAO;GACxB;GACA,MAAM,OAAO,UAAU,KAAK;GAC5B,MAAM,QAAQ,KAAK,SAAS,QAAQ,eAAe,EAAE;GACrD,OAAO,GAAG,KAAK,YAAY,MAAM;EACnC;CACF;AACF"}
@@ -1,8 +1,8 @@
1
1
  import { m as connectionUpgradeManifest } from "./module-FuSfFXPT.js";
2
- import { m as workflowUpgradeManifest } from "./module-DFCANOuI.js";
2
+ import { m as workflowUpgradeManifest } from "./module-DxRdnkW2.js";
3
3
  //#region document-models/upgrade-manifests.ts
4
4
  const upgradeManifests = [connectionUpgradeManifest, workflowUpgradeManifest];
5
5
  //#endregion
6
6
  export { upgradeManifests as t };
7
7
 
8
- //# sourceMappingURL=upgrade-manifests-B62uqKVp.js.map
8
+ //# sourceMappingURL=upgrade-manifests-bahiFXsr.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-manifests-B62uqKVp.js","names":[],"sources":["../../document-models/upgrade-manifests.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { connectionUpgradeManifest } from \"document-models/connection/upgrades\";\nimport { workflowUpgradeManifest } from \"document-models/workflow/upgrades\";\n\nexport const upgradeManifests: UpgradeManifest<readonly number[]>[] = [\n connectionUpgradeManifest,\n workflowUpgradeManifest,\n];\n"],"mappings":";;;AAQA,MAAa,mBAAyD,CACpE,2BACA,uBACF"}
1
+ {"version":3,"file":"upgrade-manifests-bahiFXsr.js","names":[],"sources":["../../document-models/upgrade-manifests.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { UpgradeManifest } from \"document-model\";\nimport { connectionUpgradeManifest } from \"document-models/connection/upgrades\";\nimport { workflowUpgradeManifest } from \"document-models/workflow/upgrades\";\n\nexport const upgradeManifests: UpgradeManifest<readonly number[]>[] = [\n connectionUpgradeManifest,\n workflowUpgradeManifest,\n];\n"],"mappings":";;;AAQA,MAAa,mBAAyD,CACpE,2BACA,uBACF"}
@@ -1,4 +1,4 @@
1
- import { a as utils, d as isWorkflowDocument, l as assertIsWorkflowDocument, t as Workflow } from "./module-DFCANOuI.js";
1
+ import { a as utils, d as isWorkflowDocument, l as assertIsWorkflowDocument, t as Workflow } from "./module-DxRdnkW2.js";
2
2
  import { useDocumentById, useDocumentsInSelectedDrive, useDocumentsInSelectedFolder, useSelectedDocument } from "@powerhousedao/reactor-browser";
3
3
  import { PHDocumentController, createBaseState, defaultBaseState } from "document-model";
4
4
  //#region document-models/workflow/v1/gen/controller.ts
@@ -37,7 +37,8 @@ function defaultGlobalState() {
37
37
  },
38
38
  published: null,
39
39
  lastRunAt: null,
40
- lastRunStatus: null
40
+ lastRunStatus: null,
41
+ managedBy: null
41
42
  };
42
43
  }
43
44
  function defaultLocalState() {
@@ -105,4 +106,4 @@ function useWorkflowDocumentsInSelectedFolder() {
105
106
  //#endregion
106
107
  export { createState$1 as a, defaultLocalState as c, useWorkflowDocumentsInSelectedFolder as i, defaultPHState as l, useWorkflowDocumentById as n, createWorkflowDocument as o, useWorkflowDocumentsInSelectedDrive as r, defaultGlobalState as s, useSelectedWorkflowDocument as t, WorkflowController as u };
107
108
 
108
- //# sourceMappingURL=workflow-DjTleFFO.js.map
109
+ //# sourceMappingURL=workflow-DZt1eS1f.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-DZt1eS1f.js","names":["createState"],"sources":["../../document-models/workflow/v1/gen/controller.ts","../../document-models/workflow/v1/gen/ph-factories.ts","../../document-models/workflow/v1/hooks.ts"],"sourcesContent":["/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport { PHDocumentController } from \"document-model\";\nimport { Workflow } from \"../module.js\";\nimport type { WorkflowAction, WorkflowPHState } from \"./types.js\";\n\nexport const WorkflowController = PHDocumentController.forDocumentModel<\n WorkflowPHState,\n WorkflowAction\n>(Workflow);\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n * Factory methods for creating WorkflowDocument instances\n */\nimport type { PHAuthState, PHBaseState, PHDocumentState } from \"document-model\";\nimport { createBaseState, defaultBaseState } from \"document-model\";\nimport type {\n WorkflowDocument,\n WorkflowGlobalState,\n WorkflowLocalState,\n WorkflowPHState,\n} from \"./types.js\";\nimport { utils } from \"./utils.js\";\n\nexport function defaultGlobalState(): WorkflowGlobalState {\n return {\n name: \"\",\n description: null,\n status: \"DRAFT\",\n version: 0,\n trigger: null,\n steps: [],\n edges: [],\n variables: [],\n policy: {\n concurrency: \"QUEUE\",\n maxParallelRuns: null,\n runTimeoutSeconds: 3600,\n maxSuspensionDays: 30,\n defaultRetry: {\n maxAttempts: 1,\n backoff: \"FIXED\",\n initialDelaySeconds: 5,\n maxDelaySeconds: 300,\n retryOn: [],\n },\n onFailure: \"PARK\",\n retainRunsDays: 30,\n journalAsDocument: false,\n },\n published: null,\n lastRunAt: null,\n lastRunStatus: null,\n managedBy: null,\n };\n}\n\nexport function defaultLocalState(): WorkflowLocalState {\n return {};\n}\n\nexport function defaultPHState(): WorkflowPHState {\n return {\n ...defaultBaseState(),\n global: defaultGlobalState(),\n local: defaultLocalState(),\n };\n}\n\nexport function createGlobalState(\n state?: Partial<WorkflowGlobalState>,\n): WorkflowGlobalState {\n return {\n ...defaultGlobalState(),\n ...(state || {}),\n };\n}\n\nexport function createLocalState(\n state?: Partial<WorkflowLocalState>,\n): WorkflowLocalState {\n return {\n ...defaultLocalState(),\n ...(state || {}),\n } as WorkflowLocalState;\n}\n\nexport function createState(\n baseState?: Partial<PHBaseState>,\n globalState?: Partial<WorkflowGlobalState>,\n localState?: Partial<WorkflowLocalState>,\n): WorkflowPHState {\n return {\n ...createBaseState(baseState?.auth, baseState?.document),\n global: createGlobalState(globalState),\n local: createLocalState(localState),\n };\n}\n\n/**\n * Creates a WorkflowDocument with custom global and local state\n * This properly handles the PHBaseState requirements while allowing\n * document-specific state to be set.\n */\nexport function createWorkflowDocument(\n state?: Partial<{\n auth?: Partial<PHAuthState>;\n document?: Partial<PHDocumentState>;\n global?: Partial<WorkflowGlobalState>;\n local?: Partial<WorkflowLocalState>;\n }>,\n): WorkflowDocument {\n const document = utils.createDocument(\n createState(\n createBaseState(state?.auth, { version: 1, ...state?.document }),\n state?.global,\n state?.local,\n ),\n );\n\n return document;\n}\n","/**\n * WARNING: DO NOT EDIT\n * This file is auto-generated and updated by codegen\n */\nimport type { DocumentDispatch } from \"@powerhousedao/reactor-browser\";\nimport {\n useDocumentById,\n useDocumentsInSelectedDrive,\n useDocumentsInSelectedFolder,\n useSelectedDocument,\n} from \"@powerhousedao/reactor-browser\";\nimport type {\n WorkflowAction,\n WorkflowDocument,\n} from \"document-models/workflow/v1\";\nimport {\n assertIsWorkflowDocument,\n isWorkflowDocument,\n} from \"./gen/document-schema.js\";\n\n/** Hook to get a Workflow document by its id */\nexport function useWorkflowDocumentById(\n documentId: string | null | undefined,\n):\n | [WorkflowDocument, DocumentDispatch<WorkflowAction>]\n | [undefined, undefined] {\n const [document, dispatch] = useDocumentById(documentId);\n if (!isWorkflowDocument(document)) return [undefined, undefined];\n return [document, dispatch];\n}\n\n/** Hook to get the selected Workflow document */\nexport function useSelectedWorkflowDocument(): [\n WorkflowDocument,\n DocumentDispatch<WorkflowAction>,\n] {\n const [document, dispatch] = useSelectedDocument();\n\n assertIsWorkflowDocument(document);\n return [document, dispatch] as const;\n}\n\n/** Hook to get all Workflow documents in the selected drive */\nexport function useWorkflowDocumentsInSelectedDrive() {\n const documentsInSelectedDrive = useDocumentsInSelectedDrive();\n return documentsInSelectedDrive?.filter(isWorkflowDocument);\n}\n\n/** Hook to get all Workflow documents in the selected folder */\nexport function useWorkflowDocumentsInSelectedFolder() {\n const documentsInSelectedFolder = useDocumentsInSelectedFolder();\n return documentsInSelectedFolder?.filter(isWorkflowDocument);\n}\n"],"mappings":";;;;;;;;AAQA,MAAa,qBAAqB,qBAAqB,iBAGrD,QAAQ;;;ACIV,SAAgB,qBAA0C;CACxD,OAAO;EACL,MAAM;EACN,aAAa;EACb,QAAQ;EACR,SAAS;EACT,SAAS;EACT,OAAO,CAAC;EACR,OAAO,CAAC;EACR,WAAW,CAAC;EACZ,QAAQ;GACN,aAAa;GACb,iBAAiB;GACjB,mBAAmB;GACnB,mBAAmB;GACnB,cAAc;IACZ,aAAa;IACb,SAAS;IACT,qBAAqB;IACrB,iBAAiB;IACjB,SAAS,CAAC;GACZ;GACA,WAAW;GACX,gBAAgB;GACh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
  return useContext(PieceSourceContext);
6041
6041
  }
6042
6042
  //#endregion
6043
- //#region ../reactor/dist/drive-container-types-CxMkWpTJ.js
6043
+ //#region ../reactor/dist/drive-container-types-CC0dU3AF.js
6044
6044
  const DRIVE_COLLECTION_PREFIX = "drive.";
6045
6045
  /**
6046
6046
  * Identifies the collection a remote synchronizes. Collections are drive-level
@@ -8597,4 +8597,4 @@ function BlockSelector(props) {
8597
8597
  //#endregion
8598
8598
  export { useTestStepRunner as $, runStats as A, IconButton as At, useBlockForms as B, Icon as Bt, canRerun as C, ITEM_PARAM as Ct, formatMs as D, FieldError as Dt, formatDuration as E, Button as Et, toneOf as F, Toggle as Ft, useDesignTime as G, useQuery as Gt, useBlockResolutions as H, DocumentErrorBoundary as Ht, workflowHealth as I, Tooltip as It, useDynamicPrefetch as J, useDynamicCache as K, DesignTimeProvider as L, invalidClass as Lt, runTimeline as M, Select as Mt, runTone as N, Switch as Nt, formatTrigger as O, FieldLabel as Ot, statusLabel as P, Tabs$1 as Pt, useRunById as Q, useBlockForm as R, textAreaClass as Rt, TONE_TEXT as S, useSecretStat as St, formatAbsolute as T, useSearchParamDraft as Tt, useCachedBlockForm as U, DocumentLoadError as Ut, useBlockPorts as V, isIconName as Vt, useConnectionList as W, errorMessage as Wt, useOptionSearch as X, useLatestRun as Y, useResolvedProp as Z, CONNECTION_TONE as _, useRunPagesQuery as _t, BlockResolutionsProvider as a, parsePropList as at, STEP_TONE as b, useRuntime as bt, runsDifferentVersion as c, storedSchema as ct, versionBadge as d, withSetting as dt, useTestTrigger as et, blockMeta as f, workflowReadiness as ft, usePieceLogos as g, usePieceCatalog as gt, useBlockMeta as h, useOAuthRedirectUri as ht, PickerPopover as i, isPropVisible as it, runStatusLabel as j, Segmented as jt, formatWhen as k, Hint as kt, updateVersion as l, stripOptions as lt, pieceLogo as m, useOAuthAttempt as mt, BlockSelector as n, blockMissing as nt, VersionSummary as o, resolverInputFor as ot, pieceDisplayName as p, WorkflowRuntimeProvider as pt, useDynamicLookup as q, PICKER_SIZE as r, isEmptyValue as rt, resolutionText as s, settingFor as st, BlockLogo as t, useWebhookEndpoint as tt, useResolution as u, undeclaredPortIssues as ut, RUN_STATUSES as v, useRunQuery as vt, durationMs as w, useSearchParam as wt, TONE_DOT as x, useRuntimeActions as xt, RUN_TONE as y, useRunsQuery as yt, useBlockFormLoader as z, textInputClass as zt };
8599
8599
 
8600
- //# sourceMappingURL=BlockSelector-DPkwGBjU.mjs.map
8600
+ //# sourceMappingURL=BlockSelector-DosVPXzD.mjs.map