@cleocode/contracts 2026.4.140 → 2026.4.142

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.
Files changed (38) hide show
  1. package/dist/index.d.ts +2 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/operations/admin.d.ts +70 -0
  5. package/dist/operations/admin.d.ts.map +1 -1
  6. package/dist/operations/conduit.d.ts +37 -6
  7. package/dist/operations/conduit.d.ts.map +1 -1
  8. package/dist/operations/conduit.js +16 -6
  9. package/dist/operations/conduit.js.map +1 -1
  10. package/dist/operations/index.d.ts +1 -0
  11. package/dist/operations/index.d.ts.map +1 -1
  12. package/dist/operations/index.js +1 -0
  13. package/dist/operations/index.js.map +1 -1
  14. package/dist/operations/llm.d.ts +1 -1
  15. package/dist/operations/llm.js +1 -1
  16. package/dist/operations/nexus.d.ts +214 -0
  17. package/dist/operations/nexus.d.ts.map +1 -1
  18. package/dist/operations/release.d.ts +79 -0
  19. package/dist/operations/release.d.ts.map +1 -1
  20. package/dist/operations/sentient.d.ts +166 -0
  21. package/dist/operations/sentient.d.ts.map +1 -0
  22. package/dist/operations/sentient.js +15 -0
  23. package/dist/operations/sentient.js.map +1 -0
  24. package/dist/operations/tasks.d.ts +242 -0
  25. package/dist/operations/tasks.d.ts.map +1 -1
  26. package/dist/operations/validate.d.ts +41 -0
  27. package/dist/operations/validate.d.ts.map +1 -1
  28. package/package.json +1 -1
  29. package/src/index.ts +114 -0
  30. package/src/operations/admin.ts +88 -0
  31. package/src/operations/conduit.ts +42 -6
  32. package/src/operations/index.ts +1 -0
  33. package/src/operations/llm.ts +1 -1
  34. package/src/operations/nexus.ts +258 -0
  35. package/src/operations/release.ts +87 -0
  36. package/src/operations/sentient.ts +208 -0
  37. package/src/operations/tasks.ts +307 -0
  38. package/src/operations/validate.ts +46 -0
@@ -1,8 +1,16 @@
1
1
  /**
2
- * Conduit Domain Operations (5 operations)
2
+ * Conduit Domain Operations (8 operations: 3 query, 5 mutate)
3
3
  *
4
- * Query operations: 2
5
- * Mutate operations: 3
4
+ * Query operations: 3
5
+ * - conduit.status — connection status + unread count
6
+ * - conduit.peek — one-shot poll for messages
7
+ * - conduit.listen — one-shot poll for topic messages (A2A, T1252)
8
+ * Mutate operations: 5
9
+ * - conduit.start — start continuous polling
10
+ * - conduit.stop — stop polling
11
+ * - conduit.send — send a message
12
+ * - conduit.subscribe — subscribe agent to a topic (A2A, T1252)
13
+ * - conduit.publish — publish message to a topic (A2A, T1252)
6
14
  *
7
15
  * CONDUIT is the agent-to-agent messaging subsystem. The protocol wraps a
8
16
  * pluggable Transport (HTTP to cloud SignalDock, LocalTransport over
@@ -16,12 +24,14 @@
16
24
  *
17
25
  * Registry note (T964 — supersedes ADR-042 Decision 1): the dispatcher
18
26
  * registers these operations under `domain: 'conduit'` with short operation
19
- * names (`status`, `peek`, `start`, `stop`, `send`). The public/HTTP identifier
20
- * `conduit.<op>` remains the stable wire-format surface and what these
21
- * contracts describe; CLI and HTTP adapters map between the two forms.
27
+ * names (`status`, `peek`, `start`, `stop`, `send`, `subscribe`, `publish`,
28
+ * `listen`). The public/HTTP identifier `conduit.<op>` remains the stable
29
+ * wire-format surface and what these contracts describe; CLI and HTTP adapters
30
+ * map between the two forms.
22
31
  *
23
32
  * @task T910 — Orchestration Coherence v4 (contract surface completion)
24
33
  * @task T964 — CONDUIT promotion to canonical domain #15
34
+ * @task T1422 — Typed-dispatch migration (Wave D, T975 follow-on)
25
35
  * @see packages/cleo/src/dispatch/domains/conduit.ts
26
36
  * @see packages/contracts/src/conduit.ts
27
37
  */
