@fungi.computer/shiitake-extensions 0.4.0 → 0.6.0

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/README.md CHANGED
@@ -112,9 +112,8 @@ paused and `null` while active. The closed kinds are `person`, `blocked`,
112
112
  text, never a discriminator. Only blocked/stalled goals emit `goal-blocked` or
113
113
  `goal-stalled` attention, kept out of the main inbox with `inbox: false`.
114
114
  Questions and these two Goal kinds ask for a person in Herdr activity;
115
- person-paused, cancelled and failed goals do not. State version 6 discards
116
- disposable preview Goal rows from versions 4 and 5 rather than reading the
117
- superseded representation.
115
+ person-paused, cancelled and failed goals do not. The current Goal state is
116
+ version 7. Superseded preview Goal rows are not migrated to this representation.
118
117
 
119
118
  Loop tools are offered in every run. `loop.get`, `loop.start` and `loop.stop`
120
119
  work from any run of the Session, and the model may start a loop itself.
@@ -181,7 +180,10 @@ reason; the host can resume it without inventing a separate background loop.
181
180
 
182
181
  ## API reference and examples
183
182
 
184
- This package documents contracts beside source and has no generated API command.
183
+ The [generated API reference](docs/api/README.md) follows the public
184
+ entrypoints. Run `pnpm --dir packages/shiitake-extensions run docs:write` from
185
+ the repository root after changing them, then
186
+ `pnpm --dir packages/shiitake-extensions run docs` to check consistency.
185
187
  [package.json](package.json) owns these exported subpaths:
186
188
 
187
189
  | Entry | Source |
@@ -197,6 +199,8 @@ This package documents contracts beside source and has no generated API command.
197
199
  | `/subagents/client` | [Subagents client entry](src/subagents/client.ts). |
198
200
  | `/goal/client`, `/loop/client`, `/plan/client` | Client entries for [Goal](src/goal/client.ts), [Loop](src/loop/client.ts) and [Plan](src/plan/client.ts). |
199
201
  | `/roster` | [Product roster and grants](src/roster.ts). |
202
+ | `/schedules` | [Schema-only schedule pages, targets and receipts](src/schedules.ts). |
203
+ | `/schedules/client` | [Native schedule reads and controls](src/schedules/client.ts). |
200
204
 
201
205
  [Loop tests](test/loop.test.ts) exercise scheduling and mid-run pause.
202
206
  [Almanac tests](test/almanac.test.ts) exercise admission and retry.
@@ -204,6 +208,15 @@ This package documents contracts beside source and has no generated API command.
204
208
  These fixtures use the actual extension definitions on Shiitake with fake
205
209
  models.
206
210
 
211
+ ### Schedule consumers
212
+
213
+ Use `/schedules` for schedule schemas and types in an App bundle. It imports the
214
+ retained Almanac and Loop data schemas, not their native invocation clients.
215
+ Native host integrations use `/schedules/client` for `readAgentSchedulePage`,
216
+ `controlAgentSchedule` and `controlAgentScheduleWithContent` on an already
217
+ admitted Agent owner. These helpers own no admission policy, store or scheduler.
218
+ Reading and management remain separately admitted by the host.
219
+
207
220
  ## Home
208
221
 
209
222
  The host creates `homeExtension({ computers })`, where `computers.read()`
@@ -1,32 +1,5 @@
1
1
  import * as Schema from "effect/Schema";
2
- /** One durable schedule as every caller sees it. */
3
- export declare const Schedule: Schema.Struct<{
4
- /** Caller-chosen schedule identity. */
5
- readonly id: Schema.String;
6
- /** Session that receives each scheduled prompt. */
7
- readonly sessionId: Schema.String;
8
- /** Original prompt submitted to the destination Session. */
9
- readonly prompt: Schema.String;
10
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
11
- readonly cron: Schema.NullOr<Schema.Struct<{
12
- /** Cron expression used to calculate occurrences. */
13
- readonly expression: Schema.String;
14
- /** IANA time zone in which the expression is evaluated. */
15
- readonly timeZone: Schema.String;
16
- }>>;
17
- /** The occurrence that fires next (or fired last, once finished). */
18
- readonly nextDueAt: Schema.Int;
19
- /** Current scheduling lifecycle state. */
20
- readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
21
- /** Latest command admitted for this schedule. */
22
- readonly lastCommandId: Schema.NullOr<Schema.String>;
23
- /** Why the current occurrence has not been admitted yet, if it failed. */
24
- readonly lastError: Schema.NullOr<Schema.String>;
25
- /** Consecutive failed admissions of the current occurrence. */
26
- readonly attempt: Schema.Int;
27
- }>;
28
- /** One durable schedule. */
29
- export type Schedule = Schema.Schema.Type<typeof Schedule>;
2
+ export { Schedule } from "./schema.js";
30
3
  /** Almanac's contract: agent-scope schedule CRUD, no Session projection. */
