@synkro-sh/cli 1.4.36 → 1.4.37
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 +19 -25
- package/dist/bootstrap.js.map +1 -1
- package/package.json +1 -1
package/dist/bootstrap.js
CHANGED
|
@@ -198,20 +198,18 @@ function installCCHooks(settingsPath, config) {
|
|
|
198
198
|
],
|
|
199
199
|
[SYNKRO_MARKER]: true
|
|
200
200
|
});
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
});
|
|
214
|
-
}
|
|
201
|
+
settings.hooks.Stop = settings.hooks.Stop ?? [];
|
|
202
|
+
removeSynkroEntries(settings.hooks, "Stop");
|
|
203
|
+
settings.hooks.Stop.push({
|
|
204
|
+
hooks: [
|
|
205
|
+
{
|
|
206
|
+
type: "command",
|
|
207
|
+
command: config.transcriptSyncScriptPath,
|
|
208
|
+
timeout: 3
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
[SYNKRO_MARKER]: true
|
|
212
|
+
});
|
|
215
213
|
writeSettingsAtomic(settingsPath, settings);
|
|
216
214
|
}
|
|
217
215
|
function uninstallCCHooks(settingsPath) {
|
|
@@ -1460,18 +1458,14 @@ if [ -z "$SESSION_ID" ] || [ -z "$TRANSCRIPT_PATH" ] || [ ! -f "$TRANSCRIPT_PATH
|
|
|
1460
1458
|
echo '{}'; exit 0
|
|
1461
1459
|
fi
|
|
1462
1460
|
|
|
1463
|
-
# Usage telemetry \u2014
|
|
1464
|
-
_LAST_ASST=$(
|
|
1461
|
+
# Usage telemetry \u2014 last turn only (metadata, ungated by privacy/consent)
|
|
1462
|
+
_LAST_ASST=$(tail -20 "$TRANSCRIPT_PATH" 2>/dev/null | grep '"type":"assistant"' | tail -1)
|
|
1465
1463
|
if [ -n "$_LAST_ASST" ]; then
|
|
1466
1464
|
_CC_MODEL=$(echo "$_LAST_ASST" | jq -r '.message.model // empty' 2>/dev/null)
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
_TI=$(echo "$_TOTALS" | jq -r '.in // 0')
|
|
1472
|
-
_TO=$(echo "$_TOTALS" | jq -r '.out // 0')
|
|
1473
|
-
_TCW=$(echo "$_TOTALS" | jq -r '.cw // 0')
|
|
1474
|
-
_TCR=$(echo "$_TOTALS" | jq -r '.cr // 0')
|
|
1465
|
+
_TI=$(echo "$_LAST_ASST" | jq -r '.message.usage.input_tokens // 0' 2>/dev/null)
|
|
1466
|
+
_TO=$(echo "$_LAST_ASST" | jq -r '.message.usage.output_tokens // 0' 2>/dev/null)
|
|
1467
|
+
_TCW=$(echo "$_LAST_ASST" | jq -r '.message.usage.cache_creation_input_tokens // 0' 2>/dev/null)
|
|
1468
|
+
_TCR=$(echo "$_LAST_ASST" | jq -r '.message.usage.cache_read_input_tokens // 0' 2>/dev/null)
|
|
1475
1469
|
if [ "\${_TI:-0}" != "0" ] || [ "\${_TO:-0}" != "0" ]; then
|
|
1476
1470
|
(
|
|
1477
1471
|
_USAGE="{\\"input_tokens\\":$_TI,\\"output_tokens\\":$_TO,\\"cache_creation_input_tokens\\":$_TCW,\\"cache_read_input_tokens\\":$_TCR}"
|
|
@@ -3946,7 +3940,7 @@ function writeConfigEnv(opts) {
|
|
|
3946
3940
|
`SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
|
|
3947
3941
|
`SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
|
|
3948
3942
|
`SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
|
|
3949
|
-
`SYNKRO_VERSION=${shellQuoteSingle("1.4.
|
|
3943
|
+
`SYNKRO_VERSION=${shellQuoteSingle("1.4.37")}`
|
|
3950
3944
|
];
|
|
3951
3945
|
if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
|
|
3952
3946
|
if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
|