@mx-space/cli 0.13.1 → 0.13.3

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 (63) hide show
  1. package/README.md +60 -1
  2. package/ROADMAP.md +11 -8
  3. package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-DTxuYHmG.mjs} +2267 -431
  4. package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-BlCLnfA6.mjs} +47 -10
  5. package/dist/Lexical.prod-CeB9UQuo.mjs +6816 -0
  6. package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-CdFkLR_D.mjs} +131 -39
  7. package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-ktUajxsv.mjs} +2 -2
  8. package/dist/LexicalClipboard.prod-DliyLofW.mjs +429 -0
  9. package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-CL9tHWJX.mjs} +81 -67
  10. package/dist/LexicalCodeCore.prod-BoMSJc29.mjs +651 -0
  11. package/dist/LexicalDragon.dev-CqW7Aq5H.mjs +186 -0
  12. package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-DLXctJyy.mjs} +3 -2
  13. package/dist/LexicalDragon.prod-DHI3T6n5.mjs +121 -0
  14. package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-BP-18zns.mjs} +352 -38
  15. package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-BWH6xbzG.mjs} +9 -4
  16. package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-Cs6OgrDn.mjs} +479 -330
  17. package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-DJp__UcP.mjs} +2 -2
  18. package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-o0v9cIu5.mjs} +2 -2
  19. package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-DoymwFpG.mjs} +327 -269
  20. package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-CVkbWtUA.mjs} +6 -4
  21. package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-C2b3z99k.mjs} +355 -353
  22. package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-7cgLOLIe.mjs} +70 -59
  23. package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-DWFgoXHR.mjs} +211 -212
  24. package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-Ci2iOxFx.mjs} +246 -198
  25. package/dist/LexicalList.prod-D0xX5d3G.mjs +944 -0
  26. package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-C0ZYCyuR.mjs} +130 -38
  27. package/dist/LexicalMarkdown.prod-0M-Nc-rh.mjs +932 -0
  28. package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-Cnr1kDym.mjs} +151 -122
  29. package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-BUJZAiap.mjs} +8 -11
  30. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +538 -0
  31. package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-C4L7l8OB.mjs} +10 -9
  32. package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-CLKroUMQ.mjs} +4 -4
  33. package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-DzFqpTlw.mjs} +144 -146
  34. package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-Cc9-zqKa.mjs} +186 -121
  35. package/dist/LexicalTable.prod-BgO4nCxy.mjs +2336 -0
  36. package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-BRgK0L6G.mjs} +375 -35
  37. package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-BVAwOkL4.mjs} +24 -12
  38. package/dist/LexicalUtils.prod-C1gtvVDP.mjs +504 -0
  39. package/dist/bin/mxs.mjs +1 -1
  40. package/dist/{esm-DFrz5rIo.mjs → esm-BNu4sUWV.mjs} +220 -185
  41. package/dist/esm-jbwcVZth.mjs +2 -0
  42. package/dist/index.d.mts +46 -17
  43. package/dist/index.mjs +1 -1
  44. package/dist/{mxs-DXpzbUf4.mjs → mxs-zPvjkoNC.mjs} +8235 -6041
  45. package/dist/vendor/litexml/cli.mjs +24150 -0
  46. package/dist/vendor/litexml/litexml-html-preview-client.css +8862 -0
  47. package/dist/vendor/litexml/litexml-html-preview-client.js +163816 -0
  48. package/dist/vendor/litexml/style.css +96 -0
  49. package/package.json +21 -22
  50. package/skills/commands-ai.md +115 -0
  51. package/skills/commands-preview.md +3 -3
  52. package/skills/overview.md +1 -0
  53. package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
  54. package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
  55. package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
  56. package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
  57. package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
  58. package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
  59. package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
  60. package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
  61. package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
  62. package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
  63. package/dist/esm-DXO9Afik.mjs +0 -2
package/README.md CHANGED
@@ -469,6 +469,65 @@ description: Expand-contract Postgres migrations safe for rolling deploys.
469
469
  Use when authoring or reviewing any Postgres migration in this codebase.
