@futdevpro/fsm-dynamo 1.20.180 → 1.20.181

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.
@@ -0,0 +1,66 @@
1
+ import { DyFM_AiContentMark } from '../../_models/interfaces/ai-content-mark.interface';
2
+ /**
3
+ * ⚖️ BFR-MASTERPROMPTER-186 (the lawyer's letter of 2026-11-08, 2.5; the AI Act article 50 (2)) — the ONE source of
4
+ * the machine-readable "AI-generated" text mark, for the browser AND the server (no `Buffer`).
5
+ *
6
+ * @description Measured before (2026-11-09): the mark lived only in the Node helper (`DyNTS_AiContentMark_Util`,
7
+ * nts-dynamo 1.15.489) — an Angular client could not import it, the attribute names and the IPTC value existed only
8
+ * inside `markText`, and a data-export record had no shared field ⇒ the MP and the Adventor each kept a copy (an MP
9
+ * constant; the Adventor's `ADV_aiDigitalSourceType` and its `appAiGenerated` directive).
10
+ * - the rendered text: `attributesOf(mark)` — the same attributes as the HTML form of `markText`;
11
+ * - an API response / a stored record: `textMark(set)`;
12
+ * - a data-export record: `markRecord(record, mark)` — under the shared field `aiContent`.
13
+ * The image marking (XMP in the bytes) stays in nts-dynamo: it needs `Buffer`.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * // a client element: <div [attr.data-ai-generated]="…"> from DyFM_AiContentMark_Util.attributesOf(item.aiContent)
18
+ * const exported = DyFM_AiContentMark_Util.markRecord(run, DyFM_AiContentMark_Util.textMark({ generator: 'gpt-5' }));
19
+ * ```
20
+ */
21
+ export declare class DyFM_AiContentMark_Util {
22
+ /** The IPTC NewsCodes digital source type of content made by a trained algorithmic model. */
23
+ static readonly aiDigitalSourceType: string;
24
+ /** The HTML attribute that states "AI-generated" (its value is always `true`). */
25
+ static readonly aiGeneratedAttribute: string;
26
+ /** The HTML attribute that carries the IPTC digital source type. */
27
+ static readonly digitalSourceTypeAttribute: string;
28
+ /** The field of a data-export (or stored) record that carries its mark. */
29
+ static readonly recordField: 'aiContent';
30
+ /**
31
+ * The "AI-generated" mark of a text output, for an API response and a stored record.
32
+ *
33
+ * @param set.generator the generating system or model, when known
34
+ * @param set.generatedAt when it was generated (default: now)
35
+ */
36
+ static textMark(set?: {
37
+ generator?: string;
38
+ generatedAt?: Date;
39
+ }): DyFM_AiContentMark;
40
+ /**
41
+ * The HTML attributes of a rendered AI-generated text (the same as the HTML form of `markText`).
42
+ *
43
+ * @param mark the item's mark; without it the shared IPTC value
44
+ * @returns attribute name ⇒ value
45
+ */
46
+ static attributesOf(mark?: Pick<DyFM_AiContentMark, 'digitalSourceType'> | null): Record<string, string>;
47
+ /**
48
+ * The attributes of `attributesOf` as markup (`name="value"`, space-separated; the values escaped).
49
+ *
50
+ * @param mark the item's mark; without it the shared IPTC value
51
+ */
52
+ static attributeMarkup(mark?: Pick<DyFM_AiContentMark, 'digitalSourceType'> | null): string;
53
+ /**
54
+ * A data-export (or stored) record with its mark under the shared field (`aiContent`); the record itself is not
55
+ * changed.
56
+ *
57
+ * @param record the generated item
58
+ * @param mark its mark (`textMark`)
59
+ */
60
+ static markRecord<T extends object>(record: T, mark: DyFM_AiContentMark): T & {
61
+ aiContent: DyFM_AiContentMark;
62
+ };
63
+ /** Escapes a value for a double-quoted attribute. */
64
+ private static escapeAttribute;
65
+ }
66
+ //# sourceMappingURL=ai-content-mark.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-content-mark.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/ai-content-mark.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AAExF;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,uBAAuB;IAElC,6FAA6F;IAC7F,MAAM,CAAC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CACgC;IAE3E,kFAAkF;IAClF,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAuB;IAEnE,oEAAoE;IACpE,MAAM,CAAC,QAAQ,CAAC,0BAA0B,EAAE,MAAM,CAA8B;IAEhF,2EAA2E;IAC3E,MAAM,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAe;IAEvD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,GAAG,GAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,GAAG,kBAAkB;IAczF;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAQxG;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,GAAG,IAAI,GAAG,MAAM;IAO3F;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,kBAAkB,GAAG,CAAC,GAAG;QAAE,SAAS,EAAE,kBAAkB,CAAA;KAAE;IAK/G,qDAAqD;IACrD,OAAO,CAAC,MAAM,CAAC,eAAe;CAG/B"}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyFM_AiContentMark_Util = void 0;
4
+ /**
5
+ * ⚖️ BFR-MASTERPROMPTER-186 (the lawyer's letter of 2026-11-08, 2.5; the AI Act article 50 (2)) — the ONE source of
6
+ * the machine-readable "AI-generated" text mark, for the browser AND the server (no `Buffer`).
7
+ *
8
+ * @description Measured before (2026-11-09): the mark lived only in the Node helper (`DyNTS_AiContentMark_Util`,
9
+ * nts-dynamo 1.15.489) — an Angular client could not import it, the attribute names and the IPTC value existed only
10
+ * inside `markText`, and a data-export record had no shared field ⇒ the MP and the Adventor each kept a copy (an MP
11
+ * constant; the Adventor's `ADV_aiDigitalSourceType` and its `appAiGenerated` directive).
12
+ * - the rendered text: `attributesOf(mark)` — the same attributes as the HTML form of `markText`;
13
+ * - an API response / a stored record: `textMark(set)`;
14
+ * - a data-export record: `markRecord(record, mark)` — under the shared field `aiContent`.
15
+ * The image marking (XMP in the bytes) stays in nts-dynamo: it needs `Buffer`.
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // a client element: <div [attr.data-ai-generated]="…"> from DyFM_AiContentMark_Util.attributesOf(item.aiContent)
20
+ * const exported = DyFM_AiContentMark_Util.markRecord(run, DyFM_AiContentMark_Util.textMark({ generator: 'gpt-5' }));
21
+ * ```
22
+ */
23
+ class DyFM_AiContentMark_Util {
24
+ /** The IPTC NewsCodes digital source type of content made by a trained algorithmic model. */
25
+ static aiDigitalSourceType = 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia';
26
+ /** The HTML attribute that states "AI-generated" (its value is always `true`). */
27
+ static aiGeneratedAttribute = 'data-ai-generated';
28
+ /** The HTML attribute that carries the IPTC digital source type. */
29
+ static digitalSourceTypeAttribute = 'data-digital-source-type';
30
+ /** The field of a data-export (or stored) record that carries its mark. */
31
+ static recordField = 'aiContent';
32
+ /**
33
+ * The "AI-generated" mark of a text output, for an API response and a stored record.
34
+ *
35
+ * @param set.generator the generating system or model, when known
36
+ * @param set.generatedAt when it was generated (default: now)
37
+ */
38
+ static textMark(set = {}) {
39
+ const mark = {
40
+ aiGenerated: true,
41
+ digitalSourceType: DyFM_AiContentMark_Util.aiDigitalSourceType,
42
+ generatedAt: (set.generatedAt ?? new Date()).toISOString(),
43
+ };
44
+ if (set.generator) {
45
+ mark.generator = set.generator;
46
+ }
47
+ return mark;
48
+ }
49
+ /**
50
+ * The HTML attributes of a rendered AI-generated text (the same as the HTML form of `markText`).
51
+ *
52
+ * @param mark the item's mark; without it the shared IPTC value
53
+ * @returns attribute name ⇒ value
54
+ */
55
+ static attributesOf(mark) {
56
+ return {
57
+ [DyFM_AiContentMark_Util.aiGeneratedAttribute]: 'true',
58
+ [DyFM_AiContentMark_Util.digitalSourceTypeAttribute]: mark?.digitalSourceType || DyFM_AiContentMark_Util.aiDigitalSourceType,
59
+ };
60
+ }
61
+ /**
62
+ * The attributes of `attributesOf` as markup (`name="value"`, space-separated; the values escaped).
63
+ *
64
+ * @param mark the item's mark; without it the shared IPTC value
65
+ */
66
+ static attributeMarkup(mark) {
67
+ return Object.entries(DyFM_AiContentMark_Util.attributesOf(mark))
68
+ .map(([name, value]) => `${name}="${DyFM_AiContentMark_Util.escapeAttribute(value)}"`)
69
+ .join(' ');
70
+ }
71
+ /**
72
+ * A data-export (or stored) record with its mark under the shared field (`aiContent`); the record itself is not
73
+ * changed.
74
+ *
75
+ * @param record the generated item
76
+ * @param mark its mark (`textMark`)
77
+ */
78
+ static markRecord(record, mark) {
79
+ // the key is `recordField` (written out: a computed key would lose its name in the type)
80
+ return { ...record, aiContent: mark };
81
+ }
82
+ /** Escapes a value for a double-quoted attribute. */
83
+ static escapeAttribute(value) {
84
+ return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
85
+ }
86
+ }
87
+ exports.DyFM_AiContentMark_Util = DyFM_AiContentMark_Util;
88
+ //# sourceMappingURL=ai-content-mark.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-content-mark.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/ai-content-mark.util.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,uBAAuB;IAElC,6FAA6F;IAC7F,MAAM,CAAU,mBAAmB,GACjC,wEAAwE,CAAC;IAE3E,kFAAkF;IAClF,MAAM,CAAU,oBAAoB,GAAW,mBAAmB,CAAC;IAEnE,oEAAoE;IACpE,MAAM,CAAU,0BAA0B,GAAW,0BAA0B,CAAC;IAEhF,2EAA2E;IAC3E,MAAM,CAAU,WAAW,GAAgB,WAAW,CAAC;IAEvD;;;;;OAKG;IACH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I,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC1G,CAAC;;AA5EH,0DA6EC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ⚖️ The AI Act (EU 2024/1689) article 50 (2) — the machine-readable "AI-generated" mark of a generated output: the
3
+ * same object in an API response, a stored record and a data-export record (`DyFM_AiContentMark_Util`).
4
+ *
5
+ * @description BFR-MASTERPROMPTER-186 — it lives HERE (browser and Node): the server marks with it
6
+ * (`DyNTS_AiContentMark_Util.textMark`), and a client renders the same mark as HTML attributes.
7
+ */
8
+ export interface DyFM_AiContentMark {
9
+ /** Always `true`: the content was generated by an AI system. */
10
+ aiGenerated: boolean;
11
+ /** The IPTC digital source type of AI-generated content (`…/digitalsourcetype/trainedAlgorithmicMedia`). */
12
+ digitalSourceType: string;
13
+ /** The generating system or model, when known (e.g. `gpt-5`). */
14
+ generator?: string;
15
+ /** When it was generated (ISO). */
16
+ generatedAt: string;
17
+ }
18
+ //# sourceMappingURL=ai-content-mark.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-content-mark.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/ai-content-mark.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,WAAW,EAAE,OAAO,CAAC;IACrB,4GAA4G;IAC5G,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ai-content-mark.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-content-mark.interface.js","sourceRoot":"","sources":["../../../src/_models/interfaces/ai-content-mark.interface.ts"],"names":[],"mappings":""}
package/build/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export * from './_collections/utils/operation-guardrails.util';
27
27
  export * from './_collections/utils/operation-run.util';
