agentstack-sdk 0.6.1 → 0.6.2-rc2
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 +36 -29
- package/dist/api.cjs +1994 -2
- package/dist/api.d.cts +29 -0
- package/dist/api.d.ts +25 -1
- package/dist/api.js +1801 -2
- package/dist/core-DcGxYeok.d.ts +1238 -0
- package/dist/core-XN6gWSAb.d.cts +1238 -0
- package/dist/core.cjs +1773 -2
- package/dist/core.d.cts +7 -0
- package/dist/core.d.ts +7 -5
- package/dist/core.js +1725 -2
- package/dist/extensions.cjs +798 -2
- package/dist/extensions.d.cts +244 -0
- package/dist/extensions.d.ts +240 -1
- package/dist/extensions.js +652 -2
- package/dist/index.cjs +3142 -2
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -7
- package/dist/index.js +2781 -2
- package/dist/index.umd.js +16509 -2
- package/dist/schemas-Dy3P_eAt.d.cts +57 -0
- package/dist/schemas-Dy3P_eAt.d.ts +57 -0
- package/dist/server.cjs +2762 -0
- package/dist/server.d.cts +244 -0
- package/dist/server.d.ts +244 -0
- package/dist/server.js +2716 -0
- package/dist/types-B5B3b0V2.d.cts +396 -0
- package/dist/types-B5B3b0V2.d.ts +396 -0
- package/dist/types-CmEs5_Ag.d.cts +3522 -0
- package/dist/types-DJm5-rZZ.d.ts +3522 -0
- package/dist/types-DvLt-XuC.d.ts +866 -0
- package/dist/types-E26YDM19.d.cts +866 -0
- package/dist/types-MfIzGgpV.d.cts +43 -0
- package/dist/types-MfIzGgpV.d.ts +43 -0
- package/package.json +36 -21
- package/src/client/a2a/extensions/auth/oauth/index.ts +6 -6
- package/src/client/a2a/extensions/auth/secrets/index.ts +6 -6
- package/src/client/a2a/extensions/interactions/approval/index.ts +7 -7
- package/src/client/a2a/extensions/services/embedding/index.ts +7 -3
- package/src/client/a2a/extensions/services/form/index.ts +3 -3
- package/src/client/a2a/extensions/services/llm/index.ts +3 -3
- package/src/client/a2a/extensions/services/mcp/index.ts +3 -3
- package/src/client/a2a/extensions/services/platform-api/index.ts +2 -2
- package/src/client/a2a/extensions/ui/agent-detail/index.ts +4 -4
- package/src/client/a2a/extensions/ui/canvas/index.ts +4 -4
- package/src/client/a2a/extensions/ui/citation/index.ts +4 -4
- package/src/client/a2a/extensions/ui/error/index.ts +4 -4
- package/src/client/a2a/extensions/ui/form-request/index.ts +4 -4
- package/src/client/a2a/extensions/ui/settings/index.ts +7 -3
- package/src/client/a2a/extensions/ui/trajectory/index.ts +4 -4
- package/src/client/core/extensions/types.ts +8 -1
- package/src/client/core/handle-task-status-update.ts +10 -3
- package/src/client/core/index.ts +1 -0
- package/src/client/core/utils/extract-text-from-message.ts +15 -0
- package/src/examples/hello-world.ts +34 -0
- package/src/experimental/server/a2a/extensions/agent-detail/index.ts +35 -0
- package/src/experimental/server/a2a/extensions/agent-detail/types.ts +10 -0
- package/src/experimental/server/a2a/extensions/index.ts +11 -0
- package/src/experimental/server/a2a/extensions/llm/index.ts +70 -0
- package/src/experimental/server/a2a/extensions/llm/types.ts +16 -0
- package/src/experimental/server/a2a/extensions/platform-self-registration/index.ts +34 -0
- package/src/experimental/server/a2a/extensions/platform-self-registration/types.ts +10 -0
- package/src/experimental/server/a2a/helpers.ts +95 -0
- package/{dist/client/a2a/index.d.ts → src/experimental/server/a2a/index.ts} +1 -1
- package/src/experimental/server/a2a/utils.ts +43 -0
- package/src/experimental/server/core/config/index.ts +17 -0
- package/src/experimental/server/core/config/schemas.ts +15 -0
- package/src/experimental/server/core/config/types.ts +10 -0
- package/src/experimental/server/core/context/index.ts +18 -0
- package/src/experimental/server/core/extensions/types.ts +24 -0
- package/{dist/client/a2a/protocol/index.d.ts → src/experimental/server/core/index.ts} +4 -0
- package/{dist/client/a2a/protocol/tests.d.ts → src/experimental/server/core/schemas.ts} +2 -1
- package/src/experimental/server/core/server/autoregistration.ts +142 -0
- package/src/experimental/server/core/server/executor.ts +284 -0
- package/src/experimental/server/core/server/helpers.ts +12 -0
- package/src/experimental/server/core/server/index.ts +166 -0
- package/src/experimental/server/core/server/types.ts +58 -0
- package/src/experimental/server/core/types.ts +8 -0
- package/src/experimental/server/core/utils.ts +59 -0
- package/{dist/client/api/core/errors/index.d.ts → src/server.ts} +3 -2
- package/dist/api.cjs.map +0 -1
- package/dist/api.js.map +0 -1
- package/dist/api.umd.js +0 -2
- package/dist/api.umd.js.map +0 -1
- package/dist/client/a2a/extensions/auth/oauth/index.d.ts +0 -10
- package/dist/client/a2a/extensions/auth/oauth/schemas.d.ts +0 -32
- package/dist/client/a2a/extensions/auth/oauth/types.d.ts +0 -13
- package/dist/client/a2a/extensions/auth/secrets/index.d.ts +0 -10
- package/dist/client/a2a/extensions/auth/secrets/schemas.d.ts +0 -23
- package/dist/client/a2a/extensions/auth/secrets/types.d.ts +0 -10
- package/dist/client/a2a/extensions/common/form/schemas.d.ts +0 -290
- package/dist/client/a2a/extensions/common/form/types.d.ts +0 -24
- package/dist/client/a2a/extensions/index.d.ts +0 -21
- package/dist/client/a2a/extensions/interactions/approval/index.d.ts +0 -10
- package/dist/client/a2a/extensions/interactions/approval/schemas.d.ts +0 -43
- package/dist/client/a2a/extensions/interactions/approval/types.d.ts +0 -14
- package/dist/client/a2a/extensions/schemas.d.ts +0 -19
- package/dist/client/a2a/extensions/services/embedding/index.d.ts +0 -9
- package/dist/client/a2a/extensions/services/embedding/schemas.d.ts +0 -29
- package/dist/client/a2a/extensions/services/embedding/types.d.ts +0 -10
- package/dist/client/a2a/extensions/services/form/index.d.ts +0 -9
- package/dist/client/a2a/extensions/services/form/schemas.d.ts +0 -97
- package/dist/client/a2a/extensions/services/form/types.d.ts +0 -8
- package/dist/client/a2a/extensions/services/llm/index.d.ts +0 -9
- package/dist/client/a2a/extensions/services/llm/schemas.d.ts +0 -29
- package/dist/client/a2a/extensions/services/llm/types.d.ts +0 -10
- package/dist/client/a2a/extensions/services/mcp/index.d.ts +0 -9
- package/dist/client/a2a/extensions/services/mcp/schemas.d.ts +0 -35
- package/dist/client/a2a/extensions/services/mcp/types.d.ts +0 -14
- package/dist/client/a2a/extensions/services/platform-api/index.d.ts +0 -11
- package/dist/client/a2a/extensions/services/platform-api/schemas.d.ts +0 -10
- package/dist/client/a2a/extensions/services/platform-api/types.d.ts +0 -7
- package/dist/client/a2a/extensions/types.d.ts +0 -19
- package/dist/client/a2a/extensions/ui/agent-detail/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/agent-detail/schemas.d.ts +0 -41
- package/dist/client/a2a/extensions/ui/agent-detail/types.d.ts +0 -13
- package/dist/client/a2a/extensions/ui/canvas/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/canvas/schemas.d.ts +0 -11
- package/dist/client/a2a/extensions/ui/canvas/types.d.ts +0 -7
- package/dist/client/a2a/extensions/ui/citation/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/citation/schemas.d.ts +0 -21
- package/dist/client/a2a/extensions/ui/citation/types.d.ts +0 -8
- package/dist/client/a2a/extensions/ui/error/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/error/schemas.d.ts +0 -30
- package/dist/client/a2a/extensions/ui/error/types.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/form-request/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/settings/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/settings/schemas.d.ts +0 -113
- package/dist/client/a2a/extensions/ui/settings/types.d.ts +0 -18
- package/dist/client/a2a/extensions/ui/trajectory/index.d.ts +0 -9
- package/dist/client/a2a/extensions/ui/trajectory/schemas.d.ts +0 -10
- package/dist/client/a2a/extensions/ui/trajectory/types.d.ts +0 -7
- package/dist/client/a2a/protocol/schemas.d.ts +0 -988
- package/dist/client/a2a/protocol/types.d.ts +0 -52
- package/dist/client/a2a/protocol/utils.d.ts +0 -6
- package/dist/client/api/common/schemas.d.ts +0 -30
- package/dist/client/api/common/types.d.ts +0 -18
- package/dist/client/api/configuration/api.d.ts +0 -22
- package/dist/client/api/configuration/schemas.d.ts +0 -31
- package/dist/client/api/configuration/types.d.ts +0 -11
- package/dist/client/api/connectors/api.d.ts +0 -78
- package/dist/client/api/connectors/schemas.d.ts +0 -114
- package/dist/client/api/connectors/types.d.ts +0 -28
- package/dist/client/api/contexts/api.d.ts +0 -133
- package/dist/client/api/contexts/schemas.d.ts +0 -359
- package/dist/client/api/contexts/types.d.ts +0 -34
- package/dist/client/api/core/client.d.ts +0 -1273
- package/dist/client/api/core/errors/types.d.ts +0 -36
- package/dist/client/api/core/errors/utils.d.ts +0 -23
- package/dist/client/api/core/index.d.ts +0 -7
- package/dist/client/api/core/schemas.d.ts +0 -17
- package/dist/client/api/core/types.d.ts +0 -45
- package/dist/client/api/core/utils.d.ts +0 -23
- package/dist/client/api/files/api.d.ts +0 -32
- package/dist/client/api/files/schemas.d.ts +0 -61
- package/dist/client/api/files/types.d.ts +0 -19
- package/dist/client/api/index.d.ts +0 -7
- package/dist/client/api/model-providers/api.d.ts +0 -50
- package/dist/client/api/model-providers/schemas.d.ts +0 -80
- package/dist/client/api/model-providers/types.d.ts +0 -44
- package/dist/client/api/provider-builds/api.d.ts +0 -143
- package/dist/client/api/provider-builds/schemas.d.ts +0 -250
- package/dist/client/api/provider-builds/types.d.ts +0 -31
- package/dist/client/api/providers/api.d.ts +0 -847
- package/dist/client/api/providers/schemas.d.ts +0 -1335
- package/dist/client/api/providers/types.d.ts +0 -45
- package/dist/client/api/schemas.d.ts +0 -15
- package/dist/client/api/types.d.ts +0 -15
- package/dist/client/api/user-feedback/api.d.ts +0 -9
- package/dist/client/api/user-feedback/schemas.d.ts +0 -15
- package/dist/client/api/user-feedback/types.d.ts +0 -8
- package/dist/client/api/users/api.d.ts +0 -13
- package/dist/client/api/users/schemas.d.ts +0 -20
- package/dist/client/api/users/types.d.ts +0 -14
- package/dist/client/api/variables/api.d.ts +0 -12
- package/dist/client/api/variables/schemas.d.ts +0 -13
- package/dist/client/api/variables/types.d.ts +0 -10
- package/dist/client/core/create-authenticated-fetch.d.ts +0 -5
- package/dist/client/core/extensions/extract.d.ts +0 -8
- package/dist/client/core/extensions/fulfill.d.ts +0 -8
- package/dist/client/core/extensions/resolve-user-metadata.d.ts +0 -6
- package/dist/client/core/extensions/types.d.ts +0 -68
- package/dist/client/core/fulfillment-resolvers/build-llm-extension-fulfillment-resolver.d.ts +0 -8
- package/dist/client/core/handle-agent-card.d.ts +0 -128
- package/dist/client/core/handle-task-status-update.d.ts +0 -7
- package/dist/client/core/index.d.ts +0 -14
- package/dist/client/core/utils/build-message-builder.d.ts +0 -9
- package/dist/client/core/utils/get-agent-card-path.d.ts +0 -5
- package/dist/core.cjs.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/core.umd.js +0 -2
- package/dist/core.umd.js.map +0 -1
- package/dist/extensions.cjs.map +0 -1
- package/dist/extensions.js.map +0 -1
- package/dist/extensions.umd.js +0 -2
- package/dist/extensions.umd.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { AgentExtension, Message, Task, Part, TaskStatus, TaskStatusUpdateEvent, Artifact, AgentCard } from '@a2a-js/sdk';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import z__default, { z as z$1 } from 'zod';
|
|
4
|
+
import { A as AgentDetail } from './schemas-Dy3P_eAt.cjs';
|
|
5
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
6
|
+
import { b as LLMFulfillment, c as LLMFulfillments, L as LLMDemand } from './types-MfIzGgpV.cjs';
|
|
7
|
+
import { ba as buildApiClient } from './types-CmEs5_Ag.cjs';
|
|
8
|
+
import './types-B5B3b0V2.cjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
interface ExtensionSpec<TParams = unknown, TFulfillments = unknown> {
|
|
16
|
+
uri: string;
|
|
17
|
+
params?: TParams;
|
|
18
|
+
fulfillmentsSchema?: z$1.ZodSchema<TFulfillments>;
|
|
19
|
+
toAgentCardExtension(): AgentExtension;
|
|
20
|
+
parseFulfillments(message: Message): TFulfillments | undefined;
|
|
21
|
+
}
|
|
22
|
+
interface ExtensionServer<TDeps = unknown, TParams = unknown, TFulfillments = unknown> {
|
|
23
|
+
spec: ExtensionSpec<TParams, TFulfillments>;
|
|
24
|
+
resolveDeps(fulfillments: TFulfillments | undefined): TDeps;
|
|
25
|
+
}
|
|
26
|
+
type ExtensionConfig<TDeps = unknown> = {
|
|
27
|
+
[K in keyof TDeps]: ExtensionServer<TDeps[K], unknown, unknown>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
32
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
type AgentDetailExtensionParams = AgentDetail;
|
|
36
|
+
type AgentDetailExtensionFulfillments = undefined;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
40
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare class AgentDetailExtensionSpec implements ExtensionSpec<AgentDetailExtensionParams, AgentDetailExtensionFulfillments> {
|
|
44
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/ui/agent-detail/v1";
|
|
45
|
+
readonly params: AgentDetailExtensionParams;
|
|
46
|
+
constructor(params: AgentDetailExtensionParams);
|
|
47
|
+
toAgentCardExtension(): {
|
|
48
|
+
uri: string;
|
|
49
|
+
required: boolean;
|
|
50
|
+
params: {
|
|
51
|
+
interaction_mode?: string | null | undefined;
|
|
52
|
+
user_greeting?: string | null | undefined;
|
|
53
|
+
input_placeholder?: string | null | undefined;
|
|
54
|
+
tools?: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
}[] | null | undefined;
|
|
58
|
+
framework?: string | null | undefined;
|
|
59
|
+
license?: string | null | undefined;
|
|
60
|
+
programming_language?: string | null | undefined;
|
|
61
|
+
homepage_url?: string | null | undefined;
|
|
62
|
+
source_code_url?: string | null | undefined;
|
|
63
|
+
container_image_url?: string | null | undefined;
|
|
64
|
+
author?: {
|
|
65
|
+
name: string;
|
|
66
|
+
email?: string | null | undefined;
|
|
67
|
+
url?: string | null | undefined;
|
|
68
|
+
} | null | undefined;
|
|
69
|
+
contributors?: {
|
|
70
|
+
name: string;
|
|
71
|
+
email?: string | null | undefined;
|
|
72
|
+
url?: string | null | undefined;
|
|
73
|
+
}[] | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
parseFulfillments(): undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
81
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
interface LLMExtensionParams {
|
|
85
|
+
demands: Record<string, LLMDemand>;
|
|
86
|
+
}
|
|
87
|
+
type LLMExtensionFulfillments = LLMFulfillments;
|
|
88
|
+
interface LLMExtensionDeps {
|
|
89
|
+
fulfillments?: Record<string, LLMFulfillment>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class LLMExtensionSpec implements ExtensionSpec<LLMExtensionParams, LLMExtensionFulfillments> {
|
|
93
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/services/llm/v1";
|
|
94
|
+
readonly params: LLMExtensionParams;
|
|
95
|
+
readonly fulfillmentsSchema: z.ZodObject<{
|
|
96
|
+
llm_fulfillments: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
97
|
+
identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
api_base: z.ZodString;
|
|
99
|
+
api_key: z.ZodString;
|
|
100
|
+
api_model: z.ZodString;
|
|
101
|
+
}, zod_v4_core.$strip>>;
|
|
102
|
+
}, zod_v4_core.$strip>;
|
|
103
|
+
constructor(params: LLMExtensionParams);
|
|
104
|
+
toAgentCardExtension(): {
|
|
105
|
+
uri: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
params: {
|
|
108
|
+
llm_demands: Record<string, {
|
|
109
|
+
description?: string | null | undefined;
|
|
110
|
+
suggested?: string[] | null | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
parseFulfillments(message: Message): {
|
|
115
|
+
llm_fulfillments: Record<string, {
|
|
116
|
+
api_base: string;
|
|
117
|
+
api_key: string;
|
|
118
|
+
api_model: string;
|
|
119
|
+
identifier?: string | null | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
} | undefined;
|
|
122
|
+
}
|
|
123
|
+
declare class LLMExtensionServer implements ExtensionServer<LLMExtensionDeps, LLMExtensionParams, LLMExtensionFulfillments> {
|
|
124
|
+
readonly spec: LLMExtensionSpec;
|
|
125
|
+
constructor(params: LLMExtensionParams);
|
|
126
|
+
resolveDeps(fulfillments: LLMExtensionFulfillments | undefined): LLMExtensionDeps;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
131
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
132
|
+
*/
|
|
133
|
+
interface PlatformSelfRegistrationExtensionParams extends Record<string, unknown> {
|
|
134
|
+
self_registration_id: string;
|
|
135
|
+
}
|
|
136
|
+
type PlatformSelfRegistrationExtensionFulfillments = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
140
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
declare const PLATFORM_SELF_REGISTRATION_EXTENSION_URI = "https://a2a-extensions.agentstack.beeai.dev/services/platform-self-registration/v1";
|
|
144
|
+
declare class PlatformSelfRegistrationExtensionSpec implements ExtensionSpec<PlatformSelfRegistrationExtensionParams, PlatformSelfRegistrationExtensionFulfillments> {
|
|
145
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/services/platform-self-registration/v1";
|
|
146
|
+
readonly params: PlatformSelfRegistrationExtensionParams;
|
|
147
|
+
constructor(params: PlatformSelfRegistrationExtensionParams);
|
|
148
|
+
toAgentCardExtension(): {
|
|
149
|
+
uri: string;
|
|
150
|
+
required: boolean;
|
|
151
|
+
params: PlatformSelfRegistrationExtensionParams;
|
|
152
|
+
};
|
|
153
|
+
parseFulfillments(): undefined;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
158
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
159
|
+
*/
|
|
160
|
+
declare function loadConfig(): {
|
|
161
|
+
platformUrl: string;
|
|
162
|
+
productionMode: boolean;
|
|
163
|
+
};
|
|
164
|
+
declare function isProductionMode(): boolean;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
168
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
declare class RunContext {
|
|
172
|
+
readonly taskId: string;
|
|
173
|
+
readonly contextId: string;
|
|
174
|
+
readonly task?: Task;
|
|
175
|
+
constructor(taskId: string, contextId: string, task?: Task);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
180
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
declare const configSchema: z__default.ZodObject<{
|
|
184
|
+
platformUrl: z__default.ZodDefault<z__default.ZodString>;
|
|
185
|
+
productionMode: z__default.ZodDefault<z__default.ZodPipe<z__default.ZodOptional<z__default.ZodString>, z__default.ZodTransform<boolean, string | undefined>>>;
|
|
186
|
+
}, z__default.core.$strip>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
190
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
type RunYield = string | Message | Part | TaskStatus | TaskStatusUpdateEvent | Artifact | Error | Record<string, unknown>;
|
|
194
|
+
type AgentFunction<TDeps = Record<string, never>> = (input: Message, ctx: RunContext, deps: TDeps) => AsyncIterable<RunYield> | Promise<RunYield | void>;
|
|
195
|
+
interface AgentOptions<TDeps = Record<string, never>> {
|
|
196
|
+
name: string;
|
|
197
|
+
description?: string;
|
|
198
|
+
detail?: AgentDetail;
|
|
199
|
+
extensions?: ExtensionConfig<TDeps>;
|
|
200
|
+
version?: string;
|
|
201
|
+
protocolVersion?: string;
|
|
202
|
+
handler: AgentFunction<TDeps>;
|
|
203
|
+
}
|
|
204
|
+
interface ServerOptions {
|
|
205
|
+
host?: string;
|
|
206
|
+
port?: number;
|
|
207
|
+
selfRegistrationId?: string;
|
|
208
|
+
platformUrl?: string;
|
|
209
|
+
}
|
|
210
|
+
interface ServerHandle {
|
|
211
|
+
port: number;
|
|
212
|
+
url: string;
|
|
213
|
+
close: () => Promise<void>;
|
|
214
|
+
}
|
|
215
|
+
interface AutoregistrationOptions {
|
|
216
|
+
selfRegistrationId: string;
|
|
217
|
+
agentCard: AgentCard;
|
|
218
|
+
host: string;
|
|
219
|
+
port: number;
|
|
220
|
+
api: ReturnType<typeof buildApiClient>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
225
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
declare class Server {
|
|
229
|
+
private agentCard?;
|
|
230
|
+
private agentOptions?;
|
|
231
|
+
private agentConfigured;
|
|
232
|
+
agent<TDeps>(options: AgentOptions<TDeps>): this;
|
|
233
|
+
run(options?: ServerOptions): Promise<ServerHandle>;
|
|
234
|
+
private buildExtensions;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
239
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
type Config = z__default.infer<typeof configSchema>;
|
|
243
|
+
|
|
244
|
+
export { type AgentDetailExtensionFulfillments, type AgentDetailExtensionParams, AgentDetailExtensionSpec, type AgentFunction, type AgentOptions, type AutoregistrationOptions, type Config, type ExtensionConfig, type ExtensionServer, type ExtensionSpec, type LLMExtensionDeps, type LLMExtensionFulfillments, type LLMExtensionParams, LLMExtensionServer, LLMExtensionSpec, PLATFORM_SELF_REGISTRATION_EXTENSION_URI, type PlatformSelfRegistrationExtensionFulfillments, type PlatformSelfRegistrationExtensionParams, PlatformSelfRegistrationExtensionSpec, RunContext, type RunYield, Server, type ServerHandle, type ServerOptions, configSchema, isProductionMode, loadConfig };
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { AgentExtension, Message, Task, Part, TaskStatus, TaskStatusUpdateEvent, Artifact, AgentCard } from '@a2a-js/sdk';
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
import z__default, { z as z$1 } from 'zod';
|
|
4
|
+
import { A as AgentDetail } from './schemas-Dy3P_eAt.js';
|
|
5
|
+
import * as zod_v4_core from 'zod/v4/core';
|
|
6
|
+
import { b as LLMFulfillment, c as LLMFulfillments, L as LLMDemand } from './types-MfIzGgpV.js';
|
|
7
|
+
import { ba as buildApiClient } from './types-DJm5-rZZ.js';
|
|
8
|
+
import './types-B5B3b0V2.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
12
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
interface ExtensionSpec<TParams = unknown, TFulfillments = unknown> {
|
|
16
|
+
uri: string;
|
|
17
|
+
params?: TParams;
|
|
18
|
+
fulfillmentsSchema?: z$1.ZodSchema<TFulfillments>;
|
|
19
|
+
toAgentCardExtension(): AgentExtension;
|
|
20
|
+
parseFulfillments(message: Message): TFulfillments | undefined;
|
|
21
|
+
}
|
|
22
|
+
interface ExtensionServer<TDeps = unknown, TParams = unknown, TFulfillments = unknown> {
|
|
23
|
+
spec: ExtensionSpec<TParams, TFulfillments>;
|
|
24
|
+
resolveDeps(fulfillments: TFulfillments | undefined): TDeps;
|
|
25
|
+
}
|
|
26
|
+
type ExtensionConfig<TDeps = unknown> = {
|
|
27
|
+
[K in keyof TDeps]: ExtensionServer<TDeps[K], unknown, unknown>;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
32
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
type AgentDetailExtensionParams = AgentDetail;
|
|
36
|
+
type AgentDetailExtensionFulfillments = undefined;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
40
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare class AgentDetailExtensionSpec implements ExtensionSpec<AgentDetailExtensionParams, AgentDetailExtensionFulfillments> {
|
|
44
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/ui/agent-detail/v1";
|
|
45
|
+
readonly params: AgentDetailExtensionParams;
|
|
46
|
+
constructor(params: AgentDetailExtensionParams);
|
|
47
|
+
toAgentCardExtension(): {
|
|
48
|
+
uri: string;
|
|
49
|
+
required: boolean;
|
|
50
|
+
params: {
|
|
51
|
+
interaction_mode?: string | null | undefined;
|
|
52
|
+
user_greeting?: string | null | undefined;
|
|
53
|
+
input_placeholder?: string | null | undefined;
|
|
54
|
+
tools?: {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
}[] | null | undefined;
|
|
58
|
+
framework?: string | null | undefined;
|
|
59
|
+
license?: string | null | undefined;
|
|
60
|
+
programming_language?: string | null | undefined;
|
|
61
|
+
homepage_url?: string | null | undefined;
|
|
62
|
+
source_code_url?: string | null | undefined;
|
|
63
|
+
container_image_url?: string | null | undefined;
|
|
64
|
+
author?: {
|
|
65
|
+
name: string;
|
|
66
|
+
email?: string | null | undefined;
|
|
67
|
+
url?: string | null | undefined;
|
|
68
|
+
} | null | undefined;
|
|
69
|
+
contributors?: {
|
|
70
|
+
name: string;
|
|
71
|
+
email?: string | null | undefined;
|
|
72
|
+
url?: string | null | undefined;
|
|
73
|
+
}[] | null | undefined;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
parseFulfillments(): undefined;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
81
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
interface LLMExtensionParams {
|
|
85
|
+
demands: Record<string, LLMDemand>;
|
|
86
|
+
}
|
|
87
|
+
type LLMExtensionFulfillments = LLMFulfillments;
|
|
88
|
+
interface LLMExtensionDeps {
|
|
89
|
+
fulfillments?: Record<string, LLMFulfillment>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
declare class LLMExtensionSpec implements ExtensionSpec<LLMExtensionParams, LLMExtensionFulfillments> {
|
|
93
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/services/llm/v1";
|
|
94
|
+
readonly params: LLMExtensionParams;
|
|
95
|
+
readonly fulfillmentsSchema: z.ZodObject<{
|
|
96
|
+
llm_fulfillments: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
97
|
+
identifier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
98
|
+
api_base: z.ZodString;
|
|
99
|
+
api_key: z.ZodString;
|
|
100
|
+
api_model: z.ZodString;
|
|
101
|
+
}, zod_v4_core.$strip>>;
|
|
102
|
+
}, zod_v4_core.$strip>;
|
|
103
|
+
constructor(params: LLMExtensionParams);
|
|
104
|
+
toAgentCardExtension(): {
|
|
105
|
+
uri: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
params: {
|
|
108
|
+
llm_demands: Record<string, {
|
|
109
|
+
description?: string | null | undefined;
|
|
110
|
+
suggested?: string[] | null | undefined;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
parseFulfillments(message: Message): {
|
|
115
|
+
llm_fulfillments: Record<string, {
|
|
116
|
+
api_base: string;
|
|
117
|
+
api_key: string;
|
|
118
|
+
api_model: string;
|
|
119
|
+
identifier?: string | null | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
} | undefined;
|
|
122
|
+
}
|
|
123
|
+
declare class LLMExtensionServer implements ExtensionServer<LLMExtensionDeps, LLMExtensionParams, LLMExtensionFulfillments> {
|
|
124
|
+
readonly spec: LLMExtensionSpec;
|
|
125
|
+
constructor(params: LLMExtensionParams);
|
|
126
|
+
resolveDeps(fulfillments: LLMExtensionFulfillments | undefined): LLMExtensionDeps;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
131
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
132
|
+
*/
|
|
133
|
+
interface PlatformSelfRegistrationExtensionParams extends Record<string, unknown> {
|
|
134
|
+
self_registration_id: string;
|
|
135
|
+
}
|
|
136
|
+
type PlatformSelfRegistrationExtensionFulfillments = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
140
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
141
|
+
*/
|
|
142
|
+
|
|
143
|
+
declare const PLATFORM_SELF_REGISTRATION_EXTENSION_URI = "https://a2a-extensions.agentstack.beeai.dev/services/platform-self-registration/v1";
|
|
144
|
+
declare class PlatformSelfRegistrationExtensionSpec implements ExtensionSpec<PlatformSelfRegistrationExtensionParams, PlatformSelfRegistrationExtensionFulfillments> {
|
|
145
|
+
readonly uri = "https://a2a-extensions.agentstack.beeai.dev/services/platform-self-registration/v1";
|
|
146
|
+
readonly params: PlatformSelfRegistrationExtensionParams;
|
|
147
|
+
constructor(params: PlatformSelfRegistrationExtensionParams);
|
|
148
|
+
toAgentCardExtension(): {
|
|
149
|
+
uri: string;
|
|
150
|
+
required: boolean;
|
|
151
|
+
params: PlatformSelfRegistrationExtensionParams;
|
|
152
|
+
};
|
|
153
|
+
parseFulfillments(): undefined;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
158
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
159
|
+
*/
|
|
160
|
+
declare function loadConfig(): {
|
|
161
|
+
platformUrl: string;
|
|
162
|
+
productionMode: boolean;
|
|
163
|
+
};
|
|
164
|
+
declare function isProductionMode(): boolean;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
168
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
declare class RunContext {
|
|
172
|
+
readonly taskId: string;
|
|
173
|
+
readonly contextId: string;
|
|
174
|
+
readonly task?: Task;
|
|
175
|
+
constructor(taskId: string, contextId: string, task?: Task);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
180
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
declare const configSchema: z__default.ZodObject<{
|
|
184
|
+
platformUrl: z__default.ZodDefault<z__default.ZodString>;
|
|
185
|
+
productionMode: z__default.ZodDefault<z__default.ZodPipe<z__default.ZodOptional<z__default.ZodString>, z__default.ZodTransform<boolean, string | undefined>>>;
|
|
186
|
+
}, z__default.core.$strip>;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
190
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
type RunYield = string | Message | Part | TaskStatus | TaskStatusUpdateEvent | Artifact | Error | Record<string, unknown>;
|
|
194
|
+
type AgentFunction<TDeps = Record<string, never>> = (input: Message, ctx: RunContext, deps: TDeps) => AsyncIterable<RunYield> | Promise<RunYield | void>;
|
|
195
|
+
interface AgentOptions<TDeps = Record<string, never>> {
|
|
196
|
+
name: string;
|
|
197
|
+
description?: string;
|
|
198
|
+
detail?: AgentDetail;
|
|
199
|
+
extensions?: ExtensionConfig<TDeps>;
|
|
200
|
+
version?: string;
|
|
201
|
+
protocolVersion?: string;
|
|
202
|
+
handler: AgentFunction<TDeps>;
|
|
203
|
+
}
|
|
204
|
+
interface ServerOptions {
|
|
205
|
+
host?: string;
|
|
206
|
+
port?: number;
|
|
207
|
+
selfRegistrationId?: string;
|
|
208
|
+
platformUrl?: string;
|
|
209
|
+
}
|
|
210
|
+
interface ServerHandle {
|
|
211
|
+
port: number;
|
|
212
|
+
url: string;
|
|
213
|
+
close: () => Promise<void>;
|
|
214
|
+
}
|
|
215
|
+
interface AutoregistrationOptions {
|
|
216
|
+
selfRegistrationId: string;
|
|
217
|
+
agentCard: AgentCard;
|
|
218
|
+
host: string;
|
|
219
|
+
port: number;
|
|
220
|
+
api: ReturnType<typeof buildApiClient>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
225
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
declare class Server {
|
|
229
|
+
private agentCard?;
|
|
230
|
+
private agentOptions?;
|
|
231
|
+
private agentConfigured;
|
|
232
|
+
agent<TDeps>(options: AgentOptions<TDeps>): this;
|
|
233
|
+
run(options?: ServerOptions): Promise<ServerHandle>;
|
|
234
|
+
private buildExtensions;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Copyright 2025 © BeeAI a Series of LF Projects, LLC
|
|
239
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
240
|
+
*/
|
|
241
|
+
|
|
242
|
+
type Config = z__default.infer<typeof configSchema>;
|
|
243
|
+
|
|
244
|
+
export { type AgentDetailExtensionFulfillments, type AgentDetailExtensionParams, AgentDetailExtensionSpec, type AgentFunction, type AgentOptions, type AutoregistrationOptions, type Config, type ExtensionConfig, type ExtensionServer, type ExtensionSpec, type LLMExtensionDeps, type LLMExtensionFulfillments, type LLMExtensionParams, LLMExtensionServer, LLMExtensionSpec, PLATFORM_SELF_REGISTRATION_EXTENSION_URI, type PlatformSelfRegistrationExtensionFulfillments, type PlatformSelfRegistrationExtensionParams, PlatformSelfRegistrationExtensionSpec, RunContext, type RunYield, Server, type ServerHandle, type ServerOptions, configSchema, isProductionMode, loadConfig };
|