@mobius-os/mobius 0.3.2 → 0.3.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": "@mobius-os/mobius",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "Mobius terminal client. Reuses Mobius frontend TypeScript types and jsonl entry shapes.",
6
6
  "bin": {
package/src/aimux.ts CHANGED
@@ -261,7 +261,7 @@ export class AimuxSupervisor {
261
261
  onStatus({ state: 'starting', phase: 'connecting', detail: '正在连接 Mobius AIMUX bridge…', identifier, attempt: this.reconnectAttempt })
262
262
  const child = this.opts.spawnProcess?.() ?? spawn(
263
263
  aimuxExe(),
264
- ['reverse', 'connect', `${server.replace(/\/$/, '')}/aimux_bridge`, '--identifier', identifier, '--token', token, '--replace'],
264
+ ['reverse', 'connect', `${server.replace(/\/$/, '')}/aimux_bridge`, '--identifier', identifier, '--token', token, '--replace', ...(process.platform === 'win32' ? ['--silent-shell'] : [])],
265
265
  { windowsHide: true },
266
266
  )
267
267
  this.child = child
@@ -35,7 +35,8 @@ interface TerminalSize {
35
35
  isTty: boolean
36
36
  }
37
37
 
38
- const VERSION = '0.2.8'
38
+ import { createRequire } from 'node:module'
39
+ const VERSION = createRequire(import.meta.url)('../../package.json').version
39
40
 
40
41
  const SLASH_COMMANDS = [
41
42
  { cmd: '/clear', desc: '清空当前对话,开启新会话' },
@@ -46,7 +46,7 @@ export function TextInput(props: TextInputProps) {
46
46
  if (key.return) { props.onSubmit?.(); return }
47
47
  if (key.upArrow) { props.onArrowUp?.(); return }
48
48
  if (key.downArrow) { props.onArrowDown?.(); return }
49
- if (key.escape) { props.onEscape?.(); return }
49
+ if (key.escape || input === '\x1b') { props.onEscape?.(); return }
50
50
  if (key.tab) { props.onTab?.(); return }
51
51
  // Ink labels the \x7f that virtually every terminal's Backspace key emits
52
52
  // as `key.delete` (see its parse-keypress.js TODO). Treat either signal as
package/src/main.tsx CHANGED
@@ -10,4 +10,4 @@ import React from 'react'
10
10
  import { render } from 'ink'
11
11
  import { App } from './App.js'
12
12
 
13
- render(React.createElement(App), { exitOnCtrlC: false })
13
+ render(React.createElement(App), { exitOnCtrlC: true })