@stigmer/react 0.0.36
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/LICENSE +190 -0
- package/README.md +248 -0
- package/agent/components/AgentCard.d.ts +9 -0
- package/agent/components/AgentCard.d.ts.map +1 -0
- package/agent/components/AgentCard.js +26 -0
- package/agent/components/AgentCard.js.map +1 -0
- package/agent/components/AgentOverview.d.ts +7 -0
- package/agent/components/AgentOverview.d.ts.map +1 -0
- package/agent/components/AgentOverview.js +36 -0
- package/agent/components/AgentOverview.js.map +1 -0
- package/agent/components/AgentPicker.d.ts +17 -0
- package/agent/components/AgentPicker.d.ts.map +1 -0
- package/agent/components/AgentPicker.js +86 -0
- package/agent/components/AgentPicker.js.map +1 -0
- package/agent/hooks/useAgentSearch.d.ts +28 -0
- package/agent/hooks/useAgentSearch.d.ts.map +1 -0
- package/agent/hooks/useAgentSearch.js +63 -0
- package/agent/hooks/useAgentSearch.js.map +1 -0
- package/agent/index.d.ts +9 -0
- package/agent/index.d.ts.map +1 -0
- package/agent/index.js +7 -0
- package/agent/index.js.map +1 -0
- package/agent-execution/components/ApprovalControls.d.ts +10 -0
- package/agent-execution/components/ApprovalControls.d.ts.map +1 -0
- package/agent-execution/components/ApprovalControls.js +19 -0
- package/agent-execution/components/ApprovalControls.js.map +1 -0
- package/agent-execution/components/ExecutionStatus.d.ts +8 -0
- package/agent-execution/components/ExecutionStatus.d.ts.map +1 -0
- package/agent-execution/components/ExecutionStatus.js +14 -0
- package/agent-execution/components/ExecutionStatus.js.map +1 -0
- package/agent-execution/components/ExecutionStream.d.ts +16 -0
- package/agent-execution/components/ExecutionStream.d.ts.map +1 -0
- package/agent-execution/components/ExecutionStream.js +39 -0
- package/agent-execution/components/ExecutionStream.js.map +1 -0
- package/agent-execution/components/MessageEntry.d.ts +17 -0
- package/agent-execution/components/MessageEntry.d.ts.map +1 -0
- package/agent-execution/components/MessageEntry.js +36 -0
- package/agent-execution/components/MessageEntry.js.map +1 -0
- package/agent-execution/components/MessageInput.d.ts +10 -0
- package/agent-execution/components/MessageInput.d.ts.map +1 -0
- package/agent-execution/components/MessageInput.js +27 -0
- package/agent-execution/components/MessageInput.js.map +1 -0
- package/agent-execution/components/OutputBlock.d.ts +9 -0
- package/agent-execution/components/OutputBlock.d.ts.map +1 -0
- package/agent-execution/components/OutputBlock.js +15 -0
- package/agent-execution/components/OutputBlock.js.map +1 -0
- package/agent-execution/components/SubAgentCard.d.ts +11 -0
- package/agent-execution/components/SubAgentCard.d.ts.map +1 -0
- package/agent-execution/components/SubAgentCard.js +19 -0
- package/agent-execution/components/SubAgentCard.js.map +1 -0
- package/agent-execution/components/ToolCallCard.d.ts +11 -0
- package/agent-execution/components/ToolCallCard.d.ts.map +1 -0
- package/agent-execution/components/ToolCallCard.js +25 -0
- package/agent-execution/components/ToolCallCard.js.map +1 -0
- package/agent-execution/helpers.d.ts +35 -0
- package/agent-execution/helpers.d.ts.map +1 -0
- package/agent-execution/helpers.js +157 -0
- package/agent-execution/helpers.js.map +1 -0
- package/agent-execution/hooks/useAgentExecution.d.ts +21 -0
- package/agent-execution/hooks/useAgentExecution.d.ts.map +1 -0
- package/agent-execution/hooks/useAgentExecution.js +99 -0
- package/agent-execution/hooks/useAgentExecution.js.map +1 -0
- package/agent-execution/hooks/useApproval.d.ts +12 -0
- package/agent-execution/hooks/useApproval.d.ts.map +1 -0
- package/agent-execution/hooks/useApproval.js +32 -0
- package/agent-execution/hooks/useApproval.js.map +1 -0
- package/agent-execution/index.d.ts +14 -0
- package/agent-execution/index.d.ts.map +1 -0
- package/agent-execution/index.js +15 -0
- package/agent-execution/index.js.map +1 -0
- package/catalog/components/ResourceSearchCard.d.ts +23 -0
- package/catalog/components/ResourceSearchCard.d.ts.map +1 -0
- package/catalog/components/ResourceSearchCard.js +36 -0
- package/catalog/components/ResourceSearchCard.js.map +1 -0
- package/catalog/index.d.ts +4 -0
- package/catalog/index.d.ts.map +1 -0
- package/catalog/index.js +5 -0
- package/catalog/index.js.map +1 -0
- package/catalog/internal/time.d.ts +13 -0
- package/catalog/internal/time.d.ts.map +1 -0
- package/catalog/internal/time.js +41 -0
- package/catalog/internal/time.js.map +1 -0
- package/context.d.ts +12 -0
- package/context.d.ts.map +1 -0
- package/context.js +13 -0
- package/context.js.map +1 -0
- package/hooks.d.ts +19 -0
- package/hooks.d.ts.map +1 -0
- package/hooks.js +28 -0
- package/hooks.js.map +1 -0
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -0
- package/index.js +6 -0
- package/index.js.map +1 -0
- package/internal/badge.d.ts +8 -0
- package/internal/badge.d.ts.map +1 -0
- package/internal/badge.js +34 -0
- package/internal/badge.js.map +1 -0
- package/internal/button.d.ts +9 -0
- package/internal/button.d.ts.map +1 -0
- package/internal/button.js +36 -0
- package/internal/button.js.map +1 -0
- package/internal/collapsible.d.ts +6 -0
- package/internal/collapsible.d.ts.map +1 -0
- package/internal/collapsible.js +14 -0
- package/internal/collapsible.js.map +1 -0
- package/internal/section.d.ts +8 -0
- package/internal/section.d.ts.map +1 -0
- package/internal/section.js +6 -0
- package/internal/section.js.map +1 -0
- package/internal/textarea.d.ts +4 -0
- package/internal/textarea.d.ts.map +1 -0
- package/internal/textarea.js +9 -0
- package/internal/textarea.js.map +1 -0
- package/mcp-server/hooks/useMcpServerSearch.d.ts +25 -0
- package/mcp-server/hooks/useMcpServerSearch.d.ts.map +1 -0
- package/mcp-server/hooks/useMcpServerSearch.js +57 -0
- package/mcp-server/hooks/useMcpServerSearch.js.map +1 -0
- package/mcp-server/index.d.ts +3 -0
- package/mcp-server/index.d.ts.map +1 -0
- package/mcp-server/index.js +3 -0
- package/mcp-server/index.js.map +1 -0
- package/package.json +75 -0
- package/provider.d.ts +55 -0
- package/provider.d.ts.map +1 -0
- package/provider.js +34 -0
- package/provider.js.map +1 -0
- package/session/components/AgentSessionHistory.d.ts +8 -0
- package/session/components/AgentSessionHistory.d.ts.map +1 -0
- package/session/components/AgentSessionHistory.js +11 -0
- package/session/components/AgentSessionHistory.js.map +1 -0
- package/session/components/SessionCard.d.ts +8 -0
- package/session/components/SessionCard.d.ts.map +1 -0
- package/session/components/SessionCard.js +57 -0
- package/session/components/SessionCard.js.map +1 -0
- package/session/hooks/useAgentSessionList.d.ts +21 -0
- package/session/hooks/useAgentSessionList.d.ts.map +1 -0
- package/session/hooks/useAgentSessionList.js +90 -0
- package/session/hooks/useAgentSessionList.js.map +1 -0
- package/session/index.d.ts +7 -0
- package/session/index.d.ts.map +1 -0
- package/session/index.js +6 -0
- package/session/index.js.map +1 -0
- package/skill/hooks/useSkillSearch.d.ts +25 -0
- package/skill/hooks/useSkillSearch.d.ts.map +1 -0
- package/skill/hooks/useSkillSearch.js +57 -0
- package/skill/hooks/useSkillSearch.js.map +1 -0
- package/skill/index.d.ts +3 -0
- package/skill/index.d.ts.map +1 -0
- package/skill/index.js +3 -0
- package/skill/index.js.map +1 -0
- package/src/agent/components/AgentCard.tsx +125 -0
- package/src/agent/components/AgentOverview.tsx +209 -0
- package/src/agent/components/AgentPicker.tsx +255 -0
- package/src/agent/hooks/useAgentSearch.ts +94 -0
- package/src/agent/index.ts +17 -0
- package/src/agent-execution/components/ApprovalControls.tsx +99 -0
- package/src/agent-execution/components/ExecutionStatus.tsx +33 -0
- package/src/agent-execution/components/ExecutionStream.tsx +148 -0
- package/src/agent-execution/components/MessageEntry.tsx +125 -0
- package/src/agent-execution/components/MessageInput.tsx +70 -0
- package/src/agent-execution/components/OutputBlock.tsx +43 -0
- package/src/agent-execution/components/SubAgentCard.tsx +138 -0
- package/src/agent-execution/components/ToolCallCard.tsx +153 -0
- package/src/agent-execution/helpers.ts +193 -0
- package/src/agent-execution/hooks/useAgentExecution.ts +147 -0
- package/src/agent-execution/hooks/useApproval.ts +56 -0
- package/src/agent-execution/index.ts +46 -0
- package/src/catalog/components/ResourceSearchCard.tsx +137 -0
- package/src/catalog/index.ts +6 -0
- package/src/catalog/internal/time.ts +40 -0
- package/src/context.ts +15 -0
- package/src/hooks.ts +32 -0
- package/src/index.ts +6 -0
- package/src/internal/badge.tsx +52 -0
- package/src/internal/button.tsx +60 -0
- package/src/internal/collapsible.tsx +21 -0
- package/src/internal/section.tsx +18 -0
- package/src/internal/textarea.tsx +23 -0
- package/src/mcp-server/hooks/useMcpServerSearch.ts +79 -0
- package/src/mcp-server/index.ts +6 -0
- package/src/provider.tsx +73 -0
- package/src/session/components/AgentSessionHistory.tsx +109 -0
- package/src/session/components/SessionCard.tsx +113 -0
- package/src/session/hooks/useAgentSessionList.ts +117 -0
- package/src/session/index.ts +13 -0
- package/src/skill/hooks/useSkillSearch.ts +79 -0
- package/src/skill/index.ts +6 -0
- package/src/styles.css +72 -0
- package/styles.css +2 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a protobuf Timestamp to a JS Date.
|
|
3
|
+
* Returns null if the timestamp is undefined or has no seconds.
|
|
4
|
+
*/
|
|
5
|
+
export function toDate(ts) {
|
|
6
|
+
if (!ts)
|
|
7
|
+
return null;
|
|
8
|
+
const seconds = Number(ts.seconds);
|
|
9
|
+
if (!seconds && seconds !== 0)
|
|
10
|
+
return null;
|
|
11
|
+
return new Date(seconds * 1000 + Math.floor(ts.nanos / 1_000_000));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Format a protobuf Timestamp as a human-readable relative time string.
|
|
15
|
+
*
|
|
16
|
+
* Examples: "just now", "2m ago", "3h ago", "yesterday", "Mar 12"
|
|
17
|
+
*/
|
|
18
|
+
export function formatRelativeTime(ts) {
|
|
19
|
+
const date = toDate(ts);
|
|
20
|
+
if (!date)
|
|
21
|
+
return "";
|
|
22
|
+
const now = Date.now();
|
|
23
|
+
const diffMs = now - date.getTime();
|
|
24
|
+
if (diffMs < 0)
|
|
25
|
+
return "just now";
|
|
26
|
+
if (diffMs < 60_000)
|
|
27
|
+
return "just now";
|
|
28
|
+
const minutes = Math.floor(diffMs / 60_000);
|
|
29
|
+
if (minutes < 60)
|
|
30
|
+
return `${minutes}m ago`;
|
|
31
|
+
const hours = Math.floor(minutes / 60);
|
|
32
|
+
if (hours < 24)
|
|
33
|
+
return `${hours}h ago`;
|
|
34
|
+
const days = Math.floor(hours / 24);
|
|
35
|
+
if (days === 1)
|
|
36
|
+
return "yesterday";
|
|
37
|
+
if (days < 7)
|
|
38
|
+
return `${days}d ago`;
|
|
39
|
+
return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/catalog/internal/time.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,MAAM,CAAC,EAAyB;IAC9C,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,MAAM,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3C,OAAO,IAAI,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC;AACrE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAyB;IAC1D,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACxB,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAEpC,IAAI,MAAM,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IAClC,IAAI,MAAM,GAAG,MAAM;QAAE,OAAO,UAAU,CAAC;IAEvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;IAC5C,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,OAAO,CAAC;IAE3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACvC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,OAAO,CAAC;IAEvC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC;IACpC,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IACnC,IAAI,IAAI,GAAG,CAAC;QAAE,OAAO,GAAG,IAAI,OAAO,CAAC;IAEpC,OAAO,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
package/context.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* React context for the Stigmer SDK client instance.
|
|
4
|
+
*
|
|
5
|
+
* Separated from the provider component to prevent circular imports:
|
|
6
|
+
* both the provider and consumer hooks import from this file.
|
|
7
|
+
*
|
|
8
|
+
* The context value is `null` when no provider is mounted. Consumer hooks
|
|
9
|
+
* throw in this case to surface wiring mistakes during development.
|
|
10
|
+
*/
|
|
11
|
+
export declare const StigmerContext: import("react").Context<Stigmer | null>;
|
|
12
|
+
//# sourceMappingURL=context.d.ts.map
|
package/context.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,yCAAsC,CAAC"}
|
package/context.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* React context for the Stigmer SDK client instance.
|
|
5
|
+
*
|
|
6
|
+
* Separated from the provider component to prevent circular imports:
|
|
7
|
+
* both the provider and consumer hooks import from this file.
|
|
8
|
+
*
|
|
9
|
+
* The context value is `null` when no provider is mounted. Consumer hooks
|
|
10
|
+
* throw in this case to surface wiring mistakes during development.
|
|
11
|
+
*/
|
|
12
|
+
export const StigmerContext = createContext(null);
|
|
13
|
+
//# sourceMappingURL=context.js.map
|
package/context.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAiB,IAAI,CAAC,CAAC"}
|
package/hooks.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Access the {@link Stigmer} SDK client from the nearest
|
|
4
|
+
* {@link StigmerProvider}.
|
|
5
|
+
*
|
|
6
|
+
* Throws if called outside a provider — this surfaces wiring mistakes
|
|
7
|
+
* immediately during development rather than producing silent `null`
|
|
8
|
+
* failures at runtime.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* function AgentDetail({ id }: { id: string }) {
|
|
13
|
+
* const stigmer = useStigmer();
|
|
14
|
+
* const agent = await stigmer.agent.get(id);
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function useStigmer(): Stigmer;
|
|
19
|
+
//# sourceMappingURL=hooks.d.ts.map
|
package/hooks.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,IAAI,OAAO,CASpC"}
|
package/hooks.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { StigmerContext } from "./context";
|
|
4
|
+
/**
|
|
5
|
+
* Access the {@link Stigmer} SDK client from the nearest
|
|
6
|
+
* {@link StigmerProvider}.
|
|
7
|
+
*
|
|
8
|
+
* Throws if called outside a provider — this surfaces wiring mistakes
|
|
9
|
+
* immediately during development rather than producing silent `null`
|
|
10
|
+
* failures at runtime.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* function AgentDetail({ id }: { id: string }) {
|
|
15
|
+
* const stigmer = useStigmer();
|
|
16
|
+
* const agent = await stigmer.agent.get(id);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export function useStigmer() {
|
|
21
|
+
const client = useContext(StigmerContext);
|
|
22
|
+
if (!client) {
|
|
23
|
+
throw new Error("useStigmer must be used within <StigmerProvider>. " +
|
|
24
|
+
"Wrap your component tree with <StigmerProvider client={stigmerClient}>.");
|
|
25
|
+
}
|
|
26
|
+
return client;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=hooks.js.map
|
package/hooks.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,UAAU;IACxB,MAAM,MAAM,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CACb,oDAAoD;YAClD,yEAAyE,CAC5E,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/index.d.ts
ADDED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,OAAO,EAAE,eAAe,EAA6B,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C,QAAQ;AACR,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
|
+
export { Badge, badgeVariants };
|
|
8
|
+
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/internal/badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;8EAqBlB,CAAC;AAEF,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,8FAevE;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
const badgeVariants = cva("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!", {
|
|
6
|
+
variants: {
|
|
7
|
+
variant: {
|
|
8
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
9
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
10
|
+
destructive: "bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
|
|
11
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
13
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
function Badge({ className, variant = "default", render, ...props }) {
|
|
21
|
+
return useRender({
|
|
22
|
+
defaultTagName: "span",
|
|
23
|
+
props: mergeProps({
|
|
24
|
+
className: cn(badgeVariants({ variant }), className),
|
|
25
|
+
}, props),
|
|
26
|
+
render,
|
|
27
|
+
state: {
|
|
28
|
+
slot: "badge",
|
|
29
|
+
variant,
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export { Badge, badgeVariants };
|
|
34
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/internal/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,MAAM,aAAa,GAAG,GAAG,CACvB,4eAA4e,EAC5e;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,4DAA4D;YACrE,SAAS,EACP,kEAAkE;YACpE,WAAW,EACT,gKAAgK;YAClK,OAAO,EACL,kFAAkF;YACpF,KAAK,EACH,mEAAmE;YACrE,IAAI,EAAE,iDAAiD;SACxD;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAEF,SAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,MAAM,EACN,GAAG,KAAK,EAC8D;IACtE,OAAO,SAAS,CAAC;QACf,cAAc,EAAE,MAAM;QACtB,KAAK,EAAE,UAAU,CACf;YACE,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC;SACrD,EACD,KAAK,CACN;QACD,MAAM;QACN,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,OAAO;SACR;KACF,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "secondary" | "destructive" | "outline" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Button, buttonVariants };
|
|
9
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/internal/button.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAmCnB,CAAC;AAEF,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,eAAe,CAAC,KAAK,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,2CAQ7D;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { cn } from "@stigmer/theme";
|
|
6
|
+
const buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
10
|
+
outline: "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
|
|
11
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
|
|
12
|
+
ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
|
|
13
|
+
destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
|
|
14
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
default: "h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
|
|
18
|
+
xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
|
|
19
|
+
sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
|
|
20
|
+
lg: "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",
|
|
21
|
+
icon: "size-8",
|
|
22
|
+
"icon-xs": "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",
|
|
23
|
+
"icon-sm": "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",
|
|
24
|
+
"icon-lg": "size-9",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
defaultVariants: {
|
|
28
|
+
variant: "default",
|
|
29
|
+
size: "default",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
function Button({ className, variant = "default", size = "default", ...props }) {
|
|
33
|
+
return (_jsx(ButtonPrimitive, { "data-slot": "button", className: cn(buttonVariants({ variant, size, className })), ...props }));
|
|
34
|
+
}
|
|
35
|
+
export { Button, buttonVariants };
|
|
36
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/internal/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,MAAM,cAAc,GAAG,GAAG,CACxB,wkBAAwkB,EACxkB;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,4DAA4D;YACrE,OAAO,EACL,iLAAiL;YACnL,SAAS,EACP,iIAAiI;YACnI,KAAK,EACH,kHAAkH;YACpH,WAAW,EACT,6NAA6N;YAC/N,IAAI,EAAE,iDAAiD;SACxD;QACD,IAAI,EAAE;YACJ,OAAO,EACL,sFAAsF;YACxF,EAAE,EAAE,+MAA+M;YACnN,EAAE,EAAE,yNAAyN;YAC7N,EAAE,EAAE,sFAAsF;YAC1F,IAAI,EAAE,QAAQ;YACd,SAAS,EACP,yHAAyH;YAC3H,SAAS,EACP,oFAAoF;YACtF,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAC;AAEF,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EACoD;IAC5D,OAAO,CACL,KAAC,eAAe,iBACJ,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
2
|
+
declare function Collapsible({ ...props }: CollapsiblePrimitive.Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
6
|
+
//# sourceMappingURL=collapsible.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.d.ts","sourceRoot":"","sources":["../../src/internal/collapsible.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,2CAEjE;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,2CAI3E;AAED,iBAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,2CAIzE;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
|
|
4
|
+
function Collapsible({ ...props }) {
|
|
5
|
+
return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
|
|
6
|
+
}
|
|
7
|
+
function CollapsibleTrigger({ ...props }) {
|
|
8
|
+
return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ...props }));
|
|
9
|
+
}
|
|
10
|
+
function CollapsibleContent({ ...props }) {
|
|
11
|
+
return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", ...props }));
|
|
12
|
+
}
|
|
13
|
+
export { Collapsible, CollapsibleTrigger, CollapsibleContent };
|
|
14
|
+
//# sourceMappingURL=collapsible.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../src/internal/collapsible.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,SAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAmC;IAChE,OAAO,KAAC,oBAAoB,CAAC,IAAI,iBAAW,aAAa,KAAK,KAAK,GAAI,CAAC;AAC1E,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAsC;IAC1E,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAoC;IACxE,OAAO,CACL,KAAC,oBAAoB,CAAC,KAAK,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC1E,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface SectionProps {
|
|
2
|
+
title: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
declare function Section({ title, children }: SectionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Section };
|
|
7
|
+
export type { SectionProps };
|
|
8
|
+
//# sourceMappingURL=section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../../src/internal/section.tsx"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,YAAY,2CASjD;AAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
function Section({ title, children }) {
|
|
3
|
+
return (_jsxs("section", { children: [_jsx("h3", { className: "text-muted-foreground mb-3 text-sm font-semibold tracking-wider uppercase", children: title }), children] }));
|
|
4
|
+
}
|
|
5
|
+
export { Section };
|
|
6
|
+
//# sourceMappingURL=section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.js","sourceRoot":"","sources":["../../src/internal/section.tsx"],"names":[],"mappings":";AAKA,SAAS,OAAO,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAgB;IAChD,OAAO,CACL,8BACE,aAAI,SAAS,EAAC,2EAA2E,YACtF,KAAK,GACH,EACJ,QAAQ,IACD,CACX,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Textarea: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
3
|
+
export { Textarea };
|
|
4
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../src/internal/textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,QAAQ,0LAeZ,CAAC;AAGH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "@stigmer/theme";
|
|
4
|
+
const Textarea = React.forwardRef(({ className, ...props }, ref) => {
|
|
5
|
+
return (_jsx("textarea", { ref: ref, "data-slot": "textarea", className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 flex field-sizing-content min-h-16 w-full rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors outline-none focus-visible:ring-3 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-3 md:text-sm", className), ...props }));
|
|
6
|
+
});
|
|
7
|
+
Textarea.displayName = "Textarea";
|
|
8
|
+
export { Textarea };
|
|
9
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../src/internal/textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAG/B,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IACjC,OAAO,CACL,mBACE,GAAG,EAAE,GAAG,eACE,UAAU,EACpB,SAAS,EAAE,EAAE,CACX,whBAAwhB,EACxhB,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SearchResult } from "@stigmer/protos/ai/stigmer/search/v1/io_pb";
|
|
2
|
+
export interface UseMcpServerSearchOptions {
|
|
3
|
+
org: string;
|
|
4
|
+
debounceMs?: number;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface UseMcpServerSearchReturn {
|
|
8
|
+
query: string;
|
|
9
|
+
setQuery: (query: string) => void;
|
|
10
|
+
results: SearchResult[];
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Debounced MCP server search scoped to a specific organization.
|
|
16
|
+
*
|
|
17
|
+
* On mount fetches all accessible MCP servers (empty query). Typing fires at
|
|
18
|
+
* most one request per debounce interval. Stale responses from out-of-order
|
|
19
|
+
* requests are discarded.
|
|
20
|
+
*
|
|
21
|
+
* Returns full {@link SearchResult} objects suitable for use with
|
|
22
|
+
* `ResourceSearchCard`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useMcpServerSearch(options: UseMcpServerSearchOptions): UseMcpServerSearchReturn;
|
|
25
|
+
//# sourceMappingURL=useMcpServerSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMcpServerSearch.d.ts","sourceRoot":"","sources":["../../../src/mcp-server/hooks/useMcpServerSearch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAK/E,MAAM,WAAW,yBAAyB;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,wBAAwB,CAkC/F"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useStigmer } from "../../hooks";
|
|
4
|
+
const DEBOUNCE_MS = 300;
|
|
5
|
+
const DEFAULT_PAGE_SIZE = 20;
|
|
6
|
+
/**
|
|
7
|
+
* Debounced MCP server search scoped to a specific organization.
|
|
8
|
+
*
|
|
9
|
+
* On mount fetches all accessible MCP servers (empty query). Typing fires at
|
|
10
|
+
* most one request per debounce interval. Stale responses from out-of-order
|
|
11
|
+
* requests are discarded.
|
|
12
|
+
*
|
|
13
|
+
* Returns full {@link SearchResult} objects suitable for use with
|
|
14
|
+
* `ResourceSearchCard`.
|
|
15
|
+
*/
|
|
16
|
+
export function useMcpServerSearch(options) {
|
|
17
|
+
const { org, debounceMs = DEBOUNCE_MS, pageSize = DEFAULT_PAGE_SIZE } = options;
|
|
18
|
+
const stigmer = useStigmer();
|
|
19
|
+
const [query, setQuery] = useState("");
|
|
20
|
+
const [results, setResults] = useState([]);
|
|
21
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
22
|
+
const [error, setError] = useState(null);
|
|
23
|
+
const latestRequestId = useRef(0);
|
|
24
|
+
const debouncedQuery = useDebouncedValue(query, debounceMs);
|
|
25
|
+
useEffect(() => {
|
|
26
|
+
const requestId = ++latestRequestId.current;
|
|
27
|
+
setIsLoading(true);
|
|
28
|
+
setError(null);
|
|
29
|
+
stigmer.mcpServer
|
|
30
|
+
.list({ query: debouncedQuery, org, page: { num: 1, size: pageSize } })
|
|
31
|
+
.then((response) => {
|
|
32
|
+
if (requestId !== latestRequestId.current)
|
|
33
|
+
return;
|
|
34
|
+
setResults(response.entries);
|
|
35
|
+
})
|
|
36
|
+
.catch((err) => {
|
|
37
|
+
if (requestId !== latestRequestId.current)
|
|
38
|
+
return;
|
|
39
|
+
setError(err instanceof Error ? err.message : "Search failed");
|
|
40
|
+
})
|
|
41
|
+
.finally(() => {
|
|
42
|
+
if (requestId !== latestRequestId.current)
|
|
43
|
+
return;
|
|
44
|
+
setIsLoading(false);
|
|
45
|
+
});
|
|
46
|
+
}, [debouncedQuery, org, pageSize, stigmer]);
|
|
47
|
+
return { query, setQuery, results, isLoading, error };
|
|
48
|
+
}
|
|
49
|
+
function useDebouncedValue(value, delayMs) {
|
|
50
|
+
const [debounced, setDebounced] = useState(value);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const timer = setTimeout(() => setDebounced(value), delayMs);
|
|
53
|
+
return () => clearTimeout(timer);
|
|
54
|
+
}, [value, delayMs]);
|
|
55
|
+
return debounced;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=useMcpServerSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMcpServerSearch.js","sourceRoot":"","sources":["../../../src/mcp-server/hooks/useMcpServerSearch.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAgB7B;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAkC;IACnE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,WAAW,EAAE,QAAQ,GAAG,iBAAiB,EAAE,GAAG,OAAO,CAAC;IAChF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,eAAe,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,cAAc,GAAG,iBAAiB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;IAE5D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,EAAE,eAAe,CAAC,OAAO,CAAC;QAC5C,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,OAAO,CAAC,SAAS;aACd,IAAI,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC;aACtE,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjB,IAAI,SAAS,KAAK,eAAe,CAAC,OAAO;gBAAE,OAAO;YAClD,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;YACtB,IAAI,SAAS,KAAK,eAAe,CAAC,OAAO;gBAAE,OAAO;YAClD,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;QACjE,CAAC,CAAC;aACD,OAAO,CAAC,GAAG,EAAE;YACZ,IAAI,SAAS,KAAK,eAAe,CAAC,OAAO;gBAAE,OAAO;YAClD,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;IACP,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACxD,CAAC;AAED,SAAS,iBAAiB,CAAI,KAAQ,EAAE,OAAe;IACrD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC;QAC7D,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;IAErB,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-server/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-server/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stigmer/react",
|
|
3
|
+
"version": "0.0.36",
|
|
4
|
+
"description": "React hooks and embeddable components for the Stigmer platform",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": [
|
|
8
|
+
"*.css"
|
|
9
|
+
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/stigmer/stigmer.git",
|
|
13
|
+
"directory": "sdk/react"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"stigmer",
|
|
20
|
+
"react",
|
|
21
|
+
"sdk",
|
|
22
|
+
"ai-agents",
|
|
23
|
+
"embeddable",
|
|
24
|
+
"execution-streaming",
|
|
25
|
+
"hitl"
|
|
26
|
+
],
|
|
27
|
+
"main": "./index.js",
|
|
28
|
+
"types": "./index.d.ts",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./index.d.ts",
|
|
32
|
+
"import": "./index.js"
|
|
33
|
+
},
|
|
34
|
+
"./agent": {
|
|
35
|
+
"types": "./agent/index.d.ts",
|
|
36
|
+
"import": "./agent/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./session": {
|
|
39
|
+
"types": "./session/index.d.ts",
|
|
40
|
+
"import": "./session/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./agent-execution": {
|
|
43
|
+
"types": "./agent-execution/index.d.ts",
|
|
44
|
+
"import": "./agent-execution/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./catalog": {
|
|
47
|
+
"types": "./catalog/index.d.ts",
|
|
48
|
+
"import": "./catalog/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./skill": {
|
|
51
|
+
"types": "./skill/index.d.ts",
|
|
52
|
+
"import": "./skill/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./mcp-server": {
|
|
55
|
+
"types": "./mcp-server/index.d.ts",
|
|
56
|
+
"import": "./mcp-server/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./styles.css": "./styles.css"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@stigmer/theme": "0.0.36"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"react": "^19.0.0",
|
|
65
|
+
"react-dom": "^19.0.0",
|
|
66
|
+
"@stigmer/sdk": "0.0.36",
|
|
67
|
+
"@stigmer/protos": "0.0.36",
|
|
68
|
+
"@bufbuild/protobuf": "^2.0.0",
|
|
69
|
+
"@base-ui/react": "^1.0.0",
|
|
70
|
+
"class-variance-authority": "^0.7.0",
|
|
71
|
+
"lucide-react": ">=0.400.0",
|
|
72
|
+
"react-markdown": "^10.0.0",
|
|
73
|
+
"remark-gfm": "^4.0.0"
|
|
74
|
+
}
|
|
75
|
+
}
|
package/provider.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { Stigmer } from "@stigmer/sdk";
|
|
3
|
+
import type { ThemePresetId } from "@stigmer/theme";
|
|
4
|
+
export interface StigmerProviderProps {
|
|
5
|
+
/** A configured {@link Stigmer} client instance. */
|
|
6
|
+
readonly client: Stigmer;
|
|
7
|
+
readonly children: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Built-in theme preset to apply.
|
|
10
|
+
*
|
|
11
|
+
* Maps to a CSS class on the scoping container so the preset's
|
|
12
|
+
* design tokens take effect for all descendant Stigmer components.
|
|
13
|
+
* Omit (or pass `"default"`) to use the base Stigmer palette.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <StigmerProvider client={client} preset="corporate">
|
|
18
|
+
* <ChatWidget />
|
|
19
|
+
* </StigmerProvider>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
readonly preset?: ThemePresetId;
|
|
23
|
+
/**
|
|
24
|
+
* Additional CSS class names applied to the scoping container element.
|
|
25
|
+
* The container always includes the `stgm` class for style isolation.
|
|
26
|
+
*/
|
|
27
|
+
readonly className?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* React provider that distributes a {@link Stigmer} SDK client to
|
|
31
|
+
* descendant components via {@link StigmerContext}.
|
|
32
|
+
*
|
|
33
|
+
* Renders a `<div class="stgm">` container that scopes Stigmer's
|
|
34
|
+
* CSS reset and design tokens. External consumers importing
|
|
35
|
+
* `@stigmer/react/styles.css` get isolated styles that do not
|
|
36
|
+
* leak into the host application.
|
|
37
|
+
*
|
|
38
|
+
* Pass {@link StigmerProviderProps.preset | preset} to apply a
|
|
39
|
+
* built-in theme, or use {@link StigmerProviderProps.className | className}
|
|
40
|
+
* for custom styling.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* const client = useMemo(
|
|
45
|
+
* () => new Stigmer({ baseUrl, getAccessToken }),
|
|
46
|
+
* [getAccessToken],
|
|
47
|
+
* );
|
|
48
|
+
*
|
|
49
|
+
* <StigmerProvider client={client} preset="fintech">
|
|
50
|
+
* <App />
|
|
51
|
+
* </StigmerProvider>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare function StigmerProvider({ client, children, preset, className, }: StigmerProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGpD,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,QAAQ,EACR,MAAM,EACN,SAAS,GACV,EAAE,oBAAoB,2CAQtB"}
|