omnara 1.0.22 → 1.0.24

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 (2) hide show
  1. package/dist/bin.js +583 -150
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -19,6 +19,7 @@ import * as z from "zod";
19
19
  var zResourceName = z.string().min(1).refine((value) => Array.from(value).length <= 64, { message: "Resource name cannot exceed 64 Unicode characters" }).transform((value) => value.normalize("NFC")).refine((value) => Array.from(value).length <= 64, { message: "Resource name cannot exceed 64 Unicode characters" }).refine((value) => !new RegExp("^\\p{White_Space}|\\p{White_Space}$", "u").test(value), { message: "Resource name must not start or end with whitespace" }).refine((value) => !/[\p{Cc}\p{Cf}\p{Cs}\p{Default_Ignorable_Code_Point}⠀]/u.test(value), { message: "Resource name contains an unsupported invisible, control, or format character" }).refine((value) => !value.includes("\uFFFD"), { message: "Resource name contains the Unicode replacement character" }).refine((value) => !Array.from(value).some((character) => character !== " " && new RegExp("\\p{White_Space}", "u").test(character)), { message: "Resource name may only use ordinary spaces" });
20
20
  var zAgentName = z.string().refine((value) => Array.from(value).length <= 64, { message: "Resource name cannot exceed 64 Unicode characters" }).transform((value) => value.normalize("NFC")).refine((value) => Array.from(value).length <= 64, { message: "Resource name cannot exceed 64 Unicode characters" }).refine((value) => !new RegExp("^\\p{White_Space}|\\p{White_Space}$", "u").test(value), { message: "Resource name must not start or end with whitespace" }).refine((value) => !/[\p{Cc}\p{Cf}\p{Cs}\p{Default_Ignorable_Code_Point}⠀]/u.test(value), { message: "Resource name contains an unsupported invisible, control, or format character" }).refine((value) => !value.includes("\uFFFD"), { message: "Resource name contains the Unicode replacement character" }).refine((value) => !Array.from(value).some((character) => character !== " " && new RegExp("\\p{White_Space}", "u").test(character)), { message: "Resource name may only use ordinary spaces" });
21
21
  var zSkillName = z.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
