@aipanel/core 1.2.10 → 1.2.11

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.
@@ -26,6 +26,8 @@ export interface ChatSession {
26
26
  }
27
27
  /** 会话运行状态 */
28
28
  export type SessionStatus = "idle" | "running" | "streaming" | "completed";
29
+ /** 会话等待用户交互的类型(对齐 dsh host approval/request 与 user-questions/request) */
30
+ export type SessionPendingKind = "approval" | "plan-review" | "question";
29
31
  /** Provider 事件(Provider 私有事件 → 归一化,客户端只消费这些事件) */
30
32
  export type ProviderEvent = {
31
33
  type: "connected";
@@ -46,6 +48,19 @@ export type ProviderEvent = {
46
48
  type: "thinking";
47
49
  sessionId: string;
48
50
  thinking: boolean;
51
+ }
52
+ /** 会话等待用户交互(审批/提问/计划评审)开始或结束 */
53
+ | {
54
+ type: "session.pending";
55
+ sessionId: string;
56
+ pending: boolean;
57
+ kind?: SessionPendingKind;
58
+ }
59
+ /** 父会话的进行中子代理数(>0 表示有子代理在跑;自身 idle 时 UI 仍显示进行中) */
60
+ | {
61
+ type: "session.subagents";
62
+ sessionId: string;
63
+ running: number;
49
64
  };
50
65
  /** Provider 环境检查结果 */
51
66
  export interface ProviderEnvironmentInfo {
@@ -2,7 +2,7 @@
2
2
  * 通用类型(Provider 无关)
3
3
  * Provider 专属类型已下沉至 @aipanel/provider-opencode。
4
4
  */
5
- import type { SessionStatus } from "./provider";
5
+ import type { SessionPendingKind, SessionStatus } from "./provider";
6
6
  /**
7
7
  * 展示模式类型
8
8
  */
@@ -127,13 +127,24 @@ export type ServiceStatus = "idle" | "starting" | "ready" | "partial" | "failed"
127
127
  * Session 状态类型(别名:以 ./provider 的 SessionStatus 为单一来源)
128
128
  */
129
129
  export type AIPanelSessionStatusType = SessionStatus;
130
+ /**
131
+ * Session 交互状态(单一来源:./types.ts 定义,事件载荷类型见 ./provider.ts 的 SessionPendingKind)
132
+ */
133
+ export type AIPanelSessionPendingKind = SessionPendingKind;
130
134
  /**
131
135
  * Session 思考状态
132
136
  */
133
137
  export interface AIPanelSessionThinkingState {
134
138
  thinking: boolean;
135
139
  statusType: AIPanelSessionStatusType;
140
+ /** 是否存在待用户交互(审批/提问/计划评审);pending 优先级高于 thinking */
136
141
  hasPending: boolean;
142
+ /** 待交互类型(hasPending=true 时有值;单一来源 ./provider.ts) */
143
+ pendingKind?: AIPanelSessionPendingKind;
144
+ /** 是否刚运行完成(client 端由 running→idle 边沿且非当前选中推导;对齐官方 completed 提醒语义) */
145
+ completed?: boolean;
146
+ /** 进行中的子代理数(>0 时即使自身 idle 也视为"在跑";源:session.subagents) */
147
+ subagentsRunning?: number;
137
148
  }
138
149
  /**
139
150
  * 挂件会话信息
@@ -26,6 +26,8 @@ export interface ChatSession {
26
26
  }
27
27
  /** 会话运行状态 */
28
28
  export type SessionStatus = "idle" | "running" | "streaming" | "completed";
29
+ /** 会话等待用户交互的类型(对齐 dsh host approval/request 与 user-questions/request) */
30
+ export type SessionPendingKind = "approval" | "plan-review" | "question";
29
31
  /** Provider 事件(Provider 私有事件 → 归一化,客户端只消费这些事件) */
30
32
  export type ProviderEvent = {
31
33
  type: "connected";
@@ -46,6 +48,19 @@ export type ProviderEvent = {
46
48
  type: "thinking";
47
49
  sessionId: string;
48
50
  thinking: boolean;
51
+ }
52
+ /** 会话等待用户交互(审批/提问/计划评审)开始或结束 */
53
+ | {
54
+ type: "session.pending";
55
+ sessionId: string;
56
+ pending: boolean;
57
+ kind?: SessionPendingKind;
58
+ }
59
+ /** 父会话的进行中子代理数(>0 表示有子代理在跑;自身 idle 时 UI 仍显示进行中) */
60
+ | {
61
+ type: "session.subagents";
62
+ sessionId: string;
63
+ running: number;
49
64
  };
50
65
  /** Provider 环境检查结果 */
51
66
  export interface ProviderEnvironmentInfo {
@@ -2,7 +2,7 @@
2
2
  * 通用类型(Provider 无关)
3
3
  * Provider 专属类型已下沉至 @aipanel/provider-opencode。
4
4
  */
5
- import type { SessionStatus } from "./provider";
5
+ import type { SessionPendingKind, SessionStatus } from "./provider";
6
6
  /**
7
7
  * 展示模式类型
8
8
  */
@@ -127,13 +127,24 @@ export type ServiceStatus = "idle" | "starting" | "ready" | "partial" | "failed"
127
127
  * Session 状态类型(别名:以 ./provider 的 SessionStatus 为单一来源)
128
128
  */
129
129
  export type AIPanelSessionStatusType = SessionStatus;
130
+ /**
131
+ * Session 交互状态(单一来源:./types.ts 定义,事件载荷类型见 ./provider.ts 的 SessionPendingKind)
132
+ */
133
+ export type AIPanelSessionPendingKind = SessionPendingKind;
130
134
  /**
131
135
  * Session 思考状态
132
136
  */
133
137
  export interface AIPanelSessionThinkingState {
134
138
  thinking: boolean;
135
139
  statusType: AIPanelSessionStatusType;
140
+ /** 是否存在待用户交互(审批/提问/计划评审);pending 优先级高于 thinking */
136
141
  hasPending: boolean;
142
+ /** 待交互类型(hasPending=true 时有值;单一来源 ./provider.ts) */
143
+ pendingKind?: AIPanelSessionPendingKind;
144
+ /** 是否刚运行完成(client 端由 running→idle 边沿且非当前选中推导;对齐官方 completed 提醒语义) */
145
+ completed?: boolean;
146
+ /** 进行中的子代理数(>0 时即使自身 idle 也视为"在跑";源:session.subagents) */
147
+ subagentsRunning?: number;
137
148
  }
138
149
  /**
139
150
  * 挂件会话信息
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aipanel/core",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "lib/index.cjs",