UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

35 lines (34 loc) • 2.5 kB
/** * The HANDLING contract shared by every tool that launches background work and hands the model a * receipt: the Agent tool's async-launch card and `run_workflow`'s backgrounded launch receipt. * * Why a module rather than two copies. Both receipts state the same two things — "these bytes are * plumbing, do not paste them at the user" and "say what you launched in your own words" — and they * had drifted into two wordings of it (`; ` vs ` — `, "this result" vs "this tool result"). Neither * difference carried meaning; each was just the copy that happened to be typed second. A model reading * one receipt and a model reading the other should be reading the same instruction, and a later edit * to one of them should not be able to leave the other behind. * * What deliberately stays PER-LANE (the earlier ruling, narrowed rather than reversed): each receipt * hands back different artifacts, so each names its own. The Agent card names `task_id`; the workflow * receipt names the ids plus the host filesystem `scriptPath` it may have written. That enumeration is * a fact about the lane and cannot be centralized without one of them lying. So the SCOPE clause is the * caller's, and the sentence around it is this module's. Likewise the envelopes stay as they were — * the Agent lane renders prose, the workflow lane a JSON field — which is why these are string parts * rather than a rendered receipt. */ /** * The no-quote clause for one lane. `artifactScope` is the caller's own enumeration of what "any part * of it" covers, spliced in verbatim INCLUDING its leading separator — a comma clause * (`", including the task_id below,"`) and a parenthetical (`" (the ids above, and scriptPath when * present)"`) punctuate differently and the caller owns which it uses. Pass `""` for a lane with * nothing to enumerate; the sentence still reads. */ export declare function launchReceiptNoQuoteClause(artifactScope: string): string; /** * The closing instruction, whole and identical on every launch lane: report the launch in the model's * own words instead of echoing the receipt. Callers append their own lane-specific continuation (how * the result will or will not arrive) after a single space; this clause is a complete sentence on its * own so a lane with nothing to add can use it unchanged. */ export declare const LAUNCH_RECEIPT_OWN_WORDS_CLAUSE = "In your own words, briefly tell the user what you launched \u2014 do not echo this tool result.";