@artinet/sdk 0.5.14 → 0.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/server/express/server.d.ts +24 -24
- package/dist/services/a2a/factory/builder.d.ts +24 -24
- package/dist/services/a2a/helpers/message-builder.d.ts +1 -1
- package/dist/services/a2a/helpers/message-builder.js +4 -4
- package/dist/services/a2a/methods/get-task.d.ts +47 -47
- package/dist/services/a2a/methods/send-message.js +1 -1
- package/dist/services/a2a/methods/stream-message.js +1 -1
- package/dist/services/a2a/service.d.ts +157 -157
- package/dist/services/a2a/state/load.d.ts +1 -1
- package/dist/transport/trpc/a2a/factory/router.d.ts +1096 -1096
- package/dist/transport/trpc/a2a/routes/info.d.ts +37 -37
- package/dist/transport/trpc/a2a/routes/message/route.d.ts +227 -227
- package/dist/transport/trpc/a2a/routes/tasks/route.d.ts +260 -260
- package/dist/transport/trpc/a2a/trpc.d.ts +120 -120
- package/dist/types/interfaces/services/a2a/service.d.ts +1 -1
- package/dist/types/schemas/a2a/agent.d.ts +840 -840
- package/dist/types/schemas/a2a/agent.js +23 -2
- package/dist/types/schemas/a2a/auth.d.ts +197 -197
- package/dist/types/schemas/a2a/auth.js +19 -4
- package/dist/types/schemas/a2a/error.d.ts +24 -24
- package/dist/types/schemas/a2a/message.d.ts +4525 -4525
- package/dist/types/schemas/a2a/message.js +10 -2
- package/dist/types/schemas/a2a/notification.d.ts +403 -403
- package/dist/types/schemas/a2a/notification.js +7 -3
- package/dist/types/schemas/a2a/parameters.d.ts +264 -264
- package/dist/types/schemas/a2a/parameters.js +14 -1
- package/dist/types/schemas/a2a/protocol.d.ts +6042 -6042
- package/dist/types/schemas/a2a/rpc.d.ts +20 -20
- package/dist/types/schemas/a2a/rpc.js +5 -0
- package/dist/types/schemas/a2a/task.d.ts +2536 -2536
- package/dist/types/schemas/a2a/task.js +12 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -69,6 +69,9 @@ It has [serveral template projects](https://github.com/the-artinet-project/creat
|
|
|
69
69
|
- The `A2AClient` now checks `/.well-known/agent-card.json` as a opposed to `/.well-known/agent.json` in-line with the A2A spec.
|
|
70
70
|
- The `A2AClient` now uses uses the `AgentCard`.url if an `AgentCard` has been successfully retrieved, else it will default to the `baseUrl`.
|
|
71
71
|
- The examples folder will be removed in favor of [`create-agent`](https://github.com/the-artinet-project/create-agent).
|
|
72
|
+
- In `Task` the `contextId` field is now required (inline with the A2A spec).
|
|
73
|
+
- In `AgentSkill` the `tag` field is now required (inline with the A2A spec).
|
|
74
|
+
- Optional fields in Agent2Agent schema fields are now nullable for better interoperability.
|
|
72
75
|
|
|
73
76
|
## Installation
|
|
74
77
|
|
|
@@ -23,48 +23,48 @@ export declare function createAgentServer(params: ServerParams & {
|
|
|
23
23
|
parts: ({
|
|
24
24
|
file: {
|
|
25
25
|
bytes: string;
|
|
26
|
-
name?: string | undefined;
|
|
27
|
-
mimeType?: string | undefined;
|
|
28
|
-
uri?: undefined;
|
|
26
|
+
name?: string | null | undefined;
|
|
27
|
+
mimeType?: string | null | undefined;
|
|
28
|
+
uri?: null | undefined;
|
|
29
29
|
} | {
|
|
30
30
|
uri: string;
|
|
31
|
-
name?: string | undefined;
|
|
32
|
-
bytes?: undefined;
|
|
33
|
-
mimeType?: string | undefined;
|
|
31
|
+
name?: string | null | undefined;
|
|
32
|
+
bytes?: null | undefined;
|
|
33
|
+
mimeType?: string | null | undefined;
|
|
34
34
|
};
|
|
35
35
|
kind: "file";
|
|
36
|
-
metadata?: Record<string, unknown> | undefined;
|
|
36
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
37
37
|
} | {
|
|
38
38
|
text: string;
|
|
39
39
|
kind: "text";
|
|
40
|
-
metadata?: Record<string, unknown> | undefined;
|
|
40
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
41
41
|
} | {
|
|
42
42
|
data: Record<string, unknown>;
|
|
43
43
|
kind: "data";
|
|
44
|
-
metadata?: Record<string, unknown> | undefined;
|
|
44
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
45
45
|
})[];
|
|
46
46
|
messageId: string;
|
|
47
|
-
metadata?: Record<string, unknown> | undefined;
|
|
48
|
-
extensions?: string[] | undefined;
|
|
49
|
-
referenceTaskIds?: string[] | undefined;
|
|
50
|
-
taskId?: string | undefined;
|
|
51
|
-
contextId?: string | undefined;
|
|
47
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
48
|
+
extensions?: string[] | null | undefined;
|
|
49
|
+
referenceTaskIds?: string[] | null | undefined;
|
|
50
|
+
taskId?: string | null | undefined;
|
|
51
|
+
contextId?: string | null | undefined;
|
|
52
52
|
};
|
|
53
|
-
metadata?: Record<string, unknown> | undefined;
|
|
53
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
54
54
|
configuration?: {
|
|
55
|
-
historyLength?: number | undefined;
|
|
55
|
+
historyLength?: number | null | undefined;
|
|
56
56
|
pushNotificationConfig?: {
|
|
57
57
|
url: string;
|
|
58
|
-
id?: string | undefined;
|
|
59
|
-
token?: string | undefined;
|
|
58
|
+
id?: string | null | undefined;
|
|
59
|
+
token?: string | null | undefined;
|
|
60
60
|
authentication?: {
|
|
61
61
|
schemes: string[];
|
|
62
|
-
credentials?: string | undefined;
|
|
63
|
-
} | undefined;
|
|
64
|
-
} | undefined;
|
|
65
|
-
acceptedOutputModes?: string[] | undefined;
|
|
66
|
-
blocking?: boolean | undefined;
|
|
67
|
-
} | undefined;
|
|
62
|
+
credentials?: string | null | undefined;
|
|
63
|
+
} | null | undefined;
|
|
64
|
+
} | null | undefined;
|
|
65
|
+
acceptedOutputModes?: string[] | null | undefined;
|
|
66
|
+
blocking?: boolean | null | undefined;
|
|
67
|
+
} | null | undefined;
|
|
68
68
|
}, import("../../types/index.js").TaskAndHistory, import("../../types/index.js").UpdateEvent>;
|
|
69
69
|
};
|
|
70
70
|
export type ExpressAgentServer = ReturnType<typeof createAgentServer>;
|
|
@@ -282,48 +282,48 @@ export declare const AgentBuilder: () => EngineBuilder<{
|
|
|
282
282
|
parts: ({
|
|
283
283
|
file: {
|
|
284
284
|
bytes: string;
|
|
285
|
-
name?: string | undefined;
|
|
286
|
-
mimeType?: string | undefined;
|
|
287
|
-
uri?: undefined;
|
|
285
|
+
name?: string | null | undefined;
|
|
286
|
+
mimeType?: string | null | undefined;
|
|
287
|
+
uri?: null | undefined;
|
|
288
288
|
} | {
|
|
289
289
|
uri: string;
|
|
290
|
-
name?: string | undefined;
|
|
291
|
-
bytes?: undefined;
|
|
292
|
-
mimeType?: string | undefined;
|
|
290
|
+
name?: string | null | undefined;
|
|
291
|
+
bytes?: null | undefined;
|
|
292
|
+
mimeType?: string | null | undefined;
|
|
293
293
|
};
|
|
294
294
|
kind: "file";
|
|
295
|
-
metadata?: Record<string, unknown> | undefined;
|
|
295
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
296
296
|
} | {
|
|
297
297
|
text: string;
|
|
298
298
|
kind: "text";
|
|
299
|
-
metadata?: Record<string, unknown> | undefined;
|
|
299
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
300
300
|
} | {
|
|
301
301
|
data: Record<string, unknown>;
|
|
302
302
|
kind: "data";
|
|
303
|
-
metadata?: Record<string, unknown> | undefined;
|
|
303
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
304
304
|
})[];
|
|
305
305
|
messageId: string;
|
|
306
|
-
metadata?: Record<string, unknown> | undefined;
|
|
307
|
-
extensions?: string[] | undefined;
|
|
308
|
-
referenceTaskIds?: string[] | undefined;
|
|
309
|
-
taskId?: string | undefined;
|
|
310
|
-
contextId?: string | undefined;
|
|
306
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
307
|
+
extensions?: string[] | null | undefined;
|
|
308
|
+
referenceTaskIds?: string[] | null | undefined;
|
|
309
|
+
taskId?: string | null | undefined;
|
|
310
|
+
contextId?: string | null | undefined;
|
|
311
311
|
};
|
|
312
|
-
metadata?: Record<string, unknown> | undefined;
|
|
312
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
313
313
|
configuration?: {
|
|
314
|
-
historyLength?: number | undefined;
|
|
314
|
+
historyLength?: number | null | undefined;
|
|
315
315
|
pushNotificationConfig?: {
|
|
316
316
|
url: string;
|
|
317
|
-
id?: string | undefined;
|
|
318
|
-
token?: string | undefined;
|
|
317
|
+
id?: string | null | undefined;
|
|
318
|
+
token?: string | null | undefined;
|
|
319
319
|
authentication?: {
|
|
320
320
|
schemes: string[];
|
|
321
|
-
credentials?: string | undefined;
|
|
322
|
-
} | undefined;
|
|
323
|
-
} | undefined;
|
|
324
|
-
acceptedOutputModes?: string[] | undefined;
|
|
325
|
-
blocking?: boolean | undefined;
|
|
326
|
-
} | undefined;
|
|
321
|
+
credentials?: string | null | undefined;
|
|
322
|
+
} | null | undefined;
|
|
323
|
+
} | null | undefined;
|
|
324
|
+
acceptedOutputModes?: string[] | null | undefined;
|
|
325
|
+
blocking?: boolean | null | undefined;
|
|
326
|
+
} | null | undefined;
|
|
327
327
|
}, []>;
|
|
328
328
|
/**
|
|
329
329
|
* Creates an agent execution engine from a list of workflow steps.
|
|
@@ -6,7 +6,7 @@ export declare class MessageBuilder {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class MessageSendConfigurationBuilder {
|
|
8
8
|
configuration: MessageSendConfiguration;
|
|
9
|
-
constructor(configuration?: Partial<MessageSendConfiguration>);
|
|
9
|
+
constructor(configuration?: Partial<MessageSendConfiguration> | null);
|
|
10
10
|
valueOf(): MessageSendConfiguration;
|
|
11
11
|
}
|
|
12
12
|
export declare const createMessageSendParams: (messageSendParams: Partial<MessageSendParams> | string) => MessageSendParams;
|
|
@@ -35,15 +35,15 @@ export class MessageSendConfigurationBuilder {
|
|
|
35
35
|
};
|
|
36
36
|
constructor(configuration = {}) {
|
|
37
37
|
this.configuration.acceptedOutputModes =
|
|
38
|
-
configuration
|
|
38
|
+
configuration?.acceptedOutputModes ??
|
|
39
39
|
this.configuration.acceptedOutputModes;
|
|
40
40
|
this.configuration.historyLength =
|
|
41
|
-
configuration
|
|
41
|
+
configuration?.historyLength ?? this.configuration.historyLength;
|
|
42
42
|
this.configuration.pushNotificationConfig =
|
|
43
|
-
configuration
|
|
43
|
+
configuration?.pushNotificationConfig ??
|
|
44
44
|
this.configuration.pushNotificationConfig;
|
|
45
45
|
this.configuration.blocking =
|
|
46
|
-
configuration
|
|
46
|
+
configuration?.blocking ?? this.configuration.blocking;
|
|
47
47
|
}
|
|
48
48
|
valueOf() {
|
|
49
49
|
return this.configuration;
|
|
@@ -13,100 +13,100 @@ export declare function getTask(input: TaskQueryParams, params: Omit<MethodParam
|
|
|
13
13
|
parts: ({
|
|
14
14
|
file: {
|
|
15
15
|
bytes: string;
|
|
16
|
-
name?: string | undefined;
|
|
17
|
-
mimeType?: string | undefined;
|
|
18
|
-
uri?: undefined;
|
|
16
|
+
name?: string | null | undefined;
|
|
17
|
+
mimeType?: string | null | undefined;
|
|
18
|
+
uri?: null | undefined;
|
|
19
19
|
} | {
|
|
20
20
|
uri: string;
|
|
21
|
-
name?: string | undefined;
|
|
22
|
-
bytes?: undefined;
|
|
23
|
-
mimeType?: string | undefined;
|
|
21
|
+
name?: string | null | undefined;
|
|
22
|
+
bytes?: null | undefined;
|
|
23
|
+
mimeType?: string | null | undefined;
|
|
24
24
|
};
|
|
25
25
|
kind: "file";
|
|
26
|
-
metadata?: Record<string, unknown> | undefined;
|
|
26
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
27
27
|
} | {
|
|
28
28
|
text: string;
|
|
29
29
|
kind: "text";
|
|
30
|
-
metadata?: Record<string, unknown> | undefined;
|
|
30
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
31
31
|
} | {
|
|
32
32
|
data: Record<string, unknown>;
|
|
33
33
|
kind: "data";
|
|
34
|
-
metadata?: Record<string, unknown> | undefined;
|
|
34
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
35
35
|
})[];
|
|
36
36
|
messageId: string;
|
|
37
|
-
metadata?: Record<string, unknown> | undefined;
|
|
38
|
-
extensions?: string[] | undefined;
|
|
39
|
-
referenceTaskIds?: string[] | undefined;
|
|
40
|
-
taskId?: string | undefined;
|
|
41
|
-
contextId?: string | undefined;
|
|
42
|
-
} | undefined;
|
|
43
|
-
timestamp?: string | undefined;
|
|
37
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
38
|
+
extensions?: string[] | null | undefined;
|
|
39
|
+
referenceTaskIds?: string[] | null | undefined;
|
|
40
|
+
taskId?: string | null | undefined;
|
|
41
|
+
contextId?: string | null | undefined;
|
|
42
|
+
} | null | undefined;
|
|
43
|
+
timestamp?: string | null | undefined;
|
|
44
44
|
};
|
|
45
45
|
kind: "task";
|
|
46
|
-
|
|
46
|
+
contextId: string;
|
|
47
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
47
48
|
history?: {
|
|
48
49
|
role: "user" | "agent";
|
|
49
50
|
kind: "message";
|
|
50
51
|
parts: ({
|
|
51
52
|
file: {
|
|
52
53
|
bytes: string;
|
|
53
|
-
name?: string | undefined;
|
|
54
|
-
mimeType?: string | undefined;
|
|
55
|
-
uri?: undefined;
|
|
54
|
+
name?: string | null | undefined;
|
|
55
|
+
mimeType?: string | null | undefined;
|
|
56
|
+
uri?: null | undefined;
|
|
56
57
|
} | {
|
|
57
58
|
uri: string;
|
|
58
|
-
name?: string | undefined;
|
|
59
|
-
bytes?: undefined;
|
|
60
|
-
mimeType?: string | undefined;
|
|
59
|
+
name?: string | null | undefined;
|
|
60
|
+
bytes?: null | undefined;
|
|
61
|
+
mimeType?: string | null | undefined;
|
|
61
62
|
};
|
|
62
63
|
kind: "file";
|
|
63
|
-
metadata?: Record<string, unknown> | undefined;
|
|
64
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
64
65
|
} | {
|
|
65
66
|
text: string;
|
|
66
67
|
kind: "text";
|
|
67
|
-
metadata?: Record<string, unknown> | undefined;
|
|
68
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
68
69
|
} | {
|
|
69
70
|
data: Record<string, unknown>;
|
|
70
71
|
kind: "data";
|
|
71
|
-
metadata?: Record<string, unknown> | undefined;
|
|
72
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
72
73
|
})[];
|
|
73
74
|
messageId: string;
|
|
74
|
-
metadata?: Record<string, unknown> | undefined;
|
|
75
|
-
extensions?: string[] | undefined;
|
|
76
|
-
referenceTaskIds?: string[] | undefined;
|
|
77
|
-
taskId?: string | undefined;
|
|
78
|
-
contextId?: string | undefined;
|
|
79
|
-
}[] | undefined;
|
|
80
|
-
contextId?: string | undefined;
|
|
75
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
76
|
+
extensions?: string[] | null | undefined;
|
|
77
|
+
referenceTaskIds?: string[] | null | undefined;
|
|
78
|
+
taskId?: string | null | undefined;
|
|
79
|
+
contextId?: string | null | undefined;
|
|
80
|
+
}[] | null | undefined;
|
|
81
81
|
artifacts?: {
|
|
82
82
|
artifactId: string;
|
|
83
83
|
parts: ({
|
|
84
84
|
file: {
|
|
85
85
|
bytes: string;
|
|
86
|
-
name?: string | undefined;
|
|
87
|
-
mimeType?: string | undefined;
|
|
88
|
-
uri?: undefined;
|
|
86
|
+
name?: string | null | undefined;
|
|
87
|
+
mimeType?: string | null | undefined;
|
|
88
|
+
uri?: null | undefined;
|
|
89
89
|
} | {
|
|
90
90
|
uri: string;
|
|
91
|
-
name?: string | undefined;
|
|
92
|
-
bytes?: undefined;
|
|
93
|
-
mimeType?: string | undefined;
|
|
91
|
+
name?: string | null | undefined;
|
|
92
|
+
bytes?: null | undefined;
|
|
93
|
+
mimeType?: string | null | undefined;
|
|
94
94
|
};
|
|
95
95
|
kind: "file";
|
|
96
|
-
metadata?: Record<string, unknown> | undefined;
|
|
96
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
97
97
|
} | {
|
|
98
98
|
text: string;
|
|
99
99
|
kind: "text";
|
|
100
|
-
metadata?: Record<string, unknown> | undefined;
|
|
100
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
101
101
|
} | {
|
|
102
102
|
data: Record<string, unknown>;
|
|
103
103
|
kind: "data";
|
|
104
|
-
metadata?: Record<string, unknown> | undefined;
|
|
104
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
105
105
|
})[];
|
|
106
|
-
name?: string | undefined;
|
|
107
|
-
metadata?: Record<string, unknown> | undefined;
|
|
108
|
-
description?: string | undefined;
|
|
109
|
-
extension?: string[] | undefined;
|
|
110
|
-
}[] | undefined;
|
|
106
|
+
name?: string | null | undefined;
|
|
107
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
108
|
+
description?: string | null | undefined;
|
|
109
|
+
extension?: string[] | null | undefined;
|
|
110
|
+
}[] | null | undefined;
|
|
111
111
|
}>;
|
|
112
112
|
export type GetTaskMethod = typeof getTask;
|
|
@@ -6,7 +6,7 @@ import { createContext } from "../factory/context.js";
|
|
|
6
6
|
export async function sendMessage(input, params) {
|
|
7
7
|
const { service, engine, contextManager, signal } = params;
|
|
8
8
|
const contextId = input.message.contextId;
|
|
9
|
-
const context = createContext(input, service, contextManager, signal, contextId, service.eventOverrides);
|
|
9
|
+
const context = createContext(input, service, contextManager, signal, contextId ?? undefined, service.eventOverrides);
|
|
10
10
|
context.events.on("complete", () => {
|
|
11
11
|
contextManager.deleteContext(context.events.contextId);
|
|
12
12
|
});
|
|
@@ -7,7 +7,7 @@ import { createContext } from "../factory/context.js";
|
|
|
7
7
|
export async function* streamMessage(input, params) {
|
|
8
8
|
const { service, engine, contextManager, signal } = params;
|
|
9
9
|
let contextId = input.message.contextId;
|
|
10
|
-
const context = createContext(input, service, contextManager, signal, contextId, service.eventOverrides);
|
|
10
|
+
const context = createContext(input, service, contextManager, signal, contextId ?? undefined, service.eventOverrides);
|
|
11
11
|
const stream = new StreamManager(context);
|
|
12
12
|
contextId = stream.getContextId();
|
|
13
13
|
context.events.on("complete", () => {
|