@cjhyy/code-shell 0.1.0-alpha.3 → 0.1.6
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.
- package/CHANGELOG.md +107 -0
- package/dist/anthropic-IBTI4WL2.cjs +10 -0
- package/dist/anthropic-PRZZKHEZ.js +10 -0
- package/dist/arena/index.cjs +7 -6
- package/dist/arena/index.js +6 -5
- package/dist/arena/model-presets.d.ts +10 -1
- package/dist/{arena-ENHBHB2W.js → arena-2LTLIXOL.js} +9 -7
- package/dist/{arena-HHDYYVHJ.cjs → arena-ADB7DRFI.cjs} +25 -23
- package/dist/{chunk-EL2RL5DG.cjs → chunk-2YW4FPFG.cjs} +2 -2
- package/dist/chunk-3OA5G4TM.js +47 -0
- package/dist/{chunk-FPFTIKEJ.js → chunk-3QO25N6E.js} +131 -173
- package/dist/chunk-3SBSUOWZ.js +447 -0
- package/dist/chunk-52LGZKT3.cjs +47 -0
- package/dist/{chunk-KOGV6PDQ.cjs → chunk-55XGPMAP.cjs} +44 -9
- package/dist/{chunk-YD7XTI7T.cjs → chunk-6QVAYW7C.cjs} +116 -28
- package/dist/{chunk-SCDKLTN3.js → chunk-6S4BJ65N.js} +5 -4
- package/dist/{chunk-ZLPJJZUW.js → chunk-76HYEPDM.js} +2 -2
- package/dist/chunk-7BI3V74Y.cjs +447 -0
- package/dist/{chunk-GZBD6QRS.cjs → chunk-7EG3V4JY.cjs} +13 -12
- package/dist/{chunk-LMEKCQX4.js → chunk-7JVTYEEC.js} +6 -6
- package/dist/{chunk-SW3L7HIM.js → chunk-7QIM3BKD.js} +2 -2
- package/dist/{chunk-5C5HIOML.js → chunk-7Y6S3OCX.js} +109 -21
- package/dist/{chunk-REFCCVDM.js → chunk-ABRRONJ7.js} +2 -2
- package/dist/{chunk-F5BS3GUC.js → chunk-BSW22MPA.js} +39 -4
- package/dist/{chunk-ZRVPCXI7.js → chunk-BXCY2FSE.js} +2 -1
- package/dist/{chunk-Y7TSCDF6.js → chunk-BZ5TNE7L.js} +347 -6
- package/dist/{chunk-X2DNIMPC.cjs → chunk-DDB6QOKJ.cjs} +32 -32
- package/dist/{chunk-C7C7ZZY4.cjs → chunk-HEKQCI7B.cjs} +10 -10
- package/dist/{chunk-JHNCK7JP.cjs → chunk-IK4EWJBP.cjs} +4 -3
- package/dist/{chunk-3CAZIWUA.cjs → chunk-ILHE7XLT.cjs} +9 -9
- package/dist/{chunk-M2QI5X3X.cjs → chunk-JMR33QVF.cjs} +2 -2
- package/dist/{chunk-TDXBHD24.js → chunk-KAQHULYN.js} +2 -2
- package/dist/chunk-KE4EQOWA.js +294 -0
- package/dist/{chunk-YAFCN7ZW.cjs → chunk-KOVYSDHZ.cjs} +15 -15
- package/dist/{chunk-IJSHQGMP.cjs → chunk-KS3RYAYL.cjs} +4 -4
- package/dist/{chunk-DI7RDLOS.js → chunk-MD32R22I.js} +7 -4
- package/dist/chunk-MV7YI4WO.cjs +293 -0
- package/dist/chunk-MY5XHADU.cjs +216 -0
- package/dist/{chunk-OP57WUWQ.cjs → chunk-NUNC3VFB.cjs} +6 -6
- package/dist/{chunk-ID6EJUHP.js → chunk-PKGRTCCY.js} +1307 -212
- package/dist/{chunk-OUC2DFA7.js → chunk-QARL3IDQ.js} +3 -3
- package/dist/{chunk-VIPLU4RY.cjs → chunk-S754JHLR.cjs} +4 -4
- package/dist/{chunk-FUOKLKR2.js → chunk-SFXHZSRF.js} +1 -1
- package/dist/{chunk-2EUAE7AY.js → chunk-SIHHIQLO.js} +2 -2
- package/dist/{chunk-SK62UVS6.js → chunk-T6VYG46N.js} +1 -1
- package/dist/{chunk-JHXNOB5G.cjs → chunk-TNLGBJYS.cjs} +6 -6
- package/dist/{chunk-3QR52LL5.cjs → chunk-TUY2T5KP.cjs} +2 -2
- package/dist/{chunk-VWFET3MG.cjs → chunk-UXOCVJJ6.cjs} +1519 -424
- package/dist/{chunk-I57ZD5IQ.js → chunk-VIAGTYYW.js} +1 -1
- package/dist/chunk-WASS5YWB.js +215 -0
- package/dist/{chunk-HOXQLX5R.cjs → chunk-WZJV6DJC.cjs} +444 -103
- package/dist/{chunk-BUJ5KYCI.cjs → chunk-YIQBXAYU.cjs} +13 -13
- package/dist/{chunk-BF4LXLQV.cjs → chunk-YKIAELDZ.cjs} +132 -174
- package/dist/{chunk-M2SVOKC6.js → chunk-ZBPSQCPU.js} +6 -6
- package/dist/cli/commands/builtin/export-md.d.ts +19 -0
- package/dist/cli/commands/builtin/init/detect.d.ts +25 -0
- package/dist/cli/commands/builtin/init/index.d.ts +19 -0
- package/dist/cli/main.cjs +2372 -1453
- package/dist/cli/main.js +2502 -1583
- package/dist/cli/migrate-models.d.ts +45 -0
- package/dist/cli/onboarding.d.ts +110 -5
- package/dist/cli/updater.d.ts +59 -4
- package/dist/client-base-HTF236ZD.cjs +9 -0
- package/dist/client-base-QKRKCOWB.js +9 -0
- package/dist/{compaction-YNWCEF7B.js → compaction-6VU2T643.js} +4 -2
- package/dist/compaction-OKUNTCA7.cjs +33 -0
- package/dist/context/compaction.d.ts +35 -3
- package/dist/context/manager.d.ts +40 -3
- package/dist/context/tool-result-storage.d.ts +96 -0
- package/dist/devtools-T2NIZBJK.cjs +6 -0
- package/dist/{devtools-IRQQPIRY.js → devtools-YXWHOVKR.js} +1 -1
- package/dist/engine/engine.d.ts +47 -0
- package/dist/engine/turn-loop.d.ts +6 -0
- package/dist/export-md-RXDW6F5W.cjs +135 -0
- package/dist/export-md-XXKZANW5.js +135 -0
- package/dist/file-history-KYPE3ECT.cjs +7 -0
- package/dist/file-history-LF4F7X26.js +7 -0
- package/dist/index.cjs +42 -22
- package/dist/index.d.ts +5 -2
- package/dist/index.js +38 -18
- package/dist/llm/client-base.d.ts +1 -1
- package/dist/llm/model-cache.d.ts +21 -0
- package/dist/llm/model-fetcher.d.ts +29 -0
- package/dist/llm/model-pool.d.ts +13 -0
- package/dist/llm/provider-catalog.d.ts +30 -0
- package/dist/llm/provider-kinds.d.ts +21 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/logging/session-recorder.d.ts +77 -0
- package/dist/manager-D65VFAPX.js +7 -0
- package/dist/manager-TTF5VHJC.cjs +7 -0
- package/dist/mcp-manager-QMKWPBZ4.js +8 -0
- package/dist/mcp-manager-Z3OKI74O.cjs +8 -0
- package/dist/memory-5LWZ6FI2.cjs +9 -0
- package/dist/{memory-EPFDBPII.js → memory-VIJLBAMQ.js} +2 -2
- package/dist/model-cache-5KIYL5SL.js +13 -0
- package/dist/model-cache-OED3IM4R.cjs +13 -0
- package/dist/model-fetcher-HKGICACL.js +8 -0
- package/dist/model-fetcher-UR6WJOQP.cjs +8 -0
- package/dist/openai-JR2WEKOF.js +10 -0
- package/dist/openai-YBTOET4O.cjs +10 -0
- package/dist/{openrouter-models-2FM3H4SQ.js → openrouter-models-H56GHBHN.js} +2 -2
- package/dist/openrouter-models-TWUFWZ5T.cjs +15 -0
- package/dist/openrouter-sync-5VMGN6C2.cjs +11 -0
- package/dist/{openrouter-sync-SO3AWEAM.js → openrouter-sync-ALEMF5IU.js} +3 -3
- package/dist/product/index.cjs +17 -15
- package/dist/product/index.js +16 -14
- package/dist/protocol/server.d.ts +3 -1
- package/dist/protocol/types.d.ts +36 -2
- package/dist/run/index.cjs +17 -15
- package/dist/run/index.js +16 -14
- package/dist/services/index.d.ts +0 -1
- package/dist/session-manager-Q22BBMD3.js +8 -0
- package/dist/session-manager-XODQVL3C.cjs +8 -0
- package/dist/settings/schema.d.ts +267 -42
- package/dist/{tool-summary-RYNR4DDB.cjs → tool-summary-63DPIS7G.cjs} +4 -4
- package/dist/{tool-summary-2RUFL5QK.js → tool-summary-NP5CDBKG.js} +2 -2
- package/dist/tool-system/builtin/ask-user.d.ts +9 -1
- package/dist/tool-system/context.d.ts +31 -2
- package/dist/tool-system/executor.d.ts +4 -0
- package/dist/tool-system/investigation-guard.d.ts +46 -0
- package/dist/types.d.ts +13 -2
- package/dist/ui/components/AskUserPrompt.d.ts +8 -1
- package/dist/ui/components/DiffLine.d.ts +33 -0
- package/dist/ui/components/ModelManager.d.ts +34 -1
- package/dist/ui/components/OnboardingPrompt.d.ts +10 -1
- package/dist/ui/components/ProviderModelFlow.d.ts +58 -0
- package/dist/ui/components/UpdateBanner.d.ts +1 -0
- package/dist/updater-I7QBW4DP.cjs +17 -0
- package/dist/updater-NVME5S3Z.js +17 -0
- package/dist/utils/semver.d.ts +1 -0
- package/dist/utils/task-sanitizer.d.ts +6 -0
- package/package.json +2 -1
- package/skills-builtin/codeshell-help.md +135 -0
- package/dist/anthropic-P5VETAFI.cjs +0 -10
- package/dist/anthropic-W2GU3D76.js +0 -10
- package/dist/chunk-75E4BBFC.js +0 -224
- package/dist/chunk-FV2ARONZ.cjs +0 -224
- package/dist/client-base-TOVE25FA.js +0 -9
- package/dist/client-base-VDDIADAC.cjs +0 -9
- package/dist/compaction-D3KV2NWY.cjs +0 -31
- package/dist/devtools-WTC3NFNE.cjs +0 -6
- package/dist/file-history-HZWO2WQ5.js +0 -7
- package/dist/file-history-UQQILIY7.cjs +0 -7
- package/dist/manager-FWLOVEEK.cjs +0 -7
- package/dist/manager-GEXJLOIS.js +0 -7
- package/dist/mcp-manager-37GQLFGX.js +0 -8
- package/dist/mcp-manager-U77NEXBY.cjs +0 -8
- package/dist/memory-ADGOWADP.cjs +0 -9
- package/dist/openai-RXU5URYI.js +0 -10
- package/dist/openai-SQW4H2K4.cjs +0 -10
- package/dist/openrouter-models-PLCWZZYE.cjs +0 -15
- package/dist/openrouter-sync-K2WK3A2A.cjs +0 -11
- package/dist/services/compact.d.ts +0 -56
- package/dist/session-manager-HRSKENKB.cjs +0 -8
- package/dist/session-manager-NEKFEHF3.js +0 -8
- package/dist/updater-J7L7R6BY.cjs +0 -185
- package/dist/updater-LDBNYCAO.js +0 -185
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIK4EWJBPcjs = require('./chunk-IK4EWJBP.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
7
7
|
|
|
8
8
|
// src/tool-system/mcp-manager.ts
|
|
9
|
-
|
|
9
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
10
10
|
var _indexjs = require('@modelcontextprotocol/sdk/client/index.js');
|
|
11
11
|
var _stdiojs = require('@modelcontextprotocol/sdk/client/stdio.js');
|
|
12
12
|
var _streamableHttpjs = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
|
|
@@ -35,7 +35,7 @@ var MCPManager = (_class = class _MCPManager {
|
|
|
35
35
|
for (let i = 0; i < results.length; i++) {
|
|
36
36
|
const result = results[i];
|
|
37
37
|
if (result.status === "rejected") {
|
|
38
|
-
|
|
38
|
+
_chunkIK4EWJBPcjs.logger.warn("mcp.connect_failed", {
|
|
39
39
|
server: entries[i][0],
|
|
40
40
|
error: result.reason.message
|
|
41
41
|
});
|
|
@@ -47,10 +47,10 @@ var MCPManager = (_class = class _MCPManager {
|
|
|
47
47
|
*/
|
|
48
48
|
async connect(name, config) {
|
|
49
49
|
if (this.connections.has(name)) {
|
|
50
|
-
|
|
50
|
+
_chunkIK4EWJBPcjs.logger.info("mcp.already_connected", { server: name });
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
_chunkIK4EWJBPcjs.logger.info("mcp.connecting", { server: name, transport: _nullishCoalesce(config.transport, () => ( "stdio")) });
|
|
54
54
|
const client = new (0, _indexjs.Client)(
|
|
55
55
|
{ name: "code-shell", version: "0.1.0" },
|
|
56
56
|
{ capabilities: {} }
|
|
@@ -99,7 +99,7 @@ var MCPManager = (_class = class _MCPManager {
|
|
|
99
99
|
}
|
|
100
100
|
this.connections.set(name, { client, serverName: name, transport });
|
|
101
101
|
await this.discoverTools(name, client);
|
|
102
|
-
|
|
102
|
+
_chunkIK4EWJBPcjs.logger.info("mcp.connected", { server: name });
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
105
|
* Discover tools from an MCP server and register them.
|
|
@@ -131,7 +131,7 @@ var MCPManager = (_class = class _MCPManager {
|
|
|
131
131
|
}
|
|
132
132
|
return parts.join("\n") || "(no output)";
|
|
133
133
|
});
|
|
134
|
-
|
|
134
|
+
_chunkIK4EWJBPcjs.logger.info("mcp.tool_registered", { server: serverName, tool: registered.name });
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
@@ -141,9 +141,9 @@ var MCPManager = (_class = class _MCPManager {
|
|
|
141
141
|
for (const [name, conn] of this.connections) {
|
|
142
142
|
try {
|
|
143
143
|
await conn.client.close();
|
|
144
|
-
|
|
144
|
+
_chunkIK4EWJBPcjs.logger.info("mcp.disconnected", { server: name });
|
|
145
145
|
} catch (err) {
|
|
146
|
-
|
|
146
|
+
_chunkIK4EWJBPcjs.logger.warn("mcp.disconnect_error", { server: name, error: err.message });
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
this.connections.clear();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
4
4
|
|
|
5
5
|
// src/logging/logger.ts
|
|
6
|
-
|
|
6
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -199,4 +199,5 @@ function rotateLogs() {
|
|
|
199
199
|
|
|
200
200
|
|
|
201
201
|
|
|
202
|
-
|
|
202
|
+
|
|
203
|
+
exports.getCurrentSid = getCurrentSid; exports.logger = logger; exports.rotateLogs = rotateLogs;
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkUXOCVJJ6cjs = require('./chunk-UXOCVJJ6.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
11
11
|
|
|
12
12
|
// src/product/index.ts
|
|
13
|
-
|
|
13
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
14
14
|
|
|
15
15
|
// src/product/define.ts
|
|
16
|
-
|
|
16
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
17
17
|
var _path = require('path');
|
|
18
18
|
var _os = require('os');
|
|
19
19
|
function defineProduct(definition, runtime) {
|
|
@@ -61,12 +61,12 @@ function defineProduct(definition, runtime) {
|
|
|
61
61
|
builtinTools: [...enabledSet],
|
|
62
62
|
defaultPermissionRules: permissionRules
|
|
63
63
|
};
|
|
64
|
-
|
|
64
|
+
_chunkUXOCVJJ6cjs.registerPreset.call(void 0, agentPreset);
|
|
65
65
|
let evaluator;
|
|
66
66
|
if (!_optionalChain([contract, 'optionalAccess', _4 => _4.evaluator])) {
|
|
67
|
-
evaluator = new (0,
|
|
67
|
+
evaluator = new (0, _chunkUXOCVJJ6cjs.NoopEvaluator)();
|
|
68
68
|
} else if (Array.isArray(contract.evaluator)) {
|
|
69
|
-
evaluator = new (0,
|
|
69
|
+
evaluator = new (0, _chunkUXOCVJJ6cjs.CompositeEvaluator)(contract.evaluator);
|
|
70
70
|
} else {
|
|
71
71
|
evaluator = contract.evaluator;
|
|
72
72
|
}
|
|
@@ -76,8 +76,8 @@ function defineProduct(definition, runtime) {
|
|
|
76
76
|
execute: ct.execute
|
|
77
77
|
}));
|
|
78
78
|
const runsDir = _nullishCoalesce(runtime.runsDir, () => ( _path.join.call(void 0, _os.homedir.call(void 0, ), ".code-shell", "runs")));
|
|
79
|
-
const store = new (0,
|
|
80
|
-
const manager = new (0,
|
|
79
|
+
const store = new (0, _chunkUXOCVJJ6cjs.FileRunStore)(runsDir);
|
|
80
|
+
const manager = new (0, _chunkUXOCVJJ6cjs.RunManager)({
|
|
81
81
|
store,
|
|
82
82
|
executor: {
|
|
83
83
|
llm: runtime.llm,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
4
4
|
|
|
5
5
|
// src/session/memory.ts
|
|
6
|
-
|
|
6
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
7
7
|
var _fs = require('fs');
|
|
8
8
|
var _path = require('path');
|
|
9
9
|
var _os = require('os');
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__dirname,
|
|
3
|
+
__filename,
|
|
4
|
+
__require,
|
|
5
|
+
init_esm_shims
|
|
6
|
+
} from "./chunk-MD32R22I.js";
|
|
7
|
+
|
|
8
|
+
// src/cli/updater.ts
|
|
9
|
+
init_esm_shims();
|
|
10
|
+
import { execFile, spawn } from "child_process";
|
|
11
|
+
import { constants as fsConstants } from "fs";
|
|
12
|
+
import { access, mkdir, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
13
|
+
import { createRequire } from "module";
|
|
14
|
+
import { homedir } from "os";
|
|
15
|
+
import { dirname, join, resolve } from "path";
|
|
16
|
+
import { readFileSync } from "fs";
|
|
17
|
+
import { fileURLToPath } from "url";
|
|
18
|
+
import { promisify } from "util";
|
|
19
|
+
|
|
20
|
+
// src/utils/semver.ts
|
|
21
|
+
init_esm_shims();
|
|
22
|
+
import { gte as semverGte, gt as semverGt, lt as semverLt } from "semver";
|
|
23
|
+
function gt(a, b) {
|
|
24
|
+
return semverGt(a, b);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// src/cli/updater.ts
|
|
28
|
+
var execFileAsync = promisify(execFile);
|
|
29
|
+
var PACKAGE_NAME = "@cjhyy/code-shell";
|
|
30
|
+
var LOCK_FILE = ".update.lock";
|
|
31
|
+
var LOCK_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
32
|
+
var NPM_VIEW_TIMEOUT_MS = 5e3;
|
|
33
|
+
var _updateInfo;
|
|
34
|
+
var _exitHookInstalled = false;
|
|
35
|
+
var _disabledReason = null;
|
|
36
|
+
function checkForUpdate(packageName = PACKAGE_NAME) {
|
|
37
|
+
void runCheck(packageName);
|
|
38
|
+
}
|
|
39
|
+
function getUpdateAvailable() {
|
|
40
|
+
return _updateInfo;
|
|
41
|
+
}
|
|
42
|
+
function getAutoUpdateDisabledReason() {
|
|
43
|
+
return _disabledReason;
|
|
44
|
+
}
|
|
45
|
+
function scheduleAutoInstallOnExit() {
|
|
46
|
+
if (_exitHookInstalled) return;
|
|
47
|
+
_exitHookInstalled = true;
|
|
48
|
+
const fire = () => {
|
|
49
|
+
const info = _updateInfo;
|
|
50
|
+
if (!info || !info.canAutoInstall) return;
|
|
51
|
+
try {
|
|
52
|
+
launchDetachedInstall(info.latestVersion);
|
|
53
|
+
} catch {
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
process.once("exit", fire);
|
|
57
|
+
}
|
|
58
|
+
var _cachedVersion;
|
|
59
|
+
function getCurrentVersion() {
|
|
60
|
+
if (_cachedVersion) return _cachedVersion;
|
|
61
|
+
const found = resolveVersion();
|
|
62
|
+
_cachedVersion = found;
|
|
63
|
+
return found;
|
|
64
|
+
}
|
|
65
|
+
function resolveVersion() {
|
|
66
|
+
try {
|
|
67
|
+
const here = typeof import.meta !== "undefined" && import.meta.url ? dirname(fileURLToPath(import.meta.url)) : __dirname;
|
|
68
|
+
let dir = here;
|
|
69
|
+
for (let i = 0; i < 6; i++) {
|
|
70
|
+
try {
|
|
71
|
+
const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf-8"));
|
|
72
|
+
if (pkg && typeof pkg.version === "string") return pkg.version;
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
75
|
+
const parent = dirname(dir);
|
|
76
|
+
if (parent === dir) break;
|
|
77
|
+
dir = parent;
|
|
78
|
+
}
|
|
79
|
+
} catch {
|
|
80
|
+
}
|
|
81
|
+
try {
|
|
82
|
+
const req = createRequire(import.meta.url ?? __filename);
|
|
83
|
+
const pkg = req("../../package.json");
|
|
84
|
+
if (pkg?.version) return pkg.version;
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
return "0.0.0";
|
|
88
|
+
}
|
|
89
|
+
async function runCheck(packageName) {
|
|
90
|
+
const disabled = isAutoUpdaterDisabled();
|
|
91
|
+
if (disabled) {
|
|
92
|
+
_disabledReason = disabled;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
_disabledReason = null;
|
|
96
|
+
try {
|
|
97
|
+
const currentVersion = getCurrentVersion();
|
|
98
|
+
const latestVersion = await getLatestVersion(packageName);
|
|
99
|
+
if (!latestVersion) return;
|
|
100
|
+
let isNewer = false;
|
|
101
|
+
try {
|
|
102
|
+
isNewer = gt(latestVersion, currentVersion);
|
|
103
|
+
} catch {
|
|
104
|
+
isNewer = latestVersion !== currentVersion;
|
|
105
|
+
}
|
|
106
|
+
if (!isNewer) {
|
|
107
|
+
_updateInfo = void 0;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const { hasPermissions, npmPrefix } = await checkGlobalInstallPermissions();
|
|
111
|
+
_updateInfo = { latestVersion, canAutoInstall: hasPermissions, npmPrefix };
|
|
112
|
+
} catch {
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function getLatestVersion(packageName) {
|
|
116
|
+
try {
|
|
117
|
+
const { stdout } = await execFileAsync(
|
|
118
|
+
"npm",
|
|
119
|
+
["view", `${packageName}@latest`, "version", "--prefer-online"],
|
|
120
|
+
{ cwd: homedir(), timeout: NPM_VIEW_TIMEOUT_MS }
|
|
121
|
+
);
|
|
122
|
+
const v = stdout.trim();
|
|
123
|
+
return v.length > 0 ? v : null;
|
|
124
|
+
} catch {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
async function checkGlobalInstallPermissions() {
|
|
129
|
+
let prefix = null;
|
|
130
|
+
try {
|
|
131
|
+
const { stdout } = await execFileAsync(
|
|
132
|
+
"npm",
|
|
133
|
+
["-g", "config", "get", "prefix"],
|
|
134
|
+
{ cwd: homedir(), timeout: 5e3 }
|
|
135
|
+
);
|
|
136
|
+
prefix = stdout.trim();
|
|
137
|
+
} catch {
|
|
138
|
+
return { hasPermissions: false, npmPrefix: null };
|
|
139
|
+
}
|
|
140
|
+
if (!prefix) return { hasPermissions: false, npmPrefix: null };
|
|
141
|
+
try {
|
|
142
|
+
await access(prefix, fsConstants.W_OK);
|
|
143
|
+
return { hasPermissions: true, npmPrefix: prefix };
|
|
144
|
+
} catch {
|
|
145
|
+
return { hasPermissions: false, npmPrefix: prefix };
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function userHome() {
|
|
149
|
+
return process.env.HOME ?? homedir();
|
|
150
|
+
}
|
|
151
|
+
function configDir() {
|
|
152
|
+
return join(userHome(), ".code-shell");
|
|
153
|
+
}
|
|
154
|
+
function getLockFilePath() {
|
|
155
|
+
return join(configDir(), LOCK_FILE);
|
|
156
|
+
}
|
|
157
|
+
function getUpdateLogPath() {
|
|
158
|
+
return join(configDir(), "update.log");
|
|
159
|
+
}
|
|
160
|
+
async function acquireLock() {
|
|
161
|
+
const lockPath = getLockFilePath();
|
|
162
|
+
try {
|
|
163
|
+
const s = await stat(lockPath);
|
|
164
|
+
if (Date.now() - s.mtimeMs < LOCK_TIMEOUT_MS) return false;
|
|
165
|
+
try {
|
|
166
|
+
const recheck = await stat(lockPath);
|
|
167
|
+
if (Date.now() - recheck.mtimeMs < LOCK_TIMEOUT_MS) return false;
|
|
168
|
+
await unlink(lockPath);
|
|
169
|
+
} catch (err) {
|
|
170
|
+
if (!isENOENT(err)) return false;
|
|
171
|
+
}
|
|
172
|
+
} catch (err) {
|
|
173
|
+
if (!isENOENT(err)) return false;
|
|
174
|
+
}
|
|
175
|
+
try {
|
|
176
|
+
await writeFile(lockPath, String(process.pid), { encoding: "utf8", flag: "wx" });
|
|
177
|
+
return true;
|
|
178
|
+
} catch (err) {
|
|
179
|
+
const code = errnoCode(err);
|
|
180
|
+
if (code === "EEXIST") return false;
|
|
181
|
+
if (code === "ENOENT") {
|
|
182
|
+
try {
|
|
183
|
+
await mkdir(configDir(), { recursive: true });
|
|
184
|
+
await writeFile(lockPath, String(process.pid), { encoding: "utf8", flag: "wx" });
|
|
185
|
+
return true;
|
|
186
|
+
} catch {
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
async function releaseLock() {
|
|
194
|
+
const lockPath = getLockFilePath();
|
|
195
|
+
try {
|
|
196
|
+
const data = await readFile(lockPath, "utf8");
|
|
197
|
+
if (data === String(process.pid)) await unlink(lockPath);
|
|
198
|
+
} catch {
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function launchDetachedInstall(version) {
|
|
202
|
+
const lockPath = getLockFilePath();
|
|
203
|
+
try {
|
|
204
|
+
try {
|
|
205
|
+
const fs2 = __require("fs");
|
|
206
|
+
fs2.mkdirSync(configDir(), { recursive: true });
|
|
207
|
+
fs2.writeFileSync(lockPath, String(process.pid), { encoding: "utf8", flag: "wx" });
|
|
208
|
+
} catch (err) {
|
|
209
|
+
if (errnoCode(err) === "EEXIST") {
|
|
210
|
+
try {
|
|
211
|
+
const fs2 = __require("fs");
|
|
212
|
+
const s = fs2.statSync(lockPath);
|
|
213
|
+
if (Date.now() - s.mtimeMs < LOCK_TIMEOUT_MS) return;
|
|
214
|
+
fs2.unlinkSync(lockPath);
|
|
215
|
+
fs2.writeFileSync(lockPath, String(process.pid), { encoding: "utf8", flag: "wx" });
|
|
216
|
+
} catch {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
} else {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
} catch {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const fs = __require("fs");
|
|
227
|
+
const logFd = fs.openSync(getUpdateLogPath(), "a");
|
|
228
|
+
try {
|
|
229
|
+
fs.writeSync(
|
|
230
|
+
logFd,
|
|
231
|
+
`
|
|
232
|
+
[${(/* @__PURE__ */ new Date()).toISOString()}] code-shell auto-update: installing ${PACKAGE_NAME}@${version} (pid=${process.pid})
|
|
233
|
+
`
|
|
234
|
+
);
|
|
235
|
+
} catch {
|
|
236
|
+
}
|
|
237
|
+
const cmd = [
|
|
238
|
+
`npm install -g ${PACKAGE_NAME}@${shellEscape(version)}`,
|
|
239
|
+
`; rm -f ${shellEscape(lockPath)}`
|
|
240
|
+
].join(" ");
|
|
241
|
+
try {
|
|
242
|
+
const child = spawn("sh", ["-c", cmd], {
|
|
243
|
+
detached: true,
|
|
244
|
+
stdio: ["ignore", logFd, logFd],
|
|
245
|
+
cwd: homedir()
|
|
246
|
+
});
|
|
247
|
+
child.unref();
|
|
248
|
+
} catch {
|
|
249
|
+
try {
|
|
250
|
+
fs.unlinkSync(lockPath);
|
|
251
|
+
} catch {
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function isAutoUpdaterDisabled() {
|
|
256
|
+
if (process.env.NODE_ENV === "development") return "development build";
|
|
257
|
+
if (isEnvTruthy(process.env.DISABLE_AUTOUPDATER)) return "DISABLE_AUTOUPDATER set";
|
|
258
|
+
if (readAutoUpdatesFlagFromDisk() === false) return "settings.autoUpdates = false";
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
function readAutoUpdatesFlagFromDisk() {
|
|
262
|
+
const path = join(userHome(), ".code-shell", "settings.json");
|
|
263
|
+
try {
|
|
264
|
+
const raw = readFileSync(path, "utf8");
|
|
265
|
+
const parsed = JSON.parse(raw);
|
|
266
|
+
if (typeof parsed.autoUpdates === "boolean") return parsed.autoUpdates;
|
|
267
|
+
} catch {
|
|
268
|
+
}
|
|
269
|
+
return void 0;
|
|
270
|
+
}
|
|
271
|
+
function isEnvTruthy(v) {
|
|
272
|
+
if (!v) return false;
|
|
273
|
+
const lower = v.toLowerCase();
|
|
274
|
+
return lower === "1" || lower === "true" || lower === "yes" || lower === "on";
|
|
275
|
+
}
|
|
276
|
+
function errnoCode(err) {
|
|
277
|
+
return typeof err === "object" && err !== null && "code" in err ? String(err.code) : void 0;
|
|
278
|
+
}
|
|
279
|
+
function isENOENT(err) {
|
|
280
|
+
return errnoCode(err) === "ENOENT";
|
|
281
|
+
}
|
|
282
|
+
function shellEscape(s) {
|
|
283
|
+
return `'${s.replace(/'/g, `'\\''`)}'`;
|
|
284
|
+
}
|
|
285
|
+
var __internal = { acquireLock, releaseLock, getLockFilePath };
|
|
286
|
+
|
|
287
|
+
export {
|
|
288
|
+
checkForUpdate,
|
|
289
|
+
getUpdateAvailable,
|
|
290
|
+
getAutoUpdateDisabledReason,
|
|
291
|
+
scheduleAutoInstallOnExit,
|
|
292
|
+
getCurrentVersion,
|
|
293
|
+
__internal
|
|
294
|
+
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7EG3V4JYcjs = require('./chunk-7EG3V4JY.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunk2YW4FPFGcjs = require('./chunk-2YW4FPFG.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkIK4EWJBPcjs = require('./chunk-IK4EWJBP.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkKS3RYAYLcjs = require('./chunk-KS3RYAYL.cjs');
|
|
15
15
|
|
|
16
16
|
// src/llm/providers/openai.ts
|
|
17
|
-
|
|
17
|
+
_chunkKS3RYAYLcjs.init_cjs_shims.call(void 0, );
|
|
18
18
|
var _openai = require('openai'); var _openai2 = _interopRequireDefault(_openai);
|
|
19
|
-
var OpenAIClient = (_class = class extends
|
|
19
|
+
var OpenAIClient = (_class = class extends _chunk7EG3V4JYcjs.LLMClientBase {
|
|
20
20
|
__init() {this._client = null}
|
|
21
21
|
constructor(config) {
|
|
22
22
|
super(config);_class.prototype.__init.call(this);;
|
|
@@ -37,7 +37,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
|
|
|
37
37
|
return this.withRetry(async () => {
|
|
38
38
|
const messages = this.buildMessages(options.systemPrompt, options.messages);
|
|
39
39
|
const tools = _optionalChain([options, 'access', _ => _.tools, 'optionalAccess', _2 => _2.length]) ? this.convertTools(options.tools) : void 0;
|
|
40
|
-
const span =
|
|
40
|
+
const span = _chunkIK4EWJBPcjs.logger.span("llm.request", {
|
|
41
41
|
cat: "llm",
|
|
42
42
|
provider: this.provider,
|
|
43
43
|
model: this.model,
|
|
@@ -74,13 +74,13 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
|
|
|
74
74
|
{ signal: options.signal }
|
|
75
75
|
);
|
|
76
76
|
const choice = response.choices[0];
|
|
77
|
-
if (!choice) throw new (0,
|
|
77
|
+
if (!choice) throw new (0, _chunk2YW4FPFGcjs.LLMError)("No response from OpenAI", "openai");
|
|
78
78
|
const usage = {
|
|
79
79
|
promptTokens: _nullishCoalesce(_optionalChain([response, 'access', _12 => _12.usage, 'optionalAccess', _13 => _13.prompt_tokens]), () => ( 0)),
|
|
80
80
|
completionTokens: _nullishCoalesce(_optionalChain([response, 'access', _14 => _14.usage, 'optionalAccess', _15 => _15.completion_tokens]), () => ( 0)),
|
|
81
81
|
totalTokens: _nullishCoalesce(_optionalChain([response, 'access', _16 => _16.usage, 'optionalAccess', _17 => _17.total_tokens]), () => ( 0))
|
|
82
82
|
};
|
|
83
|
-
this.recordUsage(usage);
|
|
83
|
+
this.recordUsage(usage, options);
|
|
84
84
|
return this.processChoice(choice, usage);
|
|
85
85
|
} catch (err) {
|
|
86
86
|
this.handleApiError(err);
|
|
@@ -120,7 +120,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
|
|
|
120
120
|
if (delta.content) {
|
|
121
121
|
if (!firstByteLogged) {
|
|
122
122
|
firstByteLogged = true;
|
|
123
|
-
|
|
123
|
+
_chunkIK4EWJBPcjs.logger.debug("llm.first_byte", {
|
|
124
124
|
cat: "llm",
|
|
125
125
|
provider: this.provider,
|
|
126
126
|
model: this.model,
|
|
@@ -176,7 +176,7 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
|
|
|
176
176
|
completionTokens: _nullishCoalesce(_optionalChain([streamUsage, 'optionalAccess', _41 => _41.completion_tokens]), () => ( 0)),
|
|
177
177
|
totalTokens: _nullishCoalesce(_optionalChain([streamUsage, 'optionalAccess', _42 => _42.total_tokens]), () => ( 0))
|
|
178
178
|
};
|
|
179
|
-
this.recordUsage(usage);
|
|
179
|
+
this.recordUsage(usage, options);
|
|
180
180
|
return {
|
|
181
181
|
text,
|
|
182
182
|
toolCalls,
|
|
@@ -309,20 +309,20 @@ var OpenAIClient = (_class = class extends _chunkGZBD6QRScjs.LLMClientBase {
|
|
|
309
309
|
handleApiError(err) {
|
|
310
310
|
if (err instanceof _openai2.default.APIError) {
|
|
311
311
|
if (err.status === 429) {
|
|
312
|
-
throw new (0,
|
|
312
|
+
throw new (0, _chunk2YW4FPFGcjs.LLMRateLimitError)("openai");
|
|
313
313
|
}
|
|
314
314
|
const msg = (_nullishCoalesce(err.message, () => ( ""))).toLowerCase();
|
|
315
315
|
if (msg.includes("context_length_exceeded") || msg.includes("maximum context length") || msg.includes("too many tokens") || msg.includes("prompt is too long")) {
|
|
316
|
-
throw new (0,
|
|
316
|
+
throw new (0, _chunk2YW4FPFGcjs.ContextLimitError)("openai");
|
|
317
317
|
}
|
|
318
318
|
if (err.status === 401 && msg.includes("provider returned error")) {
|
|
319
|
-
throw new (0,
|
|
319
|
+
throw new (0, _chunk2YW4FPFGcjs.LLMError)(
|
|
320
320
|
`OpenAI-compatible endpoint returned 401 "Provider returned error". Two likely causes: (1) the API key is invalid/revoked, or (2) the upstream provider rejects tool calls for this model (common on OpenRouter's gpt-4o-mini route). Verify the key, then try a tool-capable model such as openai/gpt-4.1-mini or anthropic/claude-3.5-haiku.`,
|
|
321
321
|
"openai",
|
|
322
322
|
{ status: err.status }
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
|
-
throw new (0,
|
|
325
|
+
throw new (0, _chunk2YW4FPFGcjs.LLMError)(`OpenAI API error: ${err.message}`, "openai", { status: err.status });
|
|
326
326
|
}
|
|
327
327
|
throw err;
|
|
328
328
|
}
|
|
@@ -11,9 +11,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
11
11
|
var __esm = (fn, res) => function __init() {
|
|
12
12
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
13
|
};
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
-
};
|
|
17
14
|
var __export = (target, all) => {
|
|
18
15
|
for (var name in all)
|
|
19
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -29,9 +26,12 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
29
26
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
27
|
|
|
31
28
|
// node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js
|
|
29
|
+
var getImportMetaUrl, importMetaUrl;
|
|
32
30
|
var init_cjs_shims = __esm({
|
|
33
31
|
"node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/cjs_shims.js"() {
|
|
34
32
|
"use strict";
|
|
33
|
+
getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.tagName.toUpperCase() === "SCRIPT" ? document.currentScript.src : new URL("main.js", document.baseURI).href;
|
|
34
|
+
importMetaUrl = exports.importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
|
|
@@ -42,4 +42,4 @@ var init_cjs_shims = __esm({
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
exports.__require = __require; exports.__esm = __esm; exports.
|
|
45
|
+
exports.__require = __require; exports.__esm = __esm; exports.__export = __export; exports.__toCommonJS = __toCommonJS; exports.importMetaUrl = importMetaUrl; exports.init_cjs_shims = init_cjs_shims;
|
|
@@ -11,9 +11,6 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
11
11
|
var __esm = (fn, res) => function __init() {
|
|
12
12
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
13
13
|
};
|
|
14
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
15
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16
|
-
};
|
|
17
14
|
var __export = (target, all) => {
|
|
18
15
|
for (var name in all)
|
|
19
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -31,17 +28,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
28
|
// node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js
|
|
32
29
|
import path from "path";
|
|
33
30
|
import { fileURLToPath } from "url";
|
|
31
|
+
var getFilename, getDirname, __dirname, __filename;
|
|
34
32
|
var init_esm_shims = __esm({
|
|
35
33
|
"node_modules/.pnpm/tsup@8.5.1_postcss@8.5.8_typescript@5.9.3_yaml@2.8.2/node_modules/tsup/assets/esm_shims.js"() {
|
|
36
34
|
"use strict";
|
|
35
|
+
getFilename = () => fileURLToPath(import.meta.url);
|
|
36
|
+
getDirname = () => path.dirname(getFilename());
|
|
37
|
+
__dirname = /* @__PURE__ */ getDirname();
|
|
38
|
+
__filename = /* @__PURE__ */ getFilename();
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
41
|
|
|
40
42
|
export {
|
|
41
43
|
__require,
|
|
42
44
|
__esm,
|
|
43
|
-
__commonJS,
|
|
44
45
|
__export,
|
|
45
46
|
__toCommonJS,
|
|
47
|
+
__dirname,
|
|
48
|
+
__filename,
|
|
46
49
|
init_esm_shims
|
|
47
50
|
};
|