cf-memory-mcp 3.43.0 → 3.44.0

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.
@@ -3967,6 +3967,8 @@ function parseCliArgs(rest) {
3967
3967
  flags.copy = true;
3968
3968
  } else if (a === '--card') {
3969
3969
  flags.card = true;
3970
+ } else if (a === '--short') {
3971
+ flags.short = true;
3970
3972
  } else if (a === '--older-than') {
3971
3973
  // Accept "7d" / "30d" / "12h" / raw number (days).
3972
3974
  const raw = rest[++i] || '';
@@ -4129,6 +4131,19 @@ async function runResumeCli() {
4129
4131
  process.exit(0);
4130
4132
  }
4131
4133
 
4134
+ // --short: single line for tmux/status bars. "goal · status"
4135
+ // truncated to terminal-friendly length.
4136
+ if (flags.short) {
4137
+ const envelope = payload.resume_handoff;
4138
+ if (!envelope) process.exit(3);
4139
+ const h = envelope.handoff || {};
4140
+ const goal = (h.goal || '(no goal)').slice(0, 60);
4141
+ const status = h.status || '?';
4142
+ const stale = envelope.stale ? ' [STALE]' : '';
4143
+ process.stdout.write(`${goal} · ${status}${stale}\n`);
4144
+ process.exit(0);
4145
+ }
4146
+
4132
4147
  // --card: compact 2-3 line summary card for status widgets.
4133
4148
  // Format: [status · age · q=score] goal / → next_step
4134
4149
  if (flags.card) {
@@ -4750,10 +4765,41 @@ function runEnvCli() {
4750
4765
 
4751
4766
  function runCompletionCli() {
4752
4767
  const shell = process.argv[3] || 'bash';
4768
+ const install = process.argv.includes('--install');
4753
4769
  const commands = ['resume', 'list', 'history', 'checkpoint', 'link', 'status', 'clean', 'export', 'import', 'delete', 'doctor', 'env', 'completion'];
4754
4770
  const flags = ['--json', '-j', '--limit', '-n', '--md', '--all', '--force', '-f', '--version', '-v', '--help', '-h', '--diagnose'];
4771
+
4772
+ // Determine the install target for each shell. Use user-local paths
4773
+ // only (no sudo). Caller can override via stdout-redirect when
4774
+ // --install isn't used.
4775
+ const installTarget = (() => {
4776
+ const home = os.homedir();
4777
+ if (shell === 'bash') {
4778
+ // Prefer ~/.bash_completion.d/ if it exists; fall back to ~/.bash_completion.
4779
+ const dir = path.join(home, '.bash_completion.d');
4780
+ return fs.existsSync(dir) ? path.join(dir, 'cf-memory-mcp') : path.join(home, '.bash_completion');
4781
+ }
4782
+ if (shell === 'zsh') {
4783
+ // Honor $ZSH_CUSTOM/plugins or ~/.zsh/completions/
4784
+ const zdir = process.env.ZSH_CUSTOM
4785
+ ? path.join(process.env.ZSH_CUSTOM, 'plugins', 'cf-memory-mcp')
4786
+ : path.join(home, '.zsh', 'completions');
4787
+ return path.join(zdir, '_cf-memory-mcp');
4788
+ }
4789
+ if (shell === 'fish') {
4790
+ return path.join(home, '.config', 'fish', 'completions', 'cf-memory-mcp.fish');
4791
+ }
4792
+ if (shell === 'powershell' || shell === 'pwsh') {
4793
+ return path.join(home, '.config', 'powershell', 'cf-memory-mcp.ps1');
4794
+ }
4795
+ return null;
4796
+ })();
4797
+ // Buffer the output so we can either print or write-to-disk.
4798
+ let output = '';
4799
+ const emit = (chunk) => { output += chunk; };
4800
+
4755
4801
  if (shell === 'bash') {
4756
- process.stdout.write(`# cf-memory-mcp bash completion
4802
+ emit(`# cf-memory-mcp bash completion
4757
4803
  # Install: cf-memory-mcp completion bash > /usr/local/etc/bash_completion.d/cf-memory-mcp
4758
4804
  # Or for the current shell: source <(cf-memory-mcp completion bash)
4759
4805
  _cf_memory_mcp_complete() {
@@ -4775,7 +4821,7 @@ complete -F _cf_memory_mcp_complete cf-memory-mcp
4775
4821
  complete -F _cf_memory_mcp_complete cfm
4776
4822
  `);
4777
4823
  } else if (shell === 'zsh') {
4778
- process.stdout.write(`# cf-memory-mcp zsh completion
4824
+ emit(`# cf-memory-mcp zsh completion
4779
4825
  # Install: cf-memory-mcp completion zsh > "\${fpath[1]}/_cf-memory-mcp" && compinit
4780
4826
  # Or for the current shell: source <(cf-memory-mcp completion zsh)
4781
4827
  #compdef cf-memory-mcp cfm
@@ -4796,7 +4842,7 @@ _cf_memory_mcp() {
4796
4842
  _cf_memory_mcp "\$@"
4797
4843
  `);
4798
4844
  } else if (shell === 'powershell' || shell === 'pwsh') {
4799
- process.stdout.write(`# cf-memory-mcp PowerShell completion
4845
+ emit(`# cf-memory-mcp PowerShell completion
4800
4846
  # Install: cf-memory-mcp completion powershell | Out-String | Invoke-Expression
4801
4847
  # To persist: add the above to your $PROFILE
4802
4848
  Register-ArgumentCompleter -Native -CommandName cf-memory-mcp,cfm -ScriptBlock {
@@ -4816,7 +4862,7 @@ Register-ArgumentCompleter -Native -CommandName cf-memory-mcp,cfm -ScriptBlock {
4816
4862
  }
4817
4863
  `);
4818
4864
  } else if (shell === 'fish') {
4819
- process.stdout.write(`# cf-memory-mcp fish completion
4865
+ emit(`# cf-memory-mcp fish completion
4820
4866
  # Install: cf-memory-mcp completion fish > ~/.config/fish/completions/cf-memory-mcp.fish
4821
4867
  ${commands.map(c => `complete -c cf-memory-mcp -n '__fish_use_subcommand' -a '${c}' -d '${c} command'`).join('\n')}
4822
4868
  ${commands.map(c => `complete -c cfm -n '__fish_use_subcommand' -a '${c}' -d '${c} command'`).join('\n')}
@@ -4831,6 +4877,31 @@ complete -c cf-memory-mcp -l version -s v -d 'Show version'
4831
4877
  process.stderr.write(`Unknown shell "${shell}". Supported: bash, zsh, fish, powershell.\n`);
4832
4878
  process.exit(1);
4833
4879
  }
4880
+
4881
+ // Either install to a user-local path or print to stdout.
4882
+ if (install) {
4883
+ if (!installTarget) {
4884
+ process.stderr.write(`No install target for shell ${shell}.\n`);
4885
+ process.exit(1);
4886
+ }
4887
+ try {
4888
+ const dir = path.dirname(installTarget);
4889
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
4890
+ fs.writeFileSync(installTarget, output);
4891
+ process.stderr.write(`Installed ${shell} completion to ${installTarget}\n`);
4892
+ if (shell === 'bash') {
4893
+ process.stderr.write(`Add to ~/.bashrc to autoload: source ${installTarget}\n`);
4894
+ } else if (shell === 'zsh') {
4895
+ const dirToFpath = path.dirname(installTarget);
4896
+ process.stderr.write(`Add to ~/.zshrc:\n fpath=(${dirToFpath} $fpath)\n autoload -Uz compinit && compinit\n`);
4897
+ }
4898
+ } catch (err) {
4899
+ process.stderr.write(`Failed to install: ${err.message}\n`);
4900
+ process.exit(1);
4901
+ }
4902
+ } else {
4903
+ process.stdout.write(output);
4904
+ }
4834
4905
  process.exit(0);
4835
4906
  }
4836
4907
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-memory-mcp",
3
- "version": "3.43.0",
3
+ "version": "3.44.0",
4
4
  "description": "Cloudflare-hosted MCP server for code indexing, retrieval, and assistant memory with a direct remote MCP endpoint and local stdio bridge.",
5
5
  "main": "bin/cf-memory-mcp.js",
6
6
  "bin": {