@cocorograph/hub-agent 0.8.30 → 0.8.31

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": "@cocorograph/hub-agent",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの Claude / Codex チャットと tmux セッションを中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -76,9 +76,18 @@ export const DELEGATION_LEDGER_RETENTION_MS = 24 * 60 * 60 * 1000
76
76
 
77
77
  const execFile = promisify(execFileCallback)
78
78
 
79
+ /**
80
+ * `ps` の起動時刻を送受信双方で比較する契約形へ正規化する。
81
+ * 先頭・末尾の Unicode 空白だけを除去し、日時本体の内部空白は変更しない。
82
+ * 正本は Hub の `codex_agent.py:_normalize_process_started_at`。
83
+ */
84
+ export function normalizeProcessStartedAt(raw) {
85
+ return raw.trim()
86
+ }
87
+
79
88
  async function defaultPidStartedAt(pid) {
80
89
  const { stdout } = await execFile("ps", ["-o", "lstart=", "-p", String(pid)])
81
- return stdout.replace(/\r?\n$/, "")
90
+ return normalizeProcessStartedAt(stdout)
82
91
  }
83
92
 
84
93
  const DELIVERY_UNCONFIRMED_HINT =
@@ -352,7 +361,10 @@ export class SiblingInjectBridge {
352
361
  if (err?.code !== "EPERM") return true
353
362
  }
354
363
  try {
355
- return (await this._pidStartedAt(event.pid)) === event.pid_started_at
364
+ return (
365
+ normalizeProcessStartedAt(await this._pidStartedAt(event.pid)) ===
366
+ normalizeProcessStartedAt(event.pid_started_at)
367
+ )
356
368
  } catch {
357
369
  return true
358
370
  }