@genesislcap/ai-assistant 15.42.0 → 15.43.0
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/dist/custom-elements.json +49 -1
- package/dist/dts/genesis/config.d.ts +51 -6
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/genesis/consumes.d.ts +42 -0
- package/dist/dts/genesis/consumes.d.ts.map +1 -0
- package/dist/dts/genesis/criteria.d.ts.map +1 -1
- package/dist/dts/genesis/event-fields.d.ts +4 -1
- package/dist/dts/genesis/event-fields.d.ts.map +1 -1
- package/dist/dts/genesis/index.d.ts +2 -1
- package/dist/dts/genesis/index.d.ts.map +1 -1
- package/dist/dts/genesis/register-genesis-assistant.d.ts +29 -4
- package/dist/dts/genesis/register-genesis-assistant.d.ts.map +1 -1
- package/dist/dts/genesis/resource-tools.d.ts.map +1 -1
- package/dist/dts/genesis/review-model.d.ts.map +1 -1
- package/dist/dts/genesis/types.d.ts +37 -5
- package/dist/dts/genesis/types.d.ts.map +1 -1
- package/dist/dts/genesis/write-payload.d.ts.map +1 -1
- package/dist/dts/genesis/write-tools.d.ts +26 -5
- package/dist/dts/genesis/write-tools.d.ts.map +1 -1
- package/dist/esm/genesis/config.js +105 -50
- package/dist/esm/genesis/consumes.js +30 -0
- package/dist/esm/genesis/criteria.js +28 -0
- package/dist/esm/genesis/event-fields.js +20 -3
- package/dist/esm/genesis/index.js +1 -0
- package/dist/esm/genesis/register-genesis-assistant.js +146 -63
- package/dist/esm/genesis/resource-tools.js +20 -12
- package/dist/esm/genesis/review-model.js +16 -3
- package/dist/esm/genesis/write-payload.js +47 -4
- package/dist/esm/genesis/write-tools.js +199 -45
- package/dist/genesis-consumes.cjs +35 -0
- package/dist/genesis-consumes.cjs.map +7 -0
- package/dist/genesis-consumes.mjs +11 -0
- package/dist/genesis-consumes.mjs.map +7 -0
- package/docs/genesis.md +156 -28
- package/package.json +29 -19
- package/scripts/build-genesis-consumes-node.mjs +50 -0
- package/scripts/smoke-genesis-consumes-node.mjs +70 -0
|
@@ -2,7 +2,7 @@ import { __awaiter } from "tslib";
|
|
|
2
2
|
import { getConnect } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { logger } from '../utils/logger';
|
|
4
4
|
import { withTimeout } from '../utils/with-timeout';
|
|
5
|
-
import { DEFAULT_MAX_ROWS, MAX_ROWS_CEILING, toolNameOf } from './config';
|
|
5
|
+
import { capIsReadable, DEFAULT_MAX_ROWS, MAX_ROWS_CEILING, toolNameOf } from './config';
|
|
6
6
|
import { composeCriteria } from './criteria';
|
|
7
7
|
import { loadFilterFields } from './filter-fields';
|
|
8
8
|
import { serialisable } from './serialisable';
|
|
@@ -120,21 +120,29 @@ function truncationNote(maxRows, cap, canFilter) {
|
|
|
120
120
|
* @beta
|
|
121
121
|
*/
|
|
122
122
|
export function createGenesisResourceTools(resources, options = {}) {
|
|
123
|
-
const requests = resources
|
|
124
|
-
.filter((r) => r.kind === 'request')
|
|
125
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
126
123
|
// Held to the ceiling HERE as well as in the config validator, for the reason `decideOp` is
|
|
127
124
|
// re-checked at the point of use: this factory is exported, and a host calling it directly
|
|
128
125
|
// never passes through the validator. The cap is what stops one read pulling tens of thousands
|
|
129
126
|
// of rows into the conversation and out to the model vendor (ADR P10), so it cannot be a rule
|
|
130
|
-
// that only one entry point obeys.
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
// that only one entry point obeys. No `maxRows` is the default; a number outside the range is
|
|
128
|
+
// clamped into it.
|
|
129
|
+
//
|
|
130
|
+
// A `maxRows` that is there but is not a number declares SOME cap, and none can be read from
|
|
131
|
+
// it. Falling back to the default read up to five times what was declared — `'10'` became 50,
|
|
132
|
+
// where it once meant 10 — so the resource gets no tool instead, as the validator leaves it out.
|
|
133
|
+
const requests = resources
|
|
134
|
+
.filter((r) => r.kind === 'request')
|
|
135
|
+
.filter((r) => {
|
|
136
|
+
if (capIsReadable(r))
|
|
137
|
+
return true;
|
|
138
|
+
logger.warn(`Genesis assistant: ${r.name} has no read tool because its maxRows (${String(r.maxRows)}) ` +
|
|
139
|
+
'is not a number, so the cap it declares cannot be read.');
|
|
140
|
+
return false;
|
|
141
|
+
})
|
|
142
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
143
|
+
const capOf = (r) => r.maxRows === undefined
|
|
144
|
+
? DEFAULT_MAX_ROWS
|
|
145
|
+
: Math.min(Math.max(Math.floor(r.maxRows), 1), MAX_ROWS_CEILING);
|
|
138
146
|
const resolveConnect = () => {
|
|
139
147
|
var _a;
|
|
140
148
|
try {
|
|
@@ -53,6 +53,11 @@ const FIRST_PLAUSIBLE_YEAR = 1971;
|
|
|
53
53
|
const FIRST_WRITABLE_YEAR = 0;
|
|
54
54
|
const LAST_WRITABLE_YEAR = 9999;
|
|
55
55
|
const LAST_PLAUSIBLE_YEAR = 2999;
|
|
56
|
+
const MS_PER_SECOND = 1000;
|
|
57
|
+
const MS_PER_DAY = 86400000;
|
|
58
|
+
const MILLIS_DIGITS = 3;
|
|
59
|
+
/** `value mod unit`, never negative, so an instant before 1970 is read the same way. */
|
|
60
|
+
const remainder = (value, unit) => ((value % unit) + unit) % unit;
|
|
56
61
|
/**
|
|
57
62
|
* A value as a person should read it.
|
|
58
63
|
*
|
|
@@ -73,7 +78,6 @@ const LAST_PLAUSIBLE_YEAR = 2999;
|
|
|
73
78
|
* @internal
|
|
74
79
|
*/
|
|
75
80
|
export function displayValue(value, type) {
|
|
76
|
-
var _a;
|
|
77
81
|
if (value === undefined || value === null)
|
|
78
82
|
return '';
|
|
79
83
|
const genesisType = genesisTypeName(type);
|
|
@@ -113,8 +117,17 @@ export function displayValue(value, type) {
|
|
|
113
117
|
// callers may rely on 0 rendering blank. `=== 0` covers -0.
|
|
114
118
|
if (epoch === 0)
|
|
115
119
|
return isDateTime ? '1970-01-01 00:00:00' : '1970-01-01';
|
|
116
|
-
//
|
|
117
|
-
|
|
120
|
+
// What is written is the millis, so the review shows every part of them that is there.
|
|
121
|
+
// A DATE is a day, but the payload builder takes a time with it ('2026-09-21T15:30', or a
|
|
122
|
+
// DATETIME a model echoes), and shown as the day alone the user approved a time they never
|
|
123
|
+
// saw. So a DATE shows its time whenever it is not midnight — and any value its
|
|
124
|
+
// milliseconds whenever they are not zero, which the formatter's seconds pattern drops.
|
|
125
|
+
const withTime = isDateTime || remainder(epoch, MS_PER_DAY) !== 0;
|
|
126
|
+
const shown = formatTimestamp(epoch, withTime);
|
|
127
|
+
if (!shown)
|
|
128
|
+
return String(value);
|
|
129
|
+
const millis = remainder(epoch, MS_PER_SECOND);
|
|
130
|
+
return millis ? `${shown}.${String(millis).padStart(MILLIS_DIGITS, '0')}` : shown;
|
|
118
131
|
}
|
|
119
132
|
}
|
|
120
133
|
return String(value);
|
|
@@ -62,6 +62,40 @@ function toEpochMillis(value) {
|
|
|
62
62
|
// to write `2026-13-01` as 2027-01-01 and report it `written`. See utcMillisOf.
|
|
63
63
|
return (_a = utcMillisOf(year, month, day, hour, minute, second)) !== null && _a !== void 0 ? _a : NO_SUCH_DATE;
|
|
64
64
|
}
|
|
65
|
+
/** Genesis types that hold a day, and no time of day. */
|
|
66
|
+
const DAY_TYPES = new Set(['DATE', 'LOCALDATE']);
|
|
67
|
+
const MS_PER_DAY = 86400000;
|
|
68
|
+
/**
|
|
69
|
+
* Whether a value the payload would send for a DATE or LOCALDATE falls at a time of day: epoch
|
|
70
|
+
* millis that are not a whole number of days. `-0` is not a time of day, so a negative whole day
|
|
71
|
+
* is not either.
|
|
72
|
+
*/
|
|
73
|
+
const timeOfDayOnADay = (field, value) => DAY_TYPES.has(genesisTypeName(field.type)) &&
|
|
74
|
+
typeof value === 'number' &&
|
|
75
|
+
value % MS_PER_DAY !== 0;
|
|
76
|
+
/**
|
|
77
|
+
* Why a DATE the model gave is refused for its time of day, or nothing.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* The date travels as epoch millis, so the time is written too, and a review showing only the day
|
|
81
|
+
* would hide it. Refused, so the model can resend the day alone. The ROW's own value is kept
|
|
82
|
+
* whatever it holds, and the review shows it in full: the row is what the server stored, and
|
|
83
|
+
* refusing it would make the row unwritable over a field nobody is changing. A model echoing the
|
|
84
|
+
* row's value is the row's too. `fromRow` is false for an echo, so the value is compared with the
|
|
85
|
+
* row's.
|
|
86
|
+
*/
|
|
87
|
+
function timeOfDayRefusal(field, { raw, value, fromRow, rowValue, }) {
|
|
88
|
+
if (fromRow || !timeOfDayOnADay(field, value))
|
|
89
|
+
return undefined;
|
|
90
|
+
const rowMillis = rowValue === undefined ? undefined : toEpochMillis(rowValue);
|
|
91
|
+
if (rowMillis === value)
|
|
92
|
+
return undefined;
|
|
93
|
+
// The row itself holds a time here, and an echo of it that is off by a second, or spelt without
|
|
94
|
+
// its seconds, is not that value. Sent as the bare day it would overwrite the stored time, so
|
|
95
|
+
// the model is told it can leave the field out instead.
|
|
96
|
+
const keep = timeOfDayOnADay(field, rowMillis) ? ", or leave it out to keep the row's value" : '';
|
|
97
|
+
return `${field.name} is a date; send it without a time of day${keep} (got '${quoted(raw)}')`;
|
|
98
|
+
}
|
|
65
99
|
/** Genesis types that hold a whole number, whatever JSON type their metadata declares. */
|
|
66
100
|
const WHOLE_NUMBER_TYPES = new Set(['INT', 'INTEGER', 'LONG', 'SHORT', 'NANO_TIMESTAMP']);
|
|
67
101
|
/**
|
|
@@ -159,13 +193,18 @@ function valueFor(field, raw) {
|
|
|
159
193
|
const millis = toEpochMillis(raw);
|
|
160
194
|
if (millis === NO_SUCH_DATE) {
|
|
161
195
|
return {
|
|
196
|
+
// No hour for a DATE: it is offered no time of day (see timeOfDayOnADay).
|
|
162
197
|
problem: `${label} is not a date that exists (got '${quoted(raw)}'): a month runs 01–12, a day ` +
|
|
163
|
-
|
|
198
|
+
`to the month's last, ${DAY_TYPES.has(type) ? '' : 'an hour 00–23, '}and a year ` +
|
|
199
|
+
'starts at 0100',
|
|
164
200
|
};
|
|
165
201
|
}
|
|
166
202
|
if (millis === undefined) {
|
|
167
203
|
return {
|
|
168
|
-
|
|
204
|
+
// A DATE is offered no time of day: one given is refused (see timeOfDayOnADay).
|
|
205
|
+
problem: `${label} is a date and must be ` +
|
|
206
|
+
`${DAY_TYPES.has(type) ? 'YYYY-MM-DD' : 'YYYY-MM-DD, YYYY-MM-DDTHH:MM'} or epoch millis ` +
|
|
207
|
+
`(got '${quoted(raw)}')`,
|
|
169
208
|
};
|
|
170
209
|
}
|
|
171
210
|
return { value: millis };
|
|
@@ -466,6 +505,7 @@ function sourceOf(field, given, changes, rowValue, merge, op) {
|
|
|
466
505
|
return { raw, fromRow: merge && !modelSent };
|
|
467
506
|
}
|
|
468
507
|
export function buildEventPayload(fields, row, { op, preImage } = {}) {
|
|
508
|
+
var _a;
|
|
469
509
|
if (!row || typeof row !== 'object' || Array.isArray(row)) {
|
|
470
510
|
return {
|
|
471
511
|
status: 'rejected',
|
|
@@ -553,7 +593,8 @@ export function buildEventPayload(fields, row, { op, preImage } = {}) {
|
|
|
553
593
|
problems.push(`${name} is set by the server and cannot be written`);
|
|
554
594
|
continue;
|
|
555
595
|
}
|
|
556
|
-
const
|
|
596
|
+
const rowValue = merge ? preImage === null || preImage === void 0 ? void 0 : preImage[name] : undefined;
|
|
597
|
+
const source = sourceOf(field, given, changes, rowValue, merge, op);
|
|
557
598
|
if (source.problem) {
|
|
558
599
|
problems.push(source.problem);
|
|
559
600
|
continue;
|
|
@@ -573,7 +614,9 @@ export function buildEventPayload(fields, row, { op, preImage } = {}) {
|
|
|
573
614
|
problems.push(unsupplied(field));
|
|
574
615
|
continue;
|
|
575
616
|
}
|
|
576
|
-
const
|
|
617
|
+
const converted = valueFor(field, raw);
|
|
618
|
+
const { value } = converted;
|
|
619
|
+
const problem = (_a = converted.problem) !== null && _a !== void 0 ? _a : timeOfDayRefusal(field, { raw, value, fromRow, rowValue });
|
|
577
620
|
if (problem) {
|
|
578
621
|
// Attribute it correctly. A value carried from the pre-image is the SERVER's own — most
|
|
579
622
|
// often a LONG beyond 2^53 that the read stamped as text and a JSON integer cannot carry
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
2
|
import { getConnect } from '@genesislcap/foundation-comms';
|
|
3
3
|
import { logger } from '../utils/logger';
|
|
4
|
-
import { opFromName, toolNameOf } from './config';
|
|
4
|
+
import { capIsReadable, opFromName, toolNameOf } from './config';
|
|
5
5
|
import { fieldKindOf as criteriaKindOf } from './criteria';
|
|
6
6
|
import { loadEventFields } from './event-fields';
|
|
7
7
|
import { GENESIS_DATA_SOURCE } from './resource-tools';
|
|
@@ -9,6 +9,7 @@ import { buildReviewModel, reviewDecisionOf, selectedRows, } from './review-mode
|
|
|
9
9
|
import { MAX_FEEDBACK_CHARS } from './review-payload';
|
|
10
10
|
import { createRequestRowSource } from './row-source';
|
|
11
11
|
import { genesisTypeName } from './type-name';
|
|
12
|
+
import { GENESIS_EVENT_OPS } from './types';
|
|
12
13
|
import { commitRows } from './write-commit';
|
|
13
14
|
import { isCarryOnly, isWholeNumberType, PLATFORM_MAINTAINED, sendableFields, } from './write-payload';
|
|
14
15
|
import { MAX_WRITE_ROWS, planWrite, stillCurrent, } from './write-plan';
|
|
@@ -261,6 +262,21 @@ function writeDefinition(resource, op, fields, keyable) {
|
|
|
261
262
|
const decideOp = (resource) => {
|
|
262
263
|
const named = opFromName(resource.name);
|
|
263
264
|
const declared = resource.op;
|
|
265
|
+
// An op outside the known set is no op at all. This factory is exported and never runs the
|
|
266
|
+
// validator, and `'MODIFY'` or `'update'` on a name with no suffix passed every check below as
|
|
267
|
+
// a write op that is neither a modify nor a delete: no row read, no merge, no staleness check —
|
|
268
|
+
// an insert-shaped payload that a replacing handler writes over the record, every unnamed
|
|
269
|
+
// column empty.
|
|
270
|
+
// Any op that is there, falsy ones included: `''` or `false` is declared, and is not a known op.
|
|
271
|
+
// Read as absent, it was refused for having no op, with a reason its own name contradicted.
|
|
272
|
+
if (declared !== undefined &&
|
|
273
|
+
declared !== null &&
|
|
274
|
+
!GENESIS_EVENT_OPS.includes(declared)) {
|
|
275
|
+
return {
|
|
276
|
+
refused: `it is declared with op '${String(declared)}', which is not one of ` +
|
|
277
|
+
`${GENESIS_EVENT_OPS.join(', ')}, so there is no way to know what a write through it would do`,
|
|
278
|
+
};
|
|
279
|
+
}
|
|
264
280
|
if (declared && named && declared !== named) {
|
|
265
281
|
return {
|
|
266
282
|
refused: `it is declared as '${declared}' and its name says '${named}'. A write built on the ` +
|
|
@@ -311,7 +327,7 @@ const joined = (items) => items.length > 1 ? `${items.slice(0, -1).join(', ')} a
|
|
|
311
327
|
* `tools` are the events that can get a write tool by the config, sharing the key, in config
|
|
312
328
|
* order: the denial's `next` names them, so it promises exactly what the lock refuses.
|
|
313
329
|
*/
|
|
314
|
-
const locksOf = (resources, sourceNameOf) => {
|
|
330
|
+
const locksOf = (resources, decide, sourceNameOf) => {
|
|
315
331
|
const keyOf = (resource) => {
|
|
316
332
|
var _a;
|
|
317
333
|
const decided = decideOp(resource);
|
|
@@ -322,8 +338,10 @@ const locksOf = (resources, sourceNameOf) => {
|
|
|
322
338
|
const table = (source === null || source === void 0 ? void 0 : source.startsWith('REQ_')) ? source.slice('REQ_'.length) : undefined;
|
|
323
339
|
return table ? { key: `table:${table}`, table } : { key: `event:${resource.name}` };
|
|
324
340
|
};
|
|
341
|
+
// Decided as the tools decide it, its rowSources entry included: an event the config refuses has
|
|
342
|
+
// no tool, so a denial's `next` does not name it.
|
|
325
343
|
const canWrite = (resource) => {
|
|
326
|
-
const decided =
|
|
344
|
+
const decided = decide(resource);
|
|
327
345
|
if (decided.refused)
|
|
328
346
|
return false;
|
|
329
347
|
return decided.op === 'insert' || !!sourceNameOf(resource, decided.op);
|
|
@@ -337,6 +355,157 @@ const locksOf = (resources, sourceNameOf) => {
|
|
|
337
355
|
return Object.assign(Object.assign({}, lock), { tools });
|
|
338
356
|
};
|
|
339
357
|
};
|
|
358
|
+
/**
|
|
359
|
+
* What the config alone settles about the write tools, with no call to the app: which events there
|
|
360
|
+
* are, the op each one writes or why it gets no tool, and where a modify or delete reads its rows.
|
|
361
|
+
*
|
|
362
|
+
* @remarks
|
|
363
|
+
* Metadata read later can still withhold a tool; it can never grant one refused here.
|
|
364
|
+
*/
|
|
365
|
+
function configRules(resources, options) {
|
|
366
|
+
var _a, _b;
|
|
367
|
+
const events = resources
|
|
368
|
+
.filter((r) => r.kind === 'event')
|
|
369
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
370
|
+
const requests = resources.filter((r) => r.kind === 'request');
|
|
371
|
+
// The requests the assistant can read: one whose cap cannot be read gets no read tool, and so is
|
|
372
|
+
// no row source either (see capIsReadable).
|
|
373
|
+
const requestNames = new Set(requests.filter(capIsReadable).map((r) => r.name));
|
|
374
|
+
const unreadable = new Set(requests.filter((r) => !capIsReadable(r)).map((r) => r.name));
|
|
375
|
+
const leftOut = new Set((_a = options.leftOut) !== null && _a !== void 0 ? _a : []);
|
|
376
|
+
// An entry for no event these tools were given does nothing, and whoever wrote it believes it
|
|
377
|
+
// does: a misspelt key most of all. Said here, once, so a direct call hears it as registration
|
|
378
|
+
// does (contracts C-15A.4: ignored with a warning that names it).
|
|
379
|
+
const { rowSources } = options;
|
|
380
|
+
// Not a list: its indexes would be named as events ("rowSources names 0"). Registration refuses
|
|
381
|
+
// one as a shape problem; a direct call gets nothing said about it, as it has no entry to judge.
|
|
382
|
+
if (rowSources && typeof rowSources === 'object' && !Array.isArray(rowSources)) {
|
|
383
|
+
const eventNames = new Set(events.map((resource) => resource.name));
|
|
384
|
+
const named = Object.keys(rowSources).filter((name) => !eventNames.has(name));
|
|
385
|
+
// An event the config has, but that was left out, is not one it "offers no event resource
|
|
386
|
+
// for": said so, whoever reads the console went looking for an event that is there.
|
|
387
|
+
const dropped = named.filter((name) => leftOut.has(name));
|
|
388
|
+
const unknown = named.filter((name) => !leftOut.has(name));
|
|
389
|
+
if (dropped.length) {
|
|
390
|
+
const said = dropped.length === 1
|
|
391
|
+
? 'was left out (the warning that names it says why), so it has no effect'
|
|
392
|
+
: 'were left out (the warnings that name them say why), so they have no effect';
|
|
393
|
+
logger.warn(`Genesis assistant: rowSources names ${dropped.join(', ')}, which ${said}.`);
|
|
394
|
+
}
|
|
395
|
+
if (unknown.length) {
|
|
396
|
+
logger.warn(`Genesis assistant: rowSources names ${unknown.join(', ')}, which the AI config offers ` +
|
|
397
|
+
'no event resource for, so it has no effect.');
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Why a rowSources entry costs this event its write tool, or nothing when it has no entry or
|
|
402
|
+
* the entry names the `REQ_<T>` derived from its own name. Said when the tool is withheld and by
|
|
403
|
+
* the handler, for every op: the rule is about the entry, not about whether the op reads rows.
|
|
404
|
+
*
|
|
405
|
+
* @remarks
|
|
406
|
+
* rowSources used to name any request resource the app exposed. But a write's pre-image has to
|
|
407
|
+
* be the root record as it stands. A view can return a joined table's column under a name the
|
|
408
|
+
* event also has (a STATUS from a joined ORDER), which passes the name-only coverage check and
|
|
409
|
+
* writes the joined table's value into the root record. And a dataserver query is read from a
|
|
410
|
+
* cache that can lag the very change the staleness check exists to catch. So an entry naming
|
|
411
|
+
* anything else is refused, not honoured and not quietly replaced by the default: whoever
|
|
412
|
+
* wrote it meant a different source, and a warning naming what they gave and what is accepted
|
|
413
|
+
* is the thing to find (contracts C-15A.4).
|
|
414
|
+
*/
|
|
415
|
+
const rowSourceRefusal = (eventName) => {
|
|
416
|
+
const { rowSources } = options;
|
|
417
|
+
if (!rowSources || !Object.prototype.hasOwnProperty.call(rowSources, eventName)) {
|
|
418
|
+
return undefined;
|
|
419
|
+
}
|
|
420
|
+
const given = rowSources[eventName];
|
|
421
|
+
const expected = readResourceFor(eventName);
|
|
422
|
+
// An event with no table in its name accepts no entry at all — not even an `undefined` one,
|
|
423
|
+
// which `given === expected` would otherwise read as agreeing with the missing derived name.
|
|
424
|
+
if (expected !== undefined && given === expected)
|
|
425
|
+
return undefined;
|
|
426
|
+
return (`rowSources gives ${String(given)} for it, and ` +
|
|
427
|
+
(expected
|
|
428
|
+
? `only ${expected}, its table's own request resource, is accepted`
|
|
429
|
+
: 'none is accepted, as its name does not end in _INSERT, _MODIFY or _DELETE') +
|
|
430
|
+
'. A view or a query is never a pre-image');
|
|
431
|
+
};
|
|
432
|
+
/**
|
|
433
|
+
* The op a write through this event does, or why it gets no tool: its own op rules first, then
|
|
434
|
+
* its rowSources entry. One decision for both the definition and the handler, so they cannot
|
|
435
|
+
* disagree about which events may write.
|
|
436
|
+
*/
|
|
437
|
+
const decide = (resource) => {
|
|
438
|
+
const decided = decideOp(resource);
|
|
439
|
+
const byRowSources = rowSourceRefusal(resource.name);
|
|
440
|
+
if (!byRowSources)
|
|
441
|
+
return decided;
|
|
442
|
+
// Both reasons when both hold: the op's alone would leave a wrong rowSources entry unsaid,
|
|
443
|
+
// to come back as a refusal the day the op is fixed.
|
|
444
|
+
return { refused: decided.refused ? `${decided.refused}; and ${byRowSources}` : byRowSources };
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* Why a modify or delete has no row source: said when its tool is withheld and by its handler.
|
|
448
|
+
* `forConsole` points at the warning that names a left-out resource, which only the console has:
|
|
449
|
+
* the model reading the handler's reply has no console to look in.
|
|
450
|
+
*/
|
|
451
|
+
const whyNoSource = (eventName, forConsole = false) => {
|
|
452
|
+
const derived = readResourceFor(eventName);
|
|
453
|
+
if (derived && unreadable.has(derived)) {
|
|
454
|
+
return (`its table's own request resource, ${derived}, has no read tool, as its maxRows is not ` +
|
|
455
|
+
'a number, and a write reads its rows only through a resource the assistant can read');
|
|
456
|
+
}
|
|
457
|
+
if (derived && leftOut.has(derived)) {
|
|
458
|
+
return (`its table's own request resource, ${derived}, is in the AI config but was left out, so ` +
|
|
459
|
+
'there is nothing to read its rows from' +
|
|
460
|
+
(forConsole ? '. The warning that names it says why' : ''));
|
|
461
|
+
}
|
|
462
|
+
return derived
|
|
463
|
+
? `the app exposes no request resource to read its rows from. Add ${derived} to the AI config`
|
|
464
|
+
: 'its name does not end in _MODIFY or _DELETE, so there is no table to read its rows from';
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* The request resource a modify or delete reads its rows through, or none, in which case it
|
|
468
|
+
* gets no tool.
|
|
469
|
+
*
|
|
470
|
+
* @remarks
|
|
471
|
+
* The DECIDED op, not `resource.op`: a resource whose op comes from its name would otherwise be
|
|
472
|
+
* told it needs a row source and handed none. Only the table's own request resource, and only
|
|
473
|
+
* when the assistant can already read it: that keeps the write path from becoming a read
|
|
474
|
+
* side-channel for columns no read tool may return. rowSources is never read here: an entry
|
|
475
|
+
* naming anything else costs the event its tool before a source is asked for (see
|
|
476
|
+
* rowSourceRefusal).
|
|
477
|
+
*/
|
|
478
|
+
const readsFrom = (resource, op) => {
|
|
479
|
+
if (op !== 'modify' && op !== 'delete')
|
|
480
|
+
return undefined;
|
|
481
|
+
const name = readResourceFor(resource.name);
|
|
482
|
+
return name && requestNames.has(name) ? name : undefined;
|
|
483
|
+
};
|
|
484
|
+
/**
|
|
485
|
+
* The events the config lets write: not refused by `decide`, and a modify or delete with a row
|
|
486
|
+
* source. Metadata read later can still withhold a tool from one of them, never grant one.
|
|
487
|
+
*/
|
|
488
|
+
const writable = events
|
|
489
|
+
.filter((resource) => {
|
|
490
|
+
const decided = decide(resource);
|
|
491
|
+
return !decided.refused && (decided.op === 'insert' || !!readsFrom(resource, decided.op));
|
|
492
|
+
})
|
|
493
|
+
.map((resource) => resource.name);
|
|
494
|
+
// What the config alone refuses is known now, so it is said now, once: a console checked right
|
|
495
|
+
// after registration showed nothing until the tools were first listed (contracts C-15A.4(b)).
|
|
496
|
+
// Registration builds these tools only after its last blocking check, so nothing here is said
|
|
497
|
+
// of an assistant that does not run.
|
|
498
|
+
// A modify or delete with no row source is decided here too, from the config alone.
|
|
499
|
+
for (const resource of events) {
|
|
500
|
+
const decided = decide(resource);
|
|
501
|
+
const noSource = !decided.refused && decided.op !== 'insert' && !readsFrom(resource, decided.op);
|
|
502
|
+
if (decided.refused || noSource) {
|
|
503
|
+
logger.warn(`Genesis assistant: ${resource.name} has no write tool because ` +
|
|
504
|
+
`${(_b = decided.refused) !== null && _b !== void 0 ? _b : whyNoSource(resource.name, true)}.`);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
return { events, decide, whyNoSource, readsFrom, writable };
|
|
508
|
+
}
|
|
340
509
|
/**
|
|
341
510
|
* Builds the assistant's write tools from an app's event resources.
|
|
342
511
|
*
|
|
@@ -344,10 +513,7 @@ const locksOf = (resources, sourceNameOf) => {
|
|
|
344
513
|
*/
|
|
345
514
|
export function createGenesisWriteTools(resources, options = {}) {
|
|
346
515
|
var _a;
|
|
347
|
-
const events = resources
|
|
348
|
-
.filter((r) => r.kind === 'event')
|
|
349
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
350
|
-
const requestNames = new Set(resources.filter((r) => r.kind === 'request').map((r) => r.name));
|
|
516
|
+
const { events, decide, whyNoSource, readsFrom, writable } = configRules(resources, options);
|
|
351
517
|
const resolveConnect = () => {
|
|
352
518
|
var _a;
|
|
353
519
|
try {
|
|
@@ -358,31 +524,14 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
358
524
|
}
|
|
359
525
|
};
|
|
360
526
|
const sources = new Map();
|
|
361
|
-
|
|
362
|
-
const sourceNameOf = (resource, op) => {
|
|
363
|
-
var _a;
|
|
364
|
-
// The DECIDED op, not `resource.op`: a resource whose op comes from its name would
|
|
365
|
-
// otherwise be told it needs a row source and handed none.
|
|
366
|
-
if (op !== 'modify' && op !== 'delete')
|
|
367
|
-
return undefined;
|
|
368
|
-
const configured = (_a = options.rowSources) === null || _a === void 0 ? void 0 : _a[resource.name];
|
|
369
|
-
const derived = readResourceFor(resource.name);
|
|
370
|
-
// Gated for the OVERRIDE as well as the derived name. A modify reads through a resource the
|
|
371
|
-
// assistant can already read — that is the rule the docs state, and it is what keeps the
|
|
372
|
-
// write path from becoming a read side-channel for columns no read tool may return. An
|
|
373
|
-
// unchecked override would let a config typo widen that silently, and the pre-image it
|
|
374
|
-
// fetched would land in the driver's persisted history.
|
|
375
|
-
const name = configured !== null && configured !== void 0 ? configured : derived;
|
|
376
|
-
return name && requestNames.has(name) ? name : undefined;
|
|
377
|
-
};
|
|
378
|
-
const lockOf = locksOf(resources, sourceNameOf);
|
|
527
|
+
const lockOf = locksOf(resources, decide, readsFrom);
|
|
379
528
|
/**
|
|
380
529
|
* The resource a modify or delete reads through, or nothing — in which case the event gets no
|
|
381
530
|
* tool. A modify with no row to read cannot be built: under replace semantics the fields
|
|
382
531
|
* nobody named would be written as null.
|
|
383
532
|
*/
|
|
384
533
|
const sourceFor = (resource, op, connect) => {
|
|
385
|
-
const name =
|
|
534
|
+
const name = readsFrom(resource, op);
|
|
386
535
|
if (!name)
|
|
387
536
|
return undefined;
|
|
388
537
|
let source = sources.get(resource.name);
|
|
@@ -448,13 +597,13 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
448
597
|
yield Promise.all(events
|
|
449
598
|
.filter((resource) => !settled.has(resource.name) && !skipped.has(resource.name))
|
|
450
599
|
.map((resource) => __awaiter(this, void 0, void 0, function* () {
|
|
451
|
-
var _a;
|
|
452
600
|
// What op this is has to be settled before anything else is decided by it. The
|
|
453
601
|
// config validator checks it too, but only the registration path reaches that.
|
|
454
|
-
const decided =
|
|
602
|
+
const decided = decide(resource);
|
|
603
|
+
// Settled for good: its op and its rowSources entry are the config's, not this moment's.
|
|
604
|
+
// Already said, when these tools were built (see configRules).
|
|
455
605
|
if (decided.refused) {
|
|
456
606
|
skipped.add(resource.name);
|
|
457
|
-
logger.warn(`Genesis assistant: ${resource.name} has no write tool because ${decided.refused}.`);
|
|
458
607
|
return;
|
|
459
608
|
}
|
|
460
609
|
const source = sourceFor(resource, decided.op, connect);
|
|
@@ -462,17 +611,9 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
462
611
|
if (needsRow && !source) {
|
|
463
612
|
// Settled for good: the app exposes no resource to read this event's rows
|
|
464
613
|
// through, which is a property of the config rather than of this moment, so
|
|
465
|
-
// asking again on the next turn would give the same answer.
|
|
614
|
+
// asking again on the next turn would give the same answer. Already said, when
|
|
615
|
+
// these tools were built (see configRules).
|
|
466
616
|
skipped.add(resource.name);
|
|
467
|
-
const named = (_a = options.rowSources) === null || _a === void 0 ? void 0 : _a[resource.name];
|
|
468
|
-
logger.warn(`Genesis assistant: ${resource.name} has no write tool because ` +
|
|
469
|
-
(named
|
|
470
|
-
? `rowSources names ${named}, which is not a request resource in this app's ` +
|
|
471
|
-
'AI config. A write reads its rows through a resource the assistant can ' +
|
|
472
|
-
'already read.'
|
|
473
|
-
: 'the app exposes no request resource to read its rows from. Add ' +
|
|
474
|
-
`${readResourceFor(resource.name)} to the AI config, or name one in ` +
|
|
475
|
-
'rowSources.'));
|
|
476
617
|
return;
|
|
477
618
|
}
|
|
478
619
|
const fields = yield loadFields(resource, connect);
|
|
@@ -510,7 +651,8 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
510
651
|
logger.warn(`Genesis assistant: ${resource.name} has no write tool because ` +
|
|
511
652
|
`${source.resource} does not return ${covered.missing.join(', ')}. A ` +
|
|
512
653
|
'generated modify replaces the record, so a column it cannot read would be ' +
|
|
513
|
-
|
|
654
|
+
"written null. Its table's own request resource has to return every field " +
|
|
655
|
+
'the event writes.');
|
|
514
656
|
return;
|
|
515
657
|
}
|
|
516
658
|
}
|
|
@@ -550,6 +692,8 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
550
692
|
return runWrite(resource, args, context, {
|
|
551
693
|
connect: resolveConnect(),
|
|
552
694
|
sourceFor,
|
|
695
|
+
whyNoSource,
|
|
696
|
+
decide,
|
|
553
697
|
loadFields,
|
|
554
698
|
coverage,
|
|
555
699
|
timeouts: options.timeouts,
|
|
@@ -559,7 +703,7 @@ export function createGenesisWriteTools(resources, options = {}) {
|
|
|
559
703
|
});
|
|
560
704
|
});
|
|
561
705
|
}
|
|
562
|
-
return { toolDefinitions, toolHandlers };
|
|
706
|
+
return { toolDefinitions, toolHandlers, writableEvents: writable };
|
|
563
707
|
}
|
|
564
708
|
/**
|
|
565
709
|
* The line for a row that was sent, with anything the plan must also say about it — a blank the
|
|
@@ -624,7 +768,7 @@ function runWrite(resource, args, context, deps) {
|
|
|
624
768
|
});
|
|
625
769
|
// Settled here as well as when the tool was defined: this factory is exported, so a host can
|
|
626
770
|
// hold the handlers without ever calling toolDefinitions().
|
|
627
|
-
const decided =
|
|
771
|
+
const decided = deps.decide(resource);
|
|
628
772
|
if (decided.refused) {
|
|
629
773
|
return fail('rejected', `${resource.name} has no write tool because ${decided.refused}.`);
|
|
630
774
|
}
|
|
@@ -650,7 +794,7 @@ function runWrite(resource, args, context, deps) {
|
|
|
650
794
|
}
|
|
651
795
|
const source = deps.sourceFor(resource, op, connect);
|
|
652
796
|
if ((op === 'modify' || op === 'delete') && !source) {
|
|
653
|
-
return fail('rejected', `${resource.name}
|
|
797
|
+
return fail('rejected', `${resource.name} cannot be written: ${deps.whyNoSource(resource.name)}. Nothing was sent.`);
|
|
654
798
|
}
|
|
655
799
|
if (source && op === 'modify') {
|
|
656
800
|
// Checked here as well as when the tool was defined, because this factory is exported: a
|
|
@@ -677,6 +821,11 @@ function runWrite(resource, args, context, deps) {
|
|
|
677
821
|
const shownFields = [...sendableFields(fields, op)];
|
|
678
822
|
if (op === 'delete' && source) {
|
|
679
823
|
const described = yield source.describes();
|
|
824
|
+
// `?? []` is for the type, and never decides anything. A row has a pre-image to render only if
|
|
825
|
+
// its read succeeded, a read succeeds only after the source's metadata has loaded, and the
|
|
826
|
+
// source keeps a successful load (row-source.ts) — so by here `described` is there whenever a
|
|
827
|
+
// row carries a pre-image. With no row read there is nothing extra to show. (Reviewed twice by
|
|
828
|
+
// the behaviour-defaults sweep; written down so it is not raised a third time.)
|
|
680
829
|
for (const [name, type] of described !== null && described !== void 0 ? described : []) {
|
|
681
830
|
// The platform's own columns stay out, as review-model already keeps them out of the
|
|
682
831
|
// columns a row brings: a delete showing RECORD_ID and TIMESTAMP would be the same table
|
|
@@ -778,8 +927,13 @@ function runWrite(resource, args, context, deps) {
|
|
|
778
927
|
deps.turns.deny(context.turnSignal, lock.key, resource.name);
|
|
779
928
|
if (read.decision === 'changes_requested')
|
|
780
929
|
turn.changeRequests += 1;
|
|
781
|
-
// Only the proposal just asked about is remembered
|
|
782
|
-
|
|
930
|
+
// Only the proposal just asked about is remembered, until another ANSWER replaces it. A timeout
|
|
931
|
+
// is not an answer: the user said nothing, so the change they asked for still stands, and a
|
|
932
|
+
// resend of the proposal they asked to change is still refused. Cleared on a timeout, it opened
|
|
933
|
+
// a fresh review of exactly that proposal, one Approve from being written.
|
|
934
|
+
if (read.decision !== 'timed_out') {
|
|
935
|
+
turn.lastAsked = read.decision === 'changes_requested' ? proposal : undefined;
|
|
936
|
+
}
|
|
783
937
|
if (read.decision !== 'approved') {
|
|
784
938
|
return declinedResult(resource.name, plan.rows, read, turn.changeRequests, deps.feedbackKey, lock);
|
|
785
939
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/genesis/consumes.ts
|
|
20
|
+
var consumes_exports = {};
|
|
21
|
+
__export(consumes_exports, {
|
|
22
|
+
GENESIS_AI_CONSUMES: () => GENESIS_AI_CONSUMES
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(consumes_exports);
|
|
25
|
+
var GENESIS_AI_CONSUMES = Object.freeze({
|
|
26
|
+
kinds: Object.freeze(["request", "event"]),
|
|
27
|
+
resourceFields: Object.freeze(["name", "kind", "op", "context", "maxRows"]),
|
|
28
|
+
vendors: Object.freeze(["anthropic", "gemini"]),
|
|
29
|
+
tiers: Object.freeze(["low", "high", "reasoning"])
|
|
30
|
+
});
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
GENESIS_AI_CONSUMES
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=genesis-consumes.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/genesis/consumes.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values\n * it accepts.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event'] as const),\n resourceFields: Object.freeze(['name', 'kind', 'op', 'context', 'maxRows'] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,OAAO,CAAU;AAAA,EAClD,gBAAgB,OAAO,OAAO,CAAC,QAAQ,QAAQ,MAAM,WAAW,SAAS,CAAU;AAAA,EACnF,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAC5D,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/genesis/consumes.ts
|
|
2
|
+
var GENESIS_AI_CONSUMES = Object.freeze({
|
|
3
|
+
kinds: Object.freeze(["request", "event"]),
|
|
4
|
+
resourceFields: Object.freeze(["name", "kind", "op", "context", "maxRows"]),
|
|
5
|
+
vendors: Object.freeze(["anthropic", "gemini"]),
|
|
6
|
+
tiers: Object.freeze(["low", "high", "reasoning"])
|
|
7
|
+
});
|
|
8
|
+
export {
|
|
9
|
+
GENESIS_AI_CONSUMES
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=genesis-consumes.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/genesis/consumes.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * What this version of the assistant reads from a generated AI config\n * (`@genesislcap/ai-assistant/genesis/consumes`).\n *\n * @remarks\n * Its own entry point, loadable in bare Node, because the seed's CI reads it in a Node step and\n * `./genesis` cannot be: that entry is bundler-target ESM, and its closure registers custom\n * elements, which need a DOM. So this module imports nothing at run time. A type from `./types`\n * is all it may take, and a test holds it to that. The Node build bundles it to\n * `dist/genesis-consumes.mjs` and `.cjs`, and a smoke test loads both without a DOM.\n *\n * @packageDocumentation\n * @beta\n */\nimport type { GenesisAiConsumes } from './types';\n\nexport type { GenesisAiConsumes } from './types';\n\n/**\n * What this version of the assistant reads from a generated AI config: the resource kinds it\n * accepts, the resource fields its validator or a tool reads, and the `vendor` and `tier` values\n * it accepts.\n *\n * @remarks\n * The generator must not emit what the installed assistant does not read, or a new kind is left out\n * and a new field ignored \u2014 and an older assistant used to block entirely on a kind it did not know.\n * Nothing in the generator can say which version will run its output. So the app's seed declares\n * what it expects, and the seed's CI checks that declaration against this constant, exported from\n * the version it installs. That makes this the single statement of what an assistant consumes, and\n * it carries no version number because it needs none.\n *\n * A test holds it to the code: its kinds are the ones validation accepts, and its fields are the\n * ones read. A change that teaches the validator a kind, or a tool a field, updates it in the same\n * commit.\n *\n * A resource this version does not read is only left out, but an unknown `vendor` or `tier` still\n * blocks the whole assistant, so those are here too. They are written out rather than imported\n * from foundation-ai, which this entry must not load; a test holds them equal to its\n * `AI_TIER_VENDORS` and `AI_TIER_IDS`, which the validator checks against.\n *\n * @beta\n */\nexport const GENESIS_AI_CONSUMES: GenesisAiConsumes = Object.freeze({\n kinds: Object.freeze(['request', 'event'] as const),\n resourceFields: Object.freeze(['name', 'kind', 'op', 'context', 'maxRows'] as const),\n vendors: Object.freeze(['anthropic', 'gemini'] as const),\n tiers: Object.freeze(['low', 'high', 'reasoning'] as const),\n});\n"],
|
|
5
|
+
"mappings": ";AA0CO,IAAM,sBAAyC,OAAO,OAAO;AAAA,EAClE,OAAO,OAAO,OAAO,CAAC,WAAW,OAAO,CAAU;AAAA,EAClD,gBAAgB,OAAO,OAAO,CAAC,QAAQ,QAAQ,MAAM,WAAW,SAAS,CAAU;AAAA,EACnF,SAAS,OAAO,OAAO,CAAC,aAAa,QAAQ,CAAU;AAAA,EACvD,OAAO,OAAO,OAAO,CAAC,OAAO,QAAQ,WAAW,CAAU;AAC5D,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|