@tinycloud/operations 0.2.1-beta.0 → 0.3.0-beta.0

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,6 +1,6 @@
1
1
  import { PermissionEntry } from '@tinycloud/sdk-core';
2
2
  import { z } from 'zod';
3
- import { T as TinyCloudPosture, O as OperationOperatorType } from './contract-OnWT3OXa.cjs';
3
+ import { T as TinyCloudPosture, O as OperationOperatorType } from './contract-xMIIMtpF.cjs';
4
4
 
5
5
  /**
6
6
  * A capability in the canonical form persisted in a v1 request artifact.
@@ -1,6 +1,6 @@
1
1
  import { PermissionEntry } from '@tinycloud/sdk-core';
2
2
  import { z } from 'zod';
3
- import { T as TinyCloudPosture, O as OperationOperatorType } from './contract-OnWT3OXa.js';
3
+ import { T as TinyCloudPosture, O as OperationOperatorType } from './contract-xMIIMtpF.js';
4
4
 
5
5
  /**
6
6
  * A capability in the canonical form persisted in a v1 request artifact.
package/dist/artifacts.js CHANGED
@@ -6592,6 +6592,7 @@ function canonicalizeCaveats(caveats) {
6592
6592
 
6593
6593
  // src/state.ts
6594
6594
  import { randomUUID } from "crypto";
6595
+ import { AsyncLocalStorage } from "async_hooks";
6595
6596
  import {
6596
6597
  mkdir,
6597
6598
  readFile,
@@ -6601,12 +6602,13 @@ import {
6601
6602
  writeFile
6602
6603
  } from "fs/promises";
6603
6604
  import { homedir } from "os";
6604
- import { basename, dirname, join, relative, resolve } from "path";
6605
+ import { basename, dirname, isAbsolute, join, relative, resolve } from "path";
6605
6606
  var DEFAULT_LOCK_TIMEOUT_MS = 2e3;
6606
6607
  var DEFAULT_LOCK_RETRY_MS = 25;
6607
6608
  var DEFAULT_STALE_LOCK_MS = 3e4;
6608
6609
  var TEST_LOCK_CONTENTION_SIGNAL_PATH = "TC_TEST_PROFILE_LOCK_CONTENTION_SIGNAL_PATH";
6609
6610
  var TEST_LOCK_RECOVERY_BARRIER_DIR = "TC_TEST_PROFILE_LOCK_RECOVERY_BARRIER_DIR";
6611
+ var invocationStateRoot = new AsyncLocalStorage();
6610
6612
  var ProfileLockTimeoutError = class extends Error {
6611
6613
  constructor(profile, timeoutMs) {
6612
6614
  super(`Timed out waiting for the profile lock for "${profile}" after ${timeoutMs}ms.`);
@@ -6615,7 +6617,7 @@ var ProfileLockTimeoutError = class extends Error {
6615
6617
  }
6616
6618
  };
6617
6619
  function tinycloudHomePath() {
6618
- const home = process.env.TC_HOME ?? process.env.HOME ?? process.env.USERPROFILE ?? homedir();
6620
+ const home = invocationStateRoot.getStore() ?? process.env.TC_HOME ?? process.env.HOME ?? process.env.USERPROFILE ?? homedir();
6619
6621
  return join(home, ".tinycloud");
6620
6622
  }
6621
6623
  function profilesPath() {