@quantiya/codevibe-codex-plugin 2.0.82 → 2.0.84

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.
Files changed (21) hide show
  1. package/dist/server.js +54 -54
  2. package/libexec/companion-launcher +28 -4
  3. package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +1 -0
  4. package/node_modules/@quantiya/codevibe-core/dist/appsync/sync-operation-journal.d.ts +1 -0
  5. package/node_modules/@quantiya/codevibe-core/dist/appsync/sync-session-retirement.d.ts +1 -1
  6. package/node_modules/@quantiya/codevibe-core/dist/appsync/sync-source-pair.d.ts +1 -1
  7. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +1 -1
  8. package/node_modules/@quantiya/codevibe-core/dist/index.js +518 -518
  9. package/node_modules/@quantiya/codevibe-core/dist/orchestration/detect-agents.d.ts +20 -0
  10. package/node_modules/@quantiya/codevibe-core/dist/orchestration/index.d.ts +1 -1
  11. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/audit-summary.d.ts +2 -0
  12. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.d.ts +4 -0
  13. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +262 -80
  14. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/doctor-cli.d.ts +2 -0
  15. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/quorum-loop.d.ts +17 -3
  16. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/ledger.d.ts +5 -0
  17. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/outbox.d.ts +3 -2
  18. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/replay-cursor.d.ts +17 -3
  19. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/sync-transport.d.ts +3 -0
  20. package/node_modules/@quantiya/codevibe-core/package.json +1 -1
  21. package/package.json +2 -2
@@ -268,10 +268,27 @@ cleanup() {
268
268
  cv_telem "wrapper_exited" "\"exit_code\":$wrapper_exit_code,\"lifetime_seconds\":$lifetime,\"codex_exit_code\":\"$codex_exit\",\"codex_lifetime_seconds\":$codex_lifetime,\"tmux_session_started\":$_CV_TMUX_STARTED,\"agent_invoked\":$_CV_AGENT_INVOKED,\"session_start_hook_fired\":$hook_fired,\"terminal_outcome\":\"$outcome\""
269
269
  fi
270
270
 
271
- if [ -n "$SERVER_PID" ] && kill -0 "$SERVER_PID" 2>/dev/null; then
272
- log "Stopping server (PID: $SERVER_PID)"
273
- kill "$SERVER_PID" 2>/dev/null || true
274
- wait "$SERVER_PID" 2>/dev/null || true
271
+ local server_exit=0
272
+ if [ -n "$SERVER_PID" ]; then
273
+ if kill -0 "$SERVER_PID" 2>/dev/null; then
274
+ log "Stopping server (PID: $SERVER_PID)"
275
+ kill "$SERVER_PID" 2>/dev/null || true
276
+ local waited=0
277
+ while kill -0 "$SERVER_PID" 2>/dev/null && [ "$waited" -lt 300 ]; do
278
+ sleep 0.1
279
+ waited=$((waited + 1))
280
+ done
281
+ if kill -0 "$SERVER_PID" 2>/dev/null; then
282
+ log "Server PID $SERVER_PID did not exit gracefully within 30s; killing with SIGKILL"
283
+ kill -9 "$SERVER_PID" 2>/dev/null || true
284
+ server_exit=137
285
+ fi
286
+ fi
287
+ local wait_rc=0
288
+ wait "$SERVER_PID" 2>/dev/null || wait_rc=$?
289
+ if [ "$wait_rc" -ne 0 ] && [ "$server_exit" -eq 0 ]; then
290
+ server_exit=$wait_rc
291
+ fi
275
292
  fi
276
293
  # Remove PID file and port file
277
294
  rm -f "${CODEVIBE_TMPDIR}/codevibe-codex-server-$$.pid"
@@ -303,6 +320,13 @@ cleanup() {
303
320
  log "Other codevibe-codex sessions active, keeping hooks"
304
321
  fi
305
322
  fi
323
+
324
+ trap - EXIT INT TERM
325
+ if [ "$wrapper_exit_code" -ne 0 ]; then
326
+ exit "$wrapper_exit_code"
327
+ elif [ "$server_exit" -ne 0 ]; then
328
+ exit "$server_exit"
329
+ fi
306
330
  }
307
331
 
308
332
  # Set up trap for cleanup
@@ -979,6 +979,7 @@ export declare class AppSyncClient {
979
979
  }, retired: Session, quiesce: () => Promise<void>, signal?: AbortSignal): Promise<{
980
980
  sourcesRemoved: number;
981
981
  operationsRemoved: number;
982
+ cleanupDeferred?: true;
982
983
  }>;
