@opencode/schema 0.0.0-dev-192 → 0.0.0-dev-201

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/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-192",
4
+ "version": "0.0.0-dev-201",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {