memorix 1.5.1 → 1.6.1

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 (52) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +3 -3
  3. package/README.zh-CN.md +3 -3
  4. package/dist/cli/index.js +558 -102
  5. package/dist/cli/memcode.js +12 -1
  6. package/dist/index.js +221 -27
  7. package/dist/maintenance-runner.js +59 -11
  8. package/dist/media-audio-runner.js +59 -11
  9. package/dist/media-video-runner.js +59 -11
  10. package/dist/memcode-runtime/CHANGELOG.md +47 -0
  11. package/dist/sdk.js +220 -26
  12. package/dist/vector-backfill-runner.js +59 -11
  13. package/docs/1.2.4-PERSISTENT-MEMORY-DELIVERY.md +1 -1
  14. package/docs/AGENT_OPERATOR_PLAYBOOK.md +11 -3
  15. package/docs/API_REFERENCE.md +2 -2
  16. package/docs/DEVELOPMENT.md +5 -3
  17. package/docs/DOCKER.md +5 -1
  18. package/docs/PERFORMANCE.md +2 -2
  19. package/docs/README.md +3 -1
  20. package/docs/SETUP.md +8 -2
  21. package/package.json +1 -1
  22. package/plugins/claude/memorix/.claude-plugin/plugin.json +1 -1
  23. package/plugins/codebuddy/memorix/.codebuddy-plugin/plugin.json +1 -1
  24. package/plugins/codex/memorix/.codex-plugin/plugin.json +1 -1
  25. package/plugins/copilot/memorix/plugin.json +1 -1
  26. package/plugins/gemini/memorix/gemini-extension.json +1 -1
  27. package/plugins/omp/memorix/package.json +1 -1
  28. package/plugins/openclaw/memorix/.codex-plugin/plugin.json +1 -1
  29. package/plugins/pi/memorix/package.json +1 -1
  30. package/server.json +2 -2
  31. package/src/cli/commands/agent-integrations.ts +9 -3
  32. package/src/cli/commands/codegraph.ts +48 -5
  33. package/src/cli/commands/context.ts +20 -4
  34. package/src/cli/commands/doctor.ts +46 -15
  35. package/src/cli/commands/hook.ts +13 -1
  36. package/src/cli/commands/resume.ts +4 -0
  37. package/src/cli/commands/serve-http.ts +68 -7
  38. package/src/cli/heap.ts +76 -0
  39. package/src/cli/invocation.ts +7 -4
  40. package/src/codegraph/auto-context.ts +4 -1
  41. package/src/codegraph/context-pack.ts +3 -1
  42. package/src/codegraph/external-provider.ts +93 -0
  43. package/src/embedding/provider.ts +76 -6
  44. package/src/hooks/handler.ts +9 -18
  45. package/src/hooks/installers/index.ts +1 -1
  46. package/src/hooks/lifecycle.ts +173 -0
  47. package/src/hooks/official-skills.ts +3 -3
  48. package/src/hooks/rules/memorix-agent-rules.md +1 -1
  49. package/src/knowledge/context-receipt.ts +41 -0
  50. package/src/knowledge/workflows.ts +6 -3
  51. package/src/knowledge/workset.ts +56 -2
  52. package/src/server.ts +15 -3
package/src/server.ts CHANGED
@@ -1579,13 +1579,17 @@ export async function createMemorixServer(
1579
1579
  refresh: z.enum(['auto', 'always', 'never']).optional().default('auto').describe(
1580
1580
  'Code Memory refresh policy. auto refreshes only when missing or stale.',
1581
1581
  ),
1582
- format: z.enum(['prompt', 'summary', 'json']).optional().default('prompt').describe(
1583
- 'Output format. "prompt" is agent-ready; "summary" is human-readable; "json" is structured.',
1582
+ format: z.enum(['prompt', 'summary', 'json', 'receipt']).optional().default('prompt').describe(
1583
+ 'Output format. "prompt" is agent-ready; "summary" is human-readable; "receipt" is bounded JSON; "json" is detailed diagnostics.',
1584
1584
  ),
1585
+ agent: z.enum([
1586
+ 'windsurf', 'cursor', 'claude-code', 'codex', 'copilot', 'antigravity', 'gemini-cli',
1587
+ 'openclaw', 'hermes', 'omp', 'kiro', 'opencode', 'trae',
1588
+ ]).optional().describe('Optional target agent for compatible workflow selection.'),
1585
1589
  limit: z.number().optional().describe('Reserved for future source limits; current prompt stays compact by default.'),
1586
1590
  },
1587
1591
  },
1588
- async ({ task, refresh, format }) => {
1592
+ async ({ task, refresh, format, agent }) => {
1589
1593
  const unresolved = requireResolvedProject('build project context for the current project');
1590
1594
  if (unresolved) return unresolved;
1591
1595
 
@@ -1599,11 +1603,13 @@ export async function createMemorixServer(
1599
1603
  { getObservationStore },
1600
1604
  { MaintenanceJobStore },
1601
1605
  { enqueueCodegraphRefresh },
1606
+ { buildBoundedContextReceipt },
1602
1607
  ] = await Promise.all([
1603
1608
  import('./codegraph/auto-context.js'),
1604
1609
  import('./store/obs-store.js'),
1605
1610
  import('./runtime/maintenance-jobs.js'),
1606
1611
  import('./runtime/lifecycle.js'),
1612
+ import('./knowledge/context-receipt.js'),
1607
1613
  ]);
1608
1614
  const observations = filterReadableObservations(
1609
1615
  await getObservationStore().loadByProject(project.id, { status: 'active' }),
@@ -1614,6 +1620,7 @@ export async function createMemorixServer(
1614
1620
  dataDir: projectDir,
1615
1621
  observations,
1616
1622
  task,
1623
+ agent,
1617
1624
  refresh: refresh ?? 'auto',
1618
1625
  reader: getObservationReader(),
1619
1626
  enqueueRefresh: () => {
@@ -1628,6 +1635,11 @@ export async function createMemorixServer(
1628
1635
  });
1629
1636
  const text = format === 'json'
1630
1637
  ? JSON.stringify({ ...context, brief: buildAutoProjectBrief(context) }, null, 2)
1638
+ : format === 'receipt'
1639
+ ? JSON.stringify(buildBoundedContextReceipt({
1640
+ workset: context.workset,
1641
+ providerQuality: context.providerQuality,
1642
+ }), null, 2)
1631
1643
  : format === 'summary'
1632
1644
  ? formatAutoProjectContextSummary(context)
1633
1645
  : formatAutoProjectContextPrompt(context);