@meistrari/agent-sdk 0.3.1 → 0.4.0
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/README.md +82 -4
- package/dist/index.cjs +52 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.mjs +53 -3
- package/dist/schemas.cjs +131 -1
- package/dist/schemas.d.cts +3 -2
- package/dist/schemas.d.mts +3 -2
- package/dist/schemas.d.ts +3 -2
- package/dist/schemas.mjs +120 -2
- package/dist/shared/{agent-sdk.3fcc7aba.d.cts → agent-sdk.dc5630ec.d.cts} +153 -4
- package/dist/shared/{agent-sdk.3fcc7aba.d.mts → agent-sdk.dc5630ec.d.mts} +153 -4
- package/dist/shared/{agent-sdk.3fcc7aba.d.ts → agent-sdk.dc5630ec.d.ts} +153 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -93,6 +93,83 @@ Multi-turn lifecycle rules:
|
|
|
93
93
|
- Treat `completed`, `failed`, and `cancelled` as non-normal follow-up states in SDK consumers.
|
|
94
94
|
- The SDK v4 path does not use the legacy `/v3/sessions/{sessionId}/continue` endpoint.
|
|
95
95
|
|
|
96
|
+
### Cancel a running session
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
const cancellation = await client.cancelSession(sessionId)
|
|
100
|
+
|
|
101
|
+
if (cancellation.success)
|
|
102
|
+
console.log(cancellation.message) // 'Message cancelled'
|
|
103
|
+
else
|
|
104
|
+
console.error(cancellation.error)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`cancelSession` aborts the active turn (the model stops generating, ending token spend)
|
|
108
|
+
and restores the session to a continuable state: `waiting_messages` for multi-turn
|
|
109
|
+
sessions, `cancelled` for single-shot runs. A session that is not currently `running`
|
|
110
|
+
rejects with a `FetchError` (HTTP 409); branch on it with `isFetchError`.
|
|
111
|
+
|
|
112
|
+
### Register session webhooks
|
|
113
|
+
|
|
114
|
+
Pass `webhooks` to `executeAgent` to receive lifecycle callbacks instead of polling.
|
|
115
|
+
Each entry takes an HTTPS `url`, an optional `events` filter, and an optional HMAC
|
|
116
|
+
`secret`:
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import type { SessionWebhookEventPayload } from '@meistrari/agent-sdk'
|
|
120
|
+
|
|
121
|
+
const { success, sessionId } = await client.executeAgent({
|
|
122
|
+
organizationName: 'acme',
|
|
123
|
+
repository: 'support-bot',
|
|
124
|
+
message: 'Summarize the latest tickets',
|
|
125
|
+
webhooks: [{
|
|
126
|
+
url: 'https://example.com/hooks/agent-session',
|
|
127
|
+
events: ['session.completed', 'session.failed', 'session.cancelled'],
|
|
128
|
+
secret: 'whsec_a-long-random-string',
|
|
129
|
+
}],
|
|
130
|
+
})
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Webhook semantics (full contract in [`docs/webhooks.md`](../../docs/webhooks.md)):
|
|
134
|
+
|
|
135
|
+
- Available on the v4 execute path only; up to **5 webhooks** per session.
|
|
136
|
+
- URLs must be HTTPS; localhost, `.local`/`.internal`, and private/loopback IP hosts are rejected.
|
|
137
|
+
- `events` defaults to **all `session.*` events** (`started`, `completed`, `failed`,
|
|
138
|
+
`cancelled`, `waiting_messages`); `subagent.started`/`subagent.completed` must be opted into.
|
|
139
|
+
- Passing `webhooks` on a continuation **replaces** the registered set; omitting it keeps
|
|
140
|
+
the existing registration.
|
|
141
|
+
- Deliveries are **at-least-once** with retries — make handlers idempotent.
|
|
142
|
+
- The payload (`SessionWebhookEventPayload`) is lightweight metadata: `eventType`,
|
|
143
|
+
`sessionId`, `runId`, `status`, `error`, `usage`, `subagent`, `deliveryId`. Fetch content
|
|
144
|
+
with `streamSession` or `fetchTimeline`.
|
|
145
|
+
|
|
146
|
+
When a `secret` is configured, verify the `x-tela-agent-webhook-signature` header with the bundled
|
|
147
|
+
helper (Web Crypto, works in Node/Bun/edge runtimes):
|
|
148
|
+
|
|
149
|
+
```ts
|
|
150
|
+
import { verifyWebhookSignature } from '@meistrari/agent-sdk'
|
|
151
|
+
|
|
152
|
+
app.post('/hooks/agent-session', async (req) => {
|
|
153
|
+
const rawBody = await req.text()
|
|
154
|
+
const valid = await verifyWebhookSignature(
|
|
155
|
+
rawBody,
|
|
156
|
+
req.headers.get('x-tela-agent-webhook-signature'),
|
|
157
|
+
process.env.WEBHOOK_SECRET!,
|
|
158
|
+
)
|
|
159
|
+
if (!valid)
|
|
160
|
+
return new Response('invalid signature', { status: 401 })
|
|
161
|
+
|
|
162
|
+
const event = JSON.parse(rawBody) as SessionWebhookEventPayload
|
|
163
|
+
// ...
|
|
164
|
+
return new Response('ok')
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
For [Trigger.dev wait-for-token](../../docs/trigger-dev-wait-token.md) flows, pass the
|
|
169
|
+
token's callback URL as a webhook filtered to terminal events — no `secret` needed (auth
|
|
170
|
+
is embedded in the token URL), and the waiting task resumes with the payload as the token
|
|
171
|
+
output.
|
|
172
|
+
|
|
96
173
|
### Update an agent model
|
|
97
174
|
|
|
98
175
|
```ts
|
|
@@ -147,7 +224,8 @@ This package mirrors `@meistrari/vault-sdk` and is published as `UNLICENSED`.
|
|
|
147
224
|
|
|
148
225
|
## Scope
|
|
149
226
|
|
|
150
|
-
Focused on sandbox execution and the public v4 consumer paths: `executeAgent
|
|
151
|
-
`streamSession`, `
|
|
152
|
-
|
|
153
|
-
|
|
227
|
+
Focused on sandbox execution and the public v4 consumer paths: `executeAgent` (including
|
|
228
|
+
session webhook registration), `streamSession`, `cancelSession`, `updateAgentModel`,
|
|
229
|
+
`fetchTimeline`, `resolveReference`, and webhook signature verification via
|
|
230
|
+
`verifyWebhookSignature`. Agent CRUD, legacy polling, and the internal sandbox timeline
|
|
231
|
+
callback are intentionally out of scope.
|
package/dist/index.cjs
CHANGED
|
@@ -231,6 +231,14 @@ function agentClient(config) {
|
|
|
231
231
|
});
|
|
232
232
|
return schemas.sessionTimelineResponseSchema.parse(await response.json());
|
|
233
233
|
}
|
|
234
|
+
async function cancelSession(sessionId) {
|
|
235
|
+
const parsedSessionId = schemas.sessionTimelineIdSchema.parse(sessionId);
|
|
236
|
+
const response = await request({
|
|
237
|
+
method: "POST",
|
|
238
|
+
path: `/v4/sessions/${encodeURIComponent(parsedSessionId)}/cancel`
|
|
239
|
+
});
|
|
240
|
+
return schemas.cancelSessionResponseSchema.parse(await response.json());
|
|
241
|
+
}
|
|
234
242
|
async function streamSession(sessionId, options) {
|
|
235
243
|
const response = await request({
|
|
236
244
|
method: "GET",
|
|
@@ -267,7 +275,49 @@ function agentClient(config) {
|
|
|
267
275
|
return JSON.parse(await vaultFile.content.text());
|
|
268
276
|
return vaultFile.content.arrayBuffer();
|
|
269
277
|
}
|
|
270
|
-
return { executeAgent, updateAgentModel, fetchTimeline, streamSession, resolveReference };
|
|
278
|
+
return { executeAgent, updateAgentModel, fetchTimeline, cancelSession, streamSession, resolveReference };
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const SIGNATURE_PREFIX = "sha256=";
|
|
282
|
+
function toBytes(rawBody) {
|
|
283
|
+
if (typeof rawBody === "string") {
|
|
284
|
+
return new TextEncoder().encode(rawBody);
|
|
285
|
+
}
|
|
286
|
+
const copy = new Uint8Array(rawBody.byteLength);
|
|
287
|
+
copy.set(rawBody);
|
|
288
|
+
return copy;
|
|
289
|
+
}
|
|
290
|
+
function toHex(buffer) {
|
|
291
|
+
return Array.from(new Uint8Array(buffer), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
292
|
+
}
|
|
293
|
+
function timingSafeEqualStrings(a, b) {
|
|
294
|
+
if (a.length !== b.length) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
let mismatch = 0;
|
|
298
|
+
for (let index = 0; index < a.length; index++) {
|
|
299
|
+
mismatch |= a.charCodeAt(index) ^ b.charCodeAt(index);
|
|
300
|
+
}
|
|
301
|
+
return mismatch === 0;
|
|
302
|
+
}
|
|
303
|
+
async function verifyWebhookSignature(rawBody, signatureHeader, secret) {
|
|
304
|
+
if (!signatureHeader || !signatureHeader.startsWith(SIGNATURE_PREFIX) || !secret) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
try {
|
|
308
|
+
const key = await crypto.subtle.importKey(
|
|
309
|
+
"raw",
|
|
310
|
+
new TextEncoder().encode(secret),
|
|
311
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
312
|
+
false,
|
|
313
|
+
["sign"]
|
|
314
|
+
);
|
|
315
|
+
const digest = await crypto.subtle.sign("HMAC", key, toBytes(rawBody));
|
|
316
|
+
const expected = `${SIGNATURE_PREFIX}${toHex(digest)}`;
|
|
317
|
+
return timingSafeEqualStrings(signatureHeader, expected);
|
|
318
|
+
} catch {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
271
321
|
}
|
|
272
322
|
|
|
273
323
|
exports.APIKeyAuthStrategy = APIKeyAuthStrategy;
|
|
@@ -278,3 +328,4 @@ exports.agentClient = agentClient;
|
|
|
278
328
|
exports.isFetchError = isFetchError;
|
|
279
329
|
exports.isNetworkError = isNetworkError;
|
|
280
330
|
exports.parseSessionStream = parseSessionStream;
|
|
331
|
+
exports.verifyWebhookSignature = verifyWebhookSignature;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, c as SessionStreamEvent } from './shared/agent-sdk.
|
|
2
|
-
export { A as AgentInput, d as SessionStatus, T as TimelineEvent,
|
|
1
|
+
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, C as CancelSessionResponse, c as SessionStreamEvent } from './shared/agent-sdk.dc5630ec.cjs';
|
|
2
|
+
export { A as AgentInput, d as SessionStatus, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult } from './shared/agent-sdk.dc5630ec.cjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface AuthStrategy {
|
|
@@ -38,6 +38,7 @@ declare function agentClient(config: AgentClientConfig): {
|
|
|
38
38
|
executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
|
|
39
39
|
updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
|
|
40
40
|
fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
|
|
41
|
+
cancelSession: (sessionId: string) => Promise<CancelSessionResponse>;
|
|
41
42
|
streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
|
|
42
43
|
resolveReference: {
|
|
43
44
|
(reference: string, options?: {
|
|
@@ -78,5 +79,7 @@ declare function isNetworkError(error: unknown): error is NetworkError;
|
|
|
78
79
|
|
|
79
80
|
declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
declare function verifyWebhookSignature(rawBody: string | Uint8Array, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
|
|
83
|
+
|
|
84
|
+
export { APIKeyAuthStrategy, CancelSessionResponse, DataTokenAuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchError, NetworkError, SessionStreamEvent, SessionTimelineResponse, UpdateAgentModelRequest, UpdateAgentModelResponse, agentClient, isFetchError, isNetworkError, parseSessionStream, verifyWebhookSignature };
|
|
82
85
|
export type { AgentClient, AgentClientConfig, AgentRequestError, AuthStrategy, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, StreamSessionOptions };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, c as SessionStreamEvent } from './shared/agent-sdk.
|
|
2
|
-
export { A as AgentInput, d as SessionStatus, T as TimelineEvent,
|
|
1
|
+
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, C as CancelSessionResponse, c as SessionStreamEvent } from './shared/agent-sdk.dc5630ec.mjs';
|
|
2
|
+
export { A as AgentInput, d as SessionStatus, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult } from './shared/agent-sdk.dc5630ec.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface AuthStrategy {
|
|
@@ -38,6 +38,7 @@ declare function agentClient(config: AgentClientConfig): {
|
|
|
38
38
|
executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
|
|
39
39
|
updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
|
|
40
40
|
fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
|
|
41
|
+
cancelSession: (sessionId: string) => Promise<CancelSessionResponse>;
|
|
41
42
|
streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
|
|
42
43
|
resolveReference: {
|
|
43
44
|
(reference: string, options?: {
|
|
@@ -78,5 +79,7 @@ declare function isNetworkError(error: unknown): error is NetworkError;
|
|
|
78
79
|
|
|
79
80
|
declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
declare function verifyWebhookSignature(rawBody: string | Uint8Array, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
|
|
83
|
+
|
|
84
|
+
export { APIKeyAuthStrategy, CancelSessionResponse, DataTokenAuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchError, NetworkError, SessionStreamEvent, SessionTimelineResponse, UpdateAgentModelRequest, UpdateAgentModelResponse, agentClient, isFetchError, isNetworkError, parseSessionStream, verifyWebhookSignature };
|
|
82
85
|
export type { AgentClient, AgentClientConfig, AgentRequestError, AuthStrategy, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, StreamSessionOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, c as SessionStreamEvent } from './shared/agent-sdk.
|
|
2
|
-
export { A as AgentInput, d as SessionStatus, T as TimelineEvent,
|
|
1
|
+
import { E as ExecuteAgentRequest, a as ExecuteAgentResponse, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, S as SessionTimelineResponse, C as CancelSessionResponse, c as SessionStreamEvent } from './shared/agent-sdk.dc5630ec.js';
|
|
2
|
+
export { A as AgentInput, d as SessionStatus, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult } from './shared/agent-sdk.dc5630ec.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
interface AuthStrategy {
|
|
@@ -38,6 +38,7 @@ declare function agentClient(config: AgentClientConfig): {
|
|
|
38
38
|
executeAgent: (input: ExecuteAgentRequest) => Promise<ExecuteAgentResponse>;
|
|
39
39
|
updateAgentModel: (input: UpdateAgentModelRequest) => Promise<UpdateAgentModelResponse>;
|
|
40
40
|
fetchTimeline: (sessionId: string, options?: FetchTimelineOptions) => Promise<SessionTimelineResponse>;
|
|
41
|
+
cancelSession: (sessionId: string) => Promise<CancelSessionResponse>;
|
|
41
42
|
streamSession: (sessionId: string, options?: StreamSessionOptions) => Promise<AsyncIterable<SessionStreamEvent>>;
|
|
42
43
|
resolveReference: {
|
|
43
44
|
(reference: string, options?: {
|
|
@@ -78,5 +79,7 @@ declare function isNetworkError(error: unknown): error is NetworkError;
|
|
|
78
79
|
|
|
79
80
|
declare function parseSessionStream(stream: ReadableStream<Uint8Array>): AsyncIterable<SessionStreamEvent>;
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
declare function verifyWebhookSignature(rawBody: string | Uint8Array, signatureHeader: string | null | undefined, secret: string): Promise<boolean>;
|
|
83
|
+
|
|
84
|
+
export { APIKeyAuthStrategy, CancelSessionResponse, DataTokenAuthStrategy, ExecuteAgentRequest, ExecuteAgentResponse, FetchError, NetworkError, SessionStreamEvent, SessionTimelineResponse, UpdateAgentModelRequest, UpdateAgentModelResponse, agentClient, isFetchError, isNetworkError, parseSessionStream, verifyWebhookSignature };
|
|
82
85
|
export type { AgentClient, AgentClientConfig, AgentRequestError, AuthStrategy, FetchTimelineOptions, ResolveReferenceAs, ResolveReferenceOptions, StreamSessionOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VaultFile } from '@meistrari/vault-sdk';
|
|
2
|
-
import { SESSION_STREAM_EVENT_KINDS, sessionStreamEventSchema, executeAgentRequestSchema, executeAgentResponseSchema, updateAgentModelRequestSchema, updateAgentModelResponseSchema, sessionTimelineIdSchema, sessionTimelineResponseSchema } from './schemas.mjs';
|
|
2
|
+
import { SESSION_STREAM_EVENT_KINDS, sessionStreamEventSchema, executeAgentRequestSchema, executeAgentResponseSchema, updateAgentModelRequestSchema, updateAgentModelResponseSchema, sessionTimelineIdSchema, sessionTimelineResponseSchema, cancelSessionResponseSchema } from './schemas.mjs';
|
|
3
3
|
import 'zod';
|
|
4
4
|
|
|
5
5
|
var __defProp$1 = Object.defineProperty;
|
|
@@ -229,6 +229,14 @@ function agentClient(config) {
|
|
|
229
229
|
});
|
|
230
230
|
return sessionTimelineResponseSchema.parse(await response.json());
|
|
231
231
|
}
|
|
232
|
+
async function cancelSession(sessionId) {
|
|
233
|
+
const parsedSessionId = sessionTimelineIdSchema.parse(sessionId);
|
|
234
|
+
const response = await request({
|
|
235
|
+
method: "POST",
|
|
236
|
+
path: `/v4/sessions/${encodeURIComponent(parsedSessionId)}/cancel`
|
|
237
|
+
});
|
|
238
|
+
return cancelSessionResponseSchema.parse(await response.json());
|
|
239
|
+
}
|
|
232
240
|
async function streamSession(sessionId, options) {
|
|
233
241
|
const response = await request({
|
|
234
242
|
method: "GET",
|
|
@@ -265,7 +273,49 @@ function agentClient(config) {
|
|
|
265
273
|
return JSON.parse(await vaultFile.content.text());
|
|
266
274
|
return vaultFile.content.arrayBuffer();
|
|
267
275
|
}
|
|
268
|
-
return { executeAgent, updateAgentModel, fetchTimeline, streamSession, resolveReference };
|
|
276
|
+
return { executeAgent, updateAgentModel, fetchTimeline, cancelSession, streamSession, resolveReference };
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const SIGNATURE_PREFIX = "sha256=";
|
|
280
|
+
function toBytes(rawBody) {
|
|
281
|
+
if (typeof rawBody === "string") {
|
|
282
|
+
return new TextEncoder().encode(rawBody);
|
|
283
|
+
}
|
|
284
|
+
const copy = new Uint8Array(rawBody.byteLength);
|
|
285
|
+
copy.set(rawBody);
|
|
286
|
+
return copy;
|
|
287
|
+
}
|
|
288
|
+
function toHex(buffer) {
|
|
289
|
+
return Array.from(new Uint8Array(buffer), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
290
|
+
}
|
|
291
|
+
function timingSafeEqualStrings(a, b) {
|
|
292
|
+
if (a.length !== b.length) {
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
let mismatch = 0;
|
|
296
|
+
for (let index = 0; index < a.length; index++) {
|
|
297
|
+
mismatch |= a.charCodeAt(index) ^ b.charCodeAt(index);
|
|
298
|
+
}
|
|
299
|
+
return mismatch === 0;
|
|
300
|
+
}
|
|
301
|
+
async function verifyWebhookSignature(rawBody, signatureHeader, secret) {
|
|
302
|
+
if (!signatureHeader || !signatureHeader.startsWith(SIGNATURE_PREFIX) || !secret) {
|
|
303
|
+
return false;
|
|
304
|
+
}
|
|
305
|
+
try {
|
|
306
|
+
const key = await crypto.subtle.importKey(
|
|
307
|
+
"raw",
|
|
308
|
+
new TextEncoder().encode(secret),
|
|
309
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
310
|
+
false,
|
|
311
|
+
["sign"]
|
|
312
|
+
);
|
|
313
|
+
const digest = await crypto.subtle.sign("HMAC", key, toBytes(rawBody));
|
|
314
|
+
const expected = `${SIGNATURE_PREFIX}${toHex(digest)}`;
|
|
315
|
+
return timingSafeEqualStrings(signatureHeader, expected);
|
|
316
|
+
} catch {
|
|
317
|
+
return false;
|
|
318
|
+
}
|
|
269
319
|
}
|
|
270
320
|
|
|
271
|
-
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, NetworkError, agentClient, isFetchError, isNetworkError, parseSessionStream };
|
|
321
|
+
export { APIKeyAuthStrategy, DataTokenAuthStrategy, FetchError, NetworkError, agentClient, isFetchError, isNetworkError, parseSessionStream, verifyWebhookSignature };
|
package/dist/schemas.cjs
CHANGED
|
@@ -430,6 +430,7 @@ const nativeAnthropicModelIds = [
|
|
|
430
430
|
"claude-sonnet-4-5",
|
|
431
431
|
"claude-sonnet-4-6",
|
|
432
432
|
"claude-haiku-4-5",
|
|
433
|
+
"claude-fable-5",
|
|
433
434
|
"claude-opus-4-6",
|
|
434
435
|
"claude-opus-4-7",
|
|
435
436
|
"claude-opus-4-8"
|
|
@@ -442,6 +443,118 @@ const modelSchema = zod.z.enum([
|
|
|
442
443
|
...openrouterModelIds
|
|
443
444
|
]);
|
|
444
445
|
|
|
446
|
+
const sessionWebhookEventTypeSchema = zod.z.enum([
|
|
447
|
+
"session.started",
|
|
448
|
+
"session.completed",
|
|
449
|
+
"session.failed",
|
|
450
|
+
"session.cancelled",
|
|
451
|
+
"session.waiting_messages",
|
|
452
|
+
"subagent.started",
|
|
453
|
+
"subagent.completed"
|
|
454
|
+
]);
|
|
455
|
+
const SESSION_WEBHOOK_DEFAULT_EVENTS = [
|
|
456
|
+
"session.started",
|
|
457
|
+
"session.completed",
|
|
458
|
+
"session.failed",
|
|
459
|
+
"session.cancelled",
|
|
460
|
+
"session.waiting_messages"
|
|
461
|
+
];
|
|
462
|
+
const BLOCKED_HOSTNAME_SUFFIXES = [".localhost", ".local", ".internal"];
|
|
463
|
+
const BLOCKED_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "metadata.google.internal"]);
|
|
464
|
+
function isPrivateIpv4(hostname) {
|
|
465
|
+
const match = hostname.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
|
|
466
|
+
if (!match) {
|
|
467
|
+
return false;
|
|
468
|
+
}
|
|
469
|
+
const octets = match.slice(1).map(Number);
|
|
470
|
+
if (octets.some((octet) => octet > 255)) {
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
const a = octets[0] ?? 0;
|
|
474
|
+
const b = octets[1] ?? 0;
|
|
475
|
+
return a === 0 || a === 10 || a === 127 || a === 100 && b >= 64 && b <= 127 || a === 169 && b === 254 || a === 172 && b >= 16 && b <= 31 || a === 192 && b === 168;
|
|
476
|
+
}
|
|
477
|
+
function isPrivateIpv6(hostname) {
|
|
478
|
+
const normalized = hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
479
|
+
if (!normalized.includes(":")) {
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
return normalized === "::" || normalized === "::1" || normalized.startsWith("fc") || normalized.startsWith("fd") || normalized.startsWith("fe8") || normalized.startsWith("fe9") || normalized.startsWith("fea") || normalized.startsWith("feb") || normalized.startsWith("::ffff:");
|
|
483
|
+
}
|
|
484
|
+
function isBlockedWebhookHostname(hostname) {
|
|
485
|
+
const normalized = hostname.toLowerCase();
|
|
486
|
+
if (BLOCKED_HOSTNAMES.has(normalized)) {
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
if (BLOCKED_HOSTNAME_SUFFIXES.some((suffix) => normalized.endsWith(suffix))) {
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
return isPrivateIpv4(normalized) || isPrivateIpv6(normalized);
|
|
493
|
+
}
|
|
494
|
+
function validateWebhookUrl(value) {
|
|
495
|
+
let parsed;
|
|
496
|
+
try {
|
|
497
|
+
parsed = new URL(value);
|
|
498
|
+
} catch {
|
|
499
|
+
return "Webhook URL is invalid";
|
|
500
|
+
}
|
|
501
|
+
if (parsed.protocol !== "https:") {
|
|
502
|
+
return "Webhook URLs must use https";
|
|
503
|
+
}
|
|
504
|
+
if (isBlockedWebhookHostname(parsed.hostname)) {
|
|
505
|
+
return "Webhook URL host is not allowed";
|
|
506
|
+
}
|
|
507
|
+
return null;
|
|
508
|
+
}
|
|
509
|
+
const sessionWebhookConfigSchema = zod.z.object({
|
|
510
|
+
url: zod.z.string().max(2048).superRefine((value, ctx) => {
|
|
511
|
+
const error = validateWebhookUrl(value);
|
|
512
|
+
if (error) {
|
|
513
|
+
ctx.addIssue({ code: "custom", message: error });
|
|
514
|
+
}
|
|
515
|
+
}).describe("HTTPS endpoint that receives lifecycle event POSTs (e.g. a Trigger.dev wait-token URL)"),
|
|
516
|
+
events: zod.z.array(sessionWebhookEventTypeSchema).min(1).optional().describe("Event filter; defaults to all session.* events (subagent.* events must be opted into)"),
|
|
517
|
+
secret: zod.z.string().min(8).max(256).optional().describe("Optional HMAC-SHA256 signing secret used for the x-tela-agent-webhook-signature header")
|
|
518
|
+
}).strict();
|
|
519
|
+
const sessionWebhooksSchema = zod.z.array(sessionWebhookConfigSchema).max(5).describe("Webhook endpoints notified about session lifecycle and subagent events");
|
|
520
|
+
const sessionWebhookUsageSchema = zod.z.object({
|
|
521
|
+
inputTokens: zod.z.number().int().nonnegative().optional(),
|
|
522
|
+
outputTokens: zod.z.number().int().nonnegative().optional(),
|
|
523
|
+
cacheReadInputTokens: zod.z.number().int().nonnegative().optional(),
|
|
524
|
+
cacheCreationInputTokens: zod.z.number().int().nonnegative().optional(),
|
|
525
|
+
totalCostUsd: zod.z.number().nullable().optional(),
|
|
526
|
+
durationMs: zod.z.number().int().nonnegative().optional(),
|
|
527
|
+
numTurns: zod.z.number().int().nonnegative().optional()
|
|
528
|
+
}).strict();
|
|
529
|
+
const sessionWebhookSubagentSchema = zod.z.object({
|
|
530
|
+
callId: zod.z.string().min(1).max(256),
|
|
531
|
+
subagentType: zod.z.string().max(256).optional(),
|
|
532
|
+
status: zod.z.enum(["success", "failed"]).optional(),
|
|
533
|
+
durationMs: zod.z.number().int().nonnegative().optional()
|
|
534
|
+
}).strict();
|
|
535
|
+
const sessionWebhookEventPayloadSchema = zod.z.object({
|
|
536
|
+
eventType: sessionWebhookEventTypeSchema,
|
|
537
|
+
sessionId: zod.z.string(),
|
|
538
|
+
workspaceId: zod.z.string().optional(),
|
|
539
|
+
runId: zod.z.string().optional(),
|
|
540
|
+
status: zod.z.string(),
|
|
541
|
+
error: zod.z.string().optional(),
|
|
542
|
+
usage: sessionWebhookUsageSchema.optional(),
|
|
543
|
+
subagent: sessionWebhookSubagentSchema.optional(),
|
|
544
|
+
timestamp: zod.z.string(),
|
|
545
|
+
apiVersion: zod.z.literal("v4"),
|
|
546
|
+
deliveryId: zod.z.string()
|
|
547
|
+
});
|
|
548
|
+
const sessionAgentEventSchema = zod.z.object({
|
|
549
|
+
type: zod.z.enum(["subagent.started", "subagent.completed"]),
|
|
550
|
+
callId: zod.z.string().min(1).max(256),
|
|
551
|
+
subagentType: zod.z.string().max(256).optional(),
|
|
552
|
+
status: zod.z.enum(["success", "failed"]).optional(),
|
|
553
|
+
durationMs: zod.z.number().int().nonnegative().optional(),
|
|
554
|
+
timestamp: zod.z.number().int().nonnegative()
|
|
555
|
+
}).strict();
|
|
556
|
+
const sessionAgentEventsSchema = zod.z.array(sessionAgentEventSchema).max(20);
|
|
557
|
+
|
|
445
558
|
const vaultReferenceSchema = zod.z.string().regex(/^vault:\/\/\S+$/, "vaultRef must start with vault:// and cannot contain whitespace");
|
|
446
559
|
const agentInputSchema = zod.z.object({
|
|
447
560
|
vaultRef: vaultReferenceSchema,
|
|
@@ -456,7 +569,8 @@ const executeAgentRequestSchema = zod.z.object({
|
|
|
456
569
|
message: zod.z.string().min(1).max(8e5).optional(),
|
|
457
570
|
inputs: zod.z.array(agentInputSchema).optional(),
|
|
458
571
|
environmentVariables: zod.z.record(zod.z.string(), zod.z.string()).optional(),
|
|
459
|
-
recover: zod.z.boolean().optional()
|
|
572
|
+
recover: zod.z.boolean().optional(),
|
|
573
|
+
webhooks: sessionWebhooksSchema.optional()
|
|
460
574
|
}).strict().superRefine((data, ctx) => {
|
|
461
575
|
if (!data.sessionId) {
|
|
462
576
|
if (!data.organizationName) {
|
|
@@ -637,22 +751,37 @@ const sessionStreamEventSchema = zod.z.discriminatedUnion("kind", [
|
|
|
637
751
|
sessionErrorEventSchema
|
|
638
752
|
]);
|
|
639
753
|
const SESSION_STREAM_EVENT_KINDS = /* @__PURE__ */ new Set(["status", "steps", "result", "timeline-finalize", "error"]);
|
|
754
|
+
const cancelSessionResponseSchema = zod.z.discriminatedUnion("success", [
|
|
755
|
+
zod.z.object({ success: zod.z.literal(true), message: zod.z.string() }),
|
|
756
|
+
zod.z.object({ success: zod.z.literal(false), error: zod.z.string() })
|
|
757
|
+
]);
|
|
640
758
|
|
|
641
759
|
exports.SESSION_STREAM_EVENT_KINDS = SESSION_STREAM_EVENT_KINDS;
|
|
760
|
+
exports.SESSION_WEBHOOK_DEFAULT_EVENTS = SESSION_WEBHOOK_DEFAULT_EVENTS;
|
|
642
761
|
exports.agentInputSchema = agentInputSchema;
|
|
762
|
+
exports.cancelSessionResponseSchema = cancelSessionResponseSchema;
|
|
643
763
|
exports.executeAgentErrorResponseSchema = executeAgentErrorResponseSchema;
|
|
644
764
|
exports.executeAgentRequestSchema = executeAgentRequestSchema;
|
|
645
765
|
exports.executeAgentResponseSchema = executeAgentResponseSchema;
|
|
646
766
|
exports.executeAgentSuccessResponseSchema = executeAgentSuccessResponseSchema;
|
|
767
|
+
exports.isBlockedWebhookHostname = isBlockedWebhookHostname;
|
|
647
768
|
exports.modelSchema = modelSchema;
|
|
648
769
|
exports.nativeAnthropicModelIds = nativeAnthropicModelIds;
|
|
649
770
|
exports.nativeModelSchema = nativeModelSchema;
|
|
650
771
|
exports.openrouterModelCatalog = openrouterModelCatalog;
|
|
651
772
|
exports.openrouterModelIds = openrouterModelIds;
|
|
773
|
+
exports.sessionAgentEventSchema = sessionAgentEventSchema;
|
|
774
|
+
exports.sessionAgentEventsSchema = sessionAgentEventsSchema;
|
|
652
775
|
exports.sessionStatusSchema = sessionStatusSchema;
|
|
653
776
|
exports.sessionStreamEventSchema = sessionStreamEventSchema;
|
|
654
777
|
exports.sessionTimelineIdSchema = sessionTimelineIdSchema;
|
|
655
778
|
exports.sessionTimelineResponseSchema = sessionTimelineResponseSchema;
|
|
779
|
+
exports.sessionWebhookConfigSchema = sessionWebhookConfigSchema;
|
|
780
|
+
exports.sessionWebhookEventPayloadSchema = sessionWebhookEventPayloadSchema;
|
|
781
|
+
exports.sessionWebhookEventTypeSchema = sessionWebhookEventTypeSchema;
|
|
782
|
+
exports.sessionWebhookSubagentSchema = sessionWebhookSubagentSchema;
|
|
783
|
+
exports.sessionWebhookUsageSchema = sessionWebhookUsageSchema;
|
|
784
|
+
exports.sessionWebhooksSchema = sessionWebhooksSchema;
|
|
656
785
|
exports.timelineEventSchema = timelineEventSchema;
|
|
657
786
|
exports.timelineMetricsSchema = timelineMetricsSchema;
|
|
658
787
|
exports.timelinePromptSchema = timelinePromptSchema;
|
|
@@ -663,3 +792,4 @@ exports.updateAgentModelErrorResponseSchema = updateAgentModelErrorResponseSchem
|
|
|
663
792
|
exports.updateAgentModelRequestSchema = updateAgentModelRequestSchema;
|
|
664
793
|
exports.updateAgentModelResponseSchema = updateAgentModelResponseSchema;
|
|
665
794
|
exports.updateAgentModelSuccessResponseSchema = updateAgentModelSuccessResponseSchema;
|
|
795
|
+
exports.validateWebhookUrl = validateWebhookUrl;
|
package/dist/schemas.d.cts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { A as AgentInput, E as ExecuteAgentRequest, a as ExecuteAgentResponse,
|
|
1
|
+
export { A as AgentInput, C as CancelSessionResponse, E as ExecuteAgentRequest, a as ExecuteAgentResponse, K as SESSION_STREAM_EVENT_KINDS, N as SESSION_WEBHOOK_DEFAULT_EVENTS, Z as SessionAgentEvent, d as SessionStatus, c as SessionStreamEvent, S as SessionTimelineResponse, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, o as agentInputSchema, L as cancelSessionResponseSchema, r as executeAgentErrorResponseSchema, p as executeAgentRequestSchema, s as executeAgentResponseSchema, q as executeAgentSuccessResponseSchema, O as isBlockedWebhookHostname, Y as sessionAgentEventSchema, _ as sessionAgentEventsSchema, x as sessionStatusSchema, J as sessionStreamEventSchema, y as sessionTimelineIdSchema, I as sessionTimelineResponseSchema, Q as sessionWebhookConfigSchema, X as sessionWebhookEventPayloadSchema, M as sessionWebhookEventTypeSchema, W as sessionWebhookSubagentSchema, V as sessionWebhookUsageSchema, R as sessionWebhooksSchema, G as timelineEventSchema, z as timelineMetricsSchema, B as timelinePromptSchema, F as timelineRunTurnMetricsSchema, H as timelineSpanSchema, D as timelineToolResultSchema, v as updateAgentModelErrorResponseSchema, u as updateAgentModelRequestSchema, w as updateAgentModelResponseSchema, t as updateAgentModelSuccessResponseSchema, P as validateWebhookUrl } from './shared/agent-sdk.dc5630ec.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
4
|
+
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-fable-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
5
5
|
type NativeAnthropicModelId = typeof nativeAnthropicModelIds[number];
|
|
6
6
|
type V3Provider = 'anthropic' | 'vertex-ai' | 'openrouter' | 'bedrock' | 'tela-claude-agent-gateway';
|
|
7
7
|
declare const nativeModelSchema: z.ZodEnum<{
|
|
8
8
|
"claude-sonnet-4-5": "claude-sonnet-4-5";
|
|
9
9
|
"claude-sonnet-4-6": "claude-sonnet-4-6";
|
|
10
10
|
"claude-haiku-4-5": "claude-haiku-4-5";
|
|
11
|
+
"claude-fable-5": "claude-fable-5";
|
|
11
12
|
"claude-opus-4-6": "claude-opus-4-6";
|
|
12
13
|
"claude-opus-4-7": "claude-opus-4-7";
|
|
13
14
|
"claude-opus-4-8": "claude-opus-4-8";
|
package/dist/schemas.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { A as AgentInput, E as ExecuteAgentRequest, a as ExecuteAgentResponse,
|
|
1
|
+
export { A as AgentInput, C as CancelSessionResponse, E as ExecuteAgentRequest, a as ExecuteAgentResponse, K as SESSION_STREAM_EVENT_KINDS, N as SESSION_WEBHOOK_DEFAULT_EVENTS, Z as SessionAgentEvent, d as SessionStatus, c as SessionStreamEvent, S as SessionTimelineResponse, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, o as agentInputSchema, L as cancelSessionResponseSchema, r as executeAgentErrorResponseSchema, p as executeAgentRequestSchema, s as executeAgentResponseSchema, q as executeAgentSuccessResponseSchema, O as isBlockedWebhookHostname, Y as sessionAgentEventSchema, _ as sessionAgentEventsSchema, x as sessionStatusSchema, J as sessionStreamEventSchema, y as sessionTimelineIdSchema, I as sessionTimelineResponseSchema, Q as sessionWebhookConfigSchema, X as sessionWebhookEventPayloadSchema, M as sessionWebhookEventTypeSchema, W as sessionWebhookSubagentSchema, V as sessionWebhookUsageSchema, R as sessionWebhooksSchema, G as timelineEventSchema, z as timelineMetricsSchema, B as timelinePromptSchema, F as timelineRunTurnMetricsSchema, H as timelineSpanSchema, D as timelineToolResultSchema, v as updateAgentModelErrorResponseSchema, u as updateAgentModelRequestSchema, w as updateAgentModelResponseSchema, t as updateAgentModelSuccessResponseSchema, P as validateWebhookUrl } from './shared/agent-sdk.dc5630ec.mjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
4
|
+
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-fable-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
5
5
|
type NativeAnthropicModelId = typeof nativeAnthropicModelIds[number];
|
|
6
6
|
type V3Provider = 'anthropic' | 'vertex-ai' | 'openrouter' | 'bedrock' | 'tela-claude-agent-gateway';
|
|
7
7
|
declare const nativeModelSchema: z.ZodEnum<{
|
|
8
8
|
"claude-sonnet-4-5": "claude-sonnet-4-5";
|
|
9
9
|
"claude-sonnet-4-6": "claude-sonnet-4-6";
|
|
10
10
|
"claude-haiku-4-5": "claude-haiku-4-5";
|
|
11
|
+
"claude-fable-5": "claude-fable-5";
|
|
11
12
|
"claude-opus-4-6": "claude-opus-4-6";
|
|
12
13
|
"claude-opus-4-7": "claude-opus-4-7";
|
|
13
14
|
"claude-opus-4-8": "claude-opus-4-8";
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
export { A as AgentInput, E as ExecuteAgentRequest, a as ExecuteAgentResponse,
|
|
1
|
+
export { A as AgentInput, C as CancelSessionResponse, E as ExecuteAgentRequest, a as ExecuteAgentResponse, K as SESSION_STREAM_EVENT_KINDS, N as SESSION_WEBHOOK_DEFAULT_EVENTS, Z as SessionAgentEvent, d as SessionStatus, c as SessionStreamEvent, S as SessionTimelineResponse, e as SessionWebhookConfig, f as SessionWebhookEventPayload, g as SessionWebhookEventType, h as SessionWebhookSubagent, i as SessionWebhookUsage, T as TimelineEvent, j as TimelineMetrics, k as TimelinePrompt, l as TimelineRunTurnMetrics, m as TimelineSpan, n as TimelineToolResult, U as UpdateAgentModelRequest, b as UpdateAgentModelResponse, o as agentInputSchema, L as cancelSessionResponseSchema, r as executeAgentErrorResponseSchema, p as executeAgentRequestSchema, s as executeAgentResponseSchema, q as executeAgentSuccessResponseSchema, O as isBlockedWebhookHostname, Y as sessionAgentEventSchema, _ as sessionAgentEventsSchema, x as sessionStatusSchema, J as sessionStreamEventSchema, y as sessionTimelineIdSchema, I as sessionTimelineResponseSchema, Q as sessionWebhookConfigSchema, X as sessionWebhookEventPayloadSchema, M as sessionWebhookEventTypeSchema, W as sessionWebhookSubagentSchema, V as sessionWebhookUsageSchema, R as sessionWebhooksSchema, G as timelineEventSchema, z as timelineMetricsSchema, B as timelinePromptSchema, F as timelineRunTurnMetricsSchema, H as timelineSpanSchema, D as timelineToolResultSchema, v as updateAgentModelErrorResponseSchema, u as updateAgentModelRequestSchema, w as updateAgentModelResponseSchema, t as updateAgentModelSuccessResponseSchema, P as validateWebhookUrl } from './shared/agent-sdk.dc5630ec.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
|
|
4
|
-
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
4
|
+
declare const nativeAnthropicModelIds: readonly ["claude-sonnet-4-5", "claude-sonnet-4-6", "claude-haiku-4-5", "claude-fable-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8"];
|
|
5
5
|
type NativeAnthropicModelId = typeof nativeAnthropicModelIds[number];
|
|
6
6
|
type V3Provider = 'anthropic' | 'vertex-ai' | 'openrouter' | 'bedrock' | 'tela-claude-agent-gateway';
|
|
7
7
|
declare const nativeModelSchema: z.ZodEnum<{
|
|
8
8
|
"claude-sonnet-4-5": "claude-sonnet-4-5";
|
|
9
9
|
"claude-sonnet-4-6": "claude-sonnet-4-6";
|
|
10
10
|
"claude-haiku-4-5": "claude-haiku-4-5";
|
|
11
|
+
"claude-fable-5": "claude-fable-5";
|
|
11
12
|
"claude-opus-4-6": "claude-opus-4-6";
|
|
12
13
|
"claude-opus-4-7": "claude-opus-4-7";
|
|
13
14
|
"claude-opus-4-8": "claude-opus-4-8";
|