@adep/cli 0.5.9 → 0.5.11

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/index.js CHANGED
@@ -1254,7 +1254,7 @@ function rpcReply(worker, id, ok, payload) {
1254
1254
  ...payload?.error === void 0 ? {} : { error: payload.error }
1255
1255
  });
1256
1256
  }
1257
- var WorkerFunctionExecutor;
1257
+ var DEFAULT_FETCH_TIMEOUT_MS, WorkerFunctionExecutor;
1258
1258
  var init_worker_executor = __esm({
1259
1259
  "packages/runtime/src/functions/runtime/worker-executor.ts"() {
1260
1260
  "use strict";
@@ -1262,14 +1262,17 @@ var init_worker_executor = __esm({
1262
1262
  init_resolve();
1263
1263
  init_domain();
1264
1264
  init_function_timeout();
1265
+ DEFAULT_FETCH_TIMEOUT_MS = 1e4;
1265
1266
  WorkerFunctionExecutor = class {
1266
1267
  depsConfig;
1267
1268
  fetchConfig;
1269
+ fetchTimeoutMs;
1268
1270
  parity;
1269
1271
  timeoutMaxMs;
1270
1272
  constructor(options = {}) {
1271
1273
  this.depsConfig = options.deps;
1272
1274
  this.fetchConfig = options.fetch;
1275
+ this.fetchTimeoutMs = options.fetchTimeoutMs;
1273
1276
  this.parity = options.parity === true;
1274
1277
  this.timeoutMaxMs = options.timeoutMaxMs;
1275
1278
  }
@@ -1287,7 +1290,11 @@ var init_worker_executor = __esm({
1287
1290
  const timeoutMs = budget.timeoutMs;
1288
1291
  const memoryLimitMb = input2.memoryLimitMb ?? DEFAULT_MEMORY_LIMIT_MB;
1289
1292
  const deps = this.depsConfig === void 0 ? void 0 : resolveExecutionDeps(this.depsConfig, input2.project.id, input2.files["package.json"]);
1290
- const effectiveFetchConfig = this.fetchConfig === void 0 ? void 0 : input2.fetchAllowlist === void 0 ? this.fetchConfig : { ...this.fetchConfig, allowlist: input2.fetchAllowlist };
1293
+ const effectiveFetchConfig = input2.fetchAllowlist === void 0 ? this.fetchConfig : {
1294
+ allowlist: input2.fetchAllowlist,
1295
+ timeoutMs: this.fetchConfig?.timeoutMs ?? this.fetchTimeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS,
1296
+ ...this.fetchConfig?.maxResponseBytes === void 0 ? {} : { maxResponseBytes: this.fetchConfig.maxResponseBytes }
1297
+ };
1291
1298
  const logs = [];
1292
1299
  if (budget.clamped) {
1293
1300
  logs.push(
@@ -10225,7 +10232,8 @@ __export(storage_exports, {
10225
10232
  storageDownload: () => storageDownload,
10226
10233
  storageList: () => storageList,
10227
10234
  storageRemove: () => storageRemove,
10228
- storageUpload: () => storageUpload
10235
+ storageUpload: () => storageUpload,
10236
+ visibilityNotice: () => visibilityNotice
10229
10237
  });
10230
10238
  import { mkdir as mkdir15, readFile as readFile24, stat as stat14, writeFile as writeFile15 } from "node:fs/promises";
10231
10239
  import { basename as basename5, dirname as dirname12, extname as extname2, join as join32, resolve as resolve15 } from "node:path";
@@ -10291,6 +10299,10 @@ async function storageUpload(paths, options) {
10291
10299
  const body = await response.json();
10292
10300
  return { ...body.file, ...body.signedUrl === void 0 ? {} : { signedUrl: body.signedUrl } };
10293
10301
  }
10302
+ function visibilityNotice(result) {
10303
+ if (result.visibility !== "private") return null;
10304
+ return "\u63D0\u793A\uFF1Avisibility=private\uFF08\u7F3A\u7701\uFF09\u2014\u2014\u79C1\u6709\u6587\u4EF6\u7ECF\u7AD9\u70B9\u6258\u7BA1\u9762\u4E0D\u53EF\u89C1\uFF1B\u82E5\u8FD9\u662F\u7AD9\u70B9\u6587\u4EF6\uFF08\u5982 site/data/*\uFF09\u9700\u516C\u5F00\u8BBF\u95EE\uFF0C\u8BF7\u52A0 --visibility public \u91CD\u65B0\u4E0A\u4F20";
10305
+ }
10294
10306
  async function storageList(paths, options) {
10295
10307
  const { client, project: project2 } = await open5(paths, options);
10296
10308
  const search = new URLSearchParams();
@@ -11144,7 +11156,7 @@ var init_version = __esm({
11144
11156
  manifest = requireJson("../package.json");
11145
11157
  CLI_VERSION = typeof manifest.version === "string" && manifest.version.length > 0 ? manifest.version : "0.0.0";
11146
11158
  RELEASE_TASKS = Array.isArray(manifest.adep?.releaseTasks) ? manifest.adep.releaseTasks.filter((item) => typeof item === "string") : [];
11147
- BUILD_COMMIT = "89404b79".trim() !== "" ? "89404b79".trim() : null;
11159
+ BUILD_COMMIT = "d1573de5".trim() !== "" ? "d1573de5".trim() : null;
11148
11160
  }
11149
11161
  });
11150
11162
 
@@ -14523,7 +14535,7 @@ var ADEP_ENV_DTS = `/**
14523
14535
  * \u5951\u7EA6\u552F\u4E00\u771F\u76F8\u6E90 = packages/types/src/\uFF1B\u540C\u6E90\u4EA7\u7269\u8FD8\u6709 Web IDE \u955C\u50CF
14524
14536
  * \uFF08app/components/ide/adep.d.ts\uFF0C\u540C\u4E00\u4EFD\u751F\u6210\u5668\u8F93\u51FA + \u6D4F\u89C8\u5668\u6D4B\u8BD5\u5168\u5C40\uFF09\u3002
14525
14537
  * \u6F02\u79FB\u95E8 = scripts/lib/__tests__/contract-mirrors.test.ts\u3002
14526
- * \u955C\u50CF\u7248\u672C = @adep/types@0.4.6\uFF08generate:contracts \u751F\u6210\u65F6\u6233\uFF09
14538
+ * \u955C\u50CF\u7248\u672C = @adep/types@0.4.7\uFF08generate:contracts \u751F\u6210\u65F6\u6233\uFF09
14527
14539
  */
14528
14540
 
14529
14541
  /* ---------- HTTP \u89E6\u53D1\u4E0A\u4E0B\u6587\uFF08FunctionContext \u955C\u50CF\uFF09 ---------- */
@@ -15618,7 +15630,7 @@ export default defineConfig({
15618
15630
  },
15619
15631
  })
15620
15632
  `;
15621
- var GITIGNORE = "node_modules/\ndata/\n.adep/\nsite/\n";
15633
+ var GITIGNORE = "node_modules/\ndata/\n.adep/\nsite/\n.wbapp_*\n";
15622
15634
  var PNPM_WORKSPACE_YAML = `# pnpm \u914D\u7F6E\uFF08pnpm 10 \u8D77\u4ECE\u8FD9\u91CC\u8BFB\u53D6\uFF1Bpackage.json \u7684 pnpm \u5B57\u6BB5\u53EA\u5BF9 pnpm 9 \u53CA\u66F4\u65E9\u751F\u6548\uFF09
15623
15635
  #
15624
15636
  # pnpm 10+ \u9ED8\u8BA4\u4E0D\u6267\u884C\u4F9D\u8D56\u7684\u6784\u5EFA\u811A\u672C\uFF08\u4F9B\u5E94\u94FE\u5B89\u5168\u9ED8\u8BA4\uFF09\u3002esbuild \u662F vite / @adep/cli \u7684
@@ -41272,13 +41284,13 @@ function registerStorage(program2, ctx) {
41272
41284
  const storage = program2.command("storage").description("\u4E91\u5B58\u50A8 / \u6587\u4EF6\u5B58\u50A8\uFF1A\u4E0A\u4F20 / \u4E0B\u8F7D / \u5217\u8868 / \u5220\u9664");
41273
41285
  storage.command("upload").description("\u4E0A\u4F20\u5355\u4E2A\u6587\u4EF6\uFF08multipart\uFF1B\u5355\u6587\u4EF6 \u2264 50MB\uFF09").argument("<file>", "\u672C\u5730\u6587\u4EF6\u8DEF\u5F84").requiredOption("--path <remote-path>", "\u6876\u5185\u76EE\u6807\u8DEF\u5F84\uFF08\u5982 avatars/a.png\uFF09").option(
41274
41286
  "--visibility <public|private>",
41275
- "public \u76F4\u8FDE / private \u7B7E\u540D\uFF08\u7F3A\u7701 private\uFF09",
41287
+ "public \u76F4\u8FDE / private \u7B7E\u540D\uFF08\u7F3A\u7701 private\u2014\u2014\u79C1\u6709\u6587\u4EF6\u7ECF\u7AD9\u70B9\u6258\u7BA1\u9762\u4E0D\u53EF\u89C1\uFF0C\u7AD9\u70B9\u6587\u4EF6\u987B\u663E\u5F0F public\uFF09",
41276
41288
  "private"
41277
41289
  ).option("-p, --project <slug>", "\u76EE\u6807\u5E73\u53F0\u9879\u76EE slug\uFF08\u7F3A\u7701\u53D6 adep.config.ts \u7684 name\uFF09").action(async (file2, flags) => {
41278
41290
  const command = ctx.io("storage upload");
41279
41291
  await command.run(async () => {
41280
41292
  const { environment, source } = await ctx.env();
41281
- const { storageUpload: storageUpload2 } = await Promise.resolve().then(() => (init_storage2(), storage_exports));
41293
+ const { storageUpload: storageUpload2, visibilityNotice: visibilityNotice2 } = await Promise.resolve().then(() => (init_storage2(), storage_exports));
41282
41294
  const result = await storageUpload2(ctx.paths, {
41283
41295
  cwd: ctx.cwd,
41284
41296
  file: file2,
@@ -41288,6 +41300,8 @@ function registerStorage(program2, ctx) {
41288
41300
  ...flags.project === void 0 ? {} : { slug: flags.project }
41289
41301
  });
41290
41302
  command.line(`\u73AF\u5883\uFF1A${environment}\uFF08${describeEnvironmentSource(source)}\uFF09`);
41303
+ const notice = visibilityNotice2(result);
41304
+ if (notice !== null) command.line(notice);
41291
41305
  command.ok(result, (data) => {
41292
41306
  const r = data;
41293
41307
  const lines = [`\u5DF2\u4E0A\u4F20 ${r.path}\uFF08${r.visibility}\uFF0C${formatBytes(r.size)}\uFF09`];
package/dist/vite.js CHANGED
@@ -336,14 +336,17 @@ function rpcReply(worker, id, ok, payload) {
336
336
  ...payload?.error === void 0 ? {} : { error: payload.error }
337
337
  });
338
338
  }
339
+ var DEFAULT_FETCH_TIMEOUT_MS = 1e4;
339
340
  var WorkerFunctionExecutor = class {
340
341
  depsConfig;
341
342
  fetchConfig;
343
+ fetchTimeoutMs;
342
344
  parity;
343
345
  timeoutMaxMs;
344
346
  constructor(options = {}) {
345
347
  this.depsConfig = options.deps;
346
348
  this.fetchConfig = options.fetch;
349
+ this.fetchTimeoutMs = options.fetchTimeoutMs;
347
350
  this.parity = options.parity === true;
348
351
  this.timeoutMaxMs = options.timeoutMaxMs;
349
352
  }
@@ -361,7 +364,11 @@ var WorkerFunctionExecutor = class {
361
364
  const timeoutMs = budget.timeoutMs;
362
365
  const memoryLimitMb = input.memoryLimitMb ?? DEFAULT_MEMORY_LIMIT_MB;
363
366
  const deps = this.depsConfig === void 0 ? void 0 : resolveExecutionDeps(this.depsConfig, input.project.id, input.files["package.json"]);
364
- const effectiveFetchConfig = this.fetchConfig === void 0 ? void 0 : input.fetchAllowlist === void 0 ? this.fetchConfig : { ...this.fetchConfig, allowlist: input.fetchAllowlist };
367
+ const effectiveFetchConfig = input.fetchAllowlist === void 0 ? this.fetchConfig : {
368
+ allowlist: input.fetchAllowlist,
369
+ timeoutMs: this.fetchConfig?.timeoutMs ?? this.fetchTimeoutMs ?? DEFAULT_FETCH_TIMEOUT_MS,
370
+ ...this.fetchConfig?.maxResponseBytes === void 0 ? {} : { maxResponseBytes: this.fetchConfig.maxResponseBytes }
371
+ };
365
372
  const logs = [];
366
373
  if (budget.clamped) {
367
374
  logs.push(
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "homepage": "https://adep.top",
9
9
  "bugs": "https://gitcode.com/yunqiang_wu/ai-yunke/issues",
10
- "version": "0.5.9",
10
+ "version": "0.5.11",
11
11
  "adep": {
12
12
  "releaseTasks": [
13
13
  "FN-062",
@@ -39,13 +39,13 @@
39
39
  "yaml": "2.9.1",
40
40
  "zod": "^4.6.6",
41
41
  "@adep/app-runtime": "0.1.1",
42
- "@adep/cf-compat": "0.1.4",
43
- "@adep/runtime": "0.3.17",
42
+ "@adep/crypto": "0.1.1",
44
43
  "@adep/vite-plugin": "0.1.13",
45
- "@adep/crypto": "0.1.1"
44
+ "@adep/runtime": "0.3.18",
45
+ "@adep/cf-compat": "0.1.4"
46
46
  },
47
47
  "devDependencies": {
48
- "@adep/types": "0.4.6"
48
+ "@adep/types": "0.4.7"
49
49
  },
50
50
  "scripts": {
51
51
  "test": "vitest run",