deepspace 0.10.1 → 0.10.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 (71) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/chunk-T7V4GUIN.js +1638 -0
  3. package/dist/chunk-T7V4GUIN.js.map +1 -0
  4. package/dist/cli.js +731 -324
  5. package/dist/cli.js.map +1 -1
  6. package/dist/documentation-client-core.d.ts +18 -0
  7. package/dist/documentation-client-core.js +395 -0
  8. package/dist/documentation-client-core.js.map +1 -0
  9. package/dist/documentation-default-renderer.cjs +124 -0
  10. package/dist/documentation-react.d.ts +2 -0
  11. package/dist/documentation-react.js +35 -0
  12. package/dist/documentation-react.js.map +1 -0
  13. package/dist/documentation-runtime.js +71 -0
  14. package/dist/documentation-server-core.d.ts +11 -0
  15. package/dist/documentation-server-core.js +48 -0
  16. package/dist/documentation-server-core.js.map +1 -0
  17. package/dist/documentation.d.ts +366 -0
  18. package/dist/documentation.js +3953 -0
  19. package/dist/documentation.js.map +1 -0
  20. package/dist/feature-installer.js +145 -0
  21. package/dist/feature-installer.js.map +1 -1
  22. package/dist/index.d.ts +177 -1
  23. package/dist/index.js +133 -0
  24. package/dist/index.js.map +1 -1
  25. package/dist/public-BGRX_Cjd.d.ts +234 -0
  26. package/dist/schema.d.ts +186 -0
  27. package/dist/schema.js +610 -0
  28. package/dist/schema.js.map +1 -0
  29. package/dist/server.d.ts +83 -4
  30. package/dist/server.js +296 -1
  31. package/dist/server.js.map +1 -1
  32. package/dist/testing.d.ts +5 -8
  33. package/dist/testing.js +48 -14
  34. package/dist/testing.js.map +1 -1
  35. package/dist/worker.d.ts +249 -5
  36. package/dist/worker.js +1438 -19
  37. package/dist/worker.js.map +1 -1
  38. package/features/admin-page/src/admin-schema.ts +1 -1
  39. package/features/ai-chat/feature.json +2 -2
  40. package/features/ai-chat/src/ChatPanel.tsx +6 -11
  41. package/features/ai-chat/src/ai-chat-schema.ts +1 -2
  42. package/features/canvas/src/canvas-schema.ts +1 -1
  43. package/features/documentation/content/index.mdx +14 -0
  44. package/features/documentation/content/quickstart.mdx +12 -0
  45. package/features/documentation/documentation.json +18 -0
  46. package/features/documentation/feature.json +68 -0
  47. package/features/{docs → documents}/feature.json +27 -27
  48. package/features/{docs/src/DocsEditorPage.tsx → documents/src/DocumentsEditorPage.tsx} +74 -74
  49. package/features/{docs/src/DocsListPage.tsx → documents/src/DocumentsListPage.tsx} +102 -102
  50. package/features/{docs/src/DocsOutlinePanel.tsx → documents/src/DocumentsOutlinePanel.tsx} +9 -9
  51. package/features/{docs/src/DocsPresence.tsx → documents/src/DocumentsPresence.tsx} +18 -18
  52. package/features/{docs → documents}/src/InviteDialog.tsx +21 -21
  53. package/features/{docs → documents}/src/LibrarySidebar.tsx +25 -25
  54. package/features/documents/src/__tests__/documents-presence-access.test.ts +71 -0
  55. package/features/{docs/src/docs-library-types.ts → documents/src/documents-library-types.ts} +3 -3
  56. package/features/{docs/src/docs-schema.ts → documents/src/documents-schema.ts} +6 -6
  57. package/features/{docs/src/docs-ui.css → documents/src/documents-ui.css} +89 -89
  58. package/features/{docs → documents}/src/editor/DocEditorSurface.tsx +11 -11
  59. package/features/{docs/src/editor/DocsTiptapToolbar.tsx → documents/src/editor/DocumentsTiptapToolbar.tsx} +21 -21
  60. package/features/{docs → documents}/src/editor/useDocEditor.ts +4 -4
  61. package/features/{docs/src/use-docs-presence-access.ts → documents/src/use-documents-presence-access.ts} +51 -51
  62. package/features/file-attachments/src/attachments-schema.ts +1 -1
  63. package/features/items/src/items-schema.ts +1 -1
  64. package/features/leaderboard/src/leaderboard-schema.ts +1 -1
  65. package/features/messaging/src/ChatMultiPage.tsx +1 -1
  66. package/features/messaging/src/ChatPage.tsx +1 -1
  67. package/features/messaging/src/messaging-schema.ts +2 -2
  68. package/features/tasks/src/tasks-schema.ts +1 -1
  69. package/features/testing/src/test-schema.ts +2 -2
  70. package/package.json +26 -1
  71. package/features/docs/src/__tests__/docs-presence-access.test.ts +0 -71
