@cleocode/contracts 2026.4.99 → 2026.4.101

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 (90) hide show
  1. package/dist/brain-graph.d.ts +245 -0
  2. package/dist/brain-graph.d.ts.map +1 -0
  3. package/dist/brain-graph.js +30 -0
  4. package/dist/brain-graph.js.map +1 -0
  5. package/dist/exit-codes.d.ts +1 -1
  6. package/dist/exit-codes.d.ts.map +1 -1
  7. package/dist/exit-codes.js +1 -1
  8. package/dist/exit-codes.js.map +1 -1
  9. package/dist/graph.d.ts +2 -0
  10. package/dist/graph.d.ts.map +1 -1
  11. package/dist/index.d.ts +8 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js.map +1 -1
  14. package/dist/nexus-contract-ops.d.ts +186 -0
  15. package/dist/nexus-contract-ops.d.ts.map +1 -0
  16. package/dist/nexus-contract-ops.js +11 -0
  17. package/dist/nexus-contract-ops.js.map +1 -0
  18. package/dist/nexus-living-brain-ops.d.ts +314 -0
  19. package/dist/nexus-living-brain-ops.d.ts.map +1 -0
  20. package/dist/nexus-living-brain-ops.js +15 -0
  21. package/dist/nexus-living-brain-ops.js.map +1 -0
  22. package/dist/nexus-query-ops.d.ts +82 -0
  23. package/dist/nexus-query-ops.d.ts.map +1 -0
  24. package/dist/nexus-query-ops.js +11 -0
  25. package/dist/nexus-query-ops.js.map +1 -0
  26. package/dist/nexus-route-ops.d.ts +103 -0
  27. package/dist/nexus-route-ops.d.ts.map +1 -0
  28. package/dist/nexus-route-ops.js +10 -0
  29. package/dist/nexus-route-ops.js.map +1 -0
  30. package/dist/nexus-tasks-bridge-ops.d.ts +68 -0
  31. package/dist/nexus-tasks-bridge-ops.d.ts.map +1 -0
  32. package/dist/nexus-tasks-bridge-ops.js +11 -0
  33. package/dist/nexus-tasks-bridge-ops.js.map +1 -0
  34. package/dist/nexus-wiki-ops.d.ts +51 -0
  35. package/dist/nexus-wiki-ops.d.ts.map +1 -0
  36. package/dist/nexus-wiki-ops.js +11 -0
  37. package/dist/nexus-wiki-ops.js.map +1 -0
  38. package/dist/operations/admin.d.ts +1781 -0
  39. package/dist/operations/admin.d.ts.map +1 -0
  40. package/dist/operations/admin.js +27 -0
  41. package/dist/operations/admin.js.map +1 -0
  42. package/dist/operations/brain.d.ts +34 -26
  43. package/dist/operations/brain.d.ts.map +1 -1
  44. package/dist/operations/brain.js +7 -6
  45. package/dist/operations/brain.js.map +1 -1
  46. package/dist/operations/docs.d.ts +279 -0
  47. package/dist/operations/docs.d.ts.map +1 -0
  48. package/dist/operations/docs.js +31 -0
  49. package/dist/operations/docs.js.map +1 -0
  50. package/dist/operations/intelligence.d.ts +319 -0
  51. package/dist/operations/intelligence.d.ts.map +1 -0
  52. package/dist/operations/intelligence.js +24 -0
  53. package/dist/operations/intelligence.js.map +1 -0
  54. package/dist/operations/orchestrate.d.ts +113 -2
  55. package/dist/operations/orchestrate.d.ts.map +1 -1
  56. package/dist/operations/orchestrate.js +3 -2
  57. package/dist/operations/orchestrate.js.map +1 -1
  58. package/dist/operations/session.d.ts +185 -47
  59. package/dist/operations/session.d.ts.map +1 -1
  60. package/dist/operations/session.js +7 -6
  61. package/dist/operations/session.js.map +1 -1
  62. package/dist/operations/sticky.d.ts +264 -0
  63. package/dist/operations/sticky.d.ts.map +1 -0
  64. package/dist/operations/sticky.js +19 -0
  65. package/dist/operations/sticky.js.map +1 -0
  66. package/dist/operations/validate.d.ts +145 -19
  67. package/dist/operations/validate.d.ts.map +1 -1
  68. package/dist/operations/validate.js +3 -3
  69. package/dist/task-record.d.ts +19 -0
  70. package/dist/task-record.d.ts.map +1 -1
  71. package/package.json +41 -1
  72. package/src/brain-graph.ts +282 -0
  73. package/src/exit-codes.ts +1 -1
  74. package/src/graph.ts +2 -0
  75. package/src/index.ts +109 -0
  76. package/src/nexus-contract-ops.ts +244 -0
  77. package/src/nexus-living-brain-ops.ts +345 -0
  78. package/src/nexus-query-ops.ts +100 -0
  79. package/src/nexus-route-ops.ts +134 -0
  80. package/src/nexus-tasks-bridge-ops.ts +71 -0
  81. package/src/nexus-wiki-ops.ts +53 -0
  82. package/src/operations/admin.ts +2087 -0
  83. package/src/operations/brain.ts +34 -26
  84. package/src/operations/docs.ts +322 -0
  85. package/src/operations/intelligence.ts +399 -0
  86. package/src/operations/orchestrate.ts +117 -2
  87. package/src/operations/session.ts +217 -48
  88. package/src/operations/sticky.ts +308 -0
  89. package/src/operations/validate.ts +161 -55
  90. package/src/task-record.ts +19 -0
