@coasys/ad4m-connect 0.13.0-test-9 → 0.13.0-test-interpretation
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 +354 -9
- package/dist/core.js.map +3 -3
- package/dist/index.js +354 -9
- package/dist/index.js.map +3 -3
- package/dist/utils.js +1 -1
- package/dist/web.js +353 -8
- package/dist/web.js.map +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
// ../package.json
|
|
55
|
-
var version = "0.13.0-test-
|
|
55
|
+
var version = "0.13.0-test-interpretation";
|
|
56
56
|
|
|
57
57
|
// src/utils.ts
|
|
58
58
|
function isEmbedded() {
|
|
@@ -423,15 +423,16 @@ var ApiClient = class {
|
|
|
423
423
|
if (this._wsReady)
|
|
424
424
|
await this._wsReady;
|
|
425
425
|
}
|
|
426
|
-
async call(type, params) {
|
|
426
|
+
async call(type, params, timeoutMs) {
|
|
427
427
|
await this._ready();
|
|
428
428
|
const id = nextId();
|
|
429
429
|
const message = { id, type, params: params || {} };
|
|
430
|
+
const effectiveTimeout = timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
430
431
|
return new Promise((resolve, reject) => {
|
|
431
432
|
const timer = setTimeout(() => {
|
|
432
433
|
this._pendingCalls.delete(id);
|
|
433
|
-
reject(new RpcError(408, `RPC call '${type}' timed out after ${
|
|
434
|
-
},
|
|
434
|
+
reject(new RpcError(408, `RPC call '${type}' timed out after ${effectiveTimeout}ms`));
|
|
435
|
+
}, effectiveTimeout);
|
|
435
436
|
this._pendingCalls.set(id, {
|
|
436
437
|
resolve,
|
|
437
438
|
reject,
|
|
@@ -1154,6 +1155,13 @@ var SHACLShape = class {
|
|
|
1154
1155
|
target: `literal:string:${JSON.stringify(this.destructor_actions)}`
|
|
1155
1156
|
});
|
|
1156
1157
|
}
|
|
1158
|
+
if (this.interpretationHint) {
|
|
1159
|
+
links.push({
|
|
1160
|
+
source: this.nodeShapeUri,
|
|
1161
|
+
predicate: "ad4m://interpretation_hint",
|
|
1162
|
+
target: `literal:string:${this.interpretationHint}`
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1157
1165
|
for (let i4 = 0; i4 < this.properties.length; i4++) {
|
|
1158
1166
|
const prop = this.properties[i4];
|
|
1159
1167
|
let propShapeId;
|
|
@@ -1342,6 +1350,20 @@ var SHACLShape = class {
|
|
|
1342
1350
|
target: `literal:string:${JSON.stringify(prop.transform)}`
|
|
1343
1351
|
});
|
|
1344
1352
|
}
|
|
1353
|
+
if (prop.interpretationHint) {
|
|
1354
|
+
links.push({
|
|
1355
|
+
source: propShapeId,
|
|
1356
|
+
predicate: "ad4m://interpretation_hint",
|
|
1357
|
+
target: `literal:string:${prop.interpretationHint}`
|
|
1358
|
+
});
|
|
1359
|
+
}
|
|
1360
|
+
if (prop.identity) {
|
|
1361
|
+
links.push({
|
|
1362
|
+
source: propShapeId,
|
|
1363
|
+
predicate: "ad4m://identity",
|
|
1364
|
+
target: `literal:string:true`
|
|
1365
|
+
});
|
|
1366
|
+
}
|
|
1345
1367
|
}
|
|
1346
1368
|
return links;
|
|
1347
1369
|
}
|
|
@@ -1364,6 +1386,10 @@ var SHACLShape = class {
|
|
|
1364
1386
|
} catch (e7) {
|
|
1365
1387
|
}
|
|
1366
1388
|
}
|
|
1389
|
+
const classHintLink = links.find((l5) => l5.source === shapeUri && l5.predicate === "ad4m://interpretation_hint");
|
|
1390
|
+
if (classHintLink) {
|
|
1391
|
+
shape.interpretationHint = classHintLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
1392
|
+
}
|
|
1367
1393
|
const propShapeLinks = links.filter((l5) => l5.source === shapeUri && l5.predicate === "sh://property");
|
|
1368
1394
|
for (const propLink of propShapeLinks) {
|
|
1369
1395
|
const propShapeId = propLink.target;
|
|
@@ -1524,6 +1550,14 @@ var SHACLShape = class {
|
|
|
1524
1550
|
val = val.substring(8);
|
|
1525
1551
|
prop.filter = val === "true";
|
|
1526
1552
|
}
|
|
1553
|
+
const interpretationHintLink = links.find((l5) => l5.source === propShapeId && l5.predicate === "ad4m://interpretation_hint");
|
|
1554
|
+
if (interpretationHintLink) {
|
|
1555
|
+
prop.interpretationHint = interpretationHintLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
1556
|
+
}
|
|
1557
|
+
const identityLink = links.find((l5) => l5.source === propShapeId && l5.predicate === "ad4m://identity");
|
|
1558
|
+
if (identityLink) {
|
|
1559
|
+
prop.identity = identityLink.target.replace(/^literal:\/\/string:|^literal:string:/, "") === "true";
|
|
1560
|
+
}
|
|
1527
1561
|
const transformLink = links.find((l5) => l5.source === propShapeId && l5.predicate === "ad4m://transform");
|
|
1528
1562
|
if (transformLink) {
|
|
1529
1563
|
const jsonStr = transformLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
@@ -1546,6 +1580,7 @@ var SHACLShape = class {
|
|
|
1546
1580
|
node_shape_uri: this.nodeShapeUri,
|
|
1547
1581
|
target_class: this.targetClass,
|
|
1548
1582
|
parent_shapes: this.parentShapes.length > 0 ? this.parentShapes : void 0,
|
|
1583
|
+
interpretation_hint: this.interpretationHint,
|
|
1549
1584
|
properties: this.properties.map((p2) => ({
|
|
1550
1585
|
path: p2.path,
|
|
1551
1586
|
name: p2.name,
|
|
@@ -1572,7 +1607,8 @@ var SHACLShape = class {
|
|
|
1572
1607
|
where_filter: p2.whereFilter,
|
|
1573
1608
|
where_predicates: p2.wherePredicates,
|
|
1574
1609
|
filter: p2.filter,
|
|
1575
|
-
transform: p2.transform
|
|
1610
|
+
transform: p2.transform,
|
|
1611
|
+
interpretation_hint: p2.interpretationHint
|
|
1576
1612
|
})),
|
|
1577
1613
|
constructor_actions: this.constructor_actions,
|
|
1578
1614
|
destructor_actions: this.destructor_actions
|
|
@@ -1610,7 +1646,8 @@ var SHACLShape = class {
|
|
|
1610
1646
|
whereFilter: p2.where_filter,
|
|
1611
1647
|
wherePredicates: p2.where_predicates,
|
|
1612
1648
|
filter: p2.filter,
|
|
1613
|
-
transform: p2.transform
|
|
1649
|
+
transform: p2.transform,
|
|
1650
|
+
interpretationHint: p2.interpretation_hint
|
|
1614
1651
|
});
|
|
1615
1652
|
}
|
|
1616
1653
|
if (json.constructor_actions) {
|
|
@@ -1624,10 +1661,13 @@ var SHACLShape = class {
|
|
|
1624
1661
|
shape.addParentShape(ps);
|
|
1625
1662
|
}
|
|
1626
1663
|
}
|
|
1664
|
+
if (json.interpretation_hint) {
|
|
1665
|
+
shape.interpretationHint = json.interpretation_hint;
|
|
1666
|
+
}
|
|
1627
1667
|
return shape;
|
|
1628
1668
|
}
|
|
1629
1669
|
};
|
|
1630
|
-
function buildSHACL(subjectName, target, properties, allRelationsMeta, conformanceFilterFn, seedCache) {
|
|
1670
|
+
function buildSHACL(subjectName, target, properties, allRelationsMeta, conformanceFilterFn, seedCache, interpretationHint) {
|
|
1631
1671
|
const obj = target.prototype;
|
|
1632
1672
|
let namespace = "ad4m://";
|
|
1633
1673
|
if (Object.keys(properties).length > 0) {
|
|
@@ -1650,6 +1690,9 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1650
1690
|
const shapeUri = `${namespace}${subjectName}Shape`;
|
|
1651
1691
|
const targetClass = `${namespace}${subjectName}`;
|
|
1652
1692
|
const shape = new SHACLShape(shapeUri, targetClass);
|
|
1693
|
+
if (interpretationHint) {
|
|
1694
|
+
shape.interpretationHint = interpretationHint;
|
|
1695
|
+
}
|
|
1653
1696
|
if (seedCache) {
|
|
1654
1697
|
seedCache({ shape, name: subjectName });
|
|
1655
1698
|
}
|
|
@@ -1710,6 +1753,12 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1710
1753
|
if (propMeta.transform) {
|
|
1711
1754
|
propShape.transform = propMeta.transform;
|
|
1712
1755
|
}
|
|
1756
|
+
if (propMeta.interpretationHint) {
|
|
1757
|
+
propShape.interpretationHint = propMeta.interpretationHint;
|
|
1758
|
+
}
|
|
1759
|
+
if (propMeta.identity) {
|
|
1760
|
+
propShape.identity = true;
|
|
1761
|
+
}
|
|
1713
1762
|
if (propMeta.prologSetter) {
|
|
1714
1763
|
console.warn(`[SHACL Generation] Custom Prolog setter for property '${propName}' in class '${subjectName}' is not yet supported. The property will be created without setter actions. Consider using standard writable properties or provide explicit SHACL JSON.`);
|
|
1715
1764
|
} else if (propMeta.writable && propMeta.through) {
|
|
@@ -2001,6 +2050,61 @@ function buildConformanceFilter(relationPredicate, targetClass) {
|
|
|
2001
2050
|
return void 0;
|
|
2002
2051
|
}
|
|
2003
2052
|
}
|
|
2053
|
+
function applyPropertyMetadata(opts) {
|
|
2054
|
+
return function(target, key) {
|
|
2055
|
+
const writable = opts.readOnly ? false : opts.through ? true : false;
|
|
2056
|
+
if (opts.required && !opts.initial) {
|
|
2057
|
+
throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");
|
|
2058
|
+
}
|
|
2059
|
+
if (!opts.through && !opts.prologGetter && !opts.getter) {
|
|
2060
|
+
throw new Error("SubjectProperty requires either 'through' or 'prologGetter' or 'getter' option");
|
|
2061
|
+
}
|
|
2062
|
+
const ctor = target.constructor;
|
|
2063
|
+
if (!propertyRegistry.has(ctor))
|
|
2064
|
+
propertyRegistry.set(ctor, {});
|
|
2065
|
+
propertyRegistry.get(ctor)[key] = { ...opts, writable };
|
|
2066
|
+
if (writable) {
|
|
2067
|
+
const value = key;
|
|
2068
|
+
target[`set${capitalize(value)}`] = () => {
|
|
2069
|
+
};
|
|
2070
|
+
}
|
|
2071
|
+
Object.defineProperty(target, key, { configurable: true, writable: true });
|
|
2072
|
+
};
|
|
2073
|
+
}
|
|
2074
|
+
function Optional(opts) {
|
|
2075
|
+
return applyPropertyMetadata({
|
|
2076
|
+
...opts,
|
|
2077
|
+
required: opts.required ?? false,
|
|
2078
|
+
readOnly: opts.readOnly ?? false
|
|
2079
|
+
});
|
|
2080
|
+
}
|
|
2081
|
+
function Flag(opts) {
|
|
2082
|
+
return function(target, key) {
|
|
2083
|
+
if (!opts.through && !opts.value) {
|
|
2084
|
+
throw new Error("SubjectFlag requires a 'through' and 'value' option");
|
|
2085
|
+
}
|
|
2086
|
+
if (!opts.through) {
|
|
2087
|
+
throw new Error("SubjectFlag requires a 'through' option");
|
|
2088
|
+
}
|
|
2089
|
+
if (!opts.value) {
|
|
2090
|
+
throw new Error("SubjectFlag requires a 'value' option");
|
|
2091
|
+
}
|
|
2092
|
+
const entry = {
|
|
2093
|
+
through: opts.through,
|
|
2094
|
+
required: true,
|
|
2095
|
+
initial: opts.value,
|
|
2096
|
+
flag: true,
|
|
2097
|
+
readOnly: true,
|
|
2098
|
+
writable: false
|
|
2099
|
+
};
|
|
2100
|
+
const ctor = target.constructor;
|
|
2101
|
+
if (!propertyRegistry.has(ctor))
|
|
2102
|
+
propertyRegistry.set(ctor, {});
|
|
2103
|
+
propertyRegistry.get(ctor)[key] = entry;
|
|
2104
|
+
target[key] = opts.value;
|
|
2105
|
+
Object.defineProperty(target, key, { configurable: true, writable: true });
|
|
2106
|
+
};
|
|
2107
|
+
}
|
|
2004
2108
|
function Model$1(opts) {
|
|
2005
2109
|
return function(target) {
|
|
2006
2110
|
target.prototype.className = opts.name;
|
|
@@ -2009,11 +2113,76 @@ function Model$1(opts) {
|
|
|
2009
2113
|
return buildSDNA(opts.name, target.prototype, getPropertiesMetadata(target), getRelationsMetadata(target));
|
|
2010
2114
|
};
|
|
2011
2115
|
target.generateSHACL = function() {
|
|
2012
|
-
return getMemoizedSHACL(target, (seed) => buildSHACL(opts.name, target, getPropertiesMetadata(target), getRelationsMetadata(target), buildConformanceFilter, seed));
|
|
2116
|
+
return getMemoizedSHACL(target, (seed) => buildSHACL(opts.name, target, getPropertiesMetadata(target), getRelationsMetadata(target), buildConformanceFilter, seed, opts.interpretationHint));
|
|
2013
2117
|
};
|
|
2014
2118
|
Object.defineProperty(target, "type", { configurable: true });
|
|
2015
2119
|
};
|
|
2016
2120
|
}
|
|
2121
|
+
function Property(opts) {
|
|
2122
|
+
const required = opts.required ?? false;
|
|
2123
|
+
return applyPropertyMetadata({
|
|
2124
|
+
...opts,
|
|
2125
|
+
required,
|
|
2126
|
+
readOnly: opts.readOnly ?? false,
|
|
2127
|
+
resolveLanguage: opts.resolveLanguage ?? "literal",
|
|
2128
|
+
initial: opts.initial ?? (required ? "literal:string:uninitialized" : void 0)
|
|
2129
|
+
});
|
|
2130
|
+
}
|
|
2131
|
+
function resolveRelationArgs(first, second) {
|
|
2132
|
+
const opts = typeof first === "function" ? { ...second || {}, target: first } : first;
|
|
2133
|
+
if (opts.getter) {
|
|
2134
|
+
if (opts.through) {
|
|
2135
|
+
throw new Error("Relation decorator: `getter` and `through` are mutually exclusive. Use `getter` alone for custom read-only relations, or `through` (with optional `target`) for standard link-based relations.");
|
|
2136
|
+
}
|
|
2137
|
+
if (opts.target) {
|
|
2138
|
+
throw new Error("Relation decorator: `getter` and `target` are mutually exclusive. `target` auto-generates a conformance getter from the model shape; providing both is contradictory.");
|
|
2139
|
+
}
|
|
2140
|
+
if (opts.where) {
|
|
2141
|
+
throw new Error("Relation decorator: `where` and `getter` are mutually exclusive. Use `where` for DSL-based filtering, or `getter` for raw getter expression.");
|
|
2142
|
+
}
|
|
2143
|
+
return opts;
|
|
2144
|
+
}
|
|
2145
|
+
if (!opts.through) {
|
|
2146
|
+
opts.through = "ad4m://has_child";
|
|
2147
|
+
}
|
|
2148
|
+
if (opts.where) {
|
|
2149
|
+
if (opts.filter === false) {
|
|
2150
|
+
throw new Error("Relation decorator: `where` and `filter: false` are contradictory. `where` adds filtering constraints; `filter: false` disables filtering.");
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
return opts;
|
|
2154
|
+
}
|
|
2155
|
+
function HasMany(first, second) {
|
|
2156
|
+
const opts = resolveRelationArgs(first, second);
|
|
2157
|
+
return function(target, key) {
|
|
2158
|
+
const ctor = target.constructor;
|
|
2159
|
+
if (!relationRegistry.has(ctor))
|
|
2160
|
+
relationRegistry.set(ctor, {});
|
|
2161
|
+
const map = relationRegistry.get(ctor);
|
|
2162
|
+
map[key] = {
|
|
2163
|
+
predicate: opts.through,
|
|
2164
|
+
target: opts.target,
|
|
2165
|
+
kind: "hasMany",
|
|
2166
|
+
local: opts.local,
|
|
2167
|
+
...opts.getter && { getter: opts.getter },
|
|
2168
|
+
...opts.filter !== void 0 && { filter: opts.filter },
|
|
2169
|
+
...opts.where && { where: opts.where }
|
|
2170
|
+
};
|
|
2171
|
+
const relKey = key;
|
|
2172
|
+
if (opts.through) {
|
|
2173
|
+
target[`add${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2174
|
+
return this.addRelationValue(relKey, arg, batchId);
|
|
2175
|
+
};
|
|
2176
|
+
target[`remove${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2177
|
+
return this.removeRelationValue(relKey, arg, batchId);
|
|
2178
|
+
};
|
|
2179
|
+
target[`set${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2180
|
+
return this.setRelationValues(relKey, arg, batchId);
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
Object.defineProperty(target, relKey, { configurable: true, writable: true });
|
|
2184
|
+
};
|
|
2185
|
+
}
|
|
2017
2186
|
var cache = /* @__PURE__ */ new Map();
|
|
2018
2187
|
var DEFAULT_TTL_MS = 200;
|
|
2019
2188
|
function makeKey(perspectiveUUID, queryText) {
|
|
@@ -2521,6 +2690,24 @@ var PerspectiveProxy = class {
|
|
|
2521
2690
|
async get(query) {
|
|
2522
2691
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryLinks(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
|
|
2523
2692
|
}
|
|
2693
|
+
async runInterpretation(transcript, basePrefix, classes) {
|
|
2694
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").runInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, transcript, basePrefix, classes);
|
|
2695
|
+
}
|
|
2696
|
+
async addAutoProcessor(config) {
|
|
2697
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessor(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, config);
|
|
2698
|
+
}
|
|
2699
|
+
async interpretationOverlays() {
|
|
2700
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").interpretationOverlays(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid);
|
|
2701
|
+
}
|
|
2702
|
+
async acceptInterpretation(base, property) {
|
|
2703
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").acceptInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, base, property);
|
|
2704
|
+
}
|
|
2705
|
+
async rejectInterpretation(base, property) {
|
|
2706
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").rejectInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, base, property);
|
|
2707
|
+
}
|
|
2708
|
+
async addAutoProcessorEventListener(cb) {
|
|
2709
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorEventListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
|
|
2710
|
+
}
|
|
2524
2711
|
async infer(query) {
|
|
2525
2712
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryProlog(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
|
|
2526
2713
|
}
|
|
@@ -3650,6 +3837,31 @@ var PerspectiveClient = class {
|
|
|
3650
3837
|
async linkMutations(uuid, mutations, status) {
|
|
3651
3838
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.linkMutations", { uuid, mutations, status });
|
|
3652
3839
|
}
|
|
3840
|
+
async runInterpretation(uuid, transcript, basePrefix, classes) {
|
|
3841
|
+
const RUN_INTERPRETATION_TIMEOUT_MS = 20 * 60 * 1e3;
|
|
3842
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.runInterpretation", { uuid, transcript, basePrefix, classes }, RUN_INTERPRETATION_TIMEOUT_MS);
|
|
3843
|
+
}
|
|
3844
|
+
async addAutoProcessor(uuid, config) {
|
|
3845
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addAutoProcessor", { uuid, ...config });
|
|
3846
|
+
}
|
|
3847
|
+
async interpretationOverlays(uuid) {
|
|
3848
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.interpretationOverlays", { uuid });
|
|
3849
|
+
}
|
|
3850
|
+
async acceptInterpretation(uuid, base, property) {
|
|
3851
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.acceptInterpretation", { uuid, base, property });
|
|
3852
|
+
}
|
|
3853
|
+
async rejectInterpretation(uuid, base, property) {
|
|
3854
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.rejectInterpretation", { uuid, base, property });
|
|
3855
|
+
}
|
|
3856
|
+
async addAutoProcessorEventListener(uuid, cb) {
|
|
3857
|
+
const unsub = __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").subscribe((data) => {
|
|
3858
|
+
if (data.type === "auto-processor-event" && data.perspectiveUuid === uuid) {
|
|
3859
|
+
cb(data);
|
|
3860
|
+
}
|
|
3861
|
+
});
|
|
3862
|
+
__classPrivateFieldGet$9(this, _PerspectiveClient_unsubscribers, "f").push(unsub);
|
|
3863
|
+
await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
|
|
3864
|
+
}
|
|
3653
3865
|
async addLinkExpression(uuid, link, status = "shared", batchId) {
|
|
3654
3866
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addLinkExpression", { uuid, link, status, batchId });
|
|
3655
3867
|
}
|
|
@@ -9081,7 +9293,7 @@ var AIClient = class {
|
|
|
9081
9293
|
async embed(modelId, text) {
|
|
9082
9294
|
const aiEmbed = await __classPrivateFieldGet$2(this, _AIClient_apiClient, "f").call("ai.embed", { modelId, text });
|
|
9083
9295
|
const compressed = base64Js.toByteArray(aiEmbed);
|
|
9084
|
-
const decompressed = JSON.parse(pako.inflate(compressed
|
|
9296
|
+
const decompressed = JSON.parse(new TextDecoder().decode(pako.inflate(compressed)));
|
|
9085
9297
|
return decompressed;
|
|
9086
9298
|
}
|
|
9087
9299
|
async openTranscriptionStream(modelId, streamCallback, params) {
|
|
@@ -10941,6 +11153,139 @@ var PerspectiveState;
|
|
|
10941
11153
|
PerspectiveState2["LinkLanguageInstalledButNotSynced"] = "LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED";
|
|
10942
11154
|
PerspectiveState2["Synced"] = "SYNCED";
|
|
10943
11155
|
})(PerspectiveState || (PerspectiveState = {}));
|
|
11156
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
11157
|
+
var c3 = arguments.length, r4 = c3 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d3;
|
|
11158
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
11159
|
+
r4 = Reflect.decorate(decorators, target, key, desc);
|
|
11160
|
+
else
|
|
11161
|
+
for (var i4 = decorators.length - 1; i4 >= 0; i4--)
|
|
11162
|
+
if (d3 = decorators[i4])
|
|
11163
|
+
r4 = (c3 < 3 ? d3(r4) : c3 > 3 ? d3(target, key, r4) : d3(target, key)) || r4;
|
|
11164
|
+
return c3 > 3 && r4 && Object.defineProperty(target, key, r4), r4;
|
|
11165
|
+
};
|
|
11166
|
+
var __metadata = function(k2, v2) {
|
|
11167
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
11168
|
+
return Reflect.metadata(k2, v2);
|
|
11169
|
+
};
|
|
11170
|
+
var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
|
|
11171
|
+
constructor() {
|
|
11172
|
+
super(...arguments);
|
|
11173
|
+
this.type = "ad4m://AutoProcessor";
|
|
11174
|
+
this.processorId = "";
|
|
11175
|
+
this.sourceScopeQuery = "";
|
|
11176
|
+
this.interpretationClasses = [];
|
|
11177
|
+
this.debounceMs = "200";
|
|
11178
|
+
this.batchMax = "32";
|
|
11179
|
+
this.claimTtlMs = "60000";
|
|
11180
|
+
}
|
|
11181
|
+
};
|
|
11182
|
+
__decorate([
|
|
11183
|
+
Flag({ through: "rdf://type", value: "ad4m://AutoProcessor" }),
|
|
11184
|
+
__metadata("design:type", String)
|
|
11185
|
+
], AutoProcessorConfig.prototype, "type", void 0);
|
|
11186
|
+
__decorate([
|
|
11187
|
+
Property({ through: "ad4m://processor_id", required: true, identity: true }),
|
|
11188
|
+
__metadata("design:type", String)
|
|
11189
|
+
], AutoProcessorConfig.prototype, "processorId", void 0);
|
|
11190
|
+
__decorate([
|
|
11191
|
+
Property({ through: "ad4m://source_scope_query", required: true }),
|
|
11192
|
+
__metadata("design:type", String)
|
|
11193
|
+
], AutoProcessorConfig.prototype, "sourceScopeQuery", void 0);
|
|
11194
|
+
__decorate([
|
|
11195
|
+
Optional({ through: "ad4m://base_prefix", resolveLanguage: "literal" }),
|
|
11196
|
+
__metadata("design:type", String)
|
|
11197
|
+
], AutoProcessorConfig.prototype, "basePrefix", void 0);
|
|
11198
|
+
__decorate([
|
|
11199
|
+
HasMany({ through: "ad4m://interpretation_class" }),
|
|
11200
|
+
__metadata("design:type", Array)
|
|
11201
|
+
], AutoProcessorConfig.prototype, "interpretationClasses", void 0);
|
|
11202
|
+
__decorate([
|
|
11203
|
+
Property({ through: "ad4m://debounce_ms", required: true }),
|
|
11204
|
+
__metadata("design:type", String)
|
|
11205
|
+
], AutoProcessorConfig.prototype, "debounceMs", void 0);
|
|
11206
|
+
__decorate([
|
|
11207
|
+
Optional({ through: "ad4m://batch_min", resolveLanguage: "literal" }),
|
|
11208
|
+
__metadata("design:type", String)
|
|
11209
|
+
], AutoProcessorConfig.prototype, "batchMin", void 0);
|
|
11210
|
+
__decorate([
|
|
11211
|
+
Property({ through: "ad4m://batch_max", required: true }),
|
|
11212
|
+
__metadata("design:type", String)
|
|
11213
|
+
], AutoProcessorConfig.prototype, "batchMax", void 0);
|
|
11214
|
+
__decorate([
|
|
11215
|
+
Optional({ through: "ad4m://max_wait_ms", resolveLanguage: "literal" }),
|
|
11216
|
+
__metadata("design:type", String)
|
|
11217
|
+
], AutoProcessorConfig.prototype, "maxWaitMs", void 0);
|
|
11218
|
+
__decorate([
|
|
11219
|
+
Property({ through: "ad4m://claim_ttl_ms", required: true }),
|
|
11220
|
+
__metadata("design:type", String)
|
|
11221
|
+
], AutoProcessorConfig.prototype, "claimTtlMs", void 0);
|
|
11222
|
+
__decorate([
|
|
11223
|
+
Optional({ through: "ad4m://source_window_ms", resolveLanguage: "literal" }),
|
|
11224
|
+
__metadata("design:type", String)
|
|
11225
|
+
], AutoProcessorConfig.prototype, "sourceWindowMs", void 0);
|
|
11226
|
+
__decorate([
|
|
11227
|
+
Optional({ through: "ad4m://dedup_strategy", resolveLanguage: "literal" }),
|
|
11228
|
+
__metadata("design:type", String)
|
|
11229
|
+
], AutoProcessorConfig.prototype, "dedupStrategy", void 0);
|
|
11230
|
+
AutoProcessorConfig = __decorate([
|
|
11231
|
+
Model$1({ name: "AutoProcessorConfig" })
|
|
11232
|
+
], AutoProcessorConfig);
|
|
11233
|
+
var InterpretationRun = class InterpretationRun2 extends Ad4mModel {
|
|
11234
|
+
constructor() {
|
|
11235
|
+
super(...arguments);
|
|
11236
|
+
this.type = "ad4m://interpretation-run";
|
|
11237
|
+
this.runId = "";
|
|
11238
|
+
this.sources = [];
|
|
11239
|
+
}
|
|
11240
|
+
};
|
|
11241
|
+
__decorate([
|
|
11242
|
+
Flag({ through: "ad4m://type", value: "ad4m://interpretation-run" }),
|
|
11243
|
+
__metadata("design:type", String)
|
|
11244
|
+
], InterpretationRun.prototype, "type", void 0);
|
|
11245
|
+
__decorate([
|
|
11246
|
+
Property({ through: "ad4m://interp/run_id", required: true, identity: true }),
|
|
11247
|
+
__metadata("design:type", String)
|
|
11248
|
+
], InterpretationRun.prototype, "runId", void 0);
|
|
11249
|
+
__decorate([
|
|
11250
|
+
Optional({ through: "ad4m://interp/model", resolveLanguage: "literal" }),
|
|
11251
|
+
__metadata("design:type", String)
|
|
11252
|
+
], InterpretationRun.prototype, "model", void 0);
|
|
11253
|
+
__decorate([
|
|
11254
|
+
Optional({ through: "ad4m://interp/prompt_version", resolveLanguage: "literal" }),
|
|
11255
|
+
__metadata("design:type", String)
|
|
11256
|
+
], InterpretationRun.prototype, "promptVersion", void 0);
|
|
11257
|
+
__decorate([
|
|
11258
|
+
Optional({ through: "ad4m://interp/ran_at", resolveLanguage: "literal" }),
|
|
11259
|
+
__metadata("design:type", String)
|
|
11260
|
+
], InterpretationRun.prototype, "ranAt", void 0);
|
|
11261
|
+
__decorate([
|
|
11262
|
+
Optional({ through: "ad4m://interp/processor", resolveLanguage: "literal" }),
|
|
11263
|
+
__metadata("design:type", String)
|
|
11264
|
+
], InterpretationRun.prototype, "processor", void 0);
|
|
11265
|
+
__decorate([
|
|
11266
|
+
HasMany({ through: "ad4m://interp/sources" }),
|
|
11267
|
+
__metadata("design:type", Array)
|
|
11268
|
+
], InterpretationRun.prototype, "sources", void 0);
|
|
11269
|
+
InterpretationRun = __decorate([
|
|
11270
|
+
Model$1({ name: "InterpretationRun" })
|
|
11271
|
+
], InterpretationRun);
|
|
11272
|
+
var InterpretationOverlay = class InterpretationOverlay2 extends Ad4mModel {
|
|
11273
|
+
constructor() {
|
|
11274
|
+
super(...arguments);
|
|
11275
|
+
this.kind = "";
|
|
11276
|
+
}
|
|
11277
|
+
};
|
|
11278
|
+
__decorate([
|
|
11279
|
+
Property({ through: "ad4m://interp/kind", required: true, resolveLanguage: "literal" }),
|
|
11280
|
+
__metadata("design:type", String)
|
|
11281
|
+
], InterpretationOverlay.prototype, "kind", void 0);
|
|
11282
|
+
__decorate([
|
|
11283
|
+
Optional({ through: "ad4m://interp/run", resolveLanguage: "literal" }),
|
|
11284
|
+
__metadata("design:type", String)
|
|
11285
|
+
], InterpretationOverlay.prototype, "run", void 0);
|
|
11286
|
+
InterpretationOverlay = __decorate([
|
|
11287
|
+
Model$1({ name: "InterpretationOverlay" })
|
|
11288
|
+
], InterpretationOverlay);
|
|
10944
11289
|
var PerspectiveDiffExpression = class extends ExpressionGeneric() {
|
|
10945
11290
|
};
|
|
10946
11291
|
var _SmartLiteral_perspective;
|