@blade-hq/agent-client 2608.0.8-beta.0 → 2608.0.8
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/README.md +26 -122
- package/dist/index.d.ts +7 -6
- package/dist/index.js +140 -179
- package/dist/index.js.map +1 -1
- package/dist/platform-endpoints.d.ts +14 -0
- package/dist/resources/auth.d.ts +0 -26
- package/dist/resources/models.d.ts +0 -22
- package/dist/resources/sessions.d.ts +3 -5
- package/dist/schemas/message-utils.d.ts +1 -11
- package/dist/schemas/session.d.ts +1 -18
- package/dist/session/agent-session.d.ts +1 -21
- package/dist/session/state.d.ts +1 -14
- package/dist/shared/projection/helpers.d.ts +0 -8
- package/package.json +1 -1
- package/public-api.md +34 -74
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PLATFORM_SERVICE_NAMES: readonly ["os", "hub", "agent", "oauth", "llmGateway", "gitea"];
|
|
2
|
+
export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number];
|
|
3
|
+
export interface PlatformEndpoints {
|
|
4
|
+
services: Partial<Record<PlatformServiceName, string>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const EMPTY_PLATFORM_ENDPOINTS: PlatformEndpoints;
|
|
7
|
+
export interface LoadPlatformEndpointsOptions {
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
fetchImpl?: typeof fetch;
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function parsePlatformEndpoints(value: unknown): PlatformEndpoints | null;
|
|
13
|
+
export declare function loadPlatformEndpoints(options?: LoadPlatformEndpointsOptions): Promise<PlatformEndpoints>;
|
|
14
|
+
export declare function resolveServiceUrl(endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string): string | null;
|
package/dist/resources/auth.d.ts
CHANGED
|
@@ -16,24 +16,6 @@ export interface ProvidersResponse {
|
|
|
16
16
|
}>;
|
|
17
17
|
password_enabled: boolean;
|
|
18
18
|
}
|
|
19
|
-
export interface ExchangeCodeParams {
|
|
20
|
-
/** 授权回调页 postMessage 回来的一次性 code。 */
|
|
21
|
-
code: string;
|
|
22
|
-
/** 发起授权时用的 state,必须原样传回。 */
|
|
23
|
-
state: string;
|
|
24
|
-
/** 发起授权的页面 origin,要和 authorize 时传的 `client_origin` 完全一致。 */
|
|
25
|
-
clientOrigin: string;
|
|
26
|
-
}
|
|
27
|
-
export interface ExchangeCodeResult {
|
|
28
|
-
access_token: string;
|
|
29
|
-
token_type: string;
|
|
30
|
-
user: {
|
|
31
|
-
id: string;
|
|
32
|
-
username: string;
|
|
33
|
-
display_name: string;
|
|
34
|
-
avatar_url: string | null;
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
19
|
export declare class AuthResource {
|
|
38
20
|
private client;
|
|
39
21
|
constructor(client: BladeClient);
|
|
@@ -42,14 +24,6 @@ export declare class AuthResource {
|
|
|
42
24
|
* 自动取得 PAT 并热挂载到当前 client。等价于 client.login()。
|
|
43
25
|
*/
|
|
44
26
|
login(options?: LoginOptions): Promise<LoginResult>;
|
|
45
|
-
/**
|
|
46
|
-
* 用一次性 code 换 PAT。给**服务端**用:浏览器把 code 交给你自己的后端,
|
|
47
|
-
* 后端换到的 PAT 不进浏览器。浏览器里直接用 `login()` 就够了。
|
|
48
|
-
*
|
|
49
|
-
* 服务端调用时会自己补上 `Origin` 头(浏览器会自动带,服务端不会,缺了
|
|
50
|
-
* 后端报 `missing_request_origin`)。
|
|
51
|
-
*/
|
|
52
|
-
exchangeCode(params: ExchangeCodeParams): Promise<ExchangeCodeResult>;
|
|
53
27
|
/** 清除 login() 存储的令牌。 */
|
|
54
28
|
logoutToken(): void;
|
|
55
29
|
getProviders(): Promise<ProvidersResponse>;
|
|
@@ -2,32 +2,10 @@ import type { BladeClient } from "../blade-client";
|
|
|
2
2
|
export interface ModelOption {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
5
|
-
/**
|
|
6
|
-
* 把这个模型发给 `baseUrl` 时该用的名字。`id` 是平台内部标识,接了多个模型服务时
|
|
7
|
-
* 形如 `provider-xxx::name`,直接发过去会被拒。不在 `baseUrl` 那个服务上的模型
|
|
8
|
-
* 这里是空串——自己做模型选择器时据此过滤。
|
|
9
|
-
*/
|
|
10
|
-
serviceModelId?: string;
|
|
11
5
|
}
|
|
12
6
|
export interface ModelCatalog {
|
|
13
7
|
default: string;
|
|
14
8
|
models: ModelOption[];
|
|
15
|
-
/**
|
|
16
|
-
* 平台默认模型服务的 OpenAI 兼容地址(Server ≥ 提供 `baseUrl` 的版本才有,否则为空)。
|
|
17
|
-
* 自建应用可以带用户的 PAT 直接调它,不必让用户自己填地址——网关端口各部署不同,
|
|
18
|
-
* 推算不出来。
|
|
19
|
-
*
|
|
20
|
-
* 这是**服务端视角**的地址:平台可能配的是 `http://127.0.0.1:30000/v1`,从自己后端
|
|
21
|
-
* 转发没问题,直接丢给浏览器就指向用户自己的机器了。默认形态是后端透传(密钥也不该
|
|
22
|
-
* 进浏览器),浏览器直连只适合这个地址对浏览器同样可达的场景。
|
|
23
|
-
*/
|
|
24
|
-
baseUrl?: string;
|
|
25
|
-
/**
|
|
26
|
-
* 直接调 `baseUrl` 时该用的默认模型名。**不要用 `default`**——那是平台内部标识,
|
|
27
|
-
* 平台默认模型来自额外接的模型服务时它带 `provider-xxx::` 前缀,发过去只会得到
|
|
28
|
-
* 「模型不存在」。没有可直调的模型时为空串。
|
|
29
|
-
*/
|
|
30
|
-
defaultServiceModel?: string;
|
|
31
9
|
}
|
|
32
10
|
/** Server 可供当前用户选择的模型目录。 */
|
|
33
11
|
export declare class ModelsResource {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BackgroundTask, BackgroundTaskStopResult } from "../schemas/background";
|
|
2
2
|
import type { TurnProjection } from "../schemas/projection";
|
|
3
|
-
import type { PublishedSolutionRef,
|
|
3
|
+
import type { PublishedSolutionRef, SessionDetail, SessionInfo, TemplateId } from "../schemas/session";
|
|
4
4
|
import type { Task } from "../schemas/task";
|
|
5
5
|
import type { BladeClient, UploadProgress } from "../blade-client";
|
|
6
6
|
import type { AgentSession } from "../session/agent-session";
|
|
@@ -203,17 +203,15 @@ export declare class SessionsResource {
|
|
|
203
203
|
}): Promise<SessionDetail>;
|
|
204
204
|
setSessionEnv(sessionId: string, env: Record<string, string>): Promise<SessionDetail>;
|
|
205
205
|
pinSession(sessionId: string, pinned: boolean): Promise<SessionInfo>;
|
|
206
|
-
startReplaySession(sourceSessionId: string, speed?:
|
|
206
|
+
startReplaySession(sourceSessionId: string, speed?: 1 | 2 | 5): Promise<{
|
|
207
207
|
session_id: string;
|
|
208
208
|
}>;
|
|
209
209
|
updateReplaySession(sessionId: string, payload: {
|
|
210
|
-
speed?:
|
|
210
|
+
speed?: 1 | 2 | 5;
|
|
211
211
|
status?: "autonomous";
|
|
212
212
|
}): Promise<{
|
|
213
213
|
replay_state: SessionInfo["replay_state"];
|
|
214
214
|
}>;
|
|
215
|
-
/** 查询会话能否作为回放来源;不支持时 reason 可直接展示,用来提前禁用入口。 */
|
|
216
|
-
getReplayPreview(sessionId: string): Promise<ReplayPreview>;
|
|
217
215
|
updateSharing(sessionId: string, shared: boolean): Promise<{
|
|
218
216
|
shared: boolean;
|
|
219
217
|
}>;
|
|
@@ -12,21 +12,11 @@ export declare function buildMessageContent(text: string, attachments: Array<{
|
|
|
12
12
|
mimeType?: string;
|
|
13
13
|
}>): MessageContent;
|
|
14
14
|
export declare function contentPreview(content: MessageContent, maxLen?: number): string;
|
|
15
|
-
/** `/` 选中的技能当前处于什么状态,决定智能体要不要先装、先加载。 */
|
|
16
|
-
export interface SkillMentionAvailability {
|
|
17
|
-
/** 本地已有(内置 / 技能目录 / 会话已加载),直接可用。 */
|
|
18
|
-
local?: boolean;
|
|
19
|
-
/** Blade Hub 上该账号是否已安装。本地技能恒为 true。 */
|
|
20
|
-
installed?: boolean;
|
|
21
|
-
}
|
|
22
15
|
/**
|
|
23
16
|
* Transform a skill mention into a natural language skill invocation.
|
|
24
17
|
* Strips the `<skill>name</skill>` tag from the raw input and prepends the instruction.
|
|
25
|
-
*
|
|
26
|
-
* Hub 技能装没装、加载没加载,用户不需要知道,但智能体需要——所以把状态翻译
|
|
27
|
-
* 成它能直接照做的 CLI 步骤。不传 availability 时按本地技能处理,与旧行为一致。
|
|
28
18
|
*/
|
|
29
|
-
export declare function transformSlashCommand(skillName: string, rawInput: string
|
|
19
|
+
export declare function transformSlashCommand(skillName: string, rawInput: string): string;
|
|
30
20
|
export interface ParsedTextAttachment {
|
|
31
21
|
name: string;
|
|
32
22
|
uploadedPath?: string;
|
|
@@ -12,31 +12,14 @@ export type PublishedSolutionRef = {
|
|
|
12
12
|
org: string;
|
|
13
13
|
name: string;
|
|
14
14
|
};
|
|
15
|
-
/** 回放时录制内容的播放倍速。 */
|
|
16
|
-
export type ReplaySpeed = 1 | 2 | 5;
|
|
17
|
-
/**
|
|
18
|
-
* 新建回放会话时的默认倍速。
|
|
19
|
-
*
|
|
20
|
-
* 所有创建入口都用它——曾经侧栏走 API 默认 5x、设置菜单初始化成 1x,
|
|
21
|
-
* 同一个源对话从不同入口开出来速度不一样。
|
|
22
|
-
*/
|
|
23
|
-
export declare const DEFAULT_REPLAY_SPEED: ReplaySpeed;
|
|
24
15
|
export interface ReplayState {
|
|
25
16
|
source_session_id?: string;
|
|
26
17
|
status?: "replay" | "autonomous";
|
|
27
|
-
speed?:
|
|
18
|
+
speed?: 1 | 2 | 5;
|
|
28
19
|
next_source_entry_id?: string | null;
|
|
29
20
|
ended_at?: string | null;
|
|
30
21
|
autonomous_reason?: string | null;
|
|
31
22
|
}
|
|
32
|
-
/** 某个会话能否作为回放来源。 */
|
|
33
|
-
export interface ReplayPreview {
|
|
34
|
-
session_id: string;
|
|
35
|
-
intent?: string | null;
|
|
36
|
-
supported: boolean;
|
|
37
|
-
/** supported 为 false 时给出的原因,可直接展示给用户。 */
|
|
38
|
-
reason?: string | null;
|
|
39
|
-
}
|
|
40
23
|
export interface SessionPortMapping {
|
|
41
24
|
container_port: number;
|
|
42
25
|
host_port: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RawEvent } from "../shared/projection";
|
|
2
2
|
import type { MessageContent } from "../schemas/message";
|
|
3
3
|
import type { PatchEnvelope, TurnProjection } from "../schemas/projection";
|
|
4
|
-
import type {
|
|
4
|
+
import type { SessionStatus } from "../schemas/session";
|
|
5
5
|
import { type CommandHandler } from "../commands/registry";
|
|
6
6
|
import { type AgentSessionEvents } from "./events";
|
|
7
7
|
import type { AppCliAttachment, AppCliDefinition, FileEntry } from "../resources/sessions";
|
|
@@ -12,15 +12,6 @@ export interface SessionRuntime {
|
|
|
12
12
|
emitWithAck(event: string, data: unknown, timeoutMs: number): Promise<Record<string, unknown> | undefined>;
|
|
13
13
|
ensureConnected(): void;
|
|
14
14
|
fetchTurns(sessionId: string): Promise<TurnProjection[]>;
|
|
15
|
-
/** 会话详情,目前只用来取回放状态。 */
|
|
16
|
-
fetchSessionInfo(sessionId: string): Promise<{
|
|
17
|
-
replay_state?: ReplayState | null;
|
|
18
|
-
viewer_role?: "owner" | "viewer";
|
|
19
|
-
}>;
|
|
20
|
-
updateReplay(sessionId: string, payload: {
|
|
21
|
-
speed?: ReplaySpeed;
|
|
22
|
-
status?: "autonomous";
|
|
23
|
-
}): Promise<ReplayState | null>;
|
|
24
15
|
listDir(sessionId: string, dirPath: string): Promise<FileEntry[]>;
|
|
25
16
|
countFiles(sessionId: string, dirPath?: string): Promise<number>;
|
|
26
17
|
downloadFile(sessionId: string, filePath: string, downloadName?: string): Promise<void>;
|
|
@@ -74,7 +65,6 @@ export declare class AgentSession {
|
|
|
74
65
|
private patchFlushCancel;
|
|
75
66
|
private joined;
|
|
76
67
|
private joinPending;
|
|
77
|
-
private replayQueue;
|
|
78
68
|
private pendingReplayMessage;
|
|
79
69
|
private pendingReplayMode;
|
|
80
70
|
private recentChatEndAt;
|
|
@@ -149,16 +139,6 @@ export declare class AgentSession {
|
|
|
149
139
|
_rejoinAfterReconnect(): Promise<void>;
|
|
150
140
|
/** @internal 首次连接:加载历史 + 加入房间。 */
|
|
151
141
|
_bootstrap(): Promise<void>;
|
|
152
|
-
/** 改回放是 owner 专属(服务端 PATCH 走 _get_owned_session)。 */
|
|
153
|
-
private get canControlReplay();
|
|
154
|
-
/** 拉一次会话详情,填回放状态和只读身份;失败按非回放会话处理,不挡启动。 */
|
|
155
|
-
private syncReplayFromSession;
|
|
156
|
-
/** 调整回放倍速;不是回放会话、或只读身份时什么都不做。 */
|
|
157
|
-
setReplaySpeed(speed: ReplaySpeed): Promise<void>;
|
|
158
|
-
/** 退出回放,之后的对话交给真实模型运行;不是回放会话、或只读身份时什么都不做。 */
|
|
159
|
-
exitReplay(): Promise<void>;
|
|
160
|
-
/** 把一次回放控制请求排进队列;前一个完成后才发出,响应直接安装。 */
|
|
161
|
-
private applyReplayControl;
|
|
162
142
|
/** @internal */
|
|
163
143
|
_handleTurnStart(turn: TurnProjection): void;
|
|
164
144
|
/** @internal */
|
package/dist/session/state.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ChatMessage, CompactionInfo, MessageContent } from "../schemas/message";
|
|
2
2
|
import type { ContentBlock, PatchEnvelope, TurnProjection } from "../schemas/projection";
|
|
3
|
-
import type {
|
|
3
|
+
import type { SessionStatus } from "../schemas/session";
|
|
4
4
|
/** 一次 AskUserQuestion 的用户作答(选项选择 + 自定义输入)。 */
|
|
5
5
|
export interface AskUserAnswerData {
|
|
6
6
|
selections: Record<number, number[]>;
|
|
@@ -39,20 +39,7 @@ export interface SessionState {
|
|
|
39
39
|
askAnswers: Record<string, AskUserAnswerData>;
|
|
40
40
|
agentLoops: Record<string, AgentLoopInfo>;
|
|
41
41
|
activeCompaction: ActiveCompactionState | null;
|
|
42
|
-
/** 回放(演示 / 彩排)状态;不是回放会话时为 null。 */
|
|
43
|
-
replay: ReplaySnapshot | null;
|
|
44
|
-
/** 当前身份对这个会话的权限;"viewer" 表示只读(分享链接打开的)。 */
|
|
45
|
-
viewerRole: "owner" | "viewer" | null;
|
|
46
42
|
}
|
|
47
|
-
/** 回放会话的快照视图,由服务端的 replay_state 归一化而来。 */
|
|
48
|
-
export interface ReplaySnapshot {
|
|
49
|
-
/** 仍在按录制内容走;转自主运行后为 false。 */
|
|
50
|
-
isReplay: boolean;
|
|
51
|
-
speed: ReplaySpeed;
|
|
52
|
-
sourceSessionId: string | null;
|
|
53
|
-
}
|
|
54
|
-
/** 把服务端的 replay_state 归一化成快照;不是回放会话时返回 null。 */
|
|
55
|
-
export declare function toReplaySnapshot(raw: ReplayState | null | undefined): ReplaySnapshot | null;
|
|
56
43
|
export declare function createInitialSessionState(sessionId: string): SessionState;
|
|
57
44
|
export declare function extractModeFromBlocks(blocks: ContentBlock[]): "planning" | "executing" | null;
|
|
58
45
|
/**
|
|
@@ -26,13 +26,6 @@ export declare function sourceLoopFor(loopId: string, loopDescriptions: Map<stri
|
|
|
26
26
|
loop_name: string;
|
|
27
27
|
description: string;
|
|
28
28
|
} | null;
|
|
29
|
-
/** 本轮交付给用户的成果:工作区里的文件,或可以打开的网址。 */
|
|
30
|
-
export interface FinalArtifact {
|
|
31
|
-
kind: "file" | "link";
|
|
32
|
-
/** file 是文件路径(相对工作目录或容器内绝对路径);link 是 http/https 网址。 */
|
|
33
|
-
target: string;
|
|
34
|
-
label: string;
|
|
35
|
-
}
|
|
36
29
|
/**
|
|
37
30
|
* Shared by the streaming and history channels — both must decide "is this
|
|
38
31
|
* follow-up showable" identically. Returns null when there is nothing to show.
|
|
@@ -41,7 +34,6 @@ export declare function normalizePostChatFollowup(data: Record<string, unknown>,
|
|
|
41
34
|
assistant_entry_id: string;
|
|
42
35
|
recaption: string;
|
|
43
36
|
suggestions: string[];
|
|
44
|
-
final_artifacts: FinalArtifact[];
|
|
45
37
|
} | null;
|
|
46
38
|
export declare function normalizeChildPause(pausePayload: Record<string, unknown>): {
|
|
47
39
|
pauseToolData: Record<string, unknown>;
|
package/package.json
CHANGED
package/public-api.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
|
|
4
4
|
> 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
|
|
5
5
|
|
|
6
|
-
共
|
|
6
|
+
共 123 个公开声明。
|
|
7
7
|
|
|
8
8
|
## `ActiveCompactionState` (interface)
|
|
9
9
|
|
|
@@ -42,7 +42,6 @@ compact: () => Promise<Record<string, unknown>>
|
|
|
42
42
|
countFiles: (dirPath?: string) => Promise<number>
|
|
43
43
|
dispose: () => void
|
|
44
44
|
downloadFile: (filePath: string, downloadName?: string) => Promise<void>
|
|
45
|
-
exitReplay: () => Promise<void>
|
|
46
45
|
getState: () => SessionState
|
|
47
46
|
insertText: (text: string) => void
|
|
48
47
|
isDisposed: boolean
|
|
@@ -52,7 +51,6 @@ on: <K extends keyof AgentSessionEvents>(name: K, handler: (event: AgentSessionE
|
|
|
52
51
|
onCommand: (action: string, handler: CommandHandler) => () => void
|
|
53
52
|
send: (content: MessageContent, options?: SendOptions) => Promise<boolean>
|
|
54
53
|
sessionId: string
|
|
55
|
-
setReplaySpeed: (speed: ReplaySpeed) => Promise<void>
|
|
56
54
|
stop: () => Promise<Record<string, unknown>>
|
|
57
55
|
subscribe: (listener: () => void) => () => void
|
|
58
56
|
```
|
|
@@ -149,7 +147,6 @@ getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
|
|
|
149
147
|
## `AuthResource` (class)
|
|
150
148
|
|
|
151
149
|
```ts
|
|
152
|
-
exchangeCode: (params: ExchangeCodeParams) => Promise<ExchangeCodeResult>
|
|
153
150
|
getMe: () => Promise<UserInfo>
|
|
154
151
|
getProviders: () => Promise<ProvidersResponse>
|
|
155
152
|
login: (options?: LoginOptions) => Promise<LoginResult>
|
|
@@ -379,12 +376,6 @@ path: string | undefined
|
|
|
379
376
|
token: string | (() => string | null | undefined) | undefined
|
|
380
377
|
```
|
|
381
378
|
|
|
382
|
-
## `DEFAULT_REPLAY_SPEED` (const)
|
|
383
|
-
|
|
384
|
-
```ts
|
|
385
|
-
DEFAULT_REPLAY_SPEED: ReplaySpeed
|
|
386
|
-
```
|
|
387
|
-
|
|
388
379
|
## `EmbeddedChat` (interface)
|
|
389
380
|
|
|
390
381
|
```ts
|
|
@@ -402,20 +393,10 @@ allowedOrigins: string[]
|
|
|
402
393
|
iframe: HTMLIFrameElement | undefined
|
|
403
394
|
```
|
|
404
395
|
|
|
405
|
-
## `
|
|
396
|
+
## `EMPTY_PLATFORM_ENDPOINTS` (const)
|
|
406
397
|
|
|
407
398
|
```ts
|
|
408
|
-
|
|
409
|
-
code: string
|
|
410
|
-
state: string
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
## `ExchangeCodeResult` (interface)
|
|
414
|
-
|
|
415
|
-
```ts
|
|
416
|
-
access_token: string
|
|
417
|
-
token_type: string
|
|
418
|
-
user: { id: string; username: string; display_name: string; avatar_url: string | null; }
|
|
399
|
+
EMPTY_PLATFORM_ENDPOINTS: PlatformEndpoints
|
|
419
400
|
```
|
|
420
401
|
|
|
421
402
|
## `ExistingSolutionRef` (interface)
|
|
@@ -544,6 +525,20 @@ export enum LayoutType {
|
|
|
544
525
|
}
|
|
545
526
|
```
|
|
546
527
|
|
|
528
|
+
## `loadPlatformEndpoints` (function)
|
|
529
|
+
|
|
530
|
+
```ts
|
|
531
|
+
loadPlatformEndpoints: (options?: LoadPlatformEndpointsOptions) => Promise<PlatformEndpoints>
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
## `LoadPlatformEndpointsOptions` (interface)
|
|
535
|
+
|
|
536
|
+
```ts
|
|
537
|
+
baseUrl: string | undefined
|
|
538
|
+
fetchImpl: { (input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | URL | Request, init?: RequestInit): Promise<Response>; } | undefined
|
|
539
|
+
timeoutMs: number | undefined
|
|
540
|
+
```
|
|
541
|
+
|
|
547
542
|
## `LoginOptions` (interface)
|
|
548
543
|
|
|
549
544
|
```ts
|
|
@@ -596,9 +591,7 @@ export type ModeId = "planning" | "executing"
|
|
|
596
591
|
## `ModelCatalog` (interface)
|
|
597
592
|
|
|
598
593
|
```ts
|
|
599
|
-
baseUrl: string | undefined
|
|
600
594
|
default: string
|
|
601
|
-
defaultServiceModel: string | undefined
|
|
602
595
|
models: ModelOption[]
|
|
603
596
|
```
|
|
604
597
|
|
|
@@ -607,7 +600,6 @@ models: ModelOption[]
|
|
|
607
600
|
```ts
|
|
608
601
|
id: string
|
|
609
602
|
label: string
|
|
610
|
-
serviceModelId: string | undefined
|
|
611
603
|
```
|
|
612
604
|
|
|
613
605
|
## `ModelsResource` (class)
|
|
@@ -656,6 +648,18 @@ sequence: number
|
|
|
656
648
|
turn_id: string
|
|
657
649
|
```
|
|
658
650
|
|
|
651
|
+
## `PlatformEndpoints` (interface)
|
|
652
|
+
|
|
653
|
+
```ts
|
|
654
|
+
services: Partial<Record<"os" | "hub" | "agent" | "oauth" | "llmGateway" | "gitea", string>>
|
|
655
|
+
```
|
|
656
|
+
|
|
657
|
+
## `PlatformServiceName` (type)
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
export type PlatformServiceName = (typeof PLATFORM_SERVICE_NAMES)[number]
|
|
661
|
+
```
|
|
662
|
+
|
|
659
663
|
## `PreparedSolution` (interface)
|
|
660
664
|
|
|
661
665
|
```ts
|
|
@@ -717,38 +721,10 @@ payload: Record<string, unknown>
|
|
|
717
721
|
type: string
|
|
718
722
|
```
|
|
719
723
|
|
|
720
|
-
## `
|
|
721
|
-
|
|
722
|
-
```ts
|
|
723
|
-
intent: string | null | undefined
|
|
724
|
-
reason: string | null | undefined
|
|
725
|
-
session_id: string
|
|
726
|
-
supported: boolean
|
|
727
|
-
```
|
|
728
|
-
|
|
729
|
-
## `ReplaySnapshot` (interface)
|
|
730
|
-
|
|
731
|
-
```ts
|
|
732
|
-
isReplay: boolean
|
|
733
|
-
sourceSessionId: string | null
|
|
734
|
-
speed: ReplaySpeed
|
|
735
|
-
```
|
|
736
|
-
|
|
737
|
-
## `ReplaySpeed` (type)
|
|
724
|
+
## `resolveServiceUrl` (function)
|
|
738
725
|
|
|
739
726
|
```ts
|
|
740
|
-
|
|
741
|
-
```
|
|
742
|
-
|
|
743
|
-
## `ReplayState` (interface)
|
|
744
|
-
|
|
745
|
-
```ts
|
|
746
|
-
autonomous_reason: string | null | undefined
|
|
747
|
-
ended_at: string | null | undefined
|
|
748
|
-
next_source_entry_id: string | null | undefined
|
|
749
|
-
source_session_id: string | undefined
|
|
750
|
-
speed: ReplaySpeed | undefined
|
|
751
|
-
status: "replay" | "autonomous" | undefined
|
|
727
|
+
resolveServiceUrl: (endpoints: PlatformEndpoints, name: PlatformServiceName, path?: string) => string | null
|
|
752
728
|
```
|
|
753
729
|
|
|
754
730
|
## `RunOptions` (interface)
|
|
@@ -987,7 +963,6 @@ downloadFile: (sessionId: string, filePath: string, downloadName?: string) => Pr
|
|
|
987
963
|
exportSession: (sessionId: string) => Promise<void>
|
|
988
964
|
getBackgroundTask: (sessionId: string, taskId: string, tail?: number, init?: RequestInit) => Promise<BackgroundTask>
|
|
989
965
|
getDownloadDirUrl: (sessionId: string, dirPath: string) => string
|
|
990
|
-
getReplayPreview: (sessionId: string) => Promise<ReplayPreview>
|
|
991
966
|
getSession: (sessionId: string, init?: RequestInit) => Promise<SessionDetail>
|
|
992
967
|
getSessionCheckpoints: (sessionId: string, init?: RequestInit) => Promise<{ nodes: CheckpointNode[]; leaf_id: string | null; }>
|
|
993
968
|
getSessionContextStats: (sessionId: string, init?: RequestInit) => Promise<SessionContextStats>
|
|
@@ -1009,12 +984,12 @@ revokeShare: (sessionId: string, token: string) => Promise<{ revoked: boolean; }
|
|
|
1009
984
|
rewindSession: (sessionId: string, checkpointId: string) => Promise<{ id: string; content: string; }>
|
|
1010
985
|
setSessionEnv: (sessionId: string, env: Record<string, string>) => Promise<SessionDetail>
|
|
1011
986
|
shareFile: (sessionId: string, sourcePath: string, linkName?: string, shareFolder?: string) => Promise<{ path: string; target: string; }>
|
|
1012
|
-
startReplaySession: (sourceSessionId: string, speed?:
|
|
987
|
+
startReplaySession: (sourceSessionId: string, speed?: 1 | 2 | 5) => Promise<{ session_id: string; }>
|
|
1013
988
|
stopBackgroundTask: (sessionId: string, taskId: string) => Promise<BackgroundTaskStopResult>
|
|
1014
989
|
switchBranch: (sessionId: string, checkpointId: string) => Promise<{ id: string; leaf_id: string; }>
|
|
1015
990
|
tokenizeMessages: (messages: Array<Record<string, unknown>>, options?: { model?: string; add_generation_prompt?: boolean; enable_thinking?: boolean | null; tools?: Array<Record<string, unknown>>; }) => Promise<TokenizeResult>
|
|
1016
991
|
tokenizePrompt: (prompt: string, model?: string) => Promise<TokenizeResult>
|
|
1017
|
-
updateReplaySession: (sessionId: string, payload: { speed?:
|
|
992
|
+
updateReplaySession: (sessionId: string, payload: { speed?: 1 | 2 | 5; status?: "autonomous"; }) => Promise<{ replay_state: SessionInfo["replay_state"]; }>
|
|
1018
993
|
updateSession: (sessionId: string, payload: { intent?: string; }) => Promise<SessionDetail>
|
|
1019
994
|
updateSessionMemory: (sessionId: string, memoryEnabled: boolean) => Promise<{ memory_enabled: boolean; }>
|
|
1020
995
|
updateSharing: (sessionId: string, shared: boolean) => Promise<{ shared: boolean; }>
|
|
@@ -1033,11 +1008,9 @@ errorMessage: string | null
|
|
|
1033
1008
|
isStreaming: boolean
|
|
1034
1009
|
messages: ChatMessage[]
|
|
1035
1010
|
mode: "planning" | "executing" | null
|
|
1036
|
-
replay: ReplaySnapshot | null
|
|
1037
1011
|
sessionId: string
|
|
1038
1012
|
status: "completed" | "failed" | "interrupted" | "running" | "created" | "waiting_for_input" | null
|
|
1039
1013
|
turns: TurnProjection[]
|
|
1040
|
-
viewerRole: "owner" | "viewer" | null
|
|
1041
1014
|
```
|
|
1042
1015
|
|
|
1043
1016
|
## `SessionStatus` (type)
|
|
@@ -1063,13 +1036,6 @@ files: TextFile[]
|
|
|
1063
1036
|
name: string
|
|
1064
1037
|
```
|
|
1065
1038
|
|
|
1066
|
-
## `SkillMentionAvailability` (interface)
|
|
1067
|
-
|
|
1068
|
-
```ts
|
|
1069
|
-
installed: boolean | undefined
|
|
1070
|
-
local: boolean | undefined
|
|
1071
|
-
```
|
|
1072
|
-
|
|
1073
1039
|
## `Solution` (interface)
|
|
1074
1040
|
|
|
1075
1041
|
```ts
|
|
@@ -1213,16 +1179,10 @@ result: unknown
|
|
|
1213
1179
|
status: "done" | "error" | "cancelled" | "awaiting_answer" | "pending" | undefined
|
|
1214
1180
|
```
|
|
1215
1181
|
|
|
1216
|
-
## `toReplaySnapshot` (function)
|
|
1217
|
-
|
|
1218
|
-
```ts
|
|
1219
|
-
toReplaySnapshot: (raw: ReplayState | null | undefined) => ReplaySnapshot | null
|
|
1220
|
-
```
|
|
1221
|
-
|
|
1222
1182
|
## `transformSlashCommand` (function)
|
|
1223
1183
|
|
|
1224
1184
|
```ts
|
|
1225
|
-
transformSlashCommand: (skillName: string, rawInput: string
|
|
1185
|
+
transformSlashCommand: (skillName: string, rawInput: string) => string
|
|
1226
1186
|
```
|
|
1227
1187
|
|
|
1228
1188
|
## `TurnProjection` (interface)
|