/** * CrewAI Adapter — primitive mappings between CrewAI tasks and APS delegations. * * Pure mapping + receipt-builder layer. Stateful runtime (audit trail, * spend tracking, gateway reporting) lives in the gateway — callers that * need those behaviours supply them via the `onReceipt` / `onDenied` hooks. */ import { type RevocationCheckOptions } from '../core/delegation.js'; import type { Delegation, ActionReceipt, SignedPassport } from '../types/passport.js'; export interface CrewTask { description: string; agent: string; tools?: string[]; expected_output?: string; } export interface CrewGovernanceConfig { passport: SignedPassport; delegation: Delegation; privateKey: string; onReceipt?: (r: ActionReceipt) => void; onDenied?: (info: { task: string; agent: string; reason: string; }) => void; /** Trust anchors for this gate: issuer public keys whose countersignature * is accepted. A NON-EMPTY list requires a valid countersignature from one * of them. An empty list, or omitting it, means this gate holds no * anchors; it does not mean "trust anyone". */ trustedIssuers?: string[]; /** Explicit wildcard trust: admit a passport whose only authority is its * own signature. Required to admit a self-signed credential, because a * signature that verifies under a key the passport itself supplied is not * an authorization by a trusted issuer. Default false. */ allowSelfSigned?: boolean; /** Revocation posture applied to the delegation check before every * governed call. This adapter is an execution gate: it verifies the * delegation immediately before the tool runs, which is exactly where a * caller who will not act on unknown revocation state says so. Pass * { revocationCheckPolicy: 'fail_closed', cachedRevocationState } to * refuse when revocation evidence is absent or stale. Omitted leaves the * previous behaviour, signature and expiry only. */ revocation?: RevocationCheckOptions; } export interface GovernedTaskResult { output: unknown; receipt: ActionReceipt; toolReceipts: ActionReceipt[]; } /** Generate scopes needed for a CrewTask */ export declare function crewTaskToScopes(task: CrewTask): string[]; /** Verify crew member has authority for task */ export declare function verifyCrewMember(agentName: string, task: CrewTask, config: CrewGovernanceConfig): { authorized: boolean; reason: string; scope: string; }; /** Wrap task execution with governance */ export declare function governCrewTask(task: CrewTask, execute: (task: CrewTask) => Promise, config: CrewGovernanceConfig): Promise; //# sourceMappingURL=crewai.d.ts.map