@tangle-network/agent-app 0.50.8 → 0.50.10

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.
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  ChatEmptyState,
3
3
  ChatMessages
4
- } from "../chunk-ZYJCWKZ7.js";
5
- import "../chunk-F32T3DRJ.js";
4
+ } from "../chunk-O2UKPZRF.js";
5
+ import "../chunk-6AIJSXAX.js";
6
6
  import "../chunk-3HUFJ5LO.js";
7
7
  import "../chunk-FBVLEGEG.js";
8
8
  import "../chunk-ENLRJYVW.js";
9
9
  import {
10
10
  ChatComposer
11
- } from "../chunk-73MFUVSC.js";
11
+ } from "../chunk-FAIMAGJX.js";
12
12
  import "../chunk-L7MB2LLM.js";
13
13
  import {
14
14
  ModelPicker
15
- } from "../chunk-4I76LTZS.js";
15
+ } from "../chunk-YWHLMR3N.js";
16
16
  import "../chunk-BATKJP3P.js";
17
17
  import "../chunk-SJWIZT7B.js";
18
18
  import "../chunk-GEYACSFW.js";
@@ -22,7 +22,7 @@ import {
22
22
  import "../chunk-FQYAJYPW.js";
23
23
  import "../chunk-NU7QSZBR.js";
24
24
  import "../chunk-MCYJON3F.js";
25
- import "../chunk-OU3VTK3I.js";
25
+ import "../chunk-SUUQ2QCS.js";
26
26
  import "../chunk-RACQDXJ7.js";
27
27
  import "../chunk-X47R2IVO.js";
28
28
  import "../chunk-ZVEEWGDK.js";
@@ -7,7 +7,7 @@ import {
7
7
  normalizeModelId,
8
8
  resolveCatalogModelId,
9
9
  sortModelsByFreshness
10
- } from "../chunk-OU3VTK3I.js";
10
+ } from "../chunk-SUUQ2QCS.js";
11
11
  export {
12
12
  __resetCatalogCache,
13
13
  buildCatalog,
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ComposerModeControls,
3
3
  EntryComposer
4
- } from "../chunk-73MFUVSC.js";
4
+ } from "../chunk-FAIMAGJX.js";
5
5
  import "../chunk-L7MB2LLM.js";
6
- import "../chunk-4I76LTZS.js";
6
+ import "../chunk-YWHLMR3N.js";
7
7
  import "../chunk-SJWIZT7B.js";
8
8
  import "../chunk-NU7QSZBR.js";
9
9
  import "../chunk-MCYJON3F.js";
10
- import "../chunk-OU3VTK3I.js";
10
+ import "../chunk-SUUQ2QCS.js";
11
11
  import "../chunk-X47R2IVO.js";
12
12
  import "../chunk-TXD5HXLE.js";
13
13
  export {
@@ -2,7 +2,7 @@ import {
2
2
  OVERLAY_SHADOW,
3
3
  PopoverSurface,
4
4
  usePopover
5
- } from "./chunk-4I76LTZS.js";
5
+ } from "./chunk-YWHLMR3N.js";
6
6
  import {
7
7
  UNTITLED_SESSION_LABEL,
8
8
  mergeSessionPages,
@@ -812,4 +812,4 @@ export {
812
812
  formatSessionTimestamp,
813
813
  SessionHistoryPanel
814
814
  };
815
- //# sourceMappingURL=chunk-F32T3DRJ.js.map
815
+ //# sourceMappingURL=chunk-6AIJSXAX.js.map
@@ -11,7 +11,7 @@ import {
11
11
  pickerRootClass,
12
12
  quietPickerTriggerClass,
13
13
  usePopover
14
- } from "./chunk-4I76LTZS.js";
14
+ } from "./chunk-YWHLMR3N.js";
15
15
  import {
16
16
  filterCommandPaletteItems
17
17
  } from "./chunk-SJWIZT7B.js";
@@ -273,7 +273,7 @@ import {
273
273
  } from "react";
274
274
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
275
275
  function createLazyMentionEditor() {
276
- return lazy(() => import("./mention-editor-LQDBOPVP.js").then((m) => m.loadMentionEditor()));
276
+ return lazy(() => import("./mention-editor-NUQ2NJ6Z.js").then((m) => m.loadMentionEditor()));
277
277
  }
