feat: let agents read supervisor story graphs

Expose saved decisions, timelines and source evidence through read-only Story Graph tools across Model, Harness and local/remote OpenCode and Continue. Supervisor enablement and runtime assignments govern discovery and calls; reads do not invoke models or modify stored evidence. Remote use requires matching Desktop and Agent changes.

Make Continue discussion show the complete editable message with a separated destination and shared action layout. Sending uses the visible draft without reattaching removed context.

Validation: existing focused MCP, runtime, controlled Linux Host, discussion component and Electron layout checks plus typechecks; staged diff check passed. Cross-scope fact reuse, historical reconstruction and full package acceptance remain deferred.

Release note: Agents can consult saved supervisor decisions and their sources when continuing work. Continue discussion now lets you review and edit the complete message before sending.
This commit is contained in:
mesalogo
2026-09-28 12:38:00 +08:00
parent 83a3ea261e
commit 66f77b83c2
61 changed files with 1527 additions and 150 deletions
@@ -588,21 +588,23 @@ export class ProtocolRemoteRuntimeChannel
async preparePrompt(
preparation: z.input<typeof remotePromptOperationPreparationSchema>,
imageToolBinding?: ImageToolBinding,
waitSignal?: AbortSignal
waitSignal?: AbortSignal,
storyGraphBinding?: import('../agent/knowledge-mcp-gateway').StoryGraphRemoteBinding
): Promise<
z.infer<typeof remotePromptOperationAcceptanceSchema>
> {
this.#imageTool?.close()
this.#imageTool = undefined
const description = preparation.workMode === 'execute' ? await imageToolBinding?.describe() : undefined
const storyGraph = await storyGraphBinding?.available()
waitSignal?.throwIfAborted()
let imageTool: z.infer<typeof remotePromptOperationPreparationSchema>['imageTool']
if (description && imageToolBinding) {
if ((description && imageToolBinding) || storyGraph) {
this.#assertCurrent()
const binary = this.#state.client.allocateBinaryChannel?.({ kind: 'blob' })
if (!binary) throw new Error('Remote image tool transport is unavailable')
imageTool = { channelId: binary.channelId, channelEpoch: binary.channelEpoch, description }
this.#imageTool = new MainImageToolSession(binary, imageToolBinding, waitSignal)
imageTool = { channelId: binary.channelId, channelEpoch: binary.channelEpoch, ...(description ? { description } : {}), ...(storyGraph ? { storyGraph: true } : {}) }
this.#imageTool = new MainImageToolSession(binary, imageToolBinding, waitSignal, storyGraphBinding)
}
try {
const parsed = remotePromptOperationPreparationSchema.parse({ ...preparation, imageTool })