@stigmer/react 3.14.0 → 3.15.0
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/channel/AgentChannelsPanel.d.ts.map +1 -1
- package/channel/AgentChannelsPanel.js +5 -2
- package/channel/AgentChannelsPanel.js.map +1 -1
- package/channel/useChannelTemplateReadiness.d.ts.map +1 -1
- package/channel/useChannelTemplateReadiness.js +2 -0
- package/channel/useChannelTemplateReadiness.js.map +1 -1
- package/deployment-mode.d.ts +12 -6
- package/deployment-mode.d.ts.map +1 -1
- package/deployment-mode.js +12 -6
- package/deployment-mode.js.map +1 -1
- package/identity-account/AccountPreferencesPanel.d.ts +6 -4
- package/identity-account/AccountPreferencesPanel.d.ts.map +1 -1
- package/identity-account/AccountPreferencesPanel.js +5 -16
- package/identity-account/AccountPreferencesPanel.js.map +1 -1
- package/identity-account/useAccountExecutionDefaults.d.ts +6 -4
- package/identity-account/useAccountExecutionDefaults.d.ts.map +1 -1
- package/identity-account/useAccountExecutionDefaults.js +7 -7
- package/identity-account/useAccountExecutionDefaults.js.map +1 -1
- package/identity-account/useIdentityAccountGate.d.ts +9 -3
- package/identity-account/useIdentityAccountGate.d.ts.map +1 -1
- package/identity-account/useIdentityAccountGate.js +21 -22
- package/identity-account/useIdentityAccountGate.js.map +1 -1
- package/identity-account/useMyIdentityAccount.d.ts +8 -7
- package/identity-account/useMyIdentityAccount.d.ts.map +1 -1
- package/identity-account/useMyIdentityAccount.js +5 -4
- package/identity-account/useMyIdentityAccount.js.map +1 -1
- package/index.d.ts +6 -5
- package/index.d.ts.map +1 -1
- package/index.js +7 -4
- package/index.js.map +1 -1
- package/library/ResourceVisibilityControl.d.ts.map +1 -1
- package/library/ResourceVisibilityControl.js +5 -3
- package/library/ResourceVisibilityControl.js.map +1 -1
- package/library/useCanSetPublicVisibility.d.ts +12 -9
- package/library/useCanSetPublicVisibility.d.ts.map +1 -1
- package/library/useCanSetPublicVisibility.js +17 -14
- package/library/useCanSetPublicVisibility.js.map +1 -1
- package/library/visibilityLevels.d.ts +11 -8
- package/library/visibilityLevels.d.ts.map +1 -1
- package/library/visibilityLevels.js +5 -4
- package/library/visibilityLevels.js.map +1 -1
- package/mcp-server/StdioSandboxNotice.d.ts +5 -1
- package/mcp-server/StdioSandboxNotice.d.ts.map +1 -1
- package/mcp-server/StdioSandboxNotice.js +5 -1
- package/mcp-server/StdioSandboxNotice.js.map +1 -1
- package/package.json +4 -4
- package/provider.d.ts +10 -7
- package/provider.d.ts.map +1 -1
- package/provider.js.map +1 -1
- package/sharing/ShareAgentDialog.js +2 -1
- package/sharing/ShareAgentDialog.js.map +1 -1
- package/src/__tests__/deployment-mode.test.tsx +70 -0
- package/src/channel/AgentChannelsPanel.tsx +5 -2
- package/src/channel/useChannelTemplateReadiness.ts +2 -0
- package/src/deployment-mode.ts +12 -6
- package/src/identity-account/AccountPreferencesPanel.tsx +5 -38
- package/src/identity-account/__tests__/AccountPreferencesPanel.test.tsx +8 -5
- package/src/identity-account/__tests__/useAccountExecutionDefaults.test.tsx +9 -5
- package/src/identity-account/__tests__/useIdentityAccountGate.test.tsx +236 -0
- package/src/identity-account/useAccountExecutionDefaults.ts +7 -7
- package/src/identity-account/useIdentityAccountGate.ts +21 -22
- package/src/identity-account/useMyIdentityAccount.ts +8 -7
- package/src/index.ts +30 -5
- package/src/library/ResourceVisibilityControl.tsx +5 -3
- package/src/library/__tests__/useCanSetPublicVisibility.test.tsx +85 -0
- package/src/library/__tests__/visibilityLevels.test.ts +28 -0
- package/src/library/useCanSetPublicVisibility.ts +17 -14
- package/src/library/visibilityLevels.ts +11 -8
- package/src/mcp-server/StdioSandboxNotice.tsx +5 -1
- package/src/provider.tsx +10 -7
- package/src/sharing/ShareAgentDialog.tsx +2 -1
- package/src/usage/CreditRunwayIndicator.tsx +3 -0
- package/usage/CreditRunwayIndicator.d.ts.map +1 -1
- package/usage/CreditRunwayIndicator.js +3 -0
- package/usage/CreditRunwayIndicator.js.map +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ApiResourceVisibility } from "@stigmer/protos/ai/stigmer/commons/apiresource/enum_pb";
|
|
2
|
+
import type { DeploymentMode } from "@stigmer/sdk";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* A selectable visibility level: label, explanation, and escalation copy.
|
|
@@ -110,9 +111,10 @@ const PUBLIC_OPTION: VisibilityLevelOption = {
|
|
|
110
111
|
* Mirrors the backend's per-kind `VisibilityConfig` plus runtime context the
|
|
111
112
|
* proto cannot know:
|
|
112
113
|
*
|
|
113
|
-
* - `deploymentMode`: the
|
|
114
|
+
* - `deploymentMode`: the open-source edition (`local`) is single-user and
|
|
114
115
|
* performs no org/platform visibility gating, so only Private/Public are
|
|
115
|
-
* meaningful there.
|
|
116
|
+
* meaningful there. Enterprise and Cloud share the org/FGA model, so the
|
|
117
|
+
* full ladder is offered in both (editions program, DD-001).
|
|
116
118
|
* - `hasIdentityProvider`: `visibility_platform` requires the owning org to
|
|
117
119
|
* operate an IdentityProvider — the backend rejects it otherwise
|
|
118
120
|
* (`ValidateVisibilityStep`), so the option only renders when the signal
|
|
@@ -123,7 +125,7 @@ const PUBLIC_OPTION: VisibilityLevelOption = {
|
|
|
123
125
|
* `useCanSetPublicVisibility`, which is always `true` in local mode).
|
|
124
126
|
*/
|
|
125
127
|
export interface BlueprintVisibilityLevelsContext {
|
|
126
|
-
readonly deploymentMode:
|
|
128
|
+
readonly deploymentMode: DeploymentMode;
|
|
127
129
|
readonly hasIdentityProvider: boolean;
|
|
128
130
|
readonly canSetPublicVisibility: boolean;
|
|
129
131
|
}
|
|
@@ -144,9 +146,9 @@ function publicOption(canSetPublicVisibility: boolean): VisibilityLevelOption {
|
|
|
144
146
|
* The levels a blueprint (agent, skill, workflow, mcp_server) selector
|
|
145
147
|
* offers, in escalation order.
|
|
146
148
|
*
|
|
147
|
-
* Cloud: Private / Organization [/ Platform] / Public —
|
|
148
|
-
* creation default (blueprints are shared org assets;
|
|
149
|
-
* opt-in). Local: Private / Public.
|
|
149
|
+
* Cloud and Enterprise: Private / Organization [/ Platform] / Public —
|
|
150
|
+
* Organization is the creation default (blueprints are shared org assets;
|
|
151
|
+
* Private is an explicit opt-in). Local: Private / Public.
|
|
150
152
|
*/
|
|
151
153
|
export function blueprintVisibilityLevels(
|
|
152
154
|
context: BlueprintVisibilityLevelsContext,
|
|
@@ -206,12 +208,13 @@ export function instanceVisibilityLevels(
|
|
|
206
208
|
* the values at runtime. Secret reveal stays creator-only at every
|
|
207
209
|
* level.
|
|
208
210
|
*
|
|
209
|
-
* In `local` mode (
|
|
211
|
+
* In `local` mode (the open-source edition, single-user) sharing has no
|
|
210
212
|
* enforcement meaning, so no interactive levels are offered —
|
|
211
213
|
* {@link ResourceVisibilityControl} degrades to a read-only badge.
|
|
214
|
+
* Enterprise and Cloud enforce org sharing alike.
|
|
212
215
|
*/
|
|
213
216
|
export function environmentVisibilityLevels(
|
|
214
|
-
deploymentMode:
|
|
217
|
+
deploymentMode: DeploymentMode,
|
|
215
218
|
): readonly VisibilityLevelOption[] {
|
|
216
219
|
if (deploymentMode === "local") {
|
|
217
220
|
return [PRIVATE_OPTION];
|
|
@@ -15,7 +15,11 @@ type McpServerType = McpServerSpec["serverType"];
|
|
|
15
15
|
* execution create, and the cloud connect flow refuses to spawn them. This
|
|
16
16
|
* predicate identifies exactly that combination so the UI can explain the
|
|
17
17
|
* policy and its remediation (run the session on a local runner). HTTP
|
|
18
|
-
* servers and any transport
|
|
18
|
+
* servers and any transport outside Cloud return `false`.
|
|
19
|
+
*
|
|
20
|
+
* Stigmer-managed compute is a cloud-only facility (editions program,
|
|
21
|
+
* DD-001); whether an Enterprise sandbox fleet refuses stdio is that
|
|
22
|
+
* edition's ruling and is not assumed here.
|
|
19
23
|
*
|
|
20
24
|
* Pure and framework-free so it can be unit-tested without rendering.
|
|
21
25
|
*/
|
package/src/provider.tsx
CHANGED
|
@@ -38,15 +38,18 @@ export interface StigmerProviderProps {
|
|
|
38
38
|
/** React children rendered inside the provider scope. */
|
|
39
39
|
readonly children: ReactNode;
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
41
|
+
* Edition of the connected Stigmer backend.
|
|
42
42
|
*
|
|
43
|
-
* - `"local"` —
|
|
44
|
-
*
|
|
45
|
-
*
|
|
43
|
+
* - `"local"` — Stigmer, the open-source edition. Open-source-tier
|
|
44
|
+
* resources are served; Enterprise- and cloud-only kinds (IAM policies,
|
|
45
|
+
* identity providers, invitations) are hidden.
|
|
46
|
+
* - `"enterprise"` — Stigmer Enterprise, self-hosted. Open-source- and
|
|
47
|
+
* Enterprise-tier resources are served.
|
|
48
|
+
* - `"cloud"` — Stigmer Cloud. Every resource is served.
|
|
46
49
|
*
|
|
47
|
-
* Defaults to `"cloud"` so existing consumers see no change.
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
+
* Defaults to `"cloud"` so existing consumers see no change. Read it from
|
|
51
|
+
* the server with `client.platform.getServerInfo()` (its `deploymentMode`
|
|
52
|
+
* field) rather than guessing from a hostname; the Stigmer Console does.
|
|
50
53
|
*/
|
|
51
54
|
readonly deploymentMode?: DeploymentMode;
|
|
52
55
|
/**
|
|
@@ -834,7 +834,8 @@ function WhoPaysLine({
|
|
|
834
834
|
const mode = useDeploymentMode();
|
|
835
835
|
// An Organization's id equals its slug (see ApiResourceMetadata.id), so
|
|
836
836
|
// the share's org reference is directly usable as the billing org id.
|
|
837
|
-
//
|
|
837
|
+
// The wallet is a cloud-only facility (editions program, DD-001): neither
|
|
838
|
+
// the open-source nor the Enterprise edition has billing accounts.
|
|
838
839
|
const { account } = useBillingAccount(mode === "cloud" ? org : null);
|
|
839
840
|
|
|
840
841
|
const balance =
|
|
@@ -33,6 +33,9 @@ export function CreditRunwayIndicator({
|
|
|
33
33
|
const mode = useDeploymentMode();
|
|
34
34
|
const { activeOrg } = useOrg();
|
|
35
35
|
const orgId = activeOrg?.metadata?.id ?? "";
|
|
36
|
+
// The wallet is a cloud-only facility (editions program, DD-001):
|
|
37
|
+
// Enterprise customers bring their own provider keys and have no credit
|
|
38
|
+
// balance to run down, so only Cloud asks.
|
|
36
39
|
const { account } = useBillingAccount(mode === "cloud" ? orgId : "");
|
|
37
40
|
|
|
38
41
|
if (!account?.balance || daysInRange <= 0) return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditRunwayIndicator.d.ts","sourceRoot":"","sources":["../../src/usage/CreditRunwayIndicator.tsx"],"names":[],"mappings":"AAOA,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,uBAAuB,EACvB,WAAW,EACX,SAAS,GACV,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"CreditRunwayIndicator.d.ts","sourceRoot":"","sources":["../../src/usage/CreditRunwayIndicator.tsx"],"names":[],"mappings":"AAOA,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC;IACzC,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,uBAAuB,EACvB,WAAW,EACX,SAAS,GACV,EAAE,0BAA0B,kDA0C5B"}
|
|
@@ -18,6 +18,9 @@ export function CreditRunwayIndicator({ totalBillableCostMicros, daysInRange, cl
|
|
|
18
18
|
const mode = useDeploymentMode();
|
|
19
19
|
const { activeOrg } = useOrg();
|
|
20
20
|
const orgId = activeOrg?.metadata?.id ?? "";
|
|
21
|
+
// The wallet is a cloud-only facility (editions program, DD-001):
|
|
22
|
+
// Enterprise customers bring their own provider keys and have no credit
|
|
23
|
+
// balance to run down, so only Cloud asks.
|
|
21
24
|
const { account } = useBillingAccount(mode === "cloud" ? orgId : "");
|
|
22
25
|
if (!account?.balance || daysInRange <= 0)
|
|
23
26
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreditRunwayIndicator.js","sourceRoot":"","sources":["../../src/usage/CreditRunwayIndicator.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAY1D;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACpC,uBAAuB,EACvB,WAAW,EACX,SAAS,GACkB;IAC3B,MAAM,IAAI,GAAG,iBAAiB,EAAE,CAAC;IACjC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC;IAC/B,MAAM,KAAK,GAAG,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC;IAC5C,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAErE,IAAI,CAAC,OAAO,EAAE,OAAO,IAAI,WAAW,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvD,MAAM,SAAS,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAClD,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAEhC,MAAM,SAAS,GAAG,SAAS,GAAG,WAA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