@quantiya/codevibe-core 2.0.71 → 2.0.73

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 (58) hide show
  1. package/dist/appsync/appsync-client.d.ts +42 -10
  2. package/dist/appsync/queries.d.ts +4 -0
  3. package/dist/appsync/session-freshness.d.ts +12 -0
  4. package/dist/appsync/sync-operation-journal.d.ts +1 -0
  5. package/dist/appsync/sync-session-retirement.d.ts +1 -1
  6. package/dist/appsync/sync-source-pair.d.ts +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +650 -569
  9. package/dist/orchestration/detect-agents.d.ts +20 -0
  10. package/dist/orchestration/index.d.ts +1 -1
  11. package/dist/orchestration-shell/audit-summary.d.ts +2 -0
  12. package/dist/orchestration-shell/brainstorm-context.d.ts +11 -0
  13. package/dist/orchestration-shell/cli.d.ts +15 -1
  14. package/dist/orchestration-shell/cli.js +55791 -53028
  15. package/dist/orchestration-shell/conductor-reply.d.ts +37 -0
  16. package/dist/orchestration-shell/context-items.d.ts +64 -0
  17. package/dist/orchestration-shell/doctor-cli.d.ts +2 -0
  18. package/dist/orchestration-shell/index.d.ts +44 -2
  19. package/dist/orchestration-shell/quorum-loop.d.ts +17 -3
  20. package/dist/orchestration-shell/resume-modal.d.ts +19 -0
  21. package/dist/orchestration-shell/slash-router.d.ts +2 -0
  22. package/dist/orchestration-shell/types.d.ts +48 -2
  23. package/dist/session/pending-session-create.d.ts +31 -0
  24. package/dist/session-resume/ResumePicker.d.ts +21 -0
  25. package/dist/session-resume/carry-over.d.ts +81 -0
  26. package/dist/session-resume/clean-exit.d.ts +33 -0
  27. package/dist/session-resume/cli-resume.d.ts +41 -0
  28. package/dist/session-resume/completeness-copy.d.ts +52 -0
  29. package/dist/session-resume/create-outcome.d.ts +43 -0
  30. package/dist/session-resume/e2e-fault.d.ts +28 -0
  31. package/dist/session-resume/hosted-loader.d.ts +88 -0
  32. package/dist/session-resume/local-completeness.d.ts +10 -0
  33. package/dist/session-resume/local-records.d.ts +121 -0
  34. package/dist/session-resume/picker-rows.d.ts +17 -0
  35. package/dist/session-resume/publish-retire.d.ts +40 -0
  36. package/dist/session-resume/relaunch.d.ts +72 -0
  37. package/dist/session-resume/restore-conversation.d.ts +27 -0
  38. package/dist/session-resume/resume-candidates.d.ts +52 -0
  39. package/dist/session-resume/resume-chosen.d.ts +103 -0
  40. package/dist/session-resume/resume-create.d.ts +121 -0
  41. package/dist/session-resume/resume-entry.d.ts +87 -0
  42. package/dist/session-resume/resume-header.d.ts +25 -0
  43. package/dist/session-resume/resume-io.d.ts +34 -0
  44. package/dist/session-resume/resume-ledger.d.ts +107 -0
  45. package/dist/session-resume/resume-messages.d.ts +68 -0
  46. package/dist/session-resume/resume-rows.d.ts +24 -0
  47. package/dist/session-resume/resume-target.d.ts +65 -0
  48. package/dist/session-resume/shell-resume-io.d.ts +25 -0
  49. package/dist/session-resume/shell-resume.d.ts +34 -0
  50. package/dist/session-resume/source-choice.d.ts +37 -0
  51. package/dist/session-resume/successor-carry-over.d.ts +54 -0
  52. package/dist/session-resume/will-retire.d.ts +24 -0
  53. package/dist/tool-activity/ledger.d.ts +5 -0
  54. package/dist/tool-activity/outbox.d.ts +3 -2
  55. package/dist/tool-activity/replay-cursor.d.ts +17 -3
  56. package/dist/tool-activity/sync-transport.d.ts +3 -0
  57. package/dist/types/session.d.ts +67 -0
  58. package/package.json +1 -1
