openmates 0.27.0-alpha.7 → 0.27.0-alpha.8

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.
@@ -16791,6 +16791,7 @@ var OpenMatesClient = class _OpenMatesClient {
16791
16791
  );
16792
16792
  }
16793
16793
  async resolveWorkflowId(query, options = {}) {
16794
+ if (CANONICAL_UUID_PATTERN.test(query)) return query;
16794
16795
  const workflows = await this.listWorkflows(options);
16795
16796
  const exactId = workflows.find((workflow) => workflow.id === query);
16796
16797
  if (exactId) return exactId.id;
@@ -16889,6 +16890,39 @@ var OpenMatesClient = class _OpenMatesClient {
16889
16890
  }
16890
16891
  return this.decryptWorkflowSlug(response.data.workflow, { personal: true });
16891
16892
  }
16893
+ async saveWorkflowAsReusable(workflowId, options) {
16894
+ this.requireSession();
16895
+ if (!options.idempotencyKey.trim()) throw new Error("Workflow save-as-reusable requires a stable idempotencyKey");
16896
+ const response = await this.http.post(
16897
+ `/v1/workflows/${encodeURIComponent(workflowId)}/save-as-reusable`,
16898
+ {},
16899
+ { ...this.getCliRequestHeaders(), "Idempotency-Key": options.idempotencyKey }
16900
+ );
16901
+ if (!response.ok || !response.data.workflow) throw new Error(`Workflow save-as-reusable failed with HTTP ${response.status}`);
16902
+ return this.decryptWorkflowSlug(response.data.workflow, { personal: true });
16903
+ }
16904
+ async workflowRunRouting(params) {
16905
+ const routing = {};
16906
+ if (params.sourceChatId !== void 0) routing.source_chat_id = await this.resolveRequiredChatId(params.sourceChatId, { personal: true });
16907
+ if (params.messageDestinationOverrides !== void 0) {
16908
+ routing.message_destination_overrides = Object.fromEntries(await Promise.all(
16909
+ Object.entries(params.messageDestinationOverrides).map(async ([nodeId, chatId]) => [nodeId, await this.resolveRequiredChatId(chatId, { personal: true })])
16910
+ ));
16911
+ }
16912
+ if (params.returnOutputs !== void 0) routing.return_outputs = params.returnOutputs;
16913
+ return routing;
16914
+ }
16915
+ async runWorkflowOnce(params) {
16916
+ this.requireSession();
16917
+ if (!params.idempotencyKey.trim()) throw new Error("Workflow run-once requires a stable idempotencyKey");
16918
+ const response = await this.http.post(
16919
+ "/v1/workflows/run-once",
16920
+ { title: params.title, graph: params.graph, input: params.input ?? {}, ...await this.workflowRunRouting(params) },
16921
+ { ...this.getCliRequestHeaders(), "Idempotency-Key": params.idempotencyKey }
16922
+ );
16923
+ if (!response.ok || !response.data.workflow || !response.data.run) throw new Error(`Workflow run-once failed with HTTP ${response.status}`);
16924
+ return { workflow: await this.decryptWorkflowSlug(response.data.workflow, { personal: true }), run: response.data.run };
16925
+ }
16892
16926
  async enableWorkflow(workflowId) {
16893
16927
  return this.setWorkflowEnabled(workflowId, true);
16894
16928
  }
@@ -16902,7 +16936,7 @@ var OpenMatesClient = class _OpenMatesClient {
16902
16936
  }
16903
16937
  const response = await this.http.post(
16904
16938
  `/v1/workflows/${encodeURIComponent(workflowId)}/run`,
16905
- { mode: params.mode ?? "manual", input: params.input ?? {} },
16939
+ { mode: params.mode ?? "manual", input: params.input ?? {}, ...await this.workflowRunRouting(params) },
16906
16940
  { ...this.getCliRequestHeaders(), "Idempotency-Key": params.idempotencyKey }
16907
16941
  );
16908
16942
  if (!response.ok || !response.data.run) {
@@ -30624,12 +30658,47 @@ var OpenMatesWorkflows = class {
30624
30658
  if (!response.workflow) throw new OpenMatesApiError(500, { detail: "Workflow response missing workflow" });
30625
30659
  return this.decryptWorkflowSlug(response.workflow);
30626
30660
  }
30661
+ async saveAsReusable(workflowId, options) {
30662
+ if (!options.idempotencyKey.trim()) throw new OpenMatesConfigError("Workflow save-as-reusable requires a stable idempotencyKey");
30663
+ const resolvedWorkflowId = await this.resolveId(workflowId);
30664
+ const response = await this.client.request(
30665
+ `/v1/workflows/${encodeURIComponent(resolvedWorkflowId)}/save-as-reusable`,
30666
+ {},
30667
+ void 0,
30668
+ { "Idempotency-Key": options.idempotencyKey }
30669
+ );
30670
+ if (!response.workflow) throw new OpenMatesApiError(500, { detail: "Workflow response missing workflow" });
30671
+ return this.decryptWorkflowSlug(response.workflow);
30672
+ }
30673
+ async runRouting(params) {
30674
+ const routing = {};
30675
+ if (params.sourceChatId !== void 0) routing.source_chat_id = await resolveSdkChatId(this.client, params.sourceChatId);
30676
+ if (params.messageDestinationOverrides !== void 0) {
30677
+ routing.message_destination_overrides = Object.fromEntries(await Promise.all(
30678
+ Object.entries(params.messageDestinationOverrides).map(async ([nodeId, chatId]) => [nodeId, await resolveSdkChatId(this.client, chatId)])
30679
+ ));
30680
+ }
30681
+ if (params.returnOutputs !== void 0) routing.return_outputs = params.returnOutputs;
30682
+ return routing;
30683
+ }
30684
+ async runOnce(params) {
30685
+ if (!params.idempotencyKey.trim()) throw new OpenMatesConfigError("Workflow run-once requires a stable idempotencyKey");
30686
+ const response = await this.client.request(
30687
+ "/v1/workflows/run-once",
30688
+ { title: params.title, graph: params.graph, input: params.input ?? {}, ...await this.runRouting(params) },
30689
+ void 0,
30690
+ { "Idempotency-Key": params.idempotencyKey }
30691
+ );
30692
+ if (!response.workflow || !response.run) throw new OpenMatesApiError(500, { detail: "Workflow run-once response missing workflow or run" });
30693
+ return { workflow: await this.decryptWorkflowSlug(response.workflow), run: response.run };
30694
+ }
30627
30695
  async run(workflowId, params) {
30628
30696
  if (!params.idempotencyKey.trim()) throw new OpenMatesConfigError("Workflow run requires a stable idempotencyKey");
30629
30697
  const resolvedWorkflowId = await this.resolveId(workflowId);
30630
30698
  const response = await this.client.request(`/v1/workflows/${encodeURIComponent(resolvedWorkflowId)}/run`, {
30631
30699
  mode: params.mode ?? "manual",
30632
- input: params.input ?? {}
30700
+ input: params.input ?? {},
30701
+ ...await this.runRouting(params)
30633
30702
  }, void 0, { "Idempotency-Key": params.idempotencyKey });
30634
30703
  if (!response.run) throw new OpenMatesApiError(500, { detail: "Workflow response missing run" });
30635
30704
  return response.run;
@@ -31338,7 +31407,7 @@ function assertPortable(value) {
31338
31407
  }
31339
31408
  function remapGraph(graph, ids) {
31340
31409
  const escaped = Array.from(ids.keys()).sort((a, b) => b.length - a.length).map((id) => id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
31341
- const references = escaped.length ? new RegExp(`(\\$nodes\\.|\\{\\{\\s*steps\\.)(${escaped.join("|")})(?=[.}\\s]|$)`, "g") : null;
31410
+ const references = escaped.length ? new RegExp(`(\\$nodes\\.|\\{\\{\\s*steps\\.|\\$items\\.|\\{\\{\\s*items\\.)(${escaped.join("|")})(?=[.}\\s]|$)`, "g") : null;
31342
31411
  function visit(value) {
31343
31412
  if (typeof value === "string") return references ? value.replace(references, (_match, prefix, id) => prefix + ids.get(id)) : value;
31344
31413
  if (Array.isArray(value)) return value.map((item) => visit(item));
@@ -60772,6 +60841,15 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
60772
60841
  manual_intro: {
60773
60842
  text: "Use this skill directly by entering your request below."
60774
60843
  },
60844
+ requirements: {
60845
+ text: "Requirements"
60846
+ },
60847
+ optional: {
60848
+ text: "(optional)"
60849
+ },
60850
+ requirements_placeholder: {
60851
+ text: "Describe what the results should match."
60852
+ },
60775
60853
  via: {
60776
60854
  text: "via"
60777
60855
  },
@@ -60973,6 +61051,21 @@ Only output the final Markdown table. Do NOT include explanations, notes, or any
60973
61051
  request_error: {
60974
61052
  text: "The request could not finish. You can try again."
60975
61053
  },
61054
+ saving: {
61055
+ text: "Saving results\u2026"
61056
+ },
61057
+ saved: {
61058
+ text: "Results saved"
61059
+ },
61060
+ save_failed: {
61061
+ text: "Results are available. Saving failed."
61062
+ },
61063
+ retry_save: {
61064
+ text: "Retry saving"
61065
+ },
61066
+ saving_results: {
61067
+ text: "Results awaiting save"
61068
+ },
60976
61069
  viewer_read_only: {
60977
61070
  text: "Your team role allows viewing results. Ask a team member to run this skill."
60978
61071
  },
@@ -81773,6 +81866,108 @@ As of mid-2026, the severe supply shocks from the 2024\u20132025 avian flu have
81773
81866
  if_unsure: {
81774
81867
  text: "If unsure"
81775
81868
  },
81869
+ check_result: {
81870
+ text: "Result"
81871
+ },
81872
+ check_result_boolean: {
81873
+ text: "True or False"
81874
+ },
81875
+ check_result_options: {
81876
+ text: "Multiple choice"
81877
+ },
81878
+ check_selection_mode: {
81879
+ text: "Select"
81880
+ },
81881
+ check_select_one: {
81882
+ text: "Exactly one"
81883
+ },
81884
+ check_select_multiple: {
81885
+ text: "All that apply"
81886
+ },
81887
+ check_option_name: {
81888
+ text: "Option name"
81889
+ },
81890
+ check_option_description: {
81891
+ text: "Select when (optional)"
81892
+ },
81893
+ add_option: {
81894
+ text: "Add option"
81895
+ },
81896
+ remove_option: {
81897
+ text: "Remove option"
81898
+ },
81899
+ if_no_match: {
81900
+ text: "If none match"
81901
+ },
81902
+ selected: {
81903
+ text: "Selected"
81904
+ },
81905
+ no_match: {
81906
+ text: "No match"
81907
+ },
81908
+ ai_check_options_guidance: {
81909
+ text: "Choose from the named options using earlier results. A variable alone is enough; an instruction is optional. Unsure is used when evidence is missing."
81910
+ },
81911
+ branch_mapping_required: {
81912
+ text: "This branch contains steps. Move or remove those steps before changing its result or deleting it."
81913
+ },
81914
+ for_each: {
81915
+ text: "For each"
81916
+ },
81917
+ for_each_items: {
81918
+ text: "List to process"
81919
+ },
81920
+ for_each_max_items: {
81921
+ text: "Maximum items"
81922
+ },
81923
+ for_each_advanced_limits: {
81924
+ text: "Advanced limits"
81925
+ },
81926
+ for_each_duration: {
81927
+ text: "Total time limit (seconds)"
81928
+ },
81929
+ for_each_credits: {
81930
+ text: "Credit limit"
81931
+ },
81932
+ for_each_timeout: {
81933
+ text: "Time limit per item (seconds)"
81934
+ },
81935
+ for_each_limits: {
81936
+ text: "Processes items one at a time. Defaults: 100 items, 300 seconds, 100 credits and 60 seconds per item."
81937
+ },
81938
+ for_each_array_required: {
81939
+ text: "Choose an earlier list and a maximum of 1 to 100 items."
81940
+ },
81941
+ for_each_body: {
81942
+ text: "For each item"
81943
+ },
81944
+ this_item: {
81945
+ text: "This item"
81946
+ },
81947
+ start_input: {
81948
+ text: "Start input"
81949
+ },
81950
+ item_number: {
81951
+ text: "Item"
81952
+ },
81953
+ chat_actions: {
81954
+ text: "Workflow actions"
81955
+ },
81956
+ chat_open_workflow: {
81957
+ text: "Open workflow"
81958
+ },
81959
+ chat_save_reusable: {
81960
+ text: "Save as reusable"
81961
+ },
81962
+ chat_open_saved_copy: {
81963
+ text: "Open saved copy"
81964
+ },
81965
+ chat_snapshot_note: {
81966
+ text: "Showing the workflow saved with this chat. Open the Workflows workspace to edit it."
81967
+ },
81968
+ chat_copy_failed: {
81969
+ text: "Could not save this workflow."
81970
+ },
81776
81971
  if: {
81777
81972
  text: "If"
81778
81973
  },
@@ -96757,6 +96952,7 @@ async function tryResolveWorkflow(client2, target, flags) {
96757
96952
  return singleExactNameMatch(workflows, target, (workflow) => workflow.title);
96758
96953
  }
96759
96954
  async function requiredResolvedWorkflowId(client2, target, flags, _action) {
96955
+ if (/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(target)) return target;
96760
96956
  const workflow = await tryResolveWorkflow(client2, target, flags);
96761
96957
  if (!workflow) throw new Error(`Workflow '${target}' not found.`);
96762
96958
  return workflow.id;
@@ -101332,6 +101528,52 @@ async function handleWorkflows(client2, subcommand, rest, flags, redactor) {
101332
101528
  }
101333
101529
  return;
101334
101530
  }
101531
+ if (subcommand === "save-as-reusable") {
101532
+ const workflowId = rest[0] ? await requiredResolvedWorkflowId(client2, rest[0], flags, "save-as-reusable") : void 0;
101533
+ if (!workflowId) throw new Error("Missing workflow ID. Example: openmates workflows save-as-reusable <id>");
101534
+ const idempotencyKey = typeof flags["idempotency-key"] === "string" ? flags["idempotency-key"] : "";
101535
+ if (!idempotencyKey) throw new Error("Missing --idempotency-key for workflow save-as-reusable.");
101536
+ const workflow = await client2.saveWorkflowAsReusable(workflowId, { idempotencyKey });
101537
+ if (flags.json === true) printJson2(workflow);
101538
+ else printWorkflowDetail(workflow);
101539
+ return;
101540
+ }
101541
+ const runRouting = () => ({
101542
+ ...typeof flags["source-chat"] === "string" ? { sourceChatId: flags["source-chat"] } : {},
101543
+ ...typeof flags["message-destination-overrides"] === "string" ? { messageDestinationOverrides: parseJsonFlag(flags["message-destination-overrides"], "--message-destination-overrides") } : {},
101544
+ ...typeof flags["return-outputs"] === "string" ? { returnOutputs: parseJsonFlag(flags["return-outputs"], "--return-outputs") } : {}
101545
+ });
101546
+ if (subcommand === "run-once") {
101547
+ const titleFlag = typeof flags.title === "string" ? flags.title.trim() : "";
101548
+ const graphFlag = typeof flags.graph === "string" ? flags.graph : "";
101549
+ const fileFlag = typeof flags.file === "string" ? flags.file : "";
101550
+ if (Boolean(graphFlag) === Boolean(fileFlag)) throw new Error("Specify exactly one of --graph JSON or --file definition.workflow.yml for run-once.");
101551
+ let graph;
101552
+ let title = titleFlag;
101553
+ if (fileFlag) {
101554
+ assertWorkflowFilePath(fileFlag);
101555
+ if (statSync11(fileFlag).size > WORKFLOW_FILE_MAX_BYTES) throw new Error("Workflow file exceeds the size limit.");
101556
+ const yaml = parseYamlDocument(readFileSync24(fileFlag, "utf8"), { uniqueKeys: true, strict: true });
101557
+ if (yaml.errors.length > 0) throw new Error(`Invalid workflow YAML: ${yaml.errors[0].message}`);
101558
+ const document = validateWorkflowFile(yaml.toJS({ maxAliasCount: 20 }));
101559
+ graph = document.workflow.graph;
101560
+ title ||= document.workflow.title;
101561
+ } else graph = parseJsonFlag(graphFlag, "--graph");
101562
+ if (!title) throw new Error("Missing --title for workflow run-once.");
101563
+ const idempotencyKey = typeof flags["idempotency-key"] === "string" ? flags["idempotency-key"] : "";
101564
+ if (!idempotencyKey) throw new Error("Missing --idempotency-key for workflow run-once.");
101565
+ const sourceChatId = flags["source-chat"];
101566
+ if (typeof sourceChatId !== "string" || !sourceChatId) throw new Error("Missing --source-chat for workflow run-once.");
101567
+ const input = typeof flags.input === "string" ? parseJsonFlag(flags.input, "--input") : {};
101568
+ const result = await client2.runWorkflowOnce({ title, graph, idempotencyKey, input, ...runRouting(), sourceChatId });
101569
+ if (flags.wait === true) result.run = await waitForWorkflowRun(client2, result.workflow.id, result.run);
101570
+ if (flags.json === true) printJson2(result);
101571
+ else {
101572
+ printWorkflowDetail(result.workflow);
101573
+ printWorkflowRun(result.run);
101574
+ }
101575
+ return;
101576
+ }
101335
101577
  if (subcommand === "run") {
101336
101578
  const workflowId = rest[0] ? await requiredResolvedWorkflowId(client2, rest[0], flags, "run") : void 0;
101337
101579
  if (!workflowId) throw new Error("Missing workflow ID. Example: openmates workflows run <id>");
@@ -101339,7 +101581,7 @@ async function handleWorkflows(client2, subcommand, rest, flags, redactor) {
101339
101581
  if (!idempotencyKey) throw new Error("Missing --idempotency-key. Reuse this stable key when retrying the same workflow run.");
101340
101582
  const mode = flags.mode === "test" ? "test" : "manual";
101341
101583
  const input = typeof flags.input === "string" ? parseJsonFlag(flags.input, "--input") : {};
101342
- let run = await client2.runWorkflow(workflowId, { idempotencyKey, mode, input });
101584
+ let run = await client2.runWorkflow(workflowId, { idempotencyKey, mode, input, ...runRouting() });
101343
101585
  if (flags.wait === true) {
101344
101586
  run = await waitForWorkflowRun(client2, workflowId, run);
101345
101587
  }
@@ -107701,7 +107943,9 @@ function printWorkflowsHelp() {
107701
107943
  openmates workflows show <workflow-id> [--json]
107702
107944
  openmates workflows enable <workflow-id> [--json]
107703
107945
  openmates workflows disable <workflow-id> [--json]
107704
- openmates workflows run <workflow-id> --idempotency-key <stable-key> [--mode manual|test] [--input '<json>'] [--wait] [--json]
107946
+ openmates workflows run <workflow-id> --idempotency-key <stable-key> [--mode manual|test] [--input '<json>'] [--source-chat <id>] [--message-destination-overrides '<json>'] [--return-outputs '<json>'] [--wait] [--json]
107947
+ openmates workflows run-once (--title <title> --graph '<json>' | --file definition.workflow.yml) --source-chat <id> --idempotency-key <stable-key> [--input '<json>'] [--message-destination-overrides '<json>'] [--return-outputs '<json>'] [--wait] [--json]
107948
+ openmates workflows save-as-reusable <workflow-id> --idempotency-key <stable-key> [--json]
107705
107949
  openmates workflows runs <workflow-id> [--json]
107706
107950
  openmates workflows run-show <workflow-id> <run-id> [--json]
107707
107951
  openmates workflows run-cancel <workflow-id> <run-id> [--json]
@@ -107716,6 +107960,9 @@ Workflows run on the OpenMates server, not in this terminal process. The CLI
107716
107960
  uses your paired session and shows the same workflow/run records as web, SDKs,
107717
107961
  and Apple clients.
107718
107962
  Export writes a saved workflow's portable authoring graph to .workflow.yml.
107963
+ Run-once keeps its definition with the source chat. Save-as-reusable creates a new disabled workflow.
107964
+ --message-destination-overrides maps Send step IDs to owned chat IDs.
107965
+ --return-outputs maps result names to {"ref":"$nodes.<step>.output.<field>","type":"string"}.
107719
107966
  Run history and account bindings are excluded. Import creates a disabled workflow;
107720
107967
  review and complete its bindings before enabling it.
107721
107968
  Import creates a Personal Workflow. In an active Team context, pass --personal
@@ -952,7 +952,7 @@ interface LearningModeContext {
952
952
  ageGroup?: LearningModeAgeGroup | null;
953
953
  source?: "anonymous_session";
954
954
  }
955
- type WorkflowNodeType = "schedule_trigger" | "manual_trigger" | "webhook_trigger" | "app_skill_action" | "decision" | "check" | "send_chat_message" | "start_new_chat" | "event_trigger" | "wait" | "repeat" | "create_chat_report" | "send_notification" | "send_email_notification" | "ask_user" | "custom_code" | "end";
955
+ type WorkflowNodeType = "schedule_trigger" | "manual_trigger" | "webhook_trigger" | "app_skill_action" | "decision" | "check" | "send_chat_message" | "start_new_chat" | "event_trigger" | "wait" | "repeat" | "for_each" | "create_chat_report" | "send_notification" | "send_email_notification" | "ask_user" | "custom_code" | "end";
956
956
  interface WorkflowNode {
957
957
  id: string;
958
958
  type: WorkflowNodeType;
@@ -977,7 +977,28 @@ interface WorkflowGraph {
977
977
  }
978
978
  type WorkflowRunContentRetention = "last_5" | "none";
979
979
  type WorkflowRunContentStorage = "durable" | "ephemeral" | "deleted";
980
- type WorkflowLifecycle = "persisted" | "temporary";
980
+ type WorkflowLifecycle = "persisted" | "temporary" | "chat_embed";
981
+ interface WorkflowRunRouting {
982
+ sourceChatId?: string;
983
+ messageDestinationOverrides?: Record<string, string>;
984
+ returnOutputs?: Record<string, WorkflowReturnedOutputReference>;
985
+ }
986
+ interface WorkflowReturnedOutputReference {
987
+ ref: string;
988
+ type: "string" | "number" | "integer" | "boolean" | "object" | "array";
989
+ }
990
+ interface WorkflowRunOptions extends WorkflowRunRouting {
991
+ idempotencyKey: string;
992
+ mode?: "manual" | "test";
993
+ input?: Record<string, unknown>;
994
+ }
995
+ interface WorkflowRunOnceOptions extends WorkflowRunRouting {
996
+ title: string;
997
+ graph: WorkflowGraph;
998
+ idempotencyKey: string;
999
+ sourceChatId: string;
1000
+ input?: Record<string, unknown>;
1001
+ }
981
1002
  interface WorkflowAuthoringWarning {
982
1003
  code: string;
983
1004
  node_id: string;
@@ -2711,13 +2732,17 @@ declare class OpenMatesClient {
2711
2732
  deleted: boolean;
2712
2733
  }>;
2713
2734
  keepWorkflow(workflowId: string): Promise<WorkflowDetail>;
2735
+ saveWorkflowAsReusable(workflowId: string, options: {
2736
+ idempotencyKey: string;
2737
+ }): Promise<WorkflowDetail>;
2738
+ private workflowRunRouting;
2739
+ runWorkflowOnce(params: WorkflowRunOnceOptions): Promise<{
2740
+ workflow: WorkflowDetail;
2741
+ run: WorkflowRunDetail;
2742
+ }>;
2714
2743
  enableWorkflow(workflowId: string): Promise<WorkflowDetail>;
2715
2744
  disableWorkflow(workflowId: string): Promise<WorkflowDetail>;
2716
- runWorkflow(workflowId: string, params: {
2717
- idempotencyKey: string;
2718
- mode?: "manual" | "test";
2719
- input?: Record<string, unknown>;
2720
- }): Promise<WorkflowRunDetail>;
2745
+ runWorkflow(workflowId: string, params: WorkflowRunOptions): Promise<WorkflowRunDetail>;
2721
2746
  listWorkflowRuns(workflowId: string): Promise<WorkflowRunDetail[]>;
2722
2747
  getWorkflowRun(workflowId: string, runId: string): Promise<WorkflowRunDetail>;
2723
2748
  cancelWorkflowRun(workflowId: string, runId: string): Promise<WorkflowRunCancellationResult>;
@@ -3388,4 +3413,4 @@ declare function serializeToYaml(data: Record<string, unknown>, indent?: number)
3388
3413
  /** Map language identifier to file extension for code embed downloads. */
3389
3414
  declare function getExtForLang(language: string): string;
3390
3415
 
3391
- export { type CachedChat as $, type WorkflowGraph as A, type WorkflowRunContentRetention as B, type WorkflowRunDetail as C, type DecryptedUserTask as D, type ExternalChatContext as E, type WorkflowNode as F, type WorkflowRunCancellationResult as G, type WorkflowTemplateProjectionUpsertParams as H, type WorkflowTemplateProjectionResult as I, type PublicWorkflowTemplateProjection as J, type WorkflowTemplateProjectionRevocationResult as K, type WorkflowTemplateBindingCompletionParams as L, type WorkflowTemplateBindingCompletionResult as M, type WorkflowTemplateShortUrlParams as N, type WorkflowTemplateShortUrlResult as O, type ProjectItemRecord as P, type WorkflowTemplateImportPayload as Q, type ImportedWorkflowTemplate as R, type ShortUrlRevokeResult as S, type TaskCreateOptions as T, type UserPlanStatus as U, type AuthMethodsStatus as V, type WorkflowSummary as W, type AuthoritativeChatReconciliation as X, type BackupCodesResult as Y, type BankTransferOrderDetails as Z, type BankTransferStatus as _, type UserPlanRecord as a, type CachedNewChatSuggestion as a0, type ChatListPage as a1, type CliSignupResult as a2, type DecryptedDraft as a3, type DecryptedEmbed as a4, type DecryptedMemoryEntry as a5, type DecryptedMessage as a6, type DecryptedNewChatSuggestion as a7, type DocsFile as a8, type DocsFolder as a9, getExtForLang as aA, normalizeInterestTagIds as aB, reconcileAuthoritativeChats as aC, serializeToYaml as aD, assertTrustedAccountCommandAllowed as aE, assertTrustedAccountGuardEnvironment as aF, buildProjectDefaultFocus as aG, buildTravelConnectionsRequest as aH, extractExplicitProjectMentions as aI, printWhoAmI as aJ, readRootProjectInstructions as aK, renderProjectReadApprovalRequest as aL, renderProjectWriteApprovalRequest as aM, renderRemoteCommandEvent as aN, requireExactConfirmation as aO, resolveProjectContext as aP, shouldRequireTrustedAccountGuard as aQ, waitForWorkflowRun as aR, type DocsSearchResult as aa, type DocsTree as ab, type EncryptedDraft as ac, type GiftCardBankTransferStatus as ad, INTEREST_TAG_IDS as ae, type ImagesAiDetectionClassification as af, type ImagesAiDetectionSummary as ag, type InterestTagId as ah, MATE_NAMES as ai, MEMORY_TYPE_REGISTRY as aj, type MemoryFieldDef as ak, type MemoryTypeDef as al, OpenMatesClient as am, type OpenMatesClientOptions as an, type OpenMatesSession as ao, type SyncCache as ap, type TopicPreferencesPayload as aq, type TotpSetupStartResult as ar, type WorkflowEdge as as, type WorkflowNodeRun as at, type WorkflowNodeType as au, type WorkflowRunContentStorage as av, buildImagesAiDetectionSummary as aw, classifyImagesAiDetection as ax, deriveAppUrl as ay, formatImagesAiDetectionLabel as az, type UserPlanVerificationStatus as b, type UserPlanLearningType as c, type UserPlanLearningTargetKind as d, type UserPlanLearningStatus as e, type UserPlanLearningLevel as f, type UserPlanLearningRecord as g, type UserPlanCriterionRecord as h, type UserPlanVerificationRecord as i, type UserPlanCreateInput as j, type UserPlanUpdateInput as k, type TaskUpdateOptions as l, type UserPlanLearningCreateTasksInput as m, type UserPlanLearningCreateTasksResult as n, type UserTaskStatus as o, type TaskPriorityLevel as p, type DecryptedTaskActivityEntry as q, type TaskActivityCreateOptions as r, type UserTaskReorderInput as s, type WorkflowCapability as t, type WorkflowDetail as u, type WorkflowAuthoringWarning as v, type WorkflowInputStartParams as w, type WorkflowInputSessionResult as x, type WorkflowInputSessionDetail as y, type WorkflowInputEvent as z };
3416
+ export { type BankTransferOrderDetails as $, type WorkflowGraph as A, type WorkflowRunContentRetention as B, type WorkflowRunOnceOptions as C, type DecryptedUserTask as D, type ExternalChatContext as E, type WorkflowRunDetail as F, type WorkflowRunOptions as G, type WorkflowNode as H, type WorkflowRunCancellationResult as I, type WorkflowTemplateProjectionUpsertParams as J, type WorkflowTemplateProjectionResult as K, type PublicWorkflowTemplateProjection as L, type WorkflowTemplateProjectionRevocationResult as M, type WorkflowTemplateBindingCompletionParams as N, type WorkflowTemplateBindingCompletionResult as O, type ProjectItemRecord as P, type WorkflowTemplateShortUrlParams as Q, type WorkflowTemplateShortUrlResult as R, type ShortUrlRevokeResult as S, type TaskCreateOptions as T, type UserPlanStatus as U, type WorkflowTemplateImportPayload as V, type WorkflowSummary as W, type ImportedWorkflowTemplate as X, type AuthMethodsStatus as Y, type AuthoritativeChatReconciliation as Z, type BackupCodesResult as _, type UserPlanRecord as a, type BankTransferStatus as a0, type CachedChat as a1, type CachedNewChatSuggestion as a2, type ChatListPage as a3, type CliSignupResult as a4, type DecryptedDraft as a5, type DecryptedEmbed as a6, type DecryptedMemoryEntry as a7, type DecryptedMessage as a8, type DecryptedNewChatSuggestion as a9, buildImagesAiDetectionSummary as aA, classifyImagesAiDetection as aB, deriveAppUrl as aC, formatImagesAiDetectionLabel as aD, getExtForLang as aE, normalizeInterestTagIds as aF, reconcileAuthoritativeChats as aG, serializeToYaml as aH, assertTrustedAccountCommandAllowed as aI, assertTrustedAccountGuardEnvironment as aJ, buildProjectDefaultFocus as aK, buildTravelConnectionsRequest as aL, extractExplicitProjectMentions as aM, printWhoAmI as aN, readRootProjectInstructions as aO, renderProjectReadApprovalRequest as aP, renderProjectWriteApprovalRequest as aQ, renderRemoteCommandEvent as aR, requireExactConfirmation as aS, resolveProjectContext as aT, shouldRequireTrustedAccountGuard as aU, waitForWorkflowRun as aV, type DocsFile as aa, type DocsFolder as ab, type DocsSearchResult as ac, type DocsTree as ad, type EncryptedDraft as ae, type GiftCardBankTransferStatus as af, INTEREST_TAG_IDS as ag, type ImagesAiDetectionClassification as ah, type ImagesAiDetectionSummary as ai, type InterestTagId as aj, MATE_NAMES as ak, MEMORY_TYPE_REGISTRY as al, type MemoryFieldDef as am, type MemoryTypeDef as an, OpenMatesClient as ao, type OpenMatesClientOptions as ap, type OpenMatesSession as aq, type SyncCache as ar, type TopicPreferencesPayload as as, type TotpSetupStartResult as at, type WorkflowEdge as au, type WorkflowNodeRun as av, type WorkflowNodeType as aw, type WorkflowReturnedOutputReference as ax, type WorkflowRunContentStorage as ay, type WorkflowRunRouting as az, type UserPlanVerificationStatus as b, type UserPlanLearningType as c, type UserPlanLearningTargetKind as d, type UserPlanLearningStatus as e, type UserPlanLearningLevel as f, type UserPlanLearningRecord as g, type UserPlanCriterionRecord as h, type UserPlanVerificationRecord as i, type UserPlanCreateInput as j, type UserPlanUpdateInput as k, type TaskUpdateOptions as l, type UserPlanLearningCreateTasksInput as m, type UserPlanLearningCreateTasksResult as n, type UserTaskStatus as o, type TaskPriorityLevel as p, type DecryptedTaskActivityEntry as q, type TaskActivityCreateOptions as r, type UserTaskReorderInput as s, type WorkflowCapability as t, type WorkflowDetail as u, type WorkflowAuthoringWarning as v, type WorkflowInputStartParams as w, type WorkflowInputSessionResult as x, type WorkflowInputSessionDetail as y, type WorkflowInputEvent as z };
package/dist/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export { af as ImagesAiDetectionClassification, ag as ImagesAiDetectionSummary, aE as assertTrustedAccountCommandAllowed, aF as assertTrustedAccountGuardEnvironment, aw as buildImagesAiDetectionSummary, aG as buildProjectDefaultFocus, aH as buildTravelConnectionsRequest, ax as classifyImagesAiDetection, aI as extractExplicitProjectMentions, az as formatImagesAiDetectionLabel, aA as getExtForLang, aJ as printWhoAmI, aK as readRootProjectInstructions, aL as renderProjectReadApprovalRequest, aM as renderProjectWriteApprovalRequest, aN as renderRemoteCommandEvent, aO as requireExactConfirmation, aP as resolveProjectContext, aD as serializeToYaml, aQ as shouldRequireTrustedAccountGuard, aR as waitForWorkflowRun } from './cli-5j9Lsz2s.js';
2
+ export { ah as ImagesAiDetectionClassification, ai as ImagesAiDetectionSummary, aI as assertTrustedAccountCommandAllowed, aJ as assertTrustedAccountGuardEnvironment, aA as buildImagesAiDetectionSummary, aK as buildProjectDefaultFocus, aL as buildTravelConnectionsRequest, aB as classifyImagesAiDetection, aM as extractExplicitProjectMentions, aD as formatImagesAiDetectionLabel, aE as getExtForLang, aN as printWhoAmI, aO as readRootProjectInstructions, aP as renderProjectReadApprovalRequest, aQ as renderProjectWriteApprovalRequest, aR as renderRemoteCommandEvent, aS as requireExactConfirmation, aT as resolveProjectContext, aH as serializeToYaml, aU as shouldRequireTrustedAccountGuard, aV as waitForWorkflowRun } from './cli-DPB5Qnz5.js';
package/dist/cli.js CHANGED
@@ -19,7 +19,7 @@ import {
19
19
  serializeToYaml,
20
20
  shouldRequireTrustedAccountGuard,
21
21
  waitForWorkflowRun
22
- } from "./chunk-CLOVZ7RX.js";
22
+ } from "./chunk-IUOCCXVD.js";
23
23
  import "./chunk-IWKP55ZB.js";
24
24
  import "./chunk-BBKJZ23O.js";
25
25
  export {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { U as UserPlanStatus, a as UserPlanRecord, b as UserPlanVerificationStatus, c as UserPlanLearningType, d as UserPlanLearningTargetKind, e as UserPlanLearningStatus, f as UserPlanLearningLevel, g as UserPlanLearningRecord, h as UserPlanCriterionRecord, i as UserPlanVerificationRecord, j as UserPlanCreateInput, k as UserPlanUpdateInput, P as ProjectItemRecord, T as TaskCreateOptions, l as TaskUpdateOptions, m as UserPlanLearningCreateTasksInput, n as UserPlanLearningCreateTasksResult, o as UserTaskStatus, E as ExternalChatContext, p as TaskPriorityLevel, D as DecryptedUserTask, q as DecryptedTaskActivityEntry, r as TaskActivityCreateOptions, s as UserTaskReorderInput, W as WorkflowSummary, t as WorkflowCapability, u as WorkflowDetail, v as WorkflowAuthoringWarning, w as WorkflowInputStartParams, x as WorkflowInputSessionResult, y as WorkflowInputSessionDetail, z as WorkflowInputEvent, A as WorkflowGraph, B as WorkflowRunContentRetention, C as WorkflowRunDetail, F as WorkflowNode, G as WorkflowRunCancellationResult, H as WorkflowTemplateProjectionUpsertParams, I as WorkflowTemplateProjectionResult, J as PublicWorkflowTemplateProjection, K as WorkflowTemplateProjectionRevocationResult, L as WorkflowTemplateBindingCompletionParams, M as WorkflowTemplateBindingCompletionResult, N as WorkflowTemplateShortUrlParams, O as WorkflowTemplateShortUrlResult, S as ShortUrlRevokeResult, Q as WorkflowTemplateImportPayload, R as ImportedWorkflowTemplate } from './cli-5j9Lsz2s.js';
2
- export { V as AuthMethodsStatus, X as AuthoritativeChatReconciliation, Y as BackupCodesResult, Z as BankTransferOrderDetails, _ as BankTransferStatus, $ as CachedChat, a0 as CachedNewChatSuggestion, a1 as ChatListPage, a2 as CliSignupResult, a3 as DecryptedDraft, a4 as DecryptedEmbed, a5 as DecryptedMemoryEntry, a6 as DecryptedMessage, a7 as DecryptedNewChatSuggestion, a8 as DocsFile, a9 as DocsFolder, aa as DocsSearchResult, ab as DocsTree, ac as EncryptedDraft, ad as GiftCardBankTransferStatus, ae as INTEREST_TAG_IDS, af as ImagesAiDetectionClassification, ag as ImagesAiDetectionSummary, ah as InterestTagId, ai as MATE_NAMES, aj as MEMORY_TYPE_REGISTRY, ak as MemoryFieldDef, al as MemoryTypeDef, am as OpenMatesClient, an as OpenMatesClientOptions, ao as OpenMatesSession, ap as SyncCache, aq as TopicPreferencesPayload, ar as TotpSetupStartResult, as as WorkflowEdge, at as WorkflowNodeRun, au as WorkflowNodeType, av as WorkflowRunContentStorage, aw as buildImagesAiDetectionSummary, ax as classifyImagesAiDetection, ay as deriveAppUrl, az as formatImagesAiDetectionLabel, aA as getExtForLang, aB as normalizeInterestTagIds, aC as reconcileAuthoritativeChats, aD as serializeToYaml } from './cli-5j9Lsz2s.js';
1
+ import { U as UserPlanStatus, a as UserPlanRecord, b as UserPlanVerificationStatus, c as UserPlanLearningType, d as UserPlanLearningTargetKind, e as UserPlanLearningStatus, f as UserPlanLearningLevel, g as UserPlanLearningRecord, h as UserPlanCriterionRecord, i as UserPlanVerificationRecord, j as UserPlanCreateInput, k as UserPlanUpdateInput, P as ProjectItemRecord, T as TaskCreateOptions, l as TaskUpdateOptions, m as UserPlanLearningCreateTasksInput, n as UserPlanLearningCreateTasksResult, o as UserTaskStatus, E as ExternalChatContext, p as TaskPriorityLevel, D as DecryptedUserTask, q as DecryptedTaskActivityEntry, r as TaskActivityCreateOptions, s as UserTaskReorderInput, W as WorkflowSummary, t as WorkflowCapability, u as WorkflowDetail, v as WorkflowAuthoringWarning, w as WorkflowInputStartParams, x as WorkflowInputSessionResult, y as WorkflowInputSessionDetail, z as WorkflowInputEvent, A as WorkflowGraph, B as WorkflowRunContentRetention, C as WorkflowRunOnceOptions, F as WorkflowRunDetail, G as WorkflowRunOptions, H as WorkflowNode, I as WorkflowRunCancellationResult, J as WorkflowTemplateProjectionUpsertParams, K as WorkflowTemplateProjectionResult, L as PublicWorkflowTemplateProjection, M as WorkflowTemplateProjectionRevocationResult, N as WorkflowTemplateBindingCompletionParams, O as WorkflowTemplateBindingCompletionResult, Q as WorkflowTemplateShortUrlParams, R as WorkflowTemplateShortUrlResult, S as ShortUrlRevokeResult, V as WorkflowTemplateImportPayload, X as ImportedWorkflowTemplate } from './cli-DPB5Qnz5.js';
2
+ export { Y as AuthMethodsStatus, Z as AuthoritativeChatReconciliation, _ as BackupCodesResult, $ as BankTransferOrderDetails, a0 as BankTransferStatus, a1 as CachedChat, a2 as CachedNewChatSuggestion, a3 as ChatListPage, a4 as CliSignupResult, a5 as DecryptedDraft, a6 as DecryptedEmbed, a7 as DecryptedMemoryEntry, a8 as DecryptedMessage, a9 as DecryptedNewChatSuggestion, aa as DocsFile, ab as DocsFolder, ac as DocsSearchResult, ad as DocsTree, ae as EncryptedDraft, af as GiftCardBankTransferStatus, ag as INTEREST_TAG_IDS, ah as ImagesAiDetectionClassification, ai as ImagesAiDetectionSummary, aj as InterestTagId, ak as MATE_NAMES, al as MEMORY_TYPE_REGISTRY, am as MemoryFieldDef, an as MemoryTypeDef, ao as OpenMatesClient, ap as OpenMatesClientOptions, aq as OpenMatesSession, ar as SyncCache, as as TopicPreferencesPayload, at as TotpSetupStartResult, au as WorkflowEdge, av as WorkflowNodeRun, aw as WorkflowNodeType, ax as WorkflowReturnedOutputReference, ay as WorkflowRunContentStorage, az as WorkflowRunRouting, aA as buildImagesAiDetectionSummary, aB as classifyImagesAiDetection, aC as deriveAppUrl, aD as formatImagesAiDetectionLabel, aE as getExtForLang, aF as normalizeInterestTagIds, aG as reconcileAuthoritativeChats, aH as serializeToYaml } from './cli-DPB5Qnz5.js';
3
3
 
4
4
  interface ProjectedAssistantSpeechSegment {
5
5
  sequence: number;
@@ -6375,11 +6375,15 @@ declare class OpenMatesWorkflows {
6375
6375
  deleted: boolean;
6376
6376
  }>;
6377
6377
  keep(workflowId: string): Promise<WorkflowDetail>;
6378
- run(workflowId: string, params: {
6378
+ saveAsReusable(workflowId: string, options: {
6379
6379
  idempotencyKey: string;
6380
- mode?: "manual" | "test";
6381
- input?: Record<string, unknown>;
6382
- }): Promise<WorkflowRunDetail>;
6380
+ }): Promise<WorkflowDetail>;
6381
+ private runRouting;
6382
+ runOnce(params: WorkflowRunOnceOptions): Promise<{
6383
+ workflow: WorkflowDetail;
6384
+ run: WorkflowRunDetail;
6385
+ }>;
6386
+ run(workflowId: string, params: WorkflowRunOptions): Promise<WorkflowRunDetail>;
6383
6387
  runs(workflowId: string): Promise<WorkflowRunDetail[]>;
6384
6388
  runDetail(workflowId: string, runId: string): Promise<WorkflowRunDetail>;
6385
6389
  deleteRun(workflowId: string, runId: string): Promise<{
@@ -6548,4 +6552,4 @@ type AssistantFeedbackDecision = {
6548
6552
  };
6549
6553
  declare function buildAssistantFeedbackDecision(rating: number): AssistantFeedbackDecision;
6550
6554
 
6551
- export { APP_SKILL_METADATA, ASSISTANT_FEEDBACK_REPORT_TITLE, ASSISTANT_FEEDBACK_THANKS, type ApiKeyCreateOptions, type ApiKeyCreateResult, type ApiKeyRecord, type AssistantFeedbackDecision, type ChatCreateOptions, type ChatListOptions, type ChatResponse, DecryptedUserTask, type DesignIconExportFormat, type DesignIconExportOptions, type DesignIconExportResult, type DraftRecord, type EncryptedChatMetadata, type EncryptedDraftRecord, type FocusModeSelection, type IdeaBucketAddInput, type IdeaBucketProcessOptions, type IdeaBucketResult, type IdeaBucketSettings, type IdeaBucketSettingsInput, OpenMates, OpenMatesApiError, OpenMatesConfigError, type OpenMatesOptions, OpenMatesUnavailableError, type PlanPlainCreateOptions, type PlanPlainUpdateOptions, type PlanRecord, type ProjectPlainCreateOptions, type ProjectPlainUpdateOptions, type ProjectRecordPlain, SUPPORT_URL, type TaskListFilters, type TaskPlainCreateOptions, type TaskPlainUpdateOptions, type TaskRecord, WorkflowCapability, WorkflowDetail, WorkflowGraph, WorkflowNode, WorkflowRunContentRetention, WorkflowRunDetail, WorkflowSummary, buildAssistantFeedbackDecision, buildCreatePlanCriterionInput, buildCreatePlanLearningInput, buildCreatePlanVerificationInput, buildCreateUserPlanInput, buildPlanVerificationEvidenceInput, buildUpdatePlanLearningInput, buildUpdatePlanVerificationInput, buildUpdateUserPlanInput, decryptPlanLearning, decryptPlanLearnings, decryptUserPlan, decryptUserPlans, defaultCloneBranchForVersion, findPlan, findPlanLearning, projectAssistantSpeech, renderPlanDetail, renderPlanLearningDetail, renderPlanLearningList, renderPlanList, renderSupportInfo, selectAssistantMessagesForSpeech, summarizeAssistantSpeech };
6555
+ export { APP_SKILL_METADATA, ASSISTANT_FEEDBACK_REPORT_TITLE, ASSISTANT_FEEDBACK_THANKS, type ApiKeyCreateOptions, type ApiKeyCreateResult, type ApiKeyRecord, type AssistantFeedbackDecision, type ChatCreateOptions, type ChatListOptions, type ChatResponse, DecryptedUserTask, type DesignIconExportFormat, type DesignIconExportOptions, type DesignIconExportResult, type DraftRecord, type EncryptedChatMetadata, type EncryptedDraftRecord, type FocusModeSelection, type IdeaBucketAddInput, type IdeaBucketProcessOptions, type IdeaBucketResult, type IdeaBucketSettings, type IdeaBucketSettingsInput, OpenMates, OpenMatesApiError, OpenMatesConfigError, type OpenMatesOptions, OpenMatesUnavailableError, type PlanPlainCreateOptions, type PlanPlainUpdateOptions, type PlanRecord, type ProjectPlainCreateOptions, type ProjectPlainUpdateOptions, type ProjectRecordPlain, SUPPORT_URL, type TaskListFilters, type TaskPlainCreateOptions, type TaskPlainUpdateOptions, type TaskRecord, WorkflowCapability, WorkflowDetail, WorkflowGraph, WorkflowNode, WorkflowRunContentRetention, WorkflowRunDetail, WorkflowRunOnceOptions, WorkflowRunOptions, WorkflowSummary, buildAssistantFeedbackDecision, buildCreatePlanCriterionInput, buildCreatePlanLearningInput, buildCreatePlanVerificationInput, buildCreateUserPlanInput, buildPlanVerificationEvidenceInput, buildUpdatePlanLearningInput, buildUpdatePlanVerificationInput, buildUpdateUserPlanInput, decryptPlanLearning, decryptPlanLearnings, decryptUserPlan, decryptUserPlans, defaultCloneBranchForVersion, findPlan, findPlanLearning, projectAssistantSpeech, renderPlanDetail, renderPlanLearningDetail, renderPlanLearningList, renderPlanList, renderSupportInfo, selectAssistantMessagesForSpeech, summarizeAssistantSpeech };
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  selectAssistantMessagesForSpeech,
44
44
  serializeToYaml,
45
45
  summarizeAssistantSpeech
46
- } from "./chunk-CLOVZ7RX.js";
46
+ } from "./chunk-IUOCCXVD.js";
47
47
  import "./chunk-IWKP55ZB.js";
48
48
  import "./chunk-BBKJZ23O.js";
49
49
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openmates",
3
- "version": "0.27.0-alpha.7",
3
+ "version": "0.27.0-alpha.8",
4
4
  "description": "OpenMates CLI and SDK",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",