31
4
  export declare const almanacContract: {
32
5
  /** Stable extension identity. */
@@ -50,28 +23,17 @@ export declare const almanacContract: {
50
23
  }>;
51
24
  /** Return the created durable schedule. */
52
25
  readonly output: Schema.Struct<{
53
- /** Caller-chosen schedule identity. */
54
26
  readonly id: Schema.String;
55
- /** Session that receives each scheduled prompt. */
56
27
  readonly sessionId: Schema.String;
57
- /** Original prompt submitted to the destination Session. */
58
28
  readonly prompt: Schema.String;
59
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
60
29
  readonly cron: Schema.NullOr<Schema.Struct<{
61
- /** Cron expression used to calculate occurrences. */
62
30
  readonly expression: Schema.String;
63
- /** IANA time zone in which the expression is evaluated. */
64
31
  readonly timeZone: Schema.String;
65
32
  }>>;
66
- /** The occurrence that fires next (or fired last, once finished). */
67
33
  readonly nextDueAt: Schema.Int;
68
- /** Current scheduling lifecycle state. */
69
34
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
70
- /** Latest command admitted for this schedule. */
71
35
  readonly lastCommandId: Schema.NullOr<Schema.String>;
72
- /** Why the current occurrence has not been admitted yet, if it failed. */
73
36
  readonly lastError: Schema.NullOr<Schema.String>;
74
- /** Consecutive failed admissions of the current occurrence. */
75
37
  readonly attempt: Schema.Int;
76
38
  }>;
77
39
  };
@@ -94,28 +56,17 @@ export declare const almanacContract: {
94
56
  }>;
95
57
  /** Return the created durable schedule. */
96
58
  readonly output: Schema.Struct<{
97
- /** Caller-chosen schedule identity. */
98
59
  readonly id: Schema.String;
99
- /** Session that receives each scheduled prompt. */
100
60
  readonly sessionId: Schema.String;
101
- /** Original prompt submitted to the destination Session. */
102
61
  readonly prompt: Schema.String;
103
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
104
62
  readonly cron: Schema.NullOr<Schema.Struct<{
105
- /** Cron expression used to calculate occurrences. */
106
63
  readonly expression: Schema.String;
107
- /** IANA time zone in which the expression is evaluated. */
108
64
  readonly timeZone: Schema.String;
109
65
  }>>;
110
- /** The occurrence that fires next (or fired last, once finished). */
111
66
  readonly nextDueAt: Schema.Int;
112
- /** Current scheduling lifecycle state. */
113
67
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
114
- /** Latest command admitted for this schedule. */
115
68
  readonly lastCommandId: Schema.NullOr<Schema.String>;
116
- /** Why the current occurrence has not been admitted yet, if it failed. */
117
69
  readonly lastError: Schema.NullOr<Schema.String>;
118
- /** Consecutive failed admissions of the current occurrence. */
119
70
  readonly attempt: Schema.Int;
120
71
  }>;
121
72
  };
@@ -130,28 +81,17 @@ export declare const almanacContract: {
130
81
  }>;
131
82
  /** Decode the schedule or its absence. */
