iii-sdk 0.19.7 → 0.20.0-alpha.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 (89) hide show
  1. package/dist/channel.cjs +5 -0
  2. package/dist/channel.d.cts +2 -0
  3. package/dist/channel.d.mts +2 -0
  4. package/dist/channel.mjs +3 -0
  5. package/dist/{utils-DXL7JI0q.mjs → channels-De8fNMyx.mjs} +3 -108
  6. package/dist/channels-De8fNMyx.mjs.map +1 -0
  7. package/dist/{utils-CuS1Knym.cjs → channels-ZbQzcwnN.cjs} +3 -166
  8. package/dist/channels-ZbQzcwnN.cjs.map +1 -0
  9. package/dist/engine.cjs +5 -0
  10. package/dist/engine.d.cts +3 -0
  11. package/dist/engine.d.mts +3 -0
  12. package/dist/engine.mjs +3 -0
  13. package/dist/errors.cjs +28 -0
  14. package/dist/errors.cjs.map +1 -0
  15. package/dist/errors.d.cts +40 -0
  16. package/dist/errors.d.cts.map +1 -0
  17. package/dist/errors.d.mts +40 -0
  18. package/dist/errors.d.mts.map +1 -0
  19. package/dist/errors.mjs +25 -0
  20. package/dist/errors.mjs.map +1 -0
  21. package/dist/helpers.cjs +6 -5
  22. package/dist/helpers.cjs.map +1 -1
  23. package/dist/helpers.d.cts +23 -5
  24. package/dist/helpers.d.cts.map +1 -1
  25. package/dist/helpers.d.mts +23 -5
  26. package/dist/helpers.d.mts.map +1 -1
  27. package/dist/helpers.mjs +4 -3
  28. package/dist/helpers.mjs.map +1 -1
  29. package/dist/iii-constants-Baptl8nm.d.mts +47 -0
  30. package/dist/iii-constants-Baptl8nm.d.mts.map +1 -0
  31. package/dist/iii-constants-BqXp8xSN.d.cts +47 -0
  32. package/dist/iii-constants-BqXp8xSN.d.cts.map +1 -0
  33. package/dist/iii-constants-Br94RUNi.cjs +67 -0
  34. package/dist/iii-constants-Br94RUNi.cjs.map +1 -0
  35. package/dist/iii-constants-_k3SoHry.mjs +43 -0
  36. package/dist/iii-constants-_k3SoHry.mjs.map +1 -0
  37. package/dist/iii-types-6aHBgy7l.cjs +24 -0
  38. package/dist/iii-types-6aHBgy7l.cjs.map +1 -0
  39. package/dist/iii-types-CRx2qAjB.mjs +18 -0
  40. package/dist/iii-types-CRx2qAjB.mjs.map +1 -0
  41. package/dist/index.cjs +93 -172
  42. package/dist/index.cjs.map +1 -1
  43. package/dist/index.d.cts +14 -81
  44. package/dist/index.d.cts.map +1 -1
  45. package/dist/index.d.mts +14 -81
  46. package/dist/index.d.mts.map +1 -1
  47. package/dist/index.mjs +30 -104
  48. package/dist/index.mjs.map +1 -1
  49. package/dist/internal.cjs +0 -0
  50. package/dist/internal.d.cts +2 -0
  51. package/dist/internal.d.mts +2 -0
  52. package/dist/internal.mjs +1 -0
  53. package/dist/protocol.cjs +4 -0
  54. package/dist/protocol.d.cts +2 -0
  55. package/dist/protocol.d.mts +2 -0
  56. package/dist/protocol.mjs +3 -0
  57. package/dist/runtime.cjs +0 -0
  58. package/dist/runtime.d.cts +3 -0
  59. package/dist/runtime.d.mts +3 -0
  60. package/dist/runtime.mjs +1 -0
  61. package/dist/state.cjs.map +1 -1
  62. package/dist/state.d.cts +3 -7
  63. package/dist/state.d.cts.map +1 -1
  64. package/dist/state.d.mts +3 -7
  65. package/dist/state.d.mts.map +1 -1
  66. package/dist/state.mjs.map +1 -1
  67. package/dist/stream.d.cts +5 -246
  68. package/dist/stream.d.cts.map +1 -1
  69. package/dist/stream.d.mts +5 -246
  70. package/dist/stream.d.mts.map +1 -1
  71. package/dist/trigger.cjs +0 -0
  72. package/dist/trigger.d.cts +2 -0
  73. package/dist/trigger.d.mts +2 -0
  74. package/dist/trigger.mjs +1 -0
  75. package/dist/{utils-BnRzIUCy.d.cts → types-BZoO05vA.d.cts} +45 -220
  76. package/dist/types-BZoO05vA.d.cts.map +1 -0
  77. package/dist/{utils-e84Qph-9.d.mts → types-BlFE8MZG.d.mts} +45 -220
  78. package/dist/types-BlFE8MZG.d.mts.map +1 -0
  79. package/dist/utils-63wxBJg-.cjs +121 -0
  80. package/dist/utils-63wxBJg-.cjs.map +1 -0
  81. package/dist/utils-8G4hHqvZ.mjs +69 -0
  82. package/dist/utils-8G4hHqvZ.mjs.map +1 -0
  83. package/package.json +37 -2
  84. package/typedoc.json +13 -1
  85. package/vitest.config.ts +3 -3
  86. package/dist/utils-BnRzIUCy.d.cts.map +0 -1
  87. package/dist/utils-CuS1Knym.cjs.map +0 -1
  88. package/dist/utils-DXL7JI0q.mjs.map +0 -1
  89. package/dist/utils-e84Qph-9.d.mts.map +0 -1
@@ -1,20 +1,38 @@
1
- import { S as ChannelItem, o as Channel, r as isChannelRef, t as extractChannelRefs, u as ISdk, x as ChannelDirection } from "./utils-BnRzIUCy.cjs";
1
+ import { D as StreamChannelRef, _ as ChannelItem, g as ChannelDirection, r as IIIClient, t as Channel } from "./types-BZoO05vA.cjs";
2
2
  import { IStream } from "./stream.cjs";
3
3
 
