coakka-v2-connector-node 1.3.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 (57) hide show
  1. package/CONSUMING.md +48 -0
  2. package/LICENSE.md +115 -0
  3. package/README.md +147 -0
  4. package/dist/index.d.ts +6 -0
  5. package/dist/index.js +5 -0
  6. package/dist/models.d.ts +119 -0
  7. package/dist/models.js +150 -0
  8. package/dist/orchestrator.d.ts +80 -0
  9. package/dist/orchestrator.js +260 -0
  10. package/dist/packaging.d.ts +4 -0
  11. package/dist/packaging.js +4 -0
  12. package/dist/protobuf.d.ts +63 -0
  13. package/dist/protobuf.js +323 -0
  14. package/dist/runtime-client.d.ts +124 -0
  15. package/dist/runtime-client.js +922 -0
  16. package/dist/runtime-ffi.d.ts +105 -0
  17. package/dist/runtime-ffi.js +282 -0
  18. package/native/.gitkeep +1 -0
  19. package/native/linux-aarch64/libcoakka_runtime_v2-1.3.1+bda2ef5.so +0 -0
  20. package/native/linux-aarch64/libcoakka_runtime_v2.so +0 -0
  21. package/native/linux-x86_64/libcoakka_runtime_v2-1.3.1+bda2ef5.so +0 -0
  22. package/native/linux-x86_64/libcoakka_runtime_v2.so +0 -0
  23. package/native/macos-aarch64/libcoakka_runtime_v2-1.3.1+bda2ef5.dylib +0 -0
  24. package/native/macos-aarch64/libcoakka_runtime_v2.dylib +0 -0
  25. package/native/windows-aarch64/libcoakka_runtime_v2-1.3.1+bda2ef5.dll +0 -0
  26. package/native/windows-aarch64/libcoakka_runtime_v2.dll +0 -0
  27. package/native/windows-x86_64/libcoakka_runtime_v2-1.3.1+bda2ef5.dll +0 -0
  28. package/native/windows-x86_64/libcoakka_runtime_v2.dll +0 -0
  29. package/package.json +35 -0
  30. package/vendor/koffi/LICENSE.txt +22 -0
  31. package/vendor/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
  32. package/vendor/koffi/build/koffi/darwin_x64/koffi.node +0 -0
  33. package/vendor/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
  34. package/vendor/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
  35. package/vendor/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
  36. package/vendor/koffi/build/koffi/linux_arm64/koffi.node +0 -0
  37. package/vendor/koffi/build/koffi/linux_armhf/koffi.node +0 -0
  38. package/vendor/koffi/build/koffi/linux_ia32/koffi.node +0 -0
  39. package/vendor/koffi/build/koffi/linux_loong64/koffi.node +0 -0
  40. package/vendor/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
  41. package/vendor/koffi/build/koffi/linux_x64/koffi.node +0 -0
  42. package/vendor/koffi/build/koffi/musl_arm64/koffi.node +0 -0
  43. package/vendor/koffi/build/koffi/musl_x64/koffi.node +0 -0
  44. package/vendor/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
  45. package/vendor/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
  46. package/vendor/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
  47. package/vendor/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
  48. package/vendor/koffi/build/koffi/win32_arm64/koffi.node +0 -0
  49. package/vendor/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
  50. package/vendor/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
  51. package/vendor/koffi/build/koffi/win32_ia32/koffi.node +0 -0
  52. package/vendor/koffi/build/koffi/win32_x64/koffi.exp +0 -0
  53. package/vendor/koffi/build/koffi/win32_x64/koffi.lib +0 -0
  54. package/vendor/koffi/build/koffi/win32_x64/koffi.node +0 -0
  55. package/vendor/koffi/index.d.ts +288 -0
  56. package/vendor/koffi/index.js +634 -0
  57. package/vendor/koffi/package.json +38 -0
