@k2b/cloud 0.23.0 → 0.25.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.
- package/package.json +3 -2
- package/src/_internal/capabilities.ts +230 -75
- package/src/_internal/define-app.ts +12 -3
- package/src/_internal/fixtures/filesv2-manifest-cloud-v0.29.0.json +887 -0
- package/src/_internal/page-responses.ts +1 -1
- package/src/_internal/registry.ts +78 -3
- package/src/access/PermissionEditor.tsx +32 -11
- package/src/access/managers.ts +32 -0
- package/src/access/messages.ts +6 -0
- package/src/ai/chat/blocks.tsx +2 -1
- package/src/ai/chat/messages.ts +6 -0
- package/src/ai/client/controller.ts +65 -20
- package/src/ai/client/transport.ts +5 -5
- package/src/ai/code-mode-skill.ts +2 -2
- package/src/ai/index.ts +0 -7
- package/src/ai/live-events.ts +1 -262
- package/src/ai/live.ts +31 -2
- package/src/ai/memory-learning.ts +7 -12
- package/src/ai/memory-workflow-evidence.ts +10 -2
- package/src/ai/migrate.ts +80 -18
- package/src/ai/model-access.ts +4 -2
- package/src/ai/prefs.ts +19 -5
- package/src/ai/projects.ts +5 -2
- package/src/ai/runtime.ts +1 -6
- package/src/ai/skills.ts +5 -2
- package/src/ai/solid.ts +0 -5
- package/src/ai/store.ts +14 -0
- package/src/api/help.ts +2 -2
- package/src/api/pwa-phone.ts +10 -3
- package/src/api/search/schemas.ts +34 -0
- package/src/api/search.ts +118 -50
- package/src/browser/CloudResourceSearch.browser-harness.tsx +11 -0
- package/src/browser/CloudResourceSearch.tsx +208 -80
- package/src/browser/FileChooser.tsx +600 -0
- package/src/browser/choose-files.browser-harness.tsx +32 -0
- package/src/browser/choose-files.tsx +70 -0
- package/src/browser/file-chooser-messages.ts +86 -0
- package/src/browser/file-providers.ts +217 -0
- package/src/browser/files.tsx +23 -0
- package/src/browser/resource-search-messages.ts +15 -2
- package/src/browser/search-stream.ts +151 -0
- package/src/cli/admin/account-administration.ts +2 -2
- package/src/contracts/capabilities.ts +89 -24
- package/src/contracts/capability-compatibility.ts +28 -14
- package/src/contracts/file-provider.ts +158 -0
- package/src/contracts/index.ts +1 -0
- package/src/events/live-engine.ts +11 -7
- package/src/events/live.ts +32 -32
- package/src/server/help.ts +3 -3
- package/src/server/index.ts +1 -0
- package/src/server/services/access.ts +44 -11
- package/src/server/services/index.ts +1 -0
- package/src/services/index.ts +1 -1
- package/src/services/outbox.ts +29 -115
- package/src/services/pdf/markdown.ts +22 -2
- package/src/services/pwa-devices.ts +74 -8
- package/src/shared/markdown/formula.ts +122 -26
- package/src/shared/markdown/index.ts +27 -14
- package/src/ssr/PwaLayout.tsx +2 -1
- package/src/ssr/platform-messages.ts +2 -2
- package/src/styles/file-chooser.css +169 -0
- package/src/styles/global.css +1 -0
- package/src/styles/resource-search.css +19 -0
- package/src/ai/client/live-connection.ts +0 -141
- package/src/ai/live-messages.ts +0 -45
- package/src/ai/live-outbox.ts +0 -102
- package/src/ai/live-routes.ts +0 -412
- package/src/shared/markdown/extensions/info-blocks.ts +0 -79
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Info Blocks Extension for Marked
|
|
3
|
-
*
|
|
4
|
-
* Renders custom info blocks with syntax:
|
|
5
|
-
* :::note
|
|
6
|
-
* Content here
|
|
7
|
-
* :::
|
|
8
|
-
*
|
|
9
|
-
* The type follows the colons directly — `::: note` with a space does not
|
|
10
|
-
* match. An optional argument after the type overrides the label:
|
|
11
|
-
* `:::warning Before deleting`.
|
|
12
|
-
*
|
|
13
|
-
* Supported types: note, info, success, warning, danger
|
|
14
|
-
*
|
|
15
|
-
* Every block renders as the calm NoticeCard: the tone tints the surface, the
|
|
16
|
-
* text stays neutral, and there is no icon. An explicit title is the visible
|
|
17
|
-
* heading and names the block, as on a NoticeCard; without one the type name
|
|
18
|
-
* is announced to screen readers only. Email drops the visually hidden class,
|
|
19
|
-
* so a titled block must not carry the type name as well.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
import { NOTICE_CARD_CLASSES, type NoticeTone } from "@k2b/ui";
|
|
23
|
-
import type { MarkedExtension, Tokens } from "marked";
|
|
24
|
-
import { escapeHtml } from "../shared";
|
|
25
|
-
|
|
26
|
-
type BlockType = "note" | "info" | "success" | "warning" | "danger";
|
|
27
|
-
|
|
28
|
-
const blockConfig: Record<BlockType, { label: string; tone: NoticeTone }> = {
|
|
29
|
-
note: { label: "Note", tone: "neutral" },
|
|
30
|
-
info: { label: "Info", tone: "info" },
|
|
31
|
-
success: { label: "Success", tone: "success" },
|
|
32
|
-
warning: { label: "Warning", tone: "warning" },
|
|
33
|
-
danger: { label: "Danger", tone: "danger" },
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const renderInlineContent = (content: string): string => {
|
|
37
|
-
return content
|
|
38
|
-
.replace(/\*\*(.*?)\*\*/g, "<strong>$1</strong>")
|
|
39
|
-
.replace(/(?<!\*)\*([^*]+)\*(?!\*)/g, "<em>$1</em>")
|
|
40
|
-
.replace(/`([^`]+)`/g, '<code class="bg-black/10 dark:bg-white/10 px-1 py-0.5 rounded text-sm">$1</code>')
|
|
41
|
-
.replace(/\n/g, "<br>");
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export function infoBlocksExtension(): MarkedExtension {
|
|
45
|
-
return {
|
|
46
|
-
extensions: [
|
|
47
|
-
{
|
|
48
|
-
name: "infoBlock",
|
|
49
|
-
level: "block",
|
|
50
|
-
start(src: string) {
|
|
51
|
-
return src.match(/^:::/)?.index;
|
|
52
|
-
},
|
|
53
|
-
tokenizer(src: string) {
|
|
54
|
-
const match = src.match(/^:::(\w+)(?:[ \t]+([^\n]+))?\s*\n([\s\S]*?)\n:::/);
|
|
55
|
-
if (!match) return undefined;
|
|
56
|
-
|
|
57
|
-
const typeStr = match[1]?.toLowerCase() as BlockType;
|
|
58
|
-
if (!blockConfig[typeStr]) return undefined;
|
|
59
|
-
|
|
60
|
-
return {
|
|
61
|
-
type: "infoBlock",
|
|
62
|
-
raw: match[0],
|
|
63
|
-
blockType: typeStr,
|
|
64
|
-
title: match[2]?.trim(),
|
|
65
|
-
content: match[3]?.trim() ?? "",
|
|
66
|
-
};
|
|
67
|
-
},
|
|
68
|
-
renderer(token: Tokens.Generic) {
|
|
69
|
-
const config = blockConfig[token.blockType as BlockType];
|
|
70
|
-
const body = renderInlineContent(escapeHtml(token.content as string));
|
|
71
|
-
const name = token.title
|
|
72
|
-
? `<p class="${NOTICE_CARD_CLASSES.title}">${escapeHtml(token.title as string)}</p>`
|
|
73
|
-
: `<span class="sr-only">${config.label}: </span>`;
|
|
74
|
-
return `<aside class="${NOTICE_CARD_CLASSES.root}" data-tone="${config.tone}" role="note">${name}<div class="${NOTICE_CARD_CLASSES.body}">${body}</div></aside>`;
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
],
|
|
78
|
-
};
|
|
79
|
-
}
|