agent-valley 4.8.6 → 4.8.7

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": "4.8.6",
4
+ "version": "4.8.7",
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
@@ -21823,7 +21823,11 @@ async function boundedProbe(path, args, deps) {
21823
21823
  }
21824
21824
  async function nativeAuth(agent, path, deps) {
21825
21825
  if (agent !== "claude" && agent !== "codex" && agent !== "cursor") {
21826
- return unknown2(agent, "This CLI has no supported read-only authentication status probe");
21826
+ return {
21827
+ readiness: "unknown",
21828
+ reason: "This CLI has no supported read-only authentication status probe. Authentication remains unverified.",
21829
+ authStatusProbe: "unsupported"
21830
+ };
21827
21831
  }
21828
21832
  const command = agent === "claude" ? "auth" : agent === "codex" ? "login" : "status";
21829
21833
  const probeDeps = { ...deps, env: buildAgentEnv(agent, {}, deps.env) };
@@ -24411,6 +24415,11 @@ var init_linear_webhook_client = __esm(() => {
24411
24415
  });
24412
24416
  });
24413
24417
 
24418
+ // src/setup/actor-readiness.ts
24419
+ function hasUnsupportedAuthProbe(state) {
24420
+ return state.readiness === "unknown" && state.authStatusProbe === "unsupported" && Boolean(state.binaryPath);
24421
+ }
24422
+
24414
24423
  // src/setup/config-write.ts
