@danypops/pi-papyrus 0.36.2 → 0.36.3

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.
@@ -675,6 +675,18 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
675
675
  try {
676
676
  const params: Record<string, unknown> = { ...rawParams };
677
677
  const action = params.action;
678
+ // Name resolution must search regardless of project scope -- a Playbook itself is
679
+ // commonly unscoped (e.g. a cross-repo lab-deploy playbook), so resolutionRequest
680
+ // uses the caller's ORIGINAL project_root (undefined unless explicitly given), never
681
+ // the invoke-specific default applied below -- that default is only for where the
682
+ // resulting TASKS land, not for finding the playbook artifact itself.
683
+ const resolutionRequest = { project_root: params.project_root };
684
+ await resolveNameFields(params, [
685
+ { nameKey: "name", idKey: "id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
686
+ { nameKey: "parent_name", idKey: "parent_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
687
+ { nameKey: "child_name", idKey: "child_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
688
+ { nameKey: "dependency_name", idKey: "dependency_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
689
+ ]);
678
690
  // invoke ends by calling tasks.focus server-side -- that focus write must land in the
679
691
  // SAME session scope the tasks tool reads from (ctx.sessionManager.getSessionId()),
680
692
  // the same resolution the tasks tool itself always applies, or the entry task's focus
@@ -684,6 +696,7 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
684
696
  // task is invisible to tasks(action=focused) even with the right session -- confirmed
685
697
  // live (the focus_set event existed with the correct sessionId, but Tasks.focused's own
686
698
  // project-scope filter silently excluded the unscoped task from a cwd-scoped read).
699
+ // Applied AFTER name resolution: it must never affect finding the playbook itself.
687
700
  if (action === "invoke") {
688
701
  const resolvedSessionId = params.session_id ?? ctx.sessionManager.getSessionId();
689
702
  Object.assign(params, {
@@ -692,13 +705,6 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
692
705
  ...sessionSecretField(resolvedSessionId as string),
693
706
  });
694
707
  }
695
- const resolutionRequest = { project_root: params.project_root };
696
- await resolveNameFields(params, [
697
- { nameKey: "name", idKey: "id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
698
- { nameKey: "parent_name", idKey: "parent_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
699
- { nameKey: "child_name", idKey: "child_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
700
- { nameKey: "dependency_name", idKey: "dependency_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
701
- ]);
702
708
  if (action === "create" || action === "invoke" || action === "preview") normalizeJsonEncodedField(params, "arguments");
703
709
  if (action === "create") {
704
710
  const artifact = await callService<Record<string, unknown>, Artifact>("playbooks.create", params);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danypops/pi-papyrus",
3
- "version": "0.36.2",
3
+ "version": "0.36.3",
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"],