@workglow/util 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/browser.js +344 -80
  2. package/dist/browser.js.map +17 -13
  3. package/dist/bun.js +344 -80
  4. package/dist/bun.js.map +17 -13
  5. package/dist/credentials/CredentialProviderOptions.d.ts +38 -0
  6. package/dist/credentials/CredentialProviderOptions.d.ts.map +1 -0
  7. package/dist/credentials/CredentialPutInputSchema.d.ts +37 -0
  8. package/dist/credentials/CredentialPutInputSchema.d.ts.map +1 -0
  9. package/dist/credentials/CredentialStoreRegistry.d.ts.map +1 -1
  10. package/dist/credentials/OtpPassphraseCache.d.ts +73 -0
  11. package/dist/credentials/OtpPassphraseCache.d.ts.map +1 -0
  12. package/dist/credentials/index.d.ts +6 -3
  13. package/dist/credentials/index.d.ts.map +1 -1
  14. package/dist/di/Container.d.ts +15 -0
  15. package/dist/di/Container.d.ts.map +1 -1
  16. package/dist/di/InputCompactorRegistry.d.ts +46 -0
  17. package/dist/di/InputCompactorRegistry.d.ts.map +1 -0
  18. package/dist/di/InputResolverRegistry.d.ts.map +1 -1
  19. package/dist/di/ServiceRegistry.d.ts +11 -0
  20. package/dist/di/ServiceRegistry.d.ts.map +1 -1
  21. package/dist/di/index.d.ts +1 -0
  22. package/dist/di/index.d.ts.map +1 -1
  23. package/dist/events/EventEmitter.d.ts +16 -0
  24. package/dist/events/EventEmitter.d.ts.map +1 -1
  25. package/dist/graph/directedAcyclicGraph.d.ts.map +1 -1
  26. package/dist/graph/directedGraph.d.ts.map +1 -1
  27. package/dist/graph/graph.d.ts.map +1 -1
  28. package/dist/graph-entry.js +55 -18
  29. package/dist/graph-entry.js.map +6 -6
  30. package/dist/json-schema/SchemaValidation.d.ts +31 -0
  31. package/dist/json-schema/SchemaValidation.d.ts.map +1 -1
  32. package/dist/logging/LoggerRegistry.d.ts.map +1 -1
  33. package/dist/node.js +344 -80
  34. package/dist/node.js.map +17 -13
  35. package/dist/schema-entry.js +168 -1
  36. package/dist/schema-entry.js.map +4 -4
  37. package/dist/telemetry/ITelemetryProvider.d.ts.map +1 -1
  38. package/dist/telemetry/TelemetryRegistry.d.ts.map +1 -1
  39. package/dist/vector/Tensor.d.ts.map +1 -1
  40. package/dist/vector/TypedArray.d.ts.map +1 -1
  41. package/dist/worker/Worker.browser.d.ts +1 -1
  42. package/dist/worker/Worker.bun.d.ts +1 -1
  43. package/dist/worker/WorkerManager.d.ts +9 -0
  44. package/dist/worker/WorkerManager.d.ts.map +1 -1
  45. package/dist/worker-browser.js +110 -22
  46. package/dist/worker-browser.js.map +10 -9
  47. package/dist/worker-bun.js +110 -22
  48. package/dist/worker-bun.js.map +10 -9
  49. package/dist/worker-node.js +110 -22
  50. package/dist/worker-node.js.map +10 -9
  51. package/package.json +6 -1
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ declare const CREDENTIAL_PROVIDER_VALUES: readonly ["none", "anthropic", "openai", "google", "huggingface", "custom"];
7
+ /**
8
+ * Allowed provider values for credential metadata (CLI, builder UI, and JSON schema).
9
+ */
10
+ export declare const CREDENTIAL_PROVIDER_SCHEMA_ENUM: readonly ["none", "anthropic", "openai", "google", "huggingface", "custom"];
11
+ /** Sentinel stored in UI state; persist as empty / omit provider when this is selected. */
12
+ export declare const CREDENTIAL_PROVIDER_NONE: "none";
13
+ export type CredentialProviderValue = (typeof CREDENTIAL_PROVIDER_VALUES)[number];
14
+ /**
15
+ * Rows for select UIs (e.g. builder). Values must match {@link CREDENTIAL_PROVIDER_SCHEMA_ENUM}.
16
+ */
17
+ export declare const CREDENTIAL_PROVIDER_OPTIONS: readonly [{
18
+ readonly value: "none";
19
+ readonly label: "None";
20
+ }, {
21
+ readonly value: "anthropic";
22
+ readonly label: "Anthropic";
23
+ }, {
24
+ readonly value: "openai";
25
+ readonly label: "OpenAI";
26
+ }, {
27
+ readonly value: "google";
28
+ readonly label: "Google";
29
+ }, {
30
+ readonly value: "huggingface";
31
+ readonly label: "Hugging Face";
32
+ }, {
33
+ readonly value: "custom";
34
+ readonly label: "Custom";
35
+ }];
36
+ export type CredentialProviderOption = (typeof CREDENTIAL_PROVIDER_OPTIONS)[number];
37
+ export {};
38
+ //# sourceMappingURL=CredentialProviderOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialProviderOptions.d.ts","sourceRoot":"","sources":["../../src/credentials/CredentialProviderOptions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAA,MAAM,0BAA0B,YAC9B,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,aAAa,EACb,QAAQ,CACA,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,+BAA+B,6EAA6B,CAAC;AAE1E,2FAA2F;AAC3F,eAAO,MAAM,wBAAwB,QAAgC,CAAC;AAEtE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;oBACS,MAAM;;;oBACN,WAAW;;;oBACX,QAAQ;;;oBACR,QAAQ;;;oBACR,cAAc;;;oBACd,QAAQ;EAIvD,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * CLI / form input for storing a credential (key, secret, optional metadata).
8
+ */
9
+ export declare const CredentialPutInputSchema: {
10
+ readonly type: "object";
11
+ readonly properties: {
12
+ readonly key: {
13
+ readonly type: "string";
14
+ readonly title: "Key";
15
+ readonly description: 'Unique identifier (e.g. "openai-api-key")';
16
+ };
17
+ readonly value: {
18
+ readonly type: "string";
19
+ readonly title: "Value";
20
+ readonly description: "Secret value (API key, token, or password)";
21
+ readonly format: "password";
22
+ };
23
+ readonly label: {
24
+ readonly type: "string";
25
+ readonly title: "Label";
26
+ readonly description: "Human-readable label (optional)";
27
+ };
28
+ readonly provider: {
29
+ readonly type: "string";
30
+ readonly title: "Provider";
31
+ readonly description: "Optional provider this credential is associated with";
32
+ readonly enum: readonly ["none", "anthropic", "openai", "google", "huggingface", "custom"];
33
+ };
34
+ };
35
+ readonly required: readonly ["key", "value"];
36
+ };
37
+ //# sourceMappingURL=CredentialPutInputSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialPutInputSchema.d.ts","sourceRoot":"","sources":["../../src/credentials/CredentialPutInputSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,eAAO,MAAM,wBAAwB;mBAC7B,QAAQ;;iBAEZ,GAAG;qBACD,IAAI,EAAE,QAAQ;qBACd,KAAK,EAAE,KAAK;qBACZ,WAAW,EAAE,2CAA2C;;iBAE1D,KAAK;qBACH,IAAI,EAAE,QAAQ;qBACd,KAAK,EAAE,OAAO;qBACd,WAAW,EAAE,4CAA4C;qBACzD,MAAM,EAAE,UAAU;;iBAEpB,KAAK;qBACH,IAAI,EAAE,QAAQ;qBACd,KAAK,EAAE,OAAO;qBACd,WAAW,EAAE,iCAAiC;;iBAEhD,QAAQ;qBACN,IAAI,EAAE,QAAQ;qBACd,KAAK,EAAE,UAAU;qBACjB,WAAW,EAAE,sDAAsD;qBACnE,IAAI;;;;CAI+B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CredentialStoreRegistry.d.ts","sourceRoot":"","sources":["../../src/credentials/CredentialStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAG7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAY3D;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,gBAAgB,CAE3D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAEtE;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B"}
1
+ {"version":3,"file":"CredentialStoreRegistry.d.ts","sourceRoot":"","sources":["../../src/credentials/CredentialStoreRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAU3D;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,gBAAgB,CAE3D;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAEtE;AAED;;;;;;;;;GASG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,EACX,QAAQ,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ /**
7
+ * Options for {@link OtpPassphraseCache}.
8
+ */
9
+ export interface OtpPassphraseCacheOptions {
10
+ /**
11
+ * Absolute time-to-live in milliseconds. The cache is cleared unconditionally
12
+ * after this duration regardless of access. Default: 6 hours.
13
+ */
14
+ readonly hardTtlMs?: number;
15
+ /**
16
+ * Idle time-to-live in milliseconds. The expiry timer resets on each
17
+ * {@link OtpPassphraseCache.retrieve} call. If both `hardTtlMs` and
18
+ * `idleTtlMs` are set, whichever fires first wins.
19
+ */
20
+ readonly idleTtlMs?: number;
21
+ /**
22
+ * Called when the cache expires (either hard or idle TTL). Useful for
23
+ * locking a credential store when the passphrase is no longer available.
24
+ */
25
+ readonly onExpiry?: () => void;
26
+ }
27
+ /**
28
+ * XOR-masks a passphrase with a random one-time pad so the cache does not
29
+ * retain the plaintext in its internal storage. The masked value and pad are
30
+ * stored as `Uint8Array` instances and zeroed on {@link clear}. Plaintext may
31
+ * still exist transiently as a JavaScript `string` when passed to
32
+ * {@link store} or returned from {@link retrieve}.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const cache = new OtpPassphraseCache({ hardTtlMs: 6 * 60 * 60 * 1000 });
37
+ * cache.store("my-secret-passphrase");
38
+ * const passphrase = cache.retrieve(); // "my-secret-passphrase"
39
+ * cache.clear(); // zeroes buffers, fires onExpiry
40
+ * cache.retrieve(); // undefined
41
+ * ```
42
+ */
43
+ export declare class OtpPassphraseCache {
44
+ private masked;
45
+ private pad;
46
+ private hardTimer;
47
+ private idleTimer;
48
+ private readonly options;
49
+ constructor(options?: OtpPassphraseCacheOptions);
50
+ /**
51
+ * Store a passphrase in the cache, XOR-masked with a random one-time pad.
52
+ * Any previously cached passphrase is cleared first.
53
+ */
54
+ store(passphrase: string): void;
55
+ /**
56
+ * Recover the passphrase by XOR-ing masked + pad back together.
57
+ * Returns `undefined` if the cache is empty or expired.
58
+ * Resets the idle timer if `idleTtlMs` is configured.
59
+ */
60
+ retrieve(): string | undefined;
61
+ /**
62
+ * Whether the cache currently holds a passphrase.
63
+ */
64
+ get hasValue(): boolean;
65
+ /**
66
+ * Zeroes both buffers, clears timers, and fires the `onExpiry` callback.
67
+ */
68
+ clear(): void;
69
+ private clearInternal;
70
+ private startTimers;
71
+ private resetIdleTimer;
72
+ }
73
+ //# sourceMappingURL=OtpPassphraseCache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OtpPassphraseCache.d.ts","sourceRoot":"","sources":["../../src/credentials/OtpPassphraseCache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAID;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,GAAG,CAAyB;IACpC,OAAO,CAAC,SAAS,CAA4C;IAC7D,OAAO,CAAC,SAAS,CAA4C;IAC7D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IAEpD,YAAY,OAAO,CAAC,EAAE,yBAAyB,EAE9C;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAmB9B;IAED;;;;OAIG;IACH,QAAQ,IAAI,MAAM,GAAG,SAAS,CAa7B;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;OAEG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,WAAW;IAWnB,OAAO,CAAC,cAAc;CAcvB"}
@@ -3,9 +3,12 @@
3
3
  * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export * from "./ICredentialStore";
7
- export * from "./InMemoryCredentialStore";
8
- export * from "./EnvCredentialStore";
9
6
  export * from "./ChainedCredentialStore";
7
+ export * from "./CredentialProviderOptions";
8
+ export * from "./CredentialPutInputSchema";
10
9
  export * from "./CredentialStoreRegistry";
10
+ export * from "./EnvCredentialStore";
11
+ export * from "./ICredentialStore";
12
+ export * from "./InMemoryCredentialStore";
13
+ export * from "./OtpPassphraseCache";
11
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/credentials/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
@@ -10,6 +10,7 @@ export declare class Container {
10
10
  private services;
11
11
  private factories;
12
12
  private singletons;
13
+ private resolving;
13
14
  /**
14
15
  * Register a service factory
15
16
  * @param token The identifier token for the service
@@ -17,6 +18,14 @@ export declare class Container {
17
18
  * @param singleton Whether the service should be a singleton (created once)
18
19
  */
19
20
  register<T>(token: string, factory: () => T, singleton?: boolean): void;
21
+ /**
22
+ * Register a service factory only if the token is not already registered.
23
+ * This is an atomic check-and-register to avoid TOCTOU races.
24
+ * @param token The identifier token for the service
25
+ * @param factory A factory function that creates the service
26
+ * @param singleton Whether the service should be a singleton (created once)
27
+ */
28
+ registerIfAbsent<T>(token: string, factory: () => T, singleton?: boolean): void;
20
29
  /**
21
30
  * Register an instance as a service
22
31
  * @param token The identifier token for the service
@@ -40,6 +49,12 @@ export declare class Container {
40
49
  * @param token The identifier token for the service
41
50
  */
42
51
  remove(token: string): void;
52
+ /**
53
+ * Dispose all instantiated singleton services and clear registrations.
54
+ * Services implementing dispose(), Symbol.asyncDispose, or Symbol.dispose will be cleaned up.
55
+ */
56
+ dispose(): Promise<void>;
57
+ [Symbol.asyncDispose](): Promise<void>;
43
58
  /**
44
59
  * Create a child container that inherits registrations from the parent
45
60
  * @returns A new child container
@@ -1 +1 @@
1
- {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/di/Container.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,UAAU,CAA0B;IAE5C;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,UAAO,GAAG,IAAI,CAKnE;IAED;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAGpD;IAED;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CAiBvB;IAED;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1B;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED;;;OAGG;IACH,oBAAoB,IAAI,SAAS,CAoBhC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,WAAkB,CAAC"}
1
+ {"version":3,"file":"Container.d.ts","sourceRoot":"","sources":["../../src/di/Container.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,SAAS,CAAqC;IACtD,OAAO,CAAC,UAAU,CAA0B;IAC5C,OAAO,CAAC,SAAS,CAAgB;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,UAAO,GAAG,IAAI,CAKnE;IAED;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,UAAO,GAAG,IAAI,CAK3E;IAED;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAGpD;IAED;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,CA2BvB;IAED;;;;OAIG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE1B;IAED;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAI1B;IAED;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAyB7B;IAEK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3C;IAED;;;OAGG;IACH,oBAAoB,IAAI,SAAS,CAoBhC;CACF;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,WAAkB,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Steven Roussey <sroussey@gmail.com>
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ServiceRegistry } from "./ServiceRegistry";
7
+ /**
8
+ * A compactor function that converts a resolved instance back to its string ID.
9
+ * Returns undefined if the value cannot be compacted (e.g., missing ID field).
10
+ *
11
+ * @param value The resolved instance to compact
12
+ * @param format The full format string (e.g., "model:TextEmbedding", "storage:tabular")
13
+ * @param registry The service registry to use for lookups
14
+ */
15
+ export type InputCompactorFn = (value: unknown, format: string, registry: ServiceRegistry) => string | undefined | Promise<string | undefined>;
16
+ /**
17
+ * Service token for the input compactor registry.
18
+ * Maps format prefixes to compactor functions.
19
+ */
20
+ export declare const INPUT_COMPACTORS: import("./ServiceRegistry").ServiceToken<Map<string, InputCompactorFn>>;
21
+ /**
22
+ * Gets the global input compactor registry
23
+ * @returns Map of format prefix to compactor function
24
+ */
25
+ export declare function getInputCompactors(): Map<string, InputCompactorFn>;
26
+ /**
27
+ * Registers an input compactor for a format prefix.
28
+ * The compactor will be called to convert resolved instances back to string IDs.
29
+ *
30
+ * @param formatPrefix The format prefix to match (e.g., "model", "knowledge-base")
31
+ * @param compactor The compactor function
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * // Register model compactor — extracts model_id from a ModelConfig
36
+ * registerInputCompactor("model", (value) => {
37
+ * if (typeof value === "object" && value !== null && "model_id" in value) {
38
+ * const id = (value as Record<string, unknown>).model_id;
39
+ * return typeof id === "string" ? id : undefined;
40
+ * }
41
+ * return undefined;
42
+ * });
43
+ * ```
44
+ */
45
+ export declare function registerInputCompactor(formatPrefix: string, compactor: InputCompactorFn): void;
46
+ //# sourceMappingURL=InputCompactorRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputCompactorRegistry.d.ts","sourceRoot":"","sources":["../../src/di/InputCompactorRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,KACtB,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,yEAC+C,CAAC;AAS7E;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAElE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAG9F"}
@@ -1 +1 @@
1
- {"version":3,"file":"InputResolverRegistry.d.ts","sourceRoot":"","sources":["../../src/di/InputResolverRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,eAAe,wEAC8C,CAAC;AAW3E;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAEhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAG3F"}
1
+ {"version":3,"file":"InputResolverRegistry.d.ts","sourceRoot":"","sources":["../../src/di/InputResolverRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGzD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,eAAe,KACtB,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,eAAe,wEAC8C,CAAC;AAS3E;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAEhE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,IAAI,CAG3F"}
@@ -34,6 +34,13 @@ export declare class ServiceRegistry {
34
34
  * @param singleton Whether the service should be a singleton
35
35
  */
36
36
  register<T>(token: ServiceToken<T>, factory: () => T, singleton?: boolean): void;
37
+ /**
38
+ * Register a service factory only if the token is not already registered.
39
+ * @param token Service token
40
+ * @param factory Factory function to create the service
41
+ * @param singleton Whether the service should be a singleton
42
+ */
43
+ registerIfAbsent<T>(token: ServiceToken<T>, factory: () => T, singleton?: boolean): void;
37
44
  /**
38
45
  * Register a service instance
39
46
  * @param token Service token
@@ -52,6 +59,10 @@ export declare class ServiceRegistry {
52
59
  * @returns True if the service is registered
53
60
  */
54
61
  has<T>(token: ServiceToken<T>): boolean;
62
+ /**
63
+ * Dispose all instantiated services and clear registrations.
64
+ */
65
+ dispose(): Promise<void>;
55
66
  }
56
67
  /**
57
68
  * Global service registry instance
@@ -1 +1 @@
1
- {"version":3,"file":"ServiceRegistry.d.ts","sourceRoot":"","sources":["../../src/di/ServiceRegistry.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAEjE;AAED;;GAEG;AACH,qBAAa,eAAe;IACnB,SAAS,EAAE,SAAS,CAAC;IAE5B;;;OAGG;IACH,YAAY,SAAS,GAAE,SAA2B,EAEjD;IAED;;;;;OAKG;IACH,QAAQ,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,SAAS,UAAO,GAAG,IAAI,CAE5E;IAED;;;;OAIG;IACH,gBAAgB,CAAC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AC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,CAE7D;IAED;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAEhC;IAED;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,OAAO,CAEtC;IAED;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAE7B;CACF;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,iBAAuC,CAAC"}
@@ -4,6 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  export * from "./Container";
7
+ export * from "./InputCompactorRegistry";
7
8
  export * from "./InputResolverRegistry";
8
9
  export * from "./ServiceRegistry";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/di/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/di/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
@@ -29,6 +29,21 @@ export type EmittedReturnType<Events, EventType extends keyof Events> = EventPar
29
29
  */
30
30
  export declare class EventEmitter<EventListenerTypes extends Record<string, (...args: any) => any>> {
31
31
  private listeners;
32
+ private maxListeners;
33
+ private warnedEvents;
34
+ /**
35
+ * Set the maximum number of listeners per event before a warning is emitted.
36
+ * 0 means unlimited (default).
37
+ */
38
+ setMaxListeners(n: number): this;
39
+ /**
40
+ * Get the number of listeners for a specific event
41
+ */
42
+ listenerCount<Event extends keyof EventListenerTypes>(event: Event): number;
43
+ /**
44
+ * Get all event names that have registered listeners
45
+ */
46
+ eventNames(): Array<keyof EventListenerTypes>;
32
47
  /**
33
48
  * Remove all listeners for a specific event or all events
34
49
  * @param event - Optional event name. If not provided, removes all listeners for all events
@@ -68,6 +83,7 @@ export declare class EventEmitter<EventListenerTypes extends Record<string, (...
68
83
  * @param args - Arguments to pass to the event listeners
69
84
  */
70
85
  emit<Event extends keyof EventListenerTypes>(this: EventEmitter<EventListenerTypes>, event: Event, ...args: EventParameters<EventListenerTypes, Event>): void;
86
+ private checkMaxListeners;
71
87
  /**
72
88
  * Subscribes to an event and returns a function to unsubscribe
73
89
  * @param event - The event name to subscribe to
@@ -1 +1 @@
1
- {"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../src/events/EventEmitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,KAAK,aAAa,CAAC,MAAM,EAAE,SAAS,SAAS,MAAM,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,CAAC;AAY/E;;;;GAIG;AACH,MAAM,MAAM,eAAe,CAAC,MAAM,EAAE,SAAS,SAAS,MAAM,MAAM,IAAI;KACnE,KAAK,IAAI,SAAS,GAAG,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GACpF,CAAC,GACD,KAAK;CACV,CAAC,SAAS,CAAC,CAAC;AAEb;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,MAAM,EAAE,SAAS,SAAS,MAAM,MAAM,IAAI,eAAe,CACrF,MAAM,EACN,SAAS,CACV,CAAC;AAEF;;;GAGG;AACH,qBAAa,YAAY,CAAC,kBAAkB,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;IACxF,OAAO,CAAC,SAAS,CAEV;IAEP;;;;OAIG;IACH,kBAAkB,CA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AC,CAEnE;IAED;;;;;;;OAOG;IACH,UAAU,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAmCpF;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CA0BjC;IAED;;OAEG;IACH,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAErC;IAED;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE1B;IAED;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAEhC;IAED;;;OAGG;IACH,QAAQ,CACN,KAAK,EAAE,KAAK,CAAC,CAAC,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAAC,GACpF,MAAM,EAAE,CAIV;CACF"}
@@ -66,17 +66,36 @@ class CycleError extends BaseError {
66
66
  // src/events/EventEmitter.ts
67
67
  class EventEmitter {
68
68
  listeners = {};
69
+ maxListeners = 0;
70
+ warnedEvents = new Set;
71
+ setMaxListeners(n) {
72
+ if (!Number.isFinite(n) || n < 0) {
73
+ throw new RangeError(`"n" must be a non-negative finite number. Got ${n}.`);
74
+ }
75
+ this.maxListeners = Math.trunc(n);
76
+ this.warnedEvents.clear();
77
+ return this;
78
+ }
79
+ listenerCount(event) {
80
+ return this.listeners[event]?.length ?? 0;
81
+ }
82
+ eventNames() {
83
+ return Object.keys(this.listeners).filter((k) => (this.listeners[k]?.length ?? 0) > 0);
84
+ }
69
85
  removeAllListeners(event) {
70
86
  if (event) {
71
87
  delete this.listeners[event];
88
+ this.warnedEvents.delete(event);
72
89
  } else {
73
90
  this.listeners = {};
91
+ this.warnedEvents.clear();
74
92
  }
75
93
  return this;
76
94
  }
77
95
  on(event, listener) {
78
96
  const listeners = this.listeners[event] || (this.listeners[event] = []);
79
97
  listeners.push({ listener });
98
+ this.checkMaxListeners(event, listeners.length);
80
99
  return this;
81
100
  }
82
101
  off(event, listener) {
@@ -86,12 +105,16 @@ class EventEmitter {
86
105
  const index = listeners.findIndex((l) => l.listener === listener);
87
106
  if (index >= 0) {
88
107
  listeners.splice(index, 1);
108
+ if (this.maxListeners > 0 && listeners.length <= this.maxListeners) {
109
+ this.warnedEvents.delete(event);
110
+ }
89
111
  }
90
112
  return this;
91
113
  }
92
114
  once(event, listener) {
93
115
  const listeners = this.listeners[event] || (this.listeners[event] = []);
94
116
  listeners.push({ listener, once: true });
117
+ this.checkMaxListeners(event, listeners.length);
95
118
  return this;
96
119
  }
97
120
  waitOn(event) {
@@ -115,11 +138,22 @@ class EventEmitter {
115
138
  }
116
139
  }
117
140
  this.listeners[event] = listeners.filter((l) => !l.once);
118
- if (errors.length > 0) {
141
+ if (this.maxListeners > 0 && (this.listeners[event]?.length ?? 0) <= this.maxListeners) {
142
+ this.warnedEvents.delete(event);
143
+ }
144
+ if (errors.length > 1) {
145
+ throw new AggregateError(errors, `${errors.length} listener(s) threw on "${String(event)}"`);
146
+ } else if (errors.length === 1) {
119
147
  throw errors[0];
120
148
  }
121
149
  }
122
150
  }
151
+ checkMaxListeners(event, count) {
152
+ if (this.maxListeners > 0 && count > this.maxListeners && !this.warnedEvents.has(event)) {
153
+ this.warnedEvents.add(event);
154
+ console.warn(`MaxListenersExceededWarning: Possible EventEmitter memory leak detected. ` + `${count} listeners added for event "${String(event)}". ` + `Use setMaxListeners() to increase limit (current: ${this.maxListeners}).`);
155
+ }
156
+ }
123
157
  subscribe(event, listener) {
124
158
  this.on(event, listener);
125
159
  return () => this.off(event, listener);
@@ -294,16 +328,17 @@ class Graph {
294
328
  if (edgeIdentity === undefined) {
295
329
  this.adjacency[node1Index][node2Index] = null;
296
330
  } else {
297
- for (const row of this.adjacency) {
298
- for (const edgelist of row) {
299
- if (edgelist !== null) {
300
- for (let edgeIndex = 0;edgeIndex < edgelist.length; edgeIndex++) {
301
- if (this.edgeIdentity(edgelist[edgeIndex], node1Identity, node2Identity) === edgeIdentity) {
302
- edgelist.splice(edgeIndex, 1);
303
- }
304
- }
331
+ const edgeList = this.adjacency[node1Index][node2Index];
332
+ if (edgeList !== null) {
333
+ for (let edgeIndex = 0;edgeIndex < edgeList.length; edgeIndex++) {
334
+ if (this.edgeIdentity(edgeList[edgeIndex], node1Identity, node2Identity) === edgeIdentity) {
335
+ edgeList.splice(edgeIndex, 1);
336
+ break;
305
337
  }
306
338
  }
339
+ if (edgeList.length === 0) {
340
+ this.adjacency[node1Index][node2Index] = null;
341
+ }
307
342
  }
308
343
  }
309
344
  this.emit("edge-removed", edgeIdentity);
@@ -356,12 +391,13 @@ class DirectedGraph extends Graph {
356
391
  }
357
392
  const nodeIndex = this.getNodeIndex(cur[0]);
358
393
  this.adjacency[nodeIndex].forEach((hasAdj, index) => {
359
- if (hasAdj !== null) {
394
+ if (hasAdj !== null && hasAdj.length > 0) {
395
+ const edgeCount = hasAdj.length;
360
396
  const currentInDegree = nodeInDegrees.get(nodeIndices[index]);
361
397
  if (currentInDegree !== undefined) {
362
- nodeInDegrees.set(nodeIndices[index], currentInDegree - 1);
363
- if (currentInDegree - 1 === 0) {
364
- toSearch.push([nodeIndices[index], currentInDegree - 1]);
398
+ nodeInDegrees.set(nodeIndices[index], currentInDegree - edgeCount);
399
+ if (currentInDegree - edgeCount === 0) {
400
+ toSearch.push([nodeIndices[index], currentInDegree - edgeCount]);
365
401
  }
366
402
  }
367
403
  }
@@ -377,7 +413,7 @@ class DirectedGraph extends Graph {
377
413
  throw new NodeDoesntExistError(nodeID);
378
414
  }
379
415
  return this.adjacency.reduce((carry, row) => {
380
- return carry + (row[indexOfNode] == null ? 0 : 1);
416
+ return carry + (row[indexOfNode] == null ? 0 : row[indexOfNode].length);
381
417
  }, 0);
382
418
  }
383
419
  addEdge(sourceNodeIdentity, targetNodeIdentity, edge, skipUpdatingCyclicality = false) {
@@ -519,12 +555,13 @@ class DirectedAcyclicGraph extends DirectedGraph {
519
555
  }
520
556
  toReturn.push(curNode);
521
557
  adjCopy[this.getNodeIndex(n[0])]?.forEach((edge, index) => {
522
- if (edge !== null) {
558
+ if (edge !== null && edge.length > 0) {
559
+ const edgeCount = edge.length;
523
560
  adjCopy[this.getNodeIndex(n[0])][index] = null;
524
561
  const target = nodeInDegrees.get(nodeIndices[index]);
525
562
  if (target !== undefined) {
526
- nodeInDegrees.set(nodeIndices[index], target - 1);
527
- if (target - 1 === 0) {
563
+ nodeInDegrees.set(nodeIndices[index], target - edgeCount);
564
+ if (target - edgeCount === 0) {
528
565
  toSearch.push([nodeIndices[index], 0]);
529
566
  }
530
567
  } else {
@@ -557,4 +594,4 @@ export {
557
594
  CycleError
558
595
  };
559
596
 
560
- //# debugId=B6C6EBC84B87011464756E2164756E21
597
+ //# debugId=98DAB3A067D5213F64756E2164756E21