4
+ //#region src/utils.d.ts
5
+ /**
6
+ * Type guard that checks if a value is a {@link StreamChannelRef}.
7
+ *
8
+ * @param value - Value to check.
9
+ * @returns `true` if the value is a valid `StreamChannelRef`.
10
+ */
11
+ declare const isChannelRef: (value: unknown) => value is StreamChannelRef;
12
+ /**
13
+ * Recursively extract all {@link StreamChannelRef} values from a JSON-like
14
+ * input, returning each match paired with its dotted/bracketed path. Mirrors
15
+ * the Rust SDK's `extract_channel_refs`.
16
+ *
17
+ * @param data - Arbitrary JSON-like value.
18
+ * @returns Array of `[path, ref]` tuples. Empty when no refs are found.
19
+ */
20
+ declare const extractChannelRefs: (data: unknown) => Array<[string, StreamChannelRef]>;
21
+ //#endregion
4
22
  //#region src/helpers.d.ts
5
23
  /**
6
24
  * Create a streaming channel pair for worker-to-worker data transfer.
7
25
  *
8
- * Free-function form of the previous `ISdk.createChannel` instance method.
26
+ * Free-function form of the previous `IIIClient.createChannel` instance method.
9
27
  */
10
- declare function createChannel(iii: ISdk, bufferSize?: number): Promise<Channel>;
28
+ declare function createChannel(iii: IIIClient, bufferSize?: number): Promise<Channel>;
11
29
  /**
12
30
  * Register a custom stream implementation by wiring its 5 callable methods
13
31
  * to `stream::get/set/delete/list/list_groups`.
14
32
  *
15
- * Free-function form of the previous `ISdk.createStream` instance method.
33
+ * Free-function form of the previous `IIIClient.createStream` instance method.
16
34
  */
17
- declare function createStream<TData>(iii: ISdk, streamName: string, stream: IStream<TData>): void;
35
+ declare function createStream<TData>(iii: IIIClient, streamName: string, stream: IStream<TData>): void;
18
36
  //#endregion
19
37
  export { ChannelDirection, ChannelItem, createChannel, createStream, extractChannelRefs, isChannelRef };
20
38
  //# sourceMappingURL=helpers.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.cts","names":[],"sources":["../src/helpers.ts"],"mappings":";;;;;;;;;iBAuBgB,aAAA,CAAc,GAAA,EAAK,IAAA,EAAM,UAAA,YAAsB,OAAA,CAAQ,OAAA;;;AAUvE;;;;iBAAgB,YAAA,OAAA,CAAoB,GAAA,EAAK,IAAA,EAAM,UAAA,UAAoB,MAAA,EAAQ,OAAA,CAAQ,KAAA"}
1
+ {"version":3,"file":"helpers.d.cts","names":[],"sources":["../src/utils.ts","../src/helpers.ts"],"mappings":";;;;;;AAuDA;;;;cAlBa,YAAA,GAAgB,KAAA,cAAiB,KAAA,IAAS,gBAAA;;;;;;;;ACdvD;cDgCa,kBAAA,GAAsB,IAAA,cAAgB,KAAA,UAAe,gBAAA;;;;;AAAlE;;;iBChCgB,aAAA,CAAc,GAAA,EAAK,SAAA,EAAW,UAAA,YAAsB,OAAA,CAAQ,OAAA;;;;;;;iBAU5D,YAAA,OAAA,CAAoB,GAAA,EAAK,SAAA,EAAW,UAAA,UAAoB,MAAA,EAAQ,OAAA,CAAQ,KAAA"}
@@ -1,20 +1,38 @@
1
- import { S as ChannelItem, o as Channel, r as isChannelRef, t as extractChannelRefs, u as ISdk, x as ChannelDirection } from "./utils-e84Qph-9.mjs";
1
+ import { D as StreamChannelRef, _ as ChannelItem, g as ChannelDirection, r as IIIClient, t as Channel } from "./types-BlFE8MZG.mjs";
2
2
  import { IStream } from "./stream.mjs";
3
3
 
4
+ //#region src/utils.d.ts
5
+ /**
6
+ * Type guard that checks if a value is a {@link StreamChannelRef}.
7
+ *
8
+ * @param value - Value to check.
9
+ * @returns `true` if the value is a valid `StreamChannelRef`.
10
+ */
11
+ declare const isChannelRef: (value: unknown) => value is StreamChannelRef;
12
+ /**
13
+ * Recursively extract all {@link StreamChannelRef} values from a JSON-like
14
+ * input, returning each match paired with its dotted/bracketed path. Mirrors
15
+ * the Rust SDK's `extract_channel_refs`.
16
+ *
17
+ * @param data - Arbitrary JSON-like value.
18
+ * @returns Array of `[path, ref]` tuples. Empty when no refs are found.
19
+ */
20
+ declare const extractChannelRefs: (data: unknown) => Array<[string, StreamChannelRef]>;
21
+ //#endregion
4
22
  //#region src/helpers.d.ts
5
23
  /**
6
24
  * Create a streaming channel pair for worker-to-worker data transfer.
7
25
  *
8
- * Free-function form of the previous `ISdk.createChannel` instance method.
26
+ * Free-function form of the previous `IIIClient.createChannel` instance method.
9
27
  */
10
- declare function createChannel(iii: ISdk, bufferSize?: number): Promise<Channel>;
28
+ declare function createChannel(iii: IIIClient, bufferSize?: number): Promise<Channel>;
11
29
  /**
12
30
  * Register a custom stream implementation by wiring its 5 callable methods
13
31
  * to `stream::get/set/delete/list/list_groups`.
14
32
  *
15
- * Free-function form of the previous `ISdk.createStream` instance method.
33
+ * Free-function form of the previous `IIIClient.createStream` instance method.
16
34
  */
17
- declare function createStream<TData>(iii: ISdk, streamName: string, stream: IStream<TData>): void;
35
+ declare function createStream<TData>(iii: IIIClient, streamName: string, stream: IStream<TData>): void;
18
36
  //#endregion
19
37
  export { ChannelDirection, ChannelItem, createChannel, createStream, extractChannelRefs, isChannelRef };
20
38
  //# sourceMappingURL=helpers.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.mts","names":[],"sources":["../src/helpers.ts"],"mappings":";;;;;;;;;iBAuBgB,aAAA,CAAc,GAAA,EAAK,IAAA,EAAM,UAAA,YAAsB,OAAA,CAAQ,OAAA;;;AAUvE;;;;iBAAgB,YAAA,OAAA,CAAoB,GAAA,EAAK,IAAA,EAAM,UAAA,UAAoB,MAAA,EAAQ,OAAA,CAAQ,KAAA"}
