@quantiya/codevibe-codex-plugin 2.0.65 → 2.0.68

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.
@@ -1187,6 +1187,10 @@ var import_os = __toESM(require("os")), import_path = __toESM(require("path")),
1187
1187
  // 2026-04-25 when Phase 2f.3.c destroyed and recreated the dev API
1188
1188
  // stack, breaking every hardcoded `<id>.appsync-api...` URL.
1189
1189
  appsyncUrl: "https://api-dev.codevibe.quantiya.ai/graphql",
1190
+ // Exact deployed Development API outputs, verified 2026-10-09. Keep
1191
+ // Production unconfigured until its separately approved deployment.
1192
+ syncHttpUrl: "https://syutde0emc.execute-api.us-east-1.amazonaws.com",
1193
+ syncWebSocketUrl: "wss://yahmtnhy2d.execute-api.us-east-1.amazonaws.com/development",
1190
1194
  cognitoUserPoolId: "us-east-1_yVwWDPvvJ",
1191
1195
  cognitoClientId: "e9r5apv6v5uui3l928r2ris0r",
1192
1196
  cognitoDomain: "codevibe-development.auth.us-east-1.amazoncognito.com"
@@ -4182,7 +4186,7 @@ function parseSyncPromptRetentionReceipt(value, promptId2) {
4182
4186
  }
4183
4187
 
4184
4188
  // src/appsync/sync-state.ts
