@kortix/ui 0.15.0 → 0.15.1

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 (173) 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 -0
  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-session.js +4 -3
  11. package/dist/customize/agents/agent-page.js +5 -5
  12. package/dist/customize/agents/agent-status.js +1 -1
  13. package/dist/customize/agents/agents-page.js +3 -3
  14. package/dist/customize/connectors/use-agent-access.d.ts +3 -3
  15. package/dist/customize/sections/connectors-view.js +50 -37
  16. package/dist/customize/sections/llm-provider/chatgpt-subscription-connect.js +21 -18
  17. package/dist/customize/sections/llm-provider/device-grant.d.ts +15 -0
  18. package/dist/customize/sections/llm-provider/device-grant.js +27 -0
  19. package/dist/customize/sections/view/agent-editor.d.ts +2 -2
  20. package/dist/customize/sections/view/agent-editor.js +2 -2
  21. package/dist/customize/sections/view/review-center-connected.js +37 -6
  22. package/dist/customize/sections/view/secret-delivery.d.ts +4 -5
  23. package/dist/customize/sections/view/secret-delivery.js +5 -4
  24. package/dist/customize/triggers/schedule/trigger-runs-logic.d.ts +6 -0
  25. package/dist/customize/triggers/schedule/trigger-runs-logic.js +13 -0
  26. package/dist/customize/triggers/schedule/trigger-runs-panel.js +9 -2
  27. package/dist/files/project/api/runtime-files.d.ts +2 -2
  28. package/dist/files/project/api/runtime-files.js +2 -2
  29. package/dist/files/project/components/drive-explorer.js +1 -1
  30. package/dist/files/project/components/drive-grid-view.js +0 -1
  31. package/dist/files/project/components/drive-list-view.js +0 -1
  32. package/dist/files/project/components/file-explorer-page.js +1 -1
  33. package/dist/files/project/hooks/index.d.ts +1 -1
  34. package/dist/files/project/hooks/index.js +1 -1
  35. package/dist/files/project/hooks/use-server-health.d.ts +1 -1
  36. package/dist/files/project/hooks/use-server-health.js +1 -1
  37. package/dist/files/project/search/workspace-search-service.d.ts +1 -1
  38. package/dist/files/project/search/workspace-search-service.js +1 -1
  39. package/dist/files/runtime/hooks/index.d.ts +1 -1
  40. package/dist/files/runtime/hooks/index.js +1 -1
  41. package/dist/files/runtime/hooks/server-health-state.d.ts +2 -2
  42. package/dist/files/runtime/hooks/server-health-state.js +2 -2
  43. package/dist/files/runtime/hooks/system-dir.js +2 -2
  44. package/dist/files/runtime/hooks/use-file-content.d.ts +1 -1
  45. package/dist/files/runtime/hooks/use-file-content.js +1 -1
  46. package/dist/files/runtime/hooks/use-file-list.d.ts +1 -1
  47. package/dist/files/runtime/hooks/use-file-list.js +3 -3
  48. package/dist/files/runtime/hooks/use-server-health.d.ts +2 -2
  49. package/dist/files/runtime/hooks/use-server-health.js +3 -3
  50. package/dist/files/runtime/hooks/use-workspace-search.d.ts +1 -2
  51. package/dist/files/runtime/hooks/use-workspace-search.js +0 -1
  52. package/dist/files/runtime/index.d.ts +2 -2
  53. package/dist/files/runtime/index.js +2 -2
  54. package/dist/files/runtime/path-utils.d.ts +1 -1
  55. package/dist/files/runtime/path-utils.js +1 -1
  56. package/dist/files/runtime/sandbox-explorer-source.d.ts +1 -1
  57. package/dist/files/runtime/sandbox-explorer-source.js +1 -1
  58. package/dist/files/runtime/sandbox-file-explorer.d.ts +1 -1
  59. package/dist/files/runtime/sandbox-file-explorer.js +2 -2
  60. package/dist/files/tree/components/file-tree-item.js +0 -1
  61. package/dist/files/tree/hooks/use-file-events.d.ts +1 -1
  62. package/dist/files/tree/hooks/use-file-events.js +1 -1
  63. package/dist/i18n/en.d.ts +63 -1
  64. package/dist/i18n/en.js +79 -17
  65. package/dist/internal/files/file-read-retry.js +1 -1
  66. package/dist/internal/files/types.d.ts +2 -2
  67. package/dist/internal/files/types.js +2 -2
  68. package/dist/internal/goals/goal-meta.d.ts +33 -14
  69. package/dist/internal/goals/goal-meta.js +55 -13
  70. package/dist/internal/layout/nav-hover-card.d.ts +1 -1
  71. package/dist/internal/layout/nav-hover-card.js +1 -1
  72. package/dist/internal/layout/project-capability-nav.d.ts +1 -1
  73. package/dist/internal/layout/project-capability-nav.js +1 -1
  74. package/dist/internal/lib/browser-error-noise.d.ts +1 -1
  75. package/dist/internal/lib/browser-error-noise.js +1 -1
  76. package/dist/internal/lib/browser-noise/rules/expected-states.js +1 -1
  77. package/dist/internal/lib/browser-noise/rules/injected-scripts.js +18 -0
  78. package/dist/internal/lib/browser-noise/rules/old-browsers.d.ts +1 -0
  79. package/dist/internal/lib/browser-noise/rules/old-browsers.js +1 -1
  80. package/dist/internal/lib/browser-noise/rules/rejections.d.ts +0 -9
  81. package/dist/internal/lib/browser-noise/rules/rejections.js +0 -14
  82. package/dist/internal/lib/delivered-but-disconnected.js +3 -5
  83. package/dist/internal/lib/error-handler.js +8 -3
  84. package/dist/internal/lib/pixel-mark.d.ts +4 -17
  85. package/dist/internal/lib/pixel-mark.js +5 -148
  86. package/dist/internal/lib/sounds.d.ts +4 -4
  87. package/dist/internal/lib/sounds.js +4 -4
  88. package/dist/internal/lib/use-project-feature-flags.js +3 -1
  89. package/dist/internal/stores/composer-prefill-store.js +4 -1
  90. package/dist/internal/stores/sound-store.d.ts +4 -4
  91. package/dist/internal/stores/sound-store.js +10 -0
  92. package/dist/markdown/code/shiki-highlighter.js +14 -5
  93. package/dist/markdown/file-links.js +12 -3
  94. package/dist/markdown/markdown-frontmatter.d.ts +6 -6
  95. package/dist/markdown/markdown-frontmatter.js +3 -3
  96. package/dist/primitives/button.js +2 -1
  97. package/dist/session/agents/held-messages.d.ts +1 -5
  98. package/dist/session/agents/held-messages.js +1 -21
  99. package/dist/session/composer/ComposerAboveCard.d.ts +4 -1
  100. package/dist/session/composer/ComposerAboveCard.js +2 -2
  101. package/dist/session/composer/composer-chat-input.d.ts +1 -1
  102. package/dist/session/composer/composer-chat-input.js +2 -2
  103. package/dist/session/composer/composer.js +16 -1
  104. package/dist/session/composer/hooks/use-file-search.d.ts +15 -15
  105. package/dist/session/composer/hooks/use-file-search.js +16 -16
  106. package/dist/session/composer/menus/mention-controller.js +1 -3
  107. package/dist/session/composer/menus/space-mentions.d.ts +14 -4
  108. package/dist/session/composer/menus/space-mentions.js +17 -1
  109. package/dist/session/composer/use-instant-session-send.js +2 -2
  110. package/dist/session/header/session-goal-indicator.js +4 -4
  111. package/dist/session/panel/easy/plan-card.d.ts +2 -2
  112. package/dist/session/panel/easy/plan-card.js +2 -2
  113. package/dist/session/panel/session-desktop.js +6 -0
  114. package/dist/session/panel/use-session-panel-state.js +2 -2
  115. package/dist/session/status/sandbox-loading-boundary.js +2 -2
  116. package/dist/session/status/session-terminal-state.d.ts +47 -0
  117. package/dist/session/status/session-terminal-state.js +56 -0
  118. package/dist/session/thread/plan-surface.d.ts +1 -1
  119. package/dist/session/thread/plan-surface.js +1 -1
  120. package/dist/session/thread/session-chat.d.ts +1 -1
  121. package/dist/session/thread/session-chat.js +88 -99
  122. package/dist/session/thread/stop-sequence.d.ts +51 -0
  123. package/dist/session/thread/stop-sequence.js +55 -0
  124. package/dist/session/thread/transcript.d.ts +2 -2
  125. package/dist/session/thread/transcript.js +2 -2
  126. package/dist/session/tool/tools/apply-patch-tool.d.ts +1 -1
  127. package/dist/session/tool/tools/apply-patch-tool.js +1 -1
  128. package/dist/session/tool/tools/kortix-action-tool.js +1 -1
  129. package/dist/session/tool/tools/multi-agent-tool-bodies.d.ts +1 -1
  130. package/dist/session/tool/tools/multi-agent-tool-bodies.js +1 -1
  131. package/dist/session/tool/tools/multi-agent-tools.js +1 -1
  132. package/dist/session/tool/tools/pty-kill-tool.d.ts +1 -1
  133. package/dist/session/tool/tools/pty-kill-tool.js +1 -1
  134. package/dist/session/tool/tools/pty-read-tool.d.ts +2 -2
  135. package/dist/session/tool/tools/pty-read-tool.js +2 -2
  136. package/dist/session/tool/tools/pty-spawn-tool.d.ts +1 -1
  137. package/dist/session/tool/tools/pty-spawn-tool.js +1 -1
  138. package/dist/session/tool/tools/pty-write-tool.d.ts +1 -1
  139. package/dist/session/tool/tools/pty-write-tool.js +1 -1
  140. package/dist/session/tool/tools/todo-write-tool.d.ts +1 -1
  141. package/dist/session/tool/tools/todo-write-tool.js +1 -1
  142. package/dist/session/turn/peer-message-row.d.ts +1 -10
  143. package/dist/session/turn/peer-message-row.js +1 -18
  144. package/dist/session/turn/plan-anchor.d.ts +3 -3
  145. package/dist/session/turn/plan-anchor.js +3 -3
  146. package/dist/session/turn/plan-card.d.ts +7 -7
  147. package/dist/session/turn/plan-card.js +7 -7
  148. package/dist/styles.css +1 -1
  149. package/dist/terminal/terminal-card-gate.d.ts +6 -3
  150. package/dist/terminal/terminal-card-gate.js +21 -4
  151. package/dist/workspace/index.d.ts +1 -1
  152. package/dist/workspace/index.js +1 -1
  153. package/dist/workspace/review/review-center.d.ts +8 -2
  154. package/dist/workspace/review/review-center.js +44 -13
  155. package/dist/workspace/review/review-reducer.d.ts +7 -0
  156. package/dist/workspace/review/review-reducer.js +11 -0
  157. package/dist/workspace/sidebar/footer/project-artifacts-nav.d.ts +6 -1
  158. package/dist/workspace/sidebar/footer/project-artifacts-nav.js +47 -4
  159. package/dist/workspace/sidebar/project-nav-items.js +11 -12
  160. package/dist/workspace/spaces/principal-card.d.ts +3 -1
  161. package/dist/workspace/spaces/principal-card.js +3 -3
  162. package/dist/workspace/spaces/space-agent-ask.d.ts +14 -0
  163. package/dist/workspace/spaces/space-agent-ask.js +36 -0
  164. package/dist/workspace/spaces/space-details-dialog.js +1 -1
  165. package/dist/workspace/spaces/space-details-panel.d.ts +2 -1
  166. package/dist/workspace/spaces/space-details-panel.js +62 -8
  167. package/dist/workspace/spaces/space-mention-source.d.ts +3 -2
  168. package/dist/workspace/spaces/space-mention-source.js +12 -19
  169. package/dist/workspace/spaces/space-view.js +3 -2
  170. package/package.json +3 -3
  171. package/skills/kortix-ui/references/modules.md +1 -1
  172. package/dist/session/tool/tools/multi-agent-tool-data.d.ts +0 -63
  173. package/dist/session/tool/tools/multi-agent-tool-data.js +0 -118
