@lemonriver/core 0.8.0 → 1.0.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/README.md +3 -1
- package/dist/{build-Bdagm0FU.js → build-CiT4CNey.js} +1 -1
- package/dist/cli/bin.js +11 -4
- package/dist/client-DpO_eR9X.js +57 -0
- package/dist/{config-Begts3gq.js → config-BI3VRI2n.js} +4557 -4596
- package/dist/{dev-DjjzmT28.js → dev-DpzBn_sf.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/locale/index.js +1 -1
- package/dist/mcp-CjYDzcJa.js +262 -0
- package/dist/{preview-C9y9MTY1.js → preview-Dro8hl5_.js} +2 -2
- package/dist/vite/index.js +1 -1
- package/dist/{zh-tw-DcrDeKxr.js → zh-tw-BhYyMx0-.js} +40 -40
- package/package.json +1 -1
- package/skills/slide-authoring/SKILL.md +2 -0
- package/src/app/lemonriver/agent-providers/section.tsx +13 -4
- package/src/app/lemonriver/board/use-self-check.ts +1 -1
- package/src/app/lemonriver/chrome/app-chrome.tsx +6 -0
- package/src/app/lemonriver/chrome/sidebar-extras.tsx +9 -1
- package/src/app/lemonriver/guide/guide-prompt.tsx +89 -0
- package/src/app/lemonriver/guide/state.ts +29 -0
- package/src/app/lemonriver/guide/use-guide.ts +17 -0
- package/src/app/lemonriver/help/help-page.tsx +5 -0
- package/src/app/lemonriver/help/model.test.ts +72 -0
- package/src/app/lemonriver/help/model.ts +10 -1
- package/src/app/lemonriver/home/home-page.tsx +25 -7
- package/src/app/lemonriver/mcp/respond.ts +47 -0
- package/src/app/lemonriver/mcp/screenshot.tsx +155 -0
- package/src/app/lemonriver/mcp/self-check.tsx +65 -0
- package/src/app/lemonriver/outline/describe-page.tsx +3 -1
- package/src/app/lemonriver/settings/settings-page.tsx +3 -3
- package/src/app/lemonriver/share/freeze.ts +13 -5
- package/src/app/lemonriver/text/en.ts +222 -5
- package/src/app/lemonriver/text/es.ts +18 -4
- package/src/app/lemonriver/text/ja.ts +18 -4
- package/src/app/lemonriver/text/types.ts +13 -1
- package/src/app/lemonriver/text/zh-cn.ts +215 -4
- package/src/app/lemonriver/text/zh-tw.ts +215 -4
- package/src/app/lemonriver/update/beta-badge.tsx +3 -0
- package/src/app/lemonriver/update/version.test.ts +14 -0
- package/src/app/lemonriver/update/version.ts +5 -0
- package/src/locale/en.ts +8 -8
- package/src/locale/es.ts +10 -8
- package/src/locale/ja.ts +9 -8
- package/src/locale/zh-cn.ts +9 -8
- package/src/locale/zh-tw.ts +9 -8
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @lemonriver/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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,
|
|
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 };
|