@open-document/core 0.13.3 → 0.14.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 (67) hide show
  1. package/dist/{build-CvsOak5B.js → build-CyBlmrjS.js} +1 -1
  2. package/dist/{check-CbUBwYmf.js → check-DUKDEem-.js} +3 -3
  3. package/dist/cli/bin.js +10 -21
  4. package/dist/{config-BWtOZ1jc.d.ts → config-cAV1OCuY.d.ts} +9 -1
  5. package/dist/{config-CltJJVsw.js → config-cNpYUpF6.js} +2746 -369
  6. package/dist/{context-CWgfsHoE.js → context-BPApOW9n.js} +1 -1
  7. package/dist/{dev-B8H2qT6G.js → dev-DrnOvsX3.js} +1 -1
  8. package/dist/{diff-BvIjjgnc.js → diff-BPMD2Knh.js} +2 -2
  9. package/dist/{export-DX30_s2q.js → export-DeVtL8aX.js} +3 -3
  10. package/dist/{import-DgsdJT5e.js → import-WAgWsuOv.js} +3 -2
  11. package/dist/index.d.ts +2 -2
  12. package/dist/ops/index.d.ts +3 -1
  13. package/dist/ops/index.js +2 -2
  14. package/dist/{ops-CSR5RlrE.js → ops-raK6424A.js} +2 -854
  15. package/dist/{preview-DYMUNjXL.js → preview-B8Vw9QCh.js} +1 -1
  16. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  17. package/dist/{templates-B5Tz0AKb.js → templates-D9jAFJ8R.js} +3 -3
  18. package/dist/vite/index.d.ts +1 -1
  19. package/dist/vite/index.js +1 -1
  20. package/package.json +1 -1
  21. package/skills/create-doc/SKILL.md +1 -1
  22. package/skills/doc-authoring/SKILL.md +6 -0
  23. package/src/app/app.tsx +2 -0
  24. package/src/app/components/agent/agent-dock.tsx +75 -0
  25. package/src/app/components/agent/agent-markdown.tsx +45 -0
  26. package/src/app/components/agent/agent-panel.tsx +690 -0
  27. package/src/app/components/agent/agent-presence.tsx +74 -0
  28. package/src/app/components/agent/composer.tsx +120 -0
  29. package/src/app/components/agent/connect-view.tsx +183 -0
  30. package/src/app/components/agent/history-view.tsx +134 -0
  31. package/src/app/components/agent/provider-logo.tsx +23 -0
  32. package/src/app/components/agent/transcript.tsx +609 -0
  33. package/src/app/components/comments/comments-panel.tsx +26 -2
  34. package/src/app/components/inspector/inspector.tsx +17 -0
  35. package/src/app/components/note-markdown.tsx +85 -0
  36. package/src/app/components/page-error-boundary.tsx +84 -0
  37. package/src/app/components/page-frame.tsx +2 -1
  38. package/src/app/components/panel/resize-handle.tsx +129 -0
  39. package/src/app/components/ui/button.tsx +97 -0
  40. package/src/app/components/ui/popover.tsx +144 -0
  41. package/src/app/components/ui/tooltip.tsx +123 -0
  42. package/src/app/lib/agent/use-agent.ts +543 -0
  43. package/src/app/lib/diagnostics.ts +13 -0
  44. package/src/app/lib/export-dom.ts +2 -1
  45. package/src/app/lib/export-pdf.ts +2 -1
  46. package/src/app/lib/i18n-ja/agent-panel.ts +107 -0
  47. package/src/app/lib/i18n-ja/agent.ts +9 -0
  48. package/src/app/lib/i18n-ja/index.ts +9 -1
  49. package/src/app/lib/i18n-ko/agent-panel.ts +106 -0
  50. package/src/app/lib/i18n-ko/agent.ts +9 -0
  51. package/src/app/lib/i18n-ko/index.ts +9 -1
  52. package/src/app/lib/i18n-zh-cn/agent-panel.ts +105 -0
  53. package/src/app/lib/i18n-zh-cn/agent.ts +9 -0
  54. package/src/app/lib/i18n-zh-cn/index.ts +9 -1
  55. package/src/app/lib/i18n-zh-tw/agent-panel.ts +105 -0
  56. package/src/app/lib/i18n-zh-tw/agent.ts +9 -0
  57. package/src/app/lib/i18n-zh-tw/index.ts +9 -1
  58. package/src/app/lib/note-markdown.ts +116 -0
  59. package/src/app/lib/toast.ts +50 -0
  60. package/src/app/lib/use-auto-grow.ts +15 -0
  61. package/src/app/lib/use-doc-titles.ts +28 -0
  62. package/src/app/lib/use-locale.ts +144 -0
  63. package/src/app/lib/utils.ts +4 -0
  64. package/src/app/routes/doc-preview.tsx +103 -0
  65. package/src/app/routes/doc.tsx +118 -11
  66. package/src/app/routes/home.tsx +43 -8
  67. package/src/app/styles.css +193 -0
