@ever-works/hermes-agent-plugin 1.0.15 → 1.0.17

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/dist/index.cjs CHANGED
@@ -442,6 +442,34 @@ var APP_PROVISION_LIMITS = {
442
442
  podPendingInfraMs: 10 * 6e4
443
443
  };
444
444
  var MAX_CANDIDATE_OPTIONS = APP_PROVISION_LIMITS.optionsMax - 1;
445
+ var UPSTREAM_LIMIT_WINDOW_MS = 24 * 36e5;
446
+ var UPSTREAM_TIMEOUTS = {
447
+ preparationMs: 90 * 6e4,
448
+ checkCommandMs: 30 * 6e4,
449
+ checksTotalMs: 60 * 6e4,
450
+ maxCheckCommands: 10,
451
+ approvalTtlMs: 72 * 36e5,
452
+ branchCleanupMs: 10 * 6e4,
453
+ deletionCascadeMs: 10 * 6e4
454
+ };
455
+ var UPSTREAM_POLLING = {
456
+ earlyIntervalMs: 30 * 6e4,
457
+ earlyWindowMs: 7 * 864e5,
458
+ lateIntervalMs: 6 * 36e5,
459
+ pauseAfterInactivityMs: 90 * 864e5,
460
+ batch: 100,
461
+ maxRequestsPerRead: 4
462
+ };
463
+ var UPSTREAM_TEXT = {
464
+ titleMax: 72,
465
+ bodyMax: 8e3,
466
+ guideFileMaxBytes: 64 * 1024,
467
+ quoteMax: 300,
468
+ reviewBriefMaxBytes: 64 * 1024,
469
+ maxMissingPieces: 10,
470
+ reportMaxBytes: 32 * 1024,
471
+ maxSeenReviewIds: 200
472
+ };
445
473
  var KB_EXPORT_MAX_BYTES = 200 * 1024 * 1024;
446
474
  var TERMINAL_MAX_FRAME_BYTES = 1024 * 1024;
447
475
  var COMPUTER_MAX_FRAME_BYTES = 512 * 1024;
@@ -503,7 +531,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
503
531
  "release:promotion",
504
532
  "release:revert"
505
533
  ]);
506
- var TASK_RESERVED_LABEL_PREFIXES = Object.freeze(["release:", "provision-attempt-", "fleet:"]);
534
+ var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
535
+ "release:",
536
+ "provision-attempt-",
537
+ "fleet:"
538
+ ]);
507
539
  var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
508
540
  allowAgentMerge: false,
509
541
  requireGreenGate: true,
@@ -1626,7 +1658,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1626
1658
  route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
1627
1659
  cli: "fleet desktop screenshot"
1628
1660
  }),
1629
- read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
1661
+ read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
1630
1662
  route: GET("/api/fleet/nodes/{id}/desktop/displays"),
1631
1663
  cli: "fleet desktop displays"
1632
1664
  }),
@@ -1900,6 +1932,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1900
1932
  route: GET("/api/fleet/checkouts/{id}/changes"),
1901
1933
  cli: "fleet checkouts changes"
1902
1934
  }),
1935
+ read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
1936
+ route: GET("/api/fleet/checkouts/{id}/pull-request")
1937
+ }),
1903
1938
  act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1904
1939
  route: POST("/api/fleet/checkouts"),
1905
1940
  cli: "fleet checkouts create",
@@ -2028,13 +2063,13 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2028
2063
  }),
2029
2064
  // ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
2030
2065
  // stop, a restart and a remove asked by an Agent are held for the owner's approval
2031
- // (`agent-fleet-runners-tools.ts`). The Actions jobs read and Cancel workflow run arrive with P2.
2066
+ // (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
2032
2067
  read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
2033
2068
  phase: "P3",
2034
2069
  route: GET("/api/fleet/nodes/{id}/runners"),
2035
2070
  cli: "fleet runners list"
2036
2071
  }),
2037
- read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
2072
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
2038
2073
  phase: "P3",
2039
2074
  route: GET("/api/fleet/runners/jobs"),
2040
2075
  cli: "fleet runners jobs"
@@ -2089,9 +2124,14 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2089
2124
  "machines",
2090
2125
  "FL-18",
2091
2126
  "FLEET_ACTIONS_RUNNERS_ENABLED",
2092
- "planned",
2127
+ "live",
2093
2128
  confirm("machine.admin"),
2094
- { phase: "P3", route: POST("/api/fleet/runners/jobs/cancel"), cli: "fleet runners cancel-run" }
2129
+ {
2130
+ phase: "P3",
2131
+ route: POST("/api/fleet/runners/jobs/cancel"),
2132
+ cli: "fleet runners cancel-run",
2133
+ alwaysHeld: true
2134
+ }
2095
2135
  ),
2096
2136
  // ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
2097
2137
  // checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
@@ -2267,7 +2307,9 @@ var FLEET_VIRTUAL_SYSTEMS = [
2267
2307
  approxDownloadGiB: 0.7
2268
2308
  }
2269
2309
  ];
2270
- var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
2310
+ var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
2311
+ (system) => system.id
2312
+ );
2271
2313
  var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
2272
2314
  var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
2273
2315
  var HOUR_MS2 = 60 * 60 * 1e3;
@@ -2281,6 +2323,58 @@ var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
2281
2323
  cacheWrite: 0
2282
2324
  });
2283
2325
  var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
2326
+ var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
2327
+ var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
2328
+ "control-not-allowed": { command: "ever-works-node helper control allow" },
2329
+ "permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
2330
+ "input-unavailable": {}
2331
+ });
2332
+ var FLEET_DESKTOP_REASONS = [
2333
+ "kind-unsupported",
2334
+ "wayland-unsupported",
2335
+ "helper-missing",
2336
+ "helper-unadmitted",
2337
+ "helper-untrusted",
2338
+ "no-display-session",
2339
+ "permission-screen-recording",
2340
+ "permission-accessibility"
2341
+ ];
2342
+ var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
2343
+ (reason) => reason !== "permission-accessibility"
2344
+ );
2345
+ var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
2346
+ var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
2347
+ "kind-unsupported": Object.freeze({}),
2348
+ "wayland-unsupported": Object.freeze({}),
2349
+ "helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
2350
+ "helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
2351
+ "helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
2352
+ "no-display-session": Object.freeze({}),
2353
+ "permission-screen-recording": Object.freeze({
2354
+ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
2355
+ }),
2356
+ "permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
2357
+ });
2358
+ var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
2359
+ "kill-switch": "kill_switch",
2360
+ "kind-unsupported": "unsupported_on_node",
2361
+ offline: "unreachable",
2362
+ "consent-missing": "consent_missing",
2363
+ "permission-denied": "permission_denied",
2364
+ "wayland-unsupported": "unsupported_on_node",
2365
+ "helper-missing": "unsupported_on_node",
2366
+ "helper-unadmitted": "unsupported_on_node",
2367
+ "helper-untrusted": "unsupported_on_node",
2368
+ "no-display-session": "unsupported_on_node",
2369
+ "permission-screen-recording": "unsupported_on_node",
2370
+ "link-unavailable": "unreachable"
2371
+ });
2372
+ var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
2373
+ var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
2374
+ var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
2375
+ var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
2376
+ var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
2377
+ var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
2284
2378
  var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
2285
2379
  var EMAIL_INBOX_BURST_SENDS = 10;
2286
2380
  var EMAIL_INBOX_BURST_RECIPIENTS = 20;
@@ -3759,6 +3853,161 @@ function substituteVariables(template, variables) {
3759
3853
  return value !== void 0 ? value : match;
3760
3854
  });
3761
3855
  }
