@quantiya/codevibe-codex-plugin 2.0.66 → 2.0.69

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();
@@ -11595,7 +11599,7 @@ var AppSyncClient = class _AppSyncClient {
11595
11599
  let response = await this.graphqlRequest(queries.getCompanionSyncState, {}, !1, signal, userId);
11596
11600
  this.assertSyncAccount(userId), _AppSyncClient.throwIfAborted(signal);
11597
11601
  let state = parseCompanionSyncState(response?.data?.getCompanionSyncState, this.environment), effective = this.publishCompanionSyncDisplay(userId, state, epoch, sequence), now = Date.now();
11598
- 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)
11599
11603
  throw new SyncEventClientError("INVALID_SYNC_STATE");
11600
11604
  return effective;
11601
11605
  } catch (error) {
@@ -11615,7 +11619,7 @@ var AppSyncClient = class _AppSyncClient {
11615
11619
  * grants admission, or exposes another account's last observation. */
11616
11620
  companionSyncStatusSnapshot(userId) {
11617
11621
  let value = this.syncDisplay, now = Date.now();
11618
- 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;
11619
11623
  }
11620
11624
  /** Existing socket maintenance recovers idle status after its cloud cache
11621
11625
  * expires. This is display-only; admissions never use the cached result. */
@@ -17825,7 +17829,7 @@ init_logger2();
17825
17829
  var import_node_crypto18 = require("node:crypto"), import_node_fs7 = require("node:fs"), os13 = __toESM(require("node:os")), path21 = __toESM(require("node:path"));
17826
17830
  var METERS2 = ["syncUnits", "mobileAttachmentCount", "mobileAttachmentBytes"];
17827
17831
  function companionSyncUsageWarnings(state, now = Date.now()) {
17828
- 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 [];
17829
17833
  let value = parseCompanionSyncState(state, state.environment, now), usage = value.usage;
17830
17834
  return METERS2.flatMap((meter) => {
17831
17835
  let committed = usage[`${meter}Committed`], limit = usage[`${meter}Limit`];
@@ -39,3 +39,6 @@ export declare function parseInteractivePrompt(snapshot: string, options?: {
39
39
  * so the parser can match option lines inside boxes.
40
40
  */
41
41
  export declare function normalizeSnapshot(snapshot: string): string;
42
+ export declare function countUnescapedBackticks(str: string): number;
43
+ export declare function isMcpHeadingLine(line: string): boolean;
44
+ export declare function isPromptHeadingLine(line: string): boolean;
@@ -16,7 +16,8 @@ export declare function selectTerminalMenuOption(identity: string, number: strin
16
16
  }): Promise<TerminalMenuDelivery>;
17
17
  /**
18
18
  * Recognize a bottom-pane numbered selector, never a bare numbered list.
19
- * Requires a styled title, exactly one selected option, and a separate terminal
20
- * footer. Labels are data: there is no dialog-title or approval-phrase allowlist.
19
+ * Recognizes styled (bold) titles or prompt heading patterns (with bounded
20
+ * parameter regions for MCP tool approval dialogs), exactly one selected option,
21
+ * and a separate terminal footer with key hints.
21
22
  */
22
23
  export declare function parseActiveTerminalMenu(snapshot: string): TerminalMenu | null;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-core",
3
- "version": "2.0.58",
3
+ "version": "2.0.61",
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.66",
3
+ "version": "2.0.69",
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.58",
50
+ "@quantiya/codevibe-core": "^2.0.61",
51
51
  "@quantiya/quorum-core": "^1.0.1",
52
52
  "chokidar": "^4.0.0",
53
53
  "dotenv": "^16.6.1",