jupyter-chat-components 0.3.0 → 0.4.0

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/lib/token.d.ts CHANGED
@@ -10,10 +10,18 @@ export declare const IComponentsRendererFactory: Token<IComponentsRendererFactor
10
10
  * The callback to approve or reject a tool.
11
11
  */
12
12
  export type ToolCallApproval = ((targetId: string, approvalId: string, approve: boolean) => void) | null;
13
+ /**
14
+ * The callback to submit a tool-call permission decision.
15
+ */
16
+ export type ToolCallPermissionDecision = ((sessionId: string, toolCallId: string, optionId: string) => Promise<void> | void) | null;
13
17
  /**
14
18
  * The callback to remove a queued message.
15
19
  */
16
20
  export type RemoveQueuedMessage = ((targetId: string, messageId: string) => void) | null;
21
+ /**
22
+ * The callback to open a file or resource path referenced by a tool call.
23
+ */
24
+ export type OpenToolCallPath = ((path: string) => void) | null;
17
25
  /**
18
26
  * The interface for components renderer factory.
19
27
  */
@@ -30,6 +38,14 @@ export interface IComponentsRendererFactory extends IRenderMime.IRendererFactory
30
38
  * The callback to remove a queued message.
31
39
  */
32
40
  removeQueuedMessage: RemoveQueuedMessage;
41
+ /**
42
+ * The callback to submit a permission decision for grouped tool calls.
43
+ */
44
+ toolCallPermissionDecision: ToolCallPermissionDecision;
45
+ /**
46
+ * The callback to open a path referenced by grouped tool calls.
47
+ */
48
+ openToolCallPath: OpenToolCallPath;
33
49
  }
34
50
  /**
35
51
  * The interface for the component registry.
@@ -72,6 +88,102 @@ export interface IComponentProps {
72
88
  */
73
89
  trans: TranslationBundle;
74
90
  }
91
+ /**
92
+ * A file diff entry for grouped tool calls.
93
+ */
94
+ export interface IToolCallDiff {
95
+ /**
96
+ * Path of the file being diffed.
97
+ */
98
+ path: string;
99
+ /**
100
+ * Updated text content.
101
+ */
102
+ newText: string;
103
+ /**
104
+ * Previous text content.
105
+ */
106
+ oldText?: string;
107
+ }
108
+ /**
109
+ * A permission option for grouped tool calls.
110
+ */
111
+ export interface IToolCallPermissionOption {
112
+ /**
113
+ * Stable permission option identifier.
114
+ */
115
+ optionId: string;
116
+ /**
117
+ * Human-readable button label.
118
+ */
119
+ name: string;
120
+ /**
121
+ * Optional semantic option kind, such as allow_once or reject_once.
122
+ */
123
+ kind?: string;
124
+ }
125
+ /**
126
+ * A single grouped tool call entry.
127
+ */
128
+ export interface IToolCallsEntry {
129
+ /**
130
+ * Unique tool call identifier.
131
+ */
132
+ toolCallId: string;
133
+ /**
134
+ * Human-readable title displayed in the UI.
135
+ */
136
+ title?: string;
137
+ /**
138
+ * Tool operation category.
139
+ */
140
+ kind?: string;
141
+ /**
142
+ * Current tool call status.
143
+ */
144
+ status?: string;
145
+ /**
146
+ * Tool input payload.
147
+ */
148
+ rawInput?: unknown;
149
+ /**
150
+ * Tool output payload.
151
+ */
152
+ rawOutput?: unknown;
153
+ /**
154
+ * File paths or resource locations referenced by the tool call.
155
+ */
156
+ locations?: string[];
157
+ /**
158
+ * Permission options presented to the user.
159
+ */
160
+ permissionOptions?: IToolCallPermissionOption[];
161
+ /**
162
+ * Permission request lifecycle state.
163
+ */
164
+ permissionStatus?: 'pending' | 'resolved';
165
+ /**
166
+ * Selected permission option identifier.
167
+ */
168
+ selectedOptionId?: string;
169
+ /**
170
+ * Session identifier used to route permission decisions.
171
+ */
172
+ sessionId?: string;
173
+ /**
174
+ * Optional inline file diffs associated with the tool call.
175
+ */
176
+ diffs?: IToolCallDiff[];
177
+ }
178
+ /**
179
+ * Metadata for rendering grouped tool calls.
180
+ */
181
+ export interface IToolCallsMetadata {
182
+ /**
183
+ * List of tool call entries.
184
+ */
185
+ toolCalls: IToolCallsEntry[];
186
+ }
75
187
  /**
76
188
  * A file diff target.
77
189
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jupyter-chat-components",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Components to displayed in jupyter chat",
5
5
  "keywords": [
6
6
  "jupyter",