scoutline 0.1.0 → 0.2.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/README.md +170 -5
- package/bin/scoutline.js +36 -15
- package/dist/capabilities/diagnostics.d.ts +97 -0
- package/dist/capabilities/diagnostics.d.ts.map +1 -0
- package/dist/capabilities/diagnostics.js +88 -0
- package/dist/capabilities/diagnostics.js.map +1 -0
- package/dist/capabilities/quota.d.ts +99 -0
- package/dist/capabilities/quota.d.ts.map +1 -0
- package/dist/capabilities/quota.js +129 -0
- package/dist/capabilities/quota.js.map +1 -0
- package/dist/capabilities/search.d.ts +110 -0
- package/dist/capabilities/search.d.ts.map +1 -0
- package/dist/capabilities/search.js +21 -0
- package/dist/capabilities/search.js.map +1 -0
- package/dist/capabilities/vision.d.ts +156 -0
- package/dist/capabilities/vision.d.ts.map +1 -0
- package/dist/capabilities/vision.js +111 -0
- package/dist/capabilities/vision.js.map +1 -0
- package/dist/command-invocation.d.ts +58 -0
- package/dist/command-invocation.d.ts.map +1 -0
- package/dist/command-invocation.js +95 -0
- package/dist/command-invocation.js.map +1 -0
- package/dist/commands/code.d.ts +11 -4
- package/dist/commands/code.d.ts.map +1 -1
- package/dist/commands/code.js +16 -42
- package/dist/commands/code.js.map +1 -1
- package/dist/commands/doctor.d.ts +58 -3
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +154 -52
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/quota.d.ts +45 -3
- package/dist/commands/quota.d.ts.map +1 -1
- package/dist/commands/quota.js +116 -60
- package/dist/commands/quota.js.map +1 -1
- package/dist/commands/read.d.ts +15 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +53 -54
- package/dist/commands/read.js.map +1 -1
- package/dist/commands/repo.d.ts +8 -3
- package/dist/commands/repo.d.ts.map +1 -1
- package/dist/commands/repo.js +40 -78
- package/dist/commands/repo.js.map +1 -1
- package/dist/commands/search.d.ts +27 -2
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +95 -103
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/tools.d.ts +9 -3
- package/dist/commands/tools.d.ts.map +1 -1
- package/dist/commands/tools.js +29 -59
- package/dist/commands/tools.js.map +1 -1
- package/dist/commands/vision.d.ts +35 -9
- package/dist/commands/vision.d.ts.map +1 -1
- package/dist/commands/vision.js +184 -131
- package/dist/commands/vision.js.map +1 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +389 -207
- package/dist/index.js.map +1 -1
- package/dist/lib/cache.d.ts +61 -0
- package/dist/lib/cache.d.ts.map +1 -1
- package/dist/lib/cache.js +74 -11
- package/dist/lib/cache.js.map +1 -1
- package/dist/lib/code-mode.d.ts +13 -0
- package/dist/lib/code-mode.d.ts.map +1 -1
- package/dist/lib/code-mode.js +26 -6
- package/dist/lib/code-mode.js.map +1 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +15 -18
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +65 -10
- package/dist/lib/errors.d.ts.map +1 -1
- package/dist/lib/errors.js +135 -19
- package/dist/lib/errors.js.map +1 -1
- package/dist/lib/execution.d.ts +76 -0
- package/dist/lib/execution.d.ts.map +1 -0
- package/dist/lib/execution.js +177 -0
- package/dist/lib/execution.js.map +1 -0
- package/dist/lib/index.d.ts +10 -2
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +10 -2
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/mcp-client.d.ts +46 -11
- package/dist/lib/mcp-client.d.ts.map +1 -1
- package/dist/lib/mcp-client.js +92 -27
- package/dist/lib/mcp-client.js.map +1 -1
- package/dist/lib/mcp-config.d.ts +17 -0
- package/dist/lib/mcp-config.d.ts.map +1 -1
- package/dist/lib/mcp-config.js +29 -0
- package/dist/lib/mcp-config.js.map +1 -1
- package/dist/lib/monitor-client.d.ts +17 -3
- package/dist/lib/monitor-client.d.ts.map +1 -1
- package/dist/lib/monitor-client.js +23 -69
- package/dist/lib/monitor-client.js.map +1 -1
- package/dist/lib/output.d.ts +53 -7
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +126 -39
- package/dist/lib/output.js.map +1 -1
- package/dist/lib/redact.d.ts +62 -3
- package/dist/lib/redact.d.ts.map +1 -1
- package/dist/lib/redact.js +165 -31
- package/dist/lib/redact.js.map +1 -1
- package/dist/lib/tty.d.ts +7 -20
- package/dist/lib/tty.d.ts.map +1 -1
- package/dist/lib/tty.js +51 -30
- package/dist/lib/tty.js.map +1 -1
- package/dist/node-command-invocation-adapter.d.ts +28 -0
- package/dist/node-command-invocation-adapter.d.ts.map +1 -0
- package/dist/node-command-invocation-adapter.js +88 -0
- package/dist/node-command-invocation-adapter.js.map +1 -0
- package/dist/providers/minimax/adapter.d.ts +47 -0
- package/dist/providers/minimax/adapter.d.ts.map +1 -0
- package/dist/providers/minimax/adapter.js +443 -0
- package/dist/providers/minimax/adapter.js.map +1 -0
- package/dist/providers/minimax/config.d.ts +32 -0
- package/dist/providers/minimax/config.d.ts.map +1 -0
- package/dist/providers/minimax/config.js +84 -0
- package/dist/providers/minimax/config.js.map +1 -0
- package/dist/providers/minimax/media.d.ts +34 -0
- package/dist/providers/minimax/media.d.ts.map +1 -0
- package/dist/providers/minimax/media.js +92 -0
- package/dist/providers/minimax/media.js.map +1 -0
- package/dist/providers/minimax/quota-client.d.ts +37 -0
- package/dist/providers/minimax/quota-client.d.ts.map +1 -0
- package/dist/providers/minimax/quota-client.js +78 -0
- package/dist/providers/minimax/quota-client.js.map +1 -0
- package/dist/providers/minimax/quota.d.ts +48 -0
- package/dist/providers/minimax/quota.d.ts.map +1 -0
- package/dist/providers/minimax/quota.js +120 -0
- package/dist/providers/minimax/quota.js.map +1 -0
- package/dist/providers/minimax/sdk-client.d.ts +29 -0
- package/dist/providers/minimax/sdk-client.d.ts.map +1 -0
- package/dist/providers/minimax/sdk-client.js +50 -0
- package/dist/providers/minimax/sdk-client.js.map +1 -0
- package/dist/providers/minimax/vision-attestations.d.ts +29 -0
- package/dist/providers/minimax/vision-attestations.d.ts.map +1 -0
- package/dist/providers/minimax/vision-attestations.js +54 -0
- package/dist/providers/minimax/vision-attestations.js.map +1 -0
- package/dist/providers/minimax/vision-conformance.d.ts +184 -0
- package/dist/providers/minimax/vision-conformance.d.ts.map +1 -0
- package/dist/providers/minimax/vision-conformance.js +369 -0
- package/dist/providers/minimax/vision-conformance.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/chart.d.ts +35 -0
- package/dist/providers/minimax/vision-mappings/chart.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/chart.js +55 -0
- package/dist/providers/minimax/vision-mappings/chart.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/common.d.ts +60 -0
- package/dist/providers/minimax/vision-mappings/common.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/common.js +75 -0
- package/dist/providers/minimax/vision-mappings/common.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/diagnose-error.d.ts +35 -0
- package/dist/providers/minimax/vision-mappings/diagnose-error.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/diagnose-error.js +55 -0
- package/dist/providers/minimax/vision-mappings/diagnose-error.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/diagram.d.ts +35 -0
- package/dist/providers/minimax/vision-mappings/diagram.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/diagram.js +55 -0
- package/dist/providers/minimax/vision-mappings/diagram.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/extract-text.d.ts +35 -0
- package/dist/providers/minimax/vision-mappings/extract-text.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/extract-text.js +55 -0
- package/dist/providers/minimax/vision-mappings/extract-text.js.map +1 -0
- package/dist/providers/minimax/vision-mappings/ui-artifact.d.ts +35 -0
- package/dist/providers/minimax/vision-mappings/ui-artifact.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings/ui-artifact.js +69 -0
- package/dist/providers/minimax/vision-mappings/ui-artifact.js.map +1 -0
- package/dist/providers/minimax/vision-mappings.generated.d.ts +29 -0
- package/dist/providers/minimax/vision-mappings.generated.d.ts.map +1 -0
- package/dist/providers/minimax/vision-mappings.generated.js +29 -0
- package/dist/providers/minimax/vision-mappings.generated.js.map +1 -0
- package/dist/providers/minimax/vision-revisions.d.ts +22 -0
- package/dist/providers/minimax/vision-revisions.d.ts.map +1 -0
- package/dist/providers/minimax/vision-revisions.js +27 -0
- package/dist/providers/minimax/vision-revisions.js.map +1 -0
- package/dist/providers/registry.d.ts +36 -0
- package/dist/providers/registry.d.ts.map +1 -0
- package/dist/providers/registry.js +45 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/selection.d.ts +44 -0
- package/dist/providers/selection.d.ts.map +1 -0
- package/dist/providers/selection.js +85 -0
- package/dist/providers/selection.js.map +1 -0
- package/dist/providers/types.d.ts +247 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +127 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/providers/zai/adapter.d.ts +35 -0
- package/dist/providers/zai/adapter.d.ts.map +1 -0
- package/dist/providers/zai/adapter.js +619 -0
- package/dist/providers/zai/adapter.js.map +1 -0
- package/dist/providers/zai/credentials.d.ts +38 -0
- package/dist/providers/zai/credentials.d.ts.map +1 -0
- package/dist/providers/zai/credentials.js +60 -0
- package/dist/providers/zai/credentials.js.map +1 -0
- package/dist/providers/zai/media.d.ts +38 -0
- package/dist/providers/zai/media.d.ts.map +1 -0
- package/dist/providers/zai/media.js +107 -0
- package/dist/providers/zai/media.js.map +1 -0
- package/dist/providers/zai/monitor-client.d.ts +53 -0
- package/dist/providers/zai/monitor-client.d.ts.map +1 -0
- package/dist/providers/zai/monitor-client.js +117 -0
- package/dist/providers/zai/monitor-client.js.map +1 -0
- package/dist/providers/zai/quota.d.ts +47 -0
- package/dist/providers/zai/quota.d.ts.map +1 -0
- package/dist/providers/zai/quota.js +127 -0
- package/dist/providers/zai/quota.js.map +1 -0
- package/package.json +10 -5
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Regenerate with: `node scripts/generate-minimax-vision-revisions.mjs`.
|
|
5
|
+
* The prebuild step in `packages/scoutline/package.json` runs the
|
|
6
|
+
* generator before `tsc`, so this file is always fresh when the
|
|
7
|
+
* TypeScript compiler runs.
|
|
8
|
+
*
|
|
9
|
+
* Each value is a SHA-256 digest covering the Implementation ID
|
|
10
|
+
* (`mmx-cli-sdk@1.0.16`), the stable common mapping runtime
|
|
11
|
+
* (`vision-mappings/common.ts`), only that operation's mapping Module
|
|
12
|
+
* under `vision-mappings/`, the fixture image bytes, the canonical
|
|
13
|
+
* request fields, and the exact required assertion IDs. Adding another
|
|
14
|
+
* operation does not change an existing operation's revision; changing
|
|
15
|
+
* the common runtime intentionally changes every revision.
|
|
16
|
+
*
|
|
17
|
+
* Operations without a mapping Module carry the placeholder
|
|
18
|
+
* `"pending-no-mapping-module"` until P5-03 creates their Module.
|
|
19
|
+
*/
|
|
20
|
+
import type { SpecializedVisionOperation } from "./vision-conformance.js";
|
|
21
|
+
export declare const MINIMAX_VISION_MAPPING_REVISIONS: Readonly<Record<SpecializedVisionOperation, string>>;
|
|
22
|
+
//# sourceMappingURL=vision-revisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-revisions.d.ts","sourceRoot":"","sources":["../../../src/providers/minimax/vision-revisions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAE1E,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CACrD,MAAM,CAAC,0BAA0B,EAAE,MAAM,CAAC,CAO1C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED FILE — DO NOT EDIT BY HAND.
|
|
3
|
+
*
|
|
4
|
+
* Regenerate with: `node scripts/generate-minimax-vision-revisions.mjs`.
|
|
5
|
+
* The prebuild step in `packages/scoutline/package.json` runs the
|
|
6
|
+
* generator before `tsc`, so this file is always fresh when the
|
|
7
|
+
* TypeScript compiler runs.
|
|
8
|
+
*
|
|
9
|
+
* Each value is a SHA-256 digest covering the Implementation ID
|
|
10
|
+
* (`mmx-cli-sdk@1.0.16`), the stable common mapping runtime
|
|
11
|
+
* (`vision-mappings/common.ts`), only that operation's mapping Module
|
|
12
|
+
* under `vision-mappings/`, the fixture image bytes, the canonical
|
|
13
|
+
* request fields, and the exact required assertion IDs. Adding another
|
|
14
|
+
* operation does not change an existing operation's revision; changing
|
|
15
|
+
* the common runtime intentionally changes every revision.
|
|
16
|
+
*
|
|
17
|
+
* Operations without a mapping Module carry the placeholder
|
|
18
|
+
* `"pending-no-mapping-module"` until P5-03 creates their Module.
|
|
19
|
+
*/
|
|
20
|
+
export const MINIMAX_VISION_MAPPING_REVISIONS = Object.freeze({
|
|
21
|
+
"ui-artifact": "f359d5cda2f0f6fc7b8b1308a8842ede7a09b8c5517c46e205a46881afeb5290",
|
|
22
|
+
"extract-text": "78758cfc03e282c2609eb4e05fab392be62d9b6d38c8911bf245f74206ccbf0e",
|
|
23
|
+
"diagnose-error": "f83d602a6177041d131cb05b4164e0529b04154a5651e042cea66f566d94d893",
|
|
24
|
+
"diagram": "0828b3e3c60a1f207dcd8ce4f83cf4855fef45f24436870b53a380065487e5d5",
|
|
25
|
+
"chart": "b930eac3e997e20c481abbaff4e756dced7a82a085bba770ec57ea34690c2259",
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=vision-revisions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-revisions.js","sourceRoot":"","sources":["../../../src/providers/minimax/vision-revisions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,MAAM,CAAC,MAAM,gCAAgC,GAEzC,MAAM,CAAC,MAAM,CAAC;IAChB,aAAa,EAAE,kEAAkE;IACjF,cAAc,EAAE,kEAAkE;IAClF,gBAAgB,EAAE,kEAAkE;IACpF,SAAS,EAAE,kEAAkE;IAC7E,OAAO,EAAE,kEAAkE;CAC5E,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static Provider Registry (DESIGN.md §5, P2-05).
|
|
3
|
+
*
|
|
4
|
+
* The production registry is a static list of the two real Search
|
|
5
|
+
* Provider Descriptors, in the fixed order [zai, minimax]. It performs
|
|
6
|
+
* NO dynamic imports, accepts no package names, file paths, or
|
|
7
|
+
* externally supplied factories. Tests inject descriptor lists through
|
|
8
|
+
* the explicit optional parameters of {@link getProviderDescriptor} and
|
|
9
|
+
* {@link getConfiguredProviderDescriptors}; production uses the static
|
|
10
|
+
* built-in list by default.
|
|
11
|
+
*
|
|
12
|
+
* Boundary rules (ARCHITECTURE.md §2):
|
|
13
|
+
* - Imports the real Adapter Modules (`providers/zai/adapter.js`,
|
|
14
|
+
* `providers/minimax/adapter.js`), NOT the P2-01 stubs in `types.ts`.
|
|
15
|
+
* - Must NOT import command Modules, shared execution, or transport.
|
|
16
|
+
*/
|
|
17
|
+
import type { ProviderDescriptor, ProviderId } from "./types.js";
|
|
18
|
+
/**
|
|
19
|
+
* Built-in Provider Descriptors in canonical order. Each Descriptor is
|
|
20
|
+
* constructed once at module load with its production (no-argument)
|
|
21
|
+
* factory; the Adapters bind their real transports lazily, only inside
|
|
22
|
+
* Capability invocation.
|
|
23
|
+
*/
|
|
24
|
+
export declare const BUILT_IN_PROVIDER_DESCRIPTORS: readonly ProviderDescriptor[];
|
|
25
|
+
/**
|
|
26
|
+
* Look up a built-in Descriptor by ID. The optional `descriptors`
|
|
27
|
+
* parameter lets tests inject doubles; production defaults to the
|
|
28
|
+
* static built-in list.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getProviderDescriptor(id: ProviderId, descriptors?: readonly ProviderDescriptor[]): ProviderDescriptor;
|
|
31
|
+
/**
|
|
32
|
+
* Return the built-in Descriptors that are configured for the given
|
|
33
|
+
* environment. Pure metadata; no Adapter is constructed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getConfiguredProviderDescriptors(env: NodeJS.ProcessEnv, descriptors?: readonly ProviderDescriptor[]): readonly ProviderDescriptor[];
|
|
36
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/providers/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAMjE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,kBAAkB,EAGtE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,UAAU,EACd,WAAW,GAAE,SAAS,kBAAkB,EAAkC,GACzE,kBAAkB,CAEpB;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,WAAW,GAAE,SAAS,kBAAkB,EAAkC,GACzE,SAAS,kBAAkB,EAAE,CAE/B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Static Provider Registry (DESIGN.md §5, P2-05).
|
|
3
|
+
*
|
|
4
|
+
* The production registry is a static list of the two real Search
|
|
5
|
+
* Provider Descriptors, in the fixed order [zai, minimax]. It performs
|
|
6
|
+
* NO dynamic imports, accepts no package names, file paths, or
|
|
7
|
+
* externally supplied factories. Tests inject descriptor lists through
|
|
8
|
+
* the explicit optional parameters of {@link getProviderDescriptor} and
|
|
9
|
+
* {@link getConfiguredProviderDescriptors}; production uses the static
|
|
10
|
+
* built-in list by default.
|
|
11
|
+
*
|
|
12
|
+
* Boundary rules (ARCHITECTURE.md §2):
|
|
13
|
+
* - Imports the real Adapter Modules (`providers/zai/adapter.js`,
|
|
14
|
+
* `providers/minimax/adapter.js`), NOT the P2-01 stubs in `types.ts`.
|
|
15
|
+
* - Must NOT import command Modules, shared execution, or transport.
|
|
16
|
+
*/
|
|
17
|
+
import { createZaiDescriptor } from "./zai/adapter.js";
|
|
18
|
+
import { createMiniMaxDescriptor } from "./minimax/adapter.js";
|
|
19
|
+
import { getProviderDescriptor as lookupProviderDescriptor, getConfiguredProviderDescriptors as lookupConfigured, } from "./types.js";
|
|
20
|
+
/**
|
|
21
|
+
* Built-in Provider Descriptors in canonical order. Each Descriptor is
|
|
22
|
+
* constructed once at module load with its production (no-argument)
|
|
23
|
+
* factory; the Adapters bind their real transports lazily, only inside
|
|
24
|
+
* Capability invocation.
|
|
25
|
+
*/
|
|
26
|
+
export const BUILT_IN_PROVIDER_DESCRIPTORS = [
|
|
27
|
+
createZaiDescriptor(),
|
|
28
|
+
createMiniMaxDescriptor(),
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Look up a built-in Descriptor by ID. The optional `descriptors`
|
|
32
|
+
* parameter lets tests inject doubles; production defaults to the
|
|
33
|
+
* static built-in list.
|
|
34
|
+
*/
|
|
35
|
+
export function getProviderDescriptor(id, descriptors = BUILT_IN_PROVIDER_DESCRIPTORS) {
|
|
36
|
+
return lookupProviderDescriptor(id, descriptors);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Return the built-in Descriptors that are configured for the given
|
|
40
|
+
* environment. Pure metadata; no Adapter is constructed.
|
|
41
|
+
*/
|
|
42
|
+
export function getConfiguredProviderDescriptors(env, descriptors = BUILT_IN_PROVIDER_DESCRIPTORS) {
|
|
43
|
+
return lookupConfigured(env, descriptors);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/providers/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EACL,qBAAqB,IAAI,wBAAwB,EACjD,gCAAgC,IAAI,gBAAgB,GACrD,MAAM,YAAY,CAAC;AAEpB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAkC;IAC1E,mBAAmB,EAAE;IACrB,uBAAuB,EAAE;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,EAAc,EACd,WAAW,GAAkC,6BAA6B;IAE1E,OAAO,wBAAwB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gCAAgC,CAC9C,GAAsB,EACtB,WAAW,GAAkC,6BAA6B;IAE1E,OAAO,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Selection (DESIGN.md §6, PRD FR-001 through FR-005).
|
|
3
|
+
*
|
|
4
|
+
* Pure resolution of a Provider ID from explicit and environment input.
|
|
5
|
+
* No credentials participate; no Adapter is constructed.
|
|
6
|
+
*
|
|
7
|
+
* Precedence:
|
|
8
|
+
* 1. explicit option (trimmed, lowercased)
|
|
9
|
+
* 2. SCOUTLINE_PROVIDER environment variable (trimmed, lowercased)
|
|
10
|
+
* 3. compatibility default `zai`
|
|
11
|
+
*
|
|
12
|
+
* An explicitly empty Provider is present and invalid; it must NOT fall
|
|
13
|
+
* through to the environment or default. Unknown values are invalid in
|
|
14
|
+
* both explicit and environment positions.
|
|
15
|
+
*
|
|
16
|
+
* Only Search, Vision, quota, and diagnostics call this module.
|
|
17
|
+
* Z.AI-only command families (Reader, repository exploration, raw
|
|
18
|
+
* tools, Code Mode) remove the global flag during parsing and never
|
|
19
|
+
* resolve or validate it.
|
|
20
|
+
*/
|
|
21
|
+
import type { ProviderId } from "./types.js";
|
|
22
|
+
export { getProviderDescriptor, getConfiguredProviderDescriptors } from "./types.js";
|
|
23
|
+
/**
|
|
24
|
+
* Parse and validate a Provider ID. Trims and lowercases the input.
|
|
25
|
+
* Empty and unknown values throw `ValidationError` whose `help` lists
|
|
26
|
+
* the accepted IDs.
|
|
27
|
+
*/
|
|
28
|
+
export declare function parseProviderId(value: string): ProviderId;
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the effective Provider ID with explicit precedence over
|
|
31
|
+
* environment over the compatibility default. An explicitly empty
|
|
32
|
+
* value (including whitespace) is treated as present and invalid; it
|
|
33
|
+
* throws `ValidationError` before consulting the environment.
|
|
34
|
+
*
|
|
35
|
+
* `env` defaults to `process.env` for production callers; tests pass
|
|
36
|
+
* an explicit object so they do not touch process globals.
|
|
37
|
+
*
|
|
38
|
+
* FR-003: provider selection is NEVER inferred from available
|
|
39
|
+
* credentials. The default branch always returns `"zai"`; whether the
|
|
40
|
+
* effective Provider is configured is a question for the caller (which
|
|
41
|
+
* throws `ConfigurationError`, exit 3), not for selection.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveProviderId(explicitProvider: string | undefined, env?: NodeJS.ProcessEnv): ProviderId;
|
|
44
|
+
//# sourceMappingURL=selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../../src/providers/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAM7C,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAiBrF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAezD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,UAAU,CAkBZ"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Selection (DESIGN.md §6, PRD FR-001 through FR-005).
|
|
3
|
+
*
|
|
4
|
+
* Pure resolution of a Provider ID from explicit and environment input.
|
|
5
|
+
* No credentials participate; no Adapter is constructed.
|
|
6
|
+
*
|
|
7
|
+
* Precedence:
|
|
8
|
+
* 1. explicit option (trimmed, lowercased)
|
|
9
|
+
* 2. SCOUTLINE_PROVIDER environment variable (trimmed, lowercased)
|
|
10
|
+
* 3. compatibility default `zai`
|
|
11
|
+
*
|
|
12
|
+
* An explicitly empty Provider is present and invalid; it must NOT fall
|
|
13
|
+
* through to the environment or default. Unknown values are invalid in
|
|
14
|
+
* both explicit and environment positions.
|
|
15
|
+
*
|
|
16
|
+
* Only Search, Vision, quota, and diagnostics call this module.
|
|
17
|
+
* Z.AI-only command families (Reader, repository exploration, raw
|
|
18
|
+
* tools, Code Mode) remove the global flag during parsing and never
|
|
19
|
+
* resolve or validate it.
|
|
20
|
+
*/
|
|
21
|
+
import { PROVIDER_IDS } from "./types.js";
|
|
22
|
+
import { ValidationError } from "../lib/errors.js";
|
|
23
|
+
// Re-export descriptor helpers at the selection boundary so command
|
|
24
|
+
// Modules need only a single import.
|
|
25
|
+
export { getProviderDescriptor, getConfiguredProviderDescriptors } from "./types.js";
|
|
26
|
+
/**
|
|
27
|
+
* Accepted Provider IDs shown in the help message when validation fails.
|
|
28
|
+
*/
|
|
29
|
+
const ACCEPTED_IDS_HELP = `Accepted provider IDs: ${PROVIDER_IDS.join(", ")}.`;
|
|
30
|
+
/**
|
|
31
|
+
* Trim and lowercase a Provider candidate. Returns `null` when the
|
|
32
|
+
* trimmed value is empty so callers can distinguish "absent" from
|
|
33
|
+
* "invalid".
|
|
34
|
+
*/
|
|
35
|
+
function normalize(raw) {
|
|
36
|
+
const trimmed = raw.trim().toLowerCase();
|
|
37
|
+
return trimmed.length === 0 ? null : trimmed;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Parse and validate a Provider ID. Trims and lowercases the input.
|
|
41
|
+
* Empty and unknown values throw `ValidationError` whose `help` lists
|
|
42
|
+
* the accepted IDs.
|
|
43
|
+
*/
|
|
44
|
+
export function parseProviderId(value) {
|
|
45
|
+
const normalized = normalize(value);
|
|
46
|
+
if (normalized === null) {
|
|
47
|
+
throw new ValidationError(`Provider ID must not be empty. ${ACCEPTED_IDS_HELP}`, ACCEPTED_IDS_HELP);
|
|
48
|
+
}
|
|
49
|
+
if (!PROVIDER_IDS.includes(normalized)) {
|
|
50
|
+
throw new ValidationError(`Unknown provider "${normalized}". ${ACCEPTED_IDS_HELP}`, ACCEPTED_IDS_HELP);
|
|
51
|
+
}
|
|
52
|
+
return normalized;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Resolve the effective Provider ID with explicit precedence over
|
|
56
|
+
* environment over the compatibility default. An explicitly empty
|
|
57
|
+
* value (including whitespace) is treated as present and invalid; it
|
|
58
|
+
* throws `ValidationError` before consulting the environment.
|
|
59
|
+
*
|
|
60
|
+
* `env` defaults to `process.env` for production callers; tests pass
|
|
61
|
+
* an explicit object so they do not touch process globals.
|
|
62
|
+
*
|
|
63
|
+
* FR-003: provider selection is NEVER inferred from available
|
|
64
|
+
* credentials. The default branch always returns `"zai"`; whether the
|
|
65
|
+
* effective Provider is configured is a question for the caller (which
|
|
66
|
+
* throws `ConfigurationError`, exit 3), not for selection.
|
|
67
|
+
*/
|
|
68
|
+
export function resolveProviderId(explicitProvider, env = process.env) {
|
|
69
|
+
// 1. Explicit option — present (including empty) and invalid if empty/unknown.
|
|
70
|
+
if (explicitProvider !== undefined) {
|
|
71
|
+
return parseProviderId(explicitProvider);
|
|
72
|
+
}
|
|
73
|
+
// 2. Environment variable. An empty value here means "explicitly empty":
|
|
74
|
+
// present, invalid, and must not fall through to the default.
|
|
75
|
+
const envValue = env.SCOUTLINE_PROVIDER;
|
|
76
|
+
if (envValue !== undefined) {
|
|
77
|
+
return parseProviderId(envValue);
|
|
78
|
+
}
|
|
79
|
+
// 3. Compatibility default. No credentials, descriptors, or
|
|
80
|
+
// configuration participate (FR-003). The "is the effective
|
|
81
|
+
// Provider configured?" check lives in the dispatch caller, which
|
|
82
|
+
// surfaces a missing credential as ConfigurationError (exit 3).
|
|
83
|
+
return "zai";
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/providers/selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,oEAAoE;AACpE,qCAAqC;AACrC,OAAO,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAErF;;GAEG;AACH,MAAM,iBAAiB,GAAG,0BAA0B,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAE/E;;;;GAIG;AACH,SAAS,SAAS,CAAC,GAAW;IAC5B,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAC/C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,MAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,eAAe,CACvB,kCAAkC,iBAAiB,EAAE,EACrD,iBAAiB,CAClB,CAAC;IACJ,CAAC;IACD,IAAI,CAAE,YAAkC,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,eAAe,CACvB,qBAAqB,UAAU,MAAM,iBAAiB,EAAE,EACxD,iBAAiB,CAClB,CAAC;IACJ,CAAC;IACD,OAAO,UAAwB,CAAC;AAClC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAC/B,gBAAoC,EACpC,GAAG,GAAsB,OAAO,CAAC,GAAG;IAEpC,+EAA+E;IAC/E,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;IAED,yEAAyE;IACzE,iEAAiE;IACjE,MAAM,QAAQ,GAAG,GAAG,CAAC,kBAAkB,CAAC;IACxC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,eAAe,CAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,4DAA4D;IAC5D,+DAA+D;IAC/D,qEAAqE;IACrE,mEAAmE;IACnE,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Types (DESIGN.md §5, PRD FR-001, FR-004, NFR-004, NFR-010).
|
|
3
|
+
*
|
|
4
|
+
* This module defines the static shape of a Provider: a stable ID, the
|
|
5
|
+
* set of Capabilities it advertises, and a factory that produces an
|
|
6
|
+
* Adapter bound to a Provider context. No transport, no I/O, no
|
|
7
|
+
* credential reads occur outside Capability invocation.
|
|
8
|
+
*
|
|
9
|
+
* Phase 2 (P2-01) declares only the Search Capability; Phase 3 (P3-01)
|
|
10
|
+
* adds the `vision?: VisionCapability` slot on `ProviderAdapter` and
|
|
11
|
+
* declares the matching descriptor metadata. Quota and diagnostics
|
|
12
|
+
* attach to the `ProviderAdapter` interface in later phases. The
|
|
13
|
+
* `ProviderCapability` union already enumerates them so descriptor
|
|
14
|
+
* metadata stays forward-compatible.
|
|
15
|
+
*
|
|
16
|
+
* `BUILT_IN_PROVIDER_DESCRIPTORS` is intentionally empty in this stub
|
|
17
|
+
* file; the production registry waits for P2-05, after both real
|
|
18
|
+
* Search Adapters exist. Selection functions and tests operate on
|
|
19
|
+
* explicit descriptor lists through `getProviderDescriptor` and
|
|
20
|
+
* `getConfiguredProviderDescriptors`.
|
|
21
|
+
*/
|
|
22
|
+
import type { SearchCapability } from "../capabilities/search.js";
|
|
23
|
+
import type { VisionCapability } from "../capabilities/vision.js";
|
|
24
|
+
import type { QuotaCapability } from "../capabilities/quota.js";
|
|
25
|
+
import type { DiagnosticsCapability } from "../capabilities/diagnostics.js";
|
|
26
|
+
/**
|
|
27
|
+
* Built-in Provider IDs. Adding a new Provider is a Phase 2+ decision;
|
|
28
|
+
* new entries must come with a real Adapter and conformance coverage.
|
|
29
|
+
*/
|
|
30
|
+
export declare const PROVIDER_IDS: readonly ["zai", "minimax"];
|
|
31
|
+
export type ProviderId = (typeof PROVIDER_IDS)[number];
|
|
32
|
+
/**
|
|
33
|
+
* The set of Capability names a Provider may advertise. Phase 2
|
|
34
|
+
* declares the full union so descriptor metadata stays forward-compatible
|
|
35
|
+
* with Phase 3+ Adapters, but only `search` is wired into the
|
|
36
|
+
* `ProviderAdapter` shape today.
|
|
37
|
+
*/
|
|
38
|
+
export type ProviderCapability = "search" | "vision.interpret-image" | "vision.ui-artifact" | "vision.extract-text" | "vision.diagnose-error" | "vision.diagram" | "vision.chart" | "vision.diff" | "vision.video" | "quota" | "diagnostics";
|
|
39
|
+
/**
|
|
40
|
+
* Injected Provider context. Adapters capture but do not immediately
|
|
41
|
+
* inspect this; credential resolution and transport construction happen
|
|
42
|
+
* only inside Capability invocation after validation.
|
|
43
|
+
*/
|
|
44
|
+
export interface ProviderContext {
|
|
45
|
+
readonly env: NodeJS.ProcessEnv;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Provider Adapter contract (Phase 3 shape). Each Capability that the
|
|
49
|
+
* Provider supports becomes a property on this interface. Phase 4 adds
|
|
50
|
+
* `quota?: QuotaCapability` and `diagnostics?: DiagnosticsCapability`.
|
|
51
|
+
*/
|
|
52
|
+
export interface ProviderAdapter {
|
|
53
|
+
readonly id: ProviderId;
|
|
54
|
+
readonly search?: SearchCapability;
|
|
55
|
+
readonly vision?: VisionCapability;
|
|
56
|
+
readonly quota?: QuotaCapability;
|
|
57
|
+
readonly diagnostics?: DiagnosticsCapability;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Provider Descriptor. `capabilities()` and `isConfigured()` construct
|
|
61
|
+
* no Adapter or transport. `create()` is side-effect-free: it captures
|
|
62
|
+
* the injected environment but shall not read credentials, inspect
|
|
63
|
+
* media, construct a transport, or perform I/O. Credential resolution
|
|
64
|
+
* and transport construction are allowed only inside Capability
|
|
65
|
+
* invocation after validation.
|
|
66
|
+
*/
|
|
67
|
+
export interface ProviderDescriptor {
|
|
68
|
+
readonly id: ProviderId;
|
|
69
|
+
isConfigured(env: NodeJS.ProcessEnv): boolean;
|
|
70
|
+
capabilities(): ReadonlySet<ProviderCapability>;
|
|
71
|
+
create(context: ProviderContext): ProviderAdapter;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Built-in Provider registry. Phase 2 leaves this empty; P2-05 wires
|
|
75
|
+
* the real Z.AI and MiniMax descriptors once both Adapters exist. Tests
|
|
76
|
+
* inject descriptor lists explicitly through `getProviderDescriptor` and
|
|
77
|
+
* `getConfiguredProviderDescriptors`; the production registry is static
|
|
78
|
+
* and never accepts package names, file paths, or dynamic imports.
|
|
79
|
+
*/
|
|
80
|
+
export declare const BUILT_IN_PROVIDER_DESCRIPTORS: readonly ProviderDescriptor[];
|
|
81
|
+
/**
|
|
82
|
+
* Look up a descriptor by ID. Throws when the ID is unknown. The
|
|
83
|
+
* optional `descriptors` parameter lets tests inject doubles; production
|
|
84
|
+
* uses the static built-in list.
|
|
85
|
+
*/
|
|
86
|
+
export declare function getProviderDescriptor(id: ProviderId, descriptors?: readonly ProviderDescriptor[]): ProviderDescriptor;
|
|
87
|
+
/**
|
|
88
|
+
* Return the descriptors that are configured for the given environment.
|
|
89
|
+
* Configuration is purely metadata-driven and never constructs an
|
|
90
|
+
* Adapter.
|
|
91
|
+
*/
|
|
92
|
+
export declare function getConfiguredProviderDescriptors(env: NodeJS.ProcessEnv, descriptors?: readonly ProviderDescriptor[]): readonly ProviderDescriptor[];
|
|
93
|
+
/**
|
|
94
|
+
* Narrow UTCP client surface used by Adapters. Production code passes
|
|
95
|
+
* `UtcpClient.create()` factories wrapped to this shape; tests inject
|
|
96
|
+
* doubles with the same surface.
|
|
97
|
+
*/
|
|
98
|
+
export interface UtcpClientPort {
|
|
99
|
+
registerManual(template: unknown): Promise<{
|
|
100
|
+
success: boolean;
|
|
101
|
+
errors: string[];
|
|
102
|
+
}>;
|
|
103
|
+
getTools(): Promise<unknown[]>;
|
|
104
|
+
callTool(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Z.AI MCP client options. `utcpFactory` is the existing P0-02 injection
|
|
108
|
+
* seam; `noCache` and `disableRetry` arrive in P2-03 so Adapters can
|
|
109
|
+
* hand policy to shared execution.
|
|
110
|
+
*/
|
|
111
|
+
export interface ZaiMcpClientOptions {
|
|
112
|
+
readonly enableVision?: boolean;
|
|
113
|
+
readonly noCache?: boolean;
|
|
114
|
+
readonly disableRetry?: boolean;
|
|
115
|
+
readonly utcpFactory?: () => Promise<UtcpClientPort>;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Legacy Z.AI search parameters as accepted by `ZaiMcpClient.webSearch`.
|
|
119
|
+
* Preserved by the Adapter so legacy cache keys remain reconstructible.
|
|
120
|
+
*/
|
|
121
|
+
export interface LegacyZaiSearchParams {
|
|
122
|
+
query: string;
|
|
123
|
+
count?: number;
|
|
124
|
+
domainFilter?: string;
|
|
125
|
+
recencyFilter?: "oneDay" | "oneWeek" | "oneMonth" | "oneYear" | "noLimit";
|
|
126
|
+
contentSize?: "medium" | "high";
|
|
127
|
+
location?: "cn" | "us";
|
|
128
|
+
}
|
|
129
|
+
/** Result envelope produced by `ZaiMcpClient.webSearch`. */
|
|
130
|
+
export interface WebSearchResult {
|
|
131
|
+
refer: string;
|
|
132
|
+
title: string;
|
|
133
|
+
link: string;
|
|
134
|
+
media: string;
|
|
135
|
+
content: string;
|
|
136
|
+
icon: string;
|
|
137
|
+
publish_date?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Legacy direct Z.AI search client surface used while P2-03 ships. P2-03
|
|
141
|
+
* replaces this with a real Adapter; P2-05 removes it.
|
|
142
|
+
*/
|
|
143
|
+
export interface LegacySearchClientPort {
|
|
144
|
+
webSearch(params: LegacyZaiSearchParams): Promise<WebSearchResult[]>;
|
|
145
|
+
close(): Promise<void>;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Injectable fetch response for quota transports (duck-typed). The
|
|
149
|
+
* injected fetch returns this minimal shape so tests pass a plain object
|
|
150
|
+
* without depending on the DOM `Response` type.
|
|
151
|
+
*/
|
|
152
|
+
export interface ProviderQuotaFetchResponse {
|
|
153
|
+
readonly ok: boolean;
|
|
154
|
+
readonly status: number;
|
|
155
|
+
text(): Promise<string>;
|
|
156
|
+
json(): Promise<unknown>;
|
|
157
|
+
}
|
|
158
|
+
export type ProviderQuotaFetch = (input: string | URL, init: Record<string, unknown>) => Promise<ProviderQuotaFetchResponse>;
|
|
159
|
+
/** Dependencies the Phase 2 Search wiring would inject into the registry. */
|
|
160
|
+
export interface SearchDependencies {
|
|
161
|
+
clientFactory(options: ZaiMcpClientOptions): LegacySearchClientPort;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Narrow surface a Z.AI Search Adapter uses from `ZaiMcpClient`. The
|
|
165
|
+
* Adapter only invokes raw tools; cache and retry policy live in shared
|
|
166
|
+
* execution. `listTools` is the tool-discovery surface the Z.AI
|
|
167
|
+
* diagnostics capability probes (DESIGN.md §14).
|
|
168
|
+
*/
|
|
169
|
+
export interface ZaiAdapterClientPort {
|
|
170
|
+
callToolRaw<T>(name: string, args: Record<string, unknown>): Promise<T>;
|
|
171
|
+
listTools(): Promise<unknown[]>;
|
|
172
|
+
close(): Promise<void>;
|
|
173
|
+
}
|
|
174
|
+
/** Dependencies the Z.AI Search Adapter accepts through injection. */
|
|
175
|
+
export interface ZaiAdapterDependencies {
|
|
176
|
+
clientFactory(options: ZaiMcpClientOptions): ZaiAdapterClientPort;
|
|
177
|
+
/** Optional Z.AI quota-monitor transport injection (tests). */
|
|
178
|
+
readonly quotaFetch?: ProviderQuotaFetch;
|
|
179
|
+
readonly quotaSetTimeout?: typeof setTimeout;
|
|
180
|
+
readonly quotaClearTimeout?: typeof clearTimeout;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Dependencies the MiniMax Adapter accepts. `sdkConstructor` is the
|
|
184
|
+
* only escape hatch tests need; production never passes it.
|
|
185
|
+
*/
|
|
186
|
+
export interface MiniMaxAdapterDependencies {
|
|
187
|
+
readonly sdkConstructor?: MiniMaxSdkConstructor;
|
|
188
|
+
/** Optional MiniMax direct quota transport injection (tests). */
|
|
189
|
+
readonly quotaFetch?: ProviderQuotaFetch;
|
|
190
|
+
readonly quotaSetTimeout?: typeof setTimeout;
|
|
191
|
+
readonly quotaClearTimeout?: typeof clearTimeout;
|
|
192
|
+
/**
|
|
193
|
+
* Optional injection point for the specialized-vision support check
|
|
194
|
+
* (`MiniMaxAdapterDependencies.isSpecializedVisionOperationSupported`).
|
|
195
|
+
* Production never sets this; tests pass a forced-support function so
|
|
196
|
+
* the routing branch can be exercised deterministically without
|
|
197
|
+
* flipping a compiled registry attestation. When omitted, the Adapter
|
|
198
|
+
* delegates to the compiled conformance registry query.
|
|
199
|
+
*/
|
|
200
|
+
readonly isSpecializedVisionOperationSupported?: (operation: import("./minimax/vision-conformance.js").SpecializedVisionOperation) => boolean;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* MiniMax SDK constructor type. Kept here so Adapter Modules do not
|
|
204
|
+
* import `mmx-cli/sdk` directly; only `providers/minimax/sdk-client.ts`
|
|
205
|
+
* references the implementation.
|
|
206
|
+
*/
|
|
207
|
+
export interface MiniMaxSdkConstructor {
|
|
208
|
+
new (options: {
|
|
209
|
+
apiKey: string;
|
|
210
|
+
region: "global" | "cn";
|
|
211
|
+
baseUrl: string;
|
|
212
|
+
}): MiniMaxSdkPort;
|
|
213
|
+
}
|
|
214
|
+
/** Narrow MiniMax SDK surface used by the Adapter. */
|
|
215
|
+
export interface MiniMaxSdkPort {
|
|
216
|
+
search: {
|
|
217
|
+
query(query: string): Promise<unknown>;
|
|
218
|
+
};
|
|
219
|
+
vision: {
|
|
220
|
+
describe(request: {
|
|
221
|
+
image: string;
|
|
222
|
+
prompt?: string;
|
|
223
|
+
}): Promise<unknown>;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Build the Z.AI Provider Descriptor. Phase 2 returns a stub that
|
|
228
|
+
* advertises the search Capability; P2-03 supplies the real Adapter.
|
|
229
|
+
* P3-01 extends the capability set with every current Vision operation
|
|
230
|
+
* so descriptor metadata advertises the Capability before any Adapter
|
|
231
|
+
* is constructed; the real `vision` slot arrives in P3-03.
|
|
232
|
+
*
|
|
233
|
+
* The stub keeps the Provider registerable from day one while the
|
|
234
|
+
* Search Adapter is implemented in P2-03. Throwing inside `create()`
|
|
235
|
+
* surfaces the unfinished Adapter during testing rather than silently
|
|
236
|
+
* failing later.
|
|
237
|
+
*/
|
|
238
|
+
export declare function createZaiDescriptor(dependencies?: ZaiAdapterDependencies): ProviderDescriptor;
|
|
239
|
+
/**
|
|
240
|
+
* Build the MiniMax Provider Descriptor. Phase 2 returns a stub that
|
|
241
|
+
* advertises the search Capability; P2-04 supplies the real Adapter.
|
|
242
|
+
* P3-01 advertises the general `vision.interpret-image` Capability
|
|
243
|
+
* while leaving every specialized operation out until Phase 5
|
|
244
|
+
* attests individual specialized mappings.
|
|
245
|
+
*/
|
|
246
|
+
export declare function createMiniMaxDescriptor(dependencies?: MiniMaxAdapterDependencies): ProviderDescriptor;
|
|
247
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/providers/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAM5E;;;GAGG;AACH,eAAO,MAAM,YAAY,YAAI,KAAK,EAAE,SAAS,CAAU,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,wBAAwB,GACxB,oBAAoB,GACpB,qBAAqB,GACrB,uBAAuB,GACvB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,cAAc,GACd,OAAO,GACP,aAAa,CAAC;AAMlB;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,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