chore: generate
This commit is contained in:
@@ -86,17 +86,9 @@ export class LocationServiceMap extends LayerMap.Service<LocationServiceMap>()("
|
|||||||
Layer.provide(model),
|
Layer.provide(model),
|
||||||
Layer.provide(skillGuidance),
|
Layer.provide(skillGuidance),
|
||||||
)
|
)
|
||||||
return Layer.mergeAll(
|
return Layer.mergeAll(services, commits, searches, resources, todos, questions, model, runner, builtInTools).pipe(
|
||||||
services,
|
Layer.fresh,
|
||||||
commits,
|
)
|
||||||
searches,
|
|
||||||
resources,
|
|
||||||
todos,
|
|
||||||
questions,
|
|
||||||
model,
|
|
||||||
runner,
|
|
||||||
builtInTools,
|
|
||||||
).pipe(Layer.fresh)
|
|
||||||
},
|
},
|
||||||
idleTimeToLive: "60 minutes",
|
idleTimeToLive: "60 minutes",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
|
|||||||
@@ -409,7 +409,8 @@ export const layer = Layer.effect(
|
|||||||
sessionID,
|
sessionID,
|
||||||
timestamp: yield* DateTime.now,
|
timestamp: yield* DateTime.now,
|
||||||
})
|
})
|
||||||
if (event.seq === undefined) return yield* Effect.die("Interrupt request event is missing aggregate sequence")
|
if (event.seq === undefined)
|
||||||
|
return yield* Effect.die("Interrupt request event is missing aggregate sequence")
|
||||||
yield* execution.interrupt(sessionID, event.seq)
|
yield* execution.interrupt(sessionID, event.seq)
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -95,7 +95,10 @@ export const make = <Key, A, E>(options: {
|
|||||||
// Initial work retains immediate-start behavior but cannot run before ownership is published.
|
// Initial work retains immediate-start behavior but cannot run before ownership is published.
|
||||||
// Observer-started successors yield once so synchronous drains cannot recurse on the JS stack.
|
// Observer-started successors yield once so synchronous drains cannot recurse on the JS stack.
|
||||||
const owner = fork(
|
const owner = fork(
|
||||||
(successor ? Effect.yieldNow.pipe(Effect.andThen(drain)) : Deferred.await(ready).pipe(Effect.andThen(drain))).pipe(
|
(successor
|
||||||
|
? Effect.yieldNow.pipe(Effect.andThen(drain))
|
||||||
|
: Deferred.await(ready).pipe(Effect.andThen(drain))
|
||||||
|
).pipe(
|
||||||
Effect.onExit((exit) => Effect.sync(() => settle(key, entry, demand, exit))),
|
Effect.onExit((exit) => Effect.sync(() => settle(key, entry, demand, exit))),
|
||||||
Effect.exit,
|
Effect.exit,
|
||||||
Effect.asVoid,
|
Effect.asVoid,
|
||||||
@@ -194,7 +197,12 @@ export const make = <Key, A, E>(options: {
|
|||||||
return entry?.stopping && entry.owner !== undefined ? Fiber.interrupt(entry.owner) : Effect.void
|
return entry?.stopping && entry.owner !== undefined ? Fiber.interrupt(entry.owner) : Effect.void
|
||||||
if (seq !== undefined) interruptSeq.set(key, seq)
|
if (seq !== undefined) interruptSeq.set(key, seq)
|
||||||
if (entry?.owner === undefined) return Effect.void
|
if (entry?.owner === undefined) return Effect.void
|
||||||
if (seq !== undefined && entry.current._tag === "wake" && entry.current.seq !== undefined && entry.current.seq > seq)
|
if (
|
||||||
|
seq !== undefined &&
|
||||||
|
entry.current._tag === "wake" &&
|
||||||
|
entry.current.seq !== undefined &&
|
||||||
|
entry.current.seq > seq
|
||||||
|
)
|
||||||
return Effect.void
|
return Effect.void
|
||||||
if (entry.stopping) {
|
if (entry.stopping) {
|
||||||
entry.interruptSeq = maxSeq(entry.interruptSeq, seq)
|
entry.interruptSeq = maxSeq(entry.interruptSeq, seq)
|
||||||
@@ -246,7 +254,12 @@ export const make = <Key, A, E>(options: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function suppressPendingAtOrBefore(entry: Entry<A, E>, seq: number | undefined) {
|
function suppressPendingAtOrBefore(entry: Entry<A, E>, seq: number | undefined) {
|
||||||
if (entry.pending?._tag === "wake" && seq !== undefined && entry.pending.seq !== undefined && entry.pending.seq > seq)
|
if (
|
||||||
|
entry.pending?._tag === "wake" &&
|
||||||
|
seq !== undefined &&
|
||||||
|
entry.pending.seq !== undefined &&
|
||||||
|
entry.pending.seq > seq
|
||||||
|
)
|
||||||
return
|
return
|
||||||
entry.pending = undefined
|
entry.pending = undefined
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -578,7 +578,11 @@ describe("SessionV2.prompt", () => {
|
|||||||
wakeCalls.length = 0
|
wakeCalls.length = 0
|
||||||
wakeSeqs.length = 0
|
wakeSeqs.length = 0
|
||||||
|
|
||||||
const admitted = yield* session.prompt({ sessionID, prompt: new Prompt({ text: "Run explicitly" }), resume: true })
|
const admitted = yield* session.prompt({
|
||||||
|
sessionID,
|
||||||
|
prompt: new Prompt({ text: "Run explicitly" }),
|
||||||
|
resume: true,
|
||||||
|
})
|
||||||
|
|
||||||
expect(executionCalls).toEqual([])
|
expect(executionCalls).toEqual([])
|
||||||
expect(wakeCalls).toEqual([sessionID])
|
expect(wakeCalls).toEqual([sessionID])
|
||||||
|
|||||||
@@ -325,9 +325,7 @@ describe("SessionRunCoordinator", () => {
|
|||||||
drain: () =>
|
drain: () =>
|
||||||
Effect.sync(() => ++runs).pipe(
|
Effect.sync(() => ++runs).pipe(
|
||||||
Effect.flatMap((run) =>
|
Effect.flatMap((run) =>
|
||||||
run === 1
|
run === 1 ? Deferred.succeed(firstStarted, undefined).pipe(Effect.andThen(Effect.never)) : Effect.void,
|
||||||
? Deferred.succeed(firstStarted, undefined).pipe(Effect.andThen(Effect.never))
|
|
||||||
: Effect.void,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -81,7 +81,11 @@ const execution = Layer.effect(
|
|||||||
SessionExecution.Service,
|
SessionExecution.Service,
|
||||||
SessionRunCoordinator.Service.pipe(
|
SessionRunCoordinator.Service.pipe(
|
||||||
Effect.map((coordinator) =>
|
Effect.map((coordinator) =>
|
||||||
SessionExecution.Service.of({ resume: coordinator.run, wake: coordinator.wake, interrupt: coordinator.interrupt }),
|
SessionExecution.Service.of({
|
||||||
|
resume: coordinator.run,
|
||||||
|
wake: coordinator.wake,
|
||||||
|
interrupt: coordinator.interrupt,
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).pipe(Layer.provide(coordinator))
|
).pipe(Layer.provide(coordinator))
|
||||||
|
|||||||
@@ -221,7 +221,11 @@ const execution = Layer.effect(
|
|||||||
SessionExecution.Service,
|
SessionExecution.Service,
|
||||||
SessionRunCoordinator.Service.pipe(
|
SessionRunCoordinator.Service.pipe(
|
||||||
Effect.map((coordinator) =>
|
Effect.map((coordinator) =>
|
||||||
SessionExecution.Service.of({ resume: coordinator.run, wake: coordinator.wake, interrupt: coordinator.interrupt }),
|
SessionExecution.Service.of({
|
||||||
|
resume: coordinator.run,
|
||||||
|
wake: coordinator.wake,
|
||||||
|
interrupt: coordinator.interrupt,
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
).pipe(Layer.provide(coordinator))
|
).pipe(Layer.provide(coordinator))
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export type Event =
|
|||||||
| EventSessionNextPrompted
|
| EventSessionNextPrompted
|
||||||
| EventSessionNextPromptAdmitted
|
| EventSessionNextPromptAdmitted
|
||||||
| EventSessionNextPromptPromoted
|
| EventSessionNextPromptPromoted
|
||||||
|
| EventSessionNextInterruptRequested
|
||||||
| EventSessionNextContextUpdated
|
| EventSessionNextContextUpdated
|
||||||
| EventSessionNextSynthetic
|
| EventSessionNextSynthetic
|
||||||
| EventSessionNextShellStarted
|
| EventSessionNextShellStarted
|
||||||
@@ -868,6 +869,14 @@ export type GlobalEvent = {
|
|||||||
timeCreated: number
|
timeCreated: number
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
| {
|
||||||
|
id: string
|
||||||
|
type: "session.next.interrupt.requested"
|
||||||
|
properties: {
|
||||||
|
timestamp: number
|
||||||
|
sessionID: string
|
||||||
|
}
|
||||||
|
}
|
||||||
| {
|
| {
|
||||||
id: string
|
id: string
|
||||||
type: "session.next.context.updated"
|
type: "session.next.context.updated"
|
||||||
@@ -1626,6 +1635,7 @@ export type GlobalEvent = {
|
|||||||
| SyncEventSessionNextPrompted
|
| SyncEventSessionNextPrompted
|
||||||
| SyncEventSessionNextPromptAdmitted
|
| SyncEventSessionNextPromptAdmitted
|
||||||
| SyncEventSessionNextPromptPromoted
|
| SyncEventSessionNextPromptPromoted
|
||||||
|
| SyncEventSessionNextInterruptRequested
|
||||||
| SyncEventSessionNextContextUpdated
|
| SyncEventSessionNextContextUpdated
|
||||||
| SyncEventSessionNextSynthetic
|
| SyncEventSessionNextSynthetic
|
||||||
| SyncEventSessionNextShellStarted
|
| SyncEventSessionNextShellStarted
|
||||||
@@ -3271,6 +3281,21 @@ export type SyncEventSessionNextPromptPromoted = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type SyncEventSessionNextInterruptRequested = {
|
||||||
|
type: "sync"
|
||||||
|
id: string
|
||||||
|
syncEvent: {
|
||||||
|
type: "session.next.interrupt.requested.1"
|
||||||
|
id: string
|
||||||
|
seq: number
|
||||||
|
aggregateID: string
|
||||||
|
data: {
|
||||||
|
timestamp: number
|
||||||
|
sessionID: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type SyncEventSessionNextContextUpdated = {
|
export type SyncEventSessionNextContextUpdated = {
|
||||||
type: "sync"
|
type: "sync"
|
||||||
id: string
|
id: string
|
||||||
@@ -4381,6 +4406,15 @@ export type EventSessionNextPromptPromoted = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type EventSessionNextInterruptRequested = {
|
||||||
|
id: string
|
||||||
|
type: "session.next.interrupt.requested"
|
||||||
|
properties: {
|
||||||
|
timestamp: number
|
||||||
|
sessionID: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type EventSessionNextContextUpdated = {
|
export type EventSessionNextContextUpdated = {
|
||||||
id: string
|
id: string
|
||||||
type: "session.next.context.updated"
|
type: "session.next.context.updated"
|
||||||
|
|||||||
@@ -12097,6 +12097,9 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventSessionNextPromptPromoted"
|
"$ref": "#/components/schemas/EventSessionNextPromptPromoted"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/EventSessionNextInterruptRequested"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/EventSessionNextContextUpdated"
|
"$ref": "#/components/schemas/EventSessionNextContextUpdated"
|
||||||
},
|
},
|
||||||
@@ -14695,6 +14698,35 @@
|
|||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["session.next.interrupt.requested"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"sessionID": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["timestamp", "sessionID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -17252,6 +17284,9 @@
|
|||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/SyncEventSessionNextPromptPromoted"
|
"$ref": "#/components/schemas/SyncEventSessionNextPromptPromoted"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"$ref": "#/components/schemas/SyncEventSessionNextInterruptRequested"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"$ref": "#/components/schemas/SyncEventSessionNextContextUpdated"
|
"$ref": "#/components/schemas/SyncEventSessionNextContextUpdated"
|
||||||
},
|
},
|
||||||
@@ -21983,6 +22018,56 @@
|
|||||||
"required": ["type", "id", "syncEvent"],
|
"required": ["type", "id", "syncEvent"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"SyncEventSessionNextInterruptRequested": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["sync"]
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"syncEvent": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["session.next.interrupt.requested.1"]
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"seq": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"aggregateID": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"sessionID": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["timestamp", "sessionID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "id", "seq", "aggregateID", "data"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["type", "id", "syncEvent"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"SyncEventSessionNextContextUpdated": {
|
"SyncEventSessionNextContextUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -25378,6 +25463,35 @@
|
|||||||
"required": ["id", "type", "properties"],
|
"required": ["id", "type", "properties"],
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
},
|
},
|
||||||
|
"EventSessionNextInterruptRequested": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^evt_"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["session.next.interrupt.requested"]
|
||||||
|
},
|
||||||
|
"properties": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"timestamp": {
|
||||||
|
"type": "number"
|
||||||
|
},
|
||||||
|
"sessionID": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^ses"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["timestamp", "sessionID"],
|
||||||
|
"additionalProperties": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": ["id", "type", "properties"],
|
||||||
|
"additionalProperties": false
|
||||||
|
},
|
||||||
"EventSessionNextContextUpdated": {
|
"EventSessionNextContextUpdated": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
|||||||
Reference in New Issue
Block a user