pi-daddy 0.50.0 → 0.52.0
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/CHANGELOG.md +12 -0
- package/README.md +13 -20
- package/dist/governance/approval-prompt.d.ts +4 -0
- package/dist/governance/approval-prompt.d.ts.map +1 -1
- package/dist/governance/approval-prompt.js +4 -5
- package/dist/governance/approval-prompt.js.map +1 -1
- package/dist/governance/initiative-coordinator.d.ts +5 -0
- package/dist/governance/initiative-coordinator.d.ts.map +1 -1
- package/dist/governance/initiative-coordinator.js +16 -0
- package/dist/governance/initiative-coordinator.js.map +1 -1
- package/dist/governance/permission-question.d.ts +4 -0
- package/dist/governance/permission-question.d.ts.map +1 -0
- package/dist/governance/permission-question.js +102 -0
- package/dist/governance/permission-question.js.map +1 -0
- package/dist/kernel/chain.d.ts +1 -0
- package/dist/kernel/chain.d.ts.map +1 -1
- package/dist/kernel/chain.js.map +1 -1
- package/dist/kernel/dashboard-observation.d.ts +15 -5
- package/dist/kernel/dashboard-observation.d.ts.map +1 -1
- package/dist/kernel/dashboard-observation.js.map +1 -1
- package/dist/products/activity-summary.d.ts +8 -0
- package/dist/products/activity-summary.d.ts.map +1 -0
- package/dist/products/activity-summary.js +101 -0
- package/dist/products/activity-summary.js.map +1 -0
- package/dist/products/activity-timeline.d.ts +4 -1
- package/dist/products/activity-timeline.d.ts.map +1 -1
- package/dist/products/activity-timeline.js +9 -1
- package/dist/products/activity-timeline.js.map +1 -1
- package/dist/products/dashboard-activity.d.ts +9 -0
- package/dist/products/dashboard-activity.d.ts.map +1 -0
- package/dist/products/dashboard-activity.js +119 -0
- package/dist/products/dashboard-activity.js.map +1 -0
- package/dist/products/dashboard-cli.d.ts +2 -1
- package/dist/products/dashboard-cli.d.ts.map +1 -1
- package/dist/products/dashboard-cli.js +17 -6
- package/dist/products/dashboard-cli.js.map +1 -1
- package/dist/products/dashboard-components.d.ts +10 -0
- package/dist/products/dashboard-components.d.ts.map +1 -0
- package/dist/products/dashboard-components.js +196 -0
- package/dist/products/dashboard-components.js.map +1 -0
- package/dist/products/dashboard-display-controls.d.ts.map +1 -1
- package/dist/products/dashboard-display-controls.js +43 -3
- package/dist/products/dashboard-display-controls.js.map +1 -1
- package/dist/products/dashboard-layout.d.ts +6 -0
- package/dist/products/dashboard-layout.d.ts.map +1 -0
- package/dist/products/dashboard-layout.js +61 -0
- package/dist/products/dashboard-layout.js.map +1 -0
- package/dist/products/dashboard-panels.d.ts +4 -0
- package/dist/products/dashboard-panels.d.ts.map +1 -1
- package/dist/products/dashboard-panels.js +321 -120
- package/dist/products/dashboard-panels.js.map +1 -1
- package/dist/products/dashboard-recap.d.ts +4 -0
- package/dist/products/dashboard-recap.d.ts.map +1 -0
- package/dist/products/dashboard-recap.js +43 -0
- package/dist/products/dashboard-recap.js.map +1 -0
- package/dist/products/dashboard-screen.d.ts +11 -3
- package/dist/products/dashboard-screen.d.ts.map +1 -1
- package/dist/products/dashboard-screen.js +224 -62
- package/dist/products/dashboard-screen.js.map +1 -1
- package/dist/products/dashboard-session-client.d.ts +6 -5
- package/dist/products/dashboard-session-client.d.ts.map +1 -1
- package/dist/products/dashboard-session-client.js.map +1 -1
- package/dist/products/ecosystem-versions.d.ts +2 -0
- package/dist/products/ecosystem-versions.d.ts.map +1 -1
- package/extensions/activity-timeline.ts +7 -1
- package/extensions/approvals.ts +7 -0
- package/extensions/dashboard-live.ts +45 -5
- package/extensions/dashboard-observation.ts +1 -3
- package/extensions/delegate-chain.ts +2 -0
- package/extensions/delegation-artifacts.ts +34 -4
- package/extensions/delegation-operations.ts +12 -4
- package/extensions/delegation.ts +4 -0
- package/extensions/ecosystem-versions.ts +25 -3
- package/extensions/execute-child.ts +4 -0
- package/extensions/initiative-handoff.ts +59 -0
- package/extensions/initiative-runtime.ts +39 -1
- package/extensions/run-delegation.ts +2 -0
- package/extensions/runtime-snapshot.ts +8 -4
- package/extensions/session.ts +2 -2
- package/package.json +1 -1
- package/src/governance/approval-prompt.ts +7 -6
- package/src/governance/initiative-coordinator.ts +16 -0
- package/src/governance/permission-question.ts +108 -0
- package/src/kernel/chain.ts +1 -0
- package/src/kernel/dashboard-observation.ts +15 -1
- package/src/products/activity-summary.ts +101 -0
- package/src/products/activity-timeline.ts +11 -0
- package/src/products/dashboard-activity.ts +136 -0
- package/src/products/dashboard-cli.ts +29 -7
- package/src/products/dashboard-components.ts +219 -0
- package/src/products/dashboard-display-controls.ts +37 -3
- package/src/products/dashboard-layout.ts +71 -0
- package/src/products/dashboard-panels.ts +359 -145
- package/src/products/dashboard-recap.ts +48 -0
- package/src/products/dashboard-screen.ts +264 -68
- package/src/products/dashboard-session-client.ts +7 -1
- package/src/products/ecosystem-versions.ts +2 -0
|
@@ -50,6 +50,11 @@ export type DashboardSessionAction = ({
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
export declare function dashboardSessionRequest(socketPath: string, token: string, request: DashboardSessionAction): Promise<DashboardSessionSnapshot>;
|
|
53
|
+
export type DashboardAcknowledgment = {
|
|
54
|
+
action: string;
|
|
55
|
+
state: "pending" | "applied" | "refused" | "unconfirmed";
|
|
56
|
+
effect: string;
|
|
57
|
+
};
|
|
53
58
|
/** Controls use only a connected owner; last observations remain explicitly disconnected evidence. */
|
|
54
59
|
export declare function createDashboardConnection(request?: (action: DashboardSessionAction) => Promise<DashboardSessionSnapshot>): {
|
|
55
60
|
state: {
|
|
@@ -57,11 +62,7 @@ export declare function createDashboardConnection(request?: (action: DashboardSe
|
|
|
57
62
|
lastObserved?: DashboardSessionSnapshot;
|
|
58
63
|
pending: boolean;
|
|
59
64
|
error?: string;
|
|
60
|
-
acknowledgment?:
|
|
61
|
-
action: string;
|
|
62
|
-
state: "pending" | "applied" | "refused" | "unconfirmed";
|
|
63
|
-
effect: string;
|
|
64
|
-
};
|
|
65
|
+
acknowledgment?: DashboardAcknowledgment;
|
|
65
66
|
};
|
|
66
67
|
refresh(): Promise<void>;
|
|
67
68
|
change(action: Exclude<DashboardSessionAction, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-session-client.d.ts","sourceRoot":"","sources":["../../src/products/dashboard-session-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAGjE,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,yBAAyB,CAAC;IACxC,QAAQ,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5D,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,yBAAyB,CAAC;IACrC,IAAI,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAAA;KAAE,CAAC;IAC1E,gBAAgB,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC9E;AAED,MAAM,MAAM,sBAAsB,GAAG,CACjC;IAAE,MAAM,EAAE,KAAK,CAAA;CAAE,GACjB;IAAE,MAAM,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAChC;IAAE,MAAM,EAAE,UAAU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aAAa,CAAC,UAAU;6BACrC;yBACF;wBACH,CAAC,CAAC,EAAE,CAAC;iBACR,CAAC,CAAC;gBACH,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;oBAAE,MAAM,KAAK,CAAC,gEAAgE,CAAC,CAAC;gBACrG,KAAK,CAAC,cAAc,CAAC,KAAK;oBACxB,MAAM,CAAC,MAAM,KAAK,SAAS;wBACzB,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO;4BAC9B,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO;gCACjD,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,SAAS;wBACf,CAAC,CAAC,SAAS,CAAC;gBAChB,OAAO,IAAI,CAAC;YACd,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC;gBAC3B,KAAK,CAAC,cAAc,CAAC,KAAK,GAAG,aAAa,CAAC;gBAC3C,KAAK,CAAC,KAAK,GAAG,gEAAgE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvI,OAAO,KAAK,CAAC;YACf,CAAC;oBAAS,CAAC;gBACT,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;YACxB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -10,6 +10,8 @@ export interface EcosystemVersionRow {
|
|
|
10
10
|
state: "current" | "reload-required" | "not-reported" | "unavailable" | "multiple";
|
|
11
11
|
commands: string[];
|
|
12
12
|
note?: string;
|
|
13
|
+
/** Pi reports the Bookie command from this installed package in the current session. */
|
|
14
|
+
commandAvailable?: boolean;
|
|
13
15
|
}
|
|
14
16
|
export interface EcosystemVersions {
|
|
15
17
|
rows: EcosystemVersionRow[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ecosystem-versions.d.ts","sourceRoot":"","sources":["../../src/products/ecosystem-versions.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,MAAM,kBAAkB,GAC5B,IAAI,GAAG,UAAU,GAAG,qBAAqB,GAAG,eAAe,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AACzG,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,kBAAkB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,SAAS,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,UAAU,CAAC;IACnF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ecosystem-versions.d.ts","sourceRoot":"","sources":["../../src/products/ecosystem-versions.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,MAAM,kBAAkB,GAC5B,IAAI,GAAG,UAAU,GAAG,qBAAqB,GAAG,eAAe,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AACzG,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,kBAAkB,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,EAAE,SAAS,GAAG,iBAAiB,GAAG,cAAc,GAAG,aAAa,GAAG,UAAU,CAAC;IACnF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AACD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
+
import { observedPurpose } from "../src/products/activity-summary.ts";
|
|
5
6
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
6
7
|
import { ENV_EPISODE_ID } from "../src/kernel/env-names.ts";
|
|
7
8
|
import { Type } from "typebox";
|
|
@@ -251,7 +252,12 @@ export function registerActivityTimeline(pi: ExtensionAPI, session?: ActivitySes
|
|
|
251
252
|
const value = event as { toolCallId?: string; toolName?: string; args?: { path?: unknown } };
|
|
252
253
|
if (value.toolCallId && typeof value.args?.path === "string") paths.set(value.toolCallId, value.args.path);
|
|
253
254
|
try {
|
|
254
|
-
if (value.toolName
|
|
255
|
+
if (value.toolName && recorder)
|
|
256
|
+
await recorder.append("tool_started", {
|
|
257
|
+
tool: value.toolName,
|
|
258
|
+
cwd: ctx.cwd,
|
|
259
|
+
dashboardSummary: observedPurpose(value.toolName, value.args, recorder.contentEnabled),
|
|
260
|
+
});
|
|
255
261
|
} catch {
|
|
256
262
|
/* observation cannot affect tool execution */
|
|
257
263
|
}
|
package/extensions/approvals.ts
CHANGED
|
@@ -262,6 +262,13 @@ export async function obtainApprovals(
|
|
|
262
262
|
path,
|
|
263
263
|
task,
|
|
264
264
|
signal,
|
|
265
|
+
project: session.cwd,
|
|
266
|
+
workspace: expectedBinding?.workspace_id,
|
|
267
|
+
recheckReason: pre.expired.includes(capability)
|
|
268
|
+
? "The previous permission expired."
|
|
269
|
+
: pre.scopeMismatched.includes(capability)
|
|
270
|
+
? "The saved permission covers a different request."
|
|
271
|
+
: undefined,
|
|
265
272
|
...(expectedBinding ? { bindingKey: approvalBindingDigest(expectedBinding) } : {}),
|
|
266
273
|
});
|
|
267
274
|
if (outcome.scope === null) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Bounded metadata-only Pi observations work even when optional transcript/diagnostic capture is off. */
|
|
2
|
+
import { dashboardContentEnabled, observedPurpose } from "../src/products/activity-summary.ts";
|
|
2
3
|
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
4
|
import type { DashboardContribution } from "../src/kernel/dashboard-observation.ts";
|
|
4
5
|
import type { DashboardSourceOwner } from "./dashboard-sources.ts";
|
|
@@ -7,9 +8,11 @@ export function registerDashboardLive(pi: ExtensionAPI, current: () => Dashboard
|
|
|
7
8
|
ordinal = 0;
|
|
8
9
|
let turn: DashboardContribution | undefined;
|
|
9
10
|
const activity: DashboardContribution[] = [];
|
|
11
|
+
const calls = new Map<string, { token: number; purpose: string; tool: string }>();
|
|
10
12
|
const reset = () => {
|
|
11
13
|
if (current() !== owner) {
|
|
12
14
|
owner = current();
|
|
15
|
+
calls.clear();
|
|
13
16
|
turn = undefined;
|
|
14
17
|
activity.length = 0;
|
|
15
18
|
ordinal = 0;
|
|
@@ -18,23 +21,27 @@ export function registerDashboardLive(pi: ExtensionAPI, current: () => Dashboard
|
|
|
18
21
|
const record = (kind: string, event: unknown, ctx: ExtensionContext) => {
|
|
19
22
|
reset();
|
|
20
23
|
if (!owner || ctx.sessionManager.getSessionId() !== owner.sessionId) return;
|
|
21
|
-
const value = event as { toolName?: string; isError?: boolean };
|
|
24
|
+
const value = event as { toolName?: string; toolCallId?: string; args?: unknown; isError?: boolean };
|
|
22
25
|
const tool = typeof value.toolName === "string" ? value.toolName.slice(0, 128) : undefined;
|
|
23
26
|
const at = new Date().toISOString();
|
|
24
|
-
if (kind === "agent_start")
|
|
27
|
+
if (kind === "agent_start") {
|
|
28
|
+
calls.clear();
|
|
25
29
|
turn = {
|
|
26
30
|
id: `turn:${++ordinal}`,
|
|
27
31
|
kind: "work",
|
|
28
|
-
label: "
|
|
32
|
+
label: "Pi is working on your request",
|
|
29
33
|
state: "running",
|
|
30
34
|
details: [
|
|
31
35
|
`Observed start: ${at}`,
|
|
32
36
|
`Model: ${ctx.model?.provider ?? "unknown"}/${ctx.model?.id ?? "unknown"}`.slice(0, 240),
|
|
33
37
|
],
|
|
34
38
|
};
|
|
35
|
-
|
|
39
|
+
}
|
|
40
|
+
if (kind === "agent_end" && turn) {
|
|
41
|
+
calls.clear();
|
|
36
42
|
turn = {
|
|
37
43
|
...turn,
|
|
44
|
+
label: "Pi finished its turn",
|
|
38
45
|
state: "settled",
|
|
39
46
|
details: [
|
|
40
47
|
...(turn.details ?? []),
|
|
@@ -42,12 +49,45 @@ export function registerDashboardLive(pi: ExtensionAPI, current: () => Dashboard
|
|
|
42
49
|
"Turn ended; task acceptance and child settlement remain separate.",
|
|
43
50
|
],
|
|
44
51
|
};
|
|
52
|
+
}
|
|
53
|
+
// Pair using Pi's call identity; expose only a local ordinal. Raw arguments and results stay in Pi.
|
|
54
|
+
const callId =
|
|
55
|
+
typeof value.toolCallId === "string" && value.toolCallId.length <= 200 ? value.toolCallId : undefined;
|
|
56
|
+
let call = callId ? calls.get(callId) : undefined;
|
|
57
|
+
if (tool && kind === "tool start") {
|
|
58
|
+
call = {
|
|
59
|
+
token: ++ordinal,
|
|
60
|
+
purpose: observedPurpose(tool, value.args, dashboardContentEnabled(process.env)),
|
|
61
|
+
tool,
|
|
62
|
+
};
|
|
63
|
+
if (callId) {
|
|
64
|
+
calls.set(callId, call);
|
|
65
|
+
if (calls.size > 32) calls.delete(calls.keys().next().value!);
|
|
66
|
+
}
|
|
67
|
+
if (turn?.state === "running") turn = { ...turn, label: call.purpose };
|
|
68
|
+
} else if (kind === "tool end") {
|
|
69
|
+
if (callId) {
|
|
70
|
+
calls.delete(callId);
|
|
71
|
+
if (call?.tool !== tool) call = undefined;
|
|
72
|
+
} else {
|
|
73
|
+
// Without an identity we cannot tell which same-tool action just ended.
|
|
74
|
+
for (const [key, active] of calls) if (active.tool === tool || !tool) calls.delete(key);
|
|
75
|
+
}
|
|
76
|
+
if (turn?.state === "running") {
|
|
77
|
+
const latest = Array.from(calls.values()).at(-1);
|
|
78
|
+
turn = { ...turn, label: latest?.purpose ?? "Pi is working on your request" };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
45
81
|
const item: DashboardContribution = {
|
|
46
82
|
id: `event:${++ordinal}`,
|
|
47
83
|
kind: "status",
|
|
48
84
|
label: tool ? `${tool}: ${kind}` : kind,
|
|
49
85
|
state: value.isError ? "failed" : "observed",
|
|
50
|
-
details: [
|
|
86
|
+
details: [
|
|
87
|
+
`Observed: ${at}`,
|
|
88
|
+
...(callId && call ? [`Call: ${call.token}`] : []),
|
|
89
|
+
...(call ? [`Purpose: ${call.purpose}`] : []),
|
|
90
|
+
],
|
|
51
91
|
};
|
|
52
92
|
activity.push(item);
|
|
53
93
|
if (activity.length > 32) activity.shift();
|
|
@@ -21,9 +21,7 @@ export function dashboardObservation(session: GrantsSession, now = Date.now()) {
|
|
|
21
21
|
...live,
|
|
22
22
|
sources: [...value.sources, ...(initiative ? [initiative] : []), ...(workspace ? [workspace] : [])],
|
|
23
23
|
logicalOwnerId: session.ownSpawnId,
|
|
24
|
-
artifacts: (session.dashboardArtifacts ?? [])
|
|
25
|
-
.slice(-16)
|
|
26
|
-
.map((r) => ({ operationId: r.operationId, executionId: r.executionId, sha256: r.manifest.sha256 })),
|
|
24
|
+
artifacts: (session.dashboardArtifacts ?? []).slice(-16),
|
|
27
25
|
resources: {
|
|
28
26
|
scope: "owner-process" as const,
|
|
29
27
|
sampledAt: new Date(sample.at).toISOString(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dashboardSummaryDescription } from "../src/products/activity-summary.ts";
|
|
1
2
|
import { operationIdShape, claimDelegationOperation, existingOperationOutcome } from "./delegation-operations.ts";
|
|
2
3
|
import { publicEvidenceCall } from "./public-evidence.ts";
|
|
3
4
|
import { executionEvidenceContent } from "./execution-evidence.ts";
|
|
@@ -81,6 +82,7 @@ export function registerChainTool(pi: ExtensionAPI, session: GrantsSession): voi
|
|
|
81
82
|
definitionId: Type.Optional(
|
|
82
83
|
Type.String({ description: "Snapshot id returned by delegate_describe; required for Principal phases." }),
|
|
83
84
|
),
|
|
85
|
+
dashboardSummary: Type.Optional(Type.String({ maxLength: 160, description: dashboardSummaryDescription })),
|
|
84
86
|
task: Type.String({
|
|
85
87
|
description:
|
|
86
88
|
`What this step should do. Write ${PLACEHOLDER} where the previous step's output belongs; if you omit it, ` +
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import type { OperationClaim, OperationRequest, OperationReference } from "../src/kernel/dispatch-operation.ts";
|
|
3
3
|
import type { OperationArtifactOutcome, OperationArtifactRef } from "../src/kernel/operation-artifact.ts";
|
|
4
4
|
import type { OperationArtifactStore } from "../src/governance/operation-artifacts.ts";
|
|
5
|
+
import type { DashboardResultDescription } from "../src/kernel/dashboard-observation.ts";
|
|
6
|
+
import type { OperationFinalStore } from "./delegation-operations.ts";
|
|
5
7
|
import type { GrantsSession } from "./session.ts";
|
|
6
8
|
const owners = new WeakMap<
|
|
7
9
|
OperationClaim,
|
|
@@ -9,7 +11,8 @@ const owners = new WeakMap<
|
|
|
9
11
|
store: OperationArtifactStore;
|
|
10
12
|
request: OperationRequest;
|
|
11
13
|
reference?: OperationArtifactRef;
|
|
12
|
-
|
|
14
|
+
display?: Pick<DashboardResultDescription, "agent" | "summary">;
|
|
15
|
+
publish?: OperationFinalStore["publishArtifact"];
|
|
13
16
|
}
|
|
14
17
|
>();
|
|
15
18
|
export function operationHistory(session: GrantsSession, operationId: string, includeFinal = true) {
|
|
@@ -20,6 +23,7 @@ export async function claimWithArtifact(
|
|
|
20
23
|
request: OperationRequest,
|
|
21
24
|
claim: () => Promise<OperationClaim>,
|
|
22
25
|
scope = session.reloadLifecycle?.operationFinals,
|
|
26
|
+
display?: Pick<DashboardResultDescription, "agent" | "summary">,
|
|
23
27
|
): Promise<OperationClaim> {
|
|
24
28
|
if (scope !== session.reloadLifecycle?.operationFinals) throw Error("Operation owner changed before admission");
|
|
25
29
|
const store = scope?.artifacts;
|
|
@@ -72,7 +76,12 @@ export async function claimWithArtifact(
|
|
|
72
76
|
},
|
|
73
77
|
});
|
|
74
78
|
try {
|
|
75
|
-
scope.publishArtifact?.(reference
|
|
79
|
+
scope.publishArtifact?.(reference, {
|
|
80
|
+
...display,
|
|
81
|
+
content: "record",
|
|
82
|
+
state: "not-started",
|
|
83
|
+
observedAt: owned.operation.updatedAt,
|
|
84
|
+
});
|
|
76
85
|
} catch {
|
|
77
86
|
/* optional reference hint */
|
|
78
87
|
}
|
|
@@ -82,7 +91,7 @@ export async function claimWithArtifact(
|
|
|
82
91
|
}
|
|
83
92
|
throw error;
|
|
84
93
|
}
|
|
85
|
-
const state = { store, request: { ...request }, publish: scope.publishArtifact };
|
|
94
|
+
const state = { store, request: { ...request }, publish: scope.publishArtifact, display };
|
|
86
95
|
owners.set(owned, state);
|
|
87
96
|
const started = owned.started!;
|
|
88
97
|
owned.started = async (cwd, workspaceId) => {
|
|
@@ -102,6 +111,14 @@ export async function claimWithArtifact(
|
|
|
102
111
|
};
|
|
103
112
|
if (!owners.get(owned)!.reference) retainOperationArtifact(owned, { operation: owned.operation });
|
|
104
113
|
owned.operation.artifact = owners.get(owned)!.reference;
|
|
114
|
+
if (status === "settled" && owned.operation.artifact) {
|
|
115
|
+
// Artifact retention happens before live settlement. Wake the selected work map only after both.
|
|
116
|
+
try {
|
|
117
|
+
initiative?.settled?.();
|
|
118
|
+
} catch {
|
|
119
|
+
/* A consumer can recover on its next work-map read. */
|
|
120
|
+
}
|
|
121
|
+
}
|
|
105
122
|
};
|
|
106
123
|
return owned;
|
|
107
124
|
}
|
|
@@ -113,7 +130,20 @@ export function retainOperationArtifact(claim: OperationClaim, outcome: Operatio
|
|
|
113
130
|
claim.operation.artifact = reference;
|
|
114
131
|
// Pi receives only a small reference, never duplicated full authored content.
|
|
115
132
|
try {
|
|
116
|
-
|
|
133
|
+
const { operation } = outcome;
|
|
134
|
+
owner.publish?.(reference, {
|
|
135
|
+
...owner.display,
|
|
136
|
+
content: outcome.final ? "answer" : outcome.partial !== undefined ? "partial" : "record",
|
|
137
|
+
state:
|
|
138
|
+
operation.state === "not-started" || operation.state === "uncertain"
|
|
139
|
+
? operation.state
|
|
140
|
+
: operation.runtime?.work === "failed"
|
|
141
|
+
? "failed"
|
|
142
|
+
: operation.state === "settled"
|
|
143
|
+
? "settled"
|
|
144
|
+
: "unknown",
|
|
145
|
+
observedAt: operation.updatedAt,
|
|
146
|
+
});
|
|
117
147
|
} catch {
|
|
118
148
|
/* Durable publication is authoritative; optional hints are recoverable. */
|
|
119
149
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import { claimWithArtifact, retainOperationArtifact } from "./delegation-artifacts.ts";
|
|
3
3
|
import { openOperationArtifacts, type OperationArtifactStore } from "../src/governance/operation-artifacts.ts";
|
|
4
4
|
import type { OperationArtifactRef } from "../src/kernel/operation-artifact.ts";
|
|
5
|
+
import type { DashboardResultDescription } from "../src/kernel/dashboard-observation.ts";
|
|
6
|
+
import { dashboardContentEnabled, safeDashboardSummary } from "../src/products/activity-summary.ts";
|
|
5
7
|
import { agentDir } from "../src/kernel/project-paths.ts";
|
|
6
8
|
import { createHash } from "node:crypto";
|
|
7
9
|
import { realpath } from "node:fs/promises";
|
|
@@ -27,7 +29,7 @@ const FINAL_BYTES = 4 * 1024 * 1024,
|
|
|
27
29
|
type Final = Extract<NonNullable<DelegationOutcome["final"]>, { state: "complete" }>;
|
|
28
30
|
export interface OperationFinalStore {
|
|
29
31
|
artifacts?: OperationArtifactStore;
|
|
30
|
-
publishArtifact?: (reference: OperationArtifactRef) => void;
|
|
32
|
+
publishArtifact?: (reference: OperationArtifactRef, description?: DashboardResultDescription) => void;
|
|
31
33
|
lifecycle: object;
|
|
32
34
|
owner: string;
|
|
33
35
|
bytes: number;
|
|
@@ -37,7 +39,7 @@ export function bindOperationFinals(
|
|
|
37
39
|
session: GrantsSession,
|
|
38
40
|
sessionId: string,
|
|
39
41
|
cwd: string,
|
|
40
|
-
publishArtifact?:
|
|
42
|
+
publishArtifact?: OperationFinalStore["publishArtifact"],
|
|
41
43
|
) {
|
|
42
44
|
const owner = JSON.stringify([sessionId, cwd]),
|
|
43
45
|
old = session.reloadLifecycle.operationFinals;
|
|
@@ -155,7 +157,8 @@ export async function claimDelegationOperation(
|
|
|
155
157
|
const operations = session.autoMode?.operations;
|
|
156
158
|
if (!operations) throw Error("Session operation admission is unavailable; no dispatch started");
|
|
157
159
|
const cwd = await realpath(ctx.cwd);
|
|
158
|
-
|
|
160
|
+
// A display-only caption may change when resuming the very same task.
|
|
161
|
+
const { operation_id: _id, dashboardSummary: _caption, ...request } = spec;
|
|
159
162
|
const requestDigest = createHash("sha256")
|
|
160
163
|
.update(
|
|
161
164
|
JSON.stringify(
|
|
@@ -185,7 +188,12 @@ export async function claimDelegationOperation(
|
|
|
185
188
|
cwd,
|
|
186
189
|
workspaceId: spec.workspace?.workspace_id ?? null,
|
|
187
190
|
};
|
|
188
|
-
|
|
191
|
+
const agent = spec.agent && /^[a-z][a-z0-9_-]{0,48}$/i.test(spec.agent) ? spec.agent : undefined;
|
|
192
|
+
const summary = dashboardContentEnabled(process.env) ? safeDashboardSummary(spec.dashboardSummary) : undefined;
|
|
193
|
+
return claimWithArtifact(session, identity, () => operations.claim(identity, signal), operationScope, {
|
|
194
|
+
agent,
|
|
195
|
+
summary,
|
|
196
|
+
});
|
|
189
197
|
};
|
|
190
198
|
if (!denied) return elect();
|
|
191
199
|
|
package/extensions/delegation.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { dashboardSummaryDescription } from "../src/products/activity-summary.ts";
|
|
1
2
|
import { operationIdShape, claimDelegationOperation } from "./delegation-operations.ts";
|
|
2
3
|
import { publicEvidenceCall } from "./public-evidence.ts";
|
|
3
4
|
import { executionEvidenceContent } from "./execution-evidence.ts";
|
|
@@ -195,6 +196,7 @@ export function registerDelegationTools(pi: ExtensionAPI, session: GrantsSession
|
|
|
195
196
|
definitionId: Type.Optional(
|
|
196
197
|
Type.String({ description: "Snapshot id returned by delegate_describe; required for Principal phases." }),
|
|
197
198
|
),
|
|
199
|
+
dashboardSummary: Type.Optional(Type.String({ maxLength: 160, description: dashboardSummaryDescription })),
|
|
198
200
|
task: Type.String({ description: "The task for this sub-agent. It receives only this." }),
|
|
199
201
|
agent: Type.Optional(Type.String({ description: describeAgent(spawnable()) })),
|
|
200
202
|
tools: Type.Optional(Type.Array(Type.String(), { description: "Capabilities, when no 'agent' fits." })),
|
|
@@ -218,6 +220,7 @@ export function registerDelegationTools(pi: ExtensionAPI, session: GrantsSession
|
|
|
218
220
|
definitionId: Type.Optional(
|
|
219
221
|
Type.String({ description: "Snapshot id returned by delegate_describe; required for Principal phases." }),
|
|
220
222
|
),
|
|
223
|
+
dashboardSummary: Type.Optional(Type.String({ maxLength: 160, description: dashboardSummaryDescription })),
|
|
221
224
|
task: Type.String({ description: "The task for the sub-agent. It receives only this." }),
|
|
222
225
|
agent: Type.Optional(Type.String({ description: describeAgent(spawnable()) })),
|
|
223
226
|
tools: Type.Optional(
|
|
@@ -272,6 +275,7 @@ export function registerDelegationTools(pi: ExtensionAPI, session: GrantsSession
|
|
|
272
275
|
operation_id: params.operation_id,
|
|
273
276
|
definitionId: params.definitionId,
|
|
274
277
|
task: params.task,
|
|
278
|
+
dashboardSummary: params.dashboardSummary,
|
|
275
279
|
agent: params.agent,
|
|
276
280
|
tools: params.tools,
|
|
277
281
|
model: params.model,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type ExtensionAPI,
|
|
8
8
|
type ExtensionContext,
|
|
9
9
|
} from "@earendil-works/pi-coding-agent";
|
|
10
|
-
import { join, resolve } from "node:path";
|
|
10
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
11
11
|
import { readBoundedTextSync } from "../src/kernel/bounded-read-sync.ts";
|
|
12
12
|
import { agentDir } from "../src/kernel/project-paths.ts";
|
|
13
13
|
import type { EcosystemPackageId, EcosystemVersionRow, EcosystemVersions } from "../src/products/ecosystem-versions.ts";
|
|
@@ -60,7 +60,7 @@ const defaultPorts = (ownRoot: string): VersionInventoryPorts => ({
|
|
|
60
60
|
});
|
|
61
61
|
/** Every package answers synchronously on Pi's native event bus; old packages stay explicitly unreported. */
|
|
62
62
|
export function createEcosystemVersionInventory(
|
|
63
|
-
pi: Pick<ExtensionAPI, "events"
|
|
63
|
+
pi: Pick<ExtensionAPI, "events"> & Partial<Pick<ExtensionAPI, "getCommands">>,
|
|
64
64
|
ownRoot: string,
|
|
65
65
|
ports = defaultPorts(ownRoot),
|
|
66
66
|
) {
|
|
@@ -78,7 +78,7 @@ export function createEcosystemVersionInventory(
|
|
|
78
78
|
if (
|
|
79
79
|
!["principal-pi-skills", "skill-harness", "pi-scout-research", "bookie-pi-skills"].includes(item.id) ||
|
|
80
80
|
typeof item.root !== "string" ||
|
|
81
|
-
!item.root
|
|
81
|
+
!isAbsolute(item.root)
|
|
82
82
|
)
|
|
83
83
|
return;
|
|
84
84
|
if (typeof item.version !== "string" || !versionPattern.test(item.version)) return;
|
|
@@ -115,6 +115,27 @@ export function createEcosystemVersionInventory(
|
|
|
115
115
|
sources.length > 1 ||
|
|
116
116
|
observedRoots.size > 1 ||
|
|
117
117
|
(loaded.length > 0 && sources.some((item) => !item.installedPath));
|
|
118
|
+
let bookieCommand = false;
|
|
119
|
+
if (pkg.id === "bookie-pi-skills" && root && !multiple) {
|
|
120
|
+
// A registered command proves the extension is loaded, even for older Bookie
|
|
121
|
+
// releases which did not announce a version. The current disk version cannot prove that.
|
|
122
|
+
try {
|
|
123
|
+
bookieCommand =
|
|
124
|
+
pi.getCommands?.().some((cmd) => {
|
|
125
|
+
if (
|
|
126
|
+
cmd.name !== "bookie-work" ||
|
|
127
|
+
cmd.source !== "extension" ||
|
|
128
|
+
!cmd.sourceInfo?.path ||
|
|
129
|
+
!isAbsolute(cmd.sourceInfo.path)
|
|
130
|
+
)
|
|
131
|
+
return false;
|
|
132
|
+
const child = relative(root, cmd.sourceInfo.path);
|
|
133
|
+
return !!child && !isAbsolute(child) && child !== ".." && !child.startsWith(".." + sep);
|
|
134
|
+
}) === true;
|
|
135
|
+
} catch {
|
|
136
|
+
/* Older Pi hosts may not expose a live command catalog. */
|
|
137
|
+
}
|
|
138
|
+
}
|
|
118
139
|
const commands =
|
|
119
140
|
pkg.id === "pi"
|
|
120
141
|
? ["pi update"]
|
|
@@ -144,6 +165,7 @@ export function createEcosystemVersionInventory(
|
|
|
144
165
|
? "not-reported"
|
|
145
166
|
: "unavailable",
|
|
146
167
|
commands,
|
|
168
|
+
...(bookieCommand ? { commandAvailable: true } : {}),
|
|
147
169
|
note: multiple
|
|
148
170
|
? "Multiple loaded or configured sources; inspect with pi list before changing versions."
|
|
149
171
|
: !loadedVersion
|
|
@@ -127,6 +127,7 @@ export interface ChildExecutionInput {
|
|
|
127
127
|
capacityReservation?: CapacityReservation;
|
|
128
128
|
plan: Delegation;
|
|
129
129
|
agent?: string;
|
|
130
|
+
dashboardSummary?: string;
|
|
130
131
|
childId: string;
|
|
131
132
|
executionId: string;
|
|
132
133
|
parentExecutionId: string | null;
|
|
@@ -264,6 +265,9 @@ async function executePreparedChild(
|
|
|
264
265
|
activityParent,
|
|
265
266
|
input.agent ?? "governed child",
|
|
266
267
|
(plan.args.at(-1) ?? "").trimStart(),
|
|
268
|
+
undefined,
|
|
269
|
+
undefined,
|
|
270
|
+
input.dashboardSummary,
|
|
267
271
|
);
|
|
268
272
|
activityStarted = true;
|
|
269
273
|
} catch {}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** Owner-bound access to the exact visible final of a settled initiative task. */
|
|
2
|
+
import { openOperationArtifacts, readOperationArtifact } from "../src/governance/operation-artifacts.ts";
|
|
3
|
+
import type { InitiativeAttempt } from "../src/kernel/initiative.ts";
|
|
4
|
+
|
|
5
|
+
type ArtifactScope = { cwd: string; workspaceId: string | null };
|
|
6
|
+
export type HandoffScope = ArtifactScope & { taskId: string; taskRevision: string };
|
|
7
|
+
|
|
8
|
+
export async function retainedInitiativeHandoff(
|
|
9
|
+
directory: string,
|
|
10
|
+
attempt: InitiativeAttempt,
|
|
11
|
+
authorize: (scope: ArtifactScope) => Promise<void>,
|
|
12
|
+
) {
|
|
13
|
+
const store = openOperationArtifacts(directory, attempt.owner);
|
|
14
|
+
const history = store.history(attempt.operationId, false);
|
|
15
|
+
const artifact = history?.artifact,
|
|
16
|
+
op = history?.operation,
|
|
17
|
+
runtime = op?.runtime;
|
|
18
|
+
if (
|
|
19
|
+
!artifact ||
|
|
20
|
+
!op ||
|
|
21
|
+
attempt.state === "not-admitted" ||
|
|
22
|
+
history.requestDigest !== attempt.requestDigest ||
|
|
23
|
+
op.executionId !== attempt.executionId ||
|
|
24
|
+
op.state !== "settled" ||
|
|
25
|
+
runtime?.control === "failed" ||
|
|
26
|
+
runtime?.work !== "succeeded" ||
|
|
27
|
+
runtime.cleanup?.state !== "settled" ||
|
|
28
|
+
runtime.cleanup.executionId !== attempt.executionId ||
|
|
29
|
+
runtime.final?.state !== "complete" ||
|
|
30
|
+
!runtime.final.sha256
|
|
31
|
+
)
|
|
32
|
+
return;
|
|
33
|
+
const finalSha256 = runtime.final.sha256;
|
|
34
|
+
const scope = { cwd: op.cwd, workspaceId: op.workspaceId };
|
|
35
|
+
const readText = async () => {
|
|
36
|
+
await authorize(scope);
|
|
37
|
+
const { final } = readOperationArtifact(artifact, { agentDirectory: directory });
|
|
38
|
+
if (!final || final.sha256 !== finalSha256 || !final.text.trim()) throw Error("Exact retained handoff unavailable");
|
|
39
|
+
return final.text;
|
|
40
|
+
};
|
|
41
|
+
const assertCurrent = async () => {
|
|
42
|
+
await readText();
|
|
43
|
+
};
|
|
44
|
+
await assertCurrent();
|
|
45
|
+
return {
|
|
46
|
+
reference: {
|
|
47
|
+
owner: "pi-daddy" as const,
|
|
48
|
+
reference: {
|
|
49
|
+
kind: "retained-handoff" as const,
|
|
50
|
+
operationId: attempt.operationId,
|
|
51
|
+
executionId: attempt.executionId,
|
|
52
|
+
manifestSha256: artifact.manifest.sha256,
|
|
53
|
+
finalSha256,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
assertCurrent,
|
|
57
|
+
readText,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { retainedInitiativeHandoff, type HandoffScope } from "./initiative-handoff.ts";
|
|
1
2
|
import { initiativeDashboard } from "./initiative-dashboard.ts";
|
|
2
3
|
/** Trusted selected-work-map connector. A selection permits association only, never dispatch or tool authority. */
|
|
3
4
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
@@ -22,6 +23,7 @@ export interface InitiativeOperationBinding {
|
|
|
22
23
|
begin(): Promise<void>;
|
|
23
24
|
assertCurrent(scope?: { cwd: string; workspaceId: string | null }): Promise<void>;
|
|
24
25
|
notAdmitted(): Promise<void>;
|
|
26
|
+
settled?(): void;
|
|
25
27
|
}
|
|
26
28
|
| undefined;
|
|
27
29
|
}
|
|
@@ -43,6 +45,7 @@ export function registerInitiativeRuntime(
|
|
|
43
45
|
associations: Map<string, InitiativeTask>;
|
|
44
46
|
assertSelection(): void | Promise<void>;
|
|
45
47
|
assertTaskReady(task: { taskId: string; taskRevision: string }): void | Promise<void>;
|
|
48
|
+
assertHandoffScope?: (scope: HandoffScope) => void | Promise<void>;
|
|
46
49
|
assertExecutionScope?: (scope: {
|
|
47
50
|
taskId: string;
|
|
48
51
|
taskRevision: string;
|
|
@@ -142,6 +145,17 @@ export function registerInitiativeRuntime(
|
|
|
142
145
|
}
|
|
143
146
|
},
|
|
144
147
|
notAdmitted: () => s.coordinator.notAdmitted(request),
|
|
148
|
+
settled() {
|
|
149
|
+
if (selected !== s || currentOwner() !== s.owner) return;
|
|
150
|
+
pi.events.emit?.("pi-daddy:initiative-settled:v1", {
|
|
151
|
+
version: 1,
|
|
152
|
+
sessionId: s.owner.sessionId,
|
|
153
|
+
cwd: s.owner.cwd,
|
|
154
|
+
initiativeId: s.initiativeId,
|
|
155
|
+
taskId: task.taskId,
|
|
156
|
+
taskRevision: task.taskRevision,
|
|
157
|
+
});
|
|
158
|
+
},
|
|
145
159
|
};
|
|
146
160
|
},
|
|
147
161
|
};
|
|
@@ -164,6 +178,7 @@ export function registerInitiativeRuntime(
|
|
|
164
178
|
cwd: string;
|
|
165
179
|
workspaceId: string | null;
|
|
166
180
|
}) => void | Promise<void>;
|
|
181
|
+
assertHandoffScope?: (scope: HandoffScope) => void | Promise<void>;
|
|
167
182
|
assertEffectReconciled?: (input: InitiativeEffectReconciliation) => void | Promise<void>;
|
|
168
183
|
assertTaskReady?: (task: { taskId: string; taskRevision: string }) => void | Promise<void>;
|
|
169
184
|
reply?: (value: unknown) => void;
|
|
@@ -201,6 +216,7 @@ export function registerInitiativeRuntime(
|
|
|
201
216
|
typeof r.assertSelection !== "function" ||
|
|
202
217
|
typeof r.assertTaskReady !== "function" ||
|
|
203
218
|
(r.assertObservationAuthority !== undefined && typeof r.assertObservationAuthority !== "function") ||
|
|
219
|
+
(r.assertHandoffScope !== undefined && typeof r.assertHandoffScope !== "function") ||
|
|
204
220
|
(r.action === "acquire" && typeof r.assertExecutionScope !== "function") ||
|
|
205
221
|
!Array.isArray(r.tasks) ||
|
|
206
222
|
!r.tasks.length ||
|
|
@@ -212,7 +228,8 @@ export function registerInitiativeRuntime(
|
|
|
212
228
|
throw Error("invalid selected initiative request");
|
|
213
229
|
if (selected) throw Error("release the current initiative before selecting another");
|
|
214
230
|
const epoch = ++selectionEpoch,
|
|
215
|
-
assertSelection = r.assertSelection
|
|
231
|
+
assertSelection = r.assertSelection,
|
|
232
|
+
assertHandoffScope = r.assertHandoffScope;
|
|
216
233
|
const assertAuthority = async () => {
|
|
217
234
|
if (selectionEpoch !== epoch || currentOwner() !== owner) throw Error("initiative owner changed");
|
|
218
235
|
await assertSelection();
|
|
@@ -291,6 +308,7 @@ export function registerInitiativeRuntime(
|
|
|
291
308
|
assertSelection,
|
|
292
309
|
assertTaskReady: r.assertTaskReady!,
|
|
293
310
|
assertExecutionScope: r.assertExecutionScope,
|
|
311
|
+
assertHandoffScope,
|
|
294
312
|
};
|
|
295
313
|
selected = s;
|
|
296
314
|
lastDisplay = { owner, dashboard: s.dashboard };
|
|
@@ -316,6 +334,26 @@ export function registerInitiativeRuntime(
|
|
|
316
334
|
return result;
|
|
317
335
|
},
|
|
318
336
|
associate: (input: InitiativeTaskIdentity & { operationId: string }) => associate(s, input),
|
|
337
|
+
retainedHandoff: async (input: InitiativeTaskIdentity) => {
|
|
338
|
+
const identity = structuredClone(input);
|
|
339
|
+
const task = s.tasks.find(
|
|
340
|
+
(t) => t.taskId === identity.taskId && t.taskRevision === identity.taskRevision,
|
|
341
|
+
);
|
|
342
|
+
if (!task || identity.initiativeId !== s.initiativeId || typeof s.assertHandoffScope !== "function")
|
|
343
|
+
return;
|
|
344
|
+
await stillObserved(s);
|
|
345
|
+
const bound = await coordinator.handoffAttempt(identity, task);
|
|
346
|
+
if (!bound) return;
|
|
347
|
+
const assertScope = s.assertHandoffScope;
|
|
348
|
+
return retainedInitiativeHandoff(agentDir(), bound.attempt, async (scope) => {
|
|
349
|
+
await stillObserved(s);
|
|
350
|
+
const revision = coordinator.revision();
|
|
351
|
+
await bound.assertCurrent();
|
|
352
|
+
await assertScope({ taskId: task.taskId, taskRevision: task.taskRevision, ...scope });
|
|
353
|
+
if (revision !== coordinator.revision() || selected !== s || currentOwner() !== s.owner)
|
|
354
|
+
throw Error("initiative selection changed");
|
|
355
|
+
});
|
|
356
|
+
},
|
|
319
357
|
observe: async (input: InitiativeTaskIdentity) => {
|
|
320
358
|
await stillObserved(s);
|
|
321
359
|
const task = s.tasks.find((t) => t.taskId === input.taskId && t.taskRevision === input.taskRevision);
|