@synkro-sh/cli 1.4.93 → 1.4.96

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
@@ -1661,8 +1661,12 @@ export function extractTranscript(transcriptPath: string | undefined): Transcrip
1661
1661
 
1662
1662
  // \u2500\u2500\u2500 Last Prompt \u2500\u2500\u2500
1663
1663
 
1664
- export function readLastPrompt(): string {
1664
+ export function readLastPrompt(sessionId?: string): string {
1665
1665
  try {
1666
+ if (sessionId) {
1667
+ const perSession = join(SESSIONS_DIR, sessionId + '.last-prompt');
1668
+ if (existsSync(perSession)) return readFileSync(perSession, 'utf-8').trim();
1669
+ }
1666
1670
  if (!existsSync(LAST_PROMPT_FILE)) return '';
1667
1671
  return readFileSync(LAST_PROMPT_FILE, 'utf-8').trim();
1668
1672
  } catch {
@@ -1986,7 +1990,7 @@ async function main() {
1986
1990
 
1987
1991
  // Extract transcript context
1988
1992
  const transcript = extractTranscript(transcriptPath);
1989
- const lastPrompt = readLastPrompt();
1993
+ const lastPrompt = readLastPrompt(sessionId);
1990
1994
 
1991
1995
  // Load config and decide route
1992
1996
  const config = await loadConfig(jwt);
@@ -2938,7 +2942,7 @@ async function main() {
2938
2942
  }
2939
2943
  }
2940
2944
 
2941
- const lastPrompt = readLastPrompt();
2945
+ const lastPrompt = readLastPrompt(sessionId);
2942
2946
 
2943
2947
  const config = await loadConfig(jwt);
2944
2948
  const rt = await route(config);
@@ -3119,7 +3123,7 @@ async function main() {
3119
3123
  jwt = await ensureFreshJwt(jwt);
3120
3124
 
3121
3125
  const transcript = extractTranscript(transcriptPath);
3122
- const lastPrompt = readLastPrompt();
3126
+ const lastPrompt = readLastPrompt(sessionId);
3123
3127
 
3124
3128
  const config = await loadConfig(jwt);
3125
3129
  const rt = await route(config);
@@ -3803,8 +3807,14 @@ async function main() {
3803
3807
  const msg = payload.message || payload.prompt || payload.content || '';
3804
3808
  if (msg) {
3805
3809
  const promptFile = join(homedir(), '.synkro', '.last-prompt');
3806
- mkdirSync(dirname(promptFile), { recursive: true });
3807
- writeFileSync(promptFile, msg, 'utf-8');
3810
+ mkdirSync(dirname(promptFile), { recursive: true, mode: 0o700 });
3811
+ writeFileSync(promptFile, msg, { encoding: 'utf-8', mode: 0o600 });
3812
+ const sid = hookSessionId(payload);
3813
+ if (sid) {
3814
+ const sessDir = join(homedir(), '.synkro', 'sessions');
3815
+ mkdirSync(sessDir, { recursive: true, mode: 0o700 });
3816
+ writeFileSync(join(sessDir, sid + '.last-prompt'), msg, { encoding: 'utf-8', mode: 0o600 });
3817
+ }
3808
3818
  }
3809
3819
 
3810
3820
  const sessionId = hookSessionId(payload);
@@ -3953,7 +3963,7 @@ async function main() {
3953
3963
  jwt = await ensureFreshJwt(jwt);
3954
3964
 
3955
3965
  const transcript = extractTranscript(transcriptPath);
3956
- const lastPrompt = readLastPrompt();
3966
+ const lastPrompt = readLastPrompt(sessionId);
3957
3967
 
3958
3968
  const config = await loadConfig(jwt);
3959
3969
  if (config.silent) finishAllow();
@@ -5722,7 +5732,7 @@ function writeConfigEnv(opts) {
5722
5732
  `SYNKRO_CREDENTIALS_PATH=${shellQuoteSingle(credsPath)}`,
5723
5733
  `SYNKRO_TIER=${shellQuoteSingle(safeTier)}`,
5724
5734
  `SYNKRO_INFERENCE=${shellQuoteSingle(safeInference)}`,
5725
- `SYNKRO_VERSION=${shellQuoteSingle("1.4.93")}`
5735
+ `SYNKRO_VERSION=${shellQuoteSingle("1.4.96")}`
5726
5736
  ];
5727
5737
  if (safeSynkroBin) lines.push(`SYNKRO_CLI_BIN=${shellQuoteSingle(safeSynkroBin)}`);
5728
5738
  if (safeUserId) lines.push(`SYNKRO_USER_ID=${shellQuoteSingle(safeUserId)}`);
@@ -7158,7 +7168,7 @@ var args = process.argv.slice(2);
7158
7168
  var cmd = args[0] || "";
7159
7169
  var subArgs = args.slice(1);
7160
7170
  function printVersion() {
7161
- console.log("1.4.93");
7171
+ console.log("1.4.96");
7162
7172
  }
7163
7173
  function printHelp() {
7164
7174
  console.log(`Synkro CLI \u2014 runtime safety for AI coding agents