human-to-code 0.1.26 → 0.1.28
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 +58 -38
- package/dist/agents/direct/discovery.d.ts.map +1 -1
- package/dist/agents/direct/discovery.js +8 -6
- package/dist/agents/direct/discovery.js.map +1 -1
- package/dist/agents/direct/file-memory.d.ts.map +1 -1
- package/dist/agents/direct/file-memory.js +70 -1
- package/dist/agents/direct/file-memory.js.map +1 -1
- package/dist/agents/direct/generation-client.d.ts +10 -0
- package/dist/agents/direct/generation-client.d.ts.map +1 -1
- package/dist/agents/direct/generation-client.js +19 -0
- package/dist/agents/direct/generation-client.js.map +1 -1
- package/dist/agents/direct/index.d.ts +3 -0
- package/dist/agents/direct/index.d.ts.map +1 -1
- package/dist/agents/direct/index.js +3 -0
- package/dist/agents/direct/index.js.map +1 -1
- package/dist/agents/direct/languages.d.ts +11 -0
- package/dist/agents/direct/languages.d.ts.map +1 -1
- package/dist/agents/direct/languages.js +19 -0
- package/dist/agents/direct/languages.js.map +1 -1
- package/dist/agents/direct/presentation.d.ts +20 -0
- package/dist/agents/direct/presentation.d.ts.map +1 -1
- package/dist/agents/direct/presentation.js +33 -3
- package/dist/agents/direct/presentation.js.map +1 -1
- package/dist/agents/direct/project-blueprint.d.ts +29 -0
- package/dist/agents/direct/project-blueprint.d.ts.map +1 -0
- package/dist/agents/direct/project-blueprint.js +170 -0
- package/dist/agents/direct/project-blueprint.js.map +1 -0
- package/dist/agents/direct/project-contracts.d.ts +34 -0
- package/dist/agents/direct/project-contracts.d.ts.map +1 -1
- package/dist/agents/direct/project-contracts.js +59 -42
- package/dist/agents/direct/project-contracts.js.map +1 -1
- package/dist/agents/direct/project-memory.d.ts +6 -0
- package/dist/agents/direct/project-memory.d.ts.map +1 -1
- package/dist/agents/direct/project-memory.js +20 -0
- package/dist/agents/direct/project-memory.js.map +1 -1
- package/dist/agents/direct/reference-validation.d.ts +55 -0
- package/dist/agents/direct/reference-validation.d.ts.map +1 -0
- package/dist/agents/direct/reference-validation.js +415 -0
- package/dist/agents/direct/reference-validation.js.map +1 -0
- package/dist/agents/direct/types.d.ts +45 -0
- package/dist/agents/direct/types.d.ts.map +1 -1
- package/dist/agents/direct/unit-todos.d.ts +51 -0
- package/dist/agents/direct/unit-todos.d.ts.map +1 -0
- package/dist/agents/direct/unit-todos.js +223 -0
- package/dist/agents/direct/unit-todos.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +147 -10
- package/dist/cli.js.map +1 -1
- package/dist/config/config.d.ts +22 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +40 -6
- package/dist/config/config.js.map +1 -1
- package/dist/prompts/direct-blueprint.d.ts +19 -0
- package/dist/prompts/direct-blueprint.d.ts.map +1 -0
- package/dist/prompts/direct-blueprint.js +49 -0
- package/dist/prompts/direct-blueprint.js.map +1 -0
- package/dist/prompts/direct-conversion.d.ts +8 -0
- package/dist/prompts/direct-conversion.d.ts.map +1 -1
- package/dist/prompts/direct-conversion.js +26 -0
- package/dist/prompts/direct-conversion.js.map +1 -1
- package/dist/prompts/direct-todos.d.ts +17 -0
- package/dist/prompts/direct-todos.d.ts.map +1 -0
- package/dist/prompts/direct-todos.js +43 -0
- package/dist/prompts/direct-todos.js.map +1 -0
- package/dist/prompts/index.d.ts +2 -0
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +2 -0
- package/dist/prompts/index.js.map +1 -1
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +3 -1
- package/dist/providers/provider.js.map +1 -1
- package/docs/ARCHITECTURE.md +23 -6
- package/docs/CONFIGURATION.md +251 -0
- package/docs/MODULES.md +6 -3
- package/package.json +1 -1
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
# `human-to-code.config.json` reference
|
|
2
|
+
|
|
3
|
+
Complete field-by-field reference for the schema-v1 configuration file. For
|
|
4
|
+
narrative setup guidance see the [Configuration section of the
|
|
5
|
+
Readme](../Readme.md#configuration).
|
|
6
|
+
|
|
7
|
+
## How the file is read
|
|
8
|
+
|
|
9
|
+
- The file must be named exactly `human-to-code.config.json` and live at the
|
|
10
|
+
project root. A missing file is not an error: the frozen defaults below are
|
|
11
|
+
used and every command still runs.
|
|
12
|
+
- `human-to-code --init` writes the complete default file and refuses to
|
|
13
|
+
overwrite an existing one.
|
|
14
|
+
- Loading is hardened: symlinks and non-regular files are rejected, the file is
|
|
15
|
+
opened with `O_NOFOLLOW`, size and inode are re-checked after opening to
|
|
16
|
+
detect a swap during the read, and the file may not exceed **1 MiB**.
|
|
17
|
+
- **Unknown keys are rejected at every level.** A typo is a hard error naming
|
|
18
|
+
the exact dotted path, not a silently ignored setting.
|
|
19
|
+
- **Credential-like keys are rejected before anything else.** Any key that
|
|
20
|
+
normalizes to `key`, `secret`, or `token`, or that ends in `secret`,
|
|
21
|
+
`apikey`, `accesstoken`, `authtoken`, `bearertoken`, `clientsecret`,
|
|
22
|
+
`password`, `passphrase`, `credential`, `credentials`, `privatekey`, or
|
|
23
|
+
`authorization` is refused anywhere in the file. The single exception is
|
|
24
|
+
`apiKeyEnv`, which holds an environment-variable *name*, never a value.
|
|
25
|
+
- Validation fails fast: the first problem throws with a message safe to show a
|
|
26
|
+
user, quoting the dotted path (for example `` `direct.planning.enabled` ``).
|
|
27
|
+
- `documentation`, `privacy`, `sandbox`, `budgets`, and `direct` merge
|
|
28
|
+
field-by-field onto the defaults, so a partial section keeps the rest of its
|
|
29
|
+
defaults. `direct.planning` also merges field-by-field. Every other key,
|
|
30
|
+
including the whole `provider` object and all arrays, is replaced wholesale.
|
|
31
|
+
|
|
32
|
+
## Root keys
|
|
33
|
+
|
|
34
|
+
| Key | Type | Default | Constraints |
|
|
35
|
+
| --- | --- | --- | --- |
|
|
36
|
+
| `schemaVersion` | `1` | — | **Required.** Anything other than `1` is rejected; a missing value points you at `human-to-code migrate-config`. |
|
|
37
|
+
| `language` | string | `"typescript"` | One of `typescript`, `javascript`, `python`, `rust`, `html`, `css`. Retained for alpha compatibility. When set together with `languages` it must be a member, and is normalized to the first entry. |
|
|
38
|
+
| `languages` | string[] | `["typescript"]` | Non-empty, no duplicates, each from the same six. The first entry is the default output language. |
|
|
39
|
+
| `humanFileExtensions` | object[] | `[]` | At most 1000 entries, no duplicate paths (case-insensitive). The strongest routing signal — see below. |
|
|
40
|
+
| `filesToIgnore` | string[] | `["node_modules", ".git", "dist"]` | Bare file or directory **names**, not paths or globs. No `/`, `\`, `.` or `..`; at most 255 characters each; no duplicates. |
|
|
41
|
+
| `allowNonHumanFiles` | boolean | `false` | Accepted and validated, but **no code currently reads it**. It has no effect on any run. |
|
|
42
|
+
| `provider` | object | see below | Replaced wholesale, never merged. |
|
|
43
|
+
| `workspaces` | object[] | `[]` | Per-workspace overrides; no duplicate roots (case-insensitive). |
|
|
44
|
+
| `documentation` | object | see below | Merged field-by-field. |
|
|
45
|
+
| `privacy` | object | see below | Merged field-by-field. |
|
|
46
|
+
| `sandbox` | object | see below | Merged field-by-field. |
|
|
47
|
+
| `budgets` | object | see below | Merged field-by-field. |
|
|
48
|
+
| `direct` | object | see below | Merged field-by-field. |
|
|
49
|
+
|
|
50
|
+
### `humanFileExtensions[]`
|
|
51
|
+
|
|
52
|
+
Binds one exact `.human` source path to an output extension, so prompt wording
|
|
53
|
+
can never change where a file lands.
|
|
54
|
+
|
|
55
|
+
| Key | Type | Constraints |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `path` | string | Portable repository-relative path, at most 1024 characters. Must end in `.human` and must **not** end in `.strict.human`. No absolute paths, drive letters, backslashes, or `.`/`..` segments. |
|
|
58
|
+
| `extension` | string | A leading dot is optional and the value is lowercased. Must be one of `ts`, `tsx`, `mts`, `cts`, `js`, `jsx`, `mjs`, `cjs`, `py`, `rs`, `html`, `htm`, `css`, and its language must appear in `languages`. |
|
|
59
|
+
|
|
60
|
+
## `provider`
|
|
61
|
+
|
|
62
|
+
Replaced wholesale: supplying `{"name": "openai"}` yields exactly
|
|
63
|
+
`{name: "openai", model: "gpt-4o"}` — sibling defaults are not preserved.
|
|
64
|
+
|
|
65
|
+
| Key | Type | Default | Constraints |
|
|
66
|
+
| --- | --- | --- | --- |
|
|
67
|
+
| `provider.name` | string | `"ollama"` | One of `openai`, `anthropic`, `ollama`, `grok`, `gemini`. Only `openai` and `ollama` have working adapters; the others are accepted by the schema and then stop the run with a configuration error. |
|
|
68
|
+
| `provider.model` | string | per provider | Non-empty, trimmed, at most 256 characters. Defaults: `ollama` → `qwen2.5-coder:7b`, `openai` → `gpt-4o`, `anthropic` → `claude-opus-4-8`, `grok` → `grok-4.1`, `gemini` → `gemini-2.5-pro`. The configured string is sent exactly and never silently substituted. |
|
|
69
|
+
| `provider.baseUrl` | string | absent | Explicit lowercase scheme; no userinfo, query, or fragment. Plain HTTP only for a trusted loopback Ollama endpoint; loopback only for `ollama`. Private, link-local, CGNAT, and multicast literals are refused, as are `.localhost`, `.local`, and `.internal`; a fully qualified domain name is required. |
|
|
70
|
+
| `provider.trustCustomEndpoint` | `true` | absent | May only be `true`, and only alongside `baseUrl`. Set automatically when `baseUrl` is present. |
|
|
71
|
+
| `provider.apiKeyEnv` | string | absent | An environment-variable **name** matching `/^[A-Z_][A-Z0-9_]{0,127}$/` — never a credential. Forbidden on a plain-HTTP endpoint. Set to `OLLAMA_API_KEY` automatically for `https://ollama.com`. |
|
|
72
|
+
| `provider.pricing` | object | absent | **Required before any remote request.** See below. |
|
|
73
|
+
|
|
74
|
+
### `provider.pricing`
|
|
75
|
+
|
|
76
|
+
Operator-reviewed worst-case rates used to reserve spend before a remote
|
|
77
|
+
request is sent. They are a local policy input, not a live price feed.
|
|
78
|
+
|
|
79
|
+
| Key | Type | Constraints |
|
|
80
|
+
| --- | --- | --- |
|
|
81
|
+
| `inputUsdPerMillionTokens` | number | `0`–`1000000`; fractional values allowed. |
|
|
82
|
+
| `outputUsdPerMillionTokens` | number | `0`–`1000000`; fractional values allowed. |
|
|
83
|
+
| `unmetered` | `true` | Required **exactly when** both rates are zero, and rejected otherwise. It is accepted as operator policy and is not independently verified. |
|
|
84
|
+
|
|
85
|
+
Loopback-local Ollama has no remote API cost and needs no `pricing`.
|
|
86
|
+
|
|
87
|
+
## `documentation`
|
|
88
|
+
|
|
89
|
+
| Key | Type | Default | Constraints |
|
|
90
|
+
| --- | --- | --- | --- |
|
|
91
|
+
| `mode` | string | `"local-first"` | `local-first` or `offline`. |
|
|
92
|
+
| `privatePaths` | string[] | `[]` | Portable repository-relative paths holding project or private documentation. No duplicates. |
|
|
93
|
+
| `officialDomains` | string[] | `[]` | Lowercase public domains, at most 253 characters. No scheme, port, path, wildcard, or leading/trailing dot; must contain a dot; must not be an IP address. |
|
|
94
|
+
| `officialSources` | object[] | `[]` | At most 100 entries; no duplicate `ecosystem`/`dependency`/`version` triples. |
|
|
95
|
+
|
|
96
|
+
### `documentation.officialSources[]`
|
|
97
|
+
|
|
98
|
+
| Key | Type | Constraints |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| `ecosystem` | string | One of `react`, `nestjs`, `fastapi`, `rust`. |
|
|
101
|
+
| `dependency` | string | At most 256 characters, matching `/^(?:@[a-z0-9._-]+\/)?[a-z0-9][a-z0-9._-]*$/i`. |
|
|
102
|
+
| `version` | string | At most 128 characters and an exact identifier. Moving targets (`latest`, `next`, `stable`, `nightly`, `main`, `master`, `head`, `dev`) and range operators (`<`, `>`, `=`, `^`, `~`, `*`) are refused. |
|
|
103
|
+
| `url` | string | HTTPS only, at most 2048 characters, no credentials, port, or fragment, valid percent-encoding. The path or query **must visibly contain the exact `version` string**, so a pinned entry cannot silently resolve elsewhere. |
|
|
104
|
+
|
|
105
|
+
## `privacy`
|
|
106
|
+
|
|
107
|
+
| Key | Type | Default | Constraints |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| `remoteProviderConsent` | boolean | `false` | Remote providers stay disabled until this is explicitly `true`. Direct conversion refuses to send anything to a non-loopback provider without it. |
|
|
110
|
+
| `telemetry` | boolean | `false` | Opt-in. Also forced off by the `DO_NOT_TRACK` environment variable. No telemetry is currently emitted either way. |
|
|
111
|
+
| `excludedPaths` | string[] | `[]` | Portable repository-relative files or directories that must never enter outbound context. No duplicates. |
|
|
112
|
+
| `maxFileBytes` | integer | `512000` | `1024`–`100000000`. Files above this are not read for context or contracts. |
|
|
113
|
+
| `maxContextTokens` | integer | `64000` | `1000`–`2000000`. The direct engine uses this times four as the combined FileMemory + ProjectMemory character budget for one request. |
|
|
114
|
+
|
|
115
|
+
## `sandbox`
|
|
116
|
+
|
|
117
|
+
| Key | Type | Default | Constraints |
|
|
118
|
+
| --- | --- | --- | --- |
|
|
119
|
+
| `required` | boolean | `true` | **Must be `true`** in schema v1; `false` is a hard error. |
|
|
120
|
+
| `engine` | string | `"auto"` | `auto`, `docker`, or `podman`. `auto` probes Docker first, then Podman; neither available makes validation `INCONCLUSIVE` and runs no project command. |
|
|
121
|
+
| `network` | string | `"none"` | Must be `"none"` in schema v1. |
|
|
122
|
+
|
|
123
|
+
## `budgets`
|
|
124
|
+
|
|
125
|
+
Cumulative hard ceilings for one run. Preflight accounting charges a
|
|
126
|
+
pessimistic, tokenizer-independent upper bound before a request is sent, and a
|
|
127
|
+
failed remote attempt keeps its conservative charge.
|
|
128
|
+
|
|
129
|
+
| Key | Type | Default | Range |
|
|
130
|
+
| --- | --- | --- | --- |
|
|
131
|
+
| `maxCostUsd` | number | `10` | `0`–`100000`; fractional allowed. |
|
|
132
|
+
| `maxInputTokens` | integer | `2000000` | `1000`–`10000000`. |
|
|
133
|
+
| `maxOutputTokens` | integer | `120000` | `1`–`1000000`. |
|
|
134
|
+
| `maxRequests` | integer | `60` | `1`–`100`. Raised from 12 because multi-pass planning issues a shared-contract request plus a todo and coding request per target. **Enforced in the guided pipeline and the provider ledger; the direct engine discloses its request count rather than gating on this value.** |
|
|
135
|
+
| `maxRepairs` | integer | `2` | `0`–`2`. |
|
|
136
|
+
| `timeoutMs` | integer | `900000` | `1000`–`86400000`. |
|
|
137
|
+
|
|
138
|
+
## `direct`
|
|
139
|
+
|
|
140
|
+
Controls the default conversion engine.
|
|
141
|
+
|
|
142
|
+
| Key | Type | Default | Constraints |
|
|
143
|
+
| --- | --- | --- | --- |
|
|
144
|
+
| `reconcileIntegrations` | boolean | `true` | Bounded post-generation cross-file reconciliation: audit connected generated groups, repair each named target at most once, then verify once. A failed cycle rejects the evidenced group rather than writing a known-inconsistent result. |
|
|
145
|
+
| `crossFileChecks` | boolean | `true` | Deterministic cross-file reference checking over generated HTML, CSS, and browser JavaScript. **Adds no model requests.** Findings are reported in the receipt and the `--json` result and marked `blocking` or `advisory`; the severity is a priority label, not a gate — a run is not refused because of a finding. |
|
|
146
|
+
| `planning` | object | see below | Merged field-by-field. |
|
|
147
|
+
|
|
148
|
+
### `direct.planning`
|
|
149
|
+
|
|
150
|
+
Multi-request generation. Without it, one model completion has to decide a
|
|
151
|
+
file's design, cover every requirement, and invent a naming vocabulary at once —
|
|
152
|
+
and nothing makes two independently generated files agree.
|
|
153
|
+
|
|
154
|
+
| Key | Type | Default | Constraints |
|
|
155
|
+
| --- | --- | --- | --- |
|
|
156
|
+
| `enabled` | boolean | `true` | The single off switch. `false` restores exactly one model request per unit and skips every planning pass regardless of the sibling values below. |
|
|
157
|
+
| `projectBlueprint` | boolean | `true` | One shared request before any file is generated, agreeing the file roster and the vocabulary — class names, ids, exported symbols, routes — that every target must use verbatim. Skipped automatically when fewer than two files are planned. |
|
|
158
|
+
| `fileTodo` | boolean | `true` | One todo-list request per whole-file `.human` target. |
|
|
159
|
+
| `markerTodo` | boolean | `true` | One todo-list request per inline `@human` marker. |
|
|
160
|
+
| `maxCodingPassesPerUnit` | integer | `2` | `1`–`3`. A second pass is issued **only** when the deterministic coverage check finds todo items the first pass did not address, and is kept only if it preserves everything the previous pass produced. Set to `1` to code every target in a single request. |
|
|
161
|
+
|
|
162
|
+
**Request arithmetic.** For `N` units of which `F` are whole files, the defaults
|
|
163
|
+
plan `1` blueprint request (when `F >= 2`), `N` todo requests, and `N` coding
|
|
164
|
+
requests, plus at most `N` conditional completion requests. Existing bounded
|
|
165
|
+
repair and reconciliation ceilings are unchanged. The receipt and the `--json`
|
|
166
|
+
plan disclose the exact breakdown before the confirmation prompt.
|
|
167
|
+
|
|
168
|
+
**Failure behavior.** Every planning pass is best-effort. A blueprint that
|
|
169
|
+
cannot be parsed is discarded and the run continues without a shared contract; a
|
|
170
|
+
todo list that cannot be parsed leaves that unit on the single-pass path. No
|
|
171
|
+
planning failure ever fails a unit, and one unit failing never affects another.
|
|
172
|
+
|
|
173
|
+
**Trust.** Blueprints and todo lists are model output, so they are untrusted
|
|
174
|
+
evidence: paths are checked against the real planned targets, names must match a
|
|
175
|
+
restricted character set, every free-text field is length-bounded, and a
|
|
176
|
+
blueprint containing credential-like content is discarded.
|
|
177
|
+
|
|
178
|
+
## `workspaces[]`
|
|
179
|
+
|
|
180
|
+
Per-workspace overrides for a multi-package repository. Merging is strictly
|
|
181
|
+
tightening: providers must be identical across targeted workspaces or the run
|
|
182
|
+
stops, `documentation.mode` degrades to `offline` if any workspace asks for it,
|
|
183
|
+
path lists are unioned, every numeric privacy and budget field takes the
|
|
184
|
+
minimum, and consent booleans are ANDed.
|
|
185
|
+
|
|
186
|
+
| Key | Type | Constraints |
|
|
187
|
+
| --- | --- | --- |
|
|
188
|
+
| `root` | string | **Required.** Repository-relative path; `"."` is allowed. |
|
|
189
|
+
| `provider` | object | A complete `provider` object, validated by the same rules — not a partial. |
|
|
190
|
+
| `documentation` | object | Partial `documentation` override. |
|
|
191
|
+
| `privacy` | object | Partial `privacy` override. |
|
|
192
|
+
| `budgets` | object | Partial `budgets` override. |
|
|
193
|
+
|
|
194
|
+
`sandbox` and `direct` are **not** overridable per workspace.
|
|
195
|
+
|
|
196
|
+
## Complete default file
|
|
197
|
+
|
|
198
|
+
This is exactly what `human-to-code --init` writes.
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
{
|
|
202
|
+
"schemaVersion": 1,
|
|
203
|
+
"language": "typescript",
|
|
204
|
+
"languages": ["typescript"],
|
|
205
|
+
"humanFileExtensions": [],
|
|
206
|
+
"filesToIgnore": ["node_modules", ".git", "dist"],
|
|
207
|
+
"allowNonHumanFiles": false,
|
|
208
|
+
"provider": {
|
|
209
|
+
"name": "ollama",
|
|
210
|
+
"model": "qwen2.5-coder:7b"
|
|
211
|
+
},
|
|
212
|
+
"workspaces": [],
|
|
213
|
+
"documentation": {
|
|
214
|
+
"mode": "local-first",
|
|
215
|
+
"privatePaths": [],
|
|
216
|
+
"officialDomains": [],
|
|
217
|
+
"officialSources": []
|
|
218
|
+
},
|
|
219
|
+
"privacy": {
|
|
220
|
+
"remoteProviderConsent": false,
|
|
221
|
+
"telemetry": false,
|
|
222
|
+
"excludedPaths": [],
|
|
223
|
+
"maxFileBytes": 512000,
|
|
224
|
+
"maxContextTokens": 64000
|
|
225
|
+
},
|
|
226
|
+
"sandbox": {
|
|
227
|
+
"required": true,
|
|
228
|
+
"engine": "auto",
|
|
229
|
+
"network": "none"
|
|
230
|
+
},
|
|
231
|
+
"budgets": {
|
|
232
|
+
"maxCostUsd": 10,
|
|
233
|
+
"maxInputTokens": 2000000,
|
|
234
|
+
"maxOutputTokens": 120000,
|
|
235
|
+
"maxRequests": 60,
|
|
236
|
+
"maxRepairs": 2,
|
|
237
|
+
"timeoutMs": 900000
|
|
238
|
+
},
|
|
239
|
+
"direct": {
|
|
240
|
+
"reconcileIntegrations": true,
|
|
241
|
+
"crossFileChecks": true,
|
|
242
|
+
"planning": {
|
|
243
|
+
"enabled": true,
|
|
244
|
+
"projectBlueprint": true,
|
|
245
|
+
"fileTodo": true,
|
|
246
|
+
"markerTodo": true,
|
|
247
|
+
"maxCodingPassesPerUnit": 2
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
```
|
package/docs/MODULES.md
CHANGED
|
@@ -88,18 +88,21 @@ accept typed, already-reviewed data and perform no I/O or mutation.
|
|
|
88
88
|
| `types.ts` | Direct-agent request, unit, progress, result, and provider-option types. |
|
|
89
89
|
| `languages.ts` | Language-to-default-extension and human-readable prompt-label mapping; delegates extension ownership to the shared core registry. |
|
|
90
90
|
| `marker-parser.ts` | Lightweight lexical scanner for real line, block, JSDoc, and HTML `@human` comment markers. HTML scanning is tag-aware and also handles script/style comments; quoted attributes, strings, visible-text apostrophes, and already-commented examples stay inert. |
|
|
91
|
-
| `discovery.ts` | Bounded file walking and conversion-unit creation. Output routing prioritizes exact config mappings, consumed first-line extension declarations, inner filename extensions, then deterministic inference; conflicts, existing targets, and unsupported markers produce notices. |
|
|
91
|
+
| `discovery.ts` | Bounded file walking and conversion-unit creation. Output routing prioritizes exact config mappings, consumed first-line extension or canonical language-name declarations, inner filename extensions, then deterministic inference; conflicts, existing targets, and unsupported markers produce notices. |
|
|
92
92
|
| `declarations.ts` | Language-aware declared-identifier extraction, including type-led C, C++, C#, and Java declarations. |
|
|
93
93
|
| `replacement.ts` | Exact inline-marker byte verification plus newline-preserving indentation formatting shared by memory and application. |
|
|
94
94
|
| `candidate-validation.ts` | Baseline-aware pre-write syntax gate: TypeScript parser diagnostics for JS/TS, deterministic structure checks for other programming languages, and non-empty/fence gates for HTML/CSS. Inline units are rejected only for newly introduced diagnostics. It does not claim semantic or sandbox verification. |
|
|
95
95
|
| `candidate-overlay.ts` | In-memory candidate overlay combining whole-file outputs and inline replacements for staged validation; the working tree stays unchanged and stale or conflicting units are excluded fail-closed. |
|
|
96
96
|
| `program-diagnostics.ts` | Combined TypeScript Compiler API validation over the candidate overlay: TypeScript is checked semantically; JavaScript follows explicit project `checkJs` or file `@ts-check` policy. Includes an overlay-aware compiler host, bundled `node:` typings, and multiplicity/location-aware baseline comparison. |
|
|
97
97
|
| `dependency-graph.ts` | Resolved-import dependency grouping of candidate files and bounded diagnostic-to-unit attribution; diagnostics that cannot be safely attributed fail the whole staged batch. |
|
|
98
|
-
| `integration-validation.ts` |
|
|
98
|
+
| `integration-validation.ts` | Cross-language audit orchestration (on by default). It groups generated files using structured ProjectMemory relationships, validates exact audit JSON against real group paths, permits one repair per named target, verifies once, and rejects unresolved groups. Large components are split into bounded relationship neighborhoods. |
|
|
99
|
+
| `project-blueprint.ts` | The shared contract agreed once per run before any file is generated: strict bounded parser for the planning JSON, plus per-target rendering. Every path is checked against real planned targets; a credential-bearing blueprint is discarded. |
|
|
100
|
+
| `unit-todos.ts` | Per-unit todo parsing, the deterministic `todoCoverage` check, and the `contractRegression` ratchet that discards a refinement unless it preserves everything the previous pass produced. |
|
|
101
|
+
| `reference-validation.ts` | Deterministic cross-file reference checking over generated HTML/CSS/JS with zero model requests: missing script selectors and assets are blocking; markup/stylesheet naming drift is advisory. Includes a CSS rule scanner and specificity comparator. |
|
|
99
102
|
| `staged-validation.ts` | Orchestrates overlay build, combined program validation, group rejection, and the bounded per-unit repair budget (secret-scanned repair context, injected repair callback). Produces per-unit accept/reject results for the CLI. |
|
|
100
103
|
| `file-memory.ts` | Ephemeral declaration memory, replacement normalization, candidate-validation retry isolation, and sequential per-file generation. |
|
|
101
104
|
| `project-memory.ts` | Ephemeral codebase context for direct generation. Stores current and projected path inventories, planned source-to-output mappings, target-relative companion/asset paths, language package-module guidance, and secret-aware compact contracts. Renders a deterministic bounded subset per target and learns accepted candidate contracts for later generation/repair requests; it never executes source or persists a cache. |
|
|
102
|
-
| `project-contracts.ts` | Static language-aware summarizers used by ProjectMemory: imports/includes/declarations, HTML references/ids/classes/elements/inline handler calls/control labels, CSS imports/URLs/custom properties/selectors, JavaScript DOM selectors, and limited package metadata. Credential-bearing content produces no contract. |
|
|
105
|
+
| `project-contracts.ts` | Static language-aware summarizers used by ProjectMemory and by cross-file reference checking. Exposes structured `htmlFacts`/`cssFacts`/`javaScriptFacts` with the `*Contract` renderers formatting over them — one parser, two consumers. Extracts: imports/includes/declarations, HTML references/ids/classes/elements/inline handler calls/control labels, CSS imports/URLs/custom properties/selectors, JavaScript DOM selectors, and limited package metadata. Credential-bearing content produces no contract. |
|
|
103
106
|
| `language-relationships.ts` | Declarative/extensible language relationship profiles for scripts/modules, Python, Rust, Go, Java, C/C++, C#, Ruby, HTML/CSS/assets, and same-language fallbacks. Integration orchestration consumes only their structured role/path/reference output. |
|
|
104
107
|
| `generation-client.ts` | Direct provider requests through OpenAI-compatible chat or Ollama: one conversion request per unit plus optional bounded integration and compiler-repair requests, always using the central prompt builders. |
|
|
105
108
|
| `presentation.ts` | Stable conversion receipt and unambiguous single-code-block extraction; rejects multiple or unterminated fences. |
|