stk-codegen 1.0.8 → 1.1.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.
Files changed (58) hide show
  1. package/README.md +0 -0
  2. package/dist/{984.index.js → 194.index.js} +13 -10
  3. package/dist/{96.index.js → 905.index.js} +6 -6
  4. package/dist/index.js +52 -32
  5. package/package.json +30 -7
  6. package/dist/App.d.ts +0 -4
  7. package/dist/cli.d.ts +0 -1
  8. package/dist/components/AgentStatus.d.ts +0 -7
  9. package/dist/components/BootstrapStatus.d.ts +0 -7
  10. package/dist/components/Conversation.d.ts +0 -20
  11. package/dist/components/DiffView.d.ts +0 -23
  12. package/dist/components/EscapeClearIndicator.d.ts +0 -3
  13. package/dist/components/ExitIndicator.d.ts +0 -3
  14. package/dist/components/Footer.d.ts +0 -3
  15. package/dist/components/Input.d.ts +0 -19
  16. package/dist/components/LimitedHeightBox.d.ts +0 -25
  17. package/dist/components/Message.d.ts +0 -12
  18. package/dist/components/ShellConfirmation.d.ts +0 -8
  19. package/dist/components/ShellExecution.d.ts +0 -19
  20. package/dist/components/SplashScreen.d.ts +0 -4
  21. package/dist/components/ToolExecution.d.ts +0 -9
  22. package/dist/config.d.ts +0 -9
  23. package/dist/core/agent/events.d.ts +0 -69
  24. package/dist/core/agent/reducer.d.ts +0 -4
  25. package/dist/core/agent/types.d.ts +0 -55
  26. package/dist/hooks/hooks.d.ts +0 -5
  27. package/dist/hooks/useAgent.core.d.ts +0 -16
  28. package/dist/hooks/useAgent.d.ts +0 -46
  29. package/dist/hooks/useMagicCommands.d.ts +0 -1
  30. package/dist/hooks/useTerminalLayout.d.ts +0 -16
  31. package/dist/services/clipboardImage.d.ts +0 -24
  32. package/dist/services/versionCheck.d.ts +0 -14
  33. package/dist/services/websocketClient.d.ts +0 -24
  34. package/dist/tools/Edit.d.ts +0 -14
  35. package/dist/tools/FindFiles.d.ts +0 -12
  36. package/dist/tools/GetWorkingDirectory.d.ts +0 -13
  37. package/dist/tools/GoogleSearch.d.ts +0 -9
  38. package/dist/tools/ReadFile.d.ts +0 -11
  39. package/dist/tools/ReadFolder.d.ts +0 -12
  40. package/dist/tools/ReadManyFiles.d.ts +0 -10
  41. package/dist/tools/SaveMemory.d.ts +0 -9
  42. package/dist/tools/SearchText.d.ts +0 -8
  43. package/dist/tools/Shell.d.ts +0 -11
  44. package/dist/tools/WebFetch.d.ts +0 -9
  45. package/dist/tools/WriteFile.d.ts +0 -10
  46. package/dist/tools/WriteTodos.d.ts +0 -9
  47. package/dist/tools/index.d.ts +0 -13
  48. package/dist/tools/runShellCommandAsync.d.ts +0 -3
  49. package/dist/tools/searchTextFallback.d.ts +0 -20
  50. package/dist/types/index.d.ts +0 -124
  51. package/dist/ui/agent/buildInkViewModel.d.ts +0 -57
  52. package/dist/ui/agent/mapMessages.d.ts +0 -7
  53. package/dist/ui/agent/textFormatting.d.ts +0 -8
  54. package/dist/utils/display.d.ts +0 -1
  55. package/dist/utils/keyMatchers.d.ts +0 -3
  56. package/dist/utils/paths.d.ts +0 -1
  57. package/dist/utils/projectSpecLoader.d.ts +0 -5
  58. package/dist/utils/text-buffer.d.ts +0 -25
