@opencode/schema 0.0.0-reserved → 2.0.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.
Files changed (204) hide show
  1. package/dist/agent.d.ts +164 -0
  2. package/dist/agent.js +46 -0
  3. package/dist/catalog.d.ts +69 -0
  4. package/dist/catalog.js +4 -0
  5. package/dist/command.d.ts +76 -0
  6. package/dist/command.js +13 -0
  7. package/dist/config/agent.d.ts +42 -0
  8. package/dist/config/agent.js +20 -0
  9. package/dist/config/command.d.ts +28 -0
  10. package/dist/config/command.js +13 -0
  11. package/dist/config/compaction.d.ts +14 -0
  12. package/dist/config/compaction.js +13 -0
  13. package/dist/config/experimental.d.ts +17 -0
  14. package/dist/config/experimental.js +16 -0
  15. package/dist/config/formatter.d.ts +11 -0
  16. package/dist/config/formatter.js +11 -0
  17. package/dist/config/lsp.d.ts +20 -0
  18. package/dist/config/lsp.js +16 -0
  19. package/dist/config/mcp.d.ts +18 -0
  20. package/dist/config/mcp.js +14 -0
  21. package/dist/config/media.d.ts +15 -0
  22. package/dist/config/media.js +14 -0
  23. package/dist/config/model.d.ts +18 -0
  24. package/dist/config/model.js +28 -0
  25. package/dist/config/plugin.d.ts +11 -0
  26. package/dist/config/plugin.js +10 -0
  27. package/dist/config/policy.d.ts +10 -0
  28. package/dist/config/policy.js +8 -0
  29. package/dist/config/provider.d.ts +173 -0
  30. package/dist/config/provider.js +72 -0
  31. package/dist/config/reference.d.ts +21 -0
  32. package/dist/config/reference.js +18 -0
  33. package/dist/config/tool-output.d.ts +8 -0
  34. package/dist/config/tool-output.js +8 -0
  35. package/dist/config/warming.d.ts +10 -0
  36. package/dist/config/warming.js +16 -0
  37. package/dist/config/watcher.d.ts +7 -0
  38. package/dist/config/watcher.js +7 -0
  39. package/dist/config/websearch.d.ts +9 -0
  40. package/dist/config/websearch.js +13 -0
  41. package/dist/config/worktree.d.ts +7 -0
  42. package/dist/config/worktree.js +7 -0
  43. package/dist/config.d.ts +180 -0
  44. package/dist/config.js +138 -0
  45. package/dist/connection.d.ts +28 -0
  46. package/dist/connection.js +15 -0
  47. package/dist/credential.d.ts +191 -0
  48. package/dist/credential.js +39 -0
  49. package/dist/durable-event-manifest.d.ts +3 -0
  50. package/dist/durable-event-manifest.js +5 -0
  51. package/dist/event-log.d.ts +14 -0
  52. package/dist/event-log.js +17 -0
  53. package/dist/event-manifest.d.ts +12758 -0
  54. package/dist/event-manifest.js +47 -0
  55. package/dist/event.d.ts +142 -0
  56. package/dist/event.js +110 -0
  57. package/dist/file-diff.d.ts +21 -0
  58. package/dist/file-diff.js +18 -0
  59. package/dist/filesystem-v1.d.ts +1 -0
  60. package/dist/filesystem-v1.js +1 -0
  61. package/dist/filesystem.d.ts +118 -0
  62. package/dist/filesystem.js +35 -0
  63. package/dist/form.d.ts +1259 -0
  64. package/dist/form.js +120 -0
  65. package/dist/ide-event.d.ts +76 -0
  66. package/dist/ide-event.js +10 -0
  67. package/dist/identifier.d.ts +3 -0
  68. package/dist/identifier.js +24 -0
  69. package/dist/index.d.ts +41 -0
  70. package/dist/index.js +41 -0
  71. package/dist/installation-event.d.ts +149 -0
  72. package/dist/installation-event.js +16 -0
  73. package/dist/instruction-entry.d.ts +29 -0
  74. package/dist/instruction-entry.js +26 -0
  75. package/dist/instruction.d.ts +13 -0
  76. package/dist/instruction.js +8 -0
  77. package/dist/integration-id.d.ts +5 -0
  78. package/dist/integration-id.js +3 -0
  79. package/dist/integration.d.ts +1604 -0
  80. package/dist/integration.js +85 -0
  81. package/dist/legacy-event.d.ts +1 -0
  82. package/dist/legacy-event.js +1 -0
  83. package/dist/llm.d.ts +4 -0
  84. package/dist/llm.js +3 -0
  85. package/dist/location.d.ts +37 -0
  86. package/dist/location.js +22 -0
  87. package/dist/lsp-event.d.ts +67 -0
  88. package/dist/lsp-event.js +4 -0
  89. package/dist/mcp-event.d.ts +222 -0
  90. package/dist/mcp-event.js +24 -0
  91. package/dist/mcp.d.ts +138 -0
  92. package/dist/mcp.js +111 -0
  93. package/dist/model.d.ts +247 -0
  94. package/dist/model.js +116 -0
  95. package/dist/models-dev.d.ts +69 -0
  96. package/dist/models-dev.js +7 -0
  97. package/dist/money.d.ts +10 -0
  98. package/dist/money.js +5 -0
  99. package/dist/permission-saved.d.ts +18 -0
  100. package/dist/permission-saved.js +12 -0
  101. package/dist/permission-v1.d.ts +1 -0
  102. package/dist/permission-v1.js +1 -0
  103. package/dist/permission.d.ts +311 -0
  104. package/dist/permission.js +46 -0
  105. package/dist/persistent-pty.d.ts +559 -0
  106. package/dist/persistent-pty.js +55 -0
  107. package/dist/plugin.d.ts +132 -0
  108. package/dist/plugin.js +37 -0
  109. package/dist/project-id.d.ts +5 -0
  110. package/dist/project-id.js +3 -0
  111. package/dist/project.d.ts +264 -0
  112. package/dist/project.js +46 -0
  113. package/dist/prompt-input.d.ts +143 -0
  114. package/dist/prompt-input.js +25 -0
  115. package/dist/prompt.d.ts +297 -0
  116. package/dist/prompt.js +61 -0
  117. package/dist/provider.d.ts +105 -0
  118. package/dist/provider.js +50 -0
  119. package/dist/pty-ticket.d.ts +8 -0
  120. package/dist/pty-ticket.js +7 -0
  121. package/dist/pty.d.ts +462 -0
  122. package/dist/pty.js +43 -0
  123. package/dist/question-v1.d.ts +1 -0
  124. package/dist/question-v1.js +1 -0
  125. package/dist/question.d.ts +15 -0
  126. package/dist/question.js +15 -0
  127. package/dist/reference.d.ts +120 -0
  128. package/dist/reference.js +30 -0
  129. package/dist/rpc.d.ts +111 -0
  130. package/dist/rpc.js +9 -0
  131. package/dist/schema.d.ts +10 -0
  132. package/dist/schema.js +14 -0
  133. package/dist/server-event.d.ts +132 -0
  134. package/dist/server-event.js +5 -0
  135. package/dist/session-compaction-event.d.ts +87 -0
  136. package/dist/session-compaction-event.js +10 -0
  137. package/dist/session-error.d.ts +9 -0
  138. package/dist/session-error.js +8 -0
  139. package/dist/session-event.d.ts +21315 -0
  140. package/dist/session-event.js +557 -0
  141. package/dist/session-fork.d.ts +26 -0
  142. package/dist/session-fork.js +11 -0
  143. package/dist/session-id.d.ts +6 -0
  144. package/dist/session-id.js +10 -0
  145. package/dist/session-inbox.d.ts +748 -0
  146. package/dist/session-inbox.js +47 -0
  147. package/dist/session-message.d.ts +2007 -0
  148. package/dist/session-message.js +227 -0
  149. package/dist/session-metadata.d.ts +8 -0
  150. package/dist/session-metadata.js +9 -0
  151. package/dist/session-provider-context.d.ts +54 -0
  152. package/dist/session-provider-context.js +17 -0
  153. package/dist/session-revert.d.ts +672 -0
  154. package/dist/session-revert.js +63 -0
  155. package/dist/session-stats.d.ts +186 -0
  156. package/dist/session-stats.js +53 -0
  157. package/dist/session-status-event.d.ts +299 -0
  158. package/dist/session-status-event.js +45 -0
  159. package/dist/session-transfer.d.ts +897 -0
  160. package/dist/session-transfer.js +8 -0
  161. package/dist/session-v1.d.ts +1 -0
  162. package/dist/session-v1.js +1 -0
  163. package/dist/session.d.ts +236 -0
  164. package/dist/session.js +55 -0
  165. package/dist/shell.d.ts +381 -0
  166. package/dist/shell.js +58 -0
  167. package/dist/skill.d.ts +133 -0
  168. package/dist/skill.js +48 -0
  169. package/dist/snapshot.d.ts +4 -0
  170. package/dist/snapshot.js +3 -0
  171. package/dist/token-usage.d.ts +14 -0
  172. package/dist/token-usage.js +14 -0
  173. package/dist/tool.d.ts +78 -0
  174. package/dist/tool.js +22 -0
  175. package/dist/tui-event.d.ts +307 -0
  176. package/dist/tui-event.js +53 -0
  177. package/dist/v1/filesystem.d.ts +78 -0
  178. package/dist/v1/filesystem.js +8 -0
  179. package/dist/v1/legacy-event.d.ts +108 -0
  180. package/dist/v1/legacy-event.js +15 -0
  181. package/dist/v1/permission.d.ts +316 -0
  182. package/dist/v1/permission.js +41 -0
  183. package/dist/v1/question.d.ts +444 -0
  184. package/dist/v1/question.js +57 -0
  185. package/dist/v1/session.d.ts +7657 -0
  186. package/dist/v1/session.js +535 -0
  187. package/dist/vcs-event.d.ts +76 -0
  188. package/dist/vcs-event.js +11 -0
  189. package/dist/vcs.d.ts +35 -0
  190. package/dist/vcs.js +23 -0
  191. package/dist/websearch.d.ts +108 -0
  192. package/dist/websearch.js +31 -0
  193. package/dist/workspace-event.d.ts +247 -0
  194. package/dist/workspace-event.js +25 -0
  195. package/dist/workspace-id.d.ts +6 -0
  196. package/dist/workspace-id.js +16 -0
  197. package/dist/workspace.d.ts +15 -0
  198. package/dist/workspace.js +14 -0
  199. package/dist/worktree-event.d.ts +153 -0
  200. package/dist/worktree-event.js +18 -0
  201. package/dist/worktree.d.ts +277 -0
  202. package/dist/worktree.js +82 -0
  203. package/package.json +33 -6
  204. package/README.md +0 -5
