@frontmcp/di 1.0.4 → 1.1.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.
package/esm/index.mjs CHANGED
@@ -2,8 +2,10 @@
2
2
  function createTokenFactory(options = {}) {
3
3
  const prefix = options.prefix ?? "DI";
4
4
  return {
5
- type: (name) => /* @__PURE__ */ Symbol(`${prefix}:type:${name}`),
6
- meta: (name) => /* @__PURE__ */ Symbol(`${prefix}:meta:${name}`)
5
+ // Use Symbol.for() to create globally shared symbols that survive across
6
+ // multiple module instances (e.g., SDK loaded from both app and plugin paths).
7
+ type: (name) => /* @__PURE__ */ Symbol.for(`${prefix}:type:${name}`),
8
+ meta: (name) => /* @__PURE__ */ Symbol.for(`${prefix}:meta:${name}`)
7
9
  };
8
10
  }
9
11
  var DiTokens = createTokenFactory({ prefix: "DI" });
@@ -33,7 +35,7 @@ var ProviderScope = /* @__PURE__ */ ((ProviderScope2) => {
33
35
  })(ProviderScope || {});
34
36
 
35
37
  // libs/di/src/metadata/provider.schema.ts
36
- import { z } from "zod";
38
+ import { z } from "@frontmcp/lazy-zod";
37
39
  var providerMetadataSchema = z.object({
38
40
  id: z.string().optional(),
39
41
  name: z.string().min(1),
package/esm/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/di",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Generic dependency injection container and registry utilities for TypeScript applications",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "reflect-metadata": "^0.2.0",
54
- "zod": "^4.0.0"
54
+ "@frontmcp/lazy-zod": "1.1.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "^24.0.0",
package/index.js CHANGED
@@ -53,8 +53,10 @@ module.exports = __toCommonJS(index_exports);
53
53
  function createTokenFactory(options = {}) {
54
54
  const prefix = options.prefix ?? "DI";
55
55
  return {
56
- type: (name) => /* @__PURE__ */ Symbol(`${prefix}:type:${name}`),
57
- meta: (name) => /* @__PURE__ */ Symbol(`${prefix}:meta:${name}`)
56
+ // Use Symbol.for() to create globally shared symbols that survive across
57
+ // multiple module instances (e.g., SDK loaded from both app and plugin paths).
58
+ type: (name) => /* @__PURE__ */ Symbol.for(`${prefix}:type:${name}`),
59
+ meta: (name) => /* @__PURE__ */ Symbol.for(`${prefix}:meta:${name}`)
58
60
  };
59
61
  }
60
62
  var DiTokens = createTokenFactory({ prefix: "DI" });
@@ -84,12 +86,12 @@ var ProviderScope = /* @__PURE__ */ ((ProviderScope2) => {
84
86
  })(ProviderScope || {});
85
87
 
86
88
  // libs/di/src/metadata/provider.schema.ts
87
- var import_zod = require("zod");
88
- var providerMetadataSchema = import_zod.z.object({
89
- id: import_zod.z.string().optional(),
90
- name: import_zod.z.string().min(1),
91
- description: import_zod.z.string().optional(),
92
- scope: import_zod.z.nativeEnum(ProviderScope).optional().default("global" /* GLOBAL */)
89
+ var import_lazy_zod = require("@frontmcp/lazy-zod");
90
+ var providerMetadataSchema = import_lazy_zod.z.object({
91
+ id: import_lazy_zod.z.string().optional(),
92
+ name: import_lazy_zod.z.string().min(1),
93
+ description: import_lazy_zod.z.string().optional(),
94
+ scope: import_lazy_zod.z.nativeEnum(ProviderScope).optional().default("global" /* GLOBAL */)
93
95
  }).passthrough();
94
96
 
95
97
  // libs/di/src/utils/metadata.utils.ts
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Zod schema for provider metadata validation.
3
3
  */
4
- import { z } from 'zod';
4
+ import { z } from '@frontmcp/lazy-zod';
5
5
  import { ProviderScope } from './provider.metadata.js';
6
6
  /**
7
7
  * Helper type for creating Zod schemas that match an interface.
@@ -20,12 +20,12 @@ export type RawZodShape<T> = {
20
20
  * });
21
21
  * ```
22
22
  */
23
- export declare const providerMetadataSchema: z.ZodObject<{
24
- id: z.ZodOptional<z.ZodString>;
25
- name: z.ZodString;
26
- description: z.ZodOptional<z.ZodString>;
27
- scope: z.ZodDefault<z.ZodOptional<z.ZodEnum<typeof ProviderScope>>>;
28
- }, z.core.$loose>;
23
+ export declare const providerMetadataSchema: import("@frontmcp/lazy-zod").ZodObject<{
24
+ id: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
25
+ name: import("@frontmcp/lazy-zod").ZodString;
26
+ description: import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodString>;
27
+ scope: import("@frontmcp/lazy-zod").ZodDefault<import("@frontmcp/lazy-zod").ZodOptional<import("@frontmcp/lazy-zod").ZodEnum<typeof ProviderScope>>>;
28
+ }, import("zod/v4/core").$loose>;
29
29
  /**
30
30
  * Type inferred from the provider metadata schema.
31
31
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontmcp/di",
3
- "version": "1.0.4",
3
+ "version": "1.1.0",
4
4
  "description": "Generic dependency injection container and registry utilities for TypeScript applications",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "reflect-metadata": "^0.2.0",
54
- "zod": "^4.0.0"
54
+ "@frontmcp/lazy-zod": "1.1.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "^24.0.0",
@@ -6,12 +6,12 @@
6
6
  * // Create a factory with custom prefix
7
7
  * const tokens = createTokenFactory({ prefix: 'MyApp' });
8
8
  *
9
- * // Create typed tokens
9
+ * // Create globally shared tokens (safe across multiple module instances)
10
10
  * const serviceToken = tokens.type('UserService');
11
- * // => Symbol('MyApp:type:UserService')
11
+ * // => Symbol.for('MyApp:type:UserService')
12
12
  *
13
13
  * const metaToken = tokens.meta('config');
14
- * // => Symbol('MyApp:meta:config')
14
+ * // => Symbol.for('MyApp:meta:config')
15
15
  * ```
16
16
  */
17
17
  export interface TokenFactoryOptions {