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
|
@@ -1,15 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Vision commands
|
|
2
|
+
* Vision commands.
|
|
3
|
+
*
|
|
4
|
+
* P3-04: the command no longer constructs a Provider client or validates
|
|
5
|
+
* media directly. It receives the effective Provider's VisionCapability
|
|
6
|
+
* through the dispatch dependency object (same pattern as Search in
|
|
7
|
+
* P2-05), builds the discriminated `VisionRequest`, and invokes through
|
|
8
|
+
* shared execution (`executeProviderOperation("vision", ...)`). The
|
|
9
|
+
* support check — not a command branch on a Provider ID — decides
|
|
10
|
+
* availability; Provider selection and capability gating live in the
|
|
11
|
+
* dispatcher (`index.ts`).
|
|
12
|
+
*
|
|
13
|
+
* Default prompts and command presentation meaning stay here. Source
|
|
14
|
+
* limits stay in the Adapter media Modules. Vision never uses the
|
|
15
|
+
* response cache (FR-022).
|
|
3
16
|
*/
|
|
17
|
+
import type { CommandContext, CommandResult } from "../command-invocation.js";
|
|
18
|
+
import type { VisionCapability } from "../capabilities/vision.js";
|
|
4
19
|
type OutputType = "code" | "prompt" | "spec" | "description";
|
|
5
|
-
export declare function analyze(imageSource: string, prompt?: string): Promise<void>;
|
|
6
|
-
export declare function uiToCode(imageSource: string, prompt?: string, outputType?: OutputType): Promise<void>;
|
|
7
|
-
export declare function extractText(imageSource: string, prompt?: string, language?: string): Promise<void>;
|
|
8
|
-
export declare function diagnoseError(imageSource: string, prompt?: string, context?: string): Promise<void>;
|
|
9
|
-
export declare function diagram(imageSource: string, prompt?: string, diagramType?: string): Promise<void>;
|
|
10
|
-
export declare function chart(imageSource: string, prompt?: string, focus?: string): Promise<void>;
|
|
11
|
-
export declare function diff(expectedSource: string, actualSource: string, prompt?: string): Promise<void>;
|
|
12
|
-
export declare function video(videoSource: string, prompt?: string): Promise<void>;
|
|
13
20
|
export declare const VISION_HELP: string;
|
|
21
|
+
/**
|
|
22
|
+
* Shared Vision execution dependencies. The Capability is the selected
|
|
23
|
+
* Provider's `VisionCapability`; `sleep`/`random` drive retry backoff
|
|
24
|
+
* deterministically under test. Vision bypasses the response cache, so
|
|
25
|
+
* no cache dependency is threaded here.
|
|
26
|
+
*/
|
|
27
|
+
export interface VisionExecutionDependencies {
|
|
28
|
+
readonly capability: VisionCapability;
|
|
29
|
+
readonly sleep: (ms: number) => Promise<void>;
|
|
30
|
+
readonly random: () => number;
|
|
31
|
+
}
|
|
32
|
+
export declare function analyze(imageSource: string, prompt: string, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
33
|
+
export declare function uiToCode(imageSource: string, prompt: string, outputType: OutputType, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
34
|
+
export declare function extractText(imageSource: string, prompt: string, language: string | undefined, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
35
|
+
export declare function diagnoseError(imageSource: string, prompt: string, contextFlag: string | undefined, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
36
|
+
export declare function diagram(imageSource: string, prompt: string, diagramType: string | undefined, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
37
|
+
export declare function chart(imageSource: string, prompt: string, focus: string | undefined, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
38
|
+
export declare function diff(expectedSource: string, actualSource: string, prompt: string, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
39
|
+
export declare function video(videoSource: string, prompt: string, deps: VisionExecutionDependencies, context?: CommandContext): Promise<CommandResult>;
|
|
14
40
|
export {};
|
|
15
41
|
//# sourceMappingURL=vision.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vision.d.ts","sourceRoot":"","sources":["../../src/commands/vision.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vision.d.ts","sourceRoot":"","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,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAmBxB;AAED,wBAAsB,OAAO,CAC3B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAmBxB;AAED,wBAAsB,KAAK,CACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAmBxB;AAED,wBAAsB,IAAI,CACxB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAmBxB;AAED,wBAAsB,KAAK,CACzB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,2BAA2B,EACjC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,aAAa,CAAC,CAWxB"}
|
package/dist/commands/vision.js
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Vision commands
|
|
2
|
+
* Vision commands.
|
|
3
|
+
*
|
|
4
|
+
* P3-04: the command no longer constructs a Provider client or validates
|
|
5
|
+
* media directly. It receives the effective Provider's VisionCapability
|
|
6
|
+
* through the dispatch dependency object (same pattern as Search in
|
|
7
|
+
* P2-05), builds the discriminated `VisionRequest`, and invokes through
|
|
8
|
+
* shared execution (`executeProviderOperation("vision", ...)`). The
|
|
9
|
+
* support check — not a command branch on a Provider ID — decides
|
|
10
|
+
* availability; Provider selection and capability gating live in the
|
|
11
|
+
* dispatcher (`index.ts`).
|
|
12
|
+
*
|
|
13
|
+
* Default prompts and command presentation meaning stay here. Source
|
|
14
|
+
* limits stay in the Adapter media Modules. Vision never uses the
|
|
15
|
+
* response cache (FR-022).
|
|
3
16
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { formatErrorOutput } from "../lib/errors.js";
|
|
8
|
-
import { silenceConsole, restoreConsole } from "../lib/silence.js";
|
|
17
|
+
import { executeProviderOperation } from "../lib/execution.js";
|
|
18
|
+
import { ValidationError } from "../lib/errors.js";
|
|
19
|
+
import { isMiniMaxVisionOperationSupported, SPECIALIZED_VISION_OPERATION_SET, } from "../providers/minimax/vision-conformance.js";
|
|
9
20
|
const DEFAULT_PROMPTS = {
|
|
10
21
|
analyze: "Describe this image in detail.",
|
|
11
22
|
uiToCode: "Convert this UI to production-ready code.",
|
|
@@ -16,134 +27,60 @@ const DEFAULT_PROMPTS = {
|
|
|
16
27
|
diff: "Compare these two UI screenshots and identify differences.",
|
|
17
28
|
video: "Analyze this video content.",
|
|
18
29
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error(formatErrorOutput(error));
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export async function uiToCode(imageSource, prompt = DEFAULT_PROMPTS.uiToCode, outputType = "code") {
|
|
47
|
-
try {
|
|
48
|
-
const image = resolveImageSource(imageSource);
|
|
49
|
-
const result = await withClient((client) => client.visionUiToArtifact({ imageSource: image, outputType, prompt }));
|
|
50
|
-
outputSuccess(result);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
console.error(formatErrorOutput(error));
|
|
54
|
-
process.exit(1);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export async function extractText(imageSource, prompt = DEFAULT_PROMPTS.extractText, language) {
|
|
58
|
-
try {
|
|
59
|
-
const image = resolveImageSource(imageSource);
|
|
60
|
-
const result = await withClient((client) => client.visionExtractText({
|
|
61
|
-
imageSource: image,
|
|
62
|
-
prompt,
|
|
63
|
-
programmingLanguage: language,
|
|
64
|
-
}));
|
|
65
|
-
outputSuccess(result);
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
console.error(formatErrorOutput(error));
|
|
69
|
-
process.exit(1);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
export async function diagnoseError(imageSource, prompt = DEFAULT_PROMPTS.diagnoseError, context) {
|
|
73
|
-
try {
|
|
74
|
-
const image = resolveImageSource(imageSource);
|
|
75
|
-
const result = await withClient((client) => client.visionDiagnoseError({ imageSource: image, prompt, context }));
|
|
76
|
-
outputSuccess(result);
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
console.error(formatErrorOutput(error));
|
|
80
|
-
process.exit(1);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
export async function diagram(imageSource, prompt = DEFAULT_PROMPTS.diagram, diagramType) {
|
|
84
|
-
try {
|
|
85
|
-
const image = resolveImageSource(imageSource);
|
|
86
|
-
const result = await withClient((client) => client.visionDiagram({ imageSource: image, prompt, diagramType }));
|
|
87
|
-
outputSuccess(result);
|
|
88
|
-
}
|
|
89
|
-
catch (error) {
|
|
90
|
-
console.error(formatErrorOutput(error));
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export async function chart(imageSource, prompt = DEFAULT_PROMPTS.chart, focus) {
|
|
95
|
-
try {
|
|
96
|
-
const image = resolveImageSource(imageSource);
|
|
97
|
-
const result = await withClient((client) => client.visionChart({ imageSource: image, prompt, focus }));
|
|
98
|
-
outputSuccess(result);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
console.error(formatErrorOutput(error));
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
export async function diff(expectedSource, actualSource, prompt = DEFAULT_PROMPTS.diff) {
|
|
106
|
-
try {
|
|
107
|
-
const expectedImage = resolveImageSource(expectedSource);
|
|
108
|
-
const actualImage = resolveImageSource(actualSource);
|
|
109
|
-
const result = await withClient((client) => client.visionDiff({
|
|
110
|
-
expectedImageSource: expectedImage,
|
|
111
|
-
actualImageSource: actualImage,
|
|
112
|
-
prompt,
|
|
113
|
-
}));
|
|
114
|
-
outputSuccess(result);
|
|
115
|
-
}
|
|
116
|
-
catch (error) {
|
|
117
|
-
console.error(formatErrorOutput(error));
|
|
118
|
-
process.exit(1);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
export async function video(videoSource, prompt = DEFAULT_PROMPTS.video) {
|
|
122
|
-
try {
|
|
123
|
-
const videoPath = resolveVideoSource(videoSource);
|
|
124
|
-
const result = await withClient((client) => client.visionVideo({ videoSource: videoPath, prompt }));
|
|
125
|
-
outputSuccess(result);
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
console.error(formatErrorOutput(error));
|
|
129
|
-
process.exit(1);
|
|
130
|
-
}
|
|
30
|
+
/**
|
|
31
|
+
* Render the MiniMax support suffix for a Vision operation's help line.
|
|
32
|
+
* Derives from the conformance registry so help, doctor, and the
|
|
33
|
+
* Adapter descriptor agree on a single source of truth (DESIGN.md §15).
|
|
34
|
+
*
|
|
35
|
+
* - Specialized ops pending/fail/missing attestation: " (Z.AI; MiniMax gated)"
|
|
36
|
+
* - Specialized ops supported: " (Z.AI + MiniMax)"
|
|
37
|
+
* - `interpret-image`: no suffix (the help line already calls out
|
|
38
|
+
* the shared Provider surface).
|
|
39
|
+
* - `diff` and `video`: " (Z.AI only)" — never supported by MiniMax.
|
|
40
|
+
*/
|
|
41
|
+
function miniMaxSupportSuffix(operation) {
|
|
42
|
+
if (operation === "interpret-image")
|
|
43
|
+
return "";
|
|
44
|
+
if (operation === "diff" || operation === "video")
|
|
45
|
+
return " (Z.AI only)";
|
|
46
|
+
if (SPECIALIZED_VISION_OPERATION_SET.has(operation)) {
|
|
47
|
+
return isMiniMaxVisionOperationSupported(operation)
|
|
48
|
+
? " (Z.AI + MiniMax)"
|
|
49
|
+
: " (Z.AI; MiniMax gated)";
|
|
50
|
+
}
|
|
51
|
+
return "";
|
|
131
52
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Build the Vision help text. Specialized-operation support derives
|
|
55
|
+
* from the conformance registry, so P5-03's attested mappings flip
|
|
56
|
+
* their help lines automatically without editing this template.
|
|
57
|
+
*/
|
|
58
|
+
function buildVisionHelp() {
|
|
59
|
+
const uiSuffix = miniMaxSupportSuffix("ui-artifact");
|
|
60
|
+
const extractSuffix = miniMaxSupportSuffix("extract-text");
|
|
61
|
+
const diagnoseSuffix = miniMaxSupportSuffix("diagnose-error");
|
|
62
|
+
const diagramSuffix = miniMaxSupportSuffix("diagram");
|
|
63
|
+
const chartSuffix = miniMaxSupportSuffix("chart");
|
|
64
|
+
const diffSuffix = miniMaxSupportSuffix("diff");
|
|
65
|
+
const videoSuffix = miniMaxSupportSuffix("video");
|
|
66
|
+
return `
|
|
67
|
+
Vision Commands - Analyze images and video (Z.AI + MiniMax)
|
|
135
68
|
|
|
136
69
|
Usage: scoutline vision <command> <source> [prompt] [options]
|
|
137
70
|
|
|
71
|
+
Provider selection (precedence: explicit flag, then SCOUTLINE_PROVIDER, then zai):
|
|
72
|
+
--provider <zai|minimax> Select the vision provider (default: zai)
|
|
73
|
+
SCOUTLINE_PROVIDER=<id> Fallback when --provider is not passed
|
|
74
|
+
|
|
138
75
|
Commands:
|
|
139
|
-
analyze <image> [prompt]
|
|
140
|
-
ui-to-code <image> [prompt]
|
|
141
|
-
extract-text <image> [prompt]
|
|
142
|
-
diagnose-error <image> [prompt]
|
|
143
|
-
diagram <image> [prompt]
|
|
144
|
-
chart <image> [prompt]
|
|
145
|
-
diff <expected> <actual> [prompt]
|
|
146
|
-
video <video> [prompt]
|
|
76
|
+
analyze <image> [prompt] General image interpretation (shared: Z.AI + MiniMax)
|
|
77
|
+
ui-to-code <image> [prompt] Convert UI screenshot to code${uiSuffix}
|
|
78
|
+
extract-text <image> [prompt] OCR for code, terminals, documents${extractSuffix}
|
|
79
|
+
diagnose-error <image> [prompt] Analyze error screenshots${diagnoseSuffix}
|
|
80
|
+
diagram <image> [prompt] Interpret technical diagrams${diagramSuffix}
|
|
81
|
+
chart <image> [prompt] Analyze data visualizations${chartSuffix}
|
|
82
|
+
diff <expected> <actual> [prompt] Compare two UI screenshots${diffSuffix}
|
|
83
|
+
video <video> [prompt] Analyze video content${videoSuffix}
|
|
147
84
|
|
|
148
85
|
Options:
|
|
149
86
|
--language <lang> Programming language hint (extract-text)
|
|
@@ -153,11 +90,12 @@ Options:
|
|
|
153
90
|
--output <type> Output type for ui-to-code: code, prompt, spec, description
|
|
154
91
|
|
|
155
92
|
Constraints:
|
|
156
|
-
|
|
157
|
-
|
|
93
|
+
Z.AI images: <=5MB, JPG/PNG/JPEG ; Z.AI videos: <=8MB, MP4/MOV/M4V (URLs supported)
|
|
94
|
+
MiniMax images: <=50MB, JPG/JPEG/PNG/WebP
|
|
158
95
|
|
|
159
96
|
Examples:
|
|
160
97
|
scoutline vision analyze ./screenshot.png "What's in this image?"
|
|
98
|
+
scoutline --provider minimax vision analyze ./shot.png
|
|
161
99
|
scoutline vision ui-to-code ./design.png --output code
|
|
162
100
|
scoutline vision extract-text ./code.png --language python
|
|
163
101
|
scoutline vision diagnose-error ./error.png --context "during npm install"
|
|
@@ -165,4 +103,119 @@ Examples:
|
|
|
165
103
|
scoutline vision diff ./expected.png ./actual.png "Check alignment"
|
|
166
104
|
scoutline vision video ./demo.mp4 "Summarize the key steps"
|
|
167
105
|
`.trim();
|
|
106
|
+
}
|
|
107
|
+
export const VISION_HELP = buildVisionHelp();
|
|
108
|
+
/**
|
|
109
|
+
* Invoke a Vision request through shared execution. Vision allows two
|
|
110
|
+
* retries (DESIGN.md §10); the default policy is applied by
|
|
111
|
+
* `executeProviderOperation`. No cache lookup, no fallback Provider.
|
|
112
|
+
*/
|
|
113
|
+
function runVision(request, deps) {
|
|
114
|
+
return executeProviderOperation("vision", () => deps.capability.invoke(request), {
|
|
115
|
+
sleep: deps.sleep,
|
|
116
|
+
random: deps.random,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
export async function analyze(imageSource, prompt, deps, context) {
|
|
120
|
+
void context;
|
|
121
|
+
if (!imageSource) {
|
|
122
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision analyze <image> [prompt]");
|
|
123
|
+
}
|
|
124
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.analyze;
|
|
125
|
+
const result = await runVision({ operation: "interpret-image", source: imageSource, instruction }, deps);
|
|
126
|
+
return { kind: "data", data: result };
|
|
127
|
+
}
|
|
128
|
+
export async function uiToCode(imageSource, prompt, outputType, deps, context) {
|
|
129
|
+
void context;
|
|
130
|
+
if (!imageSource) {
|
|
131
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision ui-to-code <image> [prompt]");
|
|
132
|
+
}
|
|
133
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.uiToCode;
|
|
134
|
+
const result = await runVision({
|
|
135
|
+
operation: "ui-artifact",
|
|
136
|
+
source: imageSource,
|
|
137
|
+
instruction,
|
|
138
|
+
outputType: outputType ?? "code",
|
|
139
|
+
}, deps);
|
|
140
|
+
return { kind: "data", data: result };
|
|
141
|
+
}
|
|
142
|
+
export async function extractText(imageSource, prompt, language, deps, context) {
|
|
143
|
+
void context;
|
|
144
|
+
if (!imageSource) {
|
|
145
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision extract-text <image> [prompt] [--language <lang>]");
|
|
146
|
+
}
|
|
147
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.extractText;
|
|
148
|
+
const result = await runVision({
|
|
149
|
+
operation: "extract-text",
|
|
150
|
+
source: imageSource,
|
|
151
|
+
instruction,
|
|
152
|
+
programmingLanguage: language,
|
|
153
|
+
}, deps);
|
|
154
|
+
return { kind: "data", data: result };
|
|
155
|
+
}
|
|
156
|
+
export async function diagnoseError(imageSource, prompt, contextFlag, deps, context) {
|
|
157
|
+
void context;
|
|
158
|
+
if (!imageSource) {
|
|
159
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision diagnose-error <image> [prompt] [--context <ctx>]");
|
|
160
|
+
}
|
|
161
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.diagnoseError;
|
|
162
|
+
const result = await runVision({
|
|
163
|
+
operation: "diagnose-error",
|
|
164
|
+
source: imageSource,
|
|
165
|
+
instruction,
|
|
166
|
+
context: contextFlag,
|
|
167
|
+
}, deps);
|
|
168
|
+
return { kind: "data", data: result };
|
|
169
|
+
}
|
|
170
|
+
export async function diagram(imageSource, prompt, diagramType, deps, context) {
|
|
171
|
+
void context;
|
|
172
|
+
if (!imageSource) {
|
|
173
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision diagram <image> [prompt] [--type <type>]");
|
|
174
|
+
}
|
|
175
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.diagram;
|
|
176
|
+
const result = await runVision({
|
|
177
|
+
operation: "diagram",
|
|
178
|
+
source: imageSource,
|
|
179
|
+
instruction,
|
|
180
|
+
diagramType,
|
|
181
|
+
}, deps);
|
|
182
|
+
return { kind: "data", data: result };
|
|
183
|
+
}
|
|
184
|
+
export async function chart(imageSource, prompt, focus, deps, context) {
|
|
185
|
+
void context;
|
|
186
|
+
if (!imageSource) {
|
|
187
|
+
throw new ValidationError("Missing image source", "Usage: scoutline vision chart <image> [prompt] [--focus <focus>]");
|
|
188
|
+
}
|
|
189
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.chart;
|
|
190
|
+
const result = await runVision({
|
|
191
|
+
operation: "chart",
|
|
192
|
+
source: imageSource,
|
|
193
|
+
instruction,
|
|
194
|
+
focus,
|
|
195
|
+
}, deps);
|
|
196
|
+
return { kind: "data", data: result };
|
|
197
|
+
}
|
|
198
|
+
export async function diff(expectedSource, actualSource, prompt, deps, context) {
|
|
199
|
+
void context;
|
|
200
|
+
if (!expectedSource || !actualSource) {
|
|
201
|
+
throw new ValidationError("Missing image sources", "Usage: scoutline vision diff <expected> <actual> [prompt]");
|
|
202
|
+
}
|
|
203
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.diff;
|
|
204
|
+
const result = await runVision({
|
|
205
|
+
operation: "diff",
|
|
206
|
+
expectedSource,
|
|
207
|
+
actualSource,
|
|
208
|
+
instruction,
|
|
209
|
+
}, deps);
|
|
210
|
+
return { kind: "data", data: result };
|
|
211
|
+
}
|
|
212
|
+
export async function video(videoSource, prompt, deps, context) {
|
|
213
|
+
void context;
|
|
214
|
+
if (!videoSource) {
|
|
215
|
+
throw new ValidationError("Missing video source", "Usage: scoutline vision video <video> [prompt]");
|
|
216
|
+
}
|
|
217
|
+
const instruction = prompt ?? DEFAULT_PROMPTS.video;
|
|
218
|
+
const result = await runVision({ operation: "video", source: videoSource, instruction }, deps);
|
|
219
|
+
return { kind: "data", data: result };
|
|
220
|
+
}
|
|
168
221
|
//# sourceMappingURL=vision.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vision.js","sourceRoot":"","sources":["../../src/commands/vision.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vision.js","sourceRoot":"","sources":["../../src/commands/vision.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,iCAAiC,EAC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AC,cAAc,IAAI,CAAC,YAAY,EAAE,CAAC;QACrC,MAAM,IAAI,eAAe,CACvB,uBAAuB,EACvB,2DAA2D,CAC5D,CAAC;IACJ,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,IAAI,eAAe,CAAC,IAAI,CAAC;IACnD,MAAM,MAAM,GAAG,MAAM,SAAS,CAC5B;QACE,SAAS,EAAE,MAAM;QACjB,cAAc;QACd,YAAY;QACZ,WAAW;KACZ,EACD,IAAI,CACL,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CACzB,WAAmB,EACnB,MAAc,EACd,IAAiC,EACjC,OAAwB;IAExB,KAAK,OAAO,CAAC;IACb,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,eAAe,CACvB,sBAAsB,EACtB,gDAAgD,CACjD,CAAC;IACJ,CAAC;IACD,MAAM,WAAW,GAAG,MAAM,IAAI,eAAe,CAAC,KAAK,CAAC;IACpD,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/F,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* scoutline - CLI for Z.AI capabilities
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import { type CommandInvocationAdapter } from "./command-invocation.js";
|
|
5
|
+
import { type ResponseCache } from "./lib/cache.js";
|
|
6
|
+
import type { ProviderDescriptor } from "./providers/types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Parse and validate the `--count` flag value (Fixup C — B11, Fixup D). Per
|
|
9
|
+
* DESIGN.md §7, count must be a safe integer >= 0. Invalid values (NaN,
|
|
10
|
+
* negative, non-integer, Infinity, values above Number.MAX_SAFE_INTEGER)
|
|
11
|
+
* throw `ValidationError` BEFORE any Provider resolution or invocation.
|
|
12
|
+
*
|
|
13
|
+
* Fixup D hardens two gaps:
|
|
14
|
+
* - `--count` without a value parses to `true`; that is a user error,
|
|
15
|
+
* not an absent flag, and now throws VALIDATION_ERROR instead of being
|
|
16
|
+
* silently treated as absent.
|
|
17
|
+
* - Uses `Number.isSafeInteger` instead of `Number.isFinite` +
|
|
18
|
+
* `Number.isInteger` so values above 2^53-1 are rejected rather than
|
|
19
|
+
* silently rounded.
|
|
20
|
+
*
|
|
21
|
+
* Exported for testing so the validation can be exercised without going
|
|
22
|
+
* through the CLI parser (which does not deliver negative numbers as flag
|
|
23
|
+
* values today).
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseAndValidateCount(raw: unknown): number | undefined;
|
|
26
|
+
export interface MainDependencies {
|
|
27
|
+
readonly invocation: CommandInvocationAdapter;
|
|
28
|
+
readonly env: NodeJS.ProcessEnv;
|
|
29
|
+
readonly now?: () => number;
|
|
30
|
+
/**
|
|
31
|
+
* Injectable Provider registry. Production defaults to the static
|
|
32
|
+
* built-in descriptors; tests pass doubles to route Search through a
|
|
33
|
+
* fake Adapter without touching real transports.
|
|
34
|
+
*/
|
|
35
|
+
readonly providerDescriptors?: readonly ProviderDescriptor[];
|
|
36
|
+
/**
|
|
37
|
+
* Injectable shared-Search execution dependencies. Production defaults
|
|
38
|
+
* to the on-disk cache and real sleep/random; tests inject in-memory
|
|
39
|
+
* doubles for deterministic, offline behaviour.
|
|
40
|
+
*/
|
|
41
|
+
readonly searchCache?: ResponseCache;
|
|
42
|
+
readonly searchSleep?: (ms: number) => Promise<void>;
|
|
43
|
+
readonly searchRandom?: () => number;
|
|
44
|
+
}
|
|
45
|
+
export declare function main(args: readonly string[], dependencies: MainDependencies): Promise<number>;
|
|
5
46
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AA0BH,OAAO,EAAiB,KAAK,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAI1E,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,sBAAsB,CAAC;AA8X3E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAuBtE;AA6cD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC9C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,MAAM,CAAC;CACtC;AAID,wBAAsB,IAAI,CACxB,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,YAAY,EAAE,gBAAgB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAuGjB"}
|