@opencode/schema 2.2.7 → 2.3.1
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/agent.d.ts +9 -0
- package/dist/automation.d.ts +383 -0
- package/dist/automation.js +150 -0
- package/dist/blob-store.d.ts +16 -0
- package/dist/blob-store.js +15 -0
- package/dist/config/compaction.d.ts +1 -0
- package/dist/config/compaction.js +3 -0
- package/dist/config/experimental.d.ts +6 -3
- package/dist/config/experimental.js +11 -3
- package/dist/config/flag.d.ts +12 -7
- package/dist/config/flag.js +12 -7
- package/dist/config/provider.d.ts +47 -0
- package/dist/config/provider.js +1 -0
- package/dist/event-manifest.d.ts +248 -0
- package/dist/event-manifest.js +1 -1
- package/dist/generate.d.ts +134 -0
- package/dist/generate.js +57 -1
- package/dist/job.d.ts +28 -1
- package/dist/job.js +5 -2
- package/dist/mcp-event.d.ts +188 -0
- package/dist/mcp-event.js +26 -1
- package/dist/mcp.d.ts +21 -0
- package/dist/mcp.js +15 -0
- package/dist/model.d.ts +5 -1
- package/dist/model.js +4 -1
- package/dist/provider.d.ts +61 -0
- package/dist/provider.js +7 -0
- package/dist/session-event.d.ts +283 -0
- package/dist/session-event.js +10 -1
- package/dist/session-message.d.ts +6 -0
- package/dist/session-message.js +2 -0
- package/dist/session-transfer.d.ts +1 -0
- package/dist/tool.d.ts +18 -0
- package/dist/tool.js +9 -0
- package/package.json +1 -1
- package/dist/schedule.d.ts +0 -462
- package/dist/schedule.js +0 -206
package/dist/agent.d.ts
CHANGED
|
@@ -93,6 +93,15 @@ export declare const Info: Schema.Struct<{
|
|
|
93
93
|
}>>, never, never>;
|
|
94
94
|
readonly transport: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["http", "websocket"]>>>, Schema.optionalKey<Schema.Literals<readonly ["http", "websocket"]>>, never, never>;
|
|
95
95
|
readonly encoding: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["zstd", "gzip", "none"]>>>, Schema.optionalKey<Schema.Literals<readonly ["zstd", "gzip", "none"]>>, never, never>;
|
|
96
|
+
readonly tls: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
97
|
+
readonly cert: Schema.String;
|
|
98
|
+
readonly key: Schema.String;
|
|
99
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
100
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
101
|
+
readonly cert: Schema.String;
|
|
102
|
+
readonly key: Schema.String;
|
|
103
|
+
readonly passphrase: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
104
|
+
}>>, never, never>;
|
|
96
105
|
}>, readonly [Schema.$Record<Schema.String, Schema.Any>]>>;
|
|
97
106
|
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
98
107
|
readonly body: Schema.$Record<Schema.String, Schema.Any>;
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
export * as Automation from "./automation.js";
|
|
2
|
+
import { Option, Schema } from "effect";
|
|
3
|
+
import { SessionID } from "./session-id.js";
|
|
4
|
+
export declare const ID: Schema.brand<Schema.String, "Automation.ID"> & {
|
|
5
|
+
create: () => string & import("effect/Brand").Brand<"Automation.ID">;
|
|
6
|
+
};
|
|
7
|
+
export type ID = typeof ID.Type;
|
|
8
|
+
/** Milliseconds in a duration string, or `None` when it is not one. */
|
|
9
|
+
export declare const durationMillis: (value: string) => Option.Option<number>;
|
|
10
|
+
/** A duration such as "90 seconds", "5 minutes" or "2 hours". The service validates it, since clients cannot run a custom check. */
|
|
11
|
+
export declare const DurationString: Schema.String;
|
|
12
|
+
/** Runs once: at an instant with an offset, a wall-clock time in `tz` such as "2026-10-27T09:00", or "in 10 minutes". */
|
|
13
|
+
export declare const At: Schema.Struct<{
|
|
14
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
15
|
+
readonly type: Schema.tag<"at">;
|
|
16
|
+
readonly at: Schema.String;
|
|
17
|
+
}>;
|
|
18
|
+
export interface At extends Schema.Schema.Type<typeof At> {
|
|
19
|
+
}
|
|
20
|
+
export declare const Every: Schema.Struct<{
|
|
21
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
22
|
+
readonly type: Schema.tag<"every">;
|
|
23
|
+
readonly every: Schema.String;
|
|
24
|
+
}>;
|
|
25
|
+
export interface Every extends Schema.Schema.Type<typeof Every> {
|
|
26
|
+
}
|
|
27
|
+
export declare const Cron: Schema.Struct<{
|
|
28
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
29
|
+
readonly type: Schema.tag<"cron">;
|
|
30
|
+
readonly cron: Schema.String;
|
|
31
|
+
}>;
|
|
32
|
+
export interface Cron extends Schema.Schema.Type<typeof Cron> {
|
|
33
|
+
}
|
|
34
|
+
export declare const Event: Schema.Struct<{
|
|
35
|
+
readonly type: Schema.tag<"event">;
|
|
36
|
+
readonly server: Schema.NonEmptyString;
|
|
37
|
+
readonly event: Schema.NonEmptyString;
|
|
38
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
39
|
+
}>;
|
|
40
|
+
export interface Event extends Schema.Schema.Type<typeof Event> {
|
|
41
|
+
}
|
|
42
|
+
export declare const Trigger: Schema.Union<readonly [Schema.Struct<{
|
|
43
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
44
|
+
readonly type: Schema.tag<"at">;
|
|
45
|
+
readonly at: Schema.String;
|
|
46
|
+
}>, Schema.Struct<{
|
|
47
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
48
|
+
readonly type: Schema.tag<"every">;
|
|
49
|
+
readonly every: Schema.String;
|
|
50
|
+
}>, Schema.Struct<{
|
|
51
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
52
|
+
readonly type: Schema.tag<"cron">;
|
|
53
|
+
readonly cron: Schema.String;
|
|
54
|
+
}>, Schema.Struct<{
|
|
55
|
+
readonly type: Schema.tag<"event">;
|
|
56
|
+
readonly server: Schema.NonEmptyString;
|
|
57
|
+
readonly event: Schema.NonEmptyString;
|
|
58
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
59
|
+
}>]>;
|
|
60
|
+
export type Trigger = typeof Trigger.Type;
|
|
61
|
+
/** Where a prompt action goes: an existing Session, or a new child of the creating Session with an agent on every run. */
|
|
62
|
+
export declare const Target: Schema.Union<readonly [Schema.Struct<{
|
|
63
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
64
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
65
|
+
};
|
|
66
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
69
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
70
|
+
}>]>;
|
|
71
|
+
export type Target = typeof Target.Type;
|
|
72
|
+
/** The child Session a `{ subagent }` run starts, derived from the run so a retry adopts it instead of starting another. */
|
|
73
|
+
export declare const runSessionID: (id: ID, run: number) => string & import("effect/Brand").Brand<"SessionID">;
|
|
74
|
+
/** Whether a Session is a `{ subagent }` run's child, which finishes without reporting to or waking its parent. */
|
|
75
|
+
export declare const isRunSession: (sessionID: SessionID) => boolean;
|
|
76
|
+
export declare const PromptAction: Schema.Struct<{
|
|
77
|
+
readonly type: Schema.tag<"prompt">;
|
|
78
|
+
readonly prompt: Schema.String;
|
|
79
|
+
readonly to: Schema.Union<readonly [Schema.Struct<{
|
|
80
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
81
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
82
|
+
};
|
|
83
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
84
|
+
}>, Schema.Struct<{
|
|
85
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
86
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
87
|
+
}>]>;
|
|
88
|
+
}>;
|
|
89
|
+
export interface PromptAction extends Schema.Schema.Type<typeof PromptAction> {
|
|
90
|
+
}
|
|
91
|
+
/** Code can hand off one prompt, but cannot choose a Session by id. Reject unknown keys rather than dropping a target. */
|
|
92
|
+
export declare const CodeResult: Schema.Struct<{
|
|
93
|
+
readonly state: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
94
|
+
readonly done: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
95
|
+
readonly send: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
96
|
+
readonly prompt: Schema.String;
|
|
97
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
98
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
99
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
100
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
101
|
+
}>>, never, never>;
|
|
102
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
103
|
+
readonly prompt: Schema.String;
|
|
104
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Struct<{
|
|
105
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
106
|
+
}>>>, Schema.optionalKey<Schema.Struct<{
|
|
107
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
108
|
+
}>>, never, never>;
|
|
109
|
+
}>>, never, never>;
|
|
110
|
+
}>;
|
|
111
|
+
export interface CodeResult extends Schema.Schema.Type<typeof CodeResult> {
|
|
112
|
+
}
|
|
113
|
+
export declare const decodeCodeResult: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Result").Result<{
|
|
114
|
+
readonly state?: Schema.Json | undefined;
|
|
115
|
+
readonly done?: boolean | undefined;
|
|
116
|
+
readonly send?: {
|
|
117
|
+
readonly prompt: string;
|
|
118
|
+
readonly to?: {
|
|
119
|
+
readonly subagent: string & import("effect/Brand").Brand<"Agent.ID">;
|
|
120
|
+
} | undefined;
|
|
121
|
+
} | undefined;
|
|
122
|
+
} | null, Schema.SchemaError>;
|
|
123
|
+
/**
|
|
124
|
+
* Runs `code` in a confined Code Mode runtime with no model call and no `fetch`. Tools called statically as
|
|
125
|
+
* `tools.<path>(...)` are extracted from the AST and authorized at creation. The program receives
|
|
126
|
+
* `input = { state, now, runs, args, event? }` and returns nothing or a `CodeResult`.
|
|
127
|
+
*/
|
|
128
|
+
export declare const CodeAction: Schema.Struct<{
|
|
129
|
+
readonly type: Schema.tag<"code">;
|
|
130
|
+
readonly code: Schema.String;
|
|
131
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
132
|
+
}>;
|
|
133
|
+
export interface CodeAction extends Schema.Schema.Type<typeof CodeAction> {
|
|
134
|
+
}
|
|
135
|
+
export declare const Action: Schema.Union<readonly [Schema.Struct<{
|
|
136
|
+
readonly type: Schema.tag<"prompt">;
|
|
137
|
+
readonly prompt: Schema.String;
|
|
138
|
+
readonly to: Schema.Union<readonly [Schema.Struct<{
|
|
139
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
140
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
141
|
+
};
|
|
142
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
143
|
+
}>, Schema.Struct<{
|
|
144
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
145
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
146
|
+
}>]>;
|
|
147
|
+
}>, Schema.Struct<{
|
|
148
|
+
readonly type: Schema.tag<"code">;
|
|
149
|
+
readonly code: Schema.String;
|
|
150
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
151
|
+
}>]>;
|
|
152
|
+
export type Action = typeof Action.Type;
|
|
153
|
+
export declare const Status: Schema.Literals<readonly ["active", "paused", "done"]>;
|
|
154
|
+
export type Status = typeof Status.Type;
|
|
155
|
+
export declare const Outcome: Schema.Literals<readonly ["fired", "late", "skipped", "disabled", "failed", "expired"]>;
|
|
156
|
+
export type Outcome = typeof Outcome.Type;
|
|
157
|
+
export declare const Info: Schema.Struct<{
|
|
158
|
+
readonly id: Schema.brand<Schema.String, "Automation.ID"> & {
|
|
159
|
+
create: () => string & import("effect/Brand").Brand<"Automation.ID">;
|
|
160
|
+
};
|
|
161
|
+
readonly name: Schema.String;
|
|
162
|
+
readonly projectID: Schema.brand<Schema.String, "Project.ID"> & {
|
|
163
|
+
global: string & import("effect/Brand").Brand<"Project.ID">;
|
|
164
|
+
};
|
|
165
|
+
/** The Session that created it, if any. Deleting that Session does not delete the automation. */
|
|
166
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
167
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
168
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
169
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
170
|
+
}>, never, never>;
|
|
171
|
+
readonly directory: Schema.String;
|
|
172
|
+
readonly trigger: Schema.Union<readonly [Schema.Struct<{
|
|
173
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
174
|
+
readonly type: Schema.tag<"at">;
|
|
175
|
+
readonly at: Schema.String;
|
|
176
|
+
}>, Schema.Struct<{
|
|
177
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
178
|
+
readonly type: Schema.tag<"every">;
|
|
179
|
+
readonly every: Schema.String;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
182
|
+
readonly type: Schema.tag<"cron">;
|
|
183
|
+
readonly cron: Schema.String;
|
|
184
|
+
}>, Schema.Struct<{
|
|
185
|
+
readonly type: Schema.tag<"event">;
|
|
186
|
+
readonly server: Schema.NonEmptyString;
|
|
187
|
+
readonly event: Schema.NonEmptyString;
|
|
188
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
189
|
+
}>]>;
|
|
190
|
+
readonly tz: Schema.String;
|
|
191
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
192
|
+
readonly type: Schema.tag<"prompt">;
|
|
193
|
+
readonly prompt: Schema.String;
|
|
194
|
+
readonly to: Schema.Union<readonly [Schema.Struct<{
|
|
195
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
196
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
197
|
+
};
|
|
198
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
199
|
+
}>, Schema.Struct<{
|
|
200
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
201
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
202
|
+
}>]>;
|
|
203
|
+
}>, Schema.Struct<{
|
|
204
|
+
readonly type: Schema.tag<"code">;
|
|
205
|
+
readonly code: Schema.String;
|
|
206
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
207
|
+
}>]>;
|
|
208
|
+
readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
209
|
+
readonly status: Schema.Literals<readonly ["active", "paused", "done"]>;
|
|
210
|
+
readonly nextDueAt: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
211
|
+
readonly runCount: Schema.Int;
|
|
212
|
+
readonly lastRunAt: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>>, Schema.optionalKey<Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>>, never, never>;
|
|
213
|
+
readonly lastOutcome: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["fired", "late", "skipped", "disabled", "failed", "expired"]>>>, Schema.optionalKey<Schema.Literals<readonly ["fired", "late", "skipped", "disabled", "failed", "expired"]>>, never, never>;
|
|
214
|
+
readonly lastOutput: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
215
|
+
readonly state: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
216
|
+
readonly time: Schema.Struct<{
|
|
217
|
+
readonly created: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
218
|
+
readonly updated: Schema.decodeTo<Schema.DateTimeUtc, Schema.Finite, never, never>;
|
|
219
|
+
}>;
|
|
220
|
+
}>;
|
|
221
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
222
|
+
}
|
|
223
|
+
export declare const PromptActionInput: Schema.Struct<{
|
|
224
|
+
readonly type: Schema.tag<"prompt">;
|
|
225
|
+
readonly prompt: Schema.String;
|
|
226
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
227
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
228
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
229
|
+
};
|
|
230
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
231
|
+
}>, Schema.Struct<{
|
|
232
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
233
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
234
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
235
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
236
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
237
|
+
};
|
|
238
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
239
|
+
}>, Schema.Struct<{
|
|
240
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
241
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
242
|
+
}>]>>, never, never>;
|
|
243
|
+
}>;
|
|
244
|
+
export interface PromptActionInput extends Schema.Schema.Type<typeof PromptActionInput> {
|
|
245
|
+
}
|
|
246
|
+
export declare const CodeActionInput: Schema.Struct<{
|
|
247
|
+
readonly type: Schema.tag<"code">;
|
|
248
|
+
readonly code: Schema.String;
|
|
249
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
250
|
+
}>;
|
|
251
|
+
export interface CodeActionInput extends Schema.Schema.Type<typeof CodeActionInput> {
|
|
252
|
+
}
|
|
253
|
+
export declare const ActionInput: Schema.Union<readonly [Schema.Struct<{
|
|
254
|
+
readonly type: Schema.tag<"prompt">;
|
|
255
|
+
readonly prompt: Schema.String;
|
|
256
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
257
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
258
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
259
|
+
};
|
|
260
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
261
|
+
}>, Schema.Struct<{
|
|
262
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
263
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
264
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
265
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
266
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
267
|
+
};
|
|
268
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
269
|
+
}>, Schema.Struct<{
|
|
270
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
271
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
272
|
+
}>]>>, never, never>;
|
|
273
|
+
}>, Schema.Struct<{
|
|
274
|
+
readonly type: Schema.tag<"code">;
|
|
275
|
+
readonly code: Schema.String;
|
|
276
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
277
|
+
}>]>;
|
|
278
|
+
export type ActionInput = typeof ActionInput.Type;
|
|
279
|
+
/** An automation as callers describe it: a name, when it runs, what it does, and when it stops. */
|
|
280
|
+
export declare const Request: Schema.Struct<{
|
|
281
|
+
readonly name: Schema.String;
|
|
282
|
+
readonly trigger: Schema.Union<readonly [Schema.Struct<{
|
|
283
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
284
|
+
readonly type: Schema.tag<"at">;
|
|
285
|
+
readonly at: Schema.String;
|
|
286
|
+
}>, Schema.Struct<{
|
|
287
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
288
|
+
readonly type: Schema.tag<"every">;
|
|
289
|
+
readonly every: Schema.String;
|
|
290
|
+
}>, Schema.Struct<{
|
|
291
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
292
|
+
readonly type: Schema.tag<"cron">;
|
|
293
|
+
readonly cron: Schema.String;
|
|
294
|
+
}>, Schema.Struct<{
|
|
295
|
+
readonly type: Schema.tag<"event">;
|
|
296
|
+
readonly server: Schema.NonEmptyString;
|
|
297
|
+
readonly event: Schema.NonEmptyString;
|
|
298
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
299
|
+
}>]>;
|
|
300
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
301
|
+
readonly type: Schema.tag<"prompt">;
|
|
302
|
+
readonly prompt: Schema.String;
|
|
303
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
304
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
305
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
306
|
+
};
|
|
307
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
308
|
+
}>, Schema.Struct<{
|
|
309
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
310
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
311
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
312
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
313
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
314
|
+
};
|
|
315
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
316
|
+
}>, Schema.Struct<{
|
|
317
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
318
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
319
|
+
}>]>>, never, never>;
|
|
320
|
+
}>, Schema.Struct<{
|
|
321
|
+
readonly type: Schema.tag<"code">;
|
|
322
|
+
readonly code: Schema.String;
|
|
323
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
324
|
+
}>]>;
|
|
325
|
+
readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
326
|
+
}>;
|
|
327
|
+
export interface Request extends Schema.Schema.Type<typeof Request> {
|
|
328
|
+
}
|
|
329
|
+
export declare const CreateInput: Schema.Struct<{
|
|
330
|
+
readonly name: Schema.String;
|
|
331
|
+
readonly trigger: Schema.Union<readonly [Schema.Struct<{
|
|
332
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
333
|
+
readonly type: Schema.tag<"at">;
|
|
334
|
+
readonly at: Schema.String;
|
|
335
|
+
}>, Schema.Struct<{
|
|
336
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
337
|
+
readonly type: Schema.tag<"every">;
|
|
338
|
+
readonly every: Schema.String;
|
|
339
|
+
}>, Schema.Struct<{
|
|
340
|
+
readonly tz: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
341
|
+
readonly type: Schema.tag<"cron">;
|
|
342
|
+
readonly cron: Schema.String;
|
|
343
|
+
}>, Schema.Struct<{
|
|
344
|
+
readonly type: Schema.tag<"event">;
|
|
345
|
+
readonly server: Schema.NonEmptyString;
|
|
346
|
+
readonly event: Schema.NonEmptyString;
|
|
347
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>>, Schema.optionalKey<Schema.$Record<Schema.String, Schema.Codec<Schema.Json, Schema.Json, never, never>>>, never, never>;
|
|
348
|
+
}>]>;
|
|
349
|
+
readonly action: Schema.Union<readonly [Schema.Struct<{
|
|
350
|
+
readonly type: Schema.tag<"prompt">;
|
|
351
|
+
readonly prompt: Schema.String;
|
|
352
|
+
readonly to: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Struct<{
|
|
353
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
354
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
355
|
+
};
|
|
356
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
357
|
+
}>, Schema.Struct<{
|
|
358
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
359
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
360
|
+
}>]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
361
|
+
readonly session: Schema.brand<Schema.String, "SessionID"> & {
|
|
362
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
363
|
+
};
|
|
364
|
+
readonly subagent: Schema.optionalKey<Schema.Never>;
|
|
365
|
+
}>, Schema.Struct<{
|
|
366
|
+
readonly subagent: Schema.brand<Schema.String, "Agent.ID">;
|
|
367
|
+
readonly session: Schema.optionalKey<Schema.Never>;
|
|
368
|
+
}>]>>, never, never>;
|
|
369
|
+
}>, Schema.Struct<{
|
|
370
|
+
readonly type: Schema.tag<"code">;
|
|
371
|
+
readonly code: Schema.String;
|
|
372
|
+
readonly args: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Codec<Schema.Json, Schema.Json, never, never>>>, Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>, never, never>;
|
|
373
|
+
}>]>;
|
|
374
|
+
readonly expires: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
375
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
376
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
377
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
378
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
379
|
+
}>, never, never>;
|
|
380
|
+
readonly directory: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
381
|
+
}>;
|
|
382
|
+
export interface CreateInput extends Schema.Schema.Type<typeof CreateInput> {
|
|
383
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
export * as Automation from "./automation.js";
|
|
2
|
+
import { Duration, Option, Schema } from "effect";
|
|
3
|
+
import { Agent } from "./agent.js";
|
|
4
|
+
import { ascending } from "./identifier.js";
|
|
5
|
+
import { ProjectID } from "./project-id.js";
|
|
6
|
+
import { DateTimeUtcFromMillis, NonNegativeInt, optional, statics } from "./schema.js";
|
|
7
|
+
import { SessionID } from "./session-id.js";
|
|
8
|
+
export const ID = Schema.String.check(Schema.isStartingWith("aut_")).pipe(Schema.brand("Automation.ID"), Schema.annotate({ identifier: "Automation.ID" }), statics((schema) => ({
|
|
9
|
+
create: () => schema.make("aut_" + ascending()),
|
|
10
|
+
})));
|
|
11
|
+
const decodeDuration = Schema.decodeUnknownOption(Schema.DurationFromString);
|
|
12
|
+
/** Milliseconds in a duration string, or `None` when it is not one. */
|
|
13
|
+
export const durationMillis = (value) => decodeDuration(value).pipe(Option.map(Duration.toMillis));
|
|
14
|
+
/** A duration such as "90 seconds", "5 minutes" or "2 hours". The service validates it, since clients cannot run a custom check. */
|
|
15
|
+
export const DurationString = Schema.String.annotate({
|
|
16
|
+
identifier: "Automation.Duration",
|
|
17
|
+
description: 'A duration such as "90 seconds", "5 minutes" or "2 hours".',
|
|
18
|
+
});
|
|
19
|
+
const zone = {
|
|
20
|
+
tz: Schema.String.pipe(optional).annotate({
|
|
21
|
+
description: "IANA time zone. Defaults to the configured timezone, then the server's local zone.",
|
|
22
|
+
}),
|
|
23
|
+
};
|
|
24
|
+
/** Runs once: at an instant with an offset, a wall-clock time in `tz` such as "2026-10-27T09:00", or "in 10 minutes". */
|
|
25
|
+
export const At = Schema.Struct({
|
|
26
|
+
type: Schema.tag("at"),
|
|
27
|
+
at: Schema.String.annotate({
|
|
28
|
+
description: 'An instant with an offset, a wall-clock time in tz such as "2026-10-27T09:00", or "in 10 minutes".',
|
|
29
|
+
}),
|
|
30
|
+
...zone,
|
|
31
|
+
}).annotate({ identifier: "Automation.Trigger.At" });
|
|
32
|
+
export const Every = Schema.Struct({ type: Schema.tag("every"), every: DurationString, ...zone }).annotate({
|
|
33
|
+
identifier: "Automation.Trigger.Every",
|
|
34
|
+
});
|
|
35
|
+
export const Cron = Schema.Struct({ type: Schema.tag("cron"), cron: Schema.String, ...zone }).annotate({
|
|
36
|
+
identifier: "Automation.Trigger.Cron",
|
|
37
|
+
});
|
|
38
|
+
export const Event = Schema.Struct({
|
|
39
|
+
type: Schema.tag("event"),
|
|
40
|
+
server: Schema.NonEmptyString,
|
|
41
|
+
event: Schema.NonEmptyString,
|
|
42
|
+
args: Schema.Record(Schema.String, Schema.Json).pipe(optional),
|
|
43
|
+
}).annotate({ identifier: "Automation.Trigger.Event" });
|
|
44
|
+
export const Trigger = Schema.Union([At, Every, Cron, Event]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Automation.Trigger" }));
|
|
45
|
+
/** Declares a variant field absent, so `{ session, subagent }` fails instead of silently dropping one. */
|
|
46
|
+
const absent = Schema.optionalKey(Schema.Never);
|
|
47
|
+
/** Where a prompt action goes: an existing Session, or a new child of the creating Session with an agent on every run. */
|
|
48
|
+
export const Target = Schema.Union([
|
|
49
|
+
Schema.Struct({ session: SessionID, subagent: absent }),
|
|
50
|
+
Schema.Struct({ subagent: Agent.ID, session: absent }),
|
|
51
|
+
]).annotate({ identifier: "Automation.Target" });
|
|
52
|
+
/** The child Session a `{ subagent }` run starts, derived from the run so a retry adopts it instead of starting another. */
|
|
53
|
+
export const runSessionID = (id, run) => SessionID.make(`ses_${id}_${run}`);
|
|
54
|
+
/** Whether a Session is a `{ subagent }` run's child, which finishes without reporting to or waking its parent. */
|
|
55
|
+
export const isRunSession = (sessionID) => sessionID.startsWith("ses_aut_");
|
|
56
|
+
export const PromptAction = Schema.Struct({ type: Schema.tag("prompt"), prompt: Schema.String, to: Target }).annotate({
|
|
57
|
+
identifier: "Automation.Action.Prompt",
|
|
58
|
+
});
|
|
59
|
+
/** Code can hand off one prompt, but cannot choose a Session by id. Reject unknown keys rather than dropping a target. */
|
|
60
|
+
export const CodeResult = Schema.Struct({
|
|
61
|
+
state: Schema.Json.pipe(optional),
|
|
62
|
+
done: Schema.Boolean.pipe(optional),
|
|
63
|
+
send: Schema.Struct({
|
|
64
|
+
prompt: Schema.String.check(Schema.isPattern(/\S/)),
|
|
65
|
+
to: Schema.Struct({ subagent: Agent.ID.check(Schema.isPattern(/\S/)) }).pipe(optional),
|
|
66
|
+
}).pipe(optional),
|
|
67
|
+
}).annotate({ identifier: "Automation.CodeResult" });
|
|
68
|
+
// Code Mode represents a program that returns nothing as JSON null.
|
|
69
|
+
export const decodeCodeResult = Schema.decodeUnknownResult(Schema.NullOr(CodeResult), { onExcessProperty: "error" });
|
|
70
|
+
/**
|
|
71
|
+
* Runs `code` in a confined Code Mode runtime with no model call and no `fetch`. Tools called statically as
|
|
72
|
+
* `tools.<path>(...)` are extracted from the AST and authorized at creation. The program receives
|
|
73
|
+
* `input = { state, now, runs, args, event? }` and returns nothing or a `CodeResult`.
|
|
74
|
+
*/
|
|
75
|
+
export const CodeAction = Schema.Struct({
|
|
76
|
+
type: Schema.tag("code"),
|
|
77
|
+
code: Schema.String,
|
|
78
|
+
args: Schema.Json.pipe(optional),
|
|
79
|
+
}).annotate({ identifier: "Automation.Action.Code" });
|
|
80
|
+
export const Action = Schema.Union([PromptAction, CodeAction]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Automation.Action" }));
|
|
81
|
+
export const Status = Schema.Literals(["active", "paused", "done"]).annotate({ identifier: "Automation.Status" });
|
|
82
|
+
export const Outcome = Schema.Literals(["fired", "late", "skipped", "disabled", "failed", "expired"]).annotate({
|
|
83
|
+
identifier: "Automation.Outcome",
|
|
84
|
+
});
|
|
85
|
+
export const Info = Schema.Struct({
|
|
86
|
+
id: ID,
|
|
87
|
+
name: Schema.String,
|
|
88
|
+
projectID: ProjectID,
|
|
89
|
+
/** The Session that created it, if any. Deleting that Session does not delete the automation. */
|
|
90
|
+
sessionID: SessionID.pipe(optional),
|
|
91
|
+
directory: Schema.String,
|
|
92
|
+
trigger: Trigger,
|
|
93
|
+
tz: Schema.String,
|
|
94
|
+
action: Action,
|
|
95
|
+
expires: DateTimeUtcFromMillis.pipe(optional),
|
|
96
|
+
status: Status,
|
|
97
|
+
nextDueAt: DateTimeUtcFromMillis.pipe(optional),
|
|
98
|
+
runCount: NonNegativeInt,
|
|
99
|
+
lastRunAt: DateTimeUtcFromMillis.pipe(optional),
|
|
100
|
+
lastOutcome: Outcome.pipe(optional),
|
|
101
|
+
lastOutput: Schema.String.pipe(optional),
|
|
102
|
+
state: Schema.Json.pipe(optional),
|
|
103
|
+
time: Schema.Struct({ created: DateTimeUtcFromMillis, updated: DateTimeUtcFromMillis }),
|
|
104
|
+
}).annotate({ identifier: "Automation.Info" });
|
|
105
|
+
export const PromptActionInput = Schema.Struct({
|
|
106
|
+
type: Schema.tag("prompt"),
|
|
107
|
+
prompt: Schema.String.check(Schema.isMinLength(1)).annotate({
|
|
108
|
+
description: "The message the target Session receives, with enough context to act on it without this conversation.",
|
|
109
|
+
}),
|
|
110
|
+
to: Target.pipe(optional).annotate({
|
|
111
|
+
description: 'Where the prompt goes: { session: "ses_..." }, or { subagent: "<agent>" } to start a new child of the creating Session with that agent each run. Defaults to the creating Session.',
|
|
112
|
+
}),
|
|
113
|
+
}).annotate({ identifier: "Automation.PromptActionInput" });
|
|
114
|
+
export const CodeActionInput = Schema.Struct({
|
|
115
|
+
type: Schema.tag("code"),
|
|
116
|
+
code: Schema.String.check(Schema.isMinLength(1)).annotate({
|
|
117
|
+
description: [
|
|
118
|
+
"Code Mode JavaScript run on each trigger with no model (no fetch; 30s, 20 tool calls, 32 KB output cap).",
|
|
119
|
+
'Call tools statically as tools.<ns>.<tool>(...) or tools["ns-name"].tool(...); each is authorized once at creation to run unattended.',
|
|
120
|
+
"Receives input = { state, now, runs, args } (also globals): state starts null, now is epoch ms, runs counts earlier runs.",
|
|
121
|
+
"Event triggers also receive input.event = { id, timestamp, data }; data follows the event type's payloadSchema.",
|
|
122
|
+
"Return nothing, or { state?, done?, send? }. JSON state is kept for the next run; done: true stops. lastOutput shows the delivery target and any logs.",
|
|
123
|
+
"Return at most one send per run. { send: { prompt } } steers the creating session; { send: { prompt, to: { subagent } } } starts a permitted child that does not report back. No session IDs. Omit send to stay quiet. A rejected send commits neither state nor done.",
|
|
124
|
+
'Example code string: if (runs < 2) return; return { done: true, send: { prompt: "Three checks elapsed. Review the build." } }',
|
|
125
|
+
].join(" "),
|
|
126
|
+
}),
|
|
127
|
+
args: Schema.Json.pipe(optional).annotate({ description: "JSON passed to every run as input.args." }),
|
|
128
|
+
}).annotate({ identifier: "Automation.CodeActionInput" });
|
|
129
|
+
export const ActionInput = Schema.Union([PromptActionInput, CodeActionInput]).pipe(Schema.toTaggedUnion("type"), Schema.annotate({ identifier: "Automation.ActionInput" }));
|
|
130
|
+
/** An automation as callers describe it: a name, when it runs, what it does, and when it stops. */
|
|
131
|
+
export const Request = Schema.Struct({
|
|
132
|
+
name: Schema.String.check(Schema.isMinLength(1)).annotate({ description: "A short label shown in lists." }),
|
|
133
|
+
trigger: Trigger.annotate({
|
|
134
|
+
description: 'When it runs: { type: "at", at: "in 20 minutes" | "2026-10-27T09:00" }, { type: "every", every: "1 hour" } or { type: "cron", cron: "0 9 * * 1-5" }, each with an optional tz. Or { type: "event", server, event, args? } for a connected MCP server advertising push delivery (requires mcp_events).',
|
|
135
|
+
}),
|
|
136
|
+
action: ActionInput.annotate({
|
|
137
|
+
description: 'What it does: { type: "prompt", prompt, to? } sends a prompt; { type: "code", code, args? } runs Code Mode with no model.',
|
|
138
|
+
}),
|
|
139
|
+
expires: Schema.String.pipe(optional).annotate({
|
|
140
|
+
description: 'When it stops for good: an instant, a wall-clock time in tz, or "in 8 hours".',
|
|
141
|
+
}),
|
|
142
|
+
}).annotate({ identifier: "Automation.Request" });
|
|
143
|
+
export const CreateInput = Schema.Struct({
|
|
144
|
+
// A creating Session supplies the directory, default recipient, and authority for code or child actions.
|
|
145
|
+
sessionID: SessionID.pipe(optional),
|
|
146
|
+
directory: Schema.String.annotate({
|
|
147
|
+
description: "Where it runs when there is no Session. Defaults to the server user's home folder.",
|
|
148
|
+
}).pipe(optional),
|
|
149
|
+
...Request.fields,
|
|
150
|
+
}).annotate({ identifier: "Automation.CreateInput" });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * as BlobStore from "./blob-store.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* The ID of what made the blob and the blob's position among its outputs: `video_<id>_0` is a video job's first
|
|
5
|
+
* video. The prefix says what kind of blob it is. Strict, because the server names files after it.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ID: Schema.brand<Schema.String, "Blob.ID">;
|
|
8
|
+
export type ID = typeof ID.Type;
|
|
9
|
+
export interface Info extends Schema.Schema.Type<typeof Info> {
|
|
10
|
+
}
|
|
11
|
+
export declare const Info: Schema.Struct<{
|
|
12
|
+
readonly id: Schema.brand<Schema.String, "Blob.ID">;
|
|
13
|
+
readonly mime: Schema.String;
|
|
14
|
+
readonly bytes: Schema.Finite;
|
|
15
|
+
readonly expiresAt: Schema.Finite;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * as BlobStore from "./blob-store.js";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
/**
|
|
4
|
+
* The ID of what made the blob and the blob's position among its outputs: `video_<id>_0` is a video job's first
|
|
5
|
+
* video. The prefix says what kind of blob it is. Strict, because the server names files after it.
|
|
6
|
+
*/
|
|
7
|
+
export const ID = Schema.String.check(Schema.isPattern(/^video_[0-9a-f]{12}[0-9A-Za-z]{14}_(0|[1-9][0-9]{0,2})$/u)).pipe(Schema.brand("Blob.ID"), Schema.annotate({ identifier: "Blob.ID" }));
|
|
8
|
+
export const Info = Schema.Struct({
|
|
9
|
+
id: ID,
|
|
10
|
+
mime: Schema.String,
|
|
11
|
+
bytes: Schema.Finite,
|
|
12
|
+
expiresAt: Schema.Finite.annotate({
|
|
13
|
+
description: "Epoch milliseconds after which the blob may be deleted. Read it with GET /api/experimental/blob/:id",
|
|
14
|
+
}),
|
|
15
|
+
}).annotate({ identifier: "Blob.Info" });
|
|
@@ -10,6 +10,7 @@ export declare const Percent: Schema.String;
|
|
|
10
10
|
export type Percent = typeof Percent.Type;
|
|
11
11
|
declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
12
12
|
readonly auto: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
13
|
+
readonly background: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
13
14
|
readonly keep: Schema.decodeTo<Schema.optional<Schema.toType<typeof Keep>>, Schema.optionalKey<typeof Keep>, never, never>;
|
|
14
15
|
readonly buffer: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.String, Schema.Int]>>>, Schema.optionalKey<Schema.Union<readonly [Schema.String, Schema.Int]>>, never, never>;
|
|
15
16
|
}>, {}>;
|
|
@@ -11,6 +11,9 @@ export const Percent = Schema.String.check(Schema.isPattern(/^([1-9]\d?(\.\d+)?)
|
|
|
11
11
|
});
|
|
12
12
|
export class Info extends Schema.Class("Config.Compaction")({
|
|
13
13
|
auto: Schema.Boolean.pipe(optional),
|
|
14
|
+
background: Schema.Boolean.pipe(optional).annotate({
|
|
15
|
+
description: "Write the summary in the background as the session nears automatic compaction, so it does not wait for one (default: true). A summary that is never used still costs tokens.",
|
|
16
|
+
}),
|
|
14
17
|
keep: Keep.pipe(optional),
|
|
15
18
|
buffer: Schema.Union([Percent, NonNegativeInt]).pipe(optional).annotate({
|
|
16
19
|
description: 'Room kept free below the model\'s context window before automatic compaction, as a share of the window from "1%" to "99%", such as "20%" to compact at 80% full. A token count is also accepted.',
|
|
@@ -2,7 +2,9 @@ export * as ConfigExperimental from "./experimental.js";
|
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
4
4
|
readonly portable_shell_scanner: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
5
|
+
readonly codemode_vm: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
5
6
|
readonly all_flags: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
7
|
+
readonly schedules: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
6
8
|
readonly part_rows: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
7
9
|
readonly image_generate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
8
10
|
readonly model: Schema.decodeTo<Schema.optional<Schema.toType<Schema.decodeTo<Schema.Struct<{
|
|
@@ -61,12 +63,13 @@ declare const Info_base: Schema.Class<Info, Schema.Struct<{
|
|
|
61
63
|
readonly effect: Schema.Literals<readonly ["allow", "deny"]>;
|
|
62
64
|
}>, never, never>>>, never, never>;
|
|
63
65
|
readonly artifacts: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
64
|
-
readonly
|
|
65
|
-
readonly codemode_vm: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
66
|
+
readonly automations: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
66
67
|
readonly console_watches: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
68
|
+
readonly full_codemode: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
69
|
+
readonly mcp_events: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
67
70
|
readonly media_blob: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
68
|
-
readonly schedules: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
69
71
|
readonly todo: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
72
|
+
readonly video_generate: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Boolean>>, Schema.optionalKey<Schema.Boolean>, never, never>;
|
|
70
73
|
}>, {}>;
|
|
71
74
|
export declare class Info extends Info_base {
|
|
72
75
|
}
|