@danypops/pi-papyrus 0.36.1 → 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,14 +675,11 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
|
|
|
675
675
|
try {
|
|
676
676
|
const params: Record<string, unknown> = { ...rawParams };
|
|
677
677
|
const action = params.action;
|
|
678
|
-
//
|
|
679
|
-
//
|
|
680
|
-
// the
|
|
681
|
-
//
|
|
682
|
-
|
|
683
|
-
const resolvedSessionId = params.session_id ?? ctx.sessionManager.getSessionId();
|
|
684
|
-
Object.assign(params, { session_id: resolvedSessionId, ...sessionSecretField(resolvedSessionId as string) });
|
|
685
|
-
}
|
|
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.
|
|
686
683
|
const resolutionRequest = { project_root: params.project_root };
|
|
687
684
|
await resolveNameFields(params, [
|
|
688
685
|
{ nameKey: "name", idKey: "id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
|
|
@@ -690,6 +687,24 @@ export function registerPlaybooksTool(pi: ExtensionAPI): void {
|
|
|
690
687
|
{ nameKey: "child_name", idKey: "child_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
|
|
691
688
|
{ nameKey: "dependency_name", idKey: "dependency_id", listOperation: "playbooks.list", baseRequest: resolutionRequest },
|
|
692
689
|
]);
|
|
690
|
+
// invoke ends by calling tasks.focus server-side -- that focus write must land in the
|
|
691
|
+
// SAME session scope the tasks tool reads from (ctx.sessionManager.getSessionId()),
|
|
692
|
+
// the same resolution the tasks tool itself always applies, or the entry task's focus
|
|
693
|
+
// is invisible to tasks(action=focused/active) despite invoke reporting it as focused.
|
|
694
|
+
// project_root defaults to ctx.cwd for the same reason: the tasks tool always scopes
|
|
695
|
+
// its OWN reads to ctx.cwd unless told otherwise, so an unscoped playbook-materialized
|
|
696
|
+
// task is invisible to tasks(action=focused) even with the right session -- confirmed
|
|
697
|
+
// live (the focus_set event existed with the correct sessionId, but Tasks.focused's own
|
|
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.
|
|
700
|
+
if (action === "invoke") {
|
|
701
|
+
const resolvedSessionId = params.session_id ?? ctx.sessionManager.getSessionId();
|
|
702
|
+
Object.assign(params, {
|
|
703
|
+
project_root: params.project_root ?? ctx.cwd,
|
|
704
|
+
session_id: resolvedSessionId,
|
|
705
|
+
...sessionSecretField(resolvedSessionId as string),
|
|
706
|
+
});
|
|
707
|
+
}
|
|
693
708
|
if (action === "create" || action === "invoke" || action === "preview") normalizeJsonEncodedField(params, "arguments");
|
|
694
709
|
if (action === "create") {
|
|
695
710
|
const artifact = await callService<Record<string, unknown>, Artifact>("playbooks.create", params);
|
package/package.json
CHANGED