@hasna/mementos 0.15.2 → 0.16.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 (107) hide show
  1. package/README.md +75 -21
  2. package/dist/audit-contract.d.ts +87 -0
  3. package/dist/audit-contract.d.ts.map +1 -0
  4. package/dist/cli/commands/info-context.d.ts.map +1 -1
  5. package/dist/cli/commands/info-history.d.ts.map +1 -1
  6. package/dist/cli/commands/io-backup.d.ts.map +1 -1
  7. package/dist/cli/commands/io-restore.d.ts.map +1 -1
  8. package/dist/cli/commands/memory-cmd-list.d.ts +25 -0
  9. package/dist/cli/commands/memory-cmd-list.d.ts.map +1 -1
  10. package/dist/cli/commands/project.d.ts.map +1 -1
  11. package/dist/cli/commands/system-session.d.ts.map +1 -1
  12. package/dist/cli/commands/system-synthesized-profile.d.ts.map +1 -1
  13. package/dist/cli/index.js +2093 -740
  14. package/dist/db/api-mode.d.ts +10 -0
  15. package/dist/db/api-mode.d.ts.map +1 -1
  16. package/dist/db/api-response-contract.d.ts +23 -0
  17. package/dist/db/api-response-contract.d.ts.map +1 -0
  18. package/dist/db/audit.d.ts +34 -45
  19. package/dist/db/audit.d.ts.map +1 -1
  20. package/dist/db/database.d.ts +1 -0
  21. package/dist/db/database.d.ts.map +1 -1
  22. package/dist/db/locks.d.ts.map +1 -1
  23. package/dist/db/machines.d.ts +50 -13
  24. package/dist/db/machines.d.ts.map +1 -1
  25. package/dist/db/memories.d.ts.map +1 -1
  26. package/dist/db/migrations.d.ts.map +1 -1
  27. package/dist/db/pg-migrate.d.ts.map +1 -1
  28. package/dist/db/pg-migrations.d.ts.map +1 -1
  29. package/dist/db/session-jobs.d.ts +2 -0
  30. package/dist/db/session-jobs.d.ts.map +1 -1
  31. package/dist/diagnostics/historical-project-registration-receipt.js +215 -1
  32. package/dist/index.d.ts +4 -2
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +1523 -206
  35. package/dist/lib/built-in-hooks.d.ts.map +1 -1
  36. package/dist/lib/injection-project.d.ts +10 -0
  37. package/dist/lib/injection-project.d.ts.map +1 -0
  38. package/dist/lib/injector.d.ts +1 -0
  39. package/dist/lib/injector.d.ts.map +1 -1
  40. package/dist/lib/machine-visibility.d.ts.map +1 -1
  41. package/dist/lib/memory-lock.d.ts.map +1 -1
  42. package/dist/lib/profile-synthesizer.d.ts +13 -2
  43. package/dist/lib/profile-synthesizer.d.ts.map +1 -1
  44. package/dist/lib/session-queue.d.ts.map +1 -1
  45. package/dist/lib/session-registry.d.ts +38 -1
  46. package/dist/lib/session-registry.d.ts.map +1 -1
  47. package/dist/lib/storage-sync.d.ts +5 -0
  48. package/dist/lib/storage-sync.d.ts.map +1 -1
  49. package/dist/lib/synthesis/index.d.ts.map +1 -1
  50. package/dist/mcp/index.d.ts +1 -1
  51. package/dist/mcp/index.d.ts.map +1 -1
  52. package/dist/mcp/index.js +3828 -1776
  53. package/dist/mcp/profile.d.ts +23 -0
  54. package/dist/mcp/profile.d.ts.map +1 -0
  55. package/dist/mcp/tools/lock-tools.d.ts.map +1 -1
  56. package/dist/mcp/tools/memory-audit.d.ts +1 -1
  57. package/dist/mcp/tools/memory-audit.d.ts.map +1 -1
  58. package/dist/mcp/tools/memory-crud.d.ts.map +1 -1
  59. package/dist/mcp/tools/memory-inject.d.ts.map +1 -1
  60. package/dist/mcp/tools/project-tools.d.ts.map +1 -1
  61. package/dist/mcp/tools/session-tools.d.ts.map +1 -1
  62. package/dist/mcp/tools/tool-registry.d.ts +22 -19
  63. package/dist/mcp/tools/tool-registry.d.ts.map +1 -1
  64. package/dist/mcp/tools/utility-tools.d.ts +2 -1
  65. package/dist/mcp/tools/utility-tools.d.ts.map +1 -1
  66. package/dist/project-registration.js +276 -20
  67. package/dist/sdk/index.d.ts +109 -6
  68. package/dist/sdk/index.d.ts.map +1 -1
  69. package/dist/sdk/index.js +740 -25
  70. package/dist/server/index.d.ts +2 -0
  71. package/dist/server/index.d.ts.map +1 -1
  72. package/dist/server/index.js +3195 -1134
  73. package/dist/server/openapi.d.ts.map +1 -1
  74. package/dist/server/routes/audit.d.ts +2 -0
  75. package/dist/server/routes/audit.d.ts.map +1 -0
  76. package/dist/server/routes/machines.d.ts +2 -0
  77. package/dist/server/routes/machines.d.ts.map +1 -0
  78. package/dist/server/routes/system-sessions.d.ts.map +1 -1
  79. package/dist/server/routes/system-synthesis.d.ts.map +1 -1
  80. package/dist/types/index.d.ts +3 -0
  81. package/dist/types/index.d.ts.map +1 -1
  82. package/hasna.contract.json +2 -2
  83. package/package.json +8 -5
  84. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts +0 -2
  85. package/dist/cli/__fixtures__/clean-fallback-stub-server.d.ts.map +0 -1
  86. package/dist/cli/__fixtures__/io-restore-stub-server.d.ts +0 -2
  87. package/dist/cli/__fixtures__/io-restore-stub-server.d.ts.map +0 -1
  88. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts +0 -2
  89. package/dist/db/__fixtures__/fail-closed-stub-server.d.ts.map +0 -1
  90. package/dist/db/__fixtures__/list-filter-capture-server.d.ts +0 -2
  91. package/dist/db/__fixtures__/list-filter-capture-server.d.ts.map +0 -1
  92. package/dist/db/__fixtures__/list-filter-client-runner.d.ts +0 -2
  93. package/dist/db/__fixtures__/list-filter-client-runner.d.ts.map +0 -1
  94. package/dist/test-support/memories-page-stub-server.d.ts +0 -2
  95. package/dist/test-support/memories-page-stub-server.d.ts.map +0 -1
  96. package/dist/test-support/memories-page-stub.d.ts +0 -28
  97. package/dist/test-support/memories-page-stub.d.ts.map +0 -1
  98. package/dist/test-support/pg-sync-stub-worker.d.ts +0 -2
  99. package/dist/test-support/pg-sync-stub-worker.d.ts.map +0 -1
  100. package/dist/test-support/preload-local-store.d.ts +0 -2
  101. package/dist/test-support/preload-local-store.d.ts.map +0 -1
  102. package/dist/test-support/project-authority-identity.d.ts +0 -8
  103. package/dist/test-support/project-authority-identity.d.ts.map +0 -1
  104. package/dist/test-support/store-isolation.d.ts +0 -147
  105. package/dist/test-support/store-isolation.d.ts.map +0 -1
  106. package/dist/test-support/strip-ansi.d.ts +0 -3
  107. package/dist/test-support/strip-ansi.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  # @hasna/mementos
2
2
 
3
3
  Persistent memory for AI agents, available as a CLI, MCP server, REST service,
4
- and TypeScript library. Mementos stores memories in local SQLite by default and
5
- can route clients to a self-hosted PostgreSQL-backed service over an authenticated
6
- HTTP API.
4
+ and TypeScript library. Hosted clients use the authenticated Mementos HTTP API;
5
+ local SQLite is available only through an explicit local-mode opt-in.
7
6
 
8
7
  [![npm](https://img.shields.io/npm/v/@hasna/mementos)](https://www.npmjs.com/package/@hasna/mementos)
9
8
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
@@ -28,10 +27,11 @@ The package installs three binaries:
28
27
 
29
28
  ## Quick start
30
29
 
31
- Local mode needs no service or database configuration. The first command creates
30
+ Local mode must be selected explicitly. The first command after the opt-in creates
32
31
  and migrates `~/.hasna/mementos/mementos.db`.
33
32
 
34
33
  ```bash
34
+ export HASNA_MEMENTOS_LOCAL=1
35
35
  mementos save project-stack "Bun, TypeScript, SQLite" \
36
36
  --scope shared --category fact
37
37
  mementos recall project-stack
@@ -51,6 +51,28 @@ Memory scopes are `global`, `shared`, `private`, and `working`. `working` is
51
51
  transient session scratch space and defaults to a one-hour lifetime. Categories
52
52
  are `preference`, `fact`, `knowledge`, `history`, `procedural`, and `resource`.
53
53
 
54
+ For CLI `context` and `inject`, an explicit `--project` must resolve to a registered
55
+ project and restricts every included scope to that exact project. SDK
56
+ `getContext({ project_id })` uses the same exact-project rule. Unknown explicit
57
+ projects fail before memories are selected or touched; omitting the project keeps
58
+ the existing scope selection.
59
+
60
+ The library and MCP injection strategies retain unassigned agent-private context
61
+ alongside the selected project's private memories. They exclude private memories
62
+ assigned to another project. Their existing global/shared policies remain:
63
+ library strategies include global memories across projects and project-scoped
64
+ shared memories; direct MCP injection also scopes global memories to the project,
65
+ while its full smart pipeline uses the library policy.
66
+
67
+ Injection project references may be a stable project ID, registered name, or
68
+ registered path. Library, MCP, and HTTP/SDK injection resolve that reference once
69
+ and use the stable project ID for every downstream profile, search, filter, hook,
70
+ and touch path.
71
+
72
+ The list API and SDK expose `include_unassigned_project: true` with `project_id`
73
+ for this union. The filter applies before pagination and also governs `total`;
74
+ without a project it has no effect. Omitting it keeps an exact project match.
75
+
54
76
  ## CLI
55
77
 
56
78
  ```bash
@@ -60,13 +82,28 @@ mementos <command> --help
60
82
 
61
83
  Human-readable list and search commands are compact and paginated by default.
62
84
  Use `--limit` with `--cursor` or `--offset`, `--verbose` for wider snippets, and
63
- `mementos show <id>` for a full record. Use global `--json` or a supported
64
- `--format json|csv|yaml` option for structured output.
85
+ `mementos show <id>` for a full record.
86
+
87
+ Historical `--json` and `--format json` collection reads remain compatible:
88
+ they emit full bare arrays and, without `--limit`, traverse the complete result.
89
+ Use explicit `--agent-json` when a token-bounded page receipt is wanted. Agent
90
+ JSON defaults to 20 compact list rows or 10 compact history rows, includes
91
+ `_meta.next_cursor`, and has a 32 KiB byte budget. `--full`, `--all`, and
92
+ `--max-bytes` are receipt-mode controls and require `--agent-json`; exhaustive
93
+ mode fails closed above 5,000 rows or 1 MiB.
94
+
95
+ Agent JSON uses offset pagination. Stable ID tie-breakers prevent overlap for
96
+ equal timestamps and importance while the result set is unchanged; writes
97
+ between page requests can shift offsets, so restart traversal when a stable
98
+ snapshot is required.
65
99
 
66
100
  ```bash
67
- mementos list --limit 20 --cursor 20
101
+ mementos list --json # compatible full bare array
102
+ mementos list --agent-json # bounded receipt page
103
+ mementos list --agent-json --cursor 20
104
+ mementos list --agent-json --full --limit 5
105
+ mementos history --agent-json --all
68
106
  mementos search "deploy" --verbose
69
- mementos --json list
70
107
  mementos storage mode --json
71
108
  ```
72
109
 
@@ -95,11 +132,19 @@ mementos-mcp --stdio
95
132
  Cursor, Codex, Claude, and other command-based MCP host entries should use
96
133
  `command = "mementos-mcp"` with `args = ["--stdio"]`.
97
134
 
98
- The server exposes its live tools plus `mementos://memories`,
99
- `mementos://agents`, and `mementos://projects`. MCP `tools/list` is the complete
100
- schema source; the convenience `search_tools` and `describe_tools` calls cover
101
- the smaller registered utility discovery catalog. See the [MCP
102
- reference](docs/MCP.md) for installation examples and the full tool inventory.
135
+ The default `core` MCP profile exposes a bounded 23-tool agent surface. Select
136
+ additional comma-separated profiles with `--mcp-profile`,
137
+ `HASNA_MEMENTOS_MCP_PROFILE`, or the compatibility alias
138
+ `MEMENTOS_MCP_PROFILE`: `search`, `graph`, `automation`, `admin`, `storage`,
139
+ `hooks`, and `full`. The explicit `full` profile preserves all 124 tools and the
140
+ legacy unpaged `mementos://memories`, `mementos://agents`, and
141
+ `mementos://projects` resources; reduced profiles omit those resources and use
142
+ bounded list/get tools instead.
143
+
144
+ MCP `tools/list` remains the authoritative schema source. `search_tools` returns
145
+ a bounded names-only page for active-profile tools, and `describe_tools`
146
+ requires one to ten explicit names. See the [MCP reference](docs/MCP.md) for
147
+ profile membership and compatibility details.
103
148
 
104
149
  ## REST API
105
150
 
@@ -123,17 +168,26 @@ API routes use bearer/API-key authentication when configured. See the
123
168
 
124
169
  ## Storage
125
170
 
126
- ### Local clients
171
+ ### Client storage selection
172
+
173
+ The hosted Mementos API is the ordinary client default. The CLI, MCP server,
174
+ and SDK resolve the hosted credential and authority chain described below; if
175
+ no hosted credential resolves, client data commands fail closed rather than
176
+ opening or creating SQLite automatically.
127
177
 
128
- SQLite is authoritative by default. Database selection order is:
178
+ SQLite is available only through an explicit local opt-in:
129
179
 
130
- 1. `HASNA_MEMENTOS_DB_PATH` or `MEMENTOS_DB_PATH`.
131
- 2. The nearest existing `.mementos/mementos.db` walking up from the current directory.
132
- 3. Git-root `.mementos/mementos.db` when `MEMENTOS_DB_SCOPE=project`.
133
- 4. `~/.hasna/mementos/mementos.db`.
180
+ ```bash
181
+ # Use the standard local data root (~/.hasna/mementos/mementos.db).
182
+ export HASNA_MEMENTOS_LOCAL=1
183
+
184
+ # Or select one exact SQLite file explicitly.
185
+ export HASNA_MEMENTOS_DB_PATH=/absolute/path/to/mementos.db
186
+ ```
134
187
 
135
- Legacy `~/.mementos` data is copied to `~/.hasna/mementos` when the new directory
136
- does not yet exist.
188
+ `MEMENTOS_LOCAL=1` and `MEMENTOS_DB_PATH` are compatibility aliases. Legacy
189
+ `~/.mementos` data is considered for migration only after local mode has been
190
+ selected explicitly; it is never an automatic client fallback.
137
191
 
138
192
  ### Server backend and HTTP clients
139
193
 
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Pure public contract for the immutable Mementos audit log.
3
+ *
4
+ * This module deliberately has no storage, credential, transport, filesystem,
5
+ * or server dependencies so the SDK and hosted client can validate the exact
6
+ * same versioned receipts without pulling SQLite into client bundles.
7
+ */
8
+ export declare const AUDIT_TRAIL_CONTRACT: "mementos.audit.trail.v1";
9
+ export declare const AUDIT_EXPORT_CONTRACT: "mementos.audit.export.v1";
10
+ export declare const AUDIT_STATS_CONTRACT: "mementos.audit.stats.v1";
11
+ export declare const AUDIT_CURSOR_VERSION: 1;
12
+ export declare const AUDIT_DEFAULT_LIMIT: 50;
13
+ export declare const AUDIT_OPERATIONS: readonly ["create", "update", "delete", "archive", "restore", "read"];
14
+ export type AuditOperation = (typeof AUDIT_OPERATIONS)[number];
15
+ export type AuditPageContract = typeof AUDIT_TRAIL_CONTRACT | typeof AUDIT_EXPORT_CONTRACT;
16
+ export interface AuditEntry {
17
+ id: string;
18
+ memory_id: string;
19
+ memory_key: string | null;
20
+ operation: AuditOperation;
21
+ agent_id: string | null;
22
+ /** md5 hex digest of the value before the operation, or null when unavailable. */
23
+ old_value_hash: string | null;
24
+ /** md5 hex digest of the value after the operation, or null when unavailable. */
25
+ new_value_hash: string | null;
26
+ changes: Record<string, unknown>;
27
+ created_at: string;
28
+ }
29
+ export interface AuditFilters {
30
+ memory_id: string | null;
31
+ since: string | null;
32
+ until: string | null;
33
+ operation: AuditOperation | null;
34
+ agent_id: string | null;
35
+ }
36
+ export interface AuditPage {
37
+ contract: AuditPageContract;
38
+ entries: AuditEntry[];
39
+ count: number;
40
+ total: number;
41
+ limit: number;
42
+ cursor: string | null;
43
+ next_cursor: string | null;
44
+ consumed: number;
45
+ has_more: boolean;
46
+ complete: boolean;
47
+ snapshot_at: string;
48
+ filters: AuditFilters;
49
+ sort: {
50
+ field: "created_at";
51
+ direction: "desc";
52
+ tie_breaker: "id";
53
+ };
54
+ }
55
+ export interface AuditStats {
56
+ contract: typeof AUDIT_STATS_CONTRACT;
57
+ total_entries: number;
58
+ by_operation: Record<AuditOperation, number>;
59
+ recent_24h: number;
60
+ snapshot_at: string;
61
+ }
62
+ export interface AuditCursorPayload {
63
+ v: typeof AUDIT_CURSOR_VERSION;
64
+ contract: AuditPageContract;
65
+ snapshot_created_at: string | null;
66
+ snapshot_id: string | null;
67
+ after_created_at: string | null;
68
+ after_id: string | null;
69
+ snapshot_total: number;
70
+ consumed: number;
71
+ filter_fingerprint: string;
72
+ }
73
+ export declare class AuditContractError extends Error {
74
+ readonly code = "MEMENTOS_AUDIT_CONTRACT";
75
+ constructor(message: string);
76
+ }
77
+ export declare function canonicalAuditTimestamp(value: unknown, label: string): string;
78
+ export declare function auditOperation(value: unknown, label?: string): AuditOperation;
79
+ export declare function validateAuditEntry(value: unknown, label?: string): AuditEntry;
80
+ export declare function validateAuditPage(value: unknown, expected: {
81
+ contract: AuditPageContract;
82
+ cursor: string | null;
83
+ filters: AuditFilters;
84
+ limit: number;
85
+ }): AuditPage;
86
+ export declare function validateAuditStats(value: unknown): AuditStats;
87
+ //# sourceMappingURL=audit-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-contract.d.ts","sourceRoot":"","sources":["../src/audit-contract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,oBAAoB,EAAG,yBAAkC,CAAC;AACvE,eAAO,MAAM,qBAAqB,EAAG,0BAAmC,CAAC;AAC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AAgB,GAAG,UAAU,CAcpF;AA4BD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE;IAAE,QAAQ,EAAE,iBAAiB,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACrG,SAAS,CAuEX;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAsB7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"info-context.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6I7D"}
1
+ {"version":3,"file":"info-context.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmBzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgJ7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"info-history.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyF7D"}
1
+ {"version":3,"file":"info-history.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info-history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoI7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"io-backup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/io-backup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsG5D"}
1
+ {"version":3,"file":"io-backup.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/io-backup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuIzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiI5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"io-restore.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/io-restore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4N7D"}
1
+ {"version":3,"file":"io-restore.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/io-restore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA6FzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsN7D"}
@@ -1,3 +1,28 @@
1
1
  import type { Command } from "commander";
2
+ import type { Memory } from "../../types/index.js";
3
+ export declare const STRUCTURED_PAGE_MAX_ROWS = 1000;
4
+ export declare const STRUCTURED_ALL_MAX_ROWS = 5000;
5
+ export declare const STRUCTURED_DEFAULT_MAX_BYTES: number;
6
+ export declare const STRUCTURED_FULL_MAX_BYTES: number;
7
+ export declare const STRUCTURED_ALL_MAX_BYTES: number;
8
+ export type StructuredMemoryDetail = "compact" | "full";
9
+ export declare function structuredMaxBytes(value: unknown, opts: {
10
+ all: boolean;
11
+ detail: StructuredMemoryDetail;
12
+ }): number;
13
+ export declare function compactMemoryForStructuredOutput(memory: Memory, opts?: {
14
+ history?: boolean;
15
+ }): Record<string, unknown>;
16
+ export declare function structuredMemoryOutput(args: {
17
+ memories: Memory[];
18
+ receipt: string;
19
+ offset: number;
20
+ limit: number;
21
+ sourceHasMore: boolean;
22
+ all: boolean;
23
+ detail: StructuredMemoryDetail;
24
+ maxBytes: number;
25
+ history?: boolean;
26
+ }): string;
2
27
  export declare function registerListCommand(program: Command): void;
3
28
  //# sourceMappingURL=memory-cmd-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"memory-cmd-list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/memory-cmd-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6I1D"}
1
+ {"version":3,"file":"memory-cmd-list.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/memory-cmd-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,OAAO,KAAK,EAAE,MAAM,EAA2D,MAAM,sBAAsB,CAAC;AAkB5G,eAAO,MAAM,wBAAwB,OAAQ,CAAC;AAC9C,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAC7C,eAAO,MAAM,4BAA4B,QAAY,CAAC;AACtD,eAAO,MAAM,yBAAyB,QAAY,CAAC;AACnD,eAAO,MAAM,wBAAwB,QAAc,CAAC;AAGpD,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,MAAM,CAAC;AA2BxD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,sBAAsB,CAAA;CAAE,GACrD,MAAM,CAkBR;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,MAAM,EACd,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoBzB;AAiED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,MAAM,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,MAAM,CAkDT;AAkBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqK1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsb9D"}
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/project.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyb9D"}
@@ -1 +1 @@
1
- {"version":3,"file":"system-session.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwH7D"}
1
+ {"version":3,"file":"system-session.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmI7D"}
@@ -1 +1 @@
1
- {"version":3,"file":"system-synthesized-profile.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-synthesized-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsDxE"}
1
+ {"version":3,"file":"system-synthesized-profile.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/system-synthesized-profile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwDxE"}