agent-valley 4.5.0 → 4.7.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/README.md +12 -0
- package/dist/assets/plugin.json +1 -1
- package/dist/index.js +2167 -944
- package/dist/supervisor.js +68 -16
- package/package.json +1 -1
package/dist/supervisor.js
CHANGED
|
@@ -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 (
|
|
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";
|
|
@@ -7892,6 +7902,26 @@ var init_chief_schema = __esm(() => {
|
|
|
7892
7902
|
});
|
|
7893
7903
|
});
|
|
7894
7904
|
|
|
7905
|
+
// ../../packages/core/src/config/comment-relay-schema.ts
|
|
7906
|
+
function buildCommentRelayConfig(relay) {
|
|
7907
|
+
return { enabled: relay?.enabled ?? false, ignoreAuthors: relay?.ignore_authors ?? [] };
|
|
7908
|
+
}
|
|
7909
|
+
var commentRelayProjectSchema, githubCommentRelayProjectSchema, commentRelayMergedSchema;
|
|
7910
|
+
var init_comment_relay_schema = __esm(() => {
|
|
7911
|
+
init_zod();
|
|
7912
|
+
commentRelayProjectSchema = object({
|
|
7913
|
+
enabled: boolean2().optional(),
|
|
7914
|
+
ignore_authors: array(string2().min(1)).optional()
|
|
7915
|
+
});
|
|
7916
|
+
githubCommentRelayProjectSchema = commentRelayProjectSchema.extend({
|
|
7917
|
+
pull_request_reviews: boolean2().optional()
|
|
7918
|
+
});
|
|
7919
|
+
commentRelayMergedSchema = object({
|
|
7920
|
+
enabled: boolean2(),
|
|
7921
|
+
ignoreAuthors: array(string2())
|
|
7922
|
+
}).optional();
|
|
7923
|
+
});
|
|
7924
|
+
|
|
7895
7925
|
// ../../packages/core/src/config/hardware.ts
|
|
7896
7926
|
import { cpus, totalmem } from "node:os";
|
|
7897
7927
|
function detectHardware() {
|
|
@@ -7955,6 +7985,33 @@ function resolveProjectConfigPath(root) {
|
|
|
7955
7985
|
var PROJECT_CONFIG_FILENAME = "av.yaml";
|
|
7956
7986
|
var init_project_config_path = () => {};
|
|
7957
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
|
+
|
|
7958
8015
|
// ../../packages/core/src/config/team-schema.ts
|
|
7959
8016
|
function normalizeTeamRelayUrl(value) {
|
|
7960
8017
|
const input = value.trim();
|
|
@@ -15187,7 +15244,7 @@ function mergeConfigs(global, project, env) {
|
|
|
15187
15244
|
cancelled: project?.linear?.workflow_states?.cancelled ?? ""
|
|
15188
15245
|
},
|
|
15189
15246
|
github: githubMerged,
|
|
15190
|
-
commentRelay:
|
|
15247
|
+
commentRelay: buildCommentRelayConfig(trackerKind === "github" ? project?.github?.comment_relay : project?.linear?.comment_relay),
|
|
15191
15248
|
workspaceRoot: project?.workspace?.root ?? "",
|
|
15192
15249
|
agentType: projectActor?.type ?? globalActor?.type ?? defaults.agentType,
|
|
15193
15250
|
agentTimeout: projectActor?.timeout ?? globalActor?.timeout ?? defaults.agentTimeout,
|
|
@@ -15198,6 +15255,7 @@ function mergeConfigs(global, project, env) {
|
|
|
15198
15255
|
logLevel: project?.logging?.level ?? global?.logging?.level ?? defaults.logLevel,
|
|
15199
15256
|
logFormat: project?.logging?.format ?? global?.logging?.format ?? defaults.logFormat,
|
|
15200
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),
|
|
15201
15259
|
promptTemplate: project?.prompt ?? "",
|
|
15202
15260
|
routingRules: (project?.routing?.rules ?? []).map((r) => ({
|
|
15203
15261
|
label: r.label,
|
|
@@ -15254,19 +15312,18 @@ Symphony cannot start until all config errors are resolved.`);
|
|
|
15254
15312
|
process.exit(1);
|
|
15255
15313
|
}
|
|
15256
15314
|
}
|
|
15257
|
-
|
|
15258
|
-
return { enabled: relay?.enabled ?? false, ignoreAuthors: relay?.ignore_authors ?? [] };
|
|
15259
|
-
}
|
|
15260
|
-
var globalConfigSchema, commentRelayProjectSchema, projectConfigSchema, githubConfigSchema, mergedConfigSchema;
|
|
15315
|
+
var globalConfigSchema, projectConfigSchema, githubConfigSchema, mergedConfigSchema;
|
|
15261
15316
|
var init_yaml_loader = __esm(() => {
|
|
15262
15317
|
init_zod();
|
|
15263
15318
|
init_skill_matrix_schema();
|
|
15264
15319
|
init_actor_schema();
|
|
15265
15320
|
init_budget_schema();
|
|
15266
15321
|
init_chief_schema();
|
|
15322
|
+
init_comment_relay_schema();
|
|
15267
15323
|
init_hardware();
|
|
15268
15324
|
init_observability_schema();
|
|
15269
15325
|
init_project_config_path();
|
|
15326
|
+
init_pull_request_reviews_schema();
|
|
15270
15327
|
init_task_schema();
|
|
15271
15328
|
init_team_schema();
|
|
15272
15329
|
init_tunnel_schema();
|
|
@@ -15288,10 +15345,6 @@ var init_yaml_loader = __esm(() => {
|
|
|
15288
15345
|
}).optional(),
|
|
15289
15346
|
team: teamConfigSchema.optional()
|
|
15290
15347
|
}).strict().overwrite(normalizeActorDefaults);
|
|
15291
|
-
commentRelayProjectSchema = object({
|
|
15292
|
-
enabled: boolean2().optional(),
|
|
15293
|
-
ignore_authors: array(string2().min(1)).optional()
|
|
15294
|
-
});
|
|
15295
15348
|
projectConfigSchema = object({
|
|
15296
15349
|
tracker: object({
|
|
15297
15350
|
kind: _enum(["linear", "github"]).optional()
|
|
@@ -15320,7 +15373,7 @@ var init_yaml_loader = __esm(() => {
|
|
|
15320
15373
|
done: string2().min(1).optional(),
|
|
15321
15374
|
cancelled: string2().min(1).optional()
|
|
15322
15375
|
}).optional(),
|
|
15323
|
-
comment_relay:
|
|
15376
|
+
comment_relay: githubCommentRelayProjectSchema.optional()
|
|
15324
15377
|
}).optional(),
|
|
15325
15378
|
workspace: object({
|
|
15326
15379
|
root: string2().min(1).optional()
|
|
@@ -15328,7 +15381,8 @@ var init_yaml_loader = __esm(() => {
|
|
|
15328
15381
|
actor: actorDefaultsSchema.optional(),
|
|
15329
15382
|
agent: actorDefaultsSchema.optional(),
|
|
15330
15383
|
delivery: object({
|
|
15331
|
-
mode: _enum(["merge", "pr"]).optional()
|
|
15384
|
+
mode: _enum(["merge", "pr"]).optional(),
|
|
15385
|
+
pull_request_reviews: pullRequestReviewsProjectSchema.optional()
|
|
15332
15386
|
}).optional(),
|
|
15333
15387
|
logging: object({
|
|
15334
15388
|
level: _enum(["debug", "info", "warn", "error"]).optional(),
|
|
@@ -15387,10 +15441,7 @@ var init_yaml_loader = __esm(() => {
|
|
|
15387
15441
|
cancelled: string2()
|
|
15388
15442
|
}),
|
|
15389
15443
|
github: githubConfigSchema.optional(),
|
|
15390
|
-
commentRelay:
|
|
15391
|
-
enabled: boolean2(),
|
|
15392
|
-
ignoreAuthors: array(string2())
|
|
15393
|
-
}).optional(),
|
|
15444
|
+
commentRelay: commentRelayMergedSchema,
|
|
15394
15445
|
workspaceRoot: string2().min(1, `workspace.root is not set.
|
|
15395
15446
|
Fix: Add workspace.root to av.yaml`).refine((v) => v.startsWith("/"), `workspace.root must be an absolute path.
|
|
15396
15447
|
Fix: Set workspace.root: /absolute/path in av.yaml`),
|
|
@@ -15403,6 +15454,7 @@ var init_yaml_loader = __esm(() => {
|
|
|
15403
15454
|
logLevel: _enum(["debug", "info", "warn", "error"]),
|
|
15404
15455
|
logFormat: _enum(["json", "text"]),
|
|
15405
15456
|
deliveryMode: _enum(["merge", "pr"]),
|
|
15457
|
+
pullRequestReviews: pullRequestReviewsMergedSchema,
|
|
15406
15458
|
promptTemplate: string2().min(1, `prompt is not set.
|
|
15407
15459
|
Fix: Add prompt field to av.yaml`),
|
|
15408
15460
|
routingRules: array(object({
|