hebbian 0.3.4 → 0.5.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.
@@ -0,0 +1,42 @@
1
+ import type { OutcomeType } from './constants';
2
+ export interface SessionState {
3
+ ts: string;
4
+ sha: string;
5
+ status: string[];
6
+ neurons: string[];
7
+ uuid: string;
8
+ }
9
+ export interface OutcomeResult {
10
+ outcome: OutcomeType;
11
+ neuronsAffected: number;
12
+ protectedSkipped: number;
13
+ detail: string;
14
+ }
15
+ /**
16
+ * Capture session state: git HEAD SHA, working tree status, active neurons.
17
+ * Writes session_state_{uuid}.json to hippocampus/session_state/.
18
+ * Returns null if not in a git repo.
19
+ */
20
+ export declare function captureSessionStart(brainRoot: string): SessionState | null;
21
+ /**
22
+ * Detect session outcome by comparing git state at start vs end.
23
+ * Writes contra on revert, logs outcome episode.
24
+ * Returns null if no session state or no changes detected.
25
+ */
26
+ export declare function detectOutcome(brainRoot: string): OutcomeResult | null;
27
+ /**
28
+ * Classify outcome based on git state comparison.
29
+ *
30
+ * Case 1: status unchanged + HEAD unchanged → no-op (null)
31
+ * Case 2: new files/mods in status vs start → acceptance
32
+ * Case 3: status items removed/restored vs start → possible revert
33
+ * Case 4: HEAD moved, non-empty committed diff → acceptance
34
+ * Case 5: HEAD moved, net-zero diff OR "revert" in git log → revert
35
+ */
36
+ export declare function classifyOutcome(state: SessionState, currentSha: string, currentStatus: string[]): OutcomeType | null;
37
+ /**
38
+ * Build per-neuron outcome summary from episode history.
39
+ * Returns markdown section for the evolve prompt, or empty string if no data.
40
+ */
41
+ export declare function buildOutcomeSummary(brainRoot: string): string;
42
+ //# sourceMappingURL=outcome.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outcome.d.ts","sourceRoot":"","sources":["../src/outcome.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,WAAW,YAAY;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,aAAa;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CACf;AAID;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CA2C1E;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAsErE;AAID;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC9B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EAAE,GACrB,WAAW,GAAG,IAAI,CAwDpB;AA0BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAqC7D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hebbian",
3
- "version": "0.3.4",
3
+ "version": "0.5.0",
4
4
  "description": "Folder-as-neuron brain for any AI agent. mkdir replaces system prompts.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",