@openclawbrain/openclaw 0.2.2 → 0.2.3
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/LICENSE +201 -0
- package/README.md +10 -0
- package/dist/src/cli.d.ts +61 -3
- package/dist/src/cli.js +1424 -167
- package/dist/src/cli.js.map +1 -1
- package/dist/src/daemon.js +55 -0
- package/dist/src/daemon.js.map +1 -1
- package/dist/src/index.d.ts +64 -3
- package/dist/src/index.js +399 -35
- package/dist/src/index.js.map +1 -1
- package/dist/src/local-session-passive-learning.d.ts +1 -0
- package/dist/src/local-session-passive-learning.js +97 -7
- package/dist/src/local-session-passive-learning.js.map +1 -1
- package/dist/src/resolve-activation-root.js +44 -21
- package/dist/src/resolve-activation-root.js.map +1 -1
- package/dist/src/session-store.d.ts +18 -0
- package/dist/src/session-store.js +40 -0
- package/dist/src/session-store.js.map +1 -1
- package/dist/src/session-tail.d.ts +6 -3
- package/dist/src/session-tail.js +35 -4
- package/dist/src/session-tail.js.map +1 -1
- package/extension/index.ts +69 -34
- package/extension/runtime-guard.ts +338 -0
- package/package.json +12 -13
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { type CompileSelectionMode } from "@openclawbrain/compiler";
|
|
1
2
|
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
3
|
import { type EventExportLaneV1 } from "@openclawbrain/event-export";
|
|
3
|
-
import { type AdvanceAlwaysOnLearningRuntimeInput, type AlwaysOnLearningCadenceV1, type AlwaysOnLearningMaterializationJobV1, type AlwaysOnLearningRuntimePlanV1, type AlwaysOnLearningRuntimeStateV1, type PendingPrincipalEventV1, type PrincipalLearningCheckpointV1 } from "@openclawbrain/learner";
|
|
4
|
-
import { type ActivationInspection, type ActivationObservabilityReport, type GraphEvolutionLogV1, type ActivationSlotInspection, type InitHandoffState } from "@openclawbrain/pack-format";
|
|
4
|
+
import { type AdvanceAlwaysOnLearningRuntimeInput, type AlwaysOnLearningCadenceV1, type AlwaysOnLearningMaterializationJobV1, type AlwaysOnLearningRuntimePlanV1, type AlwaysOnLearningRuntimeStateV1, type BaselineStateV1, type PendingPrincipalEventV1, type PrincipalLearningCheckpointV1 } from "@openclawbrain/learner";
|
|
5
|
+
import { type ActivationInspection, type ActivationObservabilityReport, type GraphEvolutionLogV1, type ActivationSlotInspection, type InitHandoffState, type LearningSpineServeRouteDecisionLogEntryV1 } from "@openclawbrain/pack-format";
|
|
5
6
|
export declare const DEFAULT_ASYNC_TEACHER_QUEUE_CAPACITY = 8;
|
|
6
7
|
declare const RECORDED_SESSION_TRACE_CONTRACT: "recorded_session_trace.v1";
|
|
7
8
|
declare const RECORDED_SESSION_FIXTURE_CONTRACT: "recorded_session_replay_fixture.v1";
|
|
@@ -78,8 +79,15 @@ export interface CompileRuntimeContextInput {
|
|
|
78
79
|
budgetStrategy?: CompileRuntimeBudgetStrategy;
|
|
79
80
|
maxContextChars?: number;
|
|
80
81
|
mode?: RouteMode;
|
|
82
|
+
selectionMode?: CompileSelectionMode;
|
|
81
83
|
compactionMode?: ContextCompactionMode;
|
|
82
84
|
runtimeHints?: readonly string[];
|
|
85
|
+
/** Optional session ID for serve-time route decision logging (extension callers). */
|
|
86
|
+
sessionId?: string;
|
|
87
|
+
/** Optional channel identifier for serve-time route decision logging (extension callers). */
|
|
88
|
+
channel?: string;
|
|
89
|
+
/** @internal Suppress serve-time logging inside compileRuntimeContext when called from runRuntimeTurn (which logs separately). */
|
|
90
|
+
_suppressServeLog?: boolean;
|
|
83
91
|
}
|
|
84
92
|
export interface ActiveCompileTarget {
|
|
85
93
|
activationRoot: string;
|
|
@@ -305,6 +313,7 @@ export interface OpenClawRuntimeTurnInput {
|
|
|
305
313
|
maxContextBlocks?: number;
|
|
306
314
|
budgetStrategy?: CompileRuntimeBudgetStrategy;
|
|
307
315
|
mode?: RouteMode;
|
|
316
|
+
selectionMode?: CompileSelectionMode;
|
|
308
317
|
runtimeHints?: readonly string[];
|
|
309
318
|
brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
|
|
310
319
|
contextFingerprint?: RuntimeTurnContextFingerprintInputV1 | null;
|
|
@@ -345,6 +354,13 @@ export type TeacherLoopNoOpReason = "none" | "duplicate_export" | "queue_full" |
|
|
|
345
354
|
export interface AsyncTeacherLiveLoopInput extends Pick<AdvanceAlwaysOnLearningRuntimeInput, "packLabel" | "workspace" | "learnedRouting" | "builtAt" | "offlineArtifacts" | "structuralOps" | "sparseFeedback" | "liveSliceSize" | "backfillSliceSize" | "cadence"> {
|
|
346
355
|
maxQueuedExports?: number;
|
|
347
356
|
staleAfterMs?: number;
|
|
357
|
+
resumeFromSnapshot?: AsyncTeacherLiveLoopSnapshotV1 | null;
|
|
358
|
+
resolveLearnedRoutingState?: () => {
|
|
359
|
+
pgVersion?: AdvanceAlwaysOnLearningRuntimeInput["pgVersion"];
|
|
360
|
+
serveTimeDecisions?: LearningSpineServeRouteDecisionLogEntryV1[];
|
|
361
|
+
baselineState?: BaselineStateV1;
|
|
362
|
+
};
|
|
363
|
+
persistUpdatedBaseline?: (state: BaselineStateV1) => void;
|
|
348
364
|
}
|
|
349
365
|
export interface AsyncTeacherQueuedExportJobV1 {
|
|
350
366
|
jobId: string;
|
|
@@ -381,6 +397,18 @@ export interface AsyncTeacherLiveLoopSnapshotV1 {
|
|
|
381
397
|
lastMaterialization: AlwaysOnLearningMaterializationJobV1 | null;
|
|
382
398
|
};
|
|
383
399
|
diagnostics: AsyncTeacherLiveLoopDiagnosticsV1;
|
|
400
|
+
state?: {
|
|
401
|
+
interactionEvents: InteractionEventV1[];
|
|
402
|
+
feedbackEvents: FeedbackEventV1[];
|
|
403
|
+
seenExportDigests: string[];
|
|
404
|
+
};
|
|
405
|
+
runtime?: {
|
|
406
|
+
startedAt: string | null;
|
|
407
|
+
lastHeartbeatAt: string | null;
|
|
408
|
+
lastScanAt: string | null;
|
|
409
|
+
scanRoot: string | null;
|
|
410
|
+
lastAppliedMaterializationJobId: string | null;
|
|
411
|
+
};
|
|
384
412
|
}
|
|
385
413
|
export interface AsyncTeacherEnqueueResultV1 {
|
|
386
414
|
accepted: boolean;
|
|
@@ -602,9 +630,13 @@ export interface ScanLiveEventExportResultV1 {
|
|
|
602
630
|
packLabel: string;
|
|
603
631
|
supervision: CanonicalSupervisionV1;
|
|
604
632
|
snapshot: AsyncTeacherLiveLoopSnapshotV1;
|
|
633
|
+
labelFlow: OperatorLabelFlowSummary;
|
|
634
|
+
learningPath: OperatorLearningPathSummary;
|
|
605
635
|
}
|
|
606
636
|
export declare function scanRecordedSession(input: ScanRecordedSessionInputV1): ScanRecordedSessionResultV1;
|
|
607
637
|
export declare function scanLiveEventExport(input: ScanLiveEventExportInputV1): ScanLiveEventExportResultV1;
|
|
638
|
+
export declare function resolveAsyncTeacherLiveLoopSnapshotPath(activationRoot: string): string;
|
|
639
|
+
export declare function loadAsyncTeacherLiveLoopSnapshot(snapshotPath: string): AsyncTeacherLiveLoopSnapshotV1;
|
|
608
640
|
export declare function buildRuntimeEventExportBundleManifest(input: {
|
|
609
641
|
exportName: string;
|
|
610
642
|
exportedAt: string;
|
|
@@ -1155,6 +1187,27 @@ export interface OperatorGraphSummary {
|
|
|
1155
1187
|
operatorSummary: string | null;
|
|
1156
1188
|
detail: string;
|
|
1157
1189
|
}
|
|
1190
|
+
export type OperatorObservabilitySource = "active_pack" | "event_export" | "materialized_candidate" | "missing";
|
|
1191
|
+
export type OperatorPolicyGradientVersion = "v1" | "v2" | "unavailable";
|
|
1192
|
+
export interface OperatorLabelFlowSummary {
|
|
1193
|
+
source: OperatorObservabilitySource;
|
|
1194
|
+
humanLabelCount: number | null;
|
|
1195
|
+
selfLabelCount: number | null;
|
|
1196
|
+
asyncTeacherArtifactCount: number | null;
|
|
1197
|
+
implicitPositiveCount: number | null;
|
|
1198
|
+
detail: string;
|
|
1199
|
+
}
|
|
1200
|
+
export interface OperatorLearningPathSummary {
|
|
1201
|
+
available: boolean;
|
|
1202
|
+
source: OperatorObservabilitySource;
|
|
1203
|
+
policyGradientVersion: OperatorPolicyGradientVersion;
|
|
1204
|
+
policyGradientMethod: string | null;
|
|
1205
|
+
objective: string | null;
|
|
1206
|
+
targetConstruction: string | null;
|
|
1207
|
+
connectOpsFired: number | null;
|
|
1208
|
+
reconstructedTrajectoryCount: number | null;
|
|
1209
|
+
detail: string;
|
|
1210
|
+
}
|
|
1158
1211
|
export interface OperatorServePathSummary {
|
|
1159
1212
|
state: OperatorServePathState;
|
|
1160
1213
|
fallbackToStaticContext: boolean;
|
|
@@ -1208,10 +1261,14 @@ export interface OperatorTeacherLoopSummary {
|
|
|
1208
1261
|
sourcePath: string | null;
|
|
1209
1262
|
lastNoOpReason: TeacherLoopNoOpReason | "unavailable";
|
|
1210
1263
|
latestFreshness: AsyncTeacherLiveLoopDiagnosticsV1["latestFreshness"] | "unavailable";
|
|
1264
|
+
startedAt: string | null;
|
|
1265
|
+
lastHeartbeatAt: string | null;
|
|
1266
|
+
lastScanAt: string | null;
|
|
1211
1267
|
lastProcessedAt: string | null;
|
|
1212
1268
|
queueDepth: number | null;
|
|
1213
1269
|
queueCapacity: number | null;
|
|
1214
1270
|
running: boolean | null;
|
|
1271
|
+
lastAppliedMaterializationJobId: string | null;
|
|
1215
1272
|
lastMaterializedPackId: string | null;
|
|
1216
1273
|
notes: string[];
|
|
1217
1274
|
detail: string;
|
|
@@ -1312,6 +1369,8 @@ interface OperatorSurfaceReport {
|
|
|
1312
1369
|
};
|
|
1313
1370
|
brain: OperatorBrainStateSummary;
|
|
1314
1371
|
graph: OperatorGraphSummary;
|
|
1372
|
+
labelFlow: OperatorLabelFlowSummary;
|
|
1373
|
+
learningPath: OperatorLearningPathSummary;
|
|
1315
1374
|
learnedRouting: {
|
|
1316
1375
|
required: boolean;
|
|
1317
1376
|
available: boolean;
|
|
@@ -1360,6 +1419,8 @@ export interface CurrentProfileBrainStatusInput extends OperatorSurfaceInput {
|
|
|
1360
1419
|
profileId?: string | null;
|
|
1361
1420
|
}
|
|
1362
1421
|
export type CurrentProfileBrainStatusV1 = CurrentProfileBrainStatusAnswerV1;
|
|
1422
|
+
export declare function summarizeNormalizedEventExportLabelFlow(normalizedEventExport: NormalizedEventExportV1, asyncTeacherArtifactCount?: number): OperatorLabelFlowSummary;
|
|
1423
|
+
export declare function summarizeLearningPathFromMaterialization(materialization: AlwaysOnLearningMaterializationJobV1 | null): OperatorLearningPathSummary;
|
|
1363
1424
|
export declare function buildOperatorSurfaceReport(input: OperatorSurfaceInput): OperatorSurfaceReport;
|
|
1364
1425
|
export declare function describeCurrentProfileBrainStatus(input: CurrentProfileBrainStatusInput): CurrentProfileBrainStatusV1;
|
|
1365
1426
|
export declare function formatOperatorRollbackReport(result: RollbackRuntimeAttachResult): string;
|
|
@@ -1420,7 +1481,7 @@ export { describeNormalizedEventExportObservability } from "@openclawbrain/event
|
|
|
1420
1481
|
export { describeCompileFallbackUsage } from "@openclawbrain/compiler";
|
|
1421
1482
|
export { describeActivationObservability, inspectActivationState, rollbackActivePack } from "@openclawbrain/pack-format";
|
|
1422
1483
|
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";
|
|
1484
|
+
export { discoverOpenClawMainSessionStores, discoverOpenClawSessionStores, loadOpenClawSessionIndex, readOpenClawAcpStreamFile, readOpenClawSessionFile, type OpenClawMainSessionStoreV1, type OpenClawSessionStoreV1, 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
1485
|
export { buildPassiveLearningSessionExportFromOpenClawSessionStore, buildPassiveLearningStoreExportFromOpenClawSessionIndex, type OpenClawPassiveLearningPrivacySummaryV1, type OpenClawPassiveLearningSessionEvidenceV1, type OpenClawPassiveLearningSessionExportV1, type OpenClawPassiveLearningStoreExportV1 } from "./local-session-passive-learning.js";
|
|
1425
1486
|
export { resolveActivationRoot, type ResolveActivationRootOptions } from "./resolve-activation-root.js";
|
|
1426
1487
|
export { runDaemonCommand, type DaemonCliArgs, type DaemonSubcommand, parseDaemonArgs } from "./daemon.js";
|