@k2b/cloud 0.26.0 → 0.28.0

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 (121) hide show
  1. package/package.json +3 -3
  2. package/src/_internal/define-app.ts +8 -1
  3. package/src/_internal/process-identity.ts +7 -1
  4. package/src/_internal/registry-validation.ts +3 -0
  5. package/src/_internal/runtime-context.ts +1 -0
  6. package/src/ai/admin.ts +1 -0
  7. package/src/ai/browser-code-contracts.ts +46 -64
  8. package/src/ai/browser.ts +9 -1
  9. package/src/ai/capabilities.ts +82 -22
  10. package/src/ai/chat/blocks.tsx +16 -7
  11. package/src/ai/chat/builtin-tools.tsx +31 -23
  12. package/src/ai/chat/file-tools.tsx +4 -1
  13. package/src/ai/chat/live-turn.browser-harness.tsx +15 -5
  14. package/src/ai/chat/message-actions.tsx +123 -101
  15. package/src/ai/chat/message-utils.ts +30 -1
  16. package/src/ai/chat/messages.ts +206 -2
  17. package/src/ai/chat/presentation.tsx +94 -28
  18. package/src/ai/chat/tool-groups.ts +1 -1
  19. package/src/ai/chat/turn-error.ts +21 -0
  20. package/src/ai/chat/turn-view.tsx +102 -16
  21. package/src/ai/chat/user-message.tsx +19 -14
  22. package/src/ai/chat/visual-tools.tsx +1 -1
  23. package/src/ai/client/controller.ts +83 -37
  24. package/src/ai/client/file-source.ts +20 -3
  25. package/src/ai/client/projection.ts +7 -2
  26. package/src/ai/code-mode-skill.ts +32 -36
  27. package/src/ai/code-runtime-tools.ts +14 -1
  28. package/src/ai/code-source-contracts.ts +56 -6
  29. package/src/ai/code-source-tools.ts +10 -3
  30. package/src/ai/credentials.ts +17 -3
  31. package/src/ai/data-analysis-skill.ts +3 -3
  32. package/src/ai/default-tools.ts +15 -16
  33. package/src/ai/executor.ts +281 -141
  34. package/src/ai/file-context.ts +14 -2
  35. package/src/ai/file-tools.ts +17 -3
  36. package/src/ai/files-store.ts +134 -11
  37. package/src/ai/grids-skill.ts +2 -2
  38. package/src/ai/index.ts +9 -0
  39. package/src/ai/memories.ts +14 -0
  40. package/src/ai/migrate.ts +125 -0
  41. package/src/ai/model-request-settings.ts +98 -0
  42. package/src/ai/open-tool-calls.ts +87 -0
  43. package/src/ai/protocol.ts +6 -0
  44. package/src/ai/provider.ts +7 -1
  45. package/src/ai/quota-provider.ts +2 -2
  46. package/src/ai/request-headers.ts +117 -0
  47. package/src/ai/routes.ts +40 -6
  48. package/src/ai/run-timeout.ts +4 -5
  49. package/src/ai/runtime.ts +9 -1
  50. package/src/ai/settings.ts +19 -2
  51. package/src/ai/skill-seeds.ts +35 -7
  52. package/src/ai/skills.ts +26 -0
  53. package/src/ai/solid.ts +1 -1
  54. package/src/ai/store.ts +155 -71
  55. package/src/ai/stream.ts +180 -37
  56. package/src/ai/structured.ts +20 -5
  57. package/src/ai/system-prompt.ts +8 -0
  58. package/src/ai/tool-call-names.ts +45 -0
  59. package/src/ai/turn-failure.ts +100 -0
  60. package/src/ai/turn-policy.ts +248 -0
  61. package/src/ai/types.ts +52 -4
  62. package/src/api/admin-ai-quotas.ts +36 -1
  63. package/src/api/admin-core-settings.ts +16 -23
  64. package/src/api/admin-outgoing-mail.ts +242 -0
  65. package/src/api/index.ts +2 -0
  66. package/src/browser/FileChooser.tsx +11 -0
  67. package/src/browser/file-chooser-messages.ts +2 -0
  68. package/src/cli/admin/ai-quotas.ts +70 -1
  69. package/src/cli/admin/index.ts +8 -0
  70. package/src/cli/admin/notifications.ts +6 -0
  71. package/src/cli/admin/outgoing-mail.ts +215 -0
  72. package/src/contracts/app.ts +2 -0
  73. package/src/contracts/index.ts +1 -0
  74. package/src/contracts/outgoing-mail.ts +265 -0
  75. package/src/contracts/registry.ts +2 -0
  76. package/src/services/help/store.ts +2 -1
  77. package/src/services/index.ts +13 -0
  78. package/src/services/notifications/batches.ts +139 -79
  79. package/src/services/notifications/channels.ts +33 -13
  80. package/src/services/notifications/dispatcher.ts +57 -5
  81. package/src/services/notifications/email-frame.fixture.html +51 -0
  82. package/src/services/notifications/{email.ts → email-frame.ts} +12 -45
  83. package/src/services/notifications/email-mail.ts +101 -0
  84. package/src/services/notifications/index.ts +49 -36
  85. package/src/services/notifications/observability.ts +9 -1
  86. package/src/services/notifications/platform.ts +1 -1
  87. package/src/services/notifications/runtime.ts +9 -3
  88. package/src/services/outgoing-mail/admin.ts +84 -0
  89. package/src/services/outgoing-mail/attachments.ts +135 -0
  90. package/src/services/outgoing-mail/bulk.ts +11 -0
  91. package/src/services/outgoing-mail/dispatcher.ts +231 -0
  92. package/src/services/outgoing-mail/drain.ts +60 -0
  93. package/src/services/outgoing-mail/enqueue.ts +180 -0
  94. package/src/services/outgoing-mail/index.ts +112 -0
  95. package/src/services/outgoing-mail/message.ts +14 -0
  96. package/src/services/outgoing-mail/messages.ts +431 -0
  97. package/src/services/outgoing-mail/retention.ts +48 -0
  98. package/src/services/outgoing-mail/runtime.ts +72 -0
  99. package/src/services/outgoing-mail/send.ts +130 -0
  100. package/src/services/outgoing-mail/store.ts +397 -0
  101. package/src/services/outgoing-mail/sync.ts +39 -0
  102. package/src/services/outgoing-mail/test-send.ts +40 -0
  103. package/src/services/outgoing-mail/transport.ts +17 -0
  104. package/src/services/pdf/markdown.ts +22 -4
  105. package/src/services/postgres.ts +15 -0
  106. package/src/services/settings/core-settings.ts +19 -38
  107. package/src/services/settings/store.ts +5 -1
  108. package/src/shared/ai-model-request-settings.ts +21 -0
  109. package/src/shared/ai-platform-prompt.ts +49 -5
  110. package/src/shared/ai-request-options.ts +185 -0
  111. package/src/shared/markdown/extensions/links.ts +28 -20
  112. package/src/shared/markdown/index.ts +14 -5
  113. package/src/shared/markdown/shared.ts +0 -7
  114. package/src/ssr/GlobalAnnouncements.island.tsx +1 -1
  115. package/src/ssr/admin-navigation.ts +1 -1
  116. package/src/ssr/platform-messages.ts +3 -1
  117. package/src/ssr/workspace-navigation.ts +7 -1
  118. package/src/styles/effects.css +15 -17
  119. package/src/styles/tokens.css +2 -0
  120. package/src/styles/utilities-markdown-editor.css +4 -39
  121. package/src/styles/utilities-markdown-table.css +14 -17
