human-to-code 0.1.13 → 0.1.16
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 +21 -43
- package/SECURITY.md +16 -1
- package/dist/agents/direct/application.d.ts +10 -0
- package/dist/agents/direct/application.d.ts.map +1 -0
- package/dist/agents/direct/application.js +51 -0
- package/dist/agents/direct/application.js.map +1 -0
- package/dist/agents/direct/candidate-validation.d.ts +8 -0
- package/dist/agents/direct/candidate-validation.d.ts.map +1 -0
- package/dist/agents/direct/candidate-validation.js +125 -0
- package/dist/agents/direct/candidate-validation.js.map +1 -0
- package/dist/agents/direct/declarations.d.ts +3 -0
- package/dist/agents/direct/declarations.d.ts.map +1 -0
- package/dist/agents/direct/declarations.js +36 -0
- package/dist/agents/direct/declarations.js.map +1 -0
- package/dist/agents/direct/discovery.d.ts +6 -0
- package/dist/agents/direct/discovery.d.ts.map +1 -0
- package/dist/agents/direct/discovery.js +144 -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 +170 -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 +13 -0
- package/dist/agents/direct/index.d.ts.map +1 -0
- package/dist/agents/direct/index.js +13 -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 +83 -0
- package/dist/agents/direct/marker-parser.js.map +1 -0
- package/dist/agents/direct/presentation.d.ts +7 -0
- package/dist/agents/direct/presentation.d.ts.map +1 -0
- package/dist/agents/direct/presentation.js +42 -0
- package/dist/agents/direct/presentation.js.map +1 -0
- package/dist/agents/direct/replacement.d.ts +10 -0
- package/dist/agents/direct/replacement.d.ts.map +1 -0
- package/dist/agents/direct/replacement.js +19 -0
- package/dist/agents/direct/replacement.js.map +1 -0
- package/dist/agents/direct/types.d.ts +87 -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 +22 -61
- 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/file-memory.d.ts.map +1 -1
- package/dist/pipeline/file-memory.js +42 -1
- package/dist/pipeline/file-memory.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 +42 -35
- package/docs/MODULES.md +51 -11
- package/docs/SCALABILITY.md +11 -9
- package/docs/roadmap/README.md +3 -2
- package/docs/roadmap/ruby.md +3 -4
- package/package.json +5 -8
- package/dist/pipeline/agent-tools.d.ts +0 -348
- package/dist/pipeline/agent-tools.d.ts.map +0 -1
- package/dist/pipeline/agent-tools.js +0 -542
- package/dist/pipeline/agent-tools.js.map +0 -1
- package/dist/pipeline/agent-tui.d.ts +0 -15
- package/dist/pipeline/agent-tui.d.ts.map +0 -1
- package/dist/pipeline/agent-tui.js +0 -133
- package/dist/pipeline/agent-tui.js.map +0 -1
- package/dist/pipeline/deep-agent.d.ts +0 -61
- package/dist/pipeline/deep-agent.d.ts.map +0 -1
- package/dist/pipeline/deep-agent.js +0 -395
- package/dist/pipeline/deep-agent.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/agents/direct/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { WorkspaceProfileV1 } from "../../analysis/analyzer.ts";
|
|
2
|
+
import type { ContextManifestV1 } from "../../context/context.ts";
|
|
3
|
+
import type { PatchSetV1 } from "../../core/contracts.ts";
|
|
4
|
+
/** Reject external APIs not proven by dependencies plus selected evidence. */
|
|
5
|
+
export declare function assertExternalApisGrounded(patch: PatchSetV1, workspaces: readonly WorkspaceProfileV1[], manifest: ContextManifestV1): void;
|
|
6
|
+
//# sourceMappingURL=api-grounding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-grounding.d.ts","sourceRoot":"","sources":["../../../src/agents/guided/api-grounding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AA6F1D,8EAA8E;AAC9E,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,SAAS,kBAAkB,EAAE,EACzC,QAAQ,EAAE,iBAAiB,GAC1B,IAAI,CAiEN"}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { DocumentationError } from "../../context/documentation.js";
|
|
2
|
+
const PYTHON_STDLIB_MODULES = new Set([
|
|
3
|
+
"abc", "argparse", "asyncio", "base64", "bisect", "builtins", "calendar", "collections", "concurrent",
|
|
4
|
+
"contextlib", "contextvars", "copy", "csv", "dataclasses", "datetime", "decimal", "enum", "functools",
|
|
5
|
+
"getpass", "glob", "gzip", "hashlib", "heapq", "hmac", "html", "http", "importlib", "inspect", "io",
|
|
6
|
+
"itertools", "json", "logging", "math", "multiprocessing", "operator", "os", "pathlib", "pickle", "queue",
|
|
7
|
+
"random", "re", "secrets", "shlex", "shutil", "signal", "socket", "sqlite3", "statistics", "string",
|
|
8
|
+
"struct", "subprocess", "sys", "tempfile", "textwrap", "threading", "time", "tomllib", "traceback", "types", "typing",
|
|
9
|
+
"unittest", "urllib", "uuid", "warnings", "weakref", "xml", "zipfile", "zoneinfo",
|
|
10
|
+
]);
|
|
11
|
+
function addedOperationText(patch) {
|
|
12
|
+
return patch.operations.flatMap((operation) => {
|
|
13
|
+
if (operation.kind === "create")
|
|
14
|
+
return [{ path: operation.path, text: operation.content }];
|
|
15
|
+
if (operation.kind !== "edit")
|
|
16
|
+
return [];
|
|
17
|
+
const before = new Set(operation.oldText.split("\n").map((line) => line.trim()));
|
|
18
|
+
return [{
|
|
19
|
+
path: operation.path,
|
|
20
|
+
text: operation.newText.split("\n").filter((line) => !before.has(line.trim())).join("\n"),
|
|
21
|
+
}];
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function extractIntroducedApis(patch) {
|
|
25
|
+
const result = [];
|
|
26
|
+
for (const { path, text } of addedOperationText(patch)) {
|
|
27
|
+
if (/\.(?:[cm]?[jt]sx?)$/iu.test(path)) {
|
|
28
|
+
const imports = /import\s+(?:(\w+)\s*,?\s*)?(?:\{([^}]+)\}\s*)?from\s*["']([^"']+)["']|(?:require|import)\s*\(\s*["']([^"']+)["']\s*\)/gu;
|
|
29
|
+
for (const match of text.matchAll(imports)) {
|
|
30
|
+
const module = match[3] ?? match[4];
|
|
31
|
+
if (!module || module.startsWith(".") || module.startsWith("node:"))
|
|
32
|
+
continue;
|
|
33
|
+
const symbols = [
|
|
34
|
+
match[1] ?? "",
|
|
35
|
+
...(match[2] ?? "").split(",").map((item) => item.trim().split(/\s+as\s+/u)[0] ?? ""),
|
|
36
|
+
].filter(Boolean);
|
|
37
|
+
result.push({ module, symbols, path });
|
|
38
|
+
}
|
|
39
|
+
for (const match of text.matchAll(/(?:^|\n)\s*import\s*["']([^"']+)["']/gu)) {
|
|
40
|
+
if (match[1] && !match[1].startsWith(".") && !match[1].startsWith("node:")) {
|
|
41
|
+
result.push({ module: match[1], symbols: [], path });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
for (const match of text.matchAll(/\bexport\s+(?:\*|\{([^}]+)\})\s+from\s*["']([^"']+)["']/gu)) {
|
|
45
|
+
const module = match[2];
|
|
46
|
+
if (!module || module.startsWith(".") || module.startsWith("node:"))
|
|
47
|
+
continue;
|
|
48
|
+
const symbols = (match[1] ?? "").split(",")
|
|
49
|
+
.map((item) => item.trim().split(/\s+as\s+/u)[0] ?? "")
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
result.push({ module, symbols, path });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else if (/\.pyi?$/iu.test(path)) {
|
|
55
|
+
const imports = /^(?:from\s+([A-Za-z_][\w.]*)\s+import\s+([^\n#]+)|import\s+([A-Za-z_][\w.]*)(?:\s+as\s+\w+)?)/gmu;
|
|
56
|
+
for (const match of text.matchAll(imports)) {
|
|
57
|
+
const module = (match[1] ?? match[3] ?? "").split(".")[0];
|
|
58
|
+
const symbols = (match[2] ?? "").split(",")
|
|
59
|
+
.map((item) => item.trim().split(/\s+as\s+/u)[0] ?? "")
|
|
60
|
+
.filter(Boolean);
|
|
61
|
+
result.push({ module, symbols, path });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (/\.rs$/iu.test(path)) {
|
|
65
|
+
for (const match of text.matchAll(/^use\s+([A-Za-z_][\w-]*)::([^;]+);/gmu)) {
|
|
66
|
+
const module = match[1];
|
|
67
|
+
if (["std", "core", "alloc", "crate", "self", "super"].includes(module))
|
|
68
|
+
continue;
|
|
69
|
+
const symbols = (match[2] ?? "").replace(/[{}]/gu, "").split(",")
|
|
70
|
+
.map((item) => item.trim().split("::").at(-1) ?? "")
|
|
71
|
+
.filter(Boolean);
|
|
72
|
+
result.push({ module, symbols, path });
|
|
73
|
+
}
|
|
74
|
+
for (const match of text.matchAll(/\bextern\s+crate\s+([A-Za-z_][\w-]*)\s*;/gu)) {
|
|
75
|
+
if (match[1])
|
|
76
|
+
result.push({ module: match[1], symbols: [], path });
|
|
77
|
+
}
|
|
78
|
+
for (const match of text.matchAll(/\b([a-z_][\w-]*)::([A-Za-z_][\w]*)/gu)) {
|
|
79
|
+
const module = match[1];
|
|
80
|
+
if (!module || ["std", "core", "alloc", "crate", "self", "super"].includes(module))
|
|
81
|
+
continue;
|
|
82
|
+
result.push({ module, symbols: match[2] ? [match[2]] : [], path });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
function packageName(module) {
|
|
89
|
+
if (module.startsWith("@"))
|
|
90
|
+
return module.split("/").slice(0, 2).join("/");
|
|
91
|
+
return module.split("/")[0] ?? module;
|
|
92
|
+
}
|
|
93
|
+
/** Reject external APIs not proven by dependencies plus selected evidence. */
|
|
94
|
+
export function assertExternalApisGrounded(patch, workspaces, manifest) {
|
|
95
|
+
if (workspaces.length > 0 && workspaces.every((workspace) => workspace.ecosystem === "general"))
|
|
96
|
+
return;
|
|
97
|
+
const aliases = workspaces.flatMap((workspace) => Object.keys(workspace.moduleAliases));
|
|
98
|
+
const workspacePackages = new Set(workspaces.flatMap((workspace) => workspace.workspaceDependencies));
|
|
99
|
+
const dependencies = new Map();
|
|
100
|
+
const pythonLocalModules = new Set();
|
|
101
|
+
for (const workspace of workspaces) {
|
|
102
|
+
for (const dependency of workspace.framework.dependencies) {
|
|
103
|
+
dependencies.set(dependency.name.toLowerCase().replaceAll("-", "_"), dependency.name);
|
|
104
|
+
}
|
|
105
|
+
if (workspace.ecosystem !== "fastapi")
|
|
106
|
+
continue;
|
|
107
|
+
for (const sourceRoot of workspace.sourceRoots) {
|
|
108
|
+
const segments = sourceRoot.split("/").filter((segment) => segment !== ".");
|
|
109
|
+
if (segments.length > 0)
|
|
110
|
+
pythonLocalModules.add(segments.at(-1).toLowerCase());
|
|
111
|
+
const sourcePaths = [
|
|
112
|
+
...workspace.entryPoints,
|
|
113
|
+
...workspace.routes,
|
|
114
|
+
...workspace.evidence.filter((item) => item.kind === "source").map((item) => item.path),
|
|
115
|
+
];
|
|
116
|
+
for (const path of sourcePaths) {
|
|
117
|
+
if (sourceRoot !== "." && !path.startsWith(`${sourceRoot}/`))
|
|
118
|
+
continue;
|
|
119
|
+
const relativePath = sourceRoot === "." ? path : path.slice(sourceRoot.length + 1);
|
|
120
|
+
const top = relativePath.split("/")[0];
|
|
121
|
+
if (top && !top.endsWith(".py"))
|
|
122
|
+
pythonLocalModules.add(top.toLowerCase());
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
const groundedEvidence = manifest.evidence.filter((item) => item.origin === "official_documentation"
|
|
127
|
+
|| item.origin === "dependency" && "path" in item
|
|
128
|
+
&& /(?:^|\/)(?:node_modules|site-packages|vendor)\//u.test(item.path));
|
|
129
|
+
for (const api of extractIntroducedApis(patch)) {
|
|
130
|
+
if (aliases.some((alias) => api.module === alias || api.module.startsWith(`${alias}/`)))
|
|
131
|
+
continue;
|
|
132
|
+
if (workspacePackages.has(packageName(api.module)))
|
|
133
|
+
continue;
|
|
134
|
+
const normalized = packageName(api.module).toLowerCase().replaceAll("-", "_");
|
|
135
|
+
const dependency = dependencies.get(normalized);
|
|
136
|
+
if (!dependency) {
|
|
137
|
+
const localPython = /\.pyi?$/iu.test(api.path)
|
|
138
|
+
&& (PYTHON_STDLIB_MODULES.has(normalized)
|
|
139
|
+
|| pythonLocalModules.has(packageName(api.module).toLowerCase()));
|
|
140
|
+
if (localPython)
|
|
141
|
+
continue;
|
|
142
|
+
throw new DocumentationError("CONTEXT_INSUFFICIENT", `Introduced external module '${api.module}' is not proven by the target workspace dependency graph.`);
|
|
143
|
+
}
|
|
144
|
+
const evidence = groundedEvidence.filter((item) => item.content.toLowerCase().includes(dependency.toLowerCase().replaceAll("-", "_"))
|
|
145
|
+
|| "path" in item && item.path.toLowerCase().includes(dependency.toLowerCase()));
|
|
146
|
+
if (evidence.length === 0) {
|
|
147
|
+
throw new DocumentationError("CONTEXT_INSUFFICIENT", `No installed source/declaration or version-matched official documentation was supplied for '${dependency}'.`);
|
|
148
|
+
}
|
|
149
|
+
for (const symbol of api.symbols) {
|
|
150
|
+
if (symbol === "*" || symbol.length < 2)
|
|
151
|
+
continue;
|
|
152
|
+
if (!evidence.some((item) => item.content.includes(symbol))) {
|
|
153
|
+
throw new DocumentationError("CONTEXT_INSUFFICIENT", `External API '${dependency}.${symbol}' was introduced without exact local or documented evidence.`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
//# sourceMappingURL=api-grounding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-grounding.js","sourceRoot":"","sources":["../../../src/agents/guided/api-grounding.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASpE,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY;IACrG,YAAY,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,E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,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,kBAAkB,CAC1B,sBAAsB,EACtB,+FAA+F,UAAU,IAAI,CAC9G,CAAC;QACJ,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;YACjC,IAAI,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,SAAS;YAClD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;gBAC5D,MAAM,IAAI,kBAAkB,CAC1B,sBAAsB,EACtB,iBAAiB,UAAU,IAAI,MAAM,8DAA8D,CACpG,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Public surface of the reviewed, grounded, and validated guided agent. */
|
|
2
|
+
export * from "./workflow.ts";
|
|
3
|
+
export * from "./types.ts";
|
|
4
|
+
export * from "./workspace-policy.ts";
|
|
5
|
+
export * from "./patch-diff.ts";
|
|
6
|
+
export * from "./api-grounding.ts";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/guided/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Public surface of the reviewed, grounded, and validated guided agent. */
|
|
2
|
+
export * from "./workflow.js";
|
|
3
|
+
export * from "./types.js";
|
|
4
|
+
export * from "./workspace-policy.js";
|
|
5
|
+
export * from "./patch-diff.js";
|
|
6
|
+
export * from "./api-grounding.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/guided/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-diff.d.ts","sourceRoot":"","sources":["../../../src/agents/guided/patch-diff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE1D,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CA4BzD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Render structured patch operations as a stable, review-oriented diff. */
|
|
2
|
+
export function renderPatchDiff(patch) {
|
|
3
|
+
const blocks = [];
|
|
4
|
+
for (const operation of patch.operations) {
|
|
5
|
+
if (operation.kind === "rename") {
|
|
6
|
+
blocks.push(`rename from ${operation.from}\nrename to ${operation.path}`);
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
const before = operation.kind === "create"
|
|
10
|
+
? ""
|
|
11
|
+
: operation.kind === "edit"
|
|
12
|
+
? operation.oldText
|
|
13
|
+
: "[content bound by base hash; omitted from model artifact]";
|
|
14
|
+
const after = operation.kind === "delete"
|
|
15
|
+
? ""
|
|
16
|
+
: operation.kind === "edit"
|
|
17
|
+
? operation.newText
|
|
18
|
+
: operation.content;
|
|
19
|
+
const oldPath = operation.kind === "create" ? "/dev/null" : `a/${operation.path}`;
|
|
20
|
+
const newPath = operation.kind === "delete" ? "/dev/null" : `b/${operation.path}`;
|
|
21
|
+
blocks.push([
|
|
22
|
+
`--- ${oldPath}`,
|
|
23
|
+
`+++ ${newPath}`,
|
|
24
|
+
"@@ human-to-code structured operation @@",
|
|
25
|
+
...before.split("\n").map((line) => `-${line}`),
|
|
26
|
+
...after.split("\n").map((line) => `+${line}`),
|
|
27
|
+
].join("\n"));
|
|
28
|
+
}
|
|
29
|
+
return `${blocks.join("\n\n")}\n`;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=patch-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patch-diff.js","sourceRoot":"","sources":["../../../src/agents/guided/patch-diff.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,KAAiB;IAC/C,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC,eAAe,SAAS,CAAC,IAAI,eAAe,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;YAC1E,SAAS;QACX,CAAC;QACD,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,KAAK,QAAQ;YACxC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM;gBACzB,CAAC,CAAC,SAAS,CAAC,OAAO;gBACnB,CAAC,CAAC,2DAA2D,CAAC;QAClE,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,KAAK,QAAQ;YACvC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,MAAM;gBACzB,CAAC,CAAC,SAAS,CAAC,OAAO;gBACnB,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;QACxB,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;QAClF,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,EAAE,CAAC;QAClF,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,OAAO,EAAE;YAChB,OAAO,OAAO,EAAE;YAChB,0CAA0C;YAC1C,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;YAC/C,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;SAC/C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ProjectProfileV1 } from "../../analysis/analyzer.ts";
|
|
2
|
+
import type { ConfigV1 } from "../../config/config.ts";
|
|
3
|
+
import type { ChangeContractV1, RunStatus, UsageSummaryV1, ValidationReportV1 } from "../../core/contracts.ts";
|
|
4
|
+
import type { RunStore } from "../../pipeline/run-store.ts";
|
|
5
|
+
import type { validateBaselineAndCandidate } from "../../pipeline/validation.ts";
|
|
6
|
+
import type { ProviderAdapter } from "../../providers/provider.ts";
|
|
7
|
+
export interface ProviderCertificationV1 {
|
|
8
|
+
matrixKey: string;
|
|
9
|
+
certified: boolean;
|
|
10
|
+
reason: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RunCertificationV1 {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
supportMatrixVersion: string;
|
|
15
|
+
provider: ProviderCertificationV1;
|
|
16
|
+
profileCertified: boolean;
|
|
17
|
+
certified: boolean;
|
|
18
|
+
reasons: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface GenerateRunOptions {
|
|
21
|
+
root: string;
|
|
22
|
+
profile: ProjectProfileV1;
|
|
23
|
+
contract: ChangeContractV1;
|
|
24
|
+
config: ConfigV1;
|
|
25
|
+
provider: ProviderAdapter;
|
|
26
|
+
store?: RunStore;
|
|
27
|
+
offline?: boolean;
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkflowOutcome {
|
|
31
|
+
runId: string;
|
|
32
|
+
status: RunStatus;
|
|
33
|
+
diagnostics: string[];
|
|
34
|
+
diff?: string;
|
|
35
|
+
report?: ValidationReportV1;
|
|
36
|
+
/** Cumulative provider usage for runs that reached the provider. */
|
|
37
|
+
usage?: UsageSummaryV1;
|
|
38
|
+
/** Fixed CLI exit code when status alone cannot distinguish the failure. */
|
|
39
|
+
exitCode?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface ValidateStoredRunOptions {
|
|
42
|
+
runId: string;
|
|
43
|
+
store?: RunStore;
|
|
44
|
+
sandboxImage?: string;
|
|
45
|
+
dockerBinary?: string;
|
|
46
|
+
manualChecksPassed?: boolean;
|
|
47
|
+
/** Present only for guided validation; standalone validate never guesses credentials. */
|
|
48
|
+
provider?: ProviderAdapter;
|
|
49
|
+
/** Must exactly match the configuration persisted during generation. */
|
|
50
|
+
config?: ConfigV1;
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
/** Deterministic test seam; production always uses the strong-sandbox runner. */
|
|
53
|
+
validationRunner?: typeof validateBaselineAndCandidate;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agents/guided/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAw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B;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,wEAAwE;IACxE,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,OAAO,4BAA4B,CAAC;CACxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/agents/guided/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Auditable generation, isolated validation, and explicit application workflow. */
|
|
2
|
+
import { type ProjectProfileV1 } from "../../analysis/analyzer.ts";
|
|
3
|
+
import { type ConfigV1 } from "../../config/config.ts";
|
|
4
|
+
import { type ChangeContractV1 } from "../../core/contracts.ts";
|
|
5
|
+
import { type ContextManifestV1 } from "../../context/context.ts";
|
|
6
|
+
import { RunStore } from "../../pipeline/run-store.ts";
|
|
7
|
+
import type { GenerateRunOptions, ValidateStoredRunOptions, WorkflowOutcome } from "./types.ts";
|
|
8
|
+
export type { GenerateRunOptions, ProviderCertificationV1, RunCertificationV1, ValidateStoredRunOptions, WorkflowOutcome, } from "./types.ts";
|
|
9
|
+
export { createValidationPlan, resolveWorkspaceConfig } from "./workspace-policy.ts";
|
|
10
|
+
export { renderPatchDiff } from "./patch-diff.ts";
|
|
11
|
+
export declare function buildContextPreview(rootInput: string, profile: ProjectProfileV1, contract: ChangeContractV1, config: ConfigV1, offline?: boolean): Promise<ContextManifestV1>;
|
|
12
|
+
export declare function generateRun(input: GenerateRunOptions): Promise<WorkflowOutcome>;
|
|
13
|
+
export declare function validateStoredRun(options: ValidateStoredRunOptions): Promise<WorkflowOutcome>;
|
|
14
|
+
export declare function applyVerifiedRun(runId: string, store?: RunStore): Promise<WorkflowOutcome>;
|
|
15
|
+
export declare function rollbackAppliedRun(runId: string, store?: RunStore): Promise<WorkflowOutcome>;
|
|
16
|
+
export declare function rootRelative(root: string, path: string): string;
|
|
17
|
+
//# sourceMappingURL=workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/agents/guided/workflow.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAMpF,OAAO,EAA0C,KAAK,gBAAgB,EAA2B,MAAM,4BAA4B,CAAC;AAGpI,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAQL,KAAK,gBAAgB,EAStB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AAalC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAavD,OAAO,KAAK,EACV,kBAAkB,EAGlB,wBAAwB,EACxB,eAAe,EAChB,MAAM,YAAY,CAAC;AAIpB,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAwPlD,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,gBAAgB,EAC1B,MAAM,EAAE,QAAQ,EAChB,OAAO,UAA0C,GAChD,OAAO,CAAC,iBAAiB,CAAC,CAsB5B;AAmGD,wBAAsB,WAAW,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO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