@parallelworks/ui 0.35.0 → 0.36.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.
@@ -291,6 +291,12 @@ function ConfirmApproval({ part, onAnswer }) {
291
291
  const t = strings.agentTranscript;
292
292
  const [feedback, setFeedback] = useState(null);
293
293
  const answer = (a) => onAnswer?.(part.id, a);
294
+ const [allowLabel, denyLabel] = {
295
+ command: [t.allowOnce, t.deny],
296
+ code: [t.allowCode, t.denyCode],
297
+ path: [t.allowPath, t.denyPath],
298
+ call: [t.allowCall, t.denyCall]
299
+ }[part.subject ?? "command"];
294
300
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
295
301
  part.command && /* @__PURE__ */ jsx("pre", {
296
302
  className: "overflow-x-auto rounded-md bg-(--theme-muted-panel-bg) p-2 font-mono text-xs whitespace-pre-wrap",
@@ -313,7 +319,7 @@ function ConfirmApproval({ part, onAnswer }) {
313
319
  allowed: true
314
320
  }),
315
321
  className: "px-3 py-1 text-xs font-medium rounded-full bg-(--theme-element) text-(--theme-element-text)",
316
- children: t.allowOnce
322
+ children: allowLabel
317
323
  }),
318
324
  part.canAllowDirectory !== false && /* @__PURE__ */ jsx("button", {
319
325
  type: "button",
@@ -332,7 +338,7 @@ function ConfirmApproval({ part, onAnswer }) {
332
338
  allowed: false
333
339
  }),
334
340
  className: "px-3 py-1 text-xs font-medium rounded-full border theme-border hover:theme-hover text-red-600",
335
- children: t.deny
341
+ children: denyLabel
336
342
  }),
337
343
  /* @__PURE__ */ jsx("button", {
338
344
  type: "button",
@@ -183,6 +183,12 @@ export interface ChatStrings {
183
183
  allowOnce: string;
184
184
  allowDirectory: string;
185
185
  deny: string;
186
+ allowCode: string;
187
+ denyCode: string;
188
+ allowPath: string;
189
+ denyPath: string;
190
+ allowCall: string;
191
+ denyCall: string;
186
192
  denyWithFeedback: string;
187
193
  feedbackPlaceholder: string;
188
194
  send: string;
@@ -183,6 +183,12 @@ var defaultChatStrings = {
183
183
  allowOnce: "Yes, allow this command",
184
184
  allowDirectory: "Yes, and allow this directory for the session",
185
185
  deny: "No, deny this command",
186
+ allowCode: "Yes, run this code",
187
+ denyCode: "No, don't run this code",
188
+ allowPath: "Yes, allow this once",
189
+ denyPath: "No, deny",
190
+ allowCall: "Yes, allow this call",
191
+ denyCall: "No, deny this call",
186
192
  denyWithFeedback: "No, and provide feedback to the agent",
187
193
  feedbackPlaceholder: "Tell the agent what to do instead…",
188
194
  send: "Send",
@@ -84,11 +84,13 @@ export type ApprovalAnswerValue = {
84
84
  text: string;
85
85
  chat?: boolean;
86
86
  };
87
+ export type ApprovalSubject = 'command' | 'code' | 'path' | 'call';
87
88
  export interface ApprovalPart {
88
89
  kind: 'approval';
89
90
  id: string;
90
91
  approvalKind: 'confirm' | 'ask' | 'plan';
91
92
  toolName?: string;
93
+ subject?: ApprovalSubject;
92
94
  command?: string;
93
95
  reason?: string;
94
96
  agent?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/ui",
3
- "version": "0.35.0",
3
+ "version": "0.36.0",
4
4
  "description": "React UI components: a theme contract, icons, primitives, lists, forms, a job graph, a code editor, a log viewer, a file explorer and an AI chat, each on its own subpath",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {