@github/copilot
Advanced tools
+43
-23
@@ -19,3 +19,3 @@ import { createServerRpc } from "./generated/rpc.js"; | ||
| * // Or connect to an existing server | ||
| * const client = new CopilotClient({ cliUrl: "localhost:3000" }); | ||
| * const client = new CopilotClient({ connection: RuntimeConnection.forUri("localhost:3000") }); | ||
| * | ||
@@ -43,3 +43,3 @@ * // Create a session | ||
| private socket; | ||
| private actualPort; | ||
| private runtimePort; | ||
| private actualHost; | ||
@@ -49,2 +49,8 @@ private state; | ||
| private stderrBuffer; | ||
| /** Resolved connection mode chosen in the constructor. */ | ||
| private connectionConfig; | ||
| /** Resolved path to the runtime executable (only used for child-process kinds). */ | ||
| private resolvedCliPath; | ||
| /** Resolved environment passed to the spawned runtime. */ | ||
| private resolvedEnv; | ||
| private options; | ||
@@ -73,28 +79,30 @@ private isExternalServer; | ||
| /** | ||
| * Internal RPC surface (e.g. handshake helpers). Not part of the public API. | ||
| * @internal | ||
| */ | ||
| private get internalRpc(); | ||
| /** | ||
| * Creates a new CopilotClient instance. | ||
| * | ||
| * @param options - Configuration options for the client | ||
| * @throws Error if mutually exclusive options are provided (e.g., cliUrl with useStdio or cliPath) | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * // Default options - spawns CLI server using stdio | ||
| * // Default: spawns the bundled runtime over stdio | ||
| * const client = new CopilotClient(); | ||
| * | ||
| * // Connect to an existing server | ||
| * const client = new CopilotClient({ cliUrl: "localhost:3000" }); | ||
| * // Connect to an existing runtime | ||
| * const client = new CopilotClient({ | ||
| * connection: RuntimeConnection.forUri("localhost:3000"), | ||
| * }); | ||
| * | ||
| * // Custom CLI path with specific log level | ||
| * // Spawn the runtime over TCP on a chosen port | ||
| * const client = new CopilotClient({ | ||
| * cliPath: "/usr/local/bin/copilot", | ||
| * logLevel: "debug" | ||
| * connection: RuntimeConnection.forTcp({ port: 9001 }), | ||
| * }); | ||
| * | ||
| * // Use a custom runtime binary | ||
| * const client = new CopilotClient({ | ||
| * connection: RuntimeConnection.forStdio({ path: "/usr/local/bin/copilot" }), | ||
| * logLevel: "debug", | ||
| * }); | ||
| * ``` | ||
| */ | ||
| constructor(options?: CopilotClientOptions); | ||
| private connectionExtraArgs; | ||
| /** | ||
@@ -113,3 +121,3 @@ * Parse CLI URL into host and port | ||
| * | ||
| * This method is called automatically when creating a session if `autoStart` is true (default). | ||
| * This method is called automatically the first time you create or resume a session. | ||
| * | ||
@@ -121,3 +129,3 @@ * @returns A promise that resolves when the connection is established | ||
| * ```typescript | ||
| * const client = new CopilotClient({ autoStart: false }); | ||
| * const client = new CopilotClient(); | ||
| * await client.start(); | ||
@@ -153,2 +161,15 @@ * // Now ready to create sessions | ||
| /** | ||
| * Alias for {@link stop} that lets `CopilotClient` participate in `await using` | ||
| * blocks for automatic cleanup. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * await using client = new CopilotClient(); | ||
| * const session = await client.createSession({ onPermissionRequest: approveAll }); | ||
| * await session.sendAndWait("Hello"); | ||
| * // client.stop() is called automatically when the block exits. | ||
| * ``` | ||
| */ | ||
| [Symbol.asyncDispose](): Promise<void>; | ||
| /** | ||
| * Forcefully stops the CLI server without graceful cleanup. | ||
@@ -183,8 +204,7 @@ * | ||
| * Sessions maintain conversation state, handle events, and manage tool execution. | ||
| * If the client is not connected and `autoStart` is enabled, this will automatically | ||
| * start the connection. | ||
| * If the client is not connected, this method automatically starts the connection. | ||
| * | ||
| * @param config - Optional configuration for the session | ||
| * @returns A promise that resolves with the created session | ||
| * @throws Error if the client is not connected and autoStart is disabled | ||
| * @throws Error if the client fails to start | ||
| * | ||
@@ -410,3 +430,3 @@ * @example | ||
| * // Listen for when a session becomes foreground in TUI | ||
| * const unsubscribe = client.on("session.foreground", (event) => { | ||
| * const unsubscribe = client.onLifecycle("session.foreground", (event) => { | ||
| * console.log(`Session ${event.sessionId} is now displayed in TUI`); | ||
@@ -419,3 +439,3 @@ * }); | ||
| */ | ||
| on<K extends SessionLifecycleEventType>(eventType: K, handler: TypedSessionLifecycleHandler<K>): () => void; | ||
| onLifecycle<K extends SessionLifecycleEventType>(eventType: K, handler: TypedSessionLifecycleHandler<K>): () => void; | ||
| /** | ||
@@ -429,3 +449,3 @@ * Subscribes to all session lifecycle events. | ||
| * ```typescript | ||
| * const unsubscribe = client.on((event) => { | ||
| * const unsubscribe = client.onLifecycle((event) => { | ||
| * switch (event.type) { | ||
@@ -445,3 +465,3 @@ * case "session.foreground": | ||
| */ | ||
| on(handler: SessionLifecycleHandler): () => void; | ||
| onLifecycle(handler: SessionLifecycleHandler): () => void; | ||
| /** | ||
@@ -448,0 +468,0 @@ * Start the CLI server process |
@@ -7,5 +7,6 @@ /** | ||
| export { CopilotClient } from "./client.js"; | ||
| export { RuntimeConnection } from "./types.js"; | ||
| export { CopilotSession, type AssistantMessageEvent } from "./session.js"; | ||
| export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, SYSTEM_PROMPT_SECTIONS, } from "./types.js"; | ||
| export type * from "./generated/session-events.js"; | ||
| export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, ConnectionState, CopilotClientOptions, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, InputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventType, SessionLifecycleHandler, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemPromptSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js"; | ||
| export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, ConnectionState, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, RemoteSessionMode, ResumeSessionConfig, SectionOverride, SectionOverrideAction, SectionTransformFn, SessionCapabilities, SessionConfig, SessionConfigBase, SessionEvent, SessionEventHandler, SessionEventPayload, SessionEventType, SessionLifecycleEvent, SessionLifecycleEventMetadata, SessionLifecycleEventType, SessionLifecycleHandler, SessionCreatedEvent, SessionDeletedEvent, SessionUpdatedEvent, SessionForegroundEvent, SessionBackgroundEvent, SessionContext, SessionListFilter, SessionMetadata, SessionUiApi, SessionFsConfig, SessionFsProvider, SessionFsFileInfo, SessionFsSqliteQueryResult, SessionFsSqliteQueryType, SessionFsSqliteProvider, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemPromptSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js"; |
+5
-212
@@ -1,10 +0,3 @@ | ||
| /** | ||
| * Copilot Session - represents a single conversation session with the Copilot CLI. | ||
| * @module session | ||
| */ | ||
| import type { MessageConnection } from "vscode-jsonrpc/node.js"; | ||
| import { createSessionRpc } from "./generated/rpc.js"; | ||
| import type { ClientSessionApiHandlers } from "./generated/rpc.js"; | ||
| import type { CommandHandler, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, ElicitationHandler, ElicitationContext, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, MessageOptions, PermissionHandler, PermissionRequestResult, ReasoningEffort, ModelCapabilitiesOverride, SectionTransformFn, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionHooks, SessionUiApi, Tool, ToolHandler, TraceContextProvider, TypedSessionEventHandler, UserInputHandler, UserInputResponse } from "./types.js"; | ||
| export declare const NO_RESULT_PERMISSION_V2_ERROR = "Permission handlers cannot return 'no-result' when connected to a protocol v2 server."; | ||
| import type { MessageOptions, ReasoningEffort, ModelCapabilitiesOverride, SessionCapabilities, SessionEvent, SessionEventHandler, SessionEventType, SessionUiApi, TypedSessionEventHandler } from "./types.js"; | ||
| /** Assistant message event - the final response from the assistant. */ | ||
@@ -57,15 +50,3 @@ export type AssistantMessageEvent = Extract<SessionEvent, { | ||
| private _capabilities; | ||
| /** @internal Client session API handlers, populated by CopilotClient during create/resume. */ | ||
| clientSessionApis: ClientSessionApiHandlers; | ||
| /** | ||
| * Creates a new CopilotSession instance. | ||
| * | ||
| * @param sessionId - The unique identifier for this session | ||
| * @param connection - The JSON-RPC message connection to the Copilot CLI | ||
| * @param workspacePath - Path to the session workspace directory (when infinite sessions enabled) | ||
| * @param traceContextProvider - Optional callback to get W3C Trace Context for outbound RPCs | ||
| * @internal This constructor is internal. Use {@link CopilotClient.createSession} to create sessions. | ||
| */ | ||
| constructor(sessionId: string, connection: MessageConnection, _workspacePath?: string | undefined, traceContextProvider?: TraceContextProvider); | ||
| /** | ||
| * Typed session-scoped RPC methods. | ||
@@ -116,2 +97,3 @@ */ | ||
| */ | ||
| send(prompt: string): Promise<string>; | ||
| send(options: MessageOptions): Promise<string>; | ||
@@ -141,2 +123,3 @@ /** | ||
| */ | ||
| sendAndWait(prompt: string, timeout?: number): Promise<AssistantMessageEvent | undefined>; | ||
| sendAndWait(options: MessageOptions, timeout?: number): Promise<AssistantMessageEvent | undefined>; | ||
@@ -189,104 +172,2 @@ /** | ||
| on(handler: SessionEventHandler): () => void; | ||
| /** | ||
| * Dispatches an event to all registered handlers. | ||
| * Also handles broadcast request events internally (external tool calls, permissions). | ||
| * | ||
| * @param event - The session event to dispatch | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| _dispatchEvent(event: SessionEvent): void; | ||
| /** | ||
| * Handles broadcast request events by executing local handlers and responding via RPC. | ||
| * Handlers are dispatched as fire-and-forget — rejections propagate as unhandled promise | ||
| * rejections, consistent with standard EventEmitter / event handler semantics. | ||
| * @internal | ||
| */ | ||
| private _handleBroadcastEvent; | ||
| /** | ||
| * Executes a tool handler and sends the result back via RPC. | ||
| * @internal | ||
| */ | ||
| private _executeToolAndRespond; | ||
| /** | ||
| * Executes a permission handler and sends the result back via RPC. | ||
| * @internal | ||
| */ | ||
| private _executePermissionAndRespond; | ||
| /** | ||
| * Executes a command handler and sends the result back via RPC. | ||
| * @internal | ||
| */ | ||
| private _executeCommandAndRespond; | ||
| /** | ||
| * Registers custom tool handlers for this session. | ||
| * | ||
| * Tools with handlers allow the assistant to execute custom functions automatically. | ||
| * Declaration-only tools are surfaced as events and left pending for the consumer. | ||
| * | ||
| * @param tools - An array of tool definitions with their handlers, or undefined to clear all tools | ||
| * @internal This method is typically called internally when creating a session with tools. | ||
| */ | ||
| registerTools(tools?: Tool[]): void; | ||
| /** | ||
| * Retrieves a registered tool handler by name. | ||
| * | ||
| * @param name - The name of the tool to retrieve | ||
| * @returns The tool handler if found, or undefined | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| getToolHandler(name: string): ToolHandler | undefined; | ||
| /** | ||
| * Registers command handlers for this session. | ||
| * | ||
| * @param commands - An array of command definitions with handlers, or undefined to clear | ||
| * @internal This method is typically called internally when creating/resuming a session. | ||
| */ | ||
| registerCommands(commands?: { | ||
| name: string; | ||
| handler: CommandHandler; | ||
| }[]): void; | ||
| /** | ||
| * Registers the elicitation handler for this session. | ||
| * | ||
| * @param handler - The handler to invoke when the server dispatches an elicitation request | ||
| * @internal This method is typically called internally when creating/resuming a session. | ||
| */ | ||
| registerElicitationHandler(handler?: ElicitationHandler): void; | ||
| /** | ||
| * Registers the exit-plan-mode handler for this session. | ||
| * | ||
| * @param handler - The handler to invoke when the server dispatches an exit-plan-mode request | ||
| * @internal This method is typically called internally when creating/resuming a session. | ||
| */ | ||
| registerExitPlanModeHandler(handler?: ExitPlanModeHandler): void; | ||
| /** | ||
| * Registers the auto-mode-switch handler for this session. | ||
| * | ||
| * @param handler - The handler to invoke when the server dispatches an auto-mode-switch request | ||
| * @internal This method is typically called internally when creating/resuming a session. | ||
| */ | ||
| registerAutoModeSwitchHandler(handler?: AutoModeSwitchHandler): void; | ||
| /** | ||
| * Handles an elicitation.requested broadcast event. | ||
| * Invokes the registered handler and responds via handlePendingElicitation RPC. | ||
| * @internal | ||
| */ | ||
| _handleElicitationRequest(context: ElicitationContext, requestId: string): Promise<void>; | ||
| /** | ||
| * Handles an exitPlanMode.request callback from the runtime. | ||
| * @internal | ||
| */ | ||
| _handleExitPlanModeRequest(request: ExitPlanModeRequest): Promise<ExitPlanModeResult>; | ||
| /** | ||
| * Handles an autoModeSwitch.request callback from the runtime. | ||
| * @internal | ||
| */ | ||
| _handleAutoModeSwitchRequest(request: AutoModeSwitchRequest): Promise<AutoModeSwitchResponse>; | ||
| /** | ||
| * Sets the host capabilities for this session. | ||
| * | ||
| * @param capabilities - The capabilities object from the create/resume response | ||
| * @internal This method is typically called internally when creating/resuming a session. | ||
| */ | ||
| setCapabilities(capabilities?: SessionCapabilities): void; | ||
| private assertElicitation; | ||
@@ -298,80 +179,2 @@ private _elicitation; | ||
| /** | ||
| * Registers a handler for permission requests. | ||
| * | ||
| * When the assistant needs permission to perform certain actions (e.g., file operations), | ||
| * this handler is called to approve or deny the request. | ||
| * | ||
| * @param handler - The permission handler function, or undefined to remove the handler | ||
| * @internal This method is typically called internally when creating a session. | ||
| */ | ||
| registerPermissionHandler(handler?: PermissionHandler): void; | ||
| /** | ||
| * Registers a user input handler for ask_user requests. | ||
| * | ||
| * When the agent needs input from the user (via ask_user tool), | ||
| * this handler is called to provide the response. | ||
| * | ||
| * @param handler - The user input handler function, or undefined to remove the handler | ||
| * @internal This method is typically called internally when creating a session. | ||
| */ | ||
| registerUserInputHandler(handler?: UserInputHandler): void; | ||
| /** | ||
| * Registers hook handlers for session lifecycle events. | ||
| * | ||
| * Hooks allow custom logic to be executed at various points during | ||
| * the session lifecycle (before/after tool use, session start/end, etc.). | ||
| * | ||
| * @param hooks - The hook handlers object, or undefined to remove all hooks | ||
| * @internal This method is typically called internally when creating a session. | ||
| */ | ||
| registerHooks(hooks?: SessionHooks): void; | ||
| /** | ||
| * Registers transform callbacks for system message sections. | ||
| * | ||
| * @param callbacks - Map of section ID to transform callback, or undefined to clear | ||
| * @internal This method is typically called internally when creating a session. | ||
| */ | ||
| registerTransformCallbacks(callbacks?: Map<string, SectionTransformFn>): void; | ||
| /** | ||
| * Handles a systemMessage.transform request from the runtime. | ||
| * Dispatches each section to its registered transform callback. | ||
| * | ||
| * @param sections - Map of section IDs to their current rendered content | ||
| * @returns A promise that resolves with the transformed sections | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| _handleSystemMessageTransform(sections: Record<string, { | ||
| content: string; | ||
| }>): Promise<{ | ||
| sections: Record<string, { | ||
| content: string; | ||
| }>; | ||
| }>; | ||
| /** | ||
| * Handles a permission request in the v2 protocol format (synchronous RPC). | ||
| * Used as a back-compat adapter when connected to a v2 server. | ||
| * | ||
| * @param request - The permission request data from the CLI | ||
| * @returns A promise that resolves with the permission decision | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| _handlePermissionRequestV2(request: unknown): Promise<PermissionRequestResult>; | ||
| /** | ||
| * Handles a user input request from the Copilot CLI. | ||
| * | ||
| * @param request - The user input request data from the CLI | ||
| * @returns A promise that resolves with the user's response | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| _handleUserInputRequest(request: unknown): Promise<UserInputResponse>; | ||
| /** | ||
| * Handles a hooks invocation from the Copilot CLI. | ||
| * | ||
| * @param hookType - The type of hook being invoked | ||
| * @param input - The input data for the hook | ||
| * @returns A promise that resolves with the hook output, or undefined | ||
| * @internal This method is for internal use by the SDK. | ||
| */ | ||
| _handleHooksInvoke(hookType: string, input: unknown): Promise<unknown>; | ||
| /** | ||
| * Retrieves all events and messages from this session's history. | ||
@@ -387,3 +190,3 @@ * | ||
| * ```typescript | ||
| * const events = await session.getMessages(); | ||
| * const events = await session.getEvents(); | ||
| * for (const event of events) { | ||
@@ -396,3 +199,3 @@ * if (event.type === "assistant.message") { | ||
| */ | ||
| getMessages(): Promise<SessionEvent[]>; | ||
| getEvents(): Promise<SessionEvent[]>; | ||
| /** | ||
@@ -420,12 +223,2 @@ * Disconnects this session and releases all in-memory resources (event handlers, | ||
| disconnect(): Promise<void>; | ||
| /** | ||
| * @deprecated Use {@link disconnect} instead. This method will be removed in a future release. | ||
| * | ||
| * Disconnects this session and releases all in-memory resources. | ||
| * Session data on disk is preserved for later resumption. | ||
| * | ||
| * @returns A promise that resolves when the session is disconnected | ||
| * @throws Error if the connection fails | ||
| */ | ||
| destroy(): Promise<void>; | ||
| /** Enables `await using session = ...` syntax for automatic cleanup. */ | ||
@@ -432,0 +225,0 @@ [Symbol.asyncDispose](): Promise<void>; |
+239
-112
@@ -51,70 +51,110 @@ /** | ||
| } | ||
| export interface CopilotClientOptions { | ||
| /** | ||
| * Configures how a {@link CopilotClient} connects to the Copilot runtime. | ||
| * Construct via the factory functions on {@link RuntimeConnection}. | ||
| */ | ||
| export type RuntimeConnection = StdioRuntimeConnection | TcpRuntimeConnection | UriRuntimeConnection; | ||
| /** | ||
| * Spawns a runtime child process and communicates over its stdin/stdout. | ||
| * This is the default if no {@link CopilotClientOptions.connection} is set. | ||
| */ | ||
| export interface StdioRuntimeConnection { | ||
| readonly kind: "stdio"; | ||
| /** Path to the runtime executable. When omitted, the bundled runtime is used. */ | ||
| readonly path?: string; | ||
| /** Extra command-line arguments to pass to the runtime process. */ | ||
| readonly args?: readonly string[]; | ||
| } | ||
| /** | ||
| * Spawns a runtime child process that listens on a TCP socket and connects to it. | ||
| */ | ||
| export interface TcpRuntimeConnection { | ||
| readonly kind: "tcp"; | ||
| /** | ||
| * Path to the CLI executable or JavaScript entry point. | ||
| * If not specified, uses the bundled CLI from the @github/copilot package. | ||
| * TCP port to listen on. `0` (the default) auto-allocates a free port. | ||
| * If the chosen port is already in use, startup fails. | ||
| */ | ||
| cliPath?: string; | ||
| readonly port?: number; | ||
| /** | ||
| * Extra arguments to pass to the CLI executable (inserted before SDK-managed args) | ||
| * Optional shared secret the SDK sends to the spawned runtime to authenticate | ||
| * the TCP connection. When omitted, a UUID is generated automatically so the | ||
| * loopback listener is safe by default. | ||
| */ | ||
| cliArgs?: string[]; | ||
| readonly connectionToken?: string; | ||
| /** Path to the runtime executable. When omitted, the bundled runtime is used. */ | ||
| readonly path?: string; | ||
| /** Extra command-line arguments to pass to the runtime process. */ | ||
| readonly args?: readonly string[]; | ||
| } | ||
| /** | ||
| * Connects to an already-running runtime at the specified URL. The SDK does not | ||
| * spawn a process in this mode. | ||
| */ | ||
| export interface UriRuntimeConnection { | ||
| readonly kind: "uri"; | ||
| /** | ||
| * Working directory for the CLI process | ||
| * If not set, inherits the current process's working directory | ||
| * URL of the runtime to connect to. Accepts `"port"`, `"host:port"`, or a | ||
| * full URL (`"http://host:port"`). | ||
| */ | ||
| cwd?: string; | ||
| readonly url: string; | ||
| /** Optional shared secret to authenticate the connection. */ | ||
| readonly connectionToken?: string; | ||
| } | ||
| /** Factory functions for constructing {@link RuntimeConnection} instances. */ | ||
| export declare const RuntimeConnection: { | ||
| /** | ||
| * Base directory for Copilot data (session state, config, etc.). | ||
| * Sets the COPILOT_HOME environment variable on the spawned CLI process. | ||
| * When not set, the CLI defaults to ~/.copilot. | ||
| * This option is only used when the SDK spawns the CLI process; it is ignored | ||
| * when connecting to an external server via {@link cliUrl}. | ||
| * Spawn a runtime child process and communicate over its stdin/stdout. | ||
| * This is the default if no {@link CopilotClientOptions.connection} is set. | ||
| */ | ||
| copilotHome?: string; | ||
| readonly forStdio: (opts?: { | ||
| path?: string; | ||
| args?: readonly string[]; | ||
| }) => StdioRuntimeConnection; | ||
| /** | ||
| * Port for the CLI server (TCP mode only) | ||
| * @default 0 (random available port) | ||
| * Spawn a runtime child process that listens on a TCP socket and connect to it. | ||
| */ | ||
| port?: number; | ||
| readonly forTcp: (opts?: { | ||
| port?: number; | ||
| connectionToken?: string; | ||
| path?: string; | ||
| args?: readonly string[]; | ||
| }) => TcpRuntimeConnection; | ||
| /** | ||
| * Use stdio transport instead of TCP | ||
| * When true, communicates with CLI via stdin/stdout pipes | ||
| * @default true | ||
| * Connect to an already-running runtime at the given URL. The SDK does not | ||
| * spawn a process in this mode. | ||
| */ | ||
| useStdio?: boolean; | ||
| readonly forUri: (url: string, opts?: { | ||
| connectionToken?: string; | ||
| }) => UriRuntimeConnection; | ||
| }; | ||
| export interface CopilotClientOptions { | ||
| /** | ||
| * When true, indicates the SDK is running as a child process of the Copilot CLI server, and should | ||
| * use its own stdio for communicating with the existing parent process. Can only be used in combination | ||
| * with useStdio: true. | ||
| * How to connect to the Copilot runtime. When omitted, defaults to | ||
| * {@link RuntimeConnection.forStdio} with the bundled runtime. | ||
| */ | ||
| isChildProcess?: boolean; | ||
| connection?: RuntimeConnection; | ||
| /** | ||
| * URL of an existing Copilot CLI server to connect to over TCP | ||
| * When provided, the client will not spawn a CLI process | ||
| * Format: "host:port" or "http://host:port" or just "port" (defaults to localhost) | ||
| * Examples: "localhost:8080", "http://127.0.0.1:9000", "8080" | ||
| * Mutually exclusive with cliPath, useStdio | ||
| * Working directory for the runtime process. | ||
| * If not set, inherits the current process's working directory. | ||
| */ | ||
| cliUrl?: string; | ||
| workingDirectory?: string; | ||
| /** | ||
| * Log level for the CLI server | ||
| * Base directory for Copilot data (session state, config, etc.). | ||
| * Sets the COPILOT_HOME environment variable on the spawned runtime. | ||
| * When not set, the runtime defaults to ~/.copilot. | ||
| * Ignored when connecting to an existing runtime via {@link RuntimeConnection.forUri}. | ||
| */ | ||
| logLevel?: "none" | "error" | "warning" | "info" | "debug" | "all"; | ||
| baseDirectory?: string; | ||
| /** | ||
| * Auto-start the CLI server on first use | ||
| * @default true | ||
| * Log level for the Copilot runtime. When omitted, the runtime uses its | ||
| * own default (currently `"info"`). | ||
| */ | ||
| autoStart?: boolean; | ||
| logLevel?: "none" | "error" | "warning" | "info" | "debug" | "all"; | ||
| /** | ||
| * @deprecated This option has no effect and will be removed in a future release. | ||
| * Environment variables to pass to the runtime process. If not set, inherits process.env. | ||
| */ | ||
| autoRestart?: boolean; | ||
| /** | ||
| * Environment variables to pass to the CLI process. If not set, inherits process.env. | ||
| */ | ||
| env?: Record<string, string | undefined>; | ||
| /** | ||
| * GitHub token to use for authentication. | ||
| * When provided, the token is passed to the CLI server via environment variable. | ||
| * When provided, the token is passed to the runtime via environment variable. | ||
| * This takes priority over other authentication methods. | ||
@@ -125,3 +165,3 @@ */ | ||
| * Whether to use the logged-in user for authentication. | ||
| * When true, the CLI server will attempt to use stored OAuth tokens or gh CLI auth. | ||
| * When true, the runtime will attempt to use stored OAuth tokens or gh CLI auth. | ||
| * When false, only explicit tokens (gitHubToken or environment variables) are used. | ||
@@ -134,3 +174,3 @@ * @default true (but defaults to false when gitHubToken is provided) | ||
| * When provided, client.listModels() calls this handler instead of | ||
| * querying the CLI server. Useful in BYOK mode to return models | ||
| * querying the runtime. Useful in BYOK mode to return models | ||
| * available from your custom provider. | ||
@@ -140,5 +180,5 @@ */ | ||
| /** | ||
| * OpenTelemetry configuration for the CLI process. | ||
| * OpenTelemetry configuration for the runtime process. | ||
| * When provided, the corresponding OTel environment variables are set | ||
| * on the spawned CLI server. | ||
| * on the spawned runtime. | ||
| */ | ||
@@ -182,4 +222,3 @@ telemetry?: TelemetryConfig; | ||
| * Set to 0 or omit to disable (sessions live indefinitely). | ||
| * This option is only used when the SDK spawns the CLI process; it is ignored | ||
| * when connecting to an external server via {@link cliUrl}. | ||
| * Ignored when connecting to an existing runtime via {@link RuntimeConnection.forUri}. | ||
| * @default undefined (disabled) | ||
@@ -189,17 +228,9 @@ */ | ||
| /** | ||
| * Connection token for the headless CLI server (TCP only). When the SDK | ||
| * spawns its own CLI in TCP mode and this is omitted, a UUID is generated | ||
| * automatically so the loopback listener is safe by default. Rejected with | ||
| * `useStdio: true` (stdio is pre-authenticated by transport). | ||
| */ | ||
| tcpConnectionToken?: string; | ||
| /** | ||
| * Enable remote session support (Mission Control integration). | ||
| * When true, sessions in a GitHub repository working directory are | ||
| * accessible from GitHub web and mobile. | ||
| * This option is only used when the SDK spawns the CLI process; it is ignored | ||
| * when connecting to an external server via {@link cliUrl}. | ||
| * Ignored when connecting to an existing runtime via {@link RuntimeConnection.forUri}. | ||
| * @default false | ||
| */ | ||
| remote?: boolean; | ||
| enableRemoteSessions?: boolean; | ||
| } | ||
@@ -216,2 +247,3 @@ /** | ||
| }; | ||
| export type ToolTelemetry = Record<string, Record<string, unknown> | undefined>; | ||
| export type ToolResultObject = { | ||
@@ -223,3 +255,3 @@ textResultForLlm: string; | ||
| sessionLog?: string; | ||
| toolTelemetry?: Record<string, unknown>; | ||
| toolTelemetry?: ToolTelemetry; | ||
| }; | ||
@@ -492,3 +524,3 @@ export type ToolResult = string | ToolResultObject; | ||
| */ | ||
| export interface InputOptions { | ||
| export interface UiInputOptions { | ||
| /** Title label for the input field. */ | ||
@@ -534,3 +566,3 @@ title?: string; | ||
| */ | ||
| input(message: string, options?: InputOptions): Promise<string | null>; | ||
| input(message: string, options?: UiInputOptions): Promise<string | null>; | ||
| } | ||
@@ -634,9 +666,16 @@ export interface ToolCallRequestPayload { | ||
| /** | ||
| * Permission request types from the server | ||
| * Permission request types from the server. This is the generated | ||
| * discriminated union from the runtime schema — switch on `kind` to | ||
| * access the variant-specific fields (e.g. shell `commands`, write | ||
| * `fileName`/`diff`, mcp `toolName`/`args`). | ||
| */ | ||
| export interface PermissionRequest { | ||
| kind: "shell" | "write" | "mcp" | "read" | "url" | "custom-tool" | "memory" | "hook"; | ||
| toolCallId?: string; | ||
| } | ||
| export type { PermissionRequest } from "./generated/session-events.js"; | ||
| import type { PermissionRequest } from "./generated/session-events.js"; | ||
| import type { PermissionDecisionRequest } from "./generated/rpc.js"; | ||
| /** | ||
| * Permission decision result returned from a {@link PermissionHandler}. | ||
| * The discriminated `kind` field selects the decision. Variant-specific | ||
| * fields (e.g. `feedback` on `{ kind: "reject" }`) come from the generated | ||
| * `PermissionDecisionRequest["result"]` union. | ||
| */ | ||
| export type PermissionRequestResult = PermissionDecisionRequest["result"] | { | ||
@@ -743,4 +782,5 @@ kind: "no-result"; | ||
| sessionId: string; | ||
| timestamp: number; | ||
| cwd: string; | ||
| /** Time at which the hook event was emitted by the runtime. */ | ||
| timestamp: Date; | ||
| workingDirectory: string; | ||
| } | ||
@@ -771,2 +811,30 @@ /** | ||
| /** | ||
| * Input for pre-MCP-tool-call hook | ||
| */ | ||
| export interface PreMcpToolCallHookInput extends BaseHookInput { | ||
| toolCallId?: string; | ||
| serverName: string; | ||
| toolName: string; | ||
| arguments: unknown; | ||
| _meta?: Record<string, unknown>; | ||
| } | ||
| /** | ||
| * Output for pre-MCP-tool-call hook | ||
| */ | ||
| export interface PreMcpToolCallHookOutput { | ||
| /** | ||
| * Hook-controlled metadata to use for the outgoing MCP request. | ||
| * - undefined/absent: preserve the current request `_meta` | ||
| * - object: use this object as request `_meta` | ||
| * - null: omit `_meta` | ||
| */ | ||
| metaToUse?: Record<string, unknown> | null; | ||
| } | ||
| /** | ||
| * Handler for pre-MCP-tool-call hook | ||
| */ | ||
| export type PreMcpToolCallHandler = (input: PreMcpToolCallHookInput, invocation: { | ||
| sessionId: string; | ||
| }) => Promise<PreMcpToolCallHookOutput | void> | PreMcpToolCallHookOutput | void; | ||
| /** | ||
| * Input for post-tool-use hook | ||
@@ -887,2 +955,6 @@ */ | ||
| /** | ||
| * Called before an MCP tool is called | ||
| */ | ||
| onPreMcpToolCall?: PreMcpToolCallHandler; | ||
| /** | ||
| * Called after a tool is executed | ||
@@ -913,5 +985,7 @@ */ | ||
| /** | ||
| * List of tools to include from this server. [] means none. "*" means all. | ||
| * List of tools to include from this server. | ||
| * `undefined` (the default) or `["*"]` means include all tools. | ||
| * `[]` means include none. | ||
| */ | ||
| tools: string[]; | ||
| tools?: string[]; | ||
| /** | ||
@@ -938,3 +1012,6 @@ * Indicates the server type: "stdio" for local/subprocess servers, "http"/"sse" for remote servers. | ||
| env?: Record<string, string>; | ||
| cwd?: string; | ||
| /** | ||
| * Working directory for the server process. | ||
| */ | ||
| workingDirectory?: string; | ||
| } | ||
@@ -1050,9 +1127,9 @@ /** | ||
| export type ReasoningEffort = "low" | "medium" | "high" | "xhigh"; | ||
| export interface SessionConfig { | ||
| /** | ||
| * Shared configuration fields used by both {@link SessionConfig} (for | ||
| * creating a new session) and {@link ResumeSessionConfig} (for resuming | ||
| * an existing one). | ||
| */ | ||
| export interface SessionConfigBase { | ||
| /** | ||
| * Optional custom session ID | ||
| * If not provided, server will generate one | ||
| */ | ||
| sessionId?: string; | ||
| /** | ||
| * Client name to identify the application using the SDK. | ||
@@ -1152,3 +1229,3 @@ * Included in the User-Agent header for API requests. | ||
| */ | ||
| onExitPlanMode?: ExitPlanModeHandler; | ||
| onExitPlanModeRequest?: ExitPlanModeHandler; | ||
| /** | ||
@@ -1158,3 +1235,3 @@ * Handler for auto-mode-switch requests from the agent. | ||
| */ | ||
| onAutoModeSwitch?: AutoModeSwitchHandler; | ||
| onAutoModeSwitchRequest?: AutoModeSwitchHandler; | ||
| /** | ||
@@ -1170,2 +1247,9 @@ * Hook handlers for intercepting session lifecycle events. | ||
| workingDirectory?: string; | ||
| /** | ||
| * Enable streaming of assistant message and reasoning chunks. | ||
| * When true, ephemeral assistant.message_delta and assistant.reasoning_delta | ||
| * events are sent as the response is generated. Clients should accumulate | ||
| * deltaContent values to build the full response. | ||
| * @default false | ||
| */ | ||
| streaming?: boolean; | ||
@@ -1241,7 +1325,2 @@ /** | ||
| /** | ||
| * Creates a remote session in the cloud instead of a local session. | ||
| * The optional repository is associated with the cloud session. | ||
| */ | ||
| cloud?: CloudSessionOptions; | ||
| /** | ||
| * Optional event handler that is registered on the session before the | ||
@@ -1260,9 +1339,24 @@ * session.create RPC is issued. This guarantees that early events emitted | ||
| */ | ||
| createSessionFsHandler?: (session: CopilotSession) => SessionFsProvider; | ||
| createSessionFsProvider?: (session: CopilotSession) => SessionFsProvider; | ||
| } | ||
| /** | ||
| * Configuration for resuming a session | ||
| * Configuration for creating a new session via {@link CopilotClient.createSession}. | ||
| */ | ||
| export type ResumeSessionConfig = Pick<SessionConfig, "clientName" | "model" | "tools" | "commands" | "systemMessage" | "availableTools" | "excludedTools" | "provider" | "enableSessionTelemetry" | "modelCapabilities" | "streaming" | "includeSubAgentStreamingEvents" | "reasoningEffort" | "onPermissionRequest" | "onUserInputRequest" | "onElicitationRequest" | "onExitPlanMode" | "onAutoModeSwitch" | "hooks" | "workingDirectory" | "configDir" | "enableConfigDiscovery" | "mcpServers" | "customAgents" | "defaultAgent" | "agent" | "skillDirectories" | "instructionDirectories" | "disabledSkills" | "infiniteSessions" | "gitHubToken" | "remoteSession" | "onEvent" | "createSessionFsHandler"> & { | ||
| export interface SessionConfig extends SessionConfigBase { | ||
| /** | ||
| * Optional custom session ID. If not provided, the server generates one. | ||
| */ | ||
| sessionId?: string; | ||
| /** | ||
| * Creates a remote session in the cloud instead of a local session. | ||
| * The optional repository is associated with the cloud session. | ||
| */ | ||
| cloud?: CloudSessionOptions; | ||
| } | ||
| /** | ||
| * Configuration for resuming an existing session via | ||
| * {@link CopilotClient.resumeSession}. | ||
| */ | ||
| export interface ResumeSessionConfig extends SessionConfigBase { | ||
| /** | ||
| * When true, skips emitting the session.resume event. | ||
@@ -1272,3 +1366,3 @@ * Useful for reconnecting to a session without triggering resume-related side effects. | ||
| */ | ||
| disableResume?: boolean; | ||
| suppressResumeEvent?: boolean; | ||
| /** | ||
@@ -1286,3 +1380,3 @@ * When true, the runtime continues any tool calls or permission prompts that were | ||
| continuePendingWork?: boolean; | ||
| }; | ||
| } | ||
| /** | ||
@@ -1347,3 +1441,3 @@ * Configuration for a custom API provider. | ||
| */ | ||
| maxInputTokens?: number; | ||
| maxPromptTokens?: number; | ||
| /** | ||
@@ -1433,3 +1527,3 @@ * Overrides the resolved model's default max output tokens. When hit, the | ||
| /** Working directory where the session was created */ | ||
| cwd: string; | ||
| workingDirectory: string; | ||
| /** Git repository root (if in a git repo) */ | ||
@@ -1477,4 +1571,4 @@ gitRoot?: string; | ||
| export interface SessionListFilter { | ||
| /** Filter by exact cwd match */ | ||
| cwd?: string; | ||
| /** Filter by exact working directory match */ | ||
| workingDirectory?: string; | ||
| /** Filter by git root */ | ||
@@ -1496,3 +1590,3 @@ gitRoot?: string; | ||
| isRemote: boolean; | ||
| /** Working directory context (cwd, git info) from session creation */ | ||
| /** Working directory context (working directory, git info) from session creation */ | ||
| context?: SessionContext; | ||
@@ -1582,31 +1676,64 @@ } | ||
| /** | ||
| * Types of session lifecycle events | ||
| * Types of session lifecycle events. | ||
| */ | ||
| export type SessionLifecycleEventType = "session.created" | "session.deleted" | "session.updated" | "session.foreground" | "session.background"; | ||
| /** | ||
| * Session lifecycle event notification | ||
| * Sent when sessions are created, deleted, updated, or change foreground/background state | ||
| * Metadata payload for session lifecycle events. Not present on | ||
| * `session.deleted` events. | ||
| */ | ||
| export interface SessionLifecycleEvent { | ||
| /** Type of lifecycle event */ | ||
| type: SessionLifecycleEventType; | ||
| /** ID of the session this event relates to */ | ||
| export interface SessionLifecycleEventMetadata { | ||
| /** Time the session was created. */ | ||
| startTime: Date; | ||
| /** Time the session was last modified. */ | ||
| modifiedTime: Date; | ||
| /** Human-readable summary of the session, if available. */ | ||
| summary?: string; | ||
| } | ||
| /** Base shape shared by every lifecycle event variant. */ | ||
| interface SessionLifecycleEventBase { | ||
| /** ID of the session this event relates to. */ | ||
| sessionId: string; | ||
| /** Session metadata (not included for deleted sessions) */ | ||
| metadata?: { | ||
| startTime: string; | ||
| modifiedTime: string; | ||
| summary?: string; | ||
| }; | ||
| /** Session metadata (not included for `session.deleted`). */ | ||
| metadata?: SessionLifecycleEventMetadata; | ||
| } | ||
| /** Emitted when a new session is created. */ | ||
| export interface SessionCreatedEvent extends SessionLifecycleEventBase { | ||
| type: "session.created"; | ||
| metadata: SessionLifecycleEventMetadata; | ||
| } | ||
| /** Emitted when a session is deleted. The metadata field is omitted. */ | ||
| export interface SessionDeletedEvent extends SessionLifecycleEventBase { | ||
| type: "session.deleted"; | ||
| metadata?: undefined; | ||
| } | ||
| /** Emitted when a session's metadata is updated. */ | ||
| export interface SessionUpdatedEvent extends SessionLifecycleEventBase { | ||
| type: "session.updated"; | ||
| metadata: SessionLifecycleEventMetadata; | ||
| } | ||
| /** Emitted when a session is brought to the foreground (TUI+server mode). */ | ||
| export interface SessionForegroundEvent extends SessionLifecycleEventBase { | ||
| type: "session.foreground"; | ||
| metadata: SessionLifecycleEventMetadata; | ||
| } | ||
| /** Emitted when a session is moved to the background (TUI+server mode). */ | ||
| export interface SessionBackgroundEvent extends SessionLifecycleEventBase { | ||
| type: "session.background"; | ||
| metadata: SessionLifecycleEventMetadata; | ||
| } | ||
| /** | ||
| * Handler for session lifecycle events | ||
| * Discriminated union of all session lifecycle events emitted in TUI+server mode. | ||
| * Switch on `type` to access the variant-specific metadata. | ||
| */ | ||
| export type SessionLifecycleEvent = SessionCreatedEvent | SessionDeletedEvent | SessionUpdatedEvent | SessionForegroundEvent | SessionBackgroundEvent; | ||
| /** | ||
| * Handler for session lifecycle events. | ||
| */ | ||
| export type SessionLifecycleHandler = (event: SessionLifecycleEvent) => void; | ||
| /** | ||
| * Typed handler for specific session lifecycle event types | ||
| * Typed handler for specific session lifecycle event types. | ||
| */ | ||
| export type TypedSessionLifecycleHandler<K extends SessionLifecycleEventType> = (event: SessionLifecycleEvent & { | ||
| export type TypedSessionLifecycleHandler<K extends SessionLifecycleEventType> = (event: Extract<SessionLifecycleEvent, { | ||
| type: K; | ||
| }) => void; | ||
| }>) => void; | ||
| /** | ||
@@ -1613,0 +1740,0 @@ * Information about the foreground session in TUI+server mode |
+10
-10
| { | ||
| "name": "@github/copilot", | ||
| "description": "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal.", | ||
| "version": "1.0.52-3", | ||
| "version": "1.0.52-4", | ||
| "license": "SEE LICENSE IN LICENSE.md", | ||
@@ -73,14 +73,14 @@ "type": "module", | ||
| "buildMetadata": { | ||
| "gitCommit": "01ebc34" | ||
| "gitCommit": "c677925" | ||
| }, | ||
| "optionalDependencies": { | ||
| "@github/copilot-linux-x64": "1.0.52-3", | ||
| "@github/copilot-linux-arm64": "1.0.52-3", | ||
| "@github/copilot-linuxmusl-x64": "1.0.52-3", | ||
| "@github/copilot-linuxmusl-arm64": "1.0.52-3", | ||
| "@github/copilot-darwin-x64": "1.0.52-3", | ||
| "@github/copilot-darwin-arm64": "1.0.52-3", | ||
| "@github/copilot-win32-x64": "1.0.52-3", | ||
| "@github/copilot-win32-arm64": "1.0.52-3" | ||
| "@github/copilot-linux-x64": "1.0.52-4", | ||
| "@github/copilot-linux-arm64": "1.0.52-4", | ||
| "@github/copilot-linuxmusl-x64": "1.0.52-4", | ||
| "@github/copilot-linuxmusl-arm64": "1.0.52-4", | ||
| "@github/copilot-darwin-x64": "1.0.52-4", | ||
| "@github/copilot-darwin-arm64": "1.0.52-4", | ||
| "@github/copilot-win32-x64": "1.0.52-4", | ||
| "@github/copilot-win32-arm64": "1.0.52-4" | ||
| } | ||
| } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 22 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 22 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 2 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
281847162
0191898
0.04%198
-0.5%