@overaihq/cli 0.8.0 → 0.9.0

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
@@ -27110,7 +27110,7 @@ var runAutomation = async (args) => {
27110
27110
  // src/workspace/validateElements.ts
27111
27111
  var findings = (parsed) => parsed.success ? [] : parsed.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`);
27112
27112
  var validateAutomationElements = async (elements) => {
27113
- const { automationNodesSchema } = await import("./types-VTXVZF4K.js");
27113
+ const { automationNodesSchema } = await import("./types-RJF53EMD.js");
27114
27114
  return findings(automationNodesSchema.safeParse(elements));
27115
27115
  };
27116
27116
  var validateWebPageConfig = async (config) => {
@@ -33575,6 +33575,66 @@ var runDataStream = async (args) => {
33575
33575
  printResult(body, resolveFormat(flagValue(args, "-o", "--output")));
33576
33576
  };
33577
33577
 
33578
+ // src/commands/knowledgeBase.ts
33579
+ import { readFile as readFile2 } from "fs/promises";
33580
+ import { basename } from "path";
33581
+ var runKnowledgeBase = async (args) => {
33582
+ const [operation, id] = args;
33583
+ if (id == null || operation !== "upload" && operation !== "search") {
33584
+ throw new Error(
33585
+ "Usage: overai knowledge-base upload <id> <file...> | knowledge-base search <id> <query> [--limit N]"
33586
+ );
33587
+ }
33588
+ const { organizationId } = await getAccessToken();
33589
+ if (operation === "upload") {
33590
+ const paths = args.slice(2).filter(
33591
+ (arg, i, all) => !arg.startsWith("-") && all[i - 1] !== "-o" && all[i - 1] !== "--output"
33592
+ );
33593
+ if (paths.length === 0)
33594
+ throw new Error("Knowledge base upload requires at least one file path.");
33595
+ const uploads = [];
33596
+ for (const path of paths) {
33597
+ const bytes = await readFile2(path);
33598
+ const formData = new FormData();
33599
+ formData.append(
33600
+ "file",
33601
+ new Blob([new Uint8Array(bytes)]),
33602
+ basename(path)
33603
+ );
33604
+ const response2 = await v2Fetch(
33605
+ `/v2/knowledge-bases/${organizationId}/${id}/upload`,
33606
+ { method: "POST", body: formData }
33607
+ );
33608
+ const raw3 = await response2.text();
33609
+ if (!response2.ok) throw v2Error("knowledge-base upload", response2, raw3);
33610
+ uploads.push({ file: basename(path), ...JSON.parse(raw3) });
33611
+ }
33612
+ printResult(uploads, resolveFormat(flagValue(args, "-o", "--output")));
33613
+ return;
33614
+ }
33615
+ const query = args[2];
33616
+ if (query == null || query.startsWith("-"))
33617
+ throw new Error("Knowledge base search requires a query string.");
33618
+ const limit2 = flagValue(args, "--limit");
33619
+ const response = await v2Fetch(
33620
+ `/v2/knowledge-bases/${organizationId}/${id}/search`,
33621
+ {
33622
+ method: "POST",
33623
+ headers: { "Content-Type": "application/json" },
33624
+ body: JSON.stringify({
33625
+ query,
33626
+ ...limit2 != null ? { limit: Number(limit2) } : {}
33627
+ })
33628
+ }
33629
+ );
33630
+ const raw2 = await response.text();
33631
+ if (!response.ok) throw v2Error("knowledge-base search", response, raw2);
33632
+ printResult(
33633
+ JSON.parse(raw2),
33634
+ resolveFormat(flagValue(args, "-o", "--output"))
33635
+ );
33636
+ };
33637
+
33578
33638
  // src/commands/dev.ts
33579
33639
  import { createHash as createHash3 } from "crypto";
33580
33640
  import { watch } from "fs";
@@ -34605,6 +34665,7 @@ var resources = {
34605
34665
  IN: { collection: "integrations", mutation: "updateIntegration", result: "integration", patch: "IntegrationPatch", fields: "id name description isArchived integrationTypeId workspaceId", editable: ["name", "description", "isArchived", "integrationTypeId"] },
34606
34666
  TBS: { collection: "tableSpaces", mutation: "updateTableSpace", result: "tableSpace", patch: "TableSpacePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
34607
34667
  DS: { collection: "dataStreams", mutation: "updateDataStream", result: "dataStream", patch: "DataStreamPatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
34668
+ KB: { collection: "knowledgeBases", mutation: "updateKnowledgeBase", result: "knowledgeBase", patch: "KnowledgeBasePatch", fields: "id name description isArchived embeddingModel workspaceId", editable: ["name", "description", "isArchived"] },
34608
34669
  DF: { collection: "dataFiles", mutation: "updateDataFile", result: "dataFile", patch: "DataFilePatch", fields: "id name description isArchived workspaceId", editable: ["name", "description", "isArchived"] },
34609
34670
  AR: { collection: "actionRunners", mutation: "updateActionRunner", result: "actionRunner", patch: "ActionRunnerPatch", fields: "id isArchived actionTimeoutSeconds config workspaceId identityId identity { name }", editable: ["isArchived", "actionTimeoutSeconds", "config"] }
34610
34671
  };
@@ -34823,6 +34884,9 @@ language, customTitle, hideTopBar, ...). Push reassembles them.
34823
34884
  substituted into it (neither {x} nor Liquid {{ x }}). If the data depends on
34824
34885
  a search param, fetch it in the page instead. To clear it use JSON null; the
34825
34886
  string "null" is a four-character URL that fails at fetch time.
34887
+ - A printable page's print/save-to-PDF filename is the page's own title:
34888
+ customTitle if set, else "<name> - <date>"; page code can assign
34889
+ \`document.title\` at runtime to control it per render.
34826
34890
  - Printable page PDFs render in a headless browser that waits for network idle,
34827
34891
  so useEffect fetches DO resolve before capture. Load data in the page \u2014 you
34828
34892
  don't need to pre-fetch it into searchParams or stage it in storage. A blank
@@ -35868,6 +35932,8 @@ Other resources:
35868
35932
  overai data-stream query <id> --start <date> --end <date> [--query <filter>]
35869
35933
  overai data-file upload <id> <path> [-m <message>]
35870
35934
  overai data-file download <id> [path|-] | data-file head <id>
35935
+ overai knowledge-base upload <id> <file...>
35936
+ overai knowledge-base search <id> <query> [--limit N]
35871
35937
  overai integration configure <id> --config <json|@file|@->
35872
35938
  overai integration config <id> Read its masked configuration
35873
35939
  overai printable-page render <id> [--search-params <json|@file>]
@@ -36016,6 +36082,9 @@ var run = async () => {
36016
36082
  case "data-stream":
36017
36083
  await runDataStream(rest);
36018
36084
  return;
36085
+ case "knowledge-base":
36086
+ await runKnowledgeBase(rest);
36087
+ return;
36019
36088
  case "data-file":
36020
36089
  await runDataFile(rest);
36021
36090
  return;
@@ -59,6 +59,7 @@ var ServiceEnum = /* @__PURE__ */ ((ServiceEnum2) => {
59
59
  ServiceEnum2["Http"] = "HTTP";
60
60
  ServiceEnum2["HybridAnalysis"] = "HYBRID_ANALYSIS";
61
61
  ServiceEnum2["Jira"] = "JIRA";
62
+ ServiceEnum2["KnowledgeBases"] = "KNOWLEDGE_BASES";
62
63
  ServiceEnum2["Linkedin"] = "LINKEDIN";
63
64
  ServiceEnum2["LocalNetwork"] = "LOCAL_NETWORK";
64
65
  ServiceEnum2["MicrosoftDefender"] = "MICROSOFT_DEFENDER";
@@ -293,6 +294,7 @@ var NodeEnum = /* @__PURE__ */ ((NodeEnum2) => {
293
294
  NodeEnum2["saveToDataFile"] = "SAVE_TO_DATA_FILE";
294
295
  NodeEnum2["screenshotWebpage"] = "SCREENSHOT_WEBPAGE";
295
296
  NodeEnum2["searchCisaKevs"] = "SEARCH_CISA_KEVS";
297
+ NodeEnum2["searchKnowledgeBase"] = "SEARCH_KNOWLEDGE_BASE";
296
298
  NodeEnum2["sendEmail"] = "SEND_EMAIL";
297
299
  NodeEnum2["sendRequest"] = "SEND_REQUEST";
298
300
  NodeEnum2["sentinelOneAction"] = "SENTINEL_ONE_ACTION";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@overaihq/cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
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",