@vextlabs/theron-cli 0.1.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/LICENSE +15 -0
- package/LICENSE.txt +190 -0
- package/README.md +98 -0
- package/bin/theron +22 -0
- package/bin/theron.js +25 -0
- package/dist/api.d.ts +111 -0
- package/dist/api.js +328 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +15 -0
- package/dist/auth.js +92 -0
- package/dist/auth.js.map +1 -0
- package/dist/banner.d.ts +29 -0
- package/dist/banner.js +191 -0
- package/dist/banner.js.map +1 -0
- package/dist/cap_config.d.ts +28 -0
- package/dist/cap_config.js +83 -0
- package/dist/cap_config.js.map +1 -0
- package/dist/config.d.ts +18 -0
- package/dist/config.js +65 -0
- package/dist/config.js.map +1 -0
- package/dist/connections.d.ts +3 -0
- package/dist/connections.js +105 -0
- package/dist/connections.js.map +1 -0
- package/dist/import_claude.d.ts +3 -0
- package/dist/import_claude.js +268 -0
- package/dist/import_claude.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +237 -0
- package/dist/index.js.map +1 -0
- package/dist/onboard.d.ts +3 -0
- package/dist/onboard.js +234 -0
- package/dist/onboard.js.map +1 -0
- package/dist/profile_match.d.ts +15 -0
- package/dist/profile_match.js +107 -0
- package/dist/profile_match.js.map +1 -0
- package/dist/profiles/index.d.ts +20 -0
- package/dist/profiles/index.js +56 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/profiles/seeds.d.ts +4 -0
- package/dist/profiles/seeds.js +500 -0
- package/dist/profiles/seeds.js.map +1 -0
- package/dist/profiles/types.d.ts +35 -0
- package/dist/profiles/types.js +18 -0
- package/dist/profiles/types.js.map +1 -0
- package/dist/render.d.ts +18 -0
- package/dist/render.js +82 -0
- package/dist/render.js.map +1 -0
- package/dist/repl.d.ts +13 -0
- package/dist/repl.js +821 -0
- package/dist/repl.js.map +1 -0
- package/dist/streaming.d.ts +28 -0
- package/dist/streaming.js +118 -0
- package/dist/streaming.js.map +1 -0
- package/dist/tools/bash.d.ts +8 -0
- package/dist/tools/bash.js +57 -0
- package/dist/tools/bash.js.map +1 -0
- package/dist/tools/edit.d.ts +9 -0
- package/dist/tools/edit.js +42 -0
- package/dist/tools/edit.js.map +1 -0
- package/dist/tools/glob.d.ts +7 -0
- package/dist/tools/glob.js +40 -0
- package/dist/tools/glob.js.map +1 -0
- package/dist/tools/grep.d.ts +9 -0
- package/dist/tools/grep.js +73 -0
- package/dist/tools/grep.js.map +1 -0
- package/dist/tools/index.d.ts +31 -0
- package/dist/tools/index.js +180 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/ls.d.ts +6 -0
- package/dist/tools/ls.js +25 -0
- package/dist/tools/ls.js.map +1 -0
- package/dist/tools/read.d.ts +8 -0
- package/dist/tools/read.js +43 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/stoa.d.ts +34 -0
- package/dist/tools/stoa.js +103 -0
- package/dist/tools/stoa.js.map +1 -0
- package/dist/tools/write.d.ts +7 -0
- package/dist/tools/write.js +15 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/verifiers/ai_ism_check.d.ts +2 -0
- package/dist/verifiers/ai_ism_check.js +48 -0
- package/dist/verifiers/ai_ism_check.js.map +1 -0
- package/dist/verifiers/arithmetic_recheck.d.ts +2 -0
- package/dist/verifiers/arithmetic_recheck.js +74 -0
- package/dist/verifiers/arithmetic_recheck.js.map +1 -0
- package/dist/verifiers/citation_presence.d.ts +2 -0
- package/dist/verifiers/citation_presence.js +42 -0
- package/dist/verifiers/citation_presence.js.map +1 -0
- package/dist/verifiers/em_dash_check.d.ts +2 -0
- package/dist/verifiers/em_dash_check.js +23 -0
- package/dist/verifiers/em_dash_check.js.map +1 -0
- package/dist/verifiers/index.d.ts +16 -0
- package/dist/verifiers/index.js +123 -0
- package/dist/verifiers/index.js.map +1 -0
- package/dist/verifiers/lint.d.ts +2 -0
- package/dist/verifiers/lint.js +90 -0
- package/dist/verifiers/lint.js.map +1 -0
- package/dist/verifiers/style_lint.d.ts +2 -0
- package/dist/verifiers/style_lint.js +115 -0
- package/dist/verifiers/style_lint.js.map +1 -0
- package/dist/verifiers/test_smoke.d.ts +2 -0
- package/dist/verifiers/test_smoke.js +94 -0
- package/dist/verifiers/test_smoke.js.map +1 -0
- package/dist/verifiers/typecheck.d.ts +2 -0
- package/dist/verifiers/typecheck.js +98 -0
- package/dist/verifiers/typecheck.js.map +1 -0
- package/dist/verifiers/types.d.ts +33 -0
- package/dist/verifiers/types.js +23 -0
- package/dist/verifiers/types.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// Tool registry — schemas (sent to the model as JSON tool defs) +
|
|
2
|
+
// local executors (run in this Node process against the user's repo).
|
|
3
|
+
//
|
|
4
|
+
// The executor takes parsed args and returns a string (success) or
|
|
5
|
+
// throws (error). The CLI loop sends the result back to the council
|
|
6
|
+
// as the next turn's tool_result content block.
|
|
7
|
+
import { execRead } from "./read.js";
|
|
8
|
+
import { execWrite } from "./write.js";
|
|
9
|
+
import { execEdit } from "./edit.js";
|
|
10
|
+
import { execBash } from "./bash.js";
|
|
11
|
+
import { execGlob } from "./glob.js";
|
|
12
|
+
import { execGrep } from "./grep.js";
|
|
13
|
+
import { execLs } from "./ls.js";
|
|
14
|
+
import { execStoa, STOA_TOOL_DESCRIBE, STOA_TOOL_SCHEMA } from "./stoa.js";
|
|
15
|
+
export const TOOL_REGISTRY = {
|
|
16
|
+
Read: {
|
|
17
|
+
name: "Read",
|
|
18
|
+
confirmPolicy: "never",
|
|
19
|
+
execute: (args, ctx) => execRead(args, ctx),
|
|
20
|
+
describe: (args) => `Reading ${args.file_path}`,
|
|
21
|
+
},
|
|
22
|
+
Write: {
|
|
23
|
+
name: "Write",
|
|
24
|
+
confirmPolicy: "always",
|
|
25
|
+
execute: (args, ctx) => execWrite(args, ctx),
|
|
26
|
+
describe: (args) => `Writing ${args.file_path}`,
|
|
27
|
+
},
|
|
28
|
+
Edit: {
|
|
29
|
+
name: "Edit",
|
|
30
|
+
confirmPolicy: "always",
|
|
31
|
+
execute: (args, ctx) => execEdit(args, ctx),
|
|
32
|
+
describe: (args) => `Editing ${args.file_path}`,
|
|
33
|
+
},
|
|
34
|
+
Bash: {
|
|
35
|
+
name: "Bash",
|
|
36
|
+
confirmPolicy: "always",
|
|
37
|
+
execute: (args, ctx) => execBash(args, ctx),
|
|
38
|
+
describe: (args) => `Running: ${args.description || args.command?.slice(0, 80)}`,
|
|
39
|
+
},
|
|
40
|
+
Glob: {
|
|
41
|
+
name: "Glob",
|
|
42
|
+
confirmPolicy: "never",
|
|
43
|
+
execute: (args, ctx) => execGlob(args, ctx),
|
|
44
|
+
describe: (args) => `Glob ${args.pattern}`,
|
|
45
|
+
},
|
|
46
|
+
Grep: {
|
|
47
|
+
name: "Grep",
|
|
48
|
+
confirmPolicy: "never",
|
|
49
|
+
execute: (args, ctx) => execGrep(args, ctx),
|
|
50
|
+
describe: (args) => `Grep "${args.pattern?.slice(0, 60)}"`,
|
|
51
|
+
},
|
|
52
|
+
LS: {
|
|
53
|
+
name: "LS",
|
|
54
|
+
confirmPolicy: "never",
|
|
55
|
+
execute: (args, ctx) => execLs(args, ctx),
|
|
56
|
+
describe: (args) => `Listing ${args.path || "."}`,
|
|
57
|
+
},
|
|
58
|
+
Stoa: {
|
|
59
|
+
name: "Stoa",
|
|
60
|
+
// Stoa calls hit a real SaaS — ask for confirmation by default.
|
|
61
|
+
// Once we have per-cap cost caps + receipt review, we can flip
|
|
62
|
+
// low-risk read-only caps to "never" automatically.
|
|
63
|
+
confirmPolicy: "always",
|
|
64
|
+
execute: (args, ctx) => execStoa(args, ctx),
|
|
65
|
+
describe: STOA_TOOL_DESCRIBE,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
export const TOOL_SCHEMAS = [
|
|
69
|
+
{
|
|
70
|
+
type: "function",
|
|
71
|
+
function: {
|
|
72
|
+
name: "Read",
|
|
73
|
+
description: "Read a file from the user's local working directory. Returns the file contents as text. Use offset/limit to page through large files (1-indexed lines). Errors if the path is outside the repo or doesn't exist.",
|
|
74
|
+
parameters: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
file_path: { type: "string", description: "Absolute or repo-relative path." },
|
|
78
|
+
offset: { type: "number", description: "Optional 1-indexed line to start reading from." },
|
|
79
|
+
limit: { type: "number", description: "Optional max lines to read." },
|
|
80
|
+
},
|
|
81
|
+
required: ["file_path"],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
type: "function",
|
|
87
|
+
function: {
|
|
88
|
+
name: "Write",
|
|
89
|
+
description: "Write a file to the user's local working directory. Creates or overwrites. Asks the user for confirmation before each write unless --yes is passed.",
|
|
90
|
+
parameters: {
|
|
91
|
+
type: "object",
|
|
92
|
+
properties: {
|
|
93
|
+
file_path: { type: "string" },
|
|
94
|
+
content: { type: "string", description: "Full file contents — overwrites whatever was there." },
|
|
95
|
+
},
|
|
96
|
+
required: ["file_path", "content"],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
type: "function",
|
|
102
|
+
function: {
|
|
103
|
+
name: "Edit",
|
|
104
|
+
description: "Replace an exact substring in a file. old_string must appear EXACTLY ONCE (or set replace_all=true). The CLI shows a diff and asks for confirmation unless --yes.",
|
|
105
|
+
parameters: {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
file_path: { type: "string" },
|
|
109
|
+
old_string: { type: "string" },
|
|
110
|
+
new_string: { type: "string" },
|
|
111
|
+
replace_all: { type: "boolean", default: false },
|
|
112
|
+
},
|
|
113
|
+
required: ["file_path", "old_string", "new_string"],
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
type: "function",
|
|
119
|
+
function: {
|
|
120
|
+
name: "Bash",
|
|
121
|
+
description: "Run a shell command in the user's working directory. Returns stdout + stderr + exit code. Asks for confirmation unless --yes. Has a default 120s timeout.",
|
|
122
|
+
parameters: {
|
|
123
|
+
type: "object",
|
|
124
|
+
properties: {
|
|
125
|
+
command: { type: "string" },
|
|
126
|
+
timeout: { type: "number", description: "Timeout in ms (default 120000, max 600000)." },
|
|
127
|
+
description: { type: "string", description: "Short label for what the command does, shown to the user." },
|
|
128
|
+
},
|
|
129
|
+
required: ["command"],
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
type: "function",
|
|
135
|
+
function: {
|
|
136
|
+
name: "Glob",
|
|
137
|
+
description: "Find files by glob pattern. Returns paths sorted by mtime descending. Use to locate files when you don't know exact names.",
|
|
138
|
+
parameters: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
pattern: { type: "string", description: "Glob like 'src/**/*.ts'." },
|
|
142
|
+
path: { type: "string", description: "Root to search from (default cwd)." },
|
|
143
|
+
},
|
|
144
|
+
required: ["pattern"],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: "function",
|
|
150
|
+
function: {
|
|
151
|
+
name: "Grep",
|
|
152
|
+
description: "Search file contents with a regex. Returns matching lines with file:line prefixes. Use for 'where is this defined' / 'who calls X' questions.",
|
|
153
|
+
parameters: {
|
|
154
|
+
type: "object",
|
|
155
|
+
properties: {
|
|
156
|
+
pattern: { type: "string", description: "Regex pattern." },
|
|
157
|
+
path: { type: "string", description: "Optional file or directory to limit the search." },
|
|
158
|
+
glob: { type: "string", description: "Optional glob filter, e.g. '*.ts'." },
|
|
159
|
+
case_insensitive: { type: "boolean", default: false },
|
|
160
|
+
},
|
|
161
|
+
required: ["pattern"],
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "function",
|
|
167
|
+
function: {
|
|
168
|
+
name: "LS",
|
|
169
|
+
description: "List files and directories in a path (single level, not recursive).",
|
|
170
|
+
parameters: {
|
|
171
|
+
type: "object",
|
|
172
|
+
properties: {
|
|
173
|
+
path: { type: "string", description: "Default cwd." },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
STOA_TOOL_SCHEMA,
|
|
179
|
+
];
|
|
180
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,sEAAsE;AACtE,EAAE;AACF,mEAAmE;AACnE,oEAAoE;AACpE,gDAAgD;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAkC3E,MAAM,CAAC,MAAM,aAAa,GAAiC;IACzD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,aAAa,EAAE,OAAO;QACtB,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,IAA8D,EAAE,GAAG,CAAC;QACrG,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,IAAI,CAAC,SAAS,EAAE;KAChD;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,aAAa,EAAE,QAAQ;QACvB,OAAO,EA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,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;oBACpE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;iBAC5E;gBACD,QAAQ,EAAE,CAAC,SAAS,CAAC;aACtB;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,WAAW,EACT,+IAA+I;YACjJ,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE;oBAC1D,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iDAAiD,EAAE;oBACxF,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oCAAoC,EAAE;oBAC3E,gBAAgB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;iBACtD;gBACD,QAAQ,EAAE,CAAC,SAAS,CAAC;aACtB;SACF;KACF;IACD;QACE,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,qEAAqE;YAClF,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;iBACtD;aACF;SACF;KACF;IACD,gBAAgB;CACjB,CAAC"}
|
package/dist/tools/ls.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// LS tool — single-level directory listing.
|
|
2
|
+
import { promises as fs } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export async function execLs(args, ctx) {
|
|
5
|
+
const target = args.path
|
|
6
|
+
? (path.isAbsolute(args.path) ? args.path : path.resolve(ctx.cwd, args.path))
|
|
7
|
+
: ctx.cwd;
|
|
8
|
+
let entries;
|
|
9
|
+
try {
|
|
10
|
+
entries = await fs.readdir(target, { withFileTypes: true });
|
|
11
|
+
}
|
|
12
|
+
catch (err) {
|
|
13
|
+
return `[error] Cannot list ${target}: ${err instanceof Error ? err.message : String(err)}`;
|
|
14
|
+
}
|
|
15
|
+
const lines = [];
|
|
16
|
+
for (const e of entries) {
|
|
17
|
+
if (e.name.startsWith("."))
|
|
18
|
+
continue;
|
|
19
|
+
lines.push(`${e.isDirectory() ? "d" : "-"} ${e.name}${e.isDirectory() ? "/" : ""}`);
|
|
20
|
+
}
|
|
21
|
+
if (lines.length === 0)
|
|
22
|
+
return `${target} is empty.`;
|
|
23
|
+
return `${target}\n${lines.join("\n")}`;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ls.js","sourceRoot":"","sources":["../../src/tools/ls.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAE5C,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAO7B,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAY,EAAE,GAAgB;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI;QACtB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7E,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACZ,IAAI,OAAO,CAAC;IACZ,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,uBAAuB,MAAM,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAC9F,CAAC;IACD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QACrC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,MAAM,YAAY,CAAC;IACrD,OAAO,GAAG,MAAM,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Read tool — local file reader with safety rails:
|
|
2
|
+
// - Resolves the path relative to ctx.cwd
|
|
3
|
+
// - Refuses paths outside cwd (unless absolute is passed; absolute is allowed)
|
|
4
|
+
// - Caps output at ctx.maxBytes
|
|
5
|
+
// - Supports offset/limit for paging large files
|
|
6
|
+
import { promises as fs } from "node:fs";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
export async function execRead(args, ctx) {
|
|
9
|
+
const target = path.isAbsolute(args.file_path)
|
|
10
|
+
? args.file_path
|
|
11
|
+
: path.resolve(ctx.cwd, args.file_path);
|
|
12
|
+
let stat;
|
|
13
|
+
try {
|
|
14
|
+
stat = await fs.stat(target);
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
return `[error] Cannot read ${target}: ${err instanceof Error ? err.message : String(err)}`;
|
|
18
|
+
}
|
|
19
|
+
if (stat.isDirectory()) {
|
|
20
|
+
return `[error] ${target} is a directory; use LS or Glob.`;
|
|
21
|
+
}
|
|
22
|
+
if (stat.size > 5_000_000) {
|
|
23
|
+
return `[error] ${target} is ${(stat.size / 1024 / 1024).toFixed(1)}MB — too large to read directly. Use Bash with head/tail/grep instead.`;
|
|
24
|
+
}
|
|
25
|
+
const raw = await fs.readFile(target, "utf-8");
|
|
26
|
+
const lines = raw.split(/\r?\n/);
|
|
27
|
+
const offset = Math.max(1, args.offset ?? 1);
|
|
28
|
+
const limit = Math.max(1, Math.min(args.limit ?? 2000, 5000));
|
|
29
|
+
const slice = lines.slice(offset - 1, offset - 1 + limit);
|
|
30
|
+
// cat -n style: 1-indexed line numbers, tab separator
|
|
31
|
+
const numbered = slice
|
|
32
|
+
.map((line, i) => `${(offset + i).toString().padStart(6, " ")}\t${line}`)
|
|
33
|
+
.join("\n");
|
|
34
|
+
// Truncate to byte cap
|
|
35
|
+
let out = numbered;
|
|
36
|
+
if (Buffer.byteLength(out, "utf-8") > ctx.maxBytes) {
|
|
37
|
+
out = out.slice(0, ctx.maxBytes) + "\n[truncated to maxBytes]";
|
|
38
|
+
}
|
|
39
|
+
const totalLines = lines.length;
|
|
40
|
+
const ranged = `${offset}–${Math.min(totalLines, offset + slice.length - 1)}`;
|
|
41
|
+
return `${target} (lines ${ranged} of ${totalLines})\n${out}`;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read.js","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,0CAA0C;AAC1C,+EAA+E;AAC/E,gCAAgC;AAChC,iDAAiD;AAEjD,OAAO,EAAE,QAAQ,IAAI,EAAE,EA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AC,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IAE1D,sDAAsD;IACtD,MAAM,QAAQ,GAAG,KAAK;SACnB,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACxE,IAAI,CAAC,IAAI,CAAC,CAAC;IAEd,uBAAuB;IACvB,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QACnD,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,QAAQ,CAAC,GAAG,2BAA2B,CAAC;IACjE,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;IAChC,MAAM,MAAM,GAAG,GAAG,MAAM,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC;IAC9E,OAAO,GAAG,MAAM,YAAY,MAAM,OAAO,UAAU,MAAM,GAAG,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ToolContext } from "./index.js";
|
|
2
|
+
interface StoaArgs {
|
|
3
|
+
/** Capability URN — e.g. "urn:stoa:cap:slack.chat.postMessage@1.0.0".
|
|
4
|
+
* Run `/cap list` to see what's registered. */
|
|
5
|
+
cap: string;
|
|
6
|
+
/** The capability-specific input. Schema is defined by the cap's
|
|
7
|
+
* spec in the Stoa registry. */
|
|
8
|
+
input: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
export declare function execStoa(args: StoaArgs, _ctx: ToolContext): Promise<string>;
|
|
11
|
+
export declare const STOA_TOOL_DESCRIBE: (args: Record<string, unknown>) => string;
|
|
12
|
+
/** OpenAI-compatible function tool def for the Stoa cap proxy. */
|
|
13
|
+
export declare const STOA_TOOL_SCHEMA: {
|
|
14
|
+
type: "function";
|
|
15
|
+
function: {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
parameters: {
|
|
19
|
+
type: string;
|
|
20
|
+
properties: {
|
|
21
|
+
cap: {
|
|
22
|
+
type: string;
|
|
23
|
+
description: string;
|
|
24
|
+
};
|
|
25
|
+
input: {
|
|
26
|
+
type: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
required: string[];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Stoa cap proxy tool — the bridge from CLI agents to Stoa-compliant
|
|
2
|
+
// SaaS. When the model wants to "send a Slack message" or "charge a
|
|
3
|
+
// $1 test charge on Stripe" or "send an email via Resend," it doesn't
|
|
4
|
+
// learn N different APIs. It calls the Stoa tool with a cap URN, the
|
|
5
|
+
// CLI proxies to https://tryvext.com/v1/cap, and a Stoa/1 response
|
|
6
|
+
// envelope comes back with a signed receipt.
|
|
7
|
+
//
|
|
8
|
+
// Why this matters strategically:
|
|
9
|
+
// - The CLI agent's tool layer becomes UNBOUNDED. Today: 3 caps
|
|
10
|
+
// (Stripe, Slack, GitHub, Resend, ...). Tomorrow: every vendor
|
|
11
|
+
// who registers a Stoa cap is reachable from every Theron agent
|
|
12
|
+
// without a CLI release.
|
|
13
|
+
// - This is the Stoa product proving itself — Theron is the first
|
|
14
|
+
// and best Stoa client, eating its own dogfood.
|
|
15
|
+
// - Receipts are audit-quality (Merkle-anchored, ES256-signed),
|
|
16
|
+
// so an enterprise can trust "Theron did this, here's the proof."
|
|
17
|
+
const DEFAULT_BASE = process.env.THERON_STOA_BASE ?? "https://tryvext.com";
|
|
18
|
+
export async function execStoa(args, _ctx) {
|
|
19
|
+
if (typeof args.cap !== "string" || !args.cap.startsWith("urn:stoa:cap:")) {
|
|
20
|
+
throw new Error(`invalid cap URN: ${args.cap}`);
|
|
21
|
+
}
|
|
22
|
+
if (typeof args.input !== "object" || args.input === null) {
|
|
23
|
+
throw new Error("input must be an object");
|
|
24
|
+
}
|
|
25
|
+
const url = `${DEFAULT_BASE}/v1/cap`;
|
|
26
|
+
const envelope = {
|
|
27
|
+
stoa: "1",
|
|
28
|
+
cap: args.cap,
|
|
29
|
+
input: args.input,
|
|
30
|
+
};
|
|
31
|
+
let response;
|
|
32
|
+
try {
|
|
33
|
+
response = await fetch(url, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "content-type": "application/json" },
|
|
36
|
+
body: JSON.stringify(envelope),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
throw new Error(`network error calling Stoa: ${err instanceof Error ? err.message : String(err)}`);
|
|
41
|
+
}
|
|
42
|
+
let parsed;
|
|
43
|
+
try {
|
|
44
|
+
parsed = (await response.json());
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw new Error(`Stoa returned non-JSON response (HTTP ${response.status})`);
|
|
48
|
+
}
|
|
49
|
+
if (parsed.status === "error") {
|
|
50
|
+
const remediation = parsed.error?.remediation?.hint
|
|
51
|
+
? ` (remediation: ${parsed.error.remediation.hint})`
|
|
52
|
+
: "";
|
|
53
|
+
throw new Error(`Stoa cap failed: ${parsed.error?.code ?? "unknown"} — ${parsed.error?.message ?? "no detail"}${remediation}`);
|
|
54
|
+
}
|
|
55
|
+
// Format for the model. Receipt is the audit handle; output is the
|
|
56
|
+
// actual response; cost is the per-call charge.
|
|
57
|
+
const lines = [];
|
|
58
|
+
lines.push(`Stoa cap ${args.cap} → ok`);
|
|
59
|
+
if (parsed.cost_cents != null)
|
|
60
|
+
lines.push(` cost: ${(parsed.cost_cents / 100).toFixed(2)} USD`);
|
|
61
|
+
if (parsed.output !== undefined) {
|
|
62
|
+
lines.push(` output:`);
|
|
63
|
+
lines.push(JSON.stringify(parsed.output, null, 2).split("\n").map((l) => " " + l).join("\n"));
|
|
64
|
+
}
|
|
65
|
+
if (parsed.side_effects !== undefined) {
|
|
66
|
+
const sec = JSON.stringify(parsed.side_effects);
|
|
67
|
+
if (sec.length > 4)
|
|
68
|
+
lines.push(` side_effects: ${sec}`);
|
|
69
|
+
}
|
|
70
|
+
if (parsed.receipt) {
|
|
71
|
+
lines.push(` receipt: ${parsed.receipt.alg} ${parsed.receipt.sig.slice(0, 24)}…`);
|
|
72
|
+
}
|
|
73
|
+
return lines.join("\n");
|
|
74
|
+
}
|
|
75
|
+
export const STOA_TOOL_DESCRIBE = (args) => {
|
|
76
|
+
const cap = args.cap ?? "?";
|
|
77
|
+
// Strip the URN prefix for terminal display.
|
|
78
|
+
const shortCap = cap.replace(/^urn:stoa:cap:/, "");
|
|
79
|
+
return `Stoa cap → ${shortCap}`;
|
|
80
|
+
};
|
|
81
|
+
/** OpenAI-compatible function tool def for the Stoa cap proxy. */
|
|
82
|
+
export const STOA_TOOL_SCHEMA = {
|
|
83
|
+
type: "function",
|
|
84
|
+
function: {
|
|
85
|
+
name: "Stoa",
|
|
86
|
+
description: "Invoke a Stoa-registered capability (e.g. send a Slack message, create a Stripe charge, send an email via Resend, create a GitHub issue). Pass a cap URN and the capability-specific input. Returns a signed-receipt envelope with the result + audit proof. Use this instead of writing custom API integrations — the URN registry covers vendors that have published a Stoa spec.",
|
|
87
|
+
parameters: {
|
|
88
|
+
type: "object",
|
|
89
|
+
properties: {
|
|
90
|
+
cap: {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Capability URN, e.g. 'urn:stoa:cap:slack.chat.postMessage@1.0.0'. List registered caps with /cap list.",
|
|
93
|
+
},
|
|
94
|
+
input: {
|
|
95
|
+
type: "object",
|
|
96
|
+
description: "Capability-specific input. Schema is defined by the cap's spec. Most caps accept { to, subject, body } for messaging or { amount_cents, currency } for payments — check the cap spec for the exact shape.",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
required: ["cap", "input"],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
//# sourceMappingURL=stoa.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stoa.js","sourceRoot":"","sources":["../../src/tools/stoa.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,oEAAoE;AACpE,sEAAsE;AACtE,qEAAqE;AACrE,mEAAmE;AACnE,6CAA6C;AAC7C,EAAE;AACF,kCAAkC;AAClC,kEAAkE;AAClE,mEAAmE;AACnE,oEAAoE;AACpE,6BAA6B;AAC7B,oEAAoE;AACpE,oDAAoD;AACpD,kEAAkE;AAClE,sEAAsE;AAwBtE,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,qBAAqB,CAAC;AAE3E,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAc,EAAE,IAAiB;IAC9D,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QAC1E,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,GAAG,GAAG,GAAG,YAAY,SAAS,CAAC;IACrC,MAAM,QAAQ,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,IAAI,CAAC,GAAc,IAAI,GAAG,CAAC;IACxC,6CAA6C;IAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACnD,OAAO,cAAc,QAAQ,EAAE,CAAC;AAClC,CAAC,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,UAAmB;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM;QACZ,WAAW,EACT,qXAAqX;QACvX,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,wGAAwG;iBACtH;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,2MAA2M;iBACzN;aACF;YACD,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;SAC3B;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Write tool — creates/overwrites a file. Asks for confirmation in the
|
|
2
|
+
// REPL loop before this executes; this function trusts that the gate
|
|
3
|
+
// already passed.
|
|
4
|
+
import { promises as fs } from "node:fs";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
export async function execWrite(args, ctx) {
|
|
7
|
+
const target = path.isAbsolute(args.file_path)
|
|
8
|
+
? args.file_path
|
|
9
|
+
: path.resolve(ctx.cwd, args.file_path);
|
|
10
|
+
await fs.mkdir(path.dirname(target), { recursive: true });
|
|
11
|
+
await fs.writeFile(target, args.content, "utf-8");
|
|
12
|
+
const lineCount = args.content.split(/\r?\n/).length;
|
|
13
|
+
return `Wrote ${target} (${lineCount} lines, ${Buffer.byteLength(args.content, "utf-8")} bytes)`;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,qEAAqE;AACrE,kBAAkB;AAElB,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAe,EAAE,GAAgB;IAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC5C,CAAC,CAAC,IAAI,CAAC,SAAS;QAChB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAE1C,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,EAAE,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IACrD,OAAO,SAAS,MAAM,KAAK,SAAS,WAAW,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// AI-ism checker — flags the rhetorical patterns that scream "ChatGPT
|
|
2
|
+
// wrote this." Each match is a warning (not blocking), because writers
|
|
3
|
+
// sometimes have legitimate use for these words.
|
|
4
|
+
//
|
|
5
|
+
// The list is curated from the ones the user has explicitly hated:
|
|
6
|
+
// - "delve", "tapestry", "elevate" — over-elaborate verb choices
|
|
7
|
+
// - "navigate the complexities" — empty stock phrasing
|
|
8
|
+
// - "in today's fast-paced world" — opening cliché
|
|
9
|
+
// - "robust" + "comprehensive" — adjective filler
|
|
10
|
+
// - "leverages" — corporate jargon when "uses" works
|
|
11
|
+
// - "It's important to note" — throat-clearing
|
|
12
|
+
// - "Certainly!" / "Of course!" — sycophantic openers
|
|
13
|
+
const PATTERNS = [
|
|
14
|
+
{ pattern: /\bdelv(e|ing|ed)\b/gi, reason: '"delve" — try "look at", "examine", "dig into"' },
|
|
15
|
+
{ pattern: /\btapestry\b/gi, reason: '"tapestry" — almost always pretentious' },
|
|
16
|
+
{ pattern: /\belevat(e|ing|ed)\b/gi, reason: '"elevate" — try "raise", "improve"' },
|
|
17
|
+
{ pattern: /\bnavigate the complexit\w+/gi, reason: '"navigate the complexities" — stock phrase' },
|
|
18
|
+
{ pattern: /\bin today'?s (fast-paced|rapidly-changing|ever-evolving) world\b/gi, reason: 'Opening cliché' },
|
|
19
|
+
{ pattern: /\brobust and comprehensive\b/gi, reason: '"robust and comprehensive" — adjective filler' },
|
|
20
|
+
{ pattern: /\bleverag(e|es|ing|ed)\b/gi, reason: '"leverage" as a verb — try "use"' },
|
|
21
|
+
{ pattern: /\bit'?s important to note that\b/gi, reason: 'Throat-clearing — just say the thing' },
|
|
22
|
+
{ pattern: /^(certainly|of course|absolutely|sure)[!.]\s/gim, reason: 'Sycophantic opener' },
|
|
23
|
+
{ pattern: /\bgame-?chang(er|ing)\b/gi, reason: '"game-changer" — cliché' },
|
|
24
|
+
{ pattern: /\bunlock(ing|ed)? (the )?potential\b/gi, reason: '"unlock potential" — empty corporate' },
|
|
25
|
+
{ pattern: /\bpush the boundaries\b/gi, reason: '"push the boundaries" — cliché' },
|
|
26
|
+
];
|
|
27
|
+
export const aiIsmCheckKernel = {
|
|
28
|
+
slug: "ai_ism_check",
|
|
29
|
+
describe: "Scan output for AI-isms (delve, tapestry, leverage, etc.)",
|
|
30
|
+
async run(ctx) {
|
|
31
|
+
if (!ctx.assistantText)
|
|
32
|
+
return [];
|
|
33
|
+
const issues = [];
|
|
34
|
+
for (const { pattern, reason } of PATTERNS) {
|
|
35
|
+
pattern.lastIndex = 0;
|
|
36
|
+
const matches = [...ctx.assistantText.matchAll(pattern)];
|
|
37
|
+
if (matches.length === 0)
|
|
38
|
+
continue;
|
|
39
|
+
issues.push({
|
|
40
|
+
severity: "warn",
|
|
41
|
+
kernel: "ai_ism_check",
|
|
42
|
+
message: `${reason} (${matches.length}×)`,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return issues;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=ai_ism_check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai_ism_check.js","sourceRoot":"","sources":["../../src/verifiers/ai_ism_check.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,uEAAuE;AACvE,iDAAiD;AACjD,EAAE;AACF,mEAAmE;AACnE,mEAAmE;AACnE,yDAAyD;AACzD,qDAAqD;AACrD,oDAAoD;AACpD,uDAAuD;AACvD,iDAAiD;AACjD,wDAAwD;AAIxD,MAAM,QAAQ,GAA+C;IAC3D,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,EAAE,gDAAgD,EAAE;IAC7F,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,wCAAwC,EAAE;IAC/E,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,EAAE,oCAAoC,EAAE;IACnF,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,EAAE,4CAA4C,EAAE;IAClG,EAAE,OAAO,EAAE,qEAAqE,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC5G,EAAE,OAAO,EAAE,gCAAgC,EAAE,MAAM,EAAE,+CAA+C,EAAE;IACtG,EAAE,OAAO,EAAE,4BAA4B,EAAE,MAAM,EAAE,kCAAkC,EAAE;IACrF,EAAE,OAAO,EAAE,oCAAoC,EAAE,MAAM,EAAE,sCAAsC,EAAE;IACjG,EAAE,OAAO,EAAE,iDAAiD,EAAE,MAAM,EAAE,oBAAoB,EAAE;IAC5F,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,yBAAyB,EAAE;IAC3E,EAAE,OAAO,EAAE,wCAAwC,EAAE,MAAM,EAAE,sCAAsC,EAAE;IACrG,EAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAAE,gCAAgC,EAAE;CACnF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAa;IACxC,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,2DAA2D;IACrE,KAAK,CAAC,GAAG,CAAC,GAAoB;QAC5B,IAAI,CAAC,GAAG,CAAC,aAAa;YAAE,OAAO,EAAE,CAAC;QAClC,MAAM,MAAM,GAAoB,EAAE,CAAC;QACnC,KAAK,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,QAAQ,EAAE,CAAC;YAC3C,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC;YACtB,MAAM,OAAO,GAAG,CAAC,GAAG,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YACzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;gBAAE,SAAS;YACnC,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,MAAM;gBAChB,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,GAAG,MAAM,KAAK,OAAO,CAAC,MAAM,IAAI;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// Arithmetic re-check verifier — used by the finance, data, trader,
|
|
2
|
+
// engineer, and realtor profiles. Scans the output for arithmetic
|
|
3
|
+
// claims of the form "X + Y = Z" / "X * Y = Z" / "X / Y = Z" and
|
|
4
|
+
// re-evaluates each, surfacing any that don't match.
|
|
5
|
+
//
|
|
6
|
+
// This is the simplest "actual verifier" beyond pattern matching —
|
|
7
|
+
// it catches the model when it confidently asserts wrong numbers,
|
|
8
|
+
// which LLMs do constantly even at frontier scale.
|
|
9
|
+
const APPLIES_TO_PROFILES = new Set(["finance", "data", "trader", "engineer", "realtor", "code"]);
|
|
10
|
+
// Match expressions like "1,234.56 + 7,890 = 9,124.56" or "10 * 0.5 = 5".
|
|
11
|
+
// Numbers can have commas and decimals. Allow surrounding $/% signs.
|
|
12
|
+
// We're conservative — only flag arithmetic that's unambiguous.
|
|
13
|
+
const ARITH_RE = /\b([\$\€\£]?-?\d[\d,]*(?:\.\d+)?\s*%?)\s*([+\-*/×÷])\s*([\$\€\£]?-?\d[\d,]*(?:\.\d+)?\s*%?)\s*=\s*([\$\€\£]?-?\d[\d,]*(?:\.\d+)?\s*%?)/g;
|
|
14
|
+
function parseNumber(s) {
|
|
15
|
+
// Strip currency symbols, commas, percent.
|
|
16
|
+
const cleaned = s.replace(/[\$€£,%]/g, "").trim();
|
|
17
|
+
const n = parseFloat(cleaned);
|
|
18
|
+
if (Number.isNaN(n))
|
|
19
|
+
return NaN;
|
|
20
|
+
return n;
|
|
21
|
+
}
|
|
22
|
+
function evalOp(a, op, b) {
|
|
23
|
+
switch (op) {
|
|
24
|
+
case "+": return a + b;
|
|
25
|
+
case "-": return a - b;
|
|
26
|
+
case "*":
|
|
27
|
+
case "×": return a * b;
|
|
28
|
+
case "/":
|
|
29
|
+
case "÷": return b === 0 ? NaN : a / b;
|
|
30
|
+
default: return NaN;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export const arithmeticRecheckKernel = {
|
|
34
|
+
slug: "arithmetic_recheck",
|
|
35
|
+
describe: "Re-evaluate every X op Y = Z claim in the output; flag mismatches",
|
|
36
|
+
async run(ctx) {
|
|
37
|
+
if (!APPLIES_TO_PROFILES.has(ctx.profile))
|
|
38
|
+
return [];
|
|
39
|
+
if (!ctx.assistantText)
|
|
40
|
+
return [];
|
|
41
|
+
const issues = [];
|
|
42
|
+
ARITH_RE.lastIndex = 0;
|
|
43
|
+
let m;
|
|
44
|
+
let count = 0;
|
|
45
|
+
while ((m = ARITH_RE.exec(ctx.assistantText)) && count < 20) {
|
|
46
|
+
count += 1;
|
|
47
|
+
const a = parseNumber(m[1]);
|
|
48
|
+
const op = m[2];
|
|
49
|
+
const b = parseNumber(m[3]);
|
|
50
|
+
const claimed = parseNumber(m[4]);
|
|
51
|
+
if ([a, b, claimed].some((n) => Number.isNaN(n)))
|
|
52
|
+
continue;
|
|
53
|
+
const actual = evalOp(a, op, b);
|
|
54
|
+
if (Number.isNaN(actual))
|
|
55
|
+
continue;
|
|
56
|
+
// Tolerance: 0.01 absolute or 0.1% relative, whichever is larger.
|
|
57
|
+
const tol = Math.max(0.01, Math.abs(actual) * 0.001);
|
|
58
|
+
if (Math.abs(actual - claimed) > tol) {
|
|
59
|
+
issues.push({
|
|
60
|
+
severity: "block",
|
|
61
|
+
kernel: "arithmetic_recheck",
|
|
62
|
+
message: `Claimed ${m[1].trim()} ${op} ${m[3].trim()} = ${m[4].trim()}, but actual = ${formatNumber(actual)}`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return issues;
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
function formatNumber(n) {
|
|
70
|
+
// Keep up to 4 sig figs after the decimal, trim trailing zeros.
|
|
71
|
+
const s = Math.abs(n) >= 1000 ? n.toFixed(2) : n.toFixed(4);
|
|
72
|
+
return s.replace(/\.?0+$/, "");
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=arithmetic_recheck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmetic_recheck.js","sourceRoot":"","sources":["../../src/verifiers/arithmetic_recheck.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,kEAAkE;AAClE,iEAAiE;AACjE,qDAAqD;AACrD,EAAE;AACF,mEAAmE;AACnE,kEAAkE;AAClE,mDAAmD;AAInD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,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