@cleocode/contracts 2026.9.22 → 2026.9.24

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 (102) hide show
  1. package/dist/__tests__/evidence-atom-schema.test.js +3 -2
  2. package/dist/__tests__/evidence-atom-schema.test.js.map +1 -1
  3. package/dist/acceptance-gate-schema.d.ts.map +1 -1
  4. package/dist/acceptance-gate-schema.js +4 -1
  5. package/dist/acceptance-gate-schema.js.map +1 -1
  6. package/dist/branch-lock.d.ts +9 -0
  7. package/dist/branch-lock.d.ts.map +1 -1
  8. package/dist/branch-lock.js +25 -3
  9. package/dist/branch-lock.js.map +1 -1
  10. package/dist/cloud/api.d.ts +1 -1
  11. package/dist/data-accessor.d.ts +209 -16
  12. package/dist/data-accessor.d.ts.map +1 -1
  13. package/dist/data-accessor.js.map +1 -1
  14. package/dist/decide-sites.d.ts +157 -0
  15. package/dist/decide-sites.d.ts.map +1 -0
  16. package/dist/decide-sites.js +28 -0
  17. package/dist/decide-sites.js.map +1 -0
  18. package/dist/decide.d.ts +214 -0
  19. package/dist/decide.d.ts.map +1 -1
  20. package/dist/decide.js +54 -0
  21. package/dist/decide.js.map +1 -1
  22. package/dist/dispatch/operations-registry.d.ts.map +1 -1
  23. package/dist/dispatch/operations-registry.js +174 -8
  24. package/dist/dispatch/operations-registry.js.map +1 -1
  25. package/dist/doctor.d.ts +9 -0
  26. package/dist/doctor.d.ts.map +1 -1
  27. package/dist/evidence-atom-schema.d.ts.map +1 -1
  28. package/dist/evidence-atom-schema.js +3 -0
  29. package/dist/evidence-atom-schema.js.map +1 -1
  30. package/dist/exit-codes.d.ts +7 -0
  31. package/dist/exit-codes.d.ts.map +1 -1
  32. package/dist/exit-codes.js +7 -0
  33. package/dist/exit-codes.js.map +1 -1
  34. package/dist/index.d.ts +12 -7
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +4 -1
  37. package/dist/index.js.map +1 -1
  38. package/dist/knowledge-health.d.ts +21 -0
  39. package/dist/knowledge-health.d.ts.map +1 -1
  40. package/dist/nexus-account.d.ts +160 -0
  41. package/dist/nexus-account.d.ts.map +1 -0
  42. package/dist/nexus-account.js +68 -0
  43. package/dist/nexus-account.js.map +1 -0
  44. package/dist/operations/admin.d.ts +5 -0
  45. package/dist/operations/admin.d.ts.map +1 -1
  46. package/dist/operations/focus.d.ts +7 -3
  47. package/dist/operations/focus.d.ts.map +1 -1
  48. package/dist/operations/nexus-scope-map.d.ts +8 -0
  49. package/dist/operations/nexus-scope-map.d.ts.map +1 -1
  50. package/dist/operations/nexus-scope-map.js +8 -0
  51. package/dist/operations/nexus-scope-map.js.map +1 -1
  52. package/dist/operations/nexus.d.ts +265 -0
  53. package/dist/operations/nexus.d.ts.map +1 -1
  54. package/dist/operations/nexus.js +9 -1
  55. package/dist/operations/nexus.js.map +1 -1
  56. package/dist/operations/orchestrate.d.ts +6 -1
  57. package/dist/operations/orchestrate.d.ts.map +1 -1
  58. package/dist/operations/output-contracts-data.d.ts.map +1 -1
  59. package/dist/operations/output-contracts-data.js +115 -1
  60. package/dist/operations/output-contracts-data.js.map +1 -1
  61. package/dist/operations/tasks.d.ts +97 -9
  62. package/dist/operations/tasks.d.ts.map +1 -1
  63. package/dist/operations/tasks.js.map +1 -1
  64. package/dist/project-lifecycle.d.ts +6 -2
  65. package/dist/project-lifecycle.d.ts.map +1 -1
  66. package/dist/session.d.ts +19 -1
  67. package/dist/session.d.ts.map +1 -1
  68. package/dist/session.js +9 -2
  69. package/dist/session.js.map +1 -1
  70. package/dist/task.d.ts +49 -1
  71. package/dist/task.d.ts.map +1 -1
  72. package/dist/tools/index.d.ts +1 -1
  73. package/dist/tools/index.d.ts.map +1 -1
  74. package/dist/tools/score-task-priority.d.ts +28 -3
  75. package/dist/tools/score-task-priority.d.ts.map +1 -1
  76. package/package.json +2 -2
  77. package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
  78. package/src/__tests__/evidence-atom-schema.test.ts +3 -2
  79. package/src/acceptance-gate-schema.ts +4 -1
  80. package/src/branch-lock.ts +38 -3
  81. package/src/data-accessor.ts +215 -16
  82. package/src/decide-sites.ts +179 -0
  83. package/src/decide.ts +235 -0
  84. package/src/dispatch/operations-registry.ts +183 -8
  85. package/src/doctor.ts +9 -0
  86. package/src/evidence-atom-schema.ts +3 -0
  87. package/src/exit-codes.ts +7 -0
  88. package/src/index.ts +72 -0
  89. package/src/knowledge-health.ts +22 -0
  90. package/src/nexus-account.ts +181 -0
  91. package/src/operations/admin.ts +5 -0
  92. package/src/operations/focus.ts +7 -3
  93. package/src/operations/nexus-scope-map.ts +9 -0
  94. package/src/operations/nexus.ts +281 -0
  95. package/src/operations/orchestrate.ts +6 -2
  96. package/src/operations/output-contracts-data.ts +125 -1
  97. package/src/operations/tasks.ts +104 -12
  98. package/src/project-lifecycle.ts +6 -2
  99. package/src/session.ts +20 -2
  100. package/src/task.ts +51 -1
  101. package/src/tools/index.ts +1 -0
  102. package/src/tools/score-task-priority.ts +29 -3
package/dist/decide.d.ts CHANGED
@@ -119,6 +119,17 @@ export interface DecisionRequest {
119
119
  readonly state: DecisionState;
120
120
  /** Question name → question (1–32 entries). Names key the answers in {@link DecisionOutcome}. */
121
121
  readonly questions: Readonly<Record<string, DecisionQuestion>>;
122
+ /**
123
+ * Language hint (e.g. `en`). Sent only to a provider whose capabilities
124
+ * include `langHint`; others never see it (T12664).
125
+ */
126
+ readonly lang?: string;
127
+ /**
128
+ * Provider-side answer cache. `false` asks a provider with `cacheControl`
129
+ * not to answer from its cache (real latency, sensitive text). Ignored by
130
+ * providers without the capability.
131
+ */
132
+ readonly cache?: boolean;
122
133
  }
123
134
  /** Answer to a {@link NoulDecisionQuestion}. */
124
135
  export interface NoulDecisionAnswer {
@@ -167,13 +178,202 @@ export interface DecisionOutcome {
167
178
  readonly latencyMs: number;
168
179
  /** Provider-reported cost in US dollars, when known. */
169
180
  readonly costUsd?: number;
181
+ /** Provider-reported cost in integer micro-dollars, when known (T12664). */
182
+ readonly costMicros?: number;
183
+ /**
184
+ * Account balance in integer micro-dollars reported with this answer, when
185
+ * known. The Jev wire adapter never sets it (the layahost OpenAPI reports
186
+ * balance only via `GET /v1/usage`, T12715); other providers may.
187
+ */
188
+ readonly balanceMicros?: number;
189
+ /** Provider model checkpoint that answered, when reported. */
190
+ readonly checkpoint?: string;
170
191
  /** Provider-reported input-token count, when known. */
171
192
  readonly inputTokens?: number;
172
193
  }
194
+ /**
195
+ * Every supported decision-provider kind, recommended first.
196
+ *
197
+ * - `layahost` — the hosted provider at {@link LAYAHOST_BASE_URL}; the user
198
+ * supplies only an API key.
199
+ * - `jev` — any other Jev-compatible endpoint; the user supplies the URL.
200
+ */
201
+ export declare const DECISION_PROVIDER_KINDS: readonly ["layahost", "jev"];
202
+ /** A decision-provider kind. See {@link DECISION_PROVIDER_KINDS}. */
203
+ export type DecisionProviderKind = (typeof DECISION_PROVIDER_KINDS)[number];
204
+ /** Base URL of the layahost API (its OpenAPI `servers[0].url`). */
205
+ export declare const LAYAHOST_BASE_URL = "https://layahost.com";
206
+ /**
207
+ * Base URL of Jev's own API (TypeSafe AI). Source: the canonical spec
208
+ * `system-one-integration`, "Provider research: capability map" ("Jev itself
209
+ * (TypeSafe AI, `https://api.typesafe.ai`, OpenAPI v0.2.0)").
210
+ */
211
+ export declare const JEV_DEFAULT_BASE_URL = "https://api.typesafe.ai";
212
+ /** layahost's routing model, the default for a layahost connection. */
213
+ export declare const LAYAHOST_DEFAULT_MODEL = "laya-auto";
214
+ /**
215
+ * A valid profile name: 1-32 characters of lowercase letters, digits and
216
+ * `-`, starting and ending with a letter or digit (e.g. `default`, `work`,
217
+ * `team-b`). A profile is addressed as `<provider>/<name>`, e.g.
218
+ * `layahost/default` or `jev/team`; one provider may hold several profiles
219
+ * (accounts), each with its own key.
220
+ */
221
+ export declare const DECIDE_PROFILE_NAME_PATTERN: RegExp;
222
+ /** The profile name used when none is given: `<provider>/default`. */
223
+ export declare const DECIDE_DEFAULT_PROFILE_NAME = "default";
224
+ /**
225
+ * The stored `baseUrl` of a profile that uses its provider's preset URL. It
226
+ * is resolved when the profile is used, so a changed preset URL flows
227
+ * through to every profile that kept the default.
228
+ */
229
+ export declare const DECIDE_PROFILE_DEFAULT_URL = "default";
230
+ /** How a profile's base URL is set: the provider's preset URL, or an override. */
231
+ export type DecideProfileUrlSource = 'default' | 'override';
232
+ /**
233
+ * Reachability of a decision provider, as `GET /v1/models` reports it.
234
+ *
235
+ * - `reachable` — the listing answered 2xx.
236
+ * - `unauthorized` — the provider rejected the key.
237
+ * - `key_limit_reached` — the key's monthly decision limit is reached.
238
+ * - `unconfigured` — no valid base URL + key stored.
239
+ * - `unreachable` — network failure, timeout, or any other HTTP status.
240
+ */
241
+ export type DecideProviderState = 'reachable' | 'unauthorized' | 'key_limit_reached' | 'unconfigured' | 'unreachable';
242
+ /** Result of probing one profile (`cleo decide profiles --probe`). Secret-free. */
243
+ export interface DecideProfileProbe {
244
+ /** Reachability verdict. */
245
+ readonly state: DecideProviderState;
246
+ /** HTTP status of the probe, when one was received. */
247
+ readonly httpStatus?: number;
248
+ /** Probe latency, ms. */
249
+ readonly latencyMs?: number;
250
+ /** Secret-free explanation, when there is one. */
251
+ readonly detail?: string;
252
+ }
253
+ /** One named System One provider profile, as listed. Carries no key, only its masked preview. */
254
+ export interface DecideProfileSummary {
255
+ /** Profile id, `<provider>/<name>`, e.g. `layahost/work`. */
256
+ readonly id: string;
257
+ /** Profile name within its provider, e.g. `work`. */
258
+ readonly name: string;
259
+ /** Whether everyday decisions use this profile. Exactly one profile is active when any is. */
260
+ readonly active: boolean;
261
+ /** Whether the profile holds an acceptable base URL and a non-blank key. */
262
+ readonly configured: boolean;
263
+ /** Provider kind. */
264
+ readonly provider: DecisionProviderKind;
265
+ /** Resolved base URL (userinfo removed). */
266
+ readonly baseUrl: string;
267
+ /** Whether the URL is the provider's preset (`default`) or an override. */
268
+ readonly urlSource: DecideProfileUrlSource;
269
+ /** Default model, when stored. */
270
+ readonly model?: string;
271
+ /** Masked key preview (`…abcd`). */
272
+ readonly keyPreview: string;
273
+ /** ISO timestamp of the profile's last write, when known. */
274
+ readonly updatedAt?: string;
275
+ /** Reachability, when probed. */
276
+ readonly probe?: DecideProfileProbe;
277
+ }
278
+ /**
279
+ * A profile resolved for use (`resolveDecideProfile`): its id, provider, base
280
+ * URL (a stored `default` already resolved to the preset), plaintext API key
281
+ * and default model. Contains the key: pass it to the wire and never log or
282
+ * emit it. `profile` repeats `name` so the value can be used directly as a
283
+ * decision connection whose provider state is cached per profile.
284
+ */
285
+ export interface DecideProfileConnection {
286
+ /** Profile id, `<provider>/<name>`. */
287
+ readonly name: string;
288
+ /** Same as {@link DecideProfileConnection.name}. */
289
+ readonly profile: string;
290
+ /** Provider kind. */
291
+ readonly provider: DecisionProviderKind;
292
+ /** Resolved base URL. */
293
+ readonly baseUrl: string;
294
+ /** Plaintext API key. SECRET. */
295
+ readonly apiKey: string;
296
+ /** Default model, when stored. */
297
+ readonly model?: string;
298
+ }
299
+ /** Result of listing the System One profiles. Secret-free. */
300
+ export interface DecideProfileListResult {
301
+ /** Absolute path of the credential store. */
302
+ readonly path: string;
303
+ /** Id (`<provider>/<name>`) of the active profile, or `null` when none is configured. */
304
+ readonly active: string | null;
305
+ /** Every stored profile, sorted by id. */
306
+ readonly profiles: readonly DecideProfileSummary[];
307
+ /**
308
+ * True when the top-level settings disagreed with the active profile's
309
+ * entry (an older CLEO rewrote the file) and were taken as authoritative.
310
+ */
311
+ readonly reconciled: boolean;
312
+ }
173
313
  /** Connection settings for a decision provider. */
174
314
  export interface DecisionProviderConfig {
175
315
  /** Absolute base URL of the provider's API (no trailing path to the endpoint). */
176
316
  readonly baseUrl: string;
317
+ /** Provider kind; absent means a custom Jev-compatible endpoint (`jev`). */
318
+ readonly provider?: DecisionProviderKind;
319
+ }
320
+ /**
321
+ * What a decision provider can do beyond the Jev minimum
322
+ * (`POST /v1/systemone`, 32 questions, 32,000-character state). A caller asks
323
+ * for a capability; the client degrades when it is absent (spec
324
+ * `system-one-integration` §2.2).
325
+ */
326
+ export interface DecisionProviderCapabilities {
327
+ /** Wire protocol the provider speaks. */
328
+ readonly wire: string;
329
+ /** Most questions one request may carry. */
330
+ readonly maxQuestionsPerRequest: number;
331
+ /** Largest state, in characters. */
332
+ readonly maxStateChars: number;
333
+ /** Batch endpoint limits, when the provider has one. */
334
+ readonly batch?: {
335
+ readonly maxRequests: number;
336
+ readonly maxQuestions: number;
337
+ };
338
+ /** Built-in template names, when the provider has templates. */
339
+ readonly templates?: readonly string[];
340
+ /** Server-side flows are available. */
341
+ readonly flows?: boolean;
342
+ /** A usage/balance endpoint and cost headers are available. */
343
+ readonly usage?: boolean;
344
+ /** The request's `cache` field is honoured. */
345
+ readonly cacheControl?: boolean;
346
+ /** The request's `lang` field is honoured. */
347
+ readonly langHint?: boolean;
348
+ /** How the provider reports cost. */
349
+ readonly reportsCost?: 'micros' | 'usd' | false;
350
+ }
351
+ /** The Jev minimum every provider supports; the default when a provider reports nothing. */
352
+ export declare const JEV_MINIMUM_CAPABILITIES: DecisionProviderCapabilities;
353
+ /** One item of a batch call: its outcome, or why it failed. */
354
+ export type DecisionBatchItem = {
355
+ readonly ok: true;
356
+ readonly outcome: DecisionOutcome;
357
+ } | {
358
+ readonly ok: false;
359
+ readonly status?: number;
360
+ readonly errorKind: string;
361
+ };
362
+ /** Account usage and balance as a provider reports it. */
363
+ export interface DecisionProviderUsage {
364
+ /** Balance in integer micro-dollars. */
365
+ readonly balanceMicros?: number;
366
+ /** Decisions the balance still covers. */
367
+ readonly decisionsLeft?: number;
368
+ /** Plan name. */
369
+ readonly plan?: string;
370
+ /** End of the current plan period, ISO-8601. */
371
+ readonly periodEnd?: string;
372
+ /** Decisions and cost over the queried window. */
373
+ readonly totals?: {
374
+ readonly decisions?: number;
375
+ readonly costMicros?: number;
376
+ };
177
377
  }
178
378
  /** Zod schema for {@link DecisionQuestionType}. */
179
379
  export declare const decisionQuestionTypeSchema: z.ZodEnum<{
@@ -245,6 +445,8 @@ export declare const decisionQuestionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
245
445
  */
246
446
  export declare const decisionRequestSchema: z.ZodObject<{
247
447
  model: z.ZodOptional<z.ZodString>;
448
+ lang: z.ZodOptional<z.ZodString>;
449
+ cache: z.ZodOptional<z.ZodBoolean>;
248
450
  state: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodJSONSchema>, z.ZodRecord<z.ZodString, z.ZodJSONSchema>]>;
249
451
  questions: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
250
452
  type: z.ZodLiteral<"noul">;
@@ -324,10 +526,22 @@ export declare const decisionOutcomeSchema: z.ZodObject<{
324
526
  requestId: z.ZodOptional<z.ZodString>;
325
527
  latencyMs: z.ZodNumber;
326
528
  costUsd: z.ZodOptional<z.ZodNumber>;
529
+ costMicros: z.ZodOptional<z.ZodNumber>;
530
+ balanceMicros: z.ZodOptional<z.ZodNumber>;
531
+ checkpoint: z.ZodOptional<z.ZodString>;
327
532
  inputTokens: z.ZodOptional<z.ZodNumber>;
328
533
  }, z.core.$strip>;
534
+ /** Zod schema for {@link DecisionProviderKind}. */
535
+ export declare const decisionProviderKindSchema: z.ZodEnum<{
536
+ layahost: "layahost";
537
+ jev: "jev";
538
+ }>;
329
539
  /** Zod schema for {@link DecisionProviderConfig}; `baseUrl` must be an absolute URL. */
330
540
  export declare const decisionProviderConfigSchema: z.ZodObject<{
331
541
  baseUrl: z.ZodURL;
542
+ provider: z.ZodOptional<z.ZodEnum<{
543
+ layahost: "layahost";
544
+ jev: "jev";
545
+ }>>;
332
546
  }, z.core.$strip>;
333
547
  //# sourceMappingURL=decide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decide.d.ts","sourceRoot":"","sources":["../src/decide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK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H,iEAAiE;AACjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;2BAI/B,CAAC;AAEH,wFAAwF;AACxF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAUhC,CAAC;AAEH,mDAAmD;AACnD,eAAO,MAAM,0BAA0B;;;EAAkC,CAAC;AAE1E,wFAAwF;AACxF,eAAO,MAAM,4BAA4B;;;;;;iBAGvC,CAAC"}
package/dist/decide.js CHANGED
@@ -55,6 +55,49 @@ export const DECISION_REQUEST_LIMITS = {
55
55
  /** Maximum number of levels on a `score` question's scale. */
56
56
  maxScoreLevels: 10,
57
57
  };
58
+ // ─── Provider kinds (T12713) ─────────────────────────────────────────────────
59
+ /**
60
+ * Every supported decision-provider kind, recommended first.
61
+ *
62
+ * - `layahost` — the hosted provider at {@link LAYAHOST_BASE_URL}; the user
63
+ * supplies only an API key.
64
+ * - `jev` — any other Jev-compatible endpoint; the user supplies the URL.
65
+ */
66
+ export const DECISION_PROVIDER_KINDS = ['layahost', 'jev'];
67
+ /** Base URL of the layahost API (its OpenAPI `servers[0].url`). */
68
+ export const LAYAHOST_BASE_URL = 'https://layahost.com';
69
+ /**
70
+ * Base URL of Jev's own API (TypeSafe AI). Source: the canonical spec
71
+ * `system-one-integration`, "Provider research: capability map" ("Jev itself
72
+ * (TypeSafe AI, `https://api.typesafe.ai`, OpenAPI v0.2.0)").
73
+ */
74
+ export const JEV_DEFAULT_BASE_URL = 'https://api.typesafe.ai';
75
+ /** layahost's routing model, the default for a layahost connection. */
76
+ export const LAYAHOST_DEFAULT_MODEL = 'laya-auto';
77
+ // ─── Named provider profiles (T12733) ────────────────────────────────────────
78
+ /**
79
+ * A valid profile name: 1-32 characters of lowercase letters, digits and
80
+ * `-`, starting and ending with a letter or digit (e.g. `default`, `work`,
81
+ * `team-b`). A profile is addressed as `<provider>/<name>`, e.g.
82
+ * `layahost/default` or `jev/team`; one provider may hold several profiles
83
+ * (accounts), each with its own key.
84
+ */
85
+ export const DECIDE_PROFILE_NAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$/;
86
+ /** The profile name used when none is given: `<provider>/default`. */
87
+ export const DECIDE_DEFAULT_PROFILE_NAME = 'default';
88
+ /**
89
+ * The stored `baseUrl` of a profile that uses its provider's preset URL. It
90
+ * is resolved when the profile is used, so a changed preset URL flows
91
+ * through to every profile that kept the default.
92
+ */
93
+ export const DECIDE_PROFILE_DEFAULT_URL = 'default';
94
+ /** The Jev minimum every provider supports; the default when a provider reports nothing. */
95
+ export const JEV_MINIMUM_CAPABILITIES = {
96
+ wire: 'jev-systemone/1',
97
+ maxQuestionsPerRequest: 32,
98
+ maxStateChars: 32_000,
99
+ reportsCost: 'usd',
100
+ };
58
101
  // ─── Zod schemas ──────────────────────────────────────────────────────────────
59
102
  /** Zod schema for {@link DecisionQuestionType}. */
60
103
  export const decisionQuestionTypeSchema = z.enum(DECISION_QUESTION_TYPES);
@@ -129,6 +172,11 @@ export const decisionQuestionSchema = z.discriminatedUnion('type', [
129
172
  */
130
173
  export const decisionRequestSchema = z.object({
131
174
  model: z.string().min(1).optional(),
175
+ lang: z
176
+ .string()
177
+ .regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})?$/)
178
+ .optional(),
179
+ cache: z.boolean().optional(),
132
180
  state: decisionStateSchema,
133
181
  questions: z.record(z.string().min(1), decisionQuestionSchema).refine((questions) => {
134
182
  const count = Object.keys(questions).length;
@@ -175,10 +223,16 @@ export const decisionOutcomeSchema = z.object({
175
223
  requestId: z.string().min(1).optional(),
176
224
  latencyMs: z.number().nonnegative(),
177
225
  costUsd: z.number().nonnegative().optional(),
226
+ costMicros: z.number().int().nonnegative().optional(),
227
+ balanceMicros: z.number().int().optional(),
228
+ checkpoint: z.string().min(1).optional(),
178
229
  inputTokens: z.number().int().nonnegative().optional(),
179
230
  });
231
+ /** Zod schema for {@link DecisionProviderKind}. */
232
+ export const decisionProviderKindSchema = z.enum(DECISION_PROVIDER_KINDS);
180
233
  /** Zod schema for {@link DecisionProviderConfig}; `baseUrl` must be an absolute URL. */
181
234
  export const decisionProviderConfigSchema = z.object({
182
235
  baseUrl: z.url(),
236
+ provider: decisionProviderKindSchema.optional(),
183
237
  });
184
238
  //# sourceMappingURL=decide.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decide.js","sourceRoot":"","sources":["../src/decide.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iFAAiF;AAEjF,mEAAmE;AACnE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAEnF;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC;;;;OAIG;IACH,aAAa,EAAE,MAAM;IACrB,kDAAkD;IAClD,YAAY,EAAE,CAAC;IACf,kDAAkD;IAClD,YAAY,EAAE,EAAE;IAChB,gEAAgE;IAChE,gBAAgB,EAAE,CAAC;IACnB,8DAA8D;IAC9D,cAAc,EAAE,CAAC;IACjB,8DAA8D;IAC9D,cAAc,EAAE,EAAE;CACV,CAAC;AAmJX,iFAAiF;AAEjF,mDAAmD;AACnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;AAE1E,oDAAoD;AACpD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AAE5E,mDAAmD;AACnD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,M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AAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAeD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EAk7UpC,CAAC"}
1
+ {"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAeD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EAimVpC,CAAC"}
@@ -790,12 +790,21 @@ export const OPERATIONS = [
790
790
  gateway: 'query',
791
791
  domain: 'tasks',
792
792
  operation: 'history',
793
- description: 'Show task work history (time tracked per task)',
793
+ description: 'Show task work history; with taskId, the task audit trail; with ranking, who changed its priority/severity/kind/depends and why (T12693)',
794
794
  tier: 1,
795
795
  idempotent: true,
796
796
  sessionRequired: false,
797
797
  requiredParams: [],
798
- params: [],
798
+ params: [
799
+ { name: 'taskId', type: 'string', required: false, description: 'Task to show history for' },
800
+ { name: 'limit', type: 'number', required: false, description: 'Maximum entries' },
801
+ {
802
+ name: 'ranking',
803
+ type: 'boolean',
804
+ required: false,
805
+ description: 'Only ranking-input changes (actor, session, reason, before/after)',
806
+ },
807
+ ],
799
808
  },
800
809
  {
801
810
  gateway: 'query',
@@ -2995,6 +3004,13 @@ export const OPERATIONS = [
2995
3004
  description: 'taskId parameter',
2996
3005
  cli: { positional: true },
2997
3006
  },
3007
+ {
3008
+ name: 'expectedUpdatedAt',
3009
+ type: 'string',
3010
+ required: false,
3011
+ description: 'Optimistic-concurrency guard: fail with E_CONFLICT unless the task updatedAt still equals this value',
3012
+ cli: { flag: 'if-match' },
3013
+ },
2998
3014
  ],
2999
3015
  },
3000
3016
  {
@@ -3290,6 +3306,32 @@ export const OPERATIONS = [
3290
3306
  ],
3291
3307
  outputSchema: OUTPUT_CONTRACTS['tasks.assignee'],
3292
3308
  },
3309
+ {
3310
+ gateway: 'mutate',
3311
+ domain: 'tasks',
3312
+ operation: 'ranking.revert',
3313
+ description: 'tasks.ranking.revert (mutate) — undo one recorded ranking change (priority/severity/kind/depends) as a new audited change (T12693, D11161)',
3314
+ tier: 1,
3315
+ idempotent: false,
3316
+ sessionRequired: false,
3317
+ requiredParams: ['entryId'],
3318
+ params: [
3319
+ {
3320
+ name: 'entryId',
3321
+ type: 'string',
3322
+ required: true,
3323
+ description: 'ranking_changed audit row id (cleo history ranking <taskId>)',
3324
+ cli: { positional: true },
3325
+ },
3326
+ { name: 'reason', type: 'string', required: false, description: 'Why it is reverted' },
3327
+ {
3328
+ name: 'force',
3329
+ type: 'boolean',
3330
+ required: false,
3331
+ description: 'Revert even though a field changed again since',
3332
+ },
3333
+ ],
3334
+ },
3293
3335
  {
3294
3336
  gateway: 'mutate',
3295
3337
  domain: 'tasks',
@@ -3628,7 +3670,7 @@ export const OPERATIONS = [
3628
3670
  gateway: 'mutate',
3629
3671
  domain: 'tasks',
3630
3672
  operation: 'start',
3631
- description: 'tasks.start (mutate)',
3673
+ description: "tasks.start (mutate) — start work and take the caller session's leased claim (E_TASK_CLAIMED when another session holds it)",
3632
3674
  tier: 0,
3633
3675
  idempotent: false,
3634
3676
  sessionRequired: false,
@@ -3641,6 +3683,20 @@ export const OPERATIONS = [
3641
3683
  description: 'taskId parameter',
3642
3684
  cli: { positional: true },
3643
3685
  },
3686
+ {
3687
+ name: 'takeOver',
3688
+ type: 'boolean',
3689
+ required: false,
3690
+ description: "Take over another session's EXPIRED claim lease (audited)",
3691
+ cli: { flag: 'take-over' },
3692
+ },
3693
+ {
3694
+ name: 'forceClaim',
3695
+ type: 'boolean',
3696
+ required: false,
3697
+ description: "Take over another session's LIVE claim lease (audited)",
3698
+ cli: { flag: 'force-claim' },
3699
+ },
3644
3700
  ],
3645
3701
  },
3646
3702
  {
@@ -3749,11 +3805,11 @@ export const OPERATIONS = [
3749
3805
  gateway: 'mutate',
3750
3806
  domain: 'tasks',
3751
3807
  operation: 'claim',
3752
- description: 'tasks.claim (mutate) — claim a task by assigning it to the current session',
3808
+ description: "tasks.claim (mutate) — take, renew or override the caller session's leased claim on a task (never the human assignee)",
3753
3809
  tier: 0,
3754
3810
  idempotent: false,
3755
3811
  sessionRequired: true,
3756
- requiredParams: ['taskId', 'agentId'],
3812
+ requiredParams: ['taskId'],
3757
3813
  params: [
3758
3814
  {
3759
3815
  name: 'taskId',
@@ -3764,8 +3820,26 @@ export const OPERATIONS = [
3764
3820
  {
3765
3821
  name: 'agentId',
3766
3822
  type: 'string',
3767
- required: true,
3768
- description: 'Agent ID to assign the task to',
3823
+ required: false,
3824
+ description: "Agent ID recorded with the lease (default: the session's agent / CLEO_AGENT_ID)",
3825
+ },
3826
+ {
3827
+ name: 'renew',
3828
+ type: 'boolean',
3829
+ required: false,
3830
+ description: "Renew the caller's own lease",
3831
+ },
3832
+ {
3833
+ name: 'takeOver',
3834
+ type: 'boolean',
3835
+ required: false,
3836
+ description: "Take over another session's EXPIRED lease (audited)",
3837
+ },
3838
+ {
3839
+ name: 'forceClaim',
3840
+ type: 'boolean',
3841
+ required: false,
3842
+ description: "Take over another session's LIVE lease (audited)",
3769
3843
  },
3770
3844
  ],
3771
3845
  },
@@ -3773,7 +3847,7 @@ export const OPERATIONS = [
3773
3847
  gateway: 'mutate',
3774
3848
  domain: 'tasks',
3775
3849
  operation: 'unclaim',
3776
- description: 'tasks.unclaim (mutate) — unclaim a task by removing the current assignee',
3850
+ description: "tasks.unclaim (mutate) — release the caller session's claim lease (never the human assignee)",
3777
3851
  tier: 0,
3778
3852
  idempotent: false,
3779
3853
  sessionRequired: true,
@@ -3785,6 +3859,12 @@ export const OPERATIONS = [
3785
3859
  required: true,
3786
3860
  description: 'Task ID to unclaim',
3787
3861
  },
3862
+ {
3863
+ name: 'forceClaim',
3864
+ type: 'boolean',
3865
+ required: false,
3866
+ description: "Release another session's lease (audited)",
3867
+ },
3788
3868
  ],
3789
3869
  },
3790
3870
  {
@@ -4039,6 +4119,20 @@ export const OPERATIONS = [
4039
4119
  required: false,
4040
4120
  description: 'When true (default), adds toTaskId as a dependency on fromTaskId so it cannot complete before the pivot resolves',
4041
4121
  },
4122
+ {
4123
+ name: 'takeOver',
4124
+ type: 'boolean',
4125
+ required: false,
4126
+ description: "Take over another session's EXPIRED claim on toTaskId (audited)",
4127
+ cli: { flag: 'take-over' },
4128
+ },
4129
+ {
4130
+ name: 'forceClaim',
4131
+ type: 'boolean',
4132
+ required: false,
4133
+ description: "Take over another session's LIVE claim on toTaskId (audited)",
4134
+ cli: { flag: 'force-claim' },
4135
+ },
4042
4136
  ],
4043
4137
  },
4044
4138
  // parallel.start and parallel.end merged into orchestrate.parallel via action param (T5615)
@@ -6682,6 +6776,78 @@ export const OPERATIONS = [
6682
6776
  requiredParams: [],
6683
6777
  params: [],
6684
6778
  },
6779
+ {
6780
+ gateway: 'query',
6781
+ domain: 'nexus',
6782
+ operation: 'projects.fleet',
6783
+ description: 'nexus.projects.fleet (query) — fleet view: every project with its location on each device, last recorded git state (local, and remote as of the last fetch) and staleness; paged, counts first, read-only',
6784
+ tier: 1,
6785
+ idempotent: true,
6786
+ sessionRequired: false,
6787
+ requiredParams: [],
6788
+ params: [
6789
+ {
6790
+ name: 'device',
6791
+ type: 'string',
6792
+ required: false,
6793
+ description: 'Only locations on this device (device id, hostname, or current)',
6794
+ },
6795
+ {
6796
+ name: 'missing',
6797
+ type: 'boolean',
6798
+ required: false,
6799
+ description: 'Only projects with a missing location',
6800
+ },
6801
+ {
6802
+ name: 'dirty',
6803
+ type: 'boolean',
6804
+ required: false,
6805
+ description: 'Only projects with a dirty location',
6806
+ },
6807
+ {
6808
+ name: 'behind',
6809
+ type: 'boolean',
6810
+ required: false,
6811
+ description: 'Only projects with a location behind its upstream (as of the last fetch)',
6812
+ },
6813
+ {
6814
+ name: 'ahead',
6815
+ type: 'boolean',
6816
+ required: false,
6817
+ description: 'Only projects with a location ahead of its upstream (as of the last fetch)',
6818
+ },
6819
+ {
6820
+ name: 'stale',
6821
+ type: 'boolean',
6822
+ required: false,
6823
+ description: 'Only projects with a never-probed, old-probe or old-fetch location',
6824
+ },
6825
+ {
6826
+ name: 'errored',
6827
+ type: 'boolean',
6828
+ required: false,
6829
+ description: 'Only projects whose last probe recorded an error',
6830
+ },
6831
+ {
6832
+ name: 'staleAfterMs',
6833
+ type: 'number',
6834
+ required: false,
6835
+ description: 'Staleness window for probes, fetches and heartbeats (default 24h)',
6836
+ },
6837
+ {
6838
+ name: 'limit',
6839
+ type: 'number',
6840
+ required: false,
6841
+ description: 'Page size in projects (default 50, max 500; 0 = all)',
6842
+ },
6843
+ {
6844
+ name: 'offset',
6845
+ type: 'number',
6846
+ required: false,
6847
+ description: 'Projects skipped before the page',
6848
+ },
6849
+ ],
6850
+ },
6685
6851
  {
6686
6852
  gateway: 'mutate',
6687
6853
  domain: 'nexus',