@opencode/protocol 0.0.0-dev-1039 → 0.0.0-dev-1063

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.
@@ -3126,6 +3126,18 @@ export declare const makeSessionGroup: <I extends HttpApiMiddleware.AnyId, S, Fo
3126
3126
  }>>, never, Schema.toCodecJson<Schema.Struct<{
3127
3127
  readonly data: Schema.Struct<{
3128
3128
  readonly text: Schema.String;
3129
+ readonly tokens: Schema.Struct<{
3130
+ readonly input: Schema.Finite;
3131
+ readonly output: Schema.Finite;
3132
+ readonly reasoning: Schema.Finite;
3133
+ readonly cache: Schema.Struct<{
3134
+ readonly read: Schema.Finite;
3135
+ readonly write: Schema.Finite;
3136
+ }>;
3137
+ }>;
3138
+ readonly cost: Schema.brand<Schema.Finite, "Money.USD"> & {
3139
+ zero: number & import("effect/Brand").Brand<"Money.USD">;
3140
+ };
3129
3141
  }>;
3130
3142
  }>>, Schema.toCodecJson<typeof ServiceUnavailableError | typeof SessionNotFoundError>, I, HttpApiMiddleware.Requires<I>> | HttpApiEndpoint.HttpApiEndpoint<"session.get", "GET", "/api/session/:sessionID", Schema.toCodecStringTree<Schema.Struct<{
3131
3143
  sessionID: Schema.brand<Schema.String, "SessionID"> & {
@@ -3,6 +3,8 @@ import { SessionInbox } from "@opencode/schema/session-inbox";
3
3
  import { PromptInput } from "@opencode/schema/prompt-input";
4
4
  import { Session } from "@opencode/schema/session";
5
5
  import { SessionStats } from "@opencode/schema/session-stats";
6
+ import { TokenUsage } from "@opencode/schema/token-usage";
7
+ import { Money } from "@opencode/schema/money";
6
8
  import { InstructionEntry } from "@opencode/schema/instruction-entry";
7
9
  import { Project } from "@opencode/schema/project";
8
10
  import { DateTimeUtcFromMillis, NonNegativeInt, PositiveInt } from "@opencode/schema/schema";
@@ -450,7 +452,8 @@ export const makeSessionGroup = (sessionLocationMiddleware, formLocationMiddlewa
450
452
  params: { sessionID: Session.ID },
451
453
  payload: Schema.Struct({ prompt: Schema.String }),
452
454
  success: Schema.Struct({
453
- data: Schema.Struct({ text: Schema.String }),
455
+ // Same `tokens` and `cost` an assistant message reports for a step.
456
+ data: Schema.Struct({ text: Schema.String, tokens: TokenUsage.Info, cost: Money.USD }),
454
457
  }).annotate({ identifier: "SessionGenerateResponse" }),
455
458
  error: [SessionNotFoundError, ServiceUnavailableError],
456
459
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/protocol",
4
- "version": "0.0.0-dev-1039",
4
+ "version": "0.0.0-dev-1063",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -17,12 +17,12 @@
17
17
  ],
18
18
  "exports": {
19
19
  "./simulation": {
20
- "import": "./dist/simulation.js",
21
- "types": "./dist/simulation.d.ts"
20
+ "types": "./dist/simulation.d.ts",
21
+ "import": "./dist/simulation.js"
22
22
  },
23
23
  "./*": {
24
- "import": "./dist/*.js",
25
- "types": "./dist/*.d.ts"
24
+ "types": "./dist/*.d.ts",
25
+ "import": "./dist/*.js"
26
26
  }
27
27
  },
28
28
  "scripts": {
@@ -35,7 +35,7 @@
35
35
  "typecheck:tsc": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@opencode/schema": "0.0.0-dev-1039",
38
+ "@opencode/schema": "0.0.0-dev-1063",
39
39
  "effect": "4.1.0"
40
40
  },
41
41
  "devDependencies": {