@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
@@ -1,311 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ARTIFACT_ANNOTATION_LIMITS: {
3
- readonly messageBytes: 65536;
4
- readonly captureBytes: 2097152;
5
- readonly captureChunkChars: 49152;
6
- readonly captureChunkBytes: 36864;
7
- readonly captureChunks: 57;
8
- readonly captureEdge: 2048;
9
- readonly capturePixels: 4194304;
10
- readonly captureSvgBytes: 8388608;
11
- readonly captureTimeout: 10000;
12
- readonly chunkItems: 64;
13
- readonly chunks: 256;
14
- readonly elements: 8192;
15
- readonly texts: 8192;
16
- readonly textUnits: 524288;
17
- readonly pins: 1000;
18
- readonly pinLabel: 64;
19
- readonly ranges: 64;
20
- readonly rects: 64;
21
- readonly coordinate: 10000000;
22
- readonly viewport: 100000;
23
- };
24
- declare const rectSchema: z.ZodObject<{
25
- x: z.ZodNumber;
26
- y: z.ZodNumber;
27
- width: z.ZodNumber;
28
- height: z.ZodNumber;
29
- }, z.core.$strict>;
30
- declare const viewportSchema: z.ZodObject<{
31
- width: z.ZodNumber;
32
- height: z.ZodNumber;
33
- scroll: z.ZodObject<{
34
- x: z.ZodNumber;
35
- y: z.ZodNumber;
36
- }, z.core.$strict>;
37
- }, z.core.$strict>;
38
- export type ArtifactAnnotationRect = z.infer<typeof rectSchema>;
39
- export type ArtifactAnnotationViewport = z.infer<typeof viewportSchema>;
40
- export declare const artifactAnnotationCaptureFailureSchema: z.ZodEnum<{
41
- stale: "stale";
42
- unavailable: "unavailable";
43
- tainted: "tainted";
44
- too_large: "too_large";
45
- cancelled: "cancelled";
46
- timeout: "timeout";
47
- }>;
48
- export type ArtifactAnnotationCaptureFailure = z.infer<typeof artifactAnnotationCaptureFailureSchema>;
49
- declare const candidateSchema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
50
- type: "text";
51
- quote: string;
52
- prefix: string;
53
- suffix: string;
54
- } | {
55
- offset: {
56
- x: number;
57
- y: number;
58
- };
59
- selector: string;
60
- snippet: string;
61
- viewport_width: number;
62
- scroll: {
63
- x: number;
64
- y: number;
65
- };
66
- type: "point";
67
- } | {
68
- offset: {
69
- x: number;
70
- y: number;
71
- width: number;
72
- height: number;
73
- };
74
- selector: string;
75
- snippet: string;
76
- viewport_width: number;
77
- scroll: {
78
- x: number;
79
- y: number;
80
- };
81
- type: "region";
82
- }, unknown>>;
83
- export declare const artifactAnnotationFrameMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
84
- type: z.ZodLiteral<"ready">;
85
- kortix: z.ZodLiteral<"annotate">;
86
- v: z.ZodLiteral<1>;
87
- }, z.core.$strict>, z.ZodObject<{
88
- type: z.ZodLiteral<"layout">;
89
- revision: z.ZodNumber;
90
- chunk: z.ZodNumber;
91
- final: z.ZodBoolean;
92
- complete: z.ZodBoolean;
93
- viewport: z.ZodObject<{
94
- width: z.ZodNumber;
95
- height: z.ZodNumber;
96
- scroll: z.ZodObject<{
97
- x: z.ZodNumber;
98
- y: z.ZodNumber;
99
- }, z.core.$strict>;
100
- }, z.core.$strict>;
101
- elements: z.ZodArray<z.ZodObject<{
102
- n: z.ZodNumber;
103
- selector: z.ZodString;
104
- snippet: z.ZodString;
105
- rect: z.ZodObject<{
106
- x: z.ZodNumber;
107
- y: z.ZodNumber;
108
- width: z.ZodNumber;
109
- height: z.ZodNumber;
110
- }, z.core.$strict>;
111
- }, z.core.$strict>>;
112
- texts: z.ZodArray<z.ZodObject<{
113
- n: z.ZodNumber;
114
- offset: z.ZodNumber;
115
- text: z.ZodString;
116
- }, z.core.$strict>>;
117
- kortix: z.ZodLiteral<"annotate">;
118
- v: z.ZodLiteral<1>;
119
- }, z.core.$strict>, z.ZodObject<{
120
- type: z.ZodLiteral<"candidate">;
121
- revision: z.ZodNumber;
122
- anchor: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
123
- type: "text";
124
- quote: string;
125
- prefix: string;
126
- suffix: string;
127
- } | {
128
- offset: {
129
- x: number;
130
- y: number;
131
- };
132
- selector: string;
133
- snippet: string;
134
- viewport_width: number;
135
- scroll: {
136
- x: number;
137
- y: number;
138
- };
139
- type: "point";
140
- } | {
141
- offset: {
142
- x: number;
143
- y: number;
144
- width: number;
145
- height: number;
146
- };
147
- selector: string;
148
- snippet: string;
149
- viewport_width: number;
150
- scroll: {
151
- x: number;
152
- y: number;
153
- };
154
- type: "region";
155
- }, unknown>>;
156
- rect: z.ZodOptional<z.ZodObject<{
157
- x: z.ZodNumber;
158
- y: z.ZodNumber;
159
- width: z.ZodNumber;
160
- height: z.ZodNumber;
161
- }, z.core.$strict>>;
162
- kortix: z.ZodLiteral<"annotate">;
163
- v: z.ZodLiteral<1>;
164
- }, z.core.$strict>, z.ZodObject<{
165
- type: z.ZodLiteral<"selection">;
166
- state: z.ZodEnum<{
167
- none: "none";
168
- too_long: "too_long";
169
- }>;
170
- rect: z.ZodOptional<z.ZodObject<{
171
- x: z.ZodNumber;
172
- y: z.ZodNumber;
173
- width: z.ZodNumber;
174
- height: z.ZodNumber;
175
- }, z.core.$strict>>;
176
- moved: z.ZodOptional<z.ZodLiteral<true>>;
177
- kortix: z.ZodLiteral<"annotate">;
178
- v: z.ZodLiteral<1>;
179
- }, z.core.$strict>, z.ZodObject<{
180
- type: z.ZodLiteral<"key">;
181
- key: z.ZodEnum<{
182
- escape: "escape";
183
- comment: "comment";
184
- }>;
185
- kortix: z.ZodLiteral<"annotate">;
186
- v: z.ZodLiteral<1>;
187
- }, z.core.$strict>, z.ZodObject<{
188
- type: z.ZodLiteral<"focus">;
189
- n: z.ZodNumber;
190
- kortix: z.ZodLiteral<"annotate">;
191
- v: z.ZodLiteral<1>;
192
- }, z.core.$strict>, z.ZodObject<{
193
- type: z.ZodLiteral<"pointer">;
194
- revision: z.ZodNumber;
195
- at: z.ZodNullable<z.ZodObject<{
196
- n: z.ZodNumber;
197
- x: z.ZodNumber;
198
- y: z.ZodNumber;
199
- }, z.core.$strict>>;
200
- kortix: z.ZodLiteral<"annotate">;
201
- v: z.ZodLiteral<1>;
202
- }, z.core.$strict>, z.ZodObject<{
203
- type: z.ZodLiteral<"capture_start">;
204
- mime: z.ZodLiteral<"image/png">;
205
- width: z.ZodNumber;
206
- height: z.ZodNumber;
207
- bytes: z.ZodNumber;
208
- chunks: z.ZodNumber;
209
- request: z.ZodNumber;
210
- revision: z.ZodNumber;
211
- kortix: z.ZodLiteral<"annotate">;
212
- v: z.ZodLiteral<1>;
213
- }, z.core.$strict>, z.ZodObject<{
214
- type: z.ZodLiteral<"capture_chunk">;
215
- index: z.ZodNumber;
216
- data: z.ZodString;
217
- request: z.ZodNumber;
218
- revision: z.ZodNumber;
219
- kortix: z.ZodLiteral<"annotate">;
220
- v: z.ZodLiteral<1>;
221
- }, z.core.$strict>, z.ZodObject<{
222
- type: z.ZodLiteral<"capture_complete">;
223
- request: z.ZodNumber;
224
- revision: z.ZodNumber;
225
- kortix: z.ZodLiteral<"annotate">;
226
- v: z.ZodLiteral<1>;
227
- }, z.core.$strict>, z.ZodObject<{
228
- type: z.ZodLiteral<"capture_error">;
229
- reason: z.ZodEnum<{
230
- stale: "stale";
231
- unavailable: "unavailable";
232
- tainted: "tainted";
233
- too_large: "too_large";
234
- cancelled: "cancelled";
235
- timeout: "timeout";
236
- }>;
237
- request: z.ZodNumber;
238
- revision: z.ZodNumber;
239
- kortix: z.ZodLiteral<"annotate">;
240
- v: z.ZodLiteral<1>;
241
- }, z.core.$strict>], "type">;
242
- export declare const artifactAnnotationHostMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
243
- type: z.ZodLiteral<"mode">;
244
- mode: z.ZodEnum<{
245
- off: "off";
246
- text: "text";
247
- comment: "comment";
248
- }>;
249
- kortix: z.ZodLiteral<"annotate">;
250
- v: z.ZodLiteral<1>;
251
- }, z.core.$strict>, z.ZodObject<{
252
- type: z.ZodLiteral<"request_layout">;
253
- kortix: z.ZodLiteral<"annotate">;
254
- v: z.ZodLiteral<1>;
255
- }, z.core.$strict>, z.ZodObject<{
256
- type: z.ZodLiteral<"track">;
257
- pointer: z.ZodBoolean;
258
- kortix: z.ZodLiteral<"annotate">;
259
- v: z.ZodLiteral<1>;
260
- }, z.core.$strict>, z.ZodObject<{
261
- type: z.ZodLiteral<"capture">;
262
- rect: z.ZodObject<{
263
- x: z.ZodNumber;
264
- y: z.ZodNumber;
265
- width: z.ZodNumber;
266
- height: z.ZodNumber;
267
- }, z.core.$strict>;
268
- request: z.ZodNumber;
269
- revision: z.ZodNumber;
270
- kortix: z.ZodLiteral<"annotate">;
271
- v: z.ZodLiteral<1>;
272
- }, z.core.$strict>, z.ZodObject<{
273
- type: z.ZodLiteral<"cancel_capture">;
274
- request: z.ZodNumber;
275
- kortix: z.ZodLiteral<"annotate">;
276
- v: z.ZodLiteral<1>;
277
- }, z.core.$strict>, z.ZodObject<{
278
- type: z.ZodLiteral<"draw">;
279
- revision: z.ZodNumber;
280
- pins: z.ZodArray<z.ZodObject<{
281
- n: z.ZodNumber;
282
- rects: z.ZodArray<z.ZodObject<{
283
- x: z.ZodNumber;
284
- y: z.ZodNumber;
285
- width: z.ZodNumber;
286
- height: z.ZodNumber;
287
- }, z.core.$strict>>;
288
- ranges: z.ZodArray<z.ZodObject<{
289
- n: z.ZodNumber;
290
- start: z.ZodNumber;
291
- end: z.ZodNumber;
292
- }, z.core.$strict>>;
293
- label: z.ZodOptional<z.ZodString>;
294
- }, z.core.$strict>>;
295
- active: z.ZodNullable<z.ZodNumber>;
296
- focus: z.ZodBoolean;
297
- kortix: z.ZodLiteral<"annotate">;
298
- v: z.ZodLiteral<1>;
299
- }, z.core.$strict>], "type">;
300
- export type ArtifactAnnotationCandidate = z.infer<typeof candidateSchema>;
301
- export type ArtifactAnnotationFrameMessage = z.infer<typeof artifactAnnotationFrameMessageSchema>;
302
- export type ArtifactAnnotationHostMessage = z.infer<typeof artifactAnnotationHostMessageSchema>;
303
- export type ArtifactAnnotationLayout = Extract<ArtifactAnnotationFrameMessage, {
304
- type: "layout";
305
- }>;
306
- export type ArtifactAnnotationPin = Extract<ArtifactAnnotationHostMessage, {
307
- type: "draw";
308
- }>["pins"][number];
309
- export declare function parseArtifactAnnotationFrameMessage(value: unknown): ArtifactAnnotationFrameMessage | null;
310
- export declare function parseArtifactAnnotationHostMessage(value: unknown): ArtifactAnnotationHostMessage | null;
311
- export {};
@@ -1,155 +0,0 @@
1
- import { z } from 'zod';
2
- /** The longest text quote, in UTF-16 code units: a paragraph. A longer selection is refused, never cut. */
3
- export declare const ARTIFACT_TEXT_QUOTE_MAX = 500;
4
- /** The longest prefix and suffix, in UTF-16 code units. */
5
- export declare const ARTIFACT_TEXT_CONTEXT_MAX = 32;
6
- export declare const artifactCommentAnchorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
7
- type: z.ZodLiteral<"text">;
8
- version: z.ZodString;
9
- quote: z.ZodString;
10
- prefix: z.ZodString;
11
- suffix: z.ZodString;
12
- }, z.core.$strict>, z.ZodObject<{
13
- offset: z.ZodObject<{
14
- x: z.ZodNumber;
15
- y: z.ZodNumber;
16
- }, z.core.$strict>;
17
- version: z.ZodString;
18
- selector: z.ZodString;
19
- snippet: z.ZodString;
20
- viewport_width: z.ZodNumber;
21
- scroll: z.ZodObject<{
22
- x: z.ZodNumber;
23
- y: z.ZodNumber;
24
- }, z.core.$strict>;
25
- type: z.ZodLiteral<"point">;
26
- }, z.core.$strict>, z.ZodObject<{
27
- offset: z.ZodObject<{
28
- x: z.ZodNumber;
29
- y: z.ZodNumber;
30
- width: z.ZodNumber;
31
- height: z.ZodNumber;
32
- }, z.core.$strict>;
33
- version: z.ZodString;
34
- selector: z.ZodString;
35
- snippet: z.ZodString;
36
- viewport_width: z.ZodNumber;
37
- scroll: z.ZodObject<{
38
- x: z.ZodNumber;
39
- y: z.ZodNumber;
40
- }, z.core.$strict>;
41
- type: z.ZodLiteral<"region">;
42
- }, z.core.$strict>, z.ZodObject<{
43
- type: z.ZodLiteral<"none">;
44
- version: z.ZodString;
45
- }, z.core.$strict>], "type">;
46
- export declare const artifactCommentMarkSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
47
- points: z.ZodArray<z.ZodObject<{
48
- x: z.ZodNumber;
49
- y: z.ZodNumber;
50
- }, z.core.$strict>>;
51
- color: z.ZodEnum<{
52
- red: "red";
53
- blue: "blue";
54
- black: "black";
55
- }>;
56
- width: z.ZodNumber;
57
- tool: z.ZodLiteral<"pen">;
58
- }, z.core.$strict>, z.ZodObject<{
59
- points: z.ZodArray<z.ZodObject<{
60
- x: z.ZodNumber;
61
- y: z.ZodNumber;
62
- }, z.core.$strict>>;
63
- color: z.ZodEnum<{
64
- red: "red";
65
- blue: "blue";
66
- black: "black";
67
- }>;
68
- width: z.ZodNumber;
69
- tool: z.ZodLiteral<"arrow">;
70
- }, z.core.$strict>, z.ZodObject<{
71
- points: z.ZodArray<z.ZodObject<{
72
- x: z.ZodNumber;
73
- y: z.ZodNumber;
74
- }, z.core.$strict>>;
75
- color: z.ZodEnum<{
76
- red: "red";
77
- blue: "blue";
78
- black: "black";
79
- }>;
80
- width: z.ZodNumber;
81
- tool: z.ZodLiteral<"rectangle">;
82
- }, z.core.$strict>], "tool">;
83
- export declare const artifactCommentMarksSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
84
- points: z.ZodArray<z.ZodObject<{
85
- x: z.ZodNumber;
86
- y: z.ZodNumber;
87
- }, z.core.$strict>>;
88
- color: z.ZodEnum<{
89
- red: "red";
90
- blue: "blue";
91
- black: "black";
92
- }>;
93
- width: z.ZodNumber;
94
- tool: z.ZodLiteral<"pen">;
95
- }, z.core.$strict>, z.ZodObject<{
96
- points: z.ZodArray<z.ZodObject<{
97
- x: z.ZodNumber;
98
- y: z.ZodNumber;
99
- }, z.core.$strict>>;
100
- color: z.ZodEnum<{
101
- red: "red";
102
- blue: "blue";
103
- black: "black";
104
- }>;
105
- width: z.ZodNumber;
106
- tool: z.ZodLiteral<"arrow">;
107
- }, z.core.$strict>, z.ZodObject<{
108
- points: z.ZodArray<z.ZodObject<{
109
- x: z.ZodNumber;
110
- y: z.ZodNumber;
111
- }, z.core.$strict>>;
112
- color: z.ZodEnum<{
113
- red: "red";
114
- blue: "blue";
115
- black: "black";
116
- }>;
117
- width: z.ZodNumber;
118
- tool: z.ZodLiteral<"rectangle">;
119
- }, z.core.$strict>], "tool">>;
120
- export type ArtifactCommentMark = z.infer<typeof artifactCommentMarkSchema>;
121
- export type ArtifactCommentAnchor = z.infer<typeof artifactCommentAnchorSchema>;
122
- export type ArtifactTextAnchor = Extract<ArtifactCommentAnchor, {
123
- type: 'text';
124
- }>;
125
- export type ArtifactTextPosition = {
126
- start: number | null;
127
- end: number | null;
128
- outdated: boolean;
129
- };
130
- /**
131
- * The re-anchoring work one read may spend across all its threads (about 100 ms):
132
- * fuzzy-scanned code units plus alignment cells, and an eighth of a code unit
133
- * per natively exact-scanned one. A list re-anchors every stored thread, and a
134
- * commenter can store many unmatched quotes, so the cost of one read must not
135
- * grow with the thread count. A thread past the budget is outdated for that read.
136
- */
137
- export declare const ARTIFACT_REANCHOR_READ_UNITS: number;
138
- export interface ArtifactReanchorBudget {
139
- remaining: number;
140
- }
141
- /** One budget per read: pass the same object to every reanchorArtifactText call of that read. */
142
- export declare function createArtifactReanchorBudget(): ArtifactReanchorBudget;
143
- /**
144
- * The read budget split into equal shares, one per thread author (a person or an
145
- * agent session). A commenter whose quotes match nothing spends only their own
146
- * share, so other people's threads still re-anchor; the read's total stays at
147
- * ARTIFACT_REANCHOR_READ_UNITS. Name every author of the read up front.
148
- */
149
- export declare function createArtifactReanchorBudgets(authors: Iterable<string>): (author: string) => ArtifactReanchorBudget;
150
- /**
151
- * Where a text anchor sits in `text` now. Every scan spends `budget`; a caller
152
- * that re-anchors many threads in one read passes one shared budget
153
- * (createArtifactReanchorBudget), so the read's cost is bounded.
154
- */
155
- export declare function reanchorArtifactText(text: string, anchor: ArtifactTextAnchor, budget?: ArtifactReanchorBudget): ArtifactTextPosition;
@@ -1,50 +0,0 @@
1
- /** @internal Kortix apps only. No semver: it may change in any release. */
2
- /**
3
- * The strict `notification_center` gate controls session mute/watch actions.
4
- * Inbox surfaces also work when artifacts and artifact_comments are both on.
5
- *
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
- * - Without one (`/projects`, `/new`, standalone `/settings`): on when any
9
- * project already in this client's query cache has the flag on. The scan
10
- * reads the cached project rows, project details and project lists. It sends no request,
11
- * so a cold load of such a page with nothing cached reads off.
12
- * - `NotificationHost` uses `useNotificationHostGate`: while a project's
13
- * row loads, a cached detail, a cached project list or its previous answer
14
- * decides.
15
- */
16
- import type { KortixProject } from '@kortix/sdk';
17
- import { type QueryClient } from '@tanstack/react-query';
18
- export declare const NOTIFICATION_CENTER_FLAG = "notification_center";
19
- type FlagHolder = {
20
- experimental?: Partial<NonNullable<KortixProject['experimental']>>;
21
- } | null | undefined;
22
- /** The predicate of `useFeatureFlag`: the server said exactly `true`. */
23
- export declare function notificationCenterOn(project: FlagHolder): boolean;
24
- export declare function notificationInboxOn(project: FlagHolder): boolean;
25
- /**
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.
29
- */
30
- export declare function cachedNotificationCenterAnswer(client: QueryClient | null, projectId: string | null | undefined): boolean | undefined;
31
- export declare function cachedNotificationInboxAnswer(client: QueryClient | null, projectId: string | null | undefined): boolean | undefined;
32
- /** The flag for one project from the query cache. False when nothing cached holds it. */
33
- export declare function cachedNotificationCenter(client: QueryClient | null, projectId: string | null | undefined): boolean;
34
- /** True when any project in the query cache has the flag on. */
35
- export declare function anyCachedNotificationCenter(client: QueryClient): boolean;
36
- export declare function anyCachedNotificationInbox(client: QueryClient): boolean;
37
- /** Is the notification center on for `projectId`, or, without one, for any cached project. */
38
- export declare function useNotificationCenter(projectId?: string | null): boolean;
39
- export declare function useNotificationInboxEnabled(projectId?: string | null): boolean;
40
- /**
41
- * The inbox gate of `NotificationHost`, except while the
42
- * project's row loads. Then a cached detail or project list answers, else the
43
- * previous answer stays. So entering a flag-on project from `/projects` or
44
- * from another flag-on project does not unmount the host and subscribe Web
45
- * Push again. Only a loaded detail without the flag turns it off. A cold
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.
48
- */
49
- export declare function useNotificationHostGate(projectId?: string | null): boolean;
50
- export {};
@@ -1,151 +0,0 @@
1
- 'use client';
2
- import { qk, useFeatureFlag } from '@kortix/sdk/react';
3
- import { useQueryClient } from '@tanstack/react-query';
4
- import { useCallback, useState, useSyncExternalStore } from 'react';
5
- export const NOTIFICATION_CENTER_FLAG = 'notification_center';
6
- /** The predicate of `useFeatureFlag`: the server said exactly `true`. */
7
- export function notificationCenterOn(project) {
8
- return project?.experimental?.[NOTIFICATION_CENTER_FLAG] === true;
9
- }
10
- export function notificationInboxOn(project) {
11
- return notificationCenterOn(project) || (project?.experimental?.artifacts === true && project.experimental.artifact_comments === true);
12
- }
13
- /**
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.
17
- */
18
- export function cachedNotificationCenterAnswer(client, projectId) {
19
- return cachedFlagAnswer(client, projectId, notificationCenterOn);
20
- }
21
- function cachedFlagAnswer(client, projectId, enabled) {
22
- if (!client || !projectId)
23
- return undefined;
24
- const row = client.getQueryData(qk.project.summary(projectId));
25
- if (row)
26
- return enabled(row);
27
- const detail = client.getQueryData(qk.project.detail(projectId));
28
- if (detail?.project)
29
- return enabled(detail.project);
30
- for (const [, data] of client.getQueriesData({ queryKey: qk.projects.scope() })) {
31
- if (!Array.isArray(data))
32
- continue;
33
- const project = data.find((row) => row?.project_id === projectId);
34
- if (project)
35
- return enabled(project);
36
- }
37
- return undefined;
38
- }
39
- export function cachedNotificationInboxAnswer(client, projectId) {
40
- return cachedFlagAnswer(client, projectId, notificationInboxOn);
41
- }
42
- /** The flag for one project from the query cache. False when nothing cached holds it. */
43
- export function cachedNotificationCenter(client, projectId) {
44
- return cachedNotificationCenterAnswer(client, projectId) === true;
45
- }
46
- const [ROOT, LIST_SCOPE] = qk.projects.scope();
47
- const [, DETAIL_SCOPE, , DETAIL] = qk.project.detail('');
48
- const [, , , SUMMARY] = qk.project.summary('');
49
- /** A project-list, project-row or project-detail entry that holds a project with the flag on. */
50
- function holdsFlagOn(query, enabled) {
51
- const key = query.queryKey;
52
- const data = query.state.data;
53
- if (key[0] !== ROOT)
54
- return false;
55
- if (key[1] === LIST_SCOPE)
56
- return Array.isArray(data) && data.some(enabled);
57
- if (key[1] === DETAIL_SCOPE && key.length === 4 && key[3] === DETAIL) {
58
- return enabled(data?.project);
59
- }
60
- if (key[1] === DETAIL_SCOPE && key.length === 4 && key[3] === SUMMARY)
61
- return enabled(data);
62
- return false;
63
- }
64
- /** True when any project in the query cache has the flag on. */
65
- export function anyCachedNotificationCenter(client) {
66
- return client.getQueryCache().getAll().some((query) => holdsFlagOn(query, notificationCenterOn));
67
- }
68
- export function anyCachedNotificationInbox(client) {
69
- return client.getQueryCache().getAll().some((query) => holdsFlagOn(query, notificationInboxOn));
70
- }
71
- /**
72
- * A `useSyncExternalStore` subscription to the query cache, live only while
73
- * `active`. The cache reports synchronously, also when another component's
74
- * `useQuery` builds its query during render; the re-check waits for a
75
- * microtask so this component never updates in the middle of that render.
76
- */
77
- function useCacheSubscription(client, active) {
78
- return useCallback((onChange) => {
79
- if (!active)
80
- return () => { };
81
- let live = true;
82
- const unsubscribe = client.getQueryCache().subscribe(() => {
83
- queueMicrotask(() => {
84
- if (live)
85
- onChange();
86
- });
87
- });
88
- return () => {
89
- live = false;
90
- unsubscribe();
91
- };
92
- }, [client, active]);
93
- }
94
- /** `anyCachedNotificationCenter`, reactive. Subscribes to the cache only while `scan`. */
95
- function useAnyCachedNotificationCenter(client, scan) {
96
- return useSyncExternalStore(useCacheSubscription(client, scan), () => scan && anyCachedNotificationCenter(client), () => false);
97
- }
98
- function useAnyCachedNotificationInbox(client, scan) {
99
- return useSyncExternalStore(useCacheSubscription(client, scan), () => scan && anyCachedNotificationInbox(client), () => false);
100
- }
101
- /** Is the notification center on for `projectId`, or, without one, for any cached project. */
102
- export function useNotificationCenter(projectId) {
103
- const project = useFeatureFlag(projectId, NOTIFICATION_CENTER_FLAG).enabled;
104
- const anyProject = useAnyCachedNotificationCenter(useQueryClient(), !projectId);
105
- return projectId ? project : anyProject;
106
- }
107
- export function useNotificationInboxEnabled(projectId) {
108
- const center = useFeatureFlag(projectId, NOTIFICATION_CENTER_FLAG).enabled;
109
- const artifacts = useFeatureFlag(projectId, 'artifacts').enabled;
110
- const comments = useFeatureFlag(projectId, 'artifact_comments').enabled;
111
- const anyProject = useAnyCachedNotificationInbox(useQueryClient(), !projectId);
112
- return projectId ? center || (artifacts && comments) : anyProject;
113
- }
114
- /**
115
- * The inbox gate of `NotificationHost`, except while the
116
- * project's row loads. Then a cached detail or project list answers, else the
117
- * previous answer stays. So entering a flag-on project from `/projects` or
118
- * from another flag-on project does not unmount the host and subscribe Web
119
- * Push again. Only a loaded detail without the flag turns it off. A cold
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.
122
- */
123
- export function useNotificationHostGate(projectId) {
124
- const client = useQueryClient();
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
127
- // observer. An observer added a detail query without a queryFn (also for the
128
- // empty id of a page outside any project), and every refetch of it logged
129
- // "No queryFn was passed".
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';
135
- const flag = {
136
- isLoading: !rowLoaded && !detailLoaded,
137
- enabled: notificationInboxOn(rowLoaded ? row?.data : detail?.data?.project),
138
- };
139
- const anyProject = useAnyCachedNotificationInbox(client, !projectId);
140
- const [previous, setPrevious] = useState(false);
141
- let answer = anyProject;
142
- if (projectId) {
143
- answer = flag.isLoading
144
- ? (cachedNotificationInboxAnswer(client, projectId) ?? previous)
145
- : flag.enabled;
146
- }
147
- // The answer from an earlier render: React's derived-state pattern.
148
- if (answer !== previous)
149
- setPrevious(answer);
150
- return answer;
151
- }