@@ -7,6 +7,7 @@ import { DurableDesktopSyncWriter, type DesktopSyncSessionScope } from './sync-o
7
7
  import { DesktopSyncReadClient } from './sync-read-client';
8
8
  import { DesktopSyncLiveConnection } from './sync-live-connection';
9
9
  import { type DurableDesktopSyncReader } from './sync-desktop-registration';
10
+ import type { ContextItemPage, ResumableSessionPage, ResumeDetails } from '../types/session';
10
11
  import type { PromptReRaiseDisposition } from './sync-prompt-retention';
11
12
  import { type ResolveDesktopSyncPromptInput, type SyncPromptResolutionReceipt } from './sync-prompt-resolution';
12
13
  import { type ConfirmDesktopSyncRetirementInput, type SyncSessionRetirementReceipt } from './sync-session-retirement';
@@ -422,18 +423,16 @@ export interface DownloadUrlResponse {
422
423
  expiresAt: string;
423
424
  }
424
425
  /**
425
- * CP-1.b IMPL r2 M-4 — Typed GraphQL error that preserves AppSync's
426
- * `errorType` and `extensions` fields, alongside the human-readable
427
- * `message`. Stage 2 r1's `graphqlRequest()` threw a plain
428
- * `Error("GraphQL error: <message>")` and silently dropped
429
- * `errorType`, which broke `BackendPlannerClient.classifyTransportError`
430
- * (it discriminates on `err.errorType` to separate
431
- * `BudgetExceeded` / `TierGateRejected` from provider-health failures).
426
+ * The P61 old-backend retry's trigger: the server's schema lacks an input field the update sent.
432
427
  *
433
- * Callers may catch this class to inspect `errorType` directly. Code
434
- * paths that still parse error.message will continue to work because
435
- * the message is unchanged ("GraphQL error: <message>").
428
+ * AppSync answers a variable carrying an undefined input field with a GraphQL error whose message is
429
+ * exactly "The variables input contains a field that is not defined for input object type
430
+ * 'UpdateSessionInput'" — no `errorType`, and the field is not named (observed against Development on
431
+ * 2026-10-15, P61B-S1-F8; Phase B assumption PB-12). The caller retries only when the request carried
432
+ * clean-exit fields, and the retry removes only those, so a different unknown field still fails.
433
+ * The older validation-error shape that names a clean-exit field is kept as a second form.
436
434
  */
435
+ export declare function isUnknownCleanExitFieldError(error: unknown): boolean;
437
436
  export declare class AppSyncGraphQLError extends Error {
438
437
  readonly responseMessage: string;
439
438
  readonly errorType?: string;
@@ -980,6 +979,7 @@ export declare class AppSyncClient {
980
979
  }, retired: Session, quiesce: () => Promise<void>, signal?: AbortSignal): Promise<{
981
980
  sourcesRemoved: number;
982
981
  operationsRemoved: number;
982
+ cleanupDeferred?: true;
983
983
  }>;
984
984
  /** No Session fetch, live key lookup, native-process operation or re-homing.
985
985
  * The encrypted intent records a completed producer join; fresh cloud proof
@@ -1014,6 +1014,12 @@ export declare class AppSyncClient {
1014
1014
  * Create a session
1015
1015
  */
1016
1016
  createSession(input: CreateSessionInput): Promise<Session>;
