@better-openclaw/core 1.0.18 → 1.0.20

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 +1 @@
1
- {"version":3,"file":"dokploy.cjs","names":[],"sources":["../../src/deployers/dokploy.ts"],"sourcesContent":["/**\n * Dokploy PaaS deployer — deploys Docker Compose stacks via the Dokploy REST API.\n *\n * API docs: https://docs.dokploy.com/docs/api\n * Auth: x-api-key header\n * Endpoints use dot-notation (e.g. /api/project.create, /api/compose.deploy)\n */\n\nimport type { DeployInput, DeployResult, DeployStep, DeployTarget, PaasDeployer } from \"./types.js\";\n\n/** Shape returned by Dokploy's project endpoints. */\ninterface DokployProject {\n\tprojectId: string;\n\tname: string;\n\tdescription: string;\n\tenvironments?: { environmentId: string; name: string }[];\n}\n\n/** Shape returned by Dokploy's compose endpoints. */\ninterface DokployCompose {\n\tcomposeId: string;\n\tname: string;\n\tstatus?: string;\n}\n\n/** Build a full Dokploy API URL from a dot-notation endpoint (e.g. \"project.create\"). */\nfunction apiUrl(target: DeployTarget, endpoint: string): string {\n\tconst base = target.instanceUrl.replace(/\\/+$/, \"\");\n\treturn `${base}/api/${endpoint}`;\n}\n\n/**\n * Typed fetch wrapper for the Dokploy API.\n * Handles JSON serialisation, x-api-key auth, and error extraction.\n */\nasync function dokployFetch<T>(\n\ttarget: DeployTarget,\n\tendpoint: string,\n\toptions: { method?: string; body?: unknown } = {},\n): Promise<T> {\n\tconst res = await fetch(apiUrl(target, endpoint), {\n\t\tmethod: options.method ?? \"GET\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"x-api-key\": target.apiKey,\n\t\t},\n\t\tbody: options.body ? JSON.stringify(options.body) : undefined,\n\t});\n\n\tif (!res.ok) {\n\t\tconst text = await res.text().catch(() => \"\");\n\t\tlet detail = text;\n\t\ttry {\n\t\t\tconst json = JSON.parse(text);\n\t\t\tdetail = json.message || json.error || text;\n\t\t} catch {\n\t\t\t// use raw text\n\t\t}\n\t\tthrow new Error(`Dokploy API ${res.status}: ${detail}`);\n\t}\n\n\tconst text = await res.text();\n\tif (!text) return undefined as T;\n\treturn JSON.parse(text) as T;\n}\n\n/**\n * Deploys Docker Compose stacks to a Dokploy instance.\n *\n * Deploy flow (4 steps):\n * 1. Create a Dokploy project\n * 2. Create a compose stack inside the project's default environment\n * 3. Push .env variables to the compose stack\n * 4. Trigger the deployment\n */\nexport class DokployDeployer implements PaasDeployer {\n\treadonly name = \"Dokploy\";\n\treadonly id = \"dokploy\";\n\n\tasync testConnection(target: DeployTarget): Promise<{ ok: boolean; error?: string }> {\n\t\ttry {\n\t\t\tawait dokployFetch<DokployProject[]>(target, \"project.all\");\n\t\t\treturn { ok: true };\n\t\t} catch (err) {\n\t\t\treturn { ok: false, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tasync deploy(input: DeployInput): Promise<DeployResult> {\n\t\tconst steps: DeployStep[] = [\n\t\t\t{ step: \"Create project\", status: \"pending\" },\n\t\t\t{ step: \"Create compose stack\", status: \"pending\" },\n\t\t\t{ step: \"Set environment variables\", status: \"pending\" },\n\t\t\t{ step: \"Trigger deployment\", status: \"pending\" },\n\t\t];\n\n\t\tconst result: DeployResult = { success: false, steps };\n\n\t\ttry {\n\t\t\t// Step 1: Create project\n\t\t\tsteps[0].status = \"running\";\n\t\t\tconst project = await dokployFetch<DokployProject>(input.target, \"project.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tdescription: input.description ?? `OpenClaw stack: ${input.projectName}`,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.projectId = project.projectId;\n\t\t\tsteps[0].status = \"done\";\n\t\t\tsteps[0].detail = `Project ID: ${project.projectId}`;\n\n\t\t\t// Get the default environment ID\n\t\t\tconst projectDetail = await dokployFetch<DokployProject>(\n\t\t\t\tinput.target,\n\t\t\t\t`project.one?projectId=${project.projectId}`,\n\t\t\t);\n\t\t\tconst envId = projectDetail.environments?.[0]?.environmentId;\n\t\t\tif (!envId) {\n\t\t\t\tthrow new Error(\"No default environment found in project\");\n\t\t\t}\n\n\t\t\t// Step 2: Create compose stack\n\t\t\tsteps[1].status = \"running\";\n\t\t\tconst compose = await dokployFetch<DokployCompose>(input.target, \"compose.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tenvironmentId: envId,\n\t\t\t\t\tcomposeFile: input.composeYaml,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.composeId = compose.composeId;\n\t\t\tsteps[1].status = \"done\";\n\t\t\tsteps[1].detail = `Compose ID: ${compose.composeId}`;\n\n\t\t\t// Step 3: Set environment variables\n\t\t\tsteps[2].status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.update\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\tenv: input.envContent,\n\t\t\t\t},\n\t\t\t});\n\t\t\tsteps[2].status = \"done\";\n\n\t\t\t// Step 4: Trigger deployment\n\t\t\tsteps[3].status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.deploy\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\ttitle: `Initial deploy: ${input.projectName}`,\n\t\t\t\t\tdescription: input.description ?? \"Deployed via OpenClaw web builder\",\n\t\t\t\t},\n\t\t\t});\n\t\t\tsteps[3].status = \"done\";\n\n\t\t\tresult.success = true;\n\t\t\tconst base = input.target.instanceUrl.replace(/\\/+$/, \"\");\n\t\t\tresult.dashboardUrl = `${base}/dashboard/project/${project.projectId}`;\n\t\t} catch (err) {\n\t\t\tconst failedIdx = steps.findIndex((s) => s.status === \"running\");\n\t\t\tif (failedIdx >= 0) {\n\t\t\t\tsteps[failedIdx].status = \"error\";\n\t\t\t\tsteps[failedIdx].detail = err instanceof Error ? err.message : String(err);\n\t\t\t}\n\t\t\tresult.error = err instanceof Error ? err.message : String(err);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"],"mappings":";;;;AA0BA,SAAS,OAAO,QAAsB,UAA0B;AAE/D,QAAO,GADM,OAAO,YAAY,QAAQ,QAAQ,GAAG,CACpC,OAAO;;;;;;AAOvB,eAAe,aACd,QACA,UACA,UAA+C,EAAE,EACpC;CACb,MAAM,MAAM,MAAM,MAAM,OAAO,QAAQ,SAAS,EAAE;EACjD,QAAQ,QAAQ,UAAU;EAC1B,SAAS;GACR,gBAAgB;GAChB,aAAa,OAAO;GACpB;EACD,MAAM,QAAQ,OAAO,KAAK,UAAU,QAAQ,KAAK,GAAG;EACpD,CAAC;AAEF,KAAI,CAAC,IAAI,IAAI;EACZ,MAAM,OAAO,MAAM,IAAI,MAAM,CAAC,YAAY,GAAG;EAC7C,IAAI,SAAS;AACb,MAAI;GACH,MAAM,OAAO,KAAK,MAAM,KAAK;AAC7B,YAAS,KAAK,WAAW,KAAK,SAAS;UAChC;AAGR,QAAM,IAAI,MAAM,eAAe,IAAI,OAAO,IAAI,SAAS;;CAGxD,MAAM,OAAO,MAAM,IAAI,MAAM;AAC7B,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO,KAAK,MAAM,KAAK;;;;;;;;;;;AAYxB,IAAa,kBAAb,MAAqD;CACpD,AAAS,OAAO;CAChB,AAAS,KAAK;CAEd,MAAM,eAAe,QAAgE;AACpF,MAAI;AACH,SAAM,aAA+B,QAAQ,cAAc;AAC3D,UAAO,EAAE,IAAI,MAAM;WACX,KAAK;AACb,UAAO;IAAE,IAAI;IAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;IAAE;;;CAI/E,MAAM,OAAO,OAA2C;EACvD,MAAM,QAAsB;GAC3B;IAAE,MAAM;IAAkB,QAAQ;IAAW;GAC7C;IAAE,MAAM;IAAwB,QAAQ;IAAW;GACnD;IAA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qB,QAAQ;WACnD,KAAK;GACb,MAAM,YAAY,MAAM,WAAW,MAAM,EAAE,WAAW,UAAU;AAChE,OAAI,aAAa,GAAG;AACnB,UAAM,WAAW,SAAS;AAC1B,UAAM,WAAW,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAE3E,UAAO,QAAQ,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAGhE,SAAO"}
1
+ {"version":3,"file":"dokploy.cjs","names":[],"sources":["../../src/deployers/dokploy.ts"],"sourcesContent":["/**\n * Dokploy PaaS deployer — deploys Docker Compose stacks via the Dokploy REST API.\n *\n * API docs: https://docs.dokploy.com/docs/api\n * Auth: x-api-key header\n * Endpoints use dot-notation (e.g. /api/project.create, /api/compose.deploy)\n */\n\nimport type { DeployInput, DeployResult, DeployStep, DeployTarget, PaasDeployer } from \"./types.js\";\n\n/** Shape returned by Dokploy's project endpoints. */\ninterface DokployProject {\n\tprojectId: string;\n\tname: string;\n\tdescription: string;\n\tenvironments?: { environmentId: string; name: string }[];\n}\n\n/** Shape returned by Dokploy's compose endpoints. */\ninterface DokployCompose {\n\tcomposeId: string;\n\tname: string;\n\tstatus?: string;\n}\n\n/** Build a full Dokploy API URL from a dot-notation endpoint (e.g. \"project.create\"). */\nfunction apiUrl(target: DeployTarget, endpoint: string): string {\n\tconst base = target.instanceUrl.replace(/\\/+$/, \"\");\n\treturn `${base}/api/${endpoint}`;\n}\n\n/**\n * Typed fetch wrapper for the Dokploy API.\n * Handles JSON serialisation, x-api-key auth, and error extraction.\n */\nasync function dokployFetch<T>(\n\ttarget: DeployTarget,\n\tendpoint: string,\n\toptions: { method?: string; body?: unknown } = {},\n): Promise<T> {\n\tconst res = await fetch(apiUrl(target, endpoint), {\n\t\tmethod: options.method ?? \"GET\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"x-api-key\": target.apiKey,\n\t\t},\n\t\tbody: options.body ? JSON.stringify(options.body) : undefined,\n\t});\n\n\tif (!res.ok) {\n\t\tconst text = await res.text().catch(() => \"\");\n\t\tlet detail = text;\n\t\ttry {\n\t\t\tconst json = JSON.parse(text);\n\t\t\tdetail = json.message || json.error || text;\n\t\t} catch {\n\t\t\t// use raw text\n\t\t}\n\t\tthrow new Error(`Dokploy API ${res.status}: ${detail}`);\n\t}\n\n\tconst text = await res.text();\n\tif (!text) return undefined as T;\n\treturn JSON.parse(text) as T;\n}\n\n/**\n * Deploys Docker Compose stacks to a Dokploy instance.\n *\n * Deploy flow (4 steps):\n * 1. Create a Dokploy project\n * 2. Create a compose stack inside the project's default environment\n * 3. Push .env variables to the compose stack\n * 4. Trigger the deployment\n */\nexport class DokployDeployer implements PaasDeployer {\n\treadonly name = \"Dokploy\";\n\treadonly id = \"dokploy\";\n\n\tasync testConnection(target: DeployTarget): Promise<{ ok: boolean; error?: string }> {\n\t\ttry {\n\t\t\tawait dokployFetch<DokployProject[]>(target, \"project.all\");\n\t\t\treturn { ok: true };\n\t\t} catch (err) {\n\t\t\treturn { ok: false, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tasync deploy(input: DeployInput): Promise<DeployResult> {\n\t\tconst step1: DeployStep = { step: \"Create project\", status: \"pending\" };\n\t\tconst step2: DeployStep = { step: \"Create compose stack\", status: \"pending\" };\n\t\tconst step3: DeployStep = { step: \"Set environment variables\", status: \"pending\" };\n\t\tconst step4: DeployStep = { step: \"Trigger deployment\", status: \"pending\" };\n\t\tconst steps: DeployStep[] = [step1, step2, step3, step4];\n\n\t\tconst result: DeployResult = { success: false, steps };\n\n\t\ttry {\n\t\t\t// Step 1: Create project\n\t\t\tstep1.status = \"running\";\n\t\t\tconst project = await dokployFetch<DokployProject>(input.target, \"project.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tdescription: input.description ?? `OpenClaw stack: ${input.projectName}`,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.projectId = project.projectId;\n\t\t\tstep1.status = \"done\";\n\t\t\tstep1.detail = `Project ID: ${project.projectId}`;\n\n\t\t\t// Get the default environment ID\n\t\t\tconst projectDetail = await dokployFetch<DokployProject>(\n\t\t\t\tinput.target,\n\t\t\t\t`project.one?projectId=${project.projectId}`,\n\t\t\t);\n\t\t\tconst envId = projectDetail.environments?.[0]?.environmentId;\n\t\t\tif (!envId) {\n\t\t\t\tthrow new Error(\"No default environment found in project\");\n\t\t\t}\n\n\t\t\t// Step 2: Create compose stack\n\t\t\tstep2.status = \"running\";\n\t\t\tconst compose = await dokployFetch<DokployCompose>(input.target, \"compose.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tenvironmentId: envId,\n\t\t\t\t\tcomposeFile: input.composeYaml,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.composeId = compose.composeId;\n\t\t\tstep2.status = \"done\";\n\t\t\tstep2.detail = `Compose ID: ${compose.composeId}`;\n\n\t\t\t// Step 3: Set environment variables\n\t\t\tstep3.status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.update\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\tenv: input.envContent,\n\t\t\t\t},\n\t\t\t});\n\t\t\tstep3.status = \"done\";\n\n\t\t\t// Step 4: Trigger deployment\n\t\t\tstep4.status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.deploy\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\ttitle: `Initial deploy: ${input.projectName}`,\n\t\t\t\t\tdescription: input.description ?? \"Deployed via OpenClaw web builder\",\n\t\t\t\t},\n\t\t\t});\n\t\t\tstep4.status = \"done\";\n\n\t\t\tresult.success = true;\n\t\t\tconst base = input.target.instanceUrl.replace(/\\/+$/, \"\");\n\t\t\tresult.dashboardUrl = `${base}/dashboard/project/${project.projectId}`;\n\t\t} catch (err) {\n\t\t\tconst failedStep = steps.find((s) => s.status === \"running\");\n\t\t\tif (failedStep) {\n\t\t\t\tfailedStep.status = \"error\";\n\t\t\t\tfailedStep.detail = err instanceof Error ? err.message : String(err);\n\t\t\t}\n\t\t\tresult.error = err instanceof Error ? err.message : String(err);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"],"mappings":";;;;AA0BA,SAAS,OAAO,QAAsB,UAA0B;AAE/D,QAAO,GADM,OAAO,YAAY,QAAQ,QAAQ,GAAG,CACpC,OAAO;;;;;;AAOvB,eAAe,aACd,QACA,UACA,UAA+C,EAAE,EACpC;CACb,MAAM,MAAM,MAAM,MAAM,OAAO,QAAQ,SAAS,EAAE;EACjD,QAAQ,QAAQ,UAAU;EAC1B,SAAS;GACR,gBAAgB;GAChB,aAAa,OAAO;GACpB;EACD,MAAM,QAAQ,OAAO,KAAK,UAAU,QAAQ,KAAK,GAAG;EACpD,CAAC;AAEF,KAAI,CAAC,IAAI,IAAI;EACZ,MAAM,OAAO,MAAM,IAAI,MAAM,CAAC,YAAY,GAAG;EAC7C,IAAI,SAAS;AACb,MAAI;GACH,MAAM,OAAO,KAAK,MAAM,KAAK;AAC7B,YAAS,KAAK,WAAW,KAAK,SAAS;UAChC;AAGR,QAAM,IAAI,MAAM,eAAe,IAAI,OAAO,IAAI,SAAS;;CAGxD,MAAM,OAAO,MAAM,IAAI,MAAM;AAC7B,KAAI,CAAC,KAAM,QAAO;AAClB,QAAO,KAAK,MAAM,KAAK;;;;;;;;;;;AAYxB,IAAa,kBAAb,MAAqD;CACpD,AAAS,OAAO;CAChB,AAAS,KAAK;CAEd,MAAM,eAAe,QAAgE;AACpF,MAAI;AACH,SAAM,aAA+B,QAAQ,cAAc;AAC3D,UAAO,EAAE,IAAI,MAAM;WACX,KAAK;AACb,UAAO;IAAE,IAAI;IAAO,OAAO,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;IAAE;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C,aAAa,MAAM,eAAe;KAClC;IACD,CAAC;AACF,SAAM,SAAS;AAEf,UAAO,UAAU;AAEjB,UAAO,eAAe,GADT,MAAM,OAAO,YAAY,QAAQ,QAAQ,GAAG,CAC3B,qBAAqB,QAAQ;WACnD,KAAK;GACb,MAAM,aAAa,MAAM,MAAM,MAAM,EAAE,WAAW,UAAU;AAC5D,OAAI,YAAY;AACf,eAAW,SAAS;AACpB,eAAW,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAErE,UAAO,QAAQ,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAGhE,SAAO"}
@@ -53,30 +53,34 @@ var DokployDeployer = class {
53
53
  }
