@miphamai/cli 0.19.2 → 0.19.4

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": "@miphamai/cli",
3
- "version": "0.19.2",
3
+ "version": "0.19.4",
4
4
  "description": "Mipham Code — Multi-model open-core intelligent coding terminal by MiphamAI",
5
5
  "keywords": [
6
6
  "ai",
package/src/mcp/oauth.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { randomBytes, createHash } from 'node:crypto'
2
+ import { exec } from 'node:child_process'
2
3
  import { createServer, Server } from 'node:http'
3
4
  import type { IncomingMessage, ServerResponse } from 'node:http'
4
5
  import type { McpServerConfig } from '../shared/types'
@@ -74,7 +75,6 @@ export class OAuthClient {
74
75
  : process.platform === 'win32'
75
76
  ? `start "" "${authUrl.toString()}"`
76
77
  : `xdg-open "${authUrl.toString()}"`
77
- const { exec } = require('node:child_process')
78
78
  exec(cmd, () => {
79
79
  /* fire-and-forget */
80
80
  })
@@ -1994,19 +1994,25 @@ const resumeLastCmd: CommandHandler = async () => {
1994
1994
  }
1995
1995
  }
1996
1996
 
1997
+ const MAX_RESUME = 30
1998
+ const truncated = session.messages.length > MAX_RESUME
1999
+ const messages = truncated ? session.messages.slice(-MAX_RESUME) : session.messages
2000
+
1997
2001
  const date = new Date(latest.updatedAt).toLocaleString()
1998
2002
  return {
1999
2003
  content: [
2000
2004
  '─ Session Restored ─',
2001
2005
  '',
2002
2006
  `Name: ${latest.name}`,
2003
- `Messages: ${session.messages.length}`,
2007
+ `Messages: ${session.messages.length} total${truncated ? ` (showing last ${MAX_RESUME})` : ''}`,
2004
2008
  `Provider: ${latest.provider} / ${latest.model}`,
2005
2009
  `Updated: ${date}`,
2006
2010
  '',
2007
- `${session.messages.length} messages loaded. Context has been restored.`,
2011
+ truncated
2012
+ ? `${messages.length} of ${session.messages.length} messages loaded. Older context summarized above.`
2013
+ : `${messages.length} messages loaded. Context has been restored.`,
2008
2014
  ].join('\n'),
2009
- forwardedMessages: session.messages,
2015
+ forwardedMessages: messages,
2010
2016
  }
2011
2017
  }
2012
2018