@atbash/sdk 0.10.1-dev.0 → 0.10.5-dev.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.
package/dist/index.mjs CHANGED
@@ -2922,11 +2922,14 @@ function signEncryptedToolCall(toolCallId, action, context, toolName, toolArgsJs
2922
2922
  }
2923
2923
 
2924
2924
  // src-ts/endpoint.ts
2925
- var ALLOWED_JUDGE_HOSTS = /* @__PURE__ */ new Set([
2926
- "atbash.ai",
2927
- "www.atbash.ai",
2928
- "chromia-verified-ai-dev-two.vercel.app"
2929
- ]);
2925
+ function buildAllowedJudgeHosts() {
2926
+ return /* @__PURE__ */ new Set([
2927
+ "atbash.ai",
2928
+ "www.atbash.ai",
2929
+ new URL(DEFAULT_ENDPOINT).hostname.toLowerCase()
2930
+ ]);
2931
+ }
2932
+ var ALLOWED_JUDGE_HOSTS = buildAllowedJudgeHosts();
2930
2933
  function validateJudgeEndpoint(judge) {
2931
2934
  const policy = judge?.policy === "self-hosted" ? "self-hosted" : "default";
2932
2935
  const candidate = judge?.endpoint?.trim() || DEFAULT_ENDPOINT;
@@ -3288,6 +3291,8 @@ var Atbash = class _Atbash {
3288
3291
  orgEncryptionPubKey;
3289
3292
  /** When true (default), `auditToolCall` denies on any error. */
3290
3293
  failClosed;
3294
+ /** Org key learned from the last agent-exists check, for this agent only. */
3295
+ _orgKeyFromChain = null;
3291
3296
  logger;
3292
3297
  http;
3293
3298
  /**
@@ -3372,6 +3377,10 @@ var Atbash = class _Atbash {
3372
3377
  );
3373
3378
  await this.raiseIfError(resp);
3374
3379
  const data = await this.json(resp);
3380
+ if (pk === this.auth.pubkey) {
3381
+ const key3 = data?.org_encryption_pubkey;
3382
+ this._orgKeyFromChain = typeof key3 === "string" && key3 ? key3 : null;
3383
+ }
3375
3384
  return Boolean(data?.registered);
3376
3385
  });
3377
3386
  }
@@ -3402,7 +3411,7 @@ var Atbash = class _Atbash {
3402
3411
  }
3403
3412
  const toolCallId = generateToolCallId();
3404
3413
  const brid = this.bridFromChainOpts(options.chainOpts);
3405
- const orgKey = options.orgEncryptionPubKey ?? this.orgEncryptionPubKey;
3414
+ const orgKey = options.orgEncryptionPubKey ?? this.orgEncryptionPubKey ?? this._orgKeyFromChain;
3406
3415
  try {
3407
3416
  const signedHex = orgKey ? signEncryptedToolCall(
3408
3417
  toolCallId,
@@ -3488,6 +3497,7 @@ var Atbash = class _Atbash {
3488
3497
  if (context) body.context = context;
3489
3498
  if (options.provider) body.provider = options.provider;
3490
3499
  if (options.toolName) body.tool_name = options.toolName;
3500
+ if (options.toolArgsJson) body.tool_args_json = options.toolArgsJson;
3491
3501
  if (options.model) body.model = options.model;
3492
3502
  if (options.resolved) body.resolved = options.resolved;
3493
3503
  if (options.mode) body.mode = options.mode;
@@ -43050,6 +43060,7 @@ export {
43050
43060
  MemoryIntegrityError,
43051
43061
  PointerStore,
43052
43062
  SignatureVerificationError,
43063
+ buildAllowedJudgeHosts,
43053
43064
  claimHashHex,
43054
43065
  classifyMemoryRead,
43055
43066
  classifyMemoryWrite,