@kortix/ui 0.15.0 → 0.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/_vendor/kortix-shared.js +233 -130
  2. package/dist/_vendor/shared/code-language.d.ts +2 -2
  3. package/dist/_vendor/shared/html.d.ts +7 -0
  4. package/dist/_vendor/shared/index.d.ts +1 -2
  5. package/dist/_vendor/shared/pixel-mark.d.ts +28 -0
  6. package/dist/_vendor/shared/runtime-versions.d.ts +2 -6
  7. package/dist/_vendor/shared/tool-output/media-path.d.ts +1 -6
  8. package/dist/_vendor/shared/tool-output/scan.d.ts +2 -0
  9. package/dist/_vendor/shared/utils/string.d.ts +6 -0
  10. package/dist/artifacts/artifact-frame.d.ts +0 -1
  11. package/dist/artifacts/artifact-frame.js +4 -10
  12. package/dist/artifacts/artifact-session.js +4 -7
  13. package/dist/artifacts/frame-policy.d.ts +1 -1
  14. package/dist/artifacts/frame-policy.js +2 -2
  15. package/dist/customize/agents/agent-page.js +5 -5
  16. package/dist/customize/agents/agent-status.js +1 -1
  17. package/dist/customize/agents/agents-page.js +3 -3
  18. package/dist/customize/connectors/use-agent-access.d.ts +3 -3
  19. package/dist/customize/sections/connectors-view.js +50 -37
  20. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +21 -18
  21. package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
  22. package/dist/customize/sections/llm-provider/device-grant.js +27 -0
  23. package/dist/customize/sections/view/agent-editor-catalog.js +0 -5
  24. package/dist/customize/sections/view/agent-editor.d.ts +2 -2
  25. package/dist/customize/sections/view/agent-editor.js +2 -2
  26. package/dist/customize/sections/view/review-center-connected.js +37 -6
  27. package/dist/customize/sections/view/secret-delivery.d.ts +4 -5
  28. package/dist/customize/sections/view/secret-delivery.js +5 -4
  29. package/dist/customize/triggers/schedule/trigger-list.d.ts +2 -2
  30. package/dist/customize/triggers/schedule/trigger-list.js +12 -18
  31. package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +6 -0
  32. package/dist/customize/triggers/schedule/trigger-runs-logic.js +13 -0
  33. package/dist/customize/triggers/schedule/trigger-runs-panel.js +9 -2
  34. package/dist/files/project/api/runtime-files.d.ts +2 -2
  35. package/dist/files/project/api/runtime-files.js +2 -2
  36. package/dist/files/project/components/drive-explorer.js +1 -1
  37. package/dist/files/project/components/drive-grid-view.js +0 -1
  38. package/dist/files/project/components/drive-list-view.js +0 -1
  39. package/dist/files/project/components/file-explorer-page.js +1 -1
  40. package/dist/files/project/hooks/index.d.ts +1 -1
  41. package/dist/files/project/hooks/index.js +1 -1
  42. package/dist/files/project/hooks/use-server-health.d.ts +1 -1
  43. package/dist/files/project/hooks/use-server-health.js +1 -1
  44. package/dist/files/project/search/workspace-search-service.d.ts +1 -1
  45. package/dist/files/project/search/workspace-search-service.js +1 -1
  46. package/dist/files/runtime/hooks/index.d.ts +1 -1
  47. package/dist/files/runtime/hooks/index.js +1 -1
  48. package/dist/files/runtime/hooks/server-health-state.d.ts +2 -2
  49. package/dist/files/runtime/hooks/server-health-state.js +2 -2
  50. package/dist/files/runtime/hooks/system-dir.js +2 -2
  51. package/dist/files/runtime/hooks/use-file-content.d.ts +1 -1
  52. package/dist/files/runtime/hooks/use-file-content.js +1 -1
  53. package/dist/files/runtime/hooks/use-file-list.d.ts +1 -1
  54. package/dist/files/runtime/hooks/use-file-list.js +3 -3
  55. package/dist/files/runtime/hooks/use-server-health.d.ts +2 -2
  56. package/dist/files/runtime/hooks/use-server-health.js +3 -3
  57. package/dist/files/runtime/hooks/use-workspace-search.d.ts +1 -2
  58. package/dist/files/runtime/hooks/use-workspace-search.js +0 -1
  59. package/dist/files/runtime/index.d.ts +2 -2
  60. package/dist/files/runtime/index.js +2 -2
  61. package/dist/files/runtime/path-utils.d.ts +1 -1
  62. package/dist/files/runtime/path-utils.js +1 -1
  63. package/dist/files/runtime/sandbox-explorer-source.d.ts +1 -1
  64. package/dist/files/runtime/sandbox-explorer-source.js +1 -1
  65. package/dist/files/runtime/sandbox-file-explorer.d.ts +1 -1
  66. package/dist/files/runtime/sandbox-file-explorer.js +2 -2
  67. package/dist/files/tree/components/file-tree-item.js +0 -1
  68. package/dist/files/tree/hooks/use-file-events.d.ts +1 -1
  69. package/dist/files/tree/hooks/use-file-events.js +1 -1
  70. package/dist/i18n/en.d.ts +60 -175
  71. package/dist/i18n/en.js +71 -186
  72. package/dist/internal/components/agent-mark.js +6 -0
  73. package/dist/internal/components/clickable-path.d.ts +3 -0
  74. package/dist/internal/components/clickable-path.js +4 -1
  75. package/dist/internal/files/file-read-retry.js +1 -1
  76. package/dist/internal/files/types.d.ts +2 -2
  77. package/dist/internal/files/types.js +2 -2
  78. package/dist/internal/goals/goal-meta.d.ts +33 -14
  79. package/dist/internal/goals/goal-meta.js +55 -13
  80. package/dist/internal/layout/nav-hover-card.d.ts +1 -1
  81. package/dist/internal/layout/nav-hover-card.js +1 -1
  82. package/dist/internal/layout/project-capability-nav.d.ts +1 -1
  83. package/dist/internal/layout/project-capability-nav.js +1 -1
  84. package/dist/internal/lib/browser-error-noise.d.ts +1 -1
  85. package/dist/internal/lib/browser-error-noise.js +1 -1
  86. package/dist/internal/lib/browser-noise/rules/expected-states.js +1 -1
  87. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +29 -0
  88. package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +1 -0
  89. package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
  90. package/dist/internal/lib/browser-noise/rules/rejections.d.ts +0 -9
  91. package/dist/internal/lib/browser-noise/rules/rejections.js +0 -14
  92. package/dist/internal/lib/delivered-but-disconnected.js +3 -5
  93. package/dist/internal/lib/error-handler.js +8 -3
  94. package/dist/internal/lib/pixel-mark.d.ts +4 -17
  95. package/dist/internal/lib/pixel-mark.js +5 -148
  96. package/dist/internal/lib/sounds.d.ts +4 -4
  97. package/dist/internal/lib/sounds.js +4 -4
  98. package/dist/internal/lib/trigger-clock.d.ts +5 -0
  99. package/dist/internal/lib/trigger-clock.js +15 -0
  100. package/dist/internal/lib/turn-broadcast.d.ts +0 -3
  101. package/dist/internal/lib/use-project-feature-flags.d.ts +2 -0
  102. package/dist/internal/lib/use-project-feature-flags.js +5 -5
  103. package/dist/internal/lib/web-notifications.d.ts +1 -8
  104. package/dist/internal/lib/web-notifications.js +12 -53
  105. package/dist/internal/notifications/notification-bell.d.ts +13 -33
  106. package/dist/internal/notifications/notification-bell.js +14 -117
  107. package/dist/internal/notifications/notification-inbox.d.ts +45 -0
  108. package/dist/internal/notifications/notification-inbox.js +119 -0
  109. package/dist/internal/notifications/notification-rows.d.ts +3 -4
  110. package/dist/internal/notifications/notification-rows.js +1 -4
  111. package/dist/internal/notifications/use-inbox-summary.d.ts +13 -0
  112. package/dist/internal/notifications/use-inbox-summary.js +22 -0
  113. package/dist/internal/notifications/web-push.d.ts +9 -10
  114. package/dist/internal/notifications/web-push.js +9 -10
  115. package/dist/internal/stores/composer-prefill-store.js +4 -1
  116. package/dist/internal/stores/sound-store.d.ts +4 -4
  117. package/dist/internal/stores/sound-store.js +10 -0
  118. package/dist/internal/stores/web-notification-store.d.ts +6 -9
  119. package/dist/internal/stores/web-notification-store.js +0 -4
  120. package/dist/lib/routes.d.ts +8 -0
  121. package/dist/lib/routes.js +4 -1
  122. package/dist/markdown/code/shiki-highlighter.js +14 -5
  123. package/dist/markdown/doc-editor/doc-menus.d.ts +1 -10
  124. package/dist/markdown/doc-editor/doc-menus.js +6 -69
  125. package/dist/markdown/file-links.js +33 -3
  126. package/dist/markdown/markdown-frontmatter.d.ts +6 -6
  127. package/dist/markdown/markdown-frontmatter.js +3 -3
  128. package/dist/primitives/button.d.ts +1 -1
  129. package/dist/primitives/button.js +2 -1
  130. package/dist/session/agents/held-messages.d.ts +1 -5
  131. package/dist/session/agents/held-messages.js +1 -21
  132. package/dist/session/composer/ComposerAboveCard.d.ts +4 -1
  133. package/dist/session/composer/ComposerAboveCard.js +2 -2
  134. package/dist/session/composer/composer-chat-input.d.ts +1 -1
  135. package/dist/session/composer/composer-chat-input.js +2 -2
  136. package/dist/session/composer/composer.js +16 -1
  137. package/dist/session/composer/hooks/use-file-search.d.ts +15 -15
  138. package/dist/session/composer/hooks/use-file-search.js +16 -16
  139. package/dist/session/composer/menus/mention-controller.js +1 -3
  140. package/dist/session/composer/menus/space-mentions.d.ts +14 -4
  141. package/dist/session/composer/menus/space-mentions.js +17 -1
  142. package/dist/session/composer/use-instant-session-send.js +2 -2
  143. package/dist/session/header/reminder-parts.d.ts +1 -1
  144. package/dist/session/header/session-goal-indicator.js +4 -4
  145. package/dist/session/header/session-site-header.js +2 -6
  146. package/dist/session/panel/easy/plan-card.d.ts +2 -2
  147. package/dist/session/panel/easy/plan-card.js +2 -2
  148. package/dist/session/panel/session-desktop.js +6 -0
  149. package/dist/session/panel/session-reminders-panel.js +4 -15
  150. package/dist/session/panel/use-session-panel-state.js +2 -2
  151. package/dist/session/status/sandbox-loading-boundary.js +2 -2
  152. package/dist/session/status/session-terminal-state.d.ts +47 -0
  153. package/dist/session/status/session-terminal-state.js +56 -0
  154. package/dist/session/thread/plan-surface.d.ts +1 -1
  155. package/dist/session/thread/plan-surface.js +1 -1
  156. package/dist/session/thread/session-chat.d.ts +1 -1
  157. package/dist/session/thread/session-chat.js +88 -99
  158. package/dist/session/thread/stop-sequence.d.ts +51 -0
  159. package/dist/session/thread/stop-sequence.js +55 -0
  160. package/dist/session/thread/transcript.d.ts +2 -2
  161. package/dist/session/thread/transcript.js +2 -2
  162. package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -1
  163. package/dist/session/tool/tools/apply-patch-tool.js +1 -1
  164. package/dist/session/tool/tools/kortix-action-tool.js +1 -1
  165. package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +1 -1
  166. package/dist/session/tool/tools/multi-agent-tool-bodies.js +1 -1
  167. package/dist/session/tool/tools/multi-agent-tools.js +1 -1
  168. package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -1
  169. package/dist/session/tool/tools/pty-kill-tool.js +1 -1
  170. package/dist/session/tool/tools/pty-read-tool.d.ts +2 -2
  171. package/dist/session/tool/tools/pty-read-tool.js +2 -2
  172. package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -1
  173. package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
  174. package/dist/session/tool/tools/pty-write-tool.d.ts +1 -1
  175. package/dist/session/tool/tools/pty-write-tool.js +1 -1
  176. package/dist/session/tool/tools/session-spawn-tool.js +7 -4
  177. package/dist/session/tool/tools/task-tool.js +18 -4
  178. package/dist/session/tool/tools/todo-write-tool.d.ts +1 -1
  179. package/dist/session/tool/tools/todo-write-tool.js +1 -1
  180. package/dist/session/turn/peer-message-row.d.ts +1 -10
  181. package/dist/session/turn/peer-message-row.js +1 -18
  182. package/dist/session/turn/plan-anchor.d.ts +3 -3
  183. package/dist/session/turn/plan-anchor.js +3 -3
  184. package/dist/session/turn/plan-card.d.ts +7 -7
  185. package/dist/session/turn/plan-card.js +7 -7
  186. package/dist/styles.css +1 -1
  187. package/dist/terminal/terminal-card-gate.d.ts +6 -3
  188. package/dist/terminal/terminal-card-gate.js +21 -4
  189. package/dist/workspace/home/access-requests-bell.d.ts +6 -9
  190. package/dist/workspace/home/access-requests-bell.js +8 -10
  191. package/dist/workspace/index.d.ts +1 -1
  192. package/dist/workspace/index.js +1 -1
  193. package/dist/workspace/layout/project-home.js +1 -2
  194. package/dist/workspace/review/review-center.d.ts +8 -2
  195. package/dist/workspace/review/review-center.js +44 -13
  196. package/dist/workspace/review/review-reducer.d.ts +7 -0
  197. package/dist/workspace/review/review-reducer.js +11 -0
  198. package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -1
  199. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +47 -4
  200. package/dist/workspace/sidebar/project-nav-items.js +11 -12
  201. package/dist/workspace/sidebar/project-sidebar.js +2 -6
  202. package/dist/workspace/spaces/principal-card.d.ts +3 -1
  203. package/dist/workspace/spaces/principal-card.js +3 -3
  204. package/dist/workspace/spaces/space-agent-ask.d.ts +14 -0
  205. package/dist/workspace/spaces/space-agent-ask.js +36 -0
  206. package/dist/workspace/spaces/space-details-dialog.js +1 -1
  207. package/dist/workspace/spaces/space-details-panel.d.ts +2 -1
  208. package/dist/workspace/spaces/space-details-panel.js +62 -8
  209. package/dist/workspace/spaces/space-mention-source.d.ts +3 -2
  210. package/dist/workspace/spaces/space-mention-source.js +12 -19
  211. package/dist/workspace/spaces/space-view.js +3 -2
  212. package/package.json +11 -7
  213. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
  214. package/skills/kortix-ui/references/modules.md +1 -1
  215. package/dist/_vendor/shared/artifact-annotations.d.ts +0 -311
  216. package/dist/_vendor/shared/artifact-comments.d.ts +0 -155
  217. package/dist/internal/hooks/use-notification-center.d.ts +0 -50
  218. package/dist/internal/hooks/use-notification-center.js +0 -151
  219. package/dist/session/tool/tools/multi-agent-tool-data.d.ts +0 -63
  220. package/dist/session/tool/tools/multi-agent-tool-data.js +0 -118
@@ -41,9 +41,12 @@ export declare function shouldPaintTerminalCard(input: {
41
41
  * and the wake ladder only holds until it exhausts — so withholding the
42
42
  * card there strands the user with no card AND no poll.
43
43
  *
44
- * `stage` alone already separates the only two shapes that must be withheld
45
- * (`starting`: still polling, the server retries on its own) from the three
46
- * that must paint (`failed`: the server is done trying).
44
+ * `stage` alone decides, and every value is named. `starting` is still
45
+ * polling (the server retries on its own); `provisioning` and `null` (no
46
+ * `/start` answer yet) have not reached a verdict; `ready` contradicts a
47
+ * `stopped|error` row, which is then a stale cache from an earlier `/start`.
48
+ * None of those paints. `stopped` and `failed` are the server's verdict, and
49
+ * they paint.
47
50
  */
48
51
  export declare function shouldPaintFatalCard(input: {
49
52
  stage: SessionStartStage | null;
@@ -45,10 +45,27 @@ export function shouldPaintTerminalCard(input) {
45
45
  * and the wake ladder only holds until it exhausts — so withholding the
46
46
  * card there strands the user with no card AND no poll.
47
47
  *
48
- * `stage` alone already separates the only two shapes that must be withheld
49
- * (`starting`: still polling, the server retries on its own) from the three
50
- * that must paint (`failed`: the server is done trying).
48
+ * `stage` alone decides, and every value is named. `starting` is still
49
+ * polling (the server retries on its own); `provisioning` and `null` (no
50
+ * `/start` answer yet) have not reached a verdict; `ready` contradicts a
51
+ * `stopped|error` row, which is then a stale cache from an earlier `/start`.
52
+ * None of those paints. `stopped` and `failed` are the server's verdict, and
53
+ * they paint.
51
54
  */
52
55
  export function shouldPaintFatalCard(input) {
53
- return input.stage !== 'starting';
56
+ switch (input.stage) {
57
+ case 'stopped':
58
+ case 'failed':
59
+ return true;
60
+ case null:
61
+ case 'provisioning':
62
+ case 'starting':
63
+ case 'ready':
64
+ return false;
65
+ default: {
66
+ const unhandled = input.stage;
67
+ void unhandled;
68
+ return false;
69
+ }
70
+ }
54
71
  }
@@ -2,13 +2,12 @@ import type { ProjectAccessRequest } from '@kortix/sdk';
2
2
  import { type HubTarget } from '../../internal/stores/account-panel-store.js';
3
3
  /**
4
4
  * The pending-access-requests control, floated over the hero's top-right
5
- * corner. With the project's `notification_center` flag on, its glyph is a
6
- * person with a plus, not a bell: the bell is then the notification inbox
7
- * (KRTX-1742), and two bells on one screen would read as one control. With
8
- * the flag off there is no inbox bell, and the glyph stays the bell.
5
+ * corner. Its glyph is a person with a plus, not a bell: the bell names the
6
+ * notification Inbox (KRTX-1742), and two bells on one screen would read as
7
+ * one control.
9
8
  *
10
- * It draws its count with the inbox's `BellMark`, in the yellow "needs you"
11
- * tone: a request waits on the person, so it reads like the sidebar bell.
9
+ * It draws its count with `BellMark`, in the yellow "needs you" tone: a
10
+ * request waits on the person.
12
11
  * Hover opens the people card of the session header's participant stack:
13
12
  * who asked and when, with one way to review.
14
13
  *
@@ -29,13 +28,11 @@ import { type HubTarget } from '../../internal/stores/account-panel-store.js';
29
28
  * runs at 80% of the enter. Under reduced motion the scale is dropped and the
30
29
  * fade stays, because the fade is what says "this is new".
31
30
  */
32
- export declare function AccessRequestsBell({ requests, to, notificationCenter, className, }: {
31
+ export declare function AccessRequestsBell({ requests, to, className, }: {
33
32
  /** The project's pending access requests, newest last as the API returns them. */
34
33
  requests: ProjectAccessRequest[];
35
34
  /** The account hub's Access › Projects pane, scoped to this project.
36
35
  * `null` while `account_id` is still loading — the bell renders inert. */
37
36
  to: HubTarget | null;
38
- /** The project's `notification_center` flag: on, the inbox owns the bell glyph. */
39
- notificationCenter?: boolean;
40
37
  className?: string;
41
38
  }): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { BellIcon, UserPlusIcon } from '@phosphor-icons/react';
3
+ import { UserPlusIcon } from '@phosphor-icons/react';
4
4
  import { AnimatePresence, m, useReducedMotion } from 'motion/react';
5
5
  import { useState } from 'react';
6
6
  import { BellMark } from '../../internal/notifications/notification-bell.js';
@@ -14,13 +14,12 @@ import { relativeTime } from '../../internal/lib/relative-time.js';
14
14
  import { cn } from '../../internal/lib/utils.js';
15
15
  /**
16
16
  * The pending-access-requests control, floated over the hero's top-right
17
- * corner. With the project's `notification_center` flag on, its glyph is a
18
- * person with a plus, not a bell: the bell is then the notification inbox
19
- * (KRTX-1742), and two bells on one screen would read as one control. With
20
- * the flag off there is no inbox bell, and the glyph stays the bell.
17
+ * corner. Its glyph is a person with a plus, not a bell: the bell names the
18
+ * notification Inbox (KRTX-1742), and two bells on one screen would read as
19
+ * one control.
21
20
  *
22
- * It draws its count with the inbox's `BellMark`, in the yellow "needs you"
23
- * tone: a request waits on the person, so it reads like the sidebar bell.
21
+ * It draws its count with `BellMark`, in the yellow "needs you" tone: a
22
+ * request waits on the person.
24
23
  * Hover opens the people card of the session header's participant stack:
25
24
  * who asked and when, with one way to review.
26
25
  *
@@ -41,15 +40,14 @@ import { cn } from '../../internal/lib/utils.js';
41
40
  * runs at 80% of the enter. Under reduced motion the scale is dropped and the
42
41
  * fade stays, because the fade is what says "this is new".
43
42
  */
44
- export function AccessRequestsBell({ requests, to, notificationCenter = false, className, }) {
43
+ export function AccessRequestsBell({ requests, to, className, }) {
45
44
  const t = useTranslations('hardcodedUi.i18nComplete');
46
45
  const locale = useLocale();
47
46
  const reduceMotion = useReducedMotion();
48
47
  const [open, setOpen] = useState(false);
49
48
  const count = requests.length;
50
49
  const label = `${count} pending access request${count === 1 ? '' : 's'}`;
51
- const Glyph = notificationCenter ? UserPlusIcon : BellIcon;
52
- const body = _jsx(BellMark, { count: count, needsYou: true, icon: Glyph });
50
+ const body = _jsx(BellMark, { count: count, needsYou: true, icon: UserPlusIcon });
53
51
  return (_jsx(AnimatePresence, { children: count > 0 && (_jsx(m.div, { initial: reduceMotion ? { opacity: 0 } : { opacity: 0, scale: 0.95 }, animate: {
54
52
  opacity: 1,
55
53
  scale: 1,
@@ -29,7 +29,7 @@ export { CompanyMemoryPage } from './memory/company-memory-page.js';
29
29
  export { ProjectSessionList } from './sidebar/project-session-list.js';
30
30
  export { ProjectSidebar } from './sidebar/project-sidebar.js';
31
31
  export { ShareSessionModal } from './sidebar/modal/share-session-modal.js';
32
- export { formatGoalTime, goalAssignedTo, GoalHealthDot, goalHref, goalNeedsYou, goalNeedsAttention, goalLastWake, useGoalPerson, useStartGoal, goalOpenAsks, goalPaused, GoalCriteriaProgress, GoalPersonChip, GoalStatusIcon, goalIconState, goalStatusIconState, type GoalIconState, useGoalStateText, goalProgress, GoalStatusBadge, useGoalClock, useGoalIssueText, } from '../internal/goals/goal-meta.js';
32
+ export { formatGoalTime, goalAssignedTo, GoalHealthDot, goalHref, goalNeedsYou, goalNeedsAttention, goalLastWake, useGoalPerson, useStartGoal, goalOpenAsks, goalPaused, GoalCriteriaProgress, GoalPersonChip, GoalStatusIcon, goalIconState, goalStatusIconState, type GoalIconState, useGoalStateText, goalProgress, goalCriteriaStatus, goalNextWake, GoalStatusBadge, useGoalClock, useGoalBlockedNextStep, useGoalIssueText, } from '../internal/goals/goal-meta.js';
33
33
  export { useActiveSpace } from '../internal/stores/active-space-store.js';
34
34
  export { ALL_SPACES } from '../customize/shared/catalog/catalog-space-tabs.js';
35
35
  export { SpaceFilterTabs, spaceFilterLabel } from './space/space-filter-tabs.js';
@@ -34,7 +34,7 @@ export { CompanyMemoryPage } from './memory/company-memory-page.js';
34
34
  export { ProjectSessionList } from './sidebar/project-session-list.js';
35
35
  export { ProjectSidebar } from './sidebar/project-sidebar.js';
36
36
  export { ShareSessionModal } from './sidebar/modal/share-session-modal.js';
37
- export { formatGoalTime, goalAssignedTo, GoalHealthDot, goalHref, goalNeedsYou, goalNeedsAttention, goalLastWake, useGoalPerson, useStartGoal, goalOpenAsks, goalPaused, GoalCriteriaProgress, GoalPersonChip, GoalStatusIcon, goalIconState, goalStatusIconState, useGoalStateText, goalProgress, GoalStatusBadge, useGoalClock, useGoalIssueText, } from '../internal/goals/goal-meta.js';
37
+ export { formatGoalTime, goalAssignedTo, GoalHealthDot, goalHref, goalNeedsYou, goalNeedsAttention, goalLastWake, useGoalPerson, useStartGoal, goalOpenAsks, goalPaused, GoalCriteriaProgress, GoalPersonChip, GoalStatusIcon, goalIconState, goalStatusIconState, useGoalStateText, goalProgress, goalCriteriaStatus, goalNextWake, GoalStatusBadge, useGoalClock, useGoalBlockedNextStep, useGoalIssueText, } from '../internal/goals/goal-meta.js';
38
38
  // Spaces: the per-viewer active space and the space filter the Goals and Artifacts pages share.
39
39
  export { useActiveSpace } from '../internal/stores/active-space-store.js';
40
40
  export { ALL_SPACES } from '../customize/shared/catalog/catalog-space-tabs.js';
@@ -18,7 +18,6 @@ import { getProject, listProjectAccessRequests, listProjectSandboxes, setProject
18
18
  import { contract, invalidateProject, qk } from '@kortix/sdk/react';
19
19
  import { MY_KORTIX_SANDBOX_SLUG, isMyKortixAgentName } from '../../_vendor/kortix-shared.js';
20
20
  import { AccessRequestsBell } from '../home/access-requests-bell.js';
21
- import { notificationCenterOn } from '../../internal/hooks/use-notification-center.js';
22
21
  import { FirstChat } from '../home/first-chat.js';
23
22
  import { SandboxPicker } from '../home/sandbox-picker.js';
24
23
  import { ProjectHomeWallpaper, ProjectHomeWelcomeBody } from '../home/welcome-body.js';
@@ -229,5 +228,5 @@ function ProjectHomeView({ projectId, onSend, busy, beforeSend, onboarding: onbo
229
228
  return (
230
229
  // A file dropped anywhere on the page attaches to the composer, as on a
231
230
  // session page.
232
- _jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo, notificationCenter: notificationCenterOn(projectRowQuery.data) }), firstChatPending || !onboarded || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}), firstChat ? (_jsx(FirstChat, { composer: composer })) : (_jsx(ProjectHomeWelcomeBody, { projectId: projectId, onPickSuggestion: applySuggestion, composer: composer }))] }));
231
+ _jsxs(ComposerDropZone, { className: "bg-background relative flex min-h-0 flex-1 flex-col overflow-hidden lg:px-4.5", children: [_jsx(ProjectHomeWallpaper, {}), _jsx(SidebarToggle, { placement: "floating" }), _jsx(AccessRequestsBell, { requests: accessRequests.data?.requests ?? [], to: accessRequestsTo }), firstChatPending || !onboarded || !HomeAnnouncement ? null : _jsx(HomeAnnouncement, {}), firstChat ? (_jsx(FirstChat, { composer: composer })) : (_jsx(ProjectHomeWelcomeBody, { projectId: projectId, onPickSuggestion: applySuggestion, composer: composer }))] }));
233
232
  }
@@ -16,8 +16,14 @@ export declare function ReviewCenter({ initialItems, segment: segmentProp, onSeg
16
16
  isLoading: boolean;
17
17
  isError: boolean;
18
18
  };
19
- /** Connected mode: fire the server verdict for a single item. */
20
- onAct?: (id: string, verdict: ReviewVerdict, feedback?: string) => void;
19
+ /**
20
+ * Connected mode: fire the server verdict for a single item. Return a
21
+ * promise to make the inbox wait for the server: it rolls the optimistic
22
+ * status back on a rejection (the host toasts the error), and it shows its
23
+ * own success toast only on resolve, unless the host resolves with
24
+ * `REVIEW_VERDICT_ANNOUNCED` because it already told the user.
25
+ */
26
+ onAct?: (id: string, verdict: ReviewVerdict, feedback?: string) => unknown;
21
27
  /** Connected mode: fire the server verdict for many items (the select-mode
22
28
  * bar and `d`). Resolves with one result per id; absent results mean all ok. */
23
29
  onBulkAct?: (ids: string[], verdict: ReviewVerdict) => void | Promise<readonly BulkResult[] | undefined>;
@@ -47,7 +47,7 @@ import { ConnectorAppMark } from '../../markdown/setup-links/connector-handshake
47
47
  import { ApprovalDecisionModal, reviewApprovalAsker, reviewApprovalDenyOnly, reviewApprovalDetails, } from './approval-modal.js';
48
48
  import { ReviewDetail, ReviewItemModal } from './review-detail.js';
49
49
  import { KIND_META, reviewKindLabel, reviewStatusLabel, } from './review-meta.js';
50
- import { bulkSetStatus, decideApprovalAction, filterItems, groupBySession, sessionOptions, setStatus, } from './review-reducer.js';
50
+ import { bulkSetStatus, decideApprovalAction, filterItems, groupBySession, isPromiseLike, REVIEW_VERDICT_ANNOUNCED, sessionOptions, setStatus, } from './review-reducer.js';
51
51
  import { segmentForStatus, } from './types.js';
52
52
  /**
53
53
  * Relative time is client-only: it depends on `Date.now()`, which differs between
@@ -238,6 +238,11 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
238
238
  // next `initialItems` reconciliation (the refetch that follows a mutation).
239
239
  const [pendingId, setPendingId] = useState(null);
240
240
  const [pendingDecision, setPendingDecision] = useState(null);
241
+ // The single verdict still waiting for the server (an `onAct` that returned
242
+ // a promise). While it waits, a poll keeps its optimistic status and does
243
+ // not clear the spinner, so the row cannot flicker back to "needs you" and a
244
+ // second verdict cannot go out.
245
+ const [inFlight, setInFlight] = useState(null);
241
246
  const undoRef = useRef(null);
242
247
  // Query root for scroll-into-view — a container of the [data-idx] rows. It wraps
243
248
  // either the flat <ul> or the grouped <div>, so it's typed to the common base.
@@ -380,10 +385,13 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
380
385
  const [initialItemsSeen, setInitialItemsSeen] = useState(initialItems);
381
386
  if (initialItems !== initialItemsSeen) {
382
387
  setInitialItemsSeen(initialItems);
383
- if (initialItems)
384
- setItems(initialItems);
385
- setPendingId(null);
386
- setPendingDecision(null);
388
+ if (initialItems) {
389
+ setItems(inFlight ? setStatus(initialItems, inFlight.id, inFlight.status) : initialItems);
390
+ }
391
+ if (!inFlight) {
392
+ setPendingId(null);
393
+ setPendingDecision(null);
394
+ }
387
395
  }
388
396
  // Detect items that arrived since the user last looked → flag them "fresh".
389
397
  // The first load of each segment seeds its known set silently (nothing is
@@ -432,15 +440,35 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
432
440
  * lets the refetch reconcile (the action is a real state change, so no local
433
441
  * Undo); prototype mode is fully local and undoable.
434
442
  */
435
- function apply(next, message, tone = 'success', server) {
436
- if (connected) {
437
- setItems(next);
438
- server?.();
439
- (tone === 'info' ? infoToast : successToast)(message);
440
- }
441
- else {
443
+ function apply(next, message, tone = 'success', server, optimistic) {
444
+ if (!connected) {
442
445
  commit(next, message, tone);
446
+ return;
443
447
  }
448
+ const before = items;
449
+ setItems(next);
450
+ const result = server?.();
451
+ const announce = () => (tone === 'info' ? infoToast : successToast)(message);
452
+ if (!isPromiseLike(result)) {
453
+ announce();
454
+ return;
455
+ }
456
+ // Wait for the server: no "done" toast before it answers, and a refused
457
+ // verdict puts the item back where it was.
458
+ if (optimistic)
459
+ setInFlight(optimistic);
460
+ void Promise.resolve(result)
461
+ .then((value) => {
462
+ if (value !== REVIEW_VERDICT_ANNOUNCED)
463
+ announce();
464
+ }, () => setItems(before))
465
+ .finally(() => {
466
+ if (!optimistic)
467
+ return;
468
+ setInFlight(null);
469
+ setPendingId(null);
470
+ setPendingDecision(null);
471
+ });
444
472
  }
445
473
  /** Every verdict path checks here first, so a refused verdict never commits. */
446
474
  const allowsId = (id, verdict) => {
@@ -452,11 +480,14 @@ export function ReviewCenter({ initialItems, segment: segmentProp, onSegmentChan
452
480
  const verdict = statusToVerdict(status);
453
481
  if (verdict && !allowsId(id, verdict))
454
482
  return;
483
+ // One verdict per item at a time.
484
+ if (inFlight?.id === id)
485
+ return;
455
486
  if (connected && (status === 'approved' || status === 'rejected')) {
456
487
  setPendingId(id);
457
488
  setPendingDecision(status === 'approved' ? 'approve' : 'deny');
458
489
  }
459
- apply(setStatus(items, id, status), message ?? 'Updated', status === 'rejected' || status === 'changes_requested' ? 'info' : 'success', verdict && onAct ? () => onAct(id, verdict, feedback) : undefined);
490
+ apply(setStatus(items, id, status), message ?? 'Updated', status === 'rejected' || status === 'changes_requested' ? 'info' : 'success', verdict && onAct ? () => onAct(id, verdict, feedback) : undefined, { id, status });
460
491
  },
461
492
  decideAction: (itemId, actionId, decision) => setItems(decideApprovalAction(items, itemId, actionId, decision)),
462
493
  openSession: onOpenSession,
@@ -49,3 +49,10 @@ export declare function sessionOptions(items: ReviewItem[], labelFor: (sessionId
49
49
  }[];
50
50
  /** Set the same status on many items at once (multi-select bulk approve / dismiss). */
51
51
  export declare function bulkSetStatus(items: ReviewItem[], ids: Iterable<string>, status: ReviewStatus): ReviewItem[];
52
+ /**
53
+ * What a host's `onAct` resolves with when it already told the user the
54
+ * verdict landed (its own, more specific toast). The inbox then shows none,
55
+ * so one verdict is one success toast.
56
+ */
57
+ export declare const REVIEW_VERDICT_ANNOUNCED: "review-verdict-announced";
58
+ export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
@@ -118,3 +118,14 @@ export function bulkSetStatus(items, ids, status) {
118
118
  const set = ids instanceof Set ? ids : new Set(ids);
119
119
  return items.map((i) => (set.has(i.id) ? { ...i, status } : i));
120
120
  }
121
+ /**
122
+ * What a host's `onAct` resolves with when it already told the user the
123
+ * verdict landed (its own, more specific toast). The inbox then shows none,
124
+ * so one verdict is one success toast.
125
+ */
126
+ export const REVIEW_VERDICT_ANNOUNCED = 'review-verdict-announced';
127
+ export function isPromiseLike(value) {
128
+ return (typeof value === 'object' &&
129
+ value !== null &&
130
+ typeof value.then === 'function');
131
+ }
@@ -1,6 +1,11 @@
1
1
  /** The Artifacts row shows only with the `artifacts` flag on. */
2
2
  export declare function useArtifactsRowVisible(projectId: string | undefined): boolean;
3
- /** The Artifacts row: docs, slides, boards and dashboards published in the project. */
3
+ /**
4
+ * The Artifacts row: docs, slides, boards and dashboards published in the
5
+ * project. A mouse that rests on it opens a card of those artifacts, newest
6
+ * change first, so one click opens one. The list is the gallery's own query
7
+ * (`scope: 'all'`), so the card and the page share one cache entry.
8
+ */
4
9
  export declare function ProjectArtifactsNavItem({ projectId }: {
5
10
  projectId: string;
6
11
  }): import("react").JSX.Element | null;
@@ -2,21 +2,64 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { uiRoutes } from '../../../lib/routes.js';
4
4
  import { ProjectNavRow } from '../../../internal/layout/project-nav-row.js';
5
+ import { HoverPrefetchLink } from '../../../internal/components/hover-prefetch-link.js';
5
6
  import { useTranslations } from '../../../i18n/index.js';
6
- import { useFeatureFlag } from '@kortix/sdk/react';
7
- import { CardsThreeIcon } from '@phosphor-icons/react';
7
+ import { Popover, PopoverAnchor } from '../../../primitives/popover.js';
8
+ import { InputGroupSearch, InputGroupSearchIcon, InputGroupSearchInput, } from '../../../primitives/input-group.js';
9
+ import { menuRow } from '../../../primitives/menu-recipe.js';
10
+ import { NavHoverCardContent, NavHoverCardList, useNavHoverCard } from '../../../internal/layout/nav-hover-card.js';
11
+ import { useArtifacts, useFeatureFlag } from '@kortix/sdk/react';
12
+ import { BrowserIcon, CardsThreeIcon, FileTextIcon, MagnifyingGlassIcon } from '@phosphor-icons/react';
8
13
  import { useUiPathname } from '../../../providers/ui-provider.js';
14
+ import { useRef, useState } from 'react';
15
+ /** Above this many artifacts the card gets a search field. Same as the Apps card. */
16
+ const SEARCH_THRESHOLD = 10;
17
+ /** The list's page size (the API default). A full page may hold more: a search there asks the server. */
18
+ const LIST_PAGE = 100;
19
+ /** The glyph the artifact's own header draws for its type (`artifact-session.tsx`). */
20
+ const TYPE_ICON = { doc: FileTextIcon, html: BrowserIcon };
9
21
  /** The Artifacts row shows only with the `artifacts` flag on. */
10
22
  export function useArtifactsRowVisible(projectId) {
11
23
  return useFeatureFlag(projectId, 'artifacts').enabled;
12
24
  }
13
- /** The Artifacts row: docs, slides, boards and dashboards published in the project. */
25
+ /**
26
+ * The Artifacts row: docs, slides, boards and dashboards published in the
27
+ * project. A mouse that rests on it opens a card of those artifacts, newest
28
+ * change first, so one click opens one. The list is the gallery's own query
29
+ * (`scope: 'all'`), so the card and the page share one cache entry.
30
+ */
14
31
  export function ProjectArtifactsNavItem({ projectId }) {
15
32
  const t = useTranslations('sidebar');
16
33
  const pathname = useUiPathname();
17
34
  const visible = useArtifactsRowVisible(projectId);
35
+ const artifacts = useArtifacts(visible ? projectId : null, { scope: 'all' });
36
+ const [query, setQuery] = useState('');
37
+ const searchRef = useRef(null);
38
+ const listed = artifacts.data ?? [];
39
+ const card = useNavHoverCard({ enabled: listed.length > 0, holdRef: searchRef });
40
+ const showSearch = listed.length > SEARCH_THRESHOLD;
41
+ const needle = query.trim().toLowerCase();
42
+ // Same split as the gallery: a full page filters on the server, a shorter list here.
43
+ const paged = listed.length >= LIST_PAGE;
44
+ const server = useArtifacts(paged && needle ? projectId : null, { scope: 'all', q: needle || undefined });
45
+ // Title or description, as the server's `q` matches. The loaded page shows until the server
46
+ // answers this query (not a previous one's placeholder), and when it fails.
47
+ const local = needle
48
+ ? listed.filter((artifact) => artifact.title.toLowerCase().includes(needle) || !!artifact.description?.toLowerCase().includes(needle))
49
+ : listed;
50
+ const shown = paged && needle && server.data && !server.isPlaceholderData ? server.data : local;
18
51
  const href = projectId ? uiRoutes().artifacts(projectId) : null;
19
52
  if (!href || !visible)
20
53
  return null;
21
- return (_jsxs(ProjectNavRow, { active: pathname?.startsWith(href) === true, label: t('artifacts'), href: href, prefetch: true, children: [_jsx("span", { className: "shrink-0", children: _jsx(CardsThreeIcon, {}) }), t('artifacts')] }));
54
+ const close = () => card.setOpen(false);
55
+ return (_jsxs(Popover, { open: card.open, onOpenChange: (next) => {
56
+ card.setOpen(next);
57
+ if (!next)
58
+ setQuery('');
59
+ }, children: [_jsx(PopoverAnchor, { virtualRef: card.anchorRef }), _jsxs(ProjectNavRow, { active: pathname?.startsWith(href) === true, label: t('artifacts'), href: href, prefetch: true, ...card.rowProps, children: [_jsx("span", { className: "shrink-0", children: _jsx(CardsThreeIcon, {}) }), t('artifacts')] }), _jsxs(NavHoverCardContent, { ...card.contentProps, children: [showSearch ? (_jsx("div", { className: "border-border border-b p-1", children: _jsxs(InputGroupSearch, { children: [_jsx(InputGroupSearchIcon, { children: _jsx(MagnifyingGlassIcon, {}) }), _jsx(InputGroupSearchInput, { ref: searchRef, variant: "popover", size: "xs", value: query, onChange: (event) => setQuery(event.target.value), placeholder: t('searchArtifacts'), "aria-label": t('searchArtifacts') })] }) })) : null, _jsxs(NavHoverCardList, { className: "max-h-80 overflow-x-hidden overflow-y-auto overscroll-contain", children: [shown.map((artifact) => (_jsx("li", { children: _jsx(ArtifactRow, { artifact: artifact, href: `${href}/${encodeURIComponent(artifact.artifact_id)}`, onOpen: close }) }, artifact.artifact_id))), shown.length === 0 ? (_jsx("li", { className: menuRow('sm', 'default', 'text-muted-foreground pointer-events-none'), children: t('appsNoMatches') })) : null] })] })] }));
60
+ }
61
+ /** One artifact: its type glyph and its title. */
62
+ function ArtifactRow({ artifact, href, onOpen }) {
63
+ const Glyph = TYPE_ICON[artifact.type];
64
+ return (_jsxs(HoverPrefetchLink, { href: href, onClick: onOpen, className: menuRow('sm', 'default', 'cursor-pointer'), children: [_jsx(Glyph, { "aria-hidden": true, className: "text-muted-foreground size-4 shrink-0" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: artifact.title })] }));
22
65
  }
@@ -6,18 +6,16 @@ import { ProjectArtifactsNavItem } from './footer/project-artifacts-nav.js';
6
6
  import { ProjectFilesNavItem } from './footer/project-files-nav.js';
7
7
  import { CustomizeGlyph, useCapabilityAccess, } from '../../internal/layout/project-settings-nav.js';
8
8
  import { isProjectAdminPath, ProjectCapabilityNav, useOpenNewAgent } from '../../internal/layout/project-capability-nav.js';
9
- import { capabilityTabHref } from '../../internal/lib/capability-tab-routes.js';
10
9
  import { PROJECT_ACTIONS } from '../../internal/lib/project-actions.js';
11
10
  import { useProjectCan } from '../../internal/lib/use-project-can.js';
12
11
  import { Button } from '../../primitives/button.js';
13
- import { ButtonGroup } from '../../primitives/button-group.js';
14
12
  import Hint from '../../primitives/hint.js';
15
13
  import { cn } from '../../lib/utils.js';
16
14
  import { SidebarMenuButton, SidebarMenuItem, useSidebar } from '../../primitives/sidebar.js';
17
15
  import { useIsMobile } from '../../internal/hooks/index.js';
18
16
  import { useTranslations } from '../../i18n/index.js';
19
- import { CaretRightIcon, ListIcon, PlusIcon } from '@phosphor-icons/react';
20
- import { UiLink as Link, useUiPathname } from '../../providers/ui-provider.js';
17
+ import { CaretRightIcon, PlusIcon } from '@phosphor-icons/react';
18
+ import { useUiPathname } from '../../providers/ui-provider.js';
21
19
  import { useEffect, useState } from 'react';
22
20
  /**
23
21
  * The nav rows under New session, in one fixed order. Each row applies its
@@ -33,10 +31,11 @@ export function ProjectNavItems({ projectId }) {
33
31
  * Customize, for the people who may configure the project. Most configuring
34
32
  * happens by asking an agent in a session, so this stays one disclosure: the
35
33
  * row toggles the project's agents, Review, Models and Settings
36
- * (`ProjectCapabilityNav`). On hover, its right edge holds
37
- * + (New agent) and All agents. Open by itself on an agent or Customize page;
38
- * a click overrides that until you cross between those contexts. Absent when
39
- * the caller may open no capability page (same gate as the tab bar).
34
+ * (`ProjectCapabilityNav`). On hover, its right edge holds + (New agent);
35
+ * All agents is a row inside the disclosure. Open by itself on an agent or
36
+ * Customize page; a click overrides that until you cross between those
37
+ * contexts. Absent when the caller may open no capability page (same gate
38
+ * as the tab bar).
40
39
  */
41
40
  function CustomizeNavEntry({ projectId }) {
42
41
  const t = useTranslations('sidebar');
@@ -62,10 +61,10 @@ function CustomizeNavEntry({ projectId }) {
62
61
  return (_jsxs(_Fragment, { children: [_jsxs(SidebarMenuItem, { className: "group/customize", children: [_jsxs(SidebarMenuButton, { onClick: () => setOverride(!open), "aria-expanded": open,
63
62
  // The caret is the Sessions header's: 12px (beats the button's
64
63
  // `[&_svg]:size-4!`), shown on hover, turned when open.
65
- className: "group/menu-button text-sidebar-foreground pr-14 [&>svg:last-child]:size-3!", children: [_jsx("span", { className: "shrink-0", children: _jsx(CustomizeGlyph, {}) }), _jsx("span", { className: "truncate", children: t('customize') }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground duration-normal size-3 shrink-0 opacity-0 transition-transform ease-out group-focus-within/customize:opacity-100 group-hover/customize:opacity-100', open && 'rotate-90') })] }), hasAgents ? (_jsxs(ButtonGroup, { className: "absolute top-1/2 right-1 -translate-y-1/2 opacity-100 transition-opacity group-focus-within/customize:opacity-100 group-hover/customize:opacity-100 md:opacity-0", children: [canCreate && openNewAgent ? (_jsx(Hint, { side: "top", label: tTabs('newAgent'), children: _jsx(Button, { variant: "secondary", size: "icon-xs", type: "button", "aria-label": tTabs('newAgent'), onClick: () => {
66
- close();
67
- openNewAgent();
68
- }, children: _jsx(PlusIcon, { className: "size-4" }) }) })) : null, _jsx(Hint, { side: "top", label: tTabs('allAgents'), children: _jsx(Button, { variant: "secondary", size: "icon-xs", asChild: true, children: _jsx(Link, { href: capabilityTabHref(projectId, 'agent'), prefetch: false, "aria-label": tTabs('allAgents'), onClick: close, children: _jsx(ListIcon, { className: "size-4" }) }) }) })] })) : null] }), open ? _jsx(ProjectCapabilityNav, { projectId: projectId }) : null] }));
64
+ className: "group/menu-button text-sidebar-foreground pr-8 [&>svg:last-child]:size-3!", children: [_jsx("span", { className: "shrink-0", children: _jsx(CustomizeGlyph, {}) }), _jsx("span", { className: "truncate", children: t('customize') }), _jsx(CaretRightIcon, { "aria-hidden": true, className: cn('text-muted-foreground duration-normal size-3 shrink-0 opacity-0 transition-transform ease-out group-focus-within/customize:opacity-100 group-hover/customize:opacity-100', open && 'rotate-90') })] }), hasAgents && canCreate && openNewAgent ? (_jsx(Hint, { side: "top", label: tTabs('newAgent'), children: _jsx(Button, { variant: "secondary", size: "icon-xs", type: "button", "aria-label": tTabs('newAgent'), className: "absolute top-1/2 right-1 -translate-y-1/2 opacity-100 transition-opacity group-focus-within/customize:opacity-100 group-hover/customize:opacity-100 md:opacity-0", onClick: () => {
65
+ close();
66
+ openNewAgent();
67
+ }, children: _jsx(PlusIcon, { className: "size-4" }) }) })) : null] }), open ? _jsx(ProjectCapabilityNav, { projectId: projectId }) : null] }));
69
68
  }
70
69
  function NavItem({ id, projectId }) {
71
70
  switch (id) {
@@ -5,7 +5,6 @@ import { Button } from '../../primitives/button.js';
5
5
  import Hint from '../../primitives/hint.js';
6
6
  import { Kbd, KbdGroup } from '../../primitives/kbd.js';
7
7
  import { Sidebar, SidebarContent, SidebarGroup, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarRail, useSidebar, } from '../../primitives/sidebar.js';
8
- import { NotificationBell } from '../../internal/notifications/notification-bell.js';
9
8
  import { ComputerConnectModal } from '../../internal/tunnel/computer-connect.js';
10
9
  import { ConnectMcpModal } from '../../internal/layout/connect-mcp-modal.js';
11
10
  import { ProjectMcpNavItem } from './footer/project-mcp-nav.js';
@@ -107,13 +106,10 @@ export function ProjectSidebar({ projectId, menu, onOpenSearch, }) {
107
106
  // the square positioning box — while the visible card is the rounded
108
107
  // inner box, which already carries `bg-sidebar`. Painting it twice put a
109
108
  // square fill behind the flyout card and it showed at all four corners.
110
- className: "[scrollbar-width:'none'] [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden", children: [_jsx(SidebarHeader, { className: "kx-project-sidebar-header space-y-2", "data-peek": peek ? '' : undefined, children: _jsxs("div", { className: cn('flex w-full items-center gap-1', !peek && 'kx-titlebar-row kx-titlebar-band-height kx-project-sidebar-titlebar'), children: [menu ? _jsx("div", { className: "min-w-0", children: menu }) : null, _jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-0.5", children: [_jsx(NotificationBell, { projectId: projectId, surface: "bg-sidebar", onNavigate: () => {
111
- if (isMobile)
112
- setOpenMobile(false);
113
- } }), onOpenSearch && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [t('search'), !isMobile && (_jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "K" })] }))] }), children: _jsx(Button, { type: "button", "aria-label": t('search'), variant: "ghost", size: "icon", onClick: handleOpenSearch,
109
+ className: "[scrollbar-width:'none'] [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden", children: [_jsx(SidebarHeader, { className: "kx-project-sidebar-header space-y-2", "data-peek": peek ? '' : undefined, children: _jsxs("div", { className: cn('flex w-full items-center gap-1', !peek && 'kx-titlebar-row kx-titlebar-band-height kx-project-sidebar-titlebar'), children: [menu ? _jsx("div", { className: "min-w-0", children: menu }) : null, _jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-0.5", children: [onOpenSearch && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [t('search'), !isMobile && (_jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "K" })] }))] }), children: _jsx(Button, { type: "button", "aria-label": t('search'), variant: "ghost", size: "icon", onClick: handleOpenSearch,
114
110
  // The palette's only pointer-reachable entry: the ≈26px ghost
115
111
  // box clears the 44px floor with the vertical-only extension —
116
112
  // vertical-only because this titlebar row packs several
117
113
  // controls side by side (KRTX-2004).
118
- className: "shrink-0 hit-area-y-3", children: _jsx(MagnifyingGlassIcon, { className: "size-4" }) }) })), isMobile && (_jsx(Button, { type: "button", "aria-label": tCommon('close'), variant: "ghost", size: "icon", onClick: () => setOpenMobile(false), className: "shrink-0 hit-area-y-3", children: _jsx(Close, {}) })), !isMobile && !peek && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [isExpanded ? t('collapse') : t('pin'), _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "B" })] })] }), children: _jsx(Button, { type: "button", "aria-label": isExpanded ? t('collapse') : t('pin'), variant: "ghost", size: "icon", onClick: toggleSidebar, className: "shrink-0", children: _jsx(PanelLeft, { className: "cn-rtl-flip" }) }) }))] })] }) }), _jsx(SidebarContent, { className: "relative min-h-0 flex-1 [scrollbar-width:'none'] overflow-hidden [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden [&_[data-sidebar=menu-button]]:pl-2", children: _jsxs("div", { className: "flex h-full min-h-0 flex-col space-y-2", children: [chat ? null : (_jsx(SidebarGroup, { className: "py-0", children: _jsxs(SidebarMenu, { children: [chat ? null : (_jsx(SidebarMenuItem, { children: creatingSession ? (_jsx(SidebarMenuButton, { disabled: true, "aria-busy": true, className: "group/menu-button text-sidebar-foreground relative", children: newSessionRowBody })) : (_jsx(SidebarMenuButton, { asChild: true, className: "group/menu-button text-sidebar-foreground relative", children: _jsx(Link, { href: uiRoutes().project(projectId), prefetch: true, onClick: handleNewSessionClick, children: newSessionRowBody }) })) })), _jsx(ProjectNavItems, { projectId: projectId })] }) })), _jsx(SidebarGroup, { className: "min-h-0 flex-1 flex-col py-0", ref: sessionsGroupRef, children: chat ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "min-h-0 flex-1", children: _jsx(ProjectSpacesNav, { projectId: projectId }) }), _jsx(SidebarMoreGroup, { projectId: projectId, footer: _jsx(SidebarMenu, { className: "gap-1", children: connectRows }) })] })) : (_jsx(ProjectSessionList, { projectId: projectId })) }), _jsx(SidebarGroup, { className: "mt-auto", children: _jsxs(SidebarMenu, { className: "gap-1", children: [_jsx(ProjectRepositoryDisconnectedAlert, { projectId: projectId }), _jsx(ProjectSandboxAlert, { projectId: projectId }), _jsx(ProjectManifestIssuesAlert, { projectId: projectId }), _jsx(SidebarBalanceWarning, { accountId: accountId }), chat ? null : connectRows] }) })] }) }), _jsx(SidebarRail, { "aria-label": t('resize'), title: t('resizeHelp') })] }), _jsx(ComputerConnectModal, { projectId: projectId, open: computerConnectOpen, onOpenChange: setComputerConnectOpen }), _jsx(AppsModal, { chrome: chrome, onOpenComputer: () => setComputerConnectOpen(true), onOpenMcp: () => setConnectMcpOpen(true) }), _jsx(ConnectMcpModal, { open: connectMcpOpen, onOpenChange: setConnectMcpOpen })] }));
114
+ className: "shrink-0 hit-area-y-3", children: _jsx(MagnifyingGlassIcon, { className: "size-4" }) }) })), isMobile && (_jsx(Button, { type: "button", "aria-label": tCommon('close'), variant: "ghost", size: "icon", onClick: () => setOpenMobile(false), className: "shrink-0 hit-area-y-3", children: _jsx(Close, {}) })), !isMobile && !peek && (_jsx(Hint, { side: "bottom", label: _jsxs("span", { className: "flex items-center gap-1.5", children: [isExpanded ? t('collapse') : t('pin'), _jsxs(KbdGroup, { children: [_jsx(Kbd, { className: "font-mono", children: modSymbol }), _jsx(Kbd, { className: "font-mono", children: "B" })] })] }), children: _jsx(Button, { type: "button", "aria-label": isExpanded ? t('collapse') : t('pin'), variant: "ghost", size: "icon", onClick: toggleSidebar, className: "shrink-0", children: _jsx(PanelLeft, { className: "cn-rtl-flip" }) }) }))] })] }) }), _jsx(SidebarContent, { className: "relative min-h-0 flex-1 [scrollbar-width:'none'] overflow-hidden [-ms-overflow-style:'none'] [&::-webkit-scrollbar]:hidden [&_[data-sidebar=menu-button]]:pl-2", children: _jsxs("div", { className: "flex h-full min-h-0 flex-col space-y-2", children: [_jsx(SidebarGroup, { className: "py-0", children: _jsxs(SidebarMenu, { children: [chat ? null : (_jsx(SidebarMenuItem, { children: creatingSession ? (_jsx(SidebarMenuButton, { disabled: true, "aria-busy": true, className: "group/menu-button text-sidebar-foreground relative", children: newSessionRowBody })) : (_jsx(SidebarMenuButton, { asChild: true, className: "group/menu-button text-sidebar-foreground relative", children: _jsx(Link, { href: uiRoutes().project(projectId), prefetch: true, onClick: handleNewSessionClick, children: newSessionRowBody }) })) })), chat ? null : _jsx(ProjectNavItems, { projectId: projectId })] }) }), _jsx(SidebarGroup, { className: "min-h-0 flex-1 flex-col py-0", ref: sessionsGroupRef, children: chat ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "min-h-0 flex-1", children: _jsx(ProjectSpacesNav, { projectId: projectId }) }), _jsx(SidebarMoreGroup, { projectId: projectId, footer: _jsx(SidebarMenu, { className: "gap-1", children: connectRows }) })] })) : (_jsx(ProjectSessionList, { projectId: projectId })) }), _jsx(SidebarGroup, { className: "mt-auto", children: _jsxs(SidebarMenu, { className: "gap-1", children: [_jsx(ProjectRepositoryDisconnectedAlert, { projectId: projectId }), _jsx(ProjectSandboxAlert, { projectId: projectId }), _jsx(ProjectManifestIssuesAlert, { projectId: projectId }), _jsx(SidebarBalanceWarning, { accountId: accountId }), chat ? null : connectRows] }) })] }) }), _jsx(SidebarRail, { "aria-label": t('resize'), title: t('resizeHelp') })] }), _jsx(ComputerConnectModal, { projectId: projectId, open: computerConnectOpen, onOpenChange: setComputerConnectOpen }), _jsx(AppsModal, { chrome: chrome, onOpenComputer: () => setComputerConnectOpen(true), onOpenMcp: () => setConnectMcpOpen(true) }), _jsx(ConnectMcpModal, { open: connectMcpOpen, onOpenChange: setConnectMcpOpen })] }));
119
115
  }
@@ -44,7 +44,7 @@ export declare function PrincipalHover({ projectId, principal, children, classNa
44
44
  * the Profile on click (Enter too), and `onOpened` to close the popover it
45
45
  * sits in. Every list of principals in Spaces renders through it.
46
46
  */
47
- export declare function PrincipalRow({ projectId, principal, avatar, name, secondary, tag, onOpened, }: {
47
+ export declare function PrincipalRow({ projectId, principal, avatar, name, secondary, tag, actions, onOpened, }: {
48
48
  projectId: string;
49
49
  principal: Principal;
50
50
  /** One 28px slot, so every name starts on one edge. */
@@ -54,6 +54,8 @@ export declare function PrincipalRow({ projectId, principal, avatar, name, secon
54
54
  secondary?: string | null;
55
55
  /** A muted tag at the row's end ("You", "Default"). */
56
56
  tag?: string | null;
57
+ /** The row's own menu at its end, beside the card trigger (a button never nests in one). */
58
+ actions?: ReactNode;
57
59
  onOpened?: () => void;
58
60
  }): import("react").JSX.Element;
59
61
  /**
@@ -167,8 +167,8 @@ export function PrincipalHover({ projectId, principal, children, className, focu
167
167
  * the Profile on click (Enter too), and `onOpened` to close the popover it
168
168
  * sits in. Every list of principals in Spaces renders through it.
169
169
  */
170
- export function PrincipalRow({ projectId, principal, avatar, name, secondary, tag, onOpened, }) {
171
- return (_jsx("li", { children: _jsxs(PrincipalHover, { projectId: projectId, principal: principal, onOpened: onOpened, className: "hover:bg-hover flex min-h-9 w-full items-center gap-2.5 rounded-md px-2 py-1", children: [_jsx("span", { className: "flex size-7 shrink-0 items-center justify-center", children: avatar }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm leading-tight", children: name }), secondary ? _jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight tabular-nums", children: secondary }) : null] }), tag ? _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tag }) : null] }) }));
170
+ export function PrincipalRow({ projectId, principal, avatar, name, secondary, tag, actions, onOpened, }) {
171
+ return (_jsxs("li", { className: actions ? 'hover:bg-hover flex items-center rounded-md pr-1' : undefined, children: [_jsxs(PrincipalHover, { projectId: projectId, principal: principal, onOpened: onOpened, className: cn('flex min-h-9 w-full min-w-0 items-center gap-2.5 rounded-md px-2 py-1', actions ? 'flex-1' : 'hover:bg-hover'), children: [_jsx("span", { className: "flex size-7 shrink-0 items-center justify-center", children: avatar }), _jsxs("span", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm leading-tight", children: name }), secondary ? _jsx("span", { className: "text-muted-foreground truncate text-xs leading-tight tabular-nums", children: secondary }) : null] }), tag ? _jsx("span", { className: "text-muted-foreground shrink-0 text-xs", children: tag }) : null] }), actions] }));
172
172
  }
173
173
  /** The card: avatar, name ("(you)"), role and description, then one or two actions. */
174
174
  function PrincipalSummary({ projectId, principal, onOpenProfile }) {
@@ -209,7 +209,7 @@ function AgentProfile({ projectId, name }) {
209
209
  const spaces = useProjectSpaces(projectId);
210
210
  const personalName = usePersonalSpaceName();
211
211
  const agent = config?.agents.find((item) => item.name === name);
212
- const projectDefault = config?.default_agent ?? config?.open_code_default_agent ?? null;
212
+ const projectDefault = config?.default_agent ?? null;
213
213
  // The spaces it works in: channels that list it, and the person's own space for My Kortix.
214
214
  const memberOf = (spaces.data ?? []).filter((space) => !space.archived_at && (space.kind === 'channel' ? !!space.agents?.includes(name) : isPersonalSpace(space) && isMyKortixAgentName(name)));
215
215
  const add = useAddAgentToSpace(projectId, name);
@@ -0,0 +1,14 @@
1
+ import type { ProjectSpace } from '@kortix/sdk';
2
+ /**
3
+ * Above a space's composer after a send named an agent from outside the space
4
+ * (flag `chat`). A space's agents are a boundary: the router hands work only
5
+ * to them, so naming another agent never adds it. A person who may edit the
6
+ * channel gets "Add Worker to #launch? Add · Not now"; anyone else gets who to
7
+ * ask. Add replaces the channel's agent list (PATCH space `agents`).
8
+ */
9
+ export declare function SpaceAgentAsk({ projectId, space, agent, onDone, }: {
10
+ projectId: string;
11
+ space: ProjectSpace;
12
+ agent: string;
13
+ onDone: () => void;
14
+ }): import("react").JSX.Element;
@@ -0,0 +1,36 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useUpdateProjectSpace } from '@kortix/sdk/react';
4
+ import { useTranslations } from '../../i18n/index.js';
5
+ import { Close } from '../../icons/close.js';
6
+ import { AgentMark } from '../../internal/components/agent-mark.js';
7
+ import { Button } from '../../primitives/button.js';
8
+ import { errorToast, successToast } from '../../primitives/toast.js';
9
+ import { agentLabel } from './space-timeline.js';
10
+ /**
11
+ * Above a space's composer after a send named an agent from outside the space
12
+ * (flag `chat`). A space's agents are a boundary: the router hands work only
13
+ * to them, so naming another agent never adds it. A person who may edit the
14
+ * channel gets "Add Worker to #launch? Add · Not now"; anyone else gets who to
15
+ * ask. Add replaces the channel's agent list (PATCH space `agents`).
16
+ */
17
+ export function SpaceAgentAsk({ projectId, space, agent, onDone, }) {
18
+ const t = useTranslations('spaces.mentions');
19
+ const update = useUpdateProjectSpace(projectId);
20
+ const spaceName = `#${space.slug ?? space.name}`;
21
+ const label = agentLabel(agent);
22
+ const canEdit = space.kind === 'channel' && space.can_edit === true;
23
+ const add = () => {
24
+ const agents = space.agents ?? [];
25
+ if (agents.includes(agent))
26
+ return onDone();
27
+ update.mutate({ spaceId: space.space_id, input: { agents: [...agents, agent] } }, {
28
+ onSuccess: () => {
29
+ successToast(t('added', { agent: label, space: spaceName }));
30
+ onDone();
31
+ },
32
+ onError: () => errorToast(t('addFailed')),
33
+ });
34
+ };
35
+ return (_jsxs("div", { role: "status", "aria-live": "polite", "data-space-agent-ask": agent, className: "bg-sidebar border-border flex w-full items-center gap-2 rounded-xl border py-1.5 pr-1.5 pl-3", children: [_jsx(AgentMark, { slug: agent, size: 14 }), _jsx("span", { className: "text-muted-foreground min-w-0 flex-1 truncate text-xs", children: canEdit ? t('askAdd', { agent: label, space: spaceName }) : t('askAdmin', { agent: label, space: spaceName }) }), canEdit ? (_jsxs(_Fragment, { children: [_jsx(Button, { type: "button", size: "xs", onClick: add, disabled: update.isPending, children: t('askAddConfirm') }), _jsx(Button, { type: "button", variant: "ghost", size: "xs", className: "text-muted-foreground hover:text-foreground", onClick: onDone, children: t('askNotNow') })] })) : (_jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", className: "text-muted-foreground hover:text-foreground", "aria-label": t('dismiss'), onClick: onDone, children: _jsx(Close, { className: "size-3.5" }) }))] }));
36
+ }
@@ -50,7 +50,7 @@ function AboutPane({ space, onEdit, onArchive }) {
50
50
  });
51
51
  // A channel with an agent list starts a new thread on its first agent.
52
52
  const channelDefault = space.agents?.[0] ?? null;
53
- const defaultAgent = channelDefault ?? detail.data?.config.default_agent ?? detail.data?.config.open_code_default_agent ?? null;
53
+ const defaultAgent = channelDefault ?? detail.data?.config.default_agent ?? null;
54
54
  const created = new Date(space.created_at).toLocaleDateString(locale, { dateStyle: 'medium' });
55
55
  // Its creator or a project manager; an older API sends no `can_edit`.
56
56
  const editable = space.can_edit !== false;