@genesislcap/ai-assistant 15.46.5-FUI-2648.1 → 15.47.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/ai-assistant.api.json +0 -65
- package/dist/ai-assistant.d.ts +16 -35
- package/dist/custom-elements.json +215 -21
- package/dist/dts/genesis/config.d.ts +30 -6
- package/dist/dts/genesis/config.d.ts.map +1 -1
- package/dist/dts/genesis/consumes.d.ts.map +1 -1
- package/dist/dts/genesis/event-fields.d.ts.map +1 -1
- package/dist/dts/genesis/filter-fields.d.ts +31 -0
- package/dist/dts/genesis/filter-fields.d.ts.map +1 -1
- package/dist/dts/genesis/index.d.ts +3 -1
- package/dist/dts/genesis/index.d.ts.map +1 -1
- package/dist/dts/genesis/reference-check.d.ts +83 -0
- package/dist/dts/genesis/reference-check.d.ts.map +1 -0
- package/dist/dts/genesis/reference-existence.d.ts +110 -0
- package/dist/dts/genesis/reference-existence.d.ts.map +1 -0
- package/dist/dts/genesis/resource-tools.d.ts +4 -4
- package/dist/dts/genesis/resource-tools.d.ts.map +1 -1
- package/dist/dts/genesis/review-model.d.ts +2 -2
- package/dist/dts/genesis/review-model.d.ts.map +1 -1
- package/dist/dts/genesis/row-source.d.ts +32 -0
- package/dist/dts/genesis/row-source.d.ts.map +1 -1
- package/dist/dts/genesis/server-text.d.ts +29 -0
- package/dist/dts/genesis/server-text.d.ts.map +1 -1
- package/dist/dts/genesis/types.d.ts +32 -5
- package/dist/dts/genesis/types.d.ts.map +1 -1
- package/dist/dts/genesis/write-payload.d.ts +14 -1
- package/dist/dts/genesis/write-payload.d.ts.map +1 -1
- package/dist/dts/genesis/write-plan.d.ts +8 -2
- package/dist/dts/genesis/write-plan.d.ts.map +1 -1
- package/dist/dts/genesis/write-tools.d.ts +5 -3
- package/dist/dts/genesis/write-tools.d.ts.map +1 -1
- package/dist/dts/genesis/write-turn.d.ts +4 -1
- package/dist/dts/genesis/write-turn.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +0 -16
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/dts/main/main.styles.d.ts.map +1 -1
- package/dist/dts/main/main.template.d.ts +4 -7
- package/dist/dts/main/main.template.d.ts.map +1 -1
- package/dist/esm/genesis/config.js +152 -20
- package/dist/esm/genesis/consumes.js +2 -1
- package/dist/esm/genesis/event-fields.js +5 -8
- package/dist/esm/genesis/filter-fields.js +159 -78
- package/dist/esm/genesis/index.js +1 -0
- package/dist/esm/genesis/reference-check.js +132 -0
- package/dist/esm/genesis/reference-existence.js +283 -0
- package/dist/esm/genesis/resource-tools.js +135 -18
- package/dist/esm/genesis/review-model.js +3 -1
- package/dist/esm/genesis/row-source.js +107 -16
- package/dist/esm/genesis/server-text.js +52 -0
- package/dist/esm/genesis/write-payload.js +32 -4
- package/dist/esm/genesis/write-plan.js +3 -2
- package/dist/esm/genesis/write-tools.js +248 -44
- package/dist/esm/main/main.js +0 -21
- package/dist/esm/main/main.styles.js +0 -25
- package/dist/esm/main/main.template.js +34 -76
- package/dist/genesis-consumes.cjs +3 -2
- package/dist/genesis-consumes.cjs.map +2 -2
- package/dist/genesis-consumes.mjs +3 -2
- package/dist/genesis-consumes.mjs.map +2 -2
- package/docs/genesis.md +131 -21
- package/docs/styling.md +0 -130
- package/package.json +17 -17
- package/scripts/smoke-genesis-consumes-node.mjs +2 -2
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import { type GenesisFilterField } from './criteria';
|
|
3
|
+
import type { GenesisEventField } from './event-fields';
|
|
4
|
+
import { type GenesisRowSource, type RequestRowSourceOptions } from './row-source';
|
|
5
|
+
import type { GenesisAiResource, GenesisEventOp, GenesisReference } from './types';
|
|
6
|
+
/** One declared reference, and whether it can be checked. */
|
|
7
|
+
export type ReferenceGate = {
|
|
8
|
+
status: 'checkable';
|
|
9
|
+
reference: GenesisReference;
|
|
10
|
+
/** The target read the check goes through. */
|
|
11
|
+
source: GenesisRowSource;
|
|
12
|
+
/** The target fields the check composes its criteria with, by name. */
|
|
13
|
+
targetFields: ReadonlyMap<string, GenesisFilterField>;
|
|
14
|
+
}
|
|
15
|
+
/** It cannot be checked, for a reason asking again will not change. */
|
|
16
|
+
| {
|
|
17
|
+
status: 'unchecked';
|
|
18
|
+
reference: GenesisReference;
|
|
19
|
+
reason: string;
|
|
20
|
+
}
|
|
21
|
+
/** Its target could not be described this time. Asked again next turn. */
|
|
22
|
+
| {
|
|
23
|
+
status: 'transient';
|
|
24
|
+
reference: GenesisReference;
|
|
25
|
+
reason: string;
|
|
26
|
+
};
|
|
27
|
+
/** @internal */
|
|
28
|
+
export interface ReferenceGateDeps {
|
|
29
|
+
/** The request resources the assistant can read: a reference is checked only through one. */
|
|
30
|
+
requestNames: ReadonlySet<string>;
|
|
31
|
+
/** The row source for a target read, one per `REQ_` name. */
|
|
32
|
+
sourceFor: (resource: string) => GenesisRowSource;
|
|
33
|
+
}
|
|
34
|
+
/** The table a `REQ_<T>` reads. */
|
|
35
|
+
export declare const tableOf: (resource: string) => string;
|
|
36
|
+
/**
|
|
37
|
+
* Decides, per declared reference, whether it can be checked. A reference is checkable only when
|
|
38
|
+
* every one of its fields is.
|
|
39
|
+
*
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare function gateReferences(references: readonly GenesisReference[], fields: readonly GenesisEventField[], deps: ReferenceGateDeps): Promise<ReferenceGate[]>;
|
|
43
|
+
/** A field whose reference cannot be checked: the read it names, and why not. */
|
|
44
|
+
export interface UncheckedField {
|
|
45
|
+
resource: string;
|
|
46
|
+
reason: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* What the gates mean for one write tool.
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export interface ReferenceOutcome {
|
|
54
|
+
/** Why an insert gets no tool: a required value it must send cannot be checked. */
|
|
55
|
+
noTool?: string;
|
|
56
|
+
/** Why the tool waits: a target could not be described this time. */
|
|
57
|
+
transient?: string;
|
|
58
|
+
/** Fields left out of the schema: an insert refuses one if sent, a modify keeps the row's. */
|
|
59
|
+
unchecked: ReadonlyMap<string, UncheckedField>;
|
|
60
|
+
/** The references the check reads. */
|
|
61
|
+
checkable: readonly Extract<ReferenceGate, {
|
|
62
|
+
status: 'checkable';
|
|
63
|
+
}>[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Turns the gates into what the tool does.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare function referenceOutcome(op: GenesisEventOp, fields: readonly GenesisEventField[], gates: readonly ReferenceGate[]): ReferenceOutcome;
|
|
71
|
+
/**
|
|
72
|
+
* The reference gate for one set of write tools: whether each of a write's declared references can
|
|
73
|
+
* be checked, and what that means for its tool. A target read is described once, however many
|
|
74
|
+
* events reference it.
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export declare function createReferenceGate(requestNames: ReadonlySet<string>, timeouts?: RequestRowSourceOptions['timeouts']): (resource: GenesisAiResource, op: GenesisEventOp, fields: readonly GenesisEventField[], connect: Connect) => Promise<ReferenceOutcome>;
|
|
79
|
+
/** What an insert says about a value it cannot check. */
|
|
80
|
+
export declare const notAcceptedHere: (field: string, { resource, reason }: UncheckedField) => string;
|
|
81
|
+
/** What a modify says about a new value it cannot check. */
|
|
82
|
+
export declare const cannotBeChanged: (field: string, { resource, reason }: UncheckedField) => string;
|
|
83
|
+
//# sourceMappingURL=reference-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-check.d.ts","sourceRoot":"","sources":["../../../src/genesis/reference-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,iBAA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;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC/C,sCAAsC;IACtC,SAAS,EAAE,SAAS,OAAO,CAAC,aAAa,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,EAAE,CAAC;CACvE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,SAAS,iBAAiB,EAAE,EACpC,KAAK,EAAE,SAAS,aAAa,EAAE,GAC9B,gBAAgB,CA4BlB;AAQD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,EACjC,QAAQ,CAAC,EAAE,uBAAuB,CAAC,UAAU,CAAC,IAY5C,UAAU,iBAAiB,EAC3B,IAAI,cAAc,EAClB,QAAQ,SAAS,iBAAiB,EAAE,EACpC,SAAS,OAAO,KACf,OAAO,CAAC,gBAAgB,CAAC,CAQ7B;AAED,yDAAyD;AACzD,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,sBAAsB,cAAc,KAAG,MAEpB,CAAC;AAEnE,4DAA4D;AAC5D,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,sBAAsB,cAAc,KAAG,MAEpB,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Connect } from '@genesislcap/foundation-comms';
|
|
2
|
+
import type { GenesisEventField } from './event-fields';
|
|
3
|
+
import { type ReferenceGate } from './reference-check';
|
|
4
|
+
import type { GenesisKeyCheck } from './row-source';
|
|
5
|
+
import type { GenesisEventOp } from './types';
|
|
6
|
+
/** The most distinct values one call may check. */
|
|
7
|
+
export declare const MAX_REFERENCE_CHECKS = 50;
|
|
8
|
+
type Checkable = Extract<ReferenceGate, {
|
|
9
|
+
status: 'checkable';
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* What the model is told about each field whose reference is checked (contracts C-17.16), by
|
|
13
|
+
* field. Only a checkable group has a sentence: one that cannot be checked is not offered at all.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare function checkedSentences(checkable: readonly Checkable[]): Map<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* The tool description's line for the references it checks, cap included, or nothing when it
|
|
20
|
+
* checks none.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export declare function checkedLine(checkable: readonly Checkable[]): string | undefined;
|
|
25
|
+
/** A row on its way to the review, as far as this check needs it. */
|
|
26
|
+
export interface RowForCheck {
|
|
27
|
+
index: number;
|
|
28
|
+
details?: Record<string, unknown>;
|
|
29
|
+
preImage?: Record<string, unknown>;
|
|
30
|
+
problems?: string[];
|
|
31
|
+
}
|
|
32
|
+
/** One group a row sets, and the read that answers for it. */
|
|
33
|
+
export interface ReferenceAsk {
|
|
34
|
+
gate: Checkable;
|
|
35
|
+
/** The write's own fields and the values it sends, in member order. */
|
|
36
|
+
sent: Array<[field: string, value: unknown]>;
|
|
37
|
+
/** What the target's row must hold, by target field. */
|
|
38
|
+
values: Record<string, string>;
|
|
39
|
+
/** Shared by every row that sends the same values to the same read. */
|
|
40
|
+
lookup: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The groups one row has to check, and why it is refused before any read. On a modify only a
|
|
44
|
+
* group with a member the write changes: a row that already holds a dangling reference stays
|
|
45
|
+
* editable while the model leaves it alone.
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
export declare function asksOf(row: RowForCheck, op: GenesisEventOp, fields: readonly GenesisEventField[], checkable: readonly Checkable[]): {
|
|
50
|
+
asks: ReferenceAsk[];
|
|
51
|
+
problems: string[];
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Why a row is refused for what a read said about one of its groups, or nothing when the row it
|
|
55
|
+
* names exists.
|
|
56
|
+
*
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
export declare function problemOf(ask: ReferenceAsk, answer: GenesisKeyCheck | undefined): string | undefined;
|
|
60
|
+
/** What the check says about a batch. */
|
|
61
|
+
export type ReferenceCheck = {
|
|
62
|
+
status: 'checked';
|
|
63
|
+
problems: ReadonlyMap<number, string[]>;
|
|
64
|
+
} | {
|
|
65
|
+
status: 'refused';
|
|
66
|
+
reason: string;
|
|
67
|
+
} | {
|
|
68
|
+
status: 'stopped';
|
|
69
|
+
} | {
|
|
70
|
+
status: 'not_connected';
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Checks before the review that every reference the batch sets names a row the user can see.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* A Stop wins over everything this adds: it is checked before any of it, and again once the
|
|
77
|
+
* reads are back, so a stopped call is never answered as refused, disconnected or unchanged.
|
|
78
|
+
*
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export declare function checkReferences(rows: readonly RowForCheck[], options: {
|
|
82
|
+
op: GenesisEventOp;
|
|
83
|
+
fields: readonly GenesisEventField[];
|
|
84
|
+
checkable: readonly Checkable[];
|
|
85
|
+
connect: Connect;
|
|
86
|
+
signal?: AbortSignal;
|
|
87
|
+
deadlineMs?: number;
|
|
88
|
+
}): Promise<ReferenceCheck>;
|
|
89
|
+
/** A row's references read again as it is written. */
|
|
90
|
+
export type ReferencesNow = {
|
|
91
|
+
status: 'there';
|
|
92
|
+
} | {
|
|
93
|
+
status: 'gone';
|
|
94
|
+
message: string;
|
|
95
|
+
} | {
|
|
96
|
+
status: 'unreadable';
|
|
97
|
+
reason: string;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Reads a row's references again just before it is written (contracts C-17.12), beside its own
|
|
101
|
+
* staleness read. Not memoised across rows, and nothing read before the review is reused: the
|
|
102
|
+
* review can stay open for minutes.
|
|
103
|
+
*
|
|
104
|
+
* @internal
|
|
105
|
+
*/
|
|
106
|
+
export declare function referencesNow(asks: readonly ReferenceAsk[]): Promise<ReferencesNow>;
|
|
107
|
+
/** The rows with what the check found added to their problems. */
|
|
108
|
+
export declare const withReferenceProblems: <T extends RowForCheck>(rows: readonly T[], problems: ReadonlyMap<number, string[]>) => T[];
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=reference-existence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference-existence.d.ts","sourceRoot":"","sources":["../../../src/genesis/reference-existence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,KAAK,aAAa,EAAW,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAQ9C,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAMvC,KAAK,SAAS,GAAG,OAAO,CAAC,aAAa,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC,CAAC;AAEjE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,SAAS,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAcrF;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,GAAG,SAAS,CAU/E;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EA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,WAAW,EAAE,EAC5B,OAAO,EAAE;IACP,EAAE,EAAE,cAAc,CAAC;IACnB,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACrC,SAAS,EAAE,SAAS,SAAS,EAAE,CAAC;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GACA,OAAO,CAAC,cAAc,CAAC,CAsCzB;AAED,sDAAsD;AACtD,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GACnB;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAiCzF;AAED,kEAAkE;AAClE,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,WAAW,EACzD,MAAM,SAAS,CAAC,EAAE,EAClB,UAAU,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,KACtC,CAAC,EAIA,CAAC"}
|
|
@@ -19,9 +19,9 @@ export interface GenesisReadResult {
|
|
|
19
19
|
untrusted: true;
|
|
20
20
|
resource: string;
|
|
21
21
|
rows: unknown[];
|
|
22
|
-
/** True when
|
|
22
|
+
/** True when these rows may not be the full set. */
|
|
23
23
|
truncated: boolean;
|
|
24
|
-
/** When `truncated`: that these rows
|
|
24
|
+
/** When `truncated`: that these rows may not be the full set, and how to narrow the read. */
|
|
25
25
|
note?: string;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -34,7 +34,7 @@ export interface GenesisToolError {
|
|
|
34
34
|
source: typeof GENESIS_DATA_SOURCE;
|
|
35
35
|
untrusted: true;
|
|
36
36
|
resource: string;
|
|
37
|
-
error: 'not_connected' | 'invalid_filter' | 'rejected' | 'request_failed';
|
|
37
|
+
error: 'not_connected' | 'invalid_filter' | 'rejected' | 'request_failed' | 'unexpected_shape';
|
|
38
38
|
message: string;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -75,7 +75,7 @@ export interface GenesisResourceTools {
|
|
|
75
75
|
* Builds the assistant's tools from an app's resources.
|
|
76
76
|
*
|
|
77
77
|
* @remarks
|
|
78
|
-
* Each request resource becomes a read tool: filters from the resource's own schema, a row cap
|
|
78
|
+
* Each request or query resource becomes a read tool: filters from the resource's own schema, a row cap
|
|
79
79
|
* (ADR P10: 50 by default, never more than the resource's `maxRows` whatever the model asks),
|
|
80
80
|
* no paging (see `truncationNote`), and every result stamped as untrusted app data (P9). Event resources are not turned
|
|
81
81
|
* into tools yet; the write path, with its review table, comes separately.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-tools.d.ts","sourceRoot":"","sources":["../../../src/genesis/resource-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,
|
|
1
|
+
{"version":3,"file":"resource-tools.d.ts","sourceRoot":"","sources":["../../../src/genesis/resource-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACvF,OAAO,EAGL,KAAK,OAAO,EAEb,MAAM,+BAA+B,CAAC;AAcvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAalD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,oDAAoD;IACpD,SAAS,EAAE,OAAO,CAAC;IACnB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,mBAAmB,CAAC;IACnC,SAAS,EAAE,IAAI,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,eAAe,GAAG,gBAAgB,GAAG,UAAU,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;IAC/F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,gGAAgG;IAChG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,eAAe,EAAE,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACrD,YAAY,EAAE,gBAAgB,CAAC;CAChC;AA0GD;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,OAAO,GAAE,2BAAgC,GACxC,oBAAoB,CAgHtB"}
|
|
@@ -92,8 +92,8 @@ export interface ReviewModel {
|
|
|
92
92
|
* The table's columns, and the order every row's cells are in.
|
|
93
93
|
*
|
|
94
94
|
* @remarks
|
|
95
|
-
* Built here rather than from one row's keys, because rows legitimately differ: a refused row
|
|
96
|
-
*
|
|
95
|
+
* Built here rather than from one row's keys, because rows legitimately differ: a refused row may
|
|
96
|
+
* carry no payload at all, an insert may name a different subset of fields, and a field that
|
|
97
97
|
* is null in one row and set in another appears in only one of them. A header taken from the
|
|
98
98
|
* first row put those rows' values under the wrong headings — and a refused row at position
|
|
99
99
|
* one gave the table NO headings while every other row still rendered its values.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-model.d.ts","sourceRoot":"","sources":["../../../src/genesis/review-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAE3D,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAEnF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;;;;OAQG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;CACf;AAuBD;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,KAAK,CAAC;AAE7B,gBAAgB;AAChB,MAAM,WAAW,SAAS;IACxB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB;;;;;;;;OAQG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,gBAAgB;AAChB,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,KAA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AAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAGG,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,OAAO,EAAE,OAAO,CAAC;IACjB,8FAA8F;IAC9F,IAAI,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,qBAAqB,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAgB3E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAQ7D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CA2BnE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Connect } from '@genesislcap/foundation-comms';
|
|
2
2
|
import { type GenesisFilterField } from './criteria';
|
|
3
|
+
import { type FilterFieldsResult } from './filter-fields';
|
|
3
4
|
/**
|
|
4
5
|
* Reading the row a write is based on.
|
|
5
6
|
*
|
|
@@ -42,6 +43,26 @@ export type GenesisRowRead = {
|
|
|
42
43
|
status: 'failed';
|
|
43
44
|
reason: string;
|
|
44
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* Whether a row with the given values exists, for a reference check. Carries no row: the rows it
|
|
48
|
+
* reads are used to decide, never shown or returned.
|
|
49
|
+
*
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export type GenesisKeyCheck = {
|
|
53
|
+
status: 'exists';
|
|
54
|
+
} | {
|
|
55
|
+
status: 'missing';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Unknown. `cause: 'unsearchable'` is a value the resource cannot be searched for, and its
|
|
59
|
+
* `reason` then never contains the value: the caller words it.
|
|
60
|
+
*/
|
|
61
|
+
| {
|
|
62
|
+
status: 'failed';
|
|
63
|
+
reason: string;
|
|
64
|
+
cause?: 'unsearchable';
|
|
65
|
+
};
|
|
45
66
|
/**
|
|
46
67
|
* Where a write's rows are read from. One per event resource, held for the life of the tools.
|
|
47
68
|
*
|
|
@@ -76,6 +97,17 @@ export interface GenesisRowSource {
|
|
|
76
97
|
* with every row red.
|
|
77
98
|
*/
|
|
78
99
|
filterableBy(): Promise<ReadonlyMap<string, GenesisFilterField> | undefined>;
|
|
100
|
+
/**
|
|
101
|
+
* This resource's metadata as the loader gave it, so a caller can tell a failure that asking
|
|
102
|
+
* again may fix (`transient`) from one it will not.
|
|
103
|
+
*/
|
|
104
|
+
metadata(): Promise<FilterFieldsResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Whether a row this user can see carries every one of these values. A row the server returns
|
|
107
|
+
* counts only if its values really match: a request that ignores the criteria and sends any row
|
|
108
|
+
* must not pass an invented value.
|
|
109
|
+
*/
|
|
110
|
+
exists(values: Record<string, unknown>): Promise<GenesisKeyCheck>;
|
|
79
111
|
}
|
|
80
112
|
/** @internal */
|
|
81
113
|
export interface RequestRowSourceOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-source.d.ts","sourceRoot":"","sources":["../../../src/genesis/row-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"row-source.d.ts","sourceRoot":"","sources":["../../../src/genesis/row-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO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,OAAO,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACnE;AA0BD,gBAAgB;AAChB,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,wFAAwF;IACxF,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrD;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,EAAE,uBAAuB,GAAG,gBAAgB,CAqN5C"}
|
|
@@ -60,4 +60,33 @@ export declare function plainFailure(error: unknown, context: string, wording: {
|
|
|
60
60
|
timeout: string;
|
|
61
61
|
failed: string;
|
|
62
62
|
}): string;
|
|
63
|
+
/**
|
|
64
|
+
* The app's refusal off an `ERROR` list: every `TEXT` joined, and the codes for the console.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
export declare const refusalOf: (errors: unknown[]) => {
|
|
69
|
+
text: string;
|
|
70
|
+
codes: string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* The `ERROR` list of the NACK a request was rejected with, or `undefined` when the rejection is
|
|
74
|
+
* not a NACK. On the socket path comms rejects a router MSG_NACK or LOGON_NACK with
|
|
75
|
+
* `{ receivedMessage, sentMessage }`, and that message is the app's answer.
|
|
76
|
+
*
|
|
77
|
+
* @internal
|
|
78
|
+
*/
|
|
79
|
+
export declare const nackErrorsOf: (error: unknown) => unknown[] | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* Why a metadata request failed, in words that are safe to show.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* The app's refusal is read off the router's MSG_NACK only when comms keeps it: the socket rejects
|
|
85
|
+
* with `{ receivedMessage, sentMessage }`, but `DefaultConnect.getMetadata` rewraps that as
|
|
86
|
+
* `Error('[object Object]')` today, which reads as the transport failing and gets the generic text.
|
|
87
|
+
* Nothing leaks either way: both go through the allow-list, with the raw text logged.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
91
|
+
export declare function metadataFailureOf(error: unknown, resourceName: string): string;
|
|
63
92
|
//# sourceMappingURL=server-text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-text.d.ts","sourceRoot":"","sources":["../../../src/genesis/server-text.ts"],"names":[],"mappings":"AA2DA,gBAAgB;AAChB,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OAQrB,CAAC;AAyB1B,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,OAAgC,CAAC;AAEnF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,OAC8C,CAAC;AAEhG,gBAAgB;AAChB,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAY7F;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,GACf,MAAM,CAKR;AAKD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAUlE;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3C,MAAM,CAKR"}
|
|
1
|
+
{"version":3,"file":"server-text.d.ts","sourceRoot":"","sources":["../../../src/genesis/server-text.ts"],"names":[],"mappings":"AA2DA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'../config/config';
|
|
5
5
|
import type { TieredAIProviderSwitcher } from '../provider/tiered-provider-switcher';
|
|
6
6
|
/**
|
|
7
|
-
* What a Genesis resource is to the assistant: a request/reply it can read,
|
|
8
|
-
* can propose a write to.
|
|
7
|
+
* What a Genesis resource is to the assistant: a request/reply or a dataserver query it can read,
|
|
8
|
+
* or an event it can propose a write to.
|
|
9
9
|
*
|
|
10
10
|
* @beta
|
|
11
11
|
*/
|
|
12
|
-
export type GenesisResourceKind = 'request' | 'event';
|
|
12
|
+
export type GenesisResourceKind = 'request' | 'event' | 'query';
|
|
13
13
|
/**
|
|
14
14
|
* The wire vocabulary for an event resource's operation. Custom handlers keep their own name.
|
|
15
15
|
*
|
|
@@ -29,20 +29,29 @@ export type GenesisEventOp = (typeof GENESIS_EVENT_OPS)[number];
|
|
|
29
29
|
* @beta
|
|
30
30
|
*/
|
|
31
31
|
export interface GenesisAiResource {
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* `REQ_<NAME>` for a request, `EVENT_<NAME>` for an event, and the query's own name for a
|
|
34
|
+
* dataserver query. Unique within the config.
|
|
35
|
+
*/
|
|
33
36
|
name: string;
|
|
34
37
|
kind: GenesisResourceKind;
|
|
35
38
|
/** Events only. */
|
|
36
39
|
op?: GenesisEventOp;
|
|
37
40
|
/** What the resource is for, in plain words. Becomes the tool's description. */
|
|
38
41
|
context: string;
|
|
39
|
-
/** Requests
|
|
42
|
+
/** Requests and queries: the most rows one read may return (1–1000). Defaults to 50. */
|
|
40
43
|
maxRows?: number;
|
|
41
44
|
/**
|
|
42
45
|
* Insert, modify and delete events only: the event's handler runs custom code, which can write
|
|
43
46
|
* more than the row a review shows. See {@link GenesisCustomCode}.
|
|
44
47
|
*/
|
|
45
48
|
customCode?: GenesisCustomCode;
|
|
49
|
+
/**
|
|
50
|
+
* Inserts and modifies only: the values of this write that must match a row of another table,
|
|
51
|
+
* checked before the review. Absent on a config older than this version, or when the generator
|
|
52
|
+
* had no fields for the table, and then nothing is checked. `[]` declares none.
|
|
53
|
+
*/
|
|
54
|
+
references?: GenesisReference[];
|
|
46
55
|
}
|
|
47
56
|
/**
|
|
48
57
|
* What the app generator found an event's custom code can write to, beyond the row it saves.
|
|
@@ -60,6 +69,24 @@ export interface GenesisCustomCode {
|
|
|
60
69
|
/** True only when the generator could prove those are ALL the other tables it writes to. */
|
|
61
70
|
listComplete: boolean;
|
|
62
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* One reference a write declares: fields whose values must match one row of another table, read
|
|
74
|
+
* through that table's own request resource.
|
|
75
|
+
*
|
|
76
|
+
* @beta
|
|
77
|
+
*/
|
|
78
|
+
export interface GenesisReference {
|
|
79
|
+
/**
|
|
80
|
+
* The target table's own read, `REQ_<T>`. It may name a read the config does not have, and the
|
|
81
|
+
* reference then cannot be checked.
|
|
82
|
+
*/
|
|
83
|
+
resource: string;
|
|
84
|
+
/** Each field of the write and the target field it must equal, in the write's field order. */
|
|
85
|
+
fields: {
|
|
86
|
+
field: string;
|
|
87
|
+
targetField: string;
|
|
88
|
+
}[];
|
|
89
|
+
}
|
|
63
90
|
/**
|
|
64
91
|
* What an assistant version reads from a generated AI config. See `GENESIS_AI_CONSUMES`.
|
|
65
92
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/genesis/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAErF;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GA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,SAAS,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,0BAA0B,CAAC;IACxC;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,4BAA4B;IAC3C,6EAA6E;IAC7E,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,wBAAwB,CAAC;IACpC;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { GenesisEventField } from './event-fields';
|
|
2
|
+
import { type UncheckedField } from './reference-check';
|
|
2
3
|
import type { GenesisEventOp } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Turns one row of model-supplied values into the `DETAILS` payload an event takes.
|
|
@@ -61,6 +62,12 @@ export declare const isCarryOnly: (field: Pick<GenesisEventField, "type">) => bo
|
|
|
61
62
|
* @internal
|
|
62
63
|
*/
|
|
63
64
|
export declare const isWholeNumberType: (type: string | undefined) => boolean;
|
|
65
|
+
/**
|
|
66
|
+
* A value echoed into one of our sentences: bounded, and without the quote that delimits it.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
export declare const quoted: (raw: unknown) => string;
|
|
64
71
|
/**
|
|
65
72
|
* Builds one event payload from a row the model supplied.
|
|
66
73
|
*
|
|
@@ -97,6 +104,12 @@ export interface BuildPayloadOptions {
|
|
|
97
104
|
* would be a model inventing them.
|
|
98
105
|
*/
|
|
99
106
|
preImage?: Record<string, unknown>;
|
|
107
|
+
/**
|
|
108
|
+
* Fields whose reference cannot be checked (contracts C-17.8). An insert refuses a value for one;
|
|
109
|
+
* a modify keeps the row's, and refuses any value but that one or a blank. Required: no default
|
|
110
|
+
* may offer what cannot be checked.
|
|
111
|
+
*/
|
|
112
|
+
unchecked: ReadonlyMap<string, UncheckedField>;
|
|
100
113
|
}
|
|
101
114
|
/**
|
|
102
115
|
* The fields this op may put on the wire: what the event declares, minus the platform's own
|
|
@@ -125,5 +138,5 @@ export declare const isBlankText: (text: string) => boolean;
|
|
|
125
138
|
* @internal
|
|
126
139
|
*/
|
|
127
140
|
export declare const isBlankEntry: (value: unknown) => boolean;
|
|
128
|
-
export declare function buildEventPayload(fields: readonly GenesisEventField[], row: unknown, { op, preImage }
|
|
141
|
+
export declare function buildEventPayload(fields: readonly GenesisEventField[], row: unknown, { op, preImage, unchecked }: BuildPayloadOptions): PayloadResult;
|
|
129
142
|
//# sourceMappingURL=write-payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-payload.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-payload.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-payload.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,GAClD;IAAE,MAAM,EAAE,UA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|
+
import type { UncheckedField } from './reference-check';
|
|
2
3
|
import type { GenesisRowSource } from './row-source';
|
|
3
4
|
import type { GenesisEventOp } from './types';
|
|
4
5
|
/**
|
|
@@ -19,7 +20,10 @@ export interface PlannedRow {
|
|
|
19
20
|
* a re-read by anything else would be re-reading a different question.
|
|
20
21
|
*/
|
|
21
22
|
key?: Record<string, unknown>;
|
|
22
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* The payload, frozen, when one could be built. A row refused over a reference keeps it: `problems`
|
|
25
|
+
* alone decides whether a row is written.
|
|
26
|
+
*/
|
|
23
27
|
details?: Record<string, unknown>;
|
|
24
28
|
/** The row as it stood when the review was built — what the user was shown as "now". */
|
|
25
29
|
preImage?: Record<string, unknown>;
|
|
@@ -37,6 +41,8 @@ export interface PlanOptions {
|
|
|
37
41
|
fields: readonly GenesisEventField[];
|
|
38
42
|
/** Required for a modify or a delete; an insert has no row to read. */
|
|
39
43
|
source?: GenesisRowSource;
|
|
44
|
+
/** Fields whose reference cannot be checked; see `BuildPayloadOptions.unchecked`. Required. */
|
|
45
|
+
unchecked: ReadonlyMap<string, UncheckedField>;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* A batch a person can actually read before approving it.
|
|
@@ -56,7 +62,7 @@ export declare const MAX_WRITE_ROWS = 25;
|
|
|
56
62
|
*
|
|
57
63
|
* @internal
|
|
58
64
|
*/
|
|
59
|
-
export declare function planWrite(rows: unknown, { op, fields, source }: PlanOptions): Promise<{
|
|
65
|
+
export declare function planWrite(rows: unknown, { op, fields, source, unchecked }: PlanOptions): Promise<{
|
|
60
66
|
status: 'ok';
|
|
61
67
|
rows: PlannedRow[];
|
|
62
68
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-plan.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-plan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KA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AC1B,+FAA+F;IAC/F,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAWjC;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,OAAO,EACb,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,WAAW,GAC7C,OAAO,CAAC;IAAE,MAAM,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqNxF;AAsBD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,mGAAmG;GACjG;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACvC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;AACpB,+FAA+F;GAC7F;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,YAAY,CAChC,GAAG,EAAE,UAAU,EACf,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,SAAS,iBAAiB,EAAE,CAAA;CAAE,GACrF,OAAO,CAAC,eAAe,CAAC,CAmB1B"}
|
|
@@ -31,7 +31,9 @@ export type GenesisWriteRowStatus = GenesisWriteStatus
|
|
|
31
31
|
* Approved, and never sent: the user stopped the turn before its turn to be written came.
|
|
32
32
|
* Not `failed`, which says the app could not be reached or the row was refused first.
|
|
33
33
|
*/
|
|
34
|
-
| 'stopped'
|
|
34
|
+
| 'stopped'
|
|
35
|
+
/** A reference it sets no longer named a row when it was written. Nothing was sent. */
|
|
36
|
+
| 'reference_gone';
|
|
35
37
|
/**
|
|
36
38
|
* What the user decided in a write review.
|
|
37
39
|
*
|
|
@@ -166,8 +168,8 @@ export declare function createGenesisWriteTools(resources: readonly GenesisAiRes
|
|
|
166
168
|
toolHandlers: ChatToolHandlers;
|
|
167
169
|
/**
|
|
168
170
|
* The events that can get a write tool, as far as the config can tell: an event refused for its
|
|
169
|
-
* op
|
|
170
|
-
* metadata, read when the tools are first listed, can still withhold one.
|
|
171
|
+
* op, its rowSources entry or a malformed references, or a modify or delete with no row source,
|
|
172
|
+
* is not among them. Their metadata, read when the tools are first listed, can still withhold one.
|
|
171
173
|
*/
|
|
172
174
|
writableEvents: readonly string[];
|
|
173
175
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-tools.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"write-tools.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAc,KAAK,OAAO,EAAE,MAAM,+BAA+B,CAAC;AA0BzE,OAAO,EAAE,mBAAmB,EAAyB,MAAM,kBAAkB,CAAC;AAa9E,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,SAAS,CAAC;AAEjB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAwB1D;;;;;;;;;;;;;;;;;GAiBG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,qBAAqB,GAC7B,kBAAkB;AACpB,oDAAoD;GAClD,cAAc;AAChB,4EAA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AAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,iGAAiG;IACjG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3F;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,MAGvB,CAAC;AA0wBb;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,OAAO,GAAE,wBAA6B,GACrC;IACD,eAAe,EAAE,MAAM,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACrD,YAAY,EAAE,gBAAgB,CAAC;IAC/B;;;;OAIG;IACH,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC,CA0OA"}
|
|
@@ -43,7 +43,10 @@ export interface ProposalRow {
|
|
|
43
43
|
target: Readonly<Record<string, unknown>>;
|
|
44
44
|
/** What the row would write. For a modify, only the fields it changes. */
|
|
45
45
|
change: Readonly<Record<string, unknown>>;
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Why the row was refused: `problems` alone decides refusal. A row refused over a reference keeps
|
|
48
|
+
* its frozen payload, so these are what tell two refusals apart.
|
|
49
|
+
*/
|
|
47
50
|
problems: readonly string[];
|
|
48
51
|
/** What the row's outcome would also say, such as a blank kept as the row's value. */
|
|
49
52
|
notes: readonly string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-turn.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-turn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1C,0EAA0E;IAC1E,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1C
|
|
1
|
+
{"version":3,"file":"write-turn.d.ts","sourceRoot":"","sources":["../../../src/genesis/write-turn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,uEAAuE;IACvE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,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