Generated from SDK source comments by
scripts/generate-play-sdk-reference.ts. Do not edit this file manually.DeeplineClient from Node/TypeScript services, scripts, schedulers, or tests. Code inside a Play uses the runtime in the SDK reference.
Low-Level Client
DeeplineClient
Low-level typed REST client with authentication, retries, and localhost failover.
Signature: class DeeplineClient
Members
| Member | Kind | Purpose | Parameters | Returns / type |
|---|---|---|---|---|
constructor | constructor | Create a low-level SDK client. Most callers can omit options and let the SDK resolve auth/config from environment variables and CLI-managed credentials. | options?: DeeplineClientOptions - Optional overrides for API key, base URL, timeout, and retries. | |
runs | property | Canonical run lifecycle namespace backed by /api/v2/runs. | RunsNamespace | |
db | property | Current mutable customer database namespace backed by /api/v2/db/query. | DbNamespace | |
billing | property | Billing namespace: subscription status/cancel and invoice history. | BillingNamespace | |
workspaces | property | Workspace lifecycle namespace. | WorkspacesNamespace | |
baseUrl | getter | The resolved base URL this client is targeting (e.g. "http://localhost:3000"). | string | |
executions | getter | Public recovery namespace. | { getByKey: (key: string) => Promise<ExecutionByKeyResult>; } | |
listSecrets | method | List secret metadata visible to the current workspace. | Promise<PlaySecretMetadata[]> | |
checkSecret | method | Check whether a named secret exists, is active, and has a stored value. | name: string - Secret name. It is normalized to uppercase before lookup. | Promise<PlaySecretMetadata | null> |
inspectSecret | method | Check effective scope and active-version health without reading the value. Without playName, checks the organization-scoped secret only. With a Play name, an active Play secret takes precedence. A deleted/disabled Play secret falls back to the organization-scoped secret. | name: stringoptions?: { playName?: string } | Promise<PlaySecretCheck> |
updateSecretNote | method | Add, replace, or clear the non-sensitive note attached to one secret. | secretId: stringnote: string | Promise<PlaySecretMetadata> |
listTools | method | List all available tools. Returns tool definitions including ID, provider, description, input/output schemas, and list extractor paths for automatic CSV conversion. | options?: { categories?: string; tags?: string; grep?: string; grepMode?: 'all' | 'any' | 'phrase'; compact?: boolean; } | Promise<ToolDefinition[]> |
listToolCategorieslistToolsInCategory | method method | List category counts without downloading tool definitions. Read one complete category and its live category counts in one request. | category: stringoptions?: { compact?: boolean } | Promise<ToolCategorySummary[]>Promise<ToolCategoryListing> |
listProviders | method | List discoverable providers without requiring a local plugin catalog. | options?: { changed?: boolean; } | Promise<ProviderDefinition[]> |
searchTools | method | Search available tools using Deepline’s ranked backend search. The CLI uses the same search. The search ranks tool metadata, categories, agent guidance, and input schema fields. | options?: ToolSearchOptions | Promise<ToolSearchResult> |
search | method | Search everything Deepline can run or deploy in one ranked list: tools, monitor types, prebuilt plays, and your workspace’s own plays. | options?: SearchOptions | Promise<SearchResult> |
getTool | method | Get detailed metadata for a single tool. Returns everything from ToolDefinition plus pricing info, sampleinputs/outputs, failure modes, and cost estimates. | toolId: string - Tool identifier (e.g. "dropleads_search_people")options?: { cliInvocationId?: string } | Promise<ToolMetadata> |
describeModel | method | Describe a Deepline Agent model and its provider-specific option surface. The method combines live AI Gateway model metadata with Deepline’s generated registry of AI SDK provider options. Agents can use this information to construct providerOptions payloads before they execute deeplineagent.The returned schemas describe accepted shapes for provider options. These schemas do not guarantee that every model supports each option. Runtime AI SDK and Gateway errors determine support for model-specific values. | model: string - Exact-case Gateway model id such as "openai/gpt-5.6-luna" | Promise<DeeplineAgentModelDescription> |
quoteInferenceTool | method | Quote dynamic AI inference pricing for a concrete payload. The result contains a planning estimate and a separate, proven authorization maximum. Both values use Deepline credits. | toolId: 'ai_evaluate' | 'ai_inference' | 'deeplineagent'payload: Record<string, unknown> | Promise<InferenceQuote> |
executeTool | method | Execute a tool and return the standard execution envelope. The toolResponse.rawV2 field contains the complete tool response,preserving its original nesting. Inspect getTool().examples for a fullDeepline response example. Optional toolResponse.responseMeta containsresponse metadata. Top-level fields such as status, job_id, and billing describe theDeepline execution envelope. | toolId: stringinput: Record<string, unknown>options?: ExecuteToolRawOptions | Promise<ToolExecution<TData, TMeta>> |
getExecutionByKey | method | Read the durable state of a keyed tool execution. | idempotencyKey: string | Promise<ExecutionByKeyResult> |
executeToolRaw | method | Back-compatible alias for executeTool.Retained for callers that still use the older raw naming while the response envelope remains the same. | toolId: stringinput: Record<string, unknown>options?: ExecuteToolRawOptions | Promise<ToolExecution<TData, TMeta>> |
queryCustomerDb | method | Run a bounded SQL query against the current mutable customer database. This query is not scoped to one play run. Use client.runs export actionswhen the caller needs the rows produced by a specific run. | input: CustomerDbQueryOptions | Promise<CustomerDbQueryResult> |
repairIngestionStorage | method | Re-establish this workspace’s tenant storage contract: role/DB connect grants plus materialized table grants. Org-admin only. Use when a run fails with WORKSPACE_STORAGE_NOT_READY. | input?: { provider?: string; } | Promise<IngestionStorageRepairResult> |
startPlayRun | method | Start a play run. Internal/advanced primitive. For normal callers, prefer the public entrypoints: the CLI, Deepline.connect, submitPlay,or runPlay.These interfaces share the run contract and return a workflow or run ID: - deepline plays run.- Repository scripts such as bun run deepline -- plays run.- SDK context calls such as Deepline.connect().play(name).run().- Direct POST /api/v2/plays/run calls.Read completed output from getPlayStatus(runId).result.For SDK context calls, read output from PlayJob.get().Execution logs appear under progress.logs. The user output object does not contain these logs. | request: StartPlayRunRequest - Play run configuration (name, code, input, etc.)options?: PlayRunStartOptions | Promise<PlayRunStart> |
preparePlayRunAdmission | method | Prepare a tenant-scoped start intent without executing it. Its stream sender retains the exact body and transport selected during preparation. | request: StartPlayRunRequestoptions?: { cliAdmission?: boolean; onSubmission?: (intent: { workflowId: string; orgId: string; request: Record<string, unknown>; }) => void | Promise<void>; } | Promise<{ startStream(streamOptions?: { signal?: AbortSignal; }): AsyncGenerator<PlayLiveEvent, void, unknown>; body: Record<string, unknown>; workflowId?: string; supportsCallerIntent: boolean; }> |
startPlayRunStream | method | Submit a play run through the legacy event response. This reports admission from the start request. It does not watch an existing run. Use startPlayRun() and watchRunEvents(runId) separately. | request: StartPlayRunRequest - Play run configuration.options?: { signal?: AbortSignal; onSubmission?: (intent: { workflowId: string; orgId: string; request: Record<string, unknown>; }) => void | Promise<void>; } - Optional compatibility response options. | AsyncGenerator<PlayLiveEvent> |
registerPlayArtifact | method | Register a bundled play artifact. Internal/advanced primitive used by packaging flows. Public callers should prefer the CLI, submitPlay, or runPlay. | input: { name: string; sourceCode: string; sourceFiles?: Record<string, string>; description?: string; artifact: Record<string, unknown>; compilerManifest?: PlayCompilerManifest; publish?: boolean; artifactOnly?: boolean; ownerType?: 'org' | 'deepline'; scope?: 'org' | 'system'; userId?: string; } | Promise<{ success?: boolean; name?: string; artifactStorageKey: string; artifactMetadata?: Record<string, unknown> | null; staticPipeline?: unknown; definitionId?: string | null; revisionId?: string | null; version?: number | null; liveVersion?: number | null; triggerMetadata?: unknown; triggerBindings?: unknown; }> |
registerPlayArtifacts | method | Register multiple bundled play artifacts in one request. Used by packaging and prebuilt publication flows. Each artifact is compiled first when a compiler manifest is not already supplied. | artifacts: Array<{ name: string; sourceCode: string; sourceFiles?: Record<string, string>; description?: string; artifact: Record<string, unknown>; compilerManifest?: PlayCompilerManifest; publish?: boolean; ownerType?: 'org' | 'deepline'; scope?: 'org' | 'system'; userId?: string; }> | Promise<{ success: boolean; artifacts: Array<{ success?: boolean; name?: string; artifactStorageKey: string; artifactMetadata?: Record<string, unknown> | null; staticPipeline?: unknown; definitionId?: string | null; revisionId?: string | null; version?: number | null; liveVersion?: number | null; triggerMetadata?: unknown; triggerBindings?: unknown; }>; }> |
compilePlayManifest | method | Compile a bundled play artifact into the server-side compiler manifest. The manifest records imports, trigger bindings, static pipeline shape, and runtime metadata. The compiler needs these records before it checks, registers, or runs a Play artifact. | input: { name: string; sourceCode: string; sourceFiles?: Record<string, string>; artifact: Record<string, unknown>; importedPlayDependencies?: PlayCompilerManifest[]; } | Promise<PlayCompilerManifest> |
checkPlayArtifact | method | Check a bundled play artifact against the server’s current play compiler. Unlike registerPlayArtifact, this does not store the artifact,publish a revision, or start a run. It is the authoritative cloud validation path used by deepline plays check. | input: { name?: string; sourceCode: string; sourceFiles?: Record<string, string>; description?: string; artifact: Record<string, unknown>; exportName?: string | null; integrationMode?: 'live' | 'eval_stub' | 'fixture'; importedPlays?: Array<{ playName?: string | null; sourceCode: string; sourcePath?: string | null; }>; } | Promise<PlayCheckResult> |
startPlayRunFromBundle | method | Register an already-bundled play artifact and start a run from it. SDK and CLI packaging wrappers use this low-level run method for file-based Plays. Local bundling must produce the runtime artifact first. | input: { name: string; sourceCode: string; sourceFiles?: Record<string, string>; description?: string; artifact: Record<string, unknown>; compilerManifest?: PlayCompilerManifest; input?: Record<string, unknown>; inputFile?: PlayStagedFileRef | null; packagedFiles?: PlayStagedFileRef[]; force?: boolean; forceToolRefresh?: boolean; } | Promise<PlayRunStart> |
submitPlay | method | Register a bundled play artifact and start a run from the live revision. This method wraps registerPlayArtifact and startPlayRun.Packaging wrappers use this method for file-based Plays. Pass the returned ID to getPlayStatus.The method returns the same durable { result } object that the CLI prints after plays run completes. | code: string - Fallback source string. Pass the bundled artifact in options.artifact.csvPath: string | null - Path to the input CSV file, or null.name?: string - Play name. The SDK derives it from the source when omitted.options?: { sourceCode?: string; sourceFiles?: Record<string, string>; description?: string; artifact?: Record<string, unknown>; compilerManifest?: PlayCompilerManifest; input?: Record<string, unknown>; inputFile?: PlayStagedFileRef | null; packagedFiles?: PlayStagedFileRef[]; force?: boolean; forceToolRefresh?: boolean; } - Additional submission options. | Promise<PlayRunStart> |
stagePlayFiles | method | Upload files to the staging area for use in play runs. Internal/advanced primitive used by packaging flows. Public callers should prefer the CLI, submitPlay, or runPlay.Staged files are referenced by their returned PlayStagedFileRefin subsequent startPlayRun calls via inputFile or packagedFiles. | files: Array<{ logicalPath: string; contentBase64: string; contentHash: string; contentType: string; bytes: number; }> - Array of files to stage (base64-encoded content) | Promise<PlayStagedFileRef[]> |
mintStagedPlayFileUploads | method | Mint short-lived presigned upload targets for staged play files. Internal primitive used by stagePlayFiles. For a content-addressed file already in storage, the server returns a staged reference. That file needs no upload.For other files, the server returns a presigned PUT URL. Upload the file body to that URL. | files: Array<{ logicalPath: string; contentHash: string; contentType: string; bytes: number; }> | Promise<MintStagedFileUpload[]> |
resolveStagedPlayFiles | method | Resolve staged play files by content hash without uploading bytes. The response identifies missing files. Callers need to upload only these files. | files: Array<{ logicalPath: string; contentHash: string; contentType: string; bytes: number; }> | Promise<{ files: PlayStagedFileRef[]; missing: Array<{ logicalPath: string; contentHash: string }>; }> |
getPlayStatus | method | Get the current status of a play execution. Internal/advanced primitive. Public callers should usually prefer runPlay, PlayJob.get, or deepline plays run. | workflowId: string - Play-run id from startPlayRunoptions?: { billing?: boolean; full?: boolean } | Promise<PlayStatus> |
watchRunEvents | method | Poll authenticated snapshots and emit changes. deferLogs delays terminal logs. omitTerminalLogs skips them. | workflowId: stringoptions?: { signal?: AbortSignal; onNotice?: (message: string) => void; onRetry?: RunsWatchOptions['onRetry']; deferLogs?: boolean; omitTerminalLogs?: boolean; onPoll?: (observation: WatchPollObservation) => void; terminalStatus?: { full?: boolean; billing?: boolean; runStatus?: boolean; onStatus: (status: PlayStatus) => void | Promise<void>; }; } | AsyncGenerator<PlayLiveEvent> |
streamPlayRunEvents | method | Read raw legacy SSE events for callers that explicitly require that compatibility endpoint. Ordinary run watching uses REST snapshot polling. | workflowId: stringoptions?: { signal?: AbortSignal; lastEventId?: string; mode?: 'cli' | 'ui'; } | AsyncGenerator<PlayLiveEvent> |
observeRunEvents | method | Compatibility alias for polling canonical run snapshots and emitting their changed events. | runId: stringoptions?: { signal?: AbortSignal; onNotice?: (message: string) => void; fallback?: 'sse' | 'none'; } | AsyncGenerator<PlayLiveEvent> |
tailRun | method | Wait for a run and return its terminal status. This source-compatible alias uses the same authenticated two-second REST snapshot polling as client.runs.watch. | runId: string - Public Deepline play-run id.options?: RunsTailOptions - Optional callbacks and cancellation signal. | Promise<PlayStatus> |
cancelPlay | method | Cancel a running play execution. Sends a stop request for the run. | workflowId: string - Public Deepline play-run id to cancel | Promise<void> |
stopPlay | method | Stop a running play execution, including open HITL waits. | workflowId: string - Public Deepline play-run id to stopoptions?: { reason?: string } | Promise<StopPlayRunResult> |
listPlayRuns | method | List recent runs for a named play. Returns runs sorted by start time (newest first), including workflow IDs, status, timestamps, and metadata. | playName: string - The play name to query | Promise<PlayRunListItem[]> |
getRunStatus | method | Get a run by id using the public runs resource model. This is the SDK equivalent of: bash<br />deepline runs get <run-id><br /> | runId: stringoptions?: RunsGetOptions | Promise<PlayStatus> |
getRunChildren | method | Read one paginated, launch-scoped page of direct child Runs. | parentRunId: stringoptions: RunsChildrenOptions | Promise<RunChildrenPage> |
getRunLifecycleStatus | method | Fetch only the legacy scalar lifecycle status for a run. | runId: string | Promise<RunLifecycleStatus> |
listRuns | method | List play runs using the public runs resource model. This is the SDK equivalent of: bash<br />deepline runs list --play <play-name> --status failed<br /> | options: RunsListOptions | Promise<PlayRunListItem[]> |
getRunsHistory | method | The same tenant-scoped run history searched by the dashboard and CLI. | options?: RunsHistoryOptions | Promise<RunsHistoryPage> |
listRunsPage | method | Read one run page without discarding server pagination metadata. | options: RunsListOptions | Promise<RunsListPage> |
getRunReceipts | method | Read retained tool results without executing tools, preserving supplied key order and batching 100 keys per request. Obtain keys from exported evidence or execution metadata. Each key must be nonempty, at most 2,048 characters and contain no CR, LF or NUL. Missing/expired results have an explicit per-key error. | runId: stringoptions: { keys: string[] } | Promise<import('./runs/receipts').RunToolReceiptsResponse> |
getRunInput | method | Get the exact original input retained for a run. This is intentionally separate from status. | runId: string | Promise<{ runId: string; input: Record<string, unknown> | unknown[]; bytes: number; sha256: string | null; replayedFromRunId: string | null; }> |
rerun | method | Start a fresh run from a prior run’s retained input and pinned revision. Every invocation sends an Idempotency-Key.When the caller supplies no key, the SDK creates a fresh key once per call. The transport reuses that key for network retries, so those retries produce one rerun. Reuse an explicit key across separate invocations when the previous result is uncertain. A different key starts another rerun. | runId: stringoptions?: RerunOptions | Promise<RerunPlayRunResult> |
getRunLogs | method | Read a run’s retained text tail (default 200), full retained stream (all), or terminal failure window (failed, at most 20). These are existing reads. sampling and retention loss cannot be recovered. See run logs and events for structured search and payload retrieval.This is the SDK equivalent of: bash<br />deepline runs logs <run-id> --limit 200<br /> | runId: stringoptions?: RunsLogsOptions | Promise<RunsLogsResult> |
searchRunEvents | method | Read structured history across the active organization without requiring a run ID. Defaults to the last hour, newest first. Use the returned cursor and exact time bounds to continue. See run logs and events for all kinds, indexed fields, payloads and SDK/API response types. | options?: RunsEventSearchOptions | Promise<RunsEventSearchResult> |
getPlayRunRowHistory | method | Read one page of immutable admitted and terminal rows for a Play Run dataset. Follow nextCursor. coverage explicitly identifies unavailable or incomplete history. | input: PlayRunRowHistoryOptions | Promise<RuntimeSheetRunRowMembershipPage> |
getPlaySheetRows | method | Export persisted runtime-sheet rows for a play dataset/table namespace. This is the SDK form of exporting deepline.dataset(...).run() output for aspecific play and optional run id. | input: { playName: string; tableNamespace: string; runId?: string; limit?: number; offset?: number; rowMode?: 'output' | 'all' | 'live'; signal?: AbortSignal; } | Promise<PlaySheetRowsResult> |
stopRun | method | Stop a run by id using the public runs resource model. This is the SDK equivalent of: bash<br />deepline runs stop <run-id> --reason "stale lock"<br /> | runId: stringoptions?: { reason?: string } | Promise<StopPlayRunResult> |
stopAllRuns | method | Stop every active run visible to the current workspace. With dryRun: true, list the exact candidates without cancelling any run.This is the SDK equivalent of: bash<br />deepline runs stop-all --dry-run<br />deepline runs stop-all --reason "stale lock"<br />Use this method when a failed parent leaves active child or waiting runs. The method clears workspace run-slot state without requiring each run ID. | options?: StopAllRunsOptions | Promise<StopAllPlayRunsResult> |
listPlays | method | List one page of callable Plays. With grep, the method retains all matching results. Use listPlaysPage for pagination metadata. Pass origin: "prebuilt" for Deepline-managed prebuilts ororigin: "owned" for org-owned plays. | options?: PlaysListOptions | Promise<PlayListItem[]> |
listPlaysPage | method | Read one bounded inventory page. cursor continues the same filters. | options?: PlaysListOptions & { limit?: number; cursor?: string | null; } | Promise<PlaysListPage> |
getPlaysActivity | method | Count durable Play runs and Monitor deliveries in local calendar days. | options?: { timeZone?: string; days?: number; endDate?: string; groupBy?: 'kind' | 'trigger_source'; } | Promise<PlaysActivityResponse> |
getPlaySettings | method | Read definition-level settings, independently of code revisions. | playName: string | Promise<PlaySettingsResult> |
updatePlaySettings | method | Retry-safe field patch. omitted fields retain their current value. | playName: stringpatch: PlaySettingsPatch | Promise<PlaySettingsResult> |
getPlayTriggerConfig | method | Read a Play’s cron and webhook triggers and their scheduler state. | playName: string | Promise<PlayTriggerConfigView> |
updatePlayTriggerConfig | method | Declare a Play’s cron and/or webhook trigger (null removes it) and publish the rewritten source as a new live revision. Retry-safe: a request the live revision already satisfies returns changed: false. | playName: stringupdate: PlayTriggerConfigUpdate | Promise<PlayTriggerConfigUpdateResult> |
listPlaySettingsPaths | method | List one bounded page of existing Play locations. continue with cursor. | options?: { root?: 'person' | 'team'; limit?: number; cursor?: string } | Promise<PlaySettingsPathsPage> |
setPlayPinned | method | Set whether an org-owned Play sorts before unpinned Plays. | playName: stringpinned: boolean | Promise<{ name: string; pinned: boolean }> |
getNotificationSettings | method | Read product-notification destinations, subscriptions, event catalog, and DLQ health. | Promise<ProductNotificationSettings> | |
setIntegrationCredentials | method | Save provider-owned credential fields without starting an OAuth browser flow. | provider: stringcredentials: Record<string, string> | Promise<{ ok: boolean; credential_saved?: boolean }> |
startIntegrationOAuth | method | Start provider OAuth and return the URL to open in a browser. | provider: stringoptions?: { preset?: string; scopes?: string[]; optionalScopes?: string[]; } | Promise<{ ok: boolean; redirect_url: string }> |
connectNotificationSlack | method | Start the Slack OAuth flow required by product notifications. | options?: { successUrl?: string; failureUrl?: string; } | Promise<{ ok: boolean; redirect_url: string }> |
listNotificationSlackChannels | method | List Slack channels visible to the connected Deepline Slack app. | query?: string | Promise<{ identity: { teamId: string; teamName?: string }; channels: Array<{ id: string; name: string; isPrivate: boolean }>; }> |
setNotificationSlack | method | Select a Slack channel or direct member used for product notifications. | destination: string | { memberId: string } | Promise<unknown> |
testNotificationSlack | method | Send one synchronous test ping and return Slack’s delivery result. | Promise<{ ok: boolean; deliveryId: string; state: string; message: string; }> | |
disableNotificationSlack | method | Disable Slack product notifications without deleting the OAuth connection. | Promise<unknown> | |
setNotificationSubscriptions | method | Enable or disable event IDs from the server-provided notification catalog. | eventTypes: string[]enabled: boolean | Promise<unknown> |
listNotificationDlq | method | List exhausted deliveries. Dead-lettered messages never replay automatically. | limit?: number | Promise<unknown> |
getNotificationDlqDelivery | method | Inspect one exhausted notification delivery. | deliveryId: string | Promise<unknown> |
updateNotificationDlqDelivery | method | Explicitly retry or archive one dead-lettered notification delivery. | deliveryId: stringaction: 'retry' | 'archive' | Promise<unknown> |
getNotifications | method | List the workspace’s named notification rules. | Promise<ProductNotificationSettings> | |
getNotificationConfiguration | method | Read the group-based product-notification configuration and rule catalog. | Promise<ProductNotificationConfigurationResponse> | |
changeNotificationConfiguration | method | Atomically apply one retry-safe desired configuration change. | expectedWorkspaceVersion: numberchange: ProductNotificationConfigurationChange | Promise<Pick<ProductNotificationConfigurationResponse, 'configuration'>> |
createNotificationGroup | method | Create one notification group and its destinations as a retry-safe unit. | input: CreateNotificationGroupInput | Promise<CreateNotificationGroupResult> |
listNotificationChannels | method | List Slack channels available to an already-connected Slack integration. | query?: string | Promise<{ identity: { teamId: string; teamName?: string }; channels: Array<{ id: string; name: string; isPrivate: boolean }>; }> |
createNotification | method | Create a named notification routed through an existing provider integration. | input: CreateNotificationInput | Promise<unknown> |
updateNotification | method | Update a notification’s target, event selection, or enabled state. | notificationId: stringinput: UpdateNotificationInput | Promise<unknown> |
testNotification | method | Send a validation ping to one notification. | notificationId: string | Promise<{ ok: boolean; deliveryId: string; state: string; message: string; }> |
deleteNotification | method | Archive one notification without touching its provider integration. | notificationId: string | Promise<{ deleted: boolean; id: string }> |
searchPlays | method | Search callable plays and return compact play descriptions. Prebuilt plays are preferred by default because they have maintained contracts and stable run behavior. | options: { query: string; compact?: boolean; pipeline?: boolean; scope?: 'prebuilt' | 'owned' | 'all'; cliInvocationId?: string; } | Promise<PlayDescription[]> |
getPlay | method | Get the full definition and state of a named play. The response includes revision state (draft or live), recent runs, a summary of sheet processing, and the database URL. | name: string - Play nameoptions?: { source?: 'working' | 'live' | version:$; guidance?: boolean; } | Promise<PlayDetail> |
listPlayTriggerInventory | method | Read one trigger inventory page without loading run histories. | options?: { cursor?: string } | Promise<{ page: Array<{ bindingId: string; name: string; type: string; status: string; cron: string | null; timezone: string | null; nextScheduledAt: number | null; }>; continueCursor: string; isDone: boolean; }> |
getPlayTriggerHistory | method | Read one trigger’s recent runs, with an explicit partial-history flag. | bindingId: stringoptions?: { limit?: number } | Promise<{ recentRuns: Array<{ workflowId: string; runId: string | null; status: string; createdAt: number; startedAt: number | null; finishedAt: number | null; }>; truncated: boolean; cronInput: Record<string, unknown> | null; }> |
describePlay | method | Get a normalized play description suitable for agents and CLIs. The description includes runnable examples, input and output summaries, clone guidance, and revision state. It also includes metadata for the latest run when available. Set { pipeline: true } to include the compiled pipeline.The pipeline can be hundreds of kilobytes. The response omits it by default. | name: stringoptions?: PlayDescriptionOptions | Promise<PlayDescription> |
clearPlayHistory | method | Clear run history and durable sheet/result data for a play without deleting the play definition or revisions. | name: stringrequest?: ClearPlayHistoryRequest | Promise<ClearPlayHistoryResult> |
listPlayVersions | method | List saved versions for a named play. Returns immutable revision snapshots newest-first, including the revision id needed for exact-version runs and live-version switching. | name: string - Play nameoptions?: { full?: boolean } | Promise<PlayRevisionSummary[]> |
publishPlayVersion | method | Make a play revision live. When revisionId is omitted, the current working revision becomes live.A call by Play name executes the live revision unless the caller specifies another revision. | name: string - Play namerequest?: PublishPlayVersionRequest - Optional explicit revision to make live | Promise<PublishPlayVersionResult> |
deletePlay | method | Move an org-owned play to Trash. This disables its active triggers while retaining its revisions and run history so it can be restored. Deepline prebuilt plays are read-only. | name: string | Promise<DeletePlayResult> |
restorePlay | method | Restore an org-owned play that was previously moved to Trash. | name: string | Promise<RestorePlayResult> |
getSharePage | method | Current share status for a play: the public page (if any), the published copy, and the revision picker. Read-only. | name: stringoptions?: { revisionId?: string } | Promise<SharePageStatus> |
publishSharePage | method | Publish (or repoint) the play’s public share page to a revision. RequiresacknowledgedUnlisted: true — the page is publicly viewable. Org-admin only. | name: stringrequest: PublishSharePageRequest | Promise<SharePageStatus> |
updateSharePage | method | Update share-page settings (SEO indexing, credit-cost / latency display) without moving the published pointer. Org-admin only. | name: stringrequest: UpdateSharePageRequest | Promise<SharePageStatus> |
unpublishSharePage | method | Unshare: hard-delete the play’s public page and its cards. Returns the fresh status (now share: null). Org-admin only. Idempotent — a no-op whenthe play was never published. | name: string | Promise<SharePageStatus> |
regenerateSharePage | method | Regenerate the LLM landing-page copy for a revision (defaults to the published one). Org-admin only. | name: stringrequest?: { revisionId?: string } | Promise<SharePageStatus> |
runPlay | method | Run a play end-to-end: submit, poll progress until terminal, return result. This is the highest-level play execution method. It submits the play, reads the canonical run snapshot for status updates, and returns a structured result with logs and timing. Supports cancellation via AbortSignal. | code: string - Source string fallback. pass the bundled artifact in options.artifactcsvPath: string | null - Input CSV path, or nullname?: string - Play nameoptions?: { onProgress?: (status: PlayStatus) => void; signal?: AbortSignal; input?: Record<string, unknown>; sourceCode?: string; artifact?: Record<string, unknown>; compilerManifest?: PlayCompilerManifest; inputFile?: PlayStagedFileRef | null; packagedFiles?: PlayStagedFileRef[]; force?: boolean; forceToolRefresh?: boolean; } - Execution options | Promise<PlayRunResult> |
getBillingPlans | method | Published plans plus the caller’s active plan: prices, monthly grant credits, rollover policy, and which plans are open for subscription. Prefer client.billing.plans(). | Promise<BillingPlansResult> | |
getBillingUsageEvent | method | Read the authenticated usage record for one execution request. The request id comes from the original executeTool result and is not aretry or idempotency token. | requestId: string | Promise<BillingUsageEvent> |
getRunBilling | method | Read Deepline credits billed to each run and whether charges are still settling. The response never shows provider spend. The dashboard runs grid uses the same read. HTTP endpoint: GET /api/v2/runs/billing. | runIds: readonly string[] | Promise<RunBillingResult> |
getBillingUsage | method | Read workspace usage and recent customer-facing Deepline charges. Pass the job_id from executeTool as requestId to retrieve one exact call,including whether its charge is final or still a temporary hold. Exact request lookups return only the org_id and recent result fields. | options?: BillingUsageOptions | Promise<BillingUsageResult> |
topUpBillingBalance | method | Charge the saved payment method and add Deepline credits to the active workspace. Prefer client.billing.topUp(...). | options: { credits: number; idempotencyKey?: string; } | Promise<BillingTopUpResult> |
topUpBillingBalanceWithReceipt | method | Request a durable top-up operation receipt. A pending receipt does not imply that payment or credit activation has completed. Prefer client.billing.topUpWithReceipt(...). | options: { credits: number; idempotencyKey?: string; } | Promise<BillingTopUpReceipt> |
getBillingSubscriptionStatus | method | Subscription state for the active workspace: active plan, whether a Stripe subscription backs it, renewal/cancellation facts, and remaining Deepline credit pools. Prefer client.billing.subscription.status(). | Promise<BillingSubscriptionStatus> | |
cancelBillingSubscription | method | Schedule subscription cancellation at period end, or reverse a pending cancellation with { undo: true }. The customer keeps the cycle theypaid for and every remaining credit — cancellation never claws back credits. Prefer client.billing.subscription.cancel(...). | options?: { undo?: boolean; } | Promise<BillingSubscriptionCancelResult> |
listBillingInvoices | method | Customer-facing billing history: subscription invoices plus one-time credit purchase receipts, newest first, with Stripe-hosted links. Prefer client.billing.invoices.list(...). | options?: { limit?: number; } | Promise<BillingInvoicesResult> |
getTargetBillingPlans | method | List the reviewed target plans and whether new acquisition is enabled. | Promise<TargetBillingPlansResult> | |
getTargetBillingStatus | method | Read the workspace’s normalized target plan, payment, and balance state. | Promise<TargetBillingStatusResult> | |
getTargetAutoRecharge | method | Read the canonical Metronome automatic recharge configuration. | Promise<TargetAutoRechargeResult> | |
updateTargetAutoRecharge | method | Update automatic recharge and return the server-verified configuration. | options: TargetAutoRechargeUpdateOptions | Promise<TargetAutoRechargeResult> |
purchaseTargetBillingCredits | method | Purchase target-billing credits through the durable commercial operation flow. The caller supplies an idempotency key for safe retries. | options: { credits: number; idempotencyKey: string; } | Promise<TargetBillingMutationResult> |
recoverTargetBillingCreditPurchase | method | Recover only the original workspace, credit amount, and purchase key. Never charge. | options: { credits: number; orgId: string; idempotencyKey: string; } | Promise<TargetBillingMutationResult> |
transitionTargetBillingPlan | method | Start, change, cancel, or restore a target plan through one idempotent commercial operation. | options: TargetBillingPlanTransitionOptions | Promise<TargetBillingMutationResult> |
createTargetBillingPortalSession | method | Create a Stripe-hosted portal session for payment recovery and invoices. | options?: { flow?: 'customer_update'; } | Promise<{ url: string }> |
createWorkspace | method | Create an additional workspace through the durable PAYG workflow. | options: { name: string; idempotencyKey: string; } | Promise<WorkspaceCreateResult> |
authStatus | method | The workspace and user this client’s API key authenticates as. | Promise<Record<string, unknown>> | |
health | method | Check API connectivity and server health. | Promise<{ status: string; version?: string; status_banner?: { message: string; updatedAt: number; }; }> |
client.runs
Use client.runs to watch, stop, query logs/events, and export durable dataset rows.
| Name | Type | Required | Description |
|---|---|---|---|
getReceipts | ( runId: string, options: { keys: string[] }, ) => Promise<import('./runs/receipts').RunToolReceiptsResponse> | Yes | Read retained tool results in supplied key order. Use keys returned in exported evidence or execution metadata. search does not expose receipt keys. Never executes tools. |
get | (runId: string, options?: RunsGetOptions) => Promise<PlayStatus> | Yes | Get current run status by public run id. |
children | ( parentRunId: string, options: RunsChildrenOptions, ) => Promise<RunChildrenPage> | Yes | Read one bounded page of direct children for an async launch. |
input | (runId: string) => Promise<{ runId: string; input: Record<string, unknown> | unknown[]; bytes: number; sha256: string | null; replayedFromRunId: string | null; }> | Yes | Explicitly read the retained original input (may include customer data). |
rerun | (runId: string, options?: RerunOptions) => Promise<RerunPlayRunResult> | Yes | Start a fresh run from a prior run’s retained input and pinned revision. |
list | (options: RunsListOptions) => Promise<PlayRunListItem[]> | Yes | List runs for one play, optionally filtered by status. |
listPage | (options: RunsListOptions) => Promise<RunsListPage> | Yes | Read one run page with total, offset, limit and completeness metadata. |
history | (options?: RunsHistoryOptions) => Promise<RunsHistoryPage> | Yes | Search/page workspace run history newest first. follow empty continuing pages. |
watch | (runId: string, options?: RunsWatchOptions) => Promise<PlayStatus> | Yes | Poll run snapshots every two seconds until terminal status. |
logs | RunsLogsNamespace | Yes | Call for the retained text tail, full stream (all) or terminal failure window (failed). Use logs.query/count/summarize/fields for structured filters and exact aggregates. See run logs and events. |
events | RunsEventsNamespace | Yes | Use events.list/count/summarize/fields for lifecycle, receipt and organization-wide events. See run logs and events. |
searchEvents | ( options?: RunsEventSearchOptions, ) => Promise<RunsEventSearchResult> | Yes | Search existing events across the active organization. default last hour, up to 200 events per page (ten with payloads). See run logs and events for the catalog, query fields and response types. |
exportDatasetRows | (input: { playName: string; tableNamespace: string; runId?: string; limit?: number; offset?: number; rowMode?: 'output' | 'all' | 'live'; signal?: AbortSignal; }) => Promise<PlaySheetRowsResult> | Yes | Export persisted rows for a runtime-sheet dataset/table namespace. |
rowHistory | ( input: PlayRunRowHistoryOptions, ) => Promise<RuntimeSheetRunRowMembershipPage> | Yes | One immutable history page. incomplete legacy coverage stays explicit. |
stop | ( runId: string, options?: { reason?: string }, ) => Promise<StopPlayRunResult> | Yes | Stop a running/waiting run. |
stopAll | { ( options: StopAllRunsOptions & { dryRun: true }, ): Promise<StopAllPlayRunsDryRunResult>; ( options?: StopAllRunsOptions & { dryRun?: false }, ): Promise<StopAllPlayRunsStopResult>; (options?: StopAllRunsOptions): Promise<StopAllPlayRunsResult>; } | Yes | Stop active runs across the current workspace, or with dryRun: trueenumerate the exact candidates without cancelling anything. |
client.billing
Public client.billing namespace for CLI commands and programmatic callers.
Covers usage, plans, subscription state, cancellation, and invoice/receipt
history.
| Name | Type | Required | Description |
|---|---|---|---|
quote | (input: BillingQuoteRequest) => Promise<BillingQuoteResult> | Yes | Read a bounded sandbox-session estimate. excludes tools and Customer DB. |
entitlements | () => Promise<BillingEntitlements> | Yes | Current workspace provider benefits. discovery does not authorize a call. |
topUp | (options: { credits: number; idempotencyKey?: string; }) => Promise<BillingTopUpResult> | Yes | Charge the saved payment method and add Deepline credits to the active workspace. |
topUpWithReceipt | (options: { credits: number; idempotencyKey?: string; }) => Promise<BillingTopUpReceipt> | Yes | Request a durable pending or applied receipt for a saved-card top-up. |
plans | () => Promise<BillingPlansResult> | Yes | Published plans plus the plan you are on (“what plans exist and what am I on”). |
subscription | { status: () => Promise<BillingSubscriptionStatus>; cancel: (options?: { undo?: boolean; }) => Promise<BillingSubscriptionCancelResult>; } | Yes | |
invoices | { list: (options?: { limit?: number }) => Promise<BillingInvoicesResult>; } | Yes | |
usageEvent | (requestId: string) => Promise<BillingUsageEvent> | Yes | Read one exact execution outcome using the request_id returned by executeTool. |
usage | (options?: BillingUsageOptions) => Promise<BillingUsageResult> | Yes | Read current billing usage, or look up one exact execution charge by request ID. |
targetPlans | () => Promise<TargetBillingPlansResult> | Yes | Metronome-authored target catalog and current Contract projection. |
targetStatus | () => Promise<TargetBillingStatusResult> | Yes | Normalized target billing state. |
autoRecharge | { get: () => Promise<TargetAutoRechargeResult>; trigger: (options?: { idempotencyKey: string; }) => Promise<{ data: { status: string; operation_id?: string } }>; update: ( options: TargetAutoRechargeUpdateOptions, ) => Promise<TargetAutoRechargeResult>; } | Yes | Read and manage the Metronome-backed automatic recharge configuration. |
purchaseCredits | (options: { credits: number; idempotencyKey: string; }) => Promise<TargetBillingMutationResult> | Yes | Buy Deepline credits through a payment-gated Metronome commit. |
recoverCreditPurchase | (options: { credits: number; orgId: string; idempotencyKey: string; }) => Promise<TargetBillingMutationResult> | Yes | Inspect or retire the original purchase intent without starting a payment. |
transitionPlan | ( options: TargetBillingPlanTransitionOptions, ) => Promise<TargetBillingMutationResult> | Yes | Start, change, cancel, or undo a target plan transition. |
portalSession | (options?: { flow?: 'customer_update'; }) => Promise<{ url: string }> | Yes | Create a Stripe-hosted billing Portal session. |
client.monitors
Use client.monitors for the /api/v2/monitors resource family.
Every deepline monitors verb maps here. Author a definition with defineMonitor,
then check/deploy/list/get/update/delete/reactivate through this namespace.
| Name | Type | Required | Description |
|---|---|---|---|
status | () => Promise<MonitorsAccessStatus> | Yes | Whether the current workspace can use monitors ({ has_access, reason }). |
available | ( toolIdOrOptions?: string | (MonitorsAvailableOptions & { tool?: string }), options?: MonitorsAvailableOptions, ) => Promise<MonitorsAvailableResult> | Yes | The deployable monitor tools catalog. Call with no tool id for the list, or with a tool id (positional or { tool }) to describe one tool’s fullpayload/stream contract. |
check | (definition: MonitorDefinition) => Promise<MonitorCheckResult> | Yes | Validate a monitor definition without deploying it (no spend). |
preview | ( definition: MonitorDefinition, options?: MonitorPreviewOptions, ) => Promise<MonitorPreviewResult> | Yes | Sample a few recent matches for a definition before deploying it. Spends Deepline credits per returned update. Reuse idempotencyKey to recover alost result without paying again. omit it for a new preview. |
deploy | ( definition: MonitorDefinition, options?: { dryRun?: boolean }, ) => Promise<MonitorDeployResult> | Yes | Deploy a monitor from a definition. May spend Deepline credits. |
sync | ( definition: MonitorDefinition, options?: MonitorLifecycleOptions, ) => Promise<MonitorJobResult | MonitorDeployResult> | Yes | Set the desired definition for one stable monitor key. |
list | (options?: MonitorsListOptions) => Promise<MonitorsListResult> | Yes | List deployed monitors (active by default). Use state to filter thefour customer states ( active, provisioning, billing_suspended,disabled). status is retained for older servers.includeConsumers requires a limit of 20 or fewer. |
get | (key: string) => Promise<MonitorDetail> | Yes | Fetch one deployed monitor by public key with bounded current listener health. |
test | ( key: string, payload: Record<string, unknown>, options?: MonitorTestOptions, ) => Promise<MonitorTestResult> | Yes | Test a deployed monitor’s callback envelope without side effects. |
validate | (key: string) => Promise<MonitorValidateResult> | Yes | |
dependents | (key: string) => Promise<MonitorDependents> | Yes | List the published plays depending on one monitor’s output streams. |
update | ( key: string, patch: Record<string, unknown>, ) => Promise<MonitorUpdateResult> | Yes | Update a deployed monitor by public key. |
delete | ( key: string, options?: { dryRun?: boolean }, ) => Promise<MonitorDeleteResult> | Yes | Delete a deployed monitor and its upstream provider resource. dryRun returns the delete plan. |
reactivate | ( key: string, options?: { dryRun?: boolean }, ) => Promise<MonitorReactivateResult> | Yes | Reactivate a disabled monitor. dryRun returns the reactivation cost. |
start | ( key: string, options?: MonitorLifecycleOptions, ) => Promise<MonitorJobResult | MonitorBatchOperationResult> | Yes | Explicitly apply the retained definition for a stopped monitor. |
stop | ( key: string, options?: MonitorLifecycleOptions, ) => Promise<MonitorJobResult | MonitorBatchOperationResult> | Yes | Converge one monitor to inactive while retaining its definition. |
audit | (options?: { fleetId?: string; cursor?: string | null; }) => Promise<MonitorsAuditResult> | Yes | Re-read what the provider holds onto the monitors that claim it. Bounded and idempotent: pass cursor back while audit.cursor is non-null. |
repair | (options?: { fleetId?: string; dryRun?: boolean; }) => Promise<MonitorsRepairResult> | Yes | Converge the monitors whose desired and observed states disagree.dryRun returns the same plan without queueing anything. |
health | (options?: { fleetId?: string }) => Promise<MonitorsHealth> | Yes | Delivery and convergence health for the workspace or one fleet. |
fleets | MonitorFleetsNamespace | Yes | Define, reconcile, and control table-backed monitor fleets. |
batch | MonitorBatchNamespace | Yes | Deploy an immutable one-off list through the common Monitor Job engine. |
batches | MonitorNamedBatchesNamespace | Yes | Reconcile and control a stable named static Batch. |
jobs | MonitorJobsNamespace | Yes | Read, wait for, inspect, or cancel Monitor Jobs. |