@adminiumjs/llm 0.1.0-rc.1
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/LICENSE +661 -0
- package/dist/apply/diff.d.ts +79 -0
- package/dist/apply/diff.d.ts.map +1 -0
- package/dist/apply/diff.js +459 -0
- package/dist/apply/diff.js.map +1 -0
- package/dist/apply/index.d.ts +6 -0
- package/dist/apply/index.d.ts.map +1 -0
- package/dist/apply/index.js +6 -0
- package/dist/apply/index.js.map +1 -0
- package/dist/apply/normalize.d.ts +55 -0
- package/dist/apply/normalize.d.ts.map +1 -0
- package/dist/apply/normalize.js +232 -0
- package/dist/apply/normalize.js.map +1 -0
- package/dist/apply/plan.d.ts +206 -0
- package/dist/apply/plan.d.ts.map +1 -0
- package/dist/apply/plan.js +422 -0
- package/dist/apply/plan.js.map +1 -0
- package/dist/apply/suggestion-id.d.ts +103 -0
- package/dist/apply/suggestion-id.d.ts.map +1 -0
- package/dist/apply/suggestion-id.js +121 -0
- package/dist/apply/suggestion-id.js.map +1 -0
- package/dist/crypto.d.ts +48 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +35 -0
- package/dist/crypto.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt/builder.d.ts +27 -0
- package/dist/prompt/builder.d.ts.map +1 -0
- package/dist/prompt/builder.js +263 -0
- package/dist/prompt/builder.js.map +1 -0
- package/dist/prompt/chunker.d.ts +89 -0
- package/dist/prompt/chunker.d.ts.map +1 -0
- package/dist/prompt/chunker.js +383 -0
- package/dist/prompt/chunker.js.map +1 -0
- package/dist/prompt/index.d.ts +14 -0
- package/dist/prompt/index.d.ts.map +1 -0
- package/dist/prompt/index.js +14 -0
- package/dist/prompt/index.js.map +1 -0
- package/dist/prompt/serializer.d.ts +138 -0
- package/dist/prompt/serializer.d.ts.map +1 -0
- package/dist/prompt/serializer.js +178 -0
- package/dist/prompt/serializer.js.map +1 -0
- package/dist/prompt/templates/v1.d.ts +41 -0
- package/dist/prompt/templates/v1.d.ts.map +1 -0
- package/dist/prompt/templates/v1.js +312 -0
- package/dist/prompt/templates/v1.js.map +1 -0
- package/dist/prompt/token-estimate.d.ts +16 -0
- package/dist/prompt/token-estimate.d.ts.map +1 -0
- package/dist/prompt/token-estimate.js +20 -0
- package/dist/prompt/token-estimate.js.map +1 -0
- package/dist/prompt/types.d.ts +134 -0
- package/dist/prompt/types.d.ts.map +1 -0
- package/dist/prompt/types.js +44 -0
- package/dist/prompt/types.js.map +1 -0
- package/dist/providers/anthropic.d.ts +3 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +65 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/factory.d.ts +3 -0
- package/dist/providers/factory.d.ts.map +1 -0
- package/dist/providers/factory.js +37 -0
- package/dist/providers/factory.js.map +1 -0
- package/dist/providers/http.d.ts +56 -0
- package/dist/providers/http.d.ts.map +1 -0
- package/dist/providers/http.js +148 -0
- package/dist/providers/http.js.map +1 -0
- package/dist/providers/index.d.ts +15 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +15 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/model-catalog.d.ts +21 -0
- package/dist/providers/model-catalog.d.ts.map +1 -0
- package/dist/providers/model-catalog.js +121 -0
- package/dist/providers/model-catalog.js.map +1 -0
- package/dist/providers/ollama.d.ts +3 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +55 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openai-compatible.d.ts +3 -0
- package/dist/providers/openai-compatible.d.ts.map +1 -0
- package/dist/providers/openai-compatible.js +50 -0
- package/dist/providers/openai-compatible.js.map +1 -0
- package/dist/providers/openai.d.ts +18 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +68 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/types.d.ts +112 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +55 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/response/errors.d.ts +60 -0
- package/dist/response/errors.d.ts.map +1 -0
- package/dist/response/errors.js +101 -0
- package/dist/response/errors.js.map +1 -0
- package/dist/response/extract.d.ts +38 -0
- package/dist/response/extract.d.ts.map +1 -0
- package/dist/response/extract.js +77 -0
- package/dist/response/extract.js.map +1 -0
- package/dist/response/index.d.ts +8 -0
- package/dist/response/index.d.ts.map +1 -0
- package/dist/response/index.js +8 -0
- package/dist/response/index.js.map +1 -0
- package/dist/response/merge.d.ts +53 -0
- package/dist/response/merge.d.ts.map +1 -0
- package/dist/response/merge.js +348 -0
- package/dist/response/merge.js.map +1 -0
- package/dist/response/referential.d.ts +113 -0
- package/dist/response/referential.d.ts.map +1 -0
- package/dist/response/referential.js +556 -0
- package/dist/response/referential.js.map +1 -0
- package/dist/response/schema.d.ts +506 -0
- package/dist/response/schema.d.ts.map +1 -0
- package/dist/response/schema.js +191 -0
- package/dist/response/schema.js.map +1 -0
- package/dist/response/validate.d.ts +29 -0
- package/dist/response/validate.d.ts.map +1 -0
- package/dist/response/validate.js +167 -0
- package/dist/response/validate.js.map +1 -0
- package/dist/types.d.ts +95 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +49 -0
- package/dist/types.js.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/** §7.1: "heuristic entries use fixed 0.5." Shared with the diff engine. */
|
|
2
|
+
export const HEURISTIC_CONFIDENCE = 0.5;
|
|
3
|
+
/**
|
|
4
|
+
* Reduce a validated `LlmResponseV1` to the normalized `EnrichmentSet` (§7.1).
|
|
5
|
+
*
|
|
6
|
+
* `tables` is keyed by `"schema.table"`, `enums` by `"schema.table.column"`.
|
|
7
|
+
* Confirmed relations that AFFIRM a declared FK (`correct: true`) re-state an
|
|
8
|
+
* existing relation and are handled at apply time (§8.3), not in the refinement
|
|
9
|
+
* diff. Confirmed relations the model REJECTS (`correct: false`) are a different
|
|
10
|
+
* matter: §8.2 lists them as `rejects-heuristic` rows a human must confirm and
|
|
11
|
+
* "Accept all ≥ 0.8" must never auto-select, so they are lifted into
|
|
12
|
+
* `suppressedRelations` for the diff to surface (finding: without this a
|
|
13
|
+
* `correct: false` suppression produced no diff row at all and bypassed the
|
|
14
|
+
* human-confirm gate).
|
|
15
|
+
*/
|
|
16
|
+
export function normalizeLlmResponse(response, opts = {}) {
|
|
17
|
+
const tables = {};
|
|
18
|
+
for (const t of response.tables) {
|
|
19
|
+
const columns = {};
|
|
20
|
+
for (const c of t.columns) {
|
|
21
|
+
const column = { label: c.label, pii: c.pii };
|
|
22
|
+
if (c.description !== undefined)
|
|
23
|
+
column.description = c.description;
|
|
24
|
+
columns[c.column] = column;
|
|
25
|
+
}
|
|
26
|
+
const table = {
|
|
27
|
+
label: t.label,
|
|
28
|
+
description: t.description,
|
|
29
|
+
icon: t.icon,
|
|
30
|
+
displayColumn: t.displayColumn,
|
|
31
|
+
naturalKey: t.naturalKey,
|
|
32
|
+
templates: t.pageTemplates.map((p) => ({
|
|
33
|
+
template: p.template,
|
|
34
|
+
rank: p.rank,
|
|
35
|
+
reason: p.reason,
|
|
36
|
+
confidence: p.confidence,
|
|
37
|
+
})),
|
|
38
|
+
columns,
|
|
39
|
+
confidence: t.confidence,
|
|
40
|
+
};
|
|
41
|
+
if (t.microcopy !== undefined)
|
|
42
|
+
table.microcopy = t.microcopy;
|
|
43
|
+
tables[t.table] = table;
|
|
44
|
+
}
|
|
45
|
+
const enums = {};
|
|
46
|
+
for (const e of response.enums) {
|
|
47
|
+
enums[`${e.table}.${e.column}`] = e;
|
|
48
|
+
}
|
|
49
|
+
const set = {
|
|
50
|
+
source: 'llm',
|
|
51
|
+
tables,
|
|
52
|
+
enums,
|
|
53
|
+
inferredRelations: response.relations.inferred,
|
|
54
|
+
suppressedRelations: response.relations.confirmed.filter((r) => !r.correct),
|
|
55
|
+
navGroups: response.navGroups,
|
|
56
|
+
dashboards: response.dashboards,
|
|
57
|
+
};
|
|
58
|
+
const runId = opts.llmRunId ?? response.run_id;
|
|
59
|
+
if (runId !== undefined)
|
|
60
|
+
set.llmRunId = runId;
|
|
61
|
+
return set;
|
|
62
|
+
}
|
|
63
|
+
// ─── Heuristic classified model → EnrichmentSet ──────────────────────────────
|
|
64
|
+
/**
|
|
65
|
+
* Reduce the engine's heuristic classification to the same `EnrichmentSet`
|
|
66
|
+
* shape (§7.1). Consumes both the classifier output (`ClassifiedModel` — shape,
|
|
67
|
+
* display/natural key, per-column semantics + PII flags) and the source
|
|
68
|
+
* `DatabaseModel` (identifier names for humanization, declared enum values,
|
|
69
|
+
* inferred relations). Emitting only pure-Zod/pure-TS engine data keeps the
|
|
70
|
+
* heuristic→EnrichmentSet mapping inside `@adminium/llm` with no engine→llm edge.
|
|
71
|
+
*/
|
|
72
|
+
export function normalizeHeuristicBaseline(model, classified) {
|
|
73
|
+
const columnsByTable = new Map(model.tables.map((t) => [t.id, new Map(t.columns.map((c) => [c.name, c]))]));
|
|
74
|
+
const enumValuesById = new Map(model.enums.map((e) => [e.id, e.values]));
|
|
75
|
+
const tables = {};
|
|
76
|
+
const enums = {};
|
|
77
|
+
for (const ct of classified.tables) {
|
|
78
|
+
const modelColumns = columnsByTable.get(ct.tableId);
|
|
79
|
+
const columns = {};
|
|
80
|
+
for (const cc of ct.columns) {
|
|
81
|
+
columns[cc.column] = {
|
|
82
|
+
label: { en_US: humanize(cc.column) },
|
|
83
|
+
pii: heuristicPii(cc.semantics.flags.pii, cc.semantics.confidence),
|
|
84
|
+
};
|
|
85
|
+
const kind = cc.semantics.primary === 'status-workflow'
|
|
86
|
+
? 'workflow'
|
|
87
|
+
: cc.semantics.primary === 'category-enum'
|
|
88
|
+
? 'category'
|
|
89
|
+
: null;
|
|
90
|
+
if (kind === null)
|
|
91
|
+
continue;
|
|
92
|
+
const enumRef = modelColumns?.get(cc.column)?.enumRef ?? null;
|
|
93
|
+
const values = enumRef !== null ? enumValuesById.get(enumRef) : undefined;
|
|
94
|
+
if (values === undefined || values.length === 0)
|
|
95
|
+
continue;
|
|
96
|
+
enums[`${ct.tableId}.${cc.column}`] = {
|
|
97
|
+
table: ct.tableId,
|
|
98
|
+
column: cc.column,
|
|
99
|
+
kind,
|
|
100
|
+
order: [...values],
|
|
101
|
+
tones: enumTones(values),
|
|
102
|
+
reason: 'Heuristic enum classification from column semantics and declared values.',
|
|
103
|
+
confidence: HEURISTIC_CONFIDENCE,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
tables[ct.tableId] = {
|
|
107
|
+
label: { en_US: humanize(ct.tableId) },
|
|
108
|
+
icon: SHAPE_ICONS[ct.shape.kind] ?? 'table',
|
|
109
|
+
displayColumn: ct.displayColumn,
|
|
110
|
+
naturalKey: ct.naturalKey !== null ? [ct.naturalKey] : null,
|
|
111
|
+
templates: [],
|
|
112
|
+
columns,
|
|
113
|
+
confidence: HEURISTIC_CONFIDENCE,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const inferredRelations = [];
|
|
117
|
+
for (const rel of model.relations) {
|
|
118
|
+
if (rel.kind === 'inferred-name' || rel.kind === 'inferred-join-table') {
|
|
119
|
+
inferredRelations.push(toInferredRelation(rel));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
source: 'heuristic',
|
|
124
|
+
tables,
|
|
125
|
+
enums,
|
|
126
|
+
inferredRelations,
|
|
127
|
+
suppressedRelations: [],
|
|
128
|
+
navGroups: [],
|
|
129
|
+
dashboards: [],
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// ─── Local mirrors of the two engine heuristics the classifier doesn't persist ─
|
|
133
|
+
/**
|
|
134
|
+
* Mirror of `@adminium/widgets/generate` `registry/candidates.ts#humanize`
|
|
135
|
+
* (byte-identical twin of the engine's `generate/util.ts#humanize`):
|
|
136
|
+
* `order_details` → `Order Details`; `public.orders` → `Orders`. Kept
|
|
137
|
+
* byte-faithful so the heuristic baseline labels match what the generator
|
|
138
|
+
* emits.
|
|
139
|
+
*/
|
|
140
|
+
function humanize(name) {
|
|
141
|
+
const bare = name.includes('.') ? (name.split('.').pop() ?? name) : name;
|
|
142
|
+
return bare
|
|
143
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
144
|
+
.replace(/[_-]+/g, ' ')
|
|
145
|
+
.trim()
|
|
146
|
+
.split(/\s+/)
|
|
147
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
148
|
+
.join(' ');
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Mirror of `@adminium/widgets/generate` `generate/crud-body.ts#enumTones`
|
|
152
|
+
* (§7.1 rule-7 tone map), narrowed to the `Tone` union. The generator map
|
|
153
|
+
* never emits `accent`.
|
|
154
|
+
*/
|
|
155
|
+
const TONE_POS = /^(active|paid|done|completed?|closed|approved|healthy|shipped|delivered)$/i;
|
|
156
|
+
const TONE_WARN = /^(pending|trial|review|in_review|draft|queued|on_hold|paused|open|new)$/i;
|
|
157
|
+
const TONE_DANGER = /^(failed|rejected|churned|overdue|blocked|cancell?ed|error)$/i;
|
|
158
|
+
function enumTones(values) {
|
|
159
|
+
const tones = {};
|
|
160
|
+
for (const value of values) {
|
|
161
|
+
if (TONE_POS.test(value))
|
|
162
|
+
tones[value] = 'pos';
|
|
163
|
+
else if (TONE_WARN.test(value))
|
|
164
|
+
tones[value] = 'warn';
|
|
165
|
+
else if (TONE_DANGER.test(value))
|
|
166
|
+
tones[value] = 'danger';
|
|
167
|
+
else
|
|
168
|
+
tones[value] = 'muted';
|
|
169
|
+
}
|
|
170
|
+
return tones;
|
|
171
|
+
}
|
|
172
|
+
/** Mirror of the generator's nav-icon-per-shape map (09 §2.2 / generate/index.ts). */
|
|
173
|
+
const SHAPE_ICONS = {
|
|
174
|
+
people: 'users',
|
|
175
|
+
workflow: 'kanban-square',
|
|
176
|
+
events: 'calendar',
|
|
177
|
+
catalog: 'package',
|
|
178
|
+
log: 'scroll-text',
|
|
179
|
+
settings: 'settings',
|
|
180
|
+
geo: 'map',
|
|
181
|
+
join: 'link',
|
|
182
|
+
generic: 'table',
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Map the engine's PII kind (§7.2) onto the LLM contract's PII vocabulary (§6.1)
|
|
186
|
+
* with a sensible default masking, so a heuristic PII flag normalizes into the
|
|
187
|
+
* same `PiiSuggestion` shape the LLM emits. Masking is a display default; the
|
|
188
|
+
* diff treats a heuristic flag as "considers this PII" and compares confirm vs
|
|
189
|
+
* reject, not masking strategy.
|
|
190
|
+
*/
|
|
191
|
+
const PII_KIND_MAP = {
|
|
192
|
+
email: { kind: 'email', masking: 'mask-email' },
|
|
193
|
+
phone: { kind: 'phone', masking: 'mask-partial' },
|
|
194
|
+
ip: { kind: 'ip', masking: 'mask-partial' },
|
|
195
|
+
'person-name': { kind: 'name', masking: 'mask-partial' },
|
|
196
|
+
address: { kind: 'address', masking: 'redact' },
|
|
197
|
+
dob: { kind: 'dob', masking: 'redact' },
|
|
198
|
+
'gov-id': { kind: 'gov-id', masking: 'last4' },
|
|
199
|
+
'payment-id': { kind: 'financial', masking: 'last4' },
|
|
200
|
+
'geo-precise': { kind: 'location', masking: 'redact' },
|
|
201
|
+
};
|
|
202
|
+
function heuristicPii(kind, confidence) {
|
|
203
|
+
if (kind === null)
|
|
204
|
+
return null;
|
|
205
|
+
const mapped = PII_KIND_MAP[kind];
|
|
206
|
+
return {
|
|
207
|
+
kind: mapped.kind,
|
|
208
|
+
masking: mapped.masking,
|
|
209
|
+
reason: `Heuristic PII flag (${kind}).`,
|
|
210
|
+
confidence,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function toInferredRelation(rel) {
|
|
214
|
+
const kind = rel.cardinality === 'one-to-one'
|
|
215
|
+
? 'one-to-one'
|
|
216
|
+
: rel.cardinality === 'many-to-many'
|
|
217
|
+
? 'many-to-many-via'
|
|
218
|
+
: 'many-to-one';
|
|
219
|
+
const inferred = {
|
|
220
|
+
fromTable: rel.from.tableId,
|
|
221
|
+
fromColumns: [...rel.from.columns],
|
|
222
|
+
toTable: rel.to.tableId,
|
|
223
|
+
toColumns: [...rel.to.columns],
|
|
224
|
+
kind,
|
|
225
|
+
evidence: 'Heuristic-inferred relation from the engine classifier.',
|
|
226
|
+
confidence: rel.confidence,
|
|
227
|
+
};
|
|
228
|
+
if (rel.through !== null)
|
|
229
|
+
inferred.viaTable = rel.through.tableId;
|
|
230
|
+
return inferred;
|
|
231
|
+
}
|
|
232
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../src/apply/normalize.ts"],"names":[],"mappings":"AAyCA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AASxC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAuB,EACvB,OAA4B,EAAE;IAE9B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAE3C,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChC,MAAM,OAAO,GAA+B,EAAE,CAAC;QAC/C,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;YAC1B,MAAM,MAAM,GAAuC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;YAClF,IAAI,CAAC,CAAC,WAAW,KAAK,SAAS;gBAAE,MAAM,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;YACpE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;QAC7B,CAAC;QAED,MAAM,KAAK,GAAoB;YAC7B,KAAK,EAAE,CAAC,CAAC,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,UAAU;KAC3B,CAAC;IACF,IAAI,GAAG,CAAC,OAAO,KAAK,IAAI;QAAE,QAAQ,CAAC,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;IAClE,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PURE apply-planner (06-llm-assist.md §8.3).
|
|
3
|
+
*
|
|
4
|
+
* Turns a reviewed {@link SuggestionDiff}[] plus the set of accepted suggestion
|
|
5
|
+
* ids into an ordered, serializable {@link ApplyPlan} of WRITE DESCRIPTORS — one
|
|
6
|
+
* per accepted suggestion, each mapped to its §8.3 apply target. A descriptor
|
|
7
|
+
* names its target table/column/field + value; it is NOT SQL. The server-side
|
|
8
|
+
* executor (T10b, `apps/server`) turns descriptors into transactional Kysely
|
|
9
|
+
* writes against `adminium_schema_overrides` / `adminium_pages` and owns
|
|
10
|
+
* upsert idempotency at write time.
|
|
11
|
+
*
|
|
12
|
+
* Browser-safe (01-architecture.md §2.3): this module imports only pure-TS types
|
|
13
|
+
* from within `@adminium/llm`; it never touches `@adminium/meta` or a DB driver.
|
|
14
|
+
* Provider network calls happen server-side only — the dashboard imports this
|
|
15
|
+
* planner purely to preview the write set in the review confirmation modal.
|
|
16
|
+
*
|
|
17
|
+
* Provenance (§8.3, user > llm > heuristic) is enforced IN THE PLAN:
|
|
18
|
+
* - suggestions whose diff row is `user-locked` (an existing `source: 'user'`
|
|
19
|
+
* override) are EXCLUDED — applying an LLM run never touches a user edit;
|
|
20
|
+
* - a `rejects-heuristic` acceptance produces the correct SUPPRESSION
|
|
21
|
+
* descriptor (`pii` value `null`, or `relation_suppressed`) rather than a
|
|
22
|
+
* positive override.
|
|
23
|
+
*
|
|
24
|
+
* Idempotency: `buildApplyPlan` is a pure function of `(diff, acceptedIds, opts)`
|
|
25
|
+
* — no `Date.now` / `Math.random`, `acceptedIds` order is irrelevant (it is
|
|
26
|
+
* consumed as a set), and the output is emitted in the diff's own stable
|
|
27
|
+
* (category, id) order — so re-planning the same run yields an identical plan.
|
|
28
|
+
* Write-time upsert idempotency (no duplicate rows/pages) is T10b's concern.
|
|
29
|
+
*/
|
|
30
|
+
import type { LocaleCode } from '../response/schema.js';
|
|
31
|
+
import type { SuggestionDiff } from './diff.js';
|
|
32
|
+
/**
|
|
33
|
+
* The `adminium_schema_overrides` fields an accepted suggestion can target. The
|
|
34
|
+
* table-`label` value bundles `label` + `description` + `icon` together (the
|
|
35
|
+
* §8.1 accept unit "table label+description+icon bundle", mirroring the meta
|
|
36
|
+
* `table.label` op which stores the icon inline) — there is no standalone icon
|
|
37
|
+
* descriptor. The executor maps each field onto a concrete override op.
|
|
38
|
+
*/
|
|
39
|
+
export type OverrideField = 'label' | 'key' | 'pii' | 'copy' | 'enum_semantics' | 'virtual_relation' | 'relation_suppressed';
|
|
40
|
+
/** A write against `adminium_schema_overrides` (§8.3). */
|
|
41
|
+
export interface OverrideWrite {
|
|
42
|
+
target: 'override';
|
|
43
|
+
/** The originating §8.1 suggestion id (accept/reject trace + idempotency key). */
|
|
44
|
+
suggestionId: string;
|
|
45
|
+
field: OverrideField;
|
|
46
|
+
/** Qualified `"schema.table"`. */
|
|
47
|
+
table: string;
|
|
48
|
+
/** Column name for column-scoped fields; `null` for table-scoped fields. */
|
|
49
|
+
column: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Field-specific value json (localized maps where applicable), or `null` for
|
|
52
|
+
* an explicit clear — a `rejects-heuristic` PII rejection writes `pii: null`.
|
|
53
|
+
*/
|
|
54
|
+
value: Record<string, unknown> | null;
|
|
55
|
+
/** Always `'llm'` — the executor never lets an LLM write shadow a user edit. */
|
|
56
|
+
source: 'llm';
|
|
57
|
+
confidence: number;
|
|
58
|
+
}
|
|
59
|
+
/** One grid item on a planned dashboard page (04-widget-registry.md §6.1). */
|
|
60
|
+
export interface PlannedLayoutItem {
|
|
61
|
+
/** Deterministic instance id = the widget's §8.1 suggestion id. */
|
|
62
|
+
i: string;
|
|
63
|
+
/** Registry widget id. */
|
|
64
|
+
widget: string;
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
/** Width in grid columns — the §5 span heuristic (KPI 3, donut/funnel 4, bar/table 6, line/area 8). */
|
|
68
|
+
w: number;
|
|
69
|
+
/** Height in half-row (40px) units — KPI 3, everything else 8. */
|
|
70
|
+
h: number;
|
|
71
|
+
config: {
|
|
72
|
+
title: string;
|
|
73
|
+
binding: Record<string, unknown>;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** A planned dashboard grid (`config.layout`), matching `pageLayoutSchema`. */
|
|
77
|
+
export interface PlannedLayout {
|
|
78
|
+
version: 1;
|
|
79
|
+
items: PlannedLayoutItem[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Assign `nav_group` + `nav_order` to each member table's page rows (§8.3
|
|
83
|
+
* `group`). The executor stamps the group/order onto every table in `tables`.
|
|
84
|
+
*/
|
|
85
|
+
export interface NavGroupWrite {
|
|
86
|
+
target: 'page';
|
|
87
|
+
kind: 'nav-group';
|
|
88
|
+
suggestionId: string;
|
|
89
|
+
/** Group slug (kebab-case). */
|
|
90
|
+
group: string;
|
|
91
|
+
navOrder: number;
|
|
92
|
+
/** Localized group label. */
|
|
93
|
+
label: Partial<Record<LocaleCode, string>>;
|
|
94
|
+
icon: string;
|
|
95
|
+
/** Qualified table names this nav placement applies to. */
|
|
96
|
+
tables: string[];
|
|
97
|
+
source: 'llm';
|
|
98
|
+
confidence: number;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* A new template page row for a table (§8.3 `template`): `{ type: template,
|
|
102
|
+
* table, config, enabled: true, source: 'llm' }`. The executor generates the
|
|
103
|
+
* template body from the active snapshot and skips the write if an identical
|
|
104
|
+
* page already exists — the planner does not dedupe against DB state.
|
|
105
|
+
*/
|
|
106
|
+
export interface TemplatePageWrite {
|
|
107
|
+
target: 'page';
|
|
108
|
+
kind: 'template-page';
|
|
109
|
+
suggestionId: string;
|
|
110
|
+
/** Page-template id, e.g. `page-queue-inbox`. */
|
|
111
|
+
template: string;
|
|
112
|
+
/** Qualified `"schema.table"` this page is generated for. */
|
|
113
|
+
table: string;
|
|
114
|
+
/** Recommendation rank (1 = best) — the executor derives nav ordering from it. */
|
|
115
|
+
rank: number;
|
|
116
|
+
/** Minimal data-scope seed; the executor expands it into the full page body. */
|
|
117
|
+
config: {
|
|
118
|
+
source: {
|
|
119
|
+
connectionId: string;
|
|
120
|
+
table: string;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
source: 'llm';
|
|
124
|
+
confidence: number;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* A new `page-dashboard` row whose `config.layout.items[]` carry the accepted,
|
|
128
|
+
* bound widgets (§8.3 `dashboard` + `widget`). Widgets are NOT standalone
|
|
129
|
+
* descriptors — each accepted widget folds into its dashboard's layout; an
|
|
130
|
+
* accepted widget whose dashboard was not accepted produces nothing (a widget
|
|
131
|
+
* cannot exist without its container page).
|
|
132
|
+
*/
|
|
133
|
+
export interface DashboardPageWrite {
|
|
134
|
+
target: 'page';
|
|
135
|
+
kind: 'dashboard-page';
|
|
136
|
+
suggestionId: string;
|
|
137
|
+
/** Dashboard slug. */
|
|
138
|
+
dashboard: string;
|
|
139
|
+
domain: string;
|
|
140
|
+
label: Partial<Record<LocaleCode, string>>;
|
|
141
|
+
navOrder: number;
|
|
142
|
+
/** Qualified table names the dashboard spans. */
|
|
143
|
+
tables: string[];
|
|
144
|
+
/** `config.layout` — items carry the query-descriptor binding + span-heuristic w/h. */
|
|
145
|
+
layout: PlannedLayout;
|
|
146
|
+
/** The accepted widget suggestion ids folded into this page (bound layout items). */
|
|
147
|
+
widgetIds: string[];
|
|
148
|
+
source: 'llm';
|
|
149
|
+
confidence: number;
|
|
150
|
+
}
|
|
151
|
+
export type PageWrite = NavGroupWrite | TemplatePageWrite | DashboardPageWrite;
|
|
152
|
+
export type WriteDescriptor = OverrideWrite | PageWrite;
|
|
153
|
+
/** An ordered, serializable plan of write descriptors (§8.3). */
|
|
154
|
+
export interface ApplyPlan {
|
|
155
|
+
/** The connection every write targets (also stamped into widget bindings). */
|
|
156
|
+
connectionId: string;
|
|
157
|
+
/** The run this plan derives from — provenance recorded on every applied row. */
|
|
158
|
+
llmRunId?: string;
|
|
159
|
+
/**
|
|
160
|
+
* Write descriptors in the diff's stable (category, id) order: labels, keys,
|
|
161
|
+
* enum semantics, relations, PII, template pages, nav groups, dashboard
|
|
162
|
+
* pages, micro-copy. Deterministic — re-planning the same run is identical.
|
|
163
|
+
*/
|
|
164
|
+
writes: WriteDescriptor[];
|
|
165
|
+
/** Accepted ids skipped because their target is a `source: 'user'` override (locked). */
|
|
166
|
+
excludedUserLocked: string[];
|
|
167
|
+
}
|
|
168
|
+
export interface ApplyPlanOptions {
|
|
169
|
+
/** The connection these writes target; stamped into query-descriptor bindings. */
|
|
170
|
+
connectionId: string;
|
|
171
|
+
/** The run this plan derives from — provenance recorded on the plan. */
|
|
172
|
+
llmRunId?: string;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build the ordered {@link ApplyPlan} for the accepted subset of a reviewed diff
|
|
176
|
+
* (§8.3). Emits one descriptor per accepted suggestion (widgets fold into their
|
|
177
|
+
* dashboard), excludes `user-locked` targets (provenance), and turns
|
|
178
|
+
* `rejects-heuristic` acceptances into suppression descriptors.
|
|
179
|
+
*/
|
|
180
|
+
export declare function buildApplyPlan(diff: readonly SuggestionDiff[], acceptedIds: Iterable<string>, opts: ApplyPlanOptions): ApplyPlan;
|
|
181
|
+
export interface ApplyPlanSummary {
|
|
182
|
+
totalWrites: number;
|
|
183
|
+
overrides: number;
|
|
184
|
+
pages: number;
|
|
185
|
+
labels: number;
|
|
186
|
+
keys: number;
|
|
187
|
+
pii: number;
|
|
188
|
+
enums: number;
|
|
189
|
+
/** virtual relations + suppressions. */
|
|
190
|
+
relations: number;
|
|
191
|
+
microcopy: number;
|
|
192
|
+
navGroups: number;
|
|
193
|
+
templatePages: number;
|
|
194
|
+
dashboardPages: number;
|
|
195
|
+
/** Total bound layout items across all dashboard pages. */
|
|
196
|
+
widgets: number;
|
|
197
|
+
/**
|
|
198
|
+
* English fallback sentence ("Creates 1 dashboard page, 3 template pages;
|
|
199
|
+
* updates 41 labels…") for the confirmation modal. UI surfaces localize from
|
|
200
|
+
* the numeric counts above; this package carries no i18n runtime.
|
|
201
|
+
*/
|
|
202
|
+
text: string;
|
|
203
|
+
}
|
|
204
|
+
/** Human counts for the review confirmation modal (§10.3, task step 3). */
|
|
205
|
+
export declare function applyPlanSummary(plan: ApplyPlan): ApplyPlanSummary;
|
|
206
|
+
//# sourceMappingURL=plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/apply/plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,OAAO,KAAK,EAAoC,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,KAAK,EAAsB,cAAc,EAAoB,MAAM,WAAW,CAAC;AAKtF;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,KAAK,GACL,KAAK,GACL,MAAM,GACN,gBAAgB,GAChB,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B,0DAA0D;AAC1D,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,kFAAkF;IAClF,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,aAAa,CAAC;IACrB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtC,gFAAgF;IAChF,MAAM,EAAE,KAA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