@carllee1983/dbcli 1.44.0 → 1.44.1
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/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/CHANGELOG.md +14 -0
- package/dist/agent-core.d.ts +7 -1
- package/dist/agent-core.mjs +14 -4
- package/dist/cli.mjs +596 -11291
- package/dist/core.mjs +12 -4
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/plugins/dbcli-agent/.codex-plugin/plugin.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to dbcli are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.44.1] - 2026-08-02 - `agent-core` 的 `loadEnvFile` 改用 node:fs,可在 Node 執行
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`loadEnvFile` 不再依賴 `Bun.file`。** `./agent-core` 存在的理由是給下游 agent CLI 共用,而那些工具不一定跑在 Bun 上;`loadEnvFile` 內部呼叫 `Bun.file()`,在 Node 下直接 `ReferenceError: Bun is not defined`,使整個匯出對第一個 Node 消費者(logq)不可用。改以 `node:fs/promises` 讀檔,解析與「不覆寫既有 `process.env`」的行為完全不變;檔案不存在仍拋 `ConfigError`。其餘五個匯出本來就沒有 runtime 相依,不受影響。
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Node runtime 契約測試。** 本 repo 的測試全部跑在 Bun 上,所以 agent-core 裡的 Bun-only 呼叫對它們是隱形的 —— 這正是這個 bug 得以發布的原因。新增的契約測試會 spawn 真正的 `node` 行程去 import 建置後的 `dist/agent-core.mjs`,逐一呼叫每個匯出。還原修正後此測試會失敗(已驗證),因此這個失敗模式不會再次出貨。
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **同步跨平台發版 metadata。** npm package、Codex/Claude/Cursor plugin、packaged Codex plugin 與 Gemini extension 統一為 `1.44.1`。
|
|
21
|
+
|
|
8
22
|
## [1.44.0] - 2026-08-02 - agent-core 補上錯誤型別與 env reference 型別
|
|
9
23
|
|
|
10
24
|
### Added
|
package/dist/agent-core.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Load a file into process.env without overwriting existing values.
|
|
5
|
+
*
|
|
6
|
+
* Uses `node:fs` rather than `Bun.file` on purpose: `agent-core` is the public
|
|
7
|
+
* surface downstream tools consume, and those tools do not necessarily run on
|
|
8
|
+
* Bun. A Bun-only builtin here makes the whole export unusable for them.
|
|
9
|
+
*/
|
|
4
10
|
export declare function loadEnvFile(filePath: string): Promise<void>;
|
|
5
11
|
export interface AppliedLimitMetadata {
|
|
6
12
|
/** True only when the caller fetched and removed an additional row. */
|
package/dist/agent-core.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
// src/agent-core/env-loader.ts
|
|
3
|
+
import { readFile } from "fs/promises";
|
|
4
|
+
|
|
2
5
|
// src/agent-core/errors.ts
|
|
3
6
|
class ConfigError extends Error {
|
|
4
7
|
constructor(message) {
|
|
@@ -30,10 +33,17 @@ function parseEnvContent(content) {
|
|
|
30
33
|
return entries;
|
|
31
34
|
}
|
|
32
35
|
async function loadEnvFile(filePath) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
let content;
|
|
37
|
+
try {
|
|
38
|
+
content = await readFile(filePath, "utf8");
|
|
39
|
+
} catch (cause) {
|
|
40
|
+
const code = cause.code;
|
|
41
|
+
if (code === "ENOENT" || code === "EISDIR") {
|
|
42
|
+
throw new ConfigError(`\u627E\u4E0D\u5230 env \u6A94\u6848\uFF1A${filePath}`);
|
|
43
|
+
}
|
|
44
|
+
throw cause;
|
|
45
|
+
}
|
|
46
|
+
for (const [key, value] of parseEnvContent(content)) {
|
|
37
47
|
if (process.env[key] === undefined)
|
|
38
48
|
process.env[key] = value;
|
|
39
49
|
}
|