@openclawbrain/openclaw 0.1.11 → 0.2.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/README.md CHANGED
@@ -5,10 +5,11 @@ OpenClaw integration helpers for promoted-pack compile consumption and normalize
5
5
  This is the default front door for first-time OpenClawBrain users.
6
6
 
7
7
  - Start here when you want one package to import from instead of guessing across the `@openclawbrain/*` split.
8
- - Install it with `npm install @openclawbrain/openclaw`.
9
- - Use the `openclawbrain` CLI for status and rollback; `openclawbrain-ops` stays available as a compatibility alias.
10
- - `npm exec openclawbrain -- --help` now works from the installed package surface, but the exact quickstart commands remain the clearest first attach path.
11
- - Use local `.release/*.tgz` tarballs only for maintainer repo-tip / release-validation fallback, not as the default outside-user front door.
8
+ - The stable front-door names are `@openclawbrain/openclaw` and `openclawbrain`.
9
+ - If you are validating this repo-tip checkout, prepare the checkout with `pnpm install --frozen-lockfile`, run `pnpm release:status`, then `pnpm release:pack`, then install the local `.release/*.tgz` tarballs.
10
+ - If you are intentionally consuming a later tagged and published wave, install it with `npm install @openclawbrain/openclaw`.
11
+ - Use the `openclawbrain` CLI for status, rollback, and narrow scanner scans; `openclawbrain-ops` stays available as a compatibility alias.
12
+ - `npm exec openclawbrain -- --help` works after either install path, but the exact quickstart commands remain the clearest first attach path.
12
13
 
13
14
  Use this package when OpenClaw needs the narrow supported operator bridge captured by `OPERATOR_API_CONTRACT_V1`:
14
15
 
@@ -142,16 +143,22 @@ Operator-facing CLI:
142
143
  ```bash
143
144
  pnpm exec openclawbrain status --activation-root /var/openclawbrain/activation --event-export /var/openclawbrain/exports/latest --teacher-snapshot /var/openclawbrain/runtime/teacher-snapshot.json
144
145
  pnpm exec openclawbrain rollback --activation-root /var/openclawbrain/activation --dry-run
146
+ pnpm exec openclawbrain scan --session ./fixtures/recorded-session-replay/sanitized-support-escalation.trace.json --root /tmp/openclawbrain-scan-session
147
+ pnpm exec openclawbrain scan --live /var/openclawbrain/exports/latest --workspace /var/openclawbrain/runtime/workspace.json --snapshot-out /var/openclawbrain/runtime/scan-live-snapshot.json
145
148
  ```
146
149
 
147
150
  - `openclawbrain-ops` remains available as the same CLI entrypoint if you already scripted against the older name
148
151
  - `bootstrapRuntimeAttach()` resolves the activation root, stamps the attach as a `current_profile` action, returns the canonical current-profile answer immediately, and includes copy-paste-ready next steps for the attached root that prefer the primary `openclawbrain` CLI while matching the current `npm`/`pnpm` invocation style when it is detectable; those hints now cover `status`, canonical `status --json`, and `rollback --dry-run`
152
+ - `resolveActivationRoot()` keeps the existing explicit-path and global fallback chain, and same-gateway hosts with multiple `~/.openclaw-*` homes can now pin resolution to one installed OpenClaw profile home via `openclawHome` or `OPENCLAW_HOME`
149
153
  - `formatBootstrapRuntimeAttachReport()` prints the shipped attach handoff as a current-profile action instead of dropping callers straight into lower-level proof fields
150
- - plain `status` is the human answer to “How's the brain?” for the current profile on that activation root; it now keeps principal backlog/downstream truth and active structural-graph evolution visible in the compact text summary, while `status --json` still emits the canonical `current_profile_brain_status.v1` answer from that same boundary
154
+ - plain `status` is the human answer to “How's the brain?” for the current profile on that activation root; it now keeps the principal backlog frontier (`learnedThrough -> newestPending`), live-vs-backfill passive-learning progress, explicit backlog warning states, structural-decision origin, and active structural-graph evolution visible in the compact text summary, while `status --json` still emits the canonical `current_profile_brain_status.v1` answer from that same boundary
155
+ - with `--teacher-snapshot`, that same human summary also keeps the learner `mode`, next lane, and exact scheduler `priority` bucket visible so operators can see live-first intake, principal-priority work, and passive backfill without pretending the canonical JSON object widened
151
156
  - `describeCurrentProfileBrainStatus()` freezes the current-profile `Host / Profile / Brain / Attachment` answer shape instead of widening to a second report payload
152
157
  - `rollback --dry-run` previews the exact `active <- previous` and `active -> candidate` move before you apply rollback for real
153
158
  - `--event-export` accepts either a runtime event-export bundle root or a normalized-export JSON payload
