omnara 1.0.24 → 1.0.26

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 (3) hide show
  1. package/README.md +98 -0
  2. package/dist/bin.js +1427 -691
  3. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -89,7 +89,7 @@ var zAgentId = z.string().regex(/^agt_[a-z2-7]{26}$/);
89
89
  var zAgentConfigId = z.string().regex(/^acfg_[a-z2-7]{26}$/);
90
90
  var zAgentProfileId = z.string().regex(/^aprf_[a-z2-7]{26}$/);
91
91
  var zCronTriggerId = z.string().regex(/^cron_[a-z2-7]{26}$/);
92
- var zIntegrationInstallId = z.string().regex(/^iin_[a-z2-7]{26}$/);
92
+ var zIntegrationTargetId = z.string().regex(/^itgt_[a-z2-7]{26}$/);
93
93
  var zAgentEventId = z.string().regex(/^evt_[a-z2-7]{26}$/);
94
94
  var zModelCallContextId = z.string().regex(/^mcc_[a-z2-7]{26}$/);
95
95
  var zAgentInputId = z.string().regex(/^ain_[a-z2-7]{26}$/);
@@ -506,40 +506,40 @@ var zMcpoAuthStartResponse = z.object({
506
506
  expires_at: zTimestamp
507
507
  });
508
508
  var zCreateIntegrationOAuthSetupRequest = z.object({
509
- provider: z.string().optional().default("slack"),
510
509
  client_id: z.string().min(1),
511
510
  client_secret: z.string().min(1),
512
511
  signing_secret: z.string().min(1),
513
512
  return_to: z.string().optional()
514
513
  });
