@agent-marshal/marshal-pi 0.56.0 → 0.58.0

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/src/identity.ts CHANGED
@@ -8,6 +8,7 @@ import { execFileSync } from "node:child_process";
8
8
  import type { HostInfo } from "./entities.ts";
9
9
 
10
10
  export interface Identity {
11
+ agentId?: string;
11
12
  operator: string;
12
13
  host: HostInfo;
13
14
  gitBranch?: string;
@@ -57,5 +58,5 @@ export async function resolveIdentity(cwd: string): Promise<Identity> {
57
58
  const toplevel = tryText("git", ["rev-parse", "--show-toplevel"], cwd);
58
59
  const project = toplevel ? toplevel.split(/[/\\]/).pop() || undefined : undefined;
59
60
 
60
- return { operator, host, gitBranch, project };
61
+ return { operator, host, gitBranch, project, agentId: process.env.MARSHAL_AGENT_ID?.trim() || undefined };
61
62
  }
package/src/index.ts CHANGED
@@ -348,6 +348,7 @@ async function init(pi: ExtensionAPI) {
348
348
  "",
349
349
  `nickname: ${nick}`,
350
350
  `operator: ${identity.operator}`,
351
+ `agent_id: ${JSON.stringify(identity.agentId ?? null)}`,
351
352
  `host: ${host}`,
352
353
  `project: ${identity.project ?? "(none)"}`,
353
354
  `branch: ${identity.gitBranch ?? "(none)"}`,
@@ -377,7 +378,7 @@ async function init(pi: ExtensionAPI) {
377
378
  const branch = s.gitBranch ? ` @${s.gitBranch}` : "";
378
379
  const op = s.operator ? ` (${s.operator})` : "";
379
380
  const task = s.currentTask ? ` — ${s.currentTask}` : "";
380
- return `- ${host}:${dir}${branch}${op} [${s.id}]${task}`;
381
+ return `- ${host}:${dir}${branch}${op} [${s.id}]${s.agentId ? ` agent_id=${JSON.stringify(s.agentId)}` : ""}${task}`;
381
382
  });
382
383
  return { content: [{ type: "text", text: rows.join("\n") }], details: {} };
383
384
  },