agent-personalizer 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/README.md CHANGED
@@ -133,7 +133,7 @@ examples/ one invented user, end to end
133
133
  docs/ tiers.md, companions.md, paste-guide.md
134
134
  CHANGELOG.md keyed on audit rounds
135
135
  .github/ harness.yml: the checks on every push and PR, Ubuntu and macOS x Node 18/20/22, plus a Windows smoke job; publish.yml: npm publish with provenance, dispatched per tag
136
- test/ run.sh: 82 checks, exact exit codes, adversarial fixtures (symlinks, traversal, malformed markers, CRLF, partial renders)
136
+ test/ run.sh: 83 checks, exact exit codes, adversarial fixtures (symlinks, traversal, malformed markers, CRLF, partial renders)
137
137
  ```
138
138
 
139
139
  ## Changelog
@@ -44,12 +44,12 @@ const AI_LABEL = { claude: 'Claude (Claude Code, Claude apps)', agents: 'Codex /
44
44
  function die(msg) { console.error(`agent-personalizer: ${msg}`); process.exit(2); }
45
45
 
46
46
  const VALUE_OPTS = ['--dir', '--ai', '--level', '--answers'];
47
- const FLAG_OPTS = ['--yes', '--defaults', '--quick', '--help', '--version'];
47
+ const FLAG_OPTS = ['--yes', '--defaults', '--quick', '--help', '--version', '-h', '-v'];
48
48
  const USAGE = `agent-personalizer ${require(path.join(PKG, 'package.json')).version}
49
49
 
50
50
  npx agent-personalizer [--dir <folder>] [--ai claude,agents,gemini,chatgpt,prompt] [--level 1|2|3|4]
51
51
  [--answers <file.json> | --answers - | --defaults] [--quick] [--yes]
52
- [--help] [--version]
52
+ [--help | -h] [--version | -v]
53
53
 
54
54
  Interactive when flags are missing and stdin is a terminal; the onboarding interview runs then.
