@speculoai/baton 0.0.0-stage → 0.5.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 +21 -0
- package/README.md +171 -2
- package/README.zh-CN.md +172 -0
- package/dist/adapters/agy.js +67 -0
- package/dist/adapters/claude.js +86 -0
- package/dist/adapters/codex.js +114 -0
- package/dist/adapters/common.js +25 -0
- package/dist/adapters/cursor.js +104 -0
- package/dist/adapters/index.js +6 -0
- package/dist/cli.js +224 -0
- package/dist/contract.js +42 -0
- package/dist/git.js +220 -0
- package/dist/install-ui.js +74 -0
- package/dist/install.js +221 -0
- package/dist/mcp.js +95 -0
- package/dist/process.js +23 -0
- package/dist/redact.js +9 -0
- package/dist/rules.js +394 -0
- package/dist/scope.js +108 -0
- package/dist/store.js +105 -0
- package/dist/supervisor.js +320 -0
- package/dist/tail.js +64 -0
- package/dist/tasks.js +417 -0
- package/dist/types.js +1 -0
- package/dist/worktree.js +345 -0
- package/package.json +36 -4
package/dist/install.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { which } from "./adapters/common.js";
|
|
5
|
+
import { batonHome } from "./store.js";
|
|
6
|
+
export const REPO = "https://github.com/SpeculoAI/baton";
|
|
7
|
+
const PLUGIN_ID = "baton@speculoai";
|
|
8
|
+
const OLD_ID = "baton@agent-plugin-agent";
|
|
9
|
+
const OLD_MARKET = "agent-plugin-agent";
|
|
10
|
+
export const HOSTS = [
|
|
11
|
+
{
|
|
12
|
+
id: "claude",
|
|
13
|
+
label: "Claude Code",
|
|
14
|
+
bins: ["claude"],
|
|
15
|
+
migrate: [
|
|
16
|
+
{ args: ["plugin", "uninstall", OLD_ID], soft: true },
|
|
17
|
+
{ args: ["plugin", "marketplace", "remove", OLD_MARKET], soft: true },
|
|
18
|
+
],
|
|
19
|
+
install: [
|
|
20
|
+
{ args: ["plugin", "marketplace", "add", REPO], soft: true },
|
|
21
|
+
{ args: ["plugin", "install", PLUGIN_ID] },
|
|
22
|
+
],
|
|
23
|
+
update: [
|
|
24
|
+
{ args: ["plugin", "marketplace", "update", "speculoai"] },
|
|
25
|
+
{ args: ["plugin", "update", PLUGIN_ID] },
|
|
26
|
+
],
|
|
27
|
+
uninstall: [{ args: ["plugin", "uninstall", PLUGIN_ID] }],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "codex",
|
|
31
|
+
label: "Codex CLI",
|
|
32
|
+
bins: ["codex"],
|
|
33
|
+
migrate: [
|
|
34
|
+
{ args: ["plugin", "remove", OLD_ID], soft: true },
|
|
35
|
+
{ args: ["plugin", "marketplace", "remove", OLD_MARKET], soft: true },
|
|
36
|
+
],
|
|
37
|
+
install: [
|
|
38
|
+
{ args: ["plugin", "marketplace", "add", REPO], soft: true },
|
|
39
|
+
{ args: ["plugin", "add", PLUGIN_ID] },
|
|
40
|
+
],
|
|
41
|
+
update: [
|
|
42
|
+
{ args: ["plugin", "marketplace", "upgrade", "speculoai"] },
|
|
43
|
+
{ args: ["plugin", "add", PLUGIN_ID] },
|
|
44
|
+
],
|
|
45
|
+
uninstall: [{ args: ["plugin", "remove", PLUGIN_ID] }],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "cursor",
|
|
49
|
+
label: "Cursor Agent CLI",
|
|
50
|
+
bins: ["agent", "cursor-agent"],
|
|
51
|
+
note: "Run /add-plugin baton in a Cursor chat",
|
|
52
|
+
migrate: [{ args: ["plugin", "marketplace", "remove", OLD_MARKET], soft: true }],
|
|
53
|
+
install: [{ args: ["plugin", "marketplace", "add", REPO] }],
|
|
54
|
+
update: [{ args: ["plugin", "marketplace", "update", "speculoai"] }],
|
|
55
|
+
uninstall: [{ args: ["plugin", "marketplace", "remove", "speculoai"] }],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "agy",
|
|
59
|
+
label: "Antigravity",
|
|
60
|
+
bins: ["agy"],
|
|
61
|
+
install: [{ args: ["plugin", "install", REPO] }],
|
|
62
|
+
update: [{ args: ["plugin", "install", REPO] }],
|
|
63
|
+
uninstall: [{ args: ["plugin", "uninstall", "baton"] }],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "gemini",
|
|
67
|
+
label: "Gemini CLI",
|
|
68
|
+
bins: ["gemini"],
|
|
69
|
+
install: [{ args: ["extensions", "install", REPO, "--consent"] }],
|
|
70
|
+
update: [{ args: ["extensions", "update", "baton"] }],
|
|
71
|
+
uninstall: [{ args: ["extensions", "uninstall", "baton"] }],
|
|
72
|
+
},
|
|
73
|
+
];
|
|
74
|
+
export function detectedHosts(env = process.env) {
|
|
75
|
+
return HOSTS.filter((host) => which(host.bins, env)).map((host) => ({ id: host.id, label: host.label }));
|
|
76
|
+
}
|
|
77
|
+
export function commandsFor(id, action, opts = {}) {
|
|
78
|
+
const host = HOSTS.find((item) => item.id === id);
|
|
79
|
+
if (!host)
|
|
80
|
+
throw new Error(`Unknown agent: ${id}`);
|
|
81
|
+
if (action !== "install")
|
|
82
|
+
return host[action];
|
|
83
|
+
const forced = opts.force ? host.uninstall.map((step) => ({ ...step, soft: true })) : [];
|
|
84
|
+
return [...(host.migrate ?? []), ...forced, ...host.install];
|
|
85
|
+
}
|
|
86
|
+
export function planInstall(input) {
|
|
87
|
+
const env = input.env ?? process.env;
|
|
88
|
+
const known = new Set(HOSTS.map((host) => host.id));
|
|
89
|
+
for (const id of input.only ?? [])
|
|
90
|
+
if (!known.has(id))
|
|
91
|
+
throw new Error(`Unknown agent: ${id}`);
|
|
92
|
+
const ids = input.only?.length
|
|
93
|
+
? input.only
|
|
94
|
+
: input.action === "install"
|
|
95
|
+
? HOSTS.filter((host) => which(host.bins, env)).map((host) => host.id)
|
|
96
|
+
: input.recorded ?? readInstalled();
|
|
97
|
+
const hosts = [];
|
|
98
|
+
const missing = [];
|
|
99
|
+
for (const id of ids) {
|
|
100
|
+
const host = HOSTS.find((item) => item.id === id);
|
|
101
|
+
if (!host)
|
|
102
|
+
throw new Error(`Unknown agent: ${id}`);
|
|
103
|
+
const bin = which(host.bins, env);
|
|
104
|
+
if (!bin) {
|
|
105
|
+
if (input.only?.length)
|
|
106
|
+
throw new Error(`${id} not detected.`);
|
|
107
|
+
missing.push(id);
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
hosts.push({
|
|
111
|
+
id,
|
|
112
|
+
bin,
|
|
113
|
+
commands: commandsFor(id, input.action, { force: input.force }).map((step) => step.args),
|
|
114
|
+
...(host.note && input.action === "install" ? { note: host.note } : {}),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (input.action === "uninstall" || input.skipGlobal)
|
|
118
|
+
return { hosts, missing };
|
|
119
|
+
const version = JSON.parse(fs.readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
120
|
+
const spec = input.action === "update" ? "@speculoai/baton@latest" : `@speculoai/baton@${version}`;
|
|
121
|
+
return { hosts, missing, global: { command: [process.platform === "win32" ? "npm.cmd" : "npm", "install", "-g", spec] } };
|
|
122
|
+
}
|
|
123
|
+
export function readInstalled(home = batonHome()) {
|
|
124
|
+
try {
|
|
125
|
+
const data = JSON.parse(fs.readFileSync(path.join(home, "installed.json"), "utf8"));
|
|
126
|
+
return Array.isArray(data.hosts) ? data.hosts.filter((id) => typeof id === "string") : [];
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
export function writeInstalled(ids, home = batonHome()) {
|
|
133
|
+
fs.mkdirSync(home, { recursive: true });
|
|
134
|
+
fs.writeFileSync(path.join(home, "installed.json"), `${JSON.stringify({ hosts: [...new Set(ids)] })}\n`);
|
|
135
|
+
}
|
|
136
|
+
function defaultSpawn(command, args, env) {
|
|
137
|
+
return new Promise((resolve) => {
|
|
138
|
+
const child = spawn(command, args, { env, stdio: ["inherit", "pipe", "pipe"] });
|
|
139
|
+
let stdout = "";
|
|
140
|
+
let stderr = "";
|
|
141
|
+
let settled = false;
|
|
142
|
+
const finish = (result) => { if (!settled) {
|
|
143
|
+
settled = true;
|
|
144
|
+
resolve(result);
|
|
145
|
+
} };
|
|
146
|
+
child.stdout?.on("data", (chunk) => { stdout += chunk; process.stderr.write(chunk); });
|
|
147
|
+
child.stderr?.on("data", (chunk) => { stderr += chunk; process.stderr.write(chunk); });
|
|
148
|
+
child.on("error", (error) => finish({ status: 1, stderr: error.message }));
|
|
149
|
+
child.on("close", (status) => finish({ status, stdout, stderr }));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function failText(ran) {
|
|
153
|
+
return `${ran.stderr || ran.stdout || ""}`.trim().slice(-500) || `exit code ${ran.status}`;
|
|
154
|
+
}
|
|
155
|
+
export async function runInstall(input) {
|
|
156
|
+
const env = input.env ?? process.env;
|
|
157
|
+
const home = input.home ?? batonHome();
|
|
158
|
+
let only = input.only;
|
|
159
|
+
if (input.action === "install" && !only?.length && input.selectHosts) {
|
|
160
|
+
const detected = detectedHosts(env);
|
|
161
|
+
if (!detected.length)
|
|
162
|
+
return { exitCode: 0, result: { action: input.action, hosts: [] } };
|
|
163
|
+
const picked = await input.selectHosts(detected);
|
|
164
|
+
if (!picked?.length)
|
|
165
|
+
return { exitCode: 0, result: { action: input.action, hosts: [] } };
|
|
166
|
+
only = picked;
|
|
167
|
+
}
|
|
168
|
+
const planned = planInstall({ action: input.action, only, force: input.force, skipGlobal: input.skipGlobal, env, recorded: readInstalled(home) });
|
|
169
|
+
if (input.dryRun) {
|
|
170
|
+
return {
|
|
171
|
+
exitCode: 0,
|
|
172
|
+
result: { action: input.action, dry_run: true, ...(planned.global ? { global: planned.global } : {}), hosts: planned.hosts, ...(planned.missing.length ? { missing: planned.missing } : {}) },
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
const spawn = input.spawn ?? ((command, args) => defaultSpawn(command, args, env));
|
|
176
|
+
const report = input.onProgress;
|
|
177
|
+
let global;
|
|
178
|
+
if (planned.global) {
|
|
179
|
+
report?.({ type: "global", phase: "start" });
|
|
180
|
+
const ran = await spawn(planned.global.command[0], planned.global.command.slice(1));
|
|
181
|
+
global = ran.status === 0 ? { ok: true } : { ok: false, error: failText(ran) };
|
|
182
|
+
report?.({ type: "global", phase: "done", ok: global.ok, ...(global.error ? { error: global.error } : {}) });
|
|
183
|
+
}
|
|
184
|
+
const hosts = [];
|
|
185
|
+
for (const host of planned.hosts) {
|
|
186
|
+
report?.({ type: "host", phase: "start", id: host.id });
|
|
187
|
+
let error;
|
|
188
|
+
let skipped = false;
|
|
189
|
+
for (const step of commandsFor(host.id, input.action, { force: input.force })) {
|
|
190
|
+
const ran = await spawn(host.bin, step.args);
|
|
191
|
+
if (ran.status === 0 || step.soft)
|
|
192
|
+
continue;
|
|
193
|
+
if (/already installed/i.test(`${ran.stdout || ""}\n${ran.stderr || ""}`)) {
|
|
194
|
+
skipped = true;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
error = failText(ran);
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
const note = skipped ? "already installed, skipped" : host.note;
|
|
201
|
+
const row = { id: host.id, ok: !error, ...(note ? { note } : {}), ...(error ? { error } : {}) };
|
|
202
|
+
hosts.push(row);
|
|
203
|
+
report?.({ type: "host", phase: "done", id: host.id, ok: row.ok, ...(note ? { note } : {}), ...(error ? { error } : {}) });
|
|
204
|
+
}
|
|
205
|
+
if (input.action !== "update") {
|
|
206
|
+
const recorded = new Set(readInstalled(home));
|
|
207
|
+
for (const host of hosts) {
|
|
208
|
+
if (!host.ok)
|
|
209
|
+
continue;
|
|
210
|
+
if (input.action === "install")
|
|
211
|
+
recorded.add(host.id);
|
|
212
|
+
else
|
|
213
|
+
recorded.delete(host.id);
|
|
214
|
+
}
|
|
215
|
+
writeInstalled([...recorded], home);
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
exitCode: hosts.some((host) => !host.ok) ? 1 : 0,
|
|
219
|
+
result: { action: input.action, ...(global ? { global } : {}), hosts, ...(planned.missing.length ? { missing: planned.missing } : {}) },
|
|
220
|
+
};
|
|
221
|
+
}
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { agents, cancel, ls, reply, start, status, wait } from "./tasks.js";
|
|
5
|
+
import { redact } from "./redact.js";
|
|
6
|
+
const MAX_WAIT_SECONDS = 55;
|
|
7
|
+
const PROGRESS_MS = 15_000;
|
|
8
|
+
// Each tool only delegates to tasks.ts; the MCP process keeps no task state, so tasks remain readable after a restart.
|
|
9
|
+
async function respond(run) {
|
|
10
|
+
let value;
|
|
11
|
+
try {
|
|
12
|
+
value = await run();
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
value = { status: "failed", summary: redact(error.message) };
|
|
16
|
+
}
|
|
17
|
+
return { content: [{ type: "text", text: JSON.stringify(value) }] };
|
|
18
|
+
}
|
|
19
|
+
export function createServer() {
|
|
20
|
+
const server = new McpServer({ name: "baton", version: "0.3.0" });
|
|
21
|
+
server.registerTool("list_agents", { description: "List local CLIs available for delegation and whether each is installed." }, () => respond(() => ({ agents: agents() })));
|
|
22
|
+
server.registerTool("delegate_task", {
|
|
23
|
+
description: "Delegate a bounded task to another local AI CLI. Returns task_id immediately (status=running); the task runs in a separate process and survives exit of this MCP process or the host session. Then use task_wait for a bounded wait.",
|
|
24
|
+
inputSchema: {
|
|
25
|
+
target_agent: z.enum(["codex", "claude", "cursor", "agy"]),
|
|
26
|
+
prompt: z.string(),
|
|
27
|
+
files: z.array(z.string()).optional(),
|
|
28
|
+
reasoning_effort: z.enum(["low", "medium", "high", "ultra"]).optional(),
|
|
29
|
+
model: z.string().optional().describe("Per-task model (cursor only for now; stored in meta and carried over by reply)."),
|
|
30
|
+
idle_timeout_seconds: z.number().optional().describe("Stop after this long with no output at all; default 600."),
|
|
31
|
+
max_duration_seconds: z.number().optional().describe("Maximum total duration per turn; default unlimited."),
|
|
32
|
+
cwd: z.string().optional(),
|
|
33
|
+
scope: z.array(z.string()).optional().describe("Path globs allowed to change (repeatable); checked against the net changes after the task ends."),
|
|
34
|
+
scope_on_violation: z.enum(["warn", "fail"]).optional().describe("Out-of-scope policy; default warn."),
|
|
35
|
+
mode: z.enum(["readonly", "write"]).optional().describe("Permission mode; default write. readonly maps to each CLI's read-only flags."),
|
|
36
|
+
allow_weak: z.boolean().optional().describe("Explicitly allow --mode readonly only when the target cannot enforce read-only."),
|
|
37
|
+
isolate: z.boolean().optional().describe("Create a git worktree and run the write job there (default false)."),
|
|
38
|
+
allow_dirty: z.boolean().optional().describe("Allow in-place write on a dirty working tree (default false)."),
|
|
39
|
+
rules: z.enum(["check", "pointer", "off"]).optional().describe("Project rules discovery; default check. pointer injects unread rule paths into the first-turn prompt."),
|
|
40
|
+
},
|
|
41
|
+
}, (args) => respond(() => start({
|
|
42
|
+
target: args.target_agent, prompt: args.prompt, files: args.files, cwd: args.cwd,
|
|
43
|
+
reasoningEffort: args.reasoning_effort, model: args.model,
|
|
44
|
+
idleTimeout: args.idle_timeout_seconds, maxDuration: args.max_duration_seconds,
|
|
45
|
+
scope: args.scope, scopeOnViolation: args.scope_on_violation,
|
|
46
|
+
mode: args.mode, allowWeak: args.allow_weak,
|
|
47
|
+
isolate: args.isolate, allowDirty: args.allow_dirty,
|
|
48
|
+
rules: args.rules,
|
|
49
|
+
})));
|
|
50
|
+
server.registerTool("task_status", {
|
|
51
|
+
description: "Get a task's current status. While running, includes liveness (active/quiet/orphaned) and quiet_for_s.",
|
|
52
|
+
inputSchema: { task_id: z.string() },
|
|
53
|
+
}, (args) => respond(() => status(args.task_id)));
|
|
54
|
+
server.registerTool("task_wait", {
|
|
55
|
+
description: `Bounded wait: returns as soon as any task leaves running; if still running at wait_seconds (default 50, max ${MAX_WAIT_SECONDS}), returns running and the caller can simply call again.`,
|
|
56
|
+
inputSchema: { task_ids: z.array(z.string()).min(1), wait_seconds: z.number().optional() },
|
|
57
|
+
}, (args, extra) => respond(async () => {
|
|
58
|
+
const seconds = Math.min(Math.max(args.wait_seconds ?? 50, 0), MAX_WAIT_SECONDS);
|
|
59
|
+
const token = extra?._meta?.progressToken;
|
|
60
|
+
let step = 0;
|
|
61
|
+
const timer = token == null ? null : setInterval(() => {
|
|
62
|
+
step += 1;
|
|
63
|
+
const quiet = args.task_ids.map((id) => { try {
|
|
64
|
+
return `${id.slice(0, 8)} ${status(id).quiet_for_s ?? "?"}s without output`;
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return id;
|
|
68
|
+
} }).join("; ");
|
|
69
|
+
extra.sendNotification({ method: "notifications/progress", params: { progressToken: token, progress: step, message: quiet } }).catch(() => { });
|
|
70
|
+
}, PROGRESS_MS);
|
|
71
|
+
try {
|
|
72
|
+
return await wait(args.task_ids, seconds);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
if (timer)
|
|
76
|
+
clearInterval(timer);
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
server.registerTool("task_reply", {
|
|
80
|
+
description: "After a task stops at needs_input, success, scope_violation or readonly_violation, start the next turn in the same session. as=human means a human said it; default host. Returns busy while running.",
|
|
81
|
+
inputSchema: { task_id: z.string(), prompt: z.string(), as: z.enum(["host", "human"]).optional() },
|
|
82
|
+
}, (args) => respond(() => reply(args.task_id, args.prompt, (args.as ?? "host"))));
|
|
83
|
+
server.registerTool("task_cancel", {
|
|
84
|
+
description: "Stop a running task (kills the whole process group).",
|
|
85
|
+
inputSchema: { task_id: z.string() },
|
|
86
|
+
}, (args) => respond(() => cancel(args.task_id)));
|
|
87
|
+
server.registerTool("task_list", {
|
|
88
|
+
description: "List tasks, newest update first. By default lists only tasks under cwd (or BATON_CWD); all=true lists everything.",
|
|
89
|
+
inputSchema: { all: z.boolean().optional(), cwd: z.string().optional() },
|
|
90
|
+
}, (args) => respond(() => ({ tasks: ls(args.all ?? false, args.cwd ?? process.env.BATON_CWD ?? process.cwd()) })));
|
|
91
|
+
return server;
|
|
92
|
+
}
|
|
93
|
+
export async function startMcp() {
|
|
94
|
+
await createServer().connect(new StdioServerTransport());
|
|
95
|
+
}
|
package/dist/process.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function isAlive(pid) {
|
|
2
|
+
if (!pid || !Number.isSafeInteger(pid) || pid <= 1)
|
|
3
|
+
return false;
|
|
4
|
+
// shortcut: PID reuse can cause misjudgment; add the process start time if stricter identity checks are needed.
|
|
5
|
+
try {
|
|
6
|
+
process.kill(pid, 0);
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
return error.code === "EPERM";
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function killGroup(pid) {
|
|
14
|
+
if (!pid || !Number.isSafeInteger(pid) || pid <= 1)
|
|
15
|
+
return;
|
|
16
|
+
try {
|
|
17
|
+
process.kill(-pid, "SIGKILL");
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error.code !== "ESRCH")
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
}
|
package/dist/redact.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function redact(text) {
|
|
2
|
+
let safe = text;
|
|
3
|
+
for (const [key, value] of Object.entries(process.env)) {
|
|
4
|
+
if (/TOKEN|SECRET|PASSWORD|API_KEY|CREDENTIAL/i.test(key) && value && value.length >= 4)
|
|
5
|
+
safe = safe.split(value).join("[REDACTED]");
|
|
6
|
+
}
|
|
7
|
+
return safe.replace(/(Bearer\s+)[\w.\-]+/gi, "$1[REDACTED]")
|
|
8
|
+
.replace(/((?:api[_-]?key|token|secret|password)["']?\s*[=:]\s*["']?)[^\s"',;}]+/gi, "$1[REDACTED]");
|
|
9
|
+
}
|