@quantiya/codevibe-claude-plugin 2.0.33 → 2.0.34

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.
@@ -3092,6 +3092,9 @@ var queries = {
3092
3092
  encryptionVersion
3093
3093
  writerAuthenticated
3094
3094
  writerEventNonce
3095
+ writerEventKind
3096
+ writerSessionGenerationId
3097
+ emittedBy
3095
3098
  }
3096
3099
  }
3097
3100
  `
@@ -5144,7 +5147,15 @@ var AppSyncClient = class _AppSyncClient {
5144
5147
  }
5145
5148
  let preparedInput = {
5146
5149
  ...input,
5147
- metadata: input.metadata ? JSON.stringify(input.metadata) : void 0
5150
+ metadata: input.metadata ? JSON.stringify(input.metadata) : void 0,
5151
+ // AWSJSON is serialized at the transport boundary; the signed local
5152
+ // outbox retains its original structured subject and predecessor.
5153
+ ...input.writerOutcomeSubject !== void 0 && {
5154
+ writerOutcomeSubject: JSON.stringify(input.writerOutcomeSubject)
5155
+ },
5156
+ ...input.writerCausalPredecessor !== void 0 && {
5157
+ writerCausalPredecessor: JSON.stringify(input.writerCausalPredecessor)
5158
+ }
5148
5159
  };
5149
5160
  if (input.writerAttestation !== void 0) {
5150
5161
  let inputBytes = Buffer.byteLength(JSON.stringify(preparedInput), "utf8"), maximumBytes = 180 * 1024;
@@ -24204,6 +24215,7 @@ function definitiveRejectionCode(error) {
24204
24215
  var WorkspaceTerminalCoordinator = class {
24205
24216
  constructor(options) {
24206
24217
  this.resolutions = /* @__PURE__ */ new Map();
24218
+ this.reportedSyncIssues = /* @__PURE__ */ new Set();
24207
24219
  this.operationChain = Promise.resolve();
24208
24220
  if (!options.session.sessionGenerationId || !UUID_RE5.test(options.session.sessionGenerationId))
24209
24221
  throw new Error("WorkspaceTerminalCoordinator: session generation is unavailable");
@@ -24689,7 +24701,10 @@ var WorkspaceTerminalCoordinator = class {
24689
24701
  await atomicWriteFileSync2(
24690
24702
  path16.join(directory, `${sha2562(nonce)}.json`),
24691
24703
  this.serialize(diagnostic)
24692
- ), await this.acknowledge(nonce, generation), this.onSyncIssue?.(`Workspace result could not be synchronized (${rejectionCode}).`);
24704
+ ), await this.acknowledge(nonce, generation), this.reportSyncIssue(`Workspace result could not be synchronized (${rejectionCode}).`);
24705
+ }
24706
+ reportSyncIssue(message) {
24707
+ this.reportedSyncIssues.has(message) || (this.reportedSyncIssues.add(message), this.onSyncIssue?.(message));
24693
24708
  }
24694
24709
  async sendOutbox(row) {
24695
24710
  for (let attempt = 1; attempt <= 2; attempt += 1)
@@ -24704,7 +24719,12 @@ var WorkspaceTerminalCoordinator = class {
24704
24719
  await this.quarantine(row.nonce, rejection, row.sessionGenerationId);
24705
24720
  return;
24706
24721
  }
24707
- attempt === 2 && this.onSyncIssue?.("Workspace result is saved locally and will sync the next time CodeVibe starts.");
24722
+ attempt === 2 && (logger.warn("[WorkspaceTerminalCoordinator] result synchronization deferred", {
24723
+ sessionId: row.sessionId,
24724
+ sessionGenerationId: row.sessionGenerationId,
24725
+ nonce: row.nonce,
24726
+ reason: error instanceof AppSyncGraphQLError ? "graphql_error" : error instanceof Error && error.message === "WorkspaceTerminalCoordinator: invalid outbox acknowledgement" ? "invalid_acknowledgment" : "transport_or_local_storage_error"
24727
+ }), this.reportSyncIssue("Workspace results are saved locally and will retry synchronization the next time CodeVibe starts."));
24708
24728
  }
24709
24729
  }
24710
24730
  /** Reconcile terminal receipts first, then replay exact encrypted bytes. */
@@ -24719,10 +24739,11 @@ var WorkspaceTerminalCoordinator = class {
24719
24739
  let intentFiles = await this.listRecords(this.intentDir());
24720
24740
  if (intentFiles.length > MAX_OUTBOX_RECORDS)
24721
24741
  throw new Error("WorkspaceTerminalCoordinator: intent capacity exceeded");
24742
+ let attempted = /* @__PURE__ */ new Set();
24722
24743
  for (let file of intentFiles) {
24723
24744
  let intent = validateAnyIntent(await this.readJson(file));
24724
24745
  if (intent.sessionId !== this.session.sessionId || intent.sessionGenerationId !== this.generation()) throw new Error("WorkspaceTerminalCoordinator: intent generation mismatch");
24725
- intent.state === "TERMINAL" && await this.flushTerminalIntent(intent);
24746
+ intent.state === "TERMINAL" && (await this.flushTerminalIntent(intent), attempted.add(intent.nonce));
24726
24747
  }
24727
24748
  let outboxFiles = await this.listRecordsAcrossGenerations(this.outboxRoot()), bytes = 0;
24728
24749
  for (let record of outboxFiles) bytes += (await import_node_fs6.promises.stat(record.file)).size;
@@ -24734,7 +24755,7 @@ var WorkspaceTerminalCoordinator = class {
24734
24755
  record.generation,
24735
24756
  record.file
24736
24757
  );
24737
- await this.sendOutbox(row);
24758
+ record.generation === this.generation() && attempted.has(row.nonce) || await this.sendOutbox(row);
24738
24759
  }
24739
24760
  }).catch((error) => {
24740
24761
  throw logger.warn("[WorkspaceTerminalCoordinator] replay incomplete", {
@@ -65,6 +65,7 @@ export declare class WorkspaceTerminalCoordinator implements WorkspaceOutcomeSin
65
65
  private readonly now;
66
66
  private readonly onSyncIssue?;
67
67
  private readonly resolutions;
68
+ private readonly reportedSyncIssues;
68
69
  private operationChain;
69
70
  constructor(options: WorkspaceTerminalCoordinatorOptions);
70
71
  private generation;
@@ -108,6 +109,7 @@ export declare class WorkspaceTerminalCoordinator implements WorkspaceOutcomeSin
108
109
  private flushTerminalIntent;
109
110
  private acknowledge;
110
111
  private quarantine;
112
+ private reportSyncIssue;
111
113
  private sendOutbox;
112
114
  /** Reconcile terminal receipts first, then replay exact encrypted bytes. */
113
115
  replayPending(): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.28",
3
+ "version": "2.0.29",
4
4
  "description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-claude-plugin",
3
- "version": "2.0.33",
3
+ "version": "2.0.34",
4
4
  "description": "Control Claude Code from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "codevibe": {
@@ -48,7 +48,7 @@
48
48
  "node": ">=22.0.0"
49
49
  },
50
50
  "dependencies": {
51
- "@quantiya/codevibe-core": "^2.0.28",
51
+ "@quantiya/codevibe-core": "^2.0.29",
52
52
  "@quantiya/quorum-core": "^1.0.1",
53
53
  "dotenv": "^16.6.1",
54
54
  "express": "^5.1.0",