@jacexh/claude-web-console 0.7.5 → 0.7.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacexh/claude-web-console",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Web-based console for Claude Code — manage sessions, switch models, preview artifacts",
5
5
  "type": "module",
6
6
  "bin": {
@@ -132,6 +132,13 @@ export class SessionManager {
132
132
  private pendingRemaps = new Map<string, { sessionIdRef: { current: string } }>()
133
133
  // Track cwd for each session so we can resume in the correct project
134
134
  private sessionCwds = new Map<string, string>()
135
+ /** User-supplied creation options that must survive resume cycles */
136
+ private sessionCreationOptions = new Map<string, {
137
+ model?: string
138
+ permissionMode?: string
139
+ executableArgs?: string[]
140
+ env?: Record<string, string>
141
+ }>()
135
142
  // Cache commands extracted from SDK init messages
136
143
  private sessionCommands = new Map<string, { name: string; description: string }[]>()
137
144
  // Active stream (Query) references for control requests like setModel
@@ -344,6 +351,12 @@ export class SessionManager {
344
351
  const tempId = `pending-${Date.now()}`
345
352
  this.sessions.set(tempId, session)
346
353
  this.sessionCwds.set(tempId, cwd)
354
+ this.sessionCreationOptions.set(tempId, {
355
+ model: options?.model,
356
+ permissionMode: options?.permissionMode,
357
+ executableArgs: options?.executableArgs,
358
+ env: options?.env,
359
+ })
347
360
 
348
361
  // Store tempId in pendingRemaps for remap inside consumeStream
349
362
  this.pendingRemaps.set(tempId, { sessionIdRef })
@@ -477,6 +490,8 @@ export class SessionManager {
477
490
  if (s) { this.sessions.delete(tempId); this.sessions.set(sessionId, s) }
478
491
  const c = this.sessionCwds.get(tempId)
479
492
  if (c) { this.sessionCwds.delete(tempId); this.sessionCwds.set(sessionId, c) }
493
+ const opts = this.sessionCreationOptions.get(tempId)
494
+ if (opts) { this.sessionCreationOptions.delete(tempId); this.sessionCreationOptions.set(sessionId, opts) }
480
495
  const listeners = this.sessionListeners.get(tempId)
481
496
  if (listeners) { this.sessionListeners.delete(tempId); this.sessionListeners.set(sessionId, listeners) }
482
497
  this.streamingSessionIds.delete(tempId)
@@ -731,16 +746,20 @@ export class SessionManager {
731
746
  }
732
747
  this.closedSessionIds.delete(sessionId)
733
748
 
734
- // Use the cached cwd from listSessions so claude spawns in the correct project
749
+ // Use the cached cwd and creation options so claude spawns with the correct config
735
750
  const cwd = this.sessionCwds.get(sessionId)
751
+ const cached = this.sessionCreationOptions.get(sessionId)
736
752
  const resumeSessionIdRef = { current: sessionId }
753
+ const pluginArgs = getPluginDirArgs()
754
+ const userArgs = cached?.executableArgs ?? []
737
755
  const sessionOptions = {
738
- permissionMode: 'default',
756
+ ...(cached?.model ? { model: cached.model } : {}),
757
+ permissionMode: cached?.permissionMode ?? 'default',
739
758
  canUseTool: this.buildCanUseTool(resumeSessionIdRef),
740
759
  onElicitation: this.buildOnElicitation(resumeSessionIdRef),
741
- env: cleanEnv(cwd),
760
+ env: { ...cleanEnv(cwd), ...cached?.env },
742
761
  pathToClaudeCodeExecutable: CLAUDE_EXECUTABLE,
743
- executableArgs: getPluginDirArgs(),
762
+ executableArgs: [...pluginArgs, ...userArgs],
744
763
  } as unknown as SDKSessionOptions
745
764
 
746
765
  const originalCwd = process.cwd()