Skip to content

Commit d65260e

Browse files
committed
refactor(session): 回滚 session.ts 文件
1 parent a109178 commit d65260e

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/session.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as fs from "fs";
22
import * as path from "path";
33
import * as os from "os";
44
import * as crypto from "crypto";
5-
import { fileURLToPath } from "url";
65
import matter from "gray-matter";
76
import ejs from "ejs";
87
import type { ChatCompletionMessageParam, ChatCompletionContentPart } from "openai/resources/chat/completions";
@@ -12,6 +11,7 @@ import { DEEPSEEK_V4_MODELS, supportsMultimodal } from "./common/model-capabilit
1211
import {
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-
147138
function getTotalTokens(usage: ModelUsage | null | undefined): number {
148139
if (!isUsageRecord(usage)) {
149140
return 0;

0 commit comments

Comments
 (0)