@kortix/ui 0.15.7 → 0.15.9
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/README.md +7 -7
- package/dist/_vendor/kortix-shared.js +39 -1
- package/dist/_vendor/shared/my-kortix-agent.d.ts +7 -0
- package/dist/_vendor/shared/pixel-mark.d.ts +18 -0
- package/dist/access/access/access-dialog-share.js +12 -6
- package/dist/access/access/share-selection.d.ts +9 -0
- package/dist/access/access/share-selection.js +64 -0
- package/dist/customize/connectors/catalog/connector-categories.d.ts +2 -2
- package/dist/customize/connectors/catalog/connector-categories.js +2 -2
- package/dist/customize/connectors/connector-identity.js +3 -3
- package/dist/customize/connectors/detail/app-page.js +2 -2
- package/dist/customize/connectors/detail/connector-accounts.d.ts +3 -1
- package/dist/customize/connectors/detail/connector-accounts.js +2 -2
- package/dist/customize/connectors/detail/connector-modal.js +1 -1
- package/dist/customize/connectors/detail/connector-notice-view.d.ts +4 -0
- package/dist/customize/connectors/detail/connector-notice-view.js +4 -0
- package/dist/customize/connectors/detail/connector-notice.d.ts +31 -4
- package/dist/customize/connectors/detail/connector-notice.js +23 -4
- package/dist/customize/connectors/detail/connector-page.js +27 -7
- package/dist/customize/connectors/detail/connector-status.d.ts +12 -1
- package/dist/customize/connectors/detail/connector-status.js +11 -0
- package/dist/customize/connectors/detail/status-badge.d.ts +3 -3
- package/dist/customize/connectors/detail/status-badge.js +2 -1
- package/dist/customize/connectors/detail/use-connector-detail.js +10 -2
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.d.ts +13 -0
- package/dist/customize/connectors/detail/use-mcp-oauth-sign-in.js +29 -0
- package/dist/customize/providers/provider-accordion.js +5 -4
- package/dist/customize/providers/provider-connect.js +3 -1
- package/dist/customize/providers/provider-sheet.js +9 -4
- package/dist/customize/sections/component/email-connect-form.js +4 -2
- package/dist/customize/sections/connectors-view.d.ts +4 -1
- package/dist/customize/sections/connectors-view.js +42 -7
- package/dist/customize/sections/gateway-view.d.ts +1 -1
- package/dist/customize/sections/gateway-view.js +1 -1
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
- package/dist/customize/sections/view/account-secret-resources-panel.js +48 -7
- package/dist/customize/sections/view/agent-editor-basics-fields.js +1 -1
- package/dist/customize/sections/view/gateway/gateway-logs.d.ts +1 -1
- package/dist/customize/sections/view/git-view.js +1 -1
- package/dist/customize/sections/view/permission-editor.js +1 -1
- package/dist/customize/sections/view/secret-delivery.d.ts +9 -2
- package/dist/customize/sections/view/secret-delivery.js +14 -4
- package/dist/customize/sections/view/secrets-view.js +21 -5
- package/dist/customize/sections/view/subscription-usage.d.ts +3 -32
- package/dist/customize/sections/view/subscription-usage.js +2 -86
- package/dist/customize/shared/entity/entity-modal.js +8 -10
- package/dist/customize/triggers/schedule/schedule-builder.js +1 -1
- package/dist/customize/triggers/schedule/schedule-copy.js +4 -0
- package/dist/customize/triggers/schedule/schedule-detail-sheet.js +14 -3
- package/dist/customize/triggers/schedule/then-fields.d.ts +3 -1
- package/dist/customize/triggers/schedule/then-fields.js +8 -4
- package/dist/customize/triggers/schedule/trigger-composer.js +1 -1
- package/dist/customize/triggers/schedule/trigger-list.d.ts +3 -1
- package/dist/customize/triggers/schedule/trigger-list.js +18 -2
- package/dist/customize/triggers/schedule/trigger-runs-logic.js +4 -2
- package/dist/customize/triggers/schedule/trigger-runs-panel.js +4 -1
- package/dist/files/project/components/drive-toolbar.d.ts +1 -1
- package/dist/files/project/components/drive-toolbar.js +1 -1
- package/dist/files/project/store/version-store.d.ts +1 -1
- package/dist/files/renderers/pptx-renderer.js +5 -20
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.d.ts +3 -2
- package/dist/files/renderers/presentation/FullScreenPresentationViewer.js +23 -304
- package/dist/files/renderers/presentation/presentation-export-menu.d.ts +14 -0
- package/dist/files/renderers/presentation/presentation-export-menu.js +44 -0
- package/dist/files/renderers/presentation/presentation-utils.d.ts +1 -0
- package/dist/files/renderers/presentation/presentation-utils.js +4 -0
- package/dist/files/renderers/presentation/slide-iframe.d.ts +23 -0
- package/dist/files/renderers/presentation/slide-iframe.js +61 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.d.ts +39 -0
- package/dist/files/renderers/presentation/use-presentation-metadata.js +137 -0
- package/dist/files/renderers/presentation/use-slide-navigation.d.ts +17 -0
- package/dist/files/renderers/presentation/use-slide-navigation.js +82 -0
- package/dist/files/renderers/shared/scroll-area-compat.d.ts +6 -6
- package/dist/files/renderers/shared/scroll-area-compat.js +7 -9
- package/dist/files/renderers/shared/select-compat.js +3 -7
- package/dist/files/renderers/shared/use-stage-fit-scale.d.ts +19 -0
- package/dist/files/renderers/shared/use-stage-fit-scale.js +41 -0
- package/dist/files/renderers/show-content-renderer.js +16 -11
- package/dist/files/renderers/xlsx/xlsx-renderer.d.ts +4 -13
- package/dist/files/renderers/xlsx/xlsx-renderer.js +6 -63
- package/dist/files/renderers/xlsx/xlsx-viewer.d.ts +4 -2
- package/dist/files/renderers/xlsx/xlsx-viewer.js +28 -34
- package/dist/files/viewer/file-content-renderer.js +1 -4
- package/dist/files/viewer/file-preview-modal.d.ts +10 -11
- package/dist/files/viewer/file-preview-modal.js +17 -18
- package/dist/files/viewer/use-file-content-state.js +10 -9
- package/dist/i18n/en.d.ts +51 -0
- package/dist/i18n/en.js +58 -7
- package/dist/index.js +1 -1
- package/dist/internal/account-hub/account-hub-location.js +2 -2
- package/dist/internal/account-hub/use-account-members.d.ts +28 -1
- package/dist/internal/account-hub/use-account-members.js +27 -10
- package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
- package/dist/internal/chrome/use-chrome-offered.js +4 -2
- package/dist/internal/components/agent-mark.d.ts +1 -8
- package/dist/internal/components/agent-mark.js +2 -19
- package/dist/internal/hooks/connectors/use-finish-sign-in.d.ts +13 -0
- package/dist/internal/hooks/connectors/use-finish-sign-in.js +33 -0
- package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +6 -1
- package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +6 -1
- package/dist/internal/lib/error-handler.js +33 -0
- package/dist/internal/lib/navigation/modified-click.js +2 -2
- package/dist/internal/lib/pixel-mark.d.ts +3 -20
- package/dist/internal/lib/pixel-mark.js +3 -34
- package/dist/internal/lib/trigger-clock.d.ts +7 -2
- package/dist/internal/lib/trigger-clock.js +17 -3
- package/dist/internal/stores/active-space-store.d.ts +1 -1
- package/dist/internal/stores/browser-recents-store.d.ts +1 -1
- package/dist/internal/stores/current-account-store.d.ts +1 -1
- package/dist/internal/stores/first-chat-store.d.ts +1 -1
- package/dist/internal/stores/mobile-app-promo-store.d.ts +1 -1
- package/dist/internal/stores/session-browser-store.d.ts +1 -1
- package/dist/internal/stores/session-expanded-store.d.ts +1 -1
- package/dist/internal/stores/session-filter-store.d.ts +1 -1
- package/dist/internal/stores/session-history-view-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.d.ts +1 -1
- package/dist/internal/stores/session-hover-store.js +1 -1
- package/dist/internal/stores/session-panel-memory-store.d.ts +1 -1
- package/dist/internal/stores/sound-store.d.ts +1 -1
- package/dist/internal/stores/tab-store.d.ts +1 -1
- package/dist/internal/stores/user-preferences-store.d.ts +1 -1
- package/dist/internal/stores/web-notification-store.d.ts +1 -1
- package/dist/lib/base-ui-compat.d.ts +149 -0
- package/dist/lib/base-ui-compat.js +339 -0
- package/dist/lib/portal-container.d.ts +3 -7
- package/dist/lib/portal-container.js +5 -3
- package/dist/lib/z-stack.d.ts +9 -5
- package/dist/lib/z-stack.js +17 -7
- package/dist/primitives/accordion.d.ts +36 -5
- package/dist/primitives/accordion.js +41 -8
- package/dist/primitives/alert-dialog.d.ts +33 -11
- package/dist/primitives/alert-dialog.js +41 -19
- package/dist/primitives/avatar.d.ts +5 -2
- package/dist/primitives/avatar.js +3 -3
- package/dist/primitives/badge.js +1 -1
- package/dist/primitives/breadcrumb.js +1 -1
- package/dist/primitives/button-group.js +3 -3
- package/dist/primitives/button.js +1 -1
- package/dist/primitives/checkbox.d.ts +14 -5
- package/dist/primitives/checkbox.js +24 -9
- package/dist/primitives/collapsible.d.ts +16 -4
- package/dist/primitives/collapsible.js +18 -7
- package/dist/primitives/command-core.d.ts +121 -0
- package/dist/primitives/command-core.js +642 -0
- package/dist/primitives/command.d.ts +38 -4
- package/dist/primitives/command.js +22 -13
- package/dist/primitives/context-menu.d.ts +61 -31
- package/dist/primitives/context-menu.js +40 -53
- package/dist/primitives/dialog.d.ts +48 -10
- package/dist/primitives/dialog.js +48 -19
- package/dist/primitives/disclosure.d.ts +1 -1
- package/dist/primitives/disclosure.js +2 -2
- package/dist/primitives/drawer.d.ts +28 -9
- package/dist/primitives/drawer.js +42 -18
- package/dist/primitives/dropdown-menu.d.ts +55 -33
- package/dist/primitives/dropdown-menu.js +46 -82
- package/dist/primitives/faded-scroll-area.js +2 -1
- package/dist/primitives/hint.js +3 -3
- package/dist/primitives/hover-card.d.ts +17 -5
- package/dist/primitives/hover-card.js +45 -8
- package/dist/primitives/item.js +2 -2
- package/dist/primitives/label.d.ts +5 -2
- package/dist/primitives/label.js +10 -3
- package/dist/primitives/menu-base.d.ts +150 -0
- package/dist/primitives/menu-base.js +171 -0
- package/dist/primitives/menu-recipe.d.ts +1 -1
- package/dist/primitives/menu-recipe.js +2 -7
- package/dist/primitives/modal.d.ts +19 -52
- package/dist/primitives/modal.js +24 -28
- package/dist/primitives/navigation-menu.d.ts +36 -11
- package/dist/primitives/navigation-menu.js +31 -12
- package/dist/primitives/popover.d.ts +31 -6
- package/dist/primitives/popover.js +79 -12
- package/dist/primitives/preview-image.d.ts +18 -7
- package/dist/primitives/preview-image.js +14 -11
- package/dist/primitives/progress.d.ts +4 -2
- package/dist/primitives/progress.js +4 -3
- package/dist/primitives/project-icon-picker.js +2 -2
- package/dist/primitives/radio-group.d.ts +28 -5
- package/dist/primitives/radio-group.js +18 -10
- package/dist/primitives/scroll-area.d.ts +2 -2
- package/dist/primitives/scroll-area.js +8 -3
- package/dist/primitives/select.d.ts +55 -12
- package/dist/primitives/select.js +93 -36
- package/dist/primitives/separator.d.ts +6 -2
- package/dist/primitives/separator.js +10 -2
- package/dist/primitives/sheet.d.ts +17 -10
- package/dist/primitives/sheet.js +19 -22
- package/dist/primitives/sidebar-menu-primitives.js +8 -8
- package/dist/primitives/slider-native.d.ts +2 -2
- package/dist/primitives/slider-native.js +11 -9
- package/dist/primitives/slider.d.ts +24 -6
- package/dist/primitives/slider.js +26 -24
- package/dist/primitives/slot.d.ts +6 -0
- package/dist/primitives/slot.js +7 -0
- package/dist/primitives/split-sheet.js +1 -1
- package/dist/primitives/stepper.js +1 -1
- package/dist/primitives/switch.d.ts +16 -3
- package/dist/primitives/switch.js +7 -6
- package/dist/primitives/tabs.d.ts +36 -20
- package/dist/primitives/tabs.js +131 -102
- package/dist/primitives/toggle.d.ts +16 -3
- package/dist/primitives/toggle.js +8 -3
- package/dist/primitives/tooltip.d.ts +24 -5
- package/dist/primitives/tooltip.js +32 -10
- package/dist/primitives/type-to-confirm-dialog.d.ts +1 -1
- package/dist/primitives/type-to-confirm-dialog.js +1 -1
- package/dist/session/composer/animated-placeholder.js +1 -1
- package/dist/session/composer/chat-input/chat-input-control.js +3 -3
- package/dist/session/composer/editor/composer-editor.js +1 -1
- package/dist/session/composer/menus/menu-shell.d.ts +1 -1
- package/dist/session/composer/menus/menu-shell.js +1 -1
- package/dist/session/composer/menus/mount.js +1 -1
- package/dist/session/composer/reasoning-effort-selector.js +1 -1
- package/dist/session/header/session-site-header.js +2 -2
- package/dist/session/header/subagent-hover-card.js +2 -2
- package/dist/session/media/image-preview.js +1 -1
- package/dist/session/models/model-connection-gate.js +16 -3
- package/dist/session/models/model-picker-panel.js +6 -2
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +18 -12
- package/dist/session/models/provider-key-action.d.ts +10 -0
- package/dist/session/models/provider-key-action.js +35 -0
- package/dist/session/models/provider-key-slot.d.ts +9 -0
- package/dist/session/models/provider-key-slot.js +19 -0
- package/dist/session/models/subscription-switcher.d.ts +37 -0
- package/dist/session/models/subscription-switcher.js +97 -0
- package/dist/session/models/subscription-windows.d.ts +40 -0
- package/dist/session/models/subscription-windows.js +86 -0
- package/dist/session/overrides/session-overrides-control.js +3 -3
- package/dist/session/panel/diff-dialog.js +1 -1
- package/dist/session/panel/easy/detail-view.js +3 -3
- package/dist/session/panel/mobile-tool-drawer.js +2 -2
- package/dist/session/panel/panel-fallback.js +1 -1
- package/dist/session/panel/session-files-explorer.d.ts +1 -1
- package/dist/session/panel/session-files-explorer.js +1 -1
- package/dist/session/prompts/session-connect-prompt.d.ts +40 -0
- package/dist/session/prompts/session-connect-prompt.js +126 -0
- package/dist/session/status/session-error-banner.d.ts +1 -1
- package/dist/session/status/session-error-banner.js +12 -4
- package/dist/session/thread/session-chat.js +9 -4
- package/dist/session/thread/session-context-message-explorer.js +1 -1
- package/dist/session/thread/transcript.js +31 -7
- package/dist/session/thread/turn-share.js +3 -4
- package/dist/session/tool/shared/show-helpers.js +1 -1
- package/dist/session/turn/message-time-label.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/test-utils/intl.d.ts +51 -0
- package/dist/workspace/projects/modal/project-icon-field.js +9 -23
- package/dist/workspace/review/review-center.js +1 -1
- package/dist/workspace/sessions/session-row.js +1 -1
- package/dist/workspace/sidebar/project-session-list.js +2 -2
- package/dist/workspace/sidebar/session-brief-hover-card.d.ts +1 -1
- package/dist/workspace/sidebar/session-brief-hover-card.js +3 -3
- package/dist/workspace/sidebar/session-title.d.ts +2 -2
- package/dist/workspace/sidebar/session-title.js +2 -2
- package/dist/workspace/sidebar/workspace-menu-section.js +1 -1
- package/dist/workspace/spaces/space-links.js +1 -1
- package/dist/workspace/spaces/space-threads-tab.js +1 -1
- package/package.json +16 -35
- package/skills/kortix-ui/SKILL.md +1 -1
- package/skills/kortix-ui/references/custom-dashboard.md +1 -1
package/README.md
CHANGED
|
@@ -310,9 +310,9 @@ How it stays themable:
|
|
|
310
310
|
with their variable (`--text-sm`, `--shadow-md`, `--ease-default`, bare
|
|
311
311
|
`rounded`) live in `@theme inline reference`, so Tailwind never emits the
|
|
312
312
|
`--x: var(--x)` cycle into `:root`.
|
|
313
|
-
- Every
|
|
313
|
+
- Every overlay portal goes through `withPortalContainer`
|
|
314
314
|
(`src/lib/portal-container.tsx`). Without a `ThemeScope` it portals to
|
|
315
|
-
`document.body
|
|
315
|
+
`document.body`.
|
|
316
316
|
- A new component reads tokens only: no hex, no palette class, no fixed
|
|
317
317
|
radius. `apps/web` must look identical: every new variable defaults to the
|
|
318
318
|
value it replaces.
|
|
@@ -320,11 +320,11 @@ How it stays themable:
|
|
|
320
320
|
## Known issues
|
|
321
321
|
|
|
322
322
|
- Server rendering: the entries that render sessions or files (`session`, `composer`, `session-panel`, `workspace`, `files`, `file-viewer`, `markdown`, `genui`, `customize`) import CSS (KaTeX and others) from JS, so plain Node cannot evaluate them (`ERR_UNKNOWN_FILE_EXTENSION ".css"`). A Vite SSR host adds `ssr: { noExternal: ['@kortix/ui'] }`. A Next.js host lists `@kortix/ui` in `transpilePackages`. Or load those blocks on the client only (`lazyClient`). The root, `theme`, `i18n`, `icons`, `diff`, `changes`, `terminal`, `browser`, `apps` and `access` entries evaluate in Node.
|
|
323
|
-
- `
|
|
324
|
-
|
|
325
|
-
`cmdk`
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
- `Command` does not depend on the `cmdk` package. `src/primitives/command-core.tsx`
|
|
324
|
+
is a vendored MIT port of `cmdk` 0.2.1 without its Radix dialog. It keeps cmdk's
|
|
325
|
+
selection model, filter scoring and `[cmdk-*]` attributes, which `command.tsx`
|
|
326
|
+
and the ⌘K palette are tuned to. `useCommandState` is exported from
|
|
327
|
+
`@kortix/ui/command`.
|
|
328
328
|
|
|
329
329
|
## Rules
|
|
330
330
|
|
|
@@ -629,6 +629,12 @@ function peerHandleLabel(handle) {
|
|
|
629
629
|
function isMyKortixAgentName(name) {
|
|
630
630
|
return name === MY_KORTIX_AGENT_NAME || name === LEGACY_MY_KORTIX_AGENT_NAME;
|
|
631
631
|
}
|
|
632
|
+
function agentDisplayName(slug) {
|
|
633
|
+
if (isMyKortixAgentName(slug)) return MY_KORTIX_DISPLAY_NAME;
|
|
634
|
+
if (typeof slug !== "string") return String(slug);
|
|
635
|
+
const words = slug.replace(/[-_]+/g, " ").trim();
|
|
636
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
637
|
+
}
|
|
632
638
|
|
|
633
639
|
// ../manifest-schema/src/slug.ts
|
|
634
640
|
var SLUG_MAX_LENGTH = 128;
|
|
@@ -3605,6 +3611,9 @@ var ARTIFACT_DOC_CSS = `
|
|
|
3605
3611
|
.kx-doc .kx-code>figcaption button{display:none}}
|
|
3606
3612
|
`;
|
|
3607
3613
|
|
|
3614
|
+
// ../shared/src/chrome-launch.ts
|
|
3615
|
+
var CHROME_LAUNCHED = false;
|
|
3616
|
+
|
|
3608
3617
|
// ../shared/src/code-language.ts
|
|
3609
3618
|
var LANGUAGE_ALIASES = {
|
|
3610
3619
|
// web
|
|
@@ -4256,6 +4265,35 @@ function pixelMarkShape(slug) {
|
|
|
4256
4265
|
height: PIXEL_MARK_SIZE
|
|
4257
4266
|
};
|
|
4258
4267
|
}
|
|
4268
|
+
var tone = (name, tile, ink) => ({
|
|
4269
|
+
name,
|
|
4270
|
+
tile,
|
|
4271
|
+
ink,
|
|
4272
|
+
tileDark: ink,
|
|
4273
|
+
inkDark: tile
|
|
4274
|
+
});
|
|
4275
|
+
var PIXEL_MARK_TONES = [
|
|
4276
|
+
tone("graphite", "#EDEDED", "#191919"),
|
|
4277
|
+
tone("sand", "#F1EBDD", "#6B5A3A"),
|
|
4278
|
+
tone("moss", "#E6EDE0", "#3F5A33"),
|
|
4279
|
+
tone("sea", "#E2ECF0", "#2E5566"),
|
|
4280
|
+
tone("blue", "#E6EEFF", "#2457C5"),
|
|
4281
|
+
tone("plum", "#EEE6F0", "#5E3A68"),
|
|
4282
|
+
tone("clay", "#F3E6E0", "#7A4532"),
|
|
4283
|
+
tone("slate", "#E4E7EC", "#3B4656")
|
|
4284
|
+
];
|
|
4285
|
+
var BRAND = {
|
|
4286
|
+
name: "brand",
|
|
4287
|
+
tile: "#1F1F1F",
|
|
4288
|
+
ink: "#FFFFFF",
|
|
4289
|
+
tileDark: "#2C2C2C",
|
|
4290
|
+
inkDark: "#FFFFFF"
|
|
4291
|
+
};
|
|
4292
|
+
var RESERVED_TONES = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
|
|
4293
|
+
function pixelMark(slug) {
|
|
4294
|
+
const tone2 = RESERVED_TONES[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
|
|
4295
|
+
return { ...pixelMarkShape(slug), tone: tone2 };
|
|
4296
|
+
}
|
|
4259
4297
|
|
|
4260
4298
|
// ../shared/src/preview-state-page.ts
|
|
4261
4299
|
var PREVIEW_BUILDING_STATES = /* @__PURE__ */ new Set([
|
|
@@ -5767,4 +5805,4 @@ function parseWorkspaceSettingsSection(raw) {
|
|
|
5767
5805
|
return Object.prototype.hasOwnProperty.call(WORKSPACE_SETTINGS_SECTION_ALIASES, value) ? WORKSPACE_SETTINGS_SECTION_ALIASES[value] : null;
|
|
5768
5806
|
}
|
|
5769
5807
|
|
|
5770
|
-
export { ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS, COMMIT_CONFIRM_ATTEMPTS, COMMIT_CONFIRM_DELAY_MS, CREDITS_PER_DOLLAR, CURATED_SECTIONS, HUMAN_ONLY, KATEX_FENCE_LANGUAGES, LANGUAGE_ALIASES, MAX_PROMPT_ATTACHMENTS_BYTES, MAX_PROMPT_ATTACHMENT_BYTES, MAX_PROMPT_ATTACHMENT_FILES, MAX_PROMPT_UPLOAD_FILENAME_BYTES, MERMAID_DIAGRAM_STARTERS, MY_KORTIX_AGENT_NAME, MY_KORTIX_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText,
|
|
5808
|
+
export { ARTIFACT_DOC_CSS, AVATAR_INK, CARD_TEXT_RATIO, CHANNELS, CHANNEL_PLATFORM_IDS, CHROME_LAUNCHED, COMMIT_CONFIRM_ATTEMPTS, COMMIT_CONFIRM_DELAY_MS, CREDITS_PER_DOLLAR, CURATED_SECTIONS, HUMAN_ONLY, KATEX_FENCE_LANGUAGES, LANGUAGE_ALIASES, MAX_PROMPT_ATTACHMENTS_BYTES, MAX_PROMPT_ATTACHMENT_BYTES, MAX_PROMPT_ATTACHMENT_FILES, MAX_PROMPT_UPLOAD_FILENAME_BYTES, MERMAID_DIAGRAM_STARTERS, MY_KORTIX_AGENT_NAME, MY_KORTIX_DISPLAY_NAME, MY_KORTIX_SANDBOX_SLUG, OTHER, PASTED_INLINE_MAX_BYTES, PIXEL_KORTIX_ROWS, PIXEL_MARK_TONES, POLICY_SETS_UNSUPPORTED_PROVIDERS, POPULAR_SECTION, PREVIEW_BUILDING_STATES, PREVIEW_STATE_MESSAGE, PROJECT_GLYPH_COLORS, PROJECT_GLYPH_GROUPS, SPACE_POST_SUMMARY, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, agentDisplayName, appAdminsOnly, autoLinkUrls, avatarFill, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, confirmCommitted, countInSection, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isProjectGlyphColor, isProjectGlyphName, isProjectGlyphPaletteColor, languageLabel, looksLikeMarkdown, masonryColumns, neutralizePastedTags, newConfigPrompt, newPastedContentId, normalizeLanguage, normalizeLatexDelimiters, normalizeProjectGlyphColor, openMarkdownLinkAtEnd, parseBackgroundWorkers, parseBalanceUsd, parseChannelMessage, parseGrepOutput, parseManifestText, parseMemoryEntryOutput, parseMemorySearchOutput, parsePeerMessagePrompt, parseReminderPrompt, parseSessionGetOutput, parseSessionMessagesOutput, parseSessionMetadataOutput, parseSessionSearchHits, parseTriggerEvent, parseTriggerLines, parseWorkspaceSettingsSection, passesPixelMarkGate, peerHandleLabel, pixelMark, policySetNameError, prefersPreviewLink, prepareMarkdownForKatex, prepareMarkdownForMath, promptFileReferenceXml, ptyOutputBlock, ptySpawnedBody, pushTypeOf, referenceHeaders, removeSpans, replaceSpans, resolveRegisteredKey, safeHttpUrl, sandboxMediaPath, sanitizePromptUploadFilename, sectionKeyForCategory, sectionKeysForEntry, sectionTitle, selfClosingTags, serializePromptWithPastes, shouldTilePaste, skillDocumentBody, slackPlainText, slugifySlug, spaceDriveFolders, spaceSlug, splitPastedContent, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
|
|
@@ -38,3 +38,10 @@ export type BuiltinAgentKey = keyof typeof BUILTIN_AGENTS;
|
|
|
38
38
|
export declare const BUILTIN_AGENT_KEYS: BuiltinAgentKey[];
|
|
39
39
|
/** The `builtin_agents` key of a built-in agent slug (legacy `meta` included), or `null` for a declared agent. */
|
|
40
40
|
export declare function builtinAgentKeyOf(agentName: string | null | undefined): BuiltinAgentKey | null;
|
|
41
|
+
/**
|
|
42
|
+
* An agent's name as a person reads it: My Kortix for the built-in agent,
|
|
43
|
+
* otherwise the manifest key in sentence case with its separators as spaces
|
|
44
|
+
* (`session-reviewer` → "Session reviewer"). One helper, so the web app, the
|
|
45
|
+
* sidebar and channel posts (Slack) name an agent the same way.
|
|
46
|
+
*/
|
|
47
|
+
export declare function agentDisplayName(slug: string): string;
|
|
@@ -36,4 +36,22 @@ export declare function pixelMarkShape(slug: string): {
|
|
|
36
36
|
width: number;
|
|
37
37
|
height: number;
|
|
38
38
|
};
|
|
39
|
+
export interface PixelMarkTone {
|
|
40
|
+
name: string;
|
|
41
|
+
tile: string;
|
|
42
|
+
ink: string;
|
|
43
|
+
/** Dark theme: the pair inverts, so the tile stays visible on a dark page. */
|
|
44
|
+
tileDark: string;
|
|
45
|
+
inkDark: string;
|
|
46
|
+
}
|
|
47
|
+
export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
|
|
48
|
+
/** The agent's mark: its shape and its tile tone. */
|
|
49
|
+
export declare function pixelMark(slug: string): {
|
|
50
|
+
tone: PixelMarkTone;
|
|
51
|
+
grid: boolean[][];
|
|
52
|
+
path: string;
|
|
53
|
+
ditherPath: string;
|
|
54
|
+
width: number;
|
|
55
|
+
height: number;
|
|
56
|
+
};
|
|
39
57
|
export {};
|
|
@@ -30,6 +30,7 @@ import { LockIcon, UsersIcon, UsersThreeIcon, XIcon } from '@phosphor-icons/reac
|
|
|
30
30
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
31
31
|
import { useState } from 'react';
|
|
32
32
|
import { EMPTY_PRINCIPAL_SELECTION, PrincipalPicker, } from './principal-picker.js';
|
|
33
|
+
import { applyShareSelection, shareSelectionView } from './share-selection.js';
|
|
33
34
|
/** What Save writes. The rules live in `@kortix/sdk`. */
|
|
34
35
|
export { grantConnectionAccess, planPrivateShare, planShare, sharedWithEveryoneAfter };
|
|
35
36
|
export function ShareAccessBody({ open, onOpenChange, accountId, projectId, projectName, object, current, onDone, }) {
|
|
@@ -96,11 +97,16 @@ export function ShareAccessBody({ open, onOpenChange, accountId, projectId, proj
|
|
|
96
97
|
next.add(grantId);
|
|
97
98
|
return next;
|
|
98
99
|
});
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
// A shared account: the picker shows who has access as checked, and
|
|
101
|
+
// unchecking one is the same as its Remove button (`share-selection.ts`).
|
|
102
|
+
const pickerValue = privateOwner ? picked : shareSelectionView(current, removed, picked);
|
|
103
|
+
const onPickerChange = (next) => {
|
|
104
|
+
if (privateOwner)
|
|
105
|
+
return setPicked(next);
|
|
106
|
+
const split = applyShareSelection(current, removed, next);
|
|
107
|
+
setPicked(split.picked);
|
|
108
|
+
setRemoved(split.removed);
|
|
109
|
+
};
|
|
104
110
|
return (_jsx(Modal, { open: open, onOpenChange: (next) => {
|
|
105
111
|
if (save.isPending)
|
|
106
112
|
return;
|
|
@@ -120,7 +126,7 @@ export function ShareAccessBody({ open, onOpenChange, accountId, projectId, proj
|
|
|
120
126
|
})) })] }), _jsxs(Field, { className: "gap-1.5", children: [_jsx(FieldLabel, { children: t('add') }), _jsx(PrincipalPicker, { scope: { kind: 'project', projectId }, selection: "multi",
|
|
121
127
|
// A private account becomes shared through `shareConnection`,
|
|
122
128
|
// which takes people and groups; an agent joins once it is shared.
|
|
123
|
-
kinds: privateOwner ? ['member', 'group'] : ['member', 'group', 'agent'], everyone: { label: everyoneLabel }, excludeUserIds:
|
|
129
|
+
kinds: privateOwner ? ['member', 'group'] : ['member', 'group', 'agent'], everyone: { label: everyoneLabel }, excludeUserIds: privateOwner ? [privateOwner.userId] : undefined, value: pickerValue, onChange: onPickerChange, disabled: save.isPending, autoFocus: false, emptyLabel: tI18nComplete.raw('textd2600c68a9ff'), allExcludedLabel: tI18nComplete.raw('textf68d7561db3d') }), (picked.agentIds?.length ?? 0) > 0 ? (_jsx("p", { className: "text-muted-foreground text-xs", children: t('agentShareHint') })) : null] }), _jsxs(BannerAlert, { variant: "default", children: [_jsx(BannerAlertMedia, { children: everyoneAfter ? _jsx(UsersThreeIcon, {}) : _jsx(LockIcon, {}) }), _jsx(BannerAlertDescription, { children: _jsx("span", { "data-testid": "share-result", children: everyoneAfter
|
|
124
130
|
? t('resultEveryone', { project: projectName })
|
|
125
131
|
: privateOwner && !privatePlan
|
|
126
132
|
? t('onlyYouDescription')
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectionShare } from '@kortix/sdk';
|
|
2
|
+
import type { PrincipalSelection } from './principal-picker.js';
|
|
3
|
+
/** What the picker shows: the new picks plus every grant not marked removed. */
|
|
4
|
+
export declare function shareSelectionView(current: readonly ConnectionShare[], removed: ReadonlySet<string>, picked: PrincipalSelection): PrincipalSelection;
|
|
5
|
+
/** Split the picker's next value into new picks and grants marked removed. */
|
|
6
|
+
export declare function applyShareSelection(current: readonly ConnectionShare[], removed: ReadonlySet<string>, next: PrincipalSelection): {
|
|
7
|
+
picked: PrincipalSelection;
|
|
8
|
+
removed: Set<string>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// The Share dialog's one selection rule. The picker shows every principal that
|
|
2
|
+
// has access to the account as checked: unchecking it marks its grant for
|
|
3
|
+
// removal, checking it again keeps the grant, and anything else checked is an
|
|
4
|
+
// addition. The audience rows' Remove/Keep buttons edit the same `removed`
|
|
5
|
+
// set, so the two controls never disagree.
|
|
6
|
+
//
|
|
7
|
+
// Before: a principal with access was an ordinary unchecked picker row.
|
|
8
|
+
// Clicking it picked it again, and the save plan cancels a removal whose
|
|
9
|
+
// principal is picked (`planConnectionShare`), so "Remove" then did nothing
|
|
10
|
+
// and Save stayed disabled until the picker was cleared.
|
|
11
|
+
const KEY_OF = {
|
|
12
|
+
member: 'memberIds',
|
|
13
|
+
group: 'groupIds',
|
|
14
|
+
agent: 'agentIds',
|
|
15
|
+
};
|
|
16
|
+
function selected(selection, grant) {
|
|
17
|
+
if (grant.principal_type === 'project')
|
|
18
|
+
return selection.everyone === true;
|
|
19
|
+
return (selection[KEY_OF[grant.principal_type]] ?? []).includes(grant.principal_id);
|
|
20
|
+
}
|
|
21
|
+
/** What the picker shows: the new picks plus every grant not marked removed. */
|
|
22
|
+
export function shareSelectionView(current, removed, picked) {
|
|
23
|
+
const view = {
|
|
24
|
+
...picked,
|
|
25
|
+
memberIds: [...picked.memberIds],
|
|
26
|
+
groupIds: [...picked.groupIds],
|
|
27
|
+
agentIds: [...(picked.agentIds ?? [])],
|
|
28
|
+
};
|
|
29
|
+
for (const grant of current) {
|
|
30
|
+
if (removed.has(grant.grant_id) || selected(view, grant))
|
|
31
|
+
continue;
|
|
32
|
+
if (grant.principal_type === 'project')
|
|
33
|
+
view.everyone = true;
|
|
34
|
+
else
|
|
35
|
+
view[KEY_OF[grant.principal_type]].push(grant.principal_id);
|
|
36
|
+
}
|
|
37
|
+
return view;
|
|
38
|
+
}
|
|
39
|
+
/** Split the picker's next value into new picks and grants marked removed. */
|
|
40
|
+
export function applyShareSelection(current, removed, next) {
|
|
41
|
+
const nextRemoved = new Set(removed);
|
|
42
|
+
const picked = {
|
|
43
|
+
...next,
|
|
44
|
+
memberIds: [...next.memberIds],
|
|
45
|
+
groupIds: [...next.groupIds],
|
|
46
|
+
agentIds: [...(next.agentIds ?? [])],
|
|
47
|
+
};
|
|
48
|
+
for (const grant of current) {
|
|
49
|
+
if (selected(next, grant)) {
|
|
50
|
+
// Checked: the grant stays. It is not an addition.
|
|
51
|
+
nextRemoved.delete(grant.grant_id);
|
|
52
|
+
if (grant.principal_type === 'project')
|
|
53
|
+
picked.everyone = false;
|
|
54
|
+
else {
|
|
55
|
+
const key = KEY_OF[grant.principal_type];
|
|
56
|
+
picked[key] = (picked[key] ?? []).filter((id) => id !== grant.principal_id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
nextRemoved.add(grant.grant_id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return { picked, removed: nextRemoved };
|
|
64
|
+
}
|
|
@@ -10,8 +10,8 @@ export type { CatalogSectionDef } from '../../../_vendor/shared/connector-sectio
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const CATEGORY_ROW_CAP = 6;
|
|
12
12
|
/**
|
|
13
|
-
* The category `Select`'s "no category" value.
|
|
14
|
-
*
|
|
13
|
+
* The category `Select`'s "no category" value. `Select` reads an empty string
|
|
14
|
+
* as "no value", so this needs a sentinel no real category can collide with.
|
|
15
15
|
* `groupIntoSections` trims every key and every curated key is
|
|
16
16
|
* lowercase-kebab, so a leading space is unreachable by construction — this is
|
|
17
17
|
* provably distinct rather than merely unlikely.
|
|
@@ -13,8 +13,8 @@ export { OTHER, POPULAR_SECTION, CURATED_SECTIONS, sectionKeyForCategory, sectio
|
|
|
13
13
|
*/
|
|
14
14
|
export const CATEGORY_ROW_CAP = 6;
|
|
15
15
|
/**
|
|
16
|
-
* The category `Select`'s "no category" value.
|
|
17
|
-
*
|
|
16
|
+
* The category `Select`'s "no category" value. `Select` reads an empty string
|
|
17
|
+
* as "no value", so this needs a sentinel no real category can collide with.
|
|
18
18
|
* `groupIntoSections` trims every key and every curated key is
|
|
19
19
|
* lowercase-kebab, so a leading space is unreachable by construction — this is
|
|
20
20
|
* provably distinct rather than merely unlikely.
|
|
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { CheckIcon, } from '@phosphor-icons/react';
|
|
4
4
|
import { useTranslations } from '../../i18n/index.js';
|
|
5
5
|
import { ConnectorLogo } from '../../internal/connector-logo/connector-logo.js';
|
|
6
|
-
import { STATUS_DOT, STATUS_WORD,
|
|
6
|
+
import { STATUS_DOT, STATUS_WORD, connectorTone } from './detail/connector-status.js';
|
|
7
7
|
import { ConnectorStatusBadge as ToneBadge } from './detail/status-badge.js';
|
|
8
8
|
import { cn } from '../../internal/lib/utils.js';
|
|
9
9
|
/**
|
|
@@ -35,7 +35,7 @@ export function ConnectorConnectedMark({ className } = {}) {
|
|
|
35
35
|
* slot instead, the catalogue's `✓`.
|
|
36
36
|
*/
|
|
37
37
|
export function ConnectorStatusBadge({ connector, accountCount, }) {
|
|
38
|
-
const tone =
|
|
38
|
+
const tone = connectorTone(connector, accountCount);
|
|
39
39
|
return tone === 'connected' ? null : _jsx(ToneBadge, { tone: tone });
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -46,6 +46,6 @@ export function ConnectorStatusBadge({ connector, accountCount, }) {
|
|
|
46
46
|
*/
|
|
47
47
|
export function ConnectorStatusLogo({ connector, source, accountCount, }) {
|
|
48
48
|
const t = useTranslations('connectorPages');
|
|
49
|
-
const tone =
|
|
49
|
+
const tone = connectorTone(connector, accountCount);
|
|
50
50
|
return (_jsxs("span", { className: "relative flex shrink-0", children: [_jsx(ConnectorLogo, { source: source, size: "lg" }), _jsx("span", { "aria-hidden": true, className: "bg-background absolute -right-1 -bottom-1 flex size-3 items-center justify-center rounded-full", children: _jsx("span", { className: cn('size-2 rounded-full', STATUS_DOT[tone]) }) }), _jsx("span", { className: "sr-only", children: t(STATUS_WORD[tone]) })] }));
|
|
51
51
|
}
|
|
@@ -35,7 +35,7 @@ import { providerLabel } from '../provider-label.js';
|
|
|
35
35
|
import { useTranslations } from '../../../i18n/index.js';
|
|
36
36
|
import { PROJECT_ACTIONS } from '../../../internal/lib/project-actions.js';
|
|
37
37
|
import { useProjectCan } from '../../../internal/lib/use-project-can.js';
|
|
38
|
-
import { connectorRunsOver,
|
|
38
|
+
import { connectorRunsOver, connectorTone } from './connector-status.js';
|
|
39
39
|
import { ProviderInfo, providerName } from './provider-info.js';
|
|
40
40
|
import { ConnectorStatusBadge } from './status-badge.js';
|
|
41
41
|
/** The same column as the connector page beside this one (`connector-page.tsx`). */
|
|
@@ -242,7 +242,7 @@ function CatalogAppPage({ projectId, appSegment }) {
|
|
|
242
242
|
_jsx("span", { className: "text-muted-foreground text-xs", children: t('askAdminToInstall') }))] })) : null] }), channelPlatform ? (
|
|
243
243
|
// The header above shows the app's logo: the hero below does not repeat it.
|
|
244
244
|
_jsx(ChannelHeroLogoInHeader, { children: _jsx(ChannelsSection, { projectId: projectId, platform: channelPlatform }) })) : null, !channelPlatform && (infoCells.length > 0 || resolved.description) ? (_jsxs("div", { className: "bg-popover divide-border divide-y overflow-hidden rounded-md border", children: [infoCells.length > 0 ? (_jsx("dl", { className: "flex flex-wrap gap-x-8 gap-y-3 px-4 py-3", children: infoCells.map((cell) => (_jsxs("div", { className: "min-w-0 space-y-0.5", children: [_jsxs("dt", { className: "text-muted-foreground flex h-4 items-center justify-between gap-2 text-xs", children: [_jsx("span", { children: cell.label }), cell.labelAddon] }), _jsx("dd", { className: "text-foreground truncate text-sm font-medium", children: cell.value })] }, cell.key))) })) : null, resolved.description ? (_jsxs("div", { className: "space-y-1.5 px-4 py-4", children: [_jsx("h2", { className: "text-muted-foreground text-xs", children: t('overview') }), _jsx("p", { className: "text-foreground text-sm text-pretty", children: resolved.description })] })) : null] })) : null, inProject.length > 0 ? (_jsxs("section", { className: "space-y-3", children: [_jsx("h2", { className: "text-foreground text-sm font-medium", children: projectName ? t('installedIn', { project: projectName }) : t('installedHere') }), _jsx("ul", { className: ROW_GROUP, children: inProject.map((connector) => {
|
|
245
|
-
const tone =
|
|
245
|
+
const tone = connectorTone(connector, connectionsQuery.data ? connectorAccounts(connectionsQuery.data.connections, connector).length : undefined);
|
|
246
246
|
return (_jsx("li", { children: _jsxs(Link, { href: connectorHref(projectId, connector.slug, { app }), className: "hover:bg-muted/50 flex items-center gap-3 px-4 py-3 transition-colors", children: [_jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "text-foreground block truncate text-sm font-medium", children: connectorDisplayName(connector) }), _jsx("span", { className: "text-muted-foreground block truncate text-xs", children: connectorSummary(connector, providerLabel(connector.provider)) })] }), _jsx("span", { className: "flex w-28 shrink-0 items-center", children: _jsx(ConnectorStatusBadge, { tone: tone }) }), _jsxs("span", { className: "text-muted-foreground flex w-16 shrink-0 items-center justify-end gap-1 text-xs", children: [t('open'), _jsx(CaretRightIcon, { "aria-hidden": true, className: "size-4" })] })] }) }, connector.slug));
|
|
247
247
|
}) })] })) : null, resolved.surfaces.length === 0 && resolved.references.length === 0 ? (_jsx(EmptyState, { icon: GlobeIcon, size: "sm", title: tI18nComplete.raw('text363579e1d66b'), description: tI18nComplete.raw('text4d286e47d580') })) : null, waySurfaces.length > (channelPlatform ? 0 : 1) || resolved.references.length > 0 ? (_jsxs("section", { className: "space-y-3", children: [_jsx("h2", { className: "text-foreground text-sm font-medium", children: channelPlatform ? t('otherWaysToConnect') : t('waysToConnect') }), waySurfaces.length > 0 ? (_jsx("ul", { className: ROW_GROUP, children: waySurfaces.map((surface) => (_jsxs("li", { className: SURFACE_ROW, children: [_jsxs("span", { className: "min-w-0 flex-1 space-y-0.5", children: [_jsxs("span", { className: "flex min-w-0 flex-wrap items-center gap-1.5", children: [_jsx("span", { className: "text-foreground truncate text-sm font-medium", children: surface.label }), _jsx(Badge, { variant: "muted", size: "xs", children: wayKindLabel(surface.kind) }), surface.oneClick ? (_jsx(Badge, { variant: "secondary", size: "xs", children: t('wayOneClick') })) : null, surface.recommended ? (_jsx(Badge, { variant: "success", size: "xs", children: t('wayRecommended') })) : null] }), _jsx("span", { className: "text-muted-foreground block text-xs text-pretty", children: wayDescription(t, { kind: surface.kind, oneClick: surface.oneClick }, resolved.name) })] }), surface.variantId && detail ? (_jsx(Button, { type: "button", variant: shownWay?.variantId === surface.variantId ? 'secondary' : 'outline-ghost', size: "sm", "aria-pressed": shownWay?.variantId === surface.variantId, onClick: () => {
|
|
248
248
|
setToolsWay(surface.variantId);
|
|
@@ -18,6 +18,8 @@ interface ConnectorAccountsProps {
|
|
|
18
18
|
showAccountInfo?: boolean;
|
|
19
19
|
/** Sign an unsigned account in (the row's Connect). */
|
|
20
20
|
onConnect?: (connection: Connection) => void;
|
|
21
|
+
/** Accounts sign in through a provider window: rows say "Sign in". */
|
|
22
|
+
signsIn?: boolean;
|
|
21
23
|
/** Bumped to open "Add account" (a header button, or right after Install). */
|
|
22
24
|
addRequest?: number;
|
|
23
25
|
onAddRequestHandled?: () => void;
|
|
@@ -47,5 +49,5 @@ interface ConnectorAccountsProps {
|
|
|
47
49
|
* (`connector-settings.tsx`) — see that file's docstring. Mounting it here
|
|
48
50
|
* too would print the same form twice.
|
|
49
51
|
*/
|
|
50
|
-
export declare function ConnectorAccounts({ projectId, connector, displayName, canWrite, canManageConnections, onChanged, onRemoved, onStartSession, onSetCredential, showAccountInfo, onConnect, addRequest, onAddRequestHandled, }: ConnectorAccountsProps): import("react").JSX.Element;
|
|
52
|
+
export declare function ConnectorAccounts({ projectId, connector, displayName, canWrite, canManageConnections, onChanged, onRemoved, onStartSession, onSetCredential, showAccountInfo, onConnect, signsIn, addRequest, onAddRequestHandled, }: ConnectorAccountsProps): import("react").JSX.Element;
|
|
51
53
|
export {};
|
|
@@ -30,7 +30,7 @@ import { AccountInfo } from './account-info.js';
|
|
|
30
30
|
* (`connector-settings.tsx`) — see that file's docstring. Mounting it here
|
|
31
31
|
* too would print the same form twice.
|
|
32
32
|
*/
|
|
33
|
-
export function ConnectorAccounts({ projectId, connector, displayName, canWrite, canManageConnections, onChanged, onRemoved, onStartSession, onSetCredential, showAccountInfo = false, onConnect, addRequest, onAddRequestHandled, }) {
|
|
33
|
+
export function ConnectorAccounts({ projectId, connector, displayName, canWrite, canManageConnections, onChanged, onRemoved, onStartSession, onSetCredential, showAccountInfo = false, onConnect, signsIn, addRequest, onAddRequestHandled, }) {
|
|
34
34
|
const tI18nComplete = useTranslations('hardcodedUi.i18nComplete');
|
|
35
35
|
const isManagedProvider = isManagedConnectorProvider(connector.provider);
|
|
36
36
|
// Email's accounts are inboxes (ConnectionsList's `isEmail` branch); Slack and
|
|
@@ -40,5 +40,5 @@ export function ConnectorAccounts({ projectId, connector, displayName, canWrite,
|
|
|
40
40
|
if (isChannel) {
|
|
41
41
|
return (_jsx(ChannelConnectionSection, { projectId: projectId, connector: connector, onChanged: onChanged, onRemoved: onRemoved, canWrite: canWrite }));
|
|
42
42
|
}
|
|
43
|
-
return (_jsxs("div", { className: "space-y-5", children: [_jsx(ConnectionsList, { projectId: projectId, connector: connector, displayName: displayName, canManageConnections: canManageConnections, onChanged: onChanged, onStartSession: onStartSession, onSetCredential: onSetCredential, onConnect: onConnect, addRequest: addRequest, onAddRequestHandled: onAddRequestHandled, addVariant: "default", titleAddon: showAccountInfo ? (_jsx(AccountInfo, { projectId: projectId, displayName: displayName })) : undefined }), showRoster ? (_jsxs("section", { className: "space-y-2", children: [_jsx(Label, { children: tI18nComplete.raw('text74156382383b') }), _jsx(ConnectionRoster, { projectId: projectId, connectorSlug: connector.slug, displayName: displayName })] })) : null] }));
|
|
43
|
+
return (_jsxs("div", { className: "space-y-5", children: [_jsx(ConnectionsList, { projectId: projectId, connector: connector, displayName: displayName, canManageConnections: canManageConnections, onChanged: onChanged, onStartSession: onStartSession, onSetCredential: onSetCredential, onConnect: onConnect, signsIn: signsIn, addRequest: addRequest, onAddRequestHandled: onAddRequestHandled, addVariant: "default", titleAddon: showAccountInfo ? (_jsx(AccountInfo, { projectId: projectId, displayName: displayName })) : undefined }), showRoster ? (_jsxs("section", { className: "space-y-2", children: [_jsx(Label, { children: tI18nComplete.raw('text74156382383b') }), _jsx(ConnectionRoster, { projectId: projectId, connectorSlug: connector.slug, displayName: displayName })] })) : null] }));
|
|
44
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useTranslations } from '../../../i18n/index.js';
|
|
4
|
-
import { VisuallyHidden } from '
|
|
4
|
+
import { VisuallyHidden } from '../../../lib/base-ui-compat.js';
|
|
5
5
|
import { Button } from '../../../primitives/button.js';
|
|
6
6
|
import { Modal, ModalClose, ModalContent, ModalTitle } from '../../../primitives/modal.js';
|
|
7
7
|
import { Skeleton } from '../../../primitives/skeleton.js';
|
|
@@ -11,12 +11,16 @@ export declare function NoticeLogLine({ reason }: {
|
|
|
11
11
|
export declare const NOTICE_TITLE: {
|
|
12
12
|
error: string;
|
|
13
13
|
sign_in: string;
|
|
14
|
+
sign_in_again: string;
|
|
15
|
+
no_tools: string;
|
|
14
16
|
no_account: string;
|
|
15
17
|
needs_credential: string;
|
|
16
18
|
};
|
|
17
19
|
export declare const NOTICE_BODY: {
|
|
18
20
|
error: string;
|
|
19
21
|
sign_in: string;
|
|
22
|
+
sign_in_again: string;
|
|
23
|
+
no_tools: string;
|
|
20
24
|
no_account: string;
|
|
21
25
|
needs_credential: string;
|
|
22
26
|
};
|
|
@@ -11,12 +11,16 @@ export function NoticeLogLine({ reason }) {
|
|
|
11
11
|
export const NOTICE_TITLE = {
|
|
12
12
|
error: 'noticeErrorTitle',
|
|
13
13
|
sign_in: 'noticeSignInTitle',
|
|
14
|
+
sign_in_again: 'noticeSignInAgainTitle',
|
|
15
|
+
no_tools: 'noticeNoToolsTitle',
|
|
14
16
|
no_account: 'noticeNoAccountTitle',
|
|
15
17
|
needs_credential: 'noticeCredentialTitle',
|
|
16
18
|
};
|
|
17
19
|
export const NOTICE_BODY = {
|
|
18
20
|
error: 'noticeErrorBody',
|
|
19
21
|
sign_in: 'noticeSignInBody',
|
|
22
|
+
sign_in_again: 'noticeSignInAgainBody',
|
|
23
|
+
no_tools: 'noticeNoToolsBody',
|
|
20
24
|
no_account: 'noticeNoAccountBody',
|
|
21
25
|
needs_credential: 'noticeCredentialBody',
|
|
22
26
|
};
|
|
@@ -8,8 +8,14 @@ import type { AdminConnector } from '@kortix/sdk';
|
|
|
8
8
|
*
|
|
9
9
|
* no_account — nothing is connected; add an account.
|
|
10
10
|
* needs_credential — an account exists and cannot authenticate.
|
|
11
|
-
* sign_in —
|
|
12
|
-
*
|
|
11
|
+
* sign_in — the account still has to finish its sign-in: an MCP
|
|
12
|
+
* server asked for one (401/403), or an account on a
|
|
13
|
+
* connector that signs in (managed, one-click OAuth MCP)
|
|
14
|
+
* never finished one.
|
|
15
|
+
* sign_in_again — an account on a connector that signs in was signed in
|
|
16
|
+
* before and no longer is (expired, revoked, rejected).
|
|
17
|
+
* no_tools — an HTTP connector that works but has no routes, so it
|
|
18
|
+
* gives agents nothing to call.
|
|
13
19
|
* error — the last attempt to load the connector's tools failed;
|
|
14
20
|
* `reason` is the server's own words, when it sent any.
|
|
15
21
|
*/
|
|
@@ -23,6 +29,10 @@ export type ConnectorNotice = {
|
|
|
23
29
|
action: 'set_credential' | 'open_accounts';
|
|
24
30
|
} | {
|
|
25
31
|
kind: 'sign_in';
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'sign_in_again';
|
|
34
|
+
} | {
|
|
35
|
+
kind: 'no_tools';
|
|
26
36
|
} | {
|
|
27
37
|
kind: 'error';
|
|
28
38
|
reason: string | null;
|
|
@@ -43,7 +53,23 @@ export declare function connectorNotice(input: {
|
|
|
43
53
|
accountCount: number;
|
|
44
54
|
/** The accounts list has answered; before that nothing is claimed. */
|
|
45
55
|
accountsLoaded: boolean;
|
|
56
|
+
/** Accounts authorize through a sign-in window, not a typed credential:
|
|
57
|
+
* a managed provider, or an MCP server with one-click OAuth. */
|
|
58
|
+
signsIn?: boolean;
|
|
59
|
+
/** The account the banner fixes never finished a sign-in (`accountNeverSignedIn`). */
|
|
60
|
+
neverSignedIn?: boolean;
|
|
61
|
+
/** How many tools the connector gives agents. Omitted = not known. */
|
|
62
|
+
toolCount?: number;
|
|
46
63
|
}): ConnectorNotice;
|
|
64
|
+
/**
|
|
65
|
+
* An account that never finished a sign-in: not authorized, and nothing on it
|
|
66
|
+
* says it was signed in before (no rejected credential, no known identity).
|
|
67
|
+
*/
|
|
68
|
+
export declare function accountNeverSignedIn(account: {
|
|
69
|
+
authorized?: boolean;
|
|
70
|
+
connected_as?: string | null;
|
|
71
|
+
metadata?: Record<string, unknown> | null;
|
|
72
|
+
}): boolean;
|
|
47
73
|
/**
|
|
48
74
|
* The account the banner's Sign in / Set credential button fixes: one of the
|
|
49
75
|
* caller's OWN accounts (any owner but the project), the first one not signed
|
|
@@ -65,8 +91,9 @@ export declare function noticeTarget<T extends {
|
|
|
65
91
|
*/
|
|
66
92
|
export declare function noticeButton<T>(notice: ConnectorNotice, target: T | 'add' | null, managed: boolean): {
|
|
67
93
|
/** Which button: its words. `add_account` is the page's Add account control. */
|
|
68
|
-
kind: 'add_account' | 'sign_in' | 'set_credential' | 'connect' | 'reconnect';
|
|
69
|
-
|
|
94
|
+
kind: 'add_account' | 'sign_in' | 'set_credential' | 'connect' | 'reconnect' | 'add_routes';
|
|
95
|
+
/** `settings` opens the Settings tab, where an HTTP connector's routes spec is. */
|
|
96
|
+
run: 'add' | 'sign_in' | 'reconnect' | 'settings';
|
|
70
97
|
account: T | null;
|
|
71
98
|
} | null;
|
|
72
99
|
/** A failure line split for the log row: `MCP tools/list failed: HTTP 401` → `401` + `MCP tools/list failed`. */
|
|
@@ -26,12 +26,28 @@ export function connectorNotice(input) {
|
|
|
26
26
|
action: input.accountCount === 0 ? 'add_account' : fixAccount,
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
if (input.connected)
|
|
30
|
-
|
|
29
|
+
if (input.connected) {
|
|
30
|
+
// An HTTP connector's tools are its routes: none means agents can call nothing.
|
|
31
|
+
return input.provider === 'http' && input.toolCount === 0 ? { kind: 'no_tools' } : { kind: 'none' };
|
|
32
|
+
}
|
|
31
33
|
if (input.accountCount === 0)
|
|
32
34
|
return { kind: 'no_account', action: 'add_account' };
|
|
35
|
+
// A connector that signs in has no credential to type: say "sign in".
|
|
36
|
+
if (input.signsIn)
|
|
37
|
+
return input.neverSignedIn ? { kind: 'sign_in' } : { kind: 'sign_in_again' };
|
|
33
38
|
return { kind: 'needs_credential', action: fixAccount };
|
|
34
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* An account that never finished a sign-in: not authorized, and nothing on it
|
|
42
|
+
* says it was signed in before (no rejected credential, no known identity).
|
|
43
|
+
*/
|
|
44
|
+
export function accountNeverSignedIn(account) {
|
|
45
|
+
if (account.authorized !== false)
|
|
46
|
+
return false;
|
|
47
|
+
if (account.connected_as)
|
|
48
|
+
return false;
|
|
49
|
+
return !account.metadata?.credential_rejected_at;
|
|
50
|
+
}
|
|
35
51
|
/**
|
|
36
52
|
* The account the banner's Sign in / Set credential button fixes: one of the
|
|
37
53
|
* caller's OWN accounts (any owner but the project), the first one not signed
|
|
@@ -56,10 +72,13 @@ export function noticeTarget(accounts) {
|
|
|
56
72
|
export function noticeButton(notice, target, managed) {
|
|
57
73
|
if (notice.kind === 'none')
|
|
58
74
|
return null;
|
|
59
|
-
if (notice.kind === '
|
|
75
|
+
if (notice.kind === 'no_tools')
|
|
76
|
+
return { kind: 'add_routes', run: 'settings', account: null };
|
|
77
|
+
if (notice.kind === 'sign_in' || notice.kind === 'sign_in_again') {
|
|
60
78
|
if (target === 'add')
|
|
61
79
|
return { kind: 'sign_in', run: 'add', account: null };
|
|
62
|
-
|
|
80
|
+
// A managed account signs in through its provider window (`reconnect`).
|
|
81
|
+
return target ? { kind: 'sign_in', run: managed ? 'reconnect' : 'sign_in', account: target } : null;
|
|
63
82
|
}
|
|
64
83
|
if (notice.action === 'add_account')
|
|
65
84
|
return { kind: 'add_account', run: 'add', account: null };
|