@clawos-dev/clawd 0.2.547 → 0.2.548

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/app-builder-plugin/mcp-server.cjs +35 -35
  2. package/dist/cli.cjs +475 -649
  3. package/dist/persona-defaults/persona-app-builder/.mcp.json +17 -2
  4. package/dist/persona-defaults/persona-app-builder/CLAUDE.md +8 -9
  5. package/dist/persona-defaults/persona-app-builder/extension-kit/README.md +6 -7
  6. package/dist/persona-defaults/persona-app-builder/extension-kit/contract/s.yaml.tmpl +3 -2
  7. package/dist/persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit/scripts/ensure-credentials.sh +96 -0
  8. package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/scripts/publish.sh +3 -3
  9. package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/scripts/remove-extension.sh +2 -2
  10. package/dist/persona-defaults/persona-app-builder/mcp/clawd-app-builder/mcp-server.cjs +25397 -0
  11. package/dist/persona-defaults/persona-dataclaw-builder/.mcp.json +14 -1
  12. package/dist/persona-defaults/persona-dataclaw-builder/CLAUDE.md +1 -1
  13. package/dist/persona-defaults/persona-dataclaw-builder/extension-kit/README.md +6 -7
  14. package/dist/persona-defaults/persona-dataclaw-builder/extension-kit/config.env +1 -1
  15. package/dist/persona-defaults/persona-dataclaw-builder/extension-kit/contract/s.yaml.tmpl +3 -2
  16. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/contract/bootstrap +22 -0
  17. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/ensure-credentials.sh +96 -0
  18. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/ensure-toolchain.sh +65 -0
  19. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/new-extension.sh +71 -0
  20. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/publish.sh +205 -0
  21. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/remove-extension.sh +89 -0
  22. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/deploy-kit/scripts/verify.sh +49 -0
  23. package/dist/persona-defaults/persona-dataclaw-builder/mcp/clawd-app-builder/mcp-server.cjs +25397 -0
  24. package/package.json +1 -1
  25. package/dist/deploy-kit/.secrets/aliyun.env.example +0 -7
  26. package/dist/deploy-kit/.secrets/aliyun.env.local.example +0 -12
  27. package/dist/deploy-kit/scripts/ensure-credentials.sh +0 -111
  28. package/dist/deploy-kit/scripts/ensure-credentials.spec.ts +0 -438
  29. package/dist/deploy-kit/scripts/publish.spec.ts +0 -278
  30. /package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/contract/bootstrap +0 -0
  31. /package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/scripts/ensure-toolchain.sh +0 -0
  32. /package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/scripts/new-extension.sh +0 -0
  33. /package/dist/{deploy-kit → persona-defaults/persona-app-builder/mcp/clawd-app-builder/deploy-kit}/scripts/verify.sh +0 -0
@@ -3227,8 +3227,8 @@ var require_utils = __commonJS({
3227
3227
  }
3228
3228
  return ind;
3229
3229
  }
