@atbash/sdk 0.13.3-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/README.md CHANGED
@@ -63,8 +63,8 @@ Two ways to create an agent:
63
63
 
64
64
  ```ts
65
65
  import { generateKeypair } from "@atbash/sdk";
66
- const { privKey, pubKey } = generateKeypair();
67
- console.log("Save this private key somewhere safe:", privKey);
66
+ const { priv_key, pub_key } = generateKeypair();
67
+ console.log("Save this private key somewhere safe:", priv_key);
68
68
  ```
69
69
 
70
70
  Paste the public key into the **Onboard agent** form on the dashboard, assign it to an org, and attach a policy pack before calling `judgeAction`.
@@ -564,7 +564,17 @@ declare class Atbash {
564
564
  */
565
565
  private failJudge;
566
566
  private fail;
567
- getJudgmentStatus(judgmentId: string, agentPubkey?: string): Promise<JudgmentStatus>;
567
+ /**
568
+ * Return the current status of a previously submitted judgment.
569
+ *
570
+ * `chainOpts` names which chain the judgment was signed against. The
571
+ * server's GET /api/v1/judge routes to that chain when the SDK sends
572
+ * a `brid` query param; without it, the server falls back to public.
573
+ * Callers on the private chain must pass a `chainOpts` (or configure
574
+ * the client on the private chain) — otherwise polling a POSTed
575
+ * judgment on the private chain 404s at the server.
576
+ */
577
+ getJudgmentStatus(judgmentId: string, agentPubkey?: string, chainOpts?: ChainOpts): Promise<JudgmentStatus>;
568
578
  getToolCalls(maxCount: number): Promise<ToolCallRecord[]>;
569
579
  getOrgToolCalls(orgName: string, maxCount: number): Promise<ToolCallRecord[]>;
570
580
  getAgentToolCalls(agentPubkey: string, maxCount: number): Promise<ToolCallRecord[]>;
package/dist/browser.mjs CHANGED
@@ -45182,13 +45182,24 @@ var Atbash = class _Atbash {
45182
45182
  return { allow: !this.failClosed, verdict: "ERROR", reason, toolCallId };
45183
45183
  }
45184
45184
  /* ── judgment status ───────────────────────────────────────────────────── */
45185
- async getJudgmentStatus(judgmentId, agentPubkey) {
45185
+ /**
45186
+ * Return the current status of a previously submitted judgment.
45187
+ *
45188
+ * `chainOpts` names which chain the judgment was signed against. The
45189
+ * server's GET /api/v1/judge routes to that chain when the SDK sends
45190
+ * a `brid` query param; without it, the server falls back to public.
45191
+ * Callers on the private chain must pass a `chainOpts` (or configure
45192
+ * the client on the private chain) — otherwise polling a POSTed
45193
+ * judgment on the private chain 404s at the server.
45194
+ */
45195
+ async getJudgmentStatus(judgmentId, agentPubkey, chainOpts) {
45186
45196
  const pk = agentPubkey ?? this.auth.pubkey;
45197
+ const brid = this.bridFromChainOpts(chainOpts);
45187
45198
  return this.track("getJudgmentStatus", pk, async () => {
45188
45199
  const resp = await this.http.get(
45189
45200
  "/api/v1/judge",
45190
- { tool_call_id: judgmentId, agent_pubkey: pk },
45191
- this.authHeaders(await this.defaultOrgBrid())
45201
+ { tool_call_id: judgmentId, agent_pubkey: pk, brid },
45202
+ this.authHeaders(brid)
45192
45203
  );
45193
45204
  await this.raiseIfError(resp);
45194
45205
  const data = await this.json(resp) ?? {};