import { type Static } from "@sinclair/typebox"; import type { EventId } from "./EventId.js"; /** * What a worklet is doing right now. * * `starting` covers the window a freshly launched worklet has to register its tools and report * ready. `running` means it is up and its tools are callable. `asleep` is reserved for a worklet * that has nothing outstanding and has been parked; nothing puts a worklet to sleep yet. */ export declare const workletStateSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"starting">, import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"asleep">, import("@sinclair/typebox").TLiteral<"stopped">, import("@sinclair/typebox").TLiteral<"failed">]>; export type WorkletState = Static; export declare const workletToolSchema: import("@sinclair/typebox").TObject<{ name: import("@sinclair/typebox").TString; description: import("@sinclair/typebox").TString; }>; export type WorkletTool = Static; /** A worklet always writes only inside its own durable `Data` folder. */ export declare const workletDiskPermissionSchema: import("@sinclair/typebox").TLiteral<"none">; export type WorkletDiskPermission = Static; /** * Where a worklet may reach on the network. A scoped worklet's traffic runs through Rig's managed * proxy, which allows exactly the declared hosts and refuses the rest. */ export declare const workletNetworkPermissionSchema: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TObject<{ hosts: import("@sinclair/typebox").TArray; }>]>; export type WorkletNetworkPermission = Static; /** Everything a worklet may touch beyond its own folder and the socket it reaches Rig on. */ export declare const workletPermissionsSchema: import("@sinclair/typebox").TObject<{ disk: import("@sinclair/typebox").TLiteral<"none">; network: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TObject<{ hosts: import("@sinclair/typebox").TArray; }>]>; }>; export type WorkletPermissions = Static; /** * One imported version, carrying the manifest it was imported with. * * What a worklet says about itself and what it is allowed to do are properties of its code, so * they are recorded per version. Reverting therefore restores the older version's permissions * along with its source, and never leaves a newer grant in force. */ export declare const workletVersionSchema: import("@sinclair/typebox").TObject<{ version: import("@sinclair/typebox").TInteger; changeDescription: import("@sinclair/typebox").TString; createdAt: import("@sinclair/typebox").TNumber; description: import("@sinclair/typebox").TString; permissions: import("@sinclair/typebox").TObject<{ disk: import("@sinclair/typebox").TLiteral<"none">; network: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TObject<{ hosts: import("@sinclair/typebox").TArray; }>]>; }>; }>; export type WorkletVersion = Static; /** * A worklet is background compute Rig keeps running: TypeScript imported as a source folder, * versioned like an applet, writing only into its own `Data` folder, and declaring tools any * agent can call. */ export declare const workletSchema: import("@sinclair/typebox").TObject<{ name: import("@sinclair/typebox").TString; description: import("@sinclair/typebox").TString; /** What the current version's manifest asks for, and what Rig is enforcing right now. */ permissions: import("@sinclair/typebox").TObject<{ disk: import("@sinclair/typebox").TLiteral<"none">; network: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TObject<{ hosts: import("@sinclair/typebox").TArray; }>]>; }>; iconThumbhash: import("@sinclair/typebox").TString; iconUrl: import("@sinclair/typebox").TString; authorSessionId: import("@sinclair/typebox").TString; sourceDescription: import("@sinclair/typebox").TOptional; currentVersion: import("@sinclair/typebox").TInteger; versions: import("@sinclair/typebox").TArray; network: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"none">, import("@sinclair/typebox").TObject<{ hosts: import("@sinclair/typebox").TArray; }>]>; }>; }>>; createdAt: import("@sinclair/typebox").TNumber; updatedAt: import("@sinclair/typebox").TNumber; /** The folder the worklet writes into. It survives every version change. */ dataDirectory: import("@sinclair/typebox").TString; state: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"starting">, import("@sinclair/typebox").TLiteral<"running">, import("@sinclair/typebox").TLiteral<"asleep">, import("@sinclair/typebox").TLiteral<"stopped">, import("@sinclair/typebox").TLiteral<"failed">]>; /** The worklet's own words about itself, shown in the interface. */ status: import("@sinclair/typebox").TOptional; /** Why the worklet is not running, when it failed or stopped. */ failure: import("@sinclair/typebox").TOptional; tools: import("@sinclair/typebox").TArray>; }>; export type Worklet = Static; /** * An install names a folder and an icon, and nothing else. * * The worklet's name, what it does, why it exists, and what it is allowed to touch all come from * the `worklet.json` at the root of that folder, so the code and its declared powers arrive * together and no caller can describe a worklet as something other than what it is. */ export declare const installWorkletRequestSchema: import("@sinclair/typebox").TObject<{ authorSessionId: import("@sinclair/typebox").TString; path: import("@sinclair/typebox").TString; iconPath: import("@sinclair/typebox").TString; sourceDescription: import("@sinclair/typebox").TOptional; }>; export type InstallWorkletRequest = Static; export declare const updateWorkletRequestSchema: import("@sinclair/typebox").TObject<{ path: import("@sinclair/typebox").TString; changeDescription: import("@sinclair/typebox").TString; }>; export type UpdateWorkletRequest = Static; export declare const revertWorkletRequestSchema: import("@sinclair/typebox").TObject<{ version: import("@sinclair/typebox").TInteger; }>; export type RevertWorkletRequest = Static; export interface WorkletResponse { worklet: Worklet; } export interface ListWorkletsResponse { /** Which change this reading reflects, so a live event can be ordered against it. */ version: EventId; worklets: readonly Worklet[]; } export interface WorkletLogResponse { log: string; /** True when the read bound omitted older output. */ truncated: boolean; } export type WorkletManagementErrorCode = "invalid_request" | "invalid_worklet" | "worklet_not_found"; export interface WorkletManagementErrorResponse { error: { code: WorkletManagementErrorCode; message: string; }; } /** * Worklets changed. Live-only, carrying the whole current set so a reconnecting client reads the * current worklets instead of replaying every past install and state change. */ export interface WorkletsChangedEvent { createdAt: number; data: { /** The catalog reading this event carries, comparable with a list response. */ version: EventId; worklets: readonly Worklet[]; }; id: EventId; type: "worklets_changed"; }