@blade-hq/agent-client 2612.0.0-beta.74 → 2612.0.0-beta.76

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/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export type { SessionConfig, SessionDefinition, SessionSetupStage, SkillDefiniti
19
19
  export type { QueuedMessage, QueuedMessageStatus, QueueOperationResult, SessionQueueSnapshot, } from "./session/queue";
20
20
  export type { CommandHandler } from "./commands/registry";
21
21
  export type { BladeChatMountRenderers, MountHandle, MountRenderer, MountRendererObject, MountResult, } from "./embed/mount-renderer";
22
- export type { AuthResource, ExchangeCodeParams, ExchangeCodeResult, ProvidersResponse, UserInfo, } from "./resources/auth";
22
+ export type { AuthResource, Subaccount, ExchangeCodeParams, ExchangeCodeResult, ProvidersResponse, UserInfo, } from "./resources/auth";
23
23
  export type { HeadlessResource } from "./resources/headless";
24
24
  export type { RunOptions, RunResult, RunTrace } from "./types/sdk-profile";
25
25
  export type { ModelsResource, ModelCatalog, ModelOption } from "./resources/models";
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  parseAskUserQuestion,
27
27
  transformSlashCommand,
28
28
  userFacingErrorText
29
- } from "./chunk-Y5UEXTRK.js";
29
+ } from "./chunk-TT3SAXSF.js";
30
30
  export {
31
31
  AgentSession,
32
32
  AgentSessionError,
package/dist/internal.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  withTurns,
96
96
  workflowEntriesFromOutput,
97
97
  workflowNameFromArguments
98
- } from "./chunk-Y5UEXTRK.js";
98
+ } from "./chunk-TT3SAXSF.js";
99
99
 
100
100
  // src/polling-backoff.ts
101
101
  var MAX_BACKOFF_MS = 6e4;
@@ -9,6 +9,13 @@ export interface UserInfo {
9
9
  auth_type: "casdoor";
10
10
  is_admin?: boolean;
11
11
  }
12
+ /** Managed execution account; its opaque ID belongs to the identity service. */
13
+ export interface Subaccount {
14
+ id: string;
15
+ name: string;
16
+ avatar_url: string;
17
+ status: string;
18
+ }
12
19
  export interface ProvidersResponse {
13
20
  providers: Array<{
14
21
  name: string;
@@ -43,6 +50,15 @@ export interface ExchangeCodeResult {
43
50
  export declare class AuthResource {
44
51
  private client;
45
52
  constructor(client: BladeClient);
53
+ subaccounts(): Promise<{
54
+ items: Subaccount[];
55
+ }>;
56
+ createSubaccount(name: string, requestId: string): Promise<Subaccount>;
57
+ /** Server-side only: keep the returned execution credential out of the UI. */
58
+ subaccountCredential(id: string): Promise<{
59
+ account: Subaccount;
60
+ access_token: string;
61
+ }>;
46
62
  /**
47
63
  * 弹窗授权登录(浏览器专用):弹出后端授权页,用户点击"许可授权"后
48
64
  * 自动取得 PAT 并热挂载到当前 client。等价于 client.login()。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blade-hq/agent-client",
3
- "version": "2612.0.0-beta.74",
3
+ "version": "2612.0.0-beta.76",
4
4
  "description": "Blade Agent 框架无关客户端:会话实时状态机、REST 通道、弹窗登录、页面协作。浏览器与 Node.js 通用。",
5
5
  "repository": {
6
6
  "type": "git",
package/public-api.md CHANGED
@@ -3,7 +3,7 @@
3
3
  > 本文件由 `scripts/public-api-report.mjs` 生成,请勿手改。
4
4
  > 公共面变更时重新生成本报告,并同步更新 README 对应章节——CI 会校验两者。
5
5
 
6
- 共 158 个公开声明。
6
+ 共 159 个公开声明。
7
7
 
8
8
  ## `AccountComputer` (interface)
9
9
 
@@ -205,12 +205,15 @@ getContext: () => Record<string, unknown> | Promise<Record<string, unknown>>
205
205
  ## `AuthResource` (class)
206
206
 
207
207
  ```ts
208
+ createSubaccount: (name: string, requestId: string) => Promise<Subaccount>
208
209
  exchangeCode: (params: ExchangeCodeParams) => Promise<ExchangeCodeResult>
209
210
  getMe: (options?: { signal?: AbortSignal; }) => Promise<UserInfo>
210
211
  getProviders: () => Promise<ProvidersResponse>
211
212
  login: (options?: LoginOptions) => Promise<LoginResult>
212
213
  logout: () => Promise<{ logout_url: string; }>
213
214
  logoutToken: () => void
215
+ subaccountCredential: (id: string) => Promise<{ account: Subaccount; access_token: string; }>
216
+ subaccounts: () => Promise<{ items: Subaccount[]; }>
214
217
  ```
215
218
 
216
219
  ## `BladeApiError` (class)
@@ -1617,6 +1620,15 @@ export type SolutionDefinition =
1617
1620
  | { files: TextFile[]; role?: string }
1618
1621
  ```
1619
1622
 
1623
+ ## `Subaccount` (interface)
1624
+
1625
+ ```ts
1626
+ avatar_url: string
1627
+ id: string
1628
+ name: string
1629
+ status: string
1630
+ ```
1631
+
1620
1632
  ## `TextContentPart` (interface)
1621
1633
 
1622
1634
  ```ts