3856
+ function zod3ParsedType(data) {
3857
+ switch (typeof data) {
3858
+ case "undefined":
3859
+ return "undefined";
3860
+ case "string":
3861
+ return "string";
3862
+ case "number":
3863
+ return Number.isNaN(data) ? "nan" : "number";
3864
+ case "boolean":
3865
+ return "boolean";
3866
+ case "function":
3867
+ return "function";
3868
+ case "bigint":
3869
+ return "bigint";
3870
+ case "symbol":
3871
+ return "symbol";
3872
+ case "object": {
3873
+ if (Array.isArray(data)) return "array";
3874
+ if (data === null) return "null";
3875
+ const thenable = data;
3876
+ if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
3877
+ if (data instanceof Map) return "map";
3878
+ if (data instanceof Set) return "set";
3879
+ if (data instanceof Date) return "date";
3880
+ return "object";
3881
+ }
3882
+ default:
3883
+ return "unknown";
3884
+ }
3885
+ }
3886
+ function joinValues(values, separator = " | ") {
3887
+ return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
3888
+ }
3889
+ function bigIntSafe(_key, value) {
3890
+ return typeof value === "bigint" ? value.toString() : value;
3891
+ }
3892
+ function schemaType(issue) {
3893
+ return issue.inst?._zod?.def?.type;
3894
+ }
3895
+ var ZOD3_EXPECTED = {
3896
+ record: "object",
3897
+ tuple: "array"
3898
+ };
3899
+ var ZOD3_FORMAT = {
3900
+ guid: "uuid",
3901
+ ipv4: "ip",
3902
+ ipv6: "ip",
3903
+ cidrv4: "cidr",
3904
+ cidrv6: "cidr"
3905
+ };
3906
+ var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
3907
+ function invalidType(issue) {
3908
+ if (issue.input === void 0) return "Required";
3909
+ if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
3910
+ const received = zod3ParsedType(issue.input);
3911
+ if (issue.expected === "int") {
3912
+ return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
3913
+ }
3914
+ const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
3915
+ return `Expected ${expected}, received ${received}`;
3916
+ }
3917
+ function invalidValue(issue) {
3918
+ const values = issue.values ?? [];
3919
+ if (schemaType(issue) === "literal") {
3920
+ return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
3921
+ }
3922
+ if (issue.input === void 0) return "Required";
3923
+ const stringEnum = values.every((value) => typeof value === "string");
3924
+ const input = issue.input;
3925
+ if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
3926
+ return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
3927
+ }
3928
+ return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
3929
+ }
3930
+ function invalidFormat(issue) {
3931
+ const format = issue.format ?? "";
3932
+ switch (format) {
3933
+ case "regex":
3934
+ return "Invalid";
3935
+ case "starts_with":
3936
+ return `Invalid input: must start with "${issue.prefix}"`;
3937
+ case "ends_with":
3938
+ return `Invalid input: must end with "${issue.suffix}"`;
3939
+ case "includes":
3940
+ return `Invalid input: must include "${issue.includes}"`;
3941
+ default:
3942
+ if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
3943
+ return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
3944
+ }
3945
+ }
3946
+ function tooSmall(issue) {
3947
+ const { exact, inclusive, minimum } = issue;
3948
+ switch (issue.origin) {
3949
+ case "array":
3950
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
3951
+ case "string":
3952
+ return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
3953
+ case "number":
3954
+ case "int":
3955
+ case "bigint":
3956
+ return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
3957
+ case "date":
3958
+ return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
3959
+ default:
3960
+ return "Invalid input";
3961
+ }
3962
+ }
3963
+ function tooBig(issue) {
3964
+ const { exact, inclusive, maximum } = issue;
3965
+ switch (issue.origin) {
3966
+ case "array":
3967
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
3968
+ case "string":
3969
+ return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
3970
+ case "number":
3971
+ case "int":
3972
+ return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3973
+ case "bigint":
3974
+ return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3975
+ case "date":
3976
+ return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
3977
+ default:
3978
+ return "Invalid input";
3979
+ }
3980
+ }
3981
+ function zod3ErrorMessage(issue) {
3982
+ switch (issue.code) {
3983
+ case "invalid_type":
3984
+ return invalidType(issue);
3985
+ case "invalid_value":
3986
+ return invalidValue(issue);
3987
+ case "unrecognized_keys":
3988
+ return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
3989
+ case "invalid_union":
3990
+ if (issue.discriminator !== void 0 && issue.options) {
3991
+ return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
3992
+ }
3993
+ return "Invalid input";
3994
+ case "invalid_format":
3995
+ return invalidFormat(issue);
3996
+ case "too_small":
3997
+ return tooSmall(issue);
3998
+ case "too_big":
3999
+ return tooBig(issue);
4000
+ case "not_multiple_of":
4001
+ return `Number must be a multiple of ${issue.divisor}`;
4002
+ case "custom":
4003
+ return "Invalid input";
4004
+ case "invalid_key":
4005
+ return issue.issues?.[0]?.message;
4006
+ default:
4007
+ return void 0;
4008
+ }
4009
+ }
4010
+ var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
3762
4011
 
3763
4012
  // src/types.ts
3764
4013
  var os = __toESM(require("os"), 1);
package/dist/index.js CHANGED
@@ -403,6 +403,34 @@ var APP_PROVISION_LIMITS = {
403
403
  podPendingInfraMs: 10 * 6e4
404
404
  };
405
405
  var MAX_CANDIDATE_OPTIONS = APP_PROVISION_LIMITS.optionsMax - 1;
406
+ var UPSTREAM_LIMIT_WINDOW_MS = 24 * 36e5;
407
+ var UPSTREAM_TIMEOUTS = {
408
+ preparationMs: 90 * 6e4,
409
+ checkCommandMs: 30 * 6e4,
410
+ checksTotalMs: 60 * 6e4,
411
+ maxCheckCommands: 10,
412
+ approvalTtlMs: 72 * 36e5,
413
+ branchCleanupMs: 10 * 6e4,
414
+ deletionCascadeMs: 10 * 6e4
415
+ };
416
+ var UPSTREAM_POLLING = {
417
+ earlyIntervalMs: 30 * 6e4,
418
+ earlyWindowMs: 7 * 864e5,
419
+ lateIntervalMs: 6 * 36e5,
420
+ pauseAfterInactivityMs: 90 * 864e5,
421
+ batch: 100,
422
+ maxRequestsPerRead: 4
423
+ };
424
+ var UPSTREAM_TEXT = {
425
+ titleMax: 72,
426
+ bodyMax: 8e3,
427
+ guideFileMaxBytes: 64 * 1024,
428
+ quoteMax: 300,
429
+ reviewBriefMaxBytes: 64 * 1024,
430
+ maxMissingPieces: 10,
431
+ reportMaxBytes: 32 * 1024,
432
+ maxSeenReviewIds: 200
433
+ };
406
434
  var KB_EXPORT_MAX_BYTES = 200 * 1024 * 1024;
407
435
  var TERMINAL_MAX_FRAME_BYTES = 1024 * 1024;
408
436
  var COMPUTER_MAX_FRAME_BYTES = 512 * 1024;
@@ -464,7 +492,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
464
492
  "release:promotion",
465
493
  "release:revert"
466
494
  ]);
467
- var TASK_RESERVED_LABEL_PREFIXES = Object.freeze(["release:", "provision-attempt-", "fleet:"]);
495
+ var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
496
+ "release:",
497
+ "provision-attempt-",
498
+ "fleet:"
499
+ ]);
468
500
  var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
469
501
  allowAgentMerge: false,
470
502
  requireGreenGate: true,
@@ -1587,7 +1619,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1587
1619
  route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
1588
1620
  cli: "fleet desktop screenshot"
1589
1621
  }),
1590
- read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
1622
+ read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
1591
1623
  route: GET("/api/fleet/nodes/{id}/desktop/displays"),
1592
1624
  cli: "fleet desktop displays"
1593
1625
  }),
@@ -1861,6 +1893,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1861
1893
  route: GET("/api/fleet/checkouts/{id}/changes"),
1862
1894
  cli: "fleet checkouts changes"
1863
1895
  }),
1896
+ read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
1897
+ route: GET("/api/fleet/checkouts/{id}/pull-request")
1898
+ }),
1864
1899
  act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1865
1900
  route: POST("/api/fleet/checkouts"),
1866
1901
  cli: "fleet checkouts create",
@@ -1989,13 +2024,13 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1989
2024
  }),
1990
2025
  // ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
1991
2026
  // stop, a restart and a remove asked by an Agent are held for the owner's approval
1992
- // (`agent-fleet-runners-tools.ts`). The Actions jobs read and Cancel workflow run arrive with P2.
2027
+ // (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
1993
2028
  read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
1994
2029
  phase: "P3",
1995
2030
  route: GET("/api/fleet/nodes/{id}/runners"),
1996
2031
  cli: "fleet runners list"
1997
2032
  }),
1998
- read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
2033
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
1999
2034
  phase: "P3",
2000
2035
  route: GET("/api/fleet/runners/jobs"),
2001
2036
  cli: "fleet runners jobs"
@@ -2050,9 +2085,14 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2050
2085
  "machines",
2051
2086
  "FL-18",
2052
2087
  "FLEET_ACTIONS_RUNNERS_ENABLED",
2053
- "planned",
2088
+ "live",
2054
2089
  confirm("machine.admin"),
2055
- { phase: "P3", route: POST("/api/fleet/runners/jobs/cancel"), cli: "fleet runners cancel-run" }
2090
+ {
2091
+ phase: "P3",
2092
+ route: POST("/api/fleet/runners/jobs/cancel"),
2093
+ cli: "fleet runners cancel-run",
2094
+ alwaysHeld: true
2095
+ }
2056
2096
  ),
2057
2097
  // ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
2058
2098
  // checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
@@ -2228,7 +2268,9 @@ var FLEET_VIRTUAL_SYSTEMS = [
2228
2268
  approxDownloadGiB: 0.7
2229
2269
  }
2230
2270
  ];
2231
- var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
2271
+ var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
2272
+ (system) => system.id
2273
+ );
2232
2274
  var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
2233
2275
  var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
2234
2276
  var HOUR_MS2 = 60 * 60 * 1e3;
@@ -2242,6 +2284,58 @@ var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
2242
2284
  cacheWrite: 0
2243
2285
  });
2244
2286
  var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
2287
+ var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
2288
+ var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
2289
+ "control-not-allowed": { command: "ever-works-node helper control allow" },
2290
+ "permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
2291
+ "input-unavailable": {}
2292
+ });
2293
+ var FLEET_DESKTOP_REASONS = [
2294
+ "kind-unsupported",
2295
+ "wayland-unsupported",
2296
+ "helper-missing",
2297
+ "helper-unadmitted",
2298
+ "helper-untrusted",
2299
+ "no-display-session",
2300
+ "permission-screen-recording",
2301
+ "permission-accessibility"
2302
+ ];
2303
+ var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
2304
+ (reason) => reason !== "permission-accessibility"
2305
+ );
2306
+ var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
2307
+ var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
2308
+ "kind-unsupported": Object.freeze({}),
2309
+ "wayland-unsupported": Object.freeze({}),
2310
+ "helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
2311
+ "helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
2312
+ "helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
2313
+ "no-display-session": Object.freeze({}),
2314
+ "permission-screen-recording": Object.freeze({
2315
+ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
2316
+ }),
2317
+ "permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
2318
+ });
2319
+ var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
2320
+ "kill-switch": "kill_switch",
2321
+ "kind-unsupported": "unsupported_on_node",
2322
+ offline: "unreachable",
2323
+ "consent-missing": "consent_missing",
2324
+ "permission-denied": "permission_denied",
2325
+ "wayland-unsupported": "unsupported_on_node",
2326
+ "helper-missing": "unsupported_on_node",
2327
+ "helper-unadmitted": "unsupported_on_node",
2328
+ "helper-untrusted": "unsupported_on_node",
2329
+ "no-display-session": "unsupported_on_node",
2330
+ "permission-screen-recording": "unsupported_on_node",
2331
+ "link-unavailable": "unreachable"
2332
+ });
2333
+ var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
2334
+ var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
2335
+ var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
2336
+ var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
2337
+ var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
2338
+ var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
2245
2339
  var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
