abmind 0.2.5 → 0.2.7-alpha.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/SUPPORTED-SURFACE.md +20 -2
- package/dist/cli/abmind-hook-recall.js +17 -40
- package/dist/cli/abmind-hook-recall.js.map +1 -1
- package/dist/cli/abmind-hook-store.js +10 -31
- package/dist/cli/abmind-hook-store.js.map +1 -1
- package/dist/cli/abmind-hook-wakeup.js +17 -3
- package/dist/cli/abmind-hook-wakeup.js.map +1 -1
- package/dist/cli/abmind-install.js +19 -19
- package/dist/cli/abmind-install.js.map +1 -1
- package/dist/cli/abmind-restore.js +10 -0
- package/dist/cli/abmind-restore.js.map +1 -1
- package/dist/cli/abmind-sleep.d.ts +9 -5
- package/dist/cli/abmind-sleep.d.ts.map +1 -1
- package/dist/cli/abmind-sleep.js +61 -14
- package/dist/cli/abmind-sleep.js.map +1 -1
- package/dist/cli/hook-lifecycle-adapter.d.ts +11 -0
- package/dist/cli/hook-lifecycle-adapter.d.ts.map +1 -0
- package/dist/cli/hook-lifecycle-adapter.js +33 -0
- package/dist/cli/hook-lifecycle-adapter.js.map +1 -0
- package/dist/src/context-engine.d.ts +13 -3
- package/dist/src/context-engine.d.ts.map +1 -1
- package/dist/src/context-engine.js +22 -5
- package/dist/src/context-engine.js.map +1 -1
- package/dist/src/context-orchestrator.d.ts +20 -2
- package/dist/src/context-orchestrator.d.ts.map +1 -1
- package/dist/src/context-orchestrator.js +11 -3
- package/dist/src/context-orchestrator.js.map +1 -1
- package/dist/src/context-tier-renderer.d.ts +8 -1
- package/dist/src/context-tier-renderer.d.ts.map +1 -1
- package/dist/src/context-tier-renderer.js +7 -2
- package/dist/src/context-tier-renderer.js.map +1 -1
- package/dist/src/ensure-initialized.d.ts +5 -0
- package/dist/src/ensure-initialized.d.ts.map +1 -1
- package/dist/src/ensure-initialized.js +19 -28
- package/dist/src/ensure-initialized.js.map +1 -1
- package/dist/src/fts-utils.d.ts +47 -0
- package/dist/src/fts-utils.d.ts.map +1 -0
- package/dist/src/fts-utils.js +65 -0
- package/dist/src/fts-utils.js.map +1 -0
- package/dist/src/host-integration/identity.d.ts +10 -0
- package/dist/src/host-integration/identity.d.ts.map +1 -0
- package/dist/src/host-integration/identity.js +66 -0
- package/dist/src/host-integration/identity.js.map +1 -0
- package/dist/src/host-integration/index.d.ts +5 -0
- package/dist/src/host-integration/index.d.ts.map +1 -0
- package/dist/src/host-integration/index.js +4 -0
- package/dist/src/host-integration/index.js.map +1 -0
- package/dist/src/host-integration/lifecycle.d.ts +14 -0
- package/dist/src/host-integration/lifecycle.d.ts.map +1 -0
- package/dist/src/host-integration/lifecycle.js +192 -0
- package/dist/src/host-integration/lifecycle.js.map +1 -0
- package/dist/src/host-integration/render.d.ts +5 -0
- package/dist/src/host-integration/render.d.ts.map +1 -0
- package/dist/src/host-integration/render.js +20 -0
- package/dist/src/host-integration/render.js.map +1 -0
- package/dist/src/host-integration/types.d.ts +107 -0
- package/dist/src/host-integration/types.d.ts.map +1 -0
- package/dist/src/host-integration/types.js +2 -0
- package/dist/src/host-integration/types.js.map +1 -0
- package/dist/src/imemory-system.d.ts +1 -1
- package/dist/src/imemory-system.d.ts.map +1 -1
- package/dist/src/index.d.ts +6 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/maintenance-service.d.ts +11 -0
- package/dist/src/maintenance-service.d.ts.map +1 -1
- package/dist/src/maintenance-service.js +43 -0
- package/dist/src/maintenance-service.js.map +1 -1
- package/dist/src/memory-index.d.ts +0 -16
- package/dist/src/memory-index.d.ts.map +1 -1
- package/dist/src/memory-index.js +1 -60
- package/dist/src/memory-index.js.map +1 -1
- package/dist/src/memory-manager.d.ts +6 -2
- package/dist/src/memory-manager.d.ts.map +1 -1
- package/dist/src/memory-manager.js +9 -5
- package/dist/src/memory-manager.js.map +1 -1
- package/dist/src/message-store.d.ts +15 -3
- package/dist/src/message-store.d.ts.map +1 -1
- package/dist/src/message-store.js +28 -9
- package/dist/src/message-store.js.map +1 -1
- package/dist/src/openclaw-plugin/index.d.ts.map +1 -1
- package/dist/src/openclaw-plugin/index.js +3 -2
- package/dist/src/openclaw-plugin/index.js.map +1 -1
- package/dist/src/pi-plugin/abtars-client.d.ts +22 -0
- package/dist/src/pi-plugin/abtars-client.d.ts.map +1 -0
- package/dist/src/pi-plugin/abtars-client.js +153 -0
- package/dist/src/pi-plugin/abtars-client.js.map +1 -0
- package/dist/src/pi-plugin/abtars-tools.d.ts +8 -0
- package/dist/src/pi-plugin/abtars-tools.d.ts.map +1 -0
- package/dist/src/pi-plugin/abtars-tools.js +317 -0
- package/dist/src/pi-plugin/abtars-tools.js.map +1 -0
- package/dist/src/pi-plugin/identity.d.ts +8 -0
- package/dist/src/pi-plugin/identity.d.ts.map +1 -0
- package/dist/src/pi-plugin/identity.js +37 -0
- package/dist/src/pi-plugin/identity.js.map +1 -0
- package/dist/src/pi-plugin/index.d.ts +3 -0
- package/dist/src/pi-plugin/index.d.ts.map +1 -0
- package/dist/src/pi-plugin/index.js +139 -0
- package/dist/src/pi-plugin/index.js.map +1 -0
- package/dist/src/pi-plugin/messages.d.ts +4 -0
- package/dist/src/pi-plugin/messages.d.ts.map +1 -0
- package/dist/src/pi-plugin/messages.js +36 -0
- package/dist/src/pi-plugin/messages.js.map +1 -0
- package/dist/src/pi-plugin/pi-types.d.ts +126 -0
- package/dist/src/pi-plugin/pi-types.d.ts.map +1 -0
- package/dist/src/pi-plugin/pi-types.js +15 -0
- package/dist/src/pi-plugin/pi-types.js.map +1 -0
- package/dist/src/pi-plugin/runtime.d.ts +21 -0
- package/dist/src/pi-plugin/runtime.d.ts.map +1 -0
- package/dist/src/pi-plugin/runtime.js +60 -0
- package/dist/src/pi-plugin/runtime.js.map +1 -0
- package/dist/src/pi-plugin/tools.d.ts +11 -0
- package/dist/src/pi-plugin/tools.d.ts.map +1 -0
- package/dist/src/pi-plugin/tools.js +136 -0
- package/dist/src/pi-plugin/tools.js.map +1 -0
- package/dist/src/recall-boosts.d.ts +15 -0
- package/dist/src/recall-boosts.d.ts.map +1 -0
- package/dist/src/recall-boosts.js +159 -0
- package/dist/src/recall-boosts.js.map +1 -0
- package/dist/src/recall-engine.d.ts +0 -2
- package/dist/src/recall-engine.d.ts.map +1 -1
- package/dist/src/recall-engine.js +1 -151
- package/dist/src/recall-engine.js.map +1 -1
- package/dist/src/reconcile.d.ts +2 -0
- package/dist/src/reconcile.d.ts.map +1 -1
- package/dist/src/reconcile.js +21 -4
- package/dist/src/reconcile.js.map +1 -1
- package/dist/src/session-context.d.ts +1 -0
- package/dist/src/session-context.d.ts.map +1 -1
- package/dist/src/session-context.js +42 -23
- package/dist/src/session-context.js.map +1 -1
- package/dist/src/sleep/audit.d.ts +6 -0
- package/dist/src/sleep/audit.d.ts.map +1 -1
- package/dist/src/sleep/audit.js +6 -8
- package/dist/src/sleep/audit.js.map +1 -1
- package/dist/src/sleep/basic.d.ts +1 -1
- package/dist/src/sleep/basic.d.ts.map +1 -1
- package/dist/src/sleep/basic.js +5 -2
- package/dist/src/sleep/basic.js.map +1 -1
- package/dist/src/sleep/catchup.d.ts +17 -0
- package/dist/src/sleep/catchup.d.ts.map +1 -0
- package/dist/src/sleep/catchup.js +141 -0
- package/dist/src/sleep/catchup.js.map +1 -0
- package/dist/src/sleep/contracts.d.ts +112 -0
- package/dist/src/sleep/contracts.d.ts.map +1 -0
- package/dist/src/sleep/contracts.js +25 -0
- package/dist/src/sleep/contracts.js.map +1 -0
- package/dist/src/sleep/llm-budget.d.ts +49 -0
- package/dist/src/sleep/llm-budget.d.ts.map +1 -0
- package/dist/src/sleep/llm-budget.js +106 -0
- package/dist/src/sleep/llm-budget.js.map +1 -0
- package/dist/src/sleep/locks.d.ts +9 -5
- package/dist/src/sleep/locks.d.ts.map +1 -1
- package/dist/src/sleep/locks.js +8 -11
- package/dist/src/sleep/locks.js.map +1 -1
- package/dist/src/sleep/orchestrator.d.ts +20 -86
- package/dist/src/sleep/orchestrator.d.ts.map +1 -1
- package/dist/src/sleep/orchestrator.js +291 -755
- package/dist/src/sleep/orchestrator.js.map +1 -1
- package/dist/src/sleep/state.d.ts +15 -18
- package/dist/src/sleep/state.d.ts.map +1 -1
- package/dist/src/sleep/state.js +24 -19
- package/dist/src/sleep/state.js.map +1 -1
- package/dist/src/sleep/test-harness.d.ts +3 -1
- package/dist/src/sleep/test-harness.d.ts.map +1 -1
- package/dist/src/sleep/test-harness.js +3 -2
- package/dist/src/sleep/test-harness.js.map +1 -1
- package/dist/src/soul-seeder.d.ts +36 -0
- package/dist/src/soul-seeder.d.ts.map +1 -0
- package/dist/src/soul-seeder.js +69 -0
- package/dist/src/soul-seeder.js.map +1 -0
- package/dist/src/wake-up-builder.d.ts +3 -1
- package/dist/src/wake-up-builder.d.ts.map +1 -1
- package/dist/src/wake-up-builder.js +29 -5
- package/dist/src/wake-up-builder.js.map +1 -1
- package/package.json +20 -2
|
@@ -1,101 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* abmind sleep orchestrator —
|
|
3
|
+
* abmind sleep orchestrator — host-neutral memory-maintenance engine (#1353).
|
|
4
4
|
*
|
|
5
|
-
* Called via runSleepCycle(
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Called via runSleepCycle(options). Gathers system state, runs through a
|
|
6
|
+
* pipeline of prompt-driven steps (gc-noise, daily-summary, extract-memories,
|
|
7
|
+
* retrospective, retro-derive, etc.), persists audit log, returns a structured
|
|
8
|
+
* SleepRunResult.
|
|
9
|
+
*
|
|
10
|
+
* abmind owns: step ordering, shared variables/outputs, wired memory
|
|
11
|
+
* maintenance, essential-step/continuation rules, LLM-call budget, durable
|
|
12
|
+
* checkpoints/resume/catch-up/watermark, and the final domain result.
|
|
13
|
+
*
|
|
14
|
+
* The embedding host owns: scheduling, admission, model/provider transport,
|
|
15
|
+
* agent/session lifecycle, cancellation on shutdown, and delivery. The host
|
|
16
|
+
* never reads sleep_*.lock — SleepRunResult is the only supported way to
|
|
17
|
+
* learn what happened.
|
|
8
18
|
*
|
|
9
19
|
* Library-only — no CLI entry point here. Standalone entry lives in
|
|
10
20
|
* cli/abmind-sleep.ts.
|
|
11
|
-
*
|
|
12
|
-
* Flags (passed via RunOpts.flags):
|
|
13
|
-
* --dry-run Gather state + build prompts, print to stdout, skip LLM calls
|
|
14
|
-
* --verbose Detailed logging at each orchestration step
|
|
15
|
-
* --force Run housekeeping even if no messages since last sleep
|
|
16
21
|
*/
|
|
17
|
-
import {
|
|
18
|
-
import type { SleepRuntime } from "./runtime.js";
|
|
19
|
-
import { type Level } from "./levels.js";
|
|
22
|
+
import type { SleepRunOptions, SleepRunResult } from "./contracts.js";
|
|
20
23
|
/** Steps whose failure blocks watermark advance. Public so tests can derive reject targets. */
|
|
21
|
-
export
|
|
24
|
+
export { ESSENTIAL_STEPS } from "./catchup.js";
|
|
22
25
|
/** Thrown by runSleepCycle when memory layer fails to initialize. */
|
|
23
26
|
export declare class SleepInitError extends Error {
|
|
24
27
|
constructor(message: string);
|
|
25
28
|
}
|
|
26
|
-
/** Thrown by runSleepCycle when the wall-clock timeout expires before completion. */
|
|
27
|
-
export declare class SleepTimeoutError extends Error {
|
|
28
|
-
constructor(message: string);
|
|
29
|
-
}
|
|
30
|
-
/** Step-lifecycle event fired by the orchestrator at each step boundary (#895).
|
|
31
|
-
* Best-effort — a throwing handler must never break memory consolidation. */
|
|
32
|
-
export interface SleepStepEvent {
|
|
33
|
-
/** Step name, e.g. "extract-memories". */
|
|
34
|
-
name: string;
|
|
35
|
-
/** Source filename, e.g. "03-extract-memories.md". */
|
|
36
|
-
filename: string;
|
|
37
|
-
/** 1-based step index within the run. */
|
|
38
|
-
index: number;
|
|
39
|
-
/** Total steps in this run (loaded from loadSleepSteps() at cycle start). */
|
|
40
|
-
total: number;
|
|
41
|
-
/** "start" fired before the step runs, "done"/"skipped"/"failed" on resolution. */
|
|
42
|
-
phase: "start" | "done" | "skipped" | "failed";
|
|
43
|
-
}
|
|
44
|
-
/** Options for runSleepCycle. All optional — defaults preserve current main() behavior. */
|
|
45
|
-
export interface RunOpts {
|
|
46
|
-
flags?: RawArgs;
|
|
47
|
-
runtime: SleepRuntime;
|
|
48
|
-
/** Which prompt set to run. Defaults to SLEEP_QUALITY env or "normal". */
|
|
49
|
-
level?: Level;
|
|
50
|
-
/** Discard prior state and start with a clean budget. Used by /sleep now. */
|
|
51
|
-
fresh?: boolean;
|
|
52
|
-
/** Inject a deterministic clock for decision sites (today/weekday/startedAt). Observations use real Date.now. */
|
|
53
|
-
now?: () => number;
|
|
54
|
-
/** Override the wall-clock timeout in ms. Default from SLEEP_TIMEOUT_MIN env. */
|
|
55
|
-
timeoutMs?: number;
|
|
56
|
-
/** Override inter-step backoff. Default: [10,30,60]s on consecutive failures. Tests: () => 0. */
|
|
57
|
-
backoffMs?: (consecutiveFailures: number) => number;
|
|
58
|
-
/** Override intra-step retry delay in ms. Default: 6000. Tests: 0. */
|
|
59
|
-
retryDelayMs?: number;
|
|
60
|
-
/** Override transport-failure backoff per attempt (ms). Default: capped exp (30s/60s/120s). Tests: () => 0. */
|
|
61
|
-
transportBackoffMs?: (attempt: number) => number;
|
|
62
|
-
/** Override transport-failure retry window (ms). Default: 8 minutes. Tests: small value. */
|
|
63
|
-
transportRetryWindowMs?: number;
|
|
64
|
-
/** Override memory config (temp dirs in tests). */
|
|
65
|
-
memoryConfigOverride?: Partial<import("../memory-config.js").MemoryConfig>;
|
|
66
|
-
/** Step-lifecycle hook (#895) — fired at each step boundary.
|
|
67
|
-
* Display-only: a throwing handler never breaks the cycle. */
|
|
68
|
-
onStep?: (e: SleepStepEvent) => void;
|
|
69
|
-
/** Hook fired once at the start of a cycle (before any step runs).
|
|
70
|
-
* Used by hosts to create a stepped card, reset per-night state, etc. */
|
|
71
|
-
onCycleStart?: (e: {
|
|
72
|
-
totalSteps: number;
|
|
73
|
-
}) => void;
|
|
74
|
-
}
|
|
75
|
-
/** Result of runSleepCycle — thrown errors handled separately. */
|
|
76
|
-
export interface RunResult {
|
|
77
|
-
ok: boolean;
|
|
78
|
-
failCount: number;
|
|
79
|
-
}
|
|
80
|
-
export type RawArgs = {
|
|
81
|
-
dryRun: boolean;
|
|
82
|
-
verbose: boolean;
|
|
83
|
-
force: boolean;
|
|
84
|
-
};
|
|
85
|
-
export declare function parseArgs(argv: string[]): RawArgs;
|
|
86
|
-
/** Thrown by sendWithRetry when runtime.complete() throws on every attempt within the retry window.
|
|
87
|
-
* Extends LLMUnavailableError so buildDailySummary and extractFromDaily rethrow it naturally
|
|
88
|
-
* (those functions check instanceof LLMUnavailableError to propagate errors up). */
|
|
89
|
-
export declare class ModelUnavailableError extends LLMUnavailableError {
|
|
90
|
-
constructor(stepName: string);
|
|
91
|
-
}
|
|
92
29
|
/**
|
|
93
|
-
* Run the full sleep cycle
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* - Returns { ok, failCount } for observable outcomes
|
|
97
|
-
*
|
|
98
|
-
* Default args preserve current main() behavior exactly.
|
|
30
|
+
* Run the full sleep cycle against a host-injected runtime. Returns a
|
|
31
|
+
* structured SleepRunResult projected from the authoritative on-disk state —
|
|
32
|
+
* hosts never need to read the lock file themselves.
|
|
99
33
|
*/
|
|
100
|
-
export declare function runSleepCycle(
|
|
34
|
+
export declare function runSleepCycle(options: SleepRunOptions): Promise<SleepRunResult>;
|
|
101
35
|
//# sourceMappingURL=orchestrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/sleep/orchestrator.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"orchestrator.d.ts","sourceRoot":"","sources":["../../../src/sleep/orchestrator.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;GAmBG;AA2BH,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EAGf,MAAM,gBAAgB,CAAC;AAIxB,+FAA+F;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,qEAAqE;AACrE,qBAAa,cAAe,SAAQ,KAAK;gBAC3B,OAAO,EAAE,MAAM;CAC5B;AASD;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA4pBrF"}
|