@aibolabs/plugin-protocol 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 chldu2000
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @aibolabs/plugin-protocol
2
+
3
+ Aibo 公共 JSON 类型与呈现能力声明。零运行时依赖,不导出 Svelte、DOM、CSS、挂载句柄或函数回调。
4
+
5
+ - `@aibolabs/plugin-protocol/semantic`:语义快照与动作。
6
+ - `@aibolabs/plugin-protocol/presentation`:呈现代际消息;仍标记 experimental-v1。
7
+ - `@aibolabs/plugin-protocol/renderer`:纯数据 renderer 描述、核心语义和支持版本常量。
8
+ - 默认入口另导出 Capability Runtime 2.0 的初始化、调用、scope、结果及子请求目标类型。
9
+
10
+ 包版本不替代 wire schema 版本。当前语义数据类型保留 experimental-v1、v1 与 v1.1;具体载荷仍须通过宿主运行时 schema 校验,TypeScript 类型本身不是权限或有效性证明。
11
+
12
+ 安装:`npm install -D @aibolabs/plugin-protocol`。包版本等于宿主 SDK 版本;生成的包没有运行时或类型依赖。
13
+ 仓库内构建:从仓库根运行 `pnpm exec tsc -p packages/plugin-protocol/tsconfig.json`;发布见 `scripts/publish-sdk.mjs`。
14
+
15
+ 可执行 renderer 的 mount/update/dispose 接口继续属于可信宿主本地层,不从此包重导出。
@@ -0,0 +1,5 @@
1
+ /** Monochrome SVG path in a 24 × 24 viewBox. No markup, URLs or styling. */
2
+ export type AgentIcon = {
3
+ path: string;
4
+ };
5
+ export declare function readAgentIcon(value: unknown): AgentIcon | undefined;
@@ -0,0 +1,10 @@
1
+ export function readAgentIcon(value) {
2
+ if (!value || typeof value !== 'object' || Array.isArray(value))
3
+ return undefined;
4
+ const icon = value;
5
+ if (Object.keys(icon).length !== 1 || typeof icon.path !== 'string')
6
+ return undefined;
7
+ if (icon.path.length > 8192 || !/^[Mm][0-9MmZzLlHhVvCcSsQqTtAaEe.,+\s-]+$/.test(icon.path))
8
+ return undefined;
9
+ return { path: icon.path };
10
+ }
@@ -0,0 +1,114 @@
1
+ import type { AgentSettingsContext } from './settings.js';
2
+ import type { JsonValue } from './semantic.js';
3
+ export declare const CAPABILITY_RUNTIME_PROTOCOL = "2.0";
4
+ /** Explicit opt-in for invocation streams and controls; 2.0 keeps its original meaning. */
5
+ export declare const CAPABILITY_INTERACTIVE_PROTOCOL = "2.1";
6
+ export type CapabilityScope = {
7
+ kind: 'application';
8
+ } | {
9
+ kind: 'workspace' | 'session';
10
+ id: string;
11
+ };
12
+ export type CapabilityRequest = {
13
+ scope: CapabilityScope;
14
+ capability: string;
15
+ version: string;
16
+ requestId: string;
17
+ turnId?: string;
18
+ input: JsonValue;
19
+ };
20
+ export type CapabilityResult = {
21
+ instanceId: string;
22
+ invocationId: string;
23
+ installationId: string;
24
+ generationId: string;
25
+ output: JsonValue;
26
+ };
27
+ export type CapabilityFailure = {
28
+ code: string;
29
+ message: string;
30
+ invocationId: string | null;
31
+ };
32
+ export type CapabilityOperation = {
33
+ capability: string;
34
+ version: string;
35
+ operationId: string;
36
+ };
37
+ export type CapabilityInitialization = {
38
+ protocol: '2.0' | '2.1';
39
+ instanceId: string;
40
+ generationId: string;
41
+ installationId: string;
42
+ pluginId: string;
43
+ pluginVersion: string;
44
+ contributionId: string;
45
+ privateData: {
46
+ path: string;
47
+ formatVersion: 1;
48
+ };
49
+ };
50
+ export type CapabilityInvocation = {
51
+ invocationId: string;
52
+ instanceId: string;
53
+ generationId: string;
54
+ contributionId: string;
55
+ capability: string;
56
+ contractVersion: string;
57
+ operationId: string;
58
+ scope: CapabilityScope;
59
+ deadlineUnixMs: number;
60
+ context: {
61
+ hostTools?: {
62
+ schema: 'aibo.host-tools/v1';
63
+ tools: {
64
+ name: string;
65
+ description: string;
66
+ inputSchema: JsonValue;
67
+ outputSchema?: JsonValue;
68
+ annotations?: JsonValue;
69
+ }[];
70
+ };
71
+ settings?: AgentSettingsContext;
72
+ turnId: string | null;
73
+ workspaceId: string | null;
74
+ workspacePath: string | null;
75
+ originalCaller: {
76
+ kind: 'window';
77
+ id: string;
78
+ };
79
+ permissions: string[];
80
+ callChain: {
81
+ invocationId: string;
82
+ installationId: string;
83
+ contributionId: string;
84
+ }[];
85
+ };
86
+ input: JsonValue;
87
+ };
88
+ export type CapabilityCallTarget = {
89
+ pluginId: string;
90
+ contributionId: string;
91
+ capability: string;
92
+ version: string;
93
+ input: JsonValue;
94
+ };
95
+ /** Identity comes from the active invocation, never from an event producer. */
96
+ export type CapabilityStreamEvent = {
97
+ instanceId: string;
98
+ generationId: string;
99
+ contributionId: string;
100
+ invocationId: string;
101
+ sequence: number;
102
+ event: JsonValue;
103
+ };
104
+ /** Host-authorized control of a running invocation; it cannot replace scope or permissions. */
105
+ export type CapabilityControl = {
106
+ instanceId: string;
107
+ generationId: string;
108
+ contributionId: string;
109
+ invocationId: string;
110
+ capability: string;
111
+ contractVersion: string;
112
+ operationId: string;
113
+ input: JsonValue;
114
+ };
@@ -0,0 +1,3 @@
1
+ export const CAPABILITY_RUNTIME_PROTOCOL = '2.0';
2
+ /** Explicit opt-in for invocation streams and controls; 2.0 keeps its original meaning. */
3
+ export const CAPABILITY_INTERACTIVE_PROTOCOL = '2.1';
@@ -0,0 +1,16 @@
1
+ export * from './semantic.js';
2
+ export * from './presentation.js';
3
+ export * from './renderer.js';
4
+ export * from './capability.js';
5
+ export * from './session.js';
6
+ export * from './presentation-package.js';
7
+ export * from './presentation-runtime.js';
8
+ export * from './presentation-controls.js';
9
+ export * from './agent-icon.js';
10
+ export type { PresentationNavigation, PresentationNavigationAction, PresentationNavigationOperation } from './presentation-navigation.js';
11
+ export type { PresentationConversation, PresentationConversationAction, PresentationConversationOperation } from './presentation-conversation.js';
12
+ export type { PresentationGit, PresentationGitAction, PresentationGitDrafts } from './presentation-git.js';
13
+ export type { PresentationInspector, PresentationInspectorAction, PresentationArtifactPreview, PresentationProjectEditor } from './presentation-inspector.js';
14
+ export type { PresentationCapabilityWorkbench, PresentationCapabilityView, PresentationCapabilityAction, PresentationCapabilityContribution, PresentationCapabilityScope } from './presentation-capability.js';
15
+ export type { PresentationLayout, PresentationLayoutAction } from './presentation-layout.js';
16
+ export type { AgentSettingValue, AgentSettingField, AgentSettingsDescriptor, AgentSettingsTarget, AgentSettingsSnapshot, AgentSettingsSave, AgentSettingsContext } from './settings.js';
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ export * from './semantic.js';
2
+ export * from './presentation.js';
3
+ export * from './renderer.js';
4
+ export * from './capability.js';
5
+ export * from './session.js';
6
+ export * from './presentation-package.js';
7
+ export * from './presentation-runtime.js';
8
+ export * from './presentation-controls.js';
9
+ export * from './agent-icon.js';
@@ -0,0 +1,37 @@
1
+ import type { Snapshot } from './semantic.js';
2
+ export type PresentationCapabilityContribution = {
3
+ scope?: 'application' | 'workspace' | 'session';
4
+ extensionPoint?: string;
5
+ visibility?: 'always' | 'workspaceSelected' | 'sessionSelected';
6
+ installationId: string;
7
+ contributionId: string;
8
+ title: string;
9
+ available: boolean;
10
+ issue: string | null;
11
+ };
12
+ export type PresentationCapabilityScope = {
13
+ kind: 'application';
14
+ } | {
15
+ kind: 'workspace' | 'session';
16
+ id: string;
17
+ };
18
+ export type PresentationCapabilityView = {
19
+ snapshot: Snapshot | null;
20
+ error: string;
21
+ enhanced: boolean;
22
+ layout: 'central' | 'sidebar';
23
+ focusTarget: string | null;
24
+ restoring: boolean;
25
+ };
26
+ export type PresentationCapabilityWorkbench = {
27
+ catalog: PresentationCapabilityContribution[];
28
+ selected: PresentationCapabilityContribution | null;
29
+ scope: PresentationCapabilityScope;
30
+ view: PresentationCapabilityView;
31
+ };
32
+ export type PresentationCapabilityAction = {
33
+ token: string;
34
+ operation: 'open' | 'close' | 'reload' | 'toggleLayout' | 'toggleReading' | 'semantic';
35
+ event: 'click';
36
+ args: readonly (string | null)[];
37
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,160 @@
1
+ import type { AgentIcon } from './agent-icon.js';
2
+ /** Data-only control customization contract; callbacks remain in the host UI kit. */
3
+ export type PresentationModelCell = {
4
+ id: string;
5
+ label: string;
6
+ description: string | null;
7
+ available: boolean;
8
+ active: boolean;
9
+ };
10
+ export type PresentationModelColumn = Pick<PresentationModelCell, 'id' | 'label' | 'description'>;
11
+ export type PresentationModelRow = {
12
+ reference: string;
13
+ label: string;
14
+ isDefault: boolean;
15
+ active: boolean;
16
+ defaultActive: boolean;
17
+ cells: readonly PresentationModelCell[];
18
+ };
19
+ export type PresentationModelMatrix = {
20
+ columns: readonly PresentationModelColumn[];
21
+ rows: readonly PresentationModelRow[];
22
+ defaultLabel: string;
23
+ defaultTitle: string;
24
+ fastTier: {
25
+ id: string;
26
+ label: string;
27
+ description: string | null;
28
+ active: boolean;
29
+ } | null;
30
+ disabled: boolean;
31
+ };
32
+ export type PresentationStatusMark = {
33
+ agent: 'codex' | 'pi' | 'plugin';
34
+ icon?: AgentIcon;
35
+ tone: 'idle' | 'running' | 'attention' | 'danger' | 'muted';
36
+ label: string;
37
+ };
38
+ /** Host API 1.1.0. The host supplies the label; decorative marks are hidden from assistive technology. */
39
+ export type PresentationFileChangeMark = {
40
+ kind: 'added' | 'modified' | 'deleted' | 'renamed' | 'conflicted';
41
+ label: string;
42
+ decorative: boolean;
43
+ };
44
+ /** Host API 1.1.0. `appearance` is the host's classification of the declared policy; always decorative. */
45
+ export type PresentationSessionControlMark = {
46
+ kind: 'permission' | 'mode';
47
+ profile: Readonly<Record<string, string | undefined>>;
48
+ compact: boolean;
49
+ appearance: {
50
+ icon: string;
51
+ tone: 'info' | 'plan' | 'write' | 'elevated' | 'neutral';
52
+ };
53
+ };
54
+ /** Host API 1.1.0. The package draws the closed trigger; `open` asks the host to draw the listbox outside the frame. */
55
+ export type PresentationSelect = {
56
+ options: readonly {
57
+ value: string;
58
+ label: string;
59
+ disabled: boolean;
60
+ }[];
61
+ value: string;
62
+ placeholder: string;
63
+ disabled: boolean;
64
+ label: string;
65
+ };
66
+ /** Host API 1.1.0. Same trigger-only customization as Select. */
67
+ export type PresentationModelContextSelect = {
68
+ options: readonly {
69
+ id: string;
70
+ label: string;
71
+ description: string | null;
72
+ tokens: number | null;
73
+ }[];
74
+ current: string | null;
75
+ disabled: boolean;
76
+ };
77
+ export type PresentationOpenAction = {
78
+ token: 'open';
79
+ kind: 'open';
80
+ };
81
+ /** Host API 1.1.0. File names only: host paths and image previews never reach the package. */
82
+ export type PresentationAttachmentList = {
83
+ items: readonly {
84
+ id: string;
85
+ name: string;
86
+ mediaType: string;
87
+ sizeLabel: string | null;
88
+ }[];
89
+ removable: boolean;
90
+ disabled: boolean;
91
+ label: string;
92
+ };
93
+ /** Host API 1.1.0. Expanding long objectives is local package state. */
94
+ export type PresentationGoalBar = {
95
+ objective: string;
96
+ statusLabel: string;
97
+ usageLabel: string | null;
98
+ busy: boolean;
99
+ };
100
+ /** Host API 1.1.0. `open` shows the host-owned subagent dialog. */
101
+ export type PresentationSubagentCard = {
102
+ name: string;
103
+ task: string;
104
+ statusLabel: string;
105
+ activity: string;
106
+ failed: boolean;
107
+ };
108
+ export type PresentationControlData = {
109
+ control: 'ModelMatrix';
110
+ props: PresentationModelMatrix;
111
+ actions: readonly ({
112
+ token: string;
113
+ kind: 'model';
114
+ model: string;
115
+ reasoningEffort: string | null;
116
+ } | {
117
+ token: string;
118
+ kind: 'serviceTier';
119
+ serviceTier: string;
120
+ })[];
121
+ } | {
122
+ control: 'AgentStatusMark';
123
+ props: PresentationStatusMark;
124
+ actions: readonly [];
125
+ } | {
126
+ control: 'FileChangeMark';
127
+ props: PresentationFileChangeMark;
128
+ actions: readonly [];
129
+ } | {
130
+ control: 'SessionControlMark';
131
+ props: PresentationSessionControlMark;
132
+ actions: readonly [];
133
+ } | {
134
+ control: 'Select';
135
+ props: PresentationSelect;
136
+ actions: readonly PresentationOpenAction[];
137
+ } | {
138
+ control: 'ModelContextSelect';
139
+ props: PresentationModelContextSelect;
140
+ actions: readonly PresentationOpenAction[];
141
+ } | {
142
+ control: 'AttachmentList';
143
+ props: PresentationAttachmentList;
144
+ actions: readonly {
145
+ token: string;
146
+ kind: 'remove';
147
+ id: string;
148
+ }[];
149
+ } | {
150
+ control: 'GoalBar';
151
+ props: PresentationGoalBar;
152
+ actions: readonly {
153
+ token: 'pause' | 'resume' | 'clear';
154
+ kind: 'pause' | 'resume' | 'clear';
155
+ }[];
156
+ } | {
157
+ control: 'SubagentCard';
158
+ props: PresentationSubagentCard;
159
+ actions: readonly PresentationOpenAction[];
160
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,281 @@
1
+ import type { SessionControl } from './session.js';
2
+ type InteractionMode = 'ask' | 'plan' | 'edit';
3
+ type ApprovalPolicy = 'never' | 'untrusted' | 'on-request' | 'trusted';
4
+ type ApprovalReviewer = 'user' | 'auto-review' | 'none';
5
+ type FilesystemPolicy = 'read-only' | 'workspace-write' | 'danger-full-access';
6
+ type CommandPolicy = 'disabled' | 'approved' | 'trusted';
7
+ type NetworkPolicy = 'disabled' | 'agent-managed';
8
+ interface ExecutionProfile {
9
+ schema: 'aibo.execution-profile/v1';
10
+ interactionMode: InteractionMode;
11
+ approvalPolicy: ApprovalPolicy;
12
+ approvalReviewer: ApprovalReviewer;
13
+ filesystemPolicy: FilesystemPolicy;
14
+ commandPolicy: CommandPolicy;
15
+ networkPolicy: NetworkPolicy;
16
+ model?: string | null;
17
+ reasoningEffort?: string | null;
18
+ }
19
+ interface ResolvedExecutionProfile {
20
+ schema: 'aibo.execution-profile/v1';
21
+ requested: ExecutionProfile;
22
+ enforced: ExecutionProfile;
23
+ unsupported: string[];
24
+ adapterCapabilities: string[];
25
+ nativeSandbox: boolean;
26
+ sessionControls?: SessionControl[];
27
+ resolvedAt: string;
28
+ }
29
+ interface SessionExecutionProfile extends ResolvedExecutionProfile {
30
+ sessionId: string;
31
+ }
32
+ type SessionState = 'created' | 'starting' | 'idle' | 'running' | 'waiting_approval' | 'waiting_user' | 'compacting' | 'interrupted' | 'failed' | 'closed';
33
+ interface Session {
34
+ id: string;
35
+ workspaceId: string;
36
+ agent: string;
37
+ label: string;
38
+ state: SessionState;
39
+ archived: boolean;
40
+ historyOnly?: boolean;
41
+ externalSessionId: string | null;
42
+ pluginInstallationId: string | null;
43
+ capabilities: string[];
44
+ createdAt: string;
45
+ updatedAt: string;
46
+ }
47
+ interface SessionModelOption {
48
+ reference: string;
49
+ label: string;
50
+ provider: string | null;
51
+ id: string;
52
+ description: string | null;
53
+ isDefault: boolean;
54
+ defaultReasoningEffort: string | null;
55
+ reasoningEfforts: SessionReasoningOption[];
56
+ serviceTiers: SessionServiceTierOption[];
57
+ contextWindows?: SessionContextWindowOption[];
58
+ }
59
+ interface SessionReasoningOption {
60
+ id: string;
61
+ label: string;
62
+ description: string | null;
63
+ }
64
+ interface SessionContextWindowOption {
65
+ id: string;
66
+ label: string;
67
+ description: string | null;
68
+ tokens?: number | null;
69
+ }
70
+ interface SessionServiceTierOption {
71
+ id: string;
72
+ label: string;
73
+ description: string | null;
74
+ }
75
+ interface SessionModelCatalog {
76
+ parameterScope?: 'all-models' | 'current-model';
77
+ current: SessionModelOption | null;
78
+ models: SessionModelOption[];
79
+ currentReasoningEffort: string | null;
80
+ reasoningEfforts: SessionReasoningOption[];
81
+ currentServiceTier: string | null;
82
+ currentContextWindow?: string | null;
83
+ }
84
+ interface AgentGoal {
85
+ objective: string;
86
+ status: 'active' | 'paused' | 'completed' | 'cleared' | 'blocked' | 'usageLimited' | 'budgetLimited' | 'unknown';
87
+ tokenBudget: number | null;
88
+ tokensUsed: number | null;
89
+ timeUsedSeconds?: number | null;
90
+ updatedAt: string | null;
91
+ }
92
+ interface WorkspacePathSuggestion {
93
+ path: string;
94
+ isDirectory: boolean;
95
+ }
96
+ type AgentCommandCategory = 'agent' | 'skill' | 'extension';
97
+ type AgentCommandExecution = 'aibo' | 'adapter' | 'prompt';
98
+ interface AgentCommand {
99
+ insertionText?: string;
100
+ id?: string;
101
+ name: string;
102
+ aliases?: string[];
103
+ description: string | null;
104
+ source: 'extension' | 'prompt' | 'skill' | string;
105
+ category?: AgentCommandCategory;
106
+ execution?: AgentCommandExecution;
107
+ /** Legacy display metadata; binding determines command ownership. */
108
+ agent?: string;
109
+ enabled?: boolean;
110
+ argumentHint?: string;
111
+ capability?: string;
112
+ }
113
+ interface ContextAttachment {
114
+ schema: 'aibo.context-attachment/v1';
115
+ id: string;
116
+ workspaceId: string;
117
+ sessionId: string;
118
+ turnId: string | null;
119
+ path: string;
120
+ contentHash: string | null;
121
+ size: number | null;
122
+ mediaType: string;
123
+ source: 'picker' | 'drop' | 'manual' | string;
124
+ sendStrategy: 'reference' | 'inline' | string;
125
+ inlineContext?: string | null;
126
+ createdAt: string;
127
+ }
128
+ interface UserInputOption {
129
+ label: string;
130
+ description: string | null;
131
+ }
132
+ interface UserInputQuestion {
133
+ id: string;
134
+ header: string | null;
135
+ question: string;
136
+ options: UserInputOption[];
137
+ isOther: boolean;
138
+ }
139
+ interface UserInputRequest {
140
+ requestId: string;
141
+ sessionId: string;
142
+ turnId: string | null;
143
+ questions: UserInputQuestion[];
144
+ isBlocking: boolean;
145
+ }
146
+ interface ApprovalOption {
147
+ id: string;
148
+ kind: 'allow' | 'reject';
149
+ label: string | null;
150
+ }
151
+ /** A pending Agent approval of the selected session; the host revalidates every submitted choice. */
152
+ interface ApprovalRequest {
153
+ requestId: string;
154
+ sessionId: string;
155
+ turnId: string | null;
156
+ kind: string;
157
+ command: string | null;
158
+ cwd: string | null;
159
+ availableDecisions: ('accept' | 'cancel')[];
160
+ /** Empty for providers answering by decision. */
161
+ options: ApprovalOption[];
162
+ }
163
+ interface QueuedMessage {
164
+ id: string;
165
+ text: string;
166
+ status: 'pending' | 'sending' | 'failed' | 'uncertain';
167
+ error: string | null;
168
+ createdAt: string;
169
+ }
170
+ interface AgentQueueSnapshot {
171
+ items?: QueuedMessage[];
172
+ paused?: boolean;
173
+ revision?: number;
174
+ sessionId: string;
175
+ steering: string[];
176
+ followUp: string[];
177
+ updatedAt: string;
178
+ }
179
+ interface PiSessionTreeNode {
180
+ id: string;
181
+ parentId: string | null;
182
+ type: string;
183
+ timestamp: string;
184
+ role?: string;
185
+ summary?: string;
186
+ label?: string;
187
+ children: PiSessionTreeNode[];
188
+ }
189
+ interface PiSessionTreeSnapshot {
190
+ sessionId: string;
191
+ externalSessionId: string | null;
192
+ leafId: string | null;
193
+ tree: PiSessionTreeNode[];
194
+ }
195
+ /** Complete host conversation data, independent of framework and native APIs. */
196
+ export type PresentationConversation = {
197
+ workspace: {
198
+ id: string;
199
+ label: string;
200
+ path: string;
201
+ trust: string;
202
+ } | null;
203
+ session: Session | null;
204
+ goal: AgentGoal | null;
205
+ goalBusy?: boolean;
206
+ thread: {
207
+ id: string;
208
+ turnCount: number | null;
209
+ } | null;
210
+ timeline: {
211
+ id: string;
212
+ turnId: string | null;
213
+ role: string;
214
+ toolName: string | null;
215
+ entryType: string | null;
216
+ content: string;
217
+ status: string;
218
+ }[];
219
+ timelineVisibleCount: number;
220
+ /** Group ordinary system events; summaries and reasoning always remain separate. */
221
+ groupSystemItems?: boolean;
222
+ usage: {
223
+ input: number | null;
224
+ output: number | null;
225
+ total: number | null;
226
+ contextUsed: number | null;
227
+ contextLimit: number | null;
228
+ contextEstimated: boolean;
229
+ plan?: string | null;
230
+ limits?: {
231
+ id: string;
232
+ label: string | null;
233
+ usedPercent: number;
234
+ windowMinutes: number | null;
235
+ resetsAt: number | null;
236
+ }[];
237
+ credits?: {
238
+ balance: string | null;
239
+ unlimited: boolean;
240
+ } | null;
241
+ } | null;
242
+ retryPrompt: string | null;
243
+ retryReason: string | null;
244
+ userInputRequests: UserInputRequest[];
245
+ approvalRequests: ApprovalRequest[];
246
+ answerDrafts: Record<string, string>;
247
+ queue: AgentQueueSnapshot | null;
248
+ activityLabel: string | null;
249
+ compacting: boolean;
250
+ running: boolean;
251
+ archiving: boolean;
252
+ busy: boolean;
253
+ attachments: ContextAttachment[];
254
+ executionProfile: SessionExecutionProfile | null;
255
+ modelConfiguration: {
256
+ currentReasoningEffort: string | null;
257
+ selectedReasoningEffort: string | null;
258
+ defaultAction: 'preserve' | 'reset';
259
+ };
260
+ modelCatalog: SessionModelCatalog | null;
261
+ modelCatalogLoading: boolean;
262
+ modelOverride: string | null;
263
+ workspacePathSuggestions: WorkspacePathSuggestion[];
264
+ sessionSuggestions?: Session[];
265
+ agentCommands: AgentCommand[];
266
+ agentCommandsLoading: boolean;
267
+ draft: string;
268
+ draftFailed: boolean;
269
+ tree: PiSessionTreeSnapshot | null;
270
+ treeOpen: boolean;
271
+ treeNavigationStatus: string | null;
272
+ };
273
+ export type PresentationConversationOperation = 'copyCode' | 'openLink' | 'draft' | 'send' | 'stop' | 'retry' | 'queueSteer' | 'queueFollowUp' | 'clearQueue' | 'removeQueuedMessage' | 'sendQueuedMessage' | 'resumeQueue' | 'clearGoal' | 'pauseGoal' | 'resumeGoal' | 'addAttachments' | 'addDirectory' | 'removeAttachment' | 'selectPath' | 'selectSessionReference' | 'selectCommand' | 'openSubagent' | 'loadOlder' | 'fork' | 'loadModels' | 'selectModel' | 'selectServiceTier' | 'selectContextWindow' | 'selectAccess' | 'compact' | 'answer' | 'chooseAnswer' | 'submitAnswers' | 'cancelAnswers' | 'resolveApproval' | 'openTree' | 'closeTree' | 'refreshTree' | 'selectTreeNode';
274
+ export type PresentationConversationAction = {
275
+ token: string;
276
+ operation: PresentationConversationOperation;
277
+ event: 'click' | 'input' | 'change';
278
+ /** Fixed semantic arguments chosen by the host, not parameters supplied by package code. */
279
+ args: readonly (string | null)[];
280
+ };
281
+ export {};
@@ -0,0 +1 @@
1
+ export {};