@wrongstack/tools 0.320.1 → 1.0.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/dist/_danger-detect.d.ts +8 -0
- package/dist/_syntax-check.d.ts +1 -2
- package/dist/audit.d.ts +4 -5
- package/dist/audit.js +6 -6
- package/dist/auto-proceed-loop-guard.js +9 -160
- package/dist/bash-kill-guard.d.ts +2 -3
- package/dist/bash.d.ts +2 -3
- package/dist/bash.js +4 -4
- package/dist/batch-tool-use.d.ts +2 -3
- package/dist/batch-tool-use.js +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/tools.d.ts +56 -45
- package/dist/builtin.js +50 -50
- package/dist/{chunk-T77XOX7E.js → chunk-24T5XIJU.js} +1 -1
- package/dist/{chunk-DTQ75VBC.js → chunk-2CTZW6JQ.js} +2 -2
- package/dist/chunk-37QKUQ2Z.js +171 -0
- package/dist/{chunk-KWXIKGE3.js → chunk-3D5DJWOE.js} +3 -3
- package/dist/{chunk-XSSFBS5I.js → chunk-4ERMPDHV.js} +11 -6
- package/dist/{chunk-QSNVDHOZ.js → chunk-4WPBS45A.js} +4 -5
- package/dist/{chunk-4CQWNZ62.js → chunk-5ITQPCLC.js} +2 -2
- package/dist/{chunk-B4HTSV6Z.js → chunk-5KS24LTS.js} +11 -11
- package/dist/{chunk-QPNYDH5B.js → chunk-62OAECEQ.js} +29 -7
- package/dist/{chunk-DFQDJT22.js → chunk-6GOZTS6F.js} +3 -3
- package/dist/{chunk-34VLZ35Z.js → chunk-7HL23T3T.js} +63 -10
- package/dist/{chunk-HFXSNKCV.js → chunk-7JJFC6CT.js} +1 -1
- package/dist/{chunk-NDIT3SBZ.js → chunk-7N5U2RAU.js} +2 -2
- package/dist/{chunk-QBV725YG.js → chunk-7ODZTPCU.js} +2 -2
- package/dist/{chunk-4BABEJC2.js → chunk-AB2CAUOP.js} +64 -53
- package/dist/{chunk-6AAOT4PW.js → chunk-AQ5YBURX.js} +16 -4
- package/dist/{chunk-ZMW6WJFT.js → chunk-ASEXQRA7.js} +3 -3
- package/dist/{chunk-FRN7TIAA.js → chunk-B3MGJBFI.js} +1 -1
- package/dist/{chunk-JLYA4X7K.js → chunk-CGXTR34H.js} +21 -6
- package/dist/{chunk-IU4DV2PA.js → chunk-CHEK3ASV.js} +6 -3
- package/dist/{chunk-GOIZNNOA.js → chunk-DJYLI7EW.js} +1 -1
- package/dist/{chunk-Z6IHMJMC.js → chunk-DK4J2WMH.js} +11 -11
- package/dist/{chunk-OYP27E3I.js → chunk-DRRY6SCM.js} +47 -20
- package/dist/{chunk-BK732J7I.js → chunk-FBUP524S.js} +4 -4
- package/dist/{chunk-NYRLWDT5.js → chunk-FVM3O4JQ.js} +1 -1
- package/dist/chunk-FYDBUVQD.js +244 -0
- package/dist/{chunk-PV6HIZQD.js → chunk-GDDXX27P.js} +50 -50
- package/dist/{chunk-3GIKYHLA.js → chunk-GKSG5CPH.js} +6 -6
- package/dist/{chunk-ESLPBT5A.js → chunk-HDYUBRMF.js} +4 -3
- package/dist/{chunk-ELRRTWNP.js → chunk-IXIS7RSG.js} +2 -2
- package/dist/{chunk-HR67OWEP.js → chunk-IYH4OHBP.js} +5 -5
- package/dist/{chunk-W232EFEM.js → chunk-JDOO4P6Z.js} +7 -4
- package/dist/{chunk-OTPTQBYE.js → chunk-KDEXUQY7.js} +19 -8
- package/dist/{chunk-2OXHS3KZ.js → chunk-KLJZ4WV4.js} +4 -3
- package/dist/{chunk-3M7LLN7W.js → chunk-LQSOU63Z.js} +12 -11
- package/dist/{chunk-JVRLTEO7.js → chunk-M6UV67BH.js} +2 -2
- package/dist/{chunk-C2DQKVLO.js → chunk-MJSJWXBF.js} +1 -1
- package/dist/{chunk-NSPNFOJ7.js → chunk-MK2JK35J.js} +25 -10
- package/dist/{chunk-JSNSMG5R.js → chunk-MSOAX3GC.js} +1 -1
- package/dist/{chunk-J43O3BOX.js → chunk-N3K2SFEI.js} +532 -492
- package/dist/{chunk-J74TMK4M.js → chunk-NJX2RXKJ.js} +50 -7
- package/dist/{chunk-5UFVCIUB.js → chunk-NN2SNP2R.js} +4 -4
- package/dist/{chunk-WAQASTXB.js → chunk-O6BY43ZB.js} +29 -8
- package/dist/{chunk-QGF2C7TF.js → chunk-PVCB7RUZ.js} +2 -2
- package/dist/{chunk-YTKSNTT4.js → chunk-QA6IASYX.js} +8 -8
- package/dist/{chunk-VPALDFYM.js → chunk-RV7BVTDG.js} +1 -1
- package/dist/chunk-S57CDR2H.js +288 -0
- package/dist/{chunk-W2CECGTG.js → chunk-SMARDKAC.js} +1 -1
- package/dist/{chunk-QWKSKFKZ.js → chunk-SOR7OCYP.js} +1 -1
- package/dist/{chunk-I7FBZOEP.js → chunk-T3SMFF5Q.js} +11 -5
- package/dist/{chunk-4BHUSMNL.js → chunk-UI3ZJIG3.js} +1 -1
- package/dist/{chunk-WXJY3BKV.js → chunk-VBF2YXUW.js} +2 -2
- package/dist/{chunk-FQNXYA6W.js → chunk-VU3QBYL4.js} +36 -5
- package/dist/{chunk-VD2LV5WO.js → chunk-VZGPASGD.js} +37 -12
- package/dist/{chunk-UZFY3CKD.js → chunk-WEEVSWQB.js} +17 -6
- package/dist/chunk-XXRMF2BC.js +186 -0
- package/dist/{chunk-LRDIRJJL.js → chunk-YEISRT4S.js} +5 -11
- package/dist/{chunk-Q5JPPCZC.js → chunk-YJTXRH5Y.js} +3 -2
- package/dist/{chunk-23EX5WDO.js → chunk-YULVUTK5.js} +3 -3
- package/dist/{chunk-Z5Q3TXRY.js → chunk-ZTCJCYLN.js} +3 -3
- package/dist/circuit-breaker.d.ts +1 -0
- package/dist/circuit-breaker.js +1 -1
- package/dist/clarify.d.ts +1 -0
- package/dist/codebase-index/codebase-ast-replace-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-impact-analysis-tool.d.ts +5 -4
- package/dist/codebase-index/codebase-incoming-calls-tool.d.ts +4 -3
- package/dist/codebase-index/codebase-index-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-invariant-check-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-outgoing-calls-tool.d.ts +4 -3
- package/dist/codebase-index/codebase-repo-map-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-search-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-skeleton-tool.d.ts +2 -3
- package/dist/codebase-index/codebase-stats-tool.d.ts +9 -3
- package/dist/codebase-index/codebase-targeted-test-tool.d.ts +4 -3
- package/dist/codebase-index/index.d.ts +11 -11
- package/dist/codebase-index/index.js +8 -8
- package/dist/codebase-index/project-server-framing.d.ts +29 -0
- package/dist/codebase-index/project-server-lifecycle.d.ts +20 -0
- package/dist/codebase-index/project-server-operations.d.ts +37 -0
- package/dist/codebase-index/project-server-types.d.ts +30 -0
- package/dist/codebase-index/project-server-watcher.d.ts +25 -0
- package/dist/codebase-index/project-server.js +448 -391
- package/dist/codebase-index/worker.js +2 -2
- package/dist/codebase-index/writer-init.d.ts +13 -0
- package/dist/codebase-index/writer-maintenance.d.ts +14 -0
- package/dist/codebase-index/writer.d.ts +0 -15
- package/dist/design.d.ts +2 -2
- package/dist/design.js +1 -1
- package/dist/diff.d.ts +4 -4
- package/dist/diff.js +1 -1
- package/dist/document.d.ts +3 -4
- package/dist/document.js +1 -1
- package/dist/e2e.d.ts +1 -1
- package/dist/e2e.js +1 -1
- package/dist/edit.d.ts +3 -3
- package/dist/edit.js +6 -6
- package/dist/exec.d.ts +2 -3
- package/dist/exec.js +4 -4
- package/dist/fetch.d.ts +4 -3
- package/dist/fetch.js +1 -1
- package/dist/format.d.ts +17 -45
- package/dist/format.js +12 -8
- package/dist/git.d.ts +3 -3
- package/dist/git.js +1 -1
- package/dist/glob.d.ts +2 -3
- package/dist/glob.js +2 -2
- package/dist/grep.d.ts +7 -5
- package/dist/grep.js +3 -3
- package/dist/index.d.ts +54 -45
- package/dist/index.js +118 -59
- package/dist/install.d.ts +7 -55
- package/dist/install.js +6 -6
- package/dist/json.d.ts +3 -4
- package/dist/json.js +2 -2
- package/dist/kanban-tool-types.d.ts +1 -2
- package/dist/kanban.d.ts +3 -19
- package/dist/kanban.js +1 -1
- package/dist/languages/execute-tool.d.ts +2 -3
- package/dist/languages/index.d.ts +2 -2
- package/dist/languages/index.js +4 -4
- package/dist/languages/tool.d.ts +3 -4
- package/dist/{legacy-bridge-FOV5ODDI.js → legacy-bridge-YXANP5QB.js} +6 -6
- package/dist/lint.d.ts +5 -4
- package/dist/lint.js +6 -6
- package/dist/logs.d.ts +3 -4
- package/dist/logs.js +2 -2
- package/dist/memory.d.ts +7 -8
- package/dist/memory.js +1 -1
- package/dist/mode.d.ts +3 -4
- package/dist/mode.js +1 -1
- package/dist/next-steps-tool.d.ts +2 -3
- package/dist/next-steps.d.ts +4 -0
- package/dist/next-steps.js +9 -175
- package/dist/outdated.d.ts +5 -29
- package/dist/outdated.js +3 -3
- package/dist/pack.js +51 -51
- package/dist/patch.d.ts +2 -3
- package/dist/patch.js +5 -5
- package/dist/plan.d.ts +4 -4
- package/dist/plan.js +3 -3
- package/dist/process-registry.js +2 -2
- package/dist/ps-slash.js +4 -4
- package/dist/pwsh.d.ts +1 -0
- package/dist/read.d.ts +5 -5
- package/dist/read.js +5 -5
- package/dist/replace.d.ts +2 -3
- package/dist/replace.js +6 -6
- package/dist/scaffold.d.ts +7 -3
- package/dist/scaffold.js +3 -1
- package/dist/search.d.ts +17 -3
- package/dist/search.js +5 -1
- package/dist/set-working-dir.d.ts +2 -3
- package/dist/skill.d.ts +4 -5
- package/dist/skill.js +1 -1
- package/dist/task.d.ts +6 -6
- package/dist/task.js +3 -3
- package/dist/test.d.ts +5 -4
- package/dist/test.js +6 -6
- package/dist/todo.d.ts +8 -8
- package/dist/todo.js +2 -2
- package/dist/tool-diff.js +11 -230
- package/dist/tool-help.d.ts +2 -3
- package/dist/tool-help.js +1 -1
- package/dist/tool-search.d.ts +2 -3
- package/dist/tool-search.js +1 -1
- package/dist/tool-summary.js +5 -281
- package/dist/tool-tier.js +52 -52
- package/dist/tool-use.d.ts +2 -3
- package/dist/tool-use.js +1 -1
- package/dist/tree.d.ts +5 -3
- package/dist/tree.js +5 -1
- package/dist/typecheck.d.ts +3 -3
- package/dist/typecheck.js +6 -6
- package/dist/write.d.ts +2 -3
- package/dist/write.js +6 -6
- package/package.json +5 -5
- package/dist/spawn-background.d.ts +0 -80
package/dist/_danger-detect.d.ts
CHANGED
|
@@ -33,6 +33,14 @@ export interface DangerAssessment {
|
|
|
33
33
|
/** Stable id of the matched rule, for tests and config-override. */
|
|
34
34
|
matchedRule?: string;
|
|
35
35
|
}
|
|
36
|
+
export interface DangerRule {
|
|
37
|
+
id: string;
|
|
38
|
+
level: DangerLevel;
|
|
39
|
+
/** Match a (cmd, args) pair. Return true if this rule fires. */
|
|
40
|
+
test: (cmd: string, args: readonly string[]) => boolean;
|
|
41
|
+
/** Human-readable explanation, joined with "; " in the output. */
|
|
42
|
+
reason: string;
|
|
43
|
+
}
|
|
36
44
|
/**
|
|
37
45
|
* Evaluate the danger level of a (cmd, args) pair.
|
|
38
46
|
*
|
package/dist/_syntax-check.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
interface SyntaxCheckResult {
|
|
1
|
+
export interface SyntaxCheckResult {
|
|
2
2
|
/** Parse errors in the new content (capped at {@link MAX_ERRORS}). */
|
|
3
3
|
errors: string[];
|
|
4
4
|
/** True when the pre-edit content already failed to parse — the edit did
|
|
@@ -13,5 +13,4 @@ interface SyntaxCheckResult {
|
|
|
13
13
|
* pre-existing ones.
|
|
14
14
|
*/
|
|
15
15
|
export declare function checkSyntax(filePath: string, content: string, previousContent?: string): Promise<SyntaxCheckResult | undefined>;
|
|
16
|
-
export {};
|
|
17
16
|
//# sourceMappingURL=_syntax-check.d.ts.map
|
package/dist/audit.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { Tool, ToolStreamEvent } from '@wrongstack/core/types';
|
|
2
|
-
interface AuditInput {
|
|
2
|
+
export interface AuditInput {
|
|
3
3
|
cwd?: string | undefined;
|
|
4
4
|
level?: 'low' | 'moderate' | 'high' | 'critical' | undefined;
|
|
5
5
|
fix?: boolean | undefined;
|
|
6
6
|
}
|
|
7
|
-
interface AuditVulnerability {
|
|
7
|
+
export interface AuditVulnerability {
|
|
8
8
|
severity: string;
|
|
9
9
|
package: string;
|
|
10
10
|
title: string;
|
|
11
11
|
url: string;
|
|
12
12
|
}
|
|
13
|
-
interface AuditOutput {
|
|
13
|
+
export interface AuditOutput {
|
|
14
14
|
exit_code: number;
|
|
15
15
|
vulnerabilities: AuditVulnerability[];
|
|
16
16
|
total: number;
|
|
@@ -18,7 +18,7 @@ interface AuditOutput {
|
|
|
18
18
|
output: string;
|
|
19
19
|
truncated: boolean;
|
|
20
20
|
}
|
|
21
|
-
type AuditContext = Parameters<Tool<AuditInput, AuditOutput>['execute']>[1];
|
|
21
|
+
export type AuditContext = Parameters<Tool<AuditInput, AuditOutput>['execute']>[1];
|
|
22
22
|
export declare const auditTool: {
|
|
23
23
|
name: string;
|
|
24
24
|
category: string;
|
|
@@ -54,5 +54,4 @@ export declare const auditTool: {
|
|
|
54
54
|
signal: AbortSignal;
|
|
55
55
|
}): AsyncGenerator<ToolStreamEvent<AuditOutput>>;
|
|
56
56
|
};
|
|
57
|
-
export {};
|
|
58
57
|
//# sourceMappingURL=audit.d.ts.map
|
package/dist/audit.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
auditTool
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-WEEVSWQB.js";
|
|
4
|
+
import "./chunk-T3SMFF5Q.js";
|
|
5
|
+
import "./chunk-7N5U2RAU.js";
|
|
6
|
+
import "./chunk-DRRY6SCM.js";
|
|
7
7
|
import "./chunk-SCMRM6NL.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-HDYUBRMF.js";
|
|
9
|
+
import "./chunk-7JJFC6CT.js";
|
|
10
10
|
import "./chunk-KE7A76VC.js";
|
|
11
11
|
import "./chunk-ZUFHAHTE.js";
|
|
12
12
|
export {
|
|
@@ -1,163 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"- remove or reword items that no longer apply.",
|
|
11
|
-
"Then continue the work. If you are blocked, state exactly what is blocking you instead of repeating the same turn."
|
|
12
|
-
].join("\n");
|
|
13
|
-
function createContinuationAttemptTracker() {
|
|
14
|
-
const attempts = /* @__PURE__ */ new Map();
|
|
15
|
-
const skipped = /* @__PURE__ */ new Set();
|
|
16
|
-
return {
|
|
17
|
-
recordAttempt(todoId) {
|
|
18
|
-
const count = (attempts.get(todoId) ?? 0) + 1;
|
|
19
|
-
attempts.set(todoId, count);
|
|
20
|
-
return count;
|
|
21
|
-
},
|
|
22
|
-
getAttempts(todoId) {
|
|
23
|
-
return attempts.get(todoId) ?? 0;
|
|
24
|
-
},
|
|
25
|
-
markSkipped(todoId) {
|
|
26
|
-
skipped.add(todoId);
|
|
27
|
-
},
|
|
28
|
-
isSkipped(todoId) {
|
|
29
|
-
return skipped.has(todoId);
|
|
30
|
-
},
|
|
31
|
-
reset() {
|
|
32
|
-
attempts.clear();
|
|
33
|
-
skipped.clear();
|
|
34
|
-
},
|
|
35
|
-
snapshot() {
|
|
36
|
-
const result = {};
|
|
37
|
-
const allIds = /* @__PURE__ */ new Set([...attempts.keys(), ...skipped]);
|
|
38
|
-
for (const id of allIds) {
|
|
39
|
-
result[id] = { attempts: attempts.get(id) ?? 0, skipped: skipped.has(id) };
|
|
40
|
-
}
|
|
41
|
-
return result;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
var ADVANCE_PREAMBLES = [
|
|
46
|
-
"Pivoting to the next open item \u2014 previous todo still pending after {attempts} attempt(s).",
|
|
47
|
-
"Shifting focus to a different task while the previous item ({label}) remains open after {attempts} attempt(s).",
|
|
48
|
-
"No board progress on the current item after {attempts} attempt(s). Continuing with the next todo.",
|
|
49
|
-
"The previous item is still unresolved after {attempts} try(ies). Moving on down the list.",
|
|
50
|
-
"Advancing to the next piece of work after {attempts} unproductive attempt(s) on the prior one.",
|
|
51
|
-
"Taking a different angle \u2014 the stalled item ({label}) stays open after {attempts} attempt(s). Pressing ahead.",
|
|
52
|
-
"The todo board shows no movement on the current task after {attempts} attempt(s). Switching gears.",
|
|
53
|
-
"No change on the board from the last {attempts} continuation(s). Proceeding to the next open item."
|
|
54
|
-
];
|
|
55
|
-
function generateAdvancementPrompt(stalledTodo, nextTodo, attemptCount, todos) {
|
|
56
|
-
const idx = Math.max(0, Math.min(attemptCount - 1, ADVANCE_PREAMBLES.length - 1));
|
|
57
|
-
const preamble = ADVANCE_PREAMBLES[idx].replace(
|
|
58
|
-
/\{attempts\}/g,
|
|
59
|
-
() => String(attemptCount)
|
|
60
|
-
).replace(/\{label\}/g, () => stalledTodo.content.slice(0, 72));
|
|
61
|
-
if (!nextTodo) {
|
|
62
|
-
return [
|
|
63
|
-
preamble,
|
|
64
|
-
"",
|
|
65
|
-
"No more open items remain on the todo list. What has been accomplished and what should I do next?"
|
|
66
|
-
].join("\n");
|
|
67
|
-
}
|
|
68
|
-
const itemLabel = nextTodo.status === "in_progress" && nextTodo.activeForm ? nextTodo.activeForm : nextTodo.content;
|
|
69
|
-
const done = todos.filter((t) => t.status === "completed").length;
|
|
70
|
-
const total = todos.length;
|
|
71
|
-
const lines = [preamble, "", `Proceed with: ${itemLabel}`];
|
|
72
|
-
if (total > 0) {
|
|
73
|
-
lines.push("", `Todo board (${done}/${total} done):`);
|
|
74
|
-
lines.push(
|
|
75
|
-
...todos.slice(0, 20).map((t) => {
|
|
76
|
-
const mark = t.status === "completed" ? "[x]" : t.status === "in_progress" ? "[~]" : "[ ]";
|
|
77
|
-
const flat = t.content.replace(/\n|\r/g, " ");
|
|
78
|
-
return ` ${mark} ${flat}`;
|
|
79
|
-
})
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
lines.push(
|
|
83
|
-
"",
|
|
84
|
-
"If this item is already done, mark it complete and move to the next open todo. Keep the board honest as you work."
|
|
85
|
-
);
|
|
86
|
-
return lines.join("\n");
|
|
87
|
-
}
|
|
88
|
-
function matchTodoIdFromPrompt(todos, prompt) {
|
|
89
|
-
if (todos.length === 0 || !prompt) return null;
|
|
90
|
-
const lowerPrompt = prompt.toLowerCase();
|
|
91
|
-
const inProgress = todos.find((t) => t.status === "in_progress");
|
|
92
|
-
if (inProgress) {
|
|
93
|
-
const label = (inProgress.activeForm ?? inProgress.content).toLowerCase();
|
|
94
|
-
if (label.length > 5 && lowerPrompt.includes(label)) {
|
|
95
|
-
return { id: inProgress.id, content: inProgress.activeForm ?? inProgress.content };
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
for (const t of todos) {
|
|
99
|
-
if (t.status === "completed") continue;
|
|
100
|
-
if (inProgress && t.id === inProgress.id) continue;
|
|
101
|
-
const label = (t.activeForm ?? t.content).toLowerCase();
|
|
102
|
-
if (label.length > 5 && lowerPrompt.includes(label)) {
|
|
103
|
-
return { id: t.id, content: t.activeForm ?? t.content };
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
const firstOpen = todos.find((t) => t.status !== "completed");
|
|
107
|
-
return firstOpen ? { id: firstOpen.id, content: firstOpen.activeForm ?? firstOpen.content } : null;
|
|
108
|
-
}
|
|
109
|
-
var MAX_ADVANCEMENT_ATTEMPTS = 9;
|
|
110
|
-
function createAutoProceedLoopGuard(options = {}) {
|
|
111
|
-
const safeIntegerOption = (value, fallback) => {
|
|
112
|
-
if (value === void 0) return fallback;
|
|
113
|
-
if (!Number.isFinite(value)) return fallback;
|
|
114
|
-
return Math.floor(value);
|
|
115
|
-
};
|
|
116
|
-
const repeatThreshold = Math.max(2, safeIntegerOption(options.repeatThreshold, 2));
|
|
117
|
-
const windowSize = Math.max(repeatThreshold, safeIntegerOption(options.windowSize, 3));
|
|
118
|
-
let buffer = [];
|
|
119
|
-
let steeredFor = null;
|
|
120
|
-
function record(prompt) {
|
|
121
|
-
const normalized = normalizeForRepetition(prompt);
|
|
122
|
-
buffer.push(normalized);
|
|
123
|
-
if (buffer.length > windowSize) {
|
|
124
|
-
buffer = buffer.slice(buffer.length - windowSize);
|
|
125
|
-
}
|
|
126
|
-
let runLength = 0;
|
|
127
|
-
for (let i = buffer.length - 1; i >= 0; i--) {
|
|
128
|
-
if (buffer[i] === normalized) runLength++;
|
|
129
|
-
else break;
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
normalized,
|
|
133
|
-
runLength,
|
|
134
|
-
shouldHalt: runLength >= repeatThreshold
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
function recordGrounded(prompt) {
|
|
138
|
-
const signal = record(prompt);
|
|
139
|
-
if (!signal.shouldHalt) {
|
|
140
|
-
steeredFor = null;
|
|
141
|
-
return { ...signal, shouldHalt: false, action: "feed" };
|
|
142
|
-
}
|
|
143
|
-
if (steeredFor === signal.normalized) {
|
|
144
|
-
return { ...signal, action: "halt" };
|
|
145
|
-
}
|
|
146
|
-
steeredFor = signal.normalized;
|
|
147
|
-
return { ...signal, shouldHalt: false, action: "steer" };
|
|
148
|
-
}
|
|
149
|
-
function reset() {
|
|
150
|
-
buffer = [];
|
|
151
|
-
steeredFor = null;
|
|
152
|
-
}
|
|
153
|
-
function history() {
|
|
154
|
-
return buffer.slice();
|
|
155
|
-
}
|
|
156
|
-
function size() {
|
|
157
|
-
return buffer.length;
|
|
158
|
-
}
|
|
159
|
-
return { record, recordGrounded, reset, history, size };
|
|
160
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
GROUNDED_NO_PROGRESS_STEER,
|
|
3
|
+
MAX_ADVANCEMENT_ATTEMPTS,
|
|
4
|
+
createAutoProceedLoopGuard,
|
|
5
|
+
createContinuationAttemptTracker,
|
|
6
|
+
generateAdvancementPrompt,
|
|
7
|
+
matchTodoIdFromPrompt,
|
|
8
|
+
normalizeForRepetition
|
|
9
|
+
} from "./chunk-37QKUQ2Z.js";
|
|
161
10
|
export {
|
|
162
11
|
GROUNDED_NO_PROGRESS_STEER,
|
|
163
12
|
MAX_ADVANCEMENT_ATTEMPTS,
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* destructive detection as the primary controls; this guard is a best-effort
|
|
41
41
|
* fast path for the common non-obfuscated forms.
|
|
42
42
|
*/
|
|
43
|
-
interface KillCommand {
|
|
43
|
+
export interface KillCommand {
|
|
44
44
|
pid?: number;
|
|
45
45
|
name?: string;
|
|
46
46
|
signal?: string;
|
|
@@ -48,7 +48,7 @@ interface KillCommand {
|
|
|
48
48
|
isAllKill: boolean;
|
|
49
49
|
originalCommand: string;
|
|
50
50
|
}
|
|
51
|
-
interface KillCheckResult {
|
|
51
|
+
export interface KillCheckResult {
|
|
52
52
|
blocked: boolean;
|
|
53
53
|
reason?: string;
|
|
54
54
|
}
|
|
@@ -65,5 +65,4 @@ export declare function checkAndBlockKillCommand(command: string): Promise<KillC
|
|
|
65
65
|
* Get a safe error message for blocked kill commands.
|
|
66
66
|
*/
|
|
67
67
|
export declare function getBlockedKillMessage(pid: number, signal?: string): string;
|
|
68
|
-
export {};
|
|
69
68
|
//# sourceMappingURL=bash-kill-guard.d.ts.map
|
package/dist/bash.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Tool } from '@wrongstack/core/types';
|
|
2
|
-
interface BashInput {
|
|
2
|
+
export interface BashInput {
|
|
3
3
|
command: string;
|
|
4
4
|
timeout_ms?: number | undefined;
|
|
5
5
|
background?: boolean | undefined;
|
|
6
6
|
}
|
|
7
|
-
interface BashOutput {
|
|
7
|
+
export interface BashOutput {
|
|
8
8
|
output: string;
|
|
9
9
|
exit_code: number | null;
|
|
10
10
|
timed_out: boolean;
|
|
@@ -12,5 +12,4 @@ interface BashOutput {
|
|
|
12
12
|
error?: string | undefined;
|
|
13
13
|
}
|
|
14
14
|
export declare const bashTool: Tool<BashInput, BashOutput>;
|
|
15
|
-
export type { BashInput, BashOutput };
|
|
16
15
|
//# sourceMappingURL=bash.d.ts.map
|
package/dist/bash.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bashTool
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NN2SNP2R.js";
|
|
4
4
|
import "./chunk-BTSFTGIL.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-PVCB7RUZ.js";
|
|
6
6
|
import "./chunk-SCMRM6NL.js";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-HDYUBRMF.js";
|
|
8
|
+
import "./chunk-7JJFC6CT.js";
|
|
9
9
|
import "./chunk-KE7A76VC.js";
|
|
10
10
|
import "./chunk-ZUFHAHTE.js";
|
|
11
11
|
export {
|
package/dist/batch-tool-use.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Tool } from '@wrongstack/core/types';
|
|
2
|
-
interface BatchToolUseInput {
|
|
2
|
+
export interface BatchToolUseInput {
|
|
3
3
|
calls: {
|
|
4
4
|
tool: string;
|
|
5
5
|
input: Record<string, unknown>;
|
|
@@ -7,7 +7,7 @@ interface BatchToolUseInput {
|
|
|
7
7
|
stop_on_error?: boolean | undefined;
|
|
8
8
|
parallel?: boolean | undefined;
|
|
9
9
|
}
|
|
10
|
-
interface BatchToolUseOutput {
|
|
10
|
+
export interface BatchToolUseOutput {
|
|
11
11
|
results: {
|
|
12
12
|
tool: string;
|
|
13
13
|
success: boolean;
|
|
@@ -21,5 +21,4 @@ interface BatchToolUseOutput {
|
|
|
21
21
|
stop_on_error: boolean;
|
|
22
22
|
}
|
|
23
23
|
export declare const batchToolUseTool: Tool<BatchToolUseInput, BatchToolUseOutput>;
|
|
24
|
-
export {};
|
|
25
24
|
//# sourceMappingURL=batch-tool-use.d.ts.map
|
package/dist/batch-tool-use.js
CHANGED
package/dist/browser/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { BrowserArtifactStore } from './artifacts.js';
|
|
|
2
2
|
export { type BrowserLauncher, BrowserSessionManager, browserInstallationDiagnostics, } from './manager.js';
|
|
3
3
|
export { BrowserNetworkGuardProxy } from './network-guard-proxy.js';
|
|
4
4
|
export { assertBrowserUrlAllowed, type BrowserDnsLookup, type BrowserResolvedTarget, parsePrivateOriginAllowlist, redactBrowserText, resolvePinnedBrowserTarget, safeBrowserUrl, } from './security.js';
|
|
5
|
-
export { browserClickTool, browserCloseTool, browserDragTool, browserEvaluateTool, browserHoverTool, browserListTool, browserNavigateTool, browserOpenTool, browserPressTool, browserScreenshotTool, browserSelectTool, browserSnapshotTool, browserStatusTool, browserTools, browserTypeTool, browserUploadTool, browserWaitTool, shutdownBrowserTools, } from './tools.js';
|
|
5
|
+
export { browserClickTool, browserCloseTool, browserDragTool, browserEvaluateTool, browserHoverTool, browserListTool, browserNavigateTool, browserOpenTool, browserPressTool, browserScreenshotTool, browserSelectTool, browserSnapshotTool, browserStatusTool, browserTools, browserTypeTool, browserUploadTool, browserWaitTool, shutdownBrowserTools, type BrowserCloseInput, type BrowserDragInput, type BrowserEvaluateInput, type BrowserNavigateInput, type BrowserOpenInput, type BrowserPressInput, type BrowserScreenshotInput, type BrowserSelectInput, type BrowserSelectorInput, type BrowserSnapshotInput, type BrowserTypeInput, type BrowserUploadInput, type BrowserWaitInput, } from './tools.js';
|
|
6
6
|
export type { BrowserArtifact, BrowserArtifactKind, BrowserConsoleEntry, BrowserManagerOptions, BrowserNetworkEntry, BrowserOpenOptions, BrowserSessionSummary, BrowserSnapshot, } from './types.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.js
CHANGED
package/dist/browser/tools.d.ts
CHANGED
|
@@ -1,77 +1,88 @@
|
|
|
1
1
|
import type { Context } from '@wrongstack/core/agent';
|
|
2
2
|
import type { Tool } from '@wrongstack/core/types';
|
|
3
|
-
export
|
|
3
|
+
export interface BrowserOpenInput {
|
|
4
4
|
url?: string | undefined;
|
|
5
5
|
width?: number | undefined;
|
|
6
6
|
height?: number | undefined;
|
|
7
7
|
trace?: boolean | undefined;
|
|
8
|
-
}
|
|
9
|
-
export
|
|
10
|
-
name: string;
|
|
11
|
-
description: string;
|
|
12
|
-
permission: "auto";
|
|
13
|
-
mutating: false;
|
|
14
|
-
riskTier: "safe";
|
|
15
|
-
capabilities: "net.outbound"[];
|
|
16
|
-
inputSchema: {
|
|
17
|
-
type: string;
|
|
18
|
-
properties: {};
|
|
19
|
-
};
|
|
20
|
-
execute(_input: Record<string, never>, ctx: Context, _opts?: {
|
|
21
|
-
signal: AbortSignal;
|
|
22
|
-
}): Promise<string>;
|
|
23
|
-
};
|
|
24
|
-
export declare const browserStatusTool: Tool<Record<string, never>>;
|
|
25
|
-
export declare const browserNavigateTool: Tool<{
|
|
8
|
+
}
|
|
9
|
+
export interface BrowserNavigateInput {
|
|
26
10
|
sessionId: string;
|
|
27
11
|
url: string;
|
|
28
|
-
}
|
|
29
|
-
export
|
|
12
|
+
}
|
|
13
|
+
export interface BrowserSnapshotInput {
|
|
30
14
|
sessionId: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
15
|
+
}
|
|
16
|
+
export interface BrowserScreenshotInput {
|
|
33
17
|
sessionId: string;
|
|
34
18
|
fullPage?: boolean | undefined;
|
|
35
19
|
selector?: string | undefined;
|
|
36
|
-
}
|
|
37
|
-
|
|
20
|
+
}
|
|
21
|
+
export interface BrowserSelectorInput {
|
|
38
22
|
sessionId: string;
|
|
39
23
|
selector: string;
|
|
40
|
-
}
|
|
41
|
-
export
|
|
42
|
-
export declare const browserHoverTool: Tool<SelectorInput, unknown>;
|
|
43
|
-
export declare const browserTypeTool: Tool<SelectorInput & {
|
|
24
|
+
}
|
|
25
|
+
export interface BrowserTypeInput extends BrowserSelectorInput {
|
|
44
26
|
text?: string | undefined;
|
|
45
27
|
secretEnv?: string | undefined;
|
|
46
|
-
}
|
|
47
|
-
export
|
|
28
|
+
}
|
|
29
|
+
export interface BrowserSelectInput extends BrowserSelectorInput {
|
|
48
30
|
value: string;
|
|
49
|
-
}
|
|
50
|
-
export
|
|
31
|
+
}
|
|
32
|
+
export interface BrowserPressInput {
|
|
51
33
|
sessionId: string;
|
|
52
34
|
key: string;
|
|
53
|
-
}
|
|
54
|
-
export
|
|
35
|
+
}
|
|
36
|
+
export interface BrowserDragInput {
|
|
55
37
|
sessionId: string;
|
|
56
38
|
from: string;
|
|
57
39
|
to: string;
|
|
58
|
-
}
|
|
59
|
-
export
|
|
40
|
+
}
|
|
41
|
+
export interface BrowserWaitInput {
|
|
60
42
|
sessionId: string;
|
|
61
43
|
selector?: string | undefined;
|
|
62
44
|
timeoutMs?: number | undefined;
|
|
63
|
-
}
|
|
64
|
-
export
|
|
45
|
+
}
|
|
46
|
+
export interface BrowserEvaluateInput {
|
|
65
47
|
sessionId: string;
|
|
66
48
|
expression: string;
|
|
67
|
-
}
|
|
68
|
-
export
|
|
49
|
+
}
|
|
50
|
+
export interface BrowserUploadInput extends BrowserSelectorInput {
|
|
69
51
|
files: string[];
|
|
70
|
-
}
|
|
71
|
-
export
|
|
52
|
+
}
|
|
53
|
+
export interface BrowserCloseInput {
|
|
72
54
|
sessionId: string;
|
|
73
|
-
}
|
|
55
|
+
}
|
|
56
|
+
export declare const browserOpenTool: Tool<BrowserOpenInput>;
|
|
57
|
+
export declare const browserListTool: {
|
|
58
|
+
name: string;
|
|
59
|
+
description: string;
|
|
60
|
+
permission: "auto";
|
|
61
|
+
mutating: false;
|
|
62
|
+
riskTier: "safe";
|
|
63
|
+
capabilities: "net.outbound"[];
|
|
64
|
+
inputSchema: {
|
|
65
|
+
type: string;
|
|
66
|
+
properties: {};
|
|
67
|
+
};
|
|
68
|
+
execute(_input: Record<string, never>, ctx: Context, _opts?: {
|
|
69
|
+
signal: AbortSignal;
|
|
70
|
+
}): Promise<string>;
|
|
71
|
+
};
|
|
72
|
+
export declare const browserStatusTool: Tool<Record<string, never>>;
|
|
73
|
+
export declare const browserNavigateTool: Tool<BrowserNavigateInput>;
|
|
74
|
+
export declare const browserSnapshotTool: Tool<BrowserSnapshotInput>;
|
|
75
|
+
export declare const browserScreenshotTool: Tool<BrowserScreenshotInput>;
|
|
76
|
+
export declare const browserClickTool: Tool<BrowserSelectorInput, unknown>;
|
|
77
|
+
export declare const browserHoverTool: Tool<BrowserSelectorInput, unknown>;
|
|
78
|
+
export declare const browserTypeTool: Tool<BrowserTypeInput>;
|
|
79
|
+
export declare const browserSelectTool: Tool<BrowserSelectInput>;
|
|
80
|
+
export declare const browserPressTool: Tool<BrowserPressInput>;
|
|
81
|
+
export declare const browserDragTool: Tool<BrowserDragInput>;
|
|
82
|
+
export declare const browserWaitTool: Tool<BrowserWaitInput>;
|
|
83
|
+
export declare const browserEvaluateTool: Tool<BrowserEvaluateInput>;
|
|
84
|
+
export declare const browserUploadTool: Tool<BrowserUploadInput>;
|
|
85
|
+
export declare const browserCloseTool: Tool<BrowserCloseInput>;
|
|
74
86
|
export declare const browserTools: Tool[];
|
|
75
87
|
export declare function shutdownBrowserTools(): Promise<void>;
|
|
76
|
-
export {};
|
|
77
88
|
//# sourceMappingURL=tools.d.ts.map
|
package/dist/builtin.js
CHANGED
|
@@ -6,67 +6,67 @@ import {
|
|
|
6
6
|
TIER2_TOOLS,
|
|
7
7
|
TIER3_TOOLS,
|
|
8
8
|
builtinTools
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-AB2CAUOP.js";
|
|
10
|
+
import "./chunk-RV7BVTDG.js";
|
|
11
|
+
import "./chunk-YEISRT4S.js";
|
|
12
12
|
import "./chunk-XRNN44QY.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
-
import "./chunk-
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-5KS24LTS.js";
|
|
14
|
+
import "./chunk-LQSOU63Z.js";
|
|
15
|
+
import "./chunk-24T5XIJU.js";
|
|
16
|
+
import "./chunk-B3MGJBFI.js";
|
|
17
|
+
import "./chunk-VBF2YXUW.js";
|
|
18
|
+
import "./chunk-7ODZTPCU.js";
|
|
19
|
+
import "./chunk-IXIS7RSG.js";
|
|
20
|
+
import "./chunk-QA6IASYX.js";
|
|
21
|
+
import "./chunk-O6BY43ZB.js";
|
|
22
|
+
import "./chunk-WEEVSWQB.js";
|
|
23
|
+
import "./chunk-6GOZTS6F.js";
|
|
24
|
+
import "./chunk-VU3QBYL4.js";
|
|
25
|
+
import "./chunk-CHEK3ASV.js";
|
|
26
|
+
import "./chunk-KLJZ4WV4.js";
|
|
27
|
+
import "./chunk-AQ5YBURX.js";
|
|
28
|
+
import "./chunk-CGXTR34H.js";
|
|
29
|
+
import "./chunk-VZGPASGD.js";
|
|
30
|
+
import "./chunk-7HL23T3T.js";
|
|
31
|
+
import "./chunk-JDOO4P6Z.js";
|
|
32
|
+
import "./chunk-3D5DJWOE.js";
|
|
33
|
+
import "./chunk-NJX2RXKJ.js";
|
|
34
|
+
import "./chunk-4WPBS45A.js";
|
|
35
|
+
import "./chunk-T3SMFF5Q.js";
|
|
36
|
+
import "./chunk-7N5U2RAU.js";
|
|
37
|
+
import "./chunk-DRRY6SCM.js";
|
|
38
|
+
import "./chunk-IYH4OHBP.js";
|
|
39
|
+
import "./chunk-ASEXQRA7.js";
|
|
40
|
+
import "./chunk-4ERMPDHV.js";
|
|
41
|
+
import "./chunk-YJTXRH5Y.js";
|
|
42
42
|
import "./chunk-ZBMANLYH.js";
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-NN2SNP2R.js";
|
|
44
|
+
import "./chunk-KDEXUQY7.js";
|
|
45
45
|
import "./chunk-BTSFTGIL.js";
|
|
46
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-PVCB7RUZ.js";
|
|
47
47
|
import "./chunk-SCMRM6NL.js";
|
|
48
|
-
import "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-HDYUBRMF.js";
|
|
49
|
+
import "./chunk-7JJFC6CT.js";
|
|
50
|
+
import "./chunk-MJSJWXBF.js";
|
|
51
|
+
import "./chunk-62OAECEQ.js";
|
|
52
52
|
import "./chunk-NBDZMMG2.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-FBUP524S.js";
|
|
54
|
+
import "./chunk-SMARDKAC.js";
|
|
55
55
|
import "./chunk-X6KXNHUO.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
62
|
-
import "./chunk-
|
|
63
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-SOR7OCYP.js";
|
|
57
|
+
import "./chunk-MK2JK35J.js";
|
|
58
|
+
import "./chunk-GKSG5CPH.js";
|
|
59
|
+
import "./chunk-DK4J2WMH.js";
|
|
60
|
+
import "./chunk-MSOAX3GC.js";
|
|
61
|
+
import "./chunk-ZTCJCYLN.js";
|
|
62
|
+
import "./chunk-GDDXX27P.js";
|
|
63
|
+
import "./chunk-N3K2SFEI.js";
|
|
64
64
|
import "./chunk-NU2IZ72J.js";
|
|
65
65
|
import "./chunk-VVZPQPTY.js";
|
|
66
66
|
import "./chunk-6IEBD27U.js";
|
|
67
67
|
import "./chunk-UCYQTZ7F.js";
|
|
68
68
|
import "./chunk-YOHO4DVT.js";
|
|
69
|
-
import "./chunk-
|
|
69
|
+
import "./chunk-2CTZW6JQ.js";
|
|
70
70
|
import "./chunk-KE7A76VC.js";
|
|
71
71
|
import "./chunk-ZUFHAHTE.js";
|
|
72
72
|
export {
|
|
@@ -35,7 +35,7 @@ function compileGitignore(lines) {
|
|
|
35
35
|
}
|
|
36
36
|
const hasNegation = rules.some((r) => r.negated);
|
|
37
37
|
return (relPath, isDir) => {
|
|
38
|
-
const p = relPath.
|
|
38
|
+
const p = relPath.replace(/\\/g, "/").replace(/^\.\//, "").replace(/^\/+/, "");
|
|
39
39
|
let ignored = false;
|
|
40
40
|
for (const r of rules) {
|
|
41
41
|
const re = r.dirOnly && !isDir ? r.under : r.eqOrUnder;
|
|
@@ -61,4 +61,4 @@ export {
|
|
|
61
61
|
compileGitignore,
|
|
62
62
|
loadGitignoreMatcher
|
|
63
63
|
};
|
|
64
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-2CTZW6JQ.js.map
|