openyida 2026.11.15-1 → 2026.11.16

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.
@@ -13,6 +13,11 @@ const MAX_FILE_BYTES = 256 * 1024 * 1024;
13
13
  const MAX_BUNDLE_BYTES = 1024 * 1024 * 1024;
14
14
  const MAX_FILES = 30000;
15
15
  const MAX_BUNDLE_MANIFEST_BYTES = 16 * 1024 * 1024;
16
+ // Keep a bounded snapshot of small files between inventory and copying. The
17
+ // source is still revalidated before publication; large bundles remain bounded
18
+ // and spill to the existing reread-and-hash path.
19
+ const MAX_SNAPSHOT_BYTES = 32 * 1024 * 1024;
20
+ const MAX_SNAPSHOT_FILE_BYTES = 64 * 1024;
16
21
  const PACKAGE_NAME = /^(?:@[a-z0-9._-]+\/)?[a-z0-9._-]+$/i;
17
22
 
18
23
  // Retry only transient Windows publication locks; never remove a winner.
@@ -139,6 +144,7 @@ function materializeBundle(runtime, config, options = {}) {
139
144
  const destinations = new Set();
140
145
  const dependencySources = new Map();
141
146
  let totalBytes = 0;
147
+ let snapshotBytes = 0;
142
148
  let published = false;
143
149
  let runtimePackage;
144
150
  const nodeBytes = readRegularFile(config.node.executable, MAX_FILE_BYTES).bytes;
@@ -150,9 +156,9 @@ function materializeBundle(runtime, config, options = {}) {
150
156
  const sha256 = digest(bytes);
151
157
  files.push({ path: relative, size: bytes.length, sha256, mode });
152
158
  // Inventory first. Reconnecting to the same content needs no staging copy.
153
- // Retain paths instead of whole dependency trees in memory; new bundles
154
- // reread and check each file against this snapshot before writing it.
155
- pendingFiles.push({ relative, source, bytes: source ? undefined : bytes, mode, sha256 });
159
+ const retain = source && bytes.length <= MAX_SNAPSHOT_FILE_BYTES && snapshotBytes + bytes.length <= MAX_SNAPSHOT_BYTES;
160
+ if (retain) {snapshotBytes += bytes.length;}
161
+ pendingFiles.push({ relative, source, bytes: !source || retain ? bytes : undefined, mode, sha256 });
156
162
  }
157
163
  function copyFile(source, target) {
158
164
  const file = readRegularFile(source, MAX_FILE_BYTES);
@@ -284,16 +290,18 @@ function materializeBundle(runtime, config, options = {}) {
284
290
  mkdirPrivateDirectories(pendingFiles.map(file => path.dirname(path.join(stage, file.relative))));
285
291
  }
286
292
  for (const file of pendingFiles) {
287
- const bytes = file.source ? readRegularFile(file.source, MAX_FILE_BYTES).bytes : file.bytes;
293
+ const bytes = file.bytes ?? readRegularFile(file.source, MAX_FILE_BYTES).bytes;
288
294
  if (digest(bytes) !== file.sha256) {throw bundleError('AGENT_BUNDLE_SOURCE_CHANGED');}
289
295
  const target = path.join(stage, file.relative);
290
296
  if (process.platform !== 'win32') {fs.mkdirSync(path.dirname(target), { recursive: true, mode: 0o700 });}
291
297
  fs.writeFileSync(target, bytes, { flag: 'wx', mode: file.mode });
292
- fs.chmodSync(target, file.mode);
298
+ // Windows applies the read-only attribute at exclusive creation.
299
+ // Unix needs chmod to correct restrictive umasks to the exact mode.
300
+ if (process.platform !== 'win32') {fs.chmodSync(target, file.mode);}
293
301
  }
294
302
  verifySources();
295
303
  fs.writeFileSync(path.join(stage, 'bundle-manifest.json'), raw, { flag: 'wx', mode: 0o444 });
296
- fs.chmodSync(path.join(stage, 'bundle-manifest.json'), 0o444);
304
+ if (process.platform !== 'win32') {fs.chmodSync(path.join(stage, 'bundle-manifest.json'), 0o444);}
297
305
  verifyBundle(stage, id);
298
306
  sealDirectories(stage, false);
299
307
  try {publishBundle(stage, root); published = true;}
@@ -36,6 +36,10 @@ function mkdirPrivateDirectories(directories) {
36
36
  }
37
37
  const missing = [...pending];
38
38
  if (!missing.length) {return;}
39
+ // A frozen bundle can contain hundreds of directories. Budget the batch,
40
+ // including ACL verification, instead of giving it a single-directory limit.
41
+ // Keep an upper bound so a stalled PowerShell process still terminates.
42
+ const timeout = Math.min(120000, 15000 + missing.length * 100);
39
43
  const script = `
40
44
  $ErrorActionPreference = 'Stop'
41
45
  $reader = [System.IO.StreamReader]::new([Console]::OpenStandardInput(), [System.Text.Encoding]::UTF8)
@@ -70,7 +74,7 @@ foreach ($directory in ($reader.ReadToEnd() | ConvertFrom-Json)) {
70
74
  try {
71
75
  execFileSync(path.join(process.env.SystemRoot || 'C:\\Windows', 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe'),
72
76
  ['-NoProfile', '-NonInteractive', '-Command', script], {
73
- windowsHide: true, timeout: 15000, stdio: 'pipe',
77
+ windowsHide: true, timeout, stdio: 'pipe',
74
78
  // Stdin avoids Windows environment-variable size limits for full bundles.
75
79
  input: JSON.stringify(missing),
76
80
  });
@@ -13,33 +13,33 @@
13
13
  "platform": "darwin",
14
14
  "arch": "arm64",
15
15
  "packageName": "@openyida/local-agent-runtime-darwin-arm64",
16
- "packageVersion": "0.1.7",
17
- "runtimeVersion": "0.1.7",
18
- "manifestSha256": "78bb41038c4a8b933eb01d138dfcf8411539cbc9c06fba52cb109e929780c3e0"
16
+ "packageVersion": "0.1.8",
17
+ "runtimeVersion": "0.1.8",
18
+ "manifestSha256": "2c941c8b267071b0e3810cab5fe08c5121e3abed3515be45c9803979a76e3642"
19
19
  },
20
20
  {
21
21
  "platform": "darwin",
22
22
  "arch": "x64",
23
23
  "packageName": "@openyida/local-agent-runtime-darwin-x64",
24
- "packageVersion": "0.1.7",
25
- "runtimeVersion": "0.1.7",
26
- "manifestSha256": "b257b3b8ef1411382c0f28655ea44386191394cee9335e99503e513bc09a6ca1"
24
+ "packageVersion": "0.1.8",
25
+ "runtimeVersion": "0.1.8",
26
+ "manifestSha256": "1f821bf10cad55769890d075cb16fb6dfe3add1f7e0692a29a0d094a486b4f44"
27
27
  },
28
28
  {
29
29
  "platform": "win32",
30
30
  "arch": "x64",
31
31
  "packageName": "@openyida/local-agent-runtime-win32-x64",
32
- "packageVersion": "0.1.7",
33
- "runtimeVersion": "0.1.7",
34
- "manifestSha256": "bdbc1cdd3cd8284f09a2ee2c0949c1411d63d12b3bcaf407f995293ab5dc5ea8"
32
+ "packageVersion": "0.1.8",
33
+ "runtimeVersion": "0.1.8",
34
+ "manifestSha256": "2c2a03b3b889e66eb6d13ec1ccd68f820ef1cb29a911463887a58c55c50431c2"
35
35
  },
36
36
  {
37
37
  "platform": "win32",
38
38
  "arch": "arm64",
39
39
  "packageName": "@openyida/local-agent-runtime-win32-arm64",
40
- "packageVersion": "0.1.7",
41
- "runtimeVersion": "0.1.7",
42
- "manifestSha256": "fd25c86698227ed4b9ae42d6dad2de04a1dc8a6dd8b589dd079f95dbe202ba60"
40
+ "packageVersion": "0.1.8",
41
+ "runtimeVersion": "0.1.8",
42
+ "manifestSha256": "e7f05ef2c7edbe39616d4c7939a1b7e913dc47eab485e788c174e5273499629c"
43
43
  }
44
44
  ]
45
45
  }
@@ -12,6 +12,10 @@ const { t } = require('../core/i18n');
12
12
  const MAX_CONFIG_BYTES = 64 * 1024;
13
13
  const MAX_OUTPUT_LINE_BYTES = 256 * 1024;
14
14
  const BACKGROUND_LOG_NAME = 'agent-run.log';
15
+ // Windows file-open and endpoint-protection latency can keep full bundle
16
+ // verification busy for several minutes. Keep a finite startup deadline, but
17
+ // do not kill a healthy daemon before it can verify its bundle and providers.
18
+ const BACKGROUND_STARTUP_TIMEOUT_MS = process.platform === 'win32' ? 300000 : 60000;
15
19
  const ENV_KEYS = [
16
20
  'USERPROFILE', 'DBUS_SESSION_BUS_ADDRESS', 'XDG_RUNTIME_DIR', 'HOME', 'USER', 'LOGNAME', 'SHELL', 'PATH', 'TMPDIR', 'TMP', 'TEMP',
17
21
  'SystemRoot', 'SYSTEMROOT', 'COMSPEC', 'PATHEXT', 'APPDATA', 'LOCALAPPDATA',
@@ -323,7 +327,7 @@ function launchBackgroundRuntime(runtime, config, options = {}) {
323
327
  } finally { if (fd !== undefined) {fs.closeSync(fd);} }
324
328
  };
325
329
  const pollTimer = setInterval(checkReady, 50);
326
- const startupTimer = setTimeout(() => fail('AGENT_RUNTIME_START_TIMEOUT'), options.startupTimeoutMs ?? 60000);
330
+ const startupTimer = setTimeout(() => fail('AGENT_RUNTIME_START_TIMEOUT'), options.startupTimeoutMs ?? BACKGROUND_STARTUP_TIMEOUT_MS);
327
331
  if (child.stdin) {
328
332
  child.stdin.on('error', () => fail('AGENT_RUNTIME_START_FAILED'));
329
333
  child.stdin.end(`${payload}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.11.15-1",
3
+ "version": "2026.11.16",
4
4
  "description": "OpenYida CLI - AI 宜搭应用开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",
@@ -123,9 +123,9 @@
123
123
  "endpoint": "https://www.aliwork.com/openyida/agent-api"
124
124
  },
125
125
  "optionalDependencies": {
126
- "@openyida/local-agent-runtime-darwin-arm64": "0.1.7",
127
- "@openyida/local-agent-runtime-darwin-x64": "0.1.7",
128
- "@openyida/local-agent-runtime-win32-x64": "0.1.7",
129
- "@openyida/local-agent-runtime-win32-arm64": "0.1.7"
126
+ "@openyida/local-agent-runtime-darwin-arm64": "0.1.8",
127
+ "@openyida/local-agent-runtime-darwin-x64": "0.1.8",
128
+ "@openyida/local-agent-runtime-win32-x64": "0.1.8",
129
+ "@openyida/local-agent-runtime-win32-arm64": "0.1.8"
130
130
  }
131
131
  }