@tangle-network/agent-app 0.58.4 → 0.58.6

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,6 +1,6 @@
1
1
  import {
2
2
  chatToolCallPart
3
- } from "../chunk-OHRL6TO3.js";
3
+ } from "../chunk-5NRXHO32.js";
4
4
  import "../chunk-X374TCDT.js";
5
5
  import "../chunk-3HUFJ5LO.js";
6
6
  import "../chunk-FBVLEGEG.js";
@@ -42,7 +42,7 @@ import {
42
42
  flattenHistory,
43
43
  readSandboxBinaryBytes,
44
44
  statSandboxFileSize
45
- } from "../chunk-Q3XW5YKR.js";
45
+ } from "../chunk-K7MN4RPX.js";
46
46
  import "../chunk-MCYJON3F.js";
47
47
  import "../chunk-LWSJK546.js";
48
48
  import "../chunk-W5VBZTNN.js";
@@ -1671,19 +1671,19 @@ function Field({ label, hint, children }) {
1671
1671
  ] });
1672
1672
  }
1673
1673
  function Section({ title, description, children }) {
1674
- return /* @__PURE__ */ jsxs6("section", { className: "space-y-4 rounded-xl border border-border bg-card p-4 sm:p-5", children: [
1674
+ return /* @__PURE__ */ jsxs6("section", { className: "grid min-w-0 gap-4 border-t border-border py-6 first:border-t-0 first:pt-0 sm:grid-cols-[9rem_minmax(0,1fr)] sm:gap-6", children: [
1675
1675
  /* @__PURE__ */ jsxs6("div", { children: [
1676
- /* @__PURE__ */ jsx8("h2", { className: "text-base font-semibold text-foreground", children: title }),
1676
+ /* @__PURE__ */ jsx8("h2", { className: "text-sm font-medium text-muted-foreground", children: title }),
1677
1677
  description && /* @__PURE__ */ jsx8("p", { className: "mt-1 text-sm text-muted-foreground", children: description })
1678
1678
  ] }),
1679
- children
1679
+ /* @__PURE__ */ jsx8("div", { className: "min-w-0 space-y-4", children })
1680
1680
  ] });
1681
1681
  }
1682
1682
  function Disclosure({ title, description, detail, children }) {
1683
- return /* @__PURE__ */ jsxs6("details", { className: "group rounded-xl border border-border bg-card", children: [
1684
- /* @__PURE__ */ jsxs6("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: [
1683
+ return /* @__PURE__ */ jsxs6("details", { className: "group min-w-0 border-t border-border", children: [
1684
+ /* @__PURE__ */ jsxs6("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-4 rounded-sm py-5 marker:hidden focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: [
1685
1685
  /* @__PURE__ */ jsxs6("span", { children: [
1686
- /* @__PURE__ */ jsx8("span", { className: "block text-base font-semibold text-foreground", children: title }),
1686
+ /* @__PURE__ */ jsx8("span", { className: "block text-sm font-medium text-foreground", children: title }),
1687
1687
  description && /* @__PURE__ */ jsx8("span", { className: "mt-1 block text-sm text-muted-foreground", children: description })
1688
1688
  ] }),
1689
1689
  /* @__PURE__ */ jsxs6("span", { className: "flex shrink-0 items-center gap-2 text-sm text-muted-foreground", children: [
@@ -1691,7 +1691,7 @@ function Disclosure({ title, description, detail, children }) {
1691
1691
  /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", className: "transition-transform group-open:rotate-180", children: "\u2304" })
1692
1692
  ] })
1693
1693
  ] }),
1694
- /* @__PURE__ */ jsx8("div", { className: "space-y-4 border-t border-border p-4 sm:p-5", children })
1694
+ /* @__PURE__ */ jsx8("div", { className: "min-w-0 space-y-4 pb-6", children })
1695
1695
  ] });
1696
1696
  }
1697
1697
  function issueMessage(error) {
@@ -2027,7 +2027,7 @@ function AgentProfileEditor({
2027
2027
  refs.length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "None configured." }),
2028
2028
  /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: refs.map((ref, index) => {
2029
2029
  const issue = resourceIssue(key, resourceDraft(ref), refs, index, true);
2030
- return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": title + " " + (index + 1), children: [
2030
+ return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": title + " " + (index + 1), children: [
2031
2031
  /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2032
2032
  /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2033
2033
  /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: ref.name || (ref.kind === "github" ? ref.path : "Inline resource") }),
@@ -2094,7 +2094,7 @@ function AgentProfileEditor({
2094
2094
  onAdd: (ref) => resources("skills", [...value.resources?.skills ?? [], ref])
2095
2095
  }
2096
2096
  ),
2097
- /* @__PURE__ */ jsxs6("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
2097
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-4", children: [
2098
2098
  /* @__PURE__ */ jsx8(
2099
2099
  ResourceFields,
2100
2100
  {
@@ -2152,7 +2152,7 @@ function AgentProfileEditor({
2152
2152
  setError(cause instanceof Error ? cause.message : "Invalid JSON");
2153
2153
  }
2154
2154
  }
2155
- return /* @__PURE__ */ jsxs6("div", { className: "space-y-5 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
2155
+ return /* @__PURE__ */ jsxs6("div", { className: "min-w-0 " + (className ?? ""), "aria-label": "Agent profile editor", children: [
2156
2156
  error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive", children: error }),
2157
2157
  jsonDirty && /* @__PURE__ */ jsx8("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." }),
2158
2158
  unsupportedResources.length > 0 && /* @__PURE__ */ jsxs6("p", { role: "status", className: "rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm text-foreground", children: [
@@ -2172,54 +2172,62 @@ function AgentProfileEditor({
2172
2172
  invalidMcpCount === 1 ? "server needs" : "servers need",
2173
2173
  " a public HTTPS endpoint before this product can save the profile. Review MCP servers or Advanced JSON. Existing values remain unchanged until you edit them."
2174
2174
  ] }),
2175
- /* @__PURE__ */ jsxs6(Section, { title: "Profile", description: "Name the agent and set its instructions.", children: [
2176
- /* @__PURE__ */ jsxs6("div", { className: "grid gap-4 sm:grid-cols-2", children: [
2177
- /* @__PURE__ */ jsx8(Field, { label: "Name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
2178
- /* @__PURE__ */ jsx8(Field, { label: "Description", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
2179
- ] }),
2180
- /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
2181
- /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
2182
- /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Project-level instructions. Each entry remains separate." }),
2183
- /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
2184
- (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-2", children: [
2185
- /* @__PURE__ */ jsx8(
2186
- Textarea,
2187
- {
2188
- "aria-label": "Instruction " + (index + 1),
2189
- className: "min-h-20",
2190
- disabled: editingDisabled,
2191
- value: instruction,
2192
- onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
2193
- }
2194
- ),
2195
- /* @__PURE__ */ jsx8(
2196
- Button2,
2197
- {
2198
- type: "button",
2199
- variant: "ghost",
2200
- className: "pt-2 text-destructive",
2201
- disabled: editingDisabled,
2202
- "aria-label": "Remove instruction " + (index + 1),
2203
- onClick: () => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).filter((_, i) => i !== index) }),
2204
- children: "Remove"
2205
- }
2206
- )
2207
- ] }, index)),
2208
- /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
2209
- ] })
2210
- ] }),
2211
- /* @__PURE__ */ jsxs6("details", { className: "rounded-lg border border-border p-3", children: [
2212
- /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer font-medium text-foreground", children: "System prompt overrides" }),
2213
- /* @__PURE__ */ jsxs6("div", { className: "mt-4 space-y-4", children: [
2214
- /* @__PURE__ */ jsx8(Field, { label: "Append to system prompt", hint: "Keeps the harness system prompt and adds this text.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
2215
- /* @__PURE__ */ jsx8(Field, { label: "Replace system prompt", hint: "Only use when the harness supports full replacement.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.systemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value }) }) })
2175
+ /* @__PURE__ */ jsx8(Section, { title: "Identity", children: /* @__PURE__ */ jsxs6("div", { className: "grid gap-4 sm:grid-cols-2", children: [
2176
+ /* @__PURE__ */ jsx8(Field, { label: "Name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.name ?? "", onChange: (event) => emit({ ...value, name: event.target.value }) }) }),
2177
+ /* @__PURE__ */ jsx8(Field, { label: "Description", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.description ?? "", onChange: (event) => emit({ ...value, description: event.target.value }) }) })
2178
+ ] }) }),
2179
+ /* @__PURE__ */ jsxs6(Section, { title: "Instructions", children: [
2180
+ /* @__PURE__ */ jsx8(Field, { label: "System instructions", hint: "Replaces default system instructions.", children: /* @__PURE__ */ jsx8(
2181
+ Textarea,
2182
+ {
2183
+ "aria-label": "System instructions",
2184
+ className: "min-h-52 text-base leading-7 sm:text-sm",
2185
+ disabled: editingDisabled,
2186
+ value: value.prompt?.systemPrompt ?? "",
2187
+ onChange: (event) => prompt({ ...value.prompt, systemPrompt: event.target.value })
2188
+ }
2189
+ ) }),
2190
+ /* @__PURE__ */ jsxs6("details", { className: "group/instructions", open: Boolean(value.prompt?.appendSystemPrompt || value.prompt?.instructions?.length), children: [
2191
+ /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "Additional instructions" }),
2192
+ /* @__PURE__ */ jsxs6("div", { className: "mt-3 space-y-5", children: [
2193
+ /* @__PURE__ */ jsx8(Field, { label: "Append to system prompt", hint: "Adds to the system prompt without replacing it.", children: /* @__PURE__ */ jsx8(Textarea, { className: "min-h-24", disabled: editingDisabled, value: value.prompt?.appendSystemPrompt ?? "", onChange: (event) => prompt({ ...value.prompt, appendSystemPrompt: event.target.value }) }) }),
2194
+ /* @__PURE__ */ jsxs6("div", { role: "group", "aria-label": "Agent instructions", className: "space-y-2", children: [
2195
+ /* @__PURE__ */ jsx8("p", { className: "text-sm font-medium text-foreground", children: "Agent instructions" }),
2196
+ /* @__PURE__ */ jsxs6("div", { className: "space-y-2", children: [
2197
+ (value.prompt?.instructions ?? []).map((instruction, index) => /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-2", children: [
2198
+ /* @__PURE__ */ jsx8(
2199
+ Textarea,
2200
+ {
2201
+ "aria-label": "Instruction " + (index + 1),
2202
+ className: "min-h-20",
2203
+ disabled: editingDisabled,
2204
+ value: instruction,
2205
+ onChange: (event) => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).map((item, i) => i === index ? event.target.value : item) })
2206
+ }
2207
+ ),
2208
+ /* @__PURE__ */ jsx8(
2209
+ Button2,
2210
+ {
2211
+ type: "button",
2212
+ variant: "ghost",
2213
+ className: "pt-2 text-destructive",
2214
+ disabled: editingDisabled,
2215
+ "aria-label": "Remove instruction " + (index + 1),
2216
+ onClick: () => prompt({ ...value.prompt, instructions: (value.prompt?.instructions ?? []).filter((_, i) => i !== index) }),
2217
+ children: "Remove"
2218
+ }
2219
+ )
2220
+ ] }, index)),
2221
+ /* @__PURE__ */ jsx8(Button2, { type: "button", variant: "outline", disabled: editingDisabled, onClick: () => prompt({ ...value.prompt, instructions: [...value.prompt?.instructions ?? [], ""] }), children: "Add instruction" })
2222
+ ] })
2223
+ ] })
2216
2224
  ] })
2217
2225
  ] })
2218
2226
  ] }),
2219
- /* @__PURE__ */ jsxs6(Section, { title: "Model", description: "Set model preferences. The host decides which models can run.", children: [
2227
+ /* @__PURE__ */ jsxs6(Section, { title: "Model", children: [
2220
2228
  /* @__PURE__ */ jsx8("div", { className: "grid gap-4 sm:grid-cols-2", children: /* @__PURE__ */ jsx8(Field, { label: "Default model", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.default ?? "", onChange: (event) => model({ ...value.model, default: event.target.value }), placeholder: "provider/model" }) }) }),
2221
- /* @__PURE__ */ jsxs6("details", { className: "rounded-lg border border-border p-3", children: [
2222
- /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer font-medium text-foreground", children: "More model settings" }),
2229
+ /* @__PURE__ */ jsxs6("details", { children: [
2230
+ /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer rounded-sm py-2 text-sm font-medium text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "More model settings" }),
2223
2231
  /* @__PURE__ */ jsxs6("div", { className: "mt-4 grid gap-4 sm:grid-cols-2", children: [
2224
2232
  /* @__PURE__ */ jsx8(Field, { label: "Small model", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.small ?? "", onChange: (event) => model({ ...value.model, small: event.target.value }), placeholder: "provider/model" }) }),
2225
2233
  /* @__PURE__ */ jsx8(Field, { label: "Provider hint", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: value.model?.provider ?? "", onChange: (event) => model({ ...value.model, provider: event.target.value }) }) }),
@@ -2243,7 +2251,7 @@ function AgentProfileEditor({
2243
2251
  ] }),
2244
2252
  showToolsAndPermissions && /* @__PURE__ */ jsxs6(Disclosure, { title: "Tools and permissions", description: "Choose which tools are available and when each needs approval.", detail: Object.keys(value.tools ?? {}).length + " configured", children: [
2245
2253
  Object.keys(value.tools ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No tool rules added." }),
2246
- /* @__PURE__ */ jsx8("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-3 rounded-lg border border-border p-3 text-sm", children: [
2254
+ /* @__PURE__ */ jsx8("div", { className: "space-y-2", children: Object.entries(value.tools ?? {}).slice(0, showAllTools ? void 0 : 4).map(([name, enabled]) => /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-center gap-3 border-b border-border py-3 text-sm", children: [
2247
2255
  /* @__PURE__ */ jsxs6("label", { className: "flex min-w-32 flex-1 items-center gap-2", children: [
2248
2256
  /* @__PURE__ */ jsx8(
2249
2257
  Switch,
@@ -2301,10 +2309,10 @@ function AgentProfileEditor({
2301
2309
  /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Nested permission rules remain in Advanced JSON." })
2302
2310
  ] }),
2303
2311
  allowsResource("skills") && resourceSection("skills", "Skills", "Add skill packages from a repository or inline content."),
2304
- allowsResource("tools") && resourceSection("tools", "Tool files", "Provide files that a supported harness can discover as tools."),
2312
+ allowsResource("tools") && resourceSection("tools", "Tool files", "Files that define custom tools."),
2305
2313
  /* @__PURE__ */ jsxs6(Disclosure, { title: "MCP servers", description: publicHttpsMcpOnly ? "Configure public HTTPS servers. Use secret references for credentials." : "Configure remote or local servers. Use secret references for credentials.", detail: Object.keys(value.mcp ?? {}).length + " configured", children: [
2306
2314
  Object.keys(value.mcp ?? {}).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No servers configured." }),
2307
- /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs6("li", { className: "flex items-center justify-between gap-3 rounded-lg border border-border p-3 text-sm", children: [
2315
+ /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: Object.entries(value.mcp ?? {}).map(([name, server]) => /* @__PURE__ */ jsxs6("li", { className: "flex items-center justify-between gap-3 border-b border-border py-3 text-sm", children: [
2308
2316
  /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2309
2317
  /* @__PURE__ */ jsx8("span", { className: "font-medium", children: name }),
2310
2318
  /* @__PURE__ */ jsx8("span", { className: "ml-2 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled" : "command" in server ? "Local" : "Remote" }),
@@ -2320,7 +2328,7 @@ function AgentProfileEditor({
2320
2328
  emit({ ...value, mcp });
2321
2329
  }, children: "Remove" })
2322
2330
  ] }, name)) }),
2323
- /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 rounded-lg border border-dashed border-border p-3 sm:grid-cols-[1fr_10rem]", children: [
2331
+ /* @__PURE__ */ jsxs6("div", { className: "grid gap-3 border-t border-border pt-4 sm:grid-cols-[1fr_10rem]", children: [
2324
2332
  /* @__PURE__ */ jsx8(Field, { label: "Server name", children: /* @__PURE__ */ jsx8(Input2, { disabled: editingDisabled, value: mcpName, onChange: (event) => setMcpName(event.target.value), placeholder: "search" }) }),
2325
2333
  /* @__PURE__ */ jsx8(Field, { label: "Transport", children: /* @__PURE__ */ jsxs6(Select, { disabled: editingDisabled, value: selectedMcpKind, onValueChange: (kind) => setMcpKind(kind), children: [
2326
2334
  /* @__PURE__ */ jsx8(SelectTrigger, { "aria-label": "Transport", children: /* @__PURE__ */ jsx8(SelectValue, {}) }),
@@ -2349,11 +2357,11 @@ function AgentProfileEditor({
2349
2357
  ),
2350
2358
  /* @__PURE__ */ jsx8("p", { className: "text-xs text-muted-foreground", children: "Arguments, headers, environment, and secret references remain in Advanced JSON." })
2351
2359
  ] }),
2352
- allowsResource("files") && /* @__PURE__ */ jsxs6(Disclosure, { title: "Resource files", description: "Configure files for the agent workspace. The runtime determines whether it can place them.", detail: (value.resources?.files ?? []).length + " configured", children: [
2360
+ allowsResource("files") && /* @__PURE__ */ jsxs6(Disclosure, { title: "Resource files", description: "Files to add to the agent workspace.", detail: (value.resources?.files ?? []).length + " configured", children: [
2353
2361
  (value.resources?.files ?? []).length === 0 && /* @__PURE__ */ jsx8("p", { className: "text-sm text-muted-foreground", children: "No resource files configured." }),
2354
2362
  /* @__PURE__ */ jsx8("ul", { className: "space-y-2", children: (value.resources?.files ?? []).map((mount, index) => {
2355
2363
  const issues = fileIssues(fileDraft(mount), workspaceFilePrefix, allowExecutableFiles, requireGitHubCommitSha, true);
2356
- return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 rounded-lg border border-border p-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2364
+ return /* @__PURE__ */ jsxs6("li", { className: "space-y-3 border-b border-border py-3 text-sm", "aria-label": "Resource file " + (index + 1), children: [
2357
2365
  /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap items-start justify-between gap-2", children: [
2358
2366
  /* @__PURE__ */ jsxs6("div", { className: "min-w-0", children: [
2359
2367
  /* @__PURE__ */ jsx8("span", { className: "block break-words font-medium text-foreground", children: mount.path }),
@@ -2415,7 +2423,7 @@ function AgentProfileEditor({
2415
2423
  ] })
2416
2424
  ] }, index);
2417
2425
  }) }),
2418
- addingFile ? /* @__PURE__ */ jsxs6("div", { className: "space-y-3 rounded-lg border border-dashed border-border p-3", children: [
2426
+ addingFile ? /* @__PURE__ */ jsxs6("div", { className: "space-y-3 border-t border-border pt-4", children: [
2419
2427
  fileFields(newFile, setNewFile),
2420
2428
  /* @__PURE__ */ jsxs6("div", { className: "flex gap-2", children: [
2421
2429
  /* @__PURE__ */ jsx8(
@@ -2461,10 +2469,6 @@ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
2461
2469
  function nonempty(value) {
2462
2470
  return Boolean(value?.trim());
2463
2471
  }
2464
- function preview(value, limit = 120) {
2465
- const flat = value.replace(/\s+/g, " ").trim();
2466
- return flat.length > limit ? `${flat.slice(0, limit - 1)}\u2026` : flat;
2467
- }
2468
2472
  function resourceName(resource) {
2469
2473
  if (resource.kind === "inline") return resource.name;
2470
2474
  return [resource.repository, resource.path].filter(Boolean).join(":") || resource.path;
@@ -2473,37 +2477,43 @@ function ResourceRow({ label, resource, path }) {
2473
2477
  const name = resourceName(resource);
2474
2478
  return /* @__PURE__ */ jsxs7("li", { className: "min-w-0 py-2 first:pt-0 last:pb-0", children: [
2475
2479
  /* @__PURE__ */ jsxs7("div", { className: "flex min-w-0 flex-wrap items-baseline gap-x-2 gap-y-0.5", children: [
2476
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs font-medium text-muted-foreground", children: label }),
2477
- path && /* @__PURE__ */ jsx9("code", { className: "break-all font-mono text-xs text-foreground", children: path }),
2480
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm font-medium text-muted-foreground", children: label }),
2481
+ path && /* @__PURE__ */ jsx9("code", { className: "break-all font-mono text-sm text-foreground", children: path }),
2478
2482
  /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-all text-sm text-foreground", children: name }),
2479
- resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
2483
+ resource.kind === "github" && resource.ref && /* @__PURE__ */ jsxs7("span", { className: "shrink-0 text-sm text-muted-foreground", children: [
2480
2484
  "at ",
2481
2485
  resource.ref
2482
2486
  ] })
2483
2487
  ] }),
2484
2488
  resource.kind === "inline" && nonempty(resource.content) && /* @__PURE__ */ jsxs7("details", { className: "mt-1.5", children: [
2485
- /* @__PURE__ */ jsx9("summary", { className: "w-fit cursor-pointer select-none text-xs text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2486
- /* @__PURE__ */ jsx9("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-xs leading-relaxed text-foreground", children: resource.content })
2489
+ /* @__PURE__ */ jsx9("summary", { className: "w-fit cursor-pointer select-none text-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", children: "View inline content" }),
2490
+ /* @__PURE__ */ jsx9("pre", { className: "mt-2 max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: resource.content })
2487
2491
  ] })
2488
2492
  ] });
2489
2493
  }
2490
2494
  function PromptDetail({ label, note, value }) {
2491
- return /* @__PURE__ */ jsxs7("details", { className: "group/prompt min-w-0", children: [
2492
- /* @__PURE__ */ jsxs7("summary", { className: "flex min-w-0 cursor-pointer list-none items-start gap-2 rounded-md py-1 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2493
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "mt-1 shrink-0 text-muted-foreground transition-transform group-open/prompt:rotate-90", children: "\u203A" }),
2494
- /* @__PURE__ */ jsxs7("span", { className: "min-w-0 flex-1", children: [
2495
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-foreground", children: label }),
2496
- note && /* @__PURE__ */ jsx9("span", { className: "ml-2 text-xs text-muted-foreground", children: note }),
2497
- /* @__PURE__ */ jsx9("span", { className: "mt-1 block truncate text-xs text-muted-foreground", children: preview(value) })
2498
- ] })
2495
+ return /* @__PURE__ */ jsxs7("div", { className: "min-w-0 space-y-2", children: [
2496
+ label && /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1", children: [
2497
+ /* @__PURE__ */ jsx9("h4", { className: "font-medium text-foreground", children: label }),
2498
+ note && /* @__PURE__ */ jsx9("span", { className: "text-sm text-muted-foreground", children: note })
2499
2499
  ] }),
2500
- /* @__PURE__ */ jsx9("pre", { className: "mb-2 ml-4 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-3 text-sm leading-relaxed text-foreground", children: value })
2500
+ /* @__PURE__ */ jsx9("div", { className: "whitespace-pre-wrap break-words text-sm leading-7 text-foreground", children: value })
2501
2501
  ] });
2502
2502
  }
2503
2503
  function ProfileSection({ title, children }) {
2504
- return /* @__PURE__ */ jsxs7("section", { className: "min-w-0 py-3 first:pt-0 last:pb-0", "aria-label": title, children: [
2505
- /* @__PURE__ */ jsx9("h3", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: title }),
2506
- children
2504
+ return /* @__PURE__ */ jsxs7("section", { className: "grid min-w-0 gap-3 border-t border-border py-6 first:border-t-0 first:pt-0 sm:grid-cols-[9rem_minmax(0,1fr)] sm:gap-6", "aria-label": title, children: [
2505
+ /* @__PURE__ */ jsx9("h3", { className: "text-sm font-medium text-muted-foreground", children: title }),
2506
+ /* @__PURE__ */ jsx9("div", { className: "min-w-0", children })
2507
+ ] });
2508
+ }
2509
+ function ProfileConfiguration({ expanded, children }) {
2510
+ if (expanded) return /* @__PURE__ */ jsx9("div", { children });
2511
+ return /* @__PURE__ */ jsxs7("details", { className: "group/config border-t border-border pt-4", children: [
2512
+ /* @__PURE__ */ jsxs7("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 rounded-sm py-2 font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2513
+ "Profile configuration ",
2514
+ /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "text-muted-foreground group-open/config:rotate-90", children: "\u203A" })
2515
+ ] }),
2516
+ /* @__PURE__ */ jsx9("div", { className: "pt-4", children })
2507
2517
  ] });
2508
2518
  }
2509
2519
  function permissionRows(profile) {
@@ -2544,7 +2554,7 @@ function configuredResources(profile) {
2544
2554
  }))
2545
2555
  ];
2546
2556
  }
2547
- function AgentProfileViewer({ profile, className = "", defaultExpanded = true }) {
2557
+ function AgentProfileViewer({ profile, className = "", defaultExpanded = true, showIdentity = true }) {
2548
2558
  const permissions = permissionRows(profile);
2549
2559
  const resources = configuredResources(profile);
2550
2560
  const prompt = profile.prompt;
@@ -2554,96 +2564,83 @@ function AgentProfileViewer({ profile, className = "", defaultExpanded = true })
2554
2564
  const tools = Object.entries(profile.tools ?? {}).sort(([a], [b]) => a.localeCompare(b));
2555
2565
  const hasBehavior = Boolean(nonempty(prompt?.systemPrompt) || nonempty(prompt?.appendSystemPrompt) || instructions.length || (typeof resourceInstructions === "string" ? nonempty(resourceInstructions) : resourceInstructions));
2556
2566
  const hasConfiguration = Boolean(hasBehavior || tools.length || permissions.length || mcp.length || profile.connections?.length || resources.length || profile.resources?.failOnError || profile.subagents && Object.keys(profile.subagents).length || profile.hooks && Object.keys(profile.hooks).length || profile.modes && Object.keys(profile.modes).length);
2557
- const hasProfileDetails = Boolean(profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.harness || profile.description || profile.version || profile.tags?.length || hasConfiguration);
2558
- return /* @__PURE__ */ jsxs7("section", { className: `min-w-0 text-sm ${className}`.trim(), "aria-label": "Agent profile", children: [
2559
- /* @__PURE__ */ jsxs7("header", { className: "min-w-0 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2560
- /* @__PURE__ */ jsx9("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2561
- nonempty(profile.description) && /* @__PURE__ */ jsx9("p", { className: "mt-1 whitespace-pre-wrap break-words leading-relaxed text-muted-foreground", children: profile.description }),
2562
- (profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs7("dl", { className: "mt-3 flex flex-wrap gap-x-4 gap-y-1 text-xs", children: [
2563
- profile.model?.default && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2564
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Default model" }),
2565
- /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.default })
2566
- ] }),
2567
- profile.model?.small && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2568
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Small model" }),
2569
- /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.small })
2570
- ] }),
2571
- profile.model?.reasoningEffort && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2572
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Reasoning" }),
2573
- /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.model.reasoningEffort })
2574
- ] }),
2575
- profile.harness && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2576
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Preferred harness" }),
2577
- /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.harness })
2578
- ] }),
2579
- profile.version && /* @__PURE__ */ jsxs7("div", { className: "flex gap-1", children: [
2580
- /* @__PURE__ */ jsx9("dt", { className: "text-muted-foreground", children: "Version" }),
2581
- /* @__PURE__ */ jsx9("dd", { className: "font-medium text-foreground", children: profile.version })
2582
- ] }),
2583
- profile.tags?.map((tag) => /* @__PURE__ */ jsx9("div", { className: "rounded-full bg-muted px-2 py-0.5 text-muted-foreground", children: tag }, tag))
2584
- ] })
2567
+ const hasProfileDetails = Boolean(profile.model?.default || profile.model?.small || profile.model?.reasoningEffort || profile.model?.provider || profile.harness || profile.description || profile.version || profile.tags?.length || hasConfiguration);
2568
+ return /* @__PURE__ */ jsxs7("section", { className: `min-w-0 text-sm text-foreground ${className}`.trim(), "aria-label": "Agent profile", children: [
2569
+ (showIdentity || nonempty(profile.description)) && /* @__PURE__ */ jsxs7("header", { className: "mb-6 min-w-0", children: [
2570
+ showIdentity && /* @__PURE__ */ jsx9("h2", { className: "break-words text-lg font-semibold leading-tight text-foreground", children: nonempty(profile.name) ? profile.name : "Unnamed profile" }),
2571
+ nonempty(profile.description) && /* @__PURE__ */ jsx9("p", { className: "mt-2 whitespace-pre-wrap break-words leading-6 text-muted-foreground", children: profile.description })
2585
2572
  ] }),
2586
- !hasProfileDetails && /* @__PURE__ */ jsx9("p", { className: "mt-4 border-t border-border pt-3 text-sm text-muted-foreground", children: "No profile details are configured." }),
2587
- hasConfiguration && /* @__PURE__ */ jsxs7("details", { open: defaultExpanded, className: "group/config mt-4 rounded-xl border border-border bg-card p-4 shadow-sm", children: [
2588
- /* @__PURE__ */ jsxs7("summary", { className: "flex cursor-pointer list-none items-center gap-2 rounded-md py-2 text-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", children: [
2589
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", className: "text-muted-foreground transition-transform group-open/config:rotate-90", children: "\u203A" }),
2590
- /* @__PURE__ */ jsx9("span", { className: "font-medium text-foreground", children: "Profile configuration" }),
2591
- /* @__PURE__ */ jsx9("span", { className: "text-xs text-muted-foreground", children: [hasBehavior && "Instructions", (tools.length || permissions.length) > 0 && "Tools", mcp.length > 0 && "MCP", (resources.length || profile.resources?.failOnError) && "Resources", profile.connections?.length && "Connections", profile.subagents && Object.keys(profile.subagents).length > 0 && "Subagents", profile.hooks && Object.keys(profile.hooks).length > 0 && "Hooks", profile.modes && Object.keys(profile.modes).length > 0 && "Modes"].filter(Boolean).join(" \xB7 ") })
2592
- ] }),
2593
- /* @__PURE__ */ jsxs7("div", { className: "divide-y divide-border border-t border-border", children: [
2594
- hasBehavior && /* @__PURE__ */ jsx9(ProfileSection, { title: "Instructions", children: /* @__PURE__ */ jsxs7("div", { className: "space-y-2", children: [
2595
- nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx9(PromptDetail, { label: "System prompt", note: "Replaces the harness default", value: prompt.systemPrompt }),
2596
- nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx9(
2597
- PromptDetail,
2598
- {
2599
- label: "Added system prompt",
2600
- note: nonempty(prompt.systemPrompt) ? "Supplements the system prompt above" : "Supplements the harness default",
2601
- value: prompt.appendSystemPrompt
2602
- }
2603
- ),
2604
- instructions.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2605
- /* @__PURE__ */ jsxs7("h4", { className: "font-medium text-foreground", children: [
2606
- "Project instructions ",
2607
- /* @__PURE__ */ jsx9("span", { className: "ml-1 font-normal text-xs text-muted-foreground", children: "Lower-privilege workspace guidance" })
2608
- ] }),
2609
- /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(PromptDetail, { label: `Instruction ${index + 1}`, value: instruction }) }, `${index}:${instruction}`)) })
2573
+ !hasProfileDetails && /* @__PURE__ */ jsx9("p", { className: "text-muted-foreground", children: "No profile details are configured." }),
2574
+ (hasConfiguration || profile.model || profile.harness || profile.version || profile.tags?.length) && /* @__PURE__ */ jsxs7(ProfileConfiguration, { expanded: defaultExpanded, children: [
2575
+ hasBehavior && /* @__PURE__ */ jsx9(ProfileSection, { title: "Instructions", children: /* @__PURE__ */ jsxs7("div", { className: "space-y-6", children: [
2576
+ nonempty(prompt?.systemPrompt) && /* @__PURE__ */ jsx9(PromptDetail, { label: nonempty(prompt.appendSystemPrompt) || instructions.length ? "System instructions" : void 0, note: "Replaces default instructions", value: prompt.systemPrompt }),
2577
+ nonempty(prompt?.appendSystemPrompt) && /* @__PURE__ */ jsx9(
2578
+ PromptDetail,
2579
+ {
2580
+ label: "Added system prompt",
2581
+ note: nonempty(prompt.systemPrompt) ? "Supplements the system prompt above" : "Supplements the harness default",
2582
+ value: prompt.appendSystemPrompt
2583
+ }
2584
+ ),
2585
+ instructions.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "space-y-1.5", children: [
2586
+ /* @__PURE__ */ jsxs7("h4", { className: "font-medium text-foreground", children: [
2587
+ "Project instructions ",
2588
+ /* @__PURE__ */ jsx9("span", { className: "ml-1 font-normal text-sm text-muted-foreground", children: "Lower-privilege workspace guidance" })
2610
2589
  ] }),
2611
- typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx9(PromptDetail, { label: "Resource instructions", note: "Configured in resources", value: resourceInstructions }),
2612
- resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx9("ul", { children: /* @__PURE__ */ jsx9(ResourceRow, { label: "Instruction resource", resource: resourceInstructions }) })
2613
- ] }) }),
2614
- (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Tool policy", children: /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
2615
- const enabled = tools.find(([tool]) => tool === name)?.[1];
2616
- const policy = permissions.find(([permission]) => permission === name)?.[1];
2617
- return /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2618
- /* @__PURE__ */ jsx9("code", { className: "min-w-0 break-all font-mono text-xs text-foreground", children: name }),
2619
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2620
- ] }, name);
2621
- }) }) }) }),
2622
- mcp.length > 0 && /* @__PURE__ */ jsx9(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2623
- /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2624
- /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-xs text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2625
- ] }, name)) }) }),
2626
- Boolean(profile.connections?.length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
2627
- /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2628
- connection.capabilities.length > 0 && /* @__PURE__ */ jsx9("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2629
- ] }, `${connection.alias ?? "connection"}:${index}`)) }) }),
2630
- (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs7(ProfileSection, { title: "Declared resources", children: [
2631
- /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx9(ResourceRow, { ...item }, key)) }),
2632
- profile.resources?.failOnError && /* @__PURE__ */ jsx9("p", { className: "mt-2 text-xs text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2590
+ /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: instructions.map((instruction, index) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9(PromptDetail, { label: `Instruction ${index + 1}`, value: instruction }) }, `${index}:${instruction}`)) })
2633
2591
  ] }),
2634
- Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs7("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
2635
- /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: name }),
2636
- nonempty(subagent.description) && /* @__PURE__ */ jsx9("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-xs leading-relaxed text-muted-foreground", children: subagent.description })
2637
- ] }, name)) }) }),
2638
- Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 justify-between gap-4", children: [
2639
- /* @__PURE__ */ jsx9("code", { className: "font-mono text-xs text-foreground", children: event }),
2640
- /* @__PURE__ */ jsxs7("span", { className: "text-xs text-muted-foreground", children: [
2641
- commands.length,
2642
- " configured"
2643
- ] })
2644
- ] }, event)) }) }),
2645
- Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx9("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-xs text-muted-foreground", children: mode }, mode)) }) })
2646
- ] })
2592
+ typeof resourceInstructions === "string" && nonempty(resourceInstructions) && /* @__PURE__ */ jsx9(PromptDetail, { label: "Resource instructions", note: "Configured in resources", value: resourceInstructions }),
2593
+ resourceInstructions && typeof resourceInstructions !== "string" && /* @__PURE__ */ jsx9("ul", { children: /* @__PURE__ */ jsx9(ResourceRow, { label: "Instruction resource", resource: resourceInstructions }) })
2594
+ ] }) }),
2595
+ (profile.model?.default || profile.model?.small || profile.model?.provider || profile.model?.reasoningEffort || profile.harness) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Model and runtime", children: /* @__PURE__ */ jsx9("dl", { className: "grid gap-x-6 gap-y-4 sm:grid-cols-2", children: [
2596
+ ["Default model", profile.model?.default],
2597
+ ["Provider", profile.model?.provider],
2598
+ ["Preferred harness", profile.harness],
2599
+ ["Reasoning", profile.model?.reasoningEffort],
2600
+ ["Small model", profile.model?.small]
2601
+ ].filter(([, value]) => value).map(([label, value]) => /* @__PURE__ */ jsxs7("div", { className: "min-w-0", children: [
2602
+ /* @__PURE__ */ jsx9("dt", { className: "mb-1 text-sm text-muted-foreground", children: label }),
2603
+ /* @__PURE__ */ jsx9("dd", { className: "break-words font-medium", children: value })
2604
+ ] }, label)) }) }),
2605
+ (tools.length > 0 || permissions.length > 0) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Tools and permissions", children: /* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: [.../* @__PURE__ */ new Set([...tools.map(([name]) => name), ...permissions.map(([name]) => name)])].sort().map((name) => {
2606
+ const enabled = tools.find(([tool]) => tool === name)?.[1];
2607
+ const policy = permissions.find(([permission]) => permission === name)?.[1];
2608
+ return /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2609
+ /* @__PURE__ */ jsx9("code", { className: "min-w-0 break-all font-mono text-sm text-foreground", children: name }),
2610
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm text-muted-foreground", children: [enabled === void 0 ? void 0 : enabled ? "Enabled" : "Disabled", policy].filter(Boolean).join(" \xB7 ") })
2611
+ ] }, name);
2612
+ }) }) }) }),
2613
+ mcp.length > 0 && /* @__PURE__ */ jsx9(ProfileSection, { title: "MCP servers", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: mcp.map(([name, server]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 items-center justify-between gap-4 py-1.5 first:pt-0 last:pb-0", children: [
2614
+ /* @__PURE__ */ jsx9("span", { className: "min-w-0 break-words font-medium text-foreground", children: name }),
2615
+ /* @__PURE__ */ jsx9("span", { className: "shrink-0 text-sm text-muted-foreground", children: server.enabled === false ? "Disabled in profile" : "Enabled in profile" })
2616
+ ] }, name)) }) }),
2617
+ Boolean(profile.connections?.length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Hub capabilities", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-2", children: profile.connections?.map((connection, index) => /* @__PURE__ */ jsxs7("li", { className: "min-w-0", children: [
2618
+ /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: connection.alias || "Hub connection" }),
2619
+ connection.capabilities.length > 0 && /* @__PURE__ */ jsx9("ul", { className: "mt-1 flex flex-wrap gap-1.5", children: connection.capabilities.map((capability, capabilityIndex) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: capability }, `${capability}:${capabilityIndex}`)) })
2620
+ ] }, `${connection.alias ?? "connection"}:${index}`)) }) }),
2621
+ (resources.length > 0 || profile.resources?.failOnError) && /* @__PURE__ */ jsxs7(ProfileSection, { title: "Declared resources", children: [
2622
+ /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: resources.map(({ key, ...item }) => /* @__PURE__ */ jsx9(ResourceRow, { ...item }, key)) }),
2623
+ profile.resources?.failOnError && /* @__PURE__ */ jsx9("p", { className: "mt-2 text-sm text-muted-foreground", children: "Profile configuration requires declared resources to load successfully." })
2624
+ ] }),
2625
+ Boolean(profile.subagents && Object.keys(profile.subagents).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Subagents", children: /* @__PURE__ */ jsx9("ul", { className: "divide-y divide-border/70", children: Object.entries(profile.subagents ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([name, subagent]) => /* @__PURE__ */ jsxs7("li", { className: "py-1.5 first:pt-0 last:pb-0", children: [
2626
+ /* @__PURE__ */ jsx9("p", { className: "font-medium text-foreground", children: name }),
2627
+ nonempty(subagent.description) && /* @__PURE__ */ jsx9("p", { className: "mt-0.5 whitespace-pre-wrap break-words text-sm leading-relaxed text-muted-foreground", children: subagent.description })
2628
+ ] }, name)) }) }),
2629
+ Boolean(profile.hooks && Object.keys(profile.hooks).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Lifecycle hooks", children: /* @__PURE__ */ jsx9("ul", { className: "space-y-1", children: Object.entries(profile.hooks ?? {}).sort(([a], [b]) => a.localeCompare(b)).map(([event, commands]) => /* @__PURE__ */ jsxs7("li", { className: "flex min-w-0 justify-between gap-4", children: [
2630
+ /* @__PURE__ */ jsx9("code", { className: "font-mono text-sm text-foreground", children: event }),
2631
+ /* @__PURE__ */ jsxs7("span", { className: "text-sm text-muted-foreground", children: [
2632
+ commands.length,
2633
+ " configured"
2634
+ ] })
2635
+ ] }, event)) }) }),
2636
+ Boolean(profile.modes && Object.keys(profile.modes).length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Modes", children: /* @__PURE__ */ jsx9("ul", { className: "flex flex-wrap gap-1.5", children: Object.keys(profile.modes ?? {}).sort().map((mode) => /* @__PURE__ */ jsx9("li", { className: "rounded-full bg-muted px-2 py-0.5 text-sm text-muted-foreground", children: mode }, mode)) }) }),
2637
+ (profile.version || profile.tags?.length) && /* @__PURE__ */ jsx9(ProfileSection, { title: "Metadata", children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-muted-foreground", children: [
2638
+ profile.version && /* @__PURE__ */ jsxs7("span", { children: [
2639
+ "Version ",
2640
+ profile.version
2641
+ ] }),
2642
+ profile.tags?.map((tag) => /* @__PURE__ */ jsx9("span", { children: tag }, tag))
2643
+ ] }) })
2647
2644
  ] })
2648
2645
  ] });
2649
2646
  }
@@ -7550,4 +7547,4 @@ export {
7550
7547
  useThinkingSeconds,
7551
7548
  ChatMessages
7552
7549
  };
7553
- //# sourceMappingURL=chunk-OHRL6TO3.js.map
7550
+ //# sourceMappingURL=chunk-5NRXHO32.js.map