agent-valley 2.0.0 → 2.1.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 +2 -0
- package/dist/assets/plugin.json +1 -1
- package/dist/assets/skills/av/SKILL.md +2 -0
- package/dist/index.js +1077 -81
- package/dist/supervisor.js +78 -1
- package/package.json +1 -1
package/dist/supervisor.js
CHANGED
|
@@ -6618,6 +6618,80 @@ var init_capture_schema = __esm(() => {
|
|
|
6618
6618
|
});
|
|
6619
6619
|
});
|
|
6620
6620
|
|
|
6621
|
+
// ../../packages/core/src/chief/container-observation-policy.ts
|
|
6622
|
+
function containerTargetHealthy(result) {
|
|
6623
|
+
return result.status === "collected" && result.state === "running" && result.ready === true && result.logsAvailable !== false && result.statsAvailable !== false && result.issues.length === 0;
|
|
6624
|
+
}
|
|
6625
|
+
var targetName, contextName, dnsName, timestamp, digest, containerObservationTargetSchema, containerObservationPolicySchema, containerObservationResultSchema, containerObservationSnapshotSchema;
|
|
6626
|
+
var init_container_observation_policy = __esm(() => {
|
|
6627
|
+
init_zod();
|
|
6628
|
+
targetName = string2().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/, "Use a container name or ID, without CLI flags.");
|
|
6629
|
+
contextName = string2().regex(/^[A-Za-z0-9][A-Za-z0-9_.:@/-]{0,199}$/, "Use an existing CLI context name.").refine((value) => !value.includes("://"), "Use a context name, not a URL or credentials.");
|
|
6630
|
+
dnsName = string2().regex(/^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?$/, "Use an explicit Kubernetes name.");
|
|
6631
|
+
timestamp = string2().datetime({ offset: true });
|
|
6632
|
+
digest = string2().regex(/^[a-f0-9]{64}$/);
|
|
6633
|
+
containerObservationTargetSchema = discriminatedUnion("kind", [
|
|
6634
|
+
strictObject({ id: targetName, kind: literal("docker"), container: targetName, context: contextName.optional() }),
|
|
6635
|
+
strictObject({
|
|
6636
|
+
id: targetName,
|
|
6637
|
+
kind: literal("kubernetes"),
|
|
6638
|
+
namespace: dnsName,
|
|
6639
|
+
pod: dnsName,
|
|
6640
|
+
container: targetName,
|
|
6641
|
+
context: contextName.optional()
|
|
6642
|
+
})
|
|
6643
|
+
]);
|
|
6644
|
+
containerObservationPolicySchema = strictObject({
|
|
6645
|
+
enabled: boolean2().default(true),
|
|
6646
|
+
targets: array(containerObservationTargetSchema).min(1).max(20),
|
|
6647
|
+
poll_interval_sec: number2().int().min(1).max(3600).default(30),
|
|
6648
|
+
timeout_ms: number2().int().min(100).max(60000).default(1e4),
|
|
6649
|
+
max_output_bytes: number2().int().min(1024).max(1048576).default(65536),
|
|
6650
|
+
log_tail: number2().int().min(1).max(200).default(50),
|
|
6651
|
+
log_since_sec: number2().int().min(1).max(86400).default(300),
|
|
6652
|
+
cpu_percent_threshold: number2().finite().positive().max(1e4).optional(),
|
|
6653
|
+
memory_percent_threshold: number2().finite().positive().max(100).optional()
|
|
6654
|
+
}).superRefine((policy, ctx) => {
|
|
6655
|
+
if (new Set(policy.targets.map((target) => target.id)).size !== policy.targets.length)
|
|
6656
|
+
ctx.addIssue({ code: "custom", path: ["targets"], message: "Container observation target IDs must be unique." });
|
|
6657
|
+
});
|
|
6658
|
+
containerObservationResultSchema = strictObject({
|
|
6659
|
+
targetId: targetName,
|
|
6660
|
+
kind: _enum(["docker", "kubernetes"]),
|
|
6661
|
+
status: _enum(["collected", "unavailable"]),
|
|
6662
|
+
identity: string2().min(1).max(500).optional(),
|
|
6663
|
+
state: _enum(["running", "waiting", "terminated", "unknown"]).optional(),
|
|
6664
|
+
ready: boolean2().optional(),
|
|
6665
|
+
health: string2().max(100).optional(),
|
|
6666
|
+
exitCode: number2().int().optional(),
|
|
6667
|
+
restartCount: number2().int().nonnegative().optional(),
|
|
6668
|
+
oomKilled: boolean2().optional(),
|
|
6669
|
+
cpuPercent: number2().finite().nonnegative().optional(),
|
|
6670
|
+
memoryPercent: number2().finite().nonnegative().optional(),
|
|
6671
|
+
logExcerpt: string2().max(8192).optional(),
|
|
6672
|
+
logsAvailable: boolean2().optional(),
|
|
6673
|
+
statsAvailable: boolean2().optional(),
|
|
6674
|
+
reason: string2().max(1000).optional(),
|
|
6675
|
+
issues: array(_enum([
|
|
6676
|
+
"not-running",
|
|
6677
|
+
"unhealthy",
|
|
6678
|
+
"oom-killed",
|
|
6679
|
+
"restarting",
|
|
6680
|
+
"restart-increase",
|
|
6681
|
+
"log-error",
|
|
6682
|
+
"cpu-high",
|
|
6683
|
+
"memory-high"
|
|
6684
|
+
])).max(8),
|
|
6685
|
+
fingerprint: digest
|
|
6686
|
+
});
|
|
6687
|
+
containerObservationSnapshotSchema = strictObject({
|
|
6688
|
+
collectedAt: timestamp,
|
|
6689
|
+
nextPollAt: timestamp,
|
|
6690
|
+
fingerprint: digest,
|
|
6691
|
+
results: array(containerObservationResultSchema).max(20)
|
|
6692
|
+
});
|
|
6693
|
+
});
|
|
6694
|
+
|
|
6621
6695
|
// ../../packages/core/src/chief/execution.ts
|
|
6622
6696
|
import { createHash } from "node:crypto";
|
|
6623
6697
|
function classifyFailure(reason) {
|
|
@@ -6693,7 +6767,8 @@ function progressKey(mission, fingerprint) {
|
|
|
6693
6767
|
value: metric.value,
|
|
6694
6768
|
timestamp: metric.timestamp
|
|
6695
6769
|
})),
|
|
6696
|
-
effects: mission.tasks.map((task) => ({ id: task.id, effectState: task.effectState }))
|
|
6770
|
+
effects: mission.tasks.map((task) => ({ id: task.id, effectState: task.effectState })),
|
|
6771
|
+
containers: mission.containerObservation?.fingerprint
|
|
6697
6772
|
})).digest("hex");
|
|
6698
6773
|
}
|
|
6699
6774
|
function pauseForFailure(mission, reason, taskId) {
|
|
@@ -7168,6 +7243,7 @@ var price, chiefConfigSchema;
|
|
|
7168
7243
|
var init_chief_schema = __esm(() => {
|
|
7169
7244
|
init_zod();
|
|
7170
7245
|
init_capture_schema();
|
|
7246
|
+
init_container_observation_policy();
|
|
7171
7247
|
init_execution();
|
|
7172
7248
|
init_metric_source_policy();
|
|
7173
7249
|
init_operations();
|
|
@@ -7176,6 +7252,7 @@ var init_chief_schema = __esm(() => {
|
|
|
7176
7252
|
init_tool_environment();
|
|
7177
7253
|
price = number2().finite().nonnegative().optional();
|
|
7178
7254
|
chiefConfigSchema = strictObject({
|
|
7255
|
+
container_observation: containerObservationPolicySchema.optional(),
|
|
7179
7256
|
tool_env_keys: toolEnvKeysSchema.optional(),
|
|
7180
7257
|
execution: strictObject({
|
|
7181
7258
|
max_parallel: number2().int().min(1).max(8).default(3),
|