@akasecurity/ai-tc-codex 0.9.18 → 0.9.19

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.
@@ -22723,6 +22723,31 @@ var DeviceCommandAckBody = external_exports.discriminatedUnion("outcome", [
22723
22723
  projectsScanned: external_exports.number().int().nonnegative()
22724
22724
  }).strict()
22725
22725
  ]);
22726
+ var SIGHTING_KEY_MATERIAL = /^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/;
22727
+ var sightingKeyMaterial = external_exports.string().regex(SIGHTING_KEY_MATERIAL, "must be the base64url encoding of exactly 32 bytes");
22728
+ var sightingKeyVersion = external_exports.number().int().min(1);
22729
+ var SightingKeyVersion = external_exports.object({
22730
+ keyVersion: sightingKeyVersion,
22731
+ key: sightingKeyMaterial
22732
+ });
22733
+ var SightingKeyResponse = external_exports.object({
22734
+ keyVersion: sightingKeyVersion,
22735
+ algorithm: external_exports.literal("hmac-sha256"),
22736
+ key: sightingKeyMaterial,
22737
+ previous: external_exports.array(SightingKeyVersion).optional()
22738
+ }).refine(
22739
+ (body) => {
22740
+ const versions = [body.keyVersion, ...(body.previous ?? []).map((p) => p.keyVersion)];
22741
+ return new Set(versions).size === versions.length;
22742
+ },
22743
+ { message: "key versions must be distinct", path: ["previous"] }
22744
+ );
22745
+ var StoredSightingKeys = SightingKeyResponse.and(
22746
+ external_exports.object({
22747
+ fetchedAtMs: external_exports.number().int().nonnegative(),
22748
+ endpointFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/)
22749
+ })
22750
+ );
22726
22751
 
22727
22752
  // ../../packages/schema/src/zod/registry.ts
22728
22753
  var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
@@ -23937,6 +23962,26 @@ var ManagedSettings = external_exports.object({
23937
23962
  };
23938
23963
  }).meta({ id: "ManagedSettings" });
23939
23964
 
23965
+ // ../../packages/schema/src/zod/mod-finding.ts
23966
+ var MOD_FINDINGS_MAX_BYTES = 4 * 1024 * 1024;
23967
+ var ModFindingAction = external_exports.enum(["redacted", "vaulted", "blocked", "warned", "logged"]).meta({ id: "ModFindingAction" });
23968
+ var ModFindingWhere = external_exports.enum(["prompt", "attachment", "tool-input", "tool-output", "memory", "subagent"]).meta({ id: "ModFindingWhere" });
23969
+ var ModFinding = external_exports.strictObject({
23970
+ v: external_exports.literal(1),
23971
+ id: external_exports.string().regex(/^[0-9a-f]{16}$/),
23972
+ at: external_exports.iso.datetime(),
23973
+ ruleId: external_exports.string().min(1),
23974
+ shortName: external_exports.string().min(1).max(64).optional(),
23975
+ category: DetectionCategory,
23976
+ severity: Severity,
23977
+ action: ModFindingAction,
23978
+ where: ModFindingWhere,
23979
+ pointer: external_exports.string().regex(POINTER_TOKEN_ANCHORED).optional()
23980
+ }).refine((f) => f.action === "vaulted" === (f.pointer !== void 0), {
23981
+ path: ["pointer"],
23982
+ message: "pointer is present only for a vaulted finding, and a vaulted finding has one"
23983
+ }).meta({ id: "ModFinding" });
23984
+
23940
23985
  // ../../packages/schema/src/zod/mod-policy-snapshot.ts
23941
23986
  var MOD_POLICY_SNAPSHOT_VERSION = 1;
23942
23987
  var MOD_POLICY_SNAPSHOT_MAX_BYTES = 4 * 1024 * 1024;
package/scripts/stop.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // ../../packages/plugin-sdk/src/config.ts
8
8
  import { existsSync as existsSync8 } from "fs";
9
- import { join as join17 } from "path";
9
+ import { join as join18 } from "path";
10
10
 
11
11
  // ../../packages/schema/src/drizzle/deferred-migrations.ts
12
12
  var DEFERRED_MIGRATION_TAGS = [
@@ -22735,6 +22735,31 @@ var DeviceCommandAckBody = external_exports.discriminatedUnion("outcome", [
22735
22735
  projectsScanned: external_exports.number().int().nonnegative()
22736
22736
  }).strict()
22737
22737
  ]);
