@coasys/ad4m-connect 0.13.0-test-interpretation-1 → 0.13.0-test-interpretation-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.
package/dist/core.js CHANGED
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // ../package.json
42
- var version = "0.13.0-test-interpretation-1";
42
+ var version = "0.13.0-test-interpretation-2";
43
43
 
44
44
  // src/utils.ts
45
45
  function isEmbedded() {
@@ -764,6 +764,14 @@ var Literal = class {
764
764
  const numberString = body.substring(7);
765
765
  return parseFloat(numberString);
766
766
  }
767
+ if (body.startsWith("boolean:")) {
768
+ const boolString = decodeURIComponent(body.substring(8));
769
+ if (boolString === "true")
770
+ return true;
771
+ if (boolString === "false")
772
+ return false;
773
+ throw new Error(`Can't parse boolean literal: ${boolString}`);
774
+ }
767
775
  if (body.startsWith("json:")) {
768
776
  const json = body.substring(5);
769
777
  return JSON.parse(decodeURIComponent(json));
@@ -1090,6 +1098,10 @@ var SHACLShape = class {
1090
1098
  }
1091
1099
  if (prop.writable !== void 0) {
1092
1100
  turtle += ` ad4m:writable ${prop.writable} ;
1101
+ `;
1102
+ }
1103
+ if (prop.identity !== void 0) {
1104
+ turtle += ` ad4m:identity ${prop.identity} ;
1093
1105
  `;
1094
1106
  }
1095
1107
  turtle = turtle.slice(0, -2) + "\n";
@@ -1606,7 +1618,7 @@ var SHACLShape = class {
1606
1618
  hasValue: p.has_value,
1607
1619
  local: p.local,
1608
1620
  writable: p.writable,
1609
- resolveLanguage: p.resolve_language,
1621
+ resolveLanguage: p.resolve_language ?? p.resolveLanguage,
1610
1622
  setter: p.setter,
1611
1623
  adder: p.adder,
1612
1624
  remover: p.remover,
@@ -1690,16 +1702,19 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
1690
1702
  name: propName,
1691
1703
  path: propMeta.through
1692
1704
  };
1693
- if (propMeta.resolveLanguage === "literal") {
1694
- propShape.datatype = "xsd://string";
1695
- } else if (propMeta.initial) {
1696
- const initialType = typeof obj[propName];
1697
- if (initialType === "number") {
1698
- propShape.datatype = "xsd://integer";
1699
- } else if (initialType === "boolean") {
1700
- propShape.datatype = "xsd://boolean";
1701
- } else if (initialType === "string") {
1702
- propShape.datatype = "xsd://string";
1705
+ if (propMeta.datatype) {
1706
+ propShape.datatype = propMeta.datatype;
1707
+ } else {
1708
+ const isLiteral = propMeta.resolveLanguage === void 0 || propMeta.resolveLanguage === "literal";
1709
+ if ((propMeta.initial !== void 0 || isLiteral) && !propMeta.getter) {
1710
+ const initialType = typeof obj[propName];
1711
+ if (initialType === "number") {
1712
+ propShape.datatype = "xsd://integer";
1713
+ } else if (initialType === "boolean") {
1714
+ propShape.datatype = "xsd://boolean";
1715
+ } else if (initialType === "string" || isLiteral) {
1716
+ propShape.datatype = "xsd://string";
1717
+ }
1703
1718
  }
1704
1719
  }
1705
1720
  if (propMeta.required) {
@@ -1773,7 +1788,12 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
1773
1788
  name: relName,
1774
1789
  path: synthesizedPath
1775
1790
  };
1776
- relShape.nodeKind = "IRI";
1791
+ if (relMeta.datatype) {
1792
+ relShape.datatype = relMeta.datatype;
1793
+ relShape.nodeKind = "Literal";
1794
+ } else {
1795
+ relShape.nodeKind = "IRI";
1796
+ }
1777
1797
  relShape.relationKind = relMeta.kind;
1778
1798
  if (relMeta.kind === "hasOne" || relMeta.kind === "belongsToOne") {
1779
1799
  relShape.maxCount = 1;
@@ -2034,33 +2054,6 @@ function Optional(opts) {
2034
2054
  readOnly: opts.readOnly ?? false
2035
2055
  });
2036
2056
  }
2037
- function Flag(opts) {
2038
- return function(target, key) {
2039
- if (!opts.through && !opts.value) {
2040
- throw new Error("SubjectFlag requires a 'through' and 'value' option");
2041
- }
2042
- if (!opts.through) {
2043
- throw new Error("SubjectFlag requires a 'through' option");
2044
- }
2045
- if (!opts.value) {
2046
- throw new Error("SubjectFlag requires a 'value' option");
2047
- }
2048
- const entry = {
2049
- through: opts.through,
2050
- required: true,
2051
- initial: opts.value,
2052
- flag: true,
2053
- readOnly: true,
2054
- writable: false
2055
- };
2056
- const ctor = target.constructor;
2057
- if (!propertyRegistry.has(ctor))
2058
- propertyRegistry.set(ctor, {});
2059
- propertyRegistry.get(ctor)[key] = entry;
2060
- target[key] = opts.value;
2061
- Object.defineProperty(target, key, { configurable: true, writable: true });
2062
- };
2063
- }
2064
2057
  function Model$1(opts) {
2065
2058
  return function(target) {
2066
2059
  target.prototype.className = opts.name;
@@ -2080,7 +2073,6 @@ function Property(opts) {
2080
2073
  ...opts,
2081
2074
  required,
2082
2075
  readOnly: opts.readOnly ?? false,
2083
- resolveLanguage: opts.resolveLanguage ?? "literal",
2084
2076
  initial: opts.initial ?? (required ? "literal:string:uninitialized" : void 0)
2085
2077
  });
2086
2078
  }
@@ -2122,7 +2114,8 @@ function HasMany(first, second) {
2122
2114
  local: opts.local,
2123
2115
  ...opts.getter && { getter: opts.getter },
2124
2116
  ...opts.filter !== void 0 && { filter: opts.filter },
2125
- ...opts.where && { where: opts.where }
2117
+ ...opts.where && { where: opts.where },
2118
+ ...opts.datatype && { datatype: opts.datatype }
2126
2119
  };
2127
2120
  const relKey = key;
2128
2121
  if (opts.through) {
@@ -2664,6 +2657,9 @@ var PerspectiveProxy = class {
2664
2657
  async addAutoProcessorEventListener(cb) {
2665
2658
  return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorEventListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
2666
2659
  }
2660
+ async addAutoProcessorNeighbourhoodStateListener(cb) {
2661
+ return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorNeighbourhoodStateListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
2662
+ }
2667
2663
  async infer(query) {
2668
2664
  return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryProlog(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
2669
2665
  }
@@ -3106,16 +3102,14 @@ var PerspectiveProxy = class {
3106
3102
  return null;
3107
3103
  }
3108
3104
  const flowUri = flowUriLinks[0].data.target;
3109
- const alternatePrefix = flowUri.endsWith("Flow") ? flowUri.slice(0, -4) + "." : flowUri + ".";
3110
- const sparqlQuery = `SELECT ?s ?p ?o WHERE {
3111
- ?s ?p ?o .
3112
- FILTER(?s = <${flowUri}> || STRSTARTS(STR(?s), "${alternatePrefix}"))
3113
- }`;
3114
- const sparqlResult = await this.querySparql(sparqlQuery);
3115
- const flowLinks = (sparqlResult || []).map((r) => ({
3116
- source: r.s,
3117
- predicate: r.p,
3118
- target: r.o
3105
+ const flowLevelLinks = await this.get(new LinkQuery({ source: flowUri }));
3106
+ const childUris = flowLevelLinks.filter((l) => l.data.predicate === "ad4m://hasState" || l.data.predicate === "ad4m://hasTransition").map((l) => l.data.target);
3107
+ const childResults = await Promise.all(childUris.map((uri) => this.get(new LinkQuery({ source: uri }))));
3108
+ const allExprs = [...flowLevelLinks, ...childResults.flat()];
3109
+ const flowLinks = allExprs.map((l) => ({
3110
+ source: l.data.source,
3111
+ predicate: l.data.predicate,
3112
+ target: l.data.target
3119
3113
  }));
3120
3114
  return SHACLFlow.fromLinks(flowLinks, flowUri);
3121
3115
  }
@@ -3793,9 +3787,9 @@ var PerspectiveClient = class {
3793
3787
  async linkMutations(uuid, mutations, status) {
3794
3788
  return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.linkMutations", { uuid, mutations, status });
3795
3789
  }
3796
- async runInterpretation(uuid, transcript, basePrefix, classes) {
3790
+ async runInterpretation(uuid, transcript, basePrefix, classes, existingScope, mintScope) {
3797
3791
  const RUN_INTERPRETATION_TIMEOUT_MS = 20 * 60 * 1e3;
3798
- return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.runInterpretation", { uuid, transcript, basePrefix, classes }, RUN_INTERPRETATION_TIMEOUT_MS);
3792
+ return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.runInterpretation", { uuid, transcript, basePrefix, classes, existingScope, mintScope }, RUN_INTERPRETATION_TIMEOUT_MS);
3799
3793
  }
3800
3794
  async addAutoProcessor(uuid, config) {
3801
3795
  return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addAutoProcessor", { uuid, ...config });
@@ -3815,7 +3809,20 @@ var PerspectiveClient = class {
3815
3809
  cb(data);
3816
3810
  }
3817
3811
  });
3818
- __classPrivateFieldGet$9(this, _PerspectiveClient_unsubscribers, "f").push(unsub);
3812
+ let existing = __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").get(uuid) || [];
3813
+ existing.push(unsub);
3814
+ __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").set(uuid, existing);
3815
+ await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
3816
+ }
3817
+ async addAutoProcessorNeighbourhoodStateListener(uuid, cb) {
3818
+ const unsub = __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").subscribe((data) => {
3819
+ if (data.type === "auto-processor-neighbourhood-state" && data.perspectiveUuid === uuid) {
3820
+ cb(data);
3821
+ }
3822
+ });
3823
+ let existing = __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").get(uuid) || [];
3824
+ existing.push(unsub);
3825
+ __classPrivateFieldGet$9(this, _PerspectiveClient_linkUnsubscribers, "f").set(uuid, existing);
3819
3826
  await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
3820
3827
  }
3821
3828
  async addLinkExpression(uuid, link, status = "shared", batchId) {
@@ -9346,10 +9353,6 @@ function isArrayType(schema) {
9346
9353
  function isObjectType(schema) {
9347
9354
  return isSchemaType(schema, "object");
9348
9355
  }
9349
- function isNumericType(schema) {
9350
- const normalized = normalizeSchemaType(schema.type);
9351
- return normalized === "number" || normalized === "integer";
9352
- }
9353
9356
  function determineNamespace(schema, options) {
9354
9357
  if (options.namespace) {
9355
9358
  return options.namespace;
@@ -9471,10 +9474,6 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
9471
9474
  DynamicModelClass.prototype[setterName] = function() {
9472
9475
  };
9473
9476
  } else {
9474
- let resolveLanguage = getPropertyOption(propertyName, propertySchema, options, "resolveLanguage");
9475
- if (!resolveLanguage && options.resolveLanguage) {
9476
- resolveLanguage = options.resolveLanguage;
9477
- }
9478
9477
  const local = getPropertyOption(propertyName, propertySchema, options, "local");
9479
9478
  let readOnly = getPropertyOption(propertyName, propertySchema, options, "readOnly");
9480
9479
  if (readOnly === void 0) {
@@ -9483,16 +9482,10 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
9483
9482
  }
9484
9483
  const writable = !readOnly;
9485
9484
  let initial = getPropertyOption(propertyName, propertySchema, options, "initial");
9486
- if (isObjectType(propertySchema) && !resolveLanguage) {
9487
- resolveLanguage = "literal";
9485
+ const resolveLanguage = getPropertyOption(propertyName, propertySchema, options, "resolveLanguage");
9486
+ if (isObjectType(propertySchema)) {
9488
9487
  console.warn(`Property "${propertyName}" is an object type. It will be stored as JSON. Consider flattening complex objects for better semantic querying.`);
9489
9488
  }
9490
- if ((resolveLanguage === void 0 || resolveLanguage === null) && isNumericType(propertySchema)) {
9491
- resolveLanguage = "literal";
9492
- }
9493
- if (resolveLanguage === void 0 || resolveLanguage === null) {
9494
- resolveLanguage = "literal";
9495
- }
9496
9489
  if (isRequired && !initial) {
9497
9490
  if (isObjectType(propertySchema)) {
9498
9491
  initial = "literal:json:{}";
@@ -9504,7 +9497,7 @@ function buildModelFromJSONSchema(BaseClass, schema, options) {
9504
9497
  through: predicate,
9505
9498
  required: isRequired,
9506
9499
  writable,
9507
- ...resolveLanguage && { resolveLanguage },
9500
+ ...resolveLanguage !== void 0 && { resolveLanguage },
9508
9501
  ...local !== void 0 && { local },
9509
9502
  ...initial && { initial }
9510
9503
  };
@@ -9567,13 +9560,43 @@ function hasJsOnlyWhereFilters(metadata, allRelationsMetadata, where) {
9567
9560
  }
9568
9561
  return false;
9569
9562
  }
9570
- function isLiteralStoredProperty(propMeta) {
9571
- if (propMeta.flag)
9563
+ function looksLikeUri(value) {
9564
+ if (!/^[a-zA-Z][a-zA-Z0-9+\-._]*:/.test(value))
9572
9565
  return false;
9573
- if (propMeta.resolveLanguage && propMeta.resolveLanguage !== "literal")
9566
+ if (/[\s<>{}"\u0000-\u001F\u007F-\u009F]/.test(value))
9574
9567
  return false;
9575
9568
  return true;
9576
9569
  }
9570
+ function valueToLiteralIri(value) {
9571
+ if (typeof value === "string") {
9572
+ if (looksLikeUri(value))
9573
+ return value;
9574
+ return Literal.from(value).toUrl();
9575
+ }
9576
+ if (typeof value === "number") {
9577
+ return Literal.from(value).toUrl();
9578
+ }
9579
+ if (typeof value === "boolean") {
9580
+ return Literal.from(value).toUrl();
9581
+ }
9582
+ if (value !== null && typeof value === "object") {
9583
+ return Literal.from(value).toUrl();
9584
+ }
9585
+ return Literal.from(String(value)).toUrl();
9586
+ }
9587
+ function effectiveLiteralStorage(meta) {
9588
+ const lang = meta.resolveLanguage;
9589
+ if (lang === void 0)
9590
+ return { kind: "deterministic" };
9591
+ if (lang === "literal")
9592
+ return { kind: "envelope" };
9593
+ return { kind: "custom", language: lang };
9594
+ }
9595
+ function isLiteralStoredProperty(propMeta) {
9596
+ if (propMeta.flag)
9597
+ return false;
9598
+ return effectiveLiteralStorage(propMeta).kind === "deterministic";
9599
+ }
9577
9600
  function escapeSPARQL(value) {
9578
9601
  return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t").replace(/\0/g, "").replace(/\f/g, "\\u000C");
9579
9602
  }
@@ -10309,7 +10332,7 @@ var Ad4mModel = class {
10309
10332
  predicate,
10310
10333
  required: isRequired,
10311
10334
  readOnly: propertySchema["x-ad4m"]?.writable === false,
10312
- ...propertySchema["x-ad4m"]?.resolveLanguage && { resolveLanguage: propertySchema["x-ad4m"].resolveLanguage },
10335
+ ...propertySchema["x-ad4m"]?.resolveLanguage !== void 0 && { resolveLanguage: propertySchema["x-ad4m"].resolveLanguage },
10313
10336
  ...propertySchema["x-ad4m"]?.initial && { initial: propertySchema["x-ad4m"].initial },
10314
10337
  ...propertySchema["x-ad4m"]?.local !== void 0 && { local: propertySchema["x-ad4m"].local }
10315
10338
  };
@@ -10325,7 +10348,7 @@ var Ad4mModel = class {
10325
10348
  }
10326
10349
  constructor(perspective, baseExpression) {
10327
10350
  this._snapshot = null;
10328
- this._baseExpression = baseExpression ? baseExpression : Literal.from(makeRandomId(24)).toUrl();
10351
+ this._baseExpression = baseExpression ? baseExpression : `ad4m://obj/${makeRandomId(24)}`;
10329
10352
  this._perspective = perspective;
10330
10353
  }
10331
10354
  get id() {
@@ -10615,12 +10638,16 @@ var Ad4mModel = class {
10615
10638
  return;
10616
10639
  }
10617
10640
  const actions = this.generatePropertySetterAction(key, metadata);
10618
- let resolveLanguage = metadata.resolveLanguage;
10619
10641
  if (value === void 0 || value === null || value === "") {
10620
10642
  return;
10621
10643
  }
10622
- if (resolveLanguage) {
10623
- value = await this._perspective.createExpression(value, resolveLanguage);
10644
+ const mode = effectiveLiteralStorage(metadata);
10645
+ if (mode.kind === "custom") {
10646
+ value = await this._perspective.createExpression(value, mode.language);
10647
+ } else if (mode.kind === "envelope") {
10648
+ value = await this._perspective.createExpression(value, "literal");
10649
+ } else {
10650
+ value = valueToLiteralIri(value);
10624
10651
  }
10625
10652
  await this._perspective.executeAction(actions, this._baseExpression, [{ name: "value", value }], batchId);
10626
10653
  }
@@ -10693,14 +10720,14 @@ var Ad4mModel = class {
10693
10720
  }
10694
10721
  const metadata = this.constructor.getModelMetadata();
10695
10722
  const hasConstructor = Object.values(metadata.properties).some((p) => p.required || p.flag || p.initial !== void 0);
10696
- const deferredResolveLanguageProps = [];
10723
+ const deferredExpressionProps = [];
10697
10724
  if (hasConstructor) {
10698
10725
  const initialValues = {};
10699
10726
  for (const [key, value] of Object.entries(this)) {
10700
10727
  if (value !== void 0 && value !== null && !(Array.isArray(value) && value.length > 0) && !value?.action) {
10701
10728
  const propMeta = metadata.properties[key];
10702
- if (propMeta?.resolveLanguage && propMeta.resolveLanguage !== "literal" && typeof value === "object") {
10703
- deferredResolveLanguageProps.push(key);
10729
+ if (propMeta && effectiveLiteralStorage(propMeta).kind !== "deterministic") {
10730
+ deferredExpressionProps.push(key);
10704
10731
  continue;
10705
10732
  }
10706
10733
  initialValues[key] = value;
@@ -10710,7 +10737,7 @@ var Ad4mModel = class {
10710
10737
  await this.perspective.createSubject(className, this._baseExpression, initialValues, batchId);
10711
10738
  }
10712
10739
  await this.innerUpdate(!hasConstructor, batchId);
10713
- for (const key of deferredResolveLanguageProps) {
10740
+ for (const key of deferredExpressionProps) {
10714
10741
  const value = this[key];
10715
10742
  if (value !== void 0 && value !== null) {
10716
10743
  await this.setProperty(key, value, batchId);
@@ -11126,7 +11153,6 @@ var __metadata = function(k, v) {
11126
11153
  var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
11127
11154
  constructor() {
11128
11155
  super(...arguments);
11129
- this.type = "ad4m://AutoProcessor";
11130
11156
  this.processorId = "";
11131
11157
  this.sourceScopeQuery = "";
11132
11158
  this.interpretationClasses = [];
@@ -11135,10 +11161,6 @@ var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
11135
11161
  this.claimTtlMs = "60000";
11136
11162
  }
11137
11163
  };
11138
- __decorate([
11139
- Flag({ through: "rdf://type", value: "ad4m://AutoProcessor" }),
11140
- __metadata("design:type", String)
11141
- ], AutoProcessorConfig.prototype, "type", void 0);
11142
11164
  __decorate([
11143
11165
  Property({ through: "ad4m://processor_id", required: true, identity: true }),
11144
11166
  __metadata("design:type", String)
@@ -11148,11 +11170,11 @@ __decorate([
11148
11170
  __metadata("design:type", String)
11149
11171
  ], AutoProcessorConfig.prototype, "sourceScopeQuery", void 0);
11150
11172
  __decorate([
11151
- Optional({ through: "ad4m://base_prefix", resolveLanguage: "literal" }),
11173
+ Optional({ through: "ad4m://base_prefix" }),
11152
11174
  __metadata("design:type", String)
11153
11175
  ], AutoProcessorConfig.prototype, "basePrefix", void 0);
11154
11176
  __decorate([
11155
- HasMany({ through: "ad4m://interpretation_class" }),
11177
+ HasMany({ through: "ad4m://interpretation_class", datatype: "xsd:string" }),
11156
11178
  __metadata("design:type", Array)
11157
11179
  ], AutoProcessorConfig.prototype, "interpretationClasses", void 0);
11158
11180
  __decorate([
@@ -11160,7 +11182,7 @@ __decorate([
11160
11182
  __metadata("design:type", String)
11161
11183
  ], AutoProcessorConfig.prototype, "debounceMs", void 0);
11162
11184
  __decorate([
11163
- Optional({ through: "ad4m://batch_min", resolveLanguage: "literal" }),
11185
+ Optional({ through: "ad4m://batch_min" }),
11164
11186
  __metadata("design:type", String)
11165
11187
  ], AutoProcessorConfig.prototype, "batchMin", void 0);
11166
11188
  __decorate([
@@ -11168,7 +11190,7 @@ __decorate([
11168
11190
  __metadata("design:type", String)
11169
11191
  ], AutoProcessorConfig.prototype, "batchMax", void 0);
11170
11192
  __decorate([
11171
- Optional({ through: "ad4m://max_wait_ms", resolveLanguage: "literal" }),
11193
+ Optional({ through: "ad4m://max_wait_ms" }),
11172
11194
  __metadata("design:type", String)
11173
11195
  ], AutoProcessorConfig.prototype, "maxWaitMs", void 0);
11174
11196
  __decorate([
@@ -11176,52 +11198,75 @@ __decorate([
11176
11198
  __metadata("design:type", String)
11177
11199
  ], AutoProcessorConfig.prototype, "claimTtlMs", void 0);
11178
11200
  __decorate([
11179
- Optional({ through: "ad4m://source_window_ms", resolveLanguage: "literal" }),
11201
+ Optional({ through: "ad4m://source_window_ms" }),
11180
11202
  __metadata("design:type", String)
11181
11203
  ], AutoProcessorConfig.prototype, "sourceWindowMs", void 0);
11182
11204
  __decorate([
11183
- Optional({ through: "ad4m://dedup_strategy", resolveLanguage: "literal" }),
11205
+ Optional({ through: "ad4m://dedup_strategy" }),
11184
11206
  __metadata("design:type", String)
11185
11207
  ], AutoProcessorConfig.prototype, "dedupStrategy", void 0);
11208
+ __decorate([
11209
+ Optional({ through: "ad4m://existing_scope" }),
11210
+ __metadata("design:type", String)
11211
+ ], AutoProcessorConfig.prototype, "existingScope", void 0);
11212
+ __decorate([
11213
+ Optional({ through: "ad4m://mint_scope" }),
11214
+ __metadata("design:type", String)
11215
+ ], AutoProcessorConfig.prototype, "mintScope", void 0);
11216
+ __decorate([
11217
+ Optional({ through: "ad4m://debug_mode", resolveLanguage: "literal" }),
11218
+ __metadata("design:type", String)
11219
+ ], AutoProcessorConfig.prototype, "debugMode", void 0);
11220
+ __decorate([
11221
+ Optional({ through: "ad4m://persist_debug", resolveLanguage: "literal" }),
11222
+ __metadata("design:type", String)
11223
+ ], AutoProcessorConfig.prototype, "persistDebug", void 0);
11224
+ __decorate([
11225
+ Optional({ through: "ad4m://emit_debug_events", resolveLanguage: "literal" }),
11226
+ __metadata("design:type", String)
11227
+ ], AutoProcessorConfig.prototype, "emitDebugEvents", void 0);
11186
11228
  AutoProcessorConfig = __decorate([
11187
- Model$1({ name: "AutoProcessorConfig" })
11229
+ Model$1({ name: "AutoProcessor" })
11188
11230
  ], AutoProcessorConfig);
11189
11231
  var InterpretationRun = class InterpretationRun2 extends Ad4mModel {
11190
11232
  constructor() {
11191
11233
  super(...arguments);
11192
- this.type = "ad4m://interpretation-run";
11193
11234
  this.runId = "";
11194
11235
  this.sources = [];
11195
11236
  }
11196
11237
  };
11197
- __decorate([
11198
- Flag({ through: "ad4m://type", value: "ad4m://interpretation-run" }),
11199
- __metadata("design:type", String)
11200
- ], InterpretationRun.prototype, "type", void 0);
11201
11238
  __decorate([
11202
11239
  Property({ through: "ad4m://interp/run_id", required: true, identity: true }),
11203
11240
  __metadata("design:type", String)
11204
11241
  ], InterpretationRun.prototype, "runId", void 0);
11205
11242
  __decorate([
11206
- Optional({ through: "ad4m://interp/model", resolveLanguage: "literal" }),
11243
+ Optional({ through: "ad4m://interp/model" }),
11207
11244
  __metadata("design:type", String)
11208
11245
  ], InterpretationRun.prototype, "model", void 0);
11209
11246
  __decorate([
11210
- Optional({ through: "ad4m://interp/prompt_version", resolveLanguage: "literal" }),
11247
+ Optional({ through: "ad4m://interp/prompt_version" }),
11211
11248
  __metadata("design:type", String)
11212
11249
  ], InterpretationRun.prototype, "promptVersion", void 0);
11213
11250
  __decorate([
11214
- Optional({ through: "ad4m://interp/ran_at", resolveLanguage: "literal" }),
11251
+ Optional({ through: "ad4m://interp/ran_at" }),
11215
11252
  __metadata("design:type", String)
11216
11253
  ], InterpretationRun.prototype, "ranAt", void 0);
11217
11254
  __decorate([
11218
- Optional({ through: "ad4m://interp/processor", resolveLanguage: "literal" }),
11255
+ Optional({ through: "ad4m://interp/processor" }),
11219
11256
  __metadata("design:type", String)
11220
11257
  ], InterpretationRun.prototype, "processor", void 0);
11221
11258
  __decorate([
11222
- HasMany({ through: "ad4m://interp/sources" }),
11259
+ HasMany({ through: "ad4m://interp/sources", datatype: "xsd:string" }),
11223
11260
  __metadata("design:type", Array)
11224
11261
  ], InterpretationRun.prototype, "sources", void 0);
11262
+ __decorate([
11263
+ Optional({ through: "ad4m://interp/debug_prompt", resolveLanguage: "literal" }),
11264
+ __metadata("design:type", String)
11265
+ ], InterpretationRun.prototype, "debugPrompt", void 0);
11266
+ __decorate([
11267
+ Optional({ through: "ad4m://interp/debug_response", resolveLanguage: "literal" }),
11268
+ __metadata("design:type", String)
11269
+ ], InterpretationRun.prototype, "debugResponse", void 0);
11225
11270
  InterpretationRun = __decorate([
11226
11271
  Model$1({ name: "InterpretationRun" })
11227
11272
  ], InterpretationRun);
@@ -11232,11 +11277,11 @@ var InterpretationOverlay = class InterpretationOverlay2 extends Ad4mModel {
11232
11277
  }
11233
11278
  };
11234
11279
  __decorate([
11235
- Property({ through: "ad4m://interp/kind", required: true, resolveLanguage: "literal" }),
11280
+ Property({ through: "ad4m://interp/kind", required: true }),
11236
11281
  __metadata("design:type", String)
11237
11282
  ], InterpretationOverlay.prototype, "kind", void 0);
11238
11283
  __decorate([
11239
- Optional({ through: "ad4m://interp/run", resolveLanguage: "literal" }),
11284
+ Optional({ through: "ad4m://interp/run" }),
11240
11285
  __metadata("design:type", String)
11241
11286
  ], InterpretationOverlay.prototype, "run", void 0);
11242
11287
  InterpretationOverlay = __decorate([