1
+ {"version":3,"file":"helpers.d.mts","names":[],"sources":["../src/utils.ts","../src/helpers.ts"],"mappings":";;;;;;AAuDA;;;;cAlBa,YAAA,GAAgB,KAAA,cAAiB,KAAA,IAAS,gBAAA;;;;;;;;ACdvD;cDgCa,kBAAA,GAAsB,IAAA,cAAgB,KAAA,UAAe,gBAAA;;;;;AAAlE;;;iBChCgB,aAAA,CAAc,GAAA,EAAK,SAAA,EAAW,UAAA,YAAsB,OAAA,CAAQ,OAAA;;;;;;;iBAU5D,YAAA,OAAA,CAAoB,GAAA,EAAK,SAAA,EAAW,UAAA,UAAoB,MAAA,EAAQ,OAAA,CAAQ,KAAA"}
package/dist/helpers.mjs CHANGED
@@ -1,10 +1,11 @@
1
- import { a as ChannelDirection, i as isChannelRef, n as extractChannelRefs, o as ChannelItem } from "./utils-DXL7JI0q.mjs";
1
+ import { n as ChannelItem, t as ChannelDirection } from "./channels-De8fNMyx.mjs";
2
+ import { n as extractChannelRefs, r as isChannelRef } from "./utils-8G4hHqvZ.mjs";
2
3
 
3
4
  //#region src/helpers.ts
4
5
  /**
5
6
  * Create a streaming channel pair for worker-to-worker data transfer.
6
7
  *
7
- * Free-function form of the previous `ISdk.createChannel` instance method.
8
+ * Free-function form of the previous `IIIClient.createChannel` instance method.
8
9
  */
