@genesislcap/ai-assistant 15.50.1 → 15.50.2

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.
@@ -35,7 +35,26 @@ export interface GenesisEventField {
35
35
  title?: string;
36
36
  /** For ENUM fields: the values the server accepts. */
37
37
  validValues?: string[];
38
+ /**
39
+ * For a STRING field: the most characters it holds, from `MAX_LENGTH`, else
40
+ * {@link DEFAULT_STRING_MAX_LENGTH}. Not set on any other type.
41
+ */
42
+ maxLength?: number;
43
+ /** For a STRING field: the fewest characters it takes, when `MIN_LENGTH` says. */
44
+ minLength?: number;
38
45
  }
46
+ /**
47
+ * The column size assumed for a STRING field whose metadata gives no `MAX_LENGTH`.
48
+ *
49
+ * @remarks
50
+ * A platform assumption, not something the app advertises: GSF 8.15 stores a plain `STRING` as
51
+ * `VARCHAR(64)`, and neither the metadata nor the JSON schema says so. A longer value passes the
52
+ * schema and then fails in the database with a 500, whose text is the SQL statement. A field
53
+ * with an explicit size (`STRING(100)`) carries `MAX_LENGTH`, and that wins.
54
+ *
55
+ * @internal
56
+ */
57
+ export declare const DEFAULT_STRING_MAX_LENGTH = 64;
39
58
  /** @internal */
40
59
  export type EventFieldsResult = {
41
60
  status: 'ok';
@@ -1 +1 @@
1
- {"version":3,"file":"event-fields.d.ts","sourceRoot":"","sources":["../../../src/genesis/event-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAkB,MAAM,+BAA+B,CAAC;AAOvF;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,6FAA6F;IAC7F,QAAQ,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,gFAAgF;IAChF,KAAK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,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;AAy+Bb;;;;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,CAmPA"}
@@ -4,6 +4,18 @@ import { withTimeout } from '../utils/with-timeout';
4
4
  import { allowedValuesOf, listOf, metadataNameOf } from './filter-fields';
5
5
  import { metadataFailureOf } from './server-text';
6
6
  import { genesisTypeName } from './type-name';
7
+ /**
8
+ * The column size assumed for a STRING field whose metadata gives no `MAX_LENGTH`.
9
+ *
10
+ * @remarks
11
+ * A platform assumption, not something the app advertises: GSF 8.15 stores a plain `STRING` as
12
+ * `VARCHAR(64)`, and neither the metadata nor the JSON schema says so. A longer value passes the
13
+ * schema and then fails in the database with a 500, whose text is the SQL statement. A field
14
+ * with an explicit size (`STRING(100)`) carries `MAX_LENGTH`, and that wins.
15
+ *
16
+ * @internal
17
+ */
18
+ export const DEFAULT_STRING_MAX_LENGTH = 64;
7
19
  /**
8
20
  * How a value travels when the reply does not say. Every live 8.15 `FIELD` entry carries
9
21
  * `JSON_TYPE`, so this is a defensive path — but deriving it locally beats sending an INT as a
@@ -65,6 +77,20 @@ const titleOf = (detail) => {
65
77
  const title = detail.TITLE;
66
78
  return typeof title === 'string' && title.length ? title : undefined;
67
79
  };
80
+ /** A positive whole number of characters, or `undefined` for anything else. */
81
+ const lengthOf = (raw) => typeof raw === 'number' && Number.isSafeInteger(raw) && raw > 0 ? raw : undefined;
82
+ /**
83
+ * A STRING field's limits. An ENUM is checked against its values instead, and every other type
84
+ * is not text, so neither gets one. Not declared on `MetadataDetail`, so read defensively.
85
+ */
86
+ const lengthsOf = (detail, validValues) => {
87
+ var _a;
88
+ if (genesisTypeName(typeOf(detail)) !== 'STRING' || (validValues === null || validValues === void 0 ? void 0 : validValues.length))
89
+ return {};
90
+ const { MAX_LENGTH, MIN_LENGTH } = detail;
91
+ const minLength = lengthOf(MIN_LENGTH);
92
+ return Object.assign({ maxLength: (_a = lengthOf(MAX_LENGTH)) !== null && _a !== void 0 ? _a : DEFAULT_STRING_MAX_LENGTH }, (minLength ? { minLength } : {}));
93
+ };
68
94
  /** A metadata request Connect never settles would hang the turn; see loadFilterFields. */
69
95
  const METADATA_TIMEOUT_MS = 20000;
70
96
  /** @internal */
@@ -84,19 +110,13 @@ export function eventFieldsFrom(metadata) {
84
110
  unreadableValues.push(detail.NAME);
85
111
  continue;
86
112
  }
87
- fields.push({
88
- name: detail.NAME,
89
- type: String(typeOf(detail)),
90
- jsonType: jsonTypeOf(detail),
113
+ fields.push(Object.assign({ name: detail.NAME, type: String(typeOf(detail)), jsonType: jsonTypeOf(detail),
91
114
  // NULLABLE is about the column; OPTIONAL is about the payload, and it is the one that
92
115
  // decides whether the model must supply a value.
93
- optional: detail.OPTIONAL === true,
94
- readOnly: detail.READ_ONLY === true,
116
+ optional: detail.OPTIONAL === true, readOnly: detail.READ_ONLY === true,
95
117
  // A live reply carries TITLE ("Counterparty Id"), though MetadataDetail does not declare
96
118
  // it; read defensively rather than widening a published platform type from here.
97
- title: titleOf(detail),
98
- validValues: allowed.values,
99
- });
119
+ title: titleOf(detail), validValues: allowed.values }, lengthsOf(detail, allowed.values)));
100
120
  }
101
121
  return { fields, untyped, unreadableValues };
102
122
  }
