@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.
@@ -1,4 +1,5 @@
1
- import { CONTRACT_IDS, type ArtifactManifestV1, type ActivationPointerRecordV1, type ActivationPointerSlot, type RuntimeTurnBrainAttachmentPolicyV1, type ContextCompactionMode, type ContextContributionEvidenceStateV1, type CurrentProfileBrainStatusAnswerV1, type FeedbackEventKind, type PackGraphEvolutionV1, type FeedbackEventV1, type KernelSurfaceValidationResultV1, type LearningBootProfile, type InteractionEventV1, type NormalizedEventExportV1, type NormalizedEventV1, type RouteMode, type RuntimeCompileResponseV1, type RuntimeCompileStructuralSignalsV1, type RuntimeCompileTargetV1, type RuntimeGraphPlasticityStateV1, type RuntimePlasticitySourceV1, type SparseFeedbackPolicyV1, type TeacherSupervisionArtifactV1, type WorkspaceInjectionSurfaceV1 } from "@openclawbrain/contracts";
1
+ import { CONTRACT_IDS, type ArtifactManifestV1, type ActivationPointerRecordV1, type ActivationPointerSlot, type RuntimeTurnBrainAttachmentPolicyV1, type ContextCompactionMode, type ContextContributionEvidenceStateV1, type CurrentProfileBrainStatusAnswerV1, type CurrentProfileStructuralDecisionV1, type FeedbackEventKind, type PackGraphEvolutionV1, type FeedbackEventV1, type KernelSurfaceValidationResultV1, type LearningBootProfile, type LearningScanPolicy, type InteractionEventV1, type NormalizedEventExportV1, type NormalizedEventV1, type PrincipalPriorityClassV1, type PrincipalRoleV1, type RouteMode, type RuntimeCompileResponseV1, type RuntimeCompileStructuralSignalsV1, type RuntimeCompileTargetV1, type RuntimeGraphPlasticityStateV1, type RuntimePlasticitySourceV1, type SparseFeedbackPolicyV1, type TeacherAuthorityV1, type TeacherSupervisionArtifactV1, type WorkspaceInjectionSurfaceV1 } from "@openclawbrain/contracts";
2
+ import { type EventExportLaneV1 } from "@openclawbrain/event-export";
2
3
  import { type AdvanceAlwaysOnLearningRuntimeInput, type AlwaysOnLearningCadenceV1, type AlwaysOnLearningMaterializationJobV1, type AlwaysOnLearningRuntimePlanV1, type AlwaysOnLearningRuntimeStateV1, type PendingPrincipalEventV1, type PrincipalLearningCheckpointV1 } from "@openclawbrain/learner";
3
4
  import { type ActivationInspection, type ActivationObservabilityReport, type GraphEvolutionLogV1, type ActivationSlotInspection, type InitHandoffState } from "@openclawbrain/pack-format";
4
5
  export declare const DEFAULT_ASYNC_TEACHER_QUEUE_CAPACITY = 8;
@@ -20,6 +21,38 @@ export interface RuntimeEventExportBundleSummaryV1 {
20
21
  sourceStreams: string[];
21
22
  contracts: NormalizedEventExportV1["provenance"]["contracts"];
22
23
  }
