@brainpilot/protocol 0.2.2 → 0.3.0-rc.1

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/domain.d.ts CHANGED
@@ -17,6 +17,39 @@ export declare const EXAMPLE_MODEL = "claude-sonnet-4-6";
17
17
  /** Per-session domain-resource ablation mode. Defaults to full in the runtime. */
18
18
  export declare const DomainResourcesSchema: z.ZodEnum<["full", "base"]>;
19
19
  export type DomainResources = z.infer<typeof DomainResourcesSchema>;
20
+ /** The three built-in tools a user may switch per conversation. */
21
+ export declare const SessionBuiltinToolIdSchema: z.ZodEnum<["skill_search", "get_domain_knowledge_local", "search_papers_local"]>;
22
+ export type SessionBuiltinToolId = z.infer<typeof SessionBuiltinToolIdSchema>;
23
+ /**
24
+ * Per-conversation resource scope. For the four scoped kinds an omitted field
25
+ * and an empty array both mean "everything available"; the runtime drops empty
26
+ * arrays when it parses this value. The schema still accepts them for older
27
+ * clients.
28
+ *
29
+ * `toolIds` addresses external MCP servers by their configured server name.
30
+ * `builtinToolIds` is an explicit switch list: an empty array means all
31
+ * built-in tools off. It never turns a globally disabled tool back on.
32
+ */
33
+ export declare const SessionResourcesSchema: z.ZodObject<{
34
+ skillIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ knowledgeBaseIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
36
+ datasetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
37
+ toolIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
38
+ builtinToolIds: z.ZodOptional<z.ZodArray<z.ZodEnum<["skill_search", "get_domain_knowledge_local", "search_papers_local"]>, "many">>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ skillIds?: string[] | undefined;
41
+ knowledgeBaseIds?: string[] | undefined;
42
+ datasetIds?: string[] | undefined;
43
+ toolIds?: string[] | undefined;
44
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
45
+ }, {
46
+ skillIds?: string[] | undefined;
47
+ knowledgeBaseIds?: string[] | undefined;
48
+ datasetIds?: string[] | undefined;
49
+ toolIds?: string[] | undefined;
50
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
51
+ }>;
52
+ export type SessionResources = z.infer<typeof SessionResourcesSchema>;
20
53
  /** Shared reasoning effort for every agent in a session. */
21
54
  export declare const ThinkingLevelSchema: z.ZodEnum<["off", "low", "medium", "high"]>;
22
55
  export type ThinkingLevel = z.infer<typeof ThinkingLevelSchema>;