983
984
  /** No Session fetch, live key lookup, native-process operation or re-homing.
984
985
  * The encrypted intent records a completed producer join; fresh cloud proof
@@ -179,6 +179,7 @@ export declare class DurableDesktopSyncWriter {
179
179
  * intent removal. Network I/O never holds the account-store lock. */
180
180
  runSessionRetirement<T>(input: ConfirmDesktopSyncRetirementInput, toolOutbox: ToolSyncRetirementLocation | null, cleanup: (record: SessionRetirementRecord, fence: () => Promise<void>) => Promise<T>, options?: {
181
181
  existingOnly?: boolean;
182
+ isComplete?: (result: T) => boolean;
182
183
  }): Promise<T | null>;
183
184
  /** Terminal GC, not delivery settlement. The session owner MUST first stop
184
185
  * admission and join its native readers, shell emitters and prompt producers.
@@ -9,7 +9,7 @@ export type SyncSessionRetirementReceipt = ConfirmDesktopSyncRetirementInput & {
9
9
  controlClass: 'SESSION_RETIREMENT';
10
10
  };
11
11
  export interface ToolSyncRetirementLocation {
12
- agent: 'codex' | 'claude';
12
+ agent: 'codex' | 'claude' | 'agy';
13
13
  root: string;
14
14
  }
15
15
  export interface SessionRetirementRecord {
@@ -3,7 +3,7 @@ import type { DesktopSyncSourceFrame, DesktopSyncSourceGap, DesktopSyncSourceJou
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. */
6
- open(initial: number | DesktopSyncSourcePosition): Promise<DesktopSyncSourcePosition>;
6
+ open(initial: number | DesktopSyncSourcePosition, validateInitial?: () => void): Promise<DesktopSyncSourcePosition>;
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>;
@@ -74,7 +74,7 @@ export { emitShellEvent, createShellEventEmitter } from './orchestration-shell';
74
74
  export { processMarkers, withRoleMarker } from './orchestration-shell';
75
75
  export { ToolActivityOutbox, type ToolActivityOutboxOptions, type ListPendingResult, } from './tool-activity';
76
76
  export { ToolActivityLedger, LedgerEntrySchema, LedgerFileSchema, LegacyOwnedFileSchema, type LedgerEntry, type LedgerFile, type LegacyOwnedFile, type OccurrenceRef, type ToolActivityLedgerOptions, } from './tool-activity';
77
- export { ToolReplayCursor, ReplayFrameTooLargeError, ReplayCursorStateSchema, DEFAULT_REPLAY_READ_BYTES, DEFAULT_REPLAY_MAX_FRAME_BYTES, type ReplayCursorState, type ReplayFrame, type ReadFramesResult, type ToolReplayCursorOptions, } from './tool-activity';
77
+ 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';
78
78
  export { ToolActivitySessionMap, InProcessRolloutLock, SessionMapRecordSchema, type RolloutLock, type RolloutOwnership, type SessionMapRecord, type ToolActivitySessionMapOptions, } from './tool-activity';
79
79
  export { ToolActivityConsolidator, isSessionKeyStaleError, isTerminalSessionError, type ObservedOccurrence, type ObserveDisposition, type ToolActivityTransport, type ToolActivityConsolidatorOptions, } from './tool-activity';
80
80
  export { SocketRolloutLock, type SocketRolloutLockOptions, FlockRolloutLock, type FlockRolloutLockOptions, type FlockSyncFn, type FlockFlag, createRolloutLock, type CreateRolloutLockOptions, } from './tool-activity';