@overaihq/cli 0.13.6 → 0.13.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.
package/dist/index.js CHANGED
@@ -26948,9 +26948,9 @@ import { hostname } from "os";
26948
26948
  import { spawn } from "child_process";
26949
26949
  import { platform } from "os";
26950
26950
  var openBrowser = (url) => {
26951
- const [command, args] = platform() === "darwin" ? ["open", [url]] : platform() === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
26951
+ const [command2, args] = platform() === "darwin" ? ["open", [url]] : platform() === "win32" ? ["cmd", ["/c", "start", "", url]] : ["xdg-open", [url]];
26952
26952
  try {
26953
- const child = spawn(command, args, { stdio: "ignore", detached: true });
26953
+ const child = spawn(command2, args, { stdio: "ignore", detached: true });
26954
26954
  child.on("error", () => {
26955
26955
  });
26956
26956
  child.unref();
@@ -27517,7 +27517,7 @@ var runAutomation = async (args) => {
27517
27517
  // src/workspace/validateElements.ts
27518
27518
  var findings = (parsed) => parsed.success ? [] : parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`);
27519
27519
  var validateAutomationElements = async (elements) => {
27520
- const { automationNodesSchema } = await import("./types-QDEUVRZP.js");
27520
+ const { automationNodesSchema } = await import("./types-WI2WSJ3F.js");
27521
27521
  return findings(automationNodesSchema.safeParse(elements));
27522
27522
  };
27523
27523
  var validateWebPageConfig = async (config) => {
@@ -34117,6 +34117,10 @@ var lintDiagnosticSchema = external_exports.object({
34117
34117
  var lintRequestSchema = external_exports.object({
34118
34118
  code: external_exports.string(),
34119
34119
  surface: lintSurfaceSchema,
34120
+ // See PageLintContext. Client-supplied like the rest of the request —
34121
+ // advisory, so nothing is trusted from it. Ignored off the webPage surface.
34122
+ pageRuntime: external_exports.enum(["v1", "v2"]).optional(),
34123
+ flipCheck: external_exports.boolean().optional(),
34120
34124
  // The workspace the code is being authored in. Used to (a) authorize the
34121
34125
  // caller as a builder in that workspace and (b) resolve its real resources so
34122
34126
  // env id references are type-narrowed. A user token carries no workspace, so
@@ -35039,6 +35043,147 @@ var runKnowledgeBase = async (args) => {
35039
35043
  );
35040
35044
  };
35041
35045
 
35046
+ // ../common/src/random/index.ts
35047
+ var UNMISTAKABLE_CHARS = "0123456789abcdefghjkmnpqrstvwxyz";
35048
+ var nanoid2 = customAlphabet(UNMISTAKABLE_CHARS, 12);
35049
+ var MFA_SECRET_CHARS = "234567ABCDEFGHIJKLMNOPQRSTUVWXYZ";
35050
+ var generateMfaSecret = customAlphabet(MFA_SECRET_CHARS, 32);
35051
+ var VALID_VARIABLE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_";
35052
+ var generateRandomVariableName = customAlphabet(
35053
+ VALID_VARIABLE_CHARS,
35054
+ 12
35055
+ );
35056
+
35057
+ // ../common/src/ids.ts
35058
+ var ID_PREFIXES = {
35059
+ action_runner: { prefix: "ar", body: 10 },
35060
+ action_runner_email_alert: { prefix: "area", body: 10 },
35061
+ action_runner_email_subscription: { prefix: "ares", body: 10 },
35062
+ action_runner_token: { prefix: "art", body: 10 },
35063
+ admin_chat_view_log: { prefix: "acvl", body: 16 },
35064
+ agent: { prefix: "agt", body: 10 },
35065
+ agent_conversation: { prefix: "agcv", body: 20 },
35066
+ agent_message: { prefix: "agmsg", body: 20 },
35067
+ architect_chat: {
35068
+ prefix: "ac",
35069
+ body: 12,
35070
+ legacy: [{ prefix: "cc", body: 12 }]
35071
+ },
35072
+ architect_chat_feedback: { prefix: "acf", body: 20 },
35073
+ architect_chat_message: {
35074
+ prefix: "acm",
35075
+ body: 16,
35076
+ legacy: [{ prefix: "ccm", body: 16 }]
35077
+ },
35078
+ architect_chat_message_part: { prefix: "acmp", body: 16 },
35079
+ architect_mcp_connection: { prefix: "amc", body: 10 },
35080
+ automatic_top_up_attempt: { prefix: "atp", body: 12 },
35081
+ automation: { prefix: "at", body: 10 },
35082
+ automation_email_address: { prefix: "aea", body: 10 },
35083
+ automation_email_alert: { prefix: "aes", body: 10 },
35084
+ automation_error_alert_queue: { prefix: "aeaq", body: 10 },
35085
+ browser_automation: { prefix: "bra", body: 10 },
35086
+ browser_automation_run: { prefix: "brr", body: 20 },
35087
+ browser_session_usage: { prefix: "bsu", body: 12 },
35088
+ chat_execution: { prefix: "chx", body: 20 },
35089
+ chat_tool_invocation: { prefix: "cti", body: 20 },
35090
+ cli_auth_request: { prefix: "cac", body: 32 },
35091
+ data_file: { prefix: "df", body: 10 },
35092
+ data_stream: { prefix: "ds", body: 10 },
35093
+ file_bucket: { prefix: "fb", body: 10 },
35094
+ file_bucket_entry: { prefix: "fbe", body: 16 },
35095
+ file_bucket_file_version: { prefix: "fbv", body: 20 },
35096
+ file_bucket_sftp_access: { prefix: "fba", body: 16 },
35097
+ file_bucket_sftp_key: { prefix: "fbk", body: 16 },
35098
+ file_bucket_share_link: { prefix: "fsl", body: 16 },
35099
+ file_bucket_upload_request: { prefix: "fbu", body: 16 },
35100
+ function: { prefix: "fn", body: 10 },
35101
+ function_execution: { prefix: "fex", body: 20 },
35102
+ game_score: { prefix: "gsc", body: 16 },
35103
+ identity_architect_memory: { prefix: "iam", body: 10 },
35104
+ identity_invite_token: { prefix: "iit", body: 10 },
35105
+ integration: { prefix: "in", body: 10 },
35106
+ integration_email_alert: { prefix: "iea", body: 10 },
35107
+ integration_email_subscription: { prefix: "ies", body: 10 },
35108
+ knowledge_base: { prefix: "kb", body: 10 },
35109
+ knowledge_base_chunk: { prefix: "kbc", body: 20 },
35110
+ knowledge_base_document: { prefix: "kbd", body: 20 },
35111
+ mailbox: { prefix: "mbx", body: 10 },
35112
+ mailbox_address: { prefix: "mba", body: 10 },
35113
+ mailbox_message: { prefix: "mbm", body: 10 },
35114
+ organization_usage_credit: { prefix: "crd", body: 12 },
35115
+ organization_usage_transaction: { prefix: "utx", body: 12 },
35116
+ page: { prefix: "pg", body: 10 },
35117
+ personal_access_token: { prefix: "pat", body: 10 },
35118
+ plaid_connection: { prefix: "plc", body: 12 },
35119
+ printable_page: { prefix: "pp", body: 10 },
35120
+ resource_group: { prefix: "rgp", body: 10 },
35121
+ saml_config: { prefix: "slc", body: 10 },
35122
+ saml_group_mapping: { prefix: "sgm", body: 10 },
35123
+ saml_session: { prefix: "sls", body: 10 },
35124
+ siem_event_outbox: { prefix: "seo", body: 10 },
35125
+ // Shared `stc` with storage_transcription until 2026-09; its old rows keep it.
35126
+ snaptrade_connection: {
35127
+ prefix: "snc",
35128
+ body: 12,
35129
+ legacy: [{ prefix: "stc", body: 12 }]
35130
+ },
35131
+ snaptrade_user: { prefix: "stu", body: 12 },
35132
+ storage_transcription: { prefix: "stc", body: 10 },
35133
+ storage_vision_conversion: {
35134
+ prefix: "svc",
35135
+ body: 20,
35136
+ legacy: [{ prefix: "svc", body: 10 }]
35137
+ },
35138
+ table_space: { prefix: "tbs", body: 10 },
35139
+ table_space_credential: { prefix: "tbsc", body: 10 },
35140
+ table_space_duplication_job: { prefix: "tsdj", body: 10 },
35141
+ table_space_query_execution: { prefix: "tbsq", body: 10 },
35142
+ web_page: { prefix: "wp", body: 10 },
35143
+ web_page_error: {
35144
+ prefix: "wpe",
35145
+ body: 20,
35146
+ legacy: [{ prefix: "wpe", body: 10 }]
35147
+ },
35148
+ web_page_log: { prefix: "wpl", body: 20 },
35149
+ web_page_view: {
35150
+ prefix: "wpv",
35151
+ body: 20,
35152
+ legacy: [{ prefix: "wpv", body: 10 }]
35153
+ },
35154
+ workspace: { prefix: "ws", body: 10 },
35155
+ workspace_architect_memory: { prefix: "wam", body: 10 },
35156
+ workspace_duplication_job: { prefix: "wdj", body: 10 },
35157
+ workspace_invite_token: { prefix: "wit", body: 10 },
35158
+ workspace_resource_share: { prefix: "wrs", body: 10 }
35159
+ };
35160
+ var shapesOf = (table) => {
35161
+ const spec = ID_PREFIXES[table];
35162
+ return [spec, ...spec.legacy ?? []];
35163
+ };
35164
+ var isIdOf = (table, id) => {
35165
+ if (typeof id !== "string") return false;
35166
+ const lower = id.toLowerCase();
35167
+ return shapesOf(table).some(
35168
+ ({ prefix, body }) => lower.length === prefix.length + body && lower.startsWith(prefix) && /^[a-z0-9_-]+$/.test(lower.slice(prefix.length))
35169
+ );
35170
+ };
35171
+ var idTable = (id) => Object.keys(ID_PREFIXES).find((table) => isIdOf(table, id)) ?? null;
35172
+ var idTableByPrefix = (id) => {
35173
+ const exact = idTable(id);
35174
+ if (exact) return exact;
35175
+ const lower = id.toLowerCase();
35176
+ let best = null;
35177
+ for (const table of Object.keys(ID_PREFIXES)) {
35178
+ for (const { prefix } of shapesOf(table)) {
35179
+ if (lower.startsWith(prefix) && prefix.length > (best?.length ?? 0)) {
35180
+ best = { table, length: prefix.length };
35181
+ }
35182
+ }
35183
+ }
35184
+ return best?.table ?? null;
35185
+ };
35186
+
35042
35187
  // src/commands/open.ts
35043
35188
  var ROUTE_BY_TYPE = {
35044
35189
  automation: "automations",
@@ -35047,20 +35192,20 @@ var ROUTE_BY_TYPE = {
35047
35192
  printablePage: "printable-pages",
35048
35193
  agent: "agents"
35049
35194
  };
35050
- var ROUTE_BY_PREFIX = [
35051
- ["WS", "workspaces"],
35052
- ["WP", "web-pages"],
35053
- ["PP", "printable-pages"],
35054
- ["FN", "functions"],
35055
- ["AT", "automations"],
35056
- ["TBS", "table-spaces"],
35057
- ["DF", "data-files"],
35058
- ["AGT", "agents"],
35059
- ["IN", "integrations"],
35060
- ["DS", "data-streams"],
35061
- ["AR", "action-runners"],
35062
- ["PG", "pages"]
35063
- ];
35195
+ var ROUTE_BY_TABLE = {
35196
+ workspace: "workspaces",
35197
+ web_page: "web-pages",
35198
+ printable_page: "printable-pages",
35199
+ function: "functions",
35200
+ automation: "automations",
35201
+ table_space: "table-spaces",
35202
+ data_file: "data-files",
35203
+ agent: "agents",
35204
+ integration: "integrations",
35205
+ data_stream: "data-streams",
35206
+ action_runner: "action-runners",
35207
+ page: "pages"
35208
+ };
35064
35209
  var runOpen = async (args) => {
35065
35210
  const filter2 = args.find((a) => !a.startsWith("-"));
35066
35211
  const { organizationId } = await getAccessToken();
@@ -35089,15 +35234,14 @@ var runOpen = async (args) => {
35089
35234
  "Not inside a cloned workspace \u2014 pass a resource id (WP..., FN..., WS..., AT...)."
35090
35235
  );
35091
35236
  }
35092
- const prefixed = ROUTE_BY_PREFIX.find(
35093
- ([prefix]) => filter2.startsWith(prefix)
35094
- );
35095
- if (prefixed == null) {
35237
+ const table = idTableByPrefix(filter2);
35238
+ const route = table == null ? void 0 : ROUTE_BY_TABLE[table];
35239
+ if (route == null) {
35096
35240
  throw new Error(
35097
35241
  `Nothing matched "${filter2}" (not a tracked resource or a recognized id prefix).`
35098
35242
  );
35099
35243
  }
35100
- return `${appBaseUrl(apiBaseUrl())}/${organizationId}/${prefixed[1]}/${filter2}`;
35244
+ return `${appBaseUrl(apiBaseUrl())}/${organizationId}/${route}/${filter2}`;
35101
35245
  })();
35102
35246
  process.stdout.write(`${url}
35103
35247
  `);
@@ -35489,8 +35633,8 @@ var runDiff = async (args, clone) => {
35489
35633
  };
35490
35634
 
35491
35635
  // src/commands/recursiveSync.ts
35492
- var runRecursiveSync = async (command, args) => {
35493
- if (command === "push" && args.includes("--deploy"))
35636
+ var runRecursiveSync = async (command2, args) => {
35637
+ if (command2 === "push" && args.includes("--deploy"))
35494
35638
  throw new Error("Recursive push saves versions only. Deploy from an individual workspace.");
35495
35639
  const origin = openClone();
35496
35640
  const local = /* @__PURE__ */ new Map([[origin.manifest.workspaceId, origin]]);
@@ -35546,7 +35690,7 @@ var runRecursiveSync = async (command, args) => {
35546
35690
  process.stdout.write(`
35547
35691
  Workspace ${label} (${entry.workspace.id})
35548
35692
  `);
35549
- if (clone == null && command !== "pull") {
35693
+ if (clone == null && command2 !== "pull") {
35550
35694
  process.stdout.write("New remote workspace \u2014 run `overai pull --recursive` to clone.\n");
35551
35695
  continue;
35552
35696
  }
@@ -35558,9 +35702,9 @@ Workspace ${label} (${entry.workspace.id})
35558
35702
  throw new Error("Destination already exists, possibly from an incomplete clone. Local files kept; move the folder aside before retrying.");
35559
35703
  await runClone([entry.workspace.id, entry.root], true);
35560
35704
  available.add(entry.workspace.id);
35561
- } else if (command === "status") await runStatus(clone);
35562
- else if (command === "diff") await runDiff(args, clone);
35563
- else if (command === "pull") await runPull(clone);
35705
+ } else if (command2 === "status") await runStatus(clone);
35706
+ else if (command2 === "diff") await runDiff(args, clone);
35707
+ else if (command2 === "pull") await runPull(clone);
35564
35708
  else await runPush(args, clone);
35565
35709
  completed += 1;
35566
35710
  } catch (error) {
@@ -35570,9 +35714,9 @@ Workspace ${label} (${entry.workspace.id})
35570
35714
  }
35571
35715
  }
35572
35716
  process.stdout.write(`
35573
- Recursive ${command}: ${String(completed)} workspace(s) completed, ${String(failures.length)} failed or skipped.
35717
+ Recursive ${command2}: ${String(completed)} workspace(s) completed, ${String(failures.length)} failed or skipped.
35574
35718
  `);
35575
- if (failures.length > 0) throw new Error(`Recursive ${command} incomplete. Successful work was kept; resolve the reported issues and retry.`);
35719
+ if (failures.length > 0) throw new Error(`Recursive ${command2} incomplete. Successful work was kept; resolve the reported issues and retry.`);
35576
35720
  };
35577
35721
 
35578
35722
  // src/commands/update.ts
@@ -35588,6 +35732,11 @@ var packageRootUrl = () => {
35588
35732
  }
35589
35733
  throw new Error("package.json not found relative to the CLI bundle");
35590
35734
  };
35735
+ var compareVersions = (a, b) => {
35736
+ const av = a.split(".").map(Number);
35737
+ const bv = b.split(".").map(Number);
35738
+ return av.map((n, i) => n - (bv[i] ?? 0)).find((d) => d !== 0) ?? 0;
35739
+ };
35591
35740
  var cliVersion = () => {
35592
35741
  const pkg = JSON.parse(
35593
35742
  readFileSync8(new URL("package.json", packageRootUrl()), "utf8")
@@ -35627,9 +35776,7 @@ var runUpdate = async () => {
35627
35776
  `);
35628
35777
  return;
35629
35778
  }
35630
- const cur = current.split(".").map(Number);
35631
- const lat = latest.split(".").map(Number);
35632
- const cmp = cur.map((n, i) => n - (lat[i] ?? 0)).find((d) => d !== 0) ?? 0;
35779
+ const cmp = compareVersions(current, latest);
35633
35780
  if (cmp > 0) {
35634
35781
  process.stdout.write(
35635
35782
  `overai ${current} is ahead of latest (${latest}) \u2014 likely a @next install; nothing to do.
@@ -35725,23 +35872,26 @@ var runReport = async (args) => {
35725
35872
 
35726
35873
  // src/commands/resource.ts
35727
35874
  var resources = {
35728
- WS: { collection: "workspaces", mutation: "updateWorkspace", result: "workspace", patch: "WorkspacePatch", fields: "id name description isArchived", editable: ["name", "description", "isArchived"] },
35729
- AT: { collection: "automations", mutation: "updateAutomation", result: "automation", patch: "AutomationPatch", fields: "id name description isArchived isActive workspaceId", editable: ["name", "description", "isArchived", "isActive"] },
35730
- FN: { collection: "functions", mutation: "updateFunction", result: "function", patch: "FunctionPatch", fields: "id name description isArchived isEnabled workspaceId", editable: ["name", "description", "isArchived", "isEnabled"] },
35731
- WP: { collection: "webPages", mutation: "updateWebPage", result: "webPage", patch: "WebPagePatch", fields: "id name isArchived workspaceId", editable: ["name", "isArchived"] },
35732
- PP: { collection: "printablePages", mutation: "updatePrintablePage", result: "printablePage", patch: "PrintablePagePatch", fields: "id name isArchived workspaceId", editable: ["name", "isArchived"] },
35733
- AGT: { collection: "agents", mutation: "updateAgent", result: "agent", patch: "AgentPatch", fields: "id name description isArchived isEnabled workspaceId", editable: ["name", "description", "isArchived", "isEnabled"] },
35734
- IN: { collection: "integrations", mutation: "updateIntegration", result: "integration", patch: "IntegrationPatch", fields: "id name description isArchived integrationTypeId workspaceId", editable: ["name", "description", "isArchived", "integrationTypeId"] },
35735
- TBS: { collection: "tableSpaces", mutation: "updateTableSpace", result: "tableSpace", patch: "TableSpacePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35736
- DS: { collection: "dataStreams", mutation: "updateDataStream", result: "dataStream", patch: "DataStreamPatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35737
- KB: { collection: "knowledgeBases", mutation: "updateKnowledgeBase", result: "knowledgeBase", patch: "KnowledgeBasePatch", fields: "id name description isArchived embeddingModel workspaceId", editable: ["name", "description", "isArchived"] },
35738
- DF: { collection: "dataFiles", mutation: "updateDataFile", result: "dataFile", patch: "DataFilePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35739
- AR: { collection: "actionRunners", mutation: "updateActionRunner", result: "actionRunner", patch: "ActionRunnerPatch", fields: "id isArchived actionTimeoutSeconds config workspaceId identityId identity { name }", editable: ["isArchived", "actionTimeoutSeconds", "config"] }
35875
+ workspace: { collection: "workspaces", mutation: "updateWorkspace", result: "workspace", patch: "WorkspacePatch", fields: "id name description isArchived", editable: ["name", "description", "isArchived"] },
35876
+ automation: { collection: "automations", mutation: "updateAutomation", result: "automation", patch: "AutomationPatch", fields: "id name description isArchived isActive workspaceId", editable: ["name", "description", "isArchived", "isActive"] },
35877
+ function: { collection: "functions", mutation: "updateFunction", result: "function", patch: "FunctionPatch", fields: "id name description isArchived isEnabled workspaceId", editable: ["name", "description", "isArchived", "isEnabled"] },
35878
+ web_page: { collection: "webPages", mutation: "updateWebPage", result: "webPage", patch: "WebPagePatch", fields: "id name isArchived workspaceId", editable: ["name", "isArchived"] },
35879
+ printable_page: { collection: "printablePages", mutation: "updatePrintablePage", result: "printablePage", patch: "PrintablePagePatch", fields: "id name isArchived workspaceId", editable: ["name", "isArchived"] },
35880
+ agent: { collection: "agents", mutation: "updateAgent", result: "agent", patch: "AgentPatch", fields: "id name description isArchived isEnabled workspaceId", editable: ["name", "description", "isArchived", "isEnabled"] },
35881
+ integration: { collection: "integrations", mutation: "updateIntegration", result: "integration", patch: "IntegrationPatch", fields: "id name description isArchived integrationTypeId workspaceId", editable: ["name", "description", "isArchived", "integrationTypeId"] },
35882
+ table_space: { collection: "tableSpaces", mutation: "updateTableSpace", result: "tableSpace", patch: "TableSpacePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35883
+ data_stream: { collection: "dataStreams", mutation: "updateDataStream", result: "dataStream", patch: "DataStreamPatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35884
+ knowledge_base: { collection: "knowledgeBases", mutation: "updateKnowledgeBase", result: "knowledgeBase", patch: "KnowledgeBasePatch", fields: "id name description isArchived embeddingModel workspaceId", editable: ["name", "description", "isArchived"] },
35885
+ data_file: { collection: "dataFiles", mutation: "updateDataFile", result: "dataFile", patch: "DataFilePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
35886
+ action_runner: { collection: "actionRunners", mutation: "updateActionRunner", result: "actionRunner", patch: "ActionRunnerPatch", fields: "id isArchived actionTimeoutSeconds config workspaceId identityId identity { name }", editable: ["isArchived", "actionTimeoutSeconds", "config"] }
35887
+ // Keyed by table so `idTableByPrefix` can index it; `satisfies` rejects a key
35888
+ // the registry does not know.
35740
35889
  };
35741
35890
  var resourceFor = (id) => {
35742
- const entry = Object.entries(resources).find(([prefix]) => id.startsWith(prefix));
35743
- if (entry == null) throw new Error(`Unsupported resource id: ${id}`);
35744
- return entry[1];
35891
+ const table = idTableByPrefix(id);
35892
+ const resource = table == null ? void 0 : resources[table];
35893
+ if (resource == null) throw new Error(`Unsupported resource id: ${id}`);
35894
+ return resource;
35745
35895
  };
35746
35896
  var readResource = async (id, resource) => {
35747
35897
  const data = await gqlRequest(
@@ -35798,7 +35948,7 @@ var runResource = async (args) => {
35798
35948
  }
35799
35949
  }
35800
35950
  const name2 = flagValue(args, "--name");
35801
- if (name2 != null && id.startsWith("AR")) {
35951
+ if (name2 != null && idTableByPrefix(id) === "action_runner") {
35802
35952
  const current = await readResource(id, resource);
35803
35953
  const result = await gqlRequest(
35804
35954
  `mutation CliRenameRunner($id: String!, $name: String!) {
@@ -35816,7 +35966,7 @@ var runResource = async (args) => {
35816
35966
  { id, patch }
35817
35967
  );
35818
35968
  if (result[resource.mutation]?.updated == null) throw new Error(`Resource ${id} was not updated; check that it exists and your workspace role allows editing.`);
35819
- } else if (!(name2 != null && id.startsWith("AR"))) {
35969
+ } else if (!(name2 != null && idTableByPrefix(id) === "action_runner")) {
35820
35970
  throw new Error(`No supported changes supplied for ${id}.`);
35821
35971
  }
35822
35972
  printResult(await readResource(id, resource), resolveFormat(flagValue(args, "-o", "--output")));
@@ -35872,7 +36022,9 @@ characters in the middle while preserving their ends), env.STORAGE.text
35872
36022
  without AI; \`{ vision: true }\` uses AI to represent PDFs or images as text and
35873
36023
  is required for images), env.STORAGE.csv (one Excel worksheet selected by name
35874
36024
  or zero-based index), env.STORAGE.image (PNG representation of a raster image,
35875
- SVG, or single-page PDF),
36025
+ SVG, or single-page PDF), env.STORAGE.transcribe (AI transcription of a stored
36026
+ audio file; optional ISO-639-1 language like "en"; the same backend is also
36027
+ reachable as env.AI.speechToText),
35876
36028
  env.AI.generateText/generateObject,
35877
36029
  env.GRAPHQL.request().
35878
36030
 
@@ -36685,6 +36837,81 @@ var runWorkspace = async (args) => {
36685
36837
  process.exitCode = 1;
36686
36838
  };
36687
36839
 
36840
+ // src/updateCheck.ts
36841
+ import { request as httpsRequest } from "https";
36842
+ import { existsSync as existsSync6 } from "fs";
36843
+ import { fileURLToPath as fileURLToPath2 } from "url";
36844
+ var CHECK_TIMEOUT_MS = 2e3;
36845
+ var fetchLatestVersion = (signal) => {
36846
+ return new Promise((resolve4, reject2) => {
36847
+ const req = httpsRequest(
36848
+ `https://registry.npmjs.org/${encodeURIComponent(PACKAGE_NAME)}/latest`,
36849
+ { signal, timeout: CHECK_TIMEOUT_MS },
36850
+ (res) => {
36851
+ if (res.statusCode !== 200) {
36852
+ res.resume();
36853
+ reject2(new Error(`registry responded HTTP ${String(res.statusCode)}`));
36854
+ return;
36855
+ }
36856
+ const chunks = [];
36857
+ res.on("data", (chunk) => chunks.push(chunk));
36858
+ res.on("end", () => {
36859
+ try {
36860
+ resolve4(JSON.parse(Buffer.concat(chunks).toString()));
36861
+ } catch {
36862
+ reject2(new Error("registry returned a non-JSON body"));
36863
+ }
36864
+ });
36865
+ }
36866
+ );
36867
+ req.on("timeout", () => {
36868
+ req.destroy(new Error("connect timed out"));
36869
+ });
36870
+ req.on("error", reject2);
36871
+ req.end();
36872
+ });
36873
+ };
36874
+ var PRINT_GRACE_MS = 500;
36875
+ var updateNotice = (current, latest) => {
36876
+ if (compareVersions(current, latest) >= 0) return null;
36877
+ return `overai ${current} \u2192 ${latest} available \u2014 run "overai update"`;
36878
+ };
36879
+ var startUpdateCheck = () => {
36880
+ const controller = new AbortController();
36881
+ const promise = (async () => {
36882
+ try {
36883
+ if (existsSync6(new URL("src", packageRootUrl()))) return null;
36884
+ const path = fileURLToPath2(import.meta.url);
36885
+ if (path.includes("_npx") || path.includes("dlx-")) return null;
36886
+ const body = await fetchLatestVersion(controller.signal);
36887
+ const latest = typeof body.version === "string" ? body.version : null;
36888
+ if (latest == null) return null;
36889
+ return updateNotice(cliVersion(), latest);
36890
+ } catch {
36891
+ return null;
36892
+ }
36893
+ })();
36894
+ return {
36895
+ promise,
36896
+ cancel: () => {
36897
+ controller.abort();
36898
+ }
36899
+ };
36900
+ };
36901
+ var printUpdateNotice = async (check) => {
36902
+ if (check == null) return;
36903
+ const grace = new Promise((resolve4) => {
36904
+ const timer = setTimeout(() => {
36905
+ resolve4(null);
36906
+ }, PRINT_GRACE_MS);
36907
+ timer.unref();
36908
+ });
36909
+ const message = await Promise.race([check.promise, grace]);
36910
+ check.cancel();
36911
+ if (message != null) process.stderr.write(`${message}
36912
+ `);
36913
+ };
36914
+
36688
36915
  // src/index.ts
