@stigmer/react 3.1.7 → 3.1.9
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/agent/AgentDetailView.d.ts +9 -1
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +15 -4
- package/agent/AgentDetailView.js.map +1 -1
- package/environment/EnvironmentListPanel.d.ts.map +1 -1
- package/environment/EnvironmentListPanel.js +11 -3
- package/environment/EnvironmentListPanel.js.map +1 -1
- package/environment/EnvironmentPicker.d.ts +17 -1
- package/environment/EnvironmentPicker.d.ts.map +1 -1
- package/environment/EnvironmentPicker.js +3 -2
- package/environment/EnvironmentPicker.js.map +1 -1
- package/environment/EnvironmentVariableEditor.d.ts.map +1 -1
- package/environment/EnvironmentVariableEditor.js +9 -3
- package/environment/EnvironmentVariableEditor.js.map +1 -1
- package/environment/index.d.ts +1 -0
- package/environment/index.d.ts.map +1 -1
- package/environment/index.js +1 -0
- package/environment/index.js.map +1 -1
- package/environment/shareRestriction.d.ts +13 -0
- package/environment/shareRestriction.d.ts.map +1 -0
- package/environment/shareRestriction.js +15 -0
- package/environment/shareRestriction.js.map +1 -0
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +12 -0
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/ToolRunGroup.js +4 -0
- package/execution/ToolRunGroup.js.map +1 -1
- package/execution/WriteBackCard.d.ts +14 -5
- package/execution/WriteBackCard.d.ts.map +1 -1
- package/execution/WriteBackCard.js +103 -32
- package/execution/WriteBackCard.js.map +1 -1
- package/execution/WriteBacksWidget.d.ts +1 -1
- package/execution/WriteBacksWidget.js +2 -2
- package/execution/WriteBacksWidget.js.map +1 -1
- package/execution/index.d.ts +2 -0
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +1 -0
- package/execution/index.js.map +1 -1
- package/execution/write-back-utils.d.ts +57 -0
- package/execution/write-back-utils.d.ts.map +1 -0
- package/execution/write-back-utils.js +81 -0
- package/execution/write-back-utils.js.map +1 -0
- package/index.d.ts +6 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -1
- package/index.js.map +1 -1
- package/internal/dev/dom-counter.d.ts.map +1 -1
- package/internal/dev/dom-counter.js +2 -2
- package/internal/dev/dom-counter.js.map +1 -1
- package/internal/dev/enabled.d.ts +7 -0
- package/internal/dev/enabled.d.ts.map +1 -0
- package/internal/dev/enabled.js +38 -0
- package/internal/dev/enabled.js.map +1 -0
- package/internal/dev/profiler-wrapper.d.ts +3 -3
- package/internal/dev/profiler-wrapper.d.ts.map +1 -1
- package/internal/dev/profiler-wrapper.js +5 -5
- package/internal/dev/profiler-wrapper.js.map +1 -1
- package/internal/dev/use-key-stability.d.ts.map +1 -1
- package/internal/dev/use-key-stability.js +2 -2
- package/internal/dev/use-key-stability.js.map +1 -1
- package/internal/dev/use-render-tracer.d.ts +2 -2
- package/internal/dev/use-render-tracer.d.ts.map +1 -1
- package/internal/dev/use-render-tracer.js +4 -4
- package/internal/dev/use-render-tracer.js.map +1 -1
- package/internal/dev/use-stream-rate.d.ts +2 -1
- package/internal/dev/use-stream-rate.d.ts.map +1 -1
- package/internal/dev/use-stream-rate.js +4 -3
- package/internal/dev/use-stream-rate.js.map +1 -1
- package/library/ResourceVisibilityControl.d.ts +3 -0
- package/library/ResourceVisibilityControl.d.ts.map +1 -1
- package/library/ResourceVisibilityControl.js +22 -8
- package/library/ResourceVisibilityControl.js.map +1 -1
- package/library/useUpdateVisibility.d.ts +5 -3
- package/library/useUpdateVisibility.d.ts.map +1 -1
- package/library/useUpdateVisibility.js +7 -2
- package/library/useUpdateVisibility.js.map +1 -1
- package/library/visibilityLevels.d.ts +17 -0
- package/library/visibilityLevels.d.ts.map +1 -1
- package/library/visibilityLevels.js +32 -0
- package/library/visibilityLevels.js.map +1 -1
- package/package.json +4 -4
- package/session/NewSessionViewer.d.ts +11 -1
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +28 -8
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +9 -2
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +26 -12
- package/session/SessionViewer.js.map +1 -1
- package/session/audience.d.ts +12 -4
- package/session/audience.d.ts.map +1 -1
- package/session/facets/ChangesTab.d.ts.map +1 -1
- package/session/facets/ChangesTab.js +3 -1
- package/session/facets/ChangesTab.js.map +1 -1
- package/session/useNewSessionFlow.d.ts +12 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +13 -1
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +13 -0
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +7 -2
- package/session/useSessionPageFlow.js.map +1 -1
- package/sharing/ShareAgentDialog.d.ts +57 -0
- package/sharing/ShareAgentDialog.d.ts.map +1 -0
- package/sharing/ShareAgentDialog.js +478 -0
- package/sharing/ShareAgentDialog.js.map +1 -0
- package/sharing/SharedAgentChat.d.ts +84 -0
- package/sharing/SharedAgentChat.d.ts.map +1 -0
- package/sharing/SharedAgentChat.js +80 -0
- package/sharing/SharedAgentChat.js.map +1 -0
- package/sharing/index.d.ts +18 -0
- package/sharing/index.d.ts.map +1 -0
- package/sharing/index.js +12 -0
- package/sharing/index.js.map +1 -0
- package/sharing/useAgentShare.d.ts +43 -0
- package/sharing/useAgentShare.d.ts.map +1 -0
- package/sharing/useAgentShare.js +54 -0
- package/sharing/useAgentShare.js.map +1 -0
- package/sharing/useRotateShareLink.d.ts +45 -0
- package/sharing/useRotateShareLink.d.ts.map +1 -0
- package/sharing/useRotateShareLink.js +58 -0
- package/sharing/useRotateShareLink.js.map +1 -0
- package/sharing/useSaveAgentShare.d.ts +105 -0
- package/sharing/useSaveAgentShare.d.ts.map +1 -0
- package/sharing/useSaveAgentShare.js +97 -0
- package/sharing/useSaveAgentShare.js.map +1 -0
- package/sharing/useShareAgent.d.ts +69 -0
- package/sharing/useShareAgent.d.ts.map +1 -0
- package/sharing/useShareAgent.js +42 -0
- package/sharing/useShareAgent.js.map +1 -0
- package/sharing/useShareToolReadiness.d.ts +52 -0
- package/sharing/useShareToolReadiness.d.ts.map +1 -0
- package/sharing/useShareToolReadiness.js +89 -0
- package/sharing/useShareToolReadiness.js.map +1 -0
- package/sharing/useSharedAgentProfile.d.ts +85 -0
- package/sharing/useSharedAgentProfile.d.ts.map +1 -0
- package/sharing/useSharedAgentProfile.js +73 -0
- package/sharing/useSharedAgentProfile.js.map +1 -0
- package/src/agent/AgentDetailView.tsx +28 -3
- package/src/environment/EnvironmentListPanel.tsx +47 -18
- package/src/environment/EnvironmentPicker.tsx +23 -2
- package/src/environment/EnvironmentVariableEditor.tsx +27 -17
- package/src/environment/__tests__/shareRestriction.test.ts +35 -0
- package/src/environment/index.ts +5 -0
- package/src/environment/shareRestriction.ts +22 -0
- package/src/execution/ToolCallItem.tsx +19 -1
- package/src/execution/ToolRunGroup.tsx +4 -0
- package/src/execution/WriteBackCard.tsx +285 -88
- package/src/execution/WriteBacksWidget.tsx +5 -5
- package/src/execution/__tests__/ToolCallItem.test.tsx +51 -0
- package/src/execution/__tests__/ToolRunGroup.test.tsx +22 -0
- package/src/execution/__tests__/WriteBackCard.test.tsx +64 -10
- package/src/execution/__tests__/write-back-utils.test.ts +135 -0
- package/src/execution/index.ts +7 -0
- package/src/execution/write-back-utils.ts +107 -0
- package/src/index.ts +38 -0
- package/src/internal/dev/__tests__/use-key-stability.test.ts +4 -0
- package/src/internal/dev/__tests__/use-render-tracer.test.ts +4 -0
- package/src/internal/dev/dom-counter.ts +2 -3
- package/src/internal/dev/enabled.ts +39 -0
- package/src/internal/dev/profiler-wrapper.tsx +5 -6
- package/src/internal/dev/use-key-stability.ts +2 -3
- package/src/internal/dev/use-render-tracer.ts +4 -5
- package/src/internal/dev/use-stream-rate.ts +4 -4
- package/src/library/ResourceVisibilityControl.tsx +23 -7
- package/src/library/__tests__/visibilityLevels.test.ts +33 -0
- package/src/library/useUpdateVisibility.ts +9 -3
- package/src/library/visibilityLevels.ts +36 -0
- package/src/session/NewSessionViewer.tsx +67 -31
- package/src/session/SessionViewer.tsx +67 -36
- package/src/session/__tests__/audienceWiring.test.tsx +99 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +75 -1
- package/src/session/__tests__/useSessionPageFlow.guest.test.tsx +112 -0
- package/src/session/audience.ts +12 -4
- package/src/session/facets/ChangesTab.tsx +6 -4
- package/src/session/useNewSessionFlow.ts +26 -1
- package/src/session/useSessionPageFlow.ts +24 -2
- package/src/sharing/ShareAgentDialog.tsx +1489 -0
- package/src/sharing/SharedAgentChat.tsx +283 -0
- package/src/sharing/__tests__/ShareAgentDialog.test.tsx +926 -0
- package/src/sharing/__tests__/SharedAgentChat.test.tsx +222 -0
- package/src/sharing/__tests__/useAgentShare.test.tsx +149 -0
- package/src/sharing/__tests__/useRotateShareLink.test.tsx +96 -0
- package/src/sharing/__tests__/useSaveAgentShare.test.tsx +241 -0
- package/src/sharing/__tests__/useShareAgent.test.tsx +131 -0
- package/src/sharing/__tests__/useShareToolReadiness.test.tsx +219 -0
- package/src/sharing/__tests__/useSharedAgentProfile.test.tsx +201 -0
- package/src/sharing/index.ts +32 -0
- package/src/sharing/useAgentShare.ts +91 -0
- package/src/sharing/useRotateShareLink.ts +81 -0
- package/src/sharing/useSaveAgentShare.ts +186 -0
- package/src/sharing/useShareAgent.tsx +107 -0
- package/src/sharing/useShareToolReadiness.ts +131 -0
- package/src/sharing/useSharedAgentProfile.ts +132 -0
- package/src/switch/Switch.tsx +97 -0
- package/src/switch/__tests__/Switch.test.tsx +107 -0
- package/src/switch/index.ts +2 -0
- package/styles.css +1 -1
- package/switch/Switch.d.ts +47 -0
- package/switch/Switch.d.ts.map +1 -0
- package/switch/Switch.js +41 -0
- package/switch/Switch.js.map +1 -0
- package/switch/index.d.ts +3 -0
- package/switch/index.d.ts.map +1 -0
- package/switch/index.js +2 -0
- package/switch/index.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedAgentChat.d.ts","sourceRoot":"","sources":["../../src/sharing/SharedAgentChat.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAM9D,yCAAyC;AACzC,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,6CAA6C;IAC7C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;IACjC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,eAAe,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,yDAAyD;IACzD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,eAAe,CAAC,EAC9B,GAAG,EACH,IAAI,EACJ,OAAO,EACP,WAAW,EACX,aAAoB,EACpB,gBAAgB,EAChB,eAA0B,EAC1B,SAAS,EACT,SAAS,GACV,EAAE,oBAAoB,2CAoItB"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { getUserMessage } from "@stigmer/sdk";
|
|
6
|
+
import { NewSessionViewer } from "../session/NewSessionViewer.js";
|
|
7
|
+
import { SessionViewer } from "../session/SessionViewer.js";
|
|
8
|
+
import { useSharedAgentProfile } from "./useSharedAgentProfile.js";
|
|
9
|
+
/**
|
|
10
|
+
* The complete shared-agent chat experience for anonymous visitors —
|
|
11
|
+
* the organism behind a shared agent's hosted page and embeds.
|
|
12
|
+
*
|
|
13
|
+
* Resolves the agent's public profile (name, description, icon, and
|
|
14
|
+
* the pinned deployment) via {@link useSharedAgentProfile}, then
|
|
15
|
+
* renders the session organisms with `audience="guest"`: a pure chat
|
|
16
|
+
* surface with no configuration pickers, pinned to the shared agent's
|
|
17
|
+
* default instance so the session binds synchronously on mount.
|
|
18
|
+
*
|
|
19
|
+
* Handles all states: loading, unavailable (the agent does not exist
|
|
20
|
+
* or is not shared — indistinguishable by design), transient errors
|
|
21
|
+
* (with retry), and the live chat.
|
|
22
|
+
*
|
|
23
|
+
* **Auth contract:** requires a `StigmerProvider` whose client can
|
|
24
|
+
* chat with this agent. For public shares (the default), pair with
|
|
25
|
+
* `createGuestAuth({ baseUrl, org, slug })` from `@stigmer/sdk` —
|
|
26
|
+
* the profile fetch is public and sessions use the guest token the
|
|
27
|
+
* provider mints on demand. For org-members-only shares, pass
|
|
28
|
+
* `sharingAudience="org"` and a client carrying the signed-in
|
|
29
|
+
* member's own token; the presentation stays the same pure chat.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```tsx
|
|
33
|
+
* const guestAuth = createGuestAuth({ baseUrl, org, slug });
|
|
34
|
+
* const client = useMemo(
|
|
35
|
+
* () => new Stigmer({ baseUrl, getAccessToken: guestAuth.getAccessToken }),
|
|
36
|
+
* [guestAuth],
|
|
37
|
+
* );
|
|
38
|
+
*
|
|
39
|
+
* <StigmerProvider client={client} colorMode="system">
|
|
40
|
+
* <SharedAgentChat org={org} slug={slug} />
|
|
41
|
+
* </StigmerProvider>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export function SharedAgentChat({ org, slug, heading, placeholder, showPoweredBy = true, onSessionCreated, sharingAudience = "public", linkToken, className, }) {
|
|
45
|
+
const { profile, isLoading, error, refetch } = useSharedAgentProfile(org, slug, {
|
|
46
|
+
audience: sharingAudience,
|
|
47
|
+
linkToken,
|
|
48
|
+
});
|
|
49
|
+
const [sessionId, setSessionId] = useState(null);
|
|
50
|
+
const [submitError, setSubmitError] = useState(null);
|
|
51
|
+
const handleSessionCreated = useCallback((id) => {
|
|
52
|
+
setSubmitError(null);
|
|
53
|
+
setSessionId(id);
|
|
54
|
+
onSessionCreated?.(id);
|
|
55
|
+
}, [onSessionCreated]);
|
|
56
|
+
if (isLoading) {
|
|
57
|
+
return (_jsx("div", { className: cn("flex h-full w-full items-center justify-center", className), "aria-busy": "true", "aria-label": "Loading agent", children: _jsx(LoadingSkeleton, {}) }));
|
|
58
|
+
}
|
|
59
|
+
if (error) {
|
|
60
|
+
return (_jsx("div", { className: cn("flex h-full w-full items-center justify-center", className), children: _jsx(StateCard, { title: "Something went wrong", message: getUserMessage(error), onRetry: refetch }) }));
|
|
61
|
+
}
|
|
62
|
+
// NOT_FOUND covers both "no such agent" and "sharing disabled" — the
|
|
63
|
+
// server keeps them indistinguishable so a revoked link leaks nothing.
|
|
64
|
+
// A profile without a default instance is equally unusable: there is
|
|
65
|
+
// no deployment to chat with, so it presents as the same state.
|
|
66
|
+
if (!profile || !profile.defaultInstanceId) {
|
|
67
|
+
return (_jsx("div", { className: cn("flex h-full w-full items-center justify-center", className), children: _jsx(StateCard, { title: "This agent isn't available", message: "The link may be incorrect, or sharing may have been turned off." }) }));
|
|
68
|
+
}
|
|
69
|
+
return (_jsxs("div", { className: cn("flex h-full w-full flex-col", className), children: [_jsxs("header", { className: "flex items-center gap-3 border-b border-border px-4 py-3", children: [profile.iconUrl ? (_jsx("img", { src: profile.iconUrl, alt: "", className: "size-8 rounded-md object-cover" })) : (_jsx("div", { "aria-hidden": "true", className: "flex size-8 items-center justify-center rounded-md bg-muted text-sm font-semibold text-muted-foreground", children: (profile.name || slug).charAt(0).toUpperCase() })), _jsxs("div", { className: "min-w-0", children: [_jsx("h1", { className: "truncate text-sm font-semibold text-foreground", children: profile.name || slug }), profile.description && (_jsx("p", { className: "truncate text-xs text-muted-foreground", children: profile.description }))] })] }), _jsx("div", { className: "min-h-0 flex-1", children: sessionId ? (_jsx(SessionViewer, { sessionId: sessionId, org: org, audience: "guest", enableGitHub: false })) : (_jsx(NewSessionViewer, { org: org, audience: "guest", initialAgentRef: { org, slug }, initialInstanceId: profile.defaultInstanceId, enableGitHub: false, heading: heading ?? `Chat with ${profile.name || slug}`, placeholder: placeholder ?? "Ask anything\u2026", onSessionCreated: handleSessionCreated, onError: setSubmitError, footerContent: submitError ? (_jsx("p", { role: "alert", className: "text-center text-xs text-destructive", children: submitError })) : undefined })) }), showPoweredBy && (_jsx("footer", { className: "border-t border-border px-4 py-2 text-center", children: _jsx("a", { href: "https://stigmer.ai", target: "_blank", rel: "noopener noreferrer", className: "text-[0.65rem] text-muted-foreground hover:text-foreground transition-colors", children: "Powered by Stigmer" }) }))] }));
|
|
70
|
+
}
|
|
71
|
+
// ---------------------------------------------------------------------------
|
|
72
|
+
// State presentation
|
|
73
|
+
// ---------------------------------------------------------------------------
|
|
74
|
+
function LoadingSkeleton() {
|
|
75
|
+
return (_jsxs("div", { className: "w-full max-w-sm space-y-3 px-6", children: [_jsx("div", { className: "mx-auto h-8 w-8 animate-pulse rounded-md bg-muted" }), _jsx("div", { className: "mx-auto h-4 w-2/3 animate-pulse rounded bg-muted" }), _jsx("div", { className: "mx-auto h-3 w-1/2 animate-pulse rounded bg-muted" })] }));
|
|
76
|
+
}
|
|
77
|
+
function StateCard({ title, message, onRetry, }) {
|
|
78
|
+
return (_jsxs("div", { className: "mx-6 w-full max-w-sm rounded-lg border border-border bg-card p-6 text-center shadow-sm", children: [_jsx("h2", { className: "text-base font-semibold text-foreground", children: title }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: message }), onRetry && (_jsx("button", { type: "button", onClick: onRetry, className: cn("mt-4 inline-flex items-center justify-center rounded-md px-4 py-2 text-sm font-medium", "bg-primary text-primary-foreground hover:bg-primary-hover", "transition-colors"), children: "Try again" }))] }));
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=SharedAgentChat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SharedAgentChat.js","sourceRoot":"","sources":["../../src/sharing/SharedAgentChat.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAsDnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,GAAG,EACH,IAAI,EACJ,OAAO,EACP,WAAW,EACX,aAAa,GAAG,IAAI,EACpB,gBAAgB,EAChB,eAAe,GAAG,QAAQ,EAC1B,SAAS,EACT,SAAS,GACY;IACrB,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,qBAAqB,CAAC,GAAG,EAAE,IAAI,EAAE;QAC9E,QAAQ,EAAE,eAAe;QACzB,SAAS;KACV,CAAC,CAAC;IACH,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAA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EAAC,8EAA8E,mCAGtF,GACG,CACV,IACG,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E,SAAS,eAAe;IACtB,OAAO,CACL,eAAK,SAAS,EAAC,gCAAgC,aAC7C,cAAK,SAAS,EAAC,mDAAmD,GAAG,EACrE,cAAK,SAAS,EAAC,kDAAkD,GAAG,EACpE,cAAK,SAAS,EAAC,kDAAkD,GAAG,IAChE,CACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,EACjB,KAAK,EACL,OAAO,EACP,OAAO,GAKR;IACC,OAAO,CACL,eAAK,SAAS,EAAC,wFAAwF,aACrG,aAAI,SAAS,EAAC,yCAAyC,YAAE,KAAK,GAAM,EACpE,YAAG,SAAS,EAAC,oCAAoC,YAAE,OAAO,GAAK,EAC9D,OAAO,IAAI,CACV,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,EAAE,CACX,uFAAuF,EACvF,2DAA2D,EAC3D,mBAAmB,CACpB,0BAGM,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { useSharedAgentProfile } from "./useSharedAgentProfile.js";
|
|
2
|
+
export type { UseSharedAgentProfileOptions, UseSharedAgentProfileReturn, } from "./useSharedAgentProfile.js";
|
|
3
|
+
export { SharedAgentChat } from "./SharedAgentChat.js";
|
|
4
|
+
export type { SharedAgentChatProps } from "./SharedAgentChat.js";
|
|
5
|
+
export { useAgentShare } from "./useAgentShare.js";
|
|
6
|
+
export type { UseAgentShareReturn } from "./useAgentShare.js";
|
|
7
|
+
export { sharingAudienceFromProto, useSaveAgentShare, } from "./useSaveAgentShare.js";
|
|
8
|
+
export type { AgentShareDraft, SharingAudience, UseSaveAgentShareReturn, } from "./useSaveAgentShare.js";
|
|
9
|
+
export { useRotateShareLink } from "./useRotateShareLink.js";
|
|
10
|
+
export type { UseRotateShareLinkReturn } from "./useRotateShareLink.js";
|
|
11
|
+
export { ShareAgentDialog } from "./ShareAgentDialog.js";
|
|
12
|
+
export type { ShareAgentDialogProps } from "./ShareAgentDialog.js";
|
|
13
|
+
export { useShareAgent } from "./useShareAgent.js";
|
|
14
|
+
export type { UseShareAgentArgs, UseShareAgentReturn, } from "./useShareAgent.js";
|
|
15
|
+
export { useShareToolReadiness } from "./useShareToolReadiness.js";
|
|
16
|
+
export type { ShareToolReadiness } from "./useShareToolReadiness.js";
|
|
17
|
+
export { validateOrigin, MAX_ALLOWED_ORIGINS } from "@stigmer/sdk";
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sharing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EACV,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EACL,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,eAAe,EACf,eAAe,EACf,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGrE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
package/sharing/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { useSharedAgentProfile } from "./useSharedAgentProfile.js";
|
|
2
|
+
export { SharedAgentChat } from "./SharedAgentChat.js";
|
|
3
|
+
export { useAgentShare } from "./useAgentShare.js";
|
|
4
|
+
export { sharingAudienceFromProto, useSaveAgentShare, } from "./useSaveAgentShare.js";
|
|
5
|
+
export { useRotateShareLink } from "./useRotateShareLink.js";
|
|
6
|
+
export { ShareAgentDialog } from "./ShareAgentDialog.js";
|
|
7
|
+
export { useShareAgent } from "./useShareAgent.js";
|
|
8
|
+
export { useShareToolReadiness } from "./useShareToolReadiness.js";
|
|
9
|
+
// Origin validation moved to @stigmer/sdk (framework-free, shared with the
|
|
10
|
+
// CLI); re-exported here so existing @stigmer/react importers keep working.
|
|
11
|
+
export { validateOrigin, MAX_ALLOWED_ORIGINS } from "@stigmer/sdk";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sharing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAKnE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EACL,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,2EAA2E;AAC3E,4EAA4E;AAC5E,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
2
|
+
import type { AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
3
|
+
/** Return value of {@link useAgentShare}. */
|
|
4
|
+
export interface UseAgentShareReturn {
|
|
5
|
+
/**
|
|
6
|
+
* The agent's canonical share, or `null` while loading, on error, or
|
|
7
|
+
* when the agent has never been shared. `share === null && !isLoading
|
|
8
|
+
* && !error` means "no share exists yet" — the first save creates it.
|
|
9
|
+
*/
|
|
10
|
+
readonly share: AgentShare | null;
|
|
11
|
+
/** `true` while the initial fetch or a refetch is in flight. */
|
|
12
|
+
readonly isLoading: boolean;
|
|
13
|
+
/** `true` while a background refetch is in flight and stale data is shown. */
|
|
14
|
+
readonly isRefetching: boolean;
|
|
15
|
+
/** Error from the last failed request, or `null` when healthy. */
|
|
16
|
+
readonly error: Error | null;
|
|
17
|
+
/** Discard cached data and re-fetch the share from the server. */
|
|
18
|
+
readonly refetch: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Data hook that loads an agent's canonical {@link AgentShare} — the
|
|
22
|
+
* resource carrying the hosted-chat channel configuration (audience,
|
|
23
|
+
* allowed origins, visitor messages, tool credentials, link token).
|
|
24
|
+
*
|
|
25
|
+
* Sharing is channel configuration, not agent behavior (decision 011):
|
|
26
|
+
* it lives in its own resource, so reading the agent alone can never
|
|
27
|
+
* tell whether it is shared. This hook is how owner-side surfaces (the
|
|
28
|
+
* Share dialog) resolve that state.
|
|
29
|
+
*
|
|
30
|
+
* Pass `null` for `agent` to skip fetching (stable no-op) — useful
|
|
31
|
+
* while the agent is still loading. A resolved `null` share means the
|
|
32
|
+
* agent has never been shared; the first save creates the share.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const { share, isLoading } = useAgentShare(agent);
|
|
37
|
+
*
|
|
38
|
+
* if (isLoading) return <Spinner />;
|
|
39
|
+
* const enabled = share?.spec?.enabled ?? false;
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useAgentShare(agent: Agent | null): UseAgentShareReturn;
|
|
43
|
+
//# sourceMappingURL=useAgentShare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentShare.d.ts","sourceRoot":"","sources":["../../src/sharing/useAgentShare.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAK1F,6CAA6C;AAC7C,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,kEAAkE;IAClE,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B;AAqBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,mBAAmB,CAsBtE"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { create } from "@bufbuild/protobuf";
|
|
3
|
+
import { GetAgentSharesByAgentRequestSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/io_pb";
|
|
4
|
+
import { useStigmer } from "../hooks.js";
|
|
5
|
+
import { useFetch } from "../internal/useFetch.js";
|
|
6
|
+
/**
|
|
7
|
+
* The canonical share among an agent's shares: the one whose slug equals
|
|
8
|
+
* the agent's slug (the server's default when a share is created without
|
|
9
|
+
* an explicit slug), falling back to the first entry. The data model
|
|
10
|
+
* allows N shares per agent (decision 011 D3); the console manages the
|
|
11
|
+
* canonical one in Phase A, so extra shares created via manifests never
|
|
12
|
+
* confuse the dialog.
|
|
13
|
+
*/
|
|
14
|
+
function pickCanonicalShare(shares, agentSlug) {
|
|
15
|
+
return (shares.find((share) => share.metadata?.slug === agentSlug) ??
|
|
16
|
+
shares[0] ??
|
|
17
|
+
null);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Data hook that loads an agent's canonical {@link AgentShare} — the
|
|
21
|
+
* resource carrying the hosted-chat channel configuration (audience,
|
|
22
|
+
* allowed origins, visitor messages, tool credentials, link token).
|
|
23
|
+
*
|
|
24
|
+
* Sharing is channel configuration, not agent behavior (decision 011):
|
|
25
|
+
* it lives in its own resource, so reading the agent alone can never
|
|
26
|
+
* tell whether it is shared. This hook is how owner-side surfaces (the
|
|
27
|
+
* Share dialog) resolve that state.
|
|
28
|
+
*
|
|
29
|
+
* Pass `null` for `agent` to skip fetching (stable no-op) — useful
|
|
30
|
+
* while the agent is still loading. A resolved `null` share means the
|
|
31
|
+
* agent has never been shared; the first save creates the share.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* const { share, isLoading } = useAgentShare(agent);
|
|
36
|
+
*
|
|
37
|
+
* if (isLoading) return <Spinner />;
|
|
38
|
+
* const enabled = share?.spec?.enabled ?? false;
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function useAgentShare(agent) {
|
|
42
|
+
const stigmer = useStigmer();
|
|
43
|
+
const agentId = agent?.metadata?.id ?? "";
|
|
44
|
+
const agentSlug = agent?.metadata?.slug ?? "";
|
|
45
|
+
const fetchFn = agentId
|
|
46
|
+
? async () => {
|
|
47
|
+
const result = await stigmer.agentShare.getByAgent(create(GetAgentSharesByAgentRequestSchema, { agentId }));
|
|
48
|
+
return pickCanonicalShare(result.items, agentSlug);
|
|
49
|
+
}
|
|
50
|
+
: null;
|
|
51
|
+
const { data: share, isLoading, isRefetching, error, refetch } = useFetch(fetchFn, [agentId, agentSlug, stigmer], null);
|
|
52
|
+
return { share, isLoading, isRefetching, error, refetch };
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=useAgentShare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAgentShare.js","sourceRoot":"","sources":["../../src/sharing/useAgentShare.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,kCAAkC,EAAE,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAoBnD;;;;;;;GAOG;AACH,SAAS,kBAAkB,CACzB,MAA6B,EAC7B,SAAiB;IAEjB,OAAO,CACL,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,KAAK,SAAS,CAAC;QAC1D,MAAM,CAAC,CAAC,CAAC;QACT,IAAI,CACL,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,aAAa,CAAC,KAAmB;IAC/C,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAE7B,MAAM,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,EAAE,CAAC;IAE9C,MAAM,OAAO,GAAG,OAAO;QACrB,CAAC,CAAC,KAAK,IAAI,EAAE;YACT,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,UAAU,CAChD,MAAM,CAAC,kCAAkC,EAAE,EAAE,OAAO,EAAE,CAAC,CACxD,CAAC;YACF,OAAO,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACrD,CAAC;QACH,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,QAAQ,CACvE,OAAO,EACP,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAC7B,IAAyB,CAC1B,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
2
|
+
/** Return value of {@link useRotateShareLink}. */
|
|
3
|
+
export interface UseRotateShareLinkReturn {
|
|
4
|
+
/**
|
|
5
|
+
* Rotate the share's link token via the `rotateShareLink` RPC.
|
|
6
|
+
* Resolves with the updated share, whose `status.shareLinkToken`
|
|
7
|
+
* carries the new token for building the fresh share URL.
|
|
8
|
+
*/
|
|
9
|
+
readonly rotateShareLink: () => Promise<AgentShare | undefined>;
|
|
10
|
+
/** `true` while the RPC is in flight. */
|
|
11
|
+
readonly isPending: boolean;
|
|
12
|
+
/** The last error from the RPC, or `null`. */
|
|
13
|
+
readonly error: Error | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Behavior hook that rotates a share's link token.
|
|
17
|
+
*
|
|
18
|
+
* Wraps the `stigmer.agentShare.rotateShareLink()` RPC (authorized by
|
|
19
|
+
* the share's `can_edit`) with loading and error state management. The
|
|
20
|
+
* server generates the token — there is nothing to supply — and the
|
|
21
|
+
* previous link stops working the moment the call resolves, including
|
|
22
|
+
* for visitors mid-conversation. The token lives in
|
|
23
|
+
* `status.shareLinkToken` (server-owned; this RPC is its sole writer),
|
|
24
|
+
* so it is never part of a share draft and survives every apply.
|
|
25
|
+
*
|
|
26
|
+
* The hook is stateless with respect to the share — adopt the returned
|
|
27
|
+
* share (or refetch) so the UI shows the new tokened link, matching the
|
|
28
|
+
* {@link useSaveAgentShare} convention.
|
|
29
|
+
*
|
|
30
|
+
* Pass `null` for `shareId` to produce a stable no-op (useful while the
|
|
31
|
+
* share is still loading, or before the agent has ever been shared —
|
|
32
|
+
* there is no token to rotate until a share exists).
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* const { rotateShareLink, isPending } = useRotateShareLink(
|
|
37
|
+
* share?.metadata?.id ?? null,
|
|
38
|
+
* );
|
|
39
|
+
*
|
|
40
|
+
* const updated = await rotateShareLink();
|
|
41
|
+
* // updated.status.shareLinkToken is the new token
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function useRotateShareLink(shareId: string | null): UseRotateShareLinkReturn;
|
|
45
|
+
//# sourceMappingURL=useRotateShareLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRotateShareLink.d.ts","sourceRoot":"","sources":["../../src/sharing/useRotateShareLink.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAK1F,kDAAkD;AAClD,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAChE,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GAAG,IAAI,GACrB,wBAAwB,CA0B1B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { create } from "@bufbuild/protobuf";
|
|
4
|
+
import { RotateShareLinkInputSchema } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/io_pb";
|
|
5
|
+
import { useStigmer } from "../hooks.js";
|
|
6
|
+
import { toError } from "../internal/toError.js";
|
|
7
|
+
/**
|
|
8
|
+
* Behavior hook that rotates a share's link token.
|
|
9
|
+
*
|
|
10
|
+
* Wraps the `stigmer.agentShare.rotateShareLink()` RPC (authorized by
|
|
11
|
+
* the share's `can_edit`) with loading and error state management. The
|
|
12
|
+
* server generates the token — there is nothing to supply — and the
|
|
13
|
+
* previous link stops working the moment the call resolves, including
|
|
14
|
+
* for visitors mid-conversation. The token lives in
|
|
15
|
+
* `status.shareLinkToken` (server-owned; this RPC is its sole writer),
|
|
16
|
+
* so it is never part of a share draft and survives every apply.
|
|
17
|
+
*
|
|
18
|
+
* The hook is stateless with respect to the share — adopt the returned
|
|
19
|
+
* share (or refetch) so the UI shows the new tokened link, matching the
|
|
20
|
+
* {@link useSaveAgentShare} convention.
|
|
21
|
+
*
|
|
22
|
+
* Pass `null` for `shareId` to produce a stable no-op (useful while the
|
|
23
|
+
* share is still loading, or before the agent has ever been shared —
|
|
24
|
+
* there is no token to rotate until a share exists).
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```tsx
|
|
28
|
+
* const { rotateShareLink, isPending } = useRotateShareLink(
|
|
29
|
+
* share?.metadata?.id ?? null,
|
|
30
|
+
* );
|
|
31
|
+
*
|
|
32
|
+
* const updated = await rotateShareLink();
|
|
33
|
+
* // updated.status.shareLinkToken is the new token
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export function useRotateShareLink(shareId) {
|
|
37
|
+
const stigmer = useStigmer();
|
|
38
|
+
const [isPending, setIsPending] = useState(false);
|
|
39
|
+
const [error, setError] = useState(null);
|
|
40
|
+
const rotateShareLink = useCallback(async () => {
|
|
41
|
+
if (!shareId)
|
|
42
|
+
return undefined;
|
|
43
|
+
setIsPending(true);
|
|
44
|
+
setError(null);
|
|
45
|
+
try {
|
|
46
|
+
return await stigmer.agentShare.rotateShareLink(create(RotateShareLinkInputSchema, { resourceId: shareId }));
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
setError(toError(err));
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
setIsPending(false);
|
|
54
|
+
}
|
|
55
|
+
}, [shareId, stigmer]);
|
|
56
|
+
return { rotateShareLink, isPending, error };
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=useRotateShareLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRotateShareLink.js","sourceRoot":"","sources":["../../src/sharing/useRotateShareLink.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,wDAAwD,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAgBjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAsB;IAEtB,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAe,IAAI,CAAC,CAAC;IAEvD,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,IAEvC,EAAE;QACF,IAAI,CAAC,OAAO;YAAE,OAAO,SAAS,CAAC;QAE/B,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEf,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,UAAU,CAAC,eAAe,CAC7C,MAAM,CAAC,0BAA0B,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAC5D,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,MAAM,GAAG,CAAC;QACZ,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAEvB,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Agent } from "@stigmer/protos/ai/stigmer/agentic/agent/v1/api_pb";
|
|
2
|
+
import type { AgentShare } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/api_pb";
|
|
3
|
+
import { AgentShareAudience } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
4
|
+
import type { ResourceRef } from "@stigmer/sdk";
|
|
5
|
+
/**
|
|
6
|
+
* Who can chat with a shared agent over its hosted link.
|
|
7
|
+
*
|
|
8
|
+
* - `"public"` — anyone with the link; visitors are anonymous guests.
|
|
9
|
+
* - `"org"` — signed-in members of the owning organization only.
|
|
10
|
+
* Membership is checked on every conversation turn, so access ends the
|
|
11
|
+
* moment a member leaves the org.
|
|
12
|
+
*/
|
|
13
|
+
export type SharingAudience = "public" | "org";
|
|
14
|
+
/**
|
|
15
|
+
* A complete share configuration to persist.
|
|
16
|
+
*
|
|
17
|
+
* Every field is required by design: saving **replaces the share's whole
|
|
18
|
+
* spec**, so a caller must always supply the full configuration. A
|
|
19
|
+
* partial type here would let a toggle change silently wipe
|
|
20
|
+
* `allowedOrigins`, `messages`, `environmentRefs`, or the `audience` —
|
|
21
|
+
* the required shape makes that mistake unrepresentable. (The rotatable
|
|
22
|
+
* link token is exempt: it is server-owned `status`, which survives
|
|
23
|
+
* every save verbatim.)
|
|
24
|
+
*/
|
|
25
|
+
export interface AgentShareDraft {
|
|
26
|
+
/** Whether hosted-chat access for the configured audience is enabled. */
|
|
27
|
+
readonly enabled: boolean;
|
|
28
|
+
/** Who can chat: anyone with the link, or org members only. */
|
|
29
|
+
readonly audience: SharingAudience;
|
|
30
|
+
/**
|
|
31
|
+
* Exact web origins allowed to embed the shared agent
|
|
32
|
+
* (e.g. `https://example.com`). Empty list = embeddable anywhere.
|
|
33
|
+
* Embedding is public-audience only.
|
|
34
|
+
*/
|
|
35
|
+
readonly allowedOrigins: readonly string[];
|
|
36
|
+
/** Owner-customized visitor refusal copy. Empty strings mean platform defaults. */
|
|
37
|
+
readonly messages: {
|
|
38
|
+
/** Shown when a visitor exceeds the message rate limit. */
|
|
39
|
+
readonly rateLimited: string;
|
|
40
|
+
/** Shown when the org's credits are exhausted (sharing fails closed). */
|
|
41
|
+
readonly unavailable: string;
|
|
42
|
+
/** Shown when a conversation hits its turn limit or inactivity timeout. */
|
|
43
|
+
readonly conversationEnded: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Org-shared environments whose values guest conversations receive —
|
|
47
|
+
* how a tool-using agent becomes chattable over a share link without
|
|
48
|
+
* touching its pristine default instance. Public-audience only (the
|
|
49
|
+
* proto CEL rule rejects bindings on org-audience shares, whose member
|
|
50
|
+
* sessions carry no share linkage in Phase A — decision 011 addendum).
|
|
51
|
+
*/
|
|
52
|
+
readonly environmentRefs: readonly ResourceRef[];
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Maps a proto {@link AgentShareAudience} to the SDK's string union.
|
|
56
|
+
* Unspecified means public by contract (a share created without an
|
|
57
|
+
* explicit audience is an anyone-with-link share).
|
|
58
|
+
*/
|
|
59
|
+
export declare function sharingAudienceFromProto(audience: AgentShareAudience | undefined): SharingAudience;
|
|
60
|
+
/** Return value of {@link useSaveAgentShare}. */
|
|
61
|
+
export interface UseSaveAgentShareReturn {
|
|
62
|
+
/**
|
|
63
|
+
* Persist the complete share configuration. Resolves with the
|
|
64
|
+
* persisted {@link AgentShare} — adopt it as the new baseline (its
|
|
65
|
+
* `status.shareLinkToken` carries the live link token).
|
|
66
|
+
*
|
|
67
|
+
* `current` is the share being edited, or `null` when the agent has
|
|
68
|
+
* never been shared — the save then creates the canonical share.
|
|
69
|
+
*/
|
|
70
|
+
readonly save: (draft: AgentShareDraft, current: AgentShare | null) => Promise<AgentShare | undefined>;
|
|
71
|
+
/** `true` while the RPC is in flight. */
|
|
72
|
+
readonly isPending: boolean;
|
|
73
|
+
/** The last error from the RPC, or `null`. */
|
|
74
|
+
readonly error: Error | null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Behavior hook that persists an agent's canonical share configuration.
|
|
78
|
+
*
|
|
79
|
+
* Commits via `stigmer.agentShare.apply()` — an idempotent upsert keyed
|
|
80
|
+
* on the share's `(org, slug)` identity — so one code path serves both
|
|
81
|
+
* the first enable (creates the share; the server authorizes on the
|
|
82
|
+
* referenced agent's `can_edit`) and every later edit. There is
|
|
83
|
+
* deliberately no create/update branching: the share slug is unique per
|
|
84
|
+
* org and defaults to the agent's slug, which makes apply-by-identity
|
|
85
|
+
* exact, and the generated `AgentShareInput` carries no `metadata.id`
|
|
86
|
+
* for an update to route by anyway.
|
|
87
|
+
*
|
|
88
|
+
* Disabling is a save with `enabled: false` — a config-preserving pause
|
|
89
|
+
* (decision 011 D1). Deleting the share is a separate, destructive
|
|
90
|
+
* operation this hook does not perform.
|
|
91
|
+
*
|
|
92
|
+
* Pass `null` for `agent` to produce a stable no-op (useful while the
|
|
93
|
+
* agent is still loading).
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```tsx
|
|
97
|
+
* const { share } = useAgentShare(agent);
|
|
98
|
+
* const { save, isPending } = useSaveAgentShare(agent);
|
|
99
|
+
*
|
|
100
|
+
* const persisted = await save({ ...draft, enabled: true }, share);
|
|
101
|
+
* // persisted.status.shareLinkToken is the live link token
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare function useSaveAgentShare(agent: Agent | null): UseSaveAgentShareReturn;
|
|
105
|
+
//# sourceMappingURL=useSaveAgentShare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSaveAgentShare.d.ts","sourceRoot":"","sources":["../../src/sharing/useSaveAgentShare.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oDAAoD,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yDAAyD,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAC9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,eAAe,CAAC;IACnC;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,EAAE;QACjB,2DAA2D;QAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,yEAAyE;QACzE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,2EAA2E;QAC3E,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;KACpC,CAAC;IACF;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,EAAE,SAAS,WAAW,EAAE,CAAC;CAClD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,GACvC,eAAe,CAEjB;AAQD,iDAAiD;AACjD,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,EAAE,CACb,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,UAAU,GAAG,IAAI,KACvB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IACrC,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,KAAK,GAAG,IAAI,GAClB,uBAAuB,CAyDzB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { AgentShareAudience } from "@stigmer/protos/ai/stigmer/agentic/agentshare/v1/spec_pb";
|
|
4
|
+
import { useStigmer } from "../hooks.js";
|
|
5
|
+
import { toError } from "../internal/toError.js";
|
|
6
|
+
/**
|
|
7
|
+
* Maps a proto {@link AgentShareAudience} to the SDK's string union.
|
|
8
|
+
* Unspecified means public by contract (a share created without an
|
|
9
|
+
* explicit audience is an anyone-with-link share).
|
|
10
|
+
*/
|
|
11
|
+
export function sharingAudienceFromProto(audience) {
|
|
12
|
+
return audience === AgentShareAudience.org ? "org" : "public";
|
|
13
|
+
}
|
|
14
|
+
function sharingAudienceToProto(audience) {
|
|
15
|
+
return audience === "org"
|
|
16
|
+
? AgentShareAudience.org
|
|
17
|
+
: AgentShareAudience.public;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Behavior hook that persists an agent's canonical share configuration.
|
|
21
|
+
*
|
|
22
|
+
* Commits via `stigmer.agentShare.apply()` — an idempotent upsert keyed
|
|
23
|
+
* on the share's `(org, slug)` identity — so one code path serves both
|
|
24
|
+
* the first enable (creates the share; the server authorizes on the
|
|
25
|
+
* referenced agent's `can_edit`) and every later edit. There is
|
|
26
|
+
* deliberately no create/update branching: the share slug is unique per
|
|
27
|
+
* org and defaults to the agent's slug, which makes apply-by-identity
|
|
28
|
+
* exact, and the generated `AgentShareInput` carries no `metadata.id`
|
|
29
|
+
* for an update to route by anyway.
|
|
30
|
+
*
|
|
31
|
+
* Disabling is a save with `enabled: false` — a config-preserving pause
|
|
32
|
+
* (decision 011 D1). Deleting the share is a separate, destructive
|
|
33
|
+
* operation this hook does not perform.
|
|
34
|
+
*
|
|
35
|
+
* Pass `null` for `agent` to produce a stable no-op (useful while the
|
|
36
|
+
* agent is still loading).
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```tsx
|
|
40
|
+
* const { share } = useAgentShare(agent);
|
|
41
|
+
* const { save, isPending } = useSaveAgentShare(agent);
|
|
42
|
+
*
|
|
43
|
+
* const persisted = await save({ ...draft, enabled: true }, share);
|
|
44
|
+
* // persisted.status.shareLinkToken is the live link token
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export function useSaveAgentShare(agent) {
|
|
48
|
+
const stigmer = useStigmer();
|
|
49
|
+
const [isPending, setIsPending] = useState(false);
|
|
50
|
+
const [error, setError] = useState(null);
|
|
51
|
+
const agentOrg = agent?.metadata?.org ?? "";
|
|
52
|
+
const agentSlug = agent?.metadata?.slug ?? "";
|
|
53
|
+
const agentName = agent?.metadata?.name ?? "";
|
|
54
|
+
const save = useCallback(async (draft, current) => {
|
|
55
|
+
if (!agentOrg || !agentSlug)
|
|
56
|
+
return undefined;
|
|
57
|
+
setIsPending(true);
|
|
58
|
+
setError(null);
|
|
59
|
+
try {
|
|
60
|
+
return await stigmer.agentShare.apply({
|
|
61
|
+
// Identity: the existing share's org/slug when editing (a
|
|
62
|
+
// manifest-created share may carry a non-default slug — apply
|
|
63
|
+
// with the agent's slug would create a SECOND share), the
|
|
64
|
+
// agent's when creating (the server's own D2 default, made
|
|
65
|
+
// explicit).
|
|
66
|
+
org: current?.metadata?.org || agentOrg,
|
|
67
|
+
slug: current?.metadata?.slug || agentSlug,
|
|
68
|
+
name: current?.metadata?.name || agentName || agentSlug,
|
|
69
|
+
agentRef: { org: agentOrg, slug: agentSlug },
|
|
70
|
+
enabled: draft.enabled,
|
|
71
|
+
// Written as the explicit enum value, never left unspecified —
|
|
72
|
+
// a share persisted as "public" can't be silently downgraded
|
|
73
|
+
// by tooling that relies on the unspecified-means-public rule.
|
|
74
|
+
audience: sharingAudienceToProto(draft.audience),
|
|
75
|
+
allowedOrigins: [...draft.allowedOrigins],
|
|
76
|
+
messages: {
|
|
77
|
+
rateLimited: draft.messages.rateLimited,
|
|
78
|
+
unavailable: draft.messages.unavailable,
|
|
79
|
+
conversationEnded: draft.messages.conversationEnded,
|
|
80
|
+
},
|
|
81
|
+
environmentRefs: draft.environmentRefs.map((ref) => ({
|
|
82
|
+
org: ref.org,
|
|
83
|
+
slug: ref.slug,
|
|
84
|
+
})),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
setError(toError(err));
|
|
89
|
+
throw err;
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
setIsPending(false);
|
|
93
|
+
}
|
|
94
|
+
}, [agentOrg, agentSlug, agentName, stigmer]);
|
|
95
|
+
return { save, isPending, error };
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=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