GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #337 from modelstudioai/feat/rename-call-source · modelstudioai/cli@58789db

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • docs/agents
    • telemetry-change.md
  • packages
    • cli/tests/e2e
      • registry.smoke.e2e.test.ts
    • core
      • src
        • config
          • loader.ts
          • schema.ts
        • telemetry
          • caller.ts
          • event.ts
          • tracker.ts
        • types
          • command.ts
      • tests
        • config-priority.test.ts
        • telemetry-caller.test.ts
        • telemetry-tracker.test.ts
  • skills
    • bailian-cli/reference
      • index.md
    • bailian-finetune/reference
      • index.md
    • bailian-gen/reference
      • index.md
    • bailian-knowledge/reference
      • knowledge.md
      • kscli.md
    • bailian-managed-agent/reference
      • index.md
    • bailian-memory/reference
      • index.md
    • bailian-sandbox/reference
      • index.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and
1010

1111
### Added
1212

13-
- **Global `--biz-source` flag**: All commands accept `--biz-source <source>` so callers (skills/agents/products) can declare their business source. The normalized label is reported to AEM as a dedicated flat column `c6` (plus `ext`), enabling per-source PV/UV analysis of command usage (e.g. `flow-agent`). Absent → omitted; blank/invalid → `unknown`.
13+
- **Global `--biz-from` flag**: All commands accept `--biz-from <source>` so callers (skills/agents/products) can declare their business source, enabling per-source usage analysis (PV/UV) of command calls (e.g. `flow-agent`).
1414

1515
## [2.10.5] - 2026-11-23
1616

Collapse file

‎CHANGELOG.zh.md‎

Copy file name to clipboardExpand all lines: CHANGELOG.zh.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
### 新增
1212

13-
- **全局 `--biz-source` 参数**:所有命令支持 `--biz-source <source>`,调用方(skill/agent/产品)可声明业务来源。归一化后的来源上报到 AEM 专用扁平列 `c6`(及 `ext`),支持按来源统计命令调用(如 `flow-agent`)的 PV/UV。缺省省略;空白/非法 → `unknown`。
13+
- **全局 `--biz-from` 参数**:所有命令支持 `--biz-from <source>`,调用方(skill/agent/产品)可声明业务来源,便于按来源统计命令调用(如 `flow-agent`)的 PV/UV。
1414

1515
## [2.10.5] - 2026-11-23
1616

Collapse file

‎docs/agents/telemetry-change.md‎

Copy file name to clipboardExpand all lines: docs/agents/telemetry-change.md
+3-3Lines changed: 3 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ source-config 只用于百炼 / DashScope API 侧消费,不发送到通用网
9999
- `authMethod`
100100
- `callerType`(必填:`agent` | `script` | `unknown`)
101101
- `callerName`:`agent` 与 `script` 时发送(缺省/非法 → `"unknown"`);`skillName` / `skillVersion` 仅 `agent` 时可选发送
102-
- `bizSource`:全局 `--biz-source` 声明的业务来源(可选);经 `normalizeBizSource` 归一化(缺省省略,空白/非法 → `"unknown"`),与 `callerName` 独立;映射到 AEM `c6` 专用扁平列
102+
- `bizFrom`:全局 `--biz-from` 声明的业务来源(可选);经 `normalizeBizFrom` 归一化(缺省省略,空白/非法 → `"unknown"`),与 `callerName` 独立;映射到 AEM `c6` 专用扁平列
103103
- 失败时的 `errorMessage`、`exitCode`、`httpStatus`、`requestId`
104104
- 安全 allowlist 过滤后的 `params`
105105

