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

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
@@ -503,7 +503,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
503
503
  "release:promotion",
504
504
  "release:revert"
505
505
  ]);
506
- var TASK_RESERVED_LABEL_PREFIXES = Object.freeze(["release:", "provision-attempt-", "fleet:"]);
506
+ var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
507
+ "release:",
508
+ "provision-attempt-",
509
+ "fleet:"
510
+ ]);
507
511
  var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
508
512
  allowAgentMerge: false,
509
513
  requireGreenGate: true,
@@ -1626,7 +1630,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1626
1630
  route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
1627
1631
  cli: "fleet desktop screenshot"
1628
1632
  }),
1629
- read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
1633
+ read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
1630
1634
  route: GET("/api/fleet/nodes/{id}/desktop/displays"),
1631
1635
  cli: "fleet desktop displays"
1632
1636
  }),
@@ -1900,6 +1904,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1900
1904
  route: GET("/api/fleet/checkouts/{id}/changes"),
1901
1905
  cli: "fleet checkouts changes"
1902
1906
  }),
1907
+ read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
1908
+ route: GET("/api/fleet/checkouts/{id}/pull-request")
1909
+ }),
1903
1910
  act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1904
1911
  route: POST("/api/fleet/checkouts"),
1905
1912
  cli: "fleet checkouts create",
@@ -2028,13 +2035,13 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2028
2035
  }),
2029
2036
  // ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
2030
2037
  // 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.
2038
+ // (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
2032
2039
  read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
2033
2040
  phase: "P3",
2034
2041
  route: GET("/api/fleet/nodes/{id}/runners"),
2035
2042
  cli: "fleet runners list"
2036
2043
  }),
2037
- read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
2044
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
2038
2045
  phase: "P3",
2039
2046
  route: GET("/api/fleet/runners/jobs"),
2040
2047
  cli: "fleet runners jobs"
@@ -2089,9 +2096,14 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2089
2096
  "machines",
2090
2097
  "FL-18",
2091
2098
  "FLEET_ACTIONS_RUNNERS_ENABLED",
2092
- "planned",
2099
+ "live",
2093
2100
  confirm("machine.admin"),
2094
- { phase: "P3", route: POST("/api/fleet/runners/jobs/cancel"), cli: "fleet runners cancel-run" }
2101
+ {
2102
+ phase: "P3",
2103
+ route: POST("/api/fleet/runners/jobs/cancel"),
2104
+ cli: "fleet runners cancel-run",
2105
+ alwaysHeld: true
2106
+ }
2095
2107
  ),
2096
2108
  // ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
2097
2109
  // checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
@@ -2267,7 +2279,9 @@ var FLEET_VIRTUAL_SYSTEMS = [
2267
2279
  approxDownloadGiB: 0.7
2268
2280
  }
2269
2281
  ];
2270
- var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
2282
+ var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
2283
+ (system) => system.id
2284
+ );
2271
2285
  var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
2272
2286
  var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
2273
2287
  var HOUR_MS2 = 60 * 60 * 1e3;
@@ -2281,6 +2295,58 @@ var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
2281
2295
  cacheWrite: 0
2282
2296
  });
2283
2297
  var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
2298
+ var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
2299
+ var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
2300
+ "control-not-allowed": { command: "ever-works-node helper control allow" },
2301
+ "permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
2302
+ "input-unavailable": {}
2303
+ });
2304
+ var FLEET_DESKTOP_REASONS = [
2305
+ "kind-unsupported",
2306
+ "wayland-unsupported",
2307
+ "helper-missing",
2308
+ "helper-unadmitted",
2309
+ "helper-untrusted",
2310
+ "no-display-session",
2311
+ "permission-screen-recording",
2312
+ "permission-accessibility"
2313
+ ];
2314
+ var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
2315
+ (reason) => reason !== "permission-accessibility"
2316
+ );
2317
+ var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
2318
+ var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
2319
+ "kind-unsupported": Object.freeze({}),
2320
+ "wayland-unsupported": Object.freeze({}),
2321
+ "helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
2322
+ "helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
2323
+ "helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
2324
+ "no-display-session": Object.freeze({}),
2325
+ "permission-screen-recording": Object.freeze({
2326
+ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
2327
+ }),
2328
+ "permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
2329
+ });
2330
+ var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
2331
+ "kill-switch": "kill_switch",
2332
+ "kind-unsupported": "unsupported_on_node",
2333
+ offline: "unreachable",
2334
+ "consent-missing": "consent_missing",
2335
+ "permission-denied": "permission_denied",
2336
+ "wayland-unsupported": "unsupported_on_node",
2337
+ "helper-missing": "unsupported_on_node",
2338
+ "helper-unadmitted": "unsupported_on_node",
2339
+ "helper-untrusted": "unsupported_on_node",
2340
+ "no-display-session": "unsupported_on_node",
2341
+ "permission-screen-recording": "unsupported_on_node",
2342
+ "link-unavailable": "unreachable"
2343
+ });
2344
+ var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
2345
+ var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
2346
+ var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
2347
+ var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
2348
+ var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
2349
+ var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
2284
2350
  var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
2285
2351
  var EMAIL_INBOX_BURST_SENDS = 10;
2286
2352
  var EMAIL_INBOX_BURST_RECIPIENTS = 20;
@@ -3759,6 +3825,161 @@ function substituteVariables(template, variables) {
3759
3825
  return value !== void 0 ? value : match;
3760
3826
  });
3761
3827
  }
