@cleocode/adapters 2026.6.19 → 2026.7.1

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.js CHANGED
@@ -12791,7 +12791,7 @@ var init_lafs = __esm({
12791
12791
 
12792
12792
  // packages/contracts/src/lease-ipc/messages.ts
12793
12793
  import { z as z11 } from "zod";
12794
- var LeaseScopeSchema, LeaseLaneSchema, LeaseAcquireRequestSchema, LeaseReleaseRequestSchema, LeaseRenewRequestSchema, RateCheckRequestSchema, ToolGrantRequestSchema, QueuePriorityClassSchema, QueueAdmitRequestSchema, WorkerHeartbeatRequestSchema, LeaseIpcRequestSchema, LeaseGrantedResponseSchema, LeaseQueuedResponseSchema, LeaseDeniedResponseSchema, RateResultResponseSchema, ToolGrantedResponseSchema, LeaseRevokedResponseSchema, ChildKilledUnresponsiveResponseSchema, QueueAdmitDispositionSchema, QueueAdmitResultResponseSchema, HeartbeatAckResponseSchema, LeaseErrorResponseSchema, LeaseIpcResponseSchema, LeaseIpcRequestEnvelopeSchema, LeaseIpcResponseEnvelopeSchema, LeaseIpcEnvelopeSchema, LEASE_IPC_REQUEST_KINDS, LEASE_IPC_RESPONSE_KINDS, LEASE_IPC_MESSAGE_KINDS;
12794
+ var LeaseScopeSchema, LeaseLaneSchema, LeaseAcquireRequestSchema, LeaseReleaseRequestSchema, LeaseRenewRequestSchema, RateCheckRequestSchema, ToolGrantRequestSchema, QueuePriorityClassSchema, QueueAdmitRequestSchema, WorkerHeartbeatRequestSchema, ResourceAdmitRequestSchema, ResourceReleaseRequestSchema, LeaseIpcRequestSchema, LeaseGrantedResponseSchema, LeaseQueuedResponseSchema, LeaseDeniedResponseSchema, RateResultResponseSchema, ToolGrantedResponseSchema, LeaseRevokedResponseSchema, ChildKilledUnresponsiveResponseSchema, QueueAdmitDispositionSchema, QueueAdmitResultResponseSchema, HeartbeatAckResponseSchema, ResourceAdmitDispositionSchema, ResourceAdmitResultResponseSchema, ResourceReleaseResultResponseSchema, LeaseErrorResponseSchema, LeaseIpcResponseSchema, LeaseIpcRequestEnvelopeSchema, LeaseIpcResponseEnvelopeSchema, LeaseIpcEnvelopeSchema, LEASE_IPC_REQUEST_KINDS, LEASE_IPC_RESPONSE_KINDS, LEASE_IPC_MESSAGE_KINDS;
12795
12795
  var init_messages2 = __esm({
12796
12796
  "packages/contracts/src/lease-ipc/messages.ts"() {
12797
12797
  "use strict";
@@ -12876,6 +12876,24 @@ var init_messages2 = __esm({
12876
12876
  /** The worker's own view of whether it is currently inside an LLM call. */
12877
12877
  in_flight_llm: z11.boolean()
12878
12878
  }).strict();
12879
+ ResourceAdmitRequestSchema = z11.object({
12880
+ /** Tag discriminating this request variant. */
12881
+ kind: z11.literal("resource_admit"),
12882
+ /** The resource class (e.g. `"db-heavy"`, `"full-build"`, `"test-run"`). */
12883
+ class: z11.string().min(1),
12884
+ /** The caller holding the slot — process/worktree-unique; the release key. */
12885
+ holder_id: z11.string().min(1),
12886
+ /** The client-computed budget: the max concurrent holders for this class. */
12887
+ budget: z11.number().int().nonnegative()
12888
+ }).strict();
12889
+ ResourceReleaseRequestSchema = z11.object({
12890
+ /** Tag discriminating this request variant. */
12891
+ kind: z11.literal("resource_release"),
12892
+ /** The resource class the slot belongs to. */
12893
+ class: z11.string().min(1),
12894
+ /** The holder that was admitted (matches the admit `holder_id`). */
12895
+ holder_id: z11.string().min(1)
12896
+ }).strict();
12879
12897
  LeaseIpcRequestSchema = z11.discriminatedUnion("kind", [
12880
12898
  LeaseAcquireRequestSchema,
12881
12899
  LeaseReleaseRequestSchema,
@@ -12883,7 +12901,9 @@ var init_messages2 = __esm({
12883
12901
  RateCheckRequestSchema,
12884
12902
  ToolGrantRequestSchema,
12885
12903
  QueueAdmitRequestSchema,
12886
- WorkerHeartbeatRequestSchema
12904
+ WorkerHeartbeatRequestSchema,
12905
+ ResourceAdmitRequestSchema,
12906
+ ResourceReleaseRequestSchema
12887
12907
  ]);
12888
12908
  LeaseGrantedResponseSchema = z11.object({
12889
12909
  /** Tag discriminating this response variant. */
@@ -12984,6 +13004,25 @@ var init_messages2 = __esm({
12984
13004
  /** Tag discriminating this response variant. */
12985
13005
  kind: z11.literal("heartbeat_ack")
12986
13006
  }).strict();
13007
+ ResourceAdmitDispositionSchema = z11.enum(["admitted", "deferred"]);
13008
+ ResourceAdmitResultResponseSchema = z11.object({
13009
+ /** Tag discriminating this response variant. */
13010
+ kind: z11.literal("resource_admit_result"),
13011
+ /** Whether the heavy op was admitted or deferred. */
13012
+ disposition: ResourceAdmitDispositionSchema,
13013
+ /** Back-off in ms before re-requesting (0 when admitted). */
13014
+ retry_after_ms: z11.number().int().nonnegative(),
13015
+ /** Remaining slots for the class after this decision. */
13016
+ slots_remaining: z11.number().int().nonnegative()
13017
+ }).strict();
13018
+ ResourceReleaseResultResponseSchema = z11.object({
13019
+ /** Tag discriminating this response variant. */
13020
+ kind: z11.literal("resource_release_result"),
13021
+ /** Whether a held slot was actually released (false = no such holder). */
13022
+ released: z11.boolean(),
13023
+ /** Remaining in-flight holders for the class after the release. */
13024
+ slots_remaining: z11.number().int().nonnegative()
13025
+ }).strict();
12987
13026
  LeaseErrorResponseSchema = z11.object({
12988
13027
  /** Tag discriminating this response variant. */
12989
13028
  kind: z11.literal("error"),
@@ -13002,6 +13041,8 @@ var init_messages2 = __esm({
13002
13041
  ChildKilledUnresponsiveResponseSchema,
13003
13042
  QueueAdmitResultResponseSchema,
13004
13043
  HeartbeatAckResponseSchema,
13044
+ ResourceAdmitResultResponseSchema,
13045
+ ResourceReleaseResultResponseSchema,
13005
13046
  LeaseErrorResponseSchema
13006
13047
  ]);
13007
13048
  LeaseIpcRequestEnvelopeSchema = z11.object({
@@ -13035,7 +13076,9 @@ var init_messages2 = __esm({
13035
13076
  "rate_check",
13036
13077
  "tool_grant",
13037
13078
  "queue_admit",
13038
- "worker_heartbeat"
13079
+ "worker_heartbeat",
13080
+ "resource_admit",
13081
+ "resource_release"
13039
13082
  ];
13040
13083
  LEASE_IPC_RESPONSE_KINDS = [
13041
13084
  "lease_granted",
@@ -13047,6 +13090,8 @@ var init_messages2 = __esm({
13047
13090
  "child_killed_unresponsive",
13048
13091
  "queue_admit_result",
13049
13092
  "heartbeat_ack",
13093
+ "resource_admit_result",
13094
+ "resource_release_result",
13050
13095
  "error"
13051
13096
  ];
13052
13097
  LEASE_IPC_MESSAGE_KINDS = [
@@ -14217,6 +14262,24 @@ var init_render = __esm({
14217
14262
  }
14218
14263
  });
14219
14264
 
14265
+ // packages/contracts/src/resource-governor.ts
14266
+ var RESOURCE_CLASSES;
14267
+ var init_resource_governor = __esm({
14268
+ "packages/contracts/src/resource-governor.ts"() {
14269
+ "use strict";
14270
+ RESOURCE_CLASSES = Object.freeze([
14271
+ "interactive-cli",
14272
+ "agent-session",
14273
+ "llm-call",
14274
+ "test-run",
14275
+ "scoped-build",
14276
+ "full-build",
14277
+ "db-heavy",
14278
+ "background-autonomous"
14279
+ ]);
14280
+ }
14281
+ });
14282
+
14220
14283
  // packages/contracts/src/session.ts
14221
14284
  var init_session2 = __esm({
14222
14285
  "packages/contracts/src/session.ts"() {
@@ -15967,6 +16030,7 @@ var init_src = __esm({
15967
16030
  init_evidence_atoms();
15968
16031
  init_plan();
15969
16032
  init_render();
16033
+ init_resource_governor();
15970
16034
  init_session2();
15971
16035
  init_session_journal();
15972
16036
  init_status_registry();