@@ -298,6 +298,28 @@ function valueFor(field, raw) {
298
298
  }
299
299
  }
300
300
  }
301
+ /**
302
+ * Why a text value the model sent does not fit its field, or `undefined` when it does.
303
+ *
304
+ * @remarks
305
+ * The two limits count differently, each the stricter way round. The most is counted in UTF-16
306
+ * units, as Java (and so H2) counts a VARCHAR, where an emoji is two: never fewer than the code
307
+ * points the JSON schema counts, so nothing the database would refuse gets through. The fewest is
308
+ * counted in code points, so nothing the schema accepts is refused. The row's own value is never
309
+ * checked, carried or echoed back: it is not a change, and the column holds it.
310
+ */
311
+ function lengthRefusal(field, value, rowValue) {
312
+ if (typeof value !== 'string' || !field.maxLength || value === rowValue)
313
+ return undefined;
314
+ if (value.length > field.maxLength) {
315
+ return `${field.name} holds at most ${field.maxLength} characters; this value has ${value.length}. Send a shorter one.`;
316
+ }
317
+ const count = [...value].length;
318
+ if (field.minLength && count < field.minLength) {
319
+ return `${field.name} holds at least ${field.minLength} characters; this value has ${count}. Send a longer one.`;
320
+ }
321
+ return undefined;
322
+ }
301
323
  /**
302
324
  * Builds one event payload from a row the model supplied.
303
325
  *
@@ -544,7 +566,7 @@ function withoutUncheckedValues(fields, sent, { op, preImage, unchecked }) {
544
566
  return { changes, refused };
545
567
  }
546
568
  export function buildEventPayload(fields, row, { op, preImage, unchecked }) {
547
- var _a;
569
+ var _a, _b;
548
570
  if (!row || typeof row !== 'object' || Array.isArray(row)) {
549
571
  return {
550
572
  status: 'rejected',
@@ -656,7 +678,7 @@ export function buildEventPayload(fields, row, { op, preImage, unchecked }) {
656
678
  }
657
679
  const converted = valueFor(field, raw);
658
680
  const { value } = converted;
659
- const problem = (_a = converted.problem) !== null && _a !== void 0 ? _a : timeOfDayRefusal(field, { raw, value, fromRow, rowValue, op });
681
+ const problem = (_b = (_a = converted.problem) !== null && _a !== void 0 ? _a : timeOfDayRefusal(field, { raw, value, fromRow, rowValue, op })) !== null && _b !== void 0 ? _b : lengthRefusal(field, value, rowValue);
660
682
  if (problem) {
661
683
  // Attribute it correctly. A value carried from the pre-image is the SERVER's own — most
662
684
  // often a LONG beyond 2^53 that the read stamped as text and a JSON integer cannot carry
@@ -172,9 +172,24 @@ function propertyFor(field) {
172
172
  default:
173
173
  return type === 'BIGDECIMAL' || type === 'DECIMAL'
174
174
  ? { type: 'string', description: 'A number written as text, so nothing is rounded.' }
175
- : { type: 'string' };
175
+ : withLength(field);
176
176
  }
177
177
  }
178
+ /**
179
+ * A text property with its limits, both as keywords and in words. Anthropic and Gemini accept
180
+ * `maxLength` but enforce neither, so the sentence is what the model reads; the payload builder
181
+ * is what holds it.
182
+ */
183
+ function withLength({ maxLength, minLength }) {
184
+ if (!maxLength)
185
+ return { type: 'string' };
186
+ const sentence = !minLength
187
+ ? `At most ${maxLength} characters.`
188
+ : minLength === maxLength
189
+ ? `Exactly ${maxLength} characters.`
190
+ : `${minLength} to ${maxLength} characters.`;
191
+ return Object.assign(Object.assign({ type: 'string', maxLength }, (minLength ? { minLength } : {})), { description: sentence });
192
+ }
178
193
  /** A property with the sentence for a checked reference after any description it has. */