3828
+ function zod3ParsedType(data) {
3829
+ switch (typeof data) {
3830
+ case "undefined":
3831
+ return "undefined";
3832
+ case "string":
3833
+ return "string";
3834
+ case "number":
3835
+ return Number.isNaN(data) ? "nan" : "number";
3836
+ case "boolean":
3837
+ return "boolean";
3838
+ case "function":
3839
+ return "function";
3840
+ case "bigint":
3841
+ return "bigint";
3842
+ case "symbol":
3843
+ return "symbol";
3844
+ case "object": {
3845
+ if (Array.isArray(data)) return "array";
3846
+ if (data === null) return "null";
3847
+ const thenable = data;
3848
+ if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
3849
+ if (data instanceof Map) return "map";
3850
+ if (data instanceof Set) return "set";
3851
+ if (data instanceof Date) return "date";
3852
+ return "object";
3853
+ }
3854
+ default:
3855
+ return "unknown";
3856
+ }
3857
+ }
3858
+ function joinValues(values, separator = " | ") {
3859
+ return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
3860
+ }
3861
+ function bigIntSafe(_key, value) {
3862
+ return typeof value === "bigint" ? value.toString() : value;
3863
+ }
3864
+ function schemaType(issue) {
3865
+ return issue.inst?._zod?.def?.type;
3866
+ }
3867
+ var ZOD3_EXPECTED = {
3868
+ record: "object",
3869
+ tuple: "array"
3870
+ };
3871
+ var ZOD3_FORMAT = {
3872
+ guid: "uuid",
3873
+ ipv4: "ip",
3874
+ ipv6: "ip",
3875
+ cidrv4: "cidr",
3876
+ cidrv6: "cidr"
3877
+ };
3878
+ var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
3879
+ function invalidType(issue) {
3880
+ if (issue.input === void 0) return "Required";
3881
+ if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
3882
+ const received = zod3ParsedType(issue.input);
3883
+ if (issue.expected === "int") {
3884
+ return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
3885
+ }
3886
+ const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
3887
+ return `Expected ${expected}, received ${received}`;
3888
+ }
3889
+ function invalidValue(issue) {
3890
+ const values = issue.values ?? [];
3891
+ if (schemaType(issue) === "literal") {
3892
+ return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
3893
+ }
3894
+ if (issue.input === void 0) return "Required";
3895
+ const stringEnum = values.every((value) => typeof value === "string");
3896
+ const input = issue.input;
3897
+ if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
3898
+ return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
3899
+ }
3900
+ return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
3901
+ }
3902
+ function invalidFormat(issue) {
3903
+ const format = issue.format ?? "";
3904
+ switch (format) {
3905
+ case "regex":
3906
+ return "Invalid";
3907
+ case "starts_with":
3908
+ return `Invalid input: must start with "${issue.prefix}"`;
3909
+ case "ends_with":
3910
+ return `Invalid input: must end with "${issue.suffix}"`;
3911
+ case "includes":
3912
+ return `Invalid input: must include "${issue.includes}"`;
3913
+ default:
3914
+ if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
3915
+ return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
3916
+ }
3917
+ }
3918
+ function tooSmall(issue) {
3919
+ const { exact, inclusive, minimum } = issue;
3920
+ switch (issue.origin) {
3921
+ case "array":
3922
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
3923
+ case "string":
3924
+ return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
3925
+ case "number":
3926
+ case "int":
3927
+ case "bigint":
3928
+ return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
3929
+ case "date":
3930
+ return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
3931
+ default:
3932
+ return "Invalid input";
3933
+ }
3934
+ }
3935
+ function tooBig(issue) {
3936
+ const { exact, inclusive, maximum } = issue;
3937
+ switch (issue.origin) {
3938
+ case "array":
3939
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
3940
+ case "string":
3941
+ return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
3942
+ case "number":
3943
+ case "int":
3944
+ return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3945
+ case "bigint":
3946
+ return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3947
+ case "date":
3948
+ return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
3949
+ default:
3950
+ return "Invalid input";
3951
+ }
3952
+ }
3953
+ function zod3ErrorMessage(issue) {
3954
+ switch (issue.code) {
3955
+ case "invalid_type":
3956
+ return invalidType(issue);
3957
+ case "invalid_value":
3958
+ return invalidValue(issue);
3959
+ case "unrecognized_keys":
3960
+ return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
3961
+ case "invalid_union":
3962
+ if (issue.discriminator !== void 0 && issue.options) {
3963
+ return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
3964
+ }
3965
+ return "Invalid input";
3966
+ case "invalid_format":
3967
+ return invalidFormat(issue);
3968
+ case "too_small":
3969
+ return tooSmall(issue);
3970
+ case "too_big":
3971
+ return tooBig(issue);
3972
+ case "not_multiple_of":
3973
+ return `Number must be a multiple of ${issue.divisor}`;
3974
+ case "custom":
3975
+ return "Invalid input";
3976
+ case "invalid_key":
3977
+ return issue.issues?.[0]?.message;
3978
+ default:
3979
+ return void 0;
3980
+ }
3981
+ }
3982
+ var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
3762
3983
 
3763
3984
  // src/types.ts
3764
3985
  var os = __toESM(require("os"), 1);
package/dist/index.js CHANGED
@@ -464,7 +464,11 @@ var TASK_RESERVED_LABELS = Object.freeze([
464
464
  "release:promotion",
465
465
  "release:revert"
466
466
  ]);
467
- var TASK_RESERVED_LABEL_PREFIXES = Object.freeze(["release:", "provision-attempt-", "fleet:"]);
467
+ var TASK_RESERVED_LABEL_PREFIXES = Object.freeze([
468
+ "release:",
469
+ "provision-attempt-",
470
+ "fleet:"
471
+ ]);
468
472
  var PLATFORM_DEFAULT_MERGE_POLICY = Object.freeze({
469
473
  allowAgentMerge: false,
470
474
  requireGreenGate: true,
@@ -1587,7 +1591,7 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1587
1591
  route: GET("/api/fleet/nodes/{id}/desktop/screenshot"),
1588
1592
  cli: "fleet desktop screenshot"
1589
1593
  }),
