@ganglion/xacpx 0.20.0-beta.0 → 0.20.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.
@@ -44,7 +44,6 @@ var __export = (target, all) => {
44
44
  });
45
45
  };
46
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
- var __promiseAll = (args) => Promise.all(args);
48
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
49
48
 
50
49
  // src/adapters/hermes-shim.ts
@@ -44,7 +44,6 @@ var __export = (target, all) => {
44
44
  });
45
45
  };
46
46
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
47
- var __promiseAll = (args) => Promise.all(args);
48
47
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
49
48
 
50
49
  // src/process/windows-process-identity.ts
@@ -2168,7 +2167,12 @@ async function queryWindowsProcessIdentity(pid, options = {}) {
2168
2167
  if (item.pid !== pid || parseCanonicalFileTime(item.creationDate) === null || typeof item.executablePath !== "string" || !item.executablePath) {
2169
2168
  return null;
2170
2169
  }
2171
- return { pid, creationDate: String(item.creationDate), executablePath: item.executablePath };
2170
+ return {
2171
+ pid,
2172
+ creationDate: String(item.creationDate),
2173
+ executablePath: item.executablePath,
2174
+ ...typeof item.commandLine === "string" && item.commandLine ? { commandLine: item.commandLine } : {}
2175
+ };
2172
2176
  } catch {
2173
2177
  return null;
2174
2178
  }
@@ -2345,7 +2349,18 @@ if($request.action -eq 'identity'){
2345
2349
  try {
2346
2350
  $creation=[XacpxNativeProcess]::Creation($h);$image=[XacpxNativeProcess]::Image($h)
2347
2351
  if(!$creation -or !$image){Write-Output (@{status='unavailable'} | ConvertTo-Json -Compress);exit 0}
2348
- Write-Output (@{status='found';identity=@{pid=[int]$request.pid;creationDate=$creation;executablePath=$image}} | ConvertTo-Json -Depth 4 -Compress)
2352
+ $commandLine=$null
2353
+ try {
2354
+ $cim=Get-CimInstance Win32_Process -Filter ("ProcessId = "+[int]$request.pid)
2355
+ if($cim -and $cim.CreationDate){
2356
+ $cimCreation=$cim.CreationDate.ToUniversalTime().ToFileTimeUtc().ToString()
2357
+ $delta=[Numerics.BigInteger]::Abs([Numerics.BigInteger]::Parse($creation)-[Numerics.BigInteger]::Parse($cimCreation))
2358
+ if($delta -le 9 -and [string]::Equals([string]$image,[string]$cim.ExecutablePath,[StringComparison]::OrdinalIgnoreCase)){
2359
+ $commandLine=$cim.CommandLine
2360
+ }
2361
+ }
2362
+ } catch {}
2363
+ Write-Output (@{status='found';identity=@{pid=[int]$request.pid;creationDate=$creation;executablePath=$image;commandLine=$commandLine}} | ConvertTo-Json -Depth 4 -Compress)
2349
2364
  exit 0
2350
2365
  } finally {[XacpxNativeProcess]::Close($h)}
2351
2366
  }
@@ -4569,13 +4584,13 @@ var init_cli = __esm(() => {
4569
4584
  startFailed: (detail) => `xacpx failed to start: ${detail}`,
4570
4585
  running: "xacpx is running",
4571
4586
  notRunning: "xacpx is not running",
4572
- indeterminate: "xacpx process is still running but status metadata is missing",
4587
+ indeterminate: "xacpx process is still running but daemon metadata is incomplete or inconsistent",
4573
4588
  stopped: "xacpx stopped",
4574
4589
  restarting: "xacpx restarting...",
4575
4590
  restartNotRunning: "xacpx is not running, starting...",
4576
4591
  restartFailed: (detail) => `xacpx failed to restart: ${detail}`,
4577
- restartIndeterminate: "xacpx process is still running but status metadata is missing",
4578
- restartIndeterminateHint: "Run `xacpx stop` first, or manually clean up the stale PID/status before retrying.",
4592
+ restartIndeterminate: "xacpx process is still running but daemon metadata is incomplete or inconsistent",
4593
+ restartIndeterminateHint: "Verify the PID shown above and stop that process before retrying; do not delete runtime metadata while it is still alive.",
4579
4594
  checkAppLog: (path2) => `Check App Log: ${path2}`,
4580
4595
  checkStderrLog: (path2) => `Check Stderr: ${path2}`,
4581
4596
  workspaceEmpty: "No workspaces yet.",
@@ -5694,13 +5709,13 @@ var init_cli2 = __esm(() => {
5694
5709
  startFailed: (detail) => `xacpx 启动失败:${detail}`,
5695
5710
  running: "xacpx 正在运行",
5696
5711
  notRunning: "xacpx 未运行",
5697
- indeterminate: "xacpx 进程仍在运行,但状态元数据缺失",
5712
+ indeterminate: "xacpx 进程仍在运行,但 daemon 元数据不完整或不一致",
5698
5713
  stopped: "xacpx 已停止",
5699
5714
  restarting: "xacpx 正在重启...",
5700
5715
  restartNotRunning: "xacpx 未运行,正在启动...",
5701
5716
  restartFailed: (detail) => `xacpx 重启失败:${detail}`,
5702
- restartIndeterminate: "xacpx 进程仍在运行,但状态元数据缺失",
5703
- restartIndeterminateHint: "请先执行 `xacpx stop`,或手动清理 stale PID/status 后再重试。",
5717
+ restartIndeterminate: "xacpx 进程仍在运行,但 daemon 元数据不完整或不一致",
5718
+ restartIndeterminateHint: "请先核对上方 PID 并停止该进程;进程仍存活时不要删除 runtime 元数据。",
5704
5719
  checkAppLog: (path2) => `请查看 App Log: ${path2}`,
5705
5720
  checkStderrLog: (path2) => `请查看 Stderr: ${path2}`,
5706
5721
  workspaceEmpty: "还没有工作区。",
@@ -6216,6 +6231,9 @@ function resolveDaemonPaths(options) {
6216
6231
  function resolveRuntimeDirFromConfigPath(configPath) {
6217
6232
  return join7(dirname4(configPath), "runtime");
6218
6233
  }
6234
+ function resolveRuntimeConsumerLockPath(runtimeDir) {
6235
+ return join7(runtimeDir, RUNTIME_CONSUMER_LOCK_FILE);
6236
+ }
6219
6237
  function resolveDaemonOrchestrationSocketPath(runtimeDir, platform = process.platform) {
6220
6238
  return resolveOrchestrationEndpoint(runtimeDir, platform).path;
6221
6239
  }
@@ -6227,6 +6245,7 @@ function isProcessAlive(pid) {
6227
6245
  return error.code === "EPERM";
6228
6246
  }
6229
6247
  }
6248
+ var RUNTIME_CONSUMER_LOCK_FILE = "runtime-consumer.lock.json";
6230
6249
  var init_daemon_files = __esm(() => {
6231
6250
  init_core_home();
6232
6251
  init_orchestration_ipc();
@@ -94,6 +94,17 @@ export interface ConsumerLockMetadata {
94
94
  schemaVersion?: 2;
95
95
  lockId?: string;
96
96
  processCreationDate?: string | null;
97
+ processStartedAtMs?: number;
98
+ }
99
+ /**
100
+ * Shared conflict shape for runtime and channel compatibility locks. Keeping
101
+ * it in the generic channel contract lets the console report an active owner
102
+ * without importing a channel-specific implementation.
103
+ */
104
+ export declare class ActiveConsumerLockError extends Error {
105
+ readonly lockFilePath: string;
106
+ readonly existing: ConsumerLockMetadata;
107
+ constructor(message: string, lockFilePath: string, existing: ConsumerLockMetadata);
97
108
  }
98
109
  export interface ConsumerLock {
99
110
  acquire(meta: ConsumerLockMetadata): Promise<void>;