@saptools/cf-inspector 0.5.0 → 0.6.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.
- package/README.md +51 -0
- package/dist/cli.js +380 -153
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +102 -7
- package/dist/index.js +495 -141
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -422,6 +422,57 @@ cf-inspector attach --port 9229
|
|
|
422
422
|
`attach` checks the port-level `/json/version` endpoint, so raw-target and
|
|
423
423
|
worker selectors do not apply to this smoke test.
|
|
424
424
|
|
|
425
|
+
### Exact CDP tracing APIs
|
|
426
|
+
|
|
427
|
+
The library also exports lower-level, validated primitives for tools that need to plan and step an
|
|
428
|
+
exact loaded function instead of using a URL-regex breakpoint:
|
|
429
|
+
|
|
430
|
+
```ts
|
|
431
|
+
const scripts = listScripts(session);
|
|
432
|
+
const source = await getScriptSource(session, scripts[0].scriptId);
|
|
433
|
+
const locations = await getPossibleBreakpoints(session, {
|
|
434
|
+
start: { scriptId: scripts[0].scriptId, lineNumber: 10 },
|
|
435
|
+
restrictToFunction: true,
|
|
436
|
+
});
|
|
437
|
+
const breakpoint = await setBreakpointAtLocation(session, { location: locations[0] });
|
|
438
|
+
const pause = await waitForPause(session, {
|
|
439
|
+
timeoutMs: 30_000,
|
|
440
|
+
breakpointIds: [breakpoint.breakpointId],
|
|
441
|
+
signal: abortController.signal,
|
|
442
|
+
});
|
|
443
|
+
await stepOver(session);
|
|
444
|
+
await releaseObject(session, objectId);
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
`ScriptLocation` and `BreakLocation` use CDP-native zero-based line and column numbers. Exact
|
|
448
|
+
breakpoint setup returns both the requested and actual location, then fails closed and removes the
|
|
449
|
+
breakpoint if V8 resolves a different script, line, or column. An omitted column means CDP column
|
|
450
|
+
zero. `RemoteObjectInfo.completeness` is `truncated` for logical values stored in internal slots
|
|
451
|
+
(including maps, sets, promises, and dates) and `unavailable` for proxies; it is omitted for
|
|
452
|
+
ordinary objects. `waitForPause` accepts an `AbortSignal` and cleans its event listener and timer
|
|
453
|
+
on success, timeout, abort, or session close. The same layer exports `stepInto`, `stepOver`,
|
|
454
|
+
`stepOut`, `releaseObject`, and `releaseObjectGroup` for bounded controllers.
|
|
455
|
+
|
|
456
|
+
Programmatic Cloud Foundry tunnels can select the same process instance and Node PID used for both
|
|
457
|
+
the remote signal and SSH forwarding:
|
|
458
|
+
|
|
459
|
+
```ts
|
|
460
|
+
const tunnel = await openCfTunnel({
|
|
461
|
+
region: "eu10",
|
|
462
|
+
org: "my-org",
|
|
463
|
+
space: "dev",
|
|
464
|
+
app: "orders-srv",
|
|
465
|
+
process: "worker",
|
|
466
|
+
instance: 2,
|
|
467
|
+
nodePid: 4312,
|
|
468
|
+
});
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
`openCfTunnel` retains backward-compatible reuse when `cf-debugger` reports a healthy local port
|
|
472
|
+
for an existing session. Controllers that must prove they own and can dispose the tunnel should use
|
|
473
|
+
`openOwnedCfTunnel`; it propagates `SESSION_ALREADY_RUNNING` instead of parsing or borrowing a
|
|
474
|
+
pre-existing session.
|
|
475
|
+
|
|
425
476
|
---
|
|
426
477
|
|
|
427
478
|
## 🔭 How it works
|