coder-config 0.42.26 → 0.42.28

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/README.md CHANGED
@@ -397,20 +397,17 @@ Context is automatically restored within 24 hours of being saved.
397
397
  ### Setup
398
398
 
399
399
  ```bash
400
- # Install the Claude Code hooks
401
- coder-config session install-hooks
402
-
403
- # Copy the /flush command to your Claude Code commands
404
- cp /path/to/coder-config/templates/commands/flush.md ~/.claude/commands/
400
+ coder-config session install
405
401
  ```
406
402
 
403
+ This installs the Claude Code hooks and the `/flush` command.
404
+
407
405
  ### CLI Commands
408
406
 
409
407
  ```bash
410
- coder-config session # Show session status
411
- coder-config session flush # Instructions for saving context
412
- coder-config session clear # Clear saved context
413
- coder-config session install-hooks # Install Claude Code hooks
408
+ coder-config session # Show session status
409
+ coder-config session install # Install hooks and /flush command
410
+ coder-config session clear # Clear saved context
414
411
  ```
415
412
 
416
413
  ### Storage Location
package/config-loader.js CHANGED
@@ -31,7 +31,7 @@ const { getProjectsRegistryPath, loadProjectsRegistry, saveProjectsRegistry, pro
31
31
  const { getWorkstreamsPath, loadWorkstreams, saveWorkstreams, workstreamList, workstreamCreate, workstreamUpdate, workstreamDelete, workstreamUse, workstreamActive, workstreamAddProject, workstreamRemoveProject, workstreamInject, workstreamDetect, workstreamGet, getActiveWorkstream, countWorkstreamsForProject, workstreamInstallHook, workstreamInstallHookGemini, workstreamInstallHookCodex, workstreamDeactivate, workstreamCheckPath, getSettingsPath, loadSettings, saveSettings, workstreamAddTrigger, workstreamRemoveTrigger, workstreamSetAutoActivate, setGlobalAutoActivate, shouldAutoActivate, workstreamCheckFolder, workstreamInstallCdHook, workstreamUninstallCdHook, workstreamCdHookStatus } = require('./lib/workstreams');
32
32
  const { getActivityPath, getDefaultActivity, loadActivity, saveActivity, detectProjectRoot, activityLog, activitySummary, generateWorkstreamName, activitySuggestWorkstreams, activityClear } = require('./lib/activity');
33
33
  const { getLoopsPath, loadLoops, saveLoops, loadLoopState, saveLoopState, loadHistory, saveHistory, loopList, loopCreate, loopGet, loopUpdate, loopDelete, loopStart, loopPause, loopResume, loopCancel, loopApprove, loopComplete, loopStatus, loopHistory, loopConfig, getActiveLoop, recordIteration, saveClarifications, savePlan, loadClarifications, loadPlan, loopInject, archiveLoop } = require('./lib/loops');
34
- const { getSessionStatus, showSessionStatus, flushContext, clearContext, installHooks: sessionInstallHooks, getFlushedContext, SESSION_DIR, FLUSHED_CONTEXT_FILE } = require('./lib/sessions');
34
+ const { getSessionStatus, showSessionStatus, flushContext, clearContext, installHooks: sessionInstallHooks, getFlushedContext, installFlushCommand, installAll: sessionInstallAll, SESSION_DIR, FLUSHED_CONTEXT_FILE } = require('./lib/sessions');
35
35
  const { runCli } = require('./lib/cli');
36
36
 
37
37
  class ClaudeConfigManager {
@@ -212,6 +212,8 @@ class ClaudeConfigManager {
212
212
  sessionFlush() { return flushContext(); }
213
213
  sessionClear() { return clearContext(); }
214
214
  sessionInstallHooks() { return sessionInstallHooks(); }
215
+ sessionInstallCommand() { return installFlushCommand(); }
216
+ sessionInstall() { return sessionInstallAll(); }
215
217
  getFlushedContext() { return getFlushedContext(); }
216
218
  getSessionDir() { return SESSION_DIR; }
217
219
  getFlushedContextPath() { return FLUSHED_CONTEXT_FILE; }
package/lib/cli.js CHANGED
@@ -280,6 +280,10 @@ function runCli(manager) {
280
280
  manager.sessionClear();
281
281
  } else if (args[1] === 'install-hooks') {
282
282
  manager.sessionInstallHooks();
283
+ } else if (args[1] === 'install-command') {
284
+ manager.sessionInstallCommand();
285
+ } else if (args[1] === 'install') {
286
+ manager.sessionInstall();
283
287
  } else {
284
288
  manager.sessionStatus();
285
289
  }
@@ -407,9 +411,8 @@ Workstream Commands:
407
411
  ${loopHelp}
408
412
  Session Persistence:
409
413
  session Show session status (saved context)
410
- session flush Manually save current context
414
+ session install Install hooks and /flush command
411
415
  session clear Clear saved session context
412
- session install-hooks Install Claude Code hooks for session persistence
413
416
 
414
417
  Registry Commands:
415
418
  registry List MCPs in global registry
package/lib/constants.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Constants and tool path configurations
3
3
  */
4
4
 
5
- const VERSION = '0.42.26';
5
+ const VERSION = '0.42.28';
6
6
 
7
7
  // Tool-specific path configurations
8
8
  const TOOL_PATHS = {
package/lib/sessions.js CHANGED
@@ -250,6 +250,66 @@ function getFlushedContext() {
250
250
  return null;
251
251
  }
252
252
 
253
+ /**
254
+ * Install the /flush command to ~/.claude/commands/
255
+ */
256
+ function installFlushCommand() {
257
+ const claudeDir = path.join(os.homedir(), '.claude');
258
+ const commandsDir = path.join(claudeDir, 'commands');
259
+ const destFile = path.join(commandsDir, 'flush.md');
260
+
261
+ // Find the template
262
+ const templateFile = path.join(__dirname, '..', 'templates', 'commands', 'flush.md');
263
+
264
+ if (!fs.existsSync(templateFile)) {
265
+ console.error('Flush command template not found.');
266
+ console.log(`Expected: ${templateFile}`);
267
+ return false;
268
+ }
269
+
270
+ // Ensure commands directory exists
271
+ if (!fs.existsSync(commandsDir)) {
272
+ fs.mkdirSync(commandsDir, { recursive: true });
273
+ }
274
+
275
+ // Check if command already exists
276
+ if (fs.existsSync(destFile)) {
277
+ const existing = fs.readFileSync(destFile, 'utf8');
278
+ const template = fs.readFileSync(templateFile, 'utf8');
279
+ if (existing === template) {
280
+ console.log('/flush command already installed.');
281
+ return true;
282
+ }
283
+ // Backup existing
284
+ const backupFile = path.join(commandsDir, 'flush.md.bak');
285
+ fs.copyFileSync(destFile, backupFile);
286
+ console.log(`Backed up existing /flush to ${backupFile}`);
287
+ }
288
+
289
+ // Copy template
290
+ fs.copyFileSync(templateFile, destFile);
291
+ console.log('/flush command installed to ~/.claude/commands/flush.md');
292
+ return true;
293
+ }
294
+
295
+ /**
296
+ * Install everything needed for session persistence
297
+ */
298
+ function installAll() {
299
+ console.log('Installing session persistence...\n');
300
+
301
+ // Install hooks
302
+ installHooks();
303
+
304
+ console.log('');
305
+
306
+ // Install command
307
+ installFlushCommand();
308
+
309
+ console.log('\nSession persistence setup complete!');
310
+ console.log('Use /flush in Claude Code to save context before exiting.');
311
+ }
312
+
253
313
  module.exports = {
254
314
  getSessionStatus,
255
315
  showSessionStatus,
@@ -257,6 +317,8 @@ module.exports = {
257
317
  clearContext,
258
318
  installHooks,
259
319
  getFlushedContext,
320
+ installFlushCommand,
321
+ installAll,
260
322
  SESSION_DIR,
261
323
  FLUSHED_CONTEXT_FILE,
262
324
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder-config",
3
- "version": "0.42.26",
3
+ "version": "0.42.28",
4
4
  "description": "Configuration manager for AI coding tools - Claude Code, Gemini CLI, Codex CLI, Antigravity. Manage MCPs, rules, permissions, memory, and workstreams.",
5
5
  "author": "regression.io",
6
6
  "main": "config-loader.js",