@danypops/pi-papyrus 0.36.0 → 0.36.2
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.
|
@@ -671,10 +671,27 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
|
|
|
671
671
|
}),
|
|
672
672
|
renderCall(args, theme) { return renderPapyrusToolCall("Playbooks", args, theme); },
|
|
673
673
|
renderResult(result, options, theme, context) { return renderPapyrusToolResult(result, options, theme, context); },
|
|
674
|
-
async execute(_id, rawParams) {
|
|
674
|
+
async execute(_id, rawParams, _signal, _onUpdate, ctx) {
|
|
675
675
|
try {
|
|
676
676
|
const params: Record<string, unknown> = { ...rawParams };
|
|
677
677
|
const action = params.action;
|
|
678
|
+
// invoke ends by calling tasks.focus server-side -- that focus write must land in the
|
|
679
|
+
// SAME session scope the tasks tool reads from (ctx.sessionManager.getSessionId()),
|
|
680
|
+
// the same resolution the tasks tool itself always applies, or the entry task's focus
|
|
681
|
+
// is invisible to tasks(action=focused/active) despite invoke reporting it as focused.
|
|
682
|
+
// project_root defaults to ctx.cwd for the same reason: the tasks tool always scopes
|
|
683
|
+
// its OWN reads to ctx.cwd unless told otherwise, so an unscoped playbook-materialized
|
|
684
|
+
// task is invisible to tasks(action=focused) even with the right session -- confirmed
|
|
685
|
+
// live (the focus_set event existed with the correct sessionId, but Tasks.focused's own
|
|
686
|
+
// project-scope filter silently excluded the unscoped task from a cwd-scoped read).
|
|
687
|
+
if (action === "invoke") {
|
|
688
|
+
const resolvedSessionId = params.session_id ?? ctx.sessionManager.getSessionId();
|
|
689
|
+
Object.assign(params, {
|
|
690
|
+
project_root: params.project_root ?? ctx.cwd,
|
|
691
|
+
session_id: resolvedSessionId,
|
|
692
|
+
...sessionSecretField(resolvedSessionId as string),
|
|
693
|
+
});
|
|
694
|
+
}
|
|
678
695
|
const resolutionRequest = { project_root: params.project_root };
|
|
679
696
|
await resolveNameFields(params, [
|
|
680
697
|
{ nameKey: "name", idKey: "id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danypops/pi-papyrus",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.2",
|
|
4
4
|
"description": "Pi host extension for Papyrus: native tools, TUI panels, and context injection over the daemon-backed graph store",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": ["pi-package"],
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@danypops/daemon-kit": "^0.10.0",
|
|
21
|
-
"@danypops/papyrus": "^0.36.
|
|
21
|
+
"@danypops/papyrus": "^0.36.1",
|
|
22
22
|
"beautiful-mermaid": "1.1.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|