melchizedek-agents 1.2.0 → 1.3.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/.env.example +9 -0
- package/CHANGELOG.md +141 -0
- package/DOCUMENTATION.md +107 -10
- package/ONBOARDING.md +50 -11
- package/QUICKSTART.md +1 -1
- package/README.md +22 -2
- package/config/agents/examples/connectors.yaml +82 -0
- package/config/agents/syndicate.schema.json +324 -26
- package/dist/lib/a2a/app.js +3 -0
- package/dist/lib/a2a/oauthSetup.js +20 -5
- package/dist/lib/chatgpt/adapter.d.ts +50 -0
- package/dist/lib/chatgpt/adapter.js +107 -0
- package/dist/lib/chatgpt/cli.d.ts +23 -0
- package/dist/lib/chatgpt/cli.js +77 -0
- package/dist/lib/chatgpt/oauth.d.ts +103 -0
- package/dist/lib/chatgpt/oauth.js +448 -0
- package/dist/lib/chatgpt/state.d.ts +98 -0
- package/dist/lib/chatgpt/state.js +145 -0
- package/dist/lib/chatgpt/store.d.ts +24 -0
- package/dist/lib/chatgpt/store.js +94 -0
- package/dist/lib/compile.js +40 -25
- package/dist/lib/dispatch.js +6 -2
- package/dist/lib/doctor.d.ts +34 -3
- package/dist/lib/doctor.js +63 -5
- package/dist/lib/loadSyndicate.d.ts +6 -0
- package/dist/lib/mcp/server.d.ts +195 -0
- package/dist/lib/mcp/server.js +564 -0
- package/dist/lib/memory/supabaseMemoryService.js +2 -2
- package/dist/lib/models/adapterResolver.js +6 -1
- package/dist/lib/models/gateway.d.ts +1 -1
- package/dist/lib/models/gateway.js +4 -2
- package/dist/lib/onboarding.d.ts +4 -3
- package/dist/lib/onboarding.js +48 -9
- package/dist/lib/runtime/syndicateTurn.js +30 -16
- package/dist/lib/syndicateSchema.d.ts +146 -8
- package/dist/lib/syndicateSchema.js +118 -11
- package/dist/lib/tools/credentialUses.d.ts +7 -1
- package/dist/lib/tools/credentialUses.js +10 -2
- package/dist/lib/tools/generateImageTool.js +2 -1
- package/dist/lib/tools/inspectImageTool.js +1 -1
- package/dist/lib/tools/mcpToolFactory.d.ts +29 -1
- package/dist/lib/tools/mcpToolFactory.js +71 -25
- package/dist/lib/tools/mcpTransports.d.ts +12 -0
- package/dist/lib/tools/mcpTransports.js +11 -0
- package/dist/lib/tools/oauthConsent.d.ts +18 -3
- package/dist/lib/tools/oauthConsent.js +49 -14
- package/dist/lib/tools/oauthDiscovery.d.ts +202 -0
- package/dist/lib/tools/oauthDiscovery.js +616 -0
- package/dist/lib/tools/oauthTools.d.ts +44 -12
- package/dist/lib/tools/oauthTools.js +79 -22
- package/dist/lib/tools/xApiSearchTool.js +2 -2
- package/dist/scripts/a2a_server.js +8 -0
- package/dist/scripts/assistant_worker.js +11 -1
- package/dist/scripts/doctor.d.ts +1 -1
- package/dist/scripts/doctor.js +1 -1
- package/dist/scripts/mcp_server.d.ts +12 -0
- package/dist/scripts/mcp_server.js +345 -0
- package/dist/scripts/setup.d.ts +2 -0
- package/dist/scripts/setup.js +27 -0
- package/dist/scripts/syndicate_chat.js +12 -3
- package/package.json +5 -2
- package/skills/README.md +2 -2
- package/skills/briefs/skills-readme.md +1 -1
- package/skills/melchizedek-onboard/SKILL.md +28 -6
- package/skills/melchizedek-onboard-keys/SKILL.md +17 -5
package/dist/lib/onboarding.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* WHY this file exists:
|
|
5
5
|
* A newcomer arrives with something: no key, one provider's key, several, a
|
|
6
6
|
* gateway key, a cloud account, a server to put in front of other people,
|
|
7
|
-
*
|
|
7
|
+
* a ChatGPT plan on their own machine (Sign in with ChatGPT, ADR 0126), or
|
|
8
|
+
* a Claude.ai / Gemini CLI / Codex CLI sign-in. Each of those is a
|
|
8
9
|
* different first ten minutes. This module names those levels once, from
|
|
9
10
|
* what the engine actually supports (lib/models/providerMap.ts,
|
|
10
11
|
* endpoints.ts, gateway.ts, the A2A server's identity modes and the OAuth
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
* ignored (secrets-hygiene).
|
|
27
28
|
*/
|
|
28
29
|
import type { DoctorResult, Tier } from './doctor.ts';
|
|
29
|
-
export type LevelId = 'local' | 'one-provider' | 'several-providers' | 'gateway' | 'cloud-platform' | 'byok' | 'caller-tokens' | 'oauth-grants' | 'subscription-signin';
|
|
30
|
+
export type LevelId = 'local' | 'one-provider' | 'several-providers' | 'gateway' | 'cloud-platform' | 'byok' | 'caller-tokens' | 'oauth-grants' | 'chatgpt-signin' | 'subscription-signin';
|
|
30
31
|
/** How a command is spelled: in a project that installed the package, or in a clone of the repository. */
|
|
31
32
|
export type CommandForm = 'package' | 'clone';
|
|
32
33
|
export interface EnvLine {
|
|
@@ -51,7 +52,7 @@ export interface Level {
|
|
|
51
52
|
notes: string[];
|
|
52
53
|
/** The onboarding skill a coding agent follows for this level. */
|
|
53
54
|
skill: string;
|
|
54
|
-
/** False for an entry that is not a way to run the engine (subscription sign-ins). */
|
|
55
|
+
/** False for an entry that is not a way to run the engine (the unsupported subscription sign-ins). */
|
|
55
56
|
detectable: boolean;
|
|
56
57
|
}
|
|
57
58
|
/** Shipped templates and examples by the tier their models imply, and which declare an OAuth grant. */
|
package/dist/lib/onboarding.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* WHY this file exists:
|
|
5
5
|
* A newcomer arrives with something: no key, one provider's key, several, a
|
|
6
6
|
* gateway key, a cloud account, a server to put in front of other people,
|
|
7
|
-
*
|
|
7
|
+
* a ChatGPT plan on their own machine (Sign in with ChatGPT, ADR 0126), or
|
|
8
|
+
* a Claude.ai / Gemini CLI / Codex CLI sign-in. Each of those is a
|
|
8
9
|
* different first ten minutes. This module names those levels once, from
|
|
9
10
|
* what the engine actually supports (lib/models/providerMap.ts,
|
|
10
11
|
* endpoints.ts, gateway.ts, the A2A server's identity modes and the OAuth
|
|
@@ -35,6 +36,7 @@ import { PROVIDERS } from './models/providerMap.js';
|
|
|
35
36
|
import { CREDENTIAL_KEY_ENV } from './tools/credentialCipher.js';
|
|
36
37
|
import { OAUTH_HOSTS_ENV } from './tools/oauthHosts.js';
|
|
37
38
|
import { OAUTH_REDIRECT_URI_ENV } from './a2a/oauthSetup.js';
|
|
39
|
+
import { CHATGPT_SIGNIN_ENV, CHATGPT_SIGNIN_FILE_ENV } from './chatgpt/state.js';
|
|
38
40
|
// ── Where the package lives ──────────────────────────────────────────────────
|
|
39
41
|
/** The package (or clone) root: the directory holding config/agents/syndicate.schema.json. */
|
|
40
42
|
export function packageRoot(from = fileURLToPath(import.meta.url)) {
|
|
@@ -332,18 +334,43 @@ export const LEVELS = [
|
|
|
332
334
|
skill: 'melchizedek-onboard-serve',
|
|
333
335
|
detectable: true,
|
|
334
336
|
},
|
|
337
|
+
{
|
|
338
|
+
id: 'chatgpt-signin',
|
|
339
|
+
menu: 'A ChatGPT plan, on your own machine (Sign in with ChatGPT, local only)',
|
|
340
|
+
title: 'Sign in with ChatGPT (local only)',
|
|
341
|
+
summary: "OpenAI's own Sign in with ChatGPT lets an open-source app that runs on your machine use your ChatGPT plan for OpenAI requests. `melchizedek-setup --chatgpt-signin` opens your browser; once you approve, OpenAI model ids (`gpt-*`, `o<digit>*`) run on your plan whenever OPENAI_API_KEY is not set. The engine registers as its own app with OpenAI and never reads another app's sign-in. Local only: the A2A server, the worker and every other served surface refuse to start while it is the OpenAI path.",
|
|
342
|
+
env: [
|
|
343
|
+
{ name: CHATGPT_SIGNIN_FILE_ENV, shape: 'a path outside any git repository (default ~/.melchizedek/chatgpt-signin.json)', purpose: 'optional: where the sign-in is stored, mode 600' },
|
|
344
|
+
{ name: CHATGPT_SIGNIN_ENV, shape: 'off', purpose: 'optional: ignore a stored sign-in in this process' },
|
|
345
|
+
{ name: 'OPENAI_API_KEY', shape: 'leave blank', purpose: 'a key, when set, wins over the sign-in' },
|
|
346
|
+
],
|
|
347
|
+
confirm: 'the providers line shows `✓ OpenAI ChatGPT sign-in, local only`, and the `chatgpt` line reads `signed in · carries OpenAI ids · local only`.',
|
|
348
|
+
runs: (s) => [`OpenAI files: ${list(s.byTier.openai)}`, `with no key at all: ${list(s.byTier.keyless)}`],
|
|
349
|
+
first: {
|
|
350
|
+
package: ['npx melchizedek-setup --chatgpt-signin', 'npx melchizedek-doctor', init('package', 'research_brief'), '# change its model: lines to a GPT id your ChatGPT account offers, then:', chat('package', 'research_brief')],
|
|
351
|
+
clone: ['npm run setup -- --chatgpt-signin', 'npm run doctor', "# change a syndicate's model: lines to a GPT id your ChatGPT account offers, then:", 'npm run chat:syndicate'],
|
|
352
|
+
},
|
|
353
|
+
notes: [
|
|
354
|
+
'OpenAI documents this flow for open-source and personal projects that run locally (https://developers.openai.com/siwc/token-sharing-open-source). It is a preview: requests go to the Responses API on api.openai.com, streamed and not stored, without temperature, top_p or an output-token cap, and only models your account lists answer.',
|
|
355
|
+
"Your ChatGPT plan's usage limits apply. A limit reached is reported as an OpenAI error and is not retried.",
|
|
356
|
+
'`melchizedek-setup --chatgpt-status` shows where the sign-in is; `--chatgpt-signout` removes the tokens and revokes them at OpenAI. A stored sign-in is never copied into `.env` or the repository.',
|
|
357
|
+
'To serve on the same machine, set OPENAI_API_KEY (or Azure OpenAI), or `MELCHIZEDEK_CHATGPT_SIGNIN=off` for the served process; `doctor --check` fails a served configuration that would run on the sign-in.',
|
|
358
|
+
],
|
|
359
|
+
skill: 'melchizedek-onboard-keys',
|
|
360
|
+
detectable: true,
|
|
361
|
+
},
|
|
335
362
|
{
|
|
336
363
|
id: 'subscription-signin',
|
|
337
|
-
menu: 'A
|
|
338
|
-
title: 'Subscription sign-ins (
|
|
339
|
-
summary: "Not supported, on purpose. A consumer subscription sign-in authorizes that vendor's own apps. The engine does not read, reuse or relay those tokens: Anthropic and Google say third-party apps may not use them, and OpenAI's
|
|
364
|
+
menu: 'A Claude.ai or Gemini CLI sign-in, or a Codex CLI login (no API key)',
|
|
365
|
+
title: 'Subscription sign-ins (Claude.ai, Gemini CLI, Codex CLI)',
|
|
366
|
+
summary: "Not supported, on purpose. A consumer subscription sign-in authorizes that vendor's own apps. The engine does not read, reuse or relay those tokens: Anthropic and Google say third-party apps may not use them, and the Codex CLI's login belongs to the Codex CLI. OpenAI's own Sign in with ChatGPT is the exception, and it is level 9, on your own machine only. Otherwise use the same vendor's sanctioned route.",
|
|
340
367
|
env: [
|
|
341
|
-
{ name: 'OPENAI_API_KEY', shape: 'an API key from https://platform.openai.com/api-keys', purpose: 'instead of a
|
|
368
|
+
{ name: 'OPENAI_API_KEY', shape: 'an API key from https://platform.openai.com/api-keys', purpose: 'instead of a Codex CLI login (or Sign in with ChatGPT: level 9; Azure OpenAI: level 5)' },
|
|
342
369
|
{ name: 'ANTHROPIC_API_KEY', shape: 'an API key from https://console.anthropic.com', purpose: 'instead of a Claude.ai sign-in (or Bedrock / Vertex AI: level 5)' },
|
|
343
370
|
{ name: 'GOOGLE_GENAI_API_KEY', shape: 'an API key from https://aistudio.google.com (free tier)', purpose: 'instead of a Gemini CLI sign-in (or Vertex AI: level 5)' },
|
|
344
371
|
],
|
|
345
|
-
confirm:
|
|
346
|
-
runs: () => ['as level 2 (one key)
|
|
372
|
+
confirm: "the provider you chose shows a ✓; nothing reads another app's sign-in.",
|
|
373
|
+
runs: () => ['as level 2 (one key), level 5 (cloud platform) or, for OpenAI on your own machine, level 9'],
|
|
347
374
|
first: {
|
|
348
375
|
package: [init('package', 'research_brief'), chat('package', 'research_brief')],
|
|
349
376
|
clone: ['npm run chat:syndicate'],
|
|
@@ -351,7 +378,7 @@ export const LEVELS = [
|
|
|
351
378
|
notes: [
|
|
352
379
|
'Anthropic: Claude.ai (Pro/Max) OAuth is for Claude Code and its own apps; third-party developers may not offer Claude.ai login or route requests through those credentials. Use an API key, Bedrock or Vertex AI.',
|
|
353
380
|
"Google: reaching Gemini CLI's services with its sign-in from third-party software is against Gemini CLI's terms. Use an AI Studio key or Vertex AI.",
|
|
354
|
-
"OpenAI: an API key
|
|
381
|
+
"OpenAI: an API key, Azure OpenAI, or on your own machine Sign in with ChatGPT (level 9), which is the engine's own registration with OpenAI. The engine never reads the Codex CLI's stored login or uses its client id.",
|
|
355
382
|
'A coding agent signed in with a subscription (Claude Code, Codex, Gemini CLI) can still drive this repository: the sign-in pays for the coding agent, and the engine runs on the keys above.',
|
|
356
383
|
],
|
|
357
384
|
skill: 'melchizedek-onboard-keys',
|
|
@@ -416,7 +443,7 @@ export function renderOnboardingDoc(shipped = shippedIndex()) {
|
|
|
416
443
|
* Local is always available (whether Ollama is running is not checked).
|
|
417
444
|
*/
|
|
418
445
|
export function detectLevels(result) {
|
|
419
|
-
const direct = result.providers.filter((p) => p.platform === 'direct' && p.funded && p.transport === 'direct');
|
|
446
|
+
const direct = result.providers.filter((p) => p.platform === 'direct' && p.funded && p.transport === 'direct' && p.credential !== 'chatgpt-signin');
|
|
420
447
|
const names = direct.map((p) => `${p.label} (${p.keyEnv})`);
|
|
421
448
|
const cloud = result.endpoints.filter((e) => e.platform === 'vertex' || e.platform === 'bedrock' || e.platform === 'azure' || e.platform === 'invalid');
|
|
422
449
|
const serving = result.serving;
|
|
@@ -464,6 +491,18 @@ export function detectLevels(result) {
|
|
|
464
491
|
evidence: oauthSet.length ? `set: ${oauthSet.join(', ')}` : `${CREDENTIAL_KEY_ENV} unset`,
|
|
465
492
|
problems: result.oauth?.problems ?? [],
|
|
466
493
|
},
|
|
494
|
+
'chatgpt-signin': {
|
|
495
|
+
detected: !!result.chatgpt?.routesOpenAi,
|
|
496
|
+
// Presence only: the file's path stays on the doctor's own line.
|
|
497
|
+
evidence: !result.chatgpt?.present
|
|
498
|
+
? 'no ChatGPT sign-in stored'
|
|
499
|
+
: !result.chatgpt.signedIn
|
|
500
|
+
? 'a sign-in file without tokens (signed out)'
|
|
501
|
+
: result.chatgpt.routesOpenAi
|
|
502
|
+
? 'signed in; carries OpenAI ids (local only)'
|
|
503
|
+
: 'signed in; not used (OPENAI_API_KEY, another OpenAI endpoint, or switched off)',
|
|
504
|
+
problems: result.chatgpt?.problems ?? [],
|
|
505
|
+
},
|
|
467
506
|
};
|
|
468
507
|
return LEVELS.filter((l) => l.detectable).map((l) => ({ id: l.id, ...out[l.id] }));
|
|
469
508
|
}
|
|
@@ -57,7 +57,7 @@ export { CREDENTIAL_REQUEST, credentialResponsePart, describeConsent, pendingCon
|
|
|
57
57
|
export { chooseRuntime, describeRuntime, runtimeSetting, DEFAULT_RUNTIME, RUNTIMES, RuntimeRemovedError, UnsupportedOnRuntimeError } from './runtimeFlag.js';
|
|
58
58
|
// The session store a turn takes when nothing durable is configured, and the engine's interfaces (ADR 0107).
|
|
59
59
|
export { InProcessSessionService } from './sessions.js';
|
|
60
|
-
import { ROUTE_STEP_SUFFIX,
|
|
60
|
+
import { ROUTE_STEP_SUFFIX, inputRequestFrom, isWorkflowSyndicate } from '../workflow.js';
|
|
61
61
|
export { describeInput } from '../workflow.js';
|
|
62
62
|
import { isDispatchSyndicate, matchRouteOverride, resolveRoute } from '../dispatch.js';
|
|
63
63
|
import { collectGrounding, describeGrounding, newGroundingState, webSourcesLine } from '../grounding.js';
|
|
@@ -86,15 +86,28 @@ const CLASSIFIER_PREAMBLE = `RECENT CONVERSATION, oldest first — context for y
|
|
|
86
86
|
// The defaults live with the loop's self-correction (lib/runtime/native/selfCorrection.ts).
|
|
87
87
|
export { DEFAULT_MODEL_ERROR_RETRIES, DEFAULT_TOOL_ERROR_RETRIES } from './native/selfCorrection.js';
|
|
88
88
|
// ── Draining one agent's stream ──────────────────────────────────────────────
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
/**
|
|
90
|
+
* The shape of a tool call's arguments for a log line: the key names and the
|
|
91
|
+
* size, never a value. Arguments are model-chosen and routinely carry the
|
|
92
|
+
* person's words, and a server log is not where those belong (the ledger is
|
|
93
|
+
* the deliberate record, with its own retention).
|
|
94
|
+
*/
|
|
95
|
+
function describeToolArgs(args) {
|
|
96
|
+
const keys = args ? Object.keys(args) : [];
|
|
97
|
+
if (!keys.length)
|
|
98
|
+
return 'no args';
|
|
99
|
+
let bytes;
|
|
100
|
+
try {
|
|
101
|
+
bytes = Buffer.byteLength(JSON.stringify(args), 'utf8');
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return `args: ${keys.join(', ')}`;
|
|
105
|
+
}
|
|
106
|
+
return `args: ${keys.join(', ')} (${bytes.toLocaleString()} bytes)`;
|
|
107
|
+
}
|
|
108
|
+
/** A pending question for a log line: who asks, never what. */
|
|
109
|
+
function describeInputForLog(input) {
|
|
110
|
+
return `${input.node} asks a question${input.path?.length ? ` (${input.path.join(' → ')})` : ''}`;
|
|
98
111
|
}
|
|
99
112
|
/**
|
|
100
113
|
* Drains one agent's event stream into a DrainedRun. The answer is the LAST
|
|
@@ -188,7 +201,7 @@ export async function drainAgentStream(stream, opts = {}) {
|
|
|
188
201
|
if (inputRequest) {
|
|
189
202
|
// An ask_user node: the workflow waits for the person (lib/workflow.ts).
|
|
190
203
|
d.inputRequests.push(inputRequest);
|
|
191
|
-
ev.log?.(`⏸ ${
|
|
204
|
+
ev.log?.(`⏸ ${describeInputForLog(inputRequest)}`);
|
|
192
205
|
continue;
|
|
193
206
|
}
|
|
194
207
|
if (!name)
|
|
@@ -197,7 +210,7 @@ export async function drainAgentStream(stream, opts = {}) {
|
|
|
197
210
|
if (opts.subagentNames?.has(name))
|
|
198
211
|
d.delegations.push(name);
|
|
199
212
|
d.toolCalls.push({ agent: e.author ?? 'unknown', name, args });
|
|
200
|
-
ev.log?.(`→ Tool: ${name}
|
|
213
|
+
ev.log?.(`→ Tool: ${name} by ${e.author ?? 'unknown'} — ${describeToolArgs(args)}`);
|
|
201
214
|
if (opts.publishToolStatus)
|
|
202
215
|
ev.onProgress?.(`Invoking tool: ${name}`);
|
|
203
216
|
}
|
|
@@ -580,7 +593,7 @@ async function runTurnInner(opts, control, _runtime, nestedTurn) {
|
|
|
580
593
|
result.status = 'input-required';
|
|
581
594
|
result.input = input;
|
|
582
595
|
result.text = input.message;
|
|
583
|
-
ev.log?.(`⏸ Input needed: ${
|
|
596
|
+
ev.log?.(`⏸ Input needed: ${describeInputForLog(input)}`);
|
|
584
597
|
return finish();
|
|
585
598
|
};
|
|
586
599
|
/** After the answering run: does a pause wait inside a delegated call `agentName` left open (ADR 0110)? */
|
|
@@ -595,7 +608,7 @@ async function runTurnInner(opts, control, _runtime, nestedTurn) {
|
|
|
595
608
|
result.status = 'input-required';
|
|
596
609
|
result.input = below.question;
|
|
597
610
|
result.text = below.question.message;
|
|
598
|
-
ev.log?.(`⏸ Input needed: ${
|
|
611
|
+
ev.log?.(`⏸ Input needed: ${describeInputForLog({ node: below.question.node, path: below.path })}`);
|
|
599
612
|
return finish();
|
|
600
613
|
}
|
|
601
614
|
return undefined;
|
|
@@ -612,7 +625,7 @@ async function runTurnInner(opts, control, _runtime, nestedTurn) {
|
|
|
612
625
|
result.status = 'input-required';
|
|
613
626
|
result.input = input;
|
|
614
627
|
result.text = input.message;
|
|
615
|
-
ev.log?.(`⏸ Input needed: ${
|
|
628
|
+
ev.log?.(`⏸ Input needed: ${describeInputForLog(input)}`);
|
|
616
629
|
return finish();
|
|
617
630
|
};
|
|
618
631
|
/** A nested workflow's walk, or a nested dispatch syndicate's turn, paused below a route (ADR 0119, ADR 0120): its approval request, its consent request, else its question. */
|
|
@@ -922,7 +935,8 @@ async function runTurnInner(opts, control, _runtime, nestedTurn) {
|
|
|
922
935
|
throw new Error(`Dispatch failed: no subagent named '${resolution.route}' is declared.`);
|
|
923
936
|
result.route = { ...resolution, decidedBy };
|
|
924
937
|
const routeNote = resolution.reason ? ` — ${resolution.reason}` : '';
|
|
925
|
-
|
|
938
|
+
// The classifier's reason can paraphrase the person: progress (to the caller) carries it, the log does not.
|
|
939
|
+
ev.log?.(`⇄ Route: ${resolution.route}`);
|
|
926
940
|
ev.onProgress?.(`Routed to ${resolution.route}${routeNote}`);
|
|
927
941
|
// ══ DISPATCH ═════════════════════════════════════════════════════════
|
|
928
942
|
if (routeCfg.a2a_agent_url) {
|
|
@@ -28,6 +28,8 @@ export declare const REASONING_LEVELS: readonly ['none', 'low', 'medium', 'high'
|
|
|
28
28
|
export declare const OUTPUT_MIMES: readonly ['application/json', 'text/plain'];
|
|
29
29
|
export declare const TOOL_CHOICE_MODES: readonly ['auto', 'none', 'required'];
|
|
30
30
|
export declare const SKILL_SCRIPT_MODES: readonly ['none', 'local'];
|
|
31
|
+
/** An `mcp_servers` entry's name: lowercase, bounded, one character class (no backtracking). */
|
|
32
|
+
export declare const MCP_SERVER_NAME: RegExp;
|
|
31
33
|
export declare const agentSchema: z.ZodObject<{
|
|
32
34
|
name: z.ZodString;
|
|
33
35
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -131,8 +133,9 @@ export declare const agentSchema: z.ZodObject<{
|
|
|
131
133
|
authorization_code: "authorization_code";
|
|
132
134
|
client_credentials: "client_credentials";
|
|
133
135
|
}>;
|
|
136
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
134
137
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
135
|
-
token_url: z.ZodString
|
|
138
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
136
139
|
client_id: z.ZodOptional<z.ZodString>;
|
|
137
140
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
138
141
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -140,6 +143,38 @@ export declare const agentSchema: z.ZodObject<{
|
|
|
140
143
|
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
141
144
|
}, z.core.$strict>;
|
|
142
145
|
}, z.core.$strict>>;
|
|
146
|
+
mcp_transport: z.ZodOptional<z.ZodEnum<{
|
|
147
|
+
auto: "auto";
|
|
148
|
+
sse: "sse";
|
|
149
|
+
streamable_http: "streamable_http";
|
|
150
|
+
}>>;
|
|
151
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
url: z.ZodString;
|
|
154
|
+
tools: z.ZodArray<z.ZodString>;
|
|
155
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
156
|
+
oauth2: z.ZodObject<{
|
|
157
|
+
provider: z.ZodString;
|
|
158
|
+
grant: z.ZodEnum<{
|
|
159
|
+
authorization_code: "authorization_code";
|
|
160
|
+
client_credentials: "client_credentials";
|
|
161
|
+
}>;
|
|
162
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
163
|
+
authorization_url: z.ZodOptional<z.ZodString>;
|
|
164
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
165
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
166
|
+
client_id_env: z.ZodOptional<z.ZodString>;
|
|
167
|
+
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
168
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
169
|
+
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
170
|
+
}, z.core.$strict>;
|
|
171
|
+
}, z.core.$strict>>;
|
|
172
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
173
|
+
auto: "auto";
|
|
174
|
+
sse: "sse";
|
|
175
|
+
streamable_http: "streamable_http";
|
|
176
|
+
}>>;
|
|
177
|
+
}, z.core.$strict>>>;
|
|
143
178
|
skills: z.ZodOptional<z.ZodObject<{
|
|
144
179
|
dir: z.ZodString;
|
|
145
180
|
scripts: z.ZodOptional<z.ZodEnum<{
|
|
@@ -171,8 +206,9 @@ export declare const agentSchema: z.ZodObject<{
|
|
|
171
206
|
authorization_code: "authorization_code";
|
|
172
207
|
client_credentials: "client_credentials";
|
|
173
208
|
}>;
|
|
209
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
174
210
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
175
|
-
token_url: z.ZodString
|
|
211
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
176
212
|
client_id: z.ZodOptional<z.ZodString>;
|
|
177
213
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
178
214
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -306,8 +342,9 @@ export declare const subagentSchema: z.ZodObject<{
|
|
|
306
342
|
authorization_code: "authorization_code";
|
|
307
343
|
client_credentials: "client_credentials";
|
|
308
344
|
}>;
|
|
345
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
309
346
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
310
|
-
token_url: z.ZodString
|
|
347
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
311
348
|
client_id: z.ZodOptional<z.ZodString>;
|
|
312
349
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
313
350
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -315,6 +352,38 @@ export declare const subagentSchema: z.ZodObject<{
|
|
|
315
352
|
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
316
353
|
}, z.core.$strict>;
|
|
317
354
|
}, z.core.$strict>>;
|
|
355
|
+
mcp_transport: z.ZodOptional<z.ZodEnum<{
|
|
356
|
+
auto: "auto";
|
|
357
|
+
sse: "sse";
|
|
358
|
+
streamable_http: "streamable_http";
|
|
359
|
+
}>>;
|
|
360
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
361
|
+
name: z.ZodString;
|
|
362
|
+
url: z.ZodString;
|
|
363
|
+
tools: z.ZodArray<z.ZodString>;
|
|
364
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
365
|
+
oauth2: z.ZodObject<{
|
|
366
|
+
provider: z.ZodString;
|
|
367
|
+
grant: z.ZodEnum<{
|
|
368
|
+
authorization_code: "authorization_code";
|
|
369
|
+
client_credentials: "client_credentials";
|
|
370
|
+
}>;
|
|
371
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
372
|
+
authorization_url: z.ZodOptional<z.ZodString>;
|
|
373
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
374
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
375
|
+
client_id_env: z.ZodOptional<z.ZodString>;
|
|
376
|
+
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
377
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
378
|
+
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
379
|
+
}, z.core.$strict>;
|
|
380
|
+
}, z.core.$strict>>;
|
|
381
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
382
|
+
auto: "auto";
|
|
383
|
+
sse: "sse";
|
|
384
|
+
streamable_http: "streamable_http";
|
|
385
|
+
}>>;
|
|
386
|
+
}, z.core.$strict>>>;
|
|
318
387
|
skills: z.ZodOptional<z.ZodObject<{
|
|
319
388
|
dir: z.ZodString;
|
|
320
389
|
scripts: z.ZodOptional<z.ZodEnum<{
|
|
@@ -346,8 +415,9 @@ export declare const subagentSchema: z.ZodObject<{
|
|
|
346
415
|
authorization_code: "authorization_code";
|
|
347
416
|
client_credentials: "client_credentials";
|
|
348
417
|
}>;
|
|
418
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
349
419
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
350
|
-
token_url: z.ZodString
|
|
420
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
351
421
|
client_id: z.ZodOptional<z.ZodString>;
|
|
352
422
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
353
423
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -485,8 +555,9 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
485
555
|
authorization_code: "authorization_code";
|
|
486
556
|
client_credentials: "client_credentials";
|
|
487
557
|
}>;
|
|
558
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
488
559
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
489
|
-
token_url: z.ZodString
|
|
560
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
490
561
|
client_id: z.ZodOptional<z.ZodString>;
|
|
491
562
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
492
563
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -494,6 +565,38 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
494
565
|
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
495
566
|
}, z.core.$strict>;
|
|
496
567
|
}, z.core.$strict>>;
|
|
568
|
+
mcp_transport: z.ZodOptional<z.ZodEnum<{
|
|
569
|
+
auto: "auto";
|
|
570
|
+
sse: "sse";
|
|
571
|
+
streamable_http: "streamable_http";
|
|
572
|
+
}>>;
|
|
573
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
574
|
+
name: z.ZodString;
|
|
575
|
+
url: z.ZodString;
|
|
576
|
+
tools: z.ZodArray<z.ZodString>;
|
|
577
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
578
|
+
oauth2: z.ZodObject<{
|
|
579
|
+
provider: z.ZodString;
|
|
580
|
+
grant: z.ZodEnum<{
|
|
581
|
+
authorization_code: "authorization_code";
|
|
582
|
+
client_credentials: "client_credentials";
|
|
583
|
+
}>;
|
|
584
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
585
|
+
authorization_url: z.ZodOptional<z.ZodString>;
|
|
586
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
587
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
588
|
+
client_id_env: z.ZodOptional<z.ZodString>;
|
|
589
|
+
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
590
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
591
|
+
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
592
|
+
}, z.core.$strict>;
|
|
593
|
+
}, z.core.$strict>>;
|
|
594
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
595
|
+
auto: "auto";
|
|
596
|
+
sse: "sse";
|
|
597
|
+
streamable_http: "streamable_http";
|
|
598
|
+
}>>;
|
|
599
|
+
}, z.core.$strict>>>;
|
|
497
600
|
skills: z.ZodOptional<z.ZodObject<{
|
|
498
601
|
dir: z.ZodString;
|
|
499
602
|
scripts: z.ZodOptional<z.ZodEnum<{
|
|
@@ -525,8 +628,9 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
525
628
|
authorization_code: "authorization_code";
|
|
526
629
|
client_credentials: "client_credentials";
|
|
527
630
|
}>;
|
|
631
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
528
632
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
529
|
-
token_url: z.ZodString
|
|
633
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
530
634
|
client_id: z.ZodOptional<z.ZodString>;
|
|
531
635
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
532
636
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -654,8 +758,9 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
654
758
|
authorization_code: "authorization_code";
|
|
655
759
|
client_credentials: "client_credentials";
|
|
656
760
|
}>;
|
|
761
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
657
762
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
658
|
-
token_url: z.ZodString
|
|
763
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
659
764
|
client_id: z.ZodOptional<z.ZodString>;
|
|
660
765
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
661
766
|
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
@@ -663,6 +768,38 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
663
768
|
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
664
769
|
}, z.core.$strict>;
|
|
665
770
|
}, z.core.$strict>>;
|
|
771
|
+
mcp_transport: z.ZodOptional<z.ZodEnum<{
|
|
772
|
+
auto: "auto";
|
|
773
|
+
sse: "sse";
|
|
774
|
+
streamable_http: "streamable_http";
|
|
775
|
+
}>>;
|
|
776
|
+
mcp_servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
777
|
+
name: z.ZodString;
|
|
778
|
+
url: z.ZodString;
|
|
779
|
+
tools: z.ZodArray<z.ZodString>;
|
|
780
|
+
auth: z.ZodOptional<z.ZodObject<{
|
|
781
|
+
oauth2: z.ZodObject<{
|
|
782
|
+
provider: z.ZodString;
|
|
783
|
+
grant: z.ZodEnum<{
|
|
784
|
+
authorization_code: "authorization_code";
|
|
785
|
+
client_credentials: "client_credentials";
|
|
786
|
+
}>;
|
|
787
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
788
|
+
authorization_url: z.ZodOptional<z.ZodString>;
|
|
789
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
790
|
+
client_id: z.ZodOptional<z.ZodString>;
|
|
791
|
+
client_id_env: z.ZodOptional<z.ZodString>;
|
|
792
|
+
client_secret_env: z.ZodOptional<z.ZodString>;
|
|
793
|
+
scopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
794
|
+
authorization_params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
795
|
+
}, z.core.$strict>;
|
|
796
|
+
}, z.core.$strict>>;
|
|
797
|
+
transport: z.ZodOptional<z.ZodEnum<{
|
|
798
|
+
auto: "auto";
|
|
799
|
+
sse: "sse";
|
|
800
|
+
streamable_http: "streamable_http";
|
|
801
|
+
}>>;
|
|
802
|
+
}, z.core.$strict>>>;
|
|
666
803
|
skills: z.ZodOptional<z.ZodObject<{
|
|
667
804
|
dir: z.ZodString;
|
|
668
805
|
scripts: z.ZodOptional<z.ZodEnum<{
|
|
@@ -694,8 +831,9 @@ export declare const syndicateSchema: z.ZodObject<{
|
|
|
694
831
|
authorization_code: "authorization_code";
|
|
695
832
|
client_credentials: "client_credentials";
|
|
696
833
|
}>;
|
|
834
|
+
client_registration: z.ZodOptional<z.ZodLiteral<"dynamic">>;
|
|
697
835
|
authorization_url: z.ZodOptional<z.ZodString>;
|
|
698
|
-
token_url: z.ZodString
|
|
836
|
+
token_url: z.ZodOptional<z.ZodString>;
|
|
699
837
|
client_id: z.ZodOptional<z.ZodString>;
|
|
700
838
|
client_id_env: z.ZodOptional<z.ZodString>;
|
|
701
839
|
client_secret_env: z.ZodOptional<z.ZodString>;
|