@memnexus-ai/cli 1.7.231 → 1.7.233
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/dist/commands/memories.d.ts.map +1 -1
- package/dist/commands/memories.js +44 -8
- package/dist/commands/memories.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +39 -1
- package/dist/commands/setup.js.map +1 -1
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-help.d.ts.map +1 -1
- package/dist/lib/agent-help.js +6 -0
- package/dist/lib/agent-help.js.map +1 -1
- package/dist/lib/cli-parsing.d.ts +45 -0
- package/dist/lib/cli-parsing.d.ts.map +1 -0
- package/dist/lib/cli-parsing.js +82 -0
- package/dist/lib/cli-parsing.js.map +1 -0
- package/dist/lib/content-input.d.ts +87 -0
- package/dist/lib/content-input.d.ts.map +1 -0
- package/dist/lib/content-input.js +320 -0
- package/dist/lib/content-input.js.map +1 -0
- package/dist/lib/setup/config-writer.d.ts +14 -0
- package/dist/lib/setup/config-writer.d.ts.map +1 -1
- package/dist/lib/setup/config-writer.js +44 -5
- package/dist/lib/setup/config-writer.js.map +1 -1
- package/dist/lib/setup/index.d.ts +1 -1
- package/dist/lib/setup/index.d.ts.map +1 -1
- package/dist/lib/setup/index.js +2 -1
- package/dist/lib/setup/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memories.d.ts","sourceRoot":"","sources":["../../src/commands/memories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,KAAK,EAGN,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"memories.d.ts","sourceRoot":"","sources":["../../src/commands/memories.ts"],"names":[],"mappings":"AAAA,OAAO,E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,OAAO,GAAG,IAAI,CA0ErE;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAsE1E;AA0DD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAsJ7D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CA2G7D;AAgLD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAuI5D;AAkPD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAkPnE"}
|
|
@@ -82,6 +82,7 @@ const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
|
82
82
|
const spinner_1 = require("../lib/spinner");
|
|
83
83
|
const date_utils_1 = require("../lib/date-utils");
|
|
84
84
|
const session_reader_1 = require("../lib/commit-context/session-reader");
|
|
85
|
+
const content_input_1 = require("../lib/content-input");
|
|
85
86
|
const fs = __importStar(require("fs"));
|
|
86
87
|
const os = __importStar(require("os"));
|
|
87
88
|
const path = __importStar(require("path"));
|
|
@@ -1637,6 +1638,9 @@ function registerMemoriesCommands(program) {
|
|
|
1637
1638
|
.description('Create a new memory')
|
|
1638
1639
|
.option('--conversation-id <id>', 'Conversation ID (REQUIRED - use "NEW" to create a new conversation)')
|
|
1639
1640
|
.option('--content <text>', 'Memory content')
|
|
1641
|
+
.option('--content-file <path>', 'Read memory content verbatim from a file ("-" for stdin). Shell-safe: backticks and ' +
|
|
1642
|
+
'$(...) in the text are stored literally instead of being expanded by your shell. ' +
|
|
1643
|
+
'Mutually exclusive with --content.')
|
|
1640
1644
|
.option('--name <name>', 'Assign a kebab-case name for deterministic retrieval')
|
|
1641
1645
|
.option('--memory-type <type>', 'Memory type (episodic|semantic|procedural)')
|
|
1642
1646
|
.option('--context <context>', 'Context identifier')
|
|
@@ -1666,7 +1670,7 @@ function registerMemoriesCommands(program) {
|
|
|
1666
1670
|
// Streaming batch create path. Mutually exclusive with the single-create
|
|
1667
1671
|
// content/interactive flags — the input is stdin JSONL, not CLI flags.
|
|
1668
1672
|
if (options.stdinJsonl) {
|
|
1669
|
-
const conflicting = ['content', 'interactive', 'supersedes'].filter((
|
|
1673
|
+
const conflicting = ['content', 'content-file', 'interactive', 'supersedes'].filter((flag) => options[flag === 'content-file' ? 'contentFile' : flag]);
|
|
1670
1674
|
if (conflicting.length > 0) {
|
|
1671
1675
|
console.error(chalk_1.default.red(`Error: --stdin-jsonl cannot be combined with --${conflicting.join(', --')}. ` +
|
|
1672
1676
|
'Pass all fields as JSON per line on stdin instead.'));
|
|
@@ -1697,11 +1701,22 @@ function registerMemoriesCommands(program) {
|
|
|
1697
1701
|
}
|
|
1698
1702
|
}
|
|
1699
1703
|
let memoryData = {};
|
|
1700
|
-
//
|
|
1701
|
-
|
|
1704
|
+
// Resolve the content source once. --content-file reads the text verbatim
|
|
1705
|
+
// from a file (or stdin), which is the only input path a shell cannot
|
|
1706
|
+
// rewrite: a double-quoted --content has backticks and $(...) expanded by
|
|
1707
|
+
// bash before mx ever runs. Throws (exit 2) on both-flags, missing file,
|
|
1708
|
+
// empty file, or content over the 50,000-character server cap — before
|
|
1709
|
+
// any network call.
|
|
1710
|
+
const resolvedContent = await (0, content_input_1.resolveContentInput)({
|
|
1711
|
+
content: options.content,
|
|
1712
|
+
contentFile: options.contentFile,
|
|
1713
|
+
interactive: options.interactive,
|
|
1714
|
+
});
|
|
1715
|
+
// Default conversationId to "NEW" when content is provided without --conversation-id
|
|
1716
|
+
if (resolvedContent && !options.conversationId) {
|
|
1702
1717
|
options.conversationId = 'NEW';
|
|
1703
1718
|
}
|
|
1704
|
-
if (options.interactive || !
|
|
1719
|
+
if (options.interactive || !resolvedContent) {
|
|
1705
1720
|
// Interactive mode
|
|
1706
1721
|
const answers = await inquirer_1.default.prompt([
|
|
1707
1722
|
{
|
|
@@ -1715,7 +1730,7 @@ function registerMemoriesCommands(program) {
|
|
|
1715
1730
|
type: 'input',
|
|
1716
1731
|
name: 'content',
|
|
1717
1732
|
message: 'Memory content:',
|
|
1718
|
-
default:
|
|
1733
|
+
default: resolvedContent,
|
|
1719
1734
|
validate: (input) => input.trim().length > 0 || 'Content is required',
|
|
1720
1735
|
},
|
|
1721
1736
|
{
|
|
@@ -1781,7 +1796,7 @@ function registerMemoriesCommands(program) {
|
|
|
1781
1796
|
memoryData = {
|
|
1782
1797
|
conversationId: options.conversationId,
|
|
1783
1798
|
claudeSessionId: claudeSession?.sessionId || undefined,
|
|
1784
|
-
content:
|
|
1799
|
+
content: resolvedContent,
|
|
1785
1800
|
name: options.name || undefined,
|
|
1786
1801
|
role: options.role || 'user',
|
|
1787
1802
|
memoryType: options.memoryType || (options.name ? 'procedural' : 'episodic'),
|
|
@@ -1944,6 +1959,9 @@ function registerMemoriesCommands(program) {
|
|
|
1944
1959
|
.option('--assign-name <name>', 'Assign a name to an existing memory (kebab-case, 2-64 chars)')
|
|
1945
1960
|
.option('--rename <newName>', 'Rename a named memory (use with --name or an ID that has a name)')
|
|
1946
1961
|
.option('--content <text>', 'Updated content')
|
|
1962
|
+
.option('--content-file <path>', 'Read updated content verbatim from a file ("-" for stdin). Shell-safe: backticks and ' +
|
|
1963
|
+
'$(...) in the text are stored literally instead of being expanded by your shell. ' +
|
|
1964
|
+
'Mutually exclusive with --content.')
|
|
1947
1965
|
.option('--memory-type <type>', 'Updated memory type')
|
|
1948
1966
|
.option('--context <context>', 'Updated context')
|
|
1949
1967
|
.option('--topics <topics>', 'Updated topics (comma-separated)')
|
|
@@ -1960,8 +1978,15 @@ function registerMemoriesCommands(program) {
|
|
|
1960
1978
|
throw (0, errors_1.validationError)('Cannot use --assign-name and --rename together');
|
|
1961
1979
|
}
|
|
1962
1980
|
const updates = {};
|
|
1963
|
-
|
|
1964
|
-
|
|
1981
|
+
// Same shell-safe input path as create. `update` carries every
|
|
1982
|
+
// leader-state / known-issues / iteration-log document in the fleet, so
|
|
1983
|
+
// this is where shell expansion did the most damage.
|
|
1984
|
+
const resolvedContent = await (0, content_input_1.resolveContentInput)({
|
|
1985
|
+
content: options.content,
|
|
1986
|
+
contentFile: options.contentFile,
|
|
1987
|
+
});
|
|
1988
|
+
if (resolvedContent)
|
|
1989
|
+
updates.content = resolvedContent;
|
|
1965
1990
|
if (options.memoryType)
|
|
1966
1991
|
updates.memoryType = options.memoryType;
|
|
1967
1992
|
if (options.context)
|
|
@@ -2507,6 +2532,17 @@ function registerMemoriesCommands(program) {
|
|
|
2507
2532
|
if (degradedLine) {
|
|
2508
2533
|
console.error(chalk_1.default.yellow(degradedLine));
|
|
2509
2534
|
}
|
|
2535
|
+
// v4.21 FR-7: gate the exit code so a scripted caller can tell "partial
|
|
2536
|
+
// answer" (6) from a complete result (0), matching recall/digest/status.
|
|
2537
|
+
// Keyed strictly on health.degraded — a zero-result-but-degraded search
|
|
2538
|
+
// (the worst case: "nothing found" that is actually incomplete) also
|
|
2539
|
+
// exits 6, while a zero-result COMPLETE search stays 0. Set via
|
|
2540
|
+
// process.exitCode (NOT process.exit) so the buffered stdout/JSON of
|
|
2541
|
+
// every output branch below flushes first. The stderr warning, headline
|
|
2542
|
+
// suffix, and --json/--yaml health shape are unchanged.
|
|
2543
|
+
if (search.health.degraded) {
|
|
2544
|
+
process.exitCode = EXIT_DEGRADED_RESULT;
|
|
2545
|
+
}
|
|
2510
2546
|
// Surface extraction failures (#2862). Failed memories are invisible to
|
|
2511
2547
|
// fact/entity search, so flag them on stderr where they won't pollute
|
|
2512
2548
|
// piped JSON. Callers in table mode also see an inline indicator below.
|