@atbash/sdk 0.13.2-dev.0 → 0.14.1-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
@@ -3954,13 +3954,24 @@ var Atbash = class _Atbash {
3954
3954
  return { allow: !this.failClosed, verdict: "ERROR", reason, toolCallId };
3955
3955
  }
3956
3956
  /* ── judgment status ───────────────────────────────────────────────────── */
3957
- async getJudgmentStatus(judgmentId, agentPubkey) {
3957
+ /**
3958
+ * Return the current status of a previously submitted judgment.
3959
+ *
3960
+ * `chainOpts` names which chain the judgment was signed against. The
3961
+ * server's GET /api/v1/judge routes to that chain when the SDK sends
3962
+ * a `brid` query param; without it, the server falls back to public.
3963
+ * Callers on the private chain must pass a `chainOpts` (or configure
3964
+ * the client on the private chain) — otherwise polling a POSTed
3965
+ * judgment on the private chain 404s at the server.
3966
+ */
3967
+ async getJudgmentStatus(judgmentId, agentPubkey, chainOpts) {
3958
3968
  const pk = agentPubkey ?? this.auth.pubkey;
3969
+ const brid = this.bridFromChainOpts(chainOpts);
3959
3970
  return this.track("getJudgmentStatus", pk, async () => {
3960
3971
  const resp = await this.http.get(
3961
3972
  "/api/v1/judge",
3962
- { tool_call_id: judgmentId, agent_pubkey: pk },
3963
- this.authHeaders(await this.defaultOrgBrid())
3973
+ { tool_call_id: judgmentId, agent_pubkey: pk, brid },
3974
+ this.authHeaders(brid)
3964
3975
  );
3965
3976
  await this.raiseIfError(resp);
3966
3977
  const data = await this.json(resp) ?? {};
@@ -43010,11 +43021,20 @@ async function rollbackMemory(toId, reason, auth, opts) {
43010
43021
  );
43011
43022
  }
43012
43023
 
43024
+ // src-ts/memory/_json_safe.ts
43025
+ function toJsonSafe(value) {
43026
+ try {
43027
+ return JSON.parse(JSON.stringify(value ?? null));
43028
+ } catch {
43029
+ return null;
43030
+ }
43031
+ }
43032
+
43013
43033
  // src-ts/memory/classifier.ts
43014
43034
  var DEFAULT_MEMORY_WRITE_TOOL_NAMES = native.defaultMemoryWriteToolNames();
43015
43035
  var DEFAULT_MEMORY_PATH_PATTERNS = native.defaultMemoryPathPatterns();
43016
43036
  function classifyMemoryWrite(event, ctx, opts = {}) {
43017
- return native.classifyMemoryWrite(event, ctx, {
43037
+ return native.classifyMemoryWrite(toJsonSafe(event), toJsonSafe(ctx), {
43018
43038
  patterns: opts.patterns ? [...opts.patterns] : void 0,
43019
43039
  toolNames: opts.toolNames ? [...opts.toolNames] : void 0
43020
43040
  });
@@ -43252,7 +43272,7 @@ function defaultPluginLogPath(workspaceDir = process.cwd()) {
43252
43272
  // src-ts/memory/read-classifier.ts
43253
43273
  var DEFAULT_MEMORY_READ_TOOL_NAMES = native.defaultMemoryReadToolNames();
43254
43274
  function classifyMemoryRead(event, ctx, opts = {}) {
43255
- return native.classifyMemoryRead(event, ctx, {
43275
+ return native.classifyMemoryRead(toJsonSafe(event), toJsonSafe(ctx), {
43256
43276
  readToolNames: opts.readToolNames ? [...opts.readToolNames] : void 0,
43257
43277
  patterns: opts.patterns ? [...opts.patterns] : void 0,
43258
43278
  genericReadToolNames: opts.genericReadToolNames ? [...opts.genericReadToolNames] : void 0