@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/README.md +2 -2
- package/dist/browser.d.mts +11 -1
- package/dist/browser.mjs +14 -3
- package/dist/browser.mjs.map +1 -1
- package/dist/index.d.mts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +25 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
package/dist/index.d.mts
CHANGED
|
@@ -564,7 +564,17 @@ declare class Atbash {
|
|
|
564
564
|
*/
|
|
565
565
|
private failJudge;
|
|
566
566
|
private fail;
|
|
567
|
-
|
|
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/index.d.ts
CHANGED
|
@@ -564,7 +564,17 @@ declare class Atbash {
|
|
|
564
564
|
*/
|
|
565
565
|
private failJudge;
|
|
566
566
|
private fail;
|
|
567
|
-
|
|
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/index.js
CHANGED
|
@@ -4038,13 +4038,24 @@ var Atbash = class _Atbash {
|
|
|
4038
4038
|
return { allow: !this.failClosed, verdict: "ERROR", reason, toolCallId };
|
|
4039
4039
|
}
|
|
4040
4040
|
/* ── judgment status ───────────────────────────────────────────────────── */
|
|
4041
|
-
|
|
4041
|
+
/**
|
|
4042
|
+
* Return the current status of a previously submitted judgment.
|
|
4043
|
+
*
|
|
4044
|
+
* `chainOpts` names which chain the judgment was signed against. The
|
|
4045
|
+
* server's GET /api/v1/judge routes to that chain when the SDK sends
|
|
4046
|
+
* a `brid` query param; without it, the server falls back to public.
|
|
4047
|
+
* Callers on the private chain must pass a `chainOpts` (or configure
|
|
4048
|
+
* the client on the private chain) — otherwise polling a POSTed
|
|
4049
|
+
* judgment on the private chain 404s at the server.
|
|
4050
|
+
*/
|
|
4051
|
+
async getJudgmentStatus(judgmentId, agentPubkey, chainOpts) {
|
|
4042
4052
|
const pk = agentPubkey ?? this.auth.pubkey;
|
|
4053
|
+
const brid = this.bridFromChainOpts(chainOpts);
|
|
4043
4054
|
return this.track("getJudgmentStatus", pk, async () => {
|
|
4044
4055
|
const resp = await this.http.get(
|
|
4045
4056
|
"/api/v1/judge",
|
|
4046
|
-
{ tool_call_id: judgmentId, agent_pubkey: pk },
|
|
4047
|
-
this.authHeaders(
|
|
4057
|
+
{ tool_call_id: judgmentId, agent_pubkey: pk, brid },
|
|
4058
|
+
this.authHeaders(brid)
|
|
4048
4059
|
);
|
|
4049
4060
|
await this.raiseIfError(resp);
|
|
4050
4061
|
const data = await this.json(resp) ?? {};
|
|
@@ -43094,11 +43105,20 @@ async function rollbackMemory(toId, reason, auth, opts) {
|
|
|
43094
43105
|
);
|
|
43095
43106
|
}
|
|
43096
43107
|
|
|
43108
|
+
// src-ts/memory/_json_safe.ts
|
|
43109
|
+
function toJsonSafe(value) {
|
|
43110
|
+
try {
|
|
43111
|
+
return JSON.parse(JSON.stringify(value ?? null));
|
|
43112
|
+
} catch {
|
|
43113
|
+
return null;
|
|
43114
|
+
}
|
|
43115
|
+
}
|
|
43116
|
+
|
|
43097
43117
|
// src-ts/memory/classifier.ts
|
|
43098
43118
|
var DEFAULT_MEMORY_WRITE_TOOL_NAMES = native.defaultMemoryWriteToolNames();
|
|
43099
43119
|
var DEFAULT_MEMORY_PATH_PATTERNS = native.defaultMemoryPathPatterns();
|
|
43100
43120
|
function classifyMemoryWrite(event, ctx, opts = {}) {
|
|
43101
|
-
return native.classifyMemoryWrite(event, ctx, {
|
|
43121
|
+
return native.classifyMemoryWrite(toJsonSafe(event), toJsonSafe(ctx), {
|
|
43102
43122
|
patterns: opts.patterns ? [...opts.patterns] : void 0,
|
|
43103
43123
|
toolNames: opts.toolNames ? [...opts.toolNames] : void 0
|
|
43104
43124
|
});
|
|
@@ -43336,7 +43356,7 @@ function defaultPluginLogPath(workspaceDir = process.cwd()) {
|
|
|
43336
43356
|
// src-ts/memory/read-classifier.ts
|
|
43337
43357
|
var DEFAULT_MEMORY_READ_TOOL_NAMES = native.defaultMemoryReadToolNames();
|
|
43338
43358
|
function classifyMemoryRead(event, ctx, opts = {}) {
|
|
43339
|
-
return native.classifyMemoryRead(event, ctx, {
|
|
43359
|
+
return native.classifyMemoryRead(toJsonSafe(event), toJsonSafe(ctx), {
|
|
43340
43360
|
readToolNames: opts.readToolNames ? [...opts.readToolNames] : void 0,
|
|
43341
43361
|
patterns: opts.patterns ? [...opts.patterns] : void 0,
|
|
43342
43362
|
genericReadToolNames: opts.genericReadToolNames ? [...opts.genericReadToolNames] : void 0
|