@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
|
@@ -7,12 +7,10 @@ import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
|
7
7
|
import type { Skill } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/api_pb";
|
|
8
8
|
import type { GitProvenance } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/status_pb";
|
|
9
9
|
import { SkillState } from "@stigmer/protos/ai/stigmer/agentic/skill/v1/status_pb";
|
|
10
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
11
10
|
import { useSkill } from "./useSkill";
|
|
12
11
|
import { SkillFileBrowser } from "./SkillFileBrowser";
|
|
13
12
|
import { ErrorMessage } from "../error/ErrorMessage";
|
|
14
|
-
import {
|
|
15
|
-
import { PermissionGate } from "../iam-policy/PermissionGate";
|
|
13
|
+
import { ResourceVisibilityControl } from "../library/ResourceVisibilityControl";
|
|
16
14
|
import { MARKDOWN_COMPONENTS, REMARK_PLUGINS, stripFrontmatter } from "../internal/markdown-components";
|
|
17
15
|
import { ResourceDetailShell } from "../resource-detail/ResourceDetailShell";
|
|
18
16
|
import { Section } from "../resource-detail/Section";
|
|
@@ -46,15 +44,6 @@ export interface SkillDetailViewProps {
|
|
|
46
44
|
* Not called on error or not-found states.
|
|
47
45
|
*/
|
|
48
46
|
readonly onResourceLoad?: (meta: { name: string; id: string }) => void;
|
|
49
|
-
/**
|
|
50
|
-
* Called when the user toggles visibility via the inline control.
|
|
51
|
-
* When provided, the header renders an interactive
|
|
52
|
-
* {@link VisibilityToggle} instead of a read-only badge.
|
|
53
|
-
* When omitted, visibility is displayed as a static "Public" pill.
|
|
54
|
-
*/
|
|
55
|
-
readonly onVisibilityChange?: (v: ApiResourceVisibility) => void;
|
|
56
|
-
/** `true` while a visibility update RPC is in flight. */
|
|
57
|
-
readonly isVisibilityPending?: boolean;
|
|
58
47
|
/**
|
|
59
48
|
* Primary action rendered as a visible button in the header area.
|
|
60
49
|
*/
|
|
@@ -153,8 +142,6 @@ export function SkillDetailView({
|
|
|
153
142
|
slug,
|
|
154
143
|
version,
|
|
155
144
|
onResourceLoad,
|
|
156
|
-
onVisibilityChange,
|
|
157
|
-
isVisibilityPending,
|
|
158
145
|
primaryAction,
|
|
159
146
|
actions,
|
|
160
147
|
additionalTabs,
|
|
@@ -243,27 +230,15 @@ export function SkillDetailView({
|
|
|
243
230
|
statusLabel: status ? skillStateLabel(status.state) : undefined,
|
|
244
231
|
};
|
|
245
232
|
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
<PermissionGate
|
|
256
|
-
resource={{ kind: "skill", id: meta.id }}
|
|
257
|
-
relation="can_edit"
|
|
258
|
-
fallback={visibilityBadge}
|
|
259
|
-
>
|
|
260
|
-
<VisibilityToggle
|
|
261
|
-
visibility={meta.visibility}
|
|
262
|
-
onVisibilityChange={onVisibilityChange}
|
|
263
|
-
isPending={isVisibilityPending}
|
|
264
|
-
/>
|
|
265
|
-
</PermissionGate>
|
|
266
|
-
) : visibilityBadge;
|
|
233
|
+
const visibilityControl = meta ? (
|
|
234
|
+
<ResourceVisibilityControl
|
|
235
|
+
kind="skill"
|
|
236
|
+
resourceId={meta.id}
|
|
237
|
+
visibility={meta.visibility}
|
|
238
|
+
org={meta.org || org}
|
|
239
|
+
onChanged={refetch}
|
|
240
|
+
/>
|
|
241
|
+
) : undefined;
|
|
267
242
|
|
|
268
243
|
let tabContent: React.ReactNode;
|
|
269
244
|
if (activeAdditionalTab) {
|
|
@@ -5,7 +5,6 @@ import { cn } from "@stigmer/theme";
|
|
|
5
5
|
import { timestampDate } from "@bufbuild/protobuf/wkt";
|
|
6
6
|
import type { Workflow } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/api_pb";
|
|
7
7
|
import type { WorkflowInstance } from "@stigmer/protos/ai/stigmer/agentic/workflowinstance/v1/api_pb";
|
|
8
|
-
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
9
8
|
import { ValidationState } from "@stigmer/protos/ai/stigmer/agentic/workflow/v1/serverless/validation_pb";
|
|
10
9
|
import type { WorkflowInput } from "@stigmer/sdk";
|
|
11
10
|
import { useWorkflow } from "./useWorkflow";
|
|
@@ -23,9 +22,8 @@ import { WorkflowInstanceList } from "./instance/WorkflowInstanceList";
|
|
|
23
22
|
import { WorkflowVersionsTab } from "./WorkflowVersionsTab";
|
|
24
23
|
import { useWorkflowVersions } from "./useWorkflowVersions";
|
|
25
24
|
import { ErrorMessage } from "../error/ErrorMessage";
|
|
26
|
-
import {
|
|
25
|
+
import { ResourceVisibilityControl } from "../library/ResourceVisibilityControl";
|
|
27
26
|
import { formatDurationSec } from "./format-utils";
|
|
28
|
-
import { PermissionGate } from "../iam-policy/PermissionGate";
|
|
29
27
|
import { ResourceDetailShell } from "../resource-detail/ResourceDetailShell";
|
|
30
28
|
import { Section } from "../resource-detail/Section";
|
|
31
29
|
import { useDetailTabs } from "../resource-detail/useDetailTabs";
|
|
@@ -53,14 +51,6 @@ export interface WorkflowDetailViewProps {
|
|
|
53
51
|
* Provides the resource display name for breadcrumbs, document titles, etc.
|
|
54
52
|
*/
|
|
55
53
|
readonly onResourceLoad?: (meta: { name: string; id: string }) => void;
|
|
56
|
-
/**
|
|
57
|
-
* Called when the user toggles visibility via the inline control.
|
|
58
|
-
* When provided, the header renders an interactive
|
|
59
|
-
* {@link VisibilityToggle} instead of a read-only badge.
|
|
60
|
-
*/
|
|
61
|
-
readonly onVisibilityChange?: (v: ApiResourceVisibility) => void;
|
|
62
|
-
/** `true` while a visibility update RPC is in flight. */
|
|
63
|
-
readonly isVisibilityPending?: boolean;
|
|
64
54
|
/**
|
|
65
55
|
* Primary action rendered as a visible button in the header area.
|
|
66
56
|
*/
|
|
@@ -158,8 +148,6 @@ export function WorkflowDetailView({
|
|
|
158
148
|
org,
|
|
159
149
|
slug,
|
|
160
150
|
onResourceLoad,
|
|
161
|
-
onVisibilityChange,
|
|
162
|
-
isVisibilityPending,
|
|
163
151
|
primaryAction,
|
|
164
152
|
actions,
|
|
165
153
|
additionalTabs,
|
|
@@ -269,27 +257,15 @@ export function WorkflowDetailView({
|
|
|
269
257
|
<ValidationIndicator state={validationState} />
|
|
270
258
|
) : undefined;
|
|
271
259
|
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
<PermissionGate
|
|
282
|
-
resource={{ kind: "workflow", id: meta.id }}
|
|
283
|
-
relation="can_edit"
|
|
284
|
-
fallback={visibilityBadge}
|
|
285
|
-
>
|
|
286
|
-
<VisibilityToggle
|
|
287
|
-
visibility={meta.visibility}
|
|
288
|
-
onVisibilityChange={onVisibilityChange}
|
|
289
|
-
isPending={isVisibilityPending}
|
|
290
|
-
/>
|
|
291
|
-
</PermissionGate>
|
|
292
|
-
) : visibilityBadge;
|
|
260
|
+
const visibilityControl = meta ? (
|
|
261
|
+
<ResourceVisibilityControl
|
|
262
|
+
kind="workflow"
|
|
263
|
+
resourceId={meta.id}
|
|
264
|
+
visibility={meta.visibility}
|
|
265
|
+
org={meta.org || org}
|
|
266
|
+
onChanged={refetch}
|
|
267
|
+
/>
|
|
268
|
+
) : undefined;
|
|
293
269
|
|
|
294
270
|
let tabContent: React.ReactNode;
|
|
295
271
|
if (activeAdditionalTab) {
|
|
@@ -12,6 +12,7 @@ import { useUpdateWorkflowInstance } from "./useUpdateWorkflowInstance";
|
|
|
12
12
|
import { useDeleteWorkflowInstance } from "./useDeleteWorkflowInstance";
|
|
13
13
|
import { useUpdateVisibility } from "../../library/useUpdateVisibility";
|
|
14
14
|
import { InstanceVisibilitySelector } from "../../library/InstanceVisibilitySelector";
|
|
15
|
+
import { visibilityLabel } from "../../library/visibilityLevels";
|
|
15
16
|
import { PermissionGate } from "../../iam-policy/PermissionGate";
|
|
16
17
|
import { SharePanel } from "../../iam-policy/SharePanel";
|
|
17
18
|
import { EnvironmentPicker } from "../../environment/EnvironmentPicker";
|
|
@@ -259,7 +260,7 @@ export function WorkflowInstanceDetailPanel({
|
|
|
259
260
|
relation="can_edit"
|
|
260
261
|
fallback={
|
|
261
262
|
<span className="text-sm text-foreground">
|
|
262
|
-
{
|
|
263
|
+
{visibilityLabel(meta?.visibility ?? ApiResourceVisibility.visibility_private)}
|
|
263
264
|
</span>
|
|
264
265
|
}
|
|
265
266
|
>
|
|
@@ -343,12 +344,6 @@ export function WorkflowInstanceDetailPanel({
|
|
|
343
344
|
);
|
|
344
345
|
}
|
|
345
346
|
|
|
346
|
-
const VISIBILITY_LABELS: Record<number, string> = {
|
|
347
|
-
[ApiResourceVisibility.visibility_private]: "Private",
|
|
348
|
-
[ApiResourceVisibility.visibility_org]: "Organization",
|
|
349
|
-
[ApiResourceVisibility.visibility_public]: "Public",
|
|
350
|
-
};
|
|
351
|
-
|
|
352
347
|
function CloseIcon() {
|
|
353
348
|
return (
|
|
354
349
|
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" aria-hidden="true">
|
|
@@ -8,6 +8,7 @@ import { useWorkflowInstances } from "../useWorkflowInstances";
|
|
|
8
8
|
import { useEnvironmentList } from "../../environment/useEnvironmentList";
|
|
9
9
|
import { useUpdateVisibility } from "../../library/useUpdateVisibility";
|
|
10
10
|
import { InstanceVisibilitySelector } from "../../library/InstanceVisibilitySelector";
|
|
11
|
+
import { visibilityLabel } from "../../library/visibilityLevels";
|
|
11
12
|
import { PermissionGate } from "../../iam-policy/PermissionGate";
|
|
12
13
|
import { WorkflowInstanceEmptyState } from "./WorkflowInstanceEmptyState";
|
|
13
14
|
|
|
@@ -228,7 +229,7 @@ function InstanceRow({
|
|
|
228
229
|
relation="can_edit"
|
|
229
230
|
fallback={
|
|
230
231
|
<span className="text-xs text-muted-foreground">
|
|
231
|
-
{
|
|
232
|
+
{visibilityLabel(meta?.visibility ?? ApiResourceVisibility.visibility_private)}
|
|
232
233
|
</span>
|
|
233
234
|
}
|
|
234
235
|
>
|
|
@@ -282,12 +283,6 @@ function InstanceRow({
|
|
|
282
283
|
);
|
|
283
284
|
}
|
|
284
285
|
|
|
285
|
-
const VISIBILITY_LABELS: Record<number, string> = {
|
|
286
|
-
[ApiResourceVisibility.visibility_private]: "Private",
|
|
287
|
-
[ApiResourceVisibility.visibility_org]: "Organization",
|
|
288
|
-
[ApiResourceVisibility.visibility_public]: "Public",
|
|
289
|
-
};
|
|
290
|
-
|
|
291
286
|
function LoadingSkeleton() {
|
|
292
287
|
return (
|
|
293
288
|
<div className="space-y-2 py-4">
|