@embassys/ambassador 0.0.0 → 0.2.7
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/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/agent-capabilities.d.ts +35 -0
- package/dist/agent-capabilities.js +221 -0
- package/dist/agent-capabilities.js.map +1 -0
- package/dist/ambassador-options.d.ts +6 -0
- package/dist/ambassador-options.js +13 -0
- package/dist/ambassador-options.js.map +1 -0
- package/dist/central-credential.d.ts +41 -0
- package/dist/central-credential.js +355 -0
- package/dist/central-credential.js.map +1 -0
- package/dist/central-enrollment.d.ts +31 -0
- package/dist/central-enrollment.js +278 -0
- package/dist/central-enrollment.js.map +1 -0
- package/dist/central-json.d.ts +8 -0
- package/dist/central-json.js +259 -0
- package/dist/central-json.js.map +1 -0
- package/dist/central-protected-transport.d.ts +21 -0
- package/dist/central-protected-transport.js +217 -0
- package/dist/central-protected-transport.js.map +1 -0
- package/dist/central-rest.d.ts +50 -0
- package/dist/central-rest.js +401 -0
- package/dist/central-rest.js.map +1 -0
- package/dist/cli.d.ts +26 -0
- package/dist/cli.js +129 -0
- package/dist/cli.js.map +1 -0
- package/dist/credential-store.d.ts +18 -0
- package/dist/credential-store.js +617 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/delivery-profile.d.ts +43 -0
- package/dist/delivery-profile.js +253 -0
- package/dist/delivery-profile.js.map +1 -0
- package/dist/direct-delivery.d.ts +37 -0
- package/dist/direct-delivery.js +312 -0
- package/dist/direct-delivery.js.map +1 -0
- package/dist/dpop.d.ts +28 -0
- package/dist/dpop.js +119 -0
- package/dist/dpop.js.map +1 -0
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -0
- package/dist/gateway-application.d.ts +32 -0
- package/dist/gateway-application.js +255 -0
- package/dist/gateway-application.js.map +1 -0
- package/dist/gateway-paths.d.ts +11 -0
- package/dist/gateway-paths.js +29 -0
- package/dist/gateway-paths.js.map +1 -0
- package/dist/guided-registration.d.ts +23 -0
- package/dist/guided-registration.js +117 -0
- package/dist/guided-registration.js.map +1 -0
- package/dist/identity.d.ts +20 -0
- package/dist/identity.js +54 -0
- package/dist/identity.js.map +1 -0
- package/dist/local-mcp.d.ts +28 -0
- package/dist/local-mcp.js +410 -0
- package/dist/local-mcp.js.map +1 -0
- package/dist/local-tool-result.d.ts +4 -0
- package/dist/local-tool-result.js +17 -0
- package/dist/local-tool-result.js.map +1 -0
- package/dist/mcp-contract.d.ts +10 -0
- package/dist/mcp-contract.js +63 -0
- package/dist/mcp-contract.js.map +1 -0
- package/dist/notification-journal.d.ts +24 -0
- package/dist/notification-journal.js +194 -0
- package/dist/notification-journal.js.map +1 -0
- package/dist/notification-relay.d.ts +31 -0
- package/dist/notification-relay.js +203 -0
- package/dist/notification-relay.js.map +1 -0
- package/dist/process-lock.d.ts +8 -0
- package/dist/process-lock.js +122 -0
- package/dist/process-lock.js.map +1 -0
- package/dist/sqlite-artifact.d.ts +7 -0
- package/dist/sqlite-artifact.js +121 -0
- package/dist/sqlite-artifact.js.map +1 -0
- package/dist/webhook-delivery.d.ts +23 -0
- package/dist/webhook-delivery.js +122 -0
- package/dist/webhook-delivery.js.map +1 -0
- package/docs/getting-started-claude.md +33 -0
- package/docs/getting-started-codex.md +36 -0
- package/docs/getting-started-gemini.md +31 -0
- package/docs/getting-started-hermes.md +47 -0
- package/docs/getting-started-openclaw.md +48 -0
- package/docs/live-qualification.md +174 -0
- package/package.json +48 -7
- package/index.js +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 a2adev contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,71 @@
|
|
|
1
1
|
# Embassys Ambassador
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Embassys Ambassador is a local bridge between an agent and the Embassys REST
|
|
4
|
+
service. Agents call it through MCP. Incoming messages go directly to a local
|
|
5
|
+
agent over ACP v1 or to an authenticated webhook.
|
|
6
|
+
|
|
7
|
+
## Start
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx --yes @embassys/ambassador@0.2.7 start
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
- No Ambassador token or environment variable is needed for direct delivery.
|
|
14
|
+
- Configure your agent's MCP client for `http://127.0.0.1:8787/mcp` without
|
|
15
|
+
authentication.
|
|
16
|
+
- Ask the agent to register your email with Ambassador.
|
|
17
|
+
- OpenClaw and Hermes users choose **direct** (the default) or **webhook**.
|
|
18
|
+
Codex, Claude Code, and Gemini CLI proceed directly without a delivery
|
|
19
|
+
question.
|
|
20
|
+
- Webhook users set a receiver secret in Ambassador's environment before
|
|
21
|
+
startup and give the agent only the variable name during registration.
|
|
22
|
+
|
|
23
|
+
Direct delivery supports OpenClaw, Hermes, Codex, Claude Code, and Gemini CLI.
|
|
24
|
+
Webhook delivery supports OpenClaw and Hermes. Unknown or incomplete profiles
|
|
25
|
+
fail closed. The agent cannot choose an executable, adapter, or arbitrary
|
|
26
|
+
delivery implementation.
|
|
27
|
+
|
|
28
|
+
The central integration uses the unversioned REST API at
|
|
29
|
+
`https://mcp.embassys.ai`. Verification binds the central token to an
|
|
30
|
+
Ambassador-owned P-256 key. Protected requests use Bearer authorization plus a
|
|
31
|
+
separate DPoP proof. Ambassador does not use the central MCP endpoint.
|
|
32
|
+
|
|
33
|
+
## Implementation status
|
|
34
|
+
|
|
35
|
+
The REST, DPoP, delivery, and zero-configuration startup paths are implemented.
|
|
36
|
+
The live-central qualification with real Codex passed. The remaining
|
|
37
|
+
real-agent matrix is still open under the disclosed release exception in
|
|
38
|
+
[ADR 0015](docs/adr/0015-npm-distribution.md); outstanding work remains in the
|
|
39
|
+
[implementation plan](docs/implementation-plan.md).
|
|
40
|
+
|
|
41
|
+
## Development
|
|
42
|
+
|
|
43
|
+
Use Node.js 24 and the pnpm version recorded in `package.json`.
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
pnpm install --frozen-lockfile
|
|
47
|
+
pnpm check
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
CI uses a mock webhook receiver and mock ACP v1 agent for deterministic
|
|
51
|
+
delivery tests. Opt-in local qualification covers direct delivery for all five
|
|
52
|
+
agents and webhook delivery for OpenClaw and Hermes.
|
|
53
|
+
|
|
54
|
+
## Documentation
|
|
55
|
+
|
|
56
|
+
- [Documentation map](docs/README.md)
|
|
57
|
+
- [Product and architecture](docs/product-vision-and-architecture.md)
|
|
58
|
+
- [Target protocol](docs/protocol.md)
|
|
59
|
+
- [Current work](docs/implementation-plan.md)
|
|
60
|
+
- [Architecture decisions](docs/adr/README.md)
|
|
61
|
+
- [Qualification strategy](docs/qualification.md)
|
|
62
|
+
- [Codex setup](docs/getting-started-codex.md)
|
|
63
|
+
- [Claude Code setup](docs/getting-started-claude.md)
|
|
64
|
+
- [Gemini CLI setup](docs/getting-started-gemini.md)
|
|
65
|
+
- [Hermes setup](docs/getting-started-hermes.md)
|
|
66
|
+
- [OpenClaw setup](docs/getting-started-openclaw.md)
|
|
67
|
+
- [Central service follow-ups](docs/central-follow-ups.md)
|
|
68
|
+
|
|
69
|
+
## License
|
|
70
|
+
|
|
71
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type DeliveryMode = "direct" | "webhook";
|
|
2
|
+
export type McpConfigurationBehavior = "provider_config" | "session";
|
|
3
|
+
export interface AgentClientInfo {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly version: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DirectAgentCapability {
|
|
8
|
+
readonly command: string;
|
|
9
|
+
readonly args: readonly string[];
|
|
10
|
+
readonly agentInfo: {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly versions: readonly string[];
|
|
13
|
+
};
|
|
14
|
+
readonly mcp: McpConfigurationBehavior;
|
|
15
|
+
readonly environment: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export interface AgentCapability {
|
|
18
|
+
readonly kind: string;
|
|
19
|
+
readonly displayName: string;
|
|
20
|
+
readonly enabled: boolean;
|
|
21
|
+
readonly aliases: readonly AgentClientInfo[];
|
|
22
|
+
readonly modes: readonly DeliveryMode[];
|
|
23
|
+
readonly direct?: DirectAgentCapability;
|
|
24
|
+
readonly qualificationCases: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export type AgentCapabilityResolution = {
|
|
27
|
+
readonly status: "matched";
|
|
28
|
+
readonly profile: AgentCapability;
|
|
29
|
+
} | {
|
|
30
|
+
readonly status: "unsupported";
|
|
31
|
+
};
|
|
32
|
+
export declare const PRODUCTION_AGENT_CAPABILITIES: readonly AgentCapability[];
|
|
33
|
+
export declare function isCompleteAgentCapability(value: AgentCapability): boolean;
|
|
34
|
+
export declare function resolveAgentCapability(clientInfo: AgentClientInfo | undefined, registry?: readonly AgentCapability[]): AgentCapabilityResolution;
|
|
35
|
+
export declare function capabilityForKind(kind: string, registry?: readonly AgentCapability[]): AgentCapability | undefined;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
const BOUNDED_METADATA = /^[\x20-\x7e]{1,128}$/u;
|
|
2
|
+
const KIND = /^[a-z][a-z0-9-]{0,63}$/u;
|
|
3
|
+
const ENVIRONMENT_NAME = /^[A-Za-z_][A-Za-z0-9_]*$/u;
|
|
4
|
+
export const PRODUCTION_AGENT_CAPABILITIES = [
|
|
5
|
+
{
|
|
6
|
+
kind: "openclaw",
|
|
7
|
+
displayName: "OpenClaw",
|
|
8
|
+
enabled: true,
|
|
9
|
+
aliases: [{ name: "openclaw-bundle-mcp", version: "0.0.0" }],
|
|
10
|
+
modes: ["direct", "webhook"],
|
|
11
|
+
direct: {
|
|
12
|
+
command: "openclaw",
|
|
13
|
+
args: ["acp"],
|
|
14
|
+
agentInfo: { name: "openclaw-acp", versions: ["2026.8.1"] },
|
|
15
|
+
mcp: "provider_config",
|
|
16
|
+
environment: [
|
|
17
|
+
"HOME",
|
|
18
|
+
"LANG",
|
|
19
|
+
"LC_ALL",
|
|
20
|
+
"NODE_EXTRA_CA_CERTS",
|
|
21
|
+
"PATH",
|
|
22
|
+
"SSL_CERT_DIR",
|
|
23
|
+
"SSL_CERT_FILE",
|
|
24
|
+
"TMPDIR",
|
|
25
|
+
"USERPROFILE",
|
|
26
|
+
"XDG_CONFIG_HOME",
|
|
27
|
+
"XDG_DATA_HOME",
|
|
28
|
+
"XDG_STATE_HOME",
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
qualificationCases: ["openclaw-webhook", "openclaw-direct"],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
kind: "hermes",
|
|
35
|
+
displayName: "Hermes",
|
|
36
|
+
enabled: true,
|
|
37
|
+
aliases: [{ name: "mcp", version: "0.1.0" }],
|
|
38
|
+
modes: ["direct", "webhook"],
|
|
39
|
+
direct: {
|
|
40
|
+
command: "hermes-acp",
|
|
41
|
+
args: [],
|
|
42
|
+
agentInfo: { name: "hermes-agent", versions: ["0.21.0"] },
|
|
43
|
+
mcp: "session",
|
|
44
|
+
environment: [
|
|
45
|
+
"HOME",
|
|
46
|
+
"LANG",
|
|
47
|
+
"LC_ALL",
|
|
48
|
+
"PATH",
|
|
49
|
+
"SSL_CERT_DIR",
|
|
50
|
+
"SSL_CERT_FILE",
|
|
51
|
+
"TMPDIR",
|
|
52
|
+
"USERPROFILE",
|
|
53
|
+
"XDG_CACHE_HOME",
|
|
54
|
+
"XDG_CONFIG_HOME",
|
|
55
|
+
"XDG_DATA_HOME",
|
|
56
|
+
"XDG_STATE_HOME",
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
qualificationCases: ["hermes-webhook", "hermes-direct"],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
kind: "codex",
|
|
63
|
+
displayName: "Codex",
|
|
64
|
+
enabled: true,
|
|
65
|
+
aliases: [
|
|
66
|
+
{ name: "codex-mcp-client", version: "0.149.0" },
|
|
67
|
+
{ name: "codex-mcp-client", version: "0.152.1" },
|
|
68
|
+
],
|
|
69
|
+
modes: ["direct"],
|
|
70
|
+
direct: {
|
|
71
|
+
command: "codex-acp",
|
|
72
|
+
args: [],
|
|
73
|
+
agentInfo: { name: "@agentclientprotocol/codex-acp", versions: ["1.8.0"] },
|
|
74
|
+
mcp: "session",
|
|
75
|
+
environment: [
|
|
76
|
+
"CODEX_API_KEY",
|
|
77
|
+
"HOME",
|
|
78
|
+
"LANG",
|
|
79
|
+
"LC_ALL",
|
|
80
|
+
"NODE_EXTRA_CA_CERTS",
|
|
81
|
+
"OPENAI_API_KEY",
|
|
82
|
+
"PATH",
|
|
83
|
+
"SSL_CERT_DIR",
|
|
84
|
+
"SSL_CERT_FILE",
|
|
85
|
+
"TMPDIR",
|
|
86
|
+
"USERPROFILE",
|
|
87
|
+
"XDG_CONFIG_HOME",
|
|
88
|
+
"XDG_DATA_HOME",
|
|
89
|
+
"XDG_RUNTIME_DIR",
|
|
90
|
+
"XDG_STATE_HOME",
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
qualificationCases: ["codex-direct"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
kind: "claude",
|
|
97
|
+
displayName: "Claude Code",
|
|
98
|
+
enabled: true,
|
|
99
|
+
aliases: [
|
|
100
|
+
{ name: "claude-code", version: "2.1.257" },
|
|
101
|
+
{ name: "claude-code", version: "2.1.258" },
|
|
102
|
+
],
|
|
103
|
+
modes: ["direct"],
|
|
104
|
+
direct: {
|
|
105
|
+
command: "claude-agent-acp",
|
|
106
|
+
args: [],
|
|
107
|
+
agentInfo: { name: "@agentclientprotocol/claude-agent-acp", versions: ["0.73.0"] },
|
|
108
|
+
mcp: "session",
|
|
109
|
+
environment: [
|
|
110
|
+
"ANTHROPIC_API_KEY",
|
|
111
|
+
"ANTHROPIC_AUTH_TOKEN",
|
|
112
|
+
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
113
|
+
"HOME",
|
|
114
|
+
"LANG",
|
|
115
|
+
"LC_ALL",
|
|
116
|
+
"NODE_EXTRA_CA_CERTS",
|
|
117
|
+
"PATH",
|
|
118
|
+
"SSL_CERT_DIR",
|
|
119
|
+
"SSL_CERT_FILE",
|
|
120
|
+
"TMPDIR",
|
|
121
|
+
"USERPROFILE",
|
|
122
|
+
"XDG_CONFIG_HOME",
|
|
123
|
+
"XDG_DATA_HOME",
|
|
124
|
+
"XDG_STATE_HOME",
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
qualificationCases: ["claude-direct"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
kind: "gemini",
|
|
131
|
+
displayName: "Gemini CLI",
|
|
132
|
+
enabled: true,
|
|
133
|
+
aliases: [{ name: "gemini-cli-mcp-client", version: "0.58.0" }],
|
|
134
|
+
modes: ["direct"],
|
|
135
|
+
direct: {
|
|
136
|
+
command: "gemini",
|
|
137
|
+
args: ["--acp"],
|
|
138
|
+
agentInfo: { name: "gemini-cli", versions: ["0.58.0"] },
|
|
139
|
+
mcp: "session",
|
|
140
|
+
environment: [
|
|
141
|
+
"GEMINI_API_KEY",
|
|
142
|
+
"GOOGLE_API_KEY",
|
|
143
|
+
"GOOGLE_CLOUD_LOCATION",
|
|
144
|
+
"GOOGLE_CLOUD_PROJECT",
|
|
145
|
+
"GOOGLE_GENAI_USE_VERTEXAI",
|
|
146
|
+
"HOME",
|
|
147
|
+
"LANG",
|
|
148
|
+
"LC_ALL",
|
|
149
|
+
"NODE_EXTRA_CA_CERTS",
|
|
150
|
+
"PATH",
|
|
151
|
+
"SSL_CERT_DIR",
|
|
152
|
+
"SSL_CERT_FILE",
|
|
153
|
+
"TMPDIR",
|
|
154
|
+
"USERPROFILE",
|
|
155
|
+
"XDG_CONFIG_HOME",
|
|
156
|
+
"XDG_DATA_HOME",
|
|
157
|
+
"XDG_STATE_HOME",
|
|
158
|
+
],
|
|
159
|
+
},
|
|
160
|
+
qualificationCases: ["gemini-direct"],
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
function unique(values) {
|
|
164
|
+
return new Set(values).size === values.length;
|
|
165
|
+
}
|
|
166
|
+
function completeDirect(value) {
|
|
167
|
+
return (value !== undefined &&
|
|
168
|
+
BOUNDED_METADATA.test(value.command) &&
|
|
169
|
+
value.args.length <= 16 &&
|
|
170
|
+
value.args.every((argument) => BOUNDED_METADATA.test(argument)) &&
|
|
171
|
+
BOUNDED_METADATA.test(value.agentInfo.name) &&
|
|
172
|
+
value.agentInfo.versions.length > 0 &&
|
|
173
|
+
value.agentInfo.versions.length <= 16 &&
|
|
174
|
+
value.agentInfo.versions.every((version) => BOUNDED_METADATA.test(version)) &&
|
|
175
|
+
unique(value.agentInfo.versions) &&
|
|
176
|
+
(value.mcp === "provider_config" || value.mcp === "session") &&
|
|
177
|
+
value.environment.length <= 32 &&
|
|
178
|
+
value.environment.every((name) => ENVIRONMENT_NAME.test(name)) &&
|
|
179
|
+
unique(value.environment));
|
|
180
|
+
}
|
|
181
|
+
export function isCompleteAgentCapability(value) {
|
|
182
|
+
if (!KIND.test(value.kind) ||
|
|
183
|
+
!BOUNDED_METADATA.test(value.displayName) ||
|
|
184
|
+
value.aliases.length === 0 ||
|
|
185
|
+
value.aliases.length > 16 ||
|
|
186
|
+
value.modes.length === 0 ||
|
|
187
|
+
value.modes.length > 2 ||
|
|
188
|
+
!unique(value.modes) ||
|
|
189
|
+
value.qualificationCases.length === 0 ||
|
|
190
|
+
value.qualificationCases.length > 16 ||
|
|
191
|
+
!value.qualificationCases.every((item) => BOUNDED_METADATA.test(item)) ||
|
|
192
|
+
!unique(value.qualificationCases)) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
const aliases = value.aliases.map(({ name, version }) => `${name}\u0000${version}`);
|
|
196
|
+
if (!unique(aliases) ||
|
|
197
|
+
!value.aliases.every(({ name, version }) => BOUNDED_METADATA.test(name) && BOUNDED_METADATA.test(version))) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
if (value.modes.some((mode) => mode !== "direct" && mode !== "webhook"))
|
|
201
|
+
return false;
|
|
202
|
+
return value.modes.includes("direct") ? completeDirect(value.direct) : value.direct === undefined;
|
|
203
|
+
}
|
|
204
|
+
function boundedClientInfo(value) {
|
|
205
|
+
return (value !== undefined && BOUNDED_METADATA.test(value.name) && BOUNDED_METADATA.test(value.version));
|
|
206
|
+
}
|
|
207
|
+
export function resolveAgentCapability(clientInfo, registry = PRODUCTION_AGENT_CAPABILITIES) {
|
|
208
|
+
if (!boundedClientInfo(clientInfo))
|
|
209
|
+
return { status: "unsupported" };
|
|
210
|
+
const matches = registry.filter((profile) => profile.enabled &&
|
|
211
|
+
isCompleteAgentCapability(profile) &&
|
|
212
|
+
profile.aliases.some((alias) => alias.name === clientInfo.name && alias.version === clientInfo.version));
|
|
213
|
+
return matches.length === 1 && matches[0] !== undefined
|
|
214
|
+
? { status: "matched", profile: matches[0] }
|
|
215
|
+
: { status: "unsupported" };
|
|
216
|
+
}
|
|
217
|
+
export function capabilityForKind(kind, registry = PRODUCTION_AGENT_CAPABILITIES) {
|
|
218
|
+
const matches = registry.filter((profile) => profile.kind === kind && profile.enabled && isCompleteAgentCapability(profile));
|
|
219
|
+
return matches.length === 1 ? matches[0] : undefined;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=agent-capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-capabilities.js","sourceRoot":"","sources":["../src/agent-capabilities.ts"],"names":[],"mappings":"AAiCA,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AACjD,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,gBAAgB,GAAG,2BAA2B,CAAC;AAErD,MAAM,CAAC,MAAM,6BAA6B,GAA+B;IACvE;QACE,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,UAAU;QACvB,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QAC5D,KAAK,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;QAC5B,MAAM,EAAE;YACN,OAAO,EAAE,UAAU;YACnB,IAAI,EAAE,CAAC,KAAK,CAAC;YACb,SAAS,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE;YAC3D,GAAG,EAAE,iBAAiB;YACtB,WAAW,EAAE;gBACX,MAAM;gBACN,MAAM;gBACN,QAAQ;gBACR,qBAAqB;gBACrB,MAAM;gBACN,cAAc;gBACd,eAAe;gBACf,QAAQ;gBACR,aAAa;gBACb,iBAAiB;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,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS;QACrD,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE;QAC5C,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,IAAY,EACZ,QAAQ,GAA+B,6BAA6B;IAEpE,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAC7B,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,CAAC,OAAO,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAC5F,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class AmbassadorOptionsError extends Error {
|
|
2
|
+
readonly exitCode = 2;
|
|
3
|
+
constructor();
|
|
4
|
+
}
|
|
5
|
+
export type AmbassadorStartOptions = Record<string, never>;
|
|
6
|
+
export declare function parseAmbassadorStartOptions(args: readonly string[]): AmbassadorStartOptions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export class AmbassadorOptionsError extends Error {
|
|
2
|
+
exitCode = 2;
|
|
3
|
+
constructor() {
|
|
4
|
+
super("Invalid command or arguments");
|
|
5
|
+
this.name = "AmbassadorOptionsError";
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export function parseAmbassadorStartOptions(args) {
|
|
9
|
+
if (args.length !== 1 || args[0] !== "start")
|
|
10
|
+
throw new AmbassadorOptionsError();
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ambassador-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ambassador-options.js","sourceRoot":"","sources":["../src/ambassador-options.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IACtC,QAAQ,GAAG,CAAC,CAAC;IAEtB;QACE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAID,MAAM,UAAU,2BAA2B,CAAC,IAAuB;IACjE,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,OAAO;QAAE,MAAM,IAAI,sBAAsB,EAAE,CAAC;IACjF,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type KeyObject } from "node:crypto";
|
|
2
|
+
export interface CentralPublicJwk {
|
|
3
|
+
readonly kty: "EC";
|
|
4
|
+
readonly crv: "P-256";
|
|
5
|
+
readonly x: string;
|
|
6
|
+
readonly y: string;
|
|
7
|
+
}
|
|
8
|
+
export interface CentralCredentialRecord {
|
|
9
|
+
readonly credential_format: 1;
|
|
10
|
+
readonly access_token: string;
|
|
11
|
+
readonly dpop_private_key_pkcs8: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CentralTokenClaims {
|
|
14
|
+
readonly subject: string;
|
|
15
|
+
readonly email: string;
|
|
16
|
+
readonly issuedAt: number;
|
|
17
|
+
readonly expiresAt: number;
|
|
18
|
+
readonly keyThumbprint: string;
|
|
19
|
+
}
|
|
20
|
+
export interface LoadedCentralCredential {
|
|
21
|
+
readonly record: CentralCredentialRecord;
|
|
22
|
+
readonly serialized: string;
|
|
23
|
+
readonly privateKey: KeyObject;
|
|
24
|
+
readonly publicJwk: CentralPublicJwk;
|
|
25
|
+
readonly keyThumbprint: string;
|
|
26
|
+
readonly token: CentralTokenClaims;
|
|
27
|
+
}
|
|
28
|
+
export interface CentralKeyMaterial {
|
|
29
|
+
readonly privateKey: KeyObject;
|
|
30
|
+
readonly privateKeyPkcs8: string;
|
|
31
|
+
readonly publicJwk: CentralPublicJwk;
|
|
32
|
+
readonly thumbprint: string;
|
|
33
|
+
}
|
|
34
|
+
export declare class CentralCredentialError extends Error {
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
export declare function exactCentralPublicJwk(value: unknown): CentralPublicJwk;
|
|
38
|
+
export declare function centralJwkThumbprint(jwk: CentralPublicJwk): string;
|
|
39
|
+
export declare function serializeCentralCredential(record: CentralCredentialRecord): string;
|
|
40
|
+
export declare function parseCentralCredential(value: string | CentralCredentialRecord | unknown, nowSeconds?: () => number): LoadedCentralCredential;
|
|
41
|
+
export declare function createCentralCredentialRecord(accessToken: string, key: CentralKeyMaterial): CentralCredentialRecord;
|