omnara 1.0.13 → 1.0.14
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 +123 -60
- 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)")));
|
|
@@ -8648,6 +8683,9 @@ function parseStreamData(data) {
|
|
|
8648
8683
|
function sequenceNumber(value) {
|
|
8649
8684
|
return value ?? 0;
|
|
8650
8685
|
}
|
|
8686
|
+
function eventsAfterSequence(events, sequence) {
|
|
8687
|
+
return events.filter((event) => sequenceNumber(event.sequence) > sequence);
|
|
8688
|
+
}
|
|
8651
8689
|
function eventMetadata(event) {
|
|
8652
8690
|
return {
|
|
8653
8691
|
eventId: event.id,
|
|
@@ -9347,6 +9385,7 @@ var AgentChatSession = class {
|
|
|
9347
9385
|
localInputs: [],
|
|
9348
9386
|
backlogInputs: [],
|
|
9349
9387
|
error: void 0,
|
|
9388
|
+
streamError: void 0,
|
|
9350
9389
|
hasOlderEvents: false
|
|
9351
9390
|
};
|
|
9352
9391
|
constructor({
|
|
@@ -9503,6 +9542,7 @@ var AgentChatSession = class {
|
|
|
9503
9542
|
localInputs,
|
|
9504
9543
|
backlogInputs: [],
|
|
9505
9544
|
error: this.error,
|
|
9545
|
+
streamError: this.errorSource === "stream" ? this.error : void 0,
|
|
9506
9546
|
hasOlderEvents: false
|
|
9507
9547
|
};
|
|
9508
9548
|
for (const listener of this.listeners) listener();
|
|
@@ -9512,10 +9552,7 @@ var AgentChatSession = class {
|
|
|
9512
9552
|
if (this.cursor == null || sequence <= this.cursor) return;
|
|
9513
9553
|
this.cursor = sequence;
|
|
9514
9554
|
this.events = [...this.events, event];
|
|
9515
|
-
|
|
9516
|
-
this.error = void 0;
|
|
9517
|
-
this.errorSource = void 0;
|
|
9518
|
-
}
|
|
9555
|
+
this.clearStreamError();
|
|
9519
9556
|
const inputIdempotencyKey = event.event_kind === "agent_input" ? event.input_idempotency_key : void 0;
|
|
9520
9557
|
let localInputEcho = inputIdempotencyKey != null && inputIdempotencyKey === this.lastFailedSend?.id;
|
|
9521
9558
|
if (localInputEcho) {
|
|
@@ -9566,10 +9603,7 @@ var AgentChatSession = class {
|
|
|
9566
9603
|
}
|
|
9567
9604
|
handleDelta(delta) {
|
|
9568
9605
|
if (this.completedCalls.has(delta.model_call_context_id)) return;
|
|
9569
|
-
|
|
9570
|
-
this.error = void 0;
|
|
9571
|
-
this.errorSource = void 0;
|
|
9572
|
-
}
|
|
9606
|
+
this.clearStreamError();
|
|
9573
9607
|
if (delta.event.kind === "error") {
|
|
9574
9608
|
this.completedCalls.add(delta.model_call_context_id);
|
|
9575
9609
|
this.deltas = this.deltas.filter(
|
|
@@ -9598,6 +9632,16 @@ var AgentChatSession = class {
|
|
|
9598
9632
|
this.runController?.abort();
|
|
9599
9633
|
this.runController = null;
|
|
9600
9634
|
};
|
|
9635
|
+
reconnect = () => {
|
|
9636
|
+
if (this.clearStreamError()) this.notify();
|
|
9637
|
+
this.connect();
|
|
9638
|
+
};
|
|
9639
|
+
clearStreamError() {
|
|
9640
|
+
if (this.errorSource !== "stream") return false;
|
|
9641
|
+
this.error = void 0;
|
|
9642
|
+
this.errorSource = void 0;
|
|
9643
|
+
return true;
|
|
9644
|
+
}
|
|
9601
9645
|
connect() {
|
|
9602
9646
|
if (this.cursor == null || this.listeners.length === 0 || this.runController != null) return;
|
|
9603
9647
|
this.runController = new AbortController();
|
|
@@ -9668,21 +9712,28 @@ function useAgentChat(scope, options) {
|
|
|
9668
9712
|
const data = useMemo(
|
|
9669
9713
|
() => ({
|
|
9670
9714
|
...sessionData,
|
|
9671
|
-
events: [
|
|
9715
|
+
events: [
|
|
9716
|
+
...history.data?.events ?? [],
|
|
9717
|
+
...eventsAfterSequence(sessionData.events, newestLoadedSequence)
|
|
9718
|
+
],
|
|
9672
9719
|
backlogInputs: authoritativeBacklogInputs,
|
|
9673
9720
|
hasOlderEvents
|
|
9674
9721
|
}),
|
|
9675
|
-
[authoritativeBacklogInputs, history.data, hasOlderEvents, sessionData]
|
|
9722
|
+
[authoritativeBacklogInputs, history.data, hasOlderEvents, newestLoadedSequence, sessionData]
|
|
9676
9723
|
);
|
|
9677
9724
|
const projected = useMemo(() => projectAgentChat(data), [data]);
|
|
9678
9725
|
const inputPlacement = projected.isWorking || projected.backlogInputs.length > 0 || sessionData.localInputs.length > 0 ? "backlog" : "conversation";
|
|
9679
9726
|
return {
|
|
9727
|
+
events: data.events,
|
|
9680
9728
|
messages: projected.messages,
|
|
9681
9729
|
status: projected.status,
|
|
9682
9730
|
isWorking: projected.isWorking,
|
|
9683
9731
|
error: data.error,
|
|
9732
|
+
streamError: data.streamError,
|
|
9684
9733
|
historyStatus: history.status,
|
|
9685
9734
|
historyError: history.error,
|
|
9735
|
+
retryHistory: () => void history.refetch(),
|
|
9736
|
+
reconnect: session.reconnect,
|
|
9686
9737
|
hasOlderMessages: history.hasNextPage,
|
|
9687
9738
|
isLoadingOlderMessages: history.isFetchingNextPage,
|
|
9688
9739
|
loadOlderMessages: () => void history.fetchNextPage(),
|
|
@@ -9709,11 +9760,50 @@ function useAgentChat(scope, options) {
|
|
|
9709
9760
|
};
|
|
9710
9761
|
}
|
|
9711
9762
|
|
|
9763
|
+
// ../react/src/domains/agent-config-tools.ts
|
|
9764
|
+
import { useQuery as useQuery4 } from "@tanstack/react-query";
|
|
9765
|
+
|
|
9766
|
+
// ../react/src/domains/agent-event-preview.ts
|
|
9767
|
+
function truncate2(value, width) {
|
|
9768
|
+
if (value.length <= width) return value;
|
|
9769
|
+
let end = Math.max(0, width - 1);
|
|
9770
|
+
const lastUnit = value.charCodeAt(end - 1);
|
|
9771
|
+
if (end > 0 && lastUnit >= 55296 && lastUnit <= 56319) end -= 1;
|
|
9772
|
+
return `${value.slice(0, end)}\u2026`;
|
|
9773
|
+
}
|
|
9774
|
+
function abbreviate(text, max) {
|
|
9775
|
+
return truncate2(text.replaceAll(/\s+/g, " ").trim(), max);
|
|
9776
|
+
}
|
|
9777
|
+
function blockText(block) {
|
|
9778
|
+
switch (block.type) {
|
|
9779
|
+
case "text":
|
|
9780
|
+
return block.text ?? "";
|
|
9781
|
+
case "tool_call":
|
|
9782
|
+
return `[tool_call ${block.name ?? ""}]`;
|
|
9783
|
+
case "structured_data":
|
|
9784
|
+
return JSON.stringify(block.value);
|
|
9785
|
+
default:
|
|
9786
|
+
return `[${block.type}]`;
|
|
9787
|
+
}
|
|
9788
|
+
}
|
|
9789
|
+
var agentEventPreviewWidth = 80;
|
|
9790
|
+
function agentEventPreview(event, width = agentEventPreviewWidth) {
|
|
9791
|
+
switch (event.event_kind) {
|
|
9792
|
+
case "agent_input":
|
|
9793
|
+
case "model_output":
|
|
9794
|
+
return abbreviate(event.content_blocks.map(blockText).join(" "), width);
|
|
9795
|
+
case "tool_result":
|
|
9796
|
+
return abbreviate(`${event.outcome}: ${event.content_blocks.map(blockText).join(" ")}`, width);
|
|
9797
|
+
case "context_checkpoint":
|
|
9798
|
+
return abbreviate(`context summarized: ${event.summary}`, width);
|
|
9799
|
+
}
|
|
9800
|
+
}
|
|
9801
|
+
|
|
9712
9802
|
// ../react/src/domains/agent-profiles.ts
|
|
9713
9803
|
import {
|
|
9714
9804
|
useInfiniteQuery as useInfiniteQuery2,
|
|
9715
9805
|
useMutation as useMutation4,
|
|
9716
|
-
useQuery as
|
|
9806
|
+
useQuery as useQuery5,
|
|
9717
9807
|
useQueryClient as useQueryClient4,
|
|
9718
9808
|
useSuspenseQuery as useSuspenseQuery2
|
|
9719
9809
|
} from "@tanstack/react-query";
|
|
@@ -9730,7 +9820,7 @@ import {
|
|
|
9730
9820
|
keepPreviousData as keepPreviousData2,
|
|
9731
9821
|
useInfiniteQuery as useInfiniteQuery3,
|
|
9732
9822
|
useMutation as useMutation5,
|
|
9733
|
-
useQuery as
|
|
9823
|
+
useQuery as useQuery6,
|
|
9734
9824
|
useQueryClient as useQueryClient5,
|
|
9735
9825
|
useSuspenseQuery as useSuspenseQuery3
|
|
9736
9826
|
} from "@tanstack/react-query";
|
|
@@ -9742,20 +9832,20 @@ import { useInfiniteQuery as useInfiniteQuery4, useMutation as useMutation6, use
|
|
|
9742
9832
|
import { useInfiniteQuery as useInfiniteQuery5, useMutation as useMutation7, useQueryClient as useQueryClient7 } from "@tanstack/react-query";
|
|
9743
9833
|
|
|
9744
9834
|
// ../react/src/domains/invitations.ts
|
|
9745
|
-
import { useMutation as useMutation8, useQuery as
|
|
9835
|
+
import { useMutation as useMutation8, useQuery as useQuery7, useQueryClient as useQueryClient8, useSuspenseQuery as useSuspenseQuery4 } from "@tanstack/react-query";
|
|
9746
9836
|
|
|
9747
9837
|
// ../react/src/domains/machine-pools.ts
|
|
9748
|
-
import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as
|
|
9838
|
+
import { useInfiniteQuery as useInfiniteQuery6, useMutation as useMutation9, useQuery as useQuery8, useQueryClient as useQueryClient9 } from "@tanstack/react-query";
|
|
9749
9839
|
|
|
9750
9840
|
// ../react/src/domains/machines.ts
|
|
9751
|
-
import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as
|
|
9841
|
+
import { useInfiniteQuery as useInfiniteQuery7, useMutation as useMutation10, useQuery as useQuery9, useQueryClient as useQueryClient10 } from "@tanstack/react-query";
|
|
9752
9842
|
|
|
9753
9843
|
// ../react/src/domains/mcp-registry.ts
|
|
9754
|
-
import { useInfiniteQuery as useInfiniteQuery8, useQuery as
|
|
9844
|
+
import { useInfiniteQuery as useInfiniteQuery8, useQuery as useQuery10, useQueryClient as useQueryClient11 } from "@tanstack/react-query";
|
|
9755
9845
|
var serverInfoStaleTime = 5 * 60 * 1e3;
|
|
9756
9846
|
|
|
9757
9847
|
// ../react/src/domains/mcp-server-tools.ts
|
|
9758
|
-
import { useQuery as
|
|
9848
|
+
import { useQuery as useQuery11 } from "@tanstack/react-query";
|
|
9759
9849
|
var mcpServerToolsStaleTime = 60 * 1e3;
|
|
9760
9850
|
|
|
9761
9851
|
// ../react/src/domains/me.ts
|
|
@@ -9766,20 +9856,20 @@ import {
|
|
|
9766
9856
|
useInfiniteQuery as useInfiniteQuery9,
|
|
9767
9857
|
useMutation as useMutation11,
|
|
9768
9858
|
useQueries,
|
|
9769
|
-
useQuery as
|
|
9859
|
+
useQuery as useQuery12,
|
|
9770
9860
|
useQueryClient as useQueryClient12
|
|
9771
9861
|
} from "@tanstack/react-query";
|
|
9772
9862
|
import { useEffect as useEffect2 } from "react";
|
|
9773
9863
|
var modelCatalogPricingStaleTime = 5 * 60 * 1e3;
|
|
9774
9864
|
|
|
9775
9865
|
// ../react/src/domains/org-api-keys.ts
|
|
9776
|
-
import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as
|
|
9866
|
+
import { useInfiniteQuery as useInfiniteQuery10, useMutation as useMutation12, useQuery as useQuery13, useQueryClient as useQueryClient13 } from "@tanstack/react-query";
|
|
9777
9867
|
|
|
9778
9868
|
// ../react/src/domains/org-members.ts
|
|
9779
|
-
import { useMutation as useMutation13, useQuery as
|
|
9869
|
+
import { useMutation as useMutation13, useQuery as useQuery14, useQueryClient as useQueryClient14 } from "@tanstack/react-query";
|
|
9780
9870
|
|
|
9781
9871
|
// ../react/src/domains/orgs.ts
|
|
9782
|
-
import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as
|
|
9872
|
+
import { useInfiniteQuery as useInfiniteQuery11, useMutation as useMutation14, useQuery as useQuery15, useQueryClient as useQueryClient15 } from "@tanstack/react-query";
|
|
9783
9873
|
|
|
9784
9874
|
// ../react/src/domains/personal-access-tokens.ts
|
|
9785
9875
|
import { useInfiniteQuery as useInfiniteQuery12, useMutation as useMutation15, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
@@ -9799,7 +9889,7 @@ import {
|
|
|
9799
9889
|
import {
|
|
9800
9890
|
useInfiniteQuery as useInfiniteQuery15,
|
|
9801
9891
|
useMutation as useMutation17,
|
|
9802
|
-
useQuery as
|
|
9892
|
+
useQuery as useQuery16,
|
|
9803
9893
|
useQueryClient as useQueryClient19
|
|
9804
9894
|
} from "@tanstack/react-query";
|
|
9805
9895
|
|
|
@@ -9807,12 +9897,12 @@ import {
|
|
|
9807
9897
|
import {
|
|
9808
9898
|
useInfiniteQuery as useInfiniteQuery16,
|
|
9809
9899
|
useMutation as useMutation18,
|
|
9810
|
-
useQuery as
|
|
9900
|
+
useQuery as useQuery17,
|
|
9811
9901
|
useQueryClient as useQueryClient20
|
|
9812
9902
|
} from "@tanstack/react-query";
|
|
9813
9903
|
|
|
9814
9904
|
// ../react/src/domains/tool-catalog.ts
|
|
9815
|
-
import { useQuery as
|
|
9905
|
+
import { useQuery as useQuery18 } from "@tanstack/react-query";
|
|
9816
9906
|
|
|
9817
9907
|
// src/chat.tsx
|
|
9818
9908
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
@@ -9825,40 +9915,13 @@ import * as z15 from "zod";
|
|
|
9825
9915
|
|
|
9826
9916
|
// src/agent-rendering.ts
|
|
9827
9917
|
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
9918
|
var formatAgentEventList = (response) => {
|
|
9856
9919
|
const page = {
|
|
9857
9920
|
data: response.data.map((event) => ({
|
|
9858
9921
|
sequence: event.sequence,
|
|
9859
9922
|
event_kind: event.event_kind,
|
|
9860
9923
|
turn_sequence: event.turn_sequence,
|
|
9861
|
-
preview:
|
|
9924
|
+
preview: agentEventPreview(event),
|
|
9862
9925
|
created_at: event.created_at
|
|
9863
9926
|
})),
|
|
9864
9927
|
has_more: response.has_more,
|
package/package.json
CHANGED