@kortix/ui 0.15.9 → 0.15.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/dist/_vendor/kortix-shared.js +72 -1
  2. package/dist/_vendor/shared/index.d.ts +1 -0
  3. package/dist/_vendor/shared/session/attachment-tile.d.ts +32 -0
  4. package/dist/_vendor/shared/session/stop-refusal.d.ts +15 -0
  5. package/dist/_vendor/shared/session/tool-row-text.d.ts +58 -0
  6. package/dist/_vendor/shared/session-delivery.d.ts +2 -0
  7. package/dist/customize/connectors/connectors-page.js +1 -1
  8. package/dist/customize/connectors/detail/connector-page.js +9 -4
  9. package/dist/customize/connectors/install/use-install.js +1 -1
  10. package/dist/customize/providers/provider-accordion.js +5 -5
  11. package/dist/customize/providers/provider-connect.d.ts +3 -3
  12. package/dist/customize/providers/provider-connect.js +8 -16
  13. package/dist/customize/providers/provider-sheet.js +4 -4
  14. package/dist/customize/sections/connector-connection-form.d.ts +0 -1
  15. package/dist/customize/sections/connector-connection-form.js +0 -9
  16. package/dist/customize/sections/view/review-center-connected.js +7 -3
  17. package/dist/customize/settings/tabs/workspace-keys.js +53 -11
  18. package/dist/customize/shared/feature-gate-screen.js +1 -1
  19. package/dist/customize/triggers/schedule/event-account-picker.js +1 -1
  20. package/dist/customize/triggers/schedule/use-event-app-connect.js +2 -1
  21. package/dist/i18n/en.d.ts +7 -7
  22. package/dist/i18n/en.js +8 -8
  23. package/dist/internal/billing/compute-pricing.d.ts +7 -1
  24. package/dist/internal/billing/compute-pricing.js +7 -1
  25. package/dist/internal/hooks/connectors/invalidate-connections.d.ts +10 -0
  26. package/dist/internal/hooks/connectors/invalidate-connections.js +18 -0
  27. package/dist/internal/hooks/connectors/use-finish-sign-in.js +1 -1
  28. package/dist/internal/hooks/connectors/use-pipedream-connect-member.js +1 -1
  29. package/dist/internal/hooks/connectors/use-pipedream-connect-project.js +1 -1
  30. package/dist/internal/hooks/projects/use-new-project-session.d.ts +2 -0
  31. package/dist/internal/hooks/projects/use-new-project-session.js +4 -1
  32. package/dist/internal/hooks/use-review-session-summary.d.ts +1 -1
  33. package/dist/internal/hooks/use-review-session-summary.js +1 -1
  34. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +2 -2
  35. package/dist/internal/notifications/notification-inbox.d.ts +4 -10
  36. package/dist/internal/notifications/notification-inbox.js +8 -9
  37. package/dist/internal/stores/connector-gate-store.d.ts +3 -1
  38. package/dist/internal/stores/connector-gate-store.js +13 -3
  39. package/dist/internal/stores/upgrade-dialog-store.d.ts +4 -0
  40. package/dist/internal/stores/upgrade-dialog-store.js +2 -0
  41. package/dist/lib/routes.d.ts +4 -11
  42. package/dist/lib/routes.js +3 -5
  43. package/dist/markdown/unified-markdown-utils.d.ts +7 -0
  44. package/dist/markdown/unified-markdown-utils.js +19 -0
  45. package/dist/markdown/unified-markdown.js +16 -3
  46. package/dist/primitives/alert-dialog.js +1 -1
  47. package/dist/primitives/dialog.js +3 -1
  48. package/dist/primitives/drawer.js +1 -1
  49. package/dist/primitives/modal.js +1 -1
  50. package/dist/primitives/preview-image.js +1 -1
  51. package/dist/primitives/sheet.js +1 -1
  52. package/dist/session/composer/ComposerCard.js +4 -2
  53. package/dist/session/composer/attachment-tile.d.ts +2 -26
  54. package/dist/session/composer/attachment-tile.js +3 -47
  55. package/dist/session/composer/composer-chat-input.d.ts +2 -1
  56. package/dist/session/composer/composer-chat-input.js +2 -2
  57. package/dist/session/composer/composer.d.ts +2 -0
  58. package/dist/session/composer/composer.js +5 -8
  59. package/dist/session/composer/draft/home-composer-focus-handoff.d.ts +7 -0
  60. package/dist/session/composer/draft/home-composer-focus-handoff.js +94 -0
  61. package/dist/session/composer/draft/use-composer-draft.d.ts +3 -1
  62. package/dist/session/composer/draft/use-composer-draft.js +22 -2
  63. package/dist/session/composer/editor/composer-editor.d.ts +4 -2
  64. package/dist/session/composer/editor/composer-editor.js +7 -3
  65. package/dist/session/composer/hooks/use-composer-focus.js +4 -2
  66. package/dist/session/index.d.ts +1 -0
  67. package/dist/session/index.js +1 -0
  68. package/dist/session/models/chatgpt-connection-button.js +5 -9
  69. package/dist/session/models/model-connection-gate.d.ts +2 -1
  70. package/dist/session/models/model-connection-gate.js +6 -3
  71. package/dist/session/models/model-connection-layout.d.ts +2 -0
  72. package/dist/session/models/model-connection-layout.js +4 -0
  73. package/dist/session/models/model-selector.d.ts +1 -1
  74. package/dist/session/models/model-selector.js +9 -6
  75. package/dist/session/models/subscription-offer.d.ts +4 -0
  76. package/dist/session/models/subscription-offer.js +11 -3
  77. package/dist/session/overrides/session-overrides-toolbar.js +2 -4
  78. package/dist/session/prompts/ask-deck.d.ts +5 -1
  79. package/dist/session/prompts/ask-deck.js +15 -3
  80. package/dist/session/prompts/question-labels.d.ts +16 -0
  81. package/dist/session/prompts/question-labels.js +34 -0
  82. package/dist/session/prompts/question-prompt.js +6 -6
  83. package/dist/session/status/provisioning-failure.d.ts +23 -2
  84. package/dist/session/status/provisioning-failure.js +53 -3
  85. package/dist/session/status/stop-refusal.d.ts +6 -12
  86. package/dist/session/status/stop-refusal.js +6 -19
  87. package/dist/session/thread/agent-run-props.d.ts +19 -0
  88. package/dist/session/thread/agent-run-props.js +54 -0
  89. package/dist/session/thread/session-chat.js +27 -4
  90. package/dist/session/thread/transcript.d.ts +17 -1
  91. package/dist/session/thread/transcript.js +87 -23
  92. package/dist/session/tool/tools/bash-tool.d.ts +3 -52
  93. package/dist/session/tool/tools/bash-tool.js +3 -86
  94. package/dist/session/turn/answer-streaming.d.ts +21 -0
  95. package/dist/session/turn/answer-streaming.js +34 -0
  96. package/dist/session/turn/queued-prompt-bubbles.d.ts +5 -0
  97. package/dist/session/turn/queued-prompt-bubbles.js +12 -0
  98. package/dist/session/turn/turn-work-accordion.d.ts +3 -1
  99. package/dist/session/turn/turn-work-accordion.js +2 -2
  100. package/dist/styles.css +1 -1
  101. package/dist/test-utils/intl.d.ts +7 -7
  102. package/dist/workspace/home/first-chat.d.ts +7 -1
  103. package/dist/workspace/home/first-chat.js +12 -5
  104. package/dist/workspace/inbox/workspace-inbox.d.ts +6 -16
  105. package/dist/workspace/inbox/workspace-inbox.js +9 -51
  106. package/dist/workspace/layout/project-home.js +5 -11
  107. package/dist/workspace/layout/use-project-home-send.d.ts +2 -0
  108. package/dist/workspace/layout/use-project-home-send.js +29 -15
  109. package/dist/workspace/new/advanced-fields.d.ts +4 -1
  110. package/dist/workspace/new/advanced-fields.js +2 -2
  111. package/dist/workspace/new/workspace-name.d.ts +9 -0
  112. package/dist/workspace/new/workspace-name.js +20 -0
  113. package/dist/workspace/projects/session-starter.d.ts +6 -4
  114. package/dist/workspace/projects/session-starter.js +8 -14
  115. package/dist/workspace/review/review-center.d.ts +6 -2
  116. package/dist/workspace/review/review-center.js +45 -25
  117. package/dist/workspace/sidebar/workspace-menu-model.d.ts +3 -5
  118. package/dist/workspace/sidebar/workspace-menu-model.js +1 -1
  119. package/package.json +3 -7
  120. package/skills/kortix-ui/references/modules.md +1 -1
  121. package/dist/customize/connectors/invalidate-connections.d.ts +0 -2
  122. package/dist/customize/connectors/invalidate-connections.js +0 -4
  123. package/dist/internal/notifications/use-inbox-summary.d.ts +0 -17
  124. package/dist/internal/notifications/use-inbox-summary.js +0 -28
@@ -11,98 +11,15 @@ import { CopyButton } from '../../../markdown/copy-button.js';
11
11
  import { formatBashOutput, InlineSessionMessagesList, parseSessionMessagesOutput, parseSessionMetadataOutput, SessionMetadataList, } from '../shared/session-helpers.js';
12
12
  import { hasStructuredContent, normalizeToolOutput, parseStructuredOutput, } from '../../../internal/lib/utils/structured-output.js';
13
13
  import { shellExitCode, stripAnsi } from '../../../internal/session-types/index.js';
14
+ import { bashRowTitle, dedentCommand } from '../../../_vendor/kortix-shared.js';
14
15
  import { TerminalIcon } from '@phosphor-icons/react';
15
16
  import { toolKind } from '@kortix/sdk';
16
17
  import { useContext, useMemo } from 'react';
17
18
  import { ChannelBrandMark } from '../../turn/channel-brand.js';
18
19
  import { channelSendText, parseChannelSendCommand } from './channel-send.js';
19
20
  import { ChannelSendCard, channelSendTitle } from './channel-send-card.js';
20
- /** The row title never runs past this; a trigger is one line, not a sentence. */
21
- const TITLE_MAX = 60;
22
- /**
23
- * The words a settled row leads with.
24
- *
25
- * The bash tool's input carries a `description` — the one-line summary the
26
- * model writes for its own call ("Install the workspace dependencies"). The
27
- * SDK already reads it as this tool's subtitle (`core/turns/parts.ts`, case
28
- * `'bash'`), so the row promotes a source it had been dropping rather than
29
- * inventing one. A reader scanning a turn wants to know what a command was
30
- * FOR, and `pnpm -w install --frozen-lockfile` answers that only if they read
31
- * shell.
32
- *
33
- * Three rules, in order:
34
- * - A failure keeps its verdict. "Command failed" is the one thing a friendly
35
- * summary must never soften, so it outranks any description.
36
- * - No description → exactly today's "Ran command". Nothing is ever derived
37
- * from the command text: a classifier answering "Installed dependencies" to
38
- * `npm i` would put a claim in the model's mouth that it never made.
39
- * - Sentence case only lifts a lower-case opener. Lowering the rest would turn
40
- * "Run CI on the release branch" into "Run ci on the release branch".
41
- */
42
- export function bashRowTitle(description, failed) {
43
- if (failed)
44
- return 'Command failed';
45
- // Collapsed, because a description arrives as free text and may carry a
46
- // newline; a trigger row renders it on one line either way.
47
- const summary = typeof description === 'string' ? description.replace(/\s+/g, ' ').trim() : '';
48
- if (!summary)
49
- return 'Ran command';
50
- const cased = /^[a-z]/.test(summary) ? summary[0].toUpperCase() + summary.slice(1) : summary;
51
- if (cased.length <= TITLE_MAX)
52
- return cased;
53
- // Trim the tail before the ellipsis. `truncate` in `lib/utils/string` cuts on
54
- // the character count alone, which strands a space in front of the ellipsis
55
- // whenever the cut lands just after a word.
56
- return `${cased.slice(0, TITLE_MAX).trimEnd()}…`;
57
- }
58
- /**
59
- * The command as the reader should see it: leading indent stripped, blank
60
- * edges dropped.
61
- *
62
- * Commands arrive with incidental leading whitespace — a model quoting a
63
- * command out of indented YAML/JSON sends ` agent-browser open …`. The
64
- * trigger row hides it (a `truncate` span collapses spaces under normal
65
- * white-space), but the card's `whitespace-pre-wrap` pane renders it verbatim,
66
- * so the first line sits two characters deeper than its own wrapped
67
- * continuation and the output below — an inverse hanging indent that reads as
68
- * broken padding.
69
- *
70
- * Two rules, because a one-line command and a script are different documents:
71
- *
72
- * - **One line has no structure to protect**, so every leading blank is noise
73
- * and all of it goes. This is the case a common-indent rule cannot be
74
- * trusted with alone: it only strips what it can MEASURE, and the measure
75
- * used to be `[ \t]` — so a command indented with a non-breaking space (or
76
- * any other Unicode space; agents paste these out of rendered docs and
77
- * spreadsheets) kept its indent and drew exactly the misalignment above.
78
- * - **A script keeps its shape**: the COMMON indent goes, never a per-line
79
- * trim, so nesting survives. Heredocs survive by construction — a non-`<<-`
80
- * heredoc needs its terminator at column 0, which pins the common indent to
81
- * 0 and makes this a no-op exactly where indentation is load-bearing.
82
- *
83
- * `[^\S\r\n]` is "whitespace that is not a line break", so both rules count
84
- * every horizontal space character the Unicode table has, not just the two on
85
- * a US keyboard. The trailing trim also stops a final `\n` from counting as a
86
- * phantom `+1` line in the trigger.
87
- */
88
- export function dedentCommand(raw) {
89
- const text = raw.replace(/^[\r\n]+/, '').trimEnd();
90
- if (!text)
91
- return '';
92
- const lines = text.split('\n');
93
- // One line: strip the lot. `trimEnd` above already took the other end.
94
- if (lines.length === 1)
95
- return lines[0].replace(/^[^\S\r\n]+/, '');
96
- let min = Infinity;
97
- for (const line of lines) {
98
- if (!line.trim())
99
- continue;
100
- min = Math.min(min, /^[^\S\r\n]*/.exec(line)[0].length);
101
- }
102
- if (!min || min === Infinity)
103
- return text;
104
- return lines.map((line) => line.slice(min)).join('\n');
105
- }
21
+ /** The row-title and dedent rules live once in `@kortix/shared/session/tool-row-text`. */
22
+ export { bashRowTitle, dedentCommand };
106
23
  /**
107
24
  * The command, syntax-highlighted, with its output beneath a hairline.
108
25
  *
@@ -0,0 +1,21 @@
1
+ /**
2
+ * How long the open text block may go without growing before the busy row
3
+ * returns. Text deltas arrive well under a second apart. A longer silence
4
+ * means the model moved on: the harness shows a tool call only once it runs
5
+ * (`tool_execution_start`), so while a large call's arguments stream the open
6
+ * text block is still the last block and no longer grows.
7
+ */
8
+ export declare const ANSWER_QUIET_AFTER_MS = 3000;
9
+ /**
10
+ * Whether the answer's open text block is still being written.
11
+ *
12
+ * While the words arrive they are the busy signal, so the turn's busy row
13
+ * ("Gathering thoughts...") stays hidden instead of sitting glued under the
14
+ * streaming text. The row comes back when the block closes (a tool call or
15
+ * the next step starts), and when the text stops growing for `quietMs`: a
16
+ * stream that went silent must not look like a finished answer.
17
+ *
18
+ * `text` is the open block's text (`openTextBlock`), `undefined` when no
19
+ * block is open.
20
+ */
21
+ export declare function useAnswerStreaming(text: string | undefined, quietMs?: number): boolean;
@@ -0,0 +1,34 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * How long the open text block may go without growing before the busy row
4
+ * returns. Text deltas arrive well under a second apart. A longer silence
5
+ * means the model moved on: the harness shows a tool call only once it runs
6
+ * (`tool_execution_start`), so while a large call's arguments stream the open
7
+ * text block is still the last block and no longer grows.
8
+ */
9
+ export const ANSWER_QUIET_AFTER_MS = 3_000;
10
+ /**
11
+ * Whether the answer's open text block is still being written.
12
+ *
13
+ * While the words arrive they are the busy signal, so the turn's busy row
14
+ * ("Gathering thoughts...") stays hidden instead of sitting glued under the
15
+ * streaming text. The row comes back when the block closes (a tool call or
16
+ * the next step starts), and when the text stops growing for `quietMs`: a
17
+ * stream that went silent must not look like a finished answer.
18
+ *
19
+ * `text` is the open block's text (`openTextBlock`), `undefined` when no
20
+ * block is open.
21
+ */
22
+ export function useAnswerStreaming(text, quietMs = ANSWER_QUIET_AFTER_MS) {
23
+ const hasText = !!text?.trim();
24
+ // The text that last went silent for `quietMs`. Any growth makes it stale,
25
+ // so the row hides again without a reset in the effect.
26
+ const [quietText, setQuietText] = useState(null);
27
+ useEffect(() => {
28
+ if (!hasText)
29
+ return;
30
+ const timer = setTimeout(() => setQuietText(text), quietMs);
31
+ return () => clearTimeout(timer);
32
+ }, [text, hasText, quietMs]);
33
+ return hasText && quietText !== text;
34
+ }
@@ -20,4 +20,9 @@ export declare function QueuedPromptFailure({ lastError, onRetry, onRemove, }: {
20
20
  onRetry?: () => void;
21
21
  onRemove?: () => void;
22
22
  }): import("react").JSX.Element;
23
+ /** A failed callback path requires a new computer, not a retry on the old one. */
24
+ export declare function QueuedPromptRecovery({ projectId, onRemove }: {
25
+ projectId?: string;
26
+ onRemove?: () => void;
27
+ }): import("react").JSX.Element;
23
28
  export {};
@@ -1,6 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { newSessionHref } from '../../lib/routes.js';
4
+ import { UiLink } from '../../providers/ui-provider.js';
3
5
  import { Button } from '../../primitives/button.js';
6
+ import { ButtonGroup } from '../../primitives/button-group.js';
4
7
  import { InlineMeta } from '../../primitives/inline-meta.js';
5
8
  import { useTranslations } from '../../i18n/index.js';
6
9
  /** Pending text stays legible while the active turn continues above it. */
@@ -25,3 +28,12 @@ export function QueuedPromptFailure({ lastError, onRetry, onRemove, }) {
25
28
  const common = useTranslations('common');
26
29
  return (_jsx(InlineMeta, { children: _jsxs("span", { "data-queued-status": "failed", className: "flex items-center gap-1", children: [_jsxs("span", { className: "text-kortix-red", role: "status", title: lastError ?? undefined, children: [copy.raw('textcd5f943d5863'), lastError ? ` — ${lastError}` : ''] }), onRetry && (_jsx(Button, { type: "button", variant: "ghost", size: "xs", onClick: onRetry, children: copy.raw('text942087cc2d41') })), onRemove && (_jsx(Button, { type: "button", variant: "ghost", size: "xs", onClick: onRemove, children: common('remove') }))] }) }));
27
30
  }
31
+ /** A failed callback path requires a new computer, not a retry on the old one. */
32
+ export function QueuedPromptRecovery({ projectId, onRemove }) {
33
+ const sidebar = useTranslations('sidebar');
34
+ const turn = useTranslations('sessionUi.turn');
35
+ const common = useTranslations('common');
36
+ const newSession = projectId ? (_jsx(Button, { variant: "ghost", size: "xs", asChild: true, children: _jsx(UiLink, { href: newSessionHref(projectId), children: sidebar('newSession') }) })) : null;
37
+ const remove = onRemove ? (_jsx(Button, { type: "button", variant: "ghost", size: "xs", onClick: onRemove, children: common('remove') })) : null;
38
+ return (_jsxs("div", { "data-queued-status": "failed", className: "flex flex-col items-end gap-1", children: [_jsx("span", { role: "status", className: "text-kortix-red text-xs", children: turn('computerDisconnected') }), newSession && remove ? _jsxs(ButtonGroup, { children: [newSession, remove] }) : newSession ?? remove] }));
39
+ }
@@ -9,7 +9,9 @@ export declare const WorkFoldContext: import("react").Context<boolean>;
9
9
  * the reader touched while it worked settles with its row open.
10
10
  */
11
11
  export declare const WorkTouchContext: import("react").Context<(() => void) | null>;
12
- export declare function TurnWorkAccordion({ durationMs, open, onToggle, contentId, }: {
12
+ export declare function TurnWorkAccordion({ label, durationMs, open, onToggle, contentId, }: {
13
+ /** The row's words in place of "Worked for …": an agent run's (`sessionLogAgentRunLabel`). */
14
+ label?: string;
13
15
  /** `sessionTurnDurationMs(turn)`; `null` reads "Worked". */
14
16
  durationMs: number | null;
15
17
  open: boolean;
@@ -27,6 +27,6 @@ export const WorkFoldContext = createContext(false);
27
27
  * the reader touched while it worked settles with its row open.
28
28
  */
29
29
  export const WorkTouchContext = createContext(null);
30
- export function TurnWorkAccordion({ durationMs, open, onToggle, contentId, }) {
31
- return (_jsx("div", { className: cn('flex items-center', open && 'border-border/60 border-b pb-2'), children: _jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": open ? contentId : undefined, onClick: onToggle, className: cn('group/work text-muted-foreground/70 hover:text-muted-foreground flex min-w-0 cursor-pointer items-center gap-2', 'focus-visible:ring-ring/50 rounded-sm text-left text-sm transition-colors select-none focus-visible:ring-2 focus-visible:outline-none'), children: [_jsx("span", { className: "min-w-0 truncate tabular-nums", children: workedForLabel(durationMs) }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground/40 group-hover/work:text-muted-foreground/70 size-3.5 flex-none transition-[transform,color]', open && 'rotate-90') })] }) }));
30
+ export function TurnWorkAccordion({ label, durationMs, open, onToggle, contentId, }) {
31
+ return (_jsx("div", { className: cn('flex items-center', open && 'border-border/60 border-b pb-2'), children: _jsxs("button", { type: "button", "aria-expanded": open, "aria-controls": open ? contentId : undefined, onClick: onToggle, className: cn('group/work text-muted-foreground/70 hover:text-muted-foreground flex min-w-0 cursor-pointer items-center gap-2', 'focus-visible:ring-ring/50 rounded-sm text-left text-sm transition-colors select-none focus-visible:ring-2 focus-visible:outline-none'), children: [_jsx("span", { className: "min-w-0 truncate tabular-nums", children: label ?? workedForLabel(durationMs) }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground/40 group-hover/work:text-muted-foreground/70 size-3.5 flex-none transition-[transform,color]', open && 'rotate-90') })] }) }));
32
32
  }