@cleocode/contracts 2026.9.23 → 2026.9.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/branch-lock.d.ts +9 -0
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +25 -3
- package/dist/branch-lock.js.map +1 -1
- package/dist/cloud/api.d.ts +1 -1
- package/dist/data-accessor.d.ts +205 -16
- package/dist/data-accessor.d.ts.map +1 -1
- package/dist/data-accessor.js.map +1 -1
- package/dist/decide.d.ts +110 -1
- package/dist/decide.d.ts.map +1 -1
- package/dist/decide.js +23 -0
- package/dist/decide.js.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +137 -6
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/doctor.d.ts +9 -0
- package/dist/doctor.d.ts.map +1 -1
- package/dist/exit-codes.d.ts +7 -0
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +7 -0
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/knowledge-health.d.ts +21 -0
- package/dist/knowledge-health.d.ts.map +1 -1
- package/dist/nexus-account.d.ts +160 -0
- package/dist/nexus-account.d.ts.map +1 -0
- package/dist/nexus-account.js +68 -0
- package/dist/nexus-account.js.map +1 -0
- package/dist/operations/focus.d.ts +7 -3
- package/dist/operations/focus.d.ts.map +1 -1
- package/dist/operations/nexus-scope-map.d.ts +8 -0
- package/dist/operations/nexus-scope-map.d.ts.map +1 -1
- package/dist/operations/nexus-scope-map.js +8 -0
- package/dist/operations/nexus-scope-map.js.map +1 -1
- package/dist/operations/nexus.d.ts +265 -0
- package/dist/operations/nexus.d.ts.map +1 -1
- package/dist/operations/nexus.js +9 -1
- package/dist/operations/nexus.js.map +1 -1
- package/dist/operations/orchestrate.d.ts +6 -1
- package/dist/operations/orchestrate.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.d.ts.map +1 -1
- package/dist/operations/output-contracts-data.js +115 -1
- package/dist/operations/output-contracts-data.js.map +1 -1
- package/dist/operations/tasks.d.ts +73 -9
- package/dist/operations/tasks.d.ts.map +1 -1
- package/dist/operations/tasks.js.map +1 -1
- package/dist/project-lifecycle.d.ts +6 -2
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/session.d.ts +19 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +9 -2
- package/dist/session.js.map +1 -1
- package/dist/task.d.ts +35 -1
- package/dist/task.d.ts.map +1 -1
- package/dist/tools/score-task-priority.d.ts +1 -1
- package/dist/tools/score-task-priority.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/branch-lock.ts +38 -3
- package/src/data-accessor.ts +211 -16
- package/src/decide.ts +127 -1
- package/src/dispatch/operations-registry.ts +144 -6
- package/src/doctor.ts +9 -0
- package/src/exit-codes.ts +7 -0
- package/src/index.ts +48 -0
- package/src/knowledge-health.ts +22 -0
- package/src/nexus-account.ts +181 -0
- package/src/operations/focus.ts +7 -3
- package/src/operations/nexus-scope-map.ts +9 -0
- package/src/operations/nexus.ts +281 -0
- package/src/operations/orchestrate.ts +6 -2
- package/src/operations/output-contracts-data.ts +125 -1
- package/src/operations/tasks.ts +78 -12
- package/src/project-lifecycle.ts +6 -2
- package/src/session.ts +20 -2
- package/src/task.ts +37 -1
- package/src/tools/score-task-priority.ts +1 -1
package/src/session.ts
CHANGED
|
@@ -132,6 +132,17 @@ export interface Session {
|
|
|
132
132
|
* @defaultValue undefined
|
|
133
133
|
*/
|
|
134
134
|
parentSessionId?: string | null;
|
|
135
|
+
/**
|
|
136
|
+
* ID of the orchestrator session that SPAWNED this one, recorded by the
|
|
137
|
+
* spawn itself (T12502). Unlike {@link Session.parentSessionId}, which a
|
|
138
|
+
* process declares for itself at `session start`, only the spawn writes
|
|
139
|
+
* this edge, so the task-claim chokepoint trusts it to let a spawn family
|
|
140
|
+
* pass a live lease between its members. Read-only on the session record:
|
|
141
|
+
* the whole-row session upsert never writes it.
|
|
142
|
+
*
|
|
143
|
+
* @defaultValue undefined
|
|
144
|
+
*/
|
|
145
|
+
spawnedBySessionId?: string | null;
|
|
135
146
|
/** Provider-specific agent identifier string. @defaultValue undefined */
|
|
136
147
|
agentIdentifier?: string | null;
|
|
137
148
|
/** ISO 8601 timestamp of when the handoff was consumed. @defaultValue undefined */
|
|
@@ -233,9 +244,16 @@ export class SessionView {
|
|
|
233
244
|
return this._sessions.length;
|
|
234
245
|
}
|
|
235
246
|
|
|
236
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* First `active` session in THIS collection — a scan over the rows the
|
|
249
|
+
* caller loaded, NOT the caller's own session (T12500). With several agents
|
|
250
|
+
* active it names an arbitrary one of them.
|
|
251
|
+
*
|
|
252
|
+
* @deprecated For "my session" use `resolveBoundSession` (mutations) or
|
|
253
|
+
* `resolveSessionForRead` (reads, labels an unbound guess).
|
|
254
|
+
*/
|
|
237
255
|
findActive(): Session | undefined {
|
|
238
|
-
return this._sessions.find((s) => s.status === 'active');
|
|
256
|
+
return this._sessions.find((s) => s.status === 'active'); // get-active-session-allowed: collection scan over caller-supplied rows, not identity (T12500)
|
|
239
257
|
}
|
|
240
258
|
|
|
241
259
|
/** Find a session by ID. */
|
package/src/task.ts
CHANGED
|
@@ -723,9 +723,22 @@ export interface Task {
|
|
|
723
723
|
*/
|
|
724
724
|
pipelineStage?: string | null;
|
|
725
725
|
|
|
726
|
-
/**
|
|
726
|
+
/**
|
|
727
|
+
* First-class human / owner assignee (`cleo assignee`, Studio boards).
|
|
728
|
+
* Separate from the agent work lease in {@link Task.claim}: `cleo start`,
|
|
729
|
+
* `cleo claim` and spawn never write it (T12502). @defaultValue undefined
|
|
730
|
+
*/
|
|
727
731
|
assignee?: string | null;
|
|
728
732
|
|
|
733
|
+
/**
|
|
734
|
+
* The agent work lease held on this task, when one is recorded (T12502).
|
|
735
|
+
* Absent when the task is unclaimed. Distinct from the human
|
|
736
|
+
* {@link Task.assignee}. Read-only on the task object: full-row writes
|
|
737
|
+
* never carry it, only the claim chokepoint changes it.
|
|
738
|
+
* @defaultValue undefined
|
|
739
|
+
*/
|
|
740
|
+
claim?: TaskClaim;
|
|
741
|
+
|
|
729
742
|
/**
|
|
730
743
|
* Abort reason when a worker was stopped due to runaway detection (T1658).
|
|
731
744
|
*
|
|
@@ -1020,3 +1033,26 @@ export interface TaskWorkState {
|
|
|
1020
1033
|
/** ID of the primary session managing this work state. @defaultValue undefined */
|
|
1021
1034
|
primarySession?: string | null;
|
|
1022
1035
|
}
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* A leased agent claim on a task (T12502 · epic T12497).
|
|
1039
|
+
*
|
|
1040
|
+
* Taken by `cleo start`, `cleo claim` and spawn with a compare-and-set in the
|
|
1041
|
+
* same write transaction; renewed by the holder session's activity or
|
|
1042
|
+
* `cleo claim <id> --renew`; released by `cleo stop`, completion,
|
|
1043
|
+
* cancellation, archive and the holder session ending. A claim whose
|
|
1044
|
+
* `leaseExpiresAt` has passed stays recorded until another session takes it
|
|
1045
|
+
* over explicitly (`--take-over`, audited).
|
|
1046
|
+
*
|
|
1047
|
+
* @task T12502
|
|
1048
|
+
*/
|
|
1049
|
+
export interface TaskClaim {
|
|
1050
|
+
/** Session holding the lease. */
|
|
1051
|
+
sessionId: string;
|
|
1052
|
+
/** Agent identity of the holder (`CLEO_AGENT_ID` / spawn handle), or `null`. */
|
|
1053
|
+
agentId: string | null;
|
|
1054
|
+
/** ISO-8601 UTC instant the lease was taken. */
|
|
1055
|
+
claimedAt: string;
|
|
1056
|
+
/** ISO-8601 UTC instant the lease lapses unless renewed. */
|
|
1057
|
+
leaseExpiresAt: string;
|
|
1058
|
+
}
|
|
@@ -26,7 +26,7 @@ export interface ScoreTaskInput {
|
|
|
26
26
|
labels?: string[];
|
|
27
27
|
/** Severity axis (orthogonal to priority); unset for most tasks. */
|
|
28
28
|
severity?: TaskSeverity | null;
|
|
29
|
-
/** Kind axis;
|
|
29
|
+
/** Kind axis; not part of the order — an unset severity is unknown, never imputed from `kind` (D11161). */
|
|
30
30
|
kind?: TaskKind | null;
|
|
31
31
|
}
|
|
32
32
|
|