yuque-cookie-plugin 0.1.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/.env.example +5 -0
- package/README.md +253 -0
- package/bin/yuque-local.mjs +3 -0
- package/dist/auth.js +439 -0
- package/dist/cli.js +692 -0
- package/dist/client-cookie.js +544 -0
- package/dist/download-utils.js +579 -0
- package/dist/downloader.js +388 -0
- package/dist/editor-bridge.js +240 -0
- package/dist/fs-utils.js +9 -0
- package/dist/lake-diff.js +113 -0
- package/dist/lake-heading-numbering.js +29 -0
- package/dist/lake-insert.js +34 -0
- package/dist/lake-markdown.js +54 -0
- package/dist/lake-parser.js +79 -0
- package/dist/lake-transform.js +12 -0
- package/dist/reports.js +10 -0
- package/dist/serve-book.js +134 -0
- package/dist/types.js +1 -0
- package/docs/docker-quickstart.md +96 -0
- package/docs/native-lake-capability.md +101 -0
- package/docs/npm-release.md +91 -0
- package/docs/real-acceptance.md +146 -0
- package/docs/usage-zh.md +580 -0
- package/package.json +71 -0
- package/skills/yuque-cookie-plugin/SKILL.md +58 -0
- package/skills/yuque-cookie-plugin/commands.yaml +61 -0
- package/skills/yuque-cookie-plugin/reference/agent-spec.md +51 -0
- package/vendor/lake-editor/CodeMirror.js +1 -0
- package/vendor/lake-editor/antd.4.24.13.css +26886 -0
- package/vendor/lake-editor/doc.css +23603 -0
- package/vendor/lake-editor/doc.umd.js +2 -0
- package/vendor/lake-editor/katex.js +18829 -0
- package/vendor/lake-editor/lake-editor-icon.js +1 -0
- package/vendor/lake-editor/react-dom.production.min.js +267 -0
- package/vendor/lake-editor/react.production.min.js +31 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# yuque-cookie-plugin command registry
|
|
2
|
+
|
|
3
|
+
auth.login:
|
|
4
|
+
cli: "yuque-local auth login"
|
|
5
|
+
description: "Open a local browser page for Yuque cookie setup"
|
|
6
|
+
optional: ["--manual", "--port", "--home-url", "--session", "--ctoken"]
|
|
7
|
+
example: "yuque-local auth login --manual"
|
|
8
|
+
reference: "reference/agent-spec.md"
|
|
9
|
+
|
|
10
|
+
auth.status:
|
|
11
|
+
cli: "yuque-local auth status"
|
|
12
|
+
description: "Check saved credential metadata and optionally validate against a Yuque URL"
|
|
13
|
+
optional: ["<doc-or-book-url>", "--json"]
|
|
14
|
+
example: "yuque-local auth status https://www.yuque.com/user/book --json"
|
|
15
|
+
reference: "reference/agent-spec.md"
|
|
16
|
+
|
|
17
|
+
doctor:
|
|
18
|
+
cli: "yuque-local doctor"
|
|
19
|
+
description: "Inspect CLI version, runtime, auth config path, and skill install status"
|
|
20
|
+
optional: ["--json"]
|
|
21
|
+
example: "yuque-local doctor --json"
|
|
22
|
+
reference: "reference/agent-spec.md"
|
|
23
|
+
|
|
24
|
+
skill.install:
|
|
25
|
+
cli: "yuque-local skill install"
|
|
26
|
+
description: "Install this AI skill into local supported agent skill directories"
|
|
27
|
+
optional: ["--json"]
|
|
28
|
+
example: "yuque-local skill install --json"
|
|
29
|
+
reference: "reference/agent-spec.md"
|
|
30
|
+
|
|
31
|
+
book.download:
|
|
32
|
+
cli: "yuque-local book download"
|
|
33
|
+
description: "Download a Yuque knowledge base with resources and reports"
|
|
34
|
+
required: ["<book-url>"]
|
|
35
|
+
optional: ["--dist-dir", "--incremental", "--quiet", "--json"]
|
|
36
|
+
example: "yuque-local book download https://www.yuque.com/user/book --dist-dir download --incremental --quiet --json"
|
|
37
|
+
reference: "reference/agent-spec.md"
|
|
38
|
+
|
|
39
|
+
doc.create:
|
|
40
|
+
cli: "yuque-local doc create"
|
|
41
|
+
description: "Create a Yuque document from Markdown and optionally apply native Lake heading numbering"
|
|
42
|
+
required: ["<book-url>", "--title", "--markdown-file"]
|
|
43
|
+
optional: ["--number-headings", "--slug", "--no-toc", "--json"]
|
|
44
|
+
example: "yuque-local doc create https://www.yuque.com/user/book --title Title --markdown-file article.md --number-headings --json"
|
|
45
|
+
reference: "reference/agent-spec.md"
|
|
46
|
+
|
|
47
|
+
doc.snapshot:
|
|
48
|
+
cli: "yuque-local doc snapshot"
|
|
49
|
+
description: "Create a local snapshot before editing"
|
|
50
|
+
required: ["<doc-url>", "--out"]
|
|
51
|
+
optional: ["--json"]
|
|
52
|
+
example: "yuque-local doc snapshot https://www.yuque.com/user/book/doc --out /tmp/doc.snapshot.json --json"
|
|
53
|
+
reference: "reference/agent-spec.md"
|
|
54
|
+
|
|
55
|
+
doc.apply_lake:
|
|
56
|
+
cli: "yuque-local doc apply-lake"
|
|
57
|
+
description: "Apply Lake content to a document with built-in backup/report safeguards"
|
|
58
|
+
required: ["<doc-url>", "--lake-file"]
|
|
59
|
+
optional: ["--dry-run", "--json"]
|
|
60
|
+
example: "yuque-local doc apply-lake https://www.yuque.com/user/book/doc --lake-file body_asl.html --dry-run --json"
|
|
61
|
+
reference: "reference/agent-spec.md"
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Agent Spec
|
|
2
|
+
|
|
3
|
+
Use `yuque-local` as the only execution surface. This project is a local CLI automation tool, not an MCP service and not an OpenAPI token wrapper.
|
|
4
|
+
|
|
5
|
+
## JSON Contract
|
|
6
|
+
|
|
7
|
+
When `--json` is passed, commands should prefer a stable envelope:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
{
|
|
11
|
+
"status": "success",
|
|
12
|
+
"message": "operation completed",
|
|
13
|
+
"data": {},
|
|
14
|
+
"error": null,
|
|
15
|
+
"metadata": {}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Some legacy calls without `--json` may return raw JSON objects or short prose. For agent automation, pass `--json`.
|
|
20
|
+
|
|
21
|
+
## Auth
|
|
22
|
+
|
|
23
|
+
Use:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yuque-local auth status <url> --json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If auth is missing or expired, stop and ask the user to run:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
yuque-local auth login
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For Docker, SSH, or headless terminals:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yuque-local auth login --manual
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Never request raw cookie values in the conversation.
|
|
42
|
+
|
|
43
|
+
## Safe Write Flow
|
|
44
|
+
|
|
45
|
+
1. Snapshot the online document.
|
|
46
|
+
2. Generate or transform content locally.
|
|
47
|
+
3. Run `--dry-run` when supported.
|
|
48
|
+
4. Apply only after the user approves the intended target and content.
|
|
49
|
+
5. Keep report paths from stdout for audit.
|
|
50
|
+
|
|
51
|
+
Do not delete, replace, or batch-update documents unless the user explicitly asked for that operation.
|