54
54
  }
55
55
  async deploy(input) {
56
+ const step1 = {
57
+ step: "Create project",
58
+ status: "pending"
59
+ };
60
+ const step2 = {
61
+ step: "Create compose stack",
62
+ status: "pending"
63
+ };
64
+ const step3 = {
65
+ step: "Set environment variables",
66
+ status: "pending"
67
+ };
68
+ const step4 = {
69
+ step: "Trigger deployment",
70
+ status: "pending"
71
+ };
56
72
  const steps = [
57
- {
58
- step: "Create project",
59
- status: "pending"
60
- },
61
- {
62
- step: "Create compose stack",
63
- status: "pending"
64
- },
65
- {
66
- step: "Set environment variables",
67
- status: "pending"
68
- },
69
- {
70
- step: "Trigger deployment",
71
- status: "pending"
72
- }
73
+ step1,
74
+ step2,
75
+ step3,
76
+ step4
73
77
  ];
74
78
  const result = {
75
79
  success: false,
76
80
  steps
77
81
  };
78
82
  try {
79
- steps[0].status = "running";
83
+ step1.status = "running";
80
84
  const project = await dokployFetch(input.target, "project.create", {
81
85
  method: "POST",
82
86
  body: {
@@ -85,11 +89,11 @@ var DokployDeployer = class {
85
89
  }
86
90
  });
87
91
  result.projectId = project.projectId;
88
- steps[0].status = "done";
89
- steps[0].detail = `Project ID: ${project.projectId}`;
92
+ step1.status = "done";
93
+ step1.detail = `Project ID: ${project.projectId}`;
90
94
  const envId = (await dokployFetch(input.target, `project.one?projectId=${project.projectId}`)).environments?.[0]?.environmentId;
91
95
  if (!envId) throw new Error("No default environment found in project");
92
- steps[1].status = "running";
96
+ step2.status = "running";
93
97
  const compose = await dokployFetch(input.target, "compose.create", {
94
98
  method: "POST",
95
99
  body: {
@@ -99,9 +103,9 @@ var DokployDeployer = class {
99
103
  }
100
104
  });
101
105
  result.composeId = compose.composeId;
102
- steps[1].status = "done";
103
- steps[1].detail = `Compose ID: ${compose.composeId}`;
104
- steps[2].status = "running";
106
+ step2.status = "done";
107
+ step2.detail = `Compose ID: ${compose.composeId}`;
108
+ step3.status = "running";
105
109
  await dokployFetch(input.target, "compose.update", {
106
110
  method: "POST",
107
111
  body: {
@@ -109,8 +113,8 @@ var DokployDeployer = class {
109
113
  env: input.envContent
110
114
  }
111
115
  });
112
- steps[2].status = "done";
113
- steps[3].status = "running";
116
+ step3.status = "done";
117
+ step4.status = "running";
114
118
  await dokployFetch(input.target, "compose.deploy", {
115
119
  method: "POST",
116
120
  body: {
@@ -119,14 +123,14 @@ var DokployDeployer = class {
119
123
  description: input.description ?? "Deployed via OpenClaw web builder"
120
124
  }
121
125
  });
122
- steps[3].status = "done";
126
+ step4.status = "done";
123
127
  result.success = true;
124
128
  result.dashboardUrl = `${input.target.instanceUrl.replace(/\/+$/, "")}/dashboard/project/${project.projectId}`;
125
129
  } catch (err) {
126
- const failedIdx = steps.findIndex((s) => s.status === "running");
127
- if (failedIdx >= 0) {
128
- steps[failedIdx].status = "error";
129
- steps[failedIdx].detail = err instanceof Error ? err.message : String(err);
130
+ const failedStep = steps.find((s) => s.status === "running");
131
+ if (failedStep) {
132
+ failedStep.status = "error";
133
+ failedStep.detail = err instanceof Error ? err.message : String(err);
130
134
  }
131
135
  result.error = err instanceof Error ? err.message : String(err);
132
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"dokploy.mjs","names":[],"sources":["../../src/deployers/dokploy.ts"],"sourcesContent":["/**\n * Dokploy PaaS deployer — deploys Docker Compose stacks via the Dokploy REST API.\n *\n * API docs: https://docs.dokploy.com/docs/api\n * Auth: x-api-key header\n * Endpoints use dot-notation (e.g. /api/project.create, /api/compose.deploy)\n */\n\nimport type { DeployInput, DeployResult, DeployStep, DeployTarget, PaasDeployer } from \"./types.js\";\n\n/** Shape returned by Dokploy's project endpoints. */\ninterface DokployProject {\n\tprojectId: string;\n\tname: string;\n\tdescription: string;\n\tenvironments?: { environmentId: string; name: string }[];\n}\n\n/** Shape returned by Dokploy's compose endpoints. */\ninterface DokployCompose {\n\tcomposeId: string;\n\tname: string;\n\tstatus?: string;\n}\n\n/** Build a full Dokploy API URL from a dot-notation endpoint (e.g. \"project.create\"). */\nfunction apiUrl(target: DeployTarget, endpoint: string): string {\n\tconst base = target.instanceUrl.replace(/\\/+$/, \"\");\n\treturn `${base}/api/${endpoint}`;\n}\n\n/**\n * Typed fetch wrapper for the Dokploy API.\n * Handles JSON serialisation, x-api-key auth, and error extraction.\n */\nasync function dokployFetch<T>(\n\ttarget: DeployTarget,\n\tendpoint: string,\n\toptions: { method?: string; body?: unknown } = {},\n): Promise<T> {\n\tconst res = await fetch(apiUrl(target, endpoint), {\n\t\tmethod: options.method ?? \"GET\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"x-api-key\": target.apiKey,\n\t\t},\n\t\tbody: options.body ? JSON.stringify(options.body) : undefined,\n\t});\n\n\tif (!res.ok) {\n\t\tconst text = await res.text().catch(() => \"\");\n\t\tlet detail = text;\n\t\ttry {\n\t\t\tconst json = JSON.parse(text);\n\t\t\tdetail = json.message || json.error || text;\n\t\t} catch {\n\t\t\t// use raw text\n\t\t}\n\t\tthrow new Error(`Dokploy API ${res.status}: ${detail}`);\n\t}\n\n\tconst text = await res.text();\n\tif (!text) return undefined as T;\n\treturn JSON.parse(text) as T;\n}\n\n/**\n * Deploys Docker Compose stacks to a Dokploy instance.\n *\n * Deploy flow (4 steps):\n * 1. Create a Dokploy project\n * 2. Create a compose stack inside the project's default environment\n * 3. Push .env variables to the compose stack\n * 4. Trigger the deployment\n */\nexport class DokployDeployer implements PaasDeployer {\n\treadonly name = \"Dokploy\";\n\treadonly id = \"dokploy\";\n\n\tasync testConnection(target: DeployTarget): Promise<{ ok: boolean; error?: string }> {\n\t\ttry {\n\t\t\tawait dokployFetch<DokployProject[]>(target, \"project.all\");\n\t\t\treturn { ok: true };\n\t\t} catch (err) {\n\t\t\treturn { ok: false, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tasync deploy(input: DeployInput): Promise<DeployResult> {\n\t\tconst steps: DeployStep[] = [\n\t\t\t{ step: \"Create project\", status: \"pending\" },\n\t\t\t{ step: \"Create compose stack\", status: \"pending\" },\n\t\t\t{ step: \"Set environment variables\", status: \"pending\" },\n\t\t\t{ step: \"Trigger deployment\", status: \"pending\" },\n\t\t];\n\n\t\tconst result: DeployResult = { success: false, steps };\n\n\t\ttry {\n\t\t\t// Step 1: Create project\n\t\t\tsteps[0].status = \"running\";\n\t\t\tconst project = await dokployFetch<DokployProject>(input.target, \"project.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tdescription: input.description ?? `OpenClaw stack: ${input.projectName}`,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.projectId = project.projectId;\n\t\t\tsteps[0].status = \"done\";\n\t\t\tsteps[0].detail = `Project ID: ${project.projectId}`;\n\n\t\t\t// Get the default environment ID\n\t\t\tconst projectDetail = await dokployFetch<DokployProject>(\n\t\t\t\tinput.target,\n\t\t\t\t`project.one?projectId=${project.projectId}`,\n\t\t\t);\n\t\t\tconst envId = projectDetail.environments?.[0]?.environmentId;\n\t\t\tif (!envId) {\n\t\t\t\tthrow new Error(\"No default environment found in project\");\n\t\t\t}\n\n\t\t\t// Step 2: Create compose stack\n\t\t\tsteps[1].status = \"running\";\n\t\t\tconst compose = await dokployFetch<DokployCompose>(input.target, \"compose.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tenvironmentId: envId,\n\t\t\t\t\tcomposeFile: input.composeYaml,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.composeId = compose.composeId;\n\t\t\tsteps[1].status = \"done\";\n\t\t\tsteps[1].detail = `Compose ID: ${compose.composeId}`;\n\n\t\t\t// Step 3: Set environment variables\n\t\t\tsteps[2].status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.update\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\tenv: input.envContent,\n\t\t\t\t},\n\t\t\t});\n\t\t\tsteps[2].status = \"done\";\n\n\t\t\t// Step 4: Trigger deployment\n\t\t\tsteps[3].status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.deploy\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\ttitle: `Initial deploy: ${input.projectName}`,\n\t\t\t\t\tdescription: input.description ?? \"Deployed via OpenClaw web builder\",\n\t\t\t\t},\n\t\t\t});\n\t\t\tsteps[3].status = \"done\";\n\n\t\t\tresult.success = true;\n\t\t\tconst base = input.target.instanceUrl.replace(/\\/+$/, \"\");\n\t\t\tresult.dashboardUrl = `${base}/dashboard/project/${project.projectId}`;\n\t\t} catch (err) {\n\t\t\tconst failedIdx = steps.findIndex((s) => s.status === \"running\");\n\t\t\tif (failedIdx >= 0) {\n\t\t\t\tsteps[failedIdx].status = \"error\";\n\t\t\t\tsteps[failedIdx].detail = err instanceof Error ? err.message : String(err);\n\t\t\t}\n\t\t\tresult.error = err instanceof Error ? err.message : String(err);\n\t\t}\n\n\t\treturn result;\n\t}\n}\n"],"mappings":";;AA0BA,SAAS,OAAO,QAAsB,UAA0B;AAE/D,QAAO,GADM,OAAO,YAAY,QAAQ,QAAQ,GAAG,CACpC,OAAO;;;;;;AAOvB,eAAe,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E,SAAO"}
1
+ {"version":3,"file":"dokploy.mjs","names":[],"sources":["../../src/deployers/dokploy.ts"],"sourcesContent":["/**\n * Dokploy PaaS deployer — deploys Docker Compose stacks via the Dokploy REST API.\n *\n * API docs: https://docs.dokploy.com/docs/api\n * Auth: x-api-key header\n * Endpoints use dot-notation (e.g. /api/project.create, /api/compose.deploy)\n */\n\nimport type { DeployInput, DeployResult, DeployStep, DeployTarget, PaasDeployer } from \"./types.js\";\n\n/** Shape returned by Dokploy's project endpoints. */\ninterface DokployProject {\n\tprojectId: string;\n\tname: string;\n\tdescription: string;\n\tenvironments?: { environmentId: string; name: string }[];\n}\n\n/** Shape returned by Dokploy's compose endpoints. */\ninterface DokployCompose {\n\tcomposeId: string;\n\tname: string;\n\tstatus?: string;\n}\n\n/** Build a full Dokploy API URL from a dot-notation endpoint (e.g. \"project.create\"). */\nfunction apiUrl(target: DeployTarget, endpoint: string): string {\n\tconst base = target.instanceUrl.replace(/\\/+$/, \"\");\n\treturn `${base}/api/${endpoint}`;\n}\n\n/**\n * Typed fetch wrapper for the Dokploy API.\n * Handles JSON serialisation, x-api-key auth, and error extraction.\n */\nasync function dokployFetch<T>(\n\ttarget: DeployTarget,\n\tendpoint: string,\n\toptions: { method?: string; body?: unknown } = {},\n): Promise<T> {\n\tconst res = await fetch(apiUrl(target, endpoint), {\n\t\tmethod: options.method ?? \"GET\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"x-api-key\": target.apiKey,\n\t\t},\n\t\tbody: options.body ? JSON.stringify(options.body) : undefined,\n\t});\n\n\tif (!res.ok) {\n\t\tconst text = await res.text().catch(() => \"\");\n\t\tlet detail = text;\n\t\ttry {\n\t\t\tconst json = JSON.parse(text);\n\t\t\tdetail = json.message || json.error || text;\n\t\t} catch {\n\t\t\t// use raw text\n\t\t}\n\t\tthrow new Error(`Dokploy API ${res.status}: ${detail}`);\n\t}\n\n\tconst text = await res.text();\n\tif (!text) return undefined as T;\n\treturn JSON.parse(text) as T;\n}\n\n/**\n * Deploys Docker Compose stacks to a Dokploy instance.\n *\n * Deploy flow (4 steps):\n * 1. Create a Dokploy project\n * 2. Create a compose stack inside the project's default environment\n * 3. Push .env variables to the compose stack\n * 4. Trigger the deployment\n */\nexport class DokployDeployer implements PaasDeployer {\n\treadonly name = \"Dokploy\";\n\treadonly id = \"dokploy\";\n\n\tasync testConnection(target: DeployTarget): Promise<{ ok: boolean; error?: string }> {\n\t\ttry {\n\t\t\tawait dokployFetch<DokployProject[]>(target, \"project.all\");\n\t\t\treturn { ok: true };\n\t\t} catch (err) {\n\t\t\treturn { ok: false, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tasync deploy(input: DeployInput): Promise<DeployResult> {\n\t\tconst step1: DeployStep = { step: \"Create project\", status: \"pending\" };\n\t\tconst step2: DeployStep = { step: \"Create compose stack\", status: \"pending\" };\n\t\tconst step3: DeployStep = { step: \"Set environment variables\", status: \"pending\" };\n\t\tconst step4: DeployStep = { step: \"Trigger deployment\", status: \"pending\" };\n\t\tconst steps: DeployStep[] = [step1, step2, step3, step4];\n\n\t\tconst result: DeployResult = { success: false, steps };\n\n\t\ttry {\n\t\t\t// Step 1: Create project\n\t\t\tstep1.status = \"running\";\n\t\t\tconst project = await dokployFetch<DokployProject>(input.target, \"project.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tdescription: input.description ?? `OpenClaw stack: ${input.projectName}`,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.projectId = project.projectId;\n\t\t\tstep1.status = \"done\";\n\t\t\tstep1.detail = `Project ID: ${project.projectId}`;\n\n\t\t\t// Get the default environment ID\n\t\t\tconst projectDetail = await dokployFetch<DokployProject>(\n\t\t\t\tinput.target,\n\t\t\t\t`project.one?projectId=${project.projectId}`,\n\t\t\t);\n\t\t\tconst envId = projectDetail.environments?.[0]?.environmentId;\n\t\t\tif (!envId) {\n\t\t\t\tthrow new Error(\"No default environment found in project\");\n\t\t\t}\n\n\t\t\t// Step 2: Create compose stack\n\t\t\tstep2.status = \"running\";\n\t\t\tconst compose = await dokployFetch<DokployCompose>(input.target, \"compose.create\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tname: input.projectName,\n\t\t\t\t\tenvironmentId: envId,\n\t\t\t\t\tcomposeFile: input.composeYaml,\n\t\t\t\t},\n\t\t\t});\n\t\t\tresult.composeId = compose.composeId;\n\t\t\tstep2.status = \"done\";\n\t\t\tstep2.detail = `Compose ID: ${compose.composeId}`;\n\n\t\t\t// Step 3: Set environment variables\n\t\t\tstep3.status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.update\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\tenv: input.envContent,\n\t\t\t\t},\n\t\t\t});\n\t\t\tstep3.status = \"done\";\n\n\t\t\t// Step 4: Trigger deployment\n\t\t\tstep4.status = \"running\";\n\t\t\tawait dokployFetch(input.target, \"compose.deploy\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tbody: {\n\t\t\t\t\tcomposeId: compose.composeId,\n\t\t\t\t\ttitle: `Initial deploy: ${input.projectName}`,\n\t\t\t\t\tdescription: input.description ?? \"Deployed via OpenClaw web builder\",\n\t\t\t\t},\n\t\t\t});\n\t\t\tstep4.status = \"done\";\n\n\t\t\tresult.success = true;\n\t\t\tconst base = input.target.instanceUrl.replace(/\\/+$/, \"\");\n\t\t\tresult.dashboardUrl = `${base}/dashboard/project/${project.projectId}`;\n\t\t} catch (err) {\n\t\t\tconst failedStep = steps.find((s) => s.status === \"running\");\n\t\t\tif (failedStep) {\n\t\t\t\tfailedStep.status = \"error\";\n\t\t\t\tfailedStep.detail = err instanceof Error ? err.message : String(err);\n\t\t\t}\n\t\t\tresult.error = err instanceof Error ? err.message : String(err);\n\t\t}\n\n\t\treturn result;\n\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AAS;AACpB,eAAW,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAErE,UAAO,QAAQ,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;;AAGhE,SAAO"}
@@ -40,7 +40,7 @@ async function isPortAvailable(port) {
40
40
  })) return false;
41
41
  return await new Promise((resolve) => {
42
42
  const server = net.createServer();
43
- server.once("error", (err) => {
43
+ server.once("error", (_err) => {
44
44
  resolve(false);
45
45
  });
46
46
  server.listen(port, "0.0.0.0", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"port-scanner.cjs","names":[],"sources":["../src/port-scanner.ts"],"sourcesContent":["import type { ServiceDefinition } from \"./types.js\";\n\n/**\n * Scans system for ports in use and suggests alternatives for conflicts\n */\nexport interface PortConflict {\n\tport: number;\n\tserviceId: string;\n\tdescription: string;\n\tsuggestedPort: number;\n}\n\n/**\n * Check if a port is available using a two-phase approach:\n * 1. TCP connect — detects if something is already listening\n * 2. Bind check — detects OS-reserved/excluded port ranges (e.g. Hyper-V on Windows)\n *\n * The connect-only approach misses Windows excluded port ranges because\n * ECONNREFUSED (nothing listening) looks the same as \"available\" even though\n * Docker's bind() will fail on those reserved ranges.\n */\nasync function isPortAvailable(port: number): Promise<boolean> {\n\ttry {\n\t\tconst net = await import(\"node:net\");\n\n\t\t// Phase 1: TCP connect check — is something actively listening?\n\t\tconst isListening = await new Promise<boolean>((resolve) => {\n\t\t\tconst socket = new net.Socket();\n\t\t\tlet resolved = false;\n\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tsocket.removeAllListeners();\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsocket.once(\"connect\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(true);\n\t\t\t});\n\n\t\t\tsocket.once(\"error\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.setTimeout(500);\n\t\t\tsocket.once(\"timeout\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.connect(port, \"127.0.0.1\");\n\t\t});\n\n\t\tif (isListening) return false; // Port is in use\n\n\t\t// Phase 2: Bind check — catches OS-reserved/excluded port ranges\n\t\t// On Windows, Hyper-V/WSL reserve dynamic port ranges that TCP connect\n\t\t// cannot detect. Attempting to bind reveals these reservations.\n\t\tconst canBind = await new Promise<boolean>((resolve) => {\n\t\t\tconst server = net.createServer();\n\n\t\t\tserver.once(\"error\", (err: NodeJS.ErrnoException) => {\n\t\t\t\t// EACCES / EADDRINUSE / EPERM = port is reserved or in use\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tserver.listen(port, \"0.0.0.0\", () => {\n\t\t\t\t// Successfully bound — port is truly available\n\t\t\t\tserver.close(() => resolve(true));\n\t\t\t});\n\t\t});\n\n\t\treturn canBind;\n\t} catch (error) {\n\t\tconsole.warn(`Port scanner error for port ${port}:`, error);\n\t\treturn true; // Failsafe: assume available\n\t}\n}\n\n/**\n * Find next available port starting from a base port.\n * Also skips ports already claimed by other services in this generation.\n */\nasync function findNextAvailablePort(\n\tstartPort: number,\n\tclaimedPorts: Set<number>,\n\tmaxAttempts = 100,\n): Promise<number> {\n\tfor (let i = 0; i < maxAttempts; i++) {\n\t\tconst port = startPort + i;\n\t\tif (port > 65535) break;\n\t\tif (claimedPorts.has(port)) continue;\n\t\tif (await isPortAvailable(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n\t// Fallback: return a high random port\n\treturn 50000 + Math.floor(Math.random() * 10000);\n}\n\n/**\n * Scan for port conflicts and suggest alternatives.\n *\n * Detects two types of conflicts:\n * 1. Host conflicts — port is already in use or reserved by the OS\n * 2. Inter-service conflicts — multiple selected services claim the same host port\n */\nexport async function scanPortConflicts(\n\tservices: ServiceDefinition[],\n): Promise<Map<string, Map<number, number>>> {\n\tconst portReassignments = new Map<string, Map<number, number>>();\n\n\t// Track which host ports are already claimed by services in this stack.\n\t// First service to claim a port wins; subsequent services get reassigned.\n\tconst claimedPorts = new Map<number, string>(); // port → serviceId that claimed it\n\n\tfor (const service of services) {\n\t\tif (!service.ports || service.ports.length === 0) continue;\n\n\t\tconst serviceReassignments = new Map<number, number>();\n\n\t\tfor (const portDef of service.ports) {\n\t\t\tif (!portDef.exposed) continue;\n\n\t\t\tconst port = portDef.host;\n\n\t\t\t// Check inter-service conflict first\n\t\t\tconst claimedBy = claimedPorts.get(port);\n\t\t\tif (claimedBy && claimedBy !== service.id) {\n\t\t\t\t// Another service already claimed this port — must reassign\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check host availability (TCP connect + bind check)\n\t\t\tconst isAvailable = await isPortAvailable(port);\n\n\t\t\tif (!isAvailable) {\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t} else {\n\t\t\t\t// Port is available and not claimed — claim it\n\t\t\t\tclaimedPorts.set(port, service.id);\n\t\t\t}\n\t\t}\n\n\t\tif (serviceReassignments.size > 0) {\n\t\t\tportReassignments.set(service.id, serviceReassignments);\n\t\t}\n\t}\n\n\treturn portReassignments;\n}\n\n/**\n * Get conflicts in a user-friendly format\n */\nexport function formatPortConflicts(\n\tservices: ServiceDefinition[],\n\treassignments: Map<string, Map<number, number>>,\n): PortConflict[] {\n\tconst conflicts: PortConflict[] = [];\n\n\tfor (const service of services) {\n\t\tconst serviceReassignments = reassignments.get(service.id);\n\t\tif (!serviceReassignments) continue;\n\n\t\tfor (const portDef of service.ports || []) {\n\t\t\tconst newPort = serviceReassignments.get(portDef.host);\n\t\t\tif (newPort) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tport: portDef.host,\n\t\t\t\t\tserviceId: service.id,\n\t\t\t\t\tdescription: portDef.description || `${service.name} port`,\n\t\t\t\t\tsuggestedPort: newPort,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn conflicts;\n}\n"],"mappings":";;;;;;;;;;;;AAqBA,eAAe,gBAAgB,MAAgC;AAC9D,KAAI;EACH,MAAM,MAAM,MAAM,OAAO;AAkCzB,MA/BoB,MAAM,IAAI,SAAkB,YAAY;GAC3D,MAAM,SAAS,IAAI,IAAI,QAAQ;GAC/B,IAAI,WAAW;GAEf,MAAM,gBAAgB;AACrB,QAAI,CAAC,UAAU;AACd,gBAAW;AACX,YAAO,oBAAoB;AAC3B,YAAO,SAAS;;;AAIlB,UAAO,KAAK,iBAAiB;AAC5B,aAAS;AACT,YAAQ,KAAK;KACZ;AAEF,UAAO,KAAK,eAAe;AAC1B,aAAS;AACT,YAAQ,MAAM;KACb;AAEF,UAAO,WAAW,IAAI;AACtB,UAAO,KAAK,iBAAiB;AAC5B,aAAS;AACT,YAAQ,MAAM;KACb;AAEF,UAAO,QAAQ,MAAM,YAAY;IAChC,CAEe,QAAO;AAmBxB,SAdgB,MAAM,IAAI,SAAkB,YAAY;GACvD,MAAM,SAAS,IAAI,cAAc;AAEjC,UAAO,KAAK,UAAU,QAA+B;AAEpD,YAAQ,MAAM;KACb;AAEF,UAAO,OAAO,MAAM,iBAAiB;AAEpC,WAAO,YAAY,QAAQ,KAAK,CAAC;KAChC;IACD;UAGM,OAAO;AACf,UAAQ,KAAK,+BAA+B,KAAK,IAAI,MAAM;AAC3D,SAAO;;;;;;;AAQT,eAAe,sBACd,WACA,cACA,cAAc,KACI;AAClB,MAAK,IAAI,IAAI,GAAG,IAAI,aAAa,KAAK;EACrC,MAAM,OAAO,YAAY;AACzB,MAAI,OAAO,MAAO;AAClB,MAAI,aAAa,IAAI,KAAK,CAAE;AAC5B,MAAI,MAAM,gBAAg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tD,OAAI,QACH,WAAU,KAAK;IACd,MAAM,QAAQ;IACd,WAAW,QAAQ;IACnB,aAAa,QAAQ,eAAe,GAAG,QAAQ,KAAK;IACpD,eAAe;IACf,CAAC;;;AAKL,QAAO"}
1
+ {"version":3,"file":"port-scanner.cjs","names":[],"sources":["../src/port-scanner.ts"],"sourcesContent":["import type { ServiceDefinition } from \"./types.js\";\n\n/**\n * Scans system for ports in use and suggests alternatives for conflicts\n */\nexport interface PortConflict {\n\tport: number;\n\tserviceId: string;\n\tdescription: string;\n\tsuggestedPort: number;\n}\n\n/**\n * Check if a port is available using a two-phase approach:\n * 1. TCP connect — detects if something is already listening\n * 2. Bind check — detects OS-reserved/excluded port ranges (e.g. Hyper-V on Windows)\n *\n * The connect-only approach misses Windows excluded port ranges because\n * ECONNREFUSED (nothing listening) looks the same as \"available\" even though\n * Docker's bind() will fail on those reserved ranges.\n */\nasync function isPortAvailable(port: number): Promise<boolean> {\n\ttry {\n\t\tconst net = await import(\"node:net\");\n\n\t\t// Phase 1: TCP connect check — is something actively listening?\n\t\tconst isListening = await new Promise<boolean>((resolve) => {\n\t\t\tconst socket = new net.Socket();\n\t\t\tlet resolved = false;\n\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tsocket.removeAllListeners();\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsocket.once(\"connect\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(true);\n\t\t\t});\n\n\t\t\tsocket.once(\"error\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.setTimeout(500);\n\t\t\tsocket.once(\"timeout\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.connect(port, \"127.0.0.1\");\n\t\t});\n\n\t\tif (isListening) return false; // Port is in use\n\n\t\t// Phase 2: Bind check — catches OS-reserved/excluded port ranges\n\t\t// On Windows, Hyper-V/WSL reserve dynamic port ranges that TCP connect\n\t\t// cannot detect. Attempting to bind reveals these reservations.\n\t\tconst canBind = await new Promise<boolean>((resolve) => {\n\t\t\tconst server = net.createServer();\n\n\t\t\tserver.once(\"error\", (_err: NodeJS.ErrnoException) => {\n\t\t\t\t// EACCES / EADDRINUSE / EPERM = port is reserved or in use\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tserver.listen(port, \"0.0.0.0\", () => {\n\t\t\t\t// Successfully bound — port is truly available\n\t\t\t\tserver.close(() => resolve(true));\n\t\t\t});\n\t\t});\n\n\t\treturn canBind;\n\t} catch (error) {\n\t\tconsole.warn(`Port scanner error for port ${port}:`, error);\n\t\treturn true; // Failsafe: assume available\n\t}\n}\n\n/**\n * Find next available port starting from a base port.\n * Also skips ports already claimed by other services in this generation.\n */\nasync function findNextAvailablePort(\n\tstartPort: number,\n\tclaimedPorts: Set<number>,\n\tmaxAttempts = 100,\n): Promise<number> {\n\tfor (let i = 0; i < maxAttempts; i++) {\n\t\tconst port = startPort + i;\n\t\tif (port > 65535) break;\n\t\tif (claimedPorts.has(port)) continue;\n\t\tif (await isPortAvailable(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n\t// Fallback: return a high random port\n\treturn 50000 + Math.floor(Math.random() * 10000);\n}\n\n/**\n * Scan for port conflicts and suggest alternatives.\n *\n * Detects two types of conflicts:\n * 1. Host conflicts — port is already in use or reserved by the OS\n * 2. Inter-service conflicts — multiple selected services claim the same host port\n */\nexport async function scanPortConflicts(\n\tservices: ServiceDefinition[],\n): Promise<Map<string, Map<number, number>>> {\n\tconst portReassignments = new Map<string, Map<number, number>>();\n\n\t// Track which host ports are already claimed by services in this stack.\n\t// First service to claim a port wins; subsequent services get reassigned.\n\tconst claimedPorts = new Map<number, string>(); // port → serviceId that claimed it\n\n\tfor (const service of services) {\n\t\tif (!service.ports || service.ports.length === 0) continue;\n\n\t\tconst serviceReassignments = new Map<number, number>();\n\n\t\tfor (const portDef of service.ports) {\n\t\t\tif (!portDef.exposed) continue;\n\n\t\t\tconst port = portDef.host;\n\n\t\t\t// Check inter-service conflict first\n\t\t\tconst claimedBy = claimedPorts.get(port);\n\t\t\tif (claimedBy && claimedBy !== service.id) {\n\t\t\t\t// Another service already claimed this port — must reassign\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check host availability (TCP connect + bind check)\n\t\t\tconst isAvailable = await isPortAvailable(port);\n\n\t\t\tif (!isAvailable) {\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t} else {\n\t\t\t\t// Port is available and not claimed — claim it\n\t\t\t\tclaimedPorts.set(port, service.id);\n\t\t\t}\n\t\t}\n\n\t\tif (serviceReassignments.size > 0) {\n\t\t\tportReassignments.set(service.id, serviceReassignments);\n\t\t}\n\t}\n\n\treturn portReassignments;\n}\n\n/**\n * Get conflicts in a user-friendly format\n */\nexport function formatPortConflicts(\n\tservices: ServiceDefinition[],\n\treassignments: Map<string, Map<number, number>>,\n): PortConflict[] {\n\tconst conflicts: PortConflict[] = [];\n\n\tfor (const service of services) {\n\t\tconst serviceReassignments = reassignments.get(service.id);\n\t\tif (!serviceReassignments) continue;\n\n\t\tfor (const portDef of service.ports || []) {\n\t\t\tconst newPort = serviceReassignments.get(portDef.host);\n\t\t\tif (newPort) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tport: portDef.host,\n\t\t\t\t\tserviceId: service.id,\n\t\t\t\t\tdescription: portDef.description || `${service.name} port`,\n\t\t\t\t\tsuggestedPort: newPort,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\tre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38
38
  })) return false;
39
39
  return await new Promise((resolve) => {
40
40
  const server = net.createServer();
41
- server.once("error", (err) => {
41
+ server.once("error", (_err) => {
42
42
  resolve(false);
43
43
  });
44
44
  server.listen(port, "0.0.0.0", () => {
@@ -1 +1 @@
1
- {"version":3,"file":"port-scanner.mjs","names":[],"sources":["../src/port-scanner.ts"],"sourcesContent":["import type { ServiceDefinition } from \"./types.js\";\n\n/**\n * Scans system for ports in use and suggests alternatives for conflicts\n */\nexport interface PortConflict {\n\tport: number;\n\tserviceId: string;\n\tdescription: string;\n\tsuggestedPort: number;\n}\n\n/**\n * Check if a port is available using a two-phase approach:\n * 1. TCP connect — detects if something is already listening\n * 2. Bind check — detects OS-reserved/excluded port ranges (e.g. Hyper-V on Windows)\n *\n * The connect-only approach misses Windows excluded port ranges because\n * ECONNREFUSED (nothing listening) looks the same as \"available\" even though\n * Docker's bind() will fail on those reserved ranges.\n */\nasync function isPortAvailable(port: number): Promise<boolean> {\n\ttry {\n\t\tconst net = await import(\"node:net\");\n\n\t\t// Phase 1: TCP connect check — is something actively listening?\n\t\tconst isListening = await new Promise<boolean>((resolve) => {\n\t\t\tconst socket = new net.Socket();\n\t\t\tlet resolved = false;\n\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tsocket.removeAllListeners();\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsocket.once(\"connect\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(true);\n\t\t\t});\n\n\t\t\tsocket.once(\"error\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.setTimeout(500);\n\t\t\tsocket.once(\"timeout\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.connect(port, \"127.0.0.1\");\n\t\t});\n\n\t\tif (isListening) return false; // Port is in use\n\n\t\t// Phase 2: Bind check — catches OS-reserved/excluded port ranges\n\t\t// On Windows, Hyper-V/WSL reserve dynamic port ranges that TCP connect\n\t\t// cannot detect. Attempting to bind reveals these reservations.\n\t\tconst canBind = await new Promise<boolean>((resolve) => {\n\t\t\tconst server = net.createServer();\n\n\t\t\tserver.once(\"error\", (err: NodeJS.ErrnoException) => {\n\t\t\t\t// EACCES / EADDRINUSE / EPERM = port is reserved or in use\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tserver.listen(port, \"0.0.0.0\", () => {\n\t\t\t\t// Successfully bound — port is truly available\n\t\t\t\tserver.close(() => resolve(true));\n\t\t\t});\n\t\t});\n\n\t\treturn canBind;\n\t} catch (error) {\n\t\tconsole.warn(`Port scanner error for port ${port}:`, error);\n\t\treturn true; // Failsafe: assume available\n\t}\n}\n\n/**\n * Find next available port starting from a base port.\n * Also skips ports already claimed by other services in this generation.\n */\nasync function findNextAvailablePort(\n\tstartPort: number,\n\tclaimedPorts: Set<number>,\n\tmaxAttempts = 100,\n): Promise<number> {\n\tfor (let i = 0; i < maxAttempts; i++) {\n\t\tconst port = startPort + i;\n\t\tif (port > 65535) break;\n\t\tif (claimedPorts.has(port)) continue;\n\t\tif (await isPortAvailable(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n\t// Fallback: return a high random port\n\treturn 50000 + Math.floor(Math.random() * 10000);\n}\n\n/**\n * Scan for port conflicts and suggest alternatives.\n *\n * Detects two types of conflicts:\n * 1. Host conflicts — port is already in use or reserved by the OS\n * 2. Inter-service conflicts — multiple selected services claim the same host port\n */\nexport async function scanPortConflicts(\n\tservices: ServiceDefinition[],\n): Promise<Map<string, Map<number, number>>> {\n\tconst portReassignments = new Map<string, Map<number, number>>();\n\n\t// Track which host ports are already claimed by services in this stack.\n\t// First service to claim a port wins; subsequent services get reassigned.\n\tconst claimedPorts = new Map<number, string>(); // port → serviceId that claimed it\n\n\tfor (const service of services) {\n\t\tif (!service.ports || service.ports.length === 0) continue;\n\n\t\tconst serviceReassignments = new Map<number, number>();\n\n\t\tfor (const portDef of service.ports) {\n\t\t\tif (!portDef.exposed) continue;\n\n\t\t\tconst port = portDef.host;\n\n\t\t\t// Check inter-service conflict first\n\t\t\tconst claimedBy = claimedPorts.get(port);\n\t\t\tif (claimedBy && claimedBy !== service.id) {\n\t\t\t\t// Another service already claimed this port — must reassign\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check host availability (TCP connect + bind check)\n\t\t\tconst isAvailable = await isPortAvailable(port);\n\n\t\t\tif (!isAvailable) {\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t} else {\n\t\t\t\t// Port is available and not claimed — claim it\n\t\t\t\tclaimedPorts.set(port, service.id);\n\t\t\t}\n\t\t}\n\n\t\tif (serviceReassignments.size > 0) {\n\t\t\tportReassignments.set(service.id, serviceReassignments);\n\t\t}\n\t}\n\n\treturn portReassignments;\n}\n\n/**\n * Get conflicts in a user-friendly format\n */\nexport function formatPortConflicts(\n\tservices: ServiceDefinition[],\n\treassignments: Map<string, Map<number, number>>,\n): PortConflict[] {\n\tconst conflicts: PortConflict[] = [];\n\n\tfor (const service of services) {\n\t\tconst serviceReassignments = reassignments.get(service.id);\n\t\tif (!serviceReassignments) continue;\n\n\t\tfor (const portDef of service.ports || []) {\n\t\t\tconst newPort = serviceReassignments.get(portDef.host);\n\t\t\tif (newPort) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tport: portDef.host,\n\t\t\t\t\tserviceId: service.id,\n\t\t\t\t\tdescription: portDef.description || `${service.name} port`,\n\t\t\t\t\tsuggestedPort: newPort,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n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s","names":[],"sources":["../src/port-scanner.ts"],"sourcesContent":["import type { ServiceDefinition } from \"./types.js\";\n\n/**\n * Scans system for ports in use and suggests alternatives for conflicts\n */\nexport interface PortConflict {\n\tport: number;\n\tserviceId: string;\n\tdescription: string;\n\tsuggestedPort: number;\n}\n\n/**\n * Check if a port is available using a two-phase approach:\n * 1. TCP connect — detects if something is already listening\n * 2. Bind check — detects OS-reserved/excluded port ranges (e.g. Hyper-V on Windows)\n *\n * The connect-only approach misses Windows excluded port ranges because\n * ECONNREFUSED (nothing listening) looks the same as \"available\" even though\n * Docker's bind() will fail on those reserved ranges.\n */\nasync function isPortAvailable(port: number): Promise<boolean> {\n\ttry {\n\t\tconst net = await import(\"node:net\");\n\n\t\t// Phase 1: TCP connect check — is something actively listening?\n\t\tconst isListening = await new Promise<boolean>((resolve) => {\n\t\t\tconst socket = new net.Socket();\n\t\t\tlet resolved = false;\n\n\t\t\tconst cleanup = () => {\n\t\t\t\tif (!resolved) {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tsocket.removeAllListeners();\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsocket.once(\"connect\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(true);\n\t\t\t});\n\n\t\t\tsocket.once(\"error\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.setTimeout(500);\n\t\t\tsocket.once(\"timeout\", () => {\n\t\t\t\tcleanup();\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tsocket.connect(port, \"127.0.0.1\");\n\t\t});\n\n\t\tif (isListening) return false; // Port is in use\n\n\t\t// Phase 2: Bind check — catches OS-reserved/excluded port ranges\n\t\t// On Windows, Hyper-V/WSL reserve dynamic port ranges that TCP connect\n\t\t// cannot detect. Attempting to bind reveals these reservations.\n\t\tconst canBind = await new Promise<boolean>((resolve) => {\n\t\t\tconst server = net.createServer();\n\n\t\t\tserver.once(\"error\", (_err: NodeJS.ErrnoException) => {\n\t\t\t\t// EACCES / EADDRINUSE / EPERM = port is reserved or in use\n\t\t\t\tresolve(false);\n\t\t\t});\n\n\t\t\tserver.listen(port, \"0.0.0.0\", () => {\n\t\t\t\t// Successfully bound — port is truly available\n\t\t\t\tserver.close(() => resolve(true));\n\t\t\t});\n\t\t});\n\n\t\treturn canBind;\n\t} catch (error) {\n\t\tconsole.warn(`Port scanner error for port ${port}:`, error);\n\t\treturn true; // Failsafe: assume available\n\t}\n}\n\n/**\n * Find next available port starting from a base port.\n * Also skips ports already claimed by other services in this generation.\n */\nasync function findNextAvailablePort(\n\tstartPort: number,\n\tclaimedPorts: Set<number>,\n\tmaxAttempts = 100,\n): Promise<number> {\n\tfor (let i = 0; i < maxAttempts; i++) {\n\t\tconst port = startPort + i;\n\t\tif (port > 65535) break;\n\t\tif (claimedPorts.has(port)) continue;\n\t\tif (await isPortAvailable(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n\t// Fallback: return a high random port\n\treturn 50000 + Math.floor(Math.random() * 10000);\n}\n\n/**\n * Scan for port conflicts and suggest alternatives.\n *\n * Detects two types of conflicts:\n * 1. Host conflicts — port is already in use or reserved by the OS\n * 2. Inter-service conflicts — multiple selected services claim the same host port\n */\nexport async function scanPortConflicts(\n\tservices: ServiceDefinition[],\n): Promise<Map<string, Map<number, number>>> {\n\tconst portReassignments = new Map<string, Map<number, number>>();\n\n\t// Track which host ports are already claimed by services in this stack.\n\t// First service to claim a port wins; subsequent services get reassigned.\n\tconst claimedPorts = new Map<number, string>(); // port → serviceId that claimed it\n\n\tfor (const service of services) {\n\t\tif (!service.ports || service.ports.length === 0) continue;\n\n\t\tconst serviceReassignments = new Map<number, number>();\n\n\t\tfor (const portDef of service.ports) {\n\t\t\tif (!portDef.exposed) continue;\n\n\t\t\tconst port = portDef.host;\n\n\t\t\t// Check inter-service conflict first\n\t\t\tconst claimedBy = claimedPorts.get(port);\n\t\t\tif (claimedBy && claimedBy !== service.id) {\n\t\t\t\t// Another service already claimed this port — must reassign\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Check host availability (TCP connect + bind check)\n\t\t\tconst isAvailable = await isPortAvailable(port);\n\n\t\t\tif (!isAvailable) {\n\t\t\t\tconst newPort = await findNextAvailablePort(port + 1000, new Set(claimedPorts.keys()));\n\t\t\t\tserviceReassignments.set(port, newPort);\n\t\t\t\tclaimedPorts.set(newPort, service.id);\n\t\t\t} else {\n\t\t\t\t// Port is available and not claimed — claim it\n\t\t\t\tclaimedPorts.set(port, service.id);\n\t\t\t}\n\t\t}\n\n\t\tif (serviceReassignments.size > 0) {\n\t\t\tportReassignments.set(service.id, serviceReassignments);\n\t\t}\n\t}\n\n\treturn portReassignments;\n}\n\n/**\n * Get conflicts in a user-friendly format\n */\nexport function formatPortConflicts(\n\tservices: ServiceDefinition[],\n\treassignments: Map<string, Map<number, number>>,\n): PortConflict[] {\n\tconst conflicts: PortConflict[] = [];\n\n\tfor (const service of services) {\n\t\tconst serviceReassignments = reassignments.get(service.id);\n\t\tif (!serviceReassignments) continue;\n\n\t\tfor (const portDef of service.ports || []) {\n\t\t\tconst newPort = serviceReassignments.get(portDef.host);\n\t\t\tif (newPort) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tport: portDef.host,\n\t\t\t\t\tserviceId: service.id,\n\t\t\t\t\tdescription: portDef.description || `${service.name} port`,\n\t\t\t\t\tsuggestedPort: newPort,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\treturn conflicts;\n}\n"],"mappings":";;;;;;;;;;AAqBA,eAAe,gBAAgB,MAAgC;AAC9D,KAAI;EACH,MAAM,MAAM,MAAM,OAAO;AAkCzB,MA/BoB,MAAM,IAAI,SAAkB,YAAY;GAC3D,MAAM,SAAS,IAAI,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,CAAC,QAAQ,QAAS;GAEtB,MAAM,OAAO,QAAQ;GAGrB,MAAM,YAAY,aAAa,IAAI,KAAK;AACxC,OAAI,aAAa,cAAc,QAAQ,IAAI;IAE1C,MAAM,UAAU,MAAM,sBAAsB,OAAO,KAAM,IAAI,IAAI,aAAa,MAAM,CAAC,CAAC;AACtF,yBAAqB,IAAI,MAAM,QAAQ;AACvC,iBAAa,IAAI,SAAS,QAAQ,GAAG;AACrC;;AAMD,OAAI,CAFgB,MAAM,gBAAgB,KAAK,EAE7B;IACjB,MAAM,UAAU,MAAM,sBAAsB,OAAO,KAAM,IAAI,IAAI,aAAa,MAAM,CAAC,CAAC;AACtF,yBAAqB,IAAI,MAAM,QAAQ;AACvC,iBAAa,IAAI,SAAS,QAAQ,GAAG;SAGrC,cAAa,IAAI,MAAM,QAAQ,GAAG;;AAIpC,MAAI,qBAAqB,OAAO,EAC/B,mBAAkB,IAAI,QAAQ,IAAI,qBAAqB;;AAIzD,QAAO;;;;;AAMR,SAAgB,oBACf,UACA,eACiB;CACjB,MAAM,YAA4B,EAAE;AAEpC,MAAK,MAAM,WAAW,UAAU;EAC/B,MAAM,uBAAuB,cAAc,IAAI,QAAQ,GAAG;AAC1D,MAAI,CAAC,qBAAsB;AAE3B,OAAK,MAAM,WAAW,QAAQ,SAAS,EAAE,EAAE;GAC1C,MAAM,UAAU,qBAAqB,IAAI,QAAQ,KAAK;AACtD,OAAI,QACH,WAAU,KAAK;IACd,MAAM,QAAQ;IACd,WAAW,QAAQ;IACnB,aAAa,QAAQ,eAAe,GAAG,QAAQ,KAAK;IACpD,eAAe;IACf,CAAC;;;AAKL,QAAO"}
@@ -33,28 +33,28 @@ const usesendDefinition = {
33
33
  },
34
34
  {
35
35
  key: "AWS_ACCESS_KEY",
36
- defaultValue: "",
36
+ defaultValue: "your-aws-access-key",
37
37
  secret: true,
38
38
  description: "AWS access key for SES/SNS",
39
39
  required: true
40
40
  },
41
41
  {
42
42
  key: "AWS_SECRET_KEY",
43
- defaultValue: "",
43
+ defaultValue: "your-aws-secret-key",
44
44
  secret: true,
45
45
  description: "AWS secret key for SES/SNS",
46
46
  required: true
47
47
  },
48
48
  {
49
49
  key: "GITHUB_ID",
50
- defaultValue: "",
50
+ defaultValue: "your-github-oauth-client-id",
51
51
  secret: false,
52
52
  description: "GitHub OAuth app client ID",
53
53
  required: true
54
54
  },
55
55
  {
56
56
  key: "GITHUB_SECRET",
57
- defaultValue: "",
57
+ defaultValue: "your-github-oauth-client-secret",
58
58
  secret: true,
59
59
  description: "GitHub OAuth app client secret",
60
60
  required: true
@@ -1 +1 @@
1
- {"version":3,"file":"usesend.cjs","names":[],"sources":["../../../src/services/definitions/usesend.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const usesendDefinition: ServiceDefinition = {\n\tid: \"usesend\",\n\tname: \"useSend\",\n\tdescription:\n\t\t\"Self-hosted sending infrastructure for developers. Email via AWS SES/SNS, GitHub auth, Postgres and Redis. Open-source alternative for transactional and status emails.\",\n\tcategory: \"communication\",\n\ticon: \"📧\",\n\n\timage: \"usesend/usesend\",\n\timageTag: \"v1.7.7\",\n\tports: [\n\t\t{\n\t\t\thost: 3025,\n\t\t\tcontainer: 3000,\n\t\t\tdescription: \"useSend web UI\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [],\n\tenvironment: [\n\t\t{\n\t\t\tkey: \"DATABASE_URL\",\n\t\t\tdefaultValue: \"postgres://usesend:${USESEND_DB_PASSWORD}@postgresql:5432/usesend\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"PostgreSQL connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"REDIS_URL\",\n\t\t\tdefaultValue: \"redis://:password@redis:6379\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Redis connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_ACCESS_KEY\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS access key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_SECRET_KEY\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS secret key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_ID\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"GitHub OAuth app client ID\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"GitHub OAuth app client secret\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_URL\",\n\t\t\tdefaultValue: \"https://your-usesend-instance\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Public URL of your useSend instance\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Random secret for NextAuth (e.g. openssl rand -base64 32)\",\n\t\t\trequired: true,\n\t\t},\n\t],\n\tdependsOn: [\"postgresql\", \"redis\"],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [],\n\n\tdocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\tselfHostedDocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\ttags: [\"email\", \"ses\", \"smtp\", \"transactional\", \"self-hosted\"],\n\tmaturity: \"stable\",\n\n\trequires: [\"postgresql\", \"redis\"],\n\trecommends: [],\n\tconflictsWith: [],\n\n\tminMemoryMB: 512,\n\tgpuRequired: false,\n};\n"],"mappings":";;;AAEA,MAAa,oBAAuC;CACnD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,EAAE;CACX,aAAa;EACZ;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;CACD,WAAW,CAAC,cAAc,QAAQ;CAClC,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,EAAE;CAEnB,SAAS;CACT,mBAAmB;CACnB,MAAM;EAAC;EAAS;EAAO;EAAQ;EAAiB;EAAc;CAC9D,UAAU;CAEV,UAAU,CAAC,cAAc,QAAQ;CACjC,YAAY,EAAE;CACd,eAAe,EAAE;CAEjB,aAAa;CACb,aAAa;CACb"}
1
+ {"version":3,"file":"usesend.cjs","names":[],"sources":["../../../src/services/definitions/usesend.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const usesendDefinition: ServiceDefinition = {\n\tid: \"usesend\",\n\tname: \"useSend\",\n\tdescription:\n\t\t\"Self-hosted sending infrastructure for developers. Email via AWS SES/SNS, GitHub auth, Postgres and Redis. Open-source alternative for transactional and status emails.\",\n\tcategory: \"communication\",\n\ticon: \"📧\",\n\n\timage: \"usesend/usesend\",\n\timageTag: \"v1.7.7\",\n\tports: [\n\t\t{\n\t\t\thost: 3025,\n\t\t\tcontainer: 3000,\n\t\t\tdescription: \"useSend web UI\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [],\n\tenvironment: [\n\t\t{\n\t\t\tkey: \"DATABASE_URL\",\n\t\t\tdefaultValue: \"postgres://usesend:${USESEND_DB_PASSWORD}@postgresql:5432/usesend\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"PostgreSQL connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"REDIS_URL\",\n\t\t\tdefaultValue: \"redis://:password@redis:6379\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Redis connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_ACCESS_KEY\",\n\t\t\tdefaultValue: \"your-aws-access-key\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS access key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_SECRET_KEY\",\n\t\t\tdefaultValue: \"your-aws-secret-key\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS secret key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_ID\",\n\t\t\tdefaultValue: \"your-github-oauth-client-id\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"GitHub OAuth app client ID\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_SECRET\",\n\t\t\tdefaultValue: \"your-github-oauth-client-secret\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"GitHub OAuth app client secret\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_URL\",\n\t\t\tdefaultValue: \"https://your-usesend-instance\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Public URL of your useSend instance\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Random secret for NextAuth (e.g. openssl rand -base64 32)\",\n\t\t\trequired: true,\n\t\t},\n\t],\n\tdependsOn: [\"postgresql\", \"redis\"],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [],\n\n\tdocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\tselfHostedDocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\ttags: [\"email\", \"ses\", \"smtp\", \"transactional\", \"self-hosted\"],\n\tmaturity: \"stable\",\n\n\trequires: [\"postgresql\", \"redis\"],\n\trecommends: [],\n\tconflictsWith: [],\n\n\tminMemoryMB: 512,\n\tgpuRequired: false,\n};\n"],"mappings":";;;AAEA,MAAa,oBAAuC;CACnD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,EAAE;CACX,aAAa;EACZ;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;CACD,WAAW,CAAC,cAAc,QAAQ;CAClC,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,EAAE;CAEnB,SAAS;CACT,mBAAmB;CACnB,MAAM;EAAC;EAAS;EAAO;EAAQ;EAAiB;EAAc;CAC9D,UAAU;CAEV,UAAU,CAAC,cAAc,QAAQ;CACjC,YAAY,EAAE;CACd,eAAe,EAAE;CAEjB,aAAa;CACb,aAAa;CACb"}
@@ -31,28 +31,28 @@ const usesendDefinition = {
31
31
  },
32
32
  {
33
33
  key: "AWS_ACCESS_KEY",
34
- defaultValue: "",
34
+ defaultValue: "your-aws-access-key",
35
35
  secret: true,
36
36
  description: "AWS access key for SES/SNS",
37
37
  required: true
38
38
  },
39
39
  {
40
40
  key: "AWS_SECRET_KEY",
41
- defaultValue: "",
41
+ defaultValue: "your-aws-secret-key",
42
42
  secret: true,
43
43
  description: "AWS secret key for SES/SNS",
44
44
  required: true
45
45
  },
46
46
  {
47
47
  key: "GITHUB_ID",
48
- defaultValue: "",
48
+ defaultValue: "your-github-oauth-client-id",
49
49
  secret: false,
50
50
  description: "GitHub OAuth app client ID",
51
51
  required: true
52
52
  },
53
53
  {
54
54
  key: "GITHUB_SECRET",
55
- defaultValue: "",
55
+ defaultValue: "your-github-oauth-client-secret",
56
56
  secret: true,
57
57
  description: "GitHub OAuth app client secret",
58
58
  required: true
@@ -1 +1 @@
1
- {"version":3,"file":"usesend.mjs","names":[],"sources":["../../../src/services/definitions/usesend.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const usesendDefinition: ServiceDefinition = {\n\tid: \"usesend\",\n\tname: \"useSend\",\n\tdescription:\n\t\t\"Self-hosted sending infrastructure for developers. Email via AWS SES/SNS, GitHub auth, Postgres and Redis. Open-source alternative for transactional and status emails.\",\n\tcategory: \"communication\",\n\ticon: \"📧\",\n\n\timage: \"usesend/usesend\",\n\timageTag: \"v1.7.7\",\n\tports: [\n\t\t{\n\t\t\thost: 3025,\n\t\t\tcontainer: 3000,\n\t\t\tdescription: \"useSend web UI\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [],\n\tenvironment: [\n\t\t{\n\t\t\tkey: \"DATABASE_URL\",\n\t\t\tdefaultValue: \"postgres://usesend:${USESEND_DB_PASSWORD}@postgresql:5432/usesend\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"PostgreSQL connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"REDIS_URL\",\n\t\t\tdefaultValue: \"redis://:password@redis:6379\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Redis connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_ACCESS_KEY\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS access key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_SECRET_KEY\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS secret key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_ID\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"GitHub OAuth app client ID\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"GitHub OAuth app client secret\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_URL\",\n\t\t\tdefaultValue: \"https://your-usesend-instance\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Public URL of your useSend instance\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Random secret for NextAuth (e.g. openssl rand -base64 32)\",\n\t\t\trequired: true,\n\t\t},\n\t],\n\tdependsOn: [\"postgresql\", \"redis\"],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [],\n\n\tdocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\tselfHostedDocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\ttags: [\"email\", \"ses\", \"smtp\", \"transactional\", \"self-hosted\"],\n\tmaturity: \"stable\",\n\n\trequires: [\"postgresql\", \"redis\"],\n\trecommends: [],\n\tconflictsWith: [],\n\n\tminMemoryMB: 512,\n\tgpuRequired: false,\n};\n"],"mappings":";AAEA,MAAa,oBAAuC;CACnD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,EAAE;CACX,aAAa;EACZ;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;CACD,WAAW,CAAC,cAAc,QAAQ;CAClC,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,EAAE;CAEnB,SAAS;CACT,mBAAmB;CACnB,MAAM;EAAC;EAAS;EAAO;EAAQ;EAAiB;EAAc;CAC9D,UAAU;CAEV,UAAU,CAAC,cAAc,QAAQ;CACjC,YAAY,EAAE;CACd,eAAe,EAAE;CAEjB,aAAa;CACb,aAAa;CACb"}
1
+ {"version":3,"file":"usesend.mjs","names":[],"sources":["../../../src/services/definitions/usesend.ts"],"sourcesContent":["import type { ServiceDefinition } from \"../../types.js\";\n\nexport const usesendDefinition: ServiceDefinition = {\n\tid: \"usesend\",\n\tname: \"useSend\",\n\tdescription:\n\t\t\"Self-hosted sending infrastructure for developers. Email via AWS SES/SNS, GitHub auth, Postgres and Redis. Open-source alternative for transactional and status emails.\",\n\tcategory: \"communication\",\n\ticon: \"📧\",\n\n\timage: \"usesend/usesend\",\n\timageTag: \"v1.7.7\",\n\tports: [\n\t\t{\n\t\t\thost: 3025,\n\t\t\tcontainer: 3000,\n\t\t\tdescription: \"useSend web UI\",\n\t\t\texposed: true,\n\t\t},\n\t],\n\tvolumes: [],\n\tenvironment: [\n\t\t{\n\t\t\tkey: \"DATABASE_URL\",\n\t\t\tdefaultValue: \"postgres://usesend:${USESEND_DB_PASSWORD}@postgresql:5432/usesend\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"PostgreSQL connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"REDIS_URL\",\n\t\t\tdefaultValue: \"redis://:password@redis:6379\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Redis connection URL\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_ACCESS_KEY\",\n\t\t\tdefaultValue: \"your-aws-access-key\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS access key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"AWS_SECRET_KEY\",\n\t\t\tdefaultValue: \"your-aws-secret-key\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"AWS secret key for SES/SNS\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_ID\",\n\t\t\tdefaultValue: \"your-github-oauth-client-id\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"GitHub OAuth app client ID\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"GITHUB_SECRET\",\n\t\t\tdefaultValue: \"your-github-oauth-client-secret\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"GitHub OAuth app client secret\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_URL\",\n\t\t\tdefaultValue: \"https://your-usesend-instance\",\n\t\t\tsecret: false,\n\t\t\tdescription: \"Public URL of your useSend instance\",\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tkey: \"NEXTAUTH_SECRET\",\n\t\t\tdefaultValue: \"\",\n\t\t\tsecret: true,\n\t\t\tdescription: \"Random secret for NextAuth (e.g. openssl rand -base64 32)\",\n\t\t\trequired: true,\n\t\t},\n\t],\n\tdependsOn: [\"postgresql\", \"redis\"],\n\trestartPolicy: \"unless-stopped\",\n\tnetworks: [\"openclaw-network\"],\n\n\tskills: [],\n\topenclawEnvVars: [],\n\n\tdocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\tselfHostedDocsUrl: \"https://docs.usesend.com/self-hosting/overview\",\n\ttags: [\"email\", \"ses\", \"smtp\", \"transactional\", \"self-hosted\"],\n\tmaturity: \"stable\",\n\n\trequires: [\"postgresql\", \"redis\"],\n\trecommends: [],\n\tconflictsWith: [],\n\n\tminMemoryMB: 512,\n\tgpuRequired: false,\n};\n"],"mappings":";AAEA,MAAa,oBAAuC;CACnD,IAAI;CACJ,MAAM;CACN,aACC;CACD,UAAU;CACV,MAAM;CAEN,OAAO;CACP,UAAU;CACV,OAAO,CACN;EACC,MAAM;EACN,WAAW;EACX,aAAa;EACb,SAAS;EACT,CACD;CACD,SAAS,EAAE;CACX,aAAa;EACZ;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;GACC,KAAK;GACL,cAAc;GACd,QAAQ;GACR,aAAa;GACb,UAAU;GACV;EACD;CACD,WAAW,CAAC,cAAc,QAAQ;CAClC,eAAe;CACf,UAAU,CAAC,mBAAmB;CAE9B,QAAQ,EAAE;CACV,iBAAiB,EAAE;CAEnB,SAAS;CACT,mBAAmB;CACnB,MAAM;EAAC;EAAS;EAAO;EAAQ;EAAiB;EAAc;CAC9D,UAAU;CAEV,UAAU,CAAC,cAAc,QAAQ;CACjC,YAAY,EAAE;CACd,eAAe,EAAE;CAEjB,aAAa;CACb,aAAa;CACb"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-openclaw/core",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "private": false,
5
5
  "description": "Core logic for better-openclaw: schemas, service registry, resolver, composer, validators and generators",
6
6
  "author": "bidew.io <bachir@bidew.io>",
@@ -11,7 +11,6 @@
11
11
  "directory": "packages/core"
12
12
  },
13
13
  "homepage": "https://better-openclaw.dev",
14
- "packageManager": "pnpm@9.15.4",
15
14
  "sideEffects": false,
16
15
  "main": "dist/index.mjs",
17
16
  "types": "dist/index.d.ts",
@@ -48,8 +47,8 @@
48
47
  "zod": "^4.3.6"
49
48
  },
50
49
  "devDependencies": {
51
- "@biomejs/biome": "^2.0.0",
52
- "@types/node": "^25.2.2",
50
+ "@biomejs/biome": "^2.4.4",
51
+ "@types/node": "^25.3.3",
53
52
  "tsdown": "^0.20.3",
54
53
  "typescript": "^5.9.3",
55
54
  "vitest": "^4.0.18"