@@ -410,49 +410,14 @@
410
410
  @apply bg-zinc-200/60 dark:bg-zinc-700/50 rounded-sm;
411
411
  }
412
412
 
413
- /* Links — color + underline, both width-safe */
413
+ /* Links — the rendered web link's thin accent underline, width-safe */
414
414
  .md-link {
415
- @apply text-blue-600 dark:text-blue-400 underline;
415
+ text-decoration-line: underline;
416
+ text-decoration-thickness: 1px;
417
+ text-decoration-color: color-mix(in srgb, var(--k2b-link-accent) 55%, transparent);
416
418
  text-underline-offset: 2px;
417
419
  }
418
420
 
419
- /* Rendered links use one anchor for their complete visible hit area. */
420
- .md-link-widget {
421
- display: inline-flex;
422
- align-items: baseline;
423
- gap: 0.125rem;
424
- color: inherit;
425
- font-weight: 600;
426
- text-decoration: none;
427
- transition: color 150ms ease;
428
- }
429
-
430
- .md-link-widget:hover {
431
- color: var(--ui-app-accent-text);
432
- }
433
-
434
- /* The brackets, weight and icon already mark the widget as a link, so it
435
- keeps no underline inside MarkdownView, the same as in Assistant chat. */
436
- .k2b-ui .k2b-content-markdown a.md-link-widget {
437
- text-decoration: none;
438
- }
439
-
440
- .md-link-widget:focus-visible {
441
- border-radius: 0.125rem;
442
- outline: var(--k2b-focus-width) solid var(--ui-app-accent-border);
443
- outline-offset: var(--k2b-focus-offset);
444
- }
445
-
446
- .md-link-icon {
447
- opacity: 0.7;
448
- transition: opacity 150ms ease;
449
- }
450
-
451
- .md-link-widget:hover .md-link-icon,
452
- .md-link-widget:focus-visible .md-link-icon {
453
- opacity: 1;
454
- }
455
-
456
421
  /* Blockquote — color + inset box-shadow for the left bar (box-shadow
457
422
  doesn't affect layout, unlike border-left or padding-left). The bar
458
423
  sits visually outside the text column edge so prose stays aligned. */
