dsh-ris-ide 1.8.5 → 1.8.6

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/lib/client.js CHANGED
@@ -11287,7 +11287,7 @@ var [ui, setUi] = useState(function () {
11287
11287
  }, {
11288
11288
  icon: true, width: 25, off: true, disabled: siteBusyId === program.id, action: 'console-open-site',
11289
11289
  title: '在系统浏览器打开 ' + program.name + ' 的页面'
11290
- + (ydsProject ? '(yds 项目:请求自动带上登录 token,免登录)' : ''),
11290
+ + (ydsProject ? '(yds 项目:点 🌐 用专用调试浏览器打开工作台,模块由扩展指向本地 dev server)' : ''),
11291
11291
  })
11292
11292
  : null,
11293
11293
  program.kind === 'spring' ? button(ideBadgeIcon('bug', 'play', 13), function (event) { event.stopPropagation(); void consoleDebug(program) }, { icon: true, width: 25, debug: true, off: ui.busy, action: 'console-debug', title: '调试 ' + program.name }) : null,
@@ -15239,10 +15239,13 @@ var [ui, setUi] = useState(function () {
15239
15239
  }
15240
15240
 
15241
15241
  /**
15242
- * Open one program in the user's own browser (🌐).
15242
+ * Open one program (🌐).
15243
15243
  *
15244
- * A browser page cannot add headers to the tab it opens, so the token work
15245
- * lives on the host side (dsh-ris-yds' proxy) and this only asks where to go.
15244
+ * The host decides what "open" means, because the two cases differ: a plain
15245
+ * program's own page is a `window.open` away, while a yds front-end opens its
15246
+ * workbench in yds' dedicated debugging browser (extension + CDP) — a tab
15247
+ * opened here could carry neither, and the workbench needs them to point the
15248
+ * module at the local dev server.
15246
15249
  */
15247
15250
  function openSite(program) {
15248
15251
  if (busySiteId !== undefined) return
@@ -15260,8 +15263,8 @@ var [ui, setUi] = useState(function () {
15260
15263
  setState(function (prev) {
15261
15264
  return Object.assign({}, prev, {
15262
15265
  note: result.pid !== undefined
15263
- ? '已在专用调试浏览器打开(pid ' + result.pid + ',DevTools 127.0.0.1:' + result.port + ')'
15264
- : '已在专用调试浏览器打开',
15266
+ ? '已在专用调试浏览器打开工作台(pid ' + result.pid + ',DevTools 127.0.0.1:' + result.port + ')'
15267
+ : '已在专用调试浏览器打开工作台',
15265
15268
  })
15266
15269
  })
15267
15270
  return
@@ -15572,7 +15575,7 @@ var [ui, setUi] = useState(function () {
15572
15575
  type: 'button', style: busySiteId === program.id ? S.paneIconOff : S.paneIcon, disabled: busySiteId === program.id,
15573
15576
  'data-action': 'open-site',
15574
15577
  title: '在系统浏览器打开 ' + program.name + ' 的页面'
15575
- + (ydsProject ? '(yds 项目:请求自动带上登录 token,免登录)' : ''),
15578
+ + (ydsProject ? '(yds 项目:点 🌐 用专用调试浏览器打开工作台,模块由扩展指向本地 dev server)' : ''),
15576
15579
  onClick: function (event) {
15577
15580
  event.stopPropagation()
15578
15581
  openSite(program)
@@ -15905,7 +15908,7 @@ var [ui, setUi] = useState(function () {
15905
15908
  type: 'button', style: busySiteId === program.id ? S.paneIconOff : S.buttonOff, 'data-action': 'open-site',
15906
15909
  disabled: busySiteId === program.id,
15907
15910
  title: '在系统浏览器打开 ' + program.name + ' 的页面'
15908
- + (ydsProject ? '(yds 项目:请求自动带上登录 token,免登录)' : ''),
15911
+ + (ydsProject ? '(yds 项目:点 🌐 用专用调试浏览器打开工作台,模块由扩展指向本地 dev server)' : ''),
15909
15912
  onClick: function (event) { event.stopPropagation(); openSite(program) },
15910
15913
  }, busySiteId === program.id ? '…' : '🌐')
15911
15914
  : null,
package/lib/index.js CHANGED
@@ -4026,13 +4026,27 @@ function describe(error) {
4026
4026
  * @param options - `{ restrictToCwd }` (see {@link apply}).
4027
4027
  */
4028
4028
  /**
4029
- * Resolve the URL "open in browser" should use for one program.
4029
+ * Open one program in a browser: the URL it printed, or — for a yds front-end —
4030
+ * that front-end's WORKBENCH in yds' own debugging browser.
4030
4031
  *
4031
- * The dev-server URL the program printed into its own log (webpack/vite always do)
4032
- * is the answer. dsh-ris-yds may then wrap it — but ONLY when the program is one of
4033
- * the yds front-ends the workspace declares, and it is told which one (m00555);
4034
- * otherwise the page opens directly (m00462). A missing/failing yds plugin never
4035
- * blocks the button: ris-ide keeps working without it.
4032
+ * Two different pages, because the two cases need different browsers:
4033
+ *
4034
+ * - A plain program (npm app, spring service) prints the page it serves; opening it
4035
+ * in the browser you are already using is enough.
4036
+ * - A yds front-end does NOT live on its dev server. Its page is the workbench, and
4037
+ * what makes it local is that the module's extend bundle is rewritten to the dev
4038
+ * server — by yds' extension, which a `window.open` tab cannot get. So the button
4039
+ * asks dsh-ris-yds to open the workbench in its debugging browser (CDP on :9222,
4040
+ * extension preloaded); that browser brings its own rdbga, so the page's requests
4041
+ * come back to this machine (m0xxx — the previous behaviour opened the raw dev
4042
+ * URL, which for a yds front-end is a page without platform chrome, session, or
4043
+ * the module's data).
4044
+ *
4045
+ * The dev URL is still handed to yds, but only as evidence of WHERE that front-end's
4046
+ * dev server actually listens — the declared `localDevUrl` port goes stale, and the
4047
+ * extension has to follow the live one. A missing yds plugin, or a plugin that
4048
+ * answers nothing, falls back to the plain dev-server page: the button never fails
4049
+ * just because yds is absent.
4036
4050
  */
4037
4051
  async function serveOpenTarget(ctx, req, res, options) {
4038
4052
  try {
@@ -4047,28 +4061,29 @@ async function serveOpenTarget(ctx, req, res, options) {
4047
4061
  let program = await findProgramById(cwd, logsDir, wanted)
4048
4062
  if (program === null) throw new TailError('not-found', `没有找到程序「${wanted.id || wanted.name}」,刷新程序列表后再试`, 404)
4049
4063
  const devUrl = await logUrl(program.logPath)
4050
- if (devUrl === undefined) {
4051
- writeJson(res, 200, {
4052
- ok: false,
4053
- code: 'no-url',
4054
- message: '这个程序还没打印出访问地址:先启动它,日志里出现 Local: http://localhost:<端口> 后再点',
4055
- })
4056
- return
4057
- }
4058
- // The 🌐 button opens the dev-server page the program printed. That page is
4059
- // enough on its own; dsh-ris-yds is asked ONLY for a program that IS a yds
4060
- // frontend, and it is told WHICH frontend: `yds.webConfig` declares one entry
4061
- // per front-end project with its own port, and injecting another entry's rules
4062
- // opens a page that talks to the wrong dev server (m00555). A plain npm app, a
4063
- // spring program, or an unlisted frontend opens directly — no proxy, no
4064
- // private browser (m00462), and a yds refusal is not an error.
4064
+ // `yds.webConfig` declares one entry per front-end project; the plugin is told
4065
+ // WHICH one, because injecting another entry's rules opens a page that points at
4066
+ // the wrong dev server (m00555).
4065
4067
  const frontend = program.kind === 'frontend' ? await ydsFrontendOf(req, cwd, program) : null
4066
4068
  if (frontend !== null) {
4067
- const wrapped = await askYdsToWrap(req, cwd, devUrl, frontend)
4068
- if (wrapped !== null && wrapped.ok === true && typeof wrapped.url === 'string') {
4069
- writeJson(res, 200, { ...wrapped, source: 'yds' })
4069
+ // The workbench page is remote, so it does not need this dev server to have
4070
+ // announced itself — but driving a browser at a program that never started is
4071
+ // still a mistake worth reporting.
4072
+ if (devUrl === undefined && program.running?.alive !== true) {
4073
+ writeJson(res, 200, { ok: false, code: 'no-url', message: OPEN_NO_URL_MESSAGE })
4070
4074
  return
4071
4075
  }
4076
+ const opened = await askYdsToOpenFrontend(req, cwd, frontend, devUrl)
4077
+ if (opened !== null) {
4078
+ writeJson(res, 200, opened.ok === true ? { ...opened, source: 'yds' } : opened)
4079
+ return
4080
+ }
4081
+ // The plugin answered the probe but not this call (a reload in between). Fall
4082
+ // through to the plain dev-server page instead of failing the button.
4083
+ }
4084
+ if (devUrl === undefined) {
4085
+ writeJson(res, 200, { ok: false, code: 'no-url', message: OPEN_NO_URL_MESSAGE })
4086
+ return
4072
4087
  }
4073
4088
  writeJson(res, 200, { ok: true, url: devUrl, source: 'dev-server' })
4074
4089
  } catch (error) {
@@ -4140,25 +4155,46 @@ async function askYdsProbe(req, cwd) {
4140
4155
  }
4141
4156
 
4142
4157
  /**
4143
- * Ask dsh-ris-yds to serve this URL through its injecting proxy for ONE frontend.
4158
+ * Ask dsh-ris-yds to open ONE front-end's workbench in its own debugging browser.
4159
+ *
4160
+ * The dev URL travels along as a port hint only: the workbench page is the thing
4161
+ * opened, but yds needs to know which dev server this front-end really started (the
4162
+ * declared port can be stale), because its extension rewrites the module bundle to
4163
+ * it. A browser launch takes seconds, so the timeout is generous — longer than yds'
4164
+ * own 15s port wait.
4144
4165
  * @param {object} frontend - `{code, name, relDir}` of the yds front-end program.
4166
+ * @param {string|undefined} devUrl - the dev URL its log printed, if any.
4145
4167
  * @returns {Promise<object|null>} the yds answer, or null when the plugin is absent.
4146
4168
  */
4147
- async function askYdsToWrap(req, cwd, devUrl, frontend) {
4169
+ async function askYdsToOpenFrontend(req, cwd, frontend, devUrl) {
4148
4170
  const host = typeof req.headers.host === 'string' ? req.headers.host : ''
4149
4171
  if (host === '') return null
4150
4172
  const controller = new AbortController()
4151
- const timer = setTimeout(() => controller.abort(), 5000)
4173
+ const timer = setTimeout(() => controller.abort(), 25000)
4152
4174
  try {
4153
4175
  const response = await fetch(`http://${host}/dsh-ris-yds/open`, {
4154
4176
  method: 'POST',
4155
4177
  headers: { 'content-type': 'application/json' },
4156
- body: JSON.stringify({ workspace: cwd, devUrl, frontend }),
4178
+ body: JSON.stringify({
4179
+ workspace: cwd,
4180
+ mode: 'debug',
4181
+ frontend,
4182
+ ...(typeof devUrl === 'string' && devUrl !== '' ? { devUrl } : {}),
4183
+ }),
4157
4184
  signal: controller.signal,
4158
4185
  })
4159
4186
  if (response.status === 404) return null
4160
4187
  const parsed = await response.json().catch(() => null)
4161
- return parsed === null ? null : parsed
4188
+ if (parsed === null || typeof parsed !== 'object') return null
4189
+ if (parsed.ok === true) return parsed
4190
+ // A refusal is an answer, not a transient: pass it on so the button can say WHY
4191
+ // (no browser installed, project not a yds one, …) instead of silently opening a
4192
+ // page the user did not ask for.
4193
+ return {
4194
+ ok: false,
4195
+ code: typeof parsed.code === 'string' ? parsed.code : 'yds-refused',
4196
+ message: typeof parsed.reason === 'string' && parsed.reason !== '' ? parsed.reason : 'dsh-ris-yds 没能打开调试浏览器',
4197
+ }
4162
4198
  } catch {
4163
4199
  return null
4164
4200
  } finally {
@@ -11199,12 +11235,48 @@ async function logUrl(logPath) {
11199
11235
  if (tail === undefined || typeof tail.content !== 'string') return undefined
11200
11236
  // eslint-disable-next-line no-control-regex
11201
11237
  const text = tail.content.replace(/\u001b\[[0-9;]*m/g, '')
11202
- const pattern = /https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\]|\[::\]|<[^>\s]{1,40}>):\d+[^\s)"',。;]*/gi
11203
- const matches = text.match(pattern)
11204
- if (matches === null || matches.length === 0) return undefined
11205
- const last = matches[matches.length - 1]
11206
- // A wildcard/placeholder host is a listening address, not a dialable one.
11207
- return last.replace(/^(https?):\/\/(?:0\.0\.0\.0|\[::\]|<[^>]+>|\[::1\]):/i, '$1://127.0.0.1:')
11238
+ const urls = []
11239
+ const lines = text.split(/\r?\n/)
11240
+ for (const line of lines) {
11241
+ const match = line.match(LOG_URL_PATTERN)
11242
+ if (match === null) continue
11243
+ const candidate = dialableUrl(match[0])
11244
+ if (candidate === undefined) continue
11245
+ // The LAST match in a log is often a quoted URL from a failed request (an asset
11246
+ // the app could not load), never the address the server announced. Only a line
11247
+ // that names the server owns an address; anything else is a hint at best.
11248
+ urls.push({ url: candidate, announced: LOG_URL_ANNOUNCEMENT.test(line), quoted: LOG_URL_TROUBLE.test(line) })
11249
+ }
11250
+ const announced = urls.filter((entry) => entry.announced)
11251
+ if (announced.length > 0) return announced[announced.length - 1].url
11252
+ const quiet = urls.filter((entry) => entry.quoted !== true)
11253
+ return quiet.length > 0 ? quiet[quiet.length - 1].url : undefined
11254
+ }
11255
+
11256
+ /** A loopback address with a port: the only shape a dev server announces (m03945). */
11257
+ const LOG_URL_PATTERN = /https?:\/\/(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1?\]|\[::\]|<[^>\s]{1,40}>):\d+[^\s)"',。;]*/gi
11258
+
11259
+ /** Lines that introduce a listening dev server (`Local:`, `服务地址`, vite's `ready in`…). */
11260
+ const LOG_URL_ANNOUNCEMENT = /(?:Local|Network|Listening|running at|服务地址|Dev Server|Server started|ready in|available at)/i
11261
+
11262
+ /** Lines that quote a URL because something failed (a fetch, a missing asset). */
11263
+ const LOG_URL_TROUBLE = /\b(?:error|warn(?:ing)?|failed|not found|status|未获取到|失败|异常)\b/i
11264
+
11265
+ /** The 🌐 answer when a program's log never announced a page (pressed too early). */
11266
+ const OPEN_NO_URL_MESSAGE = '这个程序还没打印出访问地址:先启动它,日志里出现 Local: http://localhost:<端口> 后再点'
11267
+
11268
+ /**
11269
+ * The dialable form of one loopback URL, or undefined when it is not an address.
11270
+ *
11271
+ * A wildcard/placeholder host is a listening address, not a dialable one, so it is
11272
+ * rewritten to 127.0.0.1. A URL that still carries a template (`.../}/module/...`)
11273
+ * is not an address at all — opening it lands on a 404.
11274
+ * @param {string} raw - one URL matched from a log line.
11275
+ * @returns {string|undefined} the URL to open, or undefined to skip it.
11276
+ */
11277
+ function dialableUrl(raw) {
11278
+ const url = raw.replace(/^(https?):\/\/(?:0\.0\.0\.0|\[::\]|<[^>]+>|\[::1\]):/i, '$1://127.0.0.1:')
11279
+ return /[{}]/.test(url) ? undefined : url
11208
11280
  }
11209
11281
 
11210
11282
  /** Status of one log path (a program's fixed log, or an ad-hoc instance log). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-ris-ide",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "license": "MIT",
5
5
  "description": "RIS-IDE local dev panel for the DSH web GUI: live log tail, one-click start/stop of workspace programs, JDWP debugging, file tree + editor, and a standalone IDE window that carries no session history. \u00b7 DSH \u53f3\u4fa7\u680f\u672c\u5730\u5f00\u53d1\u9762\u677f\uff1a\u65e5\u5fd7\u5b9e\u65f6\u8ddf\u968f\u3001\u4e00\u952e\u542f\u505c\u672c\u5730\u7a0b\u5e8f\u3001Java \u65ad\u70b9\u8c03\u8bd5\u3001\u6587\u4ef6\u6811\u4e0e\u7f16\u8f91\u5668\u3001\u72ec\u7acb IDE \u7a97\u53e3\u3002",
6
6
  "keywords": [
@@ -3602,11 +3602,12 @@ test('only a FRONTEND row offers the browser button, and only a yds project prom
3602
3602
  assert.match(source, /event\.stopPropagation\(\); openSite\(program\)/)
3603
3603
  // Errors are told in the panel's note bar, never swallowed.
3604
3604
  assert.match(source, /还没有可打开的地址|这个程序还没有\.\.\./)
3605
- // The token sentence may only appear behind the yds flag: a plain workspace must
3606
- // never read "yds" (m04354).
3605
+ // The yds sentence may only appear behind the yds flag: a plain workspace must
3606
+ // never read "yds" (m04354). It promises the debugging browser now — the 🌐 button
3607
+ // no longer just opens the dev-server page for a yds front-end.
3607
3608
  assert.match(source, /async function requestYdsProject\(scope\)/)
3608
3609
  assert.match(source, /dsh-ris-yds\/probe\?/)
3609
- assert.match(source, /ydsProject \? '(yds 项目:请求自动带上登录 token,免登录)' : ''/)
3610
+ assert.match(source, /ydsProject \? '(yds 项目:点 🌐 用专用调试浏览器打开工作台,模块由扩展指向本地 dev server)' : ''/)
3610
3611
  assert.doesNotMatch(source, /yds 项目会自动注入 YYCToken/, 'the old unconditional yds wording is gone')
3611
3612
  })
3612
3613
 
@@ -3650,12 +3651,12 @@ test('the IDE console opens a frontend page with the same 🌐 as the sidebar (m
3650
3651
  assert.match(busyTag, /disabled=""/)
3651
3652
  assert.match(busy, /…<\/button>/)
3652
3653
 
3653
- // The token sentence only appears for a yds workspace (m04354).
3654
+ // The yds sentence only appears for a yds workspace (m04354).
3654
3655
  const yds = renderWorkbench({
3655
3656
  ydsProject: true,
3656
3657
  programs: [{ id: 'frontend:ui#dev', name: 'ris-ui-3', kind: 'frontend', logPath: '/w/logs/ui.log', running: { alive: true } }],
3657
3658
  })
3658
- assert.match(yds, /yds 项目:请求自动带上登录 token,免登录/)
3659
+ assert.match(yds, /yds 项目:点 🌐 用专用调试浏览器打开工作台/)
3659
3660
  })
3660
3661
 
3661
3662
  test('the tab strip shows ⟳ while the buffer is clean and ± once it is dirty (m00388/m00808)', { skip: !reactIsReal ? 'React unavailable for SSR' : false }, () => {
@@ -708,6 +708,72 @@ test('the open-target route resolves a program by id and never invents a URL (m0
708
708
  }, undefined, root)
709
709
  })
710
710
 
711
+ test('a yds front-end opens yds\' debugging browser, never a tab at the dev URL', async () => {
712
+ // The 🌐 answer for a yds front-end is NOT its dev server: the platform page is the
713
+ // workbench, and only yds' own browser carries the extension that points the module
714
+ // at the local dev server. ris-ide asks for `mode:'debug'` and passes the log's URL
715
+ // along as the live dev port — it must not window.open it.
716
+ const { root } = await makeProgramFixture()
717
+ const ctx = { sessions: { get: (id) => (id === 's1' ? { header: { cwd: root } } : undefined) } }
718
+ const calls = []
719
+ const state = { refuse: false }
720
+ const answer = (res, payload) => {
721
+ res.writeHead(200, { 'content-type': 'application/json' })
722
+ res.end(JSON.stringify(payload))
723
+ }
724
+ const server = createServer((req, res) => {
725
+ const url = new URL(req.url ?? '/', 'http://dsh.internal')
726
+ if (url.pathname === '/dsh-ris-yds/probe') {
727
+ answer(res, { ok: true, yds: true, projectDir: join(root, 'proj-a'), frontends: ['ui'] })
728
+ return
729
+ }
730
+ if (url.pathname === '/dsh-ris-yds/open') {
731
+ const chunks = []
732
+ req.on('data', (chunk) => chunks.push(chunk))
733
+ req.on('end', () => {
734
+ const body = JSON.parse(Buffer.concat(chunks).toString('utf8'))
735
+ calls.push(body)
736
+ if (state.refuse) answer(res, { ok: false, code: 'not-yds-frontend', reason: '不是这个前端' })
737
+ else answer(res, { ok: true, mode: 'debug', pid: 4242, port: 9222, url: 'https://workbench.example/c-ass-kk-hans' })
738
+ })
739
+ return
740
+ }
741
+ handleRequest(ctx, req, res, { maxBytes: HARD_MAX_BYTES, restrictToCwd: false, stopGraceMs: 5000 })
742
+ })
743
+ await new Promise((resolve) => server.listen(0, '127.0.0.1', resolve))
744
+ const base = `http://127.0.0.1:${server.address().port}`
745
+ try {
746
+ const listing = await (await fetch(`${base}${PROGRAMS_PATH}?sessionId=s1&refresh=1`)).json()
747
+ const program = listing.programs.find((entry) => entry.kind === 'frontend')
748
+ assert.ok(program !== undefined, 'the fixture frontend program is discovered')
749
+ await mkdir(join(root, 'logs'), { recursive: true })
750
+ await writeFile(program.logPath, ' \u001b[32m- Local:\u001b[39m http://localhost:5173/\n')
751
+
752
+ const opened = await (await fetch(`${base}${OPEN_TARGET_PATH}?sessionId=s1&id=${encodeURIComponent(program.id)}`)).json()
753
+ assert.equal(opened.ok, true, JSON.stringify(opened))
754
+ assert.equal(opened.mode, 'debug', 'yds started its own browser')
755
+ assert.equal(opened.source, 'yds')
756
+ assert.equal(opened.pid, 4242)
757
+ assert.equal(opened.url, 'https://workbench.example/c-ass-kk-hans')
758
+ assert.equal(calls.length, 1)
759
+ assert.equal(calls[0].mode, 'debug', 'a yds front-end is never asked for the proxy page')
760
+ assert.equal(calls[0].workspace, root)
761
+ assert.equal(calls[0].frontend.code, 'ui')
762
+ assert.equal(calls[0].devUrl, 'http://localhost:5173/', 'the live dev URL travels along as a port hint')
763
+
764
+ // A refusal is reported, not papered over with a window at the dev URL.
765
+ state.refuse = true
766
+ const refused = await (await fetch(`${base}${OPEN_TARGET_PATH}?sessionId=s1&id=${encodeURIComponent(program.id)}`)).json()
767
+ assert.equal(refused.ok, false, 'a refusal is not turned into a silent window')
768
+ assert.equal(refused.code, 'not-yds-frontend')
769
+ assert.match(refused.message, /不是这个前端/)
770
+ assert.equal(calls.length, 2)
771
+ } finally {
772
+ await new Promise((resolve) => server.close(resolve))
773
+ await rm(root, { recursive: true, force: true })
774
+ }
775
+ })
776
+
711
777
  test('a dev-server URL is read from local hosts, placeholders and ANSI logs (m03945)', async () => {
712
778
  // What scaffolds actually print: webpack/vite use localhost, MDF prints
713
779
  // `Node服务地址:http://<HOST地址>:3003`, and colour codes wrap both the label
@@ -718,6 +784,13 @@ test('a dev-server URL is read from local hosts, placeholders and ANSI logs (m03
718
784
  ['\u001b[32m - Local: \u001b[36mhttp://0.0.0.0:8080/\u001b[39m\n', 'http://127.0.0.1:8080/'],
719
785
  ['http://[::]:9000/\n', 'http://127.0.0.1:9000/'],
720
786
  ['Java服务地址:https://srmdev.hanslaser.com/c-ass-kk-hans\n', undefined],
787
+ // The LAST URL in a log is usually quoted from a failed request; the address is
788
+ // the one a server line announced (mftm: mdf-node prints no bare `Local:` line).
789
+ [' - Local: http://localhost:5173/\nERROR fetch http://127.0.0.1:3003/api/x.json\n', 'http://localhost:5173/'],
790
+ ['Node服务地址:http://<HOST地址>:3003 当前环境:daily\nERROR Unable to fetch http://127.0.0.1:3003/}/c-ass-kk-hans/version.json\n', 'http://127.0.0.1:3003'],
791
+ // A URL with an unresolved template is not an address: opening it lands on a 404.
792
+ ['GET http://127.0.0.1:3003/}/c-ass-kk-hans/version.json\n', undefined],
793
+ ['\u001b[32mready in 512 ms\u001b[39m\n\u001b[36m➜\u001b[39m http://127.0.0.1:3004/\n', 'http://127.0.0.1:3004/'],
721
794
  ]
722
795
  const dir = await mkdtemp(join(tmpdir(), 'ris-logurl-'))
723
796
  const logPath = join(dir, 'prog.log')