claude-flow 3.59.13 → 3.59.14
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/.claude/proven-config.json +1 -1
- package/package.json +1 -1
- package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
- package/v3/@claude-flow/cli/dist/src/mcp-tools/memory-tools.js +41 -11
- package/v3/@claude-flow/cli/dist/src/mcp-tools/workflow-tools.js +3 -2
- package/v3/@claude-flow/cli/package.json +1 -1
package/package.json
CHANGED
|
@@ -21,6 +21,17 @@ import { DEFAULT_SEARCH_THRESHOLD, nearMisses } from '../memory/search-defaults.
|
|
|
21
21
|
const MEMORY_DIR = '.swarm';
|
|
22
22
|
const LEGACY_MEMORY_FILE = 'store.json';
|
|
23
23
|
const LEGACY_MEMORY_DIR = '.claude-flow/memory';
|
|
24
|
+
/**
|
|
25
|
+
* #3196: allow an MCP caller to select the same explicit store the CLI accepts
|
|
26
|
+
* via `--path`. No path means the existing MCP default is unchanged; this is
|
|
27
|
+
* deliberately not an implicit `CLAUDE_FLOW_DB_PATH` override because the
|
|
28
|
+
* native/encrypted CLI store and the AgentDB sibling are separate backends.
|
|
29
|
+
*/
|
|
30
|
+
function resolveDbPathOption(inputDbPath) {
|
|
31
|
+
return typeof inputDbPath === 'string' && inputDbPath.trim().length > 0
|
|
32
|
+
? resolve(inputDbPath)
|
|
33
|
+
: undefined;
|
|
34
|
+
}
|
|
24
35
|
const MIGRATION_MARKER = '.migrated-to-sqlite';
|
|
25
36
|
function getMemoryDir() {
|
|
26
37
|
return resolve(MEMORY_DIR);
|
|
@@ -439,6 +450,7 @@ export const memoryTools = [
|
|
|
439
450
|
enum: ['user_claim', 'agent_output', 'system_observation', 'tool_result', 'unknown'],
|
|
440
451
|
description: 'ADR-323: who/what produced this value, so shared-namespace retrieval can filter by trust level instead of conflating a user\'s stated claim with an agent\'s own output. Default: "unknown".',
|
|
441
452
|
},
|
|
453
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
442
454
|
},
|
|
443
455
|
required: ['key', 'value'],
|
|
444
456
|
},
|
|
@@ -447,7 +459,9 @@ export const memoryTools = [
|
|
|
447
459
|
if (missingKey) {
|
|
448
460
|
return { success: false, key: input.key, stored: false, hasEmbedding: false, ...missingKey };
|
|
449
461
|
}
|
|
450
|
-
|
|
462
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
463
|
+
if (!dbPath)
|
|
464
|
+
await ensureInitialized();
|
|
451
465
|
const { storeEntry } = await getMemoryFunctions();
|
|
452
466
|
const key = input.key;
|
|
453
467
|
const namespace = input.namespace || 'default';
|
|
@@ -486,6 +500,7 @@ export const memoryTools = [
|
|
|
486
500
|
ttl,
|
|
487
501
|
upsert,
|
|
488
502
|
provenanceType,
|
|
503
|
+
dbPath,
|
|
489
504
|
});
|
|
490
505
|
const duration = performance.now() - startTime;
|
|
491
506
|
return {
|
|
@@ -522,6 +537,7 @@ export const memoryTools = [
|
|
|
522
537
|
properties: {
|
|
523
538
|
key: { type: 'string', description: 'Memory key' },
|
|
524
539
|
namespace: { type: 'string', description: 'Namespace (default: "default")' },
|
|
540
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
525
541
|
},
|
|
526
542
|
required: ['key'],
|
|
527
543
|
},
|
|
@@ -530,13 +546,15 @@ export const memoryTools = [
|
|
|
530
546
|
if (missingKey) {
|
|
531
547
|
return { key: input.key, namespace: input.namespace, value: null, found: false, ...missingKey };
|
|
532
548
|
}
|
|
533
|
-
|
|
549
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
550
|
+
if (!dbPath)
|
|
551
|
+
await ensureInitialized();
|
|
534
552
|
const { getEntry } = await getMemoryFunctions();
|
|
535
553
|
const key = input.key;
|
|
536
554
|
const namespace = input.namespace || 'default';
|
|
537
555
|
validateMemoryInput(key, undefined, undefined, namespace);
|
|
538
556
|
try {
|
|
539
|
-
const result = await getEntry({ key, namespace });
|
|
557
|
+
const result = await getEntry({ key, namespace, dbPath });
|
|
540
558
|
if (result.found && result.entry) {
|
|
541
559
|
// Try to parse JSON value
|
|
542
560
|
let value = result.entry.content;
|
|
@@ -594,6 +612,7 @@ export const memoryTools = [
|
|
|
594
612
|
items: { type: 'string', enum: ['user_claim', 'agent_output', 'system_observation', 'tool_result', 'unknown'] },
|
|
595
613
|
description: 'ADR-323: restrict results to these provenance types (e.g. exclude user_claim when fact-checking). Omit for no filtering. Enforced for standard and SmartRetrieval searches.',
|
|
596
614
|
},
|
|
615
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
597
616
|
},
|
|
598
617
|
required: ['query'],
|
|
599
618
|
},
|
|
@@ -602,7 +621,9 @@ export const memoryTools = [
|
|
|
602
621
|
if (missingQuery) {
|
|
603
622
|
return { query: input.query, results: [], total: 0, ...missingQuery };
|
|
604
623
|
}
|
|
605
|
-
|
|
624
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
625
|
+
if (!dbPath)
|
|
626
|
+
await ensureInitialized();
|
|
606
627
|
const { searchEntries } = await getMemoryFunctions();
|
|
607
628
|
const query = input.query;
|
|
608
629
|
const provenanceFilter = input.provenance_filter;
|
|
@@ -649,6 +670,7 @@ export const memoryTools = [
|
|
|
649
670
|
limit: req.limit || limit * 3,
|
|
650
671
|
threshold: req.threshold ?? threshold,
|
|
651
672
|
provenanceFilter,
|
|
673
|
+
dbPath,
|
|
652
674
|
});
|
|
653
675
|
return {
|
|
654
676
|
results: r.results.map(e => ({
|
|
@@ -693,7 +715,7 @@ export const memoryTools = [
|
|
|
693
715
|
};
|
|
694
716
|
});
|
|
695
717
|
const smartNearMisses = results.length === 0 && thresholdWasDefault
|
|
696
|
-
? await nearMisses(searchEntries, { query, namespace, provenanceFilter })
|
|
718
|
+
? await nearMisses(searchEntries, { query, namespace, provenanceFilter, dbPath })
|
|
697
719
|
: undefined;
|
|
698
720
|
return {
|
|
699
721
|
query,
|
|
@@ -721,6 +743,7 @@ export const memoryTools = [
|
|
|
721
743
|
limit,
|
|
722
744
|
threshold,
|
|
723
745
|
provenanceFilter,
|
|
746
|
+
dbPath,
|
|
724
747
|
});
|
|
725
748
|
if (!result.success) {
|
|
726
749
|
return { query, results: [], total: 0, error: result.error };
|
|
@@ -744,7 +767,7 @@ export const memoryTools = [
|
|
|
744
767
|
};
|
|
745
768
|
});
|
|
746
769
|
const nearMissInfo = results.length === 0 && thresholdWasDefault
|
|
747
|
-
? await nearMisses(searchEntries, { query, namespace, provenanceFilter })
|
|
770
|
+
? await nearMisses(searchEntries, { query, namespace, provenanceFilter, dbPath })
|
|
748
771
|
: undefined;
|
|
749
772
|
return {
|
|
750
773
|
query,
|
|
@@ -775,6 +798,7 @@ export const memoryTools = [
|
|
|
775
798
|
properties: {
|
|
776
799
|
key: { type: 'string', description: 'Memory key' },
|
|
777
800
|
namespace: { type: 'string', description: 'Namespace (default: "default")' },
|
|
801
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
778
802
|
},
|
|
779
803
|
required: ['key'],
|
|
780
804
|
},
|
|
@@ -783,13 +807,15 @@ export const memoryTools = [
|
|
|
783
807
|
if (missingKey) {
|
|
784
808
|
return { success: false, key: input.key, namespace: input.namespace, deleted: false, ...missingKey };
|
|
785
809
|
}
|
|
786
|
-
|
|
810
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
811
|
+
if (!dbPath)
|
|
812
|
+
await ensureInitialized();
|
|
787
813
|
const { deleteEntry } = await getMemoryFunctions();
|
|
788
814
|
const key = input.key;
|
|
789
815
|
const namespace = input.namespace || 'default';
|
|
790
816
|
validateMemoryInput(key, undefined, undefined, namespace);
|
|
791
817
|
try {
|
|
792
|
-
const result = await deleteEntry({ key, namespace });
|
|
818
|
+
const result = await deleteEntry({ key, namespace, dbPath });
|
|
793
819
|
return {
|
|
794
820
|
success: result.deleted,
|
|
795
821
|
key,
|
|
@@ -825,10 +851,13 @@ export const memoryTools = [
|
|
|
825
851
|
},
|
|
826
852
|
limit: { type: 'number', description: 'Maximum results (default: 50)' },
|
|
827
853
|
offset: { type: 'number', description: 'Offset for pagination (default: 0)' },
|
|
854
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
828
855
|
},
|
|
829
856
|
},
|
|
830
857
|
handler: async (input) => {
|
|
831
|
-
|
|
858
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
859
|
+
if (!dbPath)
|
|
860
|
+
await ensureInitialized();
|
|
832
861
|
const { listEntries } = await getMemoryFunctions();
|
|
833
862
|
const namespace = input.namespace;
|
|
834
863
|
const tags = Array.isArray(input.tags)
|
|
@@ -847,6 +876,7 @@ export const memoryTools = [
|
|
|
847
876
|
tags,
|
|
848
877
|
limit,
|
|
849
878
|
offset,
|
|
879
|
+
dbPath,
|
|
850
880
|
});
|
|
851
881
|
const entries = result.entries.map(e => ({
|
|
852
882
|
key: e.key,
|
|
@@ -884,14 +914,14 @@ export const memoryTools = [
|
|
|
884
914
|
inputSchema: {
|
|
885
915
|
type: 'object',
|
|
886
916
|
properties: {
|
|
887
|
-
dbPath: { type: 'string', description: '
|
|
917
|
+
dbPath: { type: 'string', description: 'Explicit SQLite store to read/write; omit to use the MCP default (the native/AgentDB sibling).' },
|
|
888
918
|
},
|
|
889
919
|
},
|
|
890
920
|
handler: async (input) => {
|
|
891
921
|
if (input.dbPath !== undefined && (typeof input.dbPath !== 'string' || !input.dbPath.trim())) {
|
|
892
922
|
return memoryStatsUnavailable('dbPath must be a non-empty string');
|
|
893
923
|
}
|
|
894
|
-
const dbPath =
|
|
924
|
+
const dbPath = resolveDbPathOption(input.dbPath);
|
|
895
925
|
// An explicit read must not initialize or migrate the unrelated default store.
|
|
896
926
|
if (!dbPath)
|
|
897
927
|
await ensureInitialized();
|
|
@@ -583,7 +583,8 @@ export const workflowTools = [
|
|
|
583
583
|
}
|
|
584
584
|
// Sort by creation date (newest first)
|
|
585
585
|
workflows.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
|
586
|
-
//
|
|
586
|
+
// Count the matches before the limit cuts the page down
|
|
587
|
+
const total = workflows.length;
|
|
587
588
|
const limit = input.limit || 20;
|
|
588
589
|
workflows = workflows.slice(0, limit);
|
|
589
590
|
return {
|
|
@@ -595,7 +596,7 @@ export const workflowTools = [
|
|
|
595
596
|
createdAt: w.createdAt,
|
|
596
597
|
completedAt: w.completedAt,
|
|
597
598
|
})),
|
|
598
|
-
total
|
|
599
|
+
total,
|
|
599
600
|
filters: { status: input.status },
|
|
600
601
|
};
|
|
601
602
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.59.
|
|
3
|
+
"version": "3.59.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|