@@ -1,4 +1,4 @@
1
- import { t as createViteConfig } from "./config-CltJJVsw.js";
1
+ import { t as createViteConfig } from "./config-cNpYUpF6.js";
2
2
  import path from "node:path";
3
3
  import { build as build$1, mergeConfig } from "vite";
4
4
  //#region src/cli/build.ts
@@ -1,6 +1,6 @@
1
- import { j as listDocIds } from "./config-CltJJVsw.js";
2
- import { n as closeRenderSession, t as checkLayout } from "./ops-CSR5RlrE.js";
3
- import { t as cliContext } from "./context-CWgfsHoE.js";
1
+ import { M as listDocIds } from "./config-cNpYUpF6.js";
2
+ import { n as closeRenderSession, t as checkLayout } from "./ops-raK6424A.js";
3
+ import { t as cliContext } from "./context-BPApOW9n.js";
4
4
  import chalk from "chalk";
5
5
  //#region src/cli/check.ts
6
6
  function line(finding) {
package/dist/cli/bin.js CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
2
3
  import { i as ORIENTATIONS, o as PAGE_SIZE_NAMES, r as EXPORT_FORMATS } from "../sdk-CqNZzbkz.js";
3
4
  import { n as readCoreVersion } from "../package-version-C89gtYSk.js";
4
5
  import chalk from "chalk";
@@ -8,18 +9,6 @@ import { fileURLToPath } from "node:url";
8
9
  import { Argument, Command, Option } from "commander";
9
10
  import fs from "node:fs/promises";
10
11
  import { existsSync } from "node:fs";
11
- //#region \0rolldown/runtime.js
12
- var __defProp = Object.defineProperty;
13
- var __exportAll = (all, no_symbols) => {
14
- let target = {};
15
- for (var name in all) __defProp(target, name, {
16
- get: all[name],
17
- enumerable: true
18
- });
19
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
20
- return target;
21
- };
22
- //#endregion
23
12
  //#region src/cli/sync.ts
24
13
  var sync_exports = /* @__PURE__ */ __exportAll({
25
14
  detectSkillsDrift: () => detectSkillsDrift,
@@ -154,39 +143,39 @@ async function run(argv) {
154
143
  program.name("open-doc").description("Author documents — we handle the Vite/React stack, pagination, and export.").version(version, "-v, --version", "print version").helpOption("-h, --help", "show help").showHelpAfterError(chalk.dim("(run `open-doc --help` for usage)"));
155
144
  program.command("dev").description("Start the dev server").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").option("--no-skills-check", "skip the built-in skills drift check").option("--mcp", "serve an MCP endpoint at /mcp (requires @open-document/mcp)").action(async (flags) => {
156
145
  if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
157
- const { dev } = await import("../dev-B8H2qT6G.js");
146
+ const { dev } = await import("../dev-DrnOvsX3.js");
158
147
  await dev(flags);
159
148
  });
160
149
  program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
161
- const { build } = await import("../build-CvsOak5B.js");
150
+ const { build } = await import("../build-CyBlmrjS.js");
162
151
  await build(flags);
163
152
  });
164
153
  program.command("preview").description("Preview the production build").addOption(new Option("-p, --port <port>", "port to listen on").argParser(parsePort)).addOption(new Option("--host [host]", "expose on the network (optional host)")).option("--open", "open the browser on start").action(async (flags) => {
165
- const { preview } = await import("../preview-DYMUNjXL.js");
154
+ const { preview } = await import("../preview-B8Vw9QCh.js");
166
155
  await preview(flags);
167
156
  });
168
157
  program.command("export [docIds...]").description("Render documents headlessly to PDF, HTML, PNG, or DOCX").addOption(new Option("-f, --format <format>", "output format").choices([...EXPORT_FORMATS])).option("-o, --out-dir <dir>", "directory to write into (defaults to `out`)").option("--all", "export every document under docs/").option("--each", "one copy per row of the document's `records`").option("--name <pattern>", "with --each: file name, e.g. \"certificate-{name}\" ({#} is the row number)").action(async (docIds, flags) => {
169
- const { exportDocs } = await import("../export-DX30_s2q.js");
158
+ const { exportDocs } = await import("../export-DeVtL8aX.js");
170
159
  await exportDocs(docIds, flags);
171
160
  });
