dsh-mnemon 0.5.43 → 0.5.44
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/bin/repair-legacy-session.mjs +18 -2
- package/lib/bundle.js +1 -1
- package/lib/client.js +448 -84
- package/lib/index.js +270 -76
- package/lib/{starter-resolution-CTY14Exj.js → starter-resolution-LTLQsJPW.js} +2 -2
- package/lib/starter.js +1 -1
- package/lib/types/src/client/locales.d.ts +15 -0
- package/lib/types/src/host/protocol.d.ts +6 -0
- package/locale/detail.en.md +7 -0
- package/locale/detail.zh.md +7 -0
- package/locale/en.json +3 -1
- package/locale/zh.json +2 -1
- package/package.json +3 -3
|
@@ -637,6 +637,8 @@ async function repairIdleProbeSession(entries, original, compressed, input, outp
|
|
|
637
637
|
const pending = new Map()
|
|
638
638
|
const roots = new Set()
|
|
639
639
|
let openTurn
|
|
640
|
+
let openStep
|
|
641
|
+
let completedStep = false
|
|
640
642
|
let completed = false
|
|
641
643
|
const refuse = () => { throw new Error('Unrecognized or incomplete out-of-turn PTC audit; no output written.') }
|
|
642
644
|
for (const entry of entries.slice(1)) {
|
|
@@ -647,17 +649,31 @@ async function repairIdleProbeSession(entries, original, compressed, input, outp
|
|
|
647
649
|
if (row.type === 'turn/start') {
|
|
648
650
|
if (openTurn !== undefined) refuse()
|
|
649
651
|
openTurn = row.data.turn
|
|
652
|
+
completedStep = false
|
|
650
653
|
} else {
|
|
651
654
|
if (openTurn !== row.data.turn) refuse()
|
|
652
655
|
openTurn = undefined
|
|
653
656
|
completed = true
|
|
654
657
|
}
|
|
658
|
+
openStep = undefined
|
|
655
659
|
}
|
|
656
|
-
if (
|
|
660
|
+
if (row.type === 'step/start' || row.type === 'step/end') {
|
|
661
|
+
assertUniqueJson(entry.line, row)
|
|
662
|
+
if (pending.size || openTurn !== row.data?.turn || !count(row.data?.step)) refuse()
|
|
663
|
+
if (row.type === 'step/start') {
|
|
664
|
+
if (openStep !== undefined) refuse()
|
|
665
|
+
openStep = row.data.step
|
|
666
|
+
} else {
|
|
667
|
+
if (openStep !== row.data.step) refuse()
|
|
668
|
+
openStep = undefined
|
|
669
|
+
completedStep = true
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
if (!['tool/ptc-dispatch-start', 'tool/ptc-dispatch'].includes(row.type) || openStep !== undefined) continue
|
|
657
673
|
assertUniqueJson(entry.line, row)
|
|
658
674
|
const data = row.data
|
|
659
675
|
const start = row.type === 'tool/ptc-dispatch-start'
|
|
660
|
-
if (!completed || !exactKeys(row, ['type', 'seq', 'time', 'data']) || !count(row.seq) || !integer(row.time) ||
|
|
676
|
+
if (!(openTurn === undefined ? completed : completedStep) || !exactKeys(row, ['type', 'seq', 'time', 'data']) || !count(row.seq) || !integer(row.time) ||
|
|
661
677
|
!exactKeys(data, ['rootCallId', 'parentCallId', 'subCallId', 'name', 'arguments', ...(start ? [] : ['isError', 'content'])], start ? [] : ['error', 'meta']) ||
|
|
662
678
|
!uuid.test(data.rootCallId) || data.parentCallId !== data.rootCallId || data.subCallId !== `${data.rootCallId}:ptc:1` ||
|
|
663
679
|
data.name !== 'mnemon_subagent_result' || !exactKeys(data.arguments, ['requestId', 'result']) ||
|
package/lib/bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as prepareStarterResolution } from "./starter-resolution-
|
|
1
|
+
import { t as prepareStarterResolution } from "./starter-resolution-LTLQsJPW.js";
|
|
2
2
|
//#region src/bundle.ts
|
|
3
3
|
const groupKey = Symbol.for("cordis.group");
|
|
4
4
|
const init = Symbol.for("cordis.init");
|