hebbian 0.2.0 → 0.3.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.
- package/dist/api.d.ts +23 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/bin/hebbian.js +1012 -38
- package/dist/bin/hebbian.js.map +1 -1
- package/dist/constants.d.ts +6 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/digest.d.ts +30 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/episode.d.ts +16 -0
- package/dist/episode.d.ts.map +1 -0
- package/dist/hooks.d.ts +20 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/inbox.d.ts +28 -0
- package/dist/inbox.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +906 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/digest.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DigestResult {
|
|
2
|
+
corrections: number;
|
|
3
|
+
skipped: number;
|
|
4
|
+
transcriptPath: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ExtractedCorrection {
|
|
8
|
+
text: string;
|
|
9
|
+
path: string;
|
|
10
|
+
prefix: 'NO' | 'DO';
|
|
11
|
+
keywords: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parse hook input from stdin to extract transcript path and session ID.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readHookInput(stdin: string): {
|
|
17
|
+
transcriptPath: string;
|
|
18
|
+
sessionId: string;
|
|
19
|
+
} | null;
|
|
20
|
+
/**
|
|
21
|
+
* Digest a conversation transcript and extract corrections.
|
|
22
|
+
* Auto-processes inbox and writes audit log.
|
|
23
|
+
*/
|
|
24
|
+
export declare function digestTranscript(brainRoot: string, transcriptPath: string, sessionId?: string): DigestResult;
|
|
25
|
+
/**
|
|
26
|
+
* Extract corrections from user messages using pattern matching.
|
|
27
|
+
* Returns up to MAX_CORRECTIONS_PER_SESSION corrections.
|
|
28
|
+
*/
|
|
29
|
+
export declare function extractCorrections(messages: string[]): ExtractedCorrection[];
|
|
30
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../src/digest.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,YAAY;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB;AAyCD;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAYjG;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAsD5G;AA6CD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAuB5E"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Episode {
|
|
2
|
+
ts: string;
|
|
3
|
+
type: string;
|
|
4
|
+
path: string;
|
|
5
|
+
detail: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Log an episode to the hippocampus session log.
|
|
9
|
+
* Circular buffer — writes to memoryN.neuron, wraps at MAX_EPISODES.
|
|
10
|
+
*/
|
|
11
|
+
export declare function logEpisode(brainRoot: string, type: string, path: string, detail: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Read all episodes from the session log, sorted by timestamp.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readEpisodes(brainRoot: string): Episode[];
|
|
16
|
+
//# sourceMappingURL=episode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"episode.d.ts","sourceRoot":"","sources":["../src/episode.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAmB9F;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,EAAE,CA0BzD"}
|
package/dist/hooks.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface HookStatus {
|
|
2
|
+
installed: boolean;
|
|
3
|
+
path: string;
|
|
4
|
+
events: string[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Install hebbian hooks into .claude/settings.local.json.
|
|
8
|
+
* Deep-merges with existing settings. Uses statusMessage marker for ownership.
|
|
9
|
+
*/
|
|
10
|
+
export declare function installHooks(brainRoot: string, projectRoot?: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Remove hebbian hooks from .claude/settings.local.json.
|
|
13
|
+
* Preserves non-hebbian hooks and other settings.
|
|
14
|
+
*/
|
|
15
|
+
export declare function uninstallHooks(projectRoot?: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Check if hebbian hooks are installed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkHooks(projectRoot?: string): HookStatus;
|
|
20
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,UAAU;IAC1B,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAcD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAmF1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CA6CzD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,CAmD3D"}
|
package/dist/inbox.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface Correction {
|
|
2
|
+
ts: string;
|
|
3
|
+
type: 'correction';
|
|
4
|
+
text: string;
|
|
5
|
+
path: string;
|
|
6
|
+
counter_add: number;
|
|
7
|
+
author: string;
|
|
8
|
+
dopamine?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface InboxResult {
|
|
11
|
+
processed: number;
|
|
12
|
+
skipped: number;
|
|
13
|
+
errors: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Process the inbox corrections file.
|
|
17
|
+
* Each line is a JSON object describing a correction to apply.
|
|
18
|
+
*/
|
|
19
|
+
export declare function processInbox(brainRoot: string): InboxResult;
|
|
20
|
+
/**
|
|
21
|
+
* Ensure the inbox directory and corrections file exist.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ensureInbox(brainRoot: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Append a correction entry to the inbox.
|
|
26
|
+
*/
|
|
27
|
+
export declare function appendCorrection(brainRoot: string, correction: Correction): void;
|
|
28
|
+
//# sourceMappingURL=inbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inbox.d.ts","sourceRoot":"","sources":["../src/inbox.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW,CAqE3D;AA8CD;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAKhF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,4 +16,15 @@ export { gitSnapshot } from './snapshot';
|
|
|
16
16
|
export { startWatch } from './watch';
|
|
17
17
|
export { initBrain } from './init';
|
|
18
18
|
export { emitBootstrap, emitIndex, emitRegionRules, emitToTarget, writeAllTiers, printDiag } from './emit';
|
|
19
|
+
export { startAPI, getLastActivity, getPendingReports, clearReports } from './api';
|
|
20
|
+
export type { ReportEntry } from './api';
|
|
21
|
+
export { logEpisode, readEpisodes } from './episode';
|
|
22
|
+
export type { Episode } from './episode';
|
|
23
|
+
export { processInbox, ensureInbox, appendCorrection } from './inbox';
|
|
24
|
+
export type { Correction, InboxResult } from './inbox';
|
|
25
|
+
export { installHooks, uninstallHooks, checkHooks } from './hooks';
|
|
26
|
+
export type { HookStatus } from './hooks';
|
|
27
|
+
export { digestTranscript, extractCorrections, readHookInput } from './digest';
|
|
28
|
+
export type { DigestResult, ExtractedCorrection } from './digest';
|
|
29
|
+
export { resolveBrainRoot } from './constants';
|
|
19
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC"}
|
|
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