File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import * as fs from "fs";
22import * as path from "path" ;
33import * as os from "os" ;
44import * as crypto from "crypto" ;
5- import { fileURLToPath } from "url" ;
65import matter from "gray-matter" ;
76import ejs from "ejs" ;
87import type { ChatCompletionMessageParam , ChatCompletionContentPart } from "openai/resources/chat/completions" ;
@@ -12,6 +11,7 @@ import { DEEPSEEK_V4_MODELS, supportsMultimodal } from "./common/model-capabilit
1211import {
1312 getCompactPrompt ,
1413 getDefaultSkillPrompt ,
14+ getExtensionRoot ,
1515 getRuntimeContext ,
1616 getSystemPrompt ,
1717 getTools ,
@@ -135,15 +135,6 @@ function accumulateUsagePerModel(
135135 return usagePerModel ;
136136}
137137
138- function getExtensionRoot ( ) : string {
139- if ( typeof __dirname !== "undefined" ) {
140- return path . resolve ( __dirname , ".." ) ;
141- }
142-
143- const currentFilePath = fileURLToPath ( import . meta. url ) ;
144- return path . resolve ( path . dirname ( currentFilePath ) , ".." ) ;
145- }
146-
147138function getTotalTokens ( usage : ModelUsage | null | undefined ) : number {
148139 if ( ! isUsageRecord ( usage ) ) {
149140 return 0 ;
You can’t perform that action at this time.
0 commit comments