@orq-ai/node 4.1.0-rc.4 → 4.1.0-rc.5
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/bin/mcp-server.js +25494 -27422
- package/bin/mcp-server.js.map +64 -47
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/models/components/actionreviewedstreamingevent.d.ts +76 -0
- package/models/components/actionreviewedstreamingevent.d.ts.map +1 -0
- package/models/components/actionreviewedstreamingevent.js +127 -0
- package/models/components/actionreviewedstreamingevent.js.map +1 -0
- package/models/components/actionreviewrequestedstreamingevent.d.ts +135 -0
- package/models/components/actionreviewrequestedstreamingevent.d.ts.map +1 -0
- package/models/components/actionreviewrequestedstreamingevent.js +180 -0
- package/models/components/actionreviewrequestedstreamingevent.js.map +1 -0
- package/models/components/agenterroredstreamingevent.d.ts +58 -0
- package/models/components/agenterroredstreamingevent.d.ts.map +1 -0
- package/models/components/agenterroredstreamingevent.js +91 -0
- package/models/components/agenterroredstreamingevent.js.map +1 -0
- package/models/components/agentexecutionstartedstreamingevent.d.ts +62 -0
- package/models/components/agentexecutionstartedstreamingevent.d.ts.map +1 -0
- package/models/components/agentexecutionstartedstreamingevent.js +103 -0
- package/models/components/agentexecutionstartedstreamingevent.js.map +1 -0
- package/models/components/agenthandedoffstreamingevent.d.ts +51 -0
- package/models/components/agenthandedoffstreamingevent.d.ts.map +1 -0
- package/models/components/agenthandedoffstreamingevent.js +96 -0
- package/models/components/agenthandedoffstreamingevent.js.map +1 -0
- package/models/components/agentinactivestreamingevent.d.ts +309 -0
- package/models/components/agentinactivestreamingevent.d.ts.map +1 -0
- package/models/components/agentinactivestreamingevent.js +385 -0
- package/models/components/agentinactivestreamingevent.js.map +1 -0
- package/models/components/agentmessagecreatedstreamingevent.d.ts +141 -0
- package/models/components/agentmessagecreatedstreamingevent.d.ts.map +1 -0
- package/models/components/agentmessagecreatedstreamingevent.js +190 -0
- package/models/components/agentmessagecreatedstreamingevent.js.map +1 -0
- package/models/components/agentstartedstreamingevent.d.ts +382 -0
- package/models/components/agentstartedstreamingevent.d.ts.map +1 -0
- package/models/components/agentstartedstreamingevent.js +441 -0
- package/models/components/agentstartedstreamingevent.js.map +1 -0
- package/models/components/agentthoughtstreamingevent.d.ts +542 -0
- package/models/components/agentthoughtstreamingevent.d.ts.map +1 -0
- package/models/components/agentthoughtstreamingevent.js +626 -0
- package/models/components/agentthoughtstreamingevent.js.map +1 -0
- package/models/components/errorstreamingevent.d.ts +51 -0
- package/models/components/errorstreamingevent.d.ts.map +1 -0
- package/models/components/errorstreamingevent.js +87 -0
- package/models/components/errorstreamingevent.js.map +1 -0
- package/models/components/executionnamedstreamingevent.d.ts +51 -0
- package/models/components/executionnamedstreamingevent.d.ts.map +1 -0
- package/models/components/executionnamedstreamingevent.js +96 -0
- package/models/components/executionnamedstreamingevent.js.map +1 -0
- package/models/components/executionreviewedstreamingevent.d.ts +45 -0
- package/models/components/executionreviewedstreamingevent.d.ts.map +1 -0
- package/models/components/executionreviewedstreamingevent.js +81 -0
- package/models/components/executionreviewedstreamingevent.js.map +1 -0
- package/models/components/executionreviewrequiredstreamingevent.d.ts +45 -0
- package/models/components/executionreviewrequiredstreamingevent.d.ts.map +1 -0
- package/models/components/executionreviewrequiredstreamingevent.js +82 -0
- package/models/components/executionreviewrequiredstreamingevent.js.map +1 -0
- package/models/components/filepart.d.ts +1 -1
- package/models/components/index.d.ts +17 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +17 -0
- package/models/components/index.js.map +1 -1
- package/models/components/invokedeploymentrequest.d.ts +13 -13
- package/models/components/invokedeploymentrequest.d.ts.map +1 -1
- package/models/components/invokedeploymentrequest.js +17 -17
- package/models/components/invokedeploymentrequest.js.map +1 -1
- package/models/components/timeoutstreamingevent.d.ts +49 -0
- package/models/components/timeoutstreamingevent.d.ts.map +1 -0
- package/models/components/timeoutstreamingevent.js +85 -0
- package/models/components/timeoutstreamingevent.js.map +1 -0
- package/models/components/toolexecutionfailedstreamingevent.d.ts +144 -0
- package/models/components/toolexecutionfailedstreamingevent.d.ts.map +1 -0
- package/models/components/toolexecutionfailedstreamingevent.js +223 -0
- package/models/components/toolexecutionfailedstreamingevent.js.map +1 -0
- package/models/components/toolexecutionfinishedstreamingevent.d.ts +129 -0
- package/models/components/toolexecutionfinishedstreamingevent.d.ts.map +1 -0
- package/models/components/toolexecutionfinishedstreamingevent.js +205 -0
- package/models/components/toolexecutionfinishedstreamingevent.js.map +1 -0
- package/models/components/toolexecutionstartedstreamingevent.d.ts +139 -0
- package/models/components/toolexecutionstartedstreamingevent.d.ts.map +1 -0
- package/models/components/toolexecutionstartedstreamingevent.js +217 -0
- package/models/components/toolexecutionstartedstreamingevent.js.map +1 -0
- package/models/components/toolresultpart.d.ts +1 -1
- package/models/operations/createagentresponserequest.d.ts +4 -137
- package/models/operations/createagentresponserequest.d.ts.map +1 -1
- package/models/operations/createagentresponserequest.js +9 -138
- package/models/operations/createagentresponserequest.js.map +1 -1
- package/models/operations/createbudget.js +2 -2
- package/models/operations/createcontact.js +2 -2
- package/models/operations/createdataset.js +2 -2
- package/models/operations/createdatasetitem.js +8 -8
- package/models/operations/createdatasource.js +2 -2
- package/models/operations/createeval.d.ts +80 -145
- package/models/operations/createeval.d.ts.map +1 -1
- package/models/operations/createeval.js +190 -266
- package/models/operations/createeval.js.map +1 -1
- package/models/operations/createtool.js +12 -12
- package/models/operations/fileget.js +2 -2
- package/models/operations/filelist.js +2 -2
- package/models/operations/fileupload.js +2 -2
- package/models/operations/getalltools.js +12 -12
- package/models/operations/getbudget.js +2 -2
- package/models/operations/getevals.d.ts +14 -79
- package/models/operations/getevals.d.ts.map +1 -1
- package/models/operations/getevals.js +49 -132
- package/models/operations/getevals.js.map +1 -1
- package/models/operations/invokeagent.d.ts +14 -147
- package/models/operations/invokeagent.d.ts.map +1 -1
- package/models/operations/invokeagent.js +19 -148
- package/models/operations/invokeagent.js.map +1 -1
- package/models/operations/listbudgets.js +2 -2
- package/models/operations/listcontacts.js +2 -2
- package/models/operations/listdatasetdatapoints.js +8 -8
- package/models/operations/listdatasets.js +2 -2
- package/models/operations/listdatasources.js +2 -2
- package/models/operations/listknowledgebases.d.ts +16 -16
- package/models/operations/listknowledgebases.d.ts.map +1 -1
- package/models/operations/listknowledgebases.js +27 -25
- package/models/operations/listknowledgebases.js.map +1 -1
- package/models/operations/retrievecontact.js +2 -2
- package/models/operations/retrievedatapoint.js +8 -8
- package/models/operations/retrievedataset.js +2 -2
- package/models/operations/retrievedatasource.js +2 -2
- package/models/operations/retrievetool.js +12 -12
- package/models/operations/runagent.d.ts +4 -137
- package/models/operations/runagent.d.ts.map +1 -1
- package/models/operations/runagent.js +17 -145
- package/models/operations/runagent.js.map +1 -1
- package/models/operations/streamagent.d.ts +241 -2491
- package/models/operations/streamagent.d.ts.map +1 -1
- package/models/operations/streamagent.js +172 -2826
- package/models/operations/streamagent.js.map +1 -1
- package/models/operations/streamrunagent.d.ts +889 -3139
- package/models/operations/streamrunagent.d.ts.map +1 -1
- package/models/operations/streamrunagent.js +175 -2825
- package/models/operations/streamrunagent.js.map +1 -1
- package/models/operations/updatebudget.js +2 -2
- package/models/operations/updatecontact.js +2 -2
- package/models/operations/updatedatapoint.js +8 -8
- package/models/operations/updatedataset.js +2 -2
- package/models/operations/updatedatasource.js +2 -2
- package/models/operations/updateeval.d.ts +14 -79
- package/models/operations/updateeval.d.ts.map +1 -1
- package/models/operations/updateeval.js +51 -134
- package/models/operations/updateeval.js.map +1 -1
- package/models/operations/updatetool.js +14 -14
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/models/components/actionreviewedstreamingevent.ts +189 -0
- package/src/models/components/actionreviewrequestedstreamingevent.ts +326 -0
- package/src/models/components/agenterroredstreamingevent.ts +142 -0
- package/src/models/components/agentexecutionstartedstreamingevent.ts +145 -0
- package/src/models/components/agenthandedoffstreamingevent.ts +142 -0
- package/src/models/components/agentinactivestreamingevent.ts +857 -0
- package/src/models/components/agentmessagecreatedstreamingevent.ts +396 -0
- package/src/models/components/agentstartedstreamingevent.ts +909 -0
- package/src/models/components/agentthoughtstreamingevent.ts +1419 -0
- package/src/models/components/errorstreamingevent.ts +129 -0
- package/src/models/components/executionnamedstreamingevent.ts +142 -0
- package/src/models/components/executionreviewedstreamingevent.ts +122 -0
- package/src/models/components/executionreviewrequiredstreamingevent.ts +130 -0
- package/src/models/components/filepart.ts +1 -1
- package/src/models/components/index.ts +17 -0
- package/src/models/components/invokedeploymentrequest.ts +32 -27
- package/src/models/components/timeoutstreamingevent.ts +125 -0
- package/src/models/components/toolexecutionfailedstreamingevent.ts +406 -0
- package/src/models/components/toolexecutionfinishedstreamingevent.ts +373 -0
- package/src/models/components/toolexecutionstartedstreamingevent.ts +350 -0
- package/src/models/components/toolresultpart.ts +1 -1
- package/src/models/operations/createagentresponserequest.ts +20 -321
- package/src/models/operations/createbudget.ts +2 -2
- package/src/models/operations/createcontact.ts +2 -2
- package/src/models/operations/createdataset.ts +2 -2
- package/src/models/operations/createdatasetitem.ts +8 -8
- package/src/models/operations/createdatasource.ts +2 -2
- package/src/models/operations/createeval.ts +318 -615
- package/src/models/operations/createtool.ts +12 -12
- package/src/models/operations/fileget.ts +2 -2
- package/src/models/operations/filelist.ts +2 -2
- package/src/models/operations/fileupload.ts +2 -2
- package/src/models/operations/getalltools.ts +12 -12
- package/src/models/operations/getbudget.ts +2 -2
- package/src/models/operations/getevals.ts +52 -287
- package/src/models/operations/invokeagent.ts +36 -373
- package/src/models/operations/listbudgets.ts +2 -2
- package/src/models/operations/listcontacts.ts +2 -2
- package/src/models/operations/listdatasetdatapoints.ts +8 -8
- package/src/models/operations/listdatasets.ts +2 -2
- package/src/models/operations/listdatasources.ts +2 -2
- package/src/models/operations/listknowledgebases.ts +82 -102
- package/src/models/operations/retrievecontact.ts +2 -2
- package/src/models/operations/retrievedatapoint.ts +8 -8
- package/src/models/operations/retrievedataset.ts +2 -2
- package/src/models/operations/retrievedatasource.ts +2 -2
- package/src/models/operations/retrievetool.ts +12 -12
- package/src/models/operations/runagent.ts +17 -365
- package/src/models/operations/streamagent.ts +794 -6985
- package/src/models/operations/streamrunagent.ts +3939 -9983
- package/src/models/operations/updatebudget.ts +2 -2
- package/src/models/operations/updatecontact.ts +2 -2
- package/src/models/operations/updatedatapoint.ts +8 -8
- package/src/models/operations/updatedataset.ts +2 -2
- package/src/models/operations/updatedatasource.ts +2 -2
- package/src/models/operations/updateeval.ts +52 -287
- package/src/models/operations/updatetool.ts +14 -14
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const ActionReviewedStreamingEventType = {
|
|
13
|
+
EventAgentsActionReviewed: "event.agents.action_reviewed",
|
|
14
|
+
} as const;
|
|
15
|
+
export type ActionReviewedStreamingEventType = ClosedEnum<
|
|
16
|
+
typeof ActionReviewedStreamingEventType
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
export const Review = {
|
|
20
|
+
Approved: "approved",
|
|
21
|
+
Rejected: "rejected",
|
|
22
|
+
} as const;
|
|
23
|
+
export type Review = ClosedEnum<typeof Review>;
|
|
24
|
+
|
|
25
|
+
export type ActionReviewedStreamingEventData = {
|
|
26
|
+
agentId: string;
|
|
27
|
+
actionId: string;
|
|
28
|
+
agentToolCallId: string;
|
|
29
|
+
review: Review;
|
|
30
|
+
mockOutput?: { [k: string]: any } | undefined;
|
|
31
|
+
reviewSource?: string | undefined;
|
|
32
|
+
reviewedById?: string | undefined;
|
|
33
|
+
workflowRunId: string;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Emitted after a tool action has been reviewed. Contains the review decision (approved/rejected), optional mock output for rejected actions, and reviewer information.
|
|
38
|
+
*/
|
|
39
|
+
export type ActionReviewedStreamingEvent = {
|
|
40
|
+
type: ActionReviewedStreamingEventType;
|
|
41
|
+
/**
|
|
42
|
+
* ISO timestamp of the event
|
|
43
|
+
*/
|
|
44
|
+
timestamp: string;
|
|
45
|
+
data: ActionReviewedStreamingEventData;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const ActionReviewedStreamingEventType$inboundSchema: z.ZodNativeEnum<
|
|
50
|
+
typeof ActionReviewedStreamingEventType
|
|
51
|
+
> = z.nativeEnum(ActionReviewedStreamingEventType);
|
|
52
|
+
/** @internal */
|
|
53
|
+
export const ActionReviewedStreamingEventType$outboundSchema: z.ZodNativeEnum<
|
|
54
|
+
typeof ActionReviewedStreamingEventType
|
|
55
|
+
> = ActionReviewedStreamingEventType$inboundSchema;
|
|
56
|
+
|
|
57
|
+
/** @internal */
|
|
58
|
+
export const Review$inboundSchema: z.ZodNativeEnum<typeof Review> = z
|
|
59
|
+
.nativeEnum(Review);
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const Review$outboundSchema: z.ZodNativeEnum<typeof Review> =
|
|
62
|
+
Review$inboundSchema;
|
|
63
|
+
|
|
64
|
+
/** @internal */
|
|
65
|
+
export const ActionReviewedStreamingEventData$inboundSchema: z.ZodType<
|
|
66
|
+
ActionReviewedStreamingEventData,
|
|
67
|
+
z.ZodTypeDef,
|
|
68
|
+
unknown
|
|
69
|
+
> = z.object({
|
|
70
|
+
agent_id: z.string(),
|
|
71
|
+
action_id: z.string(),
|
|
72
|
+
agent_tool_call_id: z.string(),
|
|
73
|
+
review: Review$inboundSchema,
|
|
74
|
+
mock_output: z.record(z.any()).optional(),
|
|
75
|
+
review_source: z.string().optional(),
|
|
76
|
+
reviewed_by_id: z.string().optional(),
|
|
77
|
+
workflowRunId: z.string(),
|
|
78
|
+
}).transform((v) => {
|
|
79
|
+
return remap$(v, {
|
|
80
|
+
"agent_id": "agentId",
|
|
81
|
+
"action_id": "actionId",
|
|
82
|
+
"agent_tool_call_id": "agentToolCallId",
|
|
83
|
+
"mock_output": "mockOutput",
|
|
84
|
+
"review_source": "reviewSource",
|
|
85
|
+
"reviewed_by_id": "reviewedById",
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
/** @internal */
|
|
89
|
+
export type ActionReviewedStreamingEventData$Outbound = {
|
|
90
|
+
agent_id: string;
|
|
91
|
+
action_id: string;
|
|
92
|
+
agent_tool_call_id: string;
|
|
93
|
+
review: string;
|
|
94
|
+
mock_output?: { [k: string]: any } | undefined;
|
|
95
|
+
review_source?: string | undefined;
|
|
96
|
+
reviewed_by_id?: string | undefined;
|
|
97
|
+
workflowRunId: string;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export const ActionReviewedStreamingEventData$outboundSchema: z.ZodType<
|
|
102
|
+
ActionReviewedStreamingEventData$Outbound,
|
|
103
|
+
z.ZodTypeDef,
|
|
104
|
+
ActionReviewedStreamingEventData
|
|
105
|
+
> = z.object({
|
|
106
|
+
agentId: z.string(),
|
|
107
|
+
actionId: z.string(),
|
|
108
|
+
agentToolCallId: z.string(),
|
|
109
|
+
review: Review$outboundSchema,
|
|
110
|
+
mockOutput: z.record(z.any()).optional(),
|
|
111
|
+
reviewSource: z.string().optional(),
|
|
112
|
+
reviewedById: z.string().optional(),
|
|
113
|
+
workflowRunId: z.string(),
|
|
114
|
+
}).transform((v) => {
|
|
115
|
+
return remap$(v, {
|
|
116
|
+
agentId: "agent_id",
|
|
117
|
+
actionId: "action_id",
|
|
118
|
+
agentToolCallId: "agent_tool_call_id",
|
|
119
|
+
mockOutput: "mock_output",
|
|
120
|
+
reviewSource: "review_source",
|
|
121
|
+
reviewedById: "reviewed_by_id",
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export function actionReviewedStreamingEventDataToJSON(
|
|
126
|
+
actionReviewedStreamingEventData: ActionReviewedStreamingEventData,
|
|
127
|
+
): string {
|
|
128
|
+
return JSON.stringify(
|
|
129
|
+
ActionReviewedStreamingEventData$outboundSchema.parse(
|
|
130
|
+
actionReviewedStreamingEventData,
|
|
131
|
+
),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export function actionReviewedStreamingEventDataFromJSON(
|
|
135
|
+
jsonString: string,
|
|
136
|
+
): SafeParseResult<ActionReviewedStreamingEventData, SDKValidationError> {
|
|
137
|
+
return safeParse(
|
|
138
|
+
jsonString,
|
|
139
|
+
(x) => ActionReviewedStreamingEventData$inboundSchema.parse(JSON.parse(x)),
|
|
140
|
+
`Failed to parse 'ActionReviewedStreamingEventData' from JSON`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** @internal */
|
|
145
|
+
export const ActionReviewedStreamingEvent$inboundSchema: z.ZodType<
|
|
146
|
+
ActionReviewedStreamingEvent,
|
|
147
|
+
z.ZodTypeDef,
|
|
148
|
+
unknown
|
|
149
|
+
> = z.object({
|
|
150
|
+
type: ActionReviewedStreamingEventType$inboundSchema,
|
|
151
|
+
timestamp: z.string(),
|
|
152
|
+
data: z.lazy(() => ActionReviewedStreamingEventData$inboundSchema),
|
|
153
|
+
});
|
|
154
|
+
/** @internal */
|
|
155
|
+
export type ActionReviewedStreamingEvent$Outbound = {
|
|
156
|
+
type: string;
|
|
157
|
+
timestamp: string;
|
|
158
|
+
data: ActionReviewedStreamingEventData$Outbound;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
/** @internal */
|
|
162
|
+
export const ActionReviewedStreamingEvent$outboundSchema: z.ZodType<
|
|
163
|
+
ActionReviewedStreamingEvent$Outbound,
|
|
164
|
+
z.ZodTypeDef,
|
|
165
|
+
ActionReviewedStreamingEvent
|
|
166
|
+
> = z.object({
|
|
167
|
+
type: ActionReviewedStreamingEventType$outboundSchema,
|
|
168
|
+
timestamp: z.string(),
|
|
169
|
+
data: z.lazy(() => ActionReviewedStreamingEventData$outboundSchema),
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
export function actionReviewedStreamingEventToJSON(
|
|
173
|
+
actionReviewedStreamingEvent: ActionReviewedStreamingEvent,
|
|
174
|
+
): string {
|
|
175
|
+
return JSON.stringify(
|
|
176
|
+
ActionReviewedStreamingEvent$outboundSchema.parse(
|
|
177
|
+
actionReviewedStreamingEvent,
|
|
178
|
+
),
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
export function actionReviewedStreamingEventFromJSON(
|
|
182
|
+
jsonString: string,
|
|
183
|
+
): SafeParseResult<ActionReviewedStreamingEvent, SDKValidationError> {
|
|
184
|
+
return safeParse(
|
|
185
|
+
jsonString,
|
|
186
|
+
(x) => ActionReviewedStreamingEvent$inboundSchema.parse(JSON.parse(x)),
|
|
187
|
+
`Failed to parse 'ActionReviewedStreamingEvent' from JSON`,
|
|
188
|
+
);
|
|
189
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
|
|
12
|
+
export const ActionReviewRequestedStreamingEventType = {
|
|
13
|
+
EventAgentsActionReviewRequested: "event.agents.action_review_requested",
|
|
14
|
+
} as const;
|
|
15
|
+
export type ActionReviewRequestedStreamingEventType = ClosedEnum<
|
|
16
|
+
typeof ActionReviewRequestedStreamingEventType
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
export type Conditions = {
|
|
20
|
+
/**
|
|
21
|
+
* The argument of the tool call to evaluate
|
|
22
|
+
*/
|
|
23
|
+
condition: string;
|
|
24
|
+
/**
|
|
25
|
+
* The operator to use
|
|
26
|
+
*/
|
|
27
|
+
operator: string;
|
|
28
|
+
/**
|
|
29
|
+
* The value to compare against
|
|
30
|
+
*/
|
|
31
|
+
value: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type Tool = {
|
|
35
|
+
/**
|
|
36
|
+
* The id of the resource
|
|
37
|
+
*/
|
|
38
|
+
id: string;
|
|
39
|
+
/**
|
|
40
|
+
* Optional tool key for custom tools
|
|
41
|
+
*/
|
|
42
|
+
key?: string | undefined;
|
|
43
|
+
actionType: string;
|
|
44
|
+
displayName?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Optional tool description
|
|
47
|
+
*/
|
|
48
|
+
description?: string | undefined;
|
|
49
|
+
requiresApproval?: boolean | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Nested tool ID for MCP tools (identifies specific tool within MCP server)
|
|
52
|
+
*/
|
|
53
|
+
toolId?: string | undefined;
|
|
54
|
+
conditions?: Array<Conditions> | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* Tool execution timeout in seconds (default: 2 minutes, max: 10 minutes)
|
|
57
|
+
*/
|
|
58
|
+
timeout?: number | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type ActionReviewRequestedStreamingEventData = {
|
|
62
|
+
agentId: string;
|
|
63
|
+
actionId: string;
|
|
64
|
+
requiresApproval: boolean;
|
|
65
|
+
tool: Tool;
|
|
66
|
+
input: { [k: string]: any };
|
|
67
|
+
agentToolCallId: string;
|
|
68
|
+
responseId?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Emitted when a tool action requires approval before execution. Contains the tool details, input arguments, and whether approval is mandatory.
|
|
73
|
+
*/
|
|
74
|
+
export type ActionReviewRequestedStreamingEvent = {
|
|
75
|
+
type: ActionReviewRequestedStreamingEventType;
|
|
76
|
+
/**
|
|
77
|
+
* ISO timestamp of the event
|
|
78
|
+
*/
|
|
79
|
+
timestamp: string;
|
|
80
|
+
data: ActionReviewRequestedStreamingEventData;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const ActionReviewRequestedStreamingEventType$inboundSchema:
|
|
85
|
+
z.ZodNativeEnum<typeof ActionReviewRequestedStreamingEventType> = z
|
|
86
|
+
.nativeEnum(ActionReviewRequestedStreamingEventType);
|
|
87
|
+
/** @internal */
|
|
88
|
+
export const ActionReviewRequestedStreamingEventType$outboundSchema:
|
|
89
|
+
z.ZodNativeEnum<typeof ActionReviewRequestedStreamingEventType> =
|
|
90
|
+
ActionReviewRequestedStreamingEventType$inboundSchema;
|
|
91
|
+
|
|
92
|
+
/** @internal */
|
|
93
|
+
export const Conditions$inboundSchema: z.ZodType<
|
|
94
|
+
Conditions,
|
|
95
|
+
z.ZodTypeDef,
|
|
96
|
+
unknown
|
|
97
|
+
> = z.object({
|
|
98
|
+
condition: z.string(),
|
|
99
|
+
operator: z.string(),
|
|
100
|
+
value: z.string(),
|
|
101
|
+
});
|
|
102
|
+
/** @internal */
|
|
103
|
+
export type Conditions$Outbound = {
|
|
104
|
+
condition: string;
|
|
105
|
+
operator: string;
|
|
106
|
+
value: string;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
/** @internal */
|
|
110
|
+
export const Conditions$outboundSchema: z.ZodType<
|
|
111
|
+
Conditions$Outbound,
|
|
112
|
+
z.ZodTypeDef,
|
|
113
|
+
Conditions
|
|
114
|
+
> = z.object({
|
|
115
|
+
condition: z.string(),
|
|
116
|
+
operator: z.string(),
|
|
117
|
+
value: z.string(),
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export function conditionsToJSON(conditions: Conditions): string {
|
|
121
|
+
return JSON.stringify(Conditions$outboundSchema.parse(conditions));
|
|
122
|
+
}
|
|
123
|
+
export function conditionsFromJSON(
|
|
124
|
+
jsonString: string,
|
|
125
|
+
): SafeParseResult<Conditions, SDKValidationError> {
|
|
126
|
+
return safeParse(
|
|
127
|
+
jsonString,
|
|
128
|
+
(x) => Conditions$inboundSchema.parse(JSON.parse(x)),
|
|
129
|
+
`Failed to parse 'Conditions' from JSON`,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const Tool$inboundSchema: z.ZodType<Tool, z.ZodTypeDef, unknown> = z
|
|
135
|
+
.object({
|
|
136
|
+
id: z.string(),
|
|
137
|
+
key: z.string().optional(),
|
|
138
|
+
action_type: z.string(),
|
|
139
|
+
display_name: z.string().optional(),
|
|
140
|
+
description: z.string().optional(),
|
|
141
|
+
requires_approval: z.boolean().default(false),
|
|
142
|
+
tool_id: z.string().optional(),
|
|
143
|
+
conditions: z.array(z.lazy(() => Conditions$inboundSchema)).optional(),
|
|
144
|
+
timeout: z.number().default(120),
|
|
145
|
+
}).transform((v) => {
|
|
146
|
+
return remap$(v, {
|
|
147
|
+
"action_type": "actionType",
|
|
148
|
+
"display_name": "displayName",
|
|
149
|
+
"requires_approval": "requiresApproval",
|
|
150
|
+
"tool_id": "toolId",
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
/** @internal */
|
|
154
|
+
export type Tool$Outbound = {
|
|
155
|
+
id: string;
|
|
156
|
+
key?: string | undefined;
|
|
157
|
+
action_type: string;
|
|
158
|
+
display_name?: string | undefined;
|
|
159
|
+
description?: string | undefined;
|
|
160
|
+
requires_approval: boolean;
|
|
161
|
+
tool_id?: string | undefined;
|
|
162
|
+
conditions?: Array<Conditions$Outbound> | undefined;
|
|
163
|
+
timeout: number;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/** @internal */
|
|
167
|
+
export const Tool$outboundSchema: z.ZodType<Tool$Outbound, z.ZodTypeDef, Tool> =
|
|
168
|
+
z.object({
|
|
169
|
+
id: z.string(),
|
|
170
|
+
key: z.string().optional(),
|
|
171
|
+
actionType: z.string(),
|
|
172
|
+
displayName: z.string().optional(),
|
|
173
|
+
description: z.string().optional(),
|
|
174
|
+
requiresApproval: z.boolean().default(false),
|
|
175
|
+
toolId: z.string().optional(),
|
|
176
|
+
conditions: z.array(z.lazy(() => Conditions$outboundSchema)).optional(),
|
|
177
|
+
timeout: z.number().default(120),
|
|
178
|
+
}).transform((v) => {
|
|
179
|
+
return remap$(v, {
|
|
180
|
+
actionType: "action_type",
|
|
181
|
+
displayName: "display_name",
|
|
182
|
+
requiresApproval: "requires_approval",
|
|
183
|
+
toolId: "tool_id",
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
export function toolToJSON(tool: Tool): string {
|
|
188
|
+
return JSON.stringify(Tool$outboundSchema.parse(tool));
|
|
189
|
+
}
|
|
190
|
+
export function toolFromJSON(
|
|
191
|
+
jsonString: string,
|
|
192
|
+
): SafeParseResult<Tool, SDKValidationError> {
|
|
193
|
+
return safeParse(
|
|
194
|
+
jsonString,
|
|
195
|
+
(x) => Tool$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
+
`Failed to parse 'Tool' from JSON`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** @internal */
|
|
201
|
+
export const ActionReviewRequestedStreamingEventData$inboundSchema: z.ZodType<
|
|
202
|
+
ActionReviewRequestedStreamingEventData,
|
|
203
|
+
z.ZodTypeDef,
|
|
204
|
+
unknown
|
|
205
|
+
> = z.object({
|
|
206
|
+
agent_id: z.string(),
|
|
207
|
+
action_id: z.string(),
|
|
208
|
+
requires_approval: z.boolean(),
|
|
209
|
+
tool: z.lazy(() => Tool$inboundSchema),
|
|
210
|
+
input: z.record(z.any()),
|
|
211
|
+
agent_tool_call_id: z.string(),
|
|
212
|
+
responseId: z.string().optional(),
|
|
213
|
+
}).transform((v) => {
|
|
214
|
+
return remap$(v, {
|
|
215
|
+
"agent_id": "agentId",
|
|
216
|
+
"action_id": "actionId",
|
|
217
|
+
"requires_approval": "requiresApproval",
|
|
218
|
+
"agent_tool_call_id": "agentToolCallId",
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
/** @internal */
|
|
222
|
+
export type ActionReviewRequestedStreamingEventData$Outbound = {
|
|
223
|
+
agent_id: string;
|
|
224
|
+
action_id: string;
|
|
225
|
+
requires_approval: boolean;
|
|
226
|
+
tool: Tool$Outbound;
|
|
227
|
+
input: { [k: string]: any };
|
|
228
|
+
agent_tool_call_id: string;
|
|
229
|
+
responseId?: string | undefined;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
/** @internal */
|
|
233
|
+
export const ActionReviewRequestedStreamingEventData$outboundSchema: z.ZodType<
|
|
234
|
+
ActionReviewRequestedStreamingEventData$Outbound,
|
|
235
|
+
z.ZodTypeDef,
|
|
236
|
+
ActionReviewRequestedStreamingEventData
|
|
237
|
+
> = z.object({
|
|
238
|
+
agentId: z.string(),
|
|
239
|
+
actionId: z.string(),
|
|
240
|
+
requiresApproval: z.boolean(),
|
|
241
|
+
tool: z.lazy(() => Tool$outboundSchema),
|
|
242
|
+
input: z.record(z.any()),
|
|
243
|
+
agentToolCallId: z.string(),
|
|
244
|
+
responseId: z.string().optional(),
|
|
245
|
+
}).transform((v) => {
|
|
246
|
+
return remap$(v, {
|
|
247
|
+
agentId: "agent_id",
|
|
248
|
+
actionId: "action_id",
|
|
249
|
+
requiresApproval: "requires_approval",
|
|
250
|
+
agentToolCallId: "agent_tool_call_id",
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
export function actionReviewRequestedStreamingEventDataToJSON(
|
|
255
|
+
actionReviewRequestedStreamingEventData:
|
|
256
|
+
ActionReviewRequestedStreamingEventData,
|
|
257
|
+
): string {
|
|
258
|
+
return JSON.stringify(
|
|
259
|
+
ActionReviewRequestedStreamingEventData$outboundSchema.parse(
|
|
260
|
+
actionReviewRequestedStreamingEventData,
|
|
261
|
+
),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
export function actionReviewRequestedStreamingEventDataFromJSON(
|
|
265
|
+
jsonString: string,
|
|
266
|
+
): SafeParseResult<
|
|
267
|
+
ActionReviewRequestedStreamingEventData,
|
|
268
|
+
SDKValidationError
|
|
269
|
+
> {
|
|
270
|
+
return safeParse(
|
|
271
|
+
jsonString,
|
|
272
|
+
(x) =>
|
|
273
|
+
ActionReviewRequestedStreamingEventData$inboundSchema.parse(
|
|
274
|
+
JSON.parse(x),
|
|
275
|
+
),
|
|
276
|
+
`Failed to parse 'ActionReviewRequestedStreamingEventData' from JSON`,
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** @internal */
|
|
281
|
+
export const ActionReviewRequestedStreamingEvent$inboundSchema: z.ZodType<
|
|
282
|
+
ActionReviewRequestedStreamingEvent,
|
|
283
|
+
z.ZodTypeDef,
|
|
284
|
+
unknown
|
|
285
|
+
> = z.object({
|
|
286
|
+
type: ActionReviewRequestedStreamingEventType$inboundSchema,
|
|
287
|
+
timestamp: z.string(),
|
|
288
|
+
data: z.lazy(() => ActionReviewRequestedStreamingEventData$inboundSchema),
|
|
289
|
+
});
|
|
290
|
+
/** @internal */
|
|
291
|
+
export type ActionReviewRequestedStreamingEvent$Outbound = {
|
|
292
|
+
type: string;
|
|
293
|
+
timestamp: string;
|
|
294
|
+
data: ActionReviewRequestedStreamingEventData$Outbound;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
/** @internal */
|
|
298
|
+
export const ActionReviewRequestedStreamingEvent$outboundSchema: z.ZodType<
|
|
299
|
+
ActionReviewRequestedStreamingEvent$Outbound,
|
|
300
|
+
z.ZodTypeDef,
|
|
301
|
+
ActionReviewRequestedStreamingEvent
|
|
302
|
+
> = z.object({
|
|
303
|
+
type: ActionReviewRequestedStreamingEventType$outboundSchema,
|
|
304
|
+
timestamp: z.string(),
|
|
305
|
+
data: z.lazy(() => ActionReviewRequestedStreamingEventData$outboundSchema),
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
export function actionReviewRequestedStreamingEventToJSON(
|
|
309
|
+
actionReviewRequestedStreamingEvent: ActionReviewRequestedStreamingEvent,
|
|
310
|
+
): string {
|
|
311
|
+
return JSON.stringify(
|
|
312
|
+
ActionReviewRequestedStreamingEvent$outboundSchema.parse(
|
|
313
|
+
actionReviewRequestedStreamingEvent,
|
|
314
|
+
),
|
|
315
|
+
);
|
|
316
|
+
}
|
|
317
|
+
export function actionReviewRequestedStreamingEventFromJSON(
|
|
318
|
+
jsonString: string,
|
|
319
|
+
): SafeParseResult<ActionReviewRequestedStreamingEvent, SDKValidationError> {
|
|
320
|
+
return safeParse(
|
|
321
|
+
jsonString,
|
|
322
|
+
(x) =>
|
|
323
|
+
ActionReviewRequestedStreamingEvent$inboundSchema.parse(JSON.parse(x)),
|
|
324
|
+
`Failed to parse 'ActionReviewRequestedStreamingEvent' from JSON`,
|
|
325
|
+
);
|
|
326
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export const AgentErroredStreamingEventType = {
|
|
12
|
+
EventAgentsErrored: "event.agents.errored",
|
|
13
|
+
} as const;
|
|
14
|
+
export type AgentErroredStreamingEventType = ClosedEnum<
|
|
15
|
+
typeof AgentErroredStreamingEventType
|
|
16
|
+
>;
|
|
17
|
+
|
|
18
|
+
export type AgentErroredStreamingEventData = {
|
|
19
|
+
error: string;
|
|
20
|
+
code: number;
|
|
21
|
+
/**
|
|
22
|
+
* ID of the response tracking this execution
|
|
23
|
+
*/
|
|
24
|
+
responseId?: string | undefined;
|
|
25
|
+
workflowRunId: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Emitted when an error occurs during agent execution. Contains the error message and HTTP status code indicating the failure type.
|
|
30
|
+
*/
|
|
31
|
+
export type AgentErroredStreamingEvent = {
|
|
32
|
+
type: AgentErroredStreamingEventType;
|
|
33
|
+
/**
|
|
34
|
+
* ISO timestamp of the event
|
|
35
|
+
*/
|
|
36
|
+
timestamp: string;
|
|
37
|
+
data: AgentErroredStreamingEventData;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/** @internal */
|
|
41
|
+
export const AgentErroredStreamingEventType$inboundSchema: z.ZodNativeEnum<
|
|
42
|
+
typeof AgentErroredStreamingEventType
|
|
43
|
+
> = z.nativeEnum(AgentErroredStreamingEventType);
|
|
44
|
+
/** @internal */
|
|
45
|
+
export const AgentErroredStreamingEventType$outboundSchema: z.ZodNativeEnum<
|
|
46
|
+
typeof AgentErroredStreamingEventType
|
|
47
|
+
> = AgentErroredStreamingEventType$inboundSchema;
|
|
48
|
+
|
|
49
|
+
/** @internal */
|
|
50
|
+
export const AgentErroredStreamingEventData$inboundSchema: z.ZodType<
|
|
51
|
+
AgentErroredStreamingEventData,
|
|
52
|
+
z.ZodTypeDef,
|
|
53
|
+
unknown
|
|
54
|
+
> = z.object({
|
|
55
|
+
error: z.string(),
|
|
56
|
+
code: z.number(),
|
|
57
|
+
responseId: z.string().optional(),
|
|
58
|
+
workflowRunId: z.string(),
|
|
59
|
+
});
|
|
60
|
+
/** @internal */
|
|
61
|
+
export type AgentErroredStreamingEventData$Outbound = {
|
|
62
|
+
error: string;
|
|
63
|
+
code: number;
|
|
64
|
+
responseId?: string | undefined;
|
|
65
|
+
workflowRunId: string;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/** @internal */
|
|
69
|
+
export const AgentErroredStreamingEventData$outboundSchema: z.ZodType<
|
|
70
|
+
AgentErroredStreamingEventData$Outbound,
|
|
71
|
+
z.ZodTypeDef,
|
|
72
|
+
AgentErroredStreamingEventData
|
|
73
|
+
> = z.object({
|
|
74
|
+
error: z.string(),
|
|
75
|
+
code: z.number(),
|
|
76
|
+
responseId: z.string().optional(),
|
|
77
|
+
workflowRunId: z.string(),
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export function agentErroredStreamingEventDataToJSON(
|
|
81
|
+
agentErroredStreamingEventData: AgentErroredStreamingEventData,
|
|
82
|
+
): string {
|
|
83
|
+
return JSON.stringify(
|
|
84
|
+
AgentErroredStreamingEventData$outboundSchema.parse(
|
|
85
|
+
agentErroredStreamingEventData,
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
export function agentErroredStreamingEventDataFromJSON(
|
|
90
|
+
jsonString: string,
|
|
91
|
+
): SafeParseResult<AgentErroredStreamingEventData, SDKValidationError> {
|
|
92
|
+
return safeParse(
|
|
93
|
+
jsonString,
|
|
94
|
+
(x) => AgentErroredStreamingEventData$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'AgentErroredStreamingEventData' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/** @internal */
|
|
100
|
+
export const AgentErroredStreamingEvent$inboundSchema: z.ZodType<
|
|
101
|
+
AgentErroredStreamingEvent,
|
|
102
|
+
z.ZodTypeDef,
|
|
103
|
+
unknown
|
|
104
|
+
> = z.object({
|
|
105
|
+
type: AgentErroredStreamingEventType$inboundSchema,
|
|
106
|
+
timestamp: z.string(),
|
|
107
|
+
data: z.lazy(() => AgentErroredStreamingEventData$inboundSchema),
|
|
108
|
+
});
|
|
109
|
+
/** @internal */
|
|
110
|
+
export type AgentErroredStreamingEvent$Outbound = {
|
|
111
|
+
type: string;
|
|
112
|
+
timestamp: string;
|
|
113
|
+
data: AgentErroredStreamingEventData$Outbound;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/** @internal */
|
|
117
|
+
export const AgentErroredStreamingEvent$outboundSchema: z.ZodType<
|
|
118
|
+
AgentErroredStreamingEvent$Outbound,
|
|
119
|
+
z.ZodTypeDef,
|
|
120
|
+
AgentErroredStreamingEvent
|
|
121
|
+
> = z.object({
|
|
122
|
+
type: AgentErroredStreamingEventType$outboundSchema,
|
|
123
|
+
timestamp: z.string(),
|
|
124
|
+
data: z.lazy(() => AgentErroredStreamingEventData$outboundSchema),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export function agentErroredStreamingEventToJSON(
|
|
128
|
+
agentErroredStreamingEvent: AgentErroredStreamingEvent,
|
|
129
|
+
): string {
|
|
130
|
+
return JSON.stringify(
|
|
131
|
+
AgentErroredStreamingEvent$outboundSchema.parse(agentErroredStreamingEvent),
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export function agentErroredStreamingEventFromJSON(
|
|
135
|
+
jsonString: string,
|
|
136
|
+
): SafeParseResult<AgentErroredStreamingEvent, SDKValidationError> {
|
|
137
|
+
return safeParse(
|
|
138
|
+
jsonString,
|
|
139
|
+
(x) => AgentErroredStreamingEvent$inboundSchema.parse(JSON.parse(x)),
|
|
140
|
+
`Failed to parse 'AgentErroredStreamingEvent' from JSON`,
|
|
141
|
+
);
|
|
142
|
+
}
|