unplugin-devpilot 0.0.0 → 0.0.2

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/dist/farm.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginDevpilot } from "./index-CyKvTBcJ.mjs";
1
+ import { t as unpluginDevpilot } from "./index-CQudsm6j.mjs";
2
2
 
3
3
  //#region src/farm.d.ts
4
4
  /**
package/dist/farm.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as unpluginDevpilot } from "./src-aMXlip6o.mjs";
1
+ import { n as unpluginDevpilot } from "./src-D62s1VAN.mjs";
2
2
 
3
3
  //#region src/farm.ts
4
4
  /**
@@ -4111,6 +4111,7 @@ interface DevpilotPluginContext {
4111
4111
  }
4112
4112
  /**
4113
4113
  * Resolve the module path relative to the plugin to an absolute path
4114
+ * Handles cross-platform paths (Windows, macOS, Linux) and proper escaping for imports
4114
4115
  * @param importMetaUrl - Pass in import.meta.url
4115
4116
  * @param relativePath - Path relative to the plugin
4116
4117
  * @example
@@ -1,4 +1,4 @@
1
- import { r as McpToolRegister, t as DevpilotPluginContext } from "./index-CL0Gw5-1.mjs";
1
+ import { r as McpToolRegister, t as DevpilotPluginContext } from "./index-9V3dRAxA.mjs";
2
2
  import { UnpluginInstance } from "unplugin";
3
3
  import { WebSocket } from "ws";
4
4
 
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { i as defineMcpToolRegister, n as resolveClientModule, t as DevpilotPluginContext } from "./index-CL0Gw5-1.mjs";
2
- import { a as ClientDiscoveryFilter, c as PendingTask, d as ServerFunctions, f as TaskHistory, i as BaseServerFunctions, l as PluginClientFunctions, m as Options, n as clientManager, o as ClientFunctions, p as DevpilotPlugin, r as BaseClientFunctions, s as ClientInfo, t as unpluginDevpilot, u as PluginServerFunctions } from "./index-CyKvTBcJ.mjs";
1
+ import { i as defineMcpToolRegister, n as resolveClientModule, t as DevpilotPluginContext } from "./index-9V3dRAxA.mjs";
2
+ import { a as ClientDiscoveryFilter, c as PendingTask, d as ServerFunctions, f as TaskHistory, i as BaseServerFunctions, l as PluginClientFunctions, m as Options, n as clientManager, o as ClientFunctions, p as DevpilotPlugin, r as BaseClientFunctions, s as ClientInfo, t as unpluginDevpilot, u as PluginServerFunctions } from "./index-CQudsm6j.mjs";
3
3
  export { BaseClientFunctions, BaseServerFunctions, ClientDiscoveryFilter, ClientFunctions, ClientInfo, DevpilotPlugin, DevpilotPluginContext, Options, PendingTask, PluginClientFunctions, PluginServerFunctions, ServerFunctions, TaskHistory, clientManager, unpluginDevpilot as default, unpluginDevpilot, defineMcpToolRegister, resolveClientModule };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as unpluginDevpilot, r as clientManager, t as src_default } from "./src-aMXlip6o.mjs";
2
- import { n as defineMcpToolRegister, t as resolveClientModule } from "./plugin-PB-j5Ck2.mjs";
1
+ import { n as unpluginDevpilot, r as clientManager, t as src_default } from "./src-D62s1VAN.mjs";
2
+ import { n as defineMcpToolRegister, t as resolveClientModule } from "./plugin-BPkoZQbf.mjs";
3
3
 
4
4
  export { clientManager, src_default as default, defineMcpToolRegister, resolveClientModule, unpluginDevpilot };
@@ -1,5 +1,5 @@
1
- import { dirname } from "node:path";
2
- import { fileURLToPath } from "node:url";
1
+ import { dirname, join } from "node:path";
2
+ import { fileURLToPath, pathToFileURL } from "node:url";
3
3
 
4
4
  //#region src/core/plugin/mcp.ts
5
5
  function defineMcpToolRegister(name, config, cb) {
@@ -14,6 +14,7 @@ function defineMcpToolRegister(name, config, cb) {
14
14
  //#region src/core/plugin/index.ts
15
15
  /**
16
16
  * Resolve the module path relative to the plugin to an absolute path
17
+ * Handles cross-platform paths (Windows, macOS, Linux) and proper escaping for imports
17
18
  * @param importMetaUrl - Pass in import.meta.url
18
19
  * @param relativePath - Path relative to the plugin
19
20
  * @example
@@ -29,7 +30,7 @@ function defineMcpToolRegister(name, config, cb) {
29
30
  * ```
30
31
  */