@@ -1,10 +0,0 @@
1
- export declare const ReadManyFiles: (parameters: {
2
- include: string[];
3
- exclude?: string[];
4
- }) => Promise<{
5
- content: string;
6
- error?: undefined;
7
- } | {
8
- error: any;
9
- content?: undefined;
10
- }>;
@@ -1,9 +0,0 @@
1
- export declare const SaveMemory: (parameters: {
2
- fact: string;
3
- }) => Promise<{
4
- success: boolean;
5
- error?: undefined;
6
- } | {
7
- error: any;
8
- success?: undefined;
9
- }>;
@@ -1,8 +0,0 @@
1
- import { type SearchTextParams } from './searchTextFallback.js';
2
- export declare const SearchText: (parameters: SearchTextParams) => Promise<{
3
- matches: ({
4
- file: string;
5
- line: any;
6
- content: any;
7
- } | null)[];
8
- }>;
@@ -1,11 +0,0 @@
1
- export declare const Shell: (parameters: {
2
- command: string;
3
- dir_path?: string;
4
- }) => Promise<{
5
- command: string;
6
- directory: string | undefined;
7
- stdout: string;
8
- stderr: string;
9
- error: string;
10
- exitCode: number;
11
- }>;
@@ -1,9 +0,0 @@
1
- export declare const WebFetch: (parameters: {
2
- prompt: string;
3
- }) => Promise<{
4
- content: string;
5
- error?: undefined;
6
- } | {
7
- error: any;
8
- content?: undefined;
9
- }>;
@@ -1,10 +0,0 @@
1
- export declare const WriteFile: (parameters: {
2
- file_path: string;
3
- content: string;
4
- }) => Promise<{
5
- success: boolean;
6
- error?: undefined;
7
- } | {
8
- error: any;
9
- success?: undefined;
10
- }>;
@@ -1,9 +0,0 @@
1
- import { WriteTodosResponse } from '../types/index.js';
2
- export declare const WriteTodos: (parameters: {
3
- todos: {
4
- description: string;
5
- status: string;
6
- }[];
7
- }) => Promise<WriteTodosResponse | {
8
- error: string;
9
- }>;
@@ -1,13 +0,0 @@
1
- export { ReadFile } from './ReadFile.js';
2
- export { ReadFolder } from './ReadFolder.js';
3
- export { Shell } from './Shell.js';
4
- export { FindFiles } from './FindFiles.js';
5
- export { SearchText } from './SearchText.js';
6
- export { WriteFile } from './WriteFile.js';
7
- export { Edit } from './Edit.js';
8
- export { ReadManyFiles } from './ReadManyFiles.js';
9
- export { SaveMemory } from './SaveMemory.js';
10
- export { WebFetch } from './WebFetch.js';
11
- export { GoogleSearch } from './GoogleSearch.js';
12
- export { WriteTodos } from './WriteTodos.js';
13
- export { GetWorkingDirectory } from './GetWorkingDirectory.js';
@@ -1,3 +0,0 @@
1
- import { ChildProcess } from 'child_process';
2
- export type ShellProcess = ChildProcess;
3
- export declare const runShellCommand: (command: string, cwd: string) => ShellProcess;
@@ -1,20 +0,0 @@
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
- }>;
@@ -1,124 +0,0 @@
1
- export interface ConversationMessage {
2
- id: string;
3
- sender: 'user' | 'agent' | 'tool_execution' | 'agent_thought' | 'agent_error' | 'system' | 'shell';
4
- text: string;
5
- toolName?: string;
6
- toolParams?: Record<string, any>;
7
- status?: 'running' | 'finished' | 'pending_review' | 'completed';
8
- stream?: {
9
- status: 'streaming' | 'finished';
10
- content?: string;
11
- };
12
- highlightedBlock?: {
13
- language?: string;
14
- content: string;
15
- };
16
- }
17
- export interface PendingShellCommand {
18
- tool_name: string;
19
- tool_id: string;
20
- generation_id: string;
21
- parameters: {
22
- command: string;
23
- dir_path?: string;
24
- };
25
- }
26
- export interface RunTool {
27
- type: 'run_tool';
28
- payload: {
29
- tool_name: string;
30
- tool_id: string;
31
- generation_id: string;
32
- parameters: Record<string, any>;
33
- };
34
- }
35
- export interface ToolResult {
36
- type: 'tool_result';
37
- payload: {
38
- tool_name: string;
39
- tool_id: string;
40
- generation_id: string;
41
- status: 'success' | 'error';
42
- result: any;
43
- };
44
- }
45
- export interface ClientCancelGeneration {
46
- type: 'client_cancel_generation';
47
- payload: {
48
- generation_id: string;
49
- };
50
- }
51
- export interface AgentGenerationCancelled {
52
- type: 'agent_generation_cancelled';
53
- payload: {
54
- generation_id: string;
55
- };
56
- }
57
- export interface UserMessage {
58
- type: 'user_message';
59
- payload: {
60
- prompt: string;
61
- images?: {
62
- base64: string;
63
- mimeType: string;
64
- }[];
65
- };
66
- }
67
- export interface MagicCommand {
68
- type: 'magic_command';
69
- payload: {
70
- name: string;
71
- };
72
- }
73
- export interface WriteTodosResponse {
74
- llmContent: string;
75
- returnDisplay: {
76
- todos: {
77
- description: string;
78
- status: string;
79
- }[];
80
- };
81
- }
82
- export interface HandshakeMessage {
83
- type: 'handshake';
84
- payload: {
85
- client_type: 'cli';
86
- known_tools: string[];
87
- custom_tools: any[];
88
- projectSpec: {
89
- content: string;
90
- filePaths: string[];
91
- } | null;
92
- };
93
- }
94
- export interface ClientCancelLast {
95
- type: 'client_cancel_last';
96
- payload: Record<string, never>;
97
- }
98
- export type ClientMessage = UserMessage | MagicCommand | ClientCancelGeneration | ClientCancelLast | ToolResult | HandshakeMessage;
99
- export type BackendMessage = RunTool | AgentGenerationCancelled | {
100
- type: 'agent_error';
101
- payload: {
102
- message: string;
103
- details?: string;
104
- };
105
- } | {
106
- type: 'agent_message_delta';
107
- payload: {
108
- content: string;
109
- };
110
- } | {
111
- type: 'agent_thought';
112
- payload: {
113
- content: string;
114
- };
115
- } | {
116
- type: 'agent_finished';
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>;
124
- };
@@ -1,57 +0,0 @@
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
- highlightedBlock?: {
11
- language?: string;
12
- content: string;
13
- };
14
- }
15
- export interface ShellRunView {
16
- id: string;
17
- command: string;
18
- status: 'pending' | 'running' | 'finished' | 'error' | 'cancelled';
19
- stdout: string;
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;
39
- }
40
- export interface DiffReviewView {
41
- id: string;
42
- title?: string;
43
- toolName?: string;
44
- toolParams?: Record<string, any>;
45
- oldContent: string;
46
- newContent: string;
47
- status: 'pending' | 'accepted' | 'rejected';
48
- }
49
- export interface InkViewModel {
50
- staticMessages: StaticMessageView[];
51
- liveAgentMessage?: StaticMessageView;
52
- activeShellRun?: ShellRunView;
53
- activeDiffReview?: DiffReviewView;
54
- agentStatusLabel: string;
55
- agentStatusPhase: string;
56
- }
57
- export declare function buildInkViewModel(state: CoreState): InkViewModel;
@@ -1,7 +0,0 @@
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,8 +0,0 @@
1
- export type InlineSegment = {
2
- type: 'text';
3
- content: string;
4
- } | {
5
- type: 'code';
6
- content: string;
7
- };
8
- export declare function parseInlineCodeSegments(text: string): InlineSegment[];
@@ -1 +0,0 @@
1
- export declare const buildFriendlyLabel: (toolName: string, toolParams?: Record<string, any>) => string;
@@ -1,3 +0,0 @@
1
- import { Key } from 'ink';
2
- export declare const isBackspace: (key: Key) => boolean;
3
- export declare const isDelete: () => boolean;
@@ -1 +0,0 @@
1
- export declare const sanitizePath: (p?: string) => string | undefined;
@@ -1,5 +0,0 @@
1
- export interface ProjectSpecResult {
2
- content: string;
3
- filePaths: string[];
4
- }
5
- export declare function loadProjectSpec(cwd: string): Promise<ProjectSpecResult | null>;
@@ -1,25 +0,0 @@
1
- export declare class TextBuffer {
2
- private text;
3
- private cursor;
4
- constructor(initialValue?: string);
5
- get value(): string;
6
- get cursorPosition(): number;
7
- insert(char: string): void;
8
- insertText(text: string): void;
9
- backspace(): void;
10
- delete(): void;
11
- moveCursorLeft(): void;
12
- moveCursorRight(): void;
13
- moveCursorToStart(): void;
14
- moveCursorToEnd(): void;
15
- private _getLines;
16
- private _offsetToRowCol;
17
- private _rowColToOffset;
18
- getLineCount(): number;
19
- getCursorRow(): number;
20
- moveCursorUp(): void;
21
- moveCursorDown(): void;
22
- moveCursorWordLeft(): void;
23
- moveCursorWordRight(): void;
24
- clone(): TextBuffer;
25
- }