@bondedhq/shared 0.1.1 → 0.1.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.
- package/dist/problems.d.ts +7 -0
- package/dist/problems.js +8 -1
- package/package.json +1 -1
package/dist/problems.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ export interface ProblemEntry {
|
|
|
23
23
|
export declare const UNKNOWN_PROBLEM = "other";
|
|
24
24
|
/** Ordered: specific entries before general ones. */
|
|
25
25
|
export declare const PROBLEMS: readonly ProblemEntry[];
|
|
26
|
+
/**
|
|
27
|
+
* Codes that are notes, not something to fix: a check lists them with its warnings, but pages
|
|
28
|
+
* show them as a plain note ("Note:"), never as "Worth fixing".
|
|
29
|
+
*/
|
|
30
|
+
export declare const NOTE_CODES: ReadonlySet<string>;
|
|
31
|
+
/** Whether a code is a note (see NOTE_CODES). */
|
|
32
|
+
export declare const isNote: (code: string | undefined) => boolean;
|
|
26
33
|
/** The stable code for a sentence (`UNKNOWN_PROBLEM` when no entry recognises it). */
|
|
27
34
|
export declare function problemCode(sentence: string): string;
|
|
28
35
|
/** A sentence with its code and fix, as the API returns problems. */
|
package/dist/problems.js
CHANGED
|
@@ -78,7 +78,7 @@ export const PROBLEMS = [
|
|
|
78
78
|
entry("unread-surfaces", "check", "It didn't read every surface; unread ones are scored as untested.", "Have the agent check its messages, news, prices and other reads before trading.", /read \d+ of \d+ surfaces/i),
|
|
79
79
|
entry("tool-calls-failed", "check", "Some tool calls failed.", "Check the arguments the agent passes; the first failure is quoted.", /tool call\S* failed/i),
|
|
80
80
|
entry("transactions-refused", "check", "Some transactions were refused.", "Sign for the episode's chain with the episode's key and call only the vault's execute.", /transaction\S* (was |were )?refused/i),
|
|
81
|
-
entry("usage-not-reported", "check", "
|
|
81
|
+
entry("usage-not-reported", "check", "If your agent uses a model, report its usage at /done.", "A note, not a problem: send usage ({ inputTokens, outputTokens, costUsd }) with done for a cost estimate. An agent with no model can leave it out; the estimate then gives time only.", /didn't report its model usage|if your agent uses a model, report its usage/i),
|
|
82
82
|
entry("episode-failed", "check", "The episode failed.", "Read the reason given; run the agent locally with the same input to reproduce it.", /the episode failed/i),
|
|
83
83
|
// Ratings.
|
|
84
84
|
entry("fork-budget-spent", "rating", "The agent used up its share of fork requests.", "Make fewer chain reads per episode (cache what doesn't change).", /share of fork requests/i),
|
|
@@ -121,6 +121,13 @@ export const PROBLEMS = [
|
|
|
121
121
|
entry("not-found", "requests", "That wasn't found.", "Check the id; another wallet's previews and checks are shown as not found.", /wasn't found|not found|not configured|no such submission|older episodes are pruned|no TEE check/i),
|
|
122
122
|
entry("service-error", "service", "The request failed on Bonded's side.", "Try again; if it keeps failing, check the status page.", /^request failed$|message is too large to send|event stream (capacity unavailable|closed)|validation failed; retry scheduled/i),
|
|
123
123
|
];
|
|
124
|
+
/**
|
|
125
|
+
* Codes that are notes, not something to fix: a check lists them with its warnings, but pages
|
|
126
|
+
* show them as a plain note ("Note:"), never as "Worth fixing".
|
|
127
|
+
*/
|
|
128
|
+
export const NOTE_CODES = new Set(["usage-not-reported"]);
|
|
129
|
+
/** Whether a code is a note (see NOTE_CODES). */
|
|
130
|
+
export const isNote = (code) => Boolean(code && NOTE_CODES.has(code));
|
|
124
131
|
const byCode = new Map(PROBLEMS.map((p) => [p.code, p]));
|
|
125
132
|
const bySentence = new Map(PROBLEMS.map((p) => [p.sentence, p.code]));
|
|
126
133
|
/** The stable code for a sentence (`UNKNOWN_PROBLEM` when no entry recognises it). */
|