trylode 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/bin/cli.mjs +12 -2
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -65,6 +65,17 @@ const cmd = argv[0];
65
65
  // through; --share and --project-code are dropped, so these never send a choice or outcome and never write a file.
66
66
  const LOOKUPS = ['find', 'check', 'list', 'platforms', 'stack', 'overlap', 'triage'];
67
67
  const NEVER = new Set(['--share', '--project-code']);
68
+ // What a lookup prints (LOD-329 clean-up). Lode's answer is untrusted text for the agent's terminal: control characters
69
+ // (escape sequences included), C1 codes, zero-width and bidi marks are removed; tabs and line breaks stay. The skill's
70
+ // hints for lookups name its own script, so they become npx trylode <command>; hints a lookup can't follow (record a
71
+ // request, or run again with --share, which lookups drop) are left out rather than reworded.
72
+ const UNSAFE = /[\u0000-\u0008\u000B-\u001F\u007F-\u009F\u200B-\u200F\u202A-\u202E\u2060-\u2069\uFEFF]/g;
73
+ const CANT_FOLLOW = [/ If the user needs it, tell Lode \(with their agreement\): node lode\.mjs request [^\n]*/g, /\n*[^\n]*run this again with --share\.[^\n]*/g];
74
+ function forLookup(text) {
75
+ let s = String(text).replace(/\r\n?/g, '\n').replace(/(?:\u001B\[|\u009B)[0-?]*[ -/]*[@-~]|\u001B[\]PX^_][^\u0007\u001B]*(?:\u0007|\u001B\\)?/g, '').replace(UNSAFE, '');
76
+ for (const re of CANT_FOLLOW) s = s.replace(re, '');
77
+ return s.replace(new RegExp(`node lode\\.mjs (${LOOKUPS.join('|')})\\b`, 'g'), 'npx trylode $1');
78
+ }
68
79
  if (LOOKUPS.includes(cmd)) {
69
80
  try {
70
81
  // Counted as trylode, not as the installed skill (Paul's yes 05-12-2026): the skill's user agent plus "trylode;".
@@ -78,8 +89,7 @@ if (LOOKUPS.includes(cmd)) {
78
89
  const out = String(await main([cmd, ...argv.slice(1).filter((a) => !NEVER.has(a))]));
79
90
  // A command missing its arguments gets the skill's usage, which lists commands trylode doesn't run: show ours
80
91
  if (out.startsWith('Usage:')) { console.log(USAGE); process.exit(1); }
81
- // The skill's hints name its own script; here the same lookups run as npx trylode <command>
82
- console.log(out.replace(new RegExp(`node lode\\.mjs (${LOOKUPS.join('|')})\\b`, 'g'), 'npx trylode $1'));
92
+ console.log(forLookup(out));
83
93
  } catch (e) {
84
94
  console.error(`trylode: ${e.message}`);
85
95
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trylode",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
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" },