@kortix/ui 0.15.8 → 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 +75 -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/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/connector-identity.js +3 -3
- package/dist/customize/connectors/connectors-page.js +1 -1
- 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-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 +35 -10
- 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/connectors/install/use-install.js +1 -1
- package/dist/customize/providers/provider-accordion.js +9 -8
- package/dist/customize/providers/provider-connect.d.ts +3 -3
- package/dist/customize/providers/provider-connect.js +10 -16
- package/dist/customize/providers/provider-sheet.js +13 -8
- package/dist/customize/sections/component/email-connect-form.js +4 -2
- 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/connectors-view.d.ts +4 -1
- package/dist/customize/sections/connectors-view.js +42 -7
- package/dist/customize/sections/view/account-secret-resources-panel.d.ts +15 -0
- package/dist/customize/sections/view/account-secret-resources-panel.js +44 -5
- package/dist/customize/sections/view/review-center-connected.js +7 -3
- 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/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/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/customize/triggers/schedule/use-event-app-connect.js +2 -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/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/use-file-content-state.js +10 -9
- package/dist/i18n/en.d.ts +55 -7
- package/dist/i18n/en.js +59 -11
- package/dist/internal/billing/compute-pricing.d.ts +7 -1
- package/dist/internal/billing/compute-pricing.js +7 -1
- package/dist/internal/chrome/use-chrome-offered.d.ts +2 -1
- package/dist/internal/chrome/use-chrome-offered.js +4 -2
- 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.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/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/lib/error-handler.js +33 -0
- package/dist/internal/lib/trigger-clock.d.ts +7 -2
- package/dist/internal/lib/trigger-clock.js +17 -3
- 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/lib/z-stack.d.ts +5 -1
- package/dist/lib/z-stack.js +12 -2
- 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 +21 -5
- 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-picker-panel.js +6 -2
- package/dist/session/models/model-selector.d.ts +1 -1
- package/dist/session/models/model-selector.js +9 -6
- 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-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/prompts/session-connect-prompt.d.ts +40 -0
- package/dist/session/prompts/session-connect-prompt.js +126 -0
- package/dist/session/status/provisioning-failure.d.ts +23 -2
- package/dist/session/status/provisioning-failure.js +53 -3
- package/dist/session/status/session-error-banner.d.ts +1 -1
- package/dist/session/status/session-error-banner.js +12 -4
- 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 +34 -6
- package/dist/session/thread/transcript.d.ts +17 -1
- package/dist/session/thread/transcript.js +104 -16
- 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 +55 -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
|
@@ -3502,6 +3502,9 @@ function spaceDriveFolders(kind, name, personalFolder, privateSpaceId = null) {
|
|
|
3502
3502
|
return { files: `${personalFolder}/Agents/${name}`, memory: `${personalFolder}/Memory/${name}` };
|
|
3503
3503
|
}
|
|
3504
3504
|
|
|
3505
|
+
// ../shared/src/session-delivery.ts
|
|
3506
|
+
var STALE_RUNTIME_DELIVERY_ERROR = "this session's computer cannot reach the API. Start a new session";
|
|
3507
|
+
|
|
3505
3508
|
// ../shared/src/artifact-doc.ts
|
|
3506
3509
|
var ARTIFACT_DOC_CSS = `
|
|
3507
3510
|
.kx-doc{--s:var(--spacing,.23rem);color:var(--foreground);font-family:var(--font-sans);font-weight:400;font-size:var(--text-base,1rem);line-height:var(--leading-relaxed,1.625);
|
|
@@ -3611,6 +3614,9 @@ var ARTIFACT_DOC_CSS = `
|
|
|
3611
3614
|
.kx-doc .kx-code>figcaption button{display:none}}
|
|
3612
3615
|
`;
|
|
3613
3616
|
|
|
3617
|
+
// ../shared/src/chrome-launch.ts
|
|
3618
|
+
var CHROME_LAUNCHED = false;
|
|
3619
|
+
|
|
3614
3620
|
// ../shared/src/code-language.ts
|
|
3615
3621
|
var LANGUAGE_ALIASES = {
|
|
3616
3622
|
// web
|
|
@@ -4299,6 +4305,73 @@ var PREVIEW_BUILDING_STATES = /* @__PURE__ */ new Set([
|
|
|
4299
4305
|
]);
|
|
4300
4306
|
var PREVIEW_STATE_MESSAGE = "kortix:preview-state";
|
|
4301
4307
|
|
|
4308
|
+
// ../shared/src/session/attachment-tile.ts
|
|
4309
|
+
function attachmentExtension(filename, mime) {
|
|
4310
|
+
const dot = filename.lastIndexOf(".");
|
|
4311
|
+
if (dot > 0 && dot < filename.length - 1) {
|
|
4312
|
+
const ext = filename.slice(dot + 1).trim().toLowerCase();
|
|
4313
|
+
if (ext.length > 0 && ext.length <= 8 && !/\s/.test(ext)) return ext;
|
|
4314
|
+
}
|
|
4315
|
+
const subtype = (mime ?? "").split("/")[1]?.split(";")[0]?.trim().toLowerCase() ?? "";
|
|
4316
|
+
if (!subtype) return "";
|
|
4317
|
+
return subtype.split("+")[0].replace(/^x-/, "").split(".").pop() ?? "";
|
|
4318
|
+
}
|
|
4319
|
+
function isPreviewableImage(filename, mime) {
|
|
4320
|
+
if (attachmentExtension(filename, mime) === "svg") return false;
|
|
4321
|
+
return (mime ?? "").toLowerCase().startsWith("image/");
|
|
4322
|
+
}
|
|
4323
|
+
var LONG_NAME_THRESHOLD = 24;
|
|
4324
|
+
var NAME_TAIL_CHARS = 10;
|
|
4325
|
+
function splitFilenameForTile(name) {
|
|
4326
|
+
if (name.length <= LONG_NAME_THRESHOLD) return null;
|
|
4327
|
+
return { head: name.slice(0, -NAME_TAIL_CHARS), tail: name.slice(-NAME_TAIL_CHARS) };
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
// ../shared/src/session/session-starter.ts
|
|
4331
|
+
function classifySessionStarter(session, viewerId) {
|
|
4332
|
+
const initiator = session.initiator ?? null;
|
|
4333
|
+
if (!initiator || initiator.type === "member") {
|
|
4334
|
+
const id = initiator?.id ?? session.created_by ?? null;
|
|
4335
|
+
const isViewer = Boolean(viewerId) && id === viewerId && (initiator?.id != null || session.is_owner !== false);
|
|
4336
|
+
return { type: "member", id, isViewer, label: initiator?.label || null };
|
|
4337
|
+
}
|
|
4338
|
+
return { type: initiator.type, id: initiator.id, isViewer: false, label: initiator.label || null };
|
|
4339
|
+
}
|
|
4340
|
+
|
|
4341
|
+
// ../shared/src/session/stop-refusal.ts
|
|
4342
|
+
var NOT_TURN_PROMPTER = "not_turn_prompter";
|
|
4343
|
+
function stopRefusalMessage(error, fallback) {
|
|
4344
|
+
if (!error || typeof error !== "object") return null;
|
|
4345
|
+
const { status, code, message } = error;
|
|
4346
|
+
if (code !== NOT_TURN_PROMPTER && status !== 403) return null;
|
|
4347
|
+
const text = typeof message === "string" ? message.trim() : "";
|
|
4348
|
+
return text || fallback || null;
|
|
4349
|
+
}
|
|
4350
|
+
|
|
4351
|
+
// ../shared/src/session/tool-row-text.ts
|
|
4352
|
+
var TITLE_MAX = 60;
|
|
4353
|
+
function bashRowTitle(description, failed) {
|
|
4354
|
+
if (failed) return "Command failed";
|
|
4355
|
+
const summary = typeof description === "string" ? description.replace(/\s+/g, " ").trim() : "";
|
|
4356
|
+
if (!summary) return "Ran command";
|
|
4357
|
+
const cased = /^[a-z]/.test(summary) ? summary[0].toUpperCase() + summary.slice(1) : summary;
|
|
4358
|
+
if (cased.length <= TITLE_MAX) return cased;
|
|
4359
|
+
return `${cased.slice(0, TITLE_MAX).trimEnd()}\u2026`;
|
|
4360
|
+
}
|
|
4361
|
+
function dedentCommand(raw) {
|
|
4362
|
+
const text = raw.replace(/^[\r\n]+/, "").trimEnd();
|
|
4363
|
+
if (!text) return "";
|
|
4364
|
+
const lines = text.split("\n");
|
|
4365
|
+
if (lines.length === 1) return lines[0].replace(/^[^\S\r\n]+/, "");
|
|
4366
|
+
let min = Infinity;
|
|
4367
|
+
for (const line of lines) {
|
|
4368
|
+
if (!line.trim()) continue;
|
|
4369
|
+
min = Math.min(min, /^[^\S\r\n]*/.exec(line)[0].length);
|
|
4370
|
+
}
|
|
4371
|
+
if (!min || min === Infinity) return text;
|
|
4372
|
+
return lines.map((line) => line.slice(min)).join("\n");
|
|
4373
|
+
}
|
|
4374
|
+
|
|
4302
4375
|
// ../shared/src/tool-output/background-workers.ts
|
|
4303
4376
|
var COLON2 = 58;
|
|
4304
4377
|
function occurrences(text, needle, ignoreCase) {
|
|
@@ -5775,6 +5848,7 @@ var WORKSPACE_SETTINGS_SECTIONS = WORKSPACE_SETTINGS_GROUPS.flatMap(
|
|
|
5775
5848
|
(group) => group.sections
|
|
5776
5849
|
);
|
|
5777
5850
|
var WORKSPACE_SETTINGS_SECTION_ALIASES = {
|
|
5851
|
+
"audit-log": "audit",
|
|
5778
5852
|
access: "members",
|
|
5779
5853
|
"access-projects": "members",
|
|
5780
5854
|
settings: "security",
|
|
@@ -5802,4 +5876,4 @@ function parseWorkspaceSettingsSection(raw) {
|
|
|
5802
5876
|
return Object.prototype.hasOwnProperty.call(WORKSPACE_SETTINGS_SECTION_ALIASES, value) ? WORKSPACE_SETTINGS_SECTION_ALIASES[value] : null;
|
|
5803
5877
|
}
|
|
5804
5878
|
|
|
5805
|
-
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, 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 };
|
|
5879
|
+
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, LONG_NAME_THRESHOLD, 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, NAME_TAIL_CHARS, NOT_TURN_PROMPTER, 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, STALE_RUNTIME_DELIVERY_ERROR, UNKNOWN_RATIO, UPLOAD_LIMITS, WORKSPACE_SETTINGS_GROUPS, agentDisplayName, appAdminsOnly, attachmentExtension, autoLinkUrls, avatarFill, bashRowTitle, buildWebhookSampleRequest, capitalizeWords, cardImageShape, cardListLayout, chalkColors, channelPromptTail, classifySessionStarter, confirmCommitted, countInSection, dedentCommand, dollarsToCredits, editConfigPrompt, errorCode, escapeCurrencyDollars, expandPastedContent, extractReadableHtml, fileTagBlocks, fixManifestText, formatFileSize, formatRelative, formatUsdAsCredits, gridApps, groupIntoSections, hasReferenceDefinitionOutsideFences, humanizeCategory, indexOfIgnoreCase, isAllowedWebPushHost, isAmbiguousCreateFailure, isChannelFileLabel, isChannelPlatform, isMermaidCode, isMyKortixAgentName, isPreviewableImage, 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, splitFilenameForTile, splitPastedContent, stopRefusalMessage, stripBashMetadata, stripChatMentionMarkup, stripMarkupForToolOutput, tagBlocks, toolRegistryCandidates, trimPastedText, truncateString, utf8Bytes, withoutEdgeQuotes, xmlBlocks };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure rules of an attachment tile. Both hosts
|
|
3
|
+
* (`packages/ui/src/session/composer/attachment-tile.tsx`,
|
|
4
|
+
* `apps/mobile/lib/session/attachment-tile.ts`) re-export these, so every
|
|
5
|
+
* fix lands once.
|
|
6
|
+
*/
|
|
7
|
+
/** What the tile prints in the file's corner. Lowercase, from the name first
|
|
8
|
+
* and the MIME subtype second; empty when neither says anything. */
|
|
9
|
+
export declare function attachmentExtension(filename: string, mime?: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Which files the tile shows AS A PICTURE. Raster images only. An SVG is text
|
|
12
|
+
* that happens to draw — a logo file on a tile is a black blob at 100px, and
|
|
13
|
+
* its name is what tells it from the next logo file (Jay, 2026-09-06). It
|
|
14
|
+
* gets the named treatment, badge and all.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isPreviewableImage(filename: string, mime?: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* How a name is laid out on the tile.
|
|
19
|
+
*
|
|
20
|
+
* A short name wraps over two lines as the browser sees fit. A long one is
|
|
21
|
+
* split: the first line is the head, ellipsized by CSS at the tile's edge, and
|
|
22
|
+
* the second line is the last ten characters verbatim — the part that carries
|
|
23
|
+
* the extension and tells `…-chatux.md` from `…-ux.md`. A single middle
|
|
24
|
+
* ellipsis in one string wrapped wherever the browser chose, and left a
|
|
25
|
+
* dangling hyphen at the end of line one (2026-09-06).
|
|
26
|
+
*/
|
|
27
|
+
export declare const LONG_NAME_THRESHOLD = 24;
|
|
28
|
+
export declare const NAME_TAIL_CHARS = 10;
|
|
29
|
+
export declare function splitFilenameForTile(name: string): {
|
|
30
|
+
head: string;
|
|
31
|
+
tail: string;
|
|
32
|
+
} | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The stop-refusal guard. Both hosts (`packages/ui/src/session/status/stop-refusal.ts`,
|
|
3
|
+
* `apps/mobile/lib/session/turn-stop.ts`) re-export these, so every fix
|
|
4
|
+
* lands once.
|
|
5
|
+
*/
|
|
6
|
+
/** The 403 `code` of a stop the server refused. */
|
|
7
|
+
export declare const NOT_TURN_PROMPTER = "not_turn_prompter";
|
|
8
|
+
/**
|
|
9
|
+
* The server's message when it refused a stop, else `fallback`; null for any
|
|
10
|
+
* other failure, so the caller keeps its "Couldn't stop" toast. A REST stop
|
|
11
|
+
* (the hold, "Stop and send") is an `ApiError` carrying the code. The runtime
|
|
12
|
+
* abort answers through the sandbox proxy, whose error keeps the status and
|
|
13
|
+
* the message but drops the body's `code`, so a 403 alone also counts.
|
|
14
|
+
*/
|
|
15
|
+
export declare function stopRefusalMessage(error: unknown, fallback?: string): string | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pure text rules of the `bash` tool row. Both hosts
|
|
3
|
+
* (`packages/ui/src/session/tool/tools/bash-tool.tsx`,
|
|
4
|
+
* `apps/mobile/lib/session/tools/files-bash.ts`) re-export these, so every
|
|
5
|
+
* fix lands once.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* The words a settled row leads with.
|
|
9
|
+
*
|
|
10
|
+
* The bash tool's input carries a `description` — the one-line summary the
|
|
11
|
+
* model writes for its own call ("Install the workspace dependencies"). The
|
|
12
|
+
* SDK already reads it as this tool's subtitle (`core/turns/parts.ts`, case
|
|
13
|
+
* `'bash'`), so the row promotes a source it had been dropping rather than
|
|
14
|
+
* inventing one. A reader scanning a turn wants to know what a command was
|
|
15
|
+
* FOR, and `pnpm -w install --frozen-lockfile` answers that only if they read
|
|
16
|
+
* shell.
|
|
17
|
+
*
|
|
18
|
+
* Three rules, in order:
|
|
19
|
+
* - A failure keeps its verdict. "Command failed" is the one thing a friendly
|
|
20
|
+
* summary must never soften, so it outranks any description.
|
|
21
|
+
* - No description → exactly today's "Ran command". Nothing is ever derived
|
|
22
|
+
* from the command text: a classifier answering "Installed dependencies" to
|
|
23
|
+
* `npm i` would put a claim in the model's mouth that it never made.
|
|
24
|
+
* - Sentence case only lifts a lower-case opener. Lowering the rest would turn
|
|
25
|
+
* "Run CI on the release branch" into "Run ci on the release branch".
|
|
26
|
+
*/
|
|
27
|
+
export declare function bashRowTitle(description: unknown, failed: boolean): string;
|
|
28
|
+
/**
|
|
29
|
+
* The command as the reader should see it: leading indent stripped, blank
|
|
30
|
+
* edges dropped.
|
|
31
|
+
*
|
|
32
|
+
* Commands arrive with incidental leading whitespace — a model quoting a
|
|
33
|
+
* command out of indented YAML/JSON sends ` agent-browser open …`. The
|
|
34
|
+
* trigger row hides it (a `truncate` span collapses spaces under normal
|
|
35
|
+
* white-space), but the card's `whitespace-pre-wrap` pane renders it verbatim,
|
|
36
|
+
* so the first line sits two characters deeper than its own wrapped
|
|
37
|
+
* continuation and the output below — an inverse hanging indent that reads as
|
|
38
|
+
* broken padding.
|
|
39
|
+
*
|
|
40
|
+
* Two rules, because a one-line command and a script are different documents:
|
|
41
|
+
*
|
|
42
|
+
* - **One line has no structure to protect**, so every leading blank is noise
|
|
43
|
+
* and all of it goes. This is the case a common-indent rule cannot be
|
|
44
|
+
* trusted with alone: it only strips what it can MEASURE, and the measure
|
|
45
|
+
* used to be `[ \t]` — so a command indented with a non-breaking space (or
|
|
46
|
+
* any other Unicode space; agents paste these out of rendered docs and
|
|
47
|
+
* spreadsheets) kept its indent and drew exactly the misalignment above.
|
|
48
|
+
* - **A script keeps its shape**: the COMMON indent goes, never a per-line
|
|
49
|
+
* trim, so nesting survives. Heredocs survive by construction — a non-`<<-`
|
|
50
|
+
* heredoc needs its terminator at column 0, which pins the common indent to
|
|
51
|
+
* 0 and makes this a no-op exactly where indentation is load-bearing.
|
|
52
|
+
*
|
|
53
|
+
* `[^\S\r\n]` is "whitespace that is not a line break", so both rules count
|
|
54
|
+
* every horizontal space character the Unicode table has, not just the two on
|
|
55
|
+
* a US keyboard. The trailing trim also stops a final `\n` from counting as a
|
|
56
|
+
* phantom `+1` line in the trigger.
|
|
57
|
+
*/
|
|
58
|
+
export declare function dedentCommand(raw: string): string;
|
|
@@ -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
|
+
}
|
|
@@ -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
|
}
|
|
@@ -23,7 +23,7 @@ import { Skeleton } from '../../primitives/skeleton.js';
|
|
|
23
23
|
import { SplitSheet, SplitSheetBody, SplitSheetContent, SplitSheetDescription, SplitSheetHeader, SplitSheetMain, SplitSheetTitle, } from '../../primitives/split-sheet.js';
|
|
24
24
|
import { Tabs, TabsList, TabsTrigger } from '../../primitives/tabs.js';
|
|
25
25
|
import { EmptyState } from '../../primitives/empty-state.js';
|
|
26
|
-
import { connectorConnectionQueryKeys
|
|
26
|
+
import { connectorConnectionQueryKeys } from '../../internal/hooks/connectors/invalidate-connections.js';
|
|
27
27
|
import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
|
|
28
28
|
import { useProjectCan } from '../../internal/lib/use-project-can.js';
|
|
29
29
|
import { ConnectorStatusBadge, ConnectorStatusLogo } from './connector-identity.js';
|
|
@@ -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
|
}
|
|
@@ -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 };
|