agent-valley 3.0.3 → 3.0.5

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "av",
4
- "version": "3.0.3",
4
+ "version": "3.0.5",
5
5
  "description": "Delegate repository goals to Agent Valley and inspect mission progress and verification evidence.",
6
6
  "author": {
7
7
  "name": "Agent Valley"
package/dist/index.js CHANGED
@@ -15926,13 +15926,16 @@ function signalProcessTree(proc, signal) {
15926
15926
  try {
15927
15927
  proc.kill(signal);
15928
15928
  } catch (handleError) {
15929
- if (handleError.code === "EPERM" && absent(-proc.pid) && absent(proc.pid))
15929
+ if (handleError.code === "EPERM" && rootAndGroupAbsent(proc.pid))
15930
15930
  return;
15931
15931
  throw handleError;
15932
15932
  }
15933
15933
  }
15934
15934
  }
15935
15935
  }
15936
+ function rootAndGroupAbsent(pid) {
15937
+ return absent(-pid) && absent(pid);
15938
+ }
15936
15939
  function absent(pid) {
15937
15940
  try {
15938
15941
  process.kill(pid, 0);
@@ -16380,6 +16383,15 @@ function waitForReap(proc, timeoutMs) {
16380
16383
  onExit();
16381
16384
  });
16382
16385
  }
16386
+ async function waitForRootAndGroupAbsence(pid, timeoutMs) {
16387
+ const deadline = Date.now() + Math.min(250, timeoutMs);
16388
+ while (Date.now() < deadline) {
16389
+ await new Promise((resolve) => setTimeout(resolve, Math.min(25, deadline - Date.now())));
16390
+ if (rootAndGroupAbsent(pid))
16391
+ return true;
16392
+ }
16393
+ return false;
16394
+ }
16383
16395
  function waitForStreamCompletion(proc, graceMs = 250) {
16384
16396
  return new Promise((resolve) => {
16385
16397
  if (!proc.stdout) {
@@ -16540,6 +16552,7 @@ class BaseSession {
16540
16552
  async terminateProcess(proc) {
16541
16553
  if (!proc.pid)
16542
16554
  return;
16555
+ const deadline = Date.now() + 5000;
16543
16556
  let signalError;
16544
16557
  try {
16545
16558
  signalProcessTree(proc, "SIGKILL");
@@ -16548,13 +16561,15 @@ class BaseSession {
16548
16561
  throw error;
16549
16562
  signalError = error;
16550
16563
  }
16551
- if (!await waitForReap(proc, 5000)) {
16564
+ if (!await waitForReap(proc, Math.max(0, deadline - Date.now()))) {
16552
16565
  throw signalError ?? new Error(`Agent process ${proc.pid} did not exit within 5000ms after SIGKILL; inspect it before retrying.`);
16553
16566
  }
16554
16567
  if (signalError) {
16555
16568
  try {
16556
16569
  signalProcessTree(proc, "SIGKILL");
16557
- } catch {
16570
+ } catch (retryError) {
16571
+ if (retryError.code === "EPERM" && await waitForRootAndGroupAbsence(proc.pid, Math.max(0, deadline - Date.now())))
16572
+ return;
16558
16573
  throw signalError;
16559
16574
  }
16560
16575
  }
@@ -70014,6 +70029,12 @@ function context(mission) {
70014
70029
  }
70015
70030
  function planPrompt(mission) {
70016
70031
  const chief = mission.personas.find((persona) => persona.id === mission.chiefId);
70032
+ const responseKeys = [
70033
+ "tasks",
70034
+ ...mission.availableAgents ? ["actors"] : [],
70035
+ ...mission.supervision ? ["goalBrief"] : [],
70036
+ ...mission.verificationMode === "chief" ? ["verificationContract"] : []
70037
+ ];
70017
70038
  return [
70018
70039
  "You are the Chief Director coordinating this mission. Understand the user's intent and the actual business and product context, then decide a strategy and plan the requested work.",
70019
70040
  CHIEF_DIRECTOR_ROLE,
@@ -70050,6 +70071,8 @@ function planPrompt(mission) {
70050
70071
  `Verified installed OMA skill catalog (JSON data): ${JSON.stringify(mission.availableSkills.map(({ name, description }) => ({ name, description: description.slice(0, 300) })))}`,
70051
70072
  "Select only needed catalog skill names for each generated Actor. No invented names or paths; the runtime supplies selected skill files. Skill access does not extend publication, spending or file-change authorization."
70052
70073
  ] : [],
70074
+ `Allowed top-level response keys for this mode: ${JSON.stringify(responseKeys)}. Return no other root keys.`,
70075
+ "Mission input identity fields are metadata, not response fields. Do not copy chiefId, technicalLeadId, designLeadId or marketingLeadId into the response root, or copy other Mission metadata. When generating a roster, retain nominated companions only as entries in actors with their supplied ids. With a fixed roster, use configured Actor ids without returning actors.",
70053
70076
  ...mission.availableAgents ? [
70054
70077
  `The operator's Chief Director CLI is fixed: ${JSON.stringify({ id: mission.chiefId, actorType: chief?.agentType })}. Do not replace it with another vendor. Omit model from every response Actor; the scheduler retains the selected Chief Director model and Actors use their CLI defaults.`,
70055
70078
  mission.availableSkills?.length ? "Select relevant skills only from the verified installed catalog. Assign tasks to generated Actor ids. Return actors, tasks and the requested goalBrief together in one JSON object within the 8,000-character limit." : "Set skills: [] because no installed skill capabilities were supplied; describe expertise in role. Assign tasks to generated Actor ids. Return actors, tasks and any requested goalBrief together in one JSON object within the 8,000-character limit.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",