28
28
  export * from './_collections/utils/operation-schema.util';
29
29
  export * from './_collections/utils/uuid.util';
30
+ export * from './_collections/utils/ai-content-mark.util';
30
31
  export * from './_collections/utils/math/box-bounds.util';
31
32
  export * from './_collections/utils/math/math.util';
32
33
  export * from './_collections/utils/math/random.util';
@@ -60,6 +61,7 @@ export * from './_models/control-models/operation-context.control-model';
60
61
  export * from './_models/control-models/operation-settings.control-model';
61
62
  export * from './_models/control-models/poll.control-model';
62
63
  export * from './_models/interfaces/poll-handle.interface';
64
+ export * from './_models/interfaces/ai-content-mark.interface';
63
65
  export * from './_models/control-models/range-value.control-model';
64
66
  export * from './_models/control-models/server-status.control-model';
65
67
  export * from './_models/control-models/service-endpoint-settings-base.control-model';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iDAAiD,CAAC;AAChE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gCAAgC,CAAC;AAC/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AAC9E,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0DAA0D,CAAC;AACzE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,oDAAoD,CAAC;AACnE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uEAAuE,CAAC;AACtF,cAAc,mEAAmE,CAAC;AAGlF,cAAc,iEAAiE,CAAC;AAChF,cAAc,0DAA0D,CAAC;AACzE,cAAc,wDAAwD,CAAC;AAGvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAG1D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,kDAAkD,CAAC;AACjE,cAAc,uDAAuD,CAAC;AACtE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,qDAAqD,CAAC;AACpE,cAAc,mDAAmD,CAAC;AAClE,cAAc,qDAAqD,CAAC;AACpE,cAAc,sDAAsD,CAAC;AACrE,cAAc,0DAA0D,CAAC;AACzE,cAAc,yDAAyD,CAAC;AACxE,cAAc,sDAAsD,CAAC;AACrE,cAAc,uDAAuD,CAAC;AACtE,cAAc,sCAAsC,CAAC;AACrD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AAGvD,cAAc,gEAAgE,CAAC;AAC/E,cAAc,4DAA4D,CAAC;AAG3E,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