132
83
  readonly output: Schema.NullOr<Schema.Struct<{
133
- /** Caller-chosen schedule identity. */
134
84
  readonly id: Schema.String;
135
- /** Session that receives each scheduled prompt. */
136
85
  readonly sessionId: Schema.String;
137
- /** Original prompt submitted to the destination Session. */
138
86
  readonly prompt: Schema.String;
139
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
140
87
  readonly cron: Schema.NullOr<Schema.Struct<{
141
- /** Cron expression used to calculate occurrences. */
142
88
  readonly expression: Schema.String;
143
- /** IANA time zone in which the expression is evaluated. */
144
89
  readonly timeZone: Schema.String;
145
90
  }>>;
146
- /** The occurrence that fires next (or fired last, once finished). */
147
91
  readonly nextDueAt: Schema.Int;
148
- /** Current scheduling lifecycle state. */
149
92
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
150
- /** Latest command admitted for this schedule. */
151
93
  readonly lastCommandId: Schema.NullOr<Schema.String>;
152
- /** Why the current occurrence has not been admitted yet, if it failed. */
153
94
  readonly lastError: Schema.NullOr<Schema.String>;
154
- /** Consecutive failed admissions of the current occurrence. */
155
95
  readonly attempt: Schema.Int;
156
96
  }>>;
157
97
  };
@@ -161,35 +101,22 @@ export declare const almanacContract: {
161
101
  readonly scope: "agent";
162
102
  /** Decode pagination arguments. */
163
103
  readonly input: Schema.Struct<{
164
- /** Exclusive schedule cursor. */
165
104
  readonly after: Schema.optionalKey<Schema.String>;
166
- /** Maximum number of schedules returned. */
167
105
  readonly limit: Schema.optionalKey<Schema.Int>;
168
106
  }>;
169
107
  /** Decode the returned schedule rows. */
170
108
  readonly output: Schema.$Array<Schema.Struct<{
171
- /** Caller-chosen schedule identity. */
172
109
  readonly id: Schema.String;
173
- /** Session that receives each scheduled prompt. */
174
110
  readonly sessionId: Schema.String;
175
- /** Original prompt submitted to the destination Session. */
176
111
  readonly prompt: Schema.String;
177
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
178
112
  readonly cron: Schema.NullOr<Schema.Struct<{
179
- /** Cron expression used to calculate occurrences. */
180
113
  readonly expression: Schema.String;
181
- /** IANA time zone in which the expression is evaluated. */
182
114
  readonly timeZone: Schema.String;
183
115
  }>>;
184
- /** The occurrence that fires next (or fired last, once finished). */
185
116
  readonly nextDueAt: Schema.Int;
186
- /** Current scheduling lifecycle state. */
187
117
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
188
- /** Latest command admitted for this schedule. */
189
118
  readonly lastCommandId: Schema.NullOr<Schema.String>;
190
- /** Why the current occurrence has not been admitted yet, if it failed. */
191
119
  readonly lastError: Schema.NullOr<Schema.String>;
192
- /** Consecutive failed admissions of the current occurrence. */
193
120
  readonly attempt: Schema.Int;
194
121
  }>>;
195
122
  };
@@ -204,28 +131,17 @@ export declare const almanacContract: {
204
131
  }>;
205
132
  /** Return its updated state. */
206
133
  readonly output: Schema.Struct<{
207
- /** Caller-chosen schedule identity. */
208
134
  readonly id: Schema.String;
209
- /** Session that receives each scheduled prompt. */
210
135
  readonly sessionId: Schema.String;
211
- /** Original prompt submitted to the destination Session. */
212
136
  readonly prompt: Schema.String;
213
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
214
137
  readonly cron: Schema.NullOr<Schema.Struct<{
215
- /** Cron expression used to calculate occurrences. */
216
138
  readonly expression: Schema.String;
217
- /** IANA time zone in which the expression is evaluated. */
218
139
  readonly timeZone: Schema.String;
219
140
  }>>;
220
- /** The occurrence that fires next (or fired last, once finished). */
221
141
  readonly nextDueAt: Schema.Int;
222
- /** Current scheduling lifecycle state. */
223
142
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
224
- /** Latest command admitted for this schedule. */
225
143
  readonly lastCommandId: Schema.NullOr<Schema.String>;
226
- /** Why the current occurrence has not been admitted yet, if it failed. */
227
144
  readonly lastError: Schema.NullOr<Schema.String>;
228
- /** Consecutive failed admissions of the current occurrence. */
229
145
  readonly attempt: Schema.Int;
230
146
  }>;
231
147
  };