4185
- var import_json_freeze3 = require("json-freeze"), QUOTA_PAUSED_CONTENT = "Companion sync paused. Continue on desktop. Messages omitted while paused will not be backfilled.";
4189
+ var import_json_freeze3 = require("json-freeze"), SYNC_STATE_CLOCK_SKEW_MS = 6e4, QUOTA_PAUSED_CONTENT = "Companion sync paused. Continue on desktop. Messages omitted while paused will not be backfilled.";
4186
4190
  function companionSyncStateMerge(next, previous) {
4187
4191
  if (next.controlGeneration !== previous.controlGeneration) return next.controlGeneration > previous.controlGeneration ? "REPLACE" : "RETAIN";
4188
4192
  if (next.accountingGeneration !== previous.accountingGeneration) return "CONFLICT";
@@ -4194,11 +4198,11 @@ function companionSyncStateMerge(next, previous) {
4194
4198
  return payload(next) !== payload(previous) ? "CONFLICT" : next.observedAtEpochMs !== previous.observedAtEpochMs ? next.observedAtEpochMs > previous.observedAtEpochMs ? "REPLACE" : "RETAIN" : next.validUntilEpochMs >= previous.validUntilEpochMs ? "REPLACE" : "RETAIN";
4195
4199
  }
4196
4200
  function companionSyncBadge(state, now = Date.now()) {
4197
- return !state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now || now >= state.validUntilEpochMs ? "Companion sync status unavailable" : state.usage?.syncState === "PAUSED" ? "Companion sync paused" : state.protocol === "FROZEN" ? "Companion sync unavailable" : state.usage?.syncState === "WARNING" ? "Companion sync 80%+" : null;
4201
+ return !state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || now >= state.validUntilEpochMs ? "Companion sync status unavailable" : state.usage?.syncState === "PAUSED" ? "Companion sync paused" : state.protocol === "FROZEN" ? "Companion sync unavailable" : state.usage?.syncState === "WARNING" ? "Companion sync 80%+" : null;
4198
4202
  }
4199
4203
  function companionSyncUsageLines(state, now = Date.now()) {
4200
4204
  let unavailable = ["Companion sync status unavailable"];
4201
- if (!state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now || now >= state.validUntilEpochMs) return unavailable;
4205
+ if (!state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || now >= state.validUntilEpochMs) return unavailable;
4202
4206
  if (state.protocol === "LEGACY") return ["Legacy Companion accounting"];
4203
4207
  if (!state.usage || state.resetAtEpochMs === null) return unavailable;
4204
4208
  let paused = state.usage.syncState === "PAUSED", allowsSend = !paused && state.protocol === "SYNC_V2", lines = [paused ? "Companion sync paused" : allowsSend ? state.usage.syncState === "WARNING" ? "Companion sync 80%+" : "Companion sync active" : "Companion sync unavailable"], labels = [["syncUnits", "Sync units"], ["mobileAttachmentCount", "Mobile images"], ["mobileAttachmentBytes", "Mobile upload bytes"]];
@@ -4242,7 +4246,7 @@ function parseCompanionSyncState(value, environment, now = Date.now()) {
4242
4246
  invalid2();
4243
4247
  }
4244
4248
  }
4245
- (!closed(value, plain2(value) && Object.prototype.hasOwnProperty.call(value, "quotaNotice") ? [...FIELDS, "quotaNotice"] : FIELDS) || Buffer.byteLength(JSON.stringify(value)) > 2048 || value.schemaVersion !== 1 || value.environment !== environment || !["development", "production"].includes(value.environment) || !["FREE", "PRO", "MAX"].includes(value.tier) || !["LEGACY", "SHADOW", "AUTHORITATIVE", "ROLLBACK_FREEZE"].includes(value.mode) || !["LEGACY", "SYNC_V2", "FROZEN"].includes(value.protocol) || !Number.isSafeInteger(value.controlGeneration) || value.controlGeneration < 0 || !Number.isSafeInteger(value.observedAtEpochMs) || value.observedAtEpochMs < Date.UTC(2e3, 0, 1) || value.observedAtEpochMs > now + 6e4 || !Number.isSafeInteger(value.validUntilEpochMs) || value.validUntilEpochMs <= now || value.validUntilEpochMs <= value.observedAtEpochMs || value.validUntilEpochMs - value.observedAtEpochMs > 18e5 || value.accountingGeneration !== null && (typeof value.accountingGeneration != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(value.accountingGeneration)) || !closed(value.limits, METERS)) && invalid2(), count(value.entitlementVersion);
4249
+ (!closed(value, plain2(value) && Object.prototype.hasOwnProperty.call(value, "quotaNotice") ? [...FIELDS, "quotaNotice"] : FIELDS) || Buffer.byteLength(JSON.stringify(value)) > 2048 || value.schemaVersion !== 1 || value.environment !== environment || !["development", "production"].includes(value.environment) || !["FREE", "PRO", "MAX"].includes(value.tier) || !["LEGACY", "SHADOW", "AUTHORITATIVE", "ROLLBACK_FREEZE"].includes(value.mode) || !["LEGACY", "SYNC_V2", "FROZEN"].includes(value.protocol) || !Number.isSafeInteger(value.controlGeneration) || value.controlGeneration < 0 || !Number.isSafeInteger(value.observedAtEpochMs) || value.observedAtEpochMs < Date.UTC(2e3, 0, 1) || value.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || !Number.isSafeInteger(value.validUntilEpochMs) || value.validUntilEpochMs <= now || value.validUntilEpochMs <= value.observedAtEpochMs || value.validUntilEpochMs - value.observedAtEpochMs > 18e5 || value.accountingGeneration !== null && (typeof value.accountingGeneration != "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(value.accountingGeneration)) || !closed(value.limits, METERS)) && invalid2(), count(value.entitlementVersion);
4246
4250
  for (let meter of METERS) count(value.limits[meter]) === 0n && invalid2();
4247
4251
  if (value.mode === "AUTHORITATIVE") {
4248
4252
  (value.protocol === "LEGACY" || !value.accountingGeneration || !closed(value.usage, USAGE_FIELDS) || typeof value.periodId != "string" || !/^\d{4}-(0[1-9]|1[0-2])$/.test(value.periodId)) && invalid2();
@@ -4303,9 +4307,7 @@ function boundedObject(value, limit) {
4303
4307
  }
4304
4308
  }
4305
4309
  function parseSyncSecurityPostureReceipt(value, expected) {
4306
- let wrapper = boundedObject(value, 4096);
4307
- if (!closed2(wrapper, ["ok", "receiptJson"]) || wrapper.ok !== !0 || typeof wrapper.receiptJson != "string") return invalidReceipt();
4308
- let row3 = boundedObject(wrapper.receiptJson, 2048);
4310
+ let row3 = boundedObject(value, 2048);
4309
4311
  if (!closed2(row3, ["schemaVersion", "kind", "state", "sessionId", "sessionGenerationId", "posture", "noticeId", "delivery"]) || row3.schemaVersion !== 1 || row3.kind !== "SECURITY_POSTURE" || row3.state !== "RECORDED" || row3.sessionId !== expected.sessionId || row3.sessionGenerationId !== expected.sessionGenerationId || row3.posture !== expected.posture || row3.noticeId !== syncSecurityPostureNoticeId(expected) || !closed2(row3.delivery, ["state", "outcomes"]) || !["ATTEMPTED", "REPLAY_NO_SEND"].includes(row3.delivery.state) || !Array.isArray(row3.delivery.outcomes) || row3.delivery.outcomes.length > 3 || row3.delivery.state === "REPLAY_NO_SEND" && row3.delivery.outcomes.length !== 0) return invalidReceipt();
4310
4312
  let recipients = /* @__PURE__ */ new Set();
4311
4313
  for (let outcome2 of row3.delivery.outcomes) {
@@ -11597,7 +11599,7 @@ var AppSyncClient = class _AppSyncClient {
11597
11599
  let response = await this.graphqlRequest(queries.getCompanionSyncState, {}, !1, signal, userId);
11598
11600
  this.assertSyncAccount(userId), _AppSyncClient.throwIfAborted(signal);
11599
11601
  let state = parseCompanionSyncState(response?.data?.getCompanionSyncState, this.environment), effective = this.publishCompanionSyncDisplay(userId, state, epoch, sequence), now = Date.now();
11600
- if (!effective || effective.observedAtEpochMs > now || effective.validUntilEpochMs <= now)
11602
+ if (!effective || !Number.isSafeInteger(now) || effective.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || effective.validUntilEpochMs <= now)
11601
11603
  throw new SyncEventClientError("INVALID_SYNC_STATE");
11602
11604
  return effective;
11603
11605
  } catch (error) {
@@ -11617,7 +11619,7 @@ var AppSyncClient = class _AppSyncClient {
11617
11619
  * grants admission, or exposes another account's last observation. */
11618
11620
  companionSyncStatusSnapshot(userId) {
11619
11621
  let value = this.syncDisplay, now = Date.now();
11620
- return !this.authenticated || this.currentUserId !== userId || this.tokens?.userId !== userId || value?.userId !== userId || value.state.environment !== this.environment || !Number.isSafeInteger(now) || value.state.observedAtEpochMs > now || now >= value.state.validUntilEpochMs ? null : value.state;
11622
+ return !this.authenticated || this.currentUserId !== userId || this.tokens?.userId !== userId || value?.userId !== userId || value.state.environment !== this.environment || !Number.isSafeInteger(now) || value.state.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || now >= value.state.validUntilEpochMs ? null : value.state;
11621
11623
  }
11622
11624
  /** Existing socket maintenance recovers idle status after its cloud cache
11623
11625
  * expires. This is display-only; admissions never use the cached result. */
@@ -17827,7 +17829,7 @@ init_logger2();
17827
17829
  var import_node_crypto18 = require("node:crypto"), import_node_fs7 = require("node:fs"), os13 = __toESM(require("node:os")), path21 = __toESM(require("node:path"));
17828
17830
  var METERS2 = ["syncUnits", "mobileAttachmentCount", "mobileAttachmentBytes"];
17829
17831
  function companionSyncUsageWarnings(state, now = Date.now()) {
17830
- if (!state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now || now >= state.validUntilEpochMs || state.mode !== "AUTHORITATIVE" || state.protocol !== "SYNC_V2" || state.usage?.syncState !== "WARNING") return [];
17832
+ if (!state || !Number.isSafeInteger(now) || state.observedAtEpochMs > now + SYNC_STATE_CLOCK_SKEW_MS || now >= state.validUntilEpochMs || state.mode !== "AUTHORITATIVE" || state.protocol !== "SYNC_V2" || state.usage?.syncState !== "WARNING") return [];
17831
17833
  let value = parseCompanionSyncState(state, state.environment, now), usage = value.usage;
17832
17834
  return METERS2.flatMap((meter) => {
17833
17835
  let committed = usage[`${meter}Committed`], limit = usage[`${meter}Limit`];
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.57",
3
+ "version": "2.0.60",
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-codex-plugin",
3
- "version": "2.0.65",
3
+ "version": "2.0.68",
4
4
  "description": "Control OpenAI Codex CLI 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": {
@@ -47,7 +47,7 @@
47
47
  "node": ">=22.0.0"
48
48
  },
49
49
  "dependencies": {
50
- "@quantiya/codevibe-core": "^2.0.57",
50
+ "@quantiya/codevibe-core": "^2.0.60",
51
51
  "@quantiya/quorum-core": "^1.0.1",
52
52
  "chokidar": "^4.0.0",
53
53
  "dotenv": "^16.6.1",