31
32
  function resolveClientModule(importMetaUrl, relativePath) {
32
- return `${dirname(fileURLToPath(importMetaUrl))}/${relativePath}`;
33
+ return pathToFileURL(join(dirname(fileURLToPath(importMetaUrl)), relativePath)).href;
33
34
  }
34
35
 
35
36
  //#endregion
package/dist/plugin.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as defineMcpToolRegister, n as resolveClientModule, r as McpToolRegister, t as DevpilotPluginContext } from "./index-CL0Gw5-1.mjs";
1
+ import { i as defineMcpToolRegister, n as resolveClientModule, r as McpToolRegister, t as DevpilotPluginContext } from "./index-9V3dRAxA.mjs";
2
2
  export { DevpilotPluginContext, McpToolRegister as McpServerRegister, defineMcpToolRegister, resolveClientModule };
package/dist/plugin.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as defineMcpToolRegister, t as resolveClientModule } from "./plugin-PB-j5Ck2.mjs";
1
+ import { n as defineMcpToolRegister, t as resolveClientModule } from "./plugin-BPkoZQbf.mjs";
2
2
 
3
3
  export { defineMcpToolRegister, resolveClientModule };
package/dist/rspack.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginDevpilot } from "./index-CyKvTBcJ.mjs";
1
+ import { t as unpluginDevpilot } from "./index-CQudsm6j.mjs";
2
2
 
3
3
  //#region src/rspack.d.ts
