human-to-code 0.1.23 → 0.1.24
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 +29 -20
- package/SECURITY.md +18 -14
- package/dist/agents/direct/generation-client.d.ts +16 -5
- package/dist/agents/direct/generation-client.d.ts.map +1 -1
- package/dist/agents/direct/generation-client.js +9 -4
- package/dist/agents/direct/generation-client.js.map +1 -1
- package/dist/agents/direct/index.d.ts +1 -0
- package/dist/agents/direct/index.d.ts.map +1 -1
- package/dist/agents/direct/index.js +1 -0
- package/dist/agents/direct/index.js.map +1 -1
- package/dist/agents/direct/integration-validation.d.ts +38 -15
- package/dist/agents/direct/integration-validation.d.ts.map +1 -1
- package/dist/agents/direct/integration-validation.js +305 -207
- package/dist/agents/direct/integration-validation.js.map +1 -1
- package/dist/agents/direct/language-relationships.d.ts +11 -0
- package/dist/agents/direct/language-relationships.d.ts.map +1 -0
- package/dist/agents/direct/language-relationships.js +55 -0
- package/dist/agents/direct/language-relationships.js.map +1 -0
- package/dist/agents/direct/presentation.d.ts +2 -1
- package/dist/agents/direct/presentation.d.ts.map +1 -1
- package/dist/agents/direct/presentation.js +5 -3
- package/dist/agents/direct/presentation.js.map +1 -1
- package/dist/agents/direct/project-contracts.d.ts.map +1 -1
- package/dist/agents/direct/project-contracts.js +44 -0
- package/dist/agents/direct/project-contracts.js.map +1 -1
- package/dist/agents/direct/project-memory.d.ts +2 -1
- package/dist/agents/direct/project-memory.d.ts.map +1 -1
- package/dist/agents/direct/project-memory.js +11 -59
- package/dist/agents/direct/project-memory.js.map +1 -1
- package/dist/agents/direct/staged-validation.d.ts +2 -0
- package/dist/agents/direct/staged-validation.d.ts.map +1 -1
- package/dist/agents/direct/staged-validation.js +22 -1
- package/dist/agents/direct/staged-validation.js.map +1 -1
- package/dist/agents/direct/types.d.ts +8 -0
- package/dist/agents/direct/types.d.ts.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +38 -15
- package/dist/cli.js.map +1 -1
- package/dist/prompts/direct-conversion.d.ts.map +1 -1
- package/dist/prompts/direct-conversion.js +4 -3
- package/dist/prompts/direct-conversion.js.map +1 -1
- package/dist/prompts/direct-integration.d.ts +28 -8
- package/dist/prompts/direct-integration.d.ts.map +1 -1
- package/dist/prompts/direct-integration.js +51 -17
- package/dist/prompts/direct-integration.js.map +1 -1
- package/dist/prompts/direct-repair.d.ts +2 -0
- package/dist/prompts/direct-repair.d.ts.map +1 -1
- package/dist/prompts/direct-repair.js +4 -0
- package/dist/prompts/direct-repair.js.map +1 -1
- package/docs/ARCHITECTURE.md +8 -2
- package/docs/MODULES.md +4 -3
- package/docs/SCALABILITY.md +9 -7
- package/docs/roadmap/html-css.md +4 -5
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -57,7 +57,7 @@ By default this runs the **direct converter**, not an instruction to rewrite the
|
|
|
57
57
|
2. Reports marker-shaped requests in unsupported file types and refuses a `.human` request whose sibling output already exists. Intentionally ignored directories and symlinks remain outside discovery.
|
|
58
58
|
3. Prints a receipt (the output languages actually selected for this worklist, provider, model, and exact source-to-output paths) and asks for confirmation. Nothing is written until you confirm — or pass `-y`/`--yes`. If no request is found it returns `NEEDS_INPUT`.
|
|
59
59
|
4. On confirmation, converts each item with one model completion per unit, extracts one unambiguous code block, and validates the complete candidate before writing. JavaScript and TypeScript use the TypeScript parser; supported programming languages receive a deterministic structural syntax check. HTML and CSS receive the non-empty and code-fence gates because generic delimiter balancing misreads valid markup and stylesheet text. Inline validation compares the candidate with the original file and rejects only syntax errors introduced by that replacement, without blaming it for unchanged baseline errors.
|
|
60
|
-
5. When `direct.reconcileIntegrations` is explicitly enabled,
|
|
60
|
+
5. When `direct.reconcileIntegrations` is explicitly enabled, audits ProjectMemory-evidenced groups of generated files across every supported language. A strict-JSON, read-only audit checks concrete imports/includes, modules/packages/namespaces, exports/signatures/calls, schemas/configuration, routes/templates/assets/selectors, and other evidenced contracts. Reported issues receive one target-scoped repair each and one verification audit; an unresolved connected group is rejected before application. This phase is off by default, so it adds no requests or rejection behavior to an ordinary upgrade.
|
|
61
61
|
6. For JavaScript/TypeScript output, additionally stages every accepted unit into an in-memory candidate overlay and type-checks the combined candidate project with the TypeScript Compiler API — imports/exports, methods and properties, argument counts, literal unions, object shapes, readonly rules, and call compatibility across the generated files together. Diagnostics are compared against the unchanged baseline, so pre-existing project errors are never blamed on generated units. A dependency-connected group that introduces new cross-file errors receives at most one bounded repair request per whole-file unit (same provider and model); if it still fails, every generated unit in that group is rejected before application while units proven independent may still apply. Other direct languages keep their per-file validation level.
|
|
62
62
|
7. Applies each accepted item defensively: new sibling files use exclusive creation, inline markers must still match the bytes found during discovery, and multi-line replacements inherit the marker's indentation. A failing or stale item is skipped with a reason rather than aborting the rest.
|
|
63
63
|
|
|
@@ -150,9 +150,11 @@ text generation work fine.
|
|
|
150
150
|
all planned outputs succeed, stores the complete conversion plan and renders
|
|
151
151
|
its target-relevant bounded subset with an explicit omitted count, supplies
|
|
152
152
|
exact relative references to likely companion files, and summarizes relevant
|
|
153
|
-
imports, exports/declarations,
|
|
154
|
-
|
|
155
|
-
|
|
153
|
+
imports/includes, exports/declarations, modules/packages/namespaces,
|
|
154
|
+
language-specific references and manifests, plus markup ids/classes/assets,
|
|
155
|
+
stylesheet selectors/custom properties, and DOM selectors where relevant.
|
|
156
|
+
Ecosystem rules live in extensible profiles; the ProjectMemory and optional
|
|
157
|
+
reconciliation orchestration do not assume a web application. It is
|
|
156
158
|
rebuilt for each run rather than persisted, so it cannot become a stale cache.
|
|
157
159
|
Accepted candidates update the shared in-memory contracts before later files
|
|
158
160
|
are generated.
|
|
@@ -166,12 +168,12 @@ text generation work fine.
|
|
|
166
168
|
bounded repair attempt per whole-file unit); independent units still apply.
|
|
167
169
|
Pre-existing baseline errors are never attributed to generated code. This is
|
|
168
170
|
static compilation, not sandbox execution, runtime testing, or API grounding.
|
|
169
|
-
- **Optional
|
|
170
|
-
`direct.reconcileIntegrations` defaults to `false`. When enabled,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
- **Optional cross-language reconciliation** —
|
|
172
|
+
`direct.reconcileIntegrations` defaults to `false`. When enabled, the host
|
|
173
|
+
forms bounded relationship groups from ProjectMemory, asks for one strict
|
|
174
|
+
read-only audit, repairs only named generated targets, and verifies once.
|
|
175
|
+
Independent files are not coupled merely because they share a run. The
|
|
176
|
+
receipt discloses conservative audit and target-repair ceilings.
|
|
175
177
|
- **Clear, stable output** — a single truncated status line per marker
|
|
176
178
|
(`✓ app.ts (inline @human, line 12)` / `⊘ skipped … : <reason>`), plus an
|
|
177
179
|
in-place elapsed spinner while a completion is in flight.
|
|
@@ -185,15 +187,20 @@ references `styles.css` and `script.js`. After HTML is accepted, the CSS and
|
|
|
185
187
|
JavaScript requests see its generated ids and classes as a compact contract.
|
|
186
188
|
For a nested target, ProjectMemory computes the correct relative reference
|
|
187
189
|
such as `../styles.css`; it does not assume every file lives at the root.
|
|
190
|
+
The same mechanism describes Python modules, Rust crate modules, Go packages,
|
|
191
|
+
Java/C# namespaces and types, C/C++ headers, Ruby loaders, and same-language
|
|
192
|
+
companions. Those conventions are profile data; the grouping, audit, repair,
|
|
193
|
+
and verification control flow is shared.
|
|
188
194
|
|
|
189
195
|
ProjectMemory is evidence for generation, not proof of correctness. Its prompt
|
|
190
196
|
contract tells the model to connect genuine companions without importing every
|
|
191
197
|
file it sees. JS/TS relationships still receive combined compiler validation.
|
|
192
|
-
|
|
193
|
-
optional `direct.reconcileIntegrations` pass
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
Use the guided path when
|
|
198
|
+
Cross-file relationships are not runtime-tested by the direct engine. The
|
|
199
|
+
optional `direct.reconcileIntegrations` pass audits compact contracts across
|
|
200
|
+
supported languages and verifies any target-scoped model repair once, but it is
|
|
201
|
+
deliberately off by default and is not a compiler, runtime, or sandbox proof for
|
|
202
|
+
Python, Rust, web projects, or any other ecosystem. Use the guided path when
|
|
203
|
+
integration must be sandbox-verified.
|
|
197
204
|
|
|
198
205
|
```bash
|
|
199
206
|
# Deterministic engine — works with small models:
|
|
@@ -312,11 +319,13 @@ This complete local-Ollama example shows the policy fields:
|
|
|
312
319
|
`direct.reconcileIntegrations` is an opt-in post-generation safety net. The
|
|
313
320
|
default `false` keeps the established ProjectMemory first pass unchanged and
|
|
314
321
|
adds no provider calls, checks, group coupling, or receipt fields. With `true`,
|
|
315
|
-
the receipt/JSON plan discloses
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
322
|
+
the receipt/JSON plan discloses conservative audit and target-repair ceilings.
|
|
323
|
+
ProjectMemory supplies structured relationships using extensible language
|
|
324
|
+
profiles; the generic orchestrator audits only connected generated groups,
|
|
325
|
+
validates strict JSON against real generated paths, repairs each named target at
|
|
326
|
+
most once, and performs at most one verification audit. A failed bounded cycle
|
|
327
|
+
rejects that evidenced group instead of writing a known-inconsistent partial
|
|
328
|
+
result.
|
|
320
329
|
|
|
321
330
|
The direct engine uses `privacy.maxContextTokens` as the combined upper bound
|
|
322
331
|
for FileMemory and ProjectMemory. ProjectMemory additionally caps each rendered
|
package/SECURITY.md
CHANGED
|
@@ -51,8 +51,9 @@ imported or executed and no project scripts run during this validation.
|
|
|
51
51
|
|
|
52
52
|
Direct ProjectMemory is rebuilt from the static discovery inventory for each
|
|
53
53
|
run. It may send project-relative filenames and compact source-derived
|
|
54
|
-
contracts (declarations/imports,
|
|
55
|
-
|
|
54
|
+
contracts (declarations/imports/includes, modules/packages/namespaces,
|
|
55
|
+
language-specific references, markup/style/asset contracts where relevant,
|
|
56
|
+
and limited package metadata) to the selected model. It also
|
|
56
57
|
contains the planned post-conversion output tree and other `.human` purposes so
|
|
57
58
|
the model can coordinate files. Protected paths, configured ignored/excluded
|
|
58
59
|
paths, oversized/unreadable files, and credential-bearing contracts are
|
|
@@ -62,16 +63,18 @@ no `context --explain` preview. Remote direct conversion therefore remains
|
|
|
62
63
|
blocked until explicit project-level remote-provider consent; use local Ollama
|
|
63
64
|
or the guided flow when this compact context is not appropriate to transmit.
|
|
64
65
|
|
|
65
|
-
Post-generation
|
|
66
|
+
Post-generation integration reconciliation is a separate explicit opt-in
|
|
66
67
|
(`direct.reconcileIntegrations`, default `false`). When disabled, it performs
|
|
67
|
-
no audit and sends no additional request. When enabled,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
credential-scanned
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
no audit and sends no additional request. When enabled, ProjectMemory supplies
|
|
69
|
+
structured language relationships and the generic orchestrator forms bounded
|
|
70
|
+
generated-file groups. A read-only audit must return strict JSON whose target
|
|
71
|
+
and related paths are members of that exact group. Each reported target may
|
|
72
|
+
receive one bounded repair followed by one verification audit. Audit/repair
|
|
73
|
+
bundles are credential-scanned; file purposes, contracts, diagnostics, and
|
|
74
|
+
source are prompt-isolated as untrusted evidence. Malformed output, invented
|
|
75
|
+
paths, exhausted context, or unresolved issues reject the connected opt-in
|
|
76
|
+
group before writing. This is model-assisted static consistency checking, not
|
|
77
|
+
compiler, runtime, or sandbox verification.
|
|
75
78
|
|
|
76
79
|
These controls prevent the specific malformed-output, overwrite, stale-range,
|
|
77
80
|
indentation, and cross-file-contract failures they check. Static compilation
|
|
@@ -79,9 +82,10 @@ is stronger than syntax parsing, but it does not prove runtime behavior,
|
|
|
79
82
|
external-API grounding, project-wide security properties, or test success,
|
|
80
83
|
and it never executes the candidate in a sandbox or claims `VERIFIED`. Other
|
|
81
84
|
direct programming languages keep their per-file structural validation level;
|
|
82
|
-
|
|
83
|
-
reconciliation adds
|
|
84
|
-
the guided contract and validation path when stronger boundaries
|
|
85
|
+
Non-JS/TS languages normally keep their per-file syntax/structure gates; the
|
|
86
|
+
optional generic reconciliation adds the bounded contract audit described
|
|
87
|
+
above. Use the guided contract and validation path when stronger boundaries
|
|
88
|
+
are required.
|
|
85
89
|
|
|
86
90
|
### The reviewed contract owns authority
|
|
87
91
|
|
|
@@ -1,24 +1,35 @@
|
|
|
1
|
-
import { type DirectIntegrationIssue, type
|
|
1
|
+
import { type DirectIntegrationAuditFile, type DirectIntegrationIssue, type DirectIntegrationRelationship } from "../../prompts/direct-integration.ts";
|
|
2
2
|
import { type DirectRepairDiagnostic, type DirectRepairRelatedFile } from "../../prompts/direct-repair.ts";
|
|
3
3
|
import type { GenerateOptions } from "./types.ts";
|
|
4
4
|
/** Send one direct-conversion request to OpenAI-compatible chat or Ollama. */
|
|
5
5
|
export declare function generateCode(instruction: string, options: GenerateOptions): Promise<string>;
|
|
6
|
-
export interface
|
|
6
|
+
export interface IntegrationAuditGenerationRequest {
|
|
7
|
+
files: readonly DirectIntegrationAuditFile[];
|
|
8
|
+
relationships: readonly DirectIntegrationRelationship[];
|
|
9
|
+
projectMemory?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Send one opt-in, read-only, cross-language integration audit request. */
|
|
12
|
+
export declare function generateIntegrationAudit(request: IntegrationAuditGenerationRequest, options: GenerateOptions): Promise<string>;
|
|
13
|
+
export interface IntegrationRepairGenerationRequest {
|
|
7
14
|
targetPath: string;
|
|
8
15
|
instruction: string;
|
|
9
16
|
currentCode: string;
|
|
10
17
|
issues: readonly DirectIntegrationIssue[];
|
|
11
|
-
relatedFiles:
|
|
18
|
+
relatedFiles: ReadonlyArray<{
|
|
19
|
+
path: string;
|
|
20
|
+
content: string;
|
|
21
|
+
}>;
|
|
12
22
|
projectMemory?: string;
|
|
13
23
|
}
|
|
14
|
-
/** Send one
|
|
15
|
-
export declare function
|
|
24
|
+
/** Send one bounded target repair after a generic integration audit. */
|
|
25
|
+
export declare function generateIntegrationRepairCode(request: IntegrationRepairGenerationRequest, options: GenerateOptions): Promise<string>;
|
|
16
26
|
export interface RepairGenerationRequest {
|
|
17
27
|
targetPath: string;
|
|
18
28
|
inline: boolean;
|
|
19
29
|
instruction: string;
|
|
20
30
|
currentCode: string;
|
|
21
31
|
diagnostics: readonly DirectRepairDiagnostic[];
|
|
32
|
+
hints?: readonly string[];
|
|
22
33
|
relatedFiles: readonly DirectRepairRelatedFile[];
|
|
23
34
|
projectMemory?: string;
|
|
24
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation-client.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/generation-client.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"generation-client.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/generation-client.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EACnC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA+ClD,8EAA8E;AAC9E,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAWjG;AAED,MAAM,WAAW,iCAAiC;IAChD,KAAK,EAAE,SAAS,0BAA0B,EAAE,CAAC;IAC7C,aAAa,EAAE,SAAS,6BAA6B,EAAE,CAAC;IACxD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,4EAA4E;AAC5E,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,iCAAiC,EAC1C,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC1C,YAAY,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wEAAwE;AACxE,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,kCAAkC,EAC3C,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAC/C,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,SAAS,uBAAuB,EAAE,CAAC;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mFAAmF;AACnF,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildDirectConversionPrompt } from "../../prompts/direct-conversion.js";
|
|
2
|
-
import {
|
|
2
|
+
import { buildDirectIntegrationAuditPrompt, buildDirectIntegrationRepairPrompt, } from "../../prompts/direct-integration.js";
|
|
3
3
|
import { buildDirectRepairPrompt, } from "../../prompts/direct-repair.js";
|
|
4
4
|
import { languageProfile } from "./languages.js";
|
|
5
5
|
import { stripCodeFence } from "./presentation.js";
|
|
@@ -61,10 +61,15 @@ export async function generateCode(instruction, options) {
|
|
|
61
61
|
});
|
|
62
62
|
return requestChatCompletion(prompt, options);
|
|
63
63
|
}
|
|
64
|
-
/** Send one opt-in
|
|
65
|
-
export async function
|
|
64
|
+
/** Send one opt-in, read-only, cross-language integration audit request. */
|
|
65
|
+
export async function generateIntegrationAudit(request, options) {
|
|
66
|
+
const prompt = buildDirectIntegrationAuditPrompt(request);
|
|
67
|
+
return requestChatCompletion(prompt, options);
|
|
68
|
+
}
|
|
69
|
+
/** Send one bounded target repair after a generic integration audit. */
|
|
70
|
+
export async function generateIntegrationRepairCode(request, options) {
|
|
66
71
|
const profile = languageProfile(options.language);
|
|
67
|
-
const prompt =
|
|
72
|
+
const prompt = buildDirectIntegrationRepairPrompt({ languageLabel: profile.label, ...request });
|
|
68
73
|
return requestChatCompletion(prompt, options);
|
|
69
74
|
}
|
|
70
75
|
/** Send one bounded cross-file repair request with the same provider and model. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation-client.js","sourceRoot":"","sources":["../../../src/agents/direct/generation-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAuB,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"generation-client.js","sourceRoot":"","sources":["../../../src/agents/direct/generation-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAuB,MAAM,oCAAoC,CAAC;AACtG,OAAO,EACL,iCAAiC,EACjC,kCAAkC,GAInC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,uBAAuB,GAGxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,0EAA0E;AAC1E,KAAK,UAAU,qBAAqB,CAAC,MAAsB,EAAE,OAAwB;IACnF,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,2BAA2B,CAAC;QAC5D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,mBAAmB,EAAE;YACvD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,OAA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AAC5E,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,OAA0C,EAC1C,OAAwB;IAExB,MAAM,MAAM,GAAG,iCAAiC,CAAC,OAAO,CAAC,CAAC;IAC1D,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAWD,wEAAwE;AACxE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAA2C,EAC3C,OAAwB;IAExB,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,kCAAkC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAaD,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAgC,EAChC,OAAwB;IAExB,MAAM,OAAO,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,uBAAuB,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,OAAO,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -5,6 +5,7 @@ export * from "./marker-parser.ts";
|
|
|
5
5
|
export * from "./file-memory.ts";
|
|
6
6
|
export * from "./project-memory.ts";
|
|
7
7
|
export * from "./project-contracts.ts";
|
|
8
|
+
export * from "./language-relationships.ts";
|
|
8
9
|
export * from "./discovery.ts";
|
|
9
10
|
export * from "./presentation.ts";
|
|
10
11
|
export * from "./generation-client.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
|
|
@@ -5,6 +5,7 @@ export * from "./marker-parser.js";
|
|
|
5
5
|
export * from "./file-memory.js";
|
|
6
6
|
export * from "./project-memory.js";
|
|
7
7
|
export * from "./project-contracts.js";
|
|
8
|
+
export * from "./language-relationships.js";
|
|
8
9
|
export * from "./discovery.js";
|
|
9
10
|
export * from "./presentation.js";
|
|
10
11
|
export * from "./generation-client.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/direct/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/direct/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { DirectIntegrationIssue } from "../../prompts/direct-integration.ts";
|
|
2
|
-
import type { ConversionUnit, GeneratedConversionUnit, ProjectMemoryProvider } from "./types.ts";
|
|
3
|
-
export interface
|
|
1
|
+
import type { DirectIntegrationAuditFile, DirectIntegrationIssue, DirectIntegrationRelationship } from "../../prompts/direct-integration.ts";
|
|
2
|
+
import type { ConversionUnit, GeneratedConversionUnit, ProjectMemoryProvider, ProjectRelationship } from "./types.ts";
|
|
3
|
+
export interface IntegrationAuditRequest {
|
|
4
|
+
/** Representative unit used for provider defaults and target-specific memory. */
|
|
5
|
+
unit: ConversionUnit;
|
|
6
|
+
units: ConversionUnit[];
|
|
7
|
+
files: DirectIntegrationAuditFile[];
|
|
8
|
+
relationships: DirectIntegrationRelationship[];
|
|
9
|
+
projectMemory?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IntegrationRepairRequest {
|
|
4
12
|
unit: ConversionUnit;
|
|
5
13
|
targetPath: string;
|
|
6
14
|
instruction: string;
|
|
@@ -12,12 +20,17 @@ export interface IntegrationRequest {
|
|
|
12
20
|
}>;
|
|
13
21
|
projectMemory?: string;
|
|
14
22
|
}
|
|
23
|
+
export interface IntegrationAuditResult {
|
|
24
|
+
status: "consistent" | "issues";
|
|
25
|
+
issues: DirectIntegrationIssue[];
|
|
26
|
+
}
|
|
15
27
|
export type IntegrationProgress = {
|
|
16
|
-
kind: "integration-
|
|
28
|
+
kind: "integration-audit";
|
|
17
29
|
unit: ConversionUnit;
|
|
18
|
-
|
|
30
|
+
pass: number;
|
|
31
|
+
files: number;
|
|
19
32
|
} | {
|
|
20
|
-
kind: "
|
|
33
|
+
kind: "integration-repair";
|
|
21
34
|
unit: ConversionUnit;
|
|
22
35
|
attempt: number;
|
|
23
36
|
issues: number;
|
|
@@ -27,21 +40,31 @@ export type IntegrationProgress = {
|
|
|
27
40
|
reason: string;
|
|
28
41
|
};
|
|
29
42
|
export interface IntegrationValidationOptions {
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
audit?: (request: IntegrationAuditRequest) => Promise<string>;
|
|
44
|
+
repair?: (request: IntegrationRepairRequest) => Promise<string>;
|
|
45
|
+
/** Initial audit plus one verification audit by default. */
|
|
46
|
+
maxAuditPassesPerGroup?: number;
|
|
47
|
+
/** One target-scoped repair per generated file by default. */
|
|
48
|
+
maxRepairAttemptsPerUnit?: number;
|
|
32
49
|
contextCharBudget?: number;
|
|
33
50
|
projectMemory?: ProjectMemoryProvider;
|
|
34
51
|
onProgress?: (event: IntegrationProgress) => void;
|
|
35
52
|
}
|
|
36
53
|
export interface IntegrationValidationOutcome {
|
|
37
54
|
results: GeneratedConversionUnit[];
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
auditRequests: number;
|
|
56
|
+
repairRequests: number;
|
|
57
|
+
checkedGroups: number;
|
|
40
58
|
}
|
|
41
|
-
/**
|
|
42
|
-
export declare function
|
|
43
|
-
/**
|
|
44
|
-
export declare function
|
|
45
|
-
|
|
59
|
+
/** Strictly validate the model's audit JSON against the exact generated group. */
|
|
60
|
+
export declare function parseIntegrationAuditOutput(output: string, allowedPaths: ReadonlySet<string>): IntegrationAuditResult;
|
|
61
|
+
/** Conservative pre-run ceiling: two audits and one repair per whole-file unit. */
|
|
62
|
+
export declare function potentialIntegrationRequests(units: readonly ConversionUnit[]): {
|
|
63
|
+
auditUpTo: number;
|
|
64
|
+
repairUpTo: number;
|
|
65
|
+
};
|
|
66
|
+
/** Audit, repair, and verify generated relationship groups without writing. */
|
|
46
67
|
export declare function reconcileGeneratedIntegrations(generated: readonly GeneratedConversionUnit[], options?: IntegrationValidationOptions): Promise<IntegrationValidationOutcome>;
|
|
68
|
+
/** Helper for tests and alternative ProjectMemory implementations. */
|
|
69
|
+
export declare function generatedRelationshipsFor(unit: ConversionUnit, projectMemory: ProjectMemoryProvider): readonly ProjectRelationship[];
|
|
47
70
|
//# sourceMappingURL=integration-validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-validation.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/integration-validation.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"integration-validation.d.ts","sourceRoot":"","sources":["../../../src/agents/direct/integration-validation.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAG7C,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC,iFAAiF;IACjF,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,KAAK,EAAE,0BAA0B,EAAE,CAAC;IACpC,aAAa,EAAE,6BAA6B,EAAE,CAAC;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,YAAY,GAAG,QAAQ,CAAC;IAChC,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,mBAAmB,CAAC;IAAC,IAAI,EAAE,cAAc,CAAC;IAAC,IAAI,EAAE,M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