UNPKG

@sema-agent/core

Version:

Stateless, task-oriented AI agent core

53 lines (52 loc) • 3.06 kB
/** * The run's host questions, wired: the seat {@link sandboxHostQuestions} reads ({@link SandboxNetworkSeat}), each member read when a * question is put. The rules are the run's own fetch of the host judged by the layers every synthetic probe meets (the FETCH face * of `synthetic-read-verdict.ts`), then the allow members the gate's allow layer reads — the deployment's and the request's lists, * the person's stored rows, the skill rows — on that very probe; the card's offer is the rule-offer factory's on the same probe. * The card goes to the run's approval seat through the one resolver every live card goes through, with the leg's ask source and * its carrier for a person's written words. Nothing here is a second reading of a rule: every answer is a lane's own. */ import { type AskSourceIdentity, type OnAsk, type ToolCallRequest } from "../tool-policy.js"; import { type SandboxHostQuestions } from "../command-sandbox.js"; import type { SyntheticFetchJudge } from "../synthetic-read-verdict.js"; import type { AllowEntryLane } from "../allow-entry.js"; import type { SkillGrantLane } from "../skill-grant.js"; import type { PermissionMode } from "../ask-origin.js"; import type { AutoModeDecider } from "../auto-mode.js"; import type { ApprovalWordsSeat } from "../approval-words.js"; import type { PersistedRuleAnswer } from "../hooks.js"; import type { RunnerDeps } from "../types.js"; import type { createRuleOffersOf } from "./permission-rule-lanes.js"; export interface SandboxNetworkSeatInput { /** The run's FETCH face over its rule layers (the turn wiring's). */ readonly fetchJudge: SyntheticFetchJudge; /** The allow members, in the order the gate's allow layer reads them. */ readonly allows: { readonly deployment: AllowEntryLane; readonly persisted: { adjudicate: (req: ToolCallRequest) => PersistedRuleAnswer | Promise<PersistedRuleAnswer>; } | undefined; readonly skill: Pick<SkillGrantLane, "allowing">; readonly request: AllowEntryLane; }; /** The rule-offer factory every card's offer comes from. */ readonly offersOf: ReturnType<typeof createRuleOffersOf>; /** The leg's permission mode now. */ readonly mode: () => PermissionMode; /** Auto mode's decider, when the leg arms one. */ readonly decider: () => AutoModeDecider | undefined; /** The run's approval seat, its ask source and its carrier for a person's written words. */ readonly onAsk: OnAsk | undefined; readonly askSource: AskSourceIdentity; readonly approvalWords: ApprovalWordsSeat; /** The run's signal: the leg's end ends it. */ readonly signal: AbortSignal; readonly report: { readonly sessionId: string; readonly runId: string; readonly taskId: string; readonly deps: Pick<RunnerDeps, "onNotice" | "onError">; }; } /** The run's host questions over the run's own lanes and approval seat. */ export declare function sandboxNetworkQuestions(i: SandboxNetworkSeatInput): SandboxHostQuestions;