agent-valley 4.6.0 → 4.8.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.
@@ -7086,6 +7086,7 @@ var init_contracts = __esm(() => {
7086
7086
  "service-shutdown",
7087
7087
  "chief-wait",
7088
7088
  "chief-unavailable",
7089
+ "handoff-unavailable",
7089
7090
  "integrity"
7090
7091
  ]).optional(),
7091
7092
  progressKey: string2().optional(),
@@ -7109,12 +7110,21 @@ function chiefRecoveryStopped(mission) {
7109
7110
  const intervenedAt = Date.parse(mission.execution?.interventionAt ?? "");
7110
7111
  return !Number.isFinite(stoppedAt) || !Number.isFinite(intervenedAt) || intervenedAt <= stoppedAt;
7111
7112
  }
7113
+ function isNativeAgentTimeout(reason) {
7114
+ return /^Agent timed out after \d+(?:\.\d+)?s$/i.test(reason);
7115
+ }
7116
+ function isUnavailableAgentModel(reason) {
7117
+ const normalized = reason.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
7118
+ return /\bmodel not (?:found|available)\b|(?:^|:\s*)(?:the )?model (?:is )?unavailable(?:[.!:]|$)/i.test(normalized);
7119
+ }
7112
7120
  function classifyFailure(reason) {
7113
7121
  if (/unauthori[sz]ed|authentication|login required|log in|expired token|invalid.*(?:token|api.key)|\b401\b|\b403\b/i.test(reason))
7114
7122
  return "authentication";
7115
7123
  if (/rate.?limit|too many requests|\b429\b/i.test(reason))
7116
7124
  return "rate-limit";
7117
- if (/\b50[0234]\b|econnreset|econnrefused|etimedout|fetch failed|temporarily unavailable|overloaded|network error/i.test(reason))
7125
+ if (isUnavailableAgentModel(reason))
7126
+ return "environment";
7127
+ if (isNativeAgentTimeout(reason) || /\b50[0234]\b|econnreset|econnrefused|etimedout|fetch failed|temporarily unavailable|overloaded|network error/i.test(reason))
7118
7128
  return "provider";
7119
7129
  if (/enoent|not found|missing.*(?:cli|command|dependency)|permission denied|eacces|enospc/i.test(reason))
7120
7130
  return "environment";
@@ -7894,11 +7904,7 @@ var init_chief_schema = __esm(() => {
7894
7904
 
7895
7905
  // ../../packages/core/src/config/comment-relay-schema.ts
7896
7906
  function buildCommentRelayConfig(relay) {
7897
- return {
7898
- enabled: relay?.enabled ?? false,
7899
- ignoreAuthors: relay?.ignore_authors ?? [],
7900
- pullRequestReviews: relay?.pull_request_reviews ?? false
7901
- };
7907
+ return { enabled: relay?.enabled ?? false, ignoreAuthors: relay?.ignore_authors ?? [] };
7902
7908
  }
7903
7909
  var commentRelayProjectSchema, githubCommentRelayProjectSchema, commentRelayMergedSchema;
7904
7910
  var init_comment_relay_schema = __esm(() => {
@@ -7912,8 +7918,7 @@ var init_comment_relay_schema = __esm(() => {
7912
7918
  });
7913
7919
  commentRelayMergedSchema = object({
7914
7920
  enabled: boolean2(),
7915
- ignoreAuthors: array(string2()),
7916
- pullRequestReviews: boolean2()
7921
+ ignoreAuthors: array(string2())
7917
7922
  }).optional();
7918
7923
  });
7919
7924
 
@@ -7980,6 +7985,33 @@ function resolveProjectConfigPath(root) {
7980
7985
  var PROJECT_CONFIG_FILENAME = "av.yaml";
7981
7986
  var init_project_config_path = () => {};
7982
7987
 
7988
+ // ../../packages/core/src/config/pull-request-reviews-schema.ts
7989
+ function buildPullRequestReviewsConfig(reviews, trackerKind, githubWebhookSecret, legacyGithubEnabled) {
7990
+ return {
7991
+ enabled: reviews?.enabled ?? (trackerKind === "github" ? legacyGithubEnabled : undefined) ?? false,
7992
+ webhookSecret: (trackerKind === "github" ? githubWebhookSecret : reviews?.webhook_secret) ?? "",
7993
+ ignoreAuthors: reviews?.ignore_authors ?? []
7994
+ };
7995
+ }
7996
+ var pullRequestReviewsProjectSchema, pullRequestReviewsMergedSchema;
7997
+ var init_pull_request_reviews_schema = __esm(() => {
7998
+ init_zod();
7999
+ pullRequestReviewsProjectSchema = object({
8000
+ enabled: boolean2().optional(),
8001
+ webhook_secret: string2().min(1).optional(),
8002
+ ignore_authors: array(string2().min(1)).optional()
8003
+ });
8004
+ pullRequestReviewsMergedSchema = object({
8005
+ enabled: boolean2(),
8006
+ webhookSecret: string2(),
8007
+ ignoreAuthors: array(string2())
8008
+ }).refine((reviews) => !reviews.enabled || reviews.webhookSecret, {
8009
+ path: ["webhookSecret"],
8010
+ message: `Pull request review follow-up needs the GitHub webhook secret.
8011
+ ` + " Fix: set delivery.pull_request_reviews.webhook_secret in av.yaml (github.webhook_secret with the GitHub tracker)."
8012
+ }).optional();
8013
+ });
8014
+
7983
8015
  // ../../packages/core/src/config/team-schema.ts
7984
8016
  function normalizeTeamRelayUrl(value) {
7985
8017
  const input = value.trim();
@@ -15223,6 +15255,7 @@ function mergeConfigs(global, project, env) {
15223
15255
  logLevel: project?.logging?.level ?? global?.logging?.level ?? defaults.logLevel,
15224
15256
  logFormat: project?.logging?.format ?? global?.logging?.format ?? defaults.logFormat,
15225
15257
  deliveryMode: project?.delivery?.mode ?? defaults.deliveryMode,
15258
+ pullRequestReviews: buildPullRequestReviewsConfig(project?.delivery?.pull_request_reviews, trackerKind, project?.github?.webhook_secret, project?.github?.comment_relay?.pull_request_reviews),
15226
15259
  promptTemplate: project?.prompt ?? "",
15227
15260
  routingRules: (project?.routing?.rules ?? []).map((r) => ({
15228
15261
  label: r.label,
@@ -15290,6 +15323,7 @@ var init_yaml_loader = __esm(() => {
15290
15323
  init_hardware();
15291
15324
  init_observability_schema();
15292
15325
  init_project_config_path();
15326
+ init_pull_request_reviews_schema();
15293
15327
  init_task_schema();
15294
15328
  init_team_schema();
15295
15329
  init_tunnel_schema();
@@ -15347,7 +15381,8 @@ var init_yaml_loader = __esm(() => {
15347
15381
  actor: actorDefaultsSchema.optional(),
15348
15382
  agent: actorDefaultsSchema.optional(),
15349
15383
  delivery: object({
15350
- mode: _enum(["merge", "pr"]).optional()
15384
+ mode: _enum(["merge", "pr"]).optional(),
15385
+ pull_request_reviews: pullRequestReviewsProjectSchema.optional()
15351
15386
  }).optional(),
15352
15387
  logging: object({
15353
15388
  level: _enum(["debug", "info", "warn", "error"]).optional(),
@@ -15419,6 +15454,7 @@ var init_yaml_loader = __esm(() => {
15419
15454
  logLevel: _enum(["debug", "info", "warn", "error"]),
15420
15455
  logFormat: _enum(["json", "text"]),
15421
15456
  deliveryMode: _enum(["merge", "pr"]),
15457
+ pullRequestReviews: pullRequestReviewsMergedSchema,
15422
15458
  promptTemplate: string2().min(1, `prompt is not set.
15423
15459
  Fix: Add prompt field to av.yaml`),
15424
15460
  routingRules: array(object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",