515
- var zIntegrationInstall = z.object({
516
- id: zIntegrationInstallId,
517
- org_id: zOrganizationId,
518
- project_id: zProjectId,
519
- agent_profile_id: zAgentProfileId.optional(),
520
- agent_id: zAgentId.optional(),
521
- provider: z.string(),
522
- integration_kind: z.string(),
523
- connection_mode: z.string(),
524
- state: z.enum(["active", "disabled"]),
525
- provider_tenant_id: z.string(),
526
- provider_account_ref: z.string(),
527
- provider_agent_display_name: z.string(),
528
- created_at: zTimestamp,
529
- updated_at: zTimestamp
514
+ var zIntegrationKind = z.enum([
515
+ "slack_thread",
516
+ "discord_thread",
517
+ "github_pr"
518
+ ]);
519
+ var zIntegrationProviderDisplayName = z.string().max(512);
520
+ var zIntegrationProviderConfig = z.record(z.string(), z.unknown());
521
+ var zCreateGitHubSetupRequest = z.object({
522
+ expected_setup_revision: z.int().gte(1),
523
+ app_name: z.string().min(1).max(34).optional(),
524
+ organization: z.string().min(1).max(39).regex(/^[A-Za-z0-9]+(-[A-Za-z0-9]+)*$/).optional()
525
+ });
526
+ var zInspectGitHubInstallationsRequest = z.object({
527
+ credential_secret_id: zSecretId,
528
+ page: z.int().gte(1).lte(1e3).optional().default(1)
530
529
  });
531
- var zListIntegrationInstallsResponse = z.object({
532
- data: z.array(zIntegrationInstall),
533
- next_cursor: z.string().nullable()
530
+ var zGitHubSetupInstallation = z.object({
531
+ id: z.string().regex(/^[1-9][0-9]*$/),
532
+ account: z.string(),
533
+ account_type: z.string().optional(),
534
+ settings_url: z.url()
534
535
  });
535
- var zIntegrationOAuthSetup = z.object({
536
- provider: z.string(),
537
- flow_id: zIntegrationOAuthFlowId,
538
- oauth_url: z.url(),
539
- redirect_uri: z.url(),
540
- events_url: z.url(),
541
- actions_url: z.url(),
542
- expires_at: zTimestamp
536
+ var zGitHubInstallations = z.object({
537
+ provider_app_id: z.string().regex(/^[1-9][0-9]*$/),
538
+ name: z.string(),
539
+ slug: z.string(),
540
+ install_url: z.url(),
541
+ installations: z.array(zGitHubSetupInstallation),
542
+ next_page: z.int().gte(1).lte(1e3).optional()
543
543
  });
544
544
  var zSlackSetupIcon = z.object({
545
545
  filename: z.string().optional(),
@@ -551,16 +551,6 @@ var zCreateSlackSetupRequest = z.object({
551
551
  icon: zSlackSetupIcon.optional(),
552
552
  return_to: z.string().optional()
553
553
  });
554
- var zSlackSetup = z.object({
555
- provider: z.string(),
556
- flow_id: zIntegrationOAuthFlowId,
557
- slack_app_id: z.string(),
558
- oauth_url: z.url(),
559
- redirect_uri: z.url(),
560
- events_url: z.url(),
561
- actions_url: z.url(),
562
- expires_at: zTimestamp
563
- });
564
554
  var zResolveAgentConfigToolsRequest = z.object({
565
555
  source: z.string().min(1),
566
556
  source_format: z.enum(["yaml", "json"])
@@ -758,14 +748,6 @@ var zCompiledMachineSource = z.object({
758
748
  machine_provider_options_overlay: z.record(z.string(), z.unknown()).optional(),
759
749
  description: z.string().optional()
760
750
  });
761
- var zCompiledTool = z.object({
762
- enabled: z.boolean(),
763
- type: z.enum(["built_in", "custom"]).optional(),
764
- permission: zToolPermissionSelection,
765
- deferred: z.boolean().optional(),
766
- description: z.string().optional(),
767
- input_schema: z.record(z.string(), z.unknown()).optional()
768
- });
769
751
  var zCompiledMcpAuthBearer = z.object({
770
752
  type: z.enum(["bearer"]),
771
753
  secret_id: zSecretId
@@ -833,20 +815,6 @@ var zCompiledSubagent = z.discriminatedUnion("type", [
833
815
  zCompiledSelfSubagent.extend({ type: z.literal("self") }),
834
816
  zCompiledProfileSubagent.extend({ type: z.literal("profile") })
835
817
  ]);
836
- var zCompiledAgentConfig = z.object({
837
- version: z.string().optional(),
838
- instruction: z.string(),
839
- model: zCompiledAgentModel,
840
- machine_sources: z.array(zCompiledMachineSource).optional(),
841
- tools: z.record(z.string(), zCompiledTool).optional(),
842
- mcp: z.record(z.string(), zCompiledMcpServer).optional(),
843
- event_webhook: zCompiledEventWebhook.optional(),
844
- skills: z.array(zCompiledSkill).optional(),
845
- memory_stores: z.array(zCompiledMemoryStore).optional(),
846
- subagents: z.record(z.string(), zCompiledSubagent).optional(),
847
- max_subagents: z.int().optional(),
848
- max_depth: z.int().optional()
849
- });
850
818
  var zAgentConfigSummary = z.object({
851
819
  id: zAgentConfigId,
852
820
  org_id: zOrganizationId,
@@ -858,18 +826,6 @@ var zAgentConfigSummary = z.object({
858
826
  instruction_hash: z.string().optional(),
859
827
  created_at: zTimestamp
860
828
  });
861
- var zAgentConfig = z.object({
862
- id: zAgentConfigId,
863
- org_id: zOrganizationId,
864
- project_id: zProjectId,
865
- source: z.string().optional(),
866
- source_format: z.enum(["yaml", "json"]).optional(),
867
- effective_definition_hash: z.string(),
868
- model: zAgentConfigModel,
869
- instruction_hash: z.string().optional(),
870
- created_at: zTimestamp,
871
- compiled_definition: zCompiledAgentConfig
872
- });
873
829
  var zCreateAgentProfileRequest = z.object({
874
830
  name: zResourceName,
875
831
  config: zAgentConfigId
@@ -881,32 +837,6 @@ var zUpdateAgentProfileRequest = z.object({
881
837
  var zRenameAgentProfileRequest = z.object({
882
838
  name: zResourceName
883
839
  });
884
- var zAgentProfileSummary = z.object({
885
- id: zAgentProfileId,
886
- org_id: zOrganizationId,
887
- project_id: zProjectId,
888
- name: zResourceName,
889
- current_config_id: zAgentConfigId,
890
- current_generation: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
891
- created_at: zTimestamp,
892
- updated_at: zTimestamp,
893
- current_config: zAgentConfigSummary
894
- });
895
- var zAgentProfile = z.object({
896
- id: zAgentProfileId,
897
- org_id: zOrganizationId,
898
- project_id: zProjectId,
899
- name: zResourceName,
900
- current_config_id: zAgentConfigId,
901
- current_generation: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
902
- created_at: zTimestamp,
903
- updated_at: zTimestamp,
904
- current_config: zAgentConfig
905
- });
906
- var zListAgentProfilesResponse = z.object({
907
- data: z.array(zAgentProfileSummary),
908
- next_cursor: z.string().nullable()
909
- });
910
840
  var zAgentProfileCronTriggerTarget = z.object({
911
841
  type: z.enum(["profile"]),
912
842
  agent_profile_id: zAgentProfileId
@@ -920,56 +850,22 @@ var zAgentCronTriggerTarget = z.object({
920
850
  agent_id: zAgentId,
921
851
  delivery_mode: zCronTriggerDeliveryMode.optional()
922
852
  });
923
- var zCronTriggerTarget = z.discriminatedUnion("type", [
924
- zAgentCronTriggerTarget.extend({ type: z.literal("agent") }),
925
- zAgentProfileCronTriggerTarget.extend({ type: z.literal("profile") })
926
- ]);
927
853
  var zCronTriggerFailureReport = z.object({
928
854
  message: z.string(),
929
855
  will_retry: z.boolean(),
930
856
  failed_at: zTimestamp
931
857
  });
932
- var zCreateCronTriggerRequest = z.object({
933
- name: zResourceName,
934
- target: zCronTriggerTarget,
935
- cron: zCronExpression,
936
- timezone: zCronTimezone.optional(),
937
- message_template: zCronMessageTemplate,
938
- enabled: z.boolean().optional().default(true)
939
- });
940
- var zUpdateCronTriggerRequest = z.object({
941
- target: zCronTriggerTarget.optional(),
942
- name: zResourceName.optional(),
943
- cron: zCronExpression.optional(),
944
- timezone: zCronTimezone.optional(),
945
- message_template: zCronMessageTemplate.optional(),
946
- enabled: z.boolean().optional()
947
- });
948
- var zCronTrigger = z.object({
949
- id: zCronTriggerId,
950
- org_id: zOrganizationId,
951
- project_id: zProjectId,
952
- name: zResourceName,
953
- target: zCronTriggerTarget,
954
- cron: zCronExpression,
955
- timezone: zCronTimezone,
956
- message_template: zCronMessageTemplate,
957
- enabled: z.boolean(),
958
- last_fired_at: zTimestamp.nullable(),
959
- next_fire_at: zTimestamp.nullable(),
960
- failure_report: zCronTriggerFailureReport.nullable(),
858
+ var zCronTriggerLastRunState = z.enum([
859
+ "queued",
860
+ "processing",
861
+ "completed",
862
+ "failed"
863
+ ]);
864
+ var zCronTriggerLastRun = z.object({
865
+ state: zCronTriggerLastRunState,
961
866
  created_at: zTimestamp,
962
- updated_at: zTimestamp
963
- });
964
- var zListCronTriggersResponse = z.object({
965
- data: z.array(zCronTrigger),
966
- next_cursor: z.string().nullable()
967
- });
968
- var zCreateAgentRequest = z.object({
969
- profile: zAgentProfileId.optional(),
970
- config: zAgentConfigId,
971
- name: zAgentName.optional(),
972
- message: z.string().optional()
867
+ updated_at: zTimestamp,
868
+ failure_message: z.string().nullable()
973
869
  });
974
870
  var zAgentActivity = z.object({
975
871
  state: z.enum([
@@ -984,30 +880,6 @@ var zAgentModel = z.object({
984
880
  provider_config: zResourceName,
985
881
  name: zResourceName
986
882
  });
987
- var zIntegrationTarget = z.object({
988
- provider: z.string(),
989
- provider_ref: z.string(),
990
- provider_ref_kind: z.string(),
991
- display_name: z.string(),
992
- provider_uri: z.url().optional()
993
- });
994
- var zAgent = z.object({
995
- id: zAgentId,
996
- org_id: zOrganizationId,
997
- project_id: zProjectId,
998
- agent_profile_id: zAgentProfileId.optional(),
999
- state: z.enum(["active", "archived"]),
1000
- name: zAgentName,
1001
- integration_target: zIntegrationTarget.optional(),
1002
- current_config_id: zAgentConfigId.optional(),
1003
- model: zAgentModel.optional(),
1004
- parent_agent_id: zAgentId.optional(),
1005
- subagent_key: z.string().optional(),
1006
- activity: zAgentActivity.optional(),
1007
- created_at: zTimestamp,
1008
- updated_at: zTimestamp,
1009
- archived_at: zTimestamp.optional()
1010
- });
1011
883
  var zAgentMcpConnection = z.object({
1012
884
  server_key: z.string(),
1013
885
  endpoint_url: z.string(),
@@ -1022,18 +894,6 @@ var zAgentMcpConnection = z.object({
1022
894
  created_at: zTimestamp,
1023
895
  updated_at: zTimestamp
1024
896
  });
1025
- var zCurrentAgentResponse = z.object({
1026
- agent: zAgent
1027
- });
1028
- var zGetAgentResponse = z.object({
1029
- agent: zAgent,
1030
- machine_ids: z.array(zMachineId),
1031
- mcp_connections: z.array(zAgentMcpConnection)
1032
- });
1033
- var zListAgentsResponse = z.object({
1034
- data: z.array(zAgent),
1035
- next_cursor: z.string().nullable()
1036
- });
1037
897
  var zAgentInputKind = z.enum([
1038
898
  "content",
1039
899
  "control",
@@ -1188,17 +1048,6 @@ var zAgentInput = z.object({
1188
1048
  content_blocks: z.array(zAgentInputContentBlock).optional(),
1189
1049
  queued_at: zTimestamp
1190
1050
  });
1191
- var zLaunchAgentResponse = z.object({
1192
- agent: zAgent,
1193
- agent_config: zAgentConfig,
1194
- machine_bindings: z.array(zAgentMachineBinding),
1195
- agent_input: zAgentInput.optional()
1196
- });
1197
- var zUpdateAgentConfigResponse = z.object({
1198
- agent_config: zAgentConfig,
1199
- agent_input: zAgentInput,
1200
- event_id: zAgentEventId
1201
- });
1202
1051
  var zMachineMetadata = z.record(z.string(), z.string().max(512));
1203
1052
  var zAgentInputEnvelope = z.object({
1204
1053
  agent_input: zAgentInput
@@ -1250,11 +1099,6 @@ var zToolCall = z.object({
1250
1099
  completed_at: zTimestamp.optional(),
1251
1100
  created_at: zTimestamp
1252
1101
  });
1253
- var zToolCallUpdate = z.object({
1254
- tool_call_id: zToolCallId,
1255
- agent_id: zAgentId.optional(),
1256
- state: zToolCallState
1257
- });
1258
1102
  var zListToolCallsResponse = z.object({
1259
1103
  data: z.array(zToolCall),
1260
1104
  next_cursor: z.string().nullable()
@@ -1337,10 +1181,6 @@ var zEventWebhookContextCheckpointEvent = z.object({
1337
1181
  event: z.enum(["context_checkpoint"]),
1338
1182
  data: zContextCheckpointEvent
1339
1183
  });
1340
- var zEventWebhookToolCallUpdate = z.object({
1341
- event: z.enum(["tool_call_update"]),
1342
- data: zToolCallUpdate
1343
- });
1344
1184
  var zModelOutputTextStreamBlock = z.object({
1345
1185
  kind: z.enum(["text"])
1346
1186
  });
@@ -1410,13 +1250,6 @@ var zEventWebhookModelOutputEvent = z.object({
1410
1250
  event: z.enum(["model_output"]),
1411
1251
  data: zModelOutputEvent
1412
1252
  });
1413
- var zEventWebhookPayload = z.discriminatedUnion("event", [
1414
- zEventWebhookAgentInputEvent.extend({ event: z.literal("agent_input") }),
1415
- zEventWebhookModelOutputEvent.extend({ event: z.literal("model_output") }),
1416
- zEventWebhookToolResultEvent.extend({ event: z.literal("tool_result") }),
1417
- zEventWebhookContextCheckpointEvent.extend({ event: z.literal("context_checkpoint") }),
1418
- zEventWebhookToolCallUpdate.extend({ event: z.literal("tool_call_update") })
1419
- ]);
1420
1253
  var zAgentEvent = z.discriminatedUnion("event_kind", [
1421
1254
  zAgentInputEvent.extend({ event_kind: z.literal("agent_input") }),
1422
1255
  zModelOutputEvent.extend({ event_kind: z.literal("model_output") }),
@@ -1454,12 +1287,6 @@ var zModelOutputDelta = z.object({
1454
1287
  coalesced_count: zAgentCount,
1455
1288
  event: zModelOutputStreamDelta
1456
1289
  });
1457
- var zAgentEventStreamData = z.union([
1458
- zAgentEvent,
1459
- zToolCallUpdate,
1460
- zModelOutputDelta,
1461
- zError
1462
- ]);
1463
1290
  var zListAgentEventsResponse = z.object({
1464
1291
  data: z.array(zAgentEvent),
1465
1292
  next_after_sequence: zAgentSequenceCursor,
@@ -1541,26 +1368,38 @@ var zAgentInteractionState = z.enum([
1541
1368
  "resolved",
1542
1369
  "canceled"
1543
1370
  ]);
1544
- var zAgentInteraction = z.object({
1371
+ var zAgentInteractionUpdate = z.object({
1545
1372
  id: zAgentInteractionId,
1546
- org_id: zOrganizationId,
1547
- project_id: zProjectId,
1548
- agent_id: zAgentId,
1549
- tool_call_id: zToolCallId,
1550
- tool_name: z.string().optional(),
1551
- agent_name: zAgentName.optional(),
1552
- subagent_key: z.string().optional(),
1553
1373
  interaction_kind: zAgentInteractionKind,
1554
- state: zAgentInteractionState,
1555
- request: zInteractionForm,
1556
- resolution: zInteractionResolution.optional(),
1557
- resolved_by_input_id: zAgentInputId.optional(),
1558
- created_at: zTimestamp,
1559
- resolved_at: zTimestamp.optional()
1374
+ state: zAgentInteractionState
1375
+ });
1376
+ var zToolCallUpdate = z.object({
1377
+ tool_call_id: zToolCallId,
1378
+ agent_id: zAgentId.optional(),
1379
+ state: zToolCallState,
1380
+ interaction_update: zAgentInteractionUpdate.optional()
1381
+ });
1382
+ var zEventWebhookToolCallUpdate = z.object({
1383
+ event: z.enum(["tool_call_update"]),
1384
+ data: zToolCallUpdate
1560
1385
  });
1386
+ var zEventWebhookPayload = z.discriminatedUnion("event", [
1387
+ zEventWebhookAgentInputEvent.extend({ event: z.literal("agent_input") }),
1388
+ zEventWebhookModelOutputEvent.extend({ event: z.literal("model_output") }),
1389
+ zEventWebhookToolResultEvent.extend({ event: z.literal("tool_result") }),
1390
+ zEventWebhookContextCheckpointEvent.extend({ event: z.literal("context_checkpoint") }),
1391
+ zEventWebhookToolCallUpdate.extend({ event: z.literal("tool_call_update") })
1392
+ ]);
1393
+ var zAgentEventStreamData = z.union([
1394
+ zAgentEvent,
1395
+ zToolCallUpdate,
1396
+ zModelOutputDelta,
1397
+ zError
1398
+ ]);
1399
+ var zInteractionPresentationReceipt = z.record(z.string(), z.unknown());
1561
1400
  var zActorProvider = z.enum([
1562
1401
  "omnara",
1563
- "slack",
1402
+ "integration",
1564
1403
  "external"
1565
1404
  ]);
1566
1405
  var zActor = z.object({
@@ -1581,6 +1420,10 @@ var zExternalActorParams = z.object({
1581
1420
  display_name: z.string().max(256).optional(),
1582
1421
  metadata: zMetadata.optional()
1583
1422
  });
1423
+ var zAgentLaunchInitialInput = z.object({
1424
+ content_blocks: z.array(zTextContentBlock).min(1),
1425
+ actor: zExternalActorParams.optional()
1426
+ });
1584
1427
  var zCreateAgentInputRequest = z.object({
1585
1428
  content_blocks: z.array(zCreateAgentInputContentBlock),
1586
1429
  delivery_mode: zCreateAgentInputDeliveryMode.optional(),
@@ -1598,10 +1441,6 @@ var zListActorsResponse = z.object({
1598
1441
  data: z.array(zActor),
1599
1442
  next_cursor: z.string().nullable()
1600
1443
  });
1601
- var zListAgentInteractionsResponse = z.object({
1602
- data: z.array(zAgentInteraction),
1603
- next_cursor: z.string().nullable()
1604
- });
1605
1444
  var zOrgSecretOwnerInput = z.object({
1606
1445
  kind: z.enum(["org"])
1607
1446
  });
@@ -1672,10 +1511,17 @@ var zAwsCredentialsSecretMaterial = z.object({
1672
1511
  role_arn: z.string().min(1).optional(),
1673
1512
  external_id: z.string().min(1).optional()
1674
1513
  });
1514
+ var zGitHubAppCredentialsSecretMaterial = z.object({
1515
+ kind: z.enum(["github_app_credentials"]),
1516
+ app_id: z.string().regex(/^[1-9][0-9]*$/),
1517
+ private_key: z.string().min(1),
1518
+ webhook_secret: z.string().min(1)
1519
+ });
1675
1520
  var zSecretMaterial = z.discriminatedUnion("kind", [
1676
1521
  zGenericSecretMaterial.extend({ kind: z.literal("generic") }),
1677
1522
  zOAuthTokenSetSecretMaterial.extend({ kind: z.literal("oauth_token_set") }),
1678
- zAwsCredentialsSecretMaterial.extend({ kind: z.literal("aws_credentials") })
1523
+ zAwsCredentialsSecretMaterial.extend({ kind: z.literal("aws_credentials") }),
1524
+ zGitHubAppCredentialsSecretMaterial.extend({ kind: z.literal("github_app_credentials") })
1679
1525
  ]);
1680
1526
  var zCreateSecretRequest = z.object({
1681
1527
  owner: zSecretOwnerInput,
@@ -1697,7 +1543,8 @@ var zSecretKind = z.enum([
1697
1543
  "generic",
1698
1544
  "oauth_token_set",
1699
1545
  "slack_app_credentials",
1700
- "aws_credentials"
1546
+ "aws_credentials",
1547
+ "github_app_credentials"
1701
1548
  ]);
1702
1549
  var zSecret = z.object({
1703
1550
  id: zSecretId,
@@ -1871,7 +1718,11 @@ var zCreateMachinePoolRequest = zCreateMachinePoolRequestBase.and(z.union([
1871
1718
  max_machine_memory_mb: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" })
1872
1719
  }),
1873
1720
  z.object({
1874
- provider: z.enum(["daytona"]),
1721
+ provider: z.enum([
1722
+ "daytona",
1723
+ "boxd",
1724
+ "createos"
1725
+ ]),
1875
1726
  max_total_cpu: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
1876
1727
  max_total_memory_mb: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
1877
1728
  max_machine_cpu: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
@@ -2320,22 +2171,43 @@ var zListProjectsResponse = z.object({
2320
2171
  data: z.array(zVisibleProject),
2321
2172
  next_cursor: z.string().nullable()
2322
2173
  });
2174
+ var zOrgOverviewProjectActivity = z.object({
2175
+ project_id: zProjectId,
2176
+ last_active_at: zTimestamp
2177
+ });
2323
2178
  var zOrgOverviewAgentProfileReference = z.object({
2324
2179
  id: zAgentProfileId,
2325
2180
  name: zResourceName,
2326
2181
  agent_count: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2327
2182
  });
2328
- var zOrgOverviewToday = z.object({
2329
- agents_created: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2330
- messages_sent: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2331
- });
2332
- var zOrgOverviewUsageDayModel = z.object({
2333
- id: zConfiguredModelId,
2334
- tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2335
- });
2336
- var zOrgOverviewUsageDayProfile = z.object({
2337
- id: zAgentProfileId.optional(),
2338
- tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2183
+ var zUsageTimeseriesInterval = z.enum([
2184
+ "hour",
2185
+ "day",
2186
+ "week",
2187
+ "month"
2188
+ ]);
2189
+ var zUsageTimeseriesMetric = z.enum([
2190
+ "sum_tokens",
2191
+ "sum_input_tokens",
2192
+ "sum_output_tokens",
2193
+ "sum_cost",
2194
+ "count_model_calls"
2195
+ ]);
2196
+ var zUsageTimeseriesGroupBy = z.enum(["model", "profile"]);
2197
+ var zUsageTimeseriesSeries = z.object({
2198
+ kind: z.enum([
2199
+ "all",
2200
+ "model",
2201
+ "profile",
2202
+ "no_profile",
2203
+ "other"
2204
+ ]),
2205
+ id: z.string().optional(),
2206
+ name: zResourceName.optional(),
2207
+ model_provider_config_name: zResourceName.optional(),
2208
+ project_name: zResourceName.optional(),
2209
+ total: z.number().gte(0),
2210
+ values: z.array(z.number().gte(0))
2339
2211
  });
2340
2212
  var zUsageTokenTotals = z.object({
2341
2213
  input_tokens_total: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
@@ -2354,36 +2226,36 @@ var zUsageTotals = z.object({
2354
2226
  tokens: zUsageTokenTotals,
2355
2227
  cost: zUsageCostTotals
2356
2228
  });
2357
- var zOrgOverviewUsageModel = z.object({
2358
- id: zConfiguredModelId,
2359
- name: zResourceName,
2360
- totals: zUsageTotals
2361
- });
2362
- var zOrgOverviewUsageProfile = z.object({
2363
- id: zAgentProfileId.optional(),
2364
- name: zResourceName.optional(),
2365
- totals: zUsageTotals
2229
+ var zAgentProfileStats = z.object({
2230
+ agent_count: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2231
+ usage: zUsageTotals
2366
2232
  });
2367
- var zOrgOverviewUsageDay = z.object({
2368
- start: zTimestamp,
2369
- totals: zUsageTotals,
2370
- models: z.array(zOrgOverviewUsageDayModel),
2371
- profiles: z.array(zOrgOverviewUsageDayProfile)
2233
+ var zAgentProfileSummary = z.object({
2234
+ id: zAgentProfileId,
2235
+ org_id: zOrganizationId,
2236
+ project_id: zProjectId,
2237
+ name: zResourceName,
2238
+ current_config_id: zAgentConfigId,
2239
+ current_generation: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2240
+ created_at: zTimestamp,
2241
+ updated_at: zTimestamp,
2242
+ current_config: zAgentConfigSummary,
2243
+ stats: zAgentProfileStats.optional()
2372
2244
  });
2373
- var zOrgOverviewUsage = z.object({
2245
+ var zListAgentProfilesResponse = z.object({
2246
+ data: z.array(zAgentProfileSummary),
2247
+ next_cursor: z.string().nullable()
2248
+ });
2249
+ var zUsageTimeseries = z.object({
2250
+ metric: zUsageTimeseriesMetric,
2251
+ interval: zUsageTimeseriesInterval,
2252
+ group_by: zUsageTimeseriesGroupBy.optional(),
2253
+ timezone: z.string(),
2254
+ bucket_starts: z.array(zTimestamp),
2255
+ until: zTimestamp,
2374
2256
  totals: zUsageTotals,
2375
2257
  active_agents: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2376
- models: z.array(zOrgOverviewUsageModel),
2377
- profiles: z.array(zOrgOverviewUsageProfile),
2378
- days: z.array(zOrgOverviewUsageDay)
2379
- });
2380
- var zOrgOverviewResponse = z.object({
2381
- projects: z.array(zVisibleProject),
2382
- recent_agents: z.array(zAgent),
2383
- recent_agent_profiles: z.array(zAgentProfileSummary),
2384
- referenced_agent_profiles: z.array(zOrgOverviewAgentProfileReference),
2385
- today: zOrgOverviewToday,
2386
- usage: zOrgOverviewUsage
2258
+ series: z.array(zUsageTimeseriesSeries)
2387
2259
  });
2388
2260
  var zUsageModel = z.object({
2389
2261
  configured_model_id: zConfiguredModelId,
@@ -2450,6 +2322,346 @@ var zProjectMembershipGrant = z.object({
2450
2322
  var zListProjectMembershipGrantsResponse = z.object({
2451
2323
  data: z.array(zProjectMembershipGrant)
2452
2324
  });
2325
+ var zIntegrationId = z.string().regex(/^itg_[a-z2-7]{26}$/);
2326
+ var zIntegrationOAuthSetup = z.object({
2327
+ integration_id: zIntegrationId,
2328
+ setup_revision: z.int().gte(1),
2329
+ provider: z.string(),
2330
+ flow_id: zIntegrationOAuthFlowId,
2331
+ oauth_url: z.url(),
2332
+ redirect_uri: z.url(),
2333
+ events_url: z.url(),
2334
+ actions_url: z.url(),
2335
+ expires_at: zTimestamp
2336
+ });
2337
+ var zGitHubSetup = z.object({
2338
+ integration_id: zIntegrationId,
2339
+ setup_revision: z.int().gte(1),
2340
+ registration_url: z.url(),
2341
+ manifest: z.record(z.string(), z.unknown()),
2342
+ expires_at: zTimestamp
2343
+ });
2344
+ var zSlackSetup = z.object({
2345
+ integration_id: zIntegrationId,
2346
+ setup_revision: z.int().gte(1),
2347
+ provider: z.string(),
2348
+ flow_id: zIntegrationOAuthFlowId,
2349
+ slack_app_id: z.string(),
2350
+ oauth_url: z.url(),
2351
+ redirect_uri: z.url(),
2352
+ events_url: z.url(),
2353
+ actions_url: z.url(),
2354
+ expires_at: zTimestamp
2355
+ });
2356
+ var zCompiledTool = z.object({
2357
+ integration_id: zIntegrationId.optional(),
2358
+ enabled: z.boolean(),
2359
+ type: z.enum(["built_in", "custom"]).optional(),
2360
+ permission: zToolPermissionSelection,
2361
+ deferred: z.boolean().optional(),
2362
+ description: z.string().optional(),
2363
+ input_schema: z.record(z.string(), z.unknown()).optional()
2364
+ });
2365
+ var zCompiledIntegrationCapability = z.object({
2366
+ integration_id: zIntegrationId
2367
+ });
2368
+ var zIntegrationCronTriggerTarget = z.object({
2369
+ type: z.enum(["integration"]),
2370
+ integration_id: zIntegrationId,
2371
+ settings: z.record(z.string(), z.unknown())
2372
+ });
2373
+ var zCronTriggerTarget = z.discriminatedUnion("type", [
2374
+ zAgentCronTriggerTarget.extend({ type: z.literal("agent") }),
2375
+ zAgentProfileCronTriggerTarget.extend({ type: z.literal("profile") }),
2376
+ zIntegrationCronTriggerTarget.extend({ type: z.literal("integration") })
2377
+ ]);
2378
+ var zCreateCronTriggerRequest = z.object({
2379
+ name: zResourceName,
2380
+ target: zCronTriggerTarget,
2381
+ cron: zCronExpression,
2382
+ timezone: zCronTimezone.optional(),
2383
+ message_template: zCronMessageTemplate.optional(),
2384
+ enabled: z.boolean().optional().default(true)
2385
+ });
2386
+ var zUpdateCronTriggerRequest = z.object({
2387
+ target: zCronTriggerTarget.optional(),
2388
+ name: zResourceName.optional(),
2389
+ cron: zCronExpression.optional(),
2390
+ timezone: zCronTimezone.optional(),
2391
+ message_template: zCronMessageTemplate.optional(),
2392
+ enabled: z.boolean().optional()
2393
+ });
2394
+ var zCronTrigger = z.object({
2395
+ id: zCronTriggerId,
2396
+ org_id: zOrganizationId,
2397
+ project_id: zProjectId,
2398
+ name: zResourceName,
2399
+ target: zCronTriggerTarget,
2400
+ cron: zCronExpression,
2401
+ timezone: zCronTimezone,
2402
+ message_template: zCronMessageTemplate.optional(),
2403
+ enabled: z.boolean(),
2404
+ last_fired_at: zTimestamp.nullable(),
2405
+ next_fire_at: zTimestamp.nullable(),
2406
+ failure_report: zCronTriggerFailureReport.nullable(),
2407
+ last_run: zCronTriggerLastRun.nullable(),
2408
+ created_at: zTimestamp,
2409
+ updated_at: zTimestamp
2410
+ });
2411
+ var zListCronTriggersResponse = z.object({
2412
+ data: z.array(zCronTrigger),
2413
+ next_cursor: z.string().nullable()
2414
+ });
2415
+ var zIntegrationSettings = z.record(z.string(), z.unknown());
2416
+ var zUpdateIntegrationRequest = z.object({
2417
+ settings: zIntegrationSettings
2418
+ });
2419
+ var zIntegrationRuntimeFailure = z.object({
2420
+ message: z.string(),
2421
+ retry_at: zTimestamp
2422
+ });
2423
+ var zConfigAgentToolInputSchema = z.object({
2424
+ properties: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
2425
+ required: z.array(z.string().min(1)).optional(),
2426
+ type: z.literal("object")
2427
+ });
2428
+ var zConfigIntegrationCapabilitySource = z.record(z.string(), z.never());
2429
+ var zConfigToolPermissionSelection = z.object({
2430
+ mode: z.string().min(1).regex(/\S/),
2431
+ parameters: z.record(z.string(), z.unknown()).optional()
2432
+ });
2433
+ var zConfigToolSource = z.object({
2434
+ deferred: z.boolean().optional(),
2435
+ description: z.string().min(1).optional(),
2436
+ enabled: z.boolean().nullish(),
2437
+ input_schema: zConfigAgentToolInputSchema.optional(),
2438
+ permission: zConfigToolPermissionSelection.optional(),
2439
+ type: z.enum(["built_in", "custom"]).optional()
2440
+ });
2441
+ var zIntegrationName = z.string().regex(/^[a-zA-Z][a-zA-Z0-9-]{0,31}$/);
2442
+ var zCompiledGitCredentials = z.object({
2443
+ integration: zIntegrationName,
2444
+ integration_id: zIntegrationId
2445
+ });
2446
+ var zCompiledAgentConfig = z.object({
2447
+ version: z.string().optional(),
2448
+ instruction: z.string(),
2449
+ model: zCompiledAgentModel,
2450
+ machine_sources: z.array(zCompiledMachineSource).optional(),
2451
+ tools: z.record(z.string(), zCompiledTool).optional(),
2452
+ mcp: z.record(z.string(), zCompiledMcpServer).optional(),
2453
+ event_webhook: zCompiledEventWebhook.optional(),
2454
+ interaction_handlers: z.record(z.string(), zCompiledIntegrationCapability).optional(),
2455
+ git_credentials: zCompiledGitCredentials.optional(),
2456
+ skills: z.array(zCompiledSkill).optional(),
2457
+ memory_stores: z.array(zCompiledMemoryStore).optional(),
2458
+ subagents: z.record(z.string(), zCompiledSubagent).optional(),
2459
+ max_subagents: z.int().optional(),
2460
+ max_depth: z.int().optional()
2461
+ });
2462
+ var zAgentConfig = z.object({
2463
+ id: zAgentConfigId,
2464
+ org_id: zOrganizationId,
2465
+ project_id: zProjectId,
2466
+ source: z.string().optional(),
2467
+ source_format: z.enum(["yaml", "json"]).optional(),
2468
+ effective_definition_hash: z.string(),
2469
+ model: zAgentConfigModel,
2470
+ instruction_hash: z.string().optional(),
2471
+ created_at: zTimestamp,
2472
+ compiled_definition: zCompiledAgentConfig
2473
+ });
2474
+ var zAgentProfile = z.object({
2475
+ id: zAgentProfileId,
2476
+ org_id: zOrganizationId,
2477
+ project_id: zProjectId,
2478
+ name: zResourceName,
2479
+ current_config_id: zAgentConfigId,
2480
+ current_generation: z.int().min(-2147483648, { error: "Invalid value: Expected int32 to be >= -2147483648" }).max(2147483647, { error: "Invalid value: Expected int32 to be <= 2147483647" }),
2481
+ created_at: zTimestamp,
2482
+ updated_at: zTimestamp,
2483
+ current_config: zAgentConfig
2484
+ });
2485
+ var zUpdateAgentConfigResponse = z.object({
2486
+ agent_config: zAgentConfig,
2487
+ agent_input: zAgentInput,
2488
+ event_id: zAgentEventId
2489
+ });
2490
+ var zCreateIntegrationRequest = z.object({
2491
+ name: zIntegrationName,
2492
+ integration_kind: zIntegrationKind,
2493
+ settings: zIntegrationSettings
2494
+ });
2495
+ var zIntegrationState = z.enum(["active", "disconnected"]);
2496
+ var zConfigureIntegrationRequest = z.object({
2497
+ expected_setup_revision: z.int().gte(1),
2498
+ provider_tenant_id: z.string().min(1).max(512),
2499
+ provider_account_ref: z.string().min(1).max(512).optional(),
2500
+ provider_agent_display_name: zIntegrationProviderDisplayName.optional(),
2501
+ credential_secret_id: zSecretId,
2502
+ provider_config: zIntegrationProviderConfig.optional()
2503
+ });
2504
+ var zIntegrationCapabilityDefinition = z.object({
2505
+ description: z.string().optional(),
2506
+ input_schema: z.record(z.string(), z.unknown())
2507
+ });
2508
+ var zIntegrationSubscriptionId = z.string().regex(/^isub_[a-z2-7]{26}$/);
2509
+ var zIntegrationConversation = z.record(z.string(), z.unknown());
2510
+ var zIntegrationTarget = z.object({
2511
+ provider: z.string(),
2512
+ conversation: zIntegrationConversation,
2513
+ display_name: z.string(),
2514
+ provider_uri: z.url().optional()
2515
+ });
2516
+ var zAgent = z.object({
2517
+ id: zAgentId,
2518
+ org_id: zOrganizationId,
2519
+ project_id: zProjectId,
2520
+ agent_profile_id: zAgentProfileId.optional(),
2521
+ state: z.enum(["active", "archived"]),
2522
+ name: zAgentName,
2523
+ integration_target: zIntegrationTarget.optional(),
2524
+ current_config_id: zAgentConfigId.optional(),
2525
+ model: zAgentModel.optional(),
2526
+ parent_agent_id: zAgentId.optional(),
2527
+ subagent_key: z.string().optional(),
2528
+ activity: zAgentActivity.optional(),
2529
+ usage: zUsageTotals.optional(),
2530
+ created_at: zTimestamp,
2531
+ updated_at: zTimestamp,
2532
+ archived_at: zTimestamp.optional()
2533
+ });
2534
+ var zCurrentAgentResponse = z.object({
2535
+ agent: zAgent
2536
+ });
2537
+ var zGetAgentResponse = z.object({
2538
+ agent: zAgent,
2539
+ machine_ids: z.array(zMachineId),
2540
+ mcp_connections: z.array(zAgentMcpConnection)
2541
+ });
2542
+ var zListAgentsResponse = z.object({
2543
+ data: z.array(zAgent),
2544
+ next_cursor: z.string().nullable()
2545
+ });
2546
+ var zLaunchAgentResponse = z.object({
2547
+ agent: zAgent,
2548
+ agent_config: zAgentConfig,
2549
+ machine_bindings: z.array(zAgentMachineBinding),
2550
+ agent_input: zAgentInput.optional()
2551
+ });
2552
+ var zAgentInteractionDestination = z.object({
2553
+ integration_kind: zIntegrationKind,
2554
+ handler_key: z.string(),
2555
+ integration_id: zIntegrationId,
2556
+ integration_target_id: zIntegrationTargetId,
2557
+ conversation: zIntegrationConversation
2558
+ });
2559
+ var zAgentInteraction = z.object({
2560
+ id: zAgentInteractionId,
2561
+ org_id: zOrganizationId,
2562
+ project_id: zProjectId,
2563
+ agent_id: zAgentId,
2564
+ tool_call_id: zToolCallId,
2565
+ tool_name: z.string().optional(),
2566
+ agent_name: zAgentName.optional(),
2567
+ subagent_key: z.string().optional(),
2568
+ interaction_kind: zAgentInteractionKind,
2569
+ state: zAgentInteractionState,
2570
+ request: zInteractionForm,
2571
+ resolution: zInteractionResolution.optional(),
2572
+ destination: zAgentInteractionDestination.optional(),
2573
+ presentation_receipt: zInteractionPresentationReceipt.optional(),
2574
+ resolved_by_input_id: zAgentInputId.optional(),
2575
+ created_at: zTimestamp,
2576
+ resolved_at: zTimestamp.optional()
2577
+ });
2578
+ var zListAgentInteractionsResponse = z.object({
2579
+ data: z.array(zAgentInteraction),
2580
+ next_cursor: z.string().nullable()
2581
+ });
2582
+ var zOrgOverviewResponse = z.object({
2583
+ projects: z.array(zVisibleProject),
2584
+ project_activity: z.array(zOrgOverviewProjectActivity),
2585
+ recent_agents: z.array(zAgent),
2586
+ recent_agent_profiles: z.array(zAgentProfileSummary),
2587
+ referenced_agent_profiles: z.array(zOrgOverviewAgentProfileReference)
2588
+ });
2589
+ var zIntegrationSubscriptionAttachment = z.object({
2590
+ integration_id: zIntegrationId,
2591
+ conversation: zIntegrationConversation
2592
+ });
2593
+ var zCreateAgentRequest = z.object({
2594
+ profile: zAgentProfileId.optional(),
2595
+ config: zAgentConfigId,
2596
+ name: zAgentName.optional(),
2597
+ message: z.string().optional(),
2598
+ tools: z.record(z.string(), zConfigToolSource).optional(),
2599
+ subscriptions: z.array(zIntegrationSubscriptionAttachment).max(100).optional(),
2600
+ interaction_handlers: z.record(z.string(), zConfigIntegrationCapabilitySource).optional(),
2601
+ initial_input: zAgentLaunchInitialInput.optional()
2602
+ });
2603
+ var zCreateIntegrationSubscriptionRequest = z.object({
2604
+ agent_id: zAgentId,
2605
+ conversation: zIntegrationConversation
2606
+ });
2607
+ var zIntegrationSubscription = z.object({
2608
+ id: zIntegrationSubscriptionId,
2609
+ project_id: zProjectId,
2610
+ integration_id: zIntegrationId,
2611
+ agent_id: zAgentId,
2612
+ agent_name: zAgentName,
2613
+ conversation: zIntegrationConversation,
2614
+ conversation_name: z.string().optional(),
2615
+ created_at: zTimestamp
2616
+ });
2617
+ var zListIntegrationSubscriptionsResponse = z.object({
2618
+ data: z.array(zIntegrationSubscription),
2619
+ next_cursor: z.string().nullable()
2620
+ });
2621
+ var zIntegrationSubscriptionDefinition = z.object({
2622
+ conversation_schema: z.record(z.string(), z.unknown())
2623
+ });
2624
+ var zIntegrationCapabilities = z.object({
2625
+ settings: zIntegrationCapabilityDefinition.optional(),
2626
+ tools: z.record(z.string(), zIntegrationCapabilityDefinition),
2627
+ subscription: zIntegrationSubscriptionDefinition.optional(),
2628
+ interaction_handler: zIntegrationCapabilityDefinition.optional(),
2629
+ schedule: zIntegrationCapabilityDefinition.optional()
2630
+ });
2631
+ var zIntegration = z.object({
2632
+ id: zIntegrationId,
2633
+ project_id: zProjectId,
2634
+ name: zIntegrationName,
2635
+ integration_kind: zIntegrationKind,
2636
+ state: zIntegrationState,
2637
+ setup_revision: z.int().gte(1),
2638
+ last_oauth_flow_id: zIntegrationOAuthFlowId.optional(),
2639
+ runtime_failure: zIntegrationRuntimeFailure.optional(),
2640
+ settings: zIntegrationSettings,
2641
+ provider_tenant_id: z.string().optional(),
2642
+ provider_account_ref: z.string().optional(),
2643
+ provider_agent_display_name: zIntegrationProviderDisplayName,
2644
+ bot_mention: z.string().optional(),
2645
+ credential_secret_id: zSecretId.optional(),
2646
+ provider_config: zIntegrationProviderConfig,
2647
+ capabilities: zIntegrationCapabilities,
2648
+ created_at: zTimestamp,
2649
+ updated_at: zTimestamp
2650
+ });
2651
+ var zListIntegrationsResponse = z.object({
2652
+ data: z.array(zIntegration),
2653
+ next_cursor: z.string().nullable()
2654
+ });
2655
+ var zIntegrationDefinition = z.object({
2656
+ integration_kind: zIntegrationKind,
2657
+ capabilities: zIntegrationCapabilities
2658
+ });
2659
+ var zListIntegrationDefinitionsResponse = z.object({
2660
+ data: z.array(zIntegrationDefinition)
2661
+ });
2662
+ var zAgentIncludeUsage = z.boolean();
2663
+ var zAgentProfileIncludeStats = z.boolean();
2664
+ var zAgentProfileStatsSince = z.iso.datetime({ offset: true });
2453
2665
  var zUsageSince = z.iso.datetime({ offset: true });
2454
2666
  var zUsageUntil = z.iso.datetime({ offset: true });
2455
2667
  var zUsageIncludeProjectIds = z.array(zProjectId).min(1).max(100);
@@ -2527,9 +2739,6 @@ var zDeclineInvitationResponse = zOrgInvitation;
2527
2739
  var zGetOrgOverviewPath = z.object({
2528
2740
  orgID: zOrganizationId
2529
2741
  });
2530
- var zGetOrgOverviewQuery = z.object({
2531
- timezone: z.string().max(64).optional().default("UTC")
2532
- });
2533
2742
  var zGetOrgOverviewResponse = zOrgOverviewResponse;
2534
2743
  var zGetOrgUsagePath = z.object({
2535
2744
  orgID: zOrganizationId
@@ -2541,6 +2750,49 @@ var zGetOrgUsageQuery = z.object({
2541
2750
  exclude_project_ids: z.array(zProjectId).min(1).max(100).optional()
2542
2751
  });
2543
2752
  var zGetOrgUsageResponse = zUsageReport;
2753
+ var zGetOrgUsageTimeseriesPath = z.object({
2754
+ orgID: zOrganizationId
2755
+ });
2756
+ var zGetOrgUsageTimeseriesQuery = z.object({
2757
+ since: z.iso.datetime({ offset: true }).optional(),
2758
+ until: z.iso.datetime({ offset: true }).optional(),
2759
+ timezone: z.string().max(64).optional().default("UTC"),
2760
+ interval: zUsageTimeseriesInterval.optional(),
2761
+ metric: zUsageTimeseriesMetric.optional(),
2762
+ group_by: zUsageTimeseriesGroupBy.optional(),
2763
+ group_limit: z.int().gte(1).lte(20).optional().default(8),
2764
+ project_ids: z.array(zProjectId).min(1).max(100).optional(),
2765
+ agent_profile_ids: z.array(zAgentProfileId).min(1).max(100).optional(),
2766
+ include_subagents: z.boolean().optional().default(false)
2767
+ });
2768
+ var zGetOrgUsageTimeseriesResponse = zUsageTimeseries;
2769
+ var zListOrgAgentsPath = z.object({
2770
+ orgID: zOrganizationId
2771
+ });
2772
+ var zListOrgAgentsQuery = z.object({
2773
+ name: z.string().min(1).max(200).optional(),
2774
+ agent_profile_id: zAgentProfileId.optional(),
2775
+ parent_agent_id: zAgentId.optional(),
2776
+ include_subagents: z.boolean().optional(),
2777
+ include_archived: z.boolean().optional(),
2778
+ include_usage: z.boolean().optional(),
2779
+ sort: zResourceListSort.optional(),
2780
+ limit: z.int().gte(1).lte(100).optional().default(50),
2781
+ cursor: z.string().max(1024).optional()
2782
+ });
2783
+ var zListOrgAgentsResponse = zListAgentsResponse;
2784
+ var zListOrgAgentProfilesPath = z.object({
2785
+ orgID: zOrganizationId
2786
+ });
2787
+ var zListOrgAgentProfilesQuery = z.object({
2788
+ name: z.string().min(1).max(200).optional(),
2789
+ include_stats: z.boolean().optional(),
2790
+ stats_since: z.iso.datetime({ offset: true }).optional(),
2791
+ sort: zResourceListSort.optional(),
2792
+ limit: z.int().gte(1).lte(100).optional().default(50),
2793
+ cursor: z.string().max(1024).optional()
2794
+ });
2795
+ var zListOrgAgentProfilesResponse = zListAgentProfilesResponse;
2544
2796
  var zListVisibleProjectsPath = z.object({
2545
2797
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/)
2546
2798
  });
@@ -2894,25 +3146,6 @@ var zDeleteSecretGrantPath = z.object({
2894
3146
  grantID: z.string().regex(/^sgr_[a-z2-7]{26}$/)
2895
3147
  });
2896
3148
  var zDeleteSecretGrantResponse = z.void();
2897
- var zListIntegrationInstallsPath = z.object({
2898
- orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
2899
- projectID: z.string().regex(/^proj_[a-z2-7]{26}$/)
2900
- });
2901
- var zListIntegrationInstallsQuery = z.object({
2902
- name: z.string().min(1).max(200).optional(),
2903
- agent_profile_id: zAgentProfileId.optional(),
2904
- oauth_flow_id: zIntegrationOAuthFlowId.optional(),
2905
- sort: zResourceListSort.optional(),
2906
- limit: z.int().gte(1).lte(100).optional().default(50),
2907
- cursor: z.string().max(1024).optional()
2908
- });
2909
- var zListIntegrationInstallsResponse2 = zListIntegrationInstallsResponse;
2910
- var zDeleteIntegrationInstallPath = z.object({
2911
- orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
2912
- projectID: z.string().regex(/^proj_[a-z2-7]{26}$/),
2913
- integrationInstallID: z.string().regex(/^iin_[a-z2-7]{26}$/)
2914
- });
2915
- var zDeleteIntegrationInstallResponse = z.void();
2916
3149
  var zResolveAgentConfigToolsPath = z.object({
2917
3150
  orgID: zOrganizationId,
2918
3151
  projectID: zProjectId
@@ -2948,6 +3181,8 @@ var zListAgentProfilesPath = z.object({
2948
3181
  });
2949
3182
  var zListAgentProfilesQuery = z.object({
2950
3183
  name: z.string().min(1).max(200).optional(),
3184
+ include_stats: z.boolean().optional(),
3185
+ stats_since: z.iso.datetime({ offset: true }).optional(),
2951
3186
  sort: zResourceListSort.optional(),
2952
3187
  limit: z.int().gte(1).lte(100).optional().default(50),
2953
3188
  cursor: z.string().max(1024).optional()
@@ -3001,17 +3236,29 @@ var zUpdateAgentProfilePath = z.object({
3001
3236
  });
3002
3237
  var zUpdateAgentProfileResponse = zAgentProfile;
3003
3238
  var zCreateIntegrationOAuthSetupPath = z.object({
3004
- orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
3005
- projectID: z.string().regex(/^proj_[a-z2-7]{26}$/),
3006
- agentProfileID: z.string().regex(/^aprf_[a-z2-7]{26}$/)
3239
+ orgID: zOrganizationId,
3240
+ projectID: zProjectId,
3241
+ integrationID: zIntegrationId
3007
3242
  });
3008
3243
  var zCreateIntegrationOAuthSetupResponse = zIntegrationOAuthSetup;
3009
- var zCreateSlackSetupPath = z.object({
3010
- orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
3011
- projectID: z.string().regex(/^proj_[a-z2-7]{26}$/),
3012
- agentProfileID: z.string().regex(/^aprf_[a-z2-7]{26}$/)
3244
+ var zCreateIntegrationSlackSetupPath = z.object({
3245
+ orgID: zOrganizationId,
3246
+ projectID: zProjectId,
3247
+ integrationID: zIntegrationId
3248
+ });
3249
+ var zCreateIntegrationSlackSetupResponse = zSlackSetup;
3250
+ var zCreateIntegrationGitHubSetupPath = z.object({
3251
+ orgID: zOrganizationId,
3252
+ projectID: zProjectId,
3253
+ integrationID: zIntegrationId
3013
3254
  });
3014
- var zCreateSlackSetupResponse = zSlackSetup;
3255
+ var zCreateIntegrationGitHubSetupResponse = zGitHubSetup;
3256
+ var zInspectIntegrationGitHubInstallationsPath = z.object({
3257
+ orgID: zOrganizationId,
3258
+ projectID: zProjectId,
3259
+ integrationID: zIntegrationId
3260
+ });
3261
+ var zInspectIntegrationGitHubInstallationsResponse = zGitHubInstallations;
3015
3262
  var zListCronTriggersPath = z.object({
3016
3263
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
3017
3264
  projectID: z.string().regex(/^proj_[a-z2-7]{26}$/)
@@ -3020,6 +3267,7 @@ var zListCronTriggersQuery = z.object({
3020
3267
  name: z.string().min(1).max(200).optional(),
3021
3268
  agent_id: zAgentId.optional(),
3022
3269
  agent_profile_id: zAgentProfileId.optional(),
3270
+ integration_id: zIntegrationId.optional(),
3023
3271
  sort: zResourceListSort.optional(),
3024
3272
  limit: z.int().gte(1).lte(100).optional().default(50),
3025
3273
  cursor: z.string().max(1024).optional()
@@ -3063,6 +3311,7 @@ var zListAgentsQuery = z.object({
3063
3311
  parent_agent_id: zAgentId.optional(),
3064
3312
  include_subagents: z.boolean().optional(),
3065
3313
  include_archived: z.boolean().optional(),
3314
+ include_usage: z.boolean().optional(),
3066
3315
  sort: zResourceListSort.optional(),
3067
3316
  limit: z.int().gte(1).lte(100).optional().default(50),
3068
3317
  cursor: z.string().max(1024).optional()
@@ -3586,6 +3835,13 @@ var zSleepMachineDaemonRuntimePath = z.object({
3586
3835
  runtimeID: z.string().regex(/^drt_[a-z2-7]{26}$/)
3587
3836
  });
3588
3837
  var zSleepMachineDaemonRuntimeResponse = zDaemonRuntime;
3838
+ var zGetDaemonGitCredentialsPath = z.object({
3839
+ processID: zProcessId
3840
+ });
3841
+ var zGetDaemonGitCredentialsResponse = z.object({
3842
+ token: z.string(),
3843
+ expires_at: zTimestamp
3844
+ });
3589
3845
  var zGetDaemonSkillArchivePath = z.object({
3590
3846
  skillID: z.string().regex(/^skl_[a-z2-7]{26}$/)
3591
3847
  });
@@ -3603,10 +3859,85 @@ var zUploadDaemonFileBody = z.instanceof(Blob);
3603
3859
  var zUploadDaemonFilePath = z.object({
3604
3860
  processID: zProcessId
3605
3861
  });
3606
- var zUploadDaemonFileQuery = z.object({
3607
- filename: z.string().optional()
3862
+ var zUploadDaemonFileQuery = z.object({
3863
+ filename: z.string().optional()
3864
+ });
3865
+ var zUploadDaemonFileResponse = zUploadFileResponse;
3866
+ var zListIntegrationsPath = z.object({
3867
+ orgID: zOrganizationId,
3868
+ projectID: zProjectId
3869
+ });
3870
+ var zListIntegrationsQuery = z.object({
3871
+ limit: z.int().gte(1).lte(100).optional().default(50),
3872
+ cursor: z.string().max(1024).optional()
3873
+ });
3874
+ var zListIntegrationsResponse2 = zListIntegrationsResponse;
3875
+ var zCreateIntegrationBody = zCreateIntegrationRequest;
3876
+ var zCreateIntegrationPath = z.object({
3877
+ orgID: zOrganizationId,
3878
+ projectID: zProjectId
3879
+ });
3880
+ var zCreateIntegrationResponse = zIntegration;
3881
+ var zDeleteIntegrationPath = z.object({
3882
+ orgID: zOrganizationId,
3883
+ projectID: zProjectId,
3884
+ integrationID: zIntegrationId
3885
+ });
3886
+ var zDeleteIntegrationResponse = z.void();
3887
+ var zGetIntegrationPath = z.object({
3888
+ orgID: zOrganizationId,
3889
+ projectID: zProjectId,
3890
+ integrationID: zIntegrationId
3891
+ });
3892
+ var zGetIntegrationResponse = zIntegration;
3893
+ var zUpdateIntegrationBody = zUpdateIntegrationRequest;
3894
+ var zUpdateIntegrationPath = z.object({
3895
+ orgID: zOrganizationId,
3896
+ projectID: zProjectId,
3897
+ integrationID: zIntegrationId
3898
+ });
3899
+ var zUpdateIntegrationResponse = zIntegration;
3900
+ var zListIntegrationSubscriptionsPath = z.object({
3901
+ orgID: zOrganizationId,
3902
+ projectID: zProjectId,
3903
+ integrationID: zIntegrationId
3904
+ });
3905
+ var zListIntegrationSubscriptionsQuery = z.object({
3906
+ limit: z.int().gte(1).lte(100).optional().default(50),
3907
+ cursor: z.string().max(1024).optional()
3908
+ });
3909
+ var zListIntegrationSubscriptionsResponse2 = zListIntegrationSubscriptionsResponse;
3910
+ var zCreateIntegrationSubscriptionPath = z.object({
3911
+ orgID: zOrganizationId,
3912
+ projectID: zProjectId,
3913
+ integrationID: zIntegrationId
3914
+ });
3915
+ var zCreateIntegrationSubscriptionResponse = zIntegrationSubscription;
3916
+ var zDeleteIntegrationSubscriptionPath = z.object({
3917
+ orgID: zOrganizationId,
3918
+ projectID: zProjectId,
3919
+ integrationID: zIntegrationId,
3920
+ subscriptionID: zIntegrationSubscriptionId
3921
+ });
3922
+ var zDeleteIntegrationSubscriptionResponse = z.void();
3923
+ var zConfigureIntegrationBody = zConfigureIntegrationRequest;
3924
+ var zConfigureIntegrationPath = z.object({
3925
+ orgID: zOrganizationId,
3926
+ projectID: zProjectId,
3927
+ integrationID: zIntegrationId
3928
+ });
3929
+ var zConfigureIntegrationResponse = zIntegration;
3930
+ var zDisconnectIntegrationPath = z.object({
3931
+ orgID: zOrganizationId,
3932
+ projectID: zProjectId,
3933
+ integrationID: zIntegrationId
3934
+ });
3935
+ var zDisconnectIntegrationResponse = zIntegration;
3936
+ var zListIntegrationDefinitionsPath = z.object({
3937
+ orgID: zOrganizationId,
3938
+ projectID: zProjectId
3608
3939
  });
3609
- var zUploadDaemonFileResponse = zUploadFileResponse;
3940
+ var zListIntegrationDefinitionsResponse2 = zListIntegrationDefinitionsResponse;
3610
3941
 
3611
3942
  // ../sdk/src/json-body.ts
3612
3943
  import * as z2 from "zod";
@@ -5020,6 +5351,7 @@ __export(sdk_gen_exports, {
5020
5351
  bootstrapDaemon: () => bootstrapDaemon,
5021
5352
  cancelAgent: () => cancelAgent,
5022
5353
  cancelQueuedBacklogInput: () => cancelQueuedBacklogInput,
5354
+ configureIntegration: () => configureIntegration,
5023
5355
  connectByoMachine: () => connectByoMachine,
5024
5356
  createAgent: () => createAgent,
5025
5357
  createAgentConfig: () => createAgentConfig,
@@ -5028,7 +5360,11 @@ __export(sdk_gen_exports, {
5028
5360
  createByoMachineDaemonToken: () => createByoMachineDaemonToken,
5029
5361
  createConfiguredModel: () => createConfiguredModel,
5030
5362
  createCronTrigger: () => createCronTrigger,
5363
+ createIntegration: () => createIntegration,
5364
+ createIntegrationGitHubSetup: () => createIntegrationGitHubSetup,
5031
5365
  createIntegrationOAuthSetup: () => createIntegrationOAuthSetup,
5366
+ createIntegrationSlackSetup: () => createIntegrationSlackSetup,
5367
+ createIntegrationSubscription: () => createIntegrationSubscription,
5032
5368
  createMachine: () => createMachine,
5033
5369
  createMachinePool: () => createMachinePool,
5034
5370
  createMemoryStore: () => createMemoryStore,
@@ -5046,13 +5382,13 @@ __export(sdk_gen_exports, {
5046
5382
  createSecretVersion: () => createSecretVersion,
5047
5383
  createSkill: () => createSkill,
5048
5384
  createSkillGrant: () => createSkillGrant,
5049
- createSlackSetup: () => createSlackSetup,
5050
5385
  declineInvitation: () => declineInvitation,
5051
5386
  deleteAgentProfile: () => deleteAgentProfile,
5052
5387
  deleteConfiguredModel: () => deleteConfiguredModel,
5053
5388
  deleteCronTrigger: () => deleteCronTrigger,
5054
5389
  deleteCurrentUser: () => deleteCurrentUser,
5055
- deleteIntegrationInstall: () => deleteIntegrationInstall,
5390
+ deleteIntegration: () => deleteIntegration,
5391
+ deleteIntegrationSubscription: () => deleteIntegrationSubscription,
5056
5392
  deleteMachine: () => deleteMachine,
5057
5393
  deleteMachinePool: () => deleteMachinePool,
5058
5394
  deleteMemoryFile: () => deleteMemoryFile,
@@ -5069,6 +5405,7 @@ __export(sdk_gen_exports, {
5069
5405
  deleteSkill: () => deleteSkill,
5070
5406
  deleteSkillGrant: () => deleteSkillGrant,
5071
5407
  demoteSteeringInputToQueued: () => demoteSteeringInputToQueued,
5408
+ disconnectIntegration: () => disconnectIntegration,
5072
5409
  downloadDaemonFile: () => downloadDaemonFile,
5073
5410
  downloadMemoryFile: () => downloadMemoryFile,
5074
5411
  endMachineDaemonRuntime: () => endMachineDaemonRuntime,
@@ -5082,7 +5419,9 @@ __export(sdk_gen_exports, {
5082
5419
  getArtifactContent: () => getArtifactContent,
5083
5420
  getCronTrigger: () => getCronTrigger,
5084
5421
  getCurrentUser: () => getCurrentUser,
5422
+ getDaemonGitCredentials: () => getDaemonGitCredentials,
5085
5423
  getDaemonSkillArchive: () => getDaemonSkillArchive,
5424
+ getIntegration: () => getIntegration,
5086
5425
  getMachine: () => getMachine,
5087
5426
  getMachinePool: () => getMachinePool,
5088
5427
  getMemoryStore: () => getMemoryStore,
@@ -5091,12 +5430,14 @@ __export(sdk_gen_exports, {
5091
5430
  getOrgApiKey: () => getOrgApiKey,
5092
5431
  getOrgOverview: () => getOrgOverview,
5093
5432
  getOrgUsage: () => getOrgUsage,
5433
+ getOrgUsageTimeseries: () => getOrgUsageTimeseries,
5094
5434
  getProjectAvailableSecret: () => getProjectAvailableSecret,
5095
5435
  getProjectMachinePoolGrant: () => getProjectMachinePoolGrant,
5096
5436
  getProjectUsage: () => getProjectUsage,
5097
5437
  getSecret: () => getSecret,
5098
5438
  getSkill: () => getSkill,
5099
5439
  getToolCatalog: () => getToolCatalog,
5440
+ inspectIntegrationGitHubInstallations: () => inspectIntegrationGitHubInstallations,
5100
5441
  listActors: () => listActors,
5101
5442
  listAgentInteractions: () => listAgentInteractions,
5102
5443
  listAgentProfiles: () => listAgentProfiles,
@@ -5105,7 +5446,9 @@ __export(sdk_gen_exports, {
5105
5446
  listConfiguredModels: () => listConfiguredModels,
5106
5447
  listCronTriggers: () => listCronTriggers,
5107
5448
  listEvents: () => listEvents,
5108
- listIntegrationInstalls: () => listIntegrationInstalls,
5449
+ listIntegrationDefinitions: () => listIntegrationDefinitions,
5450
+ listIntegrationSubscriptions: () => listIntegrationSubscriptions,
5451
+ listIntegrations: () => listIntegrations,
5109
5452
  listMachinePools: () => listMachinePools,
5110
5453
  listMcpServerTools: () => listMcpServerTools,
5111
5454
  listMcpServers: () => listMcpServers,
@@ -5113,6 +5456,8 @@ __export(sdk_gen_exports, {
5113
5456
  listMemoryFiles: () => listMemoryFiles,
5114
5457
  listMemoryStores: () => listMemoryStores,
5115
5458
  listModelProviderConfigs: () => listModelProviderConfigs,
5459
+ listOrgAgentProfiles: () => listOrgAgentProfiles,
5460
+ listOrgAgents: () => listOrgAgents,
5116
5461
  listOrgApiKeyProjectAccess: () => listOrgApiKeyProjectAccess,
5117
5462
  listOrgApiKeys: () => listOrgApiKeys,
5118
5463
  listOrgInvitations: () => listOrgInvitations,
@@ -5161,6 +5506,7 @@ __export(sdk_gen_exports, {
5161
5506
  updateAgentProfile: () => updateAgentProfile,
5162
5507
  updateConfiguredModel: () => updateConfiguredModel,
5163
5508
  updateCronTrigger: () => updateCronTrigger,
5509
+ updateIntegration: () => updateIntegration,
5164
5510
  updateMachine: () => updateMachine,
5165
5511
  updateMachinePool: () => updateMachinePool,
5166
5512
  updateMemoryStore: () => updateMemoryStore,
@@ -5409,6 +5755,48 @@ var getOrgUsage = (options) => (options.client ?? client).get({
5409
5755
  url: "/orgs/{orgID}/usage",
5410
5756
  ...options
5411
5757
  });
5758
+ var getOrgUsageTimeseries = (options) => (options.client ?? client).get({
5759
+ responseValidator: relaxedResponseValidator(zGetOrgUsageTimeseriesResponse),
5760
+ security: [{
5761
+ key: "bearerAuth",
5762
+ scheme: "bearer",
5763
+ type: "http"
5764
+ }, {
5765
+ in: "cookie",
5766
+ name: "__Host-omnara_session",
5767
+ type: "apiKey"
5768
+ }],
5769
+ url: "/orgs/{orgID}/usage/timeseries",
5770
+ ...options
5771
+ });
5772
+ var listOrgAgents = (options) => (options.client ?? client).get({
5773
+ responseValidator: relaxedResponseValidator(zListOrgAgentsResponse),
5774
+ security: [{
5775
+ key: "bearerAuth",
5776
+ scheme: "bearer",
5777
+ type: "http"
5778
+ }, {
5779
+ in: "cookie",
5780
+ name: "__Host-omnara_session",
5781
+ type: "apiKey"
5782
+ }],
5783
+ url: "/orgs/{orgID}/agents",
5784
+ ...options
5785
+ });
5786
+ var listOrgAgentProfiles = (options) => (options.client ?? client).get({
5787
+ responseValidator: relaxedResponseValidator(zListOrgAgentProfilesResponse),
5788
+ security: [{
5789
+ key: "bearerAuth",
5790
+ scheme: "bearer",
5791
+ type: "http"
5792
+ }, {
5793
+ in: "cookie",
5794
+ name: "__Host-omnara_session",
5795
+ type: "apiKey"
5796
+ }],
5797
+ url: "/orgs/{orgID}/agent-profiles",
5798
+ ...options
5799
+ });
5412
5800
  var listVisibleProjects = (options) => (options.client ?? client).get({
5413
5801
  responseValidator: relaxedResponseValidator(zListVisibleProjectsResponse),
5414
5802
  security: [{
@@ -6250,38 +6638,6 @@ var deleteSecretGrant = (options) => (options.client ?? client).delete({
6250
6638
  url: "/orgs/{orgID}/secrets/{secretID}/grants/{grantID}",
6251
6639
  ...options
6252
6640
  });
6253
- var listIntegrationInstalls = (options) => (options.client ?? client).get({
6254
- responseValidator: relaxedResponseValidator(zListIntegrationInstallsResponse2),
6255
- security: [{
6256
- key: "bearerAuth",
6257
- scheme: "bearer",
6258
- type: "http"
6259
- }, {
6260
- in: "cookie",
6261
- name: "__Host-omnara_session",
6262
- type: "apiKey"
6263
- }],
6264
- url: "/orgs/{orgID}/projects/{projectID}/integration-installs",
6265
- ...options
6266
- });
6267
- var deleteIntegrationInstall = (options) => (options.client ?? client).delete({
6268
- responseValidator: relaxedResponseValidator(zDeleteIntegrationInstallResponse),
6269
- security: [
6270
- {
6271
- key: "bearerAuth",
6272
- scheme: "bearer",
6273
- type: "http"
6274
- },
6275
- {
6276
- in: "cookie",
6277
- name: "__Host-omnara_session",
6278
- type: "apiKey"
6279
- },
6280
- { name: "X-Omnara-Csrf", type: "apiKey" }
6281
- ],
6282
- url: "/orgs/{orgID}/projects/{projectID}/integration-installs/{integrationInstallID}",
6283
- ...options
6284
- });
6285
6641
  var resolveAgentConfigTools = (options) => (options.client ?? client).post({
6286
6642
  responseValidator: relaxedResponseValidator(zResolveAgentConfigToolsResponse),
6287
6643
  security: [
@@ -6531,15 +6887,15 @@ var createIntegrationOAuthSetup = (options) => (options.client ?? client).post({
6531
6887
  },
6532
6888
  { name: "X-Omnara-Csrf", type: "apiKey" }
6533
6889
  ],
6534
- url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/integration-oauth/setup",
6890
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/oauth/setup",
6535
6891
  ...options,
6536
6892
  headers: {
6537
6893
  "Content-Type": "application/json",
6538
6894
  ...options.headers
6539
6895
  }
6540
6896
  });
6541
- var createSlackSetup = (options) => (options.client ?? client).post({
6542
- responseValidator: relaxedResponseValidator(zCreateSlackSetupResponse),
6897
+ var createIntegrationSlackSetup = (options) => (options.client ?? client).post({
6898
+ responseValidator: relaxedResponseValidator(zCreateIntegrationSlackSetupResponse),
6543
6899
  security: [
6544
6900
  {
6545
6901
  key: "bearerAuth",
@@ -6553,7 +6909,35 @@ var createSlackSetup = (options) => (options.client ?? client).post({
6553
6909
  },
6554
6910
  { name: "X-Omnara-Csrf", type: "apiKey" }
6555
6911
  ],
6556
- url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/slack-setup",
6912
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/slack-setup",
6913
+ ...options,
6914
+ headers: {
6915
+ "Content-Type": "application/json",
6916
+ ...options.headers
6917
+ }
6918
+ });
6919
+ var createIntegrationGitHubSetup = (options) => (options.client ?? client).post({
6920
+ responseValidator: relaxedResponseValidator(zCreateIntegrationGitHubSetupResponse),
6921
+ security: [{
6922
+ in: "cookie",
6923
+ name: "__Host-omnara_session",
6924
+ type: "apiKey"
6925
+ }, { name: "X-Omnara-Csrf", type: "apiKey" }],
6926
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/github-setup",
6927
+ ...options,
6928
+ headers: {
6929
+ "Content-Type": "application/json",
6930
+ ...options.headers
6931
+ }
6932
+ });
6933
+ var inspectIntegrationGitHubInstallations = (options) => (options.client ?? client).post({
6934
+ responseValidator: relaxedResponseValidator(zInspectIntegrationGitHubInstallationsResponse),
6935
+ security: [{
6936
+ in: "cookie",
6937
+ name: "__Host-omnara_session",
6938
+ type: "apiKey"
6939
+ }, { name: "X-Omnara-Csrf", type: "apiKey" }],
6940
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/github-setup/installations",
6557
6941
  ...options,
6558
6942
  headers: {
6559
6943
  "Content-Type": "application/json",
@@ -7839,6 +8223,16 @@ var sleepMachineDaemonRuntime = (options) => (options.client ?? client).post({
7839
8223
  url: "/daemon/runtimes/{runtimeID}/sleep",
7840
8224
  ...options
7841
8225
  });
8226
+ var getDaemonGitCredentials = (options) => (options.client ?? client).post({
8227
+ responseValidator: relaxedResponseValidator(zGetDaemonGitCredentialsResponse),
8228
+ security: [{
8229
+ key: "machineDaemonAuth",
8230
+ scheme: "bearer",
8231
+ type: "http"
8232
+ }],
8233
+ url: "/daemon/processes/{processID}/git-credentials",
8234
+ ...options
8235
+ });
7842
8236
  var getDaemonSkillArchive = (options) => (options.client ?? client).get({
7843
8237
  responseValidator: relaxedResponseValidator(zGetDaemonSkillArchiveResponse),
7844
8238
  security: [{
@@ -7874,24 +8268,245 @@ var uploadDaemonFile = (options) => (options.client ?? client).post({
7874
8268
  ...options.headers
7875
8269
  }
7876
8270
  });
8271
+ var listIntegrations = (options) => (options.client ?? client).get({
8272
+ responseValidator: relaxedResponseValidator(zListIntegrationsResponse2),
8273
+ security: [{
8274
+ key: "bearerAuth",
8275
+ scheme: "bearer",
8276
+ type: "http"
8277
+ }, {
8278
+ in: "cookie",
8279
+ name: "__Host-omnara_session",
8280
+ type: "apiKey"
8281
+ }],
8282
+ url: "/orgs/{orgID}/projects/{projectID}/integrations",
8283
+ ...options
8284
+ });
8285
+ var createIntegration = (options) => (options.client ?? client).post({
8286
+ responseValidator: relaxedResponseValidator(zCreateIntegrationResponse),
8287
+ security: [
8288
+ {
8289
+ key: "bearerAuth",
8290
+ scheme: "bearer",
8291
+ type: "http"
8292
+ },
8293
+ {
8294
+ in: "cookie",
8295
+ name: "__Host-omnara_session",
8296
+ type: "apiKey"
8297
+ },
8298
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8299
+ ],
8300
+ url: "/orgs/{orgID}/projects/{projectID}/integrations",
8301
+ ...options,
8302
+ headers: {
8303
+ "Content-Type": "application/json",
8304
+ ...options.headers
8305
+ }
8306
+ });
8307
+ var deleteIntegration = (options) => (options.client ?? client).delete({
8308
+ responseValidator: relaxedResponseValidator(zDeleteIntegrationResponse),
8309
+ security: [
8310
+ {
8311
+ key: "bearerAuth",
8312
+ scheme: "bearer",
8313
+ type: "http"
8314
+ },
8315
+ {
8316
+ in: "cookie",
8317
+ name: "__Host-omnara_session",
8318
+ type: "apiKey"
8319
+ },
8320
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8321
+ ],
8322
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}",
8323
+ ...options
8324
+ });
8325
+ var getIntegration = (options) => (options.client ?? client).get({
8326
+ responseValidator: relaxedResponseValidator(zGetIntegrationResponse),
8327
+ security: [{
8328
+ key: "bearerAuth",
8329
+ scheme: "bearer",
8330
+ type: "http"
8331
+ }, {
8332
+ in: "cookie",
8333
+ name: "__Host-omnara_session",
8334
+ type: "apiKey"
8335
+ }],
8336
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}",
8337
+ ...options
8338
+ });
8339
+ var updateIntegration = (options) => (options.client ?? client).put({
8340
+ responseValidator: relaxedResponseValidator(zUpdateIntegrationResponse),
8341
+ security: [
8342
+ {
8343
+ key: "bearerAuth",
8344
+ scheme: "bearer",
8345
+ type: "http"
8346
+ },
8347
+ {
8348
+ in: "cookie",
8349
+ name: "__Host-omnara_session",
8350
+ type: "apiKey"
8351
+ },
8352
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8353
+ ],
8354
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}",
8355
+ ...options,
8356
+ headers: {
8357
+ "Content-Type": "application/json",
8358
+ ...options.headers
8359
+ }
8360
+ });
8361
+ var listIntegrationSubscriptions = (options) => (options.client ?? client).get({
8362
+ responseValidator: relaxedResponseValidator(zListIntegrationSubscriptionsResponse2),
8363
+ security: [{
8364
+ key: "bearerAuth",
8365
+ scheme: "bearer",
8366
+ type: "http"
8367
+ }, {
8368
+ in: "cookie",
8369
+ name: "__Host-omnara_session",
8370
+ type: "apiKey"
8371
+ }],
8372
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/subscriptions",
8373
+ ...options
8374
+ });
8375
+ var createIntegrationSubscription = (options) => (options.client ?? client).post({
8376
+ responseValidator: relaxedResponseValidator(zCreateIntegrationSubscriptionResponse),
8377
+ security: [
8378
+ {
8379
+ key: "bearerAuth",
8380
+ scheme: "bearer",
8381
+ type: "http"
8382
+ },
8383
+ {
8384
+ in: "cookie",
8385
+ name: "__Host-omnara_session",
8386
+ type: "apiKey"
8387
+ },
8388
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8389
+ ],
8390
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/subscriptions",
8391
+ ...options,
8392
+ headers: {
8393
+ "Content-Type": "application/json",
8394
+ ...options.headers
8395
+ }
8396
+ });
8397
+ var deleteIntegrationSubscription = (options) => (options.client ?? client).delete({
8398
+ responseValidator: relaxedResponseValidator(zDeleteIntegrationSubscriptionResponse),
8399
+ security: [
8400
+ {
8401
+ key: "bearerAuth",
8402
+ scheme: "bearer",
8403
+ type: "http"
8404
+ },
8405
+ {
8406
+ in: "cookie",
8407
+ name: "__Host-omnara_session",
8408
+ type: "apiKey"
8409
+ },
8410
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8411
+ ],
8412
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/subscriptions/{subscriptionID}",
8413
+ ...options
8414
+ });
8415
+ var configureIntegration = (options) => (options.client ?? client).post({
8416
+ responseValidator: relaxedResponseValidator(zConfigureIntegrationResponse),
8417
+ security: [
8418
+ {
8419
+ key: "bearerAuth",
8420
+ scheme: "bearer",
8421
+ type: "http"
8422
+ },
8423
+ {
8424
+ in: "cookie",
8425
+ name: "__Host-omnara_session",
8426
+ type: "apiKey"
8427
+ },
8428
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8429
+ ],
8430
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/setup",
8431
+ ...options,
8432
+ headers: {
8433
+ "Content-Type": "application/json",
8434
+ ...options.headers
8435
+ }
8436
+ });
8437
+ var disconnectIntegration = (options) => (options.client ?? client).post({
8438
+ responseValidator: relaxedResponseValidator(zDisconnectIntegrationResponse),
8439
+ security: [
8440
+ {
8441
+ key: "bearerAuth",
8442
+ scheme: "bearer",
8443
+ type: "http"
8444
+ },
8445
+ {
8446
+ in: "cookie",
8447
+ name: "__Host-omnara_session",
8448
+ type: "apiKey"
8449
+ },
8450
+ { name: "X-Omnara-Csrf", type: "apiKey" }
8451
+ ],
8452
+ url: "/orgs/{orgID}/projects/{projectID}/integrations/{integrationID}/disconnect",
8453
+ ...options
8454
+ });
8455
+ var listIntegrationDefinitions = (options) => (options.client ?? client).get({
8456
+ responseValidator: relaxedResponseValidator(zListIntegrationDefinitionsResponse2),
8457
+ security: [{
8458
+ key: "bearerAuth",
8459
+ scheme: "bearer",
8460
+ type: "http"
8461
+ }, {
8462
+ in: "cookie",
8463
+ name: "__Host-omnara_session",
8464
+ type: "apiKey"
8465
+ }],
8466
+ url: "/orgs/{orgID}/projects/{projectID}/integration-definitions",
8467
+ ...options
8468
+ });
7877
8469
 
7878
8470
  // ../sdk/src/memory.ts
7879
8471
  var MAX_MEMORY_FILE_BYTES = 10 * 1024 * 1024;
7880
8472
  var FILE_DIGEST_HEADER = "X-Omnara-File-Digest";
7881
8473
 
8474
+ // ../sdk/src/profile-integration.ts
8475
+ import * as z8 from "zod";
8476
+ var discordPublicKeyPattern = "[a-fA-F0-9]{64}";
8477
+ var discordPublicKey = z8.string().regex(new RegExp(`^${discordPublicKeyPattern}$`));
8478
+ var profilesSchema = z8.array(zAgentProfileId).max(16).refine((ids) => new Set(ids).size === ids.length, "Choose each profile only once.");
8479
+ var repositorySchema = z8.string().trim().regex(/^[1-9][0-9]*$/, "Enter a positive repository ID without leading zeros.").refine((id) => BigInt(id) <= 9223372036854775807n, "The repository ID is too large.");
8480
+ var triggerSchema = z8.enum(["mention", "pull_request_opened", "both"]);
8481
+ var chatLauncherSchema = z8.object({ profiles: profilesSchema.min(1) }).strict();
8482
+ var githubLauncherSchema = z8.object({
8483
+ profile: zAgentProfileId,
8484
+ trigger: triggerSchema,
8485
+ repository_id: repositorySchema.optional()
8486
+ }).strict();
8487
+ function profileIntegrationProfileUpdate(integration, profileIds) {
8488
+ if (!["slack_thread", "discord_thread"].includes(integration.integration_kind))
8489
+ throw new Error("Profile editing requires a Slack or Discord integration.");
8490
+ const profiles = profilesSchema.parse(profileIds);
8491
+ const settings = { ...integration.settings };
8492
+ if (profiles.length === 0) delete settings.launcher;
8493
+ else settings.launcher = { profiles };
8494
+ return { settings };
8495
+ }
8496
+
7882
8497
  // src/config-file.ts
7883
8498
  import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
7884
8499
  import { homedir } from "node:os";
7885
8500
  import { dirname, join } from "node:path";
7886
- import * as z9 from "zod";
8501
+ import * as z10 from "zod";
7887
8502
 
7888
8503
  // src/output.ts
7889
- import * as z8 from "zod";
7890
- var zRenderValue = z8.json();
8504
+ import * as z9 from "zod";
8505
+ var zRenderValue = z9.json();
7891
8506
  var zOptionalRenderValue = zRenderValue.optional();
7892
- var zListEnvelope = z8.strictObject({
7893
- data: z8.array(zRenderValue),
7894
- next_cursor: z8.string().nullable()
8507
+ var zListEnvelope = z9.strictObject({
8508
+ data: z9.array(zRenderValue),
8509
+ next_cursor: z9.string().nullable()
7895
8510
  });
7896
8511
  var PREFERRED_LEADING_COLUMNS = ["id", "name"];
7897
8512
  var HIDDEN_TABLE_COLUMNS = /* @__PURE__ */ new Set(["org_id", "project_id"]);
@@ -8063,9 +8678,9 @@ async function runCliAction(action) {
8063
8678
  } catch (error) {
8064
8679
  if (error instanceof CliInputError) {
8065
8680
  console.error(`error: ${error.message}`);
8066
- } else if (error instanceof z8.ZodError) {
8681
+ } else if (error instanceof z9.ZodError) {
8067
8682
  console.error(`error: unexpected response shape:
8068
- ${z8.prettifyError(error)}`);
8683
+ ${z9.prettifyError(error)}`);
8069
8684
  } else if (error instanceof ApiError) {
8070
8685
  const code = error.code ? ` [${error.code}]` : "";
8071
8686
  console.error(`error: API ${error.status}${code}: ${error.message}`);
@@ -8078,11 +8693,11 @@ ${z8.prettifyError(error)}`);
8078
8693
  }
8079
8694
 
8080
8695
  // src/config-file.ts
8081
- var zConfigFile = z9.looseObject({
8082
- api_url: z9.url().optional(),
8083
- issuer_url: z9.url().optional(),
8084
- base_url: z9.url().optional(),
8085
- token: z9.string().min(1).optional(),
8696
+ var zConfigFile = z10.looseObject({
8697
+ api_url: z10.url().optional(),
8698
+ issuer_url: z10.url().optional(),
8699
+ base_url: z10.url().optional(),
8700
+ token: z10.string().min(1).optional(),
8086
8701
  org_id: zOrganizationId.optional(),
8087
8702
  project_id: zProjectId.optional()
8088
8703
  });
@@ -8099,9 +8714,9 @@ function loadConfigFile() {
8099
8714
  const path = configFilePath();
8100
8715
  if (!existsSync(path)) return { readable: true, file: {} };
8101
8716
  const json8 = zJsonText.safeParse(readFileSync(path, "utf8"));
8102
- if (!json8.success) return { readable: false, reason: z9.prettifyError(json8.error) };
8717
+ if (!json8.success) return { readable: false, reason: z10.prettifyError(json8.error) };
8103
8718
  const file = zConfigFile.safeParse(json8.data);
8104
- return file.success ? { readable: true, file: file.data } : { readable: false, reason: z9.prettifyError(file.error) };
8719
+ return file.success ? { readable: true, file: file.data } : { readable: false, reason: z10.prettifyError(file.error) };
8105
8720
  }
8106
8721
  function readConfigFile() {
8107
8722
  const loaded = loadConfigFile();
@@ -8128,7 +8743,7 @@ function updateConfigFile(patch) {
8128
8743
  const result = zConfigFile.safeParse(merged);
8129
8744
  if (!result.success) {
8130
8745
  throw new CliInputError(`refusing to save invalid config:
8131
- ${z9.prettifyError(result.error)}`);
8746
+ ${z10.prettifyError(result.error)}`);
8132
8747
  }
8133
8748
  mkdirSync(dirname(configFilePath()), { recursive: true, mode: 448 });
8134
8749
  writeFileSync(configFilePath(), `${JSON.stringify(result.data, null, 2)}
@@ -8140,7 +8755,7 @@ ${z9.prettifyError(result.error)}`);
8140
8755
  // src/device-login.ts
8141
8756
  import { hostname } from "node:os";
8142
8757
  import { intro, log, note, outro, spinner } from "@clack/prompts";
8143
- import * as z10 from "zod";
8758
+ import * as z11 from "zod";
8144
8759
 
8145
8760
  // src/browser.ts
8146
8761
  import { spawn } from "node:child_process";
@@ -8313,7 +8928,7 @@ function loginTokenName(explicit, hostName) {
8313
8928
  if (result.success) return result.data;
8314
8929
  if (explicit === void 0) return cliLoginTokenName();
8315
8930
  throw new CliInputError(`invalid token name:
8316
- ${z10.prettifyError(result.error)}`);
8931
+ ${z11.prettifyError(result.error)}`);
8317
8932
  }
8318
8933
  async function loginWithDevice(options) {
8319
8934
  const { report, store } = options;
@@ -8549,14 +9164,14 @@ function registerConfigCommand(program2, cli) {
8549
9164
 
8550
9165
  // src/factory.ts
8551
9166
  import { InvalidArgumentError } from "commander";
8552
- import * as z12 from "zod";
9167
+ import * as z13 from "zod";
8553
9168
 
8554
9169
  // src/flags.ts
8555
- import * as z11 from "zod";
8556
- var zScalarKind = z11.union([
8557
- z11.string().transform(() => "string"),
8558
- z11.number().transform(() => "number"),
8559
- z11.boolean().transform(() => "boolean")
9170
+ import * as z12 from "zod";
9171
+ var zScalarKind = z12.union([
9172
+ z12.string().transform(() => "string"),
9173
+ z12.number().transform(() => "number"),
9174
+ z12.boolean().transform(() => "boolean")
8560
9175
  ]);
8561
9176
  function isChoice(value) {
8562
9177
  return typeof value === "string" || typeof value === "number";
@@ -8673,7 +9288,7 @@ function finalizeFlag(draft) {
8673
9288
  };
8674
9289
  }
8675
9290
  function deriveFlags(schema) {
8676
- const jsonSchema = z11.toJSONSchema(schema, { io: "input" });
9291
+ const jsonSchema = z12.toJSONSchema(schema, { io: "input" });
8677
9292
  const drafts = /* @__PURE__ */ new Map();
8678
9293
  collectDrafts(drafts, jsonSchema, [], false);
8679
9294
  return [...drafts.values()].map(finalizeFlag);
@@ -8744,9 +9359,9 @@ function createFlowReporter(title) {
8744
9359
  }
8745
9360
 
8746
9361
  // src/factory.ts
8747
- var zFlagValue = z12.json();
8748
- var zFlagObject = z12.record(z12.string(), zFlagValue);
8749
- var zNoParams = z12.object({});
9362
+ var zFlagValue = z13.json();
9363
+ var zFlagObject = z13.record(z13.string(), zFlagValue);
9364
+ var zNoParams = z13.object({});
8750
9365
  function op(spec) {
8751
9366
  return {
8752
9367
  type: "op",
@@ -8902,7 +9517,7 @@ function parseWithSchema(schema, value, label) {
8902
9517
  const result = schema.safeParse(value);
8903
9518
  if (!result.success) {
8904
9519
  throw new CliInputError(`invalid ${label}:
8905
- ${z12.prettifyError(result.error)}`);
9520
+ ${z13.prettifyError(result.error)}`);
8906
9521
  }
8907
9522
  return result.data;
8908
9523
  }
@@ -8947,7 +9562,7 @@ function registerPathParams(command, plan) {
8947
9562
  command.option(param.option, `defaults from config (${param.describe})`);
8948
9563
  }
8949
9564
  }
8950
- var zExplicitOption = z12.string().optional();
9565
+ var zExplicitOption = z13.string().optional();
8951
9566
  async function resolvePathValues(plan, args, options, config2) {
8952
9567
  const path = {};
8953
9568
  plan.positionalParams.forEach((param, index) => {
@@ -9090,10 +9705,10 @@ function registerLoginCommand(program2, cli) {
9090
9705
  }
9091
9706
 
9092
9707
  // src/manifest.ts
9093
- import * as z26 from "zod";
9708
+ import * as z28 from "zod";
9094
9709
 
9095
9710
  // src/agent-commands.ts
9096
- import * as z18 from "zod";
9711
+ import * as z19 from "zod";
9097
9712
 
9098
9713
  // ../sdk/src/generated/@tanstack/react-query.gen.ts
9099
9714
  import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
@@ -9119,6 +9734,7 @@ var createQueryKey = (id, options, infinite, tags) => {
9119
9734
  }
9120
9735
  return [params];
9121
9736
  };
9737
+ var listOrgAgentsQueryKey = (options) => createQueryKey("listOrgAgents", options);
9122
9738
  var listAgentsQueryKey = (options) => createQueryKey("listAgents", options);
9123
9739
  var getAgentQueryKey = (options) => createQueryKey("getAgent", options);
9124
9740
  var getAgentOptions = (options) => queryOptions({
@@ -9195,12 +9811,12 @@ function useOmnaraClient() {
9195
9811
  }
9196
9812
 
9197
9813
  // ../react/src/domains/query-keys.ts
9198
- import { z as z13 } from "zod";
9199
- var generatedQueryKeyEntry = z13.object({
9200
- _id: z13.string(),
9201
- path: z13.object({
9202
- orgID: z13.string().optional(),
9203
- projectID: z13.string().optional()
9814
+ import { z as z14 } from "zod";
9815
+ var generatedQueryKeyEntry = z14.object({
9816
+ _id: z14.string(),
9817
+ path: z14.object({
9818
+ orgID: z14.string().optional(),
9819
+ projectID: z14.string().optional()
9204
9820
  }).optional()
9205
9821
  });
9206
9822
  function generatedQueryKey(query) {
@@ -9216,6 +9832,21 @@ function projectActorsQueryPredicate(orgID, projectID) {
9216
9832
  };
9217
9833
  }
9218
9834
 
9835
+ // ../react/src/domains/agent-activity.ts
9836
+ var activeAgentPollIntervalMs = 5e3;
9837
+ function isAgentActive(agent) {
9838
+ const state = agent.activity?.state;
9839
+ return state === "running" || state === "waiting_on_interaction";
9840
+ }
9841
+ function activeAgentsRefetchInterval(getAgents, refetchInterval) {
9842
+ return (query) => {
9843
+ const data = query.state.data;
9844
+ const own = refetchInterval?.(data);
9845
+ if (own) return own;
9846
+ return getAgents(data).some(isAgentActive) ? activeAgentPollIntervalMs : false;
9847
+ };
9848
+ }
9849
+
9219
9850
  // ../react/src/domains/agent-chat.ts
9220
9851
  import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
9221
9852
  import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
@@ -9224,7 +9855,7 @@ import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
9224
9855
  import { useInfiniteQuery } from "@tanstack/react-query";
9225
9856
 
9226
9857
  // ../react/src/domains/agent-chat-messages.ts
9227
- import { z as z14 } from "zod";
9858
+ import { z as z15 } from "zod";
9228
9859
  function parseStreamData(data) {
9229
9860
  if ("event_kind" in data) return { kind: "event", event: data };
9230
9861
  if ("tool_call_id" in data && "state" in data) return { kind: "tool_call_update" };
@@ -9261,7 +9892,7 @@ function mediaPart(block, id) {
9261
9892
  function isHiddenContentBlock(block) {
9262
9893
  return block.metadata?.omnara_hidden === "true";
9263
9894
  }
9264
- var structuredToolError = z14.object({ error_code: z14.string() });
9895
+ var structuredToolError = z15.object({ error_code: z15.string() });
9265
9896
  function structuredToolErrorCode(blocks) {
9266
9897
  for (const block of blocks) {
9267
9898
  if (block.type !== "structured_data") continue;
@@ -9682,7 +10313,7 @@ function historyHasEvent(queryClient, scope, matches) {
9682
10313
  // ../react/src/domains/agent-chat-transport.ts
9683
10314
  var sourceLabels = { web: "web app", cli: "CLI" };
9684
10315
  function sourceHint(source) {
9685
- return `This message came from the Omnara ${sourceLabels[source]}. Reply with normal assistant text unless explicitly asked to message an integration.`;
10316
+ return `This message came from the Omnara ${sourceLabels[source]}. Reply with normal assistant text unless explicitly asked to send a message through an integration.`;
9686
10317
  }
9687
10318
  var sdkAgentChatTransport = {
9688
10319
  openAgentEventStream,
@@ -9932,12 +10563,17 @@ async function invalidateSubagentList(queryClient, client2, scope, event, hasEve
9932
10563
  if (!spawnsSubagent(event, hasEvent) && !await sentBySubagent(queryClient, client2, scope, event)) {
9933
10564
  return;
9934
10565
  }
9935
- await queryClient.invalidateQueries({
9936
- queryKey: listAgentsQueryKey({
9937
- path: { orgID: scope.orgID, projectID: scope.projectID },
9938
- client: client2
10566
+ await Promise.all([
10567
+ queryClient.invalidateQueries({
10568
+ queryKey: listAgentsQueryKey({
10569
+ path: { orgID: scope.orgID, projectID: scope.projectID },
10570
+ client: client2
10571
+ })
10572
+ }),
10573
+ queryClient.invalidateQueries({
10574
+ queryKey: listOrgAgentsQueryKey({ path: { orgID: scope.orgID }, client: client2 })
9939
10575
  })
9940
- });
10576
+ ]);
9941
10577
  }
9942
10578
 
9943
10579
  // ../react/src/domains/usage.ts
@@ -10420,87 +11056,88 @@ import {
10420
11056
  useQueryClient as useQueryClient6,
10421
11057
  useSuspenseQuery as useSuspenseQuery3
10422
11058
  } from "@tanstack/react-query";
11059
+ var agentListRefetchInterval = activeAgentsRefetchInterval(
11060
+ (data) => data?.pages.flatMap((page) => page.data) ?? []
11061
+ );
10423
11062
 
10424
11063
  // ../react/src/domains/cron-triggers.ts
10425
11064
  import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
10426
11065
 
10427
- // ../react/src/domains/integration-installs.ts
10428
- import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient8 } from "@tanstack/react-query";
11066
+ // ../react/src/domains/integration-subscriptions.ts
11067
+ import {
11068
+ useInfiniteQuery as useInfiniteQuery5,
11069
+ useMutation as useMutation7,
11070
+ useQueryClient as useQueryClient8
11071
+ } from "@tanstack/react-query";
11072
+
11073
+ // ../react/src/domains/integrations.ts
11074
+ import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
10429
11075
 
10430
11076
  // ../react/src/domains/invitations.ts
10431
- import { useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient9, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
11077
+ import { useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient10, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
10432
11078
 
10433
11079
  // ../react/src/domains/machine-pools.ts
10434
- import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
11080
+ import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
10435
11081
 
10436
11082
  // ../react/src/domains/machines.ts
10437
- import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
11083
+ import { useInfiniteQuery as useInfiniteQuery8, useMutation as useMutation11, useQuery as useQuery10, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
10438
11084
 
10439
11085
  // ../react/src/domains/mcp-registry.ts
10440
- import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery10, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
11086
+ import { useInfiniteQuery as useInfiniteQuery9, useQuery as useQuery11, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
10441
11087
  var serverInfoStaleTime = 5 * 60 * 1e3;
10442
11088
 
10443
11089
  // ../react/src/domains/mcp-server-tools.ts
10444
- import { useQuery as useQuery11 } from "@tanstack/react-query";
11090
+ import { useQuery as useQuery12 } from "@tanstack/react-query";
10445
11091
  var mcpServerToolsStaleTime = 60 * 1e3;
10446
11092
 
10447
11093
  // ../react/src/domains/me.ts
10448
- import { useMutation as useMutation11, useQueryClient as useQueryClient13, useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
11094
+ import { useMutation as useMutation12, useQueryClient as useQueryClient14, useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
10449
11095
 
10450
11096
  // ../react/src/domains/memory.ts
10451
11097
  import {
10452
11098
  skipToken,
10453
- useInfiniteQuery as useInfiniteQuery9,
10454
- useMutation as useMutation12,
10455
- useQuery as useQuery12,
10456
- useQueryClient as useQueryClient14
11099
+ useInfiniteQuery as useInfiniteQuery10,
11100
+ useMutation as useMutation13,
11101
+ useQuery as useQuery13,
11102
+ useQueryClient as useQueryClient15
10457
11103
  } from "@tanstack/react-query";
10458
- import * as z15 from "zod";
10459
- var memoryFileDigest = z15.object({ digest: z15.string() });
11104
+ import * as z16 from "zod";
11105
+ var memoryFileDigest = z16.object({ digest: z16.string() });
10460
11106
 
10461
11107
  // ../react/src/domains/model-providers.ts
10462
11108
  import {
10463
- useInfiniteQuery as useInfiniteQuery10,
10464
- useMutation as useMutation13,
11109
+ useInfiniteQuery as useInfiniteQuery11,
11110
+ useMutation as useMutation14,
10465
11111
  useQueries,
10466
- useQuery as useQuery13,
10467
- useQueryClient as useQueryClient15
11112
+ useQuery as useQuery14,
11113
+ useQueryClient as useQueryClient16
10468
11114
  } from "@tanstack/react-query";
10469
11115
  import { useEffect as useEffect2 } from "react";
10470
- var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
10471
11116
 
10472
11117
  // ../react/src/domains/org-api-keys.ts
10473
- import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery14, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
11118
+ import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQuery as useQuery15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
10474
11119
 
10475
11120
  // ../react/src/domains/org-members.ts
10476
- import { useMutation as useMutation15, useQuery as useQuery15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
11121
+ import { useMutation as useMutation16, useQuery as useQuery16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
10477
11122
 
10478
11123
  // ../react/src/domains/orgs.ts
10479
- import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation16, useQuery as useQuery16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
11124
+ import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation17, useQuery as useQuery17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
10480
11125
 
10481
11126
  // ../react/src/domains/personal-access-tokens.ts
10482
- import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation17, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
11127
+ import { useInfiniteQuery as useInfiniteQuery14, useMutation as useMutation18, useQueryClient as useQueryClient20 } from "@tanstack/react-query";
10483
11128
 
10484
11129
  // ../react/src/domains/project-grants.ts
10485
- import { useInfiniteQuery as useInfiniteQuery14, useMutation as useMutation18, useQueryClient as useQueryClient20 } from "@tanstack/react-query";
11130
+ import { useInfiniteQuery as useInfiniteQuery15, useMutation as useMutation19, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
10486
11131
 
10487
11132
  // ../react/src/domains/projects.ts
10488
11133
  import {
10489
11134
  skipToken as skipToken2,
10490
- useInfiniteQuery as useInfiniteQuery15,
10491
- useQueryClient as useQueryClient21,
11135
+ useInfiniteQuery as useInfiniteQuery16,
11136
+ useQueryClient as useQueryClient22,
10492
11137
  useSuspenseInfiniteQuery
10493
11138
  } from "@tanstack/react-query";
10494
11139
 
10495
11140
  // ../react/src/domains/secrets.ts
10496
- import {
10497
- useInfiniteQuery as useInfiniteQuery16,
10498
- useMutation as useMutation19,
10499
- useQuery as useQuery17,
10500
- useQueryClient as useQueryClient22
10501
- } from "@tanstack/react-query";
10502
-
10503
- // ../react/src/domains/skills.ts
10504
11141
  import {
10505
11142
  useInfiniteQuery as useInfiniteQuery17,
10506
11143
  useMutation as useMutation20,
@@ -10508,8 +11145,16 @@ import {
10508
11145
  useQueryClient as useQueryClient23
10509
11146
  } from "@tanstack/react-query";
10510
11147
 
11148
+ // ../react/src/domains/skills.ts
11149
+ import {
11150
+ useInfiniteQuery as useInfiniteQuery18,
11151
+ useMutation as useMutation21,
11152
+ useQuery as useQuery19,
11153
+ useQueryClient as useQueryClient24
11154
+ } from "@tanstack/react-query";
11155
+
10511
11156
  // ../react/src/domains/tool-catalog.ts
10512
- import { useQuery as useQuery19 } from "@tanstack/react-query";
11157
+ import { useQuery as useQuery20 } from "@tanstack/react-query";
10513
11158
 
10514
11159
  // src/chat.tsx
10515
11160
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
@@ -10518,10 +11163,10 @@ import { render } from "ink";
10518
11163
  // src/chat-ui.tsx
10519
11164
  import { Box as Box2, Static, Text as Text2, useApp } from "ink";
10520
11165
  import { useEffect as useEffect3, useMemo as useMemo2, useReducer, useState as useState2 } from "react";
10521
- import * as z17 from "zod";
11166
+ import * as z18 from "zod";
10522
11167
 
10523
11168
  // src/agent-rendering.ts
10524
- import * as z16 from "zod";
11169
+ import * as z17 from "zod";
10525
11170
  var formatAgentEventList = (response) => {
10526
11171
  const page = {
10527
11172
  data: response.data.map((event) => ({
@@ -10538,10 +11183,10 @@ var formatAgentEventList = (response) => {
10538
11183
  return { value: next_before_sequence == null ? page : { ...page, next_before_sequence } };
10539
11184
  };
10540
11185
  var summaryWidth = 100;
10541
- var zJsonValue = z16.json();
10542
- var zRunCommandInput = z16.object({ command: z16.string() });
11186
+ var zJsonValue = z17.json();
11187
+ var zRunCommandInput = z17.object({ command: z17.string() });
10543
11188
  function summaryValue(value) {
10544
- const text = z16.string().safeParse(value);
11189
+ const text = z17.string().safeParse(value);
10545
11190
  return text.success ? text.data : JSON.stringify(value);
10546
11191
  }
10547
11192
  function toolCallSummary(name, input) {
@@ -10735,10 +11380,10 @@ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
10735
11380
  var spinnerFrames = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"];
10736
11381
  var streamingTailLines = 8;
10737
11382
  var streamingTailChars = 1500;
10738
- var zToolInput2 = z17.record(z17.string(), z17.json());
10739
- var zToolOutput = z17.object({
11383
+ var zToolInput2 = z18.record(z18.string(), z18.json());
11384
+ var zToolOutput = z18.object({
10740
11385
  outcome: zToolCallOutcome,
10741
- contentBlocks: z17.array(zToolResultContentBlock)
11386
+ contentBlocks: z18.array(zToolResultContentBlock)
10742
11387
  });
10743
11388
  function formatDuration(ms) {
10744
11389
  const seconds = Math.max(1, Math.round(ms / 1e3));
@@ -11104,7 +11749,7 @@ var agentEventsStreamOp = customOp({
11104
11749
  },
11105
11750
  run: async ({ client: client2, path, args, options }) => {
11106
11751
  const agentID = parseWithSchema(zAgentId, args[0], "agent id");
11107
- const afterSequence = parseWithSchema(z18.int().gte(0).optional(), options.afterSequence, "--after-sequence") ?? 0;
11752
+ const afterSequence = parseWithSchema(z19.int().gte(0).optional(), options.afterSequence, "--after-sequence") ?? 0;
11108
11753
  const abort = new AbortController();
11109
11754
  process.once("SIGINT", () => {
11110
11755
  abort.abort();
@@ -11121,12 +11766,12 @@ var agentEventsStreamOp = customOp({
11121
11766
 
11122
11767
  // src/config-attachment.ts
11123
11768
  import { readFileSync as readFileSync2 } from "node:fs";
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)")
11769
+ import * as z20 from "zod";
11770
+ var zConfigSourceAttachment = z20.object({
11771
+ file: z20.string().min(1).optional().describe("path to an agent config file (.yaml, .yml, or .json)"),
11772
+ source: z20.string().min(1).optional().describe("inline agent config source (YAML or JSON)")
11128
11773
  });
11129
- var zConfigAttachment = z19.object({
11774
+ var zConfigAttachment = z20.object({
11130
11775
  config: zAgentConfigId.optional().describe("existing agent config ID"),
11131
11776
  ...zConfigSourceAttachment.shape
11132
11777
  });
@@ -11160,59 +11805,341 @@ function renderConfigSource(attachment) {
11160
11805
  } catch {
11161
11806
  throw new CliInputError(`could not read config file: ${attachment.file}`);
11162
11807
  }
11163
- return { source, source_format: format };
11164
- }
11165
- if (attachment.source !== void 0) {
11166
- return { source: attachment.source, source_format: inlineFormat(attachment.source) };
11808
+ return { source, source_format: format };
11809
+ }
11810
+ if (attachment.source !== void 0) {
11811
+ return { source: attachment.source, source_format: inlineFormat(attachment.source) };
11812
+ }
11813
+ throw new CliInputError(SOURCE_HINT);
11814
+ }
11815
+ async function resolveConfigId(client2, path, attachment) {
11816
+ requireExactlyOne([attachment.config, attachment.file, attachment.source], ATTACHMENT_HINT);
11817
+ if (attachment.config !== void 0) return attachment.config;
11818
+ const { data } = await sdk_gen_exports.createAgentConfig({
11819
+ client: client2,
11820
+ path,
11821
+ body: renderConfigSource(attachment)
11822
+ });
11823
+ return data.id;
11824
+ }
11825
+ async function currentProfileConfigId(client2, path) {
11826
+ const { data } = await sdk_gen_exports.getAgentProfile({ client: client2, path });
11827
+ return data.current_config_id;
11828
+ }
11829
+
11830
+ // src/format.ts
11831
+ function pickFields(source, fields) {
11832
+ const picked = {};
11833
+ for (const field of fields) {
11834
+ const value = source[field];
11835
+ if (value !== void 0) picked[field] = value;
11836
+ }
11837
+ return picked;
11838
+ }
11839
+ function formatTable(columns) {
11840
+ return (response) => ({
11841
+ value: {
11842
+ data: response.data.map((item) => pickFields(item, columns)),
11843
+ next_cursor: response.next_cursor
11844
+ },
11845
+ columns
11846
+ });
11847
+ }
11848
+ function formatRecord() {
11849
+ return (data) => ({ value: data });
11850
+ }
11851
+ function formatVoid(message = "ok") {
11852
+ return () => ({ value: message });
11853
+ }
11854
+
11855
+ // src/integration-setup.ts
11856
+ import * as z23 from "zod";
11857
+
11858
+ // src/slack-setup.ts
11859
+ import * as z22 from "zod";
11860
+
11861
+ // src/mcp-oauth.ts
11862
+ import * as z21 from "zod";
11863
+ async function authorizeMcpOAuthSecret(options) {
11864
+ const { data: start } = await sdk_gen_exports.startSecretMcpoAuth({
11865
+ client: options.client,
11866
+ path: { orgID: options.orgId },
11867
+ body: options.request
11868
+ });
11869
+ options.onAuthorization(start.authorization_url);
11870
+ return pollUntilDeadline({
11871
+ expiresAt: start.expires_at,
11872
+ expiredMessage: "MCP OAuth authorization expired before the secret was created",
11873
+ async fetchOnce() {
11874
+ const { data } = await sdk_gen_exports.listSecrets({
11875
+ client: options.client,
11876
+ path: { orgID: options.orgId },
11877
+ query: { mcp_oauth_flow_id: start.flow_id, limit: 1 }
11878
+ });
11879
+ return data.data[0];
11880
+ }
11881
+ });
11882
+ }
11883
+ var zBrowserFlag = z21.boolean().default(true).describe("open the authorization URL in a browser");
11884
+ function openAuthorizationUrl(report, title, url4, browser) {
11885
+ report.url(title, url4);
11886
+ if (browser) {
11887
+ openInBrowser(url4, (message) => {
11888
+ report.warn(message);
11889
+ });
11890
+ }
11891
+ }
11892
+ var zMcpOAuthBody = zMcpoAuthStartRequest.extend({ browser: zBrowserFlag });
11893
+ async function runMcpOAuth(context) {
11894
+ const { client: client2, path, body, report } = context;
11895
+ const { browser, ...request } = body;
11896
+ let secret;
11897
+ try {
11898
+ secret = await authorizeMcpOAuthSecret({
11899
+ client: client2,
11900
+ orgId: path.orgID,
11901
+ request,
11902
+ onAuthorization(url4) {
11903
+ openAuthorizationUrl(report, "Authorize this MCP server in your browser", url4, browser);
11904
+ report.start("Waiting for the secret to be created");
11905
+ }
11906
+ });
11907
+ } catch (error) {
11908
+ report.fail("Authorization failed");
11909
+ throw error;
11910
+ }
11911
+ report.stop("Secret created");
11912
+ report.info(`Secret ID: ${secret.id}`);
11913
+ report.done();
11914
+ }
11915
+
11916
+ // src/slack-setup.ts
11917
+ var zSlackBody = z22.object({
11918
+ app_name: z22.string().optional().describe("name for a new Slack app"),
11919
+ app_configuration_token: z22.string().optional().describe("Slack app configuration token for a new app"),
11920
+ icon_filename: z22.string().optional().describe("filename for the new Slack app icon"),
11921
+ icon_data_base64: z22.string().optional().describe("base64-encoded Slack app icon"),
11922
+ client_id: z22.string().optional().describe("existing Slack app client ID"),
11923
+ client_secret: z22.string().optional().describe("existing Slack app client secret"),
11924
+ signing_secret: z22.string().optional().describe("existing Slack app signing secret"),
11925
+ return_to: z22.string().optional().describe("console-relative path opened after authorization"),
11926
+ browser: zBrowserFlag
11927
+ });
11928
+ function parseRequest(body) {
11929
+ const createAppFields = [
11930
+ body.app_name,
11931
+ body.app_configuration_token,
11932
+ body.icon_filename,
11933
+ body.icon_data_base64
11934
+ ];
11935
+ const existingAppFields = [body.client_id, body.client_secret, body.signing_secret];
11936
+ const createsApp = createAppFields.some((value) => value !== void 0);
11937
+ const usesExistingApp = existingAppFields.some((value) => value !== void 0);
11938
+ if (createsApp && usesExistingApp) {
11939
+ throw new CliInputError(
11940
+ "choose either --app-name with --app-configuration-token, or existing app credentials"
11941
+ );
11942
+ }
11943
+ if (usesExistingApp) {
11944
+ const draft2 = {
11945
+ client_id: body.client_id,
11946
+ client_secret: body.client_secret,
11947
+ signing_secret: body.signing_secret
11948
+ };
11949
+ if (body.return_to !== void 0) draft2.return_to = body.return_to;
11950
+ const result2 = zCreateIntegrationOAuthSetupRequest.safeParse(draft2);
11951
+ if (!result2.success) {
11952
+ throw new CliInputError(
11953
+ `invalid existing Slack app parameters:
11954
+ ${z22.prettifyError(result2.error)}`
11955
+ );
11956
+ }
11957
+ return { kind: "existing-app", body: result2.data };
11958
+ }
11959
+ if (body.icon_filename !== void 0 && body.icon_data_base64 === void 0) {
11960
+ throw new CliInputError("--icon-filename requires --icon-data-base64");
11961
+ }
11962
+ const draft = {
11963
+ app_name: body.app_name,
11964
+ app_configuration_token: body.app_configuration_token
11965
+ };
11966
+ if (body.icon_data_base64 !== void 0) {
11967
+ draft.icon = { data_base64: body.icon_data_base64 };
11968
+ if (body.icon_filename !== void 0) draft.icon.filename = body.icon_filename;
11969
+ }
11970
+ if (body.return_to !== void 0) draft.return_to = body.return_to;
11971
+ const result = zCreateSlackSetupRequest.safeParse(draft);
11972
+ if (!result.success) {
11973
+ throw new CliInputError(
11974
+ `invalid Slack app parameters:
11975
+ ${z22.prettifyError(result.error)}
11976
+ Pass --app-name and --app-configuration-token, or existing app credentials.`
11977
+ );
11978
+ }
11979
+ return { kind: "create-app", body: result.data };
11980
+ }
11981
+ async function runSlackIntegration(context) {
11982
+ const { client: client2, path, body, report } = context;
11983
+ const request = parseRequest(body);
11984
+ const setupPath = {
11985
+ orgID: path.orgID,
11986
+ projectID: path.projectID,
11987
+ integrationID: path.integrationID
11988
+ };
11989
+ let start;
11990
+ let slackAppId;
11991
+ if (request.kind === "create-app") {
11992
+ const { data } = await sdk_gen_exports.createIntegrationSlackSetup({
11993
+ client: client2,
11994
+ path: setupPath,
11995
+ body: request.body
11996
+ });
11997
+ start = data;
11998
+ slackAppId = data.slack_app_id;
11999
+ } else {
12000
+ const { data } = await sdk_gen_exports.createIntegrationOAuthSetup({
12001
+ client: client2,
12002
+ path: setupPath,
12003
+ body: request.body
12004
+ });
12005
+ start = data;
12006
+ }
12007
+ openAuthorizationUrl(
12008
+ report,
12009
+ "Authorize the Slack app in your browser",
12010
+ start.oauth_url,
12011
+ body.browser
12012
+ );
12013
+ report.start("Waiting for the Slack integration to connect");
12014
+ let integration;
12015
+ try {
12016
+ integration = await pollUntilDeadline({
12017
+ expiresAt: start.expires_at,
12018
+ expiredMessage: "Slack authorization expired before the integration connected",
12019
+ async fetchOnce() {
12020
+ const { data } = await sdk_gen_exports.getIntegration({ client: client2, path: setupPath });
12021
+ return data.state === "active" && data.last_oauth_flow_id === start.flow_id ? data : void 0;
12022
+ }
12023
+ });
12024
+ } catch (error) {
12025
+ report.fail("Slack authorization failed");
12026
+ if (slackAppId !== void 0) {
12027
+ report.warn(`Slack app ${slackAppId} was created, but Omnara setup was not completed`);
12028
+ }
12029
+ throw error;
11167
12030
  }
11168
- throw new CliInputError(SOURCE_HINT);
12031
+ report.stop("Slack integration connected");
12032
+ report.info(`Integration ID: ${integration.id} (${integration.name})`);
12033
+ report.info(
12034
+ "Reconnect preserves existing integration settings. Use integrations get/update to inspect or change the launcher."
12035
+ );
12036
+ report.done();
11169
12037
  }
11170
- async function resolveConfigId(client2, path, attachment) {
11171
- requireExactlyOne([attachment.config, attachment.file, attachment.source], ATTACHMENT_HINT);
11172
- if (attachment.config !== void 0) return attachment.config;
11173
- const { data } = await sdk_gen_exports.createAgentConfig({
12038
+
12039
+ // src/integration-setup.ts
12040
+ var zIntegrationProfilesBody = z23.object({
12041
+ profile_ids: z23.array(zAgentProfileId).max(16).describe("repeat for each offered profile; preserves other integration settings")
12042
+ });
12043
+ async function runIntegrationProfilesUpdate(context) {
12044
+ const { client: client2, path, body, report } = context;
12045
+ const { data: integration } = await sdk_gen_exports.getIntegration({ client: client2, path });
12046
+ await sdk_gen_exports.updateIntegration({
11174
12047
  client: client2,
11175
12048
  path,
11176
- body: renderConfigSource(attachment)
12049
+ body: profileIntegrationProfileUpdate(integration, body.profile_ids)
11177
12050
  });
11178
- return data.id;
11179
- }
11180
- async function currentProfileConfigId(client2, path) {
11181
- const { data } = await sdk_gen_exports.getAgentProfile({ client: client2, path });
11182
- return data.current_config_id;
12051
+ report.info("Profiles saved. One launches immediately; several show a menu to select one.");
12052
+ report.done();
11183
12053
  }
11184
-
11185
- // src/format.ts
11186
- function pickFields(source, fields) {
11187
- const picked = {};
11188
- for (const field of fields) {
11189
- const value = source[field];
11190
- if (value !== void 0) picked[field] = value;
12054
+ var integrationCommandGroups = [
12055
+ {
12056
+ name: "integrations",
12057
+ summary: "Manage project integrations, credentials and launchers",
12058
+ operations: [
12059
+ op({
12060
+ verb: "definitions",
12061
+ summary: "List available integration implementations and capabilities",
12062
+ fn: sdk_gen_exports.listIntegrationDefinitions,
12063
+ path: zListIntegrationDefinitionsPath,
12064
+ format: formatRecord()
12065
+ }),
12066
+ op({
12067
+ verb: "list",
12068
+ summary: "List project integrations",
12069
+ fn: sdk_gen_exports.listIntegrations,
12070
+ path: zListIntegrationsPath,
12071
+ query: zListIntegrationsQuery,
12072
+ format: formatTable(["id", "name", "integration_kind", "state"])
12073
+ }),
12074
+ op({
12075
+ verb: "get",
12076
+ summary: "Read integration setup and exported capabilities",
12077
+ fn: sdk_gen_exports.getIntegration,
12078
+ path: zGetIntegrationPath,
12079
+ format: formatRecord()
12080
+ }),
12081
+ op({
12082
+ verb: "create",
12083
+ summary: "Create a disconnected integration and optional launcher",
12084
+ fn: sdk_gen_exports.createIntegration,
12085
+ path: zCreateIntegrationPath,
12086
+ body: zCreateIntegrationBody,
12087
+ format: formatRecord()
12088
+ }),
12089
+ op({
12090
+ verb: "update",
12091
+ summary: "Replace integration settings; name and kind are immutable",
12092
+ fn: sdk_gen_exports.updateIntegration,
12093
+ path: zUpdateIntegrationPath,
12094
+ body: zUpdateIntegrationBody,
12095
+ format: formatRecord()
12096
+ }),
12097
+ op({
12098
+ verb: "configure",
12099
+ summary: "Verify GitHub or Discord credentials for an integration; use integrations slack for Slack",
12100
+ fn: sdk_gen_exports.configureIntegration,
12101
+ path: zConfigureIntegrationPath,
12102
+ body: zConfigureIntegrationBody,
12103
+ format: formatRecord()
12104
+ }),
12105
+ flowOp({
12106
+ verb: "slack",
12107
+ summary: "Connect this integration to Slack through browser authorization",
12108
+ path: zGetIntegrationPath,
12109
+ body: zSlackBody,
12110
+ run: runSlackIntegration
12111
+ }),
12112
+ flowOp({
12113
+ verb: "profiles",
12114
+ summary: "Edit offered Slack or Discord profiles",
12115
+ path: zGetIntegrationPath,
12116
+ body: zIntegrationProfilesBody,
12117
+ run: runIntegrationProfilesUpdate
12118
+ }),
12119
+ op({
12120
+ verb: "disconnect",
12121
+ summary: "Stop provider access while retaining integration setup and agents",
12122
+ fn: sdk_gen_exports.disconnectIntegration,
12123
+ path: zDisconnectIntegrationPath,
12124
+ format: formatRecord()
12125
+ }),
12126
+ op({
12127
+ verb: "delete",
12128
+ summary: "Delete integration setup and revoke its capabilities; retain agents",
12129
+ fn: sdk_gen_exports.deleteIntegration,
12130
+ path: zDeleteIntegrationPath,
12131
+ format: formatVoid("deleted")
12132
+ })
12133
+ ]
11191
12134
  }
11192
- return picked;
11193
- }
11194
- function formatTable(columns) {
11195
- return (response) => ({
11196
- value: {
11197
- data: response.data.map((item) => pickFields(item, columns)),
11198
- next_cursor: response.next_cursor
11199
- },
11200
- columns
11201
- });
11202
- }
11203
- function formatRecord() {
11204
- return (data) => ({ value: data });
11205
- }
11206
- function formatVoid(message = "ok") {
11207
- return () => ({ value: message });
11208
- }
12135
+ ];
11209
12136
 
11210
12137
  // src/machine-setup.ts
11211
12138
  import { spawn as spawn2, spawnSync } from "node:child_process";
11212
12139
  import { accessSync, constants, existsSync as existsSync2, readdirSync, readFileSync as readFileSync3 } from "node:fs";
11213
12140
  import { homedir as homedir2, release } from "node:os";
11214
12141
  import { basename, dirname as dirname2, isAbsolute, join as join2, resolve } from "node:path";
11215
- import * as z20 from "zod";
12142
+ import * as z24 from "zod";
11216
12143
  var zMachineSetupBody = zConnectByoMachineRequest;
11217
12144
  async function connectMachine(context) {
11218
12145
  const { client: client2, path, body, report } = context;
@@ -11249,9 +12176,9 @@ var daemonConfigFileName = "daemon.json";
11249
12176
  var installLockFileName = "install.lock";
11250
12177
  var daemonLockFileName = "daemon.lock";
11251
12178
  var daemonLockPollMs = 250;
11252
- var zDaemonConfigFile = z20.looseObject({
11253
- machine_id: z20.string().optional(),
11254
- api_url: z20.string().optional()
12179
+ var zDaemonConfigFile = z24.looseObject({
12180
+ machine_id: z24.string().optional(),
12181
+ api_url: z24.string().optional()
11255
12182
  });
11256
12183
  function daemonHome() {
11257
12184
  const override = process.env.OMNARA_HOME;
@@ -11533,67 +12460,10 @@ function runInstaller(report, apiUrl, token, machineId, home) {
11533
12460
 
11534
12461
  // src/mcp-add.ts
11535
12462
  import { isMap, isScalar as isScalar2, parseDocument } from "yaml";
11536
- import * as z22 from "zod";
11537
-
11538
- // src/mcp-oauth.ts
11539
- import * as z21 from "zod";
11540
- async function authorizeMcpOAuthSecret(options) {
11541
- const { data: start } = await sdk_gen_exports.startSecretMcpoAuth({
11542
- client: options.client,
11543
- path: { orgID: options.orgId },
11544
- body: options.request
11545
- });
11546
- options.onAuthorization(start.authorization_url);
11547
- return pollUntilDeadline({
11548
- expiresAt: start.expires_at,
11549
- expiredMessage: "MCP OAuth authorization expired before the secret was created",
11550
- async fetchOnce() {
11551
- const { data } = await sdk_gen_exports.listSecrets({
11552
- client: options.client,
11553
- path: { orgID: options.orgId },
11554
- query: { mcp_oauth_flow_id: start.flow_id, limit: 1 }
11555
- });
11556
- return data.data[0];
11557
- }
11558
- });
11559
- }
11560
- var zBrowserFlag = z21.boolean().default(true).describe("open the authorization URL in a browser");
11561
- function openAuthorizationUrl(report, title, url4, browser) {
11562
- report.url(title, url4);
11563
- if (browser) {
11564
- openInBrowser(url4, (message) => {
11565
- report.warn(message);
11566
- });
11567
- }
11568
- }
11569
- var zMcpOAuthBody = zMcpoAuthStartRequest.extend({ browser: zBrowserFlag });
11570
- async function runMcpOAuth(context) {
11571
- const { client: client2, path, body, report } = context;
11572
- const { browser, ...request } = body;
11573
- let secret;
11574
- try {
11575
- secret = await authorizeMcpOAuthSecret({
11576
- client: client2,
11577
- orgId: path.orgID,
11578
- request,
11579
- onAuthorization(url4) {
11580
- openAuthorizationUrl(report, "Authorize this MCP server in your browser", url4, browser);
11581
- report.start("Waiting for the secret to be created");
11582
- }
11583
- });
11584
- } catch (error) {
11585
- report.fail("Authorization failed");
11586
- throw error;
11587
- }
11588
- report.stop("Secret created");
11589
- report.info(`Secret ID: ${secret.id}`);
11590
- report.done();
11591
- }
11592
-
11593
- // src/mcp-add.ts
12463
+ import * as z25 from "zod";
11594
12464
  var SERVER_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9-]{0,31}$/;
11595
12465
  var zMcpAddBody = zMcpoAuthStartRequest.omit({ owner: true, name: true }).extend({
11596
- server_name: z22.string().regex(
12466
+ server_name: z25.string().regex(
11597
12467
  SERVER_KEY_PATTERN,
11598
12468
  "must start with a letter and contain at most 32 letters, digits, or hyphens"
11599
12469
  ).describe("MCP server key used in the agent config"),
@@ -11606,7 +12476,7 @@ function targetLabel(target) {
11606
12476
  function serverEntry(url4, secretId) {
11607
12477
  return { url: url4, auth: { type: "oauth", secret_id: secretId } };
11608
12478
  }
11609
- var zJsonRecord = z22.record(z22.string(), z22.json());
12479
+ var zJsonRecord = z25.record(z25.string(), z25.json());
11610
12480
  function prepareJsonConfig(config2, serverName, mcpUrl) {
11611
12481
  const json8 = zJsonText.safeParse(config2.source ?? "");
11612
12482
  if (!json8.success) throw new CliInputError("the current agent config contains invalid JSON");
@@ -11768,9 +12638,9 @@ function runProfileMcpAdd(context) {
11768
12638
  // src/memory-files.ts
11769
12639
  import { open, writeFile } from "node:fs/promises";
11770
12640
  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")
12641
+ import * as z26 from "zod";
12642
+ var zMemoryUploadBody = z26.object({
12643
+ file: z26.string().min(1).describe("local file to upload")
11774
12644
  });
11775
12645
  async function loadMemoryUpload(file) {
11776
12646
  const handle = await open(file, "r");
@@ -11802,7 +12672,7 @@ var memoryDownloadOp = customOp({
11802
12672
  { path: options.path ?? null },
11803
12673
  "query flags"
11804
12674
  );
11805
- const output = parseWithSchema(z23.string().min(1), options.output, "--output");
12675
+ const output = parseWithSchema(z26.string().min(1), options.output, "--output");
11806
12676
  const { response } = await sdk_gen_exports.downloadMemoryFile({ client: client2, path, query, parseAs: "stream" });
11807
12677
  const digest = response.headers.get(FILE_DIGEST_HEADER);
11808
12678
  if (!digest) throw new CliInputError("file response is missing its digest");
@@ -11816,10 +12686,10 @@ var memoryDownloadOp = customOp({
11816
12686
  import { readdirSync as readdirSync2, readFileSync as readFileSync4, statSync } from "node:fs";
11817
12687
  import { basename as basename2, dirname as dirname3, join as join3, resolve as resolve2 } from "node:path";
11818
12688
  import * as tar from "tar";
11819
- import * as z24 from "zod";
11820
- var zCreateSkillCliBody = z24.object({
12689
+ import * as z27 from "zod";
12690
+ var zCreateSkillCliBody = z27.object({
11821
12691
  owner: zSkillOwnerInput,
11822
- archive: z24.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
12692
+ archive: z27.string().min(1).describe("path to a skill directory (packed automatically) or a .zip/.tar.gz archive")
11823
12693
  });
11824
12694
  var ARCHIVE_SUFFIXES = [".zip", ".tar.gz", ".tgz"];
11825
12695
  function assertPackable(dir) {
@@ -11860,130 +12730,9 @@ async function loadSkillArchive(archivePath) {
11860
12730
  return new File([new Uint8Array(readFileSync4(archivePath))], filename);
11861
12731
  }
11862
12732
 
11863
- // src/slack-integration.ts
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"),
11874
- browser: zBrowserFlag
11875
- });
11876
- function parseRequest(body) {
11877
- const createAppFields = [
11878
- body.app_name,
11879
- body.app_configuration_token,
11880
- body.icon_filename,
11881
- body.icon_data_base64
11882
- ];
11883
- const existingAppFields = [body.client_id, body.client_secret, body.signing_secret];
11884
- const createsApp = createAppFields.some((value) => value !== void 0);
11885
- const usesExistingApp = existingAppFields.some((value) => value !== void 0);
11886
- if (createsApp && usesExistingApp) {
11887
- throw new CliInputError(
11888
- "choose either --app-name with --app-configuration-token, or existing app credentials"
11889
- );
11890
- }
11891
- if (usesExistingApp) {
11892
- const draft2 = {
11893
- provider: "slack",
11894
- client_id: body.client_id,
11895
- client_secret: body.client_secret,
11896
- signing_secret: body.signing_secret
11897
- };
11898
- if (body.return_to !== void 0) draft2.return_to = body.return_to;
11899
- const result2 = zCreateIntegrationOAuthSetupRequest.safeParse(draft2);
11900
- if (!result2.success) {
11901
- throw new CliInputError(
11902
- `invalid existing Slack app parameters:
11903
- ${z25.prettifyError(result2.error)}`
11904
- );
11905
- }
11906
- return { kind: "existing-app", body: result2.data };
11907
- }
11908
- if (body.icon_filename !== void 0 && body.icon_data_base64 === void 0) {
11909
- throw new CliInputError("--icon-filename requires --icon-data-base64");
11910
- }
11911
- const draft = {
11912
- app_name: body.app_name,
11913
- app_configuration_token: body.app_configuration_token
11914
- };
11915
- if (body.icon_data_base64 !== void 0) {
11916
- draft.icon = { data_base64: body.icon_data_base64 };
11917
- if (body.icon_filename !== void 0) draft.icon.filename = body.icon_filename;
11918
- }
11919
- if (body.return_to !== void 0) draft.return_to = body.return_to;
11920
- const result = zCreateSlackSetupRequest.safeParse(draft);
11921
- if (!result.success) {
11922
- throw new CliInputError(
11923
- `invalid Slack app parameters:
11924
- ${z25.prettifyError(result.error)}
11925
- Pass --app-name and --app-configuration-token, or existing app credentials.`
11926
- );
11927
- }
11928
- return { kind: "create-app", body: result.data };
11929
- }
11930
- async function runSlackIntegration(context) {
11931
- const { client: client2, path, body, report } = context;
11932
- const request = parseRequest(body);
11933
- const setupPath = {
11934
- orgID: path.orgID,
11935
- projectID: path.projectID,
11936
- agentProfileID: path.agentProfileID
11937
- };
11938
- let start;
11939
- let slackAppId;
11940
- if (request.kind === "create-app") {
11941
- const { data } = await sdk_gen_exports.createSlackSetup({ client: client2, path: setupPath, body: request.body });
11942
- start = data;
11943
- slackAppId = data.slack_app_id;
11944
- } else {
11945
- const { data } = await sdk_gen_exports.createIntegrationOAuthSetup({
11946
- client: client2,
11947
- path: setupPath,
11948
- body: request.body
11949
- });
11950
- start = data;
11951
- }
11952
- openAuthorizationUrl(
11953
- report,
11954
- "Approve the Slack integration in your browser",
11955
- start.oauth_url,
11956
- body.browser
11957
- );
11958
- report.start("Waiting for the Slack integration to be created");
11959
- let integration;
11960
- try {
11961
- integration = await pollUntilDeadline({
11962
- expiresAt: start.expires_at,
11963
- expiredMessage: "Slack authorization expired before the integration was created",
11964
- async fetchOnce() {
11965
- const { data } = await sdk_gen_exports.listIntegrationInstalls({
11966
- client: client2,
11967
- path: { orgID: path.orgID, projectID: path.projectID },
11968
- query: { oauth_flow_id: start.flow_id, limit: 1 }
11969
- });
11970
- return data.data[0];
11971
- }
11972
- });
11973
- } catch (error) {
11974
- report.fail("Slack authorization failed");
11975
- if (slackAppId !== void 0) {
11976
- report.warn(`Slack app ${slackAppId} was created, but the integration was not completed`);
11977
- }
11978
- throw error;
11979
- }
11980
- report.stop("Slack integration created");
11981
- report.info(`Integration ID: ${integration.id}`);
11982
- report.done();
11983
- }
11984
-
11985
12733
  // src/manifest.ts
11986
12734
  var commandGroups = [
12735
+ ...integrationCommandGroups,
11987
12736
  {
11988
12737
  name: "agents",
11989
12738
  aliases: ["agent"],
@@ -12020,7 +12769,7 @@ var commandGroups = [
12020
12769
  body: zConfigAttachment.extend({
12021
12770
  profile: zAgentProfileId.optional(),
12022
12771
  name: zAgentName.optional(),
12023
- message: z26.string().optional()
12772
+ message: z28.string().optional()
12024
12773
  }),
12025
12774
  transformBody: async ({ profile, name, message, ...attachment }, { client: client2, path }) => ({
12026
12775
  profile,
@@ -12061,7 +12810,7 @@ var commandGroups = [
12061
12810
  flowOp({
12062
12811
  verb: "mcp-add",
12063
12812
  summary: "Create an OAuth secret and add an MCP server to an agent",
12064
- path: z26.object({
12813
+ path: z28.object({
12065
12814
  orgID: zOrganizationId,
12066
12815
  projectID: zProjectId,
12067
12816
  agentID: zAgentId
@@ -12077,7 +12826,7 @@ var commandGroups = [
12077
12826
  format: (response) => formatRecord()(response.agent_input),
12078
12827
  path: zCreateAgentInputPath,
12079
12828
  body: zCreateAgentInputBody.partial({ content_blocks: true }).extend({
12080
- message: z26.string().optional().describe("plain text to send as a single text block")
12829
+ message: z28.string().optional().describe("plain text to send as a single text block")
12081
12830
  }).transform(({ message, content_blocks, ...rest }, ctx) => {
12082
12831
  if (content_blocks !== void 0 && message === void 0) {
12083
12832
  return { ...rest, content_blocks };
@@ -12086,7 +12835,7 @@ var commandGroups = [
12086
12835
  return { ...rest, content_blocks: [{ type: "text", text: message }] };
12087
12836
  }
12088
12837
  ctx.addIssue("pass exactly one of --message or --content-blocks");
12089
- return z26.NEVER;
12838
+ return z28.NEVER;
12090
12839
  })
12091
12840
  })
12092
12841
  ],
@@ -12103,8 +12852,8 @@ var commandGroups = [
12103
12852
  format: formatAgentEventList,
12104
12853
  path: zListEventsPath,
12105
12854
  query: zListEventsQuery.extend({
12106
- before_sequence: z26.int().gte(0).optional(),
12107
- after_sequence: z26.int().gte(0).optional()
12855
+ before_sequence: z28.int().gte(0).optional(),
12856
+ after_sequence: z28.int().gte(0).optional()
12108
12857
  })
12109
12858
  }),
12110
12859
  agentEventsStreamOp
@@ -12158,8 +12907,7 @@ var commandGroups = [
12158
12907
  summary: "Show an organization overview",
12159
12908
  fn: sdk_gen_exports.getOrgOverview,
12160
12909
  format: formatRecord(),
12161
- path: zGetOrgOverviewPath,
12162
- query: zGetOrgOverviewQuery
12910
+ path: zGetOrgOverviewPath
12163
12911
  }),
12164
12912
  op({
12165
12913
  verb: "delete",
@@ -12601,7 +13349,7 @@ var commandGroups = [
12601
13349
  flowOp({
12602
13350
  verb: "mcp-oauth",
12603
13351
  summary: "Create a secret through an MCP server OAuth flow",
12604
- path: z26.object({ orgID: zOrganizationId }),
13352
+ path: z28.object({ orgID: zOrganizationId }),
12605
13353
  body: zMcpOAuthBody,
12606
13354
  run: runMcpOAuth
12607
13355
  })
@@ -12808,25 +13556,13 @@ var commandGroups = [
12808
13556
  flowOp({
12809
13557
  verb: "mcp-add",
12810
13558
  summary: "Create an OAuth secret and add an MCP server to an agent profile",
12811
- path: z26.object({
13559
+ path: z28.object({
12812
13560
  orgID: zOrganizationId,
12813
13561
  projectID: zProjectId,
12814
13562
  agentProfileID: zAgentProfileId
12815
13563
  }),
12816
13564
  body: zMcpAddBody,
12817
13565
  run: runProfileMcpAdd
12818
- }),
12819
- flowOp({
12820
- verb: "slack",
12821
- aliases: ["slack-setup"],
12822
- summary: "Connect Slack to an agent profile through OAuth",
12823
- path: z26.object({
12824
- orgID: zOrganizationId,
12825
- projectID: zProjectId,
12826
- agentProfileID: zAgentProfileId
12827
- }),
12828
- body: zSlackBody,
12829
- run: runSlackIntegration
12830
13566
  })
12831
13567
  ]
12832
13568
  },