@@ -414,19 +414,6 @@ export function isNonErrorObjectNotFoundRejectionNoise(input) {
414
414
  }
415
415
  return true;
416
416
  }
417
- // A Supabase refresh can race with sign-out on the anonymous landing page.
418
- // The SDK rejects with AuthSessionMissingError when its stored session has
419
- // disappeared; there is no session to recover and no user to notify.
420
- export function isAnonymousAuthRefreshRace(input) {
421
- if (normalizeString(input.message) !== 'Auth session missing!' ||
422
- input.requestUrl !== 'https://kortix.com/' ||
423
- input.mechanism !== 'auto.browser.global_handlers.onunhandledrejection')
424
- return false;
425
- const frames = input.frames ?? [];
426
- return frames.some((frame) => normalizeString(frame.function).includes('refreshSession') &&
427
- isBrowserBundleSource(frame.filename)) &&
428
- !frames.some((frame) => isFirstPartyResolvedSource(frame.filename));
429
- }
430
417
  // An `HTMLMediaElement.play()` promise the browser's autoplay policy denied.
431
418
  // The HTML spec fixes the DOMException message: `NotAllowedError: The play
432
419
  // method is not allowed by the user agent or the platform in the current
@@ -532,7 +519,6 @@ export const REJECTION_RULES = [
532
519
  appliesTo: 'sentry',
533
520
  match: isNonErrorUndefinedRejectionNoise,
534
521
  },
