export declare const ACTION_HASH_PREFIX = "sha256:"; export declare const ACTION_FIELDS: readonly ['case_id', 'action', 'decision', 'subject', 'amount', 'extra']; export declare const MAX_CASE_ID_LENGTH = 256; export declare const MAX_SUBJECT_LENGTH = 512; export declare const MAX_EXTRA_FIELDS = 16; /** Whether the code point is one of the refused Unicode format characters. */ export declare function isInvisibleFormatCodePoint(codePoint: number): boolean; /** The JSON object form of a semantic action (the decision grant's `action` claim). */ export interface DecisionAction { case_id: string; /** The manifest tool that carries out the decision, e.g. `case_decision`. */ action: string; /** The outcome approved, e.g. `approve` or `decline`. */ decision: string; /** What the decision is about, e.g. `gb:00000001`. */ subject: string; /** A finite number or a canonical decimal string. A number and a string are different values. */ amount?: number | string; /** Extra semantic fields the manifest declares for the tool (`decision_fields`), e.g. `{currency: 'GBP'}`. */ extra?: Record; } export type ActionValidationCode = 'not_an_object' | 'missing_field' | 'unknown_field' | 'invalid_type' | 'invalid_value' | 'duplicate_key'; /** The semantic action is malformed. `code` and `field` match the Python SDK. */ export declare class ActionValidationError extends Error { readonly code: ActionValidationCode; readonly field: string; constructor(code: ActionValidationCode, field: string, message: string); } /** * Validates the JSON object form and returns a normalised copy, refusing * unknown or missing fields. `amount` and `extra` may be absent; `null` or an * empty `extra` is refused, so a field has one encoding. */ export declare function parseDecisionAction(value: unknown): DecisionAction; /** Parses the JSON object form from text, refusing duplicate member names. */ export declare function parseDecisionActionJson(text: string): DecisionAction; /** * Derives the semantic action from a tool call: `action` is the tool name; * `case_id`, `decision`, `subject` and (when present and not null) `amount` * are read from the arguments, and so is every name in `extraFields` (the * manifest's `decision_fields`), which must be present and not null. Every * other argument is ignored. */ export declare function decisionActionFromToolCall(tool: string, args: unknown, extraFields?: readonly string[]): DecisionAction; /** RFC 8785 canonical JSON of the action. */ export declare function canonicalActionJson(action: DecisionAction): string; /** `sha256:` followed by the unpadded base64url SHA-256 of the canonical JSON. */ export declare function computeActionHash(action: DecisionAction | Record): string; /** Whether `value` has the shape of an `action_hash`. */ export declare function isActionHash(value: unknown): value is string; //# sourceMappingURL=action.d.ts.map