pi-daddy 0.56.3 → 0.58.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 +13 -0
- package/README.md +15 -1
- package/dist/governance/approval-prompt.d.ts +3 -1
- package/dist/governance/approval-prompt.d.ts.map +1 -1
- package/dist/governance/approval-prompt.js +7 -3
- package/dist/governance/approval-prompt.js.map +1 -1
- package/dist/governance/permission-question.d.ts.map +1 -1
- package/dist/governance/permission-question.js +15 -5
- package/dist/governance/permission-question.js.map +1 -1
- package/dist/kernel/child-tools.d.ts +17 -0
- package/dist/kernel/child-tools.d.ts.map +1 -0
- package/dist/kernel/child-tools.js +46 -0
- package/dist/kernel/child-tools.js.map +1 -0
- package/dist/kernel/dashboard-observation.d.ts +40 -0
- package/dist/kernel/dashboard-observation.d.ts.map +1 -1
- package/dist/kernel/dashboard-observation.js +42 -3
- package/dist/kernel/dashboard-observation.js.map +1 -1
- package/dist/kernel/definitions.d.ts +2 -0
- package/dist/kernel/definitions.d.ts.map +1 -1
- package/dist/kernel/definitions.js.map +1 -1
- package/dist/kernel/delegate-types.d.ts +2 -0
- package/dist/kernel/delegate-types.d.ts.map +1 -1
- package/dist/kernel/delegate-types.js.map +1 -1
- package/dist/kernel/delegate.d.ts.map +1 -1
- package/dist/kernel/delegate.js +12 -1
- package/dist/kernel/delegate.js.map +1 -1
- package/dist/kernel/principal-binding.d.ts.map +1 -1
- package/dist/kernel/principal-binding.js +11 -0
- package/dist/kernel/principal-binding.js.map +1 -1
- package/dist/kernel/selected-definitions.d.ts.map +1 -1
- package/dist/kernel/selected-definitions.js +10 -1
- package/dist/kernel/selected-definitions.js.map +1 -1
- package/dist/kernel/selected-resources.d.ts +21 -0
- package/dist/kernel/selected-resources.d.ts.map +1 -0
- package/dist/kernel/selected-resources.js +10 -0
- package/dist/kernel/selected-resources.js.map +1 -0
- package/dist/kernel/spawn.d.ts +2 -0
- package/dist/kernel/spawn.d.ts.map +1 -1
- package/dist/kernel/spawn.js +3 -1
- package/dist/kernel/spawn.js.map +1 -1
- package/dist/products/dashboard-cli.d.ts.map +1 -1
- package/dist/products/dashboard-cli.js +1 -1
- package/dist/products/dashboard-cli.js.map +1 -1
- package/dist/products/dashboard-components.d.ts.map +1 -1
- package/dist/products/dashboard-components.js +74 -9
- package/dist/products/dashboard-components.js.map +1 -1
- package/dist/products/dashboard-inventory-view.d.ts +9 -0
- package/dist/products/dashboard-inventory-view.d.ts.map +1 -0
- package/dist/products/dashboard-inventory-view.js +44 -0
- package/dist/products/dashboard-inventory-view.js.map +1 -0
- package/dist/products/dashboard-layout.js +4 -3
- 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 +7 -3
- package/dist/products/dashboard-panels.js.map +1 -1
- package/dist/products/dashboard-screen.d.ts +2 -0
- package/dist/products/dashboard-screen.d.ts.map +1 -1
- package/dist/products/dashboard-screen.js +10 -5
- package/dist/products/dashboard-screen.js.map +1 -1
- package/dist/products/dashboard-session-client.d.ts +4 -2
- package/dist/products/dashboard-session-client.d.ts.map +1 -1
- package/dist/products/dashboard-session-client.js +24 -7
- package/dist/products/dashboard-session-client.js.map +1 -1
- package/dist/products/dashboard-settings.d.ts +2 -1
- package/dist/products/dashboard-settings.d.ts.map +1 -1
- package/dist/products/dashboard-settings.js +10 -1
- package/dist/products/dashboard-settings.js.map +1 -1
- package/extensions/approvals.ts +52 -38
- package/extensions/chain-approval-facts.ts +20 -0
- package/extensions/dashboard-session-server.ts +4 -0
- package/extensions/dashboard-source-refresh.ts +95 -0
- package/extensions/dashboard-sources.ts +42 -4
- package/extensions/definition-describe.ts +1 -0
- package/extensions/delegate-chain.ts +35 -21
- package/extensions/grants.ts +2 -0
- package/extensions/runtime-snapshot.ts +1 -0
- package/extensions/session.ts +4 -0
- package/package.json +2 -2
- package/src/governance/approval-prompt.ts +10 -4
- package/src/governance/permission-question.ts +16 -5
- package/src/kernel/child-tools.ts +62 -0
- package/src/kernel/dashboard-observation.ts +86 -4
- package/src/kernel/definitions.ts +2 -0
- package/src/kernel/delegate-types.ts +2 -0
- package/src/kernel/delegate.ts +12 -1
- package/src/kernel/principal-binding.ts +11 -0
- package/src/kernel/selected-definitions.ts +11 -1
- package/src/kernel/selected-resources.ts +20 -0
- package/src/kernel/spawn.ts +4 -1
- package/src/products/dashboard-cli.ts +1 -0
- package/src/products/dashboard-components.ts +78 -10
- package/src/products/dashboard-inventory-view.ts +44 -0
- package/src/products/dashboard-layout.ts +6 -4
- package/src/products/dashboard-panels.ts +9 -3
- package/src/products/dashboard-screen.ts +12 -4
- package/src/products/dashboard-session-client.ts +31 -11
- package/src/products/dashboard-settings.ts +11 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { validChoiceDetail, } from "../kernel/dashboard-choice.js";
|
|
2
|
+
import { DASHBOARD_RESPONSE_BYTES } from "../kernel/dashboard-observation.js";
|
|
2
3
|
import { createConnection } from "node:net";
|
|
3
4
|
class ChoiceDeclined extends Error {
|
|
4
5
|
stale;
|
|
@@ -19,7 +20,7 @@ export async function dashboardSessionRequest(socketPath, token, request) {
|
|
|
19
20
|
socket.once("error", reject);
|
|
20
21
|
socket.on("data", (chunk) => {
|
|
21
22
|
output += chunk;
|
|
22
|
-
if (output
|
|
23
|
+
if (Buffer.byteLength(output) > DASHBOARD_RESPONSE_BYTES)
|
|
23
24
|
socket.destroy(new Error("dashboard session response too large"));
|
|
24
25
|
});
|
|
25
26
|
socket.once("end", () => {
|
|
@@ -59,6 +60,18 @@ export function createDashboardConnection(request) {
|
|
|
59
60
|
let generation = 0, poll = 0, requestedJev;
|
|
60
61
|
let choiceInterest = 0, consumedInterest = 0;
|
|
61
62
|
const retired = new Set();
|
|
63
|
+
const disconnect = () => {
|
|
64
|
+
state.snapshot = undefined;
|
|
65
|
+
const previous = state.lastObserved;
|
|
66
|
+
if (previous?.observation)
|
|
67
|
+
state.lastObserved = {
|
|
68
|
+
...previous,
|
|
69
|
+
observation: {
|
|
70
|
+
...previous.observation,
|
|
71
|
+
sources: previous.observation.sources.map(({ inventory: _inventory, ...source }) => source),
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
};
|
|
62
75
|
const accept = (snapshot) => {
|
|
63
76
|
const previous = state.lastObserved?.observation, next = snapshot.observation;
|
|
64
77
|
if (previous && !next)
|
|
@@ -112,24 +125,28 @@ export function createDashboardConnection(request) {
|
|
|
112
125
|
requestChoiceRefresh() {
|
|
113
126
|
choiceInterest++;
|
|
114
127
|
},
|
|
115
|
-
async refresh(visibleChoices) {
|
|
128
|
+
async refresh(visibleChoices, visibleSources = false) {
|
|
116
129
|
if (!request || state.pending)
|
|
117
130
|
return;
|
|
118
131
|
const observed = generation, order = ++poll;
|
|
119
132
|
try {
|
|
120
133
|
const interest = choiceInterest;
|
|
121
134
|
const wanted = visibleChoices === "picker" || (visibleChoices === "list" && interest !== consumedInterest);
|
|
122
|
-
const { choiceRefreshRequested, ...snapshot } = await request(
|
|
135
|
+
const { choiceRefreshRequested, sourceRefreshRequested: _sourceRefreshRequested, ...snapshot } = await request({
|
|
136
|
+
action: "get",
|
|
137
|
+
...(wanted ? { refreshChoices: true } : {}),
|
|
138
|
+
...(visibleSources ? { refreshSources: true } : {}),
|
|
139
|
+
});
|
|
123
140
|
if (choiceRefreshRequested)
|
|
124
141
|
consumedInterest = Math.max(consumedInterest, interest);
|
|
125
142
|
if (generation === observed && order === poll && !accept(snapshot)) {
|
|
126
|
-
|
|
143
|
+
disconnect();
|
|
127
144
|
state.error = "Owner observation is stale or unavailable; controls disabled until a fresh reply.";
|
|
128
145
|
}
|
|
129
146
|
}
|
|
130
147
|
catch (error) {
|
|
131
148
|
if (generation === observed && order === poll) {
|
|
132
|
-
|
|
149
|
+
disconnect();
|
|
133
150
|
state.error = `Controls unavailable; showing last observation: ${error instanceof Error ? error.message : String(error)}`;
|
|
134
151
|
}
|
|
135
152
|
}
|
|
@@ -192,12 +209,12 @@ export function createDashboardConnection(request) {
|
|
|
192
209
|
catch (error) {
|
|
193
210
|
if (action.action === "answer-choice" && error instanceof ChoiceDeclined) {
|
|
194
211
|
if (error.stale)
|
|
195
|
-
|
|
212
|
+
disconnect();
|
|
196
213
|
state.acknowledgment.state = "refused";
|
|
197
214
|
state.error = error.message;
|
|
198
215
|
return false;
|
|
199
216
|
}
|
|
200
|
-
|
|
217
|
+
disconnect();
|
|
201
218
|
state.acknowledgment.state = "unconfirmed";
|
|
202
219
|
state.error =
|
|
203
220
|
action.action === "answer-choice"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-session-client.js","sourceRoot":"","sources":["../../src/products/dashboard-session-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAIlB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-session-client.js","sourceRoot":"","sources":["../../src/products/dashboard-session-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAIlB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAkC,MAAM,oCAAoC,CAAC;AAG9G,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAoB5C,MAAM,cAAe,SAAQ,KAAK;IACvB,KAAK,CAAU;IACxB,YAAY,KAAc;QACxB,KAAK,CACH,KAAK;YACH,CAAC,CAAC,uDAAuD;YACzD,CAAC,CAAC,sEAAsE,CAC3E,CAAC;QACF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAWD,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,UAAkB,EAClB,KAAa,EACb,OAA+B;IAE/B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,MAAM,CAAC,W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D,UAAU,EAAE,CAAC;gBACb,KAAK,CAAC,cAAc,CAAC,KAAK,GAAG,aAAa,CAAC;gBAC3C,KAAK,CAAC,KAAK;oBACT,MAAM,CAAC,MAAM,KAAK,eAAe;wBAC/B,CAAC,CAAC,yDAAyD;wBAC3D,CAAC,CAAC,gEAAgE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/H,OAAO,KAAK,CAAC;YACf,CAAC;oBAAS,CAAC;gBACT,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;YACxB,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AutoModeSource } from "../kernel/auto-mode.ts";
|
|
1
2
|
/** Settings are owner observations; rendering never grants consent or changes execution. */
|
|
2
3
|
export declare const JEV_EDIT_ACTIONS: readonly ["limit", "configure", "hints"];
|
|
3
4
|
export type JevEditAction = (typeof JEV_EDIT_ACTIONS)[number];
|
|
@@ -39,5 +40,5 @@ export interface DashboardSettingsSnapshot {
|
|
|
39
40
|
export declare const JEV_EDITOR_NOTICE = "Finish editing in the main Pi session.";
|
|
40
41
|
export declare const JEV_CONSENT_NOTICE = "Complete JEV paid-call and LoRA-storage choices in the parent Pi session";
|
|
41
42
|
export declare function dashboardJevNotice(jev: DashboardJevState): string;
|
|
42
|
-
export declare function dashboardSettingsLines(settings: DashboardSettingsSnapshot | undefined, auto: boolean | undefined, selected: DashboardSettingKey, width: number): string[];
|
|
43
|
+
export declare function dashboardSettingsLines(settings: DashboardSettingsSnapshot | undefined, auto: boolean | undefined, selected: DashboardSettingKey, width: number, autoSource?: AutoModeSource): string[];
|
|
43
44
|
//# sourceMappingURL=dashboard-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-settings.d.ts","sourceRoot":"","sources":["../../src/products/dashboard-settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-settings.d.ts","sourceRoot":"","sources":["../../src/products/dashboard-settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,4FAA4F;AAC5F,eAAO,MAAM,gBAAgB,0CAA2C,CAAC;AACzE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,aACX,CAAC;AAChD,MAAM,MAAM,mBAAmB,GAC7B,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AACzF,eAAO,MAAM,sBAAsB,EAAE,mBAAmB,EAQvD,CAAC;AACF,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,iBAAiB,GAAG,mBAAmB,EAAE,CAGjF;AACD,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,iBAAiB,CAAC;CACxB;AACD,eAAO,MAAM,iBAAiB,2CAA2C,CAAC;AAC1E,eAAO,MAAM,kBAAkB,6EAA6E,CAAC;AAC7G,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,iBAAiB,GAAG,MAAM,CAIjE;AACD,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,yBAAyB,GAAG,SAAS,EAC/C,IAAI,EAAE,OAAO,GAAG,SAAS,EACzB,QAAQ,EAAE,mBAAmB,EAC7B,KAAK,EAAE,MAAM,EACb,UAAU,CAAC,EAAE,cAAc,GAC1B,MAAM,EAAE,CAyEV"}
|
|
@@ -24,7 +24,7 @@ export function dashboardJevNotice(jev) {
|
|
|
24
24
|
return "JEV controls unavailable; inspect the parent Pi session";
|
|
25
25
|
return jev.error || `JEV ${jev.enabled ? "enabled" : "disabled"}; ${jev.availability ?? "status unknown"}`;
|
|
26
26
|
}
|
|
27
|
-
export function dashboardSettingsLines(settings, auto, selected, width) {
|
|
27
|
+
export function dashboardSettingsLines(settings, auto, selected, width, autoSource) {
|
|
28
28
|
if (!settings)
|
|
29
29
|
return ["Owner settings unavailable. Reconnect from /grants dashboard."];
|
|
30
30
|
const row = (key, label, nested = false) => `${key === selected ? ">" : " "}${nested ? " " : " "}${label}`;
|
|
@@ -45,6 +45,15 @@ export function dashboardSettingsLines(settings, auto, selected, width) {
|
|
|
45
45
|
return [
|
|
46
46
|
sectionHeading("PERMISSIONS", width),
|
|
47
47
|
row("auto", `Permission Auto: ${auto ? "ON" : "OFF"}`),
|
|
48
|
+
...(autoSource
|
|
49
|
+
? [
|
|
50
|
+
autoSource === "session"
|
|
51
|
+
? " Session choice; /new uses the startup setting."
|
|
52
|
+
: autoSource === "environment"
|
|
53
|
+
? " From the startup environment."
|
|
54
|
+
: " Startup default: OFF.",
|
|
55
|
+
]
|
|
56
|
+
: []),
|
|
48
57
|
"",
|
|
49
58
|
sectionHeading("JEV · optional advice", width),
|
|
50
59
|
row("jev", `JEV: ${jev.pending ? "waiting for consent" : !jev.available ? "unavailable" : jev.enabled ? "ON" : "OFF"}`),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-settings.js","sourceRoot":"","sources":["../../src/products/dashboard-settings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dashboard-settings.js","sourceRoot":"","sources":["../../src/products/dashboard-settings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAU,CAAC;AAEzE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAc,EAA0B,EAAE,CACxE,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;AAGhD,MAAM,CAAC,MAAM,sBAAsB,GAA0B;IAC3D,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS;CACV,CAAC;AAoBF,MAAM,UAAU,kBAAkB,CAAC,GAAuB;IACxD,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,SAA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CAAC,CAAC,CAAC,iDAAiD,CAAC,CAAC;QACxD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,EAAE;QACF,cAAc,CAAC,gBAAgB,EAAE,KAAK,CAAC;QACvC,GAAG,CAAC,MAAM,EAAE,eAAe,QAAQ,CAAC,WAAW,MAAM,QAAQ,CAAC,UAAU,GAAG,CAAC;QAC5E,GAAG,CAAC,MAAM,EAAE,eAAe,QAAQ,CAAC,WAAW,MAAM,QAAQ,CAAC,UAAU,GAAG,CAAC;QAC5E,QAAQ,CAAC,QAAQ;YACf,CAAC,CAAC,gDAAgD;YAClD,CAAC,CAAC,sDAAsD;QAC1D,EAAE;QACF,cAAc,CAAC,oCAAoC,EAAE,KAAK,CAAC;QAC3D,GAAG,CAAC,aAAa,EAAE,uBAAuB,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,QAAQ,8BAA8B,CAAC;QACnH,GAAG,CAAC,OAAO,EAAE,kBAAkB,QAAQ,CAAC,QAAQ,uBAAuB,CAAC;QACxE,GAAG,CAAC,SAAS,EAAE,sBAAsB,QAAQ,CAAC,OAAO,uBAAuB,CAAC;KAC9E,CAAC;AACJ,CAAC"}
|
package/extensions/approvals.ts
CHANGED
|
@@ -168,13 +168,13 @@ export async function storedApprovals(
|
|
|
168
168
|
gated: Capability[],
|
|
169
169
|
subject: string,
|
|
170
170
|
expectedBinding?: ApprovalBinding,
|
|
171
|
-
): Promise<ResolveApprovalsResult> {
|
|
171
|
+
): Promise<ResolveApprovalsResult & { recheckReasons: Record<Capability, string> }> {
|
|
172
172
|
const { valid, dropped } = await loadApprovals({
|
|
173
173
|
cwd: session.cwd,
|
|
174
174
|
now: new Date(),
|
|
175
175
|
snapshotOf: (name) => snapshotOf(session, name),
|
|
176
176
|
});
|
|
177
|
-
|
|
177
|
+
const result = resolveApprovals({
|
|
178
178
|
gated,
|
|
179
179
|
subject,
|
|
180
180
|
sessionApprovals: session.sessionApprovals,
|
|
@@ -186,6 +186,28 @@ export async function storedApprovals(
|
|
|
186
186
|
// arrives at `session_start` — after the session object is built.
|
|
187
187
|
inherited: verifyInherited(session.inheritedApprovals, (name) => snapshotOf(session, name)),
|
|
188
188
|
});
|
|
189
|
+
const recheckReasons: Record<Capability, string> = {};
|
|
190
|
+
const reasons = {
|
|
191
|
+
expired: "The previous permission expired or its expiry could not be verified.",
|
|
192
|
+
"instructions-changed": "The agent instructions changed or their previous version could not be verified.",
|
|
193
|
+
"type-changed": "The agent’s requested tools changed since the previous permission.",
|
|
194
|
+
"type-missing": "The previously approved agent definition is no longer available.",
|
|
195
|
+
"foreign-cwd": "The previous permission belongs to a different project folder.",
|
|
196
|
+
valid: "",
|
|
197
|
+
};
|
|
198
|
+
for (const capability of result.needsPrompt) {
|
|
199
|
+
const key = approvalKey(capability, subject);
|
|
200
|
+
const previous = dropped.find((entry) => entry.key === key);
|
|
201
|
+
if (previous) recheckReasons[capability] = reasons[previous.verdict];
|
|
202
|
+
else if (result.scopeMismatched.includes(capability))
|
|
203
|
+
recheckReasons[capability] = "The saved permission covers a different request.";
|
|
204
|
+
else {
|
|
205
|
+
const inherited = session.inheritedApprovals.get(key);
|
|
206
|
+
if (inherited && inherited !== snapshotOf(session, subject)?.bodySha256)
|
|
207
|
+
recheckReasons[capability] = reasons["instructions-changed"];
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return { ...result, recheckReasons };
|
|
189
211
|
}
|
|
190
212
|
|
|
191
213
|
/**
|
|
@@ -255,40 +277,32 @@ export async function obtainApprovals(
|
|
|
255
277
|
let refusalCode: RefusalCode | undefined;
|
|
256
278
|
let reason: string | undefined;
|
|
257
279
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
// RPC mode too, so an automated client's timeout or dismissal there would misreport as "a human
|
|
277
|
-
// declined" if we asked `ctx.hasUI` instead. Only `kind === "declined"` means a person said no.
|
|
278
|
-
humanDenied = outcome.kind === "declined";
|
|
279
|
-
// The full discriminant, not just the one bit of it that had a field. `no-ui`, `dismissed` and
|
|
280
|
-
// `error` used to produce records identical to each other, separated only by free-text `reason` —
|
|
281
|
-
// so "was there an operator who timed out, or was there nobody?" had no answer, and the two want
|
|
282
|
-
// different fixes. It was computed here all along and thrown away.
|
|
283
|
-
gateOutcome = outcome.kind;
|
|
284
|
-
refusalCode = pre.expired.includes(capability)
|
|
280
|
+
const outcome = await gate.request({
|
|
281
|
+
capability: pre.needsPrompt[0]!,
|
|
282
|
+
capabilities: pre.needsPrompt,
|
|
283
|
+
subject,
|
|
284
|
+
path,
|
|
285
|
+
task,
|
|
286
|
+
signal,
|
|
287
|
+
project: session.cwd,
|
|
288
|
+
workspace: expectedBinding?.workspace_id,
|
|
289
|
+
recheckReason: [...new Set(Object.values(pre.recheckReasons))].join(" ") || undefined,
|
|
290
|
+
...(expectedBinding ? { bindingKey: approvalBindingDigest(expectedBinding) } : {}),
|
|
291
|
+
});
|
|
292
|
+
if (outcome.scope === null) {
|
|
293
|
+
// Only an explicit Deny is a human refusal. Cancellation, expiry and UI failure grant nothing.
|
|
294
|
+
humanDenied = outcome.kind === "declined";
|
|
295
|
+
gateOutcome = outcome.kind;
|
|
296
|
+
refusalCode =
|
|
297
|
+
pre.expired.length > 0
|
|
285
298
|
? "APPROVAL_EXPIRED"
|
|
286
|
-
: pre.scopeMismatched.
|
|
299
|
+
: pre.scopeMismatched.length > 0
|
|
287
300
|
? "APPROVAL_SCOPE_MISMATCH"
|
|
288
301
|
: "GATED_UNAPPROVED";
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
302
|
+
reason = outcome.reason;
|
|
303
|
+
}
|
|
304
|
+
for (const capability of outcome.scope === null ? [] : pre.needsPrompt) {
|
|
305
|
+
const scope = outcome.scope!;
|
|
292
306
|
approved.push(capability);
|
|
293
307
|
// R-66: `prompt` means A HUMAN SAW A DIALOG FOR THIS. A caller that joined another's in-flight answer
|
|
294
308
|
// did not, so it records the source it actually had — the session approval that answer created. Eight
|
|
@@ -296,12 +310,12 @@ export async function obtainApprovals(
|
|
|
296
310
|
// prompt. Same repair as R-46, one level up: stop asserting a human was asked on a path where they
|
|
297
311
|
// were not.
|
|
298
312
|
sources[capability] = outcome.source === "auto" ? "auto" : outcome.joined ? "session" : "prompt";
|
|
299
|
-
scopes[capability] =
|
|
300
|
-
recordedScopes[capability] =
|
|
313
|
+
scopes[capability] = scope;
|
|
314
|
+
recordedScopes[capability] = scope;
|
|
301
315
|
if (expectedBinding) bindings[capability] = expectedBinding;
|
|
302
|
-
if (
|
|
316
|
+
if (scope === "once") uses[capability] = { max: 1, remaining: 0 };
|
|
303
317
|
|
|
304
|
-
if (
|
|
318
|
+
if (scope === "session" || scope === "always") {
|
|
305
319
|
const key = approvalKey(capability, subject);
|
|
306
320
|
// Whether THIS call created the authority, decided before we add it. `joined` means a human answer
|
|
307
321
|
// opened by another delegation was shared with us; an existing key means it was already standing.
|
|
@@ -313,7 +327,7 @@ export async function obtainApprovals(
|
|
|
313
327
|
else session.sessionApprovals.add(key);
|
|
314
328
|
banked.push({ key, capability, subject, persisted: false, owned });
|
|
315
329
|
}
|
|
316
|
-
if (
|
|
330
|
+
if (scope === "always") {
|
|
317
331
|
const now = new Date();
|
|
318
332
|
const current = snapshot(subject);
|
|
319
333
|
// No readable ceiling means the entry would carry `grantAtApproval: []`, which `entryVerdict`
|
|
@@ -2,6 +2,26 @@ import type { InheritableApproval } from "../src/kernel/approval.ts";
|
|
|
2
2
|
import type { Capability } from "../src/kernel/resolve.ts";
|
|
3
3
|
import type { ApprovalOutcome } from "./approvals.ts";
|
|
4
4
|
|
|
5
|
+
/** An upfront Auto answer is provisional until an actual step admission, never consumed approval evidence. */
|
|
6
|
+
export function retainedChainApproval(outcome: ApprovalOutcome): ApprovalOutcome | undefined {
|
|
7
|
+
const approved = outcome.approved.filter((capability) => outcome.sources[capability] !== "auto");
|
|
8
|
+
if (!approved.length) return undefined;
|
|
9
|
+
const keep = new Set(approved);
|
|
10
|
+
const filter = <T>(values: Record<Capability, T>): Record<Capability, T> =>
|
|
11
|
+
Object.fromEntries(Object.entries(values).filter(([capability]) => keep.has(capability)));
|
|
12
|
+
return {
|
|
13
|
+
...outcome,
|
|
14
|
+
approved,
|
|
15
|
+
sources: filter(outcome.sources),
|
|
16
|
+
scopes: filter(outcome.scopes),
|
|
17
|
+
recordedScopes: filter(outcome.recordedScopes),
|
|
18
|
+
bindings: filter(outcome.bindings),
|
|
19
|
+
expiresAt: filter(outcome.expiresAt),
|
|
20
|
+
uses: filter(outcome.uses),
|
|
21
|
+
...(outcome.banked ? { banked: outcome.banked.filter((entry) => keep.has(entry.capability)) } : {}),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
5
25
|
export interface ChainApprovalAudit {
|
|
6
26
|
sources: Map<string, ApprovalOutcome["sources"][Capability]>;
|
|
7
27
|
scopes: Map<string, ApprovalOutcome["recordedScopes"][Capability]>;
|
|
@@ -104,6 +104,7 @@ interface DashboardWireRequest {
|
|
|
104
104
|
enabled?: unknown;
|
|
105
105
|
key?: unknown;
|
|
106
106
|
refreshChoices?: unknown;
|
|
107
|
+
refreshSources?: unknown;
|
|
107
108
|
seconds?: unknown;
|
|
108
109
|
option?: unknown;
|
|
109
110
|
sourceGeneration?: unknown;
|
|
@@ -208,11 +209,14 @@ async function respond(
|
|
|
208
209
|
return { ok: false, choiceOutcome: "stale", error: "Choice is no longer available. Refresh and reopen it." };
|
|
209
210
|
const choiceRefreshRequested =
|
|
210
211
|
request.action === "get" && request.refreshChoices === true && session.dashboardChoices?.requestRenewal();
|
|
212
|
+
const sourceRefreshRequested =
|
|
213
|
+
request.action === "get" && request.refreshSources === true && session.dashboardRefreshSources?.();
|
|
211
214
|
const choiceControls = session.dashboardChoices?.controls();
|
|
212
215
|
return {
|
|
213
216
|
ok: true,
|
|
214
217
|
...(choiceControls ? { choiceControls } : {}),
|
|
215
218
|
...(choiceRefreshRequested ? { choiceRefreshRequested: true } : {}),
|
|
219
|
+
...(sourceRefreshRequested ? { sourceRefreshRequested: true } : {}),
|
|
216
220
|
...(choiceDetail ? { choiceDetail } : {}),
|
|
217
221
|
...(request.action === "answer-choice" ? { choiceSaved: true } : {}),
|
|
218
222
|
...controls,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/** Visible-client demand may recheck bounded metadata; no timer starts work on its own. */
|
|
2
|
+
import type {
|
|
3
|
+
DashboardSourceRefreshCallback,
|
|
4
|
+
DashboardSourceSnapshot,
|
|
5
|
+
DashboardSourceUpdate,
|
|
6
|
+
} from "../src/kernel/dashboard-observation.ts";
|
|
7
|
+
|
|
8
|
+
export const DASHBOARD_REFRESH_INTERVAL_MS = 30_000;
|
|
9
|
+
export const DASHBOARD_REFRESH_TIMEOUT_MS = 5_000;
|
|
10
|
+
const MAX_BACKOFF_MS = 300_000;
|
|
11
|
+
|
|
12
|
+
export function dashboardSourceRefresh(
|
|
13
|
+
snapshot: DashboardSourceSnapshot,
|
|
14
|
+
refresh: DashboardSourceRefreshCallback,
|
|
15
|
+
active: () => boolean,
|
|
16
|
+
publish: (value: DashboardSourceUpdate) => boolean,
|
|
17
|
+
now: () => number,
|
|
18
|
+
) {
|
|
19
|
+
let closed = false,
|
|
20
|
+
failures = 0,
|
|
21
|
+
nextAttempt = 0;
|
|
22
|
+
let lastAttempt: number | undefined;
|
|
23
|
+
let pending:
|
|
24
|
+
| { controller: AbortController; timer: ReturnType<typeof setTimeout>; failed: boolean; attemptedAt: string }
|
|
25
|
+
| undefined;
|
|
26
|
+
snapshot.refresh = { state: "idle" };
|
|
27
|
+
const current = () => !closed && active();
|
|
28
|
+
return {
|
|
29
|
+
observed(replacedInventory: boolean) {
|
|
30
|
+
if (!current()) return;
|
|
31
|
+
if (snapshot.refresh?.state === "failed" && !replacedInventory) return;
|
|
32
|
+
if (pending && !pending.controller.signal.aborted && !replacedInventory) return;
|
|
33
|
+
pending?.controller.abort();
|
|
34
|
+
if (pending) clearTimeout(pending.timer);
|
|
35
|
+
failures = 0;
|
|
36
|
+
nextAttempt = lastAttempt === undefined ? 0 : lastAttempt + DASHBOARD_REFRESH_INTERVAL_MS;
|
|
37
|
+
snapshot.refresh = {
|
|
38
|
+
state: "idle",
|
|
39
|
+
...(nextAttempt ? { nextAttemptAt: new Date(nextAttempt).toISOString() } : {}),
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
request() {
|
|
43
|
+
if (!current()) return false;
|
|
44
|
+
if (pending) return !pending.controller.signal.aborted;
|
|
45
|
+
const time = now();
|
|
46
|
+
if (time < nextAttempt) return false;
|
|
47
|
+
lastAttempt = time;
|
|
48
|
+
const controller = new AbortController(),
|
|
49
|
+
attemptedAt = new Date(time).toISOString();
|
|
50
|
+
const fail = () => {
|
|
51
|
+
if (!current() || pending !== attempt || attempt.failed) return;
|
|
52
|
+
attempt.failed = true;
|
|
53
|
+
failures++;
|
|
54
|
+
nextAttempt = now() + Math.min(DASHBOARD_REFRESH_INTERVAL_MS * 2 ** (failures - 1), MAX_BACKOFF_MS);
|
|
55
|
+
snapshot.refresh = { state: "failed", attemptedAt, nextAttemptAt: new Date(nextAttempt).toISOString() };
|
|
56
|
+
};
|
|
57
|
+
const timer = setTimeout(() => {
|
|
58
|
+
controller.abort();
|
|
59
|
+
fail();
|
|
60
|
+
}, DASHBOARD_REFRESH_TIMEOUT_MS);
|
|
61
|
+
timer.unref?.();
|
|
62
|
+
const attempt = { controller, timer, failed: false, attemptedAt };
|
|
63
|
+
pending = attempt;
|
|
64
|
+
snapshot.refresh = { state: "checking", attemptedAt };
|
|
65
|
+
void Promise.resolve()
|
|
66
|
+
.then(() => {
|
|
67
|
+
if (current() && !controller.signal.aborted) return refresh({ signal: controller.signal });
|
|
68
|
+
})
|
|
69
|
+
.then((value) => {
|
|
70
|
+
if (!current() || controller.signal.aborted || pending !== attempt) return;
|
|
71
|
+
if (!value || !publish(value)) {
|
|
72
|
+
fail();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
failures = 0;
|
|
76
|
+
nextAttempt = now() + DASHBOARD_REFRESH_INTERVAL_MS;
|
|
77
|
+
snapshot.refresh = { state: "idle", attemptedAt, nextAttemptAt: new Date(nextAttempt).toISOString() };
|
|
78
|
+
})
|
|
79
|
+
.catch(() => {
|
|
80
|
+
if (!controller.signal.aborted) fail();
|
|
81
|
+
})
|
|
82
|
+
.finally(() => {
|
|
83
|
+
clearTimeout(timer);
|
|
84
|
+
if (pending === attempt) pending = undefined;
|
|
85
|
+
});
|
|
86
|
+
return true;
|
|
87
|
+
},
|
|
88
|
+
close() {
|
|
89
|
+
closed = true;
|
|
90
|
+
pending?.controller.abort();
|
|
91
|
+
if (pending) clearTimeout(pending.timer);
|
|
92
|
+
snapshot.refresh = { ...snapshot.refresh, state: "idle" };
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Optional trusted producers publish display observations; no automatic work, tools, or persistent store. */
|
|
2
2
|
import { registerDashboardChoiceOwner } from "./dashboard-choice-controls.ts";
|
|
3
|
+
import { dashboardSourceRefresh } from "./dashboard-source-refresh.ts";
|
|
3
4
|
import { randomUUID } from "node:crypto";
|
|
4
5
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
5
6
|
import {
|
|
@@ -8,6 +9,7 @@ import {
|
|
|
8
9
|
isBookieChoice,
|
|
9
10
|
validDashboardSourceUpdate,
|
|
10
11
|
type DashboardSourceSnapshot,
|
|
12
|
+
type DashboardSourceRefreshCallback,
|
|
11
13
|
type DashboardSourceUpdate,
|
|
12
14
|
} from "../src/kernel/dashboard-observation.ts";
|
|
13
15
|
export interface DashboardSourceOwner {
|
|
@@ -20,6 +22,7 @@ export function registerDashboardSources(
|
|
|
20
22
|
now: () => number = Date.now,
|
|
21
23
|
) {
|
|
22
24
|
const sources = new Map<string, DashboardSourceSnapshot>();
|
|
25
|
+
const refreshers = new Map<string, ReturnType<typeof dashboardSourceRefresh>>();
|
|
23
26
|
let closed = false;
|
|
24
27
|
let owner = current(),
|
|
25
28
|
generation = randomUUID(),
|
|
@@ -29,6 +32,8 @@ export function registerDashboardSources(
|
|
|
29
32
|
const selected = current();
|
|
30
33
|
if (selected !== owner) {
|
|
31
34
|
owner = selected;
|
|
35
|
+
for (const refresh of refreshers.values()) refresh.close();
|
|
36
|
+
refreshers.clear();
|
|
32
37
|
sources.clear();
|
|
33
38
|
generation = randomUUID();
|
|
34
39
|
sequence = 0;
|
|
@@ -51,6 +56,7 @@ export function registerDashboardSources(
|
|
|
51
56
|
cwd?: unknown;
|
|
52
57
|
producer?: unknown;
|
|
53
58
|
producerVersion?: unknown;
|
|
59
|
+
refresh?: unknown;
|
|
54
60
|
reply?: (value: unknown) => void;
|
|
55
61
|
};
|
|
56
62
|
if (r?.version !== 1 || typeof r.reply !== "function") return;
|
|
@@ -71,6 +77,7 @@ export function registerDashboardSources(
|
|
|
71
77
|
typeof r.producerVersion !== "string" ||
|
|
72
78
|
!r.producerVersion ||
|
|
73
79
|
r.producerVersion.length > 80 ||
|
|
80
|
+
(r.refresh !== undefined && typeof r.refresh !== "function") ||
|
|
74
81
|
(!sources.has(r.producer) && sources.size >= DASHBOARD_SOURCE_LIMIT)
|
|
75
82
|
) {
|
|
76
83
|
reply({ version: 1, ok: false, reason: "dashboard source registration unavailable" });
|
|
@@ -89,21 +96,44 @@ export function registerDashboardSources(
|
|
|
89
96
|
items: [],
|
|
90
97
|
};
|
|
91
98
|
sources.set(producer, snapshot);
|
|
99
|
+
refreshers.get(producer)?.close();
|
|
100
|
+
refreshers.delete(producer);
|
|
92
101
|
const active = () =>
|
|
93
102
|
reconcile() === selected && sources.get(producer) === snapshot && snapshot.availability !== "closed";
|
|
103
|
+
const publish = (value: DashboardSourceUpdate) => {
|
|
104
|
+
if (!active() || !validDashboardSourceUpdate(value) || value.sequence <= snapshot.sequence) return false;
|
|
105
|
+
snapshot.sequence = value.sequence;
|
|
106
|
+
snapshot.items = structuredClone(value.items);
|
|
107
|
+
if (value.inventory) snapshot.inventory = structuredClone(value.inventory);
|
|
108
|
+
else delete snapshot.inventory;
|
|
109
|
+
snapshot.observedAt = new Date(now()).toISOString();
|
|
110
|
+
return true;
|
|
111
|
+
};
|
|
112
|
+
if (r.refresh)
|
|
113
|
+
refreshers.set(
|
|
114
|
+
producer,
|
|
115
|
+
dashboardSourceRefresh(snapshot, r.refresh as DashboardSourceRefreshCallback, active, publish, now),
|
|
116
|
+
);
|
|
94
117
|
reply({
|
|
95
118
|
version: 1,
|
|
96
119
|
ok: true,
|
|
97
120
|
generation: token,
|
|
121
|
+
capabilities: { inventory: 1, refresh: 1 },
|
|
98
122
|
publish(value: DashboardSourceUpdate) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
const previousInventory = snapshot.inventory;
|
|
124
|
+
if (!publish(value)) return false;
|
|
125
|
+
refreshers
|
|
126
|
+
.get(producer)
|
|
127
|
+
?.observed(
|
|
128
|
+
value.inventory !== undefined && JSON.stringify(previousInventory) !== JSON.stringify(value.inventory),
|
|
129
|
+
);
|
|
103
130
|
return true;
|
|
104
131
|
},
|
|
105
132
|
close() {
|
|
106
133
|
if (active()) {
|
|
134
|
+
refreshers.get(producer)?.close();
|
|
135
|
+
refreshers.delete(producer);
|
|
136
|
+
delete snapshot.inventory;
|
|
107
137
|
snapshot.items = snapshot.items.filter((item) => !isBookieChoice(producer, item));
|
|
108
138
|
snapshot.availability = "closed";
|
|
109
139
|
snapshot.observedAt = new Date(now()).toISOString();
|
|
@@ -113,6 +143,12 @@ export function registerDashboardSources(
|
|
|
113
143
|
});
|
|
114
144
|
return {
|
|
115
145
|
choices,
|
|
146
|
+
requestRefresh() {
|
|
147
|
+
if (!reconcile()) return false;
|
|
148
|
+
let requested = false;
|
|
149
|
+
for (const refresh of refreshers.values()) requested = refresh.request() || requested;
|
|
150
|
+
return requested;
|
|
151
|
+
},
|
|
116
152
|
snapshot() {
|
|
117
153
|
const selected = reconcile();
|
|
118
154
|
return selected
|
|
@@ -128,6 +164,8 @@ export function registerDashboardSources(
|
|
|
128
164
|
},
|
|
129
165
|
close() {
|
|
130
166
|
closed = true;
|
|
167
|
+
for (const refresh of refreshers.values()) refresh.close();
|
|
168
|
+
refreshers.clear();
|
|
131
169
|
choices.close();
|
|
132
170
|
off?.();
|
|
133
171
|
sources.clear();
|
|
@@ -38,6 +38,7 @@ export function registerDefinitionDescribe(pi: ExtensionAPI, session: GrantsSess
|
|
|
38
38
|
bodySha256: digestDefinition(definition).sha256,
|
|
39
39
|
binding: definition.binding ?? null,
|
|
40
40
|
definitionId: definition.definitionId,
|
|
41
|
+
selectedResources: definition.selectedResources ?? null,
|
|
41
42
|
};
|
|
42
43
|
const capture = publicEvidenceCall(session.publicEvidence, _id, "delegate_describe", [{ agent: params.agent }]);
|
|
43
44
|
capture.selected(0, definition);
|