fullcourtdefense-cli 1.36.3 → 1.37.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.
Files changed (95) hide show
  1. package/dist/actionPolicyEngine.d.ts +19 -0
  2. package/dist/actionPolicyEngine.js +147 -0
  3. package/dist/askDialog.d.ts +1 -0
  4. package/dist/askDialog.js +20 -3
  5. package/dist/callerEnv.d.ts +29 -2
  6. package/dist/callerEnv.js +48 -2
  7. package/dist/commandNarrative.js +87 -7
  8. package/dist/commands/daemon.d.ts +10 -0
  9. package/dist/commands/daemon.js +348 -170
  10. package/dist/commands/desktopChatGuard.js +2 -0
  11. package/dist/commands/deterministicGuard.d.ts +11 -0
  12. package/dist/commands/deterministicGuard.js +445 -28
  13. package/dist/commands/discoverPaths.d.ts +12 -9
  14. package/dist/commands/discoverPaths.js +30 -0
  15. package/dist/commands/ephemeralStack.js +7 -0
  16. package/dist/commands/flushSpool.d.ts +2 -0
  17. package/dist/commands/flushSpool.js +9 -2
  18. package/dist/commands/hook.d.ts +14 -0
  19. package/dist/commands/hook.js +302 -101
  20. package/dist/commands/httpGatewayCommand.d.ts +1 -0
  21. package/dist/commands/httpGatewayCommand.js +7 -1
  22. package/dist/commands/installClaudeHook.js +32 -10
  23. package/dist/commands/installCursorHook.js +20 -9
  24. package/dist/commands/login.js +8 -1
  25. package/dist/commands/mcpGateway.d.ts +21 -0
  26. package/dist/commands/mcpGateway.js +90 -32
  27. package/dist/commands/refreshPolicyCache.d.ts +28 -0
  28. package/dist/commands/refreshPolicyCache.js +59 -0
  29. package/dist/commands/watchdog.d.ts +2 -0
  30. package/dist/commands/watchdog.js +30 -5
  31. package/dist/config.d.ts +36 -0
  32. package/dist/config.js +78 -12
  33. package/dist/daemonDetectorBoot.d.ts +1 -0
  34. package/dist/daemonDetectorBoot.js +12 -0
  35. package/dist/daemonForensics.d.ts +14 -1
  36. package/dist/daemonForensics.js +32 -0
  37. package/dist/detectorInProcess.d.ts +18 -0
  38. package/dist/detectorInProcess.js +234 -0
  39. package/dist/detectorInThread.d.ts +15 -0
  40. package/dist/detectorInThread.js +129 -0
  41. package/dist/distress.d.ts +2 -0
  42. package/dist/distress.js +2 -0
  43. package/dist/fileWriteCanon.d.ts +17 -0
  44. package/dist/fileWriteCanon.js +141 -0
  45. package/dist/gateReports.d.ts +144 -0
  46. package/dist/gateReports.js +488 -0
  47. package/dist/hookIo.d.ts +59 -0
  48. package/dist/hookIo.js +319 -9
  49. package/dist/hookSlim.d.ts +15 -8
  50. package/dist/hookSlim.js +187 -25
  51. package/dist/housekeeping.d.ts +64 -0
  52. package/dist/housekeeping.js +384 -0
  53. package/dist/housekeepingOps.d.ts +150 -0
  54. package/dist/housekeepingOps.js +218 -0
  55. package/dist/housekeepingWorker.d.ts +1 -0
  56. package/dist/housekeepingWorker.js +113 -0
  57. package/dist/index.d.ts +1 -1
  58. package/dist/index.js +19 -0
  59. package/dist/localDetectionData.d.ts +10 -0
  60. package/dist/localDetectionData.js +48 -0
  61. package/dist/localDetectionUpdates.d.ts +2 -2
  62. package/dist/localDetectionUpdates.js +4 -4
  63. package/dist/localSafetySnapshot.d.ts +48 -2
  64. package/dist/localSafetySnapshot.js +241 -25
  65. package/dist/machineIdentity.d.ts +7 -0
  66. package/dist/machineIdentity.js +20 -2
  67. package/dist/monitorFastPath.d.ts +191 -0
  68. package/dist/monitorFastPath.js +1198 -0
  69. package/dist/nativeHook.js +9 -2
  70. package/dist/pendingDrain.d.ts +82 -0
  71. package/dist/pendingDrain.js +215 -0
  72. package/dist/pendingDrainer.d.ts +30 -0
  73. package/dist/pendingDrainer.js +217 -0
  74. package/dist/perfSnapshot.d.ts +1 -1
  75. package/dist/perfSnapshot.js +28 -4
  76. package/dist/policyCacheFiles.d.ts +73 -0
  77. package/dist/policyCacheFiles.js +320 -0
  78. package/dist/policyGateHealth.d.ts +8 -0
  79. package/dist/policyGateHealth.js +17 -0
  80. package/dist/policyRefresh.d.ts +28 -0
  81. package/dist/policyRefresh.js +69 -0
  82. package/dist/protectionMaintenance.d.ts +15 -0
  83. package/dist/protectionMaintenance.js +43 -1
  84. package/dist/runtimeConfig.d.ts +77 -20
  85. package/dist/runtimeConfig.js +278 -57
  86. package/dist/selfTest.d.ts +6 -1
  87. package/dist/selfTest.js +11 -4
  88. package/dist/telemetry.d.ts +136 -4
  89. package/dist/telemetry.js +493 -96
  90. package/dist/verdictIpc.d.ts +60 -0
  91. package/dist/verdictIpc.js +504 -19
  92. package/dist/verdictIpcClient.d.ts +175 -18
  93. package/dist/verdictIpcClient.js +277 -59
  94. package/dist/version.json +1 -1
  95. package/package.json +2 -2
