@lumenflow/memory 1.0.0 → 1.3.2
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/mem-checkpoint-core.js +1 -1
- package/dist/mem-triage-core.js +1 -1
- package/package.json +7 -13
- package/dist/index.d.ts +0 -16
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mem-checkpoint-core.d.ts +0 -91
- package/dist/mem-checkpoint-core.d.ts.map +0 -1
- package/dist/mem-checkpoint-core.js.map +0 -1
- package/dist/mem-cleanup-core.d.ts +0 -202
- package/dist/mem-cleanup-core.d.ts.map +0 -1
- package/dist/mem-cleanup-core.js.map +0 -1
- package/dist/mem-create-core.d.ts +0 -93
- package/dist/mem-create-core.d.ts.map +0 -1
- package/dist/mem-create-core.js.map +0 -1
- package/dist/mem-id.d.ts +0 -91
- package/dist/mem-id.d.ts.map +0 -1
- package/dist/mem-id.js.map +0 -1
- package/dist/mem-init-core.d.ts +0 -91
- package/dist/mem-init-core.d.ts.map +0 -1
- package/dist/mem-init-core.js.map +0 -1
- package/dist/mem-ready-core.d.ts +0 -56
- package/dist/mem-ready-core.d.ts.map +0 -1
- package/dist/mem-ready-core.js.map +0 -1
- package/dist/mem-signal-core.d.ts +0 -132
- package/dist/mem-signal-core.d.ts.map +0 -1
- package/dist/mem-signal-core.js.map +0 -1
- package/dist/mem-start-core.d.ts +0 -76
- package/dist/mem-start-core.d.ts.map +0 -1
- package/dist/mem-start-core.js.map +0 -1
- package/dist/mem-summarize-core.d.ts +0 -105
- package/dist/mem-summarize-core.d.ts.map +0 -1
- package/dist/mem-summarize-core.js.map +0 -1
- package/dist/mem-triage-core.d.ts +0 -127
- package/dist/mem-triage-core.d.ts.map +0 -1
- package/dist/mem-triage-core.js.map +0 -1
- package/dist/memory-schema.d.ts +0 -150
- package/dist/memory-schema.d.ts.map +0 -1
- package/dist/memory-schema.js.map +0 -1
- package/dist/memory-store.d.ts +0 -108
- package/dist/memory-store.d.ts.map +0 -1
- package/dist/memory-store.js.map +0 -1
package/dist/mem-init-core.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Init Core (WU-1464)
|
|
3
|
-
*
|
|
4
|
-
* Core logic for initializing memory layer in a repository.
|
|
5
|
-
* Creates .beacon/memory/ directory with empty memory.jsonl and config.yaml.
|
|
6
|
-
*
|
|
7
|
-
* @see {@link tools/__tests__/mem-init.test.mjs} - Tests
|
|
8
|
-
* @see {@link tools/lib/memory-store.mjs} - Memory store operations
|
|
9
|
-
* @see {@link tools/lib/memory-schema.mjs} - Memory schema definitions
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* Memory layer file/directory paths
|
|
13
|
-
*/
|
|
14
|
-
export declare const MEMORY_PATHS: {
|
|
15
|
-
/** Memory directory relative to project root */
|
|
16
|
-
MEMORY_DIR: string;
|
|
17
|
-
/** Memory JSONL file name */
|
|
18
|
-
MEMORY_FILE: string;
|
|
19
|
-
/** Config YAML file name */
|
|
20
|
-
CONFIG_FILE: string;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Default memory layer configuration
|
|
24
|
-
*
|
|
25
|
-
* Retention values are in seconds:
|
|
26
|
-
* - ephemeral: 0 (immediate discard)
|
|
27
|
-
* - session: 3600 (1 hour)
|
|
28
|
-
* - wu: 604800 (7 days)
|
|
29
|
-
* - project: -1 (never expire)
|
|
30
|
-
*/
|
|
31
|
-
export declare const DEFAULT_CONFIG: {
|
|
32
|
-
/** Config schema version */
|
|
33
|
-
version: number;
|
|
34
|
-
/** Retention policy for each lifecycle */
|
|
35
|
-
retention: {
|
|
36
|
-
/** Ephemeral nodes are discarded immediately after use */
|
|
37
|
-
ephemeral: number;
|
|
38
|
-
/** Session nodes expire after 1 hour */
|
|
39
|
-
session: number;
|
|
40
|
-
/** WU nodes expire after 7 days */
|
|
41
|
-
wu: number;
|
|
42
|
-
/** Project nodes never expire (-1 = infinite) */
|
|
43
|
-
project: number;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Memory initialization paths
|
|
48
|
-
*/
|
|
49
|
-
interface InitMemoryPaths {
|
|
50
|
-
memoryDir: string;
|
|
51
|
-
memoryJsonl: string;
|
|
52
|
-
configYaml: string;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Memory initialization created flags
|
|
56
|
-
*/
|
|
57
|
-
interface InitMemoryCreated {
|
|
58
|
-
directory: boolean;
|
|
59
|
-
memoryJsonl: boolean;
|
|
60
|
-
configYaml: boolean;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Memory initialization result
|
|
64
|
-
*/
|
|
65
|
-
export interface InitMemoryResult {
|
|
66
|
-
success: boolean;
|
|
67
|
-
alreadyInitialized: boolean;
|
|
68
|
-
paths: InitMemoryPaths;
|
|
69
|
-
created: InitMemoryCreated;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Initialize memory layer in a repository.
|
|
73
|
-
*
|
|
74
|
-
* Creates:
|
|
75
|
-
* - .beacon/memory/ directory
|
|
76
|
-
* - memory.jsonl (empty if not exists)
|
|
77
|
-
* - config.yaml (default settings if not exists)
|
|
78
|
-
*
|
|
79
|
-
* Idempotent: Running multiple times does not corrupt existing data.
|
|
80
|
-
*
|
|
81
|
-
* @param baseDir - Base directory of the repository
|
|
82
|
-
* @returns Result object with success, paths, and created flags
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* const result = await initMemory(process.cwd());
|
|
86
|
-
* if (result.success) {
|
|
87
|
-
* console.log('Memory initialized at:', result.paths.memoryDir);
|
|
88
|
-
* }
|
|
89
|
-
*/
|
|
90
|
-
export declare function initMemory(baseDir: string): Promise<InitMemoryResult>;
|
|
91
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-init-core.d.ts","sourceRoot":"","sources":["../src/mem-init-core.ts"],"names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HAAiH;QACjH,MAAM,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAClC,CAAC;IAED,sCAAsC;IACtC,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,oGAAoG;QACpG,MAAM,EAAE,CAAC,SAAS,CAAC,eAAe,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IACpC,CAAC;IAED,6CAA6C;IAC7C,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,aAAa,GAAG,kBAAkB,EAAE,CAAC;QAC3C,mGAAmG;QACnG,MAAM,EAAE,CAAC,SAAS,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QAC3D,MAAM,CAAC,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IACnC,CAAC;IAED,MAAM,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/mem-ready-core.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Ready Core (WU-1468)
|
|
3
|
-
*
|
|
4
|
-
* Deterministic ready-work query for "what next?" oracle.
|
|
5
|
-
* Returns open nodes with no blockers, ordered by priority then createdAt.
|
|
6
|
-
*
|
|
7
|
-
* Ordering algorithm:
|
|
8
|
-
* 1. Priority ASC (P0 first, then P1, P2, P3; nodes without priority last)
|
|
9
|
-
* 2. CreatedAt ASC (oldest first for same priority)
|
|
10
|
-
* 3. ID ASC (stable sort for identical priority and timestamp)
|
|
11
|
-
*
|
|
12
|
-
* A node is "ready" if:
|
|
13
|
-
* - Linked to the specified WU
|
|
14
|
-
* - Not blocked by another node (no `blocks` relationship pointing to it)
|
|
15
|
-
* - No `metadata.blocked_by` array set
|
|
16
|
-
* - Lifecycle is not `ephemeral`
|
|
17
|
-
* - Status is not `closed` (metadata.status !== 'closed')
|
|
18
|
-
*
|
|
19
|
-
* @see {@link tools/mem-ready.mjs} - CLI implementation
|
|
20
|
-
* @see {@link tools/__tests__/mem-ready.test.mjs} - Tests
|
|
21
|
-
*/
|
|
22
|
-
import { type MemoryNode } from './memory-schema.js';
|
|
23
|
-
/**
|
|
24
|
-
* Query options for ready nodes
|
|
25
|
-
*/
|
|
26
|
-
export interface QueryOptions {
|
|
27
|
-
/** WU ID to query (required) */
|
|
28
|
-
wuId: string;
|
|
29
|
-
/** Filter by node type (optional) */
|
|
30
|
-
type?: string;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Query ready nodes for a WU.
|
|
34
|
-
*
|
|
35
|
-
* Returns unblocked, open nodes linked to the WU in deterministic order:
|
|
36
|
-
* 1. Priority (P0 first, then P1, P2, P3; nodes without priority last)
|
|
37
|
-
* 2. CreatedAt (oldest first for same priority)
|
|
38
|
-
* 3. ID (alphabetical for stable sort)
|
|
39
|
-
*
|
|
40
|
-
* @param baseDir - Base directory containing .beacon/memory
|
|
41
|
-
* @param options - Query options
|
|
42
|
-
* @returns Deterministically ordered ready nodes
|
|
43
|
-
* @throws If WU ID format is invalid or file contains malformed JSON
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* const ready = await queryReadyNodes('/path/to/project', { wuId: 'WU-1234' });
|
|
47
|
-
* console.log(`${ready.length} nodes ready for processing`);
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* // Filter by type
|
|
51
|
-
* const discoveries = await queryReadyNodes('/path/to/project', {
|
|
52
|
-
* wuId: 'WU-1234',
|
|
53
|
-
* type: 'discovery',
|
|
54
|
-
* });
|
|
55
|
-
*/
|
|
56
|
-
export declare function queryReadyNodes(baseDir: string, options: QueryOptions): Promise<MemoryNode[]>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-ready-core.d.ts","sourceRoot":"","sources":["../src/mem-ready-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkLH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA,gBAwCrD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-ready-core.js","sourceRoot":"","sources":["../src/mem-ready-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;GAEG;AACH,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;IACL,EAAE,EAAE,CAAC;CACN,CAAC;AAEF,gEAAgE;AAChE,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;;;;;GAMG;AACH,SAAS,eAAe,CAAC,IAAI;IAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IACD,yGAAyG;IACzG,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,qBAAqB,CAAC;AAC1D,CAAC;AAED;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,CAAC,EAAE,CAAC;IACxB,+CAA+C;IAC/C,MAAM,YAAY,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IAC7D,IAAI,YAA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CAAC,CAAC,CAAC;IAEH,yBAAyB;IACzB,OAAO,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Signal Core Logic (WU-1473)
|
|
3
|
-
*
|
|
4
|
-
* Core logic for creating coordination signals between parallel agents.
|
|
5
|
-
* Enables sub-100ms agent communication via JSONL append operations.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Append-only writes for sub-100ms performance
|
|
9
|
-
* - WU-scoped signals for focused coordination
|
|
10
|
-
* - Lane-targeted signals for cross-team communication
|
|
11
|
-
* - Read/unread tracking for mem:inbox integration
|
|
12
|
-
*
|
|
13
|
-
* @see {@link tools/mem-signal.mjs} - CLI wrapper
|
|
14
|
-
* @see {@link tools/__tests__/mem-signal.test.mjs} - Tests
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Signal file name constant
|
|
18
|
-
*/
|
|
19
|
-
export declare const SIGNAL_FILE_NAME = "signals.jsonl";
|
|
20
|
-
/**
|
|
21
|
-
* Signal structure
|
|
22
|
-
*/
|
|
23
|
-
export interface Signal {
|
|
24
|
-
/** Unique signal identifier (sig-XXXXXXXX) */
|
|
25
|
-
id: string;
|
|
26
|
-
/** Signal content/message */
|
|
27
|
-
message: string;
|
|
28
|
-
/** ISO 8601 timestamp */
|
|
29
|
-
created_at: string;
|
|
30
|
-
/** Whether signal has been read */
|
|
31
|
-
read: boolean;
|
|
32
|
-
/** Optional WU ID scope */
|
|
33
|
-
wu_id?: string;
|
|
34
|
-
/** Optional target lane */
|
|
35
|
-
lane?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Result of creating a signal
|
|
39
|
-
*/
|
|
40
|
-
export interface CreateSignalResult {
|
|
41
|
-
/** Whether signal was created successfully */
|
|
42
|
-
success: boolean;
|
|
43
|
-
/** The created signal object */
|
|
44
|
-
signal: Signal;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Options for creating a signal
|
|
48
|
-
*/
|
|
49
|
-
export interface CreateSignalOptions {
|
|
50
|
-
/** Signal message content (required) */
|
|
51
|
-
message: string;
|
|
52
|
-
/** WU ID to scope signal to */
|
|
53
|
-
wuId?: string;
|
|
54
|
-
/** Lane to target signal to */
|
|
55
|
-
lane?: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Options for loading signals
|
|
59
|
-
*/
|
|
60
|
-
export interface LoadSignalsOptions {
|
|
61
|
-
/** Filter by WU ID */
|
|
62
|
-
wuId?: string;
|
|
63
|
-
/** Filter by lane */
|
|
64
|
-
lane?: string;
|
|
65
|
-
/** Only return unread signals */
|
|
66
|
-
unreadOnly?: boolean;
|
|
67
|
-
/** Only return signals created after this time */
|
|
68
|
-
since?: Date | string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Result of marking signals as read
|
|
72
|
-
*/
|
|
73
|
-
export interface MarkAsReadResult {
|
|
74
|
-
/** Number of signals marked as read */
|
|
75
|
-
markedCount: number;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Creates a coordination signal between parallel agents.
|
|
79
|
-
*
|
|
80
|
-
* Signals are appended to signals.jsonl using append-only writes
|
|
81
|
-
* for sub-100ms performance. Signals can be scoped to a specific
|
|
82
|
-
* WU or targeted at a specific lane.
|
|
83
|
-
*
|
|
84
|
-
* @param {string} baseDir - Project base directory
|
|
85
|
-
* @param {CreateSignalOptions} options - Signal options
|
|
86
|
-
* @returns {Promise<CreateSignalResult>} Result with created signal
|
|
87
|
-
* @throws {Error} If message is missing or WU ID is invalid
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* const result = await createSignal('/project', {
|
|
91
|
-
* message: 'Starting feature implementation',
|
|
92
|
-
* wuId: 'WU-1473',
|
|
93
|
-
* lane: 'Operations: Tooling',
|
|
94
|
-
* });
|
|
95
|
-
*/
|
|
96
|
-
export declare function createSignal(baseDir: string, options: CreateSignalOptions): Promise<CreateSignalResult>;
|
|
97
|
-
/**
|
|
98
|
-
* Loads signals from the signals file with optional filtering.
|
|
99
|
-
*
|
|
100
|
-
* Signals are returned in chronological order (oldest first).
|
|
101
|
-
* Supports filtering by WU ID, lane, and read status.
|
|
102
|
-
*
|
|
103
|
-
* @param {string} baseDir - Project base directory
|
|
104
|
-
* @param {LoadSignalsOptions} [options={}] - Filter options
|
|
105
|
-
* @returns {Promise<Signal[]>} Array of signals matching filters
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* // Load all signals
|
|
109
|
-
* const all = await loadSignals('/project');
|
|
110
|
-
*
|
|
111
|
-
* // Load unread signals for a specific WU
|
|
112
|
-
* const unread = await loadSignals('/project', {
|
|
113
|
-
* wuId: 'WU-1473',
|
|
114
|
-
* unreadOnly: true,
|
|
115
|
-
* });
|
|
116
|
-
*/
|
|
117
|
-
export declare function loadSignals(baseDir: string, options?: LoadSignalsOptions): Promise<Signal[]>;
|
|
118
|
-
/**
|
|
119
|
-
* Marks signals as read by updating the signals file.
|
|
120
|
-
*
|
|
121
|
-
* Reads the entire file, updates the read status for matching IDs,
|
|
122
|
-
* and writes back. Only signals that were previously unread are counted.
|
|
123
|
-
*
|
|
124
|
-
* @param baseDir - Project base directory
|
|
125
|
-
* @param signalIds - Array of signal IDs to mark as read
|
|
126
|
-
* @returns Result with count of signals marked
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
* const result = await markSignalsAsRead('/project', ['sig-abc12345', 'sig-def67890']);
|
|
130
|
-
* console.log(result.markedCount); // 2
|
|
131
|
-
*/
|
|
132
|
-
export declare function markSignalsAsRead(baseDir: string, signalIds: string[]): Promise<MarkAsReadResult>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-signal-core.d.ts","sourceRoot":"","sources":["../src/mem-signal-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH;;GAE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AC;IAEzE,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC"}
|
package/dist/mem-start-core.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Start Core (WU-1466)
|
|
3
|
-
*
|
|
4
|
-
* Core logic for creating session nodes linked to WUs.
|
|
5
|
-
* Called by wu:claim enhancement for context restoration after /clear.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Creates session nodes with WU reference
|
|
9
|
-
* - Stores agent type, start timestamp, context tier
|
|
10
|
-
* - Idempotent: multiple starts create separate sessions
|
|
11
|
-
* - Auto-initializes memory layer if not present
|
|
12
|
-
*
|
|
13
|
-
* @see {@link tools/mem-start.mjs} - CLI wrapper
|
|
14
|
-
* @see {@link tools/__tests__/mem-start.test.mjs} - Tests
|
|
15
|
-
* @see {@link tools/lib/memory-schema.mjs} - Schema definitions
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Session start options
|
|
19
|
-
*/
|
|
20
|
-
export interface StartSessionOptions {
|
|
21
|
-
/** Work Unit ID (required) */
|
|
22
|
-
wuId: string;
|
|
23
|
-
/** Agent type (defaults to 'unknown') */
|
|
24
|
-
agentType?: string;
|
|
25
|
-
/** Context tier (defaults to 'full') */
|
|
26
|
-
contextTier?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Session node structure
|
|
30
|
-
*/
|
|
31
|
-
interface SessionNode {
|
|
32
|
-
id: string;
|
|
33
|
-
type: 'session';
|
|
34
|
-
lifecycle: 'wu';
|
|
35
|
-
content: string;
|
|
36
|
-
created_at: string;
|
|
37
|
-
wu_id: string;
|
|
38
|
-
session_id: string;
|
|
39
|
-
metadata: {
|
|
40
|
-
agentType: string;
|
|
41
|
-
contextTier: string;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Session start result
|
|
46
|
-
*/
|
|
47
|
-
export interface StartSessionResult {
|
|
48
|
-
/** Whether the operation succeeded */
|
|
49
|
-
success: boolean;
|
|
50
|
-
/** Created session node */
|
|
51
|
-
session: SessionNode;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Creates a new session node linked to a WU.
|
|
55
|
-
*
|
|
56
|
-
* Creates a session-type memory node with:
|
|
57
|
-
* - Unique ID (mem-XXXX format)
|
|
58
|
-
* - Link to WU via wu_id field
|
|
59
|
-
* - Agent type and context tier in metadata
|
|
60
|
-
* - UUID session_id for unique identification
|
|
61
|
-
*
|
|
62
|
-
* @param baseDir - Base directory containing .beacon/memory/
|
|
63
|
-
* @param options - Session options
|
|
64
|
-
* @returns Result with created session node
|
|
65
|
-
* @throws If wuId is missing or invalid
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* const result = await startSession('/path/to/project', {
|
|
69
|
-
* wuId: 'WU-1234',
|
|
70
|
-
* agentType: 'general-purpose',
|
|
71
|
-
* contextTier: 'core',
|
|
72
|
-
* });
|
|
73
|
-
* console.log(result.session.id); // 'mem-a1b2'
|
|
74
|
-
*/
|
|
75
|
-
export declare function startSession(baseDir: string, options: StartSessionOptions): Promise<StartSessionResult>;
|
|
76
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-start-core.d.ts","sourceRoot":"","sources":["../src/mem-start-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA2EH;;;;;;;GAOG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,YAAY,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;;;;;;;;;;;;;;;GA+ClD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-start-core.js","sourceRoot":"","sources":["../src/mem-start-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,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|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Summarize Core (WU-1471)
|
|
3
|
-
*
|
|
4
|
-
* Rollup older memory nodes into summary nodes for compaction.
|
|
5
|
-
* Implements forgetting as first-class feature.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Aggregate checkpoint/note/discovery nodes into summaries
|
|
9
|
-
* - Mark originals for cleanup after summary creation
|
|
10
|
-
* - Respect lifecycle TTL (ephemeral, session, wu, project)
|
|
11
|
-
* - Support dry-run mode for preview
|
|
12
|
-
*
|
|
13
|
-
* @see {@link tools/mem-summarize.mjs} - CLI wrapper
|
|
14
|
-
* @see {@link tools/__tests__/mem-summarize.test.mjs} - Tests
|
|
15
|
-
*/
|
|
16
|
-
import { type MemoryNode } from './memory-schema.js';
|
|
17
|
-
/**
|
|
18
|
-
* Summarize options
|
|
19
|
-
*/
|
|
20
|
-
export interface SummarizeOptions {
|
|
21
|
-
/** WU ID to summarize (e.g., 'WU-1234') */
|
|
22
|
-
wuId: string;
|
|
23
|
-
/** If true, preview without modifications */
|
|
24
|
-
dryRun?: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Summary node structure
|
|
28
|
-
*/
|
|
29
|
-
interface SummaryNode {
|
|
30
|
-
id: string;
|
|
31
|
-
type: 'summary';
|
|
32
|
-
lifecycle: 'project';
|
|
33
|
-
content: string;
|
|
34
|
-
created_at: string;
|
|
35
|
-
wu_id: string;
|
|
36
|
-
metadata: {
|
|
37
|
-
source_nodes: string[];
|
|
38
|
-
source_count: number;
|
|
39
|
-
summarized_at: string;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Summarize result
|
|
44
|
-
*/
|
|
45
|
-
export interface SummarizeResult {
|
|
46
|
-
/** Whether summarization succeeded */
|
|
47
|
-
success: boolean;
|
|
48
|
-
/** Created summary node */
|
|
49
|
-
summary: SummaryNode;
|
|
50
|
-
/** Node IDs marked for cleanup */
|
|
51
|
-
markedForCleanup: string[];
|
|
52
|
-
/** True if in dry-run mode */
|
|
53
|
-
dryRun?: boolean;
|
|
54
|
-
/** Ratio of source nodes to summary */
|
|
55
|
-
compactionRatio: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Filter nodes that can be summarized for a given WU.
|
|
59
|
-
*
|
|
60
|
-
* Excludes:
|
|
61
|
-
* - Nodes from different WUs
|
|
62
|
-
* - Ephemeral lifecycle nodes (already transient)
|
|
63
|
-
* - Already-summarized nodes (have summarized_into metadata)
|
|
64
|
-
* - Summary nodes themselves
|
|
65
|
-
*
|
|
66
|
-
* @param nodes - All memory nodes
|
|
67
|
-
* @param wuId - WU ID to filter by
|
|
68
|
-
* @returns Summarizable nodes
|
|
69
|
-
*/
|
|
70
|
-
export declare function filterSummarizableNodes(nodes: MemoryNode[], wuId: string): MemoryNode[];
|
|
71
|
-
/**
|
|
72
|
-
* Calculate compaction ratio (source nodes / summary nodes).
|
|
73
|
-
*
|
|
74
|
-
* @param sourceCount - Number of source nodes
|
|
75
|
-
* @param summaryCount - Number of summary nodes created
|
|
76
|
-
* @returns Compaction ratio (0 if invalid input)
|
|
77
|
-
*/
|
|
78
|
-
export declare function getCompactionRatio(sourceCount: number, summaryCount: number): number;
|
|
79
|
-
/**
|
|
80
|
-
* Summarize memory nodes for a closed WU.
|
|
81
|
-
*
|
|
82
|
-
* Aggregates checkpoint, note, and discovery nodes into a single
|
|
83
|
-
* summary node. Original nodes are marked for cleanup (unless
|
|
84
|
-
* they have project lifecycle).
|
|
85
|
-
*
|
|
86
|
-
* @param baseDir - Base directory containing .beacon/memory/
|
|
87
|
-
* @param options - Summarization options
|
|
88
|
-
* @returns Result with summary and cleanup info
|
|
89
|
-
* @throws If no summarizable nodes found for WU
|
|
90
|
-
*
|
|
91
|
-
* @example
|
|
92
|
-
* // Summarize nodes for a completed WU
|
|
93
|
-
* const result = await summarizeWu(baseDir, { wuId: 'WU-1234' });
|
|
94
|
-
* console.log(`Created summary ${result.summary.id}`);
|
|
95
|
-
* console.log(`Compaction ratio: ${result.compactionRatio}:1`);
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* // Preview without modifications
|
|
99
|
-
* const preview = await summarizeWu(baseDir, {
|
|
100
|
-
* wuId: 'WU-1234',
|
|
101
|
-
* dryRun: true,
|
|
102
|
-
* });
|
|
103
|
-
*/
|
|
104
|
-
export declare function summarizeWu(baseDir: string, options: SummarizeOptions): Promise<SummarizeResult>;
|
|
105
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-summarize-core.d.ts","sourceRoot":"","sources":["../src/mem-summarize-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAuBH;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,KAAA,EAAE,IAAI,KAAA,OAyBlD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,KAAA,EAAE,YAAY,KAAA,UAK3D;AAqID;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,WAAW,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDjD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-summarize-core.js","sourceRoot":"","sources":["../src/mem-summarize-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;GAEG;AACH,MAAM,UAAU,GAAG,gBAAgB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,CAAC;IAC7D,CAAC;IAED,sBAAsB;IACtB,MAAM,OAAO,GAAG,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAEtD,4CAA4C;IAC5C,MAAM,YAAY,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;IACzD,MAAM,gBAAgB,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAEvD,6BAA6B;IAC7B,MAAM,eAAe,GAAG,kBAAkB,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAEnE,mDAAmD;IACnD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO;YACL,OAAO,EAAE,IAAI;YACb,OAAO;YACP,gBAAgB;YAChB,MAAM,EAAE,IAAI;YACZ,eAAe;SAChB,CAAC;IACJ,CAAC;IAED,uBAAuB;IACvB,MAAM,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAErC,kCAAkC;IAClC,MAAM,cAAc,GAAG,oBAAoB,CAAC,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACtE,KAAK,MAAM,MAAM,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO;QACP,gBAAgB;QAChB,eAAe;KAChB,CAAC;AACJ,CAAC"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Triage Core (WU-1470)
|
|
3
|
-
*
|
|
4
|
-
* Review discovery nodes and promote to WUs or archive.
|
|
5
|
-
*
|
|
6
|
-
* Features:
|
|
7
|
-
* - List open discovery nodes with deterministic ordering
|
|
8
|
-
* - Promote discovery to WU (integrates with wu:create)
|
|
9
|
-
* - Archive discovery without promotion
|
|
10
|
-
*
|
|
11
|
-
* @see {@link tools/mem-triage.mjs} - CLI wrapper
|
|
12
|
-
* @see {@link tools/__tests__/mem-triage.test.mjs} - Tests
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Memory node structure for triage operations
|
|
16
|
-
*/
|
|
17
|
-
interface TriageMemoryNode {
|
|
18
|
-
id: string;
|
|
19
|
-
type: string;
|
|
20
|
-
lifecycle: string;
|
|
21
|
-
content: string;
|
|
22
|
-
created_at: string;
|
|
23
|
-
updated_at?: string;
|
|
24
|
-
wu_id?: string;
|
|
25
|
-
session_id?: string;
|
|
26
|
-
metadata?: Record<string, unknown>;
|
|
27
|
-
tags?: string[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Options for listing discoveries
|
|
31
|
-
*/
|
|
32
|
-
export interface ListOptions {
|
|
33
|
-
/** Filter by WU ID (or 'unlinked' for nodes without wu_id) */
|
|
34
|
-
wuId?: string;
|
|
35
|
-
/** Filter by tag */
|
|
36
|
-
tag?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* List open discovery nodes.
|
|
40
|
-
*
|
|
41
|
-
* Returns unblocked, non-archived discovery nodes in deterministic order.
|
|
42
|
-
*
|
|
43
|
-
* @param baseDir - Base directory
|
|
44
|
-
* @param options - Filter options
|
|
45
|
-
* @returns Open discovery nodes
|
|
46
|
-
*/
|
|
47
|
-
export declare function listOpenDiscoveries(baseDir: string, options?: ListOptions): Promise<TriageMemoryNode[]>;
|
|
48
|
-
/**
|
|
49
|
-
* Options for archiving a discovery
|
|
50
|
-
*/
|
|
51
|
-
export interface ArchiveOptions {
|
|
52
|
-
/** Node ID to archive */
|
|
53
|
-
nodeId: string;
|
|
54
|
-
/** Archive reason */
|
|
55
|
-
reason: string;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Result of archiving a discovery
|
|
59
|
-
*/
|
|
60
|
-
export interface ArchiveResult {
|
|
61
|
-
/** Whether archiving succeeded */
|
|
62
|
-
success: boolean;
|
|
63
|
-
/** Archived node ID */
|
|
64
|
-
nodeId: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Archive a discovery node without promotion.
|
|
68
|
-
*
|
|
69
|
-
* Sets metadata.status to 'archived' and records the reason.
|
|
70
|
-
*
|
|
71
|
-
* @param baseDir - Base directory
|
|
72
|
-
* @param options - Archive options
|
|
73
|
-
* @returns Archive result
|
|
74
|
-
* @throws If node not found, not a discovery, or already archived
|
|
75
|
-
*/
|
|
76
|
-
export declare function archiveDiscovery(baseDir: string, options: ArchiveOptions): Promise<ArchiveResult>;
|
|
77
|
-
/**
|
|
78
|
-
* Options for promoting a discovery to a WU
|
|
79
|
-
*/
|
|
80
|
-
export interface PromoteOptions {
|
|
81
|
-
/** Node ID to promote */
|
|
82
|
-
nodeId: string;
|
|
83
|
-
/** WU lane */
|
|
84
|
-
lane: string;
|
|
85
|
-
/** Custom WU title (defaults to discovery content) */
|
|
86
|
-
title?: string;
|
|
87
|
-
/** Explicit WU ID (defaults to next available) */
|
|
88
|
-
wuId?: string;
|
|
89
|
-
/** Priority override */
|
|
90
|
-
priority?: string;
|
|
91
|
-
/** If true, return spec without creating WU */
|
|
92
|
-
dryRun?: boolean;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* WU specification generated from promotion
|
|
96
|
-
*/
|
|
97
|
-
export interface WUSpec {
|
|
98
|
-
/** WU ID */
|
|
99
|
-
id: string;
|
|
100
|
-
/** WU title */
|
|
101
|
-
title: string;
|
|
102
|
-
/** WU lane */
|
|
103
|
-
lane: string;
|
|
104
|
-
/** WU priority */
|
|
105
|
-
priority: string;
|
|
106
|
-
/** WU notes with provenance */
|
|
107
|
-
notes: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* Result of promoting a discovery
|
|
111
|
-
*/
|
|
112
|
-
export interface PromoteResult {
|
|
113
|
-
/** Whether promotion succeeded */
|
|
114
|
-
success: boolean;
|
|
115
|
-
/** Generated WU specification */
|
|
116
|
-
wuSpec: WUSpec;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Promote a discovery node to a WU.
|
|
120
|
-
*
|
|
121
|
-
* @param baseDir - Base directory
|
|
122
|
-
* @param options - Promote options
|
|
123
|
-
* @returns Promotion result
|
|
124
|
-
* @throws If node not found, not a discovery, or already closed
|
|
125
|
-
*/
|
|
126
|
-
export declare function promoteDiscovery(baseDir: string, options: PromoteOptions): Promise<PromoteResult>;
|
|
127
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mem-triage-core.d.ts","sourceRoot":"","sources":["../src/mem-triage-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA6KH;;;;GAIG;AAEH;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,KAAA,EAAE,OAAO,KAAK,kBAgC9D;AAED;;;;GAIG;AAEH;;;;GAIG;AAEH;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;;;GAsCtD;AAwED;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,KAAA,EAAE,OAAO,KAAA;;;;;;;;;GA2CtD"}
|