prismcast 1.10.2 → 1.10.3

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.
Files changed (166) hide show
  1. package/dist/app.d.ts +5 -3
  2. package/dist/app.js +42 -41
  3. package/dist/app.js.map +1 -1
  4. package/dist/browser/hlsPlaylistObserver.d.ts +38 -0
  5. package/dist/browser/hlsPlaylistObserver.js +113 -0
  6. package/dist/browser/hlsPlaylistObserver.js.map +1 -0
  7. package/dist/browser/index.d.ts +26 -16
  8. package/dist/browser/index.js +95 -70
  9. package/dist/browser/index.js.map +1 -1
  10. package/dist/browser/manifestInterceptor.d.ts +29 -29
  11. package/dist/browser/manifestInterceptor.js +106 -212
  12. package/dist/browser/manifestInterceptor.js.map +1 -1
  13. package/dist/browser/tabNetworkObserver.d.ts +48 -0
  14. package/dist/browser/tabNetworkObserver.js +140 -0
  15. package/dist/browser/tabNetworkObserver.js.map +1 -0
  16. package/dist/config/consistencyProbe.js +13 -11
  17. package/dist/config/consistencyProbe.js.map +1 -1
  18. package/dist/config/paths.d.ts +3 -8
  19. package/dist/config/paths.js +3 -10
  20. package/dist/config/paths.js.map +1 -1
  21. package/dist/config/profiles.d.ts +1 -1
  22. package/dist/config/profiles.js +6 -6
  23. package/dist/config/profiles.js.map +1 -1
  24. package/dist/config/services.d.ts +5 -5
  25. package/dist/config/services.js +8 -8
  26. package/dist/config/services.js.map +1 -1
  27. package/dist/config/sites.d.ts +2 -2
  28. package/dist/config/sites.js +6 -6
  29. package/dist/config/sites.js.map +1 -1
  30. package/dist/config/userChannels.d.ts +108 -14
  31. package/dist/config/userChannels.js +291 -37
  32. package/dist/config/userChannels.js.map +1 -1
  33. package/dist/config/userConfig.js +1 -1
  34. package/dist/config/userConfig.js.map +1 -1
  35. package/dist/config/userProfiles.d.ts +3 -3
  36. package/dist/config/userProfiles.js +19 -19
  37. package/dist/config/userProfiles.js.map +1 -1
  38. package/dist/index.js +7 -9
  39. package/dist/index.js.map +1 -1
  40. package/dist/native/index.d.ts +1 -1
  41. package/dist/native/index.js +9 -18
  42. package/dist/native/index.js.map +1 -1
  43. package/dist/native/proxy.d.ts +1 -4
  44. package/dist/native/proxy.js +0 -9
  45. package/dist/native/proxy.js.map +1 -1
  46. package/dist/routes/clientActions.d.ts +97 -0
  47. package/dist/routes/clientActions.js +113 -0
  48. package/dist/routes/clientActions.js.map +1 -0
  49. package/dist/routes/components.d.ts +4 -3
  50. package/dist/routes/components.js +36 -39
  51. package/dist/routes/components.js.map +1 -1
  52. package/dist/routes/config/channels/endpoints/browse.js.map +1 -1
  53. package/dist/routes/config/channels/endpoints/crud.js +37 -72
  54. package/dist/routes/config/channels/endpoints/crud.js.map +1 -1
  55. package/dist/routes/config/channels/endpoints/importExport.js.map +1 -1
  56. package/dist/routes/config/channels/healthBridge.d.ts +23 -0
  57. package/dist/routes/config/channels/healthBridge.js +71 -0
  58. package/dist/routes/config/channels/healthBridge.js.map +1 -0
  59. package/dist/routes/config/channels/table.js +97 -84
  60. package/dist/routes/config/channels/table.js.map +1 -1
  61. package/dist/routes/config/services.js +25 -22
  62. package/dist/routes/config/services.js.map +1 -1
  63. package/dist/routes/config/settings.js +9 -6
  64. package/dist/routes/config/settings.js.map +1 -1
  65. package/dist/routes/debug.js +277 -139
  66. package/dist/routes/debug.js.map +1 -1
  67. package/dist/routes/logs.js +1 -1
  68. package/dist/routes/logs.js.map +1 -1
  69. package/dist/routes/root/content.js +18 -14
  70. package/dist/routes/root/content.js.map +1 -1
  71. package/dist/routes/root/index.js +17 -14
  72. package/dist/routes/root/index.js.map +1 -1
  73. package/dist/routes/root/scripts/channels.js +50 -21
  74. package/dist/routes/root/scripts/channels.js.map +1 -1
  75. package/dist/routes/root/scripts/config.js +72 -3
  76. package/dist/routes/root/scripts/config.js.map +1 -1
  77. package/dist/routes/root/scripts/shared.js +60 -0
  78. package/dist/routes/root/scripts/shared.js.map +1 -1
  79. package/dist/routes/root/scripts/status.handlers.d.ts +5 -27
  80. package/dist/routes/root/scripts/status.handlers.js +8 -60
  81. package/dist/routes/root/scripts/status.handlers.js.map +1 -1
  82. package/dist/routes/root/scripts/status.js +6 -1
  83. package/dist/routes/root/scripts/status.js.map +1 -1
  84. package/dist/routes/streams.js +5 -3
  85. package/dist/routes/streams.js.map +1 -1
  86. package/dist/service/commands.context.js +1 -1
  87. package/dist/service/commands.context.js.map +1 -1
  88. package/dist/service/generators.context.js +1 -1
  89. package/dist/service/generators.context.js.map +1 -1
  90. package/dist/service/generators.d.ts +1 -1
  91. package/dist/service/generators.js +3 -11
  92. package/dist/service/generators.js.map +1 -1
  93. package/dist/streaming/hls.js +1 -5
  94. package/dist/streaming/hls.js.map +1 -1
  95. package/dist/streaming/hlsSegments.d.ts +1 -1
  96. package/dist/streaming/hlsSegments.js.map +1 -1
  97. package/dist/streaming/preroll.d.ts +1 -1
  98. package/dist/streaming/preroll.js +1 -5
  99. package/dist/streaming/preroll.js.map +1 -1
  100. package/dist/streaming/statusEmitter.d.ts +5 -8
  101. package/dist/streaming/statusEmitter.js +0 -5
  102. package/dist/streaming/statusEmitter.js.map +1 -1
  103. package/dist/types/channels.d.ts +9 -0
  104. package/dist/types/channels.js.map +1 -1
  105. package/dist/types/profiles.d.ts +2 -2
  106. package/dist/upgrade/commands.context.js +14 -10
  107. package/dist/upgrade/commands.context.js.map +1 -1
  108. package/dist/upgrade/commands.d.ts +7 -15
  109. package/dist/upgrade/commands.js +27 -28
  110. package/dist/upgrade/commands.js.map +1 -1
  111. package/dist/upgrade/detection.context.js +2 -1
  112. package/dist/upgrade/detection.context.js.map +1 -1
  113. package/dist/upgrade/detection.d.ts +2 -1
  114. package/dist/upgrade/detection.js +20 -51
  115. package/dist/upgrade/detection.js.map +1 -1
  116. package/dist/upgrade/index.d.ts +1 -0
  117. package/dist/upgrade/index.js +1 -0
  118. package/dist/upgrade/index.js.map +1 -1
  119. package/dist/upgrade/lifecycle.context.d.ts +19 -0
  120. package/dist/upgrade/lifecycle.context.js +47 -0
  121. package/dist/upgrade/lifecycle.context.js.map +1 -0
  122. package/dist/upgrade/lifecycle.d.ts +72 -0
  123. package/dist/upgrade/lifecycle.js +176 -0
  124. package/dist/upgrade/lifecycle.js.map +1 -0
  125. package/dist/upgrade/pathHandle.d.ts +28 -0
  126. package/dist/upgrade/pathHandle.js +101 -0
  127. package/dist/upgrade/pathHandle.js.map +1 -0
  128. package/dist/utils/bootSession.context.d.ts +15 -0
  129. package/dist/utils/bootSession.context.js +59 -0
  130. package/dist/utils/bootSession.context.js.map +1 -0
  131. package/dist/utils/bootSession.d.ts +16 -0
  132. package/dist/utils/bootSession.js +20 -0
  133. package/dist/utils/bootSession.js.map +1 -0
  134. package/dist/utils/clock.js +1 -1
  135. package/dist/utils/ffmpeg.js +1 -1
  136. package/dist/utils/ffmpeg.js.map +1 -1
  137. package/dist/utils/index.d.ts +3 -0
  138. package/dist/utils/index.js +3 -0
  139. package/dist/utils/index.js.map +1 -1
  140. package/dist/utils/markup.d.ts +10 -0
  141. package/dist/utils/markup.js +23 -0
  142. package/dist/utils/markup.js.map +1 -1
  143. package/dist/utils/pid.d.ts +2 -25
  144. package/dist/utils/pid.js +10 -49
  145. package/dist/utils/pid.js.map +1 -1
  146. package/dist/utils/processInspector.context.d.ts +7 -0
  147. package/dist/utils/processInspector.context.js +104 -0
  148. package/dist/utils/processInspector.context.js.map +1 -0
  149. package/dist/utils/processInspector.d.ts +54 -0
  150. package/dist/utils/processInspector.js +125 -0
  151. package/dist/utils/processInspector.js.map +1 -0
  152. package/dist/utils/retry.d.ts +1 -1
  153. package/dist/utils/retry.js +1 -1
  154. package/dist/utils/retry.js.map +1 -1
  155. package/dist/utils/runtimeIdentity.context.d.ts +6 -0
  156. package/dist/utils/runtimeIdentity.context.js +13 -0
  157. package/dist/utils/runtimeIdentity.context.js.map +1 -0
  158. package/dist/utils/runtimeIdentity.d.ts +96 -0
  159. package/dist/utils/runtimeIdentity.js +171 -0
  160. package/dist/utils/runtimeIdentity.js.map +1 -0
  161. package/dist/utils/timing.d.ts +1 -1
  162. package/dist/utils/timing.js +0 -5
  163. package/dist/utils/timing.js.map +1 -1
  164. package/dist/utils/version.js +40 -10
  165. package/dist/utils/version.js.map +1 -1
  166. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ffmpeg.js","sourceRoot":"","sources":["../../src/utils/ffmpeg.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,iKAAiK;AACjK,2EAA2E;AAC3E,MAAM,qBAAqB,GAAG,CAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAE,CAAC;AAyBxG;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAqB,0BAA0B,EAAE;IAEpF,IAAG,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAElD,OAAO,GAAG,CAAC,WAAW,CAAC;IACzB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,iKAAiK;AACjK,4JAA4J;AAC5J,MAAM,kBAAkB,GAAsB;IAC5C,cAAc;IACd,UAAU;IACV,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,iBAAiB;IAC5B,aAAa,EAAE,YAAY;IAC3B,YAAY,EAAE,OAAO;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAqB,0BAA0B,EAAE;IAErF,sHAAsH;IACtH,IAAG,GAAG,CAAC,QAAQ,KAAK,QA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B,2BAA2B;QAC3B,QAAQ;KACT,CAAC;AACJ,CAAC;AAED,0BAA0B;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CAAC,SAAiB,EAAE,YAAoB,EAAE,OAA+B,EAAE,QAAiB,EAAE,OAAgB;IAEvI,OAAO,kBAAkB,CAAC;QAExB,IAAI,EAAE,oBAAoB,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,CAAC;QACrD,SAAS;QACT,KAAK,EAAE,QAAQ;QACf,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,OAA+B,EAAE,QAAiB;IAEtG,OAAO,kBAAkB,CAAC;QAExB,IAAI,EAAE,sBAAsB,EAAE;QAC9B,SAAS;QACT,KAAK,EAAE,iBAAiB;QACxB,OAAO;QACP,QAAQ;KACT,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IAErC,OAAO,CAAC,MAAM,iBAAiB,EAAE,CAAC,KAAK,SAAS,CAAC;AACnD,CAAC"}
@@ -1,3 +1,4 @@
1
+ export * from "./bootSession.ts";
1
2
  export * from "./chromeFetch.ts";
2
3
  export * from "./cliOutput.ts";
3
4
  export * from "./clock.ts";
@@ -15,7 +16,9 @@ export * from "./morganStream.ts";
15
16
  export * from "./network.ts";
16
17
  export * from "./pid.ts";
17
18
  export * from "./platform.ts";
19
+ export * from "./processInspector.ts";
18
20
  export * from "./retry.ts";
21
+ export * from "./runtimeIdentity.ts";
19
22
  export * from "./sanitize.ts";
20
23
  export * from "./streamContext.ts";
21
24
  export * from "./timing.ts";
@@ -2,6 +2,7 @@
2
2
  *
3
3
  * index.ts: Utility module exports for PrismCast.
4
4
  */
5
+ export * from "./bootSession.js";
5
6
  export * from "./chromeFetch.js";
6
7
  export * from "./cliOutput.js";
7
8
  export * from "./clock.js";
@@ -19,7 +20,9 @@ export * from "./morganStream.js";
19
20
  export * from "./network.js";
20
21
  export * from "./pid.js";
21
22
  export * from "./platform.js";
23
+ export * from "./processInspector.js";
22
24
  export * from "./retry.js";
