stk-codegen 1.0.6 → 1.0.8
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 +0 -0
- package/dist/components/BootstrapStatus.d.ts +5 -1
- package/dist/components/Input.d.ts +6 -1
- package/dist/components/ShellExecution.d.ts +4 -0
- package/dist/config.d.ts +1 -0
- package/dist/core/agent/events.d.ts +5 -1
- package/dist/core/agent/types.d.ts +3 -1
- package/dist/hooks/useAgent.core.d.ts +0 -0
- package/dist/hooks/useAgent.d.ts +13 -2
- package/dist/hooks/useTerminalLayout.d.ts +2 -2
- package/dist/index.js +5 -5
- package/dist/services/clipboardImage.d.ts +24 -0
- package/dist/services/websocketClient.d.ts +10 -3
- package/dist/tools/SearchText.d.ts +2 -12
- package/dist/tools/runShellCommandAsync.d.ts +2 -1
- package/dist/tools/searchTextFallback.d.ts +20 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/ui/agent/buildInkViewModel.d.ts +24 -1
- package/dist/ui/agent/textFormatting.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ClipboardImage {
|
|
2
|
+
base64: string;
|
|
3
|
+
mimeType: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Best-effort helper to read an image from the system clipboard and return it
|
|
7
|
+
* as a base64 string.
|
|
8
|
+
*
|
|
9
|
+
* Strategy on macOS:
|
|
10
|
+
* - First, try `pngpaste` if it is available on the system PATH. This is very
|
|
11
|
+
* robust for typical PNG clipboard contents.
|
|
12
|
+
* - If `pngpaste` is not available or fails, fall back to an AppleScript that
|
|
13
|
+
* writes the clipboard image (PNG/TIFF/JPEG) to a file in a user/project
|
|
14
|
+
* context directory (instead of /tmp), which we then read from Node.
|
|
15
|
+
*
|
|
16
|
+
* Other platforms currently return null (no-op) until we implement proper
|
|
17
|
+
* portable support.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readClipboardImageAsBase64(baseDir?: string): Promise<ClipboardImage | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Best-effort cleanup: remove old clipboard image files created by this
|
|
22
|
+
* service. Files are identified by the `clipboard-` prefix and `maxAgeMs`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function cleanupOldClipboardImages(baseDir?: string, maxAgeMs?: number): Promise<void>;
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { BackendMessage, ClientMessage } from '../types/index.js';
|
|
2
2
|
type MessageHandler = (data: BackendMessage) => void;
|
|
3
|
-
|
|
3
|
+
type StatusChangeHandler = (status: 'connecting' | 'connected' | 'disconnected') => void;
|
|
4
|
+
export declare class WebSocketClient {
|
|
4
5
|
private ws;
|
|
5
6
|
private messageHandler;
|
|
7
|
+
private onStatusChange;
|
|
6
8
|
private sessionId;
|
|
7
9
|
private handshakeSent;
|
|
8
10
|
private isConnecting;
|
|
9
11
|
private connectionPromise;
|
|
12
|
+
private messageQueue;
|
|
13
|
+
private isReadyForUserInput;
|
|
14
|
+
private status;
|
|
15
|
+
private setStatus;
|
|
10
16
|
private createSession;
|
|
11
17
|
private setupWebSocketConnection;
|
|
18
|
+
private flushMessageQueue;
|
|
12
19
|
ensureConnected(): Promise<void>;
|
|
13
|
-
connect(messageHandler: MessageHandler): Promise<void>;
|
|
14
|
-
send(data: ClientMessage): void
|
|
20
|
+
connect(messageHandler: MessageHandler, onStatusChange: StatusChangeHandler): Promise<void>;
|
|
21
|
+
send(data: ClientMessage): Promise<void>;
|
|
15
22
|
}
|
|
16
23
|
export declare const websocketClient: WebSocketClient;
|
|
17
24
|
export {};
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
dir_path?: string;
|
|
4
|
-
include?: string;
|
|
5
|
-
case_sensitive?: boolean;
|
|
6
|
-
fixed_strings?: boolean;
|
|
7
|
-
context?: number;
|
|
8
|
-
}) => Promise<{
|
|
1
|
+
import { type SearchTextParams } from './searchTextFallback.js';
|
|
2
|
+
export declare const SearchText: (parameters: SearchTextParams) => Promise<{
|
|
9
3
|
matches: ({
|
|
10
4
|
file: string;
|
|
11
5
|
line: any;
|
|
12
6
|
content: any;
|
|
13
7
|
} | null)[];
|
|
14
|
-
error?: undefined;
|
|
15
|
-
} | {
|
|
16
|
-
error: any;
|
|
17
|
-
matches?: undefined;
|
|
18
8
|
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type SearchTextParams = {
|
|
2
|
+
pattern: string;
|
|
3
|
+
dir_path?: string;
|
|
4
|
+
include?: string;
|
|
5
|
+
case_sensitive?: boolean;
|
|
6
|
+
fixed_strings?: boolean;
|
|
7
|
+
context?: number;
|
|
8
|
+
};
|
|
9
|
+
export type SearchTextMatch = {
|
|
10
|
+
file: string;
|
|
11
|
+
line: number;
|
|
12
|
+
content: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Node-based SearchText fallback that avoids external binaries.
|
|
16
|
+
* Behavior is best-effort compatible with rg: returns line matches and line text.
|
|
17
|
+
*/
|
|
18
|
+
export declare const searchTextFallback: (params: SearchTextParams) => Promise<{
|
|
19
|
+
matches: SearchTextMatch[];
|
|
20
|
+
}>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export interface ConversationMessage {
|
|
|
9
9
|
status: 'streaming' | 'finished';
|
|
10
10
|
content?: string;
|
|
11
11
|
};
|
|
12
|
+
highlightedBlock?: {
|
|
13
|
+
language?: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
12
16
|
}
|
|
13
17
|
export interface PendingShellCommand {
|
|
14
18
|
tool_name: string;
|
|
@@ -54,6 +58,10 @@ export interface UserMessage {
|
|
|
54
58
|
type: 'user_message';
|
|
55
59
|
payload: {
|
|
56
60
|
prompt: string;
|
|
61
|
+
images?: {
|
|
62
|
+
base64: string;
|
|
63
|
+
mimeType: string;
|
|
64
|
+
}[];
|
|
57
65
|
};
|
|
58
66
|
}
|
|
59
67
|
export interface MagicCommand {
|
|
@@ -107,4 +115,10 @@ export type BackendMessage = RunTool | AgentGenerationCancelled | {
|
|
|
107
115
|
} | {
|
|
108
116
|
type: 'agent_finished';
|
|
109
117
|
payload: Record<string, never>;
|
|
118
|
+
} | {
|
|
119
|
+
type: 'handshake_ack';
|
|
120
|
+
payload: Record<string, never>;
|
|
121
|
+
} | {
|
|
122
|
+
type: 'bootstrap_finished';
|
|
123
|
+
payload: Record<string, never>;
|
|
110
124
|
};
|
|
@@ -7,6 +7,10 @@ export interface StaticMessageView {
|
|
|
7
7
|
toolParams?: Record<string, any>;
|
|
8
8
|
status?: 'running' | 'finished' | 'error';
|
|
9
9
|
isBootstrap?: boolean;
|
|
10
|
+
highlightedBlock?: {
|
|
11
|
+
language?: string;
|
|
12
|
+
content: string;
|
|
13
|
+
};
|
|
10
14
|
}
|
|
11
15
|
export interface ShellRunView {
|
|
12
16
|
id: string;
|
|
@@ -14,13 +18,32 @@ export interface ShellRunView {
|
|
|
14
18
|
status: 'pending' | 'running' | 'finished' | 'error' | 'cancelled';
|
|
15
19
|
stdout: string;
|
|
16
20
|
stderr: string;
|
|
21
|
+
/**
|
|
22
|
+
* Saída agregada (stdout + stderr) em forma já limpa para
|
|
23
|
+
* renderização, potencialmente truncada apenas do ponto de
|
|
24
|
+
* vista visual (o CoreState continua contendo a saída completa).
|
|
25
|
+
*/
|
|
26
|
+
visibleOutput: string;
|
|
27
|
+
/**
|
|
28
|
+
* Indica se a saída visual foi truncada em relação à saída real.
|
|
29
|
+
*/
|
|
30
|
+
isVisuallyTruncated: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Número total de linhas de saída (stdout + stderr) no core.
|
|
33
|
+
*/
|
|
34
|
+
totalLines: number;
|
|
35
|
+
/**
|
|
36
|
+
* Número de linhas efetivamente renderizadas na UI.
|
|
37
|
+
*/
|
|
38
|
+
visibleLinesCount: number;
|
|
17
39
|
}
|
|
18
40
|
export interface DiffReviewView {
|
|
19
41
|
id: string;
|
|
20
42
|
title?: string;
|
|
21
43
|
toolName?: string;
|
|
22
44
|
toolParams?: Record<string, any>;
|
|
23
|
-
|
|
45
|
+
oldContent: string;
|
|
46
|
+
newContent: string;
|
|
24
47
|
status: 'pending' | 'accepted' | 'rejected';
|
|
25
48
|
}
|
|
26
49
|
export interface InkViewModel {
|