3230
- function removeDotSegments(path4) {
3231
- let input = path4;
3230
+ function removeDotSegments(path5) {
3231
+ let input = path5;
3232
3232
  const output = [];
3233
3233
  let nextSlash = -1;
3234
3234
  let len = 0;
@@ -3480,8 +3480,8 @@ var require_schemes = __commonJS({
3480
3480
  wsComponent.secure = void 0;
3481
3481
  }
3482
3482
  if (wsComponent.resourceName) {
3483
- const [path4, query] = wsComponent.resourceName.split("?");
3484
- wsComponent.path = path4 && path4 !== "/" ? path4 : void 0;
3483
+ const [path5, query] = wsComponent.resourceName.split("?");
3484
+ wsComponent.path = path5 && path5 !== "/" ? path5 : void 0;
3485
3485
  wsComponent.query = query;
3486
3486
  wsComponent.resourceName = void 0;
3487
3487
  }
@@ -6894,11 +6894,12 @@ __export(mcp_server_exports, {
6894
6894
  handleCreateProject: () => handleCreateProject,
6895
6895
  handlePublish: () => handlePublish,
6896
6896
  handleRemoveProject: () => handleRemoveProject,
6897
- readEnv: () => readEnv,
6898
- registerTools: () => registerTools
6897
+ registerTools: () => registerTools,
6898
+ resolvePluginEnv: () => resolvePluginEnv
6899
6899
  });
6900
6900
  module.exports = __toCommonJS(mcp_server_exports);
6901
6901
  var import_node_fs4 = __toESM(require("fs"), 1);
6902
+ var import_node_path6 = __toESM(require("path"), 1);
6902
6903
 
6903
6904
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js
6904
6905
  var external_exports = {};
@@ -7378,8 +7379,8 @@ function getErrorMap() {
7378
7379
 
7379
7380
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
7380
7381
  var makeIssue = (params) => {
7381
- const { data, path: path4, errorMaps, issueData } = params;
7382
- const fullPath = [...path4, ...issueData.path || []];
7382
+ const { data, path: path5, errorMaps, issueData } = params;
7383
+ const fullPath = [...path5, ...issueData.path || []];
7383
7384
  const fullIssue = {
7384
7385
  ...issueData,
7385
7386
  path: fullPath
@@ -7495,11 +7496,11 @@ var errorUtil;
7495
7496
 
7496
7497
  // ../node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js
7497
7498
  var ParseInputLazyPath = class {
7498
- constructor(parent, value, path4, key) {
7499
+ constructor(parent, value, path5, key) {
7499
7500
  this._cachedPath = [];
7500
7501
  this.parent = parent;
7501
7502
  this.data = value;
7502
- this._path = path4;
7503
+ this._path = path5;
7503
7504
  this._key = key;
7504
7505
  }
7505
7506
  get path() {
@@ -11136,10 +11137,10 @@ function assignProp(target, prop, value) {
11136
11137
  configurable: true
11137
11138
  });
11138
11139
  }
11139
- function getElementAtPath(obj, path4) {
11140
- if (!path4)
11140
+ function getElementAtPath(obj, path5) {
11141
+ if (!path5)
11141
11142
  return obj;
11142
- return path4.reduce((acc, key) => acc?.[key], obj);
11143
+ return path5.reduce((acc, key) => acc?.[key], obj);
11143
11144
  }
11144
11145
  function promiseAllObject(promisesObj) {
11145
11146
  const keys = Object.keys(promisesObj);
@@ -11459,11 +11460,11 @@ function aborted(x, startIndex = 0) {
11459
11460
  }
11460
11461
  return false;
11461
11462
  }
11462
- function prefixIssues(path4, issues) {
11463
+ function prefixIssues(path5, issues) {
11463
11464
  return issues.map((iss) => {
11464
11465
  var _a;
11465
11466
  (_a = iss).path ?? (_a.path = []);
11466
- iss.path.unshift(path4);
11467
+ iss.path.unshift(path5);
11467
11468
  return iss;
11468
11469
  });
11469
11470
  }
@@ -25240,24 +25241,23 @@ var ok = (payload) => ({
25240
25241
  });
25241
25242
  var fail = (text) => ({ content: [{ type: "text", text }], isError: true });
25242
25243
  var errMsg2 = (err) => err instanceof Error ? err.message : String(err);
25243
- var ENV_NAMES = {
25244
- root: "CLAWD_APP_BUILDER_ROOT",
25245
- personaRoot: "CLAWD_APP_BUILDER_PERSONA_ROOT",
25246
- templateDir: "CLAWD_APP_BUILDER_TEMPLATE_DIR",
25247
- scaffoldScript: "CLAWD_APP_BUILDER_SCAFFOLD_SCRIPT",
25248
- publishScript: "CLAWD_APP_BUILDER_PUBLISH_SCRIPT",
25249
- removeScript: "CLAWD_APP_BUILDER_REMOVE_SCRIPT"
25250
- };
25251
- function readEnv(env = process.env) {
25252
- const out = {};
25253
- for (const [key, name] of Object.entries(ENV_NAMES)) {
25254
- const v = env[name];
25255
- if (v) out[key] = v;
25256
- }
25257
- return out;
25244
+ var WORK_DIR_ENV = "CLAWD_WORK_DIR";
25245
+ var SCAFFOLD_TEMPLATE = "nestjs-react";
25246
+ function resolvePluginEnv(env, pluginDir) {
25247
+ const personaRoot = import_node_path6.default.resolve(pluginDir, "..", "..");
25248
+ const scripts = import_node_path6.default.join(pluginDir, "deploy-kit", "scripts");
25249
+ const root = env[WORK_DIR_ENV];
25250
+ return {
25251
+ ...root ? { root } : {},
25252
+ personaRoot,
25253
+ templateDir: import_node_path6.default.join(personaRoot, "extension-kit", "examples", SCAFFOLD_TEMPLATE),
25254
+ scaffoldScript: import_node_path6.default.join(scripts, "new-extension.sh"),
25255
+ publishScript: import_node_path6.default.join(scripts, "publish.sh"),
25256
+ removeScript: import_node_path6.default.join(scripts, "remove-extension.sh")
25257
+ };
25258
25258
  }
25259
25259
  function missingEnv(env, keys) {
25260
- const missing = keys.filter((k) => !env[k]).map((k) => ENV_NAMES[k]);
25260
+ const missing = keys.filter((k) => !env[k]).map((k) => k === "root" ? WORK_DIR_ENV : k);
25261
25261
  return missing.length ? `env not set: ${missing.join(", ")}` : null;
25262
25262
  }
25263
25263
  async function handleCreateProject(input, ctx) {
@@ -25372,8 +25372,8 @@ function registerTools(server, ctx) {
25372
25372
  );
25373
25373
  }
25374
25374
  async function main() {
25375
- const env = readEnv();
25376
- log("boot", { pid: process.pid, root: env.root ?? "(unset)", personaRoot: env.personaRoot ?? "(unset)" });
25375
+ const env = resolvePluginEnv(process.env, __dirname);
25376
+ log("boot", { pid: process.pid, root: env.root ?? "(unset)", personaRoot: env.personaRoot });
25377
25377
  const server = new McpServer({ name: "clawd-app-builder", version: "0.3.0" });
25378
25378
  registerTools(server, { env });
25379
25379
  await server.connect(new StdioServerTransport());
@@ -25392,6 +25392,6 @@ if (isMainModule) {
25392
25392
  handleCreateProject,
25393
25393
  handlePublish,
25394
25394
  handleRemoveProject,
25395
- readEnv,
25396
- registerTools
25395
+ registerTools,
25396
+ resolvePluginEnv
25397
25397
  });