UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

66 lines • 6.64 kB
import type { SharedSections } from "../../../dynamic-prompt/types.ts"; export type ExecutionToolingRuleId = "eval-routing-decision" | "eval-evidence-return" | "perceived-state-loop" | "eval-stay-direct"; export type ExecutionToolingConcern = "code-cell-routing"; export type ExecutionToolingDialect = "claude" | "kimi"; export interface ExecutionToolingRule { readonly id: ExecutionToolingRuleId; readonly concern: ExecutionToolingConcern; readonly directive: Readonly<Record<ExecutionToolingDialect, string>>; /** The directive as worded before the senpi#5335 diet, rendered for `sharedSections: "full"` (senpi#5665). */ readonly fullDirective: Readonly<Record<ExecutionToolingDialect, string>>; } export declare const EXECUTION_TOOLING_RULES: readonly [{ readonly id: "eval-routing-decision"; readonly concern: "code-cell-routing"; readonly directive: { readonly claude: "Sort each multi-call step first: independent reads/searches/symbol lookups/probes -> ONE `eval` cell via `parallel(thunks)`. Edits, side effects, deploys, approvals, any call fed by an unseen result -> one at a time, observe each before next."; readonly kimi: "Sort a multi-call step before you write it: put independent reads, searches, symbol lookups, and probes into one `eval` cell together with `parallel(thunks)`, and run edits, side-effecting commands, deploys, approvals, and any call that depends on a result you have not seen yet one at a time, looking at each result before the next."; }; readonly fullDirective: { readonly claude: "Sort a multi-call step before you write it: independent reads, searches, symbol lookups, and probes go into ONE `eval` cell together via `parallel(thunks)` - an extra read-only call in that wave is nearly free, a stale assumption costs the turn - while edits, side-effecting commands, deploys, approvals, and any call whose input is a result you have not seen yet run one at a time, each observed before the next."; readonly kimi: "Sort a multi-call step before you write it: put independent reads, searches, symbol lookups, and probes into one `eval` cell together with `parallel(thunks)`, and run edits, side-effecting commands, deploys, approvals, and any call that depends on a result you have not seen yet one at a time, looking at each result before the next."; }; }, { readonly id: "eval-evidence-return"; readonly concern: "code-cell-routing"; readonly directive: { readonly claude: "Name expected state before running a cell; on return COMPARE evidence to it; for a mutating cell also confirm nothing changed beyond it."; readonly kimi: "Name the state a cell should produce before running it; when it returns, compare the returned evidence with that state, and for a cell that changed something also check that nothing changed beyond it."; }; readonly fullDirective: { readonly claude: "Name the state a cell should produce before running it; when it returns, COMPARE the returned evidence with that state, and for a cell that changed something also check that nothing changed beyond it. A result that hides a failed item or a truncated tail is not evidence."; readonly kimi: "Name the state a cell should produce before running it; when it returns, compare the returned evidence with that state, and for a cell that changed something also check that nothing changed beyond it. A result that hides a failed item or a truncated tail is not evidence."; }; }, { readonly id: "perceived-state-loop"; readonly concern: "code-cell-routing"; readonly directive: { readonly claude: "Result must be SEEN (page, component, image, 3D scene, layout): one change -> render/screenshot -> look -> next. 3D: several angles. Page: desktop + mobile widths. Compare to reference or stated intent; ask only where two readings of intent diverge."; readonly kimi: "When the result must be seen rather than read - a page, a component, an image, a 3D scene, a layout - make one change, render or screenshot it, look, then make the next; check a 3D scene from several angles and a page at desktop and mobile widths. Compare what you see with the reference or the stated intent, and ask only where two readings of that intent diverge."; }; readonly fullDirective: { readonly claude: "When the result must be SEEN rather than read - a page, a component, an image, a 3D scene, a layout - make one change, render or screenshot it, look, then make the next; check a 3D scene from several angles and a page at desktop and mobile widths. Compare what you see with the reference or the stated intent, and ask only where two readings of that intent diverge."; readonly kimi: "When the result must be seen rather than read - a page, a component, an image, a 3D scene, a layout - make one change, render or screenshot it, look, then make the next; check a 3D scene from several angles and a page at desktop and mobile widths. Compare what you see with the reference or the stated intent, and ask only where two readings of that intent diverge."; }; }, { readonly id: "eval-stay-direct"; readonly concern: "code-cell-routing"; readonly directive: { readonly claude: "Direct tool call only when: one call suffices, result decides next call, semantic judgment sits between calls, or action needs approval."; readonly kimi: "Use a direct tool call when one call is enough, when each result decides the next call, or when the action needs approval - then stop deliberating and make it."; }; readonly fullDirective: { readonly claude: "Call a tool directly only when one call is enough, the result decides the next call, semantic judgment sits between calls, or the action needs approval."; readonly kimi: "Use a direct tool call when one call is enough, when each result decides the next call, or when the action needs approval - then stop deliberating and make it."; }; }]; export interface BuildExecutionToolingSectionOptions { readonly toolNames: readonly string[]; readonly dialect: ExecutionToolingDialect; readonly sharedSections?: SharedSections; } /** Directives for the selected tools, or "" when eval is not available. */ export declare function buildExecutionToolingSection(options: BuildExecutionToolingSectionOptions): string; /** Same as buildExecutionToolingSection but followed by a paragraph gap, for inline placement. */ export declare function buildExecutionToolingParagraph(options: BuildExecutionToolingSectionOptions): string; //# sourceMappingURL=execution-tooling.d.ts.map