trylode 0.4.1 → 0.4.2
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/PERMISSIONS.md +3 -2
- package/README.md +2 -2
- package/bin/cli.mjs +2 -1
- package/package.json +1 -1
- package/skill/PERMISSIONS.md +1 -1
- package/skill/SKILL.md +3 -2
- package/skill/scripts/failure-hook.mjs +1 -1
- package/skill/scripts/lode.mjs +30 -4
package/PERMISSIONS.md
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
## Writes (only with `--yes`; without it, nothing is written)
|
|
6
6
|
|
|
7
7
|
- `.mcp.json`: one `"lode"` server entry, `https://trylode.io/mcp?src=setup`. Other entries are unchanged.
|
|
8
|
-
- `.cursor/mcp.json`: the same entry for Cursor.
|
|
8
|
+
- `.cursor/mcp.json`: the same entry for Grok Build (formerly Cursor).
|
|
9
9
|
- `CLAUDE.md` and `AGENTS.md` (each created if missing; `AGENTS.md` left out with `--no-agents-md`): one marked block with the Lode rules line, added at the end. Nothing else in the file changes.
|
|
10
|
-
- `.cursor/rules/lode.mdc`: the rules line as a Cursor rule.
|
|
10
|
+
- `.cursor/rules/lode.mdc`: the rules line as a Grok Build (formerly Cursor) rule.
|
|
11
|
+
- `.grok/rules/lode.md`: the same rules line for Grok Build's terminal app, only when it won't be in `AGENTS.md` (with `--client cursor`, or `--no-agents-md` and no `AGENTS.md`).
|
|
11
12
|
- `.claude/skills/lode-integration-check/`: a copy of the Lode Integration Check skill.
|
|
12
13
|
- `.claude/lode-init.json`: a note of what was added, so `remove` can undo exactly that.
|
|
13
14
|
|
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ npx trylode setup --yes # adds it
|
|
|
9
9
|
|
|
10
10
|
It adds:
|
|
11
11
|
|
|
12
|
-
1. **Lode's MCP server** to `.mcp.json` (Claude Code) and `.cursor/mcp.json` (Cursor). Hosted, no sign-in or API key.
|
|
13
|
-
2. **The rules line** to `CLAUDE.md`, `AGENTS.md` (each created if missing; `--no-agents-md` leaves `AGENTS.md` out) and `.cursor/rules/lode.mdc`. This is the step that matters most: agents reliably use a tool their instructions file tells them about.
|
|
12
|
+
1. **Lode's MCP server** to `.mcp.json` (Claude Code) and `.cursor/mcp.json` (Grok Build, formerly Cursor). Hosted, no sign-in or API key.
|
|
13
|
+
2. **The rules line** to `CLAUDE.md`, `AGENTS.md` (each created if missing; `--no-agents-md` leaves `AGENTS.md` out) and `.cursor/rules/lode.mdc` (plus `.grok/rules/lode.md` for Grok Build's terminal app when the line won't be in `AGENTS.md`). This is the step that matters most: agents reliably use a tool their instructions file tells them about.
|
|
14
14
|
3. **The Lode Integration Check skill** in `.claude/skills/`.
|
|
15
15
|
|
|
16
16
|
Optional (Claude Code only): Lode Gate. Running `npx trylode setup --gate --yes` adds a hook that runs just before the agent installs a package Lode knows (for example, `npm install resend`) and injects Lode's facts into the agent's context: required platform plan, recorded regions, and any SDK deprecation or published security advisory (each with a link and date). It never blocks an install and applies only to you, in this project (`.claude/settings.local.json`, kept out of git). When triggered, it sends only package names and a few codes to Lode—never your full command, source code, or local file paths. See [PERMISSIONS.md](PERMISSIONS.md) for details.
|
package/bin/cli.mjs
CHANGED
|
@@ -13,7 +13,8 @@ const USAGE = `Usage:
|
|
|
13
13
|
Shows what it would add to this project, and adds it with --yes:
|
|
14
14
|
.mcp.json and .cursor/mcp.json: one "lode" server entry (other entries unchanged)
|
|
15
15
|
CLAUDE.md, AGENTS.md, .cursor/rules/lode.mdc: the Lode rules line (each created if missing;
|
|
16
|
-
--no-agents-md leaves AGENTS.md out)
|
|
16
|
+
--no-agents-md leaves AGENTS.md out); .grok/rules/lode.md for Grok Build's terminal app
|
|
17
|
+
when the line won't be in AGENTS.md
|
|
17
18
|
.claude/skills/lode-integration-check/: the Lode Integration Check skill
|
|
18
19
|
--gate Also enables Lode Gate for Claude Code in .claude/settings.local.json (user-local, not shared).
|
|
19
20
|
Injects Lode's facts into the agent's context before installing a known package; never blocks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trylode",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "One command puts Lode in your project: the MCP server, the rules line and the skill, so your coding agent checks integration facts before it adds a third-party service.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": { "trylode": "bin/cli.mjs" },
|
package/skill/PERMISSIONS.md
CHANGED
|
@@ -16,7 +16,7 @@ secrets. Privacy policy: https://trylode.io/privacy/
|
|
|
16
16
|
| `stack` | `package.json`, `requirements.txt`, `pyproject.toml`, `Gemfile`, `go.mod`, variable NAMES in `.env.example`, `vercel.json`, `netlify.toml`, `supabase/config.toml` | with `--share`: the app and platform codes found, the framework | nothing |
|
|
17
17
|
| `triage` | nothing | the app, platform, one fixed symptom code, the HTTP status if given (only its class is kept) and the `--object` code if given (sent only when it is one of the platform's object codes, otherwise not sent); with `--share`: the outcome code and the `--switched-to` app | nothing |
|
|
18
18
|
| `watch` (`watch`, `watch changes`, `watch stop`) | `lode-integrations.json`, `.lode/watch.json` and an existing `.gitignore` (never through links; a file not in the expected shape is refused) | `watch`: only with `--share`, the Lode ids of the integrations still kept in `lode-integrations.json` (at most 50); Lode makes a fresh random watch code, unless `--project-code` asks it to use the file's own project code; the watch code and token on later updates. `watch changes` and `watch stop`: the watch code and the token only. Lode keeps the list of ids until the watch is stopped; `stop` deletes it | `watch --share`: `.lode/watch.json` (mode 0600: the watch code and the secret token Lode returns once; the `.lode` folder is made if missing) and, only when a `.gitignore` already exists, one appended `.lode/` line; `watch stop` removes the token file |
|
|
19
|
-
| `init` | `.mcp.json`, `.cursor/mcp.json`, `.claude/lode-init.json`, `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/lode.mdc` | nothing | only with `--yes`, only inside a project folder and never through links: one `lode` entry in those MCP files, a copy of this skill in `.claude/skills/`, the Lode rules line as one marked block at the end of `CLAUDE.md` and `AGENTS.md` (each created if missing; `AGENTS.md` left out with `--no-agents-md`) and as `.cursor/rules/lode.mdc` (left out with `--no-rules`), and a note of what was added in `.claude/lode-init.json`; a file it can't parse is left alone; `init --remove --yes` undoes only what init added (the rules block only when unchanged); with `--src setup` (used by `npx trylode setup`) the entry's address is `https://trylode.io/mcp?src=setup`, and `--remove` recognises either address |
|
|
19
|
+
| `init` | `.mcp.json`, `.cursor/mcp.json`, `.claude/lode-init.json`, `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/lode.mdc`, `.grok/rules/lode.md` | nothing | only with `--yes`, only inside a project folder and never through links: one `lode` entry in those MCP files, a copy of this skill in `.claude/skills/`, the Lode rules line as one marked block at the end of `CLAUDE.md` and `AGENTS.md` (each created if missing; `AGENTS.md` left out with `--no-agents-md`) and as `.cursor/rules/lode.mdc` (left out with `--no-rules`), and as `.grok/rules/lode.md` for Grok Build's terminal app only when the line won't be in `AGENTS.md` (with `--client cursor`, or `--no-agents-md` and no `AGENTS.md`), and a note of what was added in `.claude/lode-init.json`; a file it can't parse is left alone; `init --remove --yes` undoes only what init added (the rules block only when unchanged); with `--src setup` (used by `npx trylode setup`) the entry's address is `https://trylode.io/mcp?src=setup`, and `--remove` recognises either address |
|
|
20
20
|
| `init --gate` (Lode Gate, opt-in) | `.claude/settings.local.json` (or `.claude/settings.json` with `--shared`), `.claude/lode-init.json`, `.claude/.gitignore`, the Gate files already in `.claude/skills/lode-integration-check/` | nothing | only with `--yes`, only inside a project folder and never through links: one PreToolUse hook entry in that settings file (by default only for you: Claude Code keeps `settings.local.json` out of git; `--shared` gives it to everyone who opens the project), a copy of this skill with `gate.mjs` and `gate-packages.json` in `.claude/skills/` (it never overwrites a file, and refuses if Gate files already there differ from its own), two lines at the end of `.claude/.gitignore` inside a git repository (a comment and `settings.local.json`, so the hook file is never committed; `--remove` takes out exactly those two), and a note in `.claude/lode-init.json`; `init --gate --remove --yes` deletes only the files it copied, unchanged, from its fixed list |
|
|
21
21
|
| Gate hook (`scripts/gate.mjs`, runs before each shell command once switched on) | the shell command Claude is about to run and the session id (on your machine only; the id is used only to name the temp file below), the project folder (`CLAUDE_PROJECT_DIR`, else the working folder), whether `vercel.json`, `.vercel/project.json`, `netlify.toml`, `supabase/config.toml`, `wrangler.toml`, `wrangler.json` or `wrangler.jsonc` exist there (names only, never contents), `gate-packages.json`, and `LODE_GATE_LOG` | only when the command installs a package on Lode's list: those package names, the package manager, the platform codes found, the mode and a random code for the Claude Code session; never the command, versions, paths, file contents or the session id; with `LODE_GATE_LOG=0` Lode keeps nothing except the daily rate-limit count | a random session code in your temp folder (tidied after a day) |
|
|
22
22
|
| `init --triage` (the failure hook, opt-in) | the same files as `init --gate`, for the failure hook's own entry | nothing | only with `--yes`, under the same rules as `init --gate`: one `PostToolUseFailure` hook entry in `.claude/settings.local.json` (or `.claude/settings.json` with `--shared`), `failure-hook.mjs` and `failure-signals.json` copied with this skill, the same `.claude/.gitignore` lines and a note in `.claude/lode-init.json`; `init --triage --remove --yes` undoes only that |
|
package/skill/SKILL.md
CHANGED
|
@@ -249,9 +249,10 @@ node scripts/lode.mjs init [--client claude|cursor|all]
|
|
|
249
249
|
```
|
|
250
250
|
|
|
251
251
|
It shows the files it would change: one `lode` entry in `.mcp.json` (Claude Code) and/or
|
|
252
|
-
`.cursor/mcp.json` (Cursor), a copy of this skill in `.claude/skills/`, and the Lode rules line (so the
|
|
252
|
+
`.cursor/mcp.json` (Grok Build, formerly Cursor), a copy of this skill in `.claude/skills/`, and the Lode rules line (so the
|
|
253
253
|
agent checks Lode before it adds an integration) at the end of `CLAUDE.md` and `AGENTS.md` (each created if
|
|
254
|
-
missing), and as `.cursor/rules/lode.mdc
|
|
254
|
+
missing), and as `.cursor/rules/lode.mdc` (plus `.grok/rules/lode.md` for Grok Build's terminal app when
|
|
255
|
+
the line won't be in `AGENTS.md`). Add `--no-rules` to leave the rules line out, or `--no-agents-md`
|
|
255
256
|
to leave out `AGENTS.md`. It writes nothing until the
|
|
256
257
|
user agrees and you run it again with `--yes`. It runs only in a project folder, never through links, leaves
|
|
257
258
|
any config file it can't parse alone (it tells you the entry to add by hand), changes no other entry or text, adds no
|
|
@@ -84,7 +84,7 @@ export function loadSignals() {
|
|
|
84
84
|
|
|
85
85
|
// ---- Step 2: the hook (PostToolUseFailure). Sends only app, platform, symptom code and status number, never the
|
|
86
86
|
// output text, the command, paths, versions or the session id. Asks once per app, platform and symptom in a session.
|
|
87
|
-
const VERSION = '2026.12.
|
|
87
|
+
const VERSION = '2026.12.4'; // the skill's version: kept equal to SKILL_VERSION in lode.mjs by a test
|
|
88
88
|
// The hook ships inside the skill, so it identifies as the skill: the server already counts `lode-skill` and leaves
|
|
89
89
|
// `lode-skill-test` (Lode's own tests) out of every figure. Only Lode's tests may point it at this machine.
|
|
90
90
|
const BASE = (() => { const u = process.env.LODE_GATE_URL || ''; return /^http:\/\/(127\.0\.0\.1|localhost)(:\d+)?$/.test(u) ? u : 'https://trylode.io'; })();
|
package/skill/scripts/lode.mjs
CHANGED
|
@@ -56,7 +56,7 @@ import { pathToFileURL } from 'node:url';
|
|
|
56
56
|
const BASE = (process.env.LODE_BASE || 'https://trylode.io').replace(/\/$/, '');
|
|
57
57
|
// The skill's version (year.month.day of its last change; a test makes every change bump it), sent in the user agent
|
|
58
58
|
// so Lode can count which copies agents run. Copies before 03-12-2026 all sent 0.1.
|
|
59
|
-
export const SKILL_VERSION = '2026.12.
|
|
59
|
+
export const SKILL_VERSION = '2026.12.4';
|
|
60
60
|
const UA = process.env.LODE_UA || `lode-skill/${SKILL_VERSION} (+https://trylode.io/agents/)`;
|
|
61
61
|
|
|
62
62
|
export const NAMES = { xero: 'Xero', 'quickbooks-online': 'QuickBooks Online', hubspot: 'HubSpot', shopify: 'Shopify', stripe: 'Stripe', supabase: 'Supabase', vercel: 'Vercel', netlify: 'Netlify', n8n: 'n8n', lovable: 'Lovable', replit: 'Replit', linear: 'Linear', github: 'GitHub', langchain: 'LangChain', cursor: 'Grok Build', cloudflare: 'Cloudflare' };
|
|
@@ -1270,13 +1270,35 @@ async function initCmd({ client = 'all', yes = false, remove = false, gate = fal
|
|
|
1270
1270
|
else if (KNOWN_MDCS.some((m) => text === m || text === crlf(m))) { if (remove) plan.push({ do: 'rules-remove', file: t.file, f, text, st: r.st, kind: 'mdc' }); }
|
|
1271
1271
|
else refused.push(`${t.file}: isn't the rule file lode init writes, so it was left alone.`);
|
|
1272
1272
|
}
|
|
1273
|
+
// LOD-306 (Paul, 04-12-2026): Grok Build's terminal app (grok) does not read .mdc rules; it reads *.md in
|
|
1274
|
+
// .grok/rules/ and AGENTS.md (docs.grok.com/build/agents-window/rules.md, read 04-12-2026). So when the rules line
|
|
1275
|
+
// won't be in AGENTS.md after this run (--client cursor, or --no-agents-md with no AGENTS.md), init also writes
|
|
1276
|
+
// .grok/rules/lode.md: the same block, as the whole file. Created only if missing; removed only if unchanged and the
|
|
1277
|
+
// marker (.claude/lode-init.json, grok_rules) says init created it.
|
|
1278
|
+
if (remove || client === 'all' || client === 'cursor') {
|
|
1279
|
+
const grokRel = path.join('.grok', 'rules', 'lode.md');
|
|
1280
|
+
const isOurs = (x) => KNOWN_BLOCKS.some((b) => x === b || x === crlf(b));
|
|
1281
|
+
let covered = plan.some((p) => p.do === 'rules-add' && p.file === 'AGENTS.md');
|
|
1282
|
+
if (!remove && !covered) {
|
|
1283
|
+
const a = readRules('AGENTS.md');
|
|
1284
|
+
covered = !a.bad && a.text != null && (a.text.includes(RULE) || a.text.includes(RULE_V1));
|
|
1285
|
+
}
|
|
1286
|
+
const g = readRules(grokRel);
|
|
1287
|
+
const exists = (() => { try { return !!fs.lstatSync(path.join(cwd, grokRel)); } catch { return false; } })();
|
|
1288
|
+
if (g.bad) { if (exists || (!remove && !covered)) refused.push(`${grokRel}: ${g.bad}`); }
|
|
1289
|
+
else if (remove) { if (g.text != null && isOurs(g.text) && marker.grok_rules === true) plan.push({ do: 'rules-remove', file: grokRel, f: path.join(cwd, grokRel), text: g.text, st: g.st, kind: 'grok' }); }
|
|
1290
|
+
else if (!covered) {
|
|
1291
|
+
if (g.text == null) plan.push({ do: 'rules-add', file: grokRel, f: path.join(cwd, grokRel), text: null, kind: 'grok' });
|
|
1292
|
+
else if (!isOurs(g.text)) refused.push(`${grokRel}: isn't the rule file lode init writes, so it was left alone.`);
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1273
1295
|
}
|
|
1274
1296
|
const refusedText = refused.length ? `\nNot changed:\n${refused.map((r) => ` ${r}`).join('\n')}` : '';
|
|
1275
1297
|
if (!plan.length) return (remove ? 'Nothing to remove that lode init added.' : 'Lode is already set up in this project.') + refusedText;
|
|
1276
1298
|
const lines = plan.map((p) => p.do === 'add' ? ` ${p.file}: ${p.created ? 'create it with' : 'add'} one entry "lode" -> ${serverUrl}${p.created ? '' : ' (other entries unchanged)'}`
|
|
1277
1299
|
: p.do === 'remove' ? ` ${p.file}: remove the "lode" entry lode init added (other entries unchanged)${p.created ? '; delete the file if nothing else is left in it' : ''}`
|
|
1278
1300
|
: p.do === 'rules-add' ? ` ${p.file}: ${p.text == null ? 'create it with' : 'add, at the end,'} the Lode rules line (the agent checks Lode before it adds an integration)${p.text == null ? '' : '; nothing else in the file changes'}`
|
|
1279
|
-
: p.do === 'rules-remove' ? ` ${p.file}: remove the Lode rules ${p.kind === '
|
|
1301
|
+
: p.do === 'rules-remove' ? ` ${p.file}: remove the Lode rules ${p.kind === 'md' ? 'line' : 'file'} lode init added${p.kind === 'md' ? ' (nothing else in the file changes)' : ''}`
|
|
1280
1302
|
: p.do === 'copy-skill' ? ` ${p.file}/: copy the Lode Integration Check skill (SKILL.md, PERMISSIONS.md, scripts/lode.mjs; no dependencies, nothing runs on install)`
|
|
1281
1303
|
: ` ${p.file}/: delete the skill files lode init copied, if unchanged`);
|
|
1282
1304
|
if (!remove) lines.push(` ${markerRel}: a small note of what lode init added, so --remove undoes only that`);
|
|
@@ -1339,7 +1361,11 @@ async function initCmd({ client = 'all', yes = false, remove = false, gate = fal
|
|
|
1339
1361
|
}
|
|
1340
1362
|
if (p.do === 'rules-add' || p.do === 'rules-remove') {
|
|
1341
1363
|
// A failure here is reported, never thrown, so the marker for the steps already done is still written
|
|
1342
|
-
try {
|
|
1364
|
+
try {
|
|
1365
|
+
rulesWrite(p);
|
|
1366
|
+
// Security review 04-12-2026: the .grok file is removed only when the marker says init created it
|
|
1367
|
+
if (p.kind === 'grok') { if (p.do === 'rules-add') marker.grok_rules = true; else delete marker.grok_rules; }
|
|
1368
|
+
} catch (e) { failed.push(` ${p.file}: not changed (${e.code || e.message}).`); }
|
|
1343
1369
|
}
|
|
1344
1370
|
if (p.do === 'copy-skill') {
|
|
1345
1371
|
marker.skill_files = {};
|
|
@@ -1365,7 +1391,7 @@ async function initCmd({ client = 'all', yes = false, remove = false, gate = fal
|
|
|
1365
1391
|
marker.skill_files = {};
|
|
1366
1392
|
}
|
|
1367
1393
|
}
|
|
1368
|
-
if ((marker.added || []).length || Object.keys(marker.skill_files || {}).length || Object.values(HOOK_KINDS).some((k) => marker[k.key] || Object.keys(marker[k.filesKey] || {}).length)) { fs.mkdirSync(path.dirname(markerFile), { recursive: true }); fs.writeFileSync(markerFile, JSON.stringify(marker, null, 2) + '\n'); }
|
|
1394
|
+
if ((marker.added || []).length || Object.keys(marker.skill_files || {}).length || marker.grok_rules === true || Object.values(HOOK_KINDS).some((k) => marker[k.key] || Object.keys(marker[k.filesKey] || {}).length)) { fs.mkdirSync(path.dirname(markerFile), { recursive: true }); fs.writeFileSync(markerFile, JSON.stringify(marker, null, 2) + '\n'); }
|
|
1369
1395
|
else { try { fs.rmSync(markerFile); } catch { /* none */ } }
|
|
1370
1396
|
return `${remove ? 'Removed' : 'Done'}:\n${lines.join('\n')}${refusedText}${failed.length ? `\nFailed:\n${failed.join('\n')}` : ''}\n${remove ? '' : 'Commit these files so teammates and sub-agents in this project have Lode. Undo with: ' + runCmd(true) + ' --yes\n'}Nothing was sent to Lode.`;
|
|
1371
1397
|
}
|