@lemonriver/core 0.8.0 → 1.0.1

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 (54) hide show
  1. package/README.md +3 -1
  2. package/dist/{build-Bdagm0FU.js → build-CiT4CNey.js} +1 -1
  3. package/dist/cli/bin.js +11 -4
  4. package/dist/client-DpO_eR9X.js +57 -0
  5. package/dist/{config-Begts3gq.js → config-BI3VRI2n.js} +4557 -4596
  6. package/dist/{dev-DjjzmT28.js → dev-DpzBn_sf.js} +2 -2
  7. package/dist/index.js +1 -1
  8. package/dist/locale/index.js +1 -1
  9. package/dist/mcp-CjYDzcJa.js +262 -0
  10. package/dist/{preview-C9y9MTY1.js → preview-Dro8hl5_.js} +2 -2
  11. package/dist/vite/index.js +1 -1
  12. package/dist/{zh-tw-DcrDeKxr.js → zh-tw-BhYyMx0-.js} +40 -40
  13. package/package.json +1 -1
  14. package/skills/slide-authoring/SKILL.md +2 -0
  15. package/src/app/lemonriver/agent-providers/section.tsx +13 -4
  16. package/src/app/lemonriver/board/use-self-check.ts +1 -1
  17. package/src/app/lemonriver/brand/mascot.tsx +4 -1
  18. package/src/app/lemonriver/chrome/app-chrome.tsx +6 -0
  19. package/src/app/lemonriver/chrome/sidebar-extras.tsx +9 -1
  20. package/src/app/lemonriver/feedback/lemon-empty.tsx +3 -1
  21. package/src/app/lemonriver/guide/guide-prompt.tsx +89 -0
  22. package/src/app/lemonriver/guide/state.ts +29 -0
  23. package/src/app/lemonriver/guide/use-guide.ts +17 -0
  24. package/src/app/lemonriver/help/help-page.tsx +5 -0
  25. package/src/app/lemonriver/help/model.test.ts +72 -0
  26. package/src/app/lemonriver/help/model.ts +10 -1
  27. package/src/app/lemonriver/home/home-page.tsx +25 -7
  28. package/src/app/lemonriver/mcp/respond.ts +47 -0
  29. package/src/app/lemonriver/mcp/screenshot.tsx +155 -0
  30. package/src/app/lemonriver/mcp/self-check.tsx +65 -0
  31. package/src/app/lemonriver/outline/describe-page.tsx +3 -1
  32. package/src/app/lemonriver/routes.test.tsx +4 -1
  33. package/src/app/lemonriver/routes.tsx +12 -11
  34. package/src/app/lemonriver/settings/settings-page.tsx +3 -3
  35. package/src/app/lemonriver/share/freeze.ts +13 -5
  36. package/src/app/lemonriver/text/en.ts +227 -7
  37. package/src/app/lemonriver/text/es.ts +23 -6
  38. package/src/app/lemonriver/text/ja.ts +23 -6
  39. package/src/app/lemonriver/text/types.ts +14 -1
  40. package/src/app/lemonriver/text/zh-cn.ts +218 -6
  41. package/src/app/lemonriver/text/zh-tw.ts +218 -6
  42. package/src/app/lemonriver/update/beta-badge.tsx +3 -0
  43. package/src/app/lemonriver/update/lazy-page.tsx +29 -0
  44. package/src/app/lemonriver/update/notice-mascot.tsx +18 -0
  45. package/src/app/lemonriver/update/restart-notice.tsx +47 -0
  46. package/src/app/lemonriver/update/state.ts +33 -0
  47. package/src/app/lemonriver/update/update-prompt.tsx +30 -1
  48. package/src/app/lemonriver/update/version.test.ts +14 -0
  49. package/src/app/lemonriver/update/version.ts +5 -0
  50. package/src/locale/en.ts +8 -8
  51. package/src/locale/es.ts +10 -8
  52. package/src/locale/ja.ts +9 -8
  53. package/src/locale/zh-cn.ts +9 -8
  54. package/src/locale/zh-tw.ts +9 -8
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # @lemonriver/core
2
2
 