535
- { id: 'anonymous-auth-refresh-race', appliesTo: 'sentry', match: isAnonymousAuthRefreshRace },
536
522
  { id: 'pop-error-scope', appliesTo: 'sentry', match: isOperationErrorPopErrorScopeNoise },
537
523
  { id: 'supabase-token-expired', appliesTo: 'sentry', match: isSupabaseTokenExpiredNoise },
538
524
  {
@@ -3,8 +3,8 @@ import { RUNTIME_NOT_READY_MARKERS } from '@kortix/sdk';
3
3
  * Did the prompt reach the agent before the connection gave up?
4
4
  *
5
5
  * `POST /session/:id/command` blocks until the whole turn finishes, and two
6
- * proxy hops sit between the browser and opencode. Either can stop waiting
7
- * while opencode is still working perfectly well:
6
+ * proxy hops sit between the browser and the runtime. Either can stop waiting
7
+ * while the runtime is still working perfectly well:
8
8
  *
9
9
  * - the sandbox daemon answers `502 {"error":"upstream unreachable"}` once its
10
10
  * header wait elapses (`kortix-sandbox-agent-server/src/app/server.ts`)
@@ -57,11 +57,9 @@ const DELIVERED_BUT_DISCONNECTED = [
57
57
  * forwarding, so nothing was delivered and the message really is lost.
58
58
  */
59
59
  const REFUSED_BEFORE_DELIVERY = [
60
- // The daemon's not-ready 503, in every spelling (code, pi, OpenCode).
60
+ // The daemon's not-ready 503, with or without its code.
61
61
  ...RUNTIME_NOT_READY_MARKERS,
62
62
  'initial_runtime_session',
63
- // A daemon built before W4 names the same refusal this way.
64
- 'initial_opencode_session',
65
63
  'econnrefused',
66
64
  'connection refused',
67
65
  'unauthorized',
@@ -182,8 +182,12 @@ export const handleApiError = (error, context, tI18nComplete) => {
182
182
  // (`isGitMirrorUnavailableNoiseMessage`); a genuine 503 with another
183
183
  // message/code still reports.
184
184
  const isGitMirrorUnavailable503 = status === 503 && isGitMirrorUnavailableNoiseMessage(errorMessage);
185
- if ((status >= 500 && !isServerDeadline503 && !isGitMirrorUnavailable503) ||
186
- error?.code === 'NETWORK_ERROR') {
185
+ // The previous API tasks answer `503 deploy_in_progress` while a release
186
+ // migration they predate rolls out (`resolveSessionInsertFailure`): accepted
187
+ // deploy downtime. The toast tells the user to retry; nothing to report.
188
+ const isDeployInProgress503 = status === 503 && error?.code === 'deploy_in_progress';
189
+ const reportsServerError = status >= 500 && !isServerDeadline503 && !isGitMirrorUnavailable503 && !isDeployInProgress503;
190
+ if (reportsServerError || error?.code === 'NETWORK_ERROR') {
187
191
  captureException(error instanceof Error ? error : new Error(error?.message || String(error)), {
188
192
  tags: {
189
193
  errorType: status >= 500 ? 'server_error' : 'network_error',
@@ -286,8 +290,9 @@ export const handleApiError = (error, context, tI18nComplete) => {
286
290
  return;
287
291
  }
288
292
  if (error?.status >= 500) {
293
+ // "Our team has been notified" is true only when it was captured above.
289
294
  errorToast(formattedMessage, {
290
- description: tI18nComplete.raw('text75aec78d2ee8'),
295
+ description: reportsServerError ? tI18nComplete.raw('text75aec78d2ee8') : undefined,
291
296
  duration: 6000,
292
297
  });
293
298
  }
@@ -1,17 +1,9 @@
1
1
  /** @internal Kortix apps only. No semver: it may change in any release. */
2
2
  /**
3
- * An agent's pixel mark: a 7×7 mirrored pixel figure derived from its slug.
4
- *
5
- * Same slug, same mark, on every surface and every device. Nothing is stored:
6
- * the slug is hashed (FNV-1a), the hash seeds a PRNG (mulberry32), the PRNG
7
- * fills the left half of the grid against a density mask, and the half is
8
- * mirrored. A draw that fails the quality gate is redrawn from a salted seed,
9
- * so retries stay deterministic. The tone comes from a second hash.
10
- *
11
- * Changing SIZE, MASK, the gate or PALETTES changes every agent's mark — the
12
- * golden test in `pixel-mark.test.ts` exists to make that a deliberate act.
3
+ * An agent's pixel mark on its tile: the shape from `pixelMarkShape`
4
+ * (`@kortix/shared/pixel-mark`) plus a tile tone from a second hash of the slug.
13
5
  */
14
- export declare const PIXEL_MARK_SIZE = 7;
6
+ export { passesPixelMarkGate } from '../../_vendor/shared/pixel-mark.js';
15
7
  export interface PixelMarkTone {
16
8
  name: string;
17
9
  tile: string;
@@ -21,16 +13,11 @@ export interface PixelMarkTone {
21
13
  inkDark: string;
22
14
  }
23
15
  export declare const PIXEL_MARK_TONES: readonly PixelMarkTone[];
24
- type Grid = boolean[][];
25
- export declare function fnv1a(input: string): number;
26
- /** Readable at 14px, fills the frame, one connected body. */
27
- export declare function passesPixelMarkGate(grid: Grid): boolean;
28
16
  export declare function pixelMark(slug: string): {
17
+ tone: PixelMarkTone;
29
18
  grid: boolean[][];
30
19
  path: string;
31
20
  ditherPath: string;
32
21
  width: number;
33
22
  height: number;
34
- tone: PixelMarkTone;
35
23
  };
36
- export {};
@@ -1,30 +1,9 @@
1
1
  /**
2
- * An agent's pixel mark: a 7×7 mirrored pixel figure derived from its slug.
3
- *
4
- * Same slug, same mark, on every surface and every device. Nothing is stored:
5
- * the slug is hashed (FNV-1a), the hash seeds a PRNG (mulberry32), the PRNG
6
- * fills the left half of the grid against a density mask, and the half is
7
- * mirrored. A draw that fails the quality gate is redrawn from a salted seed,
8
- * so retries stay deterministic. The tone comes from a second hash.
9
- *
10
- * Changing SIZE, MASK, the gate or PALETTES changes every agent's mark — the
11
- * golden test in `pixel-mark.test.ts` exists to make that a deliberate act.
2
+ * An agent's pixel mark on its tile: the shape from `pixelMarkShape`
3
+ * (`@kortix/shared/pixel-mark`) plus a tile tone from a second hash of the slug.
12
4
  */
13
- import { PIXEL_KORTIX_ROWS } from '../../primitives/pixel-kortix-mark.js';
14
- export const PIXEL_MARK_SIZE = 7;
15
- const HALF = 4;
16
- const MAX_ATTEMPTS = 256;
17
- // Fill chance per cell, outer edge → spine. Dense centre, sparse edges, so the
18
- // mirrored result reads as one body.
19
- const MASK = [
20
- [0.15, 0.3, 0.45, 0.55],
21
- [0.3, 0.5, 0.6, 0.7],
22
- [0.4, 0.6, 0.65, 0.7],
23
- [0.5, 0.65, 0.7, 0.75],
24
- [0.4, 0.55, 0.6, 0.65],
25
- [0.3, 0.45, 0.5, 0.5],
26
- [0.2, 0.35, 0.4, 0.35],
27
- ];
5
+ import { fnv1a, pixelMarkShape } from '../../_vendor/kortix-shared.js';
6
+ export { passesPixelMarkGate } from '../../_vendor/kortix-shared.js';
28
7
  const tone = (name, tile, ink) => ({
29
8
  name,
30
9
  tile,
@@ -51,129 +30,7 @@ const BRAND = {
51
30
  inkDark: '#FFFFFF',
52
31
  };
53
32
  const RESERVED = { kortix: BRAND, mykortix: BRAND, meta: BRAND };
54
- /** My Kortix (slug `mykortix`) wears the Kortix symbol itself, the same 12 × 10
55
- * grid as `PixelKortixMark` and the merch chips. `+` cells are the dithered
56
- * curve cells; at agent-mark sizes they paint at half ink. */
57
- const RESERVED_ROWS = { mykortix: PIXEL_KORTIX_ROWS, meta: PIXEL_KORTIX_ROWS };
58
- export function fnv1a(input) {
59
- let h = 0x811c9dc5;
60
- for (let i = 0; i < input.length; i++) {
61
- h ^= input.charCodeAt(i);
62
- h = Math.imul(h, 0x01000193);
63
- }
64
- return h >>> 0;
65
- }
66
- function mulberry32(seed) {
67
- let a = seed;
68
- return () => {
69
- a = (a + 0x6d2b79f5) | 0;
70
- let t = Math.imul(a ^ (a >>> 15), 1 | a);
71
- t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
72
- return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
73
- };
74
- }
75
- function draw(seed) {
76
- const rand = mulberry32(seed);
77
- return MASK.map((row) => {
78
- const half = row.map((p) => rand() < p);
79
- return [...half, half[2], half[1], half[0]];
80
- });
81
- }
82
- function largestComponent(grid) {
83
- const seen = grid.map((row) => row.map(() => false));
84
- let best = 0;
85
- for (let r = 0; r < PIXEL_MARK_SIZE; r++)
86
- for (let c = 0; c < PIXEL_MARK_SIZE; c++) {
87
- if (!grid[r][c] || seen[r][c])
88
- continue;
89
- let size = 0;
90
- const stack = [[r, c]];
91
- seen[r][c] = true;
92
- while (stack.length) {
93
- const [y, x] = stack.pop();
94
- size++;
95
- for (const [ny, nx] of [[y + 1, x], [y - 1, x], [y, x + 1], [y, x - 1]]) {
96
- if (grid[ny]?.[nx] && !seen[ny][nx]) {
97
- seen[ny][nx] = true;
98
- stack.push([ny, nx]);
99
- }
100
- }
101
- }
102
- best = Math.max(best, size);
103
- }
104
- return best;
105
- }
106
- function hasIsolatedPixel(grid) {
107
- return grid.some((row, r) => row.some((on, c) => {
108
- if (!on)
109
- return false;
110
- for (let dy = -1; dy <= 1; dy++)
111
- for (let dx = -1; dx <= 1; dx++)
112
- if ((dy || dx) && grid[r + dy]?.[c + dx])
113
- return false;
114
- return true;
115
- }));
116
- }
117
- /** Readable at 14px, fills the frame, one connected body. */
118
- export function passesPixelMarkGate(grid) {
119
- const filled = grid.flat().filter(Boolean).length;
120
- if (filled < 18 || filled > 30)
121
- return false;
122
- const rows = grid.filter((row) => row.some(Boolean)).length;
123
- const cols = grid[0].filter((_, c) => grid.some((row) => row[c])).length;
124
- if (rows < 5 || cols < 5)
125
- return false;
126
- if (grid.filter((row) => row.every(Boolean)).length > 1)
127
- return false;
128
- if (grid.filter((row) => row[HALF - 1]).length < 3)
129
- return false;
130
- if (hasIsolatedPixel(grid))
131
- return false;
132
- return largestComponent(grid) >= Math.ceil(filled * 0.85);
133
- }
134
- /** One SVG path, horizontal runs merged, in grid units. */
135
- function toPath(grid) {
136
- let d = '';
137
- grid.forEach((row, y) => {
138
- for (let x = 0; x < row.length;) {
139
- if (!row[x]) {
140
- x++;
141
- continue;
142
- }
143
- const start = x;
144
- while (x < row.length && row[x])
145
- x++;
146
- d += `M${start} ${y}h${x - start}v1h-${x - start}z`;
147
- }
148
- });
149
- return d;
150
- }
151
- /** Runs of one cell character on one row, as an SVG path. */
152
- function rowsToPath(rows, cell) {
153
- return toPath(rows.map((row) => [...row].map((c) => c === cell)));
154
- }
155
33
  export function pixelMark(slug) {
156
- const rows = RESERVED_ROWS[slug];
157
- if (rows) {
158
- return {
159
- grid: rows.map((row) => [...row].map((c) => c !== ' ')),
160
- path: rowsToPath(rows, '#'),
161
- ditherPath: rowsToPath(rows, '+'),
162
- width: rows[0].length,
163
- height: rows.length,
164
- tone: RESERVED[slug] ?? BRAND,
165
- };
166
- }
167
- let grid = draw(fnv1a(slug));
168
- for (let attempt = 1; !passesPixelMarkGate(grid) && attempt < MAX_ATTEMPTS; attempt++)
169
- grid = draw(fnv1a(`${slug}:${attempt}`));
170
34
  const tone = RESERVED[slug] ?? PIXEL_MARK_TONES[fnv1a(`${slug}#tone`) % PIXEL_MARK_TONES.length];
171
- return {
172
- grid,
173
- path: toPath(grid),
174
- ditherPath: '',
175
- width: PIXEL_MARK_SIZE,
176
- height: PIXEL_MARK_SIZE,
177
- tone,
178
- };
35
+ return { ...pixelMarkShape(slug), tone };
179
36
  }
@@ -8,10 +8,10 @@
8
8
  * -----------------------------------------------------------------------
9
9
  * FILE PLACEMENT:
10
10
  *
11
- * public/sounds/opencode/completion.mp3
12
- * public/sounds/opencode/error.mp3
13
- * public/sounds/opencode/notification.mp3
14
- * public/sounds/opencode/send.mp3
11
+ * public/sounds/classic/completion.mp3
12
+ * public/sounds/classic/error.mp3
13
+ * public/sounds/classic/notification.mp3
14
+ * public/sounds/classic/send.mp3
15
15
  *
16
16
  * public/sounds/kortix/completion.mp3
17
17
  * public/sounds/kortix/error.mp3
@@ -7,10 +7,10 @@
7
7
  * -----------------------------------------------------------------------
8
8
  * FILE PLACEMENT:
9
9
  *
10
- * public/sounds/opencode/completion.mp3
11
- * public/sounds/opencode/error.mp3
12
- * public/sounds/opencode/notification.mp3
13
- * public/sounds/opencode/send.mp3
10
+ * public/sounds/classic/completion.mp3
11
+ * public/sounds/classic/error.mp3
12
+ * public/sounds/classic/notification.mp3
13
+ * public/sounds/classic/send.mp3
14
14
  *
15
15
  * public/sounds/kortix/completion.mp3
16
16
  * public/sounds/kortix/error.mp3
@@ -44,6 +44,7 @@ export function useProjectFeatureFlags(projectId) {
44
44
  const voiceCall = useFeatureFlag(projectId, 'voice_call');
45
45
  const chatInput = useFeatureFlag(projectId, 'chat_input');
46
46
  const chatFront = useFeatureFlag(projectId, 'chat_front');
47
+ const spacesProactive = useFeatureFlag(projectId, 'spaces_proactive');
47
48
  return {
48
49
  flags: {
49
50
  marketplace: marketplace.enabled,
@@ -69,8 +70,9 @@ export function useProjectFeatureFlags(projectId) {
69
70
  voice_call: voiceCall.enabled,
70
71
  chat_input: chatInput.enabled,
71
72
  chat_front: chatFront.enabled,
73
+ spaces_proactive: spacesProactive.enabled,
72
74
  },
73
75
  // The trailing hook's loading state — keep this on the LAST hook above.
74
- isLoading: chatFront.isLoading,
76
+ isLoading: spacesProactive.isLoading,
75
77
  };
76
78
  }
@@ -7,7 +7,10 @@ export const useComposerPrefillStore = create((set, get) => ({
7
7
  ...s.prefillByProject,
8
8
  [projectId]: {
9
9
  text: prompt,
10
- ...(extras?.submit ? { submit: true } : {}),
10
+ // The value as given: `'when-ready'` must reach the composer, which
11
+ // waits for Send to be possible. Collapsed to `true` it sent while
12
+ // models and entitlements still loaded.
13
+ ...(extras?.submit ? { submit: extras.submit } : {}),
11
14
  ...(extras?.files?.length ? { files: extras.files } : {}),
12
15
  ...(extras?.options ? { options: extras.options } : {}),
13
16
  },
@@ -11,11 +11,11 @@ export type SoundEvent = 'completion' | 'error' | 'notification' | 'send';
11
11
  /**
12
12
  * Available sound packs.
13
13
  *
14
- * - `off` – all sounds disabled
15
- * - `opencode` – default sound pack (OpenCode style)
16
- * - `kortix` – Kortix branded sound pack
14
+ * - `off` – all sounds disabled
15
+ * - `classic` – default sound pack (synthesized tones)
16
+ * - `kortix` – Kortix branded sound pack
17
17
  */
18
- export type SoundPack = 'off' | 'opencode' | 'kortix';
18
+ export type SoundPack = 'off' | 'classic' | 'kortix';
19
19
  export interface SoundPreferences {
20
20
  /** Active sound pack — 'off' disables all sounds */
21
21
  pack: SoundPack;
@@ -35,6 +35,16 @@ export const useSoundStore = create()(persist((set, get) => ({
35
35
  },
36
36
  }), {
37
37
  name: 'kortix-sound-preferences',
38
+ // v1 renamed the default pack from 'opencode' to 'classic'. A saved
39
+ // 'opencode' keeps playing the same pack.
40
+ version: 1,
41
+ migrate: (persisted) => {
42
+ const state = persisted;
43
+ const preferences = { ...DEFAULT_PREFERENCES, ...state?.preferences };
44
+ if (preferences.pack === 'opencode')
45
+ preferences.pack = 'classic';
46
+ return { preferences };
47
+ },
38
48
  storage: createSafeJSONStorage(),
39
49
  partialize: (state) => ({
40
50
  preferences: state.preferences,
@@ -117,19 +117,26 @@ export function warmHighlighter() {
117
117
  else
118
118
  setTimeout(run, 1500);
119
119
  }
120
+ /**
121
+ * Resolves `false` for a hint Shiki has no grammar for (`conf`, a typo): an
122
+ * expected state, so no Error. A rejected promise here reached Sentry as an
123
+ * unhandled rejection from engines that report it before `await` attaches a
124
+ * handler (KRTX-4265). Rejects only when a real grammar chunk fails to load.
125
+ */
120
126
  function ensureLangLoaded(h, lang) {
121
127
  if (PLAIN_LANGS.has(lang) || loadedLangs.has(lang))
122
- return Promise.resolve();
128
+ return Promise.resolve(true);
123
129
  const existing = langLoadPromises.get(lang);
124
130
  if (existing)
125
131
  return existing;
126
132
  const importer = bundledLanguages[lang];
127
133
  if (!importer)
128
- return Promise.reject(new Error(`no bundled grammar for "${lang}"`));
134
+ return Promise.resolve(false);
129
135
  const p = h
130
136
  .loadLanguage(importer())
131
137
  .then(() => {
132
138
  loadedLangs.add(lang);
139
+ return true;
133
140
  })
134
141
  .finally(() => {
135
142
  langLoadPromises.delete(lang);
@@ -225,11 +232,13 @@ export function highlightAsync(code, language, theme, opts) {
225
232
  if (!h)
226
233
  return null;
227
234
  try {
228
- await ensureLangLoaded(h, lang);
235
+ // Unknown hint: plain text, quietly.
236
+ if (!(await ensureLangLoaded(h, lang)))
237
+ return null;
229
238
  }
230
239
  catch (err) {
231
- // Unknown hint or a grammar chunk that failed to load: plain text is
232
- // the honest rendering. Not cached, so a later mount can retry.
240
+ // A grammar chunk that failed to load: plain text is the honest
241
+ // rendering. Not cached, so a later mount can retry.
233
242
  console.warn(`[markdown-code] failed to load Shiki lang "${lang}":`, err?.message || err);
234
243
  return null;
235
244
  }
@@ -11,6 +11,15 @@ import { isUnderSandboxRoot } from '@kortix/sdk';
11
11
  const FILE_LINK_HREF = '#kortix-file:';
12
12
  const FILE_SCHEME = /^(?:sandbox|file|computer):(?:\/\/[^/]*)?/i;
13
13
  const ANY_SCHEME = /^[a-z][a-z0-9+.-]*:/i;
14
+ /**
15
+ * A path the file preview can open: under a sandbox root, or under a session's
16
+ * drive mounts (`/drives/<mount>/…`), which the file client reads through the
17
+ * drive API (`internal/files/session-drive-files.ts`). A router links a worker's
18
+ * result file in the thread folder this way.
19
+ */
20
+ function isFilePreviewPath(path) {
21
+ return isUnderSandboxRoot(path) || (path.startsWith('/drives/') && !path.split('/').some((part) => part === '..' || part === '.'));
22
+ }
14
23
  /**
15
24
  * Resolves a document-relative href against the directory of the document
16
25
  * that contains the link, lexically (`.` and `..` only — no filesystem
@@ -45,7 +54,7 @@ export function workspaceFileLinkPath(url, baseDir) {
45
54
  else if (ANY_SCHEME.test(path) || /^(?:[#?]|\/\/)/.test(path)) {
46
55
  return null;
47
56
  }
48
- else if (path.startsWith('/') && !isUnderSandboxRoot(path)) {
57
+ else if (path.startsWith('/') && !isFilePreviewPath(path)) {
49
58
  // A root-relative path outside the sandbox roots is an app route.
50
59
  return null;
51
60
  }
@@ -60,7 +69,7 @@ export function workspaceFileLinkPath(url, baseDir) {
60
69
  const resolved = path.startsWith('/')
61
70
  ? resolveDocumentRelative('', path)
62
71
  : resolveDocumentRelative(baseDir, path);
63
- return resolved && isUnderSandboxRoot(resolved) ? resolved : null;
72
+ return resolved && isFilePreviewPath(resolved) ? resolved : null;
64
73
  }
65
74
  return path || null;
66
75
  }
@@ -72,7 +81,7 @@ export function parseFileLinkHref(href, document = false) {
72
81
  if (!document)
73
82
  return path || null;
74
83
  const resolved = resolveDocumentRelative('', path);
75
- return path.startsWith('/') && resolved && isUnderSandboxRoot(resolved) ? resolved : null;
84
+ return path.startsWith('/') && resolved && isFilePreviewPath(resolved) ? resolved : null;
76
85
  }
77
86
  catch {
78
87
  return null;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  /**
3
- * Minimal YAML frontmatter rendering for markdown files (opencode-style agent
4
- * and skill definitions, but generic). The parser handles flat key/value pairs
5
- * plus a single level of nested objects — enough for the patterns documented
6
- * at https://opencode.ai/docs/agents/ and similar conventions.
3
+ * Minimal YAML frontmatter rendering for markdown files (agent and skill
4
+ * definitions, but generic). The parser handles flat key/value pairs plus a
5
+ * single level of nested objects — enough for agent and skill frontmatter
6
+ * (`description`, `mode`, `permission`, ...) and similar conventions.
7
7
  */
8
8
  export type FrontmatterValue = string | Record<string, string>;
9
9
  export interface ParsedMarkdown {
@@ -13,8 +13,8 @@ export interface ParsedMarkdown {
13
13
  export declare function parseFrontmatter(content: string): ParsedMarkdown;
14
14
  /**
15
15
  * Render markdown content; if a leading YAML frontmatter block is present, it
16
- * renders as a small metadata card above the prose. Used for opencode-style
17
- * agent / skill markdown files (and any other frontmatter-prefixed `.md`).
16
+ * renders as a small metadata card above the prose. Used for agent / skill
17
+ * markdown files (and any other frontmatter-prefixed `.md`).
18
18
  */
19
19
  export declare function MarkdownWithFrontmatter({ content, className, documentPath, }: {
20
20
  content: string;
@@ -64,7 +64,7 @@ export function parseFrontmatter(content) {
64
64
  const line = rawLine.trimEnd();
65
65
  if (!line.trim() || line.trim().startsWith('#'))
66
66
  continue;
67
- // A nested key may be QUOTED, and in the opencode permission idiom it
67
+ // A nested key may be QUOTED, and in the agent permission idiom it
68
68
  // usually is — `"*": allow`. Matching only [\w.-] dropped that line, left
69
69
  // the parent an empty object, and printed a bare em-dash where the
70
70
  // permissions belong. Wildcards and path-ish keys are accepted bare too.
@@ -143,8 +143,8 @@ function FrontmatterValueBody({ value }) {
143
143
  }
144
144
  /**
145
145
  * Render markdown content; if a leading YAML frontmatter block is present, it
146
- * renders as a small metadata card above the prose. Used for opencode-style
147
- * agent / skill markdown files (and any other frontmatter-prefixed `.md`).
146
+ * renders as a small metadata card above the prose. Used for agent / skill
147
+ * markdown files (and any other frontmatter-prefixed `.md`).
148
148
  */
149
149
  export function MarkdownWithFrontmatter({ content, className, documentPath, }) {
150
150
  const { frontmatter, body } = parseFrontmatter(content);
@@ -40,7 +40,8 @@ const buttonVariants = cva("flex items-center justify-center gap-2 whitespace-no
40
40
  },
41
41
  size: {
42
42
  default: 'h-9 px-4 py-2 has-[>svg]:px-3',
43
- xs: 'h-7 gap-1.5 px-2.5 rounded-sm has-[>svg]:px-2',
43
+ // In a group, the radius of its icon neighbours (`icon-sm`, `icon`), so the group's outer corners match.
44
+ xs: 'h-7 gap-1.5 px-2.5 rounded-sm in-data-[slot=button-group]:rounded-md has-[>svg]:px-2',
44
45
  base: "h-7 gap-1 px-2.5 in-data-[slot=button-group]:rounded-2xl has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
45
46
  sm: 'h-8 gap-1.5 px-3 has-[>svg]:px-2.5',
46
47
  lg: 'h-10 px-6 has-[>svg]:px-4',
@@ -1,4 +1,4 @@
1
- import type { PeerMessage } from '@kortix/sdk';
1
+ import { type PeerMessage } from '@kortix/sdk';
2
2
  import { usePeerMessages } from '@kortix/sdk/react';
3
3
  /**
4
4
  * Messages from other sessions that wait for the person (`inbound: hold`, or a
@@ -7,8 +7,6 @@ import { usePeerMessages } from '@kortix/sdk/react';
7
7
  * the agent strip. "Approve message" delivers it, "Deny" drops it. A message
8
8
  * nobody decides expires after 5 minutes on the server.
9
9
  */
10
- /** The preview line: the sender's summary, else the message's first line. */
11
- export declare function heldPreview(message: Pick<PeerMessage, 'summary' | 'message'>): string;
12
10
  export interface HeldMessageCardProps {
13
11
  message: PeerMessage;
14
12
  pending: 'approve' | 'deny' | null;
@@ -23,8 +21,6 @@ export declare function HeldMessageList({ messages, approve, deny, }: {
23
21
  approve: PeerMessagesQuery['approve'];
24
22
  deny: PeerMessagesQuery['deny'];
25
23
  }): import("react").JSX.Element | null;
26
- /** The messages that wait for the person, oldest first (the order they arrived). */
27
- export declare function heldMessages(messages: readonly PeerMessage[] | undefined): PeerMessage[];
28
24
  /** A session's held messages, read on their own (for a host without the agent strip). */
29
25
  export declare function HeldMessages({ projectId, sessionId }: {
30
26
  projectId: string | undefined;
@@ -5,22 +5,8 @@ import { errorToast } from '../../primitives/toast.js';
5
5
  import { useTranslations } from '../../i18n/index.js';
6
6
  import { AgentFace, AgentStatus } from './agent-surface.js';
7
7
  import { peerHandleLabel } from '../../_vendor/kortix-shared.js';
8
+ import { heldMessages } from '@kortix/sdk';
8
9
  import { usePeerMessages } from '@kortix/sdk/react';
9
- /**
10
- * Messages from other sessions that wait for the person (`inbound: hold`, or a
11
- * session the person asked to approve first). Claude Code opens an approval
12
- * dialog with the sender and a preview; Kortix shows one card per message above
13
- * the agent strip. "Approve message" delivers it, "Deny" drops it. A message
14
- * nobody decides expires after 5 minutes on the server.
15
- */
16
- /** The preview line: the sender's summary, else the message's first line. */
17
- export function heldPreview(message) {
18
- const summary = message.summary?.trim();
19
- if (summary)
20
- return summary;
21
- const first = message.message.trim().split('\n')[0] ?? '';
22
- return first.length > 200 ? `${first.slice(0, 200)}…` : first;
23
- }
24
10
  export function HeldMessageCard({ message, pending, onApprove, onDeny }) {
25
11
  const t = useTranslations('multiAgent.held');
26
12
  const handle = message.from_handle;
@@ -40,12 +26,6 @@ export function HeldMessageList({ messages, approve, deny, }) {
40
26
  const fail = (key) => (error) => errorToast(t(key), { description: error instanceof Error ? error.message : undefined });
41
27
  return (_jsx("div", { "aria-label": t('label'), role: "group", className: "space-y-1.5", children: held.map((message) => (_jsx(HeldMessageCard, { message: message, pending: pendingFor(message.id), onApprove: () => approve.mutate(message.id, { onError: fail('approveFailed') }), onDeny: () => deny.mutate(message.id, { onError: fail('denyFailed') }) }, message.id))) }));
42
28
  }
43
- /** The messages that wait for the person, oldest first (the order they arrived). */
44
- export function heldMessages(messages) {
45
- return (messages ?? [])
46
- .filter((message) => message.status === 'held')
47
- .sort((a, b) => Date.parse(a.created_at) - Date.parse(b.created_at));
48
- }
49
29
  /** A session's held messages, read on their own (for a host without the agent strip). */
50
30
  export function HeldMessages({ projectId, sessionId }) {
51
31
  const { data, approve, deny } = usePeerMessages(projectId, sessionId, 'in');
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from 'react';
1
2
  import { type SessionChatInputProps } from './composer.js';
2
3
  import type { ComposerQuote } from './composer-logic.js';
3
4
  /**
@@ -18,6 +19,8 @@ export interface ComposerAboveCardDerived {
18
19
  remove: string;
19
20
  };
20
21
  handleRemoveQuote: (id: string) => void;
22
+ /** Inside a space: the ask about an agent the last message named from outside it (`menus/space-mentions.ts`). */
23
+ spaceAsk?: ReactNode;
21
24
  }
22
25
  export type ComposerAboveCardProps = SessionChatInputProps & ComposerAboveCardDerived;
23
- export declare function ComposerAboveCard({ dockId, quotes, quoteListLabels, handleRemoveQuote, aboveSlot, inputSlot, notice, noticeAsleep, onNoticeRetry, onModelChange, slashMenuPlacement, questionActive, }: ComposerAboveCardProps): import("react").JSX.Element;
26
+ export declare function ComposerAboveCard({ dockId, quotes, quoteListLabels, handleRemoveQuote, spaceAsk, aboveSlot, inputSlot, notice, noticeAsleep, onNoticeRetry, onModelChange, slashMenuPlacement, questionActive, }: ComposerAboveCardProps): import("react").JSX.Element;
@@ -14,9 +14,9 @@ import { QuoteList } from './quote-list.js';
14
14
  * keeps only the side ring, so no ring line crosses a seam.
15
15
  */
16
16
  const DOCKED_MIDDLE_LAYER_CLASS = 'ring-muted/15 rounded-t-none ring-3 [clip-path:inset(0_-8px_0_-8px)]';
17
- export function ComposerAboveCard({ dockId, quotes, quoteListLabels, handleRemoveQuote, aboveSlot, inputSlot, notice = null, noticeAsleep, onNoticeRetry, onModelChange, slashMenuPlacement = 'above', questionActive = false, }) {
17
+ export function ComposerAboveCard({ dockId, quotes, quoteListLabels, handleRemoveQuote, spaceAsk = null, aboveSlot, inputSlot, notice = null, noticeAsleep, onNoticeRetry, onModelChange, slashMenuPlacement = 'above', questionActive = false, }) {
18
18
  const showQueueStrip = Boolean(inputSlot);
19
- return (_jsxs(_Fragment, { children: [slashMenuPlacement === 'above' && _jsx("div", { id: dockId }), _jsx("div", { className: "mb-2 w-full empty:hidden", children: _jsx(QuoteList, { quotes: quotes, labels: quoteListLabels, onRemove: handleRemoveQuote }, quotes.length === 0 ? 'empty' : 'quotes') }), aboveSlot && _jsx("div", { className: "mb-2 w-full empty:hidden", children: aboveSlot }), (notice || showQueueStrip) && (_jsxs("div", { "data-composer-stack": true, className: "relative isolate flex w-full flex-col items-center justify-center [&>[data-composer-strip]:not(:empty)~*]:rounded-t-none", children: [showQueueStrip && (
19
+ return (_jsxs(_Fragment, { children: [slashMenuPlacement === 'above' && _jsx("div", { id: dockId }), _jsx("div", { className: "mb-2 w-full empty:hidden", children: _jsx(QuoteList, { quotes: quotes, labels: quoteListLabels, onRemove: handleRemoveQuote }, quotes.length === 0 ? 'empty' : 'quotes') }), spaceAsk ? _jsx("div", { className: "mb-2 w-full", children: spaceAsk }) : null, aboveSlot && _jsx("div", { className: "mb-2 w-full empty:hidden", children: aboveSlot }), (notice || showQueueStrip) && (_jsxs("div", { "data-composer-stack": true, className: "relative isolate flex w-full flex-col items-center justify-center [&>[data-composer-strip]:not(:empty)~*]:rounded-t-none", children: [showQueueStrip && (
20
20
  // A pending question also carries a ring around the whole
21
21
  // surface, down to the card: each layer clips its ring at the seam.
22
22
  _jsx("div", { "data-composer-strip": true, className: cn(COMPOSER_INPUT_SLOT_CLASS, questionActive &&
@@ -17,7 +17,7 @@ export interface ComposerOptions {
17
17
  }
18
18
  /**
19
19
  * The canonical "compose a first message" input: {@link SessionChatInput}
20
- * pre-wired with the OpenCode model / agent / variant / command selectors (the
20
+ * pre-wired with the model / agent / variant / command selectors (the
21
21
  * four catalog queries + per-session selection state). Used by the home composer
22
22
  * and the instant session shell so neither hand-rolls the selector wiring.
23
23
  *