@cleocode/contracts 2026.5.130 → 2026.5.132
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/__tests__/atomic-tools-contract.test.d.ts +14 -0
- package/dist/__tests__/atomic-tools-contract.test.d.ts.map +1 -0
- package/dist/__tests__/atomic-tools-contract.test.js +55 -0
- package/dist/__tests__/atomic-tools-contract.test.js.map +1 -0
- package/dist/__tests__/gateway-contract.test.d.ts +18 -0
- package/dist/__tests__/gateway-contract.test.d.ts.map +1 -0
- package/dist/__tests__/gateway-contract.test.js +187 -0
- package/dist/__tests__/gateway-contract.test.js.map +1 -0
- package/dist/__tests__/mvi.test.d.ts +17 -0
- package/dist/__tests__/mvi.test.d.ts.map +1 -0
- package/dist/__tests__/mvi.test.js +147 -0
- package/dist/__tests__/mvi.test.js.map +1 -0
- package/dist/__tests__/operation-def.test.js +1 -1
- package/dist/__tests__/operation-def.test.js.map +1 -1
- package/dist/boundary.d.ts +26 -0
- package/dist/boundary.d.ts.map +1 -1
- package/dist/boundary.js +44 -6
- package/dist/boundary.js.map +1 -1
- package/dist/branch-lock.d.ts +35 -1
- package/dist/branch-lock.d.ts.map +1 -1
- package/dist/branch-lock.js +23 -2
- package/dist/branch-lock.js.map +1 -1
- package/dist/daemon/__tests__/health-roundtrip.test.d.ts +13 -0
- package/dist/daemon/__tests__/health-roundtrip.test.d.ts.map +1 -0
- package/dist/daemon/__tests__/health-roundtrip.test.js +69 -0
- package/dist/daemon/__tests__/health-roundtrip.test.js.map +1 -0
- package/dist/daemon/health.d.ts +108 -0
- package/dist/daemon/health.d.ts.map +1 -0
- package/dist/daemon/health.js +95 -0
- package/dist/daemon/health.js.map +1 -0
- package/dist/daemon/index.d.ts +24 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +22 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/subsystem.d.ts +121 -0
- package/dist/daemon/subsystem.d.ts.map +1 -0
- package/dist/daemon/subsystem.js +28 -0
- package/dist/daemon/subsystem.js.map +1 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.d.ts +15 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.d.ts.map +1 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.js +40 -0
- package/dist/daemon-ipc/__tests__/daemon-ipc-freeze.test.js.map +1 -0
- package/dist/daemon-ipc/index.d.ts +44 -0
- package/dist/daemon-ipc/index.d.ts.map +1 -0
- package/dist/daemon-ipc/index.js +43 -0
- package/dist/daemon-ipc/index.js.map +1 -0
- package/dist/db-inventory.json +8 -8
- package/dist/dispatch/identity.d.ts +1 -1
- package/dist/dispatch/identity.d.ts.map +1 -1
- package/dist/dispatch/identity.js +3 -0
- package/dist/dispatch/identity.js.map +1 -1
- package/dist/dispatch/operation-def.d.ts +16 -0
- package/dist/dispatch/operation-def.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.d.ts.map +1 -1
- package/dist/dispatch/operations-registry.js +133 -0
- package/dist/dispatch/operations-registry.js.map +1 -1
- package/dist/exit-codes.d.ts +1 -1
- package/dist/exit-codes.js +1 -1
- package/dist/gateway/rpc/__tests__/freeze.test.d.ts +20 -0
- package/dist/gateway/rpc/__tests__/freeze.test.d.ts.map +1 -0
- package/dist/gateway/rpc/__tests__/freeze.test.js +122 -0
- package/dist/gateway/rpc/__tests__/freeze.test.js.map +1 -0
- package/dist/gateway/rpc/index.d.ts +23 -0
- package/dist/gateway/rpc/index.d.ts.map +1 -0
- package/dist/gateway/rpc/index.js +22 -0
- package/dist/gateway/rpc/index.js.map +1 -0
- package/dist/gateway/rpc/messages.d.ts +263 -0
- package/dist/gateway/rpc/messages.d.ts.map +1 -0
- package/dist/gateway/rpc/messages.js +152 -0
- package/dist/gateway/rpc/messages.js.map +1 -0
- package/dist/gateway/rpc/version.d.ts +39 -0
- package/dist/gateway/rpc/version.d.ts.map +1 -0
- package/dist/gateway/rpc/version.js +39 -0
- package/dist/gateway/rpc/version.js.map +1 -0
- package/dist/gateway.d.ts +239 -0
- package/dist/gateway.d.ts.map +1 -0
- package/dist/gateway.js +171 -0
- package/dist/gateway.js.map +1 -0
- package/dist/goal.d.ts +314 -0
- package/dist/goal.d.ts.map +1 -0
- package/dist/goal.js +118 -0
- package/dist/goal.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/mvi.d.ts +209 -0
- package/dist/mvi.d.ts.map +1 -0
- package/dist/mvi.js +99 -0
- package/dist/mvi.js.map +1 -0
- package/dist/operations/attention.d.ts +114 -0
- package/dist/operations/attention.d.ts.map +1 -0
- package/dist/operations/attention.js +22 -0
- package/dist/operations/attention.js.map +1 -0
- package/dist/operations/focus.d.ts +25 -0
- package/dist/operations/focus.d.ts.map +1 -1
- package/dist/operations/index.d.ts +1 -0
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +1 -0
- package/dist/operations/index.js.map +1 -1
- package/dist/operations/session.d.ts +11 -0
- package/dist/operations/session.d.ts.map +1 -1
- package/dist/release/evidence-atoms.d.ts +3 -2
- package/dist/release/evidence-atoms.d.ts.map +1 -1
- package/dist/release/evidence-atoms.js +3 -2
- package/dist/release/evidence-atoms.js.map +1 -1
- package/dist/sdk-tool.d.ts +1 -1
- package/dist/sdk-tool.js +1 -1
- package/dist/supervisor-ipc/__tests__/freeze.test.d.ts +15 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.d.ts.map +1 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.js +159 -0
- package/dist/supervisor-ipc/__tests__/freeze.test.js.map +1 -0
- package/dist/supervisor-ipc/index.d.ts +15 -0
- package/dist/supervisor-ipc/index.d.ts.map +1 -0
- package/dist/supervisor-ipc/index.js +14 -0
- package/dist/supervisor-ipc/index.js.map +1 -0
- package/dist/supervisor-ipc/messages.d.ts +457 -0
- package/dist/supervisor-ipc/messages.d.ts.map +1 -0
- package/dist/supervisor-ipc/messages.js +312 -0
- package/dist/supervisor-ipc/messages.js.map +1 -0
- package/dist/supervisor-ipc/version.d.ts +29 -0
- package/dist/supervisor-ipc/version.d.ts.map +1 -0
- package/dist/supervisor-ipc/version.js +29 -0
- package/dist/supervisor-ipc/version.js.map +1 -0
- package/dist/task.d.ts +5 -5
- package/dist/tools/__tests__/composite.test.d.ts +14 -0
- package/dist/tools/__tests__/composite.test.d.ts.map +1 -0
- package/dist/tools/__tests__/composite.test.js +75 -0
- package/dist/tools/__tests__/composite.test.js.map +1 -0
- package/dist/tools/atomic.d.ts +195 -0
- package/dist/tools/atomic.d.ts.map +1 -0
- package/dist/tools/atomic.js +82 -0
- package/dist/tools/atomic.js.map +1 -0
- package/dist/tools/composite.d.ts +128 -0
- package/dist/tools/composite.d.ts.map +1 -0
- package/dist/tools/composite.js +88 -0
- package/dist/tools/composite.js.map +1 -0
- package/package.json +34 -2
- package/src/__tests__/__snapshots__/operations-registry.test.ts.snap +1 -1
- package/src/__tests__/atomic-tools-contract.test.ts +67 -0
- package/src/__tests__/gateway-contract.test.ts +219 -0
- package/src/__tests__/mvi.test.ts +175 -0
- package/src/__tests__/operation-def.test.ts +2 -1
- package/src/boundary.ts +76 -6
- package/src/branch-lock.ts +49 -2
- package/src/daemon/__tests__/health-roundtrip.test.ts +84 -0
- package/src/daemon/health.ts +121 -0
- package/src/daemon/index.ts +35 -0
- package/src/daemon/subsystem.ts +126 -0
- package/src/daemon-ipc/__tests__/daemon-ipc-freeze.test.ts +53 -0
- package/src/daemon-ipc/index.ts +90 -0
- package/src/db-inventory.json +8 -8
- package/src/dispatch/identity.ts +3 -0
- package/src/dispatch/operation-def.ts +16 -0
- package/src/dispatch/operations-registry.ts +140 -0
- package/src/exit-codes.ts +1 -1
- package/src/gateway/rpc/__tests__/freeze.test.ts +139 -0
- package/src/gateway/rpc/index.ts +43 -0
- package/src/gateway/rpc/messages.ts +187 -0
- package/src/gateway/rpc/version.ts +40 -0
- package/src/gateway.ts +252 -0
- package/src/goal.ts +348 -0
- package/src/index.ts +109 -0
- package/src/mvi.ts +236 -0
- package/src/operations/attention.ts +117 -0
- package/src/operations/focus.ts +26 -0
- package/src/operations/index.ts +1 -0
- package/src/operations/session.ts +11 -0
- package/src/release/evidence-atoms.ts +3 -2
- package/src/sdk-tool.ts +1 -1
- package/src/supervisor-ipc/__tests__/freeze.test.ts +180 -0
- package/src/supervisor-ipc/index.ts +62 -0
- package/src/supervisor-ipc/messages.ts +396 -0
- package/src/supervisor-ipc/version.ts +30 -0
- package/src/task.ts +5 -5
- package/src/tools/__tests__/composite.test.ts +88 -0
- package/src/tools/atomic.ts +274 -0
- package/src/tools/composite.ts +173 -0
package/dist/index.js
CHANGED
|
@@ -15,6 +15,12 @@ export { CHANGESET_KINDS, ChangesetEntrySchema } from './changesets.js';
|
|
|
15
15
|
export { CLI_CATEGORY_ORDER } from './cli-category.js';
|
|
16
16
|
export { CLEO_CONFIG_MANIFEST, CONFIG_MANIFEST_ENTRIES, configManifestEntrySchema, GLOBAL_CLEO_CONFIG_MANIFEST, PROJECT_CONTEXT_MANIFEST, PROJECT_INFO_MANIFEST, } from './config/manifest.js';
|
|
17
17
|
export { parseClaudeCodeCredentials } from './credentials.js';
|
|
18
|
+
export { HealthStatusSchema, SUBSYSTEM_LIFECYCLE_PHASES, SubsystemHealthSchema, SubsystemStateSchema, summarizeHealth, toMonitorChildren, } from './daemon/index.js';
|
|
19
|
+
// === Daemon-IPC v1.0 (AC8 alias of supervisor-ipc — T11369 · R2 gates R4-R7) ===
|
|
20
|
+
// `daemon-ipc` is the AC8-named re-export barrel over the FROZEN supervisor-ipc
|
|
21
|
+
// v1.0 contract — one contract, two names. The subpath
|
|
22
|
+
// `@cleocode/contracts/daemon-ipc` resolves via the package `./*` export.
|
|
23
|
+
export { DAEMON_IPC_PROTOCOL_VERSION } from './daemon-ipc/index.js';
|
|
18
24
|
export { DB_INVENTORY } from './db-inventory.js';
|
|
19
25
|
export { CANONICAL_DOMAINS } from './dispatch/identity.js';
|
|
20
26
|
// === Dispatch OPERATIONS data + builder helpers (T10061 — T9833b / E-CLI-BOUNDARY / SG-ARCH-SOLID) ===
|
|
@@ -48,12 +54,14 @@ E_INVALID_PIPELINE_STAGE, E_INVALID_SEVERITY_VALUE, E_INVALID_STATE, E_PLAN_NOT_
|
|
|
48
54
|
E_WRITE_CONTENTION, ExitCode, getExitCodeName, isErrorCode, isNoChangeCode, isRecoverableCode, isSuccessCode, } from './exit-codes.js';
|
|
49
55
|
// === Facade API Interfaces ===
|
|
50
56
|
export { AGENT_INSTANCE_STATUSES, AGENT_TYPES, BRAIN_OBSERVATION_TYPES, } from './facade.js';
|
|
57
|
+
export { GOAL_STATUSES, GOAL_TARGET_TASK_ID_REGEX, GOAL_TERMINAL_STATUSES, isFuzzyGoal, isTaskCompletionGoal, isTerminalGoalStatus, isValidGoalTargetTaskId, } from './goal.js';
|
|
51
58
|
export { confidenceFromProvenance, confidenceLabelFromNumeric, provenanceFromNumeric, } from './graph.js';
|
|
52
59
|
export { ADR_056_INVARIANTS, ADR_073_INVARIANTS, getInvariant, getInvariantsByAdr, INVARIANTS_REGISTRY, } from './invariants/index.js';
|
|
53
60
|
// === LAFS Envelope Types ===
|
|
54
61
|
export { isGatewayEnvelope, isLafsError, isLafsSuccess, } from './lafs.js';
|
|
55
62
|
export { PluginDeniedError, PluginLlmError, PluginModelGateError, PluginRateLimitedError, } from './llm/plugin-llm.js';
|
|
56
63
|
export { BRAIN_OBSERVATION_SOURCE_TYPES } from './memory/observe.js';
|
|
64
|
+
export { expansionFromNextDirectives, expansionFromStructuredOps, expansionFromSuggestedCommands, isNextDirectivesHint, isStructuredOpsHint, isSuggestedCommandsHint, } from './mvi.js';
|
|
57
65
|
export { E_LAFS_OPERATION_ERROR_SHAPE, E_LAFS_OPERATION_RESULT_SCHEMA, E_LAFS_OPERATION_UNREGISTERED, OPERATION_RESULT_SCHEMAS, validateOperationEnvelope, } from './operation-envelope-validation.js';
|
|
58
66
|
// === Docs Operation Types (T10618 — docs.update lifecycle status SSoT) ===
|
|
59
67
|
// Re-exported at top level so core and CLI layers can consume the same
|
|
@@ -85,6 +93,8 @@ PIPELINE_STATUS_ICONS, SESSION_STATUSES, STAGE_STATUS_ICONS, STATUS_REGISTRY, TA
|
|
|
85
93
|
TASK_STATUSES, TERMINAL_PIPELINE_STATUSES, TERMINAL_STAGE_STATUSES,
|
|
86
94
|
// Terminal state sets
|
|
87
95
|
TERMINAL_TASK_STATUSES, } from './status-registry.js';
|
|
96
|
+
// === Supervisor IPC v1.0 (FROZEN — T11339 · SG-RUNTIME-UNIFICATION R1) ===
|
|
97
|
+
export { ChildStateSchema, ChildStatusSchema, EnvPairSchema, ErrorResponseSchema, HealthRequestSchema, HealthResponseSchema, LifecycleEventKindSchema, LifecycleEventResponseSchema, MonitorRequestSchema, MonitorResponseSchema, RestartedResponseSchema, RestartRequestSchema, SpawnedResponseSchema, SpawnRequestSchema, SUPERVISOR_IPC_CHANNEL_BASENAME, SUPERVISOR_IPC_MESSAGE_KINDS, SUPERVISOR_IPC_PROTOCOL_VERSION, SUPERVISOR_IPC_REQUEST_KINDS, SUPERVISOR_IPC_RESPONSE_KINDS, SupervisorIpcEnvelopeSchema, SupervisorIpcRequestEnvelopeSchema, SupervisorIpcRequestSchema, SupervisorIpcResponseEnvelopeSchema, SupervisorIpcResponseSchema, } from './supervisor-ipc/index.js';
|
|
88
98
|
export { isTestFixtureOrigin, TASK_ORIGIN_CANONICAL } from './task.js';
|
|
89
99
|
export { commandOutputEvidenceSchema, fileEvidenceSchema, logEvidenceSchema, screenshotEvidenceSchema, taskEvidenceSchema, testOutputEvidenceSchema, } from './task-evidence.js';
|
|
90
100
|
// === Archive Reason Enum (T1409 — typed z.enum + tombstone guard) ===
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,2DAA2D;AAC3D,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,6BAA6B,CAAC;AA0DrC,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAkChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA6ClD,iDAAiD;AACjD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAGxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AA4BvD,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAiD9B,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH,2DAA2D;AAC3D,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,oBAAoB,EACpB,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,cAAc,GACf,MAAM,6BAA6B,CAAC;AA0DrC,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,gBAA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,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MVI (Minimum-Viable-Information) progressive-disclosure primitive.
|
|
3
|
+
*
|
|
4
|
+
* CLEO historically grew three *separate* "expansion-hint" conventions, each
|
|
5
|
+
* answering the same question — *"the agent got a lean result; how does it
|
|
6
|
+
* drill deeper?"* — in a different wire shape:
|
|
7
|
+
*
|
|
8
|
+
* 1. **`_next`** (`core/src/mvi-helpers.ts`) — `Record<string, string>`: a map
|
|
9
|
+
* of follow-up *name* → copy-pasteable CLI command
|
|
10
|
+
* (`{ full: "cleo show T1", children: "cleo find --parent T1" }`).
|
|
11
|
+
* 2. **`meta.suggestedNext`** (`core/src/dispatch/suggested-next.ts`, T9920) — a
|
|
12
|
+
* flat `ReadonlyArray<string>` of copy-pasteable CLI commands.
|
|
13
|
+
* 3. **`_nexus.suggestedNext`** (`contracts/operations/nexus-scope.ts`) — a
|
|
14
|
+
* `ReadonlyArray<SuggestedNextOp>` of machine-readable, structured operations.
|
|
15
|
+
*
|
|
16
|
+
* {@link MviDigest} is the single primitive that unifies them. A digest
|
|
17
|
+
* describes a *collapsed* collection: a one-line `summary`, the total `count`,
|
|
18
|
+
* an optional bounded `preview` sample, and exactly one {@link ExpansionHint}
|
|
19
|
+
* describing how to fetch the rest. The hint is a discriminated union whose
|
|
20
|
+
* variants are the three legacy conventions — so existing producers can emit a
|
|
21
|
+
* digest and existing consumers can read one *without any `any` casts*.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
* @module @cleocode/contracts/mvi
|
|
25
|
+
*
|
|
26
|
+
* @epic T11285 EP-MVI-PRIMITIVE
|
|
27
|
+
* @task T11349
|
|
28
|
+
* @saga T11283 SG-COGNITIVE-SUBSTRATE
|
|
29
|
+
*/
|
|
30
|
+
import type { SuggestedNextOp } from './operations/nexus-scope.js';
|
|
31
|
+
/**
|
|
32
|
+
* `_next`-style expansion hint: a map of follow-up *name* → CLI command string.
|
|
33
|
+
*
|
|
34
|
+
* The `kind` discriminant lets a single {@link MviDigest} carry any of the
|
|
35
|
+
* three legacy conventions without ambiguity. This variant corresponds to the
|
|
36
|
+
* `_next` directives built by `core/src/mvi-helpers.ts`.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const hint: NextDirectivesHint = {
|
|
41
|
+
* kind: 'next-directives',
|
|
42
|
+
* directives: { full: 'cleo show T1', children: 'cleo find --parent T1' },
|
|
43
|
+
* };
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export interface NextDirectivesHint {
|
|
49
|
+
/** Discriminant: this hint carries `_next`-style named CLI directives. */
|
|
50
|
+
readonly kind: 'next-directives';
|
|
51
|
+
/** Map of follow-up operation name → copy-pasteable CLI command string. */
|
|
52
|
+
readonly directives: Readonly<Record<string, string>>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `meta.suggestedNext`-style expansion hint: a flat list of CLI commands.
|
|
56
|
+
*
|
|
57
|
+
* Corresponds to the `ReadonlyArray<string>` promoted to
|
|
58
|
+
* `meta.suggestedNext` in T9920 (`core/src/dispatch/suggested-next.ts`).
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```ts
|
|
62
|
+
* const hint: SuggestedCommandsHint = {
|
|
63
|
+
* kind: 'suggested-commands',
|
|
64
|
+
* commands: ['cleo show T1', 'cleo focus T1'],
|
|
65
|
+
* };
|
|
66
|
+
* ```
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export interface SuggestedCommandsHint {
|
|
71
|
+
/** Discriminant: this hint carries a flat list of CLI command strings. */
|
|
72
|
+
readonly kind: 'suggested-commands';
|
|
73
|
+
/** Copy-pasteable CLI command strings the agent may run next. */
|
|
74
|
+
readonly commands: ReadonlyArray<string>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* `_nexus.suggestedNext`-style expansion hint: structured machine-readable ops.
|
|
78
|
+
*
|
|
79
|
+
* Corresponds to the `ReadonlyArray<SuggestedNextOp>` carried under
|
|
80
|
+
* `meta._nexus.suggestedNext` (`contracts/operations/nexus-scope.ts`). Display
|
|
81
|
+
* strings are *derived* from these structured fields, never the reverse.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const hint: StructuredOpsHint = {
|
|
86
|
+
* kind: 'structured-ops',
|
|
87
|
+
* ops: [{ op: 'nexus.context', args: { name: 'foo' }, scope: 'project',
|
|
88
|
+
* effect: 'read', requiresConfirmation: false, reason: 'see callers' }],
|
|
89
|
+
* };
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export interface StructuredOpsHint {
|
|
95
|
+
/** Discriminant: this hint carries structured, machine-readable operations. */
|
|
96
|
+
readonly kind: 'structured-ops';
|
|
97
|
+
/** Structured next-operations. Every `.op` resolves to a known op key. */
|
|
98
|
+
readonly ops: ReadonlyArray<SuggestedNextOp>;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Unified expansion hint — the discriminated union reconciling CLEO's three
|
|
102
|
+
* historical progressive-disclosure conventions (`_next`,
|
|
103
|
+
* `meta.suggestedNext`, `_nexus.suggestedNext`) under one type.
|
|
104
|
+
*
|
|
105
|
+
* Narrow on {@link ExpansionHint | the `.kind` discriminant} to access the
|
|
106
|
+
* variant payload without casts.
|
|
107
|
+
*
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
export type ExpansionHint = NextDirectivesHint | SuggestedCommandsHint | StructuredOpsHint;
|
|
111
|
+
/**
|
|
112
|
+
* The Minimum-Viable-Information digest: the formalized progressive-disclosure
|
|
113
|
+
* primitive for any *collapsed* collection in a LAFS envelope.
|
|
114
|
+
*
|
|
115
|
+
* Instead of streaming a full collection (and blowing the agent's token
|
|
116
|
+
* budget), a producer emits a digest: a one-line {@link MviDigest.summary}, the
|
|
117
|
+
* total {@link MviDigest.count}, an optional bounded {@link MviDigest.preview}
|
|
118
|
+
* sample, and exactly one {@link MviDigest.expand} hint describing how to fetch
|
|
119
|
+
* the remainder.
|
|
120
|
+
*
|
|
121
|
+
* @typeParam T - Element type of the underlying collection. The optional
|
|
122
|
+
* `preview` is a `ReadonlyArray<T>`; the rest of the digest is element-shape
|
|
123
|
+
* agnostic, so a producer can describe any collection with one primitive.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const digest: MviDigest<{ id: string }> = {
|
|
128
|
+
* summary: '12 child tasks (3 done, 9 pending)',
|
|
129
|
+
* count: 12,
|
|
130
|
+
* preview: [{ id: 'T1' }, { id: 'T2' }],
|
|
131
|
+
* expand: { kind: 'next-directives', directives: { all: 'cleo list --parent T0' } },
|
|
132
|
+
* };
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
export interface MviDigest<T = unknown> {
|
|
138
|
+
/** One-line human/agent-readable summary of the collapsed collection. */
|
|
139
|
+
readonly summary: string;
|
|
140
|
+
/** Total number of elements the collection contains (not the preview size). */
|
|
141
|
+
readonly count: number;
|
|
142
|
+
/**
|
|
143
|
+
* A bounded sample of elements for at-a-glance context. Omitted when no
|
|
144
|
+
* preview is carried (the agent must {@link MviDigest.expand} to see any).
|
|
145
|
+
*
|
|
146
|
+
* @defaultValue undefined
|
|
147
|
+
*/
|
|
148
|
+
readonly preview?: ReadonlyArray<T>;
|
|
149
|
+
/** Exactly one {@link ExpansionHint} describing how to fetch the remainder. */
|
|
150
|
+
readonly expand: ExpansionHint;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Adapt a legacy `_next` directives map into the unified {@link ExpansionHint}.
|
|
154
|
+
*
|
|
155
|
+
* Lets existing `core/src/mvi-helpers.ts` producers feed a digest without
|
|
156
|
+
* re-shaping their output by hand.
|
|
157
|
+
*
|
|
158
|
+
* @param directives - The `_next`-style name → CLI command map.
|
|
159
|
+
* @returns A {@link NextDirectivesHint} wrapping the directives verbatim.
|
|
160
|
+
*
|
|
161
|
+
* @public
|
|
162
|
+
*/
|
|
163
|
+
export declare function expansionFromNextDirectives(directives: Readonly<Record<string, string>>): NextDirectivesHint;
|
|
164
|
+
/**
|
|
165
|
+
* Adapt a legacy `meta.suggestedNext` command list into an {@link ExpansionHint}.
|
|
166
|
+
*
|
|
167
|
+
* @param commands - The flat `ReadonlyArray<string>` of CLI commands.
|
|
168
|
+
* @returns A {@link SuggestedCommandsHint} wrapping the commands verbatim.
|
|
169
|
+
*
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
export declare function expansionFromSuggestedCommands(commands: ReadonlyArray<string>): SuggestedCommandsHint;
|
|
173
|
+
/**
|
|
174
|
+
* Adapt a legacy `_nexus.suggestedNext` op list into an {@link ExpansionHint}.
|
|
175
|
+
*
|
|
176
|
+
* @param ops - The structured `ReadonlyArray<SuggestedNextOp>`.
|
|
177
|
+
* @returns A {@link StructuredOpsHint} wrapping the ops verbatim.
|
|
178
|
+
*
|
|
179
|
+
* @public
|
|
180
|
+
*/
|
|
181
|
+
export declare function expansionFromStructuredOps(ops: ReadonlyArray<SuggestedNextOp>): StructuredOpsHint;
|
|
182
|
+
/**
|
|
183
|
+
* Type guard: narrow an {@link ExpansionHint} to its `_next`-directives variant.
|
|
184
|
+
*
|
|
185
|
+
* @param hint - The hint to test.
|
|
186
|
+
* @returns `true` when `hint.kind === 'next-directives'`.
|
|
187
|
+
*
|
|
188
|
+
* @public
|
|
189
|
+
*/
|
|
190
|
+
export declare function isNextDirectivesHint(hint: ExpansionHint): hint is NextDirectivesHint;
|
|
191
|
+
/**
|
|
192
|
+
* Type guard: narrow an {@link ExpansionHint} to its suggested-commands variant.
|
|
193
|
+
*
|
|
194
|
+
* @param hint - The hint to test.
|
|
195
|
+
* @returns `true` when `hint.kind === 'suggested-commands'`.
|
|
196
|
+
*
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
export declare function isSuggestedCommandsHint(hint: ExpansionHint): hint is SuggestedCommandsHint;
|
|
200
|
+
/**
|
|
201
|
+
* Type guard: narrow an {@link ExpansionHint} to its structured-ops variant.
|
|
202
|
+
*
|
|
203
|
+
* @param hint - The hint to test.
|
|
204
|
+
* @returns `true` when `hint.kind === 'structured-ops'`.
|
|
205
|
+
*
|
|
206
|
+
* @public
|
|
207
|
+
*/
|
|
208
|
+
export declare function isStructuredOpsHint(hint: ExpansionHint): hint is StructuredOpsHint;
|
|
209
|
+
//# sourceMappingURL=mvi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvi.d.ts","sourceRoot":"","sources":["../src/mvi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAAC;IACpC,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;CAC9C;AAED;;;;;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* "expansion-hint" conventions, each
|
|
5
|
+
* answering the same question — *"the agent got a lean result; how does it
|
|
6
|
+
* drill deeper?"* — in a different wire shape:
|
|
7
|
+
*
|
|
8
|
+
* 1. **`_next`** (`core/src/mvi-helpers.ts`) — `Record<string, string>`: a map
|
|
9
|
+
* of follow-up *name* → copy-pasteable CLI command
|
|
10
|
+
* (`{ full: "cleo show T1", children: "cleo find --parent T1" }`).
|
|
11
|
+
* 2. **`meta.suggestedNext`** (`core/src/dispatch/suggested-next.ts`, T9920) — a
|
|
12
|
+
* flat `ReadonlyArray<string>` of copy-pasteable CLI commands.
|
|
13
|
+
* 3. **`_nexus.suggestedNext`** (`contracts/operations/nexus-scope.ts`) — a
|
|
14
|
+
* `ReadonlyArray<SuggestedNextOp>` of machine-readable, structured operations.
|
|
15
|
+
*
|
|
16
|
+
* {@link MviDigest} is the single primitive that unifies them. A digest
|
|
17
|
+
* describes a *collapsed* collection: a one-line `summary`, the total `count`,
|
|
18
|
+
* an optional bounded `preview` sample, and exactly one {@link ExpansionHint}
|
|
19
|
+
* describing how to fetch the rest. The hint is a discriminated union whose
|
|
20
|
+
* variants are the three legacy conventions — so existing producers can emit a
|
|
21
|
+
* digest and existing consumers can read one *without any `any` casts*.
|
|
22
|
+
*
|
|
23
|
+
* @packageDocumentation
|
|
24
|
+
* @module @cleocode/contracts/mvi
|
|
25
|
+
*
|
|
26
|
+
* @epic T11285 EP-MVI-PRIMITIVE
|
|
27
|
+
* @task T11349
|
|
28
|
+
* @saga T11283 SG-COGNITIVE-SUBSTRATE
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Adapt a legacy `_next` directives map into the unified {@link ExpansionHint}.
|
|
32
|
+
*
|
|
33
|
+
* Lets existing `core/src/mvi-helpers.ts` producers feed a digest without
|
|
34
|
+
* re-shaping their output by hand.
|
|
35
|
+
*
|
|
36
|
+
* @param directives - The `_next`-style name → CLI command map.
|
|
37
|
+
* @returns A {@link NextDirectivesHint} wrapping the directives verbatim.
|
|
38
|
+
*
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export function expansionFromNextDirectives(directives) {
|
|
42
|
+
return { kind: 'next-directives', directives };
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Adapt a legacy `meta.suggestedNext` command list into an {@link ExpansionHint}.
|
|
46
|
+
*
|
|
47
|
+
* @param commands - The flat `ReadonlyArray<string>` of CLI commands.
|
|
48
|
+
* @returns A {@link SuggestedCommandsHint} wrapping the commands verbatim.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export function expansionFromSuggestedCommands(commands) {
|
|
53
|
+
return { kind: 'suggested-commands', commands };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Adapt a legacy `_nexus.suggestedNext` op list into an {@link ExpansionHint}.
|
|
57
|
+
*
|
|
58
|
+
* @param ops - The structured `ReadonlyArray<SuggestedNextOp>`.
|
|
59
|
+
* @returns A {@link StructuredOpsHint} wrapping the ops verbatim.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export function expansionFromStructuredOps(ops) {
|
|
64
|
+
return { kind: 'structured-ops', ops };
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Type guard: narrow an {@link ExpansionHint} to its `_next`-directives variant.
|
|
68
|
+
*
|
|
69
|
+
* @param hint - The hint to test.
|
|
70
|
+
* @returns `true` when `hint.kind === 'next-directives'`.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export function isNextDirectivesHint(hint) {
|
|
75
|
+
return hint.kind === 'next-directives';
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Type guard: narrow an {@link ExpansionHint} to its suggested-commands variant.
|
|
79
|
+
*
|
|
80
|
+
* @param hint - The hint to test.
|
|
81
|
+
* @returns `true` when `hint.kind === 'suggested-commands'`.
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export function isSuggestedCommandsHint(hint) {
|
|
86
|
+
return hint.kind === 'suggested-commands';
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Type guard: narrow an {@link ExpansionHint} to its structured-ops variant.
|
|
90
|
+
*
|
|
91
|
+
* @param hint - The hint to test.
|
|
92
|
+
* @returns `true` when `hint.kind === 'structured-ops'`.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
export function isStructuredOpsHint(hint) {
|
|
97
|
+
return hint.kind === 'structured-ops';
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=mvi.js.map
|
package/dist/mvi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvi.js","sourceRoot":"","sources":["../src/mvi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAkIH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CACzC,UAA4C;IAE5C,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,UAAU,EAAE,CAAC;AACjD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,8BAA8B,CAC5C,QAA+B;IAE/B,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAClD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAmC;IAC5E,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAmB;IACtD,OAAO,IAAI,CAAC,IAAI,KAAK,iBAAiB,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAmB;IACzD,OAAO,IAAI,CAAC,IAAI,KAAK,oBAAoB,CAAC;AAC5C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAmB;IACrD,OAAO,IAAI,CAAC,IAAI,KAAK,gBAAgB,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attention Domain Operations Contract (Tier-2 working memory).
|
|
3
|
+
*
|
|
4
|
+
* The attention buffer is a per-agent, scope-keyed, decaying working-memory
|
|
5
|
+
* layer. `cleo attention add` (alias `jot`) writes ONE item, auto-keyed to the
|
|
6
|
+
* narrowest scope the writing agent resolves (agent > task > epic > saga >
|
|
7
|
+
* session > global) via the E0 env-first identity resolvers. Because visibility
|
|
8
|
+
* is the scope key itself, an agent working task `T-A` can never read the
|
|
9
|
+
* agent/task-scoped items written by an agent working `T-B` — cross-agent
|
|
10
|
+
* leakage is structurally impossible (Epic T11288).
|
|
11
|
+
*
|
|
12
|
+
* CLI identifiers start with `attention.*` and route through the `attention`
|
|
13
|
+
* domain handler. These operation types are the wire-format API contract.
|
|
14
|
+
*
|
|
15
|
+
* @task T11373 — Attention CLI + dispatch op
|
|
16
|
+
* @epic T11288 EP-TIER2-ATTENTION
|
|
17
|
+
* @saga T11283 SG-COGNITIVE-SUBSTRATE
|
|
18
|
+
* @see packages/core/src/memory/attention.ts
|
|
19
|
+
* @see packages/cleo/src/dispatch/domains/attention.ts
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Scope-kind taxonomy for attention items, ordered NARROWEST → BROADEST.
|
|
23
|
+
*
|
|
24
|
+
* Mirrors `BRAIN_ATTENTION_SCOPE_KINDS` in the brain schema; declared here so
|
|
25
|
+
* the wire contract does not depend on the core schema module.
|
|
26
|
+
*/
|
|
27
|
+
export type AttentionScopeKind = 'agent' | 'task' | 'epic' | 'saga' | 'session' | 'global';
|
|
28
|
+
/** Lifecycle status of an attention item. */
|
|
29
|
+
export type AttentionStatus = 'open' | 'consolidated' | 'discarded';
|
|
30
|
+
/**
|
|
31
|
+
* One attention item in wire format.
|
|
32
|
+
*
|
|
33
|
+
* Returned by `add`, `show`, and `list`. `tags` is always a parsed string
|
|
34
|
+
* array (decoded from the JSONB column via `json(col)`), never the raw BLOB.
|
|
35
|
+
*/
|
|
36
|
+
export interface AttentionItem {
|
|
37
|
+
/** Stable item id (`att_<ts>_<hex>`). */
|
|
38
|
+
id: string;
|
|
39
|
+
/** The jot content. */
|
|
40
|
+
content: string;
|
|
41
|
+
/** Resolved session id of the writer, if any. */
|
|
42
|
+
sessionId: string | null;
|
|
43
|
+
/** Resolved agent identity of the writer, if any. */
|
|
44
|
+
agentId: string | null;
|
|
45
|
+
/** Narrowest scope kind the item was keyed to. */
|
|
46
|
+
scopeKind: AttentionScopeKind;
|
|
47
|
+
/** Id of the bound scope (task/epic/saga id, agent id, session id, or `global`). */
|
|
48
|
+
scopeId: string;
|
|
49
|
+
/** Parsed tag list (decoded from the JSONB column). */
|
|
50
|
+
tags: string[];
|
|
51
|
+
/** Creation time, unix epoch milliseconds. */
|
|
52
|
+
createdAt: number;
|
|
53
|
+
/** Optional hard TTL, unix epoch milliseconds. */
|
|
54
|
+
expiresAt: number | null;
|
|
55
|
+
/** Optional decay score in `[0, 1]`. */
|
|
56
|
+
decayScore: number | null;
|
|
57
|
+
/** Lifecycle status. */
|
|
58
|
+
status: AttentionStatus;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Parameters for `attention.add` (alias `jot`).
|
|
62
|
+
*
|
|
63
|
+
* Identity (`sessionId`/`agentId`) and the current task are resolved server-
|
|
64
|
+
* side from the environment (E0) — callers do NOT pass them by default. The
|
|
65
|
+
* optional `scope` override escalates the auto-resolved narrowest scope.
|
|
66
|
+
*/
|
|
67
|
+
export interface AttentionAddParams {
|
|
68
|
+
/** The jot content. Required, non-empty. */
|
|
69
|
+
content: string;
|
|
70
|
+
/** Optional tags to attach. */
|
|
71
|
+
tags?: string[];
|
|
72
|
+
/**
|
|
73
|
+
* Optional explicit scope override. When omitted the narrowest resolvable
|
|
74
|
+
* scope is used. Accepts a scope kind to escalate to (e.g. `epic`, `saga`).
|
|
75
|
+
*/
|
|
76
|
+
scope?: AttentionScopeKind;
|
|
77
|
+
/** Optional TTL in seconds from now (sets `expiresAt`). */
|
|
78
|
+
ttlSeconds?: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parameters for `attention.list` / `attention.show`.
|
|
82
|
+
*
|
|
83
|
+
* With no flags the resolved scope chain (narrowest + visible ancestors) of the
|
|
84
|
+
* calling agent is used. `--scope` restricts to one kind; `--tag` filters by
|
|
85
|
+
* "contains ALL" membership.
|
|
86
|
+
*/
|
|
87
|
+
export interface AttentionListParams {
|
|
88
|
+
/** Restrict to one scope kind. */
|
|
89
|
+
scope?: AttentionScopeKind;
|
|
90
|
+
/** "Contains ALL" tag filter. */
|
|
91
|
+
tags?: string[];
|
|
92
|
+
/** Include non-open items too (default: open only). */
|
|
93
|
+
includeAll?: boolean;
|
|
94
|
+
/** Max rows. */
|
|
95
|
+
limit?: number;
|
|
96
|
+
}
|
|
97
|
+
/** Result of `attention.add`. */
|
|
98
|
+
export interface AttentionAddResult {
|
|
99
|
+
/** The persisted item. */
|
|
100
|
+
item: AttentionItem;
|
|
101
|
+
}
|
|
102
|
+
/** Result of `attention.list` / `attention.show`. */
|
|
103
|
+
export interface AttentionListResult {
|
|
104
|
+
/** Matching items, newest first. */
|
|
105
|
+
items: AttentionItem[];
|
|
106
|
+
/** Total returned (== items.length; the digest carries the live count). */
|
|
107
|
+
total: number;
|
|
108
|
+
/** The scope chain the items were resolved against (for transparency). */
|
|
109
|
+
resolvedScopes: Array<{
|
|
110
|
+
kind: AttentionScopeKind;
|
|
111
|
+
id: string;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=attention.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attention.d.ts","sourceRoot":"","sources":["../../src/operations/attention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;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B,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,iCAAiC;AACjC,MAAM,WAAW,kBAAkB;IACjC,0BAA0B;IAC1B,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,kBAAkB,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attention Domain Operations Contract (Tier-2 working memory).
|
|
3
|
+
*
|
|
4
|
+
* The attention buffer is a per-agent, scope-keyed, decaying working-memory
|
|
5
|
+
* layer. `cleo attention add` (alias `jot`) writes ONE item, auto-keyed to the
|
|
6
|
+
* narrowest scope the writing agent resolves (agent > task > epic > saga >
|
|
7
|
+
* session > global) via the E0 env-first identity resolvers. Because visibility
|
|
8
|
+
* is the scope key itself, an agent working task `T-A` can never read the
|
|
9
|
+
* agent/task-scoped items written by an agent working `T-B` — cross-agent
|
|
10
|
+
* leakage is structurally impossible (Epic T11288).
|
|
11
|
+
*
|
|
12
|
+
* CLI identifiers start with `attention.*` and route through the `attention`
|
|
13
|
+
* domain handler. These operation types are the wire-format API contract.
|
|
14
|
+
*
|
|
15
|
+
* @task T11373 — Attention CLI + dispatch op
|
|
16
|
+
* @epic T11288 EP-TIER2-ATTENTION
|
|
17
|
+
* @saga T11283 SG-COGNITIVE-SUBSTRATE
|
|
18
|
+
* @see packages/core/src/memory/attention.ts
|
|
19
|
+
* @see packages/cleo/src/dispatch/domains/attention.ts
|
|
20
|
+
*/
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=attention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attention.js","sourceRoot":"","sources":["../../src/operations/attention.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
|
|
@@ -11,7 +11,23 @@
|
|
|
11
11
|
* @task T9973
|
|
12
12
|
* @epic T9964 E-ORIENT-V2
|
|
13
13
|
*/
|
|
14
|
+
import type { MviDigest } from '../mvi.js';
|
|
15
|
+
import type { AttentionScopeKind } from './attention.js';
|
|
14
16
|
import type { MemoryCompactHit } from './memory.js';
|
|
17
|
+
/**
|
|
18
|
+
* A minimal preview element for the attention digest (T11374 · Epic T11288).
|
|
19
|
+
*
|
|
20
|
+
* The MVI digest preview carries only the few fields an agent needs to glance
|
|
21
|
+
* at a jot — the full item is one `cleo attention show` away (the expand hint).
|
|
22
|
+
*/
|
|
23
|
+
export interface AttentionDigestPreviewItem {
|
|
24
|
+
/** Item id. */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Truncated jot content. */
|
|
27
|
+
content: string;
|
|
28
|
+
/** Scope kind the jot is keyed to. */
|
|
29
|
+
scopeKind: AttentionScopeKind;
|
|
30
|
+
}
|
|
15
31
|
/**
|
|
16
32
|
* Parameters for `focus.show`.
|
|
17
33
|
*
|
|
@@ -182,6 +198,15 @@ export interface FocusShowResult {
|
|
|
182
198
|
* Omitted when the BRAIN store is unavailable.
|
|
183
199
|
*/
|
|
184
200
|
brainContext?: FocusBrainContext;
|
|
201
|
+
/**
|
|
202
|
+
* Tier-2 attention digest — a budget-bounded MVI summary of the open
|
|
203
|
+
* working-memory jots visible to the calling agent in this scope (T11374 ·
|
|
204
|
+
* Epic T11288). Carries a one-line summary, the live count, a tiny preview,
|
|
205
|
+
* and the `cleo attention show` expand hint — never a full dump. Omitted when
|
|
206
|
+
* there are zero open items (the empty-attention contract) or the buffer is
|
|
207
|
+
* unavailable.
|
|
208
|
+
*/
|
|
209
|
+
attentionDigest?: MviDigest<AttentionDigestPreviewItem>;
|
|
185
210
|
/** Estimated token weight of this envelope. */
|
|
186
211
|
tokensEstimated: number;
|
|
187
212
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/operations/focus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"focus.d.ts","sourceRoot":"","sources":["../../src/operations/focus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,0BAA0B;IACzC,eAAe;IACf,EAAE,EAAE,MAAM,CAAC;IACX,6BAA6B;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAMD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,6EAA6E;IAC7E,EAAE,EAAE,MAAM,CAAC;CACZ;AAMD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,MAAM,CAAC,E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AC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
|
package/dist/operations/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC"}
|
|
@@ -523,6 +523,17 @@ export interface SessionEndParams {
|
|
|
523
523
|
* @task T140 @epic T134
|
|
524
524
|
*/
|
|
525
525
|
sessionSummary?: import('../config.js').SessionSummaryInput;
|
|
526
|
+
/**
|
|
527
|
+
* Explicit session id to end (T11346 · Epic T11284).
|
|
528
|
+
*
|
|
529
|
+
* When omitted, session-end targets the CALLER's session resolved env-first
|
|
530
|
+
* (`CLEO_SESSION_ID` → … → most-recent active). When provided, this id
|
|
531
|
+
* overrides env/active resolution. Either way, one agent can no longer end a
|
|
532
|
+
* different concurrently-active agent's session implicitly.
|
|
533
|
+
*
|
|
534
|
+
* @task T11346
|
|
535
|
+
*/
|
|
536
|
+
sessionId?: string;
|
|
526
537
|
}
|
|
527
538
|
/** Result of `session.end`. */
|
|
528
539
|
export interface SessionEndResult {
|