@stigmer/react 3.12.0 → 3.12.2
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/access/ManageAccessDialog.d.ts.map +1 -1
- package/access/ManageAccessDialog.js +7 -2
- package/access/ManageAccessDialog.js.map +1 -1
- package/activity/format-relative-time.d.ts +11 -9
- package/activity/format-relative-time.d.ts.map +1 -1
- package/activity/format-relative-time.js +11 -9
- package/activity/format-relative-time.js.map +1 -1
- package/agent/steps/CapabilitiesStep.js +5 -2
- package/agent/steps/CapabilitiesStep.js.map +1 -1
- package/agent/steps/IdentityStep.d.ts.map +1 -1
- package/agent/steps/IdentityStep.js +6 -5
- package/agent/steps/IdentityStep.js.map +1 -1
- package/agent-instance/CreateAgentInstanceDialog.d.ts.map +1 -1
- package/agent-instance/CreateAgentInstanceDialog.js +10 -2
- package/agent-instance/CreateAgentInstanceDialog.js.map +1 -1
- package/api-key/ApiKeyCreatedAlert.d.ts.map +1 -1
- package/api-key/ApiKeyCreatedAlert.js +12 -20
- package/api-key/ApiKeyCreatedAlert.js.map +1 -1
- package/api-key/ApiKeyListPanel.d.ts.map +1 -1
- package/api-key/ApiKeyListPanel.js +3 -23
- package/api-key/ApiKeyListPanel.js.map +1 -1
- package/api-key/CreateApiKeyForm.d.ts.map +1 -1
- package/api-key/CreateApiKeyForm.js +6 -10
- package/api-key/CreateApiKeyForm.js.map +1 -1
- package/approval-defaults-context.d.ts +47 -0
- package/approval-defaults-context.d.ts.map +1 -0
- package/approval-defaults-context.js +27 -0
- package/approval-defaults-context.js.map +1 -0
- package/attachment/index.d.ts +2 -0
- package/attachment/index.d.ts.map +1 -1
- package/attachment/index.js +1 -0
- package/attachment/index.js.map +1 -1
- package/attachment/vision-preflight.d.ts +113 -0
- package/attachment/vision-preflight.d.ts.map +1 -0
- package/attachment/vision-preflight.js +143 -0
- package/attachment/vision-preflight.js.map +1 -0
- package/billing/AutoRechargeCard.d.ts.map +1 -1
- package/billing/AutoRechargeCard.js +3 -2
- package/billing/AutoRechargeCard.js.map +1 -1
- package/billing/BillingSection.d.ts.map +1 -1
- package/billing/BillingSection.js +3 -2
- package/billing/BillingSection.js.map +1 -1
- package/channel/ChannelConversationsDialog.d.ts.map +1 -1
- package/channel/ChannelConversationsDialog.js +5 -4
- package/channel/ChannelConversationsDialog.js.map +1 -1
- package/channel/ChannelCredentialsDialog.d.ts.map +1 -1
- package/channel/ChannelCredentialsDialog.js +9 -4
- package/channel/ChannelCredentialsDialog.js.map +1 -1
- package/channel/ChannelTemplatesDialog.d.ts.map +1 -1
- package/channel/ChannelTemplatesDialog.js +5 -4
- package/channel/ChannelTemplatesDialog.js.map +1 -1
- package/channel/ConnectSlackDialog.d.ts.map +1 -1
- package/channel/ConnectSlackDialog.js +9 -4
- package/channel/ConnectSlackDialog.js.map +1 -1
- package/channel/ConnectWhatsAppDialog.d.ts.map +1 -1
- package/channel/ConnectWhatsAppDialog.js +9 -4
- package/channel/ConnectWhatsAppDialog.js.map +1 -1
- package/channel/useChannelSessions.d.ts.map +1 -1
- package/channel/useChannelSessions.js.map +1 -1
- package/channel-app/ChannelAppDetailPanel.d.ts.map +1 -1
- package/channel-app/ChannelAppDetailPanel.js +8 -5
- package/channel-app/ChannelAppDetailPanel.js.map +1 -1
- package/channel-app/CreateChannelAppForm.d.ts.map +1 -1
- package/channel-app/CreateChannelAppForm.js +12 -7
- package/channel-app/CreateChannelAppForm.js.map +1 -1
- package/channel-app/internal.d.ts +0 -1
- package/channel-app/internal.d.ts.map +1 -1
- package/channel-app/internal.js +5 -10
- package/channel-app/internal.js.map +1 -1
- package/composer/ComposerToolbar.js +2 -1
- package/composer/ComposerToolbar.js.map +1 -1
- package/composer/SessionComposer.d.ts +1 -1
- package/composer/SessionComposer.d.ts.map +1 -1
- package/composer/SessionComposer.js +120 -13
- package/composer/SessionComposer.js.map +1 -1
- package/composer/icons.d.ts +0 -1
- package/composer/icons.d.ts.map +1 -1
- package/composer/icons.js +0 -3
- package/composer/icons.js.map +1 -1
- package/conversation/ConversationComposer.js +1 -1
- package/conversation/ConversationComposer.js.map +1 -1
- package/conversation/ConversationListPane.d.ts.map +1 -1
- package/conversation/ConversationListPane.js +3 -2
- package/conversation/ConversationListPane.js.map +1 -1
- package/cursor-accounts/MemberCoverageTable.js +3 -14
- package/cursor-accounts/MemberCoverageTable.js.map +1 -1
- package/dashboard/DashboardFailedRuns.d.ts.map +1 -1
- package/dashboard/DashboardFailedRuns.js +2 -14
- package/dashboard/DashboardFailedRuns.js.map +1 -1
- package/environment/CreateEnvironmentForm.d.ts.map +1 -1
- package/environment/CreateEnvironmentForm.js +4 -8
- package/environment/CreateEnvironmentForm.js.map +1 -1
- package/environment/EnvVarForm.d.ts.map +1 -1
- package/environment/EnvVarForm.js +2 -4
- package/environment/EnvVarForm.js.map +1 -1
- package/environment/EnvironmentVariableEditor.d.ts.map +1 -1
- package/environment/EnvironmentVariableEditor.js +5 -7
- package/environment/EnvironmentVariableEditor.js.map +1 -1
- package/execution/ArtifactApplyButton.d.ts.map +1 -1
- package/execution/ArtifactApplyButton.js +2 -4
- package/execution/ArtifactApplyButton.js.map +1 -1
- package/execution/ExecutionErrorNotice.d.ts +36 -0
- package/execution/ExecutionErrorNotice.d.ts.map +1 -0
- package/execution/ExecutionErrorNotice.js +39 -0
- package/execution/ExecutionErrorNotice.js.map +1 -0
- package/execution/FilePathLink.d.ts.map +1 -1
- package/execution/FilePathLink.js +5 -8
- package/execution/FilePathLink.js.map +1 -1
- package/execution/FileReviewCard.d.ts.map +1 -1
- package/execution/FileReviewCard.js +1 -6
- package/execution/FileReviewCard.js.map +1 -1
- package/execution/FollowUpInput.d.ts.map +1 -1
- package/execution/FollowUpInput.js +1 -3
- package/execution/FollowUpInput.js.map +1 -1
- package/execution/LivenessStatusLine.d.ts +40 -0
- package/execution/LivenessStatusLine.d.ts.map +1 -0
- package/execution/LivenessStatusLine.js +34 -0
- package/execution/LivenessStatusLine.js.map +1 -0
- package/execution/MessageEntry.d.ts.map +1 -1
- package/execution/MessageEntry.js +31 -3
- package/execution/MessageEntry.js.map +1 -1
- package/execution/MessageThread.d.ts +25 -0
- package/execution/MessageThread.d.ts.map +1 -1
- package/execution/MessageThread.js +51 -36
- package/execution/MessageThread.js.map +1 -1
- package/execution/SetupProgress.d.ts.map +1 -1
- package/execution/SetupProgress.js +1 -1
- package/execution/SetupProgress.js.map +1 -1
- package/execution/SubAgentSection.d.ts.map +1 -1
- package/execution/SubAgentSection.js +9 -7
- package/execution/SubAgentSection.js.map +1 -1
- package/execution/TerminalSession.d.ts +30 -0
- package/execution/TerminalSession.d.ts.map +1 -1
- package/execution/TerminalSession.js +37 -1
- package/execution/TerminalSession.js.map +1 -1
- package/execution/ToolCallDetail.d.ts +9 -0
- package/execution/ToolCallDetail.d.ts.map +1 -1
- package/execution/ToolCallDetail.js +16 -0
- package/execution/ToolCallDetail.js.map +1 -1
- package/execution/ToolCallItem.d.ts +20 -6
- package/execution/ToolCallItem.d.ts.map +1 -1
- package/execution/ToolCallItem.js +102 -29
- package/execution/ToolCallItem.js.map +1 -1
- package/execution/ToolRunGroup.d.ts.map +1 -1
- package/execution/ToolRunGroup.js +11 -11
- package/execution/ToolRunGroup.js.map +1 -1
- package/execution/WriteBackCard.d.ts.map +1 -1
- package/execution/WriteBackCard.js +5 -20
- package/execution/WriteBackCard.js.map +1 -1
- package/execution/index.d.ts +6 -2
- package/execution/index.d.ts.map +1 -1
- package/execution/index.js +3 -1
- package/execution/index.js.map +1 -1
- package/execution/tool-categories.d.ts +42 -7
- package/execution/tool-categories.d.ts.map +1 -1
- package/execution/tool-categories.js +38 -4
- package/execution/tool-categories.js.map +1 -1
- package/execution/tool-presenter.d.ts +17 -1
- package/execution/tool-presenter.d.ts.map +1 -1
- package/execution/tool-presenter.js +4 -1
- package/execution/tool-presenter.js.map +1 -1
- package/execution/useArtifactInspection.d.ts.map +1 -1
- package/execution/useArtifactInspection.js +4 -7
- package/execution/useArtifactInspection.js.map +1 -1
- package/execution/useCreateAgentExecution.d.ts +3 -2
- package/execution/useCreateAgentExecution.d.ts.map +1 -1
- package/execution/useCreateAgentExecution.js.map +1 -1
- package/iam-policy/GrantAccessForm.d.ts.map +1 -1
- package/iam-policy/GrantAccessForm.js +2 -4
- package/iam-policy/GrantAccessForm.js.map +1 -1
- package/iam-policy/OrgMembersPanel.d.ts.map +1 -1
- package/iam-policy/OrgMembersPanel.js +3 -5
- package/iam-policy/OrgMembersPanel.js.map +1 -1
- package/iam-policy/RoleSelector.d.ts.map +1 -1
- package/iam-policy/RoleSelector.js +7 -1
- package/iam-policy/RoleSelector.js.map +1 -1
- package/identity-provider/CreateIdentityProviderForm.d.ts.map +1 -1
- package/identity-provider/CreateIdentityProviderForm.js +6 -9
- package/identity-provider/CreateIdentityProviderForm.js.map +1 -1
- package/identity-provider/IdentityProviderDetailPanel.d.ts.map +1 -1
- package/identity-provider/IdentityProviderDetailPanel.js +17 -26
- package/identity-provider/IdentityProviderDetailPanel.js.map +1 -1
- package/identity-provider/IdentityProviderListPanel.d.ts.map +1 -1
- package/identity-provider/IdentityProviderListPanel.js +2 -4
- package/identity-provider/IdentityProviderListPanel.js.map +1 -1
- package/identity-provider/IdentityProviderWizard.d.ts.map +1 -1
- package/identity-provider/IdentityProviderWizard.js +8 -7
- package/identity-provider/IdentityProviderWizard.js.map +1 -1
- package/identity-provider/SsoLoginPrompt.js +5 -6
- package/identity-provider/SsoLoginPrompt.js.map +1 -1
- package/index.d.ts +9 -8
- package/index.d.ts.map +1 -1
- package/index.js +4 -4
- package/index.js.map +1 -1
- package/internal/DecisionButton.d.ts.map +1 -1
- package/internal/DecisionButton.js +1 -6
- package/internal/DecisionButton.js.map +1 -1
- package/internal/SpinnerIcon.d.ts +22 -0
- package/internal/SpinnerIcon.d.ts.map +1 -0
- package/internal/SpinnerIcon.js +23 -0
- package/internal/SpinnerIcon.js.map +1 -0
- package/internal/isUnimplemented.d.ts +17 -0
- package/internal/isUnimplemented.d.ts.map +1 -0
- package/internal/isUnimplemented.js +26 -0
- package/internal/isUnimplemented.js.map +1 -0
- package/internal/select-element-text.d.ts +11 -0
- package/internal/select-element-text.d.ts.map +1 -0
- package/internal/select-element-text.js +19 -0
- package/internal/select-element-text.js.map +1 -0
- package/internal/thread-card/ThreadCardShell.d.ts +27 -10
- package/internal/thread-card/ThreadCardShell.d.ts.map +1 -1
- package/internal/thread-card/ThreadCardShell.js +11 -5
- package/internal/thread-card/ThreadCardShell.js.map +1 -1
- package/internal/thread-card/glyphs.d.ts +11 -2
- package/internal/thread-card/glyphs.d.ts.map +1 -1
- package/internal/thread-card/glyphs.js +9 -3
- package/internal/thread-card/glyphs.js.map +1 -1
- package/internal/thread-card/index.d.ts +1 -1
- package/internal/thread-card/index.d.ts.map +1 -1
- package/internal/thread-card/index.js.map +1 -1
- package/internal/useCopyFeedback.d.ts +28 -0
- package/internal/useCopyFeedback.d.ts.map +1 -0
- package/internal/useCopyFeedback.js +40 -0
- package/internal/useCopyFeedback.js.map +1 -0
- package/invitation/InvitationCreatedAlert.d.ts.map +1 -1
- package/invitation/InvitationCreatedAlert.js +12 -19
- package/invitation/InvitationCreatedAlert.js.map +1 -1
- package/invitation/InvitationManager.d.ts.map +1 -1
- package/invitation/InvitationManager.js +14 -21
- package/invitation/InvitationManager.js.map +1 -1
- package/invitation/InvitationRedemption.d.ts.map +1 -1
- package/invitation/InvitationRedemption.js +2 -4
- package/invitation/InvitationRedemption.js.map +1 -1
- package/library/useExportResource.d.ts.map +1 -1
- package/library/useExportResource.js +16 -27
- package/library/useExportResource.js.map +1 -1
- package/manifest/ApplyManifestDialog.js +1 -1
- package/manifest/EditResourceYamlDialog.js +1 -1
- package/mcp-server/DefinitionDriftNotice.d.ts +42 -0
- package/mcp-server/DefinitionDriftNotice.d.ts.map +1 -0
- package/mcp-server/DefinitionDriftNotice.js +52 -0
- package/mcp-server/DefinitionDriftNotice.js.map +1 -0
- package/mcp-server/McpServerConnectDialog.js +8 -4
- package/mcp-server/McpServerConnectDialog.js.map +1 -1
- package/mcp-server/McpServerDetailView.d.ts.map +1 -1
- package/mcp-server/McpServerDetailView.js +47 -14
- package/mcp-server/McpServerDetailView.js.map +1 -1
- package/mcp-server/OAuthAppForm.d.ts.map +1 -1
- package/mcp-server/OAuthAppForm.js +2 -4
- package/mcp-server/OAuthAppForm.js.map +1 -1
- package/mcp-server/internal/definitionDrift.d.ts +39 -0
- package/mcp-server/internal/definitionDrift.d.ts.map +1 -0
- package/mcp-server/internal/definitionDrift.js +122 -0
- package/mcp-server/internal/definitionDrift.js.map +1 -0
- package/mcp-server/internal/mcpServerToInput.d.ts.map +1 -1
- package/mcp-server/internal/mcpServerToInput.js +3 -0
- package/mcp-server/internal/mcpServerToInput.js.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.d.ts.map +1 -1
- package/mcp-server/steps/EnvironmentAuthStep.js +8 -4
- package/mcp-server/steps/EnvironmentAuthStep.js.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.d.ts.map +1 -1
- package/mcp-server/steps/IdentityTransportStep.js +5 -4
- package/mcp-server/steps/IdentityTransportStep.js.map +1 -1
- package/mcp-server/useMcpServerConnect.d.ts +1 -1
- package/mcp-server/useMcpServerCredentials.d.ts +38 -10
- package/mcp-server/useMcpServerCredentials.d.ts.map +1 -1
- package/mcp-server/useMcpServerCredentials.js +50 -7
- package/mcp-server/useMcpServerCredentials.js.map +1 -1
- package/mcp-server/useMcpServerDefinitionDrift.d.ts +44 -0
- package/mcp-server/useMcpServerDefinitionDrift.d.ts.map +1 -0
- package/mcp-server/useMcpServerDefinitionDrift.js +61 -0
- package/mcp-server/useMcpServerDefinitionDrift.js.map +1 -0
- package/mcp-server/useOrgOAuthApp.d.ts +22 -0
- package/mcp-server/useOrgOAuthApp.d.ts.map +1 -1
- package/mcp-server/useOrgOAuthApp.js +39 -7
- package/mcp-server/useOrgOAuthApp.js.map +1 -1
- package/models/ModelRegistryContext.d.ts +7 -1
- package/models/ModelRegistryContext.d.ts.map +1 -1
- package/models/ModelRegistryContext.js.map +1 -1
- package/models/ModelSelector.js +9 -1
- package/models/ModelSelector.js.map +1 -1
- package/models/index.d.ts +2 -2
- package/models/index.d.ts.map +1 -1
- package/models/index.js +1 -1
- package/models/index.js.map +1 -1
- package/models/registry.d.ts +88 -6
- package/models/registry.d.ts.map +1 -1
- package/models/registry.js +133 -27
- package/models/registry.js.map +1 -1
- package/models/useModelRegistry.d.ts +7 -1
- package/models/useModelRegistry.d.ts.map +1 -1
- package/models/useModelRegistry.js +3 -2
- package/models/useModelRegistry.js.map +1 -1
- package/oauth-app/CreateOAuthAppForm.d.ts.map +1 -1
- package/oauth-app/CreateOAuthAppForm.js +4 -5
- package/oauth-app/CreateOAuthAppForm.js.map +1 -1
- package/oauth-app/OAuthAppDetailPanel.d.ts.map +1 -1
- package/oauth-app/OAuthAppDetailPanel.js +5 -6
- package/oauth-app/OAuthAppDetailPanel.js.map +1 -1
- package/organization/CreateOrganizationForm.d.ts.map +1 -1
- package/organization/CreateOrganizationForm.js +5 -9
- package/organization/CreateOrganizationForm.js.map +1 -1
- package/organization/OrgProfilePanel.d.ts.map +1 -1
- package/organization/OrgProfilePanel.js +7 -16
- package/organization/OrgProfilePanel.js.map +1 -1
- package/package.json +4 -4
- package/platform-client/CreatePlatformClientForm.d.ts.map +1 -1
- package/platform-client/CreatePlatformClientForm.js +5 -6
- package/platform-client/CreatePlatformClientForm.js.map +1 -1
- package/platform-client/PlatformClientDetailPanel.d.ts.map +1 -1
- package/platform-client/PlatformClientDetailPanel.js +6 -7
- package/platform-client/PlatformClientDetailPanel.js.map +1 -1
- package/platform-client/PlatformClientListPanel.d.ts.map +1 -1
- package/platform-client/PlatformClientListPanel.js +2 -4
- package/platform-client/PlatformClientListPanel.js.map +1 -1
- package/platform-client/PlatformClientSecretAlert.d.ts.map +1 -1
- package/platform-client/PlatformClientSecretAlert.js +18 -25
- package/platform-client/PlatformClientSecretAlert.js.map +1 -1
- package/provider.d.ts +34 -1
- package/provider.d.ts.map +1 -1
- package/provider.js +14 -7
- package/provider.js.map +1 -1
- package/resource-creation/WizardNav.d.ts.map +1 -1
- package/resource-creation/WizardNav.js +2 -4
- package/resource-creation/WizardNav.js.map +1 -1
- package/resource-detail/ConfirmDialog.js +1 -1
- package/resource-detail/useCopyResource.d.ts +4 -3
- package/resource-detail/useCopyResource.d.ts.map +1 -1
- package/resource-detail/useCopyResource.js +10 -19
- package/resource-detail/useCopyResource.js.map +1 -1
- package/schedule/ScheduleDetailView.d.ts.map +1 -1
- package/schedule/ScheduleDetailView.js +2 -4
- package/schedule/ScheduleDetailView.js.map +1 -1
- package/schedule/ScheduleForm.d.ts.map +1 -1
- package/schedule/ScheduleForm.js +6 -7
- package/schedule/ScheduleForm.js.map +1 -1
- package/session/NewSessionViewer.d.ts +52 -2
- package/session/NewSessionViewer.d.ts.map +1 -1
- package/session/NewSessionViewer.js +21 -6
- package/session/NewSessionViewer.js.map +1 -1
- package/session/SessionViewer.d.ts +63 -2
- package/session/SessionViewer.d.ts.map +1 -1
- package/session/SessionViewer.js +43 -17
- package/session/SessionViewer.js.map +1 -1
- package/session/audience.d.ts +17 -0
- package/session/audience.d.ts.map +1 -1
- package/session/index.d.ts +2 -1
- package/session/index.d.ts.map +1 -1
- package/session/index.js.map +1 -1
- package/session/run-config.d.ts +50 -0
- package/session/run-config.d.ts.map +1 -0
- package/session/run-config.js +15 -0
- package/session/run-config.js.map +1 -0
- package/session/useNewSessionFlow.d.ts +11 -0
- package/session/useNewSessionFlow.d.ts.map +1 -1
- package/session/useNewSessionFlow.js +29 -2
- package/session/useNewSessionFlow.js.map +1 -1
- package/session/useSessionConversation.d.ts +11 -9
- package/session/useSessionConversation.d.ts.map +1 -1
- package/session/useSessionConversation.js +2 -0
- package/session/useSessionConversation.js.map +1 -1
- package/session/useSessionPageFlow.d.ts +18 -4
- package/session/useSessionPageFlow.d.ts.map +1 -1
- package/session/useSessionPageFlow.js +33 -6
- package/session/useSessionPageFlow.js.map +1 -1
- package/session/useSessionPanel.d.ts +37 -2
- package/session/useSessionPanel.d.ts.map +1 -1
- package/session/useSessionPanel.js +44 -10
- package/session/useSessionPanel.js.map +1 -1
- package/settings/ApiKeysSection.d.ts.map +1 -1
- package/settings/ApiKeysSection.js +3 -2
- package/settings/ApiKeysSection.js.map +1 -1
- package/settings/ChannelAppsSection.d.ts.map +1 -1
- package/settings/ChannelAppsSection.js +3 -2
- package/settings/ChannelAppsSection.js.map +1 -1
- package/settings/EnvironmentsSection.js +5 -3
- package/settings/EnvironmentsSection.js.map +1 -1
- package/settings/IdentityProvidersSection.d.ts.map +1 -1
- package/settings/IdentityProvidersSection.js +3 -2
- package/settings/IdentityProvidersSection.js.map +1 -1
- package/settings/InvitationsSection.d.ts.map +1 -1
- package/settings/InvitationsSection.js +3 -1
- package/settings/InvitationsSection.js.map +1 -1
- package/settings/MembersSection.d.ts.map +1 -1
- package/settings/MembersSection.js +3 -1
- package/settings/MembersSection.js.map +1 -1
- package/settings/OAuthAppsSection.d.ts.map +1 -1
- package/settings/OAuthAppsSection.js +3 -2
- package/settings/OAuthAppsSection.js.map +1 -1
- package/settings/OrgProfileSection.d.ts.map +1 -1
- package/settings/OrgProfileSection.js +3 -2
- package/settings/OrgProfileSection.js.map +1 -1
- package/settings/PlatformClientsSection.d.ts.map +1 -1
- package/settings/PlatformClientsSection.js +3 -2
- package/settings/PlatformClientsSection.js.map +1 -1
- package/settings/UsageSection.d.ts.map +1 -1
- package/settings/UsageSection.js +3 -1
- package/settings/UsageSection.js.map +1 -1
- package/sharing/ShareAgentDialog.d.ts.map +1 -1
- package/sharing/ShareAgentDialog.js +18 -7
- package/sharing/ShareAgentDialog.js.map +1 -1
- package/sidebar/chrome.d.ts +3 -4
- package/sidebar/chrome.d.ts.map +1 -1
- package/sidebar/chrome.js +5 -4
- package/sidebar/chrome.js.map +1 -1
- package/skill/SkillDiffDialog.js +1 -1
- package/skill/useSkillVersions.d.ts.map +1 -1
- package/skill/useSkillVersions.js +1 -9
- package/skill/useSkillVersions.js.map +1 -1
- package/src/access/ManageAccessDialog.tsx +10 -4
- package/src/activity/format-relative-time.ts +11 -9
- package/src/agent/steps/CapabilitiesStep.tsx +6 -3
- package/src/agent/steps/IdentityStep.tsx +19 -12
- package/src/agent-instance/CreateAgentInstanceDialog.tsx +17 -8
- package/src/api-key/ApiKeyCreatedAlert.tsx +10 -19
- package/src/api-key/ApiKeyListPanel.tsx +3 -39
- package/src/api-key/CreateApiKeyForm.tsx +12 -26
- package/src/approval-defaults-context.ts +56 -0
- package/src/attachment/__tests__/vision-preflight.test.ts +311 -0
- package/src/attachment/index.ts +12 -0
- package/src/attachment/vision-preflight.ts +236 -0
- package/src/billing/AutoRechargeCard.tsx +5 -4
- package/src/billing/BillingSection.tsx +4 -3
- package/src/channel/ChannelConversationsDialog.tsx +8 -4
- package/src/channel/ChannelCredentialsDialog.tsx +14 -4
- package/src/channel/ChannelTemplatesDialog.tsx +8 -4
- package/src/channel/ConnectSlackDialog.tsx +14 -4
- package/src/channel/ConnectWhatsAppDialog.tsx +14 -4
- package/src/channel/useChannelSessions.ts +3 -0
- package/src/channel-app/ChannelAppDetailPanel.tsx +15 -12
- package/src/channel-app/CreateChannelAppForm.tsx +17 -12
- package/src/channel-app/internal.tsx +5 -25
- package/src/composer/ComposerToolbar.tsx +1 -1
- package/src/composer/SessionComposer.tsx +160 -13
- package/src/composer/__tests__/SessionComposer-modelCoherence.test.tsx +220 -0
- package/src/composer/__tests__/SessionComposer-visionPreflight.test.tsx +222 -0
- package/src/composer/icons.tsx +0 -18
- package/src/conversation/ConversationComposer.tsx +1 -1
- package/src/conversation/ConversationListPane.tsx +4 -3
- package/src/cursor-accounts/MemberCoverageTable.tsx +3 -14
- package/src/cursor-accounts/__tests__/CursorAccountsConsole.test.tsx +2 -10
- package/src/dashboard/DashboardFailedRuns.tsx +2 -12
- package/src/environment/CreateEnvironmentForm.tsx +8 -27
- package/src/environment/EnvVarForm.tsx +2 -18
- package/src/environment/EnvironmentVariableEditor.tsx +5 -21
- package/src/execution/ArtifactApplyButton.tsx +2 -17
- package/src/execution/ExecutionErrorNotice.tsx +99 -0
- package/src/execution/FilePathLink.tsx +5 -9
- package/src/execution/FileReviewCard.tsx +1 -20
- package/src/execution/FollowUpInput.tsx +1 -16
- package/src/execution/LivenessStatusLine.tsx +59 -0
- package/src/execution/MessageEntry.tsx +136 -25
- package/src/execution/MessageThread.tsx +84 -83
- package/src/execution/SetupProgress.tsx +5 -1
- package/src/execution/SubAgentSection.tsx +9 -20
- package/src/execution/TerminalSession.tsx +97 -10
- package/src/execution/ToolCallDetail.tsx +19 -0
- package/src/execution/ToolCallItem.tsx +157 -37
- package/src/execution/ToolRunGroup.tsx +30 -32
- package/src/execution/WriteBackCard.tsx +5 -24
- package/src/execution/__tests__/MessageEntry-copy.test.tsx +125 -0
- package/src/execution/__tests__/MessageThread.test.tsx +97 -0
- package/src/execution/__tests__/TerminalSession.test.tsx +71 -1
- package/src/execution/__tests__/ToolCallDetail.test.tsx +33 -1
- package/src/execution/__tests__/ToolCallItem.test.tsx +299 -11
- package/src/execution/__tests__/ToolRunGroup.test.tsx +41 -9
- package/src/execution/__tests__/message-thread-slots.test.tsx +92 -0
- package/src/execution/__tests__/tool-presenter.test.tsx +41 -4
- package/src/execution/index.ts +8 -2
- package/src/execution/tool-categories.ts +72 -8
- package/src/execution/tool-presenter.ts +22 -1
- package/src/execution/useArtifactInspection.ts +4 -8
- package/src/execution/useCreateAgentExecution.ts +3 -2
- package/src/iam-policy/GrantAccessForm.tsx +2 -18
- package/src/iam-policy/OrgMembersPanel.tsx +3 -19
- package/src/iam-policy/RoleSelector.tsx +8 -1
- package/src/identity-provider/CreateIdentityProviderForm.tsx +13 -31
- package/src/identity-provider/IdentityProviderDetailPanel.tsx +24 -49
- package/src/identity-provider/IdentityProviderListPanel.tsx +2 -18
- package/src/identity-provider/IdentityProviderWizard.tsx +15 -32
- package/src/identity-provider/SsoLoginPrompt.tsx +6 -21
- package/src/index.ts +23 -1
- package/src/internal/DecisionButton.tsx +1 -20
- package/src/internal/SpinnerIcon.tsx +42 -0
- package/src/internal/__tests__/ThreadCardShell.test.tsx +43 -7
- package/src/internal/__tests__/useCopyFeedback.test.ts +92 -0
- package/src/internal/isUnimplemented.ts +26 -0
- package/src/internal/select-element-text.ts +17 -0
- package/src/internal/thread-card/ThreadCardShell.tsx +53 -21
- package/src/internal/thread-card/glyphs.tsx +24 -3
- package/src/internal/thread-card/index.ts +1 -0
- package/src/internal/useCopyFeedback.ts +61 -0
- package/src/invitation/InvitationCreatedAlert.tsx +10 -18
- package/src/invitation/InvitationManager.tsx +23 -34
- package/src/invitation/InvitationRedemption.tsx +2 -18
- package/src/library/useExportResource.ts +15 -29
- package/src/manifest/ApplyManifestDialog.tsx +1 -1
- package/src/manifest/EditResourceYamlDialog.tsx +1 -1
- package/src/mcp-server/DefinitionDriftNotice.tsx +120 -0
- package/src/mcp-server/McpServerConnectDialog.tsx +30 -12
- package/src/mcp-server/McpServerDetailView.tsx +58 -26
- package/src/mcp-server/OAuthAppForm.tsx +2 -18
- package/src/mcp-server/__tests__/DefinitionDriftNotice.test.tsx +57 -0
- package/src/mcp-server/__tests__/VendorApprovalBlocked.surfaces.test.tsx +103 -5
- package/src/mcp-server/__tests__/byoaEditionDegradation.test.tsx +323 -0
- package/src/mcp-server/__tests__/definitionDrift.test.ts +245 -0
- package/src/mcp-server/__tests__/mcpServerToInput.test.ts +201 -0
- package/src/mcp-server/__tests__/useMcpServerCredentials.test.tsx +306 -0
- package/src/mcp-server/__tests__/useMcpServerDefinitionDrift.test.tsx +173 -0
- package/src/mcp-server/internal/definitionDrift.ts +158 -0
- package/src/mcp-server/internal/mcpServerToInput.ts +3 -0
- package/src/mcp-server/steps/EnvironmentAuthStep.tsx +19 -19
- package/src/mcp-server/steps/IdentityTransportStep.tsx +24 -23
- package/src/mcp-server/useMcpServerConnect.ts +1 -1
- package/src/mcp-server/useMcpServerCredentials.ts +87 -19
- package/src/mcp-server/useMcpServerDefinitionDrift.ts +95 -0
- package/src/mcp-server/useOrgOAuthApp.ts +54 -8
- package/src/models/ModelRegistryContext.ts +7 -1
- package/src/models/ModelSelector.tsx +37 -0
- package/src/models/__tests__/ModelSelector-visionIndicator.test.tsx +129 -0
- package/src/models/__tests__/resolveDefaultModel.test.ts +115 -0
- package/src/models/__tests__/useModelRegistry.test.tsx +99 -4
- package/src/models/index.ts +2 -2
- package/src/models/registry.ts +196 -29
- package/src/models/useModelRegistry.ts +10 -2
- package/src/oauth-app/CreateOAuthAppForm.tsx +16 -31
- package/src/oauth-app/OAuthAppDetailPanel.tsx +16 -31
- package/src/organization/CreateOrganizationForm.tsx +10 -29
- package/src/organization/OrgProfilePanel.tsx +13 -44
- package/src/platform-client/CreatePlatformClientForm.tsx +9 -29
- package/src/platform-client/PlatformClientDetailPanel.tsx +10 -30
- package/src/platform-client/PlatformClientListPanel.tsx +2 -18
- package/src/platform-client/PlatformClientSecretAlert.tsx +26 -55
- package/src/provider.tsx +76 -33
- package/src/resource-creation/WizardNav.tsx +2 -18
- package/src/resource-detail/ConfirmDialog.tsx +1 -1
- package/src/resource-detail/useCopyResource.ts +17 -23
- package/src/schedule/ScheduleDetailView.tsx +2 -18
- package/src/schedule/ScheduleForm.tsx +19 -34
- package/src/session/NewSessionViewer.tsx +85 -7
- package/src/session/SessionViewer.tsx +120 -17
- package/src/session/__tests__/audienceWiring.test.tsx +76 -0
- package/src/session/__tests__/panelNegotiation.test.tsx +302 -0
- package/src/session/__tests__/useNewSessionFlow.test.tsx +134 -5
- package/src/session/__tests__/useSessionPageFlow.autoApprove.test.tsx +74 -0
- package/src/session/__tests__/useSessionPageFlow.runConfig.test.tsx +157 -0
- package/src/session/__tests__/useSessionPanel.test.ts +114 -0
- package/src/session/audience.ts +18 -0
- package/src/session/index.ts +2 -1
- package/src/session/run-config.ts +59 -0
- package/src/session/useNewSessionFlow.ts +39 -2
- package/src/session/useSessionConversation.ts +14 -10
- package/src/session/useSessionPageFlow.ts +51 -10
- package/src/session/useSessionPanel.ts +91 -10
- package/src/settings/ApiKeysSection.tsx +4 -3
- package/src/settings/ChannelAppsSection.tsx +4 -3
- package/src/settings/EnvironmentsSection.tsx +8 -5
- package/src/settings/IdentityProvidersSection.tsx +4 -3
- package/src/settings/InvitationsSection.tsx +4 -2
- package/src/settings/MembersSection.tsx +4 -2
- package/src/settings/OAuthAppsSection.tsx +4 -3
- package/src/settings/OrgProfileSection.tsx +4 -3
- package/src/settings/PlatformClientsSection.tsx +4 -3
- package/src/settings/UsageSection.tsx +4 -2
- package/src/sharing/ShareAgentDialog.tsx +28 -10
- package/src/sidebar/__tests__/WorkspaceSidebar.test.tsx +4 -1
- package/src/sidebar/chrome.tsx +6 -6
- package/src/skill/SkillDiffDialog.tsx +1 -1
- package/src/skill/useSkillVersions.ts +1 -11
- package/src/styles.css +43 -0
- package/src/version-history/VersionTimelineEntry.tsx +1 -21
- package/src/workflow/FailedRunsWidget.tsx +2 -9
- package/src/workflow/PendingApprovalsWidget.tsx +2 -9
- package/src/workflow/ViewYamlDialog.tsx +7 -22
- package/src/workflow/WorkflowArchitectDialog.tsx +8 -27
- package/src/workflow/WorkflowArtifactDocument.tsx +5 -9
- package/src/workflow/WorkflowCanvasEditor.tsx +39 -7
- package/src/workflow/WorkflowCanvasInner.tsx +14 -1
- package/src/workflow/WorkflowDiffGraph.tsx +7 -1
- package/src/workflow/WorkflowExecutionGraph.tsx +26 -1
- package/src/workflow/WorkflowExecutionViewer.tsx +115 -24
- package/src/workflow/WorkflowExplainDialog.tsx +8 -24
- package/src/workflow/WorkflowNode.tsx +5 -2
- package/src/workflow/WorkflowOverviewGraph.tsx +9 -1
- package/src/workflow/WorkflowRefinePanel.tsx +2 -18
- package/src/workflow/WorkflowRepairCard.tsx +2 -18
- package/src/workflow/WorkflowRunDialog.tsx +31 -24
- package/src/workflow/WorkflowTaskApprovalSummary.tsx +2 -17
- package/src/workflow/WorkflowVersionBadge.tsx +4 -13
- package/src/workflow/WorkflowVersionTimeline.tsx +1 -25
- package/src/workflow/__tests__/WorkflowExecutionViewer.reconciliation.test.tsx +48 -1
- package/src/workflow/__tests__/WorkflowNode.test.tsx +93 -0
- package/src/workflow/__tests__/WorkflowRunDialog.test.tsx +127 -0
- package/src/workflow/__tests__/graph-history.test.ts +103 -0
- package/src/workflow/__tests__/overview-graph.test.ts +17 -0
- package/src/workflow/__tests__/panelNegotiation.test.tsx +230 -0
- package/src/workflow/__tests__/useCanvasKeyboardShortcuts.undo.test.ts +115 -0
- package/src/workflow/__tests__/useWorkflowCanvas.dirty.test.tsx +178 -0
- package/src/workflow/__tests__/useWorkflowCanvas.drag.test.tsx +224 -0
- package/src/workflow/__tests__/useWorkflowCanvas.undo.test.tsx +133 -0
- package/src/workflow/__tests__/useWorkflowExecutionPanel.test.ts +100 -0
- package/src/workflow/execution-comparison/ExecutionComparisonPicker.tsx +7 -11
- package/src/workflow/execution-history/ExecutionHistoryTable.tsx +1 -25
- package/src/workflow/index.ts +1 -0
- package/src/workflow/instance/CreateWorkflowInstanceDialog.tsx +17 -8
- package/src/workflow/instance/WorkflowInstanceDetailPanel.tsx +2 -1
- package/src/workflow/instance/useDeleteWorkflowInstance.ts +9 -4
- package/src/workflow/layout/registry-dimensions.ts +2 -5
- package/src/workflow/node-shell/NodeShell.tsx +4 -0
- package/src/workflow/picker/BranchAddPopover.tsx +4 -3
- package/src/workflow/task-type-visual-registry.ts +5 -3
- package/src/workflow/templates/WorkflowTemplatePreview.tsx +1 -1
- package/src/workflow/useApprovalBoundary.ts +1 -1
- package/src/workflow/useCanvasKeyboardShortcuts.ts +33 -3
- package/src/workflow/useGraphHistory.ts +22 -41
- package/src/workflow/useWorkflowCanvas.ts +126 -21
- package/src/workflow/useWorkflowExecutionPanel.ts +95 -13
- package/src/workflow/useWorkflowSave.ts +2 -15
- package/src/workflow/workflow-graph-conversions.ts +25 -3
- package/styles.css +1 -1
- package/version-history/VersionTimelineEntry.d.ts.map +1 -1
- package/version-history/VersionTimelineEntry.js +1 -23
- package/version-history/VersionTimelineEntry.js.map +1 -1
- package/workflow/CanvasTransitionEdge.d.ts +1 -1
- package/workflow/FailedRunsWidget.d.ts.map +1 -1
- package/workflow/FailedRunsWidget.js +2 -11
- package/workflow/FailedRunsWidget.js.map +1 -1
- package/workflow/PendingApprovalsWidget.d.ts.map +1 -1
- package/workflow/PendingApprovalsWidget.js +2 -11
- package/workflow/PendingApprovalsWidget.js.map +1 -1
- package/workflow/ViewYamlDialog.d.ts.map +1 -1
- package/workflow/ViewYamlDialog.js +7 -23
- package/workflow/ViewYamlDialog.js.map +1 -1
- package/workflow/WorkflowArchitectDialog.d.ts.map +1 -1
- package/workflow/WorkflowArchitectDialog.js +7 -11
- package/workflow/WorkflowArchitectDialog.js.map +1 -1
- package/workflow/WorkflowArtifactDocument.d.ts.map +1 -1
- package/workflow/WorkflowArtifactDocument.js +5 -8
- package/workflow/WorkflowArtifactDocument.js.map +1 -1
- package/workflow/WorkflowCanvasEditor.d.ts.map +1 -1
- package/workflow/WorkflowCanvasEditor.js +31 -6
- package/workflow/WorkflowCanvasEditor.js.map +1 -1
- package/workflow/WorkflowCanvasInner.d.ts +4 -2
- package/workflow/WorkflowCanvasInner.d.ts.map +1 -1
- package/workflow/WorkflowCanvasInner.js +7 -3
- package/workflow/WorkflowCanvasInner.js.map +1 -1
- package/workflow/WorkflowDiffGraph.js +6 -2
- package/workflow/WorkflowDiffGraph.js.map +1 -1
- package/workflow/WorkflowExecutionGraph.d.ts.map +1 -1
- package/workflow/WorkflowExecutionGraph.js +27 -1
- package/workflow/WorkflowExecutionGraph.js.map +1 -1
- package/workflow/WorkflowExecutionViewer.d.ts +51 -0
- package/workflow/WorkflowExecutionViewer.d.ts.map +1 -1
- package/workflow/WorkflowExecutionViewer.js +49 -18
- package/workflow/WorkflowExecutionViewer.js.map +1 -1
- package/workflow/WorkflowExplainDialog.d.ts.map +1 -1
- package/workflow/WorkflowExplainDialog.js +6 -8
- package/workflow/WorkflowExplainDialog.js.map +1 -1
- package/workflow/WorkflowNode.d.ts.map +1 -1
- package/workflow/WorkflowNode.js +2 -2
- package/workflow/WorkflowNode.js.map +1 -1
- package/workflow/WorkflowOverviewGraph.js +8 -2
- package/workflow/WorkflowOverviewGraph.js.map +1 -1
- package/workflow/WorkflowRefinePanel.d.ts.map +1 -1
- package/workflow/WorkflowRefinePanel.js +2 -4
- package/workflow/WorkflowRefinePanel.js.map +1 -1
- package/workflow/WorkflowRepairCard.d.ts.map +1 -1
- package/workflow/WorkflowRepairCard.js +2 -4
- package/workflow/WorkflowRepairCard.js.map +1 -1
- package/workflow/WorkflowRunDialog.d.ts +11 -1
- package/workflow/WorkflowRunDialog.d.ts.map +1 -1
- package/workflow/WorkflowRunDialog.js +18 -9
- package/workflow/WorkflowRunDialog.js.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.d.ts.map +1 -1
- package/workflow/WorkflowTaskApprovalSummary.js +2 -4
- package/workflow/WorkflowTaskApprovalSummary.js.map +1 -1
- package/workflow/WorkflowVersionBadge.d.ts.map +1 -1
- package/workflow/WorkflowVersionBadge.js +4 -13
- package/workflow/WorkflowVersionBadge.js.map +1 -1
- package/workflow/WorkflowVersionTimeline.d.ts.map +1 -1
- package/workflow/WorkflowVersionTimeline.js +1 -26
- package/workflow/WorkflowVersionTimeline.js.map +1 -1
- package/workflow/execution-comparison/ExecutionComparisonPicker.d.ts.map +1 -1
- package/workflow/execution-comparison/ExecutionComparisonPicker.js +7 -15
- package/workflow/execution-comparison/ExecutionComparisonPicker.js.map +1 -1
- package/workflow/execution-history/ExecutionHistoryTable.d.ts.map +1 -1
- package/workflow/execution-history/ExecutionHistoryTable.js +1 -24
- package/workflow/execution-history/ExecutionHistoryTable.js.map +1 -1
- package/workflow/index.d.ts +1 -1
- package/workflow/index.d.ts.map +1 -1
- package/workflow/index.js.map +1 -1
- package/workflow/instance/CreateWorkflowInstanceDialog.d.ts.map +1 -1
- package/workflow/instance/CreateWorkflowInstanceDialog.js +10 -2
- package/workflow/instance/CreateWorkflowInstanceDialog.js.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.d.ts.map +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.js +1 -1
- package/workflow/instance/WorkflowInstanceDetailPanel.js.map +1 -1
- package/workflow/instance/useDeleteWorkflowInstance.d.ts +9 -4
- package/workflow/instance/useDeleteWorkflowInstance.d.ts.map +1 -1
- package/workflow/instance/useDeleteWorkflowInstance.js +4 -2
- package/workflow/instance/useDeleteWorkflowInstance.js.map +1 -1
- package/workflow/layout/registry-dimensions.d.ts.map +1 -1
- package/workflow/layout/registry-dimensions.js +2 -5
- package/workflow/layout/registry-dimensions.js.map +1 -1
- package/workflow/node-shell/NodeShell.js +1 -1
- package/workflow/node-shell/NodeShell.js.map +1 -1
- package/workflow/picker/BranchAddPopover.d.ts.map +1 -1
- package/workflow/picker/BranchAddPopover.js +3 -2
- package/workflow/picker/BranchAddPopover.js.map +1 -1
- package/workflow/task-type-visual-registry.d.ts.map +1 -1
- package/workflow/task-type-visual-registry.js +5 -3
- package/workflow/task-type-visual-registry.js.map +1 -1
- package/workflow/templates/WorkflowTemplatePreview.js +1 -1
- package/workflow/useApprovalBoundary.d.ts +1 -1
- package/workflow/useApprovalBoundary.js +1 -1
- package/workflow/useCanvasKeyboardShortcuts.d.ts +15 -4
- package/workflow/useCanvasKeyboardShortcuts.d.ts.map +1 -1
- package/workflow/useCanvasKeyboardShortcuts.js +25 -4
- package/workflow/useCanvasKeyboardShortcuts.js.map +1 -1
- package/workflow/useGraphHistory.d.ts +16 -9
- package/workflow/useGraphHistory.d.ts.map +1 -1
- package/workflow/useGraphHistory.js +19 -33
- package/workflow/useGraphHistory.js.map +1 -1
- package/workflow/useWorkflowCanvas.d.ts +6 -4
- package/workflow/useWorkflowCanvas.d.ts.map +1 -1
- package/workflow/useWorkflowCanvas.js +115 -23
- package/workflow/useWorkflowCanvas.js.map +1 -1
- package/workflow/useWorkflowExecutionPanel.d.ts +38 -2
- package/workflow/useWorkflowExecutionPanel.d.ts.map +1 -1
- package/workflow/useWorkflowExecutionPanel.js +46 -13
- package/workflow/useWorkflowExecutionPanel.js.map +1 -1
- package/workflow/useWorkflowSave.d.ts.map +1 -1
- package/workflow/useWorkflowSave.js +2 -15
- package/workflow/useWorkflowSave.js.map +1 -1
- package/workflow/workflow-graph-conversions.d.ts +19 -1
- package/workflow/workflow-graph-conversions.d.ts.map +1 -1
- package/workflow/workflow-graph-conversions.js +17 -3
- package/workflow/workflow-graph-conversions.js.map +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
3
|
+
import { useCallback, useId, useState } from "react";
|
|
4
4
|
import { cn } from "@stigmer/theme";
|
|
5
5
|
import { getUserMessage } from "@stigmer/sdk";
|
|
6
6
|
import { useCreateApiKey } from "./useCreateApiKey.js";
|
|
7
|
+
import { SpinnerIcon } from "../internal/SpinnerIcon.js";
|
|
7
8
|
/**
|
|
8
9
|
* Compact form for creating a new API key.
|
|
9
10
|
*
|
|
@@ -25,6 +26,7 @@ import { useCreateApiKey } from "./useCreateApiKey.js";
|
|
|
25
26
|
*/
|
|
26
27
|
export function CreateApiKeyForm({ org, onCreated, onCancel, initialName = "", className, }) {
|
|
27
28
|
const { create, isCreating, error, clearError } = useCreateApiKey();
|
|
29
|
+
const baseId = useId();
|
|
28
30
|
const [name, setName] = useState(initialName);
|
|
29
31
|
const [expiry, setExpiry] = useState("never");
|
|
30
32
|
const trimmedName = name.trim();
|
|
@@ -48,7 +50,7 @@ export function CreateApiKeyForm({ org, onCreated, onCancel, initialName = "", c
|
|
|
48
50
|
// error state is managed by useCreateApiKey
|
|
49
51
|
}
|
|
50
52
|
}, [canSubmit, trimmedName, org, expiry, create, clearError, onCreated]);
|
|
51
|
-
return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-3", className), children: [_jsxs("div", { className: "stg:space-y-3", children: [_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor:
|
|
53
|
+
return (_jsxs("form", { onSubmit: handleSubmit, className: cn("stg:space-y-3", className), children: [_jsxs("div", { className: "stg:space-y-3", children: [_jsxs("div", { className: "stg:space-y-1", children: [_jsx("label", { htmlFor: `${baseId}-name`, className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Name" }), _jsx("input", { id: `${baseId}-name`, type: "text", value: name, onChange: (e) => setName(e.target.value), placeholder: "e.g. ci-deploy-key", disabled: isCreating, autoFocus: true, required: true, className: cn("stg:w-full stg:rounded-md stg:border stg:border-input stg:bg-background stg:px-2.5 stg:py-1.5 stg:text-xs stg:text-foreground", "stg:placeholder:text-muted-foreground", "stg:focus-visible:outline-none stg:focus-visible:ring-1 stg:focus-visible:ring-ring", "stg:disabled:pointer-events-none stg:disabled:opacity-50") })] }), _jsxs("fieldset", { className: "stg:space-y-1.5", children: [_jsx("legend", { className: "stg:text-xs stg:font-medium stg:text-foreground", children: "Expiration" }), _jsx("div", { className: "stg:flex stg:flex-wrap stg:gap-2", children: EXPIRY_OPTIONS.map(({ value, label }) => (_jsx(ExpiryRadio, { name: `${baseId}-expiry`, value: value, label: label, checked: expiry === value, disabled: isCreating, onChange: setExpiry }, value))) })] })] }), error && (_jsx("p", { className: "stg:text-destructive stg:text-[0.65rem]", role: "alert", children: getUserMessage(error) })), _jsxs("div", { className: "stg:flex stg:items-center stg:gap-2", children: [_jsxs("button", { type: "submit", disabled: !canSubmit, className: cn("stg:inline-flex stg:items-center stg:gap-1.5 stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-40"), children: [isCreating && _jsx(SpinnerIcon, { size: 12 }), "Create API key"] }), onCancel && (_jsx("button", { type: "button", onClick: onCancel, disabled: isCreating, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs", "stg:text-muted-foreground stg:hover:text-foreground stg:hover:bg-accent-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), children: "Cancel" }))] })] }));
|
|
52
54
|
}
|
|
53
55
|
// ---------------------------------------------------------------------------
|
|
54
56
|
// Expiry helpers
|
|
@@ -67,15 +69,9 @@ function daysFromNow(days) {
|
|
|
67
69
|
// ---------------------------------------------------------------------------
|
|
68
70
|
// ExpiryRadio (internal)
|
|
69
71
|
// ---------------------------------------------------------------------------
|
|
70
|
-
function ExpiryRadio({ value, label, checked, disabled, onChange, }) {
|
|
72
|
+
function ExpiryRadio({ name, value, label, checked, disabled, onChange, }) {
|
|
71
73
|
return (_jsxs("label", { className: cn("stg:inline-flex stg:cursor-pointer stg:items-center stg:rounded-md stg:border stg:px-2.5 stg:py-1 stg:text-xs stg:transition-colors", checked
|
|
72
74
|
? "stg:border-primary stg:bg-primary-subtle stg:text-primary stg:font-medium"
|
|
73
|
-
: "stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground", disabled && "stg:pointer-events-none stg:opacity-50"), children: [_jsx("input", { type: "radio", name:
|
|
74
|
-
}
|
|
75
|
-
// ---------------------------------------------------------------------------
|
|
76
|
-
// Icons
|
|
77
|
-
// ---------------------------------------------------------------------------
|
|
78
|
-
function SpinnerIcon() {
|
|
79
|
-
return (_jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", className: "stg:animate-spin", "aria-hidden": "true", children: _jsx("path", { d: "M8 2a6 6 0 1 0 6 6" }) }));
|
|
75
|
+
: "stg:border-input stg:bg-background stg:text-muted-foreground stg:hover:border-border stg:hover:text-foreground", disabled && "stg:pointer-events-none stg:opacity-50"), children: [_jsx("input", { type: "radio", name: name, value: value, checked: checked, disabled: disabled, onChange: () => onChange(value), className: "stg:sr-only" }), label] }));
|
|
80
76
|
}
|
|
81
77
|
//# sourceMappingURL=CreateApiKeyForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateApiKeyForm.js","sourceRoot":"","sources":["../../src/api-key/CreateApiKeyForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CreateApiKeyForm.js","sourceRoot":"","sources":["../../src/api-key/CreateApiKeyForm.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AA8BzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,GAAG,EACH,SAAS,EACT,QAAQ,EACR,WAAW,GAAG,EAAE,EAChB,SAAS,GACa;IACtB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACpE,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IAEvB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC9C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAe,OAAO,CAAC,CAAC;IAE5D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAChC,MAAM,SAAS,GAAG,WAAW,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC;IAEpD,MAAM,YAAY,GAAG,WAAW,CAC9B,KAAK,EAAE,CAAY,EAAE,EAAE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AE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAC;AAEF,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,SAAS,WAAW,CAAC,EACnB,IAAI,EACJ,KAAK,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,GAQT;IACC,OAAO,CACL,iBACE,SAAS,EAAE,EAAE,CACX,qIAAqI,EACrI,OAAO;YACL,CAAC,CAAC,2EAA2E;YAC7E,CAAC,CAAC,gHAAgH,EACpH,QAAQ,IAAI,wCAAwC,CACrD,aAED,gBACE,IAAI,EAAC,OAAO,EACZ,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAC/B,SAAS,EAAC,aAAa,GACvB,EACD,KAAK,IACA,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App-level approval defaults for interactive sessions (#302).
|
|
3
|
+
*
|
|
4
|
+
* These are the *host's* defaults, not the platform's: an embedding product
|
|
5
|
+
* that has judged its whole surface trusted — e.g. a desktop app whose
|
|
6
|
+
* sessions operate on the user's own local folder, where the apply-then-
|
|
7
|
+
* review file ledger is the safety net — can pre-arm what a user would
|
|
8
|
+
* otherwise opt into at the first approval gate. The user always keeps the
|
|
9
|
+
* last word: the session UI shows its "Auto-approving tool calls" notice
|
|
10
|
+
* from the first render, with the same "Turn off" affordance as a
|
|
11
|
+
* gate-armed preference.
|
|
12
|
+
*/
|
|
13
|
+
export interface ApprovalDefaults {
|
|
14
|
+
/**
|
|
15
|
+
* Start interactive sessions with the session-scoped auto-approve
|
|
16
|
+
* preference armed, and create their bootstrap executions with
|
|
17
|
+
* `auto_approve_all` set.
|
|
18
|
+
*
|
|
19
|
+
* Equivalent to the user clicking "Approve & don't ask again" before the
|
|
20
|
+
* first gate, applied as a product decision. Defaults to off — omitting
|
|
21
|
+
* the provider prop keeps today's fail-closed behavior exactly.
|
|
22
|
+
*/
|
|
23
|
+
readonly autoApproveAll?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* React context for app-level approval defaults.
|
|
27
|
+
*
|
|
28
|
+
* Separated from the provider to mirror the `ExecutionTargetContext`
|
|
29
|
+
* pattern and avoid circular imports.
|
|
30
|
+
*
|
|
31
|
+
* `undefined` means the host configured nothing — every approval default
|
|
32
|
+
* stays platform-standard (fail-closed gates, opt-in at the gate).
|
|
33
|
+
*/
|
|
34
|
+
export declare const ApprovalDefaultsContext: import("react").Context<ApprovalDefaults | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Read the app-level approval defaults from the nearest `StigmerProvider`.
|
|
37
|
+
*
|
|
38
|
+
* Consumed by the interactive-session surface only: `useNewSessionFlow`
|
|
39
|
+
* (bootstrap execution create) and `useSessionPageFlow` (session-scoped
|
|
40
|
+
* preference initializer). Deliberately NOT consumed by the lower-level
|
|
41
|
+
* `useCreateSession` / `useCreateAgentExecution` primitives — those are
|
|
42
|
+
* shared by specialized flows (workflow architect/explain/diagnose) and by
|
|
43
|
+
* headless callers, which pass `autoApproveAll` explicitly when they mean
|
|
44
|
+
* it.
|
|
45
|
+
*/
|
|
46
|
+
export declare function useApprovalDefaults(): ApprovalDefaults | undefined;
|
|
47
|
+
//# sourceMappingURL=approval-defaults-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-defaults-context.d.ts","sourceRoot":"","sources":["../src/approval-defaults-context.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,uDAExB,CAAC;AAEb;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,SAAS,CAElE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* React context for app-level approval defaults.
|
|
5
|
+
*
|
|
6
|
+
* Separated from the provider to mirror the `ExecutionTargetContext`
|
|
7
|
+
* pattern and avoid circular imports.
|
|
8
|
+
*
|
|
9
|
+
* `undefined` means the host configured nothing — every approval default
|
|
10
|
+
* stays platform-standard (fail-closed gates, opt-in at the gate).
|
|
11
|
+
*/
|
|
12
|
+
export const ApprovalDefaultsContext = createContext(undefined);
|
|
13
|
+
/**
|
|
14
|
+
* Read the app-level approval defaults from the nearest `StigmerProvider`.
|
|
15
|
+
*
|
|
16
|
+
* Consumed by the interactive-session surface only: `useNewSessionFlow`
|
|
17
|
+
* (bootstrap execution create) and `useSessionPageFlow` (session-scoped
|
|
18
|
+
* preference initializer). Deliberately NOT consumed by the lower-level
|
|
19
|
+
* `useCreateSession` / `useCreateAgentExecution` primitives — those are
|
|
20
|
+
* shared by specialized flows (workflow architect/explain/diagnose) and by
|
|
21
|
+
* headless callers, which pass `autoApproveAll` explicitly when they mean
|
|
22
|
+
* it.
|
|
23
|
+
*/
|
|
24
|
+
export function useApprovalDefaults() {
|
|
25
|
+
return useContext(ApprovalDefaultsContext);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=approval-defaults-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-defaults-context.js","sourceRoot":"","sources":["../src/approval-defaults-context.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA2BlD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAElD,SAAS,CAAC,CAAC;AAEb;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC"}
|
package/attachment/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { MAX_ATTACHMENT_BYTES, detectContentType, formatFileSize, uniquifyFilena
|
|
|
6
6
|
export { extractClipboardFiles } from "./clipboard.js";
|
|
7
7
|
export type { ClipboardFilesSource } from "./clipboard.js";
|
|
8
8
|
export { prepareImageForVision } from "./prepare-image.js";
|
|
9
|
+
export { assessVisionPreflight, visionPreflightMessage, } from "./vision-preflight.js";
|
|
10
|
+
export type { AssessVisionPreflightOptions, VisionPreflight, VisionPreflightAttachment, VisionPreflightMessageOptions, VisionPreflightReason, VisionPreflightWarning, } from "./vision-preflight.js";
|
|
9
11
|
export { MAX_VISION_LONG_EDGE_PX, MAX_VISION_PIXELS, exceedsVisionResolution, fitToVisionResolution, } from "./vision-fit.js";
|
|
10
12
|
export type { VisionFitSize } from "./vision-fit.js";
|
|
11
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/attachment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EACV,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,YAAY,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,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B,CAAC;AACzB,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
|
package/attachment/index.js
CHANGED
|
@@ -3,5 +3,6 @@ export { AttachmentChipList } from "./AttachmentChipList.js";
|
|
|
3
3
|
export { MAX_ATTACHMENT_BYTES, detectContentType, formatFileSize, uniquifyFilename, validateAttachmentSize, } from "./attachment-utils.js";
|
|
4
4
|
export { extractClipboardFiles } from "./clipboard.js";
|
|
5
5
|
export { prepareImageForVision } from "./prepare-image.js";
|
|
6
|
+
export { assessVisionPreflight, visionPreflightMessage, } from "./vision-preflight.js";
|
|
6
7
|
export { MAX_VISION_LONG_EDGE_PX, MAX_VISION_PIXELS, exceedsVisionResolution, fitToVisionResolution, } from "./vision-fit.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/attachment/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attachment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/attachment/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side vision preflight — predicts, before a turn is spent, which
|
|
3
|
+
* attached images the runner will refuse to deliver inline and why
|
|
4
|
+
* (stigmer/stigmer#365, stigmer/stigmer#386).
|
|
5
|
+
*
|
|
6
|
+
* The runner is the enforcement authority (`VisionBudget` in its
|
|
7
|
+
* `shared/attachment-vision.ts`); this module is the warning authority.
|
|
8
|
+
* To never warn differently than the runner behaves, it replicates the
|
|
9
|
+
* runner's admission semantics against the SAME data the runner uses:
|
|
10
|
+
*
|
|
11
|
+
* - the byte budget arrives via the registry document's `limits.vision`
|
|
12
|
+
* block ({@link VisionLimits}) — advertised == enforced;
|
|
13
|
+
* - the model's vision capability arrives via the per-model
|
|
14
|
+
* `capabilities` block ({@link ModelInfo.visionCapability});
|
|
15
|
+
* - reasons reuse the runner's disclosure vocabulary
|
|
16
|
+
* (`VisionDegradedReason`), so a warning here and a disclosure in the
|
|
17
|
+
* agent's reply always tell one story.
|
|
18
|
+
*
|
|
19
|
+
* Tri-state discipline: absent limits or an unassessed model produce NO
|
|
20
|
+
* warnings. A client that cannot know the budget must stay silent, not
|
|
21
|
+
* guess — the runner's own disclosure remains the backstop.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately assessed client-side reasons are a SUBSET of the runner's:
|
|
24
|
+
* `unsupported_format` and `type_mismatch` need magic-byte sniffing that a
|
|
25
|
+
* declared content type cannot honestly stand in for (and pasted images are
|
|
26
|
+
* already normalized by `prepareImageForVision`), so those two remain
|
|
27
|
+
* runner-disclosed only.
|
|
28
|
+
*/
|
|
29
|
+
import type { ModelInfo, VisionLimits } from "../models/registry.js";
|
|
30
|
+
/** Minimal attachment shape the preflight needs — pure data, no `File`. */
|
|
31
|
+
export interface VisionPreflightAttachment {
|
|
32
|
+
/** Display name used in warning copy (the chip's filename). */
|
|
33
|
+
readonly name: string;
|
|
34
|
+
/** Raw byte size — what the runner's budget counts. */
|
|
35
|
+
readonly sizeBytes: number;
|
|
36
|
+
/** Declared/detected MIME type (`AttachmentEntry.contentType`). */
|
|
37
|
+
readonly contentType: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Why an image will not be viewable inline — the client-assessable subset
|
|
41
|
+
* of the runner's `VisionDegradedReason` vocabulary, same spellings.
|
|
42
|
+
*/
|
|
43
|
+
export type VisionPreflightReason =
|
|
44
|
+
/** Raw bytes exceed the per-image cap; a smaller re-export would fix it. */
|
|
45
|
+
"too_large"
|
|
46
|
+
/** Image is fine but the turn's total/count budget is already spent. */
|
|
47
|
+
| "budget_exhausted"
|
|
48
|
+
/** The selected model is explicitly assessed as unable to see images. */
|
|
49
|
+
| "model_no_vision";
|
|
50
|
+
/** One image the runner is predicted to degrade, and why. */
|
|
51
|
+
export interface VisionPreflightWarning {
|
|
52
|
+
readonly name: string;
|
|
53
|
+
readonly sizeBytes: number;
|
|
54
|
+
readonly reason: VisionPreflightReason;
|
|
55
|
+
}
|
|
56
|
+
/** Result of {@link assessVisionPreflight}. */
|
|
57
|
+
export interface VisionPreflight {
|
|
58
|
+
/** Predicted-degraded images in attachment order. Empty = all clear. */
|
|
59
|
+
readonly warnings: readonly VisionPreflightWarning[];
|
|
60
|
+
/**
|
|
61
|
+
* True when the selected model is explicitly blind (`vision: false`)
|
|
62
|
+
* and at least one image is attached. When set, every image warning
|
|
63
|
+
* carries `model_no_vision` — resending smaller images cannot help, so
|
|
64
|
+
* warning UI should lead with the model, not the files.
|
|
65
|
+
*/
|
|
66
|
+
readonly modelCannotSeeImages: boolean;
|
|
67
|
+
}
|
|
68
|
+
/** Options for {@link assessVisionPreflight}. */
|
|
69
|
+
export interface AssessVisionPreflightOptions {
|
|
70
|
+
/**
|
|
71
|
+
* The model the turn will run on. `undefined` (unknown/still loading)
|
|
72
|
+
* disables the capability verdict, never the byte assessment.
|
|
73
|
+
*/
|
|
74
|
+
readonly model?: ModelInfo | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The advertised byte budget from `useModelRegistry().visionLimits`.
|
|
77
|
+
* `undefined` (older server, still loading) disables the byte
|
|
78
|
+
* assessment, never the capability verdict.
|
|
79
|
+
*/
|
|
80
|
+
readonly limits?: VisionLimits | undefined;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Predict which attached images the runner will degrade this turn.
|
|
84
|
+
*
|
|
85
|
+
* Pure and deterministic — safe to call in render (memoized by callers).
|
|
86
|
+
* Non-image attachments never warn. The byte assessment replicates the
|
|
87
|
+
* runner's sequential admission: an image over the per-image cap is
|
|
88
|
+
* degraded WITHOUT consuming budget; remaining images are admitted in
|
|
89
|
+
* order until the count or total-byte budget is exhausted.
|
|
90
|
+
*/
|
|
91
|
+
export declare function assessVisionPreflight(attachments: readonly VisionPreflightAttachment[], options?: AssessVisionPreflightOptions): VisionPreflight;
|
|
92
|
+
/** Options for {@link visionPreflightMessage}. */
|
|
93
|
+
export interface VisionPreflightMessageOptions {
|
|
94
|
+
/** The advertised budget — names the caps in the copy when present. */
|
|
95
|
+
readonly limits?: VisionLimits | undefined;
|
|
96
|
+
/** Display name of the selected model, for the capability wording. */
|
|
97
|
+
readonly modelDisplayName?: string | undefined;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* One-line human copy for a {@link VisionPreflight} — the client-side twin
|
|
101
|
+
* of the runner's `visionDisclosureLines`, worded for BEFORE the turn
|
|
102
|
+
* ("will arrive as a file") instead of after ("was not viewable").
|
|
103
|
+
*
|
|
104
|
+
* Returns `null` when there is nothing to warn about. Copy rules:
|
|
105
|
+
* - a blind model leads with the model, never the files — no smaller
|
|
106
|
+
* resend can help, so file-size advice would be dishonest;
|
|
107
|
+
* - `too_large` names the files (up to two, then a count) and the actual
|
|
108
|
+
* cap, so the fix — export smaller — is self-evident;
|
|
109
|
+
* - `budget_exhausted` explains the per-turn budget, the only fix being
|
|
110
|
+
* fewer images this turn.
|
|
111
|
+
*/
|
|
112
|
+
export declare function visionPreflightMessage(preflight: VisionPreflight, options?: VisionPreflightMessageOptions): string | null;
|
|
113
|
+
//# sourceMappingURL=vision-preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-preflight.d.ts","sourceRoot":"","sources":["../../src/attachment/vision-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAerE,2EAA2E;AAC3E,MAAM,WAAW,yBAAyB;IACxC,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,uDAAuD;IACvD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB;AAC/B,4EAA4E;AAC1E,WAAW;AACb,wEAAwE;GACtE,kBAAkB;AACpB,yEAAyE;GACvE,iBAAiB,CAAC;AAEtB,6DAA6D;AAC7D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;CACxC;AAED,+CAA+C;AAC/C,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACrD;;;;;OAKG;IACH,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CACxC;AAID,iDAAiD;AACjD,MAAM,WAAW,4BAA4B;IAC3C;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IACvC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CAC5C;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,SAAS,yBAAyB,EAAE,EACjD,OAAO,CAAC,EAAE,4BAA4B,GACrC,eAAe,CAkDjB;AAED,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,uEAAuE;IACvE,QAAQ,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;IAC3C,sEAAsE;IACtE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,eAAe,EAC1B,OAAO,CAAC,EAAE,6BAA6B,GACtC,MAAM,GAAG,IAAI,CA4Cf"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side vision preflight — predicts, before a turn is spent, which
|
|
3
|
+
* attached images the runner will refuse to deliver inline and why
|
|
4
|
+
* (stigmer/stigmer#365, stigmer/stigmer#386).
|
|
5
|
+
*
|
|
6
|
+
* The runner is the enforcement authority (`VisionBudget` in its
|
|
7
|
+
* `shared/attachment-vision.ts`); this module is the warning authority.
|
|
8
|
+
* To never warn differently than the runner behaves, it replicates the
|
|
9
|
+
* runner's admission semantics against the SAME data the runner uses:
|
|
10
|
+
*
|
|
11
|
+
* - the byte budget arrives via the registry document's `limits.vision`
|
|
12
|
+
* block ({@link VisionLimits}) — advertised == enforced;
|
|
13
|
+
* - the model's vision capability arrives via the per-model
|
|
14
|
+
* `capabilities` block ({@link ModelInfo.visionCapability});
|
|
15
|
+
* - reasons reuse the runner's disclosure vocabulary
|
|
16
|
+
* (`VisionDegradedReason`), so a warning here and a disclosure in the
|
|
17
|
+
* agent's reply always tell one story.
|
|
18
|
+
*
|
|
19
|
+
* Tri-state discipline: absent limits or an unassessed model produce NO
|
|
20
|
+
* warnings. A client that cannot know the budget must stay silent, not
|
|
21
|
+
* guess — the runner's own disclosure remains the backstop.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately assessed client-side reasons are a SUBSET of the runner's:
|
|
24
|
+
* `unsupported_format` and `type_mismatch` need magic-byte sniffing that a
|
|
25
|
+
* declared content type cannot honestly stand in for (and pasted images are
|
|
26
|
+
* already normalized by `prepareImageForVision`), so those two remain
|
|
27
|
+
* runner-disclosed only.
|
|
28
|
+
*/
|
|
29
|
+
import { formatFileSize } from "./attachment-utils.js";
|
|
30
|
+
/**
|
|
31
|
+
* Content types the runner recognizes as vision candidates (its
|
|
32
|
+
* `VisionMimeType` set). Anything else — PDFs, SVGs, archives — rides the
|
|
33
|
+
* normal file story with no inline-vision expectation and no warning.
|
|
34
|
+
*/
|
|
35
|
+
const VISION_CANDIDATE_TYPES = new Set([
|
|
36
|
+
"image/png",
|
|
37
|
+
"image/jpeg",
|
|
38
|
+
"image/webp",
|
|
39
|
+
"image/gif",
|
|
40
|
+
]);
|
|
41
|
+
const NO_WARNINGS = { warnings: [], modelCannotSeeImages: false };
|
|
42
|
+
/**
|
|
43
|
+
* Predict which attached images the runner will degrade this turn.
|
|
44
|
+
*
|
|
45
|
+
* Pure and deterministic — safe to call in render (memoized by callers).
|
|
46
|
+
* Non-image attachments never warn. The byte assessment replicates the
|
|
47
|
+
* runner's sequential admission: an image over the per-image cap is
|
|
48
|
+
* degraded WITHOUT consuming budget; remaining images are admitted in
|
|
49
|
+
* order until the count or total-byte budget is exhausted.
|
|
50
|
+
*/
|
|
51
|
+
export function assessVisionPreflight(attachments, options) {
|
|
52
|
+
const candidates = attachments.filter((a) => VISION_CANDIDATE_TYPES.has(a.contentType.toLowerCase()));
|
|
53
|
+
if (candidates.length === 0)
|
|
54
|
+
return NO_WARNINGS;
|
|
55
|
+
// The capability gate short-circuits the byte math: on an explicitly
|
|
56
|
+
// blind model no image is deliverable at any size, and mixing byte
|
|
57
|
+
// warnings in would wrongly suggest a smaller resend could help.
|
|
58
|
+
if (options?.model?.visionCapability === false) {
|
|
59
|
+
return {
|
|
60
|
+
warnings: candidates.map((a) => ({
|
|
61
|
+
name: a.name,
|
|
62
|
+
sizeBytes: a.sizeBytes,
|
|
63
|
+
reason: "model_no_vision",
|
|
64
|
+
})),
|
|
65
|
+
modelCannotSeeImages: true,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
const limits = options?.limits;
|
|
69
|
+
if (!limits)
|
|
70
|
+
return NO_WARNINGS;
|
|
71
|
+
const warnings = [];
|
|
72
|
+
let acceptedCount = 0;
|
|
73
|
+
let acceptedBytes = 0;
|
|
74
|
+
for (const image of candidates) {
|
|
75
|
+
if (image.sizeBytes > limits.maxImageBytes) {
|
|
76
|
+
warnings.push({ name: image.name, sizeBytes: image.sizeBytes, reason: "too_large" });
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (acceptedCount >= limits.maxImages ||
|
|
80
|
+
acceptedBytes + image.sizeBytes > limits.maxTotalBytes) {
|
|
81
|
+
warnings.push({
|
|
82
|
+
name: image.name,
|
|
83
|
+
sizeBytes: image.sizeBytes,
|
|
84
|
+
reason: "budget_exhausted",
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
acceptedCount += 1;
|
|
89
|
+
acceptedBytes += image.sizeBytes;
|
|
90
|
+
}
|
|
91
|
+
return warnings.length === 0
|
|
92
|
+
? NO_WARNINGS
|
|
93
|
+
: { warnings, modelCannotSeeImages: false };
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* One-line human copy for a {@link VisionPreflight} — the client-side twin
|
|
97
|
+
* of the runner's `visionDisclosureLines`, worded for BEFORE the turn
|
|
98
|
+
* ("will arrive as a file") instead of after ("was not viewable").
|
|
99
|
+
*
|
|
100
|
+
* Returns `null` when there is nothing to warn about. Copy rules:
|
|
101
|
+
* - a blind model leads with the model, never the files — no smaller
|
|
102
|
+
* resend can help, so file-size advice would be dishonest;
|
|
103
|
+
* - `too_large` names the files (up to two, then a count) and the actual
|
|
104
|
+
* cap, so the fix — export smaller — is self-evident;
|
|
105
|
+
* - `budget_exhausted` explains the per-turn budget, the only fix being
|
|
106
|
+
* fewer images this turn.
|
|
107
|
+
*/
|
|
108
|
+
export function visionPreflightMessage(preflight, options) {
|
|
109
|
+
if (preflight.warnings.length === 0)
|
|
110
|
+
return null;
|
|
111
|
+
if (preflight.modelCannotSeeImages) {
|
|
112
|
+
const model = options?.modelDisplayName ?? "The selected model";
|
|
113
|
+
return `${model} can't view images — attached images will reach the agent as files only.`;
|
|
114
|
+
}
|
|
115
|
+
const tooLarge = preflight.warnings.filter((w) => w.reason === "too_large");
|
|
116
|
+
const exhausted = preflight.warnings.filter((w) => w.reason === "budget_exhausted");
|
|
117
|
+
const parts = [];
|
|
118
|
+
if (tooLarge.length > 0) {
|
|
119
|
+
const capPhrase = options?.limits
|
|
120
|
+
? `the ${formatFileSize(options.limits.maxImageBytes)} inline-image limit`
|
|
121
|
+
: "the inline-image size limit";
|
|
122
|
+
if (tooLarge.length === 1) {
|
|
123
|
+
const w = tooLarge[0];
|
|
124
|
+
parts.push(`${w.name} (${formatFileSize(w.sizeBytes)}) exceeds ${capPhrase} and will reach the agent as a file, not an image`);
|
|
125
|
+
}
|
|
126
|
+
else if (tooLarge.length === 2) {
|
|
127
|
+
parts.push(`${tooLarge[0].name} and ${tooLarge[1].name} exceed ${capPhrase} and will reach the agent as files, not images`);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
parts.push(`${tooLarge.length} images exceed ${capPhrase} and will reach the agent as files, not images`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (exhausted.length > 0) {
|
|
134
|
+
const budget = options?.limits
|
|
135
|
+
? `this turn's inline-image budget (${options.limits.maxImages} images, ${formatFileSize(options.limits.maxTotalBytes)} total)`
|
|
136
|
+
: "this turn's inline-image budget";
|
|
137
|
+
parts.push(exhausted.length === 1
|
|
138
|
+
? `${exhausted[0].name} is over ${budget} and will reach the agent as a file`
|
|
139
|
+
: `${exhausted.length} images are over ${budget} and will reach the agent as files`);
|
|
140
|
+
}
|
|
141
|
+
return parts.length === 0 ? null : `${parts.join("; ")}.`;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=vision-preflight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vision-preflight.js","sourceRoot":"","sources":["../../src/attachment/vision-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IAC1D,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,WAAW;CACZ,CAAC,CAAC;AA4CH,MAAM,WAAW,GAAoB,EAAE,QAAQ,EAAE,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;AAiBnF;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,WAAiD,EACjD,OAAsC;IAEtC,MAAM,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1C,sBAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CACxD,CAAC;IACF,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,WAAW,CAAC;IAEhD,qEAAqE;IACrE,mEAAmE;IACnE,iEAAiE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,CAAC,EAC/B,KAAK,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,SAAS,GACV,EAAE,qBAAqB,2CAgKvB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useCallback, useEffect } from "react";
|
|
3
|
+
import { useState, useCallback, useEffect, useId } from "react";
|
|
4
4
|
import { cn } from "@stigmer/theme";
|
|
5
5
|
import { BillingAccountStatus } from "@stigmer/protos/ai/stigmer/billing/v1/enum_pb";
|
|
6
6
|
import { getUserMessage } from "@stigmer/sdk";
|
|
@@ -38,6 +38,7 @@ function dollarsToMicros(value) {
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
export function AutoRechargeCard({ orgId, autoRecharge, hasPaymentMethod, accountStatus, onSaved, className, }) {
|
|
41
|
+
const baseId = useId();
|
|
41
42
|
const { setConfig, isSubmitting, error, clearError } = useSetAutoRechargeConfig();
|
|
42
43
|
const [enabled, setEnabled] = useState(autoRecharge?.enabled ?? false);
|
|
43
44
|
const [threshold, setThreshold] = useState(microsToDollars(autoRecharge?.thresholdMicros ?? BigInt(0)));
|
|
@@ -79,7 +80,7 @@ export function AutoRechargeCard({ orgId, autoRecharge, hasPaymentMethod, accoun
|
|
|
79
80
|
// error state is managed by the hook
|
|
80
81
|
}
|
|
81
82
|
}, [orgId, enabled, threshold, amount, cap, setConfig, clearError, onSaved]);
|
|
82
|
-
return (_jsxs("div", { className: cn("stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4 stg:py-4", className), children: [_jsxs("div", { className: "stg:flex stg:items-center stg:justify-between", children: [_jsxs("div", { children: [_jsx("h3", { className: "stg:text-xs stg:font-semibold stg:text-foreground", children: "Auto-Recharge" }), _jsx("p", { className: "stg:mt-0.5 stg:text-[0.7rem] stg:text-muted-foreground", children: "Automatically add credits when your balance runs low." })] }), _jsx("button", { type: "button", role: "switch", "aria-checked": enabled, disabled: !canConfigure || isSubmitting, onClick: () => setEnabled((prev) => !prev), className: cn("stg:relative stg:inline-flex stg:h-5 stg:w-9 stg:shrink-0 stg:rounded-full stg:transition-colors", "stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring", "stg:disabled:cursor-not-allowed stg:disabled:opacity-50", enabled ? "stg:bg-primary" : "stg:bg-muted"), children: _jsx("span", { className: cn("stg:pointer-events-none stg:block stg:size-4 stg:rounded-full stg:bg-background stg:shadow-sm stg:ring-0 stg:transition-transform", enabled ? "stg:translate-x-4" : "stg:translate-x-0.5", "stg:mt-0.5") }) })] }), !hasPaymentMethod && (_jsx("p", { className: "stg:mt-3 stg:text-xs stg:text-muted-foreground", children: "A saved payment method is required to enable auto-recharge. Purchase a credit pack first to save a card." })), canConfigure && (_jsxs("div", { className: "stg:mt-4 stg:space-y-3", children: [_jsx(DollarInput, { id:
|
|
83
|
+
return (_jsxs("div", { className: cn("stg:rounded-lg stg:border stg:border-border stg:bg-card stg:px-4 stg:py-4", className), children: [_jsxs("div", { className: "stg:flex stg:items-center stg:justify-between", children: [_jsxs("div", { children: [_jsx("h3", { className: "stg:text-xs stg:font-semibold stg:text-foreground", children: "Auto-Recharge" }), _jsx("p", { className: "stg:mt-0.5 stg:text-[0.7rem] stg:text-muted-foreground", children: "Automatically add credits when your balance runs low." })] }), _jsx("button", { type: "button", role: "switch", "aria-checked": enabled, disabled: !canConfigure || isSubmitting, onClick: () => setEnabled((prev) => !prev), className: cn("stg:relative stg:inline-flex stg:h-5 stg:w-9 stg:shrink-0 stg:rounded-full stg:transition-colors", "stg:focus-visible:outline-none stg:focus-visible:ring-2 stg:focus-visible:ring-ring", "stg:disabled:cursor-not-allowed stg:disabled:opacity-50", enabled ? "stg:bg-primary" : "stg:bg-muted"), children: _jsx("span", { className: cn("stg:pointer-events-none stg:block stg:size-4 stg:rounded-full stg:bg-background stg:shadow-sm stg:ring-0 stg:transition-transform", enabled ? "stg:translate-x-4" : "stg:translate-x-0.5", "stg:mt-0.5") }) })] }), !hasPaymentMethod && (_jsx("p", { className: "stg:mt-3 stg:text-xs stg:text-muted-foreground", children: "A saved payment method is required to enable auto-recharge. Purchase a credit pack first to save a card." })), canConfigure && (_jsxs("div", { className: "stg:mt-4 stg:space-y-3", children: [_jsx(DollarInput, { id: `${baseId}-threshold`, label: "When balance drops below", value: threshold, onChange: setThreshold, disabled: isSubmitting, placeholder: "e.g. 5" }), _jsx(DollarInput, { id: `${baseId}-amount`, label: "Recharge amount", value: amount, onChange: setAmount, disabled: isSubmitting, placeholder: "e.g. 50" }), _jsx(DollarInput, { id: `${baseId}-cap`, label: "Monthly cap", value: cap, onChange: setCap, disabled: isSubmitting, placeholder: "e.g. 200" }), _jsxs("div", { className: "stg:flex stg:items-center stg:gap-3 stg:pt-1", children: [_jsx("button", { type: "button", disabled: !hasChanges || isSubmitting, onClick: handleSave, className: cn("stg:rounded-md stg:px-3 stg:py-1.5 stg:text-xs stg:font-medium stg:transition-colors", "stg:bg-primary stg:text-primary-foreground stg:hover:bg-primary-hover", "stg:disabled:pointer-events-none stg:disabled:opacity-50"), "aria-busy": isSubmitting, children: isSubmitting ? "Saving\u2026" : "Save" }), saved && (_jsx("span", { className: "stg:text-xs stg:text-emerald-600 stg:dark:text-emerald-400", children: "Saved" }))] }), error && (_jsx("p", { className: "stg:text-xs stg:text-destructive", role: "alert", children: getUserMessage(error) }))] }))] }));
|
|
83
84
|
}
|
|
84
85
|
// ---------------------------------------------------------------------------
|
|
85
86
|
// DollarInput (internal)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutoRechargeCard.js","sourceRoot":"","sources":["../../src/billing/AutoRechargeCard.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AutoRechargeCard.js","sourceRoot":"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AC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,GAChC,EACR,KAAK,IAAI,CACR,eAAM,SAAS,EAAC,4DAA4D,sBAErE,CACR,IACG,EAEL,KAAK,IAAI,CACR,YAAG,SAAS,EAAC,kCAAkC,EAAC,IAAI,EAAC,OAAO,YACzD,cAAc,CAAC,KAAK,CAAC,GACpB,CACL,IACG,CACP,IACG,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E,SAAS,WAAW,CAAC,EACnB,EAAE,EACF,KAAK,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,GAQZ;IACC,OAAO,CACL,0BACE,gBAAO,OAAO,EAAE,EAAE,EAAE,SAAS,EAAC,iDAAiD,YAC5E,KAAK,GACA,EACR,eAAK,SAAS,EAAC,uBAAuB,aACpC,eAAM,SAAS,EAAC,0HAA0H,kBAEnI,EACP,gBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAC,QAAQ,EACb,GAAG,EAAC,GAAG,EACP,IAAI,EAAC,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,CACX,mIAAmI,EACnI,kEAAkE,EAClE,qFAAqF,EACrF,yDAAyD,CAC1D,GACD,IACE,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BillingSection.d.ts","sourceRoot":"","sources":["../../src/billing/BillingSection.tsx"],"names":[],"mappings":"AAmBA,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,uDAAuD;IACvD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/C,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC7B,eAAe,EACf,wBAAwB,EACxB,SAAS,GACV,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"BillingSection.d.ts","sourceRoot":"","sources":["../../src/billing/BillingSection.tsx"],"names":[],"mappings":"AAmBA,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC,uDAAuD;IACvD,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/C,kCAAkC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC7B,eAAe,EACf,wBAAwB,EACxB,SAAS,GACV,EAAE,mBAAmB,2CAqCrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useId, useState } from "react";
|
|
4
4
|
import { getUserMessage } from "@stigmer/sdk";
|
|
5
5
|
import { useDeploymentMode } from "../deployment-mode.js";
|
|
6
6
|
import { CloudFeatureNotice } from "../internal/CloudFeatureNotice.js";
|
|
@@ -30,10 +30,11 @@ import { LowBalanceBanner } from "./LowBalanceBanner.js";
|
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
32
|
export function BillingSection({ checkoutSuccess, onDismissCheckoutSuccess, className, }) {
|
|
33
|
+
const headingId = useId();
|
|
33
34
|
const { activeOrg } = useOrg();
|
|
34
35
|
const mode = useDeploymentMode();
|
|
35
36
|
const orgId = activeOrg?.metadata?.id ?? "";
|
|
36
|
-
return (_jsxs("section", { "aria-labelledby":
|
|
37
|
+
return (_jsxs("section", { "aria-labelledby": headingId, className: className, children: [_jsx("h2", { id: headingId, className: "stg:text-foreground stg:mb-1 stg:text-sm stg:font-semibold", children: "Billing" }), _jsx("p", { className: "stg:text-muted-foreground stg:mb-4 stg:text-xs", children: "Manage credits, purchase credit packs, and view transaction history." }), mode === "local" ? (_jsx(CloudFeatureNotice, { children: "Credit billing and purchases are available on Stigmer Cloud. Local mode uses your own LLM API keys directly \u2014 no Stigmer credits needed." })) : !orgId ? (_jsx("p", { className: "stg:text-muted-foreground stg:py-4 stg:text-center stg:text-xs", children: "Select an organization to view billing." })) : (_jsx(BillingContent, { orgId: orgId, checkoutSuccess: checkoutSuccess, onDismissCheckoutSuccess: onDismissCheckoutSuccess }))] }));
|
|
37
38
|
}
|
|
38
39
|
// ---------------------------------------------------------------------------
|
|
39
40
|
// BillingContent (internal)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BillingSection.js","sourceRoot":"","sources":["../../src/billing/BillingSection.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"BillingSection.js","sourceRoot":"","sources":["../../src/billing/BillingSection.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,6BAA6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,MAAM,EAC7B,OAAO,EAAE,OAAO,GAChB,EAEF,KAAC,cAAc,IACb,aAAa,EAAE,OAAO,CAAC,MAAM,EAC7B,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,EACxD,UAAU,EAAE,cAAc,GAC1B,EAED,aAAa,IAAI,CAChB,YAAG,SAAS,EAAC,kCAAkC,EAAC,IAAI,EAAC,OAAO,YACzD,cAAc,CAAC,aAAa,CAAC,GAC5B,CACL,EAED,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,GAAI,IAC/B,CACP,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,mCAAmC;AACnC,8EAA8E;AAE9E,SAAS,qBAAqB,CAAC,EAC7B,SAAS,GAGV;IACC,OAAO,CACL,eACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,iNAAiN,aAE3N,wBACE,eAAM,SAAS,EAAC,iBAAiB,iCAAwB,EACxD,UAAU,oDAET,EACH,SAAS,IAAI,CACZ,iBACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAC,sFAAsF,gBACrF,SAAS,YAEpB,eACE,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,YAAY,GAAG,EACvB,eAAM,CAAC,EAAC,YAAY,GAAG,IACnB,GACC,CACV,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChannelConversationsDialog.d.ts","sourceRoot":"","sources":["../../src/channel/ChannelConversationsDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;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