@@ -16,12 +16,19 @@ async function flushSpoolCommand(args, config) {
16
16
  });
17
17
  if (!creds.shieldId)
18
18
  return; // nothing to attribute to
19
- const result = await (0, telemetry_1.flushSpool)({
19
+ // Drains in batches and records completion for the hooks that coalesced
20
+ // onto this flusher. `--heartbeat liveness` (hook-requested flushes):
21
+ // liveness only, no diagnostic payload, and a short linger for the rest of
22
+ // the burst that requested it.
23
+ const hookRequested = args.heartbeat === 'liveness';
24
+ const result = await (0, telemetry_1.drainSpool)({
20
25
  apiUrl: creds.apiUrl,
21
26
  shieldId: creds.shieldId,
22
27
  shieldKey: creds.shieldKey,
23
28
  heartbeat: args.heartbeat !== 'false',
24
- });
29
+ livenessOnly: hookRequested,
30
+ refreshGuardRules: args.guardRules !== 'false',
31
+ }, { linger: hookRequested });
25
32
  if (result) {
26
33
  console.log(`Flushed ${result.accepted} event(s)${result.deduped ? `, ${result.deduped} deduped` : ''}.`);
27
34
  }
@@ -34,6 +34,7 @@ export interface HookArgs {
34
34
  approvalMode?: string;
35
35
  approvalTimeoutMs?: string;
36
36
  approvalPollMs?: string;
37
+ ideTimeout?: string;
37
38
  }
38
39
  /**
39
40
  * `post` = a post-execution hook (Cursor afterShellExecution / afterMCPExecution, Claude
@@ -209,6 +210,14 @@ export interface HookIo {
209
210
  * mode, where `exit` only unwinds the evaluation and the process lives on.
210
211
  */
211
212
  exitsProcess: boolean;
213
+ /**
214
+ * Native hooks (Codex, Gemini CLI, Windsurf, Kiro): a block-mode local-first
215
+ * allow queues its check-tool-call report (gateReports.ts) instead of
216
+ * spooling it. These processes used to send that report themselves and
217
+ * wait for it; its answer still ends a gate-failure streak and feeds the
218
+ * server's behavior baseline, only after the verdict and off this process.
219
+ */
220
+ deferGateReports?: boolean;
212
221
  /** Evaluated inside the resident daemon for a thin client (see DaemonDeclined). */
213
222
  viaDaemon?: boolean;
214
223
  /** Set when this evaluation's verdict is a stop still being settled (approval wait). */
@@ -245,9 +254,14 @@ export declare function crashVerdictForProcess(event: string | undefined, messag
245
254
  * snapshot, policy engine) is warm here — verdicts resolve in milliseconds.
246
255
  * Mirrors hookCommand's fail-open contract: any unexpected exception yields
247
256
  * an allow verdict, never an error the thin client would surface.
257
+ * `exitsProcess`: the caller is a one-shot hook process that ends with this
258
+ * verdict (the slim entry's fallback, native hooks) — see HookIo.exitsProcess.
259
+ * `deferGateReports`: native hooks — see HookIo.deferGateReports.
248
260
  */
249
261
  export declare function evaluateHookRequest(args: HookArgs, stdinRaw: string, config: BotGuardConfig, opts?: {
250
262
  viaDaemon?: boolean;
263
+ exitsProcess?: boolean;
264
+ deferGateReports?: boolean;
251
265
  }): Promise<{
252
266
  stdout: string;
253
267
  stderr: string;