@@ -297,3 +307,29 @@ export interface ConduitListenResult {
297
307
  /** Duration of the listen call in milliseconds. */
298
308
  listenedForMs: number;
299
309
  }
310
+
311
+ // ============================================================================
312
+ // Typed Operation Record (T1422 — Wave D typed-dispatch)
313
+ // ============================================================================
314
+
315
+ /**
316
+ * Typed operation record for the conduit domain.
317
+ *
318
+ * Each key is an operation name, and each value is a tuple of
319
+ * `[Params, Result]` types. Used by the typed dispatch adapter
320
+ * (`packages/cleo/src/dispatch/adapters/typed.ts`) to provide
321
+ * compile-time narrowing on all conduit handler params.
322
+ *
323
+ * @task T1422 — Typed-dispatch migration (T975 follow-on)
324
+ * @see packages/cleo/src/dispatch/domains/conduit.ts (ConduitHandler)
325
+ */
326
+ export type ConduitOps = {
327
+ status: [ConduitStatusParams, ConduitStatusResult];
328
+ peek: [ConduitPeekParams, ConduitPeekResult];
329
+ listen: [ConduitListenParams, ConduitListenResult];
330
+ start: [ConduitStartParams, ConduitStartResult];
331
+ stop: [ConduitStopParams, ConduitStopResult];
332
+ send: [ConduitSendParams, ConduitSendResult];
333
+ subscribe: [ConduitSubscribeParams, ConduitSubscribeResult];
334
+ publish: [ConduitPublishParams, ConduitPublishResult];
335
+ };
@@ -17,6 +17,7 @@ export * from './orchestrate.js';
17
17
  export * from './params.js';
18
18
  export * from './release.js';
19
19
  export * from './research.js';
20
+ export * from './sentient.js';
20
21
  export * from './session.js';
21
22
  export * from './skills.js';
22
23
  export * from './system.js';
@@ -2,7 +2,7 @@
2
2
  * LLM operations contract types for the CLEO LLM abstraction layer.
3
3
  *
4
4
  * These are the wire-format types for the new `cleoLlmCall()` API surface
5
- * ported from Honcho's llm/ layer. They live in contracts so that packages
5
+ * ported from PSYCHE's llm/ layer. They live in contracts so that packages
6
6
  * outside core can reference them without importing the full SDK.
7
7
  *
8
8
  * @task T1399 (T1386-W13)
@@ -20,6 +20,23 @@
20
20
  */
21
21
 
22
22
  import type { LAFSPage } from '../lafs.js';
23
+ // Profile types are now canonical in nexus-user-profile.ts (T1424 dedup)
24
+ import type {
25
+ NexusProfileExportParams,
26
+ NexusProfileExportResult,
27
+ NexusProfileGetParams,
28
+ NexusProfileGetResult,
29
+ NexusProfileImportParams,
30
+ NexusProfileImportResult,
31
+ NexusProfileReinforceParams,
32
+ NexusProfileReinforceResult,
33
+ NexusProfileSupersedeParams,
34
+ NexusProfileSupersedeResult,
35
+ NexusProfileUpsertParams,
36
+ NexusProfileUpsertResult,
37
+ NexusProfileViewParams,
38
+ NexusProfileViewResult,
39
+ } from './nexus-user-profile.js';
23
40
 
24
41
  // ============================================================================
25
42
  // Shared Nexus wire-format types
@@ -709,3 +726,244 @@ export interface NexusTransferResult {
709
726
  /** Manifest describing what was moved. */
710
727
  manifest: NexusTransferManifest;
711
728
  }
