@stigmer/react 3.0.4 → 3.0.6
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 +1 -11
- package/agent/AgentDetailView.d.ts.map +1 -1
- package/agent/AgentDetailView.js +3 -6
- package/agent/AgentDetailView.js.map +1 -1
- package/agent-instance/AgentInstanceDetailPanel.d.ts.map +1 -1
- package/agent-instance/AgentInstanceDetailPanel.js +2 -6
- package/agent-instance/AgentInstanceDetailPanel.js.map +1 -1
- package/agent-instance/AgentInstanceList.d.ts.map +1 -1
- package/agent-instance/AgentInstanceList.js +2 -6
- package/agent-instance/AgentInstanceList.js.map +1 -1
- package/iam-policy/useCheckPermission.d.ts +3 -1
- package/iam-policy/useCheckPermission.d.ts.map +1 -1
- package/iam-policy/useCheckPermission.js +11 -15
- package/iam-policy/useCheckPermission.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/library/InstanceVisibilitySelector.d.ts +8 -15
- package/library/InstanceVisibilitySelector.d.ts.map +1 -1
- package/library/InstanceVisibilitySelector.js +11 -139
- package/library/InstanceVisibilitySelector.js.map +1 -1
- package/library/ResourceVisibilityControl.d.ts +52 -0
- package/library/ResourceVisibilityControl.d.ts.map +1 -0
- package/library/ResourceVisibilityControl.js +81 -0
- package/library/ResourceVisibilityControl.js.map +1 -0
- package/library/ScopeToggle.d.ts +1 -1
- package/library/ScopeToggle.js +1 -1
- package/library/VisibilitySelector.d.ts +75 -0
- package/library/VisibilitySelector.d.ts.map +1 -0
- package/library/VisibilitySelector.js +171 -0
- package/library/VisibilitySelector.js.map +1 -0
- package/library/index.d.ts +6 -2
- package/library/index.d.ts.map +1 -1
- package/library/index.js +3 -1
- package/library/index.js.map +1 -1
- package/library/useUpdateVisibility.d.ts +5 -4
- package/library/useUpdateVisibility.d.ts.map +1 -1
- package/library/useUpdateVisibility.js +5 -4
- package/library/useUpdateVisibility.js.map +1 -1
- package/library/visibilityLevels.d.ts +74 -0
- package/library/visibilityLevels.d.ts.map +1 -0
- package/library/visibilityLevels.js +91 -0
- package/library/visibilityLevels.js.map +1 -0
- package/mcp-server/McpServerDetailView.d.ts +1 -11
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +3 -6
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/package.json +4 -4
- package/resource-detail/types.d.ts +1 -1
- package/skill/SkillDetailView.d.ts +1 -11
- package/skill/SkillDetailView.d.ts.map +1 -1
- package/skill/SkillDetailView.js +3 -6
- package/skill/SkillDetailView.js.map +1 -1
- package/src/agent/AgentDetailView.tsx +10 -35
- package/src/agent-instance/AgentInstanceDetailPanel.tsx +2 -7
- package/src/agent-instance/AgentInstanceList.tsx +2 -7
- package/src/iam-policy/useCheckPermission.ts +10 -15
- package/src/index.ts +8 -2
- package/src/library/InstanceVisibilitySelector.tsx +19 -276
- package/src/library/ResourceVisibilityControl.tsx +145 -0
- package/src/library/ScopeToggle.tsx +1 -1
- package/src/library/VisibilitySelector.tsx +393 -0
- package/src/library/index.ts +16 -2
- package/src/library/useUpdateVisibility.ts +5 -4
- package/src/library/visibilityLevels.ts +144 -0
- package/src/mcp-server/McpServerDetailView.tsx +10 -35
- package/src/resource-detail/types.ts +1 -1
- package/src/skill/SkillDetailView.tsx +10 -35
- package/src/workflow/WorkflowDetailView.tsx +10 -34
- package/src/workflow/instance/WorkflowInstanceDetailPanel.tsx +2 -7
- package/src/workflow/instance/WorkflowInstanceList.tsx +2 -7
- package/styles.css +1 -1
- package/workflow/WorkflowDetailView.d.ts +1 -10
- package/workflow/WorkflowDetailView.d.ts.map +1 -1
- package/workflow/WorkflowDetailView.js +3 -6
- package/workflow/WorkflowDetailView.js.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.js +2 -6
- package/workflow/instance/WorkflowInstanceDetailPanel.js.map +1 -1
- package/workflow/instance/WorkflowInstanceList.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceList.js +2 -6
- package/workflow/instance/WorkflowInstanceList.js.map +1 -1
- package/library/VisibilityToggle.d.ts +0 -42
- package/library/VisibilityToggle.d.ts.map +0 -1
- package/library/VisibilityToggle.js +0 -89
- package/library/VisibilityToggle.js.map +0 -1
- package/src/library/VisibilityToggle.tsx +0 -247
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { cn } from "@stigmer/theme";
|
|
5
|
+
import { visibilityOption, } from "./visibilityLevels";
|
|
6
|
+
/**
|
|
7
|
+
* Segmented visibility selector — the single control for resource
|
|
8
|
+
* visibility across blueprints AND instances. The offered levels are pure
|
|
9
|
+
* data ({@link VisibilityLevelOption}); per-kind level sets live in
|
|
10
|
+
* `visibilityLevels.ts`, so this component carries no kind-specific logic.
|
|
11
|
+
*
|
|
12
|
+
* Escalating (moving right in the options list) shows an inline
|
|
13
|
+
* confirmation prompt colored by the target level's tone, since expanding
|
|
14
|
+
* access is consequential. De-escalating applies immediately.
|
|
15
|
+
*
|
|
16
|
+
* If the current visibility is not among the offered options (e.g. a
|
|
17
|
+
* platform-shared blueprint whose org no longer operates an
|
|
18
|
+
* IdentityProvider), its canonical option is rendered in place so the
|
|
19
|
+
* state stays legible and the user can still move to an offered level.
|
|
20
|
+
*
|
|
21
|
+
* WAI-ARIA Radio Group with roving tabindex, following the same visual
|
|
22
|
+
* pattern as {@link ScopeToggle}. All visual properties flow through
|
|
23
|
+
* `--stgm-*` design tokens.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <VisibilitySelector
|
|
28
|
+
* visibility={agent.metadata.visibility}
|
|
29
|
+
* options={blueprintVisibilityLevels({ deploymentMode, hasIdentityProvider })}
|
|
30
|
+
* onVisibilityChange={updateVisibility}
|
|
31
|
+
* isPending={isPending}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export function VisibilitySelector({ visibility, options, onVisibilityChange, isPending = false, disabled = false, ariaLabel = "Resource visibility", className, }) {
|
|
36
|
+
const [confirming, setConfirming] = useState(null);
|
|
37
|
+
const optionRefs = useRef([]);
|
|
38
|
+
const effectivelyDisabled = disabled || isPending;
|
|
39
|
+
// Keep the current state legible even when it is not offerable in the
|
|
40
|
+
// current context: render its canonical option as an extra segment.
|
|
41
|
+
const effectiveOptions = useMemo(() => {
|
|
42
|
+
if (options.some((o) => o.value === visibility))
|
|
43
|
+
return options;
|
|
44
|
+
return [...options, visibilityOption(visibility)];
|
|
45
|
+
}, [options, visibility]);
|
|
46
|
+
const isEscalation = useCallback((target) => {
|
|
47
|
+
const values = effectiveOptions.map((o) => o.value);
|
|
48
|
+
return values.indexOf(target) > values.indexOf(visibility);
|
|
49
|
+
}, [effectiveOptions, visibility]);
|
|
50
|
+
const handleSelect = useCallback((value) => {
|
|
51
|
+
if (value === visibility)
|
|
52
|
+
return;
|
|
53
|
+
if (isEscalation(value)) {
|
|
54
|
+
setConfirming(value);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setConfirming(null);
|
|
58
|
+
onVisibilityChange(value);
|
|
59
|
+
}, [visibility, onVisibilityChange, isEscalation]);
|
|
60
|
+
const confirmChange = useCallback(() => {
|
|
61
|
+
if (confirming === null)
|
|
62
|
+
return;
|
|
63
|
+
setConfirming(null);
|
|
64
|
+
onVisibilityChange(confirming);
|
|
65
|
+
}, [confirming, onVisibilityChange]);
|
|
66
|
+
const cancelConfirm = useCallback(() => {
|
|
67
|
+
setConfirming(null);
|
|
68
|
+
}, []);
|
|
69
|
+
const handleKeyDown = useCallback((e, index) => {
|
|
70
|
+
let nextIndex = null;
|
|
71
|
+
if (e.key === "ArrowRight" || e.key === "ArrowDown") {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
nextIndex = (index + 1) % effectiveOptions.length;
|
|
74
|
+
}
|
|
75
|
+
else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
|
|
76
|
+
e.preventDefault();
|
|
77
|
+
nextIndex =
|
|
78
|
+
(index - 1 + effectiveOptions.length) % effectiveOptions.length;
|
|
79
|
+
}
|
|
80
|
+
if (nextIndex !== null) {
|
|
81
|
+
optionRefs.current[nextIndex]?.focus();
|
|
82
|
+
handleSelect(effectiveOptions[nextIndex].value);
|
|
83
|
+
}
|
|
84
|
+
}, [effectiveOptions, handleSelect]);
|
|
85
|
+
const confirmingOption = confirming !== null
|
|
86
|
+
? effectiveOptions.find((o) => o.value === confirming)
|
|
87
|
+
: undefined;
|
|
88
|
+
return (_jsxs("div", { className: cn("inline-flex flex-col gap-1.5", className), children: [_jsx("div", { role: "radiogroup", "aria-label": ariaLabel, "aria-disabled": effectivelyDisabled || undefined, className: cn("inline-flex rounded-md bg-muted p-0.5", effectivelyDisabled && "pointer-events-none opacity-50"), children: effectiveOptions.map((option, index) => {
|
|
89
|
+
const isSelected = visibility === option.value;
|
|
90
|
+
return (_jsxs("button", { ref: (el) => {
|
|
91
|
+
optionRefs.current[index] = el;
|
|
92
|
+
}, type: "button", role: "radio", "aria-checked": isSelected, "aria-label": `${option.label}: ${option.description}`, tabIndex: isSelected ? 0 : -1, disabled: effectivelyDisabled, onClick: () => handleSelect(option.value), onKeyDown: (e) => handleKeyDown(e, index), className: cn("inline-flex cursor-pointer items-center gap-1 rounded-sm px-2.5 py-1 text-xs font-medium transition-colors", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", isSelected
|
|
93
|
+
? SELECTED_STYLES[option.tone]
|
|
94
|
+
: "text-muted-foreground hover:text-foreground"), children: [isPending && isSelected ? (_jsx("span", { className: "inline-block size-3 animate-spin rounded-full border-2 border-current border-t-transparent", "aria-hidden": "true" })) : (_jsx(VisibilityIcon, { tone: option.tone, className: "size-3" })), option.label] }, option.value));
|
|
95
|
+
}) }), confirming === null && (_jsx("p", { className: "text-[0.65rem] text-muted-foreground", children: effectiveOptions.find((o) => o.value === visibility)?.description })), confirmingOption?.confirmPrompt && (_jsxs("div", { className: cn("flex items-center gap-2 rounded-md border px-3 py-1.5 text-xs", PROMPT_STYLES[confirmingOption.tone].container), role: "alert", children: [_jsx("span", { className: PROMPT_STYLES[confirmingOption.tone].text, children: confirmingOption.confirmPrompt }), _jsx("button", { type: "button", onClick: confirmChange, className: cn("rounded px-2 py-0.5 text-xs font-medium text-white", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", PROMPT_STYLES[confirmingOption.tone].confirm), children: "Confirm" }), _jsx("button", { type: "button", onClick: cancelConfirm, className: cn("rounded px-2 py-0.5 text-xs font-medium", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", PROMPT_STYLES[confirmingOption.tone].cancel), children: "Cancel" })] }))] }));
|
|
96
|
+
}
|
|
97
|
+
const SELECTED_STYLES = {
|
|
98
|
+
private: "bg-amber-50 text-amber-800 shadow-sm dark:bg-amber-900/30 dark:text-amber-300",
|
|
99
|
+
org: "bg-blue-100 text-blue-800 shadow-sm dark:bg-blue-900/40 dark:text-blue-300",
|
|
100
|
+
platform: "bg-violet-100 text-violet-800 shadow-sm dark:bg-violet-900/40 dark:text-violet-300",
|
|
101
|
+
public: "bg-emerald-100 text-emerald-800 shadow-sm dark:bg-emerald-900/40 dark:text-emerald-300",
|
|
102
|
+
};
|
|
103
|
+
const PROMPT_STYLES = {
|
|
104
|
+
// Private never escalates, but the row keeps the Record total.
|
|
105
|
+
private: {
|
|
106
|
+
container: "border-amber-200 bg-amber-50 dark:border-amber-800/50 dark:bg-amber-950/30",
|
|
107
|
+
text: "text-amber-800 dark:text-amber-200",
|
|
108
|
+
confirm: "bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-500",
|
|
109
|
+
cancel: "text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",
|
|
110
|
+
},
|
|
111
|
+
org: {
|
|
112
|
+
container: "border-blue-200 bg-blue-50 dark:border-blue-800/50 dark:bg-blue-950/30",
|
|
113
|
+
text: "text-blue-800 dark:text-blue-200",
|
|
114
|
+
confirm: "bg-blue-600 hover:bg-blue-700 dark:bg-blue-600 dark:hover:bg-blue-500",
|
|
115
|
+
cancel: "text-blue-700 hover:text-blue-900 dark:text-blue-300 dark:hover:text-blue-100",
|
|
116
|
+
},
|
|
117
|
+
platform: {
|
|
118
|
+
container: "border-violet-200 bg-violet-50 dark:border-violet-800/50 dark:bg-violet-950/30",
|
|
119
|
+
text: "text-violet-800 dark:text-violet-200",
|
|
120
|
+
confirm: "bg-violet-600 hover:bg-violet-700 dark:bg-violet-600 dark:hover:bg-violet-500",
|
|
121
|
+
cancel: "text-violet-700 hover:text-violet-900 dark:text-violet-300 dark:hover:text-violet-100",
|
|
122
|
+
},
|
|
123
|
+
public: {
|
|
124
|
+
container: "border-amber-200 bg-amber-50 dark:border-amber-800/50 dark:bg-amber-950/30",
|
|
125
|
+
text: "text-amber-800 dark:text-amber-200",
|
|
126
|
+
confirm: "bg-amber-600 hover:bg-amber-700 dark:bg-amber-600 dark:hover:bg-amber-500",
|
|
127
|
+
cancel: "text-amber-700 hover:text-amber-900 dark:text-amber-300 dark:hover:text-amber-100",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
// ---------------------------------------------------------------------------
|
|
131
|
+
// Icons — inline SVGs following the SDK pattern (no icon library dependency)
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
/** Icon for a visibility tone; shared with {@link VisibilityBadge}. */
|
|
134
|
+
export function VisibilityIcon({ tone, className, }) {
|
|
135
|
+
switch (tone) {
|
|
136
|
+
case "org":
|
|
137
|
+
return _jsx(UsersIcon, { className: className });
|
|
138
|
+
case "platform":
|
|
139
|
+
return _jsx(BuildingsIcon, { className: className });
|
|
140
|
+
case "public":
|
|
141
|
+
return _jsx(GlobeIcon, { className: className });
|
|
142
|
+
default:
|
|
143
|
+
return _jsx(LockIcon, { className: className });
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function LockIcon({ className }) {
|
|
147
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3.5", y: "7", width: "9", height: "7", rx: "1.5" }), _jsx("path", { d: "M5.5 7V5a2.5 2.5 0 0 1 5 0v2" })] }));
|
|
148
|
+
}
|
|
149
|
+
function UsersIcon({ className }) {
|
|
150
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "6", cy: "5", r: "2.5" }), _jsx("path", { d: "M2 13c0-2.21 1.79-4 4-4s4 1.79 4 4" }), _jsx("circle", { cx: "11.5", cy: "5.5", r: "2" }), _jsx("path", { d: "M14 13c0-1.66-1.12-3-2.5-3-.5 0-1 .14-1.4.4" })] }));
|
|
151
|
+
}
|
|
152
|
+
function BuildingsIcon({ className }) {
|
|
153
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M2 14V4.5L6.5 2v12" }), _jsx("path", { d: "M6.5 6.5 14 8.5V14" }), _jsx("path", { d: "M2 14h12" }), _jsx("path", { d: "M4.25 6h.01M4.25 8.5h.01M4.25 11h.01M10.5 10.5h.01M10.5 12.5h.01" })] }));
|
|
154
|
+
}
|
|
155
|
+
function GlobeIcon({ className }) {
|
|
156
|
+
return (_jsxs("svg", { className: className, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("circle", { cx: "8", cy: "8", r: "6" }), _jsx("path", { d: "M2 8h12" }), _jsx("path", { d: "M8 2c1.66 1.46 2.6 3.63 2.6 6s-.94 4.54-2.6 6c-1.66-1.46-2.6-3.63-2.6-6s.94-4.54 2.6-6Z" })] }));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Read-only visibility indicator with a matching icon, covering all four
|
|
160
|
+
* levels (Private / Organization / Platform / Public).
|
|
161
|
+
*
|
|
162
|
+
* Rendered wherever the interactive {@link VisibilitySelector} is not
|
|
163
|
+
* available — for viewers who lack `can_edit`, and while a permission check
|
|
164
|
+
* is in flight — so a resource's visibility is always legible rather than
|
|
165
|
+
* silently blank.
|
|
166
|
+
*/
|
|
167
|
+
export function VisibilityBadge({ visibility, className, }) {
|
|
168
|
+
const option = visibilityOption(visibility);
|
|
169
|
+
return (_jsxs("span", { className: cn("inline-flex shrink-0 items-center gap-1 rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", className), children: [_jsx(VisibilityIcon, { tone: option.tone, className: "size-2.5" }), option.label] }));
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=VisibilitySelector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VisibilitySelector.js","sourceRoot":"","sources":["../../src/library/VisibilitySelector.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAEpC,OAAO,EACL,gBAAgB,GAEjB,MAAM,oBAAoB,CAAC;AAyB5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,UAAU,EACV,OAAO,EACP,kBAAkB,EAClB,SAAS,GAAG,KAAK,EACjB,QAAQ,G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CAAC,EAAE,SAAS,EAAmC;IAC/D,OAAO,CACL,eAAK,SAAS,EAAE,SAAS,EAAE,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,WAAW,EAAC,KAAK,EAAC,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,iBAAa,MAAM,aAChK,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,GAAG,EAC9B,eAAM,CAAC,EAAC,SAAS,GAAG,EACpB,eAAM,CAAC,EAAC,yFAAyF,GAAG,IAChG,CACP,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,SAAS,GAIV;IACC,MAAM,MAAM,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;IAC5C,OAAO,CACL,gBACE,SAAS,EAAE,EAAE,CACX,yHAAyH,EACzH,SAAS,CACV,aAED,KAAC,cAAc,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAC,UAAU,GAAG,EACzD,MAAM,CAAC,KAAK,IACR,CACR,CAAC;AACJ,CAAC"}
|
package/library/index.d.ts
CHANGED
|
@@ -23,8 +23,12 @@ export { useImportResource } from "./useImportResource";
|
|
|
23
23
|
export type { ImportFormat, ImportPreview, UseImportResourceReturn, } from "./useImportResource";
|
|
24
24
|
export { ImportResourceDialog } from "./ImportResourceDialog";
|
|
25
25
|
export type { ImportResourceDialogProps } from "./ImportResourceDialog";
|
|
26
|
-
export {
|
|
27
|
-
export type {
|
|
26
|
+
export { VisibilitySelector, VisibilityBadge } from "./VisibilitySelector";
|
|
27
|
+
export type { VisibilitySelectorProps } from "./VisibilitySelector";
|
|
28
|
+
export { blueprintVisibilityLevels, INSTANCE_VISIBILITY_LEVELS, visibilityLabel, visibilityOption, } from "./visibilityLevels";
|
|
29
|
+
export type { BlueprintVisibilityLevelsContext, VisibilityLevelOption, } from "./visibilityLevels";
|
|
30
|
+
export { ResourceVisibilityControl } from "./ResourceVisibilityControl";
|
|
31
|
+
export type { ResourceVisibilityControlProps } from "./ResourceVisibilityControl";
|
|
28
32
|
export { useUpdateVisibility } from "./useUpdateVisibility";
|
|
29
33
|
export type { VisibilityResourceKind, UseUpdateVisibilityReturn, } from "./useUpdateVisibility";
|
|
30
34
|
export { InstanceVisibilitySelector } from "./InstanceVisibilitySelector";
|
package/library/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EACV,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,cAAc,EACd,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,YAAY,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D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yB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAElF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EACV,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC"}
|
package/library/index.js
CHANGED
|
@@ -13,7 +13,9 @@ export { useApplyResource } from "./useApplyResource";
|
|
|
13
13
|
export { useExportResource } from "./useExportResource";
|
|
14
14
|
export { useImportResource } from "./useImportResource";
|
|
15
15
|
export { ImportResourceDialog } from "./ImportResourceDialog";
|
|
16
|
-
export {
|
|
16
|
+
export { VisibilitySelector, VisibilityBadge } from "./VisibilitySelector";
|
|
17
|
+
export { blueprintVisibilityLevels, INSTANCE_VISIBILITY_LEVELS, visibilityLabel, visibilityOption, } from "./visibilityLevels";
|
|
18
|
+
export { ResourceVisibilityControl } from "./ResourceVisibilityControl";
|
|
17
19
|
export { useUpdateVisibility } from "./useUpdateVisibility";
|
|
18
20
|
export { InstanceVisibilitySelector } from "./InstanceVisibilitySelector";
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
package/library/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/library/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA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wB,CAAC;AAGhC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EACL,yBAAyB,EACzB,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAM5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -16,9 +16,9 @@ export interface UseUpdateVisibilityReturn {
|
|
|
16
16
|
/**
|
|
17
17
|
* Behavior hook that updates the visibility of a resource.
|
|
18
18
|
*
|
|
19
|
-
* Supports blueprints (Agent, Workflow, Skill, MCP Server) with
|
|
20
|
-
* private/public
|
|
21
|
-
* WorkflowInstance) with
|
|
19
|
+
* Supports blueprints (Agent, Workflow, Skill, MCP Server) with the
|
|
20
|
+
* full private/org/public/platform spectrum, and instances
|
|
21
|
+
* (AgentInstance, WorkflowInstance) with private/org/public.
|
|
22
22
|
*
|
|
23
23
|
* Wraps the generated `stigmer.{kind}.updateVisibility()` SDK method
|
|
24
24
|
* with loading and error state management. The hook is stateless with
|
|
@@ -33,8 +33,9 @@ export interface UseUpdateVisibilityReturn {
|
|
|
33
33
|
* ```tsx
|
|
34
34
|
* const { updateVisibility, isPending } = useUpdateVisibility("workflow", workflow.metadata.id);
|
|
35
35
|
*
|
|
36
|
-
* <
|
|
36
|
+
* <VisibilitySelector
|
|
37
37
|
* visibility={workflow.metadata.visibility}
|
|
38
|
+
* options={options}
|
|
38
39
|
* onVisibilityChange={updateVisibility}
|
|
39
40
|
* isPending={isPending}
|
|
40
41
|
* />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateVisibility.d.ts","sourceRoot":"","sources":["../../src/library/useUpdateVisibility.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAK/F,8DAA8D;AAC9D,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,OAAO,GACP,WAAW,GACX,UAAU,GACV,eAAe,GACf,kBAAkB,CAAC;AAEvB,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,CACzB,UAAU,EAAE,qBAAqB,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED
|
|
1
|
+
{"version":3,"file":"useUpdateVisibility.d.ts","sourceRoot":"","sources":["../../src/library/useUpdateVisibility.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAK/F,8DAA8D;AAC9D,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,OAAO,GACP,WAAW,GACX,UAAU,GACV,eAAe,GACf,kBAAkB,CAAC;AAEvB,mDAAmD;AACnD,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,EAAE,CACzB,UAAU,EAAE,qBAAqB,KAC9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,yCAAyC;IACzC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,sBAAsB,EAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,yBAAyB,CAiD3B"}
|
|
@@ -7,9 +7,9 @@ import { toError } from "../internal/toError";
|
|
|
7
7
|
/**
|
|
8
8
|
* Behavior hook that updates the visibility of a resource.
|
|
9
9
|
*
|
|
10
|
-
* Supports blueprints (Agent, Workflow, Skill, MCP Server) with
|
|
11
|
-
* private/public
|
|
12
|
-
* WorkflowInstance) with
|
|
10
|
+
* Supports blueprints (Agent, Workflow, Skill, MCP Server) with the
|
|
11
|
+
* full private/org/public/platform spectrum, and instances
|
|
12
|
+
* (AgentInstance, WorkflowInstance) with private/org/public.
|
|
13
13
|
*
|
|
14
14
|
* Wraps the generated `stigmer.{kind}.updateVisibility()` SDK method
|
|
15
15
|
* with loading and error state management. The hook is stateless with
|
|
@@ -24,8 +24,9 @@ import { toError } from "../internal/toError";
|
|
|
24
24
|
* ```tsx
|
|
25
25
|
* const { updateVisibility, isPending } = useUpdateVisibility("workflow", workflow.metadata.id);
|
|
26
26
|
*
|
|
27
|
-
* <
|
|
27
|
+
* <VisibilitySelector
|
|
28
28
|
* visibility={workflow.metadata.visibility}
|
|
29
|
+
* options={options}
|
|
29
30
|
* onVisibilityChange={updateVisibility}
|
|
30
31
|
* isPending={isPending}
|
|
31
32
|
* />
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateVisibility.js","sourceRoot":"","sources":["../../src/library/useUpdateVisibility.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,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA0B9C
|
|
1
|
+
{"version":3,"file":"useUpdateVisibility.js","sourceRoot":"","sources":["../../src/library/useUpdateVisibility.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,2BAA2B,EAAE,MAAM,sDAAsD,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AA0B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAA4B,EAC5B,UAAyB;IAEzB,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,gBAAgB,GAAG,WAAW,CAClC,KAAK,EAAE,UAAiC,EAAE,EAAE;QAC1C,IAAI,CAAC,UAAU;YAAE,OAAO;QAExB,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,QAAQ,CAAC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|
|
3
|
+
* A selectable visibility level: label, explanation, and escalation copy.
|
|
4
|
+
*
|
|
5
|
+
* Options are always declared in escalation order (least to most exposed:
|
|
6
|
+
* private < org < platform < public); {@link VisibilitySelector} derives
|
|
7
|
+
* "is this an escalation?" from array position, and shows
|
|
8
|
+
* {@link confirmPrompt} before applying one.
|
|
9
|
+
*/
|
|
10
|
+
export interface VisibilityLevelOption {
|
|
11
|
+
readonly value: ApiResourceVisibility;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
/** One-line explanation shown under the selector for the current level. */
|
|
14
|
+
readonly description: string;
|
|
15
|
+
/**
|
|
16
|
+
* Inline confirmation question shown when the user escalates TO this
|
|
17
|
+
* level. Omitted for the least-exposed level (de-escalation never
|
|
18
|
+
* confirms — revoking access is always safe).
|
|
19
|
+
*/
|
|
20
|
+
readonly confirmPrompt?: string;
|
|
21
|
+
/** Color treatment for the selected segment and the confirmation prompt. */
|
|
22
|
+
readonly tone: "private" | "org" | "platform" | "public";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Inputs that gate which levels a blueprint selector offers.
|
|
26
|
+
*
|
|
27
|
+
* Mirrors the backend's per-kind `VisibilityConfig` plus runtime context the
|
|
28
|
+
* proto cannot know:
|
|
29
|
+
*
|
|
30
|
+
* - `deploymentMode`: the OSS Go backend (`local`) is single-user and
|
|
31
|
+
* performs no org/platform visibility gating, so only Private/Public are
|
|
32
|
+
* meaningful there.
|
|
33
|
+
* - `hasIdentityProvider`: `visibility_platform` requires the owning org to
|
|
34
|
+
* operate an IdentityProvider — the backend rejects it otherwise
|
|
35
|
+
* (`ValidateVisibilityStep`), so the option only renders when the signal
|
|
36
|
+
* is present (use `useSsoProvider`, the permission-free lookup).
|
|
37
|
+
*/
|
|
38
|
+
export interface BlueprintVisibilityLevelsContext {
|
|
39
|
+
readonly deploymentMode: "cloud" | "local";
|
|
40
|
+
readonly hasIdentityProvider: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The levels a blueprint (agent, skill, workflow, mcp_server) selector
|
|
44
|
+
* offers, in escalation order.
|
|
45
|
+
*
|
|
46
|
+
* Cloud: Private / Organization [/ Platform] / Public — Organization is the
|
|
47
|
+
* creation default (blueprints are shared org assets; Private is an explicit
|
|
48
|
+
* opt-in). Local: Private / Public.
|
|
49
|
+
*/
|
|
50
|
+
export declare function blueprintVisibilityLevels(context: BlueprintVisibilityLevelsContext): readonly VisibilityLevelOption[];
|
|
51
|
+
/**
|
|
52
|
+
* The levels an instance (agent_instance, workflow_instance) selector
|
|
53
|
+
* offers, in escalation order: Private / Organization / Public.
|
|
54
|
+
*
|
|
55
|
+
* Platform is deliberately absent — instances are tenant-isolated by
|
|
56
|
+
* design (each managed org instantiates shared blueprints inside its own
|
|
57
|
+
* boundary). Descriptions are execution-oriented because org visibility on
|
|
58
|
+
* an instance is about who can run it and see its executions.
|
|
59
|
+
*/
|
|
60
|
+
export declare const INSTANCE_VISIBILITY_LEVELS: readonly VisibilityLevelOption[];
|
|
61
|
+
/**
|
|
62
|
+
* Canonical option for a visibility value, independent of any kind's offered
|
|
63
|
+
* list. Used to render the current level even when it is not offerable in
|
|
64
|
+
* the current context (e.g. a platform-shared blueprint whose org no longer
|
|
65
|
+
* operates an IdentityProvider) — the state must stay legible.
|
|
66
|
+
*/
|
|
67
|
+
export declare function visibilityOption(visibility: ApiResourceVisibility): VisibilityLevelOption;
|
|
68
|
+
/**
|
|
69
|
+
* Human label for a visibility value — the one place list rows, badges, and
|
|
70
|
+
* detail panels resolve enum-to-text, so no surface ever falls through to
|
|
71
|
+
* "Private" (or "unknown") for org/platform.
|
|
72
|
+
*/
|
|
73
|
+
export declare function visibilityLabel(visibility: ApiResourceVisibility): string;
|
|
74
|
+
//# sourceMappingURL=visibilityLevels.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibilityLevels.d.ts","sourceRoot":"","sources":["../../src/library/visibilityLevels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAE/F;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,KAAK,EAAE,qBAAqB,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,2EAA2E;IAC3E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,4EAA4E;IAC5E,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC1D;AAiCD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,cAAc,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3C,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;CACvC;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,gCAAgC,GACxC,SAAS,qBAAqB,EAAE,CAOlC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,qBAAqB,EAUtE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,qBAAqB,GAChC,qBAAqB,CAWvB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,qBAAqB,GAAG,MAAM,CAEzE"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
2
|
+
const PRIVATE_OPTION = {
|
|
3
|
+
value: ApiResourceVisibility.visibility_private,
|
|
4
|
+
label: "Private",
|
|
5
|
+
description: "Only you can access",
|
|
6
|
+
tone: "private",
|
|
7
|
+
};
|
|
8
|
+
const ORG_OPTION = {
|
|
9
|
+
value: ApiResourceVisibility.visibility_org,
|
|
10
|
+
label: "Organization",
|
|
11
|
+
description: "All members of your organization",
|
|
12
|
+
confirmPrompt: "Make visible to all org members?",
|
|
13
|
+
tone: "org",
|
|
14
|
+
};
|
|
15
|
+
const PLATFORM_OPTION = {
|
|
16
|
+
value: ApiResourceVisibility.visibility_platform,
|
|
17
|
+
label: "Platform",
|
|
18
|
+
description: "All organizations managed by your platform",
|
|
19
|
+
confirmPrompt: "Share with every organization managed by your platform?",
|
|
20
|
+
tone: "platform",
|
|
21
|
+
};
|
|
22
|
+
const PUBLIC_OPTION = {
|
|
23
|
+
value: ApiResourceVisibility.visibility_public,
|
|
24
|
+
label: "Public",
|
|
25
|
+
description: "Anyone on Stigmer",
|
|
26
|
+
confirmPrompt: "Make visible to all authenticated users?",
|
|
27
|
+
tone: "public",
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The levels a blueprint (agent, skill, workflow, mcp_server) selector
|
|
31
|
+
* offers, in escalation order.
|
|
32
|
+
*
|
|
33
|
+
* Cloud: Private / Organization [/ Platform] / Public — Organization is the
|
|
34
|
+
* creation default (blueprints are shared org assets; Private is an explicit
|
|
35
|
+
* opt-in). Local: Private / Public.
|
|
36
|
+
*/
|
|
37
|
+
export function blueprintVisibilityLevels(context) {
|
|
38
|
+
if (context.deploymentMode === "local") {
|
|
39
|
+
return [PRIVATE_OPTION, PUBLIC_OPTION];
|
|
40
|
+
}
|
|
41
|
+
return context.hasIdentityProvider
|
|
42
|
+
? [PRIVATE_OPTION, ORG_OPTION, PLATFORM_OPTION, PUBLIC_OPTION]
|
|
43
|
+
: [PRIVATE_OPTION, ORG_OPTION, PUBLIC_OPTION];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The levels an instance (agent_instance, workflow_instance) selector
|
|
47
|
+
* offers, in escalation order: Private / Organization / Public.
|
|
48
|
+
*
|
|
49
|
+
* Platform is deliberately absent — instances are tenant-isolated by
|
|
50
|
+
* design (each managed org instantiates shared blueprints inside its own
|
|
51
|
+
* boundary). Descriptions are execution-oriented because org visibility on
|
|
52
|
+
* an instance is about who can run it and see its executions.
|
|
53
|
+
*/
|
|
54
|
+
export const INSTANCE_VISIBILITY_LEVELS = [
|
|
55
|
+
PRIVATE_OPTION,
|
|
56
|
+
{
|
|
57
|
+
...ORG_OPTION,
|
|
58
|
+
description: "All org members can view executions",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
...PUBLIC_OPTION,
|
|
62
|
+
description: "All authenticated users can view",
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
/**
|
|
66
|
+
* Canonical option for a visibility value, independent of any kind's offered
|
|
67
|
+
* list. Used to render the current level even when it is not offerable in
|
|
68
|
+
* the current context (e.g. a platform-shared blueprint whose org no longer
|
|
69
|
+
* operates an IdentityProvider) — the state must stay legible.
|
|
70
|
+
*/
|
|
71
|
+
export function visibilityOption(visibility) {
|
|
72
|
+
switch (visibility) {
|
|
73
|
+
case ApiResourceVisibility.visibility_org:
|
|
74
|
+
return ORG_OPTION;
|
|
75
|
+
case ApiResourceVisibility.visibility_platform:
|
|
76
|
+
return PLATFORM_OPTION;
|
|
77
|
+
case ApiResourceVisibility.visibility_public:
|
|
78
|
+
return PUBLIC_OPTION;
|
|
79
|
+
default:
|
|
80
|
+
return PRIVATE_OPTION;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Human label for a visibility value — the one place list rows, badges, and
|
|
85
|
+
* detail panels resolve enum-to-text, so no surface ever falls through to
|
|
86
|
+
* "Private" (or "unknown") for org/platform.
|
|
87
|
+
*/
|
|
88
|
+
export function visibilityLabel(visibility) {
|
|
89
|
+
return visibilityOption(visibility).label;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=visibilityLevels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visibilityLevels.js","sourceRoot":"","sources":["../../src/library/visibilityLevels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MA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EAAE,kCAAkC;KAChD;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAC9B,UAAiC;IAEjC,QAAQ,UAAU,EAAE,CAAC;QACnB,KAAK,qBAAqB,CAAC,cAAc;YACvC,OAAO,UAAU,CAAC;QACpB,KAAK,qBAAqB,CAAC,mBAAmB;YAC5C,OAAO,eAAe,CAAC;QACzB,KAAK,qBAAqB,CAAC,iBAAiB;YAC1C,OAAO,aAAa,CAAC;QACvB;YACE,OAAO,cAAc,CAAC;IAC1B,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,UAAiC;IAC/D,OAAO,gBAAgB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;AAC5C,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { McpServer } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/api_pb";
|
|
2
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
3
2
|
import type { DetailAction } from "../resource-detail/types";
|
|
4
3
|
/** Tab identifier for the MCP server capability panel. */
|
|
5
4
|
export type CapabilityTab = "tools" | "policies" | "resources";
|
|
@@ -21,15 +20,6 @@ export interface McpServerDetailViewProps {
|
|
|
21
20
|
name: string;
|
|
22
21
|
id: string;
|
|
23
22
|
}) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Called when the user toggles visibility via the inline control.
|
|
26
|
-
* When provided, the header renders an interactive
|
|
27
|
-
* {@link VisibilityToggle} instead of a read-only badge.
|
|
28
|
-
* When omitted, visibility is displayed as a static "Public" pill.
|
|
29
|
-
*/
|
|
30
|
-
readonly onVisibilityChange?: (v: ApiResourceVisibility) => void;
|
|
31
|
-
/** `true` while a visibility update RPC is in flight. */
|
|
32
|
-
readonly isVisibilityPending?: boolean;
|
|
33
23
|
/**
|
|
34
24
|
* Initial active capability tab. Defaults to `"tools"`.
|
|
35
25
|
* Useful for deep-linking or demo scenarios that need to start on
|
|
@@ -103,5 +93,5 @@ export interface McpServerDetailViewProps {
|
|
|
103
93
|
* <McpServerDetailView org="acme" slug="github" />
|
|
104
94
|
* ```
|
|
105
95
|
*/
|
|
106
|
-
export declare function McpServerDetailView({ org, slug, onResourceLoad,
|
|
96
|
+
export declare function McpServerDetailView({ org, slug, onResourceLoad, defaultCapabilityTab, defaultShowCredentialForm, credentialPoolValues, activeOrg, primaryAction, actions, editable, onResourceUpdated, className, }: McpServerDetailViewProps): import("react/jsx-runtime").JSX.Element;
|
|
107
97
|
//# sourceMappingURL=McpServerDetailView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"McpServerDetailView.d.ts","sourceRoot":"","sources":["../../src/mcp-server/McpServerDetailView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;
|
|
1
|
+
{"version":3,"file":"McpServerDetailView.d.ts","sourceRoot":"","sources":["../../src/mcp-server/McpServerDetailView.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AA0BxF,OAAO,KAAK,EAAE,YAAY,EAAsB,MAAM,0BAA0B,CAAC;AAQjF,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAC;AAE/D,6CAA6C;AAC7C,MAAM,WAAW,wBAAwB;IACvC,kDAAkD;IAClD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IACvE;;;;OAIG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC;IAC9C;;;;;;OAMG;IACH,QAAQ,CAAC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAC7C;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAC9B,GAAG,EAAE,MAAM,KACR,OAAO,cAAc,EAAE,WAAW,GAAG,SAAS,CAAC;IACpD;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC;IACtC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B;;OAEG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC;IACzD,qDAAqD;IACrD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,IAAI,EACJ,cAAc,EACd,oBAA8B,EAC9B,yBAAiC,EACjC,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,OAAO,EACP,QAAgB,EAChB,iBAAiB,EACjB,SAAS,GACV,EAAE,wBAAwB,2CAgb1B"}
|
|
@@ -6,7 +6,6 @@ import { getUserMessage, isRetryableError } from "@stigmer/sdk";
|
|
|
6
6
|
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
7
7
|
import { OAuthConnectionHealth } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/io_pb";
|
|
8
8
|
import { ValidationState } from "@stigmer/protos/ai/stigmer/agentic/mcpserver/v1/status_pb";
|
|
9
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
10
9
|
import { useMcpServer } from "./useMcpServer";
|
|
11
10
|
import { useUpdateMcpServer } from "./useUpdateMcpServer";
|
|
12
11
|
import { mcpServerToInput } from "./internal/mcpServerToInput";
|
|
@@ -18,8 +17,7 @@ import { useOrgOAuthApp } from "./useOrgOAuthApp";
|
|
|
18
17
|
import { OAuthAppForm } from "./OAuthAppForm";
|
|
19
18
|
import { ErrorMessage } from "../error/ErrorMessage";
|
|
20
19
|
import { EnvVarForm } from "../environment/EnvVarForm";
|
|
21
|
-
import {
|
|
22
|
-
import { PermissionGate } from "../iam-policy/PermissionGate";
|
|
20
|
+
import { ResourceVisibilityControl } from "../library/ResourceVisibilityControl";
|
|
23
21
|
import { Tabs } from "../tabs/Tabs";
|
|
24
22
|
import { ResourceDetailShell } from "../resource-detail/ResourceDetailShell";
|
|
25
23
|
import { Section } from "../resource-detail/Section";
|
|
@@ -52,7 +50,7 @@ import { InlineEditKeyValue } from "../inline-edit/InlineEditKeyValue";
|
|
|
52
50
|
* <McpServerDetailView org="acme" slug="github" />
|
|
53
51
|
* ```
|
|
54
52
|
*/
|
|
55
|
-
export function McpServerDetailView({ org, slug, onResourceLoad,
|
|
53
|
+
export function McpServerDetailView({ org, slug, onResourceLoad, defaultCapabilityTab = "tools", defaultShowCredentialForm = false, credentialPoolValues, activeOrg, primaryAction, actions, editable = false, onResourceUpdated, className, }) {
|
|
56
54
|
const { mcpServer, isLoading, error, refetch } = useMcpServer(org, slug);
|
|
57
55
|
const { update: updateMcpServer, isUpdating } = useUpdateMcpServer();
|
|
58
56
|
const saveMcpField = useCallback(async (field, value) => {
|
|
@@ -235,8 +233,7 @@ export function McpServerDetailView({ org, slug, onResourceLoad, onVisibilityCha
|
|
|
235
233
|
createdAt: specAudit?.createdAt ? timestampDate(specAudit.createdAt) : null,
|
|
236
234
|
updatedAt: specAudit?.updatedAt ? timestampDate(specAudit.updatedAt) : null,
|
|
237
235
|
};
|
|
238
|
-
const
|
|
239
|
-
const visibilityControl = onVisibilityChange && meta ? (_jsx(PermissionGate, { resource: { kind: "mcp_server", id: meta.id }, relation: "can_edit", fallback: visibilityBadge, children: _jsx(VisibilityToggle, { visibility: meta.visibility, onVisibilityChange: onVisibilityChange, isPending: isVisibilityPending }) })) : visibilityBadge;
|
|
236
|
+
const visibilityControl = meta ? (_jsx(ResourceVisibilityControl, { kind: "mcpServer", resourceId: meta.id, visibility: meta.visibility, org: meta.org || org, onChanged: refetch })) : undefined;
|
|
240
237
|
const headerMetaExtra = (_jsxs(_Fragment, { children: [status && _jsx(ValidationStateBadge, { state: status.validationState }), lastDiscoveredAt && (_jsxs(_Fragment, { children: [_jsx(Dot, {}), _jsxs("span", { children: ["Discovered ", formatDate(lastDiscoveredAt)] })] }))] }));
|
|
241
238
|
const headerBanner = status?.validationState === ValidationState.invalid &&
|
|
242
239
|
status.validationMessage ? (_jsx(ValidationBanner, { message: status.validationMessage })) : undefined;
|