delimit-cli 4.1.8 → 4.1.10

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.
@@ -322,12 +322,18 @@ function installClaudeHooks(tool, hookConfig) {
322
322
  const changes = [];
323
323
 
324
324
  // --- SessionStart hook (no condition) ---
325
+ // Always update to latest version (reinstall-safe)
325
326
  if (hookConfig.session_start) {
326
327
  if (!config.hooks.SessionStart) {
327
328
  config.hooks.SessionStart = [];
328
329
  }
329
330
  const existing = findClaudeHookGroup(config.hooks.SessionStart, 'delimit-cli hook session-start');
330
- if (!existing) {
331
+ if (existing) {
332
+ // Remove old entry so we can replace it
333
+ const idx = config.hooks.SessionStart.indexOf(existing);
334
+ if (idx >= 0) config.hooks.SessionStart.splice(idx, 1);
335
+ }
336
+ {
331
337
  config.hooks.SessionStart.push({
332
338
  matcher: '',
333
339
  hooks: [{
@@ -796,9 +802,23 @@ async function hookSessionStart() {
796
802
  const lines = [];
797
803
  lines.push('=== Delimit Status ===');
798
804
 
799
- // Server status + tool count
800
805
  const home = getHome();
801
- const serverFile = path.join(home, '.delimit', 'server', 'ai', 'server.py');
806
+ const delimitHome = path.join(home, '.delimit');
807
+ const cwd = process.cwd();
808
+
809
+ // Governance status + policy source
810
+ const projectPolicy = fs.existsSync(path.join(cwd, 'delimit.yml')) || fs.existsSync(path.join(cwd, '.delimit', 'policies.yml'));
811
+ const userPolicy = fs.existsSync(path.join(delimitHome, 'delimit.yml'));
812
+ if (projectPolicy) {
813
+ lines.push('Governance: active | policy=project');
814
+ } else if (userPolicy) {
815
+ lines.push('Governance: active | policy=user');
816
+ } else {
817
+ lines.push('Governance: not initialized -- run npx delimit-cli init');
818
+ }
819
+
820
+ // Server status + tool count
821
+ const serverFile = path.join(delimitHome, 'server', 'ai', 'server.py');
802
822
  if (fs.existsSync(serverFile)) {
803
823
  try {
804
824
  const content = fs.readFileSync(serverFile, 'utf-8');
@@ -811,20 +831,43 @@ async function hookSessionStart() {
811
831
  lines.push('Server: not installed -- run npx delimit-cli setup');
812
832
  }
813
833
 
814
- // Governance status
815
- const cwd = process.cwd();
816
- const hasPolicy = fs.existsSync(path.join(cwd, 'delimit.yml'))
817
- || fs.existsSync(path.join(cwd, '.delimit.yml'))
818
- || fs.existsSync(path.join(cwd, '.delimit', 'policies.yml'));
834
+ // Hooks + audit
835
+ const settingsFile = path.join(home, '.claude', 'settings.json');
836
+ const hooksEnabled = fs.existsSync(settingsFile) && fs.readFileSync(settingsFile, 'utf-8').includes('"hooks"');
837
+ const auditOn = fs.existsSync(path.join(delimitHome, 'audit'));
838
+ lines.push(`Hooks: ${hooksEnabled ? 'enabled' : 'disabled'} | Audit: ${auditOn ? 'on' : 'off'}`);
839
+
840
+ // MCP registration
841
+ const mcpFile = path.join(home, '.mcp.json');
842
+ const mcpRegistered = fs.existsSync(mcpFile) && fs.readFileSync(mcpFile, 'utf-8').includes('delimit');
843
+ lines.push(`MCP: ${mcpRegistered ? 'delimit registered' : 'not registered -- run npx delimit-cli setup'}`);
819
844
 
820
- if (hasPolicy) {
821
- lines.push('Governance: active');
845
+ // Deliberation models
846
+ const modelsFile = path.join(delimitHome, 'models.json');
847
+ const modelNames = [];
848
+ try {
849
+ if (fs.existsSync(modelsFile)) {
850
+ const models = JSON.parse(fs.readFileSync(modelsFile, 'utf-8'));
851
+ for (const [key, val] of Object.entries(models)) {
852
+ if (val && val.enabled) modelNames.push(val.name || key);
853
+ }
854
+ }
855
+ } catch {}
856
+ // Also check env vars for available models
857
+ if (modelNames.length === 0) {
858
+ const envModels = [];
859
+ if (process.env.XAI_API_KEY) envModels.push('Grok');
860
+ if (process.env.GOOGLE_APPLICATION_CREDENTIALS) envModels.push('Gemini');
861
+ if (process.env.OPENAI_API_KEY) envModels.push('Codex');
862
+ if (envModels.length > 0) {
863
+ lines.push(`Deliberation: ${envModels.join(' + ')}`);
864
+ }
822
865
  } else {
823
- lines.push('Governance: not initialized -- run npx delimit-cli init');
866
+ lines.push(`Deliberation: ${modelNames.join(' + ')}`);
824
867
  }
825
868
 
826
869
  // Last session context (prevents cross-session drift)
827
- const sessionsDir = path.join(home, '.delimit', 'sessions');
870
+ const sessionsDir = path.join(delimitHome, 'sessions');
828
871
  try {
829
872
  if (fs.existsSync(sessionsDir)) {
830
873
  const sessions = fs.readdirSync(sessionsDir).filter(f => f.startsWith('session_')).sort().reverse();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "delimit-cli",
3
3
  "mcpName": "io.github.delimit-ai/delimit-mcp-server",
4
- "version": "4.1.8",
4
+ "version": "4.1.10",
5
5
  "description": "Unify Claude Code, Codex, Cursor, and Gemini CLI with persistent context, governance, and multi-model debate.",
6
6
  "main": "index.js",
7
7
  "files": [