729
+
730
+ // ============================================================================
731
+ // Additional operations (T1424 — typed narrowing stub types)
732
+ // ============================================================================
733
+
734
+ /** Parameters for `nexus.augment`. */
735
+ export interface NexusAugmentParams {
736
+ /** Search pattern (required). */
737
+ pattern: string;
738
+ /** Max results (default 5). */
739
+ limit?: number;
740
+ }
741
+ /** Result of `nexus.augment`. */
742
+ export type NexusAugmentResult = unknown;
743
+
744
+ /** Parameters for `nexus.top-entries`. */
745
+ export interface NexusTopEntriesParams {
746
+ /** Optional kind filter. */
747
+ kind?: string;
748
+ }
749
+ /** Result of `nexus.top-entries`. */
750
+ export type NexusTopEntriesResult = unknown;
751
+
752
+ /** Parameters for `nexus.impact`. */
753
+ export interface NexusImpactParams {
754
+ /** Symbol name (required). */
755
+ symbol: string;
756
+ /** Include "why" reasons (optional). */
757
+ why?: boolean;
758
+ }
759
+ /** Result of `nexus.impact`. */
760
+ export type NexusImpactResult = unknown;
761
+
762
+ /** Parameters for `nexus.full-context`. */
763
+ export interface NexusFullContextParams {
764
+ /** Symbol name (required). */
765
+ symbol: string;
766
+ }
767
+ /** Result of `nexus.full-context`. */
768
+ export type NexusFullContextResult = unknown;
769
+
770
+ /** Parameters for `nexus.task-footprint`. */
771
+ export interface NexusTaskFootprintParams {
772
+ /** Task ID (required). */
773
+ taskId: string;
774
+ }
775
+ /** Result of `nexus.task-footprint`. */
776
+ export type NexusTaskFootprintResult = unknown;
777
+
778
+ /** Parameters for `nexus.brain-anchors`. */
779
+ export interface NexusBrainAnchorsParams {
780
+ /** Entry ID (required). */
781
+ entryId: string;
782
+ }
783
+ /** Result of `nexus.brain-anchors`. */
784
+ export type NexusBrainAnchorsResult = unknown;
785
+
786
+ /** Parameters for `nexus.why`. */
787
+ export interface NexusWhyParams {
788
+ /** Symbol name (required). */
789
+ symbol: string;
790
+ }
791
+ /** Result of `nexus.why`. */
792
+ export type NexusWhyResult = unknown;
793
+
794
+ /** Parameters for `nexus.impact-full`. */
795
+ export interface NexusImpactFullParams {
796
+ /** Symbol name (required). */
797
+ symbol: string;
798
+ }
799
+ /** Result of `nexus.impact-full`. */
800
+ export type NexusImpactFullResult = unknown;
801
+
802
+ /** Parameters for `nexus.route-map`. */
803
+ export interface NexusRouteMapParams {
804
+ /** Project ID (optional, auto-generated from projectRoot). */
805
+ projectId?: string;
806
+ }
807
+ /** Result of `nexus.route-map`. */
808
+ export type NexusRouteMapResult = unknown;
809
+
810
+ /** Parameters for `nexus.shape-check`. */
811
+ export interface NexusShapeCheckParams {
812
+ /** Route symbol (required). */
813
+ routeSymbol: string;
814
+ /** Project ID (optional, auto-generated from projectRoot). */
815
+ projectId?: string;
816
+ }
817
+ /** Result of `nexus.shape-check`. */
818
+ export type NexusShapeCheckResult = unknown;
819
+
820
+ /** Parameters for `nexus.search-code`. */
821
+ export interface NexusSearchCodeParams {
822
+ /** Search pattern (required). */
823
+ pattern: string;
824
+ /** Max results (default 10). */
825
+ limit?: number;
826
+ }
827
+ /** Result of `nexus.search-code`. */
828
+ export type NexusSearchCodeResult = unknown;
829
+
830
+ /** Parameters for `nexus.wiki`. */
831
+ export interface NexusWikiParams {
832
+ /** Output directory (optional). */
833
+ outputDir?: string;
834
+ /** Community filter (optional). */
835
+ communityFilter?: string;
836
+ /** Incremental mode (optional). */
837
+ incremental?: boolean;
838
+ }
839
+ /** Result of `nexus.wiki`. */
840
+ export type NexusWikiResult = unknown;
841
+
842
+ /** Parameters for `nexus.contracts-show`. */
843
+ export interface NexusContractsShowParams {
844
+ /** Project A identifier (required). */
845
+ projectA: string;
846
+ /** Project B identifier (required). */
847
+ projectB: string;
848
+ }
849
+ /** Result of `nexus.contracts-show`. */
850
+ export type NexusContractsShowResult = unknown;
851
+
852
+ /** Parameters for `nexus.task-symbols`. */
853
+ export interface NexusTaskSymbolsParams {
854
+ /** Task ID (required). */
855
+ taskId: string;
856
+ }
857
+ /** Result of `nexus.task-symbols`. */
858
+ export type NexusTaskSymbolsResult = unknown;
859
+
860
+ /** Parameters for `nexus.sigil.list`. */
861
+ export interface NexusSigilListParams {
862
+ /** Role filter (optional). */
863
+ role?: string;
864
+ }
865
+ /** Result of `nexus.sigil.list`. */
866
+ export type NexusSigilListResult = unknown;
867
+
868
+ /** Parameters for `nexus.sigil.sync` — none. */
869
+ export type NexusSigilSyncParams = Record<string, never>;
870
+ /** Result of `nexus.sigil.sync`. */
871
+ export type NexusSigilSyncResult = unknown;
872
+
873
+ /** Parameters for `nexus.conduit-scan`. */
874
+ export type NexusConduitScanParams = Record<string, never>;
875
+ /** Result of `nexus.conduit-scan`. */
876
+ export type NexusConduitScanResult = unknown;
877
+
878
+ /** Parameters for `nexus.contracts-sync`. */
879
+ export interface NexusContractsSyncParams {
880
+ /** Repository path (optional). */
881
+ repoPath?: string;
882
+ /** Project ID (optional). */
883
+ projectId?: string;
884
+ }
885
+ /** Result of `nexus.contracts-sync`. */
886
+ export type NexusContractsSyncResult = unknown;
887
+
888
+ /** Parameters for `nexus.contracts-link-tasks`. */
889
+ export interface NexusContractsLinkTasksParams {
890
+ /** Repository path (optional). */
891
+ repoPath?: string;
892
+ /** Project ID (optional). */
893
+ projectId?: string;
894
+ }
895
+ /** Result of `nexus.contracts-link-tasks`. */
896
+ export type NexusContractsLinkTasksResult = unknown;
897
+
898
+ // ============================================================================
899
+ // Typed Operations Union (T1424 — Wave D typed-dispatch migration)
900
+ // ============================================================================
901
+
902
+ /**
903
+ * All Nexus domain operations mapped to their [Params, Result] tuples.
904
+ *
905
+ * This type enables {@link TypedDomainHandler} to provide compile-time safety
906
+ * for every nexus operation, eliminating the ~76 type casts in the legacy
907
+ * handler pattern (T988 audit follow-on).
908
+ *
909
+ * @task T1424 — Nexus domain typed narrowing
910
+ */
911
+ export type NexusOps = {
912
+ readonly status: readonly [NexusStatusParams, NexusStatusResult];
913
+ readonly list: readonly [NexusListParams, NexusListResult];
914
+ readonly show: readonly [NexusShowParams, NexusShowResult];
915
+ readonly resolve: readonly [NexusResolveParams, NexusResolveResult];
916
+ readonly deps: readonly [NexusDepsParams, NexusDepsResult];
917
+ readonly graph: readonly [NexusGraphParams, NexusGraphResult];
918
+ readonly 'path.show': readonly [NexusPathShowParams, NexusPathShowResult];
919
+ readonly 'blockers.show': readonly [NexusBlockersShowParams, NexusBlockersShowResult];
920
+ readonly 'orphans.list': readonly [NexusOrphansListParams, NexusOrphansListResult];
921
+ readonly discover: readonly [NexusDiscoverParams, NexusDiscoverResult];
922
+ readonly search: readonly [NexusSearchParams, NexusSearchResult];
923
+ readonly augment: readonly [NexusAugmentParams, NexusAugmentResult];
924
+ readonly 'share.status': readonly [NexusShareStatusParams, NexusShareStatusResult];
925
+ readonly 'transfer.preview': readonly [NexusTransferPreviewParams, NexusTransferPreviewResult];
926
+ readonly 'top-entries': readonly [NexusTopEntriesParams, NexusTopEntriesResult];
927
+ readonly impact: readonly [NexusImpactParams, NexusImpactResult];
928
+ readonly 'full-context': readonly [NexusFullContextParams, NexusFullContextResult];
929
+ readonly 'task-footprint': readonly [NexusTaskFootprintParams, NexusTaskFootprintResult];
930
+ readonly 'brain-anchors': readonly [NexusBrainAnchorsParams, NexusBrainAnchorsResult];
931
+ readonly why: readonly [NexusWhyParams, NexusWhyResult];
932
+ readonly 'impact-full': readonly [NexusImpactFullParams, NexusImpactFullResult];
933
+ readonly 'route-map': readonly [NexusRouteMapParams, NexusRouteMapResult];
934
+ readonly 'shape-check': readonly [NexusShapeCheckParams, NexusShapeCheckResult];
935
+ readonly 'search-code': readonly [NexusSearchCodeParams, NexusSearchCodeResult];
936
+ readonly wiki: readonly [NexusWikiParams, NexusWikiResult];
937
+ readonly 'contracts-show': readonly [NexusContractsShowParams, NexusContractsShowResult];
938
+ readonly 'task-symbols': readonly [NexusTaskSymbolsParams, NexusTaskSymbolsResult];
939
+ readonly 'profile.view': readonly [NexusProfileViewParams, NexusProfileViewResult];
940
+ readonly 'profile.get': readonly [NexusProfileGetParams, NexusProfileGetResult];
941
+ readonly 'profile.import': readonly [NexusProfileImportParams, NexusProfileImportResult];
942
+ readonly 'profile.export': readonly [NexusProfileExportParams, NexusProfileExportResult];
943
+ readonly 'profile.reinforce': readonly [NexusProfileReinforceParams, NexusProfileReinforceResult];
944
+ readonly 'profile.upsert': readonly [NexusProfileUpsertParams, NexusProfileUpsertResult];
945
+ readonly 'profile.supersede': readonly [NexusProfileSupersedeParams, NexusProfileSupersedeResult];
946
+ readonly 'sigil.list': readonly [NexusSigilListParams, NexusSigilListResult];
947
+ readonly 'sigil.sync': readonly [NexusSigilSyncParams, NexusSigilSyncResult];
948
+ readonly init: readonly [NexusInitParams, NexusInitResult];
949
+ readonly register: readonly [NexusRegisterParams, NexusRegisterResult];
950
+ readonly unregister: readonly [NexusUnregisterParams, NexusUnregisterResult];
951
+ readonly sync: readonly [NexusSyncParams, NexusSyncResult];
952
+ readonly 'permission.set': readonly [NexusPermissionSetParams, NexusPermissionSetResult];
953
+ readonly reconcile: readonly [NexusReconcileParams, NexusReconcileResult];
954
+ readonly 'share.snapshot.export': readonly [
955
+ NexusShareSnapshotExportParams,
956
+ NexusShareSnapshotExportResult,
957
+ ];
958
+ readonly 'share.snapshot.import': readonly [
959
+ NexusShareSnapshotImportParams,
960
+ NexusShareSnapshotImportResult,
961
+ ];
962
+ readonly transfer: readonly [NexusTransferParams, NexusTransferResult];
963
+ readonly 'contracts-sync': readonly [NexusContractsSyncParams, NexusContractsSyncResult];
964
+ readonly 'contracts-link-tasks': readonly [
965
+ NexusContractsLinkTasksParams,
966
+ NexusContractsLinkTasksResult,
967
+ ];
968
+ readonly 'conduit-scan': readonly [NexusConduitScanParams, NexusConduitScanResult];
969
+ };
@@ -182,3 +182,90 @@ export interface ReleaseRollbackResult {
182
182
  /** Rollback reason. @task T963 */
183
183
  reason: string;
184
184
  }
