@lumoai/cli 1.39.0 → 1.41.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.
Files changed (31) hide show
  1. package/assets/skill/SKILL.md +8 -3
  2. package/assets/skill/references/memory.md +99 -0
  3. package/assets/skill/references/sessions.md +49 -87
  4. package/assets/skill/references/verify.md +20 -0
  5. package/dist/cli/src/commands/memory-push.js +93 -0
  6. package/dist/cli/src/commands/memory-sync.js +104 -0
  7. package/dist/cli/src/commands/session-attach.js +29 -0
  8. package/dist/cli/src/index.js +18 -8
  9. package/dist/cli/src/lib/anchor-staleness.js +116 -0
  10. package/dist/cli/src/lib/apply-sync.js +59 -0
  11. package/dist/cli/src/lib/claude-memory-dir.js +20 -0
  12. package/dist/cli/src/lib/hook-runner.js +28 -0
  13. package/dist/cli/src/lib/local-memory-store.js +85 -0
  14. package/dist/cli/src/lib/managed-block.js +33 -0
  15. package/dist/cli/src/lib/memory-auto.js +114 -0
  16. package/dist/cli/src/lib/memory-content.js +50 -20
  17. package/dist/cli/src/lib/memory-reconcile.js +33 -0
  18. package/dist/cli/src/lib/sync-throttle.js +71 -0
  19. package/dist/cli/src/lib/upsync.js +50 -0
  20. package/dist/shared/src/code-anchor.js +92 -0
  21. package/dist/shared/src/index.js +5 -1
  22. package/package.json +1 -1
  23. package/dist/cli/src/commands/session-wrap.js +0 -48
  24. package/dist/cli/src/commands/wrap/blocked-prompt-section.js +0 -64
  25. package/dist/cli/src/commands/wrap/crossings-reminder.js +0 -49
  26. package/dist/cli/src/commands/wrap/fragment-usage-section.js +0 -66
  27. package/dist/cli/src/commands/wrap/memory-review-section.js +0 -81
  28. package/dist/cli/src/lib/failure-summary-api.js +0 -43
  29. package/dist/cli/src/lib/fragment-usage-api.js +0 -47
  30. package/dist/cli/src/lib/session-memory-api.js +0 -47
  31. package/dist/cli/src/lib/wrap-panel.js +0 -15
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchUsageDraft = fetchUsageDraft;
4
- exports.applyFragmentUsage = applyFragmentUsage;
5
- const api_1 = require("./api");
6
- function base(creds) {
7
- return (0, api_1.trimTrailingSlash)((0, api_1.resolveAuthedApiUrl)(creds.apiUrl));
8
- }
9
- /** GET the fragment-usage draft (this session's injected fragments). */
10
- async function fetchUsageDraft(creds, sessionId) {
11
- const url = `${base(creds)}/api/sessions/${encodeURIComponent(sessionId)}/fragment-usage`;
12
- const res = await fetch(url, {
13
- headers: { Authorization: `Bearer ${creds.token}` },
14
- });
15
- if (res.status === 401)
16
- throw new Error('API key invalid or revoked. Run `lumo auth login`.');
17
- if (!res.ok)
18
- throw new Error(`usage draft fetch failed (HTTP ${res.status})`);
19
- return (await res.json());
20
- }
21
- /** POST the usage vote (used refs). Throws the server message on non-2xx. */
22
- async function applyFragmentUsage(creds, sessionId, payload) {
23
- const url = `${base(creds)}/api/sessions/${encodeURIComponent(sessionId)}/fragment-usage`;
24
- const res = await fetch(url, {
25
- method: 'POST',
26
- headers: {
27
- Authorization: `Bearer ${creds.token}`,
28
- 'Content-Type': 'application/json',
29
- },
30
- body: JSON.stringify(payload),
31
- });
32
- if (res.status === 401)
33
- throw new Error('API key invalid or revoked. Run `lumo auth login`.');
34
- if (!res.ok) {
35
- let serverMsg = null;
36
- try {
37
- const errBody = (await res.json());
38
- if (typeof errBody.error === 'string')
39
- serverMsg = errBody.error;
40
- }
41
- catch {
42
- // body wasn't JSON
43
- }
44
- throw new Error(serverMsg ?? `usage vote failed (HTTP ${res.status})`);
45
- }
46
- return (await res.json());
47
- }
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fetchMemoryDraft = fetchMemoryDraft;
4
- exports.applyMemoryReview = applyMemoryReview;
5
- const api_1 = require("./api");
6
- function base(creds) {
7
- return (0, api_1.trimTrailingSlash)((0, api_1.resolveAuthedApiUrl)(creds.apiUrl));
8
- }
9
- /** GET the memory-review draft for the session. Throws on transport / non-200. */
10
- async function fetchMemoryDraft(creds, sessionId) {
11
- const url = `${base(creds)}/api/sessions/${encodeURIComponent(sessionId)}/session-memories`;
12
- const res = await fetch(url, {
13
- headers: { Authorization: `Bearer ${creds.token}` },
14
- });
15
- if (res.status === 401)
16
- throw new Error('API key invalid or revoked. Run `lumo auth login`.');
17
- if (!res.ok)
18
- throw new Error(`memory draft fetch failed (HTTP ${res.status})`);
19
- return (await res.json());
20
- }
21
- /** POST the review (deletes + promotes + watermark). Throws server message on non-2xx. */
22
- async function applyMemoryReview(creds, sessionId, payload) {
23
- const url = `${base(creds)}/api/sessions/${encodeURIComponent(sessionId)}/memory-review`;
24
- const res = await fetch(url, {
25
- method: 'POST',
26
- headers: {
27
- Authorization: `Bearer ${creds.token}`,
28
- 'Content-Type': 'application/json',
29
- },
30
- body: JSON.stringify(payload),
31
- });
32
- if (res.status === 401)
33
- throw new Error('API key invalid or revoked. Run `lumo auth login`.');
34
- if (!res.ok) {
35
- let serverMsg = null;
36
- try {
37
- const errBody = (await res.json());
38
- if (typeof errBody.error === 'string')
39
- serverMsg = errBody.error;
40
- }
41
- catch {
42
- // body wasn't JSON
43
- }
44
- throw new Error(serverMsg ?? `memory review failed (HTTP ${res.status})`);
45
- }
46
- return (await res.json());
47
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runWrapPanel = runWrapPanel;
4
- /** Run each section in order; print its title, prepare, then run if it has content. */
5
- async function runWrapPanel(sections, opts) {
6
- for (const section of sections) {
7
- process.stdout.write(`\n━━ ${section.title} ━━\n`);
8
- const hasContent = await section.prepare();
9
- if (!hasContent) {
10
- process.stdout.write('(no content)\n');
11
- continue;
12
- }
13
- await section.run(opts);
14
- }
15
- }