negotium 0.2.0 → 0.2.2

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.
@@ -4209,9 +4209,9 @@ var init_transport_probe = __esm(() => {
4209
4209
  init_capability();
4210
4210
  });
4211
4211
 
4212
- // ../../packages/core/src/storage/vault-crypto.ts
4212
+ // ../../packages/core/src/storage/vault-crypto-core.ts
4213
4213
  import { createCipheriv, createDecipheriv, createHash, randomBytes as randomBytes3 } from "crypto";
4214
- function encryptionKey(masterKey = VAULT_MASTER_KEY) {
4214
+ function encryptionKey(masterKey) {
4215
4215
  return createHash("sha256").update("otium-vault-value-v1\x00", "utf8").update(masterKey, "utf8").digest().subarray(0, KEY_BYTES);
4216
4216
  }
4217
4217
  function aad(userId, key) {
@@ -4220,7 +4220,7 @@ function aad(userId, key) {
4220
4220
  function isEncryptedVaultValue(value2) {
4221
4221
  return value2.startsWith(ENVELOPE_PREFIX);
4222
4222
  }
4223
- function encryptVaultValue(userId, key, value2, masterKey = VAULT_MASTER_KEY) {
4223
+ function encryptVaultValueWithKey(userId, key, value2, masterKey) {
4224
4224
  const iv = randomBytes3(IV_BYTES);
4225
4225
  const cipher = createCipheriv("aes-256-gcm", encryptionKey(masterKey), iv);
4226
4226
  cipher.setAAD(aad(userId, key));
@@ -4228,7 +4228,7 @@ function encryptVaultValue(userId, key, value2, masterKey = VAULT_MASTER_KEY) {
4228
4228
  const tag = cipher.getAuthTag();
4229
4229
  return `${ENVELOPE_PREFIX}${iv.toString("base64url")}.${ciphertext.toString("base64url")}.${tag.toString("base64url")}`;
4230
4230
  }
4231
- function decryptVaultValue(userId, key, storedValue, masterKey = VAULT_MASTER_KEY) {
4231
+ function decryptVaultValueWithKey(userId, key, storedValue, masterKey) {
4232
4232
  if (!isEncryptedVaultValue(storedValue)) {
4233
4233
  return { value: storedValue, legacyPlaintext: true };
4234
4234
  }
@@ -4250,8 +4250,18 @@ function decryptVaultValue(userId, key, storedValue, masterKey = VAULT_MASTER_KE
4250
4250
  return { value: plaintext.toString("utf8"), legacyPlaintext: false };
4251
4251
  }
4252
4252
  var ENVELOPE_PREFIX = "otium-vault:v1:", IV_BYTES = 12, KEY_BYTES = 32;
4253
+ var init_vault_crypto_core = () => {};
4254
+
4255
+ // ../../packages/core/src/storage/vault-crypto.ts
4256
+ function encryptVaultValue(userId, key, value2, masterKey = VAULT_MASTER_KEY) {
4257
+ return encryptVaultValueWithKey(userId, key, value2, masterKey);
4258
+ }
4259
+ function decryptVaultValue(userId, key, storedValue, masterKey = VAULT_MASTER_KEY) {
4260
+ return decryptVaultValueWithKey(userId, key, storedValue, masterKey);
4261
+ }
4253
4262
  var init_vault_crypto = __esm(() => {
4254
4263
  init_config();
4264
+ init_vault_crypto_core();
4255
4265
  });
4256
4266
 
4257
4267
  // ../../packages/core/src/storage/vault.ts
@@ -7677,7 +7687,7 @@ var init_claude_provider = __esm(async () => {
7677
7687
  });
7678
7688
 
7679
7689
  // ../../packages/core/src/version.ts
7680
- var NEGOTIUM_VERSION = "0.2.0";
7690
+ var NEGOTIUM_VERSION = "0.2.2";
7681
7691
 
7682
7692
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
7683
7693
  import { spawn as spawn6 } from "child_process";
@@ -19322,4 +19332,4 @@ export {
19322
19332
  createAgentHealthMcpServer
19323
19333
  };
19324
19334
 
19325
- //# debugId=BC238DE297D39F6964756E2164756E21
19335
+ //# debugId=37FBE4A6B405392964756E2164756E21