2246
2340
  var EMAIL_INBOX_BURST_SENDS = 10;
2247
2341
  var EMAIL_INBOX_BURST_RECIPIENTS = 20;
@@ -3720,6 +3814,161 @@ function substituteVariables(template, variables) {
3720
3814
  return value !== void 0 ? value : match;
3721
3815
  });
3722
3816
  }
3817
+ function zod3ParsedType(data) {
3818
+ switch (typeof data) {
3819
+ case "undefined":
3820
+ return "undefined";
3821
+ case "string":
3822
+ return "string";
3823
+ case "number":
3824
+ return Number.isNaN(data) ? "nan" : "number";
3825
+ case "boolean":
3826
+ return "boolean";
3827
+ case "function":
3828
+ return "function";
3829
+ case "bigint":
3830
+ return "bigint";
3831
+ case "symbol":
3832
+ return "symbol";
3833
+ case "object": {
3834
+ if (Array.isArray(data)) return "array";
3835
+ if (data === null) return "null";
3836
+ const thenable = data;
3837
+ if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
3838
+ if (data instanceof Map) return "map";
3839
+ if (data instanceof Set) return "set";
3840
+ if (data instanceof Date) return "date";
3841
+ return "object";
3842
+ }
3843
+ default:
3844
+ return "unknown";
3845
+ }
3846
+ }
3847
+ function joinValues(values, separator = " | ") {
3848
+ return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
3849
+ }
3850
+ function bigIntSafe(_key, value) {
3851
+ return typeof value === "bigint" ? value.toString() : value;
3852
+ }
3853
+ function schemaType(issue) {
3854
+ return issue.inst?._zod?.def?.type;
3855
+ }
3856
+ var ZOD3_EXPECTED = {
3857
+ record: "object",
3858
+ tuple: "array"
3859
+ };
3860
+ var ZOD3_FORMAT = {
3861
+ guid: "uuid",
3862
+ ipv4: "ip",
3863
+ ipv6: "ip",
3864
+ cidrv4: "cidr",
3865
+ cidrv6: "cidr"
3866
+ };
3867
+ var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
3868
+ function invalidType(issue) {
3869
+ if (issue.input === void 0) return "Required";
3870
+ if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
3871
+ const received = zod3ParsedType(issue.input);
3872
+ if (issue.expected === "int") {
3873
+ return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
3874
+ }
3875
+ const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
3876
+ return `Expected ${expected}, received ${received}`;
3877
+ }
3878
+ function invalidValue(issue) {
3879
+ const values = issue.values ?? [];
3880
+ if (schemaType(issue) === "literal") {
3881
+ return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
3882
+ }
3883
+ if (issue.input === void 0) return "Required";
3884
+ const stringEnum = values.every((value) => typeof value === "string");
3885
+ const input = issue.input;
3886
+ if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
3887
+ return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
3888
+ }
3889
+ return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
3890
+ }
3891
+ function invalidFormat(issue) {
3892
+ const format = issue.format ?? "";
3893
+ switch (format) {
3894
+ case "regex":
3895
+ return "Invalid";
3896
+ case "starts_with":
3897
+ return `Invalid input: must start with "${issue.prefix}"`;
3898
+ case "ends_with":
3899
+ return `Invalid input: must end with "${issue.suffix}"`;
3900
+ case "includes":
3901
+ return `Invalid input: must include "${issue.includes}"`;
3902
+ default:
3903
+ if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
3904
+ return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
3905
+ }
3906
+ }
3907
+ function tooSmall(issue) {
3908
+ const { exact, inclusive, minimum } = issue;
3909
+ switch (issue.origin) {
3910
+ case "array":
3911
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
3912
+ case "string":
3913
+ return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
3914
+ case "number":
3915
+ case "int":
3916
+ case "bigint":
3917
+ return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
3918
+ case "date":
3919
+ return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
3920
+ default:
3921
+ return "Invalid input";
3922
+ }
3923
+ }
3924
+ function tooBig(issue) {
3925
+ const { exact, inclusive, maximum } = issue;
3926
+ switch (issue.origin) {
3927
+ case "array":
3928
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
3929
+ case "string":
3930
+ return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
3931
+ case "number":
3932
+ case "int":
3933
+ return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3934
+ case "bigint":
3935
+ return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3936
+ case "date":
3937
+ return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
3938
+ default:
3939
+ return "Invalid input";
3940
+ }
3941
+ }
3942
+ function zod3ErrorMessage(issue) {
3943
+ switch (issue.code) {
3944
+ case "invalid_type":
3945
+ return invalidType(issue);
3946
+ case "invalid_value":
3947
+ return invalidValue(issue);
3948
+ case "unrecognized_keys":
3949
+ return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
3950
+ case "invalid_union":
3951
+ if (issue.discriminator !== void 0 && issue.options) {
3952
+ return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
3953
+ }
3954
+ return "Invalid input";
3955
+ case "invalid_format":
3956
+ return invalidFormat(issue);
3957
+ case "too_small":
3958
+ return tooSmall(issue);
3959
+ case "too_big":
3960
+ return tooBig(issue);
3961
+ case "not_multiple_of":
3962
+ return `Number must be a multiple of ${issue.divisor}`;
3963
+ case "custom":
3964
+ return "Invalid input";
3965
+ case "invalid_key":
3966
+ return issue.issues?.[0]?.message;
3967
+ default:
3968
+ return void 0;
3969
+ }
3970
+ }
3971
+ var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
3723
3972
 
