@vibetools/dokploy-mcp 2.1.1 → 2.2.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.
@@ -1,4 +1,5 @@
1
1
  import { createGeneratedDokployRuntime } from '../../generated/dokploy-sdk.js';
2
+ import { executeVirtualProcedure, isVirtualProcedure, validateVirtualProcedureInput, } from '../overrides/virtual-procedures.js';
2
3
  export function buildHelpers() {
3
4
  return {
4
5
  sleep(ms) {
@@ -56,8 +57,34 @@ export function createCallTracker(executor, maxCalls) {
56
57
  }
57
58
  export function createExecuteContext(executor, maxCalls) {
58
59
  const tracker = createCallTracker(executor, maxCalls);
60
+ const dispatchCall = async (procedure, input = {}) => {
61
+ if (!isVirtualProcedure(procedure)) {
62
+ return tracker.call(procedure, input);
63
+ }
64
+ const validationErrors = validateVirtualProcedureInput(procedure, input);
65
+ if (validationErrors.length > 0) {
66
+ throw new Error(validationErrors.join('; '));
67
+ }
68
+ return executeVirtualProcedure(procedure, input, {
69
+ call: dispatchCall,
70
+ });
71
+ };
72
+ const runtime = createGeneratedDokployRuntime(dispatchCall);
73
+ const dokploy = {
74
+ ...runtime,
75
+ call: (procedure, input) => dispatchCall(procedure, input),
76
+ application: {
77
+ ...runtime.application,
78
+ one: (input) => dispatchCall('application.one', input),
79
+ many: (input) => dispatchCall('application.many', input),
80
+ },
81
+ project: {
82
+ ...runtime.project,
83
+ overview: (input) => dispatchCall('project.overview', input),
84
+ },
85
+ };
59
86
  return {
60
- dokploy: createGeneratedDokployRuntime(tracker.call),
87
+ dokploy,
61
88
  helpers: buildHelpers(),
62
89
  getCalls: tracker.getCalls,
63
90
  };