172
161
  program.command("diff <docId>").description("Show what changed in a document since a git revision, page by page").option("-s, --since <rev>", "revision to compare against (defaults to HEAD)").option("-o, --out-dir <dir>", "directory to write the report into (defaults to `out`)").option("--json", "print the result as JSON").action(async (docId, flags) => {
173
- const { diffDoc } = await import("../diff-BvIjjgnc.js");
162
+ const { diffDoc } = await import("../diff-BPMD2Knh.js");
174
163
  await diffDoc(docId, flags);
175
164
  });
176
165
  program.command("check [docIds...]").description("Report layout faults — clipped content, blank sheets, stranded headings").option("--json", "print the full report as JSON").action(async (docIds, flags) => {
177
- const { checkDocs } = await import("../check-CbUBwYmf.js");
166
+ const { checkDocs } = await import("../check-DUKDEem-.js");
178
167
  await checkDocs(docIds, flags);
179
168
  });
180
169
  program.command("templates").description("List the templates a new document can start from").option("--json", "print them as JSON").action(async (flags) => {
181
- const { printTemplates } = await import("../templates-B5Tz0AKb.js");
170
+ const { printTemplates } = await import("../templates-D9jAFJ8R.js");
182
171
  await printTemplates(flags);
183
172
  });
184
173
  program.command("new [docId]").description("Create a document under docs/ from a template (see `open-doc templates`)").option("-t, --template <name>", "template to start from (defaults to blank)").option("--title <title>", "title of the new document").action(async (docId, flags) => {
185
- const { newDoc } = await import("../templates-B5Tz0AKb.js");
174
+ const { newDoc } = await import("../templates-D9jAFJ8R.js");
186
175
  await newDoc(docId, flags);
187
176
  });
188
177
  program.command("import <file>").description("Turn a Markdown file into a document under docs/").option("--id <id>", "document id (defaults to a slug of the title)").option("--title <title>", "override the title").option("--subtitle <subtitle>", "subtitle, also used as the cover eyebrow").option("--lang <tag>", "language of the text, e.g. zh-Hant-TW (detected for CJK when omitted)").option("--author <author>", "author line on the cover").option("--theme <theme>", "theme id to back-link from meta.theme").addOption(new Option("--page-size <size>", "page size").choices(PAGE_SIZE_NAMES)).addOption(new Option("--orientation <orientation>", "page orientation").choices(ORIENTATIONS)).option("--no-cover", "skip the title page").option("--contents", "add a self-filling contents page").action(async (file, flags) => {
189
- const { importDoc } = await import("../import-DgsdJT5e.js");
178
+ const { importDoc } = await import("../import-WAgWsuOv.js");
190
179
  await importDoc(file, flags);
191
180
  });
192
181
  program.command("sync:skills").description("Sync built-in skills from @open-document/core into this workspace").option("--dry-run", "show what would change without writing").action(async (flags) => {
@@ -25,6 +25,13 @@ type OpenDocGcpDeployConfig = {
25
25
  type OpenDocDeployConfig = {
26
26
  gcp?: OpenDocGcpDeployConfig;
27
27
  };
28
+ type OpenDocAgentConfig = {
29
+ /**
30
+ * The agent panel in `open-doc dev`, driving the Codex CLI installed on this
31
+ * machine through its SDK. Defaults to true.
32
+ */
33
+ enabled?: boolean;
34
+ };
28
35
  type OpenDocConfig = {
29
36
  base?: string;
30
37
  /**
@@ -40,6 +47,7 @@ type OpenDocConfig = {
40
47
  allowedHosts?: string[] | true;
41
48
  build?: OpenDocBuildConfig;
42
49
  deploy?: OpenDocDeployConfig;
50
+ agent?: OpenDocAgentConfig;
43
51
  };
44
52
  //#endregion
45
- export { OpenDocGcpDeployConfig as i, OpenDocConfig as n, OpenDocDeployConfig as r, OpenDocBuildConfig as t };
53
+ export { OpenDocGcpDeployConfig as a, OpenDocDeployConfig as i, OpenDocBuildConfig as n, OpenDocConfig as r, OpenDocAgentConfig as t };