import { WebJobProgress } from "@xenosystem/web-context-client/progress"; declare const WEB_CONTEXT_TOOL_RESULT_SCHEMA: "xeno.web-context.tool-result.v1"; interface WebContextEvidenceProjection { evidenceId: string; requestId: string; sourceUrl: string; finalUrl?: string; citations: Array<{ url: string; title?: string; artifactId?: string; }>; } interface WebContextToolResult { schemaVersion: typeof WEB_CONTEXT_TOOL_RESULT_SCHEMA; operation: "search" | "fetch"; requestId: string; evidence: WebContextEvidenceProjection; job?: { jobId: string; state: string; }; artifact?: { artifactId: string; mediaType: string; bytes: number; }; jobProgress?: WebJobProgress; } interface ToolDefinition { name: string; description: string; input_schema: { type: "object"; properties: Record; required?: string[]; additionalProperties?: boolean | Record; [keyword: string]: unknown; }; } interface ImageUrlBlock { type: "image_url"; image_url: { url: string; detail?: "auto" | "low" | "high"; }; } interface ResourceContentBlock { type: "resource"; uri?: string; mimeType?: string; text?: string; data?: string; } type ToolAssistantContentBlock = TextBlock | ImageUrlBlock | ResourceContentBlock; type ToolOperationState = "registered" | "starting" | "running_foreground" | "running_background" | "waiting_for_input" | "stalled" | "verifying" | "completed" | "failed" | "timed_out" | "cancelled" | "orphaned"; type ToolCompletionPolicy = "await" | "observe" | "detach"; interface ExpectedOutputContract { path: string; kind?: "file" | "directory"; nonEmpty?: boolean; } interface ToolEvidence { id: string; kind: "artifact" | "process" | "verification"; status: "pending" | "verified" | "failed"; path?: string; observedAt: string; operationId: string; detail?: Record; } interface ToolOperationSnapshot { schemaVersion: 1; operationId: string; turnId: string; generation: number; toolCallId: string; toolName: string; ownerSessionId?: string; state: ToolOperationState; terminal: boolean; presentation: "foreground" | "background"; completionPolicy: ToolCompletionPolicy; promotable: boolean; processId?: string; taskId?: string; displayName?: string; pid?: number; commandFingerprint?: string; outputPath?: string; startedAt: string; lastActivityAt: string; deadlineAt?: string; elapsedMs: number; idleMs: number; outputBytes: number; nextOffset: number; exitCode?: number | null; completionReason?: string; suggestedNextAction?: string; expectedOutputs?: ExpectedOutputContract[]; evidence?: ToolEvidence[]; } interface ToolProgressUpdate { activity?: "stdout" | "stderr" | "input" | "waiting_for_input" | "heartbeat" | "state"; message?: string; bytes?: number; outputBytes?: number; nextOffset?: number; webContextProgress?: WebJobProgress; } interface ToolAuthorizationReceipt { turnId: string; toolCallId: string; toolName: string; iteration: number; policy: { allowed: true; reason: string; temporaryOverride: boolean; }; permission: { allowed: true; reason: string; }; } interface ToolResult { success: boolean; output: string; error?: string; errorCode?: string; errorDetails?: Record; assistantContent?: ToolAssistantContentBlock[]; assistantOnlyContent?: ToolAssistantContentBlock[]; operation?: ToolOperationSnapshot; evidence?: ToolEvidence[]; webContext?: WebContextToolResult; retryable?: boolean; } interface ToolExecutionContext { signal?: AbortSignal; operationId?: string; reportProgress?: (event: ToolProgressUpdate) => void; authorization?: ToolAuthorizationReceipt; } type ToolExecutor = (input: Record, context?: ToolExecutionContext) => Promise; interface ToolPolicyProjection { observabilityInput: Record; permissionInput: Record; permissionPreview?: string; approvalKey?: string; riskLevel?: "low" | "medium" | "high"; } interface RegisteredTool { definition: ToolDefinition; execute: ToolExecutor; projectPolicyInput?: (input: Record) => ToolPolicyProjection | { error: ToolResult; }; } interface TextBlock { type: "text"; text: string; } declare const XENO_SKILL_SCHEMA_VERSION: 2; type XenoSkillSource = "managed" | "built-in" | "user" | "project" | "plugin" | "compatible" | "legacy"; type XenoSkillExternalActionPolicy = "deny" | "ask" | "allow"; type XenoSkillInvocationDecision = "allow" | "ask" | "deny"; interface XenoSkillDiscoveryRoot { path: string; source: XenoSkillSource; precedence: number; namespace?: string; followSymlinks?: boolean; } interface XenoSkillResourceDescriptor { relativePath: string; kind: "script" | "reference" | "asset" | "template" | "other"; sizeBytes: number; sha256: string; } interface XenoSkillToolPolicy { allow?: string[]; deny?: string[]; } interface XenoSkillDescriptor { schemaVersion: typeof XENO_SKILL_SCHEMA_VERSION; key: string; name: string; description: string; source: XenoSkillSource; precedence: number; directory: string; entrypoint: string; namespace?: string; version?: string; license?: string; compatibility?: string; metadata: Record; modelInvocable: boolean; userInvocable: boolean; requestedPreapprovedTools: string[]; toolPolicy: XenoSkillToolPolicy; externalActions: XenoSkillExternalActionPolicy; contentHash: string; instructionBytes: number; resources: XenoSkillResourceDescriptor[]; } interface XenoSkillDiagnostic { severity: "warning" | "error"; code: "SKILL_ROOT_UNREADABLE" | "SKILL_INVALID" | "SKILL_SYMLINK_REJECTED" | "SKILL_RESOURCE_LIMIT" | "SKILL_AMBIGUOUS"; message: string; path?: string; key?: string; } interface XenoSkillShadowRecord { key: string; selected: XenoSkillDescriptor; shadowed: XenoSkillDescriptor[]; } interface XenoSkillCatalog { schemaVersion: typeof XENO_SKILL_SCHEMA_VERSION; generatedAt: string; catalogHash: string; skills: XenoSkillDescriptor[]; shadowed: XenoSkillShadowRecord[]; diagnostics: XenoSkillDiagnostic[]; } interface XenoLoadedSkill { descriptor: XenoSkillDescriptor; instructions: string; } interface XenoSkillDiscoveryOptions { roots: XenoSkillDiscoveryRoot[]; maxSkills?: number; maxSkillBytes?: number; maxResourceFiles?: number; maxResourceBytes?: number; now?: () => Date; } interface XenoSkillInvocationPolicy { allow?: string[]; deny?: string[]; externalActions?: XenoSkillExternalActionPolicy; } interface XenoSkillActivation { descriptor: XenoSkillDescriptor; arguments: string; toolAllowLayers: string[][]; effectiveAllowedTools?: string[]; effectiveDeniedTools: string[]; externalActions: XenoSkillExternalActionPolicy; } interface XenoSkillAuditEvent { schemaVersion: typeof XENO_SKILL_SCHEMA_VERSION; type: "skill-invoked" | "skill-denied" | "skill-load-failed"; recordedAt: string; skillKey: string; skillHash: string; invocation: "model" | "user"; argumentsHash?: string; reason?: string; } interface CreateXenoSkillToolOptions { getCatalog: () => XenoSkillCatalog; loadSkill?: (descriptor: XenoSkillDescriptor) => XenoLoadedSkill | Promise; invocationPolicy?: XenoSkillInvocationPolicy | (() => XenoSkillInvocationPolicy | undefined); authorize?: (descriptor: XenoSkillDescriptor, invocation: "model" | "user") => XenoSkillInvocationDecision | Promise; ask?: (descriptor: XenoSkillDescriptor) => Promise; onActivate?: (activation: XenoSkillActivation) => void | Promise; onAudit?: (event: XenoSkillAuditEvent) => void | Promise; now?: () => Date; projectDirectory?: string | (() => string); } type XenoSkillTool = RegisteredTool; interface LegacyXenoSkillInput { id: string; name?: string; description?: string; content: string; path?: string; source?: Extract; precedence?: number; namespace?: string; version?: string; allowedTools?: string[]; modelInvocable?: boolean; userInvocable?: boolean; toolPolicy?: XenoSkillToolPolicy; externalActions?: XenoSkillExternalActionPolicy; } declare function discoverXenoSkills(options: XenoSkillDiscoveryOptions): XenoSkillCatalog; declare function loadXenoSkill(descriptor: XenoSkillDescriptor): XenoLoadedSkill; declare function importLegacyXenoSkill(input: LegacyXenoSkillInput): XenoLoadedSkill; declare function renderXenoSkillCatalog(catalog: XenoSkillCatalog): string; declare function findXenoSkill(catalog: XenoSkillCatalog, reference: string): XenoSkillDescriptor | undefined; declare function createXenoSkillTool(options: CreateXenoSkillToolOptions): XenoSkillTool; declare function invokeXenoSkill(options: CreateXenoSkillToolOptions & { name: string; arguments?: string; invocation: "model" | "user"; }): Promise<{ loaded: XenoLoadedSkill; activation: XenoSkillActivation; output: string; }>; declare function compileXenoSkillActivation(descriptor: XenoSkillDescriptor, argumentsValue?: string, outerPolicy?: XenoSkillInvocationPolicy): XenoSkillActivation; declare function isToolAllowedByXenoSkillActivation(activation: XenoSkillActivation, toolName: string): boolean; export { type CreateXenoSkillToolOptions, type LegacyXenoSkillInput, XENO_SKILL_SCHEMA_VERSION, type XenoLoadedSkill, type XenoSkillActivation, type XenoSkillAuditEvent, type XenoSkillCatalog, type XenoSkillDescriptor, type XenoSkillDiagnostic, type XenoSkillDiscoveryOptions, type XenoSkillDiscoveryRoot, type XenoSkillExternalActionPolicy, type XenoSkillInvocationDecision, type XenoSkillInvocationPolicy, type XenoSkillResourceDescriptor, type XenoSkillShadowRecord, type XenoSkillSource, type XenoSkillTool, type XenoSkillToolPolicy, compileXenoSkillActivation, createXenoSkillTool, discoverXenoSkills, findXenoSkill, importLegacyXenoSkill, invokeXenoSkill, isToolAllowedByXenoSkillActivation, loadXenoSkill, renderXenoSkillCatalog };