24415
24424
  function canonicalConfig(config) {
24416
24425
  const { agent, actor, ...rest } = config;
@@ -24895,10 +24904,10 @@ function currentRuntimeIdentity(env) {
24895
24904
  if (claude)
24896
24905
  identities.push({ actorType: "claude", source: claude });
24897
24906
  if (identities.length > 1)
24898
- throw new Error("Current runtime identity is ambiguous. Rerun av setup --yes --actor <current-vendor> --model <current-model-or-empty>; do not use OMA defaults to identify the caller.");
24907
+ throw new SetupIdentityRequiredError("Current runtime identity is ambiguous. Rerun av setup --yes --actor <current-vendor> --model <current-model-or-empty>; do not use OMA defaults to identify the caller.");
24899
24908
  return identities[0];
24900
24909
  }
24901
- var quietSpawn = (command, args, options) => spawn13(command, args, { ...options, stdio: "ignore" });
24910
+ var quietSpawn = (command, args, options) => spawn13(command, args, { ...options, stdio: "ignore" }), SetupIdentityRequiredError;
24902
24911
  var init_noninteractive_runtime = __esm(() => {
24903
24912
  init_yaml_loader();
24904
24913
  init_agent_discovery();
@@ -24906,6 +24915,8 @@ var init_noninteractive_runtime = __esm(() => {
24906
24915
  init_client_integrations();
24907
24916
  init_client_integrations_files();
24908
24917
  init_oma_provisioning();
24918
+ SetupIdentityRequiredError = class SetupIdentityRequiredError extends Error {
24919
+ };
24909
24920
  });
24910
24921
 
24911
24922
  // ../../node_modules/.bun/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
@@ -26410,16 +26421,17 @@ async function configFile(path, schema) {
26410
26421
  function actor(raw) {
26411
26422
  return raw.actor ?? raw.agent ?? {};
26412
26423
  }
26413
- function selectChief(options, deps, project, global2) {
26424
+ function selectChief(options, deps, project, global2, existingProject) {
26414
26425
  const runtime = options.actor === undefined ? currentRuntimeIdentity(deps.env) : undefined;
26415
26426
  const projectActor = actor(project);
26416
26427
  const globalActor = actor(global2);
26417
- const selected = options.actor ?? runtime?.actorType ?? projectActor.type ?? globalActor.type;
26428
+ const savedType = projectActor.type ?? (existingProject ? globalActor.type : undefined);
26429
+ const selected = options.actor ?? runtime?.actorType ?? savedType;
26418
26430
  if (!selected)
26419
- throw new Error(`actor.type is missing in ${join72(deps.projectRoot, "av.yaml")} and ${deps.globalConfigPath}, and the current agent runtime is unknown. Rerun av setup --yes --actor <current-vendor> --model <current-model-or-empty>.`);
26431
+ throw new SetupIdentityRequiredError(`actor.type is not selected for ${join72(deps.projectRoot, "av.yaml")}, and the current agent runtime is unknown. Defaults in ${deps.globalConfigPath} do not identify a new project's initiating agent. Rerun av setup --yes --actor <current-vendor> --model <current-model-or-empty>.`);
26420
26432
  const actorType = selected;
26421
26433
  const actorSource = options.actor !== undefined ? "explicit" : runtime ? "runtime" : projectActor.type ? "project" : "global";
26422
- const previousType = projectActor.type ?? globalActor.type;
26434
+ const previousType = savedType;
26423
26435
  let model = null;
26424
26436
  let modelSource = "native-default";
26425
26437
  if (options.model !== undefined) {
@@ -26464,7 +26476,7 @@ async function prepareNoninteractiveConfig(options, deps) {
26464
26476
  const projectPath = join72(projectRoot, "av.yaml");
26465
26477
  const project = await configFile(projectPath, projectConfigSchema);
26466
26478
  const global2 = await configFile(globalPath, globalConfigSchema);
26467
- const chief = selectChief(options, { ...deps, projectRoot, globalConfigPath: globalPath }, project.raw, global2.raw);
26479
+ const chief = selectChief(options, { ...deps, projectRoot, globalConfigPath: globalPath }, project.raw, global2.raw, project.file.before !== null);
26468
26480
  for (const [raw, path] of [
26469
26481
  [project.raw, projectPath],
26470
26482
  [global2.raw, globalPath]
@@ -26581,8 +26593,12 @@ async function setupNoninteractive(options, overrides = {}) {
26581
26593
  result.nextActions.push(installation.message);
26582
26594
  }
26583
26595
  result.chief.readiness = availability.readiness;
26596
+ result.chief.authStatusProbe = availability.authStatusProbe;
26584
26597
  result.chief.message = availability.reason;
26585
- if (availability.readiness !== "ready")
26598
+ const unsupportedAuthProbe = hasUnsupportedAuthProbe(availability);
26599
+ if (unsupportedAuthProbe)
26600
+ result.chief.message += " Chief authentication remains unverified.";
26601
+ else if (availability.readiness !== "ready")
26586
26602
  result.nextActions.push(AGENT_LOGIN_HINT[selected]);
26587
26603
  if (options.oma === "skip") {
26588
26604
  result.oma = {
@@ -26617,7 +26633,7 @@ async function setupNoninteractive(options, overrides = {}) {
26617
26633
  result.nextActions.push(rerunCommand(result, options));
26618
26634
  return result;
26619
26635
  }
26620
- if (availability.readiness !== "ready") {
26636
+ if (availability.readiness !== "ready" && !unsupportedAuthProbe) {
26621
26637
  result.status = "action_required";
26622
26638
  result.exitCode = 2;
26623
26639
  result.nextActions.push(rerunCommand(result, options));
@@ -26628,6 +26644,10 @@ async function setupNoninteractive(options, overrides = {}) {
26628
26644
  result.nextActions.push(`Run av order "your goal" from ${result.projectRoot}.`, "Restart/reload the agent client and complete its normal workspace/MCP trust steps if needed.");
26629
26645
  return result;
26630
26646
  } catch (error) {
26647
+ if (error instanceof SetupIdentityRequiredError) {
26648
+ result.status = "action_required";
26649
+ result.exitCode = 2;
26650
+ }
26631
26651
  result.error = error instanceof Error ? error.message : "AV setup failed. Correct the reported settings and rerun av setup --yes.";
26632
26652
  result.nextActions.push(result.error);
26633
26653
  return result;
@@ -26644,7 +26664,8 @@ function printNoninteractiveSetupResult(result, json = false) {
26644
26664
  Workspace: ${result.workspace ?? "not selected"}
26645
26665
  Project config: ${result.config.project}
26646
26666
  Global config: ${result.config.global}
26647
- Chief Director: ${chief} (${result.chief.readiness})
26667
+ Chief Director: ${chief} (${result.chief.readiness}; source: ${result.chief.actorSource ?? "unknown"})
26668
+ Chief readiness: ${result.chief.message}
26648
26669
  OMA: ${result.oma.status}
26649
26670
  Client integrations: ${result.integrations.status}`);
26650
26671
  for (const action of result.nextActions)
@@ -26827,6 +26848,10 @@ async function stepAgentType(ctx, step, total) {
26827
26848
  log2.success(`${plan.label} Chief Director is ready. Available worker CLIs are selected automatically.`);
26828
26849
  return;
26829
26850
  }
26851
+ if (hasUnsupportedAuthProbe(state)) {
26852
+ log2.warn(`${plan.label} is installed. Authentication remains unverified because its status probe is unsupported.`);
26853
+ return;
26854
+ }
26830
26855
  note(state.reason, `${plan.label} setup`);
26831
26856
  const action = await select({
26832
26857
  message: state.readiness === "unavailable" ? `Install and sign in to ${plan.label}?` : `Sign in to ${plan.label}?`,
@@ -26864,7 +26889,7 @@ async function stepAgentType(ctx, step, total) {
26864
26889
  continue;
26865
26890
  }
26866
26891
  const afterInstall = await inspectChiefAgent(selected);
26867
- if (afterInstall.readiness === "ready")
26892
+ if (afterInstall.readiness === "ready" || hasUnsupportedAuthProbe(afterInstall))
26868
26893
  continue;
26869
26894
  if (afterInstall.readiness === "unavailable") {
26870
26895
  log2.warn("The CLI is still unavailable. Check your PATH, open a new terminal if needed, and choose Recheck.");
@@ -28930,8 +28955,10 @@ async function setup(options = {}) {
28930
28955
  const existing = globalSettings.config;
28931
28956
  if (existing.linear?.api_key)
28932
28957
  ctx.linear = { apiKey: existing.linear.api_key };
28933
- ctx.agentType = existing.agent?.type;
28934
- ctx.agentModel = existing.agent?.model;
28958
+ if (hasProject) {
28959
+ ctx.agentType = existing.agent?.type;
28960
+ ctx.agentModel = existing.agent?.model;
28961
+ }
28935
28962
  ctx.chief = existing.chief;
28936
28963
  let replaceInvalidProject = false;
28937
28964
  if (hasProject) {
@@ -28941,6 +28968,12 @@ async function setup(options = {}) {
28941
28968
  ctx.verifyCommand = existing?.verify?.command;
28942
28969
  ctx.task = existing?.task;
28943
28970
  ctx.chief = mergeChiefConfig(ctx.chief, existing?.chief);
28971
+ if (existing?.agent?.type) {
28972
+ if (ctx.agentType !== existing.agent.type)
28973
+ delete ctx.agentModel;
28974
+ ctx.agentType = existing.agent.type;
28975
+ ctx.agentModel = existing.agent.model ?? ctx.agentModel;
28976
+ }
28944
28977
  } catch (error) {
28945
28978
  if (error instanceof TeamConfigMigrationError)
28946
28979
  throw error;
@@ -28948,6 +28981,11 @@ async function setup(options = {}) {
28948
28981
  log2.warn("Existing av.yaml cannot be read. Re-enter the workspace and verification settings to replace it.");
28949
28982
  }
28950
28983
  }
28984
+ const runtime = currentRuntimeIdentity(process.env);
28985
+ if (runtime) {
28986
+ ctx.agentType = runtime.actorType;
28987
+ delete ctx.agentModel;
28988
+ }
28951
28989
  await runStepLoop(ctx);
28952
28990
  const resolved = resolveContext(ctx);
28953
28991
  if (!resolved.ok) {
@@ -28983,6 +29021,7 @@ var init_setup = __esm(() => {
28983
29021
  init_github_step();
28984
29022
  init_global_settings();
28985
29023
  init_linear_step();
29024
+ init_noninteractive_runtime();
28986
29025
  init_oma_step();
28987
29026
  init_parallel_step();
28988
29027
  init_preview();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "4.8.6",
3
+ "version": "4.8.7",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",