@agent-device/proxy 0.21.39 → 0.21.40-nightly.20261119.188

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.
@@ -87,7 +87,7 @@ function buildDaemonHealthPayload(service, version, options = {}) {
87
87
  ok: true,
88
88
  service,
89
89
  version,
90
- rpcProtocolVersion: 2,
90
+ rpcProtocolVersion: 3,
91
91
  ...options.instanceId !== void 0 ? { instanceId: options.instanceId } : {},
92
92
  ...options.hostArch !== void 0 ? { hostArch: options.hostArch } : {},
93
93
  ...options.capabilities !== void 0 ? { capabilities: options.capabilities } : {},
package/dist/process.mjs CHANGED
@@ -1364,33 +1364,41 @@ function gracefulSignalFor(record) {
1364
1364
  //#endregion
1365
1365
  //#region ../host-kit/src/internal/atomic-file.ts
1366
1366
  /**
1367
- * Gives a specialized durable publisher a canonical temp path and cleanup
1368
- * ownership while it performs its own open/fsync/safety protocol.
1367
+ * The canonical temp path for a destination: a sibling of the name, inside the directory the publish will
1368
+ * create the entry in — the walk's answer for a script destination, `path.dirname` for every other one.
1369
+ */
1370
+ function createAtomicPublishTempPath(directory, destination) {
1371
+ return path.join(directory, `.${path.basename(destination)}.${process.pid}-${crypto.randomUUID()}.tmp`);
1372
+ }
1373
+ function removeTempBestEffort(destination, temporaryPath) {
1374
+ if (temporaryPath === void 0) return;
1375
+ try {
1376
+ fs.rmSync(temporaryPath, { force: true });
1377
+ } catch (error) {
1378
+ emitDiagnostic({
1379
+ level: "warn",
1380
+ phase: "atomic_file_cleanup_failed",
1381
+ data: {
1382
+ destination,
1383
+ temporaryPath,
1384
+ error: error instanceof Error ? error.message : String(error)
1385
+ }
1386
+ });
1387
+ }
1388
+ }
1389
+ /**
1390
+ * Gives a publisher a canonical temp path and cleanup ownership while it performs its own write protocol.
1391
+ * The sibling goes in `directory`, which the caller must name when it knows the physical directory the entry
1392
+ * is created in; a spelling that sends `..` or a link elsewhere is not where a temporary file may land.
1369
1393
  */
1370
1394
  function withAtomicPublishTempPathSync(destination, publish) {
1371
- const temporaryPath = createAtomicPublishTempPath(destination);
1395
+ const temporaryPath = createAtomicPublishTempPath(path.dirname(destination), destination);
1372
1396
  try {
1373
1397
  return publish(temporaryPath);
1374
1398
  } finally {
1375
- try {
1376
- fs.rmSync(temporaryPath, { force: true });
1377
- } catch (error) {
1378
- emitDiagnostic({
1379
- level: "warn",
1380
- phase: "atomic_file_cleanup_failed",
1381
- data: {
1382
- destination,
1383
- temporaryPath,
1384
- error: error instanceof Error ? error.message : String(error)
1385
- }
1386
- });
1387
- }
1399
+ removeTempBestEffort(destination, temporaryPath);
1388
1400
  }
1389
1401
  }
1390
- /** Returns the canonical same-directory temp path used by atomic publishers. */
1391
- function createAtomicPublishTempPath(destination) {
1392
- return path.join(path.dirname(destination), `.${path.basename(destination)}.${process.pid}-${crypto.randomUUID()}.tmp`);
1393
- }
1394
1402
  //#endregion
1395
1403
  //#region ../host-kit/src/internal/owned-process-record.ts
1396
1404
  const RECORD_FILE_NAME = "owned-processes.json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-device/proxy",
3
- "version": "0.21.39",
3
+ "version": "0.21.40-nightly.20261119.188",
4
4
  "type": "module",
5
5
  "description": "Transport-neutral authenticating proxy in front of an agent-device daemon.",
6
6
  "license": "MIT",
@@ -25,8 +25,8 @@
25
25
  "dist"
26
26
  ],
27
27
  "devDependencies": {
28
- "@agent-device/host-kit": "0.0.0",
29
28
  "@agent-device/contracts": "0.0.0",
29
+ "@agent-device/host-kit": "0.0.0",
30
30
  "@agent-device/kernel": "0.0.0"
31
31
  },
32
32
  "scripts": {