stk-codegen 1.0.5 → 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.
@@ -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
- axiosGet: typeof axios.get;
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({ axiosGet, execSync, exit, log, error: logError, env, }: VersionCheckDeps): Promise<void>;
13
+ export declare function checkCliVersionWithDeps({ httpGet, execSync, exit, log, error: logError, env, }: VersionCheckDeps): Promise<void>;
12
14
  export declare function checkCliVersion(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  export interface ConversationMessage {
2
- id: number;
3
- sender: 'user' | 'agent' | 'tool' | 'agent_thought' | 'agent_error' | 'system';
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;
@@ -1 +1 @@
1
- export declare const getToolDisplayMessage: (toolName: string, parameters: any) => string;
1
+ export declare const buildFriendlyLabel: (toolName: string, toolParams?: Record<string, any>) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stk-codegen",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A CLI executor for the autonomous agent.",
5
5
  "main": "index.js",
6
6
  "bin": {