@mx-space/cli 0.13.1 → 0.13.2

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 (58) hide show
  1. package/README.md +59 -0
  2. package/ROADMAP.md +10 -7
  3. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
  4. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
  5. package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
  6. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
  7. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
  8. package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
  9. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
  10. package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
  11. package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
  12. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
  13. package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
  14. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
  15. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
  16. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
  17. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
  18. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
  19. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
  20. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
  21. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
  22. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
  23. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
  24. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
  25. package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
  26. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
  27. package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
  28. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
  29. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
  30. package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
  31. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
  32. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
  33. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
  34. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
  35. package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
  36. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
  37. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
  38. package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
  39. package/dist/bin/mxs.mjs +1 -1
  40. package/dist/esm-BumPuCXw.mjs +2 -0
  41. package/dist/{esm-DFrz5rIo.mjs → esm-DupC6TTP.mjs} +214 -179
  42. package/dist/index.d.mts +46 -17
  43. package/dist/index.mjs +1 -1
  44. package/dist/{mxs-DXpzbUf4.mjs → mxs-BgAyMQdq.mjs} +8384 -6209
  45. package/package.json +17 -17
  46. package/skills/commands-ai.md +115 -0
  47. package/skills/overview.md +1 -0
  48. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  49. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  50. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  51. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  52. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  53. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  54. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  55. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  56. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  57. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  58. package/dist/esm-DXO9Afik.mjs +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.13.1",
3
+ "version": "0.13.2",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",
@@ -48,33 +48,33 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@clack/prompts": "^1.5.1",
51
+ "@clack/prompts": "^1.6.0",
52
52
  "@effect/cli": "0.75.2",
53
- "@effect/platform": "0.96.1",
53
+ "@effect/platform": "0.96.2",
54
54
  "@effect/platform-node": "0.107.0",
55
- "@haklex/rich-headless": "0.27.0",
56
- "@haklex/rich-litexml": "0.27.0",
57
- "@haklex/rich-litexml-cli": "0.27.0",
58
- "@lexical/headless": "^0.45.0",
59
- "better-auth": "^1.6.16",
60
- "effect": "3.21.3",
61
- "fast-xml-parser": "5.8.0",
55
+ "@haklex/rich-headless": "0.29.1",
56
+ "@haklex/rich-litexml": "0.29.0",
57
+ "@haklex/rich-litexml-cli": "0.29.0",
58
+ "@lexical/headless": "^0.46.0",
59
+ "better-auth": "^1.6.20",
60
+ "effect": "3.21.4",
61
+ "fast-xml-parser": "5.9.3",
62
62
  "get-east-asian-width": "^1.6.0",
63
- "lexical": "^0.45.0",
63
+ "lexical": "^0.46.0",
64
64
  "minisearch": "^7.2.0",
65
65
  "open": "^11.0.0",
66
- "semver": "7.8.4",
67
- "@mx-space/api-client": "5.3.1",
68
- "@mx-space/editor": "0.1.0"
66
+ "semver": "7.8.5",
67
+ "@mx-space/api-client": "5.4.0",
68
+ "@mx-space/editor": "0.2.0"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@effect/vitest": "0.29.0",
72
- "@types/node": "25.9.3",
72
+ "@types/node": "26.0.0",
73
73
  "@types/semver": "7.7.1",
74
- "tsdown": "0.22.2",
74
+ "tsdown": "0.22.3",
75
75
  "tsx": "^4.22.4",
76
76
  "typescript": "6.0.3",
77
- "vitest": "4.1.8"
77
+ "vitest": "4.1.9"
78
78
  },
