stk-codegen 1.0.4 → 1.0.6
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/dist/App.d.ts +4 -2
- package/dist/components/BootstrapStatus.d.ts +3 -0
- package/dist/components/Conversation.d.ts +15 -8
- package/dist/components/DiffView.d.ts +9 -2
- package/dist/components/Input.d.ts +2 -1
- package/dist/components/Message.d.ts +1 -1
- package/dist/components/ShellConfirmation.d.ts +3 -1
- package/dist/components/ShellExecution.d.ts +6 -0
- package/dist/components/ToolExecution.d.ts +2 -1
- package/dist/core/agent/events.d.ts +65 -0
- package/dist/core/agent/reducer.d.ts +4 -0
- package/dist/core/agent/types.d.ts +53 -0
- package/dist/hooks/useAgent.core.d.ts +0 -0
- package/dist/hooks/useAgent.d.ts +6 -3
- package/dist/index.js +44 -25
- package/dist/services/versionCheck.d.ts +5 -3
- package/dist/tools/GetWorkingDirectory.d.ts +13 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -7
- package/dist/ui/agent/buildInkViewModel.d.ts +34 -0
- package/dist/ui/agent/mapMessages.d.ts +7 -0
- package/dist/utils/display.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
1
|
import { execSync } from 'child_process';
|
|
2
|
+
export type HttpGet = <T = unknown>(url: string) => Promise<{
|
|
3
|
+
data: T;
|
|
4
|
+
}>;
|
|
3
5
|
export type VersionCheckDeps = {
|
|
4
|
-
|
|
6
|
+
httpGet: HttpGet;
|
|
5
7
|
execSync: typeof execSync;
|
|
6
8
|
exit: (code: number) => never;
|
|
7
9
|
log: typeof console.log;
|
|
8
10
|
error: typeof console.error;
|
|
9
11
|
env: NodeJS.ProcessEnv;
|
|
10
12
|
};
|
|
11
|
-
export declare function checkCliVersionWithDeps({
|
|
13
|
+
export declare function checkCliVersionWithDeps({ httpGet, execSync, exit, log, error: logError, env, }: VersionCheckDeps): Promise<void>;
|
|
12
14
|
export declare function checkCliVersion(): Promise<void>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type GetWorkingDirectoryResult = {
|
|
2
|
+
/**
|
|
3
|
+
* Caminho absoluto do diretório de trabalho atual do processo Node.
|
|
4
|
+
* Equivalente ao resultado de `pwd` em sistemas Unix, porém utilizando APIs do Node
|
|
5
|
+
* para funcionar de forma portável em qualquer sistema operacional.
|
|
6
|
+
*/
|
|
7
|
+
cwd: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Retorna o diretório de trabalho atual, similar ao comando `pwd` em Unix,
|
|
11
|
+
* mas usando `process.cwd()` para garantir portabilidade entre sistemas operacionais.
|
|
12
|
+
*/
|
|
13
|
+
export declare function GetWorkingDirectory(): Promise<GetWorkingDirectoryResult>;
|
package/dist/tools/index.d.ts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface ConversationMessage {
|
|
2
|
-
id:
|
|
3
|
-
sender: 'user' | 'agent' | '
|
|
2
|
+
id: string;
|
|
3
|
+
sender: 'user' | 'agent' | 'tool_execution' | 'agent_thought' | 'agent_error' | 'system' | 'shell';
|
|
4
4
|
text: string;
|
|
5
5
|
toolName?: string;
|
|
6
6
|
toolParams?: Record<string, any>;
|
|
@@ -9,11 +9,6 @@ export interface ConversationMessage {
|
|
|
9
9
|
status: 'streaming' | 'finished';
|
|
10
10
|
content?: string;
|
|
11
11
|
};
|
|
12
|
-
filePath?: string;
|
|
13
|
-
action?: string;
|
|
14
|
-
oldContent?: string;
|
|
15
|
-
newContent?: string;
|
|
16
|
-
onComplete?: (action: 'accept' | 'reject' | 'edit', editedContent?: string) => void;
|
|
17
12
|
}
|
|
18
13
|
export interface PendingShellCommand {
|
|
19
14
|
tool_name: string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CoreState } from '../../core/agent/types.js';
|
|
2
|
+
export interface StaticMessageView {
|
|
3
|
+
id: string;
|
|
4
|
+
role: 'user' | 'agent' | 'tool_execution' | 'shell' | 'system' | 'agent_error' | 'agent_thought';
|
|
5
|
+
text: string;
|
|
6
|
+
toolName?: string;
|
|
7
|
+
toolParams?: Record<string, any>;
|
|
8
|
+
status?: 'running' | 'finished' | 'error';
|
|
9
|
+
isBootstrap?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ShellRunView {
|
|
12
|
+
id: string;
|
|
13
|
+
command: string;
|
|
14
|
+
status: 'pending' | 'running' | 'finished' | 'error' | 'cancelled';
|
|
15
|
+
stdout: string;
|
|
16
|
+
stderr: string;
|
|
17
|
+
}
|
|
18
|
+
export interface DiffReviewView {
|
|
19
|
+
id: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
toolName?: string;
|
|
22
|
+
toolParams?: Record<string, any>;
|
|
23
|
+
diffText: string;
|
|
24
|
+
status: 'pending' | 'accepted' | 'rejected';
|
|
25
|
+
}
|
|
26
|
+
export interface InkViewModel {
|
|
27
|
+
staticMessages: StaticMessageView[];
|
|
28
|
+
liveAgentMessage?: StaticMessageView;
|
|
29
|
+
activeShellRun?: ShellRunView;
|
|
30
|
+
activeDiffReview?: DiffReviewView;
|
|
31
|
+
agentStatusLabel: string;
|
|
32
|
+
agentStatusPhase: string;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildInkViewModel(state: CoreState): InkViewModel;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CoreMessage } from '../../core/agent/types.js';
|
|
2
|
+
import { ConversationMessage } from '../../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Helper centralizado para mapear mensagens do core para o formato
|
|
5
|
+
* usado atualmente pelos componentes de conversa.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mapCoreMessageToConversation(message: CoreMessage): ConversationMessage;
|
package/dist/utils/display.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const buildFriendlyLabel: (toolName: string, toolParams?: Record<string, any>) => string;
|