@@ -0,0 +1,288 @@
1
+ // SPDX-License-Identifier: MIT
2
+ // SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
3
+
4
+ type LoadOptions = {
5
+ lazy?: boolean,
6
+ global?: boolean,
7
+ deep?: boolean
8
+ };
9
+
10
+ export function load(path: string | null, options?: LoadOptions): IKoffiLib;
11
+
12
+ interface IKoffiCType { __brand: 'IKoffiCType' }
13
+ interface IKoffiPointerCast { __brand: 'IKoffiPointerCast' }
14
+ interface IKoffiRegisteredCallback { __brand: 'IKoffiRegisteredCallback' }
15
+
16
+ type PrimitiveKind = 'Void' | 'Bool' | 'Int8' | 'UInt8' | 'Int16' | 'Int16S' | 'UInt16' | 'UInt16S' |
17
+ 'Int32' | 'Int32S' | 'UInt32' | 'UInt32S' | 'Int64' | 'Int64S' | 'UInt64' | 'UInt64S' |
18
+ 'String' | 'String16' | 'Pointer' | 'Record' | 'Union' | 'Array' | 'Float32' | 'Float64' |
19
+ 'Prototype' | 'Callback';
20
+ type ArrayHint = 'Array' | 'Typed' | 'String';
21
+
22
+ type TypeSpec = string | IKoffiCType;
23
+ type TypeSpecWithAlignment = TypeSpec | [number, TypeSpec];
24
+ type TypeInfo = {
25
+ name: string;
26
+ primitive: PrimitiveKind;
27
+ size: number;
28
+ alignment: number;
29
+ disposable: boolean;
30
+ length?: number;
31
+ hint?: ArrayHint;
32
+ ref?: IKoffiCType;
33
+ members?: Record<string, { name: string, type: IKoffiCType, offset: number }>;
34
+ };
35
+ type KoffiFunction = {
36
+ (...args: any[]) : any;
37
+ async: (...args: any[]) => any;
38
+ info: {
39
+ name: string,
40
+ arguments: IKoffiCType[],
41
+ result: IKoffiCType
42
+ };
43
+ };
44
+
45
+ export type KoffiFunc<T extends (...args: any) => any> = T & {
46
+ async: (...args: [...Parameters<T>, (err: any, result: ReturnType<T>) => void]) => void;
47
+ info: {
48
+ name: string;
49
+ arguments: IKoffiCType[];
50
+ result: IKoffiCType;
51
+ };
52
+ };
53
+
54
+ export interface IKoffiLib {
55
+ func(definition: string): KoffiFunction;
56
+ func(name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
57
+ func(convention: string, name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
58
+
59
+ /** @deprecated */ cdecl(definition: string): KoffiFunction;
60
+ /** @deprecated */ cdecl(name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
61
+ /** @deprecated */ stdcall(definition: string): KoffiFunction;
62
+ /** @deprecated */ stdcall(name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
63
+ /** @deprecated */ fastcall(definition: string): KoffiFunction;
64
+ /** @deprecated */ fastcall(name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
65
+ /** @deprecated */ thiscall(definition: string): KoffiFunction;
66
+ /** @deprecated */ thiscall(name: string | number, result: TypeSpec, arguments: TypeSpec[]): KoffiFunction;
67
+
68
+ symbol(name: string, type: TypeSpec): any;
69
+
70
+ unload(): void;
71
+ }
72
+
73
+ export function struct(name: string | null | undefined, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
74
+ export function struct(ref: IKoffiCType, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
75
+ export function struct(def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
76
+ export function pack(name: string | null | undefined, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
77
+ export function pack(ref: IKoffiCType, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
78
+ export function pack(def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
79
+
80
+ export function union(name: string | null | undefined, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
81
+ export function union(ref: IKoffiCType, def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
82
+ export function union(def: Record<string, TypeSpecWithAlignment>): IKoffiCType;
83
+
84
+ export class Union {
85
+ constructor(type: TypeSpec);
86
+ [s: string]: any;
87
+ }
88
+
89
+ export function array(ref: TypeSpec, len: number, hint?: ArrayHint | null): IKoffiCType;
90
+ export function array(ref: TypeSpec, countedBy: string, maxLen: number, hint?: ArrayHint | null): IKoffiCType;
91
+
92
+ export function opaque(name: string | null | undefined): IKoffiCType;
93
+ export function opaque(): IKoffiCType;
94
+ /** @deprecated */ export function handle(name: string | null | undefined): IKoffiCType;
95
+ /** @deprecated */ export function handle(): IKoffiCType;
96
+
97
+ export function pointer(ref: TypeSpec): IKoffiCType;
98
+ export function pointer(ref: TypeSpec, count: number): IKoffiCType;
99
+ export function pointer(name: string | null | undefined, ref: TypeSpec, countedBy?: string | null): IKoffiCType;
100
+ export function pointer(name: string | null | undefined, ref: TypeSpec, count: number): IKoffiCType;
101
+
102
+ export function out(type: TypeSpec): IKoffiCType;
103
+ export function inout(type: TypeSpec): IKoffiCType;
104
+
105
+ export function disposable(type: TypeSpec): IKoffiCType;
106
+ export function disposable(type: TypeSpec, freeFunction: Function): IKoffiCType;
107
+ export function disposable(name: string | null | undefined, type: TypeSpec): IKoffiCType;
108
+ export function disposable(name: string | null | undefined, type: TypeSpec, freeFunction: Function): IKoffiCType;
109
+
110
+ export function proto(definition: string): IKoffiCType;
111
+ export function proto(result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
112
+ export function proto(convention: string, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
113
+ export function proto(name: string | null | undefined, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
114
+ export function proto(convention: string, name: string | null | undefined, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
115
+ /** @deprecated */ export function callback(definition: string): IKoffiCType;
116
+ /** @deprecated */ export function callback(result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
117
+ /** @deprecated */ export function callback(convention: string, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
118
+ /** @deprecated */ export function callback(name: string | null | undefined, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
119
+ /** @deprecated */ export function callback(convention: string, name: string | null | undefined, result: TypeSpec, arguments: TypeSpec[]): IKoffiCType;
120
+
121
+ export function register(callback: Function, type: TypeSpec): IKoffiRegisteredCallback;
122
+ export function register(thisValue: any, callback: Function, type: TypeSpec): IKoffiRegisteredCallback;
123
+ export function unregister(callback: IKoffiRegisteredCallback): void;
124
+
125
+ export function as(value: any, type: TypeSpec): IKoffiPointerCast;
126
+ export function decode(value: any, type: TypeSpec): any;
127
+ export function decode(value: any, type: TypeSpec, len: number): any;
128
+ export function decode(value: any, offset: number, type: TypeSpec): any;
129
+ export function decode(value: any, offset: number, type: TypeSpec, len: number): any;
130
+ export function address(value: any): bigint;
131
+ export function call(value: any, type: TypeSpec, ...args: any[]): any;
132
+ export function encode(ref: any, type: TypeSpec, value: any): void;
133
+ export function encode(ref: any, type: TypeSpec, value: any, len: number): void;
134
+ export function encode(ref: any, offset: number, type: TypeSpec): void;
135
+ export function encode(ref: any, offset: number, type: TypeSpec, value: any): void;
136
+ export function encode(ref: any, offset: number, type: TypeSpec, value: any, len: number): void;
137
+ export function view(ref: any, len: number): ArrayBuffer;
138
+
139
+ export function sizeof(type: TypeSpec): number;
140
+ export function alignof(type: TypeSpec): number;
141
+ export function offsetof(type: TypeSpec, member_name: string): number;
142
+ export function resolve(type: TypeSpec): IKoffiCType;
143
+ export function introspect(type: TypeSpec): TypeInfo;
144
+
145
+ export function alias(name: string, type: TypeSpec): IKoffiCType;
146
+
147
+ type KoffiConfig = {
148
+ sync_stack_size?: number
149
+ sync_heap_size?: number
150
+ async_stack_size?: number
151
+ async_heap_size?: number
152
+ resident_async_pools?: number
153
+ max_async_calls?: number
154
+ max_type_size?: number
155
+ };
156
+ type KoffiStats = {
157
+ disposed: number
158
+ };
159
+
160
+ export function config(): KoffiConfig;
161
+ export function config(cfg: KoffiConfig): KoffiConfig;
162
+ export function stats(): KoffiStats;
163
+
164
+ export function alloc(type: TypeSpec, length: number): any;
165
+ export function free(value: any): void;
166
+
167
+ export function errno(): number;
168
+ export function errno(value: number): number;
169
+
170
+ export function reset(): void;
171
+
172
+ export const internal: Boolean;
173
+ export const extension: String;
174
+
175
+ export const os: {
176
+ errno: Record<string, number>
177
+ };
178
+
179
+ // https://koffi.dev/input#standard-types
180
+ type PrimitiveTypes =
181
+ | 'bool'
182
+ | 'char'
183
+ | 'char16_t'
184
+ | 'char16'
185
+ | 'char32_t'
186
+ | 'char32'
187
+ | 'double'
188
+ | 'float'
189
+ | 'float32'
190
+ | 'float64'
191
+ | 'int'
192
+ | 'int8_t'
193
+ | 'int8'
194
+ | 'int16_be_t'
195
+ | 'int16_be'
196
+ | 'int16_le_t'
197
+ | 'int16_le'
198
+ | 'int16_t'
199
+ | 'int16'
200
+ | 'int32_be_t'
201
+ | 'int32_be'
202
+ | 'int32_le_t'
203
+ | 'int32_le'
204
+ | 'int32_t'
205
+ | 'int32'
206
+ | 'int64_be_t'
207
+ | 'int64_be'
208
+ | 'int64_le_t'
209
+ | 'int64_le'
210
+ | 'int64_t'
211
+ | 'int64'
212
+ | 'intptr_t'
213
+ | 'intptr'
214
+ | 'long long'
215
+ | 'long'
216
+ | 'longlong'
217
+ | 'short'
218
+ | 'size_t'
219
+ | 'str'
220
+ | 'str16'
221
+ | 'str32'
222
+ | 'string'
223
+ | 'string16'
224
+ | 'string32'
225
+ | 'uchar'
226
+ | 'uint'
227
+ | 'uint8_t'
228
+ | 'uint8'
229
+ | 'uint16_be_t'
230
+ | 'uint16_be'
231
+ | 'uint16_le_t'
232
+ | 'uint16_le'
233
+ | 'uint16_t'
234
+ | 'uint16'
235
+ | 'uint32_be_t'
236
+ | 'uint32_be'
237
+ | 'uint32_le_t'
238
+ | 'uint32_le'
239
+ | 'uint32_t'
240
+ | 'uint32'
241
+ | 'uint64_be_t'
242
+ | 'uint64_be'
243
+ | 'uint64_le_t'
244
+ | 'uint64_le'
245
+ | 'uint64_t'
246
+ | 'uint64'
247
+ | 'uintptr_t'
248
+ | 'uintptr'
249
+ | 'ulong'
250
+ | 'ulonglong'
251
+ | 'unsigned char'
252
+ | 'unsigned int'
253
+ | 'unsigned long long'
254
+ | 'unsigned long'
255
+ | 'unsigned short'
256
+ | 'ushort'
257
+ | 'void'
258
+ | 'wchar'
259
+ | 'wchar_t';
260
+ export const types: Record<PrimitiveTypes, IKoffiCType>;
261
+
262
+ export interface IKoffiPollOptions {
263
+ readable?: boolean;
264
+ writable?: boolean;
265
+ disconnect?: boolean;
266
+ }
267
+
268
+ export interface IKoffiPollEvents {
269
+ readable: boolean;
270
+ writable: boolean;
271
+ disconnect: boolean;
272
+ }
273
+
274
+ export namespace node {
275
+ export const env: { __brand: 'IKoffiNodeEnv' };
276
+
277
+ export class PollHandle {
278
+ start(opts: IKoffiPollOptions, callback: (ev: IKoffiPollEvents) => void): void;
279
+ start(callback: (ev: IKoffiPollEvents) => void): void;
280
+ stop(): void;
281
+ close(): void;
282
+ unref(): void;
283
+ ref(): void;
284
+ }
285
+
286
+ export function poll(fd: number, opts: IKoffiPollOptions, callback: (ev: IKoffiPollEvents) => void): PollHandle;
287
+ export function poll(fd: number, callback: (ev: IKoffiPollEvents) => void): PollHandle;
288
+ }