22738
+ var SIGHTING_KEY_MATERIAL = /^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$/;
22739
+ var sightingKeyMaterial = external_exports.string().regex(SIGHTING_KEY_MATERIAL, "must be the base64url encoding of exactly 32 bytes");
22740
+ var sightingKeyVersion = external_exports.number().int().min(1);
22741
+ var SightingKeyVersion = external_exports.object({
22742
+ keyVersion: sightingKeyVersion,
22743
+ key: sightingKeyMaterial
22744
+ });
22745
+ var SightingKeyResponse = external_exports.object({
22746
+ keyVersion: sightingKeyVersion,
22747
+ algorithm: external_exports.literal("hmac-sha256"),
22748
+ key: sightingKeyMaterial,
22749
+ previous: external_exports.array(SightingKeyVersion).optional()
22750
+ }).refine(
22751
+ (body) => {
22752
+ const versions = [body.keyVersion, ...(body.previous ?? []).map((p) => p.keyVersion)];
22753
+ return new Set(versions).size === versions.length;
22754
+ },
22755
+ { message: "key versions must be distinct", path: ["previous"] }
22756
+ );
22757
+ var StoredSightingKeys = SightingKeyResponse.and(
22758
+ external_exports.object({
22759
+ fetchedAtMs: external_exports.number().int().nonnegative(),
22760
+ endpointFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/)
22761
+ })
22762
+ );
22738
22763
 
22739
22764
  // ../../packages/schema/src/zod/registry.ts
22740
22765
  var Namespace = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
@@ -23950,6 +23975,26 @@ var ManagedSettings = external_exports.object({
23950
23975
  };
23951
23976
  }).meta({ id: "ManagedSettings" });
23952
23977
 
23978
+ // ../../packages/schema/src/zod/mod-finding.ts
23979
+ var MOD_FINDINGS_MAX_BYTES = 4 * 1024 * 1024;
23980
+ var ModFindingAction = external_exports.enum(["redacted", "vaulted", "blocked", "warned", "logged"]).meta({ id: "ModFindingAction" });
23981
+ var ModFindingWhere = external_exports.enum(["prompt", "attachment", "tool-input", "tool-output", "memory", "subagent"]).meta({ id: "ModFindingWhere" });
23982
+ var ModFinding = external_exports.strictObject({
23983
+ v: external_exports.literal(1),
23984
+ id: external_exports.string().regex(/^[0-9a-f]{16}$/),
23985
+ at: external_exports.iso.datetime(),
23986
+ ruleId: external_exports.string().min(1),
23987
+ shortName: external_exports.string().min(1).max(64).optional(),
23988
+ category: DetectionCategory,
23989
+ severity: Severity,
23990
+ action: ModFindingAction,
23991
+ where: ModFindingWhere,
23992
+ pointer: external_exports.string().regex(POINTER_TOKEN_ANCHORED).optional()
23993
+ }).refine((f) => f.action === "vaulted" === (f.pointer !== void 0), {
23994
+ path: ["pointer"],
23995
+ message: "pointer is present only for a vaulted finding, and a vaulted finding has one"
23996
+ }).meta({ id: "ModFinding" });
23997
+
23953
23998
  // ../../packages/schema/src/zod/mod-policy-snapshot.ts
23954
23999
  var MOD_POLICY_SNAPSHOT_VERSION = 1;
23955
24000
  var MOD_POLICY_SNAPSHOT_MAX_BYTES = 4 * 1024 * 1024;
@@ -24679,12 +24724,21 @@ var DB_EVENT_TYPE_TO_KIND = {
24679
24724
  };
24680
24725
  var TIMELINE_EVENT_TYPES = Object.keys(DB_EVENT_TYPE_TO_KIND).map((kind) => `'${kind}'`).join(", ");
24681
24726
  var DEFAULT_HARNESS = HARNESS.ClaudeCode;
