human-to-code 0.1.12 → 0.1.14
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 +33 -45
- package/assets/banner.svg +9 -14
- package/assets/brand/social-card.svg +6 -6
- package/dist/agents/direct/application.d.ts +7 -0
- package/dist/agents/direct/application.d.ts.map +1 -0
- package/dist/agents/direct/application.js +30 -0
- package/dist/agents/direct/application.js.map +1 -0
- package/dist/agents/direct/discovery.d.ts +4 -0
- package/dist/agents/direct/discovery.d.ts.map +1 -0
- package/dist/agents/direct/discovery.js +101 -0
- package/dist/agents/direct/discovery.js.map +1 -0
- package/dist/agents/direct/file-memory.d.ts +20 -0
- package/dist/agents/direct/file-memory.d.ts.map +1 -0
- package/dist/agents/direct/file-memory.js +174 -0
- package/dist/agents/direct/file-memory.js.map +1 -0
- package/dist/agents/direct/generation-client.d.ts +4 -0
- package/dist/agents/direct/generation-client.d.ts.map +1 -0
- package/dist/agents/direct/generation-client.js +56 -0
- package/dist/agents/direct/generation-client.js.map +1 -0
- package/dist/agents/direct/index.d.ts +10 -0
- package/dist/agents/direct/index.d.ts.map +1 -0
- package/dist/agents/direct/index.js +10 -0
- package/dist/agents/direct/index.js.map +1 -0
- package/dist/agents/direct/languages.d.ts +5 -0
- package/dist/agents/direct/languages.d.ts.map +1 -0
- package/dist/agents/direct/languages.js +17 -0
- package/dist/agents/direct/languages.js.map +1 -0
- package/dist/agents/direct/marker-parser.d.ts +8 -0
- package/dist/agents/direct/marker-parser.d.ts.map +1 -0
- package/dist/agents/direct/marker-parser.js +68 -0
- package/dist/agents/direct/marker-parser.js.map +1 -0
- package/dist/agents/direct/presentation.d.ts +4 -0
- package/dist/agents/direct/presentation.d.ts.map +1 -0
- package/dist/agents/direct/presentation.js +28 -0
- package/dist/agents/direct/presentation.js.map +1 -0
- package/dist/agents/direct/types.d.ts +74 -0
- package/dist/agents/direct/types.d.ts.map +1 -0
- package/dist/agents/direct/types.js +2 -0
- package/dist/agents/direct/types.js.map +1 -0
- package/dist/agents/guided/api-grounding.d.ts +6 -0
- package/dist/agents/guided/api-grounding.d.ts.map +1 -0
- package/dist/agents/guided/api-grounding.js +158 -0
- package/dist/agents/guided/api-grounding.js.map +1 -0
- package/dist/agents/guided/index.d.ts +7 -0
- package/dist/agents/guided/index.d.ts.map +1 -0
- package/dist/agents/guided/index.js +7 -0
- package/dist/agents/guided/index.js.map +1 -0
- package/dist/agents/guided/patch-diff.d.ts +4 -0
- package/dist/agents/guided/patch-diff.d.ts.map +1 -0
- package/dist/agents/guided/patch-diff.js +31 -0
- package/dist/agents/guided/patch-diff.js.map +1 -0
- package/dist/agents/guided/types.d.ts +55 -0
- package/dist/agents/guided/types.d.ts.map +1 -0
- package/dist/agents/guided/types.js +2 -0
- package/dist/agents/guided/types.js.map +1 -0
- package/dist/agents/guided/workflow.d.ts +17 -0
- package/dist/agents/guided/workflow.d.ts.map +1 -0
- package/dist/agents/guided/workflow.js +1360 -0
- package/dist/agents/guided/workflow.js.map +1 -0
- package/dist/agents/guided/workspace-policy.d.ts +9 -0
- package/dist/agents/guided/workspace-policy.d.ts.map +1 -0
- package/dist/agents/guided/workspace-policy.js +83 -0
- package/dist/agents/guided/workspace-policy.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +7 -107
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline/simple.d.ts +3 -160
- package/dist/pipeline/simple.d.ts.map +1 -1
- package/dist/pipeline/simple.js +3 -502
- package/dist/pipeline/simple.js.map +1 -1
- package/dist/pipeline/workflow.d.ts +5 -66
- package/dist/pipeline/workflow.d.ts.map +1 -1
- package/dist/pipeline/workflow.js +5 -1642
- package/dist/pipeline/workflow.js.map +1 -1
- package/dist/prompts/direct-conversion.d.ts +13 -0
- package/dist/prompts/direct-conversion.d.ts.map +1 -0
- package/dist/prompts/direct-conversion.js +35 -0
- package/dist/prompts/direct-conversion.js.map +1 -0
- package/dist/prompts/guided-patch.d.ts +14 -0
- package/dist/prompts/guided-patch.d.ts.map +1 -0
- package/dist/prompts/guided-patch.js +41 -0
- package/dist/prompts/guided-patch.js.map +1 -0
- package/dist/prompts/guided-repair.d.ts +12 -0
- package/dist/prompts/guided-repair.d.ts.map +1 -0
- package/dist/prompts/guided-repair.js +30 -0
- package/dist/prompts/guided-repair.js.map +1 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +6 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/provider-output.d.ts +4 -0
- package/dist/prompts/provider-output.d.ts.map +1 -0
- package/dist/prompts/provider-output.js +12 -0
- package/dist/prompts/provider-output.js.map +1 -0
- package/dist/providers/providers.d.ts.map +1 -1
- package/dist/providers/providers.js +2 -10
- package/dist/providers/providers.js.map +1 -1
- package/docs/ARCHITECTURE.md +30 -28
- package/docs/MODULES.md +46 -8
- package/docs/SCALABILITY.md +10 -8
- package/docs/roadmap/README.md +1 -1
- package/docs/roadmap/ruby.md +1 -1
- package/package.json +1 -8
- package/dist/pipeline/deep-agent.d.ts +0 -242
- package/dist/pipeline/deep-agent.d.ts.map +0 -1
- package/dist/pipeline/deep-agent.js +0 -265
- package/dist/pipeline/deep-agent.js.map +0 -1
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deep-agent orchestration for the direct `npx human-to-code .` flow.
|
|
3
|
-
*
|
|
4
|
-
* This path runs a LangChain/LangGraph "deep agent" (via the `deepagents`
|
|
5
|
-
* harness) with the four batteries-included pillars:
|
|
6
|
-
*
|
|
7
|
-
* 1. Planning — the built-in `write_todos` tool decomposes the run.
|
|
8
|
-
* 2. File System — a real-disk `FilesystemBackend` rooted at the project
|
|
9
|
-
* gives the agent `ls`/`read_file`/`write_file`/`edit_file`/
|
|
10
|
-
* `glob`/`grep` over the working tree.
|
|
11
|
-
* 3. Sub Agents — a `planner`, `implementer`, and `reviewer` subagent are
|
|
12
|
-
* reachable through the built-in `task` tool.
|
|
13
|
-
* 4. Prompts — a task-specific system prompt for the main agent and one
|
|
14
|
-
* per subagent role.
|
|
15
|
-
*
|
|
16
|
-
* Unlike the deterministic guided pipeline, the model drives scope, file
|
|
17
|
-
* reads/writes, and delegation here. The blast radius is bounded to the project
|
|
18
|
-
* root by the backend and by deny-write filesystem permissions on sensitive
|
|
19
|
-
* paths, but this is an autonomous agent, not a hash-verified patch pipeline.
|
|
20
|
-
*/
|
|
21
|
-
import { type SubAgent } from "deepagents";
|
|
22
|
-
import type { BaseChatModel } from "@langchain/core/language_models/chat_models";
|
|
23
|
-
import type { ConversionUnit } from "./simple.ts";
|
|
24
|
-
/** Provider identity and connection details for building a chat model. */
|
|
25
|
-
export interface DeepAgentModelOptions {
|
|
26
|
-
provider: string;
|
|
27
|
-
model: string;
|
|
28
|
-
baseUrl?: string;
|
|
29
|
-
apiKey?: string;
|
|
30
|
-
}
|
|
31
|
-
export interface DeepAgentRunOptions extends DeepAgentModelOptions {
|
|
32
|
-
/** Absolute project root; becomes the agent filesystem root. */
|
|
33
|
-
root: string;
|
|
34
|
-
/** Operator-declared output language. */
|
|
35
|
-
language: string;
|
|
36
|
-
/** Deterministically discovered worklist, seeded into the task prompt. */
|
|
37
|
-
units: readonly ConversionUnit[];
|
|
38
|
-
/** Test/embedding seam: skip provider construction and use this model. */
|
|
39
|
-
model_override?: BaseChatModel;
|
|
40
|
-
/** Hard cap on agent graph steps so a loop cannot run unbounded. */
|
|
41
|
-
recursionLimit?: number;
|
|
42
|
-
/** Live progress sink for interactive output (planning, tool calls, delegation). */
|
|
43
|
-
onProgress?: (event: DeepAgentProgress) => void;
|
|
44
|
-
signal?: AbortSignal;
|
|
45
|
-
}
|
|
46
|
-
export interface DeepAgentTodo {
|
|
47
|
-
content: string;
|
|
48
|
-
status: string;
|
|
49
|
-
}
|
|
50
|
-
/** A live event emitted while the agent runs, for interactive rendering. */
|
|
51
|
-
export type DeepAgentProgress = {
|
|
52
|
-
kind: "plan";
|
|
53
|
-
todos: DeepAgentTodo[];
|
|
54
|
-
} | {
|
|
55
|
-
kind: "tool";
|
|
56
|
-
name: string;
|
|
57
|
-
detail?: string;
|
|
58
|
-
} | {
|
|
59
|
-
kind: "assistant";
|
|
60
|
-
text: string;
|
|
61
|
-
};
|
|
62
|
-
export interface DeepAgentRunResult {
|
|
63
|
-
/** Final plan the agent produced (the Planning pillar's output). */
|
|
64
|
-
todos: DeepAgentTodo[];
|
|
65
|
-
/** Number of messages exchanged in the run. */
|
|
66
|
-
messageCount: number;
|
|
67
|
-
/** The agent's final natural-language summary, if any. */
|
|
68
|
-
summary: string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Construct a LangChain chat model for the configured provider.
|
|
72
|
-
*
|
|
73
|
-
* Both providers use the OpenAI-compatible chat client. Ollama is reached
|
|
74
|
-
* through its `/v1` endpoint rather than `@langchain/ollama`'s native
|
|
75
|
-
* `/api/chat`: the deep-agent harness emits tool messages with structured
|
|
76
|
-
* (array) content, which the native Ollama adapter rejects, whereas the
|
|
77
|
-
* OpenAI-compatible surface serializes them correctly.
|
|
78
|
-
*/
|
|
79
|
-
export declare function buildDeepAgentModel(options: DeepAgentModelOptions): Promise<BaseChatModel>;
|
|
80
|
-
/**
|
|
81
|
-
* Build (but do not run) the deep agent. Exposed so callers and tests can
|
|
82
|
-
* inspect wiring without a live provider.
|
|
83
|
-
*/
|
|
84
|
-
export declare function buildDeepAgent(options: DeepAgentRunOptions): Promise<import("deepagents").DeepAgent<import("deepagents").DeepAgentTypeConfig<import("langchain").ResponseFormatUndefined, undefined, import("@langchain/core/utils/types").InteropZodObject, readonly [import("langchain").AgentMiddleware<import("zod/v3").ZodObject<{
|
|
85
|
-
todos: import("zod/v3").ZodDefault<import("zod/v3").ZodArray<import("zod/v3").ZodObject<{
|
|
86
|
-
content: import("zod/v3").ZodString;
|
|
87
|
-
status: import("zod/v3").ZodEnum<["pending", "in_progress", "completed"]>;
|
|
88
|
-
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
89
|
-
content: string;
|
|
90
|
-
status: "completed" | "in_progress" | "pending";
|
|
91
|
-
}, {
|
|
92
|
-
content: string;
|
|
93
|
-
status: "completed" | "in_progress" | "pending";
|
|
94
|
-
}>, "many">>;
|
|
95
|
-
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
96
|
-
todos: {
|
|
97
|
-
content: string;
|
|
98
|
-
status: "completed" | "in_progress" | "pending";
|
|
99
|
-
}[];
|
|
100
|
-
}, {
|
|
101
|
-
todos?: {
|
|
102
|
-
content: string;
|
|
103
|
-
status: "completed" | "in_progress" | "pending";
|
|
104
|
-
}[] | undefined;
|
|
105
|
-
}>, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod/v3").ZodObject<{
|
|
106
|
-
todos: import("zod/v3").ZodArray<import("zod/v3").ZodObject<{
|
|
107
|
-
content: import("zod/v3").ZodString;
|
|
108
|
-
status: import("zod/v3").ZodEnum<["pending", "in_progress", "completed"]>;
|
|
109
|
-
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
110
|
-
content: string;
|
|
111
|
-
status: "completed" | "in_progress" | "pending";
|
|
112
|
-
}, {
|
|
113
|
-
content: string;
|
|
114
|
-
status: "completed" | "in_progress" | "pending";
|
|
115
|
-
}>, "many">;
|
|
116
|
-
}, "strip", import("zod/v3").ZodTypeAny, {
|
|
117
|
-
todos: {
|
|
118
|
-
content: string;
|
|
119
|
-
status: "completed" | "in_progress" | "pending";
|
|
120
|
-
}[];
|
|
121
|
-
}, {
|
|
122
|
-
todos: {
|
|
123
|
-
content: string;
|
|
124
|
-
status: "completed" | "in_progress" | "pending";
|
|
125
|
-
}[];
|
|
126
|
-
}>, {
|
|
127
|
-
todos: {
|
|
128
|
-
content: string;
|
|
129
|
-
status: "completed" | "in_progress" | "pending";
|
|
130
|
-
}[];
|
|
131
|
-
}, {
|
|
132
|
-
todos: {
|
|
133
|
-
content: string;
|
|
134
|
-
status: "completed" | "in_progress" | "pending";
|
|
135
|
-
}[];
|
|
136
|
-
}, import("@langchain/langgraph").Command<unknown, {
|
|
137
|
-
todos: {
|
|
138
|
-
content: string;
|
|
139
|
-
status: "completed" | "in_progress" | "pending";
|
|
140
|
-
}[];
|
|
141
|
-
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
142
|
-
}, string>, unknown, "write_todos">], readonly []>, import("langchain").AgentMiddleware<import("@langchain/langgraph").StateSchema<{
|
|
143
|
-
files: import("@langchain/langgraph").ReducedValue<{
|
|
144
|
-
[x: string]: import("deepagents").FileData;
|
|
145
|
-
} | undefined, {
|
|
146
|
-
[x: string]: import("deepagents").FileData | null;
|
|
147
|
-
} | undefined>;
|
|
148
|
-
}>, undefined, unknown, (import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
149
|
-
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
150
|
-
}, import("zod/v4/core").$strip>, {
|
|
151
|
-
path: string;
|
|
152
|
-
}, {
|
|
153
|
-
path?: string | undefined;
|
|
154
|
-
}, string, unknown, "ls"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
155
|
-
file_path: import("zod").ZodString;
|
|
156
|
-
offset: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
157
|
-
limit: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>>;
|
|
158
|
-
}, import("zod/v4/core").$strip>>, {
|
|
159
|
-
file_path: string;
|
|
160
|
-
offset: number;
|
|
161
|
-
limit: number;
|
|
162
|
-
}, unknown, {
|
|
163
|
-
type: string;
|
|
164
|
-
text: string;
|
|
165
|
-
}[] | {
|
|
166
|
-
type: string;
|
|
167
|
-
mimeType: string;
|
|
168
|
-
data: string;
|
|
169
|
-
}[], unknown, "read_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
170
|
-
file_path: import("zod").ZodString;
|
|
171
|
-
content: import("zod").ZodDefault<import("zod").ZodString>;
|
|
172
|
-
}, import("zod/v4/core").$strip>>, {
|
|
173
|
-
file_path: string;
|
|
174
|
-
content: string;
|
|
175
|
-
}, unknown, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>> | import("@langchain/langgraph").Command<unknown, {
|
|
176
|
-
files: Record<string, import("deepagents").FileData>;
|
|
177
|
-
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
178
|
-
}, string>, unknown, "write_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodPreprocess<import("zod").ZodObject<{
|
|
179
|
-
file_path: import("zod").ZodString;
|
|
180
|
-
old_string: import("zod").ZodString;
|
|
181
|
-
new_string: import("zod").ZodString;
|
|
182
|
-
replace_all: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodBoolean>>;
|
|
183
|
-
}, import("zod/v4/core").$strip>>, {
|
|
184
|
-
file_path: string;
|
|
185
|
-
old_string: string;
|
|
186
|
-
new_string: string;
|
|
187
|
-
replace_all: boolean;
|
|
188
|
-
}, unknown, string | import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>> | import("@langchain/langgraph").Command<unknown, {
|
|
189
|
-
files: Record<string, import("deepagents").FileData>;
|
|
190
|
-
messages: import("langchain").ToolMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>[];
|
|
191
|
-
}, string>, unknown, "edit_file"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
192
|
-
pattern: import("zod").ZodString;
|
|
193
|
-
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
194
|
-
}, import("zod/v4/core").$strip>, {
|
|
195
|
-
pattern: string;
|
|
196
|
-
path: string;
|
|
197
|
-
}, {
|
|
198
|
-
pattern: string;
|
|
199
|
-
path?: string | undefined;
|
|
200
|
-
}, string, unknown, "glob"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
201
|
-
pattern: import("zod").ZodString;
|
|
202
|
-
path: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
203
|
-
glob: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>>;
|
|
204
|
-
}, import("zod/v4/core").$strip>, {
|
|
205
|
-
pattern: string;
|
|
206
|
-
path: string;
|
|
207
|
-
glob: string | null;
|
|
208
|
-
}, {
|
|
209
|
-
pattern: string;
|
|
210
|
-
path?: string | undefined;
|
|
211
|
-
glob?: string | null | undefined;
|
|
212
|
-
}, string, unknown, "grep"> | import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
213
|
-
command: import("zod").ZodString;
|
|
214
|
-
}, import("zod/v4/core").$strip>, {
|
|
215
|
-
command: string;
|
|
216
|
-
}, {
|
|
217
|
-
command: string;
|
|
218
|
-
}, string, unknown, "execute">)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly [import("langchain").DynamicStructuredTool<import("zod").ZodObject<{
|
|
219
|
-
description: import("zod").ZodString;
|
|
220
|
-
subagent_type: import("zod").ZodString;
|
|
221
|
-
}, import("zod/v4/core").$strip>, {
|
|
222
|
-
description: string;
|
|
223
|
-
subagent_type: string;
|
|
224
|
-
}, {
|
|
225
|
-
description: string;
|
|
226
|
-
subagent_type: string;
|
|
227
|
-
}, string | import("@langchain/langgraph").Command<unknown, Record<string, unknown>, string>, unknown, "task">], readonly []>, import("langchain").AgentMiddleware<import("zod").ZodObject<{
|
|
228
|
-
_summarizationSessionId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
229
|
-
_summarizationEvent: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
230
|
-
cutoffIndex: import("zod").ZodNumber;
|
|
231
|
-
summaryMessage: import("zod").ZodCustom<import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>, import("langchain").HumanMessage<import("@langchain/core/messages").MessageStructure<import("@langchain/core/messages").MessageToolSet>>>;
|
|
232
|
-
filePath: import("zod").ZodNullable<import("zod").ZodString>;
|
|
233
|
-
}, import("zod/v4/core").$strip>>;
|
|
234
|
-
}, import("zod/v4/core").$strip>, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>, import("langchain").AgentMiddleware<undefined, undefined, unknown, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly []>, ...import("langchain").AgentMiddleware<any, any, any, readonly (import("@langchain/core/tools").ClientTool | import("@langchain/core/tools").ServerTool)[], readonly (() => import("@langchain/langgraph").StreamTransformer<any>)[]>[]], readonly [], readonly [SubAgent, SubAgent, SubAgent], readonly []>>>;
|
|
235
|
-
/**
|
|
236
|
-
* Run the deep agent against the discovered worklist, streaming live progress
|
|
237
|
-
* (planning, tool calls, delegation) through `onProgress`. The agent edits
|
|
238
|
-
* files on disk through its filesystem backend; this returns the final plan and
|
|
239
|
-
* summary it produced for the report.
|
|
240
|
-
*/
|
|
241
|
-
export declare function runDeepAgentConversion(options: DeepAgentRunOptions): Promise<DeepAgentRunResult>;
|
|
242
|
-
//# sourceMappingURL=deep-agent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-agent.d.ts","sourceRoot":"","sources":["../../src/pipeline/deep-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAmB,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF,OAAO,KAAK,EAAE,cAAc,EA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B,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC,CAqBhG;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gpBAchE;AAoCD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2DtG"}
|
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Deep-agent orchestration for the direct `npx human-to-code .` flow.
|
|
3
|
-
*
|
|
4
|
-
* This path runs a LangChain/LangGraph "deep agent" (via the `deepagents`
|
|
5
|
-
* harness) with the four batteries-included pillars:
|
|
6
|
-
*
|
|
7
|
-
* 1. Planning — the built-in `write_todos` tool decomposes the run.
|
|
8
|
-
* 2. File System — a real-disk `FilesystemBackend` rooted at the project
|
|
9
|
-
* gives the agent `ls`/`read_file`/`write_file`/`edit_file`/
|
|
10
|
-
* `glob`/`grep` over the working tree.
|
|
11
|
-
* 3. Sub Agents — a `planner`, `implementer`, and `reviewer` subagent are
|
|
12
|
-
* reachable through the built-in `task` tool.
|
|
13
|
-
* 4. Prompts — a task-specific system prompt for the main agent and one
|
|
14
|
-
* per subagent role.
|
|
15
|
-
*
|
|
16
|
-
* Unlike the deterministic guided pipeline, the model drives scope, file
|
|
17
|
-
* reads/writes, and delegation here. The blast radius is bounded to the project
|
|
18
|
-
* root by the backend and by deny-write filesystem permissions on sensitive
|
|
19
|
-
* paths, but this is an autonomous agent, not a hash-verified patch pipeline.
|
|
20
|
-
*/
|
|
21
|
-
import { createDeepAgent } from "deepagents";
|
|
22
|
-
import { FilesystemBackend } from "deepagents/node";
|
|
23
|
-
import { languageProfile } from "./simple.js";
|
|
24
|
-
/**
|
|
25
|
-
* Writes are denied on version-control internals, dependencies, the tool's own
|
|
26
|
-
* state, and credential-bearing files. Paths are backend-absolute globs (rooted
|
|
27
|
-
* at the project). Reads stay permissive so the agent can ground itself.
|
|
28
|
-
*/
|
|
29
|
-
const DENY_WRITE_PATHS = [
|
|
30
|
-
"/.git/**",
|
|
31
|
-
"/.hg/**",
|
|
32
|
-
"/.svn/**",
|
|
33
|
-
"/node_modules/**",
|
|
34
|
-
"/.human-to-code/**",
|
|
35
|
-
"/human-to-code.config.json",
|
|
36
|
-
"/secrets.human",
|
|
37
|
-
"/**/.env",
|
|
38
|
-
"/**/.env.*",
|
|
39
|
-
"/**/*.env",
|
|
40
|
-
"/**/*.env.*",
|
|
41
|
-
"/**/*.pem",
|
|
42
|
-
"/**/*.key",
|
|
43
|
-
"/**/id_rsa",
|
|
44
|
-
"/**/id_ed25519",
|
|
45
|
-
];
|
|
46
|
-
function mainSystemPrompt(languageLabel) {
|
|
47
|
-
return [
|
|
48
|
-
`You are human-to-code, an autonomous ${languageLabel} coding agent.`,
|
|
49
|
-
"Your job is to fulfil natural-language change requests that a developer left in their codebase, in two forms:",
|
|
50
|
-
" 1. Whole `.human` files (never `*.strict.human`): generate a sibling source file with the same base name and the language's extension, containing only real code.",
|
|
51
|
-
" 2. Inline `@human` markers inside existing source files: replace the marker comment in place with the code it asks for, preserving all surrounding code.",
|
|
52
|
-
"",
|
|
53
|
-
"Working method — be efficient; every step is a slow model call, so avoid unnecessary ones:",
|
|
54
|
-
"- First call write_todos once to record a short ordered plan covering every worklist item.",
|
|
55
|
-
"- Read each target file once with read_file to ground yourself before editing. Every path is absolute and rooted at the project: it must start with `/` (e.g. `/src/a.ts`).",
|
|
56
|
-
"- For simple items, write the code yourself directly with write_file (for `.human` file outputs) or edit_file (for inline markers). Only delegate to the `implementer` subagent for genuinely complex items, and only use the `reviewer` subagent when correctness is non-obvious. Do not delegate or review trivial one-liners.",
|
|
57
|
-
"- Never remove or rewrite code that a marker did not ask you to change. Reuse declarations that already exist in the file instead of redeclaring them.",
|
|
58
|
-
"- Keep todos updated: mark each in_progress when you start it and completed when its code is written.",
|
|
59
|
-
"- When every item is done, stop and give a one-line summary. Do not re-read or re-verify files you have already written.",
|
|
60
|
-
"",
|
|
61
|
-
"Output only real, compilable code into files. Do not add comments describing what you changed. Do not touch dependency, VCS, secret, or configuration files.",
|
|
62
|
-
].join("\n");
|
|
63
|
-
}
|
|
64
|
-
function plannerSubagent(languageLabel) {
|
|
65
|
-
return {
|
|
66
|
-
name: "planner",
|
|
67
|
-
description: "Break a human-to-code conversion request into an ordered, file-by-file implementation plan. Use before writing any code when the worklist is non-trivial.",
|
|
68
|
-
systemPrompt: [
|
|
69
|
-
`You plan ${languageLabel} conversion work.`,
|
|
70
|
-
"Given a worklist of `.human` files and inline `@human` markers, produce a concise, ordered list of concrete implementation steps.",
|
|
71
|
-
"Account for dependencies between steps (e.g. a marker that uses a symbol another marker declares).",
|
|
72
|
-
"Return only the plan as a numbered list. Write no code.",
|
|
73
|
-
].join("\n"),
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function implementerSubagent(languageLabel) {
|
|
77
|
-
return {
|
|
78
|
-
name: "implementer",
|
|
79
|
-
description: "Generate the exact code for one `.human` file or one inline `@human` marker. Delegate each concrete code-writing step to this subagent.",
|
|
80
|
-
systemPrompt: [
|
|
81
|
-
`You are a precise ${languageLabel} code generator.`,
|
|
82
|
-
"You are given one instruction and the relevant file context.",
|
|
83
|
-
"Return only the code that satisfies the instruction: for a whole-file request, the full file body; for an inline marker, only the replacement for that marker.",
|
|
84
|
-
"Reuse declarations already present in the file; never redeclare or duplicate them unless explicitly asked to shadow.",
|
|
85
|
-
"No explanations, no markdown fences, no comments describing your work.",
|
|
86
|
-
].join("\n"),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
function reviewerSubagent(languageLabel) {
|
|
90
|
-
return {
|
|
91
|
-
name: "reviewer",
|
|
92
|
-
description: "Check that generated code matches its instruction, is syntactically valid, and did not corrupt surrounding code. Use after each implementation step.",
|
|
93
|
-
systemPrompt: [
|
|
94
|
-
`You review generated ${languageLabel} code.`,
|
|
95
|
-
"Given the original instruction and the code that was written, confirm it satisfies the instruction, is syntactically plausible, and preserves unrelated surrounding code.",
|
|
96
|
-
"If it is correct, respond APPROVED with a one-line reason. If not, respond CHANGES with a concrete, minimal fix instruction.",
|
|
97
|
-
].join("\n"),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
/** Backend paths are absolute, rooted at the project (e.g. `src/a.ts` -> `/src/a.ts`). */
|
|
101
|
-
function backendPath(relativePath) {
|
|
102
|
-
return `/${relativePath.replace(/^\/+/u, "")}`;
|
|
103
|
-
}
|
|
104
|
-
function taskPrompt(units, languageLabel) {
|
|
105
|
-
const pathRule = "All filesystem tool paths are absolute and rooted at the project: they must start with `/` (for example the file `src/a.ts` is `/src/a.ts`). Never pass a relative path.";
|
|
106
|
-
if (units.length === 0) {
|
|
107
|
-
return [
|
|
108
|
-
`Scan the project for any \`.human\` files or inline \`@human\` markers and convert them to ${languageLabel}.`,
|
|
109
|
-
pathRule,
|
|
110
|
-
"If there are none, report that nothing needs conversion.",
|
|
111
|
-
].join("\n");
|
|
112
|
-
}
|
|
113
|
-
const worklist = units
|
|
114
|
-
.map((unit, index) => {
|
|
115
|
-
if (unit.kind === "file") {
|
|
116
|
-
return `${index + 1}. Whole file: read "${backendPath(unit.sourcePath)}" and write its generated ${languageLabel} into "${backendPath(unit.outputPath ?? unit.sourcePath)}". Instruction: ${unit.prompt}`;
|
|
117
|
-
}
|
|
118
|
-
return `${index + 1}. Inline marker in "${backendPath(unit.sourcePath)}": replace the @human marker in place, preserving surrounding code. Instruction: ${unit.prompt}`;
|
|
119
|
-
})
|
|
120
|
-
.join("\n");
|
|
121
|
-
return [
|
|
122
|
-
`Convert the following ${units.length} item(s) to ${languageLabel}.`,
|
|
123
|
-
pathRule,
|
|
124
|
-
"",
|
|
125
|
-
worklist,
|
|
126
|
-
"",
|
|
127
|
-
"Plan once with write_todos, read each target file once, then write the code directly with write_file or edit_file (only delegating complex items to the implementer subagent). Report a short summary of what you wrote when done.",
|
|
128
|
-
].join("\n");
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Construct a LangChain chat model for the configured provider.
|
|
132
|
-
*
|
|
133
|
-
* Both providers use the OpenAI-compatible chat client. Ollama is reached
|
|
134
|
-
* through its `/v1` endpoint rather than `@langchain/ollama`'s native
|
|
135
|
-
* `/api/chat`: the deep-agent harness emits tool messages with structured
|
|
136
|
-
* (array) content, which the native Ollama adapter rejects, whereas the
|
|
137
|
-
* OpenAI-compatible surface serializes them correctly.
|
|
138
|
-
*/
|
|
139
|
-
export async function buildDeepAgentModel(options) {
|
|
140
|
-
const { ChatOpenAI } = await import("@langchain/openai");
|
|
141
|
-
if (options.provider === "openai") {
|
|
142
|
-
return new ChatOpenAI({
|
|
143
|
-
model: options.model,
|
|
144
|
-
temperature: 0,
|
|
145
|
-
...(options.apiKey ? { apiKey: options.apiKey } : {}),
|
|
146
|
-
...(options.baseUrl ? { configuration: { baseURL: options.baseUrl } } : {}),
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
if (options.provider === "ollama") {
|
|
150
|
-
const root = (options.baseUrl ?? "http://localhost:11434").replace(/\/+$/u, "").replace(/\/v1$/u, "");
|
|
151
|
-
return new ChatOpenAI({
|
|
152
|
-
model: options.model,
|
|
153
|
-
temperature: 0,
|
|
154
|
-
// Ollama ignores the key but the OpenAI client requires a non-empty value.
|
|
155
|
-
apiKey: options.apiKey ?? "ollama",
|
|
156
|
-
configuration: { baseURL: `${root}/v1` },
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
throw new Error(`Provider '${options.provider}' has no deep-agent chat-model binding. Use openai or ollama.`);
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Build (but do not run) the deep agent. Exposed so callers and tests can
|
|
163
|
-
* inspect wiring without a live provider.
|
|
164
|
-
*/
|
|
165
|
-
export async function buildDeepAgent(options) {
|
|
166
|
-
const label = languageProfile(options.language).label;
|
|
167
|
-
const model = options.model_override ?? await buildDeepAgentModel(options);
|
|
168
|
-
const backend = new FilesystemBackend({ rootDir: options.root });
|
|
169
|
-
const permissions = [
|
|
170
|
-
{ operations: ["write"], paths: [...DENY_WRITE_PATHS], mode: "deny" },
|
|
171
|
-
];
|
|
172
|
-
return createDeepAgent({
|
|
173
|
-
model,
|
|
174
|
-
backend,
|
|
175
|
-
systemPrompt: mainSystemPrompt(label),
|
|
176
|
-
subagents: [plannerSubagent(label), implementerSubagent(label), reviewerSubagent(label)],
|
|
177
|
-
permissions,
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function normalizeTodos(raw) {
|
|
181
|
-
return raw.map((todo) => ({
|
|
182
|
-
content: typeof todo.content === "string" ? todo.content : String(todo.content ?? ""),
|
|
183
|
-
status: typeof todo.status === "string" ? todo.status : String(todo.status ?? ""),
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
/** Short human detail for a tool call (the path it touches or subagent it invokes). */
|
|
187
|
-
function toolDetail(name, args) {
|
|
188
|
-
if (!args)
|
|
189
|
-
return undefined;
|
|
190
|
-
if (name === "task") {
|
|
191
|
-
const sub = args.subagent_type ?? args.subagentType ?? args.name ?? args.description;
|
|
192
|
-
return typeof sub === "string" ? sub.split(/\s+/u).slice(0, 6).join(" ") : undefined;
|
|
193
|
-
}
|
|
194
|
-
for (const key of ["file_path", "filePath", "path", "file"]) {
|
|
195
|
-
const value = args[key];
|
|
196
|
-
if (typeof value === "string" && value.length > 0)
|
|
197
|
-
return value;
|
|
198
|
-
}
|
|
199
|
-
return undefined;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Run the deep agent against the discovered worklist, streaming live progress
|
|
203
|
-
* (planning, tool calls, delegation) through `onProgress`. The agent edits
|
|
204
|
-
* files on disk through its filesystem backend; this returns the final plan and
|
|
205
|
-
* summary it produced for the report.
|
|
206
|
-
*/
|
|
207
|
-
export async function runDeepAgentConversion(options) {
|
|
208
|
-
const agent = await buildDeepAgent(options);
|
|
209
|
-
const label = languageProfile(options.language).label;
|
|
210
|
-
const input = { messages: [{ role: "user", content: taskPrompt(options.units, label) }] };
|
|
211
|
-
const config = {
|
|
212
|
-
recursionLimit: options.recursionLimit ?? 150,
|
|
213
|
-
...(options.signal ? { signal: options.signal } : {}),
|
|
214
|
-
};
|
|
215
|
-
const seenMessages = new Set();
|
|
216
|
-
let todos = [];
|
|
217
|
-
let lastTodosKey = "";
|
|
218
|
-
let summary = "";
|
|
219
|
-
let messageCount = 0;
|
|
220
|
-
const stream = await agent.stream(input, { ...config, streamMode: "updates" });
|
|
221
|
-
for await (const chunk of stream) {
|
|
222
|
-
for (const update of Object.values(chunk)) {
|
|
223
|
-
if (!update || typeof update !== "object")
|
|
224
|
-
continue;
|
|
225
|
-
const node = update;
|
|
226
|
-
if (Array.isArray(node.todos)) {
|
|
227
|
-
const next = normalizeTodos(node.todos);
|
|
228
|
-
const key = JSON.stringify(next);
|
|
229
|
-
if (key !== lastTodosKey) {
|
|
230
|
-
lastTodosKey = key;
|
|
231
|
-
todos = next;
|
|
232
|
-
options.onProgress?.({ kind: "plan", todos: next });
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
if (Array.isArray(node.messages)) {
|
|
236
|
-
for (const raw of node.messages) {
|
|
237
|
-
const message = raw;
|
|
238
|
-
const id = typeof message.id === "string" ? message.id : undefined;
|
|
239
|
-
if (id) {
|
|
240
|
-
if (seenMessages.has(id))
|
|
241
|
-
continue;
|
|
242
|
-
seenMessages.add(id);
|
|
243
|
-
}
|
|
244
|
-
messageCount += 1;
|
|
245
|
-
const type = typeof message.getType === "function" ? message.getType() : undefined;
|
|
246
|
-
if (type === "ai") {
|
|
247
|
-
if (Array.isArray(message.tool_calls) && message.tool_calls.length > 0) {
|
|
248
|
-
for (const call of message.tool_calls) {
|
|
249
|
-
const name = typeof call.name === "string" ? call.name : "tool";
|
|
250
|
-
const detail = toolDetail(name, call.args);
|
|
251
|
-
options.onProgress?.({ kind: "tool", name, ...(detail ? { detail } : {}) });
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
else if (typeof message.content === "string" && message.content.trim().length > 0) {
|
|
255
|
-
summary = message.content.trim();
|
|
256
|
-
options.onProgress?.({ kind: "assistant", text: summary });
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return { todos, messageCount, summary };
|
|
264
|
-
}
|
|
265
|
-
//# sourceMappingURL=deep-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-agent.js","sourceRoot":"","sources":["../../src/pipeline/deep-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA8C9C;;;;GAIG;AACH,MAAM,gBAAgB,GAAsB;IAC1C,UAAU;IACV,SAAS;IACT,UAAU;IACV,kBAAkB;IAClB,oBAAoB;IACpB,4BAA4B;IAC5B,gBAAgB;IAChB,UAAU;IACV,YAAY;IACZ,WAAW;IACX,aAAa;IACb,WAAW;IACX,WAAW;IACX,YAAY;IACZ,gBAAgB;CACjB,CAAC;AAEF,SAAS,gBAAgB,CAAC,aAAqB;IAC7C,OAAO;QACL,wCAAwC,aAAa,gBAAgB;QACrE,+GAA+G;QAC/G,qKAAqK;QACrK,4JAA4J;QAC5J,EAAE;QACF,4FAA4F;QAC5F,4FAA4F;QAC5F,6KAA6K;QAC7K,kUAAkU;QAClU,wJAAwJ;QACxJ,uGAAuG;QACvG,0HAA0H;QAC1H,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