9
10
  function createChannel(iii, bufferSize) {
10
11
  return iii.__helpers_create_channel(bufferSize);
@@ -13,7 +14,7 @@ function createChannel(iii, bufferSize) {
13
14
  * Register a custom stream implementation by wiring its 5 callable methods
14
15
  * to `stream::get/set/delete/list/list_groups`.
15
16
  *
16
- * Free-function form of the previous `ISdk.createStream` instance method.
17
+ * Free-function form of the previous `IIIClient.createStream` instance method.
17
18
  */
18
19
  function createStream(iii, streamName, stream) {
19
20
  iii.__helpers_create_stream(streamName, stream);
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.mjs","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["/**\n * Helper free functions that operate on an {@link ISdk} instance.\n *\n * These were previously instance methods on the SDK. They take the iii\n * instance as the first argument so the public API surface of `ISdk` stays\n * focused on the core lifecycle and registration methods.\n */\nimport type { Channel, ISdk } from './types'\nimport type { IStream } from './stream'\n\nexport { ChannelDirection, ChannelItem } from './channels'\nexport { extractChannelRefs, isChannelRef } from './utils'\n\ntype IIIWithHelperShims = ISdk & {\n __helpers_create_channel(bufferSize?: number): Promise<Channel>\n __helpers_create_stream<T>(name: string, stream: IStream<T>): void\n}\n\n/**\n * Create a streaming channel pair for worker-to-worker data transfer.\n *\n * Free-function form of the previous `ISdk.createChannel` instance method.\n */\nexport function createChannel(iii: ISdk, bufferSize?: number): Promise<Channel> {\n return (iii as IIIWithHelperShims).__helpers_create_channel(bufferSize)\n}\n\n/**\n * Register a custom stream implementation by wiring its 5 callable methods\n * to `stream::get/set/delete/list/list_groups`.\n *\n * Free-function form of the previous `ISdk.createStream` instance method.\n */\nexport function createStream<TData>(iii: ISdk, streamName: string, stream: IStream<TData>): void {\n ;(iii as IIIWithHelperShims).__helpers_create_stream(streamName, stream)\n}\n"],"mappings":";;;;;;;;AAuBA,SAAgB,cAAc,KAAW,YAAuC;AAC9E,QAAQ,IAA2B,yBAAyB,WAAW;;;;;;;;AASzE,SAAgB,aAAoB,KAAW,YAAoB,QAA8B;AAC9F,CAAC,IAA2B,wBAAwB,YAAY,OAAO"}
1
+ {"version":3,"file":"helpers.mjs","names":[],"sources":["../src/helpers.ts"],"sourcesContent":["/**\n * Helper free functions that operate on an {@link IIIClient} instance.\n *\n * These were previously instance methods on the SDK. They take the iii\n * instance as the first argument so the public API surface of `IIIClient` stays\n * focused on the core lifecycle and registration methods.\n */\nimport type { Channel, IIIClient } from './types'\nimport type { IStream } from './stream'\n\nexport { ChannelDirection, ChannelItem } from './channels'\nexport { extractChannelRefs, isChannelRef } from './utils'\n\ntype IIIWithHelperShims = IIIClient & {\n __helpers_create_channel(bufferSize?: number): Promise<Channel>\n __helpers_create_stream<T>(name: string, stream: IStream<T>): void\n}\n\n/**\n * Create a streaming channel pair for worker-to-worker data transfer.\n *\n * Free-function form of the previous `IIIClient.createChannel` instance method.\n */\nexport function createChannel(iii: IIIClient, bufferSize?: number): Promise<Channel> {\n return (iii as IIIWithHelperShims).__helpers_create_channel(bufferSize)\n}\n\n/**\n * Register a custom stream implementation by wiring its 5 callable methods\n * to `stream::get/set/delete/list/list_groups`.\n *\n * Free-function form of the previous `IIIClient.createStream` instance method.\n */\nexport function createStream<TData>(iii: IIIClient, streamName: string, stream: IStream<TData>): void {\n ;(iii as IIIWithHelperShims).__helpers_create_stream(streamName, stream)\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,cAAc,KAAgB,YAAuC;AACnF,QAAQ,IAA2B,yBAAyB,WAAW;;;;;;;;AASzE,SAAgB,aAAoB,KAAgB,YAAoB,QAA8B;AACnG,CAAC,IAA2B,wBAAwB,YAAY,OAAO"}
@@ -0,0 +1,47 @@
1
+ //#region src/iii-constants.d.ts
2
+ /**
3
+ * Constants for the III module.
4
+ */
5
+ /**
6
+ * Engine function paths for internal operations.
7
+ *
8
+ * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
9
+ * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
10
+ * cover trigger INSTANCES (subscriber rows). The old
11
+ * `engine::trigger-types::list` builtin has been removed and is now
12
+ * served by `engine::triggers::list`.
13
+ */
14
+ declare const EngineFunctions: {
15
+ readonly LIST_FUNCTIONS: "engine::functions::list";
16
+ readonly INFO_FUNCTIONS: "engine::functions::info";
17
+ readonly LIST_WORKERS: "engine::workers::list";
18
+ readonly INFO_WORKERS: "engine::workers::info";
19
+ readonly LIST_TRIGGERS: "engine::triggers::list";
20
+ readonly INFO_TRIGGERS: "engine::triggers::info";
21
+ readonly LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list";
22
+ readonly INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info";
23
+ readonly REGISTER_WORKER: "engine::workers::register";
24
+ };
25
+ /** Engine trigger types */
26
+ declare const EngineTriggers: {
27
+ readonly FUNCTIONS_AVAILABLE: "engine::functions-available";
28
+ readonly LOG: "log";
29
+ };
30
+ /** Connection state for the III WebSocket */
31
+ type IIIConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
32
+ /** Configuration for WebSocket reconnection behavior */
33
+ interface IIIReconnectionConfig {
34
+ /** Starting delay in milliseconds (default: 1000ms) */
35
+ initialDelayMs: number;
36
+ /** Maximum delay cap in milliseconds (default: 30000ms) */
37
+ maxDelayMs: number;
38
+ /** Exponential backoff multiplier (default: 2) */
39
+ backoffMultiplier: number;
40
+ /** Random jitter factor 0-1 (default: 0.3) */
41
+ jitterFactor: number;
42
+ /** Maximum retry attempts, -1 for infinite (default: -1) */
43
+ maxRetries: number;
44
+ }
45
+ //#endregion
46
+ export { IIIReconnectionConfig as i, EngineTriggers as n, IIIConnectionState as r, EngineFunctions as t };
47
+ //# sourceMappingURL=iii-constants-Baptl8nm.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-constants-Baptl8nm.d.mts","names":[],"sources":["../src/iii-constants.ts"],"mappings":";;AAaA;;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;cAaA,cAAA;EAAA,SAGH,mBAAA;EAAA,SAAA,GAAA;AAAA;;KAWE,kBAAA;;UAQK,qBAAA;;EAEf,cAAA;;EAEA,UAAA;;EAEA,iBAAA;;EAEA,YAAA;;EAEA,UAAA;AAAA"}
@@ -0,0 +1,47 @@
1
+ //#region src/iii-constants.d.ts
2
+ /**
3
+ * Constants for the III module.
4
+ */
5
+ /**
6
+ * Engine function paths for internal operations.
7
+ *
8
+ * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
9
+ * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
10
+ * cover trigger INSTANCES (subscriber rows). The old
11
+ * `engine::trigger-types::list` builtin has been removed and is now
12
+ * served by `engine::triggers::list`.
13
+ */
14
+ declare const EngineFunctions: {
15
+ readonly LIST_FUNCTIONS: "engine::functions::list";
16
+ readonly INFO_FUNCTIONS: "engine::functions::info";
17
+ readonly LIST_WORKERS: "engine::workers::list";
18
+ readonly INFO_WORKERS: "engine::workers::info";
19
+ readonly LIST_TRIGGERS: "engine::triggers::list";
20
+ readonly INFO_TRIGGERS: "engine::triggers::info";
21
+ readonly LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list";
22
+ readonly INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info";
23
+ readonly REGISTER_WORKER: "engine::workers::register";
24
+ };
25
+ /** Engine trigger types */
26
+ declare const EngineTriggers: {
27
+ readonly FUNCTIONS_AVAILABLE: "engine::functions-available";
28
+ readonly LOG: "log";
29
+ };
30
+ /** Connection state for the III WebSocket */
31
+ type IIIConnectionState = 'disconnected' | 'connecting' | 'connected' | 'reconnecting' | 'failed';
32
+ /** Configuration for WebSocket reconnection behavior */
33
+ interface IIIReconnectionConfig {
34
+ /** Starting delay in milliseconds (default: 1000ms) */
35
+ initialDelayMs: number;
36
+ /** Maximum delay cap in milliseconds (default: 30000ms) */
37
+ maxDelayMs: number;
38
+ /** Exponential backoff multiplier (default: 2) */
39
+ backoffMultiplier: number;
40
+ /** Random jitter factor 0-1 (default: 0.3) */
41
+ jitterFactor: number;
42
+ /** Maximum retry attempts, -1 for infinite (default: -1) */
43
+ maxRetries: number;
44
+ }
45
+ //#endregion
46
+ export { IIIReconnectionConfig as i, EngineTriggers as n, IIIConnectionState as r, EngineFunctions as t };
47
+ //# sourceMappingURL=iii-constants-BqXp8xSN.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-constants-BqXp8xSN.d.cts","names":[],"sources":["../src/iii-constants.ts"],"mappings":";;AAaA;;;;;;;;;;;cAAa,eAAA;EAAA;;;;;;;;;;;cAaA,cAAA;EAAA,SAGH,mBAAA;EAAA,SAAA,GAAA;AAAA;;KAWE,kBAAA;;UAQK,qBAAA;;EAEf,cAAA;;EAEA,UAAA;;EAEA,iBAAA;;EAEA,YAAA;;EAEA,UAAA;AAAA"}
@@ -0,0 +1,67 @@
1
+
2
+ //#region src/iii-constants.ts
3
+ /**
4
+ * Constants for the III module.
5
+ */
6
+ /**
7
+ * Engine function paths for internal operations.
8
+ *
9
+ * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
10
+ * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
11
+ * cover trigger INSTANCES (subscriber rows). The old
12
+ * `engine::trigger-types::list` builtin has been removed and is now
13
+ * served by `engine::triggers::list`.
14
+ */
15
+ const EngineFunctions = {
16
+ LIST_FUNCTIONS: "engine::functions::list",
17
+ INFO_FUNCTIONS: "engine::functions::info",
18
+ LIST_WORKERS: "engine::workers::list",
19
+ INFO_WORKERS: "engine::workers::info",
20
+ LIST_TRIGGERS: "engine::triggers::list",
21
+ INFO_TRIGGERS: "engine::triggers::info",
22
+ LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list",
23
+ INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info",
24
+ REGISTER_WORKER: "engine::workers::register"
25
+ };
26
+ /** Engine trigger types */
27
+ const EngineTriggers = {
28
+ FUNCTIONS_AVAILABLE: "engine::functions-available",
29
+ LOG: "log"
30
+ };
31
+ /** Default reconnection configuration */
32
+ const DEFAULT_BRIDGE_RECONNECTION_CONFIG = {
33
+ initialDelayMs: 1e3,
34
+ maxDelayMs: 3e4,
35
+ backoffMultiplier: 2,
36
+ jitterFactor: .3,
37
+ maxRetries: -1
38
+ };
39
+ /** Default invocation timeout in milliseconds */
40
+ const DEFAULT_INVOCATION_TIMEOUT_MS = 3e4;
41
+
42
+ //#endregion
43
+ Object.defineProperty(exports, 'DEFAULT_BRIDGE_RECONNECTION_CONFIG', {
44
+ enumerable: true,
45
+ get: function () {
46
+ return DEFAULT_BRIDGE_RECONNECTION_CONFIG;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, 'DEFAULT_INVOCATION_TIMEOUT_MS', {
50
+ enumerable: true,
51
+ get: function () {
52
+ return DEFAULT_INVOCATION_TIMEOUT_MS;
53
+ }
54
+ });
55
+ Object.defineProperty(exports, 'EngineFunctions', {
56
+ enumerable: true,
57
+ get: function () {
58
+ return EngineFunctions;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, 'EngineTriggers', {
62
+ enumerable: true,
63
+ get: function () {
64
+ return EngineTriggers;
65
+ }
66
+ });
67
+ //# sourceMappingURL=iii-constants-Br94RUNi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-constants-Br94RUNi.cjs","names":[],"sources":["../src/iii-constants.ts"],"sourcesContent":["/**\n * Constants for the III module.\n */\n\n/**\n * Engine function paths for internal operations.\n *\n * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES\n * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`\n * cover trigger INSTANCES (subscriber rows). The old\n * `engine::trigger-types::list` builtin has been removed and is now\n * served by `engine::triggers::list`.\n */\nexport const EngineFunctions = {\n LIST_FUNCTIONS: 'engine::functions::list',\n INFO_FUNCTIONS: 'engine::functions::info',\n LIST_WORKERS: 'engine::workers::list',\n INFO_WORKERS: 'engine::workers::info',\n LIST_TRIGGERS: 'engine::triggers::list',\n INFO_TRIGGERS: 'engine::triggers::info',\n LIST_REGISTERED_TRIGGERS: 'engine::registered-triggers::list',\n INFO_REGISTERED_TRIGGERS: 'engine::registered-triggers::info',\n REGISTER_WORKER: 'engine::workers::register',\n} as const\n\n/** Engine trigger types */\nexport const EngineTriggers = {\n FUNCTIONS_AVAILABLE: 'engine::functions-available',\n LOG: 'log',\n} as const\n\n/** Log function paths */\nexport const LogFunctions = {\n INFO: 'engine::log::info',\n WARN: 'engine::log::warn',\n ERROR: 'engine::log::error',\n DEBUG: 'engine::log::debug',\n} as const\n\n/** Connection state for the III WebSocket */\nexport type IIIConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting'\n | 'failed'\n\n/** Configuration for WebSocket reconnection behavior */\nexport interface IIIReconnectionConfig {\n /** Starting delay in milliseconds (default: 1000ms) */\n initialDelayMs: number\n /** Maximum delay cap in milliseconds (default: 30000ms) */\n maxDelayMs: number\n /** Exponential backoff multiplier (default: 2) */\n backoffMultiplier: number\n /** Random jitter factor 0-1 (default: 0.3) */\n jitterFactor: number\n /** Maximum retry attempts, -1 for infinite (default: -1) */\n maxRetries: number\n}\n\n/** Default reconnection configuration */\nexport const DEFAULT_BRIDGE_RECONNECTION_CONFIG: IIIReconnectionConfig = {\n initialDelayMs: 1000,\n maxDelayMs: 30000,\n backoffMultiplier: 2,\n jitterFactor: 0.3,\n maxRetries: -1,\n}\n\n/** Default invocation timeout in milliseconds */\nexport const DEFAULT_INVOCATION_TIMEOUT_MS = 30000\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,eAAe;CACf,eAAe;CACf,0BAA0B;CAC1B,0BAA0B;CAC1B,iBAAiB;CAClB;;AAGD,MAAa,iBAAiB;CAC5B,qBAAqB;CACrB,KAAK;CACN;;AAiCD,MAAa,qCAA4D;CACvE,gBAAgB;CAChB,YAAY;CACZ,mBAAmB;CACnB,cAAc;CACd,YAAY;CACb;;AAGD,MAAa,gCAAgC"}
@@ -0,0 +1,43 @@
1
+ //#region src/iii-constants.ts
2
+ /**
3
+ * Constants for the III module.
4
+ */
5
+ /**
6
+ * Engine function paths for internal operations.
7
+ *
8
+ * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES
9
+ * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`
10
+ * cover trigger INSTANCES (subscriber rows). The old
11
+ * `engine::trigger-types::list` builtin has been removed and is now
12
+ * served by `engine::triggers::list`.
13
+ */
14
+ const EngineFunctions = {
15
+ LIST_FUNCTIONS: "engine::functions::list",
16
+ INFO_FUNCTIONS: "engine::functions::info",
17
+ LIST_WORKERS: "engine::workers::list",
18
+ INFO_WORKERS: "engine::workers::info",
19
+ LIST_TRIGGERS: "engine::triggers::list",
20
+ INFO_TRIGGERS: "engine::triggers::info",
21
+ LIST_REGISTERED_TRIGGERS: "engine::registered-triggers::list",
22
+ INFO_REGISTERED_TRIGGERS: "engine::registered-triggers::info",
23
+ REGISTER_WORKER: "engine::workers::register"
24
+ };
25
+ /** Engine trigger types */
26
+ const EngineTriggers = {
27
+ FUNCTIONS_AVAILABLE: "engine::functions-available",
28
+ LOG: "log"
29
+ };
30
+ /** Default reconnection configuration */
31
+ const DEFAULT_BRIDGE_RECONNECTION_CONFIG = {
32
+ initialDelayMs: 1e3,
33
+ maxDelayMs: 3e4,
34
+ backoffMultiplier: 2,
35
+ jitterFactor: .3,
36
+ maxRetries: -1
37
+ };
38
+ /** Default invocation timeout in milliseconds */
39
+ const DEFAULT_INVOCATION_TIMEOUT_MS = 3e4;
40
+
41
+ //#endregion
42
+ export { EngineTriggers as i, DEFAULT_INVOCATION_TIMEOUT_MS as n, EngineFunctions as r, DEFAULT_BRIDGE_RECONNECTION_CONFIG as t };
43
+ //# sourceMappingURL=iii-constants-_k3SoHry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-constants-_k3SoHry.mjs","names":[],"sources":["../src/iii-constants.ts"],"sourcesContent":["/**\n * Constants for the III module.\n */\n\n/**\n * Engine function paths for internal operations.\n *\n * Naming note: `LIST_TRIGGERS` / `INFO_TRIGGERS` cover trigger TYPES\n * (templates). `LIST_REGISTERED_TRIGGERS` / `INFO_REGISTERED_TRIGGERS`\n * cover trigger INSTANCES (subscriber rows). The old\n * `engine::trigger-types::list` builtin has been removed and is now\n * served by `engine::triggers::list`.\n */\nexport const EngineFunctions = {\n LIST_FUNCTIONS: 'engine::functions::list',\n INFO_FUNCTIONS: 'engine::functions::info',\n LIST_WORKERS: 'engine::workers::list',\n INFO_WORKERS: 'engine::workers::info',\n LIST_TRIGGERS: 'engine::triggers::list',\n INFO_TRIGGERS: 'engine::triggers::info',\n LIST_REGISTERED_TRIGGERS: 'engine::registered-triggers::list',\n INFO_REGISTERED_TRIGGERS: 'engine::registered-triggers::info',\n REGISTER_WORKER: 'engine::workers::register',\n} as const\n\n/** Engine trigger types */\nexport const EngineTriggers = {\n FUNCTIONS_AVAILABLE: 'engine::functions-available',\n LOG: 'log',\n} as const\n\n/** Log function paths */\nexport const LogFunctions = {\n INFO: 'engine::log::info',\n WARN: 'engine::log::warn',\n ERROR: 'engine::log::error',\n DEBUG: 'engine::log::debug',\n} as const\n\n/** Connection state for the III WebSocket */\nexport type IIIConnectionState =\n | 'disconnected'\n | 'connecting'\n | 'connected'\n | 'reconnecting'\n | 'failed'\n\n/** Configuration for WebSocket reconnection behavior */\nexport interface IIIReconnectionConfig {\n /** Starting delay in milliseconds (default: 1000ms) */\n initialDelayMs: number\n /** Maximum delay cap in milliseconds (default: 30000ms) */\n maxDelayMs: number\n /** Exponential backoff multiplier (default: 2) */\n backoffMultiplier: number\n /** Random jitter factor 0-1 (default: 0.3) */\n jitterFactor: number\n /** Maximum retry attempts, -1 for infinite (default: -1) */\n maxRetries: number\n}\n\n/** Default reconnection configuration */\nexport const DEFAULT_BRIDGE_RECONNECTION_CONFIG: IIIReconnectionConfig = {\n initialDelayMs: 1000,\n maxDelayMs: 30000,\n backoffMultiplier: 2,\n jitterFactor: 0.3,\n maxRetries: -1,\n}\n\n/** Default invocation timeout in milliseconds */\nexport const DEFAULT_INVOCATION_TIMEOUT_MS = 30000\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAa,kBAAkB;CAC7B,gBAAgB;CAChB,gBAAgB;CAChB,cAAc;CACd,cAAc;CACd,eAAe;CACf,eAAe;CACf,0BAA0B;CAC1B,0BAA0B;CAC1B,iBAAiB;CAClB;;AAGD,MAAa,iBAAiB;CAC5B,qBAAqB;CACrB,KAAK;CACN;;AAiCD,MAAa,qCAA4D;CACvE,gBAAgB;CAChB,YAAY;CACZ,mBAAmB;CACnB,cAAc;CACd,YAAY;CACb;;AAGD,MAAa,gCAAgC"}
@@ -0,0 +1,24 @@
1
+
2
+ //#region src/iii-types.ts
3
+ let MessageType = /* @__PURE__ */ function(MessageType) {
4
+ MessageType["RegisterFunction"] = "registerfunction";
5
+ MessageType["UnregisterFunction"] = "unregisterfunction";
6
+ MessageType["InvokeFunction"] = "invokefunction";
7
+ MessageType["InvocationResult"] = "invocationresult";
8
+ MessageType["RegisterTriggerType"] = "registertriggertype";
9
+ MessageType["RegisterTrigger"] = "registertrigger";
10
+ MessageType["UnregisterTrigger"] = "unregistertrigger";
11
+ MessageType["UnregisterTriggerType"] = "unregistertriggertype";
12
+ MessageType["TriggerRegistrationResult"] = "triggerregistrationresult";
13
+ MessageType["WorkerRegistered"] = "workerregistered";
14
+ return MessageType;
15
+ }({});
16
+
17
+ //#endregion
18
+ Object.defineProperty(exports, 'MessageType', {
19
+ enumerable: true,
20
+ get: function () {
21
+ return MessageType;
22
+ }
23
+ });
24
+ //# sourceMappingURL=iii-types-6aHBgy7l.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-types-6aHBgy7l.cjs","names":[],"sources":["../src/iii-types.ts"],"sourcesContent":["import type { HttpInvocationConfig } from '@iii-dev/helpers/http'\n\nexport enum MessageType {\n RegisterFunction = 'registerfunction',\n UnregisterFunction = 'unregisterfunction',\n InvokeFunction = 'invokefunction',\n InvocationResult = 'invocationresult',\n RegisterTriggerType = 'registertriggertype',\n RegisterTrigger = 'registertrigger',\n UnregisterTrigger = 'unregistertrigger',\n UnregisterTriggerType = 'unregistertriggertype',\n TriggerRegistrationResult = 'triggerregistrationresult',\n WorkerRegistered = 'workerregistered',\n}\n\nexport type RegisterTriggerTypeMessage = {\n message_type: MessageType.RegisterTriggerType\n id: string\n description: string\n}\n\nexport type UnregisterTriggerTypeMessage = {\n message_type: MessageType.UnregisterTriggerType\n id: string\n}\n\nexport type UnregisterTriggerMessage = {\n message_type: MessageType.UnregisterTrigger\n id: string\n type?: string\n}\n\nexport type ErrorBody = {\n code: string\n message: string\n stacktrace?: string\n}\n\nexport type TriggerRegistrationResultMessage = {\n message_type: MessageType.TriggerRegistrationResult\n id: string\n type: string\n function_id: string\n error?: ErrorBody\n}\n\nexport type RegisterTriggerMessage = {\n message_type: MessageType.RegisterTrigger\n id: string\n type: string\n function_id: string\n config: unknown\n metadata?: Record<string, unknown>\n}\n\nexport type RegisterFunctionFormat = {\n /**\n * The name of the parameter\n */\n name?: string\n /**\n * The description of the parameter\n */\n description?: string\n /**\n * The type of the parameter\n */\n type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null' | 'map' | 'integer'\n /**\n * The body of the parameter (for objects)\n */\n properties?: Record<string, unknown>\n /**\n * The items of the parameter (for arrays)\n */\n items?: unknown\n /**\n * Whether the parameter is required\n */\n required?: string[]\n [key: string]: unknown\n}\n\nexport type RegisterFunctionMessage = {\n message_type: MessageType.RegisterFunction\n /**\n * The path of the function (use :: for namespacing, e.g. external::my_lambda)\n */\n id: string\n /**\n * The description of the function\n */\n description?: string\n /**\n * The request format of the function\n */\n request_format?: RegisterFunctionFormat\n /**\n * The response format of the function\n */\n response_format?: RegisterFunctionFormat\n metadata?: Record<string, unknown>\n /**\n * HTTP invocation config for external HTTP functions (Lambda, Cloudflare Workers, etc.)\n */\n invocation?: HttpInvocationConfig\n}\n\n/**\n * Routing action for {@link TriggerRequest}. Determines how the engine\n * handles the invocation.\n *\n * - `enqueue` -- Routes through a named queue for async processing.\n * - `void` -- Fire-and-forget, no response.\n */\nexport type TriggerAction = { type: 'enqueue'; queue: string } | { type: 'void' }\n\n/**\n * Input passed to the RBAC middleware function on every function invocation\n * through the RBAC port. The middleware can inspect, modify, or reject the\n * call before it reaches the target function.\n */\nexport type MiddlewareFunctionInput = {\n /** ID of the function being invoked. */\n function_id: string\n /** Payload sent by the caller. */\n payload: Record<string, unknown>\n /** Routing action, if any. */\n action?: TriggerAction\n /** Auth context returned by the auth function for this session. */\n context: Record<string, unknown>\n}\n\n/**\n * Request object passed to {@link IIIClient.trigger}.\n *\n * @typeParam TInput - Type of the payload.\n */\nexport type TriggerRequest<TInput = unknown> = {\n /** ID of the function to invoke. */\n function_id: string\n /** Payload to pass to the function. */\n payload: TInput\n /** Routing action. Omit for synchronous request/response. */\n action?: TriggerAction\n /** Override the default invocation timeout in milliseconds. */\n timeoutMs?: number\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from the payload and is surfaced to the target handler as a\n * dedicated argument. Omitted from the wire message when undefined.\n */\n metadata?: unknown\n}\n\nexport type InvokeFunctionMessage = {\n message_type: MessageType.InvokeFunction\n /**\n * This is optional for async invocations\n */\n invocation_id?: string\n /**\n * The path of the function\n */\n function_id: string\n /**\n * The data to pass to the function\n */\n data: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n /**\n * Trigger action for queue routing or fire-and-forget\n */\n action?: TriggerAction\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from `data`. Omitted from the JSON when undefined; absence on\n * inbound means \"no metadata\" (backward compatible with older engines).\n */\n metadata?: unknown\n}\n\nexport type InvocationResultMessage = {\n message_type: MessageType.InvocationResult\n /**\n * The id of the invocation\n */\n invocation_id: string\n /**\n * The path of the function\n */\n function_id: string\n result?: unknown\n error?: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n}\n\nexport type WorkerRegisteredMessage = {\n message_type: MessageType.WorkerRegistered\n worker_id: string\n}\n\nexport type UnregisterFunctionMessage = {\n message_type: MessageType.UnregisterFunction\n id: string\n}\n\n/**\n * Serializable reference to one end of a streaming channel. Can be included\n * in invocation payloads to pass channel endpoints between workers.\n */\nexport type StreamChannelRef = {\n /** Unique channel identifier. */\n channel_id: string\n /** Access key for authentication. */\n access_key: string\n /** Whether this ref is for reading or writing. */\n direction: 'read' | 'write'\n}\n\nexport type IIIMessage =\n | RegisterFunctionMessage\n | UnregisterFunctionMessage\n | InvokeFunctionMessage\n | InvocationResultMessage\n | RegisterTriggerMessage\n | RegisterTriggerTypeMessage\n | UnregisterTriggerMessage\n | UnregisterTriggerTypeMessage\n | TriggerRegistrationResultMessage\n | WorkerRegisteredMessage\n"],"mappings":";;AAEA,IAAY,cAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;KACD"}
@@ -0,0 +1,18 @@
1
+ //#region src/iii-types.ts
2
+ let MessageType = /* @__PURE__ */ function(MessageType) {
3
+ MessageType["RegisterFunction"] = "registerfunction";
4
+ MessageType["UnregisterFunction"] = "unregisterfunction";
5
+ MessageType["InvokeFunction"] = "invokefunction";
6
+ MessageType["InvocationResult"] = "invocationresult";
7
+ MessageType["RegisterTriggerType"] = "registertriggertype";
8
+ MessageType["RegisterTrigger"] = "registertrigger";
9
+ MessageType["UnregisterTrigger"] = "unregistertrigger";
10
+ MessageType["UnregisterTriggerType"] = "unregistertriggertype";
11
+ MessageType["TriggerRegistrationResult"] = "triggerregistrationresult";
12
+ MessageType["WorkerRegistered"] = "workerregistered";
13
+ return MessageType;
14
+ }({});
15
+
16
+ //#endregion
17
+ export { MessageType as t };
18
+ //# sourceMappingURL=iii-types-CRx2qAjB.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iii-types-CRx2qAjB.mjs","names":[],"sources":["../src/iii-types.ts"],"sourcesContent":["import type { HttpInvocationConfig } from '@iii-dev/helpers/http'\n\nexport enum MessageType {\n RegisterFunction = 'registerfunction',\n UnregisterFunction = 'unregisterfunction',\n InvokeFunction = 'invokefunction',\n InvocationResult = 'invocationresult',\n RegisterTriggerType = 'registertriggertype',\n RegisterTrigger = 'registertrigger',\n UnregisterTrigger = 'unregistertrigger',\n UnregisterTriggerType = 'unregistertriggertype',\n TriggerRegistrationResult = 'triggerregistrationresult',\n WorkerRegistered = 'workerregistered',\n}\n\nexport type RegisterTriggerTypeMessage = {\n message_type: MessageType.RegisterTriggerType\n id: string\n description: string\n}\n\nexport type UnregisterTriggerTypeMessage = {\n message_type: MessageType.UnregisterTriggerType\n id: string\n}\n\nexport type UnregisterTriggerMessage = {\n message_type: MessageType.UnregisterTrigger\n id: string\n type?: string\n}\n\nexport type ErrorBody = {\n code: string\n message: string\n stacktrace?: string\n}\n\nexport type TriggerRegistrationResultMessage = {\n message_type: MessageType.TriggerRegistrationResult\n id: string\n type: string\n function_id: string\n error?: ErrorBody\n}\n\nexport type RegisterTriggerMessage = {\n message_type: MessageType.RegisterTrigger\n id: string\n type: string\n function_id: string\n config: unknown\n metadata?: Record<string, unknown>\n}\n\nexport type RegisterFunctionFormat = {\n /**\n * The name of the parameter\n */\n name?: string\n /**\n * The description of the parameter\n */\n description?: string\n /**\n * The type of the parameter\n */\n type?: 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null' | 'map' | 'integer'\n /**\n * The body of the parameter (for objects)\n */\n properties?: Record<string, unknown>\n /**\n * The items of the parameter (for arrays)\n */\n items?: unknown\n /**\n * Whether the parameter is required\n */\n required?: string[]\n [key: string]: unknown\n}\n\nexport type RegisterFunctionMessage = {\n message_type: MessageType.RegisterFunction\n /**\n * The path of the function (use :: for namespacing, e.g. external::my_lambda)\n */\n id: string\n /**\n * The description of the function\n */\n description?: string\n /**\n * The request format of the function\n */\n request_format?: RegisterFunctionFormat\n /**\n * The response format of the function\n */\n response_format?: RegisterFunctionFormat\n metadata?: Record<string, unknown>\n /**\n * HTTP invocation config for external HTTP functions (Lambda, Cloudflare Workers, etc.)\n */\n invocation?: HttpInvocationConfig\n}\n\n/**\n * Routing action for {@link TriggerRequest}. Determines how the engine\n * handles the invocation.\n *\n * - `enqueue` -- Routes through a named queue for async processing.\n * - `void` -- Fire-and-forget, no response.\n */\nexport type TriggerAction = { type: 'enqueue'; queue: string } | { type: 'void' }\n\n/**\n * Input passed to the RBAC middleware function on every function invocation\n * through the RBAC port. The middleware can inspect, modify, or reject the\n * call before it reaches the target function.\n */\nexport type MiddlewareFunctionInput = {\n /** ID of the function being invoked. */\n function_id: string\n /** Payload sent by the caller. */\n payload: Record<string, unknown>\n /** Routing action, if any. */\n action?: TriggerAction\n /** Auth context returned by the auth function for this session. */\n context: Record<string, unknown>\n}\n\n/**\n * Request object passed to {@link IIIClient.trigger}.\n *\n * @typeParam TInput - Type of the payload.\n */\nexport type TriggerRequest<TInput = unknown> = {\n /** ID of the function to invoke. */\n function_id: string\n /** Payload to pass to the function. */\n payload: TInput\n /** Routing action. Omit for synchronous request/response. */\n action?: TriggerAction\n /** Override the default invocation timeout in milliseconds. */\n timeoutMs?: number\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from the payload and is surfaced to the target handler as a\n * dedicated argument. Omitted from the wire message when undefined.\n */\n metadata?: unknown\n}\n\nexport type InvokeFunctionMessage = {\n message_type: MessageType.InvokeFunction\n /**\n * This is optional for async invocations\n */\n invocation_id?: string\n /**\n * The path of the function\n */\n function_id: string\n /**\n * The data to pass to the function\n */\n data: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n /**\n * Trigger action for queue routing or fire-and-forget\n */\n action?: TriggerAction\n /**\n * Optional per-invocation metadata (arbitrary JSON). Travels as a separate\n * channel from `data`. Omitted from the JSON when undefined; absence on\n * inbound means \"no metadata\" (backward compatible with older engines).\n */\n metadata?: unknown\n}\n\nexport type InvocationResultMessage = {\n message_type: MessageType.InvocationResult\n /**\n * The id of the invocation\n */\n invocation_id: string\n /**\n * The path of the function\n */\n function_id: string\n result?: unknown\n error?: unknown\n /**\n * W3C trace-context traceparent header for distributed tracing\n */\n traceparent?: string\n /**\n * W3C baggage header for cross-cutting context propagation\n */\n baggage?: string\n}\n\nexport type WorkerRegisteredMessage = {\n message_type: MessageType.WorkerRegistered\n worker_id: string\n}\n\nexport type UnregisterFunctionMessage = {\n message_type: MessageType.UnregisterFunction\n id: string\n}\n\n/**\n * Serializable reference to one end of a streaming channel. Can be included\n * in invocation payloads to pass channel endpoints between workers.\n */\nexport type StreamChannelRef = {\n /** Unique channel identifier. */\n channel_id: string\n /** Access key for authentication. */\n access_key: string\n /** Whether this ref is for reading or writing. */\n direction: 'read' | 'write'\n}\n\nexport type IIIMessage =\n | RegisterFunctionMessage\n | UnregisterFunctionMessage\n | InvokeFunctionMessage\n | InvocationResultMessage\n | RegisterTriggerMessage\n | RegisterTriggerTypeMessage\n | UnregisterTriggerMessage\n | UnregisterTriggerTypeMessage\n | TriggerRegistrationResultMessage\n | WorkerRegisteredMessage\n"],"mappings":";AAEA,IAAY,cAAL;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;KACD"}