@@ -0,0 +1,227 @@
1
+ export * as SessionMessage from "./session-message.js";
2
+ import { Schema } from "effect";
3
+ import { SessionProviderContext } from "./session-provider-context.js";
4
+ import { optional } from "./schema.js";
5
+ import { Content } from "./tool.js";
6
+ import { Location } from "./location.js";
7
+ import { Model } from "./model.js";
8
+ import { Project } from "./project.js";
9
+ import { Prompt } from "./prompt.js";
10
+ import { DateTimeUtcFromMillis, PositiveInt, RelativePath, statics } from "./schema.js";
11
+ import { ascending } from "./identifier.js";
12
+ import { Event } from "./event.js";
13
+ import { Shell as ShellSchema } from "./shell.js";
14
+ import { FinishReason } from "./llm.js";
15
+ import { SessionError } from "./session-error.js";
16
+ import { Agent } from "./agent.js";
17
+ import { Skill as SkillSchema } from "./skill.js";
18
+ import { Money } from "./money.js";
19
+ import { Snapshot } from "./snapshot.js";
20
+ import { TokenUsage } from "./token-usage.js";
21
+ export const ID = Schema.String.check(Schema.isStartsWith("msg_")).pipe(Schema.brand("Session.Message.ID"), statics((schema) => ({
22
+ create: () => schema.make("msg_" + ascending()),
23
+ fromEvent: (eventID) => schema.make(eventID.replace(/^evt_/, "msg_")),
24
+ })));
25
+ const Base = {
26
+ id: ID,
27
+ metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
28
+ time: Schema.Struct({ created: DateTimeUtcFromMillis }),
29
+ };
30
+ export const ProviderState = Schema.Record(Schema.String, Schema.Unknown).annotate({
31
+ identifier: "Session.Message.ProviderState",
32
+ });
33
+ export const AgentSelected = Schema.Struct({
34
+ ...Base,
35
+ type: Schema.tag("agent-switched"),
36
+ agent: Agent.ID,
37
+ previous: Agent.ID.pipe(optional),
38
+ }).annotate({ identifier: "Session.Message.AgentSelected" });
39
+ export const ModelSelected = Schema.Struct({
40
+ ...Base,
41
+ type: Schema.tag("model-switched"),
42
+ model: Model.Ref,
43
+ previous: Model.Ref.pipe(optional),
44
+ }).annotate({ identifier: "Session.Message.ModelSelected" });
45
+ export const LocationSwitched = Schema.Struct({
46
+ ...Base,
47
+ type: Schema.tag("location-switched"),
48
+ location: Location.Ref,
49
+ projectID: Project.ID.pipe(optional),
50
+ subpath: RelativePath.pipe(optional),
51
+ previous: Schema.Struct({
52
+ location: Location.Ref,
53
+ projectID: Project.ID.pipe(optional),
54
+ subpath: RelativePath.pipe(optional),
55
+ }).pipe(optional),
56
+ }).annotate({ identifier: "Session.Message.LocationSwitched" });
57
+ export const User = Schema.Struct({
58
+ ...Base,
59
+ text: Prompt.fields.text,
60
+ files: Prompt.fields.files,
61
+ agents: Prompt.fields.agents,
62
+ skills: Prompt.fields.skills,
63
+ type: Schema.tag("user"),
64
+ }).annotate({ identifier: "Session.Message.User" });
65
+ export const Synthetic = Schema.Struct({
66
+ ...Base,
67
+ text: Schema.String,
68
+ description: Schema.String.pipe(optional),
69
+ type: Schema.tag("synthetic"),
70
+ }).annotate({ identifier: "Session.Message.Synthetic" });
71
+ export const System = Schema.Struct({
72
+ ...Base,
73
+ type: Schema.tag("system"),
74
+ /** The model-facing update text, frozen at emit time. */
75
+ text: Schema.String,
76
+ /** A short human-readable summary for transcript display. */
77
+ description: Schema.String.pipe(optional),
78
+ }).annotate({ identifier: "Session.Message.System" });
79
+ export const Skill = Schema.Struct({
80
+ ...Base,
81
+ type: Schema.tag("skill"),
82
+ skill: SkillSchema.ID,
83
+ name: SkillSchema.Name,
84
+ text: Schema.String,
85
+ }).annotate({ identifier: "Session.Message.Skill" });
86
+ export const Shell = Schema.Struct({
87
+ ...Base,
88
+ type: Schema.tag("shell"),
89
+ shellID: ShellSchema.ID,
90
+ command: Schema.String,
91
+ status: ShellSchema.Status,
92
+ exit: Schema.Number.pipe(optional),
93
+ output: ShellSchema.Output.pipe(optional),
94
+ time: Schema.Struct({
95
+ created: DateTimeUtcFromMillis,
96
+ completed: DateTimeUtcFromMillis.pipe(optional),
97
+ }),
98
+ }).annotate({ identifier: "Session.Message.Shell" });
99
+ export const ToolStateStreaming = Schema.Struct({
100
+ status: Schema.tag("streaming"),
101
+ input: Schema.String,
102
+ }).annotate({ identifier: "Session.Message.ToolState.Streaming" });
103
+ export const ToolStateRunning = Schema.Struct({
104
+ status: Schema.tag("running"),
105
+ input: Schema.Record(Schema.String, Schema.Unknown),
106
+ metadata: Schema.Record(Schema.String, Schema.Json),
107
+ }).annotate({ identifier: "Session.Message.ToolState.Running" });
108
+ export const ToolStateCompleted = Schema.Struct({
109
+ status: Schema.tag("completed"),
110
+ input: Schema.Record(Schema.String, Schema.Unknown),
111
+ content: Schema.NonEmptyArray(Content),
112
+ metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional),
113
+ }).annotate({ identifier: "Session.Message.ToolState.Completed" });
114
+ export const ToolStateError = Schema.Struct({
115
+ status: Schema.tag("error"),
116
+ input: Schema.Record(Schema.String, Schema.Unknown),
117
+ error: SessionError.Error,
118
+ content: Schema.NonEmptyArray(Content).pipe(optional),
119
+ metadata: Schema.Record(Schema.String, Schema.Json).pipe(optional),
120
+ }).annotate({ identifier: "Session.Message.ToolState.Error" });
121
+ export const ToolState = Schema.Union([ToolStateStreaming, ToolStateRunning, ToolStateCompleted, ToolStateError]).pipe(Schema.toTaggedUnion("status"));
122
+ export const AssistantTool = Schema.Struct({
123
+ type: Schema.tag("tool"),
124
+ id: Schema.String,
125
+ name: Schema.String,
126
+ executed: Schema.Boolean.pipe(optional),
127
+ providerState: ProviderState.pipe(optional),
128
+ providerResultState: ProviderState.pipe(optional),
129
+ state: ToolState,
130
+ time: Schema.Struct({
131
+ created: DateTimeUtcFromMillis,
132
+ ran: DateTimeUtcFromMillis.pipe(optional),
133
+ completed: DateTimeUtcFromMillis.pipe(optional),
134
+ }),
135
+ }).annotate({ identifier: "Session.Message.Assistant.Tool" });
136
+ export const AssistantText = Schema.Struct({
137
+ type: Schema.tag("text"),
138
+ text: Schema.String,
139
+ state: ProviderState.pipe(optional),
140
+ }).annotate({ identifier: "Session.Message.Assistant.Text" });
141
+ export const AssistantReasoning = Schema.Struct({
142
+ type: Schema.tag("reasoning"),
143
+ text: Schema.String,
144
+ state: ProviderState.pipe(optional),
145
+ time: Schema.Struct({
146
+ created: DateTimeUtcFromMillis,
147
+ completed: DateTimeUtcFromMillis.pipe(optional),
148
+ }).pipe(optional),
149
+ }).annotate({ identifier: "Session.Message.Assistant.Reasoning" });
150
+ export const AssistantContent = Schema.Union([AssistantText, AssistantReasoning, AssistantTool]).pipe(Schema.toTaggedUnion("type"));
151
+ export const AssistantContentEncoded = Schema.toEncoded(AssistantContent).annotate({
152
+ identifier: "Session.Message.AssistantContent.Encoded",
153
+ });
154
+ export const AssistantRetry = Schema.Struct({
155
+ attempt: PositiveInt,
156
+ at: DateTimeUtcFromMillis,
157
+ error: SessionError.Error,
158
+ }).annotate({ identifier: "Session.Message.Assistant.Retry" });
159
+ export const Assistant = Schema.Struct({
160
+ ...Base,
161
+ type: Schema.tag("assistant"),
162
+ agent: Agent.ID,
163
+ model: Model.Ref,
164
+ content: AssistantContent.pipe(Schema.Array),
165
+ snapshot: Schema.Struct({
166
+ start: Snapshot.ID.pipe(optional),
167
+ end: Snapshot.ID.pipe(optional),
168
+ files: Schema.Array(RelativePath).pipe(optional),
169
+ }).pipe(optional),
170
+ finish: FinishReason.pipe(optional),
171
+ rawFinish: Schema.String.pipe(optional),
172
+ providerState: ProviderState.pipe(optional),
173
+ cost: Money.USD.pipe(optional),
174
+ tokens: TokenUsage.Info.pipe(optional),
175
+ error: SessionError.Error.pipe(optional),
176
+ retry: AssistantRetry.pipe(optional),
177
+ time: Schema.Struct({
178
+ created: DateTimeUtcFromMillis,
179
+ /** When the provider response body ended, before tool settlement. */
180
+ streamed: DateTimeUtcFromMillis.pipe(optional),
181
+ completed: DateTimeUtcFromMillis.pipe(optional),
182
+ }),
183
+ }).annotate({ identifier: "Session.Message.Assistant" });
184
+ const CompactionBase = { type: Schema.tag("compaction"), ...Base };
185
+ /** Usage of the compaction request itself, not the size of the resulting context. */
186
+ const CompactionUsage = {
187
+ cost: Money.USD.pipe(optional),
188
+ tokens: TokenUsage.Info.pipe(optional),
189
+ };
190
+ export const CompactionRunning = Schema.Struct({
191
+ ...CompactionBase,
192
+ status: Schema.tag("running"),
193
+ reason: Schema.Literals(["auto", "manual"]),
194
+ summary: Schema.String,
195
+ recent: Schema.String,
196
+ }).annotate({ identifier: "Session.Message.Compaction.Running" });
197
+ export const CompactionCompleted = Schema.Struct({
198
+ ...CompactionBase,
199
+ status: Schema.tag("completed"),
200
+ reason: Schema.Literals(["auto", "manual"]),
201
+ model: Model.Ref.pipe(optional),
202
+ providerState: ProviderState.pipe(optional),
203
+ summary: Schema.String,
204
+ recent: Schema.String,
205
+ providerContext: SessionProviderContext.Info.pipe(optional),
206
+ ...CompactionUsage,
207
+ }).annotate({ identifier: "Session.Message.Compaction.Completed" });
208
+ export const CompactionFailed = Schema.Struct({
209
+ ...CompactionBase,
210
+ status: Schema.tag("failed"),
211
+ reason: Schema.Literals(["auto", "manual"]),
212
+ error: SessionError.Error,
213
+ ...CompactionUsage,
214
+ }).annotate({ identifier: "Session.Message.Compaction.Failed" });
215
+ export const Compaction = Schema.Union([CompactionRunning, CompactionCompleted, CompactionFailed]).pipe(Schema.toTaggedUnion("status"), Schema.annotate({ identifier: "Session.Message.Compaction" }));
216
+ export const Info = Schema.Union([
217
+ AgentSelected,
218
+ ModelSelected,
219
+ LocationSwitched,
220
+ User,
221
+ Synthetic,
222
+ System,
223
+ Skill,
224
+ Shell,
225
+ Assistant,
226
+ Compaction,
227
+ ]).annotate({ identifier: "Session.Message.Info" });
@@ -0,0 +1,8 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Host-supplied session annotations, durable from creation and opaque to
4
+ * core. Keys are arbitrary; values must be JSON-serializable. Children and
5
+ * forks inherit the parent's metadata unless the creator supplies its own.
6
+ */
7
+ export declare const SessionMetadata: Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>;
8
+ export type SessionMetadata = typeof SessionMetadata.Type;
@@ -0,0 +1,9 @@
1
+ import { Schema } from "effect";
2
+ /**
3
+ * Host-supplied session annotations, durable from creation and opaque to
4
+ * core. Keys are arbitrary; values must be JSON-serializable. Children and
5
+ * forks inherit the parent's metadata unless the creator supplies its own.
6
+ */
7
+ export const SessionMetadata = Schema.Record(Schema.String, Schema.Json).annotate({
8
+ identifier: "Session.Metadata",
9
+ });
@@ -0,0 +1,54 @@
1
+ export * as SessionProviderContext from "./session-provider-context.js";
2
+ import { Schema } from "effect";
3
+ /** Exact producing model/deployment and route identity, never credentials or a connection ID. */
4
+ export interface Provenance extends Schema.Schema.Type<typeof Provenance> {
5
+ }
6
+ export declare const Provenance: Schema.Struct<{
7
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
8
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
9
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
10
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
11
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
12
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
13
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
14
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
15
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
16
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
17
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
18
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
19
+ };
20
+ readonly provider: Schema.String;
21
+ readonly modelID: Schema.String;
22
+ readonly route: Schema.String;
23
+ readonly protocol: Schema.String;
24
+ /** Digest of the configured endpoint; raw URLs and query values are not persisted. */
25
+ readonly endpoint: Schema.String;
26
+ }>;
27
+ /** Core validates the versioned canonical AI Message[] payload on installation and replay. */
28
+ export interface Info extends Schema.Schema.Type<typeof Info> {
29
+ }
30
+ export declare const Info: Schema.Struct<{
31
+ readonly version: Schema.Literal<1>;
32
+ readonly provenance: Schema.Struct<{
33
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID"> & {
34
+ opencode: string & import("effect/Brand").Brand<"Provider.ID">;
35
+ anthropic: string & import("effect/Brand").Brand<"Provider.ID">;
36
+ openai: string & import("effect/Brand").Brand<"Provider.ID">;
37
+ google: string & import("effect/Brand").Brand<"Provider.ID">;
38
+ googleVertex: string & import("effect/Brand").Brand<"Provider.ID">;
39
+ githubCopilot: string & import("effect/Brand").Brand<"Provider.ID">;
40
+ amazonBedrock: string & import("effect/Brand").Brand<"Provider.ID">;
41
+ azure: string & import("effect/Brand").Brand<"Provider.ID">;
42
+ openrouter: string & import("effect/Brand").Brand<"Provider.ID">;
43
+ mistral: string & import("effect/Brand").Brand<"Provider.ID">;
44
+ gitlab: string & import("effect/Brand").Brand<"Provider.ID">;
45
+ };
46
+ readonly provider: Schema.String;
47
+ readonly modelID: Schema.String;
48
+ readonly route: Schema.String;
49
+ readonly protocol: Schema.String;
50
+ /** Digest of the configured endpoint; raw URLs and query values are not persisted. */
51
+ readonly endpoint: Schema.String;
52
+ }>;
53
+ readonly messages: Schema.Codec<Schema.Json, Schema.Json, never, never>;
54
+ }>;
@@ -0,0 +1,17 @@
1
+ export * as SessionProviderContext from "./session-provider-context.js";
2
+ import { Schema } from "effect";
3
+ import { Provider } from "./provider.js";
4
+ export const Provenance = Schema.Struct({
5
+ providerID: Provider.ID,
6
+ provider: Schema.String,
7
+ modelID: Schema.String,
8
+ route: Schema.String,
9
+ protocol: Schema.String,
10
+ /** Digest of the configured endpoint; raw URLs and query values are not persisted. */
11
+ endpoint: Schema.String,
12
+ }).annotate({ identifier: "Session.ProviderContext.Provenance" });
13
+ export const Info = Schema.Struct({
14
+ version: Schema.Literal(1),
15
+ provenance: Provenance,
16
+ messages: Schema.Json,
17
+ }).annotate({ identifier: "Session.ProviderContext" });