@@ -240,28 +156,17 @@ export declare const almanacContract: {
240
156
  }>;
241
157
  /** Return its updated state. */
242
158
  readonly output: Schema.Struct<{
243
- /** Caller-chosen schedule identity. */
244
159
  readonly id: Schema.String;
245
- /** Session that receives each scheduled prompt. */
246
160
  readonly sessionId: Schema.String;
247
- /** Original prompt submitted to the destination Session. */
248
161
  readonly prompt: Schema.String;
249
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
250
162
  readonly cron: Schema.NullOr<Schema.Struct<{
251
- /** Cron expression used to calculate occurrences. */
252
163
  readonly expression: Schema.String;
253
- /** IANA time zone in which the expression is evaluated. */
254
164
  readonly timeZone: Schema.String;
255
165
  }>>;
256
- /** The occurrence that fires next (or fired last, once finished). */
257
166
  readonly nextDueAt: Schema.Int;
258
- /** Current scheduling lifecycle state. */
259
167
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
260
- /** Latest command admitted for this schedule. */
261
168
  readonly lastCommandId: Schema.NullOr<Schema.String>;
262
- /** Why the current occurrence has not been admitted yet, if it failed. */
263
169
  readonly lastError: Schema.NullOr<Schema.String>;
264
- /** Consecutive failed admissions of the current occurrence. */
265
170
  readonly attempt: Schema.Int;
266
171
  }>;
267
172
  };
@@ -276,28 +181,17 @@ export declare const almanacContract: {
276
181
  }>;
277
182
  /** Return its updated state. */
278
183
  readonly output: Schema.Struct<{
279
- /** Caller-chosen schedule identity. */
280
184
  readonly id: Schema.String;
281
- /** Session that receives each scheduled prompt. */
282
185
  readonly sessionId: Schema.String;
283
- /** Original prompt submitted to the destination Session. */
284
186
  readonly prompt: Schema.String;
285
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
286
187
  readonly cron: Schema.NullOr<Schema.Struct<{
287
- /** Cron expression used to calculate occurrences. */
288
188
  readonly expression: Schema.String;
289
- /** IANA time zone in which the expression is evaluated. */
290
189
  readonly timeZone: Schema.String;
291
190
  }>>;
292
- /** The occurrence that fires next (or fired last, once finished). */
293
191
  readonly nextDueAt: Schema.Int;
294
- /** Current scheduling lifecycle state. */
295
192
  readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
296
- /** Latest command admitted for this schedule. */
297
193
  readonly lastCommandId: Schema.NullOr<Schema.String>;
298
- /** Why the current occurrence has not been admitted yet, if it failed. */
299
194
  readonly lastError: Schema.NullOr<Schema.String>;
300
- /** Consecutive failed admissions of the current occurrence. */
301
195
  readonly attempt: Schema.Int;
302
196
  }>;
303
197
  };
@@ -1,44 +1,13 @@
1
1
  import { ExtensionId } from "@fungi.computer/shiitake/extensions";
2
2
  import * as Schema from "effect/Schema";
3
+ import { Prompt, SessionId } from "../internal/schedule-fields.js";
4
+ import { ScheduleId, Instant, CronExpression, TimeZone, Schedule, ScheduleListInput, } from "./schema.js";
5
+ export { Schedule } from "./schema.js";
3
6
  /**
4
7
  * Almanac: durable one-shot and cron schedules that send ordinary Session
5
8
  * prompts. This contract is shared by the server extension and its clients;
6
9
  * its schemas are the only decoders of Almanac values.
7
10
  */
