@sponsio/sdk 0.1.0-alpha.3 → 0.2.0-alpha.10
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/bin/sponsio.cjs +11 -0
- package/contracts/benchmark/agentdojo.yaml +551 -0
- package/contracts/benchmark/odcv_bench.yaml +393 -0
- package/contracts/benchmark/redcode_exec.yaml +488 -0
- package/contracts/benchmark/swebench.yaml +176 -0
- package/contracts/benchmark/tau2_bench.yaml +984 -0
- package/contracts/capability/credentials.yaml +8 -8
- package/contracts/capability/database.yaml +6 -6
- package/contracts/capability/destructive.yaml +213 -0
- package/contracts/capability/factual-claims.yaml +79 -0
- package/contracts/capability/filesystem-strict.yaml +4 -4
- package/contracts/capability/filesystem.yaml +9 -9
- package/contracts/capability/host-config-integrity.yaml +318 -0
- package/contracts/capability/self-modify.yaml +260 -9
- package/contracts/capability/shell.yaml +43 -41
- package/contracts/capability/subagent.yaml +5 -5
- package/contracts/incident/claude-code-secret-bypass.yaml +57 -26
- package/contracts/incident/cursor-railway-wipe.yaml +63 -7
- package/contracts/incident/mcp-composition.yaml +12 -12
- package/contracts/incident/openclaw.yaml +47 -92
- package/contracts/incident/subagent-escape.yaml +4 -4
- package/contracts/premium/.gitkeep +5 -6
- package/dist/cli/check.d.ts +2 -0
- package/dist/cli/check.d.ts.map +1 -0
- package/dist/cli/check.js +283 -0
- package/dist/cli/check.js.map +1 -0
- package/dist/cli/cli.d.ts +25 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +491 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/config.d.ts +88 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +243 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/demo.d.ts +12 -0
- package/dist/cli/demo.d.ts.map +1 -0
- package/dist/cli/demo.js +350 -0
- package/dist/cli/demo.js.map +1 -0
- package/dist/cli/doctor.d.ts +11 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +201 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/eval.d.ts +2 -0
- package/dist/cli/eval.d.ts.map +1 -0
- package/dist/cli/eval.js +361 -0
- package/dist/cli/eval.js.map +1 -0
- package/dist/cli/explain.d.ts +2 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +266 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/export-sessions.d.ts +2 -0
- package/dist/cli/export-sessions.d.ts.map +1 -0
- package/dist/cli/export-sessions.js +182 -0
- package/dist/cli/export-sessions.js.map +1 -0
- package/dist/cli/export.d.ts +2 -0
- package/dist/cli/export.d.ts.map +1 -0
- package/dist/cli/export.js +222 -0
- package/dist/cli/export.js.map +1 -0
- package/dist/cli/extractors/common.d.ts +27 -0
- package/dist/cli/extractors/common.d.ts.map +1 -0
- package/dist/cli/extractors/common.js +107 -0
- package/dist/cli/extractors/common.js.map +1 -0
- package/dist/cli/extractors/generic.d.ts +37 -0
- package/dist/cli/extractors/generic.d.ts.map +1 -0
- package/dist/cli/extractors/generic.js +185 -0
- package/dist/cli/extractors/generic.js.map +1 -0
- package/dist/cli/extractors/langchain.d.ts +18 -0
- package/dist/cli/extractors/langchain.d.ts.map +1 -0
- package/dist/cli/extractors/langchain.js +86 -0
- package/dist/cli/extractors/langchain.js.map +1 -0
- package/dist/cli/extractors/vercel.d.ts +17 -0
- package/dist/cli/extractors/vercel.d.ts.map +1 -0
- package/dist/cli/extractors/vercel.js +46 -0
- package/dist/cli/extractors/vercel.js.map +1 -0
- package/dist/cli/index.d.ts +38 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +146 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +2 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +177 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/mode.d.ts +2 -0
- package/dist/cli/mode.d.ts.map +1 -0
- package/dist/cli/mode.js +71 -0
- package/dist/cli/mode.js.map +1 -0
- package/dist/cli/onboard.d.ts +88 -0
- package/dist/cli/onboard.d.ts.map +1 -0
- package/dist/cli/onboard.js +758 -0
- package/dist/cli/onboard.js.map +1 -0
- package/dist/cli/otlp.d.ts +27 -0
- package/dist/cli/otlp.d.ts.map +1 -0
- package/dist/cli/otlp.js +79 -0
- package/dist/cli/otlp.js.map +1 -0
- package/dist/cli/package.json +1 -0
- package/dist/cli/packs.d.ts +16 -0
- package/dist/cli/packs.d.ts.map +1 -0
- package/dist/cli/packs.js +190 -0
- package/dist/cli/packs.js.map +1 -0
- package/dist/cli/patterns.d.ts +16 -0
- package/dist/cli/patterns.d.ts.map +1 -0
- package/dist/cli/patterns.js +136 -0
- package/dist/cli/patterns.js.map +1 -0
- package/dist/cli/prompt.d.ts +2 -0
- package/dist/cli/prompt.d.ts.map +1 -0
- package/dist/cli/prompt.js +54 -0
- package/dist/cli/prompt.js.map +1 -0
- package/dist/cli/replay.d.ts +2 -0
- package/dist/cli/replay.d.ts.map +1 -0
- package/dist/cli/replay.js +196 -0
- package/dist/cli/replay.js.map +1 -0
- package/dist/cli/report.d.ts +57 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +298 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/scan.d.ts +2 -0
- package/dist/cli/scan.d.ts.map +1 -0
- package/dist/cli/scan.js +172 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/skill.d.ts +15 -0
- package/dist/cli/skill.d.ts.map +1 -0
- package/dist/cli/skill.js +131 -0
- package/dist/cli/skill.js.map +1 -0
- package/dist/cli/tokens.d.ts +31 -0
- package/dist/cli/tokens.d.ts.map +1 -0
- package/dist/cli/tokens.js +73 -0
- package/dist/cli/tokens.js.map +1 -0
- package/dist/cli/types.d.ts +46 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +3 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/validate.d.ts +19 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +205 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/zod.d.ts +36 -0
- package/dist/cli/zod.d.ts.map +1 -0
- package/dist/cli/zod.js +226 -0
- package/dist/cli/zod.js.map +1 -0
- package/dist/cloud/client.d.ts +76 -0
- package/dist/cloud/client.d.ts.map +1 -0
- package/dist/cloud/client.js +204 -0
- package/dist/cloud/client.js.map +1 -0
- package/dist/cloud/evidence.d.ts +108 -0
- package/dist/cloud/evidence.d.ts.map +1 -0
- package/dist/cloud/evidence.js +184 -0
- package/dist/cloud/evidence.js.map +1 -0
- package/dist/cloud/privacy.d.ts +67 -0
- package/dist/cloud/privacy.d.ts.map +1 -0
- package/dist/cloud/privacy.js +170 -0
- package/dist/cloud/privacy.js.map +1 -0
- package/dist/cloud/view-model.d.ts +49 -0
- package/dist/cloud/view-model.d.ts.map +1 -0
- package/dist/cloud/view-model.js +172 -0
- package/dist/cloud/view-model.js.map +1 -0
- package/dist/contract.d.ts +13 -13
- package/dist/contract.d.ts.map +1 -1
- package/dist/contract.js +21 -21
- package/dist/contract.js.map +1 -1
- package/dist/core/config-loader.d.ts +1 -1
- package/dist/core/config-loader.d.ts.map +1 -1
- package/dist/core/config-loader.js +116 -26
- package/dist/core/config-loader.js.map +1 -1
- package/dist/core/evaluator.d.ts +11 -1
- package/dist/core/evaluator.d.ts.map +1 -1
- package/dist/core/evaluator.js +275 -13
- package/dist/core/evaluator.js.map +1 -1
- package/dist/core/formula.d.ts +76 -17
- package/dist/core/formula.d.ts.map +1 -1
- package/dist/core/formula.js +95 -1
- package/dist/core/formula.js.map +1 -1
- package/dist/core/grounding.d.ts +86 -3
- package/dist/core/grounding.d.ts.map +1 -1
- package/dist/core/grounding.js +485 -143
- package/dist/core/grounding.js.map +1 -1
- package/dist/core/nl-parser.d.ts +2 -2
- package/dist/core/nl-parser.d.ts.map +1 -1
- package/dist/core/nl-parser.js +690 -42
- package/dist/core/nl-parser.js.map +1 -1
- package/dist/core/pack-loader.d.ts.map +1 -1
- package/dist/core/pack-loader.js +14 -2
- package/dist/core/pack-loader.js.map +1 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +30 -1
- package/dist/core/parser.js.map +1 -1
- package/dist/core/pattern-factory.d.ts +4 -4
- package/dist/core/pattern-factory.d.ts.map +1 -1
- package/dist/core/pattern-factory.js +59 -4
- package/dist/core/pattern-factory.js.map +1 -1
- package/dist/core/patterns.d.ts +196 -5
- package/dist/core/patterns.d.ts.map +1 -1
- package/dist/core/patterns.js +400 -13
- package/dist/core/patterns.js.map +1 -1
- package/dist/core/session-log.d.ts.map +1 -1
- package/dist/core/session-log.js +20 -1
- package/dist/core/session-log.js.map +1 -1
- package/dist/core/spans.d.ts +1 -1
- package/dist/core/spans.d.ts.map +1 -1
- package/dist/core/spans.js.map +1 -1
- package/dist/core/sto.d.ts +30 -66
- package/dist/core/sto.d.ts.map +1 -1
- package/dist/core/sto.js +39 -100
- package/dist/core/sto.js.map +1 -1
- package/dist/core/tool-names.d.ts +59 -0
- package/dist/core/tool-names.d.ts.map +1 -0
- package/dist/core/tool-names.js +128 -0
- package/dist/core/tool-names.js.map +1 -0
- package/dist/index.d.ts +227 -33
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +539 -152
- package/dist/index.js.map +1 -1
- package/dist/integrations/claude-agent.d.ts +5 -0
- package/dist/integrations/claude-agent.d.ts.map +1 -1
- package/dist/integrations/claude-agent.js +42 -13
- package/dist/integrations/claude-agent.js.map +1 -1
- package/dist/integrations/google-adk.d.ts +5 -3
- package/dist/integrations/google-adk.d.ts.map +1 -1
- package/dist/integrations/google-adk.js +9 -5
- package/dist/integrations/google-adk.js.map +1 -1
- package/dist/integrations/langchain.d.ts +7 -0
- package/dist/integrations/langchain.d.ts.map +1 -1
- package/dist/integrations/langchain.js +21 -3
- package/dist/integrations/langchain.js.map +1 -1
- package/dist/integrations/openai-agents.d.ts +22 -10
- package/dist/integrations/openai-agents.d.ts.map +1 -1
- package/dist/integrations/openai-agents.js +57 -16
- package/dist/integrations/openai-agents.js.map +1 -1
- package/dist/integrations/openai.d.ts +11 -0
- package/dist/integrations/openai.d.ts.map +1 -1
- package/dist/integrations/openai.js +130 -48
- package/dist/integrations/openai.js.map +1 -1
- package/dist/integrations/vercel-ai.d.ts +20 -9
- package/dist/integrations/vercel-ai.d.ts.map +1 -1
- package/dist/integrations/vercel-ai.js +131 -32
- package/dist/integrations/vercel-ai.js.map +1 -1
- package/dist/render/tokens.d.ts.map +1 -1
- package/dist/render/tokens.js +1 -0
- package/dist/render/tokens.js.map +1 -1
- package/package.json +41 -9
- package/prompts/onboard.md +259 -0
- package/prompts/scan.md +123 -0
- package/skills/SKILL.md +432 -0
- package/contracts/core/llm_safety.yaml +0 -130
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One canonical spelling for a tool name, shared by contracts and grounding.
|
|
3
|
+
*
|
|
4
|
+
* Port of sponsio/formulas/tool_names.py.
|
|
5
|
+
*
|
|
6
|
+
* Predicate keys are map keys: ``called(issue_refund)`` and
|
|
7
|
+
* ``called(Issue_Refund)`` are different entries, and a contract looks up
|
|
8
|
+
* the spelling its author typed. So a rule written against ``issue_refund``
|
|
9
|
+
* was silently inert against an event whose tool arrived as
|
|
10
|
+
* ``Issue_Refund``, as ``"issue_refund "`` with a stray space, or as
|
|
11
|
+
* ``mcp__finance__issue_refund`` (our own documented MCP wire format).
|
|
12
|
+
* ``mustPrecede`` compiles to ``Or(order-holds, never-called)``, so a name
|
|
13
|
+
* that never matches makes the second disjunct true and the contract
|
|
14
|
+
* reports satisfied while the guarded action runs unchecked.
|
|
15
|
+
*
|
|
16
|
+
* Two functions, used on opposite sides of the same join:
|
|
17
|
+
*
|
|
18
|
+
* - {@link canonicalTool}: what a *contract* keys on. Contracts are
|
|
19
|
+
* authored once, so they collapse to a single canonical spelling.
|
|
20
|
+
* - {@link toolAliases}: what an *event* answers to. A tool call is a fact
|
|
21
|
+
* and cannot be rewritten, so it is grounded under every spelling a
|
|
22
|
+
* contract might reasonably have used, canonical form included.
|
|
23
|
+
*
|
|
24
|
+
* Widening only ever makes more contracts apply to a given call, never
|
|
25
|
+
* fewer.
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* Claude Code / MCP wire format: ``mcp__<server>__<tool>``, prefix in any
|
|
29
|
+
* case (``MCP__finance__x`` is the same call). The server segment has no
|
|
30
|
+
* ``__`` of its own; the tool segment may, so the split is on the FIRST
|
|
31
|
+
* ``__`` after the prefix. ``[^\n]`` rather than ``.`` because
|
|
32
|
+
* Python's ``.`` excludes only ``\n`` while JavaScript's also excludes
|
|
33
|
+
* ``\r`` and U+2028/2029.
|
|
34
|
+
*/
|
|
35
|
+
export const MCP_TOOL_RE = /^mcp__([^_]+(?:_[^_]+)*)__([^\n]+)$/i;
|
|
36
|
+
/**
|
|
37
|
+
* OpenClaw's MCP wire format: ``<server>__<tool>`` with no ``mcp__``
|
|
38
|
+
* prefix. Same split; consulted only when {@link MCP_TOOL_RE} did not
|
|
39
|
+
* match, so the ``mcp`` of a prefixed name is never read as a server.
|
|
40
|
+
*/
|
|
41
|
+
export const SERVER_TOOL_RE = /^([^_]+(?:_[^_]+)*)__([^\n]+)$/;
|
|
42
|
+
/**
|
|
43
|
+
* Python ``str.strip()`` whitespace (``str.isspace``). Differs from
|
|
44
|
+
* ``String.prototype.trim`` on U+001C-001F and U+0085 (Python strips,
|
|
45
|
+
* JavaScript keeps) and U+FEFF (JavaScript strips, Python keeps).
|
|
46
|
+
*/
|
|
47
|
+
const PY_WS = "\\t\\n\\v\\f\\r\\x1c-\\x20\\x85\\xa0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000";
|
|
48
|
+
const PY_STRIP_RE = new RegExp(`^[${PY_WS}]+|[${PY_WS}]+$`, "g");
|
|
49
|
+
function pyStrip(s) {
|
|
50
|
+
return s.replace(PY_STRIP_RE, "");
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Python ``str.casefold()``, per code point.
|
|
54
|
+
*
|
|
55
|
+
* Lower-casing alone misses the full case folds (``ß`` -> ``ss``,
|
|
56
|
+
* ``ſ`` -> ``s``, final sigma -> ``σ``, ``µ`` -> ``μ``); folding through
|
|
57
|
+
* the upper case catches those. Two families need explicit handling:
|
|
58
|
+
* dotless ``ı`` has no fold in Python but upper-cases to ``I``, and
|
|
59
|
+
* Unicode folds lower-case Cherokee *to* the upper-case letters. Code
|
|
60
|
+
* points added in a Unicode version one runtime knows and the other does
|
|
61
|
+
* not can still differ; tool names are ASCII in practice.
|
|
62
|
+
*/
|
|
63
|
+
function pyCasefold(s) {
|
|
64
|
+
let out = "";
|
|
65
|
+
for (const ch of s) {
|
|
66
|
+
const cp = ch.codePointAt(0);
|
|
67
|
+
if (cp < 0x80) {
|
|
68
|
+
out += ch.toLowerCase();
|
|
69
|
+
}
|
|
70
|
+
else if (cp === 0x131) {
|
|
71
|
+
out += ch;
|
|
72
|
+
}
|
|
73
|
+
else if (cp >= 0xab70 && cp <= 0xabbf) {
|
|
74
|
+
out += String.fromCodePoint(cp - 0xab70 + 0x13a0);
|
|
75
|
+
}
|
|
76
|
+
else if (cp >= 0x13f8 && cp <= 0x13fd) {
|
|
77
|
+
out += String.fromCodePoint(cp - 8);
|
|
78
|
+
}
|
|
79
|
+
else if (cp >= 0x13a0 && cp <= 0x13f5) {
|
|
80
|
+
out += ch;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const lower = ch.toLowerCase();
|
|
84
|
+
const upper = lower.toUpperCase();
|
|
85
|
+
out += upper !== lower ? upper.toLowerCase() : lower;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
/** ``mcp__finance__issue_refund`` -> ``issue_refund``; else ``null``. */
|
|
91
|
+
function stripMcp(name) {
|
|
92
|
+
const m = MCP_TOOL_RE.exec(name);
|
|
93
|
+
return m ? m[2] : null;
|
|
94
|
+
}
|
|
95
|
+
/** ``finance__issue_refund`` -> ``issue_refund``; else ``null``. */
|
|
96
|
+
function stripServer(name) {
|
|
97
|
+
const m = SERVER_TOOL_RE.exec(name);
|
|
98
|
+
return m ? m[2] : null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The single spelling a contract keys on.
|
|
102
|
+
*
|
|
103
|
+
* Strips surrounding whitespace and case-folds. The MCP prefix is *not*
|
|
104
|
+
* stripped here: a contract that deliberately names
|
|
105
|
+
* ``mcp__finance__issue_refund`` means that server's tool and should not
|
|
106
|
+
* widen to every tool of that name. Grounding supplies the bare-name
|
|
107
|
+
* alias so the reverse direction still joins.
|
|
108
|
+
*/
|
|
109
|
+
export function canonicalTool(tool) {
|
|
110
|
+
return pyCasefold(pyStrip(String(tool)));
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Every spelling an event's tool call should answer to.
|
|
114
|
+
*
|
|
115
|
+
* Ordered, duplicate-free, and always contains the raw name first so
|
|
116
|
+
* existing traces and predicate keys keep working unchanged.
|
|
117
|
+
*/
|
|
118
|
+
export function toolAliases(tool) {
|
|
119
|
+
const raw = String(tool);
|
|
120
|
+
const out = [raw];
|
|
121
|
+
const stripped = pyStrip(raw);
|
|
122
|
+
out.push(stripped, pyCasefold(stripped));
|
|
123
|
+
const bare = stripMcp(stripped) ?? stripServer(stripped);
|
|
124
|
+
if (bare)
|
|
125
|
+
out.push(bare, pyCasefold(bare));
|
|
126
|
+
return [...new Set(out)].filter((k) => k);
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=tool-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-names.js","sourceRoot":"","sources":["../../src/core/tool-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,W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AC,IAAI,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,8 +20,9 @@
|
|
|
20
20
|
* if (result.blocked) { ... }
|
|
21
21
|
*/
|
|
22
22
|
import { AgentTurnSpan } from "./core/spans.js";
|
|
23
|
+
import { CloudClient } from "./cloud/client.js";
|
|
23
24
|
import type { DetFormula } from "./core/patterns.js";
|
|
24
|
-
import {
|
|
25
|
+
import type { JudgeClient, JudgeConfig, StoContextSnapshot } from "./core/sto.js";
|
|
25
26
|
export { evaluate } from "./core/evaluator.js";
|
|
26
27
|
export type { Valuation } from "./core/evaluator.js";
|
|
27
28
|
export * from "./core/formula.js";
|
|
@@ -34,7 +35,13 @@ export type { LoadedConfig, SkippedItem } from "./core/config-loader.js";
|
|
|
34
35
|
export { SessionLogger, rotateSessions } from "./core/session-log.js";
|
|
35
36
|
export type { SessionRecord, SessionLoggerOptions, } from "./core/session-log.js";
|
|
36
37
|
export { contract, ContractBuilder } from "./contract.js";
|
|
37
|
-
export {
|
|
38
|
+
export { parseScore, CloudFeatureError } from "./core/sto.js";
|
|
39
|
+
export { CloudClient, CloudError, readApiKey, readProject, baseUrl, } from "./cloud/client.js";
|
|
40
|
+
export type { PulledRulebook, CloudClientOptions } from "./cloud/client.js";
|
|
41
|
+
export { LEVELS as PRIVACY_LEVELS } from "./cloud/privacy.js";
|
|
42
|
+
export type { PrivacyLevel } from "./cloud/privacy.js";
|
|
43
|
+
export { buildViewModel, newSessionId } from "./cloud/view-model.js";
|
|
44
|
+
export type { RunSpan, ViewModelInput } from "./cloud/view-model.js";
|
|
38
45
|
export type { StoEvaluator, StoContract, StoInput, StoResult, StoContextSnapshot, JudgeClient, JudgeConfig, } from "./core/sto.js";
|
|
39
46
|
/**
|
|
40
47
|
* One det violation, with enough structure to feed into downstream
|
|
@@ -61,9 +68,28 @@ export type { StoEvaluator, StoContract, StoInput, StoResult, StoContextSnapshot
|
|
|
61
68
|
* - ``alternatives`` is an optional list of suggested replacement
|
|
62
69
|
* actions for blocked / redirected outcomes.
|
|
63
70
|
*/
|
|
71
|
+
/**
|
|
72
|
+
* What the runtime did about one violation, mirroring Python's
|
|
73
|
+
* ``DetViolation.action``. Every derived verdict property reads this
|
|
74
|
+
* rather than a separate boolean, so a new outcome cannot be added
|
|
75
|
+
* without every consumer seeing it.
|
|
76
|
+
*
|
|
77
|
+
* ``blocked`` and ``redirected`` both stop the original call and are the
|
|
78
|
+
* members of the stopping set; ``escalated`` hands the decision to a
|
|
79
|
+
* human without stopping, and ``observed`` / ``warned`` record only.
|
|
80
|
+
*/
|
|
81
|
+
export type DetAction = "blocked" | "redirected" | "escalated" | "observed" | "warned";
|
|
82
|
+
/** Actions after which the original tool call must NOT run. */
|
|
83
|
+
export declare const STOPPING_ACTIONS: ReadonlySet<DetAction>;
|
|
84
|
+
/** Parity with Python's ``is_stopping_action``. */
|
|
85
|
+
export declare function isStoppingAction(action: DetAction): boolean;
|
|
64
86
|
export interface DetViolation {
|
|
65
87
|
/** Human-readable contract description (``DetFormula.desc``). */
|
|
66
88
|
desc: string;
|
|
89
|
+
/** What the runtime did. Absent on rows written before this field existed. */
|
|
90
|
+
action?: DetAction;
|
|
91
|
+
/** The tool to call instead, set when ``action`` is ``redirected``. */
|
|
92
|
+
redirectedTo?: string;
|
|
67
93
|
/** Formatted ``"[WOULD-]BLOCKED: agent.tool — det constraint …"``. */
|
|
68
94
|
message: string;
|
|
69
95
|
/** Stable rule identifier (pattern name / contract id). */
|
|
@@ -98,13 +124,49 @@ export interface CheckResult {
|
|
|
98
124
|
*/
|
|
99
125
|
detViolations: DetViolation[];
|
|
100
126
|
/**
|
|
101
|
-
* Sto-pipeline violations
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
127
|
+
* Sto-pipeline violations. Not part of this build (the engine is
|
|
128
|
+
* deterministic-only). Always ``[]`` on the TS SDK (the ctor
|
|
129
|
+
* rejects yaml sto contracts at load time and never builds a
|
|
130
|
+
* judge). External subclasses can populate this with results from
|
|
131
|
+
* stochastic contracts (``tone`` / ``llm_judge`` / ``injection_free``
|
|
132
|
+
* / ...). Kept on the schema so dashboards / session loggers branch
|
|
133
|
+
* consistently across both surfaces.
|
|
105
134
|
*/
|
|
106
135
|
stoViolations: DetViolation[];
|
|
136
|
+
/** True when any violation returned an escalate outcome. */
|
|
137
|
+
escalated: boolean;
|
|
138
|
+
/** True when any violation returned a redirect outcome. */
|
|
139
|
+
redirected: boolean;
|
|
140
|
+
/** The substitute tool named by the first redirect, if any. */
|
|
141
|
+
redirectedTo?: string;
|
|
142
|
+
/**
|
|
143
|
+
* True when the original tool call must NOT run.
|
|
144
|
+
*
|
|
145
|
+
* **This is the gate an adapter branches on, not `blocked`.** A
|
|
146
|
+
* redirect leaves `blocked` false and `allowed` true, because the
|
|
147
|
+
* agent flow continues down the safe path; a caller reading `blocked`
|
|
148
|
+
* would run the exact call the contract forbade. Adapters that can
|
|
149
|
+
* substitute should branch on `redirected` / `redirectedTo` first and
|
|
150
|
+
* dispatch the safe tool; those that cannot must gate on this, so a
|
|
151
|
+
* redirect fails closed.
|
|
152
|
+
*/
|
|
153
|
+
stopOriginal: boolean;
|
|
154
|
+
/** Det and sto violations together, in that order. */
|
|
155
|
+
allViolations: DetViolation[];
|
|
156
|
+
/**
|
|
157
|
+
* True if any sto violation asked for a retry. Always false in this
|
|
158
|
+
* build: the engine is deterministic-only and `stoViolations` is
|
|
159
|
+
* always empty. Present so an adapter written against one runtime
|
|
160
|
+
* reads the same on the other.
|
|
161
|
+
*/
|
|
162
|
+
needsRetry: boolean;
|
|
107
163
|
}
|
|
164
|
+
/**
|
|
165
|
+
* Fill the derived half of a verdict from the violations' actions. One
|
|
166
|
+
* place, so a new `DetAction` cannot be handled inconsistently across
|
|
167
|
+
* the several sites that build a `CheckResult`.
|
|
168
|
+
*/
|
|
169
|
+
export declare function deriveVerdict(detViolations: DetViolation[], stoViolations?: DetViolation[]): Pick<CheckResult, "blocked" | "escalated" | "redirected" | "redirectedTo" | "stopOriginal" | "allViolations" | "needsRetry">;
|
|
108
170
|
export type SponsoMode = "enforce" | "observe";
|
|
109
171
|
export interface SponsoOptions {
|
|
110
172
|
/** Logical agent id — used for session log paths. */
|
|
@@ -128,7 +190,11 @@ export interface SponsoOptions {
|
|
|
128
190
|
/**
|
|
129
191
|
* Runtime mode. Precedence (matches the Python SDK):
|
|
130
192
|
*
|
|
131
|
-
* SPONSIO_MODE env > ctor arg > yaml runtime.mode
|
|
193
|
+
* SPONSIO_MODE env > ctor arg > yaml runtime.mode
|
|
194
|
+
* > yaml defaults.mode > yaml top-level mode: > "observe"
|
|
195
|
+
*
|
|
196
|
+
* A contract may also carry its own `mode:` in yaml, which overrides
|
|
197
|
+
* whatever the global resolution lands on — for that contract alone.
|
|
132
198
|
*
|
|
133
199
|
* ``observe`` (the default) logs every would-have-blocked decision
|
|
134
200
|
* to ``~/.sponsio/sessions/<agent_id>/*.jsonl`` without actually
|
|
@@ -146,11 +212,13 @@ export interface SponsoOptions {
|
|
|
146
212
|
/** Override session log base dir (tests / alternative layouts). */
|
|
147
213
|
sessionLogBaseDir?: string;
|
|
148
214
|
/**
|
|
149
|
-
* Judge config for the sto pipeline.
|
|
150
|
-
* (
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
215
|
+
* Judge config for the sto pipeline. **Not supported in this build**
|
|
216
|
+
* (the engine is deterministic-only). Either a plain config object
|
|
217
|
+
* (provider / model / apiKey / baseUrl / fallbackMode) or a pre-built
|
|
218
|
+
* ``JudgeClient``. The TS SDK accepts the option for shared-yaml
|
|
219
|
+
* compatibility but never constructs a judge: passing this surfaces
|
|
220
|
+
* a warning via the skipped-items path and the field is otherwise
|
|
221
|
+
* ignored.
|
|
154
222
|
*/
|
|
155
223
|
judge?: JudgeConfig | JudgeClient;
|
|
156
224
|
}
|
|
@@ -159,8 +227,6 @@ export declare class Sponsio {
|
|
|
159
227
|
readonly mode: SponsoMode;
|
|
160
228
|
private _contracts;
|
|
161
229
|
private _stoContracts;
|
|
162
|
-
private _judge;
|
|
163
|
-
private _judgeFallback;
|
|
164
230
|
private _stoContext;
|
|
165
231
|
private _trace;
|
|
166
232
|
private _state;
|
|
@@ -168,7 +234,45 @@ export declare class Sponsio {
|
|
|
168
234
|
private _violations;
|
|
169
235
|
private _logger;
|
|
170
236
|
private _turnSpans;
|
|
237
|
+
private _runSpans;
|
|
238
|
+
private _sessionId;
|
|
239
|
+
private _startedAt;
|
|
240
|
+
private _rulebookStamp;
|
|
171
241
|
constructor(options?: SponsoOptions);
|
|
242
|
+
/**
|
|
243
|
+
* Predicates whose truth depends on the *contents* of a tool call's
|
|
244
|
+
* arguments. If a call arrives with no arguments, none of these keys is
|
|
245
|
+
* written and the evaluator reads a missing key as false, which makes
|
|
246
|
+
* ``argBlacklist`` (``!arg_field_has(...)``) report "satisfied" for a
|
|
247
|
+
* call nothing looked at. Mirrors Python's
|
|
248
|
+
* ``BaseGuard._ARG_SHAPED_PREDICATES``.
|
|
249
|
+
*/
|
|
250
|
+
private static readonly ARG_SHAPED_PREDICATES;
|
|
251
|
+
/** Canonical names of the tools some contract reads the arguments of. */
|
|
252
|
+
private _toolsNeedingArgs;
|
|
253
|
+
/** ``[tool, field]`` pairs some ``arg_numeric`` rule reads. */
|
|
254
|
+
private _numericRuleTargets;
|
|
255
|
+
/**
|
|
256
|
+
* Refuse a call whose argument rules cannot be evaluated.
|
|
257
|
+
*
|
|
258
|
+
* Two cases, both of which used to read as "not violated":
|
|
259
|
+
*
|
|
260
|
+
* - The call arrived with no arguments (``{}``, ``undefined``, ``null``)
|
|
261
|
+
* but some rule reads this tool's arguments. An adapter that loses the
|
|
262
|
+
* arguments, a partial streamed call or a malformed payload all land
|
|
263
|
+
* here, and every argument check would pass vacuously.
|
|
264
|
+
* - A field an ``arg_numeric`` rule bounds is present but is not a
|
|
265
|
+
* number (``"five thousand"``). Grounding leaves ``arg_numeric`` unset
|
|
266
|
+
* and the evaluator reads the gap as 0, which passes every upper
|
|
267
|
+
* bound. An absent field is left alone: CLI-flag and positional rules
|
|
268
|
+
* on ``Bash`` legitimately see calls without their flag.
|
|
269
|
+
*
|
|
270
|
+
* ``SPONSIO_ALLOW_MISSING_ARGS=1`` restores the permissive behaviour.
|
|
271
|
+
* Mirrors Python ``BaseGuard._args_unevaluable`` and
|
|
272
|
+
* ``_unreadable_numeric_arg``; both block under rule id
|
|
273
|
+
* ``args:unevaluable``.
|
|
274
|
+
*/
|
|
275
|
+
private _unevaluableArgs;
|
|
172
276
|
/**
|
|
173
277
|
* Check a tool call against contracts before execution.
|
|
174
278
|
*
|
|
@@ -195,6 +299,28 @@ export declare class Sponsio {
|
|
|
195
299
|
turnSpans(): AgentTurnSpan[];
|
|
196
300
|
/** Drop accumulated turn spans (used between sessions in tests). */
|
|
197
301
|
resetSession(): void;
|
|
302
|
+
/**
|
|
303
|
+
* This run, in the shape the cloud stores.
|
|
304
|
+
*
|
|
305
|
+
* Exposed so a caller can see exactly what would be uploaded before
|
|
306
|
+
* uploading anything, which is the question a customer under a data
|
|
307
|
+
* agreement asks first.
|
|
308
|
+
*/
|
|
309
|
+
viewModel(): Record<string, unknown>;
|
|
310
|
+
/**
|
|
311
|
+
* Upload this run.
|
|
312
|
+
*
|
|
313
|
+
* Best-effort by construction: it resolves false rather than throwing,
|
|
314
|
+
* because losing telemetry must never change what an agent does, and a
|
|
315
|
+
* rejected upload at the end of a run is not a reason to fail the run.
|
|
316
|
+
* Silent only about the network; a misconfiguration is worth saying
|
|
317
|
+
* once, since the symptom otherwise is a customer with no runs and no
|
|
318
|
+
* explanation.
|
|
319
|
+
*/
|
|
320
|
+
uploadSession(opts?: {
|
|
321
|
+
project?: string | null;
|
|
322
|
+
client?: CloudClient;
|
|
323
|
+
}): Promise<boolean>;
|
|
198
324
|
/**
|
|
199
325
|
* Render the end-of-session view to ``out`` (defaults to stderr) —
|
|
200
326
|
* banner, contracts armed, trace tree, verdict, perf, CTA. Mirrors
|
|
@@ -212,35 +338,103 @@ export declare class Sponsio {
|
|
|
212
338
|
}): void;
|
|
213
339
|
/** Deep-copy the grounding state so it can be restored on a blocked call. */
|
|
214
340
|
private _snapshotState;
|
|
341
|
+
/**
|
|
342
|
+
* Push external facts into the grounding context. Mirrors Python's
|
|
343
|
+
* ``BaseGuard.observe_context`` — every subsequent event sees the
|
|
344
|
+
* keys as ``ctx(k, v)`` atoms, so contracts like
|
|
345
|
+
* ``ctx_required("wire", "caller_id", ["alice"])`` can fire.
|
|
346
|
+
*
|
|
347
|
+
* Emits a synthetic ``context_update`` event into the trace so
|
|
348
|
+
* patterns that anchor on the moment a fact was set (notably
|
|
349
|
+
* ``time_since(ctx(approval.role, alice))``) start their clock here.
|
|
350
|
+
*/
|
|
351
|
+
observeContext(ctx: Record<string, unknown>): void;
|
|
352
|
+
/**
|
|
353
|
+
* Convenience helper for the approval-active gate: pushes
|
|
354
|
+
* ``approval.role`` / ``approval.decision`` (+ optional ``approver``
|
|
355
|
+
* / ``reason``) via ``observeContext``. Pairs with the
|
|
356
|
+
* ``approval_active`` pattern.
|
|
357
|
+
*/
|
|
358
|
+
observeApproval(opts: {
|
|
359
|
+
role: string;
|
|
360
|
+
decision?: "allow" | "deny";
|
|
361
|
+
approver?: string;
|
|
362
|
+
reason?: string;
|
|
363
|
+
}): void;
|
|
364
|
+
/**
|
|
365
|
+
* Record an LLM response into the trace. Drives ``max_length``,
|
|
366
|
+
* ``no_pii``, ``no_keywords`` (any pattern that grounds against
|
|
367
|
+
* ``llm_said`` / ``response_words`` / ``response_chars``). Mirrors
|
|
368
|
+
* the Python ``llm_response`` event path.
|
|
369
|
+
*
|
|
370
|
+
* Returns a ``CheckResult`` so callers can branch on observe-mode
|
|
371
|
+
* violations the same way they branch on ``guardBefore``. In
|
|
372
|
+
* enforce mode, ``blocked: true`` rolls back the synthetic event.
|
|
373
|
+
*/
|
|
374
|
+
/**
|
|
375
|
+
* Record a claim-verification verdict in the trace and check the
|
|
376
|
+
* contracts that reference it.
|
|
377
|
+
*
|
|
378
|
+
* Grounds `claim_emitted(pred)`, `evidence_verdict(pred, V)` and
|
|
379
|
+
* `evidence_action(pred, a)` at one timestep, so contracts built from
|
|
380
|
+
* `claimRequiresEvidence` / `underdeterminedMustClarify` can decide.
|
|
381
|
+
* No verdict is computed here: the atoms restate what
|
|
382
|
+
* `/v1/evidence/verify` answered.
|
|
383
|
+
*
|
|
384
|
+
* Parity with feeding `EvidenceResult.to_event()` through Python's
|
|
385
|
+
* trace path.
|
|
386
|
+
*/
|
|
387
|
+
observeEvidence(predicate: string, verdict: string, action: string): CheckResult;
|
|
388
|
+
observeResponse(content: string, opts?: {
|
|
389
|
+
segment?: string;
|
|
390
|
+
}): CheckResult;
|
|
391
|
+
/**
|
|
392
|
+
* Check one synthetic (non-tool-call) event against every contract.
|
|
393
|
+
*
|
|
394
|
+
* The output lane and the evidence lane both push an event that is not
|
|
395
|
+
* a tool call and then judge the trace. Sharing the body keeps their
|
|
396
|
+
* verdicts identical: a second copy is how one lane ends up with a
|
|
397
|
+
* rollback the other lacks.
|
|
398
|
+
*
|
|
399
|
+
* `label` names the subject in violation messages and session logs.
|
|
400
|
+
*/
|
|
401
|
+
private _checkSynthetic;
|
|
215
402
|
private _logViolations;
|
|
216
403
|
private _logAllow;
|
|
217
404
|
/**
|
|
218
|
-
* Record tool output after execution
|
|
405
|
+
* Record tool output after execution.
|
|
219
406
|
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
407
|
+
* This build ships **no sto pipeline** (the engine is deterministic-only).
|
|
408
|
+
* Stochastic (LLM-judged) atoms are the extension point that would
|
|
409
|
+
* populate ``stoViolations``; with no external implementation and no
|
|
410
|
+
* sto contracts loaded (sto entries in yaml are rejected at config
|
|
411
|
+
* load), ``stoViolations`` is always ``[]`` and ``allowed: true``.
|
|
225
412
|
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
413
|
+
* The method stays ``async`` for API parity: an external subclass
|
|
414
|
+
* or wrapper can run the judge pipeline and surface real
|
|
415
|
+
* ``stoViolations`` without changing the call site. In **enforce
|
|
416
|
+
* mode** such subclasses can flip ``blocked: true`` on the first
|
|
417
|
+
* sto violation; the tool output has already executed, so the
|
|
418
|
+
* caller is responsible for routing the result (retry with
|
|
419
|
+
* feedback, redirect to safe, etc.).
|
|
231
420
|
*/
|
|
232
|
-
guardAfter(
|
|
233
|
-
private _logSto;
|
|
421
|
+
guardAfter(_toolName: string, _output?: string): Promise<CheckResult>;
|
|
234
422
|
/**
|
|
235
|
-
* Reset guard state for a new session.
|
|
423
|
+
* Reset guard state for a new session. Clears the trace, the
|
|
424
|
+
* grounding accumulators (including ``currentCtx``, ``lastTs``,
|
|
425
|
+
* event clock), the violation log, and the sto-context snapshot.
|
|
236
426
|
*/
|
|
237
427
|
reset(): void;
|
|
238
428
|
/**
|
|
239
|
-
* Stash per-turn context for the sto pipeline.
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
429
|
+
* Stash per-turn context for the sto pipeline.
|
|
430
|
+
*
|
|
431
|
+
* Not supported in this build (the engine is deterministic-only).
|
|
432
|
+
* Atoms that need grounding (``relevance`` -> ``query``,
|
|
433
|
+
* ``hallucination_free`` -> ``source``, ``scope_respect`` ->
|
|
434
|
+
* ``scope`` override, ``metric_integrity`` -> ``history``) would
|
|
435
|
+
* read from this snapshot on the next ``guardAfter`` call. This
|
|
436
|
+
* build accepts the call as a no-op so shared agent code can stay
|
|
437
|
+
* framework-neutral; the snapshot is never consumed.
|
|
244
438
|
*
|
|
245
439
|
* Merges with any previously-set context; pass ``{ query: undefined }``
|
|
246
440
|
* to explicitly clear a field. ``reset()`` clears the whole snapshot.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAsBH,OAAO,EACL,aAAa,EAKd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AAO7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EAEX,kBAAkB,EAEnB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACtE,YAAY,EACV,aAAa,EACb,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,eAA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