79
79
  "scripts": {
80
80
  "package": "rm -rf dist && tsdown",
@@ -0,0 +1,115 @@
1
+ ---
2
+ slug: commands-ai
3
+ title: AI commands
4
+ description: mxs ai — manage AI summary / translation / insights artifacts
5
+ order: 45
6
+ ---
7
+
8
+ # AI commands
9
+
10
+ `mxs ai` manages every AI artifact the core server produces: per-article **summary**, per-article **translation**, per-article **insights**, plus the i18n **translation entries** dictionary used for category / topic / note metadata.
11
+
12
+ Article references (`<id>`) accept a Snowflake id, a post slug, or a numeric note nid. The CLI resolves through post first, then note. Record references (`<recordId>`) are raw Snowflakes — they are NOT resolved.
13
+
14
+ ## Generate verbs (async)
15
+
16
+ `summary regen`, `translate run`, `insights refresh` enqueue a task and poll `GET /tasks/:id` until terminal (`succeeded` / `failed` / `cancelled`, or the spec-2 `completed` / `partial_failed` aliases). Progress lines write to stderr. `--no-wait` returns immediately with `status: pending`. If the server reports `created: false`, an in-flight deduplicated task already exists; the CLI joins it instead of erroring. Polling cadence is 1000 ms by default; override with `MXS_AI_POLL_MS=<ms>` for tests.
17
+
18
+ | Command | Purpose |
19
+ | ---------------------------------------------------- | --------------------------------------------------------------- |
20
+ | `mxs ai summary regen <id> [--to <lang>...]` | Regenerate an article's AI summary. |
21
+ | `mxs ai translate run <id> --to <lang>...` | Translate an article into one or more languages (`--to` required, repeatable). |
22
+ | `mxs ai insights refresh <id> [--to <lang>...]` | Refresh AI insights for an article. |
23
+
24
+ Common flags on the three generate verbs:
25
+
26
+ | Flag | Effect |
27
+ | ---------------- | ------------------------------------------------------------------ |
28
+ | `--to <lang>` | Target language code (repeatable). Forwarded as `targetLanguages`. |
29
+ | `--no-wait` | Return after task creation; print `status: pending` and exit 0. |
30
+
31
+ On success the CLI emits an `ai-task` view: `taskId`, `status`, `refId`, `targetLanguages`, `totalTokens`, `totalCost` (cents), `resultIds`.
32
+
33
+ ## Summary read / manage
34
+
35
+ | Command | Purpose |
36
+ | ------------------------------------------------------------- | ------------------------------------------------------------- |
37
+ | `mxs ai summary list [--page <n>] [--size <n>] [--grouped]` | List summaries (flat or grouped by article). |
38
+ | `mxs ai summary get <recordId>` | Get one summary by record id. |
39
+ | `mxs ai summary by-article <id> [--lang <l>] [--only-db]` | Show an article's summary; `--only-db` skips auto-generation. |
40
+ | `mxs ai summary edit <recordId>` | Edit the `summary` field via `$EDITOR` (JSON envelope). |
41
+ | `mxs ai summary delete <recordId> [--force]` | Delete a summary record. `--force` required in non-TTY. |
42
+
43
+ ## Translation read / manage
44
+
45
+ There is no flat list endpoint for translations server-side. `mxs ai translate list` is always grouped by article.
46
+
47
+ | Command | Purpose |
48
+ | -------------------------------------------------------- | -------------------------------------------------------- |
49
+ | `mxs ai translate list [--page <n>] [--size <n>]` | List translations (grouped by article). |
50
+ | `mxs ai translate get <recordId>` | Get one translation by record id. |
51
+ | `mxs ai translate by-article <id> [--lang <l>]` | Show an article's translations (single lang or all). |
52
+ | `mxs ai translate languages <id>` | List languages an article has been translated into. |
53
+ | `mxs ai translate edit <recordId>` | Edit translation fields via `$EDITOR` (JSON envelope). |
54
+ | `mxs ai translate delete <recordId> [--force]` | Delete a translation record. |
55
+
56
+ Edit envelope keys: `title`, `text`, `subtitle` (nullable), `summary`, `tags`, `content`. Only included keys are PATCHed.
57
+
58
+ ## Translation entries (i18n dictionary)
59
+
60
+ The dictionary layer used for category / topic / note metadata translations. `--key-path` accepts ONLY the server-validated set: `category.name`, `topic.name`, `topic.introduce`, `topic.description`, `note.mood`, `note.weather`.
61
+
62
+ | Command | Purpose |
63
+ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
64
+ | `mxs ai translate entries list [--page <n>] [--size <n>] [--key-path <p>] [--lang <l>]` | List entries with optional filters. |
65
+ | `mxs ai translate entries generate [--key-path <p>...] [--to <lang>...]` | Regenerate entries (synchronous on the server). |
66
+ | `mxs ai translate entries edit <recordId>` | Edit `translatedText` via `$EDITOR` (JSON envelope). |
67
+ | `mxs ai translate entries delete <recordId> [--force]` | Delete an entry. |
68
+
69
+ ## Insights read / manage
70
+
71
+ | Command | Purpose |
72
+ | ------------------------------------------------------------- | -------------------------------------------------------------- |
73
+ | `mxs ai insights list [--page <n>] [--size <n>] [--grouped]` | List insights (flat or grouped by article). |
74
+ | `mxs ai insights get <recordId>` | Get one insights record by record id. |
75
+ | `mxs ai insights by-article <id> [--lang <l>] [--only-db]` | Show an article's insights; `--only-db` skips auto-generation. |
76
+ | `mxs ai insights edit <recordId>` | Edit the `content` field via `$EDITOR` (JSON envelope). |
77
+ | `mxs ai insights delete <recordId> [--force]` | Delete an insights record. |
78
+
79
+ ## Exit codes specific to `ai`
80
+
81
+ | Code | When |
82
+ | ------ | ---------------------------------------------------------------------------------------- |
83
+ | `0` | Task reached `succeeded`/`completed`; or `--no-wait`; or read/edit/delete completed. |
84
+ | `1` | `AiTaskCreateFailed` (no `taskId` in response) or `AiTaskFailed` (terminal `failed`/`cancelled`/`partial_failed`). |
85
+ | `7` | `AiRecordNotFound` (`get`/`edit`/`delete` against a missing record). |
86
+
87
+ Network / auth / validation errors map per the global table — see `safety`.
88
+
89
+ ## Examples
90
+
91
+ ```bash
92
+ # Regenerate an article's summary and wait for it
93
+ mxs ai summary regen my-post --to en --to ja
94
+
95
+ # Translate to Japanese, fire and forget
96
+ mxs ai translate run my-post --to ja --no-wait
97
+
98
+ # Refresh insights, then read the result
99
+ mxs ai insights refresh my-post
100
+ mxs ai insights by-article my-post --only-db
101
+
102
+ # Inventory
103
+ mxs ai summary list --grouped --output json | jq .
104
+ mxs ai translate languages my-post
105
+
106
+ # Patch a translation record through $EDITOR
107
+ mxs ai translate edit 01HXXX...
108
+ ```
109
+
110
+ ## Notes for agents
111
+
112
+ - Always pass `--output json` (or `--json`) for machine-parseable output. The default `readable` mode is for humans.
113
+ - `created: false` is a normal join-existing path, NOT an error. Do not retry on it.
114
+ - The polling loop has no hard timeout. For very long translation runs across many languages, prefer `--no-wait` plus periodic `mxs ai translate by-article` polls.
115
+ - Edit envelopes are typed per resource. Unknown keys are rejected client-side before any PATCH is sent.
@@ -25,6 +25,7 @@ The audience is **AI agents**. Pass `--output llm` for raw markdown suitable for
25
25
  | Categories | `commands-category` |
26
26
  | Topics | `commands-topic` |
27
27
  | Snippets (server data / functions) | `commands-snippet` |
28
+ | AI summary / translation / insights / entries | `commands-ai` |
28
29
  | Server-side options | `commands-config` |
29
30
  | Authentication | `commands-auth` |
30
31
  | Local profile management | `commands-profile` |