@github/copilot-language-server 1.537.3 → 1.537.4

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.
Files changed (2) hide show
  1. package/dist/main.js +2 -2
  2. package/package.json +8 -8
package/dist/main.js CHANGED
@@ -1945,7 +1945,7 @@ ${r}+- `:"";return e+this.description+o}}},L0=class{constructor(e,r,n,o){this.la
1945
1945
  (using_declaration)
1946
1946
  (alias_declaration)
1947
1947
  (static_assert_declaration)
1948
- ] @statement`}};var p5=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return L0.isSupported(e)}static isTrimmedByDefault(e){return L0.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=bMt(n,L0.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{SMt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var IYe=class extends p5{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndex<s?this.asCompletionOffset(r.node.endIndex):n;let c=r,l=r.nextSibling;for(;l&&l.node.endIndex<=s&&!this.hasNonStatementContentAfter(c)&&!this.isCompoundStatement(l);)c=l,l=l.nextSibling;return l&&c.node.endIndex>o&&c.node.endIndex<s?this.asCompletionOffset(c.node.endIndex):n}};async function myn(t,e){var l=[];try{let r=t.getText();let n=t.offsetAt(e);let o=bMt(l,L0.create(t.detectedLanguageId,r,0,r.length));await o.build();let s=o.statementAt(n);if(!s)return"non-block";if(!s.isCompoundStatementType&&s.children.length===0)return s.parent&&!s.nextSibling&&s.node.endPosition.row<=e.line?"block-end":s.parent?"mid-block":"non-block";if(s.children.length===0)return"empty-block";let c=s.children[s.children.length-1];if(n<c.node.startIndex)return"mid-block";return"block-end"}catch(u){var d=u,f=!0}finally{SMt(l,d,f)}}a(myn,"getBlockPositionType");p();function aGo(t){return t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy}a(aGo,"getProxyFromEnvironment");function cGo(t){return t.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}a(cGo,"getRejectUnauthorizedFromEnvironment");var gyn=b.Object({proxy:b.Optional(b.String()),proxyStrictSSL:b.Optional(b.Boolean()),proxyAuthorization:b.Optional(b.String()),proxyKerberosServicePrincipal:b.Optional(b.String()),noProxy:b.Optional(b.Array(b.String()))});function Ayn(t){let e=aGo(t),r=Zxe({proxy:e,proxyStrictSSL:cGo(t)}),n=t.GH_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.GITHUB_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.AGENT_KERBEROS_SERVICE_PRINCIPAL;return n&&(r.proxyKerberosServicePrincipal=n),r}a(Ayn,"getHttpSettingsFromEnvironment");function Zxe(t){if(!t.proxy)return{...t,proxy:""};try{let{protocol:e,host:r,username:n,password:o,pathname:s,search:c,hash:l}=new URL(t.proxy);return{...t,proxy:`${e}//${r}${s}${c}${l}`,proxyAuthorization:t.proxyAuthorization||lGo(n,o),noProxy:t.noProxy||[]}}catch{return{...t,proxy:""}}}a(Zxe,"normalizeHttpSettings");function lGo(t,e){return!t||!e?"":`${decodeURIComponent(t)}:${decodeURIComponent(e)}`}a(lGo,"getAuth");var Xxe={};Fi(Xxe,{anthropicClaude:()=>AGo,build:()=>hGo,buildType:()=>mGo,default:()=>bGo,dependencies:()=>_Go,description:()=>fGo,devDependencies:()=>EGo,displayName:()=>dGo,engines:()=>gGo,name:()=>uGo,overrides:()=>vGo,overridesComments:()=>CGo,scripts:()=>yGo,version:()=>pGo});var uGo="copilot",dGo="GitHub Copilot",fGo="Your AI pair programmer",pGo="1.537.3",hGo="112",mGo="prod",gGo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},AGo={cliPackageVersion:"2.1.159"},yGo={build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:gdpr":"tsx script/checkGdprComments.ts","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:agent-e2e-full":"npm run build","pretest:agent-e2e":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:agent-e2e":'mocha "agent/e2e/**/*.test.{ts,tsx}" --exclude "agent/e2e/**/*.daily.test.{ts,tsx}"',"test:agent-e2e-full":'mocha "agent/e2e/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:pkg-runtime":"tsx script/smokeCopilotRuntimePkg.ts","test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},EGo={"@azure/identity":"^4.13.2","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.8.0","@types/sinon":"^22.0.0","@types/toposort":"^2.0.7","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.22.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.2.0",esbuild:"^0.28.2","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.5","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.11.0","js-yaml":"^4.2.0",mocha:"^11.8.0","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^7.4.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.1.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.4",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},_Go={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.79","@github/copilot-sdk":"1.0.11","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/mxc-sdk":"0.7.0","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.4","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.6.0","@sinclair/typebox":"^0.34.52","@vscode/chat-lib":"0.60.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^15.0.0",minimatch:"^10.2.6",open:"^11.0.1",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",toposort:"^2.0.2",undici:"^7.29.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.3",yargs:"^18.1.0"},vGo={fsevents:"<0","@github/copilot-linuxmusl-arm64":"<0","@github/copilot-linuxmusl-x64":"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.21","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.5"},CGo={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.","@github/copilot-linuxmusl-arm64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.","@github/copilot-linuxmusl-x64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath), plus the 7.5.12..7.5.20 advisory run: GHSA-23hp-3jrh-7fpw / CVE-2026-59873 (critical, decompression DoS via unlimited input), GHSA-8x88-c5mf-7j5w / CVE-2026-59874 (infinite loop on negative entry size), GHSA-w8wr-v893-vjvp / CVE-2026-59871 (PAX numeric path type confusion), GHSA-gvwx-54wh-qm9j / CVE-2026-59875 (NUL byte in PAX path records), GHSA-vmf3-w455-68vh / CVE-2026-53655 (GNU long-name PAX size override file smuggling), GHSA-r292-9mhp-454m (uncontrolled recursion in mapHas/filesFilter). Pulled in by @yao-pkg/pkg (tar ^7.5.7) and node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.21. Dependabot alerts #170, #169, #179, #171, #168, #146. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133."},bGo={name:uGo,displayName:dGo,description:fGo,version:pGo,build:hGo,buildType:mGo,engines:gGo,anthropicClaude:AGo,scripts:yGo,devDependencies:EGo,dependencies:_Go,overrides:vGo,overridesComments:CGo};var $e={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",EnableQuotaThresholdWarning:"quota.enableThresholdWarning",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableOrgSkills:"agent.enableOrgSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxAuth:"agent.sandbox.auth",SandboxAllowDevToolAccess:"agent.sandbox.allowDevToolAccess",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseSessionModelForBuiltinSubagents:"agent.useSessionModelForBuiltinSubagents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",OtelEnabled:"agent.otel.enabled",OtelEndpoint:"agent.otel.otlpEndpoint",OtelCaptureContent:"agent.otel.captureContent",OtelExporterType:"agent.otel.exporterType",OtelProtocol:"agent.otel.protocol",OtelOutfile:"agent.otel.outfile",OtelServiceName:"agent.otel.serviceName",OtelResourceAttributes:"agent.otel.resourceAttributes",NESExtendedRange:"nextEditSuggestions.extendedRange",NESEagerness:"nextEditSuggestions.eagerness",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",NESModelConfiguration:"internal.nesModelConfiguration",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",EnableIntellijNes:"internal.enableIntellijNes",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",AuthTokenEncryption:"internal.auth.tokenEncryption",EnableWorkspaceIndex:"workspaceIndex.enabled"};function yyn(t){return["server","parsingandserver"].includes(t)}a(yyn,"shouldDoServerTrimming");var RD=class{static{a(this,"BlockModeConfig")}},nde=class extends RD{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(tr).overrideBlockMode(n);if(o)return MQt(o,r);let s=e.get(tr).enableProgressiveReveal(n);return(St(e,$e.AlwaysRequestMultiline)??s)||p5.isTrimmedByDefault(r)?MQt("moremultiline",r):r=="ruby"?"parsing":PI(r)?"parsingandserver":"server"}};function SGo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(SGo,"blockModeRequiresTreeSitter");function MQt(t,e){return t==="moremultiline"&&L0.isSupported(e)?t:SGo(t)&&!PI(e)?"server":t}a(MQt,"toApplicableBlockMode");var ro=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},ide=class extends ro{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return TGo(r)}getOptionalConfig(r){return IGo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},xJ=class extends ro{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new io;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new io;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=Zxe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[$e.ShowEditorCompletions,$e.EnableAutoCompletions,$e.DelayCompletions,$e.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Eyn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Eyn,"getConfigKeyRecursively");function TGo(t){if(wYe.has(t))return wYe.get(t);throw new Error(`Missing config default value: ${wMt}.${t}`)}a(TGo,"getConfigDefaultForKey");function IGo(t){return wYe.get(t)}a(IGo,"getOptionalConfigDefaultForKey");function eRe(t){return t.get(ro).getExplicitlySetConfigs()}a(eRe,"getExplicitlySetConfigs");var wGo={[$e.DebugOverrideCppHeadersEnableSwitch]:!1,[$e.RelatedFilesVSCodeCSharp]:!1,[$e.RelatedFilesVSCodeTypeScript]:!1,[$e.RelatedFilesVSCode]:!1,[$e.IncludeNeighboringFiles]:!1,[$e.ExcludeRelatedFiles]:!1,[$e.ContextProviders]:[],[$e.DebugUseEditorFetcher]:null,[$e.DebugUseElectronFetcher]:null,[$e.DebugOverrideLogLevels]:{},[$e.DebugSnippyOverrideUrl]:"",[$e.AgentDebugLogsDirectory]:void 0,[$e.ClaudeCliPath]:void 0,[$e.CodexCliPath]:void 0,[$e.OtelEnabled]:!1,[$e.OtelEndpoint]:void 0,[$e.OtelCaptureContent]:!1,[$e.OtelExporterType]:"otlp-http",[$e.OtelProtocol]:"",[$e.OtelOutfile]:"",[$e.OtelServiceName]:"",[$e.OtelResourceAttributes]:{},[$e.FetchStrategy]:"auto",[$e.ToolConfirmAutoApprove]:!1,[$e.AutoApproveUnmatchedTerminal]:void 0,[$e.AutoApproveUnmatchedFileOp]:void 0,[$e.TrustToolAnnotations]:!1,[$e.AutoApproveYoloMode]:!1,[$e.EditorHandlesAllConfirmation]:!1,[$e.MaxToolCallingLoop]:25,[$e.AutoCompress]:!1,[$e.AnthropicThinkingBudgetToken]:1024,[$e.EnableSkills]:!1,[$e.EnableOrgSkills]:!0,[$e.EnableHooks]:!1,[$e.EnableSandbox]:!1,[$e.SandboxAddCurrentWorkingDirectory]:void 0,[$e.SandboxAuth]:void 0,[$e.SandboxAllowDevToolAccess]:void 0,[$e.SandboxUserPolicy]:void 0,[$e.EnablePlugins]:!1,[$e.EnableCustomAgents]:!0,[$e.EnableOrgCustomAgents]:!0,[$e.UseSessionModelForBuiltinSubagents]:!1,[$e.UseAgentsMd]:!1,[$e.UseNestedAgentsMd]:!1,[$e.UseClaudeMd]:!1,[$e.UseNestedClaudeMd]:!1,[$e.UseSubsetMatching]:null,[$e.ContextProviderTimeBudget]:void 0,[$e.DebugOverrideCapiUrl]:"",[$e.DebugTestOverrideCapiUrl]:"",[$e.DebugOverrideProxyUrl]:"",[$e.DebugTestOverrideProxyUrl]:"",[$e.DebugOverrideEngine]:"",[$e.AlwaysRequestMultiline]:void 0,[$e.ModelAlwaysTerminatesSingleline]:void 0,[$e.TrimCompletionsAggressively]:void 0,[$e.CompletionsDebounce]:void 0,[$e.NESXTab]:void 0,[$e.UseWorkspaceContextCoordinator]:void 0,[$e.ShowWorkspaceContextDebugger]:!1,[$e.CompletionsDelay]:void 0,[$e.UseSplitContextPrompt]:void 0,[$e.UseCompletionsComparisonPanel]:void 0,[$e.ComparisonPanelModelIds]:void 0,[$e.ComparisonPanelRandomizedMode]:void 0,[$e.UseFetchFetcher]:void 0,[$e.UseChatLibCompletions]:void 0,[$e.TranscriptDirectory]:void 0,[$e.EnableThinking]:!0,[$e.ShowEditorCompletions]:void 0,[$e.EnableAutoCompletions]:void 0,[$e.DelayCompletions]:void 0,[$e.FilterCompletions]:void 0,[$e.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[$e.UserSelectedCompletionModel]:"",[$e.EnableQuotaThresholdWarning]:!0,[$e.DebugFilterLogCategories]:[],[$e.DebugOverrideEngineLegacy]:"",[$e.DebugTestOverrideProxyUrlLegacy]:"",[$e.DebugOverrideProxyUrlLegacy]:"",[$e.DebugTestOverrideCapiUrlLegacy]:"",[$e.DebugOverrideCapiUrlLegacy]:"",[$e.HookErrorOccurredStackTrace]:!1,[$e.NESUseExplicitRejection]:!1,[$e.NESModelConfiguration]:void 0,[$e.AppendPromptTokenCache]:"",[$e.PromptPersistBasePath]:void 0,[$e.AnthropicMessagesEndpoint]:"",[$e.EnableIntellijNes]:"",[$e.UseHelixFetcher]:"",[$e.EnableMapCodeFallback]:"enabled",[$e.SearchAgent]:"",[$e.PerfEnabled]:"",[$e.NESExtendedRange]:!1,[$e.NESEagerness]:"auto",[$e.AuthTokenEncryption]:"",[$e.EnableWorkspaceIndex]:!1},wYe=new Map(Object.entries(wGo));for(let t of Object.values($e))if(!wYe.has(t))throw new Error(`Missing config default value ${wMt}.${t}`);function St(t,e){return t.get(ro).getConfig(e)}a(St,"getConfig");function Ev(t){let e=St(t,$e.EnableWorkspaceIndex);return e===!0||e==="true"}a(Ev,"isSemanticSearchEnabled");function znn(t){return t.get(ro).dumpForTelemetry()}a(znn,"dumpForTelemetry");var Ts=class{constructor(){this.packageJson=Xxe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function OLt(t){return t.get(Ts).isProduction()}a(OLt,"isProduction");function eln(t){return t.get(Ts).getBuildType()==="dev"}a(eln,"isDevBuild");function nQ(t){return t.get(Ts).getBuildType()}a(nQ,"getBuildType");function Ynn(t){return t.get(Ts).getBuild()}a(Ynn,"getBuild");function VT(t){return t.get(Ts).getVersion()}a(VT,"getVersion");var Za=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function NT({name:t,version:e}){return`${t}/${e}`}a(NT,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return HWr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function Kze(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(Kze,"getIntegrationId");function vE(t){let e=t.get(Ir);return{"Editor-Version":NT(e.getEditorInfo()),"Editor-Plugin-Version":NT(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":VT(t)}}a(vE,"editorVersionHeaders");var _yn="Iv1.b507a08c87ecfe98",xGo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Vle="Ov23liV9UpD7Rnfnskm3",RGo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",PGo={[_yn]:xGo,[Vle]:RGo},yh=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??_yn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=PGo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};function vyn(t){return St(t,$e.AuthTokenEncryption)==="false"}a(vyn,"isAuthTokenEncryptionDisabled");p();var xyn=ue(require("node:crypto"));var Fq=new pe("KeytarMasterKey"),Syn="copilot-language-server",Tyn="oauth-token-key",Iyn=5e3,Ryn=32,OQt;function NGo(t){return OQt??=MGo(t).finally(()=>{OQt=void 0}),OQt}a(NGo,"resolveMasterKey");async function MGo(t){Fq.info(t,"keytar-master-key: resolving master key");let e;try{e=await BQt.loadKeytar(),Fq.info(t,"keytar-master-key: module loaded")}catch(n){return Fq.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:LQt("loadModule",n)}}let r;try{r=await LGo(t,e)}catch(n){return n instanceof xYe?(Fq.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:LQt("corruptExistingEntry",n)}):(Fq.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:LQt("getOrCreateMasterKey",n)})}return Fq.info(t,`keytar-master-key: resolved (source=${r.source})`),{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(MGo,"doResolveMasterKey");function OGo(){return Promise.resolve().then(()=>ue(byn()))}a(OGo,"loadKeytar");var BQt={resolveMasterKey:NGo,loadKeytar:OGo};async function LGo(t,e){let r=await wyn(e.getPassword(Syn,Tyn),Iyn,"getMasterKey");if(Fq.info(t,`keytar-master-key: getPassword returned (found=${r!=null})`),r){let o=BGo(r);if(o)return{key:o,source:"useExisting"};throw new xYe}let n=xyn.randomBytes(Ryn);return await wyn(e.setPassword(Syn,Tyn,n.toString("base64")),Iyn,"setMasterKey"),Fq.info(t,"keytar-master-key: setPassword (new key) completed"),{key:n,source:"createNew"}}a(LGo,"getOrCreateMasterKey");function wyn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(wyn,"withTimeout");var xYe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function LQt(t,e){return{available:!1,errorPhase:t,error:e}}a(LQt,"unavailable");function BGo(t){let e=Buffer.from(t,"base64");return e.length===Ryn?e:void 0}a(BGo,"decodeMasterKey");p();var ode=ue(require("node:crypto"));var FGo=0,QQt=1,RJ=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},PYe=class{static{a(this,"SecretCodec")}},UQt=class extends PYe{constructor(){super(...arguments);this.schemaVersion=FGo}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},RYe=12,FQt=16,Pyn=32,kYe=class extends PYe{constructor(r){super();this.key=r;this.schemaVersion=QQt;if(r.length!==Pyn)throw new Error(`AesGcmCodec requires a ${Pyn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=ode.randomBytes(RYe),o=ode.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length<RYe+FQt)throw new RJ("decode: v1 ciphertext too short","malformed");let o=n.subarray(0,RYe),s=n.subarray(n.length-FQt),c=n.subarray(RYe,n.length-FQt);try{let l=ode.createDecipheriv("aes-256-gcm",this.key,o);return l.setAuthTag(s),Buffer.concat([l.update(c),l.final()]).toString("utf8")}catch(l){throw new RJ("decode: AES-GCM verification failed","tagMismatch",{cause:l})}}},B3=class t{constructor(e){this.readers=new Map;this.writer=e,this.readers.set(e.schemaVersion,e)}static{a(this,"SecretStorage")}addReader(e){this.readers.set(e.schemaVersion,e)}setWriter(e){this.writer=e,this.readers.set(e.schemaVersion,e)}wrap(e){return{schemaVersion:this.writer.schemaVersion,ciphertext:this.writer.encode(e)}}unwrap(e){let r=this.readers.get(e.schemaVersion);if(!r)throw new RJ(`unwrap: unknown schemaVersion ${e.schemaVersion}`,"unknownVersion");return r.decode(e.ciphertext)}static plaintextOnly(){return new t(new UQt)}};p();p();function kyn(t){return{upsertToken:t.prepare(`
1948
+ ] @statement`}};var p5=class{constructor(e,r,n){this.languageId=e;this.prefix=r;this.completion=n}static{a(this,"BlockTrimmer")}static isSupported(e){return L0.isSupported(e)}static isTrimmedByDefault(e){return L0.isTrimmedByDefault(e)}async withParsedStatementTree(e){var n=[];try{let r=bMt(n,L0.create(this.languageId,this.prefix+this.completion,this.prefix.length,this.prefix.length+this.completion.length));await r.build();return await e(r)}catch(o){var s=o,c=!0}finally{SMt(n,s,c)}}trimmedCompletion(e){return e===void 0?this.completion:this.completion.substring(0,e)}getStatementAtCursor(e){return e.statementAt(Math.max(this.prefix.length-1,0))??e.statements[0]}getContainingBlockOffset(e){let r;if(e&&this.isCompoundStatement(e))r=e;else if(e){let n=e.parent;for(;n&&!this.isCompoundStatement(n);)n=n.parent;r=n}if(r){let n=this.asCompletionOffset(r.node.endIndex);if(n&&this.completion.substring(n).trim()!=="")return n}}hasNonStatementContentAfter(e){if(!e||!e.nextSibling)return!1;let r=this.asCompletionOffset(e.node.endIndex),n=this.asCompletionOffset(e.nextSibling.node.startIndex);return this.completion.substring(Math.max(0,r??0),Math.max(0,n??0)).trim()!==""}asCompletionOffset(e){return e===void 0?void 0:e-this.prefix.length}isCompoundStatement(e){return e.isCompoundStatementType||e.children.length>0}};var IYe=class extends p5{constructor(r,n,o,s=3,c=7){super(r,n,o);this.lineLimit=s;this.lookAhead=c;let l=[...this.completion.matchAll(/\n/g)],u=this.lineLimit+this.lookAhead;l.length>=this.lineLimit&&this.lineLimit>0&&(this.limitOffset=l[this.lineLimit-1].index),l.length>=u&&u>0&&(this.lookAheadOffset=l[u-1].index)}static{a(this,"TerseBlockTrimmer")}async getCompletionTrimOffset(){return await this.withParsedStatementTree(r=>{let n=r.statementAt(this.stmtStartPos()),o=this.getContainingBlockOffset(n);return o=this.trimAtFirstBlankLine(o),n&&(o=this.trimAtStatementChange(n,o)),this.limitOffset&&this.lookAheadOffset&&(o===void 0||o>this.lookAheadOffset)?this.limitOffset:o})}stmtStartPos(){let r=this.completion.match(/\S/);return r&&r.index!==void 0?this.prefix.length+r.index:Math.max(this.prefix.length-1,0)}trimAtFirstBlankLine(r){let n=[...this.trimmedCompletion(r).matchAll(/\r?\n\s*\r?\n/g)];for(;n.length>0&&(r===void 0||r>n[0].index);){let o=n.shift();if(this.completion.substring(0,o.index).trim()!=="")return o.index}return r}trimAtStatementChange(r,n){let o=this.prefix.length,s=this.prefix.length+(n??this.completion.length);if(r.node.endIndex>o&&this.isCompoundStatement(r))return r.nextSibling&&r.node.endIndex<s?this.asCompletionOffset(r.node.endIndex):n;let c=r,l=r.nextSibling;for(;l&&l.node.endIndex<=s&&!this.hasNonStatementContentAfter(c)&&!this.isCompoundStatement(l);)c=l,l=l.nextSibling;return l&&c.node.endIndex>o&&c.node.endIndex<s?this.asCompletionOffset(c.node.endIndex):n}};async function myn(t,e){var l=[];try{let r=t.getText();let n=t.offsetAt(e);let o=bMt(l,L0.create(t.detectedLanguageId,r,0,r.length));await o.build();let s=o.statementAt(n);if(!s)return"non-block";if(!s.isCompoundStatementType&&s.children.length===0)return s.parent&&!s.nextSibling&&s.node.endPosition.row<=e.line?"block-end":s.parent?"mid-block":"non-block";if(s.children.length===0)return"empty-block";let c=s.children[s.children.length-1];if(n<c.node.startIndex)return"mid-block";return"block-end"}catch(u){var d=u,f=!0}finally{SMt(l,d,f)}}a(myn,"getBlockPositionType");p();function aGo(t){return t.HTTPS_PROXY||t.https_proxy||t.HTTP_PROXY||t.http_proxy}a(aGo,"getProxyFromEnvironment");function cGo(t){return t.NODE_TLS_REJECT_UNAUTHORIZED!=="0"}a(cGo,"getRejectUnauthorizedFromEnvironment");var gyn=b.Object({proxy:b.Optional(b.String()),proxyStrictSSL:b.Optional(b.Boolean()),proxyAuthorization:b.Optional(b.String()),proxyKerberosServicePrincipal:b.Optional(b.String()),noProxy:b.Optional(b.Array(b.String()))});function Ayn(t){let e=aGo(t),r=Zxe({proxy:e,proxyStrictSSL:cGo(t)}),n=t.GH_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.GITHUB_COPILOT_KERBEROS_SERVICE_PRINCIPAL??t.AGENT_KERBEROS_SERVICE_PRINCIPAL;return n&&(r.proxyKerberosServicePrincipal=n),r}a(Ayn,"getHttpSettingsFromEnvironment");function Zxe(t){if(!t.proxy)return{...t,proxy:""};try{let{protocol:e,host:r,username:n,password:o,pathname:s,search:c,hash:l}=new URL(t.proxy);return{...t,proxy:`${e}//${r}${s}${c}${l}`,proxyAuthorization:t.proxyAuthorization||lGo(n,o),noProxy:t.noProxy||[]}}catch{return{...t,proxy:""}}}a(Zxe,"normalizeHttpSettings");function lGo(t,e){return!t||!e?"":`${decodeURIComponent(t)}:${decodeURIComponent(e)}`}a(lGo,"getAuth");var Xxe={};Fi(Xxe,{anthropicClaude:()=>AGo,build:()=>hGo,buildType:()=>mGo,default:()=>bGo,dependencies:()=>_Go,description:()=>fGo,devDependencies:()=>EGo,displayName:()=>dGo,engines:()=>gGo,name:()=>uGo,overrides:()=>vGo,overridesComments:()=>CGo,scripts:()=>yGo,version:()=>pGo});var uGo="copilot",dGo="GitHub Copilot",fGo="Your AI pair programmer",pGo="1.537.4",hGo="113",mGo="prod",gGo={node:">=22.13.0",npm:">=11.6.0 <12.0.0"},AGo={cliPackageVersion:"2.1.159"},yGo={build:"tsx esbuild.ts",clean:"./script/build/clean.sh",compress:"tsx ./script/compressTokenizer.ts",generate_languages:"tsx script/generateLanguages.ts && prettier --write lib/src/language/generatedLanguages.ts",get_token:"tsx script/deviceFlow.ts --save-as-test-token",lint:'run-p --aggregate-output "lint:*"',"lint:deps":"depcruise -c .dependency-cruiser.js .","lint:eslint":"eslint -f visualstudio --quiet --cache .","lint:gdpr":"tsx script/checkGdprComments.ts","lint:overrides":"tsx script/checkOverridesDocumented.ts","lint:prettier":"prettier --check . 2>&1","lint:types":"tsc --noEmit",inspect_auth_db:"tsx script/inspectAuthDb.ts",prebuild:"npm install",pretest:"npm run build","pretest:headless":"npm run build","pretest:agent-e2e-full":"npm run build","pretest:agent-e2e":"npm run build","pretest:lsp-client":"npm run build","pretest:lib-e2e":"npm run build",prewatch:"npm run build","prewatch:esbuild":"npm run build",start:"npm run watch",test:'npm-run-all "test:headless --ignore-scripts" lint',"test:headless":'npm-run-all test:lib test:agent "test:lib-e2e --ignore-scripts" test:prompt "test:lsp-client --ignore-scripts" lint',"test:agent":'mocha "agent/src/**/*.test.{ts,tsx}"',"test:agent-e2e":'mocha "agent/e2e/**/*.test.{ts,tsx}" --exclude "agent/e2e/**/*.daily.test.{ts,tsx}"',"test:agent-e2e-full":'mocha "agent/e2e/**/*.test.{ts,tsx}"',"test:lib":'mocha "lib/src/**/*.test.{ts,tsx}" "script/**/*.test.{ts,tsx}" --exclude "lib/src/**/*.int.test.ts"',"test:lib-int":'mocha "lib/src/**/*.int.test.ts"',"test:lib-e2e":'mocha "lib/e2e/src/**/*.test.{ts,tsx}" --exclude "lib/e2e/src/prompt/**/*.test.ts"',"test:lib-e2e-no-ci":'mocha "lib/e2e/no-ci/**/*.test.{ts,tsx}"',"test:lib-prompt-e2e":'mocha "lib/e2e/src/prompt/prompt.test.ts"',"test:lib-prompt-e2e-perf":"INCLUDE_PERFORMANCE=true npm run test:lib-prompt-e2e","test:lsp-client":'mocha "lsp-client/test/*.test.{ts,tsx}"',"test:pkg-runtime":"tsx script/smokeCopilotRuntimePkg.ts","test:prompt":'mocha "prompt/test/**/*.test.{ts,tsx}"',"test:prepare-msbench":"tsx script/setupMsbench.ts","test:run-msbench":"tsx lsp-client/test/msbench/agent/index.ts",watch:'run-p "watch:esbuild --ignore-scripts" "watch:types -- --preserveWatchOutput"',"watch:esbuild":"tsx esbuild.ts --watch","watch:types":"tsc --noEmit --watch"},EGo={"@azure/identity":"^4.13.2","@azure/keyvault-secrets":"^4.11.2","@github/prettier-config":"0.0.6","@limegrass/eslint-plugin-import-alias":"^1.6.1","@types/crypto-js":"^4.2.2","@types/diff":"^8.0.0","@types/git-url-parse":"^16.0.2","@types/js-yaml":"^4.0.6","@types/kerberos":"^1.1.2","@types/markdown-it":"^14.1.2","@types/mocha":"^10.0.10","@types/node":"~22.13.0","@types/semver":"^7.8.0","@types/sinon":"^22.0.0","@types/toposort":"^2.0.7","@types/vscode":"1.125.0","@types/which":"^3.0.0","@types/yargs":"^17.0.35","@vscode/tree-sitter-wasm":"0.0.5-php.2","@yao-pkg/pkg":"^6.22.0",boxen:"^8.0.1",chalk:"^5.6.2","dependency-cruiser":"^18.2.0",esbuild:"^0.28.2","esbuild-plugin-copy":"^2.1.1",eslint:"^9.39.5","eslint-formatter-visualstudio":"^9.0.1","eslint-plugin-mocha":"^10.5.0",globals:"^17.11.0","js-yaml":"^4.2.0",mocha:"^11.8.0","mocha-junit-reporter":"^2.2.1","mocha-multi-reporters":"^1.5.1","npm-run-all":"^4.1.5",openai:"^7.4.0",prettier:"^3.5.3","prettier-plugin-organize-imports":"^4.2.0","simple-git":"^3.36.0",sinon:"^22.1.0","tree-sitter-bash":"^0.23.0","tree-sitter-powershell":"0.25.9","ts-dedent":"^2.3.0",tsx:"^4.23.4",typescript:"^5.9.3","typescript-eslint":"^8.39.1","vscode-dts":"^0.3.3"},_Go={"@adobe/helix-fetch":"github:devm33/helix-fetch#2a08fa939591a0e14f34f611adcc3ed767579e9a","@agentclientprotocol/sdk":"^0.22.1","@anthropic-ai/claude-agent-sdk":"0.3.159","@anthropic-ai/sdk":"^0.98.0","@github/copilot":"1.0.79","@github/copilot-sdk":"1.0.11","@github/keytar":"7.10.6","@github/memoize":"1.1.5","@microsoft/1ds-core-js":"^4.3.10","@microsoft/1ds-post-js":"^4.3.10","@microsoft/applicationinsights-web-basic":"^3.3.11","@microsoft/mxc-sdk":"0.7.0","@modelcontextprotocol/sdk":"^1.29.0","@octokit/graphql":"^9.0.4","@octokit/rest":"^22.0.1","@parcel/watcher":"^2.6.0","@sinclair/typebox":"^0.34.52","@vscode/chat-lib":"0.60.0","@vscode/codicons":"^0.0.45","@vscode/deviceid":"github:ghc-jetbrains/vscode-deviceid#f0e5738cd362ef20a09aeb30c3a8be99a9a710f5","@vscode/policy-watcher":"^1.4.0","@vscode/prompt-tsx":"^0.4.0-alpha.9","@vscode/webview-ui-toolkit":"^1.3.1","crypto-js":"^4.2.0",diff:"^9.0.0",dldr:"^0.0.10",events:"^3.3.0","git-url-parse":"^16.1.0",glob:"^11.1.0","jsonc-parser":"^3.3.1",kerberos:"^2.2.0","mac-ca":"^3.1.3","markdown-it":"^15.0.0",minimatch:"^10.2.6",open:"^11.0.1",semver:"^7.8.5",shiki:"~1.15.0","source-map-support":"^0.5.21",toposort:"^2.0.2",undici:"^7.29.0",uuid:"^14.0.0","vscode-languageclient":"^9.0.0","vscode-languageserver":"^9.0.0","vscode-languageserver-protocol":"^3.17","vscode-languageserver-textdocument":"~1.0.11","vscode-uri":"^3.1.0","web-tree-sitter":"^0.23.0",which:"^7.0.0","windows-ca-certs":"^0.2.2",ws:"^8.21.3",yargs:"^18.1.0"},vGo={fsevents:"<0","@github/copilot-linuxmusl-arm64":"<0","@github/copilot-linuxmusl-x64":"<0",bindings:"npm:bundled-bindings@^1.5.0",jws:"^3.2.3",tar:"7.5.21","serialize-javascript":"^7.0.5",uuid:"^14.0.0","ip-address":"^10.1.1","fast-uri":"^3.1.5"},CGo={"//":"Rationale for each entry in `overrides`. Required by `npm run lint:overrides` (script/checkOverridesDocumented.ts). Each value should cover: why (CVE/GHSA or build-hack reason), which direct dep pulls in the vulnerable transitive, and the remove-when condition.",fsevents:"Build hack: macOS-only optional native dep; '<0' is an impossible semver that force-skips install on Linux/Windows pkg builds. Permanent \u2014 keep until @yao-pkg/pkg handles macOS-only optionalDependencies natively. See commit d635096c.","@github/copilot-linuxmusl-arm64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.","@github/copilot-linuxmusl-x64":"Build hack: @github/copilot declares a Linux musl optional runtime package, but CLS does not support musl. '<0' prevents npm from installing the unsupported runtime. Drop only if CLS adds musl support.",bindings:"Build hack: alias to bundled-bindings fork that resolves .node native addon paths after pkg/esbuild bundling. Required by kerberos. Drop when upstream `bindings` adopts platform-specific path resolution. See commits c4461665 and b55ece83.",jws:"CVE GHSA-869p-cjfg-cm3x (Improperly Verifies HMAC Signature). Pulled in by jsonwebtoken-family deps. Drop when all transitive consumers pin jws >= 3.2.3. See commit 2b5dc766.",tar:"CVE GHSA-9ppj-qmqm-q256 + GHSA-qffp-2rhf-9h96 (Symlink/Hardlink Path Traversal via Drive-Relative Linkpath), plus the 7.5.12..7.5.20 advisory run: GHSA-23hp-3jrh-7fpw / CVE-2026-59873 (critical, decompression DoS via unlimited input), GHSA-8x88-c5mf-7j5w / CVE-2026-59874 (infinite loop on negative entry size), GHSA-w8wr-v893-vjvp / CVE-2026-59871 (PAX numeric path type confusion), GHSA-gvwx-54wh-qm9j / CVE-2026-59875 (NUL byte in PAX path records), GHSA-vmf3-w455-68vh / CVE-2026-53655 (GNU long-name PAX size override file smuggling), GHSA-r292-9mhp-454m (uncontrolled recursion in mapHas/filesFilter). Pulled in by @yao-pkg/pkg (tar ^7.5.7) and node-gyp / native-build deps. Drop when transitive consumers bump tar >= 7.5.21. Dependabot alerts #170, #169, #179, #171, #168, #146. See commit e2dff0f3.","serialize-javascript":"CVE GHSA-5c6j-r48x-rmvq (RCE via RegExp.flags / Date.toISOString) + GHSA-qj8w-gfj5-8c6v (ReDoS). Pulled in by mocha 11.x (^6.0.2). Dev-only. Drop when mocha bumps to a release that carries serialize-javascript >= 7.0.3. See commit d49f75fd.",uuid:"CVE GHSA-w5hq-g745-h8pq (missing buffer bounds checks in v3/v5/v6). Pulled in by msal-node and @vscode/deviceid as uuid 8.x/9.x. Drop when both upgrade to uuid >= 14. Dependabot alert #128. See commit 6315f3f8.","ip-address":"CVE GHSA-v2v4-37r5-5v8g (XSS in Address6 HTML-emitting methods: group/link/spanAll and AddressError.parseMessage). Pulled in by @modelcontextprotocol/sdk -> express-rate-limit. Not exploitable here (we don't render HTML or call the affected methods), but the override clears the alert. Drop when express-rate-limit bumps to a release carrying ip-address >= 10.1.1. Dependabot alert #129. See PR #854.","fast-uri":"CVE-2026-6321 GHSA-q3j6-qgpj-74h6 (host confusion via percent-encoded authority delimiters) + CVE-2026-6322 GHSA-v39h-62p7-jpjc (path traversal via percent-encoded dot segments). Pulled in by @modelcontextprotocol/sdk -> ajv -> fast-uri. Drop when ajv bumps to a release carrying fast-uri >= 3.1.2. Dependabot alerts #132, #133."},bGo={name:uGo,displayName:dGo,description:fGo,version:pGo,build:hGo,buildType:mGo,engines:gGo,anthropicClaude:AGo,scripts:yGo,devDependencies:EGo,dependencies:_Go,overrides:vGo,overridesComments:CGo};var $e={Enable:"enable",UserSelectedCompletionModel:"selectedCompletionModel",EnableQuotaThresholdWarning:"quota.enableThresholdWarning",ShowEditorCompletions:"editor.showEditorCompletions",EnableAutoCompletions:"editor.enableAutoCompletions",DelayCompletions:"editor.delayCompletions",FilterCompletions:"editor.filterCompletions",FetchStrategy:"fetchStrategy",ToolConfirmAutoApprove:"agent.toolConfirmAutoApprove",AutoApproveUnmatchedTerminal:"agent.autoApproveUnmatchedTerminal",AutoApproveUnmatchedFileOp:"agent.autoApproveUnmatchedFileOp",TrustToolAnnotations:"agent.trustToolAnnotations",AutoApproveYoloMode:"agent.autoApproveYoloMode",EditorHandlesAllConfirmation:"agent.editorHandlesAllConfirmation",MaxToolCallingLoop:"agent.maxToolCallingLoop",AutoCompress:"agent.autoCompress",AnthropicThinkingBudgetToken:"agent.anthropicThinkingBudgetToken",EnableSkills:"agent.enableSkills",EnableOrgSkills:"agent.enableOrgSkills",EnableHooks:"agent.enableHooks",EnableSandbox:"agent.sandbox.enabled",SandboxAddCurrentWorkingDirectory:"agent.sandbox.addCurrentWorkingDirectory",SandboxAuth:"agent.sandbox.auth",SandboxAllowDevToolAccess:"agent.sandbox.allowDevToolAccess",SandboxUserPolicy:"agent.sandbox.userPolicy",EnablePlugins:"agent.enablePlugins",EnableCustomAgents:"agent.enableCustomAgents",EnableOrgCustomAgents:"agent.enableOrgCustomAgents",UseSessionModelForBuiltinSubagents:"agent.useSessionModelForBuiltinSubagents",UseAgentsMd:"agent.useAgentsMdFile",UseNestedAgentsMd:"agent.useNestedAgentsMdFiles",UseClaudeMd:"agent.useClaudeMdFile",UseNestedClaudeMd:"agent.useNestedClaudeMdFiles",CompletionsDelay:"completionsDelay",CompletionsDebounce:"completionsDebounce",EnableThinking:"agent.enableThinking",TranscriptDirectory:"agent.transcriptDirectory",AgentDebugLogsDirectory:"agent.agentDebugLogsDirectory",ClaudeCliPath:"agent.claude.cliPath",CodexCliPath:"agent.codex.cliPath",OtelEnabled:"agent.otel.enabled",OtelEndpoint:"agent.otel.otlpEndpoint",OtelCaptureContent:"agent.otel.captureContent",OtelExporterType:"agent.otel.exporterType",OtelProtocol:"agent.otel.protocol",OtelOutfile:"agent.otel.outfile",OtelServiceName:"agent.otel.serviceName",OtelResourceAttributes:"agent.otel.resourceAttributes",NESExtendedRange:"nextEditSuggestions.extendedRange",NESEagerness:"nextEditSuggestions.eagerness",RelatedFilesVSCodeCSharp:"advanced.relatedFilesVSCodeCSharp",RelatedFilesVSCodeTypeScript:"advanced.relatedFilesVSCodeTypeScript",RelatedFilesVSCode:"advanced.relatedFilesVSCode",ContextProviders:"advanced.contextProviders",DebugOverrideLogLevels:"advanced.debug.overrideLogLevels",DebugFilterLogCategories:"advanced.debug.filterLogCategories",DebugSnippyOverrideUrl:"advanced.debug.codeRefOverrideUrl",DebugUseElectronFetcher:"advanced.debug.useElectronFetcher",DebugUseEditorFetcher:"advanced.debug.useEditorFetcher",UseSubsetMatching:"advanced.useSubsetMatching",ContextProviderTimeBudget:"advanced.contextProviderTimeBudget",DebugOverrideCapiUrl:"internal.capiUrl",DebugOverrideCapiUrlLegacy:"advanced.debug.overrideCapiUrl",DebugTestOverrideCapiUrl:"internal.capiTestUrl",DebugTestOverrideCapiUrlLegacy:"advanced.debug.testOverrideCapiUrl",DebugOverrideProxyUrl:"internal.completionsUrl",DebugOverrideProxyUrlLegacy:"advanced.debug.overrideProxyUrl",DebugTestOverrideProxyUrl:"internal.completionsTestUrl",DebugTestOverrideProxyUrlLegacy:"advanced.debug.testOverrideProxyUrl",DebugOverrideEngine:"internal.completionModel",DebugOverrideEngineLegacy:"advanced.debug.overrideEngine",AlwaysRequestMultiline:"internal.alwaysRequestMultiline",ModelAlwaysTerminatesSingleline:"internal.modelAlwaysTerminatesSingleline",TrimCompletionsAggressively:"internal.trimCompletionsAggressively",UseWorkspaceContextCoordinator:"internal.useWorkspaceContextCoordinator",ShowWorkspaceContextDebugger:"internal.showWorkspaceContextDebugger",IncludeNeighboringFiles:"internal.includeNeighboringFiles",ExcludeRelatedFiles:"internal.excludeRelatedFiles",DebugOverrideCppHeadersEnableSwitch:"internal.cppHeadersEnableSwitch",NESXTab:"internal.useXTab",NESUseExplicitRejection:"internal.nesUseExplicitRejection",NESModelConfiguration:"internal.nesModelConfiguration",UseSplitContextPrompt:"internal.useSplitContextPrompt",UseCompletionsComparisonPanel:"internal.useCompletionsComparisonPanel",ComparisonPanelModelIds:"internal.comparisonPanelModelIds",ComparisonPanelRandomizedMode:"internal.comparisonPanelRandomizedMode",UseFetchFetcher:"internal.useFetchFetcher",UseChatLibCompletions:"internal.useChatLibCompletions",HookErrorOccurredStackTrace:"internal.hookErrorOccurredStackTrace",AppendPromptTokenCache:"internal.appendPromptTokenCache",PromptPersistBasePath:"internal.promptPersistBasePath",AnthropicMessagesEndpoint:"internal.anthropic.messagesEndpoint",EnableIntellijNes:"internal.enableIntellijNes",UseHelixFetcher:"internal.useHelixFetcher",EnableMapCodeFallback:"internal.enableMapCodeFallback",SearchAgent:"internal.searchAgent",PerfEnabled:"internal.perf.enabled",AuthTokenEncryption:"internal.auth.tokenEncryption",EnableWorkspaceIndex:"workspaceIndex.enabled"};function yyn(t){return["server","parsingandserver"].includes(t)}a(yyn,"shouldDoServerTrimming");var RD=class{static{a(this,"BlockModeConfig")}},nde=class extends RD{static{a(this,"ConfigBlockModeConfig")}forLanguage(e,r,n){let o=e.get(tr).overrideBlockMode(n);if(o)return MQt(o,r);let s=e.get(tr).enableProgressiveReveal(n);return(St(e,$e.AlwaysRequestMultiline)??s)||p5.isTrimmedByDefault(r)?MQt("moremultiline",r):r=="ruby"?"parsing":PI(r)?"parsingandserver":"server"}};function SGo(t){return["parsing","parsingandserver","moremultiline"].includes(t)}a(SGo,"blockModeRequiresTreeSitter");function MQt(t,e){return t==="moremultiline"&&L0.isSupported(e)?t:SGo(t)&&!PI(e)?"server":t}a(MQt,"toApplicableBlockMode");var ro=class{static{a(this,"ConfigProvider")}requireReady(){return Promise.resolve()}},ide=class extends ro{constructor(){super(...arguments);this.onDidChangeCopilotSettings=a(()=>({dispose:a(()=>{},"dispose")}),"onDidChangeCopilotSettings");this.onDidChangeHttpSettings=this.onDidChangeCopilotSettings}static{a(this,"DefaultsOnlyConfigProvider")}getConfig(r){return TGo(r)}getOptionalConfig(r){return IGo(r)}dumpForTelemetry(){return{}}getExplicitlySetConfigs(){return new Map}getHttpSettings(){return{proxy:""}}},xJ=class extends ro{constructor(r,n){super();this.baseConfigProvider=r;this.overrides=n;this.copilotEmitter=new io;this.onDidChangeCopilotSettings=this.copilotEmitter.event;this.didChangeHttpSettingsEmitter=new io;this.onDidChangeHttpSettings=this.didChangeHttpSettingsEmitter.event;this.httpSettings=this.baseConfigProvider.getHttpSettings()}static{a(this,"InMemoryConfigProvider")}getOptionalOverride(r){return this.overrides.get(r)}getConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getConfig(r)}getOptionalConfig(r){return this.getOptionalOverride(r)??this.baseConfigProvider.getOptionalConfig(r)}setConfig(r,n){this.setCopilotSettings({[r]:n})}setCopilotSettings(r){for(let[n,o]of Object.entries(r))o!==void 0?this.overrides.set(n,o):this.overrides.delete(n);this.copilotEmitter.fire(this)}getExplicitlySetConfigs(){let r=new Map(this.baseConfigProvider.getExplicitlySetConfigs());for(let[n,o]of this.overrides)r.set(n,o);return r}getHttpSettings(){return this.httpSettings}setHttpSettings(r){let n=Zxe(r);this.httpSettings=n,this.didChangeHttpSettingsEmitter.fire(this.getHttpSettings())}dumpForTelemetry(){let r=this.baseConfigProvider.dumpForTelemetry();for(let n of[$e.ShowEditorCompletions,$e.EnableAutoCompletions,$e.DelayCompletions,$e.FilterCompletions]){let o=this.overrides.get(n);o!==void 0&&(r[n]=JSON.stringify(o))}return r}};function Eyn(t,e){let r=t,n=[];for(let o of e.split(".")){let s=[...n,o].join(".");r&&typeof r=="object"&&s in r?(r=r[s],n.length=0):n.push(o)}if(!(r===void 0||n.length>0))return r}a(Eyn,"getConfigKeyRecursively");function TGo(t){if(wYe.has(t))return wYe.get(t);throw new Error(`Missing config default value: ${wMt}.${t}`)}a(TGo,"getConfigDefaultForKey");function IGo(t){return wYe.get(t)}a(IGo,"getOptionalConfigDefaultForKey");function eRe(t){return t.get(ro).getExplicitlySetConfigs()}a(eRe,"getExplicitlySetConfigs");var wGo={[$e.DebugOverrideCppHeadersEnableSwitch]:!1,[$e.RelatedFilesVSCodeCSharp]:!1,[$e.RelatedFilesVSCodeTypeScript]:!1,[$e.RelatedFilesVSCode]:!1,[$e.IncludeNeighboringFiles]:!1,[$e.ExcludeRelatedFiles]:!1,[$e.ContextProviders]:[],[$e.DebugUseEditorFetcher]:null,[$e.DebugUseElectronFetcher]:null,[$e.DebugOverrideLogLevels]:{},[$e.DebugSnippyOverrideUrl]:"",[$e.AgentDebugLogsDirectory]:void 0,[$e.ClaudeCliPath]:void 0,[$e.CodexCliPath]:void 0,[$e.OtelEnabled]:!1,[$e.OtelEndpoint]:void 0,[$e.OtelCaptureContent]:!1,[$e.OtelExporterType]:"otlp-http",[$e.OtelProtocol]:"",[$e.OtelOutfile]:"",[$e.OtelServiceName]:"",[$e.OtelResourceAttributes]:{},[$e.FetchStrategy]:"auto",[$e.ToolConfirmAutoApprove]:!1,[$e.AutoApproveUnmatchedTerminal]:void 0,[$e.AutoApproveUnmatchedFileOp]:void 0,[$e.TrustToolAnnotations]:!1,[$e.AutoApproveYoloMode]:!1,[$e.EditorHandlesAllConfirmation]:!1,[$e.MaxToolCallingLoop]:25,[$e.AutoCompress]:!1,[$e.AnthropicThinkingBudgetToken]:1024,[$e.EnableSkills]:!1,[$e.EnableOrgSkills]:!0,[$e.EnableHooks]:!1,[$e.EnableSandbox]:!1,[$e.SandboxAddCurrentWorkingDirectory]:void 0,[$e.SandboxAuth]:void 0,[$e.SandboxAllowDevToolAccess]:void 0,[$e.SandboxUserPolicy]:void 0,[$e.EnablePlugins]:!1,[$e.EnableCustomAgents]:!0,[$e.EnableOrgCustomAgents]:!0,[$e.UseSessionModelForBuiltinSubagents]:!1,[$e.UseAgentsMd]:!1,[$e.UseNestedAgentsMd]:!1,[$e.UseClaudeMd]:!1,[$e.UseNestedClaudeMd]:!1,[$e.UseSubsetMatching]:null,[$e.ContextProviderTimeBudget]:void 0,[$e.DebugOverrideCapiUrl]:"",[$e.DebugTestOverrideCapiUrl]:"",[$e.DebugOverrideProxyUrl]:"",[$e.DebugTestOverrideProxyUrl]:"",[$e.DebugOverrideEngine]:"",[$e.AlwaysRequestMultiline]:void 0,[$e.ModelAlwaysTerminatesSingleline]:void 0,[$e.TrimCompletionsAggressively]:void 0,[$e.CompletionsDebounce]:void 0,[$e.NESXTab]:void 0,[$e.UseWorkspaceContextCoordinator]:void 0,[$e.ShowWorkspaceContextDebugger]:!1,[$e.CompletionsDelay]:void 0,[$e.UseSplitContextPrompt]:void 0,[$e.UseCompletionsComparisonPanel]:void 0,[$e.ComparisonPanelModelIds]:void 0,[$e.ComparisonPanelRandomizedMode]:void 0,[$e.UseFetchFetcher]:void 0,[$e.UseChatLibCompletions]:void 0,[$e.TranscriptDirectory]:void 0,[$e.EnableThinking]:!0,[$e.ShowEditorCompletions]:void 0,[$e.EnableAutoCompletions]:void 0,[$e.DelayCompletions]:void 0,[$e.FilterCompletions]:void 0,[$e.Enable]:{"*":!0,plaintext:!1,markdown:!1,scminput:!1},[$e.UserSelectedCompletionModel]:"",[$e.EnableQuotaThresholdWarning]:!0,[$e.DebugFilterLogCategories]:[],[$e.DebugOverrideEngineLegacy]:"",[$e.DebugTestOverrideProxyUrlLegacy]:"",[$e.DebugOverrideProxyUrlLegacy]:"",[$e.DebugTestOverrideCapiUrlLegacy]:"",[$e.DebugOverrideCapiUrlLegacy]:"",[$e.HookErrorOccurredStackTrace]:!1,[$e.NESUseExplicitRejection]:!1,[$e.NESModelConfiguration]:void 0,[$e.AppendPromptTokenCache]:"",[$e.PromptPersistBasePath]:void 0,[$e.AnthropicMessagesEndpoint]:"",[$e.EnableIntellijNes]:"",[$e.UseHelixFetcher]:"",[$e.EnableMapCodeFallback]:"enabled",[$e.SearchAgent]:"",[$e.PerfEnabled]:"",[$e.NESExtendedRange]:!1,[$e.NESEagerness]:"auto",[$e.AuthTokenEncryption]:"",[$e.EnableWorkspaceIndex]:!1},wYe=new Map(Object.entries(wGo));for(let t of Object.values($e))if(!wYe.has(t))throw new Error(`Missing config default value ${wMt}.${t}`);function St(t,e){return t.get(ro).getConfig(e)}a(St,"getConfig");function Ev(t){let e=St(t,$e.EnableWorkspaceIndex);return e===!0||e==="true"}a(Ev,"isSemanticSearchEnabled");function znn(t){return t.get(ro).dumpForTelemetry()}a(znn,"dumpForTelemetry");var Ts=class{constructor(){this.packageJson=Xxe}static{a(this,"BuildInfo")}isProduction(){return this.getBuildType()!=="dev"}getBuildType(){return this.packageJson.buildType}getVersion(){return this.packageJson.version}getDisplayVersion(){return this.getBuildType()==="dev"?`${this.getVersion()}-dev`:this.getVersion()}getBuild(){return this.packageJson.build}getName(){return this.packageJson.name}};function OLt(t){return t.get(Ts).isProduction()}a(OLt,"isProduction");function eln(t){return t.get(Ts).getBuildType()==="dev"}a(eln,"isDevBuild");function nQ(t){return t.get(Ts).getBuildType()}a(nQ,"getBuildType");function Ynn(t){return t.get(Ts).getBuild()}a(Ynn,"getBuild");function VT(t){return t.get(Ts).getVersion()}a(VT,"getVersion");var Za=class{constructor(e,r,n,o="none",s="desktop"){this.sessionId=e;this.machineId=r;this.devDeviceId=n;this.remoteName=o;this.uiKind=s}static{a(this,"EditorSession")}};function NT({name:t,version:e}){return`${t}/${e}`}a(NT,"formatNameAndVersion");var Ir=class{static{a(this,"EditorAndPluginInfo")}getCopilotIntegrationId(){}getEditorPluginSpecificFilters(){return[]}getEditorIdentity(){return HWr({editor:this.getEditorInfo(),plugin:this.getEditorPluginInfo()})}isEditorPluginInfoKnown(){return!0}};function Kze(t){let e=t.getCopilotIntegrationId();if(e)return e;switch(t.getEditorPluginInfo().name){case"copilot-intellij":return"jetbrains-chat";case"copilot":case"copilot-vs":return;default:return"jetbrains-chat"}}a(Kze,"getIntegrationId");function vE(t){let e=t.get(Ir);return{"Editor-Version":NT(e.getEditorInfo()),"Editor-Plugin-Version":NT(e.getEditorPluginInfo()),"Copilot-Language-Server-Version":VT(t)}}a(vE,"editorVersionHeaders");var _yn="Iv1.b507a08c87ecfe98",xGo="350ee525b5da0e4a54c6e8e043edc1b99cc02f19",Vle="Ov23liV9UpD7Rnfnskm3",RGo="5509a52e4c525cd594a6fba9147ff6cc2388dd9f",PGo={[_yn]:xGo,[Vle]:RGo},yh=class{static{a(this,"GitHubAppInfo")}findAppIdToAuthenticate(){return this.githubAppId??_yn}findAppSecretToAuthenticate(){let e=this.findAppIdToAuthenticate(),r=PGo[e];if(!r)throw new Error(`GitHubAppInfo: No app secret found for app ID: ${e}`);return r}};function vyn(t){return St(t,$e.AuthTokenEncryption)==="false"}a(vyn,"isAuthTokenEncryptionDisabled");p();var xyn=ue(require("node:crypto"));var Fq=new pe("KeytarMasterKey"),Syn="copilot-language-server",Tyn="oauth-token-key",Iyn=5e3,Ryn=32,OQt;function NGo(t){return OQt??=MGo(t).finally(()=>{OQt=void 0}),OQt}a(NGo,"resolveMasterKey");async function MGo(t){Fq.info(t,"keytar-master-key: resolving master key");let e;try{e=await BQt.loadKeytar(),Fq.info(t,"keytar-master-key: module loaded")}catch(n){return Fq.warn(t,"keytar-master-key: @github/keytar failed to load",n),{diagnostics:LQt("loadModule",n)}}let r;try{r=await LGo(t,e)}catch(n){return n instanceof xYe?(Fq.error(t,"keytar-master-key: existing entry is corrupt; refusing to overwrite",n),{diagnostics:LQt("corruptExistingEntry",n)}):(Fq.warn(t,"keytar-master-key: master-key resolution failed",n),{diagnostics:LQt("getOrCreateMasterKey",n)})}return Fq.info(t,`keytar-master-key: resolved (source=${r.source})`),{masterKey:r.key,diagnostics:{available:!0,masterKeySource:r.source}}}a(MGo,"doResolveMasterKey");function OGo(){return Promise.resolve().then(()=>ue(byn()))}a(OGo,"loadKeytar");var BQt={resolveMasterKey:NGo,loadKeytar:OGo};async function LGo(t,e){let r=await wyn(e.getPassword(Syn,Tyn),Iyn,"getMasterKey");if(Fq.info(t,`keytar-master-key: getPassword returned (found=${r!=null})`),r){let o=BGo(r);if(o)return{key:o,source:"useExisting"};throw new xYe}let n=xyn.randomBytes(Ryn);return await wyn(e.setPassword(Syn,Tyn,n.toString("base64")),Iyn,"setMasterKey"),Fq.info(t,"keytar-master-key: setPassword (new key) completed"),{key:n,source:"createNew"}}a(LGo,"getOrCreateMasterKey");function wyn(t,e,r){return new Promise((n,o)=>{let s=setTimeout(()=>o(new Error(`${r}: timeout after ${e}ms`)),e);s.unref?.(),t.then(c=>{clearTimeout(s),n(c)},c=>{clearTimeout(s),o(c instanceof Error?c:new Error(`${r}: ${String(c)}`))})})}a(wyn,"withTimeout");var xYe=class extends Error{static{a(this,"CorruptMasterKeyError")}constructor(){super("keytar master-key entry present but undecodable"),this.name="CorruptMasterKeyError"}};function LQt(t,e){return{available:!1,errorPhase:t,error:e}}a(LQt,"unavailable");function BGo(t){let e=Buffer.from(t,"base64");return e.length===Ryn?e:void 0}a(BGo,"decodeMasterKey");p();var ode=ue(require("node:crypto"));var FGo=0,QQt=1,RJ=class extends Error{constructor(r,n,o){super(r,o?.cause!==void 0?{cause:o.cause}:void 0);this.kind=n;this.name="SecretUnwrapError"}static{a(this,"SecretUnwrapError")}},PYe=class{static{a(this,"SecretCodec")}},UQt=class extends PYe{constructor(){super(...arguments);this.schemaVersion=FGo}static{a(this,"PlaintextCodec")}encode(r){return Buffer.from(r,"utf8")}decode(r){return Buffer.from(r).toString("utf8")}},RYe=12,FQt=16,Pyn=32,kYe=class extends PYe{constructor(r){super();this.key=r;this.schemaVersion=QQt;if(r.length!==Pyn)throw new Error(`AesGcmCodec requires a ${Pyn}-byte key, got ${r.length}`)}static{a(this,"AesGcmCodec")}encode(r){let n=ode.randomBytes(RYe),o=ode.createCipheriv("aes-256-gcm",this.key,n),s=Buffer.concat([o.update(Buffer.from(r,"utf8")),o.final()]);return Buffer.concat([n,s,o.getAuthTag()])}decode(r){let n=Buffer.from(r);if(n.length<RYe+FQt)throw new RJ("decode: v1 ciphertext too short","malformed");let o=n.subarray(0,RYe),s=n.subarray(n.length-FQt),c=n.subarray(RYe,n.length-FQt);try{let l=ode.createDecipheriv("aes-256-gcm",this.key,o);return l.setAuthTag(s),Buffer.concat([l.update(c),l.final()]).toString("utf8")}catch(l){throw new RJ("decode: AES-GCM verification failed","tagMismatch",{cause:l})}}},B3=class t{constructor(e){this.readers=new Map;this.writer=e,this.readers.set(e.schemaVersion,e)}static{a(this,"SecretStorage")}addReader(e){this.readers.set(e.schemaVersion,e)}setWriter(e){this.writer=e,this.readers.set(e.schemaVersion,e)}wrap(e){return{schemaVersion:this.writer.schemaVersion,ciphertext:this.writer.encode(e)}}unwrap(e){let r=this.readers.get(e.schemaVersion);if(!r)throw new RJ(`unwrap: unknown schemaVersion ${e.schemaVersion}`,"unknownVersion");return r.decode(e.ciphertext)}static plaintextOnly(){return new t(new UQt)}};p();p();function kyn(t){return{upsertToken:t.prepare(`
1949
1949
  INSERT INTO oauth_tokens (
1950
1950
  auth_authority, oauth_client_id, user_login, scopes,
1951
1951
  token_ciphertext, token_schema_version, source_editor_id,
@@ -4006,7 +4006,7 @@ ${d.toFixed(2)} ${u}`).join("")??"";return Xpt.debug(t,`ghostText produced from
4006
4006
  }
4007
4007
  }
