@tai42/studio-sdk 1.4.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  * half of {@link ViewToggle}). It lays its children out on the design system's
4
4
  * responsive `.tai-grid-cards` track (three columns, dropping to two then one down
5
5
  * the responsive bands); each child is expected to be an interactive `Card`. Living
6
- * in the SDK keeps the tools screen and PLAN_4's flows page on one identical grid.
6
+ * in the SDK keeps the tools screen and the flows page on one identical grid.
7
7
  */
8
8
  import type { ReactNode } from 'react';
9
9
  export interface EntityCardGridProps {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Folder navigation primitives for the tool-organization tree — shared by the tools
3
- * screen and PLAN_4's flows page so both explore, breadcrumb, and re-file against
3
+ * screen and the flows page so both explore, breadcrumb, and re-file against
4
4
  * one identical set of controls.
5
5
  *
6
6
  * The tree is passed FLAT (a {@link Folder} list keyed by `id`, each naming its
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * Folder navigation primitives for the tool-organization tree — shared by the tools
4
- * screen and PLAN_4's flows page so both explore, breadcrumb, and re-file against
4
+ * screen and the flows page so both explore, breadcrumb, and re-file against
5
5
  * one identical set of controls.
6
6
  *
7
7
  * The tree is passed FLAT (a {@link Folder} list keyed by `id`, each naming its
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `OverlayDetailsFields` — the display-name + user-tags editor shared by EVERY
3
3
  * tool_meta edit surface (the tools-screen edit dialog, the presets screen, and
4
- * PLAN_4's flows page). One canonical control means the merge-patch write semantics
4
+ * the flows page). One canonical control means the merge-patch write semantics
5
5
  * exist exactly once.
6
6
  *
7
7
  * Controlled: the caller owns `value` (prefilled from the tool's overlay row) and
@@ -19,6 +19,13 @@ export interface ToolPickerProps {
19
19
  readonly tagsByTool?: Readonly<Record<string, readonly string[]>>;
20
20
  /** Tool names that are agent run tools; their option labels are suffixed " (agent)". */
21
21
  readonly agentToolNames?: ReadonlySet<string>;
22
+ /**
23
+ * Human display names keyed by raw tool name (from the tool-meta overlay). A
24
+ * mapped option's label reads `Display Name (raw_name)`; an unmapped name — or a
25
+ * mapping equal to the raw name — reads the bare raw name. The value `onChange`
26
+ * emits stays the raw name in every case.
27
+ */
28
+ readonly displayNames?: Readonly<Record<string, string>>;
22
29
  }
23
- export declare function ToolPicker({ toolNames, value, onChange, disabled, placeholder, idPrefix, label, 'aria-label': ariaLabel, excludeNames, tagsByTool, agentToolNames, }: ToolPickerProps): import("react").JSX.Element;
30
+ export declare function ToolPicker({ toolNames, value, onChange, disabled, placeholder, idPrefix, label, 'aria-label': ariaLabel, excludeNames, tagsByTool, agentToolNames, displayNames, }: ToolPickerProps): import("react").JSX.Element;
24
31
  //# sourceMappingURL=tool-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-picker.d.ts","sourceRoot":"","sources":["../../src/components/tool-picker.tsx"],"names":[],"mappings":"AA8BA,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,sFAAsF;IACtF,QAAQ,CAAC,UAAU,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;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CAC1D;AAyDD,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAA8B,EAC9B,QAAwB,EACxB,KAAK,EACL,YAAY,EAAE,SAAS,EACvB,YAAY,EACZ,UAAU,EACV,cAAc,EACd,YAAY,GACb,EAAE,eAAe,+BAgEjB"}
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  * PRESENTATIONAL: the caller fetches the tool names (GET /api/tools) and owns the
7
7
  * selected value; this component fetches nothing.
8
8
  *
9
- * Three optional extensions, each inert unless supplied; the preset create flow
10
- * passes all three and the multi-tool picker the first two:
9
+ * Four optional extensions, each inert unless supplied; the preset create flow
10
+ * passes the first three and the multi-tool picker the first two:
11
11
  * - `excludeNames` removes names from the options (e.g. a preset cannot be
12
12
  * another preset's base, so the preset create flow excludes existing preset
13
13
  * names). The server stays the authority — a slipped-through name is rejected
@@ -19,10 +19,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  * tool with " (agent)" (in grouped and flat renderings alike) — a purely visual
20
20
  * honesty cue; the value stays the bare name and no option is excluded, since an
21
21
  * agent run tool is a legal preset base for an authored agent.
22
+ * - `displayNames` (from the tool-meta overlay) overlays a human name onto the
23
+ * LABEL: a mapped option reads `Display Name (raw_name)`, an unmapped name (or a
24
+ * mapping equal to the raw name) reads the bare raw name. The value stays the raw
25
+ * name and grouping/filtering/exclusion key off raw names alone, so a display
26
+ * name is purely cosmetic.
22
27
  *
23
- * SAFETY: a tool name AND a tag are server-supplied, so every name/tag renders as
24
- * TEXT through the DS `Select` (React escapes it) — never an HTML sink. Pinned by
25
- * a test.
28
+ * SAFETY: a tool name, a tag, AND a display name are server-supplied, so every one
29
+ * renders as TEXT through the DS `Select` (React escapes it) — never an HTML sink.
30
+ * Pinned by a test.
26
31
  */
27
32
  import { useState } from 'react';
28
33
  import { Field } from './field';
@@ -37,12 +42,17 @@ function groupFor(name, tagsByTool) {
37
42
  const tags = [...(tagsByTool[name] ?? [])].sort((a, b) => a.localeCompare(b));
38
43
  return tags[0] ?? UNTAGGED;
39
44
  }
40
- /** The option label: the bare name, suffixed " (agent)" for an agent run tool. */
41
- function optionLabel(name, agentToolNames) {
42
- return agentToolNames?.has(name) === true ? `${name} (agent)` : name;
45
+ /**
46
+ * The option label: `Display Name (raw)` when a distinct display name maps the
47
+ * name, else the bare name; either way suffixed " (agent)" for an agent run tool.
48
+ */
49
+ function optionLabel(name, displayNames, agentToolNames) {
50
+ const display = displayNames?.[name];
51
+ const base = display !== undefined && display !== name ? `${display} (${name})` : name;
52
+ return agentToolNames?.has(name) === true ? `${base} (agent)` : base;
43
53
  }
44
54
  /** Build the grouped option clusters (sorted group labels, "Untagged" last). */
45
- function buildGroups(names, tagsByTool, agentToolNames) {
55
+ function buildGroups(names, tagsByTool, displayNames, agentToolNames) {
46
56
  const byGroup = new Map();
47
57
  for (const name of names) {
48
58
  const group = groupFor(name, tagsByTool);
@@ -62,11 +72,11 @@ function buildGroups(names, tagsByTool, agentToolNames) {
62
72
  label,
63
73
  options: groupNames.map((name) => ({
64
74
  value: name,
65
- label: optionLabel(name, agentToolNames),
75
+ label: optionLabel(name, displayNames, agentToolNames),
66
76
  })),
67
77
  }));
68
78
  }
69
- export function ToolPicker({ toolNames, value, onChange, disabled, placeholder = 'Select a tool…', idPrefix = 'tool-picker', label, 'aria-label': ariaLabel, excludeNames, tagsByTool, agentToolNames, }) {
79
+ export function ToolPicker({ toolNames, value, onChange, disabled, placeholder = 'Select a tool…', idPrefix = 'tool-picker', label, 'aria-label': ariaLabel, excludeNames, tagsByTool, agentToolNames, displayNames, }) {
70
80
  const [tagFilter, setTagFilter] = useState(ALL_TAGS);
71
81
  const excluded = new Set(excludeNames ?? []);
72
82
  const available = toolNames.filter((name) => !excluded.has(name));
@@ -77,7 +87,7 @@ export function ToolPicker({ toolNames, value, onChange, disabled, placeholder =
77
87
  const filtered = tagsByTool !== undefined && tagFilter !== ALL_TAGS
78
88
  ? available.filter((name) => (tagsByTool[name] ?? []).includes(tagFilter))
79
89
  : available;
80
- const toolSelect = tagsByTool !== undefined ? (_jsx(Select, { groups: buildGroups(filtered, tagsByTool, agentToolNames), value: value ?? '', onValueChange: onChange, placeholder: placeholder, "aria-label": ariaLabel, disabled: disabled })) : (_jsx(Select
90
+ const toolSelect = tagsByTool !== undefined ? (_jsx(Select, { groups: buildGroups(filtered, tagsByTool, displayNames, agentToolNames), value: value ?? '', onValueChange: onChange, placeholder: placeholder, "aria-label": ariaLabel, disabled: disabled })) : (_jsx(Select
81
91
  // Keep Radix controlled even when the caller's value is null: `''` matches no
82
92
  // item (placeholder still shows) and avoids the uncontrolled→controlled warning
83
93
  // a subsequent selection would otherwise trigger.
@@ -87,7 +97,7 @@ export function ToolPicker({ toolNames, value, onChange, disabled, placeholder =
87
97
  // a subsequent selection would otherwise trigger.
88
98
  options: filtered.map((name) => ({
89
99
  value: name,
90
- label: optionLabel(name, agentToolNames),
100
+ label: optionLabel(name, displayNames, agentToolNames),
91
101
  })), value: value ?? '', onValueChange: onChange, placeholder: placeholder, "aria-label": ariaLabel, disabled: disabled }));
92
102
  return (_jsxs("div", { "data-testid": idPrefix, className: "tai-stack tai-stack-2", children: [tagsByTool !== undefined && allTags.length > 0 ? (_jsx(Field, { label: "Filter by tag", children: _jsx(Select, { options: [
93
103
  { value: ALL_TAGS, label: 'All tags' },
@@ -1 +1 @@
1
- {"version":3,"file":"tool-picker.js","sourceRoot":"","sources":["../../src/components/tool-picker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAA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AC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;qBACtD,EACD,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,YAAY,EAC3B,QAAQ,EAAE,QAAQ,GAClB,GACI,CACT,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAC,KAAK,IAAC,KAAK,EAAE,KAAK,YAAG,UAAU,GAAS,CAAC,CAAC,CAAC,UAAU,IACzE,CACP,CAAC;AACJ,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * so the segment shows just its glyph while keeping a real accessible name. A single
7
7
  * screen's choice persists across sessions in `localStorage`, keyed per SURFACE —
8
8
  * the tools screen and the flows page each remember their own view — via
9
- * {@link useViewMode}. The two live in the SDK so every entity screen (and PLAN_4's
9
+ * {@link useViewMode}. The two live in the SDK so every entity screen (and the
10
10
  * flows page) toggles identically; `EntityCardGrid` renders the card half.
11
11
  */
12
12
  import { type ReactNode } from 'react';
@@ -7,7 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
7
7
  * so the segment shows just its glyph while keeping a real accessible name. A single
8
8
  * screen's choice persists across sessions in `localStorage`, keyed per SURFACE —
9
9
  * the tools screen and the flows page each remember their own view — via
10
- * {@link useViewMode}. The two live in the SDK so every entity screen (and PLAN_4's
10
+ * {@link useViewMode}. The two live in the SDK so every entity screen (and the
11
11
  * flows page) toggles identically; `EntityCardGrid` renders the card half.
12
12
  */
13
13
  import { useCallback, useState } from 'react';
@@ -873,6 +873,7 @@ export declare const ApiProvider: import("react").Provider<{
873
873
  readonly readConversationTranscript: (query: import("@tai42/api-client").ConversationTranscriptQuery, signal?: AbortSignal) => Promise<{
874
874
  items: {
875
875
  created_at: number;
876
+ origin: "client" | "operator";
876
877
  route_name: string;
877
878
  door: "channel" | "api";
878
879
  thread_id: string;
@@ -898,6 +899,18 @@ export declare const ApiProvider: import("react").Provider<{
898
899
  next_page: number | null;
899
900
  order: "asc" | "desc";
900
901
  }>;
902
+ readonly sendConversationThreadMessage: (routeName: string, body: import("@tai42/api-client").ConversationThreadMessageBody) => Promise<{
903
+ thread_id: string;
904
+ message_id: string;
905
+ }>;
906
+ readonly getConversationThreadMode: (routeName: string, threadId: string, signal?: AbortSignal) => Promise<{
907
+ mode: "agent" | "manual";
908
+ source: "thread" | "route";
909
+ }>;
910
+ readonly setConversationThreadMode: (routeName: string, threadId: string, mode: import("@tai42/api-client").ConversationThreadMode) => Promise<{
911
+ mode: "agent" | "manual";
912
+ source: "thread" | "route";
913
+ }>;
901
914
  readonly getWebEntryGate: (identity: string, signal?: AbortSignal) => Promise<{
902
915
  enabled: boolean;
903
916
  codes: {
@@ -1401,7 +1414,10 @@ export declare const ApiProvider: import("react").Provider<{
1401
1414
  format: "csv" | "json";
1402
1415
  }, signal?: AbortSignal) => Promise<Blob>;
1403
1416
  readonly searchMarketplace: (query?: import("@tai42/api-client").MarketplaceSearchQuery, signal?: AbortSignal) => Promise<{
1404
- items: {
1417
+ total: number;
1418
+ page: number;
1419
+ page_size: number;
1420
+ listings: {
1405
1421
  name: string;
1406
1422
  description: string;
1407
1423
  tags: string[];
@@ -1409,12 +1425,10 @@ export declare const ApiProvider: import("react").Provider<{
1409
1425
  icon_url: string | null;
1410
1426
  categories: string[];
1411
1427
  updated_at: string;
1412
- item: {
1428
+ groups: {
1413
1429
  name: string;
1414
- description: string;
1415
- tags: string[];
1416
- kind: string;
1417
- };
1430
+ count: number;
1431
+ }[];
1418
1432
  ref: string;
1419
1433
  namespace: string;
1420
1434
  package: string;
@@ -1422,11 +1436,13 @@ export declare const ApiProvider: import("react").Provider<{
1422
1436
  pricing: string;
1423
1437
  latest_version: string | null;
1424
1438
  downloads: number;
1439
+ kinds: {
1440
+ kind: string;
1441
+ count: number;
1442
+ names: string[];
1443
+ }[];
1425
1444
  premium?: boolean | null | undefined;
1426
1445
  }[];
1427
- total: number;
1428
- page: number;
1429
- page_size: number;
1430
1446
  }>;
1431
1447
  readonly getMarketplacePlugin: (namespace: string, name: string, signal?: AbortSignal) => Promise<{
1432
1448
  name: string;
@@ -1457,6 +1473,7 @@ export declare const ApiProvider: import("react").Provider<{
1457
1473
  description: string;
1458
1474
  tags: string[];
1459
1475
  kind: string;
1476
+ group: string | null;
1460
1477
  }[];
1461
1478
  version: string;
1462
1479
  contract_range: string | null;
@@ -1507,9 +1524,9 @@ export declare const ApiProvider: import("react").Provider<{
1507
1524
  kind: string;
1508
1525
  }[];
1509
1526
  version: string;
1527
+ source: string;
1510
1528
  ref: string;
1511
1529
  latest: string | null;
1512
- source: string;
1513
1530
  installed_at: string;
1514
1531
  update_available: boolean;
1515
1532
  incompatible_newer: string | null;
@@ -1 +1 @@
1
- {"version":3,"file":"useApi.d.ts","sourceRoot":"","sources":["../../src/hooks/useApi.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,eAAO,MAAM,WAAW;;+BAWsrX,CAAC;iDAAsF,CAAC;;;;;uCAAuM,CAAC;;;;;4EAAgO,CAAC;wFAAgG,CAAC;;;+CAA2G,CAAC;;;;;aAAqL,CAAC;cAAoC,CAAC;mBAA8B,CAAC;;oDAAkF,CAAC;;;;;mBAA2L,CAAC;;kCAAkE,CAAC;;;;;iCAA8I,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;6CAAk2B,CAAC;;;;;;;;;;;;;;sDAA4e,CAAC;;;;;;;;;;;;;;;;qEAAqiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qDAAs8C,CAAC;;;;;;;;;;;;;kCAAmb,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;kDAAqwB,CAAC;;;;;;;;;;;;;;;;;;;oCAA8kB,CAAC;;;;;0CAAwK,CAAC;;;qDAAsH,CAAC;;;;yDAAsJ,CAAC;;;;;;;;;;;;;oCAAka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gBAA2B,CAAC;;kDAAqE,CAAC;;;aAA8H,CAAC;sCAAuE,CAAC,4DAAgC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAAszB,CAAC;;;2EAA8H,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAAugC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAmuG,CAAC;gBAA8C,CAAC;;+CAAoF,CAAC;0CAA+E,CAAC;qDAA0F,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAAi7D,CAAC;;;;;;;;;;;;+BAAkW,CAAC;oCAAuE,CAAC;;;;;;wCAAga,CAAC;SAXrtoE,CAAC;AAE/C,wBAAgB,MAAM,IAAI,SAAS,CAMlC;AAED,YAAY,EAAE,SAAS,EAAE,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * EFFECTIVE hidden is the overlay's tri-state OVERRIDE of the plugin's own
6
6
  * declaration: an overlay opinion (`true`/`false`) wins, else the plugin
7
7
  * declaration stands. So an overlay `false` UNHIDES a plugin-hidden tool, `true`
8
- * force-hides, and `null` (no overlay row is the same) DEFERS to the declaration
9
- * (PLAN §Tools-read-surface). The rule lives here ONCE so the list-exclusion and
8
+ * force-hides, and `null` (no overlay row is the same) DEFERS to the declaration.
9
+ * The rule lives here ONCE so the list-exclusion and
10
10
  * the picker-exclusion can never drift apart.
11
11
  */
12
12
  import type { ToolMetaRecord, ToolTagEntry } from '@tai42/api-client';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tai42/studio-sdk",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "The Studio plugin contract, shared UI components, and hooks that every feature builds on.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "tai42 <oss@tai42.ai>",
@@ -89,7 +89,7 @@
89
89
  "@radix-ui/react-select": "^2.3.2",
90
90
  "@radix-ui/react-tabs": "^1.1.16",
91
91
  "@radix-ui/react-tooltip": "^1.2.11",
92
- "@tai42/api-client": "1.4.0"
92
+ "@tai42/api-client": "1.6.0"
93
93
  },
94
94
  "scripts": {
95
95
  "build": "tsc -b tsconfig.build.json && node scripts/copy-assets.mjs",
@@ -3,7 +3,7 @@
3
3
  * half of {@link ViewToggle}). It lays its children out on the design system's
4
4
  * responsive `.tai-grid-cards` track (three columns, dropping to two then one down
5
5
  * the responsive bands); each child is expected to be an interactive `Card`. Living
6
- * in the SDK keeps the tools screen and PLAN_4's flows page on one identical grid.
6
+ * in the SDK keeps the tools screen and the flows page on one identical grid.
7
7
  */
8
8
  import type { ReactNode } from 'react';
9
9
 
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Folder navigation primitives for the tool-organization tree — shared by the tools
3
- * screen and PLAN_4's flows page so both explore, breadcrumb, and re-file against
3
+ * screen and the flows page so both explore, breadcrumb, and re-file against
4
4
  * one identical set of controls.
5
5
  *
6
6
  * The tree is passed FLAT (a {@link Folder} list keyed by `id`, each naming its
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * `OverlayDetailsFields` — the display-name + user-tags editor shared by EVERY
3
3
  * tool_meta edit surface (the tools-screen edit dialog, the presets screen, and
4
- * PLAN_4's flows page). One canonical control means the merge-patch write semantics
4
+ * the flows page). One canonical control means the merge-patch write semantics
5
5
  * exist exactly once.
6
6
  *
7
7
  * Controlled: the caller owns `value` (prefilled from the tool's overlay row) and
@@ -5,8 +5,8 @@
5
5
  * PRESENTATIONAL: the caller fetches the tool names (GET /api/tools) and owns the
6
6
  * selected value; this component fetches nothing.
7
7
  *
8
- * Three optional extensions, each inert unless supplied; the preset create flow
9
- * passes all three and the multi-tool picker the first two:
8
+ * Four optional extensions, each inert unless supplied; the preset create flow
9
+ * passes the first three and the multi-tool picker the first two:
10
10
  * - `excludeNames` removes names from the options (e.g. a preset cannot be
11
11
  * another preset's base, so the preset create flow excludes existing preset
12
12
  * names). The server stays the authority — a slipped-through name is rejected
@@ -18,10 +18,15 @@
18
18
  * tool with " (agent)" (in grouped and flat renderings alike) — a purely visual
19
19
  * honesty cue; the value stays the bare name and no option is excluded, since an
20
20
  * agent run tool is a legal preset base for an authored agent.
21
+ * - `displayNames` (from the tool-meta overlay) overlays a human name onto the
22
+ * LABEL: a mapped option reads `Display Name (raw_name)`, an unmapped name (or a
23
+ * mapping equal to the raw name) reads the bare raw name. The value stays the raw
24
+ * name and grouping/filtering/exclusion key off raw names alone, so a display
25
+ * name is purely cosmetic.
21
26
  *
22
- * SAFETY: a tool name AND a tag are server-supplied, so every name/tag renders as
23
- * TEXT through the DS `Select` (React escapes it) — never an HTML sink. Pinned by
24
- * a test.
27
+ * SAFETY: a tool name, a tag, AND a display name are server-supplied, so every one
28
+ * renders as TEXT through the DS `Select` (React escapes it) — never an HTML sink.
29
+ * Pinned by a test.
25
30
  */
26
31
  import { useState } from 'react';
27
32
 
@@ -49,6 +54,13 @@ export interface ToolPickerProps {
49
54
  readonly tagsByTool?: Readonly<Record<string, readonly string[]>>;
50
55
  /** Tool names that are agent run tools; their option labels are suffixed " (agent)". */
51
56
  readonly agentToolNames?: ReadonlySet<string>;
57
+ /**
58
+ * Human display names keyed by raw tool name (from the tool-meta overlay). A
59
+ * mapped option's label reads `Display Name (raw_name)`; an unmapped name — or a
60
+ * mapping equal to the raw name — reads the bare raw name. The value `onChange`
61
+ * emits stays the raw name in every case.
62
+ */
63
+ readonly displayNames?: Readonly<Record<string, string>>;
52
64
  }
53
65
 
54
66
  const UNTAGGED = 'Untagged';
@@ -63,15 +75,25 @@ function groupFor(name: string, tagsByTool: Readonly<Record<string, readonly str
63
75
  return tags[0] ?? UNTAGGED;
64
76
  }
65
77
 
66
- /** The option label: the bare name, suffixed " (agent)" for an agent run tool. */
67
- function optionLabel(name: string, agentToolNames: ReadonlySet<string> | undefined): string {
68
- return agentToolNames?.has(name) === true ? `${name} (agent)` : name;
78
+ /**
79
+ * The option label: `Display Name (raw)` when a distinct display name maps the
80
+ * name, else the bare name; either way suffixed " (agent)" for an agent run tool.
81
+ */
82
+ function optionLabel(
83
+ name: string,
84
+ displayNames: Readonly<Record<string, string>> | undefined,
85
+ agentToolNames: ReadonlySet<string> | undefined,
86
+ ): string {
87
+ const display = displayNames?.[name];
88
+ const base = display !== undefined && display !== name ? `${display} (${name})` : name;
89
+ return agentToolNames?.has(name) === true ? `${base} (agent)` : base;
69
90
  }
70
91
 
71
92
  /** Build the grouped option clusters (sorted group labels, "Untagged" last). */
72
93
  function buildGroups(
73
94
  names: readonly string[],
74
95
  tagsByTool: Readonly<Record<string, readonly string[]>>,
96
+ displayNames: Readonly<Record<string, string>> | undefined,
75
97
  agentToolNames: ReadonlySet<string> | undefined,
76
98
  ): SelectGroup[] {
77
99
  const byGroup = new Map<string, string[]>();
@@ -91,7 +113,7 @@ function buildGroups(
91
113
  label,
92
114
  options: groupNames.map((name) => ({
93
115
  value: name,
94
- label: optionLabel(name, agentToolNames),
116
+ label: optionLabel(name, displayNames, agentToolNames),
95
117
  })),
96
118
  }));
97
119
  }
@@ -108,6 +130,7 @@ export function ToolPicker({
108
130
  excludeNames,
109
131
  tagsByTool,
110
132
  agentToolNames,
133
+ displayNames,
111
134
  }: ToolPickerProps) {
112
135
  const [tagFilter, setTagFilter] = useState<string>(ALL_TAGS);
113
136
 
@@ -130,7 +153,7 @@ export function ToolPicker({
130
153
  const toolSelect =
131
154
  tagsByTool !== undefined ? (
132
155
  <Select
133
- groups={buildGroups(filtered, tagsByTool, agentToolNames)}
156
+ groups={buildGroups(filtered, tagsByTool, displayNames, agentToolNames)}
134
157
  value={value ?? ''}
135
158
  onValueChange={onChange}
136
159
  placeholder={placeholder}
@@ -144,7 +167,7 @@ export function ToolPicker({
144
167
  // a subsequent selection would otherwise trigger.
145
168
  options={filtered.map((name) => ({
146
169
  value: name,
147
- label: optionLabel(name, agentToolNames),
170
+ label: optionLabel(name, displayNames, agentToolNames),
148
171
  }))}
149
172
  value={value ?? ''}
150
173
  onValueChange={onChange}
@@ -6,7 +6,7 @@
6
6
  * so the segment shows just its glyph while keeping a real accessible name. A single
7
7
  * screen's choice persists across sessions in `localStorage`, keyed per SURFACE —
8
8
  * the tools screen and the flows page each remember their own view — via
9
- * {@link useViewMode}. The two live in the SDK so every entity screen (and PLAN_4's
9
+ * {@link useViewMode}. The two live in the SDK so every entity screen (and the
10
10
  * flows page) toggles identically; `EntityCardGrid` renders the card half.
11
11
  */
12
12
  import { useCallback, useState, type ReactNode } from 'react';
@@ -5,8 +5,8 @@
5
5
  * EFFECTIVE hidden is the overlay's tri-state OVERRIDE of the plugin's own
6
6
  * declaration: an overlay opinion (`true`/`false`) wins, else the plugin
7
7
  * declaration stands. So an overlay `false` UNHIDES a plugin-hidden tool, `true`
8
- * force-hides, and `null` (no overlay row is the same) DEFERS to the declaration
9
- * (PLAN §Tools-read-surface). The rule lives here ONCE so the list-exclusion and
8
+ * force-hides, and `null` (no overlay row is the same) DEFERS to the declaration.
9
+ * The rule lives here ONCE so the list-exclusion and
10
10
  * the picker-exclusion can never drift apart.
11
11
  */
12
12
  import type { ToolMetaRecord, ToolTagEntry } from '@tai42/api-client';