@@ -4,7 +4,7 @@
4
4
  * Admin-only settings collection for key-value app configuration.
5
5
  */
6
6
 
7
- import type { CollectionSchema } from 'deepspace/worker'
7
+ import type { CollectionSchema } from 'deepspace/schema'
8
8
 
9
9
  export const settingsSchema: CollectionSchema = {
10
10
  name: 'settings',
@@ -36,8 +36,8 @@
36
36
  ],
37
37
  "patterns": [
38
38
  "ChatPanel takes `chatId` (or null). Parent owns chat lifecycle (create / select / delete); pass `disabled` while a parent-driven create is in flight so the panel doesn't kick off its own auto-create.",
39
- "ChatPanel's DEFAULT_MODELS and worker.ts's ALLOWED_MODELS must stay in sync — add entries to both when introducing a new model.",
39
+ "ChatPanel and the server agent both consume the SDK's canonical model catalog; never add a second model allowlist in app code.",
40
40
  "Compaction summary is stored on the ai-chats row (compactedSummary, compactedThroughId). The summarizer is user-billed by default; pass `makeDefaultSummarizer(c.env)` with no authToken in worker.ts to absorb the cost as the developer instead.",
41
- "Tool execution is server-side and per-user RBAC-enforced (records.* tools see only what the caller would see). `stopWhen: stepCountIs(5)` caps tool-use rounds per turn."
41
+ "Tool execution is server-side and per-user RBAC-enforced (records.* tools see only what the caller would see). The canonical runner enforces at most 20 tool calls per turn."
42
42
  ]
43
43
  }
@@ -20,7 +20,7 @@ import {
20
20
  ChevronDown,
21
21
  Square,
22
22
  } from 'lucide-react'
23
- import { useQuery } from 'deepspace'
23
+ import { listDeepSpaceAgentModels, useQuery } from 'deepspace'
24
24
  import { EmptyState, MessageTurn, ThinkingIndicator } from './ChatPanel.messages'
25
25
  import { useStreamingChat } from './ChatPanel.stream'
26
26
 
@@ -73,16 +73,11 @@ const DEFAULT_PROMPTS = [
73
73
  'List my collections',
74
74
  ]
75
75
 
76
- // Keep this picker aligned with ALLOWED_MODELS in src/ai/chat-routes.ts.
77
- const DEFAULT_MODELS: ModelOption[] = [
78
- { id: 'claude-sonnet-5', label: 'Claude Sonnet 5', provider: 'Anthropic' },
79
- { id: 'claude-opus-4-8', label: 'Claude Opus 4.8', provider: 'Anthropic' },
80
- { id: 'claude-haiku-4-5', label: 'Claude Haiku 4.5', provider: 'Anthropic' },
81
- { id: 'gpt-5.6-terra', label: 'GPT-5.6 Terra', provider: 'OpenAI' },
82
- { id: 'gpt-5.6-sol', label: 'GPT-5.6 Sol', provider: 'OpenAI' },
83
- { id: 'gpt-5.6-luna', label: 'GPT-5.6 Luna', provider: 'OpenAI' },
84
- { id: 'gpt-oss-120b', label: 'GPT-OSS 120B', provider: 'Cerebras' },
85
- ]
76
+ const DEFAULT_MODELS: ModelOption[] = listDeepSpaceAgentModels('application').map((model) => ({
77
+ id: model.id,
78
+ label: model.label,
79
+ provider: model.providerLabel,
80
+ }))
86
81
 
87
82
  export function ChatPanel({
88
83
  chatId,
@@ -5,7 +5,6 @@
5
5
  * Spread into the app's schemas array: ...aiChatSchemas
6
6
  */
7
7
 
8
- import type { CollectionSchema } from 'deepspace/worker'
9
- import { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA } from 'deepspace/worker'
8
+ import { AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA, type CollectionSchema } from 'deepspace/schema'
10
9
 
11
10
  export const aiChatSchemas: CollectionSchema[] = [AI_CHATS_SCHEMA, AI_MESSAGES_SCHEMA]
@@ -6,7 +6,7 @@
6
6
  * not in RecordRoom. This schema is just for document metadata.
7
7
  */
8
8
 
9
- import type { CollectionSchema } from 'deepspace/worker'
9
+ import type { CollectionSchema } from 'deepspace/schema'
10
10
 
11
11
  export const canvasSchema: CollectionSchema = {
12
12
  name: 'canvases',
@@ -0,0 +1,14 @@
1
+ ---
2
+ title: Introduction
3
+ description: Start writing documentation for your DeepSpace app.
4
+ ---
5
+
6
+ This site is compiled from Markdown and MDX in the same repository as your
7
+ DeepSpace app. It is available at `/docs` whenever you run or deploy the app.
8
+
9
+ ## Edit this page
10
+
11
+ Update `documentation/index.mdx`, then use your ordinary development workflow to
12
+ preview the result.
13
+
14
+ MDX can import your app's React components directly when prose is not enough.
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: Quickstart
3
+ description: Configure and expand your documentation.
4
+ ---
5
+
6
+ 1. Set your name, navigation, colors, links, and assistant access in `documentation.json`.
7
+ 2. Add `.md` or `.mdx` files under `documentation/`.
8
+ 3. Run the app normally and open `/docs`.
9
+ 4. Deploy the app normally when the documentation is ready.
10
+
11
+ For a custom React shell, add one root `documentation.tsx` file. The default surface
12
+ remains available as a component, so customization can be incremental.
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "Documentation",
3
+ "description": "Documentation for this DeepSpace app",
4
+ "domains": [],
5
+ "navigation": [
6
+ {
7
+ "group": "Get started",
8
+ "pages": ["index", "quickstart"]
9
+ }
10
+ ],
11
+ "assistant": {
12
+ "access": "authenticated",
13
+ "suggestions": [
14
+ "How do I get started?",
15
+ "What can I build?"
16
+ ]
17
+ }
18
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "id": "documentation",
3
+ "name": "Documentation",
4
+ "category": "publishing",
5
+ "description": "Publish Markdown and MDX documentation with search, API references, and an AI assistant",
6
+ "details": "Adds public documentation at /docs to this app's normal development and deployment lifecycle. Markdown is the default; MDX and an optional root documentation.tsx can import arbitrary app code without a plugin layer.",
7
+ "files": [
8
+ {
9
+ "src": "documentation.json",
10
+ "dest": "documentation.json"
11
+ },
12
+ {
13
+ "src": "content/index.mdx",
14
+ "dest": "documentation/index.mdx"
15
+ },
16
+ {
17
+ "src": "content/quickstart.mdx",
18
+ "dest": "documentation/quickstart.mdx"
19
+ }
20
+ ],
21
+ "ignore": ["public/_documentation", "public/_documentation-root"],
22
+ "wrangler": {
23
+ "runWorkerFirst": true,
24
+ "rateLimits": [
25
+ {
26
+ "name": "DOCUMENTATION_CLIENT_RATE_LIMITER",
27
+ "namespaceId": "2001",
28
+ "limit": 12,
29
+ "period": 60
30
+ },
31
+ {
32
+ "name": "DOCUMENTATION_APP_RATE_LIMITER",
33
+ "namespaceId": "2002",
34
+ "limit": 120,
35
+ "period": 60
36
+ }
37
+ ]
38
+ },
39
+ "code": [
40
+ {
41
+ "file": "vite.config.ts",
42
+ "import": "import { deepSpaceDocumentation } from 'deepspace/documentation'",
43
+ "marker": " plugins: [",
44
+ "insert": " deepSpaceDocumentation(),"
45
+ },
46
+ {
47
+ "file": "worker.ts",
48
+ "import": "import documentationConfig from './documentation.json'\nimport { registerDeepSpaceDocumentation } from 'deepspace/worker'",
49
+ "marker": "registerPlatformProxyRoutes(app)",
50
+ "placement": "before",
51
+ "insert": "registerDeepSpaceDocumentation(app, { resolveAuth, config: documentationConfig })"
52
+ }
53
+ ],
54
+ "instructions": [
55
+ "Edit documentation.json to set your name, navigation, branding, assistant access, and optional custom documentation domains.",
56
+ "Write Markdown or MDX in documentation/. Add a root documentation.tsx only when you want to wrap or replace the default React surface."
57
+ ],
58
+ "patterns": [
59
+ "The feature is served at /docs on the app's existing hostname.",
60
+ "A hostname listed in documentation.json domains serves the same release at that hostname's root after you explicitly attach it to the app.",
61
+ "Documentation builds only when documentation.json exists; apps without this feature are unaffected.",
62
+ "MDX may import app components directly. documentation.tsx is the single optional shell customization point."
63
+ ],
64
+ "agentNotes": [
65
+ "Treat documentation.json, documentation/**/*.md, documentation/**/*.mdx, and optional documentation.tsx as one app-owned documentation feature.",
66
+ "Use ordinary deepspace dev start and deepspace deploy commands; there is no separate documentation command namespace."
67
+ ]
68
+ }
@@ -1,70 +1,70 @@
1
1
  {
2
- "id": "docs",
2
+ "id": "documents",
3
3
  "name": "Documents",
4
4
  "category": "data",
5
5
  "description": "Real-time collaborative document editing with Tiptap + Yjs",
6
- "details": "Document library with folders & favorites. Collaborative editor built on Tiptap (ProseMirror) with Y.XmlFragment via @tiptap/extension-collaboration and live remote cursors via @tiptap/extension-collaboration-caret — buttery typing, no innerHTML rebuilds, no contenteditable quirks. Invite-only docs with viewer/editor roles: owner shares via an in-app dialog that resolves an email to a DeepSpace user. RBAC is enforced by the documents schema and the starter template's built-in Yjs route. Includes a one-shot migration shim that converts docs created with the legacy contenteditable editor (HTML stored in Y.Text('content')) into Tiptap on first open.",
6
+ "details": "Document library with folders & favorites. Collaborative editor built on Tiptap (ProseMirror) with Y.XmlFragment via @tiptap/extension-collaboration and live remote cursors via @tiptap/extension-collaboration-caret — buttery typing, no innerHTML rebuilds, no contenteditable quirks. Invite-only documents with viewer/editor roles: owner shares via an in-app dialog that resolves an email to a DeepSpace user. RBAC is enforced by the documents schema and the starter template's built-in Yjs route. Includes a one-shot migration shim that converts documents created with the legacy contenteditable editor (HTML stored in Y.Text('content')) into Tiptap on first open.",
7
7
  "files": [
8
8
  {
9
- "src": "src/DocsListPage.tsx",
10
- "dest": "src/pages/docs/index.tsx"
9
+ "src": "src/DocumentsListPage.tsx",
10
+ "dest": "src/pages/documents/index.tsx"
11
11
  },
12
12
  {
13
- "src": "src/DocsEditorPage.tsx",
14
- "dest": "src/pages/docs/[docId].tsx"
13
+ "src": "src/DocumentsEditorPage.tsx",
14
+ "dest": "src/pages/documents/[docId].tsx"
15
15
  },
16
16
  {
17
- "src": "src/use-docs-presence-access.ts",
18
- "dest": "src/pages/docs/use-docs-presence-access.ts"
17
+ "src": "src/use-documents-presence-access.ts",
18
+ "dest": "src/pages/documents/use-documents-presence-access.ts"
19
19
  },
20
20
  {
21
21
  "src": "src/InviteDialog.tsx",
22
- "dest": "src/pages/docs/InviteDialog.tsx"
22
+ "dest": "src/pages/documents/InviteDialog.tsx"
23
23
  },
24
24
  {
25
- "src": "src/docs-ui.css",
26
- "dest": "src/pages/docs/docs-ui.css"
25
+ "src": "src/documents-ui.css",
26
+ "dest": "src/pages/documents/documents-ui.css"
27
27
  },
28
28
  {
29
- "src": "src/docs-schema.ts",
30
- "dest": "src/schemas/docs-schema.ts"
29
+ "src": "src/documents-schema.ts",
30
+ "dest": "src/schemas/documents-schema.ts"
31
31
  },
32
32
  {
33
- "src": "src/docs-library-types.ts",
34
- "dest": "src/pages/docs/docs-library-types.ts"
33
+ "src": "src/documents-library-types.ts",
34
+ "dest": "src/pages/documents/documents-library-types.ts"
35
35
  },
36
36
  {
37
37
  "src": "src/LibrarySidebar.tsx",
38
- "dest": "src/pages/docs/LibrarySidebar.tsx"
38
+ "dest": "src/pages/documents/LibrarySidebar.tsx"
39
39
  },
40
40
  {
41
- "src": "src/DocsPresence.tsx",
42
- "dest": "src/pages/docs/DocsPresence.tsx"
41
+ "src": "src/DocumentsPresence.tsx",
42
+ "dest": "src/pages/documents/DocumentsPresence.tsx"
43
43
  },
44
44
  {
45
- "src": "src/DocsOutlinePanel.tsx",
46
- "dest": "src/pages/docs/DocsOutlinePanel.tsx"
45
+ "src": "src/DocumentsOutlinePanel.tsx",
46
+ "dest": "src/pages/documents/DocumentsOutlinePanel.tsx"
47
47
  },
48
48
  {
49
49
  "src": "src/editor/useDocEditor.ts",
50
- "dest": "src/pages/docs/editor/useDocEditor.ts"
50
+ "dest": "src/pages/documents/editor/useDocEditor.ts"
51
51
  },
52
52
  {
53
53
  "src": "src/editor/DocEditorSurface.tsx",
54
- "dest": "src/pages/docs/editor/DocEditorSurface.tsx"
54
+ "dest": "src/pages/documents/editor/DocEditorSurface.tsx"
55
55
  },
56
56
  {
57
- "src": "src/editor/DocsTiptapToolbar.tsx",
58
- "dest": "src/pages/docs/editor/DocsTiptapToolbar.tsx"
57
+ "src": "src/editor/DocumentsTiptapToolbar.tsx",
58
+ "dest": "src/pages/documents/editor/DocumentsTiptapToolbar.tsx"
59
59
  }
60
60
  ],
61
61
  "schema": {
62
- "exportName": "docsCollections",
63
- "importPath": "./schemas/docs-schema",
62
+ "exportName": "documentsCollections",
63
+ "importPath": "./schemas/documents-schema",
64
64
  "spreadOperator": true
65
65
  },
66
66
  "route": {
67
- "path": "/docs",
67
+ "path": "/documents",
68
68
  "protected": true
69
69
  },
70
70
  "requires": [],