36689
36916
  var HELP = `overai \u2014 OverAI command-line interface
36690
36917
 
@@ -36816,24 +37043,35 @@ var ORG_AGNOSTIC_COMMANDS = /* @__PURE__ */ new Set([
36816
37043
  "--help",
36817
37044
  "-h"
36818
37045
  ]);
37046
+ var SKIP_UPDATE_CHECK = /* @__PURE__ */ new Set([
37047
+ void 0,
37048
+ "update",
37049
+ "upgrade",
37050
+ "version",
37051
+ "--version",
37052
+ "-v",
37053
+ "help",
37054
+ "--help",
37055
+ "-h"
37056
+ ]);
36819
37057
  var run = async () => {
36820
- const [command, ...rest] = process.argv.slice(2);
36821
- if (command != null && !ORG_AGNOSTIC_COMMANDS.has(command)) {
37058
+ const [command2, ...rest] = process.argv.slice(2);
37059
+ if (command2 != null && !ORG_AGNOSTIC_COMMANDS.has(command2)) {
36822
37060
  pinOrgFromClone();
36823
37061
  announceOrgScope();
36824
37062
  }
36825
37063
  if (rest.includes("--recursive")) {
36826
- if (command !== "status" && command !== "diff" && command !== "pull" && command !== "push")
37064
+ if (command2 !== "status" && command2 !== "diff" && command2 !== "pull" && command2 !== "push")
36827
37065
  throw new Error(
36828
37066
  "--recursive supports status, diff, pull, and save-only push. Deploy and restore remain single-workspace."
36829
37067
  );
36830
37068
  await runRecursiveSync(
36831
- command,
37069
+ command2,
36832
37070
  rest.filter((arg) => arg !== "--recursive")
36833
37071
  );
36834
37072
  return;
36835
37073
  }
36836
- switch (command) {
37074
+ switch (command2) {
36837
37075
  case "signin":
36838
37076
  case "login":
36839
37077
  await signIn();
@@ -36959,16 +37197,20 @@ var run = async () => {
36959
37197
  process.stdout.write(HELP);
36960
37198
  return;
36961
37199
  default:
36962
- process.stderr.write(`Unknown command: ${command}
37200
+ process.stderr.write(`Unknown command: ${command2}
36963
37201
 
36964
37202
  ${HELP}`);