179
194
  const withSentence = (property, sentence) => sentence
180
195
  ? Object.assign(Object.assign({}, property), { description: property.description ? `${property.description} ${sentence}` : sentence }) : property;
package/docs/genesis.md CHANGED
@@ -299,6 +299,15 @@ or the row's time to the minute when it holds seconds, is refused. When the row
299
299
  the field, the refusal adds "or leave it out to keep the row's value" (not for a row action's
300
300
  input, which cannot be left out), because resending the day alone would overwrite that time.
301
301
 
302
+ A `STRING` field's length is taken from its metadata's `MAX_LENGTH` and `MIN_LENGTH`. A field
303
+ with no `MAX_LENGTH` is assumed to hold 64 characters, the column a plain `STRING` gets in GSF
304
+ 8.15. The metadata does not advertise that size, and a longer value fails in the database rather
305
+ than at the schema. The tool tells the model each limit, and a value that breaks one is refused
306
+ before the review ("DESCRIPTION holds at most 64 characters; this value has 102. Send a shorter
307
+ one."). The most is counted as the database counts it, where an emoji is two characters; the
308
+ fewest counts an emoji as one. A value the row already holds, or the model echoing it back, is not
309
+ checked. An `ENUM` is checked against its values instead.
310
+
302
311
  A write tool reads a field's type from its event metadata's `GENESIS_TYPE`, and from `TYPE` only
303
312
  when there is no `GENESIS_TYPE`. `TYPE` names the Java class the value travels as, so a GSF 8.15
304
313
  app describes a `DATE` field as `TYPE: DATETIME` with `GENESIS_TYPE: DATE`. The read tools'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/ai-assistant",
3
3
  "description": "Genesis AI Assistant micro-frontend",
4
- "version": "15.50.1",
4
+ "version": "15.50.2",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/esm/index.js",
7
7
  "types": "dist/ai-assistant.d.ts",
@@ -92,31 +92,31 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@genesislcap/foundation-comms": "15.50.1",
96
- "@genesislcap/foundation-testing": "15.50.1",
97
- "@genesislcap/genx": "15.50.1",
98
- "@genesislcap/ts-builder": "15.50.1",
99
- "@genesislcap/uvu-playwright-builder": "15.50.1",
100
- "@genesislcap/vite-builder": "15.50.1",
101
- "@genesislcap/webpack-builder": "15.50.1",
95
+ "@genesislcap/foundation-comms": "15.50.2",
96
+ "@genesislcap/foundation-testing": "15.50.2",
97
+ "@genesislcap/genx": "15.50.2",
98
+ "@genesislcap/ts-builder": "15.50.2",
99
+ "@genesislcap/uvu-playwright-builder": "15.50.2",
100
+ "@genesislcap/vite-builder": "15.50.2",
101
+ "@genesislcap/webpack-builder": "15.50.2",
102
102
  "@types/dompurify": "^3.0.5",
103
103
  "@types/marked": "^5.0.2",
104
104
  "esbuild": "0.25.12"
105
105
  },
106
106
  "dependencies": {
107
- "@genesislcap/foundation-ai": "15.50.1",
108
- "@genesislcap/foundation-logger": "15.50.1",
109
- "@genesislcap/foundation-notifications": "15.50.1",
110
- "@genesislcap/foundation-redux": "15.50.1",
111
- "@genesislcap/foundation-ui": "15.50.1",
112
- "@genesislcap/foundation-utils": "15.50.1",
113
- "@genesislcap/rapid-design-system": "15.50.1",
114
- "@genesislcap/web-core": "15.50.1",
107
+ "@genesislcap/foundation-ai": "15.50.2",
108
+ "@genesislcap/foundation-logger": "15.50.2",
109
+ "@genesislcap/foundation-notifications": "15.50.2",
110
+ "@genesislcap/foundation-redux": "15.50.2",
111
+ "@genesislcap/foundation-ui": "15.50.2",
112
+ "@genesislcap/foundation-utils": "15.50.2",
113
+ "@genesislcap/rapid-design-system": "15.50.2",
114
+ "@genesislcap/web-core": "15.50.2",
115
115
  "dompurify": "^3.3.1",
116
116
  "marked": "^17.0.3"
117
117
  },
118
118
  "peerDependencies": {
119
- "@genesislcap/foundation-comms": "^15.50.1"
119
+ "@genesislcap/foundation-comms": "^15.50.2"
120
120
  },
121
121
  "peerDependenciesMeta": {
122
122
  "@genesislcap/foundation-comms": {