package/build/index.js CHANGED
@@ -33,6 +33,7 @@ tslib_1.__exportStar(require("./_collections/utils/operation-guardrails.util"),
33
33
  tslib_1.__exportStar(require("./_collections/utils/operation-run.util"), exports);
34
34
  tslib_1.__exportStar(require("./_collections/utils/operation-schema.util"), exports);
35
35
  tslib_1.__exportStar(require("./_collections/utils/uuid.util"), exports);
36
+ tslib_1.__exportStar(require("./_collections/utils/ai-content-mark.util"), exports);
36
37
  // collections/utils/MATH
37
38
  tslib_1.__exportStar(require("./_collections/utils/math/box-bounds.util"), exports);
38
39
  tslib_1.__exportStar(require("./_collections/utils/math/math.util"), exports);
@@ -73,6 +74,7 @@ tslib_1.__exportStar(require("./_models/control-models/operation-context.control
73
74
  tslib_1.__exportStar(require("./_models/control-models/operation-settings.control-model"), exports);
74
75
  tslib_1.__exportStar(require("./_models/control-models/poll.control-model"), exports);
75
76
  tslib_1.__exportStar(require("./_models/interfaces/poll-handle.interface"), exports);
77
+ tslib_1.__exportStar(require("./_models/interfaces/ai-content-mark.interface"), exports);
76
78
  tslib_1.__exportStar(require("./_models/control-models/range-value.control-model"), exports);
77
79
  tslib_1.__exportStar(require("./_models/control-models/server-status.control-model"), exports);
78
80
  tslib_1.__exportStar(require("./_models/control-models/service-endpoint-settings-base.control-model"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,cAAc;AACd,wBAAwB;AACxB,oFAA0D;AAC1D,wFAA8D;AAC9D,yFAA+D;AAC/D,iFAAuD;AACvD,+EAAqD;AAErD,oBAAoB;AACpB,0EAAgD;AAChD,0EAAgD;AAChD,yEAA+C;AAC/C,0FAAgE;AAChE,sFAA4D;AAC5D,wEAA8C;AAC9C,+EAAqD;AACrD,gFAAsD;AACtD,kFAAwD;AACxD,2EAAiD;AACjD,gFAAsD;AACtD,0EAAgD;AAChD,2EAAiD;AACjD,gFAAsD;AACtD,sFAA4D;AAC5D,yEAA+C;AAC/C,yEAA+C;AAC/C,0FAAgE;AAChE,8EAAoD;AACpD,oFAA0D;AAC1D,yFAA+D;AAC/D,kFAAwD;AACxD,qFAA2D;AAC3D,yEAA+C;AAE/C,yBAA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AACrB,kFAAwD;AACxD,oFAA0D;AAE1D,oBAAoB;AACpB,oFAA0D;AAC1D,wFAA8D;AAC9D,2FAAiE;AACjE,gGAAsE;AACtE,yFAA+D;AAC/D,8FAAoE;AACpE,4FAAkE;AAClE,8FAAoE;AACpE,+FAAqE;AACrE,mGAAyE;AACzE,kGAAwE;AACxE,+FAAqE;AACrE,gGAAsE;AACtE,+EAAqD;AACrD,uFAA6D;AAC7D,wFAA8D;AAC9D,sFAA4D;AAC5D,uFAA6D;AAC7D,iGAAuE;AACvE,iFAAuD;AAEvD,gCAAgC;AAChC,yGAA+E;AAC/E,qGAA2E;AAE3E,eAAe;AACf,yEAA+C;AAC/C,uEAA6C;AAC7C,yEAA+C;AAC/C,uEAA6C"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * ⚖️ BFR-MASTERPROMPTER-186 (the lawyer's letter of 2026-11-08, 2.5; the AI Act article 50 (2)) — the ONE source of
3
+ * the machine-readable "AI-generated" text mark, for the browser AND the server (no `Buffer`).
4
+ *
5
+ * @description Measured before (2026-11-09): the mark lived only in the Node helper (`DyNTS_AiContentMark_Util`,
6
+ * nts-dynamo 1.15.489) — an Angular client could not import it, the attribute names and the IPTC value existed only
7
+ * inside `markText`, and a data-export record had no shared field ⇒ the MP and the Adventor each kept a copy (an MP
8
+ * constant; the Adventor's `ADV_aiDigitalSourceType` and its `appAiGenerated` directive).
9
+ * - the rendered text: `attributesOf(mark)` — the same attributes as the HTML form of `markText`;
10
+ * - an API response / a stored record: `textMark(set)`;
11
+ * - a data-export record: `markRecord(record, mark)` — under the shared field `aiContent`.
12
+ * The image marking (XMP in the bytes) stays in nts-dynamo: it needs `Buffer`.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // a client element: <div [attr.data-ai-generated]="…"> from DyFM_AiContentMark_Util.attributesOf(item.aiContent)
17
+ * const exported = DyFM_AiContentMark_Util.markRecord(run, DyFM_AiContentMark_Util.textMark({ generator: 'gpt-5' }));
18
+ * ```
19
+ */
20
+ export class DyFM_AiContentMark_Util {
21
+ /** The IPTC NewsCodes digital source type of content made by a trained algorithmic model. */
22
+ static aiDigitalSourceType = 'http://cv.iptc.org/newscodes/digitalsourcetype/trainedAlgorithmicMedia';
23
+ /** The HTML attribute that states "AI-generated" (its value is always `true`). */
24
+ static aiGeneratedAttribute = 'data-ai-generated';
25
+ /** The HTML attribute that carries the IPTC digital source type. */
26
+ static digitalSourceTypeAttribute = 'data-digital-source-type';
27
+ /** The field of a data-export (or stored) record that carries its mark. */
28
+ static recordField = 'aiContent';
29
+ /**
30
+ * The "AI-generated" mark of a text output, for an API response and a stored record.
31
+ *
32
+ * @param set.generator the generating system or model, when known
33
+ * @param set.generatedAt when it was generated (default: now)
34
+ */
35
+ static textMark(set = {}) {
36
+ const mark = {
37
+ aiGenerated: true,
38
+ digitalSourceType: DyFM_AiContentMark_Util.aiDigitalSourceType,
39
+ generatedAt: (set.generatedAt ?? new Date()).toISOString(),
40
+ };
41
+ if (set.generator) {
42
+ mark.generator = set.generator;
43
+ }
44
+ return mark;
45
+ }
46
+ /**
47
+ * The HTML attributes of a rendered AI-generated text (the same as the HTML form of `markText`).
48
+ *
49
+ * @param mark the item's mark; without it the shared IPTC value
50
+ * @returns attribute name ⇒ value
51
+ */
52
+ static attributesOf(mark) {
53
+ return {
54
+ [DyFM_AiContentMark_Util.aiGeneratedAttribute]: 'true',
55
+ [DyFM_AiContentMark_Util.digitalSourceTypeAttribute]: mark?.digitalSourceType || DyFM_AiContentMark_Util.aiDigitalSourceType,
56
+ };
57
+ }
58
+ /**
59
+ * The attributes of `attributesOf` as markup (`name="value"`, space-separated; the values escaped).
60
+ *
61
+ * @param mark the item's mark; without it the shared IPTC value
62
+ */
63
+ static attributeMarkup(mark) {
64
+ return Object.entries(DyFM_AiContentMark_Util.attributesOf(mark))
65
+ .map(([name, value]) => `${name}="${DyFM_AiContentMark_Util.escapeAttribute(value)}"`)
66
+ .join(' ');
67
+ }
68
+ /**
69
+ * A data-export (or stored) record with its mark under the shared field (`aiContent`); the record itself is not
70
+ * changed.
71
+ *
72
+ * @param record the generated item
73
+ * @param mark its mark (`textMark`)
74
+ */
75
+ static markRecord(record, mark) {
76
+ // the key is `recordField` (written out: a computed key would lose its name in the type)
77
+ return { ...record, aiContent: mark };
78
+ }
79
+ /** Escapes a value for a double-quoted attribute. */
80
+ static escapeAttribute(value) {
81
+ return value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
82
+ }
83
+ }
@@ -30,6 +30,7 @@ export * from './_collections/utils/operation-guardrails.util';
30
30
  export * from './_collections/utils/operation-run.util';
31
31
  export * from './_collections/utils/operation-schema.util';
32
32
  export * from './_collections/utils/uuid.util';
33
+ export * from './_collections/utils/ai-content-mark.util';
33
34
  // collections/utils/MATH
34
35
  export * from './_collections/utils/math/box-bounds.util';
35
36
  export * from './_collections/utils/math/math.util';
@@ -70,6 +71,7 @@ export * from './_models/control-models/operation-context.control-model';
70
71
  export * from './_models/control-models/operation-settings.control-model';
71
72
  export * from './_models/control-models/poll.control-model';
72
73
  export * from './_models/interfaces/poll-handle.interface';
74
+ export * from './_models/interfaces/ai-content-mark.interface';
73
75
  export * from './_models/control-models/range-value.control-model';
74
76
  export * from './_models/control-models/server-status.control-model';
75
77
  export * from './_models/control-models/service-endpoint-settings-base.control-model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/fsm-dynamo",
3
- "version": "1.20.180",
3
+ "version": "1.20.181",
4
4
  "description": "Full Stack Model Collection for Dynamic (NodeJS-Typescript) Framework called Dynamo, by Future Development Ltd.",
5
5
  "DyBu_settings": {
6
6
  "packageType": "full-stack-package",