@lmzhen/dsh-evolution-core 0.59.5 → 0.59.6
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/lib/{mutation-storage-adapter-z1_hyrQn.js → mutation-storage-adapter-Cq1bmS1E.js} +8 -3
- package/lib/skills.js +483 -104
- package/lib/types/mutation-unit.d.ts +4 -0
- package/lib/types/mutation-unit.js +9 -3
- package/lib/types/skill-observation.d.ts +4 -5
- package/lib/types/skill-observation.js +18 -2
- package/lib/types/skill-store.d.ts +36 -0
- package/lib/types/skill-store.js +141 -10
- package/lib/types/skill-write-plan.d.ts +80 -0
- package/lib/types/skill-write-plan.js +2 -0
- package/lib/types/skill-write-service.d.ts +84 -2
- package/lib/types/skill-write-service.js +207 -34
- package/lib/types/skills.d.ts +2 -0
- package/lib/types/skills.js +2 -0
- package/lib/types/system-skill-writer.d.ts +21 -0
- package/lib/types/system-skill-writer.js +15 -0
- package/lib/write.js +1 -1
- package/package.json +3 -3
|
@@ -340,6 +340,7 @@ var MutationUnit = class {
|
|
|
340
340
|
lock;
|
|
341
341
|
targetKeys;
|
|
342
342
|
targetKeysForSnapshot;
|
|
343
|
+
targetKeyResolver;
|
|
343
344
|
journal;
|
|
344
345
|
snapshots;
|
|
345
346
|
claim;
|
|
@@ -376,6 +377,10 @@ var MutationUnit = class {
|
|
|
376
377
|
now: this.now
|
|
377
378
|
});
|
|
378
379
|
}
|
|
380
|
+
async resolveTargetKeys(keys) {
|
|
381
|
+
if (keys === void 0 || this.targetKeyResolver === void 0) return keys;
|
|
382
|
+
return await this.targetKeyResolver(keys);
|
|
383
|
+
}
|
|
379
384
|
preview(request) {
|
|
380
385
|
const validation = validateMutationRequest(request, this.limits);
|
|
381
386
|
return {
|
|
@@ -407,7 +412,7 @@ var MutationUnit = class {
|
|
|
407
412
|
return await this.serial(async () => {
|
|
408
413
|
let lease;
|
|
409
414
|
try {
|
|
410
|
-
lease = await this.lock.acquire(this.targetKeys);
|
|
415
|
+
lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeys));
|
|
411
416
|
} catch (error) {
|
|
412
417
|
return {
|
|
413
418
|
ok: false,
|
|
@@ -650,7 +655,7 @@ var MutationUnit = class {
|
|
|
650
655
|
return await this.serial(async () => {
|
|
651
656
|
let lease;
|
|
652
657
|
try {
|
|
653
|
-
lease = await this.lock.acquire(this.targetKeysForSnapshot?.(snapshot) ?? this.targetKeys);
|
|
658
|
+
lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeysForSnapshot?.(snapshot) ?? this.targetKeys));
|
|
654
659
|
} catch (error) {
|
|
655
660
|
return {
|
|
656
661
|
ok: false,
|
|
@@ -778,7 +783,7 @@ var MutationUnit = class {
|
|
|
778
783
|
return await this.serial(async () => {
|
|
779
784
|
let lease;
|
|
780
785
|
try {
|
|
781
|
-
lease = await this.lock.acquire(this.targetKeys);
|
|
786
|
+
lease = await this.lock.acquire(await this.resolveTargetKeys(this.targetKeys));
|
|
782
787
|
} catch (error) {
|
|
783
788
|
return {
|
|
784
789
|
ok: false,
|