@vm0/cli 9.241.7 → 9.241.9
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.
- package/{agent-GCB6KIVM.js → agent-YCTYPYF7.js} +5 -5
- package/{banking-7ZHMYNY3.js → banking-RWPXPGOY.js} +3 -3
- package/{chat-3MPFZX2H.js → chat-XWVVRA3Q.js} +4 -4
- package/{chunk-ZLWWY6LH.js → chunk-43Q6LJ4M.js} +2 -2
- package/{chunk-W6OJY7IX.js → chunk-D7WBYCFZ.js} +2 -2
- package/{chunk-74K2DHPM.js → chunk-DCY7MYWI.js} +168 -169
- package/chunk-DCY7MYWI.js.map +1 -0
- package/{chunk-MG65P5SV.js → chunk-G2NMGFMS.js} +4 -4
- package/{chunk-KYKDHMRW.js → chunk-GJ2YK4RB.js} +2 -2
- package/{chunk-HCSK2SC7.js → chunk-HYARATBX.js} +2 -2
- package/{chunk-GND62LDP.js → chunk-JZD2ALHL.js} +3 -3
- package/{chunk-GGSXTOLM.js → chunk-N55TLKMY.js} +4 -4
- package/{chunk-KNATFPLD.js → chunk-PM36DYSC.js} +19 -1408
- package/chunk-PM36DYSC.js.map +1 -0
- package/{chunk-AMJAGFT7.js → chunk-XG3T3KKC.js} +9 -2
- package/chunk-XG3T3KKC.js.map +1 -0
- package/{computer-use-BD7QLU5Z.js → computer-use-AJ4LM52W.js} +3 -3
- package/{connector-T2LTMZ6Q.js → connector-RBJZ3XJO.js} +5 -5
- package/{credit-DX6NIRUV.js → credit-QS7QUF3Q.js} +4 -4
- package/{developer-support-SP56NSTB.js → developer-support-QIN7JTGZ.js} +3 -3
- package/{doctor-32RBQ2VC.js → doctor-PGH6KBWK.js} +5 -5
- package/{generate-HFXHRZRA.js → generate-VGPYBDHG.js} +4 -4
- package/{github-QJ42LNUG.js → github-DBVCDROM.js} +3 -3
- package/{goal-XYHZLRA2.js → goal-VZEI2OD2.js} +3 -3
- package/{host-ULVM7XLM.js → host-35I2D3WT.js} +3 -3
- package/index.js +12 -12
- package/{logs-NNNCGXPE.js → logs-SW5VAI54.js} +5 -5
- package/{mail-YONA4DQI.js → mail-YYSSPGP2.js} +5 -5
- package/{maps-2W6ALLHT.js → maps-DIQSL73V.js} +3 -3
- package/{model-ELBPMGL4.js → model-ZFYWBWJ3.js} +4 -4
- package/{model-provider-OH23775G.js → model-provider-7MXIPGCL.js} +4 -4
- package/{org-LDTBCSFG.js → org-E2T6M6MN.js} +3 -3
- package/package.json +1 -1
- package/{phone-TDR66WMI.js → phone-KKPDS6J3.js} +3 -3
- package/{preference-GXRMWCAX.js → preference-MUE7N3MZ.js} +3 -3
- package/{resource-P6VHQL27.js → resource-3HUMK4UE.js} +3 -3
- package/{scrape-O4S5ACVS.js → scrape-HH5G742T.js} +3 -3
- package/{search-KRBPB3Y2.js → search-JSTRJBHA.js} +5 -5
- package/{secret-MLMXT45G.js → secret-PH5S7HXR.js} +3 -3
- package/{slack-5WOEG5Y2.js → slack-5HWY6WME.js} +3 -3
- package/{teams-3UB7KFWZ.js → teams-DJVOFNO6.js} +3 -3
- package/{telegram-RDXCA44O.js → telegram-3IPXE4FT.js} +3 -3
- package/{variable-6WZ3JDYV.js → variable-XC2BRIE4.js} +3 -3
- package/{video-ZHQAWCKQ.js → video-SAEKMO5Q.js} +2 -2
- package/{web-GTXX2MVX.js → web-GEEMEX3J.js} +3 -3
- package/{web-search-YUVFXIAT.js → web-search-DLAG55F2.js} +3 -3
- package/{whoami-KGJ37MWP.js → whoami-EPCOG5DN.js} +5 -5
- package/{workflow-GQFEGC5L.js → workflow-VS75PBYU.js} +3 -3
- package/zero.js +35 -52
- package/zero.js.map +1 -1
- package/chunk-74K2DHPM.js.map +0 -1
- package/chunk-AMJAGFT7.js.map +0 -1
- package/chunk-KNATFPLD.js.map +0 -1
- package/memory-XRUIDTIV.js +0 -638
- package/memory-XRUIDTIV.js.map +0 -1
- package/relationship-2MRA6LEY.js +0 -186
- package/relationship-2MRA6LEY.js.map +0 -1
- /package/{agent-GCB6KIVM.js.map → agent-YCTYPYF7.js.map} +0 -0
- /package/{banking-7ZHMYNY3.js.map → banking-RWPXPGOY.js.map} +0 -0
- /package/{chat-3MPFZX2H.js.map → chat-XWVVRA3Q.js.map} +0 -0
- /package/{chunk-ZLWWY6LH.js.map → chunk-43Q6LJ4M.js.map} +0 -0
- /package/{chunk-W6OJY7IX.js.map → chunk-D7WBYCFZ.js.map} +0 -0
- /package/{chunk-MG65P5SV.js.map → chunk-G2NMGFMS.js.map} +0 -0
- /package/{chunk-KYKDHMRW.js.map → chunk-GJ2YK4RB.js.map} +0 -0
- /package/{chunk-HCSK2SC7.js.map → chunk-HYARATBX.js.map} +0 -0
- /package/{chunk-GND62LDP.js.map → chunk-JZD2ALHL.js.map} +0 -0
- /package/{chunk-GGSXTOLM.js.map → chunk-N55TLKMY.js.map} +0 -0
- /package/{computer-use-BD7QLU5Z.js.map → computer-use-AJ4LM52W.js.map} +0 -0
- /package/{connector-T2LTMZ6Q.js.map → connector-RBJZ3XJO.js.map} +0 -0
- /package/{credit-DX6NIRUV.js.map → credit-QS7QUF3Q.js.map} +0 -0
- /package/{developer-support-SP56NSTB.js.map → developer-support-QIN7JTGZ.js.map} +0 -0
- /package/{doctor-32RBQ2VC.js.map → doctor-PGH6KBWK.js.map} +0 -0
- /package/{generate-HFXHRZRA.js.map → generate-VGPYBDHG.js.map} +0 -0
- /package/{github-QJ42LNUG.js.map → github-DBVCDROM.js.map} +0 -0
- /package/{goal-XYHZLRA2.js.map → goal-VZEI2OD2.js.map} +0 -0
- /package/{host-ULVM7XLM.js.map → host-35I2D3WT.js.map} +0 -0
- /package/{logs-NNNCGXPE.js.map → logs-SW5VAI54.js.map} +0 -0
- /package/{mail-YONA4DQI.js.map → mail-YYSSPGP2.js.map} +0 -0
- /package/{maps-2W6ALLHT.js.map → maps-DIQSL73V.js.map} +0 -0
- /package/{model-ELBPMGL4.js.map → model-ZFYWBWJ3.js.map} +0 -0
- /package/{model-provider-OH23775G.js.map → model-provider-7MXIPGCL.js.map} +0 -0
- /package/{org-LDTBCSFG.js.map → org-E2T6M6MN.js.map} +0 -0
- /package/{phone-TDR66WMI.js.map → phone-KKPDS6J3.js.map} +0 -0
- /package/{preference-GXRMWCAX.js.map → preference-MUE7N3MZ.js.map} +0 -0
- /package/{resource-P6VHQL27.js.map → resource-3HUMK4UE.js.map} +0 -0
- /package/{scrape-O4S5ACVS.js.map → scrape-HH5G742T.js.map} +0 -0
- /package/{search-KRBPB3Y2.js.map → search-JSTRJBHA.js.map} +0 -0
- /package/{secret-MLMXT45G.js.map → secret-PH5S7HXR.js.map} +0 -0
- /package/{slack-5WOEG5Y2.js.map → slack-5HWY6WME.js.map} +0 -0
- /package/{teams-3UB7KFWZ.js.map → teams-DJVOFNO6.js.map} +0 -0
- /package/{telegram-RDXCA44O.js.map → telegram-3IPXE4FT.js.map} +0 -0
- /package/{variable-6WZ3JDYV.js.map → variable-XC2BRIE4.js.map} +0 -0
- /package/{video-ZHQAWCKQ.js.map → video-SAEKMO5Q.js.map} +0 -0
- /package/{web-GTXX2MVX.js.map → web-GEEMEX3J.js.map} +0 -0
- /package/{web-search-YUVFXIAT.js.map → web-search-DLAG55F2.js.map} +0 -0
- /package/{whoami-KGJ37MWP.js.map → whoami-EPCOG5DN.js.map} +0 -0
- /package/{workflow-GQFEGC5L.js.map → workflow-VS75PBYU.js.map} +0 -0
package/memory-XRUIDTIV.js
DELETED
|
@@ -1,638 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module";
|
|
3
|
-
const require = __createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
createZeroMemory,
|
|
6
|
-
forgetZeroMemory,
|
|
7
|
-
forgetZeroMemoryByPrompt,
|
|
8
|
-
getZeroMemoryContext,
|
|
9
|
-
listZeroMemory,
|
|
10
|
-
listZeroMemoryDocuments,
|
|
11
|
-
listZeroMemoryForgotten,
|
|
12
|
-
listZeroMemoryHistory,
|
|
13
|
-
recallZeroMemory,
|
|
14
|
-
searchZeroMemory,
|
|
15
|
-
updateZeroMemory
|
|
16
|
-
} from "./chunk-KNATFPLD.js";
|
|
17
|
-
import "./chunk-LTDQISD7.js";
|
|
18
|
-
import {
|
|
19
|
-
source_default,
|
|
20
|
-
withErrorHandler
|
|
21
|
-
} from "./chunk-AMJAGFT7.js";
|
|
22
|
-
import "./chunk-LRHXR7JT.js";
|
|
23
|
-
import {
|
|
24
|
-
Command
|
|
25
|
-
} from "./chunk-B3W2RUBP.js";
|
|
26
|
-
import {
|
|
27
|
-
init_esm_shims
|
|
28
|
-
} from "./chunk-DIRAZ3YX.js";
|
|
29
|
-
|
|
30
|
-
// src/commands/zero/memory/index.ts
|
|
31
|
-
init_esm_shims();
|
|
32
|
-
|
|
33
|
-
// src/commands/zero/memory/context.ts
|
|
34
|
-
init_esm_shims();
|
|
35
|
-
|
|
36
|
-
// src/commands/zero/memory/format.ts
|
|
37
|
-
init_esm_shims();
|
|
38
|
-
function formatDate(value) {
|
|
39
|
-
if (!value) {
|
|
40
|
-
return "unknown";
|
|
41
|
-
}
|
|
42
|
-
return new Intl.DateTimeFormat(void 0, {
|
|
43
|
-
year: "numeric",
|
|
44
|
-
month: "short",
|
|
45
|
-
day: "numeric"
|
|
46
|
-
}).format(new Date(value));
|
|
47
|
-
}
|
|
48
|
-
function formatKind(kind) {
|
|
49
|
-
switch (kind) {
|
|
50
|
-
case "key_fact": {
|
|
51
|
-
return "key fact";
|
|
52
|
-
}
|
|
53
|
-
case "open_loop": {
|
|
54
|
-
return "open loop";
|
|
55
|
-
}
|
|
56
|
-
case "preference": {
|
|
57
|
-
return "preference";
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function sourceSummary(memory) {
|
|
62
|
-
const source = memory.sources[0];
|
|
63
|
-
if (!source) {
|
|
64
|
-
return "no source";
|
|
65
|
-
}
|
|
66
|
-
return `${source.provider}:${source.externalId} (${formatDate(source.occurredAt)})`;
|
|
67
|
-
}
|
|
68
|
-
function printMemoryRecall(memories) {
|
|
69
|
-
if (memories.length === 0) {
|
|
70
|
-
console.log("No memories found");
|
|
71
|
-
console.log(
|
|
72
|
-
source_default.dim(
|
|
73
|
-
' Try a broader query, for example: zero memory recall "pricing"'
|
|
74
|
-
)
|
|
75
|
-
);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
console.log(source_default.green(`\u2713 Recalled ${memories.length} memories`));
|
|
79
|
-
for (const memory of memories) {
|
|
80
|
-
const entity = memory.relationship.entity.displayName;
|
|
81
|
-
console.log(`- ${memory.text}`);
|
|
82
|
-
console.log(
|
|
83
|
-
source_default.dim(
|
|
84
|
-
` ${formatKind(memory.kind)} \xB7 ${entity} \xB7 confidence ${memory.confidence} \xB7 ${sourceSummary(memory)}`
|
|
85
|
-
)
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function printMemoryContext(response) {
|
|
90
|
-
if (response.context.length === 0) {
|
|
91
|
-
console.log("No memory context found");
|
|
92
|
-
console.log(
|
|
93
|
-
source_default.dim(' Try: zero memory context --query "customer follow up"')
|
|
94
|
-
);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
console.log(response.context);
|
|
98
|
-
}
|
|
99
|
-
function compactText(value) {
|
|
100
|
-
const normalized = value.replace(/\s+/g, " ").trim();
|
|
101
|
-
if (normalized.length <= 180) {
|
|
102
|
-
return normalized;
|
|
103
|
-
}
|
|
104
|
-
return `${normalized.slice(0, 177)}...`;
|
|
105
|
-
}
|
|
106
|
-
function formatScore(score) {
|
|
107
|
-
return score.toFixed(2);
|
|
108
|
-
}
|
|
109
|
-
function printMemorySearchResult(result) {
|
|
110
|
-
if (result.kind === "memory") {
|
|
111
|
-
const memory = result.memory;
|
|
112
|
-
const entity = memory.relationship.entity.displayName;
|
|
113
|
-
console.log(`- ${memory.text}`);
|
|
114
|
-
console.log(
|
|
115
|
-
source_default.dim(
|
|
116
|
-
` memory \xB7 ${formatKind(memory.kind)} \xB7 ${entity} \xB7 score ${formatScore(result.score)} \xB7 ${sourceSummary(memory)}`
|
|
117
|
-
)
|
|
118
|
-
);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
const title = result.title ?? result.externalId;
|
|
122
|
-
const citationUrl = result.citation.url ? ` \xB7 ${result.citation.url}` : "";
|
|
123
|
-
console.log(`- ${title}`);
|
|
124
|
-
console.log(source_default.dim(` document \xB7 ${compactText(result.text)}`));
|
|
125
|
-
console.log(
|
|
126
|
-
source_default.dim(
|
|
127
|
-
` ${result.provider}:${result.externalId} \xB7 ${result.contextSpace.displayName} \xB7 score ${formatScore(result.score)}${citationUrl}`
|
|
128
|
-
)
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
function printMemorySearch(response) {
|
|
132
|
-
if (response.results.length === 0) {
|
|
133
|
-
console.log("No memory or document results found");
|
|
134
|
-
console.log(
|
|
135
|
-
source_default.dim(' Try: zero memory search "security review" --mode hybrid')
|
|
136
|
-
);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
console.log(
|
|
140
|
-
source_default.green(
|
|
141
|
-
`\u2713 Found ${response.results.length} ${response.mode} memory results`
|
|
142
|
-
)
|
|
143
|
-
);
|
|
144
|
-
for (const result of response.results) {
|
|
145
|
-
printMemorySearchResult(result);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function contextSpaceSummary(memory) {
|
|
149
|
-
return memory.contextSpace ? `${memory.contextSpace.type}:${memory.contextSpace.key}` : "no context space";
|
|
150
|
-
}
|
|
151
|
-
function printLifecycleMemory(memory) {
|
|
152
|
-
console.log(`- ${memory.text}`);
|
|
153
|
-
console.log(
|
|
154
|
-
source_default.dim(
|
|
155
|
-
` ${memory.kind} \xB7 ${memory.status} \xB7 confidence ${memory.confidence} \xB7 ${contextSpaceSummary(memory)} \xB7 ${memory.id}`
|
|
156
|
-
)
|
|
157
|
-
);
|
|
158
|
-
}
|
|
159
|
-
function printMemoryList(response) {
|
|
160
|
-
if (response.memories.length === 0) {
|
|
161
|
-
console.log("No lifecycle memories found");
|
|
162
|
-
console.log(
|
|
163
|
-
source_default.dim(' Create one: zero memory create "Remember this fact"')
|
|
164
|
-
);
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
console.log(source_default.green(`\u2713 Found ${response.memories.length} memories`));
|
|
168
|
-
for (const memory of response.memories) {
|
|
169
|
-
printLifecycleMemory(memory);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
function printMemoryCreated(memory) {
|
|
173
|
-
console.log(source_default.green("\u2713 Memory created"));
|
|
174
|
-
printLifecycleMemory(memory);
|
|
175
|
-
console.log(source_default.dim(` History: zero memory history memory ${memory.id}`));
|
|
176
|
-
}
|
|
177
|
-
function printMemoryUpdated(memory) {
|
|
178
|
-
console.log(source_default.green("\u2713 Memory updated"));
|
|
179
|
-
printLifecycleMemory(memory);
|
|
180
|
-
console.log(source_default.dim(` History: zero memory history memory ${memory.id}`));
|
|
181
|
-
}
|
|
182
|
-
function printMemoryForget(response) {
|
|
183
|
-
if (response.forgotten.length === 0) {
|
|
184
|
-
console.log("No matching active memory or document found");
|
|
185
|
-
console.log(source_default.dim(' Try: zero memory search "the thing to forget"'));
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
console.log(
|
|
189
|
-
source_default.green(`\u2713 Recorded ${response.forgotten.length} tombstones`)
|
|
190
|
-
);
|
|
191
|
-
for (const tombstone of response.forgotten) {
|
|
192
|
-
console.log(
|
|
193
|
-
`- ${tombstone.targetKind}: ${tombstone.targetTitle ?? tombstone.targetText ?? tombstone.fingerprint}`
|
|
194
|
-
);
|
|
195
|
-
console.log(source_default.dim(` ${tombstone.fingerprint} \xB7 ${tombstone.id}`));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function printMemoryHistory(response) {
|
|
199
|
-
if (response.history.length === 0) {
|
|
200
|
-
console.log("No memory history found");
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
console.log(source_default.green(`\u2713 Found ${response.history.length} versions`));
|
|
204
|
-
for (const version of response.history) {
|
|
205
|
-
console.log(
|
|
206
|
-
`- v${version.version} ${version.operation ?? "change"} ${formatDate(
|
|
207
|
-
version.createdAt
|
|
208
|
-
)}`
|
|
209
|
-
);
|
|
210
|
-
console.log(
|
|
211
|
-
source_default.dim(
|
|
212
|
-
` ${version.targetKind}:${version.targetId} \xB7 ${version.contentHash}`
|
|
213
|
-
)
|
|
214
|
-
);
|
|
215
|
-
if (version.text ?? version.title) {
|
|
216
|
-
console.log(
|
|
217
|
-
source_default.dim(` ${compactText(version.text ?? version.title ?? "")}`)
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
function printMemoryDocuments(response) {
|
|
223
|
-
if (response.documents.length === 0) {
|
|
224
|
-
console.log("No memory documents found");
|
|
225
|
-
console.log(source_default.dim(" Backfill GitHub or Notion memory sources first"));
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
console.log(source_default.green(`\u2713 Found ${response.documents.length} documents`));
|
|
229
|
-
for (const document of response.documents) {
|
|
230
|
-
console.log(`- ${document.title ?? document.externalId}`);
|
|
231
|
-
console.log(
|
|
232
|
-
source_default.dim(
|
|
233
|
-
` ${document.provider}:${document.externalId} \xB7 ${document.status} \xB7 ${document.chunkCount} chunks \xB7 ${document.id}`
|
|
234
|
-
)
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function printMemoryForgotten(response) {
|
|
239
|
-
if (response.forgotten.length === 0) {
|
|
240
|
-
console.log("No forgotten memory records found");
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
console.log(source_default.green(`\u2713 Found ${response.forgotten.length} tombstones`));
|
|
244
|
-
for (const tombstone of response.forgotten) {
|
|
245
|
-
console.log(
|
|
246
|
-
`- ${tombstone.targetKind}: ${tombstone.targetTitle ?? tombstone.targetText ?? tombstone.fingerprint}`
|
|
247
|
-
);
|
|
248
|
-
console.log(
|
|
249
|
-
source_default.dim(` ${tombstone.fingerprint} \xB7 ${tombstone.createdAt}`)
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// src/commands/zero/memory/context.ts
|
|
255
|
-
function parseLimit(value) {
|
|
256
|
-
if (value === void 0) {
|
|
257
|
-
return void 0;
|
|
258
|
-
}
|
|
259
|
-
const parsed = Number(value);
|
|
260
|
-
return Number.isInteger(parsed) ? parsed : void 0;
|
|
261
|
-
}
|
|
262
|
-
var contextCommand = new Command().name("context").description("Print prompt-ready structured memory context").option("--query <query>", "Optional query to focus the context").option("--limit <limit>", "Maximum memories to include").option("--json", "Print machine-readable JSON").addHelpText(
|
|
263
|
-
"after",
|
|
264
|
-
`
|
|
265
|
-
Examples:
|
|
266
|
-
General context: zero memory context
|
|
267
|
-
Focus context: zero memory context --query "security review"
|
|
268
|
-
Print JSON: zero memory context --query "Acme" --json
|
|
269
|
-
|
|
270
|
-
Notes:
|
|
271
|
-
- Uses the authenticated user's active organization
|
|
272
|
-
- Requires relationship memory to be enabled for the organization
|
|
273
|
-
- This command is read-only`
|
|
274
|
-
).action(
|
|
275
|
-
withErrorHandler(async (options) => {
|
|
276
|
-
const response = await getZeroMemoryContext({
|
|
277
|
-
q: options.query,
|
|
278
|
-
limit: parseLimit(options.limit)
|
|
279
|
-
});
|
|
280
|
-
if (options.json) {
|
|
281
|
-
console.log(JSON.stringify(response));
|
|
282
|
-
return;
|
|
283
|
-
}
|
|
284
|
-
printMemoryContext(response);
|
|
285
|
-
})
|
|
286
|
-
);
|
|
287
|
-
|
|
288
|
-
// src/commands/zero/memory/lifecycle.ts
|
|
289
|
-
init_esm_shims();
|
|
290
|
-
var MEMORY_KINDS = [
|
|
291
|
-
"key_fact",
|
|
292
|
-
"preference",
|
|
293
|
-
"open_loop",
|
|
294
|
-
"role",
|
|
295
|
-
"project",
|
|
296
|
-
"communication_style",
|
|
297
|
-
"recent_context"
|
|
298
|
-
];
|
|
299
|
-
var CONTEXT_TYPES = [
|
|
300
|
-
"user",
|
|
301
|
-
"org",
|
|
302
|
-
"project",
|
|
303
|
-
"repo",
|
|
304
|
-
"customer",
|
|
305
|
-
"agent",
|
|
306
|
-
"workflow"
|
|
307
|
-
];
|
|
308
|
-
var PROVIDERS = ["gmail", "slack", "github", "notion"];
|
|
309
|
-
function parseLimit2(value) {
|
|
310
|
-
if (value === void 0) {
|
|
311
|
-
return void 0;
|
|
312
|
-
}
|
|
313
|
-
const parsed = Number(value);
|
|
314
|
-
return Number.isInteger(parsed) ? parsed : void 0;
|
|
315
|
-
}
|
|
316
|
-
function parseConfidence(value) {
|
|
317
|
-
if (value === void 0) {
|
|
318
|
-
return void 0;
|
|
319
|
-
}
|
|
320
|
-
const parsed = Number(value);
|
|
321
|
-
return Number.isInteger(parsed) ? parsed : void 0;
|
|
322
|
-
}
|
|
323
|
-
function parseMemoryKind(value) {
|
|
324
|
-
if (value === void 0) {
|
|
325
|
-
return void 0;
|
|
326
|
-
}
|
|
327
|
-
if (MEMORY_KINDS.some((kind) => {
|
|
328
|
-
return kind === value;
|
|
329
|
-
})) {
|
|
330
|
-
return value;
|
|
331
|
-
}
|
|
332
|
-
console.error(source_default.red("\u2717 Unsupported memory kind"));
|
|
333
|
-
console.error(source_default.dim(` Use one of: ${MEMORY_KINDS.join(", ")}`));
|
|
334
|
-
process.exit(1);
|
|
335
|
-
}
|
|
336
|
-
function parseProvider(value) {
|
|
337
|
-
if (value === void 0) {
|
|
338
|
-
return void 0;
|
|
339
|
-
}
|
|
340
|
-
if (PROVIDERS.some((provider) => {
|
|
341
|
-
return provider === value;
|
|
342
|
-
})) {
|
|
343
|
-
return value;
|
|
344
|
-
}
|
|
345
|
-
console.error(source_default.red("\u2717 Unsupported memory provider"));
|
|
346
|
-
console.error(source_default.dim(` Use one of: ${PROVIDERS.join(", ")}`));
|
|
347
|
-
process.exit(1);
|
|
348
|
-
}
|
|
349
|
-
function parseContextSpace(options) {
|
|
350
|
-
if (!options.contextKey && !options.contextType && !options.contextName) {
|
|
351
|
-
return void 0;
|
|
352
|
-
}
|
|
353
|
-
const type = options.contextType ?? "user";
|
|
354
|
-
if (!CONTEXT_TYPES.some((contextType) => {
|
|
355
|
-
return contextType === type;
|
|
356
|
-
})) {
|
|
357
|
-
console.error(source_default.red("\u2717 Unsupported context space type"));
|
|
358
|
-
console.error(source_default.dim(` Use one of: ${CONTEXT_TYPES.join(", ")}`));
|
|
359
|
-
process.exit(1);
|
|
360
|
-
}
|
|
361
|
-
if (!options.contextKey || !options.contextName) {
|
|
362
|
-
console.error(
|
|
363
|
-
source_default.red("\u2717 --context-key and --context-name are required together")
|
|
364
|
-
);
|
|
365
|
-
console.error(
|
|
366
|
-
source_default.dim(
|
|
367
|
-
' Example: zero memory create "Fact" --context-type repo --context-key github:vm0-ai/vm0 --context-name vm0-ai/vm0'
|
|
368
|
-
)
|
|
369
|
-
);
|
|
370
|
-
process.exit(1);
|
|
371
|
-
}
|
|
372
|
-
return {
|
|
373
|
-
type,
|
|
374
|
-
key: options.contextKey,
|
|
375
|
-
displayName: options.contextName
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
function requireYes(options) {
|
|
379
|
-
if (options.yes) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
console.error(source_default.red("\u2717 --yes is required for forget operations"));
|
|
383
|
-
console.error(
|
|
384
|
-
source_default.dim(" This records tombstones and removes active search results")
|
|
385
|
-
);
|
|
386
|
-
process.exit(1);
|
|
387
|
-
}
|
|
388
|
-
var listCommand = new Command().name("list").description("List lifecycle-aware structured memories").option("--status <status>", "Filter by active or archived", "active").option("--kind <kind>", "Filter by memory kind").option("--limit <limit>", "Maximum rows to return").option("--json", "Print machine-readable JSON").action(
|
|
389
|
-
withErrorHandler(async (options) => {
|
|
390
|
-
const response = await listZeroMemory({
|
|
391
|
-
status: options.status === "archived" ? "archived" : "active",
|
|
392
|
-
kind: parseMemoryKind(options.kind),
|
|
393
|
-
limit: parseLimit2(options.limit)
|
|
394
|
-
});
|
|
395
|
-
if (options.json) {
|
|
396
|
-
console.log(JSON.stringify(response));
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
printMemoryList(response);
|
|
400
|
-
})
|
|
401
|
-
);
|
|
402
|
-
var createCommand = new Command().name("create").description("Create a direct structured memory").argument("<text>", "Memory text").option("--kind <kind>", "Memory kind", "key_fact").option("--confidence <confidence>", "Confidence 0-100").option("--entity <name>", "Entity display name").option("--context-type <type>", "Context space type").option("--context-key <key>", "Context space key").option("--context-name <name>", "Context space display name").option("--json", "Print machine-readable JSON").action(
|
|
403
|
-
withErrorHandler(async (text, options) => {
|
|
404
|
-
const memory = await createZeroMemory({
|
|
405
|
-
text,
|
|
406
|
-
kind: parseMemoryKind(options.kind) ?? "key_fact",
|
|
407
|
-
confidence: parseConfidence(options.confidence) ?? 90,
|
|
408
|
-
contextSpace: parseContextSpace(options),
|
|
409
|
-
entityDisplayName: options.entity
|
|
410
|
-
});
|
|
411
|
-
if (options.json) {
|
|
412
|
-
console.log(JSON.stringify({ memory }));
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
printMemoryCreated(memory);
|
|
416
|
-
})
|
|
417
|
-
);
|
|
418
|
-
var updateCommand = new Command().name("update").description("Update a structured memory and create a new version").argument("<memory-id>", "Memory ID").option("--text <text>", "Replacement memory text").option("--kind <kind>", "Replacement memory kind").option("--confidence <confidence>", "Confidence 0-100").option("--entity <name>", "Entity display name").option("--json", "Print machine-readable JSON").action(
|
|
419
|
-
withErrorHandler(async (memoryId, options) => {
|
|
420
|
-
const memory = await updateZeroMemory(memoryId, {
|
|
421
|
-
text: options.text,
|
|
422
|
-
kind: parseMemoryKind(options.kind),
|
|
423
|
-
confidence: parseConfidence(options.confidence),
|
|
424
|
-
entityDisplayName: options.entity
|
|
425
|
-
});
|
|
426
|
-
if (options.json) {
|
|
427
|
-
console.log(JSON.stringify({ memory }));
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
printMemoryUpdated(memory);
|
|
431
|
-
})
|
|
432
|
-
);
|
|
433
|
-
var forgetCommand = new Command().name("forget").description("Forget one structured memory by ID").argument("<memory-id>", "Memory ID").option("--reason <reason>", "Reason to record in the tombstone").option("--yes", "Confirm the forget operation").option("--json", "Print machine-readable JSON").action(
|
|
434
|
-
withErrorHandler(async (memoryId, options) => {
|
|
435
|
-
requireYes(options);
|
|
436
|
-
const response = await forgetZeroMemory(memoryId, {
|
|
437
|
-
reason: options.reason
|
|
438
|
-
});
|
|
439
|
-
if (options.json) {
|
|
440
|
-
console.log(JSON.stringify(response));
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
printMemoryForget(response);
|
|
444
|
-
})
|
|
445
|
-
);
|
|
446
|
-
var forgetPromptCommand = new Command().name("forget-prompt").description("Forget memories or documents matching a prompt").argument("<prompt>", "Forget prompt").option("--target <target>", "all, memories, or documents", "all").option("--provider <provider>", "Filter documents by provider").option("--limit <limit>", "Maximum matches to forget").option("--reason <reason>", "Reason to record in tombstones").option("--yes", "Confirm the forget operation").option("--json", "Print machine-readable JSON").action(
|
|
447
|
-
withErrorHandler(async (prompt, options) => {
|
|
448
|
-
requireYes(options);
|
|
449
|
-
const targetKind = options.target === "memories" || options.target === "documents" ? options.target : "all";
|
|
450
|
-
const response = await forgetZeroMemoryByPrompt({
|
|
451
|
-
prompt,
|
|
452
|
-
targetKind,
|
|
453
|
-
provider: parseProvider(options.provider),
|
|
454
|
-
limit: parseLimit2(options.limit) ?? 5,
|
|
455
|
-
reason: options.reason
|
|
456
|
-
});
|
|
457
|
-
if (options.json) {
|
|
458
|
-
console.log(JSON.stringify(response));
|
|
459
|
-
return;
|
|
460
|
-
}
|
|
461
|
-
printMemoryForget(response);
|
|
462
|
-
})
|
|
463
|
-
);
|
|
464
|
-
var historyCommand = new Command().name("history").description("List memory, document, or profile version history").argument("<target-kind>", "memory, document, or profile").argument("<target-id>", "Target ID").option("--limit <limit>", "Maximum versions to return").option("--json", "Print machine-readable JSON").action(
|
|
465
|
-
withErrorHandler(
|
|
466
|
-
async (targetKind, targetId, options) => {
|
|
467
|
-
if (targetKind !== "memory" && targetKind !== "document" && targetKind !== "profile") {
|
|
468
|
-
console.error(source_default.red("\u2717 Unsupported history target"));
|
|
469
|
-
console.error(source_default.dim(" Use one of: memory, document, profile"));
|
|
470
|
-
process.exit(1);
|
|
471
|
-
}
|
|
472
|
-
const response = await listZeroMemoryHistory({
|
|
473
|
-
targetKind,
|
|
474
|
-
targetId,
|
|
475
|
-
limit: parseLimit2(options.limit)
|
|
476
|
-
});
|
|
477
|
-
if (options.json) {
|
|
478
|
-
console.log(JSON.stringify(response));
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
printMemoryHistory(response);
|
|
482
|
-
}
|
|
483
|
-
)
|
|
484
|
-
);
|
|
485
|
-
var documentsCommand = new Command().name("documents").description("List indexed memory documents").option("--status <status>", "active, archived, or deleted", "active").option("--provider <provider>", "Filter by provider").option("--limit <limit>", "Maximum rows to return").option("--json", "Print machine-readable JSON").action(
|
|
486
|
-
withErrorHandler(async (options) => {
|
|
487
|
-
const status = options.status === "archived" || options.status === "deleted" ? options.status : "active";
|
|
488
|
-
const response = await listZeroMemoryDocuments({
|
|
489
|
-
status,
|
|
490
|
-
provider: parseProvider(options.provider),
|
|
491
|
-
limit: parseLimit2(options.limit)
|
|
492
|
-
});
|
|
493
|
-
if (options.json) {
|
|
494
|
-
console.log(JSON.stringify(response));
|
|
495
|
-
return;
|
|
496
|
-
}
|
|
497
|
-
printMemoryDocuments(response);
|
|
498
|
-
})
|
|
499
|
-
);
|
|
500
|
-
var forgottenCommand = new Command().name("forgotten").description("List forgotten memory tombstones").option("--limit <limit>", "Maximum rows to return").option("--json", "Print machine-readable JSON").action(
|
|
501
|
-
withErrorHandler(async (options) => {
|
|
502
|
-
const response = await listZeroMemoryForgotten({
|
|
503
|
-
limit: parseLimit2(options.limit)
|
|
504
|
-
});
|
|
505
|
-
if (options.json) {
|
|
506
|
-
console.log(JSON.stringify(response));
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
printMemoryForgotten(response);
|
|
510
|
-
})
|
|
511
|
-
);
|
|
512
|
-
|
|
513
|
-
// src/commands/zero/memory/recall.ts
|
|
514
|
-
init_esm_shims();
|
|
515
|
-
var MEMORY_KINDS2 = ["key_fact", "preference", "open_loop"];
|
|
516
|
-
function parseLimit3(value) {
|
|
517
|
-
if (value === void 0) {
|
|
518
|
-
return void 0;
|
|
519
|
-
}
|
|
520
|
-
const parsed = Number(value);
|
|
521
|
-
return Number.isInteger(parsed) ? parsed : void 0;
|
|
522
|
-
}
|
|
523
|
-
function parseKind(value) {
|
|
524
|
-
if (value === void 0) {
|
|
525
|
-
return void 0;
|
|
526
|
-
}
|
|
527
|
-
if (MEMORY_KINDS2.some((kind) => {
|
|
528
|
-
return kind === value;
|
|
529
|
-
})) {
|
|
530
|
-
return value;
|
|
531
|
-
}
|
|
532
|
-
console.error(source_default.red("\u2717 Unsupported memory kind"));
|
|
533
|
-
console.error(source_default.dim(" Use one of: key_fact, preference, open_loop"));
|
|
534
|
-
process.exit(1);
|
|
535
|
-
}
|
|
536
|
-
var recallCommand = new Command().name("recall").description("Recall structured memory by query").argument("<query>", "Recall query").option("--kind <kind>", "Filter by key_fact, preference, or open_loop").option("--limit <limit>", "Maximum memories to return").option("--json", "Print machine-readable JSON").addHelpText(
|
|
537
|
-
"after",
|
|
538
|
-
`
|
|
539
|
-
Examples:
|
|
540
|
-
Recall memory: zero memory recall "security review"
|
|
541
|
-
Filter kind: zero memory recall "pricing" --kind open_loop
|
|
542
|
-
Print JSON: zero memory recall "Acme" --json
|
|
543
|
-
|
|
544
|
-
Notes:
|
|
545
|
-
- Uses the authenticated user's active organization
|
|
546
|
-
- Requires relationship memory to be enabled for the organization
|
|
547
|
-
- This command is read-only`
|
|
548
|
-
).action(
|
|
549
|
-
withErrorHandler(async (query, options) => {
|
|
550
|
-
const response = await recallZeroMemory({
|
|
551
|
-
q: query,
|
|
552
|
-
kind: parseKind(options.kind),
|
|
553
|
-
limit: parseLimit3(options.limit)
|
|
554
|
-
});
|
|
555
|
-
if (options.json) {
|
|
556
|
-
console.log(JSON.stringify(response));
|
|
557
|
-
return;
|
|
558
|
-
}
|
|
559
|
-
printMemoryRecall(response.memories);
|
|
560
|
-
})
|
|
561
|
-
);
|
|
562
|
-
|
|
563
|
-
// src/commands/zero/memory/search.ts
|
|
564
|
-
init_esm_shims();
|
|
565
|
-
var MEMORY_SEARCH_MODES = ["hybrid", "memories", "documents"];
|
|
566
|
-
var MEMORY_PROVIDERS = ["gmail", "slack", "github", "notion"];
|
|
567
|
-
function parseLimit4(value) {
|
|
568
|
-
if (value === void 0) {
|
|
569
|
-
return void 0;
|
|
570
|
-
}
|
|
571
|
-
const parsed = Number(value);
|
|
572
|
-
return Number.isInteger(parsed) ? parsed : void 0;
|
|
573
|
-
}
|
|
574
|
-
function parseMode(value) {
|
|
575
|
-
if (value === void 0) {
|
|
576
|
-
return void 0;
|
|
577
|
-
}
|
|
578
|
-
if (MEMORY_SEARCH_MODES.some((mode) => {
|
|
579
|
-
return mode === value;
|
|
580
|
-
})) {
|
|
581
|
-
return value;
|
|
582
|
-
}
|
|
583
|
-
console.error(source_default.red("\u2717 Unsupported memory search mode"));
|
|
584
|
-
console.error(source_default.dim(" Use one of: hybrid, memories, documents"));
|
|
585
|
-
process.exit(1);
|
|
586
|
-
}
|
|
587
|
-
function parseProvider2(value) {
|
|
588
|
-
if (value === void 0) {
|
|
589
|
-
return void 0;
|
|
590
|
-
}
|
|
591
|
-
if (MEMORY_PROVIDERS.some((provider) => {
|
|
592
|
-
return provider === value;
|
|
593
|
-
})) {
|
|
594
|
-
return value;
|
|
595
|
-
}
|
|
596
|
-
console.error(source_default.red("\u2717 Unsupported memory provider"));
|
|
597
|
-
console.error(source_default.dim(" Use one of: gmail, slack, github, notion"));
|
|
598
|
-
process.exit(1);
|
|
599
|
-
}
|
|
600
|
-
var searchCommand = new Command().name("search").description("Search structured memory and document chunks").argument("<query>", "Search query").option(
|
|
601
|
-
"--mode <mode>",
|
|
602
|
-
"Search mode: hybrid, memories, or documents",
|
|
603
|
-
"hybrid"
|
|
604
|
-
).option("--provider <provider>", "Filter documents by source provider").option("--limit <limit>", "Maximum results to return").option("--json", "Print machine-readable JSON").addHelpText(
|
|
605
|
-
"after",
|
|
606
|
-
`
|
|
607
|
-
Examples:
|
|
608
|
-
Hybrid search: zero memory search "security review"
|
|
609
|
-
Documents only: zero memory search "retention policy" --mode documents
|
|
610
|
-
GitHub documents: zero memory search "release plan" --provider github
|
|
611
|
-
Print JSON: zero memory search "Acme" --json
|
|
612
|
-
|
|
613
|
-
Notes:
|
|
614
|
-
- Uses the authenticated user's active organization
|
|
615
|
-
- Requires relationship memory to be enabled for the organization
|
|
616
|
-
- This command is read-only`
|
|
617
|
-
).action(
|
|
618
|
-
withErrorHandler(async (query, options) => {
|
|
619
|
-
const response = await searchZeroMemory({
|
|
620
|
-
q: query,
|
|
621
|
-
mode: parseMode(options.mode),
|
|
622
|
-
provider: parseProvider2(options.provider),
|
|
623
|
-
limit: parseLimit4(options.limit)
|
|
624
|
-
});
|
|
625
|
-
if (options.json) {
|
|
626
|
-
console.log(JSON.stringify(response));
|
|
627
|
-
return;
|
|
628
|
-
}
|
|
629
|
-
printMemorySearch(response);
|
|
630
|
-
})
|
|
631
|
-
);
|
|
632
|
-
|
|
633
|
-
// src/commands/zero/memory/index.ts
|
|
634
|
-
var zeroMemoryCommand = new Command().name("memory").description("Manage, recall, and search structured memory").addCommand(listCommand).addCommand(createCommand).addCommand(updateCommand).addCommand(forgetCommand).addCommand(forgetPromptCommand).addCommand(historyCommand).addCommand(documentsCommand).addCommand(forgottenCommand).addCommand(recallCommand).addCommand(searchCommand).addCommand(contextCommand);
|
|
635
|
-
export {
|
|
636
|
-
zeroMemoryCommand
|
|
637
|
-
};
|
|
638
|
-
//# sourceMappingURL=memory-XRUIDTIV.js.map
|