1590
- read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "planned", {
1594
+ read("fleet_desktop_displays", "desktop", "FL-07", "FLEET_DESKTOP_ENABLED", "live", {
1591
1595
  route: GET("/api/fleet/nodes/{id}/desktop/displays"),
1592
1596
  cli: "fleet desktop displays"
1593
1597
  }),
@@ -1861,6 +1865,9 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1861
1865
  route: GET("/api/fleet/checkouts/{id}/changes"),
1862
1866
  cli: "fleet checkouts changes"
1863
1867
  }),
1868
+ read("fleet_checkouts_pull_request_get", "checkouts", "FL-06", "FLEET_CHECKOUTS_ENABLED", "planned", {
1869
+ route: GET("/api/fleet/checkouts/{id}/pull-request")
1870
+ }),
1864
1871
  act("fleet_checkouts_create", "checkouts", "FL-14", "FLEET_CHECKOUTS_ENABLED", "live", plain("machine.run"), {
1865
1872
  route: POST("/api/fleet/checkouts"),
1866
1873
  cli: "fleet checkouts create",
@@ -1989,13 +1996,13 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
1989
1996
  }),
1990
1997
  // ── runners (FL-18) ── P1 shipped: list, install, start / stop / restart, remove. An install, a
1991
1998
  // 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.
1999
+ // (`agent-fleet-runners-tools.ts`). P2: the Actions jobs read and Cancel workflow run (always held for an Agent).
1993
2000
  read("fleet_runners_list", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
1994
2001
  phase: "P3",
1995
2002
  route: GET("/api/fleet/nodes/{id}/runners"),
1996
2003
  cli: "fleet runners list"
1997
2004
  }),
1998
- read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "planned", {
2005
+ read("fleet_runners_jobs", "view", "FL-18", "FLEET_ACTIONS_RUNNERS_ENABLED", "live", {
1999
2006
  phase: "P3",
2000
2007
  route: GET("/api/fleet/runners/jobs"),
2001
2008
  cli: "fleet runners jobs"
@@ -2050,9 +2057,14 @@ var FLEET_TOOL_CATALOGUE = Object.freeze([
2050
2057
  "machines",
2051
2058
  "FL-18",
2052
2059
  "FLEET_ACTIONS_RUNNERS_ENABLED",
2053
- "planned",
2060
+ "live",
2054
2061
  confirm("machine.admin"),
2055
- { phase: "P3", route: POST("/api/fleet/runners/jobs/cancel"), cli: "fleet runners cancel-run" }
2062
+ {
2063
+ phase: "P3",
2064
+ route: POST("/api/fleet/runners/jobs/cancel"),
2065
+ cli: "fleet runners cancel-run",
2066
+ alwaysHeld: true
2067
+ }
2056
2068
  ),
2057
2069
  // ── usage (FL-20) ── P1 shipped: the Usage object (totals, by model, by computer, busiest
2058
2070
  // checkouts, sessions) every surface renders, read-only, with the payer sentence in `note`.
@@ -2228,7 +2240,9 @@ var FLEET_VIRTUAL_SYSTEMS = [
2228
2240
  approxDownloadGiB: 0.7
2229
2241
  }
2230
2242
  ];
2231
- var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map((system) => system.id);
2243
+ var FLEET_VIRTUAL_SYSTEM_IDS = FLEET_VIRTUAL_SYSTEMS.map(
2244
+ (system) => system.id
2245
+ );
2232
2246
  var FLEET_VIRTUAL_ENROLL_TIMEOUT_MS = 20 * 60 * 1e3;
2233
2247
  var FLEET_CLOUD_OPTIONS_CACHE_MS = 10 * 60 * 1e3;
2234
2248
  var HOUR_MS2 = 60 * 60 * 1e3;
@@ -2242,6 +2256,58 @@ var FLEET_USAGE_ZERO_TOKENS = Object.freeze({
2242
2256
  cacheWrite: 0
2243
2257
  });
2244
2258
  var FLEET_ACTIONS_RUNNERS_CLOSED_REFRESH_MS = 5 * 6e4;
2259
+ var FLEET_ACTIONS_RUNNER_DOWNLOADS_CACHE_MS = 60 * 6e4;
2260
+ var FLEET_DESKTOP_CONTROL_REASON_FIXES = Object.freeze({
2261
+ "control-not-allowed": { command: "ever-works-node helper control allow" },
2262
+ "permission-accessibility": { settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" },
2263
+ "input-unavailable": {}
2264
+ });
2265
+ var FLEET_DESKTOP_REASONS = [
2266
+ "kind-unsupported",
2267
+ "wayland-unsupported",
2268
+ "helper-missing",
2269
+ "helper-unadmitted",
2270
+ "helper-untrusted",
2271
+ "no-display-session",
2272
+ "permission-screen-recording",
2273
+ "permission-accessibility"
2274
+ ];
2275
+ var FLEET_DESKTOP_WATCH_REASONS = FLEET_DESKTOP_REASONS.filter(
2276
+ (reason) => reason !== "permission-accessibility"
2277
+ );
2278
+ var FLEET_DESKTOP_MAX_REASONS = FLEET_DESKTOP_REASONS.length;
2279
+ var FLEET_DESKTOP_REASON_FIXES = Object.freeze({
2280
+ "kind-unsupported": Object.freeze({}),
2281
+ "wayland-unsupported": Object.freeze({}),
2282
+ "helper-missing": Object.freeze({ command: "ever-works-node helper install" }),
2283
+ "helper-unadmitted": Object.freeze({ command: "ever-works-node helper admit" }),
2284
+ "helper-untrusted": Object.freeze({ command: "ever-works-node helper status" }),
2285
+ "no-display-session": Object.freeze({}),
2286
+ "permission-screen-recording": Object.freeze({
2287
+ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Screen Recording"
2288
+ }),
2289
+ "permission-accessibility": Object.freeze({ settingsPath: "System Settings \u2192 Privacy & Security \u2192 Accessibility" })
2290
+ });
2291
+ var FLEET_DESKTOP_BLOCKER_CODES = Object.freeze({
2292
+ "kill-switch": "kill_switch",
2293
+ "kind-unsupported": "unsupported_on_node",
2294
+ offline: "unreachable",
2295
+ "consent-missing": "consent_missing",
2296
+ "permission-denied": "permission_denied",
2297
+ "wayland-unsupported": "unsupported_on_node",
2298
+ "helper-missing": "unsupported_on_node",
2299
+ "helper-unadmitted": "unsupported_on_node",
2300
+ "helper-untrusted": "unsupported_on_node",
2301
+ "no-display-session": "unsupported_on_node",
2302
+ "permission-screen-recording": "unsupported_on_node",
2303
+ "link-unavailable": "unreachable"
2304
+ });
2305
+ var FLEET_DESKTOP_VIEW_CEILING_MS = 4 * 60 * 6e4;
2306
+ var FLEET_DESKTOP_MAX_PUBLISH_BYTES = 512 * 1024;
2307
+ var FLEET_DESKTOP_RECORDING_MAX_BYTES = 200 * 1024 * 1024;
2308
+ var FLEET_DESKTOP_RECORDING_MAX_MS = 4 * 60 * 6e4;
2309
+ var FLEET_DESKTOP_RECORDING_MAGIC = new Uint8Array([69, 87, 82, 49]);
2310
+ var FLEET_DESKTOP_RECORDING_MAX_CHUNK_BYTES = 64 * 1024 * 1024;
2245
2311
  var EMAIL_INBOX_DEFAULT_DAILY_CAP = 100;
2246
2312
  var EMAIL_INBOX_BURST_SENDS = 10;
2247
2313
  var EMAIL_INBOX_BURST_RECIPIENTS = 20;
@@ -3720,6 +3786,161 @@ function substituteVariables(template, variables) {
3720
3786
  return value !== void 0 ? value : match;
3721
3787
  });
3722
3788
  }
3789
+ function zod3ParsedType(data) {
3790
+ switch (typeof data) {
3791
+ case "undefined":
3792
+ return "undefined";
3793
+ case "string":
3794
+ return "string";
3795
+ case "number":
3796
+ return Number.isNaN(data) ? "nan" : "number";
3797
+ case "boolean":
3798
+ return "boolean";
3799
+ case "function":
3800
+ return "function";
3801
+ case "bigint":
3802
+ return "bigint";
3803
+ case "symbol":
3804
+ return "symbol";
3805
+ case "object": {
3806
+ if (Array.isArray(data)) return "array";
3807
+ if (data === null) return "null";
3808
+ const thenable = data;
3809
+ if (typeof thenable.then === "function" && typeof thenable.catch === "function") return "promise";
3810
+ if (data instanceof Map) return "map";
3811
+ if (data instanceof Set) return "set";
3812
+ if (data instanceof Date) return "date";
3813
+ return "object";
3814
+ }
3815
+ default:
3816
+ return "unknown";
3817
+ }
3818
+ }
3819
+ function joinValues(values, separator = " | ") {
3820
+ return values.map((value) => typeof value === "string" ? `'${value}'` : value).join(separator);
3821
+ }
3822
+ function bigIntSafe(_key, value) {
3823
+ return typeof value === "bigint" ? value.toString() : value;
3824
+ }
3825
+ function schemaType(issue) {
3826
+ return issue.inst?._zod?.def?.type;
3827
+ }
3828
+ var ZOD3_EXPECTED = {
3829
+ record: "object",
3830
+ tuple: "array"
3831
+ };
3832
+ var ZOD3_FORMAT = {
3833
+ guid: "uuid",
3834
+ ipv4: "ip",
3835
+ ipv6: "ip",
3836
+ cidrv4: "cidr",
3837
+ cidrv6: "cidr"
3838
+ };
3839
+ var ZOD4_ONLY_FORMATS = /* @__PURE__ */ new Set(["lowercase", "uppercase", "e164", "ksuid", "xid", "mac", "hex", "hash"]);
3840
+ function invalidType(issue) {
3841
+ if (issue.input === void 0) return "Required";
3842
+ if (issue.expected === "date" && issue.input instanceof Date) return "Invalid date";
3843
+ const received = zod3ParsedType(issue.input);
3844
+ if (issue.expected === "int") {
3845
+ return typeof issue.input === "number" ? "Expected integer, received float" : `Expected number, received ${received}`;
3846
+ }
3847
+ const expected = ZOD3_EXPECTED[issue.expected ?? ""] ?? issue.expected;
3848
+ return `Expected ${expected}, received ${received}`;
3849
+ }
3850
+ function invalidValue(issue) {
3851
+ const values = issue.values ?? [];
3852
+ if (schemaType(issue) === "literal") {
3853
+ return `Invalid literal value, expected ${JSON.stringify(values.length === 1 ? values[0] : values, bigIntSafe)}`;
3854
+ }
3855
+ if (issue.input === void 0) return "Required";
3856
+ const stringEnum = values.every((value) => typeof value === "string");
3857
+ const input = issue.input;
3858
+ if (stringEnum && typeof input !== "string" || typeof input !== "string" && typeof input !== "number") {
3859
+ return `Expected ${joinValues(values)}, received ${zod3ParsedType(input)}`;
3860
+ }
3861
+ return `Invalid enum value. Expected ${joinValues(values)}, received '${String(input)}'`;
3862
+ }
3863
+ function invalidFormat(issue) {
3864
+ const format = issue.format ?? "";
3865
+ switch (format) {
3866
+ case "regex":
3867
+ return "Invalid";
3868
+ case "starts_with":
3869
+ return `Invalid input: must start with "${issue.prefix}"`;
3870
+ case "ends_with":
3871
+ return `Invalid input: must end with "${issue.suffix}"`;
3872
+ case "includes":
3873
+ return `Invalid input: must include "${issue.includes}"`;
3874
+ default:
3875
+ if (!format || ZOD4_ONLY_FORMATS.has(format)) return void 0;
3876
+ return `Invalid ${ZOD3_FORMAT[format] ?? format}`;
3877
+ }
3878
+ }
3879
+ function tooSmall(issue) {
3880
+ const { exact, inclusive, minimum } = issue;
3881
+ switch (issue.origin) {
3882
+ case "array":
3883
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at least" : "more than"} ${minimum} element(s)`;
3884
+ case "string":
3885
+ return `String must contain ${exact ? "exactly" : inclusive ? "at least" : "over"} ${minimum} character(s)`;
3886
+ case "number":
3887
+ case "int":
3888
+ case "bigint":
3889
+ return `Number must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${minimum}`;
3890
+ case "date":
3891
+ return `Date must be ${exact ? "exactly equal to " : inclusive ? "greater than or equal to " : "greater than "}${new Date(Number(minimum))}`;
3892
+ default:
3893
+ return "Invalid input";
3894
+ }
3895
+ }
3896
+ function tooBig(issue) {
3897
+ const { exact, inclusive, maximum } = issue;
3898
+ switch (issue.origin) {
3899
+ case "array":
3900
+ return `Array must contain ${exact ? "exactly" : inclusive ? "at most" : "less than"} ${maximum} element(s)`;
3901
+ case "string":
3902
+ return `String must contain ${exact ? "exactly" : inclusive ? "at most" : "under"} ${maximum} character(s)`;
3903
+ case "number":
3904
+ case "int":
3905
+ return `Number must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3906
+ case "bigint":
3907
+ return `BigInt must be ${exact ? "exactly" : inclusive ? "less than or equal to" : "less than"} ${maximum}`;
3908
+ case "date":
3909
+ return `Date must be ${exact ? "exactly" : inclusive ? "smaller than or equal to" : "smaller than"} ${new Date(Number(maximum))}`;
3910
+ default:
3911
+ return "Invalid input";
3912
+ }
3913
+ }
3914
+ function zod3ErrorMessage(issue) {
3915
+ switch (issue.code) {
3916
+ case "invalid_type":
3917
+ return invalidType(issue);
3918
+ case "invalid_value":
3919
+ return invalidValue(issue);
3920
+ case "unrecognized_keys":
3921
+ return `Unrecognized key(s) in object: ${joinValues(issue.keys ?? [], ", ")}`;
3922
+ case "invalid_union":
3923
+ if (issue.discriminator !== void 0 && issue.options) {
3924
+ return `Invalid discriminator value. Expected ${joinValues(issue.options)}`;
3925
+ }
3926
+ return "Invalid input";
3927
+ case "invalid_format":
3928
+ return invalidFormat(issue);
3929
+ case "too_small":
3930
+ return tooSmall(issue);
3931
+ case "too_big":
3932
+ return tooBig(issue);
3933
+ case "not_multiple_of":
3934
+ return `Number must be a multiple of ${issue.divisor}`;
3935
+ case "custom":
3936
+ return "Invalid input";
3937
+ case "invalid_key":
3938
+ return issue.issues?.[0]?.message;
3939
+ default:
3940
+ return void 0;
3941
+ }
3942
+ }
3943
+ var ZOD3_ERROR_MESSAGES = Object.freeze({ error: zod3ErrorMessage });
3723
3944
 
3724
3945
  // src/types.ts
3725
3946
  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.16",
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:12511a58188161eba121e5601bfe5e968c698eda836b9980c96aa356f41e824a",
77
+ "commit": "4b0b642a5bf671c9b0480d49307c2c4442730f28",
78
+ "source": "https://github.com/ever-works/ever-works/tree/4b0b642a5bf671c9b0480d49307c2c4442730f28/packages/plugins/hermes-agent"
79
79
  }
80
80
  }