omnara 1.0.14 → 1.0.15

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 +84 -26
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -8584,6 +8584,7 @@ var createQueryKey = (id, options, infinite, tags) => {
8584
8584
  }
8585
8585
  return [params];
8586
8586
  };
8587
+ var listAgentsQueryKey = (options) => createQueryKey("listAgents", options);
8587
8588
  var getAgentQueryKey = (options) => createQueryKey("getAgent", options);
8588
8589
  var getAgentOptions = (options) => queryOptions({
8589
8590
  queryFn: async ({ queryKey, signal }) => {
@@ -8623,6 +8624,19 @@ var listQueuedBacklogInputsOptions = (options) => queryOptions({
8623
8624
  },
8624
8625
  queryKey: listQueuedBacklogInputsQueryKey(options)
8625
8626
  });
8627
+ var getActorQueryKey = (options) => createQueryKey("getActor", options);
8628
+ var getActorOptions = (options) => queryOptions({
8629
+ queryFn: async ({ queryKey, signal }) => {
8630
+ const { data } = await getActor({
8631
+ ...options,
8632
+ ...queryKey[0],
8633
+ signal,
8634
+ throwOnError: true
8635
+ });
8636
+ return data;
8637
+ },
8638
+ queryKey: getActorQueryKey(options)
8639
+ });
8626
8640
 
8627
8641
  // ../react/src/domains/actors.ts
8628
8642
  import { useSuspenseQuery } from "@tanstack/react-query";
@@ -8665,9 +8679,7 @@ function projectActorsQueryPredicate(orgID, projectID) {
8665
8679
  }
8666
8680
 
8667
8681
  // ../react/src/domains/agent-chat.ts
8668
- import {
8669
- useQueryClient as useQueryClient3
8670
- } from "@tanstack/react-query";
8682
+ import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
8671
8683
  import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
8672
8684
 
8673
8685
  // ../react/src/domains/agent-chat-history.ts
@@ -9122,6 +9134,12 @@ function useAgentChatHistory(client2, scope) {
9122
9134
  staleTime: Infinity
9123
9135
  });
9124
9136
  }
9137
+ function historyHasEvent(queryClient, scope, matches) {
9138
+ const history = queryClient.getQueryData(
9139
+ agentChatHistoryQueryKey(scope)
9140
+ );
9141
+ return history?.pages.some((page) => page.data.some(matches)) ?? false;
9142
+ }
9125
9143
 
9126
9144
  // ../react/src/domains/agent-chat-transport.ts
9127
9145
  var sourceLabels = { web: "web app", cli: "CLI" };
@@ -9351,6 +9369,38 @@ function useResolveAgentInteraction(orgID, projectID, agentID) {
9351
9369
  }
9352
9370
  });
9353
9371
  }
9372
+ function spawnsSubagent(event, hasEvent) {
9373
+ if (event.event_kind !== "tool_result") return false;
9374
+ return hasEvent(
9375
+ (candidate) => candidate.event_kind === "model_output" && candidate.content_blocks.some(
9376
+ (block) => block.type === "tool_call" && block.tool_call_id === event.tool_call_id && block.name === "spawn_agent"
9377
+ )
9378
+ );
9379
+ }
9380
+ function isAgentActor(actor) {
9381
+ return actor.provider === "omnara" && actor.provider_user_id.startsWith("agt_");
9382
+ }
9383
+ async function sentBySubagent(queryClient, client2, scope, event) {
9384
+ if (event.event_kind !== "agent_input" || event.actor_id == null) return false;
9385
+ const actor = await queryClient.ensureQueryData(
9386
+ getActorOptions({
9387
+ path: { orgID: scope.orgID, projectID: scope.projectID, actorID: event.actor_id },
9388
+ client: client2
9389
+ })
9390
+ ).catch(() => null);
9391
+ return actor != null && isAgentActor(actor);
9392
+ }
9393
+ async function invalidateSubagentList(queryClient, client2, scope, event, hasEvent) {
9394
+ if (!spawnsSubagent(event, hasEvent) && !await sentBySubagent(queryClient, client2, scope, event)) {
9395
+ return;
9396
+ }
9397
+ await queryClient.invalidateQueries({
9398
+ queryKey: listAgentsQueryKey({
9399
+ path: { orgID: scope.orgID, projectID: scope.projectID },
9400
+ client: client2
9401
+ })
9402
+ });
9403
+ }
9354
9404
 
9355
9405
  // ../react/src/domains/usage.ts
9356
9406
  import { keepPreviousData, useQuery as useQuery3 } from "@tanstack/react-query";
@@ -9527,12 +9577,12 @@ var AgentChatSession = class {
9527
9577
  if (changed) this.notify();
9528
9578
  };
