interaqt 0.7.3 → 0.7.4
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/agent/CLAUDE.md +46 -7
- package/agent/agentspace/knowledge/generator/computation-analysis.md +53 -36
- package/agent/agentspace/knowledge/generator/data-analysis.md +276 -49
- package/agent/agentspace/knowledge/generator/integration-implementation-handler.md +550 -0
- package/agent/agentspace/prompt/requirement_analysis_refactor.md +1 -1
- package/dist/index.js +217 -215
- package/dist/index.js.map +1 -1
- package/dist/storage/erstorage/RecordQueryAgent.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17,15 +17,15 @@ function Ie(u, t) {
|
|
|
17
17
|
function w(u) {
|
|
18
18
|
return typeof u == "function" ? `func::${u.toString()}` : Array.isArray(u) ? u : ue(u) && !de(u) ? `uuid::${u.uuid}` : u;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function mt(u, t) {
|
|
21
21
|
if (u == null || typeof u != "object") return u;
|
|
22
|
-
if (Array.isArray(u)) return u.map((i) =>
|
|
22
|
+
if (Array.isArray(u)) return u.map((i) => mt(i, t));
|
|
23
23
|
if (de(u))
|
|
24
|
-
return Object.fromEntries(Object.entries(u).map(([i, r]) => [i,
|
|
24
|
+
return Object.fromEntries(Object.entries(u).map(([i, r]) => [i, mt(r, t)]));
|
|
25
25
|
if (u instanceof Set)
|
|
26
|
-
return new Set(Array.from(u.values()).map((i) =>
|
|
26
|
+
return new Set(Array.from(u.values()).map((i) => mt(i, t)));
|
|
27
27
|
if (u instanceof Map)
|
|
28
|
-
return new Map(Array.from(u.entries()).map(([i, r]) => [i,
|
|
28
|
+
return new Map(Array.from(u.entries()).map(([i, r]) => [i, mt(r, t)]));
|
|
29
29
|
const e = u;
|
|
30
30
|
return t && e._type && e.constructor?.clone ? e.constructor.clone(u, t) : u;
|
|
31
31
|
}
|
|
@@ -35,13 +35,13 @@ function or(...u) {
|
|
|
35
35
|
}
|
|
36
36
|
function nr() {
|
|
37
37
|
}
|
|
38
|
-
const
|
|
38
|
+
const Dt = /* @__PURE__ */ new Map();
|
|
39
39
|
function Ce(u, t) {
|
|
40
|
-
t && t.isKlass && t.displayName &&
|
|
40
|
+
t && t.isKlass && t.displayName && Dt.set(u, t);
|
|
41
41
|
}
|
|
42
42
|
function cr() {
|
|
43
43
|
const u = [];
|
|
44
|
-
return Array.from(
|
|
44
|
+
return Array.from(Dt.entries()).forEach(([, t]) => {
|
|
45
45
|
t.instances && Array.isArray(t.instances) && t.stringify && u.push(...t.instances.map((e) => t.stringify(e)));
|
|
46
46
|
}), `[${u.join(",")}]`;
|
|
47
47
|
}
|
|
@@ -52,7 +52,7 @@ function lr(u) {
|
|
|
52
52
|
function xe(u) {
|
|
53
53
|
const t = /* @__PURE__ */ new Map();
|
|
54
54
|
return u.forEach(({ type: e, options: i = {}, uuid: r, public: s }) => {
|
|
55
|
-
const a =
|
|
55
|
+
const a = Dt.get(e);
|
|
56
56
|
if (!a) {
|
|
57
57
|
console.warn(`Class ${e} not found in KlassByName`);
|
|
58
58
|
return;
|
|
@@ -192,9 +192,9 @@ class I {
|
|
|
192
192
|
return this.create(e.public, e.options);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
var
|
|
195
|
+
var Vt = /* @__PURE__ */ ((u) => (u.String = "string", u.Number = "number", u.Boolean = "boolean", u.Timestamp = "timestamp", u))(Vt || {});
|
|
196
196
|
const $e = /^[a-zA-Z0-9_]+$/;
|
|
197
|
-
class
|
|
197
|
+
class Qt {
|
|
198
198
|
constructor(t, e) {
|
|
199
199
|
this._type = "Dictionary", this._options = e, this.uuid = k(e), this.name = t.name, this.type = t.type, this.collection = t.collection ?? !1, this.args = t.args, this.defaultValue = t.defaultValue, this.computation = t.computation;
|
|
200
200
|
}
|
|
@@ -222,7 +222,7 @@ class Vt {
|
|
|
222
222
|
type: "string",
|
|
223
223
|
required: !0,
|
|
224
224
|
collection: !1,
|
|
225
|
-
options: Array.from(Object.values(
|
|
225
|
+
options: Array.from(Object.values(Vt))
|
|
226
226
|
},
|
|
227
227
|
collection: {
|
|
228
228
|
type: "boolean",
|
|
@@ -248,7 +248,7 @@ class Vt {
|
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
250
|
static create(t, e) {
|
|
251
|
-
const i = new
|
|
251
|
+
const i = new Qt(t, e);
|
|
252
252
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
253
253
|
throw new Error(`duplicate uuid in options ${i.uuid}, Dictionary`);
|
|
254
254
|
return this.instances.push(i), i;
|
|
@@ -314,7 +314,7 @@ class v {
|
|
|
314
314
|
type: {
|
|
315
315
|
type: "string",
|
|
316
316
|
required: !0,
|
|
317
|
-
options: () => Object.values(
|
|
317
|
+
options: () => Object.values(Vt)
|
|
318
318
|
},
|
|
319
319
|
collection: {
|
|
320
320
|
type: "boolean",
|
|
@@ -553,7 +553,7 @@ class P {
|
|
|
553
553
|
return this.create(e.public, e.options);
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
class
|
|
556
|
+
class Lt {
|
|
557
557
|
constructor(t, e) {
|
|
558
558
|
this._type = "Interaction", this._options = e, this.uuid = k(e), this.name = t.name, this.conditions = t.conditions, this.userAttributives = t.userAttributives, this.userRef = t.userRef, this.action = t.action, this.payload = t.payload, this.sideEffects = t.sideEffects || [], this.data = t.data, this.query = t.query;
|
|
559
559
|
}
|
|
@@ -614,7 +614,7 @@ class Qt {
|
|
|
614
614
|
};
|
|
615
615
|
}
|
|
616
616
|
static create(t, e) {
|
|
617
|
-
const i = new
|
|
617
|
+
const i = new Lt(t, e);
|
|
618
618
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
619
619
|
throw new Error(`duplicate uuid in options ${i.uuid}, Interaction`);
|
|
620
620
|
return this.instances.push(i), i;
|
|
@@ -651,7 +651,7 @@ class Qt {
|
|
|
651
651
|
return this.create(e.public, e.options);
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
class
|
|
654
|
+
class qt {
|
|
655
655
|
constructor(t, e) {
|
|
656
656
|
this._type = "Activity", this._options = e, this.uuid = k(e), this.name = t.name, this.interactions = t.interactions || [], this.gateways = t.gateways || [], this.transfers = t.transfers || [], this.groups = t.groups || [], this.events = t.events || [];
|
|
657
657
|
}
|
|
@@ -699,7 +699,7 @@ class Lt {
|
|
|
699
699
|
};
|
|
700
700
|
}
|
|
701
701
|
static create(t, e) {
|
|
702
|
-
const i = new
|
|
702
|
+
const i = new qt(t, e);
|
|
703
703
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
704
704
|
throw new Error(`duplicate uuid in options ${i.uuid}, Activity`);
|
|
705
705
|
return this.instances.push(i), i;
|
|
@@ -1179,13 +1179,13 @@ const Fe = {
|
|
|
1179
1179
|
function De(u) {
|
|
1180
1180
|
return { key: u };
|
|
1181
1181
|
}
|
|
1182
|
-
function
|
|
1182
|
+
function yt(u, t, e) {
|
|
1183
1183
|
if (u.type === "LogicalExpression")
|
|
1184
1184
|
return {
|
|
1185
1185
|
type: "expression",
|
|
1186
1186
|
operator: Fe[u.operator],
|
|
1187
|
-
left:
|
|
1188
|
-
right:
|
|
1187
|
+
left: yt(u.left, t, e),
|
|
1188
|
+
right: yt(u.right, t, e)
|
|
1189
1189
|
};
|
|
1190
1190
|
if (u.type === "Identifier")
|
|
1191
1191
|
return {
|
|
@@ -1196,14 +1196,14 @@ function mt(u, t, e) {
|
|
|
1196
1196
|
return {
|
|
1197
1197
|
type: "expression",
|
|
1198
1198
|
operator: "not",
|
|
1199
|
-
left:
|
|
1199
|
+
left: yt(u.argument, t, e)
|
|
1200
1200
|
};
|
|
1201
1201
|
throw new Error("unknown ast node type");
|
|
1202
1202
|
}
|
|
1203
1203
|
function fr(u, t = [], e = De) {
|
|
1204
1204
|
const i = Ie(t, "name"), r = Ee(u, { ecmaVersion: 2020 });
|
|
1205
1205
|
return new R(
|
|
1206
|
-
|
|
1206
|
+
yt(r.body[0].expression, i, e)
|
|
1207
1207
|
);
|
|
1208
1208
|
}
|
|
1209
1209
|
class U {
|
|
@@ -1274,7 +1274,7 @@ class U {
|
|
|
1274
1274
|
return i.content && typeof i.content == "string" && i.content.startsWith("func::") && (i.content = new Function("return " + i.content.substring(6))()), this.create(i, e.options);
|
|
1275
1275
|
}
|
|
1276
1276
|
}
|
|
1277
|
-
class
|
|
1277
|
+
class vt {
|
|
1278
1278
|
constructor(t, e) {
|
|
1279
1279
|
this._type = "Attributives", this._options = e, this.uuid = k(e), this.content = t.content;
|
|
1280
1280
|
}
|
|
@@ -1297,7 +1297,7 @@ class Nt {
|
|
|
1297
1297
|
};
|
|
1298
1298
|
}
|
|
1299
1299
|
static create(t, e) {
|
|
1300
|
-
const i = new
|
|
1300
|
+
const i = new vt(t, e);
|
|
1301
1301
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1302
1302
|
throw new Error(`duplicate uuid in options ${i.uuid}, Attributives`);
|
|
1303
1303
|
return this.instances.push(i), i;
|
|
@@ -1328,7 +1328,7 @@ class Nt {
|
|
|
1328
1328
|
return this.create(e.public, e.options);
|
|
1329
1329
|
}
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1331
|
+
function Mt(u) {
|
|
1332
1332
|
if (!u) return;
|
|
1333
1333
|
if (u.raw.type === "atom")
|
|
1334
1334
|
return it.create({
|
|
@@ -1339,16 +1339,16 @@ function xt(u) {
|
|
|
1339
1339
|
return rt.create({
|
|
1340
1340
|
type: "expression",
|
|
1341
1341
|
operator: t.operator,
|
|
1342
|
-
left:
|
|
1343
|
-
right:
|
|
1342
|
+
left: Mt(u.left),
|
|
1343
|
+
right: Mt(u.right)
|
|
1344
1344
|
});
|
|
1345
1345
|
}
|
|
1346
1346
|
function mr(u) {
|
|
1347
|
-
return
|
|
1348
|
-
content:
|
|
1347
|
+
return vt.create({
|
|
1348
|
+
content: Mt(u)
|
|
1349
1349
|
});
|
|
1350
1350
|
}
|
|
1351
|
-
class
|
|
1351
|
+
class Bt {
|
|
1352
1352
|
constructor(t, e) {
|
|
1353
1353
|
this._type = "Condition", this._options = e, this.uuid = k(e), this.content = t.content, this.name = t.name;
|
|
1354
1354
|
}
|
|
@@ -1374,7 +1374,7 @@ class qt {
|
|
|
1374
1374
|
};
|
|
1375
1375
|
}
|
|
1376
1376
|
static create(t, e) {
|
|
1377
|
-
const i = new
|
|
1377
|
+
const i = new Bt(t, e);
|
|
1378
1378
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1379
1379
|
throw new Error(`duplicate uuid in options ${i.uuid}, Condition`);
|
|
1380
1380
|
return this.instances.push(i), i;
|
|
@@ -1408,7 +1408,7 @@ class qt {
|
|
|
1408
1408
|
return i.content && typeof i.content == "string" && i.content.startsWith("func::") && (i.content = new Function("return " + i.content.substring(6))()), this.create(i, e.options);
|
|
1409
1409
|
}
|
|
1410
1410
|
}
|
|
1411
|
-
class
|
|
1411
|
+
class _t {
|
|
1412
1412
|
constructor(t, e) {
|
|
1413
1413
|
this._type = "DataAttributive", this._options = e, this.uuid = k(e), this.content = t.content, this.name = t.name;
|
|
1414
1414
|
}
|
|
@@ -1434,7 +1434,7 @@ class Bt {
|
|
|
1434
1434
|
};
|
|
1435
1435
|
}
|
|
1436
1436
|
static create(t, e) {
|
|
1437
|
-
const i = new
|
|
1437
|
+
const i = new _t(t, e);
|
|
1438
1438
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1439
1439
|
throw new Error(`duplicate uuid in options ${i.uuid}, DataAttributive`);
|
|
1440
1440
|
return this.instances.push(i), i;
|
|
@@ -1585,7 +1585,7 @@ class me {
|
|
|
1585
1585
|
return this.create(e.public, e.options);
|
|
1586
1586
|
}
|
|
1587
1587
|
}
|
|
1588
|
-
class
|
|
1588
|
+
class kt {
|
|
1589
1589
|
constructor(t, e) {
|
|
1590
1590
|
this._type = "Action", this._options = e, this.uuid = k(e), this.name = t.name;
|
|
1591
1591
|
}
|
|
@@ -1607,7 +1607,7 @@ class vt {
|
|
|
1607
1607
|
};
|
|
1608
1608
|
}
|
|
1609
1609
|
static create(t, e) {
|
|
1610
|
-
const i = new
|
|
1610
|
+
const i = new kt(t, e);
|
|
1611
1611
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1612
1612
|
throw new Error(`duplicate uuid in options ${i.uuid}, Action`);
|
|
1613
1613
|
return this.instances.push(i), i;
|
|
@@ -1639,7 +1639,7 @@ class vt {
|
|
|
1639
1639
|
return this.create(e.public, e.options);
|
|
1640
1640
|
}
|
|
1641
1641
|
}
|
|
1642
|
-
const Ve =
|
|
1642
|
+
const Ve = kt.create({ name: "get" });
|
|
1643
1643
|
class tt {
|
|
1644
1644
|
constructor(t, e) {
|
|
1645
1645
|
this._type = "Gateway", this._options = e, this.uuid = k(e), this.name = t.name;
|
|
@@ -1694,7 +1694,7 @@ class tt {
|
|
|
1694
1694
|
return this.create(e.public, e.options);
|
|
1695
1695
|
}
|
|
1696
1696
|
}
|
|
1697
|
-
class
|
|
1697
|
+
class Wt {
|
|
1698
1698
|
constructor(t, e) {
|
|
1699
1699
|
this._type = "Event", this._options = e, this.uuid = k(e), this.name = t.name;
|
|
1700
1700
|
}
|
|
@@ -1716,7 +1716,7 @@ class _t {
|
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
1718
|
static create(t, e) {
|
|
1719
|
-
const i = new
|
|
1719
|
+
const i = new Wt(t, e);
|
|
1720
1720
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1721
1721
|
throw new Error(`duplicate uuid in options ${i.uuid}, Event`);
|
|
1722
1722
|
return this.instances.push(i), i;
|
|
@@ -1811,7 +1811,7 @@ class K {
|
|
|
1811
1811
|
return this.create(e.public, e.options);
|
|
1812
1812
|
}
|
|
1813
1813
|
}
|
|
1814
|
-
class
|
|
1814
|
+
class Jt {
|
|
1815
1815
|
constructor(t, e) {
|
|
1816
1816
|
this._type = "StateTransfer", this._options = e, this.uuid = k(e), this.trigger = t.trigger, this.current = t.current, this.next = t.next, this.computeTarget = t.computeTarget;
|
|
1817
1817
|
}
|
|
@@ -1849,7 +1849,7 @@ class Wt {
|
|
|
1849
1849
|
};
|
|
1850
1850
|
}
|
|
1851
1851
|
static create(t, e) {
|
|
1852
|
-
const i = new
|
|
1852
|
+
const i = new Jt(t, e);
|
|
1853
1853
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
1854
1854
|
throw new Error(`duplicate uuid in options ${i.uuid}, StateTransfer`);
|
|
1855
1855
|
return this.instances.push(i), i;
|
|
@@ -2442,7 +2442,7 @@ class ut {
|
|
|
2442
2442
|
return i.callback && typeof i.callback == "string" && i.callback.startsWith("func::") && (i.callback = new Function("return " + i.callback.substring(6))()), this.create(i, e.options);
|
|
2443
2443
|
}
|
|
2444
2444
|
}
|
|
2445
|
-
class
|
|
2445
|
+
class Tt {
|
|
2446
2446
|
constructor(t, e) {
|
|
2447
2447
|
this._type = "Transform", this._options = e, this.uuid = k(e), this.record = t.record, this.eventDeps = t.eventDeps, this.attributeQuery = t.attributeQuery, this.callback = t.callback;
|
|
2448
2448
|
}
|
|
@@ -2475,7 +2475,7 @@ class kt {
|
|
|
2475
2475
|
};
|
|
2476
2476
|
}
|
|
2477
2477
|
static create(t, e) {
|
|
2478
|
-
const i = new
|
|
2478
|
+
const i = new Tt(t, e);
|
|
2479
2479
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2480
2480
|
throw new Error(`duplicate uuid in options ${i.uuid}, Transform`);
|
|
2481
2481
|
return this.instances.push(i), i;
|
|
@@ -2585,7 +2585,7 @@ class dt {
|
|
|
2585
2585
|
return typeof i.callback == "string" && i.callback.startsWith("func::") && (i.callback = new Function("return " + i.callback.substring(6))()), typeof i.nextRecomputeTime == "string" && i.nextRecomputeTime.startsWith("func::") && (i.nextRecomputeTime = new Function("return " + i.nextRecomputeTime.substring(6))()), this.create(i, e.options);
|
|
2586
2586
|
}
|
|
2587
2587
|
}
|
|
2588
|
-
class
|
|
2588
|
+
class Ht {
|
|
2589
2589
|
constructor(t, e) {
|
|
2590
2590
|
this._type = "PayloadItem", this._options = e, this.uuid = k(e), this.name = t.name, this.base = t.base, this.type = t.type, this.isRef = t.isRef ?? !1, this.required = t.required ?? !1, this.isCollection = t.isCollection ?? !1, this.itemRef = t.itemRef;
|
|
2591
2591
|
}
|
|
@@ -2636,7 +2636,7 @@ class Jt {
|
|
|
2636
2636
|
};
|
|
2637
2637
|
}
|
|
2638
2638
|
static create(t, e) {
|
|
2639
|
-
const i = new
|
|
2639
|
+
const i = new Ht(t, e);
|
|
2640
2640
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2641
2641
|
throw new Error(`duplicate uuid in options ${i.uuid}, PayloadItem`);
|
|
2642
2642
|
return this.instances.push(i), i;
|
|
@@ -2675,7 +2675,7 @@ class Jt {
|
|
|
2675
2675
|
return this.create(e.public, e.options);
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
2678
|
-
class
|
|
2678
|
+
class jt {
|
|
2679
2679
|
constructor(t, e) {
|
|
2680
2680
|
this._type = "Payload", this._options = e, this.uuid = k(e), this.items = t.items || [];
|
|
2681
2681
|
}
|
|
@@ -2699,7 +2699,7 @@ class Ht {
|
|
|
2699
2699
|
};
|
|
2700
2700
|
}
|
|
2701
2701
|
static create(t, e) {
|
|
2702
|
-
const i = new
|
|
2702
|
+
const i = new jt(t, e);
|
|
2703
2703
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2704
2704
|
throw new Error(`duplicate uuid in options ${i.uuid}, Payload`);
|
|
2705
2705
|
return this.instances.push(i), i;
|
|
@@ -2731,7 +2731,7 @@ class Ht {
|
|
|
2731
2731
|
return this.create(e.public, e.options);
|
|
2732
2732
|
}
|
|
2733
2733
|
}
|
|
2734
|
-
class
|
|
2734
|
+
class Ut {
|
|
2735
2735
|
constructor(t, e) {
|
|
2736
2736
|
this._type = "SideEffect", this._options = e, this.uuid = k(e), this.name = t.name, this.handle = t.handle;
|
|
2737
2737
|
}
|
|
@@ -2759,7 +2759,7 @@ class jt {
|
|
|
2759
2759
|
};
|
|
2760
2760
|
}
|
|
2761
2761
|
static create(t, e) {
|
|
2762
|
-
const i = new
|
|
2762
|
+
const i = new Ut(t, e);
|
|
2763
2763
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2764
2764
|
throw new Error(`duplicate uuid in options ${i.uuid}, SideEffect`);
|
|
2765
2765
|
return this.instances.push(i), i;
|
|
@@ -2793,7 +2793,7 @@ class jt {
|
|
|
2793
2793
|
return i.handle && typeof i.handle == "string" && i.handle.startsWith("func::") && (i.handle = new Function("return " + i.handle.substring(6))()), this.create(i, e.options);
|
|
2794
2794
|
}
|
|
2795
2795
|
}
|
|
2796
|
-
function
|
|
2796
|
+
function Pt(u) {
|
|
2797
2797
|
if (!u) return;
|
|
2798
2798
|
if (u.raw.type === "atom")
|
|
2799
2799
|
return it.create({
|
|
@@ -2804,13 +2804,13 @@ function Mt(u) {
|
|
|
2804
2804
|
return rt.create({
|
|
2805
2805
|
type: "expression",
|
|
2806
2806
|
operator: t.operator,
|
|
2807
|
-
left:
|
|
2808
|
-
right:
|
|
2807
|
+
left: Pt(u.left),
|
|
2808
|
+
right: Pt(u.right)
|
|
2809
2809
|
});
|
|
2810
2810
|
}
|
|
2811
|
-
class
|
|
2811
|
+
class At {
|
|
2812
2812
|
constructor(t, e) {
|
|
2813
|
-
this._type = "Conditions", this._options = e, this.uuid = k(e), t.content && t.content instanceof R ? this.content =
|
|
2813
|
+
this._type = "Conditions", this._options = e, this.uuid = k(e), t.content && t.content instanceof R ? this.content = Pt(t.content) : this.content = t.content;
|
|
2814
2814
|
}
|
|
2815
2815
|
static {
|
|
2816
2816
|
this.isKlass = !0;
|
|
@@ -2831,7 +2831,7 @@ class Tt {
|
|
|
2831
2831
|
};
|
|
2832
2832
|
}
|
|
2833
2833
|
static create(t, e) {
|
|
2834
|
-
const i = new
|
|
2834
|
+
const i = new At(t, e);
|
|
2835
2835
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2836
2836
|
throw new Error(`duplicate uuid in options ${i.uuid}, Conditions`);
|
|
2837
2837
|
return this.instances.push(i), i;
|
|
@@ -2862,7 +2862,7 @@ class Tt {
|
|
|
2862
2862
|
return this.create(e.public, e.options);
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
|
-
class
|
|
2865
|
+
class Kt {
|
|
2866
2866
|
constructor(t, e) {
|
|
2867
2867
|
this._type = "DataAttributives", this._options = e, this.uuid = k(e), this.content = t.content;
|
|
2868
2868
|
}
|
|
@@ -2885,7 +2885,7 @@ class Ut {
|
|
|
2885
2885
|
};
|
|
2886
2886
|
}
|
|
2887
2887
|
static create(t, e) {
|
|
2888
|
-
const i = new
|
|
2888
|
+
const i = new Kt(t, e);
|
|
2889
2889
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
2890
2890
|
throw new Error(`duplicate uuid in options ${i.uuid}, DataAttributives`);
|
|
2891
2891
|
return this.instances.push(i), i;
|
|
@@ -2920,16 +2920,16 @@ const Qe = [
|
|
|
2920
2920
|
I,
|
|
2921
2921
|
P,
|
|
2922
2922
|
v,
|
|
2923
|
-
Qt,
|
|
2924
2923
|
Lt,
|
|
2925
|
-
U,
|
|
2926
2924
|
qt,
|
|
2925
|
+
U,
|
|
2927
2926
|
Bt,
|
|
2928
|
-
vt,
|
|
2929
|
-
tt,
|
|
2930
2927
|
_t,
|
|
2931
|
-
|
|
2928
|
+
kt,
|
|
2929
|
+
tt,
|
|
2932
2930
|
Wt,
|
|
2931
|
+
K,
|
|
2932
|
+
Jt,
|
|
2933
2933
|
st,
|
|
2934
2934
|
at,
|
|
2935
2935
|
ot,
|
|
@@ -2937,21 +2937,21 @@ const Qe = [
|
|
|
2937
2937
|
ct,
|
|
2938
2938
|
lt,
|
|
2939
2939
|
ut,
|
|
2940
|
-
|
|
2940
|
+
Tt,
|
|
2941
2941
|
dt,
|
|
2942
|
-
Jt,
|
|
2943
2942
|
Ht,
|
|
2944
2943
|
jt,
|
|
2945
|
-
|
|
2944
|
+
Ut,
|
|
2945
|
+
Qt,
|
|
2946
2946
|
it,
|
|
2947
2947
|
rt,
|
|
2948
|
-
|
|
2949
|
-
|
|
2948
|
+
At,
|
|
2949
|
+
Kt
|
|
2950
2950
|
];
|
|
2951
2951
|
Qe.forEach((u) => {
|
|
2952
2952
|
u && u.displayName && Ce(u.displayName, u);
|
|
2953
2953
|
});
|
|
2954
|
-
class
|
|
2954
|
+
class Gt {
|
|
2955
2955
|
constructor(t, e) {
|
|
2956
2956
|
this._type = "Custom", this._options = e, this.uuid = k(e), this.name = t.name, this.dataDeps = t.dataDeps, this.compute = t.compute, this.incrementalCompute = t.incrementalCompute, this.incrementalPatchCompute = t.incrementalPatchCompute, this.createState = t.createState, this.getInitialValue = t.getInitialValue, this.asyncReturn = t.asyncReturn, this.useLastValue = t.useLastValue;
|
|
2957
2957
|
}
|
|
@@ -3014,7 +3014,7 @@ class Kt {
|
|
|
3014
3014
|
};
|
|
3015
3015
|
}
|
|
3016
3016
|
static create(t, e) {
|
|
3017
|
-
const i = new
|
|
3017
|
+
const i = new Gt(t, e);
|
|
3018
3018
|
if (this.instances.find((s) => s.uuid === i.uuid))
|
|
3019
3019
|
throw new Error(`duplicate uuid in options ${i.uuid}, Custom`);
|
|
3020
3020
|
return this.instances.push(i), i;
|
|
@@ -3282,7 +3282,7 @@ function g(u, t) {
|
|
|
3282
3282
|
if (!u)
|
|
3283
3283
|
throw new Error(t);
|
|
3284
3284
|
}
|
|
3285
|
-
function
|
|
3285
|
+
function Et(u, t, e) {
|
|
3286
3286
|
const i = [...t];
|
|
3287
3287
|
let r = u, s;
|
|
3288
3288
|
const a = i.pop();
|
|
@@ -4243,18 +4243,18 @@ class We {
|
|
|
4243
4243
|
}
|
|
4244
4244
|
}
|
|
4245
4245
|
const ge = ":root";
|
|
4246
|
-
class
|
|
4246
|
+
class bt {
|
|
4247
4247
|
constructor(t, e, i = []) {
|
|
4248
4248
|
this.label = t, this.parent = e, this.stack = i;
|
|
4249
4249
|
}
|
|
4250
4250
|
concat(t) {
|
|
4251
|
-
return new
|
|
4251
|
+
return new bt(this.label, this.parent, [...this.stack, t]);
|
|
4252
4252
|
}
|
|
4253
4253
|
getStack(t) {
|
|
4254
4254
|
return [...this.stack];
|
|
4255
4255
|
}
|
|
4256
4256
|
spawn(t) {
|
|
4257
|
-
return new
|
|
4257
|
+
return new bt(t, this);
|
|
4258
4258
|
}
|
|
4259
4259
|
}
|
|
4260
4260
|
class Je {
|
|
@@ -4327,80 +4327,80 @@ ${b}
|
|
|
4327
4327
|
const s = {};
|
|
4328
4328
|
return Object.entries(r).forEach(([a, o]) => {
|
|
4329
4329
|
const n = i.getPath(a).slice(1, 1 / 0);
|
|
4330
|
-
n.length === 1 && e.includes(n[0]) && typeof o == "string" && (o = JSON.parse(o)), o !== null &&
|
|
4330
|
+
n.length === 1 && e.includes(n[0]) && typeof o == "string" && (o = JSON.parse(o)), o !== null && Et(s, n, o);
|
|
4331
4331
|
}), s;
|
|
4332
4332
|
});
|
|
4333
4333
|
}
|
|
4334
4334
|
// 查 entity 和 查 relation 都是一样的。具体在 entityQuery 里面区别。
|
|
4335
4335
|
// TODO 为了性能,也可以把信息丢到客户端,然客户端去结构化???
|
|
4336
4336
|
// CAUTION findRelatedRecords 中的递归调用会使得 includeRelationData 变为 true
|
|
4337
|
-
async findRecords(t, e = "", i, r = new
|
|
4337
|
+
async findRecords(t, e = "", i, r = new bt(ge)) {
|
|
4338
4338
|
if (i || (i = new Je(t)), t.goto) {
|
|
4339
4339
|
if (t.exit && await t.exit(r))
|
|
4340
4340
|
return [];
|
|
4341
|
-
const
|
|
4342
|
-
g(
|
|
4343
|
-
const
|
|
4344
|
-
matchExpression:
|
|
4341
|
+
const d = i.get(t.goto);
|
|
4342
|
+
g(d, `goto ${t.goto} not found`);
|
|
4343
|
+
const h = t.matchExpression.and(d.matchExpression), p = d.derive({
|
|
4344
|
+
matchExpression: h
|
|
4345
4345
|
});
|
|
4346
|
-
return this.findRecords(
|
|
4346
|
+
return this.findRecords(p, e, i, r);
|
|
4347
4347
|
}
|
|
4348
4348
|
if (t.label && r.label === t.label && r.stack.length > 1 && r.stack[0].id === r.stack.at(-1).id)
|
|
4349
4349
|
return [];
|
|
4350
|
-
const [s, a, o] = this.buildXToOneFindQuery(t, ""), n =
|
|
4351
|
-
this.completeXToOneLeftoverRecords(t,
|
|
4352
|
-
for (let
|
|
4353
|
-
if (
|
|
4354
|
-
const
|
|
4355
|
-
for (let
|
|
4356
|
-
const
|
|
4357
|
-
key: `${
|
|
4358
|
-
value: ["=",
|
|
4359
|
-
}),
|
|
4360
|
-
matchExpression:
|
|
4361
|
-
}),
|
|
4362
|
-
|
|
4350
|
+
const [s, a, o] = this.buildXToOneFindQuery(t, ""), n = await this.database.query(s, a, e), c = this.structureRawReturns(n, this.map.getRecordInfo(t.recordName).JSONFields, o), l = t.label && t.label !== r.label ? r.spawn(t.label) : r;
|
|
4351
|
+
await this.completeXToOneLeftoverRecords(t, c, i, l);
|
|
4352
|
+
for (let d of t.attributeQuery.xToOneRecords)
|
|
4353
|
+
if (d.goto) {
|
|
4354
|
+
const p = this.map.getInfo(d.parentRecord, d.attributeName).getReverseInfo()?.attributeName;
|
|
4355
|
+
for (let y of c) {
|
|
4356
|
+
const N = d.matchExpression.and({
|
|
4357
|
+
key: `${p}.id`,
|
|
4358
|
+
value: ["=", y.id]
|
|
4359
|
+
}), b = d.derive({
|
|
4360
|
+
matchExpression: N
|
|
4361
|
+
}), A = t.label ? l.concat(y) : l;
|
|
4362
|
+
y[d.alias || d.attributeName] = await this.findRecords(b, e, i, A);
|
|
4363
4363
|
}
|
|
4364
4364
|
}
|
|
4365
|
-
for (let
|
|
4366
|
-
const
|
|
4367
|
-
if (
|
|
4368
|
-
for (let
|
|
4369
|
-
const
|
|
4370
|
-
for (let
|
|
4371
|
-
const
|
|
4372
|
-
matchExpression:
|
|
4373
|
-
key: `${
|
|
4374
|
-
value: ["=",
|
|
4365
|
+
for (let d of t.attributeQuery.xToOneRecords) {
|
|
4366
|
+
const h = d.attributeQuery.parentLinkRecordQuery;
|
|
4367
|
+
if (h)
|
|
4368
|
+
for (let p of h.attributeQuery.xToManyRecords) {
|
|
4369
|
+
const N = this.map.getInfo(p.parentRecord, p.attributeName).getReverseInfo()?.attributeName;
|
|
4370
|
+
for (let b of c) {
|
|
4371
|
+
const A = b[d.attributeName][f].id, D = p.derive({
|
|
4372
|
+
matchExpression: p.matchExpression.and({
|
|
4373
|
+
key: `${N}.id`,
|
|
4374
|
+
value: ["=", A]
|
|
4375
4375
|
})
|
|
4376
|
-
}),
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
[
|
|
4376
|
+
}), ft = t.label ? l.concat(b) : l;
|
|
4377
|
+
Et(
|
|
4378
|
+
b,
|
|
4379
|
+
[d.alias || d.attributeName, f, p.attributeName],
|
|
4380
4380
|
await this.findRecords(
|
|
4381
|
-
|
|
4382
|
-
`finding relation data: ${t.recordName}.${
|
|
4381
|
+
D,
|
|
4382
|
+
`finding relation data: ${t.recordName}.${d.attributeName}.&.${p.attributeName}`,
|
|
4383
4383
|
i,
|
|
4384
|
-
|
|
4384
|
+
ft
|
|
4385
4385
|
)
|
|
4386
4386
|
);
|
|
4387
4387
|
}
|
|
4388
4388
|
}
|
|
4389
4389
|
}
|
|
4390
|
-
for (let
|
|
4391
|
-
if (!
|
|
4392
|
-
for (let
|
|
4393
|
-
const
|
|
4394
|
-
d
|
|
4390
|
+
for (let d of t.attributeQuery.xToManyRecords)
|
|
4391
|
+
if (!d.onlyRelationData)
|
|
4392
|
+
for (let h of c) {
|
|
4393
|
+
const p = t.label ? l.concat(h) : l;
|
|
4394
|
+
h[d.alias || d.attributeName] = await this.findXToManyRelatedRecords(
|
|
4395
4395
|
t.recordName,
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4396
|
+
d.attributeName,
|
|
4397
|
+
h.id,
|
|
4398
|
+
d,
|
|
4399
4399
|
i,
|
|
4400
|
-
|
|
4400
|
+
p
|
|
4401
4401
|
);
|
|
4402
4402
|
}
|
|
4403
|
-
return
|
|
4403
|
+
return c;
|
|
4404
4404
|
}
|
|
4405
4405
|
async completeXToOneLeftoverRecords(t, e, i, r) {
|
|
4406
4406
|
if (t.attributeQuery.parentLinkRecordQuery) {
|
|
@@ -4422,6 +4422,8 @@ ${b}
|
|
|
4422
4422
|
for (let s of t.attributeQuery.xToOneRecords) {
|
|
4423
4423
|
for (let a of s.attributeQuery.xToManyRecords)
|
|
4424
4424
|
for (let o of e) {
|
|
4425
|
+
if (!o[s.attributeName])
|
|
4426
|
+
continue;
|
|
4425
4427
|
const n = t.label ? r.concat(o) : r;
|
|
4426
4428
|
o[s.attributeName][a.attributeName] = await this.findXToManyRelatedRecords(
|
|
4427
4429
|
a.parentRecord,
|
|
@@ -4461,8 +4463,8 @@ ${b}
|
|
|
4461
4463
|
if (N)
|
|
4462
4464
|
for (let b of N.attributeQuery.xToManyRecords)
|
|
4463
4465
|
for (let A of p) {
|
|
4464
|
-
const D = A[f].id,
|
|
4465
|
-
|
|
4466
|
+
const D = A[f].id, ft = d.label ? y.concat(A) : y;
|
|
4467
|
+
Et(
|
|
4466
4468
|
A,
|
|
4467
4469
|
[f, b.attributeName],
|
|
4468
4470
|
await this.findXToManyRelatedRecords(
|
|
@@ -4471,7 +4473,7 @@ ${b}
|
|
|
4471
4473
|
D,
|
|
4472
4474
|
b,
|
|
4473
4475
|
s,
|
|
4474
|
-
|
|
4476
|
+
ft
|
|
4475
4477
|
)
|
|
4476
4478
|
);
|
|
4477
4479
|
}
|
|
@@ -5276,7 +5278,7 @@ class et {
|
|
|
5276
5278
|
return this.data?.resolvedMatchExpression;
|
|
5277
5279
|
}
|
|
5278
5280
|
}
|
|
5279
|
-
class
|
|
5281
|
+
class Rt {
|
|
5280
5282
|
constructor(t, e, i, r = !0) {
|
|
5281
5283
|
this.name = t, this.data = e, this.map = i, this.isFromSource = r;
|
|
5282
5284
|
}
|
|
@@ -5364,7 +5366,7 @@ class bt {
|
|
|
5364
5366
|
getBaseLinkInfo() {
|
|
5365
5367
|
g(this.isFilteredRelation(), "only filtered relation can get base link info");
|
|
5366
5368
|
const t = this.data.baseLinkName;
|
|
5367
|
-
return new
|
|
5369
|
+
return new Rt(t, this.map.data.links[t], this.map);
|
|
5368
5370
|
}
|
|
5369
5371
|
getMatchExpression() {
|
|
5370
5372
|
if (this.isFilteredRelation())
|
|
@@ -5403,10 +5405,10 @@ class Ue {
|
|
|
5403
5405
|
}
|
|
5404
5406
|
getLinkInfo(t, e) {
|
|
5405
5407
|
const i = this.getAttributeAndSymmetricDirection(e)[0], { linkName: r, isSource: s } = this.data.records[t].attributes[i];
|
|
5406
|
-
return g(!!r, `cannot find relation ${t} ${i}`), new
|
|
5408
|
+
return g(!!r, `cannot find relation ${t} ${i}`), new Rt(r, this.data.links[r], this, !!s);
|
|
5407
5409
|
}
|
|
5408
5410
|
getLinkInfoByName(t) {
|
|
5409
|
-
return g(!!this.data.links[t], `cannot find link ${t}`), new
|
|
5411
|
+
return g(!!this.data.links[t], `cannot find link ${t}`), new Rt(t, this.data.links[t], this);
|
|
5410
5412
|
}
|
|
5411
5413
|
getInfoByPath(t) {
|
|
5412
5414
|
const [e, ...i] = t;
|
|
@@ -6255,7 +6257,7 @@ const X = "_System_", q = "_Dictionary_", ie = "id", re = "_rowId", ni = I.creat
|
|
|
6255
6257
|
collection: !1
|
|
6256
6258
|
})
|
|
6257
6259
|
]
|
|
6258
|
-
}), gr = 0,
|
|
6260
|
+
}), gr = 0, It = 1, br = 2;
|
|
6259
6261
|
class li {
|
|
6260
6262
|
constructor(t, e) {
|
|
6261
6263
|
this.controller = t, this.scheduler = e, this.sourceMaps = [], this.sourceMapTree = {};
|
|
@@ -6270,18 +6272,18 @@ class li {
|
|
|
6270
6272
|
if (this.scheduler.isDataBasedComputation(i)) {
|
|
6271
6273
|
if (Object.entries(i.dataDeps).forEach(([r, s]) => {
|
|
6272
6274
|
const a = this.convertDataDepToERMutationEventsSourceMap(r, s, i);
|
|
6273
|
-
e[s.phase ||
|
|
6275
|
+
e[s.phase || It].push(...a);
|
|
6274
6276
|
}), i.dataContext.type === "property" && Object.values(i.dataDeps).some((r) => r.type === "global")) {
|
|
6275
6277
|
const r = {
|
|
6276
6278
|
type: "records",
|
|
6277
6279
|
source: i.dataContext.host
|
|
6278
6280
|
};
|
|
6279
|
-
e[
|
|
6281
|
+
e[It].push(...this.convertDataDepToERMutationEventsSourceMap("_self", r, i, "create"));
|
|
6280
6282
|
}
|
|
6281
6283
|
} else {
|
|
6282
6284
|
const { eventDeps: r } = i;
|
|
6283
6285
|
for (const s of Object.values(r))
|
|
6284
|
-
e[s.phase ||
|
|
6286
|
+
e[s.phase || It].push({
|
|
6285
6287
|
type: s.type,
|
|
6286
6288
|
recordName: s.recordName,
|
|
6287
6289
|
record: s.record,
|
|
@@ -6483,7 +6485,7 @@ class li {
|
|
|
6483
6485
|
}
|
|
6484
6486
|
class S {
|
|
6485
6487
|
static {
|
|
6486
|
-
this.skip = () => new
|
|
6488
|
+
this.skip = () => new wt();
|
|
6487
6489
|
}
|
|
6488
6490
|
static {
|
|
6489
6491
|
this.resolved = (t, e) => new we(t, e);
|
|
@@ -6495,7 +6497,7 @@ class S {
|
|
|
6495
6497
|
this.fullRecompute = (t) => new be(t);
|
|
6496
6498
|
}
|
|
6497
6499
|
}
|
|
6498
|
-
class
|
|
6500
|
+
class wt extends S {
|
|
6499
6501
|
}
|
|
6500
6502
|
class be extends S {
|
|
6501
6503
|
constructor(t) {
|
|
@@ -6538,14 +6540,14 @@ class B {
|
|
|
6538
6540
|
return await this.controller.system.storage.dict.get(this.key);
|
|
6539
6541
|
}
|
|
6540
6542
|
}
|
|
6541
|
-
function
|
|
6543
|
+
function $t(u, t) {
|
|
6542
6544
|
if (t == null || u === t) return !0;
|
|
6543
6545
|
if (typeof t != "object" || t === null)
|
|
6544
6546
|
return u === t;
|
|
6545
6547
|
if (typeof u != "object" || u === null)
|
|
6546
6548
|
return !1;
|
|
6547
6549
|
for (const e in t)
|
|
6548
|
-
if (!(e in u) ||
|
|
6550
|
+
if (!(e in u) || !$t(u[e], t[e]))
|
|
6549
6551
|
return !1;
|
|
6550
6552
|
return !0;
|
|
6551
6553
|
}
|
|
@@ -6562,13 +6564,13 @@ class Ne {
|
|
|
6562
6564
|
const i = this.map[t];
|
|
6563
6565
|
if (i) {
|
|
6564
6566
|
for (const r of i)
|
|
6565
|
-
if (
|
|
6567
|
+
if ($t(e, r.trigger))
|
|
6566
6568
|
return r.next;
|
|
6567
6569
|
}
|
|
6568
6570
|
return null;
|
|
6569
6571
|
}
|
|
6570
6572
|
findTransfers(t) {
|
|
6571
|
-
return this.data.transfers.filter((e) =>
|
|
6573
|
+
return this.data.transfers.filter((e) => $t(t, e.trigger));
|
|
6572
6574
|
}
|
|
6573
6575
|
}
|
|
6574
6576
|
function T(u, t) {
|
|
@@ -7218,7 +7220,7 @@ class Ei {
|
|
|
7218
7220
|
});
|
|
7219
7221
|
}
|
|
7220
7222
|
static {
|
|
7221
|
-
this.computationType =
|
|
7223
|
+
this.computationType = Tt;
|
|
7222
7224
|
}
|
|
7223
7225
|
static {
|
|
7224
7226
|
this.contextType = ["entity", "relation"];
|
|
@@ -7413,13 +7415,13 @@ class M {
|
|
|
7413
7415
|
}
|
|
7414
7416
|
}
|
|
7415
7417
|
gt(t) {
|
|
7416
|
-
return new
|
|
7418
|
+
return new Nt(this, ">", t);
|
|
7417
7419
|
}
|
|
7418
7420
|
lt(t) {
|
|
7419
|
-
return new
|
|
7421
|
+
return new Nt(this, "<", t);
|
|
7420
7422
|
}
|
|
7421
7423
|
eq(t) {
|
|
7422
|
-
return new
|
|
7424
|
+
return new Xt(this, t);
|
|
7423
7425
|
}
|
|
7424
7426
|
getVariables() {
|
|
7425
7427
|
const t = /* @__PURE__ */ new Set();
|
|
@@ -7516,7 +7518,7 @@ class M {
|
|
|
7516
7518
|
}
|
|
7517
7519
|
}
|
|
7518
7520
|
}
|
|
7519
|
-
class
|
|
7521
|
+
class Nt {
|
|
7520
7522
|
constructor(t, e, i) {
|
|
7521
7523
|
this.left = t, this.operator = e, this.right = i;
|
|
7522
7524
|
}
|
|
@@ -7551,7 +7553,7 @@ class wt {
|
|
|
7551
7553
|
}
|
|
7552
7554
|
}
|
|
7553
7555
|
}
|
|
7554
|
-
class
|
|
7556
|
+
class Xt {
|
|
7555
7557
|
constructor(t, e) {
|
|
7556
7558
|
this.left = t, this.right = e;
|
|
7557
7559
|
}
|
|
@@ -7611,7 +7613,7 @@ class Ci {
|
|
|
7611
7613
|
let r, s;
|
|
7612
7614
|
if (e instanceof M)
|
|
7613
7615
|
r = e.evaluate({ now: i }), s = i + this.nextRecomputeTime(i, t);
|
|
7614
|
-
else if (e instanceof
|
|
7616
|
+
else if (e instanceof Nt || e instanceof Xt)
|
|
7615
7617
|
r = e.evaluate({ now: i }), s = e.solve();
|
|
7616
7618
|
else
|
|
7617
7619
|
throw new Error("Invalid result type");
|
|
@@ -7649,7 +7651,7 @@ class xi {
|
|
|
7649
7651
|
let s, a;
|
|
7650
7652
|
if (i instanceof M)
|
|
7651
7653
|
s = i.evaluate({ now: r }), a = r + this.nextRecomputeTime(r, t);
|
|
7652
|
-
else if (i instanceof
|
|
7654
|
+
else if (i instanceof Nt || i instanceof Xt)
|
|
7653
7655
|
s = i.evaluate({ now: r }), a = i.solve();
|
|
7654
7656
|
else
|
|
7655
7657
|
throw new Error("Invalid result type");
|
|
@@ -7966,7 +7968,7 @@ class Di {
|
|
|
7966
7968
|
}
|
|
7967
7969
|
}
|
|
7968
7970
|
const Vi = [Fi, Di];
|
|
7969
|
-
class
|
|
7971
|
+
class St {
|
|
7970
7972
|
constructor(t, e, i) {
|
|
7971
7973
|
this.controller = t, this.args = e, this.dataContext = i, this.state = {}, this.dataDeps = {}, this.useLastValue = e.useLastValue !== void 0 ? e.useLastValue : !0, e.dataDeps && (this.dataDeps = e.dataDeps), e.compute && (this.computeCallback = e.compute, this.compute = async (...r) => {
|
|
7972
7974
|
if (this.computeCallback) {
|
|
@@ -8010,7 +8012,7 @@ class At {
|
|
|
8010
8012
|
}));
|
|
8011
8013
|
}
|
|
8012
8014
|
static {
|
|
8013
|
-
this.computationType =
|
|
8015
|
+
this.computationType = Gt;
|
|
8014
8016
|
}
|
|
8015
8017
|
createState() {
|
|
8016
8018
|
if (this.createStateCallback) {
|
|
@@ -8037,22 +8039,22 @@ class At {
|
|
|
8037
8039
|
return S.skip();
|
|
8038
8040
|
}
|
|
8039
8041
|
}
|
|
8040
|
-
class Qi extends
|
|
8042
|
+
class Qi extends St {
|
|
8041
8043
|
static {
|
|
8042
8044
|
this.contextType = "global";
|
|
8043
8045
|
}
|
|
8044
8046
|
}
|
|
8045
|
-
class Li extends
|
|
8047
|
+
class Li extends St {
|
|
8046
8048
|
static {
|
|
8047
8049
|
this.contextType = "entity";
|
|
8048
8050
|
}
|
|
8049
8051
|
}
|
|
8050
|
-
class qi extends
|
|
8052
|
+
class qi extends St {
|
|
8051
8053
|
static {
|
|
8052
8054
|
this.contextType = "relation";
|
|
8053
8055
|
}
|
|
8054
8056
|
}
|
|
8055
|
-
class Bi extends
|
|
8057
|
+
class Bi extends St {
|
|
8056
8058
|
static {
|
|
8057
8059
|
this.contextType = "property";
|
|
8058
8060
|
}
|
|
@@ -8269,7 +8271,7 @@ class J extends V {
|
|
|
8269
8271
|
}), this.depName = e.depName, this.depType = e.depType, this.missingData = e.missingData, this.invalidData = e.invalidData;
|
|
8270
8272
|
}
|
|
8271
8273
|
}
|
|
8272
|
-
class
|
|
8274
|
+
class Ct extends W {
|
|
8273
8275
|
constructor(t, e = {}) {
|
|
8274
8276
|
super(t, {
|
|
8275
8277
|
errorType: e.context?.errorType || "SchedulerError",
|
|
@@ -8372,7 +8374,7 @@ class O extends W {
|
|
|
8372
8374
|
});
|
|
8373
8375
|
}
|
|
8374
8376
|
}
|
|
8375
|
-
const
|
|
8377
|
+
const xt = "_ASYNC_TASK_";
|
|
8376
8378
|
class Ji {
|
|
8377
8379
|
constructor(t, e, i, r, s) {
|
|
8378
8380
|
this.controller = t, this.computationsHandles = /* @__PURE__ */ new Map(), this.computationHandleMap = /* @__PURE__ */ new Map(), this.erMutationEventSources = [], this.dataSourceMapTree = {}, this.sourceMapManager = new li(this.controller, this), this.buildComputationHandleMap(s);
|
|
@@ -8689,7 +8691,7 @@ class Ji {
|
|
|
8689
8691
|
}
|
|
8690
8692
|
}
|
|
8691
8693
|
} catch (i) {
|
|
8692
|
-
throw i instanceof V ? i : new
|
|
8694
|
+
throw i instanceof V ? i : new Ct("Unexpected error in dirty records computation", {
|
|
8693
8695
|
schedulingPhase: "dirty-records-processing",
|
|
8694
8696
|
failedComputations: [t.computation.args.constructor.displayName],
|
|
8695
8697
|
causedBy: i instanceof Error ? i : new Error(String(i))
|
|
@@ -8699,8 +8701,8 @@ class Ji {
|
|
|
8699
8701
|
getAsyncTaskRecordKey(t) {
|
|
8700
8702
|
if (t.dataContext.type === "property") {
|
|
8701
8703
|
const e = t.dataContext;
|
|
8702
|
-
return `${
|
|
8703
|
-
} else return t.dataContext.type === "global" ? `${
|
|
8704
|
+
return `${xt}_${e.host.name}_${e.id.name}`;
|
|
8705
|
+
} else return t.dataContext.type === "global" ? `${xt}_${t.dataContext.id.name}` : `${xt}_${t.dataContext.type}_${t.dataContext.id?.name}`;
|
|
8704
8706
|
}
|
|
8705
8707
|
async createAsyncTask(t, e, i, r) {
|
|
8706
8708
|
if (t.dataContext.type === "property")
|
|
@@ -8819,7 +8821,7 @@ class Ji {
|
|
|
8819
8821
|
causedBy: o instanceof Error ? o : new Error(String(o))
|
|
8820
8822
|
});
|
|
8821
8823
|
}
|
|
8822
|
-
if (s instanceof
|
|
8824
|
+
if (s instanceof wt)
|
|
8823
8825
|
return;
|
|
8824
8826
|
if (s instanceof Re)
|
|
8825
8827
|
try {
|
|
@@ -8917,7 +8919,7 @@ class Ji {
|
|
|
8917
8919
|
try {
|
|
8918
8920
|
this.addMutationPropertyComputationDefaultValueListeners(), this.addMutationComputationListeners(), t && (await this.setupGlobalBoundStateDefaultValues(), await this.setupGlobalComputationDefaultValue(), await this.setupDictDefaultValue());
|
|
8919
8921
|
} catch (e) {
|
|
8920
|
-
throw e instanceof
|
|
8922
|
+
throw e instanceof Ct ? e : new Ct("Unexpected error during scheduler setup", {
|
|
8921
8923
|
schedulingPhase: "top-level-setup",
|
|
8922
8924
|
causedBy: e instanceof Error ? e : new Error(String(e))
|
|
8923
8925
|
});
|
|
@@ -8952,7 +8954,7 @@ class ve {
|
|
|
8952
8954
|
async checkUser(t, e, i) {
|
|
8953
8955
|
let r;
|
|
8954
8956
|
if (!this.interaction.userAttributives) return !0;
|
|
8955
|
-
const s =
|
|
8957
|
+
const s = vt.is(this.interaction.userAttributives) ? R.fromValue(
|
|
8956
8958
|
this.interaction.userAttributives.content
|
|
8957
8959
|
) : R.atom(
|
|
8958
8960
|
this.interaction.userAttributives
|
|
@@ -9040,7 +9042,7 @@ class ve {
|
|
|
9040
9042
|
}
|
|
9041
9043
|
async checkCondition(t) {
|
|
9042
9044
|
if (this.interaction.conditions) {
|
|
9043
|
-
const e =
|
|
9045
|
+
const e = At.is(this.interaction.conditions) ? new R(this.interaction.conditions.content) : R.atom(this.interaction.conditions), i = async (s) => {
|
|
9044
9046
|
if (!s) return !0;
|
|
9045
9047
|
if (s.content) {
|
|
9046
9048
|
const a = s.content;
|
|
@@ -9366,8 +9368,8 @@ class Ki extends $ {
|
|
|
9366
9368
|
// 可以根据 group 上的具体配置逻辑,来动态决定。
|
|
9367
9369
|
}
|
|
9368
9370
|
$.GroupStateNodeType.set("program", Ki);
|
|
9369
|
-
const ne = new le(),
|
|
9370
|
-
name:
|
|
9371
|
+
const ne = new le(), Ot = "_Interaction_", gt = "_Activity_", ke = I.create({
|
|
9372
|
+
name: Ot,
|
|
9371
9373
|
properties: [
|
|
9372
9374
|
v.create({
|
|
9373
9375
|
name: "interactionId",
|
|
@@ -9396,7 +9398,7 @@ const ne = new le(), $t = "_Interaction_", yt = "_Activity_", ke = I.create({
|
|
|
9396
9398
|
})
|
|
9397
9399
|
]
|
|
9398
9400
|
}), Te = I.create({
|
|
9399
|
-
name:
|
|
9401
|
+
name: gt,
|
|
9400
9402
|
properties: [
|
|
9401
9403
|
v.create({
|
|
9402
9404
|
name: "name",
|
|
@@ -9520,7 +9522,7 @@ class Xi {
|
|
|
9520
9522
|
}
|
|
9521
9523
|
}
|
|
9522
9524
|
async createActivity(t) {
|
|
9523
|
-
return this.controller.system.storage.create(
|
|
9525
|
+
return this.controller.system.storage.create(gt, {
|
|
9524
9526
|
...t,
|
|
9525
9527
|
state: t.state,
|
|
9526
9528
|
refs: t.refs
|
|
@@ -9530,20 +9532,20 @@ class Xi {
|
|
|
9530
9532
|
const i = {
|
|
9531
9533
|
...e
|
|
9532
9534
|
};
|
|
9533
|
-
return delete i.state, delete i.refs, e.state && (i.state = e.state), e.refs && (i.refs = e.refs), this.controller.system.storage.update(
|
|
9535
|
+
return delete i.state, delete i.refs, e.state && (i.state = e.state), e.refs && (i.refs = e.refs), this.controller.system.storage.update(gt, t, i);
|
|
9534
9536
|
}
|
|
9535
9537
|
async getActivity(t) {
|
|
9536
|
-
return (await this.controller.system.storage.find(
|
|
9538
|
+
return (await this.controller.system.storage.find(gt, t, void 0, ["*"])).map((e) => ({
|
|
9537
9539
|
...e,
|
|
9538
9540
|
state: e.state,
|
|
9539
9541
|
refs: e.refs
|
|
9540
9542
|
}));
|
|
9541
9543
|
}
|
|
9542
9544
|
async saveEvent(t) {
|
|
9543
|
-
return this.controller.system.storage.create(
|
|
9545
|
+
return this.controller.system.storage.create(Ot, t);
|
|
9544
9546
|
}
|
|
9545
9547
|
async getEvent(t) {
|
|
9546
|
-
return (await this.controller.system.storage.find(
|
|
9548
|
+
return (await this.controller.system.storage.find(Ot, t, void 0, ["*"])).map((e) => ({
|
|
9547
9549
|
...e
|
|
9548
9550
|
}));
|
|
9549
9551
|
}
|
|
@@ -9560,12 +9562,12 @@ class Xi {
|
|
|
9560
9562
|
return this.interactionCallsByName.get(t);
|
|
9561
9563
|
}
|
|
9562
9564
|
}
|
|
9563
|
-
const
|
|
9565
|
+
const zt = new le();
|
|
9564
9566
|
function zi() {
|
|
9565
|
-
return
|
|
9567
|
+
return zt.getStore()?.effects;
|
|
9566
9568
|
}
|
|
9567
9569
|
function ce(u) {
|
|
9568
|
-
const t =
|
|
9570
|
+
const t = zt.getStore();
|
|
9569
9571
|
t?.effects && t.effects.push(...u);
|
|
9570
9572
|
}
|
|
9571
9573
|
const Ar = "User";
|
|
@@ -9577,10 +9579,10 @@ class Ae {
|
|
|
9577
9579
|
return new Ae(t);
|
|
9578
9580
|
}
|
|
9579
9581
|
}
|
|
9580
|
-
const
|
|
9582
|
+
const Ft = "_isDeleted_", Sr = {
|
|
9581
9583
|
create() {
|
|
9582
9584
|
return v.create({
|
|
9583
|
-
name:
|
|
9585
|
+
name: Ft,
|
|
9584
9586
|
type: "boolean"
|
|
9585
9587
|
});
|
|
9586
9588
|
}
|
|
@@ -9638,7 +9640,7 @@ class Er {
|
|
|
9638
9640
|
}
|
|
9639
9641
|
}
|
|
9640
9642
|
async applyResult(t, e, i) {
|
|
9641
|
-
if (!(e instanceof
|
|
9643
|
+
if (!(e instanceof wt)) {
|
|
9642
9644
|
if (t.type === "global")
|
|
9643
9645
|
return this.system.storage.dict.set(t.id.name, e);
|
|
9644
9646
|
if (t.type === "entity") {
|
|
@@ -9657,12 +9659,12 @@ class Er {
|
|
|
9657
9659
|
await this.system.storage.create(r.id.name, a);
|
|
9658
9660
|
} else {
|
|
9659
9661
|
const r = t;
|
|
9660
|
-
r.id.name ===
|
|
9662
|
+
r.id.name === Ft && e ? await this.system.storage.delete(r.host.name, R.atom({ key: "id", value: ["=", i.id] })) : await this.system.storage.update(r.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [r.id.name]: e });
|
|
9661
9663
|
}
|
|
9662
9664
|
}
|
|
9663
9665
|
}
|
|
9664
9666
|
async applyResultPatch(t, e, i) {
|
|
9665
|
-
if (e instanceof
|
|
9667
|
+
if (e instanceof wt || e === void 0) return;
|
|
9666
9668
|
const r = Array.isArray(e) ? e : [e];
|
|
9667
9669
|
for (const s of r) {
|
|
9668
9670
|
if (t.type === "global")
|
|
@@ -9680,13 +9682,13 @@ class Er {
|
|
|
9680
9682
|
}
|
|
9681
9683
|
} else {
|
|
9682
9684
|
const a = t;
|
|
9683
|
-
a.id.name ===
|
|
9685
|
+
a.id.name === Ft && s.data ? (T(s.type !== "delete", "Hard deletion property cannot be deleted"), await this.system.storage.delete(a.host.name, R.atom({ key: "id", value: ["=", i.id] }))) : s.type === "insert" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "update" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "delete" && await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: null });
|
|
9684
9686
|
}
|
|
9685
9687
|
}
|
|
9686
9688
|
}
|
|
9687
9689
|
async callInteraction(t, e, i, r) {
|
|
9688
9690
|
try {
|
|
9689
|
-
const s = { effects: [] }, a = await
|
|
9691
|
+
const s = { effects: [] }, a = await zt.run(s, async () => i ? await this.activityManager.callActivityInteraction(i, t, r, e) : await this.activityManager.callInteraction(t, e));
|
|
9690
9692
|
if (a.effects = s.effects, a.error && this.forceThrowInteractionError)
|
|
9691
9693
|
throw a.error;
|
|
9692
9694
|
return await this.runRecordChangeSideEffects(a, this.system.logger), a;
|
|
@@ -9846,7 +9848,7 @@ class tr {
|
|
|
9846
9848
|
}
|
|
9847
9849
|
}
|
|
9848
9850
|
var er = /* @__PURE__ */ ((u) => (u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u))(er || {});
|
|
9849
|
-
class
|
|
9851
|
+
class Yt {
|
|
9850
9852
|
constructor(t = 0) {
|
|
9851
9853
|
this.level = t;
|
|
9852
9854
|
}
|
|
@@ -9857,11 +9859,11 @@ class zt {
|
|
|
9857
9859
|
this.level >= 0 && console.error({ type: t, name: e, sql: i, params: r, error: s });
|
|
9858
9860
|
}
|
|
9859
9861
|
child() {
|
|
9860
|
-
return new
|
|
9862
|
+
return new Yt(this.level);
|
|
9861
9863
|
}
|
|
9862
9864
|
}
|
|
9863
9865
|
var ir = /* @__PURE__ */ ((u) => (u[u.MUTE = -1] = "MUTE", u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u[u.DEBUG = 2] = "DEBUG", u))(ir || {});
|
|
9864
|
-
class
|
|
9866
|
+
class Zt {
|
|
9865
9867
|
constructor(t = 0) {
|
|
9866
9868
|
this.level = t;
|
|
9867
9869
|
}
|
|
@@ -9875,10 +9877,10 @@ class Yt {
|
|
|
9875
9877
|
this.level >= 2 && console.debug(`[DEBUG] ${t}: ${e}`, i);
|
|
9876
9878
|
}
|
|
9877
9879
|
child(t) {
|
|
9878
|
-
return new
|
|
9880
|
+
return new Zt(this.level);
|
|
9879
9881
|
}
|
|
9880
9882
|
}
|
|
9881
|
-
const Ir = new
|
|
9883
|
+
const Ir = new Yt(), rr = new Zt();
|
|
9882
9884
|
class Cr {
|
|
9883
9885
|
constructor(t, e = rr) {
|
|
9884
9886
|
this.logger = e, this.conceptClass = /* @__PURE__ */ new Map(), this.storage = new tr(t);
|
|
@@ -9920,11 +9922,11 @@ class Cr {
|
|
|
9920
9922
|
}
|
|
9921
9923
|
}
|
|
9922
9924
|
export {
|
|
9923
|
-
|
|
9925
|
+
gt as ACTIVITY_RECORD,
|
|
9924
9926
|
qe as ALL_ATTR_SYMBOL,
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9927
|
+
xt as ASYNC_TASK_RECORD,
|
|
9928
|
+
kt as Action,
|
|
9929
|
+
qt as Activity,
|
|
9928
9930
|
Y as ActivityCall,
|
|
9929
9931
|
Z as ActivityGroup,
|
|
9930
9932
|
Gi as ActivityInteractionRelation,
|
|
@@ -9935,7 +9937,7 @@ export {
|
|
|
9935
9937
|
_ as AttributeInfo,
|
|
9936
9938
|
C as AttributeQuery,
|
|
9937
9939
|
U as Attributive,
|
|
9938
|
-
|
|
9940
|
+
vt as Attributives,
|
|
9939
9941
|
ct as Average,
|
|
9940
9942
|
Vi as AverageHandles,
|
|
9941
9943
|
dr as BaseKlass,
|
|
@@ -9948,31 +9950,31 @@ export {
|
|
|
9948
9950
|
Re as ComputationResultAsync,
|
|
9949
9951
|
be as ComputationResultFullRecompute,
|
|
9950
9952
|
we as ComputationResultResolved,
|
|
9951
|
-
|
|
9953
|
+
wt as ComputationResultSkip,
|
|
9952
9954
|
ae as ComputationStateError,
|
|
9953
|
-
|
|
9955
|
+
Bt as Condition,
|
|
9954
9956
|
O as ConditionError,
|
|
9955
|
-
|
|
9957
|
+
At as Conditions,
|
|
9956
9958
|
Er as Controller,
|
|
9957
9959
|
ot as Count,
|
|
9958
9960
|
Si as CountHandles,
|
|
9959
|
-
|
|
9961
|
+
Gt as Custom,
|
|
9960
9962
|
_i as CustomHandles,
|
|
9961
|
-
|
|
9963
|
+
Yt as DBConsoleLogger,
|
|
9962
9964
|
er as DBLogLevel,
|
|
9963
9965
|
oi as DBSetup,
|
|
9964
9966
|
Tr as DELETED_STATE,
|
|
9965
9967
|
q as DICTIONARY_RECORD,
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9968
|
+
_t as DataAttributive,
|
|
9969
|
+
Kt as DataAttributives,
|
|
9970
|
+
Qt as Dictionary,
|
|
9969
9971
|
ci as DictionaryEntity,
|
|
9970
9972
|
I as Entity,
|
|
9971
9973
|
Li as EntityCustomHandle,
|
|
9972
9974
|
je as EntityQueryHandle,
|
|
9973
9975
|
Ue as EntityToTableMap,
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
+
Xt as Equation,
|
|
9977
|
+
Wt as Event,
|
|
9976
9978
|
lt as Every,
|
|
9977
9979
|
wi as EveryHandles,
|
|
9978
9980
|
M as Expression,
|
|
@@ -9988,17 +9990,17 @@ export {
|
|
|
9988
9990
|
hi as GlobalStateMachineHandle,
|
|
9989
9991
|
Pi as GlobalSumHandle,
|
|
9990
9992
|
mi as GlobalWeightedSummationHandle,
|
|
9991
|
-
|
|
9993
|
+
Ft as HARD_DELETION_PROPERTY_NAME,
|
|
9992
9994
|
Sr as HardDeletionProperty,
|
|
9993
9995
|
ie as ID_ATTR,
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9996
|
+
Ot as INTERACTION_RECORD,
|
|
9997
|
+
Nt as Inequality,
|
|
9998
|
+
Lt as Interaction,
|
|
9997
9999
|
ve as InteractionCall,
|
|
9998
10000
|
ke as InteractionEventEntity,
|
|
9999
|
-
|
|
10001
|
+
Dt as KlassByName,
|
|
10000
10002
|
f as LINK_SYMBOL,
|
|
10001
|
-
|
|
10003
|
+
Rt as LinkInfo,
|
|
10002
10004
|
m as MatchExp,
|
|
10003
10005
|
Le as Modifier,
|
|
10004
10006
|
Cr as MonoSystem,
|
|
@@ -10007,9 +10009,9 @@ export {
|
|
|
10007
10009
|
Q as NewRecordData,
|
|
10008
10010
|
br as PHASE_AFTER_ALL,
|
|
10009
10011
|
gr as PHASE_BEFORE_ALL,
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10012
|
+
It as PHASE_NORMAL,
|
|
10013
|
+
jt as Payload,
|
|
10014
|
+
Ht as PayloadItem,
|
|
10013
10015
|
v as Property,
|
|
10014
10016
|
vi as PropertyAnyHandle,
|
|
10015
10017
|
Di as PropertyAverageHandle,
|
|
@@ -10019,7 +10021,7 @@ export {
|
|
|
10019
10021
|
xi as PropertyRealTimeComputation,
|
|
10020
10022
|
pi as PropertyStateMachineHandle,
|
|
10021
10023
|
$i as PropertySumHandle,
|
|
10022
|
-
|
|
10024
|
+
Vt as PropertyTypes,
|
|
10023
10025
|
yi as PropertyWeightedSummationHandle,
|
|
10024
10026
|
me as Query,
|
|
10025
10027
|
fe as QueryItem,
|
|
@@ -10034,31 +10036,31 @@ export {
|
|
|
10034
10036
|
He as RecordQueryAgent,
|
|
10035
10037
|
L as RecordQueryTree,
|
|
10036
10038
|
Ei as RecordsTransformHandle,
|
|
10037
|
-
|
|
10039
|
+
bt as RecursiveContext,
|
|
10038
10040
|
ye as RefContainer,
|
|
10039
10041
|
P as Relation,
|
|
10040
10042
|
qi as RelationCustomHandle,
|
|
10041
10043
|
X as SYSTEM_RECORD,
|
|
10042
10044
|
Ji as Scheduler,
|
|
10043
|
-
|
|
10045
|
+
Ut as SideEffect,
|
|
10044
10046
|
st as StateMachine,
|
|
10045
10047
|
fi as StateMachineHandles,
|
|
10046
10048
|
K as StateNode,
|
|
10047
|
-
|
|
10049
|
+
Jt as StateTransfer,
|
|
10048
10050
|
nt as Summation,
|
|
10049
10051
|
Oi as SummationHandles,
|
|
10050
|
-
|
|
10052
|
+
Zt as SystemConsoleLogger,
|
|
10051
10053
|
ni as SystemEntity,
|
|
10052
10054
|
ir as SystemLogLevel,
|
|
10053
10055
|
he as Transfer,
|
|
10054
|
-
|
|
10056
|
+
Tt as Transform,
|
|
10055
10057
|
Ii as TransformHandles,
|
|
10056
10058
|
Ar as USER_ENTITY,
|
|
10057
10059
|
at as WeightedSummation,
|
|
10058
10060
|
gi as WeightedSummationHandles,
|
|
10059
10061
|
ce as addToCurrentEffects,
|
|
10060
10062
|
T as assert,
|
|
10061
|
-
|
|
10063
|
+
zt as asyncEffectsContext,
|
|
10062
10064
|
ne as asyncInteractionContext,
|
|
10063
10065
|
mr as boolExpToAttributives,
|
|
10064
10066
|
or as clearAllInstances,
|
|
@@ -10067,7 +10069,7 @@ export {
|
|
|
10067
10069
|
lr as createInstancesFromString,
|
|
10068
10070
|
yr as createUserRoleAttributive,
|
|
10069
10071
|
Ir as dbConsoleLogger,
|
|
10070
|
-
|
|
10072
|
+
mt as deepClone,
|
|
10071
10073
|
Nr as everyAsync,
|
|
10072
10074
|
di as everyWithErrorAsync,
|
|
10073
10075
|
Rr as filterMap,
|