mirror of
https://github.com/modelstudioai/cli.git
synced 2026-09-14 19:49:23 +08:00
d24104f7dc
包名 @ali/bailian-kb-dsh → bailian-kb-dsh(公开 npm):package.json name + cordis.patch.yml insert.name + tsdown PLUGIN_ID 三处同步(漏一处即 dsh 运行时崩)。 产物 lib/ → dist/(本仓 .gitignore 忽略 dist 不忽略 lib),连带 main/types/ exports/files/tsdown outDir 同步;.gitignore 补 *.tsbuildinfo。 依赖接 catalog(yaml/typescript/@types/node/vite-plus);测试导入 vitest → vite-plus/test(全仓统一约定,消掉唯一的 vitest 依赖漂移)。 tsconfig 拆三件套:tsconfig.json 纯类型检查覆盖 src+tests(供 oxlint 自动发现, 含 jsx/DOM),tsconfig.build.json 产出 node 半,tsconfig.web.json 隔离检查 web 半。 补齐 tests 从未被类型检查暴露的一处 partial 输入类型错误。 根 vite.config.ts 新增两条 override:web 半 no-restricted-imports 把 tsdown 构建期 的 bundle purity gate 提前到 lint 期;全包放开 _ 前缀的 no-unused-vars。 文档:新增 docs/agents/dsh-plugin.md,AGENTS.md 项目地图/版本锁步例外/分层边界/ 场景索引同步,packages.mjs 注释说明故意不进发布白名单。 格式化(单引号无分号 → 双引号加分号)由 pre-commit 的 vp check --fix 自动完成, 无法单独成 commit,一并纳入。 全仓 vp check 0 error;插件 13 文件 85 测试全绿;build + typecheck 通过。
25 lines
1008 B
TypeScript
25 lines
1008 B
TypeScript
import { describe, expect, it } from "vite-plus/test";
|
|
import { Config } from "../src/index.js";
|
|
|
|
describe("Config", () => {
|
|
it("applies defaults and accepts a pinned workspaceId", () => {
|
|
const resolved = new Config({ workspaceId: "ws-1" } as never);
|
|
expect(resolved.workspaceId).toBe("ws-1");
|
|
expect(resolved.endpointHost).toBe("cn-beijing.maas.aliyuncs.com");
|
|
expect(resolved.chatTimeoutMs).toBe(300_000);
|
|
expect(resolved.defaultRetrieveAgentId).toBeUndefined();
|
|
expect(resolved.defaultChatAgentId).toBeUndefined();
|
|
});
|
|
|
|
it("accepts a missing workspaceId (per-call credentials fallback)", () => {
|
|
const resolved = new Config({} as never);
|
|
expect(resolved.workspaceId).toBeUndefined();
|
|
expect(resolved.endpointHost).toBe("cn-beijing.maas.aliyuncs.com");
|
|
});
|
|
|
|
it("carries the bl-CLI seed ledger through validation", () => {
|
|
const resolved = new Config({ seededFields: ["apiKey"] } as never);
|
|
expect(resolved.seededFields).toEqual(["apiKey"]);
|
|
});
|
|
});
|