25
+ export * from "./runtimeIdentity.js";
23
26
  export * from "./sanitize.js";
24
27
  export * from "./streamContext.js";
25
28
  export * from "./timing.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -10,3 +10,13 @@ export declare function escapeHtml(value: string): string;
10
10
  * @returns The escaped text safe for XML embedding.
11
11
  */
12
12
  export declare function escapeXml(value: string): string;
13
+ /**
14
+ * Serializes a record of HTML attribute names to values into the inline fragment suitable for embedding in an opening tag. Three value semantics keep this tied
15
+ * to the way HTML actually shapes attributes: undefined and boolean false are omitted entirely; boolean true emits the attribute name alone (HTML5 boolean
16
+ * attribute form, e.g. {@code <input disabled>}); string values are HTML-escaped via {@link escapeHtml} and emitted as {@code name="value"}. The returned
17
+ * fragment begins with a leading space when non-empty, so callers concatenate it directly after a preceding attribute without any spacing arithmetic of their
18
+ * own. Renderers therefore pass raw values - boolean predicates and untrusted strings alike - and the encoding contract lives in exactly one place.
19
+ * @param attrs - Attribute name/value pairs. Keys are emitted in insertion order.
20
+ * @returns The serialized attribute fragment, or the empty string when no attribute would be emitted.
21
+ */
22
+ export declare function serializeAttrs(attrs: Readonly<Record<string, string | boolean | undefined>>): string;
@@ -51,4 +51,27 @@ export function escapeHtml(value) {
51
51
  export function escapeXml(value) {
52
52
  return escapeMarkup(value, XML_ENTITIES);
53
53
  }
54
+ /**
55
+ * Serializes a record of HTML attribute names to values into the inline fragment suitable for embedding in an opening tag. Three value semantics keep this tied
56
+ * to the way HTML actually shapes attributes: undefined and boolean false are omitted entirely; boolean true emits the attribute name alone (HTML5 boolean
57
+ * attribute form, e.g. {@code <input disabled>}); string values are HTML-escaped via {@link escapeHtml} and emitted as {@code name="value"}. The returned
58
+ * fragment begins with a leading space when non-empty, so callers concatenate it directly after a preceding attribute without any spacing arithmetic of their
59
+ * own. Renderers therefore pass raw values - boolean predicates and untrusted strings alike - and the encoding contract lives in exactly one place.
60
+ * @param attrs - Attribute name/value pairs. Keys are emitted in insertion order.
61
+ * @returns The serialized attribute fragment, or the empty string when no attribute would be emitted.
62
+ */
63
+ export function serializeAttrs(attrs) {
64
+ const fragments = [];
65
+ for (const [name, value] of Object.entries(attrs)) {
66
+ if ((value === undefined) || (value === false)) {
67
+ continue;
68
+ }
69
+ if (value === true) {
70
+ fragments.push(name);
71
+ continue;
72
+ }
73
+ fragments.push(name + "=\"" + escapeHtml(value) + "\"");
74
+ }
75
+ return (fragments.length > 0) ? (" " + fragments.join(" ")) : "";
76
+ }
54
77
  //# sourceMappingURL=markup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"markup.js","sourceRoot":"","sources":["../../src/utils/markup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AAEH,6JAA6J;AAC7J,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAEvC,gKAAgK;AAChK,MAAM,aAAa,GAAqC;IAEtD,IAAI,EAAE,QAAQ;IACd,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;CACZ,CAAC;AAEF,wIAAwI;AACxI,MAAM,YAAY,GAAqC;IAErD,IAAI,EAAE,QAAQ;IACd,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,MAAM;CACZ,CAAC;AAEF;;;;;;GAMG;AACH,SAAS,YAAY,CAAC,KAAa,EAAE,QAA0C;IAE7E,OAAO,KAAK,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC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,CAAC,KAA6D;IAE1F,MAAM,SAAS,GAAa,EAAE,CAAC;IAE/B,KAAI,MAAM,CAAE,IAAI,EAAE,KAAK,CAAE,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAEnD,IAAG,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,CAAC;YAE9C,SAAS;QACX,CAAC;QAED,IAAG,KAAK,KAAK,IAAI,EAAE,CAAC;YAElB,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAErB,SAAS;QACX,CAAC;QAED,SAAS,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnE,CAAC"}
@@ -1,4 +1,3 @@
1
- import type { Nullable } from "../types/index.ts";
2
1
  /**
3
2
  * Checks whether a process with the given PID is still running. Uses the signal 0 technique: process.kill(pid, 0) throws ESRCH if the process does not exist,
4
3
  * returns successfully if it does. EPERM (permission denied) means the process exists but belongs to another user - treated as "still running" since we cannot
@@ -8,31 +7,9 @@ import type { Nullable } from "../types/index.ts";
8
7
  */
9
8
  export declare function isProcessRunning(pid: number): boolean;
10
9
  /**
11
- * Reads a PID from a file on disk. Returns null if the file does not exist, is empty, or contains non-numeric content. ENOENT is expected on first run or after a
12
- * clean shutdown and is silently ignored.
10
+ * Removes a PID file from disk. ENOENT is expected when the file has already been removed and is silently ignored.
13
11
  * @param filePath - The absolute path to the PID file.
14
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
15
- * @param log - Optional logger for non-ENOENT read errors. When omitted (e.g., before the logger is initialized), errors are silently ignored.
16
- * @returns The stored process ID, or null if unavailable.
17
- */
18
- export declare function readPidFile(filePath: string, label: string, log?: {
19
- warn: (message: string, ...args: unknown[]) => void;
20
- }): Nullable<number>;
21
- /**
22
- * Writes a PID to a file on disk. Used to persist the current process ID so that the next startup can detect a running instance or clean up an orphaned process.
23
- * @param filePath - The absolute path to the PID file.
24
- * @param pid - The process ID to write.
25
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
26
- * @param log - Optional logger for write errors. When omitted, errors are silently ignored.
27
- */
28
- export declare function writePidFile(filePath: string, pid: number, label: string, log?: {
29
- warn: (message: string, ...args: unknown[]) => void;
30
- }): void;
31
- /**
32
- * Removes a PID file from disk. Called during graceful shutdown and from exit handlers as a fallback. ENOENT is expected when the file has already been removed and
33
- * is silently ignored.
34
- * @param filePath - The absolute path to the PID file.
35
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
12
+ * @param label - A descriptive label for log messages (e.g., "identity", "server").
36
13
  * @param log - Optional logger for non-ENOENT removal errors. When omitted, errors are silently ignored.
37
14
  */
38
15
  export declare function clearPidFile(filePath: string, label: string, log?: {
package/dist/utils/pid.js CHANGED
@@ -1,11 +1,13 @@
1
- import fs from "node:fs";
2
- /* PID files provide a lightweight mechanism for tracking running processes across restarts and crashes. Each PID file stores a single process ID as a plain text
3
- * integer. On startup, the stored PID is checked via signal 0 to determine whether the process is still alive. Stale PID files from crashed or terminated processes
4
- * are handled gracefully - ENOENT on read and ESRCH on signal check are both expected and silently ignored.
1
+ /* Copyright(C) 2024-2026, HJD (https://github.com/hjdhjd). All rights reserved.
2
+ *
3
+ * pid.ts: Cross-platform PID liveness check and silent file removal. After the runtime-identity rewrite, the only OS-level primitives that need to live here
4
+ * are: (1) "is this PID currently a live process?" via the signal-0 technique, and (2) "remove this file, treating ENOENT as success." Structured PID-file
5
+ * lifecycle (write the record, parse it on read, detect a stale boot session) lives in utils/runtimeIdentity.ts; this module is its low-level dependency.
5
6
  *
6
- * This module is intentionally synchronous. PID file operations run in contexts where the event loop may not be available (process.on("exit") handlers), so all
7
- * I/O uses the synchronous fs API and process.kill() for signaling.
7
+ * This module is intentionally synchronous. PID-file operations run in contexts where the event loop may not be available (process.on("exit") handlers), so
8
+ * all I/O uses the synchronous fs API and process.kill() for signaling.
8
9
  */
10
+ import fs from "node:fs";
9
11
  /**
10
12
  * Checks whether a process with the given PID is still running. Uses the signal 0 technique: process.kill(pid, 0) throws ESRCH if the process does not exist,
11
13
  * returns successfully if it does. EPERM (permission denied) means the process exists but belongs to another user - treated as "still running" since we cannot
@@ -24,50 +26,9 @@ export function isProcessRunning(pid) {
24
26
  }
25
27
  }
26
28
  /**
27
- * Reads a PID from a file on disk. Returns null if the file does not exist, is empty, or contains non-numeric content. ENOENT is expected on first run or after a
28
- * clean shutdown and is silently ignored.
29
- * @param filePath - The absolute path to the PID file.
30
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
31
- * @param log - Optional logger for non-ENOENT read errors. When omitted (e.g., before the logger is initialized), errors are silently ignored.
32
- * @returns The stored process ID, or null if unavailable.
33
- */
34
- export function readPidFile(filePath, label, log) {
35
- try {
36
- const content = fs.readFileSync(filePath, "utf-8").trim();
37
- const pid = parseInt(content, 10);
38
- if (!isNaN(pid)) {
39
- return pid;
40
- }
41
- }
42
- catch (error) {
43
- if ((error.code !== "ENOENT") && log) {
44
- log.warn("Failed to read %s PID file: %s.", label, error.message);
45
- }
46
- }
47
- return null;
48
- }
49
- /**
50
- * Writes a PID to a file on disk. Used to persist the current process ID so that the next startup can detect a running instance or clean up an orphaned process.
51
- * @param filePath - The absolute path to the PID file.
52
- * @param pid - The process ID to write.
53
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
54
- * @param log - Optional logger for write errors. When omitted, errors are silently ignored.
55
- */
56
- export function writePidFile(filePath, pid, label, log) {
57
- try {
58
- fs.writeFileSync(filePath, String(pid), "utf-8");
59
- }
60
- catch (error) {
61
- if (log) {
62
- log.warn("Failed to write %s PID file: %s.", label, error.message);
63
- }
64
- }
65
- }
66
- /**
67
- * Removes a PID file from disk. Called during graceful shutdown and from exit handlers as a fallback. ENOENT is expected when the file has already been removed and
68
- * is silently ignored.
29
+ * Removes a PID file from disk. ENOENT is expected when the file has already been removed and is silently ignored.
69
30
  * @param filePath - The absolute path to the PID file.
70
- * @param label - A descriptive label for log messages (e.g., "Chrome", "server").
31
+ * @param label - A descriptive label for log messages (e.g., "identity", "server").
71
32
  * @param log - Optional logger for non-ENOENT removal errors. When omitted, errors are silently ignored.
72
33
  */
73
34
  export function clearPidFile(filePath, label, log) {
@@ -1 +1 @@
1
- {"version":3,"file":"pid.js","sourceRoot":"","sources":["../../src/utils/pid.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,SAAS,CAAC;AAEzB;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAE1C,IAAI,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAM,KAAc,EAAE,CAAC;QAEvB,wFAAwF;QACxF,OAAQ,KAA+B,CAAC,IAAI,KAAK,OAAO,CAAC;IAC3D,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,KAAa,EAAE,GAA6D;IAExH,IAAI,CAAC;QAEH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAElC,IAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAEf,OAAO,GAAG,CAAC;QACb,CAAC;IACH,CAAC;IAAC,OAAM,KAAc,EAAE,CAAC;QAEvB,IAAG,CAAE,KAA+B,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI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,CAAC;IACd,CAAC;IAAC,OAAM,KAAc,EAAE,CAAC;QAEvB,wFAAwF;QACxF,OAAQ,KAA+B,CAAC,IAAI,KAAK,OAAO,CAAC;IAC3D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB,EAAE,KAAa,EAAE,GAA6D;IAEzH,IAAI,CAAC;QAEH,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAAC,OAAM,KAAc,EAAE,CAAC;QAEvB,IAAG,CAAE,KAA+B,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC;YAE/D,GAAG,CAAC,IAAI,CAAC,mCAAmC,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,CAAC,CAAC;QACjF,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ProcessInspectorContext } from "./processInspector.ts";
2
+ /**
3
+ * Builds the default ProcessInspectorContext from real runtime I/O. Dispatches to the platform-appropriate enumerator at adapter-creation time so the chosen
4
+ * branch is captured in a closure for every subsequent enumerate() call.
5
+ * @returns A ProcessInspectorContext wired to the current platform's process table reader.
6
+ */
7
+ export declare function createDefaultProcessInspectorContext(): ProcessInspectorContext;
@@ -0,0 +1,104 @@
1
+ import { parseLinuxProcCmdline, parseLinuxProcStat, parseMacOsPsOutput, parseWindowsFormatListOutput } from "./processInspector.js";
2
+ import { execFileSync } from "node:child_process";
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ /**
6
+ * Builds the default ProcessInspectorContext from real runtime I/O. Dispatches to the platform-appropriate enumerator at adapter-creation time so the chosen
7
+ * branch is captured in a closure for every subsequent enumerate() call.
8
+ * @returns A ProcessInspectorContext wired to the current platform's process table reader.
9
+ */
10
+ export function createDefaultProcessInspectorContext() {
11
+ return { enumerate: pickEnumeratorForPlatform() };
12
+ }
13
+ /**
14
+ * Selects the platform-appropriate enumerator. Linux uses /proc; macOS and Windows shell out to their native process listing utilities.
15
+ * @returns The enumerator function for the current platform.
16
+ */
17
+ function pickEnumeratorForPlatform() {
18
+ switch (process.platform) {
19
+ case "linux": {
20
+ return enumerateLinux;
21
+ }
22
+ case "darwin": {
23
+ return enumerateMacOs;
24
+ }
25
+ case "win32": {
26
+ return enumerateWindows;
27
+ }
28
+ default: {
29
+ // Unsupported platforms return an empty snapshot. Domain code that filters this list (e.g., looking for Chrome) will simply find no matches, which is
30
+ // the safe default - we never SIGTERM anything we did not actually discover.
31
+ return () => [];
32
+ }
33
+ }
34
+ }
35
+ /**
36
+ * Enumerates processes on Linux by walking /proc. Each numeric directory under /proc corresponds to a PID; reading its cmdline file yields the command line.
37
+ * Processes that exit between readdir and readFile produce ENOENT, which we silently skip.
38
+ * @returns The current process table.
39
+ */
40
+ function enumerateLinux() {
41
+ const results = [];
42
+ let entries;
43
+ try {
44
+ entries = fs.readdirSync("/proc");
45
+ }
46
+ catch {
47
+ return results;
48
+ }
49
+ for (const entry of entries) {
50
+ const pid = parseInt(entry, 10);
51
+ if (Number.isNaN(pid)) {
52
+ continue;
53
+ }
54
+ let cmdlineRaw;
55
+ let statRaw;
56
+ try {
57
+ cmdlineRaw = fs.readFileSync(path.join("/proc", entry, "cmdline"), "utf-8");
58
+ statRaw = fs.readFileSync(path.join("/proc", entry, "stat"), "utf-8");
59
+ }
60
+ catch {
61
+ // ENOENT (process exited between readdir and readFile), EACCES (permission denied for some PIDs as a non-root user), and similar are all expected during
62
+ // a /proc walk. Skip silently rather than aborting the whole enumeration.
63
+ continue;
64
+ }
65
+ const ppid = parseLinuxProcStat(statRaw);
66
+ if (ppid === null) {
67
+ continue;
68
+ }
69
+ results.push({ commandLine: parseLinuxProcCmdline(cmdlineRaw), pid, ppid });
70
+ }
71
+ return results;
72
+ }
73
+ /**
74
+ * Enumerates processes on macOS via `ps -axww -o pid=,command=`. The -ax flags select every process on the system; -ww disables column truncation so long
75
+ * command lines (Chrome's are frequently very long) survive intact; the trailing `=` on each -o spec suppresses the column headers.
76
+ * @returns The current process table.
77
+ */
78
+ function enumerateMacOs() {
79
+ try {
80
+ // maxBuffer is bumped to 16MB to accommodate hosts with thousands of processes and Chrome's long --flag-soup command lines.
81
+ const raw = execFileSync("/bin/ps", ["-axww", "-o", "pid=,ppid=,command="], { encoding: "utf-8", maxBuffer: 16 * 1024 * 1024 });
82
+ return parseMacOsPsOutput(raw);
83
+ }
84
+ catch {
85
+ return [];
86
+ }
87
+ }
88
+ /**
89
+ * Enumerates processes on Windows via PowerShell's Get-CimInstance Win32_Process pipeline. We choose Format-List output over Format-Table because the latter
90
+ * truncates the CommandLine column, and choose CIM over the legacy wmic.exe because wmic is being deprecated by Microsoft and is absent from Windows Server
91
+ * Core / minimal SKUs.
92
+ * @returns The current process table.
93
+ */
94
+ function enumerateWindows() {
95
+ try {
96
+ // -NoProfile skips loading the user's PowerShell profile (saves hundreds of milliseconds); -Command is the parameter form most resilient to quoting.
97
+ const raw = execFileSync("powershell.exe", ["-NoProfile", "-Command", "Get-CimInstance Win32_Process | Format-List ProcessId,ParentProcessId,CommandLine"], { encoding: "utf-8", maxBuffer: 16 * 1024 * 1024 });
98
+ return parseWindowsFormatListOutput(raw);
99
+ }
100
+ catch {
101
+ return [];
102
+ }
103
+ }
104
+ //# sourceMappingURL=processInspector.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processInspector.context.js","sourceRoot":"","sources":["../../src/utils/processInspector.context.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACpI,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,oCAAoC;IAElD,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAE,EAAE,CAAC;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AC;YAEP,yJAAyJ;YACzJ,0EAA0E;YAC1E,SAAS;QACX,CAAC;QAED,MAAM,IAAI,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAEzC,IAAG,IAAI,KAAK,IAAI,EAAE,CAAC;YAEjB,SAAS;QACX,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,qBAAqB,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9E,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc;IAErB,IAAI,CAAC;QAEH,4HAA4H;QAC5H,MAAM,GAAG,GAAG,YAAY,CAAC,SAAS,EAAE,CAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,CAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QAElI,OAAO,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QAEP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,gBAAgB;IAEvB,IAAI,CAAC;QAEH,qJAAqJ;QACrJ,MAAM,GAAG,GAAG,YAAY,CAAC,gBAAgB,EACvC,CAAE,YAAY,EAAE,UAAU,EAAE,mFAAmF,CAAE,EACjH,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC;QAEtD,OAAO,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QAEP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { Nullable } from "../types/index.ts";
2
+ /**
3
+ * One row of the OS process table. The triple (pid, ppid, commandLine) lets domain code identify a process by intent and verify its ownership via the
4
+ * parent-child relationship. The ppid in particular is what lets killStaleChrome safely run from any context: a process whose Chrome is matched by profile
5
+ * but whose ppid points at a live unrelated parent is owned by that parent, not by us, and we must leave it alone.
6
+ */
7
+ export interface ProcessInfo {
8
+ readonly commandLine: string;
9
+ readonly pid: number;
10
+ readonly ppid: number;
11
+ }
12
+ /**
13
+ * The runtime capability set listProcesses consumes. Production wires it from real I/O via createDefaultProcessInspectorContext; tests pass a context literal
14
+ * holding the desired ProcessInfo[].
15
+ */
16
+ export interface ProcessInspectorContext {
17
+ readonly enumerate: () => ProcessInfo[];
18
+ }
19
+ /**
20
+ * Returns a snapshot of every visible process. Callers filter the result for the processes they care about.
21
+ * @param ctx - The process inspector context. Defaults to real I/O wiring.
22
+ * @returns The current process table.
23
+ */
24
+ export declare function listProcesses(ctx?: ProcessInspectorContext): ProcessInfo[];
25
+ /**
26
+ * Parses a single /proc/<pid>/cmdline payload. The on-disk format separates argv entries with NUL bytes and may or may not include a trailing NUL. Empty
27
+ * payloads (kernel threads, zombie processes) yield an empty command line - callers decide whether to drop those entries.
28
+ * @param raw - The /proc/<pid>/cmdline payload.
29
+ * @returns The decoded command line.
30
+ */
31
+ export declare function parseLinuxProcCmdline(raw: string): string;
32
+ /**
33
+ * Parses the ppid (field 4) from a /proc/<pid>/stat payload. The format embeds the executable name in parentheses at field 2; that name can contain
34
+ * whitespace and parentheses itself, so we anchor on the last closing paren before splitting. After the closing paren, the first field is field 3 (state) and
35
+ * the second is field 4 (ppid).
36
+ * @param raw - The /proc/<pid>/stat payload.
37
+ * @returns The parent process ID, or null when the payload is malformed.
38
+ */
39
+ export declare function parseLinuxProcStat(raw: string): Nullable<number>;
40
+ /**
41
+ * Parses the output of `ps -axww -o pid=,ppid=,command=` (or equivalent shape). Each non-empty line begins with leading whitespace, then the PID and PPID as
42
+ * integers, then whitespace, then the full command. Lines that do not match this shape are silently dropped.
43
+ * @param raw - The raw ps output.
44
+ * @returns The parsed process table.
45
+ */
46
+ export declare function parseMacOsPsOutput(raw: string): ProcessInfo[];
47
+ /**
48
+ * Parses the output of PowerShell's `Get-CimInstance Win32_Process | Format-List ProcessId,ParentProcessId,CommandLine` (or equivalent shape). The format
49
+ * places each property on its own line as "Name : Value", with blank lines separating records. CommandLine may be blank (system processes) or contain
50
+ * embedded colons - we split on the first " : " separator only.
51
+ * @param raw - The raw Format-List output.
52
+ * @returns The parsed process table.
53
+ */
54
+ export declare function parseWindowsFormatListOutput(raw: string): ProcessInfo[];
@@ -0,0 +1,125 @@
1
+ import { createDefaultProcessInspectorContext } from "./processInspector.context.js";
2
+ /**
3
+ * Returns a snapshot of every visible process. Callers filter the result for the processes they care about.
4
+ * @param ctx - The process inspector context. Defaults to real I/O wiring.
5
+ * @returns The current process table.
6
+ */
7
+ export function listProcesses(ctx = createDefaultProcessInspectorContext()) {
8
+ return ctx.enumerate();
9
+ }
10
+ /**
11
+ * Parses a single /proc/<pid>/cmdline payload. The on-disk format separates argv entries with NUL bytes and may or may not include a trailing NUL. Empty
12
+ * payloads (kernel threads, zombie processes) yield an empty command line - callers decide whether to drop those entries.
13
+ * @param raw - The /proc/<pid>/cmdline payload.
14
+ * @returns The decoded command line.
15
+ */
16
+ export function parseLinuxProcCmdline(raw) {
17
+ // Drop a trailing NUL if present so the join does not produce a phantom blank arg.
18
+ const trimmed = raw.endsWith("\0") ? raw.slice(0, -1) : raw;
19
+ return trimmed.split("\0").join(" ");
20
+ }
21
+ /**
22
+ * Parses the ppid (field 4) from a /proc/<pid>/stat payload. The format embeds the executable name in parentheses at field 2; that name can contain
23
+ * whitespace and parentheses itself, so we anchor on the last closing paren before splitting. After the closing paren, the first field is field 3 (state) and
24
+ * the second is field 4 (ppid).
25
+ * @param raw - The /proc/<pid>/stat payload.
26
+ * @returns The parent process ID, or null when the payload is malformed.
27
+ */
28
+ export function parseLinuxProcStat(raw) {
29
+ const rparen = raw.lastIndexOf(")");
30
+ if (rparen === -1) {
31
+ return null;
32
+ }
33
+ const fields = raw.slice(rparen + 1).trim().split(/\s+/);
34
+ // We want field 4 (ppid), which lands at index 1 in the post-paren split: index 0 is state (field 3), index 1 is ppid (field 4).
35
+ if (fields.length < 2) {
36
+ return null;
37
+ }
38
+ const ppid = parseInt(fields[1] ?? "", 10);
39
+ return Number.isNaN(ppid) ? null : ppid;
40
+ }
41
+ /**
42
+ * Parses the output of `ps -axww -o pid=,ppid=,command=` (or equivalent shape). Each non-empty line begins with leading whitespace, then the PID and PPID as
43
+ * integers, then whitespace, then the full command. Lines that do not match this shape are silently dropped.
44
+ * @param raw - The raw ps output.
45
+ * @returns The parsed process table.
46
+ */
47
+ export function parseMacOsPsOutput(raw) {
48
+ const results = [];
49
+ for (const line of raw.split("\n")) {
50
+ const trimmed = line.trim();
51
+ if (trimmed === "") {
52
+ continue;
53
+ }
54
+ // Three captures: pid, ppid, and the rest. The command line is the rest of the line verbatim (may contain spaces).
55
+ const match = /^(\d+)\s+(\d+)\s+(.+)$/.exec(trimmed);
56
+ if (match === null) {
57
+ continue;
58
+ }
59
+ const pid = parseInt(match[1] ?? "", 10);
60
+ const ppid = parseInt(match[2] ?? "", 10);
61
+ const commandLine = match[3] ?? "";
62
+ if (Number.isNaN(pid) || Number.isNaN(ppid)) {
63
+ continue;
64
+ }
65
+ results.push({ commandLine, pid, ppid });
66
+ }
67
+ return results;
68
+ }
69
+ /**
70
+ * Parses the output of PowerShell's `Get-CimInstance Win32_Process | Format-List ProcessId,ParentProcessId,CommandLine` (or equivalent shape). The format
71
+ * places each property on its own line as "Name : Value", with blank lines separating records. CommandLine may be blank (system processes) or contain
72
+ * embedded colons - we split on the first " : " separator only.
73
+ * @param raw - The raw Format-List output.
74
+ * @returns The parsed process table.
75
+ */
76
+ export function parseWindowsFormatListOutput(raw) {
77
+ const results = [];
78
+ let currentPid = null;
79
+ let currentPpid = null;
80
+ let currentCommandLine = null;
81
+ const flush = () => {
82
+ if ((currentPid !== null) && (currentPpid !== null)) {
83
+ results.push({ commandLine: currentCommandLine ?? "", pid: currentPid, ppid: currentPpid });
84
+ }
85
+ currentPid = null;
86
+ currentPpid = null;
87
+ currentCommandLine = null;
88
+ };
89
+ for (const line of raw.split(/\r?\n/)) {
90
+ if (line.trim() === "") {
91
+ flush();
92
+ continue;
93
+ }
94
+ // Format-List output is "Name : Value" with the colon surrounded by spaces. We split on the first " : " so values containing colons survive intact.
95
+ const sep = line.indexOf(" : ");
96
+ if (sep === -1) {
97
+ continue;
98
+ }
99
+ const key = line.slice(0, sep).trim();
100
+ const value = line.slice(sep + 3);
101
+ switch (key) {
102
+ case "ProcessId": {
103
+ const parsed = parseInt(value.trim(), 10);
104
+ currentPid = Number.isNaN(parsed) ? null : parsed;
105
+ break;
106
+ }
107
+ case "ParentProcessId": {
108
+ const parsed = parseInt(value.trim(), 10);
109
+ currentPpid = Number.isNaN(parsed) ? null : parsed;
110
+ break;
111
+ }
112
+ case "CommandLine": {
113
+ currentCommandLine = value;
114
+ break;
115
+ }
116
+ default: {
117
+ // Other Format-List keys (Name, Path, ...) are ignored. Tolerating extra fields keeps the parser robust to upstream additions.
118
+ }
119
+ }
120
+ }
121
+ // Flush the trailing record if the output did not end with a blank line.
122
+ flush();
123
+ return results;
124
+ }
125
+ //# sourceMappingURL=processInspector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processInspector.js","sourceRoot":"","sources":["../../src/utils/processInspector.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAC;AA+BrF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAA+B,oCAAoC,EAAE;IAEjG,OAAO,GAAG,CAAC,SAAS,EAAE,CAAC;AACzB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAE/C,mFAAmF;IACnF,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CA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clock.ts";
2
2
  /**
3
3
  * Options for retryOperation. Groups all parameters into a single object to avoid positional parameter sprawl and make the function extensible.
4
4
  */
@@ -4,9 +4,9 @@
4
4
  * control sleeps and timeout races without depending on real-time delays - the function's nested raceWithTimeout/Promise.race/finally/await delay chain is
5
5
  * exactly the shape Node's synchronous mock.timers.tick cannot drain.
6
6
  */
7
- import { realClock } from "./clock.js";
8
7
  import { formatError, isSessionClosedError } from "./errors.js";
9
8
  import { LOG } from "./logger.js";
9
+ import { realClock } from "./clock.js";
10
10
  /**
11
11
  * Implements a generic retry mechanism with exponential backoff and jitter. This function attempts an operation multiple times, waiting progressively longer between
12
12
  * attempts to avoid overwhelming failing services. The exponential backoff with jitter prevents thundering herd problems where many clients retry simultaneously.
@@ -1 +1 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAc,SAAS,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AA4ClC;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,OAAwB;IAE9D,MAAM,EAAE,aAAa,GAAG,IAAI,EAAE,KAAK,GAAG,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,eAAe,GAAG,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC;IAEpK,IAAI,SAAS,GAAY,IAAI,CAAC;IAE9B,KAAI,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QAEvD,gJAAgJ;QAChJ,IAAG,WAAW,EAAE,EAAE,EAAE,CAAC;YAEnB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;QAC1E,CAAC;QAED,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ntimeIdentityContext populated from the live process.
5
+ */
6
+ export declare function createDefaultRuntimeIdentityContext(): RuntimeIdentityContext;
@@ -0,0 +1,13 @@
1
+ import { getBootSessionId } from "./bootSession.js";
2
+ import { isProcessRunning } from "./pid.js";
3
+ /**
4
+ * Builds the default RuntimeIdentityContext from real runtime I/O.
5
+ * @returns A RuntimeIdentityContext populated from the live process.
6
+ */
7
+ export function createDefaultRuntimeIdentityContext() {
8
+ return {
9
+ getBootSessionId: () => getBootSessionId(),
10
+ isProcessRunning
11
+ };
12
+ }
13
+ //# sourceMappingURL=runtimeIdentity.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeIdentity.context.js","sourceRoot":"","sources":["../../src/utils/runtimeIdentity.context.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;GAGG;AACH,MAAM,UAAU,mCAAmC;IAEjD,OAAO;QAEL,gBAAgB,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE;QAC1C,gBAAgB;KACjB,CAAC;AACJ,CAAC"}