@dooc-dev/dooc 0.0.21 → 0.0.23

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 (66) hide show
  1. package/dist/client.global.js +1 -1
  2. package/dist/edit.global.js +269 -263
  3. package/dist/engine/compiler/check.js +17 -0
  4. package/dist/engine/compiler/export.js +18 -1
  5. package/dist/engine/compiler/files.js +13 -2
  6. package/dist/engine/compiler/manifest.js +4 -0
  7. package/dist/engine/compiler/skills.d.ts +10 -0
  8. package/dist/engine/compiler/skills.js +95 -0
  9. package/dist/engine/core/content-metadata.d.ts +7 -1
  10. package/dist/engine/core/content-metadata.js +52 -18
  11. package/dist/engine/core/files.d.ts +1 -0
  12. package/dist/engine/core/files.js +3 -0
  13. package/dist/frontend/document-application.d.ts +11 -2
  14. package/dist/frontend/document-application.js +364 -133
  15. package/dist/frontend/document-links.js +31 -21
  16. package/dist/frontend/language-picker.js +1 -0
  17. package/dist/frontend/locales/eng.json +19 -2
  18. package/dist/frontend/locales/jpn.json +19 -2
  19. package/dist/frontend/locales/zho.json +19 -2
  20. package/dist/frontend/mcp-operations.js +57 -1
  21. package/dist/frontend/nav-focus.d.ts +1 -1
  22. package/dist/frontend/nav-focus.js +25 -2
  23. package/dist/frontend/nav-update.js +12 -0
  24. package/dist/frontend/page-jump.d.ts +3 -0
  25. package/dist/frontend/page-jump.js +130 -0
  26. package/dist/frontend/resource-download.d.ts +1 -1
  27. package/dist/frontend/resource-download.js +118 -28
  28. package/dist/frontend/resource-library.js +16 -7
  29. package/dist/frontend/search.js +18 -5
  30. package/dist/frontend/theme-picker.js +11 -0
  31. package/dist/manifest.global.js +349 -0
  32. package/dist/mcp-relay.mjs +71 -1
  33. package/dist/plugins.global.js +4 -4
  34. package/dist/server/assets.d.ts +1 -0
  35. package/dist/server/assets.js +4 -1
  36. package/dist/server/build-media.d.ts +6 -0
  37. package/dist/server/build-media.js +136 -0
  38. package/dist/server/build-output.d.ts +2 -1
  39. package/dist/server/build-output.js +32 -2
  40. package/dist/server/build-split.d.ts +15 -0
  41. package/dist/server/build-split.js +160 -0
  42. package/dist/server/build.d.ts +6 -1
  43. package/dist/server/build.js +37 -10
  44. package/dist/server/cli.js +20 -2
  45. package/dist/server/mcp.js +14 -1
  46. package/dist/server/serve.d.ts +21 -2
  47. package/dist/server/serve.js +26 -20
  48. package/dist/server/static-client.js +2 -1
  49. package/dist/server/workspace-server.d.ts +1 -1
  50. package/dist/server/workspace-server.js +24 -4
  51. package/dist/subformats.global.js +25 -25
  52. package/dist/ui.global.js +68 -68
  53. package/dist/workspace/client.d.ts +1 -1
  54. package/dist/workspace/client.js +22 -3
  55. package/dist/workspace/mcp-tools.js +32 -0
  56. package/dist/workspace/mcp.js +50 -1
  57. package/dist/workspace/protocol.d.ts +3 -0
  58. package/dist/workspace/server.d.ts +1 -1
  59. package/dist/workspace/server.js +14 -3
  60. package/dist/workspace/site-icon.js +17 -12
  61. package/dist/workspace/textfile.js +16 -4
  62. package/dist/workspace-mcp-worker.global.js +242 -122
  63. package/dist/workspace-reader-mcp-worker.global.js +242 -122
  64. package/dist/workspace-reader-worker.global.js +242 -122
  65. package/dist/workspace-worker.global.js +242 -122
  66. package/package.json +2 -2
@@ -50,11 +50,49 @@ var handleRpc = async (tools, msg, versions = ["2024-11-05", ...MCP_HTTP_VERSION
50
50
  case "initialize":
51
51
  return reply({
52
52
  protocolVersion: versions.includes(String(params.protocolVersion)) ? params.protocolVersion : "2025-11-25",
53
- capabilities: { tools: {} },
53
+ capabilities: {
54
+ tools: {},
55
+ ...Object.hasOwn(tools, "skills") ? { resources: {}, extensions: { "io.modelcontextprotocol/skills": {} } } : {}
56
+ },
54
57
  serverInfo: { name: "dooc", version: "0" }
55
58
  });
56
59
  case "ping":
57
60
  return reply({});
61
+ case "skills/list":
62
+ case "skills/get":
63
+ case "resources/list":
64
+ case "resources/templates/list":
65
+ case "resources/read": {
66
+ if (!Object.hasOwn(tools, "skills")) return error(-32601, "method not found");
67
+ if (params.cursor !== void 0) return error(-32602, "unknown cursor");
68
+ if (msg.method === "resources/templates/list") return reply({ resourceTemplates: [] });
69
+ const action = msg.method === "skills/get" ? "get" : msg.method === "resources/read" ? "read" : "list";
70
+ if (action !== "list" && (typeof params.uri !== "string" || !params.uri))
71
+ return error(-32602, "a resource URI is required");
72
+ try {
73
+ const result = await callMcpTool(tools, "skills", {
74
+ action,
75
+ ...action === "list" ? {} : { uri: params.uri }
76
+ });
77
+ if (!record(result)) return error(-32603, "invalid skill response");
78
+ if (typeof result.error === "string")
79
+ return error(result.status === 404 ? -32602 : -32603, result.error);
80
+ if (msg.method === "resources/list") {
81
+ const skills = result.skills;
82
+ return reply({
83
+ resources: skills.map((skill) => ({
84
+ uri: skill.uri,
85
+ name: skill.frontmatter.name,
86
+ description: skill.frontmatter.description,
87
+ mimeType: "text/markdown"
88
+ }))
89
+ });
90
+ }
91
+ return reply(result);
92
+ } catch (e) {
93
+ return error(-32603, e instanceof Error ? e.message : String(e));
94
+ }
95
+ }
58
96
  case "tools/list":
59
97
  return reply({
60
98
  tools: Object.entries(tools).map(([name, t]) => ({
@@ -114,6 +152,17 @@ var num = { type: "integer", minimum: 0 };
114
152
  var bool = { type: "boolean" };
115
153
  var strings = { type: "array", items: str };
116
154
  var definitions = {
155
+ skills: {
156
+ description: "Discover project-authored workflows for applying dooc content as checklists, development conventions or other guidance. list returns skill metadata and file URIs; get returns one skill's metadata; read retrieves its instructions or supporting files. Use document tools to read the project information those instructions reference. Skill files are returned as content, never executed.",
157
+ props: {
158
+ action: { ...str, enum: ["list", "get", "read"] },
159
+ uri: {
160
+ ...str,
161
+ description: "Exact skill:// URI from list; required for get and read."
162
+ }
163
+ },
164
+ required: ["action"]
165
+ },
117
166
  export: {
118
167
  description: "Collect dooc.yaml and its source dependencies into dist/bundle.zip, without executing plugins or fetching remote data.",
119
168
  props: {},
@@ -134,6 +183,26 @@ var definitions = {
134
183
  source_url: {
135
184
  ...str,
136
185
  description: "Public source directory URL for card copy links in HTML, relative to dooc.yaml."
186
+ },
187
+ split: {
188
+ ...bool,
189
+ description: "HTML only: emit separate pages, JS, CSS and resources; serve over HTTP(S)."
190
+ },
191
+ compress: {
192
+ ...bool,
193
+ description: "HTML only: optimize previews with FFmpeg (lossy JPEG/WebP/video); implies split. Original source downloads are preserved."
194
+ },
195
+ max_file_size: {
196
+ ...str,
197
+ description: "Maximum bytes per output file, e.g. 25MiB; implies split. No limit by default."
198
+ },
199
+ max_build_size: {
200
+ ...str,
201
+ description: "Maximum total output bytes, e.g. 100MiB; implies split. No limit by default."
202
+ },
203
+ warnings_as_errors: {
204
+ ...bool,
205
+ description: "Fail when requested compression is unsupported or unavailable."
137
206
  }
138
207
  },
139
208
  required: ["format"]
@@ -327,6 +396,7 @@ var definitions = {
327
396
  }
328
397
  };
329
398
  var readTools = /* @__PURE__ */ new Set([
399
+ "skills",
330
400
  "list_docs",
331
401
  "search_docs",
332
402
  "read_doc",