9529
9579
  inputEchoLoaded(id) {
9530
- const matches = (event) => event.event_kind === "agent_input" && event.input_idempotency_key === id;
9531
- if (this.events.some(matches)) return true;
9532
- const history = this.queryClient.getQueryData(
9533
- agentChatHistoryQueryKey(this.scope)
9580
+ return this.hasLoadedEvent(
9581
+ (event) => event.event_kind === "agent_input" && event.input_idempotency_key === id
9534
9582
  );
9535
- return history?.pages.some((page) => page.data.some(matches)) ?? false;
9583
+ }
9584
+ hasLoadedEvent(matches) {
9585
+ return this.events.some(matches) || historyHasEvent(this.queryClient, this.scope, matches);
9536
9586
  }
9537
9587
  notify() {
9538
9588
  const localInputs = [...this.localInputs.values()];
@@ -9594,6 +9644,13 @@ var AgentChatSession = class {
9594
9644
  if (hasToolCalls(event) || event.event_kind === "tool_result" || isControlEvent(event)) {
9595
9645
  this.invalidateInteractions();
9596
9646
  }
9647
+ void invalidateSubagentList(
9648
+ this.queryClient,
9649
+ this.client,
9650
+ this.scope,
9651
+ event,
9652
+ (matches) => this.hasLoadedEvent(matches)
9653
+ );
9597
9654
  this.notify();
9598
9655
  }
9599
9656
  invalidateInteractions() {
@@ -9761,7 +9818,8 @@ function useAgentChat(scope, options) {
9761
9818
  }
9762
9819
 
9763
9820
  // ../react/src/domains/agent-config-tools.ts
9764
- import { useQuery as useQuery4 } from "@tanstack/react-query";
9821
+ import { useQuery as useQuery4, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
9822
+ import { useId } from "react";
9765
9823
 
9766
9824
  // ../react/src/domains/agent-event-preview.ts
9767
9825
  function truncate2(value, width) {
@@ -9804,7 +9862,7 @@ import {
9804
9862
  useInfiniteQuery as useInfiniteQuery2,
9805
9863
  useMutation as useMutation4,
9806
9864
  useQuery as useQuery5,
9807
- useQueryClient as useQueryClient4,
9865
+ useQueryClient as useQueryClient5,
9808
9866
  useSuspenseQuery as useSuspenseQuery2
9809
9867
  } from "@tanstack/react-query";
9810
9868
 
@@ -9821,27 +9879,27 @@ import {
9821
9879
  useInfiniteQuery as useInfiniteQuery3,
9822
9880
  useMutation as useMutation5,
9823
9881
  useQuery as useQuery6,
9824
- useQueryClient as useQueryClient5,
9882
+ useQueryClient as useQueryClient6,
9825
9883
  useSuspenseQuery as useSuspenseQuery3
9826
9884
  } from "@tanstack/react-query";
9827
9885
 
9828
9886
  // ../react/src/domains/cron-triggers.ts
9829
- import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, useQueryClient as useQueryClient6 } from "@tanstack/react-query";
9887
+ import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
9830
9888
 
9831
9889
  // ../react/src/domains/integration-installs.ts
9832
- import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
9890
+ import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient8 } from "@tanstack/react-query";
9833
9891
 
9834
9892
  // ../react/src/domains/invitations.ts
9835
- import { useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient8, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
9893
+ import { useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient9, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
9836
9894
 
9837
9895
  // ../react/src/domains/machine-pools.ts
9838
- import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
9896
+ import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
9839
9897
 
9840
9898
  // ../react/src/domains/machines.ts
9841
- import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
9899
+ import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
9842
9900
 
9843
9901
  // ../react/src/domains/mcp-registry.ts
9844
- import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery10, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
9902
+ import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery10, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
9845
9903
  var serverInfoStaleTime = 5 * 60 * 1e3;
9846
9904
 
9847
9905
  // ../react/src/domains/mcp-server-tools.ts
@@ -9857,31 +9915,31 @@ import {
9857
9915
  useMutation as useMutation11,
9858
9916
  useQueries,
9859
9917
  useQuery as useQuery12,
9860
- useQueryClient as useQueryClient12
9918
+ useQueryClient as useQueryClient13
9861
9919
  } from "@tanstack/react-query";
9862
9920
  import { useEffect as useEffect2 } from "react";
9863
9921
  var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
9864
9922
 
9865
9923
  // ../react/src/domains/org-api-keys.ts
9866
- import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery13, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
9924
+ import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery13, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
9867
9925
 
9868
9926
  // ../react/src/domains/org-members.ts
9869
- import { useMutation as useMutation13, useQuery as useQuery14, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
9927
+ import { useMutation as useMutation13, useQuery as useQuery14, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
9870
9928
 
9871
9929
  // ../react/src/domains/orgs.ts
9872
- import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery15, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
9930
+ import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery15, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
9873
9931
 
9874
9932
  // ../react/src/domains/personal-access-tokens.ts
9875
- import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
9933
+ import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
9876
9934
 
9877
9935
  // ../react/src/domains/project-grants.ts
9878
- import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation16, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
9936
+ import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
9879
9937
 
9880
9938
  // ../react/src/domains/projects.ts
9881
9939
  import {
9882
9940
  skipToken,
9883
9941
  useInfiniteQuery as useInfiniteQuery14,
9884
- useQueryClient as useQueryClient18,
9942
+ useQueryClient as useQueryClient19,
9885
9943
  useSuspenseInfiniteQuery
9886
9944
  } from "@tanstack/react-query";
9887
9945
 
@@ -9890,7 +9948,7 @@ import {
9890
9948
  useInfiniteQuery as useInfiniteQuery15,
9891
9949
  useMutation as useMutation17,
9892
9950
  useQuery as useQuery16,
9893
- useQueryClient as useQueryClient19
9951
+ useQueryClient as useQueryClient20
9894
9952
  } from "@tanstack/react-query";
9895
9953
 
9896
9954
  // ../react/src/domains/skills.ts
@@ -9898,7 +9956,7 @@ import {
9898
9956
  useInfiniteQuery as useInfiniteQuery16,
9899
9957
  useMutation as useMutation18,
9900
9958
  useQuery as useQuery17,
9901
- useQueryClient as useQueryClient20
9959
+ useQueryClient as useQueryClient21
9902
9960
  } from "@tanstack/react-query";
9903
9961
 
9904
9962
  // ../react/src/domains/tool-catalog.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnara",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
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",