@k2b/cloud 0.29.1 → 0.31.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 (136) hide show
  1. package/package.json +4 -2
  2. package/src/_internal/app-presentation.ts +22 -1
  3. package/src/_internal/app-roles.ts +14 -0
  4. package/src/_internal/capabilities.ts +113 -5
  5. package/src/_internal/capability-sentences.ts +413 -0
  6. package/src/_internal/define-app.ts +24 -5
  7. package/src/_internal/registry-validation.ts +5 -0
  8. package/src/_internal/registry.ts +50 -6
  9. package/src/_internal/widget-declarations.ts +53 -0
  10. package/src/access/PermissionEditor.tsx +43 -24
  11. package/src/ai/app-skill-store.ts +298 -0
  12. package/src/ai/app-skills.ts +105 -0
  13. package/src/ai/approval-routes.ts +40 -4
  14. package/src/ai/approvals.ts +68 -10
  15. package/src/ai/browser.ts +10 -0
  16. package/src/ai/capabilities.ts +68 -9
  17. package/src/ai/chart-block.ts +380 -0
  18. package/src/ai/chat/action-sentences.ts +49 -0
  19. package/src/ai/chat/blocks.tsx +97 -40
  20. package/src/ai/chat/chart-block.tsx +79 -0
  21. package/src/ai/chat/live-turn.browser-harness.tsx +4 -1
  22. package/src/ai/chat/message-actions.tsx +3 -1
  23. package/src/ai/chat/message-utils.ts +3 -0
  24. package/src/ai/chat/messages.ts +26 -2
  25. package/src/ai/chat/tool-groups.ts +66 -12
  26. package/src/ai/chat/tool-names.ts +6 -2
  27. package/src/ai/chat/turn-layout.ts +10 -2
  28. package/src/ai/chat/turn-view.tsx +123 -36
  29. package/src/ai/chat/web-tools.tsx +95 -1
  30. package/src/ai/client/controller.ts +6 -3
  31. package/src/ai/code-runtime-tools.ts +109 -61
  32. package/src/ai/code-source-contracts.ts +25 -21
  33. package/src/ai/code-source-tools.ts +3 -1
  34. package/src/ai/default-tool-contracts.ts +198 -0
  35. package/src/ai/default-tools.ts +25 -1
  36. package/src/ai/executor.ts +189 -35
  37. package/src/ai/fetch-file-tool.ts +41 -4
  38. package/src/ai/firecrawl-tools.ts +87 -4
  39. package/src/ai/index.ts +17 -1
  40. package/src/ai/migrate.ts +172 -14
  41. package/src/ai/protocol.ts +22 -1
  42. package/src/ai/routes.ts +11 -0
  43. package/src/ai/runtime-tools.ts +1 -0
  44. package/src/ai/runtime.ts +46 -7
  45. package/src/ai/skill-content.ts +54 -0
  46. package/src/ai/skills-routes.ts +22 -13
  47. package/src/ai/skills.ts +177 -231
  48. package/src/ai/store.ts +66 -1
  49. package/src/ai/tool-audit.ts +11 -1
  50. package/src/ai/tool-sentences.ts +38 -0
  51. package/src/ai/tools.ts +91 -3
  52. package/src/ai/types.ts +47 -1
  53. package/src/ai/web-provenance.ts +103 -0
  54. package/src/api/admin-ai-skills.ts +35 -16
  55. package/src/api/capabilities.ts +3 -2
  56. package/src/api/fanout.ts +128 -0
  57. package/src/api/help.ts +8 -3
  58. package/src/api/mcp.ts +4 -1
  59. package/src/api/search.ts +31 -106
  60. package/src/api/widgets.ts +291 -101
  61. package/src/browser/CloudResourceSearch.browser-harness.tsx +1 -1
  62. package/src/browser/CloudResourceSearch.tsx +1 -1
  63. package/src/browser/command-shortcuts.ts +21 -6
  64. package/src/browser/ndjson.ts +34 -0
  65. package/src/browser/reload.ts +46 -0
  66. package/src/browser/search-stream.ts +4 -26
  67. package/src/browser/spotlight-position.ts +4 -1
  68. package/src/browser/widgets.ts +30 -0
  69. package/src/capabilities/executions.ts +3 -0
  70. package/src/capabilities/server.ts +20 -2
  71. package/src/cli/access.ts +48 -14
  72. package/src/cli/admin/ai-skills.ts +59 -39
  73. package/src/cli/commands.ts +20 -0
  74. package/src/cli/index.ts +16 -0
  75. package/src/cli/plugin.ts +30 -0
  76. package/src/contracts/announcement-cookie.ts +62 -0
  77. package/src/contracts/announcements.ts +14 -52
  78. package/src/contracts/app.ts +34 -2
  79. package/src/contracts/capabilities.ts +24 -0
  80. package/src/contracts/pwa-paths.ts +7 -2
  81. package/src/contracts/pwa.ts +2 -7
  82. package/src/contracts/registry.ts +10 -1
  83. package/src/contracts/shared.ts +5 -0
  84. package/src/contracts/widgets.ts +67 -2
  85. package/src/desktop/solid.tsx +6 -7
  86. package/src/index.ts +1 -0
  87. package/src/server/help.ts +8 -1
  88. package/src/server/index.ts +1 -0
  89. package/src/server/widget-request.ts +27 -0
  90. package/src/services/accounts/users.ts +15 -0
  91. package/src/services/approvals/index.ts +225 -0
  92. package/src/services/approvals/migrate.ts +33 -0
  93. package/src/services/help/index.ts +18 -5
  94. package/src/services/help/types.ts +3 -2
  95. package/src/services/identity/constants.ts +2 -0
  96. package/src/services/identity/key-ring.ts +123 -42
  97. package/src/services/identity/runtime-config.ts +13 -2
  98. package/src/shared/app-presentation.ts +11 -0
  99. package/src/shared/email-html.ts +43 -8
  100. package/src/ssr/AdminLayout.tsx +4 -7
  101. package/src/ssr/AppLaunchpad.island.tsx +1 -1
  102. package/src/ssr/AppLaunchpadPanel.tsx +12 -3
  103. package/src/ssr/GlobalAnnouncements.island.tsx +2 -2
  104. package/src/ssr/GlobalSearchDialog.tsx +1 -43
  105. package/src/ssr/GlobalSearchTrigger.island.tsx +12 -3
  106. package/src/ssr/Layout.tsx +38 -14
  107. package/src/ssr/LayoutFooter.tsx +1 -1
  108. package/src/ssr/LayoutHeader.tsx +17 -20
  109. package/src/ssr/LayoutHelp.tsx +1 -1
  110. package/src/ssr/LayoutHelpTrigger.island.tsx +1 -1
  111. package/src/ssr/LayoutRail.tsx +1 -2
  112. package/src/ssr/PageTrail.tsx +23 -0
  113. package/src/ssr/PageTrailRow.island.tsx +20 -0
  114. package/src/ssr/PageTrailRuntime.island.tsx +26 -0
  115. package/src/ssr/ProfilePreferences.island.tsx +7 -3
  116. package/src/ssr/PwaRuntime.island.tsx +1 -1
  117. package/src/ssr/app-navigation.ts +5 -7
  118. package/src/ssr/global-search-host.tsx +55 -0
  119. package/src/ssr/help.ts +3 -3
  120. package/src/ssr/islands/index.ts +1 -0
  121. package/src/ssr/layout-runtime.ts +60 -0
  122. package/src/ssr/mobile-menu-history.ts +1 -1
  123. package/src/ssr/page-trail-runtime.ts +313 -0
  124. package/src/ssr/page-trail.browser-harness.tsx +216 -0
  125. package/src/ssr/page-trail.ts +59 -0
  126. package/src/ssr/platform-messages.ts +4 -0
  127. package/src/ssr/rail-context.ts +4 -3
  128. package/src/ssr/runtime.ts +14 -1
  129. package/src/styles/effects.css +21 -4
  130. package/src/styles/global.css +35 -2
  131. package/src/styles/utilities-layout.css +24 -1
  132. package/src/styles/utilities-navigation.css +6 -18
  133. package/src/ai/code-mode-skill.ts +0 -114
  134. package/src/ai/data-analysis-skill.ts +0 -10
  135. package/src/ai/grids-skill.ts +0 -158
  136. package/src/ai/skill-seeds.ts +0 -560
@@ -51,7 +51,7 @@
51
51
  }
52
52
  }
53
53
 
54
- /* Expanded work: one indent, one size, no lines or boxes; intermediate texts are quiet paragraphs. */
54
+ /* Expanded work: at the work line's left edge, one size, no lines or boxes; intermediate texts are quiet paragraphs. */
55
55
  .k2b-ui .ai-turn-steps {
56
56
  display: flex;
57
57
  min-width: 0;
@@ -60,20 +60,37 @@
60
60
 
61
61
  .k2b-ui .ai-turn-steps__text {
62
62
  padding-block: 0.25rem;
63
+ }
64
+
65
+ /* A live status in place 3 reads like those texts. It keeps the place's line height, so a status and the text that
66
+ replaces it line up, and the same text never grows when it turns quiet. */
67
+ .k2b-ui :is(.ai-turn-steps__text, .ai-turn__text--status) {
63
68
  color: var(--k2b-text-muted);
64
69
  }
65
70
 
66
- .k2b-ui .ai-turn-steps__text .assistant-markdown-block,
67
- .k2b-ui .ai-turn-steps__text .assistant-markdown-block :where(h1, h2, h3, h4, h5, h6) {
71
+ .k2b-ui :is(.ai-turn-steps__text, .ai-turn__text--status) .assistant-markdown-block,
72
+ .k2b-ui :is(.ai-turn-steps__text, .ai-turn__text--status) .assistant-markdown-block :where(h1, h2, h3, h4, h5, h6) {
68
73
  color: inherit;
69
74
  font-size: 0.75rem;
75
+ }
76
+
77
+ .k2b-ui .ai-turn-steps__text .assistant-markdown-block,
78
+ .k2b-ui .ai-turn-steps__text .assistant-markdown-block :where(h1, h2, h3, h4, h5, h6) {
70
79
  line-height: 1.55;
71
80
  }
72
81
 
73
- .k2b-ui .ai-turn-steps__text .assistant-markdown-block :where(p, ul, ol, pre, blockquote) {
82
+ .k2b-ui :is(.ai-turn-steps__text, .ai-turn__text--status) .assistant-markdown-block :where(p, ul, ol, pre, blockquote) {
74
83
  margin-block: 0.375rem;
75
84
  }
76
85
 
86
+ .k2b-ui .ai-turn__text--status .assistant-markdown-block > :where(:first-child) {
87
+ margin-top: 0;
88
+ }
89
+
90
+ .k2b-ui .ai-turn__text--status .assistant-markdown-block > :where(:last-child) {
91
+ margin-bottom: 0;
92
+ }
93
+
77
94
  .k2b-ui .ai-turn-steps__thought {
78
95
  margin: 0;
79
96
  color: var(--k2b-text-muted);
@@ -281,8 +281,12 @@ solid-island {
281
281
  }
282
282
  }
283
283
 
284
- /* Cloud has exactly two shell modes: mobile below lg, desktop from lg. */
285
- @media (max-width: 1023px) {
284
+ /* Cloud has three shell modes. Phones, below md, get the header and no rail.
285
+ From md, signed-in people get the rail instead of the header: up to 2xl the
286
+ app area meets the window's top, right and bottom edges, and from 2xl it is
287
+ a card with the shell spacing. Anonymous pages keep the header and the card
288
+ from md. */
289
+ @media (max-width: 767px) {
286
290
  .cloud-app-canvas {
287
291
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
288
292
  }
@@ -309,6 +313,35 @@ solid-island {
309
313
 
310
314
  }
311
315
 
316
+ /* Flush: the app area is one opaque surface from the rail to the window's
317
+ edges, without padding, radius, shadow, or border. The rail keeps the app
318
+ canvas, so the change of surface alone separates the two; no line does. The
319
+ outermost workspace and the notices above it lose their frame, so nothing
320
+ draws a box inside the app area. */
321
+ @media (min-width: 768px) and (max-width: 1535px) {
322
+ .cloud-app-canvas[data-layout-authenticated] {
323
+ padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
324
+ }
325
+ .cloud-app-canvas[data-layout-authenticated] > .layout-rail {
326
+ width: 3rem;
327
+ margin-inline-start: 0;
328
+ padding-bottom: var(--ui-space-shell);
329
+ }
330
+ .cloud-app-canvas[data-layout-authenticated] > .layout-shell-content {
331
+ gap: 0;
332
+ background: var(--k2b-surface);
333
+ }
334
+ .cloud-app-canvas[data-layout-authenticated] .layout-content-main .k2b-app-workspace:not(.k2b-app-workspace *) {
335
+ border: 0;
336
+ border-radius: 0;
337
+ box-shadow: none;
338
+ }
339
+ .cloud-app-canvas[data-layout-authenticated] > .layout-shell-content > :not(.layout-content-main) .k2b-notice-card {
340
+ border: 0;
341
+ border-radius: 0;
342
+ }
343
+ }
344
+
312
345
  .cloud-mobile-menu .k2b-panel-dialog__header {
313
346
  gap: .5rem;
314
347
  padding-inline: 1rem;
@@ -238,7 +238,7 @@
238
238
  }
239
239
 
240
240
  /* Shared shell frame and overview composition. */
241
- @media (min-width: 1024px) {
241
+ @media (min-width: 768px) {
242
242
  .cloud-app-canvas .layout-header {
243
243
  padding: 0.375rem 0.75rem 0.375rem 1.125rem;
244
244
  border-color: transparent;
@@ -601,3 +601,26 @@
601
601
  .dark .panel-dialog-tabs > button[aria-pressed="true"] {
602
602
  color: var(--color-zinc-50);
603
603
  }
604
+
605
+ /* The shell's row for the way up on pages without a workspace: the page title
606
+ with "‹ Parent" or the path above it, 46 px high like a workspace head and
607
+ without a line under it. It shows only on a page with a page above it; a
608
+ workspace's head or the page's own `PageTrail` takes its place. */
609
+ .layout-page-head {
610
+ display: none;
611
+ min-height: 2.875rem;
612
+ flex: none;
613
+ align-items: center;
614
+ padding: 0.25rem 0.5rem;
615
+ }
616
+
617
+ .layout-shell-content:not(:has(.layout-content-main .k2b-app-workspace, .k2b-page-title:not([data-fallback]))) .layout-page-head[data-trail="up"] {
618
+ display: flex;
619
+ }
620
+
621
+ /* After going up, the row that led down to where the person came from stays
622
+ marked, with the hover tint and nothing that moves. */
623
+ [data-page-trail-recent],
624
+ [data-page-trail-recent] > :is(td, th) {
625
+ background-color: var(--ui-hover);
626
+ }
@@ -829,18 +829,15 @@
829
829
  }
830
830
 
831
831
  /* Profile preferences stay Cloud-owned because their placement follows the
832
- global shell. Width, height, and pointer media queries select an already
833
- server-rendered variant; no client layout state or placeholder is needed. */
832
+ global shell: the avatar is the last control of the rail. Pointer media
833
+ queries select an already server-rendered variant; no client layout state
834
+ or placeholder is needed. */
834
835
  .layout-profile-preferences {
835
836
  position: relative;
836
837
  display: inline-flex;
837
838
  flex: none;
838
839
  }
839
840
 
840
- .layout-profile-preferences[data-placement="rail"] {
841
- display: none;
842
- }
843
-
844
841
  .layout-profile-preferences__link,
845
842
  .layout-profile-preferences__dropdown-trigger {
846
843
  display: none;
@@ -868,9 +865,12 @@
868
865
  box-shadow: var(--ui-focus);
869
866
  }
870
867
 
868
+ /* Beside the rail, growing upward from the avatar. */
871
869
  .layout-profile-preferences__panel {
872
870
  position: absolute;
873
871
  z-index: 100;
872
+ bottom: 0;
873
+ left: 100%;
874
874
  display: none;
875
875
  width: min(14rem, calc(100vw - 1rem));
876
876
  flex-direction: column;
@@ -887,16 +887,6 @@
887
887
  color: var(--color-zinc-300);
888
888
  }
889
889
 
890
- .layout-profile-preferences[data-placement="header"] .layout-profile-preferences__panel {
891
- top: 100%;
892
- right: 0;
893
- }
894
-
895
- .layout-profile-preferences[data-placement="rail"] .layout-profile-preferences__panel {
896
- bottom: 0;
897
- left: 100%;
898
- }
899
-
900
890
  .layout-profile-preferences:focus-within .layout-profile-preferences__panel {
901
891
  opacity: 1;
902
892
  visibility: visible;
@@ -923,9 +913,7 @@
923
913
  visibility: visible;
924
914
  pointer-events: auto;
925
915
  }
926
- }
927
916
 
928
- @media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
929
917
  .layout-profile-preferences__link,
930
918
  .layout-profile-preferences__panel {
931
919
  display: flex;