omnara 1.0.12 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.js +237 -46
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -146,11 +146,18 @@ var zModelCacheRetention = z.enum([
146
146
  "short",
147
147
  "long"
148
148
  ]);
149
+ var zDiscoveredModelPricing = z.object({
150
+ input_usd_per_million: z.string().regex(/^(0|[1-9][0-9]*)(\.[0-9]+)?$/),
151
+ cache_read_input_usd_per_million: z.string().regex(/^(0|[1-9][0-9]*)(\.[0-9]+)?$/).optional(),
152
+ cache_write_input_usd_per_million: z.string().regex(/^(0|[1-9][0-9]*)(\.[0-9]+)?$/).optional(),
153
+ output_usd_per_million: z.string().regex(/^(0|[1-9][0-9]*)(\.[0-9]+)?$/)
154
+ });
149
155
  var zDiscoveredProviderModel = z.object({
150
156
  slug: z.string(),
151
157
  display_name: z.string().optional(),
152
158
  context_window_tokens: z.int().gte(2).lte(2147483647).optional(),
153
- max_output_tokens: z.int().gte(1).lte(2147483647).optional()
159
+ max_output_tokens: z.int().gte(1).lte(2147483647).optional(),
160
+ pricing: zDiscoveredModelPricing.optional()
154
161
  });