3
- The runtime behind [LemonRiver](https://github.com/SegawaBeer/lemonriver) — a slide framework built for agents. Describe a deck in one sentence, review the outline, and the agent lays it out page by page; this package supplies everything around the slides themselves.
3
+ ![LemonRiver — the agent-driven slide & deck platform](https://raw.githubusercontent.com/SegawaBeer/lemonriver/main/.github/assets/lemonriver-banner-en.png)
4
+
5
+ The runtime behind [LemonRiver](https://github.com/SegawaBeer/lemonriver) — the agent-driven slide & deck platform. Your own agent writes the deck; this package supplies everything around the slides themselves.
4
6
 
5
7
  ## Install
6
8
 
@@ -1,5 +1,5 @@
1
1
  import { r as printHeader, t as createCliLogger } from "./cli/bin.js";
2
- import { t as createViteConfig } from "./config-Begts3gq.js";
2
+ import { t as createViteConfig } from "./config-BI3VRI2n.js";
3
3
  import path from "node:path";
4
4
  import { build as build$1, mergeConfig } from "vite";
5
5
  //#region src/cli/build.ts
package/dist/cli/bin.js CHANGED
@@ -449,19 +449,26 @@ async function run(argv) {
449
449
  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").action(async (flags) => {
450
450
  if (flags.skillsCheck !== false) await runSkillsDriftCheck(resolveBuiltinSkillsDir());
451
451
  await assertViteResolvesToCore();
452
- const { dev } = await import("../dev-DjjzmT28.js");
452
+ const { dev } = await import("../dev-DpzBn_sf.js");
453
453
  await dev(flags);
454
454
  });
455
455
  program.command("build").description("Build a static site").option("--out-dir <dir>", "output directory (defaults to `dist`)").action(async (flags) => {
456
456
  await assertViteResolvesToCore();
457
- const { build } = await import("../build-Bdagm0FU.js");
457
+ const { build } = await import("../build-CiT4CNey.js");
458
458
  await build(flags);
459
459
  });
460
460
  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) => {
461
461
  await assertViteResolvesToCore();
462
- const { preview } = await import("../preview-C9y9MTY1.js");
462
+ const { preview } = await import("../preview-Dro8hl5_.js");
463
463
  await preview(flags);
464
464
  });
465
+ program.command("mcp").description("Run the LemonRiver MCP server over stdio, for the agent working in this folder").action(async () => {
466
+ const { runMcp } = await import("../mcp-CjYDzcJa.js");
467
+ await runMcp(process.cwd(), {
468
+ input: process.stdin,
469
+ output: process.stdout
470
+ });
471
+ });
465
472
  program.command("sync:skills").description("Sync built-in skills from @lemonriver/core into this workspace").option("--dry-run", "show what would change without writing").action(async (flags) => {
466
473
  await syncSkills(resolveBuiltinSkillsDir(), flags);
467
474
  });
@@ -475,4 +482,4 @@ run(process.argv.slice(2)).catch((err) => {
475
482
  process.exit(1);
476
483
  });
477
484
  //#endregion
478
- export { printUrls as a, printShortcutsHint as i, formatError as n, shortcutsEnabled as o, printHeader as r, startupDuration as s, createCliLogger as t };
485
+ export { printUrls as a, startupDuration as c, printShortcutsHint as i, formatError as n, readVersion as o, printHeader as r, shortcutsEnabled as s, createCliLogger as t };
@@ -0,0 +1,57 @@
1
+ import path from "node:path";
2
+ import fs from "node:fs/promises";
3
+ //#region src/lemonriver/mcp/client.ts
4
+ /** Everything the agent is shown when the dev server is not up belongs in one sentence. */
5
+ const NOT_RUNNING = "LemonRiver 没在运行,先打开 LemonRiver";
6
+ function serverInfoFile(cwd) {
7
+ return path.join(cwd, "node_modules", ".open-slide", "server.json");
8
+ }
9
+ async function readServerInfo(cwd) {
10
+ try {
11
+ const raw = JSON.parse(await fs.readFile(serverInfoFile(cwd), "utf8"));
12
+ if (typeof raw.url !== "string" || typeof raw.token !== "string") return null;
13
+ return {
14
+ url: raw.url,
15
+ token: raw.token,
16
+ port: typeof raw.port === "number" ? raw.port : 0,
17
+ pid: typeof raw.pid === "number" ? raw.pid : 0
18
+ };
19
+ } catch {
20
+ return null;
21
+ }
22
+ }
23
+ var DevServerError = class extends Error {
24
+ constructor(message) {
25
+ super(message);
26
+ this.name = "DevServerError";
27
+ }
28
+ };
29
+ /**
30
+ * One call to the dev server's `/__lr/mcp/*` endpoints. The body is either the
31
+ * tool's JSON answer or an error carrying the sentence the agent should read.
32
+ */
33
+ async function callDevServer(cwd, endpoint, body) {
34
+ const info = await readServerInfo(cwd);
35
+ if (!info) throw new DevServerError(NOT_RUNNING);
36
+ let res;
37
+ try {
38
+ res = await fetch(new URL(`/__lr/mcp/${endpoint}`, `${info.url.replace(/\/+$/, "")}/`), {
39
+ method: "POST",
40
+ headers: {
41
+ "content-type": "application/json",
42
+ authorization: `Bearer ${info.token}`
43
+ },
44
+ body: JSON.stringify(body ?? {})
45
+ });
46
+ } catch {
47
+ throw new DevServerError(NOT_RUNNING);
48
+ }
49
+ let parsed = null;
50
+ try {
51
+ parsed = await res.json();
52
+ } catch {}
53
+ if (!res.ok) throw new DevServerError(parsed && typeof parsed === "object" && typeof parsed.error === "string" ? parsed.error : NOT_RUNNING);
54
+ return parsed;
55
+ }
56
+ //#endregion
57
+ export { readServerInfo as n, callDevServer as t };