@procwire/transport 0.1.1

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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +844 -0
  3. package/dist/channel/builder.d.ts +68 -0
  4. package/dist/channel/builder.d.ts.map +1 -0
  5. package/dist/channel/builder.js +120 -0
  6. package/dist/channel/builder.js.map +1 -0
  7. package/dist/channel/index.d.ts +6 -0
  8. package/dist/channel/index.d.ts.map +1 -0
  9. package/dist/channel/index.js +6 -0
  10. package/dist/channel/index.js.map +1 -0
  11. package/dist/channel/quickstart.d.ts +94 -0
  12. package/dist/channel/quickstart.d.ts.map +1 -0
  13. package/dist/channel/quickstart.js +104 -0
  14. package/dist/channel/quickstart.js.map +1 -0
  15. package/dist/channel/request-channel.d.ts +119 -0
  16. package/dist/channel/request-channel.d.ts.map +1 -0
  17. package/dist/channel/request-channel.js +476 -0
  18. package/dist/channel/request-channel.js.map +1 -0
  19. package/dist/channel/types.d.ts +226 -0
  20. package/dist/channel/types.d.ts.map +1 -0
  21. package/dist/channel/types.js +2 -0
  22. package/dist/channel/types.js.map +1 -0
  23. package/dist/framing/index.d.ts +4 -0
  24. package/dist/framing/index.d.ts.map +1 -0
  25. package/dist/framing/index.js +4 -0
  26. package/dist/framing/index.js.map +1 -0
  27. package/dist/framing/length-prefixed.d.ts +55 -0
  28. package/dist/framing/length-prefixed.d.ts.map +1 -0
  29. package/dist/framing/length-prefixed.js +102 -0
  30. package/dist/framing/length-prefixed.js.map +1 -0
  31. package/dist/framing/line-delimited.d.ts +61 -0
  32. package/dist/framing/line-delimited.d.ts.map +1 -0
  33. package/dist/framing/line-delimited.js +94 -0
  34. package/dist/framing/line-delimited.js.map +1 -0
  35. package/dist/framing/types.d.ts +35 -0
  36. package/dist/framing/types.d.ts.map +1 -0
  37. package/dist/framing/types.js +2 -0
  38. package/dist/framing/types.js.map +1 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +26 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/process/handle.d.ts +64 -0
  44. package/dist/process/handle.d.ts.map +1 -0
  45. package/dist/process/handle.js +107 -0
  46. package/dist/process/handle.js.map +1 -0
  47. package/dist/process/index.d.ts +37 -0
  48. package/dist/process/index.d.ts.map +1 -0
  49. package/dist/process/index.js +37 -0
  50. package/dist/process/index.js.map +1 -0
  51. package/dist/process/manager.d.ts +58 -0
  52. package/dist/process/manager.d.ts.map +1 -0
  53. package/dist/process/manager.js +360 -0
  54. package/dist/process/manager.js.map +1 -0
  55. package/dist/process/types.d.ts +322 -0
  56. package/dist/process/types.d.ts.map +1 -0
  57. package/dist/process/types.js +2 -0
  58. package/dist/process/types.js.map +1 -0
  59. package/dist/protocol/index.d.ts +4 -0
  60. package/dist/protocol/index.d.ts.map +1 -0
  61. package/dist/protocol/index.js +6 -0
  62. package/dist/protocol/index.js.map +1 -0
  63. package/dist/protocol/jsonrpc.d.ts +146 -0
  64. package/dist/protocol/jsonrpc.d.ts.map +1 -0
  65. package/dist/protocol/jsonrpc.js +288 -0
  66. package/dist/protocol/jsonrpc.js.map +1 -0
  67. package/dist/protocol/simple.d.ts +139 -0
  68. package/dist/protocol/simple.d.ts.map +1 -0
  69. package/dist/protocol/simple.js +297 -0
  70. package/dist/protocol/simple.js.map +1 -0
  71. package/dist/protocol/types.d.ts +117 -0
  72. package/dist/protocol/types.d.ts.map +1 -0
  73. package/dist/protocol/types.js +2 -0
  74. package/dist/protocol/types.js.map +1 -0
  75. package/dist/serialization/index.d.ts +5 -0
  76. package/dist/serialization/index.d.ts.map +1 -0
  77. package/dist/serialization/index.js +5 -0
  78. package/dist/serialization/index.js.map +1 -0
  79. package/dist/serialization/json.d.ts +66 -0
  80. package/dist/serialization/json.d.ts.map +1 -0
  81. package/dist/serialization/json.js +66 -0
  82. package/dist/serialization/json.js.map +1 -0
  83. package/dist/serialization/raw.d.ts +38 -0
  84. package/dist/serialization/raw.d.ts.map +1 -0
  85. package/dist/serialization/raw.js +41 -0
  86. package/dist/serialization/raw.js.map +1 -0
  87. package/dist/serialization/registry.d.ts +91 -0
  88. package/dist/serialization/registry.d.ts.map +1 -0
  89. package/dist/serialization/registry.js +119 -0
  90. package/dist/serialization/registry.js.map +1 -0
  91. package/dist/serialization/types.d.ts +27 -0
  92. package/dist/serialization/types.d.ts.map +1 -0
  93. package/dist/serialization/types.js +2 -0
  94. package/dist/serialization/types.js.map +1 -0
  95. package/dist/transport/factory.d.ts +139 -0
  96. package/dist/transport/factory.d.ts.map +1 -0
  97. package/dist/transport/factory.js +162 -0
  98. package/dist/transport/factory.js.map +1 -0
  99. package/dist/transport/index.d.ts +6 -0
  100. package/dist/transport/index.d.ts.map +1 -0
  101. package/dist/transport/index.js +9 -0
  102. package/dist/transport/index.js.map +1 -0
  103. package/dist/transport/socket-server.d.ts +48 -0
  104. package/dist/transport/socket-server.d.ts.map +1 -0
  105. package/dist/transport/socket-server.js +215 -0
  106. package/dist/transport/socket-server.js.map +1 -0
  107. package/dist/transport/socket-transport.d.ts +67 -0
  108. package/dist/transport/socket-transport.d.ts.map +1 -0
  109. package/dist/transport/socket-transport.js +193 -0
  110. package/dist/transport/socket-transport.js.map +1 -0
  111. package/dist/transport/stdio-transport.d.ts +94 -0
  112. package/dist/transport/stdio-transport.d.ts.map +1 -0
  113. package/dist/transport/stdio-transport.js +234 -0
  114. package/dist/transport/stdio-transport.js.map +1 -0
  115. package/dist/transport/types.d.ts +131 -0
  116. package/dist/transport/types.d.ts.map +1 -0
  117. package/dist/transport/types.js +2 -0
  118. package/dist/transport/types.js.map +1 -0
  119. package/dist/utils/assert.d.ts +16 -0
  120. package/dist/utils/assert.d.ts.map +1 -0
  121. package/dist/utils/assert.js +31 -0
  122. package/dist/utils/assert.js.map +1 -0
  123. package/dist/utils/disposables.d.ts +38 -0
  124. package/dist/utils/disposables.d.ts.map +1 -0
  125. package/dist/utils/disposables.js +59 -0
  126. package/dist/utils/disposables.js.map +1 -0
  127. package/dist/utils/errors.d.ts +43 -0
  128. package/dist/utils/errors.d.ts.map +1 -0
  129. package/dist/utils/errors.js +69 -0
  130. package/dist/utils/errors.js.map +1 -0
  131. package/dist/utils/events.d.ts +58 -0
  132. package/dist/utils/events.d.ts.map +1 -0
  133. package/dist/utils/events.js +95 -0
  134. package/dist/utils/events.js.map +1 -0
  135. package/dist/utils/index.d.ts +8 -0
  136. package/dist/utils/index.d.ts.map +1 -0
  137. package/dist/utils/index.js +8 -0
  138. package/dist/utils/index.js.map +1 -0
  139. package/dist/utils/pipe-path.d.ts +48 -0
  140. package/dist/utils/pipe-path.d.ts.map +1 -0
  141. package/dist/utils/pipe-path.js +89 -0
  142. package/dist/utils/pipe-path.js.map +1 -0
  143. package/dist/utils/platform.d.ts +16 -0
  144. package/dist/utils/platform.d.ts.map +1 -0
  145. package/dist/utils/platform.js +22 -0
  146. package/dist/utils/platform.js.map +1 -0
  147. package/dist/utils/time.d.ts +38 -0
  148. package/dist/utils/time.d.ts.map +1 -0
  149. package/dist/utils/time.js +55 -0
  150. package/dist/utils/time.js.map +1 -0
  151. package/package.json +85 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvB,IAAI,CAAS;IAE7B,YAAY,OAAe,EAAE,IAAY,EAAE,KAAe;QACxD,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,4CAA4C;QAC5C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClD,CAAC;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= (data: T) => void;