155
162
  var zModelCatalog = z.object({
156
163
  status: z.enum(["ok", "failed"]),
@@ -345,6 +352,7 @@ var zConfiguredModelSummary = z.object({
345
352
  model_provider_config_id: zModelProviderConfigId,
346
353
  name: zResourceName,
347
354
  provider_config: zResourceName,
355
+ provider_model_slug: z.string(),
348
356
  created_at: zTimestamp,
349
357
  updated_at: zTimestamp
350
358
  });
@@ -767,6 +775,15 @@ var zCreateAgentRequest = z.object({
767
775
  name: zAgentName.optional(),
768
776
  message: z.string().optional()
769
777
  });
778
+ var zAgentActivity = z.object({
779
+ state: z.enum([
780
+ "running",
781
+ "idle",
782
+ "waiting_on_interaction",
783
+ "archived"
784
+ ]),
785
+ last_activity_at: zTimestamp
786
+ });
770
787
  var zAgentModel = z.object({
771
788
  provider_config: zResourceName,
772
789
  name: zResourceName
@@ -788,6 +805,9 @@ var zAgent = z.object({
788
805
  integration_target: zIntegrationTarget.optional(),
789
806
  current_config_id: zAgentConfigId.optional(),
790
807
  model: zAgentModel.optional(),
808
+ parent_agent_id: zAgentId.optional(),
809
+ subagent_key: z.string().optional(),
810
+ activity: zAgentActivity.optional(),
791
811
  created_at: zTimestamp,
792
812
  updated_at: zTimestamp,
793
813
  archived_at: zTimestamp.optional()
@@ -859,7 +879,6 @@ var zAgentMachineBinding = z.object({
859
879
  project_id: zProjectId,
860
880
  agent_id: zAgentId,
861
881
  machine_id: zMachineId,
862
- machine_ref: z.string(),
863
882
  binding_kind: zAgentMachineBindingKind,
864
883
  state: zAgentMachineBindingState,
865
884
  description: z.string(),
@@ -1023,6 +1042,7 @@ var zToolCallOutcome = z.enum([
1023
1042
  ]);
1024
1043
  var zToolCall = z.object({
1025
1044
  id: zToolCallId,
1045
+ agent_id: zAgentId,
1026
1046
  turn_id: zAgentTurnId,
1027
1047
  provider_call_id: z.string(),
1028
1048
  name: z.string(),
@@ -1035,6 +1055,7 @@ var zToolCall = z.object({
1035
1055
  });
1036
1056
  var zToolCallUpdate = z.object({
1037
1057
  tool_call_id: zToolCallId,
1058
+ agent_id: zAgentId.optional(),
1038
1059
  state: zToolCallState
1039
1060
  });
1040
1061
  var zListToolCallsResponse = z.object({
@@ -1303,6 +1324,8 @@ var zAgentInteraction = z.object({
1303
1324
  agent_id: zAgentId,
1304
1325
  tool_call_id: zToolCallId,
1305
1326
  tool_name: z.string().optional(),
1327
+ agent_name: zAgentName.optional(),
1328
+ subagent_key: z.string().optional(),
1306
1329
  interaction_kind: zAgentInteractionKind,
1307
1330
  state: zAgentInteractionState,
1308
1331
  request: zInteractionForm,
@@ -2075,6 +2098,40 @@ var zOrgOverviewResponse = z.object({
2075
2098
  recent_agents: z.array(zAgent),
2076
2099
  recent_agent_profiles: z.array(zAgentProfile)
2077
2100
  });
2101
+ var zUsageTokenTotals = z.object({
2102
+ input_tokens_total: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2103
+ uncached_input_tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2104
+ cache_read_input_tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2105
+ cache_write_input_tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2106
+ output_tokens_total: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2107
+ reasoning_output_tokens: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2108
+ });
2109
+ var zUsageCostTotals = z.object({
2110
+ provider_reported_usd: z.string().regex(/^(0|[1-9][0-9]*)(\.[0-9]+)?$/),
2111
+ model_calls_with_reported_cost: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" })
2112
+ });
2113
+ var zUsageTotals = z.object({
2114
+ model_calls: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2115
+ tokens: zUsageTokenTotals,
2116
+ cost: zUsageCostTotals
2117
+ });
2118
+ var zUsageModel = z.object({
2119
+ configured_model_id: zConfiguredModelId,
2120
+ name: zResourceName,
2121
+ provider_model_slug: z.string(),
2122
+ model_provider_config_id: zModelProviderConfigId,
2123
+ model_provider_config_name: zResourceName
2124
+ });
2125
+ var zModelUsageTotals = z.object({
2126
+ model: zUsageModel,
2127
+ model_calls: z.coerce.bigint().gte(BigInt(0)).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
2128
+ tokens: zUsageTokenTotals,
2129
+ cost: zUsageCostTotals
2130
+ });
2131
+ var zUsageReport = z.object({
2132
+ totals: zUsageTotals,
2133
+ by_model: z.array(zModelUsageTotals)
2134
+ });
2078
2135
  var zCurrentUserIdentity = z.object({
2079
2136
  id: zUserId,
2080
2137
  email: z.string(),
@@ -2123,6 +2180,10 @@ var zProjectMembershipGrant = z.object({
2123
2180
  var zListProjectMembershipGrantsResponse = z.object({
2124
2181
  data: z.array(zProjectMembershipGrant)
2125
2182
  });
2183
+ var zUsageSince = z.iso.datetime({ offset: true });
2184
+ var zUsageUntil = z.iso.datetime({ offset: true });
2185
+ var zUsageIncludeProjectIds = z.array(zProjectId).min(1).max(100);
2186
+ var zUsageExcludeProjectIds = z.array(zProjectId).min(1).max(100);
2126
2187
  var zIdempotencyKey = z.string().min(1).max(255);
2127
2188
  var zPageLimit = z.int().gte(1).lte(100).default(50);
2128
2189
  var zPageCursor = z.string().max(1024);
@@ -2196,6 +2257,16 @@ var zGetOrgOverviewPath = z.object({
2196
2257
  orgID: zOrganizationId
2197
2258
  });
2198
2259
  var zGetOrgOverviewResponse = zOrgOverviewResponse;
2260
+ var zGetOrgUsagePath = z.object({
2261
+ orgID: zOrganizationId
2262
+ });
2263
+ var zGetOrgUsageQuery = z.object({
2264
+ since: z.iso.datetime({ offset: true }).optional(),
2265
+ until: z.iso.datetime({ offset: true }).optional(),
2266
+ include_project_ids: z.array(zProjectId).min(1).max(100).optional(),
2267
+ exclude_project_ids: z.array(zProjectId).min(1).max(100).optional()
2268
+ });
2269
+ var zGetOrgUsageResponse = zUsageReport;
2199
2270
  var zListVisibleProjectsPath = z.object({
2200
2271
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/)
2201
2272
  });
@@ -2217,6 +2288,15 @@ var zDeleteProjectPath = z.object({
2217
2288
  projectID: z.string().regex(/^proj_[a-z2-7]{26}$/)
2218
2289
  });
2219
2290
  var zDeleteProjectResponse = z.void();
2291
+ var zGetProjectUsagePath = z.object({
2292
+ orgID: zOrganizationId,
2293
+ projectID: zProjectId
2294
+ });
2295
+ var zGetProjectUsageQuery = z.object({
2296
+ since: z.iso.datetime({ offset: true }).optional(),
2297
+ until: z.iso.datetime({ offset: true }).optional()
2298
+ });
2299
+ var zGetProjectUsageResponse = zUsageReport;
2220
2300
  var zListOrgMembersPath = z.object({
2221
2301
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/)
2222
2302
  });
@@ -2545,6 +2625,17 @@ var zRenameAgentProfilePath = z.object({
2545
2625
  agentProfileID: z.string().regex(/^aprf_[a-z2-7]{26}$/)
2546
2626
  });
2547
2627
  var zRenameAgentProfileResponse = zAgentProfile;
2628
+ var zGetAgentProfileUsagePath = z.object({
2629
+ orgID: zOrganizationId,
2630
+ projectID: zProjectId,
2631
+ agentProfileID: zAgentProfileId
2632
+ });
2633
+ var zGetAgentProfileUsageQuery = z.object({
2634
+ since: z.iso.datetime({ offset: true }).optional(),
2635
+ until: z.iso.datetime({ offset: true }).optional(),
2636
+ include_subagents: z.boolean().optional()
2637
+ });
2638
+ var zGetAgentProfileUsageResponse = zUsageReport;
2548
2639
  var zUpdateAgentProfileHeaders = z.object({
2549
2640
  "Idempotency-Key": z.string().min(1).max(255).optional()
2550
2641
  });
@@ -2614,6 +2705,9 @@ var zListAgentsPath = z.object({
2614
2705
  var zListAgentsQuery = z.object({
2615
2706
  name: z.string().min(1).max(200).optional(),
2616
2707
  agent_profile_id: zAgentProfileId.optional(),
2708
+ parent_agent_id: zAgentId.optional(),
2709
+ include_subagents: z.boolean().optional(),
2710
+ include_archived: z.boolean().optional(),
2617
2711
  sort: zResourceListSort.optional(),
2618
2712
  limit: z.int().gte(1).lte(100).optional().default(50),
2619
2713
  cursor: z.string().max(1024).optional()
@@ -2636,6 +2730,17 @@ var zGetAgentPath = z.object({
2636
2730
  agentID: z.string().regex(/^agt_[a-z2-7]{26}$/)
2637
2731
  });
2638
2732
  var zGetAgentResponse2 = zGetAgentResponse;
2733
+ var zGetAgentUsagePath = z.object({
2734
+ orgID: zOrganizationId,
2735
+ projectID: zProjectId,
2736
+ agentID: zAgentId
2737
+ });
2738
+ var zGetAgentUsageQuery = z.object({
2739
+ since: z.iso.datetime({ offset: true }).optional(),
2740
+ until: z.iso.datetime({ offset: true }).optional(),
2741
+ include_subagents: z.boolean().optional()
2742
+ });
2743
+ var zGetAgentUsageResponse = zUsageReport;
2639
2744
  var zArchiveAgentPath = z.object({
2640
2745
  orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
2641
2746
  projectID: z.string().regex(/^proj_[a-z2-7]{26}$/),
@@ -2669,6 +2774,7 @@ var zListToolCallsPath = z.object({
2669
2774
  var zListToolCallsQuery = z.object({
2670
2775
  state: zToolCallState.optional(),
2671
2776
  type: zToolCallType.optional(),
2777
+ include_subagents: z.boolean().optional(),
2672
2778
  limit: z.int().gte(1).lte(100).optional().default(50),
2673
2779
  cursor: z.string().max(1024).optional()
2674
2780
  });
@@ -2739,6 +2845,7 @@ var zListAgentInteractionsPath = z.object({
2739
2845
  });
2740
2846
  var zListAgentInteractionsQuery = z.object({
2741
2847
  state: zAgentInteractionState.optional(),
2848
+ include_subagents: z.boolean().optional(),
2742
2849
  limit: z.int().gte(1).lte(100).optional().default(50),
2743
2850
  cursor: z.string().max(1024).optional()
2744
2851
  });
@@ -4588,6 +4695,8 @@ __export(sdk_gen_exports, {
4588
4695
  getAgent: () => getAgent,
4589
4696
  getAgentConfig: () => getAgentConfig,
4590
4697
  getAgentProfile: () => getAgentProfile,
4698
+ getAgentProfileUsage: () => getAgentProfileUsage,
4699
+ getAgentUsage: () => getAgentUsage,
4591
4700
  getArtifact: () => getArtifact,
4592
4701
  getArtifactContent: () => getArtifactContent,
4593
4702
  getCronTrigger: () => getCronTrigger,
@@ -4599,8 +4708,10 @@ __export(sdk_gen_exports, {
4599
4708
  getModelProviderConfig: () => getModelProviderConfig,
4600
4709
  getOrgApiKey: () => getOrgApiKey,
4601
4710
  getOrgOverview: () => getOrgOverview,
4711
+ getOrgUsage: () => getOrgUsage,
4602
4712
  getProjectAvailableSecret: () => getProjectAvailableSecret,
4603
4713
  getProjectMachinePoolGrant: () => getProjectMachinePoolGrant,
4714
+ getProjectUsage: () => getProjectUsage,
4604
4715
  getSecret: () => getSecret,
4605
4716
  getSkill: () => getSkill,
4606
4717
  getToolCatalog: () => getToolCatalog,
@@ -4897,6 +5008,20 @@ var getOrgOverview = (options) => (options.client ?? client).get({
4897
5008
  url: "/orgs/{orgID}/overview",
4898
5009
  ...options
4899
5010
  });
5011
+ var getOrgUsage = (options) => (options.client ?? client).get({
5012
+ responseValidator: relaxedResponseValidator(zGetOrgUsageResponse),
5013
+ security: [{
5014
+ key: "bearerAuth",
5015
+ scheme: "bearer",
5016
+ type: "http"
5017
+ }, {
5018
+ in: "cookie",
5019
+ name: "__Host-omnara_session",
5020
+ type: "apiKey"
5021
+ }],
5022
+ url: "/orgs/{orgID}/usage",
5023
+ ...options
5024
+ });
4900
5025
  var listVisibleProjects = (options) => (options.client ?? client).get({
4901
5026
  responseValidator: relaxedResponseValidator(zListVisibleProjectsResponse),
4902
5027
  security: [{
@@ -4951,6 +5076,20 @@ var deleteProject = (options) => (options.client ?? client).delete({
4951
5076
  url: "/orgs/{orgID}/projects/{projectID}",
4952
5077
  ...options
4953
5078
  });
5079
+ var getProjectUsage = (options) => (options.client ?? client).get({
5080
+ responseValidator: relaxedResponseValidator(zGetProjectUsageResponse),
5081
+ security: [{
5082
+ key: "bearerAuth",
5083
+ scheme: "bearer",
5084
+ type: "http"
5085
+ }, {
5086
+ in: "cookie",
5087
+ name: "__Host-omnara_session",
5088
+ type: "apiKey"
5089
+ }],
5090
+ url: "/orgs/{orgID}/projects/{projectID}/usage",
5091
+ ...options
5092
+ });
4954
5093
  var listOrgMembers = (options) => (options.client ?? client).get({
4955
5094
  responseValidator: relaxedResponseValidator(zListOrgMembersResponse2),
4956
5095
  security: [{
@@ -5773,6 +5912,20 @@ var renameAgentProfile = (options) => (options.client ?? client).patch({
5773
5912
  ...options.headers
5774
5913
  }
5775
5914
  });
5915
+ var getAgentProfileUsage = (options) => (options.client ?? client).get({
5916
+ responseValidator: relaxedResponseValidator(zGetAgentProfileUsageResponse),
5917
+ security: [{
5918
+ key: "bearerAuth",
5919
+ scheme: "bearer",
5920
+ type: "http"
5921
+ }, {
5922
+ in: "cookie",
5923
+ name: "__Host-omnara_session",
5924
+ type: "apiKey"
5925
+ }],
5926
+ url: "/orgs/{orgID}/projects/{projectID}/agent-profiles/{agentProfileID}/usage",
5927
+ ...options
5928
+ });
5776
5929
  var updateAgentProfile = (options) => (options.client ?? client).post({
5777
5930
  responseValidator: relaxedResponseValidator(zUpdateAgentProfileResponse),
5778
5931
  security: [
@@ -5979,6 +6132,20 @@ var getAgent = (options) => (options.client ?? client).get({
5979
6132
  url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}",
5980
6133
  ...options
5981
6134
  });
6135
+ var getAgentUsage = (options) => (options.client ?? client).get({
6136
+ responseValidator: relaxedResponseValidator(zGetAgentUsageResponse),
6137
+ security: [{
6138
+ key: "bearerAuth",
6139
+ scheme: "bearer",
6140
+ type: "http"
6141
+ }, {
6142
+ in: "cookie",
6143
+ name: "__Host-omnara_session",
6144
+ type: "apiKey"
6145
+ }],
6146
+ url: "/orgs/{orgID}/projects/{projectID}/agents/{agentID}/usage",
6147
+ ...options
6148
+ });
5982
6149
  var archiveAgent = (options) => (options.client ?? client).post({
5983
6150
  responseValidator: relaxedResponseValidator(zArchiveAgentResponse),
5984
6151
  security: [
@@ -9098,21 +9265,19 @@ function useAgentInputBacklog(path) {
9098
9265
 
9099
9266
  // ../react/src/domains/agent-interactions.ts
9100
9267
  import { useMutation as useMutation2, useQuery as useQuery2, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
9101
- var openInteractionsQuery = { state: "open", limit: 100 };
9102
- var activeAgentRefetchIntervalMs = 1e3;
9268
+ var openInteractionsQuery = { state: "open", limit: 100, include_subagents: true };
9103
9269
  function openAgentInteractionsQueryKey(client2, path) {
9104
9270
  return listAgentInteractionsQueryKey({ path, query: openInteractionsQuery, client: client2 });
9105
9271
  }
9106
- function useAgentInteractions(orgID, projectID, agentID, agentActive) {
9272
+ function useAgentInteractions(orgID, projectID, agentID) {
9107
9273
  const client2 = useOmnaraClient();
9108
- return useQuery2({
9109
- ...listAgentInteractionsOptions({
9274
+ return useQuery2(
9275
+ listAgentInteractionsOptions({
9110
9276
  path: { orgID, projectID, agentID },
9111
9277
  query: openInteractionsQuery,
9112
9278
  client: client2
9113
- }),
9114
- refetchInterval: agentActive ? activeAgentRefetchIntervalMs : false
9115
- });
9279
+ })
9280
+ );
9116
9281
  }
9117
9282
  function useResolveAgentInteraction(orgID, projectID, agentID) {
9118
9283
  const client2 = useOmnaraClient();
@@ -9121,11 +9286,12 @@ function useResolveAgentInteraction(orgID, projectID, agentID) {
9121
9286
  return useMutation2({
9122
9287
  mutationFn: async ({
9123
9288
  interactionID,
9124
- body
9289
+ body,
9290
+ targetAgentID = agentID
9125
9291
  }) => {
9126
9292
  const { data } = await sdk_gen_exports.resolveAgentInteraction({
9127
9293
  client: client2,
9128
- path: { orgID, projectID, agentID, interactionID },
9294
+ path: { orgID, projectID, agentID: targetAgentID, interactionID },
9129
9295
  body
9130
9296
  });
9131
9297
  return data;
@@ -9148,6 +9314,15 @@ function useResolveAgentInteraction(orgID, projectID, agentID) {
9148
9314
  });
9149
9315
  }
9150
9316
 
9317
+ // ../react/src/domains/usage.ts
9318
+ import { keepPreviousData, useQuery as useQuery3 } from "@tanstack/react-query";
9319
+ function agentUsageQueryPredicate(orgID, projectID) {
9320
+ return (query) => {
9321
+ const key = generatedQueryKey(query);
9322
+ return key?._id === "getAgentUsage" && key.path?.orgID === orgID && key.path.projectID === projectID;
9323
+ };
9324
+ }
9325
+
9151
9326
  // ../react/src/domains/agent-chat.ts
9152
9327
  var emptyBacklogInputs = [];
9153
9328
  var AgentChatSession = class {
@@ -9375,14 +9550,20 @@ var AgentChatSession = class {
9375
9550
  }
9376
9551
  if (isTerminalEvent(event)) {
9377
9552
  this.deltas = this.deltas.filter((delta) => delta.turn_id !== event.turn_id);
9378
- }
9379
- if (hasToolCalls(event) || event.event_kind === "tool_result" || isControlEvent(event)) {
9380
9553
  void this.queryClient.invalidateQueries({
9381
- queryKey: openAgentInteractionsQueryKey(this.client, this.scope)
9554
+ predicate: agentUsageQueryPredicate(this.scope.orgID, this.scope.projectID)
9382
9555
  });
9383
9556
  }
9557
+ if (hasToolCalls(event) || event.event_kind === "tool_result" || isControlEvent(event)) {
9558
+ this.invalidateInteractions();
9559
+ }
9384
9560
  this.notify();
9385
9561
  }
9562
+ invalidateInteractions() {
9563
+ void this.queryClient.invalidateQueries({
9564
+ queryKey: openAgentInteractionsQueryKey(this.client, this.scope)
9565
+ });
9566
+ }
9386
9567
  handleDelta(delta) {
9387
9568
  if (this.completedCalls.has(delta.model_call_context_id)) return;
9388
9569
  if (this.errorSource === "stream") {
@@ -9411,11 +9592,7 @@ var AgentChatSession = class {
9411
9592
  this.notify();
9412
9593
  return;
9413
9594
  }
9414
- if (state.reconnected) {
9415
- void this.queryClient.invalidateQueries({
9416
- queryKey: openAgentInteractionsQueryKey(this.client, this.scope)
9417
- });
9418
- }
9595
+ if (state.reconnected) this.invalidateInteractions();
9419
9596
  }
9420
9597
  disconnect = () => {
9421
9598
  this.runController?.abort();
@@ -9443,6 +9620,7 @@ var AgentChatSession = class {
9443
9620
  const parsed = parseStreamData(data);
9444
9621
  if (parsed.kind === "delta") this.handleDelta(parsed.delta);
9445
9622
  else if (parsed.kind === "event") this.handleEvent(parsed.event);
9623
+ else this.invalidateInteractions();
9446
9624
  }
9447
9625
  } catch (error) {
9448
9626
  if (signal.aborted) return;
@@ -9535,7 +9713,7 @@ function useAgentChat(scope, options) {
9535
9713
  import {
9536
9714
  useInfiniteQuery as useInfiniteQuery2,
9537
9715
  useMutation as useMutation4,
9538
- useQuery as useQuery3,
9716
+ useQuery as useQuery4,
9539
9717
  useQueryClient as useQueryClient4,
9540
9718
  useSuspenseQuery as useSuspenseQuery2
9541
9719
  } from "@tanstack/react-query";
@@ -9549,9 +9727,10 @@ import { useMutation as useMutation3 } from "@tanstack/react-query";
9549
9727
 
9550
9728
  // ../react/src/domains/agents.ts
9551
9729
  import {
9730
+ keepPreviousData as keepPreviousData2,
9552
9731
  useInfiniteQuery as useInfiniteQuery3,
9553
9732
  useMutation as useMutation5,
9554
- useQuery as useQuery4,
9733
+ useQuery as useQuery5,
9555
9734
  useQueryClient as useQueryClient5,
9556
9735
  useSuspenseQuery as useSuspenseQuery3
9557
9736
  } from "@tanstack/react-query";
@@ -9563,20 +9742,20 @@ import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, use
9563
9742
  import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
9564
9743
 
9565
9744
  // ../react/src/domains/invitations.ts
9566
- import { useMutation as useMutation8, useQuery as useQuery5, useQueryClient as useQueryClient8, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
9745
+ import { useMutation as useMutation8, useQuery as useQuery6, useQueryClient as useQueryClient8, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
9567
9746
 
9568
9747
  // ../react/src/domains/machine-pools.ts
9569
- import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery6, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
9748
+ import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery7, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
9570
9749
 
9571
9750
  // ../react/src/domains/machines.ts
9572
- import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery7, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
9751
+ import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery8, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
9573
9752
 
9574
9753
  // ../react/src/domains/mcp-registry.ts
9575
- import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery8, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
9754
+ import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery9, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
9576
9755
  var serverInfoStaleTime = 5 * 60 * 1e3;
9577
9756
 
9578
9757
  // ../react/src/domains/mcp-server-tools.ts
9579
- import { useQuery as useQuery9 } from "@tanstack/react-query";
9758
+ import { useQuery as useQuery10 } from "@tanstack/react-query";
9580
9759
  var mcpServerToolsStaleTime = 60 * 1e3;
9581
9760
 
9582
9761
  // ../react/src/domains/me.ts
@@ -9586,18 +9765,21 @@ import { useSuspenseQuery as useSuspenseQuery5 } from "@tanstack/react-query";
9586
9765
  import {
9587
9766
  useInfiniteQuery as useInfiniteQuery9,
9588
9767
  useMutation as useMutation11,
9589
- useQuery as useQuery10,
9768
+ useQueries,
9769
+ useQuery as useQuery11,
9590
9770
  useQueryClient as useQueryClient12
9591
9771
  } from "@tanstack/react-query";
9772
+ import { useEffect as useEffect2 } from "react";
9773
+ var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
9592
9774
 
9593
9775
  // ../react/src/domains/org-api-keys.ts
9594
- import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery11, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
9776
+ import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery12, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
9595
9777
 
9596
9778
  // ../react/src/domains/org-members.ts
9597
- import { useMutation as useMutation13, useQuery as useQuery12, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
9779
+ import { useMutation as useMutation13, useQuery as useQuery13, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
9598
9780
 
9599
9781
  // ../react/src/domains/orgs.ts
9600
- import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery13, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
9782
+ import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery14, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
9601
9783
 
9602
9784
  // ../react/src/domains/personal-access-tokens.ts
9603
9785
  import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
@@ -9617,7 +9799,7 @@ import {
9617
9799
  import {
9618
9800
  useInfiniteQuery as useInfiniteQuery15,
9619
9801
  useMutation as useMutation17,
9620
- useQuery as useQuery14,
9802
+ useQuery as useQuery15,
9621
9803
  useQueryClient as useQueryClient19
9622
9804
  } from "@tanstack/react-query";
9623
9805
 
@@ -9625,12 +9807,12 @@ import {
9625
9807
  import {
9626
9808
  useInfiniteQuery as useInfiniteQuery16,
9627
9809
  useMutation as useMutation18,
9628
- useQuery as useQuery15,
9810
+ useQuery as useQuery16,
9629
9811
  useQueryClient as useQueryClient20
9630
9812
  } from "@tanstack/react-query";
9631
9813
 
9632
9814
  // ../react/src/domains/tool-catalog.ts
9633
- import { useQuery as useQuery16 } from "@tanstack/react-query";
9815
+ import { useQuery as useQuery17 } from "@tanstack/react-query";
9634
9816
 
9635
9817
  // src/chat.tsx
9636
9818
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
@@ -9638,7 +9820,7 @@ import { render } from "ink";
9638
9820
 
9639
9821
  // src/chat-ui.tsx
9640
9822
  import { Box as Box2, Static, Text as Text2, useApp } from "ink";
9641
- import { useEffect as useEffect2, useMemo as useMemo2, useReducer, useState as useState2 } from "react";
9823
+ import { useEffect as useEffect3, useMemo as useMemo2, useReducer, useState as useState2 } from "react";
9642
9824
  import * as z15 from "zod";
9643
9825
 
9644
9826
  // src/agent-rendering.ts
@@ -9808,6 +9990,12 @@ function InteractionPrompt({
9808
9990
  " ",
9809
9991
  form.title
9810
9992
  ] }),
9993
+ interaction.agent_name != null && /* @__PURE__ */ jsxs(Text, { children: [
9994
+ " ",
9995
+ /* @__PURE__ */ jsx2(Text, { dimColor: true, children: "from subagent" }),
9996
+ " ",
9997
+ interaction.agent_name
9998
+ ] }),
9811
9999
  (form.context ?? []).map((item) => /* @__PURE__ */ jsxs(Text, { children: [
9812
10000
  " ",
9813
10001
  /* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
@@ -10015,7 +10203,7 @@ function transitionWorkTimer(snapshot, phase) {
10015
10203
  }
10016
10204
  function useWorkTimer(phase) {
10017
10205
  const [snapshot, transition] = useReducer(transitionWorkTimer, { accumulatedMs: 0 });
10018
- useEffect2(() => {
10206
+ useEffect3(() => {
10019
10207
  transition(phase);
10020
10208
  }, [phase]);
10021
10209
  return snapshot;
@@ -10029,7 +10217,7 @@ function StatusLine({
10029
10217
  now: void 0
10030
10218
  });
10031
10219
  const active = activity != null;
10032
- useEffect2(() => {
10220
+ useEffect3(() => {
10033
10221
  if (!active) return;
10034
10222
  const interval = setInterval(() => {
10035
10223
  setTick((previous) => ({
@@ -10140,12 +10328,7 @@ function Transcript({ items, live }) {
10140
10328
  }
10141
10329
  function Chat({ scope }) {
10142
10330
  const chat = useAgentChat(scope, { source: "cli" });
10143
- const interactions = useAgentInteractions(
10144
- scope.orgID,
10145
- scope.projectID,
10146
- scope.agentID,
10147
- chat.isWorking
10148
- );
10331
+ const interactions = useAgentInteractions(scope.orgID, scope.projectID, scope.agentID);
10149
10332
  const resolveInteraction = useResolveAgentInteraction(scope.orgID, scope.projectID, scope.agentID);
10150
10333
  const { exit } = useApp();
10151
10334
  const [draft, setDraft] = useState2("");
@@ -10186,7 +10369,11 @@ function Chat({ scope }) {
10186
10369
  {
10187
10370
  interaction,
10188
10371
  onAnswer: (answers) => {
10189
- void resolveInteraction.mutateAsync({ interactionID: interaction.id, body: { answers } }).catch(() => void 0);
10372
+ void resolveInteraction.mutateAsync({
10373
+ interactionID: interaction.id,
10374
+ body: { answers },
10375
+ targetAgentID: interaction.agent_id
10376
+ }).catch(() => void 0);
10190
10377
  }
10191
10378
  },
10192
10379
  interaction.id
@@ -11089,8 +11276,12 @@ var commandGroups = [
11089
11276
  verb: "list",
11090
11277
  summary: "List agents in a project",
11091
11278
  fn: sdk_gen_exports.listAgents,
11092
- format: (response) => formatTable(["id", "name", "state", "model", "created_at"])({
11093
- data: response.data.map((agent) => ({ ...agent, model: agent.model?.name })),
11279
+ format: (response) => formatTable(["id", "name", "state", "model", "parent_agent_id", "created_at"])({
11280
+ data: response.data.map((agent) => ({
11281
+ ...agent,
11282
+ model: agent.model?.name,
11283
+ parent_agent_id: agent.parent_agent_id ?? ""
11284
+ })),
11094
11285
  next_cursor: response.next_cursor
11095
11286
  }),
11096
11287
  path: zListAgentsPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnara",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Command-line interface for Omnara: launch and manage agents, organizations, integrations, and MCP servers",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://omnara.com",