Datalayer VS Code Extension - v0.0.9
    Preparing search index...

    Class VSCodeToolAdapter<TParams>

    VS Code Tool Adapter

    This adapter bridges VS Code's LanguageModelTool interface to our platform-agnostic core operations. It handles:

    • Document resolution from parameters or active editor
    • Context building (document handle, SDK, auth)
    • Confirmation dialog generation
    • Result formatting for VS Code

    Type Parameters

    • TParams

    Implements

    Index

    Constructors

    Properties

    definition: ToolDefinition
    operation: ToolOperation<TParams, unknown>

    Methods

    • Builds extras for create operations (createNotebook, createLexical) with VS Code-specific logic

      Returns Record<string, unknown>

    • Builds default extras for non-createNotebook tools

      Returns Record<string, unknown>

    • Executes operation by sending message to active webview Uses the Runner pattern: extension → webview message → DefaultExecutor

      Type Parameters

      • T

      Parameters

      • operationName: string
      • args: unknown

      Returns Promise<T>

    • Formats operation result for VS Code

      Parameters

      • result: unknown

      Returns LanguageModelToolResult

    • Executes the tool by delegating to the core operation

      Parameters

      • options: LanguageModelToolInvocationOptions<TParams>
      • _token: CancellationToken

      Returns Promise<LanguageModelToolResult>

    • Open a notebook document in the editor Handles both local (file://) and cloud (datalayer://) schemes Always uses the Datalayer notebook editor

      Parameters

      • uriString: string

      Returns Promise<void>

    • Prepares the tool invocation with user-facing messages

      Parameters

      • options: LanguageModelToolInvocationPrepareOptions<TParams>
      • _token: CancellationToken

      Returns Promise<
          {
              confirmationMessages: { message: MarkdownString; title: string };
              invocationMessage: string;
          },
      >

    • Prompts user to choose notebook location when intent is ambiguous (VS Code-specific UI)

      Parameters

      • OptionalspaceName: string

      Returns Promise<"local" | "cloud">

    • Resolves a message by calling the message function with params

      Parameters

      Returns string