@akagilnc/pi-workflow-roles 0.1.4522 → 0.1.4524

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.
@@ -26740,7 +26740,7 @@ async function prepareRoleEnvelope(options) {
26740
26740
 
26741
26741
  // src/role-runtime-dependencies.ts
26742
26742
  import { readFile as readFile22 } from "node:fs/promises";
26743
- import { fileURLToPath as fileURLToPath3 } from "node:url";
26743
+ import { join as join42 } from "node:path";
26744
26744
 
26745
26745
  // src/canonical-skill-binding.ts
26746
26746
  import { readFile as readFile20, realpath as realpath7 } from "node:fs/promises";
@@ -26941,16 +26941,12 @@ async function loadPackagedCanonicalSkillBinding(packageRoot, name) {
26941
26941
  // src/role-runtime-dependencies.ts
26942
26942
  init_auditor_soul();
26943
26943
  init_session_opening_materials();
26944
- var navigatorRoutePlaybookPath = fileURLToPath3(
26945
- new URL("../resources/navigator-route-playbook.md", import.meta.url)
26946
- );
26947
- var collectorHandbookSeedPath = fileURLToPath3(
26948
- new URL("../resources/collector-bot-handbook.md", import.meta.url)
26949
- );
26950
26944
  function loadPackagedRoleReferenceMaterials(role) {
26951
26945
  return role === "auditor" ? loadAuditorReferenceMaterialsFromSubjectInput() : loadMainRoleReferenceMaterials(role);
26952
26946
  }
26953
26947
  function createRoleRuntimeDependencies(packageRoot) {
26948
+ const navigatorRoutePlaybookPath = join42(packageRoot, "resources/navigator-route-playbook.md");
26949
+ const collectorHandbookSeedPath = join42(packageRoot, "resources/collector-bot-handbook.md");
26954
26950
  const doctorAuditor = createPiDoctorAuditor();
26955
26951
  const navigatorSessionFactory = createNativeNavigatorSessionFactory();
26956
26952
  return {
@@ -27017,9 +27013,9 @@ function createRoleRuntimeDependencies(packageRoot) {
27017
27013
  init_session_identity();
27018
27014
 
27019
27015
  // src/acp-host/description.ts
27020
- import { join as join42 } from "node:path";
27016
+ import { join as join43 } from "node:path";
27021
27017
  function resolveAcpBinary(description, operatorHome) {
27022
- return join42(operatorHome, ...description.binaryFromHome);
27018
+ return join43(operatorHome, ...description.binaryFromHome);
27023
27019
  }
27024
27020
  function acpStdioArgs(description, model, seat) {
27025
27021
  const { prefix, suffix, modelFlag, thinkingFlag } = description.argv;
@@ -27466,12 +27462,12 @@ function createAcpRoleTurnHost(config) {
27466
27462
  // src/acp-host/seat-profile-soul.ts
27467
27463
  import { constants as constants3 } from "node:fs";
27468
27464
  import { access as access4, copyFile, lstat as lstat8, mkdir as mkdir7, readlink as readlink2, symlink as symlink2, unlink as unlink3 } from "node:fs/promises";
27469
- import { dirname as dirname25, join as join43, relative as relative3, resolve as resolve20 } from "node:path";
27465
+ import { dirname as dirname25, join as join44, relative as relative3, resolve as resolve20 } from "node:path";
27470
27466
  function seatProfileName(spec, role) {
27471
27467
  return `${spec.namePrefix}${role}`;
27472
27468
  }
27473
27469
  function packageRoleSoulPath(packageRoot, role) {
27474
- return join43(packageRoot, "souls", `${role}.md`);
27470
+ return join44(packageRoot, "souls", `${role}.md`);
27475
27471
  }
27476
27472
  async function pathExists2(path) {
27477
27473
  try {
@@ -27488,16 +27484,16 @@ async function ensureSeatProfileSoul(options) {
27488
27484
  if (!await pathExists2(soulTarget)) {
27489
27485
  throw new Error(`packaged role soul missing: ${soulTarget}`);
27490
27486
  }
27491
- const profilesRoot = join43(operatorHome, ...spec.profilesRootFromHome);
27492
- const profileDir = join43(profilesRoot, profileName);
27487
+ const profilesRoot = join44(operatorHome, ...spec.profilesRootFromHome);
27488
+ const profileDir = join44(profilesRoot, profileName);
27493
27489
  const hostRoot = dirname25(profilesRoot);
27494
- const soulPath = join43(profileDir, spec.soulFileName);
27490
+ const soulPath = join44(profileDir, spec.soulFileName);
27495
27491
  if (!await pathExists2(profileDir)) {
27496
27492
  await mkdir7(profileDir, { recursive: true });
27497
27493
  for (const name of ["auth.json", ".env", "config.yaml"]) {
27498
- const source = join43(hostRoot, name);
27494
+ const source = join44(hostRoot, name);
27499
27495
  if (!await pathExists2(source)) continue;
27500
- await copyFile(source, join43(profileDir, name));
27496
+ await copyFile(source, join44(profileDir, name));
27501
27497
  }
27502
27498
  } else {
27503
27499
  await mkdir7(profileDir, { recursive: true });
@@ -20914,7 +20914,7 @@ import { randomUUID as randomUUID10 } from "node:crypto";
20914
20914
 
20915
20915
  // src/role-runtime-dependencies.ts
20916
20916
  import { readFile as readFile22 } from "node:fs/promises";
20917
- import { fileURLToPath as fileURLToPath2 } from "node:url";
20917
+ import { join as join40 } from "node:path";
20918
20918
 
20919
20919
  // src/canonical-skill-binding.ts
20920
20920
  import { readFile, realpath } from "node:fs/promises";
@@ -26296,16 +26296,12 @@ function createRoleRuntimeExtension(dependencies) {
26296
26296
  // src/role-runtime-dependencies.ts
26297
26297
  init_auditor_soul();
26298
26298
  init_session_opening_materials();
26299
- var navigatorRoutePlaybookPath = fileURLToPath2(
26300
- new URL("../resources/navigator-route-playbook.md", import.meta.url)
26301
- );
26302
- var collectorHandbookSeedPath = fileURLToPath2(
26303
- new URL("../resources/collector-bot-handbook.md", import.meta.url)
26304
- );
26305
26299
  function loadPackagedRoleReferenceMaterials(role) {
26306
26300
  return role === "auditor" ? loadAuditorReferenceMaterialsFromSubjectInput() : loadMainRoleReferenceMaterials(role);
26307
26301
  }
26308
26302
  function createRoleRuntimeDependencies(packageRoot) {
26303
+ const navigatorRoutePlaybookPath = join40(packageRoot, "resources/navigator-route-playbook.md");
26304
+ const collectorHandbookSeedPath = join40(packageRoot, "resources/collector-bot-handbook.md");
26309
26305
  const doctorAuditor = createPiDoctorAuditor();
26310
26306
  const navigatorSessionFactory = createNativeNavigatorSessionFactory();
26311
26307
  return {
@@ -26373,8 +26369,8 @@ init_engine_detour();
26373
26369
  import { randomUUID as randomUUID8 } from "node:crypto";
26374
26370
  import { mkdir as mkdir6, writeFile as writeFile12 } from "node:fs/promises";
26375
26371
  import { createServer } from "node:net";
26376
- import { dirname as dirname24, join as join41 } from "node:path";
26377
- import { fileURLToPath as fileURLToPath3 } from "node:url";
26372
+ import { dirname as dirname24, join as join42 } from "node:path";
26373
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
26378
26374
 
26379
26375
  // src/gatekeeper-pass-envelope.ts
26380
26376
  init_archivist_record_entry();
@@ -26460,10 +26456,10 @@ async function requireGatekeeperPass(options) {
26460
26456
 
26461
26457
  // src/host-native-method.ts
26462
26458
  import { lstat as lstat7, mkdir as mkdir5, readlink, realpath as realpath7, symlink } from "node:fs/promises";
26463
- import { basename as basename9, dirname as dirname23, join as join40 } from "node:path";
26459
+ import { basename as basename9, dirname as dirname23, join as join41 } from "node:path";
26464
26460
  var HOST_METHOD_PLUGIN_NAME = "ak-methods";
26465
- var packagedMethodsDir = (root) => join40(root, "resources", "methods");
26466
- var packagedMethodPluginDir = (root) => join40(root, "dist", "method-host-plugin");
26461
+ var packagedMethodsDir = (root) => join41(root, "resources", "methods");
26462
+ var packagedMethodPluginDir = (root) => join41(root, "dist", "method-host-plugin");
26467
26463
  function hostMethodSkills(methods) {
26468
26464
  return Object.freeze(methods.flatMap((method) => {
26469
26465
  if (method.kind !== "skill") return [];
@@ -26493,7 +26489,7 @@ function applyCodexSkillInvocation(methods, prompt) {
26493
26489
  }
26494
26490
  async function installWorkspaceMethodSkills(cwd, packageRoot) {
26495
26491
  const target = await realpath7(packagedMethodsDir(packageRoot));
26496
- const link = join40(cwd, ".agents", "skills");
26492
+ const link = join41(cwd, ".agents", "skills");
26497
26493
  try {
26498
26494
  const stat2 = await lstat7(link);
26499
26495
  if (!stat2.isSymbolicLink() || await realpath7(link) !== target) {
@@ -26560,7 +26556,7 @@ async function prepareRoleEnvelope(options) {
26560
26556
  const hostAbort = new AbortController();
26561
26557
  const runId = request.runDirectory.split("/").filter(Boolean).at(-1) ?? randomUUID8();
26562
26558
  await mkdir6(request.runDirectory, { recursive: true });
26563
- let sessionFile = options.sessionFile ?? join41(request.runDirectory, "session", "session.jsonl");
26559
+ let sessionFile = options.sessionFile ?? join42(request.runDirectory, "session", "session.jsonl");
26564
26560
  await mkdir6(dirname24(sessionFile), { recursive: true });
26565
26561
  if (request.continuation.kind !== "resume") {
26566
26562
  try {
@@ -26888,7 +26884,7 @@ async function prepareRoleEnvelope(options) {
26888
26884
  }
26889
26885
  });
26890
26886
  }
26891
- const relay = fileURLToPath3(new URL("./mcp-relay.mjs", import.meta.url));
26887
+ const relay = fileURLToPath2(new URL("./mcp-relay.mjs", import.meta.url));
26892
26888
  await listen(server, options.socketPath);
26893
26889
  let disposed = false;
26894
26890
  const dispose = async () => {
@@ -27035,7 +27031,7 @@ async function prepareRoleEnvelope(options) {
27035
27031
  init_session_identity();
27036
27032
 
27037
27033
  // src/headless-host/description.ts
27038
- import { join as join42 } from "node:path";
27034
+ import { join as join43 } from "node:path";
27039
27035
  function isClaudePrintDescription(description) {
27040
27036
  return description.protocol === "claude-print";
27041
27037
  }
@@ -27043,7 +27039,7 @@ function isCodexExecDescription(description) {
27043
27039
  return description.protocol === "codex-exec";
27044
27040
  }
27045
27041
  function resolveHeadlessBinary(description, operatorHome) {
27046
- return join42(operatorHome, ...description.binaryFromHome);
27042
+ return join43(operatorHome, ...description.binaryFromHome);
27047
27043
  }
27048
27044
  function headlessTurnArgs(options) {
27049
27045
  const { description } = options;
@@ -27299,7 +27295,7 @@ import { spawn as spawn4, spawnSync } from "node:child_process";
27299
27295
  import { randomUUID as randomUUID9 } from "node:crypto";
27300
27296
  import { existsSync as existsSync13 } from "node:fs";
27301
27297
  import { writeFile as writeFile13 } from "node:fs/promises";
27302
- import { dirname as dirname25, isAbsolute as isAbsolute11, join as join43, resolve as resolve20 } from "node:path";
27298
+ import { dirname as dirname25, isAbsolute as isAbsolute11, join as join44, resolve as resolve20 } from "node:path";
27303
27299
 
27304
27300
  // src/external-host-turn-loop.ts
27305
27301
  init_host_contracts();
@@ -27518,7 +27514,7 @@ function formatCodexFailurePayload(payload) {
27518
27514
  function cwdIsGitWorkTree(cwd) {
27519
27515
  let dir = cwd;
27520
27516
  for (; ; ) {
27521
- if (existsSync13(join43(dir, ".git"))) return true;
27517
+ if (existsSync13(join44(dir, ".git"))) return true;
27522
27518
  const parent = dirname25(dir);
27523
27519
  if (parent === dir) return false;
27524
27520
  dir = parent;
@@ -27726,14 +27722,14 @@ function createHeadlessRoleTurnHost(config) {
27726
27722
  await config.sessionIdentity.bind(request.principal, sessionId);
27727
27723
  }
27728
27724
  const env = { ...process.env, ...config.env ?? {} };
27729
- const systemPromptPath = join43(request.runDirectory, "headless-system-prompt.txt");
27725
+ const systemPromptPath = join44(request.runDirectory, "headless-system-prompt.txt");
27730
27726
  await writeFile13(systemPromptPath, systemPrompt, "utf8");
27731
27727
  let mcpConfigPath;
27732
27728
  let outputSchemaPath;
27733
27729
  let pluginDir;
27734
27730
  let applyMethodPrompt = codex ? (prompt) => applyCodexSkillInvocation(request.methods, prompt) : (prompt) => prompt;
27735
27731
  if (codex) {
27736
- outputSchemaPath = join43(request.runDirectory, "headless-output-schema.json");
27732
+ outputSchemaPath = join44(request.runDirectory, "headless-output-schema.json");
27737
27733
  await writeFile13(
27738
27734
  outputSchemaPath,
27739
27735
  `${JSON.stringify(closeJsonSchemaForCodex(prepared.jsonSchema), null, 2)}
@@ -27741,7 +27737,7 @@ function createHeadlessRoleTurnHost(config) {
27741
27737
  "utf8"
27742
27738
  );
27743
27739
  } else {
27744
- mcpConfigPath = join43(request.runDirectory, "headless-mcp-config.json");
27740
+ mcpConfigPath = join44(request.runDirectory, "headless-mcp-config.json");
27745
27741
  await writeFile13(
27746
27742
  mcpConfigPath,
27747
27743
  `${JSON.stringify(headlessMcpConfigDocument(prepared.mcpServers), null, 2)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akagilnc/pi-workflow-roles",
3
- "version": "0.1.4522",
3
+ "version": "0.1.4524",
4
4
  "description": "Soul-bound workflow roles for Pi",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1,5 +1,5 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { fileURLToPath } from "node:url";
2
+ import { join } from "node:path";
3
3
 
4
4
  import { loadCanonicalSkillBinding as loadHomeCanonicalSkillBinding } from "./canonical-skill-binding.ts";
5
5
  import { createGhCollectorGitHubTransport } from "./collector-github.ts";
@@ -20,13 +20,6 @@ import {
20
20
  loadMainRoleSessionMaterials,
21
21
  } from "./session-opening-materials.ts";
22
22
 
23
- const navigatorRoutePlaybookPath = fileURLToPath(
24
- new URL("../resources/navigator-route-playbook.md", import.meta.url),
25
- );
26
- const collectorHandbookSeedPath = fileURLToPath(
27
- new URL("../resources/collector-bot-handbook.md", import.meta.url),
28
- );
29
-
30
23
  /** Single packaged source for reference materials across production composition roots. */
31
24
  export function loadPackagedRoleReferenceMaterials(role: Parameters<NonNullable<RoleRuntimeDependencies["loadRoleReferenceMaterials"]>>[0]): Promise<string> {
32
25
  return role === "auditor"
@@ -36,6 +29,11 @@ export function loadPackagedRoleReferenceMaterials(role: Parameters<NonNullable<
36
29
 
37
30
  /** Host-neutral packaged role runtime deps for the parent-process envelope. */
38
31
  export function createRoleRuntimeDependencies(packageRoot: string): RoleRuntimeDependencies {
32
+ // packageRoot is the install root (resources/ lives there). Never resolve via
33
+ // import.meta.url — headless/acp production-host bundles live under dist/*/
34
+ // and would otherwise look for dist/resources/ (#962).
35
+ const navigatorRoutePlaybookPath = join(packageRoot, "resources/navigator-route-playbook.md");
36
+ const collectorHandbookSeedPath = join(packageRoot, "resources/collector-bot-handbook.md");
39
37
  const doctorAuditor = createPiDoctorAuditor();
40
38
  const navigatorSessionFactory = createNativeNavigatorSessionFactory();
41
39
  return {