@nuvin/session 0.2.0-rc.8 → 0.2.0

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 (32) hide show
  1. package/dist/{chunk-HJLRL64D.js → chunk-4UBSHJWS.js} +3 -1
  2. package/dist/{chunk-TUNCGICQ.js → chunk-5XT7AOI2.js} +1 -1
  3. package/dist/{chunk-2OTEZX2E.js → chunk-B6S3CWQX.js} +134 -10
  4. package/dist/{chunk-MPBST5DM.js → chunk-FAYWOY6R.js} +1 -1
  5. package/dist/client/daemon-client.d.ts.map +1 -1
  6. package/dist/client/data-client.d.ts +29 -7
  7. package/dist/client/data-client.d.ts.map +1 -1
  8. package/dist/client/http-data-client.d.ts.map +1 -1
  9. package/dist/client/index.js +181 -77
  10. package/dist/client/session-client.d.ts +41 -9
  11. package/dist/client/session-client.d.ts.map +1 -1
  12. package/dist/controller/index.js +32 -7
  13. package/dist/controller/session-controller.d.ts +13 -3
  14. package/dist/controller/session-controller.d.ts.map +1 -1
  15. package/dist/grant/index.js +2 -2
  16. package/dist/protocol/data-rpc.d.ts +53 -7
  17. package/dist/protocol/data-rpc.d.ts.map +1 -1
  18. package/dist/protocol/index.js +4 -2
  19. package/dist/protocol/types.d.ts +282 -52
  20. package/dist/protocol/types.d.ts.map +1 -1
  21. package/dist/protocol/version.d.ts +1 -1
  22. package/dist/state/file-edit-preview.d.ts +47 -0
  23. package/dist/state/file-edit-preview.d.ts.map +1 -0
  24. package/dist/state/index.js +7 -3
  25. package/dist/state/messages.d.ts +28 -0
  26. package/dist/state/messages.d.ts.map +1 -1
  27. package/dist/state/session.d.ts.map +1 -1
  28. package/dist/state/tool-preview.d.ts +3 -0
  29. package/dist/state/tool-preview.d.ts.map +1 -1
  30. package/dist/state/tool-preview.js +215 -86
  31. package/dist/test-utils/index.js +3 -3
  32. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { ConfigMutationResult, HistoryPage, ListHistoryWorkspacesParams, ListHistoryWorkspacesResult, ListWorkspaceHistoryParams, PersistenceIdentity, ProfileSummary, ProviderConfigSummary, ProviderCredentialInput, ProviderSurfaceId, SessionSnapshot, WorkspaceConfigSummary, WorkspaceHistoryPage } from "./types.ts";
1
+ import type { AgentModelSetsView, AgentModelTierMappings, ConfigMutationResult, HistoryPage, ListHistoryParams, ListHistoryWorkspacesParams, ListHistoryWorkspacesResult, ListWorkspaceHistoryParams, PersistenceIdentity, ProfileSummary, ProviderConfigSummary, ProviderCredentialInput, ProviderSurfaceId, SessionSnapshot, WorkspaceConfigSummary, WorkspaceHistoryPage } from "./types.ts";
2
2
  export type DataRpcErrorCode = "invalid-input" | "not-found" | "conflict" | "unsupported" | "unauthorized" | "daemon-offline" | "transcript-unavailable" | "transcript-corrupt" | "history-state-conflict" | "ambiguous-session-identity" | "invalid-history-cursor" | "internal";