470
470
  ```
471
471
 
472
+ ## AI
473
+
474
+ Manage AI artifacts (summary, translation, insights) produced by the core AI module. Article references accept Snowflake id, post slug, or note nid — the CLI resolves to an article id via post-then-note lookup. Record references (`<recordId>`) are raw Snowflakes.
475
+
476
+ Generate verbs (`summary regen`, `translate run`, `insights refresh`) enqueue a task on the server, then poll `GET /tasks/:id` until the task reaches a terminal status (`completed`, `partial_failed`, `failed`, `cancelled`). Progress lines write to stderr. Pass `--no-wait` to return immediately with `status: pending` after the task is created. If the server reports `created: false`, an in-flight deduplicated task already exists and the CLI joins it instead of erroring. The polling cadence is 1000 ms by default; override via `MXS_AI_POLL_MS=<n>` for tests.
477
+
478
+ ### Summary
479
+
480
+ | Command | Description |
481
+ | -------------------------------------------------- | ----------------------------------------------------------------- |
482
+ | `mxs ai summary regen <id> [--to <lang>...]` | Regenerate an article's summary (optionally for given languages). |
483
+ | `mxs ai summary list [--page <n>] [--size <n>] [--grouped]` | List summaries (flat or grouped by article). |
484
+ | `mxs ai summary get <recordId>` | Get one summary by record id. |
485
+ | `mxs ai summary by-article <id> [--lang <l>] [--only-db]` | Show an article's summary; `--only-db` skips auto-generate. |
486
+ | `mxs ai summary edit <recordId>` | Edit the `summary` field via `$EDITOR` (JSON envelope). |
487
+ | `mxs ai summary delete <recordId> [--force]` | Delete a summary record. |
488
+
489
+ ### Translate
490
+
491
+ | Command | Description |
492
+ | -------------------------------------------------------- | ------------------------------------------------------------- |
493
+ | `mxs ai translate run <id> --to <lang>... [--no-wait]` | Translate an article into one or more languages (`--to` required, repeatable). |
494
+ | `mxs ai translate list [--page <n>] [--size <n>]` | List translations (always grouped by article — no flat list server-side). |
495
+ | `mxs ai translate get <recordId>` | Get one translation by record id. |
496
+ | `mxs ai translate by-article <id> [--lang <l>]` | Show an article's translations (single lang or all). |
497
+ | `mxs ai translate languages <id>` | List languages an article has been translated into. |
498
+ | `mxs ai translate edit <recordId>` | Edit translation fields via `$EDITOR` (JSON envelope). |
499
+ | `mxs ai translate delete <recordId> [--force]` | Delete a translation record. |
500
+
501
+ ### Translation Entries
502
+
503
+ The i18n dictionary entries layer used by category / topic / note metadata. `--key-path` accepts only the server-validated set: `category.name`, `topic.name`, `topic.introduce`, `topic.description`, `note.mood`, `note.weather`.
504
+
505
+ | Command | Description |
506
+ | ----------------------------------------------------------------------------- | ------------------------------------------------------ |
507
+ | `mxs ai translate entries list [--page <n>] [--size <n>] [--key-path <p>] [--lang <l>]` | List entries with optional filters. |
508
+ | `mxs ai translate entries generate [--key-path <p>...] [--to <lang>...]` | Trigger regeneration of entries. |
509
+ | `mxs ai translate entries edit <recordId>` | Edit `translatedText` via `$EDITOR` (JSON envelope). |
510
+ | `mxs ai translate entries delete <recordId> [--force]` | Delete an entry. |
511
+
512
+ ### Insights
513
+
514
+ | Command | Description |
515
+ | ------------------------------------------------------ | ------------------------------------------------------------------- |
516
+ | `mxs ai insights refresh <id> [--no-wait]` | Refresh AI insights for an article. |
517
+ | `mxs ai insights list [--page <n>] [--size <n>] [--grouped]` | List insights (flat or grouped by article). |
518
+ | `mxs ai insights get <recordId>` | Get one insights record by record id. |
519
+ | `mxs ai insights by-article <id> [--lang <l>] [--only-db]` | Show an article's insights; `--only-db` skips auto-generate. |
520
+ | `mxs ai insights edit <recordId>` | Edit the `content` field via `$EDITOR` (JSON envelope). |
521
+ | `mxs ai insights delete <recordId> [--force]` | Delete an insights record. |
522
+
523
+ ```bash
524
+ mxs ai summary regen my-post --to en --to ja
525
+ mxs ai translate run my-post --to en
526
+ mxs ai insights refresh my-post
527
+ mxs ai summary list --grouped
528
+ mxs ai translate languages my-post
529
+ ```
530
+
472
531
  ## Configuration
473
532
 
474
533
  | Command | Description |
@@ -607,7 +666,7 @@ mxs preview ./post.xml --save out.html # write HTML to file
607
666
  mxs preview ./post.xml --print # emit HTML to stdout
608
667
  ```
