tollgate-cli 0.1.0 → 0.2.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/README.md CHANGED
@@ -6,7 +6,7 @@ Your team approves before your coding agent does something you can't undo.
6
6
 
7
7
  - **Approved:** the command continues, through Claude Code's normal permission check (Guard mode, the default).
8
8
  - **Denied with a reason:** the agent receives the reason as its next instruction and revises its plan.
9
- - **Nobody answers in time:** the gate is **parked**. The agent moves on, and once a teammate approves, the exact same command passes on retry (single use, 24 h).
9
+ - **Nobody answers in time:** the gate is **parked** and approvers who haven't voted get a reminder (and one more an hour later). The agent moves on, and once a teammate approves, the exact same command passes on retry (single use, 24 h).
10
10
 
11
11
  Every other command runs untouched; the hook adds about 50 ms.
12
12
 
@@ -35,7 +35,7 @@ Every other command runs untouched; the hook adds about 50 ms.
35
35
 
36
36
  ## What leaves your machine
37
37
 
38
- Only for commands that match a preset: the command and working directory after **local redaction** (known token formats, `KEY=value` secrets, passwords in URLs, secret flags, and every value from your `.env*` files), your git branch, the last commit subject, and for migrations the newest migration's SQL (capped at 2 KB). The card shows how many values were hidden. The server redacts everything again.
38
+ Only for commands that match a preset: the command and working directory after **local redaction** (known token formats, `KEY=value` secrets, passwords in URLs, secret flags, and every value from your `.env*` files), Claude Code's one-line description of the command (shown to approvers as the agent's reason), your git branch, the last commit subject, and for migrations the newest migration's SQL (capped at 2 KB). The card shows how many values were hidden. The server redacts everything again.
39
39
 
40
40
  ## Commands
41
41
 
package/dist/tollgate.mjs CHANGED
@@ -20114,6 +20114,8 @@ var createGateSchema = external_exports.object({
20114
20114
  // redacted by the hook
20115
20115
  branch: external_exports.string().max(200).nullable().optional(),
20116
20116
  context: external_exports.string().max(2048).default(""),
20117
+ // Claude Code's own one-line description of the Bash call ("Apply pending migrations").
20118
+ intent: external_exports.string().max(300).nullable().optional(),
20117
20119
  redactions: external_exports.number().int().min(0).max(1e4).default(0),
20118
20120
  cmdHash: external_exports.string().regex(SHA256_RE),
20119
20121
  sessionId: external_exports.string().max(200).optional()
@@ -20153,11 +20155,12 @@ var RULES = [
20153
20155
  re: /\b(Bearer|Basic)\s+[A-Za-z0-9._~+/-]{8,}=*/g,
20154
20156
  replace: (_m, scheme) => `${scheme} ${REDACTED}`
20155
20157
  },
20156
- // FOO_TOKEN=..., export DB_PASSWORD="...", etc. Non-secret names (NODE_ENV=prod) stay.
20158
+ // FOO_TOKEN=..., export DB_PASSWORD="...", bare PASSWORD=..., etc. Non-secret names
20159
+ // (NODE_ENV=prod) stay.
20157
20160
  // DATABASE_URL=... is left to url-credentials on purpose: approvers need to see the host.
20158
20161
  {
20159
20162
  name: "secret-assignment",
20160
- re: /\b([A-Za-z_][A-Za-z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIALS?|AUTH)[A-Za-z0-9_]*)=("[^"]*"|'[^']*'|[^\s;&|]+)/gi,
20163
+ re: /\b((?:[A-Za-z_][A-Za-z0-9_]*)?(?:KEY|TOKEN|SECRET|PASSWORD|PASSWD|PWD|CREDENTIALS?|AUTH)[A-Za-z0-9_]*)=("[^"]*"|'[^']*'|[^\s;&|]+)/gi,
20161
20164
  replace: (_m, name) => `${name}=${REDACTED}`
20162
20165
  },
20163
20166
  {
@@ -20256,6 +20259,8 @@ async function decide(input2, deps) {
20256
20259
  const redactedCwd = redact(cwd, secrets);
20257
20260
  const context = redact(deps.context(command, config2.repoRoot), secrets);
20258
20261
  const branch = deps.gitBranch(config2.repoRoot);
20262
+ const description = input2.tool_input?.description;
20263
+ const intent = typeof description === "string" && description.trim() ? redact(description.trim(), secrets) : null;
20259
20264
  let gate = await api.createGate({
20260
20265
  preset: match.preset.name,
20261
20266
  quorum: match.quorum,
@@ -20264,7 +20269,8 @@ async function decide(input2, deps) {
20264
20269
  cwd: truncate(redactedCwd.text, 500),
20265
20270
  branch: branch ? truncate(redact(branch, secrets).text, 200) : null,
20266
20271
  context: truncate(context.text, 2048),
20267
- redactions: redactedCommand.count + redactedCwd.count + context.count,
20272
+ intent: intent ? truncate(intent.text, 300) : null,
20273
+ redactions: redactedCommand.count + redactedCwd.count + context.count + (intent?.count ?? 0),
20268
20274
  cmdHash,
20269
20275
  sessionId: input2.session_id
20270
20276
  });
@@ -20382,7 +20388,7 @@ function writeRepoFiles(input2) {
20382
20388
  }
20383
20389
 
20384
20390
  // src/main.ts
20385
- var HELP = `tollgate ${"0.1.0"}: your team approves risky agent commands before they run
20391
+ var HELP = `tollgate ${"0.2.0"}: your team approves risky agent commands before they run
20386
20392
 
20387
20393
  Usage:
20388
20394
  npx tollgate-cli init --token <tg_\u2026> [--server <url>] [--repo <owner/name>]
@@ -20566,7 +20572,7 @@ async function main() {
20566
20572
  return runUnlink();
20567
20573
  case "--version":
20568
20574
  case "-v":
20569
- process.stdout.write(`${"0.1.0"}
20575
+ process.stdout.write(`${"0.2.0"}
20570
20576
  `);
20571
20577
  return;
20572
20578
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tollgate-cli",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Your team approves risky Claude Code commands before they run.",
5
5
  "license": "MIT",
6
6
  "type": "module",