Skip to content

Commit 157b1ac

Browse files
Feat/1030 add dosage interface (#122)
* feat(sdk): 新增百炼资源用量查询接口 新增 listModelUsage / listToolUsage 对接 app-control usage.listModelUsage / usage.listToolUsage, 支持 workspace/agent/session 三种 scope 与毫秒级 time_range 交叉校验(session 禁止、其余必传), 公开 UsageScope、ModelUsagePage、ToolUsagePage 等类型;apps/server 暴露 POST /api/usage/models、 POST /api/usage/tools 并刷新 OpenAPI 快照与 webui 生成类型。REST 映射已与 usage 契约方确认为 AgentStudio 资源风格,公网环境启用端点后即通。附 changeset 触发 @openagentpack/sdk minor 版本。 * fix: 修复 minimatch 传递依赖漏洞 webui 经 openapi-typescript / @redocly/openapi-core 引入 minimatch<11.0.1 (GHSA-g3hv-75wg-m249,moderate,globparts 放大 DoS),root overrides 强制 11.0.3, bun.lock 同步重解析;openapi-typescript 生成回归与全量测试通过。 * ci: 统一 CI bun 版本至 1.4.4 bun.lock 由 bun 1.4.4 生成,CI 的 1.3.5 消费新格式 lock 在冷缓存 runner 上 连续两次挂起在 Install dependencies(本地 1.3.5/1.4.4 均可正常安装)。 统一全部 workflow 的 bun 至 1.4.4,与 lock 生成版本一致,audit/install 均已在该版本本地验证。 * fix: 恢复 bun.lock 为默认官方 registry 并锁定 biome 版本 此前在本机重新解析依赖时,本机 npm 配置的公司内网镜像地址(registry.anpm.alibaba-inc.com) 被写入 bun.lock 的 492 个 tarball URL,GitHub runner 公网环境无法访问,导致发布流水线 Install dependencies 无限挂起。用官方 registry 重新生成 lock(恢复默认源的紧凑格式,与 历史成功发布一致),依赖版本顺带升级至最新修复线(zod 4.6.7 / hono 4.13.16 / @hono/node-server 2.1.5 / vite 8.3.5);@biomejs/biome 重解析到 2.6.4 后二进制在 macOS 上执行即被 SIGKILL,直接依赖声明锁定 2.5.3。CI 同款 bun 1.3.5/1.4.4 验证 audit 归零、全量测试通过。 * fix(cli): 适配 @clack/prompts 1.8 的 isCancel 类型签名 依赖重解析后 @clack/prompts 1.5.1→1.8.1,isCancel 谓词不再把 string | symbol 收窄为 string,init 命令的 provider 传入 parseProvider 报 TS2345。取消分支已提前退出,显式断言 string,运行时行为不变。 全 workspace typecheck 与 cli 测试通过。 * fix(repo): 修复用量查询配置和工具链兼容性 * test(sdk): 隔离版本测试的 Git hook 环境 --------- Co-authored-by: 悟扬 <car534511@alibaba-inc.com>
1 parent 9025f32 commit 157b1ac

30 files changed

Lines changed: 1815 additions & 165 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openagentpack/sdk": minor
3+
---
4+
5+
新增百炼资源用量查询:`listModelUsage` / `listToolUsage` 对接 app-control `usage.listModelUsage` / `usage.listToolUsage`,支持 workspace/agent/session 三种 scope、毫秒级 time_range 交叉校验(session 禁止、其余必传)、来源与名称过滤及分页排序,并公开 `UsageScope`、`ModelUsagePage`、`ToolUsagePage` 等类型。apps/server 同步暴露 `POST /api/usage/models`、`POST /api/usage/tools` 并刷新 OpenAPI 快照。

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
fetch-depth: 0
2626
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
2727
with:
28-
bun-version: "1.3.5"
28+
bun-version: "1.4.4"
2929
- id: profile
3030
name: Read full profile from the verification module
3131
run: echo "steps=$(bun scripts/verify.ts full --list-steps)" >> "$GITHUB_OUTPUT"
@@ -44,7 +44,7 @@ jobs:
4444
fetch-depth: 0
4545
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
4646
with:
47-
bun-version: "1.3.5"
47+
bun-version: "1.4.4"
4848
- run: bun install --frozen-lockfile
4949
- name: Run verification step
5050
env:
@@ -73,7 +73,7 @@ jobs:
7373
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
7474
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
7575
with:
76-
bun-version: "1.3.5"
76+
bun-version: "1.4.4"
7777
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
7878
with:
7979
node-version: ${{ matrix.node }}

‎.github/workflows/compatibility-canary.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
2525
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
2626
with:
27-
bun-version: "1.3.5"
27+
bun-version: "1.4.4"
2828
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
2929
with:
3030
node-version: "26"

‎.github/workflows/release-pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
2323
with:
24-
bun-version: "1.3.5"
24+
bun-version: "1.4.4"
2525

2626
- name: Install dependencies
2727
run: bun install --frozen-lockfile

‎.github/workflows/release.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343

4444
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
4545
with:
46-
bun-version: "1.3.5"
46+
bun-version: "1.4.4"
4747

4848
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
4949
with:
@@ -91,7 +91,7 @@ jobs:
9191

9292
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
9393
with:
94-
bun-version: "1.3.5"
94+
bun-version: "1.4.4"
9595

9696
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
9797
with:
@@ -145,7 +145,7 @@ jobs:
145145
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
146146
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
147147
with:
148-
bun-version: "1.3.5"
148+
bun-version: "1.4.4"
149149
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
150150
with:
151151
node-version: "24"
@@ -169,7 +169,7 @@ jobs:
169169
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
170170
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
171171
with:
172-
bun-version: "1.3.5"
172+
bun-version: "1.4.4"
173173
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
174174
with:
175175
node-version: ${{ matrix.node }}

0 commit comments

Comments
 (0)