185
+
186
+ // ── RELEASE-03: IVTR gate check ──────────────────────────────────────────────
187
+
188
+ /**
189
+ * Parameters for `release.gate` — checks all IVTR loops in a release epic
190
+ * have reached the `released` phase before allowing `release.ship`.
191
+ *
192
+ * @task T820 RELEASE-03
193
+ * @task T1416
194
+ */
195
+ export interface ReleaseGateCheckParams {
196
+ /** Epic ID whose child tasks should be inspected. */
197
+ epicId: string;
198
+ /**
199
+ * Bypass the IVTR gate — requires explicit owner confirmation.
200
+ * When true, the gate check is skipped and a loud warning is emitted.
201
+ */
202
+ force?: boolean;
203
+ }
204
+
205
+ /** A single task's IVTR phase status as reported by `release.gate`. */
206
+ export interface IvtrTaskStatus {
207
+ /** Task ID. */
208
+ taskId: string;
209
+ /**
210
+ * Current IVTR phase, or `null` when no IVTR loop has been started for
211
+ * this task (task is "unchecked").
212
+ */
213
+ currentPhase: 'implement' | 'validate' | 'test' | 'released' | null;
214
+ /** Whether the task blocks release (`true` = blocking). */
215
+ blocking: boolean;
216
+ }
217
+
218
+ /**
219
+ * Result of `release.gate`.
220
+ *
221
+ * @task T820 RELEASE-03
222
+ * @task T1416
223
+ */
224
+ export interface ReleaseGateCheckResult {
225
+ /** Epic ID that was inspected. */
226
+ epicId: string;
227
+ /** Whether the gate passed — all tasks are released or unchecked. */
228
+ passed: boolean;
229
+ /** Whether the gate was bypassed via `--force`. */
230
+ forcedBypass: boolean;
231
+ /** Task IDs whose IVTR state is not `released` (blocking). */
232
+ blocked: string[];
233
+ /**
234
+ * Task IDs with no IVTR state (non-blocking; docs / chore tasks often
235
+ * have no IVTR loop).
236
+ */
237
+ unchecked: string[];
238
+ /** Full per-task status breakdown. */
239
+ tasks: IvtrTaskStatus[];
240
+ /**
241
+ * Human-readable summary suitable for CLI output and operator review.
242
+ * Present on both pass and fail.
243
+ */
244
+ summary: string;
245
+ }
246
+
247
+ // ── RELEASE-07: IVTR → release auto-suggest ──────────────────────────────────
248
+
249
+ /**
250
+ * Result emitted by `release.ivtr-suggest` — the hint produced when an IVTR
251
+ * loop transitions to `released` and all tasks in the parent epic are now
252
+ * in the `released` phase.
253
+ *
254
+ * @task T820 RELEASE-07
255
+ * @task T1416
256
+ */
257
+ export interface IvtrAutoSuggestResult {
258
+ /** Task ID that just reached the `released` phase. */
259
+ taskId: string;
260
+ /** Parent epic ID, if the task belongs to one. */
261
+ epicId: string | null;
262
+ /** Whether every task in the epic has reached `released`. */
263
+ epicFullyReleased: boolean;
264
+ /**
265
+ * Suggested next CLI command. Non-null only when `epicFullyReleased` is
266
+ * true. Points the operator toward `cleo release ship`.
267
+ */
268
+ suggestedCommand: string | null;
269
+ /** Human-readable message for operator guidance. */
270
+ message: string;
271
+ }
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Sentient Domain Operations (10 operations)
3
+ *
4
+ * Query operations: 2 (propose.list, allowlist.list)
5
+ * Mutate operations: 5 (propose.accept, propose.reject, propose.run, propose.enable, propose.disable)
6
+ * Allowlist mutations: 2 (allowlist.add, allowlist.remove)
7
+ *
8
+ * Operations for autonomous Tier-2 proposal management and owner allowlist control.
9
+ * All operations emit LAFS-compliant envelopes.
10
+ *
11
+ * @task T1008 — Sentient Tier 2 Proposals
12
+ * @task T1421 — Sentient domain typed narrowing (Wave D · T975 follow-on)
13
+ */
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Query Operations
17
+ // ---------------------------------------------------------------------------
18
+
19
+ /** Parameters for `propose.list` — list all pending proposals. */
20
+ export interface ProposeListParams {
21
+ /** Maximum number of proposals to return (default: 50). */
22
+ limit?: number;
23
+ }
24
+
25
+ /** Minimal proposal for wire format. */
26
+ export interface Proposal {
27
+ /** Task ID of the proposal. */
28
+ id: string;
29
+ /** Task title. */
30
+ title: string;
31
+ /** Task description. */
32
+ description: string;
33
+ /** Task status (always 'proposed' when returned). */
34
+ status: string;
35
+ /** Task priority. */
36
+ priority?: string;
37
+ /** Labels attached to the task. */
38
+ labels: string[];
39
+ /** ISO timestamp when the proposal was created. */
40
+ createdAt: string;
41
+ /** Proposal metadata (weight, reasoning, etc). */
42
+ meta?: Record<string, unknown> | null;
43
+ }
44
+
45
+ /** Result of `propose.list`. */
46
+ export interface ProposeListResult {
47
+ /** Array of proposals, sorted by weight descending. */
48
+ proposals: Proposal[];
49
+ /** Total count of proposals returned. */
50
+ total: number;
51
+ }
52
+
53
+ // propose.diff
54
+ /** Parameters for `propose.diff` — show what a proposal would change. */
55
+ export interface ProposeDiffParams {
56
+ /** Proposal task ID. */
57
+ id: string;
58
+ }
59
+
60
+ /** Result of `propose.diff` — Tier-3 stub. */
61
+ export interface ProposeDiffResult {
62
+ /** Proposal ID. */
63
+ id: string;
64
+ /** Content diff (null in Tier-2; Tier-3 feature). */
65
+ diff: null;
66
+ /** Explanation message. */
67
+ message: string;
68
+ }
69
+
70
+ // allowlist.list
71
+ /** Parameters for `allowlist.list` — no params required. */
72
+ export type AllowlistListParams = Record<string, never>;
73
+
74
+ /** Result of `allowlist.list`. */
75
+ export interface AllowlistListResult {
76
+ /** Array of base64-encoded owner public keys. */
77
+ ownerPubkeys: string[];
78
+ /** Total count of pubkeys in the allowlist. */
79
+ count: number;
80
+ }
81
+
82
+ // ---------------------------------------------------------------------------
83
+ // Mutate Operations
84
+ // ---------------------------------------------------------------------------
85
+
86
+ // propose.accept
87
+ /** Parameters for `propose.accept` — accept a proposal. */
88
+ export interface ProposeAcceptParams {
89
+ /** Proposal task ID to accept. */
90
+ id: string;
91
+ }
92
+
93
+ /** Result of `propose.accept`. */
94
+ export interface ProposeAcceptResult {
95
+ /** Task ID that was accepted. */
96
+ id: string;
97
+ /** New task status ('pending'). */
98
+ status: string;
99
+ /** ISO timestamp when accepted. */
100
+ acceptedAt: string;
101
+ }
102
+
103
+ // propose.reject
104
+ /** Parameters for `propose.reject` — reject a proposal. */
105
+ export interface ProposeRejectParams {
106
+ /** Proposal task ID to reject. */
107
+ id: string;
108
+ /** Reason for rejection. */
109
+ reason?: string;
110
+ }
111
+
112
+ /** Result of `propose.reject`. */
113
+ export interface ProposeRejectResult {
114
+ /** Task ID that was rejected. */
115
+ id: string;
116
+ /** New task status ('cancelled'). */
117
+ status: string;
118
+ /** ISO timestamp when rejected. */
119
+ rejectedAt: string;
120
+ /** Rejection reason. */
121
+ reason: string;
122
+ }
123
+
124
+ // propose.run
125
+ /** Parameters for `propose.run` — manually trigger a propose tick. */
126
+ export type ProposeRunParams = Record<string, never>;
127
+
128
+ /** Result of `propose.run`. */
129
+ export interface ProposeRunResult {
130
+ /** Outcome from the propose tick. */
131
+ outcome: unknown;
132
+ }
133
+
134
+ // propose.enable
135
+ /** Parameters for `propose.enable` — enable Tier-2 proposals. */
136
+ export type ProposeEnableParams = Record<string, never>;
137
+
138
+ /** Result of `propose.enable`. */
139
+ export interface ProposeEnableResult {
140
+ /** Whether Tier-2 is now enabled. */
141
+ tier2Enabled: boolean;
142
+ /** Confirmation message. */
143
+ message: string;
144
+ }
145
+
146
+ // propose.disable
147
+ /** Parameters for `propose.disable` — disable Tier-2 proposals. */
148
+ export type ProposeDisableParams = Record<string, never>;
149
+
150
+ /** Result of `propose.disable`. */
151
+ export interface ProposeDisableResult {
152
+ /** Whether Tier-2 is now enabled (false after disable). */
153
+ tier2Enabled: boolean;
154
+ /** Confirmation message. */
155
+ message: string;
156
+ }
157
+
158
+ // allowlist.add
159
+ /** Parameters for `allowlist.add` — add a pubkey to the allowlist. */
160
+ export interface AllowlistAddParams {
161
+ /** Base64-encoded public key to add. */
162
+ pubkey: string;
163
+ }
164
+
165
+ /** Result of `allowlist.add`. */
166
+ export interface AllowlistAddResult {
167
+ /** The pubkey that was added. */
168
+ added: string;
169
+ }
170
+
171
+ // allowlist.remove
172
+ /** Parameters for `allowlist.remove` — remove a pubkey from the allowlist. */
173
+ export interface AllowlistRemoveParams {
174
+ /** Base64-encoded public key to remove. */
175
+ pubkey: string;
176
+ }
177
+
178
+ /** Result of `allowlist.remove`. */
179
+ export interface AllowlistRemoveResult {
180
+ /** The pubkey that was removed. */
181
+ removed: string;
182
+ }
183
+
184
+ // ---------------------------------------------------------------------------
185
+ // Typed operation record (Wave D adapter — T975 follow-on)
186
+ // ---------------------------------------------------------------------------
187
+
188
+ /**
189
+ * Typed operation record for the sentient domain.
190
+ *
191
+ * Maps each operation name (as dispatched by the registry — no domain prefix)
192
+ * to its `[Params, Result]` tuple. Used by `TypedDomainHandler<SentientOps>`
193
+ * in the dispatch layer to provide compile-time narrowing of params.
194
+ *
195
+ * @task T1421 — Sentient domain typed narrowing (Wave D follow-on)
196
+ */
197
+ export type SentientOps = {
198
+ readonly 'propose.list': readonly [ProposeListParams, ProposeListResult];
199
+ readonly 'propose.diff': readonly [ProposeDiffParams, ProposeDiffResult];
200
+ readonly 'propose.accept': readonly [ProposeAcceptParams, ProposeAcceptResult];
201
+ readonly 'propose.reject': readonly [ProposeRejectParams, ProposeRejectResult];
202
+ readonly 'propose.run': readonly [ProposeRunParams, ProposeRunResult];
203
+ readonly 'propose.enable': readonly [ProposeEnableParams, ProposeEnableResult];
204
+ readonly 'propose.disable': readonly [ProposeDisableParams, ProposeDisableResult];
205
+ readonly 'allowlist.list': readonly [AllowlistListParams, AllowlistListResult];
206
+ readonly 'allowlist.add': readonly [AllowlistAddParams, AllowlistAddResult];
207
+ readonly 'allowlist.remove': readonly [AllowlistRemoveParams, AllowlistRemoveResult];
208
+ };