24
+ export type ScannerExportStatusV1 = "complete" | "partial" | "failed";
25
+ export interface ScannerExportManifestV1 {
26
+ scannerId: string;
27
+ lane: string;
28
+ status: ScannerExportStatusV1;
29
+ producedAt: string;
30
+ sourceManifestPath: string | null;
31
+ sourceManifestDigest: string | null;
32
+ warnings: string[];
33
+ failures: string[];
34
+ }
35
+ export interface ScannedEventExportInputV1 {
36
+ interactionEvents: readonly InteractionEventV1[];
37
+ feedbackEvents: readonly FeedbackEventV1[];
38
+ scanner: ScannerExportManifestV1;
39
+ }
40
+ export type ScannedEventExportNoopReasonV1 = "scan_failed" | "no_events" | "invalid_scanner_manifest";
41
+ export interface ScannedEventExportBuildSuccessV1 {
42
+ ok: true;
43
+ normalizedEventExport: NormalizedEventExportV1;
44
+ scanner: ScannerExportManifestV1;
45
+ warnings: string[];
46
+ }
47
+ export interface ScannedEventExportBuildFailureV1 {
48
+ ok: false;
49
+ normalizedEventExport: null;
50
+ scanner: ScannerExportManifestV1;
51
+ warnings: string[];
52
+ reason: ScannedEventExportNoopReasonV1;
53
+ error: string;
54
+ }
55
+ export type ScannedEventExportBuildResultV1 = ScannedEventExportBuildSuccessV1 | ScannedEventExportBuildFailureV1;
23
56
  export interface RuntimeEventExportBundleManifestV1 {
24
57
  contract: typeof RUNTIME_EVENT_EXPORT_BUNDLE_CONTRACT;
25
58
  exportName: string;
@@ -27,6 +60,7 @@ export interface RuntimeEventExportBundleManifestV1 {
27
60
  payloadPath: string;
28
61
  payloadDigest: string;
29
62
  summary: RuntimeEventExportBundleSummaryV1;
63
+ scanner?: ScannerExportManifestV1 | null;
30
64
  }
31
65
  export interface RuntimeEventExportBundleDescriptor {
32
66
  rootDir: string;
@@ -187,7 +221,9 @@ export interface RollbackRuntimeAttachResult {
187
221
  parkedCandidatePackId: string | null;
188
222
  }
189
223
  export interface BootstrapRuntimeAttachInput {
190
- profileSelector?: "current_profile";
224
+ profileSelector?: string | null;
225
+ profileId?: string | null;
226
+ brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
191
227
  activationRoot: string;
192
228
  packRoot: string;
193
229
  packLabel: string;
@@ -210,7 +246,8 @@ export interface BootstrapRuntimeAttachNextStepV1 {
210
246
  }
211
247
  export interface BootstrapRuntimeAttachResult {
212
248
  runtimeOwner: "openclaw";
213
- profileSelector: "current_profile";
249
+ profileSelector: string;
250
+ operatorReadScope: "current_profile_only";
214
251
  activationRoot: string;
215
252
  packRoot: string;
216
253
  packId: string;
@@ -239,17 +276,28 @@ export interface RuntimeTurnFeedbackInput {
239
276
  kind?: FeedbackEventKind | null;
240
277
  messageId?: string | null;
241
278
  relatedInteractionId?: string | null;
279
+ actorName?: string | null;
280
+ priorityHint?: PrincipalPriorityClassV1 | null;
242
281
  }
243
282
  export interface RuntimeTurnExportInput {
244
283
  rootDir: string;
245
284
  exportName?: string | null;
246
285
  exportedAt?: string | null;
247
286
  }
287
+ export interface RuntimeTurnContextFingerprintInputV1 {
288
+ promptContextFingerprints?: readonly string[] | null;
289
+ workspaceInjectionSurface?: WorkspaceInjectionSurfaceV1 | null;
290
+ profileLineage?: readonly string[] | null;
291
+ sessionLineage?: readonly string[] | null;
292
+ }
248
293
  export interface OpenClawRuntimeTurnInput {
249
294
  activationRoot?: string | null;
250
295
  agentId?: string | null;
296
+ profileSelector?: string | null;
297
+ profileId?: string | null;
251
298
  sessionId: string;
252
299
  channel: string;
300
+ userId?: string | null;
253
301
  sourceStream?: string | null;
254
302
  userMessage: string;
255
303
  createdAt?: string | null;
@@ -259,6 +307,7 @@ export interface OpenClawRuntimeTurnInput {
259
307
  mode?: RouteMode;
260
308
  runtimeHints?: readonly string[];
261
309
  brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
310
+ contextFingerprint?: RuntimeTurnContextFingerprintInputV1 | null;
262
311
  compile?: RuntimeTurnCompileInput | null;
263
312
  delivery?: boolean | RuntimeTurnDeliveryInput | null;
264
313
  feedback?: readonly (RuntimeTurnFeedbackInput | null)[] | null;
@@ -292,7 +341,7 @@ export type RuntimeTurnResult = RuntimeCompileResult & {
292
341
  eventExport: RuntimeEventExportResult;
293
342
  warnings: string[];
294
343
  };
295
- export type TeacherLoopNoOpReason = "none" | "duplicate_export" | "queue_full" | "no_teacher_artifacts";
344
+ export type TeacherLoopNoOpReason = "none" | "duplicate_export" | "queue_full" | "no_teacher_artifacts" | "empty_scan";
296
345
  export interface AsyncTeacherLiveLoopInput extends Pick<AdvanceAlwaysOnLearningRuntimeInput, "packLabel" | "workspace" | "learnedRouting" | "builtAt" | "offlineArtifacts" | "structuralOps" | "sparseFeedback" | "liveSliceSize" | "backfillSliceSize" | "cadence"> {
297
346
  maxQueuedExports?: number;
298
347
  staleAfterMs?: number;
@@ -340,6 +389,45 @@ export interface AsyncTeacherEnqueueResultV1 {
340
389
  notes: string[];
341
390
  reason: Exclude<TeacherLoopNoOpReason, "none"> | null;
342
391
  }
392
+ export interface AsyncTeacherScannedEnqueueResultV1 {
393
+ accepted: boolean;
394
+ exportDigest: string | null;
395
+ queueDepth: number;
396
+ notes: string[];
397
+ reason: Exclude<TeacherLoopNoOpReason, "none"> | ScannedEventExportNoopReasonV1 | null;
398
+ warnings: string[];
399
+ error: string | null;
400
+ scanner: ScannerExportManifestV1;
401
+ }
402
+ export type AsyncTeacherScannerScanNoOpReasonV1 = "none" | "empty_scan" | "duplicate_exports" | "queue_full";
403
+ export interface AsyncTeacherScannerScanHitResultV1 {
404
+ lane: EventExportLaneV1;
405
+ exportDigest: string;
406
+ exportName: string;
407
+ exportedAt: string;
408
+ eventRange: Pick<NormalizedEventExportV1["range"], "start" | "end" | "count">;
409
+ accepted: boolean;
410
+ queueDepth: number;
411
+ reason: AsyncTeacherEnqueueResultV1["reason"];
412
+ }
413
+ export interface AsyncTeacherScannerScanResultV1 {
414
+ runtimeOwner: "openclaw";
415
+ scanRoot: string;
416
+ scannedAt: string;
417
+ selectedCount: number;
418
+ acceptedCount: number;
419
+ duplicateCount: number;
420
+ droppedCount: number;
421
+ liveAcceptedCount: number;
422
+ backfillAcceptedCount: number;
423
+ duplicateScannerDigestCount: number;
424
+ staleSkippedCount: number;
425
+ invalidBundleCount: number;
426
+ noOpReason: AsyncTeacherScannerScanNoOpReasonV1;
427
+ notes: string[];
428
+ results: AsyncTeacherScannerScanHitResultV1[];
429
+ snapshot: AsyncTeacherLiveLoopSnapshotV1;
430
+ }
343
431
  export interface CanonicalSupervisionFeedbackRecordV1 {
344
432
  eventId: string;
345
433
  kind: FeedbackEventKind;
@@ -462,6 +550,10 @@ export declare class AsyncTeacherLiveLoop {
462
550
  enqueueNormalizedEventExport(normalizedEventExport: NormalizedEventExportV1, options?: {
463
551
  observedAt?: string;
464
552
  }): AsyncTeacherEnqueueResultV1;
553
+ enqueueScannedEventExport(scannedEventExport: ScannedEventExportInputV1, options?: {
554
+ observedAt?: string;
555
+ }): AsyncTeacherScannedEnqueueResultV1;
556
+ ingestRuntimeEventExportScannerScan(scan: RuntimeEventExportScannerScanResultV1): Promise<AsyncTeacherScannerScanResultV1>;
465
557
  flush(): Promise<AsyncTeacherLiveLoopSnapshotV1>;
466
558
  snapshot(): AsyncTeacherLiveLoopSnapshotV1;
467
559
  private ensureDrain;
@@ -469,14 +561,209 @@ export declare class AsyncTeacherLiveLoop {
469
561
  private refreshNotes;
470
562
  }
471
563
  export declare function createAsyncTeacherLiveLoop(input: AsyncTeacherLiveLoopInput): AsyncTeacherLiveLoop;
564
+ export interface ScannerLiveWorkspaceInputV1 {
565
+ workspaceId: string;
566
+ snapshotId: string;
567
+ capturedAt: string;
568
+ rootDir: string;
569
+ branch?: string | null;
570
+ revision?: string | null;
571
+ dirty?: boolean;
572
+ manifestDigest?: string | null;
573
+ labels?: readonly string[];
574
+ files?: readonly string[];
575
+ }
576
+ export interface ScanRecordedSessionInputV1 {
577
+ rootDir: string;
578
+ trace: RecordedSessionTraceV1;
579
+ }
580
+ export interface ScanRecordedSessionResultV1 {
581
+ runtimeOwner: "openclaw";
582
+ scanMode: "session";
583
+ rootDir: string;
584
+ fixtureHash: string;
585
+ bundle: RecordedSessionReplayBundleV1;
586
+ }
587
+ export interface ScanLiveEventExportInputV1 {
588
+ normalizedEventExport: NormalizedEventExportV1;
589
+ workspace: ScannerLiveWorkspaceInputV1;
590
+ packLabel?: string | null;
591
+ observedAt?: string | null;
592
+ builtAt?: string | null;
593
+ learnedRouting?: boolean;
594
+ staleAfterMs?: number;
595
+ liveSliceSize?: number;
596
+ backfillSliceSize?: number;
597
+ }
598
+ export interface ScanLiveEventExportResultV1 {
599
+ runtimeOwner: "openclaw";
600
+ scanMode: "live";
601
+ observedAt: string;
602
+ packLabel: string;
603
+ supervision: CanonicalSupervisionV1;
604
+ snapshot: AsyncTeacherLiveLoopSnapshotV1;
605
+ }
606
+ export declare function scanRecordedSession(input: ScanRecordedSessionInputV1): ScanRecordedSessionResultV1;
607
+ export declare function scanLiveEventExport(input: ScanLiveEventExportInputV1): ScanLiveEventExportResultV1;
472
608
  export declare function buildRuntimeEventExportBundleManifest(input: {
473
609
  exportName: string;
474
610
  exportedAt: string;
475
611
  payloadPath: string;
476
612
  normalizedEventExport: NormalizedEventExportV1;
613
+ scanner?: ScannerExportManifestV1 | null;
477
614
  }): RuntimeEventExportBundleManifestV1;
478
615
  export declare function validateRuntimeEventExportBundleManifest(value: RuntimeEventExportBundleManifestV1, normalizedEventExport?: NormalizedEventExportV1): string[];
479
616
  export declare function loadRuntimeEventExportBundle(rootDir: string): RuntimeEventExportBundleDescriptor;
617
+ export declare function buildNormalizedEventExportFromScannedEvents(input: ScannedEventExportInputV1): ScannedEventExportBuildResultV1;
618
+ declare const RUNTIME_EVENT_EXPORT_SCANNER_CHECKPOINT_CONTRACT: "runtime_event_export_scanner_checkpoint.v1";
619
+ export declare const DEFAULT_RUNTIME_EVENT_EXPORT_SCANNER_LIVE_TAIL_BUNDLES = 2;
620
+ export declare const DEFAULT_RUNTIME_EVENT_EXPORT_SCANNER_BACKFILL_BUNDLES_PER_PASS = 1;
621
+ export declare const DEFAULT_RUNTIME_EVENT_EXPORT_SCANNER_STALE_HISTORY_MS: number;
622
+ export declare const DEFAULT_RUNTIME_EVENT_EXPORT_SCANNER_CHECKPOINT_BASENAME = ".openclawbrain-scanner-checkpoint.json";
623
+ export interface RuntimeEventExportScannerBundleCursorV1 {
624
+ exportDigest: string;
625
+ exportName: string;
626
+ exportedAt: string;
627
+ eventRange: Pick<NormalizedEventExportV1["range"], "start" | "end" | "count">;
628
+ }
629
+ export interface RuntimeEventExportScannerCheckpointV1 {
630
+ contract: typeof RUNTIME_EVENT_EXPORT_SCANNER_CHECKPOINT_CONTRACT;
631
+ runtimeOwner: "openclaw";
632
+ scanRoot: string;
633
+ updatedAt: string;
634
+ live: {
635
+ after: RuntimeEventExportScannerBundleCursorV1 | null;
636
+ };
637
+ backfill: {
638
+ before: RuntimeEventExportScannerBundleCursorV1 | null;
639
+ exhausted: boolean;
640
+ staleBefore: string | null;
641
+ };
642
+ processedExportDigests: string[];
643
+ stats: {
644
+ scanPasses: number;
645
+ liveBundlesScanned: number;
646
+ backfillBundlesScanned: number;
647
+ duplicateBundlesSkipped: number;
648
+ staleBundlesSkipped: number;
649
+ invalidBundlesSkipped: number;
650
+ };
651
+ }
652
+ export interface RuntimeEventExportScannerInput {
653
+ scanRoot: string;
654
+ checkpointPath?: string;
655
+ liveTailBundles?: number;
656
+ backfillBundlesPerPass?: number;
657
+ staleHistoryMs?: number;
658
+ }
659
+ export interface RuntimeEventExportScannerInvalidBundleV1 {
660
+ rootDir: string;
661
+ error: string;
662
+ }
663
+ export type RuntimeEventExportScannerPriorityBucketV1 = "live" | "principal_backfill" | "backfill" | "stale_history";
664
+ export interface RuntimeEventExportScannerQueueEntryV1 {
665
+ lane: EventExportLaneV1;
666
+ rootDir: string;
667
+ exportDigest: string;
668
+ exportName: string;
669
+ exportedAt: string;
670
+ eventRange: Pick<NormalizedEventExportV1["range"], "start" | "end" | "count">;
671
+ priorityBucket: RuntimeEventExportScannerPriorityBucketV1;
672
+ priorityScore: number;
673
+ priorityReasons: string[];
674
+ humanLabelCount: number;
675
+ feedbackCount: number;
676
+ teacherRoles: PrincipalRoleV1[];
677
+ teacherAuthorities: TeacherAuthorityV1[];
678
+ priorityClasses: PrincipalPriorityClassV1[];
679
+ scopedPrincipalEventCount: number;
680
+ supersedingPrincipalEventCount: number;
681
+ staleHistory: boolean;
682
+ ageMsFromLatest: number | null;
683
+ }
684
+ export interface RuntimeEventExportScannerHitV1 {
685
+ lane: EventExportLaneV1;
686
+ rootDir: string;
687
+ exportDigest: string;
688
+ exportName: string;
689
+ exportedAt: string;
690
+ eventRange: Pick<NormalizedEventExportV1["range"], "start" | "end" | "count">;
691
+ priorityBucket: RuntimeEventExportScannerPriorityBucketV1;
692
+ priorityScore: number;
693
+ priorityReasons: string[];
694
+ humanLabelCount: number;
695
+ feedbackCount: number;
696
+ teacherRoles: PrincipalRoleV1[];
697
+ teacherAuthorities: TeacherAuthorityV1[];
698
+ priorityClasses: PrincipalPriorityClassV1[];
699
+ scopedPrincipalEventCount: number;
700
+ supersedingPrincipalEventCount: number;
701
+ staleHistory: boolean;
702
+ ageMsFromLatest: number | null;
703
+ normalizedEventExport: NormalizedEventExportV1;
704
+ }
705
+ export interface RuntimeEventExportScannerQueueV1 {
706
+ ageFloor: {
707
+ newestExportedAt: string | null;
708
+ staleBefore: string | null;
709
+ staleHistoryMs: number;
710
+ };
711
+ live: RuntimeEventExportScannerQueueEntryV1[];
712
+ backfill: RuntimeEventExportScannerQueueEntryV1[];
713
+ staleHistory: RuntimeEventExportScannerQueueEntryV1[];
714
+ }
715
+ export interface RuntimeEventExportScannerScanResultV1 {
716
+ runtimeOwner: "openclaw";
717
+ scanRoot: string;
718
+ checkpointPath: string;
719
+ scannedAt: string;
720
+ live: RuntimeEventExportScannerHitV1[];
721
+ backfill: RuntimeEventExportScannerHitV1[];
722
+ selected: RuntimeEventExportScannerHitV1[];
723
+ queue: RuntimeEventExportScannerQueueV1;
724
+ duplicateExportDigests: string[];
725
+ staleSkippedExportDigests: string[];
726
+ invalidBundles: RuntimeEventExportScannerInvalidBundleV1[];
727
+ idle: boolean;
728
+ checkpoint: RuntimeEventExportScannerCheckpointV1;
729
+ }
730
+ export interface RuntimeEventExportScannerLoopOptionsV1 {
731
+ pollIntervalMs?: number;
732
+ maxPasses?: number;
733
+ stopWhenIdle?: boolean;
734
+ signal?: AbortSignal;
735
+ onPass?: (result: RuntimeEventExportScannerScanResultV1) => void | Promise<void>;
736
+ }
737
+ export interface RuntimeEventExportScannerLoopResultV1 {
738
+ runtimeOwner: "openclaw";
739
+ passCount: number;
740
+ liveBundlesScanned: number;
741
+ backfillBundlesScanned: number;
742
+ stoppedReason: "idle" | "max_passes" | "aborted";
743
+ lastScan: RuntimeEventExportScannerScanResultV1 | null;
744
+ checkpoint: RuntimeEventExportScannerCheckpointV1;
745
+ }
746
+ export declare function createRuntimeEventExportScannerCheckpoint(input: {
747
+ scanRoot: string;
748
+ updatedAt?: string;
749
+ }): RuntimeEventExportScannerCheckpointV1;
750
+ export declare function validateRuntimeEventExportScannerCheckpoint(value: RuntimeEventExportScannerCheckpointV1): string[];
751
+ export declare function loadRuntimeEventExportScannerCheckpoint(checkpointPath: string): RuntimeEventExportScannerCheckpointV1;
752
+ export declare class RuntimeEventExportScanner {
753
+ readonly scanRoot: string;
754
+ readonly checkpointPath: string;
755
+ readonly liveTailBundles: number;
756
+ readonly backfillBundlesPerPass: number;
757
+ readonly staleHistoryMs: number;
758
+ private checkpoint;
759
+ constructor(input: RuntimeEventExportScannerInput);
760
+ snapshot(): RuntimeEventExportScannerCheckpointV1;
761
+ scanOnce(options?: {
762
+ scannedAt?: string;
763
+ }): RuntimeEventExportScannerScanResultV1;
764
+ runLoop(options?: RuntimeEventExportScannerLoopOptionsV1): Promise<RuntimeEventExportScannerLoopResultV1>;
765
+ }
766
+ export declare function createRuntimeEventExportScanner(input: RuntimeEventExportScannerInput): RuntimeEventExportScanner;
480
767
  export declare function classifyFeedbackKind(content: string): FeedbackEventKind;
481
768
  export declare function formatPromptContext(compileResponse: RuntimeCompileResponseV1): string;
482
769
  export interface EmpiricalStructuralBudgetEvidenceV1 {
@@ -522,7 +809,15 @@ export declare function describeAttachStatus(input: AttachStatusInput): AttachSt
522
809
  export declare function rollbackRuntimeAttach(input: RollbackRuntimeAttachInput): RollbackRuntimeAttachResult;
523
810
  export declare function bootstrapRuntimeAttach(input: BootstrapRuntimeAttachInput): BootstrapRuntimeAttachResult;
524
811
  export declare function buildNormalizedRuntimeEventExport(turn: OpenClawRuntimeTurnInput, compileResult: RuntimeCompileResult): NormalizedEventExportV1;
812
+ export interface WriteScannedEventExportBundleInputV1 {
813
+ rootDir: string;
814
+ exportName?: string | null;
815
+ exportedAt?: string | null;
816
+ scannedEventExport: ScannedEventExportInputV1;
817
+ }
818
+ export type WriteScannedEventExportBundleResultV1 = RuntimeEventExportWriteSuccess | ScannedEventExportBuildFailureV1;
525
819
  export declare function writeRuntimeEventExportBundle(turn: OpenClawRuntimeTurnInput, normalizedEventExport: NormalizedEventExportV1): RuntimeEventExportNoWrite | RuntimeEventExportWriteSuccess;
820
+ export declare function writeScannedEventExportBundle(input: WriteScannedEventExportBundleInputV1): WriteScannedEventExportBundleResultV1;
526
821
  export declare function runRuntimeTurn(turn: OpenClawRuntimeTurnInput, options?: RunRuntimeTurnOptions): RuntimeTurnResult;
527
822
  export declare function runContinuousProductLoopTurn(input: RunContinuousProductLoopTurnInput): ContinuousProductLoopTurnResultV1;
528
823
  export type RecordedSessionReplayMode = "no_brain" | "seed_pack" | "learned_replay";
@@ -616,6 +911,34 @@ export interface RecordedSessionReplayTurnReportV1 {
616
911
  qualityScore: number;
617
912
  compileActiveVersion: number | null;
618
913
  promoted: boolean;
914
+ observability: {
915
+ scanPolicy: LearningScanPolicy | null;
916
+ scanSurfaces: string[];
917
+ humanLabelCount: number;
918
+ selfLabelCount: number;
919
+ totalEventCount: number;
920
+ attributedEventCount: number;
921
+ selectionDigestCount: number;
922
+ freshestSourceStream: string | null;
923
+ freshestCreatedAt: string | null;
924
+ };
925
+ warnings: string[];
926
+ }
927
+ export interface RecordedSessionReplayScannerEvidenceV1 {
928
+ exportTurnCount: number;
929
+ scanPolicy: LearningScanPolicy | null;
930
+ scanSurfaceCount: number;
931
+ scanSurfaces: string[];
932
+ humanLabelCount: number;
933
+ selfLabelCount: number;
934
+ totalEventCount: number;
935
+ attributedEventCount: number;
936
+ attributedTurnCount: number;
937
+ selectionDigestCount: number;
938
+ selectionDigestTurnCount: number;
939
+ activePackChangeCount: number;
940
+ freshestSourceStream: string | null;
941
+ freshestCreatedAt: string | null;
619
942
  warnings: string[];
620
943
  }
621
944
  export interface RecordedSessionReplayModeSummaryV1 {
@@ -627,6 +950,7 @@ export interface RecordedSessionReplayModeSummaryV1 {
627
950
  usedLearnedRouteTurnCount: number;
628
951
  promotionCount: number;
629
952
  packIds: string[];
953
+ scannerEvidence: RecordedSessionReplayScannerEvidenceV1;
630
954
  scoreHash: string;
631
955
  }
632
956
  export interface RecordedSessionReplayModeReportV1 {
@@ -785,6 +1109,7 @@ export interface OperatorSurfaceInput {
785
1109
  updatedAt?: string | null;
786
1110
  eventExportPath?: string | null;
787
1111
  teacherSnapshotPath?: string | null;
1112
+ brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
788
1113
  }
789
1114
  export interface OperatorSurfaceSlotSummary {
790
1115
  slot: ActivationPointerSlot;
@@ -846,6 +1171,7 @@ export interface OperatorServePathSummary {
846
1171
  structuralBudgetSource: string | null;
847
1172
  structuralBudgetEvidence: string | null;
848
1173
  structuralBudgetPressures: string | null;
1174
+ structuralDecision: CurrentProfileStructuralDecisionV1;
849
1175
  contextAttribution: ContextAttributionSummaryV1;
850
1176
  error: string | null;
851
1177
  }
@@ -862,11 +1188,18 @@ export interface OperatorSupervisionSummary {
862
1188
  exportDigest: string | null;
863
1189
  exportedAt: string | null;
864
1190
  flowing: boolean | null;
1191
+ scanPolicy: LearningScanPolicy | null;
1192
+ scanSurfaceCount: number;
1193
+ scanSurfaces: string[];
865
1194
  sourceCount: number;
866
1195
  freshestSourceStream: string | null;
867
1196
  freshestCreatedAt: string | null;
868
1197
  freshestKind: string | null;
869
1198
  humanLabelCount: number | null;
1199
+ selfLabelCount: number | null;
1200
+ attributedEventCount: number | null;
1201
+ totalEventCount: number | null;
1202
+ selectionDigestCount: number | null;
870
1203
  sources: string[];
871
1204
  detail: string;
872
1205
  }
@@ -883,19 +1216,26 @@ export interface OperatorTeacherLoopSummary {
883
1216
  notes: string[];
884
1217
  detail: string;
885
1218
  }
1219
+ export type OperatorLearningBacklogState = "unavailable" | "awaiting_first_export" | "principal_live_priority" | "principal_backfill_priority" | "live_priority" | "backfill_only" | "caught_up";
1220
+ export type OperatorLearningWarningState = "teacher_snapshot_unavailable" | "awaiting_first_export" | "principal_live_backlog" | "principal_backfill_pending" | "active_pack_behind_latest_principal" | "passive_backfill_pending" | "teacher_queue_full" | "teacher_labels_stale" | "teacher_no_artifacts";
886
1221
  export interface OperatorLearningSummary {
887
1222
  available: boolean;
888
1223
  sourcePath: string | null;
889
1224
  bootstrapped: boolean | null;
890
1225
  mode: AlwaysOnLearningRuntimePlanV1["mode"] | "unavailable";
891
1226
  nextPriorityLane: AlwaysOnLearningRuntimePlanV1["nextPriorityLane"] | "unavailable";
1227
+ nextPriorityBucket: AlwaysOnLearningRuntimePlanV1["nextPriorityBucket"] | "unavailable";
1228
+ backlogState: OperatorLearningBacklogState;
892
1229
  pendingLive: number | null;
893
1230
  pendingBackfill: number | null;
894
1231
  pendingTotal: number | null;
1232
+ pendingByBucket: AlwaysOnLearningRuntimePlanV1["pending"]["byBucket"] | null;
895
1233
  freshLivePriority: boolean | null;
896
1234
  principalCheckpointCount: number | null;
897
1235
  pendingPrincipalCount: number | null;
898
1236
  oldestUnlearnedPrincipalEvent: PendingPrincipalEventV1 | null;
1237
+ newestPendingPrincipalEvent: PendingPrincipalEventV1 | null;
1238
+ leadingPrincipalCheckpoint: PrincipalLearningCheckpointV1 | null;
899
1239
  principalCheckpoints: PrincipalLearningCheckpointV1[];
900
1240
  principalLagToPromotion: {
901
1241
  activeEventRangeEnd: number | null;
@@ -903,6 +1243,7 @@ export interface OperatorLearningSummary {
903
1243
  sequenceLag: number | null;
904
1244
  status: "unavailable" | "caught_up" | "pending_promotion";
905
1245
  };
1246
+ warningStates: OperatorLearningWarningState[];
906
1247
  learnedRange: RuntimeCompileTargetV1["eventRange"] | null;
907
1248
  materializationCount: number | null;
908
1249
  lastMaterializedAt: string | null;
@@ -949,6 +1290,15 @@ export interface OperatorPrincipalObservabilitySummary {
949
1290
  servingDownstreamOfLatestCorrection: boolean | null;
950
1291
  detail: string;
951
1292
  }
1293
+ interface OperatorManyProfileSupportSummary {
1294
+ operatorSurface: "current_profile_only";
1295
+ declaredAttachmentPolicy: RuntimeTurnBrainAttachmentPolicyV1;
1296
+ sameGatewayIntent: "undeclared" | "dedicated_current_profile_boundary" | "shared_attachment_declared";
1297
+ checkedInProofTopology: "two_local_gateways_dedicated_only";
1298
+ sameGatewayProof: false;
1299
+ sharedWriteSafetyProof: false;
1300
+ detail: string;
1301
+ }
952
1302
  interface OperatorSurfaceReport {
953
1303
  generatedAt: string;
954
1304
  activationRoot: string;
@@ -1002,10 +1352,12 @@ interface OperatorSurfaceReport {
1002
1352
  learning: OperatorLearningSummary;
1003
1353
  teacherLoop: OperatorTeacherLoopSummary;
1004
1354
  principal: OperatorPrincipalObservabilitySummary;
1355
+ manyProfile: OperatorManyProfileSupportSummary;
1005
1356
  findings: OperatorDoctorFinding[];
1006
1357
  }
1007
1358
  export interface CurrentProfileBrainStatusInput extends OperatorSurfaceInput {
1008
1359
  brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
1360
+ profileId?: string | null;
1009
1361
  }
1010
1362
  export type CurrentProfileBrainStatusV1 = CurrentProfileBrainStatusAnswerV1;
1011
1363
  export declare function buildOperatorSurfaceReport(input: OperatorSurfaceInput): OperatorSurfaceReport;
@@ -1067,3 +1419,8 @@ export { CONTRACT_IDS, buildNormalizedEventExport, createFeedbackEvent, createIn
1067
1419
  export { describeNormalizedEventExportObservability } from "@openclawbrain/event-export";
1068
1420
  export { describeCompileFallbackUsage } from "@openclawbrain/compiler";
1069
1421
  export { describeActivationObservability, inspectActivationState, rollbackActivePack } from "@openclawbrain/pack-format";
1422
+ export { createOpenClawLocalSessionTail, OpenClawLocalSessionTail, type OpenClawLocalSessionTailChangeKindV1, type OpenClawLocalSessionTailChangeV1, type OpenClawLocalSessionTailCursorV1, type OpenClawLocalSessionTailInput, type OpenClawLocalSessionTailLoopOptionsV1, type OpenClawLocalSessionTailLoopResultV1, type OpenClawLocalSessionTailNoopReasonV1, type OpenClawLocalSessionTailPollResultV1 } from "./session-tail.js";
1423
+ export { discoverOpenClawMainSessionStores, loadOpenClawSessionIndex, readOpenClawAcpStreamFile, readOpenClawSessionFile, type OpenClawMainSessionStoreV1, type OpenClawAcpStreamRecord, type OpenClawInjectedWorkspaceFile, type OpenClawSessionContentPart, type OpenClawSessionCustomRecord, type OpenClawSessionHeaderRecord, type OpenClawSessionIndex, type OpenClawSessionIndexEntry, type OpenClawSessionMessagePayload, type OpenClawSessionMessageRecord, type OpenClawSessionModelChangeRecord, type OpenClawSessionRecord, type OpenClawSessionTextPart, type OpenClawSessionThinkingLevelChangeRecord, type OpenClawSessionThinkingPart, type OpenClawSessionToolCallPart, type OpenClawSystemPromptReport, type OpenClawToolSurfaceEntry } from "./session-store.js";
1424
+ export { buildPassiveLearningSessionExportFromOpenClawSessionStore, buildPassiveLearningStoreExportFromOpenClawSessionIndex, type OpenClawPassiveLearningPrivacySummaryV1, type OpenClawPassiveLearningSessionEvidenceV1, type OpenClawPassiveLearningSessionExportV1, type OpenClawPassiveLearningStoreExportV1 } from "./local-session-passive-learning.js";
1425
+ export { resolveActivationRoot, type ResolveActivationRootOptions } from "./resolve-activation-root.js";
1426
+ export { runDaemonCommand, type DaemonCliArgs, type DaemonSubcommand, parseDaemonArgs } from "./daemon.js";