6
+ /**
7
+ * Map of event names to their payload types.
8
+ * Usage: interface MyEvents extends EventMap { 'data': Buffer; 'error': Error; }
9
+ */
10
+ export interface EventMap {
11
+ [event: string]: unknown;
12
+ }
13
+ /**
14
+ * Type-safe event emitter with Unsubscribe pattern.
15
+ * Zero dependencies, designed for transport and channel layers.
16
+ *
17
+ * @example
18
+ * interface MyEvents extends EventMap {
19
+ * 'connect': void;
20
+ * 'data': Buffer;
21
+ * 'error': Error;
22
+ * }
23
+ *
24
+ * const emitter = new EventEmitter<MyEvents>();
25
+ * const unsub = emitter.on('data', (buf) => console.log(buf));
26
+ * emitter.emit('data', Buffer.from('hello'));
27
+ * unsub(); // cleanup
28
+ */
29
+ export declare class EventEmitter<TEventMap extends EventMap = EventMap> {
30
+ private readonly listeners;
31
+ /**
32
+ * Subscribes to an event.
33
+ * @returns Unsubscribe function to remove the listener
34
+ */
35
+ on<K extends keyof TEventMap>(event: K, handler: EventHandler<TEventMap[K]>): Unsubscribe;
36
+ /**
37
+ * Subscribes to an event that fires only once.
38
+ * @returns Unsubscribe function (in case you want to cancel before it fires)
39
+ */
40
+ once<K extends keyof TEventMap>(event: K, handler: EventHandler<TEventMap[K]>): Unsubscribe;
41
+ /**
42
+ * Removes a specific event listener.
43
+ */
44
+ off<K extends keyof TEventMap>(event: K, handler: EventHandler<TEventMap[K]>): void;
45
+ /**
46
+ * Emits an event to all registered listeners.
47
+ */
48
+ emit<K extends keyof TEventMap>(event: K, data: TEventMap[K]): void;
49
+ /**
50
+ * Removes all listeners for a specific event, or all events if no event specified.
51
+ */
52
+ removeAllListeners<K extends keyof TEventMap>(event?: K): void;
53
+ /**
54
+ * Returns the number of listeners for a specific event.
55
+ */
56
+ listenerCount<K extends keyof TEventMap>(event: K): number;
57
+ }
58
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAAA,OAAO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3
+ * Zero dependencies, designed for transport and channel layers.
4
+ *
5
+ * @example
6
+ * interface MyEvents extends EventMap {
7
+ * 'connect': void;
8
+ * 'data': Buffer;
9
+ * 'error': Error;
10
+ * }
11
+ *
12
+ * const emitter = new EventEmitter<MyEvents>();
13
+ * const unsub = emitter.on('data', (buf) => console.log(buf));
14
+ * emitter.emit('data', Buffer.from('hello'));
15
+ * unsub(); // cleanup
16
+ */
17
+ export class EventEmitter {
18
+ listeners = new Map();
19
+ /**
20
+ * Subscribes to an event.
21
+ * @returns Unsubscribe function to remove the listener
22
+ */
23
+ on(event, handler) {
24
+ let handlers = this.listeners.get(event);
25
+ if (!handlers) {
26
+ handlers = new Set();
27
+ this.listeners.set(event, handlers);
28
+ }
29
+ handlers.add(handler);
30
+ // Return unsubscribe function
31
+ return () => {
32
+ this.off(event, handler);
33
+ };
34
+ }
35
+ /**
36
+ * Subscribes to an event that fires only once.
37
+ * @returns Unsubscribe function (in case you want to cancel before it fires)
38
+ */
39
+ once(event, handler) {
40
+ const wrapper = (data) => {
41
+ this.off(event, wrapper);
42
+ handler(data);
43
+ };
44
+ return this.on(event, wrapper);
45
+ }
46
+ /**
47
+ * Removes a specific event listener.
48
+ */
49
+ off(event, handler) {
50
+ const handlers = this.listeners.get(event);
51
+ if (handlers) {
52
+ handlers.delete(handler);
53
+ if (handlers.size === 0) {
54
+ this.listeners.delete(event);
55
+ }
56
+ }
57
+ }
58
+ /**
59
+ * Emits an event to all registered listeners.
60
+ */
61
+ emit(event, data) {
62
+ const handlers = this.listeners.get(event);
63
+ if (handlers) {
64
+ // Clone set to avoid issues if handler unsubscribes during emit
65
+ for (const handler of Array.from(handlers)) {
66
+ try {
67
+ handler(data);
68
+ }
69
+ catch (error) {
70
+ // Emit error event if available, otherwise log
71
+ console.error(`Error in event handler for '${String(event)}':`, error);
72
+ }
73
+ }
74
+ }
75
+ }
76
+ /**
77
+ * Removes all listeners for a specific event, or all events if no event specified.
78
+ */
79
+ removeAllListeners(event) {
80
+ if (event !== undefined) {
81
+ this.listeners.delete(event);
82
+ }
83
+ else {
84
+ this.listeners.clear();
85
+ }
86
+ }
87
+ /**
88
+ * Returns the number of listeners for a specific event.
89
+ */
90
+ listenerCount(event) {
91
+ const handlers = this.listeners.get(event);
92
+ return handlers ? handlers.size : 0;
93
+ }
94
+ }
95
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/utils/events.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,YAAY;IACN,SAAS,GAAG,IAAI,GAAG,EAAsC,CAAC;IAE3E;;;OAGG;IACH,EAAE,CAA4B,KAAQ,EAAE,OAAmC;QACzE,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,GAAG,EAAE,CAAC;YACrB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;QACD,QAAQ,CAAC,GAAG,CAAC,OAAuB,CAAC,CAAC;QAEtC,8BAA8B;QAC9B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACH,IAAI,CAA4B,KAAQ,EAAE,OAAmC;QAC3E,MAAM,OAAO,GAAG,CAAC,IAAkB,EAAE,EAAE;YACrC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAqC,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC;QACF,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAqC,CAAC,CAAC;IAC/D,CAAC;IAED;;OAEG;IACH,GAAG,CAA4B,KAAQ,EAAE,OAAmC;Q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AAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,8 @@
1
+ export * from "./errors.js";
2
+ export * from "./disposables.js";
3
+ export * from "./time.js";
4
+ export * from "./events.js";
5
+ export * from "./assert.js";
6
+ export * from "./platform.js";
7
+ export * from "./pipe-path.js";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from "./errors.js";
2
+ export * from "./disposables.js";
3
+ export * from "./time.js";
4
+ export * from "./events.js";
5
+ export * from "./assert.js";
6
+ export * from "./platform.js";
7
+ export * from "./pipe-path.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Cross-platform pipe path utilities for Named Pipes (Windows) and Unix Domain Sockets.
3
+ *
4
+ * Provides consistent path generation and cleanup across platforms.
5
+ */
6
+ export declare class PipePath {
7
+ /**
8
+ * Generates a platform-specific pipe/socket path for a module.
9
+ *
10
+ * Windows: `\\.\pipe\<namespace>-<moduleId>`
11
+ * Unix: `/tmp/<namespace>-<moduleId>.sock`
12
+ *
13
+ * @param namespace - Application namespace (e.g., 'procwire')
14
+ * @param moduleId - Module identifier (e.g., 'worker-1')
15
+ * @returns Platform-specific pipe/socket path
16
+ *
17
+ * @example
18
+ * ```ts
19
+ * // Windows: \\.\pipe\procwire-worker-1
20
+ * // Unix: /tmp/procwire-worker-1.sock
21
+ * const path = PipePath.forModule('procwire', 'worker-1');
22
+ * ```
23
+ */
24
+ static forModule(namespace: string, moduleId: string): string;
25
+ /**
26
+ * Cleans up a pipe/socket path (Unix only).
27
+ *
28
+ * On Unix, removes the socket file if it exists.
29
+ * On Windows, this is a no-op (Named Pipes are virtual).
30
+ *
31
+ * @param pipePath - Path to clean up
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * await PipePath.cleanup('/tmp/my-socket.sock');
36
+ * ```
37
+ */
38
+ static cleanup(pipePath: string): Promise<void>;
39
+ /**
40
+ * Sanitizes a string to be safe for use in pipe/socket names.
41
+ * Removes or replaces characters that could cause issues.
42
+ *
43
+ * @param input - String to sanitize
44
+ * @returns Sanitized string
45
+ */
46
+ private static sanitize;
47
+ }
48
+ //# sourceMappingURL=pipe-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipe-path.d.ts","sourceRoot":"","sources":["../../src/utils/pipe-path.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,qBAAa,QAAQ;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAe7D;;;;;;;;;;;;OAYG;WACU,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBrD;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ;CAMxB"}
@@ -0,0 +1,89 @@
1
+ import * as fs from "node:fs/promises";
2
+ import * as path from "node:path";
3
+ import { isWindows } from "./platform.js";
4
+ /**
5
+ * Cross-platform pipe path utilities for Named Pipes (Windows) and Unix Domain Sockets.
6
+ *
7
+ * Provides consistent path generation and cleanup across platforms.
8
+ */
9
+ export class PipePath {
10
+ /**
11
+ * Generates a platform-specific pipe/socket path for a module.
12
+ *
13
+ * Windows: `\\.\pipe\<namespace>-<moduleId>`
14
+ * Unix: `/tmp/<namespace>-<moduleId>.sock`
15
+ *
16
+ * @param namespace - Application namespace (e.g., 'procwire')
17
+ * @param moduleId - Module identifier (e.g., 'worker-1')
18
+ * @returns Platform-specific pipe/socket path
19
+ *
20
+ * @example
21
+ * ```ts
22
+ * // Windows: \\.\pipe\procwire-worker-1
23
+ * // Unix: /tmp/procwire-worker-1.sock
24
+ * const path = PipePath.forModule('procwire', 'worker-1');
25
+ * ```
26
+ */
27
+ static forModule(namespace, moduleId) {
28
+ // Sanitize inputs to remove problematic characters
29
+ const sanitizedNamespace = this.sanitize(namespace);
30
+ const sanitizedModuleId = this.sanitize(moduleId);
31
+ const name = `${sanitizedNamespace}-${sanitizedModuleId}`;
32
+ if (isWindows()) {
33
+ // Windows Named Pipe: \\.\pipe\<name>
34
+ return `\\\\.\\pipe\\${name}`;
35
+ }
36
+ else {
37
+ // Unix Domain Socket: /tmp/<name>.sock
38
+ return path.join("/tmp", `${name}.sock`);
39
+ }
40
+ }
41
+ /**
42
+ * Cleans up a pipe/socket path (Unix only).
43
+ *
44
+ * On Unix, removes the socket file if it exists.
45
+ * On Windows, this is a no-op (Named Pipes are virtual).
46
+ *
47
+ * @param pipePath - Path to clean up
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * await PipePath.cleanup('/tmp/my-socket.sock');
52
+ * ```
53
+ */
54
+ static async cleanup(pipePath) {
55
+ if (isWindows()) {
56
+ // Windows Named Pipes are virtual, no cleanup needed
57
+ return;
58
+ }
59
+ try {
60
+ // Check if file exists and is a socket
61
+ const stats = await fs.stat(pipePath);
62
+ if (stats.isSocket()) {
63
+ await fs.unlink(pipePath);
64
+ }
65
+ }
66
+ catch (error) {
67
+ // Ignore errors (file doesn't exist, permission issues, etc.)
68
+ // This is expected and safe
69
+ if (error.code !== "ENOENT") {
70
+ // Log unexpected errors but don't throw
71
+ // (we don't have a logger yet, so silently ignore)
72
+ }
73
+ }
74
+ }
75
+ /**
76
+ * Sanitizes a string to be safe for use in pipe/socket names.
77
+ * Removes or replaces characters that could cause issues.
78
+ *
79
+ * @param input - String to sanitize
80
+ * @returns Sanitized string
81
+ */
82
+ static sanitize(input) {
83
+ return input
84
+ .replace(/[^a-zA-Z0-9_-]/g, "_") // Replace non-alphanumeric (except _ and -) with _
85
+ .replace(/_{2,}/g, "_") // Replace multiple underscores with single
86
+ .replace(/^_+|_+$/g, ""); // Trim underscores from start/end
87
+ }
88
+ }
89
+ //# sourceMappingURL=pipe-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipe-path.js","sourceRoot":"","sources":["../../src/utils/pipe-path.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;;;GAIG;AACH,MAAM,OAAO,QAAQ;IACnB;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,SAAS,CAAC,SAAiB,EAAE,QAAgB;QAClD,mDAAmD;QACnD,MAAM,kBAAkB,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,GAAG,kBAAkB,IAAI,iBAAiB,EAAE,CAAC;QAE1D,IAAI,SAAS,EAAE,EAAE,CAAC;YAChB,sCAAsC;YACtC,OAAO,gBAAgB,IAAI,EAAE,CAAC;QAChC,CAAC;aAAM,CAAC;YACN,uCAAuC;YACvC,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,QAAgB;QACnC,IAAI,SAAS,EAAE,EAAE,CAAC;YAChB,qDAAqD;YACrD,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,uCAAuC;YACvC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACrB,MAAM,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,8DAA8D;YAC9D,4BAA4B;YAC5B,IAAK,KAA+B,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACvD,wCAAwC;gBACxC,mDAAmD;YACrD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,QAAQ,CAAC,KAAa;QACnC,OAAO,KAAK;aACT,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,mDAAmD;aACnF,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,2CAA2C;aAClE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC,kCAAkC;IAChE,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Platform detection utilities for cross-platform transport implementation.
3
+ */
4
+ /**
5
+ * Returns true if running on Windows platform.
6
+ */
7
+ export declare function isWindows(): boolean;
8
+ /**
9
+ * Returns true if running on Unix-like platform (Linux, macOS, BSD).
10
+ */
11
+ export declare function isUnix(): boolean;
12
+ /**
13
+ * Returns current platform identifier.
14
+ */
15
+ export declare function getPlatform(): NodeJS.Platform;
16
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAEnC;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAAC,QAAQ,CAE7C"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Platform detection utilities for cross-platform transport implementation.
3
+ */
4
+ /**
5
+ * Returns true if running on Windows platform.
6
+ */
7
+ export function isWindows() {
8
+ return process.platform === "win32";
9
+ }
10
+ /**
11
+ * Returns true if running on Unix-like platform (Linux, macOS, BSD).
12
+ */
13
+ export function isUnix() {
14
+ return process.platform === "darwin" || process.platform === "linux" || process.platform === "freebsd";
15
+ }
16
+ /**
17
+ * Returns current platform identifier.
18
+ */
19
+ export function getPlatform() {
20
+ return process.platform;
21
+ }
22
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/utils/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;AACzG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Sleeps for specified milliseconds.
3
+ */
4
+ export declare function sleep(ms: number): Promise<void>;
5
+ /**
6
+ * Options for withTimeout.
7
+ */
8
+ export interface TimeoutOptions {
9
+ /**
10
+ * Custom error message for timeout.
11
+ */
12
+ message?: string;
13
+ /**
14
+ * Cause to attach to timeout error.
15
+ */
16
+ cause?: unknown;
17
+ }
18
+ /**
19
+ * Wraps a promise with a timeout.
20
+ * Throws TimeoutError if promise doesn't settle within ms.
21
+ *
22
+ * @param promise - Promise to wrap
23
+ * @param ms - Timeout in milliseconds
24
+ * @param options - Optional message and cause for timeout error
25
+ * @returns Promise that rejects with TimeoutError on timeout
26
+ */
27
+ export declare function withTimeout<T>(promise: Promise<T>, ms: number, options?: TimeoutOptions): Promise<T>;
28
+ /**
29
+ * Creates a timeout signal that resolves after ms.
30
+ * Useful for race conditions with manual cancellation.
31
+ *
32
+ * @returns Object with promise and cancel function
33
+ */
34
+ export declare function createTimeoutSignal(ms: number): {
35
+ promise: Promise<never>;
36
+ cancel: () => void;
37
+ };
38
+ //# sourceMappingURL=time.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,CAAC,CAAC,CAiBZ;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,GAAG;IAC/C,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB,CAiBA"}
@@ -0,0 +1,55 @@
1
+ import { TimeoutError } from "./errors.js";
2
+ /**
3
+ * Sleeps for specified milliseconds.
4
+ */
5
+ export function sleep(ms) {
6
+ return new Promise((resolve) => setTimeout(resolve, ms));
7
+ }
8
+ /**
9
+ * Wraps a promise with a timeout.
10
+ * Throws TimeoutError if promise doesn't settle within ms.
11
+ *
12
+ * @param promise - Promise to wrap
13
+ * @param ms - Timeout in milliseconds
14
+ * @param options - Optional message and cause for timeout error
15
+ * @returns Promise that rejects with TimeoutError on timeout
16
+ */
17
+ export function withTimeout(promise, ms, options) {
18
+ return new Promise((resolve, reject) => {
19
+ const timeoutId = setTimeout(() => {
20
+ const message = options?.message ?? `Operation timed out after ${ms}ms`;
21
+ reject(new TimeoutError(message, options?.cause));
22
+ }, ms);
23
+ promise
24
+ .then((value) => {
25
+ clearTimeout(timeoutId);
26
+ resolve(value);
27
+ })
28
+ .catch((error) => {
29
+ clearTimeout(timeoutId);
30
+ reject(error);
31
+ });
32
+ });
33
+ }
34
+ /**
35
+ * Creates a timeout signal that resolves after ms.
36
+ * Useful for race conditions with manual cancellation.
37
+ *
38
+ * @returns Object with promise and cancel function
39
+ */
40
+ export function createTimeoutSignal(ms) {
41
+ let timeoutId;
42
+ const promise = new Promise((_, reject) => {
43
+ timeoutId = setTimeout(() => {
44
+ reject(new TimeoutError(`Timeout after ${ms}ms`));
45
+ }, ms);
46
+ });
47
+ const cancel = () => {
48
+ if (timeoutId !== undefined) {
49
+ clearTimeout(timeoutId);
50
+ timeoutId = undefined;
51
+ }
52
+ };
53
+ return { promise, cancel };
54
+ }
55
+ //# sourceMappingURL=time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,UAAU,KAAK,CAAC,EAAU;IAC9B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAC3D,CAAC;AAiBD;;;;;;;;G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AM,EAAE,CAAC;AAC7B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,85 @@
1
+ {
2
+ "name": "@procwire/transport",
3
+ "version": "0.1.1",
4
+ "description": "Standalone IPC transport building blocks for Node.js (core; zero runtime dependencies).",
5
+ "keywords": [
6
+ "ipc",
7
+ "inter-process-communication",
8
+ "stdio",
9
+ "pipes",
10
+ "sockets",
11
+ "json-rpc",
12
+ "transport",
13
+ "node",
14
+ "typescript"
15
+ ],
16
+ "author": "Sebastian Webdev",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/SebastianWebdev/procwire.git",
20
+ "directory": "transport"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/SebastianWebdev/procwire/issues"
24
+ },
25
+ "homepage": "https://github.com/SebastianWebdev/procwire/tree/main/transport#readme",
26
+ "type": "module",
27
+ "sideEffects": false,
28
+ "license": "MIT",
29
+ "engines": {
30
+ "node": ">=18"
31
+ },
32
+ "exports": {
33
+ ".": {
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "./transport": {
38
+ "types": "./dist/transport/index.d.ts",
39
+ "default": "./dist/transport/index.js"
40
+ },
41
+ "./framing": {
42
+ "types": "./dist/framing/index.d.ts",
43
+ "default": "./dist/framing/index.js"
44
+ },
45
+ "./serialization": {
46
+ "types": "./dist/serialization/index.d.ts",
47
+ "default": "./dist/serialization/index.js"
48
+ },
49
+ "./protocol": {
50
+ "types": "./dist/protocol/index.d.ts",
51
+ "default": "./dist/protocol/index.js"
52
+ },
53
+ "./channel": {
54
+ "types": "./dist/channel/index.d.ts",
55
+ "default": "./dist/channel/index.js"
56
+ },
57
+ "./process": {
58
+ "types": "./dist/process/index.d.ts",
59
+ "default": "./dist/process/index.js"
60
+ }
61
+ },
62
+ "main": "./dist/index.js",
63
+ "types": "./dist/index.d.ts",
64
+ "files": [
65
+ "dist",
66
+ "README.md",
67
+ "LICENSE"
68
+ ],
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "dependencies": {},
73
+ "devDependencies": {
74
+ "@types/node": "^22.0.0",
75
+ "rimraf": "^6.0.1",
76
+ "typescript": "^5.9.3",
77
+ "vitest": "^2.1.8"
78
+ },
79
+ "scripts": {
80
+ "clean": "rimraf dist \"*.tsbuildinfo\"",
81
+ "typecheck": "tsc -p tsconfig.json --noEmit",
82
+ "build": "tsc -p tsconfig.build.json",
83
+ "test": "vitest run"
84
+ }
85
+ }