@ssiriuss/ai 0.0.0-stage → 0.0.1
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.
- package/README.md +66 -2
- package/dist/boxes/ai-pages.d.ts +15 -0
- package/dist/boxes/ai-pages.js +1 -0
- package/dist/boxes/ai.d.ts +2 -0
- package/dist/boxes/ai.js +1 -0
- package/dist/features/ai-assets/README.md +26 -0
- package/dist/features/ai-assets/components/McpClientToolsPanel.d.ts +6 -0
- package/dist/features/ai-assets/components/McpClientToolsPanel.js +1 -0
- package/dist/features/ai-assets/components/McpEditorLayout.d.ts +29 -0
- package/dist/features/ai-assets/components/McpEditorLayout.js +1 -0
- package/dist/features/ai-assets/components/McpKeysPanel.d.ts +7 -0
- package/dist/features/ai-assets/components/McpKeysPanel.js +1 -0
- package/dist/features/ai-assets/components/McpSyncedData.d.ts +13 -0
- package/dist/features/ai-assets/components/McpSyncedData.js +1 -0
- package/dist/features/ai-assets/components/McpTables.d.ts +36 -0
- package/dist/features/ai-assets/components/McpTables.js +1 -0
- package/dist/features/ai-assets/components/Panels.d.ts +27 -0
- package/dist/features/ai-assets/components/Panels.js +1 -0
- package/dist/features/ai-assets/components/RegistryPages.d.ts +29 -0
- package/dist/features/ai-assets/components/RegistryPages.js +1 -0
- package/dist/features/ai-assets/components/SpecEditors.d.ts +27 -0
- package/dist/features/ai-assets/components/SpecEditors.js +2 -0
- package/dist/features/ai-assets/components/ToolEditor.d.ts +16 -0
- package/dist/features/ai-assets/components/ToolEditor.js +3 -0
- package/dist/features/ai-assets/components/ToolTestForm.d.ts +8 -0
- package/dist/features/ai-assets/components/ToolTestForm.js +1 -0
- package/dist/features/ai-assets/components/fields.d.ts +82 -0
- package/dist/features/ai-assets/components/fields.js +3 -0
- package/dist/features/ai-assets/components/mcp-headings.d.ts +1 -0
- package/dist/features/ai-assets/components/mcp-headings.js +1 -0
- package/dist/features/ai-assets/hooks/useAssets.d.ts +161 -0
- package/dist/features/ai-assets/hooks/useAssets.js +1 -0
- package/dist/features/ai-assets/hooks/useControlTowerTabs.d.ts +10 -0
- package/dist/features/ai-assets/hooks/useControlTowerTabs.js +1 -0
- package/dist/features/ai-assets/index.d.ts +1 -0
- package/dist/features/ai-assets/index.js +1 -0
- package/dist/features/ai-assets/model/endpoints.d.ts +2 -0
- package/dist/features/ai-assets/model/endpoints.js +1 -0
- package/dist/features/ai-assets/model/kinds.d.ts +12 -0
- package/dist/features/ai-assets/model/kinds.js +1 -0
- package/dist/features/ai-assets/model/mcp.d.ts +21 -0
- package/dist/features/ai-assets/model/mcp.js +1 -0
- package/dist/features/ai-assets/model/routes.d.ts +6 -0
- package/dist/features/ai-assets/model/routes.js +1 -0
- package/dist/features/ai-assets/model/tool-contract.d.ts +68 -0
- package/dist/features/ai-assets/model/tool-contract.js +7 -0
- package/dist/features/ai-assets/pages/AssetDesignerPage.d.ts +6 -0
- package/dist/features/ai-assets/pages/AssetDesignerPage.js +1 -0
- package/dist/features/ai-assets/pages/AssetsPage.d.ts +10 -0
- package/dist/features/ai-assets/pages/AssetsPage.js +1 -0
- package/dist/features/ai-assets/pages/GuardrailPolicyPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/GuardrailPolicyPage.js +3 -0
- package/dist/features/ai-assets/pages/GuardrailsPage.d.ts +5 -0
- package/dist/features/ai-assets/pages/GuardrailsPage.js +1 -0
- package/dist/features/ai-assets/pages/LlmProviderPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/LlmProviderPage.js +1 -0
- package/dist/features/ai-assets/pages/LlmProvidersPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/LlmProvidersPage.js +1 -0
- package/dist/features/ai-assets/pages/McpClientPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/McpClientPage.js +1 -0
- package/dist/features/ai-assets/pages/McpPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/McpPage.js +1 -0
- package/dist/features/ai-assets/pages/McpServerPage.d.ts +2 -0
- package/dist/features/ai-assets/pages/McpServerPage.js +1 -0
- package/dist/features/ai-assets/pages/NewToolPage.d.ts +3 -0
- package/dist/features/ai-assets/pages/NewToolPage.js +1 -0
- package/dist/features/ai-studio/README.md +19 -0
- package/dist/features/ai-studio/components/StudioPages.d.ts +1 -0
- package/dist/features/ai-studio/components/StudioPages.js +1 -0
- package/dist/features/ai-studio/index.d.ts +2 -0
- package/dist/features/ai-studio/index.js +1 -0
- package/dist/features/ai-studio/model/demo-data.d.ts +44 -0
- package/dist/features/ai-studio/model/demo-data.js +1 -0
- package/dist/features/ai-studio/model/studio-pages.d.ts +64 -0
- package/dist/features/ai-studio/model/studio-pages.js +1 -0
- package/dist/features/ai-studio/pages/AiStudioPage.d.ts +3 -0
- package/dist/features/ai-studio/pages/AiStudioPage.js +1 -0
- package/dist/features/ai-studio/pages/StudioInventoryPage.d.ts +8 -0
- package/dist/features/ai-studio/pages/StudioInventoryPage.js +1 -0
- package/dist/features/document-analysis/README.md +13 -0
- package/dist/features/document-analysis/components/AnalysisModelPanel.d.ts +5 -0
- package/dist/features/document-analysis/components/AnalysisModelPanel.js +1 -0
- package/dist/features/document-analysis/components/AttributeEditor.d.ts +10 -0
- package/dist/features/document-analysis/components/AttributeEditor.js +5 -0
- package/dist/features/document-analysis/components/CategoryEditor.d.ts +11 -0
- package/dist/features/document-analysis/components/CategoryEditor.js +1 -0
- package/dist/features/document-analysis/components/CategoryGrid.d.ts +11 -0
- package/dist/features/document-analysis/components/CategoryGrid.js +1 -0
- package/dist/features/document-analysis/components/DefinitionDetail.d.ts +9 -0
- package/dist/features/document-analysis/components/DefinitionDetail.js +1 -0
- package/dist/features/document-analysis/components/DefinitionEditor.d.ts +10 -0
- package/dist/features/document-analysis/components/DefinitionEditor.js +1 -0
- package/dist/features/document-analysis/components/DetailsPanel.d.ts +10 -0
- package/dist/features/document-analysis/components/DetailsPanel.js +1 -0
- package/dist/features/document-analysis/components/FieldGrid.d.ts +8 -0
- package/dist/features/document-analysis/components/FieldGrid.js +1 -0
- package/dist/features/document-analysis/components/HistoryDialog.d.ts +7 -0
- package/dist/features/document-analysis/components/HistoryDialog.js +1 -0
- package/dist/features/document-analysis/components/LifecycleDialog.d.ts +16 -0
- package/dist/features/document-analysis/components/LifecycleDialog.js +1 -0
- package/dist/features/document-analysis/components/SubFieldTree.d.ts +9 -0
- package/dist/features/document-analysis/components/SubFieldTree.js +1 -0
- package/dist/features/document-analysis/components/TestResult.d.ts +5 -0
- package/dist/features/document-analysis/components/TestResult.js +1 -0
- package/dist/features/document-analysis/components/parts.d.ts +27 -0
- package/dist/features/document-analysis/components/parts.js +1 -0
- package/dist/features/document-analysis/hooks/useDocumentAnalysis.d.ts +111 -0
- package/dist/features/document-analysis/hooks/useDocumentAnalysis.js +1 -0
- package/dist/features/document-analysis/index.d.ts +1 -0
- package/dist/features/document-analysis/index.js +1 -0
- package/dist/features/document-analysis/model/fieldKinds.d.ts +106 -0
- package/dist/features/document-analysis/model/fieldKinds.js +1 -0
- package/dist/features/document-analysis/model/presentation.d.ts +4 -0
- package/dist/features/document-analysis/model/presentation.js +1 -0
- package/dist/features/document-analysis/pages/AnalyzerAdminPage.d.ts +2 -0
- package/dist/features/document-analysis/pages/AnalyzerAdminPage.js +1 -0
- package/dist/shared/api/document-analysis.d.ts +56 -0
- package/dist/shared/api/document-analysis.js +1 -0
- package/dist/shared/api/guardrails.d.ts +74 -0
- package/dist/shared/api/guardrails.js +1 -0
- package/dist/shared/api/llm-providers.d.ts +59 -0
- package/dist/shared/api/llm-providers.js +1 -0
- package/package.json +24 -4
package/README.md
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sirius UI AI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Pages for AI Studio and its controls: agents, designers, the control tower, analyzers and classifiers.
|
|
4
|
+
|
|
5
|
+
`@ssiriuss/ai` is one of the five Sirius UI packages.
|
|
6
|
+
|
|
7
|
+
## What's inside
|
|
8
|
+
|
|
9
|
+
- **AI Studio**: AI assets, agents, LLM providers, guardrails, MCP server keys.
|
|
10
|
+
- **Control tower**: agent runs and their outcomes.
|
|
11
|
+
- **Designers**: agent, analyzer and classifier designers.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
React 19, Vite and Tailwind CSS 4. List core and every package you use (your code imports
|
|
16
|
+
core directly):
|
|
17
|
+
|
|
18
|
+
```shell
|
|
19
|
+
npm install @ssiriuss/core @ssiriuss/ai
|
|
20
|
+
npm install -D vite @vitejs/plugin-react @tailwindcss/vite typescript
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`vite.config.ts`:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
27
|
+
import react from '@vitejs/plugin-react'
|
|
28
|
+
import { defineConfig } from 'vite'
|
|
29
|
+
import { siriusBoxes } from '@ssiriuss/core/vite'
|
|
30
|
+
|
|
31
|
+
export default defineConfig({ plugins: [siriusBoxes(import.meta.dirname), react(), tailwindcss()] })
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`src/main.tsx`:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { startSirius } from '@/app/start'
|
|
38
|
+
|
|
39
|
+
startSirius([]) // your own application modules: routes, page blocks, menu entries
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`siriusBoxes` finds the installed `@ssiriuss/*` packages, resolves `@/` imports across
|
|
43
|
+
them, and gives core's shell their pages. In `tsconfig.json`, map `@/*` to
|
|
44
|
+
`./node_modules/@ssiriuss/<package>/dist/*` for each installed package, then `./src/*`.
|
|
45
|
+
The app needs the Sirius API running (the `siriuss-*` Python packages).
|
|
46
|
+
|
|
47
|
+
## The Sirius UI packages
|
|
48
|
+
|
|
49
|
+
Sirius is a platform for building business applications. The UI is a React app made of
|
|
50
|
+
five packages that match the Python packages of the Sirius API (`siriuss-*`) and talk to
|
|
51
|
+
its `/api/v1` only. Install only what you need; each package brings the ones it is built on.
|
|
52
|
+
|
|
53
|
+
| Package | What it adds | Built on |
|
|
54
|
+
| ---------------------- | ------------------------------------------------------------------------------ | -------- |
|
|
55
|
+
| `@ssiriuss/core` | the app shell, sign-in, users, tenants, access, events, menus, the Vite plugin | (base) |
|
|
56
|
+
| `@ssiriuss/connectors` | Integration Studio, mailboxes | core |
|
|
57
|
+
| `@ssiriuss/ai` | AI Studio, control tower, agent and analyzer designers | core |
|
|
58
|
+
| `@ssiriuss/builder` | component library, pages, playbooks, flows, tables, tasks, human tasks | core |
|
|
59
|
+
| `@ssiriuss/intake` | workbench, inbox, AI insights, document queue | all four |
|
|
60
|
+
|
|
61
|
+
Each package registers its own pages; core's shell shows the pages of the packages that
|
|
62
|
+
are installed, and nothing of the ones that are not.
|
|
63
|
+
|
|
64
|
+
## Status
|
|
65
|
+
|
|
66
|
+
Pre-release (`0.0.x`): pages and extension points may still change between versions.
|
|
67
|
+
All five packages are released together with the same version.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const LlmProviderDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage>;
|
|
2
|
+
export declare const GuardrailPolicyDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage>;
|
|
3
|
+
export declare const AiAgentsStudio: import("react").LazyExoticComponent<typeof import("@/features/ai-assets").AgentsRegistryPage>;
|
|
4
|
+
export declare const SkillsStudio: import("react").LazyExoticComponent<typeof import("@/features/ai-assets").SkillsRegistryPage>;
|
|
5
|
+
export declare const ToolsStudio: import("react").LazyExoticComponent<typeof import("@/features/ai-assets").ToolsRegistryPage>;
|
|
6
|
+
export declare const McpStudio: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/McpPage").McpPage>;
|
|
7
|
+
export declare const AgentDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
8
|
+
export declare const RemoteAgentDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
9
|
+
export declare const SkillDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
10
|
+
export declare const ToolDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
11
|
+
export declare const NewToolDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
12
|
+
export declare const McpServerDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
13
|
+
export declare const McpClientDesigner: import("react").LazyExoticComponent<typeof import("../features/ai-assets/pages/GuardrailPolicyPage").GuardrailPolicyPage | typeof import("../features/ai-assets/pages/GuardrailsPage").GuardrailsPage | typeof import("../features/ai-assets/pages/LlmProviderPage").LlmProviderPage | typeof import("../features/ai-assets/pages/LlmProvidersPage").LlmProvidersPage | typeof import("../features/ai-assets/pages/McpClientPage").McpClientPage | typeof import("../features/ai-assets/pages/McpPage").McpPage | typeof import("../features/ai-assets/pages/McpServerPage").McpServerPage | typeof import("../features/ai-assets/pages/NewToolPage").NewToolPage | typeof import("@/features/ai-assets").AgentsRegistryPage | typeof import("@/features/ai-assets").SkillsRegistryPage | typeof import("@/features/ai-assets").ToolsRegistryPage | typeof import("@/features/ai-assets").AgentDesignerPage | typeof import("@/features/ai-assets").RemoteAgentDesignerPage | typeof import("@/features/ai-assets").SkillDesignerPage | typeof import("@/features/ai-assets").ToolDesignerPage>;
|
|
14
|
+
/** Control Tower: LLM providers by default, guardrails on its tab. */
|
|
15
|
+
export declare function ControlTower(): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{lazy as e}from"react";import{useSearchParams as t}from"react-router-dom";import{jsx as n}from"react/jsx-runtime";const r=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.LlmProvidersRegistryPage})));export const LlmProviderDesigner=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.LlmProviderDesignerPage})));const i=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.GuardrailsRegistryPage})));export const GuardrailPolicyDesigner=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.GuardrailPolicyDesignerPage})));export const AiAgentsStudio=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.AgentsRegistryPage})));export const SkillsStudio=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.SkillsRegistryPage})));export const ToolsStudio=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.ToolsRegistryPage})));export const McpStudio=e(()=>import(`@/features/ai-assets`).then(e=>({default:e.McpRegistryPage})));const a=t=>e(()=>import(`@/features/ai-assets`).then(e=>({default:e[t]})));export const AgentDesigner=a(`AgentDesignerPage`);export const RemoteAgentDesigner=a(`RemoteAgentDesignerPage`);export const SkillDesigner=a(`SkillDesignerPage`);export const ToolDesigner=a(`ToolDesignerPage`);export const NewToolDesigner=a(`NewToolDesignerPage`);export const McpServerDesigner=a(`McpServerDesignerPage`);export const McpClientDesigner=a(`McpClientDesignerPage`);export function ControlTower(){let[e]=t();return e.get(`tab`)===`guardrails`?n(i,{}):n(r,{})}
|
package/dist/boxes/ai.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{lazy as e}from"react";import{Navigate as t}from"react-router-dom";import{paths as n}from"@/app/paths";import{pageAccess as r}from"@/shared/auth/page-access";import{AgentDesigner as i,AiAgentsStudio as a,ControlTower as o,GuardrailPolicyDesigner as s,LlmProviderDesigner as c,McpClientDesigner as l,McpServerDesigner as u,McpStudio as d,NewToolDesigner as f,RemoteAgentDesigner as p,SkillDesigner as m,SkillsStudio as h,ToolDesigner as g,ToolsStudio as _}from"./ai-pages";import{jsx as v}from"react/jsx-runtime";const y=e(()=>import(`@/features/ai-studio`).then(e=>({default:e.AiStudioPage}))),b=e(()=>import(`@/features/document-analysis`).then(e=>({default:e.AnalyzersPage}))),x=e(()=>import(`@/features/document-analysis`).then(e=>({default:e.ClassifiersPage}))),S=r.workbench,C=[[n.aiAgents,i],[n.remoteAgents,p],[n.aiSkills,m],[n.aiTools,g],[n.mcpServers,u],[n.mcpClients,l]].map(([e,t])=>({path:`${e}/:id`,page:v(t,{}),access:S}));export const BOX={name:`ai`,order:20,routes:[{path:n.aiStudio,page:v(y,{}),access:S},{path:n.controlTower,page:v(o,{}),access:S},{path:`${n.guardrails}/:id`,page:v(s,{}),access:S},{path:`${n.llmProviders}/:id`,page:v(c,{}),access:S},{path:n.aiAgents,page:v(a,{}),access:S},{path:n.aiSkills,page:v(h,{}),access:S},{path:n.aiTools,page:v(_,{}),access:S},{path:n.mcp,page:v(d,{}),access:S},{path:`${n.aiTools}/new`,page:v(f,{}),access:S},...C,{path:n.a2a,page:v(t,{to:`${n.aiAgents}?tab=remote_agent`,replace:!0})},{path:n.analyzers,page:v(b,{}),access:r.analyzers},{path:n.classifiers,page:v(x,{}),access:r.classifiers}]};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# AI assets
|
|
2
|
+
|
|
3
|
+
The AI registry (backend ADR 0031): agents, remote A2A agents, skills, tools, MCP servers we
|
|
4
|
+
publish and MCP clients we use. Routes import only `index.ts` (AgentsRegistryPage,
|
|
5
|
+
SkillsRegistryPage, ToolsRegistryPage, McpRegistryPage and one designer page per kind).
|
|
6
|
+
Designers live under each kind's page: `/ai-studio/agents/{id}`, `/ai-studio/remote-agents/{id}`,
|
|
7
|
+
`/ai-studio/skills/{id}`, `/ai-studio/tools/{id}`, `/ai-studio/mcp/servers/{id}`,
|
|
8
|
+
`/ai-studio/mcp/clients/{id}`; each calls its kind's API resource (`/api/v1/tools`, …).
|
|
9
|
+
|
|
10
|
+
A tool is the leaf that does the work (REST call, database call, coded function, script:
|
|
11
|
+
Python in a sandbox or CEL). Agents, skills and flows are the wrappers, so a new tool never wraps one; older agent
|
|
12
|
+
or prompt tools keep running but are not listed. MCP tools come from a client sync and are
|
|
13
|
+
read-only. A new tool is built step by step at `/ai-studio/tools/new`; the tool designer
|
|
14
|
+
uses the same tabs: Details, Source, Inputs & outputs, Settings.
|
|
15
|
+
|
|
16
|
+
| Folder | What lives there |
|
|
17
|
+
| ------------- | ---------------------------------------------------------------------------- |
|
|
18
|
+
| `pages/` | The list page per kind group (New opens the designer) and the designer page |
|
|
19
|
+
| `components/` | Spec editors per kind, versions/test/A2A panels, form parts, the route pages |
|
|
20
|
+
| `model/` | Kind labels and icons, list routes, endpoint addresses |
|
|
21
|
+
| `hooks/` | Registry queries and mutations |
|
|
22
|
+
|
|
23
|
+
Add a kind: backend spec first (`npm run api:update`), then a label in `model/kinds.ts`,
|
|
24
|
+
an editor in `components/SpecEditors.tsx` and its route in `model/routes.ts`.
|
|
25
|
+
|
|
26
|
+
Tests live in `src/test/features/ai-assets/`, mirroring these folders.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AssetDetail, type TenantScope } from '@/shared/api/ai-assets';
|
|
2
|
+
/** The registry tools that call this MCP client; Sync lists the server's tools again. */
|
|
3
|
+
export declare function McpClientToolsPanel({ client: asset, tenantId, }: {
|
|
4
|
+
client: AssetDetail;
|
|
5
|
+
tenantId: TenantScope;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useMutation as e,useQuery as t,useQueryClient as n}from"@tanstack/react-query";import{Link as r}from"react-router-dom";import{RefreshCw as i,Wrench as a}from"lucide-react";import{getMcpLinkedTools as o,syncMcpTools as s}from"@/shared/api/ai-assets";import{useSession as c}from"@/shared/auth/session-context";import{Button as l}from"@/shared/components/ui/button";import{formatInstant as u}from"@/shared/lib/datetime";import{cn as d}from"@/shared/lib/utils";import{assetsKey as f}from"../hooks/useAssets";import{assetTitle as p}from"../model/kinds";import{designerPath as m}from"../model/routes";import{Section as h}from"./fields";import{Problems as g}from"./Panels";import{jsx as _,jsxs as v}from"react/jsx-runtime";const y={created:`bg-success/10 text-success-foreground`,updated:`bg-primary/10 text-primary`,unchanged:`bg-muted text-muted-foreground`,missing:`bg-warning/10 text-warning-foreground`};export function McpClientToolsPanel({client:b,tenantId:x}){let{can:S}=c(),C=n(),w=[...f(x),`mcp-tools`,b.id],T=t({queryKey:w,queryFn:({signal:e})=>o(b.id,x,e),retry:!1}),E=e({mutationFn:()=>s(b.id,x),onSuccess:()=>void C.invalidateQueries({queryKey:f(x)})}),D=new Map(E.data?.items.map(e=>[e.asset.id,e.outcome]));return v(h,{title:`Tools (${T.data?.length??0})`,children:[v(`div`,{className:`flex flex-wrap items-center gap-3`,children:[S(`ai.asset.write`)&&v(l,{size:`sm`,disabled:!b.published_number||E.isPending,onClick:()=>E.mutate(),children:[_(i,{className:d(E.isPending&&`animate-spin`)}),E.isPending?`Syncing…`:`Sync tools`]}),!b.published_number&&_(`p`,{className:`text-xs text-warning-foreground`,children:`Publish the client first (Versions), then sync.`}),E.data&&v(`output`,{className:`text-xs text-muted-foreground`,children:[E.data.created,` new · `,E.data.updated,` changed · `,E.data.unchanged,` unchanged`,E.data.missing?` · ${E.data.missing} no longer listed`:``]})]}),_(g,{error:E.error??T.error}),T.data&&T.data.length>0?_(`ul`,{className:`divide-y rounded-lg border`,children:T.data.map(e=>{let t=D.get(e.id);return v(`li`,{className:`flex items-center gap-3 px-3 py-2 text-sm`,children:[_(a,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),v(`div`,{className:`min-w-0 flex-1`,children:[_(r,{to:m(`tool`,e.id),className:`font-semibold text-primary hover:underline`,children:p(e)}),v(`p`,{className:`truncate text-xs text-muted-foreground`,children:[_(`code`,{children:e.name}),` · `,e.description||`No description`]})]}),t&&_(`span`,{className:d(`rounded-badge px-2.5 py-1 text-xs`,y[t]),children:t}),v(`span`,{className:`text-xs whitespace-nowrap text-muted-foreground`,children:[e.published_number?`v${e.published_number}`:`draft`,` ·`,` `,u(e.updated_at)]})]},e.id)})}):!T.isPending&&_(`p`,{className:`text-xs text-muted-foreground`,children:`No tools yet. Sync lists the server’s tools; each becomes a tool agents and skills can pick.`})]})}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type EditorTab = {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
/** An editor page (MCP client or server, LLM provider): back link, title and actions, tabs, then the tab's body. */
|
|
8
|
+
export declare function McpEditorLayout({ back, backLabel, title, subtitle, badge, actions, tabs, tab, onTab, children, }: {
|
|
9
|
+
back: string;
|
|
10
|
+
backLabel: string;
|
|
11
|
+
title: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
badge?: ReactNode;
|
|
14
|
+
actions?: ReactNode;
|
|
15
|
+
tabs: EditorTab[];
|
|
16
|
+
tab: string;
|
|
17
|
+
onTab: (id: string) => void;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
/** One group of a settings form: its title and purpose on the left, its fields on the right. */
|
|
21
|
+
export declare function FormSection({ title, description, children, }: {
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
children: ReactNode;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
export declare function StatusBadge({ tone, children, }: {
|
|
27
|
+
tone: 'good' | 'warn' | 'bad' | 'plain';
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{tabBarClass as e,tabClass as t}from"@/shared/components/workspace/tab-styles";import{cn as n}from"@/shared/lib/utils";import{BackLink as r}from"@/shared/components/workspace/BackLink";import{jsx as i,jsxs as a}from"react/jsx-runtime";export function McpEditorLayout({back:o,backLabel:s,title:c,subtitle:l,badge:u,actions:d,tabs:f,tab:p,onTab:m,children:h}){return a(`div`,{className:`workspace-admin flex min-h-0 flex-col`,children:[i(r,{to:o,children:s}),a(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[a(`div`,{className:`min-w-0`,children:[a(`div`,{className:`flex items-center gap-2`,children:[i(`h1`,{className:`truncate text-xl font-semibold tracking-tight`,children:c}),u]}),l&&i(`p`,{className:`mt-0.5 truncate text-sm text-muted-foreground`,children:l})]}),d&&i(`div`,{className:`flex flex-wrap items-center gap-2`,children:d})]}),f.length<2?i(`div`,{className:`mt-4 mb-5 border-b`}):i(`nav`,{"aria-label":`Sections`,className:n(e,`mt-4 mb-5`),children:f.map(e=>i(`button`,{type:`button`,disabled:e.disabled,"aria-current":p===e.id?`page`:void 0,onClick:()=>m(e.id),className:t(p===e.id),children:e.label},e.id))}),h]})}export function FormSection({title:e,description:t,children:n}){return a(`section`,{className:`grid gap-6 border-b py-6 first:pt-0 last:border-b-0 md:grid-cols-[16rem_1fr]`,children:[a(`div`,{children:[i(`h2`,{className:`text-sm font-semibold`,children:e}),i(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:t})]}),i(`div`,{className:`grid max-w-3xl gap-4 md:grid-cols-2`,children:n})]})}export function StatusBadge({tone:e,children:t}){return i(`span`,{className:n(`inline-flex items-center rounded-badge px-2.5 py-1 text-xs font-medium whitespace-nowrap`,e===`good`&&`bg-success/15 text-success-foreground`,e===`warn`&&`bg-warning/15 text-warning-foreground`,e===`bad`&&`bg-destructive/15 text-destructive`,e===`plain`&&`bg-muted text-muted-foreground`),children:t})}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type AssetDetail, type TenantScope } from '@/shared/api/ai-assets';
|
|
2
|
+
/** Access keys of one MCP server: each opens only this server, is shown once when issued,
|
|
3
|
+
* can expire and is revoked one by one. */
|
|
4
|
+
export declare function McpKeysPanel({ server, tenantId }: {
|
|
5
|
+
server: AssetDetail;
|
|
6
|
+
tenantId: TenantScope;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DataTable as e}from"@/shared/components/workspace/DataTable";import{useState as t}from"react";import{useMutation as n,useQuery as r,useQueryClient as i}from"@tanstack/react-query";import{Plus as a}from"lucide-react";import{mcpServerKeys as o}from"@/shared/api/ai-assets";import{useSession as s}from"@/shared/auth/session-context";import{Button as c}from"@/shared/components/ui/button";import{Input as l}from"@/shared/components/ui/input";import{ConfirmButton as u}from"@/shared/components/workspace/ConfirmButton";import{CopyValue as d}from"@/shared/components/workspace/CopyValue";import{ModalField as f,modalSelect as p}from"@/shared/components/workspace/Modal";import{formatInstant as m}from"@/shared/lib/datetime";import{assetsKey as h}from"../hooks/useAssets";import{endpoint as g}from"../model/endpoints";import{Problems as _}from"./Panels";import{notify as v}from"@/shared/lib/notify";import{jsx as y,jsxs as b}from"react/jsx-runtime";const x=[{value:`30`,label:`30 days`},{value:`90`,label:`90 days`},{value:`365`,label:`1 year`},{value:`0`,label:`Never`}],S=(e,t,n)=>JSON.stringify({mcpServers:{[e]:{type:`http`,url:t,headers:{Authorization:`Bearer ${n}`}}}},null,2);export function McpKeysPanel({server:C,tenantId:w}){let{can:T}=s(),E=T(`admin.integration.write`),D=i(),O=[...h(w),`mcp-server-keys`],k=r({queryKey:[...O,C.id],queryFn:({signal:e})=>o.list(w,C.id,e),retry:!1}),[A,j]=t(``),[M,N]=t(`90`),[P,F]=t(null),I=()=>void D.invalidateQueries({queryKey:O}),L=n({mutationFn:()=>o.issue({server_id:C.id,label:A.trim(),expires_at:M===`0`?null:Date.now()+Number(M)*864e5},w),onSuccess:e=>{F(e),j(``),I()}}),R=n({mutationFn:e=>o.revoke(e,w),onSuccess:()=>{v.success(`Key revoked.`),I()}}),z=g(`/mcp/${C.name}`);return b(`div`,{className:`max-w-5xl space-y-4`,children:[b(`p`,{className:`text-sm text-muted-foreground`,children:[`A key opens only this server. Callers send it as `,y(`code`,{children:`Authorization: Bearer`}),` or`,` `,y(`code`,{children:`X-API-Key`}),`.`]}),P?b(`div`,{className:`space-y-3 rounded-lg border border-primary/30 bg-primary/5 p-3`,children:[y(`p`,{className:`text-sm font-medium`,children:`Copy the key now: it is shown only once.`}),y(d,{id:`mcp-key`,label:`access key`,value:P.key,secret:!0}),y(f,{label:`MCP client configuration`,htmlFor:`mcp-config`,children:y(`pre`,{id:`mcp-config`,className:`rounded-md bg-muted p-2 font-mono text-[11px] break-all whitespace-pre-wrap`,children:S(C.name,z,P.key)})}),y(c,{size:`sm`,variant:`outline`,onClick:()=>F(null),children:`I have copied it`})]}):E&&b(`form`,{className:`grid max-w-3xl items-end gap-3 sm:grid-cols-[1fr_9rem_auto]`,onSubmit:e=>{e.preventDefault(),L.mutate()},children:[y(f,{label:`Who uses the key`,htmlFor:`key-label`,children:y(l,{id:`key-label`,maxLength:100,placeholder:`Claims portal`,value:A,onChange:e=>j(e.target.value)})}),y(f,{label:`Expires`,htmlFor:`key-expiry`,children:y(`select`,{id:`key-expiry`,className:p,value:M,onChange:e=>N(e.target.value),children:x.map(e=>y(`option`,{value:e.value,children:e.label},e.value))})}),b(c,{type:`submit`,disabled:!A.trim()||L.isPending,children:[y(a,{}),` `,L.isPending?`Issuing…`:`Issue key`]})]}),y(_,{error:L.error??k.error}),y(`div`,{className:`overflow-x-auto rounded-lg border`,children:b(e,{className:`w-full text-left text-sm`,children:[y(`caption`,{className:`sr-only`,children:`Access keys`}),y(`thead`,{className:`bg-muted/40 text-xs text-muted-foreground`,children:y(`tr`,{children:[`Key`,`Created`,`Last used`,`Expires`,``].map(e=>y(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:e},e))})}),y(`tbody`,{className:`divide-y`,children:(k.data??[]).length===0?y(`tr`,{children:y(`td`,{colSpan:5,className:`px-3 py-4 text-center text-muted-foreground`,children:k.isPending?`Loading…`:`No keys yet.`})}):k.data.map(e=>b(`tr`,{children:[b(`td`,{className:`px-3 py-2`,children:[y(`span`,{className:`font-medium`,children:e.label}),b(`code`,{className:`block text-xs text-muted-foreground`,children:[e.prefix,`…`]})]}),y(`td`,{className:`px-3 py-2 whitespace-nowrap`,"data-grid-sort":e.created_at,children:m(e.created_at)}),y(`td`,{className:`px-3 py-2 whitespace-nowrap`,"data-grid-sort":e.last_used_at,children:m(e.last_used_at,`Never`)}),y(`td`,{className:`px-3 py-2 whitespace-nowrap`,"data-grid-sort":e.expires_at,children:m(e.expires_at,`Never`)}),y(`td`,{className:`px-3 py-2 text-right`,children:E&&y(u,{destructive:!0,title:`Revoke ${e.label}?`,detail:`Calls with this key fail from now on.`,action:`Revoke`,pending:R.isPending&&R.variables===e.id,error:R.variables===e.id?R.error?.message:void 0,onConfirm:()=>R.mutate(e.id),className:`h-7 px-2 text-xs`,children:`Revoke`})})]},e.id))})]})})]})}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type AssetDetail, type TenantScope } from '@/shared/api/ai-assets';
|
|
2
|
+
/**
|
|
3
|
+
* What the server offers and what we keep of it. The server's capabilities decide what
|
|
4
|
+
* is shown; tools switched on here are the ones agents may call (`allowed_tools`).
|
|
5
|
+
*/
|
|
6
|
+
export declare function McpSyncedData({ client, tenantId, writable, }: {
|
|
7
|
+
client: {
|
|
8
|
+
data: AssetDetail;
|
|
9
|
+
etag: string;
|
|
10
|
+
};
|
|
11
|
+
tenantId: TenantScope;
|
|
12
|
+
writable: boolean;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DataTable as e}from"@/shared/components/workspace/DataTable";import{useState as t}from"react";import{useMutation as n,useQuery as r,useQueryClient as i}from"@tanstack/react-query";import{Link as a}from"react-router-dom";import{RefreshCw as o,Save as s}from"lucide-react";import{getMcpLinkedTools as c,saveAssetDraft as l,syncMcpTools as u,testAsset as d}from"@/shared/api/ai-assets";import{Button as f}from"@/shared/components/ui/button";import{formatInstant as p}from"@/shared/lib/datetime";import{cn as m}from"@/shared/lib/utils";import{assetsKey as h}from"../hooks/useAssets";import{publishDraft as g}from"../model/mcp";import{designerPath as _}from"../model/routes";import{StatusBadge as v}from"./McpEditorLayout";import{Problems as y}from"./Panels";import{notify as b}from"@/shared/lib/notify";import{jsx as x,jsxs as S}from"react/jsx-runtime";const C=[{id:`tools`,label:`Tools`,use:`Synced as registry tools for agents, skills and flows`,notes:e=>e.tools_list_changed?[`announces changes`]:[]},{id:`prompts`,label:`Prompts`,use:`Listed here; not synced to the registry yet`,notes:e=>e.prompts_list_changed?[`announces changes`]:[]},{id:`resources`,label:`Resources`,use:`Listed here; not synced to the registry yet`,notes:e=>[...e.resources_subscribe?[`subscribe`]:[],...e.resources_list_changed?[`announces changes`]:[]]},{id:`logging`,label:`Logging`,use:`Not used`,notes:()=>[]},{id:`completions`,label:`Completions`,use:`Not used`,notes:()=>[]},{id:`tasks`,label:`Tasks`,use:`Not used`,notes:()=>[]}];export function McpSyncedData({client:e,tenantId:E,writable:D}){let O=i(),k=e.data,A=k.spec.allowed_tools??[],j=r({queryKey:[...h(E),`mcp-discovery`,k.id,e.etag],queryFn:async()=>(await d(`mcp_client`,k.id,{},null,E)).output,retry:!1,staleTime:3e5,refetchOnWindowFocus:!1}),M=r({queryKey:[...h(E),`mcp-tools`,k.id],queryFn:({signal:e})=>c(k.id,E,e),retry:!1}),N=n({mutationFn:()=>u(k.id,E),onSuccess:()=>void O.invalidateQueries({queryKey:h(E)})}),P=j.data?.server_tools??[],[F,I]=t(null),L=e=>F?F.has(e):A.length===0||A.includes(e),R=(e,t)=>{let n=new Set(P.map(e=>e.name).filter(L));t?n.add(e):n.delete(e),I(n)},z=n({mutationFn:async t=>{let n=P.every(e=>t.has(e.name));await l(`mcp_client`,k.id,{display_name:k.display_name??null,description:k.description??``,spec:{...k.spec,allowed_tools:n?[]:[...t]}},e.etag,E),await g(`mcp_client`,k.id,E)},onSuccess:()=>{I(null),b.success(`Tool selection saved.`),O.invalidateQueries({queryKey:h(E)})}}),B=new Map((M.data??[]).map(e=>[e.display_name??e.name,e])),V=j.data?.capabilities??{},H=j.data?.server,U=P.filter(e=>L(e.name)).length;return S(`div`,{className:`max-w-6xl space-y-6`,children:[S(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[S(`dl`,{className:`flex flex-wrap gap-x-8 gap-y-1 text-sm`,children:[x(w,{label:`Server`,children:H?`${H.title||H.name||`—`}${H.version?` ${H.version}`:``}`:`—`}),x(w,{label:`Protocol`,children:H?.protocol_version??`—`}),x(w,{label:`Tools in registry`,children:M.data?.length??0})]}),S(`div`,{className:`flex gap-2`,children:[S(f,{variant:`outline`,size:`sm`,disabled:j.isFetching,onClick:()=>void j.refetch(),children:[x(o,{className:m(j.isFetching&&`animate-spin`)}),j.isFetching?`Discovering…`:`Discover again`]}),D&&V.tools&&S(f,{size:`sm`,disabled:!k.published_number||N.isPending||F!==null,onClick:()=>N.mutate(),children:[x(o,{className:m(N.isPending&&`animate-spin`)}),N.isPending?`Syncing…`:`Sync tools`]})]})]}),N.data&&S(`output`,{className:`block text-sm text-muted-foreground`,children:[`Synced: `,N.data.created,` new · `,N.data.updated,` changed · `,N.data.unchanged,` `,`unchanged`,N.data.missing?` · ${N.data.missing} no longer offered`:``]}),x(y,{error:j.error??N.error??z.error??M.error}),H?.instructions&&S(`p`,{className:`rounded-md bg-muted/50 px-3 py-2 text-sm text-muted-foreground`,children:[x(`span`,{className:`font-medium text-foreground`,children:`Server instructions: `}),H.instructions]}),x(T,{title:`Capabilities`,caption:`What the server declared on connect. Only what it supports is synced.`,head:[`Capability`,`Supported`,`Details`,`On our side`],empty:j.isPending?`Discovering…`:`Not discovered yet.`,rows:j.data?.capabilities?C.map(e=>[e.label,x(v,{tone:V[e.id]?`good`:`plain`,children:V[e.id]?`Yes`:`No`},`supported`),e.notes(V).join(` · `)||`—`,V[e.id]?e.use:`—`]):[]}),V.tools&&x(T,{title:`Tools (${U} of ${P.length} on)`,caption:`Switch a tool off and agents can no longer call it. Sync after a change.`,head:[`On`,`Tool`,`Description`,`Registry tool`,`Synced`],empty:`The server lists no tools.`,action:D&&F&&S(`div`,{className:`flex gap-2`,children:[x(f,{variant:`ghost`,size:`sm`,onClick:()=>I(null),children:`Discard`}),S(f,{size:`sm`,disabled:z.isPending||F.size===0,onClick:()=>z.mutate(F),children:[x(s,{}),` `,z.isPending?`Saving…`:`Save selection`]})]}),rows:P.map(e=>{let t=B.get(e.name);return[x(`input`,{type:`checkbox`,role:`switch`,"aria-label":`Use ${e.name}`,"aria-checked":L(e.name),checked:L(e.name),disabled:!D||z.isPending,onChange:t=>R(e.name,t.target.checked),className:`h-5 w-9 cursor-pointer accent-primary disabled:cursor-default`},`on`),x(`code`,{className:`text-[13px]`,children:e.name},`name`),x(`span`,{className:`line-clamp-2 text-muted-foreground`,children:e.description||`—`},`description`),t?x(a,{to:_(`tool`,t.id),className:`text-primary hover:underline`,children:t.name},`registry`):x(v,{tone:`warn`,children:`Not synced`},`registry`),t?`${t.published_number?`v${t.published_number}`:`draft`} · ${p(t.updated_at)}`:`—`]})}),V.prompts&&x(T,{title:`Prompts (${j.data?.prompts?.length??0})`,caption:`Prompt templates the server offers.`,head:[`Prompt`,`Description`,`Arguments`],empty:`The server lists no prompts.`,rows:(j.data?.prompts??[]).map(e=>[x(`code`,{className:`text-[13px]`,children:e.name},`name`),e.description||`—`,e.arguments.map(e=>`${e.name}${e.required?`*`:``}`).join(`, `)||`—`])}),V.resources&&x(T,{title:`Resources (${j.data?.resources?.length??0})`,caption:`Data the server lets clients read.`,head:[`Resource`,`URI`,`Type`],empty:`The server lists no resources.`,rows:(j.data?.resources??[]).map(e=>[e.name,x(`code`,{className:`text-[13px] break-all`,children:e.uri},`uri`),e.mime_type??`—`])})]})}function w({label:e,children:t}){return S(`div`,{className:`flex gap-2`,children:[x(`dt`,{className:`text-muted-foreground`,children:e}),x(`dd`,{className:`font-medium`,children:t})]})}function T({title:t,caption:n,head:r,rows:i,empty:a,action:o}){return S(`section`,{"aria-label":t,children:[S(`div`,{className:`mb-2 flex items-end justify-between gap-3`,children:[S(`div`,{children:[x(`h2`,{className:`text-sm font-semibold`,children:t}),x(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),o]}),x(`div`,{className:`overflow-x-auto rounded-lg border`,children:S(e,{"aria-label":t,className:`w-full text-sm`,children:[x(`thead`,{className:`bg-muted/40 text-left text-xs text-muted-foreground`,children:x(`tr`,{children:r.map(e=>x(`th`,{scope:`col`,className:`px-3 py-2 font-medium`,children:e},e))})}),x(`tbody`,{className:`divide-y`,children:i.length===0?x(`tr`,{children:x(`td`,{colSpan:r.length,className:`px-3 py-4 text-center text-muted-foreground`,children:a})}):i.map((e,t)=>x(`tr`,{children:e.map((e,t)=>x(`td`,{className:`px-3 py-2 align-top`,children:e},t))},t))})]})})]})}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type AssetItem, type McpServerKey, type TenantScope } from '@/shared/api/ai-assets';
|
|
3
|
+
import type { AuthProfile } from '@/shared/api/integrations';
|
|
4
|
+
type Tone = 'good' | 'warn' | 'bad' | 'plain';
|
|
5
|
+
export declare function Badge({ tone, children }: {
|
|
6
|
+
tone: Tone;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
9
|
+
export declare function IconAction({ label, onClick, disabled, busy, children, }: {
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: () => void;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
busy?: boolean;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare const cell = "px-3 py-3 align-middle";
|
|
17
|
+
/** Outside MCP servers our agents use: connect, test, sync tools, edit, delete. */
|
|
18
|
+
export declare function McpClientsTable({ columnsToolbar, clients, profiles, tenantId, writable, onEdit, }: {
|
|
19
|
+
columnsToolbar?: HTMLElement | null;
|
|
20
|
+
clients: AssetItem[];
|
|
21
|
+
profiles: AuthProfile[];
|
|
22
|
+
tenantId: TenantScope;
|
|
23
|
+
writable: boolean;
|
|
24
|
+
onEdit: (id: string) => void;
|
|
25
|
+
}): import("react").JSX.Element;
|
|
26
|
+
/** MCP servers we publish: endpoint, access, what they expose. */
|
|
27
|
+
export declare function McpServersTable({ columnsToolbar, servers, keys, tenantId, writable, onEdit, onKeys, }: {
|
|
28
|
+
columnsToolbar?: HTMLElement | null;
|
|
29
|
+
servers: AssetItem[];
|
|
30
|
+
keys: McpServerKey[];
|
|
31
|
+
tenantId: TenantScope;
|
|
32
|
+
writable: boolean;
|
|
33
|
+
onEdit: (id: string) => void;
|
|
34
|
+
onKeys: (item: AssetItem) => void;
|
|
35
|
+
}): import("react").JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mcpHeadings as e}from"./mcp-headings";import{DataTable as t}from"@/shared/components/workspace/DataTable";import{useState as n}from"react";import{useMutation as r,useQueryClient as i}from"@tanstack/react-query";import{KeyRound as a,LockKeyhole as o,RefreshCw as s,Trash2 as c,Zap as l}from"lucide-react";import{deleteAsset as u,syncMcpTools as d,testAsset as f}from"@/shared/api/ai-assets";import{Button as p}from"@/shared/components/ui/button";import{ConfirmButton as m}from"@/shared/components/workspace/ConfirmButton";import{useProfileSignIn as h}from"@/shared/hooks/useProfileSignIn";import{formatInstant as g}from"@/shared/lib/datetime";import{cn as _}from"@/shared/lib/utils";import{assetsKey as v}from"../hooks/useAssets";import{assetTitle as y}from"../model/kinds";import{endpoint as b}from"../model/endpoints";import{authOf as x,mcpAuthOptions as S,publishDraft as C}from"../model/mcp";import{notify as w}from"@/shared/lib/notify";import{jsx as T,jsxs as E,Fragment as D}from"react/jsx-runtime";export function Badge({tone:e,children:t}){return T(`span`,{className:_(`inline-flex items-center rounded-badge px-2.5 py-1 text-xs font-medium whitespace-nowrap`,e===`good`&&`bg-success/15 text-success-foreground`,e===`warn`&&`bg-warning/15 text-warning-foreground`,e===`bad`&&`bg-destructive/15 text-destructive`,e===`plain`&&`bg-muted text-muted-foreground`),children:t})}export function IconAction({label:e,onClick:t,disabled:n,busy:r,children:i}){return T(p,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":e,title:e,disabled:n||r,onClick:t,className:_(r&&`[&_svg]:animate-spin`),children:i})}function O({item:e,detail:t,tenantId:n}){let a=i(),o=r({mutationFn:()=>u(e.kind,e.id,`"${e.version}"`,n),onSuccess:()=>{w.success(`${y(e)} deleted.`),a.invalidateQueries({queryKey:v(n)})}});return T(m,{destructive:!0,title:`Delete ${y(e)}?`,detail:t,action:`Delete`,pending:o.isPending,error:o.error?.message,onConfirm:()=>o.mutate(),className:`size-7 border-0 bg-transparent p-0 hover:bg-destructive/10`,children:T(c,{"aria-label":`Delete ${e.name}`})})}export const cell=`px-3 py-3 align-middle`;export function McpClientsTable({columnsToolbar:a,clients:c,profiles:u,tenantId:p,writable:m,onEdit:b}){let w=i(),[k,A]=n({}),j=h(()=>void w.invalidateQueries({queryKey:[`integration-studio`]})),M=(e,t)=>A(n=>({...n,[e]:t})),N=r({mutationFn:e=>f(`mcp_client`,e.id,{},null,p),onSuccess:(e,t)=>{let n=e.output?.tools??[];M(t.id,{ok:!0,text:`Connected · ${n.length} tools listed`})},onError:(e,t)=>M(t.id,{ok:!1,text:e.message})}),P=r({mutationFn:async e=>(e.published_number||await C(`mcp_client`,e.id,p),d(e.id,p)),onSuccess:(e,t)=>{let n=e.created+e.updated+e.unchanged,r=e.missing?`, ${e.missing} no longer listed`:``;M(t.id,{ok:!0,text:`${n} tools · ${e.created} new, ${e.updated} changed${r}`}),w.invalidateQueries({queryKey:v(p)})},onError:(e,t)=>M(t.id,{ok:!1,text:e.message})}),F=new Map(u.map(e=>[e.name,e]));return E(D,{children:[j.blockedUrl&&E(`p`,{className:`px-3 pb-2 text-xs`,children:[`The sign-in window was blocked.`,` `,T(`a`,{href:j.blockedUrl,target:`_blank`,rel:`noreferrer`,className:`text-primary underline`,children:`Open the sign-in`})]}),E(t,{externalSearch:!0,columnsToolbar:a,className:`w-full text-left text-sm`,children:[T(`caption`,{className:`sr-only`,children:`MCP clients`}),e([`Server`,`Transport`,`Auth`,`Status`,`Linked tools`,`Tools updated`,`Actions`]),T(`tbody`,{className:`divide-y`,children:c.map(e=>{let t=e.connection,n=t?.auth_profile?F.get(t.auth_profile):void 0,r=n?.kind===`oauth2_authorization_code`,i=!r||!!n?.credentials?.signed_in,a=t?.enabled!==!1,c=k[e.id],u=t?.auth_profile?n?S.find(e=>e.value===x(n.kind))?.label??n.display_name??n.name:t.auth_profile:`None`,d=a?c&&!c.ok?[`bad`,`Error`]:i?e.published_number?[`good`,`Active`]:[`plain`,`Draft`]:[`warn`,`Needs sign-in`]:[`plain`,`Disabled`];return E(`tr`,{className:`hover:bg-muted/30`,children:[E(`td`,{className:cell,children:[T(`button`,{type:`button`,className:`text-left font-semibold text-primary hover:underline`,onClick:()=>b(e.id),children:y(e)}),T(`p`,{className:`max-w-md truncate text-xs text-muted-foreground`,children:t?.url||`No endpoint yet`}),c&&T(`output`,{className:_(`block text-xs`,c.ok?`text-success-foreground`:`text-destructive`),children:c.text})]}),T(`td`,{className:cell,children:t?.transport===`websocket`?`WebSocket`:`HTTP`}),T(`td`,{className:_(cell,`text-xs`),children:u}),T(`td`,{className:cell,children:T(Badge,{tone:d[0],children:d[1]})}),T(`td`,{className:_(cell,`text-right tabular-nums`),children:e.linked_tools??0}),T(`td`,{className:_(cell,`text-xs whitespace-nowrap text-muted-foreground`),children:e.linked_tools?g(e.updated_at):`Never`}),T(`td`,{className:cell,children:E(`div`,{className:`flex justify-end`,children:[r&&n&&m&&T(IconAction,{label:i?`Reconnect ${e.name}`:`Connect ${e.name}`,busy:j.waiting===n.id,onClick:()=>j.connect(n.id),children:T(o,{})}),T(IconAction,{label:`Test ${e.name}`,disabled:!t?.url||!a,busy:N.isPending&&N.variables?.id===e.id,onClick:()=>N.mutate(e),children:T(l,{})}),m&&T(IconAction,{label:`Sync tools of ${e.name}`,disabled:!t?.url||!i||!a,busy:P.isPending&&P.variables?.id===e.id,onClick:()=>P.mutate(e),children:T(s,{})}),m&&T(O,{item:e,tenantId:p,detail:`Its ${e.linked_tools??0} synced tools stay but stop working.`})]})})]},e.id)})})]})]})}export function McpServersTable({columnsToolbar:n,servers:r,keys:i,tenantId:o,writable:s,onEdit:c,onKeys:l}){return E(t,{externalSearch:!0,columnsToolbar:n,className:`w-full text-left text-sm`,children:[T(`caption`,{className:`sr-only`,children:`MCP servers`}),e([`Server`,`Endpoint`,`Transport`,`Auth`,`Tools`,`Status`,`Actions`]),T(`tbody`,{className:`divide-y`,children:r.map(e=>{let t=e.exposes,n=i.filter(t=>t.server_id===e.id).length,r=t?t.tools+t.skills+t.agents:0;return E(`tr`,{className:`hover:bg-muted/30`,children:[E(`td`,{className:cell,children:[T(`button`,{type:`button`,className:`text-left font-semibold text-primary hover:underline`,onClick:()=>c(e.id),children:y(e)}),e.description&&T(`p`,{className:`max-w-xs truncate text-xs text-muted-foreground`,children:e.description})]}),T(`td`,{className:_(cell,`font-mono text-xs text-muted-foreground`),children:b(`/mcp/${e.name}`)}),T(`td`,{className:cell,children:`HTTP`}),T(`td`,{className:_(cell,`text-xs`),children:n?`${n} key${n===1?``:`s`}`:`No keys`}),T(`td`,{className:_(cell,`text-right tabular-nums`),title:t?`${t.tools} tools · ${t.skills} skills · ${t.agents} agents`:void 0,children:r}),T(`td`,{className:cell,children:e.published_number?T(Badge,{tone:`good`,children:`Published`}):T(Badge,{tone:`plain`,children:`Draft`})}),T(`td`,{className:cell,children:E(`div`,{className:`flex justify-end`,children:[T(IconAction,{label:`Access keys of ${e.name}`,onClick:()=>l(e),children:T(a,{})}),s&&T(O,{item:e,tenantId:o,detail:`Callers of its endpoint get errors from now on; its keys stop working.`})]})})]},e.id)})})]})}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AssetDetail, AssetKind, TenantScope } from '@/shared/api/ai-assets';
|
|
2
|
+
/** The reasons an API call was refused, every one of them. */
|
|
3
|
+
export declare function Problems({ error }: {
|
|
4
|
+
error: Error | null;
|
|
5
|
+
}): import("react").JSX.Element | null;
|
|
6
|
+
/** A new asset needs its kind, a stable name and a display name; the designer opens next. */
|
|
7
|
+
export declare function NewAssetPanel({ kind, tenantId, onClose, }: {
|
|
8
|
+
kind: AssetKind;
|
|
9
|
+
tenantId: TenantScope;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
/** Every version: freeze the draft with a reason, publish a frozen one. */
|
|
13
|
+
export declare function VersionsPanel({ asset, tenantId, canPublish, }: {
|
|
14
|
+
asset: AssetDetail;
|
|
15
|
+
tenantId: TenantScope;
|
|
16
|
+
canPublish: boolean;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/** Run the draft (with saved changes) or a version, and see the output and what happened. */
|
|
19
|
+
export declare function TestPanel({ asset, tenantId }: {
|
|
20
|
+
asset: AssetDetail;
|
|
21
|
+
tenantId: TenantScope;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
/** What A2A callers started on this agent, newest change first. */
|
|
24
|
+
export declare function A2aTasksPanel({ asset, tenantId }: {
|
|
25
|
+
asset: AssetDetail;
|
|
26
|
+
tenantId: TenantScope;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useState as e}from"react";import{useNavigate as t}from"react-router-dom";import{Play as n,Rocket as r,X as i}from"lucide-react";import{ApiError as a}from"@/shared/api/http";import{Button as o}from"@/shared/components/ui/button";import{Input as s}from"@/shared/components/ui/input";import{Textarea as c}from"@/shared/components/ui/textarea";import{SidePanel as l}from"@/shared/components/workspace/SidePanel";import{PersonName as u}from"@/shared/components/workspace/PersonName";import{formatInstant as d}from"@/shared/lib/datetime";import{cn as f}from"@/shared/lib/utils";import{useA2aTasks as p,useAssetActions as m}from"../hooks/useAssets";import{kinds as h}from"../model/kinds";import{designerPath as g}from"../model/routes";import{argumentsFrom as _,argumentsOf as v,callerArguments as y,startingTexts as b}from"../model/tool-contract";import{Field as x,selectClass as S}from"./fields";import{ToolTestForm as C}from"./ToolTestForm";import{jsx as w,jsxs as T,Fragment as E}from"react/jsx-runtime";export function Problems({error:e}){if(!e)return null;let t=e instanceof a?e.details:[];return T(`div`,{role:`alert`,className:`rounded-lg border border-destructive/40 p-2.5 text-xs text-destructive`,children:[w(`p`,{className:`font-medium`,children:e.message}),t.length>0&&w(`ul`,{className:`mt-1 list-disc space-y-0.5 pl-4`,children:t.map(e=>w(`li`,{children:e},e))})]})}export function NewAssetPanel({kind:n,tenantId:r,onClose:a}){let u=t(),d=m(n,r),[f,p]=e(``),[_,v]=e(``),[y,b]=e(``),S=h[n];return w(l,{label:`New ${S.label.toLowerCase()}`,size:`md`,onClose:a,children:T(`form`,{className:`flex flex-1 flex-col`,onSubmit:e=>{e.preventDefault(),d.create.mutate({name:f.trim(),display_name:_.trim()||null,description:y},{onSuccess:e=>void u(g(n,e.data.id))})},children:[T(`header`,{className:`flex items-center justify-between border-b px-5 py-4`,children:[T(`h2`,{className:`text-base font-semibold`,children:[`New `,S.label.toLowerCase()]}),w(o,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:a,children:w(i,{})})]}),T(`div`,{className:`flex-1 space-y-4 p-5`,children:[w(`p`,{className:`text-xs text-muted-foreground`,children:S.description}),w(x,{label:`Display name`,children:w(s,{value:_,maxLength:120,placeholder:`Claims triage`,onChange:e=>{v(e.target.value),f&&f!==D(_)||p(D(e.target.value))}})}),w(x,{label:`Name`,hint:`The stable reference other assets, A2A and MCP use. Lower-case, digits, . _ -`,children:w(s,{required:!0,value:f,maxLength:63,pattern:`[a-z][a-z0-9_.-]{1,62}`,className:`font-mono text-xs`,onChange:e=>p(e.target.value)})}),w(x,{label:`Description`,children:w(c,{value:y,maxLength:2e3,onChange:e=>b(e.target.value)})}),w(Problems,{error:d.create.error})]}),T(`footer`,{className:`flex justify-end gap-2 border-t px-5 py-3`,children:[w(o,{type:`button`,variant:`outline`,onClick:a,children:`Cancel`}),w(o,{type:`submit`,disabled:!f||d.create.isPending,children:d.create.isPending?`Creating…`:`Create and design`})]})]})})}const D=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^[^a-z]+/,``).replace(/-+$/,``).slice(0,63);export function VersionsPanel({asset:t,tenantId:n,canPublish:i}){let a=m(t.kind,n),[c,l]=e(``);return T(`div`,{className:`space-y-3`,children:[T(`form`,{className:`flex flex-wrap items-end gap-2 rounded-xl border bg-card p-3`,onSubmit:e=>{e.preventDefault(),a.freeze.mutate({id:t.id,reason:c},{onSuccess:()=>l(``)})},children:[w(x,{label:`Freeze the saved draft as the next version`,className:`min-w-64 flex-1`,children:w(s,{required:!0,value:c,maxLength:500,placeholder:`Why this version (e.g. adds the CRM lookup)`,onChange:e=>l(e.target.value)})}),w(o,{type:`submit`,disabled:!c.trim()||a.freeze.isPending,children:`Freeze version`})]}),w(Problems,{error:a.freeze.error??a.publish.error}),T(`ol`,{className:`divide-y rounded-xl border bg-card`,"aria-label":`Versions`,children:[t.versions.length===0&&w(`li`,{className:`p-4 text-sm text-muted-foreground`,children:`No versions yet.`}),t.versions.map(e=>T(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-2.5 text-sm`,children:[T(`span`,{className:`font-semibold tabular-nums`,children:[`v`,e.number]}),w(`span`,{className:f(`rounded-badge px-2.5 py-1 text-xs font-semibold`,e.id===t.pinned_version_id?`bg-success/15 text-success`:e.status===`published`?`bg-muted text-muted-foreground`:`bg-warning/15 text-warning-foreground`),children:e.id===t.pinned_version_id?`live`:e.status}),w(`span`,{className:`min-w-0 flex-1 truncate`,children:e.reason}),T(`span`,{className:`text-xs text-muted-foreground`,children:[w(u,{subject:e.created_by}),` · `,d(e.created_at)]}),e.status===`draft`&&i&&T(o,{size:`sm`,disabled:a.publish.isPending,onClick:()=>a.publish.mutate({id:t.id,versionId:e.id}),children:[w(r,{}),` Publish`]})]},e.id))]})]})}const O={agent:`The request: text, or JSON following the input schema.`,skill:`The facts to apply the skill to (text or JSON).`,tool:`The arguments as JSON, e.g. {"a": 2, "b": 3}.`,mcp_client:`Empty lists the server's tools; {"tool": "name", "arguments": {...}} calls one.`,mcp_server:`Empty lists what it exposes; {"tool": "name", "arguments": {...}} calls one.`,remote_agent:`Empty reads the agent card; a message is sent to the agent.`};export function TestPanel({asset:t,tenantId:r}){let i=m(t.kind,r),[a,s]=e(``),[l,u]=e(null),d=t.kind===`tool`?y(v(t.spec.input_schema),t.spec.bindings):[],[f,p]=e(d.length>0),[h,g]=e(()=>b(d)),[D,k]=e({}),A=i.test.data,j=()=>{let e=a.trim();if(!e)return null;try{return JSON.parse(e)}catch{return e}};return T(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[T(`form`,{className:`space-y-3 rounded-xl border bg-card p-4`,onSubmit:e=>{if(e.preventDefault(),!f)return i.test.mutate({id:t.id,input:j(),version:l});let n=_(d,h);k(n.problems),Object.keys(n.problems).length===0&&i.test.mutate({id:t.id,input:n.values,version:l})},children:[w(x,{label:`Run`,children:T(`select`,{className:S,value:l??``,onChange:e=>u(e.target.value?Number(e.target.value):null),children:[w(`option`,{value:``,children:`The saved draft`}),t.versions.map(e=>T(`option`,{value:e.number,children:[`Version `,e.number,` (`,e.status,`)`]},e.id))]})}),d.length>0&&T(`div`,{className:`flex items-center justify-between`,children:[w(`span`,{className:`text-xs font-medium`,children:`Arguments`}),w(o,{type:`button`,variant:`ghost`,size:`xs`,"aria-pressed":!f,onClick:()=>{f&&s(JSON.stringify(_(d,h).values,null,2)),p(!f)},children:f?`Edit as JSON`:`Edit as fields`})]}),f?w(C,{rows:d,texts:h,problems:D,onChange:(e,t)=>{g({...h,[e]:t}),k({...D,[e]:``})}}):w(x,{label:`Input`,hint:O[t.kind],children:w(c,{value:a,rows:8,className:`font-mono text-xs`,onChange:e=>s(e.target.value)})}),T(o,{type:`submit`,disabled:i.test.isPending,children:[w(n,{}),` `,i.test.isPending?`Running…`:`Run test`]}),w(Problems,{error:i.test.error})]}),T(`section`,{className:`space-y-3 rounded-xl border bg-card p-4`,"aria-label":`Test result`,children:[T(`h2`,{className:`text-sm font-semibold`,children:[`Result`,A?` · ${A.duration_ms} ms`:``]}),A?T(E,{children:[w(`pre`,{className:`rounded-lg bg-muted/40 p-3 font-mono text-xs break-words whitespace-pre-wrap`,children:typeof A.output==`string`?A.output:JSON.stringify(A.output,null,2)}),w(`ol`,{className:`space-y-1 text-xs`,"aria-label":`Trace`,children:A.trace.map((e,t)=>T(`li`,{className:`rounded-md border px-2 py-1.5`,children:[w(`span`,{className:`font-semibold`,children:e.kind}),` · `,e.name,Object.keys(e.detail).length>0&&w(`code`,{className:`mt-0.5 block break-all text-muted-foreground`,children:JSON.stringify(e.detail)})]},t))})]}):w(`p`,{className:`text-sm text-muted-foreground`,children:`Run a test to see the output and trace.`})]})]})}export function A2aTasksPanel({asset:e,tenantId:t}){let n=p(e.id,t,!0);return T(`ol`,{className:`divide-y rounded-xl border bg-card text-sm`,"aria-label":`A2A tasks`,children:[n.isPending&&w(`li`,{className:`p-4 text-muted-foreground`,children:`Loading…`}),n.data?.length===0&&w(`li`,{className:`p-4 text-muted-foreground`,children:`No A2A caller has started a task yet.`}),n.data?.map(e=>T(`li`,{className:`flex flex-wrap items-center gap-3 px-4 py-2.5`,children:[w(`span`,{className:`rounded-badge bg-muted px-2.5 py-1 text-xs font-semibold`,children:e.state.replace(`TASK_STATE_`,``).toLowerCase()}),w(`span`,{className:`font-mono text-xs`,children:e.task_id.slice(0,8)}),T(`span`,{className:`text-xs text-muted-foreground`,children:[`context `,e.context_id.slice(0,8)]}),T(`span`,{className:`ml-auto text-xs text-muted-foreground`,children:[e.caller,` · started `,d(e.started_at),` · updated`,` `,d(e.updated_at)]})]},e.task_id))]})}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { GuardrailPolicyPage } from '../pages/GuardrailPolicyPage';
|
|
2
|
+
import { GuardrailsPage } from '../pages/GuardrailsPage';
|
|
3
|
+
import { LlmProviderPage } from '../pages/LlmProviderPage';
|
|
4
|
+
import { LlmProvidersPage } from '../pages/LlmProvidersPage';
|
|
5
|
+
import { McpClientPage } from '../pages/McpClientPage';
|
|
6
|
+
import { McpPage } from '../pages/McpPage';
|
|
7
|
+
import { McpServerPage } from '../pages/McpServerPage';
|
|
8
|
+
import { NewToolPage } from '../pages/NewToolPage';
|
|
9
|
+
export declare function AgentsRegistryPage(): import("react").JSX.Element;
|
|
10
|
+
export declare function SkillsRegistryPage(): import("react").JSX.Element;
|
|
11
|
+
export declare function ToolsRegistryPage(): import("react").JSX.Element;
|
|
12
|
+
/** MCP clients and servers have their own page: connect, test, sync, keys. */
|
|
13
|
+
export declare const McpRegistryPage: typeof McpPage;
|
|
14
|
+
/** Control Tower, LLM providers: the list and one provider's page. */
|
|
15
|
+
export declare const LlmProvidersRegistryPage: typeof LlmProvidersPage;
|
|
16
|
+
export declare const LlmProviderDesignerPage: typeof LlmProviderPage;
|
|
17
|
+
/** Control Tower, guardrails: the list (with on/off switches) and one guardrail's page. */
|
|
18
|
+
export declare const GuardrailsRegistryPage: typeof GuardrailsPage;
|
|
19
|
+
export declare const GuardrailPolicyDesignerPage: typeof GuardrailPolicyPage;
|
|
20
|
+
/** One designer route per kind (the kind comes from the route, not the record). */
|
|
21
|
+
export declare const AgentDesignerPage: () => import("react").JSX.Element;
|
|
22
|
+
export declare const RemoteAgentDesignerPage: () => import("react").JSX.Element;
|
|
23
|
+
export declare const SkillDesignerPage: () => import("react").JSX.Element;
|
|
24
|
+
export declare const ToolDesignerPage: () => import("react").JSX.Element;
|
|
25
|
+
/** A new tool is built step by step on its own page. */
|
|
26
|
+
export declare const NewToolDesignerPage: typeof NewToolPage;
|
|
27
|
+
/** MCP clients and servers: Details, Versions, then Synced data or Access keys; `new` creates. */
|
|
28
|
+
export declare const McpServerDesignerPage: typeof McpServerPage;
|
|
29
|
+
export declare const McpClientDesignerPage: typeof McpClientPage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bot as e,Sparkles as t,Wrench as n}from"lucide-react";import{AssetDesignerPage as r}from"../pages/AssetDesignerPage";import{AssetsPage as i}from"../pages/AssetsPage";import{GuardrailPolicyPage as a}from"../pages/GuardrailPolicyPage";import{GuardrailsPage as o}from"../pages/GuardrailsPage";import{LlmProviderPage as s}from"../pages/LlmProviderPage";import{LlmProvidersPage as c}from"../pages/LlmProvidersPage";import{McpClientPage as l}from"../pages/McpClientPage";import{McpPage as u}from"../pages/McpPage";import{McpServerPage as d}from"../pages/McpServerPage";import{NewToolPage as f}from"../pages/NewToolPage";import{jsx as p}from"react/jsx-runtime";export function AgentsRegistryPage(){return p(i,{title:`AI agents`,description:`Agents with their skills, tools and A2A partners.`,icon:e,tabs:[`agent`,`remote_agent`]})}export function SkillsRegistryPage(){return p(i,{title:`Skills`,description:`Reusable instructions and tools that agents apply to a task.`,icon:t,tabs:[`skill`]})}export function ToolsRegistryPage(){return p(i,{title:`Tools`,description:`REST calls, coded functions, scripts and synced MCP tools: the work agents call.`,icon:n,tabs:[`tool`]})}export const McpRegistryPage=u;export const LlmProvidersRegistryPage=c;export const LlmProviderDesignerPage=s;export const GuardrailsRegistryPage=o;export const GuardrailPolicyDesignerPage=a;export const AgentDesignerPage=()=>p(r,{kind:`agent`});export const RemoteAgentDesignerPage=()=>p(r,{kind:`remote_agent`});export const SkillDesignerPage=()=>p(r,{kind:`skill`});export const ToolDesignerPage=()=>p(r,{kind:`tool`});export const NewToolDesignerPage=f;export const McpServerDesignerPage=d;export const McpClientDesignerPage=l;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { AgentSpec, AssetKind, McpClientSpec, McpServerSpec, RemoteAgentSpec, SkillSpec, TenantScope } from '@/shared/api/ai-assets';
|
|
2
|
+
/** What every spec editor receives: the draft spec, a patcher and who the asset is. */
|
|
3
|
+
export type EditorProps<T> = {
|
|
4
|
+
spec: T;
|
|
5
|
+
set: (patch: Partial<T>) => void;
|
|
6
|
+
name: string;
|
|
7
|
+
tenantId: TenantScope;
|
|
8
|
+
runtimes: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
export declare function AssetSelect({ label, kind, value, onChange, tenantId, }: {
|
|
11
|
+
label: string;
|
|
12
|
+
kind: AssetKind;
|
|
13
|
+
value: string;
|
|
14
|
+
onChange: (name: string) => void;
|
|
15
|
+
tenantId: TenantScope;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
export declare function AgentEditor({ spec, set, name, tenantId, runtimes }: EditorProps<AgentSpec>): import("react").JSX.Element;
|
|
18
|
+
export declare function SkillEditor({ spec, set, tenantId }: EditorProps<SkillSpec>): import("react").JSX.Element;
|
|
19
|
+
export declare function McpClientEditor({ spec, set, tenantId }: EditorProps<McpClientSpec>): import("react").JSX.Element;
|
|
20
|
+
export declare function McpServerEditor({ spec, set, name, tenantId }: EditorProps<McpServerSpec>): import("react").JSX.Element;
|
|
21
|
+
export declare function RemoteAgentEditor({ spec, set, tenantId }: EditorProps<RemoteAgentSpec>): import("react").JSX.Element;
|
|
22
|
+
/** The LLM provider an agent or skill runs on; empty follows the tenant's default. */
|
|
23
|
+
export declare function LlmProviderField({ value, onChange, tenantId, }: {
|
|
24
|
+
value: string | null;
|
|
25
|
+
onChange: (value: string | null) => void;
|
|
26
|
+
tenantId: TenantScope;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useQuery as e}from"@tanstack/react-query";import{Link as t}from"react-router-dom";import{paths as n}from"@/app/paths";import{Plus as r,Trash2 as i}from"lucide-react";import{authProfiles as a}from"@/shared/api/integrations";import{llmProviders as o,llmProvidersKey as s}from"@/shared/api/llm-providers";import{Button as c}from"@/shared/components/ui/button";import{Input as l}from"@/shared/components/ui/input";import{useAssets as u}from"../hooks/useAssets";import{endpoint as d}from"../model/endpoints";import{assetTitle as f}from"../model/kinds";import{AreaField as p,AssetPicker as m,Field as h,JsonField as g,ListField as _,NumberField as v,Section as y,SelectField as b,TextField as x,Toggle as S,selectClass as C}from"./fields";import{jsxs as w,jsx as T,Fragment as E}from"react/jsx-runtime";export function AssetSelect({label:e,kind:t,value:n,onChange:r,tenantId:i}){let a=u(t,i,!0);return T(h,{label:e,children:w(`select`,{className:C,value:n,onChange:e=>r(e.target.value),children:[T(`option`,{value:``,children:`Choose…`}),(a.data??[]).map(e=>w(`option`,{value:e.name,children:[f(e),e.pinned_version_id?``:` (draft)`]},e.id))]})})}function D({value:r,onChange:i,tenantId:o}){let s=e({queryKey:[`integration-auth-profiles`,o??`own`],queryFn:({signal:e})=>a.list(o,e),retry:!1}),c=s.data?.find(e=>e.name===r);return T(h,{label:`Auth profile`,hint:c?.kind===`oauth2_authorization_code`&&!c.credentials?.signed_in?w(E,{children:[`Not connected yet:`,` `,T(t,{to:`${n.credentials}?item=${c.id}`,className:`text-primary underline`,children:`connect it in Integration Studio`}),`.`]}):`An Integration Studio credential (API key, bearer, OAuth sign-in…).`,children:w(`select`,{className:C,value:r??``,onChange:e=>i(e.target.value||null),children:[T(`option`,{value:``,children:`No authentication`}),(s.data??[]).map(e=>w(`option`,{value:e.name,children:[e.display_name??e.name,` · `,e.kind,e.kind===`oauth2_authorization_code`?e.credentials?.signed_in?` · connected`:` · not connected`:``]},e.id))]})})}export function AgentEditor({spec:e,set:t,name:n,tenantId:a,runtimes:o}){let s=e.limits??{max_tool_calls:8,max_tokens:2e3,timeout_s:60},u=e.a2a??{enabled:!1,skills:[],input_modes:[`text/plain`,`application/json`],output_modes:[`text/plain`,`application/json`],streaming:!1},f=u.skills??[],h=e=>t({a2a:{...u,...e}});return w(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[w(y,{title:`Engine`,children:[w(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T(b,{label:`Runtime`,value:e.runtime??`maf`,options:[`maf`,`langchain`].map(e=>({value:e,label:`${e===`maf`?`Microsoft Agent Framework`:`LangChain`}${o.includes(e)?``:` (not installed here)`}`})),onChange:e=>t({runtime:e}),hint:`The same definition runs on any runtime; others join as remote A2A agents.`}),T(LlmProviderField,{value:e.llm_provider??null,onChange:e=>t({llm_provider:e}),tenantId:a})]}),T(p,{label:`Instructions`,value:e.instructions??``,rows:10,onChange:e=>t({instructions:e}),placeholder:`What the agent does, how it decides, what it must never do.`})]}),w(y,{title:`Capabilities`,children:[T(m,{label:`Skills`,kind:`skill`,value:e.skills??[],onChange:e=>t({skills:e}),tenantId:a}),T(m,{label:`Tools`,kind:`tool`,value:e.tools??[],onChange:e=>t({tools:e}),tenantId:a}),T(m,{label:`MCP clients`,kind:`mcp_client`,value:e.mcp_clients??[],onChange:e=>t({mcp_clients:e}),tenantId:a,hint:`Every tool of these MCP servers (within their allowed list).`}),T(m,{label:`Remote agents (A2A)`,kind:`remote_agent`,value:e.remote_agents??[],onChange:e=>t({remote_agents:e}),tenantId:a,hint:`Each becomes a tool the agent may delegate to.`}),w(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[T(v,{label:`Max tool calls`,value:s.max_tool_calls??8,min:0,max:50,onChange:e=>t({limits:{...s,max_tool_calls:e}})}),T(v,{label:`Max tokens`,value:s.max_tokens??2e3,min:64,max:32e3,onChange:e=>t({limits:{...s,max_tokens:e}})}),T(v,{label:`Timeout (s)`,value:s.timeout_s??60,min:1,max:600,onChange:e=>t({limits:{...s,timeout_s:e}})})]})]}),w(y,{title:`Contract`,children:[T(g,{label:`Input schema (JSON Schema; empty = free text)`,value:e.input_schema??{},onChange:e=>t({input_schema:e}),rows:6}),T(g,{label:`Output schema (JSON Schema; empty = free text)`,value:e.output_schema??{},onChange:e=>t({output_schema:e}),rows:6})]}),w(y,{title:`A2A deployment`,children:[T(S,{label:`Serve this agent over A2A`,checked:u.enabled??!1,onChange:e=>h({enabled:e}),hint:`Once published, partners call it with a service principal holding agent.a2a.invoke.`}),w(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 rounded-lg border bg-muted/30 p-2.5 text-xs`,children:[T(`dt`,{className:`text-muted-foreground`,children:`Endpoint`}),T(`dd`,{className:`font-mono break-all`,children:d(`/a2a/agents/${n}`)}),T(`dt`,{className:`text-muted-foreground`,children:`Agent card`}),T(`dd`,{className:`font-mono break-all`,children:d(`/a2a/agents/${n}/.well-known/agent-card.json`)})]}),w(`div`,{className:`space-y-2`,children:[w(`div`,{className:`flex items-center justify-between`,children:[T(`span`,{className:`text-xs font-medium`,children:`Skills on the agent card`}),w(c,{variant:`outline`,size:`sm`,onClick:()=>h({skills:[...f,{id:`skill-${f.length+1}`,name:`New skill`,description:``}]}),children:[T(r,{}),` Add skill`]})]}),f.map((e,t)=>{let n=e=>h({skills:f.map((n,r)=>r===t?{...n,...e}:n)});return w(`div`,{className:`grid gap-2 rounded-lg border p-2.5 sm:grid-cols-[8rem_1fr_auto]`,children:[T(l,{"aria-label":`Skill id`,value:e.id,className:`font-mono text-xs`,onChange:e=>n({id:e.target.value})}),T(l,{"aria-label":`Skill name`,value:e.name,onChange:e=>n({name:e.target.value})}),T(c,{variant:`destructive`,size:`icon-sm`,"aria-label":`Remove ${e.name}`,onClick:()=>h({skills:f.filter((e,n)=>n!==t)}),children:T(i,{})}),T(l,{"aria-label":`Skill description`,className:`sm:col-span-3`,placeholder:`What callers can ask for`,value:e.description??``,onChange:e=>n({description:e.target.value})})]},t)})]}),w(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T(_,{label:`Input modes`,value:u.input_modes??[],onChange:e=>h({input_modes:e})}),T(_,{label:`Output modes`,value:u.output_modes??[],onChange:e=>h({output_modes:e})})]}),T(S,{label:`Streaming`,checked:u.streaming??!1,onChange:e=>h({streaming:e})})]})]})}function O({label:e,value:t,onChange:n}){return T(h,{label:e,children:w(`div`,{className:`space-y-1.5`,children:[t.map((e,r)=>{let a=e=>n(t.map((t,n)=>n===r?{...t,...e}:t));return w(`div`,{className:`grid grid-cols-[1fr_7rem_auto] gap-1.5`,children:[T(l,{"aria-label":`Variable name`,value:e.name,className:`font-mono text-xs`,onChange:e=>a({name:e.target.value})}),T(`select`,{"aria-label":`Variable type`,className:C,value:e.type??`string`,onChange:e=>a({type:e.target.value}),children:[`string`,`number`,`boolean`,`object`,`array`].map(e=>T(`option`,{children:e},e))}),T(c,{variant:`destructive`,size:`icon-sm`,"aria-label":`Remove ${e.name}`,onClick:()=>n(t.filter((e,t)=>t!==r)),children:T(i,{})})]},r)}),w(c,{variant:`outline`,size:`sm`,onClick:()=>n([...t,{name:`field_${t.length+1}`,type:`string`,description:``,required:!0}]),children:[T(r,{}),` Add`]})]})})}export function SkillEditor({spec:e,set:t,tenantId:n}){return w(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[w(y,{title:`Instructions`,children:[T(LlmProviderField,{value:e.llm_provider??null,onChange:e=>t({llm_provider:e}),tenantId:n}),T(p,{label:`Instructions`,value:e.instructions??``,rows:12,onChange:e=>t({instructions:e})}),T(m,{label:`Tools`,kind:`tool`,value:e.tools??[],onChange:e=>t({tools:e}),tenantId:n})]}),w(y,{title:`Variables`,children:[T(O,{label:`Inputs`,value:e.input_variables??[],onChange:e=>t({input_variables:e})}),T(O,{label:`Outputs`,value:e.output_variables??[],onChange:e=>t({output_variables:e})})]})]})}export function McpClientEditor({spec:e,set:t,tenantId:n}){return w(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[w(y,{title:`Connection`,children:[w(`div`,{className:`grid gap-3 sm:grid-cols-[10rem_1fr]`,children:[T(b,{label:`Transport`,value:e.transport??`streamable_http`,options:[{value:`streamable_http`,label:`Streamable HTTP`},{value:`websocket`,label:`WebSocket`}],onChange:e=>t({transport:e})}),T(x,{label:`Server URL`,value:e.url??``,mono:!0,onChange:e=>t({url:e}),placeholder:`https://mcp.example.com/mcp`})]}),T(D,{value:e.auth_profile,onChange:e=>t({auth_profile:e}),tenantId:n}),T(g,{label:`Headers (non-secret)`,value:e.headers??{},onChange:e=>t({headers:e}),rows:3})]}),w(y,{title:`Use`,children:[T(_,{label:`Allowed tools (empty = all)`,value:e.allowed_tools??[],onChange:e=>t({allowed_tools:e}),placeholder:`search_claims
|
|
2
|
+
get_policy`}),w(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[T(b,{label:`Approval`,value:e.approval??`never`,options:[{value:`never`,label:`Never ask`},{value:`always`,label:`Ask a person every call`}],onChange:e=>t({approval:e})}),T(v,{label:`Timeout (s)`,value:e.timeout_s??30,min:1,max:300,onChange:e=>t({timeout_s:e})})]})]})]})}export function McpServerEditor({spec:e,set:t,name:n,tenantId:r}){return w(`div`,{className:`grid gap-3 xl:grid-cols-2`,children:[w(y,{title:`Exposes`,children:[T(m,{label:`Tools`,kind:`tool`,value:e.tools??[],onChange:e=>t({tools:e}),tenantId:r}),T(m,{label:`Skills (each becomes a tool; its input variables are the arguments)`,kind:`skill`,value:e.skills??[],onChange:e=>t({skills:e}),tenantId:r}),T(m,{label:"Agents (each becomes a tool taking `input`)",kind:`agent`,value:e.agents??[],onChange:e=>t({agents:e}),tenantId:r}),T(p,{label:`Server instructions`,value:e.instructions??``,rows:4,max:4e3,onChange:e=>t({instructions:e}),hint:`Sent to MCP clients when they connect.`})]}),T(y,{title:`Endpoint`,children:w(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[T(`dt`,{className:`text-muted-foreground`,children:`URL`}),T(`dd`,{className:`font-mono break-all`,children:d(`/mcp/${n}`)}),T(`dt`,{className:`text-muted-foreground`,children:`Transport`}),T(`dd`,{children:`Streamable HTTP (stateless JSON)`}),T(`dt`,{className:`text-muted-foreground`,children:`Callers`}),T(`dd`,{children:`Access keys of this server (Access keys tab), or accounts holding mcp.invoke`})]})})]})}export function RemoteAgentEditor({spec:e,set:t,tenantId:n}){return w(y,{title:`Connection`,children:[T(x,{label:`Agent card URL`,value:e.card_url??``,mono:!0,onChange:e=>t({card_url:e}),placeholder:`https://partner.example.com/.well-known/agent-card.json`}),w(`div`,{className:`grid gap-3 sm:grid-cols-3`,children:[T(D,{value:e.auth_profile,onChange:e=>t({auth_profile:e}),tenantId:n}),T(b,{label:`Protocol binding`,value:e.binding??`JSONRPC`,options:[{value:`JSONRPC`,label:`JSON-RPC`},{value:`HTTP+JSON`,label:`HTTP + JSON`}],onChange:e=>t({binding:e})}),T(v,{label:`Timeout (s)`,value:e.timeout_s??60,min:1,max:600,onChange:e=>t({timeout_s:e})})]})]})}export function LlmProviderField({value:r,onChange:i,tenantId:a}){let c=e({queryKey:s(a),queryFn:({signal:e})=>o.list(a,e),retry:!1}),l=c.data??[],u=l.find(e=>e.is_default),d=r!==null&&c.isSuccess&&!l.some(e=>e.id===r);return T(h,{label:`LLM provider`,hint:d?T(`span`,{className:`text-destructive`,children:`The chosen provider no longer exists.`}):w(E,{children:[`Change models in`,` `,T(t,{to:`${n.controlTower}?tab=llms`,className:`text-primary hover:underline`,children:`Control Tower`}),`; agents follow without a new version.`]}),children:w(`select`,{"aria-label":`LLM provider`,className:C,value:r??``,onChange:e=>i(e.target.value||null),children:[w(`option`,{value:``,children:[`Default`,u?` (${u.name})`:` (platform model)`]}),l.map(e=>w(`option`,{value:e.id,disabled:!e.is_enabled,children:[e.name,` · `,e.model_id,e.is_enabled?``:` (disabled)`]},e.id)),d&&T(`option`,{value:r,children:`Missing provider`})]})})}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type TenantScope, type ToolSpec } from '@/shared/api/ai-assets';
|
|
2
|
+
type ToolPartProps = {
|
|
3
|
+
spec: ToolSpec;
|
|
4
|
+
set: (patch: Partial<ToolSpec>) => void;
|
|
5
|
+
};
|
|
6
|
+
/** Where the tool's work happens. New tools pick a category (REST call, coded, script,
|
|
7
|
+
* database); a synced MCP tool and an older agent or prompt tool show what they call. */
|
|
8
|
+
export declare function ToolSource({ spec, set, tenantId }: ToolPartProps & {
|
|
9
|
+
tenantId: TenantScope;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
/** The arguments the tool takes (and which it sets itself) and the result it promises.
|
|
12
|
+
* Schemas are edited as rows; JSON stays one click away. */
|
|
13
|
+
export declare function ToolInputsOutputs({ spec, set }: ToolPartProps): import("react").JSX.Element;
|
|
14
|
+
/** How the tool behaves when called: timeout, approval and tags. */
|
|
15
|
+
export declare function ToolSettings({ spec, set }: ToolPartProps): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{DataTable as e}from"@/shared/components/workspace/DataTable";import{useRef as t,useState as n}from"react";import{useQuery as r}from"@tanstack/react-query";import{Braces as i,Cable as a,Database as o,FunctionSquare as s,Plus as c,Trash2 as l}from"lucide-react";import{getToolFunctions as u,testAsset as d}from"@/shared/api/ai-assets";import{dbQueries as f,getActions as p}from"@/shared/api/integrations";import{Button as m}from"@/shared/components/ui/button";import{Input as h}from"@/shared/components/ui/input";import{Textarea as g}from"@/shared/components/ui/textarea";import{cn as _}from"@/shared/lib/utils";import{useAssets as v}from"../hooks/useAssets";import{ARGUMENT_TYPES as y,EXECUTOR_DEFAULTS as b,CATEGORIES as x,NAME_PATTERN as S,argumentsOf as C,isSynced as w,isWrapper as T,asText as E,callerArguments as ee,nextName as D,parseValue as O,placeholders as k,schemaOf as A}from"../model/tool-contract";import{Field as j,JsonField as M,ListField as N,NumberField as P,Section as F,TextField as I,Toggle as L,selectClass as R}from"./fields";import{AssetSelect as z,LlmProviderField as te}from"./SpecEditors";import{jsx as B,jsxs as V,Fragment as H}from"react/jsx-runtime";const U={rest:a,coded:s,script:i,database:o},W={string:`''`,number:`0`,integer:`0`,boolean:`false`,object:`{}`,array:`[]`,any:`''`},G=e=>e.executor??b.action;export function ToolSource({spec:e,set:t,tenantId:n}){let r=G(e);return V(F,{title:`Source`,children:[w(r.type)?B(K,{children:`Synced from an MCP server and read-only here: the next sync of its MCP client replaces it.`}):T(r.type)?V(K,{children:[`This tool wraps `,r.type===`agent`?`an agent`:`a prompt`,`. It keeps running, but a tool should do the work itself: agents, skills and flows orchestrate tools.`]}):B(q,{value:r.type,onChange:e=>t({executor:b[e]})}),B(J,{executor:r,inputs:C(e.input_schema),spec:e,set:t,tenantId:n})]})}export function ToolInputsOutputs({spec:e,set:t}){let n=e.bindings??{},r=w(G(e).type),i=C(e.input_schema);return V(`div`,{className:`space-y-3`,children:[V(F,{title:`Inputs`,children:[B(Q,{kind:`argument`,rows:i,schema:e.input_schema??{},locked:r,bindings:n,onRows:(r,i=n)=>t({input_schema:A(r,e.input_schema),bindings:i}),onSchema:e=>t({input_schema:e})}),B(se,{rows:i,bindings:n})]}),V(F,{title:`Outputs`,children:[B(Q,{kind:`field`,rows:C(e.output_schema),schema:e.output_schema??{},locked:r,onRows:n=>t({output_schema:A(n,e.output_schema)}),onSchema:e=>t({output_schema:e})}),B(I,{label:`Shape the result (CEL, optional)`,value:e.output_expression??``,mono:!0,max:4e3,onChange:e=>t({output_expression:e}),placeholder:`{'number': result.result.number, 'link': result.result.link}`,hint:V(H,{children:[`Over `,B(`code`,{children:`result`}),` (what the source returned) and `,B(`code`,{children:`input`}),`. Empty returns the result as it is. A result that breaks the fields above fails the call.`]})})]})]})}export function ToolSettings({spec:e,set:t}){return V(F,{title:`Settings`,children:[V(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[B(P,{label:`Timeout (ms)`,value:e.timeout_ms??3e4,min:100,max:6e5,onChange:e=>t({timeout_ms:e})}),B(L,{label:`Needs a person's approval`,checked:e.requires_approval??!1,onChange:e=>t({requires_approval:e}),hint:`Agents pause and ask before every call.`})]}),B(N,{label:`Tags`,value:e.tags??[],onChange:e=>t({tags:e}),placeholder:`claims
|
|
2
|
+
read-only`,hint:`One per line; the tools list shows and searches them.`})]})}function K({children:e}){return B(`p`,{className:`rounded-lg border border-primary/30 bg-primary/5 px-3 py-2 text-xs`,children:e})}function q({value:e,onChange:t}){return V(`fieldset`,{className:`grid gap-1.5 sm:grid-cols-2 xl:grid-cols-4`,children:[B(`legend`,{className:`sr-only`,children:`Category`}),x.map(n=>{let r=U[n.key]??i,a=n.types.includes(e);return V(`label`,{className:_(`flex cursor-pointer items-start gap-2 rounded-lg border px-2.5 py-2 transition-colors has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring`,a?`border-primary bg-primary/5`:`hover:bg-muted/50`),children:[B(`input`,{type:`radio`,name:`tool-source`,className:`sr-only`,checked:a,onChange:()=>t(n.types[0])}),B(r,{className:_(`mt-0.5 size-4 shrink-0`,a?`text-primary`:`text-muted-foreground`),"aria-hidden":`true`}),V(`span`,{className:`min-w-0`,children:[B(`span`,{className:`block text-sm font-medium`,children:n.label}),B(`span`,{className:`block text-xs text-muted-foreground`,children:n.detail})]})]},n.key)})]})}function J({executor:e,inputs:t,spec:n,set:r,tenantId:i}){let a=t=>r({executor:{...e,...t}}),o=(e,t)=>{let i=new Set(C(t).map(e=>e.name)),a=Object.fromEntries(Object.entries(n.bindings??{}).filter(([e])=>i.has(e)));r({...e,input_schema:t,bindings:a})};switch(e.type){case`mcp`:return B(Z,{client:e.client,tool:e.tool,tenantId:i,onClient:e=>a({client:e,tool:``}),onTool:(t,n)=>n?o({executor:{...e,tool:t}},n):a({tool:t})});case`action`:return B(ne,{action:e.action,tenantId:i,onChange:e=>a({action:e})});case`agent`:return V(H,{children:[B(L,{label:`A remote A2A agent`,checked:e.remote??!1,onChange:e=>a({remote:e,agent:``})}),B(z,{label:e.remote?`Remote agent`:`Agent`,kind:e.remote?`remote_agent`:`agent`,value:e.agent,onChange:e=>a({agent:e}),tenantId:i}),V(`p`,{className:`text-xs text-muted-foreground`,children:[`The agent gets the `,B(`code`,{children:`input`}),` argument, or all the arguments as JSON.`]})]});case`platform`:return B(re,{value:e.function,onChange:(t,n)=>o({executor:{...e,function:t}},n)});case`query`:return B(X,{value:e.query,tenantId:i,onChange:(t,n)=>o({executor:{...e,query:t}},n)});case`script`:return V(H,{children:[B(Y,{value:`script`,onChange:e=>r({executor:b[e]})}),B(j,{label:`Python`,hint:V(H,{children:[`Define `,B(`code`,{children:`def run(inputs)`}),` and return the outputs. It runs in a sandbox with no network and no secrets; `,B(`code`,{children:`print()`}),` shows in the test trace.`]}),children:B(g,{"aria-label":`Python code`,value:e.code,rows:14,maxLength:2e4,spellCheck:!1,className:`font-mono text-xs`,onChange:e=>a({code:e.target.value})})})]});case`prompt`:return B(ie,{instructions:e.instructions,provider:e.llm_provider??null,inputs:t,tenantId:i,onChange:a});default:return V(H,{children:[B(Y,{value:`expression`,onChange:e=>r({executor:b[e]})}),B(I,{label:`Expression (CEL)`,value:e.expression,mono:!0,max:4e3,onChange:e=>a({expression:e}),placeholder:`input.amount * 1.2`,hint:V(H,{children:[`Over `,B(`code`,{children:`input`}),`, the arguments: `,B(`code`,{children:`input.amount`}),`. No side effects.`]})})]})}}function Y({value:e,onChange:t}){return B(j,{label:`Language`,children:V(`select`,{"aria-label":`Language`,className:R,value:e,onChange:e=>t(e.target.value),children:[B(`option`,{value:`script`,children:`Python`}),B(`option`,{value:`expression`,children:`CEL expression`})]})})}function X({value:e,tenantId:t,onChange:n}){let i=r({queryKey:[`integration-queries`,t??`own`,`published`],queryFn:({signal:e})=>f.list({status:`published`},t,e),retry:!1}),a=i.data??[],o=a.find(t=>t.name===e);return B(j,{label:`Published query`,hint:o?`${o.side_effect===`write`?`Write`:`Read`} · ${o.parameter_names.length} parameter(s) · returns {rows, count}.`:`Publish a query under Integration · Databases first.`,children:V(`select`,{"aria-label":`Published query`,className:R,value:e,onChange:e=>{let t=a.find(t=>t.name===e.target.value);t&&n(t.name,t.parameters)},children:[B(`option`,{value:``,children:i.isPending?`Loading…`:`Choose…`}),e&&!o&&V(`option`,{value:e,children:[e,` (not published)`]}),a.map(e=>B(`option`,{value:e.name,children:e.name},e.id))]})})}function Z({client:e,tool:t,tenantId:n,onClient:i,onTool:a}){let o=v(`mcp_client`,n,!0).data?.find(t=>t.name===e),s=r({queryKey:[`ai-assets`,n??`own`,`mcp-server-tools`,o?.id],queryFn:()=>d(`mcp_client`,o.id,{},null,n),enabled:!!o,staleTime:3e5,retry:!1}),c=s.data?.output,l=c&&typeof c==`object`&&`tools`in c&&Array.isArray(c.tools)?c.tools:[],u=l.find(e=>e.name===t);return V(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[B(z,{label:`MCP client`,kind:`mcp_client`,value:e,onChange:i,tenantId:n}),l.length>0?B(j,{label:`Server tool`,hint:u?.description??`Choosing a tool takes its arguments.`,children:V(`select`,{"aria-label":`Server tool`,className:R,value:t,onChange:e=>{let t=l.find(t=>t.name===e.target.value);a(e.target.value,t?.input_schema??{})},children:[B(`option`,{value:``,children:`Choose…`}),t&&!u&&V(`option`,{value:t,children:[t,` (not listed now)`]}),l.map(e=>B(`option`,{value:e.name,children:e.name},e.name))]})}):B(I,{label:`Server tool`,value:t,mono:!0,onChange:e=>a(e),hint:o?s.isPending?`Asking the server for its tools…`:s.error?`The server could not be asked (${s.error.message}); type the name.`:`The tool name, as the server lists it.`:`Choose a client first.`})]})}function ne({action:e,tenantId:t,onChange:n}){let i=r({queryKey:[`integration-actions`,t??`own`,`published`],queryFn:({signal:e})=>p({status:`published`},t,e),retry:!1}),a=i.data??[],o=a.find(t=>t.name===e);return i.error||i.isSuccess&&a.length===0?B(I,{label:`Published action`,value:e,mono:!0,onChange:n,placeholder:`crm.case.create`,hint:`Runs its published version with the tool's arguments as input.`}):B(j,{label:`Published action`,hint:o?`${o.method} ${o.url_template} · the tool's arguments are its input.`:`Runs its published version with the tool's arguments as input.`,children:V(`select`,{"aria-label":`Published action`,className:R,value:e,onChange:e=>n(e.target.value),children:[B(`option`,{value:``,children:i.isPending?`Loading…`:`Choose…`}),e&&!o&&V(`option`,{value:e,children:[e,` (not published)`]}),a.map(e=>V(`option`,{value:e.name,children:[e.name,` · `,e.method]},e.id))]})})}function re({value:e,onChange:t}){let n=r({queryKey:[`ai-assets`,`tool-functions`],queryFn:({signal:e})=>u(e),staleTime:18e5,retry:!1}),i=n.data?.find(t=>t.name===e);return B(j,{label:`Function`,hint:i?`${i.description} Choosing one takes its arguments.`:void 0,children:V(`select`,{"aria-label":`Function`,className:R,value:e,onChange:e=>{let r=n.data?.find(t=>t.name===e.target.value);r&&t(r.name,r.input_schema)},children:[!i&&B(`option`,{value:e,children:e}),(n.data??[]).map(e=>B(`option`,{value:e.name,children:e.name},e.name))]})})}function ie({instructions:e,provider:n,inputs:r,tenantId:i,onChange:a}){let o=t(null),s=k(e),c=new Set(r.map(e=>e.name)),l=s.filter(e=>!c.has(e)),u=t=>{let n=o.current,r=`{{${t}}}`,i=n?.selectionStart??e.length,s=n?.selectionEnd??i;a({instructions:e.slice(0,i)+r+e.slice(s)}),requestAnimationFrame(()=>{n?.focus(),n?.setSelectionRange(i+r.length,i+r.length)})};return V(H,{children:[B(te,{value:n,onChange:e=>a({llm_provider:e}),tenantId:i}),B(j,{label:`Prompt`,hint:l.length>0?V(`span`,{className:`text-destructive`,children:[`Not an argument: `,l.map(e=>`{{${e}}}`).join(`, `)]}):`The arguments are also sent as data. With output fields, the model answers in JSON.`,children:B(g,{ref:o,value:e,rows:9,maxLength:16e3,className:`font-mono text-xs`,placeholder:`Classify the email into one of: order, question, complaint.
|
|
3
|
+
Subject: {{subject}}`,onChange:e=>a({instructions:e.target.value})})}),r.length>0&&V(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs`,children:[B(`span`,{className:`text-muted-foreground`,children:`Insert:`}),r.map(e=>B(`button`,{type:`button`,onClick:()=>u(e.name),className:_(`rounded border px-1.5 py-px font-mono hover:bg-muted`,s.includes(e.name)&&`border-primary/50 text-primary`),children:`{{${e.name}}}`},e.name))]})]})}function Q({kind:t,rows:r,schema:a,locked:o=!1,bindings:s,onRows:u,onSchema:d}){let[f,p]=n(!1),g=s!==void 0,v=t===`argument`?`Arguments`:`Output fields`,b=(e,t)=>u(r.map((n,r)=>r===e?{...n,...t}:n),s),x=(e,t)=>{let n=r[e].name,i={...s};g&&i[n]&&(i[t]=i[n],delete i[n]),u(r.map((n,r)=>r===e?{...n,name:t}:n),g?i:void 0)},S=e=>{let t={...s};delete t[r[e].name],u(r.filter((t,n)=>n!==e),g?t:void 0)},C=(e,t)=>{let n={...s};t?n[e]=t:delete n[e],u(r,n)};return V(`div`,{className:`space-y-2`,children:[V(`div`,{className:`flex items-center justify-between gap-2`,children:[V(`span`,{className:`text-xs font-medium`,children:[v,` (`,r.length,`)`]}),V(`div`,{className:`flex gap-1.5`,children:[!o&&!f&&V(m,{variant:`outline`,size:`xs`,onClick:()=>u([...r,{name:D(r,t),type:`string`,required:t===`argument`,description:``,options:[],extra:{}}],s),children:[B(c,{}),` Add `,t]}),!o&&V(m,{variant:`ghost`,size:`xs`,"aria-pressed":f,onClick:()=>p(!f),children:[B(i,{}),` `,f?`Edit as rows`:`Edit as JSON`]})]})]}),f?B(M,{label:`${v} (JSON Schema)`,value:a,rows:10,onChange:d,hint:`Any JSON Schema keyword is kept when you go back to rows.`}):B(`div`,{className:`overflow-x-auto rounded-lg border`,children:V(e,{empty:t===`argument`?`No arguments: callers may send any JSON object.`:`No output fields: the result is returned as it is, unchecked.`,className:`w-full min-w-[46rem] text-xs`,"aria-label":v,children:[B(`thead`,{className:`bg-muted/40 text-left text-muted-foreground`,children:V(`tr`,{children:[B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Name`}),B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Type`}),B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Required`}),B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Description`}),g&&B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Default`}),g&&B(`th`,{className:`px-2 py-1.5 font-medium`,children:`Value from`}),B(`th`,{className:`w-8`,children:B(`span`,{className:`sr-only`,children:`Remove`})})]})}),B(`tbody`,{className:`divide-y`,children:r.map((e,n)=>V(`tr`,{className:`align-top`,children:[B(`td`,{className:`w-40 px-2 py-1.5`,"data-grid-value":e.name,children:B(ae,{value:e.name,taken:r.filter((e,t)=>t!==n).map(e=>e.name),disabled:o,onChange:e=>x(n,e)})}),B(`td`,{className:`w-28 px-2 py-1.5`,"data-grid-value":e.type,children:B(`select`,{"aria-label":`${e.name} type`,className:_(R,`h-7 text-xs`),value:e.type,disabled:o,onChange:e=>b(n,{type:e.target.value}),children:[...y,`any`].map(e=>B(`option`,{children:e},e))})}),B(`td`,{className:`w-16 px-2 py-1.5 text-center`,"data-grid-value":e.required?`Required`:`Optional`,children:B(`input`,{type:`checkbox`,"aria-label":`${e.name} required`,className:`mt-1.5`,checked:e.required,disabled:o,onChange:e=>b(n,{required:e.target.checked})})}),V(`td`,{className:`px-2 py-1.5`,"data-grid-value":[e.description,...e.options].join(` `),children:[B(h,{"aria-label":`${e.name} description`,value:e.description,maxLength:1e3,disabled:o,className:`h-7 text-xs`,placeholder:t===`argument`?`What the model should pass`:``,onChange:e=>b(n,{description:e.target.value})}),e.options.length>0&&V(`span`,{className:`mt-0.5 block text-[11px] text-muted-foreground`,children:[`One of: `,e.options.join(`, `)]})]}),g&&B(`td`,{className:`w-32 px-2 py-1.5`,children:B($,{label:`${e.name} default`,type:e.type,value:e.default,disabled:o,onChange:e=>b(n,{default:e})},e.type)}),g&&B(`td`,{className:`w-64 px-2 py-1.5`,children:B(oe,{row:e,binding:s?.[e.name],onChange:t=>C(e.name,t)})}),B(`td`,{className:`px-1 py-1.5`,children:!o&&B(m,{variant:`destructive`,size:`icon-sm`,"aria-label":`Remove ${e.name}`,onClick:()=>S(n),children:B(l,{})})})]},n))})]})})]})}function ae({value:e,taken:t,disabled:r,onChange:i}){let[a,o]=n(e),[s,c]=n(e);e!==s&&(c(e),e!==a&&o(e));let l=S.test(a)?t.includes(a)?`Already used`:``:`Letters, digits and _`;return V(`span`,{className:`grid gap-0.5`,children:[B(h,{"aria-label":`Name`,value:a,disabled:r,"aria-invalid":!!l,className:`h-7 font-mono text-xs`,onChange:e=>{o(e.target.value);let n=e.target.value;S.test(n)&&!t.includes(n)&&i(n)}}),l&&B(`span`,{className:`text-[11px] text-destructive`,children:l})]})}function $({label:e,type:t,value:r,disabled:i,placeholder:a,onChange:o}){let[s,c]=n(()=>E(r)),[l,u]=n(``),[d,f]=n(r);return r!==d&&(f(r),JSON.stringify(O(t,s).value)!==JSON.stringify(r)&&(c(E(r)),u(``))),V(`span`,{className:`grid gap-0.5`,children:[B(h,{"aria-label":e,value:s,disabled:i,placeholder:a??(t===`boolean`?`true / false`:`—`),"aria-invalid":!!l,className:`h-7 font-mono text-xs`,onChange:e=>{c(e.target.value);let n=O(t,e.target.value);u(n.problem??``),n.problem||o(n.value)}}),l&&B(`span`,{className:`text-[11px] text-destructive`,children:l})]})}function oe({row:e,binding:t,onChange:n}){let r=t?.source??`caller`;return V(`span`,{className:`grid gap-1`,children:[V(`select`,{"aria-label":`${e.name} value from`,className:_(R,`h-7 text-xs`),value:r,onChange:t=>{let r=t.target.value;n(r===`fixed`?{source:`fixed`,value:e.default??null}:r===`expression`?{source:`expression`,expression:W[e.type]}:null)},children:[B(`option`,{value:`caller`,children:`The caller (agent, flow)`}),B(`option`,{value:`fixed`,children:`A fixed value`}),B(`option`,{value:`expression`,children:`An expression`})]}),t?.source===`fixed`&&B($,{label:`${e.name} fixed value`,type:e.type,value:t.value,placeholder:`Value`,onChange:e=>n({source:`fixed`,value:e??null})},`fixed:${e.type}`),t?.source===`expression`&&B(h,{"aria-label":`${e.name} expression`,value:t.expression,maxLength:4e3,className:`h-7 font-mono text-xs`,placeholder:`input.claim_id`,onChange:e=>n({source:`expression`,expression:e.target.value})})]})}function se({rows:e,bindings:t}){if(e.length===0)return null;let n=ee(e,t),r=e.filter(e=>t[e.name]);return V(`p`,{className:`text-xs text-muted-foreground`,children:[`Callers give:`,` `,B(`span`,{className:`font-mono text-foreground`,children:n.length?n.map(e=>e.name).join(`, `):`nothing`}),r.length>0&&V(H,{children:[` `,`· the tool sets (hidden from callers):`,` `,B(`span`,{className:`font-mono text-foreground`,children:r.map(e=>e.name).join(`, `)})]})]})}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Argument } from '../model/tool-contract';
|
|
2
|
+
/** One field per argument a caller gives, typed by the tool's input schema. */
|
|
3
|
+
export declare function ToolTestForm({ rows, texts, problems, onChange, }: {
|
|
4
|
+
rows: readonly Argument[];
|
|
5
|
+
texts: Record<string, string>;
|
|
6
|
+
problems: Record<string, string>;
|
|
7
|
+
onChange: (name: string, text: string) => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Input as e}from"@/shared/components/ui/input";import{Textarea as t}from"@/shared/components/ui/textarea";import{selectClass as n}from"./fields";import{jsx as r,jsxs as i}from"react/jsx-runtime";export function ToolTestForm({rows:a,texts:o,problems:s,onChange:c}){return r(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:a.map(a=>{let l=o[a.name]??``,u=s[a.name],d=`${a.name}${a.required?` *`:``}`,f=a.type===`object`||a.type===`array`||a.type===`any`;return i(`label`,{className:f?`grid gap-1 text-xs sm:col-span-2`:`grid gap-1 text-xs`,children:[i(`span`,{className:`flex items-center gap-1.5 font-medium`,children:[r(`span`,{className:`font-mono`,children:d}),r(`span`,{className:`rounded border px-1 text-[11px] font-normal text-muted-foreground`,children:a.type})]}),a.options.length>0?i(`select`,{className:n,value:l,onChange:e=>c(a.name,e.target.value),children:[r(`option`,{value:``,children:`—`}),a.options.map(e=>r(`option`,{children:e},e))]}):a.type===`boolean`?i(`select`,{className:n,value:l,onChange:e=>c(a.name,e.target.value),children:[r(`option`,{value:``,children:`—`}),r(`option`,{children:`true`}),r(`option`,{children:`false`})]}):f?r(t,{value:l,rows:3,className:`font-mono text-xs`,placeholder:a.type===`array`?`["a", "b"]`:`{"key": "value"}`,onChange:e=>c(a.name,e.target.value)}):r(e,{value:l,inputMode:a.type===`string`?void 0:`decimal`,className:`h-8 text-xs`,onChange:e=>c(a.name,e.target.value)}),u?r(`span`,{className:`text-destructive`,children:u}):a.description&&r(`span`,{className:`font-normal text-muted-foreground`,children:a.description})]},a.name)})})}
|