24727
+ var CALL_WRITE_SPLIT = `(coalesce(ephemeral_1h_input_tokens, 0) + coalesce(ephemeral_5m_input_tokens, 0))`;
24682
24728
  var CALL_PROMPT_TOKENS = `(coalesce(input_tokens, 0) + coalesce(cache_read_input_tokens, 0)
24683
- + max(coalesce(cache_creation_input_tokens, 0),
24684
- coalesce(ephemeral_1h_input_tokens, 0) + coalesce(ephemeral_5m_input_tokens, 0)))`;
24685
- var CALL_BAND = LONG_CONTEXT_THRESHOLDS.length === 0 ? "0" : LONG_CONTEXT_THRESHOLDS.map((t) => `(${CALL_PROMPT_TOKENS} > ${String(Math.trunc(t))})`).join(
24686
- " + "
24729
+ + max(coalesce(cache_creation_input_tokens, 0), ${CALL_WRITE_SPLIT}))`;
24730
+ var CALL_BAND = LONG_CONTEXT_THRESHOLDS.map(
24731
+ (t) => `(${CALL_PROMPT_TOKENS} > ${String(Math.trunc(t))})`
24687
24732
  );
24733
+ var CALL_USAGE_SHAPE = [
24734
+ "coalesce(input_tokens, 0) > 0",
24735
+ "coalesce(output_tokens, 0) > 0",
24736
+ "coalesce(cache_read_input_tokens, 0) > 0",
24737
+ "coalesce(ephemeral_1h_input_tokens, 0) > 0",
24738
+ "coalesce(ephemeral_5m_input_tokens, 0) > 0",
24739
+ `coalesce(cache_creation_input_tokens, 0) > ${CALL_WRITE_SPLIT}`,
24740
+ "coalesce(web_search_requests, 0) > 0"
24741
+ ].map((condition) => `(${condition})`);
24688
24742
  var LLM_USAGE_SELECT = `
24689
24743
  SELECT root_session_id AS sessionId,
24690
24744
  provider,
@@ -24698,7 +24752,14 @@ var LLM_USAGE_SELECT = `
24698
24752
  coalesce(sum(ephemeral_5m_input_tokens), 0) AS ephemeral5mTokens,
24699
24753
  coalesce(sum(web_search_requests), 0) AS webSearchRequests,
24700
24754
  coalesce(max(${CALL_PROMPT_TOKENS}), 0) AS promptTokens`;
24701
- var LLM_USAGE_GROUP = `GROUP BY root_session_id, provider, model, service_tier, ${CALL_BAND}`;
24755
+ var LLM_USAGE_GROUP = `GROUP BY ${[
24756
+ "root_session_id",
24757
+ "provider",
24758
+ "model",
24759
+ "service_tier",
24760
+ ...CALL_BAND.length === 0 ? [] : [CALL_BAND.join(" + ")],
24761
+ ...CALL_USAGE_SHAPE
24762
+ ].join(", ")}`;
24702
24763
 
24703
24764
  // ../../packages/persistence/src/repositories/exceptions.ts
24704
24765
  import { randomUUID as randomUUID2 } from "crypto";
@@ -25061,21 +25122,27 @@ import {
25061
25122
  createDecipheriv,
25062
25123
  createHmac as createHmac2,
25063
25124
  hkdfSync,
25125
+ randomBytes as randomBytes2,
25064
25126
  timingSafeEqual
25065
25127
  } from "crypto";
25066
25128
 
25067
25129
  // ../../packages/persistence/src/vault/key-provider.ts
25068
25130
  import { execFileSync } from "child_process";
