@verentis/sdk 0.1.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/index.cjs +85 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +58 -3
- package/dist/index.d.ts +58 -3
- package/dist/index.js +85 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/auth/api-key.auth.ts","../src/auth/bridge.auth.ts","../src/auth/token.auth.ts","../src/modules/context.ts","../src/modules/executions.ts","../src/modules/engines.ts","../src/modules/files.ts","../src/modules/installations.ts","../src/modules/resources.ts","../src/modules/settings.ts","../src/transport/bridge.transport.ts","../src/types.ts","../src/transport/http.transport.ts","../src/client.ts","../src/utils/mime.ts","../src/index.ts"],"names":["delay","SKEW_MS"],"mappings":";;;AAOO,IAAM,aAAN,MAAyC;AAAA,EAC9C,YAA6B,MAAA,EAAgB;AAAhB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAC3B,IAAA,IAAI,CAAC,MAAA,CAAO,UAAA,CAAW,MAAM,CAAA,EAAG;AAC9B,MAAA,MAAM,IAAI,MAAM,gDAAgD,CAAA;AAAA,IAClE;AAAA,EACF;AAAA,EAJ6B,MAAA;AAAA,EAM7B,MAAM,aAAA,GAAiC;AACrC,IAAA,OAAO,CAAA,OAAA,EAAU,KAAK,MAAM,CAAA,CAAA;AAAA,EAC9B;AACF;;;ACVA,IAAM,OAAA,GAAU,GAAA;AAOT,IAAM,aAAN,MAAyC;AAAA,EAO9C,YAA6B,UAAA,EAAoB;AAApB,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AAC3B,IAAA,IAAA,CAAK,eAAA,GAAkB,IAAA,CAAK,aAAA,CAAc,IAAA,CAAK,IAAI,CAAA;AACnD,IAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC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M,MAAA,GAAS,CAAC,CAAA,CAAE,OAAA,CAAQ,SAAS,GAAG,CAAA;AACtC,IAAA,MAAM,MAAA,GAAS,CAAC,CAAA,CAAE,OAAA,CAAQ,SAAS,GAAG,CAAA;AACtC,IAAA,IAAI,MAAA,KAAW,MAAA,EAAQ,OAAO,MAAA,GAAS,EAAA,GAAK,CAAA;AAC5C,IAAA,OAAO,CAAA,CAAE,WAAW,CAAA,CAAE,QAAA;AAAA,EACxB,CAAC,CAAA;AAEH,EAAA,OAAO,OAAA,CAAQ,CAAC,CAAA,IAAK,IAAA;AACvB;AAMA,SAAS,YAAY,IAAA,EAAsB;AACzC,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC5B,EAAA,OAAO,GAAA,KAAQ,EAAA,GAAK,IAAA,CAAK,IAAA,EAAK,GAAI,KAAK,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA,CAAE,IAAA,EAAK;AAC5D;;;ACxBO,SAAS,qBAAqB,OAAA,EAAiD;AACpF,EAAA,OAAO,IAAI,eAAe,OAAO,CAAA;AACnC","file":"index.cjs","sourcesContent":["import type { AuthStrategy } from '../types'\n\n/**\n * Authenticates with a Verentis API key (`vrt_` prefix).\n * The backend detects the `vrt_` prefix in the Bearer token and resolves it\n * as an API key rather than a JWT.\n */\nexport class ApiKeyAuth implements AuthStrategy {\n constructor(private readonly apiKey: string) {\n if (!apiKey.startsWith('vrt_')) {\n throw new Error('Invalid API key format: must start with \"vrt_\"')\n }\n }\n\n async getAuthHeader(): Promise<string> {\n return `Bearer ${this.apiKey}`\n }\n}\n","import type {\n AuthStrategy,\n TokenInfo,\n VerentisTokenRefreshMessage,\n VerentisTokenRefreshedMessage,\n} from '../types'\n\nconst SKEW_MS = 30_000\n\n/**\n * Authenticates via the PostMessage bridge in iframe mode.\n * The token is received from the host during initialization and refreshed\n * by requesting a new token from the host when nearing expiry.\n */\nexport class BridgeAuth implements AuthStrategy {\n private _token: string | null = null\n private _expiresAt = 0\n private _refreshTimer: ReturnType<typeof setTimeout> | null = null\n private _pendingRefresh: Promise<void> | null = null\n private _messageHandler: (event: MessageEvent) => void\n\n constructor(private readonly hostOrigin: string) {\n this._messageHandler = this.handleMessage.bind(this)\n if (typeof window !== 'undefined') {\n window.addEventListener('message', this._messageHandler)\n }\n }\n\n /** Set the initial token received from the host's `verentis:init` message */\n setToken(info: TokenInfo): void {\n this._token = info.accessToken\n this._expiresAt = new Date(info.expiresAt).getTime()\n this.scheduleRefresh()\n }\n\n async getAuthHeader(): Promise<string | null> {\n if (!this._token) return null\n if (this.isExpired()) {\n await this.requestRefresh()\n }\n return `Bearer ${this._token}`\n }\n\n destroy(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', this._messageHandler)\n }\n }\n\n private isExpired(): boolean {\n return Date.now() >= this._expiresAt - SKEW_MS\n }\n\n private _refreshResolve: (() => void) | null = null\n\n private requestRefresh(): Promise<void> {\n if (this._pendingRefresh) return this._pendingRefresh\n\n const requestId = crypto.randomUUID()\n\n this._pendingRefresh = new Promise<void>((resolve) => {\n this._refreshResolve = resolve\n })\n\n const message: VerentisTokenRefreshMessage = {\n type: 'verentis:token:refresh',\n version: 1,\n requestId,\n }\n window.parent.postMessage(message, this.hostOrigin)\n\n return this._pendingRefresh\n }\n\n private handleMessage(event: MessageEvent): void {\n if (event.origin !== this.hostOrigin) return\n\n const data = event.data as VerentisTokenRefreshedMessage\n if (data?.type !== 'verentis:token:refreshed') return\n\n this._token = data.token.accessToken\n this._expiresAt = new Date(data.token.expiresAt).getTime()\n this._pendingRefresh = null\n this._refreshResolve?.()\n this._refreshResolve = null\n this.scheduleRefresh()\n }\n\n private scheduleRefresh(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (this._expiresAt === 0) return\n\n const delay = Math.max(0, this._expiresAt - Date.now() - SKEW_MS)\n this._refreshTimer = setTimeout(() => void this.requestRefresh(), delay)\n }\n}\n","import type { AuthStrategy, TokenInfo } from '../types'\n\nconst SKEW_MS = 30_000\n\n/**\n * Authenticates with a pre-existing bearer token.\n * Tracks expiry and invokes an optional refresh callback before the token expires.\n */\nexport class TokenAuth implements AuthStrategy {\n private _token: string\n private _expiresAt: number\n private _refreshTimer: ReturnType<typeof setTimeout> | null = null\n private _refreshFn?: () => Promise<TokenInfo>\n\n constructor(token: string, expiresAt?: string, refreshFn?: () => Promise<TokenInfo>) {\n this._token = token\n this._expiresAt = expiresAt ? new Date(expiresAt).getTime() : Infinity\n this._refreshFn = refreshFn\n this.scheduleRefresh()\n }\n\n async getAuthHeader(): Promise<string> {\n if (this.isExpired() && this._refreshFn) {\n await this.refresh()\n }\n return `Bearer ${this._token}`\n }\n\n /** Update the token (e.g. after a refresh) */\n update(info: TokenInfo): void {\n this._token = info.accessToken\n this._expiresAt = new Date(info.expiresAt).getTime()\n this.scheduleRefresh()\n }\n\n destroy(): void {\n if (this._refreshTimer) {\n clearTimeout(this._refreshTimer)\n this._refreshTimer = null\n }\n }\n\n private isExpired(): boolean {\n return Date.now() >= this._expiresAt - SKEW_MS\n }\n\n private async refresh(): Promise<void> {\n if (!this._refreshFn) return\n const info = await this._refreshFn()\n this.update(info)\n }\n\n private scheduleRefresh(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (!this._refreshFn || this._expiresAt === Infinity) return\n\n const delay = Math.max(0, this._expiresAt - Date.now() - SKEW_MS)\n this._refreshTimer = setTimeout(() => void this.refresh(), delay)\n }\n}\n","import type { AppContext, AppSurface, EntryPointInfo, FileInfo, WorkspaceInfo } from '../types'\n\n/**\n * Provides access to the current workspace and launch context.\n * In iframe mode, this is populated from the host's `verentis:init` message.\n * In standalone mode, the developer provides values via options.\n */\nexport class ContextModule {\n private _workspace: WorkspaceInfo | null = null\n private _surface: AppSurface | null = null\n private _file: FileInfo | null = null\n private _entryPoint: EntryPointInfo | null = null\n private _apiUrl: string | null = null\n\n /** The current workspace */\n get workspace(): WorkspaceInfo {\n if (!this._workspace) {\n throw new Error('Workspace context not available. Ensure the client is initialized.')\n }\n return this._workspace\n }\n\n /** The host surface that launched the app */\n get surface(): AppSurface {\n if (!this._surface) {\n throw new Error('Launch surface not available. Ensure the client is initialized.')\n }\n return this._surface\n }\n\n /** The file that triggered the app to open on a file surface */\n get file(): FileInfo {\n if (!this._file) {\n throw new Error('File context not available. The app may be running on a workspace surface.')\n }\n return this._file\n }\n\n /** The API URL */\n get apiUrl(): string {\n if (!this._apiUrl) {\n throw new Error('API URL not available. Ensure the client is initialized.')\n }\n return this._apiUrl\n }\n\n /** Whether a file context is available */\n get hasFile(): boolean {\n return this._file !== null\n }\n\n /** The application entry point that matched the opened file */\n get entryPoint(): EntryPointInfo | null {\n return this._entryPoint\n }\n\n /** Whether an entry point context is available */\n get hasEntryPoint(): boolean {\n return this._entryPoint !== null\n }\n\n /** Update context from the host's init message */\n setFromAppContext(ctx: AppContext): void {\n this._workspace = ctx.workspace\n this._surface = ctx.surface ?? 'file'\n this._file = ctx.file ?? null\n this._entryPoint = ctx.entryPoint ?? null\n this._apiUrl = ctx.apiUrl\n }\n\n /** Set workspace info directly (standalone mode) */\n setWorkspace(workspace: Partial<WorkspaceInfo> & { id: string }): void {\n this._workspace = {\n id: workspace.id,\n slug: workspace.slug ?? '',\n name: workspace.name ?? '',\n }\n }\n\n /** Set API URL directly */\n setApiUrl(url: string): void {\n this._apiUrl = url\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n ExecuteEngineOptions,\n Execution,\n ExecutionLogs,\n ExecutionListOptions,\n PagedResult,\n ExecutionScopedOptions,\n ExecutionStatus,\n RunFileOptions,\n WaitOptions,\n} from '../types'\n\nconst TERMINAL_STATUSES: ReadonlySet<ExecutionStatus> = new Set<ExecutionStatus>([\n 'Completed',\n 'Failed',\n 'Cancelled',\n 'TimedOut',\n])\n\n/** Returns true once an execution has reached a final state. */\nexport function isTerminalStatus(status: ExecutionStatus): boolean {\n return TERMINAL_STATUSES.has(status)\n}\n\n/**\n * Execution operations module. Triggers engine executions against files or a specific engine,\n * reads their status/result/logs, cancels them, and polls them to completion — all over the\n * Verentis execution API (`/v1/executions`).\n */\nexport class ExecutionsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /**\n * Run a file in the virtual file system. The platform resolves the appropriate engine from the\n * file's type (e.g. a `.py` file runs on the Python engine).\n */\n async run(filePath: string, options?: RunFileOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', '/executions', {\n body: JSON.stringify({\n workspaceId,\n filePath,\n branch: options?.branch,\n tool: options?.tool,\n mode: options?.mode,\n arguments: options?.arguments ?? [],\n parameters: serializeParameters(options?.parameters),\n }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /**\n * Execute a specific engine by id, optionally against a file and/or with structured parameters\n * (e.g. invoking an engine tool without a script).\n */\n async execute(engineId: string, options?: ExecuteEngineOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', '/executions', {\n body: JSON.stringify({\n workspaceId,\n engineId,\n filePath: options?.filePath,\n branch: options?.branch,\n tool: options?.tool,\n mode: options?.mode,\n arguments: options?.arguments ?? [],\n parameters: serializeParameters(options?.parameters),\n }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /** Get an execution by id. */\n async get(id: string, options?: ExecutionScopedOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('GET', `/executions/${encodeURIComponent(id)}`, {\n params: { workspaceId },\n })\n }\n\n /** List workspace executions with optional engine, file, lifecycle, and time filters. */\n async list(options?: ExecutionListOptions): Promise<PagedResult<Execution>> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<PagedResult<Execution>>('GET', '/executions', {\n params: {\n workspaceId,\n filePath: options?.filePath,\n engineIds: options?.engineIds,\n filePaths: options?.filePaths,\n status: options?.status,\n trigger: options?.trigger,\n activeOnly: options?.activeOnly,\n requestedAfter: options?.requestedAfter,\n requestedBefore: options?.requestedBefore,\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n })\n }\n\n /** Get the captured stdout/stderr of an execution. */\n async logs(id: string, options?: ExecutionScopedOptions): Promise<ExecutionLogs> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<ExecutionLogs>('GET', `/executions/${encodeURIComponent(id)}/logs`, {\n params: { workspaceId },\n })\n }\n\n /** Cancel a pending or running execution. */\n async cancel(id: string, options?: ExecutionScopedOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', `/executions/${encodeURIComponent(id)}/cancel`, {\n body: JSON.stringify({ id, workspaceId }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /**\n * Poll an execution until it reaches a terminal status. Returns immediately if it is already\n * terminal. Throws if `timeoutMs` elapses or the supplied signal aborts.\n */\n async wait(id: string, options?: WaitOptions): Promise<Execution> {\n const interval = options?.intervalMs ?? 1000\n const deadline = options?.timeoutMs ? Date.now() + options.timeoutMs : undefined\n\n for (;;) {\n const execution = await this.get(id, { workspaceId: options?.workspaceId })\n if (isTerminalStatus(execution.status)) {\n return execution\n }\n\n if (deadline !== undefined && Date.now() >= deadline) {\n throw new Error(`Timed out waiting for execution '${id}' to complete`)\n }\n\n await delay(interval, options?.signal)\n }\n }\n\n /**\n * Run a file and resolve once it has completed. For synchronous (request-response) executions the\n * initial response is already terminal; otherwise it polls via {@link wait}.\n */\n async runAndWait(filePath: string, options?: RunFileOptions & WaitOptions): Promise<Execution> {\n const execution = await this.run(filePath, options)\n if (isTerminalStatus(execution.status)) {\n return execution\n }\n return this.wait(execution.id, options)\n }\n\n private requireWorkspaceId(override?: string): string {\n const id = override ?? this.workspaceId\n if (!id) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return id\n }\n}\n\n/** The platform expects `parameters` as a JSON string; serialize structured input for ergonomics. */\nfunction serializeParameters(parameters?: Record<string, unknown>): string | undefined {\n return parameters === undefined ? undefined : JSON.stringify(parameters)\n}\n\nfunction delay(ms: number, signal?: AbortSignal): Promise<void> {\n if (signal?.aborted) {\n return Promise.reject(new DOMException('Aborted', 'AbortError'))\n }\n\n return new Promise((resolve, reject) => {\n const timer = setTimeout(resolve, ms)\n signal?.addEventListener(\n 'abort',\n () => {\n clearTimeout(timer)\n reject(new DOMException('Aborted', 'AbortError'))\n },\n { once: true },\n )\n })\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n ExecutionEngine,\n ExecutionEngineListOptions,\n ExecutionScopedOptions,\n PagedResult,\n} from '../types'\n\n/** Read-only access to execution engines registered in a workspace. */\nexport class EnginesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: ExecutionEngineListOptions): Promise<PagedResult<ExecutionEngine>> {\n return this.http.request<PagedResult<ExecutionEngine>>('GET', '/engines', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n })\n }\n\n async get(id: string, options?: ExecutionScopedOptions): Promise<ExecutionEngine> {\n return this.http.request<ExecutionEngine>('GET', `/engines/${encodeURIComponent(id)}`, {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type { DeleteFileOptions, ExtractUploadOptions, FileEntry, GetFileOptions, InstalledPackageDescriptor, MoveFileOptions, ReadArchiveOptions, WriteFileOptions } from '../types'\n\n/**\n * File operations module. Provides read, write, list, move, and delete\n * against the Verentis Node file API.\n */\nexport class FilesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /**\n * Get file metadata or directory listing.\n * For files: returns metadata (path, name, mimeType, size, etc.).\n * For directories: returns metadata with children array populated.\n */\n async get(path: string, options?: GetFileOptions): Promise<FileEntry> {\n const normalizedPath = normalizePath(path)\n return this.http.request<FileEntry>('GET', `/files/${normalizedPath}`, {\n params: {\n branch: options?.branch ?? 'main',\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Read the raw content of a file as a Blob.\n */\n async readContent(path: string, branch?: string): Promise<Blob> {\n const normalizedPath = normalizePath(path)\n const response = await this.http.requestRaw('GET', `/files/raw/${normalizedPath}`, {\n params: { branch: branch ?? 'main' },\n headers: {\n ...this.workspaceHeaders(),\n Accept: '*/*',\n },\n })\n if (!response.ok) {\n throw new Error(`Failed to read file content: ${response.status} ${response.statusText}`)\n }\n return response.blob()\n }\n\n /** Read UTF-8 text content from a workspace file. */\n async readText(path: string, branch?: string): Promise<string> {\n return (await this.readContent(path, branch)).text()\n }\n\n /** Inspect an extracted or sealed package node without exposing sealed payload content. */\n async getPackageDescriptor(path: string, branch = 'main'): Promise<InstalledPackageDescriptor> {\n return this.http.request<InstalledPackageDescriptor>('GET', '/files/package-descriptor', {\n params: { branch, path },\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Download a file or directory as an archive (zip or tgz).\n * Only applicable when the target has children or you want a packaged download.\n */\n async readArchive(path: string, options?: ReadArchiveOptions): Promise<Blob> {\n const normalizedPath = normalizePath(path)\n const format = options?.format ?? 'zip'\n const response = await this.http.requestRaw('GET', `/files/raw/${normalizedPath}`, {\n params: {\n branch: options?.branch ?? 'main',\n format,\n },\n headers: {\n ...this.workspaceHeaders(),\n Accept: format === 'tgz' ? 'application/gzip' : 'application/zip',\n },\n })\n if (!response.ok) {\n throw new Error(`Failed to download archive: ${response.status} ${response.statusText}`)\n }\n return response.blob()\n }\n\n /**\n * Upload an archive (zip or tgz) and auto-extract its contents as individual nodes.\n * If the archive contains a `.verentis-manifest.json`, the original metadata\n * (display names, mime types, parent-content relationships) will be honoured.\n */\n async extractUpload(path: string, file: Blob, options?: ExtractUploadOptions): Promise<void> {\n const normalizedPath = normalizePath(path)\n const formData = new FormData()\n\n const filename = options?.filename ?? 'archive.zip'\n formData.append('file', file, filename)\n\n const metadata: Record<string, unknown> = {}\n if (options?.branch) metadata.branch = options.branch\n formData.append('metadata', JSON.stringify(metadata))\n\n await this.http.request('POST', `/files/${normalizedPath}`, {\n body: formData,\n headers: {\n ...this.workspaceHeaders(),\n 'X-Auto-Extract': 'true',\n },\n })\n }\n\n /**\n * Upload or create a file.\n */\n async write(path: string, options: WriteFileOptions): Promise<void> {\n const normalizedPath = normalizePath(path)\n const formData = new FormData()\n\n let blob: Blob\n if (typeof options.content === 'string') {\n blob = new Blob([options.content], { type: options.contentType ?? 'text/plain' })\n } else if (options.content instanceof ArrayBuffer) {\n blob = new Blob([options.content], { type: options.contentType ?? 'application/octet-stream' })\n } else {\n blob = options.content\n }\n\n const filename = options.filename ?? extractFilename(path)\n formData.append('file', blob, filename)\n\n const metadata: Record<string, unknown> = {}\n if (options.contentType) metadata.contentType = options.contentType\n if (options.branch) metadata.branch = options.branch\n formData.append('metadata', JSON.stringify(metadata))\n\n await this.http.request('POST', `/files/${normalizedPath}`, {\n body: formData,\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Move or rename a file.\n */\n async move(options: MoveFileOptions): Promise<void> {\n await this.http.request('PUT', '/files', {\n body: JSON.stringify({\n from: normalizePath(options.from),\n to: normalizePath(options.to),\n branch: options.branch,\n }),\n headers: {\n ...this.workspaceHeaders(),\n 'Content-Type': 'application/json',\n },\n })\n }\n\n /**\n * Delete a file.\n */\n async remove(options: DeleteFileOptions): Promise<void> {\n await this.http.request('DELETE', '/files', {\n body: JSON.stringify({\n path: normalizePath(options.path),\n branch: options.branch,\n }),\n headers: {\n ...this.workspaceHeaders(),\n 'Content-Type': 'application/json',\n },\n })\n }\n\n private workspaceHeaders(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (this.workspaceId) {\n headers['X-Workspace-Id'] = this.workspaceId\n }\n return headers\n }\n}\n\n/** Normalize a file path: strip leading/trailing slashes, collapse doubles */\nfunction normalizePath(path: string): string {\n return path\n .replace(/\\/+/g, '/')\n .replace(/^\\//, '')\n .replace(/\\/$/, '')\n}\n\n/** Extract filename from a path */\nfunction extractFilename(path: string): string {\n const segments = path.split('/')\n return segments[segments.length - 1] || 'file'\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n Installation,\n InstallationDetail,\n InstallationLifecycleResult,\n InstallationListOptions,\n InstallationScopedOptions,\n PagedResult,\n ResolveInstallationOptions,\n UpdateInstallationOptions,\n} from '../types'\n\n/** Manage Marketplace installation ledger records for the current workspace. */\nexport class InstallationsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: InstallationListOptions): Promise<PagedResult<Installation>> {\n return this.http.request<PagedResult<Installation>>('GET', '/installations', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n packageId: options?.packageId,\n branch: options?.branch,\n installPath: options?.installPath,\n status: options?.status,\n isSystem: options?.isSystem,\n },\n })\n }\n\n async resolve(\n installPath: string,\n options?: ResolveInstallationOptions,\n ): Promise<InstallationDetail> {\n return this.http.request<InstallationDetail>('GET', '/installations/resolve', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n branch: options?.branch ?? 'main',\n installPath,\n },\n })\n }\n\n async update(\n id: string,\n options?: UpdateInstallationOptions,\n ): Promise<InstallationLifecycleResult> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<InstallationLifecycleResult>(\n 'PUT',\n `/installations/${encodeURIComponent(id)}`,\n {\n body: JSON.stringify({\n id,\n workspaceId,\n packageVersion: options?.packageVersion,\n installMode: options?.installMode,\n }),\n headers: { 'Content-Type': 'application/json' },\n },\n )\n }\n\n async uninstall(id: string, options?: InstallationScopedOptions): Promise<void> {\n await this.http.request<void>('DELETE', `/installations/${encodeURIComponent(id)}`, {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type { ResourceRegistration, ResourceScopedOptions } from '../types'\n\n/** Read-only access to workspace Resource registrations and resolved application handlers. */\nexport class ResourcesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: ResourceScopedOptions): Promise<ResourceRegistration[]> {\n return this.http.request<ResourceRegistration[]>('GET', '/resources', {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n async get(id: string, options?: ResourceScopedOptions): Promise<ResourceRegistration> {\n return this.http.request<ResourceRegistration>(\n 'GET',\n `/resources/${encodeURIComponent(id)}`,\n { params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) } },\n )\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n SettingGroup,\n SettingItem,\n SettingPresence,\n SettingsScopedOptions,\n} from '../types'\n\n/**\n * Workspace settings module. Reads (and where permitted, writes) workspace-scoped settings\n * over the Verentis settings API (`/v1/settings`).\n *\n * The app token must carry the matching scopes, declared in the manifest's `spec.permissions`:\n * `fabric.setting.read` (get), `fabric.setting.read-all` (list), `fabric.setting.update` (set)\n * and `fabric.setting.delete` (reset).\n *\n * Secret values are server-only: for browser callers the platform always returns `value: null`\n * for secrets while `hasValue` reports whether one is configured. Manifest-declared settings\n * are stored namespaced as `{manifest-name}.{key}` — see {@link SettingsModule.namespaced}.\n */\nexport class SettingsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /** List every setting group visible to the workspace (definitions merged with values). */\n async list(options?: SettingsScopedOptions): Promise<SettingGroup[]> {\n return this.http.request<SettingGroup[]>('GET', '/settings', {\n params: this.scopeParams(options),\n })\n }\n\n /** Get a single setting by its full key (e.g. `graphite.api-key`). */\n async get(key: string, options?: SettingsScopedOptions): Promise<SettingItem> {\n return this.http.request<SettingItem>('GET', `/settings/${encodeURIComponent(key)}`, {\n params: this.scopeParams(options),\n })\n }\n\n /** Get a setting's value by its full key, or `defaultValue` when unset. */\n async getValue<T = unknown>(\n key: string,\n defaultValue?: T,\n options?: SettingsScopedOptions,\n ): Promise<T | undefined> {\n const item = await this.get(key, options)\n return (item.value ?? item.defaultValue ?? defaultValue) as T | undefined\n }\n\n /**\n * Check exact setting keys for retained stored values and effective defaults.\n * This never returns value content and also finds values retained after a definition is removed.\n */\n async presence(keys: string[], options?: SettingsScopedOptions): Promise<SettingPresence[]> {\n if (keys.length === 0) return []\n return this.http.request<SettingPresence[]>('GET', '/settings/presence', {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n keys,\n },\n })\n }\n\n /** Upsert a setting value by its full key. Requires the `fabric.setting.update` scope. */\n async set(key: string, value: unknown, options?: SettingsScopedOptions): Promise<void> {\n await this.http.request<void>('PUT', `/settings/${encodeURIComponent(key)}`, {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n },\n body: JSON.stringify(value ?? null),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /** Delete a stored value (reverting to the definition default). Requires `fabric.setting.delete`. */\n async reset(key: string, options?: SettingsScopedOptions): Promise<void> {\n await this.http.request<void>('DELETE', `/settings/${encodeURIComponent(key)}`, {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n },\n })\n }\n\n /**\n * A view of this module where every key is auto-prefixed with `{namespace}.` — the platform's\n * manifest namespacing convention. An app named `graphite` declaring `key: api-key` reads it as:\n *\n * ```ts\n * const settings = client.settings.namespaced('graphite')\n * const apiKey = await settings.getValue<string>('api-key')\n * ```\n */\n namespaced(namespace: string): NamespacedSettings {\n const prefix = namespace.endsWith('.') ? namespace : `${namespace}.`\n return {\n get: (key, options) => this.get(prefix + key, options),\n getValue: (key, defaultValue, options) => this.getValue(prefix + key, defaultValue, options),\n set: (key, value, options) => this.set(prefix + key, value, options),\n reset: (key, options) => this.reset(prefix + key, options),\n }\n }\n\n private scopeParams(options?: SettingsScopedOptions): Record<string, string> {\n return {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n // Secret values never reach browser callers; the platform rejects `true` for\n // anything but trusted service-to-service identities.\n includeSecretValues: 'false',\n }\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error(\n 'workspaceId is required: pass it in options or configure the client with one',\n )\n }\n return workspaceId\n }\n}\n\n/** Key-prefixed settings accessor returned by {@link SettingsModule.namespaced}. */\nexport interface NamespacedSettings {\n get(key: string, options?: SettingsScopedOptions): Promise<SettingItem>\n getValue<T = unknown>(\n key: string,\n defaultValue?: T,\n options?: SettingsScopedOptions,\n ): Promise<T | undefined>\n set(key: string, value: unknown, options?: SettingsScopedOptions): Promise<void>\n reset(key: string, options?: SettingsScopedOptions): Promise<void>\n}\n","import type {\n AppContext,\n AppToHostMessage,\n HostToAppMessage,\n NavigateOptions,\n TokenInfo,\n VerentisInitMessage,\n VerentisReadyMessage,\n} from '../types'\n\ntype BridgeEventType = HostToAppMessage['type']\ntype BridgeListener = (data: HostToAppMessage) => void\n\n/**\n * PostMessage bridge for communication between an app (iframe) and the\n * workspace host. Handles the initialization handshake, token lifecycle,\n * and app-to-host events (navigate, resize, dirty, etc.).\n */\nexport class Bridge {\n private listeners = new Map<BridgeEventType, Set<BridgeListener>>()\n private _initResolve!: (value: { context: AppContext; token: TokenInfo }) => void\n private _initPromise: Promise<{ context: AppContext; token: TokenInfo }>\n private _hostOrigin: string | null = null\n private _messageHandler: (event: MessageEvent) => void\n private _destroyed = false\n\n constructor() {\n this._initPromise = new Promise((resolve) => {\n this._initResolve = resolve\n })\n\n this._messageHandler = this.handleMessage.bind(this)\n if (typeof window !== 'undefined') {\n window.addEventListener('message', this._messageHandler)\n }\n }\n\n /** Post `verentis:ready` to the host to start the handshake */\n sendReady(capabilities?: string[]): void {\n console.info('[Verentis SDK] Sending verentis:ready to host')\n const message: VerentisReadyMessage = {\n type: 'verentis:ready',\n version: 1,\n capabilities,\n }\n // Use '*' for ready since we don't know the host origin yet\n window.parent.postMessage(message, '*')\n }\n\n /** Wait for the host to send `verentis:init` with context and token */\n waitForInit(): Promise<{ context: AppContext; token: TokenInfo }> {\n return this._initPromise\n }\n\n /** Get the host origin (available after init) */\n get hostOrigin(): string | null {\n return this._hostOrigin\n }\n\n /** Send a message to the host */\n postToHost(message: AppToHostMessage): void {\n if (!this._hostOrigin) {\n throw new Error('Bridge not initialized: host origin unknown. Wait for init first.')\n }\n window.parent.postMessage(message, this._hostOrigin)\n }\n\n /**\n * Navigate to another location in the workspace.\n *\n * @param path A workspace file path (e.g. `/reports/q1.json`) or an absolute\n * http(s) URL. External URLs require the app to declare the\n * `navigation:external` capability in its manifest.\n * @param options Navigation options. Set `newTab: true` to open the target in\n * a new browser tab instead of the current one.\n */\n navigate(path: string, options?: NavigateOptions): void {\n this.postToHost({\n type: 'verentis:navigate',\n version: 1,\n path,\n ...(options?.newTab ? { newTab: true } : {}),\n })\n }\n\n /** Request iframe resize */\n resize(height: number): void {\n this.postToHost({ type: 'verentis:resize', version: 1, height })\n }\n\n /** Update the title displayed by the host */\n setTitle(title: string): void {\n this.postToHost({ type: 'verentis:title', version: 1, title })\n }\n\n /** Signal unsaved changes to the host */\n setDirty(isDirty: boolean): void {\n this.postToHost({ type: 'verentis:dirty', version: 1, isDirty })\n }\n\n /** Subscribe to a specific message type from the host */\n on(type: BridgeEventType, listener: BridgeListener): () => void {\n if (!this.listeners.has(type)) {\n this.listeners.set(type, new Set())\n }\n this.listeners.get(type)!.add(listener)\n\n return () => {\n this.listeners.get(type)?.delete(listener)\n }\n }\n\n /** Clean up event listeners */\n destroy(): void {\n this._destroyed = true\n this.listeners.clear()\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', this._messageHandler)\n }\n }\n\n private handleMessage(event: MessageEvent): void {\n if (this._destroyed) return\n\n const data = event.data as HostToAppMessage\n if (!data?.type?.startsWith('verentis:')) return\n\n // Capture the host origin from the first valid message\n if (data.type === 'verentis:init') {\n this._hostOrigin = event.origin\n console.info('[Verentis SDK] Received verentis:init from host', {\n origin: event.origin,\n workspaceId: data.context.workspace.id,\n filePath: data.context.file?.path ?? null,\n })\n const initData = data as VerentisInitMessage\n this._initResolve({ context: initData.context, token: initData.token })\n }\n\n // Dispatch to listeners\n const typeListeners = this.listeners.get(data.type)\n if (typeListeners) {\n for (const listener of typeListeners) {\n listener(data)\n }\n }\n }\n}\n","// ---------------------------------------------------------------------------\n// PostMessage Protocol\n// ---------------------------------------------------------------------------\n\nexport interface VerentisMessage {\n type: `verentis:${string}`\n version: 1\n requestId?: string\n}\n\n// Host → App messages\n\nexport interface VerentisInitMessage extends VerentisMessage {\n type: 'verentis:init'\n context: AppContext\n token: TokenInfo\n}\n\nexport interface VerentisTokenRefreshedMessage extends VerentisMessage {\n type: 'verentis:token:refreshed'\n requestId: string\n token: TokenInfo\n}\n\nexport interface VerentisFileChangedMessage extends VerentisMessage {\n type: 'verentis:file:changed'\n path: string\n fileVersion?: string\n}\n\nexport interface VerentisThemeMessage extends VerentisMessage {\n type: 'verentis:theme'\n colorScheme: 'light' | 'dark'\n variables?: Record<string, string>\n}\n\n// App → Host messages\n\nexport interface VerentisReadyMessage extends VerentisMessage {\n type: 'verentis:ready'\n capabilities?: string[]\n}\n\nexport interface VerentisTokenRefreshMessage extends VerentisMessage {\n type: 'verentis:token:refresh'\n requestId: string\n}\n\nexport interface VerentisNavigateMessage extends VerentisMessage {\n type: 'verentis:navigate'\n /** Target of the navigation: a workspace file path or an absolute http(s) URL. */\n path: string\n /** When true, the host opens the target in a new browser tab instead of the current one. */\n newTab?: boolean\n}\n\nexport interface VerentisResizeMessage extends VerentisMessage {\n type: 'verentis:resize'\n height: number\n}\n\nexport interface VerentisTitleMessage extends VerentisMessage {\n type: 'verentis:title'\n title: string\n}\n\nexport interface VerentisDirtyMessage extends VerentisMessage {\n type: 'verentis:dirty'\n isDirty: boolean\n}\n\nexport type HostToAppMessage =\n | VerentisInitMessage\n | VerentisTokenRefreshedMessage\n | VerentisFileChangedMessage\n | VerentisThemeMessage\n\nexport type AppToHostMessage =\n | VerentisReadyMessage\n | VerentisTokenRefreshMessage\n | VerentisNavigateMessage\n | VerentisResizeMessage\n | VerentisTitleMessage\n | VerentisDirtyMessage\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nexport type AppSurface = 'file' | 'workspace'\n\ninterface AppContextBase {\n workspace: WorkspaceInfo\n entryPoint?: EntryPointInfo\n apiUrl: string\n}\n\n/** Context for an application opened against a workspace file. */\nexport interface FileAppContext extends AppContextBase {\n surface: 'file'\n file: FileInfo\n}\n\n/** Context for an application opened as a standalone workspace experience. */\nexport interface WorkspaceAppContext extends AppContextBase {\n surface: 'workspace'\n file?: never\n}\n\n/**\n * Legacy file-hosted contexts did not include a surface discriminator. They\n * remain accepted and are treated as `file` surfaces by the SDK.\n */\ninterface LegacyFileAppContext extends AppContextBase {\n surface?: undefined\n file: FileInfo\n}\n\n/**\n * Application context supplied by the workspace host.\n *\n * New hosts explicitly identify `file` or `workspace` surfaces. The legacy\n * file shape without `surface` remains supported for backwards compatibility.\n */\nexport type AppContext = FileAppContext | WorkspaceAppContext | LegacyFileAppContext\n\nexport interface WorkspaceInfo {\n id: string\n slug: string\n name: string\n}\n\nexport interface FileInfo {\n path: string\n name: string\n mimeType: string\n size: number\n version?: string\n etag?: string\n}\n\nexport interface EntryPointInfo {\n id: string\n displayName: string\n description?: string\n icon?: string\n route: string\n mode: 'view' | 'edit'\n matchedPattern: string\n priority: number\n}\n\nexport interface TokenInfo {\n accessToken: string\n expiresAt: string\n scopes: string[]\n}\n\n// ---------------------------------------------------------------------------\n// Client Options\n// ---------------------------------------------------------------------------\n\nexport interface VerentisClientOptions {\n /** Base URL of the Verentis API gateway (e.g. 'https://api.verentis.com') */\n apiUrl?: string\n /** API version prefix (defaults to 'v1') */\n apiVersion?: string\n /** Authentication configuration */\n auth?: AuthOptions\n /** Workspace ID for standalone mode */\n workspaceId?: string\n}\n\nexport type AuthOptions =\n | { apiKey: string }\n | { token: string; expiresAt?: string; refreshToken?: () => Promise<TokenInfo> }\n\n/**\n * Options for {@link VerentisNavigateMessage}-based navigation requests.\n */\nexport interface NavigateOptions {\n /**\n * When true, the host opens the target in a new browser tab instead of\n * navigating the current tab. Defaults to false.\n *\n * The target may be a workspace file path or an absolute http(s) URL.\n * Opening an external URL requires the app to declare the\n * `navigation:external` capability in its manifest.\n */\n newTab?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// File API Types\n// ---------------------------------------------------------------------------\n\nexport interface FileEntry {\n path: string\n name: string\n size: number\n mimeType: string\n version?: string\n etag?: string\n children?: FileEntry[]\n}\n\nexport interface GetFileOptions {\n branch?: string\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\nexport interface WriteFileOptions {\n content: Blob | string | ArrayBuffer\n contentType?: string\n filename?: string\n branch?: string\n}\n\nexport interface MoveFileOptions {\n from: string\n to: string\n branch?: string\n}\n\nexport interface DeleteFileOptions {\n path: string\n branch?: string\n}\n\nexport type ArchiveFormat = 'zip' | 'tgz'\n\nexport interface ReadArchiveOptions {\n /** Archive format. Defaults to 'zip'. */\n format?: ArchiveFormat\n /** Target branch. Defaults to 'main'. */\n branch?: string\n}\n\nexport interface ExtractUploadOptions {\n /** Original filename of the archive (for format detection). */\n filename?: string\n /** Target branch. Defaults to 'main'. */\n branch?: string\n}\n\nexport interface InstalledPackagePayload {\n sourcePath: string\n destinationPath: string\n mode: string\n phase: number\n mimeType?: string | null\n}\n\nexport interface InstalledPackageDescriptor {\n packageIdentity: string\n publisher?: string | null\n name: string\n version: string\n kind: string\n manifestYaml: string\n installMode: string\n sealed: boolean\n mimeType: string\n payloads: InstalledPackagePayload[]\n}\n\n// ---------------------------------------------------------------------------\n// Installation API\n// ---------------------------------------------------------------------------\n\nexport type InstallationMode = 'Extracted' | 'Sealed'\n\nexport type InstallationStatus =\n | 'Pending'\n | 'Installing'\n | 'Installed'\n | 'Updating'\n | 'Uninstalling'\n | 'Failed'\n | 'Uninstalled'\n\nexport interface Installation {\n id: string\n accountId: string\n workspaceId: string\n packageId: string\n packageVersionId: string\n packageName: string\n publisherName: string\n version: string\n installPath: string\n branch: string\n installMode: InstallationMode\n status: InstallationStatus\n installedBy: string\n errorMessage?: string | null\n createdAt: string\n updatedAt?: string | null\n securityFlagged: boolean\n securityFlagReason?: string | null\n isSystem: boolean\n systemKey?: string | null\n protectionReason?: string | null\n}\n\nexport interface CatalogImage {\n assetId: string\n url: string\n alt: string\n caption?: string | null\n mediaType: string\n}\n\nexport interface InstallationDetail {\n installation: Installation\n installedVersionStatus: string\n installedReadmeMarkdown?: string | null\n installedChangelogMarkdown?: string | null\n installedDisplayName?: string | null\n installedDescription?: string | null\n installedLogoUrl?: string | null\n installedHeroUrl?: string | null\n installedImages: CatalogImage[]\n installedBadges: string[]\n installedIsDeprecated: boolean\n installedDeprecationMessage?: string | null\n installedIsMalicious: boolean\n installedIsDelisted: boolean\n publisherId: string\n publisherName: string\n publisherDisplayName: string\n publisherLogoUrl?: string | null\n publisherIsVerified: boolean\n publisherBadges: string[]\n publisherIsMalicious: boolean\n packageBadges: string[]\n packageIsMalicious: boolean\n packageIsDeprecated: boolean\n packageDeprecationMessage?: string | null\n latestVersion?: string | null\n latestVersionId?: string | null\n updateAvailable: boolean\n canUpdate: boolean\n canRetry: boolean\n canDelete: boolean\n allowedActions: string[]\n}\n\nexport interface InstallationLifecycleResult {\n installationId: string\n status: InstallationStatus\n succeeded: boolean\n error?: string | null\n}\n\nexport interface InstallationScopedOptions {\n workspaceId?: string\n}\n\nexport interface InstallationListOptions extends InstallationScopedOptions {\n pageNo?: number\n pageSize?: number\n orderBy?: string\n packageId?: string\n branch?: string\n installPath?: string\n status?: InstallationStatus\n isSystem?: boolean\n}\n\nexport interface ResolveInstallationOptions extends InstallationScopedOptions {\n branch?: string\n}\n\nexport interface UpdateInstallationOptions extends InstallationScopedOptions {\n packageVersion?: string\n installMode?: InstallationMode\n}\n\n// ---------------------------------------------------------------------------\n// Auth Strategy (internal)\n// ---------------------------------------------------------------------------\n\nexport interface AuthStrategy {\n getAuthHeader(): Promise<string | null>\n destroy?(): void\n}\n\n// ---------------------------------------------------------------------------\n// Application Manifest\n// ---------------------------------------------------------------------------\n\nexport interface MimeTypeBinding {\n pattern: string\n mode: 'view' | 'edit'\n priority: number\n icon?: string\n}\n\nexport interface ApplicationFileType {\n pattern: string\n extensions: string[]\n priority: number\n icon?: string\n}\n\nexport interface ApplicationManifest {\n apiVersion: string\n kind: 'Application'\n metadata: ManifestMetadata\n spec: ApplicationSpec\n}\n\nexport interface ManifestMetadata {\n name: string\n displayName?: string\n description?: string\n icon?: string\n version?: string\n author?: string\n labels?: Record<string, string>\n annotations?: Record<string, string>\n}\n\nexport type InstallMode = 'seed' | 'managed'\n\nexport interface InstallDirective {\n /** Source path/glob relative to the package payload root. Must match at least one file. */\n from: string\n /**\n * Destination workspace-absolute VFS path. A trailing `/` denotes a directory (the source's\n * basename / relative subpath is preserved beneath it); otherwise an exact file path.\n */\n to: string\n /**\n * `seed` = install once, never overwrite an existing/user-edited file (never removed on upgrade);\n * `managed` = app-owned, created and replaced on upgrade, removed on uninstall. Default `managed`.\n */\n mode?: InstallMode\n /** Optional explicit MIME for placed nodes; else inferred / resolved by json-schema. */\n mime?: string\n /** Optional sequential install phase; omitted directives remain in the legacy single phase. */\n phase?: number\n}\n\nexport interface ApplicationLaunchConfig {\n /**\n * Enables standalone launch from the workspace. Defaults to `false`.\n *\n * When enabled, the platform requires `entryPoint` or `spec.entry` to\n * resolve an iframe entry.\n */\n enabled?: boolean\n /**\n * Optional entry-point ID to use as the standalone home. When omitted, the\n * platform falls back to `spec.entry`.\n */\n entryPoint?: string\n /**\n * Whether users may pin the launch surface. Defaults to `false` and does not\n * pin it automatically.\n */\n pinnable?: boolean\n}\n\nexport interface ApplicationDisplayOptions {\n fullscreen?: boolean\n}\n\nexport interface ApplicationEntryPoint {\n id: string\n displayName?: string\n description?: string\n icon?: string\n route?: string\n /** Optional per-entry-point iframe URL override. */\n entry?: string\n /** Optional splash URL override. Relative values resolve against this entry point's iframe URL. */\n splash?: string\n order?: number\n mimeTypes?: MimeTypeBinding[]\n display?: ApplicationDisplayOptions\n}\n\nexport interface ApplicationSpec {\n /** Optional iframe UI surface URL. Omit for a headless / file-collection app. */\n entry?: string\n /** Optional application splash URL. Relative values resolve against the selected iframe entry URL. */\n splash?: string\n /** Named iframe surfaces; `launch.entryPoint` references one of these ids. */\n entryPoints?: ApplicationEntryPoint[]\n scope?: string\n mimeTypes?: MimeTypeBinding[]\n fileTypes?: ApplicationFileType[]\n capabilities?: string[]\n permissions?: string[]\n sandbox?: SandboxOptions\n oauth?: OAuthConfig\n scopes?: string[]\n /** Declarative install map: where packaged files land in the workspace VFS. */\n install?: InstallDirective[]\n /** Where the app-record (manifest node) is anchored. Default `/applications/{name}`. */\n installRoot?: string\n /** Default display behavior inherited by entry points. */\n display?: ApplicationDisplayOptions\n /**\n * Opt-in standalone workspace launch configuration. The platform defaults\n * `enabled` and `pinnable` to `false` when omitted.\n */\n launch?: ApplicationLaunchConfig\n /**\n * Workspace settings and secrets this app requires. Declared settings are auto-registered\n * in the workspace settings store under `{metadata.name}.{key}` and surfaced in the\n * settings UI. Secret values never reach browser contexts.\n */\n settings?: SettingDeclaration[]\n}\n\n/** Data type of a declared setting value. */\nexport type SettingDeclarationType = 'string' | 'number' | 'boolean' | 'select' | 'file'\n\n/**\n * A workspace setting or secret an application/engine manifest requires. The platform\n * auto-creates a matching setting definition (namespaced `{manifest-name}.{key}`) so\n * workspace admins can provide the value; engines receive values at run time.\n */\nexport interface SettingDeclaration {\n /** Short key; stored namespaced as `{metadata.name}.{key}` in the settings store. */\n key: string\n /** Optional environment variable name injected into engine runs (e.g. `MY_API_KEY`). */\n env?: string\n /**\n * Secret values are server-only: delivered to Docker engine runs, never to browser\n * contexts (wasm runs, iframe apps). Defaults to `false`.\n */\n secret?: boolean\n /**\n * Required settings prompt during marketplace install and fail an execution fast when\n * no value is configured. Defaults to `false`.\n */\n required?: boolean\n displayName?: string\n description?: string\n /**\n * Value input type. `file` prompts the installer to select a local file and stores its\n * bytes as a base64 string. Defaults to `string`.\n */\n type?: SettingDeclarationType\n /** Default value. Not allowed for secrets. */\n default?: string | number | boolean\n /** Allowed values when `type` is `select`. */\n options?: string[]\n}\n\nexport interface OAuthConfig {\n clientType: string\n redirectUris?: string[]\n}\n\nexport interface SandboxOptions {\n allowScripts?: boolean\n allowSameOrigin?: boolean\n allowPopups?: boolean\n allowForms?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Execution API\n// ---------------------------------------------------------------------------\n\n/** Lifecycle status of an execution. Mirrors the platform `ExecutionStatus` enum. */\nexport type ExecutionStatus =\n | 'Pending'\n | 'Queued'\n | 'Running'\n | 'Completed'\n | 'Failed'\n | 'Cancelled'\n | 'TimedOut'\n | 'AwaitingClient'\n\n/** How an execution is run. Mirrors the platform `ExecutionMode` enum. */\nexport type ExecutionMode = 'RequestResponse' | 'LongRunning' | 'Scheduled' | 'EventDriven'\n\n/** What triggered an execution. Mirrors the platform `ExecutionTrigger` enum. */\nexport type ExecutionTrigger = 'User' | 'Api' | 'Schedule' | 'Event'\n\n/** The structured outcome of an execution. */\nexport interface ExecutionResult {\n exitCode: number\n stdout?: string | null\n stderr?: string | null\n /** Raw JSON payload the engine reported in `result.json`, as a string. */\n data?: string | null\n artifacts: string[]\n durationMs: number\n error?: string | null\n}\n\n/** A single execution record. */\nexport interface Execution {\n id: string\n workspaceId: string\n engineId: string\n engineName: string\n filePath?: string | null\n mode: ExecutionMode\n trigger: ExecutionTrigger\n tool?: string | null\n status: ExecutionStatus\n requestedAt: string\n startedAt?: string | null\n completedAt?: string | null\n result?: ExecutionResult | null\n}\n\n/** Captured stdout/stderr of an execution. */\nexport interface ExecutionLogs {\n stdout?: string | null\n stderr?: string | null\n}\n\n/** Options for running a file (engine resolved by the file's type). */\nexport interface RunFileOptions {\n /** Workspace to run in. Defaults to the client's workspace. */\n workspaceId?: string\n branch?: string\n tool?: string\n mode?: string\n arguments?: string[]\n /** Structured parameters passed to the engine; serialized to JSON for the platform. */\n parameters?: Record<string, unknown>\n}\n\n/** Options for executing a specific engine (optionally against a file). */\nexport interface ExecuteEngineOptions {\n workspaceId?: string\n filePath?: string\n branch?: string\n tool?: string\n mode?: string\n arguments?: string[]\n parameters?: Record<string, unknown>\n}\n\n/** Options that only need to scope a request to a workspace. */\nexport interface ExecutionScopedOptions {\n workspaceId?: string\n}\n\nexport interface ExecutionListOptions extends ExecutionScopedOptions {\n filePath?: string\n engineIds?: string[]\n filePaths?: string[]\n status?: ExecutionStatus\n trigger?: ExecutionTrigger\n activeOnly?: boolean\n requestedAfter?: string\n requestedBefore?: string\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\nexport interface PagedResult<T> {\n totalCount: number\n pageCount: number\n pageSize: number\n pageNumber: number\n data: T[]\n}\n\nexport interface EngineRuntime {\n kind: 'Docker' | 'Wasm'\n image?: string | null\n pullPolicy?: string | null\n moduleUrl?: string | null\n runtimeHint?: string | null\n serverCompatible: boolean\n clientCompatible: boolean\n adapterUrl?: string | null\n}\n\nexport interface EngineFileType {\n pattern: string\n extensions: string[]\n priority: number\n icon?: string\n}\n\nexport interface EngineTool {\n name: string\n description?: string | null\n inputSchema?: string | null\n outputSchema?: string | null\n}\n\nexport interface ExecutionEngine {\n id: string\n workspaceId: string\n name: string\n displayName: string\n description?: string | null\n icon?: string | null\n version: string\n author?: string | null\n category?: string | null\n tier?: string | null\n sourcePath: string\n priority: number\n enabled: boolean\n capabilities: string[]\n permissions: string[]\n supportedModes: string[]\n runtimes: EngineRuntime[]\n fileTypes: EngineFileType[]\n tools: EngineTool[]\n resources?: {\n cpu?: string | null\n memory?: string | null\n timeoutSeconds: number\n maxConcurrent: number\n storage?: string | null\n } | null\n sandbox?: {\n network: string\n allowedHosts: string[]\n readOnlyRoot: boolean\n noNewPrivileges: boolean\n } | null\n firstParty: boolean\n}\n\nexport interface ExecutionEngineListOptions extends ExecutionScopedOptions {\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\n/** Options for polling an execution to completion. */\nexport interface WaitOptions extends ExecutionScopedOptions {\n /** Poll interval in milliseconds (default 1000). */\n intervalMs?: number\n /** Maximum time to wait in milliseconds before throwing. */\n timeoutMs?: number\n /** Abort signal to cancel waiting. */\n signal?: AbortSignal\n}\n\n// ---------------------------------------------------------------------------\n// Settings API\n// ---------------------------------------------------------------------------\n\n/** An allowed value for a `select` setting. */\nexport interface SettingOption {\n value: string\n label: string\n}\n\n/**\n * A single workspace setting merged from its definition and any stored value.\n * Secret values are always `null` for browser callers; `hasValue` still reports\n * whether a value (or default) is configured.\n */\nexport interface SettingItem {\n key: string\n group: string\n label: string\n description?: string | null\n dataType: string\n isSecret: boolean\n options?: SettingOption[] | null\n defaultValue?: unknown\n value?: unknown\n hasValue: boolean\n}\n\n/** A labeled group of settings (e.g. one group per application). */\nexport interface SettingGroup {\n key: string\n label: string\n items: SettingItem[]\n}\n\n/** Options that scope a settings request to a workspace. */\nexport interface SettingsScopedOptions {\n workspaceId?: string\n}\n\n/** Presence-only result. Stored secret and non-secret values are never included. */\nexport interface SettingPresence {\n key: string\n hasStoredValue: boolean\n hasEffectiveValue: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Resource API\n// ---------------------------------------------------------------------------\n\nexport interface ResourceMimeTypeBinding {\n id: string\n pattern: string\n mode: string\n priority: number\n}\n\nexport interface ResourceRegistration {\n id: string\n accountId: string\n workspaceId: string\n name: string\n displayName?: string | null\n description?: string | null\n icon?: string | null\n version?: string | null\n author?: string | null\n entryUrl?: string | null\n kind: string\n scope: string\n manifestPath: string\n manifestNodeId: string\n manifestHash: string\n branch: string\n spec?: string | null\n labels?: string | null\n capabilities?: string | null\n permissions?: string | null\n sandboxConfig?: string | null\n createdAt: string\n updatedAt?: string | null\n mimeTypeBindings: ResourceMimeTypeBinding[]\n entryPointId?: string | null\n entryPointDisplayName?: string | null\n entryPointDescription?: string | null\n entryPointIcon?: string | null\n entryPointRoute?: string | null\n entryPointEntryUrl?: string | null\n entryPointMode?: string | null\n entryPointMatchedPattern?: string | null\n entryPointPriority?: number | null\n entryPointFullscreen?: boolean | null\n entryPointSplashUrl?: string | null\n launchEnabled: boolean\n launchEntryPointId?: string | null\n launchPinnable: boolean\n}\n\nexport interface ResourceScopedOptions {\n workspaceId?: string\n}\n\n// ---------------------------------------------------------------------------\n// HTTP Transport Types (internal)\n// ---------------------------------------------------------------------------\n\nexport interface RequestOptions {\n headers?: Record<string, string>\n body?: BodyInit | null\n params?: Record<string, string | number | boolean | readonly (string | number)[] | undefined>\n}\n\nexport class ApiError extends Error {\n constructor(\n public readonly status: number,\n public readonly detail: string,\n public readonly title?: string,\n ) {\n super(title ?? `API error ${status}: ${detail}`)\n this.name = 'ApiError'\n }\n}\n","import { ApiError, type AuthStrategy, type RequestOptions } from '../types'\n\n/**\n * HTTP client for making direct API calls to the Verentis gateway.\n * Used in both standalone and iframe modes — the auth strategy determines\n * how the Authorization header is obtained.\n */\nexport class HttpTransport {\n constructor(\n private readonly baseUrl: string,\n private readonly auth: AuthStrategy,\n private readonly apiVersion: string = 'v1',\n ) {}\n\n async request<T>(method: string, path: string, options?: RequestOptions): Promise<T> {\n const url = this.buildUrl(path, options?.params)\n console.info('[Verentis SDK] Request started', { method, path, url })\n const headers: Record<string, string> = {}\n\n const authHeader = await this.auth.getAuthHeader()\n if (authHeader) {\n headers['Authorization'] = authHeader\n }\n\n if (options?.headers) {\n Object.assign(headers, options.headers)\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: options?.body,\n })\n\n if (!response.ok) {\n let detail = ''\n let title: string | undefined\n\n try {\n const body = await response.json()\n // ProblemDetails format\n detail = body.detail ?? body.message ?? JSON.stringify(body)\n title = body.title\n } catch {\n detail = await response.text().catch(() => response.statusText)\n }\n\n console.error('[Verentis SDK] Request failed', {\n method,\n path,\n status: response.status,\n detail,\n })\n throw new ApiError(response.status, detail, title)\n }\n\n console.info('[Verentis SDK] Request succeeded', {\n method,\n path,\n status: response.status,\n contentType: response.headers.get('content-type') ?? '',\n })\n const contentType = response.headers.get('content-type') ?? ''\n if (contentType.includes('application/json')) {\n return response.json() as Promise<T>\n }\n\n // For non-JSON responses (e.g. binary file downloads), return the blob\n return response.blob() as unknown as T\n }\n\n async requestRaw(method: string, path: string, options?: RequestOptions): Promise<Response> {\n const url = this.buildUrl(path, options?.params)\n console.info('[Verentis SDK] Raw request started', { method, path, url })\n const headers: Record<string, string> = {}\n\n const authHeader = await this.auth.getAuthHeader()\n if (authHeader) {\n headers['Authorization'] = authHeader\n }\n\n if (options?.headers) {\n Object.assign(headers, options.headers)\n }\n\n const response = await fetch(url, { method, headers, body: options?.body })\n console.info('[Verentis SDK] Raw request completed', {\n method,\n path,\n status: response.status,\n ok: response.ok,\n contentType: response.headers.get('content-type') ?? '',\n })\n return response\n }\n\n private buildUrl(path: string, params?: RequestOptions['params']): string {\n const base = `${this.baseUrl}/${this.apiVersion}${path}`\n\n if (!params) return base\n\n const searchParams = new URLSearchParams()\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) {\n continue\n }\n\n if (Array.isArray(value)) {\n for (const item of value) {\n searchParams.append(key, String(item))\n }\n } else {\n searchParams.set(key, String(value))\n }\n }\n\n const qs = searchParams.toString()\n return qs ? `${base}?${qs}` : base\n }\n}\n","import { ApiKeyAuth } from './auth/api-key.auth'\nimport { BridgeAuth } from './auth/bridge.auth'\nimport { TokenAuth } from './auth/token.auth'\nimport { ContextModule } from './modules/context'\nimport { ExecutionsModule } from './modules/executions'\nimport { EnginesModule } from './modules/engines'\nimport { FilesModule } from './modules/files'\nimport { InstallationsModule } from './modules/installations'\nimport { ResourcesModule } from './modules/resources'\nimport { SettingsModule } from './modules/settings'\nimport { Bridge } from './transport/bridge.transport'\nimport { HttpTransport } from './transport/http.transport'\nimport type { AuthStrategy, VerentisClientOptions } from './types'\n\n/**\n * The main Verentis SDK client.\n * Provides access to file operations, workspace context, and (in iframe mode)\n * the host communication bridge.\n */\nexport class VerentisClient {\n files!: FilesModule\n executions!: ExecutionsModule\n engines!: EnginesModule\n installations!: InstallationsModule\n resources!: ResourcesModule\n settings!: SettingsModule\n readonly context: ContextModule\n readonly bridge: Bridge | null\n\n private readonly _auth: AuthStrategy\n private _http!: HttpTransport\n private _ready: Promise<void>\n\n constructor(options?: VerentisClientOptions) {\n this.context = new ContextModule()\n\n const environment = detectEnvironment()\n\n if (environment === 'iframe' && !options?.auth) {\n // --- iframe mode ---\n this.bridge = new Bridge()\n const bridgeAuth = new BridgeAuth('*') // origin validated after init\n this._auth = bridgeAuth\n\n this._ready = this.initFromBridge(bridgeAuth)\n } else {\n // --- standalone mode ---\n this.bridge = null\n this._auth = createAuthStrategy(options)\n\n const apiUrl = options?.apiUrl\n if (!apiUrl) {\n throw new Error('apiUrl is required in standalone mode')\n }\n\n this.context.setApiUrl(apiUrl)\n if (options?.workspaceId) {\n this.context.setWorkspace({ id: options.workspaceId })\n }\n\n this._http = new HttpTransport(apiUrl, this._auth, options?.apiVersion ?? 'v1')\n this.files = new FilesModule(this._http, options?.workspaceId)\n this.executions = new ExecutionsModule(this._http, options?.workspaceId)\n this.engines = new EnginesModule(this._http, options?.workspaceId)\n this.installations = new InstallationsModule(this._http, options?.workspaceId)\n this.resources = new ResourcesModule(this._http, options?.workspaceId)\n this.settings = new SettingsModule(this._http, options?.workspaceId)\n this._ready = Promise.resolve()\n return\n }\n\n // _http and files are set after bridge init via initFromBridge()\n }\n\n /**\n * Returns a promise that resolves when the client is fully initialized.\n * In standalone mode this resolves immediately.\n * In iframe mode this resolves after the host sends `verentis:init`.\n */\n whenReady(): Promise<void> {\n return this._ready\n }\n\n /** Clean up resources (timers, event listeners) */\n destroy(): void {\n this._auth.destroy?.()\n this.bridge?.destroy()\n }\n\n private async initFromBridge(bridgeAuth: BridgeAuth): Promise<void> {\n // Signal readiness to the host\n this.bridge!.sendReady()\n\n // Wait for host to send context + token\n const { context, token } = await this.bridge!.waitForInit()\n\n // Now we know the host origin — update the bridge auth\n const hostOrigin = this.bridge!.hostOrigin!\n // Re-create BridgeAuth with the actual origin\n Object.assign(bridgeAuth, new BridgeAuth(hostOrigin))\n bridgeAuth.setToken(token)\n\n // Set context\n this.context.setFromAppContext(context)\n\n // Create transport and modules now that we have the API URL\n const http = new HttpTransport(\n context.apiUrl,\n bridgeAuth,\n 'v1',\n )\n\n this._http = http\n this.files = new FilesModule(http, context.workspace.id)\n this.executions = new ExecutionsModule(http, context.workspace.id)\n this.engines = new EnginesModule(http, context.workspace.id)\n this.installations = new InstallationsModule(http, context.workspace.id)\n this.resources = new ResourcesModule(http, context.workspace.id)\n this.settings = new SettingsModule(http, context.workspace.id)\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction detectEnvironment(): 'iframe' | 'standalone' {\n if (typeof window !== 'undefined' && window.parent !== window) {\n return 'iframe'\n }\n return 'standalone'\n}\n\nfunction createAuthStrategy(options?: VerentisClientOptions): AuthStrategy {\n if (!options?.auth) {\n throw new Error('auth is required in standalone mode: provide { apiKey } or { token }')\n }\n\n if ('apiKey' in options.auth) {\n return new ApiKeyAuth(options.auth.apiKey)\n }\n\n if ('token' in options.auth) {\n return new TokenAuth(\n options.auth.token,\n options.auth.expiresAt,\n options.auth.refreshToken,\n )\n }\n\n throw new Error('Invalid auth options: provide { apiKey } or { token }')\n}\n","import type { MimeTypeBinding } from '../types'\n\n/**\n * Tests whether a MIME type matches a pattern.\n * Supports wildcards: `image/*` matches `image/png`, `*/*` matches everything.\n * Comparison is case-insensitive and ignores parameters (e.g. `; charset=utf-8`).\n */\nexport function matchMimeType(pattern: string, mimeType: string): boolean {\n const normalizedPattern = stripParams(pattern).toLowerCase()\n const normalizedMime = stripParams(mimeType).toLowerCase()\n\n if (normalizedPattern === '*/*') return true\n\n const [patternType, patternSubtype] = normalizedPattern.split('/')\n const [mimeTypeType, mimeSubtype] = normalizedMime.split('/')\n\n if (!patternType || !mimeTypeType) return false\n if (patternType === '*') return true\n if (patternType !== mimeTypeType) return false\n if (!patternSubtype || patternSubtype === '*') return true\n\n return patternSubtype === mimeSubtype\n}\n\n/**\n * Finds the best matching binding for a given MIME type.\n * Exact matches beat wildcard matches at the same priority level.\n * Higher priority values are preferred.\n */\nexport function findBestMatch(\n mimeType: string,\n bindings: MimeTypeBinding[],\n): MimeTypeBinding | null {\n const matches = bindings\n .filter((b) => matchMimeType(b.pattern, mimeType))\n .sort((a, b) => {\n const aExact = !a.pattern.includes('*')\n const bExact = !b.pattern.includes('*')\n if (aExact !== bExact) return aExact ? -1 : 1\n return b.priority - a.priority\n })\n\n return matches[0] ?? null\n}\n\n/**\n * Strips parameters from a MIME type string.\n * `application/json; charset=utf-8` → `application/json`\n */\nfunction stripParams(mime: string): string {\n const idx = mime.indexOf(';')\n return idx === -1 ? mime.trim() : mime.slice(0, idx).trim()\n}\n","import { VerentisClient } from './client'\nimport type { VerentisClientOptions } from './types'\n\n/**\n * Create a new Verentis SDK client.\n *\n * @example Standalone mode (local development)\n * ```ts\n * const client = createVerentisClient({\n * apiUrl: 'https://api.verentis.com',\n * auth: { apiKey: 'vrt_abc123_...' },\n * workspaceId: 'workspace-uuid',\n * })\n *\n * const file = await client.files.get('/documents/report.json')\n * ```\n *\n * @example iframe mode (auto-detected at runtime)\n * ```ts\n * const client = createVerentisClient()\n * await client.whenReady()\n *\n * const { surface, workspace } = client.context\n * if (surface === 'file') {\n * const content = await client.files.readContent(client.context.file.path)\n * }\n * ```\n */\nexport function createVerentisClient(options?: VerentisClientOptions): VerentisClient {\n return new VerentisClient(options)\n}\n\n// Re-export everything\nexport { VerentisClient } from './client'\nexport { matchMimeType, findBestMatch } from './utils/mime'\nexport { Bridge } from './transport/bridge.transport'\nexport { HttpTransport } from './transport/http.transport'\nexport { ApiKeyAuth } from './auth/api-key.auth'\nexport { TokenAuth } from './auth/token.auth'\nexport { BridgeAuth } from './auth/bridge.auth'\nexport { FilesModule } from './modules/files'\nexport { ContextModule } from './modules/context'\nexport { ExecutionsModule, isTerminalStatus } from './modules/executions'\nexport { EnginesModule } from './modules/engines'\nexport { InstallationsModule } from './modules/installations'\nexport { ResourcesModule } from './modules/resources'\nexport { SettingsModule } from './modules/settings'\nexport type { NamespacedSettings } from './modules/settings'\n\n// Re-export types\nexport type {\n // PostMessage protocol\n VerentisMessage,\n VerentisInitMessage,\n VerentisReadyMessage,\n VerentisTokenRefreshMessage,\n VerentisTokenRefreshedMessage,\n VerentisFileChangedMessage,\n VerentisThemeMessage,\n VerentisNavigateMessage,\n VerentisResizeMessage,\n VerentisTitleMessage,\n VerentisDirtyMessage,\n HostToAppMessage,\n AppToHostMessage,\n // Context\n AppSurface,\n AppContext,\n FileAppContext,\n WorkspaceAppContext,\n WorkspaceInfo,\n FileInfo,\n EntryPointInfo,\n TokenInfo,\n // Client\n VerentisClientOptions,\n AuthOptions,\n NavigateOptions,\n // File API\n FileEntry,\n GetFileOptions,\n WriteFileOptions,\n MoveFileOptions,\n DeleteFileOptions,\n ArchiveFormat,\n ReadArchiveOptions,\n ExtractUploadOptions,\n InstalledPackageDescriptor,\n InstalledPackagePayload,\n // Installation API\n CatalogImage,\n Installation,\n InstallationDetail,\n InstallationLifecycleResult,\n InstallationListOptions,\n InstallationMode,\n InstallationScopedOptions,\n InstallationStatus,\n ResolveInstallationOptions,\n UpdateInstallationOptions,\n // Execution API\n Execution,\n ExecutionResult,\n ExecutionLogs,\n ExecutionStatus,\n ExecutionMode,\n ExecutionTrigger,\n RunFileOptions,\n ExecuteEngineOptions,\n ExecutionScopedOptions,\n ExecutionListOptions,\n ExecutionEngine,\n ExecutionEngineListOptions,\n EngineRuntime,\n EngineFileType,\n EngineTool,\n PagedResult,\n WaitOptions,\n // Settings API\n SettingGroup,\n SettingItem,\n SettingOption,\n SettingsScopedOptions,\n SettingPresence,\n // Resource API\n ResourceRegistration,\n ResourceMimeTypeBinding,\n ResourceScopedOptions,\n // Auth\n AuthStrategy,\n // Manifest\n ApplicationManifest,\n ManifestMetadata,\n ApplicationSpec,\n ApplicationLaunchConfig,\n ApplicationEntryPoint,\n ApplicationDisplayOptions,\n ApplicationFileType,\n MimeTypeBinding,\n SandboxOptions,\n OAuthConfig,\n SettingDeclaration,\n SettingDeclarationType,\n // HTTP\n RequestOptions,\n ApiError,\n} from './types'\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/auth/api-key.auth.ts","../src/auth/bridge.auth.ts","../src/auth/token.auth.ts","../src/modules/context.ts","../src/modules/executions.ts","../src/modules/engines.ts","../src/modules/files.ts","../src/modules/installations.ts","../src/modules/resources.ts","../src/modules/settings.ts","../src/transport/header-actions.ts","../src/transport/bridge.transport.ts","../src/types.ts","../src/transport/http.transport.ts","../src/client.ts","../src/utils/mime.ts","../src/index.ts"],"names":["delay","SKEW_MS"],"mappings":";;;AAOO,IAAM,aAAN,MAAyC;AAAA,EAC9C,YAA6B,MAAA,EAAgB;AAAhB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAC3B,IAAA,IAAI,CAAC,MAAA,CAAO,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,CAAO,CAAC,MAAM,aAAA,CAAc,CAAA,CAAE,OAAA,EAAS,QAAQ,CAAC,CAAA,CAChD,IAAA,CAAK,CAAC,GAAG,CAAA,KAAM;AACd,IAAA,MAAM,MAAA,GAAS,CAAC,CAAA,CAAE,OAAA,CAAQ,SAAS,GAAG,CAAA;AACtC,IAAA,MAAM,MAAA,GAAS,CAAC,CAAA,CAAE,OAAA,CAAQ,SAAS,GAAG,CAAA;AACtC,IAAA,IAAI,MAAA,KAAW,MAAA,EAAQ,OAAO,MAAA,GAAS,EAAA,GAAK,CAAA;AAC5C,IAAA,OAAO,CAAA,CAAE,WAAW,CAAA,CAAE,QAAA;AAAA,EACxB,CAAC,CAAA;AAEH,EAAA,OAAO,OAAA,CAAQ,CAAC,CAAA,IAAK,IAAA;AACvB;AAMA,SAAS,YAAY,IAAA,EAAsB;AACzC,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC5B,EAAA,OAAO,GAAA,KAAQ,EAAA,GAAK,IAAA,CAAK,IAAA,EAAK,GAAI,KAAK,KAAA,CAAM,CAAA,EAAG,GAAG,CAAA,CAAE,IAAA,EAAK;AAC5D;;;ACxBO,SAAS,qBAAqB,OAAA,EAAiD;AACpF,EAAA,OAAO,IAAI,eAAe,OAAO,CAAA;AACnC","file":"index.cjs","sourcesContent":["import type { AuthStrategy } from '../types'\n\n/**\n * Authenticates with a Verentis API key (`vrt_` prefix).\n * The backend detects the `vrt_` prefix in the Bearer token and resolves it\n * as an API key rather than a JWT.\n */\nexport class ApiKeyAuth implements AuthStrategy {\n constructor(private readonly apiKey: string) {\n if (!apiKey.startsWith('vrt_')) {\n throw new Error('Invalid API key format: must start with \"vrt_\"')\n }\n }\n\n async getAuthHeader(): Promise<string> {\n return `Bearer ${this.apiKey}`\n }\n}\n","import type {\n AuthStrategy,\n TokenInfo,\n VerentisTokenRefreshMessage,\n VerentisTokenRefreshedMessage,\n} from '../types'\n\nconst SKEW_MS = 30_000\n\n/**\n * Authenticates via the PostMessage bridge in iframe mode.\n * The token is received from the host during initialization and refreshed\n * by requesting a new token from the host when nearing expiry.\n */\nexport class BridgeAuth implements AuthStrategy {\n private _token: string | null = null\n private _expiresAt = 0\n private _refreshTimer: ReturnType<typeof setTimeout> | null = null\n private _pendingRefresh: Promise<void> | null = null\n private _messageHandler: (event: MessageEvent) => void\n\n constructor(private readonly hostOrigin: string) {\n this._messageHandler = this.handleMessage.bind(this)\n if (typeof window !== 'undefined') {\n window.addEventListener('message', this._messageHandler)\n }\n }\n\n /** Set the initial token received from the host's `verentis:init` message */\n setToken(info: TokenInfo): void {\n this._token = info.accessToken\n this._expiresAt = new Date(info.expiresAt).getTime()\n this.scheduleRefresh()\n }\n\n async getAuthHeader(): Promise<string | null> {\n if (!this._token) return null\n if (this.isExpired()) {\n await this.requestRefresh()\n }\n return `Bearer ${this._token}`\n }\n\n destroy(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', this._messageHandler)\n }\n }\n\n private isExpired(): boolean {\n return Date.now() >= this._expiresAt - SKEW_MS\n }\n\n private _refreshResolve: (() => void) | null = null\n\n private requestRefresh(): Promise<void> {\n if (this._pendingRefresh) return this._pendingRefresh\n\n const requestId = crypto.randomUUID()\n\n this._pendingRefresh = new Promise<void>((resolve) => {\n this._refreshResolve = resolve\n })\n\n const message: VerentisTokenRefreshMessage = {\n type: 'verentis:token:refresh',\n version: 1,\n requestId,\n }\n window.parent.postMessage(message, this.hostOrigin)\n\n return this._pendingRefresh\n }\n\n private handleMessage(event: MessageEvent): void {\n if (event.origin !== this.hostOrigin) return\n\n const data = event.data as VerentisTokenRefreshedMessage\n if (data?.type !== 'verentis:token:refreshed') return\n\n this._token = data.token.accessToken\n this._expiresAt = new Date(data.token.expiresAt).getTime()\n this._pendingRefresh = null\n this._refreshResolve?.()\n this._refreshResolve = null\n this.scheduleRefresh()\n }\n\n private scheduleRefresh(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (this._expiresAt === 0) return\n\n const delay = Math.max(0, this._expiresAt - Date.now() - SKEW_MS)\n this._refreshTimer = setTimeout(() => void this.requestRefresh(), delay)\n }\n}\n","import type { AuthStrategy, TokenInfo } from '../types'\n\nconst SKEW_MS = 30_000\n\n/**\n * Authenticates with a pre-existing bearer token.\n * Tracks expiry and invokes an optional refresh callback before the token expires.\n */\nexport class TokenAuth implements AuthStrategy {\n private _token: string\n private _expiresAt: number\n private _refreshTimer: ReturnType<typeof setTimeout> | null = null\n private _refreshFn?: () => Promise<TokenInfo>\n\n constructor(token: string, expiresAt?: string, refreshFn?: () => Promise<TokenInfo>) {\n this._token = token\n this._expiresAt = expiresAt ? new Date(expiresAt).getTime() : Infinity\n this._refreshFn = refreshFn\n this.scheduleRefresh()\n }\n\n async getAuthHeader(): Promise<string> {\n if (this.isExpired() && this._refreshFn) {\n await this.refresh()\n }\n return `Bearer ${this._token}`\n }\n\n /** Update the token (e.g. after a refresh) */\n update(info: TokenInfo): void {\n this._token = info.accessToken\n this._expiresAt = new Date(info.expiresAt).getTime()\n this.scheduleRefresh()\n }\n\n destroy(): void {\n if (this._refreshTimer) {\n clearTimeout(this._refreshTimer)\n this._refreshTimer = null\n }\n }\n\n private isExpired(): boolean {\n return Date.now() >= this._expiresAt - SKEW_MS\n }\n\n private async refresh(): Promise<void> {\n if (!this._refreshFn) return\n const info = await this._refreshFn()\n this.update(info)\n }\n\n private scheduleRefresh(): void {\n if (this._refreshTimer) clearTimeout(this._refreshTimer)\n if (!this._refreshFn || this._expiresAt === Infinity) return\n\n const delay = Math.max(0, this._expiresAt - Date.now() - SKEW_MS)\n this._refreshTimer = setTimeout(() => void this.refresh(), delay)\n }\n}\n","import type { AppContext, AppSurface, EntryPointInfo, FileInfo, WorkspaceInfo } from '../types'\n\n/**\n * Provides access to the current workspace and launch context.\n * In iframe mode, this is populated from the host's `verentis:init` message.\n * In standalone mode, the developer provides values via options.\n */\nexport class ContextModule {\n private _workspace: WorkspaceInfo | null = null\n private _surface: AppSurface | null = null\n private _file: FileInfo | null = null\n private _entryPoint: EntryPointInfo | null = null\n private _apiUrl: string | null = null\n\n /** The current workspace */\n get workspace(): WorkspaceInfo {\n if (!this._workspace) {\n throw new Error('Workspace context not available. Ensure the client is initialized.')\n }\n return this._workspace\n }\n\n /** The host surface that launched the app */\n get surface(): AppSurface {\n if (!this._surface) {\n throw new Error('Launch surface not available. Ensure the client is initialized.')\n }\n return this._surface\n }\n\n /** The file that triggered the app to open on a file surface */\n get file(): FileInfo {\n if (!this._file) {\n throw new Error('File context not available. The app may be running on a workspace surface.')\n }\n return this._file\n }\n\n /** The API URL */\n get apiUrl(): string {\n if (!this._apiUrl) {\n throw new Error('API URL not available. Ensure the client is initialized.')\n }\n return this._apiUrl\n }\n\n /** Whether a file context is available */\n get hasFile(): boolean {\n return this._file !== null\n }\n\n /** The application entry point that matched the opened file */\n get entryPoint(): EntryPointInfo | null {\n return this._entryPoint\n }\n\n /** Whether an entry point context is available */\n get hasEntryPoint(): boolean {\n return this._entryPoint !== null\n }\n\n /** Update context from the host's init message */\n setFromAppContext(ctx: AppContext): void {\n this._workspace = ctx.workspace\n this._surface = ctx.surface ?? 'file'\n this._file = ctx.file ?? null\n this._entryPoint = ctx.entryPoint ?? null\n this._apiUrl = ctx.apiUrl\n }\n\n /** Set workspace info directly (standalone mode) */\n setWorkspace(workspace: Partial<WorkspaceInfo> & { id: string }): void {\n this._workspace = {\n id: workspace.id,\n slug: workspace.slug ?? '',\n name: workspace.name ?? '',\n }\n }\n\n /** Set API URL directly */\n setApiUrl(url: string): void {\n this._apiUrl = url\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n ExecuteEngineOptions,\n Execution,\n ExecutionLogs,\n ExecutionListOptions,\n PagedResult,\n ExecutionScopedOptions,\n ExecutionStatus,\n RunFileOptions,\n WaitOptions,\n} from '../types'\n\nconst TERMINAL_STATUSES: ReadonlySet<ExecutionStatus> = new Set<ExecutionStatus>([\n 'Completed',\n 'Failed',\n 'Cancelled',\n 'TimedOut',\n])\n\n/** Returns true once an execution has reached a final state. */\nexport function isTerminalStatus(status: ExecutionStatus): boolean {\n return TERMINAL_STATUSES.has(status)\n}\n\n/**\n * Execution operations module. Triggers engine executions against files or a specific engine,\n * reads their status/result/logs, cancels them, and polls them to completion — all over the\n * Verentis execution API (`/v1/executions`).\n */\nexport class ExecutionsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /**\n * Run a file in the virtual file system. The platform resolves the appropriate engine from the\n * file's type (e.g. a `.py` file runs on the Python engine).\n */\n async run(filePath: string, options?: RunFileOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', '/executions', {\n body: JSON.stringify({\n workspaceId,\n filePath,\n branch: options?.branch,\n tool: options?.tool,\n mode: options?.mode,\n arguments: options?.arguments ?? [],\n parameters: serializeParameters(options?.parameters),\n }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /**\n * Execute a specific engine by id, optionally against a file and/or with structured parameters\n * (e.g. invoking an engine tool without a script).\n */\n async execute(engineId: string, options?: ExecuteEngineOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', '/executions', {\n body: JSON.stringify({\n workspaceId,\n engineId,\n filePath: options?.filePath,\n branch: options?.branch,\n tool: options?.tool,\n mode: options?.mode,\n arguments: options?.arguments ?? [],\n parameters: serializeParameters(options?.parameters),\n }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /** Get an execution by id. */\n async get(id: string, options?: ExecutionScopedOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('GET', `/executions/${encodeURIComponent(id)}`, {\n params: { workspaceId },\n })\n }\n\n /** List workspace executions with optional engine, file, lifecycle, and time filters. */\n async list(options?: ExecutionListOptions): Promise<PagedResult<Execution>> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<PagedResult<Execution>>('GET', '/executions', {\n params: {\n workspaceId,\n filePath: options?.filePath,\n engineIds: options?.engineIds,\n filePaths: options?.filePaths,\n status: options?.status,\n trigger: options?.trigger,\n activeOnly: options?.activeOnly,\n requestedAfter: options?.requestedAfter,\n requestedBefore: options?.requestedBefore,\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n })\n }\n\n /** Get the captured stdout/stderr of an execution. */\n async logs(id: string, options?: ExecutionScopedOptions): Promise<ExecutionLogs> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<ExecutionLogs>('GET', `/executions/${encodeURIComponent(id)}/logs`, {\n params: { workspaceId },\n })\n }\n\n /** Cancel a pending or running execution. */\n async cancel(id: string, options?: ExecutionScopedOptions): Promise<Execution> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<Execution>('POST', `/executions/${encodeURIComponent(id)}/cancel`, {\n body: JSON.stringify({ id, workspaceId }),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /**\n * Poll an execution until it reaches a terminal status. Returns immediately if it is already\n * terminal. Throws if `timeoutMs` elapses or the supplied signal aborts.\n */\n async wait(id: string, options?: WaitOptions): Promise<Execution> {\n const interval = options?.intervalMs ?? 1000\n const deadline = options?.timeoutMs ? Date.now() + options.timeoutMs : undefined\n\n for (;;) {\n const execution = await this.get(id, { workspaceId: options?.workspaceId })\n if (isTerminalStatus(execution.status)) {\n return execution\n }\n\n if (deadline !== undefined && Date.now() >= deadline) {\n throw new Error(`Timed out waiting for execution '${id}' to complete`)\n }\n\n await delay(interval, options?.signal)\n }\n }\n\n /**\n * Run a file and resolve once it has completed. For synchronous (request-response) executions the\n * initial response is already terminal; otherwise it polls via {@link wait}.\n */\n async runAndWait(filePath: string, options?: RunFileOptions & WaitOptions): Promise<Execution> {\n const execution = await this.run(filePath, options)\n if (isTerminalStatus(execution.status)) {\n return execution\n }\n return this.wait(execution.id, options)\n }\n\n private requireWorkspaceId(override?: string): string {\n const id = override ?? this.workspaceId\n if (!id) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return id\n }\n}\n\n/** The platform expects `parameters` as a JSON string; serialize structured input for ergonomics. */\nfunction serializeParameters(parameters?: Record<string, unknown>): string | undefined {\n return parameters === undefined ? undefined : JSON.stringify(parameters)\n}\n\nfunction delay(ms: number, signal?: AbortSignal): Promise<void> {\n if (signal?.aborted) {\n return Promise.reject(new DOMException('Aborted', 'AbortError'))\n }\n\n return new Promise((resolve, reject) => {\n const timer = setTimeout(resolve, ms)\n signal?.addEventListener(\n 'abort',\n () => {\n clearTimeout(timer)\n reject(new DOMException('Aborted', 'AbortError'))\n },\n { once: true },\n )\n })\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n ExecutionEngine,\n ExecutionEngineListOptions,\n ExecutionScopedOptions,\n PagedResult,\n} from '../types'\n\n/** Read-only access to execution engines registered in a workspace. */\nexport class EnginesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: ExecutionEngineListOptions): Promise<PagedResult<ExecutionEngine>> {\n return this.http.request<PagedResult<ExecutionEngine>>('GET', '/engines', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n })\n }\n\n async get(id: string, options?: ExecutionScopedOptions): Promise<ExecutionEngine> {\n return this.http.request<ExecutionEngine>('GET', `/engines/${encodeURIComponent(id)}`, {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type { DeleteFileOptions, ExtractUploadOptions, FileEntry, GetFileOptions, InstalledPackageDescriptor, MoveFileOptions, ReadArchiveOptions, WriteFileOptions } from '../types'\n\n/**\n * File operations module. Provides read, write, list, move, and delete\n * against the Verentis Node file API.\n */\nexport class FilesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /**\n * Get file metadata or directory listing.\n * For files: returns metadata (path, name, mimeType, size, etc.).\n * For directories: returns metadata with children array populated.\n */\n async get(path: string, options?: GetFileOptions): Promise<FileEntry> {\n const normalizedPath = normalizePath(path)\n return this.http.request<FileEntry>('GET', `/files/${normalizedPath}`, {\n params: {\n branch: options?.branch ?? 'main',\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n },\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Read the raw content of a file as a Blob.\n */\n async readContent(path: string, branch?: string): Promise<Blob> {\n const normalizedPath = normalizePath(path)\n const response = await this.http.requestRaw('GET', `/files/raw/${normalizedPath}`, {\n params: { branch: branch ?? 'main' },\n headers: {\n ...this.workspaceHeaders(),\n Accept: '*/*',\n },\n })\n if (!response.ok) {\n throw new Error(`Failed to read file content: ${response.status} ${response.statusText}`)\n }\n return response.blob()\n }\n\n /** Read UTF-8 text content from a workspace file. */\n async readText(path: string, branch?: string): Promise<string> {\n return (await this.readContent(path, branch)).text()\n }\n\n /** Inspect an extracted or sealed package node without exposing sealed payload content. */\n async getPackageDescriptor(path: string, branch = 'main'): Promise<InstalledPackageDescriptor> {\n return this.http.request<InstalledPackageDescriptor>('GET', '/files/package-descriptor', {\n params: { branch, path },\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Download a file or directory as an archive (zip or tgz).\n * Only applicable when the target has children or you want a packaged download.\n */\n async readArchive(path: string, options?: ReadArchiveOptions): Promise<Blob> {\n const normalizedPath = normalizePath(path)\n const format = options?.format ?? 'zip'\n const response = await this.http.requestRaw('GET', `/files/raw/${normalizedPath}`, {\n params: {\n branch: options?.branch ?? 'main',\n format,\n },\n headers: {\n ...this.workspaceHeaders(),\n Accept: format === 'tgz' ? 'application/gzip' : 'application/zip',\n },\n })\n if (!response.ok) {\n throw new Error(`Failed to download archive: ${response.status} ${response.statusText}`)\n }\n return response.blob()\n }\n\n /**\n * Upload an archive (zip or tgz) and auto-extract its contents as individual nodes.\n * If the archive contains a `.verentis-manifest.json`, the original metadata\n * (display names, mime types, parent-content relationships) will be honoured.\n */\n async extractUpload(path: string, file: Blob, options?: ExtractUploadOptions): Promise<void> {\n const normalizedPath = normalizePath(path)\n const formData = new FormData()\n\n const filename = options?.filename ?? 'archive.zip'\n formData.append('file', file, filename)\n\n const metadata: Record<string, unknown> = {}\n if (options?.branch) metadata.branch = options.branch\n formData.append('metadata', JSON.stringify(metadata))\n\n await this.http.request('POST', `/files/${normalizedPath}`, {\n body: formData,\n headers: {\n ...this.workspaceHeaders(),\n 'X-Auto-Extract': 'true',\n },\n })\n }\n\n /**\n * Upload or create a file.\n */\n async write(path: string, options: WriteFileOptions): Promise<void> {\n const normalizedPath = normalizePath(path)\n const formData = new FormData()\n\n let blob: Blob\n if (typeof options.content === 'string') {\n blob = new Blob([options.content], { type: options.contentType ?? 'text/plain' })\n } else if (options.content instanceof ArrayBuffer) {\n blob = new Blob([options.content], { type: options.contentType ?? 'application/octet-stream' })\n } else {\n blob = options.content\n }\n\n const filename = options.filename ?? extractFilename(path)\n formData.append('file', blob, filename)\n\n const metadata: Record<string, unknown> = {}\n if (options.contentType) metadata.contentType = options.contentType\n if (options.branch) metadata.branch = options.branch\n formData.append('metadata', JSON.stringify(metadata))\n\n await this.http.request('POST', `/files/${normalizedPath}`, {\n body: formData,\n headers: this.workspaceHeaders(),\n })\n }\n\n /**\n * Move or rename a file.\n */\n async move(options: MoveFileOptions): Promise<void> {\n await this.http.request('PUT', '/files', {\n body: JSON.stringify({\n from: normalizePath(options.from),\n to: normalizePath(options.to),\n branch: options.branch,\n }),\n headers: {\n ...this.workspaceHeaders(),\n 'Content-Type': 'application/json',\n },\n })\n }\n\n /**\n * Delete a file.\n */\n async remove(options: DeleteFileOptions): Promise<void> {\n await this.http.request('DELETE', '/files', {\n body: JSON.stringify({\n path: normalizePath(options.path),\n branch: options.branch,\n }),\n headers: {\n ...this.workspaceHeaders(),\n 'Content-Type': 'application/json',\n },\n })\n }\n\n private workspaceHeaders(): Record<string, string> {\n const headers: Record<string, string> = {}\n if (this.workspaceId) {\n headers['X-Workspace-Id'] = this.workspaceId\n }\n return headers\n }\n}\n\n/** Normalize a file path: strip leading/trailing slashes, collapse doubles */\nfunction normalizePath(path: string): string {\n return path\n .replace(/\\/+/g, '/')\n .replace(/^\\//, '')\n .replace(/\\/$/, '')\n}\n\n/** Extract filename from a path */\nfunction extractFilename(path: string): string {\n const segments = path.split('/')\n return segments[segments.length - 1] || 'file'\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n Installation,\n InstallationDetail,\n InstallationLifecycleResult,\n InstallationListOptions,\n InstallationScopedOptions,\n PagedResult,\n ResolveInstallationOptions,\n UpdateInstallationOptions,\n} from '../types'\n\n/** Manage Marketplace installation ledger records for the current workspace. */\nexport class InstallationsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: InstallationListOptions): Promise<PagedResult<Installation>> {\n return this.http.request<PagedResult<Installation>>('GET', '/installations', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n pageNo: options?.pageNo ?? 1,\n pageSize: options?.pageSize ?? 20,\n orderBy: options?.orderBy,\n packageId: options?.packageId,\n branch: options?.branch,\n installPath: options?.installPath,\n status: options?.status,\n isSystem: options?.isSystem,\n },\n })\n }\n\n async resolve(\n installPath: string,\n options?: ResolveInstallationOptions,\n ): Promise<InstallationDetail> {\n return this.http.request<InstallationDetail>('GET', '/installations/resolve', {\n params: {\n workspaceId: this.requireWorkspaceId(options?.workspaceId),\n branch: options?.branch ?? 'main',\n installPath,\n },\n })\n }\n\n async update(\n id: string,\n options?: UpdateInstallationOptions,\n ): Promise<InstallationLifecycleResult> {\n const workspaceId = this.requireWorkspaceId(options?.workspaceId)\n return this.http.request<InstallationLifecycleResult>(\n 'PUT',\n `/installations/${encodeURIComponent(id)}`,\n {\n body: JSON.stringify({\n id,\n workspaceId,\n packageVersion: options?.packageVersion,\n installMode: options?.installMode,\n }),\n headers: { 'Content-Type': 'application/json' },\n },\n )\n }\n\n async uninstall(id: string, options?: InstallationScopedOptions): Promise<void> {\n await this.http.request<void>('DELETE', `/installations/${encodeURIComponent(id)}`, {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type { ResourceRegistration, ResourceScopedOptions } from '../types'\n\n/** Read-only access to workspace Resource registrations and resolved application handlers. */\nexport class ResourcesModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n async list(options?: ResourceScopedOptions): Promise<ResourceRegistration[]> {\n return this.http.request<ResourceRegistration[]>('GET', '/resources', {\n params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) },\n })\n }\n\n async get(id: string, options?: ResourceScopedOptions): Promise<ResourceRegistration> {\n return this.http.request<ResourceRegistration>(\n 'GET',\n `/resources/${encodeURIComponent(id)}`,\n { params: { workspaceId: this.requireWorkspaceId(options?.workspaceId) } },\n )\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error('workspaceId is required: provide it in options or when creating the client')\n }\n return workspaceId\n }\n}\n","import type { HttpTransport } from '../transport/http.transport'\nimport type {\n SettingGroup,\n SettingItem,\n SettingPresence,\n SettingsScopedOptions,\n} from '../types'\n\n/**\n * Workspace settings module. Reads (and where permitted, writes) workspace-scoped settings\n * over the Verentis settings API (`/v1/settings`).\n *\n * The app token must carry the matching scopes, declared in the manifest's `spec.permissions`:\n * `fabric.setting.read` (get), `fabric.setting.read-all` (list), `fabric.setting.update` (set)\n * and `fabric.setting.delete` (reset).\n *\n * Secret values are server-only: for browser callers the platform always returns `value: null`\n * for secrets while `hasValue` reports whether one is configured. Manifest-declared settings\n * are stored namespaced as `{manifest-name}.{key}` — see {@link SettingsModule.namespaced}.\n */\nexport class SettingsModule {\n constructor(\n private readonly http: HttpTransport,\n private readonly workspaceId?: string,\n ) {}\n\n /** List every setting group visible to the workspace (definitions merged with values). */\n async list(options?: SettingsScopedOptions): Promise<SettingGroup[]> {\n return this.http.request<SettingGroup[]>('GET', '/settings', {\n params: this.scopeParams(options),\n })\n }\n\n /** Get a single setting by its full key (e.g. `graphite.api-key`). */\n async get(key: string, options?: SettingsScopedOptions): Promise<SettingItem> {\n return this.http.request<SettingItem>('GET', `/settings/${encodeURIComponent(key)}`, {\n params: this.scopeParams(options),\n })\n }\n\n /** Get a setting's value by its full key, or `defaultValue` when unset. */\n async getValue<T = unknown>(\n key: string,\n defaultValue?: T,\n options?: SettingsScopedOptions,\n ): Promise<T | undefined> {\n const item = await this.get(key, options)\n return (item.value ?? item.defaultValue ?? defaultValue) as T | undefined\n }\n\n /**\n * Check exact setting keys for retained stored values and effective defaults.\n * This never returns value content and also finds values retained after a definition is removed.\n */\n async presence(keys: string[], options?: SettingsScopedOptions): Promise<SettingPresence[]> {\n if (keys.length === 0) return []\n return this.http.request<SettingPresence[]>('GET', '/settings/presence', {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n keys,\n },\n })\n }\n\n /** Upsert a setting value by its full key. Requires the `fabric.setting.update` scope. */\n async set(key: string, value: unknown, options?: SettingsScopedOptions): Promise<void> {\n await this.http.request<void>('PUT', `/settings/${encodeURIComponent(key)}`, {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n },\n body: JSON.stringify(value ?? null),\n headers: { 'Content-Type': 'application/json' },\n })\n }\n\n /** Delete a stored value (reverting to the definition default). Requires `fabric.setting.delete`. */\n async reset(key: string, options?: SettingsScopedOptions): Promise<void> {\n await this.http.request<void>('DELETE', `/settings/${encodeURIComponent(key)}`, {\n params: {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n },\n })\n }\n\n /**\n * A view of this module where every key is auto-prefixed with `{namespace}.` — the platform's\n * manifest namespacing convention. An app named `graphite` declaring `key: api-key` reads it as:\n *\n * ```ts\n * const settings = client.settings.namespaced('graphite')\n * const apiKey = await settings.getValue<string>('api-key')\n * ```\n */\n namespaced(namespace: string): NamespacedSettings {\n const prefix = namespace.endsWith('.') ? namespace : `${namespace}.`\n return {\n get: (key, options) => this.get(prefix + key, options),\n getValue: (key, defaultValue, options) => this.getValue(prefix + key, defaultValue, options),\n set: (key, value, options) => this.set(prefix + key, value, options),\n reset: (key, options) => this.reset(prefix + key, options),\n }\n }\n\n private scopeParams(options?: SettingsScopedOptions): Record<string, string> {\n return {\n scopeKind: 'Workspace',\n parentId: this.requireWorkspaceId(options?.workspaceId),\n // Secret values never reach browser callers; the platform rejects `true` for\n // anything but trusted service-to-service identities.\n includeSecretValues: 'false',\n }\n }\n\n private requireWorkspaceId(override?: string): string {\n const workspaceId = override ?? this.workspaceId\n if (!workspaceId) {\n throw new Error(\n 'workspaceId is required: pass it in options or configure the client with one',\n )\n }\n return workspaceId\n }\n}\n\n/** Key-prefixed settings accessor returned by {@link SettingsModule.namespaced}. */\nexport interface NamespacedSettings {\n get(key: string, options?: SettingsScopedOptions): Promise<SettingItem>\n getValue<T = unknown>(\n key: string,\n defaultValue?: T,\n options?: SettingsScopedOptions,\n ): Promise<T | undefined>\n set(key: string, value: unknown, options?: SettingsScopedOptions): Promise<void>\n reset(key: string, options?: SettingsScopedOptions): Promise<void>\n}\n","export interface HeaderAction {\n id: string\n label: string\n icon?: string\n variant?: 'default' | 'outline' | 'destructive'\n /** Empty for client-only actions; otherwise a subset of the delegated token scopes. */\n scopes: string[]\n enabled?: boolean\n visible?: boolean\n busy?: boolean\n disabledReason?: string\n /** Clipboard actions return text for the host to copy during its user gesture. */\n kind?: 'clipboard'\n}\n\nexport interface HeaderActionResult {\n clipboardText?: string\n navigate?: { path: string; newTab?: boolean }\n}\n\nexport interface HeaderActionRegistration {\n update(action: HeaderAction): void\n dispose(): void\n}\n\nexport type HeaderActionHandler = () => void | HeaderActionResult | Promise<void | HeaderActionResult>\n\nexport function isHeaderAction(value: unknown): value is HeaderAction {\n if (!value || typeof value !== 'object') return false\n const a = value as Record<string, unknown>\n return typeof a.id === 'string' && /^[a-z][a-z0-9.-]{0,63}$/.test(a.id)\n && typeof a.label === 'string' && a.label.trim().length > 0 && a.label.length <= 100\n && Array.isArray(a.scopes) && a.scopes.length <= 32\n && a.scopes.every(s => typeof s === 'string' && /^[a-zA-Z0-9._:-]{1,128}$/.test(s))\n && (a.icon === undefined || (typeof a.icon === 'string' && /^lucide:[a-z0-9-]{1,64}$/.test(a.icon)))\n && (a.variant === undefined || ['default', 'outline', 'destructive'].includes(String(a.variant)))\n && ['enabled', 'visible', 'busy'].every(key => a[key] === undefined || typeof a[key] === 'boolean')\n && (a.disabledReason === undefined || (typeof a.disabledReason === 'string' && a.disabledReason.length <= 200))\n && (a.kind === undefined || a.kind === 'clipboard')\n}\n","import type {\n AppContext,\n AppToHostMessage,\n HostToAppMessage,\n NavigateOptions,\n TokenInfo,\n VerentisInitMessage,\n VerentisReadyMessage,\n VerentisActionInvokeMessage,\n} from '../types'\nimport { isHeaderAction, type HeaderAction, type HeaderActionHandler, type HeaderActionRegistration } from './header-actions'\n\ntype BridgeEventType = HostToAppMessage['type']\ntype BridgeListener = (data: HostToAppMessage) => void\n\n/**\n * PostMessage bridge for communication between an app (iframe) and the\n * workspace host. Handles the initialization handshake, token lifecycle,\n * and app-to-host events (navigate, resize, dirty, etc.).\n */\nexport class Bridge {\n private listeners = new Map<BridgeEventType, Set<BridgeListener>>()\n private _initResolve!: (value: { context: AppContext; token: TokenInfo }) => void\n private _initPromise: Promise<{ context: AppContext; token: TokenInfo }>\n private _hostOrigin: string | null = null\n private _messageHandler: (event: MessageEvent) => void\n private _destroyed = false\n private sessionId: string | null = null\n private actions = new Map<string, { descriptor: HeaderAction; handler: HeaderActionHandler; busy: boolean }>()\n private requests = new Set<string>()\n\n constructor() {\n this._initPromise = new Promise((resolve) => {\n this._initResolve = resolve\n })\n\n this._messageHandler = this.handleMessage.bind(this)\n if (typeof window !== 'undefined') {\n window.addEventListener('message', this._messageHandler)\n }\n }\n\n /** Post `verentis:ready` to the host to start the handshake */\n sendReady(capabilities?: string[]): void {\n console.info('[Verentis SDK] Sending verentis:ready to host')\n const message: VerentisReadyMessage = {\n type: 'verentis:ready',\n version: 1,\n capabilities,\n }\n // Use '*' for ready since we don't know the host origin yet\n window.parent.postMessage(message, '*')\n }\n\n /** Wait for the host to send `verentis:init` with context and token */\n waitForInit(): Promise<{ context: AppContext; token: TokenInfo }> {\n return this._initPromise\n }\n\n /** Get the host origin (available after init) */\n get hostOrigin(): string | null {\n return this._hostOrigin\n }\n\n /** Send a message to the host */\n postToHost(message: AppToHostMessage): void {\n if (this._destroyed) throw new Error('Bridge has been destroyed.')\n if (!this._hostOrigin) {\n throw new Error('Bridge not initialized: host origin unknown. Wait for init first.')\n }\n window.parent.postMessage(message, this._hostOrigin)\n }\n\n /**\n * Navigate to another location in the workspace.\n *\n * @param path A workspace file path (e.g. `/reports/q1.json`) or an absolute\n * http(s) URL. External URLs require the app to declare the\n * `navigation:external` capability in its manifest.\n * @param options Navigation options. Set `newTab: true` to open the target in\n * a new browser tab instead of the current one.\n */\n navigate(path: string, options?: NavigateOptions): void {\n this.postToHost({\n type: 'verentis:navigate',\n version: 1,\n path,\n ...(options?.newTab ? { newTab: true } : {}),\n })\n }\n\n /** Request iframe resize */\n resize(height: number): void {\n this.postToHost({ type: 'verentis:resize', version: 1, height })\n }\n\n /** Update the title displayed by the host */\n setTitle(title: string): void {\n this.postToHost({ type: 'verentis:title', version: 1, title })\n }\n\n /** Signal unsaved changes to the host */\n setDirty(isDirty: boolean): void {\n this.postToHost({ type: 'verentis:dirty', version: 1, isDirty })\n }\n\n registerAction(descriptor: HeaderAction, handler: HeaderActionHandler): HeaderActionRegistration {\n if (!this.sessionId || this._destroyed) throw new Error('Header actions require an initialized workspace host.')\n if (!isHeaderAction(descriptor)) throw new Error('Invalid header action.')\n if (this.actions.has(descriptor.id)) throw new Error(`Action '${descriptor.id}' is already registered.`)\n if (this.actions.size >= 16) throw new Error('At most 16 header actions may be registered.')\n const action = { descriptor: { ...descriptor, scopes: [...descriptor.scopes] }, handler, busy: false }\n this.actions.set(descriptor.id, action)\n this.publishActions()\n return {\n update: next => {\n if (this.actions.get(descriptor.id) !== action) throw new Error('Action has been disposed.')\n if (!isHeaderAction(next) || next.id !== descriptor.id) throw new Error('Invalid header action update.')\n action.descriptor = { ...next, scopes: [...next.scopes] }\n this.publishActions()\n },\n dispose: () => {\n if (this.actions.get(descriptor.id) !== action) return\n this.actions.delete(descriptor.id)\n this.publishActions()\n },\n }\n }\n\n private publishActions(): void {\n if (!this.sessionId || this._destroyed) return\n this.postToHost({\n type: 'verentis:actions:set', version: 1, sessionId: this.sessionId,\n actions: [...this.actions.values()].map(a => ({ ...a.descriptor, busy: a.busy || a.descriptor.busy })),\n })\n }\n\n private async invokeAction(message: VerentisActionInvokeMessage): Promise<void> {\n if (message.sessionId !== this.sessionId || typeof message.requestId !== 'string'\n || message.requestId.length > 128 || !message.requestId || this.requests.has(message.requestId)) return\n this.requests.add(message.requestId)\n if (this.requests.size > 1000) this.requests.delete(this.requests.values().next().value!)\n const action = this.actions.get(message.actionId)\n const reply = { type: 'verentis:action:result' as const, version: 1 as const,\n sessionId: message.sessionId, requestId: message.requestId, actionId: message.actionId }\n if (!action || action.busy || action.descriptor.busy\n || action.descriptor.enabled === false || action.descriptor.visible === false) {\n this.postToHost({ ...reply, error: 'Action is unavailable.' })\n return\n }\n action.busy = true\n this.publishActions()\n try {\n const result = await action.handler()\n if (!this._destroyed && this.sessionId === message.sessionId) {\n this.postToHost({ ...reply, result: result || undefined })\n }\n } catch (error) {\n if (!this._destroyed && this.sessionId === message.sessionId) {\n this.postToHost({ ...reply, error: (error instanceof Error ? error.message : 'Action failed.').slice(0, 500) })\n }\n } finally {\n action.busy = false\n this.publishActions()\n }\n }\n\n /** Subscribe to a specific message type from the host */\n on(type: BridgeEventType, listener: BridgeListener): () => void {\n if (!this.listeners.has(type)) {\n this.listeners.set(type, new Set())\n }\n this.listeners.get(type)!.add(listener)\n\n return () => {\n this.listeners.get(type)?.delete(listener)\n }\n }\n\n /** Clean up event listeners */\n destroy(): void {\n this._destroyed = true\n this.actions.clear()\n this.requests.clear()\n this.listeners.clear()\n if (typeof window !== 'undefined') {\n window.removeEventListener('message', this._messageHandler)\n }\n }\n\n private handleMessage(event: MessageEvent): void {\n if (this._destroyed) return\n\n const data = event.data as HostToAppMessage\n if (event.source !== window.parent || data?.version !== 1\n || typeof data?.type !== 'string' || !data.type.startsWith('verentis:')) return\n if (this._hostOrigin && event.origin !== this._hostOrigin) return\n\n // Capture the host origin from the first valid message\n if (data.type === 'verentis:init') {\n if (this._hostOrigin) return\n this._hostOrigin = event.origin\n this.sessionId = typeof data.sessionId === 'string' ? data.sessionId : null\n console.info('[Verentis SDK] Received verentis:init from host', {\n origin: event.origin,\n workspaceId: data.context.workspace.id,\n filePath: data.context.file?.path ?? null,\n })\n const initData = data as VerentisInitMessage\n this._initResolve({ context: initData.context, token: initData.token })\n }\n\n if (data.type === 'verentis:action:invoke') {\n void this.invokeAction(data)\n return\n }\n\n // Dispatch to listeners\n const typeListeners = this.listeners.get(data.type)\n if (typeListeners) {\n for (const listener of typeListeners) {\n listener(data)\n }\n }\n }\n}\n","// ---------------------------------------------------------------------------\n// PostMessage Protocol\n// ---------------------------------------------------------------------------\n\nexport interface VerentisMessage {\n type: `verentis:${string}`\n version: 1\n requestId?: string\n}\n\n// Host → App messages\nimport type { HeaderAction, HeaderActionResult } from './transport/header-actions'\n\nexport interface VerentisInitMessage extends VerentisMessage {\n type: 'verentis:init'\n context: AppContext\n token: TokenInfo\n sessionId?: string\n}\n\nexport interface VerentisActionsSetMessage extends VerentisMessage {\n type: 'verentis:actions:set'\n sessionId: string\n actions: HeaderAction[]\n}\n\nexport interface VerentisActionInvokeMessage extends VerentisMessage {\n type: 'verentis:action:invoke'\n sessionId: string\n requestId: string\n actionId: string\n}\n\nexport interface VerentisActionResultMessage extends VerentisMessage {\n type: 'verentis:action:result'\n sessionId: string\n requestId: string\n actionId: string\n result?: HeaderActionResult\n error?: string\n}\n\nexport interface VerentisTokenRefreshedMessage extends VerentisMessage {\n type: 'verentis:token:refreshed'\n requestId: string\n token: TokenInfo\n}\n\nexport interface VerentisFileChangedMessage extends VerentisMessage {\n type: 'verentis:file:changed'\n path: string\n fileVersion?: string\n}\n\nexport interface VerentisThemeMessage extends VerentisMessage {\n type: 'verentis:theme'\n colorScheme: 'light' | 'dark'\n variables?: Record<string, string>\n}\n\n// App → Host messages\n\nexport interface VerentisReadyMessage extends VerentisMessage {\n type: 'verentis:ready'\n capabilities?: string[]\n}\n\nexport interface VerentisTokenRefreshMessage extends VerentisMessage {\n type: 'verentis:token:refresh'\n requestId: string\n}\n\nexport interface VerentisNavigateMessage extends VerentisMessage {\n type: 'verentis:navigate'\n /** Target of the navigation: a workspace file path or an absolute http(s) URL. */\n path: string\n /** When true, the host opens the target in a new browser tab instead of the current one. */\n newTab?: boolean\n}\n\nexport interface VerentisResizeMessage extends VerentisMessage {\n type: 'verentis:resize'\n height: number\n}\n\nexport interface VerentisTitleMessage extends VerentisMessage {\n type: 'verentis:title'\n title: string\n}\n\nexport interface VerentisDirtyMessage extends VerentisMessage {\n type: 'verentis:dirty'\n isDirty: boolean\n}\n\nexport type HostToAppMessage =\n | VerentisInitMessage\n | VerentisActionInvokeMessage\n | VerentisTokenRefreshedMessage\n | VerentisFileChangedMessage\n | VerentisThemeMessage\n\nexport type AppToHostMessage =\n | VerentisReadyMessage\n | VerentisActionsSetMessage\n | VerentisActionResultMessage\n | VerentisTokenRefreshMessage\n | VerentisNavigateMessage\n | VerentisResizeMessage\n | VerentisTitleMessage\n | VerentisDirtyMessage\n\n// ---------------------------------------------------------------------------\n// Context\n// ---------------------------------------------------------------------------\n\nexport type AppSurface = 'file' | 'workspace'\n\ninterface AppContextBase {\n workspace: WorkspaceInfo\n entryPoint?: EntryPointInfo\n apiUrl: string\n}\n\n/** Context for an application opened against a workspace file. */\nexport interface FileAppContext extends AppContextBase {\n surface: 'file'\n file: FileInfo\n}\n\n/** Context for an application opened as a standalone workspace experience. */\nexport interface WorkspaceAppContext extends AppContextBase {\n surface: 'workspace'\n file?: never\n}\n\n/**\n * Legacy file-hosted contexts did not include a surface discriminator. They\n * remain accepted and are treated as `file` surfaces by the SDK.\n */\ninterface LegacyFileAppContext extends AppContextBase {\n surface?: undefined\n file: FileInfo\n}\n\n/**\n * Application context supplied by the workspace host.\n *\n * New hosts explicitly identify `file` or `workspace` surfaces. The legacy\n * file shape without `surface` remains supported for backwards compatibility.\n */\nexport type AppContext = FileAppContext | WorkspaceAppContext | LegacyFileAppContext\n\nexport interface WorkspaceInfo {\n id: string\n slug: string\n name: string\n}\n\nexport interface FileInfo {\n path: string\n name: string\n mimeType: string\n size: number\n version?: string\n etag?: string\n}\n\nexport interface EntryPointInfo {\n id: string\n displayName: string\n description?: string\n icon?: string\n route: string\n mode: 'view' | 'edit'\n matchedPattern: string\n priority: number\n}\n\nexport interface TokenInfo {\n accessToken: string\n expiresAt: string\n scopes: string[]\n}\n\n// ---------------------------------------------------------------------------\n// Client Options\n// ---------------------------------------------------------------------------\n\nexport interface VerentisClientOptions {\n /** Base URL of the Verentis API gateway (e.g. 'https://api.verentis.com') */\n apiUrl?: string\n /** API version prefix (defaults to 'v1') */\n apiVersion?: string\n /** Authentication configuration */\n auth?: AuthOptions\n /** Workspace ID for standalone mode */\n workspaceId?: string\n}\n\nexport type AuthOptions =\n | { apiKey: string }\n | { token: string; expiresAt?: string; refreshToken?: () => Promise<TokenInfo> }\n\n/**\n * Options for {@link VerentisNavigateMessage}-based navigation requests.\n */\nexport interface NavigateOptions {\n /**\n * When true, the host opens the target in a new browser tab instead of\n * navigating the current tab. Defaults to false.\n *\n * The target may be a workspace file path or an absolute http(s) URL.\n * Opening an external URL requires the app to declare the\n * `navigation:external` capability in its manifest.\n */\n newTab?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// File API Types\n// ---------------------------------------------------------------------------\n\nexport interface FileEntry {\n path: string\n name: string\n size: number\n mimeType: string\n version?: string\n etag?: string\n children?: FileEntry[]\n}\n\nexport interface GetFileOptions {\n branch?: string\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\nexport interface WriteFileOptions {\n content: Blob | string | ArrayBuffer\n contentType?: string\n filename?: string\n branch?: string\n}\n\nexport interface MoveFileOptions {\n from: string\n to: string\n branch?: string\n}\n\nexport interface DeleteFileOptions {\n path: string\n branch?: string\n}\n\nexport type ArchiveFormat = 'zip' | 'tgz'\n\nexport interface ReadArchiveOptions {\n /** Archive format. Defaults to 'zip'. */\n format?: ArchiveFormat\n /** Target branch. Defaults to 'main'. */\n branch?: string\n}\n\nexport interface ExtractUploadOptions {\n /** Original filename of the archive (for format detection). */\n filename?: string\n /** Target branch. Defaults to 'main'. */\n branch?: string\n}\n\nexport interface InstalledPackagePayload {\n sourcePath: string\n destinationPath: string\n mode: string\n phase: number\n mimeType?: string | null\n}\n\nexport interface InstalledPackageDescriptor {\n packageIdentity: string\n publisher?: string | null\n name: string\n version: string\n kind: string\n manifestYaml: string\n installMode: string\n sealed: boolean\n mimeType: string\n payloads: InstalledPackagePayload[]\n}\n\n// ---------------------------------------------------------------------------\n// Installation API\n// ---------------------------------------------------------------------------\n\nexport type InstallationMode = 'Extracted' | 'Sealed'\n\nexport type InstallationStatus =\n | 'Pending'\n | 'Installing'\n | 'Installed'\n | 'Updating'\n | 'Uninstalling'\n | 'Failed'\n | 'Uninstalled'\n\nexport interface Installation {\n id: string\n accountId: string\n workspaceId: string\n packageId: string\n packageVersionId: string\n packageName: string\n publisherName: string\n version: string\n installPath: string\n branch: string\n installMode: InstallationMode\n status: InstallationStatus\n installedBy: string\n errorMessage?: string | null\n createdAt: string\n updatedAt?: string | null\n securityFlagged: boolean\n securityFlagReason?: string | null\n isSystem: boolean\n systemKey?: string | null\n protectionReason?: string | null\n}\n\nexport interface CatalogImage {\n assetId: string\n url: string\n alt: string\n caption?: string | null\n mediaType: string\n}\n\nexport interface InstallationDetail {\n installation: Installation\n installedVersionStatus: string\n installedReadmeMarkdown?: string | null\n installedChangelogMarkdown?: string | null\n installedDisplayName?: string | null\n installedDescription?: string | null\n installedLogoUrl?: string | null\n installedHeroUrl?: string | null\n installedImages: CatalogImage[]\n installedBadges: string[]\n installedIsDeprecated: boolean\n installedDeprecationMessage?: string | null\n installedIsMalicious: boolean\n installedIsDelisted: boolean\n publisherId: string\n publisherName: string\n publisherDisplayName: string\n publisherLogoUrl?: string | null\n publisherIsVerified: boolean\n publisherBadges: string[]\n publisherIsMalicious: boolean\n packageBadges: string[]\n packageIsMalicious: boolean\n packageIsDeprecated: boolean\n packageDeprecationMessage?: string | null\n latestVersion?: string | null\n latestVersionId?: string | null\n updateAvailable: boolean\n canUpdate: boolean\n canRetry: boolean\n canDelete: boolean\n allowedActions: string[]\n}\n\nexport interface InstallationLifecycleResult {\n installationId: string\n status: InstallationStatus\n succeeded: boolean\n error?: string | null\n}\n\nexport interface InstallationScopedOptions {\n workspaceId?: string\n}\n\nexport interface InstallationListOptions extends InstallationScopedOptions {\n pageNo?: number\n pageSize?: number\n orderBy?: string\n packageId?: string\n branch?: string\n installPath?: string\n status?: InstallationStatus\n isSystem?: boolean\n}\n\nexport interface ResolveInstallationOptions extends InstallationScopedOptions {\n branch?: string\n}\n\nexport interface UpdateInstallationOptions extends InstallationScopedOptions {\n packageVersion?: string\n installMode?: InstallationMode\n}\n\n// ---------------------------------------------------------------------------\n// Auth Strategy (internal)\n// ---------------------------------------------------------------------------\n\nexport interface AuthStrategy {\n getAuthHeader(): Promise<string | null>\n destroy?(): void\n}\n\n// ---------------------------------------------------------------------------\n// Application Manifest\n// ---------------------------------------------------------------------------\n\nexport interface MimeTypeBinding {\n pattern: string\n mode: 'view' | 'edit'\n priority: number\n icon?: string\n}\n\nexport interface ApplicationFileType {\n pattern: string\n extensions: string[]\n priority: number\n icon?: string\n}\n\nexport interface ApplicationManifest {\n apiVersion: string\n kind: 'Application'\n metadata: ManifestMetadata\n spec: ApplicationSpec\n}\n\nexport interface ManifestMetadata {\n name: string\n displayName?: string\n description?: string\n icon?: string\n version?: string\n author?: string\n labels?: Record<string, string>\n annotations?: Record<string, string>\n}\n\nexport type InstallMode = 'seed' | 'managed'\n\nexport interface InstallDirective {\n /** Source path/glob relative to the package payload root. Must match at least one file. */\n from: string\n /**\n * Destination workspace-absolute VFS path. A trailing `/` denotes a directory (the source's\n * basename / relative subpath is preserved beneath it); otherwise an exact file path.\n */\n to: string\n /**\n * `seed` = install once, never overwrite an existing/user-edited file (never removed on upgrade);\n * `managed` = app-owned, created and replaced on upgrade, removed on uninstall. Default `managed`.\n */\n mode?: InstallMode\n /** Optional explicit MIME for placed nodes; else inferred / resolved by json-schema. */\n mime?: string\n /** Optional sequential install phase; omitted directives remain in the legacy single phase. */\n phase?: number\n}\n\nexport interface ApplicationLaunchConfig {\n /**\n * Enables standalone launch from the workspace. Defaults to `false`.\n *\n * When enabled, the platform requires `entryPoint` or `spec.entry` to\n * resolve an iframe entry.\n */\n enabled?: boolean\n /**\n * Optional entry-point ID to use as the standalone home. When omitted, the\n * platform falls back to `spec.entry`.\n */\n entryPoint?: string\n /**\n * Whether users may pin the launch surface. Defaults to `false` and does not\n * pin it automatically.\n */\n pinnable?: boolean\n}\n\nexport interface ApplicationDisplayOptions {\n fullscreen?: boolean\n}\n\nexport interface ApplicationEntryPoint {\n id: string\n displayName?: string\n description?: string\n icon?: string\n route?: string\n /** Optional per-entry-point iframe URL override. */\n entry?: string\n /** Optional splash URL override. Relative values resolve against this entry point's iframe URL. */\n splash?: string\n order?: number\n mimeTypes?: MimeTypeBinding[]\n display?: ApplicationDisplayOptions\n}\n\nexport interface ApplicationSpec {\n /** Optional iframe UI surface URL. Omit for a headless / file-collection app. */\n entry?: string\n /** Optional application splash URL. Relative values resolve against the selected iframe entry URL. */\n splash?: string\n /** Named iframe surfaces; `launch.entryPoint` references one of these ids. */\n entryPoints?: ApplicationEntryPoint[]\n scope?: string\n mimeTypes?: MimeTypeBinding[]\n fileTypes?: ApplicationFileType[]\n capabilities?: string[]\n permissions?: string[]\n sandbox?: SandboxOptions\n oauth?: OAuthConfig\n scopes?: string[]\n /** Declarative install map: where packaged files land in the workspace VFS. */\n install?: InstallDirective[]\n /** Where the app-record (manifest node) is anchored. Default `/applications/{name}`. */\n installRoot?: string\n /** Default display behavior inherited by entry points. */\n display?: ApplicationDisplayOptions\n /**\n * Opt-in standalone workspace launch configuration. The platform defaults\n * `enabled` and `pinnable` to `false` when omitted.\n */\n launch?: ApplicationLaunchConfig\n /**\n * Workspace settings and secrets this app requires. Declared settings are auto-registered\n * in the workspace settings store under `{metadata.name}.{key}` and surfaced in the\n * settings UI. Secret values never reach browser contexts.\n */\n settings?: SettingDeclaration[]\n}\n\n/** Data type of a declared setting value. */\nexport type SettingDeclarationType = 'string' | 'number' | 'boolean' | 'select' | 'file'\n\n/**\n * A workspace setting or secret an application/engine manifest requires. The platform\n * auto-creates a matching setting definition (namespaced `{manifest-name}.{key}`) so\n * workspace admins can provide the value; engines receive values at run time.\n */\nexport interface SettingDeclaration {\n /** Short key; stored namespaced as `{metadata.name}.{key}` in the settings store. */\n key: string\n /** Optional environment variable name injected into engine runs (e.g. `MY_API_KEY`). */\n env?: string\n /**\n * Secret values are server-only: delivered to Docker engine runs, never to browser\n * contexts (wasm runs, iframe apps). Defaults to `false`.\n */\n secret?: boolean\n /**\n * Required settings prompt during marketplace install and fail an execution fast when\n * no value is configured. Defaults to `false`.\n */\n required?: boolean\n displayName?: string\n description?: string\n /**\n * Value input type. `file` prompts the installer to select a local file and stores its\n * bytes as a base64 string. Defaults to `string`.\n */\n type?: SettingDeclarationType\n /** Default value. Not allowed for secrets. */\n default?: string | number | boolean\n /** Allowed values when `type` is `select`. */\n options?: string[]\n}\n\nexport interface OAuthConfig {\n clientType: string\n redirectUris?: string[]\n}\n\nexport interface SandboxOptions {\n allowScripts?: boolean\n allowSameOrigin?: boolean\n allowPopups?: boolean\n allowForms?: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Execution API\n// ---------------------------------------------------------------------------\n\n/** Lifecycle status of an execution. Mirrors the platform `ExecutionStatus` enum. */\nexport type ExecutionStatus =\n | 'Pending'\n | 'Queued'\n | 'Running'\n | 'Completed'\n | 'Failed'\n | 'Cancelled'\n | 'TimedOut'\n | 'AwaitingClient'\n\n/** How an execution is run. Mirrors the platform `ExecutionMode` enum. */\nexport type ExecutionMode = 'RequestResponse' | 'LongRunning' | 'Scheduled' | 'EventDriven'\n\n/** What triggered an execution. Mirrors the platform `ExecutionTrigger` enum. */\nexport type ExecutionTrigger = 'User' | 'Api' | 'Schedule' | 'Event'\n\n/** The structured outcome of an execution. */\nexport interface ExecutionResult {\n exitCode: number\n stdout?: string | null\n stderr?: string | null\n /** Raw JSON payload the engine reported in `result.json`, as a string. */\n data?: string | null\n artifacts: string[]\n durationMs: number\n error?: string | null\n}\n\n/** A single execution record. */\nexport interface Execution {\n id: string\n workspaceId: string\n engineId: string\n engineName: string\n filePath?: string | null\n mode: ExecutionMode\n trigger: ExecutionTrigger\n tool?: string | null\n status: ExecutionStatus\n requestedAt: string\n startedAt?: string | null\n completedAt?: string | null\n result?: ExecutionResult | null\n}\n\n/** Captured stdout/stderr of an execution. */\nexport interface ExecutionLogs {\n stdout?: string | null\n stderr?: string | null\n}\n\n/** Options for running a file (engine resolved by the file's type). */\nexport interface RunFileOptions {\n /** Workspace to run in. Defaults to the client's workspace. */\n workspaceId?: string\n branch?: string\n tool?: string\n mode?: string\n arguments?: string[]\n /** Structured parameters passed to the engine; serialized to JSON for the platform. */\n parameters?: Record<string, unknown>\n}\n\n/** Options for executing a specific engine (optionally against a file). */\nexport interface ExecuteEngineOptions {\n workspaceId?: string\n filePath?: string\n branch?: string\n tool?: string\n mode?: string\n arguments?: string[]\n parameters?: Record<string, unknown>\n}\n\n/** Options that only need to scope a request to a workspace. */\nexport interface ExecutionScopedOptions {\n workspaceId?: string\n}\n\nexport interface ExecutionListOptions extends ExecutionScopedOptions {\n filePath?: string\n engineIds?: string[]\n filePaths?: string[]\n status?: ExecutionStatus\n trigger?: ExecutionTrigger\n activeOnly?: boolean\n requestedAfter?: string\n requestedBefore?: string\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\nexport interface PagedResult<T> {\n totalCount: number\n pageCount: number\n pageSize: number\n pageNumber: number\n data: T[]\n}\n\nexport interface EngineRuntime {\n kind: 'Docker' | 'Wasm'\n image?: string | null\n pullPolicy?: string | null\n moduleUrl?: string | null\n runtimeHint?: string | null\n serverCompatible: boolean\n clientCompatible: boolean\n adapterUrl?: string | null\n}\n\nexport interface EngineFileType {\n pattern: string\n extensions: string[]\n priority: number\n icon?: string\n}\n\nexport interface EngineTool {\n name: string\n description?: string | null\n inputSchema?: string | null\n outputSchema?: string | null\n}\n\nexport interface ExecutionEngine {\n id: string\n workspaceId: string\n name: string\n displayName: string\n description?: string | null\n icon?: string | null\n version: string\n author?: string | null\n category?: string | null\n tier?: string | null\n sourcePath: string\n priority: number\n enabled: boolean\n capabilities: string[]\n permissions: string[]\n supportedModes: string[]\n runtimes: EngineRuntime[]\n fileTypes: EngineFileType[]\n tools: EngineTool[]\n resources?: {\n cpu?: string | null\n memory?: string | null\n timeoutSeconds: number\n maxConcurrent: number\n storage?: string | null\n } | null\n sandbox?: {\n network: string\n allowedHosts: string[]\n readOnlyRoot: boolean\n noNewPrivileges: boolean\n } | null\n firstParty: boolean\n}\n\nexport interface ExecutionEngineListOptions extends ExecutionScopedOptions {\n pageNo?: number\n pageSize?: number\n orderBy?: string\n}\n\n/** Options for polling an execution to completion. */\nexport interface WaitOptions extends ExecutionScopedOptions {\n /** Poll interval in milliseconds (default 1000). */\n intervalMs?: number\n /** Maximum time to wait in milliseconds before throwing. */\n timeoutMs?: number\n /** Abort signal to cancel waiting. */\n signal?: AbortSignal\n}\n\n// ---------------------------------------------------------------------------\n// Settings API\n// ---------------------------------------------------------------------------\n\n/** An allowed value for a `select` setting. */\nexport interface SettingOption {\n value: string\n label: string\n}\n\n/**\n * A single workspace setting merged from its definition and any stored value.\n * Secret values are always `null` for browser callers; `hasValue` still reports\n * whether a value (or default) is configured.\n */\nexport interface SettingItem {\n key: string\n group: string\n label: string\n description?: string | null\n dataType: string\n isSecret: boolean\n options?: SettingOption[] | null\n defaultValue?: unknown\n value?: unknown\n hasValue: boolean\n}\n\n/** A labeled group of settings (e.g. one group per application). */\nexport interface SettingGroup {\n key: string\n label: string\n items: SettingItem[]\n}\n\n/** Options that scope a settings request to a workspace. */\nexport interface SettingsScopedOptions {\n workspaceId?: string\n}\n\n/** Presence-only result. Stored secret and non-secret values are never included. */\nexport interface SettingPresence {\n key: string\n hasStoredValue: boolean\n hasEffectiveValue: boolean\n}\n\n// ---------------------------------------------------------------------------\n// Resource API\n// ---------------------------------------------------------------------------\n\nexport interface ResourceMimeTypeBinding {\n id: string\n pattern: string\n mode: string\n priority: number\n}\n\nexport interface ResourceRegistration {\n id: string\n accountId: string\n workspaceId: string\n name: string\n displayName?: string | null\n description?: string | null\n icon?: string | null\n version?: string | null\n author?: string | null\n entryUrl?: string | null\n kind: string\n scope: string\n manifestPath: string\n manifestNodeId: string\n manifestHash: string\n branch: string\n spec?: string | null\n labels?: string | null\n capabilities?: string | null\n permissions?: string | null\n sandboxConfig?: string | null\n createdAt: string\n updatedAt?: string | null\n mimeTypeBindings: ResourceMimeTypeBinding[]\n entryPointId?: string | null\n entryPointDisplayName?: string | null\n entryPointDescription?: string | null\n entryPointIcon?: string | null\n entryPointRoute?: string | null\n entryPointEntryUrl?: string | null\n entryPointMode?: string | null\n entryPointMatchedPattern?: string | null\n entryPointPriority?: number | null\n entryPointFullscreen?: boolean | null\n entryPointSplashUrl?: string | null\n launchEnabled: boolean\n launchEntryPointId?: string | null\n launchPinnable: boolean\n}\n\nexport interface ResourceScopedOptions {\n workspaceId?: string\n}\n\n// ---------------------------------------------------------------------------\n// HTTP Transport Types (internal)\n// ---------------------------------------------------------------------------\n\nexport interface RequestOptions {\n headers?: Record<string, string>\n body?: BodyInit | null\n params?: Record<string, string | number | boolean | readonly (string | number)[] | undefined>\n}\n\nexport class ApiError extends Error {\n constructor(\n public readonly status: number,\n public readonly detail: string,\n public readonly title?: string,\n ) {\n super(title ?? `API error ${status}: ${detail}`)\n this.name = 'ApiError'\n }\n}\n","import { ApiError, type AuthStrategy, type RequestOptions } from '../types'\n\n/**\n * HTTP client for making direct API calls to the Verentis gateway.\n * Used in both standalone and iframe modes — the auth strategy determines\n * how the Authorization header is obtained.\n */\nexport class HttpTransport {\n constructor(\n private readonly baseUrl: string,\n private readonly auth: AuthStrategy,\n private readonly apiVersion: string = 'v1',\n ) {}\n\n async request<T>(method: string, path: string, options?: RequestOptions): Promise<T> {\n const url = this.buildUrl(path, options?.params)\n console.info('[Verentis SDK] Request started', { method, path, url })\n const headers: Record<string, string> = {}\n\n const authHeader = await this.auth.getAuthHeader()\n if (authHeader) {\n headers['Authorization'] = authHeader\n }\n\n if (options?.headers) {\n Object.assign(headers, options.headers)\n }\n\n const response = await fetch(url, {\n method,\n headers,\n body: options?.body,\n })\n\n if (!response.ok) {\n let detail = ''\n let title: string | undefined\n\n try {\n const body = await response.json()\n // ProblemDetails format\n detail = body.detail ?? body.message ?? JSON.stringify(body)\n title = body.title\n } catch {\n detail = await response.text().catch(() => response.statusText)\n }\n\n console.error('[Verentis SDK] Request failed', {\n method,\n path,\n status: response.status,\n detail,\n })\n throw new ApiError(response.status, detail, title)\n }\n\n console.info('[Verentis SDK] Request succeeded', {\n method,\n path,\n status: response.status,\n contentType: response.headers.get('content-type') ?? '',\n })\n const contentType = response.headers.get('content-type') ?? ''\n if (contentType.includes('application/json')) {\n return response.json() as Promise<T>\n }\n\n // For non-JSON responses (e.g. binary file downloads), return the blob\n return response.blob() as unknown as T\n }\n\n async requestRaw(method: string, path: string, options?: RequestOptions): Promise<Response> {\n const url = this.buildUrl(path, options?.params)\n console.info('[Verentis SDK] Raw request started', { method, path, url })\n const headers: Record<string, string> = {}\n\n const authHeader = await this.auth.getAuthHeader()\n if (authHeader) {\n headers['Authorization'] = authHeader\n }\n\n if (options?.headers) {\n Object.assign(headers, options.headers)\n }\n\n const response = await fetch(url, { method, headers, body: options?.body })\n console.info('[Verentis SDK] Raw request completed', {\n method,\n path,\n status: response.status,\n ok: response.ok,\n contentType: response.headers.get('content-type') ?? '',\n })\n return response\n }\n\n private buildUrl(path: string, params?: RequestOptions['params']): string {\n const base = `${this.baseUrl}/${this.apiVersion}${path}`\n\n if (!params) return base\n\n const searchParams = new URLSearchParams()\n for (const [key, value] of Object.entries(params)) {\n if (value === undefined) {\n continue\n }\n\n if (Array.isArray(value)) {\n for (const item of value) {\n searchParams.append(key, String(item))\n }\n } else {\n searchParams.set(key, String(value))\n }\n }\n\n const qs = searchParams.toString()\n return qs ? `${base}?${qs}` : base\n }\n}\n","import { ApiKeyAuth } from './auth/api-key.auth'\nimport { BridgeAuth } from './auth/bridge.auth'\nimport { TokenAuth } from './auth/token.auth'\nimport { ContextModule } from './modules/context'\nimport { ExecutionsModule } from './modules/executions'\nimport { EnginesModule } from './modules/engines'\nimport { FilesModule } from './modules/files'\nimport { InstallationsModule } from './modules/installations'\nimport { ResourcesModule } from './modules/resources'\nimport { SettingsModule } from './modules/settings'\nimport { Bridge } from './transport/bridge.transport'\nimport { HttpTransport } from './transport/http.transport'\nimport type { AuthStrategy, VerentisClientOptions } from './types'\n\n/**\n * The main Verentis SDK client.\n * Provides access to file operations, workspace context, and (in iframe mode)\n * the host communication bridge.\n */\nexport class VerentisClient {\n files!: FilesModule\n executions!: ExecutionsModule\n engines!: EnginesModule\n installations!: InstallationsModule\n resources!: ResourcesModule\n settings!: SettingsModule\n readonly context: ContextModule\n readonly bridge: Bridge | null\n\n private readonly _auth: AuthStrategy\n private _http!: HttpTransport\n private _ready: Promise<void>\n\n constructor(options?: VerentisClientOptions) {\n this.context = new ContextModule()\n\n const environment = detectEnvironment()\n\n if (environment === 'iframe' && !options?.auth) {\n // --- iframe mode ---\n this.bridge = new Bridge()\n const bridgeAuth = new BridgeAuth('*') // origin validated after init\n this._auth = bridgeAuth\n\n this._ready = this.initFromBridge(bridgeAuth)\n } else {\n // --- standalone mode ---\n this.bridge = null\n this._auth = createAuthStrategy(options)\n\n const apiUrl = options?.apiUrl\n if (!apiUrl) {\n throw new Error('apiUrl is required in standalone mode')\n }\n\n this.context.setApiUrl(apiUrl)\n if (options?.workspaceId) {\n this.context.setWorkspace({ id: options.workspaceId })\n }\n\n this._http = new HttpTransport(apiUrl, this._auth, options?.apiVersion ?? 'v1')\n this.files = new FilesModule(this._http, options?.workspaceId)\n this.executions = new ExecutionsModule(this._http, options?.workspaceId)\n this.engines = new EnginesModule(this._http, options?.workspaceId)\n this.installations = new InstallationsModule(this._http, options?.workspaceId)\n this.resources = new ResourcesModule(this._http, options?.workspaceId)\n this.settings = new SettingsModule(this._http, options?.workspaceId)\n this._ready = Promise.resolve()\n return\n }\n\n // _http and files are set after bridge init via initFromBridge()\n }\n\n /**\n * Returns a promise that resolves when the client is fully initialized.\n * In standalone mode this resolves immediately.\n * In iframe mode this resolves after the host sends `verentis:init`.\n */\n whenReady(): Promise<void> {\n return this._ready\n }\n\n /** Clean up resources (timers, event listeners) */\n destroy(): void {\n this._auth.destroy?.()\n this.bridge?.destroy()\n }\n\n private async initFromBridge(bridgeAuth: BridgeAuth): Promise<void> {\n // Signal readiness to the host\n this.bridge!.sendReady()\n\n // Wait for host to send context + token\n const { context, token } = await this.bridge!.waitForInit()\n\n // Now we know the host origin — update the bridge auth\n const hostOrigin = this.bridge!.hostOrigin!\n // Re-create BridgeAuth with the actual origin\n Object.assign(bridgeAuth, new BridgeAuth(hostOrigin))\n bridgeAuth.setToken(token)\n\n // Set context\n this.context.setFromAppContext(context)\n\n // Create transport and modules now that we have the API URL\n const http = new HttpTransport(\n context.apiUrl,\n bridgeAuth,\n 'v1',\n )\n\n this._http = http\n this.files = new FilesModule(http, context.workspace.id)\n this.executions = new ExecutionsModule(http, context.workspace.id)\n this.engines = new EnginesModule(http, context.workspace.id)\n this.installations = new InstallationsModule(http, context.workspace.id)\n this.resources = new ResourcesModule(http, context.workspace.id)\n this.settings = new SettingsModule(http, context.workspace.id)\n }\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction detectEnvironment(): 'iframe' | 'standalone' {\n if (typeof window !== 'undefined' && window.parent !== window) {\n return 'iframe'\n }\n return 'standalone'\n}\n\nfunction createAuthStrategy(options?: VerentisClientOptions): AuthStrategy {\n if (!options?.auth) {\n throw new Error('auth is required in standalone mode: provide { apiKey } or { token }')\n }\n\n if ('apiKey' in options.auth) {\n return new ApiKeyAuth(options.auth.apiKey)\n }\n\n if ('token' in options.auth) {\n return new TokenAuth(\n options.auth.token,\n options.auth.expiresAt,\n options.auth.refreshToken,\n )\n }\n\n throw new Error('Invalid auth options: provide { apiKey } or { token }')\n}\n","import type { MimeTypeBinding } from '../types'\n\n/**\n * Tests whether a MIME type matches a pattern.\n * Supports wildcards: `image/*` matches `image/png`, `*/*` matches everything.\n * Comparison is case-insensitive and ignores parameters (e.g. `; charset=utf-8`).\n */\nexport function matchMimeType(pattern: string, mimeType: string): boolean {\n const normalizedPattern = stripParams(pattern).toLowerCase()\n const normalizedMime = stripParams(mimeType).toLowerCase()\n\n if (normalizedPattern === '*/*') return true\n\n const [patternType, patternSubtype] = normalizedPattern.split('/')\n const [mimeTypeType, mimeSubtype] = normalizedMime.split('/')\n\n if (!patternType || !mimeTypeType) return false\n if (patternType === '*') return true\n if (patternType !== mimeTypeType) return false\n if (!patternSubtype || patternSubtype === '*') return true\n\n return patternSubtype === mimeSubtype\n}\n\n/**\n * Finds the best matching binding for a given MIME type.\n * Exact matches beat wildcard matches at the same priority level.\n * Higher priority values are preferred.\n */\nexport function findBestMatch(\n mimeType: string,\n bindings: MimeTypeBinding[],\n): MimeTypeBinding | null {\n const matches = bindings\n .filter((b) => matchMimeType(b.pattern, mimeType))\n .sort((a, b) => {\n const aExact = !a.pattern.includes('*')\n const bExact = !b.pattern.includes('*')\n if (aExact !== bExact) return aExact ? -1 : 1\n return b.priority - a.priority\n })\n\n return matches[0] ?? null\n}\n\n/**\n * Strips parameters from a MIME type string.\n * `application/json; charset=utf-8` → `application/json`\n */\nfunction stripParams(mime: string): string {\n const idx = mime.indexOf(';')\n return idx === -1 ? mime.trim() : mime.slice(0, idx).trim()\n}\n","import { VerentisClient } from './client'\nimport type { VerentisClientOptions } from './types'\n\n/**\n * Create a new Verentis SDK client.\n *\n * @example Standalone mode (local development)\n * ```ts\n * const client = createVerentisClient({\n * apiUrl: 'https://api.verentis.com',\n * auth: { apiKey: 'vrt_abc123_...' },\n * workspaceId: 'workspace-uuid',\n * })\n *\n * const file = await client.files.get('/documents/report.json')\n * ```\n *\n * @example iframe mode (auto-detected at runtime)\n * ```ts\n * const client = createVerentisClient()\n * await client.whenReady()\n *\n * const { surface, workspace } = client.context\n * if (surface === 'file') {\n * const content = await client.files.readContent(client.context.file.path)\n * }\n * ```\n */\nexport function createVerentisClient(options?: VerentisClientOptions): VerentisClient {\n return new VerentisClient(options)\n}\n\n// Re-export everything\nexport { VerentisClient } from './client'\nexport { matchMimeType, findBestMatch } from './utils/mime'\nexport { Bridge } from './transport/bridge.transport'\nexport { isHeaderAction } from './transport/header-actions'\nexport type { HeaderAction, HeaderActionResult, HeaderActionHandler, HeaderActionRegistration } from './transport/header-actions'\nexport { HttpTransport } from './transport/http.transport'\nexport { ApiKeyAuth } from './auth/api-key.auth'\nexport { TokenAuth } from './auth/token.auth'\nexport { BridgeAuth } from './auth/bridge.auth'\nexport { FilesModule } from './modules/files'\nexport { ContextModule } from './modules/context'\nexport { ExecutionsModule, isTerminalStatus } from './modules/executions'\nexport { EnginesModule } from './modules/engines'\nexport { InstallationsModule } from './modules/installations'\nexport { ResourcesModule } from './modules/resources'\nexport { SettingsModule } from './modules/settings'\nexport type { NamespacedSettings } from './modules/settings'\n\n// Re-export types\nexport type {\n // PostMessage protocol\n VerentisMessage,\n VerentisActionsSetMessage,\n VerentisActionInvokeMessage,\n VerentisActionResultMessage,\n VerentisInitMessage,\n VerentisReadyMessage,\n VerentisTokenRefreshMessage,\n VerentisTokenRefreshedMessage,\n VerentisFileChangedMessage,\n VerentisThemeMessage,\n VerentisNavigateMessage,\n VerentisResizeMessage,\n VerentisTitleMessage,\n VerentisDirtyMessage,\n HostToAppMessage,\n AppToHostMessage,\n // Context\n AppSurface,\n AppContext,\n FileAppContext,\n WorkspaceAppContext,\n WorkspaceInfo,\n FileInfo,\n EntryPointInfo,\n TokenInfo,\n // Client\n VerentisClientOptions,\n AuthOptions,\n NavigateOptions,\n // File API\n FileEntry,\n GetFileOptions,\n WriteFileOptions,\n MoveFileOptions,\n DeleteFileOptions,\n ArchiveFormat,\n ReadArchiveOptions,\n ExtractUploadOptions,\n InstalledPackageDescriptor,\n InstalledPackagePayload,\n // Installation API\n CatalogImage,\n Installation,\n InstallationDetail,\n InstallationLifecycleResult,\n InstallationListOptions,\n InstallationMode,\n InstallationScopedOptions,\n InstallationStatus,\n ResolveInstallationOptions,\n UpdateInstallationOptions,\n // Execution API\n Execution,\n ExecutionResult,\n ExecutionLogs,\n ExecutionStatus,\n ExecutionMode,\n ExecutionTrigger,\n RunFileOptions,\n ExecuteEngineOptions,\n ExecutionScopedOptions,\n ExecutionListOptions,\n ExecutionEngine,\n ExecutionEngineListOptions,\n EngineRuntime,\n EngineFileType,\n EngineTool,\n PagedResult,\n WaitOptions,\n // Settings API\n SettingGroup,\n SettingItem,\n SettingOption,\n SettingsScopedOptions,\n SettingPresence,\n // Resource API\n ResourceRegistration,\n ResourceMimeTypeBinding,\n ResourceScopedOptions,\n // Auth\n AuthStrategy,\n // Manifest\n ApplicationManifest,\n ManifestMetadata,\n ApplicationSpec,\n ApplicationLaunchConfig,\n ApplicationEntryPoint,\n ApplicationDisplayOptions,\n ApplicationFileType,\n MimeTypeBinding,\n SandboxOptions,\n OAuthConfig,\n SettingDeclaration,\n SettingDeclarationType,\n // HTTP\n RequestOptions,\n ApiError,\n} from './types'\n"]}
|