@opencode/schema 0.0.0-dev-197 → 0.0.0-dev-210

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.
@@ -5,6 +5,23 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
5
5
  readonly todo: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
6
6
  readonly background_compaction: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
7
7
  readonly media_blob: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
8
+ readonly image_model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.Struct<{
9
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID">;
10
+ readonly model: Schema.brand<Schema.String, "Model.ID">;
11
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
12
+ }>, Schema.Union<readonly [Schema.String, Schema.Struct<{
13
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID">;
14
+ readonly model: Schema.brand<Schema.String, "Model.ID">;
15
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
16
+ }>]>, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.Struct<{
17
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID">;
18
+ readonly model: Schema.brand<Schema.String, "Model.ID">;
19
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
20
+ }>, Schema.Union<readonly [Schema.String, Schema.Struct<{
21
+ readonly providerID: Schema.brand<Schema.String, "Provider.ID">;
22
+ readonly model: Schema.brand<Schema.String, "Model.ID">;
23
+ readonly variant: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "Model.VariantID">>>, Schema.optionalKey<Schema.brand<Schema.String, "Model.VariantID">>, never, never>;
24
+ }>]>, never, never>>, never, never>;
8
25
  readonly schedules: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
9
26
  readonly subagent_depth: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Int>>, Schema.optionalKey<Schema.Int>, never, never>;
10
27
  readonly location_idle_timeout: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.DurationFromString, Schema.Literal<false>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.DurationFromString, Schema.Literal<false>]>>, never, never>;
@@ -1,6 +1,7 @@
1
1
  export * as ConfigExperimental from "./experimental.js";
2
2
  import { Schema } from "effect";
3
3
  import { NonNegativeInt, optional } from "../schema.js";
4
+ import { ConfigModel } from "./model.js";
4
5
  import { ConfigPolicy } from "./policy.js";
