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 @@
|
|
|
1
|
+
{"version":3,"file":"chart.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/chart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAYrB;;;;GAIG;AACH,MAAM,YAAY,GAChB,oIAAoI,CAAC;AAEvI;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAIrB;IACF,SAAS,EAAE,OAAO;IAClB,aAAa,CAAC,OAAgB;QAC5B,MAAM,GAAG,GAAG,OAAuB,CAAC;QACpC,MAAM,QAAQ,GAA2B;YACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,EAAE;YACtC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE;SAC/C,CAAC;QACF,8CAA8C;QAC9C,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QACvD,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,CAAC,GAAY;QAC1B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable common mapping runtime for MiniMax specialized Vision mappings
|
|
3
|
+
* (DESIGN.md §15, phases/05-specialized-vision.md P5-02).
|
|
4
|
+
*
|
|
5
|
+
* P5-03's operation-specific Modules (`vision-mappings/{op}.ts`) import
|
|
6
|
+
* shared helpers from this file. Keeping the shared prompt-composition
|
|
7
|
+
* and result-normalization logic here means a single intentional edit
|
|
8
|
+
* invalidates every mapping revision at once — exactly the contract
|
|
9
|
+
* the conformance registry enforces.
|
|
10
|
+
*
|
|
11
|
+
* Boundary rules:
|
|
12
|
+
* - Pure helpers only. No `process.env`, no filesystem, no network,
|
|
13
|
+
* no Provider imports.
|
|
14
|
+
* - No operation-specific knowledge lives here; per-operation
|
|
15
|
+
* prompts belong in each Module.
|
|
16
|
+
* - The byte-content of this file is one of the inputs to every
|
|
17
|
+
* generated mapping revision, so changing it intentionally
|
|
18
|
+
* invalidates every mapping's attestation.
|
|
19
|
+
*
|
|
20
|
+
* At P5-02 the helpers below are foundational; no operation Module
|
|
21
|
+
* imports them yet. P5-03a–P5-03e will compose prompts through
|
|
22
|
+
* `composeMappingPrompt` and normalize results through
|
|
23
|
+
* `normalizeMappingResult`.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* A single composed prompt segment. Segments are joined with blank-line
|
|
27
|
+
* separators so each segment (intent, instruction, options) forms a
|
|
28
|
+
* distinct paragraph in the rendered prompt.
|
|
29
|
+
*/
|
|
30
|
+
export interface MappingPromptSegment {
|
|
31
|
+
readonly kind: "intent" | "instruction" | "option" | "constraint";
|
|
32
|
+
readonly text: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Compose a deterministic multi-paragraph prompt from segments.
|
|
36
|
+
* Trims each segment, drops empties, and joins with exactly one blank
|
|
37
|
+
* line between segments. The composed prompt is stable: identical
|
|
38
|
+
* inputs always produce byte-identical output, which makes the
|
|
39
|
+
* operation Module's revision reproducible.
|
|
40
|
+
*/
|
|
41
|
+
export declare function composeMappingPrompt(segments: readonly MappingPromptSegment[]): string;
|
|
42
|
+
/**
|
|
43
|
+
* Normalize the MiniMax Vision `sdk.vision.describe` envelope to a
|
|
44
|
+
* nonempty text string. The characterized envelope is
|
|
45
|
+
* `{ content: string }`; any other shape, or empty content, is a
|
|
46
|
+
* malformed result.
|
|
47
|
+
*
|
|
48
|
+
* Operation Modules in P5-03 will route through this helper so that
|
|
49
|
+
* every specialized mapping applies the same result-shape contract.
|
|
50
|
+
*/
|
|
51
|
+
export declare function normalizeMappingResult(raw: unknown): string;
|
|
52
|
+
/**
|
|
53
|
+
* Format an optional string option as a labelled prompt line, or
|
|
54
|
+
* return the empty string when the value is absent or whitespace-only.
|
|
55
|
+
* Used by operation Modules to render optional fields (programming
|
|
56
|
+
* language, diagram type, focus, context) into the prompt without
|
|
57
|
+
* duplicating the guard logic.
|
|
58
|
+
*/
|
|
59
|
+
export declare function formatOptionalOption(label: string, value: string | undefined): string;
|
|
60
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,YAAY,CAAC;IAClE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,CAKtF;AAMD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQ3D;AAMD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGrF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable common mapping runtime for MiniMax specialized Vision mappings
|
|
3
|
+
* (DESIGN.md §15, phases/05-specialized-vision.md P5-02).
|
|
4
|
+
*
|
|
5
|
+
* P5-03's operation-specific Modules (`vision-mappings/{op}.ts`) import
|
|
6
|
+
* shared helpers from this file. Keeping the shared prompt-composition
|
|
7
|
+
* and result-normalization logic here means a single intentional edit
|
|
8
|
+
* invalidates every mapping revision at once — exactly the contract
|
|
9
|
+
* the conformance registry enforces.
|
|
10
|
+
*
|
|
11
|
+
* Boundary rules:
|
|
12
|
+
* - Pure helpers only. No `process.env`, no filesystem, no network,
|
|
13
|
+
* no Provider imports.
|
|
14
|
+
* - No operation-specific knowledge lives here; per-operation
|
|
15
|
+
* prompts belong in each Module.
|
|
16
|
+
* - The byte-content of this file is one of the inputs to every
|
|
17
|
+
* generated mapping revision, so changing it intentionally
|
|
18
|
+
* invalidates every mapping's attestation.
|
|
19
|
+
*
|
|
20
|
+
* At P5-02 the helpers below are foundational; no operation Module
|
|
21
|
+
* imports them yet. P5-03a–P5-03e will compose prompts through
|
|
22
|
+
* `composeMappingPrompt` and normalize results through
|
|
23
|
+
* `normalizeMappingResult`.
|
|
24
|
+
*/
|
|
25
|
+
import { ApiError } from "../../../lib/errors.js";
|
|
26
|
+
/**
|
|
27
|
+
* Compose a deterministic multi-paragraph prompt from segments.
|
|
28
|
+
* Trims each segment, drops empties, and joins with exactly one blank
|
|
29
|
+
* line between segments. The composed prompt is stable: identical
|
|
30
|
+
* inputs always produce byte-identical output, which makes the
|
|
31
|
+
* operation Module's revision reproducible.
|
|
32
|
+
*/
|
|
33
|
+
export function composeMappingPrompt(segments) {
|
|
34
|
+
const cleaned = segments
|
|
35
|
+
.map((s) => (typeof s?.text === "string" ? s.text.trim() : ""))
|
|
36
|
+
.filter((text) => text.length > 0);
|
|
37
|
+
return cleaned.join("\n\n");
|
|
38
|
+
}
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
// Result normalization
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
/**
|
|
43
|
+
* Normalize the MiniMax Vision `sdk.vision.describe` envelope to a
|
|
44
|
+
* nonempty text string. The characterized envelope is
|
|
45
|
+
* `{ content: string }`; any other shape, or empty content, is a
|
|
46
|
+
* malformed result.
|
|
47
|
+
*
|
|
48
|
+
* Operation Modules in P5-03 will route through this helper so that
|
|
49
|
+
* every specialized mapping applies the same result-shape contract.
|
|
50
|
+
*/
|
|
51
|
+
export function normalizeMappingResult(raw) {
|
|
52
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) {
|
|
53
|
+
const record = raw;
|
|
54
|
+
if (typeof record.content === "string" && record.content.trim().length > 0) {
|
|
55
|
+
return record.content;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
throw new ApiError("MiniMax vision returned a malformed response", 500);
|
|
59
|
+
}
|
|
60
|
+
// ---------------------------------------------------------------------------
|
|
61
|
+
// Option formatting
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
/**
|
|
64
|
+
* Format an optional string option as a labelled prompt line, or
|
|
65
|
+
* return the empty string when the value is absent or whitespace-only.
|
|
66
|
+
* Used by operation Modules to render optional fields (programming
|
|
67
|
+
* language, diagram type, focus, context) into the prompt without
|
|
68
|
+
* duplicating the guard logic.
|
|
69
|
+
*/
|
|
70
|
+
export function formatOptionalOption(label, value) {
|
|
71
|
+
if (typeof value !== "string" || value.trim().length === 0)
|
|
72
|
+
return "";
|
|
73
|
+
return `${label}: ${value.trim()}`;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAgBlD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAyC;IAC5E,MAAM,OAAO,GAAG,QAAQ;SACrB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SAC9D,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,8EAA8E;AAC9E,uBAAuB;AACvB,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,MAAM,GAAG,GAA4B,CAAC;QAC5C,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3E,OAAO,MAAM,CAAC,OAAO,CAAC;QACxB,CAAC;IACH,CAAC;IACD,MAAM,IAAI,QAAQ,CAAC,8CAA8C,EAAE,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,8EAA8E;AAC9E,oBAAoB;AACpB,8EAA8E;AAE9E;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa,EAAE,KAAyB;IAC3E,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACtE,OAAO,GAAG,KAAK,KAAK,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagnose-error specialized Vision mapping (DESIGN.md §15, P5-03c).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional context hint, and the
|
|
5
|
+
* error-diagnosis intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional context hint is rendered exactly once. The mapping
|
|
8
|
+
* routes ONLY through `sdk.vision.describe` with one image — it never
|
|
9
|
+
* claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the diagnose-error input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import type { SpecializedVisionOperation } from "../vision-conformance.js";
|
|
25
|
+
/**
|
|
26
|
+
* The diagnose-error mapping Module. Satisfies the
|
|
27
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
28
|
+
* operation map.
|
|
29
|
+
*/
|
|
30
|
+
export declare const diagnoseErrorMapping: {
|
|
31
|
+
readonly operation: SpecializedVisionOperation;
|
|
32
|
+
composePrompt(request: unknown): string;
|
|
33
|
+
normalizeResult(raw: unknown): string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=diagnose-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose-error.d.ts","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/diagnose-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AA0B3E;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE;IACjC,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;CAmBvC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagnose-error specialized Vision mapping (DESIGN.md §15, P5-03c).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional context hint, and the
|
|
5
|
+
* error-diagnosis intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional context hint is rendered exactly once. The mapping
|
|
8
|
+
* routes ONLY through `sdk.vision.describe` with one image — it never
|
|
9
|
+
* claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the diagnose-error input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import { composeMappingPrompt, normalizeMappingResult, formatOptionalOption, } from "./common.js";
|
|
25
|
+
/**
|
|
26
|
+
* Error-diagnosis intent. Rendered once per prompt as the opening
|
|
27
|
+
* intent segment. Deliberately does NOT reuse the user instruction's
|
|
28
|
+
* phrasing so the instruction remains intact and distinct.
|
|
29
|
+
*/
|
|
30
|
+
const DIAGNOSE_ERROR_INTENT = "Diagnose the error shown in the image. Identify the error class, the cause, and at least one remediation.";
|
|
31
|
+
/**
|
|
32
|
+
* The diagnose-error mapping Module. Satisfies the
|
|
33
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
34
|
+
* operation map.
|
|
35
|
+
*/
|
|
36
|
+
export const diagnoseErrorMapping = {
|
|
37
|
+
operation: "diagnose-error",
|
|
38
|
+
composePrompt(request) {
|
|
39
|
+
const req = request;
|
|
40
|
+
const segments = [
|
|
41
|
+
{ kind: "intent", text: DIAGNOSE_ERROR_INTENT },
|
|
42
|
+
{ kind: "instruction", text: req.instruction },
|
|
43
|
+
];
|
|
44
|
+
// Optional context hint, rendered at most once.
|
|
45
|
+
const context = formatOptionalOption("Context", req.context);
|
|
46
|
+
if (context.length > 0) {
|
|
47
|
+
segments.push({ kind: "option", text: context });
|
|
48
|
+
}
|
|
49
|
+
return composeMappingPrompt(segments);
|
|
50
|
+
},
|
|
51
|
+
normalizeResult(raw) {
|
|
52
|
+
return normalizeMappingResult(raw);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=diagnose-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnose-error.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/diagnose-error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAYrB;;;;GAIG;AACH,MAAM,qBAAqB,GACzB,2GAA2G,CAAC;AAE9G;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAI7B;IACF,SAAS,EAAE,gBAAgB;IAC3B,aAAa,CAAC,OAAgB;QAC5B,MAAM,GAAG,GAAG,OAA+B,CAAC;QAC5C,MAAM,QAAQ,GAA2B;YACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE;YAC/C,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE;SAC/C,CAAC;QACF,gDAAgD;QAChD,MAAM,OAAO,GAAG,oBAAoB,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,CAAC;QACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,CAAC,GAAY;QAC1B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagram specialized Vision mapping (DESIGN.md §15, P5-03d).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional diagram-type hint, and the
|
|
5
|
+
* diagram-interpretation intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional diagram-type hint is rendered exactly once. The mapping
|
|
8
|
+
* routes ONLY through `sdk.vision.describe` with one image — it never
|
|
9
|
+
* claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the diagram input to the conformance registry's SHA-256
|
|
14
|
+
* mapping revision. It stays unsupported at runtime until a separate
|
|
15
|
+
* opt-in live attestation flips the registry's live state to "pass"
|
|
16
|
+
* (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import type { SpecializedVisionOperation } from "../vision-conformance.js";
|
|
25
|
+
/**
|
|
26
|
+
* The diagram mapping Module. Satisfies the
|
|
27
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
28
|
+
* operation map.
|
|
29
|
+
*/
|
|
30
|
+
export declare const diagramMapping: {
|
|
31
|
+
readonly operation: SpecializedVisionOperation;
|
|
32
|
+
composePrompt(request: unknown): string;
|
|
33
|
+
normalizeResult(raw: unknown): string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=diagram.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram.d.ts","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/diagram.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AA0B3E;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE;IAC3B,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;CAmBvC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* diagram specialized Vision mapping (DESIGN.md §15, P5-03d).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional diagram-type hint, and the
|
|
5
|
+
* diagram-interpretation intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional diagram-type hint is rendered exactly once. The mapping
|
|
8
|
+
* routes ONLY through `sdk.vision.describe` with one image — it never
|
|
9
|
+
* claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the diagram input to the conformance registry's SHA-256
|
|
14
|
+
* mapping revision. It stays unsupported at runtime until a separate
|
|
15
|
+
* opt-in live attestation flips the registry's live state to "pass"
|
|
16
|
+
* (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import { composeMappingPrompt, normalizeMappingResult, formatOptionalOption, } from "./common.js";
|
|
25
|
+
/**
|
|
26
|
+
* Diagram-interpretation intent. Rendered once per prompt as the
|
|
27
|
+
* opening intent segment. Deliberately distinct from the user
|
|
28
|
+
* instruction's phrasing so the instruction remains intact.
|
|
29
|
+
*/
|
|
30
|
+
const DIAGRAM_INTENT = "Interpret the diagram shown in the image. Report each node by its label and describe how the nodes connect, including the direction of every relationship.";
|
|
31
|
+
/**
|
|
32
|
+
* The diagram mapping Module. Satisfies the
|
|
33
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
34
|
+
* operation map.
|
|
35
|
+
*/
|
|
36
|
+
export const diagramMapping = {
|
|
37
|
+
operation: "diagram",
|
|
38
|
+
composePrompt(request) {
|
|
39
|
+
const req = request;
|
|
40
|
+
const segments = [
|
|
41
|
+
{ kind: "intent", text: DIAGRAM_INTENT },
|
|
42
|
+
{ kind: "instruction", text: req.instruction },
|
|
43
|
+
];
|
|
44
|
+
// Optional diagram-type hint, rendered at most once.
|
|
45
|
+
const diagramType = formatOptionalOption("Diagram type", req.diagramType);
|
|
46
|
+
if (diagramType.length > 0) {
|
|
47
|
+
segments.push({ kind: "option", text: diagramType });
|
|
48
|
+
}
|
|
49
|
+
return composeMappingPrompt(segments);
|
|
50
|
+
},
|
|
51
|
+
normalizeResult(raw) {
|
|
52
|
+
return normalizeMappingResult(raw);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=diagram.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagram.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/diagram.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAYrB;;;;GAIG;AACH,MAAM,cAAc,GAClB,4JAA4J,CAAC;AAE/J;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAIvB;IACF,SAAS,EAAE,SAAS;IACpB,aAAa,CAAC,OAAgB;QAC5B,MAAM,GAAG,GAAG,OAAyB,CAAC;QACtC,MAAM,QAAQ,GAA2B;YACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE;YACxC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE;SAC/C,CAAC;QACF,qDAAqD;QACrD,MAAM,WAAW,GAAG,oBAAoB,CAAC,cAAc,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;QAC1E,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,CAAC,GAAY;QAC1B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* extract-text specialized Vision mapping (DESIGN.md §15, P5-03b).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional programming-language hint,
|
|
5
|
+
* and the exact-text recovery intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional programming-language hint is rendered exactly once. The
|
|
8
|
+
* mapping routes ONLY through `sdk.vision.describe` with one image — it
|
|
9
|
+
* never claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the extract-text input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import type { SpecializedVisionOperation } from "../vision-conformance.js";
|
|
25
|
+
/**
|
|
26
|
+
* The extract-text mapping Module. Satisfies the
|
|
27
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
28
|
+
* operation map.
|
|
29
|
+
*/
|
|
30
|
+
export declare const extractTextMapping: {
|
|
31
|
+
readonly operation: SpecializedVisionOperation;
|
|
32
|
+
composePrompt(request: unknown): string;
|
|
33
|
+
normalizeResult(raw: unknown): string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=extract-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-text.d.ts","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/extract-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AA0B3E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE;IAC/B,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;CAmBvC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* extract-text specialized Vision mapping (DESIGN.md §15, P5-03b).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, an optional programming-language hint,
|
|
5
|
+
* and the exact-text recovery intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the optional programming-language hint is rendered exactly once. The
|
|
8
|
+
* mapping routes ONLY through `sdk.vision.describe` with one image — it
|
|
9
|
+
* never claims a dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the extract-text input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import { composeMappingPrompt, normalizeMappingResult, formatOptionalOption, } from "./common.js";
|
|
25
|
+
/**
|
|
26
|
+
* Exact-text recovery intent. Rendered once per prompt as the opening
|
|
27
|
+
* intent segment. Deliberately does NOT reuse the user instruction's
|
|
28
|
+
* phrasing so the instruction remains intact and distinct.
|
|
29
|
+
*/
|
|
30
|
+
const EXTRACT_TEXT_INTENT = "Recover every rendered line of text verbatim. Output each line in order; do not paraphrase, summarize, or reorder.";
|
|
31
|
+
/**
|
|
32
|
+
* The extract-text mapping Module. Satisfies the
|
|
33
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
34
|
+
* operation map.
|
|
35
|
+
*/
|
|
36
|
+
export const extractTextMapping = {
|
|
37
|
+
operation: "extract-text",
|
|
38
|
+
composePrompt(request) {
|
|
39
|
+
const req = request;
|
|
40
|
+
const segments = [
|
|
41
|
+
{ kind: "intent", text: EXTRACT_TEXT_INTENT },
|
|
42
|
+
{ kind: "instruction", text: req.instruction },
|
|
43
|
+
];
|
|
44
|
+
// Optional programming-language hint, rendered at most once.
|
|
45
|
+
const language = formatOptionalOption("Programming language", req.programmingLanguage);
|
|
46
|
+
if (language.length > 0) {
|
|
47
|
+
segments.push({ kind: "option", text: language });
|
|
48
|
+
}
|
|
49
|
+
return composeMappingPrompt(segments);
|
|
50
|
+
},
|
|
51
|
+
normalizeResult(raw) {
|
|
52
|
+
return normalizeMappingResult(raw);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=extract-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-text.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/extract-text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GAErB,MAAM,aAAa,CAAC;AAYrB;;;;GAIG;AACH,MAAM,mBAAmB,GACvB,oHAAoH,CAAC;AAEvH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAI3B;IACF,SAAS,EAAE,cAAc;IACzB,aAAa,CAAC,OAAgB;QAC5B,MAAM,GAAG,GAAG,OAA6B,CAAC;QAC1C,MAAM,QAAQ,GAA2B;YACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,mBAAmB,EAAE;YAC7C,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE;SAC/C,CAAC;QACF,6DAA6D;QAC7D,MAAM,QAAQ,GAAG,oBAAoB,CAAC,sBAAsB,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACvF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,CAAC,GAAY;QAC1B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ui-artifact specialized Vision mapping (DESIGN.md §15, P5-03a).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, the selected output form, and the
|
|
5
|
+
* UI-artifact analysis intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the output-type hint is rendered exactly once. The mapping routes
|
|
8
|
+
* ONLY through `sdk.vision.describe` with one image — it never claims a
|
|
9
|
+
* dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the ui-artifact input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import type { SpecializedVisionOperation } from "../vision-conformance.js";
|
|
25
|
+
/**
|
|
26
|
+
* The ui-artifact mapping Module. Satisfies the
|
|
27
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
28
|
+
* operation map.
|
|
29
|
+
*/
|
|
30
|
+
export declare const uiArtifactMapping: {
|
|
31
|
+
readonly operation: SpecializedVisionOperation;
|
|
32
|
+
composePrompt(request: unknown): string;
|
|
33
|
+
normalizeResult(raw: unknown): string;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=ui-artifact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-artifact.d.ts","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/ui-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AA8C3E;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE;IAC9B,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;CAevC,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ui-artifact specialized Vision mapping (DESIGN.md §15, P5-03a).
|
|
3
|
+
*
|
|
4
|
+
* Composes the user instruction, the selected output form, and the
|
|
5
|
+
* UI-artifact analysis intent into a single prompt for
|
|
6
|
+
* `sdk.vision.describe`. The user instruction is preserved verbatim;
|
|
7
|
+
* the output-type hint is rendered exactly once. The mapping routes
|
|
8
|
+
* ONLY through `sdk.vision.describe` with one image — it never claims a
|
|
9
|
+
* dedicated MiniMax operation.
|
|
10
|
+
*
|
|
11
|
+
* This Module is wired into the generated operation map
|
|
12
|
+
* (`vision-mappings.generated.ts`) by the prebuild generator and
|
|
13
|
+
* contributes the ui-artifact input to the conformance registry's
|
|
14
|
+
* SHA-256 mapping revision. It stays unsupported at runtime until a
|
|
15
|
+
* separate opt-in live attestation flips the registry's live state to
|
|
16
|
+
* "pass" (DESIGN.md §15).
|
|
17
|
+
*
|
|
18
|
+
* Boundary rules:
|
|
19
|
+
* - Pure prompt composition + result normalization only. No
|
|
20
|
+
* `process.env`, no filesystem, no network, no Provider imports.
|
|
21
|
+
* - Imports only the shared common runtime helpers; any change to
|
|
22
|
+
* `common.ts` intentionally invalidates this mapping's revision.
|
|
23
|
+
*/
|
|
24
|
+
import { composeMappingPrompt, normalizeMappingResult, } from "./common.js";
|
|
25
|
+
/**
|
|
26
|
+
* UI-artifact analysis intent. Rendered once per prompt as the opening
|
|
27
|
+
* intent segment. Deliberately does NOT mention the selected output
|
|
28
|
+
* form — that hint lives in its own option segment so operation hints
|
|
29
|
+
* are represented exactly once.
|
|
30
|
+
*/
|
|
31
|
+
const UI_ARTIFACT_INTENT = "You are analyzing a user-interface screenshot. Identify the visible page regions (such as header, sidebar, content, and footer) and produce the artifact requested below.";
|
|
32
|
+
/**
|
|
33
|
+
* Map the ui-artifact outputType to a human-readable label for the
|
|
34
|
+
* option segment. Kept here (not in common.ts) because it is
|
|
35
|
+
* operation-specific.
|
|
36
|
+
*/
|
|
37
|
+
function outputFormLabel(outputType) {
|
|
38
|
+
switch (outputType) {
|
|
39
|
+
case "code":
|
|
40
|
+
return "code (markup)";
|
|
41
|
+
case "prompt":
|
|
42
|
+
return "a prompt";
|
|
43
|
+
case "spec":
|
|
44
|
+
return "a specification";
|
|
45
|
+
case "description":
|
|
46
|
+
return "a description";
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The ui-artifact mapping Module. Satisfies the
|
|
51
|
+
* {@link MiniMaxVisionMappingModule} interface declared in the generated
|
|
52
|
+
* operation map.
|
|
53
|
+
*/
|
|
54
|
+
export const uiArtifactMapping = {
|
|
55
|
+
operation: "ui-artifact",
|
|
56
|
+
composePrompt(request) {
|
|
57
|
+
const req = request;
|
|
58
|
+
const segments = [
|
|
59
|
+
{ kind: "intent", text: UI_ARTIFACT_INTENT },
|
|
60
|
+
{ kind: "option", text: `Requested output form: ${outputFormLabel(req.outputType)}` },
|
|
61
|
+
{ kind: "instruction", text: req.instruction },
|
|
62
|
+
];
|
|
63
|
+
return composeMappingPrompt(segments);
|
|
64
|
+
},
|
|
65
|
+
normalizeResult(raw) {
|
|
66
|
+
return normalizeMappingResult(raw);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=ui-artifact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-artifact.js","sourceRoot":"","sources":["../../../../src/providers/minimax/vision-mappings/ui-artifact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GAEvB,MAAM,aAAa,CAAC;AAcrB;;;;;GAKG;AACH,MAAM,kBAAkB,GACtB,2KAA2K,CAAC;AAE9K;;;;GAIG;AACH,SAAS,eAAe,CAAC,UAA2C;IAClE,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,eAAe,CAAC;QACzB,KAAK,QAAQ;YACX,OAAO,UAAU,CAAC;QACpB,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC;QAC3B,KAAK,aAAa;YAChB,OAAO,eAAe,CAAC;IAC3B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAI1B;IACF,SAAS,EAAE,aAAa;IACxB,aAAa,CAAC,OAAgB;QAC5B,MAAM,GAAG,GAAG,OAA4B,CAAC;QACzC,MAAM,QAAQ,GAAoC;YAChD,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE;YAC5C,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,0BAA0B,eAAe,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,EAAE;YACrF,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE;SAC/C,CAAC;QACF,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;IACD,eAAe,CAAC,GAAY;QAC1B,OAAO,sBAAsB,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* The operation map connects each specialized Vision operation id to
|
|
10
|
+
* its mapping Module (`vision-mappings/{op}.ts`). Currently 5 of 5 operations have Modules.
|
|
11
|
+
*/
|
|
12
|
+
import type { SpecializedVisionOperation } from "./vision-conformance.js";
|
|
13
|
+
/**
|
|
14
|
+
* The interface every operation-specific mapping Module implements.
|
|
15
|
+
* Defined here so the generated map has a stable type even when the
|
|
16
|
+
* map itself is empty. P5-03's Modules will satisfy this shape.
|
|
17
|
+
*/
|
|
18
|
+
export interface MiniMaxVisionMappingModule {
|
|
19
|
+
readonly operation: SpecializedVisionOperation;
|
|
20
|
+
composePrompt(request: unknown): string;
|
|
21
|
+
normalizeResult(raw: unknown): string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The generated operation map. The Adapter looks up the Module for a
|
|
25
|
+
* supported operation; absence here means the operation is not wired
|
|
26
|
+
* even if its registry entry is fully passing.
|
|
27
|
+
*/
|
|
28
|
+
export declare const MINIMAX_VISION_MAPPINGS: Readonly<Partial<Record<SpecializedVisionOperation, MiniMaxVisionMappingModule>>>;
|
|
29
|
+
//# sourceMappingURL=vision-mappings.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-mappings.generated.d.ts","sourceRoot":"","sources":["../../../src/providers/minimax/vision-mappings.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAO1E;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,SAAS,EAAE,0BAA0B,CAAC;IAC/C,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;IACxC,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;CACvC;AAED;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAC5C,OAAO,CAAC,MAAM,CAAC,0BAA0B,EAAE,0BAA0B,CAAC,CAAC,CAOvE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* The operation map connects each specialized Vision operation id to
|
|
10
|
+
* its mapping Module (`vision-mappings/{op}.ts`). Currently 5 of 5 operations have Modules.
|
|
11
|
+
*/
|
|
12
|
+
import { uiArtifactMapping } from "./vision-mappings/ui-artifact.js";
|
|
13
|
+
import { extractTextMapping } from "./vision-mappings/extract-text.js";
|
|
14
|
+
import { diagnoseErrorMapping } from "./vision-mappings/diagnose-error.js";
|
|
15
|
+
import { diagramMapping } from "./vision-mappings/diagram.js";
|
|
16
|
+
import { chartMapping } from "./vision-mappings/chart.js";
|
|
17
|
+
/**
|
|
18
|
+
* The generated operation map. The Adapter looks up the Module for a
|
|
19
|
+
* supported operation; absence here means the operation is not wired
|
|
20
|
+
* even if its registry entry is fully passing.
|
|
21
|
+
*/
|
|
22
|
+
export const MINIMAX_VISION_MAPPINGS = Object.freeze({
|
|
23
|
+
"ui-artifact": uiArtifactMapping,
|
|
24
|
+
"extract-text": extractTextMapping,
|
|
25
|
+
"diagnose-error": diagnoseErrorMapping,
|
|
26
|
+
"diagram": diagramMapping,
|
|
27
|
+
"chart": chartMapping,
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=vision-mappings.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-mappings.generated.js","sourceRoot":"","sources":["../../../src/providers/minimax/vision-mappings.generated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAa1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAEhC,MAAM,CAAC,MAAM,CAAC;IAChB,aAAa,EAAE,iBAAiB;IAChC,cAAc,EAAE,kBAAkB;IAClC,gBAAgB,EAAE,oBAAoB;IACtC,SAAS,EAAE,cAAc;IACzB,OAAO,EAAE,YAAY;CACtB,CAAC,CAAC"}
|