@kelpie/ui 0.24.0 → 0.25.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/package.json +4 -4
- package/dist/components/PersonIntakeDialog.d.ts +0 -19
- package/dist/components/PersonIntakeDialog.d.ts.map +0 -1
- package/dist/components/PersonIntakeDialog.js +0 -87
- package/dist/components/PersonIntakeDialog.js.map +0 -1
- package/dist/pages/admin/McpPage.d.ts +0 -2
- package/dist/pages/admin/McpPage.d.ts.map +0 -1
- package/dist/pages/admin/McpPage.js +0 -123
- package/dist/pages/admin/McpPage.js.map +0 -1
- package/dist/pages/admin/McpPanel.d.ts +0 -3
- package/dist/pages/admin/McpPanel.d.ts.map +0 -1
- package/dist/pages/admin/McpPanel.js +0 -123
- package/dist/pages/admin/McpPanel.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kelpie/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "React UI for Kelpie: components, pages, API client, and the extension registry an assembly composes modules through.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"kelpie",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"bugs": "https://github.com/velvet-tiger/kelpie/issues",
|
|
20
20
|
"type": "module",
|
|
21
21
|
"engines": {
|
|
22
|
-
"node": ">=24.22.
|
|
22
|
+
"node": ">=24.22.3"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@dnd-kit/core": "^6.3.1",
|
|
49
49
|
"@dnd-kit/sortable": "^10.0.0",
|
|
50
50
|
"@dnd-kit/utilities": "^3.2.2",
|
|
51
|
-
"@kelpie/schemas": "^0.
|
|
51
|
+
"@kelpie/schemas": "^0.25.1",
|
|
52
52
|
"@tanstack/react-query": "^5.101.4",
|
|
53
53
|
"react-markdown": "^10.1.0",
|
|
54
54
|
"react-router": "^8.3.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"react": "^19.2.8",
|
|
69
69
|
"react-dom": "^19.2.8",
|
|
70
70
|
"tailwindcss": "^4.3.3",
|
|
71
|
-
"vite": "^8.
|
|
71
|
+
"vite": "^8.3.8",
|
|
72
72
|
"vitest": "^5.0.3"
|
|
73
73
|
}
|
|
74
74
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
export declare function AddFromNotesButton({ onClick }: {
|
|
3
|
-
readonly onClick: () => void;
|
|
4
|
-
}): React.JSX.Element;
|
|
5
|
-
export interface PersonIntakeDialogProps {
|
|
6
|
-
readonly onClose: () => void;
|
|
7
|
-
}
|
|
8
|
-
export declare function PersonIntakeDialog({ onClose }: PersonIntakeDialogProps): React.JSX.Element;
|
|
9
|
-
/** The dialog body and footer, the same frame the wizard's steps use. */
|
|
10
|
-
export declare function IntakeFrame({ children, footer, }: {
|
|
11
|
-
readonly children: ReactNode;
|
|
12
|
-
readonly footer: ReactNode;
|
|
13
|
-
}): React.JSX.Element;
|
|
14
|
-
export declare function NotesField({ value, onChange, disabled, }: {
|
|
15
|
-
readonly value: string;
|
|
16
|
-
readonly onChange: (value: string) => void;
|
|
17
|
-
readonly disabled?: boolean;
|
|
18
|
-
}): React.JSX.Element;
|
|
19
|
-
//# sourceMappingURL=PersonIntakeDialog.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersonIntakeDialog.d.ts","sourceRoot":"","sources":["../../src/components/PersonIntakeDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAqBtC,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAcnG;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAC7B;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,EAAE,uBAAuB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CA8C1F;AAyBD,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAC3B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAOpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,QAAgB,GACjB,EAAE;IACD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAsBpB"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { PERSON_INTAKE_MAX_TEXT } from '@kelpie/schemas';
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
4
|
-
import { useResolveAgentTask } from '../api/resources/agentTasks.js';
|
|
5
|
-
import { useWorkspace } from '../api/resources/workspace.js';
|
|
6
|
-
import { usePersonIntakeProvider } from '../registry/context.js';
|
|
7
|
-
import { ErrorPanel, LoadingPanel } from './QueryState.js';
|
|
8
|
-
/**
|
|
9
|
-
* People's **Add from notes**: a second way to add a person, from what the
|
|
10
|
-
* user already knows.
|
|
11
|
-
*
|
|
12
|
-
* Core owns the button and this dialog. When a module provides a wizard and
|
|
13
|
-
* it is ready (Kelpie AI enabled, with a key), the dialog renders it. Without
|
|
14
|
-
* one, the dialog still works: it builds the `workspace.add_person` prompt
|
|
15
|
-
* with the user's notes appended, for the user to paste into their own agent.
|
|
16
|
-
* That is the same pattern as the Log transcript task.
|
|
17
|
-
*/
|
|
18
|
-
const ADD_PERSON_TASK = 'workspace.add_person';
|
|
19
|
-
export function AddFromNotesButton({ onClick }) {
|
|
20
|
-
return (_jsxs("button", { type: "button", onClick: onClick, title: "Add a person from notes", className: "inline-flex h-7 shrink-0 items-center gap-1.5 rounded-md border border-border px-2.5 text-[12px] font-medium text-ink transition hover:border-border-strong hover:bg-surface-sunken", children: [_jsx("span", { "aria-hidden": "true", className: "text-accent", children: "\u2726" }), "Add from notes"] }));
|
|
21
|
-
}
|
|
22
|
-
export function PersonIntakeDialog({ onClose }) {
|
|
23
|
-
const provider = usePersonIntakeProvider();
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
function onKey(event) {
|
|
26
|
-
if (event.key === 'Escape')
|
|
27
|
-
onClose();
|
|
28
|
-
}
|
|
29
|
-
window.addEventListener('keydown', onKey);
|
|
30
|
-
return () => {
|
|
31
|
-
window.removeEventListener('keydown', onKey);
|
|
32
|
-
};
|
|
33
|
-
}, [onClose]);
|
|
34
|
-
return (_jsx("div", { className: "fixed inset-0 z-40 flex items-end justify-center bg-ink/30 p-4 sm:items-center", role: "dialog", "aria-modal": "true", "aria-label": "Add a person from notes", onClick: onClose, children: _jsxs("div", { className: "flex max-h-[90vh] w-full max-w-2xl flex-col overflow-hidden rounded-lg border border-border bg-surface", onClick: (event) => {
|
|
35
|
-
event.stopPropagation();
|
|
36
|
-
}, children: [_jsxs("div", { className: "flex items-start justify-between gap-3 border-b border-border px-4 py-3", children: [_jsxs("div", { children: [_jsx("div", { className: "text-[14px] font-semibold text-ink", children: "Add a person from notes" }), _jsx("div", { className: "mt-0.5 text-[12px] text-ink-muted", children: "Paste what you know. Kelpie builds the record from it." })] }), _jsx("button", { type: "button", className: "text-[12px] font-medium text-ink-muted hover:text-ink", onClick: onClose, children: "Close" })] }), provider === undefined ? (_jsx(CopyPromptIntake, { reason: "The AI module is not part of this install." })) : (_jsx(ProvidedIntake, { provider: provider, onClose: onClose }))] }) }));
|
|
37
|
-
}
|
|
38
|
-
/** Split out so `useAvailability` is only called when a provider exists. */
|
|
39
|
-
function ProvidedIntake({ provider, onClose, }) {
|
|
40
|
-
const availability = provider.useAvailability({ enabled: true });
|
|
41
|
-
if (availability.status === 'loading') {
|
|
42
|
-
return _jsx(LoadingPanel, { label: "Checking AI\u2026" });
|
|
43
|
-
}
|
|
44
|
-
if (availability.status === 'unavailable') {
|
|
45
|
-
return _jsx(CopyPromptIntake, { reason: availability.reason });
|
|
46
|
-
}
|
|
47
|
-
const Wizard = provider.Wizard;
|
|
48
|
-
return _jsx(Wizard, { onClose: onClose });
|
|
49
|
-
}
|
|
50
|
-
/** The dialog body and footer, the same frame the wizard's steps use. */
|
|
51
|
-
export function IntakeFrame({ children, footer, }) {
|
|
52
|
-
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-4 py-3", children: children }), _jsx("div", { className: "flex flex-wrap items-center justify-end gap-2 border-t border-border px-4 py-3", children: footer })] }));
|
|
53
|
-
}
|
|
54
|
-
export function NotesField({ value, onChange, disabled = false, }) {
|
|
55
|
-
return (_jsxs("label", { className: "block text-[12px] font-medium text-ink-muted", children: ["What do you know about this person?", _jsx("textarea", { value: value, onChange: (event) => {
|
|
56
|
-
onChange(event.target.value);
|
|
57
|
-
}, disabled: disabled, rows: 9, maxLength: PERSON_INTAKE_MAX_TEXT, autoFocus: true, placeholder: 'Names, emails, a LinkedIn URL, an email signature, meeting notes…\n\nDana Reyes, dana@brightline.health. Met at HLTH; asked about a pilot.', className: "mt-1 block w-full resize-y rounded-md border border-border bg-surface px-2.5 py-2 text-[13px] font-normal text-ink outline-none placeholder:text-ink-faint focus:border-accent disabled:opacity-60" }), _jsx("span", { className: "mt-1 block font-normal text-ink-faint", children: "LinkedIn pages cannot be read without signing in. For the full profile, open it in your own browser, select all, copy, and paste it here." })] }));
|
|
58
|
-
}
|
|
59
|
-
/** The fallback: the add-person agent task's prompt with the notes appended. */
|
|
60
|
-
function CopyPromptIntake({ reason }) {
|
|
61
|
-
const { workspace } = useWorkspace();
|
|
62
|
-
const resolve = useResolveAgentTask();
|
|
63
|
-
const [text, setText] = useState('');
|
|
64
|
-
const [copied, setCopied] = useState(false);
|
|
65
|
-
const [clipboardFailed, setClipboardFailed] = useState(false);
|
|
66
|
-
async function copy() {
|
|
67
|
-
if (workspace === undefined)
|
|
68
|
-
return;
|
|
69
|
-
setClipboardFailed(false);
|
|
70
|
-
const resolved = await resolve.runAsync({ taskId: ADD_PERSON_TASK, targetType: 'workspace', targetId: workspace.id });
|
|
71
|
-
const prompt = `${resolved.prompt}\n\n## Notes about the person\n\n${text.trim()}\n`;
|
|
72
|
-
try {
|
|
73
|
-
await navigator.clipboard.writeText(prompt);
|
|
74
|
-
setCopied(true);
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
setClipboardFailed(true);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return (_jsxs(IntakeFrame, { footer: _jsx("button", { type: "button", disabled: text.trim().length === 0 || resolve.isPending || workspace === undefined, onClick: () => {
|
|
81
|
-
void copy().catch(() => undefined);
|
|
82
|
-
}, className: "rounded-md bg-accent px-3 py-1.5 text-[12px] font-semibold text-accent-fg hover:bg-accent-hover disabled:opacity-50", children: resolve.isPending ? 'Preparing…' : copied ? 'Copied' : 'Copy prompt for your agent' }), children: [_jsxs("div", { className: "mb-3 rounded-md border border-border bg-surface-sunken px-3 py-2 text-[12px] text-ink-muted", children: [_jsx("p", { className: "font-medium text-ink", children: "AI cannot run this for you now." }), _jsx("p", { className: "mt-0.5", children: reason }), _jsx("p", { className: "mt-1", children: "You can still copy a prompt with your notes in it. Paste it into an agent connected to Kelpie over MCP (Claude, Cursor, \u2026), and the agent creates the records." })] }), _jsx(NotesField, { value: text, onChange: (value) => {
|
|
83
|
-
setText(value);
|
|
84
|
-
setCopied(false);
|
|
85
|
-
} }), resolve.error !== null && (_jsx("div", { className: "mt-3", children: _jsx(ErrorPanel, { error: resolve.error }) })), clipboardFailed && (_jsx("p", { className: "mt-2 text-[12px] text-danger", children: "The browser did not allow Kelpie to copy to the clipboard." }))] }));
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=PersonIntakeDialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PersonIntakeDialog.js","sourceRoot":"","sources":["../../src/components/PersonIntakeDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAE5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAkB,CAAA;AAE3D;;;;;;;;;GASG;AAEH,MAAM,eAAe,GAAG,sBAAsB,CAAA;AAE9C,MAAM,UAAU,kBAAkB,CAAC,EAAE,OAAO,EAAoC;IAC9E,OAAO,CACL,kBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,KAAK,EAAC,yBAAyB,EAC/B,SAAS,EAAC,qLAAqL,aAE/L,8BAAkB,MAAM,EAAC,SAAS,EAAC,aAAa,uBAEzC,sBAEA,CACV,CAAA;AACH,CAAC;AAMD,MAAM,UAAU,kBAAkB,CAAC,EAAE,OAAO,EAA2B;IACrE,MAAM,QAAQ,GAAG,uBAAuB,EAAE,CAAA;IAE1C,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,KAAK,CAAC,KAAoB;YACjC,IAAI,KAAK,CAAC,GA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A6F,aAC1G,YAAG,SAAS,EAAC,sBAAsB,gDAAoC,EACvE,YAAG,SAAS,EAAC,QAAQ,YAAE,MAAM,GAAK,EAClC,YAAG,SAAS,EAAC,MAAM,oLAGf,IACA,EACN,KAAC,UAAU,IACT,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oBAClB,OAAO,CAAC,KAAK,CAAC,CAAA;oBACd,SAAS,CAAC,KAAK,CAAC,CAAA;gBAClB,CAAC,GACD,EACD,OAAO,CAAC,KAAK,KAAK,IAAI,IAAI,CACzB,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,UAAU,IAAC,KAAK,EAAE,OAAO,CAAC,KAAK,GAAI,GAChC,CACP,EACA,eAAe,IAAI,CAClB,YAAG,SAAS,EAAC,8BAA8B,2EAA+D,CAC3G,IACW,CACf,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpPage.d.ts","sourceRoot":"","sources":["../../../src/pages/admin/McpPage.tsx"],"names":[],"mappings":"AAoDA,wBAAgB,OAAO,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CA8E3C"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AGENT_RUN_STATUS_LABELS } from '@kelpie/schemas';
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
4
|
-
import { Link } from 'react-router';
|
|
5
|
-
import { useTimezone } from '../../api/resources/account.js';
|
|
6
|
-
import { useAgentRuns, useAgents, useAllAgentTasks, useCreateAgent, useDeleteAgent, } from '../../api/resources/agentTasks.js';
|
|
7
|
-
import { useMcpTools } from '../../api/resources/mcpTools.js';
|
|
8
|
-
import { PageHeader } from '../../components/PageHeader.js';
|
|
9
|
-
import { ErrorPanel, LoadingPanel } from '../../components/QueryState.js';
|
|
10
|
-
import { CopyButton } from '../../components/CopyButton.js';
|
|
11
|
-
import { formatRelativeTime } from '../../lib/dates.js';
|
|
12
|
-
import { mcpClientConfig, mcpEndpoint } from '../../lib/mcpConfig.js';
|
|
13
|
-
/**
|
|
14
|
-
* How an agent connects to this workspace.
|
|
15
|
-
*
|
|
16
|
-
* Everything on the page is derived rather than written down. The endpoint comes
|
|
17
|
-
* from the origin the browser reached the app on, the same way a form's embed URL
|
|
18
|
-
* does, so it is right for a self-hosted install on any hostname. The tool list
|
|
19
|
-
* comes from `/v1/mcp/tools`, which reads the registry the endpoint itself
|
|
20
|
-
* dispatches against: a module that adds a resource shows up here without anyone
|
|
21
|
-
* editing this file.
|
|
22
|
-
*
|
|
23
|
-
* Registered agents and their run log live here too, under the connection
|
|
24
|
-
* details, where the mockup put them: an agent is something you connect, and
|
|
25
|
-
* this is the connections page.
|
|
26
|
-
*/
|
|
27
|
-
/**
|
|
28
|
-
* Matches a tool on its name or its description, so "csv" finds the import and
|
|
29
|
-
* export tools and "pinned" finds the note list that filters on it.
|
|
30
|
-
*/
|
|
31
|
-
function matches(tool, term) {
|
|
32
|
-
const needle = term.trim().toLowerCase();
|
|
33
|
-
if (needle.length === 0) {
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
return (tool.name.toLowerCase().includes(needle) ||
|
|
37
|
-
tool.description.toLowerCase().includes(needle));
|
|
38
|
-
}
|
|
39
|
-
export function McpPage() {
|
|
40
|
-
const endpoint = mcpEndpoint();
|
|
41
|
-
const config = mcpClientConfig(endpoint, 'kp_live_…');
|
|
42
|
-
return (_jsxs("div", { className: "animate-slide-in mx-auto max-w-4xl space-y-6", children: [_jsx(PageHeader, { title: "MCP", description: "Connect agents to this workspace over Streamable HTTP." }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[15px] font-semibold text-ink", children: "How agents use Kelpie" }), _jsx("p", { className: "mt-2 max-w-2xl text-[13px] leading-relaxed text-ink-muted", children: "Kelpie is a CRM and a company brain. Every REST operation is also an MCP tool over Streamable HTTP, so an agent reads and writes the same records the app does, through the same API. Point Claude, Cursor, or any MCP client at this workspace: bring your own agent. An install with the AI module can also run tasks on your own OpenAI or Anthropic key." }), _jsxs("ul", { className: "mt-4 space-y-2 text-[13px] text-ink", children: [_jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "An API key is bound to one workspace, so a client sees that workspace and no other."] }), _jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "A tool refuses exactly what the endpoint behind it refuses, with the same message."] }), _jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "A browser session does not work here. The endpoint takes an API key, or a token from OAuth sign-in."] })] })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Streamable HTTP endpoint" }), _jsx(CopyButton, { value: endpoint, label: "Copy the endpoint URL" })] }), _jsx("code", { className: "mt-3 block rounded-md border border-border bg-surface px-3 py-2.5 font-mono text-[13px] break-all text-ink", children: endpoint })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Sign in with OAuth" }), _jsxs("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: ["A client that supports MCP sign-in, such as a Claude.ai connector, needs only the endpoint URL above. It opens a Kelpie page where you choose a workspace and approve the access. You can disconnect it at any time under", ' ', _jsx(Link, { to: "/account/connected-apps", className: "text-accent hover:underline", children: "Connected apps" }), "."] })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Claude / Cursor config" }), _jsx(CopyButton, { value: config, label: "Copy the client config" })] }), _jsxs("p", { className: "mt-1 text-[12px] text-ink-muted", children: ["Paste into your MCP client config, and replace the bearer token with a workspace key from", ' ', _jsx(Link, { to: "/admin/api-keys", className: "text-accent hover:underline", children: "API keys" }), "."] }), _jsx("pre", { className: "bg-code-bg text-code-fg mt-3 overflow-x-auto rounded-md border border-border p-4 font-mono text-[12px] leading-relaxed", children: config })] }), _jsx(RegisteredAgents, {}), _jsx(RecentRuns, {}), _jsx(ToolCatalog, {})] }));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Bring-your-own agents that Run dispatches to. Any member reads this list —
|
|
46
|
-
* the Run dialog on every record page is built from it — and the API holds
|
|
47
|
-
* writes to admins, so a member's Add answers `403` and the form shows it.
|
|
48
|
-
*/
|
|
49
|
-
function RegisteredAgents() {
|
|
50
|
-
const { records, isLoading, error } = useAgents();
|
|
51
|
-
const createAgent = useCreateAgent();
|
|
52
|
-
const deleteAgent = useDeleteAgent();
|
|
53
|
-
const timezone = useTimezone();
|
|
54
|
-
const [adding, setAdding] = useState(false);
|
|
55
|
-
const [name, setName] = useState('');
|
|
56
|
-
const [endpoint, setEndpoint] = useState('');
|
|
57
|
-
const [authHeader, setAuthHeader] = useState('');
|
|
58
|
-
function submit(event) {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
createAgent
|
|
61
|
-
.runAsync({
|
|
62
|
-
name,
|
|
63
|
-
endpoint,
|
|
64
|
-
...(authHeader.trim().length === 0 ? {} : { authHeader }),
|
|
65
|
-
})
|
|
66
|
-
.then(() => {
|
|
67
|
-
setAdding(false);
|
|
68
|
-
setName('');
|
|
69
|
-
setEndpoint('');
|
|
70
|
-
setAuthHeader('');
|
|
71
|
-
})
|
|
72
|
-
.catch(() => {
|
|
73
|
-
// The form stays open and renders `createAgent.error`.
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Registered agents" }), _jsx("button", { type: "button", onClick: () => {
|
|
77
|
-
setAdding((open) => !open);
|
|
78
|
-
}, className: "rounded-md border border-border px-2.5 py-1 text-[12px] font-medium text-ink transition hover:border-accent hover:text-accent", children: adding ? 'Cancel' : 'Add agent' })] }), _jsx("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: "Run on any record dispatches the resolved task to one of these endpoints as JSON. The agent still reads and writes through the API above. The auth header is stored encrypted and never shown again." }), adding && (_jsxs("form", { onSubmit: submit, className: "mt-4 space-y-2 rounded-md border border-border p-3", children: [_jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Name", _jsx("input", { value: name, onChange: (event) => {
|
|
79
|
-
setName(event.target.value);
|
|
80
|
-
}, required: true, placeholder: "Local Claude", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Endpoint URL", _jsx("input", { value: endpoint, onChange: (event) => {
|
|
81
|
-
setEndpoint(event.target.value);
|
|
82
|
-
}, required: true, placeholder: "https://agents.example.com/kelpie/run", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Auth header (optional, sent as Authorization)", _jsx("input", { value: authHeader, onChange: (event) => {
|
|
83
|
-
setAuthHeader(event.target.value);
|
|
84
|
-
}, placeholder: "Bearer \u2026", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("button", { type: "submit", disabled: createAgent.isPending, className: "rounded-md bg-accent px-3 py-1.5 text-[12px] font-semibold text-accent-fg hover:bg-accent-hover disabled:opacity-50", children: "Register agent" }), createAgent.error !== null && (_jsx("span", { className: "text-[12px] text-danger", children: createAgent.error.message }))] })] })), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading agents\u2026" }), !isLoading && error === null && records.length === 0 && (_jsx("p", { className: "mt-4 text-[12px] text-ink-faint", children: "No agents registered. Copy prompt works without one; Run needs somewhere to send the task." })), records.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: records.map((agent) => (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-3 px-3 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[13px] font-medium text-ink", children: agent.name }), agent.managedBy === null ? (_jsx("code", { className: "font-mono text-[11px] break-all text-ink-muted", children: agent.endpoint })) : (_jsxs("span", { className: "text-[11px] text-ink-muted", children: ["Runs inside Kelpie (", agent.managedBy, " module)"] }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3 text-[11px] text-ink-faint", children: [agent.hasAuthHeader && _jsx("span", { children: "Auth header set" }), _jsx("span", { children: agent.lastRunAt === null
|
|
85
|
-
? 'Never run'
|
|
86
|
-
: `Last run ${formatRelativeTime(agent.lastRunAt, timezone)}` }), agent.managedBy === null ? (_jsx("button", { type: "button", onClick: () => {
|
|
87
|
-
deleteAgent.run(agent.id);
|
|
88
|
-
}, className: "font-medium text-danger hover:underline", children: "Remove" })) : agent.settingsPath === null ? (_jsx("span", { children: "Managed by a module" })) : (_jsx(Link, { to: agent.settingsPath, className: "font-medium text-accent hover:underline", children: "Manage in settings" }))] })] }, agent.id))) })), deleteAgent.error !== null && (_jsx("p", { className: "mt-2 text-[12px] text-danger", children: deleteAgent.error.message }))] }));
|
|
89
|
-
}
|
|
90
|
-
const RUN_LOG_ROWS = 8;
|
|
91
|
-
/** The newest dispatches, labelled from the catalog the tasks came from. */
|
|
92
|
-
function RecentRuns() {
|
|
93
|
-
const { records: runs, isLoading, error } = useAgentRuns();
|
|
94
|
-
const catalog = useAllAgentTasks();
|
|
95
|
-
const agents = useAgents();
|
|
96
|
-
const timezone = useTimezone();
|
|
97
|
-
const taskLabels = useMemo(() => new Map(catalog.records.map((task) => [task.id, task.label])), [catalog.records]);
|
|
98
|
-
const agentNames = useMemo(() => new Map(agents.records.map((agent) => [agent.id, agent.name])), [agents.records]);
|
|
99
|
-
function describeRun(run) {
|
|
100
|
-
const agentName = agentNames.get(run.agentId) ?? 'a removed agent';
|
|
101
|
-
return `${run.targetType}/${run.targetId} → ${agentName}`;
|
|
102
|
-
}
|
|
103
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Recent runs" }), _jsx("p", { className: "mt-1 text-[12px] text-ink-muted", children: "Each run records the dispatch: queued, then succeeded or failed with the reason. What the agent did afterwards is on the records themselves." }), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading runs\u2026" }), !isLoading && error === null && runs.length === 0 && (_jsx("p", { className: "mt-4 text-[12px] text-ink-faint", children: "No runs yet. Run an agent task from any record page." })), runs.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: runs.slice(0, RUN_LOG_ROWS).map((run) => (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-3 px-3 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[13px] font-medium text-ink", children: taskLabels.get(run.taskId) ?? run.taskId }), _jsx("div", { className: "text-[11px] text-ink-muted", children: describeRun(run) }), run.failureReason !== null && (_jsx("div", { className: "text-[11px] text-danger", children: run.failureReason }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3 text-[11px]", children: [_jsx("span", { className: run.status === 'failed' ? 'font-medium text-danger' : 'text-ink-muted', children: AGENT_RUN_STATUS_LABELS[run.status] }), _jsx("span", { className: "text-ink-faint", children: formatRelativeTime(run.updatedAt, timezone) })] })] }, run.id))) }))] }));
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* What this deployment actually registered, read from the endpoint's own registry.
|
|
107
|
-
*
|
|
108
|
-
* A flat list rather than a grouped one. Tool names are resource-then-verb, so
|
|
109
|
-
* sorting by name already puts a resource's five together, and every rule for
|
|
110
|
-
* grouping them turned out to be a lexical guess that read `webhooks_rotate_secret`
|
|
111
|
-
* as a resource called `webhooks_rotate`.
|
|
112
|
-
*/
|
|
113
|
-
function ToolCatalog() {
|
|
114
|
-
const { records, isLoading, error } = useMcpTools();
|
|
115
|
-
const [term, setTerm] = useState('');
|
|
116
|
-
const shown = useMemo(() => [...records].filter((tool) => matches(tool, term)).sort((left, right) => left.name.localeCompare(right.name)), [records, term]);
|
|
117
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Tools" }), records.length > 0 && (_jsx("input", { type: "search", value: term, onChange: (event) => {
|
|
118
|
-
setTerm(event.target.value);
|
|
119
|
-
}, placeholder: "Filter tools", "aria-label": "Filter tools", className: "rounded-md border border-border bg-surface px-2.5 py-1 text-[12px] text-ink outline-none focus:border-border-strong" }))] }), _jsx("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: isLoading
|
|
120
|
-
? 'Reading what this deployment exposes.'
|
|
121
|
-
: `${String(records.length)} tools, mirroring the REST API one for one. Arguments and results are snake_case JSON.` }), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading tools\u2026" }), records.length > 0 && shown.length === 0 && (_jsxs("p", { className: "mt-4 text-[12px] text-ink-faint", children: ["No tool matches \u201C", term, "\u201D."] })), shown.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: shown.map((tool) => (_jsxs("li", { className: "px-3 py-2.5", children: [_jsx("code", { className: "font-mono text-[12px] text-accent", children: tool.name }), _jsx("p", { className: "mt-0.5 text-[12px] leading-relaxed text-ink-muted", children: tool.description })] }, tool.name))) }))] }));
|
|
122
|
-
}
|
|
123
|
-
//# sourceMapp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AAI,CAAC,IAAI,CAGb,CACN,CAAC,GACC,CACN,IACO,CACX,CAAA;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpPanel.d.ts","sourceRoot":"","sources":["../../../src/pages/admin/McpPanel.tsx"],"names":[],"mappings":"AAmDA,gEAAgE;AAChE,wBAAgB,QAAQ,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CA4E5C"}
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { AGENT_RUN_STATUS_LABELS } from '@kelpie/schemas';
|
|
3
|
-
import { useMemo, useState } from 'react';
|
|
4
|
-
import { Link } from 'react-router';
|
|
5
|
-
import { useTimezone } from '../../api/resources/account.js';
|
|
6
|
-
import { useAgentRuns, useAgents, useAllAgentTasks, useCreateAgent, useDeleteAgent, } from '../../api/resources/agentTasks.js';
|
|
7
|
-
import { useMcpTools } from '../../api/resources/mcpTools.js';
|
|
8
|
-
import { ErrorPanel, LoadingPanel } from '../../components/QueryState.js';
|
|
9
|
-
import { CopyButton } from '../../components/CopyButton.js';
|
|
10
|
-
import { formatRelativeTime } from '../../lib/dates.js';
|
|
11
|
-
import { mcpClientConfig, mcpEndpoint } from '../../lib/mcpConfig.js';
|
|
12
|
-
/**
|
|
13
|
-
* How an agent connects to this workspace: the MCP tab on Admin → AI.
|
|
14
|
-
*
|
|
15
|
-
* Everything on the page is derived rather than written down. The endpoint comes
|
|
16
|
-
* from the origin the browser reached the app on, the same way a form's embed URL
|
|
17
|
-
* does, so it is right for a self-hosted install on any hostname. The tool list
|
|
18
|
-
* comes from `/v1/mcp/tools`, which reads the registry the endpoint itself
|
|
19
|
-
* dispatches against: a module that adds a resource shows up here without anyone
|
|
20
|
-
* editing this file.
|
|
21
|
-
*
|
|
22
|
-
* Registered agents and their run log live here too, under the connection
|
|
23
|
-
* details, where the mockup put them: an agent is something you connect, and
|
|
24
|
-
* this is the connections page.
|
|
25
|
-
*/
|
|
26
|
-
/**
|
|
27
|
-
* Matches a tool on its name or its description, so "csv" finds the import and
|
|
28
|
-
* export tools and "pinned" finds the note list that filters on it.
|
|
29
|
-
*/
|
|
30
|
-
function matches(tool, term) {
|
|
31
|
-
const needle = term.trim().toLowerCase();
|
|
32
|
-
if (needle.length === 0) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
return (tool.name.toLowerCase().includes(needle) ||
|
|
36
|
-
tool.description.toLowerCase().includes(needle));
|
|
37
|
-
}
|
|
38
|
-
/** The MCP tab on Admin → AI. Core, so every install has it. */
|
|
39
|
-
export function McpPanel() {
|
|
40
|
-
const endpoint = mcpEndpoint();
|
|
41
|
-
const config = mcpClientConfig(endpoint, 'kp_live_…');
|
|
42
|
-
return (_jsxs("div", { className: "space-y-6", children: [_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[15px] font-semibold text-ink", children: "How agents use Kelpie" }), _jsx("p", { className: "mt-2 max-w-2xl text-[13px] leading-relaxed text-ink-muted", children: "Kelpie is a CRM and a company brain. Every REST operation is also an MCP tool over Streamable HTTP, so an agent reads and writes the same records the app does, through the same API. Point Claude, Cursor, or any MCP client at this workspace: bring your own agent. An install with the AI module can also run tasks on your own OpenAI or Anthropic key." }), _jsxs("ul", { className: "mt-4 space-y-2 text-[13px] text-ink", children: [_jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "An API key is bound to one workspace, so a client sees that workspace and no other."] }), _jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "A tool refuses exactly what the endpoint behind it refuses, with the same message."] }), _jsxs("li", { className: "flex gap-2", children: [_jsx("span", { className: "text-accent", children: "\u2192" }), "A browser session does not work here. The endpoint takes an API key, or a token from OAuth sign-in."] })] })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Streamable HTTP endpoint" }), _jsx(CopyButton, { value: endpoint, label: "Copy the endpoint URL" })] }), _jsx("code", { className: "mt-3 block rounded-md border border-border bg-surface px-3 py-2.5 font-mono text-[13px] break-all text-ink", children: endpoint })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Sign in with OAuth" }), _jsxs("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: ["A client that supports MCP sign-in, such as a Claude.ai connector, needs only the endpoint URL above. It opens a Kelpie page where you choose a workspace and approve the access. You can disconnect it at any time under", ' ', _jsx(Link, { to: "/account/connected-apps", className: "text-accent hover:underline", children: "Connected apps" }), "."] })] }), _jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Claude / Cursor config" }), _jsx(CopyButton, { value: config, label: "Copy the client config" })] }), _jsxs("p", { className: "mt-1 text-[12px] text-ink-muted", children: ["Paste into your MCP client config, and replace the bearer token with a workspace key from", ' ', _jsx(Link, { to: "/admin/api-keys", className: "text-accent hover:underline", children: "API keys" }), "."] }), _jsx("pre", { className: "bg-code-bg text-code-fg mt-3 overflow-x-auto rounded-md border border-border p-4 font-mono text-[12px] leading-relaxed", children: config })] }), _jsx(RegisteredAgents, {}), _jsx(RecentRuns, {}), _jsx(ToolCatalog, {})] }));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Bring-your-own agents that Run dispatches to. Any member reads this list —
|
|
46
|
-
* the Run dialog on every record page is built from it — and the API holds
|
|
47
|
-
* writes to admins, so a member's Add answers `403` and the form shows it.
|
|
48
|
-
*/
|
|
49
|
-
function RegisteredAgents() {
|
|
50
|
-
const { records, isLoading, error } = useAgents();
|
|
51
|
-
const createAgent = useCreateAgent();
|
|
52
|
-
const deleteAgent = useDeleteAgent();
|
|
53
|
-
const timezone = useTimezone();
|
|
54
|
-
const [adding, setAdding] = useState(false);
|
|
55
|
-
const [name, setName] = useState('');
|
|
56
|
-
const [endpoint, setEndpoint] = useState('');
|
|
57
|
-
const [authHeader, setAuthHeader] = useState('');
|
|
58
|
-
function submit(event) {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
createAgent
|
|
61
|
-
.runAsync({
|
|
62
|
-
name,
|
|
63
|
-
endpoint,
|
|
64
|
-
...(authHeader.trim().length === 0 ? {} : { authHeader }),
|
|
65
|
-
})
|
|
66
|
-
.then(() => {
|
|
67
|
-
setAdding(false);
|
|
68
|
-
setName('');
|
|
69
|
-
setEndpoint('');
|
|
70
|
-
setAuthHeader('');
|
|
71
|
-
})
|
|
72
|
-
.catch(() => {
|
|
73
|
-
// The form stays open and renders `createAgent.error`.
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Registered agents" }), _jsx("button", { type: "button", onClick: () => {
|
|
77
|
-
setAdding((open) => !open);
|
|
78
|
-
}, className: "rounded-md border border-border px-2.5 py-1 text-[12px] font-medium text-ink transition hover:border-accent hover:text-accent", children: adding ? 'Cancel' : 'Add agent' })] }), _jsx("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: "Run on any record dispatches the resolved task to one of these endpoints as JSON. The agent still reads and writes through the API above. The auth header is stored encrypted and never shown again." }), adding && (_jsxs("form", { onSubmit: submit, className: "mt-4 space-y-2 rounded-md border border-border p-3", children: [_jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Name", _jsx("input", { value: name, onChange: (event) => {
|
|
79
|
-
setName(event.target.value);
|
|
80
|
-
}, required: true, placeholder: "Local Claude", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Endpoint URL", _jsx("input", { value: endpoint, onChange: (event) => {
|
|
81
|
-
setEndpoint(event.target.value);
|
|
82
|
-
}, required: true, placeholder: "https://agents.example.com/kelpie/run", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("label", { className: "block text-[12px] text-ink-muted", children: ["Auth header (optional, sent as Authorization)", _jsx("input", { value: authHeader, onChange: (event) => {
|
|
83
|
-
setAuthHeader(event.target.value);
|
|
84
|
-
}, placeholder: "Bearer \u2026", className: "mt-1 w-full rounded-md border border-border bg-surface px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none focus:border-accent" })] }), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("button", { type: "submit", disabled: createAgent.isPending, className: "rounded-md bg-accent px-3 py-1.5 text-[12px] font-semibold text-accent-fg hover:bg-accent-hover disabled:opacity-50", children: "Register agent" }), createAgent.error !== null && (_jsx("span", { className: "text-[12px] text-danger", children: createAgent.error.message }))] })] })), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading agents\u2026" }), !isLoading && error === null && records.length === 0 && (_jsx("p", { className: "mt-4 text-[12px] text-ink-faint", children: "No agents registered. Copy prompt works without one; Run needs somewhere to send the task." })), records.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: records.map((agent) => (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-3 px-3 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[13px] font-medium text-ink", children: agent.name }), agent.managedBy === null ? (_jsx("code", { className: "font-mono text-[11px] break-all text-ink-muted", children: agent.endpoint })) : (_jsxs("span", { className: "text-[11px] text-ink-muted", children: ["Runs inside Kelpie (", agent.managedBy, " module)"] }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3 text-[11px] text-ink-faint", children: [agent.hasAuthHeader && _jsx("span", { children: "Auth header set" }), _jsx("span", { children: agent.lastRunAt === null
|
|
85
|
-
? 'Never run'
|
|
86
|
-
: `Last run ${formatRelativeTime(agent.lastRunAt, timezone)}` }), agent.managedBy === null ? (_jsx("button", { type: "button", onClick: () => {
|
|
87
|
-
deleteAgent.run(agent.id);
|
|
88
|
-
}, className: "font-medium text-danger hover:underline", children: "Remove" })) : agent.settingsPath === null ? (_jsx("span", { children: "Managed by a module" })) : (_jsx(Link, { to: agent.settingsPath, className: "font-medium text-accent hover:underline", children: "Manage in settings" }))] })] }, agent.id))) })), deleteAgent.error !== null && (_jsx("p", { className: "mt-2 text-[12px] text-danger", children: deleteAgent.error.message }))] }));
|
|
89
|
-
}
|
|
90
|
-
const RUN_LOG_ROWS = 8;
|
|
91
|
-
/** The newest dispatches, labelled from the catalog the tasks came from. */
|
|
92
|
-
function RecentRuns() {
|
|
93
|
-
const { records: runs, isLoading, error } = useAgentRuns();
|
|
94
|
-
const catalog = useAllAgentTasks();
|
|
95
|
-
const agents = useAgents();
|
|
96
|
-
const timezone = useTimezone();
|
|
97
|
-
const taskLabels = useMemo(() => new Map(catalog.records.map((task) => [task.id, task.label])), [catalog.records]);
|
|
98
|
-
const agentNames = useMemo(() => new Map(agents.records.map((agent) => [agent.id, agent.name])), [agents.records]);
|
|
99
|
-
function describeRun(run) {
|
|
100
|
-
const agentName = agentNames.get(run.agentId) ?? 'a removed agent';
|
|
101
|
-
return `${run.targetType}/${run.targetId} → ${agentName}`;
|
|
102
|
-
}
|
|
103
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Recent runs" }), _jsx("p", { className: "mt-1 text-[12px] text-ink-muted", children: "Each run records the dispatch: queued, then succeeded or failed with the reason. What the agent did afterwards is on the records themselves." }), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading runs\u2026" }), !isLoading && error === null && runs.length === 0 && (_jsx("p", { className: "mt-4 text-[12px] text-ink-faint", children: "No runs yet. Run an agent task from any record page." })), runs.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: runs.slice(0, RUN_LOG_ROWS).map((run) => (_jsxs("li", { className: "flex flex-wrap items-center justify-between gap-3 px-3 py-2.5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-[13px] font-medium text-ink", children: taskLabels.get(run.taskId) ?? run.taskId }), _jsx("div", { className: "text-[11px] text-ink-muted", children: describeRun(run) }), run.failureReason !== null && (_jsx("div", { className: "text-[11px] text-danger", children: run.failureReason }))] }), _jsxs("div", { className: "flex shrink-0 items-center gap-3 text-[11px]", children: [_jsx("span", { className: run.status === 'failed' ? 'font-medium text-danger' : 'text-ink-muted', children: AGENT_RUN_STATUS_LABELS[run.status] }), _jsx("span", { className: "text-ink-faint", children: formatRelativeTime(run.updatedAt, timezone) })] })] }, run.id))) }))] }));
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* What this deployment actually registered, read from the endpoint's own registry.
|
|
107
|
-
*
|
|
108
|
-
* A flat list rather than a grouped one. Tool names are resource-then-verb, so
|
|
109
|
-
* sorting by name already puts a resource's five together, and every rule for
|
|
110
|
-
* grouping them turned out to be a lexical guess that read `webhooks_rotate_secret`
|
|
111
|
-
* as a resource called `webhooks_rotate`.
|
|
112
|
-
*/
|
|
113
|
-
function ToolCatalog() {
|
|
114
|
-
const { records, isLoading, error } = useMcpTools();
|
|
115
|
-
const [term, setTerm] = useState('');
|
|
116
|
-
const shown = useMemo(() => [...records].filter((tool) => matches(tool, term)).sort((left, right) => left.name.localeCompare(right.name)), [records, term]);
|
|
117
|
-
return (_jsxs("section", { className: "rounded-md border border-border p-5", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [_jsx("h2", { className: "text-[13px] font-semibold text-ink", children: "Tools" }), records.length > 0 && (_jsx("input", { type: "search", value: term, onChange: (event) => {
|
|
118
|
-
setTerm(event.target.value);
|
|
119
|
-
}, placeholder: "Filter tools", "aria-label": "Filter tools", className: "rounded-md border border-border bg-surface px-2.5 py-1 text-[12px] text-ink outline-none focus:border-border-strong" }))] }), _jsx("p", { className: "mt-1 max-w-2xl text-[12px] text-ink-muted", children: isLoading
|
|
120
|
-
? 'Reading what this deployment exposes.'
|
|
121
|
-
: `${String(records.length)} tools, mirroring the REST API one for one. Arguments and results are snake_case JSON.` }), error !== null && _jsx("div", { className: "mt-4", children: _jsx(ErrorPanel, { error: error }) }), isLoading && _jsx(LoadingPanel, { label: "Loading tools\u2026" }), records.length > 0 && shown.length === 0 && (_jsxs("p", { className: "mt-4 text-[12px] text-ink-faint", children: ["No tool matches \u201C", term, "\u201D."] })), shown.length > 0 && (_jsx("ul", { className: "mt-4 divide-y divide-border rounded-md border border-border", children: shown.map((tool) => (_jsxs("li", { className: "px-3 py-2.5", children: [_jsx("code", { className: "font-mono text-[12px] text-accent", children: tool.name }), _jsx("p", { className: "mt-0.5 text-[12px] leading-relaxed text-ink-muted", children: tool.description })] }, tool.name))) }))] }));
|
|
122
|
-
}
|
|
123
|
-
//# sourceMappingURL=McpPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"McpPanel.js","sourceRoot":"","sources":["../../../src/pages/admin/McpPanel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAEzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,cAAc,EACd,cAAc,GACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,EA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