@cleocode/contracts 2026.6.7 → 2026.6.9
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/db-recovery.d.ts +63 -0
- package/dist/db-recovery.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +7 -1
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/docs/provenance.d.ts +6 -2
- package/dist/docs/provenance.d.ts.map +1 -1
- package/dist/docs/provenance.js +1 -0
- package/dist/docs/provenance.js.map +1 -1
- package/dist/docs/read.d.ts +148 -0
- package/dist/docs/read.d.ts.map +1 -0
- package/dist/docs/read.js +57 -0
- package/dist/docs/read.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/operations/docs.d.ts +27 -3
- package/dist/operations/docs.d.ts.map +1 -1
- package/dist/operations/docs.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/db-recovery.ts +65 -0
- package/src/dispatch/operations-registry.ts +7 -1
- package/src/docs/provenance.ts +4 -1
- package/src/docs/read.ts +131 -0
- package/src/index.ts +10 -0
- package/src/operations/docs.ts +27 -3
package/dist/db-recovery.d.ts
CHANGED
|
@@ -138,4 +138,67 @@ export interface BackupRecoverResult {
|
|
|
138
138
|
*/
|
|
139
139
|
dryRun: boolean;
|
|
140
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Per-role outcome of a `cleo doctor repair` pass (T11829 · DHQ-060).
|
|
143
|
+
*
|
|
144
|
+
* `doctor repair` first PROBES each role's live DB via `PRAGMA quick_check`
|
|
145
|
+
* (the same probe the recovery pipeline runs on snapshot candidates) and only
|
|
146
|
+
* invokes the {@link recoverMalformedDb} → quarantine → restore-from-snapshot →
|
|
147
|
+
* verify pipeline for roles that are actually malformed. This record captures
|
|
148
|
+
* what was observed and done for one role.
|
|
149
|
+
*
|
|
150
|
+
* @task T11829
|
|
151
|
+
* @epic T11833
|
|
152
|
+
* @saga T11242
|
|
153
|
+
* @public
|
|
154
|
+
*/
|
|
155
|
+
export interface DoctorRepairRoleResult {
|
|
156
|
+
/** Canonical role inspected. */
|
|
157
|
+
role: DbRole;
|
|
158
|
+
/** Absolute path to the role's live DB file (resolved from `DB_INVENTORY`). */
|
|
159
|
+
dbPath: string;
|
|
160
|
+
/** `true` when the live DB file exists on disk. */
|
|
161
|
+
present: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* `true` when the live DB passed `PRAGMA quick_check` (or was absent) — i.e.
|
|
164
|
+
* NO repair was needed. `false` when corruption was detected.
|
|
165
|
+
*/
|
|
166
|
+
healthy: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* `'skipped'` — healthy or absent, nothing done;
|
|
169
|
+
* `'would-repair'` — `--dry-run`, corruption detected, repair NOT performed;
|
|
170
|
+
* `'repaired'` — corruption detected and snapshot restore succeeded;
|
|
171
|
+
* `'failed'` — corruption detected but recovery could not complete.
|
|
172
|
+
*/
|
|
173
|
+
action: 'skipped' | 'would-repair' | 'repaired' | 'failed';
|
|
174
|
+
/** Absolute path to the snapshot restored (or that would be), when applicable. */
|
|
175
|
+
restoredFrom: string | null;
|
|
176
|
+
/** Absolute path to the quarantined corrupt DB, when a repair was performed. */
|
|
177
|
+
quarantinedTo: string | null;
|
|
178
|
+
/** Approximate data-loss window in hours, when a snapshot timestamp was parsed. */
|
|
179
|
+
dataLossWindowHours: number | null;
|
|
180
|
+
/** Human-readable detail (probe outcome, error reason, or restore summary). */
|
|
181
|
+
detail: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Aggregate result of a `cleo doctor repair` invocation across one or more roles
|
|
185
|
+
* (T11829 · DHQ-060).
|
|
186
|
+
*
|
|
187
|
+
* @task T11829
|
|
188
|
+
* @epic T11833
|
|
189
|
+
* @saga T11242
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
export interface DoctorRepairResult {
|
|
193
|
+
/** `true` when the run was a `--dry-run` (no files mutated). */
|
|
194
|
+
dryRun: boolean;
|
|
195
|
+
/** Per-role outcomes. */
|
|
196
|
+
roles: DoctorRepairRoleResult[];
|
|
197
|
+
/** Count of roles found malformed (`!healthy`). */
|
|
198
|
+
malformedCount: number;
|
|
199
|
+
/** Count of roles actually repaired this run. */
|
|
200
|
+
repairedCount: number;
|
|
201
|
+
/** Count of roles where a needed repair FAILED. */
|
|
202
|
+
failedCount: number;
|
|
203
|
+
}
|
|
141
204
|
//# sourceMappingURL=db-recovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-recovery.d.ts","sourceRoot":"","sources":["../src/db-recovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC;;;;;OAKG;IACH,SAAS,EAAE,oBAAoB,CAAC;IAChC,6DAA6D;IAC7D,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,mBAAmB;IAClC,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb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C;IACnC,+DAA+D;IAC/D,WAAW,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC3D,kFAAkF;IAClF,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gFAAgF;IAChF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,kBAAkB;IACjC,gEAAgE;IAChE,MAAM,EAAE,OAAO,CAAC;IAChB,yBAAyB;IACzB,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,aAAa,EAAE,MAAM,CAAC;IACtB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"operations-registry.d.ts","sourceRoot":"","sources":["../../src/dispatch/operations-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEjG,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAMvE;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAExD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAE1F;AAMD,6DAA6D;AAC7D,eAAO,MAAM,UAAU,EAAE,YAAY,EA6sRpC,CAAC"}
|
|
@@ -6916,7 +6916,7 @@ export const OPERATIONS = [
|
|
|
6916
6916
|
gateway: 'mutate',
|
|
6917
6917
|
domain: 'docs',
|
|
6918
6918
|
operation: 'add',
|
|
6919
|
-
description: 'docs.add (mutate) — attach a local file or
|
|
6919
|
+
description: 'docs.add (mutate) — attach a local file, URL, or inline content to a CLEO owner entity (task, session, observation)',
|
|
6920
6920
|
tier: 1,
|
|
6921
6921
|
idempotent: false,
|
|
6922
6922
|
sessionRequired: false,
|
|
@@ -6940,6 +6940,12 @@ export const OPERATIONS = [
|
|
|
6940
6940
|
required: false,
|
|
6941
6941
|
description: 'Remote URL to attach',
|
|
6942
6942
|
},
|
|
6943
|
+
{
|
|
6944
|
+
name: 'content',
|
|
6945
|
+
type: 'string',
|
|
6946
|
+
required: false,
|
|
6947
|
+
description: 'Inline document body (T10965); mutually exclusive with file/url',
|
|
6948
|
+
},
|
|
6943
6949
|
{
|
|
6944
6950
|
name: 'desc',
|
|
6945
6951
|
type: 'string',
|