@tencent-ai/agent-harness 0.2.0-beta.6 → 0.2.0-beta.7
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 +13 -0
- package/cli/CHANGELOG.md +49 -0
- package/cli/dist-server/shared.cjs +174 -173
- package/cli/dist-server/types/node/server/types.d.ts +8 -1
- package/cli/dist-server/types/vendor/cbc-core/node/agent/agent-protocol.d.ts +5 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/background-task-protocol.d.ts +14 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-protocol.d.ts +2 -2
- package/cli/dist-server/types/vendor/cbc-core/node/session/session-store.d.ts +13 -0
- package/cli/dist-server/types/vendor/cbc-core/node/session/truncation-recovery.d.ts +8 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/input-item-utils.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-core/node/utils/message-utils.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/index.d.ts +1 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/tools/tool-names.d.ts +2 -0
- package/cli/dist-server/types/vendor/cbc-shared/node/utils/concurrency-utils.d.ts +5 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/agent/agent-protocol.d.ts +5 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/background-task-protocol.d.ts +14 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-protocol.d.ts +2 -2
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/session-store.d.ts +13 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/session/truncation-recovery.d.ts +8 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/input-item-utils.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-core/lib/node/utils/message-utils.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/tools/tool-names.d.ts +2 -0
- package/cli/dist-server/types/workspace/cbc-shared/lib/node/utils/concurrency-utils.d.ts +5 -0
- package/cli/dist-server/types/workspace/product/lib/common/types/features.d.ts +34 -22
- package/cli/dist-server/types/workspace/product/lib/common/types/index.d.ts +1 -0
- package/cli/dist-server/types/workspace/product/lib/common/types/language-model.d.ts +5 -1
- package/cli/dist-server/types/workspace/product/lib/common/types/product.d.ts +7 -0
- package/cli/dist-server/types/workspace/product/lib/common/types/workspace-report.d.ts +119 -0
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +1 -1
- package/cli/product.internal.json +1 -1
- package/cli/product.ioa.json +1 -1
- package/cli/product.json +1 -1
- package/cli/product.selfhosted.json +1 -1
- package/docs/client.md +21 -0
- package/package.json +8 -8
|
@@ -142,7 +142,14 @@ export type QueryInput = string | unknown[] | {
|
|
|
142
142
|
readonly type: 'compact';
|
|
143
143
|
};
|
|
144
144
|
export interface QueryOptions {
|
|
145
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Opaque request metadata, captured for this query. The reserved W3C keys
|
|
147
|
+
* propagate through this request and its children using the turn context.
|
|
148
|
+
* Unknown extensions do not become session settings or arbitrary HTTP headers.
|
|
149
|
+
* `baggage: 'x-agent-intent=ask'` supplies attribution, not permissions.
|
|
150
|
+
* Host baggage and intent mapping are sent only to built-in model endpoints.
|
|
151
|
+
* The legacy `codebuddy.ai.mode` extension fills the scene only when baggage does not supply it.
|
|
152
|
+
*/
|
|
146
153
|
_meta?: Record<string, unknown> | null;
|
|
147
154
|
/**
|
|
148
155
|
* Working directory for the session. Defaults to process.cwd().
|
|
@@ -760,6 +760,11 @@ export interface AgentRunRequest<TContext = Session> extends SessionOptions {
|
|
|
760
760
|
skipAddHistory?: boolean;
|
|
761
761
|
bypassMessageQueue?: boolean;
|
|
762
762
|
inputOrigin?: AgentRunOrigin;
|
|
763
|
+
/**
|
|
764
|
+
* Whether the batch admitted by MessageQueue contains an external user prompt.
|
|
765
|
+
* Captured before History replaces input with the active conversation history.
|
|
766
|
+
*/
|
|
767
|
+
hasExternalUserPromptAtAdmission?: boolean;
|
|
763
768
|
/** Process-local arrival callback; never passed to the SDK. */
|
|
764
769
|
onResult?: AgentStandardRunOptions['onResult'];
|
|
765
770
|
traceId?: string;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import type { AcpTerminalEndReason } from '../../../cbc-shared/node/index.js';
|
|
2
|
+
export interface BackgroundTaskOutputRead {
|
|
3
|
+
/** Absolute character offset requested for this read, clamped to the current output range. */
|
|
4
|
+
fromOffset: number;
|
|
5
|
+
/** Absolute character offset immediately after the returned snapshot. */
|
|
6
|
+
nextOffset: number;
|
|
7
|
+
/** Preserved output for the requested range, including an omission marker when needed. */
|
|
8
|
+
content: string;
|
|
9
|
+
/** Unread characters no longer retained by the bounded buffer. */
|
|
10
|
+
omittedLength: number;
|
|
11
|
+
}
|
|
2
12
|
/** Output buffer capabilities used by task producers and consumers. */
|
|
3
13
|
export interface BackgroundTaskOutputBuffer {
|
|
4
14
|
push(data: string): void;
|
|
5
15
|
toString(withMarker?: boolean): string;
|
|
16
|
+
/** Absolute character offset at the current end of the output stream. */
|
|
17
|
+
getEndOffset(): number;
|
|
18
|
+
/** Read output retained after an absolute character offset. */
|
|
19
|
+
readSince(offset: number): BackgroundTaskOutputRead;
|
|
6
20
|
isEmpty(): boolean;
|
|
7
21
|
getHead(): string;
|
|
8
22
|
getTail(): string;
|
|
@@ -1062,13 +1062,13 @@ export interface SessionFactory {
|
|
|
1062
1062
|
/**
|
|
1063
1063
|
* 传给 SessionManager/SessionStore.get() 的选项。
|
|
1064
1064
|
*
|
|
1065
|
-
* 默认情况下,session
|
|
1065
|
+
* 默认情况下,session 反序列化会从尾部截断(仅读最近 ~1000 条历史),
|
|
1066
1066
|
* 目的是保证正常运行时(会话续聊、模型上下文装配)的性能与内存占用。
|
|
1067
1067
|
* 展示型场景(如历史回放给前端完整聊天视图)可以通过 `historyLimit` 放大上限。
|
|
1068
1068
|
*/
|
|
1069
1069
|
export interface SessionGetOptions {
|
|
1070
1070
|
/**
|
|
1071
|
-
* 从 jsonl
|
|
1071
|
+
* 从 jsonl 尾部加载的历史 item 数上限。
|
|
1072
1072
|
*
|
|
1073
1073
|
* - 未传:沿用默认 1000(服务于续聊、checkpoint、模型上下文等场景)。
|
|
1074
1074
|
* - 显式传值:按该值截断(如展示型 replay 传 10000)。
|
|
@@ -5,6 +5,12 @@ import { LocalJsonlSessionStore } from './local-jsonl-session-store';
|
|
|
5
5
|
import { type Session, SessionFactory, type SessionForkMutationOptions, type SessionGetOptions, type SessionRewindMutationOptions, SessionStore, type TranscriptPersistenceMetrics } from './session-protocol';
|
|
6
6
|
import type { Lane, LanePointer, SessionKey, SessionStoreEntry } from './session-store-contract';
|
|
7
7
|
import { SessionImageStorage as ImageBlobService, SessionRestoreHost, SessionStoragePaths, SessionToolOutputStorage as ToolResultBlobService } from './session-store-host-protocol';
|
|
8
|
+
/**
|
|
9
|
+
* Read transcript tails in moderately sized blocks. Small files naturally use
|
|
10
|
+
* one read, while large files stop as soon as the requested history window is
|
|
11
|
+
* complete instead of retaining the entire transcript in memory.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SESSION_REVERSE_READ_CHUNK_BYTES: number;
|
|
8
14
|
/**
|
|
9
15
|
* session/load 回放时 history 的默认最大条数。
|
|
10
16
|
* 达到此阈值且遇到 user message 时停止逆序读取,避免启动时全量读 JSONL。
|
|
@@ -291,6 +297,13 @@ export declare class SessionStoreImpl implements SessionStore {
|
|
|
291
297
|
*/
|
|
292
298
|
protected deserializeSessionFromPath(filePath: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
293
299
|
protected getSessionId(filePath: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Read complete UTF-8 JSONL records from newest to oldest with bounded I/O.
|
|
302
|
+
* Newline bytes are safe boundaries in UTF-8; a record is decoded only
|
|
303
|
+
* after all of its cross-chunk Buffer fragments have been assembled.
|
|
304
|
+
*/
|
|
305
|
+
protected readLinesFromEnd(filePath: string, fileSize: number, consumeLine: (line: string) => boolean): Promise<number>;
|
|
306
|
+
private decodeReverseLine;
|
|
294
307
|
private getPreferredProjectDirs;
|
|
295
308
|
get(id: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
296
309
|
getAcrossProjects(id: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
@@ -98,3 +98,11 @@ export declare function readTruncatedResponseUsage(lastTurnResponse: unknown): {
|
|
|
98
98
|
* 截断不该因为落在不同入口而收到不同指导。
|
|
99
99
|
*/
|
|
100
100
|
export declare function buildRecoveryPrompt(truncatedToolNames?: readonly string[]): string;
|
|
101
|
+
/**
|
|
102
|
+
* 包成 error-recovery system-reminder 后再注入。
|
|
103
|
+
*
|
|
104
|
+
* 裸文本会被 `UserQueryWrapperAgentRunInterceptor` 当成用户输入包进 `<user_query>`,
|
|
105
|
+
* 模型会把内部续写提示读成用户提问;包成带 data-role 的 reminder 后,它与
|
|
106
|
+
* `buildErrorRecoveryReminder` 等其他恢复提示同形,也不会被当成规则型 reminder。
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildTruncationRecoveryReminder(truncatedToolNames?: readonly string[]): string;
|
|
@@ -266,6 +266,7 @@ export declare abstract class InputItemUtils {
|
|
|
266
266
|
static isStructuredCompactBoundaryMessage(item: AgentInputItem): boolean;
|
|
267
267
|
static isReplayRecoverableCompactMessage(item: AgentInputItem): item is UserMessageItem;
|
|
268
268
|
static isCompactUserMessage(item: AgentInputItem): item is UserMessageItem;
|
|
269
|
+
static isCompactEnvelopeMessage(item: AgentInputItem): item is UserMessageItem;
|
|
269
270
|
private static hasCompactBoundaryContent;
|
|
270
271
|
static isCompactContinuePromptMessage(item: AgentInputItem): item is UserMessageItem;
|
|
271
272
|
private static hasTeammateMessageContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './agent/openai-agents-types';
|
|
2
2
|
export * from './agent-home/agent-home-envelope-body';
|
|
3
3
|
export * from './utils/abort-utils';
|
|
4
|
+
export * from './utils/concurrency-utils';
|
|
4
5
|
export * from './utils/retry-backoff';
|
|
5
6
|
export * from './utils/retry-policy';
|
|
6
7
|
export * from './settings/settings-types';
|
|
@@ -35,6 +35,8 @@ export declare enum ToolNames {
|
|
|
35
35
|
IMAGE_EDIT = "ImageEdit",
|
|
36
36
|
ARTIFACT = "Artifact",
|
|
37
37
|
ARTIFACT_CONTROL = "ArtifactControl",
|
|
38
|
+
/** 资料库上传:把本地单个文件上传为资料库节点。工具名按既有外部契约固定为下划线风格。 */
|
|
39
|
+
LIBRARY_UPLOAD = "LibraryUpload",
|
|
38
40
|
TEAM_CREATE = "TeamCreate",
|
|
39
41
|
TEAM_DELETE = "TeamDelete",
|
|
40
42
|
SEND_MESSAGE = "SendMessage",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map items with a bounded number of async workers while preserving input
|
|
3
|
+
* order in the returned results.
|
|
4
|
+
*/
|
|
5
|
+
export declare function mapWithConcurrency<T, R>(items: readonly T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -760,6 +760,11 @@ export interface AgentRunRequest<TContext = Session> extends SessionOptions {
|
|
|
760
760
|
skipAddHistory?: boolean;
|
|
761
761
|
bypassMessageQueue?: boolean;
|
|
762
762
|
inputOrigin?: AgentRunOrigin;
|
|
763
|
+
/**
|
|
764
|
+
* Whether the batch admitted by MessageQueue contains an external user prompt.
|
|
765
|
+
* Captured before History replaces input with the active conversation history.
|
|
766
|
+
*/
|
|
767
|
+
hasExternalUserPromptAtAdmission?: boolean;
|
|
763
768
|
/** Process-local arrival callback; never passed to the SDK. */
|
|
764
769
|
onResult?: AgentStandardRunOptions['onResult'];
|
|
765
770
|
traceId?: string;
|
package/cli/dist-server/types/workspace/cbc-core/lib/node/session/background-task-protocol.d.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import type { AcpTerminalEndReason } from '../../../../cbc-shared/lib/node/index.js';
|
|
2
|
+
export interface BackgroundTaskOutputRead {
|
|
3
|
+
/** Absolute character offset requested for this read, clamped to the current output range. */
|
|
4
|
+
fromOffset: number;
|
|
5
|
+
/** Absolute character offset immediately after the returned snapshot. */
|
|
6
|
+
nextOffset: number;
|
|
7
|
+
/** Preserved output for the requested range, including an omission marker when needed. */
|
|
8
|
+
content: string;
|
|
9
|
+
/** Unread characters no longer retained by the bounded buffer. */
|
|
10
|
+
omittedLength: number;
|
|
11
|
+
}
|
|
2
12
|
/** Output buffer capabilities used by task producers and consumers. */
|
|
3
13
|
export interface BackgroundTaskOutputBuffer {
|
|
4
14
|
push(data: string): void;
|
|
5
15
|
toString(withMarker?: boolean): string;
|
|
16
|
+
/** Absolute character offset at the current end of the output stream. */
|
|
17
|
+
getEndOffset(): number;
|
|
18
|
+
/** Read output retained after an absolute character offset. */
|
|
19
|
+
readSince(offset: number): BackgroundTaskOutputRead;
|
|
6
20
|
isEmpty(): boolean;
|
|
7
21
|
getHead(): string;
|
|
8
22
|
getTail(): string;
|
|
@@ -1062,13 +1062,13 @@ export interface SessionFactory {
|
|
|
1062
1062
|
/**
|
|
1063
1063
|
* 传给 SessionManager/SessionStore.get() 的选项。
|
|
1064
1064
|
*
|
|
1065
|
-
* 默认情况下,session
|
|
1065
|
+
* 默认情况下,session 反序列化会从尾部截断(仅读最近 ~1000 条历史),
|
|
1066
1066
|
* 目的是保证正常运行时(会话续聊、模型上下文装配)的性能与内存占用。
|
|
1067
1067
|
* 展示型场景(如历史回放给前端完整聊天视图)可以通过 `historyLimit` 放大上限。
|
|
1068
1068
|
*/
|
|
1069
1069
|
export interface SessionGetOptions {
|
|
1070
1070
|
/**
|
|
1071
|
-
* 从 jsonl
|
|
1071
|
+
* 从 jsonl 尾部加载的历史 item 数上限。
|
|
1072
1072
|
*
|
|
1073
1073
|
* - 未传:沿用默认 1000(服务于续聊、checkpoint、模型上下文等场景)。
|
|
1074
1074
|
* - 显式传值:按该值截断(如展示型 replay 传 10000)。
|
|
@@ -5,6 +5,12 @@ import { LocalJsonlSessionStore } from './local-jsonl-session-store.js';
|
|
|
5
5
|
import { type Session, SessionFactory, type SessionForkMutationOptions, type SessionGetOptions, type SessionRewindMutationOptions, SessionStore, type TranscriptPersistenceMetrics } from './session-protocol.js';
|
|
6
6
|
import type { Lane, LanePointer, SessionKey, SessionStoreEntry } from './session-store-contract.js';
|
|
7
7
|
import { SessionImageStorage as ImageBlobService, SessionRestoreHost, SessionStoragePaths, SessionToolOutputStorage as ToolResultBlobService } from './session-store-host-protocol.js';
|
|
8
|
+
/**
|
|
9
|
+
* Read transcript tails in moderately sized blocks. Small files naturally use
|
|
10
|
+
* one read, while large files stop as soon as the requested history window is
|
|
11
|
+
* complete instead of retaining the entire transcript in memory.
|
|
12
|
+
*/
|
|
13
|
+
export declare const SESSION_REVERSE_READ_CHUNK_BYTES: number;
|
|
8
14
|
/**
|
|
9
15
|
* session/load 回放时 history 的默认最大条数。
|
|
10
16
|
* 达到此阈值且遇到 user message 时停止逆序读取,避免启动时全量读 JSONL。
|
|
@@ -291,6 +297,13 @@ export declare class SessionStoreImpl implements SessionStore {
|
|
|
291
297
|
*/
|
|
292
298
|
protected deserializeSessionFromPath(filePath: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
293
299
|
protected getSessionId(filePath: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Read complete UTF-8 JSONL records from newest to oldest with bounded I/O.
|
|
302
|
+
* Newline bytes are safe boundaries in UTF-8; a record is decoded only
|
|
303
|
+
* after all of its cross-chunk Buffer fragments have been assembled.
|
|
304
|
+
*/
|
|
305
|
+
protected readLinesFromEnd(filePath: string, fileSize: number, consumeLine: (line: string) => boolean): Promise<number>;
|
|
306
|
+
private decodeReverseLine;
|
|
294
307
|
private getPreferredProjectDirs;
|
|
295
308
|
get(id: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
296
309
|
getAcrossProjects(id: string, options?: SessionGetOptions): Promise<Session | undefined>;
|
|
@@ -98,3 +98,11 @@ export declare function readTruncatedResponseUsage(lastTurnResponse: unknown): {
|
|
|
98
98
|
* 截断不该因为落在不同入口而收到不同指导。
|
|
99
99
|
*/
|
|
100
100
|
export declare function buildRecoveryPrompt(truncatedToolNames?: readonly string[]): string;
|
|
101
|
+
/**
|
|
102
|
+
* 包成 error-recovery system-reminder 后再注入。
|
|
103
|
+
*
|
|
104
|
+
* 裸文本会被 `UserQueryWrapperAgentRunInterceptor` 当成用户输入包进 `<user_query>`,
|
|
105
|
+
* 模型会把内部续写提示读成用户提问;包成带 data-role 的 reminder 后,它与
|
|
106
|
+
* `buildErrorRecoveryReminder` 等其他恢复提示同形,也不会被当成规则型 reminder。
|
|
107
|
+
*/
|
|
108
|
+
export declare function buildTruncationRecoveryReminder(truncatedToolNames?: readonly string[]): string;
|
|
@@ -266,6 +266,7 @@ export declare abstract class InputItemUtils {
|
|
|
266
266
|
static isStructuredCompactBoundaryMessage(item: AgentInputItem): boolean;
|
|
267
267
|
static isReplayRecoverableCompactMessage(item: AgentInputItem): item is UserMessageItem;
|
|
268
268
|
static isCompactUserMessage(item: AgentInputItem): item is UserMessageItem;
|
|
269
|
+
static isCompactEnvelopeMessage(item: AgentInputItem): item is UserMessageItem;
|
|
269
270
|
private static hasCompactBoundaryContent;
|
|
270
271
|
static isCompactContinuePromptMessage(item: AgentInputItem): item is UserMessageItem;
|
|
271
272
|
private static hasTeammateMessageContent;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './agent/openai-agents-types.js';
|
|
2
2
|
export * from './agent-home/agent-home-envelope-body.js';
|
|
3
3
|
export * from './utils/abort-utils.js';
|
|
4
|
+
export * from './utils/concurrency-utils.js';
|
|
4
5
|
export * from './utils/retry-backoff.js';
|
|
5
6
|
export * from './utils/retry-policy.js';
|
|
6
7
|
export * from './settings/settings-types.js';
|
|
@@ -35,6 +35,8 @@ export declare enum ToolNames {
|
|
|
35
35
|
IMAGE_EDIT = "ImageEdit",
|
|
36
36
|
ARTIFACT = "Artifact",
|
|
37
37
|
ARTIFACT_CONTROL = "ArtifactControl",
|
|
38
|
+
/** 资料库上传:把本地单个文件上传为资料库节点。工具名按既有外部契约固定为下划线风格。 */
|
|
39
|
+
LIBRARY_UPLOAD = "LibraryUpload",
|
|
38
40
|
TEAM_CREATE = "TeamCreate",
|
|
39
41
|
TEAM_DELETE = "TeamDelete",
|
|
40
42
|
SEND_MESSAGE = "SendMessage",
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map items with a bounded number of async workers while preserving input
|
|
3
|
+
* order in the returned results.
|
|
4
|
+
*/
|
|
5
|
+
export declare function mapWithConcurrency<T, R>(items: readonly T[], concurrency: number, mapper: (item: T, index: number) => Promise<R>): Promise<R[]>;
|
|
@@ -915,6 +915,12 @@ export declare enum ProductFeature {
|
|
|
915
915
|
* @default false
|
|
916
916
|
*/
|
|
917
917
|
Artifact = "Artifact",
|
|
918
|
+
/**
|
|
919
|
+
* 是否开启资料库上传(把本地单个文件上传为资料库节点)能力。
|
|
920
|
+
* 关闭时工具不注册,模型看不到;endpoint / 登录态等其它前置条件由工具自身再校验。
|
|
921
|
+
* @default false
|
|
922
|
+
*/
|
|
923
|
+
LibraryUpload = "LibraryUpload",
|
|
918
924
|
/**
|
|
919
925
|
* 是否开启 ShareLink(本地 HTML → 上传 → 可分享公网链接)能力
|
|
920
926
|
* @deprecated 兼容保留,请改用 Artifact key(新 key 优先,本 key 兜底)。
|
|
@@ -1095,21 +1101,10 @@ export declare enum ProductFeature {
|
|
|
1095
1101
|
*/
|
|
1096
1102
|
ConversationEngine = "ConversationEngine",
|
|
1097
1103
|
/**
|
|
1098
|
-
*
|
|
1099
|
-
* 设置为 true 时,启用 TencentDesignX 相关功能入口。
|
|
1100
|
-
*
|
|
1101
|
-
* 版本说明:5.4.0 之前的客户端版本仍使用 `TencentDesignX` 开关控制 Ardot 设计入口;
|
|
1102
|
-
* 5.4.0 版本之后 `TencentDesignX` 开关作废,改为使用 `EnableArdot` 开关控制 Ardot 设计入口。
|
|
1103
|
-
* @deprecated 新版客户端改用 `EnableArdot` 控制 Ardot 设计入口;本 key 不再参与门控,
|
|
1104
|
-
* 仅为兼容历史下发保留 enum 登记。
|
|
1105
|
-
* @default false
|
|
1106
|
-
*/
|
|
1107
|
-
TencentDesignX = "TencentDesignX",
|
|
1108
|
-
/**
|
|
1109
|
-
* Ardot 设计入口特性开关(unleash / product feature flag)。
|
|
1110
|
-
* 取代旧的 `TencentDesignX` 成为新版客户端 Ardot「设计创意」入口的唯一门控 key:
|
|
1104
|
+
* Ardot 族(画布设计)能力开关(unleash / product feature flag)。
|
|
1111
1105
|
* 客户端 product.json 写默认值,后端 `/v3/config` 下发覆盖。
|
|
1112
|
-
* 设置为 true
|
|
1106
|
+
* 设置为 true 时向设计会话暴露 ardot MCP(含其静默授权)、展示 Ardot 场景胶囊并自动注入 ardot skill;缺省 / false 关闭(opt-in)。
|
|
1107
|
+
* 「设计创意」Tab 不再由本开关决定:Miora 能力恒可用,Tab 始终展示。
|
|
1113
1108
|
* 各版本默认值:SaaS(个人版 / 旗舰版)= true;专享版 / 专享版私有化 / 海外版 = false。
|
|
1114
1109
|
*
|
|
1115
1110
|
* 版本说明:5.4.0 之前的客户端版本仍使用 `TencentDesignX` 开关控制 Ardot 设计入口;
|
|
@@ -1329,6 +1324,31 @@ export declare enum ProductFeature {
|
|
|
1329
1324
|
* @default false(未配置默认不启用云端专家能力)
|
|
1330
1325
|
*/
|
|
1331
1326
|
EnableExpertToCloud = "EnableExpertToCloud",
|
|
1327
|
+
/**
|
|
1328
|
+
* 客户端是否消费企业「专家页」装配布局(Issue #100136)。
|
|
1329
|
+
*
|
|
1330
|
+
* 开启后客户端专家页的三个区域(顶部推荐槽 / Tab 条 / 分类 chip 栏)
|
|
1331
|
+
* 按 admin 装配的布局渲染;关闭时全部回落客户端本地默认布局。
|
|
1332
|
+
*
|
|
1333
|
+
* 「专享版 / 私有化」的判定依据:该形态下 `enterpriseId` 可能为空或不可靠,
|
|
1334
|
+
* 仅靠 `enterpriseId` 判定会把专享版误判成个人版而丢失企业配置
|
|
1335
|
+
* (与 skill 侧 `EnableSkillPageLayout` 同款实测结论)。故本 flag 随
|
|
1336
|
+
* **专享版包**注入 true,客户端判定为:
|
|
1337
|
+
*
|
|
1338
|
+
* ```
|
|
1339
|
+
* 消费 layout = 本 flag === true
|
|
1340
|
+
* || (enterpriseId 存在 && !isTencentSSO(enterpriseId)) // 旗舰版
|
|
1341
|
+
* ```
|
|
1342
|
+
*
|
|
1343
|
+
* 只在 `build/patches/workbuddy-custom/product.json`(专享版)置 true,
|
|
1344
|
+
* **其余产品配置不写** —— 缺失即 false,判定回落到 enterpriseId 分支。
|
|
1345
|
+
*
|
|
1346
|
+
* ⚠️ 同一变量也决定 admin 侧是否展示「客户端页面装配 / 推荐位 / 分类管理」
|
|
1347
|
+
* 三个 Tab,两端共用同一源以避免判定漂移(对齐 skill 侧 §7.1.2 的结论)。
|
|
1348
|
+
*
|
|
1349
|
+
* @default false(缺省即关闭;仅专享版 product.json 置 true)
|
|
1350
|
+
*/
|
|
1351
|
+
EnableExpertPageLayout = "EnableExpertPageLayout",
|
|
1332
1352
|
/**
|
|
1333
1353
|
* 禁用对话框中的语音输入(ASR)入口
|
|
1334
1354
|
* 设置为 true 时,隐藏聊天输入框中的麦克风按钮,
|
|
@@ -1650,14 +1670,6 @@ export declare enum ProductFeature {
|
|
|
1650
1670
|
* @default false(未配置默认不启用云端 Skill 能力)
|
|
1651
1671
|
*/
|
|
1652
1672
|
EnableSkillToCloud = "EnableSkillToCloud",
|
|
1653
|
-
/**
|
|
1654
|
-
* 是否禁用侧边栏扩展菜单入口(disable 语义)。#114901
|
|
1655
|
-
* 设置为 true 时,侧边栏与「更多」下拉均不渲染扩展(extension)菜单入口。
|
|
1656
|
-
* 用于无需暴露扩展导航栏的发行版(如海外版 workbuddy-ai)。
|
|
1657
|
-
* 缺省 / false 时行为不变(正常展示扩展入口)。
|
|
1658
|
-
* @default false
|
|
1659
|
-
*/
|
|
1660
|
-
DisableExtensionMenuEntries = "DisableExtensionMenuEntries",
|
|
1661
1673
|
/**
|
|
1662
1674
|
* 是否禁用「存储扩容/升级」入口(disable 语义)。#73830 #73721
|
|
1663
1675
|
*
|
|
@@ -17,6 +17,7 @@ export * from './enhance-prompt.js';
|
|
|
17
17
|
export * from './config.js';
|
|
18
18
|
export * from './security-center.js';
|
|
19
19
|
export * from './ai-asset-security.js';
|
|
20
|
+
export * from './workspace-report.js';
|
|
20
21
|
export * from './updates.js';
|
|
21
22
|
export * from './log.js';
|
|
22
23
|
export * from './completion.js';
|
|
@@ -104,7 +104,11 @@ export interface ModelReasoning {
|
|
|
104
104
|
export type ModelPromotionKind = 'discount' | 'new_model' | 'recommendation' | 'free_trial';
|
|
105
105
|
export interface ModelPromotionBadge {
|
|
106
106
|
readonly label: string;
|
|
107
|
-
readonly
|
|
107
|
+
readonly shortLabel?: string;
|
|
108
|
+
readonly labelEn?: string;
|
|
109
|
+
readonly shortLabelEn?: string;
|
|
110
|
+
readonly icon?: string;
|
|
111
|
+
readonly color?: string;
|
|
108
112
|
readonly display?: 'always' | 'activeOnly';
|
|
109
113
|
}
|
|
110
114
|
export interface ModelPromotionDailyWindow {
|
|
@@ -28,6 +28,7 @@ import { Skill } from './skill.js';
|
|
|
28
28
|
import { TelemetryConfiguration } from './telemetry.js';
|
|
29
29
|
import { TokenUsageThresholds } from './token-usage-thresholds.js';
|
|
30
30
|
import { UpdatesConfiguration } from './updates.js';
|
|
31
|
+
import { WorkspaceReportConfig } from './workspace-report.js';
|
|
31
32
|
/**
|
|
32
33
|
* 输出样式配置
|
|
33
34
|
*/
|
|
@@ -165,6 +166,12 @@ export interface ProductConfiguration {
|
|
|
165
166
|
* 见 ai-asset-security.ts 的 RemoteAiAssetSecurity / resolveForbidHighRiskSkillInstall。
|
|
166
167
|
*/
|
|
167
168
|
aiAssetSecurity?: RemoteAiAssetSecurity;
|
|
169
|
+
/**
|
|
170
|
+
* 「Workspace 全量上报」阈值 / 过滤配置(issue #125146,需求 WB-TLM-WS-001 v1.1)。
|
|
171
|
+
* /v3/config 顶层下发,与 aiAssetSecurity / tokenUsageThresholds 同级。缺省关闭。
|
|
172
|
+
* 见 workspace-report.ts 的 WorkspaceReportConfig / resolveWorkspaceReportConfig。
|
|
173
|
+
*/
|
|
174
|
+
workspaceReport?: WorkspaceReportConfig;
|
|
168
175
|
/**
|
|
169
176
|
* TAB 实验配置拉取开关。
|
|
170
177
|
*
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 「Workspace 全量上报」阈值 / 过滤配置下发契约(issue #125146,需求 WB-TLM-WS-001 v1.1)。
|
|
3
|
+
*
|
|
4
|
+
* 放在 @genie/product 以便 workbuddy-server(daemon)与渲染层共用同一真值来源,
|
|
5
|
+
* 与 tokenUsageThresholds / aiAssetSecurity 的定位一致,挂在 /v3/config **顶层**。
|
|
6
|
+
*
|
|
7
|
+
* 设计取向:**全部字段可选**。远端不下发 / 下发脏值时,一律回落到 `resolveWorkspaceReportConfig()`
|
|
8
|
+
* 内置的 fail-safe 默认值(= PRD R4 定义的门限)。上报功能是旁路能力,配置读取绝不可抛错
|
|
9
|
+
* 打断对话链路——resolve 内部 try/catch 兜底成默认值。
|
|
10
|
+
*
|
|
11
|
+
* 降级判定(自上而下命中即停,全基于扫描统计,唯 ④ 需压缩后判定):
|
|
12
|
+
* ① fileCount > hardAbortFileCount → meta(停扫兜底防超大仓,仍产元数据)
|
|
13
|
+
* ② fileCount > maxFileCount 或 totalBytes > maxTotalBytes 或 超时 → meta(仅统计,不扫内容)
|
|
14
|
+
* ③ totalBytes > maxInputBytesForFull 或 fileCount > maxInputFileCountForFull → manifest(仅目录树)
|
|
15
|
+
* ④ full 打包后 产物 > maxOutputBytesForFull → manifest(回落,产物过大不带内容)
|
|
16
|
+
* 否则 → full(完整内容包 tar+zstd)
|
|
17
|
+
*
|
|
18
|
+
* size 与 fileCount 正交:size 挡「少量大文件」,count 挡「海量小文件」,两个门限都保留、都靠
|
|
19
|
+
* 扫描 stat 免费获得。v1.1 起 **SKIP 已并入 meta**:不再有「彻底不产元数据」的静默档,超大仓
|
|
20
|
+
* 命中 ① 时停扫并按 meta 上报停扫时的 fileCount(让服务端也能感知超大仓的存在)。
|
|
21
|
+
* full/manifest/meta 任一级别都产出一行元数据(客户端只负责采集/上传,不做去重)。
|
|
22
|
+
*/
|
|
23
|
+
/** 打包压缩相关配置。 */
|
|
24
|
+
export interface WorkspaceReportCompression {
|
|
25
|
+
/** zstd 压缩级别(1-22)。缺省 10。 */
|
|
26
|
+
zstdLevel?: number;
|
|
27
|
+
}
|
|
28
|
+
/** 采集缓存复用配置(R4:30 分钟内且顶层 mtime 未变则复用上次内容包)。 */
|
|
29
|
+
export interface WorkspaceReportCache {
|
|
30
|
+
/** 缓存有效期(毫秒)。缺省 30 分钟。 */
|
|
31
|
+
ttlMs?: number;
|
|
32
|
+
}
|
|
33
|
+
/** 过滤规则:与仓库 .gitignore 合并后喂给 `ignore` 包。 */
|
|
34
|
+
export interface WorkspaceReportFilter {
|
|
35
|
+
/**
|
|
36
|
+
* 额外排除的文件后缀(含点,如 ".log")。**缺省空、默认不过滤任何后缀**。
|
|
37
|
+
*
|
|
38
|
+
* 注意:刻意**不**内置媒体/二进制后缀黑名单。WorkBuddy 主要面向办公场景,pptx / docx / 视频 /
|
|
39
|
+
* 图片 / 各类二进制文档都是用户真实工作产物,**都需要上报**,绝不能默认过滤掉。
|
|
40
|
+
* 仅当远端出于特定分析需求显式下发时才按此清单排除,客户端不做任何内置类型裁剪。
|
|
41
|
+
*/
|
|
42
|
+
excludeSuffixes?: string[];
|
|
43
|
+
/** 额外的 ignore glob 规则(gitignore 语法)。缺省空。 */
|
|
44
|
+
extraIgnorePatterns?: string[];
|
|
45
|
+
}
|
|
46
|
+
/** /v3/config 顶层下发的「Workspace 全量上报」配置。全局生效。 */
|
|
47
|
+
export interface WorkspaceReportConfig {
|
|
48
|
+
/** 总开关。缺省 / 非 `true` 视为关闭(不采集、不上报),维持现网零开销。 */
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/** full 级别输入内容上限(字节)。超过降级为 manifest。缺省 200MB(客户端压缩成本瓶颈)。 */
|
|
51
|
+
maxInputBytesForFull?: number;
|
|
52
|
+
/** full 级别输入文件数上限。超过降级为 manifest(海量小文件也压不动)。缺省 20000。 */
|
|
53
|
+
maxInputFileCountForFull?: number;
|
|
54
|
+
/** full 级别打包产物上限(字节)。超过降级为 manifest。缺省 100MB(服务端可收 200MB,留半余量)。 */
|
|
55
|
+
maxOutputBytesForFull?: number;
|
|
56
|
+
/** meta 级别文件数门限。超过直接降级为 meta。缺省 100000。 */
|
|
57
|
+
maxFileCount?: number;
|
|
58
|
+
/** meta 级别总大小门限(字节)。超过直接降级为 meta。缺省 2GB。 */
|
|
59
|
+
maxTotalBytes?: number;
|
|
60
|
+
/** 超大仓兜底门限:文件数超过此值停止扫描,按 meta 上报停扫时的 fileCount(v1.1 起并入 meta,不再彻底静默)。缺省 500000。 */
|
|
61
|
+
hardAbortFileCount?: number;
|
|
62
|
+
/** 扫描超时(毫秒)。超时降级为 meta。缺省 10 秒。 */
|
|
63
|
+
scanTimeoutMs?: number;
|
|
64
|
+
/** base manifest 缓存的 LRU 容量上限(每 workspace 一条)。缺省 32。 */
|
|
65
|
+
workspaceBaseCacheMaxEntries?: number;
|
|
66
|
+
compression?: WorkspaceReportCompression;
|
|
67
|
+
cache?: WorkspaceReportCache;
|
|
68
|
+
filter?: WorkspaceReportFilter;
|
|
69
|
+
}
|
|
70
|
+
/** 解析后的配置(所有字段必存,供 daemon 直接消费)。 */
|
|
71
|
+
export interface ResolvedWorkspaceReportConfig {
|
|
72
|
+
enabled: boolean;
|
|
73
|
+
maxInputBytesForFull: number;
|
|
74
|
+
maxInputFileCountForFull: number;
|
|
75
|
+
maxOutputBytesForFull: number;
|
|
76
|
+
maxFileCount: number;
|
|
77
|
+
maxTotalBytes: number;
|
|
78
|
+
hardAbortFileCount: number;
|
|
79
|
+
scanTimeoutMs: number;
|
|
80
|
+
workspaceBaseCacheMaxEntries: number;
|
|
81
|
+
zstdLevel: number;
|
|
82
|
+
cacheTtlMs: number;
|
|
83
|
+
excludeSuffixes: string[];
|
|
84
|
+
extraIgnorePatterns: string[];
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 默认忽略清单(gitignore 语法,合并进 extraIgnorePatterns)。
|
|
88
|
+
*
|
|
89
|
+
* 只收录**确定为依赖 / 构建产物 / 工具缓存**的目录,避免误伤源码。参考本仓已实战的
|
|
90
|
+
* `packages/codebase/src/node/constants/file.ts` DEFAULT_IGNORE 裁剪而来。
|
|
91
|
+
*
|
|
92
|
+
* 刻意**不加**的高误伤项:`build/`(项目常把构建脚本放这)、`out/` `bin/` `obj/`(含义
|
|
93
|
+
* 因语言而异)、`vendor/`(Go modules 时代可能是显式 vendored 依赖)。远端可通过
|
|
94
|
+
* extraIgnorePatterns 追加,仓库 .gitignore 也照常生效。
|
|
95
|
+
*/
|
|
96
|
+
export declare const WORKSPACE_REPORT_DEFAULT_IGNORE: readonly string[];
|
|
97
|
+
/**
|
|
98
|
+
* 密钥 / 敏感文件 denylist(gitignore 语法)。
|
|
99
|
+
*
|
|
100
|
+
* **安全边界,与 {@link WORKSPACE_REPORT_DEFAULT_IGNORE} 分离**:默认忽略清单是「省体积」的
|
|
101
|
+
* 依赖/产物过滤,可被仓库 `.gitignore` 或远端 `extraIgnorePatterns` 用 `!` 取反覆盖;本 denylist
|
|
102
|
+
* 是「防外发」的密钥保护,由采集侧独立 matcher 判定,命中即排除——**不参与合并、不可被 `!`
|
|
103
|
+
* 取反、不受仓库 `.gitignore` 或远端配置影响**(BL-CLI-11 敏感信息外发须经统一策略、不得被替代
|
|
104
|
+
* 入口绕过;BL-CLI-13 最小必要)。命中的文件既不进内容包 tar,也不进 manifest 文件清单。
|
|
105
|
+
*
|
|
106
|
+
* 覆盖常见凭据形态:环境变量文件、私钥/证书、SSH 身份、云厂商与 K8s 凭据目录、包管理器 token。
|
|
107
|
+
* 采用宽匹配(如 `*.pem`)优先防漏,误伤真源码的概率极低(这些后缀/文件名本就不该是业务源码)。
|
|
108
|
+
*/
|
|
109
|
+
export declare const WORKSPACE_REPORT_SECRET_DENYLIST: readonly string[];
|
|
110
|
+
/** PRD R4 门限的 fail-safe 默认值。 */
|
|
111
|
+
export declare const WORKSPACE_REPORT_DEFAULTS: ResolvedWorkspaceReportConfig;
|
|
112
|
+
/**
|
|
113
|
+
* 解析「Workspace 全量上报」配置。
|
|
114
|
+
*
|
|
115
|
+
* 缺省 / 脏值一律回落默认值;`enabled` 只有显式 `true` 才开启(对齐 aiAssetSecurity
|
|
116
|
+
* 的 `=== true` 口径——上报是主动能力,缺省必须是关,绝不能因脏值凭空开启采集/上传)。
|
|
117
|
+
* 任何异常 fail-safe 到全默认(含 enabled=false),保证读配置永不打断对话链路。
|
|
118
|
+
*/
|
|
119
|
+
export declare function resolveWorkspaceReportConfig(product: unknown): ResolvedWorkspaceReportConfig;
|