pi-daddy 0.51.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 +6 -0
- package/README.md +11 -32
- 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/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 +8 -5
- 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-layout.js +20 -4
- package/dist/products/dashboard-layout.js.map +1 -1
- package/dist/products/dashboard-panels.d.ts.map +1 -1
- package/dist/products/dashboard-panels.js +128 -67
- package/dist/products/dashboard-panels.js.map +1 -1
- package/dist/products/dashboard-recap.d.ts +1 -1
- package/dist/products/dashboard-recap.d.ts.map +1 -1
- package/dist/products/dashboard-recap.js +12 -16
- package/dist/products/dashboard-recap.js.map +1 -1
- package/dist/products/dashboard-screen.d.ts +5 -2
- package/dist/products/dashboard-screen.d.ts.map +1 -1
- package/dist/products/dashboard-screen.js +92 -36
- 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 +26 -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/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/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 +20 -6
- package/src/products/dashboard-components.ts +219 -0
- package/src/products/dashboard-layout.ts +27 -6
- package/src/products/dashboard-panels.ts +128 -76
- package/src/products/dashboard-recap.ts +15 -15
- package/src/products/dashboard-screen.ts +101 -38
- 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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S;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) => {
|
|
@@ -121,7 +130,20 @@ export function retainOperationArtifact(claim: OperationClaim, outcome: Operatio
|
|
|
121
130
|
claim.operation.artifact = reference;
|
|
122
131
|
// Pi receives only a small reference, never duplicated full authored content.
|
|
123
132
|
try {
|
|
124
|
-
|
|
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
|
+
});
|
|
125
147
|
} catch {
|
|
126
148
|
/* Durable publication is authoritative; optional hints are recoverable. */
|
|
127
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 {}
|
|
@@ -54,6 +54,7 @@ export interface ChildSpec {
|
|
|
54
54
|
operation_id?: string;
|
|
55
55
|
definitionId?: string;
|
|
56
56
|
task: string;
|
|
57
|
+
dashboardSummary?: string;
|
|
57
58
|
agent?: string;
|
|
58
59
|
tools?: string[];
|
|
59
60
|
model?: string;
|
|
@@ -529,6 +530,7 @@ async function runOneDelegationImplementation(
|
|
|
529
530
|
session,
|
|
530
531
|
plan,
|
|
531
532
|
agent: spec.agent,
|
|
533
|
+
dashboardSummary: spec.dashboardSummary,
|
|
532
534
|
childId: ids.childId,
|
|
533
535
|
executionId: ids.executionId,
|
|
534
536
|
parentExecutionId: ids.parentExecutionId,
|
|
@@ -268,7 +268,7 @@ export function registerRuntimeSnapshot(
|
|
|
268
268
|
}
|
|
269
269
|
if (sequence !== bindSequence || session.reloadLifecycle !== lifecycle) return;
|
|
270
270
|
lifecycle.runtimeSettlement = runtime;
|
|
271
|
-
bindOperationFinals(session, sessionId, cwd, (reference) => {
|
|
271
|
+
bindOperationFinals(session, sessionId, cwd, (reference, description) => {
|
|
272
272
|
if (
|
|
273
273
|
bound?.sessionId === sessionId &&
|
|
274
274
|
bound.cwd === cwd &&
|
|
@@ -279,11 +279,15 @@ export function registerRuntimeSnapshot(
|
|
|
279
279
|
session.dashboardArtifacts ??= [];
|
|
280
280
|
if (
|
|
281
281
|
!session.dashboardArtifacts.some(
|
|
282
|
-
(item) =>
|
|
283
|
-
item.executionId === reference.executionId && item.manifest.sha256 === reference.manifest.sha256,
|
|
282
|
+
(item) => item.executionId === reference.executionId && item.sha256 === reference.manifest.sha256,
|
|
284
283
|
)
|
|
285
284
|
)
|
|
286
|
-
session.dashboardArtifacts.push(
|
|
285
|
+
session.dashboardArtifacts.push({
|
|
286
|
+
operationId: reference.operationId,
|
|
287
|
+
executionId: reference.executionId,
|
|
288
|
+
sha256: reference.manifest.sha256,
|
|
289
|
+
...(description ? { description } : {}),
|
|
290
|
+
});
|
|
287
291
|
if (session.dashboardArtifacts.length > 16) session.dashboardArtifacts.shift();
|
|
288
292
|
try {
|
|
289
293
|
pi.appendEntry?.("pi-daddy:operation-artifact:v1", reference);
|
package/extensions/session.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitiativeOperationBinding } from "./initiative-runtime.ts";
|
|
2
2
|
import type { DashboardSourceSnapshot, DashboardContribution } from "../src/kernel/dashboard-observation.ts";
|
|
3
|
-
import type {
|
|
3
|
+
import type { DashboardSavedEvidence } from "../src/kernel/dashboard-observation.ts";
|
|
4
4
|
import type { DashboardOwnerObservation } from "../src/kernel/dashboard-observation.ts";
|
|
5
5
|
import type { EcosystemVersions } from "../src/products/ecosystem-versions.ts";
|
|
6
6
|
import type { AutoModeReader } from "../src/kernel/auto-mode.ts";
|
|
@@ -152,7 +152,7 @@ export interface GrantsSession extends NativeSessionHost {
|
|
|
152
152
|
refreshInitiative?: () => void;
|
|
153
153
|
ecosystemVersions?: () => EcosystemVersions;
|
|
154
154
|
dashboardLive?: () => { turn?: DashboardContribution; activity: DashboardContribution[] };
|
|
155
|
-
dashboardArtifacts?:
|
|
155
|
+
dashboardArtifacts?: DashboardSavedEvidence[];
|
|
156
156
|
dashboardObservations?: () => Omit<DashboardOwnerObservation, "version" | "resources" | "capture"> | undefined;
|
|
157
157
|
autoMode?: AutoModeReader;
|
|
158
158
|
autoModeFailure?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-daddy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.52.0",
|
|
4
4
|
"description": "Capability governance for pi sub-agents: spawn Agent Skills (SKILL.md) definitions whose allowed-tools becomes a grant that can only narrow going down a delegation tree, enforced by pi's own --tools allowlist, with an append-only ledger.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -14,6 +14,7 @@ import { randomUUID } from "node:crypto";
|
|
|
14
14
|
import type { AutoModeReader } from "../kernel/auto-mode.ts";
|
|
15
15
|
import { approvalKey, offeredScopes, type ApprovalPath, type ApprovalScope } from "../kernel/approval.ts";
|
|
16
16
|
import type { Capability } from "../kernel/resolve.ts";
|
|
17
|
+
import { selectPermission } from "./permission-question.ts";
|
|
17
18
|
|
|
18
19
|
/** The slice of pi's `ExtensionUIContext` this module needs. */
|
|
19
20
|
export interface ApprovalUI {
|
|
@@ -40,6 +41,10 @@ export interface PromptRequest {
|
|
|
40
41
|
path: ApprovalPath;
|
|
41
42
|
/** Shown to the human for context. Never itself part of a key. */
|
|
42
43
|
task?: string;
|
|
44
|
+
/** Operator-owned permission store and resolved workspace, for display in the parent UI only. */
|
|
45
|
+
project?: string;
|
|
46
|
+
workspace?: string;
|
|
47
|
+
recheckReason?: string;
|
|
43
48
|
/** Trusted exact-scope identity; bound requests single-flight only with an identical binding. */
|
|
44
49
|
bindingKey?: string;
|
|
45
50
|
signal?: AbortSignal;
|
|
@@ -125,7 +130,6 @@ const interrupted = (request: PromptRequest, kind: "expired" | "aborted"): Promp
|
|
|
125
130
|
async function selectApproval(
|
|
126
131
|
options: ApprovalGateOptions,
|
|
127
132
|
request: PromptRequest,
|
|
128
|
-
title: string,
|
|
129
133
|
labels: string[],
|
|
130
134
|
): Promise<string | undefined | PromptOutcome> {
|
|
131
135
|
const timeout = typeof options.timeoutMs === "function" ? options.timeoutMs() : options.timeoutMs;
|
|
@@ -157,7 +161,7 @@ async function selectApproval(
|
|
|
157
161
|
subject: request.subject,
|
|
158
162
|
capability: request.capability,
|
|
159
163
|
});
|
|
160
|
-
const selection = options.ui
|
|
164
|
+
const selection = selectPermission(options.ui, request, labels, controller.signal).then((chosen) => {
|
|
161
165
|
settled = true;
|
|
162
166
|
return chosen;
|
|
163
167
|
});
|
|
@@ -263,13 +267,10 @@ export function createApprovalGate(
|
|
|
263
267
|
}
|
|
264
268
|
}
|
|
265
269
|
const scopes = offeredScopes(request.path);
|
|
266
|
-
const title =
|
|
267
|
-
`grants: approve ${request.capability} for ${request.subject}?` +
|
|
268
|
-
(request.task ? `\n task: ${request.task}` : "");
|
|
269
270
|
|
|
270
271
|
let chosen: string | undefined | PromptOutcome;
|
|
271
272
|
try {
|
|
272
|
-
chosen = await selectApproval(options, request,
|
|
273
|
+
chosen = await selectApproval(options, request, [DENY_LABEL, ...scopes.map((s) => SCOPE_LABELS[s])]);
|
|
273
274
|
} catch (error) {
|
|
274
275
|
// A governance layer that errors must deny, not permit. This is a dialog malfunction, not a
|
|
275
276
|
// person's answer — `kind: "error"` keeps it out of "declined".
|