55
55
  --quick ask only the seven questions that change behaviour (name, tone, length, notes tool and path,
@@ -81,8 +81,8 @@ function parseArgs() {
81
81
  }
82
82
  const ARGS = parseArgs();
83
83
  function arg(name, dflt) { return name in ARGS ? ARGS[name] : dflt; }
84
- if (ARGS['--help']) { process.stdout.write(USAGE); process.exit(0); }
85
- if (ARGS['--version']) { process.stdout.write(require(path.join(PKG, 'package.json')).version + '\n'); process.exit(0); }
84
+ if (ARGS['--help'] || ARGS['-h']) { process.stdout.write(USAGE); process.exit(0); }
85
+ if (ARGS['--version'] || ARGS['-v']) { process.stdout.write(require(path.join(PKG, 'package.json')).version + '\n'); process.exit(0); }
86
86
 
87
87
  async function ask(q, dflt) {
88
88
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
@@ -176,7 +176,8 @@ async function main() {
176
176
  answersSource = `from ${label}`;
177
177
  } else if (arg('--defaults', false) || !interactive) {
178
178
  answers = onboarding.defaults();
179
- answersSource = 'defaults (pass --answers <file.json>, or run without --yes, to answer the interview)';
179
+ if (!arg('--defaults', false) && !process.stdin.isTTY) console.error('agent-personalizer: stdin is not a terminal, so the interview cannot run; using the default answers (pass --answers <file.json>, --answers -, or --defaults to silence this)');
180
+ answersSource = process.stdin.isTTY ? 'defaults (pass --answers <file.json>, or run without --yes, to answer the interview)' : 'defaults (stdin is not a terminal; pass --answers <file.json> or --answers - to script them)';
180
181
  } else {
181
182
  const quick = !!arg('--quick', false);
182
183
  console.log(`\nOnboarding: how should an AI work with you? Enter accepts the default in brackets.${quick ? ' Quick interview: 7 questions, the rest default.' : ` ${onboarding.QUESTIONS.length} questions; --quick asks 7.`}\n`);
package/check/gate.cjs CHANGED
@@ -10,6 +10,7 @@
10
10
  usage:
11
11
  node check/gate.cjs [--dir <root>] [--list <file>] scan; exit 0 clean, 1 on hits, 2 on setup error
12
12
  node check/gate.cjs --self-test prove the gate can go red on a seeded hit
13
+ node check/gate.cjs --help | -h · --version | -v
13
14
 
14
15
  Fail-closed: a missing or empty list is exit 2, never a pass; a list that git tracks is exit 2.
15
16
  The list file may never be tracked by git; every repository enclosing its REAL path is
@@ -44,7 +45,7 @@ const SKIP_DIRS = new Set(['.git']); // --all means every file; git mode lets
44
45
  function die(msg) { console.error(`GATE SETUP ERROR: ${msg}`); process.exit(2); }
45
46
 
46
47
  const VALUE_OPTS = ['--dir', '--list'];
47
- const FLAG_OPTS = ['--self-test', '--all'];
48
+ const FLAG_OPTS = ['--self-test', '--all', '--help', '-h', '--version', '-v'];
48
49
  /* Parse argv once, strictly: value options at most once each, flags at most once, nothing unknown. */
49
50
  function parseArgs() {
50
51
  const out = {};
@@ -330,6 +331,13 @@ function selfTest() {
330
331
  }
331
332
 
332
333
  function main() {
334
+ if (arg('--version', false) || arg('-v', false)) {
335
+ // the version lives in the sibling module that is copied with this file; standalone copies say so
336
+ let v = 'unknown (render/onboarding.cjs not beside this file)';
337
+ try { v = require(path.join(__dirname, '..', 'render', 'onboarding.cjs')).VERSION; } catch (_) {}
338
+ process.stdout.write(`agent-personalizer gate ${v}\n`); return;
339
+ }
340
+ if (arg('--help', false) || arg('-h', false)) { const src = fs.readFileSync(__filename, 'utf8'); process.stdout.write(src.slice(src.indexOf('/*') + 2, src.indexOf('*/')).trim() + '\n'); return; }
333
341
  if (!!arg('--self-test', false)) return selfTest();
334
342
  let root = path.resolve(arg('--dir', path.join(__dirname, '..')));
335
343
  if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) die(`--dir ${root} is not a directory`);
@@ -37,7 +37,7 @@ _Generated by agent-personalizer from Mara's own answers (stored in `.agent-pers
37
37
 
38
38
  ### Where you may write
39
39
 
40
- - **Notes live in Obsidian:** reach them as the vault at `notes/`, through **obsidian-tc** (governed MCP: folder ACLs, human-in-the-loop confirmation for destructive tools, audit log) rather than raw filesystem access; see https://github.com/aunysillyme/agent-personalizer/blob/v0.4.1/docs/companions.md.
40
+ - **Notes live in Obsidian:** reach them as the vault at `notes/`, through **obsidian-tc** (governed MCP: folder ACLs, human-in-the-loop confirmation for destructive tools, audit log) rather than raw filesystem access; see https://github.com/aunysillyme/agent-personalizer/blob/v0.4.2/docs/companions.md.
41
41
  - You may create and edit files anywhere under `notes/`, under that folder's rules. Nowhere else without being asked.
42
42
  - **Every folder you write into has a README.** Any write, edit or delete means that README is corrected in the same pass: the file's one-line description, the folder's status, settled decisions, next steps. A stale index is worse than none, because the next agent believes it.
43
43
  - **Session log:** append a dated section to this week's note in `notes/sessions/`. **Decisions:** one line each in `notes/decisions.md`. **Inbox:** one file per item in `notes/inbox/`; finished items are deleted, not marked done.
package/hooks/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # hooks/
2
2
 
3
- Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.4.1/docs/tiers.md): the few rules that must be in context at the moment of decision, injected in full at the start of every session. Injection puts the text in front of the model; whether the model follows it is up to the model and the host. This is the strongest placement available, not a guarantee.
3
+ Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.4.2/docs/tiers.md): the few rules that must be in context at the moment of decision, injected in full at the start of every session. Injection puts the text in front of the model; whether the model follows it is up to the model and the host. This is the strongest placement available, not a guarantee.
4
4
 
5
5
  Which rules? The ones with `inject: true` in their frontmatter. Keep that set small. Every injected rule costs tokens every session.
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-personalizer",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Personalize any AI with dynamic instructions. One profile, one rule source, rendered for Claude, Codex, Cursor, Gemini and ChatGPT.",
5
5
  "license": "MIT",
6
6
  "repository": "github:aunysillyme/agent-personalizer",
@@ -17,7 +17,7 @@
17
17
  DOCS points at the matching tag on GitHub so an installed copy never links to a file the
18
18
  destination does not have.
19
19
  */
20
- const VERSION = '0.4.1';
20
+ const VERSION = '0.4.2';
21
21
  const DOCS = `https://github.com/aunysillyme/agent-personalizer/blob/v${VERSION}/docs`;
22
22
 
23
23
  /* THE single source for notes tools. Add a tool here and nowhere else: the interview option, the
package/render/render.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
  usage:
7
7
  node render/render.cjs [--dir <project>] [--targets claude,agents,gemini,chatgpt,prompt] [--check] [--strict] [--rules <dir>]
8
8
  node render/render.cjs [--dir <project>] --contract [--contract-target claude] [--no-personal]
9
- node render/render.cjs --help
9
+ node render/render.cjs --help | -h · --version | -v
10
10
 
11
11
  --rules where the rule files live. Default: <dir>/rules when it exists (a level-3 install,
12
12
  or this repo), else the rules/ folder beside this renderer's own package (a level-1
@@ -82,7 +82,7 @@ const RULE_FILE_RE = /^\d{2}-[A-Za-z0-9._-]+\.md$/;
82
82
 
83
83
 
84
84
  const VALUE_OPTS = ['--dir', '--targets', '--contract-target', '--rules'];
85
- const FLAG_OPTS = ['--check', '--contract', '--no-personal', '--strict', '--help'];
85
+ const FLAG_OPTS = ['--check', '--contract', '--no-personal', '--strict', '--help', '-h', '--version', '-v'];
86
86
  /* Parse argv once, strictly: value options at most once each, flags at most once, nothing unknown. */
87
87
  function parseArgs() {
88
88
  const out = {};
@@ -385,7 +385,8 @@ function between(existing, file) {
385
385
 
386
386
  function main() {
387
387
  ARGS = parseArgs();
388
- if (arg('--help', false)) { const src = fs.readFileSync(__filename, 'utf8'); process.stdout.write(src.slice(src.indexOf('/*') + 2, src.indexOf('*/')).trim() + `\n\nagent-personalizer renderer ${onboarding.VERSION}\n`); return; }
388
+ if (arg('--version', false) || arg('-v', false)) { process.stdout.write(onboarding.VERSION + '\n'); return; }
389
+ if (arg('--help', false) || arg('-h', false)) { const src = fs.readFileSync(__filename, 'utf8'); process.stdout.write(src.slice(src.indexOf('/*') + 2, src.indexOf('*/')).trim() + `\n\nagent-personalizer renderer ${onboarding.VERSION}\n`); return; }
389
390
  const requested = path.resolve(arg('--dir', process.cwd()));
390
391
  let root;
391
392
  try { root = fs.realpathSync(requested); } catch (_) { die(`--dir ${requested} does not exist`); }