3
3
  export type DataRpcError = {
4
4
  code: DataRpcErrorCode;
@@ -9,6 +9,8 @@ export type ProfileScope = {
9
9
  };
10
10
  export type AddProviderInput = ProfileScope & {
11
11
  name: string;
12
+ /** Canonical built-in provider this entry instances (alias support). */
13
+ providerId?: string;
12
14
  surface: ProviderSurfaceId;
13
15
  baseUrl?: string;
14
16
  defaultModel?: string;
@@ -35,12 +37,7 @@ export type DataRpcSchema = {
35
37
  result: SessionSnapshot;
36
38
  };
37
39
  "list-history": {
38
- params: {
39
- profile?: string;
40
- cwd?: string;
41
- limit?: number;
42
- cursor?: string;
43
- };
40
+ params: ListHistoryParams;
44
41
  result: HistoryPage;
45
42
  };
46
43
  "list-history-workspaces": {
@@ -86,6 +83,7 @@ export type DataRpcSchema = {
86
83
  result: ConfigMutationResult<ProviderConfigSummary>;
87
84
  };
88
85
  "remove-provider": {
86
+ /** `providerId` names the configured provider ENTRY (alias), not the canonical built-in id. */
89
87
  params: {
90
88
  providerId: string;
91
89
  profile?: string;
@@ -93,6 +91,7 @@ export type DataRpcSchema = {
93
91
  result: ConfigMutationResult<null>;
94
92
  };
95
93
  "set-default-provider": {
94
+ /** `providerId` names the configured provider ENTRY (alias), not the canonical built-in id. */
96
95
  params: {
97
96
  providerId: string;
98
97
  profile?: string;
@@ -100,6 +99,7 @@ export type DataRpcSchema = {
100
99
  result: ConfigMutationResult<null>;
101
100
  };
102
101
  "set-provider-auth": {
102
+ /** `providerId` names the configured provider ENTRY (alias), not the canonical built-in id. */
103
103
  params: {
104
104
  providerId: string;
105
105
  credential: ProviderCredentialInput;
@@ -108,6 +108,7 @@ export type DataRpcSchema = {
108
108
  result: ConfigMutationResult<null>;
109
109
  };
110
110
  "clear-provider-auth": {
111
+ /** `providerId` names the configured provider ENTRY (alias), not the canonical built-in id. */
111
112
  params: {
112
113
  providerId: string;
113
114
  profile?: string;
@@ -120,6 +121,51 @@ export type DataRpcSchema = {
120
121
  };
121
122
  result: ConfigMutationResult<WorkspaceConfigSummary>;
122
123
  };
124
+ "list-agent-model-sets": {
125
+ params: {
126
+ profile: string;
127
+ workspace?: string;
128
+ };
129
+ result: AgentModelSetsView;
130
+ };
131
+ "create-agent-model-set": {
132
+ params: {
133
+ profile: string;
134
+ name: string;
135
+ mappings: AgentModelTierMappings;
136
+ };
137
+ result: ConfigMutationResult<null>;
138
+ };
139
+ "replace-agent-model-set": {
140
+ params: {
141
+ profile: string;
142
+ name: string;
143
+ mappings: AgentModelTierMappings;
144
+ };
145
+ result: ConfigMutationResult<null>;
146
+ };
147
+ "delete-agent-model-set": {
148
+ params: {
149
+ profile: string;
150
+ name: string;
151
+ };
152
+ result: ConfigMutationResult<null>;
153
+ };
154
+ "set-default-agent-model-set": {
155
+ params: {
156
+ profile: string;
157
+ name?: string;
158
+ };
159
+ result: ConfigMutationResult<null>;
160
+ };
161
+ "set-workspace-agent-model-set": {
162
+ params: {
163
+ profile: string;
164
+ workspace: string;
165
+ name?: string;
166
+ };
167
+ result: ConfigMutationResult<null>;
168
+ };
123
169
  };
124
170
  export type DataRpcMethod = keyof DataRpcSchema;
125
171
  export type DataRpcParams<M extends DataRpcMethod> = DataRpcSchema[M]["params"];
@@ -1 +1 @@
1
- {"version":3,"file":"data-rpc.d.ts","sourceRoot":"","sources":["../../src/protocol/data-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,WAAW,EACX,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,WAAW,GACX,UAAU,GACV,aAAa,GACb,cAAc,GACd,gBAAgB,GAChB,wBAAwB,GACxB,oBAAoB,GACpB,wBAAwB,GACxB,4BAA4B,GAC5B,wBAAwB,GACxB,UAAU,CAAC;AAEf,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,uBAAuB,CAAC;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,YAAY,GAAG;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,gBAAgB,EAAE;QAChB,MAAM,EAAE;YAAE,QAAQ,E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chunk-7LEIACBZ.js";
8
8
  import {
9
9
  PROTOCOL_VERSION
10
- } from "../chunk-MPBST5DM.js";
10
+ } from "../chunk-FAYWOY6R.js";
11
11
  import {
12
+ AGENT_MODEL_TIERS,
12
13
  GRANT_CAPABILITIES,
13
14
  PROVIDER_SURFACE_IDS
14
- } from "../chunk-HJLRL64D.js";
15
+ } from "../chunk-4UBSHJWS.js";
15
16
  export {
17
+ AGENT_MODEL_TIERS,
16
18
  GRANT_CAPABILITIES,
17
19
  PROTOCOL_VERSION,
18
20
  PROVIDER_SURFACE_IDS,
@@ -152,6 +152,13 @@ export type SessionMeta = {
152
152
  * requests must read the installed `EngineChatModel.model` instead.
153
153
  */
154
154
  modelIdentity: string;
155
+ /**
156
+ * Active provider ENTRY name (alias) when it differs from the identity's
157
+ * canonical provider — display-only, rendered as an `@alias` badge so multi-
158
+ * account setups can tell which config is active. Omitted for canonical
159
+ * entries so the common case carries nothing on the wire.
160
+ */
161
+ modelProviderEntry?: string;
155
162
  /** Active main-agent persona id (spec §4.3); `"default"` for the built-in coordinator. */
156
163
  persona: string;
157
164
  /**
@@ -188,6 +195,13 @@ export type SlashCommandDescriptor = {
188
195
  name: string;
189
196
  description: string;
190
197
  argumentHint?: string;
198
+ /**
199
+ * True when the server runtime owns argument autocomplete for this command.
200
+ * The TUI only requests candidates through the generic `complete-slash-command`
201
+ * path when this flag is true. Custom (markdown-defined) commands never set
202
+ * it — their arguments are free-form.
203
+ */
204
+ hasArgumentCompletion?: boolean;
191
205
  /**
192
206
  * True for custom (markdown-defined) commands. These are the ONLY server
193
207
  * commands the `commandsEnabled.<name>` toggle affects — the runtime's
@@ -197,37 +211,38 @@ export type SlashCommandDescriptor = {
197
211
  custom?: boolean;
198
212
  };
199
213
  /**
200
- * Raw model-completion data for the `/model` autocomplete popup, returned by
201
- * the `complete-models` command (spec §6). The daemon gathers it from its
202
- * runtime (authenticated providers + each provider's live model list + recent
203
- * selections); the client builds the grouped ComboBox items. JSON-safe by rule
204
- * — the round-trip test guards it.
214
+ * Whether completing a slash-command item should submit the command (`submit`)
215
+ * or keep editing with a trailing space so the next argument level is
216
+ * requested (`continue`).
205
217
  */
206
- export type ModelCompletion = {
207
- /** Authenticated providers, in registration order. */
208
- providers: string[];
209
- /** Per-provider model lists, keyed by provider. */
210
- perProvider: Record<string, {
211
- id: string;
212
- name?: string;
213
- }[]>;
214
- /** Recently selected models (most recent first), for the "Recent" group. */
215
- recentModels: {
216
- provider: string;
217
- model: string;
218
- }[];
219
- };
220
- /** Model-specific reasoning options for `/thinking` autocomplete. */
221
- export type ThinkingCompletion = {
222
- modelIdentity: string;
223
- effectiveOption?: string;
224
- defaultOption?: string;
225
- selectedOption?: string;
226
- canDisable: boolean;
227
- options: Array<{
228
- id: string;
229
- description?: string;
230
- }>;
218
+ export type SlashCommandCompletionAction = "continue" | "submit";
219
+ /**
220
+ * One candidate for a slash-command argument, produced by the attached runtime
221
+ * and returned through the generic `complete-slash-command` wire path. The
222
+ * runtime guarantees unique `id`s; the client defensively drops duplicates.
223
+ */
224
+ export type SlashCommandCompletionItem = {
225
+ /** Stable, unique key the TUI uses for selection tracking. */
226
+ id: string;
227
+ /** Display label; when `submitValue` is absent, also the submitted value. */
228
+ label: string;
229
+ /** Complete argument string replacing the current `argumentsText`. */
230
+ submitValue?: string;
231
+ /** Optional one-line description shown beside the label. */
232
+ description?: string;
233
+ /** Optional group heading the TUI projects into a disclosure row. */
234
+ group?: string;
235
+ action: SlashCommandCompletionAction;
236
+ };
237
+ /**
238
+ * Result of a `complete-slash-command` request. The echoed `name`/`argumentsText`
239
+ * let the client correlate results and defensively drop stale/mismatched ones.
240
+ * JSON-safe by rule — the round-trip test guards it.
241
+ */
242
+ export type SlashCommandCompletion = {
243
+ name: string;
244
+ argumentsText: string;
245
+ items: SlashCommandCompletionItem[];
231
246
  };
232
247
  /**
233
248
  * The replicated session state. Everything here survives JSON round-trip.
@@ -630,6 +645,74 @@ export type McpServerInfo = {
630
645
  message?: string;
631
646
  tools: McpToolInfo[];
632
647
  };
648
+ /** One committed workspace memory (Memory tab list row). */
649
+ export type WorkspaceMemorySummary = {
650
+ slug: string;
651
+ title: string;
652
+ durable: boolean;
653
+ tags: string[];
654
+ source: "user" | "agent";
655
+ createdAt: string;
656
+ updatedAt: string;
657
+ };
658
+ /** Committed workspace memory detail (summary + full content). */
659
+ export type WorkspaceMemoryDetail = WorkspaceMemorySummary & {
660
+ content: string;
661
+ };
662
+ /** One extract record (read-only Extracts browser row). */
663
+ export type MemoryExtractSummary = {
664
+ /** Extract record id. */
665
+ id: string;
666
+ /** The source session the extract was derived from. */
667
+ sourceSessionId: string;
668
+ /** Optional human-meaningful source slug derived from the session. */
669
+ sourceSlug?: string;
670
+ /** Epoch ms when the extract was generated. */
671
+ generatedAt: number;
672
+ /** Extract status (active/empty/failed). */
673
+ status: string;
674
+ /** Truncated memory draft preview for list rows. */
675
+ memoryDraftPreview: string;
676
+ /** Number of proposed skill drafts in this extract. */
677
+ skillDraftCount: number;
678
+ };
679
+ /** One consolidate proposal (Memory tab list row). */
680
+ export type ConsolidateProposalSummary = {
681
+ id: string;
682
+ status: string;
683
+ createdAt: number;
684
+ notes: string;
685
+ memoryOpCount: number;
686
+ skillOpCount: number;
687
+ };
688
+ export type ConsolidateProposalOperation = Readonly<Record<string, unknown> & {
689
+ id: string;
690
+ }>;
691
+ /** Consolidate proposal detail (Memory tab detail pane, diff rendering). */
692
+ export type ConsolidateProposalDetail = ConsolidateProposalSummary & {
693
+ /** Parsed memory piece ops (create/edit/remove). */
694
+ memoryOps: ReadonlyArray<ConsolidateProposalOperation>;
695
+ /** Parsed skill ops (create_skill/update_skill/write_file). */
696
+ skillOps: ReadonlyArray<ConsolidateProposalOperation>;
697
+ };
698
+ /**
699
+ * Result of a `run-consolidate` / `run-consolidate-interactive` command. The
700
+ * daemon acks it once the coordinator-owned job leaves queued/running. JSON-safe
701
+ * by rule (guarded by the round-trip test).
702
+ */
703
+ export type ConsolidateRunOutcome = {
704
+ outcome: "skipped";
705
+ reason: "no_new_extracts" | "disabled";
706
+ } | {
707
+ outcome: "proposal";
708
+ proposalId: string;
709
+ memoryOpCount: number;
710
+ } | {
711
+ outcome: "noop";
712
+ } | {
713
+ outcome: "failed";
714
+ reason: string;
715
+ };
633
716
  export type ClientCommand = {
634
717
  id: string;
635
718
  type: "submit";
@@ -674,17 +757,16 @@ export type ClientCommand = {
674
757
  prefix: string;
675
758
  }
676
759
  /**
677
- * Fetch the available models for the `/model` autocomplete popup (spec §6).
678
- * The ack `result` is a {@link ModelCompletion}. Carries no payload — the
679
- * daemon reads its own runtime config. Answered by the attached host; an
680
- * empty completion is returned when no host is attached.
760
+ * Generic slash-command argument autocomplete (spec §6). The attached runtime
761
+ * answers with a {@link SlashCommandCompletion} — items are read-only
762
+ * candidates; the client renders and selects them locally. An empty
763
+ * completion is returned when no host is attached.
681
764
  */
682
765
  | {
683
766
  id: string;
684
- type: "complete-models";
685
- } | {
686
- id: string;
687
- type: "complete-thinking";
767
+ type: "complete-slash-command";
768
+ name: string;
769
+ argumentsText: string;
688
770
  } | {
689
771
  id: string;
690
772
  type: "load-history";
@@ -785,6 +867,85 @@ export type ClientCommand = {
785
867
  id: string;
786
868
  type: "list-mcp-servers";
787
869
  }
870
+ /**
871
+ * List committed workspace memories for the Memory tab. The ack `result`
872
+ * is a {@link WorkspaceMemorySummary}[]. Session-scoped.
873
+ */
874
+ | {
875
+ id: string;
876
+ type: "list-workspace-memories";
877
+ }
878
+ /**
879
+ * Lazy-load one committed memory's full content. The ack `result` is a
880
+ * {@link WorkspaceMemoryDetail}. Session-scoped.
881
+ */
882
+ | {
883
+ id: string;
884
+ type: "get-workspace-memory";
885
+ memorySlug: string;
886
+ }
887
+ /** Delete one committed workspace memory. The ack `result` is `{ removed: boolean; slug: string }`. */
888
+ | {
889
+ id: string;
890
+ type: "remove-workspace-memory";
891
+ memorySlug: string;
892
+ }
893
+ /**
894
+ * List consolidate proposals awaiting review. The ack `result` is an array of
895
+ * proposal summaries. Session-scoped.
896
+ */
897
+ | {
898
+ id: string;
899
+ type: "list-consolidate-proposals";
900
+ }
901
+ /**
902
+ * Approve or reject one consolidate proposal. An omitted approve selection
903
+ * means approve all operations; rejection is always proposal-wide. The ack
904
+ * `result` is `{ status, id?, error? }`. Session-scoped.
905
+ */
906
+ | {
907
+ id: string;
908
+ type: "decide-consolidate-proposal";
909
+ proposalId: string;
910
+ decision: "approve" | "reject";
911
+ selectedOperationIds?: string[];
912
+ }
913
+ /**
914
+ * List extract records (read-only browser). The ack `result` is a
915
+ * {@link MemoryExtractSummary}[]. Session-scoped.
916
+ */
917
+ | {
918
+ id: string;
919
+ type: "list-extracts";
920
+ }
921
+ /**
922
+ * Load one consolidate proposal's ops for diff rendering. The ack `result`
923
+ * is a {@link ConsolidateProposalDetail}. Session-scoped.
924
+ */
925
+ | {
926
+ id: string;
927
+ type: "get-consolidate-proposal";
928
+ proposalId: string;
929
+ }
930
+ /**
931
+ * Run consolidation for this session workspace. The daemon enqueues a
932
+ * coordinator-owned run and acks once the job leaves queued/running. The ack
933
+ * `result` is a `ConsolidateRunOutcome`-shaped
934
+ * `{ outcome: "proposal" | "noop" | "skipped" | "failed", ... }`. Session-scoped.
935
+ */
936
+ | {
937
+ id: string;
938
+ type: "run-consolidate";
939
+ }
940
+ /**
941
+ * Run consolidation as an attached foreground turn of this session (the
942
+ * interactive marker path). The ack `result` carries the same outcome shape
943
+ * as `run-consolidate`. Session-scoped.
944
+ */
945
+ | {
946
+ id: string;
947
+ type: "run-consolidate-interactive";
948
+ }
788
949
  /**
789
950
  * Complete ChatGPT/Codex device-code login (TUI-only). The daemon persists
790
951
  * the credential under the attached session's profile. Provider id is locked
@@ -794,6 +955,11 @@ export type ClientCommand = {
794
955
  id: string;
795
956
  type: "complete-provider-auth";
796
957
  providerId: "openai-codex";
958
+ /**
959
+ * Entry name for alias accounts; defaults to the canonical providerId
960
+ * (`openai-codex`) when omitted.
961
+ */
962
+ name?: string;
797
963
  credential: ChatGptCredentialInput;
798
964
  } | {
799
965
  id: string;
@@ -822,8 +988,50 @@ export type ServerFrame = ServerEvent | CommandAck | {
822
988
  };
823
989
  /** Session lifecycle state surfaced by list-sessions (spec §4.2). */
824
990
  export type SessionStatus = "awaiting-approval" | "busy" | "idle";
991
+ /** Durable catalog classification for a user, managed extraction, or managed consolidation session. */
992
+ export type SessionKind = "user" | "memory-extraction" | "memory-consolidation";
993
+ /** Event that requested a managed memory extraction session. */
994
+ export type ExtractionTrigger = "manual" | "idle";
995
+ /** Durable lifecycle state of a managed memory extraction session. */
996
+ export type ExtractionStatus = "queued" | "running" | "completed" | "failed" | "skipped";
997
+ /** Catalog metadata carried only by managed memory extraction sessions. */
998
+ export type ExtractionSessionMetadata = Readonly<{
999
+ jobId: string;
1000
+ source: PersistenceIdentity;
1001
+ sourceHash: string;
1002
+ trigger: ExtractionTrigger;
1003
+ status: ExtractionStatus;
1004
+ modelIdentity?: string;
1005
+ }>;
1006
+ /** Event that requested a managed memory consolidation run. */
1007
+ export type ConsolidationTrigger = "manual" | "idle";
1008
+ /** Durable lifecycle state of a managed memory consolidation session. */
1009
+ export type ConsolidationStatus = "queued" | "running" | "completed" | "failed" | "skipped";
1010
+ /** Catalog metadata carried only by managed memory consolidation sessions.
1011
+ * `workspace` is the workspace name; consolidation lineage is the extract set. */
1012
+ export type ConsolidationSessionMetadata = Readonly<{
1013
+ jobId: string;
1014
+ workspace: string;
1015
+ trigger: ConsolidationTrigger;
1016
+ status: ConsolidationStatus;
1017
+ modelIdentity?: string;
1018
+ }>;
1019
+ /** Coherent catalog classification shared by every session projection. */
1020
+ export type SessionClassification = Readonly<{
1021
+ kind: "user";
1022
+ extraction?: never;
1023
+ consolidation?: never;
1024
+ }> | Readonly<{
1025
+ kind: "memory-extraction";
1026
+ extraction: ExtractionSessionMetadata;
1027
+ consolidation?: never;
1028
+ }> | Readonly<{
1029
+ kind: "memory-consolidation";
1030
+ consolidation: ConsolidationSessionMetadata;
1031
+ extraction?: never;
1032
+ }>;
825
1033
  /** Session metadata returned by list-sessions / create-session (spec §4.2). */
826
- export type SessionDescriptor = {
1034
+ export type SessionDescriptor = SessionClassification & {
827
1035
  id: string;
828
1036
  name: string;
829
1037
  cwd: string;
@@ -1017,6 +1225,8 @@ export type ChatGptCredentialInput = {
1017
1225
  };
1018
1226
  export type ProviderConfigSummary = {
1019
1227
  id: string;
1228
+ /** Canonical built-in provider (present for alias entries). */
1229
+ providerId?: string;
1020
1230
  label: string;
1021
1231
  surface: ProviderSurfaceId;
1022
1232
  baseUrl?: string;
@@ -1024,6 +1234,27 @@ export type ProviderConfigSummary = {
1024
1234
  hasAuth: boolean;
1025
1235
  isDefault: boolean;
1026
1236
  };
1237
+ export declare const AGENT_MODEL_TIERS: readonly ["fast", "balanced", "powerful"];
1238
+ export type AgentModelTier = (typeof AGENT_MODEL_TIERS)[number];
1239
+ export type AgentModelTierMappings = Partial<Record<AgentModelTier, string>>;
1240
+ export type AgentModelSetSummary = {
1241
+ name: string;
1242
+ mappings: AgentModelTierMappings;
1243
+ valid: boolean;
1244
+ issues: string[];
1245
+ };
1246
+ export type AgentModelSetReferenceSummary = {
1247
+ name: string;
1248
+ valid: boolean;
1249
+ };
1250
+ export type AgentModelSetsView = {
1251
+ sets: AgentModelSetSummary[];
1252
+ profileDefault?: AgentModelSetReferenceSummary;
1253
+ workspaceSelection?: AgentModelSetReferenceSummary;
1254
+ effectiveSelection?: AgentModelSetReferenceSummary & {
1255
+ source: "profile" | "workspace";
1256
+ };
1257
+ };
1027
1258
  /**
1028
1259
  * A workspace as advertised to directory clients (spec §7). Carried as a
1029
1260
  * JSON-safe array in the `list-workspaces` / `create-workspace` REST (DataRpc)
@@ -1050,20 +1281,10 @@ export type ConfigMutationResult<T> = {
1050
1281
  }>;
1051
1282
  };
1052
1283
  /** Exceptional pre-attach operator commands (spec §4.2). */
1284
+ /** Exceptional pre-attach operator commands (spec §4.2). */
1053
1285
  export type DaemonAdminCommand =
1054
- /** Start the daemon-hosted web UI on `port` (default 3000). */
1055
- {
1056
- id: string;
1057
- type: "web-start";
1058
- port?: number;
1059
- }
1060
- /** Stop the daemon-hosted web UI. */
1061
- | {
1062
- id: string;
1063
- type: "web-stop";
1064
- }
1065
1286
  /** Re-read daemon config and reload running sessions. */
1066
- | {
1287
+ {
1067
1288
  id: string;
1068
1289
  type: "reload-config";
1069
1290
  };
@@ -1123,7 +1344,7 @@ export type PersistenceIdentity = Readonly<{
1123
1344
  * Display-only metadata; resuming it sends a `load-history` command after
1124
1345
  * attaching to a (new or existing) live session.
1125
1346
  */
1126
- export type HistorySummary = {
1347
+ export type HistorySummary = SessionClassification & {
1127
1348
  id: string;
1128
1349
  title: string;
1129
1350
  /** Epoch ms of the last write to the session dir. */
@@ -1146,10 +1367,18 @@ export type HistoryPage = {
1146
1367
  nextCursor?: string;
1147
1368
  currentWorkspace?: string;
1148
1369
  };
1370
+ export type ListHistoryParams = Readonly<{
1371
+ profile?: string;
1372
+ cwd?: string;
1373
+ limit?: number;
1374
+ cursor?: string;
1375
+ includeExtraction?: boolean;
1376
+ }>;
1149
1377
  export type ListHistoryWorkspacesParams = Readonly<{
1150
1378
  profile?: string;
1151
1379
  currentCwd?: string;
1152
1380
  query?: string;
1381
+ includeExtraction?: boolean;
1153
1382
  }>;
1154
1383
  export type HistoryWorkspaceSummary = Readonly<{
1155
1384
  workspace: string;
@@ -1168,6 +1397,7 @@ export type ListWorkspaceHistoryParams = Readonly<{
1168
1397
  query?: string;
1169
1398
  limit?: number;
1170
1399
  cursor?: string;
1400
+ includeExtraction?: boolean;
1171
1401
  }>;
1172
1402
  export type WorkspaceHistoryPage = Readonly<{
1173
1403
  profile: string;