@phren/cli 0.2.13 → 0.2.14
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/dist/bridge/herdr.js +10 -1
- package/dist/bridge-hook.mjs +4 -2
- package/dist/data/tasks.js +2 -1
- package/package.json +1 -1
package/dist/bridge/herdr.js
CHANGED
|
@@ -78,7 +78,16 @@ export async function servers() {
|
|
|
78
78
|
}
|
|
79
79
|
export async function snapshot(server) { return object((await rpc(server, "session.snapshot")).snapshot); }
|
|
80
80
|
export function workspaceSnapshot(s) {
|
|
81
|
-
|
|
81
|
+
const focusedPane = objects(s.panes).find(p => p.pane_id === s.focused_pane_id
|
|
82
|
+
&& p.tab_id === s.focused_tab_id && p.workspace_id === s.focused_workspace_id);
|
|
83
|
+
const focus = focusedPane && id.safeParse(s.focused_workspace_id).success
|
|
84
|
+
&& id.safeParse(s.focused_tab_id).success && id.safeParse(s.focused_pane_id).success
|
|
85
|
+
&& objects(s.tabs).some(t => t.tab_id === s.focused_tab_id && t.workspace_id === s.focused_workspace_id)
|
|
86
|
+
&& objects(s.workspaces).some(w => w.workspace_id === s.focused_workspace_id)
|
|
87
|
+
? { workspaceID: s.focused_workspace_id, tabID: s.focused_tab_id, paneID: s.focused_pane_id } : undefined;
|
|
88
|
+
// Focus identifies a pane to inspect. Its conversation is still resolved and
|
|
89
|
+
// validated independently through panes(), never inferred from a directory.
|
|
90
|
+
return { kind: "herdr", focus, groups: objects(s.workspaces).map(w => ({ id: w.workspace_id, label: w.label,
|
|
82
91
|
children: objects(s.tabs).filter(t => t.workspace_id === w.workspace_id).map(t => {
|
|
83
92
|
const panes = objects(s.panes).filter(p => p.tab_id === t.tab_id);
|
|
84
93
|
const agent = panes.find(p => p.agent);
|
package/dist/bridge-hook.mjs
CHANGED
|
@@ -18579,7 +18579,9 @@ async function snapshot(server) {
|
|
|
18579
18579
|
return object2((await rpc(server, "session.snapshot")).snapshot);
|
|
18580
18580
|
}
|
|
18581
18581
|
function workspaceSnapshot(s) {
|
|
18582
|
-
|
|
18582
|
+
const focusedPane = objects(s.panes).find((p) => p.pane_id === s.focused_pane_id && p.tab_id === s.focused_tab_id && p.workspace_id === s.focused_workspace_id);
|
|
18583
|
+
const focus = focusedPane && id.safeParse(s.focused_workspace_id).success && id.safeParse(s.focused_tab_id).success && id.safeParse(s.focused_pane_id).success && objects(s.tabs).some((t) => t.tab_id === s.focused_tab_id && t.workspace_id === s.focused_workspace_id) && objects(s.workspaces).some((w) => w.workspace_id === s.focused_workspace_id) ? { workspaceID: s.focused_workspace_id, tabID: s.focused_tab_id, paneID: s.focused_pane_id } : void 0;
|
|
18584
|
+
return { kind: "herdr", focus, groups: objects(s.workspaces).map((w) => ({
|
|
18583
18585
|
id: w.workspace_id,
|
|
18584
18586
|
label: w.label,
|
|
18585
18587
|
children: objects(s.tabs).filter((t) => t.workspace_id === w.workspace_id).map((t) => {
|
|
@@ -22682,7 +22684,7 @@ async function runBridge(args, version2) {
|
|
|
22682
22684
|
}
|
|
22683
22685
|
|
|
22684
22686
|
// src/bridge/hook-main.ts
|
|
22685
|
-
runBridge(process.argv.slice(2), "0.2.
|
|
22687
|
+
runBridge(process.argv.slice(2), "0.2.14").then((code) => {
|
|
22686
22688
|
process.exitCode = code;
|
|
22687
22689
|
}).catch((error51) => {
|
|
22688
22690
|
console.error(error51 instanceof Error ? error51.message : "Phren Hook failed.");
|
package/dist/data/tasks.js
CHANGED
|
@@ -430,7 +430,7 @@ export function addTask(phrenPath, project, item, opts) {
|
|
|
430
430
|
line,
|
|
431
431
|
checked: false,
|
|
432
432
|
priority: normalizePriority(line),
|
|
433
|
-
createdAt: opts?.createdAt,
|
|
433
|
+
createdAt: opts?.createdAt ?? new Date().toISOString(),
|
|
434
434
|
sessionId: opts?.sessionId,
|
|
435
435
|
scope: opts?.scope,
|
|
436
436
|
parentFinding: opts?.parentFinding,
|
|
@@ -468,6 +468,7 @@ export function addTasks(phrenPath, project, items, opts) {
|
|
|
468
468
|
checked: false,
|
|
469
469
|
priority: normalizePriority(line),
|
|
470
470
|
scope: opts?.scope,
|
|
471
|
+
createdAt: new Date().toISOString(),
|
|
471
472
|
});
|
|
472
473
|
added.push(line);
|
|
473
474
|
}
|