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
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { safeDashboardSummary } from "./activity-summary.js";
|
|
2
|
+
export function isComponentObservation(source, item) {
|
|
3
|
+
return ((source.producer === "scout-local" || source.producer === "scout-worker") &&
|
|
4
|
+
item.id === "research" &&
|
|
5
|
+
item.kind === "work");
|
|
6
|
+
}
|
|
7
|
+
function current(source, options) {
|
|
8
|
+
const age = (options.now?.getTime() ?? Date.now()) - Date.parse(source.observedAt);
|
|
9
|
+
return (options.connected !== false &&
|
|
10
|
+
source.availability === "observed" &&
|
|
11
|
+
Number.isFinite(age) &&
|
|
12
|
+
age >= 0 &&
|
|
13
|
+
age <= source.staleAfterMs);
|
|
14
|
+
}
|
|
15
|
+
function scoutDescription(worker, item) {
|
|
16
|
+
switch (item.state) {
|
|
17
|
+
case "observed":
|
|
18
|
+
return worker
|
|
19
|
+
? ["Docker untested", "Pi has loaded the research worker. No Docker or internet check was reported."]
|
|
20
|
+
: ["Available", "Pi has loaded the local research tools. Source availability depends on the selected catalog."];
|
|
21
|
+
case "running":
|
|
22
|
+
return worker
|
|
23
|
+
? ["Preparing research", "Scout is preparing or running a research worker. A result is still pending."]
|
|
24
|
+
: ["Research in progress", "Scout is working with the selected sources."];
|
|
25
|
+
case "settled":
|
|
26
|
+
return [
|
|
27
|
+
"Brief saved",
|
|
28
|
+
worker
|
|
29
|
+
? "Scout saved the brief and confirmed worker cleanup. The report does not identify whether it used the internet."
|
|
30
|
+
: "Scout saved a local brief. Open Saved results to inspect the source record.",
|
|
31
|
+
];
|
|
32
|
+
case "failed":
|
|
33
|
+
return ["Last attempt failed", "Open the Scout tool result in the main Pi chat for the reason."];
|
|
34
|
+
case "unknown":
|
|
35
|
+
return [
|
|
36
|
+
"Outcome unknown",
|
|
37
|
+
worker
|
|
38
|
+
? "Check the last Scout tool result and Docker cleanup before starting more research."
|
|
39
|
+
: "Check the last Scout tool result in the main Pi chat.",
|
|
40
|
+
];
|
|
41
|
+
case "unavailable":
|
|
42
|
+
return ["Unavailable", "Open the Scout tool result in the main Pi chat for the reported issue."];
|
|
43
|
+
case "dependency-wait":
|
|
44
|
+
return ["Waiting on a dependency", "Scout is waiting for a required part of the task."];
|
|
45
|
+
case "approval-wait":
|
|
46
|
+
return ["Waiting for you", "Check the request in the main Pi chat."];
|
|
47
|
+
case "cancel-requested":
|
|
48
|
+
return ["Stopping", "Scout has received a cancellation request. Cleanup is still pending."];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function componentItem(producer, options) {
|
|
52
|
+
const bookie = producer === "bookie";
|
|
53
|
+
const worker = producer === "scout-worker";
|
|
54
|
+
const title = bookie ? "Bookie memory" : worker ? "Scout research worker" : "Scout local sources";
|
|
55
|
+
const source = options.session?.observation?.sources.find((s) => s.producer === producer);
|
|
56
|
+
const pkg = options.session?.versions?.rows.find((r) => r.id === (bookie ? "bookie-pi-skills" : "pi-scout-research"));
|
|
57
|
+
if (!source && !(pkg?.source || pkg?.loadedVersion || pkg?.installedVersion || pkg?.state === "multiple"))
|
|
58
|
+
return;
|
|
59
|
+
const item = source?.items.find((i) => isComponentObservation(source, i));
|
|
60
|
+
let state = "observed", status, explanation;
|
|
61
|
+
if (options.connected === false || (source && !current(source, options))) {
|
|
62
|
+
state = "last-observed";
|
|
63
|
+
status = "Live status unknown";
|
|
64
|
+
const lastReport = item
|
|
65
|
+
? scoutDescription(worker, item)[0]
|
|
66
|
+
: bookie && source?.items.some((i) => i.kind === "goal" && i.id === "scope")
|
|
67
|
+
? "Project connected"
|
|
68
|
+
: undefined;
|
|
69
|
+
explanation = (lastReport ? `Last report: ${lastReport}. ` : "") + "Check the main Pi chat for current status.";
|
|
70
|
+
}
|
|
71
|
+
else if (bookie && source?.items.length) {
|
|
72
|
+
status = "Project connected";
|
|
73
|
+
explanation = "Bookie is sharing the selected project’s work with Pi.";
|
|
74
|
+
}
|
|
75
|
+
else if (item) {
|
|
76
|
+
state = item.state;
|
|
77
|
+
[status, explanation] = scoutDescription(worker, item);
|
|
78
|
+
}
|
|
79
|
+
else if (bookie && (pkg?.commandAvailable || pkg?.loadedVersion)) {
|
|
80
|
+
status = "Available · no project reported";
|
|
81
|
+
explanation = "Run /bookie-work in the main Pi chat to select a project and plan.";
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
status =
|
|
85
|
+
pkg?.state === "multiple"
|
|
86
|
+
? "Multiple installations"
|
|
87
|
+
: pkg?.installedVersion
|
|
88
|
+
? "Installed · no live report"
|
|
89
|
+
: "No live report";
|
|
90
|
+
explanation = bookie
|
|
91
|
+
? "Check for /bookie-work in the main Pi chat and select a project. Open Versions for installation details."
|
|
92
|
+
: "Check the loaded Scout extension in the main Pi chat. Research readiness has not been reported.";
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
key: `component:${producer}`,
|
|
96
|
+
label: `${title} · ${status}`,
|
|
97
|
+
status: state,
|
|
98
|
+
elapsed: "",
|
|
99
|
+
briefDetails: [explanation],
|
|
100
|
+
details: [
|
|
101
|
+
explanation,
|
|
102
|
+
...(source
|
|
103
|
+
? [`Source: ${source.producer} · ${source.producerVersion}`, `Last update: ${source.observedAt}`]
|
|
104
|
+
: []),
|
|
105
|
+
...(item?.details ?? []),
|
|
106
|
+
...(pkg?.installedVersion ? [`Installed version: ${pkg.installedVersion}`] : []),
|
|
107
|
+
...(pkg?.loadedVersion ? [`Running version: ${pkg.loadedVersion}`] : []),
|
|
108
|
+
],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function componentItems(options) {
|
|
112
|
+
return ["bookie", "scout-local", "scout-worker"]
|
|
113
|
+
.map((id) => componentItem(id, options))
|
|
114
|
+
.filter((item) => item !== undefined);
|
|
115
|
+
}
|
|
116
|
+
export function versionLines(row, selected, options) {
|
|
117
|
+
const prefix = selected ? "> " : " ";
|
|
118
|
+
const bookieSource = row.id === "bookie-pi-skills" && options.session?.observation?.sources.find((s) => s.producer === "bookie");
|
|
119
|
+
let detail;
|
|
120
|
+
if (options.connected === false)
|
|
121
|
+
detail = "Last seen. Reconnect for the running version.";
|
|
122
|
+
else if (row.state === "multiple")
|
|
123
|
+
detail = "Multiple installations. Open details to check the sources.";
|
|
124
|
+
else if (row.loadedVersion && row.installedVersion && row.loadedVersion !== row.installedVersion)
|
|
125
|
+
detail = `Running ${row.loadedVersion}. ${row.id === "pi" ? "Restart" : "Reload"} Pi to use the installed version.`;
|
|
126
|
+
else if (row.loadedVersion)
|
|
127
|
+
detail = `Running ${row.loadedVersion}`;
|
|
128
|
+
else if (row.commandAvailable || (bookieSource && current(bookieSource, options)))
|
|
129
|
+
detail = "Active in Pi. Running version unreported.";
|
|
130
|
+
else
|
|
131
|
+
detail = row.installedVersion ? "Pi has not reported a running version." : "No running version reported.";
|
|
132
|
+
return [
|
|
133
|
+
prefix +
|
|
134
|
+
row.label +
|
|
135
|
+
(row.installedVersion ? ` · Installed ${row.installedVersion}` : " · Installation unconfirmed"),
|
|
136
|
+
" " + detail,
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
export function savedEvidenceItem(artifact, index) {
|
|
140
|
+
const result = artifact.description;
|
|
141
|
+
const role = result?.agent?.replace(/[-_]/g, " ");
|
|
142
|
+
const who = role ? role.charAt(0).toUpperCase() + role.slice(1) : "Agent";
|
|
143
|
+
const kind = result?.content === "answer" ? "answer" : result?.content === "partial" ? "partial output" : "run record";
|
|
144
|
+
const label = result?.summary ? `${who} · ${result.summary}` : result ? `${who} ${kind}` : `Run record ${index + 1}`;
|
|
145
|
+
const status = result?.state === "not-started"
|
|
146
|
+
? "Did not start"
|
|
147
|
+
: result?.state === "uncertain"
|
|
148
|
+
? "Outcome uncertain"
|
|
149
|
+
: result?.state === "failed"
|
|
150
|
+
? "Run failed"
|
|
151
|
+
: result?.content === "partial"
|
|
152
|
+
? "Partial output saved"
|
|
153
|
+
: "Saved";
|
|
154
|
+
const brief = result?.content === "answer"
|
|
155
|
+
? `Pi saved the final answer from this ${role ?? "agent"} run.`
|
|
156
|
+
: result?.content === "partial"
|
|
157
|
+
? "Pi saved partial output from this run."
|
|
158
|
+
: "Pi saved a record of this run. Open source details for its exact reference.";
|
|
159
|
+
return {
|
|
160
|
+
key: `artifact:${artifact.executionId}`,
|
|
161
|
+
label,
|
|
162
|
+
status,
|
|
163
|
+
elapsed: "",
|
|
164
|
+
briefDetails: [brief, ...(result?.observedAt ? [`Recorded: ${result.observedAt}`] : [])],
|
|
165
|
+
details: [
|
|
166
|
+
`Operation: ${artifact.operationId}`,
|
|
167
|
+
`Execution: ${artifact.executionId}`,
|
|
168
|
+
`Manifest SHA-256: ${artifact.sha256}`,
|
|
169
|
+
"Producer: pi-daddy",
|
|
170
|
+
"A saved record alone gives no review or approval verdict.",
|
|
171
|
+
],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export function publishedEvidenceItem(source, evidence, display) {
|
|
175
|
+
const scout = source.producer === "scout-worker" || source.producer === "scout-local";
|
|
176
|
+
const author = scout ? "Scout" : source.producer === "bookie" ? "Bookie" : "A connected tool";
|
|
177
|
+
const readable = safeDashboardSummary(evidence.label);
|
|
178
|
+
const title = scout && evidence.id === "brief"
|
|
179
|
+
? source.producer === "scout-worker"
|
|
180
|
+
? "Scout research brief"
|
|
181
|
+
: "Scout local brief"
|
|
182
|
+
: readable && !/\S[/\\]\S|\b(?:sha\d*|principal):/i.test(readable)
|
|
183
|
+
? readable
|
|
184
|
+
: `${author === "A connected tool" ? "Tool" : author} evidence record`;
|
|
185
|
+
return {
|
|
186
|
+
...display,
|
|
187
|
+
label: title,
|
|
188
|
+
status: display.status === "observed" ? (evidence.reference ? "Reference saved" : "Recorded") : display.status,
|
|
189
|
+
briefDetails: [
|
|
190
|
+
`${author} reported this ${scout && evidence.id === "brief" ? "research brief" : "result"} in this session.`,
|
|
191
|
+
...(evidence.reference ? ["Open source details for the exact reference."] : []),
|
|
192
|
+
],
|
|
193
|
+
details: [...display.details, ...(title !== evidence.label ? [`Original label: ${evidence.label}`] : [])],
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=dashboard-components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard-components.js","sourceRoot":"","sources":["../../src/products/dashboard-components.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAI7D,MAAM,UAAU,sBAAsB,CAAC,MAA+B,EAAE,IAA2B;IACjG,OAAO,CACL,CAAC,MAAM,CAAC,QAAQ,KAAK,aAAa,IAAI,MAAM,CAAC,QAAQ,KAAK,cAAc,CAAC;QACzE,IAAI,CAAC,EAAE,KAAK,UAAU;QACtB,IAAI,CAAC,IAAI,KAAK,MAAM,CACrB,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,MAA+B,EAAE,OAA+B;IAC/E,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACnF,OAAO,CACL,OAAO,CAAC,SAAS,KAAK,KAAK;QAC3B,MAAM,CAAC,YAAY,KAAK,UAAU;QAClC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QACpB,GAAG,IAAI,CAAC;QACR,GAAG,IAAI,MAAM,CAAC,YAAY,CAC3B,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAe,EAAE,IAA2B;IACpE,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,MAAM;gBACX,CAAC,CAAC,CAAC,iBAAiB,EAAE,8EAA8E,CAAC;gBACrG,CAAC,CAAC,CAAC,WAAW,EAAE,8FAA8F,CAAC,CAAC;QACpH,KAAK,SAAS;YACZ,OAAO,MAAM;gBACX,CAAC,CAAC,CAAC,oBAAoB,EAAE,6EAA6E,CAAC;gBACvG,CAAC,CAAC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AC,mBAAmB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;KAC1G,CAAC;AACJ,CAAC"}
|
|
@@ -5,9 +5,9 @@ export function sectionHeading(title, width) {
|
|
|
5
5
|
return remaining >= 3 ? title + " " + "─".repeat(remaining) : truncate(title, width);
|
|
6
6
|
}
|
|
7
7
|
export function previewWidth(destination, expanded, width) {
|
|
8
|
-
if (width <
|
|
8
|
+
if (width < 82 || (!expanded && (width < 92 || !["now", "work", "reviews"].includes(destination))))
|
|
9
9
|
return;
|
|
10
|
-
return Math.min(
|
|
10
|
+
return Math.min(84, Math.floor(width * 0.57));
|
|
11
11
|
}
|
|
12
12
|
const sgr = (value, code) => (value ? `\x1b[${code}m${value}\x1b[0m` : "");
|
|
13
13
|
/** Apply terminal styles only to already-sanitized and measured display text. */
|
|
@@ -33,8 +33,24 @@ function paintCell(cell) {
|
|
|
33
33
|
const rule = /^(.*?) (─{3,})$/.exec(text);
|
|
34
34
|
if (rule) {
|
|
35
35
|
const title = rule[1];
|
|
36
|
-
const attention = /^(?:
|
|
37
|
-
return sgr(title, attention ? "1;33" :
|
|
36
|
+
const attention = /^(?:Next step|Needs |Waiting for your review|NEXT ACTION)/i.test(title);
|
|
37
|
+
return (sgr(title, attention ? "1;33" : /^(Recently finished|Saved results|What happened)/.test(title) ? "1;32" : "1;36") +
|
|
38
|
+
" " +
|
|
39
|
+
sgr(rule[2], "36") +
|
|
40
|
+
padding);
|
|
41
|
+
}
|
|
42
|
+
if (/^ /.test(text)) {
|
|
43
|
+
const status = /( · )(Failed|Blocked|Run failed|Last attempt failed|Unavailable|Awaiting decision|Needs you|Live status unknown|Running|Finished|Saved|Available)(?= |$| ·)/;
|
|
44
|
+
return (text.replace(status, (_, separator, state) => {
|
|
45
|
+
const color = /Failed|failed|Blocked|Unavailable/.test(state)
|
|
46
|
+
? "1;31"
|
|
47
|
+
: /Awaiting|Needs you|unknown/.test(state)
|
|
48
|
+
? "33"
|
|
49
|
+
: state === "Running"
|
|
50
|
+
? "36"
|
|
51
|
+
: "32";
|
|
52
|
+
return separator + sgr(state, color);
|
|
53
|
+
}) + padding);
|
|
38
54
|
}
|
|
39
55
|
if (text === "/bookie-work review")
|
|
40
56
|
return sgr(text, "1;36") + padding;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dashboard-layout.js","sourceRoot":"","sources":["../../src/products/dashboard-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,sGAAsG;AACtG,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,KAAa;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9D,OAAO,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACxF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,WAAmB,EAAE,QAAiB,EAAE,KAAa;IAChF,IAAI,KAAK,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,IAAI,CAAC,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"dashboard-layout.js","sourceRoot":"","sources":["../../src/products/dashboard-layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE5D,sGAAsG;AACtG,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,KAAa;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9D,OAAO,SAAS,IAAI,CAAC,C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EAAE,MAAM,oCAAoC,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"dashboard-panels.d.ts","sourceRoot":"","sources":["../../src/products/dashboard-panels.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,OAAO,KAAK,EAAyB,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AACzG,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAWnF,MAAM,MAAM,oBAAoB,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AACrG,eAAO,MAAM,sBAAsB,EAAE,oBAAoB,EAOxD,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAMrG;AA6BD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAclF;AAyID,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,aAAa,EAAE,CAyHtF;AAqCD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CA+DlH"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { dashboardText, friendlyStatus } from "./dashboard-screen.js";
|
|
2
|
+
import { activityStoryItems } from "./dashboard-activity.js";
|
|
3
|
+
import { componentItems, isComponentObservation, publishedEvidenceItem, savedEvidenceItem, } from "./dashboard-components.js";
|
|
2
4
|
import { previewWidth, sectionHeading } from "./dashboard-layout.js";
|
|
3
5
|
import { activityTaskKey } from "./activity-timeline.js";
|
|
4
6
|
export const DASHBOARD_DESTINATIONS = [
|
|
@@ -150,10 +152,14 @@ function bookieLabel(item, source) {
|
|
|
150
152
|
function rowText(item, destination, selected) {
|
|
151
153
|
const label = clean(item.label);
|
|
152
154
|
const marker = selected ? "> " : " ";
|
|
155
|
+
if (item.key.startsWith("component:"))
|
|
156
|
+
return marker + label;
|
|
153
157
|
if (item.status === "last-observed")
|
|
154
158
|
return `${marker}Last seen · ${label}`;
|
|
155
159
|
if (item.reviewSummary)
|
|
156
160
|
return marker + label;
|
|
161
|
+
if (item.key.startsWith("activity:") && item.status === "observed")
|
|
162
|
+
return marker + label;
|
|
157
163
|
const waitingForReview = destination === "reviews" && item.status === "approval-wait";
|
|
158
164
|
const described = waitingForReview && /^ready for review[:\s]/i.test(label);
|
|
159
165
|
const status = described ? "" : ` · ${waitingForReview ? "Awaiting review" : friendlyStatus(clean(item.status))}`;
|
|
@@ -171,9 +177,10 @@ export function sessionDashboardItems(options) {
|
|
|
171
177
|
? ["evidence"]
|
|
172
178
|
: destination === "activity"
|
|
173
179
|
? ["status"]
|
|
174
|
-
: ["work"
|
|
180
|
+
: ["work"];
|
|
175
181
|
const published = observed.sources.flatMap((source) => source.items
|
|
176
182
|
.filter((item) => wanted.includes(item.kind) &&
|
|
183
|
+
!isComponentObservation(source, item) &&
|
|
177
184
|
!(destination === "reviews" &&
|
|
178
185
|
!options.screen.expanded &&
|
|
179
186
|
source.producer === "bookie" &&
|
|
@@ -182,7 +189,11 @@ export function sessionDashboardItems(options) {
|
|
|
182
189
|
!(source.producer === "daddy-initiative" && item.id === "scope" && ["now", "work"].includes(destination)))
|
|
183
190
|
.map((item) => {
|
|
184
191
|
const stale = staleSource(source, options);
|
|
185
|
-
|
|
192
|
+
const linked = reviewForTask(item, source, stale);
|
|
193
|
+
const display = row(item, sourceKey(source, item), `${source.producer}@${source.producerVersion} · seq ${source.sequence} · ${source.observedAt}`, stale, source.producer === "bookie" ? bookieLabel(item, source) : item.label, linked);
|
|
194
|
+
if (linked)
|
|
195
|
+
display.relatedReviewKey = sourceKey(source, linked);
|
|
196
|
+
return item.kind === "evidence" ? publishedEvidenceItem(source, item, display) : display;
|
|
186
197
|
}));
|
|
187
198
|
if (destination === "reviews") {
|
|
188
199
|
const first = sessionNext(options)?.reviewKey;
|
|
@@ -190,30 +201,9 @@ export function sessionDashboardItems(options) {
|
|
|
190
201
|
return published.sort((a, b) => priority(b) - priority(a));
|
|
191
202
|
}
|
|
192
203
|
if (destination === "evidence")
|
|
193
|
-
return [
|
|
194
|
-
...(observed.artifacts ?? []).map((a) => ({
|
|
195
|
-
key: `artifact:${a.executionId}`,
|
|
196
|
-
label: a.operationId,
|
|
197
|
-
status: "retained",
|
|
198
|
-
elapsed: "",
|
|
199
|
-
details: [
|
|
200
|
-
`Producer: pi-daddy`,
|
|
201
|
-
`Execution: ${a.executionId}`,
|
|
202
|
-
`Manifest SHA-256: ${a.sha256}`,
|
|
203
|
-
"Producer reference observed in this session; payload not loaded by the dashboard.",
|
|
204
|
-
"Retained is not reviewed, applicable or approved. Use the authorized artifact resolver for content.",
|
|
205
|
-
],
|
|
206
|
-
})),
|
|
207
|
-
...published,
|
|
208
|
-
];
|
|
204
|
+
return [...(observed.artifacts ?? []).map(savedEvidenceItem), ...published];
|
|
209
205
|
if (destination === "activity")
|
|
210
|
-
return [
|
|
211
|
-
...(observed.activity ?? [])
|
|
212
|
-
.slice()
|
|
213
|
-
.reverse()
|
|
214
|
-
.map((item) => row(item, `activity:${observed.generation}:${item.id}`, `Pi owner · ${observed.sessionId}`, staleOwner)),
|
|
215
|
-
...published,
|
|
216
|
-
];
|
|
206
|
+
return [...activityStoryItems(observed.activity ?? [], observed.generation, staleOwner), ...published];
|
|
217
207
|
const native = options.items.map((item) => staleOwner
|
|
218
208
|
? {
|
|
219
209
|
...item,
|
|
@@ -223,36 +213,101 @@ export function sessionDashboardItems(options) {
|
|
|
223
213
|
: item);
|
|
224
214
|
const activity = options.session?.activity;
|
|
225
215
|
const parentShown = activity && native.some((item) => item.taskKey === activityTaskKey(activity.rootId, activity.taskId));
|
|
216
|
+
const ownerTurn = observed.turn;
|
|
217
|
+
const tasks = native.map((item) => {
|
|
218
|
+
// A running parent can supply a more recent public tool purpose than its persisted start record.
|
|
219
|
+
if (activity &&
|
|
220
|
+
item.taskKey === activityTaskKey(activity.rootId, activity.taskId) &&
|
|
221
|
+
ownerTurn?.state === "running" &&
|
|
222
|
+
!staleOwner &&
|
|
223
|
+
["running", "active"].includes(item.status))
|
|
224
|
+
return { ...item, label: ownerTurn.label };
|
|
225
|
+
return item;
|
|
226
|
+
});
|
|
226
227
|
const items = [
|
|
227
|
-
...(
|
|
228
|
-
? [row(
|
|
228
|
+
...(ownerTurn && !parentShown
|
|
229
|
+
? [row(ownerTurn, `owner:${observed.generation}:${ownerTurn.id}`, "Pi owner", staleOwner)]
|
|
229
230
|
: []),
|
|
230
|
-
...
|
|
231
|
+
...tasks,
|
|
231
232
|
...published,
|
|
232
233
|
];
|
|
233
|
-
items.sort((a, b) =>
|
|
234
|
-
|
|
234
|
+
items.sort((a, b) => {
|
|
235
|
+
const rank = workGroups.indexOf(workGroup(a)) - workGroups.indexOf(workGroup(b));
|
|
236
|
+
return rank || (workGroup(a) === "Recently finished" ? (b.updatedAt ?? "").localeCompare(a.updatedAt ?? "") : 0);
|
|
237
|
+
});
|
|
238
|
+
if (destination !== "now")
|
|
239
|
+
return items;
|
|
240
|
+
// Tasks has the complete queue. Keep the overview navigable even after a long session.
|
|
241
|
+
// A producer may publish a review without a matching task or a recommended next action.
|
|
242
|
+
const represented = new Set(items.map((i) => i.relatedReviewKey).filter(Boolean));
|
|
243
|
+
for (const source of observed.sources) {
|
|
244
|
+
if (staleSource(source, options))
|
|
245
|
+
continue;
|
|
246
|
+
for (const review of source.items) {
|
|
247
|
+
const key = sourceKey(source, review);
|
|
248
|
+
if (review.kind === "review" &&
|
|
249
|
+
review.state === "approval-wait" &&
|
|
250
|
+
review.reference &&
|
|
251
|
+
!reviewTotals(review) &&
|
|
252
|
+
!represented.has(key))
|
|
253
|
+
items.push(row(review, key, `${source.producer}@${source.producerVersion}`));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
const nextReview = sessionNext(options)?.reviewKey;
|
|
257
|
+
if (nextReview) {
|
|
258
|
+
const index = items.findIndex((i) => i.relatedReviewKey === nextReview || i.key === nextReview);
|
|
259
|
+
// Keep task rows ahead of independent review rows; Reviews opens the exact recommended output.
|
|
260
|
+
if (index > 0 && items[index]?.relatedReviewKey === nextReview)
|
|
261
|
+
items.unshift(items.splice(index, 1)[0]);
|
|
262
|
+
}
|
|
263
|
+
const shown = workGroups.flatMap((group) => {
|
|
264
|
+
const matches = items.filter((item) => workGroup(item) === group);
|
|
265
|
+
return matches.slice(0, group === "Recently finished" ? 2 : 3);
|
|
266
|
+
});
|
|
267
|
+
const recent = shown.some((i) => workGroup(i) === "Recently finished")
|
|
268
|
+
? []
|
|
269
|
+
: activityStoryItems(observed.activity ?? [], observed.generation, staleOwner).slice(0, 2);
|
|
270
|
+
return [...shown, ...recent, ...componentItems(options)];
|
|
235
271
|
}
|
|
236
|
-
const workGroups = [
|
|
272
|
+
const workGroups = [
|
|
273
|
+
"Needs your permission",
|
|
274
|
+
"Needs your decision",
|
|
275
|
+
"Needs attention",
|
|
276
|
+
"In progress",
|
|
277
|
+
"Other tasks",
|
|
278
|
+
"Recently finished",
|
|
279
|
+
"Last known",
|
|
280
|
+
"Tools",
|
|
281
|
+
];
|
|
237
282
|
function workGroup(item) {
|
|
283
|
+
if (item.key.startsWith("component:"))
|
|
284
|
+
return "Tools";
|
|
285
|
+
if (item.key.startsWith("activity:"))
|
|
286
|
+
return "Latest activity";
|
|
287
|
+
if (["last-observed", "historical"].includes(item.status))
|
|
288
|
+
return "Last known";
|
|
238
289
|
if (item.approval)
|
|
239
|
-
return "
|
|
290
|
+
return "Needs your permission";
|
|
240
291
|
if (item.status === "approval-wait")
|
|
241
|
-
return "
|
|
292
|
+
return "Needs your decision";
|
|
242
293
|
if (["needs-you", "failed", "refused", "incomplete", "dependency-wait"].includes(item.status))
|
|
243
|
-
return "
|
|
294
|
+
return "Needs attention";
|
|
244
295
|
if (["running", "active", "starting", "authorised", "cancel-requested"].includes(item.status))
|
|
245
|
-
return "
|
|
296
|
+
return "In progress";
|
|
246
297
|
if (["settled", "completed", "finished", "cancelled", "historical", "last-observed"].includes(item.status))
|
|
247
|
-
return "
|
|
248
|
-
return "
|
|
298
|
+
return "Recently finished";
|
|
299
|
+
return "Other tasks";
|
|
249
300
|
}
|
|
250
301
|
function listHeading(item, destination) {
|
|
251
302
|
if (destination === "now" || destination === "work")
|
|
252
|
-
return workGroup(item);
|
|
303
|
+
return destination === "work" && workGroup(item) === "Recently finished" ? "Finished" : workGroup(item);
|
|
253
304
|
if (destination === "reviews")
|
|
254
|
-
return item.status === "approval-wait" && !item.reviewSummary ? "
|
|
255
|
-
return destination === "evidence"
|
|
305
|
+
return item.status === "approval-wait" && !item.reviewSummary ? "Waiting for your review" : "Review records";
|
|
306
|
+
return destination === "evidence"
|
|
307
|
+
? "Saved results"
|
|
308
|
+
: item.key.startsWith("source:")
|
|
309
|
+
? "Current reports"
|
|
310
|
+
: "What happened";
|
|
256
311
|
}
|
|
257
312
|
export function sessionPanelLines(options, items, width) {
|
|
258
313
|
const observation = options.session.observation, screen = options.screen;
|
|
@@ -261,31 +316,37 @@ export function sessionPanelLines(options, items, width) {
|
|
|
261
316
|
const lines = [];
|
|
262
317
|
const initiative = observation.sources.find((source) => source.producer === "daddy-initiative");
|
|
263
318
|
const scope = initiative?.items.find((item) => item.id === "scope");
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
319
|
+
const roomy = options.height >= 22;
|
|
320
|
+
if (destination === "work") {
|
|
321
|
+
lines.push("All session tasks, grouped by status.");
|
|
322
|
+
if (scope) {
|
|
323
|
+
lines.push(`Selected ${clean(scope.label)}${staleSource(initiative, options) ? " (last known)" : ""}`);
|
|
324
|
+
if (scope.details?.[1])
|
|
325
|
+
lines.push(scope.details[1]);
|
|
326
|
+
}
|
|
268
327
|
}
|
|
269
328
|
if (destination === "now") {
|
|
270
329
|
const goals = sourceRows.filter((x) => x.item.kind === "goal");
|
|
271
330
|
const goal = goals.find((x) => !staleSource(x.source, options)) ?? goals[0];
|
|
272
331
|
if (goal) {
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
332
|
+
const project = goal.source.producer === "bookie" && /^\/projects\/([^/]+)\/project\.md$/.exec(goal.item.label);
|
|
333
|
+
lines.push(project ? `Project · ${clean(project[1])}` : `Goal · ${clean(goal.item.label)}`);
|
|
334
|
+
if (staleSource(goal.source, options))
|
|
335
|
+
lines[lines.length - 1] += " (last known)";
|
|
277
336
|
}
|
|
278
|
-
else if (options.current)
|
|
279
|
-
lines.push(`Goal · ${clean(options.current)}`);
|
|
280
337
|
}
|
|
281
|
-
if (!items.length)
|
|
282
|
-
|
|
338
|
+
if (!items.length) {
|
|
339
|
+
const fallback = destination === "reviews"
|
|
283
340
|
? options.connected === false || observation.sources.some((s) => staleSource(s, options))
|
|
284
|
-
? "Current reviews unknown. Check the
|
|
285
|
-
: "No reviews
|
|
341
|
+
? "Current reviews unknown. Check the main Pi chat."
|
|
342
|
+
: "No reviews waiting. Open [2] Tasks to see progress."
|
|
286
343
|
: destination === "evidence"
|
|
287
|
-
? "No
|
|
288
|
-
:
|
|
344
|
+
? "No saved results reported to this dashboard."
|
|
345
|
+
: destination === "activity"
|
|
346
|
+
? "No activity has been recorded in this session yet."
|
|
347
|
+
: "No tasks reported for this session yet.";
|
|
348
|
+
lines.push(fallback);
|
|
349
|
+
}
|
|
289
350
|
const left = previewWidth(destination, Boolean(screen.expanded), width);
|
|
290
351
|
const rows = [];
|
|
291
352
|
for (let start = 0; start < items.length;) {
|
|
@@ -293,24 +354,24 @@ export function sessionPanelLines(options, items, width) {
|
|
|
293
354
|
let end = start + 1;
|
|
294
355
|
while (end < items.length && listHeading(items[end], destination) === group)
|
|
295
356
|
end++;
|
|
296
|
-
|
|
357
|
+
if (roomy && (rows.length || lines.length))
|
|
358
|
+
rows.push("");
|
|
359
|
+
const count = destination === "now" ? "" : ` · ${end - start}`;
|
|
360
|
+
rows.push(sectionHeading(group + count, left ?? width));
|
|
297
361
|
for (const item of items.slice(start, end))
|
|
298
362
|
rows.push(rowText(item, destination, item.key === screen.selectedKey));
|
|
299
363
|
start = end;
|
|
300
364
|
}
|
|
301
365
|
lines.push(...rows);
|
|
366
|
+
if (destination === "now" && options.height >= 18 && items.some((i) => !i.key.startsWith("component:"))) {
|
|
367
|
+
if (roomy)
|
|
368
|
+
lines.push("");
|
|
369
|
+
lines.push("[2] Tasks · See the full task list");
|
|
370
|
+
}
|
|
302
371
|
if (screen.expanded && left === undefined)
|
|
303
|
-
lines.push("
|
|
372
|
+
lines.push("Side-by-side layout needs 82 columns; same selection retained.");
|
|
304
373
|
if (destination === "now" && screen.expanded) {
|
|
305
|
-
lines.push(sectionHeading("
|
|
306
|
-
for (const producer of ["principal", "bookie", "scout", "skill-harness"]) {
|
|
307
|
-
const streams = observation.sources.filter((x) => x.producer === producer || (producer === "scout" && x.producer.startsWith("scout-")));
|
|
308
|
-
const stale = streams.filter((s) => staleSource(s, options)).length;
|
|
309
|
-
const status = !streams.length
|
|
310
|
-
? "status adapter unavailable"
|
|
311
|
-
: `${streams.length - stale} observed${stale ? `; ${stale} last observed / stale` : ""}`;
|
|
312
|
-
lines.push(`${producer}: ${status}`);
|
|
313
|
-
}
|
|
374
|
+
lines.push(sectionHeading("Resource details", width));
|
|
314
375
|
const resource = observation.resources;
|
|
315
376
|
lines.push(`Parent RSS: ${(resource.rssBytes / 1024 / 1024).toFixed(1)} MiB`, "Host and child memory: unknown");
|
|
316
377
|
}
|