pi-daddy 0.49.5 → 0.50.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 +51 -1
- package/README.md +217 -27
- package/dist/governance/initiative-coordinator.d.ts +58 -0
- package/dist/governance/initiative-coordinator.d.ts.map +1 -0
- package/dist/governance/initiative-coordinator.js +348 -0
- package/dist/governance/initiative-coordinator.js.map +1 -0
- package/dist/governance/initiative-effects.d.ts +20 -0
- package/dist/governance/initiative-effects.d.ts.map +1 -0
- package/dist/governance/initiative-effects.js +108 -0
- package/dist/governance/initiative-effects.js.map +1 -0
- package/dist/governance/initiative-state.d.ts +13 -0
- package/dist/governance/initiative-state.d.ts.map +1 -0
- package/dist/governance/initiative-state.js +122 -0
- package/dist/governance/initiative-state.js.map +1 -0
- package/dist/governance/operation-artifact-io.d.ts +8 -0
- package/dist/governance/operation-artifact-io.d.ts.map +1 -0
- package/dist/governance/operation-artifact-io.js +95 -0
- package/dist/governance/operation-artifact-io.js.map +1 -0
- package/dist/governance/operation-artifact-scan.d.ts +13 -0
- package/dist/governance/operation-artifact-scan.d.ts.map +1 -0
- package/dist/governance/operation-artifact-scan.js +71 -0
- package/dist/governance/operation-artifact-scan.js.map +1 -0
- package/dist/governance/operation-artifacts.d.ts +53 -0
- package/dist/governance/operation-artifacts.d.ts.map +1 -0
- package/dist/governance/operation-artifacts.js +309 -0
- package/dist/governance/operation-artifacts.js.map +1 -0
- package/dist/governance/runtime-settlement.d.ts +2 -0
- package/dist/governance/runtime-settlement.d.ts.map +1 -1
- package/dist/governance/runtime-settlement.js +26 -0
- package/dist/governance/runtime-settlement.js.map +1 -1
- package/dist/governance/workspace-acceptance.d.ts +5 -0
- package/dist/governance/workspace-acceptance.d.ts.map +1 -1
- package/dist/governance/workspace-acceptance.js +16 -0
- package/dist/governance/workspace-acceptance.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/kernel/dashboard-observation.d.ts +76 -0
- package/dist/kernel/dashboard-observation.d.ts.map +1 -0
- package/dist/kernel/dashboard-observation.js +49 -0
- package/dist/kernel/dashboard-observation.js.map +1 -0
- package/dist/kernel/dispatch-operation.d.ts +2 -0
- package/dist/kernel/dispatch-operation.d.ts.map +1 -1
- package/dist/kernel/dispatch-operation.js.map +1 -1
- package/dist/kernel/initiative.d.ts +94 -0
- package/dist/kernel/initiative.d.ts.map +1 -0
- package/dist/kernel/initiative.js +38 -0
- package/dist/kernel/initiative.js.map +1 -0
- package/dist/kernel/operation-artifact.d.ts +49 -0
- package/dist/kernel/operation-artifact.d.ts.map +1 -0
- package/dist/kernel/operation-artifact.js +4 -0
- package/dist/kernel/operation-artifact.js.map +1 -0
- package/dist/kernel/principal-binding.d.ts +4 -0
- package/dist/kernel/principal-binding.d.ts.map +1 -0
- package/dist/kernel/principal-binding.js +94 -0
- package/dist/kernel/principal-binding.js.map +1 -0
- package/dist/kernel/project-paths.d.ts +6 -0
- package/dist/kernel/project-paths.d.ts.map +1 -1
- package/dist/kernel/project-paths.js +12 -0
- package/dist/kernel/project-paths.js.map +1 -1
- package/dist/kernel/selected-definitions.d.ts.map +1 -1
- package/dist/kernel/selected-definitions.js +5 -91
- package/dist/kernel/selected-definitions.js.map +1 -1
- package/dist/kernel/workspace-diagnostics.d.ts +24 -0
- package/dist/kernel/workspace-diagnostics.d.ts.map +1 -0
- package/dist/kernel/workspace-diagnostics.js +81 -0
- package/dist/kernel/workspace-diagnostics.js.map +1 -0
- package/dist/products/activity-storage.d.ts +2 -0
- package/dist/products/activity-storage.d.ts.map +1 -0
- package/dist/products/activity-storage.js +119 -0
- package/dist/products/activity-storage.js.map +1 -0
- package/dist/products/activity-timeline.d.ts +4 -0
- package/dist/products/activity-timeline.d.ts.map +1 -1
- package/dist/products/activity-timeline.js +12 -0
- package/dist/products/activity-timeline.js.map +1 -1
- package/dist/products/dashboard-cli.d.ts +2 -0
- package/dist/products/dashboard-cli.d.ts.map +1 -1
- package/dist/products/dashboard-cli.js +41 -9
- package/dist/products/dashboard-cli.js.map +1 -1
- package/dist/products/dashboard-display-controls.d.ts.map +1 -1
- package/dist/products/dashboard-display-controls.js +30 -0
- package/dist/products/dashboard-display-controls.js.map +1 -1
- package/dist/products/dashboard-file-cache.d.ts +10 -0
- package/dist/products/dashboard-file-cache.d.ts.map +1 -0
- package/dist/products/dashboard-file-cache.js +38 -0
- package/dist/products/dashboard-file-cache.js.map +1 -0
- package/dist/products/dashboard-panels.d.ts +6 -0
- package/dist/products/dashboard-panels.d.ts.map +1 -0
- package/dist/products/dashboard-panels.js +179 -0
- package/dist/products/dashboard-panels.js.map +1 -0
- package/dist/products/dashboard-screen.d.ts +8 -0
- package/dist/products/dashboard-screen.d.ts.map +1 -1
- package/dist/products/dashboard-screen.js +86 -15
- package/dist/products/dashboard-screen.js.map +1 -1
- package/dist/products/dashboard-session-client.d.ts +16 -2
- package/dist/products/dashboard-session-client.d.ts.map +1 -1
- package/dist/products/dashboard-session-client.js +64 -11
- package/dist/products/dashboard-session-client.js.map +1 -1
- package/dist/products/dashboard-settings.d.ts.map +1 -1
- package/dist/products/dashboard-settings.js +4 -6
- package/dist/products/dashboard-settings.js.map +1 -1
- package/dist/products/ecosystem-versions.d.ts +1 -1
- package/dist/products/ecosystem-versions.d.ts.map +1 -1
- package/extensions/activity-timeline.ts +3 -1
- package/extensions/artifact-bridge.ts +130 -0
- package/extensions/dashboard-live.ts +63 -0
- package/extensions/dashboard-observation.ts +39 -0
- package/extensions/dashboard-session-server.ts +45 -3
- package/extensions/dashboard-sources.ts +124 -0
- package/extensions/delegation-artifacts.ts +125 -0
- package/extensions/delegation-operations.ts +42 -13
- package/extensions/ecosystem-versions.ts +12 -5
- package/extensions/grants-command.ts +34 -6
- package/extensions/grants.ts +9 -20
- package/extensions/initiative-dashboard.ts +143 -0
- package/extensions/initiative-runtime.ts +406 -0
- package/extensions/runtime-snapshot.ts +118 -2
- package/extensions/session-environment.ts +13 -1
- package/extensions/session.ts +28 -10
- package/extensions/workspace-diagnostics.ts +90 -0
- package/package.json +1 -1
- package/src/governance/initiative-coordinator.ts +400 -0
- package/src/governance/initiative-effects.ts +146 -0
- package/src/governance/initiative-state.ts +144 -0
- package/src/governance/operation-artifact-io.ts +103 -0
- package/src/governance/operation-artifact-scan.ts +77 -0
- package/src/governance/operation-artifacts.ts +363 -0
- package/src/governance/runtime-settlement.ts +28 -0
- package/src/governance/workspace-acceptance.ts +18 -0
- package/src/index.ts +13 -0
- package/src/kernel/dashboard-observation.ts +109 -0
- package/src/kernel/dispatch-operation.ts +2 -0
- package/src/kernel/initiative.ts +126 -0
- package/src/kernel/operation-artifact.ts +46 -0
- package/src/kernel/principal-binding.ts +104 -0
- package/src/kernel/project-paths.ts +16 -0
- package/src/kernel/selected-definitions.ts +5 -100
- package/src/kernel/workspace-diagnostics.ts +110 -0
- package/src/products/activity-storage.ts +128 -0
- package/src/products/activity-timeline.ts +11 -0
- package/src/products/dashboard-cli.ts +44 -9
- package/src/products/dashboard-display-controls.ts +27 -0
- package/src/products/dashboard-file-cache.ts +38 -0
- package/src/products/dashboard-panels.ts +217 -0
- package/src/products/dashboard-screen.ts +107 -17
- package/src/products/dashboard-session-client.ts +78 -14
- package/src/products/dashboard-settings.ts +4 -6
- package/src/products/ecosystem-versions.ts +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DashboardOwnerObservation } from "../kernel/dashboard-observation.ts";
|
|
1
2
|
import type { DashboardSettingsSnapshot } from "./dashboard-settings.ts";
|
|
2
3
|
import type { EcosystemVersions } from "./ecosystem-versions.ts";
|
|
3
4
|
import { createConnection } from "node:net";
|
|
@@ -5,6 +6,7 @@ import { createConnection } from "node:net";
|
|
|
5
6
|
export interface DashboardSessionSnapshot {
|
|
6
7
|
rows: Array<{ definition: string; model: string; thinking: string; source: string }>;
|
|
7
8
|
cost: number | null;
|
|
9
|
+
observation?: DashboardOwnerObservation;
|
|
8
10
|
activity?: { rootId: string; path: string; taskId: string };
|
|
9
11
|
versions?: EcosystemVersions;
|
|
10
12
|
settings?: DashboardSettingsSnapshot;
|
|
@@ -12,12 +14,13 @@ export interface DashboardSessionSnapshot {
|
|
|
12
14
|
pendingApprovals: Array<{ id: string; subject: string; capability: string }>;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
|
-
export type DashboardSessionAction =
|
|
17
|
+
export type DashboardSessionAction = (
|
|
16
18
|
| { action: "get" }
|
|
17
19
|
| { action: "set"; edits: string }
|
|
18
20
|
| { action: "set-auto"; enabled: boolean }
|
|
19
21
|
| { action: "set-jev"; enabled: boolean }
|
|
20
|
-
| { action: "set-limit"; key: "wall" | "idle"; seconds: number }
|
|
22
|
+
| { action: "set-limit"; key: "wall" | "idle"; seconds: number }
|
|
23
|
+
) & { expectedOwner?: { sessionId: string; cwd: string; generation: string } };
|
|
21
24
|
|
|
22
25
|
export async function dashboardSessionRequest(
|
|
23
26
|
socketPath: string,
|
|
@@ -55,41 +58,102 @@ export async function dashboardSessionRequest(
|
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
/**
|
|
61
|
+
/** Controls use only a connected owner; last observations remain explicitly disconnected evidence. */
|
|
59
62
|
export function createDashboardConnection(
|
|
60
63
|
request?: (action: DashboardSessionAction) => Promise<DashboardSessionSnapshot>,
|
|
61
64
|
) {
|
|
62
|
-
const state: {
|
|
63
|
-
|
|
65
|
+
const state: {
|
|
66
|
+
snapshot?: DashboardSessionSnapshot;
|
|
67
|
+
lastObserved?: DashboardSessionSnapshot;
|
|
68
|
+
pending: boolean;
|
|
69
|
+
error?: string;
|
|
70
|
+
acknowledgment?: { action: string; state: "pending" | "applied" | "refused" | "unconfirmed"; effect: string };
|
|
71
|
+
} = { pending: false };
|
|
72
|
+
let generation = 0,
|
|
73
|
+
poll = 0,
|
|
74
|
+
requestedJev: boolean | undefined;
|
|
75
|
+
const retired = new Set<string>();
|
|
76
|
+
const accept = (snapshot: DashboardSessionSnapshot) => {
|
|
77
|
+
const previous = state.lastObserved?.observation,
|
|
78
|
+
next = snapshot.observation;
|
|
79
|
+
if (previous && !next) return false;
|
|
80
|
+
if (next && retired.has(next.generation)) return false;
|
|
81
|
+
if (previous && next && previous.generation === next.generation && next.sequence <= previous.sequence) return false;
|
|
82
|
+
if (previous && next && previous.generation !== next.generation) {
|
|
83
|
+
if (retired.size >= 16) throw Error("Dashboard owner changed repeatedly; reopen the panel");
|
|
84
|
+
retired.add(previous.generation);
|
|
85
|
+
}
|
|
86
|
+
state.snapshot = snapshot;
|
|
87
|
+
state.lastObserved = snapshot;
|
|
88
|
+
state.error = undefined;
|
|
89
|
+
if (
|
|
90
|
+
state.acknowledgment?.state === "pending" &&
|
|
91
|
+
requestedJev !== undefined &&
|
|
92
|
+
snapshot.settings?.jev &&
|
|
93
|
+
!snapshot.settings.jev.pending
|
|
94
|
+
)
|
|
95
|
+
state.acknowledgment.state = snapshot.settings.jev.enabled === requestedJev ? "applied" : "refused";
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
64
98
|
return {
|
|
65
99
|
state,
|
|
66
100
|
async refresh() {
|
|
67
101
|
if (!request || state.pending) return;
|
|
68
|
-
const observed = generation
|
|
102
|
+
const observed = generation,
|
|
103
|
+
order = ++poll;
|
|
69
104
|
try {
|
|
70
105
|
const snapshot = await request({ action: "get" });
|
|
71
|
-
if (generation === observed) {
|
|
72
|
-
state.snapshot =
|
|
73
|
-
state.error =
|
|
106
|
+
if (generation === observed && order === poll && !accept(snapshot)) {
|
|
107
|
+
state.snapshot = undefined;
|
|
108
|
+
state.error = "Owner observation is stale or unavailable; controls disabled until a fresh reply.";
|
|
74
109
|
}
|
|
75
110
|
} catch (error) {
|
|
76
|
-
if (generation === observed) {
|
|
111
|
+
if (generation === observed && order === poll) {
|
|
77
112
|
state.snapshot = undefined;
|
|
78
|
-
state.error = `Controls unavailable: ${error instanceof Error ? error.message : String(error)}`;
|
|
113
|
+
state.error = `Controls unavailable; showing last observation: ${error instanceof Error ? error.message : String(error)}`;
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
},
|
|
82
117
|
async change(action: Exclude<DashboardSessionAction, { action: "get" }>) {
|
|
83
118
|
if (!request || !state.snapshot || state.pending) return false;
|
|
119
|
+
const observedOwner = state.snapshot.observation;
|
|
84
120
|
generation++;
|
|
85
121
|
state.pending = true;
|
|
122
|
+
requestedJev = action.action === "set-jev" ? action.enabled : undefined;
|
|
123
|
+
const effect =
|
|
124
|
+
action.action === "set-auto"
|
|
125
|
+
? "current permission handling; admitted work unchanged"
|
|
126
|
+
: action.action === "set-jev"
|
|
127
|
+
? "current JEV session; separate paid-call and storage choices"
|
|
128
|
+
: "future children; running children unchanged";
|
|
129
|
+
state.acknowledgment = { action: action.action, state: "pending", effect };
|
|
86
130
|
try {
|
|
87
|
-
|
|
88
|
-
|
|
131
|
+
const snapshot = await request({
|
|
132
|
+
...action,
|
|
133
|
+
...(observedOwner
|
|
134
|
+
? {
|
|
135
|
+
expectedOwner: {
|
|
136
|
+
sessionId: observedOwner.sessionId,
|
|
137
|
+
cwd: observedOwner.cwd,
|
|
138
|
+
generation: observedOwner.generation,
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
: {}),
|
|
142
|
+
});
|
|
143
|
+
if (!accept(snapshot)) throw Error("owner acknowledgment is stale; reconcile before another action");
|
|
144
|
+
state.acknowledgment.state =
|
|
145
|
+
action.action === "set-jev"
|
|
146
|
+
? snapshot.settings?.jev.pending
|
|
147
|
+
? "pending"
|
|
148
|
+
: snapshot.settings?.jev.enabled === action.enabled
|
|
149
|
+
? "applied"
|
|
150
|
+
: "refused"
|
|
151
|
+
: "applied";
|
|
89
152
|
return true;
|
|
90
153
|
} catch (error) {
|
|
91
154
|
state.snapshot = undefined;
|
|
92
|
-
state.
|
|
155
|
+
state.acknowledgment.state = "unconfirmed";
|
|
156
|
+
state.error = `Control change not confirmed; inspect owner before retrying: ${error instanceof Error ? error.message : String(error)}`;
|
|
93
157
|
return false;
|
|
94
158
|
} finally {
|
|
95
159
|
state.pending = false;
|
|
@@ -71,12 +71,10 @@ export function dashboardSettingsLines(
|
|
|
71
71
|
...(jev.error ? [` ${jev.error}`] : []),
|
|
72
72
|
row("wall", `Child wall: ${settings.wallSeconds}s (${settings.wallSource})`),
|
|
73
73
|
row("idle", `Child idle: ${settings.idleSeconds}s (${settings.idleSource})`),
|
|
74
|
-
settings.editable
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"JEV ON asks paid-call and LoRA-storage consent in Pi.",
|
|
79
|
-
"Auto never supplies that consent. No model token budget.",
|
|
74
|
+
settings.editable ? "Limits affect future children only." : "Read-only: change settings in the owning parent.",
|
|
75
|
+
"Running children keep their limits.",
|
|
76
|
+
"JEV needs separate call/storage consent in Pi.",
|
|
77
|
+
"Auto does not grant JEV consent. No token budget.",
|
|
80
78
|
"",
|
|
81
79
|
"STARTUP LIMITS · restart to change",
|
|
82
80
|
row("descendants", `Active descendants: ${settings.descendants} (${settings.reserved} reserved) · PI_DADDY_FANOUT`),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Operator version inventory. These observations do not qualify runtime compatibility. */
|
|
2
|
-
export type EcosystemPackageId =
|
|
2
|
+
export type EcosystemPackageId =
|
|
3
|
+
"pi" | "pi-daddy" | "principal-pi-skills" | "skill-harness" | "pi-scout-research" | "bookie-pi-skills";
|
|
3
4
|
export interface EcosystemVersionRow {
|
|
4
5
|
id: EcosystemPackageId;
|
|
5
6
|
label: string;
|