1017
+ /**
1018
+ * P61 — the resume create (B-15). The same mutation as `createSession`, with
1019
+ * `resumedFromSessionId` selected so the caller can prove the server resumed
1020
+ * the predecessor. Used only on resume paths.
1021
+ */
1022
+ createResumedSession(input: CreateSessionInput): Promise<Session>;
1017
1023
  /**
1018
1024
  * Blind-hold one canonical ContextItem. The mutation is idempotent only for
1019
1025
  * an exact ciphertext+routing replay; a conflicting rewrite is rejected by
@@ -1098,6 +1104,18 @@ export declare class AppSyncClient {
1098
1104
  createdAt: string | null;
1099
1105
  updatedAt: string | null;
1100
1106
  }>>;
1107
+ /** One page of the caller's resumable sessions (creation order; amendment A-1). */
1108
+ listResumableSessions(limit?: number, nextToken?: string | null): Promise<ResumableSessionPage>;
1109
+ /**
1110
+ * Every resumable session (S1R1-F23: never just the first screen). The
1111
+ * 7-day window bounds the set; the page cap only stops a server that never
1112
+ * ends its token chain.
1113
+ */
1114
+ listAllResumableSessions(maxPages?: number): Promise<ResumeDetails[]>;
1115
+ /** One owner-only row in any status (null when absent or not owned). */
1116
+ getResumeDetails(sessionId: string): Promise<ResumeDetails | null>;
1117
+ /** One page of a session's hosted ContextItem rows (routing ids + ciphertext). */
1118
+ listContextItems(sessionId: string, nextToken?: string | null): Promise<ContextItemPage>;
1101
1119
  /**
1102
1120
  * Mark stale ACTIVE sessions of a given agentType INACTIVE so they
1103
1121
  * stop appearing in the mobile app's session list. Called at daemon
@@ -1128,6 +1146,20 @@ export declare class AppSyncClient {
1128
1146
  staleThresholdMs?: number;
1129
1147
  excludeSessionIds?: string[];
1130
1148
  }): Promise<number>;
1149
+ /**
1150
+ * P61 pre-listing retire (SESSION-RESUME-DESIGN.md §6.2 step 3; Phase B
1151
+ * B-5). Retires exactly the rows of the caller's own step-1 read for which
1152
+ * `willRetire` holds, so the `--continue` comparison and the retirement can
1153
+ * never disagree. Immediately before each retire the row is re-read
1154
+ * strongly, and it is skipped if it is no longer ACTIVE or its heartbeat
1155
+ * moved since the step-1 read (a live shell elsewhere). Returns the retired
1156
+ * IDs (step 4 merges them through `getResumeDetails`). Best effort: a failed
1157
+ * read or update leaves that row as it is.
1158
+ */
1159
+ sweepOrphanSessionsFromRows<T extends {
1160
+ sessionId: string;
1161
+ lastHeartbeatAt?: string | null;
1162
+ }>(rows: readonly T[], willRetire: (row: T) => boolean): Promise<string[]>;
1131
1163
  /**
1132
1164
  * List user device keys
1133
1165
  */
@@ -17,6 +17,9 @@ export declare const queries: {
17
17
  * whose creator died before its first heartbeat.
18
18
  */
19
19
  listSessions: string;
20
+ listResumableSessions: string;
21
+ getResumeDetails: string;
22
+ listContextItems: string;
20
23
  getSubscriptionStatus: string;
21
24
  queryAudit: string;
22
25
  verifyContinuationPacketWritten: string;
@@ -33,6 +36,7 @@ export declare const mutations: {
33
36
  recordExecutionEvent: string;
34
37
  putContextItem: string;
35
38
  createSession: string;
39
+ createResumedSession: string;
36
40
  updateSession: string;
37
41
  updateEvent: string;
38
42
  createEvent: string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The one freshness rule shared by the plain-launch orphan sweep and the P61
3
+ * pre-listing retire (SESSION-RESUME-DESIGN.md §6.2 step 3): a row's age is
4
+ * `now − max(lastHeartbeatAt, createdAt, updatedAt)`, ignoring unparsable
5
+ * values. A row with no parsable value has no age, and is never swept on age.
6
+ */
7
+ export interface SessionFreshnessFields {
8
+ lastHeartbeatAt?: string | null;
9
+ createdAt?: string | null;
10
+ updatedAt?: string | null;
11
+ }
12
+ export declare function sessionFreshnessAgeMs(row: SessionFreshnessFields, nowMs: number): number | null;
@@ -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>;
package/dist/index.d.ts CHANGED
@@ -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';