@botiverse/raft-computer 0.0.62 → 0.0.63
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/dist/index.js +16462 -1617
- package/dist/lib/index.d.ts +18 -38
- package/dist/lib/index.js +15020 -337
- package/package.json +4 -2
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Tracer } from '@slock-ai/shared';
|
|
2
|
+
import { TraceClientSource } from '@slock-ai/trace-client';
|
|
3
|
+
|
|
1
4
|
declare class ComputerError extends Error {
|
|
2
5
|
readonly code: string;
|
|
3
6
|
readonly exitCode: number;
|
|
@@ -1423,47 +1426,24 @@ interface ComputerApi {
|
|
|
1423
1426
|
* IPC-vs-disk decision: when a service is running, mutations route through it
|
|
1424
1427
|
* via IPC so the supervisor's in-memory runner state stays consistent; when no
|
|
1425
1428
|
* service is up (cold boot) the disk-only lib-pure handlers apply directly.
|
|
1426
|
-
*/
|
|
1427
|
-
declare function createComputerApi(slockHome: string): ComputerApi;
|
|
1428
|
-
|
|
1429
|
-
/**
|
|
1430
|
-
* One Computer trace line. INTENTIONALLY shaped as `@slock-ai/shared`'s
|
|
1431
|
-
* canonical `TraceEvent` (`{ name, timeMs, attrs? }`) so the forthcoming shared
|
|
1432
|
-
* trace-client can route these through the real `Tracer` / `TraceSink` with ZERO
|
|
1433
|
-
* format reconciliation. We MIRROR the shape rather than import the type — that
|
|
1434
|
-
* keeps this interim file sink from pulling `@slock-ai/shared` into the Computer
|
|
1435
|
-
* package early; the shared-client work (B) replaces this helper's internals
|
|
1436
|
-
* (file-append → `Tracer.startSpan` + `TraceSink.record`) while the emitted
|
|
1437
|
-
* shape stays identical.
|
|
1438
1429
|
*
|
|
1439
|
-
*
|
|
1440
|
-
*
|
|
1441
|
-
*
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
/** event name, e.g. "route-decision" | "action" */
|
|
1445
|
-
name: string;
|
|
1446
|
-
/** epoch milliseconds (== shared `TraceEvent.timeMs`) */
|
|
1447
|
-
timeMs: number;
|
|
1448
|
-
/** structured attributes (== shared `TraceAttributes`) */
|
|
1449
|
-
attrs?: Record<string, unknown>;
|
|
1450
|
-
}
|
|
1451
|
-
/**
|
|
1452
|
-
* Best-effort append of one `ComputerTraceEvent` JSON line to the Computer trace
|
|
1453
|
-
* sink (`run/trace.jsonl`). NEVER throws or blocks the traced operation — any fs
|
|
1454
|
-
* error is swallowed.
|
|
1430
|
+
* The single-writer ops (reset / upgrade routing) are spanned through the
|
|
1431
|
+
* caller-injected `opts.tracer` (default `noopTracer`, so untraced callers /
|
|
1432
|
+
* tests are zero-side-effect). The CALLER owns `source` attribution — the CLI
|
|
1433
|
+
* injects a `computer.cli` trace-client, the menu-bar a `computer.menu-bar`
|
|
1434
|
+
* one — so the same lib code attributes correctly across both surfaces.
|
|
1455
1435
|
*/
|
|
1456
|
-
declare function
|
|
1436
|
+
declare function createComputerApi(slockHome: string, opts?: {
|
|
1437
|
+
tracer?: Tracer;
|
|
1438
|
+
}): ComputerApi;
|
|
1439
|
+
|
|
1457
1440
|
/**
|
|
1458
|
-
*
|
|
1459
|
-
*
|
|
1460
|
-
*
|
|
1441
|
+
* Build the env-gated Computer trace client for a given emitting `source`
|
|
1442
|
+
* (CLI vs menu-bar). Both surfaces share this so their spans land in the same
|
|
1443
|
+
* `<computerDir>/traces/` sink with consistent gating. `SLOCK_COMPUTER_LOCAL_TRACE=0`
|
|
1444
|
+
* disables (default on, mirrors the daemon); any setup failure falls back to noop.
|
|
1461
1445
|
*/
|
|
1462
|
-
declare function
|
|
1463
|
-
method: string;
|
|
1464
|
-
decision: string;
|
|
1465
|
-
timeMs?: number;
|
|
1466
|
-
}): Promise<void>;
|
|
1446
|
+
declare function createComputerTracer(slockHome: string, source: TraceClientSource): Tracer;
|
|
1467
1447
|
|
|
1468
1448
|
/**
|
|
1469
1449
|
* Read the Computer-level aggregate status from `installRoot`. Identical
|
|
@@ -1509,4 +1489,4 @@ declare function userSessionPath(slockHome: string): string;
|
|
|
1509
1489
|
|
|
1510
1490
|
declare const COMPUTER_VERSION: string;
|
|
1511
1491
|
|
|
1512
|
-
export { type AttachInput, type AttachResult, COMPUTER_VERSION, type ComputerApi, type ComputerApiEvent, ComputerError, ComputerServiceError, type ComputerStatusReport, type
|
|
1492
|
+
export { type AttachInput, type AttachResult, COMPUTER_VERSION, type ComputerApi, type ComputerApiEvent, ComputerError, ComputerServiceError, type ComputerStatusReport, type ConnectService, type ConnectServiceOptions, DEFAULT_UPGRADE_BASE_URL, type DaemonState, IPC_ERROR_CODES, type IpcErrorCode, type LegacyMachineCandidate, type LegacyMachineRosterClient, type LegacyMachineRosterEntry, type LegacyMachineRosterResult, LegacyMachinesClient, type ListRunnersResult, type LoginInput, type LoginResult, MIGRATION_DETECTION_KINDS, MIGRATION_FRESH_TRIGGERS, type ManualPathValidation, type MigrationDetection, type MigrationDetectionKind, type MigrationFreshTrigger, type PickerSelection, RUNNER_STATE_VALUES, type RequestMethodMap, type RequestOptions, type ResetRunnerResult, type ResetServiceResult, type RunnerListItem as RunnerInfo, type RunnerListPerServer, type RunnerState, type RunnerStatusResult, SERVICE_STATE_VALUES, STATE_READER_ERROR_CODES, type ServerHealth, type ServerStatusRow, ServersClient, type ServiceClient, ServiceClientError, type ServiceEvent, type ServiceState, type ServiceStatusResult, StateReaderError, type StateReaderErrorCode, UPGRADE_ERROR_CODES, type UpgradeBundle, type UpgradeErrorCode, type UpgradeLogEntry, type UpgradeLogEntryErr, type UpgradeLogEntryOk, type UpgradeStartResult, type UpgradeTrigger, type UserServerEntry, type UserServersResult, assertUpgradeLogEntry, connectService, createComputerApi, createComputerTracer, detectLegacyMigration, fetchCdnLatestVersion, isComputerError, isIpcErrorCode, isMigrationDetectionKind, isRunnerState, isServiceState, listRunners, pickMigrationCandidateFromInput, readRunnerStatus, readServiceStatus, userSessionPath, validateManualMigratePath };
|