3724
3973
  // src/types.ts
3725
3974
  import * as os from "os";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ever-works/hermes-agent-plugin",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "description": "Hermes Agent pipeline plugin for Ever Works",
5
5
  "author": {
6
6
  "name": "Ever Co. LTD",
@@ -33,10 +33,10 @@
33
33
  "test:coverage": "vitest run --coverage"
34
34
  },
35
35
  "peerDependencies": {
36
- "@ever-works/plugin": "^1.2.11"
36
+ "@ever-works/plugin": "^1.2.12"
37
37
  },
38
38
  "devDependencies": {
39
- "@ever-works/plugin": "^1.2.11",
39
+ "@ever-works/plugin": "^1.2.12",
40
40
  "@types/node": "^26.6.4",
41
41
  "tsup": "^8.0.0",
42
42
  "typescript": "^5.9.3",
@@ -73,8 +73,8 @@
73
73
  "url": "https://github.com/ever-works/ever-works/issues"
74
74
  },
75
75
  "everworksRelease": {
76
- "contentHash": "sha256:8590291ac293ca9d1ddec3b91a540df4f268e3277daf506a0a6d57756e5c6a68",
77
- "commit": "67e286ed0d4c3dcc0d66d2f628215ab966cc26e1",
78
- "source": "https://github.com/ever-works/ever-works/tree/67e286ed0d4c3dcc0d66d2f628215ab966cc26e1/packages/plugins/hermes-agent"
76
+ "contentHash": "sha256:93f96d93bac541668b85a162b55db66b9e687dae7a2e39e2db34fbb67cdc7bb3",
77
+ "commit": "d3cf14ee74b443cd882e625d1c99ff75af99732b",
78
+ "source": "https://github.com/ever-works/ever-works/tree/d3cf14ee74b443cd882e625d1c99ff75af99732b/packages/plugins/hermes-agent"
79
79
  }
80
80
  }