stk-codegen 1.0.9 → 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.
- package/README.md +0 -0
- package/dist/{984.index.js → 194.index.js} +13 -10
- package/dist/{96.index.js → 905.index.js} +6 -6
- package/dist/index.js +52 -32
- package/package.json +30 -7
- package/dist/App.d.ts +0 -4
- package/dist/cli.d.ts +0 -1
- package/dist/components/AgentStatus.d.ts +0 -7
- package/dist/components/BootstrapStatus.d.ts +0 -7
- package/dist/components/Conversation.d.ts +0 -20
- package/dist/components/DiffView.d.ts +0 -23
- package/dist/components/EscapeClearIndicator.d.ts +0 -3
- package/dist/components/ExitIndicator.d.ts +0 -3
- package/dist/components/Footer.d.ts +0 -5
- package/dist/components/Input.d.ts +0 -20
- package/dist/components/LimitedHeightBox.d.ts +0 -25
- package/dist/components/Message.d.ts +0 -12
- package/dist/components/ShellConfirmation.d.ts +0 -8
- package/dist/components/ShellExecution.d.ts +0 -19
- package/dist/components/SplashScreen.d.ts +0 -4
- package/dist/components/ToolExecution.d.ts +0 -9
- package/dist/config.d.ts +0 -9
- package/dist/core/agent/events.d.ts +0 -82
- package/dist/core/agent/reducer.d.ts +0 -4
- package/dist/core/agent/types.d.ts +0 -58
- package/dist/hooks/hooks.d.ts +0 -5
- package/dist/hooks/useAgent.core.d.ts +0 -16
- package/dist/hooks/useAgent.d.ts +0 -48
- package/dist/hooks/useMagicCommands.d.ts +0 -1
- package/dist/hooks/useTerminalLayout.d.ts +0 -16
- package/dist/services/clipboardImage.d.ts +0 -24
- package/dist/services/versionCheck.d.ts +0 -14
- package/dist/services/websocketClient.d.ts +0 -24
- package/dist/tools/Edit.d.ts +0 -14
- package/dist/tools/FindFiles.d.ts +0 -12
- package/dist/tools/GetWorkingDirectory.d.ts +0 -13
- package/dist/tools/GoogleSearch.d.ts +0 -9
- package/dist/tools/ReadFile.d.ts +0 -11
- package/dist/tools/ReadFolder.d.ts +0 -12
- package/dist/tools/ReadManyFiles.d.ts +0 -10
- package/dist/tools/SaveMemory.d.ts +0 -9
- package/dist/tools/SearchText.d.ts +0 -8
- package/dist/tools/Shell.d.ts +0 -11
- package/dist/tools/WebFetch.d.ts +0 -9
- package/dist/tools/WriteFile.d.ts +0 -10
- package/dist/tools/WriteTodos.d.ts +0 -9
- package/dist/tools/index.d.ts +0 -13
- package/dist/tools/runShellCommandAsync.d.ts +0 -3
- package/dist/tools/searchTextFallback.d.ts +0 -20
- package/dist/types/index.d.ts +0 -140
- package/dist/ui/agent/buildInkViewModel.d.ts +0 -57
- package/dist/ui/agent/mapMessages.d.ts +0 -7
- package/dist/ui/agent/textFormatting.d.ts +0 -8
- package/dist/utils/display.d.ts +0 -1
- package/dist/utils/keyMatchers.d.ts +0 -3
- package/dist/utils/paths.d.ts +0 -1
- package/dist/utils/projectSpecLoader.d.ts +0 -5
- package/dist/utils/text-buffer.d.ts +0 -25
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stk-codegen",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A CLI executor for the autonomous agent.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,10 +12,15 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"test": "vitest",
|
|
16
|
-
"
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"dev": "pnpm build && node --env-file=.env.dev dist/index.js",
|
|
17
|
+
"stg": "pnpm build && node --env-file=.env.stg dist/index.js",
|
|
18
|
+
"local": "pnpm build && node --env-file=.env.local dist/index.js",
|
|
17
19
|
"build": "rm -rf dist && ncc build src/cli.tsx -o dist -m",
|
|
18
|
-
"prepare-publish": "rm -rf dist &&
|
|
20
|
+
"prepare-publish": "rm -rf dist && pnpm build && pnpm pack",
|
|
21
|
+
"lint": "eslint \"src/**/*.ts\" \"src/**/*.tsx\"",
|
|
22
|
+
"fix": "eslint --fix . && prettier --write .",
|
|
23
|
+
"check-branch": "pnpm fix && pnpm lint && pnpm build"
|
|
19
24
|
},
|
|
20
25
|
"keywords": [],
|
|
21
26
|
"author": "",
|
|
@@ -29,28 +34,46 @@
|
|
|
29
34
|
"diff": "^8.0.2",
|
|
30
35
|
"glob": "^11.1.0",
|
|
31
36
|
"html-to-text": "^9.0.5",
|
|
32
|
-
"ink": "^
|
|
37
|
+
"ink": "^6.6.0",
|
|
33
38
|
"ink-spinner": "^5.0.0",
|
|
34
39
|
"ink-text-input": "^6.0.0",
|
|
35
40
|
"inquirer": "^13.0.1",
|
|
36
41
|
"meow": "^11.0.0",
|
|
37
42
|
"open": "^11.0.0",
|
|
38
|
-
"react": "^
|
|
43
|
+
"react": "^19.2.3",
|
|
39
44
|
"serpapi": "^2.2.1",
|
|
40
45
|
"strip-ansi": "^7.1.2",
|
|
41
46
|
"tmp": "^0.2.5",
|
|
42
47
|
"ws": "^8.18.3"
|
|
43
48
|
},
|
|
44
49
|
"devDependencies": {
|
|
50
|
+
"@eslint/compat": "^2.0.1",
|
|
51
|
+
"@eslint/eslintrc": "^3.3.3",
|
|
52
|
+
"@eslint/js": "^9.39.2",
|
|
45
53
|
"@sindresorhus/tsconfig": "^3.0.1",
|
|
54
|
+
"@stylistic/eslint-plugin": "^5.7.0",
|
|
46
55
|
"@types/diff": "^7.0.2",
|
|
47
56
|
"@types/glob": "^8.1.0",
|
|
48
57
|
"@types/html-to-text": "^9.0.4",
|
|
49
58
|
"@types/ink-spinner": "^3.0.5",
|
|
50
|
-
"@types/react": "^
|
|
59
|
+
"@types/react": "^19.2.8",
|
|
51
60
|
"@types/ws": "^8.18.1",
|
|
61
|
+
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
62
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
52
63
|
"@vercel/ncc": "^0.38.4",
|
|
64
|
+
"eslint": "^9.39.2",
|
|
65
|
+
"eslint-config-prettier": "^10.1.8",
|
|
66
|
+
"eslint-plugin-filenames": "^1.3.2",
|
|
67
|
+
"eslint-plugin-import": "^2.32.0",
|
|
68
|
+
"eslint-plugin-lodash": "^8.0.0",
|
|
69
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
70
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
71
|
+
"eslint-plugin-react": "^7.37.5",
|
|
72
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
73
|
+
"eslint-plugin-react-hooks-order": "^0.1.2",
|
|
74
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
53
75
|
"ink-testing-library": "^4.0.0",
|
|
76
|
+
"prettier": "^3.8.0",
|
|
54
77
|
"typescript": "^5.0.3",
|
|
55
78
|
"vitest": "^1.0.0"
|
|
56
79
|
}
|
package/dist/App.d.ts
DELETED
package/dist/cli.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ChildProcess } from 'child_process';
|
|
3
|
-
import { DiffReviewView, ShellRunView, StaticMessageView } from "../ui/agent/buildInkViewModel.js";
|
|
4
|
-
interface ConversationProps {
|
|
5
|
-
messages: StaticMessageView[];
|
|
6
|
-
liveAgentMessage?: StaticMessageView;
|
|
7
|
-
activeShellRun?: ShellRunView;
|
|
8
|
-
activeDiffReview?: DiffReviewView;
|
|
9
|
-
onShellComplete: (result: {
|
|
10
|
-
stdout: string;
|
|
11
|
-
stderr: string;
|
|
12
|
-
exitCode: number | null;
|
|
13
|
-
}) => void;
|
|
14
|
-
childProcess: ChildProcess | null;
|
|
15
|
-
sendInputToShell: (input: string) => void;
|
|
16
|
-
onApproveDiff: (editedContent?: string) => void;
|
|
17
|
-
onRejectDiff: () => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const Conversation: FC<ConversationProps>;
|
|
20
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface DiffViewStaticProps {
|
|
3
|
-
oldContent: string;
|
|
4
|
-
newContent: string;
|
|
5
|
-
filePath?: string;
|
|
6
|
-
toolName?: string;
|
|
7
|
-
toolParams?: Record<string, any>;
|
|
8
|
-
isCompleted: boolean;
|
|
9
|
-
action?: string;
|
|
10
|
-
maxVisibleLines?: number;
|
|
11
|
-
}
|
|
12
|
-
interface DiffViewProps extends DiffViewStaticProps {
|
|
13
|
-
onApprove: (editedContent?: string) => void;
|
|
14
|
-
onReject: () => void;
|
|
15
|
-
coreDiffReview?: {
|
|
16
|
-
id: string;
|
|
17
|
-
status: 'pending' | 'accepted' | 'rejected';
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export declare const DiffDecisionHint: React.FC;
|
|
21
|
-
export declare const DiffViewStatic: React.FC<DiffViewStaticProps>;
|
|
22
|
-
declare const DiffView: React.FC<DiffViewProps>;
|
|
23
|
-
export default DiffView;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
value: string;
|
|
4
|
-
onChange: (value: string) => void;
|
|
5
|
-
onSubmit: (value: string, extra?: {
|
|
6
|
-
images?: {
|
|
7
|
-
base64: string;
|
|
8
|
-
mimeType: string;
|
|
9
|
-
}[];
|
|
10
|
-
}) => void;
|
|
11
|
-
searchFiles: (pattern: string, options?: {
|
|
12
|
-
ignore?: string[];
|
|
13
|
-
}) => Promise<string[]>;
|
|
14
|
-
isShellActive?: boolean;
|
|
15
|
-
setShowEscapeClear: (show: boolean) => void;
|
|
16
|
-
isActive: boolean;
|
|
17
|
-
isAutonomous?: boolean;
|
|
18
|
-
}
|
|
19
|
-
declare const _default: React.MemoExoticComponent<({ value, onChange, onSubmit, searchFiles, isShellActive, setShowEscapeClear, isActive, isAutonomous, }: Props) => React.JSX.Element>;
|
|
20
|
-
export default _default;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import { BoxProps } from 'ink';
|
|
3
|
-
export interface LimitedHeightBoxOwnProps {
|
|
4
|
-
/**
|
|
5
|
-
* Fração máxima das linhas do terminal que este container pode ocupar.
|
|
6
|
-
* Por padrão, 0.6 = 60% da altura disponível.
|
|
7
|
-
*/
|
|
8
|
-
maxRatio?: number;
|
|
9
|
-
/**
|
|
10
|
-
* Altura mínima em linhas para evitar containers excessivamente pequenos
|
|
11
|
-
* em terminais muito baixos.
|
|
12
|
-
*/
|
|
13
|
-
minLines?: number;
|
|
14
|
-
}
|
|
15
|
-
export type LimitedHeightBoxProps = PropsWithChildren<LimitedHeightBoxOwnProps & BoxProps>;
|
|
16
|
-
/**
|
|
17
|
-
* Container utilitário que limita a altura de seu conteúdo a uma fração
|
|
18
|
-
* da altura total do terminal (por padrão, 60%).
|
|
19
|
-
*
|
|
20
|
-
* Não tenta fazer scroll automático; apenas define um teto visual. Cabe ao
|
|
21
|
-
* componente interno (por exemplo, DiffView ou ShellExecution) controlar
|
|
22
|
-
* truncamento/scroll de conteúdo se necessário.
|
|
23
|
-
*/
|
|
24
|
-
export declare const LimitedHeightBox: React.FC<LimitedHeightBoxProps>;
|
|
25
|
-
export default LimitedHeightBox;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ConversationMessage } from '../types/index.js';
|
|
3
|
-
import { ChildProcess } from 'child_process';
|
|
4
|
-
interface MessageProps {
|
|
5
|
-
message: ConversationMessage;
|
|
6
|
-
activeShellCommand: any;
|
|
7
|
-
childProcess: ChildProcess | null;
|
|
8
|
-
handleShellCompletion: (result: any) => void;
|
|
9
|
-
context?: 'static' | 'live';
|
|
10
|
-
}
|
|
11
|
-
export declare const MemoizedMessage: React.NamedExoticComponent<MessageProps>;
|
|
12
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ShellConfirmationProps {
|
|
3
|
-
command: string;
|
|
4
|
-
onApprove: () => void;
|
|
5
|
-
onReject: () => void;
|
|
6
|
-
}
|
|
7
|
-
declare const ShellConfirmation: ({ command, onApprove, onReject }: ShellConfirmationProps) => React.JSX.Element;
|
|
8
|
-
export default ShellConfirmation;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ChildProcess } from 'child_process';
|
|
3
|
-
interface ShellExecutionProps {
|
|
4
|
-
command: string;
|
|
5
|
-
childProcess: ChildProcess | null;
|
|
6
|
-
onComplete: (result: any) => void;
|
|
7
|
-
coreShellRun?: {
|
|
8
|
-
id: string;
|
|
9
|
-
status: 'pending' | 'running' | 'finished' | 'error' | 'cancelled';
|
|
10
|
-
stdout: string;
|
|
11
|
-
stderr: string;
|
|
12
|
-
visibleOutput?: string;
|
|
13
|
-
isVisuallyTruncated?: boolean;
|
|
14
|
-
totalLines?: number;
|
|
15
|
-
visibleLinesCount?: number;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
declare const ShellExecution: React.FC<ShellExecutionProps>;
|
|
19
|
-
export default ShellExecution;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface ToolExecutionProps {
|
|
3
|
-
toolName: string;
|
|
4
|
-
displayMessage?: string;
|
|
5
|
-
toolParams?: Record<string, any>;
|
|
6
|
-
status?: 'running' | 'finished' | 'error' | 'completed' | undefined;
|
|
7
|
-
}
|
|
8
|
-
declare const ToolExecution: ({ toolName, toolParams, status }: ToolExecutionProps) => React.JSX.Element;
|
|
9
|
-
export default ToolExecution;
|
package/dist/config.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { CoreMessageId, DiffReviewId, ShellRunId } from './types.js';
|
|
2
|
-
export type CoreEvent = {
|
|
3
|
-
type: 'USER_SENT_MESSAGE';
|
|
4
|
-
text: string;
|
|
5
|
-
} | {
|
|
6
|
-
type: 'AGENT_STREAM_STARTED';
|
|
7
|
-
messageId: CoreMessageId;
|
|
8
|
-
generationId?: string;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'AGENT_DELTA_RECEIVED';
|
|
11
|
-
delta: string;
|
|
12
|
-
generationId?: string;
|
|
13
|
-
} | {
|
|
14
|
-
type: 'AGENT_STREAM_FLUSH';
|
|
15
|
-
} | {
|
|
16
|
-
type: 'AGENT_STREAM_FINISHED';
|
|
17
|
-
generationId?: string;
|
|
18
|
-
} | {
|
|
19
|
-
type: 'TOOL_RESULT_MESSAGE';
|
|
20
|
-
text: string;
|
|
21
|
-
generationId?: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'TOOL_EXECUTION_STARTED';
|
|
24
|
-
toolId: string;
|
|
25
|
-
toolName: string;
|
|
26
|
-
toolParams: Record<string, any>;
|
|
27
|
-
generationId?: string;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'TOOL_EXECUTION_FINISHED';
|
|
30
|
-
toolId: string;
|
|
31
|
-
toolName: string;
|
|
32
|
-
toolParams: Record<string, any>;
|
|
33
|
-
generationId?: string;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'TOOL_EXECUTION_ERROR';
|
|
36
|
-
toolId: string;
|
|
37
|
-
toolName: string;
|
|
38
|
-
toolParams: Record<string, any>;
|
|
39
|
-
error: string;
|
|
40
|
-
generationId?: string;
|
|
41
|
-
} | {
|
|
42
|
-
type: 'SHELL_RUN_STARTED';
|
|
43
|
-
runId: ShellRunId;
|
|
44
|
-
command: string;
|
|
45
|
-
generationId?: string;
|
|
46
|
-
} | {
|
|
47
|
-
type: 'SHELL_OUTPUT_RECEIVED';
|
|
48
|
-
runId: ShellRunId;
|
|
49
|
-
stdoutDelta?: string;
|
|
50
|
-
stderrDelta?: string;
|
|
51
|
-
generationId?: string;
|
|
52
|
-
} | {
|
|
53
|
-
type: 'SHELL_RUN_FINISHED';
|
|
54
|
-
runId: ShellRunId;
|
|
55
|
-
exitCode: number;
|
|
56
|
-
generationId?: string;
|
|
57
|
-
} | {
|
|
58
|
-
type: 'DIFF_REVIEW_OPENED';
|
|
59
|
-
reviewId: DiffReviewId;
|
|
60
|
-
title?: string;
|
|
61
|
-
toolName?: string;
|
|
62
|
-
toolParams?: Record<string, any>;
|
|
63
|
-
oldContent: string;
|
|
64
|
-
newContent: string;
|
|
65
|
-
generationId?: string;
|
|
66
|
-
} | {
|
|
67
|
-
type: 'DIFF_REVIEW_RESOLVED';
|
|
68
|
-
reviewId: DiffReviewId;
|
|
69
|
-
result: 'accepted' | 'rejected';
|
|
70
|
-
generationId?: string;
|
|
71
|
-
} | {
|
|
72
|
-
type: 'ERROR_OCCURRED';
|
|
73
|
-
message: string;
|
|
74
|
-
generationId?: string;
|
|
75
|
-
} | {
|
|
76
|
-
type: 'BOOTSTRAP_STARTED';
|
|
77
|
-
} | {
|
|
78
|
-
type: 'BOOTSTRAP_FINISHED';
|
|
79
|
-
} | {
|
|
80
|
-
type: 'CONNECTION_STATUS_CHANGED';
|
|
81
|
-
status: 'connecting' | 'connected' | 'disconnected';
|
|
82
|
-
};
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export type CoreRole = 'user' | 'agent' | 'tool_execution' | 'shell' | 'system' | 'agent_error' | 'agent_thought';
|
|
2
|
-
export type CoreMessageId = string;
|
|
3
|
-
export interface CoreMessage {
|
|
4
|
-
id: CoreMessageId;
|
|
5
|
-
role: CoreRole;
|
|
6
|
-
text: string;
|
|
7
|
-
createdAt: number;
|
|
8
|
-
isStreaming?: boolean;
|
|
9
|
-
isFinal?: boolean;
|
|
10
|
-
generationId?: string;
|
|
11
|
-
toolId?: string;
|
|
12
|
-
toolName?: string;
|
|
13
|
-
toolParams?: Record<string, any>;
|
|
14
|
-
status?: 'running' | 'finished' | 'error';
|
|
15
|
-
isBootstrap?: boolean;
|
|
16
|
-
}
|
|
17
|
-
export type ShellRunId = string;
|
|
18
|
-
export interface CoreShellRun {
|
|
19
|
-
id: ShellRunId;
|
|
20
|
-
command: string;
|
|
21
|
-
status: 'pending' | 'running' | 'finished' | 'error' | 'cancelled';
|
|
22
|
-
stdout: string;
|
|
23
|
-
stderr: string;
|
|
24
|
-
startedAt?: number;
|
|
25
|
-
finishedAt?: number;
|
|
26
|
-
}
|
|
27
|
-
export type DiffReviewId = string;
|
|
28
|
-
export interface CoreDiffReview {
|
|
29
|
-
id: DiffReviewId;
|
|
30
|
-
title?: string;
|
|
31
|
-
toolName?: string;
|
|
32
|
-
toolParams?: Record<string, any>;
|
|
33
|
-
oldContent: string;
|
|
34
|
-
newContent: string;
|
|
35
|
-
status: 'pending' | 'accepted' | 'rejected';
|
|
36
|
-
}
|
|
37
|
-
export interface CoreAgentStatus {
|
|
38
|
-
label: string;
|
|
39
|
-
detail?: string;
|
|
40
|
-
phase: 'idle' | 'thinking' | 'streaming' | 'waiting_tool' | 'running_tool';
|
|
41
|
-
}
|
|
42
|
-
export interface CoreStreamState {
|
|
43
|
-
currentMessageId?: CoreMessageId;
|
|
44
|
-
buffer: string;
|
|
45
|
-
status: 'idle' | 'streaming' | 'finished';
|
|
46
|
-
generationId?: string;
|
|
47
|
-
}
|
|
48
|
-
export interface CoreState {
|
|
49
|
-
messages: CoreMessage[];
|
|
50
|
-
shellRuns: CoreShellRun[];
|
|
51
|
-
diffReviews: CoreDiffReview[];
|
|
52
|
-
agentStatus: CoreAgentStatus;
|
|
53
|
-
stream: CoreStreamState;
|
|
54
|
-
activeGenerationId?: string;
|
|
55
|
-
isBootstrapping: boolean;
|
|
56
|
-
bootstrapFinished: boolean;
|
|
57
|
-
connectionStatus: 'connecting' | 'connected' | 'disconnected';
|
|
58
|
-
}
|
package/dist/hooks/hooks.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CoreEvent } from '../core/agent/events.js';
|
|
2
|
-
import { CoreState } from '../core/agent/types.js';
|
|
3
|
-
import { InkViewModel } from '../ui/agent/buildInkViewModel.js';
|
|
4
|
-
export interface UseAgentCoreResult {
|
|
5
|
-
coreState: CoreState;
|
|
6
|
-
dispatchCore: (event: CoreEvent) => void;
|
|
7
|
-
viewModel: InkViewModel;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Hook fino, sem dependência de Ink, que expõe o core de agente e um view model básico.
|
|
11
|
-
*
|
|
12
|
-
* A ideia é que `useAgent` (hook principal usado pela UI Ink) passe a delegar
|
|
13
|
-
* estado de domínio para este hook, mantendo apenas integração com backend,
|
|
14
|
-
* teclado e ferramentas.
|
|
15
|
-
*/
|
|
16
|
-
export declare function useAgentCore(): UseAgentCoreResult;
|
package/dist/hooks/useAgent.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { ChildProcess } from 'child_process';
|
|
2
|
-
import { PendingShellCommand } from '../types/index.js';
|
|
3
|
-
export declare const useAgent: ({ autonomous }: {
|
|
4
|
-
autonomous?: boolean;
|
|
5
|
-
}) => {
|
|
6
|
-
agentStatus: {
|
|
7
|
-
isVisible: boolean;
|
|
8
|
-
text: string;
|
|
9
|
-
};
|
|
10
|
-
isAutonomous: boolean;
|
|
11
|
-
toggleAutonomous: () => void;
|
|
12
|
-
pendingShellCommand: PendingShellCommand | null;
|
|
13
|
-
approveShellCommand: () => void;
|
|
14
|
-
rejectShellCommand: () => void;
|
|
15
|
-
approveDiff: (editedContent?: string) => void;
|
|
16
|
-
rejectDiff: () => void;
|
|
17
|
-
submitUserInput: (text: string, extra?: {
|
|
18
|
-
images?: {
|
|
19
|
-
base64: string;
|
|
20
|
-
mimeType: string;
|
|
21
|
-
}[];
|
|
22
|
-
}) => Promise<void>;
|
|
23
|
-
navigateHistoryUp: () => string | undefined;
|
|
24
|
-
navigateHistoryDown: () => string | undefined;
|
|
25
|
-
searchFiles: (pattern: string, options?: {
|
|
26
|
-
ignore?: string[];
|
|
27
|
-
}) => Promise<any>;
|
|
28
|
-
activeShellCommand: any;
|
|
29
|
-
handleShellCompletion: (result: any, meta?: {
|
|
30
|
-
messageId: number;
|
|
31
|
-
tool_name: string;
|
|
32
|
-
tool_id: string;
|
|
33
|
-
generation_id: string;
|
|
34
|
-
parameters?: any;
|
|
35
|
-
}) => void;
|
|
36
|
-
childProcess: ChildProcess | null;
|
|
37
|
-
sendInputToShell: (input: string) => void;
|
|
38
|
-
inputText: string;
|
|
39
|
-
setInputText: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
40
|
-
isShellActive: boolean;
|
|
41
|
-
setIsShellActive: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
42
|
-
resetHistory: () => void;
|
|
43
|
-
cancelCurrentInteraction: () => void;
|
|
44
|
-
activeGenerationId: string | null;
|
|
45
|
-
coreState: import("../core/agent/types.js").CoreState;
|
|
46
|
-
coreViewModel: import("../ui/agent/buildInkViewModel.js").InkViewModel;
|
|
47
|
-
hasCodegenSpec: boolean;
|
|
48
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useMagicCommands: () => string[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export declare const AGENT_STREAM_RATIO = 0.5;
|
|
2
|
-
export declare const DIFF_REVIEW_RATIO = 0.5;
|
|
3
|
-
export declare const SHELL_OUTPUT_RATIO = 0.4;
|
|
4
|
-
export declare const FOOTER_RESERVED_LINES = 4;
|
|
5
|
-
export declare const useTerminalLayout: () => {
|
|
6
|
-
readonly rows: any;
|
|
7
|
-
readonly maxAgentStreamingLines: number;
|
|
8
|
-
readonly shellViewHeight: number;
|
|
9
|
-
readonly diffReviewHeight: number;
|
|
10
|
-
readonly layoutConstants: {
|
|
11
|
-
readonly AGENT_STREAM_RATIO: 0.5;
|
|
12
|
-
readonly DIFF_REVIEW_RATIO: 0.5;
|
|
13
|
-
readonly SHELL_OUTPUT_RATIO: 0.4;
|
|
14
|
-
readonly FOOTER_RESERVED_LINES: 4;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
export type HttpGet = <T = unknown>(url: string) => Promise<{
|
|
3
|
-
data: T;
|
|
4
|
-
}>;
|
|
5
|
-
export type VersionCheckDeps = {
|
|
6
|
-
httpGet: HttpGet;
|
|
7
|
-
execSync: typeof execSync;
|
|
8
|
-
exit: (code: number) => never;
|
|
9
|
-
log: typeof console.log;
|
|
10
|
-
error: typeof console.error;
|
|
11
|
-
env: NodeJS.ProcessEnv;
|
|
12
|
-
};
|
|
13
|
-
export declare function checkCliVersionWithDeps({ httpGet, execSync, exit, log, error: logError, env, }: VersionCheckDeps): Promise<void>;
|
|
14
|
-
export declare function checkCliVersion(): Promise<void>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BackendMessage, ClientMessage } from '../types/index.js';
|
|
2
|
-
type MessageHandler = (data: BackendMessage) => void;
|
|
3
|
-
type StatusChangeHandler = (status: 'connecting' | 'connected' | 'disconnected') => void;
|
|
4
|
-
export declare class WebSocketClient {
|
|
5
|
-
private ws;
|
|
6
|
-
private messageHandler;
|
|
7
|
-
private onStatusChange;
|
|
8
|
-
private sessionId;
|
|
9
|
-
private handshakeSent;
|
|
10
|
-
private isConnecting;
|
|
11
|
-
private connectionPromise;
|
|
12
|
-
private messageQueue;
|
|
13
|
-
private isReadyForUserInput;
|
|
14
|
-
private status;
|
|
15
|
-
private setStatus;
|
|
16
|
-
private createSession;
|
|
17
|
-
private setupWebSocketConnection;
|
|
18
|
-
private flushMessageQueue;
|
|
19
|
-
ensureConnected(): Promise<void>;
|
|
20
|
-
connect(messageHandler: MessageHandler, onStatusChange: StatusChangeHandler): Promise<void>;
|
|
21
|
-
send(data: ClientMessage): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
export declare const websocketClient: WebSocketClient;
|
|
24
|
-
export {};
|
package/dist/tools/Edit.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const Edit: (parameters: {
|
|
2
|
-
file_path: string;
|
|
3
|
-
old_string: string;
|
|
4
|
-
new_string: string;
|
|
5
|
-
expected_replacements?: number;
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
success: boolean;
|
|
8
|
-
replacementsMade: number;
|
|
9
|
-
error?: undefined;
|
|
10
|
-
} | {
|
|
11
|
-
error: any;
|
|
12
|
-
success?: undefined;
|
|
13
|
-
replacementsMade?: undefined;
|
|
14
|
-
}>;
|
|
@@ -1,13 +0,0 @@
|
|
|
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>;
|