154
- - `--teacher-snapshot` accepts JSON from `teacherLoop.snapshot()` or `await teacherLoop.flush()` when you want the last duplicate/no-op reason plus learner bootstrapped/mode/next-lane backlog truth kept visible
159
+ - `--teacher-snapshot` accepts JSON from `teacherLoop.snapshot()` or `await teacherLoop.flush()` when you want the last duplicate/no-op reason plus learner bootstrapped/mode/next-lane/scheduler-priority truth kept visible
160
+ - `scan --session` is a checked-in proof-facing replay over a sanitized recorded-session trace; it reports the no-brain vs seed-pack vs learned-replay score spread and does not pretend to be the runtime hot path
161
+ - `scan --live` is a one-shot live-export scan over a real event-export payload plus explicit workspace metadata; it truthfully reports teacher/learner state for that export and does not pretend a background daemon is running
155
162
 
156
163
  Programmatic rollback is available too:
157
164
 
package/dist/src/cli.d.ts CHANGED
@@ -1,12 +1,96 @@
1
1
  #!/usr/bin/env node
2
+ import { type DaemonCliArgs } from "./daemon.js";
2
3
  import { type CurrentProfileBrainStatusInput } from "./index.js";
3
- interface ParsedOperatorCliArgs {
4
+ interface ParsedStatusRollbackCliArgs {
4
5
  command: "status" | "rollback";
5
6
  input: CurrentProfileBrainStatusInput;
6
7
  json: boolean;
7
8
  help: boolean;
8
9
  dryRun: boolean;
10
+ detailed: boolean;
9
11
  }
12
+ interface ParsedAttachCliArgs {
13
+ command: "attach";
14
+ activationRoot: string;
15
+ packRoot: string;
16
+ packLabel: string;
17
+ workspaceId: string;
18
+ brainAttachmentPolicy: CurrentProfileBrainStatusInput["brainAttachmentPolicy"];
19
+ json: boolean;
20
+ help: boolean;
21
+ }
22
+ interface ParsedSetupCliArgs {
23
+ command: "setup";
24
+ openclawHome: string;
25
+ activationRoot: string;
26
+ shared: boolean;
27
+ workspaceId: string;
28
+ json: boolean;
29
+ help: boolean;
30
+ }
31
+ interface ParsedScanCliArgs {
32
+ command: "scan";
33
+ json: boolean;
34
+ help: boolean;
35
+ sessionPath: string | null;
36
+ livePath: string | null;
37
+ rootDir: string | null;
38
+ workspacePath: string | null;
39
+ packLabel: string | null;
40
+ observedAt: string | null;
41
+ snapshotOutPath: string | null;
42
+ }
43
+ interface ParsedContextCliArgs {
44
+ command: "context";
45
+ message: string;
46
+ activationRoot: string;
47
+ json: boolean;
48
+ help: boolean;
49
+ }
50
+ interface ParsedHistoryCliArgs {
51
+ command: "history";
52
+ activationRoot: string;
53
+ limit: number;
54
+ json: boolean;
55
+ help: boolean;
56
+ }
57
+ interface ParsedLearnCliArgs {
58
+ command: "learn";
59
+ activationRoot: string;
60
+ json: boolean;
61
+ help: boolean;
62
+ }
63
+ interface ParsedWatchCliArgs {
64
+ command: "watch";
65
+ activationRoot: string;
66
+ scanRoot: string | null;
67
+ interval: number;
68
+ json: boolean;
69
+ help: boolean;
70
+ }
71
+ interface ParsedExportCliArgs {
72
+ command: "export";
73
+ activationRoot: string;
74
+ outputPath: string;
75
+ json: boolean;
76
+ help: boolean;
77
+ }
78
+ interface ParsedImportCliArgs {
79
+ command: "import";
80
+ archivePath: string;
81
+ activationRoot: string;
82
+ force: boolean;
83
+ json: boolean;
84
+ help: boolean;
85
+ }
86
+ interface ParsedResetCliArgs {
87
+ command: "reset";
88
+ activationRoot: string;
89
+ yes: boolean;
90
+ json: boolean;
91
+ help: boolean;
92
+ }
93
+ type ParsedOperatorCliArgs = ParsedStatusRollbackCliArgs | ParsedAttachCliArgs | ParsedScanCliArgs | ParsedSetupCliArgs | ParsedContextCliArgs | ParsedHistoryCliArgs | ParsedLearnCliArgs | ParsedWatchCliArgs | DaemonCliArgs | ParsedExportCliArgs | ParsedImportCliArgs | ParsedResetCliArgs;
10
94
  export declare function parseOperatorCliArgs(argv: readonly string[]): ParsedOperatorCliArgs;
11
95
  export declare function runOperatorCli(argv?: readonly string[]): number;
12
96
  export {};