@agent-native/agentkit 0.1.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/ARCHITECTURE.md +290 -0
- package/README.md +822 -0
- package/dist/adapters/http.d.ts +56 -0
- package/dist/adapters/http.d.ts.map +1 -0
- package/dist/adapters/http.js +950 -0
- package/dist/adapters/http.js.map +1 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +2 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/client/client.d.ts +240 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +1605 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/state.d.ts +72 -0
- package/dist/client/state.d.ts.map +1 -0
- package/dist/client/state.js +385 -0
- package/dist/client/state.js.map +1 -0
- package/dist/conformance/index.d.ts +41 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +924 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/agui-codec.d.ts +28 -0
- package/dist/protocol/agui-codec.d.ts.map +1 -0
- package/dist/protocol/agui-codec.js +250 -0
- package/dist/protocol/agui-codec.js.map +1 -0
- package/dist/protocol/agui.d.ts +144 -0
- package/dist/protocol/agui.d.ts.map +1 -0
- package/dist/protocol/agui.js +253 -0
- package/dist/protocol/agui.js.map +1 -0
- package/dist/protocol/compatibility.d.ts +35 -0
- package/dist/protocol/compatibility.d.ts.map +1 -0
- package/dist/protocol/compatibility.js +160 -0
- package/dist/protocol/compatibility.js.map +1 -0
- package/dist/protocol/errors.d.ts +24 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +77 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/index.d.ts +982 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +56 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/validation.d.ts +94 -0
- package/dist/protocol/validation.d.ts.map +1 -0
- package/dist/protocol/validation.js +1871 -0
- package/dist/protocol/validation.js.map +1 -0
- package/dist/protocol/version.d.ts +7 -0
- package/dist/protocol/version.d.ts.map +1 -0
- package/dist/protocol/version.js +9 -0
- package/dist/protocol/version.js.map +1 -0
- package/dist/react/chat.d.ts +34 -0
- package/dist/react/chat.d.ts.map +1 -0
- package/dist/react/chat.js +23 -0
- package/dist/react/chat.js.map +1 -0
- package/dist/react/components.d.ts +96 -0
- package/dist/react/components.d.ts.map +1 -0
- package/dist/react/components.js +1300 -0
- package/dist/react/components.js.map +1 -0
- package/dist/react/context.d.ts +259 -0
- package/dist/react/context.d.ts.map +1 -0
- package/dist/react/context.js +359 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/headless.d.ts +3 -0
- package/dist/react/headless.d.ts.map +1 -0
- package/dist/react/headless.js +3 -0
- package/dist/react/headless.js.map +1 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/root.d.ts +58 -0
- package/dist/react/root.d.ts.map +1 -0
- package/dist/react/root.js +151 -0
- package/dist/react/root.js.map +1 -0
- package/dist/react/streaming-text.d.ts +19 -0
- package/dist/react/streaming-text.d.ts.map +1 -0
- package/dist/react/streaming-text.js +259 -0
- package/dist/react/streaming-text.js.map +1 -0
- package/dist/react/styles.css +1477 -0
- package/package.json +112 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { EventType } from "@ag-ui/core";
|
|
2
|
+
import { AgentProtocolValidationError, parseAgentApprovalResponse, } from "./validation.js";
|
|
3
|
+
/**
|
|
4
|
+
* The profile identifier carried on every frame. AG-UI has no protocol version
|
|
5
|
+
* of its own, so a reader that cannot recognise this string must not assume the
|
|
6
|
+
* Builder extensions below are absent — it must refuse the stream.
|
|
7
|
+
*/
|
|
8
|
+
export const AGENTKIT_PROFILE_NAME = "builder.agentkit";
|
|
9
|
+
export const AGENTKIT_PROFILE_VERSION = 1;
|
|
10
|
+
export const AGENTKIT_PROFILE_ID = `${AGENTKIT_PROFILE_NAME}.v${AGENTKIT_PROFILE_VERSION}`;
|
|
11
|
+
/**
|
|
12
|
+
* Namespace for the Builder events that AG-UI has no counterpart for. They ride
|
|
13
|
+
* on `CUSTOM` as `<AGENTKIT_PROFILE_ID>/<domain event type>`.
|
|
14
|
+
*/
|
|
15
|
+
export const AGENTKIT_PROFILE_EVENT_PREFIX = `${AGENTKIT_PROFILE_ID}/`;
|
|
16
|
+
/**
|
|
17
|
+
* Single metadata key holding every Builder extension. `@ag-ui/core` reserves
|
|
18
|
+
* `AGUI_METADATA_KEY` ("ag-ui") for itself, so nesting under one owned key
|
|
19
|
+
* keeps the two from colliding as either side adds fields.
|
|
20
|
+
*/
|
|
21
|
+
export const AGENTKIT_METADATA_KEY = AGENTKIT_PROFILE_NAME;
|
|
22
|
+
/** HTTP header advertising the profile so negotiation fails before streaming. */
|
|
23
|
+
export const AGENTKIT_PROFILE_HEADER = "x-agentkit-profile";
|
|
24
|
+
/**
|
|
25
|
+
* Domain event types that reach a native AG-UI event, and which one.
|
|
26
|
+
*
|
|
27
|
+
* Reaching a native event is not the same as fitting in it. Only the types in
|
|
28
|
+
* {@link AGENTKIT_LOSSLESS_EVENT_TYPES} survive the trip on native fields
|
|
29
|
+
* alone; every other entry here also ships its domain payload in
|
|
30
|
+
* `residual`, because AG-UI's event carries a strict subset of the fields.
|
|
31
|
+
* `activity.updated` is the sharpest case: AG-UI's `ACTIVITY_DELTA` is a JSON
|
|
32
|
+
* Patch against prior state, which a stateless encoder cannot produce, so all
|
|
33
|
+
* three activity events map to `ACTIVITY_SNAPSHOT` instead.
|
|
34
|
+
*/
|
|
35
|
+
export const AGENTKIT_NATIVE_EVENT_TYPES = {
|
|
36
|
+
"run.started": EventType.RUN_STARTED,
|
|
37
|
+
"run.completed": EventType.RUN_FINISHED,
|
|
38
|
+
"run.failed": EventType.RUN_ERROR,
|
|
39
|
+
"run.status": EventType.STEP_STARTED,
|
|
40
|
+
"message.created": EventType.TEXT_MESSAGE_START,
|
|
41
|
+
"message.delta": EventType.TEXT_MESSAGE_CONTENT,
|
|
42
|
+
"message.completed": EventType.TEXT_MESSAGE_END,
|
|
43
|
+
"reasoning.delta": EventType.REASONING_MESSAGE_CONTENT,
|
|
44
|
+
"tool.started": EventType.TOOL_CALL_START,
|
|
45
|
+
"tool.delta": EventType.TOOL_CALL_ARGS,
|
|
46
|
+
"tool.updated": EventType.TOOL_CALL_RESULT,
|
|
47
|
+
"activity.started": EventType.ACTIVITY_SNAPSHOT,
|
|
48
|
+
"activity.updated": EventType.ACTIVITY_SNAPSHOT,
|
|
49
|
+
"activity.completed": EventType.ACTIVITY_SNAPSHOT,
|
|
50
|
+
"agent.registered": EventType.SUBAGENT_STARTED,
|
|
51
|
+
"agent.unregistered": EventType.SUBAGENT_FINISHED,
|
|
52
|
+
"approval.requested": EventType.RUN_FINISHED,
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* The mappings that need no residual. Two, out of the twelve the evaluation
|
|
56
|
+
* table calls "Direct" — the rest carry structure AG-UI's event has no slot
|
|
57
|
+
* for, so "direct" describes the event name, not the payload.
|
|
58
|
+
*/
|
|
59
|
+
export const AGENTKIT_LOSSLESS_EVENT_TYPES = [
|
|
60
|
+
"reasoning.delta",
|
|
61
|
+
"message.delta",
|
|
62
|
+
];
|
|
63
|
+
const LOSSLESS_EVENT_TYPE_SET = new Set(AGENTKIT_LOSSLESS_EVENT_TYPES);
|
|
64
|
+
export function isNativeEventType(type) {
|
|
65
|
+
return type in AGENTKIT_NATIVE_EVENT_TYPES;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* `message.delta` only fits when it does not set `format`; AG-UI's
|
|
69
|
+
* `TEXT_MESSAGE_CONTENT` has no formatting field.
|
|
70
|
+
*/
|
|
71
|
+
export function isLosslessEventType(type) {
|
|
72
|
+
return LOSSLESS_EVENT_TYPE_SET.has(type);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Everything else. These have no AG-UI counterpart at all and are the reason
|
|
76
|
+
* the profile exists: adopting AG-UI wholesale would delete the capabilities
|
|
77
|
+
* behind them, not express them differently.
|
|
78
|
+
*
|
|
79
|
+
* `approval.resolved` sits here rather than with the native mappings because
|
|
80
|
+
* AG-UI models resolution only as a `resume[]` command on the next run input.
|
|
81
|
+
* The command exists, but there is no event announcing it to other observers of
|
|
82
|
+
* the thread, so the profile keeps one.
|
|
83
|
+
*/
|
|
84
|
+
export const AGENTKIT_PROFILE_EVENT_TYPES = [
|
|
85
|
+
"run.cancelled",
|
|
86
|
+
"approval.resolved",
|
|
87
|
+
"agent.updated",
|
|
88
|
+
"agent.interaction",
|
|
89
|
+
"connection.requested",
|
|
90
|
+
"connection.updated",
|
|
91
|
+
"task.created",
|
|
92
|
+
"task.updated",
|
|
93
|
+
"task.completed",
|
|
94
|
+
"task-group.created",
|
|
95
|
+
"task-group.updated",
|
|
96
|
+
"task-group.completed",
|
|
97
|
+
"task-group.removed",
|
|
98
|
+
"artifact.created",
|
|
99
|
+
"widget.created",
|
|
100
|
+
"widget.updated",
|
|
101
|
+
"widget.removed",
|
|
102
|
+
"annotation.created",
|
|
103
|
+
"annotation.updated",
|
|
104
|
+
"annotation.removed",
|
|
105
|
+
"suggestions.updated",
|
|
106
|
+
"action.started",
|
|
107
|
+
"action.completed",
|
|
108
|
+
"action.failed",
|
|
109
|
+
"upload.progress",
|
|
110
|
+
"client.effect",
|
|
111
|
+
"client.deeplink",
|
|
112
|
+
"thread.updated",
|
|
113
|
+
"queue.updated",
|
|
114
|
+
];
|
|
115
|
+
const PROFILE_EVENT_TYPE_SET = new Set(AGENTKIT_PROFILE_EVENT_TYPES);
|
|
116
|
+
/** Host-defined `x-*` events also travel as profile events. */
|
|
117
|
+
export function isProfileEventType(type) {
|
|
118
|
+
return PROFILE_EVENT_TYPE_SET.has(type) || type.startsWith("x-");
|
|
119
|
+
}
|
|
120
|
+
export function profileEventName(type) {
|
|
121
|
+
return `${AGENTKIT_PROFILE_EVENT_PREFIX}${type}`;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Returns the domain event type for a `CUSTOM` name, or `undefined` when the
|
|
125
|
+
* name belongs to another profile. A foreign `CUSTOM` is another producer's
|
|
126
|
+
* business, not a malformed frame, so it is skipped rather than rejected.
|
|
127
|
+
*/
|
|
128
|
+
export function profileEventTypeFromName(name) {
|
|
129
|
+
if (!name.startsWith(AGENTKIT_PROFILE_EVENT_PREFIX))
|
|
130
|
+
return undefined;
|
|
131
|
+
return name.slice(AGENTKIT_PROFILE_EVENT_PREFIX.length);
|
|
132
|
+
}
|
|
133
|
+
function requireRecord(value, path) {
|
|
134
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
135
|
+
throw new AgentProtocolValidationError(path, "expected an object");
|
|
136
|
+
}
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Reads the Builder extension off an AG-UI frame. A frame that reached an
|
|
141
|
+
* AgentKit consumer without it is unreadable, not empty: silently defaulting
|
|
142
|
+
* `seq` would let the reducer accept a stream it can no longer detect gaps in.
|
|
143
|
+
*/
|
|
144
|
+
export function readProfileExtension(metadata, path = "metadata") {
|
|
145
|
+
const container = requireRecord(metadata, path);
|
|
146
|
+
const extension = requireRecord(container[AGENTKIT_METADATA_KEY], `${path}.${AGENTKIT_METADATA_KEY}`);
|
|
147
|
+
const extensionPath = `${path}.${AGENTKIT_METADATA_KEY}`;
|
|
148
|
+
const version = extension.v;
|
|
149
|
+
if (version !== AGENTKIT_PROFILE_VERSION) {
|
|
150
|
+
throw new AgentProtocolValidationError(`${extensionPath}.v`, `unsupported profile version ${JSON.stringify(version)}; expected ${AGENTKIT_PROFILE_VERSION}`);
|
|
151
|
+
}
|
|
152
|
+
const domainType = extension.t;
|
|
153
|
+
if (typeof domainType !== "string" || domainType.length === 0) {
|
|
154
|
+
throw new AgentProtocolValidationError(`${extensionPath}.t`, "expected a domain event type");
|
|
155
|
+
}
|
|
156
|
+
const seq = extension.seq;
|
|
157
|
+
if (typeof seq !== "number" || !Number.isSafeInteger(seq) || seq < 1) {
|
|
158
|
+
throw new AgentProtocolValidationError(`${extensionPath}.seq`, "expected a positive safe integer sequence");
|
|
159
|
+
}
|
|
160
|
+
const id = extension.id;
|
|
161
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
162
|
+
throw new AgentProtocolValidationError(`${extensionPath}.id`, "expected a non-empty event id");
|
|
163
|
+
}
|
|
164
|
+
const at = extension.at;
|
|
165
|
+
if (typeof at !== "string" || Number.isNaN(Date.parse(at))) {
|
|
166
|
+
throw new AgentProtocolValidationError(`${extensionPath}.at`, "expected an ISO-8601 timestamp");
|
|
167
|
+
}
|
|
168
|
+
const meta = extension.meta === undefined
|
|
169
|
+
? undefined
|
|
170
|
+
: requireRecord(extension.meta, `${extensionPath}.meta`);
|
|
171
|
+
const residual = extension.residual === undefined
|
|
172
|
+
? undefined
|
|
173
|
+
: requireRecord(extension.residual, `${extensionPath}.residual`);
|
|
174
|
+
return {
|
|
175
|
+
v: AGENTKIT_PROFILE_VERSION,
|
|
176
|
+
t: domainType,
|
|
177
|
+
seq,
|
|
178
|
+
id,
|
|
179
|
+
at,
|
|
180
|
+
meta,
|
|
181
|
+
residual,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export function writeProfileExtension(extension) {
|
|
185
|
+
const value = {
|
|
186
|
+
v: AGENTKIT_PROFILE_VERSION,
|
|
187
|
+
t: extension.t,
|
|
188
|
+
seq: extension.seq,
|
|
189
|
+
id: extension.id,
|
|
190
|
+
at: extension.at,
|
|
191
|
+
};
|
|
192
|
+
if (extension.meta !== undefined)
|
|
193
|
+
value.meta = extension.meta;
|
|
194
|
+
if (extension.residual !== undefined)
|
|
195
|
+
value.residual = extension.residual;
|
|
196
|
+
return { [AGENTKIT_METADATA_KEY]: value };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Approval decisions travel as AG-UI resume entries. Both directions live here
|
|
200
|
+
* so the client that writes an entry and the runtime that reads one cannot
|
|
201
|
+
* drift into two different payload shapes.
|
|
202
|
+
*/
|
|
203
|
+
export function resumeEntryFromApproval(input) {
|
|
204
|
+
return {
|
|
205
|
+
interruptId: input.approvalId,
|
|
206
|
+
status: "resolved",
|
|
207
|
+
payload: {
|
|
208
|
+
...input.response,
|
|
209
|
+
...(input.optionId === undefined ? {} : { optionId: input.optionId }),
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function resumePayload(entry) {
|
|
214
|
+
return requireRecord(entry.payload, "resume.payload");
|
|
215
|
+
}
|
|
216
|
+
function approvalResponseFromPayload(payload) {
|
|
217
|
+
if (payload.decision !== "approve" && payload.decision !== "deny") {
|
|
218
|
+
throw new AgentProtocolValidationError("resume.payload.decision", 'An approval response must include decision "approve" or "deny".');
|
|
219
|
+
}
|
|
220
|
+
return parseAgentApprovalResponse({
|
|
221
|
+
decision: payload.decision,
|
|
222
|
+
...(payload.optionIds === undefined
|
|
223
|
+
? {}
|
|
224
|
+
: { optionIds: payload.optionIds }),
|
|
225
|
+
...(payload.other === undefined ? {} : { other: payload.other }),
|
|
226
|
+
...(payload.input === undefined ? {} : { input: payload.input }),
|
|
227
|
+
}, "resume.payload");
|
|
228
|
+
}
|
|
229
|
+
export function approvalResponseFromResume(entry) {
|
|
230
|
+
if (entry.status === "cancelled") {
|
|
231
|
+
if (entry.payload === undefined)
|
|
232
|
+
return { decision: "deny" };
|
|
233
|
+
const payload = resumePayload(entry);
|
|
234
|
+
if (payload.decision !== undefined && payload.decision !== "deny") {
|
|
235
|
+
throw new AgentProtocolValidationError("resume.payload.decision", 'A cancelled interrupt cannot contain an "approve" decision.');
|
|
236
|
+
}
|
|
237
|
+
return approvalResponseFromPayload({ ...payload, decision: "deny" });
|
|
238
|
+
}
|
|
239
|
+
const payload = resumePayload(entry);
|
|
240
|
+
return approvalResponseFromPayload(payload);
|
|
241
|
+
}
|
|
242
|
+
export function resumeOptionId(entry) {
|
|
243
|
+
if (entry.payload === undefined)
|
|
244
|
+
return undefined;
|
|
245
|
+
const optionId = resumePayload(entry).optionId;
|
|
246
|
+
if (optionId === undefined)
|
|
247
|
+
return undefined;
|
|
248
|
+
if (typeof optionId !== "string" || optionId.length === 0) {
|
|
249
|
+
throw new AgentProtocolValidationError("resume.payload.optionId", "expected a non-empty string");
|
|
250
|
+
}
|
|
251
|
+
return optionId;
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=agui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agui.js","sourceRoot":"","sources":["../../src/protocol/agui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAYxC,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAEzB;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAC1C,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,qBAAqB,KAAK,wBAAwB,EAAE,CAAC;AAE3F;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,mBAAmB,GAAG,CAAC;AAEvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,qBAAqB,CAAC;AAE3D,iFAAiF;AACjF,MAAM,CAAC,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAoC5D;;;;;;;;;;GAUG;AACH,MAAM,CAA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ACjC,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QAC7D,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YAClE,MAAM,IAAI,4BAA4B,CACpC,yBAAyB,EACzB,6DAA6D,CAC9D,CAAC;QACJ,CAAC;QACD,OAAO,2BAA2B,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,OAAO,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACrC,OAAO,2BAA2B,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAuB;IACpD,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAClD,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IAC/C,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC7C,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,4BAA4B,CACpC,yBAAyB,EACzB,6BAA6B,CAC9B,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AgentCapabilities, AgentCapabilitiesDiscovery, AgentCapabilityAffordance, AgentCapabilityDescriptor, AgentCapabilityId, AgentProtocolCompatibility, AgentProtocolVersionOffer } from "./index.js";
|
|
2
|
+
import { type AgentKitProtocolVersion } from "./version.js";
|
|
3
|
+
/** Selects the highest mutually supported version and never guesses a fallback. */
|
|
4
|
+
export declare function negotiateAgentKitProtocolVersion(peer: AgentProtocolVersionOffer, options?: {
|
|
5
|
+
correlationId?: string;
|
|
6
|
+
}): AgentProtocolCompatibility;
|
|
7
|
+
export declare function createAgentKitProtocolVersionOffer(): AgentProtocolVersionOffer;
|
|
8
|
+
export declare function getAgentCapabilityStatus(discovery: AgentCapabilitiesDiscovery, capability: AgentCapabilityId): AgentCapabilityDescriptor | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Enforces discovery semantics at a call site. Omitted descriptors are unknown,
|
|
11
|
+
* not silently unsupported, and therefore fail as temporarily unavailable.
|
|
12
|
+
*/
|
|
13
|
+
export declare function requireAgentCapability(discovery: AgentCapabilitiesDiscovery, capability: AgentCapabilityId): AgentCapabilityDescriptor;
|
|
14
|
+
/**
|
|
15
|
+
* Lossy on purpose: the boolean map has no way to say "degraded" or "down
|
|
16
|
+
* right now", so it reports both as available and omits what discovery did
|
|
17
|
+
* not mention. Anything that gates behavior must use
|
|
18
|
+
* `resolveAgentCapabilityAffordance` against the descriptors instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare function projectAgentCapabilities(discovery: AgentCapabilitiesDiscovery): AgentCapabilities;
|
|
21
|
+
/**
|
|
22
|
+
* The single place capability presentation is decided. Enforcement in the
|
|
23
|
+
* client already branches on all four descriptor states, so a caller that
|
|
24
|
+
* reads the boolean projection instead will show controls the client then
|
|
25
|
+
* rejects, and hide ones that work. Both directions are silent.
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveAgentCapabilityAffordance(source: {
|
|
28
|
+
discovery?: AgentCapabilitiesDiscovery;
|
|
29
|
+
capabilities?: AgentCapabilities;
|
|
30
|
+
}, capability: AgentCapabilityId): AgentCapabilityAffordance;
|
|
31
|
+
/** Type-only assertion that keeps future protocol unions narrow. */
|
|
32
|
+
export declare function asAgentKitProtocolVersion(compatibility: Extract<AgentProtocolCompatibility, {
|
|
33
|
+
status: "compatible";
|
|
34
|
+
}>): AgentKitProtocolVersion;
|
|
35
|
+
//# sourceMappingURL=compatibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.d.ts","sourceRoot":"","sources":["../../src/protocol/compatibility.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,iBAAiB,EACjB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,KAAK,uBAAuB,EAC7B,MAAM,cAAc,CAAC;AAkBtB,mFAAmF;AACnF,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,yBAAyB,EAC/B,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAO,GACvC,0BAA0B,CA+B5B;AAED,wBAAgB,kCAAkC,IAAI,yBAAyB,CAK9E;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,0BAA0B,EACrC,UAAU,EAAE,iBAAiB,GAC5B,yBAAyB,GAAG,SAAS,CAEvC;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,0BAA0B,EACrC,UAAU,EAAE,iBAAiB,GAC5B,yBAAyB,CAiB3B;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,0BAA0B,GACpC,iBAAiB,CAgBnB;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE;IACN,SAAS,CAAC,EAAE,0BAA0B,CAAC;IACvC,YAAY,CAAC,EAAE,iBAAiB,CAAC;CAClC,EACD,UAAU,EAAE,iBAAiB,GAC5B,yBAAyB,CAyD3B;AAED,oEAAoE;AACpE,wBAAgB,yBAAyB,CACvC,aAAa,EAAE,OAAO,CAAC,0BAA0B,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,GAC3E,uBAAuB,CAEzB"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { AgentKitProtocolError, createCapabilityUnavailableError, createProtocolVersionUnsupportedError, } from "./errors.js";
|
|
2
|
+
import { AGENTKIT_PROTOCOL_NAME, AGENTKIT_SUPPORTED_PROTOCOL_VERSIONS, } from "./version.js";
|
|
3
|
+
function validatedVersions(values, name) {
|
|
4
|
+
if (!Array.isArray(values) || values.length === 0) {
|
|
5
|
+
throw new TypeError(`${name} must contain at least one protocol version.`);
|
|
6
|
+
}
|
|
7
|
+
const versions = values.map((value) => {
|
|
8
|
+
if (!Number.isSafeInteger(value) || value < 1) {
|
|
9
|
+
throw new TypeError(`${name} must contain positive safe integers.`);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
});
|
|
13
|
+
if (new Set(versions).size !== versions.length) {
|
|
14
|
+
throw new TypeError(`${name} must not contain duplicate versions.`);
|
|
15
|
+
}
|
|
16
|
+
return versions;
|
|
17
|
+
}
|
|
18
|
+
/** Selects the highest mutually supported version and never guesses a fallback. */
|
|
19
|
+
export function negotiateAgentKitProtocolVersion(peer, options = {}) {
|
|
20
|
+
if (peer.protocol !== AGENTKIT_PROTOCOL_NAME) {
|
|
21
|
+
throw new TypeError(`protocol must be ${JSON.stringify(AGENTKIT_PROTOCOL_NAME)}.`);
|
|
22
|
+
}
|
|
23
|
+
const peerVersions = validatedVersions(peer.versions, "peer.versions");
|
|
24
|
+
const localVersions = [...AGENTKIT_SUPPORTED_PROTOCOL_VERSIONS];
|
|
25
|
+
const selectedVersion = [...localVersions]
|
|
26
|
+
.sort((left, right) => right - left)
|
|
27
|
+
.find((version) => peerVersions.includes(version));
|
|
28
|
+
if (selectedVersion !== undefined) {
|
|
29
|
+
return {
|
|
30
|
+
status: "compatible",
|
|
31
|
+
selectedVersion,
|
|
32
|
+
localVersions,
|
|
33
|
+
peerVersions,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
status: "incompatible",
|
|
38
|
+
localVersions,
|
|
39
|
+
peerVersions,
|
|
40
|
+
error: createProtocolVersionUnsupportedError(localVersions, peerVersions, options),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export function createAgentKitProtocolVersionOffer() {
|
|
44
|
+
return {
|
|
45
|
+
protocol: AGENTKIT_PROTOCOL_NAME,
|
|
46
|
+
versions: [...AGENTKIT_SUPPORTED_PROTOCOL_VERSIONS],
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export function getAgentCapabilityStatus(discovery, capability) {
|
|
50
|
+
return discovery.capabilities.find((entry) => entry.id === capability);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Enforces discovery semantics at a call site. Omitted descriptors are unknown,
|
|
54
|
+
* not silently unsupported, and therefore fail as temporarily unavailable.
|
|
55
|
+
*/
|
|
56
|
+
export function requireAgentCapability(discovery, capability) {
|
|
57
|
+
const descriptor = getAgentCapabilityStatus(discovery, capability);
|
|
58
|
+
if (!descriptor) {
|
|
59
|
+
throw new AgentKitProtocolError(createCapabilityUnavailableError(capability, {
|
|
60
|
+
message: `The ${JSON.stringify(capability)} capability was not included in discovery.`,
|
|
61
|
+
retryable: true,
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
if (descriptor.state === "unsupported") {
|
|
65
|
+
throw new AgentKitProtocolError(descriptor.error);
|
|
66
|
+
}
|
|
67
|
+
if (descriptor.state === "unavailable") {
|
|
68
|
+
throw new AgentKitProtocolError(descriptor.error);
|
|
69
|
+
}
|
|
70
|
+
return descriptor;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Lossy on purpose: the boolean map has no way to say "degraded" or "down
|
|
74
|
+
* right now", so it reports both as available and omits what discovery did
|
|
75
|
+
* not mention. Anything that gates behavior must use
|
|
76
|
+
* `resolveAgentCapabilityAffordance` against the descriptors instead.
|
|
77
|
+
*/
|
|
78
|
+
export function projectAgentCapabilities(discovery) {
|
|
79
|
+
const projected = {
|
|
80
|
+
protocolVersion: discovery.protocol.status === "compatible"
|
|
81
|
+
? discovery.protocol.selectedVersion
|
|
82
|
+
: undefined,
|
|
83
|
+
};
|
|
84
|
+
for (const capability of discovery.capabilities) {
|
|
85
|
+
if (capability.id === "reasoning")
|
|
86
|
+
continue;
|
|
87
|
+
if (capability.state === "available" || capability.state === "degraded") {
|
|
88
|
+
projected[capability.id] = true;
|
|
89
|
+
}
|
|
90
|
+
else if (capability.state === "unsupported") {
|
|
91
|
+
projected[capability.id] = false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return projected;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The single place capability presentation is decided. Enforcement in the
|
|
98
|
+
* client already branches on all four descriptor states, so a caller that
|
|
99
|
+
* reads the boolean projection instead will show controls the client then
|
|
100
|
+
* rejects, and hide ones that work. Both directions are silent.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveAgentCapabilityAffordance(source, capability) {
|
|
103
|
+
const descriptor = source.discovery
|
|
104
|
+
? getAgentCapabilityStatus(source.discovery, capability)
|
|
105
|
+
: undefined;
|
|
106
|
+
if (descriptor) {
|
|
107
|
+
const reason = descriptor.error?.message ?? descriptor.description;
|
|
108
|
+
switch (descriptor.state) {
|
|
109
|
+
case "available":
|
|
110
|
+
return {
|
|
111
|
+
id: capability,
|
|
112
|
+
state: "available",
|
|
113
|
+
visible: true,
|
|
114
|
+
enabled: true,
|
|
115
|
+
};
|
|
116
|
+
case "degraded":
|
|
117
|
+
return {
|
|
118
|
+
id: capability,
|
|
119
|
+
state: "degraded",
|
|
120
|
+
visible: true,
|
|
121
|
+
enabled: true,
|
|
122
|
+
reason,
|
|
123
|
+
};
|
|
124
|
+
case "unavailable":
|
|
125
|
+
return {
|
|
126
|
+
id: capability,
|
|
127
|
+
state: "unavailable",
|
|
128
|
+
visible: true,
|
|
129
|
+
enabled: false,
|
|
130
|
+
reason,
|
|
131
|
+
};
|
|
132
|
+
case "unsupported":
|
|
133
|
+
return {
|
|
134
|
+
id: capability,
|
|
135
|
+
state: "unsupported",
|
|
136
|
+
visible: false,
|
|
137
|
+
enabled: false,
|
|
138
|
+
reason,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Discovery that ran and omitted the capability is reporting unknown, not
|
|
143
|
+
// unsupported, so it must not be read as a denial.
|
|
144
|
+
if (source.discovery) {
|
|
145
|
+
return { id: capability, state: "unknown", visible: false, enabled: false };
|
|
146
|
+
}
|
|
147
|
+
const projected = source.capabilities?.[capability];
|
|
148
|
+
if (projected === undefined) {
|
|
149
|
+
return { id: capability, state: "unknown", visible: false, enabled: false };
|
|
150
|
+
}
|
|
151
|
+
const supported = capability === "reasoning" ? projected !== "none" : projected === true;
|
|
152
|
+
return supported
|
|
153
|
+
? { id: capability, state: "available", visible: true, enabled: true }
|
|
154
|
+
: { id: capability, state: "unsupported", visible: false, enabled: false };
|
|
155
|
+
}
|
|
156
|
+
/** Type-only assertion that keeps future protocol unions narrow. */
|
|
157
|
+
export function asAgentKitProtocolVersion(compatibility) {
|
|
158
|
+
return compatibility.selectedVersion;
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=compatibility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compatibility.js","sourceRoot":"","sources":["../../src/protocol/compatibility.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,gCAAgC,EAChC,qCAAqC,GACtC,MAAM,aAAa,CAAC;AAUrB,OAAO,EACL,sBAAsB,EACtB,oCAAoC,GAErC,MAAM,cAAc,CAAC;AAEtB,SAAS,iBAAiB,CAAC,MAAyB,EAAE,IAAY;IAChE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CAAC,GAAG,IAAI,8CAA8C,CAAC,CAAC;IAC7E,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACpC,IAAI,CAAC,MAA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abilityUnavailableError, AgentCapabilityUnsupportedError, AgentError, AgentOperationUnsupportedError, AgentRequestAbortedError, AgentProtocolMetadata, AgentProtocolVersionUnsupportedError } from "./index.js";
|
|
2
|
+
export interface AgentErrorOptions {
|
|
3
|
+
message?: string;
|
|
4
|
+
correlationId?: string;
|
|
5
|
+
details?: unknown;
|
|
6
|
+
metadata?: AgentProtocolMetadata;
|
|
7
|
+
}
|
|
8
|
+
/** Error thrown by transports while retaining the serializable wire error. */
|
|
9
|
+
export declare class AgentKitProtocolError<TError extends AgentError = AgentError> extends Error {
|
|
10
|
+
readonly protocolError: TError;
|
|
11
|
+
readonly code: TError["code"];
|
|
12
|
+
readonly retryable: TError["retryable"];
|
|
13
|
+
readonly correlationId: TError["correlationId"];
|
|
14
|
+
constructor(protocolError: TError);
|
|
15
|
+
}
|
|
16
|
+
export declare function createCapabilityUnsupportedError(capability: AgentCapabilityId, options?: AgentErrorOptions): AgentCapabilityUnsupportedError;
|
|
17
|
+
export declare function createCapabilityUnavailableError(capability: AgentCapabilityId, options?: AgentErrorOptions & {
|
|
18
|
+
retryable?: boolean;
|
|
19
|
+
}): AgentCapabilityUnavailableError;
|
|
20
|
+
export declare function createOperationUnsupportedError(operation: string, options?: AgentErrorOptions): AgentOperationUnsupportedError;
|
|
21
|
+
export declare function createRequestAbortedError(options?: AgentErrorOptions): AgentRequestAbortedError;
|
|
22
|
+
export declare function createProtocolVersionUnsupportedError(supportedVersions: AgentProtocolVersionUnsupportedError["supportedVersions"], receivedVersions: number[], options?: AgentErrorOptions): AgentProtocolVersionUnsupportedError;
|
|
23
|
+
export declare function isAgentKitProtocolError(value: unknown): value is AgentKitProtocolError;
|
|
24
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/protocol/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,+BAA+B,EAC/B,+BAA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AK,IAAI,qBAAqB,CAEhC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
function optionalErrorFields(options) {
|
|
2
|
+
return {
|
|
3
|
+
...(options.correlationId === undefined
|
|
4
|
+
? {}
|
|
5
|
+
: { correlationId: options.correlationId }),
|
|
6
|
+
...(options.details === undefined ? {} : { details: options.details }),
|
|
7
|
+
...(options.metadata === undefined ? {} : { metadata: options.metadata }),
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** Error thrown by transports while retaining the serializable wire error. */
|
|
11
|
+
export class AgentKitProtocolError extends Error {
|
|
12
|
+
protocolError;
|
|
13
|
+
code;
|
|
14
|
+
retryable;
|
|
15
|
+
correlationId;
|
|
16
|
+
constructor(protocolError) {
|
|
17
|
+
super(protocolError.message);
|
|
18
|
+
this.protocolError = protocolError;
|
|
19
|
+
this.name = "AgentKitProtocolError";
|
|
20
|
+
this.code = protocolError.code;
|
|
21
|
+
this.retryable = protocolError.retryable;
|
|
22
|
+
this.correlationId = protocolError.correlationId;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export function createCapabilityUnsupportedError(capability, options = {}) {
|
|
26
|
+
return {
|
|
27
|
+
code: "capability_unsupported",
|
|
28
|
+
capability,
|
|
29
|
+
message: options.message ??
|
|
30
|
+
`The ${JSON.stringify(capability)} capability is unsupported.`,
|
|
31
|
+
retryable: false,
|
|
32
|
+
...optionalErrorFields(options),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export function createCapabilityUnavailableError(capability, options = {}) {
|
|
36
|
+
return {
|
|
37
|
+
code: "capability_unavailable",
|
|
38
|
+
capability,
|
|
39
|
+
message: options.message ??
|
|
40
|
+
`The ${JSON.stringify(capability)} capability is currently unavailable.`,
|
|
41
|
+
retryable: options.retryable ?? true,
|
|
42
|
+
...optionalErrorFields(options),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function createOperationUnsupportedError(operation, options = {}) {
|
|
46
|
+
return {
|
|
47
|
+
code: "operation_unsupported",
|
|
48
|
+
operation,
|
|
49
|
+
message: options.message ??
|
|
50
|
+
`The ${JSON.stringify(operation)} operation is unsupported.`,
|
|
51
|
+
retryable: false,
|
|
52
|
+
...optionalErrorFields(options),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function createRequestAbortedError(options = {}) {
|
|
56
|
+
return {
|
|
57
|
+
code: "request_aborted",
|
|
58
|
+
message: options.message ?? "The AgentKit operation was aborted.",
|
|
59
|
+
retryable: false,
|
|
60
|
+
...optionalErrorFields(options),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function createProtocolVersionUnsupportedError(supportedVersions, receivedVersions, options = {}) {
|
|
64
|
+
return {
|
|
65
|
+
code: "protocol_version_unsupported",
|
|
66
|
+
supportedVersions: [...supportedVersions],
|
|
67
|
+
receivedVersions: [...receivedVersions],
|
|
68
|
+
message: options.message ??
|
|
69
|
+
`No compatible AgentKit protocol version was offered. Supported versions: ${supportedVersions.join(", ") || "none"}.`,
|
|
70
|
+
retryable: false,
|
|
71
|
+
...optionalErrorFields(options),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export function isAgentKitProtocolError(value) {
|
|
75
|
+
return value instanceof AgentKitProtocolError;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/protocol/errors.ts"],"names":[],"mappings":"AAkBA,SAAS,mBAAmB,CAC1B,OAA0B;IAE1B,OAAO;QACL,GAAG,CAAC,OAAO,CAAC,aAAa,KAAK,SAAS;YACrC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC;QAC7C,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC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