8
- /** Caller-chosen schedule identity; also its create idempotency key. */
9
- const ScheduleId = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(200)), Schema.check(Schema.isPattern(/^[A-Za-z0-9._:-]+$/u)));
10
- const SessionId = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256)));
11
- /** Human prompt grammar; the admission door re-checks the exact byte bound. */
12
- const Prompt = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256 * 1024)));
13
- const Instant = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)));
14
- const CronExpression = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256)));
15
- const TimeZone = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(128)));
16
- /** One durable schedule as every caller sees it. */
17
- export const Schedule = Schema.Struct({
18
- /** Caller-chosen schedule identity. */
19
- id: ScheduleId,
20
- /** Session that receives each scheduled prompt. */
21
- sessionId: SessionId,
22
- /** Original prompt submitted to the destination Session. */
23
- prompt: Prompt,
24
- /** Cron expression and zone for a recurring schedule; null for one-shot. */
25
- cron: Schema.NullOr(Schema.Struct({
26
- /** Cron expression used to calculate occurrences. */
27
- expression: CronExpression,
28
- /** IANA time zone in which the expression is evaluated. */
29
- timeZone: TimeZone,
30
- })),
31
- /** The occurrence that fires next (or fired last, once finished). */
32
- nextDueAt: Instant,
33
- /** Current scheduling lifecycle state. */
34
- state: Schema.Literals(["active", "paused", "cancelled", "finished"]),
35
- /** Latest command admitted for this schedule. */
36
- lastCommandId: Schema.NullOr(Schema.String),
37
- /** Why the current occurrence has not been admitted yet, if it failed. */
38
- lastError: Schema.NullOr(Schema.String),
39
- /** Consecutive failed admissions of the current occurrence. */
40
- attempt: Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0))),
41
- });
42
11
  const ScheduleRef = Schema.Struct({
43
12
  /** Existing schedule targeted by the command. */
44
13
  scheduleId: ScheduleId,
@@ -101,12 +70,7 @@ export const almanacContract = {
101
70
  /** Read from the Agent's schedule collection. */
102
71
  scope: "agent",
103
72
  /** Decode pagination arguments. */
104
- input: Schema.Struct({
105
- /** Exclusive schedule cursor. */
106
- after: Schema.optionalKey(ScheduleId),
107
- /** Maximum number of schedules returned. */
108
- limit: Schema.optionalKey(Schema.Int.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 64 })))),
109
- }),
73
+ input: ScheduleListInput,
110
74
  /** Decode the returned schedule rows. */
111
75
  output: Schema.Array(Schedule),
112
76
  },
@@ -0,0 +1,41 @@
1
+ import * as Schema from "effect/Schema";
2
+ /** Caller-chosen schedule identity; also its create idempotency key. */
3
+ export declare const ScheduleId: Schema.String;
4
+ export declare const Instant: Schema.Int;
5
+ export declare const CronExpression: Schema.String;
6
+ export declare const TimeZone: Schema.String;
7
+ /** One durable schedule as every caller sees it. */
8
+ export declare const Schedule: Schema.Struct<{
9
+ /** Caller-chosen schedule identity. */
10
+ readonly id: Schema.String;
11
+ /** Session that receives each scheduled prompt. */
12
+ readonly sessionId: Schema.String;
13
+ /** Original prompt submitted to the destination Session. */
14
+ readonly prompt: Schema.String;
15
+ /** Cron expression and zone for a recurring schedule; null for one-shot. */
16
+ readonly cron: Schema.NullOr<Schema.Struct<{
17
+ /** Cron expression used to calculate occurrences. */
18
+ readonly expression: Schema.String;
19
+ /** IANA time zone in which the expression is evaluated. */
20
+ readonly timeZone: Schema.String;
21
+ }>>;
22
+ /** The occurrence that fires next (or fired last, once finished). */
23
+ readonly nextDueAt: Schema.Int;
24
+ /** Current scheduling lifecycle state. */
25
+ readonly state: Schema.Literals<readonly ["active", "paused", "cancelled", "finished"]>;
26
+ /** Latest command admitted for this schedule. */
27
+ readonly lastCommandId: Schema.NullOr<Schema.String>;
28
+ /** Why the current occurrence has not been admitted yet, if it failed. */
29
+ readonly lastError: Schema.NullOr<Schema.String>;
30
+ /** Consecutive failed admissions of the current occurrence. */
31
+ readonly attempt: Schema.Int;
32
+ }>;
33
+ /** One durable schedule. */
34
+ export type Schedule = Schema.Schema.Type<typeof Schedule>;
35
+ /** Native bounded Almanac page grammar, also used by shared continuations. */
36
+ export declare const ScheduleListInput: Schema.Struct<{
37
+ /** Exclusive schedule cursor. */
38
+ readonly after: Schema.optionalKey<Schema.String>;
39
+ /** Maximum number of schedules returned. */
40
+ readonly limit: Schema.optionalKey<Schema.Int>;
41
+ }>;
@@ -0,0 +1,40 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { Prompt, SessionId } from "../internal/schedule-fields.js";
3
+ /** Caller-chosen schedule identity; also its create idempotency key. */
4
+ export const ScheduleId = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(200)), Schema.check(Schema.isPattern(/^[A-Za-z0-9._:-]+$/u)));
5
+ export const Instant = Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0)));
6
+ export const CronExpression = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256)));
7
+ export const TimeZone = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(128)));
8
+ /** One durable schedule as every caller sees it. */
9
+ export const Schedule = Schema.Struct({
10
+ /** Caller-chosen schedule identity. */
11
+ id: ScheduleId,
12
+ /** Session that receives each scheduled prompt. */
13
+ sessionId: SessionId,
14
+ /** Original prompt submitted to the destination Session. */
15
+ prompt: Prompt,
16
+ /** Cron expression and zone for a recurring schedule; null for one-shot. */
17
+ cron: Schema.NullOr(Schema.Struct({
18
+ /** Cron expression used to calculate occurrences. */
19
+ expression: CronExpression,
20
+ /** IANA time zone in which the expression is evaluated. */
21
+ timeZone: TimeZone,
22
+ })),
23
+ /** The occurrence that fires next (or fired last, once finished). */
24
+ nextDueAt: Instant,
25
+ /** Current scheduling lifecycle state. */
26
+ state: Schema.Literals(["active", "paused", "cancelled", "finished"]),
27
+ /** Latest command admitted for this schedule. */
28
+ lastCommandId: Schema.NullOr(Schema.String),
29
+ /** Why the current occurrence has not been admitted yet, if it failed. */
30
+ lastError: Schema.NullOr(Schema.String),
31
+ /** Consecutive failed admissions of the current occurrence. */
32
+ attempt: Schema.Int.pipe(Schema.check(Schema.isGreaterThanOrEqualTo(0))),
33
+ });
34
+ /** Native bounded Almanac page grammar, also used by shared continuations. */
35
+ export const ScheduleListInput = Schema.Struct({
36
+ /** Exclusive schedule cursor. */
37
+ after: Schema.optionalKey(ScheduleId),
38
+ /** Maximum number of schedules returned. */
39
+ limit: Schema.optionalKey(Schema.Int.pipe(Schema.check(Schema.isBetween({ minimum: 1, maximum: 64 })))),
40
+ });
package/dist/goal/host.js CHANGED
@@ -208,7 +208,9 @@ function continueIfIdle(ctx, goal, requestId) {
208
208
  })
209
209
  .pipe(Effect.map((admitted) => admitted._tag === "Accepted"
210
210
  ? { ...goal, trackedWorkId: admitted.commandId }
211
- : goal), Effect.catchTag("AdmissionError", (error) => Effect.succeed(paused(goal, "failed", error.message))));
211
+ : goal), Effect.catchTag("AdmissionError", (error) => error.reason === "archived"
212
+ ? Clock.currentTimeMillis.pipe(Effect.flatMap((now) => ctx.timers.set(waitTimerKey(goal.sessionId), now + ctx.config.waitCheckMs)), Effect.as(goal))
213
+ : Effect.succeed(paused(goal, "failed", error.message))));
212
214
  }
213
215
  /**
214
216
  * Advance one Session's goal from one settled run. Any successful run in
@@ -0,0 +1,5 @@
1
+ import * as Schema from "effect/Schema";
2
+ /** Native Session address shared by Almanac and Loop inputs and rows. */
3
+ export declare const SessionId: Schema.String;
4
+ /** Human prompt grammar; the admission door re-checks the exact byte bound. */
5
+ export declare const Prompt: Schema.String;
@@ -0,0 +1,5 @@
1
+ import * as Schema from "effect/Schema";
2
+ /** Native Session address shared by Almanac and Loop inputs and rows. */
3
+ export const SessionId = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256)));
4
+ /** Human prompt grammar; the admission door re-checks the exact byte bound. */
5
+ export const Prompt = Schema.String.pipe(Schema.check(Schema.isMinLength(1)), Schema.check(Schema.isMaxLength(256 * 1024)));