25069
- import { randomBytes as randomBytes2 } from "crypto";
25131
+ import { randomBytes as randomBytes3 } from "crypto";
25070
25132
  import { chmodSync as chmodSync3, readFileSync as readFileSync10, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
25071
25133
  import { join as join15 } from "path";
25072
25134
 
25135
+ // ../../packages/persistence/src/vault/sighting-keys.ts
25136
+ import { createHash as createHash6 } from "crypto";
25137
+ import { readFileSync as readFileSync11, rmSync as rmSync7 } from "fs";
25138
+ import { join as join16 } from "path";
25139
+
25073
25140
  // ../../packages/persistence/src/vault/vault.ts
25074
- import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
25141
+ import { randomBytes as randomBytes4, randomUUID as randomUUID12 } from "crypto";
25075
25142
 
25076
25143
  // ../../packages/persistence/src/warn-era-cap.ts
25077
25144
  import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
25078
- import { join as join16 } from "path";
25145
+ import { join as join17 } from "path";
25079
25146
 
25080
25147
  // ../../packages/plugin-sdk/src/provider-env.ts
25081
25148
  var DEFAULT_ANTHROPIC_HOST = "api.anthropic.com";
@@ -25129,7 +25196,7 @@ function resolveProvider() {
25129
25196
  function loadConfig(base = defaultDataDir(), resolveProviderFn = resolveProvider) {
25130
25197
  try {
25131
25198
  ensureLayoutDirSync(base);
25132
- const settingsFile = join17(settingsDir(base), "settings.json");
25199
+ const settingsFile = join18(settingsDir(base), "settings.json");
25133
25200
  if (existsSync8(settingsFile)) tightenFile(settingsFile);
25134
25201
  } catch {
25135
25202
  }
@@ -26022,11 +26089,11 @@ var GROWTH_CORPORA = [
26022
26089
  ];
26023
26090
 
26024
26091
  // ../../packages/plugin-sdk/src/hook-fail-opens.ts
26025
- import { readFileSync as readFileSync11 } from "fs";
26026
- import { join as join18 } from "path";
26092
+ import { readFileSync as readFileSync12 } from "fs";
26093
+ import { join as join19 } from "path";
26027
26094
  var HOOK_FAIL_OPENS_FILENAME = "hook-fail-opens.json";
26028
26095
  function hookFailOpensPath(dataDir2) {
26029
- return join18(dataDir2, HOOK_FAIL_OPENS_FILENAME);
26096
+ return join19(dataDir2, HOOK_FAIL_OPENS_FILENAME);
26030
26097
  }
26031
26098
  function recordHookFailOpen(dataDir2, nowMs) {
26032
26099
  try {
@@ -26045,7 +26112,7 @@ function recordHookFailOpen(dataDir2, nowMs) {
26045
26112
  }
26046
26113
  function readHookFailOpens(dataDir2) {
26047
26114
  try {
26048
- const parsed = JSON.parse(readFileSync11(hookFailOpensPath(dataDir2), "utf8"));
26115
+ const parsed = JSON.parse(readFileSync12(hookFailOpensPath(dataDir2), "utf8"));
26049
26116
  if (typeof parsed !== "object" || parsed === null) return null;
26050
26117
  const record2 = parsed;
26051
26118
  if (!isPositiveSafeInteger(record2.failOpens)) return null;
@@ -26065,18 +26132,18 @@ import {
26065
26132
  fstatSync,
26066
26133
  mkdirSync as mkdirSync2,
26067
26134
  openSync as openSync2,
26068
- readFileSync as readFileSync12,
26135
+ readFileSync as readFileSync13,
26069
26136
  readSync,
26070
26137
  writeFileSync as writeFileSync5
26071
26138
  } from "fs";
26072
- import { join as join19 } from "path";
26139
+ import { join as join20 } from "path";
26073
26140
  var SESSION_MODEL_MARKER = "session-model";
26074
26141
  function recordSessionModel(dataDir2, sessionId, model) {
26075
26142
  if (sessionId === void 0 || sessionId === "") return;
26076
26143
  if (model === void 0 || model === "") return;
26077
26144
  try {
26078
26145
  mkdirSync2(dataDir2, { recursive: true, mode: DATA_DIR_MODE });
26079
- writeFileSync5(join19(dataDir2, SESSION_MODEL_MARKER), JSON.stringify({ sessionId, model }), {
26146
+ writeFileSync5(join20(dataDir2, SESSION_MODEL_MARKER), JSON.stringify({ sessionId, model }), {
26080
26147
  encoding: "utf8",
26081
26148
  mode: DATA_FILE_MODE
26082
26149
  });
@@ -26088,7 +26155,7 @@ function readTail(path) {
26088
26155
  const fd = openSync2(path, "r");
26089
26156
  try {
26090
26157
  const { size } = fstatSync(fd);
26091
- if (size <= TAIL_BYTES) return { text: readFileSync12(fd, "utf8"), truncated: false };
26158
+ if (size <= TAIL_BYTES) return { text: readFileSync13(fd, "utf8"), truncated: false };
26092
26159
  const buffer = Buffer.allocUnsafe(TAIL_BYTES);
26093
26160
  let filled = 0;
26094
26161
  while (filled < TAIL_BYTES) {
@@ -26135,9 +26202,9 @@ var codexModelFromRecord = (record2) => {
26135
26202
 
26136
26203
  // ../../packages/plugin-sdk/src/throttle.ts
26137
26204
  import { mkdirSync as mkdirSync3, statSync as statSync6, writeFileSync as writeFileSync6 } from "fs";
26138
- import { join as join20 } from "path";
26205
+ import { join as join21 } from "path";
26139
26206
  function throttled(dataDir2, markerName, windowMs) {
26140
- const marker = join20(dataDir2, markerName);
26207
+ const marker = join21(dataDir2, markerName);
26141
26208
  try {
26142
26209
  if (Date.now() - statSync6(marker).mtimeMs < windowMs) return true;
26143
26210
  } catch {
@@ -26152,27 +26219,27 @@ function throttled(dataDir2, markerName, windowMs) {
26152
26219
 
26153
26220
  // src/history/reconcile-trigger.ts
26154
26221
  import { spawn } from "child_process";
26155
- import { dirname as dirname4, join as join22 } from "path";
26222
+ import { dirname as dirname4, join as join23 } from "path";
26156
26223
  import { fileURLToPath } from "url";
26157
26224
 
26158
26225
  // src/history/tail.ts
26159
- import { createHash as createHash6 } from "crypto";
26226
+ import { createHash as createHash7 } from "crypto";
26160
26227
  import {
26161
26228
  closeSync as closeSync3,
26162
26229
  fstatSync as fstatSync2,
26163
26230
  mkdirSync as mkdirSync4,
26164
26231
  openSync as openSync3,
26165
- readFileSync as readFileSync13,
26232
+ readFileSync as readFileSync14,
26166
26233
  readSync as readSync2,
26167
26234
  writeFileSync as writeFileSync7
26168
26235
  } from "fs";
26169
- import { join as join21 } from "path";
26236
+ import { join as join22 } from "path";
26170
26237
  var SAFE_SESSION_ID = /^[A-Za-z0-9._-]+$/;
26171
26238
  function safeSessionId(sessionId) {
26172
26239
  if (SAFE_SESSION_ID.test(sessionId) && sessionId !== "." && sessionId !== "..") {
26173
26240
  return sessionId;
26174
26241
  }
26175
- return createHash6("sha256").update(sessionId).digest("hex");
26242
+ return createHash7("sha256").update(sessionId).digest("hex");
26176
26243
  }
26177
26244
 
26178
26245
  // src/history/reconcile-trigger.ts
@@ -26183,7 +26250,7 @@ function triggerReconcile(dataDir2, sessionId, transcriptPath) {
26183
26250
  const marker = `${RECONCILE_MARKER_PREFIX}-${safeSessionId(sessionId)}`;
26184
26251
  if (throttled(dataDir2, marker, RECONCILE_THROTTLE_MS)) return;
26185
26252
  const here = dirname4(fileURLToPath(import.meta.url));
26186
- const child = spawn(process.execPath, [join22(here, "reconcile.js"), sessionId, transcriptPath], {
26253
+ const child = spawn(process.execPath, [join23(here, "reconcile.js"), sessionId, transcriptPath], {
26187
26254
  detached: true,
26188
26255
  stdio: "ignore"
26189
26256
  });
@@ -26245,8 +26312,8 @@ function parseStopPayload(input2) {
26245
26312
  }
26246
26313
 
26247
26314
  // src/hooks/store-health.ts
26248
- import { mkdirSync as mkdirSync5, readFileSync as readFileSync18, writeFileSync as writeFileSync8 } from "fs";
26249
- import { dirname as dirname6, join as join30 } from "path";
26315
+ import { mkdirSync as mkdirSync5, readFileSync as readFileSync19, writeFileSync as writeFileSync8 } from "fs";
26316
+ import { dirname as dirname6, join as join31 } from "path";
26250
26317
 
26251
26318
  // ../../packages/remote/src/http.ts
26252
26319
  import { request as httpRequest } from "http";
@@ -26260,16 +26327,16 @@ var SLASH2 = "/".charCodeAt(0);
26260
26327
  var REQUEST_TIMEOUT_MS = 2e3;
26261
26328
 
26262
26329
  // ../../packages/plugin-runtime/src/attached/forward-drops.ts
26263
- import { readFileSync as readFileSync14 } from "fs";
26264
- import { join as join23 } from "path";
26330
+ import { readFileSync as readFileSync15 } from "fs";
26331
+ import { join as join24 } from "path";
26265
26332
 
26266
26333
  // ../../packages/plugin-runtime/src/attached/forward-policy.ts
26267
26334
  import { randomUUID as randomUUID13 } from "crypto";
26268
26335
  import { readFile, rename, writeFile } from "fs/promises";
26269
- import { join as join24 } from "path";
26336
+ import { join as join25 } from "path";
26270
26337
 
26271
26338
  // ../../packages/plugin-runtime/src/attached/history-sync.ts
26272
- import { createHash as createHash7 } from "crypto";
26339
+ import { createHash as createHash8 } from "crypto";
26273
26340
  import { hostname as hostname4 } from "os";
26274
26341
 
26275
26342
  // ../../packages/plugin-runtime/src/attached/capture-rebuild.ts
@@ -26289,16 +26356,16 @@ var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
26289
26356
 
26290
26357
  // ../../packages/plugin-runtime/src/attached/install-record.ts
26291
26358
  import { readFile as readFile2, stat } from "fs/promises";
26292
- import { basename as basename2, dirname as dirname5, join as join25, resolve as resolve2 } from "path";
26359
+ import { basename as basename2, dirname as dirname5, join as join26, resolve as resolve2 } from "path";
26293
26360
 
26294
26361
  // ../../packages/plugin-runtime/src/attached/plugin-block.ts
26295
- import { readFileSync as readFileSync15 } from "fs";
26362
+ import { readFileSync as readFileSync16 } from "fs";
26296
26363
  var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
26297
26364
 
26298
26365
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
26299
26366
  import { randomUUID as randomUUID14 } from "crypto";
26300
26367
  import { readFile as readFile3, rm, writeFile as writeFile2 } from "fs/promises";
26301
- import { join as join26 } from "path";
26368
+ import { join as join27 } from "path";
26302
26369
 
26303
26370
  // ../../packages/plugin-runtime/src/attached/atomic-publish.ts
26304
26371
  import { rename as rename2 } from "fs/promises";
@@ -26307,8 +26374,8 @@ var TIMED_RETRIES = 4;
26307
26374
  var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
26308
26375
 
26309
26376
  // ../../packages/plugin-runtime/src/attached/posture-report-state.ts
26310
- import { readFileSync as readFileSync16 } from "fs";
26311
- import { join as join27 } from "path";
26377
+ import { readFileSync as readFileSync17 } from "fs";
26378
+ import { join as join28 } from "path";
26312
26379
  var OUTCOME_KEYS = {
26313
26380
  ok: true,
26314
26381
  unauthorized: true,
@@ -26331,11 +26398,11 @@ import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
26331
26398
  // ../../packages/plugin-runtime/src/attached/posture-store.ts
26332
26399
  import { randomUUID as randomUUID15 } from "crypto";
26333
26400
  import { readFile as readFile4, rm as rm2, writeFile as writeFile3 } from "fs/promises";
26334
- import { join as join28 } from "path";
26401
+ import { join as join29 } from "path";
26335
26402
 
26336
26403
  // ../../packages/plugin-runtime/src/attached/sync-state.ts
26337
- import { readFileSync as readFileSync17 } from "fs";
26338
- import { join as join29 } from "path";
26404
+ import { readFileSync as readFileSync18 } from "fs";
26405
+ import { join as join30 } from "path";
26339
26406
 
26340
26407
  // ../../packages/plugin-runtime/src/attached/status.ts
26341
26408
  var REFUSAL_LINES = {
@@ -26351,6 +26418,9 @@ var OUTCOME_LINES = {
26351
26418
  "invalid-bundle": "control plane sent a policy bundle this build cannot read"
26352
26419
  };
26353
26420
 
26421
+ // ../../packages/plugin-runtime/src/attached/sighting-key-sync.ts
26422
+ var SIGHTING_KEY_MAX_AGE_MS = 24 * 60 * 60 * 1e3;
26423
+
26354
26424
  // ../../packages/plugin-runtime/src/attached/sync-trigger.ts
26355
26425
  import { spawn as spawn3 } from "child_process";
26356
26426
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -26379,7 +26449,7 @@ function markerDirs(dataDir2) {
26379
26449
  function alreadyClaimed(dirs, marker, sessionId) {
26380
26450
  return dirs.some((dir) => {
26381
26451
  try {
26382
- return readFileSync18(join30(dir, marker), "utf8") === sessionId;
26452
+ return readFileSync19(join31(dir, marker), "utf8") === sessionId;
26383
26453
  } catch {
26384
26454
  return false;
26385
26455
  }
@@ -26389,7 +26459,7 @@ function recordClaim(dirs, marker, sessionId) {
26389
26459
  for (const dir of dirs) {
26390
26460
  try {
26391
26461
  mkdirSync5(dir, { recursive: true, mode: DATA_DIR_MODE });
26392
- writeFileSync8(join30(dir, marker), sessionId, { mode: DATA_FILE_MODE });
26462
+ writeFileSync8(join31(dir, marker), sessionId, { mode: DATA_FILE_MODE });
26393
26463
  return;
26394
26464
  } catch {
26395
26465
  }