@quantiya/codevibe-core 2.0.78 → 2.0.80
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/appsync/appsync-client.d.ts +4 -0
- package/dist/appsync/index.d.ts +2 -0
- package/dist/appsync/sync-mobile-echo.d.ts +9 -0
- package/dist/appsync/sync-source-cursor.d.ts +14 -0
- package/dist/appsync/sync-source-file.d.ts +15 -0
- package/dist/appsync/sync-source-pair.d.ts +2 -1
- package/dist/appsync/sync-source-recovery.d.ts +35 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +516 -516
- package/dist/orchestration-shell/cli.js +231 -23
- package/dist/orchestration-shell/workspace-terminal-coordinator.d.ts +3 -0
- package/dist/tool-activity/replay-cursor.d.ts +11 -1
- package/package.json +1 -1
|
@@ -2012,6 +2012,10 @@ export declare class AppSyncClient {
|
|
|
2012
2012
|
private handleApplyUserDecisionWatcherError;
|
|
2013
2013
|
private cleanupApplyUserDecisionWatcherState;
|
|
2014
2014
|
private heartbeatTimers;
|
|
2015
|
+
private heartbeatReadiness;
|
|
2016
|
+
/** Local producer health, not a quota/transport flag. Reconnect must not
|
|
2017
|
+
* advertise readiness while the owning transcript reader is degraded. */
|
|
2018
|
+
setHeartbeatReadiness(sessionId: string, ready: () => boolean): () => void;
|
|
2015
2019
|
/** Identity tokens invalidate in-flight pulses when a session is stopped. */
|
|
2016
2020
|
private heartbeatTokens;
|
|
2017
2021
|
/** Shared initial confirmation makes duplicate start calls idempotent. */
|
package/dist/appsync/index.d.ts
CHANGED
|
@@ -25,6 +25,8 @@ export { MAX_SYNC_SOURCE_ANCHOR_BYTES } from './sync-source-cursor';
|
|
|
25
25
|
export type { DesktopSyncSourceStream, DesktopSyncSourceFrame, DesktopSyncSourceCursor, DesktopSyncSourceJournal, DesktopSyncSourceInventory, DesktopSyncSourceAnchor, DesktopSyncSourcePosition, DesktopSyncSourceGap } from './sync-source-cursor';
|
|
26
26
|
export type { DesktopSyncSourcePair } from './sync-source-pair';
|
|
27
27
|
export { readDesktopSyncFile } from './sync-source-file';
|
|
28
|
+
export { DEFAULT_SYNC_SOURCE_RECOVERY_POLICY, planSyncSourceRecovery, resolveSyncSourceRecoveryPolicy } from './sync-source-recovery';
|
|
29
|
+
export type { SyncSourceRecoveryPolicy, SyncSourceMessageObservation } from './sync-source-recovery';
|
|
28
30
|
export type { DesktopSyncFileIdentity, DesktopSyncFileFrame, DesktopSyncFileAdmission } from './sync-source-file';
|
|
29
31
|
export { DesktopSyncReadClient, SyncReadClientError } from './sync-read-client';
|
|
30
32
|
export type { DesktopSyncRegistrationAttempt, DesktopSyncReadCredential, SyncReadEvent, SyncHistoryPage } from './sync-read-client';
|
|
@@ -274,6 +274,15 @@ export interface DesktopMobileEchoJournal {
|
|
|
274
274
|
}): Promise<void>;
|
|
275
275
|
/** Uses native record time, not replay time; reserves one exact byte occurrence. */
|
|
276
276
|
claim(frame: DesktopMobileEchoFrame, content: string, nativeTimestamp: string): Promise<boolean>;
|
|
277
|
+
/** Read-only, under the existing row lock: freeze exact eligible IDs and
|
|
278
|
+
* one-to-one native proofs. Caller must persist the plan before settlement. */
|
|
279
|
+
planOmitted(records: Iterable<{
|
|
280
|
+
sourceSha256: string;
|
|
281
|
+
content: string;
|
|
282
|
+
timestamp: string;
|
|
283
|
+
}>): Promise<string>;
|
|
284
|
+
/** Idempotent exact removals; never rematch history or consult wall clocks. */
|
|
285
|
+
settleOmitted(plan: string): Promise<number>;
|
|
277
286
|
/** Call only after the real native cursor is durably at/past this position. */
|
|
278
287
|
reconcile(streamSha256: string, committedByteOffset: number): Promise<number>;
|
|
279
288
|
}
|
|
@@ -17,9 +17,19 @@ export interface DesktopSyncSourcePosition {
|
|
|
17
17
|
byteOffset: number;
|
|
18
18
|
anchor: DesktopSyncSourceAnchor | null;
|
|
19
19
|
discardUntilNewline: boolean;
|
|
20
|
+
/** Durable rebase marker, projected by the paired owner; never a new input. */
|
|
21
|
+
recovered?: {
|
|
22
|
+
previousOffset: number;
|
|
23
|
+
boundaryOffset: number;
|
|
24
|
+
skippedHistory: boolean;
|
|
25
|
+
recordedAt: number;
|
|
26
|
+
/** Opaque bounded cleanup intent in the existing encrypted projection. */
|
|
27
|
+
projection?: string | null;
|
|
28
|
+
};
|
|
20
29
|
/** Recovery hint only, never persisted: finish this linked PREPARING frame
|
|
21
30
|
* before the reader may discard a later backlog range. */
|
|
22
31
|
pendingFrameEndOffset?: number;
|
|
32
|
+
pendingFrame?: Pick<DesktopSyncSourceFrame, 'startOffset' | 'endOffset' | 'sourceSha256'>;
|
|
23
33
|
}
|
|
24
34
|
export interface DesktopSyncSourceGap {
|
|
25
35
|
startOffset: number;
|
|
@@ -28,6 +38,8 @@ export interface DesktopSyncSourceGap {
|
|
|
28
38
|
reason: 'BACKLOG_LIMIT' | 'OVERSIZED_RECORD' | 'PARTIAL_RECORD' | 'MALFORMED_RECORD' | 'EMPTY_RECORD';
|
|
29
39
|
discardUntilNewline: boolean;
|
|
30
40
|
}
|
|
41
|
+
/** Shared preflight: reject malformed caller coordinates before inspecting WAL progress. */
|
|
42
|
+
export declare function validSourceRebase(previous: DesktopSyncSourcePosition, target: DesktopSyncSourceAnchor, skipped: boolean): boolean;
|
|
31
43
|
declare const schema: z.ZodObject<{
|
|
32
44
|
schemaVersion: z.ZodLiteral<1>;
|
|
33
45
|
kind: z.ZodLiteral<"SOURCE_CURSOR">;
|
|
@@ -507,6 +519,8 @@ export interface DesktopSyncSourceJournal {
|
|
|
507
519
|
admit(frame: DesktopSyncSourceFrame, prepare: ((operationId: string) => Promise<CreateDesktopSyncEventInput>) | null, projectionAfter?: string | null): Promise<string | null>;
|
|
508
520
|
/** Persist an intentional reader safety gap, never a network/quota fallback. */
|
|
509
521
|
skip(gap: DesktopSyncSourceGap): Promise<void>;
|
|
522
|
+
/** A verified native rewrite, only after all already admitted operations settle. */
|
|
523
|
+
rebase(previous: DesktopSyncSourcePosition, target: DesktopSyncSourceAnchor, skippedHistory: boolean, recordedAt: number, recoveryProjection?: string | null): Promise<void>;
|
|
510
524
|
/** Repairs interrupted preparation/settlement without source bytes or new encryption. */
|
|
511
525
|
recover(): Promise<void>;
|
|
512
526
|
/** Bounded cloud drain, separate from native source admission. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type DesktopSyncSourceAnchor, type DesktopSyncSourcePosition, type DesktopSyncSourceGap } from './sync-source-cursor';
|
|
2
|
+
import { type SyncSourceMessageObservation, type SyncSourceRecoveryPolicy } from './sync-source-recovery';
|
|
2
3
|
export interface DesktopSyncFileIdentity {
|
|
3
4
|
filePath: string;
|
|
4
5
|
fileIdentity: Readonly<{
|
|
@@ -16,6 +17,15 @@ export interface DesktopSyncFileAdmission<T> {
|
|
|
16
17
|
restore(source: Readonly<DesktopSyncFileIdentity>, initial: DesktopSyncSourcePosition): Promise<DesktopSyncSourcePosition | null>;
|
|
17
18
|
admit(event: T, source: Readonly<DesktopSyncFileFrame>): Promise<void>;
|
|
18
19
|
skip(gap: DesktopSyncSourceGap, source: Readonly<DesktopSyncFileIdentity>): Promise<void>;
|
|
20
|
+
rebase?(previous: DesktopSyncSourcePosition, target: DesktopSyncSourceAnchor, skippedHistory: boolean, recoveryProjection?: string | null): Promise<DesktopSyncSourcePosition>;
|
|
21
|
+
recovered?(recovery: NonNullable<DesktopSyncSourcePosition['recovered']>): Promise<void>;
|
|
22
|
+
beforeRead?(position: Readonly<DesktopSyncSourcePosition>, source: Readonly<DesktopSyncFileIdentity>, size: number): Promise<void>;
|
|
23
|
+
/** Freeze an exact-ID cleanup plan BEFORE committing the rebase. Only newly
|
|
24
|
+
* omitted records are supplied; this callback never dispatches history. */
|
|
25
|
+
prepareRecovery?(records: Iterable<{
|
|
26
|
+
event: T;
|
|
27
|
+
frame: DesktopSyncFileFrame;
|
|
28
|
+
}>): Promise<string>;
|
|
19
29
|
}
|
|
20
30
|
/** Bounded descriptor-based reader. Admission/fsync, not cloud delivery, advances it. */
|
|
21
31
|
export declare function readDesktopSyncFile<T>(options: {
|
|
@@ -26,8 +36,13 @@ export declare function readDesktopSyncFile<T>(options: {
|
|
|
26
36
|
isCurrent(): boolean;
|
|
27
37
|
maxBacklogBytes?: number;
|
|
28
38
|
maxRecordBytes?: number;
|
|
39
|
+
recovery?: {
|
|
40
|
+
inspect(line: string): SyncSourceMessageObservation | null;
|
|
41
|
+
policy?: SyncSourceRecoveryPolicy;
|
|
42
|
+
};
|
|
29
43
|
}): Promise<{
|
|
30
44
|
position: DesktopSyncSourcePosition;
|
|
31
45
|
size: number;
|
|
32
46
|
mtimeMs: number;
|
|
47
|
+
recovered?: DesktopSyncSourcePosition['recovered'];
|
|
33
48
|
} | null>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateDesktopSyncEventInput } from './sync-event-client';
|
|
2
|
-
import type { DesktopSyncSourceFrame, DesktopSyncSourceGap, DesktopSyncSourceJournal, DesktopSyncSourcePosition, DesktopSyncSourceStream } from './sync-source-cursor';
|
|
2
|
+
import type { DesktopSyncSourceFrame, DesktopSyncSourceGap, DesktopSyncSourceJournal, DesktopSyncSourcePosition, DesktopSyncSourceStream, DesktopSyncSourceAnchor } from './sync-source-cursor';
|
|
3
3
|
type Prepare = ((operationId: string) => Promise<CreateDesktopSyncEventInput>) | null;
|
|
4
4
|
export interface DesktopSyncSourcePair {
|
|
5
5
|
/** Restore the earliest unfinished lane, never the latest volatile reader offset. */
|
|
@@ -7,6 +7,7 @@ export interface DesktopSyncSourcePair {
|
|
|
7
7
|
/** Both slots are fixed for this source's lifetime; null explicitly ignores a slot. */
|
|
8
8
|
admit(frame: DesktopSyncSourceFrame, prepare: readonly [Prepare, Prepare]): Promise<readonly [string | null, string | null]>;
|
|
9
9
|
skip(gap: DesktopSyncSourceGap): Promise<void>;
|
|
10
|
+
rebase(previous: DesktopSyncSourcePosition, target: DesktopSyncSourceAnchor, skippedHistory: boolean, recoveryProjection?: string | null): Promise<DesktopSyncSourcePosition>;
|
|
10
11
|
recover(): Promise<void>;
|
|
11
12
|
/** The bound is per lane; two lanes cannot starve each other. */
|
|
12
13
|
drain(maximumPerLane?: number, signal?: AbortSignal): Promise<number>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type DesktopSyncSourceAnchor, type DesktopSyncSourcePosition } from './sync-source-cursor';
|
|
2
|
+
/** Owner-approved recovery defaults. These are local catch-up bounds, not quotas. */
|
|
3
|
+
export interface SyncSourceRecoveryPolicy {
|
|
4
|
+
staleAfterMs: number;
|
|
5
|
+
maximumRecentMessages: number;
|
|
6
|
+
anchorSearchBytes: number;
|
|
7
|
+
maximumScanBytes: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const DEFAULT_SYNC_SOURCE_RECOVERY_POLICY: Readonly<SyncSourceRecoveryPolicy>;
|
|
10
|
+
export interface SyncSourceMessageObservation {
|
|
11
|
+
timestampMs: number;
|
|
12
|
+
isMessage: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface SyncSourceRecoveryPlan {
|
|
15
|
+
anchor: DesktopSyncSourceAnchor;
|
|
16
|
+
skippedHistory: boolean;
|
|
17
|
+
/** Current-file end of the uniquely relocated old checkpoint. Never scan
|
|
18
|
+
* already-acknowledged history as new omitted-echo evidence. */
|
|
19
|
+
resumeOffset: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveSyncSourceRecoveryPolicy(): SyncSourceRecoveryPolicy;
|
|
22
|
+
/** Metadata-only traversal, bounded by the caller; never advances a cursor. */
|
|
23
|
+
export declare function scanSyncSourceFrames(fd: number, start: number, end: number): Generator<{
|
|
24
|
+
start: number;
|
|
25
|
+
end: number;
|
|
26
|
+
bytes: Buffer;
|
|
27
|
+
}>;
|
|
28
|
+
/** Same-descriptor, bounded scan. It never dispatches or returns message content. */
|
|
29
|
+
export declare function planSyncSourceRecovery(options: {
|
|
30
|
+
fd: number;
|
|
31
|
+
size: number;
|
|
32
|
+
previous: DesktopSyncSourcePosition;
|
|
33
|
+
inspect(line: string): SyncSourceMessageObservation | null;
|
|
34
|
+
policy?: SyncSourceRecoveryPolicy;
|
|
35
|
+
}): SyncSourceRecoveryPlan;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ export type { DurableSyncResult, DurableDesktopSyncWriterOptions, DesktopSyncSes
|
|
|
29
29
|
export { MAX_SYNC_SOURCE_ANCHOR_BYTES } from './appsync';
|
|
30
30
|
export type { DesktopSyncSourcePair } from './appsync';
|
|
31
31
|
export { readDesktopSyncFile } from './appsync';
|
|
32
|
+
export { DEFAULT_SYNC_SOURCE_RECOVERY_POLICY, planSyncSourceRecovery, resolveSyncSourceRecoveryPolicy } from './appsync';
|
|
33
|
+
export type { SyncSourceRecoveryPolicy, SyncSourceMessageObservation } from './appsync';
|
|
32
34
|
export type { DesktopSyncFileIdentity, DesktopSyncFileFrame, DesktopSyncFileAdmission } from './appsync';
|
|
33
35
|
export type { DesktopSyncSourceStream, DesktopSyncSourceFrame, DesktopSyncSourceCursor, DesktopSyncSourceJournal, DesktopSyncSourceInventory, DesktopSyncSourceAnchor, DesktopSyncSourcePosition, DesktopSyncSourceGap } from './appsync';
|
|
34
36
|
export { createToolActivitySyncTransport } from './tool-activity/sync-transport';
|
|
@@ -75,7 +77,7 @@ export { emitShellEvent, createShellEventEmitter } from './orchestration-shell';
|
|
|
75
77
|
export { processMarkers, withRoleMarker } from './orchestration-shell';
|
|
76
78
|
export { ToolActivityOutbox, type ToolActivityOutboxOptions, type ListPendingResult, } from './tool-activity';
|
|
77
79
|
export { ToolActivityLedger, LedgerEntrySchema, LedgerFileSchema, LegacyOwnedFileSchema, type LedgerEntry, type LedgerFile, type LegacyOwnedFile, type OccurrenceRef, type ToolActivityLedgerOptions, } from './tool-activity';
|
|
78
|
-
export { ToolReplayCursor, captureToolReplayBoundary, ReplayFrameTooLargeError, ReplayCursorStateSchema, DEFAULT_REPLAY_READ_BYTES, DEFAULT_REPLAY_MAX_FRAME_BYTES, type ReplayCursorState, type ReplayFrame, type ReadFramesResult, type ToolReplayCursorOptions, type ToolReplayInitialBoundary, } from './tool-activity';
|
|
80
|
+
export { ToolReplayCursor, captureToolReplayBoundary, ReplayFrameTooLargeError, ReplayCursorStateSchema, DEFAULT_REPLAY_READ_BYTES, DEFAULT_REPLAY_MAX_FRAME_BYTES, type ReplayCursorState, type ReplayFrame, type ReadFramesResult, type ToolReplayCursorOptions, type ToolReplayInitialBoundary, type ToolReplayVerifiedBoundary, } from './tool-activity';
|
|
79
81
|
export { ToolActivitySessionMap, InProcessRolloutLock, SessionMapRecordSchema, type RolloutLock, type RolloutOwnership, type SessionMapRecord, type ToolActivitySessionMapOptions, } from './tool-activity';
|
|
80
82
|
export { ToolActivityConsolidator, isSessionKeyStaleError, isTerminalSessionError, type ObservedOccurrence, type ObserveDisposition, type ToolActivityTransport, type ToolActivityConsolidatorOptions, } from './tool-activity';
|
|
81
83
|
export { SocketRolloutLock, type SocketRolloutLockOptions, FlockRolloutLock, type FlockRolloutLockOptions, type FlockSyncFn, type FlockFlag, createRolloutLock, type CreateRolloutLockOptions, } from './tool-activity';
|