4
4
  /**
package/dist/rspack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as unpluginDevpilot } from "./src-aMXlip6o.mjs";
1
+ import { n as unpluginDevpilot } from "./src-D62s1VAN.mjs";
2
2
 
3
3
  //#region src/rspack.ts
4
4
  /**
@@ -1,4 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
+ import process$1 from "node:process";
2
3
  import { createUnplugin } from "unplugin";
3
4
  import { createServer } from "node:http";
4
5
  import { Http2ServerRequest } from "http2";
@@ -6406,7 +6407,7 @@ function initializeContext(params) {
6406
6407
  external: params?.external ?? void 0
6407
6408
  };
6408
6409
  }
6409
- function process$1(schema, ctx, _params = {
6410
+ function process$2(schema, ctx, _params = {
6410
6411
  path: [],
6411
6412
  schemaPath: []
6412
6413
  }) {
@@ -6443,7 +6444,7 @@ function process$1(schema, ctx, _params = {
6443
6444
  const parent = schema._zod.parent;
6444
6445
  if (parent) {
6445
6446
  if (!result.ref) result.ref = parent;
6446
- process$1(parent, ctx, params);
6447
+ process$2(parent, ctx, params);
6447
6448
  ctx.seen.get(parent).isParent = true;
6448
6449
  }
6449
6450
  }
@@ -6655,7 +6656,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
6655
6656
  ...params,
6656
6657
  processors
6657
6658
  });
6658
- process$1(schema, ctx);
6659
+ process$2(schema, ctx);
6659
6660
  extractDefs(ctx, schema);
6660
6661
  return finalize(ctx, schema);
6661
6662
  };
@@ -6667,7 +6668,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
6667
6668
  io,
6668
6669
  processors
6669
6670
  });
6670
- process$1(schema, ctx);
6671
+ process$2(schema, ctx);
6671
6672
  extractDefs(ctx, schema);
6672
6673
  return finalize(ctx, schema);
6673
6674
  };
@@ -6839,7 +6840,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
6839
6840
  if (typeof minimum === "number") json.minItems = minimum;
6840
6841
  if (typeof maximum === "number") json.maxItems = maximum;
6841
6842
  json.type = "array";
6842
- json.items = process$1(def.element, ctx, {
6843
+ json.items = process$2(def.element, ctx, {
6843
6844
  ...params,
6844
6845
  path: [...params.path, "items"]
6845
6846
  });
@@ -6850,7 +6851,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
6850
6851
  json.type = "object";
6851
6852
  json.properties = {};
6852
6853
  const shape = def.shape;
6853
- for (const key in shape) json.properties[key] = process$1(shape[key], ctx, {
6854
+ for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
6854
6855
  ...params,
6855
6856
  path: [
6856
6857
  ...params.path,
@@ -6868,7 +6869,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
6868
6869
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
6869
6870
  else if (!def.catchall) {
6870
6871
  if (ctx.io === "output") json.additionalProperties = false;
6871
- } else if (def.catchall) json.additionalProperties = process$1(def.catchall, ctx, {
6872
+ } else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
6872
6873
  ...params,
6873
6874
  path: [...params.path, "additionalProperties"]
6874
6875
  });
@@ -6876,7 +6877,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
6876
6877
  const unionProcessor = (schema, ctx, json, params) => {
6877
6878
  const def = schema._zod.def;
6878
6879
  const isExclusive = def.inclusive === false;
6879
- const options = def.options.map((x, i) => process$1(x, ctx, {
6880
+ const options = def.options.map((x, i) => process$2(x, ctx, {
6880
6881
  ...params,
6881
6882
  path: [
6882
6883
  ...params.path,
@@ -6889,7 +6890,7 @@ const unionProcessor = (schema, ctx, json, params) => {
6889
6890
  };
6890
6891
  const intersectionProcessor = (schema, ctx, json, params) => {
6891
6892
  const def = schema._zod.def;
6892
- const a = process$1(def.left, ctx, {
6893
+ const a = process$2(def.left, ctx, {
6893
6894
  ...params,
6894
6895
  path: [
6895
6896
  ...params.path,
@@ -6897,7 +6898,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
6897
6898
  0
6898
6899
  ]
6899
6900
  });
6900
- const b = process$1(def.right, ctx, {
6901
+ const b = process$2(def.right, ctx, {
6901
6902
  ...params,
6902
6903
  path: [
6903
6904
  ...params.path,
@@ -6914,7 +6915,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
6914
6915
  json.type = "array";
6915
6916
  const prefixPath = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
6916
6917
  const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
6917
- const prefixItems = def.items.map((x, i) => process$1(x, ctx, {
6918
+ const prefixItems = def.items.map((x, i) => process$2(x, ctx, {
6918
6919
  ...params,
6919
6920
  path: [
6920
6921
  ...params.path,
@@ -6922,7 +6923,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
6922
6923
  i
6923
6924
  ]
6924
6925
  }));
6925
- const rest = def.rest ? process$1(def.rest, ctx, {
6926
+ const rest = def.rest ? process$2(def.rest, ctx, {
6926
6927
  ...params,
6927
6928
  path: [
6928
6929
  ...params.path,
@@ -6953,7 +6954,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
6953
6954
  const keyType = def.keyType;
6954
6955
  const patterns = keyType._zod.bag?.patterns;
6955
6956
  if (def.mode === "loose" && patterns && patterns.size > 0) {
6956
- const valueSchema = process$1(def.valueType, ctx, {
6957
+ const valueSchema = process$2(def.valueType, ctx, {
6957
6958
  ...params,
6958
6959
  path: [
6959
6960
  ...params.path,
@@ -6964,11 +6965,11 @@ const recordProcessor = (schema, ctx, _json, params) => {
6964
6965
  json.patternProperties = {};
6965
6966
  for (const pattern of patterns) json.patternProperties[pattern.source] = valueSchema;
6966
6967
  } else {
6967
- if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$1(def.keyType, ctx, {
6968
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") json.propertyNames = process$2(def.keyType, ctx, {
6968
6969
  ...params,
6969
6970
  path: [...params.path, "propertyNames"]
6970
6971
  });
6971
- json.additionalProperties = process$1(def.valueType, ctx, {
6972
+ json.additionalProperties = process$2(def.valueType, ctx, {
6972
6973
  ...params,
6973
6974
  path: [...params.path, "additionalProperties"]
6974
6975
  });
@@ -6981,7 +6982,7 @@ const recordProcessor = (schema, ctx, _json, params) => {
6981
6982
  };
6982
6983
  const nullableProcessor = (schema, ctx, json, params) => {
6983
6984
  const def = schema._zod.def;
6984
- const inner = process$1(def.innerType, ctx, params);
6985
+ const inner = process$2(def.innerType, ctx, params);
6985
6986
  const seen = ctx.seen.get(schema);
6986
6987
  if (ctx.target === "openapi-3.0") {
6987
6988
  seen.ref = def.innerType;
@@ -6990,27 +6991,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
6990
6991
  };
6991
6992
  const nonoptionalProcessor = (schema, ctx, _json, params) => {
6992
6993
  const def = schema._zod.def;
6993
- process$1(def.innerType, ctx, params);
6994
+ process$2(def.innerType, ctx, params);
6994
6995
  const seen = ctx.seen.get(schema);
6995
6996
  seen.ref = def.innerType;
6996
6997
  };
6997
6998
  const defaultProcessor = (schema, ctx, json, params) => {
6998
6999
  const def = schema._zod.def;
6999
- process$1(def.innerType, ctx, params);
7000
+ process$2(def.innerType, ctx, params);
7000
7001
  const seen = ctx.seen.get(schema);
7001
7002
  seen.ref = def.innerType;
7002
7003
  json.default = JSON.parse(JSON.stringify(def.defaultValue));
7003
7004
  };
7004
7005
  const prefaultProcessor = (schema, ctx, json, params) => {
7005
7006
  const def = schema._zod.def;
7006
- process$1(def.innerType, ctx, params);
7007
+ process$2(def.innerType, ctx, params);
7007
7008
  const seen = ctx.seen.get(schema);
7008
7009
  seen.ref = def.innerType;
7009
7010
  if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
7010
7011
  };
7011
7012
  const catchProcessor = (schema, ctx, json, params) => {
7012
7013
  const def = schema._zod.def;
7013
- process$1(def.innerType, ctx, params);
7014
+ process$2(def.innerType, ctx, params);
7014
7015
  const seen = ctx.seen.get(schema);
7015
7016
  seen.ref = def.innerType;
7016
7017
  let catchValue;
@@ -7024,32 +7025,32 @@ const catchProcessor = (schema, ctx, json, params) => {
7024
7025
  const pipeProcessor = (schema, ctx, _json, params) => {
7025
7026
  const def = schema._zod.def;
7026
7027
  const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
7027
- process$1(innerType, ctx, params);
7028
+ process$2(innerType, ctx, params);
7028
7029
  const seen = ctx.seen.get(schema);
7029
7030
  seen.ref = innerType;
7030
7031
  };
7031
7032
  const readonlyProcessor = (schema, ctx, json, params) => {
7032
7033
  const def = schema._zod.def;
7033
- process$1(def.innerType, ctx, params);
7034
+ process$2(def.innerType, ctx, params);
7034
7035
  const seen = ctx.seen.get(schema);
7035
7036
  seen.ref = def.innerType;
7036
7037
  json.readOnly = true;
7037
7038
  };
7038
7039
  const promiseProcessor = (schema, ctx, _json, params) => {
7039
7040
  const def = schema._zod.def;
7040
- process$1(def.innerType, ctx, params);
7041
+ process$2(def.innerType, ctx, params);
7041
7042
  const seen = ctx.seen.get(schema);
7042
7043
  seen.ref = def.innerType;
7043
7044
  };
7044
7045
  const optionalProcessor = (schema, ctx, _json, params) => {
7045
7046
  const def = schema._zod.def;
7046
- process$1(def.innerType, ctx, params);
7047
+ process$2(def.innerType, ctx, params);
7047
7048
  const seen = ctx.seen.get(schema);
7048
7049
  seen.ref = def.innerType;
7049
7050
  };
7050
7051
  const lazyProcessor = (schema, ctx, _json, params) => {
7051
7052
  const innerType = schema._zod.innerType;
7052
- process$1(innerType, ctx, params);
7053
+ process$2(innerType, ctx, params);
7053
7054
  const seen = ctx.seen.get(schema);
7054
7055
  seen.ref = innerType;
7055
7056
  };
@@ -7104,7 +7105,7 @@ function toJSONSchema(input, params) {
7104
7105
  const defs = {};
7105
7106
  for (const entry of registry._idmap.entries()) {
7106
7107
  const [_, schema] = entry;
7107
- process$1(schema, ctx);
7108
+ process$2(schema, ctx);
7108
7109
  }
7109
7110
  const schemas = {};
7110
7111
  ctx.external = {
@@ -7124,7 +7125,7 @@ function toJSONSchema(input, params) {
7124
7125
  ...params,
7125
7126
  processors: allProcessors
7126
7127
  });
7127
- process$1(input, ctx);
7128
+ process$2(input, ctx);
7128
7129
  extractDefs(ctx, input);
7129
7130
  return finalize(ctx, input);
7130
7131
  }
@@ -19792,7 +19793,7 @@ var StreamableHTTPServerTransport = class {
19792
19793
 
19793
19794
  //#endregion
19794
19795
  //#region package.json
19795
- var version = "0.0.0";
19796
+ var version = "0.0.2";
19796
19797
 
19797
19798
  //#endregion
19798
19799
  //#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/util/uniqueId.mjs
@@ -24005,7 +24006,8 @@ function getPluginClientModules(plugins, options) {
24005
24006
  return typeof p.clientModule === "function" ? p.clientModule(ctx) : p.clientModule;
24006
24007
  });
24007
24008
  }
24008
- function generateVirtualClientModule(options) {
24009
+ function generateVirtualClientModule(options, isDev) {
24010
+ if (!isDev) return "";
24009
24011
  const pluginModules = getPluginClientModules(options.plugins, options);
24010
24012
  const importStatements = pluginModules.map((mod, index) => `import { rpcHandlers as handlers_${index} } from '${mod}';`).join("\n");
24011
24013
  const handlerCollection = pluginModules.map((_, index) => ` ...handlers_${index},`).join("\n");
@@ -24050,9 +24052,10 @@ const unpluginDevpilot = createUnplugin((rawOptions = {}) => {
24050
24052
  return id === RESOLVED_VIRTUAL_MODULE_ID;
24051
24053
  },
24052
24054
  load(id) {
24053
- if (id === RESOLVED_VIRTUAL_MODULE_ID) return generateVirtualClientModule(options);
24055
+ if (id === RESOLVED_VIRTUAL_MODULE_ID) return generateVirtualClientModule(options, process$1.env.NODE_ENV !== "production");
24054
24056
  },
24055
24057
  buildStart() {
24058
+ if (process$1.env.NODE_ENV === "production") return;
24056
24059
  startServers();
24057
24060
  },
24058
24061
  buildEnd() {
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginDevpilot } from "./index-CyKvTBcJ.mjs";
1
+ import { t as unpluginDevpilot } from "./index-CQudsm6j.mjs";
2
2
 
3
3
  //#region src/vite.d.ts
4
4
  /**
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as unpluginDevpilot } from "./src-aMXlip6o.mjs";
1
+ import { n as unpluginDevpilot } from "./src-D62s1VAN.mjs";
2
2
 
3
3
  //#region src/vite.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as unpluginDevpilot } from "./index-CyKvTBcJ.mjs";
1
+ import { t as unpluginDevpilot } from "./index-CQudsm6j.mjs";
2
2
 
3
3
  //#region src/webpack.d.ts
4
4
  /**
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as unpluginDevpilot } from "./src-aMXlip6o.mjs";
1
+ import { n as unpluginDevpilot } from "./src-D62s1VAN.mjs";
2
2
 
3
3
  //#region src/webpack.ts
4
4
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unplugin-devpilot",
3
3
  "type": "module",
4
- "version": "0.0.0",
4
+ "version": "0.0.2",
5
5
  "description": "Description.",
6
6
  "author": "zcf0508 <zcf0508@live.com>",
7
7
  "license": "MIT",