278
278
  var MentionEditorBoundary = class extends Component {
279
279
  state = { failed: false };
@@ -1853,4 +1853,4 @@ export {
1853
1853
  ComposerModeControls,
1854
1854
  EntryComposer
1855
1855
  };
1856
- //# sourceMappingURL=chunk-73MFUVSC.js.map
1856
+ //# sourceMappingURL=chunk-FAIMAGJX.js.map
@@ -23,7 +23,7 @@ import {
23
23
  PopoverSurface,
24
24
  usePending,
25
25
  usePopover
26
- } from "./chunk-4I76LTZS.js";
26
+ } from "./chunk-YWHLMR3N.js";
27
27
  import {
28
28
  filterCommandPaletteItems,
29
29
  groupCommandPaletteItems
@@ -1418,10 +1418,8 @@ async function streamChatTurn(opts) {
1418
1418
  // src/web-react/agent-profile-editor.tsx
1419
1419
  import { useEffect as useEffect5, useId, useState as useState7 } from "react";
1420
1420
  import { agentProfileSchema } from "@tangle-network/agent-interface/profile-schema";
1421
+ import { Button, Input, Textarea, Switch, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@tangle-network/sandbox-ui/primitives";
1421
1422
  import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1422
- var input = "min-h-10 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50";
1423
- var button = "rounded-lg border border-input bg-background px-3 py-2 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-50";
1424
- var remove = "text-destructive hover:underline disabled:opacity-50";
1425
1423
  function Field({ label, hint, children }) {
1426
1424
  return /* @__PURE__ */ jsxs5("label", { className: "block space-y-1.5 text-sm font-medium text-foreground", children: [
1427
1425
  /* @__PURE__ */ jsx7("span", { children: label }),
@@ -1438,6 +1436,21 @@ function Section({ title, description, children }) {
1438
1436
  children
1439
1437
  ] });
1440
1438
  }
1439
+ function Disclosure({ title, description, detail, children }) {
1440
+ return /* @__PURE__ */ jsxs5("details", { className: "group rounded-xl border border-border bg-card", children: [
1441
+ /* @__PURE__ */ jsxs5("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 rounded-xl p-4 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring sm:p-5", children: [
1442
+ /* @__PURE__ */ jsxs5("span", { children: [
1443
+ /* @__PURE__ */ jsx7("span", { className: "block text-base font-semibold text-foreground", children: title }),
1444
+ description && /* @__PURE__ */ jsx7("span", { className: "mt-1 block text-sm text-muted-foreground", children: description })
1445
+ ] }),
1446
+ /* @__PURE__ */ jsxs5("span", { className: "flex shrink-0 items-center gap-2 text-sm text-muted-foreground", children: [
1447
+ detail,
1448
+ /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1449
+ ] })
1450
+ ] }),
1451
+ /* @__PURE__ */ jsx7("div", { className: "space-y-4 border-t border-border p-4 sm:p-5", children })
1452
+ ] });
1453
+ }
1441
1454
  function issueMessage(error) {
1442
1455
  const issue = error.issues[0];
1443
1456
  return issue ? (issue.path.map(String).join(".") || "Profile") + ": " + issue.message : "Invalid profile";
@@ -1446,6 +1459,7 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1446
1459
  const id = useId();
1447
1460
  const [error, setError] = useState7(null);
1448
1461
  const [newTool, setNewTool] = useState7("");
1462
+ const [showAllTools, setShowAllTools] = useState7(false);
1449
1463
  const [mcpName, setMcpName] = useState7("");
1450
1464
  const [mcpKind, setMcpKind] = useState7("http");
1451
1465
  const [mcpTarget, setMcpTarget] = useState7("");
@@ -1495,7 +1509,7 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1495
1509
  function change(field, text) {
1496
1510
  setResourceDrafts((current) => ({ ...current, [key]: { ...draft, [field]: text } }));
1497
1511
  }
1498
- return /* @__PURE__ */ jsxs5(Section, { title, description, children: [
1512
+ return /* @__PURE__ */ jsxs5(Disclosure, { title, description, detail: refs.length ? refs.length + " added" : "Optional", children: [
1499
1513
  refs.length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "None added." }),
1500
1514
  /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: refs.map((ref, index) => /* @__PURE__ */ jsxs5("li", { className: "flex items-start justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
1501
1515
  /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
@@ -1504,10 +1518,11 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1504
1518
  ref.kind === "github" && ref.repository && /* @__PURE__ */ jsx7("span", { className: "block text-xs text-muted-foreground", children: ref.repository })
1505
1519
  ] }),
1506
1520
  /* @__PURE__ */ jsx7(
1507
- "button",
1521
+ Button,
1508
1522
  {
1509
1523
  type: "button",
1510
- className: remove,
1524
+ variant: "ghost",
1525
+ className: "text-destructive",
1511
1526
  disabled: editingDisabled,
1512
1527
  "aria-label": "Remove " + title.toLowerCase() + " " + (index + 1),
1513
1528
  onClick: () => resources(key, refs.filter((_, item) => item !== index)),
@@ -1516,23 +1531,16 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1516
1531
  )
1517
1532
  ] }, index)) }),
1518
1533
  /* @__PURE__ */ jsxs5("div", { className: "grid gap-3 rounded-lg border border-dashed border-border p-3 sm:grid-cols-[10rem_1fr]", children: [
1519
- /* @__PURE__ */ jsx7(Field, { label: "Source", children: /* @__PURE__ */ jsxs5(
1520
- "select",
1521
- {
1522
- className: input,
1523
- disabled: editingDisabled,
1524
- value: draft.kind,
1525
- onChange: (event) => change("kind", event.target.value),
1526
- children: [
1527
- /* @__PURE__ */ jsx7("option", { value: "github", children: "GitHub path" }),
1528
- /* @__PURE__ */ jsx7("option", { value: "inline", children: "Inline content" })
1529
- ]
1530
- }
1531
- ) }),
1534
+ /* @__PURE__ */ jsx7(Field, { label: "Source", children: /* @__PURE__ */ jsxs5(Select, { disabled: editingDisabled, value: draft.kind, onValueChange: (kind) => change("kind", kind), children: [
1535
+ /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Source", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
1536
+ /* @__PURE__ */ jsxs5(SelectContent, { children: [
1537
+ /* @__PURE__ */ jsx7(SelectItem, { value: "github", children: "GitHub path" }),
1538
+ /* @__PURE__ */ jsx7(SelectItem, { value: "inline", children: "Inline content" })
1539
+ ] })
1540
+ ] }) }),
1532
1541
  /* @__PURE__ */ jsx7(Field, { label: draft.kind === "github" ? "Path" : "Name", children: /* @__PURE__ */ jsx7(
1533
- "input",
1542
+ Input,
1534
1543
  {
1535
- className: input,
1536
1544
  disabled: editingDisabled,
1537
1545
  value: draft.kind === "github" ? draft.path : draft.name,
1538
1546
  onChange: (event) => change(draft.kind === "github" ? "path" : "name", event.target.value),
@@ -1540,15 +1548,15 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1540
1548
  }
1541
1549
  ) }),
1542
1550
  draft.kind === "inline" && /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Field, { label: "Content", children: /* @__PURE__ */ jsx7(
1543
- "textarea",
1551
+ Textarea,
1544
1552
  {
1545
- className: input + " min-h-28",
1553
+ className: "min-h-28",
1546
1554
  disabled: editingDisabled,
1547
1555
  value: draft.content,
1548
1556
  onChange: (event) => change("content", event.target.value)
1549
1557
  }
1550
1558
  ) }) }),
1551
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsxs5("button", { type: "button", className: button, disabled: editingDisabled, onClick: () => addResource(key), children: [
1559
+ /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsxs5(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => addResource(key), children: [
1552
1560
  "Add ",
1553
1561
  key === "skills" ? "skill" : "tool file"
1554
1562
  ] }) })
@@ -1589,104 +1597,125 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1589
1597
  }
1590
1598
  return /* @__PURE__ */ jsxs5("div", { className: "space-y-5 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
1591
1599
  error && /* @__PURE__ */ jsx7("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
1592
- /* @__PURE__ */ jsxs5(Section, { title: "Profile", description: "Name the agent and set its instructions. Replacing a system prompt changes how its harness behaves.", children: [
1600
+ jsonDirty && /* @__PURE__ */ jsx7("p", { role: "status", className: "rounded-lg border border-border bg-muted p-3 text-sm text-foreground", children: "Apply or discard edits in Advanced JSON before using the other fields." }),
1601
+ /* @__PURE__ */ jsxs5(Section, { title: "Profile", description: "Name the agent and set its instructions.", children: [
1593
1602
  /* @__PURE__ */ jsxs5("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1594
- /* @__PURE__ */ jsx7(Field, { label: "Name", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
1595
- /* @__PURE__ */ jsx7(Field, { label: "Description", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
1603
+ /* @__PURE__ */ jsx7(Field, { label: "Name", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
1604
+ /* @__PURE__ */ jsx7(Field, { label: "Description", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
1596
1605
  ] }),
1597
- /* @__PURE__ */ jsx7(Field, { label: "Agent instructions", hint: "Project-level instructions. Each entry remains separate.", children: /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1598
- (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2", children: [
1599
- /* @__PURE__ */ jsx7(
1600
- "textarea",
1601
- {
1602
- className: input + " min-h-20",
1603
- disabled: editingDisabled,
1604
- value: instruction,
1605
- onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
1606
- }
1607
- ),
1608
- /* @__PURE__ */ jsx7(
1609
- "button",
1606
+ /* @__PURE__ */ jsxs5("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
1607
+ /* @__PURE__ */ jsx7("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
1608
+ /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Project-level instructions. Each entry remains separate." }),
1609
+ /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
1610
+ (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs5("div", { className: "flex items-start gap-2", children: [
1611
+ /* @__PURE__ */ jsx7(
1612
+ Textarea,
1613
+ {
1614
+ "aria-label": "Instruction " + (index + 1),
1615
+ className: "min-h-20",
1616
+ disabled: editingDisabled,
1617
+ value: instruction,
1618
+ onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
1619
+ }
1620
+ ),
1621
+ /* @__PURE__ */ jsx7(
1622
+ Button,
1623
+ {
1624
+ type: "button",
1625
+ variant: "ghost",
1626
+ className: "pt-2 text-destructive",
1627
+ disabled: editingDisabled,
1628
+ "aria-label": "Remove instruction " + (index + 1),
1629
+ onClick: () => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).filter((_, i) => i !== index) }),
1630
+ children: "Remove"
1631
+ }
1632
+ )
1633
+ ] }, index)),
1634
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
1635
+ ] })
1636
+ ] }),
1637
+ /* @__PURE__ */ jsxs5("details", { className: "rounded-lg border border-border p-3", children: [
1638
+ /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer font-medium text-foreground", children: "System prompt overrides" }),
1639
+ /* @__PURE__ */ jsxs5("div", { className: "mt-4 space-y-4", children: [
1640
+ /* @__PURE__ */ jsx7(Field, { label: "Append to system prompt", hint: "Keeps the harness system prompt and adds this text.", children: /* @__PURE__ */ jsx7(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
1641
+ /* @__PURE__ */ jsx7(Field, { label: "Replace system prompt", hint: "Only use when the harness supports full replacement.", children: /* @__PURE__ */ jsx7(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.systemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value }) }) })
1642
+ ] })
1643
+ ] })
1644
+ ] }),
1645
+ /* @__PURE__ */ jsxs5(Section, { title: "Model", description: "Set model preferences. The host decides which models can run.", children: [
1646
+ /* @__PURE__ */ jsx7("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ jsx7(Field, { label: "Default model", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }) }),
1647
+ /* @__PURE__ */ jsxs5("details", { className: "rounded-lg border border-border p-3", children: [
1648
+ /* @__PURE__ */ jsx7("summary", { className: "cursor-pointer font-medium text-foreground", children: "More model settings" }),
1649
+ /* @__PURE__ */ jsxs5("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
1650
+ /* @__PURE__ */ jsx7(Field, { label: "Small model", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
1651
+ /* @__PURE__ */ jsx7(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
1652
+ /* @__PURE__ */ jsx7(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs5(
1653
+ Select,
1610
1654
  {
1611
- type: "button",
1612
- className: remove + " pt-2",
1613
1655
  disabled: editingDisabled,
1614
- "aria-label": "Remove instruction " + (index + 1),
1615
- onClick: () => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).filter((_, i) => i !== index) }),
1616
- children: "Remove"
1656
+ value: value.model?.reasoningEffort ?? "default",
1657
+ onValueChange: (level) => model({ ...value.model, reasoningEffort: level === "default" ? void 0 : level }),
1658
+ children: [
1659
+ /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Thinking level", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
1660
+ /* @__PURE__ */ jsxs5(SelectContent, { children: [
1661
+ /* @__PURE__ */ jsx7(SelectItem, { value: "default", children: "Harness default" }),
1662
+ ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx7(SelectItem, { value: level, children: level }, level))
1663
+ ] })
1664
+ ]
1617
1665
  }
1618
- )
1619
- ] }, index)),
1620
- /* @__PURE__ */ jsx7("button", { type: "button", className: button, disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
1621
- ] }) }),
1622
- /* @__PURE__ */ jsx7(Field, { label: "Append to system prompt", hint: "Keeps the harness system prompt and adds this text.", children: /* @__PURE__ */ jsx7("textarea", { className: input + " min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
1623
- /* @__PURE__ */ jsx7(Field, { label: "Replace system prompt", hint: "Only use when the harness supports full replacement.", children: /* @__PURE__ */ jsx7("textarea", { className: input + " min-h-24", disabled: editingDisabled, value: value.prompt?.systemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value }) }) })
1666
+ ) })
1667
+ ] })
1668
+ ] })
1624
1669
  ] }),
1625
- /* @__PURE__ */ jsx7(Section, { title: "Model", description: "Set model preferences. The host decides which models can run.", children: /* @__PURE__ */ jsxs5("div", { className: "grid gap-4 sm:grid-cols-2", children: [
1626
- /* @__PURE__ */ jsx7(Field, { label: "Default model", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }),
1627
- /* @__PURE__ */ jsx7(Field, { label: "Small model", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
1628
- /* @__PURE__ */ jsx7(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
1629
- /* @__PURE__ */ jsx7(Field, { label: "Thinking level", children: /* @__PURE__ */ jsxs5(
1630
- "select",
1631
- {
1632
- className: input,
1633
- disabled: editingDisabled,
1634
- value: value.model?.reasoningEffort ?? "",
1635
- onChange: (event) => model({ ...value.model, reasoningEffort: event.target.value ? event.target.value : void 0 }),
1636
- children: [
1637
- /* @__PURE__ */ jsx7("option", { value: "", children: "Harness default" }),
1638
- ["none", "minimal", "low", "medium", "high", "xhigh", "ultracode"].map((level) => /* @__PURE__ */ jsx7("option", { value: level, children: level }, level))
1639
- ]
1640
- }
1641
- ) })
1642
- ] }) }),
1643
- /* @__PURE__ */ jsxs5(Section, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", children: [
1670
+ /* @__PURE__ */ jsxs5(Disclosure, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", detail: Object.keys(value.tools ?? {}).length + " configured", children: [
1644
1671
  Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
1645
- /* @__PURE__ */ jsx7("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).map(([name, enabled]) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-border p-3 text-sm", children: [
1672
+ /* @__PURE__ */ jsx7("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-border p-3 text-sm", children: [
1646
1673
  /* @__PURE__ */ jsxs5("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
1647
1674
  /* @__PURE__ */ jsx7(
1648
- "input",
1675
+ Switch,
1649
1676
  {
1650
- type: "checkbox",
1651
1677
  disabled: editingDisabled,
1652
1678
  checked: enabled,
1653
- onChange: (event) => emit({ ...value, tools: { ...value.tools, [name]: event.target.checked } })
1679
+ onCheckedChange: (checked) => emit({ ...value, tools: { ...value.tools, [name]: checked } })
1654
1680
  }
1655
1681
  ),
1656
1682
  name
1657
1683
  ] }),
1658
- /* @__PURE__ */ jsxs5("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
1659
- "Permission",
1684
+ /* @__PURE__ */ jsxs5("div", { className: "flex min-w-36 items-center gap-2 text-muted-foreground", children: [
1685
+ /* @__PURE__ */ jsx7("span", { children: "Permission" }),
1660
1686
  /* @__PURE__ */ jsxs5(
1661
- "select",
1687
+ Select,
1662
1688
  {
1663
- className: "rounded-md border border-input bg-background px-2 py-1 text-foreground",
1664
1689
  disabled: editingDisabled,
1665
- value: typeof value.permissions?.[name] === "string" ? value.permissions[name] : "",
1666
- onChange: (event) => {
1690
+ value: typeof value.permissions?.[name] === "string" ? value.permissions[name] : "default",
1691
+ onValueChange: (permission) => {
1667
1692
  const permissions = { ...value.permissions };
1668
- if (event.target.value) permissions[name] = event.target.value;
1693
+ if (permission !== "default") permissions[name] = permission;
1669
1694
  else delete permissions[name];
1670
1695
  emit({ ...value, permissions });
1671
1696
  },
1672
1697
  children: [
1673
- /* @__PURE__ */ jsx7("option", { value: "", children: "Default" }),
1674
- /* @__PURE__ */ jsx7("option", { value: "allow", children: "Allow" }),
1675
- /* @__PURE__ */ jsx7("option", { value: "ask", children: "Ask" }),
1676
- /* @__PURE__ */ jsx7("option", { value: "deny", children: "Deny" })
1698
+ /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Permission for " + name, children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
1699
+ /* @__PURE__ */ jsxs5(SelectContent, { children: [
1700
+ /* @__PURE__ */ jsx7(SelectItem, { value: "default", children: "Default" }),
1701
+ /* @__PURE__ */ jsx7(SelectItem, { value: "allow", children: "Allow" }),
1702
+ /* @__PURE__ */ jsx7(SelectItem, { value: "ask", children: "Ask" }),
1703
+ /* @__PURE__ */ jsx7(SelectItem, { value: "deny", children: "Deny" })
1704
+ ] })
1677
1705
  ]
1678
1706
  }
1679
1707
  )
1680
1708
  ] }),
1681
- /* @__PURE__ */ jsx7("button", { type: "button", className: remove, disabled: editingDisabled, onClick: () => {
1709
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
1682
1710
  const tools = { ...value.tools };
1683
1711
  delete tools[name];
1684
1712
  emit({ ...value, tools });
1685
1713
  }, children: "Remove" })
1686
1714
  ] }, name)) }),
1715
+ Object.keys(value.tools ?? {}).length > 4 && /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", onClick: () => setShowAllTools((current) => !current), children: showAllTools ? "Show fewer rules" : "Show " + (Object.keys(value.tools ?? {}).length - 4) + " more rules" }),
1687
1716
  /* @__PURE__ */ jsxs5("div", { className: "flex gap-2", children: [
1688
- /* @__PURE__ */ jsx7("input", { "aria-label": "New tool name", className: input, disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
1689
- /* @__PURE__ */ jsx7("button", { type: "button", className: button, disabled: editingDisabled, onClick: () => {
1717
+ /* @__PURE__ */ jsx7(Input, { "aria-label": "New tool name", disabled: editingDisabled, value: newTool, onChange: (event) => setNewTool(event.target.value), placeholder: "Tool name" }),
1718
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => {
1690
1719
  const name = newTool.trim();
1691
1720
  if (!name || name in (value.tools ?? {})) {
1692
1721
  setError("Enter a unique tool name.");
@@ -1699,7 +1728,7 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1699
1728
  ] }),
1700
1729
  resourceSection("skills", "Skills", "Add skill packages from a repository or inline content."),
1701
1730
  resourceSection("tools", "Tool files", "Provide files that a supported harness can discover as tools."),
1702
- /* @__PURE__ */ jsxs5(Section, { title: "MCP servers", description: "Connect remote or local servers. Use secret references for credentials.", children: [
1731
+ /* @__PURE__ */ jsxs5(Disclosure, { title: "MCP servers", description: "Connect remote or local servers. Use secret references for credentials.", detail: Object.keys(value.mcp ?? {}).length + " connected", children: [
1703
1732
  Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No servers added." }),
1704
1733
  /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs5("li", { className: "flex items-center justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
1705
1734
  /* @__PURE__ */ jsxs5("div", { className: "min-w-0", children: [
@@ -1707,25 +1736,28 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1707
1736
  /* @__PURE__ */ jsx7("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
1708
1737
  server.enabled !== false && /* @__PURE__ */ jsx7("p", { className: "truncate text-xs text-muted-foreground", children: "command" in server ? server.command : server.url })
1709
1738
  ] }),
1710
- /* @__PURE__ */ jsx7("button", { type: "button", className: remove, disabled: editingDisabled, onClick: () => {
1739
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => {
1711
1740
  const mcp = { ...value.mcp };
1712
1741
  delete mcp[name];
1713
1742
  emit({ ...value, mcp });
1714
1743
  }, children: "Remove" })
1715
1744
  ] }, name)) }),
1716
1745
  /* @__PURE__ */ jsxs5("div", { className: "grid gap-3 rounded-lg border border-dashed border-border p-3 sm:grid-cols-[1fr_10rem]", children: [
1717
- /* @__PURE__ */ jsx7(Field, { label: "Server name", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
1718
- /* @__PURE__ */ jsx7(Field, { label: "Transport", children: /* @__PURE__ */ jsxs5("select", { className: input, disabled: editingDisabled, value: mcpKind, onChange: (event) => setMcpKind(event.target.value), children: [
1719
- /* @__PURE__ */ jsx7("option", { value: "http", children: "HTTP" }),
1720
- /* @__PURE__ */ jsx7("option", { value: "sse", children: "SSE" }),
1721
- /* @__PURE__ */ jsx7("option", { value: "stdio", children: "Local command" })
1746
+ /* @__PURE__ */ jsx7(Field, { label: "Server name", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
1747
+ /* @__PURE__ */ jsx7(Field, { label: "Transport", children: /* @__PURE__ */ jsxs5(Select, { disabled: editingDisabled, value: mcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
1748
+ /* @__PURE__ */ jsx7(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx7(SelectValue, {}) }),
1749
+ /* @__PURE__ */ jsxs5(SelectContent, { children: [
1750
+ /* @__PURE__ */ jsx7(SelectItem, { value: "http", children: "HTTP" }),
1751
+ /* @__PURE__ */ jsx7(SelectItem, { value: "sse", children: "SSE" }),
1752
+ /* @__PURE__ */ jsx7(SelectItem, { value: "stdio", children: "Local command" })
1753
+ ] })
1722
1754
  ] }) }),
1723
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Field, { label: mcpKind === "stdio" ? "Command" : "URL", children: /* @__PURE__ */ jsx7("input", { className: input, disabled: editingDisabled, value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: mcpKind === "stdio" ? "mcp-server" : "https://example.com/mcp" }) }) }),
1724
- /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7("button", { type: "button", className: button, disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
1755
+ /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Field, { label: mcpKind === "stdio" ? "Command" : "URL", children: /* @__PURE__ */ jsx7(Input, { disabled: editingDisabled, value: mcpTarget, onChange: (event) => setMcpTarget(event.target.value), placeholder: mcpKind === "stdio" ? "mcp-server" : "https://example.com/mcp" }) }) }),
1756
+ /* @__PURE__ */ jsx7("div", { className: "sm:col-span-2", children: /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: addMcp, children: "Add server" }) })
1725
1757
  ] }),
1726
1758
  /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
1727
1759
  ] }),
1728
- /* @__PURE__ */ jsxs5(Section, { title: "Resource files", description: "Mount files in the agent workspace. Edit paths and content in Advanced JSON.", children: [
1760
+ /* @__PURE__ */ jsxs5(Disclosure, { title: "Resource files", description: "Mount files in the agent workspace. Edit paths and content in Advanced JSON.", detail: (value.resources?.files ?? []).length + " mounted", children: [
1729
1761
  (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx7("p", { className: "text-sm text-muted-foreground", children: "No files mounted." }),
1730
1762
  /* @__PURE__ */ jsx7("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => /* @__PURE__ */ jsxs5("li", { className: "flex items-center justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
1731
1763
  /* @__PURE__ */ jsxs5("span", { className: "truncate", children: [
@@ -1736,19 +1768,19 @@ function AgentProfileEditor({ value, onChange, disabled = false, className }) {
1736
1768
  mount.resource.kind === "github" ? mount.resource.path : mount.resource.name
1737
1769
  ] })
1738
1770
  ] }),
1739
- /* @__PURE__ */ jsx7("button", { type: "button", className: remove, disabled: editingDisabled, onClick: () => emit({ ...value, resources: { ...value.resources, files: (value.resources?.files ?? []).filter((_, i) => i !== index) } }), children: "Remove" })
1771
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled: editingDisabled, onClick: () => emit({ ...value, resources: { ...value.resources, files: (value.resources?.files ?? []).filter((_, i) => i !== index) } }), children: "Remove" })
1740
1772
  ] }, index)) }),
1741
- /* @__PURE__ */ jsx7("button", { type: "button", className: button, disabled: editingDisabled, onClick: () => emit({ ...value, resources: { ...value.resources, files: [...value.resources?.files ?? [], { path: "new-file.md", resource: { kind: "inline", name: "New file", content: "" } }] } }), children: "Add file" })
1773
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => emit({ ...value, resources: { ...value.resources, files: [...value.resources?.files ?? [], { path: "new-file.md", resource: { kind: "inline", name: "New file", content: "" } }] } }), children: "Add file" })
1742
1774
  ] }),
1743
- /* @__PURE__ */ jsxs5(Section, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
1775
+ /* @__PURE__ */ jsxs5(Disclosure, { title: "Advanced JSON", description: "Edit the full canonical profile, including hooks, modes, connections, and extensions.", children: [
1744
1776
  /* @__PURE__ */ jsx7("label", { htmlFor: id + "-json", className: "sr-only", children: "Full profile JSON" }),
1745
- /* @__PURE__ */ jsx7("textarea", { id: id + "-json", className: input + " min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
1777
+ /* @__PURE__ */ jsx7(Textarea, { id: id + "-json", className: "min-h-72 font-mono text-xs", spellCheck: false, disabled, value: json, onChange: (event) => {
1746
1778
  setJson(event.target.value);
1747
1779
  setJsonDirty(true);
1748
1780
  } }),
1749
1781
  /* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap items-center gap-3", children: [
1750
- /* @__PURE__ */ jsx7("button", { type: "button", className: button, disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
1751
- jsonDirty && /* @__PURE__ */ jsx7("button", { type: "button", className: remove, disabled, onClick: () => {
1782
+ /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: disabled || !jsonDirty, onClick: applyJson, children: "Apply JSON" }),
1783
+ jsonDirty && /* @__PURE__ */ jsx7(Button, { type: "button", variant: "ghost", className: "text-destructive", disabled, onClick: () => {
1752
1784
  setJson(JSON.stringify(value, null, 2));
1753
1785
  setJsonDirty(false);
1754
1786
  setError(null);
@@ -1813,7 +1845,7 @@ async function responseBody(response) {
1813
1845
  }
1814
1846
  function createDurablePlanDecisionClient(options) {
1815
1847
  const fetchImpl = options.fetchImpl ?? fetch;
1816
- const urlFor = (input2) => typeof options.url === "function" ? options.url(input2) : options.url;
1848
+ const urlFor = (input) => typeof options.url === "function" ? options.url(input) : options.url;
1817
1849
  const read = async (response) => {
1818
1850
  const body = await responseBody(response);
1819
1851
  const result = parseDecisionResult(body);
@@ -1828,20 +1860,20 @@ function createDurablePlanDecisionClient(options) {
1828
1860
  );
1829
1861
  };
1830
1862
  return {
1831
- async current(input2) {
1832
- const rawUrl = urlFor(input2);
1863
+ async current(input) {
1864
+ const rawUrl = urlFor(input);
1833
1865
  const url = new URL(rawUrl, globalThis.location?.origin ?? "http://localhost");
1834
- url.searchParams.set("planId", input2.planId);
1835
- if (input2.revision !== void 0) url.searchParams.set("revision", String(input2.revision));
1866
+ url.searchParams.set("planId", input.planId);
1867
+ if (input.revision !== void 0) url.searchParams.set("revision", String(input.revision));
1836
1868
  const target = /^https?:/.test(rawUrl) ? url.toString() : `${url.pathname}${url.search}`;
1837
1869
  return read(await fetchImpl(target, { method: "GET" }));
1838
1870
  },
1839
- async decide(input2) {
1840
- const extra = typeof options.body === "function" ? options.body(input2) : options.body ?? {};
1841
- return read(await fetchImpl(urlFor(input2), {
1871
+ async decide(input) {
1872
+ const extra = typeof options.body === "function" ? options.body(input) : options.body ?? {};
1873
+ return read(await fetchImpl(urlFor(input), {
1842
1874
  method: "POST",
1843
1875
  headers: { "Content-Type": "application/json" },
1844
- body: JSON.stringify({ ...extra, ...input2 })
1876
+ body: JSON.stringify({ ...extra, ...input })
1845
1877
  }));
1846
1878
  }
1847
1879
  };
@@ -2680,16 +2712,16 @@ function rollUpProvenanceStanding(record, policy = DEFAULT_PROVENANCE_CONFIDENCE
2680
2712
  if (seen.has(record)) return "settled";
2681
2713
  seen.add(record);
2682
2714
  let standing = resolveProvenanceStanding(record, policy);
2683
- for (const input2 of record.inputs ?? []) {
2684
- standing = weakerProvenanceStanding(standing, rollUpProvenanceStanding(input2, policy, seen));
2715
+ for (const input of record.inputs ?? []) {
2716
+ standing = weakerProvenanceStanding(standing, rollUpProvenanceStanding(input, policy, seen));
2685
2717
  }
2686
2718
  return standing;
2687
2719
  }
2688
2720
  function sourcePhrase(source) {
2689
2721
  return source.locator ? `${source.label}, ${source.locator}` : source.label;
2690
2722
  }
2691
- function inputPhrase(input2) {
2692
- return input2.label ?? input2.display;
2723
+ function inputPhrase(input) {
2724
+ return input.label ?? input.display;
2693
2725
  }
2694
2726
  function describeProvenance(record) {
2695
2727
  const sources = record.sources ?? [];
@@ -3015,17 +3047,17 @@ function ProvenanceValue({
3015
3047
  loading.length > 0 && sources.length === 0 && /* @__PURE__ */ jsx9("p", { role: "status", className: "text-xs text-muted-foreground", children: "Looking up where this came from\u2026" }),
3016
3048
  inputs.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "border-t border-border pt-2", children: [
3017
3049
  /* @__PURE__ */ jsx9("p", { className: "text-xs font-medium uppercase tracking-[0.05em] text-muted-foreground", children: record.derivation ? `Computed from ${record.derivation}` : "Computed from" }),
3018
- /* @__PURE__ */ jsx9("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input2, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(
3050
+ /* @__PURE__ */ jsx9("ul", { className: "mt-1.5 space-y-1.5", children: inputs.map((input, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(
3019
3051
  ProvenanceValue,
3020
3052
  {
3021
- record: input2,
3053
+ record: input,
3022
3054
  onOpenSource,
3023
3055
  onRetrySource,
3024
3056
  confidencePolicy,
3025
3057
  maxDepth: maxDepth - 1,
3026
3058
  missingValueLabel
3027
3059
  }
3028
- ) }, `${input2.label ?? input2.display}-${index}`)) })
3060
+ ) }, `${input.label ?? input.display}-${index}`)) })
3029
3061
  ] })
3030
3062
  ]
3031
3063
  }
@@ -6512,4 +6544,4 @@ export {
6512
6544
  useThinkingSeconds,
6513
6545
  ChatMessages
6514
6546
  };
6515
- //# sourceMappingURL=chunk-ZYJCWKZ7.js.map
6547
+ //# sourceMappingURL=chunk-O2UKPZRF.js.map