feat(plugin): expose synthetic session input (#37212)

This commit is contained in:
Kit Langton 2026-07-15 22:55:40 -04:00 committed by GitHub
commit 4678bd1049
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 74 additions and 4 deletions

View file

@ -425,6 +425,7 @@ export const make = Effect.fn("PluginHost.make")(function* (plugin: PluginV2.Int
get: (input) => runtime.session.get(input.sessionID),
prompt: runtime.session.prompt,
command: runtime.session.command,
synthetic: runtime.session.synthetic,
interrupt: (input) => runtime.session.interrupt(input.sessionID),
},
} satisfies Plugin.Context

View file

@ -244,6 +244,17 @@ export function fromPromise(plugin: Plugin) {
resume: input.resume ?? undefined,
}),
),
synthetic: (input) =>
run(
host.session.synthetic({
...input,
sessionID: Session.ID.make(input.sessionID),
id: input.id == null ? undefined : SessionMessage.ID.make(input.id),
description: input.description ?? undefined,
delivery: input.delivery ?? undefined,
resume: input.resume ?? undefined,
}),
),
interrupt: (input) => run(host.session.interrupt({ sessionID: Session.ID.make(input.sessionID) })),
},
}