609
668
 
610
- The variant (`article` / `note`) is auto-detected from the envelope root. Override with `--variant` for raw LiteXML fragments. The command does not contact `mx-core` — it's a pure local render via `@haklex/rich-litexml-cli`.
669
+ The variant (`article` / `note`) is auto-detected from the envelope root. Override with `--variant` for raw LiteXML fragments. The command does not contact `mx-core` — it uses the LiteXML preview renderer vendored into the published CLI bundle.
611
670
 
612
671
  ## Skill bundle
613
672
 
package/ROADMAP.md CHANGED
@@ -11,7 +11,7 @@
11
11
  ## Shipped in v0.6
12
12
 
13
13
  - `mxs skill` — bundled AI-agent documentation. List, get, all, search across chapters shipped inside the CLI (`packages/cli/skills/*.md`); liteXML chapters loaded live from the installed `@haklex/rich-litexml` package. Default output is raw markdown for direct context injection.
14
- - `mxs preview <file>` — local HTML preview of a LiteXML fragment or `<mxpost>` / `<mxnote>` envelope. Wraps `@haklex/rich-litexml-cli` so the output matches the editor renderer.
14
+ - `mxs preview <file>` — local HTML preview of a LiteXML fragment or `<mxpost>` / `<mxnote>` envelope. Uses the vendored LiteXML preview renderer so the output matches the editor renderer without runtime package dependencies.
15
15
  - `mxs project` — full CRUD for portfolio projects: `list`, `get`, `view`, `create`, `edit` ($EDITOR JSON envelope), `update`, `delete`. Resolver accepts unique `name` or Snowflake id. Server adds `PATCH /projects/:id`, a Zod DTO on create/update, and a `PROJECT_NAME_TAKEN` (409) error on duplicate names.
16
16
 
17
17
  ## Next — Comment moderation
@@ -24,15 +24,18 @@
24
24
 
25
25
  State map: `unread=0`, `read=1`, `junk=2`. Routes single-id verbs through the server's batch endpoints (`PATCH /comments/batch/state`, `DELETE /comments/batch`) for one unified path.
26
26
 
27
- ## v2 AI
27
+ ## Shipped in v0.13
28
28
 
29
- > **Note (v0.3):** Service interface placeholders for AI, Backup, and Cache are reserved in `src/services/{Ai,Backup,Cache}.ts` and threaded through the layer composition. Implementation is pending.
29
+ - `mxs ai` full management surface for AI artifacts.
30
+ - `mxs ai summary {regen,list,get,by-article,edit,delete}`
31
+ - `mxs ai translate {run,list,get,by-article,languages,edit,delete}`
32
+ - `mxs ai translate entries {list,generate,edit,delete}`
33
+ - `mxs ai insights {refresh,list,get,by-article,edit,delete}`
34
+ - Generate verbs enqueue a task on the server and poll `GET /tasks/:id` until terminal; `--no-wait` returns the `taskId` immediately. Dedup-aware: `created: false` joins the in-flight task.
30
35
 
31
- - AI module commands
32
- - `mxs ai summary regen <id>`
33
- - `mxs ai translate <id> --to <locale>`
34
- - `mxs ai insights refresh`
35
- - `mxs ai tokens`
36
+ ## v2 — AI tokens / usage
37
+
38
+ - `mxs ai tokens` aggregate `totalCost` and `totalTokens` across recent AI tasks. Pending a final decision on client-side aggregation vs. a dedicated `/ai/usage` endpoint on the server.
36
39
 
37
40
  ## v3
38
41