22
+ var zMemoryStoreName = z.string().min(1).max(64).regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/);
22
23
  var zResourceListSort = z.enum([
23
24
  "name",
24
25
  "-name",
@@ -41,57 +42,40 @@ var zAgentConfigErrorIssue = z.object({
41
42
  });
42
43
  var zError = z.object({
43
44
  error: z.string(),
45
+ current_digest: z.string().regex(/^sha256:[0-9a-f]{64}$/).optional(),
44
46
  issues: z.array(zAgentConfigErrorIssue).optional(),
45
- code: z.enum([
46
- "invalid_request",
47
- "unauthorized",
48
- "forbidden",
49
- "not_found",
50
- "conflict",
51
- "gone",
52
- "request_too_large",
53
- "unsupported_media_type",
54
- "unprocessable",
55
- "upstream_unavailable",
56
- "rate_limited",
57
- "internal_error",
58
- "service_unavailable",
59
- "idempotency_key_conflict",
60
- "state_transition_conflict",
61
- "managed_work_admission_denied",
62
- "pending_work",
63
- "not_wake_capable",
64
- "daemon_runtime_unregistered",
65
- "validation_failed",
66
- "csrf_check_failed",
67
- "authentication_unavailable"
68
- ])
69
- });
70
- var zClientErrorCode = z.enum([
47
+ code: z.string()
48
+ });
49
+ var zErrorCode = z.enum([
71
50
  "invalid_request",
72
- "validation_failed",
73
51
  "unauthorized",
74
52
  "forbidden",
75
- "csrf_check_failed",
76
53
  "not_found",
77
54
  "conflict",
78
- "idempotency_key_conflict",
79
- "state_transition_conflict",
80
- "pending_work",
81
- "not_wake_capable",
55
+ "file_content_conflict",
56
+ "file_read_only",
57
+ "expected_digest_required",
58
+ "not_a_file",
82
59
  "gone",
83
- "daemon_runtime_unregistered",
84
60
  "request_too_large",
85
61
  "unsupported_media_type",
86
62
  "unprocessable",
87
63
  "upstream_unavailable",
88
- "rate_limited"
89
- ]);
90
- var zServerErrorCode = z.enum([
64
+ "rate_limited",
91
65
  "internal_error",
92
66
  "service_unavailable",
67
+ "idempotency_key_conflict",
68
+ "state_transition_conflict",
69
+ "managed_work_admission_denied",
70
+ "pending_work",
71
+ "not_wake_capable",
72
+ "daemon_runtime_unregistered",
73
+ "validation_failed",
74
+ "csrf_check_failed",
93
75
  "authentication_unavailable"
94
76
  ]);
77
+ var zClientErrorCode = z.string();
78
+ var zServerErrorCode = z.string();
95
79
  var zManagementKind = z.enum(["tenant", "cluster"]);
96
80
  var zOrganizationId = z.string().regex(/^org_[a-z2-7]{26}$/);
97
81
  var zOrgInvitationId = z.string().regex(/^oinv_[a-z2-7]{26}$/);
@@ -228,6 +212,7 @@ var zMachineDaemonTokenId = z.string().regex(/^mdt_[a-z2-7]{26}$/);
228
212
  var zSkillId = z.string().regex(/^skl_[a-z2-7]{26}$/);
229
213
  var zSkillRevisionId = z.string().regex(/^skr_[a-z2-7]{26}$/);
230
214
  var zSkillGrantId = z.string().regex(/^skg_[a-z2-7]{26}$/);
215
+ var zMemoryStoreId = z.string().regex(/^mst_[a-z2-7]{26}$/);
231
216
  var zSecretId = z.string().regex(/^sec_[a-z2-7]{26}$/);
232
217
  var zCreateModelProviderConfigRequest = z.object({
233
218
  name: zResourceName,
@@ -405,17 +390,17 @@ var zSkillOwner = z.discriminatedUnion("kind", [
405
390
  ]);
406
391
  var zCreateSkillRequest = z.object({
407
392
  owner: zSkillOwnerInput,
408
- archive: z.string()
393
+ archive: z.instanceof(Blob)
409
394
  });
410
395
  var zUpdateSkillRequest = z.intersection(z.union([
411
396
  z.object({
412
- archive: z.string()
397
+ archive: z.instanceof(Blob)
413
398
  }),
414
399
  z.object({
415
400
  skill_md: z.string()
416
401
  })
417
402
  ]), z.object({
418
- archive: z.string().optional(),
403
+ archive: z.instanceof(Blob).optional(),
419
404
  skill_md: z.string().optional()
420
405
  }));
421
406
  var zSkillFile = z.object({
@@ -469,6 +454,51 @@ var zSkillGrant = z.object({
469
454
  target_project_id: zProjectId,
470
455
  created_at: zTimestamp
471
456
  });
457
+ var zMemoryStoreAccess = z.enum(["read", "read_write"]);
458
+ var zMemoryStore = z.object({
459
+ id: zMemoryStoreId,
460
+ name: zMemoryStoreName,
461
+ description: z.string().refine((value) => Array.from(value).length <= 1024, { message: "String cannot exceed 1024 Unicode characters" }),
462
+ agent_access: zMemoryStoreAccess,
463
+ created_at: z.iso.datetime({ offset: true }),
464
+ updated_at: z.iso.datetime({ offset: true })
465
+ });
466
+ var zCreateMemoryStore = z.object({
467
+ name: zMemoryStoreName,
468
+ description: z.string().refine((value) => Array.from(value).length <= 1024, { message: "String cannot exceed 1024 Unicode characters" }).optional(),
469
+ agent_access: zMemoryStoreAccess.optional().default("read_write")
470
+ });
471
+ var zUpdateMemoryStore = z.object({
472
+ description: z.string().refine((value) => Array.from(value).length <= 1024, { message: "String cannot exceed 1024 Unicode characters" }).optional(),
473
+ agent_access: zMemoryStoreAccess.optional()
474
+ });
475
+ var zMemoryStoreList = z.object({
476
+ data: z.array(zMemoryStore),
477
+ next_cursor: z.string().nullable()
478
+ });
479
+ var zMemoryRegularFile = z.object({
480
+ path: z.string(),
481
+ type: z.enum(["file"]),
482
+ size_bytes: z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
483
+ modified_at: zTimestamp
484
+ });
485
+ var zMemoryDirectory = z.object({
486
+ path: z.string(),
487
+ type: z.enum(["directory"]),
488
+ modified_at: zTimestamp
489
+ });
490
+ var zMemoryFile = z.discriminatedUnion("type", [
491
+ zMemoryRegularFile.extend({ type: z.literal("file") }),
492
+ zMemoryDirectory.extend({ type: z.literal("directory") })
493
+ ]);
494
+ var zMemoryFileList = z.object({
495
+ data: z.array(zMemoryFile),
496
+ next_cursor: z.string().nullable()
497
+ });
498
+ var zUploadFileResponse = z.object({
499
+ path: z.string(),
500
+ digest: z.string().regex(/^sha256:[0-9a-f]{64}$/)
501
+ });
472
502
  var zMcpoAuthStartMetadata = z.record(z.string(), z.string().max(512));
473
503
  var zMcpoAuthStartResponse = z.object({
474
504
  flow_id: zMcpoAuthFlowId,
@@ -771,6 +801,10 @@ var zCompiledMcpServer = z.object({
771
801
  var zCompiledSkill = z.object({
772
802
  id: zSkillId
773
803
  });
804
+ var zCompiledMemoryStore = z.object({
805
+ id: zMemoryStoreId,
806
+ access: zMemoryStoreAccess
807
+ });
774
808
  var zCompiledSubagentModel = z.object({
775
809
  configured_model_id: zConfiguredModelId.optional(),
776
810
  context_window_tokens: z.int().optional(),
@@ -808,6 +842,7 @@ var zCompiledAgentConfig = z.object({
808
842
  mcp: z.record(z.string(), zCompiledMcpServer).optional(),
809
843
  event_webhook: zCompiledEventWebhook.optional(),
810
844
  skills: z.array(zCompiledSkill).optional(),
845
+ memory_stores: z.array(zCompiledMemoryStore).optional(),
811
846
  subagents: z.record(z.string(), zCompiledSubagent).optional(),
812
847
  max_subagents: z.int().optional(),
813
848
  max_depth: z.int().optional()
@@ -2240,9 +2275,6 @@ var zBootstrapDaemonResponse = z.object({
2240
2275
  installation_id: zInstallationId,
2241
2276
  machine_id: zMachineId
2242
2277
  });
2243
- var zUploadArtifactResponse = z.object({
2244
- artifact_id: zArtifactId
2245
- });
2246
2278
  var zCreateProjectRequest = z.object({
2247
2279
  name: zResourceName
2248
2280
  });
@@ -2714,6 +2746,82 @@ var zListProjectAvailableSkillsQuery = z.object({
2714
2746
  cursor: z.string().max(1024).optional()
2715
2747
  });
2716
2748
  var zListProjectAvailableSkillsResponse = zListProjectSkillAccessesResponse;
2749
+ var zListMemoryStoresPath = z.object({
2750
+ orgID: zOrganizationId,
2751
+ projectID: zProjectId
2752
+ });
2753
+ var zListMemoryStoresQuery = z.object({
2754
+ limit: z.int().gte(1).lte(100).optional().default(50),
2755
+ name: z.string().min(1).max(200).optional(),
2756
+ cursor: z.string().max(1024).optional()
2757
+ });
2758
+ var zListMemoryStoresResponse = zMemoryStoreList;
2759
+ var zCreateMemoryStoreBody = zCreateMemoryStore;
2760
+ var zCreateMemoryStorePath = z.object({
2761
+ orgID: zOrganizationId,
2762
+ projectID: zProjectId
2763
+ });
2764
+ var zCreateMemoryStoreResponse = zMemoryStore;
2765
+ var zDeleteMemoryStorePath = z.object({
2766
+ orgID: zOrganizationId,
2767
+ projectID: zProjectId,
2768
+ memoryStoreID: zMemoryStoreId
2769
+ });
2770
+ var zDeleteMemoryStoreResponse = z.void();
2771
+ var zGetMemoryStorePath = z.object({
2772
+ orgID: zOrganizationId,
2773
+ projectID: zProjectId,
2774
+ memoryStoreID: zMemoryStoreId
2775
+ });
2776
+ var zGetMemoryStoreResponse = zMemoryStore;
2777
+ var zUpdateMemoryStoreBody = zUpdateMemoryStore;
2778
+ var zUpdateMemoryStorePath = z.object({
2779
+ orgID: zOrganizationId,
2780
+ projectID: zProjectId,
2781
+ memoryStoreID: zMemoryStoreId
2782
+ });
2783
+ var zUpdateMemoryStoreResponse = zMemoryStore;
2784
+ var zListMemoryFilesPath = z.object({
2785
+ orgID: zOrganizationId,
2786
+ projectID: zProjectId,
2787
+ memoryStoreID: zMemoryStoreId
2788
+ });
2789
+ var zListMemoryFilesQuery = z.object({
2790
+ path: z.string().max(1024).optional(),
2791
+ limit: z.int().gte(1).lte(100).optional().default(50),
2792
+ cursor: z.string().max(1024).optional()
2793
+ });
2794
+ var zListMemoryFilesResponse = zMemoryFileList;
2795
+ var zDeleteMemoryFilePath = z.object({
2796
+ orgID: zOrganizationId,
2797
+ projectID: zProjectId,
2798
+ memoryStoreID: zMemoryStoreId
2799
+ });
2800
+ var zDeleteMemoryFileQuery = z.object({
2801
+ path: z.string().max(1024),
2802
+ expected_digest: z.string().regex(/^sha256:[0-9a-f]{64}$/)
2803
+ });
2804
+ var zDeleteMemoryFileResponse = z.void();
2805
+ var zDownloadMemoryFilePath = z.object({
2806
+ orgID: zOrganizationId,
2807
+ projectID: zProjectId,
2808
+ memoryStoreID: zMemoryStoreId
2809
+ });
2810
+ var zDownloadMemoryFileQuery = z.object({
2811
+ path: z.string().max(1024)
2812
+ });
2813
+ var zDownloadMemoryFileResponse = z.instanceof(Blob);
2814
+ var zWriteMemoryFileBody = z.instanceof(Blob);
2815
+ var zWriteMemoryFilePath = z.object({
2816
+ orgID: zOrganizationId,
2817
+ projectID: zProjectId,
2818
+ memoryStoreID: zMemoryStoreId
2819
+ });
2820
+ var zWriteMemoryFileQuery = z.object({
2821
+ path: z.string().max(1024),
2822
+ expected_digest: z.string().regex(/^sha256:[0-9a-f]{64}$/).optional()
2823
+ });
2824
+ var zWriteMemoryFileResponse = zUploadFileResponse;
2717
2825
  var zListSecretsPath = z.object({
2718
2826
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/)
2719
2827
  });
@@ -3156,7 +3264,7 @@ var zGetArtifactContentPath = z.object({
3156
3264
  agentID: z.string().regex(/^agt_[a-z2-7]{26}$/),
3157
3265
  artifactID: z.string().regex(/^art_[a-z2-7]{26}$/)
3158
3266
  });
3159
- var zGetArtifactContentResponse = z.string();
3267
+ var zGetArtifactContentResponse = z.instanceof(Blob);
3160
3268
  var zListVisibleProjectMachinesPath = z.object({
3161
3269
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
3162
3270
  projectID: z.string().regex(/^proj_[a-z2-7]{26}$/)
@@ -3486,20 +3594,19 @@ var zGetDaemonSkillArchiveQuery = z.object({
3486
3594
  expires_at: z.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
3487
3595
  download_token: z.string().length(64)
3488
3596
  });
3489
- var zGetDaemonSkillArchiveResponse = z.string();
3490
- var zUploadDaemonArtifactBody = z.string();
3491
- var zUploadDaemonArtifactPath = z.object({
3492
- toolCallID: zToolCallId
3597
+ var zGetDaemonSkillArchiveResponse = z.instanceof(Blob);
3598
+ var zDownloadDaemonFilePath = z.object({
3599
+ processID: zProcessId
3493
3600
  });
3494
- var zUploadDaemonArtifactQuery = z.object({
3495
- filename: z.string().min(1).max(255)
3601
+ var zDownloadDaemonFileResponse = z.instanceof(Blob);
3602
+ var zUploadDaemonFileBody = z.instanceof(Blob);
3603
+ var zUploadDaemonFilePath = z.object({
3604
+ processID: zProcessId
3496
3605
  });
3497
- var zUploadDaemonArtifactResponse = zUploadArtifactResponse;
3498
- var zDownloadDaemonArtifactPath = z.object({
3499
- toolCallID: zToolCallId,
3500
- artifactID: zArtifactId
3606
+ var zUploadDaemonFileQuery = z.object({
3607
+ filename: z.string().optional()
3501
3608
  });
3502
- var zDownloadDaemonArtifactResponse = z.string();
3609
+ var zUploadDaemonFileResponse = zUploadFileResponse;
3503
3610
 
3504
3611
  // ../sdk/src/json-body.ts
3505
3612
  import * as z2 from "zod";
@@ -3564,22 +3671,21 @@ var zErrorBody = zJsonText.pipe(zJsonBody);
3564
3671
  var zErrorResponse = relaxedSchema(
3565
3672
  zError.partial({ code: true }).extend({ error_description: z4.string().optional() })
3566
3673
  );
3567
- function issuesFromBody(body) {
3568
- const parsed = zErrorResponse.safeParse(body);
3569
- return parsed.success ? parsed.data.issues ?? [] : [];
3570
- }
3571
3674
  var ApiError = class _ApiError extends Error {
3572
3675
  status;
3573
3676
  code;
3574
3677
  body;
3575
3678
  issues;
3679
+ currentDigest;
3576
3680
  constructor(status, message, code, body) {
3577
3681
  super(message);
3578
3682
  this.name = "ApiError";
3579
3683
  this.status = status;
3580
3684
  this.code = code;
3581
3685
  this.body = body;
3582
- this.issues = issuesFromBody(body);
3686
+ const parsed = zErrorResponse.safeParse(body);
3687
+ this.issues = parsed.data?.issues ?? [];
3688
+ this.currentDigest = parsed.data?.current_digest;
3583
3689
  }
3584
3690
  static async fromResponse(response) {
3585
3691
  const body = zErrorBody.safeParse(await response.clone().text());
@@ -3970,7 +4076,7 @@ function createSseClient({
3970
4076
  if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
3971
4077
  if (!response.body) throw new Error("No body in SSE response");
3972
4078
  const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
3973
- let buffer = "";
4079
+ let buffer2 = "";
3974
4080
  const abortHandler = () => {
3975
4081
  try {
3976
4082
  reader.cancel();
@@ -3982,10 +4088,10 @@ function createSseClient({
3982
4088
  while (true) {
3983
4089
  const { done, value } = await reader.read();
3984
4090
  if (done) break;
3985
- buffer += value;
3986
- buffer = buffer.replace(/\r\n?/g, "\n");
3987
- const chunks = buffer.split("\n\n");
3988
- buffer = chunks.pop() ?? "";
4091
+ buffer2 += value;
4092
+ buffer2 = buffer2.replace(/\r\n?/g, "\n");
4093
+ const chunks = buffer2.split("\n\n");
4094
+ buffer2 = chunks.pop() ?? "";
3989
4095
  for (const chunk of chunks) {
3990
4096
  const lines = chunk.split("\n");
3991
4097
  const dataLines = [];
@@ -4925,6 +5031,7 @@ __export(sdk_gen_exports, {
4925
5031
  createIntegrationOAuthSetup: () => createIntegrationOAuthSetup,
4926
5032
  createMachine: () => createMachine,
4927
5033
  createMachinePool: () => createMachinePool,
5034
+ createMemoryStore: () => createMemoryStore,
4928
5035
  createModelProviderConfig: () => createModelProviderConfig,
4929
5036
  createOrgApiKey: () => createOrgApiKey,
4930
5037
  createOrgInvitation: () => createOrgInvitation,
@@ -4948,6 +5055,8 @@ __export(sdk_gen_exports, {
4948
5055
  deleteIntegrationInstall: () => deleteIntegrationInstall,
4949
5056
  deleteMachine: () => deleteMachine,
4950
5057
  deleteMachinePool: () => deleteMachinePool,
5058
+ deleteMemoryFile: () => deleteMemoryFile,
5059
+ deleteMemoryStore: () => deleteMemoryStore,
4951
5060
  deleteModelProviderConfig: () => deleteModelProviderConfig,
4952
5061
  deleteOrgInvitation: () => deleteOrgInvitation,
4953
5062
  deleteOrganization: () => deleteOrganization,
@@ -4960,7 +5069,8 @@ __export(sdk_gen_exports, {
4960
5069
  deleteSkill: () => deleteSkill,
4961
5070
  deleteSkillGrant: () => deleteSkillGrant,
4962
5071
  demoteSteeringInputToQueued: () => demoteSteeringInputToQueued,
4963
- downloadDaemonArtifact: () => downloadDaemonArtifact,
5072
+ downloadDaemonFile: () => downloadDaemonFile,
5073
+ downloadMemoryFile: () => downloadMemoryFile,
4964
5074
  endMachineDaemonRuntime: () => endMachineDaemonRuntime,
4965
5075
  getActor: () => getActor,
4966
5076
  getAgent: () => getAgent,
@@ -4975,6 +5085,7 @@ __export(sdk_gen_exports, {
4975
5085
  getDaemonSkillArchive: () => getDaemonSkillArchive,
4976
5086
  getMachine: () => getMachine,
4977
5087
  getMachinePool: () => getMachinePool,
5088
+ getMemoryStore: () => getMemoryStore,
4978
5089
  getModelCatalog: () => getModelCatalog,
4979
5090
  getModelProviderConfig: () => getModelProviderConfig,
4980
5091
  getOrgApiKey: () => getOrgApiKey,
@@ -4999,6 +5110,8 @@ __export(sdk_gen_exports, {
4999
5110
  listMcpServerTools: () => listMcpServerTools,
5000
5111
  listMcpServers: () => listMcpServers,
5001
5112
  listMemberProjectAccess: () => listMemberProjectAccess,
5113
+ listMemoryFiles: () => listMemoryFiles,
5114
+ listMemoryStores: () => listMemoryStores,
5002
5115
  listModelProviderConfigs: () => listModelProviderConfigs,
5003
5116
  listOrgApiKeyProjectAccess: () => listOrgApiKeyProjectAccess,
5004
5117
  listOrgApiKeys: () => listOrgApiKeys,
@@ -5050,6 +5163,7 @@ __export(sdk_gen_exports, {
5050
5163
  updateCronTrigger: () => updateCronTrigger,
5051
5164
  updateMachine: () => updateMachine,
5052
5165
  updateMachinePool: () => updateMachinePool,
5166
+ updateMemoryStore: () => updateMemoryStore,
5053
5167
  updateModelProviderConfig: () => updateModelProviderConfig,
5054
5168
  updateOrgApiKey: () => updateOrgApiKey,
5055
5169
  updateOrgMember: () => updateOrgMember,
@@ -5057,7 +5171,8 @@ __export(sdk_gen_exports, {
5057
5171
  updateProjectModelGrant: () => updateProjectModelGrant,
5058
5172
  updateSecret: () => updateSecret,
5059
5173
  updateSkill: () => updateSkill,
5060
- uploadDaemonArtifact: () => uploadDaemonArtifact
5174
+ uploadDaemonFile: () => uploadDaemonFile,
5175
+ writeMemoryFile: () => writeMemoryFile
5061
5176
  });
5062
5177
  var listPersonalAccessTokens = (options) => (options?.client ?? client).get({
5063
5178
  responseValidator: relaxedResponseValidator(zListPersonalAccessTokensResponse2),
@@ -5788,6 +5903,165 @@ var listProjectAvailableSkills = (options) => (options.client ?? client).get({
5788
5903
  url: "/orgs/{orgID}/projects/{projectID}/skills",
5789
5904
  ...options
5790
5905
  });
5906
+ var listMemoryStores = (options) => (options.client ?? client).get({
5907
+ responseValidator: relaxedResponseValidator(zListMemoryStoresResponse),
5908
+ security: [{
5909
+ key: "bearerAuth",
5910
+ scheme: "bearer",
5911
+ type: "http"
5912
+ }, {
5913
+ in: "cookie",
5914
+ name: "__Host-omnara_session",
5915
+ type: "apiKey"
5916
+ }],
5917
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores",
5918
+ ...options
5919
+ });
5920
+ var createMemoryStore = (options) => (options.client ?? client).post({
5921
+ responseValidator: relaxedResponseValidator(zCreateMemoryStoreResponse),
5922
+ security: [
5923
+ {
5924
+ key: "bearerAuth",
5925
+ scheme: "bearer",
5926
+ type: "http"
5927
+ },
5928
+ {
5929
+ in: "cookie",
5930
+ name: "__Host-omnara_session",
5931
+ type: "apiKey"
5932
+ },
5933
+ { name: "X-Omnara-Csrf", type: "apiKey" }
5934
+ ],
5935
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores",
5936
+ ...options,
5937
+ headers: {
5938
+ "Content-Type": "application/json",
5939
+ ...options.headers
5940
+ }
5941
+ });
5942
+ var deleteMemoryStore = (options) => (options.client ?? client).delete({
5943
+ responseValidator: relaxedResponseValidator(zDeleteMemoryStoreResponse),
5944
+ security: [
5945
+ {
5946
+ key: "bearerAuth",
5947
+ scheme: "bearer",
5948
+ type: "http"
5949
+ },
5950
+ {
5951
+ in: "cookie",
5952
+ name: "__Host-omnara_session",
5953
+ type: "apiKey"
5954
+ },
5955
+ { name: "X-Omnara-Csrf", type: "apiKey" }
5956
+ ],
5957
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}",
5958
+ ...options
5959
+ });
5960
+ var getMemoryStore = (options) => (options.client ?? client).get({
5961
+ responseValidator: relaxedResponseValidator(zGetMemoryStoreResponse),
5962
+ security: [{
5963
+ key: "bearerAuth",
5964
+ scheme: "bearer",
5965
+ type: "http"
5966
+ }, {
5967
+ in: "cookie",
5968
+ name: "__Host-omnara_session",
5969
+ type: "apiKey"
5970
+ }],
5971
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}",
5972
+ ...options
5973
+ });
5974
+ var updateMemoryStore = (options) => (options.client ?? client).patch({
5975
+ responseValidator: relaxedResponseValidator(zUpdateMemoryStoreResponse),
5976
+ security: [
5977
+ {
5978
+ key: "bearerAuth",
5979
+ scheme: "bearer",
5980
+ type: "http"
5981
+ },
5982
+ {
5983
+ in: "cookie",
5984
+ name: "__Host-omnara_session",
5985
+ type: "apiKey"
5986
+ },
5987
+ { name: "X-Omnara-Csrf", type: "apiKey" }
5988
+ ],
5989
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}",
5990
+ ...options,
5991
+ headers: {
5992
+ "Content-Type": "application/json",
5993
+ ...options.headers
5994
+ }
5995
+ });
5996
+ var listMemoryFiles = (options) => (options.client ?? client).get({
5997
+ responseValidator: relaxedResponseValidator(zListMemoryFilesResponse),
5998
+ security: [{
5999
+ key: "bearerAuth",
6000
+ scheme: "bearer",
6001
+ type: "http"
6002
+ }, {
6003
+ in: "cookie",
6004
+ name: "__Host-omnara_session",
6005
+ type: "apiKey"
6006
+ }],
6007
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}/files",
6008
+ ...options
6009
+ });
6010
+ var deleteMemoryFile = (options) => (options.client ?? client).delete({
6011
+ responseValidator: relaxedResponseValidator(zDeleteMemoryFileResponse),
6012
+ security: [
6013
+ {
6014
+ key: "bearerAuth",
6015
+ scheme: "bearer",
6016
+ type: "http"
6017
+ },
6018
+ {
6019
+ in: "cookie",
6020
+ name: "__Host-omnara_session",
6021
+ type: "apiKey"
6022
+ },
6023
+ { name: "X-Omnara-Csrf", type: "apiKey" }
6024
+ ],
6025
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}/file",
6026
+ ...options
6027
+ });
6028
+ var downloadMemoryFile = (options) => (options.client ?? client).get({
6029
+ responseValidator: relaxedResponseValidator(zDownloadMemoryFileResponse),
6030
+ security: [{
6031
+ key: "bearerAuth",
6032
+ scheme: "bearer",
6033
+ type: "http"
6034
+ }, {
6035
+ in: "cookie",
6036
+ name: "__Host-omnara_session",
6037
+ type: "apiKey"
6038
+ }],
6039
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}/file",
6040
+ ...options
6041
+ });
6042
+ var writeMemoryFile = (options) => (options.client ?? client).put({
6043
+ bodySerializer: null,
6044
+ responseValidator: relaxedResponseValidator(zWriteMemoryFileResponse),
6045
+ security: [
6046
+ {
6047
+ key: "bearerAuth",
6048
+ scheme: "bearer",
6049
+ type: "http"
6050
+ },
6051
+ {
6052
+ in: "cookie",
6053
+ name: "__Host-omnara_session",
6054
+ type: "apiKey"
6055
+ },
6056
+ { name: "X-Omnara-Csrf", type: "apiKey" }
6057
+ ],
6058
+ url: "/orgs/{orgID}/projects/{projectID}/memory-stores/{memoryStoreID}/file",
6059
+ ...options,
6060
+ headers: {
6061
+ "Content-Type": "application/octet-stream",
6062
+ ...options.headers
6063
+ }
6064
+ });
5791
6065
  var listSecrets = (options) => (options.client ?? client).get({
5792
6066
  responseValidator: relaxedResponseValidator(zListSecretsResponse2),
5793
6067
  security: [{
@@ -7575,32 +7849,36 @@ var getDaemonSkillArchive = (options) => (options.client ?? client).get({
7575
7849
  url: "/daemon/skills/{skillID}/archive",
7576
7850
  ...options
7577
7851
  });
7578
- var uploadDaemonArtifact = (options) => (options.client ?? client).post({
7579
- bodySerializer: null,
7580
- responseValidator: relaxedResponseValidator(zUploadDaemonArtifactResponse),
7852
+ var downloadDaemonFile = (options) => (options.client ?? client).get({
7853
+ responseValidator: relaxedResponseValidator(zDownloadDaemonFileResponse),
7581
7854
  security: [{
7582
7855
  key: "machineDaemonAuth",
7583
7856
  scheme: "bearer",
7584
7857
  type: "http"
7585
7858
  }],
7586
- url: "/daemon/tool-calls/{toolCallID}/artifact",
7587
- ...options,
7588
- headers: {
7589
- "Content-Type": "application/octet-stream",
7590
- ...options.headers
7591
- }
7859
+ url: "/daemon/processes/{processID}/file",
7860
+ ...options
7592
7861
  });
7593
- var downloadDaemonArtifact = (options) => (options.client ?? client).get({
7594
- responseValidator: relaxedResponseValidator(zDownloadDaemonArtifactResponse),
7862
+ var uploadDaemonFile = (options) => (options.client ?? client).post({
7863
+ bodySerializer: null,
7864
+ responseValidator: relaxedResponseValidator(zUploadDaemonFileResponse),
7595
7865
  security: [{
7596
7866
  key: "machineDaemonAuth",
7597
7867
  scheme: "bearer",
7598
7868
  type: "http"
7599
7869
  }],
7600
- url: "/daemon/tool-calls/{toolCallID}/artifacts/{artifactID}/content",
7601
- ...options
7870
+ url: "/daemon/processes/{processID}/file",
7871
+ ...options,
7872
+ headers: {
7873
+ "Content-Type": "application/octet-stream",
7874
+ ...options.headers
7875
+ }
7602
7876
  });
7603
7877
 
7878
+ // ../sdk/src/memory.ts
7879
+ var MAX_MEMORY_FILE_BYTES = 10 * 1024 * 1024;
7880
+ var FILE_DIGEST_HEADER = "X-Omnara-File-Digest";
7881
+
7604
7882
  // src/config-file.ts
7605
7883
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
7606
7884
  import { homedir } from "node:os";
@@ -7791,6 +8069,7 @@ ${z8.prettifyError(error)}`);
7791
8069
  } else if (error instanceof ApiError) {
7792
8070
  const code = error.code ? ` [${error.code}]` : "";
7793
8071
  console.error(`error: API ${error.status}${code}: ${error.message}`);
8072
+ if (error.currentDigest) console.error(`current_digest: ${error.currentDigest}`);
7794
8073
  } else {
7795
8074
  console.error(`error: ${error instanceof Error ? error.message : String(error)}`);
7796
8075
  }
@@ -8811,10 +9090,10 @@ function registerLoginCommand(program2, cli) {
8811
9090
  }
8812
9091
 
8813
9092
  // src/manifest.ts
8814
- import * as z24 from "zod";
9093
+ import * as z26 from "zod";
8815
9094
 
8816
9095
  // src/agent-commands.ts
8817
- import * as z17 from "zod";
9096
+ import * as z18 from "zod";
8818
9097
 
8819
9098
  // ../sdk/src/generated/@tanstack/react-query.gen.ts
8820
9099
  import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
@@ -8919,7 +9198,10 @@ function useOmnaraClient() {
8919
9198
  import { z as z13 } from "zod";
8920
9199
  var generatedQueryKeyEntry = z13.object({
8921
9200
  _id: z13.string(),
8922
- path: z13.object({ orgID: z13.string().optional(), projectID: z13.string().optional() }).optional()
9201
+ path: z13.object({
9202
+ orgID: z13.string().optional(),
9203
+ projectID: z13.string().optional()
9204
+ }).optional()
8923
9205
  });
8924
9206
  function generatedQueryKey(query) {
8925
9207
  const parsed = generatedQueryKeyEntry.safeParse(query.queryKey[0]);
@@ -10165,49 +10447,52 @@ var mcpServerToolsStaleTime = 60 * 1e3;
10165
10447
  // ../react/src/domains/me.ts
10166
10448
  import { useMutation as useMutation11, useQueryClient as useQueryClient13, useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
10167
10449
 
10168
- // ../react/src/domains/model-providers.ts
10450
+ // ../react/src/domains/memory.ts
10169
10451
  import {
10452
+ skipToken,
10170
10453
  useInfiniteQuery as useInfiniteQuery9,
10171
10454
  useMutation as useMutation12,
10172
- useQueries,
10173
10455
  useQuery as useQuery12,
10174
10456
  useQueryClient as useQueryClient14
10175
10457
  } from "@tanstack/react-query";
10458
+ import * as z15 from "zod";
10459
+ var memoryFileDigest = z15.object({ digest: z15.string() });
10460
+
10461
+ // ../react/src/domains/model-providers.ts
10462
+ import {
10463
+ useInfiniteQuery as useInfiniteQuery10,
10464
+ useMutation as useMutation13,
10465
+ useQueries,
10466
+ useQuery as useQuery13,
10467
+ useQueryClient as useQueryClient15
10468
+ } from "@tanstack/react-query";
10176
10469
  import { useEffect as useEffect2 } from "react";
10177
10470
  var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
10178
10471
 
10179
10472
  // ../react/src/domains/org-api-keys.ts
10180
- import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation13, useQuery as useQuery13, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
10473
+ import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery14, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
10181
10474
 
10182
10475
  // ../react/src/domains/org-members.ts
10183
- import { useMutation as useMutation14, useQuery as useQuery14, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
10476
+ import { useMutation as useMutation15, useQuery as useQuery15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
10184
10477
 
10185
10478
  // ../react/src/domains/orgs.ts
10186
- import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation15, useQuery as useQuery15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
10479
+ import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation16, useQuery as useQuery16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
10187
10480
 
10188
10481
  // ../react/src/domains/personal-access-tokens.ts
10189
- import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
10482
+ import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
10190
10483
 
10191
10484
  // ../react/src/domains/project-grants.ts
10192
- import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
10485
+ import { useInfiniteQuery as useInfiniteQuery14, useMutation as useMutation18, useQueryClient as useQueryClient20 } from "@tanstack/react-query";
10193
10486
 
10194
10487
  // ../react/src/domains/projects.ts
10195
10488
  import {
10196
- skipToken,
10197
- useInfiniteQuery as useInfiniteQuery14,
10198
- useQueryClient as useQueryClient20,
10489
+ skipToken as skipToken2,
10490
+ useInfiniteQuery as useInfiniteQuery15,
10491
+ useQueryClient as useQueryClient21,
10199
10492
  useSuspenseInfiniteQuery
10200
10493
  } from "@tanstack/react-query";
10201
10494
 
10202
10495
  // ../react/src/domains/secrets.ts
10203
- import {
10204
- useInfiniteQuery as useInfiniteQuery15,
10205
- useMutation as useMutation18,
10206
- useQuery as useQuery16,
10207
- useQueryClient as useQueryClient21
10208
- } from "@tanstack/react-query";
10209
-
10210
- // ../react/src/domains/skills.ts
10211
10496
  import {
10212
10497
  useInfiniteQuery as useInfiniteQuery16,
10213
10498
  useMutation as useMutation19,
@@ -10215,8 +10500,16 @@ import {
10215
10500
  useQueryClient as useQueryClient22
10216
10501
  } from "@tanstack/react-query";
10217
10502
 
10503
+ // ../react/src/domains/skills.ts
10504
+ import {
10505
+ useInfiniteQuery as useInfiniteQuery17,
10506
+ useMutation as useMutation20,
10507
+ useQuery as useQuery18,
10508
+ useQueryClient as useQueryClient23
10509
+ } from "@tanstack/react-query";
10510
+
10218
10511
  // ../react/src/domains/tool-catalog.ts
10219
- import { useQuery as useQuery18 } from "@tanstack/react-query";
10512
+ import { useQuery as useQuery19 } from "@tanstack/react-query";
10220
10513
 
10221
10514
  // src/chat.tsx
10222
10515
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
@@ -10225,10 +10518,10 @@ import { render } from "ink";
10225
10518
  // src/chat-ui.tsx
10226
10519
  import { Box as Box2, Static, Text as Text2, useApp } from "ink";
10227
10520
  import { useEffect as useEffect3, useMemo as useMemo2, useReducer, useState as useState2 } from "react";
10228
- import * as z16 from "zod";
10521
+ import * as z17 from "zod";
10229
10522
 
10230
10523
  // src/agent-rendering.ts
10231
- import * as z15 from "zod";
10524
+ import * as z16 from "zod";
10232
10525
  var formatAgentEventList = (response) => {
10233
10526
  const page = {
10234
10527
  data: response.data.map((event) => ({
@@ -10245,10 +10538,10 @@ var formatAgentEventList = (response) => {
10245
10538
  return { value: next_before_sequence == null ? page : { ...page, next_before_sequence } };
10246
10539
  };
10247
10540
  var summaryWidth = 100;
10248
- var zJsonValue = z15.json();
10249
- var zRunCommandInput = z15.object({ command: z15.string() });
10541
+ var zJsonValue = z16.json();
10542
+ var zRunCommandInput = z16.object({ command: z16.string() });
10250
10543
  function summaryValue(value) {
10251
- const text = z15.string().safeParse(value);
10544
+ const text = z16.string().safeParse(value);
10252
10545
  return text.success ? text.data : JSON.stringify(value);
10253
10546
  }
10254
10547
  function toolCallSummary(name, input) {
@@ -10442,10 +10735,10 @@ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
10442
10735
  var spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
10443
10736
  var streamingTailLines = 8;
10444
10737
  var streamingTailChars = 1500;
10445
- var zToolInput2 = z16.record(z16.string(), z16.json());
10446
- var zToolOutput = z16.object({
10738
+ var zToolInput2 = z17.record(z17.string(), z17.json());
10739
+ var zToolOutput = z17.object({
10447
10740
  outcome: zToolCallOutcome,
10448
- contentBlocks: z16.array(zToolResultContentBlock)
10741
+ contentBlocks: z17.array(zToolResultContentBlock)
10449
10742
  });
10450
10743
  function formatDuration(ms) {
10451
10744
  const seconds = Math.max(1, Math.round(ms / 1e3));
@@ -10811,7 +11104,7 @@ var agentEventsStreamOp = customOp({
10811
11104
  },
10812
11105
  run: async ({ client: client2, path, args, options }) => {
10813
11106
  const agentID = parseWithSchema(zAgentId, args[0], "agent id");
10814
- const afterSequence = parseWithSchema(z17.int().gte(0).optional(), options.afterSequence, "--after-sequence") ?? 0;
11107
+ const afterSequence = parseWithSchema(z18.int().gte(0).optional(), options.afterSequence, "--after-sequence") ?? 0;
10815
11108
  const abort = new AbortController();
10816
11109
  process.once("SIGINT", () => {
10817
11110
  abort.abort();
@@ -10828,12 +11121,12 @@ var agentEventsStreamOp = customOp({
10828
11121
 
10829
11122
  // src/config-attachment.ts
10830
11123
  import { readFileSync as readFileSync2 } from "node:fs";
10831
- import * as z18 from "zod";
10832
- var zConfigSourceAttachment = z18.object({
10833
- file: z18.string().min(1).optional().describe("path to an agent config file (.yaml, .yml, or .json)"),
10834
- source: z18.string().min(1).optional().describe("inline agent config source (YAML or JSON)")
11124
+ import * as z19 from "zod";
11125
+ var zConfigSourceAttachment = z19.object({
11126
+ file: z19.string().min(1).optional().describe("path to an agent config file (.yaml, .yml, or .json)"),
11127
+ source: z19.string().min(1).optional().describe("inline agent config source (YAML or JSON)")
10835
11128
  });
10836
- var zConfigAttachment = z18.object({
11129
+ var zConfigAttachment = z19.object({
10837
11130
  config: zAgentConfigId.optional().describe("existing agent config ID"),
10838
11131
  ...zConfigSourceAttachment.shape
10839
11132
  });
@@ -10919,7 +11212,7 @@ import { spawn as spawn2, spawnSync } from "node:child_process";
10919
11212
  import { accessSync, constants, existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
10920
11213
  import { homedir as homedir2, release } from "node:os";
10921
11214
  import { basename, dirname as dirname2, isAbsolute, join as join2, resolve } from "node:path";
10922
- import * as z19 from "zod";
11215
+ import * as z20 from "zod";
10923
11216
  var zMachineSetupBody = zConnectByoMachineRequest;
10924
11217
  async function connectMachine(context) {
10925
11218
  const { client: client2, path, body, report } = context;
@@ -10956,9 +11249,9 @@ var daemonConfigFileName = "daemon.json";
10956
11249
  var installLockFileName = "install.lock";
10957
11250
  var daemonLockFileName = "daemon.lock";
10958
11251
  var daemonLockPollMs = 250;
10959
- var zDaemonConfigFile = z19.looseObject({
10960
- machine_id: z19.string().optional(),
10961
- api_url: z19.string().optional()
11252
+ var zDaemonConfigFile = z20.looseObject({
11253
+ machine_id: z20.string().optional(),
11254
+ api_url: z20.string().optional()
10962
11255
  });
10963
11256
  function daemonHome() {
10964
11257
  const override = process.env.OMNARA_HOME;
@@ -11240,10 +11533,10 @@ function runInstaller(report, apiUrl, token, machineId, home) {
11240
11533
 
11241
11534
  // src/mcp-add.ts
11242
11535
  import { isMap, isScalar as isScalar2, parseDocument } from "yaml";
11243
- import * as z21 from "zod";
11536
+ import * as z22 from "zod";
11244
11537
 
11245
11538
  // src/mcp-oauth.ts
11246
- import * as z20 from "zod";
11539
+ import * as z21 from "zod";
11247
11540
  async function authorizeMcpOAuthSecret(options) {
11248
11541
  const { data: start } = await sdk_gen_exports.startSecretMcpoAuth({
11249
11542
  client: options.client,
@@ -11264,7 +11557,7 @@ async function authorizeMcpOAuthSecret(options) {
11264
11557
  }
11265
11558
  });
11266
11559
  }
11267
- var zBrowserFlag = z20.boolean().default(true).describe("open the authorization URL in a browser");
11560
+ var zBrowserFlag = z21.boolean().default(true).describe("open the authorization URL in a browser");
11268
11561
  function openAuthorizationUrl(report, title, url4, browser) {
11269
11562
  report.url(title, url4);
11270
11563
  if (browser) {
@@ -11300,7 +11593,7 @@ async function runMcpOAuth(context) {
11300
11593
  // src/mcp-add.ts
11301
11594
  var SERVER_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]{0,31}$/;
11302
11595
  var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend({
11303
- server_name: z21.string().regex(
11596
+ server_name: z22.string().regex(
11304
11597
  SERVER_KEY_PATTERN,
11305
11598
  "must start with a letter and contain at most 32 letters, digits, or hyphens"
11306
11599
  ).describe("MCP server key used in the agent config"),
@@ -11313,7 +11606,7 @@ function targetLabel(target) {
11313
11606
  function serverEntry(url4, secretId) {
11314
11607
  return { url: url4, auth: { type: "oauth", secret_id: secretId } };
11315
11608
  }
11316
- var zJsonRecord = z21.record(z21.string(), z21.json());
11609
+ var zJsonRecord = z22.record(z22.string(), z22.json());
11317
11610
  function prepareJsonConfig(config2, serverName, mcpUrl) {
11318
11611
  const json8 = zJsonText.safeParse(config2.source ?? "");
11319
11612
  if (!json8.success) throw new CliInputError("the current agent config contains invalid JSON");
@@ -11472,14 +11765,61 @@ function runProfileMcpAdd(context) {
11472
11765
  return runMcpAdd(context, "profile", context.path.agentProfileID);
11473
11766
  }
11474
11767
 
11768
+ // src/memory-files.ts
11769
+ import { open, writeFile } from "node:fs/promises";
11770
+ import { buffer } from "node:stream/consumers";
11771
+ import * as z23 from "zod";
11772
+ var zMemoryUploadBody = z23.object({
11773
+ file: z23.string().min(1).describe("local file to upload")
11774
+ });
11775
+ async function loadMemoryUpload(file) {
11776
+ const handle = await open(file, "r");
11777
+ try {
11778
+ if ((await handle.stat()).size > MAX_MEMORY_FILE_BYTES) {
11779
+ throw new CliInputError("memory file exceeds the 10 MiB upload limit");
11780
+ }
11781
+ const bytes = await buffer(
11782
+ handle.createReadStream({ end: MAX_MEMORY_FILE_BYTES, autoClose: false })
11783
+ );
11784
+ if (bytes.length > MAX_MEMORY_FILE_BYTES) {
11785
+ throw new CliInputError("memory file exceeds the 10 MiB upload limit");
11786
+ }
11787
+ return new Blob([new Uint8Array(bytes)]);
11788
+ } finally {
11789
+ await handle.close();
11790
+ }
11791
+ }
11792
+ var memoryDownloadOp = customOp({
11793
+ verb: "download",
11794
+ summary: "Download a memory file",
11795
+ path: zDownloadMemoryFilePath,
11796
+ configure: (command) => {
11797
+ command.requiredOption("--path <path>", "file path relative to the store root").requiredOption("--output <file>", "local destination; must not already exist").option("--json", "print download metadata as JSON");
11798
+ },
11799
+ run: async ({ client: client2, path, options }) => {
11800
+ const query = parseWithSchema(
11801
+ zDownloadMemoryFileQuery,
11802
+ { path: options.path ?? null },
11803
+ "query flags"
11804
+ );
11805
+ const output = parseWithSchema(z23.string().min(1), options.output, "--output");
11806
+ const { response } = await sdk_gen_exports.downloadMemoryFile({ client: client2, path, query, parseAs: "stream" });
11807
+ const digest = response.headers.get(FILE_DIGEST_HEADER);
11808
+ if (!digest) throw new CliInputError("file response is missing its digest");
11809
+ const bytes = new Uint8Array(await response.arrayBuffer());
11810
+ await writeFile(output, bytes, { flag: "wx" });
11811
+ renderResult({ output, digest }, options.json === true);
11812
+ }
11813
+ });
11814
+
11475
11815
  // src/skill-archive.ts
11476
11816
  import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync } from "node:fs";
11477
11817
  import { basename as basename2, dirname as dirname3, join as join3, resolve as resolve2 } from "node:path";
11478
11818
  import * as tar from "tar";
11479
- import * as z22 from "zod";
11480
- var zCreateSkillCliBody = z22.object({
11819
+ import * as z24 from "zod";
11820
+ var zCreateSkillCliBody = z24.object({
11481
11821
  owner: zSkillOwnerInput,
11482
- archive: z22.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
11822
+ archive: z24.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
11483
11823
  });
11484
11824
  var ARCHIVE_SUFFIXES = [".zip", ".tar.gz", ".tgz"];
11485
11825
  function assertPackable(dir) {
@@ -11508,8 +11848,8 @@ async function loadSkillArchive(archivePath) {
11508
11848
  throw new CliInputError(`archive path not found: ${archivePath}`);
11509
11849
  }
11510
11850
  if (isDirectory) {
11511
- const buffer = await packDirectory(archivePath);
11512
- return new File([new Uint8Array(buffer)], `${basename2(resolve2(archivePath))}.tar.gz`);
11851
+ const buffer2 = await packDirectory(archivePath);
11852
+ return new File([new Uint8Array(buffer2)], `${basename2(resolve2(archivePath))}.tar.gz`);
11513
11853
  }
11514
11854
  const filename = basename2(archivePath);
11515
11855
  if (!ARCHIVE_SUFFIXES.some((suffix) => filename.toLowerCase().endsWith(suffix))) {
@@ -11521,16 +11861,16 @@ async function loadSkillArchive(archivePath) {
11521
11861
  }
11522
11862
 
11523
11863
  // src/slack-integration.ts
11524
- import * as z23 from "zod";
11525
- var zSlackBody = z23.object({
11526
- app_name: z23.string().optional().describe("name for a new Slack app"),
11527
- app_configuration_token: z23.string().optional().describe("Slack app configuration token for a new app"),
11528
- icon_filename: z23.string().optional().describe("filename for the new Slack app icon"),
11529
- icon_data_base64: z23.string().optional().describe("base64-encoded Slack app icon"),
11530
- client_id: z23.string().optional().describe("existing Slack app client ID"),
11531
- client_secret: z23.string().optional().describe("existing Slack app client secret"),
11532
- signing_secret: z23.string().optional().describe("existing Slack app signing secret"),
11533
- return_to: z23.string().optional().describe("console-relative path opened after authorization"),
11864
+ import * as z25 from "zod";
11865
+ var zSlackBody = z25.object({
11866
+ app_name: z25.string().optional().describe("name for a new Slack app"),
11867
+ app_configuration_token: z25.string().optional().describe("Slack app configuration token for a new app"),
11868
+ icon_filename: z25.string().optional().describe("filename for the new Slack app icon"),
11869
+ icon_data_base64: z25.string().optional().describe("base64-encoded Slack app icon"),
11870
+ client_id: z25.string().optional().describe("existing Slack app client ID"),
11871
+ client_secret: z25.string().optional().describe("existing Slack app client secret"),
11872
+ signing_secret: z25.string().optional().describe("existing Slack app signing secret"),
11873
+ return_to: z25.string().optional().describe("console-relative path opened after authorization"),
11534
11874
  browser: zBrowserFlag
11535
11875
  });
11536
11876
  function parseRequest(body) {
@@ -11560,7 +11900,7 @@ function parseRequest(body) {
11560
11900
  if (!result2.success) {
11561
11901
  throw new CliInputError(
11562
11902
  `invalid existing Slack app parameters:
11563
- ${z23.prettifyError(result2.error)}`
11903
+ ${z25.prettifyError(result2.error)}`
11564
11904
  );
11565
11905
  }
11566
11906
  return { kind: "existing-app", body: result2.data };
@@ -11581,7 +11921,7 @@ ${z23.prettifyError(result2.error)}`
11581
11921
  if (!result.success) {
11582
11922
  throw new CliInputError(
11583
11923
  `invalid Slack app parameters:
11584
- ${z23.prettifyError(result.error)}
11924
+ ${z25.prettifyError(result.error)}
11585
11925
  Pass --app-name and --app-configuration-token, or existing app credentials.`
11586
11926
  );
11587
11927
  }
@@ -11680,7 +12020,7 @@ var commandGroups = [
11680
12020
  body: zConfigAttachment.extend({
11681
12021
  profile: zAgentProfileId.optional(),
11682
12022
  name: zAgentName.optional(),
11683
- message: z24.string().optional()
12023
+ message: z26.string().optional()
11684
12024
  }),
11685
12025
  transformBody: async ({ profile, name, message, ...attachment }, { client: client2, path }) => ({
11686
12026
  profile,
@@ -11721,7 +12061,7 @@ var commandGroups = [
11721
12061
  flowOp({
11722
12062
  verb: "mcp-add",
11723
12063
  summary: "Create an OAuth secret and add an MCP server to an agent",
11724
- path: z24.object({
12064
+ path: z26.object({
11725
12065
  orgID: zOrganizationId,
11726
12066
  projectID: zProjectId,
11727
12067
  agentID: zAgentId
@@ -11737,7 +12077,7 @@ var commandGroups = [
11737
12077
  format: (response) => formatRecord()(response.agent_input),
11738
12078
  path: zCreateAgentInputPath,
11739
12079
  body: zCreateAgentInputBody.partial({ content_blocks: true }).extend({
11740
- message: z24.string().optional().describe("plain text to send as a single text block")
12080
+ message: z26.string().optional().describe("plain text to send as a single text block")
11741
12081
  }).transform(({ message, content_blocks, ...rest }, ctx) => {
11742
12082
  if (content_blocks !== void 0 && message === void 0) {
11743
12083
  return { ...rest, content_blocks };
@@ -11746,7 +12086,7 @@ var commandGroups = [
11746
12086
  return { ...rest, content_blocks: [{ type: "text", text: message }] };
11747
12087
  }
11748
12088
  ctx.addIssue("pass exactly one of --message or --content-blocks");
11749
- return z24.NEVER;
12089
+ return z26.NEVER;
11750
12090
  })
11751
12091
  })
11752
12092
  ],
@@ -11763,8 +12103,8 @@ var commandGroups = [
11763
12103
  format: formatAgentEventList,
11764
12104
  path: zListEventsPath,
11765
12105
  query: zListEventsQuery.extend({
11766
- before_sequence: z24.int().gte(0).optional(),
11767
- after_sequence: z24.int().gte(0).optional()
12106
+ before_sequence: z26.int().gte(0).optional(),
12107
+ after_sequence: z26.int().gte(0).optional()
11768
12108
  })
11769
12109
  }),
11770
12110
  agentEventsStreamOp
@@ -12261,7 +12601,7 @@ var commandGroups = [
12261
12601
  flowOp({
12262
12602
  verb: "mcp-oauth",
12263
12603
  summary: "Create a secret through an MCP server OAuth flow",
12264
- path: z24.object({ orgID: zOrganizationId }),
12604
+ path: z26.object({ orgID: zOrganizationId }),
12265
12605
  body: zMcpOAuthBody,
12266
12606
  run: runMcpOAuth
12267
12607
  })
@@ -12308,6 +12648,99 @@ var commandGroups = [
12308
12648
  })
12309
12649
  ]
12310
12650
  },
12651
+ {
12652
+ name: "memory-stores",
12653
+ aliases: ["memory-store"],
12654
+ summary: "Manage project memory stores",
12655
+ operations: [
12656
+ op({
12657
+ verb: "list",
12658
+ summary: "List memory stores",
12659
+ fn: sdk_gen_exports.listMemoryStores,
12660
+ format: formatTable([
12661
+ "id",
12662
+ "name",
12663
+ "description",
12664
+ "agent_access",
12665
+ "created_at",
12666
+ "updated_at"
12667
+ ]),
12668
+ path: zListMemoryStoresPath,
12669
+ query: zListMemoryStoresQuery
12670
+ }),
12671
+ op({
12672
+ verb: "get",
12673
+ summary: "Fetch a memory store",
12674
+ fn: sdk_gen_exports.getMemoryStore,
12675
+ format: formatRecord(),
12676
+ path: zGetMemoryStorePath
12677
+ }),
12678
+ op({
12679
+ verb: "create",
12680
+ summary: "Create a memory store",
12681
+ fn: sdk_gen_exports.createMemoryStore,
12682
+ format: formatRecord(),
12683
+ path: zCreateMemoryStorePath,
12684
+ body: zCreateMemoryStoreBody
12685
+ }),
12686
+ op({
12687
+ verb: "update",
12688
+ summary: "Update memory store settings",
12689
+ fn: sdk_gen_exports.updateMemoryStore,
12690
+ format: formatRecord(),
12691
+ path: zUpdateMemoryStorePath,
12692
+ body: zUpdateMemoryStoreBody
12693
+ }),
12694
+ op({
12695
+ verb: "delete",
12696
+ summary: "Delete a memory store",
12697
+ fn: sdk_gen_exports.deleteMemoryStore,
12698
+ format: formatVoid("deleted"),
12699
+ path: zDeleteMemoryStorePath
12700
+ })
12701
+ ],
12702
+ groups: [
12703
+ {
12704
+ name: "files",
12705
+ aliases: ["file"],
12706
+ summary: "Manage files in a memory store",
12707
+ operations: [
12708
+ op({
12709
+ verb: "list",
12710
+ summary: "List files and directories in a memory store",
12711
+ fn: sdk_gen_exports.listMemoryFiles,
12712
+ format: formatTable([
12713
+ "path",
12714
+ "type",
12715
+ "size_bytes",
12716
+ "modified_at"
12717
+ ]),
12718
+ path: zListMemoryFilesPath,
12719
+ query: zListMemoryFilesQuery
12720
+ }),
12721
+ op({
12722
+ verb: "upload",
12723
+ summary: "Create or replace a memory file",
12724
+ fn: sdk_gen_exports.writeMemoryFile,
12725
+ format: formatRecord(),
12726
+ path: zWriteMemoryFilePath,
12727
+ query: zWriteMemoryFileQuery,
12728
+ body: zMemoryUploadBody,
12729
+ transformBody: ({ file }) => loadMemoryUpload(file)
12730
+ }),
12731
+ memoryDownloadOp,
12732
+ op({
12733
+ verb: "delete",
12734
+ summary: "Delete a memory file",
12735
+ fn: sdk_gen_exports.deleteMemoryFile,
12736
+ format: formatVoid("deleted"),
12737
+ path: zDeleteMemoryFilePath,
12738
+ query: zDeleteMemoryFileQuery
12739
+ })
12740
+ ]
12741
+ }
12742
+ ]
12743
+ },
12311
12744
  {
12312
12745
  name: "profiles",
12313
12746
  aliases: ["profile"],
@@ -12375,7 +12808,7 @@ var commandGroups = [
12375
12808
  flowOp({
12376
12809
  verb: "mcp-add",
12377
12810
  summary: "Create an OAuth secret and add an MCP server to an agent profile",
12378
- path: z24.object({
12811
+ path: z26.object({
12379
12812
  orgID: zOrganizationId,
12380
12813
  projectID: zProjectId,
12381
12814
  agentProfileID: zAgentProfileId
@@ -12387,7 +12820,7 @@ var commandGroups = [
12387
12820
  verb: "slack",
12388
12821
  aliases: ["slack-setup"],
12389
12822
  summary: "Connect Slack to an agent profile through OAuth",
12390
- path: z24.object({
12823
+ path: z26.object({
12391
12824
  orgID: zOrganizationId,
12392
12825
  projectID: zProjectId,
12393
12826
  agentProfileID: zAgentProfileId
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnara",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "description": "Command-line interface for Omnara: launch and manage agents, organizations, integrations, and MCP servers",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://omnara.com",