@@ -34,6 +67,26 @@ export declare const SessionSchema: z.ZodObject<{
34
67
  /** Provider/model frozen when the session was created (never includes credentials). */
35
68
  providerId: z.ZodOptional<z.ZodString>;
36
69
  modelId: z.ZodOptional<z.ZodString>;
70
+ /** Chosen resources for this conversation; omitted means the runtime default. */
71
+ resources: z.ZodOptional<z.ZodObject<{
72
+ skillIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
73
+ knowledgeBaseIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
74
+ datasetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
75
+ toolIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
76
+ builtinToolIds: z.ZodOptional<z.ZodArray<z.ZodEnum<["skill_search", "get_domain_knowledge_local", "search_papers_local"]>, "many">>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ skillIds?: string[] | undefined;
79
+ knowledgeBaseIds?: string[] | undefined;
80
+ datasetIds?: string[] | undefined;
81
+ toolIds?: string[] | undefined;
82
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
83
+ }, {
84
+ skillIds?: string[] | undefined;
85
+ knowledgeBaseIds?: string[] | undefined;
86
+ datasetIds?: string[] | undefined;
87
+ toolIds?: string[] | undefined;
88
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
89
+ }>>;
37
90
  }, "strip", z.ZodTypeAny, {
38
91
  id: string;
39
92
  title: string;
@@ -44,6 +97,13 @@ export declare const SessionSchema: z.ZodObject<{
44
97
  reasoningSupported?: boolean | undefined;
45
98
  providerId?: string | undefined;
46
99
  modelId?: string | undefined;
100
+ resources?: {
101
+ skillIds?: string[] | undefined;
102
+ knowledgeBaseIds?: string[] | undefined;
103
+ datasetIds?: string[] | undefined;
104
+ toolIds?: string[] | undefined;
105
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
106
+ } | undefined;
47
107
  }, {
48
108
  id: string;
49
109
  title: string;
@@ -54,6 +114,13 @@ export declare const SessionSchema: z.ZodObject<{
54
114
  reasoningSupported?: boolean | undefined;
55
115
  providerId?: string | undefined;
56
116
  modelId?: string | undefined;
117
+ resources?: {
118
+ skillIds?: string[] | undefined;
119
+ knowledgeBaseIds?: string[] | undefined;
120
+ datasetIds?: string[] | undefined;
121
+ toolIds?: string[] | undefined;
122
+ builtinToolIds?: ("skill_search" | "get_domain_knowledge_local" | "search_papers_local")[] | undefined;
123
+ } | undefined;
57
124
  }>;
58
125
  export type Session = z.infer<typeof SessionSchema>;
59
126
  /** §10 state authority enum. */
@@ -5111,11 +5178,11 @@ export declare const TraceGraphV2Schema: z.ZodObject<{
5111
5178
  }[];
5112
5179
  }>;
5113
5180
  export type TraceGraphV2 = z.infer<typeof TraceGraphV2Schema>;
5114
- /** A V2 SSE update. Snapshot is intentionally supported during transition. */
5181
+ /** A V2 SSE update. Patch carries only changed records at one revision. */
5115
5182
  export declare const TraceDeltaV2Schema: z.ZodObject<{
5116
5183
  schemaVersion: z.ZodLiteral<"2.0">;
5117
5184
  revision: z.ZodNumber;
5118
- op: z.ZodEnum<["snapshot", "upsert", "remove"]>;
5185
+ op: z.ZodEnum<["snapshot", "upsert", "remove", "patch"]>;
5119
5186
  graph: z.ZodOptional<z.ZodObject<{
5120
5187
  dependencies: z.ZodArray<z.ZodObject<{
5121
5188
  id: z.ZodString;
@@ -5834,122 +5901,721 @@ export declare const TraceDeltaV2Schema: z.ZodObject<{
5834
5901
  }>>;
5835
5902
  entity: z.ZodOptional<z.ZodEnum<["node", "dependency", "episode", "artifact"]>>;
5836
5903
  id: z.ZodOptional<z.ZodString>;
5837
- }, "strip", z.ZodTypeAny, {
5838
- revision: number;
5839
- schemaVersion: "2.0";
5840
- op: "snapshot" | "upsert" | "remove";
5841
- id?: string | undefined;
5842
- graph?: {
5843
- artifacts: {
5844
- path: string;
5845
- id: string;
5846
- kind: string;
5847
- exists: "unknown" | "missing" | "present";
5848
- verificationStatus: "unverified" | "reserved" | "verified" | "missing";
5849
- type?: string | undefined;
5850
- createdAt?: string | undefined;
5851
- updatedAt?: string | undefined;
5852
- previousPath?: string | undefined;
5853
- checkpoint?: {
5854
- status: "failed" | "partial" | "ready" | "unavailable";
5855
- id: string;
5856
- capturedAt: string;
5857
- skippedCount: number;
5858
- error?: string | undefined;
5859
- commitId?: string | undefined;
5860
- sourceAgent?: string | undefined;
5861
- baseCheckpointId?: string | undefined;
5862
- stats?: {
5863
- files: number;
5864
- added: number;
5865
- modified: number;
5866
- deleted: number;
5867
- renamed: number;
5868
- } | undefined;
5869
- } | undefined;
5870
- checkpointId?: string | undefined;
5871
- producerNodeId?: string | null | undefined;
5872
- blobHash?: string | undefined;
5873
- changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
5874
- role?: "input" | "output" | "checkpoint" | "reference" | undefined;
5875
- }[];
5876
- revision: number;
5877
- schemaVersion: "2.0";
5878
- meta: {
5879
- sessionId: string;
5904
+ meta: z.ZodOptional<z.ZodObject<{
5905
+ sessionId: z.ZodString;
5906
+ /** Host-managed structural root. It is not a scientific Trace claim. */
5907
+ rootNodeId: z.ZodOptional<z.ZodString>;
5908
+ userId: z.ZodOptional<z.ZodString>;
5909
+ projectName: z.ZodOptional<z.ZodString>;
5910
+ currentFocus: z.ZodOptional<z.ZodString>;
5911
+ createdAt: z.ZodOptional<z.ZodString>;
5912
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
5913
+ sessionId: z.ZodString;
5914
+ /** Host-managed structural root. It is not a scientific Trace claim. */
5915
+ rootNodeId: z.ZodOptional<z.ZodString>;
5916
+ userId: z.ZodOptional<z.ZodString>;
5917
+ projectName: z.ZodOptional<z.ZodString>;
5918
+ currentFocus: z.ZodOptional<z.ZodString>;
5919
+ createdAt: z.ZodOptional<z.ZodString>;
5920
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
5921
+ sessionId: z.ZodString;
5922
+ /** Host-managed structural root. It is not a scientific Trace claim. */
5923
+ rootNodeId: z.ZodOptional<z.ZodString>;
5924
+ userId: z.ZodOptional<z.ZodString>;
5925
+ projectName: z.ZodOptional<z.ZodString>;
5926
+ currentFocus: z.ZodOptional<z.ZodString>;
5927
+ createdAt: z.ZodOptional<z.ZodString>;
5928
+ }, z.ZodTypeAny, "passthrough">>>;
5929
+ nodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
5930
+ id: z.ZodString;
5931
+ title: z.ZodString;
5932
+ type: z.ZodString;
5933
+ status: z.ZodUnion<[z.ZodEnum<["pending", "running", "completed", "error"]>, z.ZodString]>;
5934
+ agent: z.ZodOptional<z.ZodString>;
5935
+ description: z.ZodOptional<z.ZodString>;
5936
+ reason: z.ZodOptional<z.ZodString>;
5937
+ context: z.ZodOptional<z.ZodString>;
5938
+ report: z.ZodOptional<z.ZodObject<{
5939
+ kind: z.ZodLiteral<"agent_report">;
5940
+ summary: z.ZodOptional<z.ZodString>;
5941
+ content: z.ZodOptional<z.ZodString>;
5942
+ author: z.ZodOptional<z.ZodString>;
5943
+ }, "strip", z.ZodTypeAny, {
5944
+ kind: "agent_report";
5945
+ summary?: string | undefined;
5946
+ content?: string | undefined;
5947
+ author?: string | undefined;
5948
+ }, {
5949
+ kind: "agent_report";
5950
+ summary?: string | undefined;
5951
+ content?: string | undefined;
5952
+ author?: string | undefined;
5953
+ }>>;
5954
+ createdAt: z.ZodOptional<z.ZodString>;
5955
+ updatedAt: z.ZodOptional<z.ZodString>;
5956
+ timestamp: z.ZodOptional<z.ZodObject<{
5957
+ createdAt: z.ZodOptional<z.ZodString>;
5958
+ startedAt: z.ZodOptional<z.ZodString>;
5959
+ completedAt: z.ZodOptional<z.ZodString>;
5960
+ }, "strip", z.ZodTypeAny, {
5880
5961
  createdAt?: string | undefined;
5881
- rootNodeId?: string | undefined;
5882
- userId?: string | undefined;
5883
- projectName?: string | undefined;
5884
- currentFocus?: string | undefined;
5885
- } & {
5886
- [k: string]: unknown;
5887
- };
5888
- nodes: {
5889
- type: string;
5890
- status: string;
5891
- id: string;
5892
- title: string;
5893
- parents: {
5894
- nodeId: string;
5895
- conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
5896
- reason?: string | undefined;
5897
- origin?: "host_fallback" | "trace" | undefined;
5898
- }[];
5899
- toolCalls: string[];
5900
- artifactIds: string[];
5901
- episodeTags: string[];
5902
- records: {
5903
- createdAt: string;
5904
- sourceAgent: string;
5905
- description: string;
5906
- checkpointId?: string | undefined;
5907
- context?: string | undefined;
5908
- }[];
5909
- executionResult: "failed" | "completed";
5910
- revoked: boolean;
5911
- reviewConclusion: "rejected" | "uncertain" | "unreviewed" | "approved";
5962
+ startedAt?: string | undefined;
5963
+ completedAt?: string | undefined;
5964
+ }, {
5912
5965
  createdAt?: string | undefined;
5913
- updatedAt?: string | undefined;
5914
- durationMs?: number | undefined;
5915
- timestamp?: {
5916
- createdAt?: string | undefined;
5917
- startedAt?: string | undefined;
5918
- completedAt?: string | undefined;
5919
- } | undefined;
5966
+ startedAt?: string | undefined;
5967
+ completedAt?: string | undefined;
5968
+ }>>;
5969
+ durationMs: z.ZodOptional<z.ZodNumber>;
5970
+ errorMessage: z.ZodOptional<z.ZodString>;
5971
+ toolCalls: z.ZodArray<z.ZodString, "many">;
5972
+ artifactIds: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5973
+ primaryEpisodeId: z.ZodOptional<z.ZodString>;
5974
+ episodeTags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
5975
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
5976
+ records: z.ZodDefault<z.ZodArray<z.ZodObject<{
5977
+ sourceAgent: z.ZodString;
5978
+ description: z.ZodString;
5979
+ context: z.ZodOptional<z.ZodString>;
5980
+ checkpointId: z.ZodOptional<z.ZodString>;
5981
+ createdAt: z.ZodString;
5982
+ }, "strip", z.ZodTypeAny, {
5983
+ createdAt: string;
5984
+ sourceAgent: string;
5985
+ description: string;
5986
+ checkpointId?: string | undefined;
5987
+ context?: string | undefined;
5988
+ }, {
5989
+ createdAt: string;
5990
+ sourceAgent: string;
5991
+ description: string;
5992
+ checkpointId?: string | undefined;
5993
+ context?: string | undefined;
5994
+ }>, "many">>;
5995
+ parents: z.ZodDefault<z.ZodArray<z.ZodObject<{
5996
+ nodeId: z.ZodString;
5997
+ conclusion: z.ZodEnum<["candidate", "confirmed", "rejected", "uncertain"]>;
5998
+ /** Distinguishes the structural fallback from a parent explicitly proposed by Trace. */
5999
+ origin: z.ZodOptional<z.ZodEnum<["host_fallback", "trace"]>>;
6000
+ /** Current concise reason; earlier reasons remain in TraceChangeLog. */
6001
+ reason: z.ZodOptional<z.ZodString>;
6002
+ }, "strip", z.ZodTypeAny, {
6003
+ nodeId: string;
6004
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
5920
6005
  reason?: string | undefined;
5921
- description?: string | undefined;
6006
+ origin?: "host_fallback" | "trace" | undefined;
6007
+ }, {
6008
+ nodeId: string;
6009
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6010
+ reason?: string | undefined;
6011
+ origin?: "host_fallback" | "trace" | undefined;
6012
+ }>, "many">>;
6013
+ executionResult: z.ZodDefault<z.ZodEnum<["completed", "failed"]>>;
6014
+ revoked: z.ZodDefault<z.ZodBoolean>;
6015
+ /** Historical nodes may be unevaluated; all new Trace writes provide both. */
6016
+ confidence: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
6017
+ confidenceReason: z.ZodOptional<z.ZodString>;
6018
+ reviewConclusion: z.ZodDefault<z.ZodEnum<["unreviewed", "approved", "rejected", "uncertain"]>>;
6019
+ reviewReason: z.ZodOptional<z.ZodString>;
6020
+ }, "strip", z.ZodTypeAny, {
6021
+ type: string;
6022
+ status: string;
6023
+ id: string;
6024
+ title: string;
6025
+ parents: {
6026
+ nodeId: string;
6027
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6028
+ reason?: string | undefined;
6029
+ origin?: "host_fallback" | "trace" | undefined;
6030
+ }[];
6031
+ toolCalls: string[];
6032
+ artifactIds: string[];
6033
+ episodeTags: string[];
6034
+ records: {
6035
+ createdAt: string;
6036
+ sourceAgent: string;
6037
+ description: string;
6038
+ checkpointId?: string | undefined;
5922
6039
  context?: string | undefined;
5923
- agent?: string | undefined;
5924
- metadata?: Record<string, unknown> | undefined;
5925
- report?: {
5926
- kind: "agent_report";
5927
- summary?: string | undefined;
5928
- content?: string | undefined;
5929
- author?: string | undefined;
5930
- } | undefined;
5931
- errorMessage?: string | undefined;
5932
- primaryEpisodeId?: string | undefined;
5933
- confidence?: "low" | "medium" | "high" | undefined;
5934
- confidenceReason?: string | undefined;
5935
- reviewReason?: string | undefined;
5936
6040
  }[];
5937
- episodes: {
5938
- id: string;
5939
- title: string;
6041
+ executionResult: "failed" | "completed";
6042
+ revoked: boolean;
6043
+ reviewConclusion: "rejected" | "uncertain" | "unreviewed" | "approved";
6044
+ createdAt?: string | undefined;
6045
+ updatedAt?: string | undefined;
6046
+ durationMs?: number | undefined;
6047
+ timestamp?: {
5940
6048
  createdAt?: string | undefined;
5941
- updatedAt?: string | undefined;
5942
- description?: string | undefined;
5943
- }[];
5944
- dependencies: {
5945
- id: string;
5946
- origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
5947
- confidence: "low" | "medium" | "high";
5948
- prerequisiteId: string;
5949
- dependentId: string;
5950
- state: "active" | "rejected" | "proposed";
5951
- evidence: {
5952
- kind: string;
6049
+ startedAt?: string | undefined;
6050
+ completedAt?: string | undefined;
6051
+ } | undefined;
6052
+ reason?: string | undefined;
6053
+ description?: string | undefined;
6054
+ context?: string | undefined;
6055
+ agent?: string | undefined;
6056
+ metadata?: Record<string, unknown> | undefined;
6057
+ report?: {
6058
+ kind: "agent_report";
6059
+ summary?: string | undefined;
6060
+ content?: string | undefined;
6061
+ author?: string | undefined;
6062
+ } | undefined;
6063
+ errorMessage?: string | undefined;
6064
+ primaryEpisodeId?: string | undefined;
6065
+ confidence?: "low" | "medium" | "high" | undefined;
6066
+ confidenceReason?: string | undefined;
6067
+ reviewReason?: string | undefined;
6068
+ }, {
6069
+ type: string;
6070
+ status: string;
6071
+ id: string;
6072
+ title: string;
6073
+ toolCalls: string[];
6074
+ createdAt?: string | undefined;
6075
+ updatedAt?: string | undefined;
6076
+ durationMs?: number | undefined;
6077
+ timestamp?: {
6078
+ createdAt?: string | undefined;
6079
+ startedAt?: string | undefined;
6080
+ completedAt?: string | undefined;
6081
+ } | undefined;
6082
+ reason?: string | undefined;
6083
+ description?: string | undefined;
6084
+ context?: string | undefined;
6085
+ agent?: string | undefined;
6086
+ metadata?: Record<string, unknown> | undefined;
6087
+ report?: {
6088
+ kind: "agent_report";
6089
+ summary?: string | undefined;
6090
+ content?: string | undefined;
6091
+ author?: string | undefined;
6092
+ } | undefined;
6093
+ parents?: {
6094
+ nodeId: string;
6095
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6096
+ reason?: string | undefined;
6097
+ origin?: "host_fallback" | "trace" | undefined;
6098
+ }[] | undefined;
6099
+ errorMessage?: string | undefined;
6100
+ artifactIds?: string[] | undefined;
6101
+ primaryEpisodeId?: string | undefined;
6102
+ episodeTags?: string[] | undefined;
6103
+ records?: {
6104
+ createdAt: string;
6105
+ sourceAgent: string;
6106
+ description: string;
6107
+ checkpointId?: string | undefined;
6108
+ context?: string | undefined;
6109
+ }[] | undefined;
6110
+ executionResult?: "failed" | "completed" | undefined;
6111
+ revoked?: boolean | undefined;
6112
+ confidence?: "low" | "medium" | "high" | undefined;
6113
+ confidenceReason?: string | undefined;
6114
+ reviewConclusion?: "rejected" | "uncertain" | "unreviewed" | "approved" | undefined;
6115
+ reviewReason?: string | undefined;
6116
+ }>, "many">>;
6117
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
6118
+ id: z.ZodString;
6119
+ prerequisiteId: z.ZodString;
6120
+ dependentId: z.ZodString;
6121
+ origin: z.ZodEnum<["trace", "agent_report", "explicit", "host", "user", "legacy"]>;
6122
+ confidence: z.ZodEnum<["low", "medium", "high"]>;
6123
+ state: z.ZodEnum<["proposed", "active", "rejected"]>;
6124
+ reason: z.ZodOptional<z.ZodString>;
6125
+ evidence: z.ZodArray<z.ZodObject<{
6126
+ source: z.ZodString;
6127
+ kind: z.ZodString;
6128
+ detail: z.ZodOptional<z.ZodString>;
6129
+ artifactId: z.ZodOptional<z.ZodString>;
6130
+ reportId: z.ZodOptional<z.ZodString>;
6131
+ path: z.ZodOptional<z.ZodString>;
6132
+ checkpointId: z.ZodOptional<z.ZodString>;
6133
+ baseBlobId: z.ZodOptional<z.ZodString>;
6134
+ resultBlobId: z.ZodOptional<z.ZodString>;
6135
+ deterministic: z.ZodOptional<z.ZodBoolean>;
6136
+ }, "strip", z.ZodTypeAny, {
6137
+ kind: string;
6138
+ source: string;
6139
+ path?: string | undefined;
6140
+ checkpointId?: string | undefined;
6141
+ detail?: string | undefined;
6142
+ artifactId?: string | undefined;
6143
+ reportId?: string | undefined;
6144
+ baseBlobId?: string | undefined;
6145
+ resultBlobId?: string | undefined;
6146
+ deterministic?: boolean | undefined;
6147
+ }, {
6148
+ kind: string;
6149
+ source: string;
6150
+ path?: string | undefined;
6151
+ checkpointId?: string | undefined;
6152
+ detail?: string | undefined;
6153
+ artifactId?: string | undefined;
6154
+ reportId?: string | undefined;
6155
+ baseBlobId?: string | undefined;
6156
+ resultBlobId?: string | undefined;
6157
+ deterministic?: boolean | undefined;
6158
+ }>, "many">;
6159
+ createdAt: z.ZodOptional<z.ZodString>;
6160
+ updatedAt: z.ZodOptional<z.ZodString>;
6161
+ }, "strip", z.ZodTypeAny, {
6162
+ id: string;
6163
+ origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
6164
+ confidence: "low" | "medium" | "high";
6165
+ prerequisiteId: string;
6166
+ dependentId: string;
6167
+ state: "active" | "rejected" | "proposed";
6168
+ evidence: {
6169
+ kind: string;
6170
+ source: string;
6171
+ path?: string | undefined;
6172
+ checkpointId?: string | undefined;
6173
+ detail?: string | undefined;
6174
+ artifactId?: string | undefined;
6175
+ reportId?: string | undefined;
6176
+ baseBlobId?: string | undefined;
6177
+ resultBlobId?: string | undefined;
6178
+ deterministic?: boolean | undefined;
6179
+ }[];
6180
+ createdAt?: string | undefined;
6181
+ updatedAt?: string | undefined;
6182
+ reason?: string | undefined;
6183
+ }, {
6184
+ id: string;
6185
+ origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
6186
+ confidence: "low" | "medium" | "high";
6187
+ prerequisiteId: string;
6188
+ dependentId: string;
6189
+ state: "active" | "rejected" | "proposed";
6190
+ evidence: {
6191
+ kind: string;
6192
+ source: string;
6193
+ path?: string | undefined;
6194
+ checkpointId?: string | undefined;
6195
+ detail?: string | undefined;
6196
+ artifactId?: string | undefined;
6197
+ reportId?: string | undefined;
6198
+ baseBlobId?: string | undefined;
6199
+ resultBlobId?: string | undefined;
6200
+ deterministic?: boolean | undefined;
6201
+ }[];
6202
+ createdAt?: string | undefined;
6203
+ updatedAt?: string | undefined;
6204
+ reason?: string | undefined;
6205
+ }>, "many">>;
6206
+ episodes: z.ZodOptional<z.ZodArray<z.ZodObject<{
6207
+ id: z.ZodString;
6208
+ title: z.ZodString;
6209
+ description: z.ZodOptional<z.ZodString>;
6210
+ createdAt: z.ZodOptional<z.ZodString>;
6211
+ updatedAt: z.ZodOptional<z.ZodString>;
6212
+ }, "strip", z.ZodTypeAny, {
6213
+ id: string;
6214
+ title: string;
6215
+ createdAt?: string | undefined;
6216
+ updatedAt?: string | undefined;
6217
+ description?: string | undefined;
6218
+ }, {
6219
+ id: string;
6220
+ title: string;
6221
+ createdAt?: string | undefined;
6222
+ updatedAt?: string | undefined;
6223
+ description?: string | undefined;
6224
+ }>, "many">>;
6225
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodObject<{
6226
+ id: z.ZodString;
6227
+ producerNodeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6228
+ path: z.ZodString;
6229
+ kind: z.ZodString;
6230
+ type: z.ZodOptional<z.ZodString>;
6231
+ checkpointId: z.ZodOptional<z.ZodString>;
6232
+ checkpoint: z.ZodOptional<z.ZodObject<{
6233
+ id: z.ZodString;
6234
+ commitId: z.ZodOptional<z.ZodString>;
6235
+ status: z.ZodEnum<["ready", "partial", "failed", "unavailable"]>;
6236
+ capturedAt: z.ZodString;
6237
+ sourceAgent: z.ZodOptional<z.ZodString>;
6238
+ baseCheckpointId: z.ZodOptional<z.ZodString>;
6239
+ stats: z.ZodOptional<z.ZodObject<{
6240
+ files: z.ZodNumber;
6241
+ added: z.ZodNumber;
6242
+ modified: z.ZodNumber;
6243
+ deleted: z.ZodNumber;
6244
+ renamed: z.ZodNumber;
6245
+ }, "strip", z.ZodTypeAny, {
6246
+ files: number;
6247
+ added: number;
6248
+ modified: number;
6249
+ deleted: number;
6250
+ renamed: number;
6251
+ }, {
6252
+ files: number;
6253
+ added: number;
6254
+ modified: number;
6255
+ deleted: number;
6256
+ renamed: number;
6257
+ }>>;
6258
+ skippedCount: z.ZodDefault<z.ZodNumber>;
6259
+ error: z.ZodOptional<z.ZodString>;
6260
+ }, "strip", z.ZodTypeAny, {
6261
+ status: "failed" | "partial" | "ready" | "unavailable";
6262
+ id: string;
6263
+ capturedAt: string;
6264
+ skippedCount: number;
6265
+ error?: string | undefined;
6266
+ commitId?: string | undefined;
6267
+ sourceAgent?: string | undefined;
6268
+ baseCheckpointId?: string | undefined;
6269
+ stats?: {
6270
+ files: number;
6271
+ added: number;
6272
+ modified: number;
6273
+ deleted: number;
6274
+ renamed: number;
6275
+ } | undefined;
6276
+ }, {
6277
+ status: "failed" | "partial" | "ready" | "unavailable";
6278
+ id: string;
6279
+ capturedAt: string;
6280
+ error?: string | undefined;
6281
+ commitId?: string | undefined;
6282
+ sourceAgent?: string | undefined;
6283
+ baseCheckpointId?: string | undefined;
6284
+ stats?: {
6285
+ files: number;
6286
+ added: number;
6287
+ modified: number;
6288
+ deleted: number;
6289
+ renamed: number;
6290
+ } | undefined;
6291
+ skippedCount?: number | undefined;
6292
+ }>>;
6293
+ blobHash: z.ZodOptional<z.ZodString>;
6294
+ changeStatus: z.ZodOptional<z.ZodEnum<["added", "modified", "deleted", "renamed"]>>;
6295
+ previousPath: z.ZodOptional<z.ZodString>;
6296
+ exists: z.ZodDefault<z.ZodEnum<["unknown", "present", "missing"]>>;
6297
+ verificationStatus: z.ZodDefault<z.ZodEnum<["unverified", "reserved", "verified", "missing"]>>;
6298
+ role: z.ZodOptional<z.ZodEnum<["input", "output", "checkpoint", "reference"]>>;
6299
+ createdAt: z.ZodOptional<z.ZodString>;
6300
+ updatedAt: z.ZodOptional<z.ZodString>;
6301
+ }, "strip", z.ZodTypeAny, {
6302
+ path: string;
6303
+ id: string;
6304
+ kind: string;
6305
+ exists: "unknown" | "missing" | "present";
6306
+ verificationStatus: "unverified" | "reserved" | "verified" | "missing";
6307
+ type?: string | undefined;
6308
+ createdAt?: string | undefined;
6309
+ updatedAt?: string | undefined;
6310
+ previousPath?: string | undefined;
6311
+ checkpoint?: {
6312
+ status: "failed" | "partial" | "ready" | "unavailable";
6313
+ id: string;
6314
+ capturedAt: string;
6315
+ skippedCount: number;
6316
+ error?: string | undefined;
6317
+ commitId?: string | undefined;
6318
+ sourceAgent?: string | undefined;
6319
+ baseCheckpointId?: string | undefined;
6320
+ stats?: {
6321
+ files: number;
6322
+ added: number;
6323
+ modified: number;
6324
+ deleted: number;
6325
+ renamed: number;
6326
+ } | undefined;
6327
+ } | undefined;
6328
+ checkpointId?: string | undefined;
6329
+ producerNodeId?: string | null | undefined;
6330
+ blobHash?: string | undefined;
6331
+ changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
6332
+ role?: "input" | "output" | "checkpoint" | "reference" | undefined;
6333
+ }, {
6334
+ path: string;
6335
+ id: string;
6336
+ kind: string;
6337
+ type?: string | undefined;
6338
+ createdAt?: string | undefined;
6339
+ updatedAt?: string | undefined;
6340
+ previousPath?: string | undefined;
6341
+ checkpoint?: {
6342
+ status: "failed" | "partial" | "ready" | "unavailable";
6343
+ id: string;
6344
+ capturedAt: string;
6345
+ error?: string | undefined;
6346
+ commitId?: string | undefined;
6347
+ sourceAgent?: string | undefined;
6348
+ baseCheckpointId?: string | undefined;
6349
+ stats?: {
6350
+ files: number;
6351
+ added: number;
6352
+ modified: number;
6353
+ deleted: number;
6354
+ renamed: number;
6355
+ } | undefined;
6356
+ skippedCount?: number | undefined;
6357
+ } | undefined;
6358
+ checkpointId?: string | undefined;
6359
+ producerNodeId?: string | null | undefined;
6360
+ blobHash?: string | undefined;
6361
+ changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
6362
+ exists?: "unknown" | "missing" | "present" | undefined;
6363
+ verificationStatus?: "unverified" | "reserved" | "verified" | "missing" | undefined;
6364
+ role?: "input" | "output" | "checkpoint" | "reference" | undefined;
6365
+ }>, "many">>;
6366
+ removed: z.ZodOptional<z.ZodObject<{
6367
+ nodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6368
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6369
+ episodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6370
+ artifacts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
6371
+ }, "strip", z.ZodTypeAny, {
6372
+ artifacts?: string[] | undefined;
6373
+ nodes?: string[] | undefined;
6374
+ episodes?: string[] | undefined;
6375
+ dependencies?: string[] | undefined;
6376
+ }, {
6377
+ artifacts?: string[] | undefined;
6378
+ nodes?: string[] | undefined;
6379
+ episodes?: string[] | undefined;
6380
+ dependencies?: string[] | undefined;
6381
+ }>>;
6382
+ }, "strip", z.ZodTypeAny, {
6383
+ revision: number;
6384
+ schemaVersion: "2.0";
6385
+ op: "snapshot" | "upsert" | "remove" | "patch";
6386
+ id?: string | undefined;
6387
+ artifacts?: {
6388
+ path: string;
6389
+ id: string;
6390
+ kind: string;
6391
+ exists: "unknown" | "missing" | "present";
6392
+ verificationStatus: "unverified" | "reserved" | "verified" | "missing";
6393
+ type?: string | undefined;
6394
+ createdAt?: string | undefined;
6395
+ updatedAt?: string | undefined;
6396
+ previousPath?: string | undefined;
6397
+ checkpoint?: {
6398
+ status: "failed" | "partial" | "ready" | "unavailable";
6399
+ id: string;
6400
+ capturedAt: string;
6401
+ skippedCount: number;
6402
+ error?: string | undefined;
6403
+ commitId?: string | undefined;
6404
+ sourceAgent?: string | undefined;
6405
+ baseCheckpointId?: string | undefined;
6406
+ stats?: {
6407
+ files: number;
6408
+ added: number;
6409
+ modified: number;
6410
+ deleted: number;
6411
+ renamed: number;
6412
+ } | undefined;
6413
+ } | undefined;
6414
+ checkpointId?: string | undefined;
6415
+ producerNodeId?: string | null | undefined;
6416
+ blobHash?: string | undefined;
6417
+ changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
6418
+ role?: "input" | "output" | "checkpoint" | "reference" | undefined;
6419
+ }[] | undefined;
6420
+ meta?: z.objectOutputType<{
6421
+ sessionId: z.ZodString;
6422
+ /** Host-managed structural root. It is not a scientific Trace claim. */
6423
+ rootNodeId: z.ZodOptional<z.ZodString>;
6424
+ userId: z.ZodOptional<z.ZodString>;
6425
+ projectName: z.ZodOptional<z.ZodString>;
6426
+ currentFocus: z.ZodOptional<z.ZodString>;
6427
+ createdAt: z.ZodOptional<z.ZodString>;
6428
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6429
+ nodes?: {
6430
+ type: string;
6431
+ status: string;
6432
+ id: string;
6433
+ title: string;
6434
+ parents: {
6435
+ nodeId: string;
6436
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6437
+ reason?: string | undefined;
6438
+ origin?: "host_fallback" | "trace" | undefined;
6439
+ }[];
6440
+ toolCalls: string[];
6441
+ artifactIds: string[];
6442
+ episodeTags: string[];
6443
+ records: {
6444
+ createdAt: string;
6445
+ sourceAgent: string;
6446
+ description: string;
6447
+ checkpointId?: string | undefined;
6448
+ context?: string | undefined;
6449
+ }[];
6450
+ executionResult: "failed" | "completed";
6451
+ revoked: boolean;
6452
+ reviewConclusion: "rejected" | "uncertain" | "unreviewed" | "approved";
6453
+ createdAt?: string | undefined;
6454
+ updatedAt?: string | undefined;
6455
+ durationMs?: number | undefined;
6456
+ timestamp?: {
6457
+ createdAt?: string | undefined;
6458
+ startedAt?: string | undefined;
6459
+ completedAt?: string | undefined;
6460
+ } | undefined;
6461
+ reason?: string | undefined;
6462
+ description?: string | undefined;
6463
+ context?: string | undefined;
6464
+ agent?: string | undefined;
6465
+ metadata?: Record<string, unknown> | undefined;
6466
+ report?: {
6467
+ kind: "agent_report";
6468
+ summary?: string | undefined;
6469
+ content?: string | undefined;
6470
+ author?: string | undefined;
6471
+ } | undefined;
6472
+ errorMessage?: string | undefined;
6473
+ primaryEpisodeId?: string | undefined;
6474
+ confidence?: "low" | "medium" | "high" | undefined;
6475
+ confidenceReason?: string | undefined;
6476
+ reviewReason?: string | undefined;
6477
+ }[] | undefined;
6478
+ episodes?: {
6479
+ id: string;
6480
+ title: string;
6481
+ createdAt?: string | undefined;
6482
+ updatedAt?: string | undefined;
6483
+ description?: string | undefined;
6484
+ }[] | undefined;
6485
+ dependencies?: {
6486
+ id: string;
6487
+ origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
6488
+ confidence: "low" | "medium" | "high";
6489
+ prerequisiteId: string;
6490
+ dependentId: string;
6491
+ state: "active" | "rejected" | "proposed";
6492
+ evidence: {
6493
+ kind: string;
6494
+ source: string;
6495
+ path?: string | undefined;
6496
+ checkpointId?: string | undefined;
6497
+ detail?: string | undefined;
6498
+ artifactId?: string | undefined;
6499
+ reportId?: string | undefined;
6500
+ baseBlobId?: string | undefined;
6501
+ resultBlobId?: string | undefined;
6502
+ deterministic?: boolean | undefined;
6503
+ }[];
6504
+ createdAt?: string | undefined;
6505
+ updatedAt?: string | undefined;
6506
+ reason?: string | undefined;
6507
+ }[] | undefined;
6508
+ graph?: {
6509
+ artifacts: {
6510
+ path: string;
6511
+ id: string;
6512
+ kind: string;
6513
+ exists: "unknown" | "missing" | "present";
6514
+ verificationStatus: "unverified" | "reserved" | "verified" | "missing";
6515
+ type?: string | undefined;
6516
+ createdAt?: string | undefined;
6517
+ updatedAt?: string | undefined;
6518
+ previousPath?: string | undefined;
6519
+ checkpoint?: {
6520
+ status: "failed" | "partial" | "ready" | "unavailable";
6521
+ id: string;
6522
+ capturedAt: string;
6523
+ skippedCount: number;
6524
+ error?: string | undefined;
6525
+ commitId?: string | undefined;
6526
+ sourceAgent?: string | undefined;
6527
+ baseCheckpointId?: string | undefined;
6528
+ stats?: {
6529
+ files: number;
6530
+ added: number;
6531
+ modified: number;
6532
+ deleted: number;
6533
+ renamed: number;
6534
+ } | undefined;
6535
+ } | undefined;
6536
+ checkpointId?: string | undefined;
6537
+ producerNodeId?: string | null | undefined;
6538
+ blobHash?: string | undefined;
6539
+ changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
6540
+ role?: "input" | "output" | "checkpoint" | "reference" | undefined;
6541
+ }[];
6542
+ revision: number;
6543
+ schemaVersion: "2.0";
6544
+ meta: {
6545
+ sessionId: string;
6546
+ createdAt?: string | undefined;
6547
+ rootNodeId?: string | undefined;
6548
+ userId?: string | undefined;
6549
+ projectName?: string | undefined;
6550
+ currentFocus?: string | undefined;
6551
+ } & {
6552
+ [k: string]: unknown;
6553
+ };
6554
+ nodes: {
6555
+ type: string;
6556
+ status: string;
6557
+ id: string;
6558
+ title: string;
6559
+ parents: {
6560
+ nodeId: string;
6561
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6562
+ reason?: string | undefined;
6563
+ origin?: "host_fallback" | "trace" | undefined;
6564
+ }[];
6565
+ toolCalls: string[];
6566
+ artifactIds: string[];
6567
+ episodeTags: string[];
6568
+ records: {
6569
+ createdAt: string;
6570
+ sourceAgent: string;
6571
+ description: string;
6572
+ checkpointId?: string | undefined;
6573
+ context?: string | undefined;
6574
+ }[];
6575
+ executionResult: "failed" | "completed";
6576
+ revoked: boolean;
6577
+ reviewConclusion: "rejected" | "uncertain" | "unreviewed" | "approved";
6578
+ createdAt?: string | undefined;
6579
+ updatedAt?: string | undefined;
6580
+ durationMs?: number | undefined;
6581
+ timestamp?: {
6582
+ createdAt?: string | undefined;
6583
+ startedAt?: string | undefined;
6584
+ completedAt?: string | undefined;
6585
+ } | undefined;
6586
+ reason?: string | undefined;
6587
+ description?: string | undefined;
6588
+ context?: string | undefined;
6589
+ agent?: string | undefined;
6590
+ metadata?: Record<string, unknown> | undefined;
6591
+ report?: {
6592
+ kind: "agent_report";
6593
+ summary?: string | undefined;
6594
+ content?: string | undefined;
6595
+ author?: string | undefined;
6596
+ } | undefined;
6597
+ errorMessage?: string | undefined;
6598
+ primaryEpisodeId?: string | undefined;
6599
+ confidence?: "low" | "medium" | "high" | undefined;
6600
+ confidenceReason?: string | undefined;
6601
+ reviewReason?: string | undefined;
6602
+ }[];
6603
+ episodes: {
6604
+ id: string;
6605
+ title: string;
6606
+ createdAt?: string | undefined;
6607
+ updatedAt?: string | undefined;
6608
+ description?: string | undefined;
6609
+ }[];
6610
+ dependencies: {
6611
+ id: string;
6612
+ origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
6613
+ confidence: "low" | "medium" | "high";
6614
+ prerequisiteId: string;
6615
+ dependentId: string;
6616
+ state: "active" | "rejected" | "proposed";
6617
+ evidence: {
6618
+ kind: string;
5953
6619
  source: string;
5954
6620
  path?: string | undefined;
5955
6621
  checkpointId?: string | undefined;
@@ -5966,11 +6632,138 @@ export declare const TraceDeltaV2Schema: z.ZodObject<{
5966
6632
  }[];
5967
6633
  } | undefined;
5968
6634
  entity?: "node" | "dependency" | "episode" | "artifact" | undefined;
6635
+ removed?: {
6636
+ artifacts?: string[] | undefined;
6637
+ nodes?: string[] | undefined;
6638
+ episodes?: string[] | undefined;
6639
+ dependencies?: string[] | undefined;
6640
+ } | undefined;
5969
6641
  }, {
5970
6642
  revision: number;
5971
6643
  schemaVersion: "2.0";
5972
- op: "snapshot" | "upsert" | "remove";
6644
+ op: "snapshot" | "upsert" | "remove" | "patch";
5973
6645
  id?: string | undefined;
6646
+ artifacts?: {
6647
+ path: string;
6648
+ id: string;
6649
+ kind: string;
6650
+ type?: string | undefined;
6651
+ createdAt?: string | undefined;
6652
+ updatedAt?: string | undefined;
6653
+ previousPath?: string | undefined;
6654
+ checkpoint?: {
6655
+ status: "failed" | "partial" | "ready" | "unavailable";
6656
+ id: string;
6657
+ capturedAt: string;
6658
+ error?: string | undefined;
6659
+ commitId?: string | undefined;
6660
+ sourceAgent?: string | undefined;
6661
+ baseCheckpointId?: string | undefined;
6662
+ stats?: {
6663
+ files: number;
6664
+ added: number;
6665
+ modified: number;
6666
+ deleted: number;
6667
+ renamed: number;
6668
+ } | undefined;
6669
+ skippedCount?: number | undefined;
6670
+ } | undefined;
6671
+ checkpointId?: string | undefined;
6672
+ producerNodeId?: string | null | undefined;
6673
+ blobHash?: string | undefined;
6674
+ changeStatus?: "added" | "modified" | "deleted" | "renamed" | undefined;
6675
+ exists?: "unknown" | "missing" | "present" | undefined;
6676
+ verificationStatus?: "unverified" | "reserved" | "verified" | "missing" | undefined;
6677
+ role?: "input" | "output" | "checkpoint" | "reference" | undefined;
6678
+ }[] | undefined;
6679
+ meta?: z.objectInputType<{
6680
+ sessionId: z.ZodString;
6681
+ /** Host-managed structural root. It is not a scientific Trace claim. */
6682
+ rootNodeId: z.ZodOptional<z.ZodString>;
6683
+ userId: z.ZodOptional<z.ZodString>;
6684
+ projectName: z.ZodOptional<z.ZodString>;
6685
+ currentFocus: z.ZodOptional<z.ZodString>;
6686
+ createdAt: z.ZodOptional<z.ZodString>;
6687
+ }, z.ZodTypeAny, "passthrough"> | undefined;
6688
+ nodes?: {
6689
+ type: string;
6690
+ status: string;
6691
+ id: string;
6692
+ title: string;
6693
+ toolCalls: string[];
6694
+ createdAt?: string | undefined;
6695
+ updatedAt?: string | undefined;
6696
+ durationMs?: number | undefined;
6697
+ timestamp?: {
6698
+ createdAt?: string | undefined;
6699
+ startedAt?: string | undefined;
6700
+ completedAt?: string | undefined;
6701
+ } | undefined;
6702
+ reason?: string | undefined;
6703
+ description?: string | undefined;
6704
+ context?: string | undefined;
6705
+ agent?: string | undefined;
6706
+ metadata?: Record<string, unknown> | undefined;
6707
+ report?: {
6708
+ kind: "agent_report";
6709
+ summary?: string | undefined;
6710
+ content?: string | undefined;
6711
+ author?: string | undefined;
6712
+ } | undefined;
6713
+ parents?: {
6714
+ nodeId: string;
6715
+ conclusion: "candidate" | "confirmed" | "rejected" | "uncertain";
6716
+ reason?: string | undefined;
6717
+ origin?: "host_fallback" | "trace" | undefined;
6718
+ }[] | undefined;
6719
+ errorMessage?: string | undefined;
6720
+ artifactIds?: string[] | undefined;
6721
+ primaryEpisodeId?: string | undefined;
6722
+ episodeTags?: string[] | undefined;
6723
+ records?: {
6724
+ createdAt: string;
6725
+ sourceAgent: string;
6726
+ description: string;
6727
+ checkpointId?: string | undefined;
6728
+ context?: string | undefined;
6729
+ }[] | undefined;
6730
+ executionResult?: "failed" | "completed" | undefined;
6731
+ revoked?: boolean | undefined;
6732
+ confidence?: "low" | "medium" | "high" | undefined;
6733
+ confidenceReason?: string | undefined;
6734
+ reviewConclusion?: "rejected" | "uncertain" | "unreviewed" | "approved" | undefined;
6735
+ reviewReason?: string | undefined;
6736
+ }[] | undefined;
6737
+ episodes?: {
6738
+ id: string;
6739
+ title: string;
6740
+ createdAt?: string | undefined;
6741
+ updatedAt?: string | undefined;
6742
+ description?: string | undefined;
6743
+ }[] | undefined;
6744
+ dependencies?: {
6745
+ id: string;
6746
+ origin: "trace" | "user" | "host" | "agent_report" | "explicit" | "legacy";
6747
+ confidence: "low" | "medium" | "high";
6748
+ prerequisiteId: string;
6749
+ dependentId: string;
6750
+ state: "active" | "rejected" | "proposed";
6751
+ evidence: {
6752
+ kind: string;
6753
+ source: string;
6754
+ path?: string | undefined;
6755
+ checkpointId?: string | undefined;
6756
+ detail?: string | undefined;
6757
+ artifactId?: string | undefined;
6758
+ reportId?: string | undefined;
6759
+ baseBlobId?: string | undefined;
6760
+ resultBlobId?: string | undefined;
6761
+ deterministic?: boolean | undefined;
6762
+ }[];
6763
+ createdAt?: string | undefined;
6764
+ updatedAt?: string | undefined;
6765
+ reason?: string | undefined;
6766
+ }[] | undefined;
5974
6767
  graph?: {
5975
6768
  artifacts: {
5976
6769
  path: string;
@@ -6098,6 +6891,12 @@ export declare const TraceDeltaV2Schema: z.ZodObject<{
6098
6891
  }[];
6099
6892
  } | undefined;
6100
6893
  entity?: "node" | "dependency" | "episode" | "artifact" | undefined;
6894
+ removed?: {
6895
+ artifacts?: string[] | undefined;
6896
+ nodes?: string[] | undefined;
6897
+ episodes?: string[] | undefined;
6898
+ dependencies?: string[] | undefined;
6899
+ } | undefined;
6101
6900
  }>;
6102
6901
  export type TraceDeltaV2 = z.infer<typeof TraceDeltaV2Schema>;
6103
6902
  export declare const TraceGraphSchema: z.ZodObject<{
@@ -7217,9 +8016,19 @@ export type ProviderAdapter = z.infer<typeof ProviderAdapterSchema>;
7217
8016
  * anthropic-messages short-circuited the runtime's adapter fallback).
7218
8017
  */
7219
8018
  export declare function deriveProviderApi(adapter?: ProviderAdapter): ProviderApi | undefined;
7220
- /** Context-window presets exposed by provider settings. Omission means auto. */
7221
- export declare const ProviderContextWindowSchema: z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>;
8019
+ /**
8020
+ * Context-window presets exposed by provider settings. Omission means auto.
8021
+ *
8022
+ * 32K (32768) and 128K (131072) are the small-window presets needed to match
8023
+ * smaller self-hosted models and to run long-dialogue compaction at a sane
8024
+ * cost; 256K and 1M stay for existing profiles. The set is deliberately closed:
8025
+ * the editor only offers these values, so a stray number (e.g. 40000) must be
8026
+ * rejected instead of persisted as a window the runtime cannot reason about.
8027
+ */
8028
+ export declare const ProviderContextWindowSchema: z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>;
7222
8029
  export type ProviderContextWindow = z.infer<typeof ProviderContextWindowSchema>;
8030
+ /** Optional per-profile output ceiling; omission keeps the runtime default. */
8031
+ export declare const ProviderMaxTokensSchema: z.ZodNumber;
7223
8032
  export declare const ProviderProfileSchema: z.ZodObject<{
7224
8033
  id: z.ZodString;
7225
8034
  name: z.ZodString;
@@ -7228,7 +8037,8 @@ export declare const ProviderProfileSchema: z.ZodObject<{
7228
8037
  adapter: z.ZodOptional<z.ZodEnum<["auto", "openai", "anthropic"]>>;
7229
8038
  isShared: z.ZodBoolean;
7230
8039
  models: z.ZodArray<z.ZodString, "many">;
7231
- contextWindow: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>;
8040
+ contextWindow: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>;
8041
+ maxTokens: z.ZodOptional<z.ZodNumber>;
7232
8042
  /** Model ids declared capable of Pi extended thinking. */
7233
8043
  reasoningModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7234
8044
  icon: z.ZodString;
@@ -7282,7 +8092,8 @@ export declare const ProviderProfileSchema: z.ZodObject<{
7282
8092
  checkedAt?: number | undefined;
7283
8093
  }[];
7284
8094
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7285
- contextWindow?: 262144 | 1000000 | undefined;
8095
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | undefined;
8096
+ maxTokens?: number | undefined;
7286
8097
  reasoningModels?: string[] | undefined;
7287
8098
  healthCheckedAt?: number | undefined;
7288
8099
  }, {
@@ -7308,7 +8119,8 @@ export declare const ProviderProfileSchema: z.ZodObject<{
7308
8119
  checkedAt?: number | undefined;
7309
8120
  }[];
7310
8121
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7311
- contextWindow?: 262144 | 1000000 | undefined;
8122
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | undefined;
8123
+ maxTokens?: number | undefined;
7312
8124
  reasoningModels?: string[] | undefined;
7313
8125
  healthCheckedAt?: number | undefined;
7314
8126
  }>;
@@ -7322,8 +8134,10 @@ export declare const ProviderProfileCreateSchema: z.ZodObject<{
7322
8134
  api_key: z.ZodOptional<z.ZodString>;
7323
8135
  apiKey: z.ZodOptional<z.ZodString>;
7324
8136
  models: z.ZodArray<z.ZodString, "many">;
7325
- context_window: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>;
7326
- contextWindow: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>;
8137
+ context_window: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>;
8138
+ contextWindow: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>;
8139
+ max_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8140
+ maxTokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7327
8141
  reasoning_models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7328
8142
  reasoningModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7329
8143
  icon: z.ZodOptional<z.ZodString>;
@@ -7337,14 +8151,16 @@ export declare const ProviderProfileCreateSchema: z.ZodObject<{
7337
8151
  baseUrl?: string | undefined;
7338
8152
  api?: "anthropic-messages" | "openai-completions" | "openai-responses" | "azure-openai-responses" | undefined;
7339
8153
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7340
- contextWindow?: 262144 | 1000000 | null | undefined;
8154
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8155
+ maxTokens?: number | null | undefined;
7341
8156
  reasoningModels?: string[] | undefined;
7342
8157
  icon?: string | undefined;
7343
8158
  iconColor?: string | undefined;
7344
8159
  notes?: string | undefined;
7345
8160
  base_url?: string | undefined;
7346
8161
  api_key?: string | undefined;
7347
- context_window?: 262144 | 1000000 | null | undefined;
8162
+ context_window?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8163
+ max_tokens?: number | null | undefined;
7348
8164
  reasoning_models?: string[] | undefined;
7349
8165
  icon_color?: string | undefined;
7350
8166
  }, {
@@ -7354,14 +8170,16 @@ export declare const ProviderProfileCreateSchema: z.ZodObject<{
7354
8170
  baseUrl?: string | undefined;
7355
8171
  api?: "anthropic-messages" | "openai-completions" | "openai-responses" | "azure-openai-responses" | undefined;
7356
8172
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7357
- contextWindow?: 262144 | 1000000 | null | undefined;
8173
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8174
+ maxTokens?: number | null | undefined;
7358
8175
  reasoningModels?: string[] | undefined;
7359
8176
  icon?: string | undefined;
7360
8177
  iconColor?: string | undefined;
7361
8178
  notes?: string | undefined;
7362
8179
  base_url?: string | undefined;
7363
8180
  api_key?: string | undefined;
7364
- context_window?: 262144 | 1000000 | null | undefined;
8181
+ context_window?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8182
+ max_tokens?: number | null | undefined;
7365
8183
  reasoning_models?: string[] | undefined;
7366
8184
  icon_color?: string | undefined;
7367
8185
  }>;
@@ -7380,8 +8198,10 @@ export declare const ProviderProfileUpdateSchema: z.ZodObject<{
7380
8198
  api_key: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7381
8199
  apiKey: z.ZodOptional<z.ZodOptional<z.ZodString>>;
7382
8200
  models: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7383
- context_window: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>>;
7384
- contextWindow: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>>;
8201
+ context_window: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>>;
8202
+ contextWindow: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodLiteral<32768>, z.ZodLiteral<131072>, z.ZodLiteral<262144>, z.ZodLiteral<1000000>]>>>>;
8203
+ max_tokens: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
8204
+ maxTokens: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodNumber>>>;
7385
8205
  reasoning_models: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7386
8206
  reasoningModels: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
7387
8207
  icon: z.ZodOptional<z.ZodOptional<z.ZodString>>;
@@ -7395,14 +8215,16 @@ export declare const ProviderProfileUpdateSchema: z.ZodObject<{
7395
8215
  api?: "anthropic-messages" | "openai-completions" | "openai-responses" | "azure-openai-responses" | undefined;
7396
8216
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7397
8217
  models?: string[] | undefined;
7398
- contextWindow?: 262144 | 1000000 | null | undefined;
8218
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8219
+ maxTokens?: number | null | undefined;
7399
8220
  reasoningModels?: string[] | undefined;
7400
8221
  icon?: string | undefined;
7401
8222
  iconColor?: string | undefined;
7402
8223
  notes?: string | undefined;
7403
8224
  base_url?: string | undefined;
7404
8225
  api_key?: string | undefined;
7405
- context_window?: 262144 | 1000000 | null | undefined;
8226
+ context_window?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8227
+ max_tokens?: number | null | undefined;
7406
8228
  reasoning_models?: string[] | undefined;
7407
8229
  icon_color?: string | undefined;
7408
8230
  }, {
@@ -7412,14 +8234,16 @@ export declare const ProviderProfileUpdateSchema: z.ZodObject<{
7412
8234
  api?: "anthropic-messages" | "openai-completions" | "openai-responses" | "azure-openai-responses" | undefined;
7413
8235
  adapter?: "auto" | "openai" | "anthropic" | undefined;
7414
8236
  models?: string[] | undefined;
7415
- contextWindow?: 262144 | 1000000 | null | undefined;
8237
+ contextWindow?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8238
+ maxTokens?: number | null | undefined;
7416
8239
  reasoningModels?: string[] | undefined;
7417
8240
  icon?: string | undefined;
7418
8241
  iconColor?: string | undefined;
7419
8242
  notes?: string | undefined;
7420
8243
  base_url?: string | undefined;
7421
8244
  api_key?: string | undefined;
7422
- context_window?: 262144 | 1000000 | null | undefined;
8245
+ context_window?: 32768 | 131072 | 262144 | 1000000 | null | undefined;
8246
+ max_tokens?: number | null | undefined;
7423
8247
  reasoning_models?: string[] | undefined;
7424
8248
  icon_color?: string | undefined;
7425
8249
  }>;