omnara 1.0.13 → 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.
- package/dist/bin.js +199 -78
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -67,10 +67,6 @@ var zError = z.object({
|
|
|
67
67
|
"authentication_unavailable"
|
|
68
68
|
])
|
|
69
69
|
});
|
|
70
|
-
var zWarning = z.object({
|
|
71
|
-
message: z.string(),
|
|
72
|
-
code: z.enum(["missing_recommended_machine_tools"])
|
|
73
|
-
});
|
|
74
70
|
var zClientErrorCode = z.enum([
|
|
75
71
|
"invalid_request",
|
|
76
72
|
"validation_failed",
|
|
@@ -523,6 +519,10 @@ var zSlackSetup = z.object({
|
|
|
523
519
|
actions_url: z.url(),
|
|
524
520
|
expires_at: zTimestamp
|
|
525
521
|
});
|
|
522
|
+
var zResolveAgentConfigToolsRequest = z.object({
|
|
523
|
+
source: z.string().min(1),
|
|
524
|
+
source_format: z.enum(["yaml", "json"])
|
|
525
|
+
});
|
|
526
526
|
var zCreateAgentConfigRequest = z.object({
|
|
527
527
|
source: z.string().min(1),
|
|
528
528
|
source_format: z.enum(["yaml", "json"])
|
|
@@ -536,6 +536,14 @@ var zToolPermissionSelection = z.object({
|
|
|
536
536
|
mode: z.string(),
|
|
537
537
|
parameters: z.record(z.string(), z.unknown())
|
|
538
538
|
});
|
|
539
|
+
var zResolvedAgentConfigTool = z.object({
|
|
540
|
+
name: z.string(),
|
|
541
|
+
enabled: z.boolean(),
|
|
542
|
+
permission: zToolPermissionSelection
|
|
543
|
+
});
|
|
544
|
+
var zResolvedAgentConfigTools = z.object({
|
|
545
|
+
tools: z.array(zResolvedAgentConfigTool)
|
|
546
|
+
});
|
|
539
547
|
var zToolPermissionMode = z.object({
|
|
540
548
|
name: z.string(),
|
|
541
549
|
label: z.string(),
|
|
@@ -549,6 +557,7 @@ var zToolPermissionProfile = z.object({
|
|
|
549
557
|
var zToolCatalogEntry = z.object({
|
|
550
558
|
name: z.string(),
|
|
551
559
|
description: z.string(),
|
|
560
|
+
implicit: z.boolean().optional(),
|
|
552
561
|
default_permission: zToolPermissionSelection,
|
|
553
562
|
permission_modes: z.array(zToolPermissionMode)
|
|
554
563
|
});
|
|
@@ -682,7 +691,6 @@ var zAgentConfig = z.object({
|
|
|
682
691
|
effective_definition_hash: z.string(),
|
|
683
692
|
model: zAgentConfigModel,
|
|
684
693
|
instruction_hash: z.string().optional(),
|
|
685
|
-
warnings: z.array(zWarning).min(1).optional(),
|
|
686
694
|
created_at: zTimestamp
|
|
687
695
|
});
|
|
688
696
|
var zCreateAgentProfileRequest = z.object({
|
|
@@ -893,6 +901,7 @@ var zMachineFailureReport = z.object({
|
|
|
893
901
|
"startup_script",
|
|
894
902
|
"daemon_install",
|
|
895
903
|
"daemon_update",
|
|
904
|
+
"daemon_runtime",
|
|
896
905
|
"daemon_uninstall",
|
|
897
906
|
"daemon_uninstalled"
|
|
898
907
|
]),
|
|
@@ -2219,6 +2228,7 @@ var zRecordMachineFailureQuery = z.object({
|
|
|
2219
2228
|
"startup_script",
|
|
2220
2229
|
"daemon_install",
|
|
2221
2230
|
"daemon_update",
|
|
2231
|
+
"daemon_runtime",
|
|
2222
2232
|
"daemon_uninstall",
|
|
2223
2233
|
"daemon_uninstalled"
|
|
2224
2234
|
]),
|
|
@@ -2563,6 +2573,11 @@ var zDeleteIntegrationInstallPath = z.object({
|
|
|
2563
2573
|
integrationInstallID: z.string().regex(/^iin_[a-z2-7]{26}$/)
|
|
2564
2574
|
});
|
|
2565
2575
|
var zDeleteIntegrationInstallResponse = z.void();
|
|
2576
|
+
var zResolveAgentConfigToolsPath = z.object({
|
|
2577
|
+
orgID: zOrganizationId,
|
|
2578
|
+
projectID: zProjectId
|
|
2579
|
+
});
|
|
2580
|
+
var zResolveAgentConfigToolsResponse = zResolvedAgentConfigTools;
|
|
2566
2581
|
var zCreateAgentConfigPath = z.object({
|
|
2567
2582
|
orgID: z.string().regex(/^org_[a-z2-7]{26}$/),
|
|
2568
2583
|
projectID: z.string().regex(/^proj_[a-z2-7]{26}$/)
|
|
@@ -4761,6 +4776,7 @@ __export(sdk_gen_exports, {
|
|
|
4761
4776
|
removeOrgApiKeyProjectRole: () => removeOrgApiKeyProjectRole,
|
|
4762
4777
|
removeOrgMember: () => removeOrgMember,
|
|
4763
4778
|
renameAgentProfile: () => renameAgentProfile,
|
|
4779
|
+
resolveAgentConfigTools: () => resolveAgentConfigTools,
|
|
4764
4780
|
resolveAgentInteraction: () => resolveAgentInteraction,
|
|
4765
4781
|
revokeMachineDaemonToken: () => revokeMachineDaemonToken,
|
|
4766
4782
|
revokeOrgApiKey: () => revokeOrgApiKey,
|
|
@@ -5736,6 +5752,28 @@ var deleteIntegrationInstall = (options) => (options.client ?? client).delete({
|
|
|
5736
5752
|
url: "/orgs/{orgID}/projects/{projectID}/integration-installs/{integrationInstallID}",
|
|
5737
5753
|
...options
|
|
5738
5754
|
});
|
|
5755
|
+
var resolveAgentConfigTools = (options) => (options.client ?? client).post({
|
|
5756
|
+
responseValidator: relaxedResponseValidator(zResolveAgentConfigToolsResponse),
|
|
5757
|
+
security: [
|
|
5758
|
+
{
|
|
5759
|
+
key: "bearerAuth",
|
|
5760
|
+
scheme: "bearer",
|
|
5761
|
+
type: "http"
|
|
5762
|
+
},
|
|
5763
|
+
{
|
|
5764
|
+
in: "cookie",
|
|
5765
|
+
name: "__Host-omnara_session",
|
|
5766
|
+
type: "apiKey"
|
|
5767
|
+
},
|
|
5768
|
+
{ name: "X-Omnara-Csrf", type: "apiKey" }
|
|
5769
|
+
],
|
|
5770
|
+
url: "/orgs/{orgID}/projects/{projectID}/agent-configs/tools",
|
|
5771
|
+
...options,
|
|
5772
|
+
headers: {
|
|
5773
|
+
"Content-Type": "application/json",
|
|
5774
|
+
...options.headers
|
|
5775
|
+
}
|
|
5776
|
+
});
|
|
5739
5777
|
var createAgentConfig = (options) => (options.client ?? client).post({
|
|
5740
5778
|
responseValidator: relaxedResponseValidator(zCreateAgentConfigResponse),
|
|
5741
5779
|
security: [
|
|
@@ -7399,9 +7437,6 @@ function truncate(value, width) {
|
|
|
7399
7437
|
if (end > 0 && lastUnit >= 55296 && lastUnit <= 56319) end -= 1;
|
|
7400
7438
|
return `${value.slice(0, end)}\u2026`;
|
|
7401
7439
|
}
|
|
7402
|
-
function abbreviate(text, max) {
|
|
7403
|
-
return truncate(text.replaceAll(/\s+/g, " ").trim(), max);
|
|
7404
|
-
}
|
|
7405
7440
|
function printTable(rows, indent, explicitColumns) {
|
|
7406
7441
|
if (rows.length === 0) {
|
|
7407
7442
|
console.log(indented(indent, dim("(no results)")));
|
|
@@ -8549,6 +8584,7 @@ var createQueryKey = (id, options, infinite, tags) => {
|
|
|
8549
8584
|
}
|
|
8550
8585
|
return [params];
|
|
8551
8586
|
};
|
|
8587
|
+
var listAgentsQueryKey = (options) => createQueryKey("listAgents", options);
|
|
8552
8588
|
var getAgentQueryKey = (options) => createQueryKey("getAgent", options);
|
|
8553
8589
|
var getAgentOptions = (options) => queryOptions({
|
|
8554
8590
|
queryFn: async ({ queryKey, signal }) => {
|
|
@@ -8588,6 +8624,19 @@ var listQueuedBacklogInputsOptions = (options) => queryOptions({
|
|
|
8588
8624
|
},
|
|
8589
8625
|
queryKey: listQueuedBacklogInputsQueryKey(options)
|
|
8590
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
|
+
});
|
|
8591
8640
|
|
|
8592
8641
|
// ../react/src/domains/actors.ts
|
|
8593
8642
|
import { useSuspenseQuery } from "@tanstack/react-query";
|
|
@@ -8630,9 +8679,7 @@ function projectActorsQueryPredicate(orgID, projectID) {
|
|
|
8630
8679
|
}
|
|
8631
8680
|
|
|
8632
8681
|
// ../react/src/domains/agent-chat.ts
|
|
8633
|
-
import {
|
|
8634
|
-
useQueryClient as useQueryClient3
|
|
8635
|
-
} from "@tanstack/react-query";
|
|
8682
|
+
import { useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
8636
8683
|
import { useCallback, useEffect, useMemo, useSyncExternalStore } from "react";
|
|
8637
8684
|
|
|
8638
8685
|
// ../react/src/domains/agent-chat-history.ts
|
|
@@ -8648,6 +8695,9 @@ function parseStreamData(data) {
|
|
|
8648
8695
|
function sequenceNumber(value) {
|
|
8649
8696
|
return value ?? 0;
|
|
8650
8697
|
}
|
|
8698
|
+
function eventsAfterSequence(events, sequence) {
|
|
8699
|
+
return events.filter((event) => sequenceNumber(event.sequence) > sequence);
|
|
8700
|
+
}
|
|
8651
8701
|
function eventMetadata(event) {
|
|
8652
8702
|
return {
|
|
8653
8703
|
eventId: event.id,
|
|
@@ -9084,6 +9134,12 @@ function useAgentChatHistory(client2, scope) {
|
|
|
9084
9134
|
staleTime: Infinity
|
|
9085
9135
|
});
|
|
9086
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
|
+
}
|
|
9087
9143
|
|
|
9088
9144
|
// ../react/src/domains/agent-chat-transport.ts
|
|
9089
9145
|
var sourceLabels = { web: "web app", cli: "CLI" };
|
|
@@ -9313,6 +9369,38 @@ function useResolveAgentInteraction(orgID, projectID, agentID) {
|
|
|
9313
9369
|
}
|
|
9314
9370
|
});
|
|
9315
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
|
+
}
|
|
9316
9404
|
|
|
9317
9405
|
// ../react/src/domains/usage.ts
|
|
9318
9406
|
import { keepPreviousData, useQuery as useQuery3 } from "@tanstack/react-query";
|
|
@@ -9347,6 +9435,7 @@ var AgentChatSession = class {
|
|
|
9347
9435
|
localInputs: [],
|
|
9348
9436
|
backlogInputs: [],
|
|
9349
9437
|
error: void 0,
|
|
9438
|
+
streamError: void 0,
|
|
9350
9439
|
hasOlderEvents: false
|
|
9351
9440
|
};
|
|
9352
9441
|
constructor({
|
|
@@ -9488,12 +9577,12 @@ var AgentChatSession = class {
|
|
|
9488
9577
|
if (changed) this.notify();
|
|
9489
9578
|
};
|
|
9490
9579
|
inputEchoLoaded(id) {
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
const history = this.queryClient.getQueryData(
|
|
9494
|
-
agentChatHistoryQueryKey(this.scope)
|
|
9580
|
+
return this.hasLoadedEvent(
|
|
9581
|
+
(event) => event.event_kind === "agent_input" && event.input_idempotency_key === id
|
|
9495
9582
|
);
|
|
9496
|
-
|
|
9583
|
+
}
|
|
9584
|
+
hasLoadedEvent(matches) {
|
|
9585
|
+
return this.events.some(matches) || historyHasEvent(this.queryClient, this.scope, matches);
|
|
9497
9586
|
}
|
|
9498
9587
|
notify() {
|
|
9499
9588
|
const localInputs = [...this.localInputs.values()];
|
|
@@ -9503,6 +9592,7 @@ var AgentChatSession = class {
|
|
|
9503
9592
|
localInputs,
|
|
9504
9593
|
backlogInputs: [],
|
|
9505
9594
|
error: this.error,
|
|
9595
|
+
streamError: this.errorSource === "stream" ? this.error : void 0,
|
|
9506
9596
|
hasOlderEvents: false
|
|
9507
9597
|
};
|
|
9508
9598
|
for (const listener of this.listeners) listener();
|
|
@@ -9512,10 +9602,7 @@ var AgentChatSession = class {
|
|
|
9512
9602
|
if (this.cursor == null || sequence <= this.cursor) return;
|
|
9513
9603
|
this.cursor = sequence;
|
|
9514
9604
|
this.events = [...this.events, event];
|
|
9515
|
-
|
|
9516
|
-
this.error = void 0;
|
|
9517
|
-
this.errorSource = void 0;
|
|
9518
|
-
}
|
|
9605
|
+
this.clearStreamError();
|
|
9519
9606
|
const inputIdempotencyKey = event.event_kind === "agent_input" ? event.input_idempotency_key : void 0;
|
|
9520
9607
|
let localInputEcho = inputIdempotencyKey != null && inputIdempotencyKey === this.lastFailedSend?.id;
|
|
9521
9608
|
if (localInputEcho) {
|
|
@@ -9557,6 +9644,13 @@ var AgentChatSession = class {
|
|
|
9557
9644
|
if (hasToolCalls(event) || event.event_kind === "tool_result" || isControlEvent(event)) {
|
|
9558
9645
|
this.invalidateInteractions();
|
|
9559
9646
|
}
|
|
9647
|
+
void invalidateSubagentList(
|
|
9648
|
+
this.queryClient,
|
|
9649
|
+
this.client,
|
|
9650
|
+
this.scope,
|
|
9651
|
+
event,
|
|
9652
|
+
(matches) => this.hasLoadedEvent(matches)
|
|
9653
|
+
);
|
|
9560
9654
|
this.notify();
|
|
9561
9655
|
}
|
|
9562
9656
|
invalidateInteractions() {
|
|
@@ -9566,10 +9660,7 @@ var AgentChatSession = class {
|
|
|
9566
9660
|
}
|
|
9567
9661
|
handleDelta(delta) {
|
|
9568
9662
|
if (this.completedCalls.has(delta.model_call_context_id)) return;
|
|
9569
|
-
|
|
9570
|
-
this.error = void 0;
|
|
9571
|
-
this.errorSource = void 0;
|
|
9572
|
-
}
|
|
9663
|
+
this.clearStreamError();
|
|
9573
9664
|
if (delta.event.kind === "error") {
|
|
9574
9665
|
this.completedCalls.add(delta.model_call_context_id);
|
|
9575
9666
|
this.deltas = this.deltas.filter(
|
|
@@ -9598,6 +9689,16 @@ var AgentChatSession = class {
|
|
|
9598
9689
|
this.runController?.abort();
|
|
9599
9690
|
this.runController = null;
|
|
9600
9691
|
};
|
|
9692
|
+
reconnect = () => {
|
|
9693
|
+
if (this.clearStreamError()) this.notify();
|
|
9694
|
+
this.connect();
|
|
9695
|
+
};
|
|
9696
|
+
clearStreamError() {
|
|
9697
|
+
if (this.errorSource !== "stream") return false;
|
|
9698
|
+
this.error = void 0;
|
|
9699
|
+
this.errorSource = void 0;
|
|
9700
|
+
return true;
|
|
9701
|
+
}
|
|
9601
9702
|
connect() {
|
|
9602
9703
|
if (this.cursor == null || this.listeners.length === 0 || this.runController != null) return;
|
|
9603
9704
|
this.runController = new AbortController();
|
|
@@ -9668,21 +9769,28 @@ function useAgentChat(scope, options) {
|
|
|
9668
9769
|
const data = useMemo(
|
|
9669
9770
|
() => ({
|
|
9670
9771
|
...sessionData,
|
|
9671
|
-
events: [
|
|
9772
|
+
events: [
|
|
9773
|
+
...history.data?.events ?? [],
|
|
9774
|
+
...eventsAfterSequence(sessionData.events, newestLoadedSequence)
|
|
9775
|
+
],
|
|
9672
9776
|
backlogInputs: authoritativeBacklogInputs,
|
|
9673
9777
|
hasOlderEvents
|
|
9674
9778
|
}),
|
|
9675
|
-
[authoritativeBacklogInputs, history.data, hasOlderEvents, sessionData]
|
|
9779
|
+
[authoritativeBacklogInputs, history.data, hasOlderEvents, newestLoadedSequence, sessionData]
|
|
9676
9780
|
);
|
|
9677
9781
|
const projected = useMemo(() => projectAgentChat(data), [data]);
|
|
9678
9782
|
const inputPlacement = projected.isWorking || projected.backlogInputs.length > 0 || sessionData.localInputs.length > 0 ? "backlog" : "conversation";
|
|
9679
9783
|
return {
|
|
9784
|
+
events: data.events,
|
|
9680
9785
|
messages: projected.messages,
|
|
9681
9786
|
status: projected.status,
|
|
9682
9787
|
isWorking: projected.isWorking,
|
|
9683
9788
|
error: data.error,
|
|
9789
|
+
streamError: data.streamError,
|
|
9684
9790
|
historyStatus: history.status,
|
|
9685
9791
|
historyError: history.error,
|
|
9792
|
+
retryHistory: () => void history.refetch(),
|
|
9793
|
+
reconnect: session.reconnect,
|
|
9686
9794
|
hasOlderMessages: history.hasNextPage,
|
|
9687
9795
|
isLoadingOlderMessages: history.isFetchingNextPage,
|
|
9688
9796
|
loadOlderMessages: () => void history.fetchNextPage(),
|
|
@@ -9709,12 +9817,52 @@ function useAgentChat(scope, options) {
|
|
|
9709
9817
|
};
|
|
9710
9818
|
}
|
|
9711
9819
|
|
|
9820
|
+
// ../react/src/domains/agent-config-tools.ts
|
|
9821
|
+
import { useQuery as useQuery4, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
9822
|
+
import { useId } from "react";
|
|
9823
|
+
|
|
9824
|
+
// ../react/src/domains/agent-event-preview.ts
|
|
9825
|
+
function truncate2(value, width) {
|
|
9826
|
+
if (value.length <= width) return value;
|
|
9827
|
+
let end = Math.max(0, width - 1);
|
|
9828
|
+
const lastUnit = value.charCodeAt(end - 1);
|
|
9829
|
+
if (end > 0 && lastUnit >= 55296 && lastUnit <= 56319) end -= 1;
|
|
9830
|
+
return `${value.slice(0, end)}\u2026`;
|
|
9831
|
+
}
|
|
9832
|
+
function abbreviate(text, max) {
|
|
9833
|
+
return truncate2(text.replaceAll(/\s+/g, " ").trim(), max);
|
|
9834
|
+
}
|
|
9835
|
+
function blockText(block) {
|
|
9836
|
+
switch (block.type) {
|
|
9837
|
+
case "text":
|
|
9838
|
+
return block.text ?? "";
|
|
9839
|
+
case "tool_call":
|
|
9840
|
+
return `[tool_call ${block.name ?? ""}]`;
|
|
9841
|
+
case "structured_data":
|
|
9842
|
+
return JSON.stringify(block.value);
|
|
9843
|
+
default:
|
|
9844
|
+
return `[${block.type}]`;
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9847
|
+
var agentEventPreviewWidth = 80;
|
|
9848
|
+
function agentEventPreview(event, width = agentEventPreviewWidth) {
|
|
9849
|
+
switch (event.event_kind) {
|
|
9850
|
+
case "agent_input":
|
|
9851
|
+
case "model_output":
|
|
9852
|
+
return abbreviate(event.content_blocks.map(blockText).join(" "), width);
|
|
9853
|
+
case "tool_result":
|
|
9854
|
+
return abbreviate(`${event.outcome}: ${event.content_blocks.map(blockText).join(" ")}`, width);
|
|
9855
|
+
case "context_checkpoint":
|
|
9856
|
+
return abbreviate(`context summarized: ${event.summary}`, width);
|
|
9857
|
+
}
|
|
9858
|
+
}
|
|
9859
|
+
|
|
9712
9860
|
// ../react/src/domains/agent-profiles.ts
|
|
9713
9861
|
import {
|
|
9714
9862
|
useInfiniteQuery as useInfiniteQuery2,
|
|
9715
9863
|
useMutation as useMutation4,
|
|
9716
|
-
useQuery as
|
|
9717
|
-
useQueryClient as
|
|
9864
|
+
useQuery as useQuery5,
|
|
9865
|
+
useQueryClient as useQueryClient5,
|
|
9718
9866
|
useSuspenseQuery as useSuspenseQuery2
|
|
9719
9867
|
} from "@tanstack/react-query";
|
|
9720
9868
|
|
|
@@ -9730,32 +9878,32 @@ import {
|
|
|
9730
9878
|
keepPreviousData as keepPreviousData2,
|
|
9731
9879
|
useInfiniteQuery as useInfiniteQuery3,
|
|
9732
9880
|
useMutation as useMutation5,
|
|
9733
|
-
useQuery as
|
|
9734
|
-
useQueryClient as
|
|
9881
|
+
useQuery as useQuery6,
|
|
9882
|
+
useQueryClient as useQueryClient6,
|
|
9735
9883
|
useSuspenseQuery as useSuspenseQuery3
|
|
9736
9884
|
} from "@tanstack/react-query";
|
|
9737
9885
|
|
|
9738
9886
|
// ../react/src/domains/cron-triggers.ts
|
|
9739
|
-
import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, useQueryClient as
|
|
9887
|
+
import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
9740
9888
|
|
|
9741
9889
|
// ../react/src/domains/integration-installs.ts
|
|
9742
|
-
import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as
|
|
9890
|
+
import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient8 } from "@tanstack/react-query";
|
|
9743
9891
|
|
|
9744
9892
|
// ../react/src/domains/invitations.ts
|
|
9745
|
-
import { useMutation as useMutation8, useQuery as
|
|
9893
|
+
import { useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient9, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
|
|
9746
9894
|
|
|
9747
9895
|
// ../react/src/domains/machine-pools.ts
|
|
9748
|
-
import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as
|
|
9896
|
+
import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
9749
9897
|
|
|
9750
9898
|
// ../react/src/domains/machines.ts
|
|
9751
|
-
import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as
|
|
9899
|
+
import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
9752
9900
|
|
|
9753
9901
|
// ../react/src/domains/mcp-registry.ts
|
|
9754
|
-
import { useInfiniteQuery as useInfiniteQuery8, useQuery as
|
|
9902
|
+
import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery10, useQueryClient as useQueryClient12 } from "@tanstack/react-query";
|
|
9755
9903
|
var serverInfoStaleTime = 5 * 60 * 1e3;
|
|
9756
9904
|
|
|
9757
9905
|
// ../react/src/domains/mcp-server-tools.ts
|
|
9758
|
-
import { useQuery as
|
|
9906
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
9759
9907
|
var mcpServerToolsStaleTime = 60 * 1e3;
|
|
9760
9908
|
|
|
9761
9909
|
// ../react/src/domains/me.ts
|
|
@@ -9766,32 +9914,32 @@ import {
|
|
|
9766
9914
|
useInfiniteQuery as useInfiniteQuery9,
|
|
9767
9915
|
useMutation as useMutation11,
|
|
9768
9916
|
useQueries,
|
|
9769
|
-
useQuery as
|
|
9770
|
-
useQueryClient as
|
|
9917
|
+
useQuery as useQuery12,
|
|
9918
|
+
useQueryClient as useQueryClient13
|
|
9771
9919
|
} from "@tanstack/react-query";
|
|
9772
9920
|
import { useEffect as useEffect2 } from "react";
|
|
9773
9921
|
var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
|
|
9774
9922
|
|
|
9775
9923
|
// ../react/src/domains/org-api-keys.ts
|
|
9776
|
-
import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as
|
|
9924
|
+
import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery13, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
|
|
9777
9925
|
|
|
9778
9926
|
// ../react/src/domains/org-members.ts
|
|
9779
|
-
import { useMutation as useMutation13, useQuery as
|
|
9927
|
+
import { useMutation as useMutation13, useQuery as useQuery14, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
|
|
9780
9928
|
|
|
9781
9929
|
// ../react/src/domains/orgs.ts
|
|
9782
|
-
import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as
|
|
9930
|
+
import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery15, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
9783
9931
|
|
|
9784
9932
|
// ../react/src/domains/personal-access-tokens.ts
|
|
9785
|
-
import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as
|
|
9933
|
+
import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
9786
9934
|
|
|
9787
9935
|
// ../react/src/domains/project-grants.ts
|
|
9788
|
-
import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation16, useQueryClient as
|
|
9936
|
+
import { useInfiniteQuery as useInfiniteQuery13, useMutation as useMutation16, useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
9789
9937
|
|
|
9790
9938
|
// ../react/src/domains/projects.ts
|
|
9791
9939
|
import {
|
|
9792
9940
|
skipToken,
|
|
9793
9941
|
useInfiniteQuery as useInfiniteQuery14,
|
|
9794
|
-
useQueryClient as
|
|
9942
|
+
useQueryClient as useQueryClient19,
|
|
9795
9943
|
useSuspenseInfiniteQuery
|
|
9796
9944
|
} from "@tanstack/react-query";
|
|
9797
9945
|
|
|
@@ -9799,20 +9947,20 @@ import {
|
|
|
9799
9947
|
import {
|
|
9800
9948
|
useInfiniteQuery as useInfiniteQuery15,
|
|
9801
9949
|
useMutation as useMutation17,
|
|
9802
|
-
useQuery as
|
|
9803
|
-
useQueryClient as
|
|
9950
|
+
useQuery as useQuery16,
|
|
9951
|
+
useQueryClient as useQueryClient20
|
|
9804
9952
|
} from "@tanstack/react-query";
|
|
9805
9953
|
|
|
9806
9954
|
// ../react/src/domains/skills.ts
|
|
9807
9955
|
import {
|
|
9808
9956
|
useInfiniteQuery as useInfiniteQuery16,
|
|
9809
9957
|
useMutation as useMutation18,
|
|
9810
|
-
useQuery as
|
|
9811
|
-
useQueryClient as
|
|
9958
|
+
useQuery as useQuery17,
|
|
9959
|
+
useQueryClient as useQueryClient21
|
|
9812
9960
|
} from "@tanstack/react-query";
|
|
9813
9961
|
|
|
9814
9962
|
// ../react/src/domains/tool-catalog.ts
|
|
9815
|
-
import { useQuery as
|
|
9963
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
9816
9964
|
|
|
9817
9965
|
// src/chat.tsx
|
|
9818
9966
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -9825,40 +9973,13 @@ import * as z15 from "zod";
|
|
|
9825
9973
|
|
|
9826
9974
|
// src/agent-rendering.ts
|
|
9827
9975
|
import * as z14 from "zod";
|
|
9828
|
-
function blockText(block) {
|
|
9829
|
-
switch (block.type) {
|
|
9830
|
-
case "text":
|
|
9831
|
-
return block.text ?? "";
|
|
9832
|
-
case "tool_call":
|
|
9833
|
-
return `[tool_call ${block.name ?? ""}]`;
|
|
9834
|
-
case "structured_data":
|
|
9835
|
-
return JSON.stringify(block.value);
|
|
9836
|
-
default:
|
|
9837
|
-
return `[${block.type}]`;
|
|
9838
|
-
}
|
|
9839
|
-
}
|
|
9840
|
-
var previewWidth = 80;
|
|
9841
|
-
function eventPreview(event) {
|
|
9842
|
-
switch (event.event_kind) {
|
|
9843
|
-
case "agent_input":
|
|
9844
|
-
case "model_output":
|
|
9845
|
-
return abbreviate(event.content_blocks.map(blockText).join(" "), previewWidth);
|
|
9846
|
-
case "tool_result":
|
|
9847
|
-
return abbreviate(
|
|
9848
|
-
`${event.outcome}: ${event.content_blocks.map(blockText).join(" ")}`,
|
|
9849
|
-
previewWidth
|
|
9850
|
-
);
|
|
9851
|
-
case "context_checkpoint":
|
|
9852
|
-
return abbreviate(`context summarized: ${event.summary}`, previewWidth);
|
|
9853
|
-
}
|
|
9854
|
-
}
|
|
9855
9976
|
var formatAgentEventList = (response) => {
|
|
9856
9977
|
const page = {
|
|
9857
9978
|
data: response.data.map((event) => ({
|
|
9858
9979
|
sequence: event.sequence,
|
|
9859
9980
|
event_kind: event.event_kind,
|
|
9860
9981
|
turn_sequence: event.turn_sequence,
|
|
9861
|
-
preview:
|
|
9982
|
+
preview: agentEventPreview(event),
|
|
9862
9983
|
created_at: event.created_at
|
|
9863
9984
|
})),
|
|
9864
9985
|
has_more: response.has_more,
|
package/package.json
CHANGED