@akagilnc/pi-workflow-roles 0.1.5216 → 0.1.5241
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/CLAUDE.md +3 -0
- package/README.md +1 -1
- package/dist/acp-host/production-host.js +658 -829
- package/dist/engine-detour-usage.js +4 -16
- package/dist/headless-host/production-host.js +777 -862
- package/dist/host-session-record.js +303 -0
- package/dist/pi/role-turn-host.js +1 -21
- package/dist/public-cli/main.js +200 -487
- package/dist/public-cli/post-admission.js +11 -60
- package/dist/sitian-appender.js +10 -155
- package/package.json +1 -1
- package/src/acp-host/role-turn-host.ts +36 -108
- package/src/engine-detour-usage.ts +4 -16
- package/src/external-host-turn-loop.ts +2 -18
- package/src/headless-host/role-turn-host.ts +67 -31
- package/src/host-contracts.ts +0 -15
- package/src/host-session-record.ts +325 -25
- package/src/notary-role.ts +0 -1
- package/src/pi/role-turn-host.ts +1 -25
- package/src/public-cli/countersign-run.ts +4 -3
- package/src/public-cli/post-admission.ts +10 -69
- package/src/public-role-summons.ts +1 -2
- package/src/role-envelope.ts +2 -2
- package/src/role-runtime.ts +0 -14
- package/src/sitian-appender.ts +16 -205
- package/dist/host-transition-prior-native.js +0 -78
- package/dist/public-cli/case-dossier-delivery.js +0 -109
- package/src/host-transition-prior-native.ts +0 -80
- package/src/pi/pi-normalization.ts +0 -291
- package/src/public-cli/case-dossier-delivery.ts +0 -147
|
@@ -154,7 +154,7 @@ export async function readEngineDetourToolUsage(input) {
|
|
|
154
154
|
...(input.cwd === undefined ? {} : { cwd: input.cwd }),
|
|
155
155
|
});
|
|
156
156
|
const { records } = await readSitianRecords(recordFile);
|
|
157
|
-
const
|
|
157
|
+
const callsByToolCallId = new Map();
|
|
158
158
|
for (const record of records) {
|
|
159
159
|
if (record.kind !== ENGINE_DETOUR_CALL_KIND)
|
|
160
160
|
continue;
|
|
@@ -176,8 +176,10 @@ export async function readEngineDetourToolUsage(input) {
|
|
|
176
176
|
const fact = callFactFromSitianPayload(record.payload, pointer);
|
|
177
177
|
if (fact === undefined)
|
|
178
178
|
continue;
|
|
179
|
-
|
|
179
|
+
// ADR 0086: Reader deduplicates by toolCallId within the invocation scope
|
|
180
|
+
callsByToolCallId.set(fact.toolCallId, fact);
|
|
180
181
|
}
|
|
182
|
+
const calls = Array.from(callsByToolCallId.values());
|
|
181
183
|
return { callCount: calls.length, calls };
|
|
182
184
|
}
|
|
183
185
|
/**
|
|
@@ -226,20 +228,6 @@ export async function readInvocationEngineMounted(runDirectory) {
|
|
|
226
228
|
return false;
|
|
227
229
|
return typeof raw.engine === "string" && raw.engine.trim() !== "";
|
|
228
230
|
}
|
|
229
|
-
/**
|
|
230
|
-
* Selected host from the admission invocation page — for post-admission
|
|
231
|
-
* host-transition classification only. In-turn tools take host from the shared
|
|
232
|
-
* Host envelope (RoleTurnRequest / HostContext), never this reader.
|
|
233
|
-
* Undefined when absent — callers must not invent "pi".
|
|
234
|
-
*/
|
|
235
|
-
export function readInvocationSelectedHost(runDirectory) {
|
|
236
|
-
const raw = readInvocationRecord(runDirectory);
|
|
237
|
-
if (raw === undefined)
|
|
238
|
-
return undefined;
|
|
239
|
-
return typeof raw.host === "string" && raw.host.trim() !== ""
|
|
240
|
-
? raw.host.trim()
|
|
241
|
-
: undefined;
|
|
242
|
-
}
|
|
243
231
|
/** Merge usage into decisiveFacts without touching role payloads. */
|
|
244
232
|
export function withEngineDetourToolUsageFact(outcome, usage) {
|
|
245
233
|
if (usage === undefined)
|