auto(bfc0cfa2c3a4): session end @ 2026-07-20T13:01:24 (+1f)

This commit is contained in:
ssw committed 2026-07-20 13:01:25 +08:00
1 parent 3d45ac8f3b
commit 7a69fe2f33
1 file changed
+9 -2
+9 -2
View File
@@ -39,8 +39,9 @@ import { Command } from 'commander'
import { chromium, Browser, BrowserContext, Page } from 'playwright'
import { execSync } from 'child_process'
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { dirname, join, resolve } from 'node:path'
import { homedir } from 'node:os'
import { fileURLToPath } from 'node:url'
import { log } from '../../core/log.ts'
import { JnpfClient } from '../../core/client.ts'
@@ -809,8 +810,14 @@ Prerequisites (workflow module):
}
// 拿 token (dacli app context --json, 备用 — JnpfClient.fromToken 已用 cached)
// Fix: 用绝对路径 + dacli 源码根目录 cwd, 不要用 process.cwd() 相对 src/cli.ts (会 ERR_MODULE_NOT_FOUND)
// Path: dacli/src/commands/test/browser.ts → ../../../ 才是 cli.ts
// ESM: __dirname 不可用, 用 import.meta.url 替代
const __filename = fileURLToPath(import.meta.url)
const __dirname2 = dirname(__filename)
const DACLI_ROOT = resolve(__dirname2, '..', '..', '..')
const tokenRaw = execSync('npx tsx src/cli.ts app context --json', {
cwd: process.cwd(),
cwd: DACLI_ROOT,
encoding: 'utf-8',
})
const ctx = JSON.parse(tokenRaw)