106-
`bizSource` 是调用方(skill/agent/产品)通过全局 `--biz-source` 主动声明的来源标签,用于按来源区分命令调用的 PV/UV。它走 `GLOBAL_FLAGS` → `buildSettings` → `settings.bizSource` → `trackCommandExecution` 读取,不经命令自有 flag,也不进 `PARAM_ALLOWLIST`(c1)。归一化复用 caller 的 `NAME_PATTERN`(小写、空格/下划线转连字符, bounded charset)防 PII。AEM 侧除随 `ext` 上报外,另映射到专用扁平列 `c6`(标量字符串),无需 JSON 解析维度配置即可直接按 `c6` 筛选/分组:PV=事件计数,UV=distinct `uid`;按命令路径(如 `flow-agent *`)过滤即得某命令组的来源 PV/UV。`bizSource` 与 `callerType`/`callerName`(宿主归因)是独立维度,不得混用。
106+
`bizFrom` 是调用方(skill/agent/产品)通过全局 `--biz-from` 主动声明的来源标签,用于按来源区分命令调用的 PV/UV。它走 `GLOBAL_FLAGS` → `buildSettings` → `settings.bizFrom` → `trackCommandExecution` 读取,不经命令自有 flag,也不进 `PARAM_ALLOWLIST`(c1)。归一化复用 caller 的 `NAME_PATTERN`(小写、空格/下划线转连字符, bounded charset)防 PII。AEM 侧除随 `ext` 上报外,另映射到专用扁平列 `c6`(标量字符串),无需 JSON 解析维度配置即可直接按 `c6` 筛选/分组:PV=事件计数,UV=distinct `uid`;按命令路径(如 `flow-agent *`)过滤即得某命令组的来源 PV/UV。`bizFrom` 与 `callerType`/`callerName`(宿主归因)是独立维度,不得混用。
107107

108108
调用方归因只认本次进程的 `BAILIAN_CALLER_*`(由 `readCaller` 归一化后写入事件):
109109

@@ -158,7 +158,7 @@ AEM 映射:
158158
| `c3` | HTTP status |
159159
| `c4` | 错误文案,最多 500 字符 |
160160
| `c5` | request ID |
161-
| `c6` | `bizSource` 业务来源(全局 `--biz-source`,归一化标量;专用扁平列,直接筛选/分组) |
161+
| `c6` | `bizFrom` 业务来源(全局 `--biz-from`,归一化标量;专用扁平列,直接筛选/分组) |
162162

163163
远端发送是 best-effort,不得阻塞命令或改变退出码。正常退出最多等待 1 秒,SIGINT 最多等待 500 ms。
164164

Collapse file

‎packages/cli/tests/e2e/registry.smoke.e2e.test.ts‎

Copy file name to clipboardExpand all lines: packages/cli/tests/e2e/registry.smoke.e2e.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe("e2e: bl registry smoke", () => {
7070
expect(stderr).toMatch(/--console-region/);
7171
expect(stderr).toMatch(/--console-site/);
7272
expect(stderr).toMatch(/--console-switch-agent/);
73-
expect(stderr).toMatch(/--biz-source/);
73+
expect(stderr).toMatch(/--biz-from/);
7474
expect(stderr).not.toMatch(/^\s*--region\s/m);
7575
});
7676

Collapse file

‎packages/core/src/config/loader.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/config/loader.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,6 @@ export function buildSettings(s: ResolutionSources): Settings {
338338
consoleSwitchAgent: flags.consoleSwitchAgent || file.console_switch_agent || undefined,
339339
dryRun: flags.dryRun || false,
340340
telemetry: env.DO_NOT_TRACK === "1" ? false : (file.telemetry ?? true),
341-
bizSource: flags.bizSource ?? undefined,
341+
bizFrom: flags.bizFrom ?? undefined,
342342
};
343343
}
Collapse file

‎packages/core/src/config/schema.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/config/schema.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,6 @@ export interface Settings {
253253
quiet: boolean;
254254
dryRun: boolean;
255255
telemetry: boolean;
256-
/** Per-invocation business source label (--biz-source) for usage analytics; not persisted. */
257-
bizSource?: string;
256+
/** Per-invocation business source label (--biz-from) for usage analytics; not persisted. */
257+
bizFrom?: string;
258258
}
Collapse file

‎packages/core/src/telemetry/caller.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/telemetry/caller.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ function normalizeCallerName(raw: string | undefined): string {
3434
}
3535

3636
/**
37-
* Normalize a caller-declared business source label (--biz-source) to a stable id.
37+
* Normalize a caller-declared business source label (--biz-from) to a stable id.
3838
* Absent (undefined) stays undefined so the event omits the field; a present but
3939
* blank/invalid label falls back to `unknown`, mirroring callerName. Reuses the
4040
* caller name pattern to keep the value space bounded and free of PII.
4141
*/
42-
export function normalizeBizSource(raw: string | undefined): string | undefined {
42+
export function normalizeBizFrom(raw: string | undefined): string | undefined {
4343
return raw === undefined ? undefined : normalizeCallerName(raw);
4444
}
4545

Collapse file

‎packages/core/src/telemetry/event.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/telemetry/event.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface TrackingEvent {
2323
callerName?: string;
2424
skillName?: string;
2525
skillVersion?: string;
26-
/** Caller-declared business source (--biz-source), normalized; reported as AEM c6. */
27-
bizSource?: string;
26+
/** Caller-declared call source (--biz-from), normalized; reported as AEM c6. */
27+
bizFrom?: string;
2828
}
2929

3030
export function createTrackingEvent(opts: {
@@ -36,7 +36,7 @@ export function createTrackingEvent(opts: {
3636
authMethod?: AuthRequirement;
3737
params?: Record<string, unknown>;
3838
caller: CallerAttribution;
39-
bizSource?: string;
39+
bizFrom?: string;
4040
}): TrackingEvent {
4141
const event: TrackingEvent = {
4242
command: opts.command,
@@ -58,8 +58,8 @@ export function createTrackingEvent(opts: {
5858
event.callerName = opts.caller.callerName;
5959
}
6060

61-
if (opts.bizSource !== undefined) {
62-
event.bizSource = opts.bizSource;
61+
if (opts.bizFrom !== undefined) {
62+
event.bizFrom = opts.bizFrom;
6363
}
6464

6565
if (opts.authMethod) {
@@ -108,8 +108,8 @@ export function buildRemoteAemOptions(event: TrackingEvent): Record<string, unkn
108108
opts.c5 = event.requestId;
109109
}
110110
// Dedicated flat dimension column for the business source (easy AEM filtering).
111-
if (event.bizSource !== undefined) {
112-
opts.c6 = event.bizSource;
111+
if (event.bizFrom !== undefined) {
112+
opts.c6 = event.bizFrom;
113113
}
114114

115115
return opts;
Collapse file

‎packages/core/src/telemetry/tracker.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/telemetry/tracker.ts
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Identity, Settings } from "../config/schema.ts";
22
import { BailianError } from "../errors/base.ts";
33
import type { AuthRequirement } from "../types/command.ts";
4-
import { normalizeBizSource, type CallerAttribution } from "./caller.ts";
4+
import { normalizeBizFrom, type CallerAttribution } from "./caller.ts";
55
import { createTrackingEvent } from "./event.ts";
66
import { localSink, remoteSink } from "./sink.ts";
77

@@ -137,7 +137,7 @@ export async function trackCommandExecution(
137137
authMethod: deps.authMethod,
138138
params: extractParams(flags),
139139
caller: deps.caller,
140-
bizSource: normalizeBizSource(deps.settings.bizSource),
140+
bizFrom: normalizeBizFrom(deps.settings.bizFrom),
141141
});
142142

143143
// Fire-and-forget — never block the CLI exit or mask errors
Collapse file

‎packages/core/src/types/command.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/types/command.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const GLOBAL_FLAGS = {
114114
},
115115
// Caller-declared source for usage attribution. Skills/agents should pass their
116116
// own name when invoking commands so PV/UV can be segmented by calling skill/product.
117-
bizSource: {
117+
bizFrom: {
118118
type: "string",
119119
valueHint: "<source>",
120120
description: {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.