trylode 0.5.1 → 0.5.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trylode",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.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`, `.vscode/mcp.json`, `.gemini/settings.json`, `.codex/config.toml`, `.claude/lode-init.json`, `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.cursor/rules/lode.mdc`, `.grok/rules/lode.md` (only when the rules line won't be in `AGENTS.md`), and with `--no-agents-md` `.github/copilot-instructions.md` | nothing | only with `--yes`, only inside a project folder and never through links: one `lode` entry in those MCP files (`--client claude`, `cursor`, `vscode`, `gemini` or `codex` picks one client; in `.codex/config.toml` it is one marked `[mcp_servers.lode]` block added at the end, and a file that already names a `lode` server or has an inline `mcp_servers` table is left alone), a copy of this skill in `.claude/skills/`, the Lode rules
|
|
19
|
+
| `init` | `.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json`, `.gemini/settings.json`, `.codex/config.toml`, `.claude/lode-init.json`, `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `.cursor/rules/lode.mdc`, `.grok/rules/lode.md` (only when the rules line won't be in `AGENTS.md`), and with `--no-agents-md` `.github/copilot-instructions.md` | nothing | only with `--yes`, only inside a project folder and never through links: one `lode` entry in those MCP files (`--client claude`, `cursor`, `vscode`, `gemini` or `codex` picks one client; in `.codex/config.toml` it is one marked `[mcp_servers.lode]` block added at the end, and a file that already names a `lode` server or has an inline `mcp_servers` table is left alone), a copy of this skill in `.claude/skills/`, the Lode rules lines (check integrations with Lode; record integration decisions in `docs/adr/`) as one marked block at the end of `CLAUDE.md`, `AGENTS.md` and `GEMINI.md` (each created if missing; `AGENTS.md` left out with `--no-agents-md`, which writes the line to `.github/copilot-instructions.md` instead; `.grok/rules/lode.md` gets it whenever it won't be in `AGENTS.md`, and is removed only if unchanged and the note says init created it) 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 |
|
|
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 |
|
|
@@ -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.5'; // 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.5';
|
|
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' };
|
|
@@ -1172,13 +1172,16 @@ const SETUP_URL = 'https://trylode.io/mcp?src=setup';
|
|
|
1172
1172
|
// blocks and rule files written with v1 are still recognised, so they count as set up and init --remove still takes them out.
|
|
1173
1173
|
export const RULE_V1 = "Before you add, recommend or install a third-party integration or SDK, check it with the Lode MCP server (https://trylode.io/mcp?src=rules): call check_stack for the apps this project already uses, or find_integrations or get_integration for the one you are adding. Quote Lode's facts with their dates. If Lode has no record, say it is not documented by Lode, not that it is unsupported.";
|
|
1174
1174
|
export const RULE = "Before you add, recommend or install a third-party integration or SDK, or decide to build that capability yourself (email, auth, payments, background jobs, rate limiting and similar), check it with the Lode MCP server (https://trylode.io/mcp?src=rules): call check_stack for the apps this project already uses, then find_integrations for the options or get_integration for the one you are adding. Quote Lode's facts with their dates. If Lode has no record, say it is not documented by Lode, not that it is unsupported.";
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
export const
|
|
1178
|
-
|
|
1175
|
+
// LOD-315 (Paul approved the line 04-12-2026; harness 05-12-2026: with it 2 of 2 agent picks saved a decision record, without it 0 of 3):
|
|
1176
|
+
// blocks and rule files from 2026.12.5 add the decision-record line after the rule. Earlier ones are still recognised.
|
|
1177
|
+
export const RULE_DECISION = 'Integration decisions are recorded in docs/adr/. Before adding, changing or removing an integration, check it with Lode and write a new record.';
|
|
1178
|
+
const rulesBlock = (rule, extra) => `<!-- lode:rules (added by lode init; node lode.mjs init --remove --yes takes it out) -->\n## Integrations\n${rule}\n${extra ? `${extra}\n` : ''}<!-- /lode:rules -->\n`;
|
|
1179
|
+
const rulesMdc = (rule, extra) => `---\ndescription: Check third-party integrations with Lode before adding them\nalwaysApply: true\n---\n${rule}\n${extra ? `${extra}\n` : ''}`;
|
|
1180
|
+
export const RULES_BLOCK = rulesBlock(RULE, RULE_DECISION);
|
|
1181
|
+
export const RULES_MDC = rulesMdc(RULE, RULE_DECISION);
|
|
1179
1182
|
// Every block and rule file a released init has written, newest first.
|
|
1180
|
-
export const KNOWN_BLOCKS = [RULES_BLOCK, rulesBlock(RULE_V1)];
|
|
1181
|
-
export const KNOWN_MDCS = [RULES_MDC, rulesMdc(RULE_V1)];
|
|
1183
|
+
export const KNOWN_BLOCKS = [RULES_BLOCK, rulesBlock(RULE), rulesBlock(RULE_V1)];
|
|
1184
|
+
export const KNOWN_MDCS = [RULES_MDC, rulesMdc(RULE), rulesMdc(RULE_V1)];
|
|
1182
1185
|
// LOD-306: the Codex server block (.codex/config.toml), for either address init writes.
|
|
1183
1186
|
export const codexBlock = (u) => `# lode:mcp (added by lode init; npx trylode remove --yes takes it out)\n[mcp_servers.lode]\nurl = "${u}"\n`;
|
|
1184
1187
|
export const KNOWN_TOMLS = [SETUP_URL, LODE_URL].map(codexBlock);
|
|
@@ -1393,7 +1396,7 @@ async function initCmd({ client = 'all', yes = false, remove = false, gate = fal
|
|
|
1393
1396
|
: 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' : ''}`
|
|
1394
1397
|
: p.do === 'rules-add' && p.kind === 'toml' ? ` ${p.file}: ${p.text == null ? 'create it with' : 'add, at the end,'} one server "lode" -> ${serverUrl}${p.text == null ? '' : '; nothing else in the file changes'} (Codex reads it in a trusted project)`
|
|
1395
1398
|
: p.do === 'rules-remove' && p.kind === 'toml' ? ` ${p.file}: remove the "lode" server lode init added (nothing else in the file changes)`
|
|
1396
|
-
: p.do === 'rules-add' ? ` ${p.file}: ${p.text == null ? 'create it with' : 'add, at the end,'} the Lode rules
|
|
1399
|
+
: p.do === 'rules-add' ? ` ${p.file}: ${p.text == null ? 'create it with' : 'add, at the end,'} the Lode rules lines (the agent checks Lode before it adds an integration, and writes a decision record in docs/adr/)${p.text == null ? '' : '; nothing else in the file changes'}`
|
|
1397
1400
|
: 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)' : ''}`
|
|
1398
1401
|
: 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)`
|
|
1399
1402
|
: ` ${p.file}/: delete the skill files lode init copied, if unchanged`);
|