New tools/code-dispatch-log waterfall (run via registry.shapeDispatchLog, contained — a throwing listener falls back to the unshaped content) lets listeners reshape the tool/code-dispatch event's content before the bridge appends it. dsh-spill-policy registers a second arm sharing the model-facing arm's exact replacement pipeline (same maxInlineBytes cap, preview + locator, within-cap invariant, best-effort fallbacks), with artifacts labeled dispatch under the sub-call id. The program's value is untouched; read sub-calls ARE bounded (a log copy is not model context, and read produces the biggest logs). Resolves the tools README's uncapped-dispatch-log Known Limitation.
56 lines
2.3 KiB
TypeScript
56 lines
2.3 KiB
TypeScript
/**
|
|
* Generated scoped-event routing-subject resolvers for dsh-scope invariants.
|
|
* Do not edit by hand; run `pnpm run gen-scoped-events`.
|
|
*
|
|
* @module @deepseek-ai/dsh-scope/scoped-events.generated
|
|
*/
|
|
|
|
type ScopedSubjectResolver = (args: readonly unknown[]) => unknown
|
|
|
|
const scopedSubjectResolvers: Readonly<Record<string, ScopedSubjectResolver | null>> = Object.freeze({
|
|
'agent/cancel-requested': args => args[0],
|
|
'agent/created': args => args[0],
|
|
'agent/disposed': args => args[0],
|
|
'agent/error': args => args[0],
|
|
'agent/inbox/dequeue': args => args[0],
|
|
'agent/inbox/discard': args => args[0],
|
|
'agent/inbox/enqueue': args => args[0],
|
|
'agent/post-step': args => args[0],
|
|
'agent/pre-step': args => args[0],
|
|
'agent/prompt-submit': args => args[0],
|
|
'agent/request': args => args[0],
|
|
'agent/request-error': args => args[0],
|
|
'agent/session-prefix': args => args[0],
|
|
'agent/session-start': args => args[0],
|
|
'agent/status': args => args[0],
|
|
'agent/step-result': args => args[0],
|
|
'agent/turn-continuation': args => args[0],
|
|
'agent/turn-stop': args => args[0],
|
|
'approval/request': args => (args[0] as Record<string, unknown>)['agent'],
|
|
'goal/changed': args => args[0],
|
|
'session/created': null,
|
|
'session/disposed': null,
|
|
'session/event': null,
|
|
'session/flush': null,
|
|
'subagent/end': null,
|
|
'subagent/start': null,
|
|
'system-prompt/assemble': args => (args[1] as Record<string, unknown>)['scope'],
|
|
'tools/code-dispatch-log': args => (args[0] as Record<string, unknown>)['agent'],
|
|
'tools/execute': args => (args[0] as Record<string, unknown>)['agent'],
|
|
'tools/post-execute': args => (args[0] as Record<string, unknown>)['agent'],
|
|
'tools/pre-execute': args => (args[0] as Record<string, unknown>)['agent'],
|
|
'tools/result': args => (args[0] as Record<string, unknown>)['agent'],
|
|
})
|
|
|
|
/**
|
|
* Resolve the routing key named by one scoped event payload. A null
|
|
* resolver means the payload cannot expose its external routing key, so the
|
|
* invariant checks carrier presence only.
|
|
* @param event - runtime Cordis event name.
|
|
* @returns the generated subject resolver, null for presence-only,
|
|
* or undefined when the event is not scope-filtered.
|
|
*/
|
|
export function scopedSubjectResolverFor(event: string): ScopedSubjectResolver | null | undefined {
|
|
return scopedSubjectResolvers[event]
|
|
}
|