@synkro-sh/cli 1.7.70 → 1.7.72

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.
package/dist/bootstrap.js CHANGED
@@ -132,7 +132,7 @@ function getIdentity() {
132
132
  if (cached2) return cached2;
133
133
  let cliVersion = "0.0.0";
134
134
  try {
135
- cliVersion = "1.7.70";
135
+ cliVersion = "1.7.72";
136
136
  } catch {
137
137
  }
138
138
  const creds = loadCredentialsIdentity();
@@ -2430,7 +2430,14 @@ export async function runStub(surface: string, opts: StubOpts = {}): Promise<voi
2430
2430
  if (tp && existsSync(tp)) {
2431
2431
  try {
2432
2432
  const t = readFileSync(tp, 'utf-8');
2433
- envelope.transcript = (opts.fullTranscript || t.length <= 200000) ? t : t.slice(t.length - 200000);
2433
+ // Cap the shipped transcript so the 3s Stop-hook sync COMPLETES even on huge sessions.
2434
+ // An unbounded full-transcript upload (100s of MB) is killed mid-upload by the hook
2435
+ // timeout, so the turn's final reply never lands (that was the "I don't see my latest
2436
+ // reply" gap). A 400KB tail still covers many recent turns including the final reply;
2437
+ // older turns were persisted by earlier syncs. Rows key on the stable CC uuid and order
2438
+ // by ts, so we no longer depend on the whole file for absolute message indices.
2439
+ const cap = opts.fullTranscript ? 400000 : 200000;
2440
+ envelope.transcript = t.length <= cap ? t : t.slice(t.length - cap);
2434
2441
  } catch {}
2435
2442
  }
2436
2443
  }
@@ -6481,7 +6488,7 @@ function writeConfigEnv(opts) {
6481
6488
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle2(credsPath)}`,
6482
6489
  `SYNKRO_TIER=${shellQuoteSingle2(safeTier)}`,
6483
6490
  `SYNKRO_INFERENCE=${shellQuoteSingle2(safeInference)}`,
6484
- `SYNKRO_VERSION=${shellQuoteSingle2("1.7.70")}`
6491
+ `SYNKRO_VERSION=${shellQuoteSingle2("1.7.72")}`
6485
6492
  ];
6486
6493
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle2(safeSynkroBin)}`);
6487
6494
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle2(safeUserId)}`);
@@ -7141,7 +7148,7 @@ async function installCommand(opts = {}) {
7141
7148
  await setTelemetryState({ enabled: true, remoteFlushEnabled: telemetryConsent });
7142
7149
  emit("install", {
7143
7150
  phase: "started",
7144
- cli_version_to: "1.7.70",
7151
+ cli_version_to: "1.7.72",
7145
7152
  agents_detected: agents.map((a) => a.kind),
7146
7153
  with_github: false,
7147
7154
  with_local_cc: false,
@@ -10217,13 +10224,20 @@ function parseSession(filePath, sessionId) {
10217
10224
  const kind = e.type === "assistant" || e.message?.role === "assistant" ? "assistant" : e.type === "user" || e.message?.role === "user" ? "user" : "";
10218
10225
  if (!kind) continue;
10219
10226
  const msgObj = e.message;
10227
+ const _cr = msgObj?.content ?? e.content;
10228
+ const isToolResult = kind === "user" && (!!e.toolUseResult || Array.isArray(_cr) && _cr.some((b) => b?.type === "tool_result" || b?.tool_use_id != null));
10229
+ const finalKind = isToolResult ? "tool" : kind;
10220
10230
  const text = extractText(msgObj?.content ?? e.content);
10221
10231
  const blocks = kind === "assistant" && Array.isArray(msgObj?.content) ? msgObj.content : [];
10222
10232
  const toolCalls = blocks.filter((b) => b?.type === "tool_use").map((b) => ({ name: b.name, input: JSON.stringify(b.input || {}).slice(0, 2e4), id: b.id }));
10223
10233
  if (!text.trim() && toolCalls.length === 0) continue;
10224
10234
  const msg = {
10225
10235
  message_index: i,
10226
- type: kind,
10236
+ type: finalKind,
10237
+ // CC's per-entry uuid is STABLE across transcript rewrites/compaction; message_index (line
10238
+ // number) is not. The server keys conversation_messages on this uuid so re-imports update in
10239
+ // place instead of orphaning/duplicating rows. Falls back to message_index server-side if absent.
10240
+ uuid: typeof e.uuid === "string" ? e.uuid : void 0,
10227
10241
  content: text.trim() ? text.slice(0, 8e3) : "\u21B3 " + toolCalls.map((t) => t.name).join(", "),
10228
10242
  timestamp: e.timestamp || null
10229
10243
  };
@@ -11030,7 +11044,7 @@ var subArgs = args.slice(1);
11030
11044
  var isDetachedChild = process.env.SYNKRO_TELEMETRY_DETACHED === "1";
11031
11045
  var FLUSH_SKIP = /* @__PURE__ */ new Set(["grade", "version", "--version", "-v", "help", "--help", "-h", ""]);
11032
11046
  function printVersion() {
11033
- console.log("1.7.70");
11047
+ console.log("1.7.72");
11034
11048
  }
11035
11049
  function printHelp2() {
11036
11050
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents