@tangle-network/agent-app 0.60.42 → 0.60.44

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.
@@ -81,6 +81,8 @@ export declare const NATIVE_COMPLETION_RECEIPT_MAX_BYTES: number;
81
81
  export declare function boundNativeCompletionReceipt(receipt: NativeCompletionReceipt, maxBytes?: number): NativeCompletionReceipt;
82
82
  /** Assemble admitted exact receipts in dispatch order. Missing usage stays unknown. */
83
83
  export declare function aggregateNativeCompletionReceipts(turns: readonly NativeCompletionTurnReceipt[]): NativeCompletionReceipt;
84
+ /** The failure a completed run with an aborted tool call settles with. */
85
+ export declare const TOOL_ABORTED_ERROR = "The Sandbox aborted a tool call before the turn finished, as when its runtime restarts mid-turn";
84
86
  /**
85
87
  * Observe only the turns admitted under `executionId`. Transport failures throw
86
88
  * so the durable owner retries. A missing or partial terminal record remains
@@ -438,109 +438,109 @@ function HubApprovalDock({ items, onDecide, permissions, onOpen, focusId, classN
438
438
  setSubmitting(null);
439
439
  }
440
440
  }
441
- return /* @__PURE__ */ jsxs3(
441
+ const card = /* @__PURE__ */ jsxs3(Fragment, { children: [
442
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3 px-4 pt-3", children: [
443
+ /* @__PURE__ */ jsx3(HubProviderMark, { providerId: presentation.provider.id, name: presentation.provider.name, size: 28 }),
444
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
445
+ /* @__PURE__ */ jsx3("h3", { className: "line-clamp-2 break-words text-base font-semibold leading-6 text-foreground", title: presentation.title, children: presentation.title }),
446
+ /* @__PURE__ */ jsx3("p", { className: "truncate text-sm text-muted-foreground", children: subtitle })
447
+ ] }),
448
+ /* @__PURE__ */ jsx3(
449
+ Button2,
450
+ {
451
+ variant: "ghost",
452
+ size: "icon-sm",
453
+ "aria-label": collapsed ? "Show the request" : "Hide the preview",
454
+ "aria-expanded": !collapsed,
455
+ onClick: () => setCollapsed((value) => !value),
456
+ children: /* @__PURE__ */ jsx3(ChevronDown, { className: `transition-transform ${collapsed ? "-rotate-90" : ""}` })
457
+ }
458
+ )
459
+ ] }),
460
+ !collapsed && /* @__PURE__ */ jsxs3("div", { className: "max-h-48 space-y-3 overflow-y-auto px-4 pt-3 sm:max-h-80", children: [
461
+ active.bundle?.steps && active.bundle.steps.length > 0 && /* @__PURE__ */ jsx3("ol", { className: "space-y-1 text-sm", "aria-label": "Steps this approval covers", children: active.bundle.steps.map((stepItem, index) => /* @__PURE__ */ jsxs3("li", { className: `flex items-center gap-2 ${stepItem.state === "current" ? "font-medium text-foreground" : "text-muted-foreground"}`, children: [
462
+ /* @__PURE__ */ jsx3("span", { className: `flex size-5 shrink-0 items-center justify-center rounded-full border text-sm tabular-nums ${stepItem.state === "done" ? "border-transparent bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : "border-border"}`, children: stepItem.state === "done" ? /* @__PURE__ */ jsx3(Check, { "aria-hidden": true, className: "size-3.5" }) : index + 1 }),
463
+ stepItem.label
464
+ ] }, index)) }),
465
+ /* @__PURE__ */ jsx3(HubActionPreviewView, { preview: presentation.preview, account: active.account }),
466
+ /* @__PURE__ */ jsx3(HubRawDetails, { sections: [{ label: "Call", value: { action: active.actionPath, input: active.input } }] })
467
+ ] }),
468
+ /* @__PURE__ */ jsxs3("div", { className: "space-y-3 px-4 pb-4 pt-3", children: [
469
+ busy && submitting && !HUB_APPROVAL_ACTIVE_PHASES.has(active.phase) && active.phase === "waiting" && /* @__PURE__ */ jsxs3("p", { role: "status", className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
470
+ /* @__PURE__ */ jsx3(Loader2, { "aria-hidden": true, className: "size-4 animate-spin text-[var(--surface-info-text)]" }),
471
+ submitting.label
472
+ ] }),
473
+ /* @__PURE__ */ jsx3(Progress, { item: active }),
474
+ error?.id === active.id && active.phase === "waiting" && /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-sm text-[var(--surface-danger-text)]", children: error.message }),
475
+ HUB_APPROVAL_OPEN_PHASES.has(active.phase) && active.wait && /* @__PURE__ */ jsx3(HubApprovalWaitNote, { wait: active.wait }),
476
+ active.phase === "blocked" && !active.wait && /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: "The workspace owner approves this request." }),
477
+ decidable && permissionsOpen && scopes.length > 0 && /* @__PURE__ */ jsxs3("fieldset", { className: "space-y-2 rounded-xl border border-border bg-muted/30 px-3 py-3", children: [
478
+ /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: "Standing permission" }),
479
+ scopes.length > 1 && /* @__PURE__ */ jsx3(
480
+ RadioGroup,
481
+ {
482
+ "aria-label": "What the permission covers",
483
+ value: chosenScope ?? void 0,
484
+ onValueChange: setScope,
485
+ className: "gap-1.5",
486
+ children: scopes.map((option) => /* @__PURE__ */ jsxs3("div", { className: "flex min-h-8 items-center gap-2", children: [
487
+ /* @__PURE__ */ jsx3(RadioGroupItem, { id: `hub-scope-${active.id}-${option.id}`, value: option.id }),
488
+ /* @__PURE__ */ jsx3(Label, { htmlFor: `hub-scope-${active.id}-${option.id}`, className: "cursor-pointer text-sm font-normal text-foreground", children: option.label })
489
+ ] }, option.id))
490
+ }
491
+ ),
492
+ scopes.length === 1 && /* @__PURE__ */ jsx3("p", { className: "text-sm text-foreground", children: scopes[0]?.label }),
493
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap gap-2", children: [
494
+ /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => chosenScope && void decide({ kind: "allow", duration: "24h", scope: chosenScope }, "Approving and allowing for 24 hours\u2026"), children: "Approve and allow for 24 hours" }),
495
+ /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => chosenScope && void decide({ kind: "allow", duration: "always", scope: chosenScope }, "Approving and allowing from now on\u2026"), children: "Approve and always allow" })
496
+ ] })
497
+ ] }),
498
+ /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2", children: [
499
+ decidable && /* @__PURE__ */ jsxs3(Fragment, { children: [
500
+ /* @__PURE__ */ jsx3(Button2, { onClick: () => void decide({ kind: "approve" }, "Approving\u2026"), children: "Approve" }),
501
+ /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => void decide({ kind: "deny" }, "Denying\u2026"), children: "Deny" }),
502
+ scopes.length > 0 && /* @__PURE__ */ jsx3(Button2, { variant: "ghost", "aria-expanded": permissionsOpen, onClick: () => setPermissionsOpen((value) => !value), children: permissionsOpen ? "Fewer options" : "Allow future calls\u2026" })
503
+ ] }),
504
+ (active.phase === "failed" || active.phase === "unknown") && /* @__PURE__ */ jsxs3(Button2, { variant: "outline", onClick: () => setDismissed((current) => /* @__PURE__ */ new Set([...current, active.id])), children: [
505
+ /* @__PURE__ */ jsx3(X, { "aria-hidden": true }),
506
+ " Dismiss"
507
+ ] }),
508
+ /* @__PURE__ */ jsx3("span", { className: "flex-1" }),
509
+ decidable && choices && "never" in choices && !active.wait && /* @__PURE__ */ jsx3("span", { className: "text-sm text-muted-foreground", children: choices.never }),
510
+ onOpen && /* @__PURE__ */ jsx3(Button2, { variant: "ghost", onClick: () => onOpen(active), children: "View in chat" })
511
+ ] })
512
+ ] })
513
+ ] });
514
+ return /* @__PURE__ */ jsx3(
442
515
  "section",
443
516
  {
444
517
  "aria-label": active.phase === "unknown" ? "Action may have run" : "Waiting for your approval",
445
518
  "data-hub-approval-dock": active.id,
446
519
  className: `overflow-hidden rounded-2xl border border-[var(--surface-warning-border)] bg-card shadow-md ${className}`,
447
- children: [
448
- queue.length > 1 && /* @__PURE__ */ jsxs3("div", { className: "border-b border-border bg-muted/40 px-1.5 pb-1.5 pt-2", children: [
449
- /* @__PURE__ */ jsx3("p", { className: "px-2 pb-1 text-sm font-medium text-muted-foreground", "aria-live": "polite", children: waitingCount === 0 ? `${queue.length} requests` : waitingCount === 1 ? "1 request waiting" : `${waitingCount} requests waiting` }),
450
- /* @__PURE__ */ jsx3("ul", { "aria-label": "Requests in this conversation", className: "max-h-32 space-y-0.5 overflow-y-auto sm:max-h-40", children: queue.map((item) => {
451
- const shown = presentHubAction(item);
452
- const current = item.id === active.id;
453
- return /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(
454
- Button2,
455
- {
456
- variant: "bare",
457
- "aria-current": current ? "true" : void 0,
458
- onClick: () => {
459
- setActiveId(item.id);
460
- setCollapsed(false);
461
- },
462
- className: `flex min-h-10 w-full items-center gap-2.5 rounded-lg px-2 text-left transition-colors ${current ? "bg-card shadow-sm" : "hover:bg-card/70"}`,
463
- children: [
464
- /* @__PURE__ */ jsx3(HubProviderMark, { providerId: shown.provider.id, name: shown.provider.name, size: 24 }),
465
- /* @__PURE__ */ jsx3("span", { className: "min-w-0 flex-1 truncate text-sm font-medium text-foreground", children: item.phase === "done" ? hubActionReceipt(item).title : shown.title }),
466
- /* @__PURE__ */ jsx3(HubApprovalPhasePill, { phase: item.phase, label: openPhaseLabel(item) })
467
- ]
468
- }
469
- ) }, item.id);
470
- }) })
471
- ] }),
472
- /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3 px-4 pt-3", children: [
473
- /* @__PURE__ */ jsx3(HubProviderMark, { providerId: presentation.provider.id, name: presentation.provider.name, size: 28 }),
474
- /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
475
- /* @__PURE__ */ jsx3("h3", { className: "line-clamp-2 break-words text-base font-semibold leading-6 text-foreground", title: presentation.title, children: presentation.title }),
476
- /* @__PURE__ */ jsx3("p", { className: "truncate text-sm text-muted-foreground", children: subtitle })
477
- ] }),
478
- /* @__PURE__ */ jsx3(
520
+ children: queue.length > 1 ? /* @__PURE__ */ jsxs3("div", { className: "max-h-[70vh] overflow-y-auto pt-2.5", children: [
521
+ /* @__PURE__ */ jsx3("p", { className: "px-4 pb-1.5 text-sm font-medium text-muted-foreground", "aria-live": "polite", children: waitingCount === 0 ? `${queue.length} requests` : waitingCount === 1 ? "1 request waiting" : `${waitingCount} requests waiting` }),
522
+ /* @__PURE__ */ jsx3("ul", { "aria-label": "Requests in this conversation", className: "divide-y divide-border border-t border-border", children: queue.map((item) => {
523
+ if (item.id === active.id) return /* @__PURE__ */ jsx3("li", { "aria-current": "true", children: card }, item.id);
524
+ const shown = presentHubAction(item);
525
+ return /* @__PURE__ */ jsx3("li", { children: /* @__PURE__ */ jsxs3(
479
526
  Button2,
480
527
  {
481
- variant: "ghost",
482
- size: "icon-sm",
483
- "aria-label": collapsed ? "Show the request" : "Hide the preview",
484
- "aria-expanded": !collapsed,
485
- onClick: () => setCollapsed((value) => !value),
486
- children: /* @__PURE__ */ jsx3(ChevronDown, { className: `transition-transform ${collapsed ? "-rotate-90" : ""}` })
528
+ variant: "bare",
529
+ "data-hub-approval-dock-row": item.id,
530
+ onClick: () => {
531
+ setActiveId(item.id);
532
+ setCollapsed(false);
533
+ },
534
+ className: "flex min-h-11 w-full items-center gap-2.5 px-4 text-left transition-colors hover:bg-muted/60",
535
+ children: [
536
+ /* @__PURE__ */ jsx3(HubProviderMark, { providerId: shown.provider.id, name: shown.provider.name, size: 24 }),
537
+ /* @__PURE__ */ jsx3("span", { className: "min-w-0 flex-1 truncate text-sm font-medium text-foreground", children: item.phase === "done" ? hubActionReceipt(item).title : shown.title }),
538
+ /* @__PURE__ */ jsx3("span", { className: item.phase === "waiting" ? "hidden sm:inline-flex" : "inline-flex", children: /* @__PURE__ */ jsx3(HubApprovalPhasePill, { phase: item.phase, label: openPhaseLabel(item) }) })
539
+ ]
487
540
  }
488
- )
489
- ] }),
490
- !collapsed && /* @__PURE__ */ jsxs3("div", { className: "max-h-48 space-y-3 overflow-y-auto px-4 pt-3 sm:max-h-80", children: [
491
- active.bundle?.steps && active.bundle.steps.length > 0 && /* @__PURE__ */ jsx3("ol", { className: "space-y-1 text-sm", "aria-label": "Steps this approval covers", children: active.bundle.steps.map((stepItem, index) => /* @__PURE__ */ jsxs3("li", { className: `flex items-center gap-2 ${stepItem.state === "current" ? "font-medium text-foreground" : "text-muted-foreground"}`, children: [
492
- /* @__PURE__ */ jsx3("span", { className: `flex size-5 shrink-0 items-center justify-center rounded-full border text-sm tabular-nums ${stepItem.state === "done" ? "border-transparent bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : "border-border"}`, children: stepItem.state === "done" ? /* @__PURE__ */ jsx3(Check, { "aria-hidden": true, className: "size-3.5" }) : index + 1 }),
493
- stepItem.label
494
- ] }, index)) }),
495
- /* @__PURE__ */ jsx3(HubActionPreviewView, { preview: presentation.preview, account: active.account }),
496
- /* @__PURE__ */ jsx3(HubRawDetails, { sections: [{ label: "Call", value: { action: active.actionPath, input: active.input } }] })
497
- ] }),
498
- /* @__PURE__ */ jsxs3("div", { className: "space-y-3 px-4 pb-4 pt-3", children: [
499
- busy && submitting && !HUB_APPROVAL_ACTIVE_PHASES.has(active.phase) && active.phase === "waiting" && /* @__PURE__ */ jsxs3("p", { role: "status", className: "flex items-center gap-2 text-sm font-medium text-foreground", children: [
500
- /* @__PURE__ */ jsx3(Loader2, { "aria-hidden": true, className: "size-4 animate-spin text-[var(--surface-info-text)]" }),
501
- submitting.label
502
- ] }),
503
- /* @__PURE__ */ jsx3(Progress, { item: active }),
504
- error?.id === active.id && active.phase === "waiting" && /* @__PURE__ */ jsx3("p", { role: "alert", className: "text-sm text-[var(--surface-danger-text)]", children: error.message }),
505
- HUB_APPROVAL_OPEN_PHASES.has(active.phase) && active.wait && /* @__PURE__ */ jsx3(HubApprovalWaitNote, { wait: active.wait }),
506
- active.phase === "blocked" && !active.wait && /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: "The workspace owner approves this request." }),
507
- decidable && permissionsOpen && scopes.length > 0 && /* @__PURE__ */ jsxs3("fieldset", { className: "space-y-2 rounded-xl border border-border bg-muted/30 px-3 py-3", children: [
508
- /* @__PURE__ */ jsx3("legend", { className: "sr-only", children: "Standing permission" }),
509
- scopes.length > 1 && /* @__PURE__ */ jsx3(
510
- RadioGroup,
511
- {
512
- "aria-label": "What the permission covers",
513
- value: chosenScope ?? void 0,
514
- onValueChange: setScope,
515
- className: "gap-1.5",
516
- children: scopes.map((option) => /* @__PURE__ */ jsxs3("div", { className: "flex min-h-8 items-center gap-2", children: [
517
- /* @__PURE__ */ jsx3(RadioGroupItem, { id: `hub-scope-${active.id}-${option.id}`, value: option.id }),
518
- /* @__PURE__ */ jsx3(Label, { htmlFor: `hub-scope-${active.id}-${option.id}`, className: "cursor-pointer text-sm font-normal text-foreground", children: option.label })
519
- ] }, option.id))
520
- }
521
- ),
522
- scopes.length === 1 && /* @__PURE__ */ jsx3("p", { className: "text-sm text-foreground", children: scopes[0]?.label }),
523
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap gap-2", children: [
524
- /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => chosenScope && void decide({ kind: "allow", duration: "24h", scope: chosenScope }, "Approving and allowing for 24 hours\u2026"), children: "Approve and allow for 24 hours" }),
525
- /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => chosenScope && void decide({ kind: "allow", duration: "always", scope: chosenScope }, "Approving and allowing from now on\u2026"), children: "Approve and always allow" })
526
- ] })
527
- ] }),
528
- /* @__PURE__ */ jsxs3("div", { className: "flex flex-wrap items-center gap-2", children: [
529
- decidable && /* @__PURE__ */ jsxs3(Fragment, { children: [
530
- /* @__PURE__ */ jsx3(Button2, { onClick: () => void decide({ kind: "approve" }, "Approving\u2026"), children: "Approve" }),
531
- /* @__PURE__ */ jsx3(Button2, { variant: "outline", onClick: () => void decide({ kind: "deny" }, "Denying\u2026"), children: "Deny" }),
532
- scopes.length > 0 && /* @__PURE__ */ jsx3(Button2, { variant: "ghost", "aria-expanded": permissionsOpen, onClick: () => setPermissionsOpen((value) => !value), children: permissionsOpen ? "Fewer options" : "Allow future calls\u2026" })
533
- ] }),
534
- (active.phase === "failed" || active.phase === "unknown") && /* @__PURE__ */ jsxs3(Button2, { variant: "outline", onClick: () => setDismissed((current) => /* @__PURE__ */ new Set([...current, active.id])), children: [
535
- /* @__PURE__ */ jsx3(X, { "aria-hidden": true }),
536
- " Dismiss"
537
- ] }),
538
- /* @__PURE__ */ jsx3("span", { className: "flex-1" }),
539
- decidable && choices && "never" in choices && !active.wait && /* @__PURE__ */ jsx3("span", { className: "text-sm text-muted-foreground", children: choices.never }),
540
- onOpen && /* @__PURE__ */ jsx3(Button2, { variant: "ghost", onClick: () => onOpen(active), children: "View in chat" })
541
- ] })
542
- ] })
543
- ]
541
+ ) }, item.id);
542
+ }) })
543
+ ] }) : card
544
544
  }
545
545
  );
546
546
  }