@github/copilot-win32-x64
Advanced tools
| { | ||
| "mcpServers": { | ||
| "computer-use": { | ||
| "args": [], | ||
| "command": "${PLUGIN_ROOT}/computer-use-mcp.exe", | ||
| "cwd": "${PLUGIN_ROOT}", | ||
| "type": "stdio" | ||
| } | ||
| } | ||
| } |
| { | ||
| "description": "Copilot Computer Use", | ||
| "mcpServers": "./.mcp.json", | ||
| "name": "computer-use", | ||
| "version": "0.1.71" | ||
| } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
| import type { LlmInferenceHeaders } from "./generated/rpc.js"; | ||
| declare const kSuppressCloseOnDispose: unique symbol; | ||
| /** | ||
| * Per-request context handed to every {@link CopilotRequestHandler} hook. | ||
| * | ||
| * @experimental | ||
| */ | ||
| export interface CopilotRequestContext { | ||
| readonly requestId: string; | ||
| readonly sessionId?: string; | ||
| readonly agentId?: string; | ||
| readonly parentAgentId?: string; | ||
| readonly interactionType?: string; | ||
| readonly transport: "http" | "websocket"; | ||
| url: string; | ||
| headers: LlmInferenceHeaders; | ||
| readonly signal: AbortSignal; | ||
| } | ||
| /** | ||
| * Terminal status for a callback-owned WebSocket connection. | ||
| * | ||
| * @experimental | ||
| */ | ||
| export declare class CopilotWebSocketCloseStatus { | ||
| readonly description?: string | undefined; | ||
| readonly errorCode?: string | undefined; | ||
| readonly error?: Error | undefined; | ||
| static readonly normalClosure: CopilotWebSocketCloseStatus; | ||
| constructor(description?: string | undefined, errorCode?: string | undefined, error?: Error | undefined); | ||
| } | ||
| /** | ||
| * Lower-level WebSocket handler with no upstream connection. | ||
| * | ||
| * This is the abstract base shared by all WebSocket handlers. It does not open | ||
| * or forward to any upstream server on its own — subclass it directly only when | ||
| * you want to service a fully synthetic connection yourself (e.g. answer the | ||
| * runtime without any real backend). For the common case of mutating and | ||
| * forwarding traffic to the real upstream, subclass {@link CopilotWebSocketForwarder} | ||
| * instead, which connects upstream and forwards by default. | ||
| * | ||
| * @experimental | ||
| */ | ||
| export declare abstract class CopilotWebSocketHandler implements AsyncDisposable { | ||
| #private; | ||
| [kSuppressCloseOnDispose]: boolean; | ||
| protected readonly context: CopilotRequestContext; | ||
| protected constructor(context: CopilotRequestContext); | ||
| sendResponseMessage(data: string | Uint8Array): Promise<void>; | ||
| close(status?: CopilotWebSocketCloseStatus): Promise<void>; | ||
| abstract sendRequestMessage(data: string | Uint8Array): Promise<void> | void; | ||
| [Symbol.asyncDispose](): Promise<void>; | ||
| } | ||
| /** | ||
| * WebSocket handler that connects to the real upstream and forwards traffic by | ||
| * default. This is the type returned by the default | ||
| * {@link CopilotRequestHandler.openWebSocket}. | ||
| * | ||
| * Override nothing to get full pass-through. To mutate traffic, subclass this | ||
| * type and override a message hook, then call `super` to keep forwarding to the | ||
| * upstream. (Subclassing {@link CopilotWebSocketHandler} instead would drop | ||
| * forwarding entirely.) | ||
| * | ||
| * @experimental | ||
| */ | ||
| export declare class CopilotWebSocketForwarder extends CopilotWebSocketHandler { | ||
| #private; | ||
| constructor(context: CopilotRequestContext); | ||
| sendRequestMessage(data: string | Uint8Array): void; | ||
| close(status?: CopilotWebSocketCloseStatus): Promise<void>; | ||
| [Symbol.asyncDispose](): Promise<void>; | ||
| } | ||
| /** | ||
| * Base class for SDK consumers who want to observe or mutate the outbound | ||
| * model-layer requests the runtime issues (for both CAPI and BYOK providers). | ||
| * Subclass and override {@link sendRequest} or {@link openWebSocket}; an | ||
| * instance that overrides nothing is a transparent pass-through. | ||
| * | ||
| * @experimental | ||
| */ | ||
| export declare class CopilotRequestHandler { | ||
| #private; | ||
| protected sendRequest(request: Request, ctx: CopilotRequestContext): Promise<Response>; | ||
| protected openWebSocket(ctx: CopilotRequestContext): Promise<CopilotWebSocketHandler>; | ||
| } | ||
| export {}; |
| import { PassThrough, Writable } from "node:stream"; | ||
| export declare class FfiRuntimeHost { | ||
| private readonly libraryPath; | ||
| private readonly cliEntrypoint; | ||
| private readonly environment; | ||
| private readonly args; | ||
| private readonly lib; | ||
| private serverId; | ||
| private connectionId; | ||
| private disposed; | ||
| private outboundCallback; | ||
| private keepAliveTimer; | ||
| /** The stream JSON-RPC reads server→client frames from. */ | ||
| readonly receiveStream: PassThrough; | ||
| /** The stream JSON-RPC writes client→server frames to. */ | ||
| readonly sendStream: Writable; | ||
| private constructor(); | ||
| /** | ||
| * Resolves the cdylib next to the given CLI entrypoint and prepares the FFI host. | ||
| * The cdylib is resolved as `prebuilds/<prebuildsFolder>/runtime.node` relative to | ||
| * the entrypoint directory (the napi-rs `<node-platform>-<arch>` layout, e.g. | ||
| * `linux-x64`). Throws if it cannot be found. | ||
| */ | ||
| static create(cliEntrypoint: string, prebuildsFolder: string, environment: Record<string, string | undefined> | undefined, args: readonly string[]): FfiRuntimeHost; | ||
| /** | ||
| * Starts the in-process runtime: spawns the CLI worker via the native host, | ||
| * waits for readiness, and opens the FFI JSON-RPC connection. | ||
| */ | ||
| start(): Promise<void>; | ||
| private writeFrame; | ||
| /** | ||
| * Native outbound (server→client) callback. koffi delivers it on the JS event loop | ||
| * via a threadsafe function, so the frame is decoded and written straight to | ||
| * {@link receiveStream}. The native pointer is only valid for this call, so the | ||
| * bytes are copied out before returning. | ||
| */ | ||
| private feedInbound; | ||
| private unregisterCallback; | ||
| /** Closes the FFI connection, shuts down the native host, and releases resources. */ | ||
| dispose(): void; | ||
| } |
+47
-33
| import { createServerRpc } from "./generated/rpc.js"; | ||
| import { CopilotSession } from "./session.js"; | ||
| import type { CopilotClientOptions, GetAuthStatusResponse, GetStatusResponse, ModelInfo, ResumeSessionConfig, SessionConfig, SessionLifecycleEventType, SessionLifecycleHandler, SessionListFilter, SessionMetadata, TypedSessionLifecycleHandler } from "./types.js"; | ||
| /** | ||
| * Main client for interacting with the Copilot CLI. | ||
| * | ||
| * The CopilotClient manages the connection to the Copilot CLI server and provides | ||
| * methods to create and manage conversation sessions. It can either spawn a CLI | ||
| * server process or connect to an existing server. | ||
| * | ||
| * @example | ||
| * ```typescript | ||
| * import { CopilotClient } from "@github/copilot-sdk"; | ||
| * | ||
| * // Create a client with default options (spawns CLI server) | ||
| * const client = new CopilotClient(); | ||
| * | ||
| * // Or connect to an existing server | ||
| * const client = new CopilotClient({ connection: RuntimeConnection.forUri("localhost:3000") }); | ||
| * | ||
| * // Create a session | ||
| * const session = await client.createSession({ onPermissionRequest: approveAll, model: "gpt-4" }); | ||
| * | ||
| * // Send messages and handle responses | ||
| * session.on((event) => { | ||
| * if (event.type === "assistant.message") { | ||
| * console.log(event.data.content); | ||
| * } | ||
| * }); | ||
| * await session.send({ prompt: "Hello!" }); | ||
| * | ||
| * // Clean up | ||
| * await session.disconnect(); | ||
| * await client.stop(); | ||
| * ``` | ||
| */ | ||
| export declare class CopilotClient { | ||
| private cliStartTimeout; | ||
| private cliProcess; | ||
| private ffiHost; | ||
| private connection; | ||
| private messageWriter; | ||
| private socket; | ||
@@ -70,2 +39,5 @@ private runtimePort; | ||
| private sessionFsConfig; | ||
| private requestHandler; | ||
| private onGitHubTelemetry?; | ||
| private clientGlobalHandlers; | ||
| /** | ||
@@ -77,3 +49,16 @@ * Typed server-scoped RPC methods. | ||
| private logDebugTiming; | ||
| private logDebug; | ||
| /** | ||
| * Environment variable that overrides the transport when the caller does not set | ||
| * {@link CopilotClientOptions.connection}. Accepts `"inprocess"` or `"stdio"` | ||
| * (case-insensitive); unset preserves the default stdio transport. Any other value | ||
| * is an error. | ||
| */ | ||
| private static readonly DEFAULT_CONNECTION_ENV_VAR; | ||
| /** | ||
| * Resolves the default {@link RuntimeConnection} for the no-connection case, | ||
| * honoring {@link CopilotClient.DEFAULT_CONNECTION_ENV_VAR}. | ||
| */ | ||
| private static resolveDefaultConnection; | ||
| /** | ||
| * Creates a new CopilotClient instance. | ||
@@ -114,2 +99,3 @@ * | ||
| private setupSessionFs; | ||
| private setupClientGlobalHandlers; | ||
| /** | ||
@@ -440,2 +426,10 @@ * Starts the CLI server and establishes a connection. | ||
| /** | ||
| * Builds the environment for the spawned runtime child process (stdio/TCP): applies | ||
| * the auth token, connection token, `COPILOT_HOME`, keychain setting, and telemetry | ||
| * variables on top of the effective env. Not used by the in-process (FFI) transport, | ||
| * whose worker inherits the host process's ambient environment | ||
| * (see {@link CopilotClient.startInProcessFfi}). | ||
| */ | ||
| private buildRuntimeEnv; | ||
| /** | ||
| * Start the CLI server process | ||
@@ -448,3 +442,23 @@ */ | ||
| private connectToServer; | ||
| /** Starts the in-process FFI runtime with SDK-managed typed options. */ | ||
| private startInProcessFfi; | ||
| /** | ||
| * Connect to the in-process FFI runtime host over its receive/send streams, | ||
| * reusing the same `vscode-jsonrpc` framing as the stdio transport. | ||
| */ | ||
| private connectViaFfi; | ||
| /** | ||
| * Resolves the CLI entrypoint used for in-process FFI hosting: `COPILOT_CLI_PATH` | ||
| * when set, otherwise the bundled platform-package entrypoint. | ||
| */ | ||
| private resolveCliPathForFfi; | ||
| /** | ||
| * Returns the napi prebuilds folder name for the current host — the | ||
| * `<node-platform>-<arch>` convention (e.g. `win32-x64`, `darwin-arm64`, | ||
| * `linux-x64`, `linuxmusl-x64`) under which the runtime ships | ||
| * `prebuilds/<folder>/runtime.node`. | ||
| */ | ||
| private static getNapiPrebuildsFolder; | ||
| private static isMusl; | ||
| /** | ||
| * Connect to child via stdio pipes | ||
@@ -451,0 +465,0 @@ */ |
@@ -11,4 +11,4 @@ /** | ||
| export { Canvas, CanvasError, createCanvas, type CanvasAction, type CanvasDeclaration, type CanvasHostContext, type CanvasHostContextCapabilities, type CanvasJsonSchema, type CanvasOptions, } from "./canvas.js"; | ||
| export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, SYSTEM_MESSAGE_SECTIONS, } from "./types.js"; | ||
| export { defineTool, approveAll, convertMcpCallToolResult, createSessionFsAdapter, CopilotRequestHandler, CopilotWebSocketHandler, CopilotWebSocketCloseStatus, CopilotWebSocketForwarder, SYSTEM_MESSAGE_SECTIONS, } from "./types.js"; | ||
| export type * from "./generated/session-events.js"; | ||
| export type { CommandContext, CommandDefinition, CommandHandler, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, ProviderModelConfig, 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, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, ToolTelemetry, ToolResultObject, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js"; | ||
| export type { CommandContext, CommandDefinition, CommandHandler, CanvasProviderIdentity, CloudSessionOptions, CloudSessionRepository, AutoModeSwitchHandler, AutoModeSwitchRequest, AutoModeSwitchResponse, CopilotClientMode, CopilotClientOptions, StdioRuntimeConnection, InProcessRuntimeConnection, TcpRuntimeConnection, UriRuntimeConnection, ChildProcessRuntimeConnection, CustomAgentConfig, ElicitationFieldValue, ElicitationHandler, ElicitationParams, ElicitationContext, ElicitationResult, ElicitationSchema, ElicitationSchemaField, ExitPlanModeHandler, ExitPlanModeRequest, ExitPlanModeResult, ExtensionInfo, ForegroundSessionInfo, GetAuthStatusResponse, GetStatusResponse, GitHubTelemetryNotification, GitHubTelemetryEvent, GitHubTelemetryClientInfo, InfiniteSessionConfig, LargeToolOutputConfig, MemoryConfiguration, UiInputOptions, MCPStdioServerConfig, MCPHTTPServerConfig, MCPServerConfig, DefaultAgentConfig, BearerTokenProvider, MessageOptions, ModelBilling, ModelBillingTokenPrices, ModelBillingTokenPricesLongContext, CapiSessionOptions, ModelCapabilities, ModelCapabilitiesOverride, ModelInfo, ModelPolicy, NamedProviderConfig, PermissionHandler, PermissionRequest, PermissionRequestResult, ProviderConfig, ProviderModelConfig, ProviderTokenArgs, 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, CopilotRequestContext, SystemMessageAppendConfig, SystemMessageConfig, SystemMessageCustomizeConfig, SystemMessageReplaceConfig, SystemMessageSection, TelemetryConfig, TraceContext, TraceContextProvider, Tool, ToolHandler, ToolInvocation, CurrentToolMetadata, ToolTelemetry, ToolResultObject, ToolSearchConfig, TypedSessionEventHandler, TypedSessionLifecycleHandler, ZodSchema, } from "./types.js"; |
@@ -33,2 +33,7 @@ import { createSessionRpc } from "./generated/rpc.js"; | ||
| */ | ||
| /** | ||
| * Fixed name of the runtime's built-in tool-search tool. A client can replace | ||
| * its behavior by registering a {@link Tool} with this exact name and | ||
| * `overridesBuiltInTool: true`. | ||
| */ | ||
| export declare class CopilotSession { | ||
@@ -42,4 +47,6 @@ readonly sessionId: string; | ||
| private canvases; | ||
| private bearerTokenProviders; | ||
| private commandHandlers; | ||
| private permissionHandler?; | ||
| private mcpAuthHandler?; | ||
| private userInputHandler?; | ||
@@ -55,2 +62,3 @@ private elicitationHandler?; | ||
| private openCanvasInstances; | ||
| private disconnected; | ||
| /** | ||
@@ -265,3 +273,3 @@ * Typed session-scoped RPC methods. | ||
| * ```typescript | ||
| * await session.setModel("gpt-4.1"); | ||
| * await session.setModel("gpt-5.4"); | ||
| * await session.setModel("claude-sonnet-4.6", { reasoningEffort: "high" }); | ||
@@ -268,0 +276,0 @@ * ``` |
+1
-1
@@ -9,3 +9,3 @@ #!/usr/bin/env node | ||
| var Ve=Object.create;var B=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var M=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var E=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}};var Ge=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of je(r))!qe.call(e,o)&&o!==t&&B(e,o,{get:()=>r[o],enumerable:!(n=Ue(r,o))||n.enumerable});return e};var Ke=(e,r,t)=>(t=e!=null?Ve(We(e)):{},Ge(r||!e||!e.__esModule?B(t,"default",{value:e,enumerable:!0}):t,e));var X=E((Jr,z)=>{"use strict";var Y=()=>process.platform==="linux",C=null,Ze=()=>{if(!C)if(Y()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,C=process.report.getReport(),process.report.excludeNetwork=e}else C={};return C};z.exports={isLinux:Y,getReport:Ze}});var Z=E((Yr,Q)=>{"use strict";var y=M("fs"),er="/usr/bin/ldd",rr="/proc/self/exe",L=2048,tr=e=>{let r=y.openSync(e,"r"),t=Buffer.alloc(L),n=y.readSync(r,t,0,L,0);return y.close(r,()=>{}),t.subarray(0,n)},nr=e=>new Promise((r,t)=>{y.open(e,"r",(n,o)=>{if(n)t(n);else{let i=Buffer.alloc(L);y.read(o,i,0,L,0,(s,a)=>{r(i.subarray(0,a)),y.close(o,()=>{})})}})});Q.exports={LDD_PATH:er,SELF_PATH:rr,readFileSync:tr,readFile:nr}});var re=E((zr,ee)=>{"use strict";var or=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let r=e.readUInt32LE(32),t=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let o=0;o<n;o++){let i=r+o*t;if(e.readUInt32LE(i)===3){let a=e.readUInt32LE(i+8),h=e.readUInt32LE(i+32);return e.subarray(a,a+h).toString().replace(/\0.*$/g,"")}}return null};ee.exports={interpreterPath:or}});var Ee=E((Xr,ve)=>{"use strict";var ne=M("child_process"),{isLinux:b,getReport:oe}=X(),{LDD_PATH:S,SELF_PATH:ie,readFile:w,readFileSync:I}=Z(),{interpreterPath:se}=re(),u,f,d,ae="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",m="",ce=()=>m||new Promise(e=>{ne.exec(ae,(r,t)=>{m=r?" ":t,e(m)})}),le=()=>{if(!m)try{m=ne.execSync(ae,{encoding:"utf8"})}catch{m=" "}return m},p="glibc",ue=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,g="musl",ir=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fe=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?p:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ir)?g:null},de=e=>{let[r,t]=e.split(/[\r\n]+/);return r&&r.includes(p)?p:t&&t.includes(g)?g:null},pe=e=>{if(e){if(e.includes("/ld-musl-"))return g;if(e.includes("/ld-linux-"))return p}return null},me=e=>(e=e.toString(),e.includes("musl")?g:e.includes("GNU C Library")?p:null),sr=async()=>{if(f!==void 0)return f;f=null;try{let e=await w(S);f=me(e)}catch{}return f},ar=()=>{if(f!==void 0)return f;f=null;try{let e=I(S);f=me(e)}catch{}return f},cr=async()=>{if(u!==void 0)return u;u=null;try{let e=await w(ie),r=se(e);u=pe(r)}catch{}return u},lr=()=>{if(u!==void 0)return u;u=null;try{let e=I(ie),r=se(e);u=pe(r)}catch{}return u},ge=async()=>{let e=null;if(b()&&(e=await cr(),!e&&(e=await sr(),e||(e=fe()),!e))){let r=await ce();e=de(r)}return e},he=()=>{let e=null;if(b()&&(e=lr(),!e&&(e=ar(),e||(e=fe()),!e))){let r=le();e=de(r)}return e},ur=async()=>b()&&await ge()!==p,fr=()=>b()&&he()!==p,dr=async()=>{if(d!==void 0)return d;d=null;try{let r=(await w(S)).match(ue);r&&(d=r[1])}catch{}return d},pr=()=>{if(d!==void 0)return d;d=null;try{let r=I(S).match(ue);r&&(d=r[1])}catch{}return d},ye=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},te=e=>e.trim().split(/\s+/)[1],be=e=>{let[r,t,n]=e.split(/[\r\n]+/);return r&&r.includes(p)?te(r):t&&n&&t.includes(g)?te(n):null},mr=async()=>{let e=null;if(b()&&(e=await dr(),e||(e=ye()),!e)){let r=await ce();e=be(r)}return e},gr=()=>{let e=null;if(b()&&(e=pr(),e||(e=ye()),!e)){let r=le();e=be(r)}return e};ve.exports={GLIBC:p,MUSL:g,family:ge,familySync:he,isNonGlibcLinux:ur,isNonGlibcLinuxSync:fr,version:mr,versionSync:gr}});import $r from"node:module";import{dirname as Dr,join as Br}from"node:path";import*as Me from"node:sea";import{fileURLToPath as Mr,pathToFileURL as H}from"node:url";import{basename as hr,join as N}from"node:path";var V="0.0.1";import{readdir as Je,access as Ye,constants as ze}from"node:fs/promises";import{join as c,basename as U}from"node:path";import{homedir as x}from"node:os";function W(){return process.env.XDG_CACHE_HOME||c(x(),".cache")}function q(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function G(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function Xe(){if(process.platform==="darwin")return c(x(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||c(x(),".cache");return c(e,"copilot")}return c(W(),"copilot")}function K(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(c(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(c(Xe(),"pkg")),e.push(c(W(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(c(process.env.COPILOT_HOME,"pkg")),e.push(c(x(),".copilot","pkg")),[...new Set(e)]}function j(e){let r=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(r)return[Number(r[1]),Number(r[2]),Number(r[3])]}function Qe(e,r){let t=j(e),n=j(r);if(!t&&!n)return 0;if(!t)return-1;if(!n)return 1;for(let s=0;s<3;s++)if(t[s]!==n[s])return t[s]-n[s];let o=e.includes("-"),i=r.includes("-");return o!==i?o?-1:1:e.localeCompare(r)}async function J(e,...r){let t=[];for(let n of r){let o;try{o=await Je(n)}catch{continue}for(let i of o){let s=c(n,i);try{await Ye(c(s,e),ze.R_OK),t.push(s)}catch{continue}}}return t.sort((n,o)=>{let i=Qe(U(o),U(n));return i!==0?i:n.localeCompare(o)}),t}import{join as Ce}from"node:path";var P=Ke(Ee(),1);function T(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??P.familySync)()===P.MUSL?"musl":"gnu"}function A(e=process.platform,r){let t=r??(e==="linux"?T():"gnu");return e==="linux"&&t==="musl"?"linuxmusl":e}function xe(e=process.platform,r,t=process.arch){return`${A(e,r)}-${t}`}function Le(){let e=xe();return K().flatMap(r=>[Ce(r,"universal"),Ce(r,e)])}function yr(){return process.env.COPILOT_CLI_VERSION?process.env.COPILOT_CLI_VERSION:"1.0.72-0"}async function Se(e,r){let t=N(e,"app.js"),n=yr()===V,o=G();if(r&&(o||q()&&!n)){let i=Le(),s=await J("app.js",...i);if(o){let a=s.find(h=>hr(h)===o);a?t=N(a,"app.js"):process.stderr.write(`Warning: preferred version ${o} not found in package cache, using built-in version | ||
| var Ve=Object.create;var B=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var je=Object.getOwnPropertyNames;var We=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var M=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,t)=>(typeof require<"u"?require:r)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var E=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}};var Ge=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of je(r))!qe.call(e,o)&&o!==t&&B(e,o,{get:()=>r[o],enumerable:!(n=Ue(r,o))||n.enumerable});return e};var Ke=(e,r,t)=>(t=e!=null?Ve(We(e)):{},Ge(r||!e||!e.__esModule?B(t,"default",{value:e,enumerable:!0}):t,e));var X=E((Jr,z)=>{"use strict";var Y=()=>process.platform==="linux",C=null,Ze=()=>{if(!C)if(Y()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,C=process.report.getReport(),process.report.excludeNetwork=e}else C={};return C};z.exports={isLinux:Y,getReport:Ze}});var Z=E((Yr,Q)=>{"use strict";var y=M("fs"),er="/usr/bin/ldd",rr="/proc/self/exe",L=2048,tr=e=>{let r=y.openSync(e,"r"),t=Buffer.alloc(L),n=y.readSync(r,t,0,L,0);return y.close(r,()=>{}),t.subarray(0,n)},nr=e=>new Promise((r,t)=>{y.open(e,"r",(n,o)=>{if(n)t(n);else{let i=Buffer.alloc(L);y.read(o,i,0,L,0,(s,a)=>{r(i.subarray(0,a)),y.close(o,()=>{})})}})});Q.exports={LDD_PATH:er,SELF_PATH:rr,readFileSync:tr,readFile:nr}});var re=E((zr,ee)=>{"use strict";var or=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let r=e.readUInt32LE(32),t=e.readUInt16LE(54),n=e.readUInt16LE(56);for(let o=0;o<n;o++){let i=r+o*t;if(e.readUInt32LE(i)===3){let a=e.readUInt32LE(i+8),h=e.readUInt32LE(i+32);return e.subarray(a,a+h).toString().replace(/\0.*$/g,"")}}return null};ee.exports={interpreterPath:or}});var Ee=E((Xr,ve)=>{"use strict";var ne=M("child_process"),{isLinux:b,getReport:oe}=X(),{LDD_PATH:S,SELF_PATH:ie,readFile:w,readFileSync:I}=Z(),{interpreterPath:se}=re(),u,f,d,ae="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",m="",ce=()=>m||new Promise(e=>{ne.exec(ae,(r,t)=>{m=r?" ":t,e(m)})}),le=()=>{if(!m)try{m=ne.execSync(ae,{encoding:"utf8"})}catch{m=" "}return m},p="glibc",ue=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,g="musl",ir=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),fe=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?p:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(ir)?g:null},de=e=>{let[r,t]=e.split(/[\r\n]+/);return r&&r.includes(p)?p:t&&t.includes(g)?g:null},pe=e=>{if(e){if(e.includes("/ld-musl-"))return g;if(e.includes("/ld-linux-"))return p}return null},me=e=>(e=e.toString(),e.includes("musl")?g:e.includes("GNU C Library")?p:null),sr=async()=>{if(f!==void 0)return f;f=null;try{let e=await w(S);f=me(e)}catch{}return f},ar=()=>{if(f!==void 0)return f;f=null;try{let e=I(S);f=me(e)}catch{}return f},cr=async()=>{if(u!==void 0)return u;u=null;try{let e=await w(ie),r=se(e);u=pe(r)}catch{}return u},lr=()=>{if(u!==void 0)return u;u=null;try{let e=I(ie),r=se(e);u=pe(r)}catch{}return u},ge=async()=>{let e=null;if(b()&&(e=await cr(),!e&&(e=await sr(),e||(e=fe()),!e))){let r=await ce();e=de(r)}return e},he=()=>{let e=null;if(b()&&(e=lr(),!e&&(e=ar(),e||(e=fe()),!e))){let r=le();e=de(r)}return e},ur=async()=>b()&&await ge()!==p,fr=()=>b()&&he()!==p,dr=async()=>{if(d!==void 0)return d;d=null;try{let r=(await w(S)).match(ue);r&&(d=r[1])}catch{}return d},pr=()=>{if(d!==void 0)return d;d=null;try{let r=I(S).match(ue);r&&(d=r[1])}catch{}return d},ye=()=>{let e=oe();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},te=e=>e.trim().split(/\s+/)[1],be=e=>{let[r,t,n]=e.split(/[\r\n]+/);return r&&r.includes(p)?te(r):t&&n&&t.includes(g)?te(n):null},mr=async()=>{let e=null;if(b()&&(e=await dr(),e||(e=ye()),!e)){let r=await ce();e=be(r)}return e},gr=()=>{let e=null;if(b()&&(e=pr(),e||(e=ye()),!e)){let r=le();e=be(r)}return e};ve.exports={GLIBC:p,MUSL:g,family:ge,familySync:he,isNonGlibcLinux:ur,isNonGlibcLinuxSync:fr,version:mr,versionSync:gr}});import $r from"node:module";import{dirname as Dr,join as Br}from"node:path";import*as Me from"node:sea";import{fileURLToPath as Mr,pathToFileURL as H}from"node:url";import{basename as hr,join as N}from"node:path";var V="0.0.1";import{readdir as Je,access as Ye,constants as ze}from"node:fs/promises";import{join as c,basename as U}from"node:path";import{homedir as x}from"node:os";function W(){return process.env.XDG_CACHE_HOME||c(x(),".cache")}function q(){if(process.argv.includes("--no-auto-update")||process.argv.includes("--prefer-version"))return!1;let e=process.env.COPILOT_AUTO_UPDATE;return!(e&&e.toLowerCase()==="false")}function G(){let e=process.argv.indexOf("--prefer-version");if(!(e===-1||e+1>=process.argv.length))return process.argv[e+1]}function Xe(){if(process.platform==="darwin")return c(x(),"Library","Caches","copilot");if(process.platform==="win32"){let e=process.env.LOCALAPPDATA||c(x(),".cache");return c(e,"copilot")}return c(W(),"copilot")}function K(){let e=[];return process.env.COPILOT_CACHE_HOME&&e.push(c(process.env.COPILOT_CACHE_HOME,"pkg")),e.push(c(Xe(),"pkg")),e.push(c(W(),"copilot","pkg")),process.env.COPILOT_HOME&&e.push(c(process.env.COPILOT_HOME,"pkg")),e.push(c(x(),".copilot","pkg")),[...new Set(e)]}function j(e){let r=e.match(/^(\d+)\.(\d+)\.(\d+)/);if(r)return[Number(r[1]),Number(r[2]),Number(r[3])]}function Qe(e,r){let t=j(e),n=j(r);if(!t&&!n)return 0;if(!t)return-1;if(!n)return 1;for(let s=0;s<3;s++)if(t[s]!==n[s])return t[s]-n[s];let o=e.includes("-"),i=r.includes("-");return o!==i?o?-1:1:e.localeCompare(r)}async function J(e,...r){let t=[];for(let n of r){let o;try{o=await Je(n)}catch{continue}for(let i of o){let s=c(n,i);try{await Ye(c(s,e),ze.R_OK),t.push(s)}catch{continue}}}return t.sort((n,o)=>{let i=Qe(U(o),U(n));return i!==0?i:n.localeCompare(o)}),t}import{join as Ce}from"node:path";var P=Ke(Ee(),1);function T(e={}){return(e.platform??process.platform)!=="linux"?"gnu":(e.detectLibcFamily??P.familySync)()===P.MUSL?"musl":"gnu"}function A(e=process.platform,r){let t=r??(e==="linux"?T():"gnu");return e==="linux"&&t==="musl"?"linuxmusl":e}function xe(e=process.platform,r,t=process.arch){return`${A(e,r)}-${t}`}function Le(){let e=xe();return K().flatMap(r=>[Ce(r,"universal"),Ce(r,e)])}function yr(){return process.env.COPILOT_CLI_VERSION?process.env.COPILOT_CLI_VERSION:"1.0.72-1"}async function Se(e,r){let t=N(e,"app.js"),n=yr()===V,o=G();if(r&&(o||q()&&!n)){let i=Le(),s=await J("app.js",...i);if(o){let a=s.find(h=>hr(h)===o);a?t=N(a,"app.js"):process.stderr.write(`Warning: preferred version ${o} not found in package cache, using built-in version | ||
| `)}else s.length>0&&(t=N(s[0],"app.js"))}return t}import{existsSync as br}from"node:fs";import{basename as vr,resolve as Er}from"node:path";var Pe="extension_bootstrap.mjs";function Te(e,r,t=br){let n=e.find(s=>vr(s)===Pe);if(!n)return;process.stderr.write(`[extension-fork] resolveBootstrapPath: __dir=${r}, argv-bootstrap=${n} | ||
@@ -12,0 +12,0 @@ `);let o=Er(r,"preloads",Pe),i=t(o);if(process.stderr.write(`[extension-fork] resolveBootstrapPath: localBootstrap=${o}, localExists=${i} |
+1
-1
| { | ||
| "name": "@github/copilot-win32-x64", | ||
| "version": "1.0.72-0", | ||
| "version": "1.0.72-1", | ||
| "description": "GitHub Copilot CLI for win32-x64", | ||
@@ -5,0 +5,0 @@ "license": "SEE LICENSE IN LICENSE.md", |
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
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 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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 7 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 7 instances
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
317913655
9.6%226
1.8%171828
4.57%274
1.48%41
5.13%