vigthoria-cli 1.13.18 → 1.13.22
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/completions/_vigthoria +49 -0
- package/completions/vigthoria.bash +6 -0
- package/completions/vigthoria.fish +41 -0
- package/dist/commands/auth.d.ts +1 -0
- package/dist/commands/auth.js +84 -135
- package/dist/commands/background.d.ts +0 -2
- package/dist/commands/background.js +26 -34
- package/dist/commands/bridge.js +45 -41
- package/dist/commands/cancel.d.ts +1 -0
- package/dist/commands/cancel.js +22 -16
- package/dist/commands/chat.d.ts +5 -42
- package/dist/commands/chat.js +462 -1122
- package/dist/commands/coding-registration.d.ts +4 -0
- package/dist/commands/coding-registration.js +24 -0
- package/dist/commands/config.js +32 -42
- package/dist/commands/conversation-registration.d.ts +4 -0
- package/dist/commands/conversation-registration.js +122 -0
- package/dist/commands/deploy.d.ts +8 -2
- package/dist/commands/deploy.js +92 -90
- package/dist/commands/device.d.ts +1 -2
- package/dist/commands/device.js +37 -21
- package/dist/commands/doctor-registration.d.ts +4 -0
- package/dist/commands/doctor-registration.js +200 -0
- package/dist/commands/edit.js +22 -33
- package/dist/commands/explain.js +7 -10
- package/dist/commands/fork.d.ts +1 -2
- package/dist/commands/fork.js +72 -22
- package/dist/commands/game.d.ts +1 -1
- package/dist/commands/game.js +17 -6
- package/dist/commands/generate.js +7 -9
- package/dist/commands/history.js +11 -7
- package/dist/commands/hub.d.ts +2 -2
- package/dist/commands/hub.js +34 -35
- package/dist/commands/legion.d.ts +0 -1
- package/dist/commands/legion.js +62 -79
- package/dist/commands/music.d.ts +1 -2
- package/dist/commands/music.js +62 -27
- package/dist/commands/platform-registration.d.ts +4 -0
- package/dist/commands/platform-registration.js +45 -0
- package/dist/commands/preview.d.ts +0 -1
- package/dist/commands/preview.js +82 -35
- package/dist/commands/product-run-registration.d.ts +4 -0
- package/dist/commands/product-run-registration.js +490 -0
- package/dist/commands/replay.d.ts +1 -2
- package/dist/commands/replay.js +15 -11
- package/dist/commands/repo.d.ts +14 -7
- package/dist/commands/repo.js +245 -196
- package/dist/commands/review.js +9 -12
- package/dist/commands/security.d.ts +1 -2
- package/dist/commands/security.js +12 -6
- package/dist/commands/update-registration.d.ts +3 -0
- package/dist/commands/update-registration.js +338 -0
- package/dist/commands/v4-registration.d.ts +4 -0
- package/dist/commands/v4-registration.js +24 -0
- package/dist/commands/v4.d.ts +1 -1
- package/dist/commands/v4.js +46 -8
- package/dist/commands/wallet.d.ts +1 -3
- package/dist/commands/wallet.js +18 -45
- package/dist/commands/workflow.d.ts +2 -0
- package/dist/commands/workflow.js +52 -39
- package/dist/index.js +122 -1498
- package/dist/utils/agent-stream-state.d.ts +27 -0
- package/dist/utils/agent-stream-state.js +93 -0
- package/dist/utils/agentRoute.d.ts +2 -1
- package/dist/utils/agentRoute.js +22 -9
- package/dist/utils/agentRunOutcome.d.ts +16 -0
- package/dist/utils/agentRunOutcome.js +37 -2
- package/dist/utils/api-client-factory.d.ts +8 -0
- package/dist/utils/api-client-factory.js +8 -0
- package/dist/utils/api.d.ts +45 -269
- package/dist/utils/api.js +664 -3210
- package/dist/utils/auth-session.d.ts +41 -0
- package/dist/utils/auth-session.js +224 -0
- package/dist/utils/brain-hub-client.d.ts +0 -4
- package/dist/utils/brain-hub-client.js +6 -3
- package/dist/utils/bridge-client.js +2 -0
- package/dist/utils/capability-health-service.d.ts +48 -0
- package/dist/utils/capability-health-service.js +64 -0
- package/dist/utils/chat-prompt-policy.d.ts +18 -0
- package/dist/utils/chat-prompt-policy.js +61 -0
- package/dist/utils/chat-tool-call-parser.d.ts +11 -0
- package/dist/utils/chat-tool-call-parser.js +71 -0
- package/dist/utils/cli-state.d.ts +22 -4
- package/dist/utils/cli-state.js +105 -47
- package/dist/utils/code-operations-service.d.ts +104 -0
- package/dist/utils/code-operations-service.js +837 -0
- package/dist/utils/codebase-indexer.d.ts +1 -0
- package/dist/utils/codebase-indexer.js +28 -8
- package/dist/utils/command-contract.d.ts +61 -0
- package/dist/utils/command-contract.js +149 -0
- package/dist/utils/command-policy.d.ts +10 -0
- package/dist/utils/command-policy.js +54 -0
- package/dist/utils/config.d.ts +13 -5
- package/dist/utils/config.js +227 -99
- package/dist/utils/context-ranker.js +11 -2
- package/dist/utils/context-state.d.ts +39 -0
- package/dist/utils/context-state.js +52 -0
- package/dist/utils/deckEvents.d.ts +0 -5
- package/dist/utils/deckEvents.js +3 -2
- package/dist/utils/desktop-bridge-client.js +2 -0
- package/dist/utils/direct-output-policy.d.ts +3 -0
- package/dist/utils/direct-output-policy.js +76 -0
- package/dist/utils/durable-json.d.ts +57 -0
- package/dist/utils/durable-json.js +319 -0
- package/dist/utils/fastAgentRouter.d.ts +6 -7
- package/dist/utils/fastAgentRouter.js +21 -30
- package/dist/utils/files.js +21 -13
- package/dist/utils/frontend-preview-service.d.ts +76 -0
- package/dist/utils/frontend-preview-service.js +482 -0
- package/dist/utils/goaEvents.d.ts +0 -4
- package/dist/utils/goaEvents.js +5 -2
- package/dist/utils/logger.d.ts +2 -1
- package/dist/utils/logger.js +27 -20
- package/dist/utils/mcp-context-client.d.ts +24 -0
- package/dist/utils/mcp-context-client.js +58 -0
- package/dist/utils/model-governance.d.ts +18 -0
- package/dist/utils/model-governance.js +75 -0
- package/dist/utils/model-transport-service.d.ts +44 -0
- package/dist/utils/model-transport-service.js +111 -0
- package/dist/utils/mutation-journal.d.ts +42 -0
- package/dist/utils/mutation-journal.js +387 -0
- package/dist/utils/network-policy.d.ts +24 -0
- package/dist/utils/network-policy.js +202 -0
- package/dist/utils/operator-client.d.ts +45 -0
- package/dist/utils/operator-client.js +159 -0
- package/dist/utils/post-write-validator.js +7 -9
- package/dist/utils/preview-screenshot-adapter.d.ts +13 -0
- package/dist/utils/preview-screenshot-adapter.js +36 -0
- package/dist/utils/process-policy.d.ts +23 -0
- package/dist/utils/process-policy.js +284 -0
- package/dist/utils/project-memory.d.ts +13 -3
- package/dist/utils/project-memory.js +70 -17
- package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
- package/dist/utils/prompt-workspace-resolver.js +64 -0
- package/dist/utils/release-install.d.ts +11 -0
- package/dist/utils/release-install.js +155 -0
- package/dist/utils/release-policy.d.ts +64 -0
- package/dist/utils/release-policy.js +293 -0
- package/dist/utils/requestIntent.js +22 -3
- package/dist/utils/runtime-capability.d.ts +8 -0
- package/dist/utils/runtime-capability.js +16 -0
- package/dist/utils/secret-policy.d.ts +20 -0
- package/dist/utils/secret-policy.js +160 -0
- package/dist/utils/session.d.ts +34 -2
- package/dist/utils/session.js +354 -110
- package/dist/utils/tool-approval-service.d.ts +17 -0
- package/dist/utils/tool-approval-service.js +78 -0
- package/dist/utils/tool-capability-providers.d.ts +57 -0
- package/dist/utils/tool-capability-providers.js +57 -0
- package/dist/utils/tools.d.ts +2 -23
- package/dist/utils/tools.js +216 -508
- package/dist/utils/update-policy.d.ts +18 -0
- package/dist/utils/update-policy.js +137 -0
- package/dist/utils/v3-agent-client.d.ts +40 -0
- package/dist/utils/v3-agent-client.js +165 -0
- package/dist/utils/v3-workspace-service.d.ts +28 -0
- package/dist/utils/v3-workspace-service.js +279 -0
- package/dist/utils/vigflow-client.d.ts +95 -0
- package/dist/utils/vigflow-client.js +105 -0
- package/dist/utils/workspace-boundary.d.ts +45 -0
- package/dist/utils/workspace-boundary.js +377 -0
- package/dist/utils/workspace-brain-service.d.ts +2 -0
- package/dist/utils/workspace-brain-service.js +11 -1
- package/dist/utils/workspace-cache.js +37 -15
- package/dist/utils/workspace-stream.js +35 -10
- package/install.ps1 +86 -143
- package/install.sh +76 -81
- package/package.json +44 -9
- package/release-policy.json +43 -0
- package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
- package/scripts/release/generate-completions.mjs +24 -0
- package/scripts/release/install-release.mjs +10 -0
- package/scripts/release/publish-cli-release.mjs +116 -0
- package/scripts/release/publish-cli-release.sh +2 -70
- package/scripts/release/resolve-release-manifest.mjs +26 -0
- package/scripts/release/test-balanced-model-live.sh +42 -0
- package/scripts/release/validate-live-service-gates.sh +90 -0
- package/scripts/release/validate-no-go-gates.sh +135 -172
- package/scripts/release/verify-runtime-consistency.mjs +4 -1
- package/dist/commands/index.d.ts +0 -12
- package/dist/commands/index.js +0 -194
- package/dist/commands/update.d.ts +0 -9
- package/dist/commands/update.js +0 -301
- package/dist/utils/templateInstantPath.d.ts +0 -18
- package/dist/utils/templateInstantPath.js +0 -228
package/dist/utils/api.d.ts
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Config } from './config.js';
|
|
6
6
|
import { Logger } from './logger.js';
|
|
7
|
+
import { type PreviewScreenshotPort } from './preview-screenshot-adapter.js';
|
|
8
|
+
import { type OperatorWorkflowResponse } from './operator-client.js';
|
|
9
|
+
import { type FrontendPreviewGateResult } from './frontend-preview-service.js';
|
|
10
|
+
import { type APIHealthStatus, type CapabilityTruthStatus, type EndpointHealthStatus } from './capability-health-service.js';
|
|
11
|
+
import { type ChatMessage, type ChatResponse } from './model-transport-service.js';
|
|
12
|
+
import { type ResolvedVigFlowWorkflowTarget, type VigFlowExecutionResult, type VigFlowExecutionStatus, type VigFlowTemplateSummary, type VigFlowWorkflowCreation, type VigFlowWorkflowSummary } from './vigflow-client.js';
|
|
7
13
|
export type CLIErrorCategory = 'auth' | 'repo_session' | 'model_backend' | 'bridge' | 'network' | 'timeout' | 'parsing' | 'tool_execution' | 'credits';
|
|
8
14
|
export declare const VIGTHORIA_HUB_CREDITS_URL = "https://hub.vigthoria.io/credits";
|
|
9
15
|
export declare const VIGTHORIA_SERVER_TEMPORARILY_UNAVAILABLE_MESSAGE = "Vigthoria Server is temporarily not available. Please try again later. If the issue persists, please contact support.";
|
|
@@ -21,6 +27,9 @@ export type ChatRequestOptions = {
|
|
|
21
27
|
onRouteAttempt?: (routeLabel: string) => void;
|
|
22
28
|
onStreamDelta?: (chunk: string) => void;
|
|
23
29
|
};
|
|
30
|
+
export interface APIClientDependencies {
|
|
31
|
+
screenshotAdapter?: PreviewScreenshotPort;
|
|
32
|
+
}
|
|
24
33
|
export declare class CLIError extends Error {
|
|
25
34
|
category: CLIErrorCategory;
|
|
26
35
|
statusCode?: number;
|
|
@@ -43,23 +52,9 @@ export declare function classifyError(error: unknown, fallbackCategory?: CLIErro
|
|
|
43
52
|
export declare function formatCLIError(err: CLIError): string;
|
|
44
53
|
export declare function sanitizeUserFacingPathText(input: string): string;
|
|
45
54
|
export declare function sanitizeUserFacingErrorText(input: string): string;
|
|
46
|
-
export declare function isServerRuntime(): boolean;
|
|
47
55
|
export declare function describeUpstreamStatus(status: number): string;
|
|
48
56
|
export declare function propagateError(err: any): never;
|
|
49
|
-
export
|
|
50
|
-
role: 'user' | 'assistant' | 'system';
|
|
51
|
-
content: string;
|
|
52
|
-
}
|
|
53
|
-
export interface ChatResponse {
|
|
54
|
-
id: string;
|
|
55
|
-
message: string;
|
|
56
|
-
model: string;
|
|
57
|
-
usage?: {
|
|
58
|
-
prompt_tokens: number;
|
|
59
|
-
completion_tokens: number;
|
|
60
|
-
total_tokens: number;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
57
|
+
export type { ChatMessage, ChatResponse } from './model-transport-service.js';
|
|
63
58
|
export interface V3AgentWorkflowResponse {
|
|
64
59
|
content: string;
|
|
65
60
|
taskId: string | null;
|
|
@@ -69,135 +64,10 @@ export interface V3AgentWorkflowResponse {
|
|
|
69
64
|
metadata?: Record<string, unknown>;
|
|
70
65
|
changedFiles?: Record<string, string>;
|
|
71
66
|
}
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
entryPath?: string;
|
|
77
|
-
assetPaths?: {
|
|
78
|
-
css: string[];
|
|
79
|
-
js: string[];
|
|
80
|
-
};
|
|
81
|
-
artifacts?: {
|
|
82
|
-
manifestPath?: string;
|
|
83
|
-
screenshotPath?: string;
|
|
84
|
-
previewFileUrl?: string;
|
|
85
|
-
screenshotCaptured?: boolean;
|
|
86
|
-
screenshotError?: string;
|
|
87
|
-
};
|
|
88
|
-
modes?: {
|
|
89
|
-
design?: {
|
|
90
|
-
ready: boolean;
|
|
91
|
-
devices?: string[];
|
|
92
|
-
variantCount?: number;
|
|
93
|
-
};
|
|
94
|
-
live?: {
|
|
95
|
-
ready: boolean;
|
|
96
|
-
entryPoint?: string;
|
|
97
|
-
};
|
|
98
|
-
production?: {
|
|
99
|
-
ready: boolean;
|
|
100
|
-
deploymentTarget?: string;
|
|
101
|
-
recommendedCommand?: string;
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
summary?: Record<string, unknown>;
|
|
105
|
-
processingTimeMs?: number;
|
|
106
|
-
error?: string;
|
|
107
|
-
}
|
|
108
|
-
export interface OperatorWorkflowResponse {
|
|
109
|
-
content: string;
|
|
110
|
-
workflowId: string | null;
|
|
111
|
-
contextId?: string | null;
|
|
112
|
-
backendUrl: string;
|
|
113
|
-
savedWorkflow?: {
|
|
114
|
-
id: string;
|
|
115
|
-
name?: string | null;
|
|
116
|
-
sourceWorkflowId?: string | null;
|
|
117
|
-
} | null;
|
|
118
|
-
metadata?: Record<string, unknown>;
|
|
119
|
-
changedFiles?: Record<string, string>;
|
|
120
|
-
}
|
|
121
|
-
export interface StreamChunk {
|
|
122
|
-
type: 'content' | 'done' | 'error';
|
|
123
|
-
content?: string;
|
|
124
|
-
error?: string;
|
|
125
|
-
}
|
|
126
|
-
export interface EndpointHealthStatus {
|
|
127
|
-
name: string;
|
|
128
|
-
endpoint: string;
|
|
129
|
-
ok: boolean;
|
|
130
|
-
error?: string;
|
|
131
|
-
details?: Record<string, unknown>;
|
|
132
|
-
}
|
|
133
|
-
export interface APIHealthStatus {
|
|
134
|
-
overallOk: boolean;
|
|
135
|
-
coder: EndpointHealthStatus;
|
|
136
|
-
models: EndpointHealthStatus;
|
|
137
|
-
selfHosted: EndpointHealthStatus | null;
|
|
138
|
-
}
|
|
139
|
-
export interface CapabilityTruthStatus {
|
|
140
|
-
overallOk: boolean;
|
|
141
|
-
v3Agent: EndpointHealthStatus;
|
|
142
|
-
hyperLoop: EndpointHealthStatus;
|
|
143
|
-
repoMemory: EndpointHealthStatus;
|
|
144
|
-
devtoolsBridge: EndpointHealthStatus;
|
|
145
|
-
}
|
|
146
|
-
export interface VigFlowTemplateSummary {
|
|
147
|
-
id: string;
|
|
148
|
-
name: string;
|
|
149
|
-
description: string;
|
|
150
|
-
category: string;
|
|
151
|
-
icon?: string;
|
|
152
|
-
tags: string[];
|
|
153
|
-
isBuiltin: boolean;
|
|
154
|
-
source: string;
|
|
155
|
-
createdAt?: string;
|
|
156
|
-
}
|
|
157
|
-
export interface VigFlowWorkflowSummary {
|
|
158
|
-
id: string;
|
|
159
|
-
name: string;
|
|
160
|
-
description: string;
|
|
161
|
-
isActive: boolean;
|
|
162
|
-
version: string;
|
|
163
|
-
tags: string[];
|
|
164
|
-
nodeCount: number;
|
|
165
|
-
executionCount: number;
|
|
166
|
-
lastExecutedAt?: string;
|
|
167
|
-
createdAt?: string;
|
|
168
|
-
updatedAt?: string;
|
|
169
|
-
}
|
|
170
|
-
export interface VigFlowWorkflowCreation {
|
|
171
|
-
id: string;
|
|
172
|
-
name: string;
|
|
173
|
-
fromTemplate?: string;
|
|
174
|
-
}
|
|
175
|
-
export interface ResolvedVigFlowWorkflowTarget {
|
|
176
|
-
id: string;
|
|
177
|
-
name: string;
|
|
178
|
-
selector: string;
|
|
179
|
-
matchedBy: 'id' | 'name' | 'search';
|
|
180
|
-
}
|
|
181
|
-
export interface VigFlowExecutionResult {
|
|
182
|
-
executionId: string;
|
|
183
|
-
status: string;
|
|
184
|
-
result?: unknown;
|
|
185
|
-
error?: string;
|
|
186
|
-
nodesExecuted?: number;
|
|
187
|
-
}
|
|
188
|
-
export interface VigFlowExecutionStatus {
|
|
189
|
-
id: string;
|
|
190
|
-
workflowId: string;
|
|
191
|
-
status: string;
|
|
192
|
-
startedAt?: string;
|
|
193
|
-
completedAt?: string;
|
|
194
|
-
nodesExecuted?: number;
|
|
195
|
-
totalNodes?: number;
|
|
196
|
-
result?: unknown;
|
|
197
|
-
error?: string;
|
|
198
|
-
progress?: Record<string, unknown>;
|
|
199
|
-
duration?: number;
|
|
200
|
-
}
|
|
67
|
+
export type { FrontendPreviewGateResult } from './frontend-preview-service.js';
|
|
68
|
+
export type { OperatorWorkflowResponse } from './operator-client.js';
|
|
69
|
+
export type { APIHealthStatus, CapabilityTruthStatus, EndpointHealthStatus } from './capability-health-service.js';
|
|
70
|
+
export type { ResolvedVigFlowWorkflowTarget, VigFlowExecutionResult, VigFlowExecutionStatus, VigFlowTemplateSummary, VigFlowWorkflowCreation, VigFlowWorkflowSummary, } from './vigflow-client.js';
|
|
201
71
|
export interface VigthoriUser {
|
|
202
72
|
id: string;
|
|
203
73
|
username: string;
|
|
@@ -219,17 +89,29 @@ export declare class APIClient {
|
|
|
219
89
|
private modelRouterClient;
|
|
220
90
|
private selfHostedModelRouterClient;
|
|
221
91
|
private config;
|
|
92
|
+
private authSession;
|
|
93
|
+
private unsubscribeAuthInvalidation;
|
|
222
94
|
private logger;
|
|
223
|
-
private
|
|
224
|
-
private
|
|
95
|
+
private readonly modelGovernance;
|
|
96
|
+
private readonly codeOperations;
|
|
97
|
+
private readonly mcpContextClient;
|
|
98
|
+
private readonly v3AgentClient;
|
|
99
|
+
private readonly v3WorkspaceService;
|
|
100
|
+
private readonly capabilityHealthService;
|
|
101
|
+
private readonly modelTransportService;
|
|
102
|
+
private readonly operatorClient;
|
|
103
|
+
private readonly vigFlowClient;
|
|
225
104
|
private _httpsAgent;
|
|
226
105
|
private lastChatTransportErrors;
|
|
227
106
|
private clientToolErrors;
|
|
228
107
|
private pendingV3ClientToolTasks;
|
|
229
108
|
/** Tracks files mutated via client_tool_request during an active V3 SSE stream. */
|
|
230
109
|
private activeV3StreamedFiles;
|
|
231
|
-
private
|
|
232
|
-
|
|
110
|
+
private lifecycleAbortController;
|
|
111
|
+
private readonly frontendPreviewService;
|
|
112
|
+
private withLifecycleSignal;
|
|
113
|
+
private fetch;
|
|
114
|
+
constructor(config: Config, logger: Logger, dependencies?: APIClientDependencies);
|
|
233
115
|
/**
|
|
234
116
|
* Destroy keep-alive sockets so the Node.js event loop can drain
|
|
235
117
|
* naturally. Call this before exiting commands that run HTTP probes
|
|
@@ -241,7 +123,6 @@ export declare class APIClient {
|
|
|
241
123
|
getSelfHostedModelsApiUrl(): string | null;
|
|
242
124
|
login(email: string, password: string): Promise<boolean>;
|
|
243
125
|
loginWithToken(token: string): Promise<boolean>;
|
|
244
|
-
private extractUserProfile;
|
|
245
126
|
private refreshToken;
|
|
246
127
|
getSubscriptionStatus(): Promise<void>;
|
|
247
128
|
private getAccessToken;
|
|
@@ -263,54 +144,14 @@ export declare class APIClient {
|
|
|
263
144
|
getV3AgentBackgroundUrl(baseUrl: string, suffix?: string): string;
|
|
264
145
|
getV3AgentApprovalUrl(baseUrl: string): string;
|
|
265
146
|
getOperatorBaseUrls(): string[];
|
|
266
|
-
getOperatorStreamUrl(baseUrl: string): string;
|
|
267
147
|
getMcpBaseUrls(): string[];
|
|
268
148
|
getVigFlowBaseUrls(): string[];
|
|
269
149
|
getTemplateServiceBaseUrls(): string[];
|
|
270
|
-
private isFrontendTask;
|
|
271
|
-
/**
|
|
272
|
-
* Returns true when the prompt describes a read-only / analysis task.
|
|
273
|
-
* Used to suppress preview gate and other write-oriented side effects.
|
|
274
|
-
*/
|
|
275
150
|
isAnalysisOnlyTask(message?: string, context?: Record<string, any>): boolean;
|
|
151
|
+
runTemplateServicePreviewGate(message?: string, context?: Record<string, any>): Promise<FrontendPreviewGateResult>;
|
|
276
152
|
private normalizeWorkspaceRelativePath;
|
|
277
153
|
private collectAgentStateSyncPaths;
|
|
278
|
-
private listFrontendWorkspaceFiles;
|
|
279
|
-
private chooseFrontendPreviewEntry;
|
|
280
154
|
private extractLinkedFrontendAssets;
|
|
281
|
-
private buildFrontendForPreview;
|
|
282
|
-
private gatherFrontendPreviewArtifacts;
|
|
283
|
-
private captureFrontendPreviewScreenshot;
|
|
284
|
-
private evaluateFrontendVisualProof;
|
|
285
|
-
private persistFrontendPreviewArtifacts;
|
|
286
|
-
runTemplateServicePreviewGate(message?: string, context?: Record<string, any>): Promise<FrontendPreviewGateResult>;
|
|
287
|
-
private getMcpContextCreateUrl;
|
|
288
|
-
private getMcpContextUrl;
|
|
289
|
-
private getMcpHeaders;
|
|
290
|
-
getV3AgentHeaders(): Promise<Record<string, string>>;
|
|
291
|
-
/**
|
|
292
|
-
* Ensure the V3 service key is available in config.
|
|
293
|
-
* If not already set via env or stored config, fetches it from the Coder API
|
|
294
|
-
* using the current user's auth token and caches it for this session and beyond.
|
|
295
|
-
*/
|
|
296
|
-
ensureV3ServiceKey(): Promise<void>;
|
|
297
|
-
runV3HealthCheck(): Promise<{
|
|
298
|
-
healthy: boolean;
|
|
299
|
-
endpoint: string;
|
|
300
|
-
error?: string;
|
|
301
|
-
}>;
|
|
302
|
-
private runV3AgentAuthPreflight;
|
|
303
|
-
private executeV3AgentRunRequest;
|
|
304
|
-
private getVigFlowAccessToken;
|
|
305
|
-
private getVigFlowHeaders;
|
|
306
|
-
private withVigFlow;
|
|
307
|
-
/**
|
|
308
|
-
* Build the correct sub-path for VigFlow endpoints.
|
|
309
|
-
* Local servers (e.g. localhost:5060) need `/api/…` prefix.
|
|
310
|
-
* The remote gateway URL already ends with `/api/vigflow`, so appending
|
|
311
|
-
* another `/api/…` would double the prefix and cause 404s.
|
|
312
|
-
*/
|
|
313
|
-
private vigFlowEndpoint;
|
|
314
155
|
listVigFlowTemplates(options?: {
|
|
315
156
|
category?: string;
|
|
316
157
|
search?: string;
|
|
@@ -326,8 +167,15 @@ export declare class APIClient {
|
|
|
326
167
|
executionOptions?: Record<string, unknown>;
|
|
327
168
|
}): Promise<VigFlowExecutionResult>;
|
|
328
169
|
getVigFlowExecutionStatus(executionId: string): Promise<VigFlowExecutionStatus>;
|
|
329
|
-
|
|
330
|
-
|
|
170
|
+
getV3AgentHeaders(): Promise<Record<string, string>>;
|
|
171
|
+
ensureV3ServiceKey(): Promise<void>;
|
|
172
|
+
runV3HealthCheck(): Promise<{
|
|
173
|
+
healthy: boolean;
|
|
174
|
+
endpoint: string;
|
|
175
|
+
error?: string;
|
|
176
|
+
}>;
|
|
177
|
+
private runV3AgentAuthPreflight;
|
|
178
|
+
private executeV3AgentRunRequest;
|
|
331
179
|
private static readonly HYDRATION_PRIORITY_BASENAMES;
|
|
332
180
|
/** Keep critical workspace files for server hydration when context must shrink. */
|
|
333
181
|
private compactWorkspaceFilesToBudget;
|
|
@@ -342,8 +190,8 @@ export declare class APIClient {
|
|
|
342
190
|
* 5. Drop readmeExcerpt
|
|
343
191
|
*/
|
|
344
192
|
private compactV3Context;
|
|
345
|
-
/**
|
|
346
|
-
private
|
|
193
|
+
/** Remove server-side workspace aliases before delegated local execution. */
|
|
194
|
+
private normalizePortableRunCommand;
|
|
347
195
|
private resolveRunCommandCwd;
|
|
348
196
|
/** Remove duplicate functionIndex entries that poison model context after compaction. */
|
|
349
197
|
private dedupeBrainPayload;
|
|
@@ -362,8 +210,7 @@ export declare class APIClient {
|
|
|
362
210
|
private buildLocalWorkspaceSummary;
|
|
363
211
|
/**
|
|
364
212
|
* Build complete workspace hydration separately from model context.
|
|
365
|
-
*
|
|
366
|
-
* locally; context compaction must never become filesystem compaction.
|
|
213
|
+
* Context compaction must not become filesystem compaction.
|
|
367
214
|
*/
|
|
368
215
|
private buildOutOfBandWorkspaceFiles;
|
|
369
216
|
/**
|
|
@@ -386,7 +233,6 @@ export declare class APIClient {
|
|
|
386
233
|
private executeV3ClientToolRequest;
|
|
387
234
|
private handleV3ClientToolRequest;
|
|
388
235
|
private writeV3AgentWorkspaceFile;
|
|
389
|
-
private deleteV3AgentWorkspaceFile;
|
|
390
236
|
recoverAgentWorkspaceFiles(context?: Record<string, any>, streamedFiles?: Record<string, string>, expectedFiles?: string[]): void;
|
|
391
237
|
normalizeAgentWorkspaceRelativePath(rawPath: string, rootPath?: string): string;
|
|
392
238
|
ensureAgentFrontendPolish(message?: string, context?: Record<string, any>): Promise<void>;
|
|
@@ -417,7 +263,6 @@ export declare class APIClient {
|
|
|
417
263
|
status: string;
|
|
418
264
|
files: Record<string, string>;
|
|
419
265
|
file_count: number;
|
|
420
|
-
confirmed_mutations?: string[];
|
|
421
266
|
local_workspace_path?: string;
|
|
422
267
|
}>;
|
|
423
268
|
applyV3BackgroundJobFiles(jobId: string, context?: Record<string, any>): Promise<{
|
|
@@ -425,7 +270,6 @@ export declare class APIClient {
|
|
|
425
270
|
skipped: string[];
|
|
426
271
|
status: string;
|
|
427
272
|
}>;
|
|
428
|
-
private formatOperatorResponse;
|
|
429
273
|
runOperatorWorkflow(message: string, context?: Record<string, any>): Promise<OperatorWorkflowResponse>;
|
|
430
274
|
/**
|
|
431
275
|
* Chat API - Direct Vigthoria Models API Architecture
|
|
@@ -438,51 +282,10 @@ export declare class APIClient {
|
|
|
438
282
|
*
|
|
439
283
|
* NO localhost fallbacks - CLI is for external users, not server-side!
|
|
440
284
|
*/
|
|
441
|
-
chat(messages: ChatMessage[], model: string,
|
|
442
|
-
private shouldSkipCloudRoutes;
|
|
443
|
-
private tryChatWithModel;
|
|
444
|
-
private trySelfHostedChatWithModel;
|
|
445
|
-
private getFallbackModelId;
|
|
446
|
-
private isCloudModelId;
|
|
447
|
-
private canUseCloudModel;
|
|
285
|
+
chat(messages: ChatMessage[], model: string, _useLocal?: boolean): Promise<ChatResponse>;
|
|
448
286
|
private resolvePermittedModelId;
|
|
449
|
-
private shouldSimulateCloudFailure;
|
|
450
|
-
private shouldTrySelfHostedFallback;
|
|
451
|
-
private isSelfHostedPreferredModel;
|
|
452
|
-
private getSelfHostedFallbackModelId;
|
|
453
|
-
chatStream(messages: ChatMessage[], model: string): AsyncGenerator<StreamChunk>;
|
|
454
|
-
chatWithCallback(messages: ChatMessage[], model: string, onChunk: (chunk: string) => void, onDone: () => void, onError: (error: Error) => void): Promise<void>;
|
|
455
287
|
private chatComplete;
|
|
456
288
|
generateCode(prompt: string, language: string, model: string): Promise<string>;
|
|
457
|
-
/**
|
|
458
|
-
* Ensure code has balanced curly braces by appending missing closing braces.
|
|
459
|
-
*/
|
|
460
|
-
private ensureBalancedBraces;
|
|
461
|
-
/**
|
|
462
|
-
* Quick JS/TS syntax validation using Node's built-in parser.
|
|
463
|
-
* Returns true if the code parses without errors.
|
|
464
|
-
*/
|
|
465
|
-
private validateJsSyntax;
|
|
466
|
-
/**
|
|
467
|
-
* Extract the first complete function/class from code.
|
|
468
|
-
* Used as last-resort when the model keeps over-producing.
|
|
469
|
-
*/
|
|
470
|
-
private extractFirstFunction;
|
|
471
|
-
/**
|
|
472
|
-
* Detect if code is excessively over-engineered for a short prompt.
|
|
473
|
-
* E.g. a "multiply function" request producing 20+ lines.
|
|
474
|
-
*/
|
|
475
|
-
private codeIsOverEngineered;
|
|
476
|
-
/**
|
|
477
|
-
* Detect if generated code contains DOM/HTML pollution inappropriate
|
|
478
|
-
* for a pure programming language like JavaScript, Python, etc.
|
|
479
|
-
*/
|
|
480
|
-
private codeContainsDomPollution;
|
|
481
|
-
/**
|
|
482
|
-
* Strip DOM pollution from generated code, keeping only the pure logic.
|
|
483
|
-
* Used as last-resort fallback when the model repeatedly ignores constraints.
|
|
484
|
-
*/
|
|
485
|
-
private stripDomPollution;
|
|
486
289
|
generateProject(prompt: string, projectType: string, model: string): Promise<{
|
|
487
290
|
code: string;
|
|
488
291
|
plan?: any;
|
|
@@ -509,11 +312,6 @@ export declare class APIClient {
|
|
|
509
312
|
}[];
|
|
510
313
|
suggestions: string[];
|
|
511
314
|
}>;
|
|
512
|
-
/**
|
|
513
|
-
* Lightweight client-side heuristic scan: catches common code smells
|
|
514
|
-
* AND logic/arithmetic bugs so review never returns "score 30, no issues".
|
|
515
|
-
*/
|
|
516
|
-
private heuristicCodeIssues;
|
|
517
315
|
fixCode(code: string, language: string, fixType: string): Promise<{
|
|
518
316
|
fixed: string;
|
|
519
317
|
changes: {
|
|
@@ -523,29 +321,6 @@ export declare class APIClient {
|
|
|
523
321
|
reason: string;
|
|
524
322
|
}[];
|
|
525
323
|
}>;
|
|
526
|
-
/**
|
|
527
|
-
* Compute a semantic diff between original and fixed code using
|
|
528
|
-
* Longest Common Subsequence (LCS) to avoid the line-shift inflation
|
|
529
|
-
* bug where inserting one line flags all subsequent lines as changed.
|
|
530
|
-
*/
|
|
531
|
-
private computeSemanticDiff;
|
|
532
|
-
/**
|
|
533
|
-
* Lightweight client-side syntax error detection.
|
|
534
|
-
* Returns a human-readable description of obvious errors, or empty string.
|
|
535
|
-
*/
|
|
536
|
-
private detectSyntaxErrors;
|
|
537
|
-
/**
|
|
538
|
-
* Strip comment lines that the model added during a fix but were not
|
|
539
|
-
* present in the original code. Used for syntax-only fixes where the
|
|
540
|
-
* model tends to annotate its changes with "// Fixed ..." comments.
|
|
541
|
-
*/
|
|
542
|
-
private stripInjectedComments;
|
|
543
|
-
/**
|
|
544
|
-
* Ensure the fixed code hasn't lost closing delimiters relative to the
|
|
545
|
-
* original. Counts {, }, (, ), [, ] outside strings/comments and if
|
|
546
|
-
* the fix has fewer closers than the original, appends the missing ones.
|
|
547
|
-
*/
|
|
548
|
-
private repairBracketBalance;
|
|
549
324
|
private resolveModelId;
|
|
550
325
|
private getCoderHealth;
|
|
551
326
|
/**
|
|
@@ -589,6 +364,7 @@ export declare class APIClient {
|
|
|
589
364
|
recovered: boolean;
|
|
590
365
|
message: string;
|
|
591
366
|
}>;
|
|
367
|
+
private probeDevtoolsBridgeStatus;
|
|
592
368
|
getDevtoolsBridgeStatus(): Promise<EndpointHealthStatus>;
|
|
593
369
|
getCapabilityTruthStatus(context?: Record<string, any>): Promise<CapabilityTruthStatus>;
|
|
594
370
|
getHealthStatus(): Promise<APIHealthStatus>;
|