4008
4008
  }
4009
- `,{ids:l});for(let f of d.nodes)!f||typeof f.number!="number"||!f.id||r.set(f.id,this.toPullRequestItem(f))}return r}catch(c){if(tCe.error(this.ctx,"Failed to fetch pull requests by global ids:",c),c&&typeof c=="object"&&"status"in c){let l=c;throw new Ed(l.status,l.message||"GitHub GraphQL API failed")}throw c}}toPullRequestItem(e){return{id:e.fullDatabaseId,number:e.number,title:e.title,user:e.author,html_url:e.url,draft:e.isDraft,body:e.body,updated_at:e.updatedAt,repository:e.repository}}async getApiSession(){let e=await this.ctx.get(Lr).resolveSession();if(!e)throw new GE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var sZi=require("crypto");No();var yT=new pe("CloudAgent"),ET="CloudAgentService";function c9c(){return{id:"cloud-agent-auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(c9c,"buildCloudAutoModel");var Joe=class{constructor(e){this.ctx=e;this._sessions=new Map;this._pullRequestSessionId=new Map;this.notificationSender=e.get(hs),this.client=new Nb(e)}static{a(this,"CloudAgentService")}async createSession(e){return Bh(this.ctx,"cloudAgent.createSession",async r=>{let n=e.sessionId??kt(),o=this._sessions.has(n),s=await this.getOrCreateSession(n,e.workspaceFolder);return r.properties.reason=o?"cached":"created",{sessionId:n,workspacePath:s.cwd}})}async resumeSession(e){return Bh(this.ctx,"cloudAgent.resumeSession",async r=>{r.measurements.eventCount=0;let n=this.findReusableSession(e.sessionId);r.properties.reason=n?"cached":"resolved",r.properties.hasPullRequest="false";let o=n??await this.createAndCacheSession(e.sessionId,e.workspaceFolder),s=o.localSessionId;if(r.properties.hasPullRequest=String(!!o.pullRequest),!o.pullRequest)return{sessionId:s,workspacePath:o.cwd,events:[]};let{events:c,streamStatus:l}=await this.loadSessionHistory(o.pullRequest,o.idSource);if(l&&(r.properties.streamState=l.state),r.measurements.eventCount=c.length,l&&(l.state==="in_progress"||l.state==="queued")){let{stream:u}=o.resumeStreaming(l),d=performance.now();u.catch(f=>{yT.warn(this.ctx,`${ET}.resumeSession: stream failed`,{sessionId:s,error:f instanceof Error?f.message:String(f)}),up(this.ctx,"cloudAgent.resumeSession.failure",f,{success:"false",reason:"stream",hasPullRequest:"true",streamState:l.state},{totalTimeMs:performance.now()-d,eventCount:c.length})})}return yT.info(this.ctx,`${ET}.resumeSession`,{sessionId:s,pullRequestNumber:o.pullRequest.number,events:c.length}),{sessionId:s,workspacePath:o.cwd,events:c,status:l?.state}})}async sendMessage(e,r){return Bh(this.ctx,"cloudAgent.sendMessage",async n=>{n.measurements.messageCharLen=e.message.length;let o=this._sessions.get(e.sessionId);if(!o)throw n.properties.reason="unknownSession",new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`);let s=kt(),c=o.hasPullRequest;n.properties.reason=c?"followUp":"initial";let{stream:l}=c?await o.submitFollowUp(e.message):await o.startInitialJob(e.message);o.pullRequest&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(o.pullRequest),o.localSessionId);let u=performance.now();return l.catch(d=>{yT.warn(this.ctx,`${ET}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:c,error:d instanceof Error?d.message:String(d)}),up(this.ctx,"cloudAgent.sendMessage.failure",d,{success:"false",reason:"stream"},{totalTimeMs:performance.now()-u,messageCharLen:e.message.length})}),{messageId:s}})}async stopSession(e){await Bh(this.ctx,"cloudAgent.stopSession",r=>{let n=this._sessions.get(e);if(!n){yT.warn(this.ctx,`${ET}.stopSession: unknown session`,{sessionId:e}),r.ok=!1,r.properties.reason="unknownSession";return}n.stopByUser(),r.properties.reason="stopped",yT.info(this.ctx,`${ET}.stopSession`,{sessionId:e})})}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}async listSessions(e){return Bh(this.ctx,"cloudAgent.listSessions",async r=>{r.measurements.cloudSessionCount=0;let n=e?.cwd;if(!n)return yT.warn(this.ctx,`${ET}.listSessions: missing cwd in params`),r.ok=!1,r.properties.reason="missingCwd",r.measurements.count=0,{sessions:[]};try{let o=await this.ctx.get(Qf).getRepo({uri:this.toWorkspaceUri(n)});if(!o||!o.isGitHub()||!o.owner||!o.name)return yT.warn(this.ctx,`${ET}.listSessions: workspace is not a GitHub repo`),r.ok=!1,r.properties.reason="notGitHubRepo",r.measurements.count=0,{sessions:[]};let s=`${o.owner}/${o.name}`,c=await this.client.getRepoSessions(s);r.measurements.cloudSessionCount=c.length;let l=new Map;for(let h of c){let m=l.get(h.resource_id);(!m||new Date(h.created_at).getTime()>new Date(m.created_at).getTime())&&l.set(h.resource_id,h)}let u=Array.from(new Set(Array.from(l.values()).map(h=>h.resource_global_id).filter(h=>!!h))),d=await new rCe(this.ctx).getPullRequestsFromGlobalIds(u),f=[];for(let h of l.values()){if(!h.resource_global_id){yT.warn(this.ctx,`${ET}.listSessions: session has no resource_global_id`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let m=d.get(h.resource_global_id);if(!m){yT.warn(this.ctx,`${ET}.listSessions: pull request not found`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let g=this.ensurePullRequestSession(m,n);f.push({sessionId:g,summary:m.title,startTime:this.toIsoString(h.created_at),modifiedTime:this.toIsoString(h.last_updated_at),status:h.state,isRemote:!1})}return yT.info(this.ctx,`${ET}.listSessions: success`,{nwo:s,count:f.length}),r.properties.reason="listed",r.measurements.count=f.length,{sessions:f}}catch(o){return yT.warn(this.ctx,`${ET}.listSessions: failed`,{error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",r.measurements.count=0,{sessions:[]}}})}listModels(e){return Bh(this.ctx,"cloudAgent.listModels",r=>{let n=[c9c()];return r.measurements.count=n.length,{models:n}})}toWorkspaceUri(e){return/^[A-Za-z][A-Za-z0-9+.-]+:/.test(e)?e:Oo(e)}createCloudSession(e,r,n){return new sxt(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}ensurePullRequestSession(e,r){let n=this.sessionIdForPullRequest(e),o=this.cachedSessionForCanonicalId(n);if(o)return o.updatePullRequest(e),o.localSessionId;let s=this.createCloudSession(n,{uri:r},e);return this._sessions.set(n,s),this._pullRequestSessionId.set(n,n),n}cachedSessionForCanonicalId(e){let r=this._pullRequestSessionId.get(e)??e;return this._sessions.get(r)}findReusableSession(e){let r=this._sessions.get(e);if(r)return r;let n=x6r(e);if(n)return this.cachedSessionForCanonicalId(w6r(n.owner,n.repo,n.pullRequestNumber))}sessionIdForPullRequest(e){return w6r(e.repository.owner.login,e.repository.name,e.number)}async getOrCreateSession(e,r){return this._sessions.get(e)??await this.createAndCacheSession(e,r)}async createAndCacheSession(e,r){let n=await this.resolvePullRequest(e),o=this.createCloudSession(e,r,n);return this._sessions.set(e,o),n&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n),e),o}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):yT.warn(this.ctx,`${ET}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(I6r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){yT.warn(this.ctx,`${ET}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...nxt(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,sZi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}toIsoString(e){let r=new Date(e);return isNaN(r.getTime())?new Date().toISOString():r.toISOString()}async resolvePullRequest(e){let r=x6r(e);if(r)try{return await new Rm(this.ctx).getPullRequest(r.owner,r.repo,r.pullRequestNumber)}catch(n){yT.warn(this.ctx,`${ET}.resolvePullRequest: failed`,{sessionId:e,error:n instanceof Error?n.message:String(n)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}previewRewind(e){return Promise.reject(this.unsupported("previewRewind"))}rewindHistory(e){return Promise.reject(this.unsupported("rewindHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var aZi=require("node:child_process"),cZi=require("node:events"),R6r=ue(require("node:readline"));var Ew=new pe("CodexProcessManager"),axt=class extends cZi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.serverRequestHandlers=new Map;this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'sandbox_permissions=["disk-full-read-access","disk-write-cwd","disk-write-platform-user-temp","network-full-access"]',"-c","features.default_mode_request_user_input = true"];Ew.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,aZi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),Ew.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw Ew.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{Ew.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{Ew.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=R6r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&R6r.default.createInterface({input:this.process.stderr}).on("line",s=>{Ew.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+`
4009
+ `,{ids:l});for(let f of d.nodes)!f||typeof f.number!="number"||!f.id||r.set(f.id,this.toPullRequestItem(f))}return r}catch(c){if(tCe.error(this.ctx,"Failed to fetch pull requests by global ids:",c),c&&typeof c=="object"&&"status"in c){let l=c;throw new Ed(l.status,l.message||"GitHub GraphQL API failed")}throw c}}toPullRequestItem(e){return{id:e.fullDatabaseId,number:e.number,title:e.title,user:e.author,html_url:e.url,draft:e.isDraft,body:e.body,updated_at:e.updatedAt,repository:e.repository}}async getApiSession(){let e=await this.ctx.get(Lr).resolveSession();if(!e)throw new GE;return{apiUrl:e.apiUrl.replace(/\/$/,""),accessToken:e.accessToken}}};var sZi=require("crypto");No();var yT=new pe("CloudAgent"),ET="CloudAgentService";function c9c(){return{id:"cloud-agent-auto",name:"Auto",preview:!1,capabilities:{family:"auto",supports:{vision:!0},limits:{max_context_window_tokens:0}}}}a(c9c,"buildCloudAutoModel");var Joe=class{constructor(e){this.ctx=e;this._sessions=new Map;this._pullRequestSessionId=new Map;this.notificationSender=e.get(hs),this.client=new Nb(e)}static{a(this,"CloudAgentService")}async createSession(e){return Bh(this.ctx,"cloudAgent.createSession",async r=>{let n=e.sessionId??kt(),o=this._sessions.has(n),s=await this.getOrCreateSession(n,e.workspaceFolder);return r.properties.reason=o?"cached":"created",{sessionId:n,workspacePath:s.cwd}})}async resumeSession(e){return Bh(this.ctx,"cloudAgent.resumeSession",async r=>{r.measurements.eventCount=0;let n=this.findReusableSession(e.sessionId);r.properties.reason=n?"cached":"resolved",r.properties.hasPullRequest="false";let o=n??await this.createAndCacheSession(e.sessionId,e.workspaceFolder),s=o.localSessionId;if(r.properties.hasPullRequest=String(!!o.pullRequest),!o.pullRequest)return{sessionId:s,workspacePath:o.cwd,events:[]};let{events:c,streamStatus:l}=await this.loadSessionHistory(o.pullRequest,o.idSource);if(l&&(r.properties.streamState=l.state),r.measurements.eventCount=c.length,l&&(l.state==="in_progress"||l.state==="queued")){let{stream:u}=o.resumeStreaming(l),d=performance.now();u.catch(f=>{yT.warn(this.ctx,`${ET}.resumeSession: stream failed`,{sessionId:s,error:f instanceof Error?f.message:String(f)}),up(this.ctx,"cloudAgent.resumeSession.failure",f,{success:"false",reason:"stream",hasPullRequest:"true",streamState:l.state},{totalTimeMs:performance.now()-d,eventCount:c.length})})}return yT.info(this.ctx,`${ET}.resumeSession`,{sessionId:s,pullRequestNumber:o.pullRequest.number,events:c.length}),{sessionId:s,workspacePath:o.cwd,events:c,status:l?.state}})}async sendMessage(e,r){return Bh(this.ctx,"cloudAgent.sendMessage",async n=>{n.measurements.messageCharLen=e.message.length;let o=this._sessions.get(e.sessionId);if(!o)throw n.properties.reason="unknownSession",new Error(`Cannot start cloud session ${e.sessionId}: session was not created or resumed first.`);let s=kt(),c=o.hasPullRequest;n.properties.reason=c?"followUp":"initial";let{stream:l}=c?await o.submitFollowUp(e.message):await o.startInitialJob(e.message);o.pullRequest&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(o.pullRequest),o.localSessionId);let u=performance.now();return l.catch(d=>{yT.warn(this.ctx,`${ET}.sendMessage: turn failed`,{sessionId:e.sessionId,isFollowUp:c,error:d instanceof Error?d.message:String(d)}),up(this.ctx,"cloudAgent.sendMessage.failure",d,{success:"false",reason:"stream"},{totalTimeMs:performance.now()-u,messageCharLen:e.message.length})}),{messageId:s}})}async stopSession(e){await Bh(this.ctx,"cloudAgent.stopSession",r=>{let n=this._sessions.get(e);if(!n){yT.warn(this.ctx,`${ET}.stopSession: unknown session`,{sessionId:e}),r.ok=!1,r.properties.reason="unknownSession";return}n.stopByUser(),r.properties.reason="stopped",yT.info(this.ctx,`${ET}.stopSession`,{sessionId:e})})}destroySession(e){return Promise.reject(this.unsupported("destroySession"))}async listSessions(e){return Bh(this.ctx,"cloudAgent.listSessions",async r=>{r.measurements.cloudSessionCount=0;let n=e?.cwd;if(!n)return yT.warn(this.ctx,`${ET}.listSessions: missing cwd in params`),r.ok=!1,r.properties.reason="missingCwd",r.measurements.count=0,{sessions:[]};try{let o=await this.ctx.get(Qf).getRepo({uri:this.toWorkspaceUri(n)});if(!o||!o.isGitHub()||!o.owner||!o.name)return yT.warn(this.ctx,`${ET}.listSessions: workspace is not a GitHub repo`),r.ok=!1,r.properties.reason="notGitHubRepo",r.measurements.count=0,{sessions:[]};let s=`${o.owner}/${o.name}`,c=await this.client.getRepoSessions(s);r.measurements.cloudSessionCount=c.length;let l=new Map;for(let h of c){let m=l.get(h.resource_id);(!m||new Date(h.created_at).getTime()>new Date(m.created_at).getTime())&&l.set(h.resource_id,h)}let u=Array.from(new Set(Array.from(l.values()).map(h=>h.resource_global_id).filter(h=>!!h))),d=await new rCe(this.ctx).getPullRequestsFromGlobalIds(u),f=[];for(let h of l.values()){if(!h.resource_global_id){yT.warn(this.ctx,`${ET}.listSessions: session has no resource_global_id`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let m=d.get(h.resource_global_id);if(!m){yT.warn(this.ctx,`${ET}.listSessions: pull request not found`,{cloudSessionId:h.id,resourceId:h.resource_id});continue}let g=this.ensurePullRequestSession(m,n);f.push({sessionId:g,summary:m.title,startTime:this.toIsoString(h.created_at),modifiedTime:this.toIsoString(h.last_updated_at),status:h.state,isRemote:!1})}return yT.info(this.ctx,`${ET}.listSessions: success`,{nwo:s,count:f.length}),r.properties.reason="listed",r.measurements.count=f.length,{sessions:f}}catch(o){return yT.warn(this.ctx,`${ET}.listSessions: failed`,{error:o instanceof Error?o.message:String(o)}),r.error=o,r.properties.reason="exception",r.measurements.count=0,{sessions:[]}}})}listModels(e){return Bh(this.ctx,"cloudAgent.listModels",r=>{let n=[c9c()];return r.measurements.count=n.length,{models:n}})}toWorkspaceUri(e){return/^[A-Za-z][A-Za-z0-9+.-]+:/.test(e)?e:Oo(e)}createCloudSession(e,r,n){return new sxt(this.ctx,this.notificationSender,this.client,{localSessionId:e,workspaceFolder:r,pullRequest:n})}ensurePullRequestSession(e,r){let n=this.sessionIdForPullRequest(e),o=this.cachedSessionForCanonicalId(n);if(o)return o.updatePullRequest(e),o.localSessionId;let s=this.createCloudSession(n,{uri:r},e);return this._sessions.set(n,s),this._pullRequestSessionId.set(n,n),n}cachedSessionForCanonicalId(e){let r=this._pullRequestSessionId.get(e)??e;return this._sessions.get(r)}findReusableSession(e){let r=this._sessions.get(e);if(r)return r;let n=x6r(e);if(n)return this.cachedSessionForCanonicalId(w6r(n.owner,n.repo,n.pullRequestNumber))}sessionIdForPullRequest(e){return w6r(e.repository.owner.login,e.repository.name,e.number)}async getOrCreateSession(e,r){return this._sessions.get(e)??await this.createAndCacheSession(e,r)}async createAndCacheSession(e,r){let n=await this.resolvePullRequest(e),o=this.createCloudSession(e,r,n);return this._sessions.set(e,o),n&&this._pullRequestSessionId.set(this.sessionIdForPullRequest(n),e),o}async loadSessionHistory(e,r){let o=(await this.client.getAllSessions(e.id)??[]).slice().sort((u,d)=>new Date(u.created_at).getTime()-new Date(d.created_at).getTime()),s=[],c,l=0;for(let u of o){let d=u.event_content?.trim()||u.name?.trim()||e.title;d?s.push(this.userMessageEvent(d,u.created_at)):yT.warn(this.ctx,`${ET}.loadSessionHistory: session has no prompt`,{cloudSessionId:u.id,pullRequestNumber:e.number}),l===0&&s.push(I6r(e,u.created_at)),l++;let f;try{f=await this.client.getSessionLogs(u.id)}catch(h){yT.warn(this.ctx,`${ET}.loadSessionHistory: log fetch failed`,{cloudSessionId:u.id,error:h instanceof Error?h.message:String(h)});continue}s.push(...nxt(this.ctx,f,r)),c={cloudSessionId:u.id,initialLogLength:f.length,state:u.state}}return{events:s,streamStatus:c}}userMessageEvent(e,r){let n=new Date(r),o=isNaN(n.getTime())?new Date().toISOString():n.toISOString();return{id:(0,sZi.randomUUID)(),timestamp:o,parentId:null,type:"user.message",data:{content:e}}}toIsoString(e){let r=new Date(e);return isNaN(r.getTime())?new Date().toISOString():r.toISOString()}async resolvePullRequest(e){let r=x6r(e);if(r)try{return await new Rm(this.ctx).getPullRequest(r.owner,r.repo,r.pullRequestNumber)}catch(n){yT.warn(this.ctx,`${ET}.resolvePullRequest: failed`,{sessionId:e,error:n instanceof Error?n.message:String(n)});return}}unsupported(e){return new Error(`${e} is not supported by CloudAgentService`)}truncateHistory(e){return Promise.reject(this.unsupported("truncateHistory"))}previewRewind(e){return Promise.reject(this.unsupported("previewRewind"))}rewindHistory(e){return Promise.reject(this.unsupported("rewindHistory"))}forkSession(e){return Promise.reject(this.unsupported("forkSession"))}handleInteraction(e){return Promise.resolve({success:!1})}getPlanPath(e){return Promise.reject(this.unsupported("getPlanPath"))}enableRemote(e){return Promise.reject(this.unsupported("enableRemote"))}disableRemote(e){return Promise.reject(this.unsupported("disableRemote"))}getRemoteStatus(e){throw this.unsupported("getRemoteStatus")}compactHistory(e){return Promise.reject(this.unsupported("compactHistory"))}stopCompactHistory(e){return Promise.reject(this.unsupported("stopCompactHistory"))}};p();p();var aZi=require("node:child_process"),cZi=require("node:events"),R6r=ue(require("node:readline"));var Ew=new pe("CodexProcessManager"),axt=class extends cZi.EventEmitter{constructor(r,n,o,s){super();this.ctx=r;this.codexPath=n;this.proxyPort=o;this.cwd=s;this.rpcId=0;this.pendingRequests=new Map;this.notificationHandlers=[];this.serverRequestHandlers=new Map;this.stopping=!1}static{a(this,"CodexProcessManager")}start(){if(this.process)return;this.stopping=!1;let r=this.codexPath,n=["app-server","-c",'model_provider="copilot"',"-c",'model_providers.copilot.name="copilot"',"-c",`model_providers.copilot.base_url="http://127.0.0.1:${this.proxyPort}/v1"`,"-c",'model_providers.copilot.wire_api="responses"',"-c",'default_permissions=":workspace"',"-c",'approvals_reviewer="user"',"-c","features.default_mode_request_user_input = true"];Ew.debug(this.ctx,`start: cmd=${r} args=${JSON.stringify(n)} cwd=${this.cwd}`);try{this.process=(0,aZi.spawn)(r,n,{env:{...process.env,OPENAI_API_KEY:"copilot-proxy"},stdio:["pipe","pipe","pipe"],cwd:this.cwd||void 0}),Ew.debug(this.ctx,`start: spawn succeeded, pid=${this.process.pid}`)}catch(o){let s=o instanceof Error?o.message:String(o);throw Ew.error(this.ctx,`start: spawn failed: ${s}`),new Error(`Failed to spawn codex app-server: ${s}`)}this.process.on("error",o=>{Ew.error(this.ctx,`process error event: ${o.message}`),this.handleProcessExit(-1)}),this.process.on("exit",o=>{Ew.debug(this.ctx,`process exit event: code=${o}`),this.handleProcessExit(o??-1)}),this.process.stdout&&(this.rl=R6r.default.createInterface({input:this.process.stdout}),this.rl.on("line",o=>this.handleLine(o))),this.process.stderr&&R6r.default.createInterface({input:this.process.stderr}).on("line",s=>{Ew.debug(this.ctx,`CodexProcessManager [stderr]: ${s}`)})}async stop(){if(this.stopping=!0,!this.process)return;this.rejectAllPending(new Error("Process stopping")),this.process.kill("SIGTERM");let r=setTimeout(()=>{this.process&&!this.process.killed&&this.process.kill("SIGKILL")},5e3);await new Promise(n=>{if(!this.process){n();return}this.process.on("exit",()=>{clearTimeout(r),n()})}),this.process=void 0,this.rl=void 0}sendRequest(r,n){if(!this.process?.stdin)return Promise.reject(new Error("Codex process not running"));let o=++this.rpcId,s=JSON.stringify({jsonrpc:"2.0",id:o,method:r,params:n??{}});return this.process.stdin.write(s+`
4010
4010
  `),new Promise((c,l)=>{let u=setTimeout(()=>{this.pendingRequests.delete(o),l(new Error(`Timeout waiting for response to ${r} (id=${o})`))},3e4);this.pendingRequests.set(o,{resolve:c,reject:l,timer:u})})}sendNotification(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return Ew.warn(this.ctx,`sendNotification: stdin unavailable, dropping ${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",method:r,params:n??{}});try{return this.process.stdin.write(o+`
4011
4011
  `),!0}catch(s){let c=s instanceof Error?s.message:String(s);return Ew.warn(this.ctx,`sendNotification: write failed for ${r}: ${c}`),!1}}onNotification(r){this.notificationHandlers.push(r)}onServerRequest(r,n){this.serverRequestHandlers.set(r,n)}sendRawResponse(r,n){if(!this.process?.stdin||!this.process.stdin.writable)return Ew.warn(this.ctx,`sendRawResponse: stdin unavailable, dropping response id=${r}`),!1;let o=JSON.stringify({jsonrpc:"2.0",id:r,result:n});try{return this.process.stdin.write(o+`
4012
4012
  `),!0}catch(s){let c=s instanceof Error?s.message:String(s);return Ew.warn(this.ctx,`sendRawResponse: write failed for id=${r}: ${c}`),!1}}isRunning(){return this.process!==void 0&&!this.process.killed}handleLine(r){if(r.trim())try{let n=JSON.parse(r),o=typeof n.id=="number"||typeof n.id=="string";if(o&&this.pendingRequests.has(n.id)){let s=this.pendingRequests.get(n.id);this.pendingRequests.delete(n.id),clearTimeout(s.timer),n.error?s.reject(new Error(JSON.stringify(n.error))):s.resolve(n.result)}else if(o&&n.method)Ew.info(this.ctx,`CodexProcessManager: \u2190 REQUEST ${n.method} (id=${JSON.stringify(n.id)}) params=${JSON.stringify(n.params).slice(0,500)}`),this.handleServerRequest(n.id,n.method,n.params);else if(n.method)for(let s of this.notificationHandlers)s(n.method,n.params);else n.id===null&&Ew.warn(this.ctx,`CodexProcessManager: dropped frame with null id: ${r.slice(0,500)}`)}catch{}}handleServerRequest(r,n,o){Ew.debug(this.ctx,`CodexProcessManager: server request ${n} (id=${JSON.stringify(r)})`);let s=this.serverRequestHandlers.get(n);if(s){s(o,r);return}this.sendRawResponse(r,{decision:"accept"});for(let c of this.notificationHandlers)c(n,o)}handleProcessExit(r){if(this.process=void 0,this.rl=void 0,this.stopping)return;let n=new Error(`Codex process exited unexpectedly (code: ${r})`);this.rejectAllPending(n),this.emit("error",n)}rejectAllPending(r){for(let[,n]of this.pendingRequests)clearTimeout(n.timer),n.reject(r);this.pendingRequests.clear()}};p();p();var nCe=class{constructor(){this._copilotUsage=new R0e;this._pendingPermissions=new Map}static{a(this,"CodexSessionStateService")}setActiveThread(e){this._activeThreadId=e}getActiveThread(){return this._activeThreadId}addCopilotUsageNanoAiuForThread(e,r){this._copilotUsage.add(e,r)}takeCopilotUsageNanoAiuForThread(e){return this._copilotUsage.take(e)}clear(e){this._copilotUsage.clear(e),this._activeThreadId===e&&(this._activeThreadId=void 0)}setPendingPermission(e,r,n){let o=this._pendingPermissions.get(e);o||(o=new Map,this._pendingPermissions.set(e,o)),o.set(r,n)}takePendingPermission(e,r){let n=this._pendingPermissions.get(e);if(!n)return;let o=n.get(r);if(o)return n.delete(r),n.size===0&&this._pendingPermissions.delete(e),o}takeAllPendingPermissionsForSession(e){let r=this._pendingPermissions.get(e);if(!r)return[];let n=Array.from(r.entries());return this._pendingPermissions.delete(e),n}takeAllPendingPermissions(){let e=[];for(let[r,n]of this._pendingPermissions)for(let[o,s]of n)e.push([r,o,s]);return this._pendingPermissions.clear(),e}};var lZi=ue(require("node:http")),P6r=require("node:stream/promises");var q9=new pe("CodexResponsesProxyServer"),l9c=16*1024*1024,cxt=class{constructor(e,r=new nCe){this.ctx=e;this.stateService=r;this.port=0}static{a(this,"CodexResponsesProxyServer")}async start(){if(this.server)return this.port;let e=lZi.createServer((r,n)=>{this.handleRequest(r,n)});return this.server=e,new Promise((r,n)=>{e.once("error",n),e.listen(0,"127.0.0.1",()=>{let o=e.address();o&&typeof o=="object"?(this.port=o.port,q9.info(this.ctx,`CodexResponsesProxyServer listening on port ${o.port}`),e.removeListener("error",n),r(this.port)):n(new Error("Failed to get server address"))})})}async stop(){let e=this.server;e&&(await new Promise(r=>{e.close(()=>r())}),this.server=void 0,this.port=0)}getPort(){return this.port}async handleRequest(e,r){try{if(q9.info(this.ctx,`handleRequest: ${e.method} ${e.url}`),e.method==="POST"&&e.url?.includes("/responses")){let n=await this.readBody(e);q9.info(this.ctx,`proxyToCapiResponses: forwarding ${n.length} bytes`),await this.proxyToCapiResponses(n,r),q9.info(this.ctx,"proxyToCapiResponses: completed")}else q9.debug(this.ctx,`CodexResponsesProxyServer: unhandled ${e.method} ${e.url}`),r.writeHead(404),r.end("{}")}catch(n){q9.exception(this.ctx,n,".handleRequest"),r.headersSent||r.writeHead(500,{"Content-Type":"application/json"}),r.writableEnded||r.end(JSON.stringify({error:{message:"Internal proxy error"}}))}}async proxyToCapiResponses(e,r){let n=this.ctx.get(Ft),o=this.ctx.get(zt),s;try{s=await n.getToken()}catch(h){q9.exception(this.ctx,h,".proxyToCapiResponses/getToken"),r.writeHead(401,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Failed to acquire Copilot token"}}));return}let c=Kue(this.ctx,s,"v1/responses"),l={...Ff(this.ctx),"Content-Type":"application/json"},{headers:u}=await Yue(this.ctx,l,s.token),d=new AbortController,f=a(()=>{d.signal.aborted||d.abort()},"onClose");r.on("close",f);try{let h=await o.fetch(c,{method:"POST",headers:u,body:e,signal:d.signal});Jue(this.ctx,h,"v1/responses");let m=h.headers.get("content-type")||"application/json";r.writeHead(h.status,{"Content-Type":m});let g=h.body();if(!g){r.end();return}let A=m.toLowerCase().includes("text/event-stream"),y=this.stateService.getActiveThread();if(A&&y){let E=l5e(_=>{this.stateService.addCopilotUsageNanoAiuForThread(y,_)});await(0,P6r.pipeline)(g,E,r)}else await(0,P6r.pipeline)(g,r)}catch(h){if(d.signal.aborted){q9.debug(this.ctx,"upstream fetch aborted by client disconnect"),r.writableEnded||r.end();return}if(q9.exception(this.ctx,h,".proxyToCapiResponses"),r.headersSent||r.writableEnded){r.destroy();return}r.writeHead(500,{"Content-Type":"application/json"}),r.end(JSON.stringify({error:{message:"Upstream request failed"}}))}finally{r.removeListener("close",f)}}readBody(e){return new Promise((r,n)=>{let o=[],s=0;e.on("data",c=>{if(s+=c.length,s>l9c){n(new Error("Request body exceeds maximum allowed size")),e.destroy();return}o.push(c)}),e.on("end",()=>r(Buffer.concat(o).toString("utf8"))),e.on("error",n)})}};p();var k6r=require("node:fs"),uZi=ue(require("node:os")),lxt=ue(require("node:path"));No();function u9c(){let t=process.env.CODEX_HOME;return t||lxt.join(uZi.homedir(),".codex")}a(u9c,"codexHome");async function uxt(t){let e=lxt.join(u9c(),"sessions");try{return await dZi(e,t)}catch{return null}}a(uxt,"findRolloutFile");async function dZi(t,e){let r;try{r=await k6r.promises.readdir(t,{withFileTypes:!0})}catch{return null}for(let n of r){let o=lxt.join(t,n.name);if(n.isDirectory()){let s=await dZi(o,e);if(s)return s}else if(n.isFile()&&n.name.endsWith(".jsonl")&&n.name.includes(e))return o}return null}a(dZi,"searchForRollout");async function dxt(t){let e;try{e=await k6r.promises.readFile(t,"utf8")}catch{return null}let r=e.split(`
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/github/copilot-language-server-release.git"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "1.537.3",
14
+ "version": "1.537.4",
15
15
  "bin": {
16
16
  "copilot-language-server": "../dist/language-server.js"
17
17
  },
@@ -42,12 +42,12 @@
42
42
  "vscode-languageserver-protocol": "^3.17.5"
43
43
  },
44
44
  "optionalDependencies": {
45
- "@github/copilot-language-server-win32-x64": "1.537.3",
46
- "@github/copilot-language-server-win32-arm64": "1.537.3",
47
- "@github/copilot-language-server-linux-x64": "1.537.3",
48
- "@github/copilot-language-server-linux-arm64": "1.537.3",
49
- "@github/copilot-language-server-darwin-x64": "1.537.3",
50
- "@github/copilot-language-server-darwin-arm64": "1.537.3",
45
+ "@github/copilot-language-server-win32-x64": "1.537.4",
46
+ "@github/copilot-language-server-win32-arm64": "1.537.4",
47
+ "@github/copilot-language-server-linux-x64": "1.537.4",
48
+ "@github/copilot-language-server-linux-arm64": "1.537.4",
49
+ "@github/copilot-language-server-darwin-x64": "1.537.4",
50
+ "@github/copilot-language-server-darwin-arm64": "1.537.4",
51
51
  "@github/copilot-win32-x64": "1.0.79",
52
52
  "@github/copilot-win32-arm64": "1.0.79",
53
53
  "@github/copilot-linux-x64": "1.0.79",
@@ -56,5 +56,5 @@
56
56
  "@github/copilot-darwin-arm64": "1.0.79"
57
57
  },
58
58
  "buildType": "prod",
59
- "build": "112"
59
+ "build": "113"
60
60
  }