human-to-code 0.1.13 → 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 +4 -39
- 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 +4 -55
- 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 -29
- package/docs/MODULES.md +46 -10
- package/docs/SCALABILITY.md +10 -9
- package/docs/roadmap/README.md +1 -1
- package/docs/roadmap/ruby.md +1 -1
- package/package.json +1 -6
- 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,68 @@
|
|
|
1
|
+
/** Advance past a quoted region so comment-shaped text inside it stays inert. */
|
|
2
|
+
function endOfQuotedRegion(text, start) {
|
|
3
|
+
const quote = text[start];
|
|
4
|
+
const triple = quote !== "`" && text.startsWith(quote.repeat(3), start);
|
|
5
|
+
const delimiter = triple ? quote.repeat(3) : quote;
|
|
6
|
+
let offset = start + delimiter.length;
|
|
7
|
+
while (offset < text.length) {
|
|
8
|
+
if (text[offset] === "\\") {
|
|
9
|
+
offset = Math.min(offset + 2, text.length);
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (text.startsWith(delimiter, offset))
|
|
13
|
+
return offset + delimiter.length;
|
|
14
|
+
if (!triple && quote !== "`" && (text[offset] === "\n" || text[offset] === "\r"))
|
|
15
|
+
return offset;
|
|
16
|
+
offset += 1;
|
|
17
|
+
}
|
|
18
|
+
return text.length;
|
|
19
|
+
}
|
|
20
|
+
function lineEnd(text, start) {
|
|
21
|
+
const newline = text.indexOf("\n", start);
|
|
22
|
+
return newline === -1 ? text.length : newline;
|
|
23
|
+
}
|
|
24
|
+
/** Find every lexical `@human` comment marker with its exact character range. */
|
|
25
|
+
export function extractInlineMarkers(text) {
|
|
26
|
+
const markers = [];
|
|
27
|
+
let offset = 0;
|
|
28
|
+
while (offset < text.length) {
|
|
29
|
+
const character = text[offset];
|
|
30
|
+
if (character === "'" || character === '"' || character === "`") {
|
|
31
|
+
offset = endOfQuotedRegion(text, offset);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (text.startsWith("//", offset)) {
|
|
35
|
+
const end = lineEnd(text, offset);
|
|
36
|
+
const match = /^[ \t]*@human\b[ \t]*([^\r]*)$/u.exec(text.slice(offset + 2, end));
|
|
37
|
+
const prompt = (match?.[1] ?? "").trim();
|
|
38
|
+
if (match && prompt.length > 0)
|
|
39
|
+
markers.push({ prompt, start: offset, end });
|
|
40
|
+
offset = end;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
if (text.startsWith("/*", offset)) {
|
|
44
|
+
const close = text.indexOf("*/", offset + 2);
|
|
45
|
+
const end = close === -1 ? text.length : close + 2;
|
|
46
|
+
if (close !== -1) {
|
|
47
|
+
const match = /^\s*@human\b[ \t]*([\s\S]*)$/u.exec(text.slice(offset + 2, close));
|
|
48
|
+
const prompt = (match?.[1] ?? "").trim();
|
|
49
|
+
if (match && prompt.length > 0)
|
|
50
|
+
markers.push({ prompt, start: offset, end });
|
|
51
|
+
}
|
|
52
|
+
offset = end;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (character === "#") {
|
|
56
|
+
const end = lineEnd(text, offset);
|
|
57
|
+
const match = /^[ \t]*@human\b[ \t]*([^\r]*)$/u.exec(text.slice(offset + 1, end));
|
|
58
|
+
const prompt = (match?.[1] ?? "").trim();
|
|
59
|
+
if (match && prompt.length > 0)
|
|
60
|
+
markers.push({ prompt, start: offset, end });
|
|
61
|
+
offset = end;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
offset += 1;
|
|
65
|
+
}
|
|
66
|
+
return markers;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=marker-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker-parser.js","sourceRoot":"","sources":["../../../src/agents/direct/marker-parser.ts"],"names":[],"mappings":"AAMA,iFAAiF;AACjF,SAAS,iBAAiB,CAAC,IAAY,EAAE,KAAa;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAE,CAAC;IAC3B,MAAM,MAAM,GAAG,KAAK,KAAK,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACxE,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,IAAI,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC,MAAM,CAAC;IAEtC,OAAO,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,C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YACb,SAAS;QACX,CAAC;QAED,IAAI,SAAS,KAAK,GAAG,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAClC,MAAM,KAAK,GAAG,iCAAiC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;YAClF,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YACzC,IAAI,KAAK,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YAC7E,MAAM,GAAG,GAAG,CAAC;YACb,SAAS;QACX,CAAC;QAED,MAAM,IAAI,CAAC,CAAC;IACd,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ConversionUnit } from "./types.ts";
|
|
2
|
+
export declare function renderReceipt(units: readonly ConversionUnit[], provider: string, model: string, language: string): string;
|
|
3
|
+
export declare function stripCodeFence(output: string): string;
|
|
4
|
+
//# sourceMappingURL=presentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/presentation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,cAAc,EAAE,EAChC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,MAAM,CAkBR;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAIrD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { languageProfile } from "./languages.js";
|
|
2
|
+
export function renderReceipt(units, provider, model, language) {
|
|
3
|
+
const profile = languageProfile(language);
|
|
4
|
+
const lines = [
|
|
5
|
+
"human-to-code — conversion receipt",
|
|
6
|
+
"",
|
|
7
|
+
` Language : ${profile.label} (.${profile.ext})`,
|
|
8
|
+
` Provider : ${provider}`,
|
|
9
|
+
` Model : ${model}`,
|
|
10
|
+
` Engine : direct (one model request per prompt)`,
|
|
11
|
+
` Requests : ${units.length}`,
|
|
12
|
+
"",
|
|
13
|
+
];
|
|
14
|
+
if (units.length === 0)
|
|
15
|
+
lines.push(" No .human files or @human markers were found.");
|
|
16
|
+
else {
|
|
17
|
+
lines.push(" The following will be generated:");
|
|
18
|
+
for (const unit of units)
|
|
19
|
+
lines.push(` • ${unit.describe}`);
|
|
20
|
+
}
|
|
21
|
+
return `${lines.join("\n")}\n`;
|
|
22
|
+
}
|
|
23
|
+
export function stripCodeFence(output) {
|
|
24
|
+
const trimmed = output.trim();
|
|
25
|
+
const match = /^```(?:[\w.+-]+)?\s*\n?([\s\S]*?)\n?```$/u.exec(trimmed);
|
|
26
|
+
return (match?.[1] ?? trimmed).trim();
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=presentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation.js","sourceRoot":"","sources":["../../../src/agents/direct/presentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,MAAM,UAAU,aAAa,CAC3B,KAAgC,EAChC,QAAgB,EAChB,KAAa,EACb,QAAgB;IAEhB,MAAM,OAAO,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,KAAK,GAAG;QACZ,oCAAoC;QACpC,EAAE;QACF,gBAAgB,OAAO,CAAC,KAAK,MAAM,OAAO,CAAC,GAAG,GAAG;QACjD,gBAAgB,QAAQ,EAAE;QAC1B,gBAAgB,KAAK,EAAE;QACvB,oDAAoD;QACpD,gBAAgB,KAAK,CAAC,MAAM,EAAE;QAC9B,EAAE;KACH,CAAC;IACF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;SACjF,CAAC;QACJ,KAAK,CAAC,IAAI,CAAC,oCAAoC,CAAC,CAAC;QACjD,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9B,MAAM,KAAK,GAAG,2CAA2C,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { StaticFileMemoryEntry } from "../../pipeline/file-memory.ts";
|
|
2
|
+
export interface LanguageProfile {
|
|
3
|
+
/** Output file extension without a dot. */
|
|
4
|
+
ext: string;
|
|
5
|
+
/** Human label used in prompts. */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ConversionUnit {
|
|
9
|
+
kind: "file" | "inline";
|
|
10
|
+
/** Project-relative source path. */
|
|
11
|
+
sourcePath: string;
|
|
12
|
+
/** Absolute source path. */
|
|
13
|
+
absoluteSource: string;
|
|
14
|
+
/** The extracted human-language instruction. */
|
|
15
|
+
prompt: string;
|
|
16
|
+
/** For `file` units, the project-relative output path to write. */
|
|
17
|
+
outputPath?: string;
|
|
18
|
+
/** For `inline` units, the character range of the marker to replace. */
|
|
19
|
+
range?: {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
};
|
|
23
|
+
/** 1-based source line of the marker, for progress display. */
|
|
24
|
+
line?: number;
|
|
25
|
+
/** Short human-readable description for the receipt. */
|
|
26
|
+
describe: string;
|
|
27
|
+
}
|
|
28
|
+
export type FileMemoryEntry = StaticFileMemoryEntry;
|
|
29
|
+
export interface UnitGenerationContext {
|
|
30
|
+
inline: boolean;
|
|
31
|
+
/** Static declarations and earlier replacements in this unit's file. */
|
|
32
|
+
fileMemory?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GeneratedConversionUnit {
|
|
35
|
+
unit: ConversionUnit;
|
|
36
|
+
code: string;
|
|
37
|
+
/** Set when this unit could not be generated; the others are unaffected. */
|
|
38
|
+
error?: string;
|
|
39
|
+
}
|
|
40
|
+
/** Live progress for one unit during a deterministic conversion run. */
|
|
41
|
+
export type ConversionProgress = {
|
|
42
|
+
kind: "start";
|
|
43
|
+
unit: ConversionUnit;
|
|
44
|
+
attempt: number;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "done";
|
|
47
|
+
unit: ConversionUnit;
|
|
48
|
+
} | {
|
|
49
|
+
kind: "skip";
|
|
50
|
+
unit: ConversionUnit;
|
|
51
|
+
reason: string;
|
|
52
|
+
};
|
|
53
|
+
export interface GenerateUnitsOptions {
|
|
54
|
+
/** Extra generation attempts when a unit trips the FileMemory guard or the provider errors. */
|
|
55
|
+
retries?: number;
|
|
56
|
+
onProgress?: (event: ConversionProgress) => void;
|
|
57
|
+
}
|
|
58
|
+
export interface GenerateOptions {
|
|
59
|
+
language: string;
|
|
60
|
+
provider: string;
|
|
61
|
+
model: string;
|
|
62
|
+
baseUrl?: string;
|
|
63
|
+
apiKey?: string;
|
|
64
|
+
/** Whether this request replaces one inline @human marker. */
|
|
65
|
+
inline?: boolean;
|
|
66
|
+
/** Deterministic earlier replacements from the same file. */
|
|
67
|
+
fileMemory?: string;
|
|
68
|
+
signal?: AbortSignal;
|
|
69
|
+
}
|
|
70
|
+
export interface AppliedUnit {
|
|
71
|
+
unit: ConversionUnit;
|
|
72
|
+
writtenPath: string;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,4BAA4B;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,qBAAqB,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wEAAwE;AACxE,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -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,EAAE,MAAM,EAAE,WAAW;IACrG,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,IAAI;IACnG,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO;IACzG,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ;IACnG,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ;IACrH,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU;CAClF,CAAC,CAAC;AAEH,SAAS,kBAAkB,CAAC,KAAiB;IAC3C,OAAO,KA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AC,WAAW,EAAE,CAAC,CAAC,CAAC;YACtE,IAAI,WAAW;gBAAE,SAAS;YAC1B,MAAM,IAAI,kBAAkB,CAC1B,sBAAsB,EACtB,+BAA+B,GAAG,CAAC,MAAM,2DAA2D,CACrG,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAChD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;eAC/E,MAAM,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QACnF,IAAI,QAAQ,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,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|
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,wBAAwB,CAAC;AACvD,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,CAAC,CAAC;IACjB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,QAAQ,EAAE,uBAAuB,CAAC;IAClC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,oEAAoE;IACpE,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;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,kBAAk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