@@ -0,0 +1,1781 @@
1
+ /**
2
+ * Admin Domain Operations Contract (46 operations)
3
+ *
4
+ * Query operations: 24
5
+ * version, health (query), config.show, config.presets, stats, context,
6
+ * context.pull, runtime, paths, job (status + list via action param),
7
+ * dash, log, sequence, help, token (summary + list + show via action param),
8
+ * adr.find, adr.show, backup (list), export, map (query), roadmap, smoke,
9
+ * smoke.provider, hooks.matrix
10
+ *
11
+ * Mutate operations: 19
12
+ * init, scaffold-hub, health (repair/diagnose via mode param),
13
+ * config.set, config.set-preset, backup (create + restore + restore.file
14
+ * via action param), migrate, cleanup, job.cancel, safestop,
15
+ * inject.generate, adr.sync, import, detect, token (record + delete + clear
16
+ * via action param), context.inject, map (mutate), install.global
17
+ *
18
+ * SYNC: Implementation lives in packages/cleo/src/dispatch/domains/admin.ts.
19
+ * Typed via TypedDomainHandler<AdminOps> once the T983 migration lands.
20
+ * This is the largest domain — 107 type-cast sites targeted for removal.
21
+ *
22
+ * @task T1035
23
+ * @task T983 — TypedDomainHandler migration
24
+ * @see packages/cleo/src/dispatch/domains/admin.ts
25
+ */
26
+ /**
27
+ * Known transport categories for token recording.
28
+ * Mirrors `TokenTransport` from `@cleocode/core`.
29
+ */
30
+ export type AdminTokenTransport = 'cli' | 'api' | 'agent' | 'unknown';
31
+ /**
32
+ * Token measurement method classification.
33
+ * Mirrors `TokenMethod` from `@cleocode/core`.
34
+ */
35
+ export type AdminTokenMethod = 'otel' | 'provider_api' | 'tokenizer' | 'heuristic';
36
+ /**
37
+ * Token measurement confidence level.
38
+ * Mirrors `TokenConfidence` from `@cleocode/core`.
39
+ */
40
+ export type AdminTokenConfidence = 'real' | 'high' | 'estimated' | 'coarse';
41
+ /**
42
+ * Export scope selector for the unified `admin.export` operation.
43
+ * - `undefined` / default — standard task CSV/JSON export
44
+ * - `"snapshot"` — full project snapshot
45
+ * - `"tasks"` — portable cross-project task package
46
+ */
47
+ export type AdminExportScope = 'snapshot' | 'tasks' | undefined;
48
+ /**
49
+ * Import scope selector for the unified `admin.import` operation.
50
+ * - `undefined` / default — standard task import from file
51
+ * - `"snapshot"` — full project snapshot restore
52
+ * - `"tasks"` — portable cross-project task package import
53
+ */
54
+ export type AdminImportScope = 'snapshot' | 'tasks' | undefined;
55
+ /**
56
+ * Backup action discriminator for the unified `admin.backup` mutate operation.
57
+ * - `undefined` / default — create a new backup
58
+ * - `"restore"` — restore by backup ID
59
+ * - `"restore.file"` — restore from an arbitrary backup file path
60
+ */
61
+ export type AdminBackupAction = 'restore' | 'restore.file' | undefined;
62
+ /**
63
+ * ADR status filter values.
64
+ */
65
+ export type AdminAdrStatus = 'proposed' | 'accepted' | 'superseded' | 'deprecated';
66
+ /**
67
+ * Strictness preset identifiers.
68
+ */
69
+ export type AdminStrictnessPreset = 'strict' | 'standard' | 'minimal';
70
+ /**
71
+ * Spawn implementation classification for a provider adapter.
72
+ */
73
+ export type AdminSpawnStatus = 'yes' | 'stub' | 'no';
74
+ /**
75
+ * A single backup entry (from backup list).
76
+ */
77
+ export interface AdminBackupEntry {
78
+ /** Unique backup identifier (timestamped). */
79
+ backupId: string;
80
+ /** Backup category (`snapshot`, `safety`, `migration`). */
81
+ type: string;
82
+ /** ISO-8601 timestamp when the backup was created. */
83
+ timestamp: string;
84
+ /** Optional human-readable note attached at creation time. */
85
+ note?: string;
86
+ /** File names captured in this backup. */
87
+ files: string[];
88
+ }
89
+ /**
90
+ * A single entry in the operation log.
91
+ */
92
+ export interface AdminLogEntry {
93
+ /** Operation name. */
94
+ operation: string;
95
+ /** Task ID if applicable. */
96
+ taskId?: string;
97
+ /** ISO-8601 timestamp. */
98
+ timestamp: string;
99
+ /** Additional log fields (varies by operation). */
100
+ [key: string]: unknown;
101
+ }
102
+ /**
103
+ * Pagination metadata companion for log/token list results.
104
+ */
105
+ export interface AdminPagination {
106
+ /** Total matching entries. */
107
+ total: number;
108
+ /** Current offset. */
109
+ offset: number;
110
+ /** Page size limit. */
111
+ limit: number;
112
+ /** Whether more entries exist beyond this page. */
113
+ hasMore: boolean;
114
+ }
115
+ /**
116
+ * A single health check result.
117
+ */
118
+ export interface AdminHealthCheck {
119
+ /** Check identifier. */
120
+ name: string;
121
+ /** Pass/warn/fail outcome. */
122
+ status: 'pass' | 'warn' | 'fail';
123
+ /** Human-readable message. */
124
+ message?: string;
125
+ }
126
+ /**
127
+ * A single doctor check result.
128
+ */
129
+ export interface AdminDoctorCheck {
130
+ /** Check name. */
131
+ check: string;
132
+ /** Outcome. */
133
+ status: 'ok' | 'error' | 'warning';
134
+ /** Human-readable message. */
135
+ message: string;
136
+ /** Additional check-specific data. */
137
+ details?: Record<string, unknown>;
138
+ /** Suggested fix command. */
139
+ fix?: string;
140
+ }
141
+ /**
142
+ * An individual token usage record (from `admin.token` list/show).
143
+ */
144
+ export interface AdminTokenRecord {
145
+ /** Record identifier. */
146
+ id: string;
147
+ /** Provider name. */
148
+ provider?: string;
149
+ /** Model name. */
150
+ model?: string;
151
+ /** Transport category. */
152
+ transport?: AdminTokenTransport;
153
+ /** Gateway identifier. */
154
+ gateway?: string;
155
+ /** Domain the call was made from. */
156
+ domain?: string;
157
+ /** Operation name within the domain. */
158
+ operation?: string;
159
+ /** Session ID, if captured. */
160
+ sessionId?: string;
161
+ /** Task ID, if captured. */
162
+ taskId?: string;
163
+ /** Request ID, if captured. */
164
+ requestId?: string;
165
+ /** Input tokens consumed. */
166
+ inputTokens?: number;
167
+ /** Output tokens produced. */
168
+ outputTokens?: number;
169
+ /** Total tokens (input + output). */
170
+ totalTokens?: number;
171
+ /** Measurement method. */
172
+ method?: AdminTokenMethod;
173
+ /** Measurement confidence. */
174
+ confidence?: AdminTokenConfidence;
175
+ /** ISO-8601 creation timestamp. */
176
+ createdAt: string;
177
+ }
178
+ /**
179
+ * Per-method token breakdown row in the summary.
180
+ */
181
+ export interface AdminTokenMethodBreakdown {
182
+ /** Measurement method. */
183
+ method: string;
184
+ /** Record count. */
185
+ count: number;
186
+ /** Total tokens for this method. */
187
+ totalTokens: number;
188
+ }
189
+ /**
190
+ * Per-transport token breakdown row in the summary.
191
+ */
192
+ export interface AdminTokenTransportBreakdown {
193
+ /** Transport category. */
194
+ transport: string;
195
+ /** Record count. */
196
+ count: number;
197
+ /** Total tokens for this transport. */
198
+ totalTokens: number;
199
+ }
200
+ /**
201
+ * Per-operation token breakdown row in the summary.
202
+ */
203
+ export interface AdminTokenOperationBreakdown {
204
+ /** Domain + operation key. */
205
+ key: string;
206
+ /** Record count. */
207
+ count: number;
208
+ /** Total tokens for this operation. */
209
+ totalTokens: number;
210
+ }
211
+ /**
212
+ * A single ADR record (summary form, used in lists and find results).
213
+ */
214
+ export interface AdminAdrSummary {
215
+ /** ADR identifier (e.g. `ADR-007`). */
216
+ id: string;
217
+ /** ADR title. */
218
+ title: string;
219
+ /** Lifecycle status. */
220
+ status: string;
221
+ /** ISO date string from frontmatter. */
222
+ date: string;
223
+ /** Relative file path from project root. */
224
+ filePath: string;
225
+ }
226
+ /**
227
+ * A single ADR record (full form, returned by `admin.adr.show`).
228
+ */
229
+ export interface AdminAdrRecord extends AdminAdrSummary {
230
+ /** Parsed ADR frontmatter fields. */
231
+ frontmatter: {
232
+ Date: string;
233
+ Status: AdminAdrStatus;
234
+ Accepted?: string;
235
+ Supersedes?: string;
236
+ 'Superseded By'?: string;
237
+ Amends?: string;
238
+ 'Amended By'?: string;
239
+ 'Related ADRs'?: string;
240
+ 'Related Tasks'?: string;
241
+ Gate?: 'HITL' | 'automated';
242
+ 'Gate Status'?: 'pending' | 'passed' | 'waived';
243
+ Summary?: string;
244
+ Keywords?: string;
245
+ Topics?: string;
246
+ };
247
+ }
248
+ /**
249
+ * A single smoke probe result.
250
+ */
251
+ export interface AdminSmokeProbe {
252
+ /** Domain probed. */
253
+ domain: string;
254
+ /** Operation probed within the domain. */
255
+ operation: string;
256
+ /** Probe outcome. */
257
+ status: 'pass' | 'fail' | 'skip';
258
+ /** Wall-clock duration in milliseconds. */
259
+ timeMs: number;
260
+ /** Error message when status is `fail`. */
261
+ error?: string;
262
+ }
263
+ /**
264
+ * Locality check for a single CLEO-owned database (from `admin.smoke.provider`).
265
+ */
266
+ export interface AdminDbLocalityCheck {
267
+ /** Database name (e.g. `"brain.db"`). */
268
+ name: string;
269
+ /** Whether the DB path resolves under CLEO-owned storage. */
270
+ local: boolean;
271
+ /** Resolved absolute path. */
272
+ path: string;
273
+ }
274
+ /**
275
+ * Per-provider hook coverage summary row (from `admin.hooks.matrix`).
276
+ */
277
+ export interface AdminProviderMatrixEntry {
278
+ /** CAAMP provider identifier (e.g. `"claude-code"`). */
279
+ providerId: string;
280
+ /** Number of canonical events this provider supports. */
281
+ supportedCount: number;
282
+ /** Total canonical events in the taxonomy. */
283
+ totalCanonical: number;
284
+ /** Coverage percentage (0-100, integer). */
285
+ coverage: number;
286
+ /** Canonical events supported by this provider. */
287
+ supported: string[];
288
+ /** Canonical events NOT supported by this provider. */
289
+ unsupported: string[];
290
+ }
291
+ /**
292
+ * A single background job record.
293
+ */
294
+ export interface AdminJobRecord {
295
+ /** Unique job identifier. */
296
+ jobId: string;
297
+ /** Job type or name. */
298
+ type: string;
299
+ /** Current lifecycle status. */
300
+ status: string;
301
+ /** ISO-8601 start timestamp. */
302
+ startedAt?: string;
303
+ /** ISO-8601 finish timestamp (when done or cancelled). */
304
+ finishedAt?: string;
305
+ /** Human-readable progress or result message. */
306
+ message?: string;
307
+ }
308
+ /**
309
+ * Strictness preset definition as returned by `admin.config.presets`.
310
+ */
311
+ export interface AdminPresetDefinition {
312
+ /** Preset identifier. */
313
+ name: AdminStrictnessPreset;
314
+ /** Human-readable description. */
315
+ description: string;
316
+ /** Config keys modified by this preset. */
317
+ settings: Record<string, unknown>;
318
+ }
319
+ /**
320
+ * A single apply-preset change entry.
321
+ */
322
+ export interface AdminPresetChange {
323
+ /** Config key changed. */
324
+ key: string;
325
+ /** Value before the preset was applied. */
326
+ previous: unknown;
327
+ /** Value after the preset was applied. */
328
+ current: unknown;
329
+ }
330
+ /**
331
+ * All admin domain operation identifiers.
332
+ *
333
+ * Query operations are read-only. Mutate operations write to the filesystem,
334
+ * SQLite, or trigger side-effectful system actions.
335
+ */
336
+ export type AdminOp = 'admin.version' | 'admin.health' | 'admin.config.show' | 'admin.config.presets' | 'admin.stats' | 'admin.context' | 'admin.context.pull' | 'admin.runtime' | 'admin.paths' | 'admin.job' | 'admin.dash' | 'admin.log' | 'admin.sequence' | 'admin.help' | 'admin.token' | 'admin.adr.find' | 'admin.adr.show' | 'admin.backup' | 'admin.export' | 'admin.map' | 'admin.roadmap' | 'admin.smoke' | 'admin.smoke.provider' | 'admin.hooks.matrix' | 'admin.init' | 'admin.scaffold-hub' | 'admin.health.mutate' | 'admin.config.set' | 'admin.config.set-preset' | 'admin.backup.mutate' | 'admin.migrate' | 'admin.cleanup' | 'admin.job.cancel' | 'admin.safestop' | 'admin.inject.generate' | 'admin.adr.sync' | 'admin.import' | 'admin.detect' | 'admin.token.mutate' | 'admin.context.inject' | 'admin.map.mutate' | 'admin.install.global';
337
+ /** Parameters for `admin.version` — none required. */
338
+ export type AdminVersionParams = Record<string, never>;
339
+ /** Result of `admin.version`. */
340
+ export interface AdminVersionResult {
341
+ /** The installed CLEO package version (CalVer `YYYY.M.patch`). */
342
+ version: string;
343
+ }
344
+ /**
345
+ * Parameters for `admin.health` query.
346
+ *
347
+ * @remarks
348
+ * When `mode` is `"diagnose"` the operation delegates to the doctor engine
349
+ * and returns an `AdminDoctorResult`. Otherwise it runs the lightweight
350
+ * health check and returns `AdminHealthQueryResult`.
351
+ */
352
+ export interface AdminHealthQueryParams {
353
+ /** When set to `"diagnose"`, runs a full doctor report. */
354
+ mode?: 'diagnose';
355
+ /** Include verbose per-component diagnostics. */
356
+ detailed?: boolean;
357
+ }
358
+ /** Result of `admin.health` (standard health mode). */
359
+ export interface AdminHealthQueryResult {
360
+ /** Aggregate health status. */
361
+ overall: 'healthy' | 'warning' | 'error';
362
+ /** Individual check results. */
363
+ checks: AdminHealthCheck[];
364
+ /** Installed CLEO version. */
365
+ version: string;
366
+ /** Installation quality level. */
367
+ installation: 'ok' | 'degraded';
368
+ }
369
+ /** Result of `admin.health` when `mode` is `"diagnose"`. */
370
+ export interface AdminDoctorResult {
371
+ /** Whether the project passed all checks. */
372
+ healthy: boolean;
373
+ /** Count of error-level checks. */
374
+ errors: number;
375
+ /** Count of warning-level checks. */
376
+ warnings: number;
377
+ /** Individual check results. */
378
+ checks: AdminDoctorCheck[];
379
+ }
380
+ /** Parameters for `admin.config.show`. */
381
+ export interface AdminConfigShowParams {
382
+ /** Optional dot-notation config key to read a single value. */
383
+ key?: string;
384
+ }
385
+ /**
386
+ * Result of `admin.config.show`.
387
+ *
388
+ * @remarks
389
+ * Returns the full config object when `key` is omitted, or a single value
390
+ * when `key` is provided. The type is intentionally open because config
391
+ * values are operator-defined key/value pairs.
392
+ */
393
+ export type AdminConfigShowResult = Record<string, unknown> | unknown;
394
+ /** Parameters for `admin.config.presets` — none required. */
395
+ export type AdminConfigPresetsParams = Record<string, never>;
396
+ /** Result of `admin.config.presets`. */
397
+ export interface AdminConfigPresetsResult {
398
+ /** Available strictness presets with their settings. */
399
+ presets: AdminPresetDefinition[];
400
+ }
401
+ /** Parameters for `admin.stats`. */
402
+ export interface AdminStatsParams {
403
+ /** Rolling measurement period in days (default 30). */
404
+ period?: number;
405
+ }
406
+ /** Result of `admin.stats`. */
407
+ export interface AdminStatsResult {
408
+ /** Current task counts by status. */
409
+ currentState: {
410
+ pending: number;
411
+ active: number;
412
+ done: number;
413
+ blocked: number;
414
+ cancelled: number;
415
+ /** Total non-archived tasks. */
416
+ totalActive: number;
417
+ archived: number;
418
+ /** Active + archived total. */
419
+ grandTotal: number;
420
+ };
421
+ /** Task counts grouped by priority level. */
422
+ byPriority: Record<string, number>;
423
+ /** Task counts grouped by task type. */
424
+ byType: Record<string, number>;
425
+ /** Task counts grouped by project phase. */
426
+ byPhase: Record<string, number>;
427
+ /** Completion rate metrics over the configured period. */
428
+ completionMetrics: {
429
+ /** Days in the measurement period. */
430
+ periodDays: number;
431
+ /** Tasks completed in the period. */
432
+ completedInPeriod: number;
433
+ /** Tasks created in the period. */
434
+ createdInPeriod: number;
435
+ /** Completion rate (completed / created). */
436
+ completionRate: number;
437
+ };
438
+ /** Activity metrics over the configured period. */
439
+ activityMetrics: {
440
+ createdInPeriod: number;
441
+ completedInPeriod: number;
442
+ archivedInPeriod: number;
443
+ };
444
+ /** Lifetime metrics across all time. */
445
+ allTime: {
446
+ totalCreated: number;
447
+ totalCompleted: number;
448
+ totalCancelled: number;
449
+ totalArchived: number;
450
+ archivedCompleted: number;
451
+ };
452
+ /** Average time from creation to completion. */
453
+ cycleTimes: {
454
+ /** Average days to complete, or null if insufficient data. */
455
+ averageDays: number | null;
456
+ /** Completed tasks used for the average. */
457
+ samples: number;
458
+ };
459
+ }
460
+ /** Parameters for `admin.context`. */
461
+ export interface AdminContextParams {
462
+ /** Session ID to narrow context monitoring to. */
463
+ session?: string;
464
+ }
465
+ /** A single per-session context state entry. */
466
+ export interface AdminContextSessionEntry {
467
+ /** State file path. */
468
+ file: string;
469
+ /** Session ID, or null. */
470
+ sessionId: string | null;
471
+ /** Usage percentage (0-100). */
472
+ percentage: number;
473
+ /** Status level. */
474
+ status: string;
475
+ /** ISO-8601 timestamp. */
476
+ timestamp: string;
477
+ }
478
+ /** Result of `admin.context`. */
479
+ export interface AdminContextResult {
480
+ /** Whether context monitoring data is available. */
481
+ available: boolean;
482
+ /** Aggregate status level (`ok`, `warning`, `caution`, `critical`, `emergency`). */
483
+ status: string;
484
+ /** Usage percentage (0-100). */
485
+ percentage: number;
486
+ /** Current token usage. */
487
+ currentTokens: number;
488
+ /** Maximum context window size. */
489
+ maxTokens: number;
490
+ /** ISO-8601 timestamp of last update, or null. */
491
+ timestamp: string | null;
492
+ /** Whether the data is stale. */
493
+ stale: boolean;
494
+ /** Per-session context state entries. */
495
+ sessions: AdminContextSessionEntry[];
496
+ }
497
+ /** Parameters for `admin.context.pull`. */
498
+ export interface AdminContextPullParams {
499
+ /** Task ID to pull JIT context for (required). */
500
+ taskId: string;
501
+ }
502
+ /** A compact memory hit included in a context pull result. */
503
+ export interface AdminContextPullMemoryHit {
504
+ /** Memory entry identifier. */
505
+ id: string;
506
+ /** Entry type (observation, decision, etc.). */
507
+ type: string;
508
+ /** Short display summary. */
509
+ summary: string;
510
+ }
511
+ /** Result of `admin.context.pull`. */
512
+ export interface AdminContextPullResult {
513
+ /** Compact task snapshot. */
514
+ task: {
515
+ /** Task identifier. */
516
+ id: string;
517
+ /** Task title. */
518
+ title: string;
519
+ /** Current status. */
520
+ status: string;
521
+ /** Acceptance criteria array. */
522
+ acceptance: string[];
523
+ };
524
+ /** Relevant brain memory hits (up to 5). */
525
+ relevantMemory: AdminContextPullMemoryHit[];
526
+ /** First 200 chars of the most recent handoff note, or null. */
527
+ lastHandoff: string | null;
528
+ /** Metadata about memory retrieval. */
529
+ meta: {
530
+ /** Tokens consumed by memory retrieval. */
531
+ memoryTokensUsed: number;
532
+ /** Memory entries excluded due to token budget. */
533
+ memoryEntriesExcluded: number;
534
+ };
535
+ }
536
+ /** Parameters for `admin.runtime`. */
537
+ export interface AdminRuntimeParams {
538
+ /** Include extra diagnostics in the runtime report. */
539
+ detailed?: boolean;
540
+ }
541
+ /** Result of `admin.runtime`. */
542
+ export interface AdminRuntimeResult {
543
+ /** Runtime channel (`stable`, `beta`, `dev`). */
544
+ channel: string;
545
+ /** Runtime mode string. */
546
+ mode: string;
547
+ /** Installation source (e.g. `npm`, `pnpm link`, `local`). */
548
+ source: string;
549
+ /** Installed package version. */
550
+ version: string;
551
+ /** Installed dist path. */
552
+ installed: string;
553
+ /** Global CLEO data root path. */
554
+ dataRoot: string;
555
+ /** Invocation context. */
556
+ invocation: {
557
+ /** Executable path. */
558
+ executable: string;
559
+ /** Script path. */
560
+ script: string;
561
+ /** CLI arguments. */
562
+ args: string[];
563
+ };
564
+ /** CLI and server naming metadata. */
565
+ naming: {
566
+ cli: string;
567
+ server: string;
568
+ };
569
+ /** Node.js version string. */
570
+ node: string;
571
+ /** OS platform string. */
572
+ platform: string;
573
+ /** CPU architecture string. */
574
+ arch: string;
575
+ /** Detected binary paths. */
576
+ binaries?: Record<string, string>;
577
+ /** Package identity (name + version) from package.json. */
578
+ package?: {
579
+ name: string;
580
+ version: string;
581
+ };
582
+ /** Non-fatal warnings encountered during runtime detection. */
583
+ warnings: string[];
584
+ }
585
+ /** Parameters for `admin.paths` — none required. */
586
+ export type AdminPathsParams = Record<string, never>;
587
+ /** Result of `admin.paths`. */
588
+ export interface AdminPathsResult {
589
+ /** Project-local `.cleo` directory (absolute). */
590
+ projectCleoDir: string;
591
+ /** XDG-compliant global data root (e.g. `~/.local/share/cleo`). */
592
+ cleoHome: string;
593
+ /** XDG config directory (e.g. `~/.config/cleo`). */
594
+ configDir: string;
595
+ /** CleoOS Hub path breakdown. */
596
+ hub: {
597
+ globalRecipes: string;
598
+ globalJustfile: string;
599
+ piExtensions: string;
600
+ cantWorkflows: string;
601
+ globalAgents: string;
602
+ };
603
+ /** Scaffolding existence flags (true = directory/file exists). */
604
+ scaffolded: {
605
+ globalRecipes: boolean;
606
+ globalJustfile: boolean;
607
+ piExtensions: boolean;
608
+ cantWorkflows: boolean;
609
+ globalAgents: boolean;
610
+ };
611
+ }
612
+ /** Parameters for `admin.job` query (action `"status"`). */
613
+ export interface AdminJobStatusParams {
614
+ /** Action discriminator. */
615
+ action?: 'status' | 'list';
616
+ /** Job ID to fetch (required when action is `"status"`). */
617
+ jobId?: string;
618
+ /** Status filter for list mode. */
619
+ status?: string;
620
+ /** Page size limit for list mode. */
621
+ limit?: number;
622
+ /** Page offset for list mode. */
623
+ offset?: number;
624
+ }
625
+ /** Result of `admin.job` when action is `"status"`. */
626
+ export type AdminJobStatusResult = AdminJobRecord;
627
+ /** Result of `admin.job` when action is `"list"`. */
628
+ export interface AdminJobListResult {
629
+ /** Page of job records. */
630
+ jobs: AdminJobRecord[];
631
+ /** Count of jobs matching the status filter. */
632
+ count: number;
633
+ /** Total unfiltered job count. */
634
+ total: number;
635
+ /** Filtered count (same as count). */
636
+ filtered: number;
637
+ }
638
+ /** Parameters for `admin.dash`. */
639
+ export interface AdminDashParams {
640
+ /** Override the default limit on blocked tasks shown. */
641
+ blockedTasksLimit?: number;
642
+ }
643
+ /**
644
+ * A compact task record included in dashboard lists.
645
+ *
646
+ * @remarks
647
+ * Uses `unknown` for fields sourced from the full TaskRecord to avoid
648
+ * pulling a package-level type import. Callers that need full task shapes
649
+ * should use the `tasks` domain operations.
650
+ */
651
+ export interface AdminDashTaskSummary {
652
+ /** Task identifier. */
653
+ id: string;
654
+ /** Task title. */
655
+ title: string;
656
+ /** Current status. */
657
+ status: string;
658
+ /** Priority level. */
659
+ priority?: string;
660
+ /** Task type. */
661
+ type?: string;
662
+ /** Parent task ID. */
663
+ parentId?: string | null;
664
+ /** Assigned labels. */
665
+ labels?: string[];
666
+ }
667
+ /** Result of `admin.dash`. */
668
+ export interface AdminDashResult {
669
+ /** Project name or directory basename. */
670
+ project: string;
671
+ /** Active project phase, or null. */
672
+ currentPhase: string | null;
673
+ /** Task count breakdown by status. */
674
+ summary: {
675
+ pending: number;
676
+ active: number;
677
+ blocked: number;
678
+ done: number;
679
+ cancelled: number;
680
+ /** Total non-archived tasks. */
681
+ total: number;
682
+ archived: number;
683
+ /** Active + archived total. */
684
+ grandTotal: number;
685
+ };
686
+ /** Currently focused task work state. */
687
+ taskWork: {
688
+ /** Current task ID, or null. */
689
+ currentTask: string | null;
690
+ /** Full task record for the current task, or null. */
691
+ task: AdminDashTaskSummary | null;
692
+ };
693
+ /** Active session ID, or null. */
694
+ activeSession: string | null;
695
+ /** High-priority tasks summary. */
696
+ highPriority: {
697
+ count: number;
698
+ tasks: AdminDashTaskSummary[];
699
+ };
700
+ /** Blocked tasks summary. */
701
+ blockedTasks: {
702
+ count: number;
703
+ /** Display limit applied. */
704
+ limit: number;
705
+ tasks: AdminDashTaskSummary[];
706
+ };
707
+ /** Recently completed task records. */
708
+ recentCompletions: AdminDashTaskSummary[];
709
+ /** Most frequently used labels with counts. */
710
+ topLabels: Array<{
711
+ label: string;
712
+ count: number;
713
+ }>;
714
+ }
715
+ /** Parameters for `admin.log`. */
716
+ export interface AdminLogParams {
717
+ /** Filter to a specific operation name. */
718
+ operation?: string;
719
+ /** Filter to entries for a specific task ID. */
720
+ taskId?: string;
721
+ /** ISO-8601 lower bound. */
722
+ since?: string;
723
+ /** ISO-8601 upper bound. */
724
+ until?: string;
725
+ /** Page size limit. */
726
+ limit?: number;
727
+ /** Page offset. */
728
+ offset?: number;
729
+ }
730
+ /** Result of `admin.log`. */
731
+ export interface AdminLogResult {
732
+ /** Matching log entries. */
733
+ entries: AdminLogEntry[];
734
+ /** Pagination metadata. */
735
+ pagination: AdminPagination;
736
+ }
737
+ /** Parameters for `admin.sequence`. */
738
+ export interface AdminSequenceParams {
739
+ /** `"show"` returns current state; `"check"` validates integrity. */
740
+ action?: 'show' | 'check';
741
+ }
742
+ /** Result of `admin.sequence`. */
743
+ export interface AdminSequenceResult {
744
+ /** Current counter value. */
745
+ counter: number;
746
+ /** Last assigned task ID. */
747
+ lastId: string;
748
+ /** Integrity checksum. */
749
+ checksum: string;
750
+ /** Next task ID that would be assigned. */
751
+ nextId: string;
752
+ }
753
+ /** Parameters for `admin.help`. */
754
+ export interface AdminHelpParams {
755
+ /** Help tier depth (0 = minimal, 1 = standard, 2 = full). */
756
+ tier?: number;
757
+ /** Include verbose examples and cross-references. */
758
+ verbose?: boolean;
759
+ }
760
+ /** Result of `admin.help`. */
761
+ export interface AdminHelpResult {
762
+ /** Optional topic identifier. */
763
+ topic?: string;
764
+ /** Human-readable help content. */
765
+ content: string;
766
+ /** Related CLI commands for cross-reference. */
767
+ relatedCommands?: string[];
768
+ }
769
+ /**
770
+ * Shared filter parameters used by all three `admin.token` query actions.
771
+ *
772
+ * @remarks
773
+ * The `action` field selects between `summary`, `list`, and `show` sub-operations.
774
+ */
775
+ export interface AdminTokenQueryParams {
776
+ /** Sub-operation selector (default `"summary"`). */
777
+ action?: 'summary' | 'list' | 'show';
778
+ /** Filter by provider name. */
779
+ provider?: string;
780
+ /** Filter by transport category. */
781
+ transport?: AdminTokenTransport;
782
+ /** Filter by gateway identifier. */
783
+ gateway?: string;
784
+ /** Filter by domain name. */
785
+ domain?: string;
786
+ /** Filter by operation name within a domain. */
787
+ operationName?: string;
788
+ /** Filter by session ID. */
789
+ sessionId?: string;
790
+ /** Filter by task ID. */
791
+ taskId?: string;
792
+ /** Filter by measurement method. */
793
+ method?: AdminTokenMethod;
794
+ /** Filter by confidence level. */
795
+ confidence?: AdminTokenConfidence;
796
+ /** Filter by request ID. */
797
+ requestId?: string;
798
+ /** ISO-8601 lower bound for `createdAt`. */
799
+ since?: string;
800
+ /** ISO-8601 upper bound for `createdAt`. */
801
+ until?: string;
802
+ /** Token record ID (required when action is `"show"`). */
803
+ tokenId?: string;
804
+ /** Page size limit (used by action `"list"`). */
805
+ limit?: number;
806
+ /** Page offset (used by action `"list"`). */
807
+ offset?: number;
808
+ }
809
+ /** Result of `admin.token` when action is `"summary"`. */
810
+ export interface AdminTokenSummaryResult {
811
+ /** Total records matching the filters. */
812
+ totalRecords: number;
813
+ /** Total input tokens. */
814
+ inputTokens: number;
815
+ /** Total output tokens. */
816
+ outputTokens: number;
817
+ /** Total tokens (input + output). */
818
+ totalTokens: number;
819
+ /** Breakdown by measurement method. */
820
+ byMethod: AdminTokenMethodBreakdown[];
821
+ /** Breakdown by transport category. */
822
+ byTransport: AdminTokenTransportBreakdown[];
823
+ /** Breakdown by domain + operation key. */
824
+ byOperation: AdminTokenOperationBreakdown[];
825
+ }
826
+ /** Result of `admin.token` when action is `"list"`. */
827
+ export interface AdminTokenListResult {
828
+ /** Page of token records. */
829
+ records: AdminTokenRecord[];
830
+ /** Total record count matching filters. */
831
+ total: number;
832
+ /** Filtered count (same as total when no post-filter applied). */
833
+ filtered: number;
834
+ }
835
+ /** Result of `admin.token` when action is `"show"`. */
836
+ export type AdminTokenShowResult = AdminTokenRecord;
837
+ /** Parameters for `admin.adr.find`. */
838
+ export interface AdminAdrFindParams {
839
+ /** Free-text search query. When omitted, all ADRs are listed. */
840
+ query?: string;
841
+ /** Filter by topic keywords. */
842
+ topics?: string;
843
+ /** Filter by content keywords. */
844
+ keywords?: string;
845
+ /** Filter by lifecycle status. */
846
+ status?: AdminAdrStatus;
847
+ /** ISO date lower bound. */
848
+ since?: string;
849
+ /** Page size limit. */
850
+ limit?: number;
851
+ /** Page offset. */
852
+ offset?: number;
853
+ }
854
+ /** A scored ADR search hit (from `admin.adr.find` when query is provided). */
855
+ export interface AdminAdrFindHit extends AdminAdrSummary {
856
+ /** Optional short summary from frontmatter. */
857
+ summary?: string;
858
+ /** Matched keywords from frontmatter. */
859
+ keywords?: string;
860
+ /** Matched topics from frontmatter. */
861
+ topics?: string;
862
+ /** Relevance score (higher = better match). */
863
+ score: number;
864
+ /** Fields that contributed to the match. */
865
+ matchedFields: string[];
866
+ }
867
+ /** Result of `admin.adr.find`. */
868
+ export interface AdminAdrFindResult {
869
+ /** ADR records or search hits. */
870
+ adrs: AdminAdrSummary[] | AdminAdrFindHit[];
871
+ /** Search query applied (empty string when listing all). */
872
+ query: string;
873
+ /** Total result count. */
874
+ total: number;
875
+ /** Count after status/since filtering. */
876
+ filtered: number;
877
+ }
878
+ /** Parameters for `admin.adr.show`. */
879
+ export interface AdminAdrShowParams {
880
+ /** ADR identifier to fetch (e.g. `"ADR-007"`) — required. */
881
+ adrId: string;
882
+ }
883
+ /** Result of `admin.adr.show`. */
884
+ export type AdminAdrShowResult = AdminAdrRecord;
885
+ /** Parameters for `admin.backup` query — none required. */
886
+ export type AdminBackupListParams = Record<string, never>;
887
+ /** Result of `admin.backup` query. */
888
+ export interface AdminBackupListResult {
889
+ /** Available backup entries ordered by timestamp descending. */
890
+ backups: AdminBackupEntry[];
891
+ /** Total count of available backups. */
892
+ count: number;
893
+ }
894
+ /** Parameters for `admin.export`. */
895
+ export interface AdminExportParams {
896
+ /**
897
+ * Export scope.
898
+ * - `undefined` — standard task CSV/JSON export
899
+ * - `"snapshot"` — full project snapshot
900
+ * - `"tasks"` — portable cross-project task package
901
+ */
902
+ scope?: AdminExportScope;
903
+ /** Output file path override. */
904
+ output?: string;
905
+ /** Export format for standard task export (`json`, `csv`, `tsv`, `markdown`). */
906
+ format?: 'json' | 'csv' | 'tsv' | 'markdown';
907
+ /** Filter by status for standard task export. */
908
+ status?: string;
909
+ /** Filter by parent task ID for standard task export. */
910
+ parent?: string;
911
+ /** Filter by phase for standard task export. */
912
+ phase?: string;
913
+ /** Task IDs to export (task package scope). */
914
+ taskIds?: string[];
915
+ /** Include entire subtree when exporting task packages. */
916
+ subtree?: boolean;
917
+ /** Label filters for task package scope. */
918
+ filter?: string[];
919
+ /** Include dependency tasks automatically. */
920
+ includeDeps?: boolean;
921
+ /** Dry-run mode (preview only, no file written). */
922
+ dryRun?: boolean;
923
+ }
924
+ /** Result of `admin.export` (standard mode). */
925
+ export interface AdminExportStandardResult {
926
+ /** Export format used. */
927
+ format: string;
928
+ /** Number of tasks exported. */
929
+ taskCount: number;
930
+ /** Output file path, when written to disk. */
931
+ file?: string;
932
+ /** Serialized content, when not written to disk. */
933
+ content?: string;
934
+ }
935
+ /** Result of `admin.export` (snapshot scope). */
936
+ export interface AdminExportSnapshotResult {
937
+ /** Whether the export succeeded. */
938
+ exported: boolean;
939
+ /** Number of tasks in the snapshot. */
940
+ taskCount: number;
941
+ /** Output file path. */
942
+ outputPath: string;
943
+ /** SHA-256 checksum of the snapshot. */
944
+ checksum: string;
945
+ }
946
+ /** Result of `admin.export` (tasks package scope). */
947
+ export interface AdminExportTasksPackageResult {
948
+ /** Export mode indicator. */
949
+ exportMode: string;
950
+ /** Number of tasks exported. */
951
+ taskCount: number;
952
+ /** Task IDs included in the package. */
953
+ taskIds: string[];
954
+ /** Output file path, when written. */
955
+ outputPath?: string;
956
+ /** Package content, when not written to disk. */
957
+ content?: string;
958
+ /** Whether this was a dry run. */
959
+ dryRun?: boolean;
960
+ }
961
+ /** Parameters for `admin.map` query. */
962
+ export interface AdminMapQueryParams {
963
+ /** Narrow analysis to a specific aspect. */
964
+ focus?: 'stack' | 'architecture' | 'structure' | 'conventions' | 'testing' | 'integrations' | 'concerns';
965
+ }
966
+ /**
967
+ * Result of `admin.map` query.
968
+ *
969
+ * @remarks
970
+ * Shape mirrors `CodebaseMapResult` from `@cleocode/core`. Full sub-types
971
+ * (`StackAnalysis`, `ArchAnalysis`, etc.) are omitted here to avoid pulling
972
+ * core internals into the contracts package. Consumers that need the precise
973
+ * shapes should import from `@cleocode/core/internal`.
974
+ */
975
+ export interface AdminMapResult {
976
+ /** Project context metadata (type, monorepo, conventions). */
977
+ projectContext: Record<string, unknown>;
978
+ /** Technology stack analysis. */
979
+ stack: Record<string, unknown>;
980
+ /** Architecture analysis. */
981
+ architecture: Record<string, unknown>;
982
+ /** Directory/file structure analysis. */
983
+ structure: Record<string, unknown>;
984
+ /** Coding conventions analysis. */
985
+ conventions: Record<string, unknown>;
986
+ /** Testing setup analysis. */
987
+ testing: Record<string, unknown>;
988
+ /** External integrations detected. */
989
+ integrations: Record<string, unknown>;
990
+ /** Cross-cutting concerns detected. */
991
+ concerns: Record<string, unknown>;
992
+ /** ISO-8601 timestamp when the analysis ran. */
993
+ analyzedAt: string;
994
+ }
995
+ /** Parameters for `admin.roadmap`. */
996
+ export interface AdminRoadmapParams {
997
+ /** Include completed release history. */
998
+ includeHistory?: boolean;
999
+ /** Only show upcoming epics (exclude completed). */
1000
+ upcomingOnly?: boolean;
1001
+ }
1002
+ /** An upcoming epic or milestone entry in the roadmap. */
1003
+ export interface AdminRoadmapEpic {
1004
+ /** Task identifier. */
1005
+ id: string;
1006
+ /** Epic title. */
1007
+ title: string;
1008
+ /** Current status. */
1009
+ status: string;
1010
+ /** Priority level. */
1011
+ priority: string;
1012
+ /** Active phase, if set. */
1013
+ phase?: string;
1014
+ /** Total child task count. */
1015
+ childCount: number;
1016
+ /** Count of completed child tasks. */
1017
+ completedChildren: number;
1018
+ }
1019
+ /** A past release entry in the roadmap history. */
1020
+ export interface AdminRoadmapRelease {
1021
+ /** CalVer version tag. */
1022
+ version: string;
1023
+ /** ISO-8601 release date. */
1024
+ date: string;
1025
+ }
1026
+ /** Result of `admin.roadmap`. */
1027
+ export interface AdminRoadmapResult {
1028
+ /** Current project version. */
1029
+ currentVersion: string;
1030
+ /** Upcoming epics and milestones. */
1031
+ upcoming: AdminRoadmapEpic[];
1032
+ /** Past releases (when `includeHistory` is true). */
1033
+ releaseHistory?: AdminRoadmapRelease[];
1034
+ /** Total completed epics. */
1035
+ completedEpics?: number;
1036
+ /** Summary counts. */
1037
+ summary: {
1038
+ /** Total upcoming epics. */
1039
+ totalUpcoming: number;
1040
+ /** Total tasks across upcoming epics. */
1041
+ totalTasks: number;
1042
+ };
1043
+ }
1044
+ /** Parameters for `admin.smoke` — none required. */
1045
+ export type AdminSmokeParams = Record<string, never>;
1046
+ /** Result of `admin.smoke`. */
1047
+ export interface AdminSmokeResult {
1048
+ /** Per-domain dispatch probes. */
1049
+ probes: AdminSmokeProbe[];
1050
+ /** Per-database connectivity probes. */
1051
+ dbChecks: AdminSmokeProbe[];
1052
+ /** Count of probes that passed. */
1053
+ passed: number;
1054
+ /** Count of probes that failed. */
1055
+ failed: number;
1056
+ /** Count of probes that were skipped. */
1057
+ skipped: number;
1058
+ /** Total wall-clock duration in milliseconds. */
1059
+ totalMs: number;
1060
+ }
1061
+ /** Parameters for `admin.smoke.provider`. */
1062
+ export interface AdminSmokeProviderParams {
1063
+ /** Provider ID to probe (e.g. `"claude-code"`, `"pi"`, `"opencode"`). */
1064
+ provider: string;
1065
+ }
1066
+ /** Result of `admin.smoke.provider`. */
1067
+ export interface AdminSmokeProviderResult {
1068
+ /** Provider ID that was probed. */
1069
+ providerId: string;
1070
+ /** Whether the adapter dist module resolved with the expected shape. */
1071
+ adapterLoaded: boolean;
1072
+ /** Locality checks for the four CLEO-owned databases. */
1073
+ dbChecks: AdminDbLocalityCheck[];
1074
+ /** Count of CAAMP canonical hook events referenced in the provider's hooks.ts. */
1075
+ hooksDeclared: number;
1076
+ /** Spawn implementation classification. */
1077
+ spawnStatus: AdminSpawnStatus;
1078
+ /** Absolute path returned by `getProviderAgentFolder`, or null. */
1079
+ agentFolder: string | null;
1080
+ /** Whether all ADR-049 invariants passed. */
1081
+ passed: boolean;
1082
+ /** Human-readable failure reason when `passed` is false. */
1083
+ failureReason?: string;
1084
+ /** Formatted plain-text report block for CLI rendering. */
1085
+ report: string;
1086
+ }
1087
+ /** Parameters for `admin.hooks.matrix`. */
1088
+ export interface AdminHooksMatrixParams {
1089
+ /** Filter matrix to specific provider IDs. */
1090
+ providerIds?: string[];
1091
+ /** Whether to run provider auto-detection (default true). */
1092
+ detectProvider?: boolean;
1093
+ }
1094
+ /** Result of `admin.hooks.matrix`. */
1095
+ export interface AdminHooksMatrixResult {
1096
+ /** CAAMP hook mappings version string. */
1097
+ caampVersion: string;
1098
+ /** All canonical CAAMP event names (matrix rows). */
1099
+ events: string[];
1100
+ /** Provider IDs included in the matrix (matrix columns). */
1101
+ providers: string[];
1102
+ /**
1103
+ * Two-dimensional matrix: event name → provider ID → support flag.
1104
+ * `true` means the provider natively supports the canonical event.
1105
+ */
1106
+ matrix: Record<string, Record<string, boolean>>;
1107
+ /** Per-provider summary rows with coverage statistics. */
1108
+ summary: AdminProviderMatrixEntry[];
1109
+ /** Provider ID detected as the current runtime, or null. */
1110
+ detectedProvider: string | null;
1111
+ }
1112
+ /** Parameters for `admin.init`. */
1113
+ export interface AdminInitParams {
1114
+ /** Project name override. */
1115
+ projectName?: string;
1116
+ /** Overwrite existing files. */
1117
+ force?: boolean;
1118
+ /** Run codebase analysis and store findings to brain.db. */
1119
+ mapCodebase?: boolean;
1120
+ /** Install canonical CleoOS seed agents. */
1121
+ installSeedAgents?: boolean;
1122
+ }
1123
+ /** Result of `admin.init`. */
1124
+ export interface AdminInitResult {
1125
+ /** Whether initialization succeeded. */
1126
+ initialized: boolean;
1127
+ /** Absolute path to the `.cleo` directory created. */
1128
+ directory: string;
1129
+ /** Files that were created. */
1130
+ created: string[];
1131
+ /** Files that were skipped (already existed). */
1132
+ skipped: string[];
1133
+ /** Non-fatal warnings emitted during init. */
1134
+ warnings: string[];
1135
+ /** Whether only documentation files were updated (brownfield scenario). */
1136
+ updateDocsOnly?: boolean;
1137
+ /** Greenfield/brownfield classification of the directory. */
1138
+ classification?: {
1139
+ kind: 'greenfield' | 'brownfield';
1140
+ signalCount: number;
1141
+ topLevelFileCount: number;
1142
+ hasGit: boolean;
1143
+ };
1144
+ }
1145
+ /** Parameters for `admin.scaffold-hub` — none required. */
1146
+ export type AdminScaffoldHubParams = Record<string, never>;
1147
+ /** Result of `admin.scaffold-hub`. */
1148
+ export interface AdminScaffoldHubResult {
1149
+ /** Whether the hub was created, repaired, or already current. */
1150
+ action: 'created' | 'repaired' | 'skipped';
1151
+ /** Absolute path to the hub root. */
1152
+ path: string;
1153
+ /** Additional details about what changed. */
1154
+ details?: string;
1155
+ }
1156
+ /** Parameters for `admin.health` mutate. */
1157
+ export interface AdminHealthMutateParams {
1158
+ /**
1159
+ * Mode selector.
1160
+ * - `"diagnose"` — runs doctor report (same result shape as query diagnose).
1161
+ * - `undefined` — runs auto-repair and returns per-check fix results.
1162
+ */
1163
+ mode?: 'diagnose';
1164
+ }
1165
+ /** A single auto-fix result entry (from `admin.health` repair mode). */
1166
+ export interface AdminFixResult {
1167
+ /** Check identifier that was attempted. */
1168
+ check: string;
1169
+ /** Outcome of the fix attempt. */
1170
+ action: 'fixed' | 'skipped' | 'failed';
1171
+ /** Human-readable message. */
1172
+ message: string;
1173
+ }
1174
+ /** Result of `admin.health` mutate (repair mode). */
1175
+ export type AdminHealthRepairResult = AdminFixResult[];
1176
+ /** Parameters for `admin.config.set`. */
1177
+ export interface AdminConfigSetParams {
1178
+ /** Dot-notation config key (required). */
1179
+ key: string;
1180
+ /** Value to assign. */
1181
+ value?: unknown;
1182
+ }
1183
+ /** Result of `admin.config.set`. */
1184
+ export interface AdminConfigSetResult {
1185
+ /** Config key that was written. */
1186
+ key: string;
1187
+ /** New value assigned. */
1188
+ value: unknown;
1189
+ }
1190
+ /** Parameters for `admin.config.set-preset`. */
1191
+ export interface AdminConfigSetPresetParams {
1192
+ /** Preset to apply (`strict`, `standard`, or `minimal`). */
1193
+ preset: AdminStrictnessPreset;
1194
+ }
1195
+ /** Result of `admin.config.set-preset`. */
1196
+ export interface AdminConfigSetPresetResult {
1197
+ /** Preset that was applied. */
1198
+ preset: string;
1199
+ /** Config changes made by the preset. */
1200
+ changes: AdminPresetChange[];
1201
+ }
1202
+ /** Parameters for `admin.backup` mutate. */
1203
+ export interface AdminBackupMutateParams {
1204
+ /**
1205
+ * Action selector.
1206
+ * - `undefined` / default — create a new backup
1207
+ * - `"restore"` — restore by backup ID
1208
+ * - `"restore.file"` — restore from an arbitrary file path
1209
+ */
1210
+ action?: AdminBackupAction;
1211
+ /** Backup type when creating (`snapshot`, `safety`, `migration`). */
1212
+ type?: string;
1213
+ /** Optional note to attach when creating a backup. */
1214
+ note?: string;
1215
+ /** Backup ID to restore (required when action is `"restore"`). */
1216
+ backupId?: string;
1217
+ /** Overwrite existing files without prompt when restoring by ID. */
1218
+ force?: boolean;
1219
+ /** Absolute path to backup file to restore (required when action is `"restore.file"`). */
1220
+ file?: string;
1221
+ /** Preview the restore without writing (restore.file only). */
1222
+ dryRun?: boolean;
1223
+ }
1224
+ /** Result of `admin.backup` mutate (create action). */
1225
+ export interface AdminBackupCreateResult {
1226
+ /** Unique backup identifier. */
1227
+ backupId: string;
1228
+ /** Absolute path to the backup directory. */
1229
+ path: string;
1230
+ /** ISO-8601 creation timestamp. */
1231
+ timestamp: string;
1232
+ /** Backup category. */
1233
+ type: string;
1234
+ /** Files captured in the backup. */
1235
+ files: string[];
1236
+ }
1237
+ /** Result of `admin.backup` mutate (restore action — by ID). */
1238
+ export interface AdminBackupRestoreByIdResult {
1239
+ /** Whether any files were actually restored. */
1240
+ restored: boolean;
1241
+ /** The backup identifier that was restored. */
1242
+ backupId: string;
1243
+ /** ISO-8601 timestamp of the original backup. */
1244
+ timestamp: string;
1245
+ /** File names successfully restored into `.cleo/`. */
1246
+ filesRestored: string[];
1247
+ }
1248
+ /** Result of `admin.backup` mutate (restore.file action). */
1249
+ export interface AdminBackupRestoreFileResult {
1250
+ /** Source backup file path. */
1251
+ source: string;
1252
+ /** Files restored from the backup. */
1253
+ restored: string[];
1254
+ /** Whether this was a dry run. */
1255
+ dryRun: boolean;
1256
+ }
1257
+ /** Parameters for `admin.migrate`. */
1258
+ export interface AdminMigrateParams {
1259
+ /** Target migration version. */
1260
+ target?: string;
1261
+ /** Preview migrations without applying. */
1262
+ dryRun?: boolean;
1263
+ }
1264
+ /** A single migration step. */
1265
+ export interface AdminMigrationStep {
1266
+ /** Migration name. */
1267
+ name: string;
1268
+ /** Whether the migration was applied. */
1269
+ applied: boolean;
1270
+ }
1271
+ /** Result of `admin.migrate`. */
1272
+ export interface AdminMigrateResult {
1273
+ /** Schema version before migration. */
1274
+ from: string;
1275
+ /** Schema version after migration (or target when dryRun). */
1276
+ to: string;
1277
+ /** Individual migration steps. */
1278
+ migrations: AdminMigrationStep[];
1279
+ /** Whether this was a dry run. */
1280
+ dryRun: boolean;
1281
+ }
1282
+ /** Parameters for `admin.cleanup`. */
1283
+ export interface AdminCleanupParams {
1284
+ /** Cleanup target (`backups`, `logs`, `sessions`, `archive`, etc.) — required. */
1285
+ target: string;
1286
+ /** ISO-8601 age threshold for item retention. */
1287
+ olderThan?: string;
1288
+ /** Preview without deleting. */
1289
+ dryRun?: boolean;
1290
+ }
1291
+ /** Result of `admin.cleanup`. */
1292
+ export interface AdminCleanupResult {
1293
+ /** Cleanup target applied. */
1294
+ target: string;
1295
+ /** Number of items deleted. */
1296
+ deleted: number;
1297
+ /** Identifiers of items deleted. */
1298
+ items: string[];
1299
+ /** Whether this was a dry run. */
1300
+ dryRun: boolean;
1301
+ /** Rows pruned from the database (when applicable). */
1302
+ prunedRows?: number;
1303
+ /** Rows moved to archive (when applicable). */
1304
+ archivedRows?: number;
1305
+ /** Archive file path created (when applicable). */
1306
+ archivePath?: string;
1307
+ }
1308
+ /** Parameters for `admin.job.cancel`. */
1309
+ export interface AdminJobCancelParams {
1310
+ /** Job ID to cancel — required. */
1311
+ jobId: string;
1312
+ }
1313
+ /** Result of `admin.job.cancel`. */
1314
+ export interface AdminJobCancelResult {
1315
+ /** The job ID that was cancelled. */
1316
+ jobId: string;
1317
+ /** Whether the cancellation succeeded. */
1318
+ cancelled: boolean;
1319
+ }
1320
+ /** Parameters for `admin.safestop`. */
1321
+ export interface AdminSafestopParams {
1322
+ /** Human-readable reason for the stop. */
1323
+ reason?: string;
1324
+ /** Commit any staged changes before stopping. */
1325
+ commit?: boolean;
1326
+ /** Handoff note to persist for the next session. */
1327
+ handoff?: string;
1328
+ /** Skip ending the active session. */
1329
+ noSessionEnd?: boolean;
1330
+ /** Preview the stop without performing side effects. */
1331
+ dryRun?: boolean;
1332
+ }
1333
+ /** Result of `admin.safestop`. */
1334
+ export interface AdminSafestopResult {
1335
+ /** Whether the stop completed successfully. */
1336
+ stopped: boolean;
1337
+ /** Stop reason applied. */
1338
+ reason: string;
1339
+ /** Whether the active session was ended. */
1340
+ sessionEnded: boolean;
1341
+ /** Handoff note written (when provided). */
1342
+ handoff?: string;
1343
+ /** Whether this was a dry run. */
1344
+ dryRun: boolean;
1345
+ }
1346
+ /** Parameters for `admin.inject.generate` — none required. */
1347
+ export type AdminInjectGenerateParams = Record<string, never>;
1348
+ /** Result of `admin.inject.generate`. */
1349
+ export interface AdminInjectGenerateResult {
1350
+ /** Generated injection Markdown content. */
1351
+ injection: string;
1352
+ /** Size in bytes of the generated content. */
1353
+ sizeBytes: number;
1354
+ /** CLEO protocol version used for generation. */
1355
+ version: string;
1356
+ }
1357
+ /** Parameters for `admin.adr.sync`. */
1358
+ export interface AdminAdrSyncParams {
1359
+ /**
1360
+ * When true, runs validation only without writing to the database.
1361
+ * Returns `AdminAdrValidateResult` instead of `AdminAdrSyncResult`.
1362
+ */
1363
+ validate?: boolean;
1364
+ }
1365
+ /** Result of `admin.adr.sync` (default sync mode). */
1366
+ export interface AdminAdrSyncResult {
1367
+ /** ADR records inserted into the database. */
1368
+ inserted: number;
1369
+ /** ADR records updated in the database. */
1370
+ updated: number;
1371
+ /** ADR records skipped (no changes). */
1372
+ skipped: number;
1373
+ /** Per-file sync errors. */
1374
+ errors: Array<{
1375
+ file: string;
1376
+ error: string;
1377
+ }>;
1378
+ /** Non-fatal warnings. */
1379
+ warnings: string[];
1380
+ }
1381
+ /** A single ADR validation error. */
1382
+ export interface AdminAdrValidationError {
1383
+ /** ADR identifier. */
1384
+ adrId?: string;
1385
+ /** File that failed validation. */
1386
+ file?: string;
1387
+ /** Human-readable error description. */
1388
+ message: string;
1389
+ }
1390
+ /** Result of `admin.adr.sync` when `validate` is true. */
1391
+ export interface AdminAdrValidateResult {
1392
+ /** Whether all ADRs passed validation. */
1393
+ valid: boolean;
1394
+ /** Validation errors found. */
1395
+ errors: AdminAdrValidationError[];
1396
+ /** Number of ADR files checked. */
1397
+ checked: number;
1398
+ }
1399
+ /** Parameters for `admin.import`. */
1400
+ export interface AdminImportParams {
1401
+ /**
1402
+ * Import scope.
1403
+ * - `undefined` — standard task import from file
1404
+ * - `"snapshot"` — full project snapshot restore
1405
+ * - `"tasks"` — portable cross-project task package import
1406
+ */
1407
+ scope?: AdminImportScope;
1408
+ /** Input file path — required. */
1409
+ file: string;
1410
+ /** Preview import without writing. */
1411
+ dryRun?: boolean;
1412
+ /** Parent task ID to attach imported tasks under. */
1413
+ parent?: string;
1414
+ /** Target phase for imported tasks. */
1415
+ phase?: string;
1416
+ /** Label to add to all imported tasks. */
1417
+ addLabel?: string;
1418
+ /** Duplicate resolution strategy for standard import. */
1419
+ onDuplicate?: 'skip' | 'overwrite' | 'rename';
1420
+ /** Conflict resolution for task package import. */
1421
+ onConflict?: 'duplicate' | 'rename' | 'skip' | 'fail';
1422
+ /** Missing dependency resolution for task package import. */
1423
+ onMissingDep?: 'strip' | 'placeholder' | 'fail';
1424
+ /** Force import even with validation warnings. */
1425
+ force?: boolean;
1426
+ /** Reset task status on import. */
1427
+ resetStatus?: 'pending' | 'active' | 'blocked';
1428
+ /** Write provenance metadata to imported tasks. */
1429
+ provenance?: boolean;
1430
+ }
1431
+ /** Result of `admin.import` (standard mode). */
1432
+ export interface AdminImportStandardResult {
1433
+ /** Number of tasks imported. */
1434
+ imported: number;
1435
+ /** Number of tasks skipped. */
1436
+ skipped: number;
1437
+ /** Tasks renamed during import (oldId → newId). */
1438
+ renamed: Array<{
1439
+ oldId: string;
1440
+ newId: string;
1441
+ }>;
1442
+ /** Total tasks in the source file. */
1443
+ totalTasks: number;
1444
+ /** Whether this was a dry run. */
1445
+ dryRun?: boolean;
1446
+ }
1447
+ /** Result of `admin.import` (snapshot scope). */
1448
+ export interface AdminImportSnapshotResult {
1449
+ /** Whether the import was a dry run preview. */
1450
+ dryRun?: boolean;
1451
+ /** Snapshot source identifier (dry-run only). */
1452
+ source?: string;
1453
+ /** Task count in snapshot (dry-run only). */
1454
+ taskCount?: number;
1455
+ /** Snapshot creation timestamp (dry-run only). */
1456
+ createdAt?: string;
1457
+ /** Tasks added (live import). */
1458
+ added?: number;
1459
+ /** Tasks updated (live import). */
1460
+ updated?: number;
1461
+ /** Tasks skipped (live import). */
1462
+ skipped?: number;
1463
+ /** Conflicting task IDs (live import). */
1464
+ conflicts?: string[];
1465
+ /** Whether the import was successful. */
1466
+ imported?: boolean;
1467
+ }
1468
+ /** Result of `admin.import` (tasks package scope). */
1469
+ export interface AdminImportTasksPackageResult {
1470
+ /** Number of tasks imported. */
1471
+ imported: number;
1472
+ /** Number of tasks skipped. */
1473
+ skipped: number;
1474
+ /** ID remapping (source ID → new project ID). */
1475
+ idRemap: Record<string, string>;
1476
+ /** Whether this was a dry run. */
1477
+ dryRun?: boolean;
1478
+ /** Preview data (dry-run only). */
1479
+ preview?: {
1480
+ tasks: Array<{
1481
+ id: string;
1482
+ title: string;
1483
+ type: string;
1484
+ }>;
1485
+ };
1486
+ }
1487
+ /** Parameters for `admin.detect` — none required. */
1488
+ export type AdminDetectParams = Record<string, never>;
1489
+ /** Result of `admin.detect`. */
1490
+ export interface AdminDetectResult {
1491
+ /** Project context detection result. */
1492
+ context: Record<string, unknown>;
1493
+ /** Contributor / dev-channel channel setup result. */
1494
+ devChannel: Record<string, unknown>;
1495
+ }
1496
+ /** Parameters for `admin.token` mutate. */
1497
+ export interface AdminTokenMutateParams {
1498
+ /** Sub-operation selector (default `"record"`). */
1499
+ action?: 'record' | 'delete' | 'clear';
1500
+ /** Provider name (record action). */
1501
+ provider?: string;
1502
+ /** Model name (record action). */
1503
+ model?: string;
1504
+ /** Transport category (record / clear actions). */
1505
+ transport?: AdminTokenTransport;
1506
+ /** Gateway identifier (record / clear actions). */
1507
+ gateway?: string;
1508
+ /** Domain name (record / clear actions). */
1509
+ domain?: string;
1510
+ /** Operation name within a domain (record / clear actions). */
1511
+ operationName?: string;
1512
+ /** Session ID (record / clear actions). */
1513
+ sessionId?: string;
1514
+ /** Task ID (record / clear actions). */
1515
+ taskId?: string;
1516
+ /** Request ID (record / clear actions). */
1517
+ requestId?: string;
1518
+ /** Raw request payload object (record action). */
1519
+ requestPayload?: unknown;
1520
+ /** Raw response payload object (record action). */
1521
+ responsePayload?: unknown;
1522
+ /** Arbitrary metadata (record action). */
1523
+ metadata?: Record<string, unknown>;
1524
+ /** Measurement method (clear action). */
1525
+ method?: AdminTokenMethod;
1526
+ /** Confidence level (clear action). */
1527
+ confidence?: AdminTokenConfidence;
1528
+ /** ISO-8601 lower bound (clear action). */
1529
+ since?: string;
1530
+ /** ISO-8601 upper bound (clear action). */
1531
+ until?: string;
1532
+ /** Token record ID to delete (delete action, required). */
1533
+ tokenId?: string;
1534
+ }
1535
+ /** Result of `admin.token` mutate when action is `"record"`. */
1536
+ export interface AdminTokenRecordResult {
1537
+ /** Newly-created record identifier. */
1538
+ id: string;
1539
+ /** ISO-8601 creation timestamp. */
1540
+ createdAt: string;
1541
+ }
1542
+ /** Result of `admin.token` mutate when action is `"delete"`. */
1543
+ export interface AdminTokenDeleteResult {
1544
+ /** Record identifier deleted. */
1545
+ id: string;
1546
+ /** Whether the deletion succeeded. */
1547
+ deleted: boolean;
1548
+ }
1549
+ /** Result of `admin.token` mutate when action is `"clear"`. */
1550
+ export interface AdminTokenClearResult {
1551
+ /** Number of records deleted. */
1552
+ cleared: number;
1553
+ }
1554
+ /** Parameters for `admin.context.inject`. */
1555
+ export interface AdminContextInjectParams {
1556
+ /** Protocol type identifier (e.g. `"cleo"`, `"rcasd"`) — required. */
1557
+ protocolType: string;
1558
+ /** Task ID to embed in the injection context. */
1559
+ taskId?: string;
1560
+ /** Variant of the protocol to inject. */
1561
+ variant?: string;
1562
+ }
1563
+ /** Result of `admin.context.inject`. */
1564
+ export interface AdminContextInjectResult {
1565
+ /** Protocol type that was injected. */
1566
+ protocolType: string;
1567
+ /** Rendered injection content (Markdown). */
1568
+ content: string;
1569
+ /** Absolute file path the content was read from, or null. */
1570
+ path: string | null;
1571
+ /** Length of the content in characters. */
1572
+ contentLength: number;
1573
+ /** Estimated token count. */
1574
+ estimatedTokens: number;
1575
+ /** Task ID embedded in the injection, or null. */
1576
+ taskId: string | null;
1577
+ /** Variant applied, or null. */
1578
+ variant: string | null;
1579
+ }
1580
+ /** Parameters for `admin.map` mutate. */
1581
+ export interface AdminMapMutateParams {
1582
+ /** Narrow analysis to a specific aspect. */
1583
+ focus?: 'stack' | 'architecture' | 'structure' | 'conventions' | 'testing' | 'integrations' | 'concerns';
1584
+ }
1585
+ /** Result of `admin.map` mutate (same shape as query result but also persisted). */
1586
+ export type AdminMapMutateResult = AdminMapResult;
1587
+ /** Parameters for `admin.install.global` — none required. */
1588
+ export type AdminInstallGlobalParams = Record<string, never>;
1589
+ /** Result of `admin.install.global`. */
1590
+ export interface AdminInstallGlobalResult {
1591
+ /** Global scaffold setup result. */
1592
+ scaffold: Record<string, unknown>;
1593
+ /** Global template installation result. */
1594
+ templates: Record<string, unknown>;
1595
+ }
1596
+ /**
1597
+ * Discriminated union of all admin domain operations.
1598
+ *
1599
+ * Each member fully specifies the `op`, `params`, and `result` for a single
1600
+ * operation. Consumed by `TypedDomainHandler<AdminOps>` in the T983 migration.
1601
+ *
1602
+ * @remarks
1603
+ * Operations that are unified at the handler level via an `action` param
1604
+ * (e.g. `admin.job`, `admin.token`, `admin.backup`) are represented with
1605
+ * their most permissive param union. Type-narrowing on `params.action` should
1606
+ * be performed by callers that need the precise result shape.
1607
+ *
1608
+ * Operations that differ by gateway (query vs mutate) are suffixed with
1609
+ * `.mutate` on the mutate variant when there is a name collision
1610
+ * (e.g. `admin.health` / `admin.health.mutate`, `admin.map` / `admin.map.mutate`).
1611
+ */
1612
+ export type AdminOps = {
1613
+ op: 'admin.version';
1614
+ params: AdminVersionParams;
1615
+ result: AdminVersionResult;
1616
+ } | {
1617
+ op: 'admin.health';
1618
+ params: AdminHealthQueryParams;
1619
+ result: AdminHealthQueryResult | AdminDoctorResult;
1620
+ } | {
1621
+ op: 'admin.config.show';
1622
+ params: AdminConfigShowParams;
1623
+ result: AdminConfigShowResult;
1624
+ } | {
1625
+ op: 'admin.config.presets';
1626
+ params: AdminConfigPresetsParams;
1627
+ result: AdminConfigPresetsResult;
1628
+ } | {
1629
+ op: 'admin.stats';
1630
+ params: AdminStatsParams;
1631
+ result: AdminStatsResult;
1632
+ } | {
1633
+ op: 'admin.context';
1634
+ params: AdminContextParams;
1635
+ result: AdminContextResult;
1636
+ } | {
1637
+ op: 'admin.context.pull';
1638
+ params: AdminContextPullParams;
1639
+ result: AdminContextPullResult;
1640
+ } | {
1641
+ op: 'admin.runtime';
1642
+ params: AdminRuntimeParams;
1643
+ result: AdminRuntimeResult;
1644
+ } | {
1645
+ op: 'admin.paths';
1646
+ params: AdminPathsParams;
1647
+ result: AdminPathsResult;
1648
+ } | {
1649
+ op: 'admin.job';
1650
+ params: AdminJobStatusParams;
1651
+ result: AdminJobStatusResult | AdminJobListResult;
1652
+ } | {
1653
+ op: 'admin.dash';
1654
+ params: AdminDashParams;
1655
+ result: AdminDashResult;
1656
+ } | {
1657
+ op: 'admin.log';
1658
+ params: AdminLogParams;
1659
+ result: AdminLogResult;
1660
+ } | {
1661
+ op: 'admin.sequence';
1662
+ params: AdminSequenceParams;
1663
+ result: AdminSequenceResult;
1664
+ } | {
1665
+ op: 'admin.help';
1666
+ params: AdminHelpParams;
1667
+ result: AdminHelpResult;
1668
+ } | {
1669
+ op: 'admin.token';
1670
+ params: AdminTokenQueryParams;
1671
+ result: AdminTokenSummaryResult | AdminTokenListResult | AdminTokenShowResult;
1672
+ } | {
1673
+ op: 'admin.adr.find';
1674
+ params: AdminAdrFindParams;
1675
+ result: AdminAdrFindResult;
1676
+ } | {
1677
+ op: 'admin.adr.show';
1678
+ params: AdminAdrShowParams;
1679
+ result: AdminAdrShowResult;
1680
+ } | {
1681
+ op: 'admin.backup';
1682
+ params: AdminBackupListParams;
1683
+ result: AdminBackupListResult;
1684
+ } | {
1685
+ op: 'admin.export';
1686
+ params: AdminExportParams;
1687
+ result: AdminExportStandardResult | AdminExportSnapshotResult | AdminExportTasksPackageResult;
1688
+ } | {
1689
+ op: 'admin.map';
1690
+ params: AdminMapQueryParams;
1691
+ result: AdminMapResult;
1692
+ } | {
1693
+ op: 'admin.roadmap';
1694
+ params: AdminRoadmapParams;
1695
+ result: AdminRoadmapResult;
1696
+ } | {
1697
+ op: 'admin.smoke';
1698
+ params: AdminSmokeParams;
1699
+ result: AdminSmokeResult;
1700
+ } | {
1701
+ op: 'admin.smoke.provider';
1702
+ params: AdminSmokeProviderParams;
1703
+ result: AdminSmokeProviderResult;
1704
+ } | {
1705
+ op: 'admin.hooks.matrix';
1706
+ params: AdminHooksMatrixParams;
1707
+ result: AdminHooksMatrixResult;
1708
+ } | {
1709
+ op: 'admin.init';
1710
+ params: AdminInitParams;
1711
+ result: AdminInitResult;
1712
+ } | {
1713
+ op: 'admin.scaffold-hub';
1714
+ params: AdminScaffoldHubParams;
1715
+ result: AdminScaffoldHubResult;
1716
+ } | {
1717
+ op: 'admin.health.mutate';
1718
+ params: AdminHealthMutateParams;
1719
+ result: AdminHealthRepairResult | AdminDoctorResult;
1720
+ } | {
1721
+ op: 'admin.config.set';
1722
+ params: AdminConfigSetParams;
1723
+ result: AdminConfigSetResult;
1724
+ } | {
1725
+ op: 'admin.config.set-preset';
1726
+ params: AdminConfigSetPresetParams;
1727
+ result: AdminConfigSetPresetResult;
1728
+ } | {
1729
+ op: 'admin.backup.mutate';
1730
+ params: AdminBackupMutateParams;
1731
+ result: AdminBackupCreateResult | AdminBackupRestoreByIdResult | AdminBackupRestoreFileResult;
1732
+ } | {
1733
+ op: 'admin.migrate';
1734
+ params: AdminMigrateParams;
1735
+ result: AdminMigrateResult;
1736
+ } | {
1737
+ op: 'admin.cleanup';
1738
+ params: AdminCleanupParams;
1739
+ result: AdminCleanupResult;
1740
+ } | {
1741
+ op: 'admin.job.cancel';
1742
+ params: AdminJobCancelParams;
1743
+ result: AdminJobCancelResult;
1744
+ } | {
1745
+ op: 'admin.safestop';
1746
+ params: AdminSafestopParams;
1747
+ result: AdminSafestopResult;
1748
+ } | {
1749
+ op: 'admin.inject.generate';
1750
+ params: AdminInjectGenerateParams;
1751
+ result: AdminInjectGenerateResult;
1752
+ } | {
1753
+ op: 'admin.adr.sync';
1754
+ params: AdminAdrSyncParams;
1755
+ result: AdminAdrSyncResult | AdminAdrValidateResult;
1756
+ } | {
1757
+ op: 'admin.import';
1758
+ params: AdminImportParams;
1759
+ result: AdminImportStandardResult | AdminImportSnapshotResult | AdminImportTasksPackageResult;
1760
+ } | {
1761
+ op: 'admin.detect';
1762
+ params: AdminDetectParams;
1763
+ result: AdminDetectResult;
1764
+ } | {
1765
+ op: 'admin.token.mutate';
1766
+ params: AdminTokenMutateParams;
1767
+ result: AdminTokenRecordResult | AdminTokenDeleteResult | AdminTokenClearResult;
1768
+ } | {
1769
+ op: 'admin.context.inject';
1770
+ params: AdminContextInjectParams;
1771
+ result: AdminContextInjectResult;
1772
+ } | {
1773
+ op: 'admin.map.mutate';
1774
+ params: AdminMapMutateParams;
1775
+ result: AdminMapMutateResult;
1776
+ } | {
1777
+ op: 'admin.install.global';
1778
+ params: AdminInstallGlobalParams;
1779
+ result: AdminInstallGlobalResult;
1780
+ };
1781
+ //# sourceMappingURL=admin.d.ts.map