@opencode/schema 2.0.32 → 2.1.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 (37) hide show
  1. package/dist/config/experimental.d.ts +1 -0
  2. package/dist/config/experimental.js +3 -0
  3. package/dist/config/provider.d.ts +56 -52
  4. package/dist/credential-legacy.d.ts +54 -0
  5. package/dist/credential-legacy.js +19 -0
  6. package/dist/credential.d.ts +0 -4
  7. package/dist/credential.js +0 -2
  8. package/dist/event-manifest.d.ts +1111 -1149
  9. package/dist/event-manifest.js +1 -2
  10. package/dist/form.d.ts +213 -213
  11. package/dist/instruction-entry.d.ts +1 -1
  12. package/dist/integration.d.ts +257 -257
  13. package/dist/model-compatibility.d.ts +3 -0
  14. package/dist/model-compatibility.js +2 -0
  15. package/dist/model.d.ts +76 -74
  16. package/dist/persistent-pty.d.ts +88 -88
  17. package/dist/prompt-input.d.ts +3 -3
  18. package/dist/prompt.d.ts +28 -28
  19. package/dist/provider.d.ts +2 -0
  20. package/dist/session-event.d.ts +5729 -5723
  21. package/dist/session-event.js +20 -13
  22. package/dist/session-inbox.d.ts +20 -20
  23. package/dist/session-legacy.d.ts +7 -0
  24. package/dist/session-legacy.js +118 -0
  25. package/dist/session-message.d.ts +125 -268
  26. package/dist/session-message.js +13 -12
  27. package/dist/session-revert.d.ts +407 -183
  28. package/dist/session-transfer.d.ts +33 -83
  29. package/dist/session.d.ts +109 -1
  30. package/dist/session.js +64 -2
  31. package/dist/v1/permission.d.ts +8 -8
  32. package/dist/v1/session.d.ts +696 -696
  33. package/package.json +4 -4
  34. package/dist/session-compaction-event.d.ts +0 -87
  35. package/dist/session-compaction-event.js +0 -10
  36. package/dist/session-provider-context.d.ts +0 -54
  37. package/dist/session-provider-context.js +0 -17
@@ -1,6 +1,5 @@
1
1
  export * as SessionMessage from "./session-message.js";
2
2
  import { Schema } from "effect";
3
- import { SessionProviderContext } from "./session-provider-context.js";
4
3
  import { optional } from "./schema.js";
5
4
  import { Content } from "./tool.js";
6
5
  import { Location } from "./location.js";
@@ -27,8 +26,12 @@ const Base = {
27
26
  metadata: Schema.Record(Schema.String, Schema.Unknown).pipe(optional),
28
27
  time: Schema.Struct({ created: DateTimeUtcFromMillis }),
29
28
  };
30
- export const ProviderState = Schema.Record(Schema.String, Schema.Unknown).annotate({
31
- identifier: "Session.Message.ProviderState",
29
+ /**
30
+ * Provider-owned replay data, keyed by the producing provider's metadata fields and echoed back verbatim. A tool's
31
+ * result data is merged into its call data, so adapters must not reuse a key with a different value across the two.
32
+ */
33
+ export const Native = Schema.Record(Schema.String, Schema.Unknown).annotate({
34
+ identifier: "Session.Message.Native",
32
35
  });
33
36
  export const AgentSelected = Schema.Struct({
34
37
  ...Base,
@@ -124,8 +127,7 @@ export const AssistantTool = Schema.Struct({
124
127
  id: Schema.String,
125
128
  name: Schema.String,
126
129
  executed: Schema.Boolean.pipe(optional),
127
- providerState: ProviderState.pipe(optional),
128
- providerResultState: ProviderState.pipe(optional),
130
+ native: Native.pipe(optional),
129
131
  state: ToolState,
130
132
  time: Schema.Struct({
131
133
  created: DateTimeUtcFromMillis,
@@ -136,12 +138,12 @@ export const AssistantTool = Schema.Struct({
136
138
  export const AssistantText = Schema.Struct({
137
139
  type: Schema.tag("text"),
138
140
  text: Schema.String,
139
- state: ProviderState.pipe(optional),
141
+ native: Native.pipe(optional),
140
142
  }).annotate({ identifier: "Session.Message.Assistant.Text" });
141
143
  export const AssistantReasoning = Schema.Struct({
142
144
  type: Schema.tag("reasoning"),
143
145
  text: Schema.String,
144
- state: ProviderState.pipe(optional),
146
+ native: Native.pipe(optional),
145
147
  time: Schema.Struct({
146
148
  created: DateTimeUtcFromMillis,
147
149
  completed: DateTimeUtcFromMillis.pipe(optional),
@@ -169,7 +171,8 @@ export const Assistant = Schema.Struct({
169
171
  }).pipe(optional),
170
172
  finish: FinishReason.pipe(optional),
171
173
  rawFinish: Schema.String.pipe(optional),
172
- providerState: ProviderState.pipe(optional),
174
+ /** Step-level native data, such as a provider's reason for blocking a response. */
175
+ native: Native.pipe(optional),
173
176
  cost: Money.USD.pipe(optional),
174
177
  tokens: TokenUsage.Info.pipe(optional),
175
178
  error: SessionError.Error.pipe(optional),
@@ -192,17 +195,15 @@ export const CompactionRunning = Schema.Struct({
192
195
  status: Schema.tag("running"),
193
196
  reason: Schema.Literals(["auto", "manual"]),
194
197
  summary: Schema.String,
195
- recent: Schema.String,
196
198
  }).annotate({ identifier: "Session.Message.Compaction.Running" });
197
199
  export const CompactionCompleted = Schema.Struct({
198
200
  ...CompactionBase,
199
201
  status: Schema.tag("completed"),
200
202
  reason: Schema.Literals(["auto", "manual"]),
201
203
  model: Model.Ref.pipe(optional),
202
- providerState: ProviderState.pipe(optional),
204
+ /** A provider compaction stores its replacement window in `native.messages`, replayed instead of `summary`. */
205
+ native: Native.pipe(optional),
203
206
  summary: Schema.String,
204
- recent: Schema.String,
205
- providerContext: SessionProviderContext.Info.pipe(optional),
206
207
  ...CompactionUsage,
207
208
  }).annotate({ identifier: "Session.Message.Compaction.Completed" });
208
209
  export const CompactionFailed = Schema.Struct({