36965
37203
  process.exitCode = 1;
36966
37204
  }
36967
37205
  };
37206
+ var [command] = process.argv.slice(2);
37207
+ var updateNotice2 = process.env.OVERAI_SKIP_UPDATE_CHECK === "1" || !process.stderr.isTTY || SKIP_UPDATE_CHECK.has(command) ? null : startUpdateCheck();
36968
37208
  run().catch((error) => {
36969
37209
  process.stderr.write(
36970
37210
  `${error instanceof Error ? error.message : String(error)}
36971
37211
  `
36972
37212
  );
36973
37213
  process.exitCode = 1;
37214
+ }).finally(() => {
37215
+ void printUpdateNotice(updateNotice2);
36974
37216
  });
@@ -30,6 +30,7 @@ var ServiceEnum = /* @__PURE__ */ ((ServiceEnum2) => {
30
30
  ServiceEnum2["DataFiles"] = "DATA_FILES";
31
31
  ServiceEnum2["DataStreams"] = "DATA_STREAMS";
32
32
  ServiceEnum2["Discord"] = "DISCORD";
33
+ ServiceEnum2["Docusign"] = "DOCUSIGN";
33
34
  ServiceEnum2["Dropbox"] = "DROPBOX";
34
35
  ServiceEnum2["Gmail"] = "GMAIL";
35
36
  ServiceEnum2["GoogleCalendar"] = "GOOGLE_CALENDAR";
@@ -40,6 +41,7 @@ var ServiceEnum = /* @__PURE__ */ ((ServiceEnum2) => {
40
41
  ServiceEnum2["OracleCloud"] = "ORACLE_CLOUD";
41
42
  ServiceEnum2["OracleDatabase"] = "ORACLE_DATABASE";
42
43
  ServiceEnum2["Plaid"] = "PLAID";
44
+ ServiceEnum2["Quickbooks"] = "QUICKBOOKS";
43
45
  ServiceEnum2["Redis"] = "REDIS";
44
46
  ServiceEnum2["Sftp"] = "SFTP";
45
47
  ServiceEnum2["Snaptrade"] = "SNAPTRADE";
@@ -150,6 +152,7 @@ var NodeEnum = /* @__PURE__ */ ((NodeEnum2) => {
150
152
  NodeEnum2["databricksRunSql"] = "DATABRICKS_RUN_SQL";
151
153
  NodeEnum2["databricksStartWarehouse"] = "DATABRICKS_START_WAREHOUSE";
152
154
  NodeEnum2["discordWebhookSendMessage"] = "DISCORD_WEBHOOK_SEND_MESSAGE";
155
+ NodeEnum2["docusignSendEnvelope"] = "DOCUSIGN_SEND_ENVELOPE";
153
156
  NodeEnum2["docxToHtml"] = "DOCX_TO_HTML";
154
157
  NodeEnum2["docxToMarkdown"] = "DOCX_TO_MARKDOWN";
155
158
  NodeEnum2["documentToHtml"] = "DOCUMENT_TO_HTML";
@@ -277,6 +280,7 @@ var NodeEnum = /* @__PURE__ */ ((NodeEnum2) => {
277
280
  NodeEnum2["qualysGetQidsFromCves"] = "QUALYS_GET_QIDS_FROM_CVES";
278
281
  NodeEnum2["queryDataStream"] = "QUERY_DATA_STREAM";
279
282
  NodeEnum2["queryForItems"] = "QUERY_FOR_ITEMS";
283
+ NodeEnum2["quickbooksAction"] = "QUICKBOOKS_ACTION";
280
284
  NodeEnum2["rapidSevenAction"] = "RAPID_SEVEN_ACTION";
281
285
  NodeEnum2["readFilesFromLocalFolder"] = "READ_FILES_FROM_LOCAL_FOLDER";
282
286
  NodeEnum2["readFoldersFromLocalFolder"] = "READ_FOLDERS_FROM_LOCAL_FOLDER";
@@ -320,6 +324,7 @@ var NodeEnum = /* @__PURE__ */ ((NodeEnum2) => {
320
324
  NodeEnum2["sharePointUpdateFileProperties"] = "SHARE_POINT_UPDATE_FILE_PROPERTIES";
321
325
  NodeEnum2["sharePointUploadFile"] = "SHARE_POINT_UPLOAD_FILE";
322
326
  NodeEnum2["sharepointV2Action"] = "SHAREPOINT_V2_ACTION";
327
+ NodeEnum2["sharepointV2RestAction"] = "SHAREPOINT_V2_REST_ACTION";
323
328
  NodeEnum2["sharepointV2CreatePermission"] = "SHAREPOINT_V2_CREATE_PERMISSION";
324
329
  NodeEnum2["sharepointV2DeletePermission"] = "SHAREPOINT_V2_DELETE_PERMISSION";
325
330
  NodeEnum2["sharepointV2GetFile"] = "SHAREPOINT_V2_GET_FILE";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overaihq/cli",
3
- "version": "0.13.6",
3
+ "version": "0.13.8",
4
4
  "description": "Create, edit, deploy, and run OverAI workspace resources from the command line",
5
5
  "type": "module",
6
6
  "homepage": "https://overai.com",