agent-nuvira 3.3.0 → 3.3.3
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/.agents/skills/code-assessment/SKILL.md +10 -1
- package/.agents/skills/index.json +1 -1
- package/README.md +47 -9
- package/dist/agents/agents/runner.d.ts +9 -0
- package/dist/agents/agents/runner.d.ts.map +1 -1
- package/dist/agents/agents/runner.js +34 -12
- package/dist/agents/agents/runner.js.map +1 -1
- package/dist/agents/agents/writer-tool-calling.d.ts.map +1 -1
- package/dist/agents/agents/writer-tool-calling.js +7 -2
- package/dist/agents/agents/writer-tool-calling.js.map +1 -1
- package/dist/agents/agents/writer.d.ts.map +1 -1
- package/dist/agents/agents/writer.js +7 -1
- package/dist/agents/agents/writer.js.map +1 -1
- package/dist/agents/artifact-verification.d.ts +102 -0
- package/dist/agents/artifact-verification.d.ts.map +1 -0
- package/dist/agents/artifact-verification.js +216 -0
- package/dist/agents/artifact-verification.js.map +1 -0
- package/dist/agents/checkpoint-store.d.ts +73 -0
- package/dist/agents/checkpoint-store.d.ts.map +1 -1
- package/dist/agents/checkpoint-store.js +161 -0
- package/dist/agents/checkpoint-store.js.map +1 -1
- package/dist/agents/credential-store.d.ts +120 -0
- package/dist/agents/credential-store.d.ts.map +1 -1
- package/dist/agents/credential-store.js +358 -19
- package/dist/agents/credential-store.js.map +1 -1
- package/dist/agents/orchestrator.d.ts +10 -1
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +234 -75
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/phase-engine.d.ts +61 -0
- package/dist/agents/phase-engine.d.ts.map +1 -1
- package/dist/agents/phase-engine.js +68 -2
- package/dist/agents/phase-engine.js.map +1 -1
- package/dist/agents/prompt-assembly.d.ts +11 -0
- package/dist/agents/prompt-assembly.d.ts.map +1 -1
- package/dist/agents/prompt-assembly.js +17 -0
- package/dist/agents/prompt-assembly.js.map +1 -1
- package/dist/agents/release-preflight.d.ts +121 -0
- package/dist/agents/release-preflight.d.ts.map +1 -0
- package/dist/agents/release-preflight.js +259 -0
- package/dist/agents/release-preflight.js.map +1 -0
- package/dist/agents/release-runner.d.ts +157 -0
- package/dist/agents/release-runner.d.ts.map +1 -0
- package/dist/agents/release-runner.js +719 -0
- package/dist/agents/release-runner.js.map +1 -0
- package/dist/agents/step-handoff.d.ts +190 -0
- package/dist/agents/step-handoff.d.ts.map +1 -0
- package/dist/agents/step-handoff.js +443 -0
- package/dist/agents/step-handoff.js.map +1 -0
- package/dist/cli/benchmark.d.ts.map +1 -1
- package/dist/cli/benchmark.js +11 -4
- package/dist/cli/benchmark.js.map +1 -1
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +25 -4
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/cli-program.d.ts.map +1 -1
- package/dist/cli/cli-program.js +9 -2
- package/dist/cli/cli-program.js.map +1 -1
- package/dist/cli/commands.d.ts +2 -1
- package/dist/cli/commands.d.ts.map +1 -1
- package/dist/cli/commands.js +3 -2
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/config.js +2 -2
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/credentials.d.ts +28 -0
- package/dist/cli/credentials.d.ts.map +1 -0
- package/dist/cli/credentials.js +213 -0
- package/dist/cli/credentials.js.map +1 -0
- package/dist/cli/dashboard.d.ts +26 -0
- package/dist/cli/dashboard.d.ts.map +1 -1
- package/dist/cli/dashboard.js +123 -3
- package/dist/cli/dashboard.js.map +1 -1
- package/dist/cli/failover-runner.d.ts.map +1 -1
- package/dist/cli/failover-runner.js +9 -3
- package/dist/cli/failover-runner.js.map +1 -1
- package/dist/cli/intent.d.ts +1 -1
- package/dist/cli/intent.js +2 -2
- package/dist/cli/intent.js.map +1 -1
- package/dist/cli/loop-executor.d.ts +7 -0
- package/dist/cli/loop-executor.d.ts.map +1 -1
- package/dist/cli/loop-executor.js +75 -7
- package/dist/cli/loop-executor.js.map +1 -1
- package/dist/cli/nlu.d.ts.map +1 -1
- package/dist/cli/nlu.js +8 -2
- package/dist/cli/nlu.js.map +1 -1
- package/dist/cli/process-control.d.ts +15 -0
- package/dist/cli/process-control.d.ts.map +1 -1
- package/dist/cli/process-control.js +38 -14
- package/dist/cli/process-control.js.map +1 -1
- package/dist/cli/publish.d.ts +22 -0
- package/dist/cli/publish.d.ts.map +1 -1
- package/dist/cli/publish.js +109 -13
- package/dist/cli/publish.js.map +1 -1
- package/dist/config/live-credentials.d.ts +57 -0
- package/dist/config/live-credentials.d.ts.map +1 -0
- package/dist/config/live-credentials.js +126 -0
- package/dist/config/live-credentials.js.map +1 -0
- package/dist/config/paths.d.ts +18 -0
- package/dist/config/paths.d.ts.map +1 -1
- package/dist/config/paths.js +25 -0
- package/dist/config/paths.js.map +1 -1
- package/dist/federation/a2a-types.js +1 -1
- package/dist/federation/a2a-types.js.map +1 -1
- package/dist/forwarded.d.ts +2 -0
- package/dist/forwarded.d.ts.map +1 -0
- package/dist/forwarded.js +2 -0
- package/dist/forwarded.js.map +1 -0
- package/dist/inference/model-validator.d.ts +6 -1
- package/dist/inference/model-validator.d.ts.map +1 -1
- package/dist/inference/model-validator.js +7 -2
- package/dist/inference/model-validator.js.map +1 -1
- package/dist/inference/route-resolver.d.ts +116 -0
- package/dist/inference/route-resolver.d.ts.map +1 -0
- package/dist/inference/route-resolver.js +159 -0
- package/dist/inference/route-resolver.js.map +1 -0
- package/dist/inference/tool-call-utils.d.ts +44 -0
- package/dist/inference/tool-call-utils.d.ts.map +1 -1
- package/dist/inference/tool-call-utils.js +126 -4
- package/dist/inference/tool-call-utils.js.map +1 -1
- package/dist/learning/autonomy-policy.d.ts +24 -0
- package/dist/learning/autonomy-policy.d.ts.map +1 -1
- package/dist/learning/autonomy-policy.js +110 -23
- package/dist/learning/autonomy-policy.js.map +1 -1
- package/dist/learning/eval-framework.d.ts +24 -0
- package/dist/learning/eval-framework.d.ts.map +1 -1
- package/dist/learning/eval-framework.js +291 -0
- package/dist/learning/eval-framework.js.map +1 -1
- package/dist/learning/intent-envelope.d.ts +162 -0
- package/dist/learning/intent-envelope.d.ts.map +1 -0
- package/dist/learning/intent-envelope.js +235 -0
- package/dist/learning/intent-envelope.js.map +1 -0
- package/dist/learning/reasoning-trace.d.ts +2 -2
- package/dist/learning/reasoning-trace.d.ts.map +1 -1
- package/dist/learning/reasoning-trace.js +25 -1
- package/dist/learning/reasoning-trace.js.map +1 -1
- package/dist/learning/resilient-call.d.ts.map +1 -1
- package/dist/learning/resilient-call.js +29 -17
- package/dist/learning/resilient-call.js.map +1 -1
- package/dist/learning/run-trace.d.ts +164 -0
- package/dist/learning/run-trace.d.ts.map +1 -0
- package/dist/learning/run-trace.js +342 -0
- package/dist/learning/run-trace.js.map +1 -0
- package/dist/learning/skill-store.d.ts.map +1 -1
- package/dist/learning/skill-store.js +35 -10
- package/dist/learning/skill-store.js.map +1 -1
- package/dist/learning/skill-types.d.ts +14 -0
- package/dist/learning/skill-types.d.ts.map +1 -1
- package/dist/learning/skill-types.js +19 -0
- package/dist/learning/skill-types.js.map +1 -1
- package/dist/mcp/catalog.js +2 -3
- package/dist/mcp/catalog.js.map +1 -1
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +5 -3
- package/dist/mcp/manager.js.map +1 -1
- package/dist/resources/command-manifest.json +10 -10
- package/dist/skills/bundled-skills.d.ts.map +1 -1
- package/dist/skills/bundled-skills.js +13 -2
- package/dist/skills/bundled-skills.js.map +1 -1
- package/dist/skills/secret-capture.d.ts.map +1 -1
- package/dist/skills/secret-capture.js +9 -4
- package/dist/skills/secret-capture.js.map +1 -1
- package/dist/tools/coding-tools.d.ts.map +1 -1
- package/dist/tools/coding-tools.js +33 -8
- package/dist/tools/coding-tools.js.map +1 -1
- package/dist/tools/credentials-tool.d.ts +24 -0
- package/dist/tools/credentials-tool.d.ts.map +1 -0
- package/dist/tools/credentials-tool.js +125 -0
- package/dist/tools/credentials-tool.js.map +1 -0
- package/dist/tools/edit-verification.d.ts +78 -0
- package/dist/tools/edit-verification.d.ts.map +1 -1
- package/dist/tools/edit-verification.js +213 -16
- package/dist/tools/edit-verification.js.map +1 -1
- package/dist/tools/git-tool.d.ts +25 -7
- package/dist/tools/git-tool.d.ts.map +1 -1
- package/dist/tools/git-tool.js +155 -15
- package/dist/tools/git-tool.js.map +1 -1
- package/dist/tools/loop-project-context.d.ts.map +1 -1
- package/dist/tools/loop-project-context.js +16 -0
- package/dist/tools/loop-project-context.js.map +1 -1
- package/dist/tools/loop-route-feed.d.ts +57 -0
- package/dist/tools/loop-route-feed.d.ts.map +1 -0
- package/dist/tools/loop-route-feed.js +101 -0
- package/dist/tools/loop-route-feed.js.map +1 -0
- package/dist/tools/pipeline-tool.d.ts.map +1 -1
- package/dist/tools/pipeline-tool.js +8 -2
- package/dist/tools/pipeline-tool.js.map +1 -1
- package/dist/tools/publish-tool.d.ts.map +1 -1
- package/dist/tools/publish-tool.js +76 -10
- package/dist/tools/publish-tool.js.map +1 -1
- package/dist/tools/registry.d.ts +52 -3
- package/dist/tools/registry.d.ts.map +1 -1
- package/dist/tools/registry.js +88 -11
- package/dist/tools/registry.js.map +1 -1
- package/dist/tools/run-cli.d.ts.map +1 -1
- package/dist/tools/run-cli.js +15 -2
- package/dist/tools/run-cli.js.map +1 -1
- package/dist/tools/run-terminal.d.ts +9 -0
- package/dist/tools/run-terminal.d.ts.map +1 -1
- package/dist/tools/run-terminal.js +103 -6
- package/dist/tools/run-terminal.js.map +1 -1
- package/dist/tools/skill-tool.d.ts.map +1 -1
- package/dist/tools/skill-tool.js +5 -0
- package/dist/tools/skill-tool.js.map +1 -1
- package/dist/tools/tool-loop.d.ts +40 -6
- package/dist/tools/tool-loop.d.ts.map +1 -1
- package/dist/tools/tool-loop.js +409 -14
- package/dist/tools/tool-loop.js.map +1 -1
- package/dist/tools/toolsets.js +2 -2
- package/dist/tools/toolsets.js.map +1 -1
- package/dist/web-dashboard/chat-console.d.ts +5 -0
- package/dist/web-dashboard/chat-console.d.ts.map +1 -1
- package/dist/web-dashboard/chat-console.js +32 -3
- package/dist/web-dashboard/chat-console.js.map +1 -1
- package/dist/web-dashboard/server.d.ts +46 -0
- package/dist/web-dashboard/server.d.ts.map +1 -1
- package/dist/web-dashboard/server.js +115 -1
- package/dist/web-dashboard/server.js.map +1 -1
- package/dist/web-dashboard/src/admin-auth.d.ts +49 -2
- package/dist/web-dashboard/src/admin-auth.d.ts.map +1 -1
- package/dist/web-dashboard/src/admin-auth.js +64 -3
- package/dist/web-dashboard/src/admin-auth.js.map +1 -1
- package/dist/web-dashboard/src/types.d.ts +41 -0
- package/dist/web-dashboard/src/types.d.ts.map +1 -1
- package/dist/workflow/registry.js +1 -1
- package/dist/workflow/registry.js.map +1 -1
- package/package.json +9 -5
- package/src/web-dashboard/public/assets/index-CxDj7p6i.js +207 -0
- package/src/web-dashboard/public/assets/index-CxDj7p6i.js.map +1 -0
- package/src/web-dashboard/public/index.html +1 -1
- package/src/web-dashboard/public/assets/index-kCUkORm7.js +0 -207
- package/src/web-dashboard/public/assets/index-kCUkORm7.js.map +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credentials that grant a REAL, outward action — and the rule that they must
|
|
3
|
+
* never reach a test process.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS. It is the reason agent-nuvira could not publish its own
|
|
6
|
+
* release, and the reason the failure looked inexplicable for three attempts.
|
|
7
|
+
*
|
|
8
|
+
* The release pipeline spawns `npm test` with its own environment, and the
|
|
9
|
+
* credential store loads that environment from `~/.nuvira/.env` — so the test
|
|
10
|
+
* process inherited the operator's LIVE provider keys (GROQ, GEMINI, NVIDIA NIM,
|
|
11
|
+
* OPENROUTER) along with Twilio / Slack / Telegram tokens and AWS/Bedrock
|
|
12
|
+
* credentials. Tests that are conditioned on a key being present — correctly, so
|
|
13
|
+
* that someone with a key can exercise the real path — then woke up and took a
|
|
14
|
+
* real network path. MEASURED: the same 350 files that are green in a shell
|
|
15
|
+
* without those keys (349 passed, 99-133s, twice) produced 7 failed files with
|
|
16
|
+
* 25 x `Test timed out in 15000ms` when run with the release's environment
|
|
17
|
+
* (363s). Phase 1 therefore failed every release attempt on an environment
|
|
18
|
+
* difference that left no trace in its own output.
|
|
19
|
+
*
|
|
20
|
+
* The fix is deliberately at BOTH ends:
|
|
21
|
+
* - the SUITE strips these keys (`tests/setup/hermetic-env.ts`) so no test can
|
|
22
|
+
* reach a live provider or send a real message, no matter who starts it; and
|
|
23
|
+
* - the PIPELINE spawns the suite without them (`runTestsPhase`), because
|
|
24
|
+
* handing live credentials to a process whose job is to not use them is the
|
|
25
|
+
* pipeline's own bug.
|
|
26
|
+
* A test that genuinely needs a key sets one itself, as the credential tests
|
|
27
|
+
* already do.
|
|
28
|
+
*
|
|
29
|
+
* The release's OWN git/npm credentials are stripped from the suite as well, and
|
|
30
|
+
* the measurement is the reason. `IssueTriageAgent.detectSource` infers `github`
|
|
31
|
+
* from the presence of a GitHub token, so `should detect auto when no keyword
|
|
32
|
+
* matches` returned `github` and failed — under the release, which must hold
|
|
33
|
+
* `GITHUB_TOKEN` to push, that is EVERY release. A test that needs a token now
|
|
34
|
+
* provides its own: the credential tests already set and delete these in their
|
|
35
|
+
* `beforeEach` (see tests/agents/credential-store.test.ts), so nothing depends on
|
|
36
|
+
* inheriting them.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* Every provider API key the catalog knows about, derived rather than copied —
|
|
40
|
+
* a hardcoded list here would silently fall behind the providers being added.
|
|
41
|
+
*/
|
|
42
|
+
export declare const PROVIDER_CREDENTIAL_ENV_KEYS: string[];
|
|
43
|
+
/** {@link SIDE_EFFECT_ENV_KEYS}, exported for the tests that pin the list. */
|
|
44
|
+
export declare const SIDE_EFFECT_CREDENTIAL_ENV_KEYS: string[];
|
|
45
|
+
/** The keys {@link stripTestUnsafeEnv} removes, sorted. */
|
|
46
|
+
export declare const TEST_UNSAFE_ENV_KEYS: string[];
|
|
47
|
+
/**
|
|
48
|
+
* A COPY of `env` without the credentials above — for spawning a child (the
|
|
49
|
+
* release spawns the suite) without mutating this process's own environment.
|
|
50
|
+
*/
|
|
51
|
+
export declare function stripTestUnsafeEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
52
|
+
/**
|
|
53
|
+
* Remove the credentials above from `env` IN PLACE, returning the names that were
|
|
54
|
+
* actually present — so a suite can report what it closed rather than assuming.
|
|
55
|
+
*/
|
|
56
|
+
export declare function deleteTestUnsafeEnv(env?: NodeJS.ProcessEnv): string[];
|
|
57
|
+
//# sourceMappingURL=live-credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-credentials.d.ts","sourceRoot":"","sources":["../../src/config/live-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAoCH;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,MAAM,EAOzC,CAAC;AAET,8EAA8E;AAC9E,eAAO,MAAM,+BAA+B,EAAE,MAAM,EAA8B,CAAC;AAiBnF,2DAA2D;AAC3D,eAAO,MAAM,oBAAoB,EAAE,MAAM,EAIhC,CAAC;AAEV;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAAC,UAAU,CAI1F;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,EAAE,CASlF"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Credentials that grant a REAL, outward action — and the rule that they must
|
|
3
|
+
* never reach a test process.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS. It is the reason agent-nuvira could not publish its own
|
|
6
|
+
* release, and the reason the failure looked inexplicable for three attempts.
|
|
7
|
+
*
|
|
8
|
+
* The release pipeline spawns `npm test` with its own environment, and the
|
|
9
|
+
* credential store loads that environment from `~/.nuvira/.env` — so the test
|
|
10
|
+
* process inherited the operator's LIVE provider keys (GROQ, GEMINI, NVIDIA NIM,
|
|
11
|
+
* OPENROUTER) along with Twilio / Slack / Telegram tokens and AWS/Bedrock
|
|
12
|
+
* credentials. Tests that are conditioned on a key being present — correctly, so
|
|
13
|
+
* that someone with a key can exercise the real path — then woke up and took a
|
|
14
|
+
* real network path. MEASURED: the same 350 files that are green in a shell
|
|
15
|
+
* without those keys (349 passed, 99-133s, twice) produced 7 failed files with
|
|
16
|
+
* 25 x `Test timed out in 15000ms` when run with the release's environment
|
|
17
|
+
* (363s). Phase 1 therefore failed every release attempt on an environment
|
|
18
|
+
* difference that left no trace in its own output.
|
|
19
|
+
*
|
|
20
|
+
* The fix is deliberately at BOTH ends:
|
|
21
|
+
* - the SUITE strips these keys (`tests/setup/hermetic-env.ts`) so no test can
|
|
22
|
+
* reach a live provider or send a real message, no matter who starts it; and
|
|
23
|
+
* - the PIPELINE spawns the suite without them (`runTestsPhase`), because
|
|
24
|
+
* handing live credentials to a process whose job is to not use them is the
|
|
25
|
+
* pipeline's own bug.
|
|
26
|
+
* A test that genuinely needs a key sets one itself, as the credential tests
|
|
27
|
+
* already do.
|
|
28
|
+
*
|
|
29
|
+
* The release's OWN git/npm credentials are stripped from the suite as well, and
|
|
30
|
+
* the measurement is the reason. `IssueTriageAgent.detectSource` infers `github`
|
|
31
|
+
* from the presence of a GitHub token, so `should detect auto when no keyword
|
|
32
|
+
* matches` returned `github` and failed — under the release, which must hold
|
|
33
|
+
* `GITHUB_TOKEN` to push, that is EVERY release. A test that needs a token now
|
|
34
|
+
* provides its own: the credential tests already set and delete these in their
|
|
35
|
+
* `beforeEach` (see tests/agents/credential-store.test.ts), so nothing depends on
|
|
36
|
+
* inheriting them.
|
|
37
|
+
*/
|
|
38
|
+
import { PROVIDER_CATALOG } from '../inference/provider-catalog.js';
|
|
39
|
+
/** Provider keys that are not in the catalog (legacy or bespoke). */
|
|
40
|
+
const EXTRA_PROVIDER_ENV_KEYS = ['TOKENRA_API_KEY', 'AZURE_OPENAI_ENDPOINT'];
|
|
41
|
+
/**
|
|
42
|
+
* The release's own credentials. Not "side effects" in the same sense — they are
|
|
43
|
+
* how the release pushes and publishes — but a test process must not inherit
|
|
44
|
+
* them either: their mere PRESENCE changes behaviour (see the note above).
|
|
45
|
+
*/
|
|
46
|
+
const RELEASE_CREDENTIAL_ENV_KEYS = [
|
|
47
|
+
'GITHUB_TOKEN',
|
|
48
|
+
'GH_TOKEN',
|
|
49
|
+
'GITHUB_API_KEY',
|
|
50
|
+
'GIT_USERNAME',
|
|
51
|
+
'NPM_TOKEN',
|
|
52
|
+
];
|
|
53
|
+
/** Credentials that can cause an outward action: send a message, spend money. */
|
|
54
|
+
const SIDE_EFFECT_ENV_KEYS = [
|
|
55
|
+
'TWILIO_ACCOUNT_SID',
|
|
56
|
+
'TWILIO_AUTH_TOKEN',
|
|
57
|
+
'TWILIO_PHONE_NUMBER',
|
|
58
|
+
'SLACK_BOT_TOKEN',
|
|
59
|
+
'TELEGRAM_BOT_TOKEN',
|
|
60
|
+
'TELEGRAM_TOKEN',
|
|
61
|
+
'WHATSAPP_SELF_CHAT',
|
|
62
|
+
'AWS_ACCESS_KEY_ID',
|
|
63
|
+
'AWS_SECRET_ACCESS_KEY',
|
|
64
|
+
'AWS_SESSION_TOKEN',
|
|
65
|
+
'AWS_BEARER_TOKEN',
|
|
66
|
+
'BEDROCK_REGION',
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* Every provider API key the catalog knows about, derived rather than copied —
|
|
70
|
+
* a hardcoded list here would silently fall behind the providers being added.
|
|
71
|
+
*/
|
|
72
|
+
export const PROVIDER_CREDENTIAL_ENV_KEYS = [
|
|
73
|
+
...new Set([
|
|
74
|
+
...Object.values(PROVIDER_CATALOG)
|
|
75
|
+
.map((provider) => provider.envVar)
|
|
76
|
+
.filter((name) => Boolean(name)),
|
|
77
|
+
...EXTRA_PROVIDER_ENV_KEYS,
|
|
78
|
+
]),
|
|
79
|
+
].sort();
|
|
80
|
+
/** {@link SIDE_EFFECT_ENV_KEYS}, exported for the tests that pin the list. */
|
|
81
|
+
export const SIDE_EFFECT_CREDENTIAL_ENV_KEYS = [...SIDE_EFFECT_ENV_KEYS];
|
|
82
|
+
/**
|
|
83
|
+
* One base key plus the `NUVIRA_` / `BUFF_` spellings the resolvers accept:
|
|
84
|
+
* `TELEGRAM_TOKEN` is also read as `NUVIRA_TELEGRAM_TOKEN`, and a split pair
|
|
85
|
+
* (one spelling stripped, the other kept) would leave the live key reachable.
|
|
86
|
+
*/
|
|
87
|
+
function withPrefixedAliases(keys) {
|
|
88
|
+
const out = new Set();
|
|
89
|
+
for (const key of keys) {
|
|
90
|
+
out.add(key);
|
|
91
|
+
out.add(`NUVIRA_${key}`);
|
|
92
|
+
out.add(`BUFF_${key}`);
|
|
93
|
+
}
|
|
94
|
+
return [...out];
|
|
95
|
+
}
|
|
96
|
+
/** The keys {@link stripTestUnsafeEnv} removes, sorted. */
|
|
97
|
+
export const TEST_UNSAFE_ENV_KEYS = withPrefixedAliases([
|
|
98
|
+
...PROVIDER_CREDENTIAL_ENV_KEYS,
|
|
99
|
+
...SIDE_EFFECT_ENV_KEYS,
|
|
100
|
+
...RELEASE_CREDENTIAL_ENV_KEYS,
|
|
101
|
+
]).sort();
|
|
102
|
+
/**
|
|
103
|
+
* A COPY of `env` without the credentials above — for spawning a child (the
|
|
104
|
+
* release spawns the suite) without mutating this process's own environment.
|
|
105
|
+
*/
|
|
106
|
+
export function stripTestUnsafeEnv(env = process.env) {
|
|
107
|
+
const copy = { ...env };
|
|
108
|
+
for (const key of TEST_UNSAFE_ENV_KEYS)
|
|
109
|
+
delete copy[key];
|
|
110
|
+
return copy;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Remove the credentials above from `env` IN PLACE, returning the names that were
|
|
114
|
+
* actually present — so a suite can report what it closed rather than assuming.
|
|
115
|
+
*/
|
|
116
|
+
export function deleteTestUnsafeEnv(env = process.env) {
|
|
117
|
+
const removed = [];
|
|
118
|
+
for (const key of TEST_UNSAFE_ENV_KEYS) {
|
|
119
|
+
if (env[key] !== undefined) {
|
|
120
|
+
delete env[key];
|
|
121
|
+
removed.push(key);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return removed;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=live-credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-credentials.js","sourceRoot":"","sources":["../../src/config/live-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,qEAAqE;AACrE,MAAM,uBAAuB,GAAG,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,2BAA2B,GAAG;IAClC,cAAc;IACd,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,WAAW;CACZ,CAAC;AAEF,iFAAiF;AACjF,MAAM,oBAAoB,GAAG;IAC3B,oBAAoB;IACpB,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,oBAAoB;IACpB,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,mBAAmB;IACnB,kBAAkB;IAClB,gBAAgB;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAa;IACpD,GAAG,IAAI,GAAG,CAAC;QACT,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;aAC/B,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC;aAClC,MAAM,CAAC,CAAC,IAAI,EAAkB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClD,GAAG,uBAAuB;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CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/config/paths.d.ts
CHANGED
|
@@ -27,6 +27,24 @@ export declare function resolveNuviraHome(): string;
|
|
|
27
27
|
* persists (env, routing failures, audit logs, …) must resolve through here.
|
|
28
28
|
*/
|
|
29
29
|
export declare function resolveNuviraDataPath(...segments: string[]): string;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve the directory that holds MCP server configs.
|
|
32
|
+
*
|
|
33
|
+
* Precedence: an explicit directory, `$NUVIRA_MCP_DIR` / `$BUFF_MCP_DIR`, then
|
|
34
|
+
* `<config dir>/mcp` — so `$NUVIRA_CONFIG_DIR` isolates this too — then
|
|
35
|
+
* `~/.nuvira/mcp`.
|
|
36
|
+
*
|
|
37
|
+
* WHY THIS EXISTS. Both call sites used to be a bare
|
|
38
|
+
* `join(homedir(), '.nuvira', 'mcp')`, which is the reach the note on
|
|
39
|
+
* {@link resolveNuviraHome} warns about. The cost was measured rather than
|
|
40
|
+
* assumed: the orchestrator calls `discoverConfigs()` on every run, so the test
|
|
41
|
+
* suite found the developer's REAL `github` / `exa` / `firecrawl` configs and
|
|
42
|
+
* spawned those servers mid-run. That is outbound network traffic from a test
|
|
43
|
+
* process, MCP responses arriving for clients the test had already torn down
|
|
44
|
+
* (`Received a response for an unknown message ID`), and a fully mocked test
|
|
45
|
+
* timing out at 15s. A test run must not be able to reach a live MCP server.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveMcpConfigDir(explicitDir?: string): string;
|
|
30
48
|
/**
|
|
31
49
|
* Resolve the `.env` file that supplies provider credentials.
|
|
32
50
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/config/paths.ts"],"names":[],"mappings":"AAwBA,wBAAgB,sBAAsB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAOnE;AAED,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,+BAAyB,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C,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAExD"}
|
package/dist/config/paths.js
CHANGED
|
@@ -70,6 +70,31 @@ export function resolveNuviraHome() {
|
|
|
70
70
|
export function resolveNuviraDataPath(...segments) {
|
|
71
71
|
return join(resolveNuviraConfigDir(), ...segments);
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Resolve the directory that holds MCP server configs.
|
|
75
|
+
*
|
|
76
|
+
* Precedence: an explicit directory, `$NUVIRA_MCP_DIR` / `$BUFF_MCP_DIR`, then
|
|
77
|
+
* `<config dir>/mcp` — so `$NUVIRA_CONFIG_DIR` isolates this too — then
|
|
78
|
+
* `~/.nuvira/mcp`.
|
|
79
|
+
*
|
|
80
|
+
* WHY THIS EXISTS. Both call sites used to be a bare
|
|
81
|
+
* `join(homedir(), '.nuvira', 'mcp')`, which is the reach the note on
|
|
82
|
+
* {@link resolveNuviraHome} warns about. The cost was measured rather than
|
|
83
|
+
* assumed: the orchestrator calls `discoverConfigs()` on every run, so the test
|
|
84
|
+
* suite found the developer's REAL `github` / `exa` / `firecrawl` configs and
|
|
85
|
+
* spawned those servers mid-run. That is outbound network traffic from a test
|
|
86
|
+
* process, MCP responses arriving for clients the test had already torn down
|
|
87
|
+
* (`Received a response for an unknown message ID`), and a fully mocked test
|
|
88
|
+
* timing out at 15s. A test run must not be able to reach a live MCP server.
|
|
89
|
+
*/
|
|
90
|
+
export function resolveMcpConfigDir(explicitDir) {
|
|
91
|
+
if (explicitDir)
|
|
92
|
+
return explicitDir;
|
|
93
|
+
const override = envBuff('MCP_DIR');
|
|
94
|
+
if (override)
|
|
95
|
+
return override;
|
|
96
|
+
return join(resolveNuviraConfigDir(), 'mcp');
|
|
97
|
+
}
|
|
73
98
|
/**
|
|
74
99
|
* Resolve the `.env` file that supplies provider credentials.
|
|
75
100
|
*
|
package/dist/config/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sourceRoot":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;IACpC,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,IAAI,CAAC,sBAAsB,EAAE,EAAE,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAkB;IACrD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,EAAE,CAAC;IAC1F,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,OAAO,IAAI,CAAC,sBAAsB,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;AACtE,CAAC"}
|
|
@@ -58,7 +58,7 @@ export function createDefaultAgentCard(baseUrl, nodeName) {
|
|
|
58
58
|
url: baseUrl,
|
|
59
59
|
identity: {
|
|
60
60
|
organization: 'Agent-Nuvira',
|
|
61
|
-
documentationUrl: 'https://github.com/imdheerajKube/agent-nuvira',
|
|
61
|
+
documentationUrl: 'https://github.com/imdheerajKube/agent-nuvira-documentation',
|
|
62
62
|
},
|
|
63
63
|
capabilities: [
|
|
64
64
|
{ id: 'code-generation', name: 'Code Generation', description: 'Generate new source code files and projects' },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a2a-types.js","sourceRoot":"","sources":["../../src/federation/a2a-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,+EAA+E;AAE/E,qCAAqC;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,sCAAsC;AACtC,MAAM,CAAC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MAAM,EAAE,aAAa;SACtB;QACD,cAAc,EAAE;YACd,OAAO,EAAE,CAAC,MAAM,CAAC;SAClB;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwarded.d.ts","sourceRoot":"","sources":["../src/forwarded.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,EAAE,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forwarded.js","sourceRoot":"","sources":["../src/forwarded.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC"}
|
|
@@ -36,7 +36,12 @@ export declare function clearModelListCache(): void;
|
|
|
36
36
|
* @param provider The inference provider instance (for listModels()).
|
|
37
37
|
* @param providerType Provider id (e.g. 'gemini', 'groq') for curated defaults.
|
|
38
38
|
* @param desiredModel The model Auto routing resolved (may be stale/'default').
|
|
39
|
+
* @param announce Also print the repair here. DEFAULT `false`: every caller
|
|
40
|
+
* now goes through `resolveRoute()`, which owns the reporting (print + routing
|
|
41
|
+
* history + run trace). Announcing in both places produced TWO lines for one
|
|
42
|
+
* substitution, and in strict mode it announced a swap that then threw
|
|
43
|
+
* instead of happening — worse than silence.
|
|
39
44
|
* @returns A model id guaranteed (best-effort) to exist on the provider.
|
|
40
45
|
*/
|
|
41
|
-
export declare function resolveWorkingModel(provider: InferenceProvider, providerType: string, desiredModel?: string): Promise<string>;
|
|
46
|
+
export declare function resolveWorkingModel(provider: InferenceProvider, providerType: string, desiredModel?: string, announce?: boolean): Promise<string>;
|
|
42
47
|
//# sourceMappingURL=model-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-validator.d.ts","sourceRoot":"","sources":["../../src/inference/model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AAuBzE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAyCD
|
|
1
|
+
{"version":3,"file":"model-validator.d.ts","sourceRoot":"","sources":["../../src/inference/model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AAuBzE;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAyCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,iBAAiB,EAC3B,YAAY,EAAE,MAAM,EACpB,YAAY,CAAC,EAAE,MAAM,EACrB,QAAQ,UAAQ,GACf,OAAO,CAAC,MAAM,CAAC,CA+GjB"}
|
|
@@ -94,9 +94,14 @@ function modelFallbackScore(m) {
|
|
|
94
94
|
* @param provider The inference provider instance (for listModels()).
|
|
95
95
|
* @param providerType Provider id (e.g. 'gemini', 'groq') for curated defaults.
|
|
96
96
|
* @param desiredModel The model Auto routing resolved (may be stale/'default').
|
|
97
|
+
* @param announce Also print the repair here. DEFAULT `false`: every caller
|
|
98
|
+
* now goes through `resolveRoute()`, which owns the reporting (print + routing
|
|
99
|
+
* history + run trace). Announcing in both places produced TWO lines for one
|
|
100
|
+
* substitution, and in strict mode it announced a swap that then threw
|
|
101
|
+
* instead of happening — worse than silence.
|
|
97
102
|
* @returns A model id guaranteed (best-effort) to exist on the provider.
|
|
98
103
|
*/
|
|
99
|
-
export async function resolveWorkingModel(provider, providerType, desiredModel) {
|
|
104
|
+
export async function resolveWorkingModel(provider, providerType, desiredModel, announce = false) {
|
|
100
105
|
const explicit = desiredModel && desiredModel !== 'default' ? desiredModel : undefined;
|
|
101
106
|
// ── 0. FAST PATH — the Model Availability Registry (sub-ms, no network) ─
|
|
102
107
|
// When the registry has already verified this model works (via a prior
|
|
@@ -184,7 +189,7 @@ export async function resolveWorkingModel(provider, providerType, desiredModel)
|
|
|
184
189
|
return !!m && modelFallbackScore(m) < 100 && !registryBlocks(id);
|
|
185
190
|
});
|
|
186
191
|
if (chosen) {
|
|
187
|
-
if (explicit) {
|
|
192
|
+
if (explicit && announce) {
|
|
188
193
|
const fromVerified = preferredModelsFor(providerType).includes(chosen);
|
|
189
194
|
logger.warn(`♻️ Auto routing: model '${explicit}' is not available on '${providerType}' — using '${chosen}'${fromVerified ? ' (verified working)' : ''}.`);
|
|
190
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-validator.js","sourceRoot":"","sources":["../../src/inference/model-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,8EAA8E;AAC9E,6EAA6E;AAC7E,4DAA4D;AAC5D,yEAAyE;AACzE,mEAAmE;AACnE,iDAAiD;AAEjD,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,6EAA6E;AAC7E,8EAA8E;AAC9E,mBAAmB;AACnB,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACjC,MAAM,cAAc,GAAG,IAAI,GAAG,EAA4D,CAAC;AAE3F;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB;IACjC,cAAc,CAAC,KAAK,EAAE,CAAC;AACzB,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAA2B,EAAE,YAAqB;IAC/E,MAAM,GAAG,GAAG,YAAY,IAAI,QAAQ,CAAC,IAAI,CAAC;IAC1C,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACvC,IAAI,MAAM,IAAI,IAAI,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AE;YACnC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YAC1C,OAAO,CAAC,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QACH,IAAI,MAAM,EAAE,CAAC;YACX,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;gBACzB,MAAM,YAAY,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;gBACvE,MAAM,CAAC,IAAI,CACT,4BAA4B,QAAQ,0BAA0B,YAAY,cAAc,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,EAAE,GAAG,CAC/I,CAAC;YACJ,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IAED,yEAAyE;IACzE,wEAAwE;IACxE,0EAA0E;IAC1E,4EAA4E;IAC5E,qEAAqE;IACrE,2EAA2E;IAC3E,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC9B,MAAM,cAAc,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,cAAc,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO,cAAc,CAAC;IAC1E,OAAO,QAAQ,IAAI,SAAS,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route resolution — the ONE place a provider and its model are validated as a
|
|
3
|
+
* PAIR, against the very adapter that will serve the call.
|
|
4
|
+
*
|
|
5
|
+
* WHY THIS EXISTS (issue #9). A live release run failed its first model call
|
|
6
|
+
* with `Groq API error (404): The model 'gemini-3.1-flash-lite' does not exist`
|
|
7
|
+
* — a Gemini id sent to Groq, on a machine whose `nuviraconfig.json` pins
|
|
8
|
+
* `providers.groq.model = openai/gpt-oss-120b` and `providers.gemini.model =
|
|
9
|
+
* gemini-flash-latest`. Neither pin was stale, so the foreign id came from a
|
|
10
|
+
* RESOLUTION: provider and model were decided in different places (provider
|
|
11
|
+
* ranking, the auto-router's per-task decision, and a site-local
|
|
12
|
+
* `config.model || inferenceOptions?.model` fallback), and nothing checked that
|
|
13
|
+
* the three agreed.
|
|
14
|
+
*
|
|
15
|
+
* The same class had already been found twice and patched at one call site each
|
|
16
|
+
* time — chat's failover path (`src/cli/chat.ts`) and catalog-provider
|
|
17
|
+
* substitution (`src/cli/router.ts`) — which is why `publish` still walked into
|
|
18
|
+
* it: the fix never reached a SHARED path. This module is that shared path.
|
|
19
|
+
*
|
|
20
|
+
* INVARIANTS
|
|
21
|
+
* 1. The model is validated against `provider` — the instance the caller is
|
|
22
|
+
* about to call — never against a provider looked up separately.
|
|
23
|
+
* 2. A substitution is NEVER silent: it is printed, and it is recorded (the
|
|
24
|
+
* routing history the dashboard reads, plus the active run trace when one
|
|
25
|
+
* exists). A broken pair that looks healthy is worse than no report at all.
|
|
26
|
+
* 3. `strict` (or `NUVIRA_STRICT_MODEL=1`) refuses to substitute at all, so a
|
|
27
|
+
* pinned model that is dead fails with a sentence naming the pair instead of
|
|
28
|
+
* quietly running on a different model.
|
|
29
|
+
*
|
|
30
|
+
* It is deliberately thin: `resolveWorkingModel()` already owns the repair
|
|
31
|
+
* policy (registry fast path → live list → catalog default) and is the only
|
|
32
|
+
* place a model list is fetched. This wrapper adds the PAIR guarantee, the
|
|
33
|
+
* audit, and the reporting — it must never grow a second repair policy.
|
|
34
|
+
*/
|
|
35
|
+
import type { InferenceProvider } from './interface.js';
|
|
36
|
+
/** Who is asking — used only for the audit record's wording. */
|
|
37
|
+
export type RouteSource = 'orchestrator' | 'chat' | 'publish' | 'failover' | 'cli' | (string & {});
|
|
38
|
+
export interface RouteRequest {
|
|
39
|
+
/** Provider id (`groq`, `gemini`, …) — must describe `provider`. */
|
|
40
|
+
providerType: string;
|
|
41
|
+
/** The adapter that will serve the call. The model is validated against THIS. */
|
|
42
|
+
provider: InferenceProvider;
|
|
43
|
+
/** Requested model. `undefined` or `'default'` means "let the provider decide". */
|
|
44
|
+
model?: string;
|
|
45
|
+
source?: RouteSource;
|
|
46
|
+
agentType?: string;
|
|
47
|
+
task?: string;
|
|
48
|
+
/** Refuse to substitute; throw instead. Defaults to `NUVIRA_STRICT_MODEL=1`. */
|
|
49
|
+
strict?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface ResolvedRoute {
|
|
52
|
+
providerType: string;
|
|
53
|
+
provider: InferenceProvider;
|
|
54
|
+
/** The model to send. Always a real model id when one could be resolved. */
|
|
55
|
+
model: string;
|
|
56
|
+
/** What was asked for, when anything was. */
|
|
57
|
+
requested?: string;
|
|
58
|
+
/** True when `model` differs from `requested`. */
|
|
59
|
+
substituted: boolean;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The same fact WITHOUT the adapter — the shape that can be fed to a model (see
|
|
63
|
+
* `src/tools/loop-route-feed.ts`). A provider instance is not serializable and
|
|
64
|
+
* must never leak into prompt text.
|
|
65
|
+
*/
|
|
66
|
+
export interface ServedRoute {
|
|
67
|
+
providerType: string;
|
|
68
|
+
/** The adapter's own display name (`Groq`, `Local (llama.cpp)`). */
|
|
69
|
+
providerName?: string;
|
|
70
|
+
model: string;
|
|
71
|
+
requested?: string;
|
|
72
|
+
substituted?: boolean;
|
|
73
|
+
/** Earlier serving pairs this turn, oldest first — a failover history. */
|
|
74
|
+
previous?: string[];
|
|
75
|
+
}
|
|
76
|
+
/** Strip a {@link ResolvedRoute} down to the feedable fact. */
|
|
77
|
+
export declare function servedRouteFrom(route: ResolvedRoute): ServedRoute;
|
|
78
|
+
/**
|
|
79
|
+
* Strict model mode — a dead pin FAILS instead of being substituted.
|
|
80
|
+
*
|
|
81
|
+
* Off by default: a release or a long agent run must not stop dead because one
|
|
82
|
+
* provider retired a model. On for a caller who would rather know than proceed
|
|
83
|
+
* (`NUVIRA_STRICT_MODEL=1`), because "it ran on something else" is exactly the
|
|
84
|
+
* outcome that is invisible until much later.
|
|
85
|
+
*/
|
|
86
|
+
export declare function strictModelMode(): boolean;
|
|
87
|
+
/** Test hook: forget what has already been announced. */
|
|
88
|
+
export declare function resetSubstitutionReporting(): void;
|
|
89
|
+
/** One line naming the pair that was substituted, for the console and the trace. */
|
|
90
|
+
export declare function substitutionLine(input: {
|
|
91
|
+
providerType: string;
|
|
92
|
+
requested: string;
|
|
93
|
+
served: string;
|
|
94
|
+
}): string;
|
|
95
|
+
/**
|
|
96
|
+
* Report a substitution: print it, audit it, and attach it to the active run
|
|
97
|
+
* trace when there is one. Best-effort throughout — reporting must never break
|
|
98
|
+
* the call it is reporting on.
|
|
99
|
+
*/
|
|
100
|
+
export declare function reportSubstitution(input: {
|
|
101
|
+
providerType: string;
|
|
102
|
+
requested: string;
|
|
103
|
+
served: string;
|
|
104
|
+
source?: RouteSource;
|
|
105
|
+
agentType?: string;
|
|
106
|
+
task?: string;
|
|
107
|
+
}): void;
|
|
108
|
+
/**
|
|
109
|
+
* Resolve `{providerType, provider, model}` as ONE validated pair.
|
|
110
|
+
*
|
|
111
|
+
* Never throws for a missing/unreachable model (it resolves one); it throws ONLY
|
|
112
|
+
* when strict mode is on and a requested model could not be honoured, which is
|
|
113
|
+
* the one case where proceeding would be a lie about what ran.
|
|
114
|
+
*/
|
|
115
|
+
export declare function resolveRoute(request: RouteRequest): Promise<ResolvedRoute>;
|
|
116
|
+
//# sourceMappingURL=route-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-resolver.d.ts","sourceRoot":"","sources":["../../src/inference/route-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAOxD,gEAAgE;AAChE,MAAM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