5
6
  export class Info extends Schema.Class("ConfigExperimental.Info")({
6
7
  portable_shell_scanner: Schema.Boolean.pipe(optional).annotate({
@@ -15,6 +16,9 @@ export class Info extends Schema.Class("ConfigExperimental.Info")({
15
16
  media_blob: Schema.Boolean.pipe(optional).annotate({
16
17
  description: "Store new session media once in a deduplicated blob table instead of inline in every message row. Defaults to false.",
17
18
  }),
19
+ image_model: ConfigModel.Selection.pipe(optional).annotate({
20
+ description: "Default model for the image_generate tool when the agent doesn't choose one, as providerID/modelID. Falls back to automatic selection when it isn't available.",
21
+ }),
18
22
  schedules: Schema.Boolean.pipe(optional).annotate({
19
23
  description: "Enable experimental scheduled tasks that wake a session with a prompt. Defaults to false.",
20
24
  }),
package/dist/goal.d.ts ADDED
@@ -0,0 +1,126 @@
1
+ export * as Goal from "./goal.js";
2
+ import { Schema } from "effect";
3
+ export declare const Status: Schema.Literals<readonly ["active", "paused", "complete"]>;
4
+ export type Status = typeof Status.Type;
5
+ export interface State extends Schema.Schema.Type<typeof State> {
6
+ }
7
+ export declare const State: Schema.Struct<{
8
+ readonly id: Schema.String;
9
+ readonly objective: Schema.String;
10
+ readonly status: Schema.Literals<readonly ["active", "paused", "complete"]>;
11
+ /** Why the goal last changed: the reviewer's reason, or what paused it. */
12
+ readonly reason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
13
+ /** Continuations sent since the goal was set or last resumed. */
14
+ readonly rounds: Schema.Number;
15
+ /** A backstop for loops that stall detection misses. */
16
+ readonly maxRounds: Schema.Number;
17
+ /** Rounds in a row without progress: no tool calls, or the same reason as the round before. */
18
+ readonly stalls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
19
+ /** The server process that armed the goal. */
20
+ readonly boot: Schema.String;
21
+ readonly updatedAt: Schema.Number;
22
+ }>;
23
+ /**
24
+ * The `/goal` plugin's RPC. Clients read a Session's goal with `get` and keep it current from `changed`, which the
25
+ * plugin publishes in the Session's Location on every write. A Session's goal is its own: children and forks start
26
+ * without one. The schemas are Standard Schemas too, so Promise clients can call it.
27
+ */
28
+ export declare const Definition: {
29
+ readonly id: "opencode.goal";
30
+ readonly methods: {
31
+ get: {
32
+ input: import("effect/StandardSchema").StandardSchemaV1<{
33
+ readonly sessionID: string;
34
+ }, {
35
+ readonly sessionID: string;
36
+ }> & Schema.Struct<{
37
+ readonly sessionID: Schema.String;
38
+ }>;
39
+ output: import("effect/StandardSchema").StandardSchemaV1<{
40
+ readonly id: string;
41
+ readonly objective: string;
42
+ readonly status: "active" | "complete" | "paused";
43
+ readonly reason?: string | undefined;
44
+ readonly rounds: number;
45
+ readonly maxRounds: number;
46
+ readonly stalls?: number | undefined;
47
+ readonly boot: string;
48
+ readonly updatedAt: number;
49
+ } | null, {
50
+ readonly id: string;
51
+ readonly objective: string;
52
+ readonly status: "active" | "complete" | "paused";
53
+ readonly reason?: string | undefined;
54
+ readonly rounds: number;
55
+ readonly maxRounds: number;
56
+ readonly stalls?: number | undefined;
57
+ readonly boot: string;
58
+ readonly updatedAt: number;
59
+ } | null> & Schema.NullOr<Schema.Struct<{
60
+ readonly id: Schema.String;
61
+ readonly objective: Schema.String;
62
+ readonly status: Schema.Literals<readonly ["active", "paused", "complete"]>;
63
+ /** Why the goal last changed: the reviewer's reason, or what paused it. */
64
+ readonly reason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
65
+ /** Continuations sent since the goal was set or last resumed. */
66
+ readonly rounds: Schema.Number;
67
+ /** A backstop for loops that stall detection misses. */
68
+ readonly maxRounds: Schema.Number;
69
+ /** Rounds in a row without progress: no tool calls, or the same reason as the round before. */
70
+ readonly stalls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
71
+ /** The server process that armed the goal. */
72
+ readonly boot: Schema.String;
73
+ readonly updatedAt: Schema.Number;
74
+ }>>;
75
+ };
76
+ };
77
+ readonly events: {
78
+ changed: {
79
+ schema: import("effect/StandardSchema").StandardSchemaV1<{
80
+ readonly sessionID: string;
81
+ readonly goal: {
82
+ readonly id: string;
83
+ readonly objective: string;
84
+ readonly status: "active" | "complete" | "paused";
85
+ readonly reason?: string | undefined;
86
+ readonly rounds: number;
87
+ readonly maxRounds: number;
88
+ readonly stalls?: number | undefined;
89
+ readonly boot: string;
90
+ readonly updatedAt: number;
91
+ } | null;
92
+ }, {
93
+ readonly sessionID: string;
94
+ readonly goal: {
95
+ readonly id: string;
96
+ readonly objective: string;
97
+ readonly status: "active" | "complete" | "paused";
98
+ readonly reason?: string | undefined;
99
+ readonly rounds: number;
100
+ readonly maxRounds: number;
101
+ readonly stalls?: number | undefined;
102
+ readonly boot: string;
103
+ readonly updatedAt: number;
104
+ } | null;
105
+ }> & Schema.Struct<{
106
+ readonly sessionID: Schema.String;
107
+ readonly goal: Schema.NullOr<Schema.Struct<{
108
+ readonly id: Schema.String;
109
+ readonly objective: Schema.String;
110
+ readonly status: Schema.Literals<readonly ["active", "paused", "complete"]>;
111
+ /** Why the goal last changed: the reviewer's reason, or what paused it. */
112
+ readonly reason: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
113
+ /** Continuations sent since the goal was set or last resumed. */
114
+ readonly rounds: Schema.Number;
115
+ /** A backstop for loops that stall detection misses. */
116
+ readonly maxRounds: Schema.Number;
117
+ /** Rounds in a row without progress: no tool calls, or the same reason as the round before. */
118
+ readonly stalls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Number>>, Schema.optionalKey<Schema.Number>, never, never>;
119
+ /** The server process that armed the goal. */
120
+ readonly boot: Schema.String;
121
+ readonly updatedAt: Schema.Number;
122
+ }>>;
123
+ }>;
124
+ };
125
+ };
126
+ };
package/dist/goal.js ADDED
@@ -0,0 +1,40 @@
1
+ export * as Goal from "./goal.js";
2
+ import { Schema } from "effect";
3
+ import { Rpc } from "./rpc.js";
4
+ import { optional } from "./schema.js";
5
+ export const Status = Schema.Literals(["active", "paused", "complete"]);
6
+ export const State = Schema.Struct({
7
+ id: Schema.String,
8
+ objective: Schema.String,
9
+ status: Status,
10
+ /** Why the goal last changed: the reviewer's reason, or what paused it. */
11
+ reason: optional(Schema.String),
12
+ /** Continuations sent since the goal was set or last resumed. */
13
+ rounds: Schema.Number,
14
+ /** A backstop for loops that stall detection misses. */
15
+ maxRounds: Schema.Number,
16
+ /** Rounds in a row without progress: no tool calls, or the same reason as the round before. */
17
+ stalls: optional(Schema.Number),
18
+ /** The server process that armed the goal. */
19
+ boot: Schema.String,
20
+ updatedAt: Schema.Number,
21
+ }).annotate({ identifier: "Goal.State" });
22
+ /**
23
+ * The `/goal` plugin's RPC. Clients read a Session's goal with `get` and keep it current from `changed`, which the
24
+ * plugin publishes in the Session's Location on every write. A Session's goal is its own: children and forks start
25
+ * without one. The schemas are Standard Schemas too, so Promise clients can call it.
26
+ */
27
+ export const Definition = Rpc.define({
28
+ id: "opencode.goal",
29
+ methods: {
30
+ get: {
31
+ input: Schema.toStandardSchemaV1(Schema.Struct({ sessionID: Schema.String })),
32
+ output: Schema.toStandardSchemaV1(Schema.NullOr(State)),
33
+ },
34
+ },
35
+ events: {
36
+ changed: {
37
+ schema: Schema.toStandardSchemaV1(Schema.Struct({ sessionID: Schema.String, goal: Schema.NullOr(State) })),
38
+ },
39
+ },
40
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@opencode/schema",
4
- "version": "0.0.0-dev-197",
4
+ "version": "0.0.0-dev-210",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {