@kortix/ui 0.14.17 → 0.14.19

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 (116) hide show
  1. package/README.md +2 -2
  2. package/dist/_vendor/kortix-shared.js +38 -2
  3. package/dist/_vendor/shared/channel-descriptors.d.ts +20 -1
  4. package/dist/_vendor/shared/channel-message.d.ts +1 -1
  5. package/dist/_vendor/shared/my-kortix-agent.d.ts +1 -1
  6. package/dist/_vendor/shared/space-slug.d.ts +3 -4
  7. package/dist/_vendor/shared/utils/ambiguous-write.d.ts +3 -3
  8. package/dist/customize/agents/agent-instructions.d.ts +8 -0
  9. package/dist/customize/agents/agent-instructions.js +38 -12
  10. package/dist/customize/agents/agent-overview.d.ts +6 -3
  11. package/dist/customize/agents/agent-overview.js +8 -2
  12. package/dist/customize/agents/agent-page-chrome.d.ts +45 -27
  13. package/dist/customize/agents/agent-page-chrome.js +60 -37
  14. package/dist/customize/agents/agent-page.js +88 -99
  15. package/dist/customize/agents/agent-tabs.d.ts +15 -14
  16. package/dist/customize/agents/agent-tabs.js +19 -16
  17. package/dist/customize/agents/agents-page.js +8 -6
  18. package/dist/customize/connectors/detail/account-info.js +1 -1
  19. package/dist/customize/project-settings/project-admin-sections.d.ts +6 -2
  20. package/dist/customize/project-settings/project-admin-sections.js +5 -3
  21. package/dist/customize/project-settings/project-settings-sections.js +1 -1
  22. package/dist/customize/sections/component/channel-access-panel.js +16 -0
  23. package/dist/customize/sections/component/channel-mocks.d.ts +5 -0
  24. package/dist/customize/sections/component/channel-mocks.js +14 -2
  25. package/dist/customize/sections/component/discord-channel-row.d.ts +6 -0
  26. package/dist/customize/sections/component/discord-channel-row.js +48 -0
  27. package/dist/customize/sections/gateway-access-tab.js +1 -1
  28. package/dist/customize/sections/view/channels-view.js +18 -1
  29. package/dist/customize/sections/view/git-view.js +2 -2
  30. package/dist/customize/sections/view/secret-delivery.js +1 -1
  31. package/dist/customize/sections/view/secrets-view.js +1 -1
  32. package/dist/customize/settings/rail.js +2 -2
  33. package/dist/customize/settings/tabs/experimental-tab.d.ts +2 -2
  34. package/dist/customize/settings/tabs/experimental-tab.js +2 -2
  35. package/dist/customize/settings/tabs/general-tab.js +5 -4
  36. package/dist/customize/shared/capability-library.js +19 -22
  37. package/dist/customize/shared/customize-tab-bar.d.ts +1 -2
  38. package/dist/customize/shared/customize-tab-bar.js +10 -11
  39. package/dist/files/project/components/drive-create-dialog.js +3 -3
  40. package/dist/i18n/en.d.ts +51 -4
  41. package/dist/i18n/en.js +66 -19
  42. package/dist/i18n/ui-catalog/remaining-ui-translation-keys.generated.js +1 -1
  43. package/dist/internal/branding/branding-provider.d.ts +15 -4
  44. package/dist/internal/branding/branding-provider.js +12 -7
  45. package/dist/internal/connector-logo/connector-logo.js +2 -0
  46. package/dist/internal/connector-logo/connector-mark-files.js +1 -0
  47. package/dist/internal/hooks/channels/use-channels-installations.d.ts +7 -2
  48. package/dist/internal/hooks/channels/use-channels-installations.js +31 -1
  49. package/dist/internal/hooks/projects/use-new-project-session.d.ts +6 -14
  50. package/dist/internal/hooks/projects/use-new-project-session.js +12 -97
  51. package/dist/internal/hooks/use-notification-center.d.ts +11 -8
  52. package/dist/internal/hooks/use-notification-center.js +22 -10
  53. package/dist/internal/icons/discord.d.ts +9 -0
  54. package/dist/internal/icons/discord.js +9 -0
  55. package/dist/internal/layout/connect-mcp-modal.js +1 -1
  56. package/dist/internal/lib/browser-noise/rules/expected-states.js +1 -1
  57. package/dist/internal/lib/error-handler.js +1 -1
  58. package/dist/internal/lib/use-project-feature-flags.js +5 -3
  59. package/dist/markdown/markdown-frontmatter.d.ts +0 -3
  60. package/dist/markdown/markdown-frontmatter.js +45 -5
  61. package/dist/session/actions/project-session-list-helpers.d.ts +4 -14
  62. package/dist/session/actions/project-session-list-helpers.js +5 -16
  63. package/dist/session/actions/session-label.d.ts +5 -9
  64. package/dist/session/actions/session-label.js +6 -10
  65. package/dist/session/participants/session-participants.d.ts +7 -5
  66. package/dist/session/participants/session-participants.js +11 -7
  67. package/dist/session/status/provisioning-failure.d.ts +4 -5
  68. package/dist/session/status/provisioning-failure.js +4 -5
  69. package/dist/session/thread/optimistic-turn.js +11 -2
  70. package/dist/session/thread/session-chat.js +73 -25
  71. package/dist/session/thread/transcript.d.ts +9 -0
  72. package/dist/session/thread/transcript.js +44 -5
  73. package/dist/session/tool/tools/channel-send-card.js +1 -0
  74. package/dist/session/turn/channel-brand.js +4 -0
  75. package/dist/session/turn/message-author.d.ts +13 -8
  76. package/dist/session/turn/message-author.js +34 -16
  77. package/dist/session/turn/peer-message-row.js +24 -6
  78. package/dist/session/turn/user-message.js +1 -1
  79. package/dist/session/voice/call-audio.d.ts +32 -0
  80. package/dist/session/voice/call-audio.js +146 -0
  81. package/dist/session/voice/screen-share.d.ts +24 -0
  82. package/dist/session/voice/screen-share.js +75 -0
  83. package/dist/session/voice/use-voice-call.d.ts +15 -0
  84. package/dist/session/voice/use-voice-call.js +220 -0
  85. package/dist/session/voice/voice-call-bar.d.ts +4 -0
  86. package/dist/session/voice/voice-call-bar.js +39 -0
  87. package/dist/session/voice/voice-call-state.d.ts +96 -0
  88. package/dist/session/voice/voice-call-state.js +103 -0
  89. package/dist/session/voice/voice-call-store.d.ts +12 -0
  90. package/dist/session/voice/voice-call-store.js +10 -0
  91. package/dist/session/voice/voice-call-url.d.ts +24 -0
  92. package/dist/session/voice/voice-call-url.js +33 -0
  93. package/dist/session/voice/voice-call.d.ts +15 -0
  94. package/dist/session/voice/voice-call.js +54 -0
  95. package/dist/styles.css +1 -1
  96. package/dist/workspace/admin/project-admin-dashboard.js +9 -4
  97. package/dist/workspace/layout/project-home.js +13 -14
  98. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.d.ts +1 -1
  99. package/dist/workspace/sidebar/footer/project-manifest-issues-alert.js +4 -3
  100. package/dist/workspace/sidebar/project-session-list.js +1 -0
  101. package/dist/workspace/sidebar/session-filter-menu.js +1 -0
  102. package/dist/workspace/sidebar/session-grouping.d.ts +4 -0
  103. package/dist/workspace/sidebar/session-grouping.js +2 -0
  104. package/dist/workspace/sidebar/session-source-icons.js +2 -0
  105. package/dist/workspace/space/space-page.js +2 -2
  106. package/package.json +9 -9
  107. package/skills/kortix-ui/SKILL.md +2 -2
  108. package/skills/kortix-ui/references/custom-dashboard.md +1 -1
  109. package/dist/customize/agents/agent-section-rail.d.ts +0 -21
  110. package/dist/customize/agents/agent-section-rail.js +0 -23
  111. package/dist/internal/hooks/projects/use-warm-project-session.d.ts +0 -270
  112. package/dist/internal/hooks/projects/use-warm-project-session.js +0 -362
  113. package/dist/internal/hooks/projects/warm-session-seed.d.ts +0 -66
  114. package/dist/internal/hooks/projects/warm-session-seed.js +0 -80
  115. package/dist/internal/hooks/projects/warm-session-taken-registry.d.ts +0 -61
  116. package/dist/internal/hooks/projects/warm-session-taken-registry.js +0 -141
@@ -9,59 +9,13 @@ import { createScopedSession } from '../../../session/scope/create-scoped-sessio
9
9
  import { confirmCommitted, errorCode, getRequiredConnectorConnections, isAmbiguousCreateFailure, resolveCreateFailure, } from './new-session-failure.js';
10
10
  import { NEW_SESSION_GUARD_MAX_MS, hasLandedOnNewSession, useNewSessionGuardStore, } from './new-session-guard.js';
11
11
  import { useProjectCanRun } from './use-project-can-run.js';
12
- import { createWarmSession, primeTakenWarmSession, tabIsVisible, takeWarmSessionEntry, } from './use-warm-project-session.js';
13
- import { reconcileSessionsAfterCreate, seedAdoptedWarmSession, } from './warm-session-seed.js';
14
12
  import { useConnectorGateStore } from '../../stores/connector-gate-store.js';
15
13
  import { useUpgradeDialogStore } from '../../stores/upgrade-dialog-store.js';
16
14
  import { ApiError, createProjectSession, getProjectSession, getProjectSessionScope, markSessionFresh, setProjectSessionScope, platformConfig, } from '@kortix/sdk';
17
15
  import { prefetchSessionStart, qk, upsertCachedProjectSession } from '@kortix/sdk/react';
18
16
  import { randomUUID } from '../../lib/utils/random-uuid.js';
19
- function makeTakeOrCreateSession(projectId, opts, router, queryClient, onAdopt) {
20
- // Use the project's warm session when there is one that fits, else create
21
- // one exactly as before. The warm session already exists — it is an
22
- // ordinary session created a few seconds ago — so this is a synchronous,
23
- // network-free hand-off that skips the sandbox boot the user would
24
- // otherwise watch after pressing Enter. `takeWarmSessionEntry` returns
25
- // null whenever there is nothing suitable, so the create path below stays
26
- // the authority on billing and connector requirements.
27
- async function takeOrCreateSession() {
28
- // A space thread always creates: a warm session belongs to no space.
29
- const warm = opts.create?.space_id
30
- ? null
31
- : takeWarmSessionEntry(projectId, {
32
- create: opts?.create,
33
- // Replenish after /start, not beside the claim and /start requests.
34
- replenish: false,
35
- });
36
- if (warm) {
37
- // The first prompt is a DURABLE inbox row, never a client-side
38
- // replay (the start stash carries picks only — see the producers).
39
- // The ordinary path gets that row from `create.pending_prompt` in
40
- // the create transaction; an adopted warm session was created
41
- // seconds ago with an EMPTY body, so its prompt has to land now,
42
- // through the server's claim (`primeTakenWarmSession`): one
43
- // transaction that inserts the row, drops the warm marker, and kicks
44
- // the drain. Without this the local take navigated into a session
45
- // that had never heard the prompt — the "my first message
46
- // disappears" bug, on the warm path.
47
- //
48
- // A refused claim (another tab took it, marker already gone) is not
49
- // an error the user should see: fall through to the ordinary create,
50
- // which carries the same prompt.
51
- const pending = opts?.create?.pending_prompt;
52
- const primed = pending
53
- ? await primeTakenWarmSession(projectId, warm, {
54
- pending_prompt: pending,
55
- ...(opts?.create?.agent_name ? { agent_name: opts.create.agent_name } : {}),
56
- ...(opts?.create?.sandbox_slug ? { sandbox_slug: opts.create.sandbox_slug } : {}),
57
- })
58
- : true;
59
- if (primed) {
60
- onAdopt(warm.session);
61
- router.prefetch(uiRoutes().session(projectId, warm.sessionId));
62
- return warm.sessionId;
63
- }
64
- }
17
+ function makeCreateSession(projectId, opts, router, queryClient) {
18
+ return async function createSessionRow() {
65
19
  const sessionId = randomUUID();
66
20
  markSessionFresh(sessionId);
67
21
  opts.onCreating?.(sessionId);
@@ -92,8 +46,7 @@ function makeTakeOrCreateSession(projectId, opts, router, queryClient, onAdopt)
92
46
  upsertCachedProjectSession(queryClient, projectId, created);
93
47
  }
94
48
  return sessionId;
95
- }
96
- return takeOrCreateSession;
49
+ };
97
50
  }
98
51
  export function useNewProjectSession(projectId) {
99
52
  const t = useTranslations('threads');
@@ -183,15 +136,7 @@ export function useNewProjectSession(projectId) {
183
136
  return;
184
137
  }
185
138
  releaseTimerRef.current = setTimeout(release, NEW_SESSION_GUARD_MAX_MS);
186
- // The taken warm session's server row, so `onReady` below can seed the
187
- // sessions-list cache with it (JAY-599/T21). Set only when a warm
188
- // session was actually adopted THIS call — a closure local, not a ref,
189
- // so back-to-back activations of this same hook instance never leak one
190
- // call's row into another's `onReady`.
191
- let adoptedWarmSession = null;
192
- const takeOrCreateSession = makeTakeOrCreateSession(projectId, opts, router, queryClient, (session) => {
193
- adoptedWarmSession = session;
194
- });
139
+ const createSessionRow = makeCreateSession(projectId, opts, router, queryClient);
195
140
  // A space thread shows up in the timeline at once, so it gets no toast.
196
141
  const inSpace = Boolean(opts.create?.space_id);
197
142
  // `threads.*`, not `hardcodedUi.i18nComplete.*`. The two
@@ -202,8 +147,8 @@ export function useNewProjectSession(projectId) {
202
147
  // `threads.sessionStarted` are the canonical entries and are
203
148
  // correctly translated in all nine catalogs.
204
149
  const createSession = () => inSpace
205
- ? takeOrCreateSession()
206
- : loadingToast(t('startingSession'), takeOrCreateSession(), {
150
+ ? createSessionRow()
151
+ : loadingToast(t('startingSession'), createSessionRow(), {
207
152
  success: t('sessionStarted'),
208
153
  });
209
154
  createScopedSession({
@@ -216,49 +161,19 @@ export function useNewProjectSession(projectId) {
216
161
  // Keep the claim engaged through the navigation: the effect above
217
162
  // releases it once the browser is actually showing this session.
218
163
  useNewSessionGuardStore.getState().target(projectId, sessionId);
219
- // Adoption: this only ever runs once create (+ any scope
220
- // replacement) has already SUCCEEDED, so a warm session that got
221
- // taken but never made it this far (a scope-replacement failure,
222
- // say) never seeds a phantom row here — see warm-session-seed.ts.
223
- if (adoptedWarmSession) {
224
- // Every cached shape, not just the flat key. The sidebar caches
225
- // PAGES now (`useProjectSessions`), so a write aimed at the flat
226
- // list left a brand-new session invisible there until the next
227
- // refetch — the one surface the user is watching when they start
228
- // one. `seedAdoptedWarmSession` still owns what an adopted row
229
- // looks like; the cache write is the only part that moved.
230
- const [adopted] = seedAdoptedWarmSession(undefined, adoptedWarmSession, new Date().toISOString());
231
- if (adopted)
232
- upsertCachedProjectSession(queryClient, projectId, adopted);
233
- }
234
164
  // The row exists — kick provisioning so it overlaps the navigation.
235
- // For an adopted warm session this is also the call that drops the
236
- // server's `metadata.warm` marker (apps/api/.../routes/session-runtime.ts).
237
- const started = prefetchSessionStart(queryClient, projectId, sessionId);
238
- if (adoptedWarmSession) {
239
- const replenish = () => {
240
- if (!tabIsVisible())
241
- return;
242
- void createWarmSession(projectId, undefined, { excludeSessionId: sessionId });
243
- };
244
- void started.then(replenish, replenish);
245
- }
246
- // Warm adoption defers the list reconcile until that /start settles,
247
- // so the refetch cannot observe the row still marker-hidden and wipe
248
- // the seed above — see reconcileSessionsAfterCreate.
249
- reconcileSessionsAfterCreate({
250
- adoptedWarm: adoptedWarmSession !== null,
251
- started,
252
- invalidate: () => queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) }),
253
- });
165
+ void prefetchSessionStart(queryClient, projectId, sessionId);
166
+ // The row is visible server-side the moment the create returns, so
167
+ // reconcile the cached lists now.
168
+ void queryClient.invalidateQueries({ queryKey: qk.project.sessionsScope(projectId) });
254
169
  opts?.onNavigate?.(sessionId);
255
170
  // The space view stays on screen, so no navigation lands to release the claim.
256
171
  if (inSpace) {
257
172
  release();
258
173
  return;
259
174
  }
260
- // nav-contract: prefetch-only — the session id is minted or returned
261
- // by the create POST, so no anchor can name it. `takeOrCreateSession`
175
+ // nav-contract: prefetch-only — the session id is minted client-side
176
+ // at the click, so no anchor can name it. `createSessionRow`
262
177
  // prefetches the route the moment the id exists.
263
178
  router.push(uiRoutes().session(projectId, sessionId));
264
179
  },
@@ -3,14 +3,15 @@
3
3
  * The strict `notification_center` gate controls session mute/watch actions.
4
4
  * Inbox surfaces also work when artifacts and artifact_comments are both on.
5
5
  *
6
- * - With a project id: `useFeatureFlag`, fail-closed, on the shared
7
- * `qk.project.detail(id)` entry that the project shell reads.
6
+ * - With a project id: `useFeatureFlag`, fail-closed, on the shared bare
7
+ * project row (`qk.project.summary(id)`) that the project shell reads.
8
8
  * - Without one (`/projects`, `/new`, standalone `/settings`): on when any
9
9
  * project already in this client's query cache has the flag on. The scan
10
- * reads the cached project details and project lists. It sends no request,
10
+ * reads the cached project rows, project details and project lists. It sends no request,
11
11
  * so a cold load of such a page with nothing cached reads off.
12
12
  * - `NotificationHost` uses `useNotificationHostGate`: while a project's
13
- * detail loads, a cached project list or its previous answer decides.
13
+ * row loads, a cached detail, a cached project list or its previous answer
14
+ * decides.
14
15
  */
15
16
  import type { KortixProject } from '@kortix/sdk';
16
17
  import { type QueryClient } from '@tanstack/react-query';
@@ -22,8 +23,9 @@ type FlagHolder = {
22
23
  export declare function notificationCenterOn(project: FlagHolder): boolean;
23
24
  export declare function notificationInboxOn(project: FlagHolder): boolean;
24
25
  /**
25
- * The flag for one project from the query cache: its detail, else a cached
26
- * project list that holds it. Undefined when neither holds it. Sends no request.
26
+ * The flag for one project from the query cache: its row, else its detail,
27
+ * else a cached project list that holds it. Undefined when none holds it.
28
+ * Sends no request.
27
29
  */
28
30
  export declare function cachedNotificationCenterAnswer(client: QueryClient | null, projectId: string | null | undefined): boolean | undefined;
29
31
  export declare function cachedNotificationInboxAnswer(client: QueryClient | null, projectId: string | null | undefined): boolean | undefined;
@@ -37,11 +39,12 @@ export declare function useNotificationCenter(projectId?: string | null): boolea
37
39
  export declare function useNotificationInboxEnabled(projectId?: string | null): boolean;
38
40
  /**
39
41
  * The inbox gate of `NotificationHost`, except while the
40
- * project's detail loads. Then a cached project list answers, else the
42
+ * project's row loads. Then a cached detail or project list answers, else the
41
43
  * previous answer stays. So entering a flag-on project from `/projects` or
42
44
  * from another flag-on project does not unmount the host and subscribe Web
43
45
  * Push again. Only a loaded detail without the flag turns it off. A cold
44
- * load of a project page starts off.
46
+ * load of a project page starts off. Only a loaded row (or, before it, a
47
+ * loaded detail) without the flag turns it off.
45
48
  */
46
49
  export declare function useNotificationHostGate(projectId?: string | null): boolean;
47
50
  export {};
@@ -11,8 +11,9 @@ export function notificationInboxOn(project) {
11
11
  return notificationCenterOn(project) || (project?.experimental?.artifacts === true && project.experimental.artifact_comments === true);
12
12
  }
13
13
  /**
14
- * The flag for one project from the query cache: its detail, else a cached
15
- * project list that holds it. Undefined when neither holds it. Sends no request.
14
+ * The flag for one project from the query cache: its row, else its detail,
15
+ * else a cached project list that holds it. Undefined when none holds it.
16
+ * Sends no request.
16
17
  */
17
18
  export function cachedNotificationCenterAnswer(client, projectId) {
18
19
  return cachedFlagAnswer(client, projectId, notificationCenterOn);
@@ -20,6 +21,9 @@ export function cachedNotificationCenterAnswer(client, projectId) {
20
21
  function cachedFlagAnswer(client, projectId, enabled) {
21
22
  if (!client || !projectId)
22
23
  return undefined;
24
+ const row = client.getQueryData(qk.project.summary(projectId));
25
+ if (row)
26
+ return enabled(row);
23
27
  const detail = client.getQueryData(qk.project.detail(projectId));
24
28
  if (detail?.project)
25
29
  return enabled(detail.project);
@@ -41,7 +45,8 @@ export function cachedNotificationCenter(client, projectId) {
41
45
  }
42
46
  const [ROOT, LIST_SCOPE] = qk.projects.scope();
43
47
  const [, DETAIL_SCOPE, , DETAIL] = qk.project.detail('');
44
- /** A project-list entry or a project-detail entry that holds a project with the flag on. */
48
+ const [, , , SUMMARY] = qk.project.summary('');
49
+ /** A project-list, project-row or project-detail entry that holds a project with the flag on. */
45
50
  function holdsFlagOn(query, enabled) {
46
51
  const key = query.queryKey;
47
52
  const data = query.state.data;
@@ -52,6 +57,8 @@ function holdsFlagOn(query, enabled) {
52
57
  if (key[1] === DETAIL_SCOPE && key.length === 4 && key[3] === DETAIL) {
53
58
  return enabled(data?.project);
54
59
  }
60
+ if (key[1] === DETAIL_SCOPE && key.length === 4 && key[3] === SUMMARY)
61
+ return enabled(data);
55
62
  return false;
56
63
  }
57
64
  /** True when any project in the query cache has the flag on. */
@@ -106,23 +113,28 @@ export function useNotificationInboxEnabled(projectId) {
106
113
  }
107
114
  /**
108
115
  * The inbox gate of `NotificationHost`, except while the
109
- * project's detail loads. Then a cached project list answers, else the
116
+ * project's row loads. Then a cached detail or project list answers, else the
110
117
  * previous answer stays. So entering a flag-on project from `/projects` or
111
118
  * from another flag-on project does not unmount the host and subscribe Web
112
119
  * Push again. Only a loaded detail without the flag turns it off. A cold
113
- * load of a project page starts off.
120
+ * load of a project page starts off. Only a loaded row (or, before it, a
121
+ * loaded detail) without the flag turns it off.
114
122
  */
115
123
  export function useNotificationHostGate(projectId) {
116
124
  const client = useQueryClient();
117
- // The global host sits outside the access boundary. Read the shell's detail
118
- // entry from the cache: no request for a potentially revoked project, and no
125
+ // The global host sits outside the access boundary. Read the shell's project
126
+ // row from the cache (the detail when no row is cached): no request for a potentially revoked project, and no
119
127
  // observer. An observer added a detail query without a queryFn (also for the
120
128
  // empty id of a page outside any project), and every refetch of it logged
121
129
  // "No queryFn was passed".
122
- const detail = useSyncExternalStore(useCacheSubscription(client, !!projectId), () => (projectId ? client.getQueryState(qk.project.detail(projectId)) : undefined), () => undefined);
130
+ const subscribe = useCacheSubscription(client, !!projectId);
131
+ const row = useSyncExternalStore(subscribe, () => (projectId ? client.getQueryState(qk.project.summary(projectId)) : undefined), () => undefined);
132
+ const detail = useSyncExternalStore(subscribe, () => (projectId ? client.getQueryState(qk.project.detail(projectId)) : undefined), () => undefined);
133
+ const rowLoaded = !!row && row.status !== 'pending';
134
+ const detailLoaded = !!detail && detail.status !== 'pending';
123
135
  const flag = {
124
- isLoading: !detail || detail.status === 'pending',
125
- enabled: notificationInboxOn(detail?.data?.project),
136
+ isLoading: !rowLoaded && !detailLoaded,
137
+ enabled: notificationInboxOn(rowLoaded ? row?.data : detail?.data?.project),
126
138
  };
127
139
  const anyProject = useAnyCachedNotificationInbox(client, !projectId);
128
140
  const [previous, setPrevious] = useState(false);
@@ -0,0 +1,9 @@
1
+ /** @internal Kortix apps only. No semver: it may change in any release. */
2
+ /** Discord's blurple (discord.com brand guidelines). */
3
+ export declare const DISCORD_BLURPLE = "#5865F2";
4
+ /** The Discord logo's Clyde glyph in a 24 × 24 box (Simple Icons, CC0). */
5
+ export declare const DISCORD_PATH = "M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z";
6
+ /** The Discord mark: Clyde in blurple. */
7
+ export declare const Discord: ({ className }: {
8
+ className?: string;
9
+ }) => import("react").JSX.Element;
@@ -0,0 +1,9 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { cn } from '../lib/utils.js';
4
+ /** Discord's blurple (discord.com brand guidelines). */
5
+ export const DISCORD_BLURPLE = '#5865F2';
6
+ /** The Discord logo's Clyde glyph in a 24 × 24 box (Simple Icons, CC0). */
7
+ export const DISCORD_PATH = 'M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z';
8
+ /** The Discord mark: Clyde in blurple. */
9
+ export const Discord = ({ className }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", className: cn('size-4', className), "aria-hidden": "true", children: _jsx("path", { fill: DISCORD_BLURPLE, d: DISCORD_PATH }) }));
@@ -61,7 +61,7 @@ export function ConnectMcpModal({ open, onOpenChange, }) {
61
61
  return (_jsx(Modal, { open: open, onOpenChange: onOpenChange, children: _jsx(ModalContent, { className: "space-y-0 lg:max-w-3xl", closeClassName: "max-sm:bg-background border-0 overflow-hidden", children: _jsxs("div", { className: "grid sm:grid-cols-5 lg:min-h-128", children: [_jsxs("div", { "aria-hidden": "true", className: "dark bg-background relative isolate flex h-48 items-center justify-center overflow-hidden rounded-t-xl border-b sm:col-span-2 sm:h-auto sm:rounded-tr-none sm:border-r sm:border-b-0 lg:rounded-bl-xl", children: [_jsx(BeamsShader, {}), _jsx("div", { className: "relative grid grid-cols-4 gap-2.5 sm:grid-cols-2", children: ART_CLIENTS.map(({ id, Logo }) => (
62
62
  // `bg-foreground` is white under the art's `dark` scope: the marks carry their
63
63
  // own brand colors (Codex brings its own white tile).
64
- _jsx("span", { className: "bg-foreground flex size-16 items-center justify-center rounded-xl shadow-lg", children: _jsx(Logo, { className: "size-8" }) }, id))) })] }), _jsxs("div", { className: "flex min-w-0 flex-col gap-5 p-5 sm:col-span-3 lg:p-8", children: [_jsxs("header", { className: "space-y-1.5 pr-10", children: [_jsx(ModalTitle, { className: "text-lg font-medium text-balance", children: t('title') }), _jsx(ModalDescription, { className: "text-pretty", children: t('description') })] }), _jsxs("div", { className: "bg-muted flex min-w-0 items-center gap-3 rounded-md border p-3", children: [_jsx("code", { className: "min-w-0 flex-1 text-xs break-all select-text", children: url }), _jsx(ClientAction, { client: CLIENTS[0], url: url })] }), _jsx("ul", { className: "divide-border divide-y", children: CLIENTS.map((client) => (_jsxs("li", { className: "flex items-center gap-3 py-2.5", children: [_jsx("span", { className: "bg-muted flex size-9 shrink-0 items-center justify-center rounded-sm", children: _jsx(client.Logo, { className: "size-5" }) }), _jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [_jsx("p", { className: "text-sm font-medium", children: client.name ?? t('anyClient') }), _jsx("p", { className: "text-muted-foreground truncate text-xs", children: t(`via.${client.id}`) })] }), _jsx(ClientAction, { client: client, url: url })] }, client.id))) }), _jsxs("footer", { className: "mt-auto flex items-center justify-between pt-2", children: [_jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "text-muted-foreground gap-1", children: _jsxs(Link, { href: "/docs/connect/mcp", target: "_blank", children: [t('docs'), _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0" })] }) }), _jsx(Button, { type: "button", onClick: () => onOpenChange(false), children: t('done') })] })] })] }) }) }));
64
+ _jsx("span", { className: "bg-foreground flex size-16 items-center justify-center rounded-xl shadow-lg", children: _jsx(Logo, { className: "size-8" }) }, id))) })] }), _jsxs("div", { className: "flex min-w-0 flex-col gap-5 p-5 sm:col-span-3 lg:p-8", children: [_jsxs("header", { className: "space-y-1.5 pr-10", children: [_jsx(ModalTitle, { className: "text-lg font-medium text-balance", children: t('title') }), _jsx(ModalDescription, { className: "text-pretty", children: t('description') })] }), _jsxs("div", { className: "bg-muted flex min-w-0 items-center gap-3 rounded-md border p-3", children: [_jsx("code", { className: "min-w-0 flex-1 text-xs break-all select-text", children: url }), _jsx(ClientAction, { client: CLIENTS[0], url: url })] }), _jsx("ul", { className: "divide-border divide-y", children: CLIENTS.map((client) => (_jsxs("li", { className: "flex items-center gap-3 py-2.5", children: [_jsx("span", { className: "bg-muted flex size-9 shrink-0 items-center justify-center rounded-sm", children: _jsx(client.Logo, { className: "size-5" }) }), _jsxs("div", { className: "min-w-0 flex-1 space-y-0.5", children: [_jsx("p", { className: "text-sm font-medium", children: client.name ?? t('anyClient') }), _jsx("p", { className: "text-muted-foreground truncate text-xs", children: t(`via.${client.id}`) })] }), _jsx(ClientAction, { client: client, url: url })] }, client.id))) }), _jsxs("footer", { className: "mt-auto flex items-center justify-between pt-2", children: [_jsx(Button, { asChild: true, variant: "ghost", size: "sm", className: "text-muted-foreground gap-1", children: _jsxs(Link, { href: "/docs/guide#other-ai-tools-mcp", target: "_blank", children: [t('docs'), _jsx(ArrowUpRightIcon, { className: "size-3.5 shrink-0" })] }) }), _jsx(Button, { type: "button", onClick: () => onOpenChange(false), children: t('done') })] })] })] }) }) }));
65
65
  }
66
66
  // The secondary fill sits close to the row; a ring on hover marks the target.
67
67
  const ACTION_CLASS = 'hover:border-ring hover:border hover:ring-ring/15 hover:ring-2 hit-area-y-3 hit-area-l-3 shrink-0 border border-transparent';
@@ -165,7 +165,7 @@ const MODEL_NOT_SERVABLE_NOISE_PATTERNS = [
165
165
  //
166
166
  // This is the frontend mirror of the API's request-deadline 503
167
167
  // (`apps/api/src/middleware/request-deadline.ts`, de-noised from Sentry by
168
- // https://github.com/kortix-ai/suna/pull/4524). The API bounds every
168
+ // https://github.com/kortix-ai/CompanyOS/pull/4524). The API bounds every
169
169
  // non-streaming request to a 25s server deadline that returns a clean 503 +
170
170
  // `Retry-After: 10`, and react-query retries background polls (the session-audit
171
171
  // route that produced Better Stack pattern `b1db01e5…` is polled every 5–15s
@@ -135,7 +135,7 @@ export const handleApiError = (error, context, tI18nComplete) => {
135
135
  // deadline — packages/sdk/src/core/http/api-client.ts) is intentionally NOT
136
136
  // captured here. It is the frontend mirror of the API's request-deadline 503
137
137
  // (apps/api/src/middleware/request-deadline.ts, de-noised from Sentry by
138
- // https://github.com/kortix-ai/suna/pull/4524): the API has a 25s server
138
+ // https://github.com/kortix-ai/CompanyOS/pull/4524): the API has a 25s server
139
139
  // deadline that returns a clean 503 + Retry-After, and react-query retries
140
140
  // background polls, so a 30s client abort is an EXPECTED, retryable
141
141
  // degradation under momentary API saturation — not an actionable bug. The
@@ -23,7 +23,6 @@ import { useFeatureFlag } from '@kortix/sdk/react';
23
23
  export function useProjectFeatureFlags(projectId) {
24
24
  const marketplace = useFeatureFlag(projectId, 'marketplace');
25
25
  const reminders = useFeatureFlag(projectId, 'reminders');
26
- const warmSessions = useFeatureFlag(projectId, 'warm_sessions');
27
26
  const secretsEgress = useFeatureFlag(projectId, 'secrets_egress');
28
27
  const pooledProviderSecrets = useFeatureFlag(projectId, 'pooled_provider_secrets');
29
28
  const usRegion = useFeatureFlag(projectId, 'us_region');
@@ -35,6 +34,7 @@ export function useProjectFeatureFlags(projectId) {
35
34
  const sessionLogRestore = useFeatureFlag(projectId, 'session_log_restore');
36
35
  const projectChannels = useFeatureFlag(projectId, 'project_channels');
37
36
  const agentRooms = useFeatureFlag(projectId, 'agent_rooms');
37
+ const sharedDrives = useFeatureFlag(projectId, 'shared_drives');
38
38
  const goals = useFeatureFlag(projectId, 'goals');
39
39
  const artifacts = useFeatureFlag(projectId, 'artifacts');
40
40
  const artifactComments = useFeatureFlag(projectId, 'artifact_comments');
@@ -43,11 +43,11 @@ export function useProjectFeatureFlags(projectId) {
43
43
  const sessionGroups = useFeatureFlag(projectId, 'session_groups');
44
44
  const chrome = useFeatureFlag(projectId, 'chrome');
45
45
  const agentTeams = useFeatureFlag(projectId, 'agent_teams');
46
+ const voiceCall = useFeatureFlag(projectId, 'voice_call');
46
47
  return {
47
48
  flags: {
48
49
  marketplace: marketplace.enabled,
49
50
  reminders: reminders.enabled,
50
- warm_sessions: warmSessions.enabled,
51
51
  secrets_egress: secretsEgress.enabled,
52
52
  pooled_provider_secrets: pooledProviderSecrets.enabled,
53
53
  us_region: usRegion.enabled,
@@ -59,6 +59,7 @@ export function useProjectFeatureFlags(projectId) {
59
59
  session_log_restore: sessionLogRestore.enabled,
60
60
  project_channels: projectChannels.enabled,
61
61
  agent_rooms: agentRooms.enabled,
62
+ shared_drives: sharedDrives.enabled,
62
63
  goals: goals.enabled,
63
64
  artifacts: artifacts.enabled,
64
65
  artifact_comments: artifactComments.enabled,
@@ -67,8 +68,9 @@ export function useProjectFeatureFlags(projectId) {
67
68
  session_groups: sessionGroups.enabled,
68
69
  chrome: chrome.enabled,
69
70
  agent_teams: agentTeams.enabled,
71
+ voice_call: voiceCall.enabled,
70
72
  },
71
73
  // The trailing hook's loading state — keep this on the LAST hook above.
72
- isLoading: agentTeams.isLoading,
74
+ isLoading: voiceCall.isLoading,
73
75
  };
74
76
  }
@@ -10,9 +10,6 @@ export interface ParsedMarkdown {
10
10
  frontmatter: Record<string, FrontmatterValue> | null;
11
11
  body: string;
12
12
  }
13
- /** Extract a leading `---\n…\n---` frontmatter block. Returns the parsed
14
- * object plus the markdown body. If no block is found, returns the original
15
- * content untouched. */
16
13
  export declare function parseFrontmatter(content: string): ParsedMarkdown;
17
14
  /**
18
15
  * Render markdown content; if a leading YAML frontmatter block is present, it
@@ -9,6 +9,47 @@ import { UnifiedMarkdown } from './unified-markdown.js';
9
9
  /** Extract a leading `---\n…\n---` frontmatter block. Returns the parsed
10
10
  * object plus the markdown body. If no block is found, returns the original
11
11
  * content untouched. */
12
+ /**
13
+ * `key: value` with a bare `[\w.-]` key at column 0, split at the first colon.
14
+ * String scanning, not a `\s*:\s*(.*)` regex: that one backtracked
15
+ * quadratically on a long run of spaces (CodeQL js/polynomial-redos).
16
+ */
17
+ function topEntry(line) {
18
+ const colon = line.indexOf(':');
19
+ if (colon <= 0)
20
+ return null;
21
+ const key = line.slice(0, colon).trimEnd();
22
+ return /^[\w.-]+$/.test(key) ? [key, line.slice(colon + 1)] : null;
23
+ }
24
+ /** An indented `key: value`; the key may be quoted (`"*": allow`) or bare: word characters, `.`, `*`, `/` and `-`. */
25
+ function nestedEntry(line) {
26
+ const rest = line.trimStart();
27
+ if (rest.length === line.length)
28
+ return null;
29
+ const quote = rest[0];
30
+ let key;
31
+ let after;
32
+ if (quote === '"' || quote === "'") {
33
+ const close = rest.indexOf(quote, 1);
34
+ if (close <= 1)
35
+ return null;
36
+ key = rest.slice(1, close);
37
+ after = rest.slice(close + 1).trimStart();
38
+ if (!after.startsWith(':'))
39
+ return null;
40
+ after = after.slice(1);
41
+ }
42
+ else {
43
+ const colon = rest.indexOf(':');
44
+ if (colon <= 0)
45
+ return null;
46
+ key = rest.slice(0, colon).trimEnd();
47
+ if (!/^[\w.*/-]+$/.test(key))
48
+ return null;
49
+ after = rest.slice(colon + 1);
50
+ }
51
+ return [key, after];
52
+ }
12
53
  export function parseFrontmatter(content) {
13
54
  const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);
14
55
  if (!match)
@@ -27,15 +68,14 @@ export function parseFrontmatter(content) {
27
68
  // usually is — `"*": allow`. Matching only [\w.-] dropped that line, left
28
69
  // the parent an empty object, and printed a bare em-dash where the
29
70
  // permissions belong. Wildcards and path-ish keys are accepted bare too.
30
- const nested = line.match(/^\s+(?:"([^"]+)"|'([^']+)'|([\w.*/-]+))\s*:\s*(.*)$/);
71
+ const nested = nestedEntry(line);
31
72
  if (nested && currentParent && typeof result[currentParent] === 'object') {
32
- const key = nested[1] ?? nested[2] ?? nested[3];
33
- result[currentParent][key] = nested[4].trim();
73
+ result[currentParent][nested[0]] = nested[1].trim();
34
74
  continue;
35
75
  }
36
- const top = line.match(/^([\w.-]+)\s*:\s*(.*)$/);
76
+ const top = topEntry(line);
37
77
  if (top) {
38
- const [, key, value] = top;
78
+ const [key, value] = top;
39
79
  const trimmed = value.trim();
40
80
  if (!trimmed) {
41
81
  result[key] = {};
@@ -27,13 +27,7 @@ export declare const LIVE_SESSION_STATUSES: ProjectSessionStatus[];
27
27
  */
28
28
  export declare function groupChangeRequestsBySession(changeRequests: readonly ChangeRequest[], sessions: readonly ProjectSession[]): Map<string, ChangeRequest[]>;
29
29
  /** Whether the session list should keep polling — true while any session is
30
- * still mid-provisioning (queued/branching/provisioning).
31
- *
32
- * A warm row (pre-created, never prompted) is skipped: the API reports its
33
- * idle, billed shell as `provisioning` for as long as the box lives
34
- * (KRTX-1466), and polling that static status 5s-fast for up to the warm
35
- * grant would buy nothing — the next real change is the marker drop at the
36
- * first accepted turn, which the open-session interval covers. */
30
+ * still mid-provisioning (queued/branching/provisioning). */
37
31
  export declare function shouldPollProjectSessions(sessions: ProjectSession[] | undefined): boolean;
38
32
  /**
39
33
  * How often the sidebar refetches the session list, or false for not at all.
@@ -99,13 +93,9 @@ export declare function sessionTitleHasLanded(session: ProjectSession): boolean;
99
93
  * be proven young, and guessing wrong in that direction is the unbounded poll
100
94
  * this window exists to prevent.
101
95
  *
102
- * The window opens from the LATER of creation and last activity. An adopted
103
- * warm session was created when the user landed on the project home —
104
- * possibly long before the send — but its title generation starts at the
105
- * first prompt, i.e. at adoption, which stamps `metadata.last_activity_at`
106
- * (apps/api/src/projects/routes/warm-sessions.ts). Windowing on `created_at`
107
- * alone skipped the fast poll for exactly the sessions the home send
108
- * produces.
96
+ * The window opens from the LATER of creation and last activity: a session
97
+ * created empty gets its title from its first prompt, which stamps
98
+ * `metadata.last_activity_at` and can come long after the create.
109
99
  */
110
100
  export declare function isAwaitingTitle(session: ProjectSession, now: number): boolean;
111
101
  /** Is any session in the list still waiting for its title? */
@@ -66,16 +66,9 @@ export function groupChangeRequestsBySession(changeRequests, sessions) {
66
66
  return grouped;
67
67
  }
68
68
  /** Whether the session list should keep polling — true while any session is
69
- * still mid-provisioning (queued/branching/provisioning).
70
- *
71
- * A warm row (pre-created, never prompted) is skipped: the API reports its
72
- * idle, billed shell as `provisioning` for as long as the box lives
73
- * (KRTX-1466), and polling that static status 5s-fast for up to the warm
74
- * grant would buy nothing — the next real change is the marker drop at the
75
- * first accepted turn, which the open-session interval covers. */
69
+ * still mid-provisioning (queued/branching/provisioning). */
76
70
  export function shouldPollProjectSessions(sessions) {
77
- return (sessions ?? []).some((session) => LIVE_SESSION_STATUSES.includes(session.status) &&
78
- session.metadata?.warm !== true);
71
+ return (sessions ?? []).some((session) => LIVE_SESSION_STATUSES.includes(session.status));
79
72
  }
80
73
  /** Fast poll: a provisioning session changes status within seconds. */
81
74
  const PROVISIONING_POLL_MS = 5_000;
@@ -250,13 +243,9 @@ const TITLE_WAIT_WINDOW_MS = 2 * 60_000;
250
243
  * be proven young, and guessing wrong in that direction is the unbounded poll
251
244
  * this window exists to prevent.
252
245
  *
253
- * The window opens from the LATER of creation and last activity. An adopted
254
- * warm session was created when the user landed on the project home —
255
- * possibly long before the send — but its title generation starts at the
256
- * first prompt, i.e. at adoption, which stamps `metadata.last_activity_at`
257
- * (apps/api/src/projects/routes/warm-sessions.ts). Windowing on `created_at`
258
- * alone skipped the fast poll for exactly the sessions the home send
259
- * produces.
246
+ * The window opens from the LATER of creation and last activity: a session
247
+ * created empty gets its title from its first prompt, which stamps
248
+ * `metadata.last_activity_at` and can come long after the create.
260
249
  */
261
250
  export function isAwaitingTitle(session, now) {
262
251
  if (sessionTitleHasLanded(session))
@@ -14,12 +14,12 @@ import { isLegacyMigratedSession, type ProjectSession, type SessionListStatus }
14
14
  /**
15
15
  * Where a session came from, derived from the creation metadata stamped by
16
16
  * the API: channel sessions carry `metadata.source` ('slack' | 'telegram' |
17
- * 'teams' | 'email'),
17
+ * 'teams' | 'email' | 'discord'),
18
18
  * trigger fires carry `metadata.trigger_source` ('cron' | 'webhook' | 'event' |
19
19
  * 'manual') + `trigger_type`/`trigger_slug`. Everything else is a regular
20
20
  * chat the user started.
21
21
  */
22
- export type SessionSourceKind = 'chat' | 'slack' | 'telegram' | 'teams' | 'email' | 'schedule' | 'webhook' | 'event' | 'manual';
22
+ export type SessionSourceKind = 'chat' | 'slack' | 'telegram' | 'discord' | 'teams' | 'email' | 'schedule' | 'webhook' | 'event' | 'manual';
23
23
  export interface SessionSource {
24
24
  kind: SessionSourceKind;
25
25
  /** Human label, e.g. "Slack", "Scheduled". */
@@ -74,12 +74,8 @@ export { isLegacyMigratedSession };
74
74
  /**
75
75
  * Whether the row's lifecycle menu and the session header may offer Stop.
76
76
  *
77
- * `running` is the classic case. A warm shell (`metadata.warm`, pre-created
78
- * and never prompted) is reported `provisioning` for as long as its idle box
79
- * lives (KRTX-1466), but it still bills compute the owner can stop — the stop
80
- * route reads the sandbox row, not this word — so it keeps its Stop control.
81
- * A genuinely booting session (no warm marker) does not: its box is not up
82
- * yet, and stopping one answers 409 "Session is not running".
77
+ * Only a `running` session. A booting session's box is not up yet, and
78
+ * stopping one answers 409 "Session is not running".
83
79
  */
84
80
  export declare function sessionCanBeStopped(session: ProjectSession): boolean;
85
81
  /**
@@ -92,7 +88,7 @@ export declare function sessionDisplayStatus(session: ProjectSession, reviewCoun
92
88
  * how "All" is expressed, so there is no `'all'` sentinel member. A sentinel
93
89
  * alongside arrays would allow `['all', 'running']`, which has no meaning.
94
90
  */
95
- export type SessionSourceFilter = 'shared' | 'slack' | 'telegram' | 'teams' | 'email' | 'schedule' | 'webhook' | 'event' | 'manual';
91
+ export type SessionSourceFilter = 'shared' | 'slack' | 'telegram' | 'discord' | 'teams' | 'email' | 'schedule' | 'webhook' | 'event' | 'manual';
96
92
  export type SessionStatusFilter = 'running' | 'done' | 'stopped' | 'failed' | 'legacy';
97
93
  export declare const SESSION_SOURCE_FILTERS: Array<{
98
94
  value: SessionSourceFilter;
@@ -21,6 +21,8 @@ export function sessionSource(session, tI18nComplete) {
21
21
  return { kind: 'slack', label: tI18nComplete.raw('textb27fb38ba323'), triggerSlug: null };
22
22
  if (source === 'telegram')
23
23
  return { kind: 'telegram', label: tI18nComplete.raw('textacdd1e734125'), triggerSlug: null };
24
+ if (source === 'discord')
25
+ return { kind: 'discord', label: tI18nComplete.raw('text053bc65874ad'), triggerSlug: null };
24
26
  if (source === 'teams')
25
27
  return { kind: 'teams', label: tI18nComplete.raw('texta7b52b269a23'), triggerSlug: null };
26
28
  if (source === 'email')
@@ -88,18 +90,11 @@ export { isLegacyMigratedSession };
88
90
  /**
89
91
  * Whether the row's lifecycle menu and the session header may offer Stop.
90
92
  *
91
- * `running` is the classic case. A warm shell (`metadata.warm`, pre-created
92
- * and never prompted) is reported `provisioning` for as long as its idle box
93
- * lives (KRTX-1466), but it still bills compute the owner can stop — the stop
94
- * route reads the sandbox row, not this word — so it keeps its Stop control.
95
- * A genuinely booting session (no warm marker) does not: its box is not up
96
- * yet, and stopping one answers 409 "Session is not running".
93
+ * Only a `running` session. A booting session's box is not up yet, and
94
+ * stopping one answers 409 "Session is not running".
97
95
  */
98
96
  export function sessionCanBeStopped(session) {
99
- if (session.status === 'running')
100
- return true;
101
- return (session.status === 'provisioning' &&
102
- (session.metadata ?? {}).warm === true);
97
+ return session.status === 'running';
103
98
  }
104
99
  /**
105
100
  * Resolve a session to its display status. A pending review wins outright; a
@@ -112,6 +107,7 @@ export const SESSION_SOURCE_FILTERS = [
112
107
  { value: 'shared', label: 'Shared' },
113
108
  { value: 'slack', label: 'Slack' },
114
109
  { value: 'telegram', label: 'Telegram' },
110
+ { value: 'discord', label: 'Discord' },
115
111
  { value: 'teams', label: 'Teams' },
116
112
  { value: 'email', label: 'Email' },
117
113
  { value: 'schedule', label: 'Scheduled' },