@cleocode/contracts 2026.3.39 → 2026.3.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/adapter.d.ts CHANGED
@@ -10,7 +10,7 @@ import type { AdapterHookProvider } from './hooks.js';
10
10
  import type { AdapterInstallProvider } from './install.js';
11
11
  import type { AdapterPathProvider } from './provider-paths.js';
12
12
  import type { AdapterSpawnProvider } from './spawn.js';
13
- import type { AdapterTaskSyncProvider } from './task-sync.js';
13
+ import type { ExternalTaskProvider } from './task-sync.js';
14
14
  import type { AdapterTransportProvider } from './transport.js';
15
15
  export interface CLEOProviderAdapter {
16
16
  readonly id: string;
@@ -23,7 +23,7 @@ export interface CLEOProviderAdapter {
23
23
  paths?: AdapterPathProvider;
24
24
  contextMonitor?: AdapterContextMonitorProvider;
25
25
  transport?: AdapterTransportProvider;
26
- taskSync?: AdapterTaskSyncProvider;
26
+ taskSync?: ExternalTaskProvider;
27
27
  initialize(projectDir: string): Promise<void>;
28
28
  dispose(): Promise<void>;
29
29
  healthCheck(): Promise<AdapterHealthStatus>;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB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,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,mBAAmB,CAAC;IAClC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,oBAAoB,CAAC;IAC7B,OAAO,EAAE,sBAAsB,CAAC;IAChC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C,SAAS,CAAC,EAAE,wBAAwB,CAAC;IACrC,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,WAAW,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
package/dist/index.d.ts CHANGED
@@ -31,9 +31,8 @@ export type { CAAMPSpawnOptions, CAAMPSpawnResult, CLEOSpawnAdapter, CLEOSpawnCo
31
31
  export { ADR_STATUSES, type AdrStatus, type EntityType, GATE_STATUSES, type GateStatus, isValidStatus, LIFECYCLE_PIPELINE_STATUSES, LIFECYCLE_STAGE_STATUSES, MANIFEST_STATUSES, type ManifestStatus, PIPELINE_STATUS_ICONS, type PipelineStatus, SESSION_STATUSES, type SessionStatus, STAGE_STATUS_ICONS, STATUS_REGISTRY, type StageStatus, TASK_STATUS_SYMBOLS_ASCII, TASK_STATUS_SYMBOLS_UNICODE, TASK_STATUSES, type TaskStatus, TERMINAL_PIPELINE_STATUSES, TERMINAL_STAGE_STATUSES, TERMINAL_TASK_STATUSES, } from './status-registry.js';
32
32
  export type { CancelledTask, CompletedTask, EpicLifecycle, FileMeta, Phase, PhaseStatus, PhaseTransition, ProjectMeta, Release, ReleaseStatus, SessionNote, Task, TaskCreate, TaskFile, TaskOrigin, TaskPriority, TaskProvenance, TaskRelation, TaskSize, TaskType, TaskVerification, TaskWorkState, VerificationAgent, VerificationFailure, VerificationGate, } from './task.js';
33
33
  export type { MinimalTaskRecord, TaskRecord, TaskRecordRelation, ValidationHistoryEntry, } from './task-record.js';
34
- export type { AdapterTaskSyncProvider, ConflictPolicy, ExternalTask, ExternalTaskStatus, ReconcileAction, ReconcileActionType, ReconcileOptions, ReconcileResult, SyncSessionState, } from './task-sync.js';
34
+ export type { ConflictPolicy, ExternalLinkType, ExternalTask, ExternalTaskLink, ExternalTaskProvider, ExternalTaskStatus, ReconcileAction, ReconcileActionType, ReconcileOptions, ReconcileResult, SyncDirection, } from './task-sync.js';
35
35
  export type { TesseraInstantiationInput, TesseraTemplate, TesseraVariable, } from './tessera.js';
36
- export type { TodoWriteChange, TodoWriteChangeAction, TodoWriteChangeSet, TodoWriteItem, TodoWriteItemStatus, TodoWriteMergeResult, TodoWriteState, TodoWriteSyncSessionState, } from './todowrite.js';
37
36
  export type { AdapterTransportProvider } from './transport.js';
38
37
  export type { ChainShape, ChainValidation, GateCheck, GateContract, GateName, GateResult, ProtocolType, WarpChain, WarpChainExecution, WarpChainInstance, WarpLink, WarpStage, } from './warp-chain.js';
39
38
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH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ACd,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,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"}
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,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,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;AAC5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AsB,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"}
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Task synchronization contracts for provider-agnostic task reconciliation.
3
3
  *
4
- * Replaces the legacy Claude Code-specific TodoWrite integration with a
5
- * provider-agnostic system. Any provider adapter can implement
6
- * AdapterTaskSyncProvider to sync its external task system with CLEO as SSoT.
7
- *
8
- * @task T5800
4
+ * Defines the interface for syncing external issue/task systems (Linear, Jira,
5
+ * GitHub Issues, GitLab, etc.) with CLEO as SSoT. Provider adapters normalize
6
+ * their native formats into ExternalTask[], and the reconciliation engine
7
+ * handles diffing, creating, updating, and linking.
9
8
  */
10
9
  /** Normalized status for tasks coming from an external provider. */
11
10
  export type ExternalTaskStatus = 'pending' | 'active' | 'completed' | 'removed';
@@ -16,34 +15,56 @@ export type ExternalTaskStatus = 'pending' | 'active' | 'completed' | 'removed';
16
15
  export interface ExternalTask {
17
16
  /** Provider-assigned identifier for this task (opaque to core). */
18
17
  externalId: string;
19
- /** Mapped CLEO task ID, or null if the task is new / unmatched. */
20
- cleoTaskId: string | null;
21
18
  /** Human-readable title. */
22
19
  title: string;
23
20
  /** Normalized status. */
24
21
  status: ExternalTaskStatus;
25
22
  /** Optional description text. */
26
23
  description?: string;
24
+ /** Optional priority mapping (provider decides how to map). */
25
+ priority?: 'critical' | 'high' | 'medium' | 'low';
26
+ /** Optional task type mapping. */
27
+ type?: 'epic' | 'task' | 'subtask';
27
28
  /** Optional labels/tags from the provider. */
28
29
  labels?: string[];
30
+ /** Optional URL to the external task (for linking). */
31
+ url?: string;
32
+ /** Optional parent external ID (for hierarchy). */
33
+ parentExternalId?: string;
29
34
  /** Arbitrary provider-specific metadata (opaque to core). */
30
35
  providerMeta?: Record<string, unknown>;
31
36
  }
37
+ /** How an external task link was established. */
38
+ export type ExternalLinkType = 'created' | 'matched' | 'manual';
39
+ /** Direction of the sync that established the link. */
40
+ export type SyncDirection = 'inbound' | 'outbound' | 'bidirectional';
32
41
  /**
33
- * Persistent state for a sync session between CLEO and a provider.
34
- * Stored per-provider under `.cleo/sync/<providerId>-session.json`.
42
+ * A link between a CLEO task and an external provider task.
43
+ * Stored in the external_task_links table in tasks.db.
35
44
  */
36
- export interface SyncSessionState {
37
- /** CLEO task IDs that were injected into the provider's task list. */
38
- injectedTaskIds: string[];
39
- /** Optional phase context when tasks were injected. */
40
- injectedPhase?: string;
41
- /** Per-task metadata at injection time. */
42
- taskMetadata?: Record<string, {
43
- phase?: string;
44
- }>;
45
- /** ISO timestamp of the last successful reconciliation. */
46
- lastSyncAt?: string;
45
+ export interface ExternalTaskLink {
46
+ /** Link ID (UUID). */
47
+ id: string;
48
+ /** CLEO task ID. */
49
+ taskId: string;
50
+ /** Provider identifier (e.g. 'linear', 'jira', 'github'). */
51
+ providerId: string;
52
+ /** Provider-assigned external task ID. */
53
+ externalId: string;
54
+ /** URL to the external task. */
55
+ externalUrl?: string | null;
56
+ /** Title at time of last sync. */
57
+ externalTitle?: string | null;
58
+ /** How this link was established. */
59
+ linkType: ExternalLinkType;
60
+ /** Sync direction. */
61
+ syncDirection: SyncDirection;
62
+ /** Provider-specific metadata (JSON). */
63
+ metadata?: Record<string, unknown>;
64
+ /** When the link was first established. */
65
+ linkedAt: string;
66
+ /** When the external task was last synchronized. */
67
+ lastSyncAt?: string | null;
47
68
  }
48
69
  /**
49
70
  * Policy for resolving conflicts between CLEO and provider state.
@@ -56,7 +77,7 @@ export interface SyncSessionState {
56
77
  export type ConflictPolicy = 'cleo-wins' | 'provider-wins' | 'latest-wins' | 'report-only';
57
78
  /** Options for the reconciliation engine. */
58
79
  export interface ReconcileOptions {
59
- /** Provider ID (e.g. 'claude-code', 'cursor'). */
80
+ /** Provider ID (e.g. 'linear', 'jira', 'github'). */
60
81
  providerId: string;
61
82
  /** Working directory (project root). */
62
83
  cwd?: string;
@@ -70,19 +91,21 @@ export interface ReconcileOptions {
70
91
  defaultLabels?: string[];
71
92
  }
72
93
  /** The type of action the reconciliation engine will take. */
73
- export type ReconcileActionType = 'complete' | 'activate' | 'create' | 'remove' | 'skip' | 'conflict';
94
+ export type ReconcileActionType = 'create' | 'update' | 'complete' | 'activate' | 'skip' | 'conflict';
74
95
  /** A single reconciliation action (planned or applied). */
75
96
  export interface ReconcileAction {
76
97
  /** What kind of change. */
77
98
  type: ReconcileActionType;
78
99
  /** The CLEO task ID affected (null for creates before they happen). */
79
100
  cleoTaskId: string | null;
80
- /** The external task that triggered this action. */
101
+ /** The external task ID that triggered this action. */
81
102
  externalId: string;
82
103
  /** Human-readable description of the action. */
83
104
  summary: string;
84
105
  /** Whether this action was actually applied. */
85
106
  applied: boolean;
107
+ /** The link ID if a link was created or updated. */
108
+ linkId?: string;
86
109
  /** Error message if the action failed during apply. */
87
110
  error?: string;
88
111
  }
@@ -96,24 +119,45 @@ export interface ReconcileResult {
96
119
  actions: ReconcileAction[];
97
120
  /** Summary counts. */
98
121
  summary: {
122
+ created: number;
123
+ updated: number;
99
124
  completed: number;
100
125
  activated: number;
101
- created: number;
102
- removed: number;
103
126
  skipped: number;
104
127
  conflicts: number;
128
+ total: number;
105
129
  applied: number;
106
130
  };
107
- /** Whether sync session state was cleared after apply. */
108
- sessionCleared: boolean;
131
+ /** Links created or updated during this reconciliation. */
132
+ linksAffected: number;
109
133
  }
110
134
  /**
111
135
  * Interface that provider adapters implement to expose their external
112
136
  * task system to the reconciliation engine.
113
137
  *
114
- * Provider-specific parsing lives here — core never sees native formats.
138
+ * Provider-specific parsing lives in the adapter — core never sees native formats.
139
+ * Consumers implement this interface to integrate their issue tracker with CLEO.
140
+ *
141
+ * @example
142
+ * ```typescript
143
+ * class LinearAdapter implements ExternalTaskProvider {
144
+ * async getExternalTasks(projectDir: string): Promise<ExternalTask[]> {
145
+ * const issues = await linearClient.issues({ projectId: '...' });
146
+ * return issues.map(issue => ({
147
+ * externalId: issue.id,
148
+ * title: issue.title,
149
+ * status: mapLinearStatus(issue.state),
150
+ * description: issue.description,
151
+ * priority: mapLinearPriority(issue.priority),
152
+ * labels: issue.labels.map(l => l.name),
153
+ * url: issue.url,
154
+ * providerMeta: { linearId: issue.identifier },
155
+ * }));
156
+ * }
157
+ * }
158
+ * ```
115
159
  */
116
- export interface AdapterTaskSyncProvider {
160
+ export interface ExternalTaskProvider {
117
161
  /**
118
162
  * Read the provider's current task state and return normalized ExternalTasks.
119
163
  *
@@ -122,7 +166,7 @@ export interface AdapterTaskSyncProvider {
122
166
  */
123
167
  getExternalTasks(projectDir: string): Promise<ExternalTask[]>;
124
168
  /**
125
- * Optionally push CLEO task state back to the provider.
169
+ * Optionally push CLEO task state back to the provider (outbound sync).
126
170
  * Not all providers support bidirectional sync.
127
171
  *
128
172
  * @param tasks - Current CLEO tasks to push.
@@ -133,11 +177,5 @@ export interface AdapterTaskSyncProvider {
133
177
  title: string;
134
178
  status: string;
135
179
  }>, projectDir: string): Promise<void>;
136
- /**
137
- * Clean up provider-specific sync artifacts (e.g. state files).
138
- *
139
- * @param projectDir - Project root directory.
140
- */
141
- cleanup?(projectDir: string): Promise<void>;
142
180
  }
143
181
  //# sourceMappingURL=task-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-sync.d.ts","sourceRoot":"","sources":["../src/task-sync.ts"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E,MAAM,CAAA;KAAE,CAAC,EACnE,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
package/dist/task-sync.js CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Task synchronization contracts for provider-agnostic task reconciliation.
3
3
  *
4
- * Replaces the legacy Claude Code-specific TodoWrite integration with a
5
- * provider-agnostic system. Any provider adapter can implement
6
- * AdapterTaskSyncProvider to sync its external task system with CLEO as SSoT.
7
- *
8
- * @task T5800
4
+ * Defines the interface for syncing external issue/task systems (Linear, Jira,
5
+ * GitHub Issues, GitLab, etc.) with CLEO as SSoT. Provider adapters normalize
6
+ * their native formats into ExternalTask[], and the reconciliation engine
7
+ * handles diffing, creating, updating, and linking.
9
8
  */
10
9
  export {};
11
10
  //# sourceMappingURL=task-sync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"task-sync.js","sourceRoot":"","sources":["../src/task-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
1
+ {"version":3,"file":"task-sync.js","sourceRoot":"","sources":["../src/task-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/contracts",
3
- "version": "2026.3.39",
3
+ "version": "2026.3.40",
4
4
  "description": "Domain types, interfaces, and contracts for the CLEO ecosystem",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/adapter.ts CHANGED
@@ -11,7 +11,7 @@ import type { AdapterHookProvider } from './hooks.js';
11
11
  import type { AdapterInstallProvider } from './install.js';
12
12
  import type { AdapterPathProvider } from './provider-paths.js';
13
13
  import type { AdapterSpawnProvider } from './spawn.js';
14
- import type { AdapterTaskSyncProvider } from './task-sync.js';
14
+ import type { ExternalTaskProvider } from './task-sync.js';
15
15
  import type { AdapterTransportProvider } from './transport.js';
16
16
 
17
17
  export interface CLEOProviderAdapter {
@@ -25,7 +25,7 @@ export interface CLEOProviderAdapter {
25
25
  paths?: AdapterPathProvider;
26
26
  contextMonitor?: AdapterContextMonitorProvider;
27
27
  transport?: AdapterTransportProvider;
28
- taskSync?: AdapterTaskSyncProvider;
28
+ taskSync?: ExternalTaskProvider;
29
29
  initialize(projectDir: string): Promise<void>;
30
30
  dispose(): Promise<void>;
31
31
  healthCheck(): Promise<AdapterHealthStatus>;
package/src/index.ts CHANGED
@@ -244,15 +244,17 @@ export type {
244
244
  } from './task-record.js';
245
245
  // === Task Sync Types (provider-agnostic reconciliation) ===
246
246
  export type {
247
- AdapterTaskSyncProvider,
248
247
  ConflictPolicy,
248
+ ExternalLinkType,
249
249
  ExternalTask,
250
+ ExternalTaskLink,
251
+ ExternalTaskProvider,
250
252
  ExternalTaskStatus,
251
253
  ReconcileAction,
252
254
  ReconcileActionType,
253
255
  ReconcileOptions,
254
256
  ReconcileResult,
255
- SyncSessionState,
257
+ SyncDirection,
256
258
  } from './task-sync.js';
257
259
  // === Tessera Types ===
258
260
  export type {
@@ -260,17 +262,6 @@ export type {
260
262
  TesseraTemplate,
261
263
  TesseraVariable,
262
264
  } from './tessera.js';
263
- // === TodoWrite Types (deprecated — use task-sync types) ===
264
- export type {
265
- TodoWriteChange,
266
- TodoWriteChangeAction,
267
- TodoWriteChangeSet,
268
- TodoWriteItem,
269
- TodoWriteItemStatus,
270
- TodoWriteMergeResult,
271
- TodoWriteState,
272
- TodoWriteSyncSessionState,
273
- } from './todowrite.js';
274
265
  export type { AdapterTransportProvider } from './transport.js';
275
266
  // === WarpChain Types ===
276
267
  export type {
package/src/task-sync.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  /**
2
2
  * Task synchronization contracts for provider-agnostic task reconciliation.
3
3
  *
4
- * Replaces the legacy Claude Code-specific TodoWrite integration with a
5
- * provider-agnostic system. Any provider adapter can implement
6
- * AdapterTaskSyncProvider to sync its external task system with CLEO as SSoT.
7
- *
8
- * @task T5800
4
+ * Defines the interface for syncing external issue/task systems (Linear, Jira,
5
+ * GitHub Issues, GitLab, etc.) with CLEO as SSoT. Provider adapters normalize
6
+ * their native formats into ExternalTask[], and the reconciliation engine
7
+ * handles diffing, creating, updating, and linking.
9
8
  */
10
9
 
11
10
  // ---------------------------------------------------------------------------
@@ -22,37 +21,63 @@ export type ExternalTaskStatus = 'pending' | 'active' | 'completed' | 'removed';
22
21
  export interface ExternalTask {
23
22
  /** Provider-assigned identifier for this task (opaque to core). */
24
23
  externalId: string;
25
- /** Mapped CLEO task ID, or null if the task is new / unmatched. */
26
- cleoTaskId: string | null;
27
24
  /** Human-readable title. */
28
25
  title: string;
29
26
  /** Normalized status. */
30
27
  status: ExternalTaskStatus;
31
28
  /** Optional description text. */
32
29
  description?: string;
30
+ /** Optional priority mapping (provider decides how to map). */
31
+ priority?: 'critical' | 'high' | 'medium' | 'low';
32
+ /** Optional task type mapping. */
33
+ type?: 'epic' | 'task' | 'subtask';
33
34
  /** Optional labels/tags from the provider. */
34
35
  labels?: string[];
36
+ /** Optional URL to the external task (for linking). */
37
+ url?: string;
38
+ /** Optional parent external ID (for hierarchy). */
39
+ parentExternalId?: string;
35
40
  /** Arbitrary provider-specific metadata (opaque to core). */
36
41
  providerMeta?: Record<string, unknown>;
37
42
  }
38
43
 
39
44
  // ---------------------------------------------------------------------------
40
- // Sync session state
45
+ // External task link (DB-backed tracking)
41
46
  // ---------------------------------------------------------------------------
42
47
 
48
+ /** How an external task link was established. */
49
+ export type ExternalLinkType = 'created' | 'matched' | 'manual';
50
+
51
+ /** Direction of the sync that established the link. */
52
+ export type SyncDirection = 'inbound' | 'outbound' | 'bidirectional';
53
+
43
54
  /**
44
- * Persistent state for a sync session between CLEO and a provider.
45
- * Stored per-provider under `.cleo/sync/<providerId>-session.json`.
55
+ * A link between a CLEO task and an external provider task.
56
+ * Stored in the external_task_links table in tasks.db.
46
57
  */
47
- export interface SyncSessionState {
48
- /** CLEO task IDs that were injected into the provider's task list. */
49
- injectedTaskIds: string[];
50
- /** Optional phase context when tasks were injected. */
51
- injectedPhase?: string;
52
- /** Per-task metadata at injection time. */
53
- taskMetadata?: Record<string, { phase?: string }>;
54
- /** ISO timestamp of the last successful reconciliation. */
55
- lastSyncAt?: string;
58
+ export interface ExternalTaskLink {
59
+ /** Link ID (UUID). */
60
+ id: string;
61
+ /** CLEO task ID. */
62
+ taskId: string;
63
+ /** Provider identifier (e.g. 'linear', 'jira', 'github'). */
64
+ providerId: string;
65
+ /** Provider-assigned external task ID. */
66
+ externalId: string;
67
+ /** URL to the external task. */
68
+ externalUrl?: string | null;
69
+ /** Title at time of last sync. */
70
+ externalTitle?: string | null;
71
+ /** How this link was established. */
72
+ linkType: ExternalLinkType;
73
+ /** Sync direction. */
74
+ syncDirection: SyncDirection;
75
+ /** Provider-specific metadata (JSON). */
76
+ metadata?: Record<string, unknown>;
77
+ /** When the link was first established. */
78
+ linkedAt: string;
79
+ /** When the external task was last synchronized. */
80
+ lastSyncAt?: string | null;
56
81
  }
57
82
 
58
83
  // ---------------------------------------------------------------------------
@@ -75,7 +100,7 @@ export type ConflictPolicy = 'cleo-wins' | 'provider-wins' | 'latest-wins' | 're
75
100
 
76
101
  /** Options for the reconciliation engine. */
77
102
  export interface ReconcileOptions {
78
- /** Provider ID (e.g. 'claude-code', 'cursor'). */
103
+ /** Provider ID (e.g. 'linear', 'jira', 'github'). */
79
104
  providerId: string;
80
105
  /** Working directory (project root). */
81
106
  cwd?: string;
@@ -91,10 +116,10 @@ export interface ReconcileOptions {
91
116
 
92
117
  /** The type of action the reconciliation engine will take. */
93
118
  export type ReconcileActionType =
119
+ | 'create'
120
+ | 'update'
94
121
  | 'complete'
95
122
  | 'activate'
96
- | 'create'
97
- | 'remove'
98
123
  | 'skip'
99
124
  | 'conflict';
100
125
 
@@ -104,12 +129,14 @@ export interface ReconcileAction {
104
129
  type: ReconcileActionType;
105
130
  /** The CLEO task ID affected (null for creates before they happen). */
106
131
  cleoTaskId: string | null;
107
- /** The external task that triggered this action. */
132
+ /** The external task ID that triggered this action. */
108
133
  externalId: string;
109
134
  /** Human-readable description of the action. */
110
135
  summary: string;
111
136
  /** Whether this action was actually applied. */
112
137
  applied: boolean;
138
+ /** The link ID if a link was created or updated. */
139
+ linkId?: string;
113
140
  /** Error message if the action failed during apply. */
114
141
  error?: string;
115
142
  }
@@ -124,16 +151,17 @@ export interface ReconcileResult {
124
151
  actions: ReconcileAction[];
125
152
  /** Summary counts. */
126
153
  summary: {
154
+ created: number;
155
+ updated: number;
127
156
  completed: number;
128
157
  activated: number;
129
- created: number;
130
- removed: number;
131
158
  skipped: number;
132
159
  conflicts: number;
160
+ total: number;
133
161
  applied: number;
134
162
  };
135
- /** Whether sync session state was cleared after apply. */
136
- sessionCleared: boolean;
163
+ /** Links created or updated during this reconciliation. */
164
+ linksAffected: number;
137
165
  }
138
166
 
139
167
  // ---------------------------------------------------------------------------
@@ -144,9 +172,29 @@ export interface ReconcileResult {
144
172
  * Interface that provider adapters implement to expose their external
145
173
  * task system to the reconciliation engine.
146
174
  *
147
- * Provider-specific parsing lives here — core never sees native formats.
175
+ * Provider-specific parsing lives in the adapter — core never sees native formats.
176
+ * Consumers implement this interface to integrate their issue tracker with CLEO.
177
+ *
178
+ * @example
179
+ * ```typescript
180
+ * class LinearAdapter implements ExternalTaskProvider {
181
+ * async getExternalTasks(projectDir: string): Promise<ExternalTask[]> {
182
+ * const issues = await linearClient.issues({ projectId: '...' });
183
+ * return issues.map(issue => ({
184
+ * externalId: issue.id,
185
+ * title: issue.title,
186
+ * status: mapLinearStatus(issue.state),
187
+ * description: issue.description,
188
+ * priority: mapLinearPriority(issue.priority),
189
+ * labels: issue.labels.map(l => l.name),
190
+ * url: issue.url,
191
+ * providerMeta: { linearId: issue.identifier },
192
+ * }));
193
+ * }
194
+ * }
195
+ * ```
148
196
  */
149
- export interface AdapterTaskSyncProvider {
197
+ export interface ExternalTaskProvider {
150
198
  /**
151
199
  * Read the provider's current task state and return normalized ExternalTasks.
152
200
  *
@@ -156,7 +204,7 @@ export interface AdapterTaskSyncProvider {
156
204
  getExternalTasks(projectDir: string): Promise<ExternalTask[]>;
157
205
 
158
206
  /**
159
- * Optionally push CLEO task state back to the provider.
207
+ * Optionally push CLEO task state back to the provider (outbound sync).
160
208
  * Not all providers support bidirectional sync.
161
209
  *
162
210
  * @param tasks - Current CLEO tasks to push.
@@ -166,11 +214,4 @@ export interface AdapterTaskSyncProvider {
166
214
  tasks: ReadonlyArray<{ id: string; title: string; status: string }>,
167
215
  projectDir: string,
168
216
  ): Promise<void>;
169
-
170
- /**
171
- * Clean up provider-specific sync artifacts (e.g. state files).
172
- *
173
- * @param projectDir - Project root directory.
174
- */
175
- cleanup?(projectDir: string): Promise<void>;
176
217
  }
@@ -1,53 +0,0 @@
1
- /**
2
- * TodoWrite types for Claude TodoWrite state merge operations.
3
- *
4
- * @task T4551
5
- */
6
- /** TodoWrite item status as exported by Claude. */
7
- export type TodoWriteItemStatus = 'pending' | 'in_progress' | 'completed';
8
- /** TodoWrite item as exported by Claude. */
9
- export interface TodoWriteItem {
10
- content: string;
11
- status: TodoWriteItemStatus;
12
- activeForm?: string;
13
- }
14
- /** TodoWrite state file format. */
15
- export interface TodoWriteState {
16
- todos: TodoWriteItem[];
17
- }
18
- /** Sync session state for TodoWrite integration. */
19
- export interface TodoWriteSyncSessionState {
20
- injected_tasks: string[];
21
- injectedPhase?: string;
22
- task_metadata?: Record<string, {
23
- phase?: string;
24
- }>;
25
- }
26
- /** Detected changes from TodoWrite state analysis. */
27
- export interface TodoWriteChangeSet {
28
- completed: string[];
29
- progressed: string[];
30
- newTasks: string[];
31
- removed: string[];
32
- }
33
- /** Action type for a TodoWrite merge change. */
34
- export type TodoWriteChangeAction = 'complete' | 'create' | 'update';
35
- /** A single change applied during TodoWrite merge. */
36
- export interface TodoWriteChange {
37
- taskId: string;
38
- action: TodoWriteChangeAction;
39
- details?: string;
40
- }
41
- /** Result of a TodoWrite merge operation. */
42
- export interface TodoWriteMergeResult {
43
- dryRun: boolean;
44
- changes: {
45
- completed: number;
46
- progressed: number;
47
- new: number;
48
- removed: number;
49
- applied: number;
50
- };
51
- sessionCleared?: boolean;
52
- }
53
- //# sourceMappingURL=todowrite.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"todowrite.d.ts","sourceRoot":"","sources":["../src/todowrite.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mDAAmD;AACnD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAE1E,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,oDAAoD;AACpD,MAAM,WAAW,yBAAyB;IACxC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,gDAAgD;AAChD,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAErE,sDAAsD;AACtD,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,6CAA6C;AAC7C,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
package/dist/todowrite.js DELETED
@@ -1,7 +0,0 @@
1
- /**
2
- * TodoWrite types for Claude TodoWrite state merge operations.
3
- *
4
- * @task T4551
5
- */
6
- export {};
7
- //# sourceMappingURL=todowrite.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"todowrite.js","sourceRoot":"","sources":["../src/todowrite.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
package/src/todowrite.ts DELETED
@@ -1,58 +0,0 @@
1
- /**
2
- * TodoWrite types for Claude TodoWrite state merge operations.
3
- *
4
- * @task T4551
5
- */
6
-
7
- /** TodoWrite item status as exported by Claude. */
8
- export type TodoWriteItemStatus = 'pending' | 'in_progress' | 'completed';
9
-
10
- /** TodoWrite item as exported by Claude. */
11
- export interface TodoWriteItem {
12
- content: string;
13
- status: TodoWriteItemStatus;
14
- activeForm?: string;
15
- }
16
-
17
- /** TodoWrite state file format. */
18
- export interface TodoWriteState {
19
- todos: TodoWriteItem[];
20
- }
21
-
22
- /** Sync session state for TodoWrite integration. */
23
- export interface TodoWriteSyncSessionState {
24
- injected_tasks: string[];
25
- injectedPhase?: string;
26
- task_metadata?: Record<string, { phase?: string }>;
27
- }
28
-
29
- /** Detected changes from TodoWrite state analysis. */
30
- export interface TodoWriteChangeSet {
31
- completed: string[];
32
- progressed: string[];
33
- newTasks: string[];
34
- removed: string[];
35
- }
36
-
37
- /** Action type for a TodoWrite merge change. */
38
- export type TodoWriteChangeAction = 'complete' | 'create' | 'update';
39
-
40
- /** A single change applied during TodoWrite merge. */
41
- export interface TodoWriteChange {
42
- taskId: string;
43
- action: TodoWriteChangeAction;
44
- details?: string;
45
- }
46
-
47
- /** Result of a TodoWrite merge operation. */
48
- export interface TodoWriteMergeResult {
49
- dryRun: boolean;
50
- changes: {
51
- completed: number;
52
- progressed: number;
53
- new: number;
54
- removed: number;
55
- applied: number;
56
- };
57
- sessionCleared?: boolean;
58
- }