@kortix/ui 0.15.9 → 0.15.10
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/dist/_vendor/kortix-shared.js +72 -1
- package/dist/_vendor/shared/index.d.ts +1 -0
- package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
- package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
- package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
- package/dist/_vendor/shared/session-delivery.d.ts +2 -0
- package/dist/customize/connectors/connectors-page.js +1 -1
- package/dist/customize/connectors/detail/connector-page.js +9 -4
- package/dist/customize/connectors/install/use-install.js +1 -1
- package/dist/customize/providers/provider-accordion.js +5 -5
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +8 -16
- package/dist/customize/providers/provider-sheet.js +4 -4
- package/dist/customize/sections/connector-connection-form.d.ts +0 -1
- package/dist/customize/sections/connector-connection-form.js +0 -9
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- package/dist/customize/settings/tabs/workspace-keys.js +53 -11
- package/dist/customize/shared/feature-gate-screen.js +1 -1
- package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
- package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
- package/dist/i18n/en.d.ts +7 -7
- package/dist/i18n/en.js +8 -8
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
- package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +1 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +1 -1
- package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
- package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
- package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
- package/dist/internal/hooks/use-review-session-summary.js +1 -1
- package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
- package/dist/internal/notifications/notification-inbox.d.ts +4 -10
- package/dist/internal/notifications/notification-inbox.js +8 -9
- package/dist/internal/stores/connector-gate-store.d.ts +3 -1
- package/dist/internal/stores/connector-gate-store.js +13 -3
- package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
- package/dist/internal/stores/upgrade-dialog-store.js +2 -0
- package/dist/lib/routes.d.ts +4 -11
- package/dist/lib/routes.js +3 -5
- package/dist/markdown/unified-markdown-utils.d.ts +7 -0
- package/dist/markdown/unified-markdown-utils.js +19 -0
- package/dist/markdown/unified-markdown.js +16 -3
- package/dist/primitives/alert-dialog.js +1 -1
- package/dist/primitives/dialog.js +3 -1
- package/dist/primitives/drawer.js +1 -1
- package/dist/primitives/modal.js +1 -1
- package/dist/primitives/preview-image.js +1 -1
- package/dist/primitives/sheet.js +1 -1
- package/dist/session/composer/ComposerCard.js +4 -2
- package/dist/session/composer/attachment-tile.d.ts +2 -26
- package/dist/session/composer/attachment-tile.js +3 -47
- package/dist/session/composer/composer-chat-input.d.ts +2 -1
- package/dist/session/composer/composer-chat-input.js +2 -2
- package/dist/session/composer/composer.d.ts +2 -0
- package/dist/session/composer/composer.js +5 -8
- package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
- package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
- package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
- package/dist/session/composer/draft/use-composer-draft.js +22 -2
- package/dist/session/composer/editor/composer-editor.d.ts +4 -2
- package/dist/session/composer/editor/composer-editor.js +7 -3
- package/dist/session/composer/hooks/use-composer-focus.js +4 -2
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/session/models/chatgpt-connection-button.js +5 -9
- package/dist/session/models/model-connection-gate.d.ts +2 -1
- package/dist/session/models/model-connection-gate.js +6 -3
- package/dist/session/models/model-connection-layout.d.ts +2 -0
- package/dist/session/models/model-connection-layout.js +4 -0
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- package/dist/session/models/subscription-offer.d.ts +4 -0
- package/dist/session/models/subscription-offer.js +11 -3
- package/dist/session/overrides/session-overrides-toolbar.js +2 -4
- package/dist/session/prompts/ask-deck.d.ts +5 -1
- package/dist/session/prompts/ask-deck.js +15 -3
- package/dist/session/prompts/question-labels.d.ts +16 -0
- package/dist/session/prompts/question-labels.js +34 -0
- package/dist/session/prompts/question-prompt.js +6 -6
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/stop-refusal.d.ts +6 -12
- package/dist/session/status/stop-refusal.js +6 -19
- package/dist/session/thread/agent-run-props.d.ts +19 -0
- package/dist/session/thread/agent-run-props.js +54 -0
- package/dist/session/thread/session-chat.js +27 -4
- package/dist/session/thread/transcript.d.ts +17 -1
- package/dist/session/thread/transcript.js +87 -23
- package/dist/session/tool/tools/bash-tool.d.ts +3 -52
- package/dist/session/tool/tools/bash-tool.js +3 -86
- package/dist/session/turn/answer-streaming.d.ts +21 -0
- package/dist/session/turn/answer-streaming.js +34 -0
- package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
- package/dist/session/turn/queued-prompt-bubbles.js +12 -0
- package/dist/session/turn/turn-work-accordion.d.ts +3 -1
- package/dist/session/turn/turn-work-accordion.js +2 -2
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +7 -7
- package/dist/workspace/home/first-chat.d.ts +7 -1
- package/dist/workspace/home/first-chat.js +12 -5
- package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
- package/dist/workspace/inbox/workspace-inbox.js +9 -51
- package/dist/workspace/layout/project-home.js +5 -11
- package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
- package/dist/workspace/layout/use-project-home-send.js +29 -15
- package/dist/workspace/new/advanced-fields.d.ts +4 -1
- package/dist/workspace/new/advanced-fields.js +2 -2
- package/dist/workspace/new/workspace-name.d.ts +9 -0
- package/dist/workspace/new/workspace-name.js +20 -0
- package/dist/workspace/projects/session-starter.d.ts +6 -4
- package/dist/workspace/projects/session-starter.js +8 -14
- package/dist/workspace/review/review-center.d.ts +6 -2
- package/dist/workspace/review/review-center.js +45 -25
- package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
- package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
- package/package.json +3 -7
- package/skills/kortix-ui/references/modules.md +1 -1
- package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
- package/dist/customize/connectors/invalidate-connections.js +0 -4
- package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
- package/dist/internal/notifications/use-inbox-summary.js +0 -28
|
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
14
14
|
* lists "Your keys for this workspace" and "Service account tokens".
|
|
15
15
|
*/
|
|
16
16
|
import { useRef, useState } from 'react';
|
|
17
|
-
import { createWorkspaceKey, getPatPolicy, listPermissions, listWorkspaceKeys, revokeWorkspaceKey, } from '@kortix/sdk';
|
|
17
|
+
import { createAccountToken, createWorkspaceKey, getPatPolicy, listPermissions, listWorkspaceKeys, revokeWorkspaceKey, } from '@kortix/sdk';
|
|
18
18
|
import { KeyIcon, PlusIcon, ProhibitIcon, RobotIcon, TerminalWindowIcon, TrashIcon, UserIcon } from '@phosphor-icons/react';
|
|
19
19
|
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
|
20
20
|
import { defaultKeyExpiryOption, keyExpiresAt, keyExpiryOptions } from '../../../access/iam/api-key-expiry.js';
|
|
@@ -154,6 +154,7 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
154
154
|
const actsAsLabel = useActsAsLabel();
|
|
155
155
|
const [name, setName] = useState('');
|
|
156
156
|
const [draft, setDraft] = useState({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
157
|
+
const [worksIn, setWorksIn] = useState('all');
|
|
157
158
|
const [access, setAccess] = useState('full');
|
|
158
159
|
const [picked, setPicked] = useState(() => new Set());
|
|
159
160
|
const [expiry, setExpiry] = useState('');
|
|
@@ -186,15 +187,43 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
186
187
|
}));
|
|
187
188
|
const selectedExpiry = expiryChoices.some((o) => o.value === expiry) ? expiry : defaultKeyExpiryOption(policy, tI18nComplete);
|
|
188
189
|
const principal = actsAsInput(draft);
|
|
189
|
-
|
|
190
|
+
// "All my workspaces" with "You" mints a personal key: the Access select is
|
|
191
|
+
// hidden there and its state is dead, so a leftover Custom (zero picks) must
|
|
192
|
+
// not hold the gate. Only the workspace path reads access/picked.
|
|
193
|
+
const personal = draft.actsAs === 'me' && worksIn === 'all';
|
|
194
|
+
const ready = !!name.trim() && !!principal && !(!personal && access === 'custom' && picked.size === 0);
|
|
190
195
|
const pickedBot = draft.actsAs === 'bot' && draft.bot && draft.bot !== NEW_BOT ? list?.bots.find((b) => b.bot_id === draft.bot) : undefined;
|
|
191
196
|
const mutation = useMutation({
|
|
192
|
-
mutationFn: () =>
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
197
|
+
mutationFn: async () => {
|
|
198
|
+
// "All my workspaces" mints a PERSONAL key (`project_id IS NULL`): it
|
|
199
|
+
// acts as the person in every workspace of theirs, exactly what a CLI
|
|
200
|
+
// login pastes into `kortix login --token`. The API refuses scopes on a
|
|
201
|
+
// personal key (a scope is a workspace concept), so it always carries
|
|
202
|
+
// the person's full role — the Access select below is the workspace
|
|
203
|
+
// path's alone. A personal key lists under Preferences → Personal keys,
|
|
204
|
+
// not in this workspace's list.
|
|
205
|
+
if (personal) {
|
|
206
|
+
const token = await createAccountToken({
|
|
207
|
+
name: name.trim(),
|
|
208
|
+
accountId,
|
|
209
|
+
expiresAt: keyExpiresAt(selectedExpiry),
|
|
210
|
+
});
|
|
211
|
+
return { name: token.name, secret: token.secret_key, personal: true, actsAsLabel: actsAsLabel({ type: 'me', name: null, service_account_id: null }) };
|
|
212
|
+
}
|
|
213
|
+
const key = await createWorkspaceKey(workspaceId, {
|
|
214
|
+
name: name.trim(),
|
|
215
|
+
actsAs: principal,
|
|
216
|
+
scopes: access === 'custom' ? [...picked] : access,
|
|
217
|
+
expiresAt: keyExpiresAt(selectedExpiry),
|
|
218
|
+
});
|
|
219
|
+
// The server's row resolves the principal's name; the draft resolves it here.
|
|
220
|
+
const actsAsLabelOf = draft.actsAs === 'me'
|
|
221
|
+
? actsAsLabel({ type: 'me', name: null, service_account_id: null })
|
|
222
|
+
: draft.actsAs === 'agent'
|
|
223
|
+
? actsAsLabel({ type: 'agent', name: draft.agent, service_account_id: null })
|
|
224
|
+
: actsAsLabel({ type: 'bot', name: pickedBot?.name ?? draft.newBotName, service_account_id: null });
|
|
225
|
+
return { name: key.name, secret: key.secret_key, personal: false, actsAsLabel: actsAsLabelOf };
|
|
226
|
+
},
|
|
198
227
|
onSuccess: (key) => {
|
|
199
228
|
onCreated();
|
|
200
229
|
setCreated(key);
|
|
@@ -209,6 +238,7 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
209
238
|
setTimeout(() => {
|
|
210
239
|
setName('');
|
|
211
240
|
setDraft({ actsAs: 'me', agent: '', bot: '', newBotName: '' });
|
|
241
|
+
setWorksIn('all');
|
|
212
242
|
setAccess('full');
|
|
213
243
|
setPicked(new Set());
|
|
214
244
|
setExpiry('');
|
|
@@ -223,18 +253,30 @@ function CreateWorkspaceKeyDialog({ workspaceId, accountId, list, open, onOpenCh
|
|
|
223
253
|
close();
|
|
224
254
|
else
|
|
225
255
|
onOpenChange(true);
|
|
226
|
-
}, children: _jsx(ModalContent, { className: "lg:max-w-lg", closeLabel: common('close'), children: created ? (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tTokens('copyNow') }), _jsx(ModalDescription, { children:
|
|
256
|
+
}, children: _jsx(ModalContent, { className: "lg:max-w-lg", closeLabel: common('close'), children: created ? (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: tTokens('copyNow') }), _jsx(ModalDescription, { children: created.personal
|
|
257
|
+
? t('createdPersonalDescription', { name: created.name })
|
|
258
|
+
: t('createdDescription', { name: created.name, actsAs: created.actsAsLabel }) })] }), _jsx(ModalBody, { children: _jsx(CopyRow, { value: created.secret, successMessage: tTokens('keyCopied') }) }), _jsx(ModalFooter, { children: _jsx(Button, { type: "button", size: "sm", onClick: close, children: tTokens('done') }) })] })) : (_jsxs(_Fragment, { children: [_jsxs(ModalHeader, { children: [_jsx(ModalTitle, { children: t('newKey') }), _jsx(ModalDescription, { children: t('description') })] }), _jsxs("form", { onSubmit: (event) => {
|
|
227
259
|
event.preventDefault();
|
|
228
260
|
if (!ready || mutation.isPending || submitInFlight.current)
|
|
229
261
|
return;
|
|
230
262
|
submitInFlight.current = true;
|
|
231
263
|
mutation.mutate();
|
|
232
|
-
}, children: [_jsxs(ModalBody, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-name", children: tTokens('name') }), _jsx(Input, { id: "workspace-key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: tTokens('namePlaceholder'), disabled: mutation.isPending, maxLength: 128, autoFocus: true, variant: "popover" })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-acts-as", children: t('actsAs') }), _jsxs(Select, { value: draft.actsAs, onValueChange: (value) => setDraft((d) => ({ ...d, actsAs: value })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-acts-as", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: options.map((option) => (_jsx(SelectItem, { value: option.value, disabled: option.block !== null, description: blockLabel(option.block) ?? undefined, children: option.value === 'me' ? t('actsAsMe') : option.value === 'agent' ? t('actsAsAgent') : t('actsAsBot') }, option.value))) })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: hint })] }), draft.actsAs === 'agent' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-agent", children: t('agent') }), _jsxs(Select, { value: draft.agent, onValueChange: (agent) => setDraft((d) => ({ ...d, agent })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-agent", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('agentPlaceholder') }) }), _jsx(SelectContent, { children: (list?.agents ?? []).map((agent) => (_jsx(SelectItem, { value: agent.name, children: agent.name }, agent.name))) })] })] })) : null, draft.actsAs === 'bot' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-bot", children: t('bot') }), _jsxs(Select, { value: draft.bot, onValueChange: (bot) => setDraft((d) => ({ ...d, bot })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-bot", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('botPlaceholder') }) }), _jsxs(SelectContent, { children: [(list?.bots ?? []).map((bot) => (_jsx(SelectItem, { value: bot.bot_id, children: bot.name }, bot.bot_id))), (list?.bots.length ?? 0) > 0 ? _jsx(SelectSeparator, {}) : null, _jsx(SelectItem, { value: NEW_BOT, children: t('newBot') })] })] }), draft.bot === NEW_BOT ? (_jsxs(_Fragment, { children: [_jsx(Input, { "aria-label": t('newBotName'), value: draft.newBotName, onChange: (event) => setDraft((d) => ({ ...d, newBotName: event.target.value })), placeholder: t('newBotNamePlaceholder'), maxLength: 128, disabled: mutation.isPending, variant: "popover" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('newBotHint') })] })) : pickedBot && !pickedBot.has_role ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('botNoRole') })) : null] })) : null, _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-
|
|
264
|
+
}, children: [_jsxs(ModalBody, { className: "space-y-4", children: [_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-name", children: tTokens('name') }), _jsx(Input, { id: "workspace-key-name", value: name, onChange: (event) => setName(event.target.value), placeholder: tTokens('namePlaceholder'), disabled: mutation.isPending, maxLength: 128, autoFocus: true, variant: "popover" })] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-acts-as", children: t('actsAs') }), _jsxs(Select, { value: draft.actsAs, onValueChange: (value) => setDraft((d) => ({ ...d, actsAs: value })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-acts-as", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: options.map((option) => (_jsx(SelectItem, { value: option.value, disabled: option.block !== null, description: blockLabel(option.block) ?? undefined, children: option.value === 'me' ? t('actsAsMe') : option.value === 'agent' ? t('actsAsAgent') : t('actsAsBot') }, option.value))) })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: hint })] }), draft.actsAs === 'agent' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-agent", children: t('agent') }), _jsxs(Select, { value: draft.agent, onValueChange: (agent) => setDraft((d) => ({ ...d, agent })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-agent", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('agentPlaceholder') }) }), _jsx(SelectContent, { children: (list?.agents ?? []).map((agent) => (_jsx(SelectItem, { value: agent.name, children: agent.name }, agent.name))) })] })] })) : null, draft.actsAs === 'bot' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-bot", children: t('bot') }), _jsxs(Select, { value: draft.bot, onValueChange: (bot) => setDraft((d) => ({ ...d, bot })), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-bot", size: "md", className: "w-full", children: _jsx(SelectValue, { placeholder: t('botPlaceholder') }) }), _jsxs(SelectContent, { children: [(list?.bots ?? []).map((bot) => (_jsx(SelectItem, { value: bot.bot_id, children: bot.name }, bot.bot_id))), (list?.bots.length ?? 0) > 0 ? _jsx(SelectSeparator, {}) : null, _jsx(SelectItem, { value: NEW_BOT, children: t('newBot') })] })] }), draft.bot === NEW_BOT ? (_jsxs(_Fragment, { children: [_jsx(Input, { "aria-label": t('newBotName'), value: draft.newBotName, onChange: (event) => setDraft((d) => ({ ...d, newBotName: event.target.value })), placeholder: t('newBotNamePlaceholder'), maxLength: 128, disabled: mutation.isPending, variant: "popover" }), _jsx("p", { className: "text-muted-foreground text-xs", children: t('newBotHint') })] })) : pickedBot && !pickedBot.has_role ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('botNoRole') })) : null] })) : null, draft.actsAs === 'me' ? (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-works-in", children: t('worksIn') }), _jsxs(Select, { value: worksIn, onValueChange: (value) => {
|
|
265
|
+
const next = value;
|
|
266
|
+
setWorksIn(next);
|
|
267
|
+
// The Access narrowing is the workspace path's alone;
|
|
268
|
+
// moving to the personal path must not strand a hidden
|
|
269
|
+
// "custom (0 picked)" behind a disabled Create.
|
|
270
|
+
if (next === 'all') {
|
|
271
|
+
setAccess('full');
|
|
272
|
+
setPicked(new Set());
|
|
273
|
+
}
|
|
274
|
+
}, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-works-in", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "all", children: t('worksInAll') }), _jsx(SelectItem, { value: "workspace", children: t('worksInWorkspace') })] })] }), personal ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('worksInAllHint') })) : null] })) : null, personal ? null : (_jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-access", children: tWorkspaces('keyAccess') }), _jsxs(Select, { value: access, onValueChange: (value) => setAccess(value), disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-access", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsxs(SelectContent, { children: [_jsx(SelectItem, { value: "full", children: tWorkspaces('keyAccessFull') }), _jsx(SelectItem, { value: "read", children: tWorkspaces('keyAccessRead') }), _jsx(SelectItem, { value: "custom", children: tWorkspaces('keyAccessCustom') })] })] }), _jsx("p", { className: "text-muted-foreground text-xs", children: access === 'read' ? tWorkspaces('keyAccessReadHint') : access === 'custom' ? t('accessCustomHint') : t('accessFullHint') }), access === 'custom' ? (_jsx(PermissionPicker, { query: permissionsQuery, picked: picked, onToggle: (action, on) => setPicked((prev) => {
|
|
233
275
|
const next = new Set(prev);
|
|
234
276
|
if (on)
|
|
235
277
|
next.add(action);
|
|
236
278
|
else
|
|
237
279
|
next.delete(action);
|
|
238
280
|
return next;
|
|
239
|
-
}), disabled: mutation.isPending })) : null] }), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-expiry", children: tTokens('expires') }), _jsxs(Select, { value: selectedExpiry, onValueChange: setExpiry, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-expiry", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: expiryChoices.map((choice) => (_jsx(SelectItem, { value: choice.value, children: choice.label }, choice.value))) })] }), policy?.require_expiry ? _jsx("p", { className: "text-muted-foreground text-xs", children: tTokens('expiryRequired') }) : null] })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: close, disabled: mutation.isPending, children: tTokens('cancel') }), _jsxs(Button, { type: "submit", size: "sm", disabled: !ready || mutation.isPending, className: "gap-1.5", children: [mutation.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tTokens('createKey')] })] })] })] })) }) }));
|
|
281
|
+
}), disabled: mutation.isPending })) : null] })), _jsxs("div", { className: "space-y-1.5", children: [_jsx(Label, { htmlFor: "workspace-key-expiry", children: tTokens('expires') }), _jsxs(Select, { value: selectedExpiry, onValueChange: setExpiry, disabled: mutation.isPending, children: [_jsx(SelectTrigger, { id: "workspace-key-expiry", size: "md", className: "w-full", children: _jsx(SelectValue, {}) }), _jsx(SelectContent, { children: expiryChoices.map((choice) => (_jsx(SelectItem, { value: choice.value, children: choice.label }, choice.value))) })] }), policy?.require_expiry ? _jsx("p", { className: "text-muted-foreground text-xs", children: tTokens('expiryRequired') }) : null] })] }), _jsxs(ModalFooter, { className: "sm:justify-between", children: [_jsx(Button, { type: "button", variant: "outline-ghost", size: "sm", onClick: close, disabled: mutation.isPending, children: tTokens('cancel') }), _jsxs(Button, { type: "submit", size: "sm", disabled: !ready || mutation.isPending, className: "gap-1.5", children: [mutation.isPending ? _jsx(Loading, { className: "size-3.5 shrink-0" }) : null, tTokens('createKey')] })] })] })] })) }) }));
|
|
240
282
|
}
|
|
@@ -49,7 +49,7 @@ export function FeatureGateScreen({ featureKey, featureName, description, intern
|
|
|
49
49
|
return (_jsxs("div", { className: "bg-popover rounded-md border px-4 py-5", children: [channels ? (_jsx(ChannelsSwitchDialog, { open: confirming, onOpenChange: setConfirming, turningOn: true, projectName: project.data?.name ?? '', onConfirm: () => {
|
|
50
50
|
setConfirming(false);
|
|
51
51
|
enable.mutate();
|
|
52
|
-
} })) : null, _jsxs("div", { className: "flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [_jsx("span", { className: "bg-muted/50 flex size-9 shrink-0 items-center justify-center rounded-sm", children: _jsx(FlagIcon, { className: "text-muted-foreground size-5" }) }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsxs("p", { className: "text-foreground text-sm font-medium", children: [featureName, " ", tI18nComplete.raw('text26965989cce5')] }), _jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: description }), internalOnly ? (_jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: tI18nComplete.raw('text1c41abcc2fff') })) : null] })] }), error ? (_jsx("p", { role: "alert", className: "text-destructive text-xs", children: error })) : null, projectId && !internalOnly ? (_jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(Button, { size: "sm", disabled:
|
|
52
|
+
} })) : null, _jsxs("div", { className: "flex flex-col gap-5 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { className: "flex min-w-0 items-start gap-3", children: [_jsx("span", { className: "bg-muted/50 flex size-9 shrink-0 items-center justify-center rounded-sm", children: _jsx(FlagIcon, { className: "text-muted-foreground size-5" }) }), _jsxs("div", { className: "min-w-0 space-y-1", children: [_jsxs("p", { className: "text-foreground text-sm font-medium", children: [featureName, " ", tI18nComplete.raw('text26965989cce5')] }), _jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: description }), internalOnly ? (_jsx("p", { className: "text-muted-foreground max-w-xl text-xs text-pretty", children: tI18nComplete.raw('text1c41abcc2fff') })) : null] })] }), error ? (_jsx("p", { role: "alert", className: "text-destructive text-xs", children: error })) : null, projectId && !internalOnly && !permission.isLoading && permission.allowed === true ? (_jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [_jsx(Button, { size: "sm", disabled: enable.isPending, onClick: () => {
|
|
53
53
|
setError('');
|
|
54
54
|
// Channels changes the sidebar for everyone: it asks first.
|
|
55
55
|
if (channels)
|
|
@@ -11,7 +11,7 @@ import { Button } from '../../../primitives/button.js';
|
|
|
11
11
|
import { Input } from '../../../primitives/input.js';
|
|
12
12
|
import Loading from '../../../primitives/loading.js';
|
|
13
13
|
import { RadioGroup, RadioGroupItem } from '../../../primitives/radio-group.js';
|
|
14
|
-
import { connectorConnectionQueryKeys } from '
|
|
14
|
+
import { connectorConnectionQueryKeys } from '../../../internal/hooks/connectors/invalidate-connections.js';
|
|
15
15
|
import { usePipedreamConnectProject } from '../../../internal/hooks/connectors/use-pipedream-connect-project.js';
|
|
16
16
|
import { useTranslations as useI18nTranslations } from '../../../i18n/index.js';
|
|
17
17
|
import { cn } from '../../../internal/lib/utils.js';
|
|
@@ -14,7 +14,8 @@ import { connectApp } from '../../../workspace/projects/onboarding/connect-app.j
|
|
|
14
14
|
import { addMcpServer, } from '../../connectors/add-mcp/add-mcp-server.js';
|
|
15
15
|
import { sdkAddMcpServerDeps } from '../../connectors/add-mcp/add-mcp-server-deps.js';
|
|
16
16
|
import { connectorHref } from '../../connectors/connector-routes.js';
|
|
17
|
-
import { buildEasyConnectConnectorDraft,
|
|
17
|
+
import { buildEasyConnectConnectorDraft, connectorSyncErrorForSlug, } from '../../sections/connector-connection-form.js';
|
|
18
|
+
import { connectorConnectionQueryKeys } from '../../../internal/hooks/connectors/invalidate-connections.js';
|
|
18
19
|
import { runConnectLinkFlow } from '../../../internal/hooks/connectors/use-connect-link.js';
|
|
19
20
|
import { useTranslations } from '../../../i18n/index.js';
|
|
20
21
|
import { PROJECT_ACTIONS } from '../../../internal/lib/project-actions.js';
|
package/dist/i18n/en.d.ts
CHANGED
|
@@ -288,6 +288,7 @@ declare const catalog: {
|
|
|
288
288
|
repositoryLabel: string;
|
|
289
289
|
loadingOptions: string;
|
|
290
290
|
managedUnavailable: string;
|
|
291
|
+
githubAfterCreate: string;
|
|
291
292
|
installationUnreachable: string;
|
|
292
293
|
reconnect: string;
|
|
293
294
|
managedImportLabel: string;
|
|
@@ -795,10 +796,6 @@ declare const catalog: {
|
|
|
795
796
|
name: string;
|
|
796
797
|
description: string;
|
|
797
798
|
};
|
|
798
|
-
pooled_provider_secrets: {
|
|
799
|
-
name: string;
|
|
800
|
-
description: string;
|
|
801
|
-
};
|
|
802
799
|
reminders: {
|
|
803
800
|
name: string;
|
|
804
801
|
description: string;
|
|
@@ -1560,6 +1557,7 @@ declare const catalog: {
|
|
|
1560
1557
|
agentWorkingOnFor: string;
|
|
1561
1558
|
somethingWrong: string;
|
|
1562
1559
|
notSent: string;
|
|
1560
|
+
computerDisconnected: string;
|
|
1563
1561
|
retry: string;
|
|
1564
1562
|
resume: string;
|
|
1565
1563
|
agentIsWorking: string;
|
|
@@ -2180,9 +2178,6 @@ declare const catalog: {
|
|
|
2180
2178
|
};
|
|
2181
2179
|
inbox: {
|
|
2182
2180
|
title: string;
|
|
2183
|
-
viewReview: string;
|
|
2184
|
-
viewNotifications: string;
|
|
2185
|
-
viewLabel: string;
|
|
2186
2181
|
description: string;
|
|
2187
2182
|
unreadLabel: string;
|
|
2188
2183
|
unreadCount: string;
|
|
@@ -10021,6 +10016,10 @@ declare const catalog: {
|
|
|
10021
10016
|
actsAsAgent: string;
|
|
10022
10017
|
actsAsBot: string;
|
|
10023
10018
|
actsAsMeHint: string;
|
|
10019
|
+
worksIn: string;
|
|
10020
|
+
worksInAll: string;
|
|
10021
|
+
worksInAllHint: string;
|
|
10022
|
+
worksInWorkspace: string;
|
|
10024
10023
|
actsAsAgentHint: string;
|
|
10025
10024
|
actsAsBotHint: string;
|
|
10026
10025
|
needsPermission: string;
|
|
@@ -10039,6 +10038,7 @@ declare const catalog: {
|
|
|
10039
10038
|
rowBot: string;
|
|
10040
10039
|
createdBy: string;
|
|
10041
10040
|
createdDescription: string;
|
|
10041
|
+
createdPersonalDescription: string;
|
|
10042
10042
|
accessFullHint: string;
|
|
10043
10043
|
accessCustomHint: string;
|
|
10044
10044
|
};
|
package/dist/i18n/en.js
CHANGED
|
@@ -289,6 +289,7 @@ const catalog = {
|
|
|
289
289
|
"repositoryLabel": "Repository",
|
|
290
290
|
"loadingOptions": "Loading repository options…",
|
|
291
291
|
"managedUnavailable": "Kortix-managed repositories are not available on this instance. A platform admin sets this up in the admin console.",
|
|
292
|
+
"githubAfterCreate": "To use your own GitHub for later workspaces, connect it in Workspace settings › Git once this one exists.",
|
|
292
293
|
"installationUnreachable": "This GitHub connection no longer works. Reconnect it to list repositories.",
|
|
293
294
|
"reconnect": "Reconnect in Git settings",
|
|
294
295
|
"managedImportLabel": "Import an existing managed repository",
|
|
@@ -796,10 +797,6 @@ const catalog = {
|
|
|
796
797
|
"name": "Network-Enforced Secrets",
|
|
797
798
|
"description": "Control which tools and destinations can receive workspace secrets."
|
|
798
799
|
},
|
|
799
|
-
"pooled_provider_secrets": {
|
|
800
|
-
"name": "Pooled Provider Secrets",
|
|
801
|
-
"description": "Members connect their own ChatGPT subscriptions and provider keys, share them when needed, and choose which ones each session uses."
|
|
802
|
-
},
|
|
803
800
|
"reminders": {
|
|
804
801
|
"name": "Loops",
|
|
805
802
|
"description": "Let agents and people schedule check-ins on a session, once or on repeat. Each fire re-prompts that session. Adds loops to the Triggers list, the session loop chip, and `kortix loop`."
|
|
@@ -1561,6 +1558,7 @@ const catalog = {
|
|
|
1561
1558
|
"agentWorkingOnFor": "is working on {task} · {time}",
|
|
1562
1559
|
"somethingWrong": "Something went wrong",
|
|
1563
1560
|
"notSent": "Not sent",
|
|
1561
|
+
"computerDisconnected": "This session's computer is disconnected.",
|
|
1564
1562
|
"retry": "Retry",
|
|
1565
1563
|
"resume": "Resume",
|
|
1566
1564
|
"agentIsWorking": "{agent} is working",
|
|
@@ -2181,9 +2179,6 @@ const catalog = {
|
|
|
2181
2179
|
},
|
|
2182
2180
|
"inbox": {
|
|
2183
2181
|
"title": "Inbox",
|
|
2184
|
-
"viewReview": "Review",
|
|
2185
|
-
"viewNotifications": "Notifications",
|
|
2186
|
-
"viewLabel": "Inbox view",
|
|
2187
2182
|
"description": "Updates about the sessions, triggers, and artifacts that concern you, from every workspace.",
|
|
2188
2183
|
"unreadLabel": "Inbox: {count} unread",
|
|
2189
2184
|
"unreadCount": "{count} unread",
|
|
@@ -10012,7 +10007,7 @@ const catalog = {
|
|
|
10012
10007
|
"apiKeysDescription": "Keys for scripts, CI and integrations. A key acts as you, an agent or a bot. The rules every key follows are in Security.",
|
|
10013
10008
|
"keys": {
|
|
10014
10009
|
"title": "API keys",
|
|
10015
|
-
"description": "Keys for scripts, CI and integrations. A key
|
|
10010
|
+
"description": "Keys for scripts, CI and integrations. A key acts as you, an agent or a bot; Works in sets which workspaces it reaches.",
|
|
10016
10011
|
"newKey": "New key",
|
|
10017
10012
|
"count": "{count, plural, one {# key} other {# keys}}",
|
|
10018
10013
|
"emptyTitle": "No API keys",
|
|
@@ -10022,6 +10017,10 @@ const catalog = {
|
|
|
10022
10017
|
"actsAsAgent": "An agent",
|
|
10023
10018
|
"actsAsBot": "A bot",
|
|
10024
10019
|
"actsAsMeHint": "Your role in this workspace. The key stops working when you leave.",
|
|
10020
|
+
"worksIn": "Works in",
|
|
10021
|
+
"worksInAll": "All my workspaces",
|
|
10022
|
+
"worksInAllHint": "Acts as you in every workspace of yours, with your full role. Manage it under Preferences → Personal keys.",
|
|
10023
|
+
"worksInWorkspace": "Only this workspace",
|
|
10025
10024
|
"actsAsAgentHint": "Exactly what the agent may do in kortix.yaml. Its actions are audited as the agent, and the key keeps working when you leave.",
|
|
10026
10025
|
"actsAsBotHint": "A bot for CI or an integration, with its own role. The key keeps working when you leave.",
|
|
10027
10026
|
"needsPermission": "Needs the permission to manage credentials",
|
|
@@ -10040,6 +10039,7 @@ const catalog = {
|
|
|
10040
10039
|
"rowBot": "Bot · {name}",
|
|
10041
10040
|
"createdBy": "Created by {email}",
|
|
10042
10041
|
"createdDescription": "{name} acts as {actsAs}. Kortix shows the key once: copy it now and store it as a secret.",
|
|
10042
|
+
"createdPersonalDescription": "{name} acts as you in every workspace of yours — manage it under Preferences → Personal keys. Kortix shows the key once: copy it now and store it as a secret.",
|
|
10043
10043
|
"accessFullHint": "Everything the key's principal may do in this workspace.",
|
|
10044
10044
|
"accessCustomHint": "Only the permissions you pick. Each one must be something the key's principal may do."
|
|
10045
10045
|
},
|
|
@@ -39,8 +39,14 @@ export interface CreditTier {
|
|
|
39
39
|
/** The tier ladder, smallest first. Mirrors `PLAN_PRESETS` in apps/api. */
|
|
40
40
|
export declare const CREDIT_TIERS: readonly CreditTier[];
|
|
41
41
|
export declare const CREDIT_TIER_GROUPS: readonly CreditTierGroup[];
|
|
42
|
-
/** The tier
|
|
42
|
+
/** The tier the marketing /pricing page opens on: the most popular one. */
|
|
43
43
|
export declare const DEFAULT_TIER_USD: number;
|
|
44
|
+
/**
|
|
45
|
+
* The tier an in-app upgrade opens on for an account with no plan: the
|
|
46
|
+
* smallest one, the "From $50" price the Credits card names. Opening on a
|
|
47
|
+
* larger tier quotes a price the copy never mentioned.
|
|
48
|
+
*/
|
|
49
|
+
export declare const ENTRY_TIER_USD: number;
|
|
44
50
|
/** The ladder tier for an amount, or `undefined` for an amount off the ladder (a legacy plan). */
|
|
45
51
|
export declare function tierForMonthlyUsd(monthlyUsd: number | null | undefined): CreditTier | undefined;
|
|
46
52
|
/** Whether `monthlyUsd` is an amount the API accepts: a whole dollar in range. */
|
|
@@ -57,8 +57,14 @@ export const CREDIT_TIERS = [
|
|
|
57
57
|
{ monthlyUsd: 50_000, group: 'large' },
|
|
58
58
|
];
|
|
59
59
|
export const CREDIT_TIER_GROUPS = ['small', 'growing', 'scale', 'large'];
|
|
60
|
-
/** The tier
|
|
60
|
+
/** The tier the marketing /pricing page opens on: the most popular one. */
|
|
61
61
|
export const DEFAULT_TIER_USD = CREDIT_TIERS.find((tier) => tier.popular).monthlyUsd;
|
|
62
|
+
/**
|
|
63
|
+
* The tier an in-app upgrade opens on for an account with no plan: the
|
|
64
|
+
* smallest one, the "From $50" price the Credits card names. Opening on a
|
|
65
|
+
* larger tier quotes a price the copy never mentioned.
|
|
66
|
+
*/
|
|
67
|
+
export const ENTRY_TIER_USD = CREDIT_TIERS[0].monthlyUsd;
|
|
62
68
|
/** The ladder tier for an amount, or `undefined` for an amount off the ladder (a legacy plan). */
|
|
63
69
|
export function tierForMonthlyUsd(monthlyUsd) {
|
|
64
70
|
return CREDIT_TIERS.find((tier) => tier.monthlyUsd === monthlyUsd);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @internal Kortix apps only. No semver: it may change in any release. */
|
|
2
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
3
|
+
/**
|
|
4
|
+
* The query keys every connection read uses (`sections/connector-connection-form`
|
|
5
|
+
* read them here before the form's own need was the only one). The SDK's `qk`
|
|
6
|
+
* plus the ad-hoc keys the panels hand to their queries.
|
|
7
|
+
*/
|
|
8
|
+
export declare function connectorConnectionQueryKeys(projectId: string): readonly [readonly ["kx", "project", string, "connectors"], readonly ["connections", string], readonly ["connections-all", string], readonly ["session-scope-catalog", string]];
|
|
9
|
+
/** Invalidate every connection read: an account row changed somewhere else. */
|
|
10
|
+
export declare function invalidateConnections(client: QueryClient, projectId: string): Promise<(void | undefined)[]>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { qk } from '@kortix/sdk/react';
|
|
2
|
+
/**
|
|
3
|
+
* The query keys every connection read uses (`sections/connector-connection-form`
|
|
4
|
+
* read them here before the form's own need was the only one). The SDK's `qk`
|
|
5
|
+
* plus the ad-hoc keys the panels hand to their queries.
|
|
6
|
+
*/
|
|
7
|
+
export function connectorConnectionQueryKeys(projectId) {
|
|
8
|
+
return [
|
|
9
|
+
qk.project.connectors(projectId),
|
|
10
|
+
['connections', projectId],
|
|
11
|
+
['connections-all', projectId],
|
|
12
|
+
['session-scope-catalog', projectId],
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
/** Invalidate every connection read: an account row changed somewhere else. */
|
|
16
|
+
export function invalidateConnections(client, projectId) {
|
|
17
|
+
return Promise.all(connectorConnectionQueryKeys(projectId).map((queryKey) => client.invalidateQueries({ queryKey }).catch(() => undefined)));
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { connectionSignInSteps } from '@kortix/sdk';
|
|
3
3
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
4
|
-
import { invalidateConnections } from '
|
|
4
|
+
import { invalidateConnections } from './invalidate-connections.js';
|
|
5
5
|
import { useTranslations } from '../../../i18n/index.js';
|
|
6
6
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
7
7
|
import { runConnectLinkFlow } from './use-connect-link.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { invalidateConnections } from '
|
|
3
|
+
import { invalidateConnections } from './invalidate-connections.js';
|
|
4
4
|
import { useTranslations } from '../../../i18n/index.js';
|
|
5
5
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
6
6
|
import { runConnectLinkFlow } from './use-connect-link.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { invalidateConnections } from '
|
|
3
|
+
import { invalidateConnections } from './invalidate-connections.js';
|
|
4
4
|
import { useTranslations } from '../../../i18n/index.js';
|
|
5
5
|
import { errorToast, successToast } from '../../../primitives/toast.js';
|
|
6
6
|
import { runConnectLinkFlow } from './use-connect-link.js';
|
|
@@ -53,6 +53,8 @@ export type NewProjectSessionOpts = {
|
|
|
53
53
|
*/
|
|
54
54
|
onCreating?: (sessionId: string) => void;
|
|
55
55
|
onError?: () => void;
|
|
56
|
+
/** Keep the submission pending while the connector gate owns its retry. */
|
|
57
|
+
deferConnectorRecovery?: boolean;
|
|
56
58
|
scope?: SessionScopeCommit;
|
|
57
59
|
create?: {
|
|
58
60
|
sandbox_slug?: string;
|
|
@@ -192,6 +192,7 @@ export function useNewProjectSession(projectId) {
|
|
|
192
192
|
projectId,
|
|
193
193
|
connectorConnections,
|
|
194
194
|
retry: () => startRef.current(opts),
|
|
195
|
+
onCancel: opts.deferConnectorRecovery ? opts.onError : undefined,
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
198
|
else {
|
|
@@ -204,7 +205,9 @@ export function useNewProjectSession(projectId) {
|
|
|
204
205
|
// No navigation happened, so release the claim now — the user stays
|
|
205
206
|
// where they are and must be able to try again immediately.
|
|
206
207
|
release();
|
|
207
|
-
|
|
208
|
+
if (!(action === 'connect' && getRequiredConnectorConnections(err) && opts.deferConnectorRecovery)) {
|
|
209
|
+
opts?.onError?.();
|
|
210
|
+
}
|
|
208
211
|
});
|
|
209
212
|
}, [
|
|
210
213
|
// `billingLoading` / `canRun` are deliberately absent: they are read
|
|
@@ -61,6 +61,6 @@ export declare function useSessionsAwaitingAnswer(projectId: string): ReadonlySe
|
|
|
61
61
|
* What waits on the person in this workspace's Review: the review summary's
|
|
62
62
|
* "needs you", plus the agents' questions and permission asks
|
|
63
63
|
* (`useSessionAsks`). Connector approvals are already in the summary. The
|
|
64
|
-
*
|
|
64
|
+
* sidebar's Review row (`project-spaces-nav`) shows this number.
|
|
65
65
|
*/
|
|
66
66
|
export declare function useReviewNeedsYouCount(projectId: string): number;
|
|
@@ -97,7 +97,7 @@ export function useSessionsAwaitingAnswer(projectId) {
|
|
|
97
97
|
* What waits on the person in this workspace's Review: the review summary's
|
|
98
98
|
* "needs you", plus the agents' questions and permission asks
|
|
99
99
|
* (`useSessionAsks`). Connector approvals are already in the summary. The
|
|
100
|
-
*
|
|
100
|
+
* sidebar's Review row (`project-spaces-nav`) shows this number.
|
|
101
101
|
*/
|
|
102
102
|
export function useReviewNeedsYouCount(projectId) {
|
|
103
103
|
const reviewNeedsYou = useReviewSessionSummary(projectId, { enabled: !!projectId }).totalNeedsYou;
|
|
@@ -284,8 +284,8 @@ function isRedeclaredInjectedIdentifierNoise(input) {
|
|
|
284
284
|
}
|
|
285
285
|
// Third-party tracking-pixel `Response.json()` noise. A marketing pixel
|
|
286
286
|
// (observed: Vector, `https://cdn.vector.co/pixel.js`, loaded on the marketing
|
|
287
|
-
// site by
|
|
288
|
-
//
|
|
287
|
+
// site by a visitor-identification vendor chain; apps/web removed that vendor
|
|
288
|
+
// on 2026-11-12, but a host page can still load the same pixel) fetches its own API
|
|
289
289
|
// (`https://api.vector.co/pixel/ip-info`) and calls `response.json()` without
|
|
290
290
|
// checking `response.ok`. When the site's bot protection 403s the request with
|
|
291
291
|
// an empty body, `Response.json()` rejects with the canonical DOM
|
|
@@ -15,15 +15,10 @@ export interface NotificationInboxViewProps {
|
|
|
15
15
|
prompt: string | null;
|
|
16
16
|
settings: InboxSettingsTarget;
|
|
17
17
|
/**
|
|
18
|
-
* The row above the page
|
|
19
|
-
*
|
|
18
|
+
* The row above the page (the account pages' top bar). Then the title is
|
|
19
|
+
* the column's heading. Absent: the project page header.
|
|
20
20
|
*/
|
|
21
21
|
header?: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Only the scrolling list, without the page frame and title: the workspace
|
|
24
|
-
* Inbox draws its own header and the Review | Notifications tabs above it.
|
|
25
|
-
*/
|
|
26
|
-
bare?: boolean;
|
|
27
22
|
onOpenRow: (row: InboxNotification) => void;
|
|
28
23
|
onMarkAllRead: () => void;
|
|
29
24
|
onRetry: () => void;
|
|
@@ -36,7 +31,7 @@ export interface NotificationInboxViewProps {
|
|
|
36
31
|
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
37
32
|
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
38
33
|
*/
|
|
39
|
-
export declare function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header,
|
|
34
|
+
export declare function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }: NotificationInboxViewProps): import("react").JSX.Element;
|
|
40
35
|
/**
|
|
41
36
|
* The Inbox page. Reads the inbox `NotificationHost` polls (one cache entry,
|
|
42
37
|
* so the sidebar count and the page agree), and renders nothing while signed
|
|
@@ -44,8 +39,7 @@ export declare function NotificationInboxView({ rows, state, unreadCount, prompt
|
|
|
44
39
|
* without it, "Notification settings" opens the project's Settings overlay.
|
|
45
40
|
* `header` sits above the page (the account pages' top bar).
|
|
46
41
|
*/
|
|
47
|
-
export declare function NotificationInbox({ settingsHref, header,
|
|
42
|
+
export declare function NotificationInbox({ settingsHref, header, }: {
|
|
48
43
|
settingsHref?: string;
|
|
49
44
|
header?: ReactNode;
|
|
50
|
-
bare?: boolean;
|
|
51
45
|
}): import("react").JSX.Element | null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
/**
|
|
4
|
-
* The Inbox (KRTX-1742): the person's notifications from every
|
|
5
|
-
* page.
|
|
6
|
-
*
|
|
4
|
+
* The Inbox (KRTX-1742): the person's notifications from every workspace, as
|
|
5
|
+
* a page. Notifications span every workspace, so the page is person-level:
|
|
6
|
+
* the workspace menu's Inbox row and `AccountTopBar` open it (KRTX-4799
|
|
7
|
+
* moved it out of the workspace Inbox page, which holds only Review).
|
|
7
8
|
*
|
|
8
9
|
* A row opens its subject (its session, its Artifact, or the Loops or
|
|
9
10
|
* Triggers page for an alert) and marks itself read. The tabs split what
|
|
@@ -59,16 +60,14 @@ const KIND_MARK = {
|
|
|
59
60
|
* footer. Inside a project the title is `ProjectPageHeader` (the Review,
|
|
60
61
|
* Goals and Artifacts pages' header: it owns the desktop title-bar band).
|
|
61
62
|
*/
|
|
62
|
-
export function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header,
|
|
63
|
+
export function NotificationInboxView({ rows, state, unreadCount, prompt, settings, header, onOpenRow, onMarkAllRead, onRetry, onTurnOn, onDismissPrompt, }) {
|
|
63
64
|
const t = useTranslations('notifications');
|
|
64
65
|
const [tab, setTab] = useState('all');
|
|
65
66
|
const visible = tabRows(rows, tab);
|
|
66
67
|
const needsCount = tabUnreadCount(rows, 'needs');
|
|
67
68
|
const doneCount = tabUnreadCount(rows, 'done');
|
|
68
69
|
const settingsLabel = (_jsxs(_Fragment, { children: [_jsx(GearSixIcon, { className: "size-3.5 shrink-0" }), t('inbox.settings')] }));
|
|
69
|
-
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className:
|
|
70
|
-
if (bare)
|
|
71
|
-
return list;
|
|
70
|
+
const list = (_jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: _jsxs("div", { className: "mx-auto flex w-full max-w-4xl flex-col gap-4 px-4 py-6 pb-20 md:px-8", children: [_jsxs("div", { className: "flex flex-col gap-1.5", children: [header ? _jsx("h1", { className: "text-foreground text-xl font-medium text-balance", children: t('inbox.title') }) : null, _jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.description') })] }), _jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsx(Tabs, { value: tab, onValueChange: (value) => setTab(value), children: _jsxs(TabsList, { variant: "secondary", size: "sm", children: [_jsxs(TabsTrigger, { value: "all", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabAll'), unreadCount > 0 ? _jsx(CountBadge, { count: unreadCount }) : null] }), _jsxs(TabsTrigger, { value: "needs", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabNeedsYou'), needsCount > 0 ? _jsx(CountBadge, { count: needsCount, tone: "waiting" }) : null] }), _jsxs(TabsTrigger, { value: "done", className: "w-fit flex-none gap-1.5 px-2.5", children: [t('inbox.tabDone'), doneCount > 0 ? _jsx(CountBadge, { count: doneCount }) : null] })] }) }), unreadCount > 0 ? (_jsxs(Button, { variant: "outline", size: "sm", className: "gap-1.5", onClick: onMarkAllRead, children: [_jsx(ChecksIcon, { className: "size-3.5 shrink-0" }), t('inbox.markAllRead')] })) : null] }), prompt ? (_jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: _jsx(BellIcon, {}) }), _jsx(BannerAlertTitle, { children: prompt }), _jsx(BannerAlertActions, { children: _jsxs(ButtonGroup, { children: [_jsx(Button, { variant: "secondary", size: "xs", onClick: onTurnOn, children: t('inbox.turnOn') }), _jsx(Hint, { label: t('inbox.dismiss'), side: "top", children: _jsx(Button, { variant: "secondary", size: "icon-sm", "aria-label": t('inbox.dismiss'), onClick: onDismissPrompt, children: _jsx(XIcon, { className: "size-3.5 shrink-0" }) }) })] }) })] })) : null, state === 'loading' ? (_jsx("div", { className: "space-y-0.5", children: [0, 1, 2].map((index) => (_jsx(Skeleton, { className: "h-14 w-full rounded-lg" }, index))) })) : state === 'error' ? (_jsx(ErrorState, { size: "sm", title: t('inbox.loadError'), action: _jsx(Button, { variant: "outline", size: "sm", onClick: onRetry, children: t('inbox.retry') }) })) : visible.length === 0 ? (_jsx(EmptyState, { size: "sm", media: _jsx(EmptyArt, { icon: BellIcon }), title: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYou') : t('inbox.empty'), description: tab === 'needs' && rows.length > 0 ? t('inbox.emptyNeedsYouDescription') : t('inbox.emptyDescription') })) : (_jsx("ul", { className: "space-y-0.5", children: visible.map((row) => (_jsx("li", { children: _jsx(InboxRow, { row: row, onOpen: () => onOpenRow(row) }) }, row.id))) })), _jsxs("div", { className: "flex flex-col gap-2 pt-2 sm:flex-row sm:items-center sm:justify-between", children: [_jsx("p", { className: "text-muted-foreground text-sm text-pretty", children: t('inbox.emailOptIn') }), 'href' in settings ? (_jsx(Button, { asChild: true, variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", children: _jsx(UiLink, { href: settings.href, children: settingsLabel }) })) : (_jsx(Button, { variant: "outline", size: "sm", className: "gap-1.5 self-start sm:self-auto", onClick: settings.onOpen, children: settingsLabel }))] })] }) }));
|
|
72
71
|
return (
|
|
73
72
|
// `h-svh`: nothing above this box has a definite height (as the Review page).
|
|
74
73
|
_jsxs("div", { className: "flex h-svh min-h-0 flex-col overflow-hidden", children: [header ?? _jsx(ProjectPageHeader, { title: t('inbox.title') }), list] }));
|
|
@@ -88,7 +87,7 @@ function InboxRow({ row, onOpen }) {
|
|
|
88
87
|
* without it, "Notification settings" opens the project's Settings overlay.
|
|
89
88
|
* `header` sits above the page (the account pages' top bar).
|
|
90
89
|
*/
|
|
91
|
-
export function NotificationInbox({ settingsHref, header,
|
|
90
|
+
export function NotificationInbox({ settingsHref, header, }) {
|
|
92
91
|
const t = useTranslations('notifications');
|
|
93
92
|
const viewerId = useUiViewerId();
|
|
94
93
|
const inbox = useNotificationInbox({ userId: viewerId });
|
|
@@ -107,7 +106,7 @@ export function NotificationInbox({ settingsHref, header, bare, }) {
|
|
|
107
106
|
!promptDismissed;
|
|
108
107
|
return (_jsx(NotificationInboxView, { rows: inbox.data?.notifications ?? [], state: inbox.data ? 'ready' : inbox.isError ? 'error' : 'loading', unreadCount: inbox.unreadCount, prompt: offerTurnOn ? (webPushSupported() ? t('inbox.promptPush') : t('inbox.promptBackground')) : null, settings: settingsHref
|
|
109
108
|
? { href: settingsHref }
|
|
110
|
-
: { onOpen: () => useSettingsPanelStore.getState().openSettings('sessions') }, header: header,
|
|
109
|
+
: { onOpen: () => useSettingsPanelStore.getState().openSettings('sessions') }, header: header, onOpenRow: (row) => {
|
|
111
110
|
if (!row.read)
|
|
112
111
|
inbox.markRead([row.id]).catch(() => { });
|
|
113
112
|
}, onMarkAllRead: () => {
|
|
@@ -20,8 +20,10 @@ interface ConnectorGateState {
|
|
|
20
20
|
projectId: string;
|
|
21
21
|
connectorConnections: ConnectorGateConnection[];
|
|
22
22
|
retry: () => void;
|
|
23
|
+
onCancel?: () => void;
|
|
23
24
|
}) => void;
|
|
24
|
-
closeConnectorGate: () => void;
|
|
25
|
+
closeConnectorGate: (retrying?: boolean) => void;
|
|
26
|
+
onCancel?: () => void;
|
|
25
27
|
}
|
|
26
28
|
export declare const useConnectorGateStore: import("zustand").UseBoundStore<import("zustand").StoreApi<ConnectorGateState>>;
|
|
27
29
|
export {};
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { create } from 'zustand';
|
|
2
|
-
export const useConnectorGateStore = create((set) => ({
|
|
2
|
+
export const useConnectorGateStore = create((set, get) => ({
|
|
3
3
|
isOpen: false,
|
|
4
4
|
projectId: null,
|
|
5
5
|
connectorConnections: [],
|
|
6
6
|
retry: null,
|
|
7
|
-
openConnectorGate: ({ projectId, connectorConnections, retry }) =>
|
|
8
|
-
|
|
7
|
+
openConnectorGate: ({ projectId, connectorConnections, retry, onCancel }) => {
|
|
8
|
+
const previousCancel = get().onCancel;
|
|
9
|
+
set({ isOpen: true, projectId, connectorConnections, retry, onCancel });
|
|
10
|
+
if (previousCancel !== onCancel)
|
|
11
|
+
previousCancel?.();
|
|
12
|
+
},
|
|
13
|
+
closeConnectorGate: (retrying = false) => {
|
|
14
|
+
const cancel = get().onCancel;
|
|
15
|
+
set({ isOpen: false, projectId: null, connectorConnections: [], retry: null, onCancel: undefined });
|
|
16
|
+
if (!retrying)
|
|
17
|
+
cancel?.();
|
|
18
|
+
},
|
|
9
19
|
}));
|
|
@@ -19,6 +19,10 @@ interface UpgradeDialogState {
|
|
|
19
19
|
* its view and its copy from, so the gate that opened it and the modal can
|
|
20
20
|
* never say opposite things about the same account. */
|
|
21
21
|
billingState?: BillingState;
|
|
22
|
+
/** The Credits tier the person last picked in the dialog. Reopening the
|
|
23
|
+
* dialog keeps it, so it opens on the entry tier only until they pick. */
|
|
24
|
+
pickedMonthlyUsd?: number;
|
|
25
|
+
setPickedMonthlyUsd: (monthlyUsd: number) => void;
|
|
22
26
|
openUpgradeDialog: (opts: {
|
|
23
27
|
reason?: UpgradeReason;
|
|
24
28
|
message?: string;
|