@@ -1,9 +1,14 @@
1
1
  /* Markdown tables use the same hairline language as @k2b/ui MarkdownView:
2
2
  no frame or header fill, a stronger line under the header, hairline row
3
- separators, and the outer columns flush with the prose. Used by both the
3
+ separators, and the outer text flush with the prose. Used by both the
4
4
  server-side `marked` renderer and the CodeMirror table widget so read-mode
5
5
  and edit-mode look identical.
6
6
 
7
+ The table bleeds `--md-table-bleed` past the prose on both sides, and every
8
+ cell pads its text by the same amount. So the outer text stays flush, the
9
+ columns sit twice the bleed apart, and the header line, row lines, row hover
10
+ and column band all share one width: text plus the bleed on every side.
11
+
7
12
  Three-layer markup:
8
13
  <div class="md-table-wrap"> ← horizontal scroll owner
9
14
  <table class="md-table"> ← table layout
@@ -11,16 +16,17 @@
11
16
  <span class="md-table-cell"> ← content + alignment owner */
12
17
 
13
18
  .md-table-wrap {
19
+ --md-table-bleed: 0.5rem;
14
20
  overflow: clip;
15
- margin-top: 0.5rem;
16
- margin-bottom: 0.5rem;
21
+ /* The header cell's top padding takes the place of a top margin. */
22
+ margin: 0 calc(-1 * var(--md-table-bleed)) 0.5rem;
17
23
  }
18
24
 
19
25
  /* Inside MarkdownView a table takes the same block spacing as its own
20
26
  tables, so two tables in a row do not read as one. Hosts such as Help keep
21
27
  their own spacing. */
22
28
  :where(.k2b-ui .k2b-content-markdown) .md-table-wrap {
23
- margin-block: 1em;
29
+ margin-block: calc(1em - var(--md-table-bleed)) 1em;
24
30
  }
25
31
 
26
32
  .md-table {
@@ -70,7 +76,7 @@
70
76
  gap: 0.35rem;
71
77
  box-sizing: border-box;
72
78
  min-height: 2rem;
73
- padding: 0.5rem 0.75rem;
79
+ padding: 0.5rem var(--md-table-bleed, 0.5rem);
74
80
  border: 0;
75
81
  border-radius: 0;
76
82
  background: transparent;
@@ -88,21 +94,10 @@
88
94
  }
89
95
 
90
96
  .md-table thead .md-table-cell {
91
- padding-top: 0;
92
97
  background: transparent;
93
98
  font-weight: 600;
94
99
  }
95
100
 
96
- .md-table th:first-child > .md-table-cell,
97
- .md-table td:first-child > .md-table-cell {
98
- padding-left: 0;
99
- }
100
-
101
- .md-table th:last-child > .md-table-cell,
102
- .md-table td:last-child > .md-table-cell {
103
- padding-right: 0;
104
- }
105
-
106
101
  /* Inside MarkdownView the span stays the only padding owner. */
107
102
  .k2b-ui .k2b-content-markdown .md-table th,
108
103
  .k2b-ui .k2b-content-markdown .md-table td {
@@ -147,7 +142,9 @@
147
142
  }
148
143
 
149
144
  /* A cell-sized pseudo-element can span the table vertically without
150
- changing its layout. The scroll wrapper clips it to the table frame. */
145
+ changing its layout. The scroll wrapper clips it to the table frame, so
146
+ the band, like the row, reaches the bleed above the header text and
147
+ below the last row. */
151
148
  .md-table :is(th, td)::after {
152
149
  content: "";
153
150
  position: absolute;