@opencode-ai/schema 0.0.0-dev-18819 → 0.0.0-dev-18822

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/plugin.d.ts CHANGED
@@ -27,6 +27,7 @@ export declare const State: Schema.Union<readonly [Schema.Struct<{
27
27
  }>, Schema.Struct<{
28
28
  readonly status: Schema.Literal<"failed">;
29
29
  readonly error: Schema.String;
30
+ readonly ref: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
30
31
  }>]>;
31
32
  export type State = typeof State.Type;
32
33
  export interface Info extends Schema.Schema.Type<typeof Info> {
@@ -56,6 +57,7 @@ export declare const Info: Schema.Struct<{
56
57
  }>, Schema.Struct<{
57
58
  readonly status: Schema.Literal<"failed">;
58
59
  readonly error: Schema.String;
60
+ readonly ref: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
59
61
  }>]>;
60
62
  }>;
61
63
  export declare const Event: {
package/dist/plugin.js CHANGED
@@ -21,7 +21,7 @@ export const Features = Schema.Struct({
21
21
  }).annotate({ identifier: "Plugin.Features" });
22
22
  export const State = Schema.Union([
23
23
  Schema.Struct({ status: Schema.Literal("active") }),
24
- Schema.Struct({ status: Schema.Literal("failed"), error: Schema.String }),
24
+ Schema.Struct({ status: Schema.Literal("failed"), error: Schema.String, ref: Schema.String.pipe(optional) }),
25
25
  ]).annotate({ identifier: "Plugin.State" });
26
26
  export const Info = Schema.Struct({
27
27
  id: ID.pipe(optional),
@@ -11,3 +11,4 @@ export declare const Info: Schema.Struct<{
11
11
  readonly write: Schema.Finite;
12
12
  }>;
13
13
  }>;
14
+ export declare function total(tokens: Info): number;
@@ -9,3 +9,6 @@ export const Info = Schema.Struct({
9
9
  write: Schema.Finite,
10
10
  }),
11
11
  }).annotate({ identifier: "TokenUsage.Info" });
12
+ export function total(tokens) {
13
+ return tokens.input + tokens.output + tokens.reasoning + tokens.cache.read + tokens.cache.write;
14
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode-ai/schema",
4
- "version": "0.0.0-dev-18819",
4
+ "version": "0.0.0-dev-18822",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {