@coasys/ad4m-connect 0.13.0-test-9 → 0.13.0-test-interpretation-1
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 +356 -9
- package/dist/core.js.map +3 -3
- package/dist/index.js +356 -9
- package/dist/index.js.map +3 -3
- package/dist/utils.js +1 -1
- package/dist/web.js +355 -8
- package/dist/web.js.map +3 -3
- package/package.json +2 -2
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-
|
|
42
|
+
var version = "0.13.0-test-interpretation-1";
|
|
43
43
|
|
|
44
44
|
// src/utils.ts
|
|
45
45
|
function isEmbedded() {
|
|
@@ -395,15 +395,16 @@ var ApiClient = class {
|
|
|
395
395
|
if (this._wsReady)
|
|
396
396
|
await this._wsReady;
|
|
397
397
|
}
|
|
398
|
-
async call(type, params) {
|
|
398
|
+
async call(type, params, timeoutMs) {
|
|
399
399
|
await this._ready();
|
|
400
400
|
const id = nextId();
|
|
401
401
|
const message = { id, type, params: params || {} };
|
|
402
|
+
const effectiveTimeout = timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
402
403
|
return new Promise((resolve, reject) => {
|
|
403
404
|
const timer = setTimeout(() => {
|
|
404
405
|
this._pendingCalls.delete(id);
|
|
405
|
-
reject(new RpcError(408, `RPC call '${type}' timed out after ${
|
|
406
|
-
},
|
|
406
|
+
reject(new RpcError(408, `RPC call '${type}' timed out after ${effectiveTimeout}ms`));
|
|
407
|
+
}, effectiveTimeout);
|
|
407
408
|
this._pendingCalls.set(id, {
|
|
408
409
|
resolve,
|
|
409
410
|
reject,
|
|
@@ -1126,6 +1127,13 @@ var SHACLShape = class {
|
|
|
1126
1127
|
target: `literal:string:${JSON.stringify(this.destructor_actions)}`
|
|
1127
1128
|
});
|
|
1128
1129
|
}
|
|
1130
|
+
if (this.interpretationHint) {
|
|
1131
|
+
links.push({
|
|
1132
|
+
source: this.nodeShapeUri,
|
|
1133
|
+
predicate: "ad4m://interpretation_hint",
|
|
1134
|
+
target: `literal:string:${this.interpretationHint}`
|
|
1135
|
+
});
|
|
1136
|
+
}
|
|
1129
1137
|
for (let i = 0; i < this.properties.length; i++) {
|
|
1130
1138
|
const prop = this.properties[i];
|
|
1131
1139
|
let propShapeId;
|
|
@@ -1314,6 +1322,20 @@ var SHACLShape = class {
|
|
|
1314
1322
|
target: `literal:string:${JSON.stringify(prop.transform)}`
|
|
1315
1323
|
});
|
|
1316
1324
|
}
|
|
1325
|
+
if (prop.interpretationHint) {
|
|
1326
|
+
links.push({
|
|
1327
|
+
source: propShapeId,
|
|
1328
|
+
predicate: "ad4m://interpretation_hint",
|
|
1329
|
+
target: `literal:string:${prop.interpretationHint}`
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
if (prop.identity) {
|
|
1333
|
+
links.push({
|
|
1334
|
+
source: propShapeId,
|
|
1335
|
+
predicate: "ad4m://identity",
|
|
1336
|
+
target: `literal:string:true`
|
|
1337
|
+
});
|
|
1338
|
+
}
|
|
1317
1339
|
}
|
|
1318
1340
|
return links;
|
|
1319
1341
|
}
|
|
@@ -1336,6 +1358,10 @@ var SHACLShape = class {
|
|
|
1336
1358
|
} catch (e) {
|
|
1337
1359
|
}
|
|
1338
1360
|
}
|
|
1361
|
+
const classHintLink = links.find((l) => l.source === shapeUri && l.predicate === "ad4m://interpretation_hint");
|
|
1362
|
+
if (classHintLink) {
|
|
1363
|
+
shape.interpretationHint = classHintLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
1364
|
+
}
|
|
1339
1365
|
const propShapeLinks = links.filter((l) => l.source === shapeUri && l.predicate === "sh://property");
|
|
1340
1366
|
for (const propLink of propShapeLinks) {
|
|
1341
1367
|
const propShapeId = propLink.target;
|
|
@@ -1496,6 +1522,14 @@ var SHACLShape = class {
|
|
|
1496
1522
|
val = val.substring(8);
|
|
1497
1523
|
prop.filter = val === "true";
|
|
1498
1524
|
}
|
|
1525
|
+
const interpretationHintLink = links.find((l) => l.source === propShapeId && l.predicate === "ad4m://interpretation_hint");
|
|
1526
|
+
if (interpretationHintLink) {
|
|
1527
|
+
prop.interpretationHint = interpretationHintLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
1528
|
+
}
|
|
1529
|
+
const identityLink = links.find((l) => l.source === propShapeId && l.predicate === "ad4m://identity");
|
|
1530
|
+
if (identityLink) {
|
|
1531
|
+
prop.identity = identityLink.target.replace(/^literal:\/\/string:|^literal:string:/, "") === "true";
|
|
1532
|
+
}
|
|
1499
1533
|
const transformLink = links.find((l) => l.source === propShapeId && l.predicate === "ad4m://transform");
|
|
1500
1534
|
if (transformLink) {
|
|
1501
1535
|
const jsonStr = transformLink.target.replace(/^literal:\/\/string:|^literal:string:/, "");
|
|
@@ -1518,6 +1552,7 @@ var SHACLShape = class {
|
|
|
1518
1552
|
node_shape_uri: this.nodeShapeUri,
|
|
1519
1553
|
target_class: this.targetClass,
|
|
1520
1554
|
parent_shapes: this.parentShapes.length > 0 ? this.parentShapes : void 0,
|
|
1555
|
+
interpretation_hint: this.interpretationHint,
|
|
1521
1556
|
properties: this.properties.map((p) => ({
|
|
1522
1557
|
path: p.path,
|
|
1523
1558
|
name: p.name,
|
|
@@ -1544,7 +1579,9 @@ var SHACLShape = class {
|
|
|
1544
1579
|
where_filter: p.whereFilter,
|
|
1545
1580
|
where_predicates: p.wherePredicates,
|
|
1546
1581
|
filter: p.filter,
|
|
1547
|
-
transform: p.transform
|
|
1582
|
+
transform: p.transform,
|
|
1583
|
+
interpretation_hint: p.interpretationHint,
|
|
1584
|
+
identity: p.identity
|
|
1548
1585
|
})),
|
|
1549
1586
|
constructor_actions: this.constructor_actions,
|
|
1550
1587
|
destructor_actions: this.destructor_actions
|
|
@@ -1582,7 +1619,9 @@ var SHACLShape = class {
|
|
|
1582
1619
|
whereFilter: p.where_filter,
|
|
1583
1620
|
wherePredicates: p.where_predicates,
|
|
1584
1621
|
filter: p.filter,
|
|
1585
|
-
transform: p.transform
|
|
1622
|
+
transform: p.transform,
|
|
1623
|
+
interpretationHint: p.interpretation_hint,
|
|
1624
|
+
identity: p.identity
|
|
1586
1625
|
});
|
|
1587
1626
|
}
|
|
1588
1627
|
if (json.constructor_actions) {
|
|
@@ -1596,10 +1635,13 @@ var SHACLShape = class {
|
|
|
1596
1635
|
shape.addParentShape(ps);
|
|
1597
1636
|
}
|
|
1598
1637
|
}
|
|
1638
|
+
if (json.interpretation_hint) {
|
|
1639
|
+
shape.interpretationHint = json.interpretation_hint;
|
|
1640
|
+
}
|
|
1599
1641
|
return shape;
|
|
1600
1642
|
}
|
|
1601
1643
|
};
|
|
1602
|
-
function buildSHACL(subjectName, target, properties, allRelationsMeta, conformanceFilterFn, seedCache) {
|
|
1644
|
+
function buildSHACL(subjectName, target, properties, allRelationsMeta, conformanceFilterFn, seedCache, interpretationHint) {
|
|
1603
1645
|
const obj = target.prototype;
|
|
1604
1646
|
let namespace = "ad4m://";
|
|
1605
1647
|
if (Object.keys(properties).length > 0) {
|
|
@@ -1622,6 +1664,9 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1622
1664
|
const shapeUri = `${namespace}${subjectName}Shape`;
|
|
1623
1665
|
const targetClass = `${namespace}${subjectName}`;
|
|
1624
1666
|
const shape = new SHACLShape(shapeUri, targetClass);
|
|
1667
|
+
if (interpretationHint) {
|
|
1668
|
+
shape.interpretationHint = interpretationHint;
|
|
1669
|
+
}
|
|
1625
1670
|
if (seedCache) {
|
|
1626
1671
|
seedCache({ shape, name: subjectName });
|
|
1627
1672
|
}
|
|
@@ -1682,6 +1727,12 @@ function buildSHACL(subjectName, target, properties, allRelationsMeta, conforman
|
|
|
1682
1727
|
if (propMeta.transform) {
|
|
1683
1728
|
propShape.transform = propMeta.transform;
|
|
1684
1729
|
}
|
|
1730
|
+
if (propMeta.interpretationHint) {
|
|
1731
|
+
propShape.interpretationHint = propMeta.interpretationHint;
|
|
1732
|
+
}
|
|
1733
|
+
if (propMeta.identity) {
|
|
1734
|
+
propShape.identity = true;
|
|
1735
|
+
}
|
|
1685
1736
|
if (propMeta.prologSetter) {
|
|
1686
1737
|
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.`);
|
|
1687
1738
|
} else if (propMeta.writable && propMeta.through) {
|
|
@@ -1955,6 +2006,61 @@ function buildConformanceFilter(relationPredicate, targetClass) {
|
|
|
1955
2006
|
return void 0;
|
|
1956
2007
|
}
|
|
1957
2008
|
}
|
|
2009
|
+
function applyPropertyMetadata(opts) {
|
|
2010
|
+
return function(target, key) {
|
|
2011
|
+
const writable = opts.readOnly ? false : opts.through ? true : false;
|
|
2012
|
+
if (opts.required && !opts.initial) {
|
|
2013
|
+
throw new Error("SubjectProperty requires an 'initial' option if 'required' is true");
|
|
2014
|
+
}
|
|
2015
|
+
if (!opts.through && !opts.prologGetter && !opts.getter) {
|
|
2016
|
+
throw new Error("SubjectProperty requires either 'through' or 'prologGetter' or 'getter' option");
|
|
2017
|
+
}
|
|
2018
|
+
const ctor = target.constructor;
|
|
2019
|
+
if (!propertyRegistry.has(ctor))
|
|
2020
|
+
propertyRegistry.set(ctor, {});
|
|
2021
|
+
propertyRegistry.get(ctor)[key] = { ...opts, writable };
|
|
2022
|
+
if (writable) {
|
|
2023
|
+
const value = key;
|
|
2024
|
+
target[`set${capitalize(value)}`] = () => {
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
Object.defineProperty(target, key, { configurable: true, writable: true });
|
|
2028
|
+
};
|
|
2029
|
+
}
|
|
2030
|
+
function Optional(opts) {
|
|
2031
|
+
return applyPropertyMetadata({
|
|
2032
|
+
...opts,
|
|
2033
|
+
required: opts.required ?? false,
|
|
2034
|
+
readOnly: opts.readOnly ?? false
|
|
2035
|
+
});
|
|
2036
|
+
}
|
|
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
|
+
}
|
|
1958
2064
|
function Model$1(opts) {
|
|
1959
2065
|
return function(target) {
|
|
1960
2066
|
target.prototype.className = opts.name;
|
|
@@ -1963,11 +2069,76 @@ function Model$1(opts) {
|
|
|
1963
2069
|
return buildSDNA(opts.name, target.prototype, getPropertiesMetadata(target), getRelationsMetadata(target));
|
|
1964
2070
|
};
|
|
1965
2071
|
target.generateSHACL = function() {
|
|
1966
|
-
return getMemoizedSHACL(target, (seed) => buildSHACL(opts.name, target, getPropertiesMetadata(target), getRelationsMetadata(target), buildConformanceFilter, seed));
|
|
2072
|
+
return getMemoizedSHACL(target, (seed) => buildSHACL(opts.name, target, getPropertiesMetadata(target), getRelationsMetadata(target), buildConformanceFilter, seed, opts.interpretationHint));
|
|
1967
2073
|
};
|
|
1968
2074
|
Object.defineProperty(target, "type", { configurable: true });
|
|
1969
2075
|
};
|
|
1970
2076
|
}
|
|
2077
|
+
function Property(opts) {
|
|
2078
|
+
const required = opts.required ?? false;
|
|
2079
|
+
return applyPropertyMetadata({
|
|
2080
|
+
...opts,
|
|
2081
|
+
required,
|
|
2082
|
+
readOnly: opts.readOnly ?? false,
|
|
2083
|
+
resolveLanguage: opts.resolveLanguage ?? "literal",
|
|
2084
|
+
initial: opts.initial ?? (required ? "literal:string:uninitialized" : void 0)
|
|
2085
|
+
});
|
|
2086
|
+
}
|
|
2087
|
+
function resolveRelationArgs(first, second) {
|
|
2088
|
+
const opts = typeof first === "function" ? { ...second || {}, target: first } : first;
|
|
2089
|
+
if (opts.getter) {
|
|
2090
|
+
if (opts.through) {
|
|
2091
|
+
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.");
|
|
2092
|
+
}
|
|
2093
|
+
if (opts.target) {
|
|
2094
|
+
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.");
|
|
2095
|
+
}
|
|
2096
|
+
if (opts.where) {
|
|
2097
|
+
throw new Error("Relation decorator: `where` and `getter` are mutually exclusive. Use `where` for DSL-based filtering, or `getter` for raw getter expression.");
|
|
2098
|
+
}
|
|
2099
|
+
return opts;
|
|
2100
|
+
}
|
|
2101
|
+
if (!opts.through) {
|
|
2102
|
+
opts.through = "ad4m://has_child";
|
|
2103
|
+
}
|
|
2104
|
+
if (opts.where) {
|
|
2105
|
+
if (opts.filter === false) {
|
|
2106
|
+
throw new Error("Relation decorator: `where` and `filter: false` are contradictory. `where` adds filtering constraints; `filter: false` disables filtering.");
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
return opts;
|
|
2110
|
+
}
|
|
2111
|
+
function HasMany(first, second) {
|
|
2112
|
+
const opts = resolveRelationArgs(first, second);
|
|
2113
|
+
return function(target, key) {
|
|
2114
|
+
const ctor = target.constructor;
|
|
2115
|
+
if (!relationRegistry.has(ctor))
|
|
2116
|
+
relationRegistry.set(ctor, {});
|
|
2117
|
+
const map = relationRegistry.get(ctor);
|
|
2118
|
+
map[key] = {
|
|
2119
|
+
predicate: opts.through,
|
|
2120
|
+
target: opts.target,
|
|
2121
|
+
kind: "hasMany",
|
|
2122
|
+
local: opts.local,
|
|
2123
|
+
...opts.getter && { getter: opts.getter },
|
|
2124
|
+
...opts.filter !== void 0 && { filter: opts.filter },
|
|
2125
|
+
...opts.where && { where: opts.where }
|
|
2126
|
+
};
|
|
2127
|
+
const relKey = key;
|
|
2128
|
+
if (opts.through) {
|
|
2129
|
+
target[`add${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2130
|
+
return this.addRelationValue(relKey, arg, batchId);
|
|
2131
|
+
};
|
|
2132
|
+
target[`remove${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2133
|
+
return this.removeRelationValue(relKey, arg, batchId);
|
|
2134
|
+
};
|
|
2135
|
+
target[`set${capitalize(relKey)}`] = async function(arg, batchId) {
|
|
2136
|
+
return this.setRelationValues(relKey, arg, batchId);
|
|
2137
|
+
};
|
|
2138
|
+
}
|
|
2139
|
+
Object.defineProperty(target, relKey, { configurable: true, writable: true });
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
1971
2142
|
var cache = /* @__PURE__ */ new Map();
|
|
1972
2143
|
var DEFAULT_TTL_MS = 200;
|
|
1973
2144
|
function makeKey(perspectiveUUID, queryText) {
|
|
@@ -2475,6 +2646,24 @@ var PerspectiveProxy = class {
|
|
|
2475
2646
|
async get(query) {
|
|
2476
2647
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryLinks(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
|
|
2477
2648
|
}
|
|
2649
|
+
async runInterpretation(transcript, basePrefix, classes) {
|
|
2650
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").runInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, transcript, basePrefix, classes);
|
|
2651
|
+
}
|
|
2652
|
+
async addAutoProcessor(config) {
|
|
2653
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessor(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, config);
|
|
2654
|
+
}
|
|
2655
|
+
async interpretationOverlays() {
|
|
2656
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").interpretationOverlays(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid);
|
|
2657
|
+
}
|
|
2658
|
+
async acceptInterpretation(base, property) {
|
|
2659
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").acceptInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, base, property);
|
|
2660
|
+
}
|
|
2661
|
+
async rejectInterpretation(base, property) {
|
|
2662
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").rejectInterpretation(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, base, property);
|
|
2663
|
+
}
|
|
2664
|
+
async addAutoProcessorEventListener(cb) {
|
|
2665
|
+
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").addAutoProcessorEventListener(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, cb);
|
|
2666
|
+
}
|
|
2478
2667
|
async infer(query) {
|
|
2479
2668
|
return await __classPrivateFieldGet$a(this, _PerspectiveProxy_client, "f").queryProlog(__classPrivateFieldGet$a(this, _PerspectiveProxy_handle, "f").uuid, query);
|
|
2480
2669
|
}
|
|
@@ -3604,6 +3793,31 @@ var PerspectiveClient = class {
|
|
|
3604
3793
|
async linkMutations(uuid, mutations, status) {
|
|
3605
3794
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.linkMutations", { uuid, mutations, status });
|
|
3606
3795
|
}
|
|
3796
|
+
async runInterpretation(uuid, transcript, basePrefix, classes) {
|
|
3797
|
+
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);
|
|
3799
|
+
}
|
|
3800
|
+
async addAutoProcessor(uuid, config) {
|
|
3801
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addAutoProcessor", { uuid, ...config });
|
|
3802
|
+
}
|
|
3803
|
+
async interpretationOverlays(uuid) {
|
|
3804
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.interpretationOverlays", { uuid });
|
|
3805
|
+
}
|
|
3806
|
+
async acceptInterpretation(uuid, base, property) {
|
|
3807
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.acceptInterpretation", { uuid, base, property });
|
|
3808
|
+
}
|
|
3809
|
+
async rejectInterpretation(uuid, base, property) {
|
|
3810
|
+
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.rejectInterpretation", { uuid, base, property });
|
|
3811
|
+
}
|
|
3812
|
+
async addAutoProcessorEventListener(uuid, cb) {
|
|
3813
|
+
const unsub = __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").subscribe((data) => {
|
|
3814
|
+
if (data.type === "auto-processor-event" && data.perspectiveUuid === uuid) {
|
|
3815
|
+
cb(data);
|
|
3816
|
+
}
|
|
3817
|
+
});
|
|
3818
|
+
__classPrivateFieldGet$9(this, _PerspectiveClient_unsubscribers, "f").push(unsub);
|
|
3819
|
+
await __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").waitForSubscription();
|
|
3820
|
+
}
|
|
3607
3821
|
async addLinkExpression(uuid, link, status = "shared", batchId) {
|
|
3608
3822
|
return __classPrivateFieldGet$9(this, _PerspectiveClient_apiClient, "f").call("perspective.addLinkExpression", { uuid, link, status, batchId });
|
|
3609
3823
|
}
|
|
@@ -9035,7 +9249,7 @@ var AIClient = class {
|
|
|
9035
9249
|
async embed(modelId, text) {
|
|
9036
9250
|
const aiEmbed = await __classPrivateFieldGet$2(this, _AIClient_apiClient, "f").call("ai.embed", { modelId, text });
|
|
9037
9251
|
const compressed = base64Js.toByteArray(aiEmbed);
|
|
9038
|
-
const decompressed = JSON.parse(pako.inflate(compressed
|
|
9252
|
+
const decompressed = JSON.parse(new TextDecoder().decode(pako.inflate(compressed)));
|
|
9039
9253
|
return decompressed;
|
|
9040
9254
|
}
|
|
9041
9255
|
async openTranscriptionStream(modelId, streamCallback, params) {
|
|
@@ -10895,6 +11109,139 @@ var PerspectiveState;
|
|
|
10895
11109
|
PerspectiveState2["LinkLanguageInstalledButNotSynced"] = "LINK_LANGUAGE_INSTALLED_BUT_NOT_SYNCED";
|
|
10896
11110
|
PerspectiveState2["Synced"] = "SYNCED";
|
|
10897
11111
|
})(PerspectiveState || (PerspectiveState = {}));
|
|
11112
|
+
var __decorate = function(decorators, target, key, desc) {
|
|
11113
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11114
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
11115
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
11116
|
+
else
|
|
11117
|
+
for (var i = decorators.length - 1; i >= 0; i--)
|
|
11118
|
+
if (d = decorators[i])
|
|
11119
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
11120
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11121
|
+
};
|
|
11122
|
+
var __metadata = function(k, v) {
|
|
11123
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
|
|
11124
|
+
return Reflect.metadata(k, v);
|
|
11125
|
+
};
|
|
11126
|
+
var AutoProcessorConfig = class AutoProcessorConfig2 extends Ad4mModel {
|
|
11127
|
+
constructor() {
|
|
11128
|
+
super(...arguments);
|
|
11129
|
+
this.type = "ad4m://AutoProcessor";
|
|
11130
|
+
this.processorId = "";
|
|
11131
|
+
this.sourceScopeQuery = "";
|
|
11132
|
+
this.interpretationClasses = [];
|
|
11133
|
+
this.debounceMs = "200";
|
|
11134
|
+
this.batchMax = "32";
|
|
11135
|
+
this.claimTtlMs = "60000";
|
|
11136
|
+
}
|
|
11137
|
+
};
|
|
11138
|
+
__decorate([
|
|
11139
|
+
Flag({ through: "rdf://type", value: "ad4m://AutoProcessor" }),
|
|
11140
|
+
__metadata("design:type", String)
|
|
11141
|
+
], AutoProcessorConfig.prototype, "type", void 0);
|
|
11142
|
+
__decorate([
|
|
11143
|
+
Property({ through: "ad4m://processor_id", required: true, identity: true }),
|
|
11144
|
+
__metadata("design:type", String)
|
|
11145
|
+
], AutoProcessorConfig.prototype, "processorId", void 0);
|
|
11146
|
+
__decorate([
|
|
11147
|
+
Property({ through: "ad4m://source_scope_query", required: true }),
|
|
11148
|
+
__metadata("design:type", String)
|
|
11149
|
+
], AutoProcessorConfig.prototype, "sourceScopeQuery", void 0);
|
|
11150
|
+
__decorate([
|
|
11151
|
+
Optional({ through: "ad4m://base_prefix", resolveLanguage: "literal" }),
|
|
11152
|
+
__metadata("design:type", String)
|
|
11153
|
+
], AutoProcessorConfig.prototype, "basePrefix", void 0);
|
|
11154
|
+
__decorate([
|
|
11155
|
+
HasMany({ through: "ad4m://interpretation_class" }),
|
|
11156
|
+
__metadata("design:type", Array)
|
|
11157
|
+
], AutoProcessorConfig.prototype, "interpretationClasses", void 0);
|
|
11158
|
+
__decorate([
|
|
11159
|
+
Property({ through: "ad4m://debounce_ms", required: true }),
|
|
11160
|
+
__metadata("design:type", String)
|
|
11161
|
+
], AutoProcessorConfig.prototype, "debounceMs", void 0);
|
|
11162
|
+
__decorate([
|
|
11163
|
+
Optional({ through: "ad4m://batch_min", resolveLanguage: "literal" }),
|
|
11164
|
+
__metadata("design:type", String)
|
|
11165
|
+
], AutoProcessorConfig.prototype, "batchMin", void 0);
|
|
11166
|
+
__decorate([
|
|
11167
|
+
Property({ through: "ad4m://batch_max", required: true }),
|
|
11168
|
+
__metadata("design:type", String)
|
|
11169
|
+
], AutoProcessorConfig.prototype, "batchMax", void 0);
|
|
11170
|
+
__decorate([
|
|
11171
|
+
Optional({ through: "ad4m://max_wait_ms", resolveLanguage: "literal" }),
|
|
11172
|
+
__metadata("design:type", String)
|
|
11173
|
+
], AutoProcessorConfig.prototype, "maxWaitMs", void 0);
|
|
11174
|
+
__decorate([
|
|
11175
|
+
Property({ through: "ad4m://claim_ttl_ms", required: true }),
|
|
11176
|
+
__metadata("design:type", String)
|
|
11177
|
+
], AutoProcessorConfig.prototype, "claimTtlMs", void 0);
|
|
11178
|
+
__decorate([
|
|
11179
|
+
Optional({ through: "ad4m://source_window_ms", resolveLanguage: "literal" }),
|
|
11180
|
+
__metadata("design:type", String)
|
|
11181
|
+
], AutoProcessorConfig.prototype, "sourceWindowMs", void 0);
|
|
11182
|
+
__decorate([
|
|
11183
|
+
Optional({ through: "ad4m://dedup_strategy", resolveLanguage: "literal" }),
|
|
11184
|
+
__metadata("design:type", String)
|
|
11185
|
+
], AutoProcessorConfig.prototype, "dedupStrategy", void 0);
|
|
11186
|
+
AutoProcessorConfig = __decorate([
|
|
11187
|
+
Model$1({ name: "AutoProcessorConfig" })
|
|
11188
|
+
], AutoProcessorConfig);
|
|
11189
|
+
var InterpretationRun = class InterpretationRun2 extends Ad4mModel {
|
|
11190
|
+
constructor() {
|
|
11191
|
+
super(...arguments);
|
|
11192
|
+
this.type = "ad4m://interpretation-run";
|
|
11193
|
+
this.runId = "";
|
|
11194
|
+
this.sources = [];
|
|
11195
|
+
}
|
|
11196
|
+
};
|
|
11197
|
+
__decorate([
|
|
11198
|
+
Flag({ through: "ad4m://type", value: "ad4m://interpretation-run" }),
|
|
11199
|
+
__metadata("design:type", String)
|
|
11200
|
+
], InterpretationRun.prototype, "type", void 0);
|
|
11201
|
+
__decorate([
|
|
11202
|
+
Property({ through: "ad4m://interp/run_id", required: true, identity: true }),
|
|
11203
|
+
__metadata("design:type", String)
|
|
11204
|
+
], InterpretationRun.prototype, "runId", void 0);
|
|
11205
|
+
__decorate([
|
|
11206
|
+
Optional({ through: "ad4m://interp/model", resolveLanguage: "literal" }),
|
|
11207
|
+
__metadata("design:type", String)
|
|
11208
|
+
], InterpretationRun.prototype, "model", void 0);
|
|
11209
|
+
__decorate([
|
|
11210
|
+
Optional({ through: "ad4m://interp/prompt_version", resolveLanguage: "literal" }),
|
|
11211
|
+
__metadata("design:type", String)
|
|
11212
|
+
], InterpretationRun.prototype, "promptVersion", void 0);
|
|
11213
|
+
__decorate([
|
|
11214
|
+
Optional({ through: "ad4m://interp/ran_at", resolveLanguage: "literal" }),
|
|
11215
|
+
__metadata("design:type", String)
|
|
11216
|
+
], InterpretationRun.prototype, "ranAt", void 0);
|
|
11217
|
+
__decorate([
|
|
11218
|
+
Optional({ through: "ad4m://interp/processor", resolveLanguage: "literal" }),
|
|
11219
|
+
__metadata("design:type", String)
|
|
11220
|
+
], InterpretationRun.prototype, "processor", void 0);
|
|
11221
|
+
__decorate([
|
|
11222
|
+
HasMany({ through: "ad4m://interp/sources" }),
|
|
11223
|
+
__metadata("design:type", Array)
|
|
11224
|
+
], InterpretationRun.prototype, "sources", void 0);
|
|
11225
|
+
InterpretationRun = __decorate([
|
|
11226
|
+
Model$1({ name: "InterpretationRun" })
|
|
11227
|
+
], InterpretationRun);
|
|
11228
|
+
var InterpretationOverlay = class InterpretationOverlay2 extends Ad4mModel {
|
|
11229
|
+
constructor() {
|
|
11230
|
+
super(...arguments);
|
|
11231
|
+
this.kind = "";
|
|
11232
|
+
}
|
|
11233
|
+
};
|
|
11234
|
+
__decorate([
|
|
11235
|
+
Property({ through: "ad4m://interp/kind", required: true, resolveLanguage: "literal" }),
|
|
11236
|
+
__metadata("design:type", String)
|
|
11237
|
+
], InterpretationOverlay.prototype, "kind", void 0);
|
|
11238
|
+
__decorate([
|
|
11239
|
+
Optional({ through: "ad4m://interp/run", resolveLanguage: "literal" }),
|
|
11240
|
+
__metadata("design:type", String)
|
|
11241
|
+
], InterpretationOverlay.prototype, "run", void 0);
|
|
11242
|
+
InterpretationOverlay = __decorate([
|
|
11243
|
+
Model$1({ name: "InterpretationOverlay" })
|
|
11244
|
+
], InterpretationOverlay);
|
|
10898
11245
|
var PerspectiveDiffExpression = class extends ExpressionGeneric() {
|
|
10899
11246
|
};
|
|
10900
11247
|
var _SmartLiteral_perspective;
|