@cleocode/contracts 2026.3.70 → 2026.3.71

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.
@@ -0,0 +1,571 @@
1
+ /**
2
+ * Facade API interfaces for the Cleo class.
3
+ *
4
+ * These define the public API surface that consumers (e.g. CleoOS) use
5
+ * to interact with @cleocode/core via the `Cleo` facade. Defined here
6
+ * in contracts so downstream packages can import types without depending
7
+ * on core directly.
8
+ *
9
+ * @module facade
10
+ */
11
+ import type { DataAccessor, ExternalTask, ExternalTaskLink, ReconcileOptions, ReconcileResult, Task, TaskPriority, TaskSize, TaskStatus, TaskType } from './index.js';
12
+ /** Observation type categories for brain entries. */
13
+ export declare const BRAIN_OBSERVATION_TYPES: readonly ["discovery", "change", "feature", "bugfix", "decision", "refactor"];
14
+ /** Brain observation type. */
15
+ export type BrainObservationType = (typeof BRAIN_OBSERVATION_TYPES)[number];
16
+ /** Options for hybrid (FTS + vector + graph) brain search. */
17
+ export interface HybridSearchOptions {
18
+ /** Weight for full-text search results (0-1). */
19
+ ftsWeight?: number;
20
+ /** Weight for vector similarity results (0-1). */
21
+ vecWeight?: number;
22
+ /** Weight for graph-based results (0-1). */
23
+ graphWeight?: number;
24
+ /** Maximum number of results to return. */
25
+ limit?: number;
26
+ }
27
+ /** Strategy for handling duplicate tasks during import. */
28
+ export type DuplicateStrategy = 'skip' | 'overwrite' | 'rename';
29
+ /** Parameters for task import operations. */
30
+ export interface ImportParams {
31
+ /** Path to the import file. */
32
+ file: string;
33
+ /** Parent task ID for imported tasks. */
34
+ parent?: string;
35
+ /** Phase assignment for imported tasks. */
36
+ phase?: string;
37
+ /** Strategy when a duplicate task ID is found. */
38
+ onDuplicate?: DuplicateStrategy;
39
+ /** Label to add to all imported tasks. */
40
+ addLabel?: string;
41
+ /** If true, simulate the import without persisting. */
42
+ dryRun?: boolean;
43
+ /** Working directory for resolving paths. */
44
+ cwd?: string;
45
+ }
46
+ /** Agent instance status values. */
47
+ export declare const AGENT_INSTANCE_STATUSES: readonly ["starting", "active", "idle", "error", "crashed", "stopped"];
48
+ /** Agent instance status type. */
49
+ export type AgentInstanceStatus = (typeof AGENT_INSTANCE_STATUSES)[number];
50
+ /** Agent type classification values. */
51
+ export declare const AGENT_TYPES: readonly ["orchestrator", "executor", "researcher", "architect", "validator", "documentor", "custom"];
52
+ /** Agent type classification. */
53
+ export type AgentType = (typeof AGENT_TYPES)[number];
54
+ /**
55
+ * Row shape for the `agent_instances` table.
56
+ *
57
+ * Manually defined to avoid Drizzle dependency in contracts.
58
+ * Must stay in sync with `packages/core/src/agents/agent-schema.ts`.
59
+ */
60
+ export interface AgentInstanceRow {
61
+ /** Unique agent instance ID. */
62
+ id: string;
63
+ /** Agent type classification. */
64
+ agentType: AgentType;
65
+ /** Current status. */
66
+ status: AgentInstanceStatus;
67
+ /** Associated session ID (nullable). */
68
+ sessionId: string | null;
69
+ /** Associated task ID (nullable). */
70
+ taskId: string | null;
71
+ /** ISO timestamp when the agent started. */
72
+ startedAt: string;
73
+ /** ISO timestamp of the last heartbeat. */
74
+ lastHeartbeat: string;
75
+ /** ISO timestamp when the agent stopped (nullable). */
76
+ stoppedAt: string | null;
77
+ /** Number of errors encountered. */
78
+ errorCount: number;
79
+ /** Total tasks completed by this agent. */
80
+ totalTasksCompleted: number;
81
+ /** Agent capacity as a string (e.g. "1.0"). */
82
+ capacity: string;
83
+ /** JSON-encoded metadata. */
84
+ metadataJson: string | null;
85
+ /** Parent agent ID for hierarchical orchestration (nullable). */
86
+ parentAgentId: string | null;
87
+ }
88
+ /** Options for registering a new agent instance. */
89
+ export interface RegisterAgentOptions {
90
+ /** Agent type classification. */
91
+ agentType: AgentType;
92
+ /** Session to associate with. */
93
+ sessionId?: string;
94
+ /** Task to associate with. */
95
+ taskId?: string;
96
+ /** Parent agent ID for hierarchical orchestration. */
97
+ parentAgentId?: string;
98
+ /** Arbitrary metadata. */
99
+ metadata?: Record<string, unknown>;
100
+ }
101
+ /** Agent capacity information. */
102
+ export interface AgentCapacity {
103
+ /** Agent instance ID. */
104
+ agentId: string;
105
+ /** Agent type classification. */
106
+ agentType: AgentType;
107
+ /** Current status of the agent. */
108
+ status: AgentInstanceStatus;
109
+ /** Number of tasks currently assigned to this agent. */
110
+ activeTasks: number;
111
+ /** Number of additional tasks this agent can accept (max - active). */
112
+ remainingCapacity: number;
113
+ /** Maximum tasks this agent can hold. */
114
+ maxCapacity: number;
115
+ /** Whether this agent can accept new tasks. */
116
+ available: boolean;
117
+ }
118
+ /** Agent health status from heartbeat monitoring. */
119
+ export interface AgentHealthStatus {
120
+ /** Agent instance ID. */
121
+ agentId: string;
122
+ /** Current DB status. */
123
+ status: AgentInstanceStatus;
124
+ /** ISO timestamp of the last recorded heartbeat. */
125
+ lastHeartbeat: string;
126
+ /** Milliseconds since the last recorded heartbeat (at call time). */
127
+ heartbeatAgeMs: number;
128
+ /** Whether the agent is considered healthy (heartbeat within threshold). */
129
+ healthy: boolean;
130
+ /** Whether the agent is considered stale (heartbeat older than threshold). */
131
+ stale: boolean;
132
+ /** Threshold used for staleness determination (ms). */
133
+ thresholdMs: number;
134
+ }
135
+ /** Severity classification for blast radius. */
136
+ export type BlastRadiusSeverity = 'isolated' | 'moderate' | 'widespread' | 'critical';
137
+ /** A single task predicted to be affected by a change. */
138
+ export interface ImpactedTask {
139
+ /** Task ID. */
140
+ id: string;
141
+ /** Task title. */
142
+ title: string;
143
+ /** Current task status. */
144
+ status: string;
145
+ /** Current task priority. */
146
+ priority: string;
147
+ /** Severity of exposure to the change. */
148
+ exposure: 'direct' | 'dependent' | 'transitive';
149
+ /** Number of downstream tasks that depend on this task. */
150
+ downstreamCount: number;
151
+ /** Why this task is predicted to be affected. */
152
+ reason: string;
153
+ }
154
+ /** Full impact prediction report for a free-text change description. */
155
+ export interface ImpactReport {
156
+ /** The original free-text change description. */
157
+ change: string;
158
+ /** Tasks directly matched by the change description (fuzzy search). */
159
+ matchedTasks: ImpactedTask[];
160
+ /** All tasks predicted to be affected, ordered by exposure severity. */
161
+ affectedTasks: ImpactedTask[];
162
+ /** Total count of distinct affected tasks (including direct matches). */
163
+ totalAffected: number;
164
+ /** Human-readable summary of predicted impact scope. */
165
+ summary: string;
166
+ }
167
+ /** Quantified scope of a task's impact across the project. */
168
+ export interface BlastRadius {
169
+ /** Number of direct dependents. */
170
+ directCount: number;
171
+ /** Number of transitive dependents (full downstream tree). */
172
+ transitiveCount: number;
173
+ /** Number of distinct epics affected. */
174
+ epicCount: number;
175
+ /** Percentage of the total project impacted (0-100). */
176
+ projectPercentage: number;
177
+ /** Classification of impact severity. */
178
+ severity: BlastRadiusSeverity;
179
+ }
180
+ /** Result of starting work on a task. */
181
+ export interface TaskStartResult {
182
+ /** The task ID that was started. */
183
+ taskId: string;
184
+ /** The task title. */
185
+ title: string;
186
+ /** Previous task ID if one was active (auto-stopped). */
187
+ previousTask?: string | null;
188
+ }
189
+ /** Tasks domain API. */
190
+ export interface TasksAPI {
191
+ /** Add a new task. */
192
+ add(params: {
193
+ title: string;
194
+ description: string;
195
+ parent?: string;
196
+ priority?: TaskPriority;
197
+ type?: TaskType;
198
+ size?: TaskSize;
199
+ phase?: string;
200
+ labels?: string[];
201
+ depends?: string[];
202
+ notes?: string;
203
+ }): Promise<unknown>;
204
+ /** Find tasks by query, ID, status, or limit. */
205
+ find(params: {
206
+ query?: string;
207
+ id?: string;
208
+ status?: TaskStatus;
209
+ limit?: number;
210
+ }): Promise<unknown>;
211
+ /** Show full details of a task. */
212
+ show(taskId: string): Promise<unknown>;
213
+ /** List tasks with optional filters. */
214
+ list(params?: {
215
+ status?: TaskStatus;
216
+ priority?: TaskPriority;
217
+ parentId?: string;
218
+ phase?: string;
219
+ limit?: number;
220
+ }): Promise<unknown>;
221
+ /** Update task fields. */
222
+ update(params: {
223
+ taskId: string;
224
+ title?: string;
225
+ status?: TaskStatus;
226
+ priority?: TaskPriority;
227
+ description?: string;
228
+ notes?: string;
229
+ }): Promise<unknown>;
230
+ /** Complete a task with optional notes. */
231
+ complete(params: {
232
+ taskId: string;
233
+ notes?: string;
234
+ }): Promise<unknown>;
235
+ /** Delete a task. */
236
+ delete(params: {
237
+ taskId: string;
238
+ force?: boolean;
239
+ }): Promise<unknown>;
240
+ /** Archive tasks by date or IDs. */
241
+ archive(params?: {
242
+ before?: string;
243
+ taskIds?: string[];
244
+ dryRun?: boolean;
245
+ }): Promise<unknown>;
246
+ /** Start working on a specific task (sets focus). */
247
+ start(taskId: string): Promise<unknown>;
248
+ /** Stop working on the current task (clears focus). */
249
+ stop(): Promise<{
250
+ previousTask: string | null;
251
+ }>;
252
+ /** Get the current task work state. */
253
+ current(): Promise<unknown>;
254
+ }
255
+ /** Sessions domain API. */
256
+ export interface SessionsAPI {
257
+ /** Start a new session. */
258
+ start(params: {
259
+ name: string;
260
+ scope: string;
261
+ agent?: string;
262
+ startTask?: string;
263
+ }): Promise<unknown>;
264
+ /** End the current session. */
265
+ end(params?: {
266
+ note?: string;
267
+ }): Promise<unknown>;
268
+ /** Get current session status. */
269
+ status(): Promise<unknown>;
270
+ /** Resume an existing session. */
271
+ resume(sessionId: string): Promise<unknown>;
272
+ /** List sessions with optional filters. */
273
+ list(params?: {
274
+ status?: string;
275
+ limit?: number;
276
+ }): Promise<unknown>;
277
+ /** Find sessions by criteria. */
278
+ find(params?: {
279
+ status?: string;
280
+ scope?: string;
281
+ query?: string;
282
+ limit?: number;
283
+ }): Promise<unknown>;
284
+ /** Show full details of a session. */
285
+ show(sessionId: string): Promise<unknown>;
286
+ /** Suspend a session. */
287
+ suspend(sessionId: string, reason?: string): Promise<unknown>;
288
+ /** Compute session briefing. */
289
+ briefing(params?: {
290
+ maxNextTasks?: number;
291
+ scope?: string;
292
+ }): Promise<unknown>;
293
+ /** Compute session handoff. */
294
+ handoff(sessionId: string, options?: {
295
+ note?: string;
296
+ nextAction?: string;
297
+ }): Promise<unknown>;
298
+ /** Garbage-collect stale sessions. */
299
+ gc(maxAgeHours?: number): Promise<unknown>;
300
+ /** Record a decision in a session. */
301
+ recordDecision(params: {
302
+ sessionId: string;
303
+ taskId: string;
304
+ decision: string;
305
+ rationale: string;
306
+ alternatives?: string[];
307
+ }): Promise<unknown>;
308
+ /** Record an assumption. */
309
+ recordAssumption(params: {
310
+ assumption: string;
311
+ confidence: 'high' | 'medium' | 'low';
312
+ sessionId?: string;
313
+ taskId?: string;
314
+ }): Promise<unknown>;
315
+ /** Get context drift metrics. */
316
+ contextDrift(params?: {
317
+ sessionId?: string;
318
+ }): Promise<unknown>;
319
+ /** Get decision log. */
320
+ decisionLog(params?: {
321
+ sessionId?: string;
322
+ taskId?: string;
323
+ }): Promise<unknown>;
324
+ /** Get last handoff for a scope. */
325
+ lastHandoff(scope?: {
326
+ type: string;
327
+ epicId?: string;
328
+ }): Promise<unknown>;
329
+ }
330
+ /** Memory/Brain domain API. */
331
+ export interface MemoryAPI {
332
+ /** Record a brain observation. */
333
+ observe(params: {
334
+ text: string;
335
+ title?: string;
336
+ type?: BrainObservationType;
337
+ }): Promise<unknown>;
338
+ /** Find brain entries by query. */
339
+ find(params: {
340
+ query: string;
341
+ limit?: number;
342
+ tables?: Array<'decisions' | 'patterns' | 'learnings' | 'observations'>;
343
+ }): Promise<unknown>;
344
+ /** Fetch brain entries by IDs. */
345
+ fetch(params: {
346
+ ids: string[];
347
+ }): Promise<unknown>;
348
+ /** Get temporal context around an anchor entry. */
349
+ timeline(params: {
350
+ anchor: string;
351
+ depthBefore?: number;
352
+ depthAfter?: number;
353
+ }): Promise<unknown>;
354
+ /** Search brain entries. */
355
+ search(query: string, options?: {
356
+ limit?: number;
357
+ }): Promise<unknown>;
358
+ /** Hybrid search combining FTS, vector, and graph. */
359
+ hybridSearch(query: string, options?: HybridSearchOptions): Promise<unknown>;
360
+ }
361
+ /** Orchestration domain API. */
362
+ export interface OrchestrationAPI {
363
+ /** Start orchestration for an epic. */
364
+ start(epicId: string): Promise<unknown>;
365
+ /** Analyze an epic's structure and dependencies. */
366
+ analyze(epicId: string): Promise<unknown>;
367
+ /** Get tasks ready to execute in an epic. */
368
+ readyTasks(epicId: string): Promise<unknown>;
369
+ /** Get the next recommended task in an epic. */
370
+ nextTask(epicId: string): Promise<unknown>;
371
+ /** Get orchestrator context for an epic. */
372
+ context(epicId: string): Promise<unknown>;
373
+ /** Build a dependency graph from tasks. */
374
+ dependencyGraph(tasks: Task[]): unknown;
375
+ /** Compute epic status summary. */
376
+ epicStatus(epicId: string, title: string, children: Task[]): unknown;
377
+ /** Compute progress metrics for tasks. */
378
+ progress(tasks: Task[]): unknown;
379
+ }
380
+ /** Lifecycle pipeline domain API. */
381
+ export interface LifecycleAPI {
382
+ /** Get lifecycle status for an epic. */
383
+ status(epicId: string): Promise<unknown>;
384
+ /** Start a pipeline stage. */
385
+ startStage(epicId: string, stage: string): Promise<unknown>;
386
+ /** Complete a pipeline stage. */
387
+ completeStage(epicId: string, stage: string, artifacts?: string[]): Promise<unknown>;
388
+ /** Skip a pipeline stage. */
389
+ skipStage(epicId: string, stage: string, reason: string): Promise<unknown>;
390
+ /** Check gate requirements for a stage. */
391
+ checkGate(epicId: string, targetStage: string): Promise<unknown>;
392
+ /** Get lifecycle history for an epic. */
393
+ history(epicId: string): Promise<unknown>;
394
+ /** Reset a pipeline stage. */
395
+ resetStage(epicId: string, stage: string, reason: string): Promise<unknown>;
396
+ /** Pass a gate check. */
397
+ passGate(epicId: string, gateName: string, agent?: string): Promise<unknown>;
398
+ /** Fail a gate check. */
399
+ failGate(epicId: string, gateName: string, reason?: string): Promise<unknown>;
400
+ /** Available pipeline stages. */
401
+ stages: readonly string[];
402
+ }
403
+ /** Release management domain API. */
404
+ export interface ReleaseAPI {
405
+ /** Prepare a release. */
406
+ prepare(params: {
407
+ version: string;
408
+ tasks?: string[];
409
+ notes?: string;
410
+ }): Promise<unknown>;
411
+ /** Commit a release. */
412
+ commit(params: {
413
+ version: string;
414
+ }): Promise<unknown>;
415
+ /** Tag a release. */
416
+ tag(params: {
417
+ version: string;
418
+ }): Promise<unknown>;
419
+ /** Push a release. */
420
+ push(params: {
421
+ version: string;
422
+ remote?: string;
423
+ explicitPush?: boolean;
424
+ }): Promise<unknown>;
425
+ /** Rollback a release. */
426
+ rollback(params: {
427
+ version: string;
428
+ reason?: string;
429
+ }): Promise<unknown>;
430
+ /** Calculate new version from bump type. */
431
+ calculateVersion(current: string, bumpType: string): string;
432
+ /** Bump version from config. */
433
+ bumpVersion(): Promise<unknown>;
434
+ }
435
+ /** Admin domain API. */
436
+ export interface AdminAPI {
437
+ /** Export tasks. */
438
+ export(params?: Record<string, unknown>): Promise<unknown>;
439
+ /** Import tasks from file. */
440
+ import(params: Omit<ImportParams, 'cwd'>): Promise<unknown>;
441
+ }
442
+ /** Sticky notes domain API. */
443
+ export interface StickyAPI {
444
+ /** Add a sticky note. */
445
+ add(params: {
446
+ content: string;
447
+ tags?: string[];
448
+ priority?: string;
449
+ color?: string;
450
+ }): Promise<unknown>;
451
+ /** Show a sticky note. */
452
+ show(stickyId: string): Promise<unknown>;
453
+ /** List sticky notes with optional filters. */
454
+ list(params?: {
455
+ status?: string;
456
+ color?: string;
457
+ priority?: string;
458
+ limit?: number;
459
+ }): Promise<unknown>;
460
+ /** Archive a sticky note. */
461
+ archive(stickyId: string): Promise<unknown>;
462
+ /** Purge a sticky note. */
463
+ purge(stickyId: string): Promise<unknown>;
464
+ /** Convert a sticky note to task or memory. */
465
+ convert(params: {
466
+ stickyId: string;
467
+ targetType: 'task' | 'memory' | 'task_note' | 'session_note';
468
+ title?: string;
469
+ memoryType?: string;
470
+ taskId?: string;
471
+ }): Promise<unknown>;
472
+ }
473
+ /** Cross-project Nexus domain API. */
474
+ export interface NexusAPI {
475
+ /** Initialize nexus for the current project. */
476
+ init(): Promise<unknown>;
477
+ /** Register a project in the nexus. */
478
+ register(params: {
479
+ path: string;
480
+ name?: string;
481
+ permissions?: string;
482
+ }): Promise<unknown>;
483
+ /** Unregister a project from the nexus. */
484
+ unregister(params: {
485
+ name: string;
486
+ }): Promise<unknown>;
487
+ /** List registered projects. */
488
+ list(): Promise<unknown>;
489
+ /** Show details of a registered project. */
490
+ show(params: {
491
+ name: string;
492
+ }): Promise<unknown>;
493
+ /** Sync a project or all projects. */
494
+ sync(params?: {
495
+ name?: string;
496
+ }): Promise<unknown>;
497
+ /** Discover related content across projects. */
498
+ discover(params: {
499
+ query: string;
500
+ method?: string;
501
+ limit?: number;
502
+ }): Promise<unknown>;
503
+ /** Search across registered projects. */
504
+ search(params: {
505
+ pattern: string;
506
+ project?: string;
507
+ limit?: number;
508
+ }): Promise<unknown>;
509
+ /** Set permission level for a project. */
510
+ setPermission(params: {
511
+ name: string;
512
+ level: 'read' | 'write' | 'execute';
513
+ }): Promise<unknown>;
514
+ /** Get sharing status. */
515
+ sharingStatus(): Promise<unknown>;
516
+ }
517
+ /** Task reconciliation / sync domain API. */
518
+ export interface SyncAPI {
519
+ /** Reconcile external tasks with CLEO as SSoT. */
520
+ reconcile(params: {
521
+ externalTasks: ExternalTask[];
522
+ providerId: string;
523
+ dryRun?: boolean;
524
+ conflictPolicy?: ReconcileOptions['conflictPolicy'];
525
+ defaultPhase?: string;
526
+ defaultLabels?: string[];
527
+ }): Promise<ReconcileResult>;
528
+ /** Get all external task links for a provider. */
529
+ getLinks(providerId: string): Promise<ExternalTaskLink[]>;
530
+ /** Get all external task links for a CLEO task. */
531
+ getTaskLinks(taskId: string): Promise<ExternalTaskLink[]>;
532
+ /** Remove all external task links for a provider. */
533
+ removeProviderLinks(providerId: string): Promise<number>;
534
+ }
535
+ /** Agent registry domain API. */
536
+ export interface AgentsAPI {
537
+ /** Register a new agent instance. */
538
+ register(options: RegisterAgentOptions): Promise<AgentInstanceRow>;
539
+ /** Deregister an agent instance. */
540
+ deregister(agentId: string): Promise<AgentInstanceRow | null>;
541
+ /** Get health status for a specific agent. */
542
+ health(agentId: string): Promise<AgentHealthStatus | null>;
543
+ /** Detect agents that have crashed (missed heartbeats). */
544
+ detectCrashed(thresholdMs?: number): Promise<AgentInstanceRow[]>;
545
+ /** Record a heartbeat for an agent. */
546
+ recordHeartbeat(agentId: string): Promise<unknown>;
547
+ /** Get capacity info for an agent. */
548
+ capacity(agentId: string): Promise<AgentCapacity | null>;
549
+ /** Check if system is overloaded (available capacity below threshold). */
550
+ isOverloaded(threshold?: number): Promise<boolean>;
551
+ /** List all agent instances with optional filters. */
552
+ list(params?: {
553
+ status?: string;
554
+ agentType?: string;
555
+ }): Promise<AgentInstanceRow[]>;
556
+ }
557
+ /** Intelligence / impact analysis domain API. */
558
+ export interface IntelligenceAPI {
559
+ /** Predict impact of a change description on related tasks. */
560
+ predictImpact(change: string): Promise<ImpactReport>;
561
+ /** Calculate blast radius for a task change. */
562
+ blastRadius(taskId: string): Promise<BlastRadius>;
563
+ }
564
+ /** Options for initializing the Cleo facade. */
565
+ export interface CleoInitOptions {
566
+ /** Custom data accessor (store backend). */
567
+ store?: DataAccessor;
568
+ /** Enable CAAMP injection. */
569
+ caamp?: boolean;
570
+ }
571
+ //# sourceMappingURL=facade.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../src/facade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,QAAQ,EACT,MAAM,YAAY,CAAC;AAQpB,qDAAqD;AACrD,eAAO,MAAM,uBAAuB,+EAO1B,CAAC;AAEX,8BAA8B;AAC9B,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5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
1
+ /**
2
+ * Facade API interfaces for the Cleo class.
3
+ *
4
+ * These define the public API surface that consumers (e.g. CleoOS) use
5
+ * to interact with @cleocode/core via the `Cleo` facade. Defined here
6
+ * in contracts so downstream packages can import types without depending
7
+ * on core directly.
8
+ *
9
+ * @module facade
10
+ */
11
+ // ============================================================================
12
+ // Supporting types (previously scattered across core modules)
13
+ // ============================================================================
14
+ // --- Brain / Memory ---
15
+ /** Observation type categories for brain entries. */
16
+ export const BRAIN_OBSERVATION_TYPES = [
17
+ 'discovery',
18
+ 'change',
19
+ 'feature',
20
+ 'bugfix',
21
+ 'decision',
22
+ 'refactor',
23
+ ];
24
+ // --- Agents ---
25
+ /** Agent instance status values. */
26
+ export const AGENT_INSTANCE_STATUSES = [
27
+ 'starting',
28
+ 'active',
29
+ 'idle',
30
+ 'error',
31
+ 'crashed',
32
+ 'stopped',
33
+ ];
34
+ /** Agent type classification values. */
35
+ export const AGENT_TYPES = [
36
+ 'orchestrator',
37
+ 'executor',
38
+ 'researcher',
39
+ 'architect',
40
+ 'validator',
41
+ 'documentor',
42
+ 'custom',
43
+ ];
44
+ //# sourceMappingURL=facade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facade.js","sourceRoot":"","sources":["../src/facade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAeH,+EAA+E;AAC/E,8DAA8D;AAC9D,+EAA+E;AAE/E,yBAAyB;AAEzB,qDAAqD;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,WAAW;IACX,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,UAAU;IACV,UAAU;CACF,CAAC;AAwCX,iBAAiB;AAEjB,oCAAoC;AACpC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU;IACV,QAAQ;IACR,MAAM;IACN,OAAO;IACP,SAAS;IACT,SAAS;CACD,CAAC;AAKX,wCAAwC;AACxC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,cAAc;IACd,UAAU;IACV,YAAY;IACZ,WAAW;IACX,WAAW;IACX,YAAY;IACZ,QAAQ;CACA,CAAC"}
package/dist/index.d.ts CHANGED
@@ -15,6 +15,8 @@ export type { ArchiveFields, ArchiveFile, DataAccessor, QueryTasksResult, TaskFi
15
15
  export type { AdapterManifest, DetectionPattern } from './discovery.js';
16
16
  export { createErrorResult, createSuccessResult, formatError, getErrorMessage, isErrorResult, isErrorType, normalizeError, } from './errors.js';
17
17
  export { ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
18
+ export type { AdminAPI, AgentCapacity, AgentHealthStatus, AgentInstanceRow, AgentInstanceStatus, AgentsAPI, AgentType, BlastRadius, BlastRadiusSeverity, BrainObservationType, CleoInitOptions, DuplicateStrategy, HybridSearchOptions, ImpactedTask, ImpactReport, ImportParams, IntelligenceAPI, LifecycleAPI, MemoryAPI, NexusAPI, OrchestrationAPI, RegisterAgentOptions, ReleaseAPI, SessionsAPI, StickyAPI, SyncAPI, TaskStartResult, TasksAPI, } from './facade.js';
19
+ export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
18
20
  export type { AdapterHookProvider } from './hooks.js';
19
21
  export type { AdapterInstallProvider, InstallOptions, InstallResult } from './install.js';
20
22
  export type { CleoResponse, ConformanceReport, FlagInput, GatewayEnvelope, GatewayError, GatewayMeta, GatewaySuccess, LAFSEnvelope, LAFSError, LAFSErrorCategory, LAFSMeta, LAFSPage, LAFSPageNone, LAFSPageOffset, LAFSTransport, LafsAlternative, LafsEnvelope, LafsError, LafsErrorDetail, LafsSuccess, MVILevel, Warning, } from './lafs.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EACV,uBAAuB,EACvB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,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE7E,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,YAAY,EACV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAE1E,YAAY,EACV,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExE,OAAO,EACL,iBAAiB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,EACb,aAAa,EACb,aAAa,EACb,QAAQ,EACR,KAAK,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,OAAO,EACP,aAAa,EACb,WAAW,EACX,IAAI,EACJ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,yBAAyB,EACzB,eAAe,EACf,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,YAAY,EACV,UAAU,EACV,eAAe,EACf,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,8 @@
9
9
  export { createErrorResult, createSuccessResult, formatError, getErrorMessage, isErrorResult, isErrorType, normalizeError, } from './errors.js';
10
10
  // === Exit Codes ===
11
11
  export { ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
12
+ // === Facade API Interfaces ===
13
+ export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
12
14
  // === LAFS Envelope Types ===
13
15
  export { isGatewayEnvelope, isLafsError, isLafsSuccess, } from './lafs.js';
14
16
  // === Operations Types (API wire format, namespaced to avoid collision with domain types) ===
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmEH,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,iBAAiB,CAAC;AA2BzB,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,WAAW,CAAC;AAUnB,8FAA8F;AAC9F,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAkC7C,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,uEAAuE;AACvE,OAAO,EACL,YAAY,EAIZ,aAAa,EAEb,aAAa,EACb,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB;AAEjB,gBAAgB;AAChB,qBAAqB,EAErB,gBAAgB,EAEhB,kBAAkB,EAClB,eAAe,EAEf,yBAAyB,EACzB,2BAA2B;AAC3B,YAAY;AACZ,aAAa,EAGb,0BAA0B,EAC1B,uBAAuB;AACvB,sBAAsB;AACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmEH,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,qBAAqB;AACrB,OAAO,EACL,QAAQ,EACR,eAAe,EACf,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,aAAa,GACd,MAAM,iBAAiB,CAAC;AA+BzB,gCAAgC;AAChC,OAAO,EACL,uBAAuB,EACvB,WAAW,EACX,uBAAuB,GACxB,MAAM,aAAa,CAAC;AA2BrB,8BAA8B;AAC9B,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,WAAW,CAAC;AAUnB,8FAA8F;AAC9F,OAAO,KAAK,GAAG,MAAM,uBAAuB,CAAC;AAkC7C,wBAAwB;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAa3C,uEAAuE;AACvE,OAAO,EACL,YAAY,EAIZ,aAAa,EAEb,aAAa,EACb,2BAA2B,EAC3B,wBAAwB,EACxB,iBAAiB;AAEjB,gBAAgB;AAChB,qBAAqB,EAErB,gBAAgB,EAEhB,kBAAkB,EAClB,eAAe,EAEf,yBAAyB,EACzB,2BAA2B;AAC3B,YAAY;AACZ,aAAa,EAGb,0BAA0B,EAC1B,uBAAuB;AACvB,sBAAsB;AACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/contracts",
3
- "version": "2026.3.70",
3
+ "version": "2026.3.71",
4
4
  "description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/facade.ts ADDED
@@ -0,0 +1,573 @@
1
+ /**
2
+ * Facade API interfaces for the Cleo class.
3
+ *
4
+ * These define the public API surface that consumers (e.g. CleoOS) use
5
+ * to interact with @cleocode/core via the `Cleo` facade. Defined here
6
+ * in contracts so downstream packages can import types without depending
7
+ * on core directly.
8
+ *
9
+ * @module facade
10
+ */
11
+
12
+ import type {
13
+ DataAccessor,
14
+ ExternalTask,
15
+ ExternalTaskLink,
16
+ ReconcileOptions,
17
+ ReconcileResult,
18
+ Task,
19
+ TaskPriority,
20
+ TaskSize,
21
+ TaskStatus,
22
+ TaskType,
23
+ } from './index.js';
24
+
25
+ // ============================================================================
26
+ // Supporting types (previously scattered across core modules)
27
+ // ============================================================================
28
+
29
+ // --- Brain / Memory ---
30
+
31
+ /** Observation type categories for brain entries. */
32
+ export const BRAIN_OBSERVATION_TYPES = [
33
+ 'discovery',
34
+ 'change',
35
+ 'feature',
36
+ 'bugfix',
37
+ 'decision',
38
+ 'refactor',
39
+ ] as const;
40
+
41
+ /** Brain observation type. */
42
+ export type BrainObservationType = (typeof BRAIN_OBSERVATION_TYPES)[number];
43
+
44
+ /** Options for hybrid (FTS + vector + graph) brain search. */
45
+ export interface HybridSearchOptions {
46
+ /** Weight for full-text search results (0-1). */
47
+ ftsWeight?: number;
48
+ /** Weight for vector similarity results (0-1). */
49
+ vecWeight?: number;
50
+ /** Weight for graph-based results (0-1). */
51
+ graphWeight?: number;
52
+ /** Maximum number of results to return. */
53
+ limit?: number;
54
+ }
55
+
56
+ // --- Admin / Import ---
57
+
58
+ /** Strategy for handling duplicate tasks during import. */
59
+ export type DuplicateStrategy = 'skip' | 'overwrite' | 'rename';
60
+
61
+ /** Parameters for task import operations. */
62
+ export interface ImportParams {
63
+ /** Path to the import file. */
64
+ file: string;
65
+ /** Parent task ID for imported tasks. */
66
+ parent?: string;
67
+ /** Phase assignment for imported tasks. */
68
+ phase?: string;
69
+ /** Strategy when a duplicate task ID is found. */
70
+ onDuplicate?: DuplicateStrategy;
71
+ /** Label to add to all imported tasks. */
72
+ addLabel?: string;
73
+ /** If true, simulate the import without persisting. */
74
+ dryRun?: boolean;
75
+ /** Working directory for resolving paths. */
76
+ cwd?: string;
77
+ }
78
+
79
+ // --- Agents ---
80
+
81
+ /** Agent instance status values. */
82
+ export const AGENT_INSTANCE_STATUSES = [
83
+ 'starting',
84
+ 'active',
85
+ 'idle',
86
+ 'error',
87
+ 'crashed',
88
+ 'stopped',
89
+ ] as const;
90
+
91
+ /** Agent instance status type. */
92
+ export type AgentInstanceStatus = (typeof AGENT_INSTANCE_STATUSES)[number];
93
+
94
+ /** Agent type classification values. */
95
+ export const AGENT_TYPES = [
96
+ 'orchestrator',
97
+ 'executor',
98
+ 'researcher',
99
+ 'architect',
100
+ 'validator',
101
+ 'documentor',
102
+ 'custom',
103
+ ] as const;
104
+
105
+ /** Agent type classification. */
106
+ export type AgentType = (typeof AGENT_TYPES)[number];
107
+
108
+ /**
109
+ * Row shape for the `agent_instances` table.
110
+ *
111
+ * Manually defined to avoid Drizzle dependency in contracts.
112
+ * Must stay in sync with `packages/core/src/agents/agent-schema.ts`.
113
+ */
114
+ export interface AgentInstanceRow {
115
+ /** Unique agent instance ID. */
116
+ id: string;
117
+ /** Agent type classification. */
118
+ agentType: AgentType;
119
+ /** Current status. */
120
+ status: AgentInstanceStatus;
121
+ /** Associated session ID (nullable). */
122
+ sessionId: string | null;
123
+ /** Associated task ID (nullable). */
124
+ taskId: string | null;
125
+ /** ISO timestamp when the agent started. */
126
+ startedAt: string;
127
+ /** ISO timestamp of the last heartbeat. */
128
+ lastHeartbeat: string;
129
+ /** ISO timestamp when the agent stopped (nullable). */
130
+ stoppedAt: string | null;
131
+ /** Number of errors encountered. */
132
+ errorCount: number;
133
+ /** Total tasks completed by this agent. */
134
+ totalTasksCompleted: number;
135
+ /** Agent capacity as a string (e.g. "1.0"). */
136
+ capacity: string;
137
+ /** JSON-encoded metadata. */
138
+ metadataJson: string | null;
139
+ /** Parent agent ID for hierarchical orchestration (nullable). */
140
+ parentAgentId: string | null;
141
+ }
142
+
143
+ /** Options for registering a new agent instance. */
144
+ export interface RegisterAgentOptions {
145
+ /** Agent type classification. */
146
+ agentType: AgentType;
147
+ /** Session to associate with. */
148
+ sessionId?: string;
149
+ /** Task to associate with. */
150
+ taskId?: string;
151
+ /** Parent agent ID for hierarchical orchestration. */
152
+ parentAgentId?: string;
153
+ /** Arbitrary metadata. */
154
+ metadata?: Record<string, unknown>;
155
+ }
156
+
157
+ /** Agent capacity information. */
158
+ export interface AgentCapacity {
159
+ /** Agent instance ID. */
160
+ agentId: string;
161
+ /** Agent type classification. */
162
+ agentType: AgentType;
163
+ /** Current status of the agent. */
164
+ status: AgentInstanceStatus;
165
+ /** Number of tasks currently assigned to this agent. */
166
+ activeTasks: number;
167
+ /** Number of additional tasks this agent can accept (max - active). */
168
+ remainingCapacity: number;
169
+ /** Maximum tasks this agent can hold. */
170
+ maxCapacity: number;
171
+ /** Whether this agent can accept new tasks. */
172
+ available: boolean;
173
+ }
174
+
175
+ /** Agent health status from heartbeat monitoring. */
176
+ export interface AgentHealthStatus {
177
+ /** Agent instance ID. */
178
+ agentId: string;
179
+ /** Current DB status. */
180
+ status: AgentInstanceStatus;
181
+ /** ISO timestamp of the last recorded heartbeat. */
182
+ lastHeartbeat: string;
183
+ /** Milliseconds since the last recorded heartbeat (at call time). */
184
+ heartbeatAgeMs: number;
185
+ /** Whether the agent is considered healthy (heartbeat within threshold). */
186
+ healthy: boolean;
187
+ /** Whether the agent is considered stale (heartbeat older than threshold). */
188
+ stale: boolean;
189
+ /** Threshold used for staleness determination (ms). */
190
+ thresholdMs: number;
191
+ }
192
+
193
+ // --- Intelligence ---
194
+
195
+ /** Severity classification for blast radius. */
196
+ export type BlastRadiusSeverity = 'isolated' | 'moderate' | 'widespread' | 'critical';
197
+
198
+ /** A single task predicted to be affected by a change. */
199
+ export interface ImpactedTask {
200
+ /** Task ID. */
201
+ id: string;
202
+ /** Task title. */
203
+ title: string;
204
+ /** Current task status. */
205
+ status: string;
206
+ /** Current task priority. */
207
+ priority: string;
208
+ /** Severity of exposure to the change. */
209
+ exposure: 'direct' | 'dependent' | 'transitive';
210
+ /** Number of downstream tasks that depend on this task. */
211
+ downstreamCount: number;
212
+ /** Why this task is predicted to be affected. */
213
+ reason: string;
214
+ }
215
+
216
+ /** Full impact prediction report for a free-text change description. */
217
+ export interface ImpactReport {
218
+ /** The original free-text change description. */
219
+ change: string;
220
+ /** Tasks directly matched by the change description (fuzzy search). */
221
+ matchedTasks: ImpactedTask[];
222
+ /** All tasks predicted to be affected, ordered by exposure severity. */
223
+ affectedTasks: ImpactedTask[];
224
+ /** Total count of distinct affected tasks (including direct matches). */
225
+ totalAffected: number;
226
+ /** Human-readable summary of predicted impact scope. */
227
+ summary: string;
228
+ }
229
+
230
+ /** Quantified scope of a task's impact across the project. */
231
+ export interface BlastRadius {
232
+ /** Number of direct dependents. */
233
+ directCount: number;
234
+ /** Number of transitive dependents (full downstream tree). */
235
+ transitiveCount: number;
236
+ /** Number of distinct epics affected. */
237
+ epicCount: number;
238
+ /** Percentage of the total project impacted (0-100). */
239
+ projectPercentage: number;
240
+ /** Classification of impact severity. */
241
+ severity: BlastRadiusSeverity;
242
+ }
243
+
244
+ // ============================================================================
245
+ // Task work types
246
+ // ============================================================================
247
+
248
+ /** Result of starting work on a task. */
249
+ export interface TaskStartResult {
250
+ /** The task ID that was started. */
251
+ taskId: string;
252
+ /** The task title. */
253
+ title: string;
254
+ /** Previous task ID if one was active (auto-stopped). */
255
+ previousTask?: string | null;
256
+ }
257
+
258
+ // ============================================================================
259
+ // Facade API interfaces
260
+ // ============================================================================
261
+
262
+ /** Tasks domain API. */
263
+ export interface TasksAPI {
264
+ /** Add a new task. */
265
+ add(params: {
266
+ title: string;
267
+ description: string;
268
+ parent?: string;
269
+ priority?: TaskPriority;
270
+ type?: TaskType;
271
+ size?: TaskSize;
272
+ phase?: string;
273
+ labels?: string[];
274
+ depends?: string[];
275
+ notes?: string;
276
+ }): Promise<unknown>;
277
+ /** Find tasks by query, ID, status, or limit. */
278
+ find(params: {
279
+ query?: string;
280
+ id?: string;
281
+ status?: TaskStatus;
282
+ limit?: number;
283
+ }): Promise<unknown>;
284
+ /** Show full details of a task. */
285
+ show(taskId: string): Promise<unknown>;
286
+ /** List tasks with optional filters. */
287
+ list(params?: {
288
+ status?: TaskStatus;
289
+ priority?: TaskPriority;
290
+ parentId?: string;
291
+ phase?: string;
292
+ limit?: number;
293
+ }): Promise<unknown>;
294
+ /** Update task fields. */
295
+ update(params: {
296
+ taskId: string;
297
+ title?: string;
298
+ status?: TaskStatus;
299
+ priority?: TaskPriority;
300
+ description?: string;
301
+ notes?: string;
302
+ }): Promise<unknown>;
303
+ /** Complete a task with optional notes. */
304
+ complete(params: { taskId: string; notes?: string }): Promise<unknown>;
305
+ /** Delete a task. */
306
+ delete(params: { taskId: string; force?: boolean }): Promise<unknown>;
307
+ /** Archive tasks by date or IDs. */
308
+ archive(params?: { before?: string; taskIds?: string[]; dryRun?: boolean }): Promise<unknown>;
309
+ /** Start working on a specific task (sets focus). */
310
+ start(taskId: string): Promise<unknown>;
311
+ /** Stop working on the current task (clears focus). */
312
+ stop(): Promise<{ previousTask: string | null }>;
313
+ /** Get the current task work state. */
314
+ current(): Promise<unknown>;
315
+ }
316
+
317
+ /** Sessions domain API. */
318
+ export interface SessionsAPI {
319
+ /** Start a new session. */
320
+ start(params: {
321
+ name: string;
322
+ scope: string;
323
+ agent?: string;
324
+ startTask?: string;
325
+ }): Promise<unknown>;
326
+ /** End the current session. */
327
+ end(params?: { note?: string }): Promise<unknown>;
328
+ /** Get current session status. */
329
+ status(): Promise<unknown>;
330
+ /** Resume an existing session. */
331
+ resume(sessionId: string): Promise<unknown>;
332
+ /** List sessions with optional filters. */
333
+ list(params?: { status?: string; limit?: number }): Promise<unknown>;
334
+ /** Find sessions by criteria. */
335
+ find(params?: {
336
+ status?: string;
337
+ scope?: string;
338
+ query?: string;
339
+ limit?: number;
340
+ }): Promise<unknown>;
341
+ /** Show full details of a session. */
342
+ show(sessionId: string): Promise<unknown>;
343
+ /** Suspend a session. */
344
+ suspend(sessionId: string, reason?: string): Promise<unknown>;
345
+ /** Compute session briefing. */
346
+ briefing(params?: { maxNextTasks?: number; scope?: string }): Promise<unknown>;
347
+ /** Compute session handoff. */
348
+ handoff(sessionId: string, options?: { note?: string; nextAction?: string }): Promise<unknown>;
349
+ /** Garbage-collect stale sessions. */
350
+ gc(maxAgeHours?: number): Promise<unknown>;
351
+ /** Record a decision in a session. */
352
+ recordDecision(params: {
353
+ sessionId: string;
354
+ taskId: string;
355
+ decision: string;
356
+ rationale: string;
357
+ alternatives?: string[];
358
+ }): Promise<unknown>;
359
+ /** Record an assumption. */
360
+ recordAssumption(params: {
361
+ assumption: string;
362
+ confidence: 'high' | 'medium' | 'low';
363
+ sessionId?: string;
364
+ taskId?: string;
365
+ }): Promise<unknown>;
366
+ /** Get context drift metrics. */
367
+ contextDrift(params?: { sessionId?: string }): Promise<unknown>;
368
+ /** Get decision log. */
369
+ decisionLog(params?: { sessionId?: string; taskId?: string }): Promise<unknown>;
370
+ /** Get last handoff for a scope. */
371
+ lastHandoff(scope?: { type: string; epicId?: string }): Promise<unknown>;
372
+ }
373
+
374
+ /** Memory/Brain domain API. */
375
+ export interface MemoryAPI {
376
+ /** Record a brain observation. */
377
+ observe(params: { text: string; title?: string; type?: BrainObservationType }): Promise<unknown>;
378
+ /** Find brain entries by query. */
379
+ find(params: {
380
+ query: string;
381
+ limit?: number;
382
+ tables?: Array<'decisions' | 'patterns' | 'learnings' | 'observations'>;
383
+ }): Promise<unknown>;
384
+ /** Fetch brain entries by IDs. */
385
+ fetch(params: { ids: string[] }): Promise<unknown>;
386
+ /** Get temporal context around an anchor entry. */
387
+ timeline(params: { anchor: string; depthBefore?: number; depthAfter?: number }): Promise<unknown>;
388
+ /** Search brain entries. */
389
+ search(query: string, options?: { limit?: number }): Promise<unknown>;
390
+ /** Hybrid search combining FTS, vector, and graph. */
391
+ hybridSearch(query: string, options?: HybridSearchOptions): Promise<unknown>;
392
+ }
393
+
394
+ /** Orchestration domain API. */
395
+ export interface OrchestrationAPI {
396
+ /** Start orchestration for an epic. */
397
+ start(epicId: string): Promise<unknown>;
398
+ /** Analyze an epic's structure and dependencies. */
399
+ analyze(epicId: string): Promise<unknown>;
400
+ /** Get tasks ready to execute in an epic. */
401
+ readyTasks(epicId: string): Promise<unknown>;
402
+ /** Get the next recommended task in an epic. */
403
+ nextTask(epicId: string): Promise<unknown>;
404
+ /** Get orchestrator context for an epic. */
405
+ context(epicId: string): Promise<unknown>;
406
+ /** Build a dependency graph from tasks. */
407
+ dependencyGraph(tasks: Task[]): unknown;
408
+ /** Compute epic status summary. */
409
+ epicStatus(epicId: string, title: string, children: Task[]): unknown;
410
+ /** Compute progress metrics for tasks. */
411
+ progress(tasks: Task[]): unknown;
412
+ }
413
+
414
+ /** Lifecycle pipeline domain API. */
415
+ export interface LifecycleAPI {
416
+ /** Get lifecycle status for an epic. */
417
+ status(epicId: string): Promise<unknown>;
418
+ /** Start a pipeline stage. */
419
+ startStage(epicId: string, stage: string): Promise<unknown>;
420
+ /** Complete a pipeline stage. */
421
+ completeStage(epicId: string, stage: string, artifacts?: string[]): Promise<unknown>;
422
+ /** Skip a pipeline stage. */
423
+ skipStage(epicId: string, stage: string, reason: string): Promise<unknown>;
424
+ /** Check gate requirements for a stage. */
425
+ checkGate(epicId: string, targetStage: string): Promise<unknown>;
426
+ /** Get lifecycle history for an epic. */
427
+ history(epicId: string): Promise<unknown>;
428
+ /** Reset a pipeline stage. */
429
+ resetStage(epicId: string, stage: string, reason: string): Promise<unknown>;
430
+ /** Pass a gate check. */
431
+ passGate(epicId: string, gateName: string, agent?: string): Promise<unknown>;
432
+ /** Fail a gate check. */
433
+ failGate(epicId: string, gateName: string, reason?: string): Promise<unknown>;
434
+ /** Available pipeline stages. */
435
+ stages: readonly string[];
436
+ }
437
+
438
+ /** Release management domain API. */
439
+ export interface ReleaseAPI {
440
+ /** Prepare a release. */
441
+ prepare(params: { version: string; tasks?: string[]; notes?: string }): Promise<unknown>;
442
+ /** Commit a release. */
443
+ commit(params: { version: string }): Promise<unknown>;
444
+ /** Tag a release. */
445
+ tag(params: { version: string }): Promise<unknown>;
446
+ /** Push a release. */
447
+ push(params: { version: string; remote?: string; explicitPush?: boolean }): Promise<unknown>;
448
+ /** Rollback a release. */
449
+ rollback(params: { version: string; reason?: string }): Promise<unknown>;
450
+ /** Calculate new version from bump type. */
451
+ calculateVersion(current: string, bumpType: string): string;
452
+ /** Bump version from config. */
453
+ bumpVersion(): Promise<unknown>;
454
+ }
455
+
456
+ /** Admin domain API. */
457
+ export interface AdminAPI {
458
+ /** Export tasks. */
459
+ export(params?: Record<string, unknown>): Promise<unknown>;
460
+ /** Import tasks from file. */
461
+ import(params: Omit<ImportParams, 'cwd'>): Promise<unknown>;
462
+ }
463
+
464
+ /** Sticky notes domain API. */
465
+ export interface StickyAPI {
466
+ /** Add a sticky note. */
467
+ add(params: {
468
+ content: string;
469
+ tags?: string[];
470
+ priority?: string;
471
+ color?: string;
472
+ }): Promise<unknown>;
473
+ /** Show a sticky note. */
474
+ show(stickyId: string): Promise<unknown>;
475
+ /** List sticky notes with optional filters. */
476
+ list(params?: {
477
+ status?: string;
478
+ color?: string;
479
+ priority?: string;
480
+ limit?: number;
481
+ }): Promise<unknown>;
482
+ /** Archive a sticky note. */
483
+ archive(stickyId: string): Promise<unknown>;
484
+ /** Purge a sticky note. */
485
+ purge(stickyId: string): Promise<unknown>;
486
+ /** Convert a sticky note to task or memory. */
487
+ convert(params: {
488
+ stickyId: string;
489
+ targetType: 'task' | 'memory' | 'task_note' | 'session_note';
490
+ title?: string;
491
+ memoryType?: string;
492
+ taskId?: string;
493
+ }): Promise<unknown>;
494
+ }
495
+
496
+ /** Cross-project Nexus domain API. */
497
+ export interface NexusAPI {
498
+ /** Initialize nexus for the current project. */
499
+ init(): Promise<unknown>;
500
+ /** Register a project in the nexus. */
501
+ register(params: { path: string; name?: string; permissions?: string }): Promise<unknown>;
502
+ /** Unregister a project from the nexus. */
503
+ unregister(params: { name: string }): Promise<unknown>;
504
+ /** List registered projects. */
505
+ list(): Promise<unknown>;
506
+ /** Show details of a registered project. */
507
+ show(params: { name: string }): Promise<unknown>;
508
+ /** Sync a project or all projects. */
509
+ sync(params?: { name?: string }): Promise<unknown>;
510
+ /** Discover related content across projects. */
511
+ discover(params: { query: string; method?: string; limit?: number }): Promise<unknown>;
512
+ /** Search across registered projects. */
513
+ search(params: { pattern: string; project?: string; limit?: number }): Promise<unknown>;
514
+ /** Set permission level for a project. */
515
+ setPermission(params: { name: string; level: 'read' | 'write' | 'execute' }): Promise<unknown>;
516
+ /** Get sharing status. */
517
+ sharingStatus(): Promise<unknown>;
518
+ }
519
+
520
+ /** Task reconciliation / sync domain API. */
521
+ export interface SyncAPI {
522
+ /** Reconcile external tasks with CLEO as SSoT. */
523
+ reconcile(params: {
524
+ externalTasks: ExternalTask[];
525
+ providerId: string;
526
+ dryRun?: boolean;
527
+ conflictPolicy?: ReconcileOptions['conflictPolicy'];
528
+ defaultPhase?: string;
529
+ defaultLabels?: string[];
530
+ }): Promise<ReconcileResult>;
531
+ /** Get all external task links for a provider. */
532
+ getLinks(providerId: string): Promise<ExternalTaskLink[]>;
533
+ /** Get all external task links for a CLEO task. */
534
+ getTaskLinks(taskId: string): Promise<ExternalTaskLink[]>;
535
+ /** Remove all external task links for a provider. */
536
+ removeProviderLinks(providerId: string): Promise<number>;
537
+ }
538
+
539
+ /** Agent registry domain API. */
540
+ export interface AgentsAPI {
541
+ /** Register a new agent instance. */
542
+ register(options: RegisterAgentOptions): Promise<AgentInstanceRow>;
543
+ /** Deregister an agent instance. */
544
+ deregister(agentId: string): Promise<AgentInstanceRow | null>;
545
+ /** Get health status for a specific agent. */
546
+ health(agentId: string): Promise<AgentHealthStatus | null>;
547
+ /** Detect agents that have crashed (missed heartbeats). */
548
+ detectCrashed(thresholdMs?: number): Promise<AgentInstanceRow[]>;
549
+ /** Record a heartbeat for an agent. */
550
+ recordHeartbeat(agentId: string): Promise<unknown>;
551
+ /** Get capacity info for an agent. */
552
+ capacity(agentId: string): Promise<AgentCapacity | null>;
553
+ /** Check if system is overloaded (available capacity below threshold). */
554
+ isOverloaded(threshold?: number): Promise<boolean>;
555
+ /** List all agent instances with optional filters. */
556
+ list(params?: { status?: string; agentType?: string }): Promise<AgentInstanceRow[]>;
557
+ }
558
+
559
+ /** Intelligence / impact analysis domain API. */
560
+ export interface IntelligenceAPI {
561
+ /** Predict impact of a change description on related tasks. */
562
+ predictImpact(change: string): Promise<ImpactReport>;
563
+ /** Calculate blast radius for a task change. */
564
+ blastRadius(taskId: string): Promise<BlastRadius>;
565
+ }
566
+
567
+ /** Options for initializing the Cleo facade. */
568
+ export interface CleoInitOptions {
569
+ /** Custom data accessor (store backend). */
570
+ store?: DataAccessor;
571
+ /** Enable CAAMP injection. */
572
+ caamp?: boolean;
573
+ }
package/src/index.ts CHANGED
@@ -90,6 +90,42 @@ export {
90
90
  isRecoverableCode,
91
91
  isSuccessCode,
92
92
  } from './exit-codes.js';
93
+ export type {
94
+ AdminAPI,
95
+ AgentCapacity,
96
+ AgentHealthStatus,
97
+ AgentInstanceRow,
98
+ AgentInstanceStatus,
99
+ AgentsAPI,
100
+ AgentType,
101
+ BlastRadius,
102
+ BlastRadiusSeverity,
103
+ BrainObservationType,
104
+ CleoInitOptions,
105
+ DuplicateStrategy,
106
+ HybridSearchOptions,
107
+ ImpactedTask,
108
+ ImpactReport,
109
+ ImportParams,
110
+ IntelligenceAPI,
111
+ LifecycleAPI,
112
+ MemoryAPI,
113
+ NexusAPI,
114
+ OrchestrationAPI,
115
+ RegisterAgentOptions,
116
+ ReleaseAPI,
117
+ SessionsAPI,
118
+ StickyAPI,
119
+ SyncAPI,
120
+ TaskStartResult,
121
+ TasksAPI,
122
+ } from './facade.js';
123
+ // === Facade API Interfaces ===
124
+ export {
125
+ AGENT_INSTANCE_STATUSES,
126
+ AGENT_TYPES,
127
+ BRAIN_OBSERVATION_TYPES,
128
+ } from './facade.js';
93
129
  export type { AdapterHookProvider } from './hooks.js';
94
130
  export type { AdapterInstallProvider, InstallOptions, InstallResult } from './install.js';
95
131
  export type {