agent-personalizer 0.10.0 → 0.10.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/CHANGELOG.md +26 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +19 -18
- package/SECURITY.md +1 -1
- package/bin/agent-personalizer.js +130 -26
- package/bin/global.cjs +155 -29
- package/bin/home.cjs +69 -4
- package/bin/install-plan.cjs +10 -6
- package/bin/learn.cjs +5 -4
- package/bin/sessions.cjs +57 -14
- package/check/gate.cjs +76 -30
- package/docs/companions.md +11 -11
- package/docs/guarantees.md +4 -4
- package/docs/install.md +1 -1
- package/docs/learning.md +5 -5
- package/docs/paste-guide.md +13 -11
- package/examples/answers.json +1 -1
- package/hooks/README.md +1 -1
- package/hooks/gemini-cli/session-start.sh +19 -7
- package/llms.txt +2 -1
- package/package.json +22 -9
- package/render/onboarding.cjs +8 -8
- package/render/render.cjs +1 -1
- package/skills/agent-personalizer/SKILL.md +1 -1
package/check/gate.cjs
CHANGED
|
@@ -46,7 +46,7 @@ const { execFileSync } = require('child_process');
|
|
|
46
46
|
const SKIP_DIRS = new Set(['.git']); // --all means every file; git mode lets .gitignore decide about node_modules
|
|
47
47
|
const PRIVATE_CLASSES = [
|
|
48
48
|
['P_PATH', /\/(?:Users|home)\/(?!you\b|user\b|example\b|runner\b|name\b)[^/\s"'`),;]+/i],
|
|
49
|
-
['P_TOKEN', /(?<![A-Za-z0-9_-])(?:(?:gh[pousr]_|
|
|
49
|
+
['P_TOKEN', /(?<![A-Za-z0-9_-])(?:(?:gh[pousr]_|npm_)[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|sk-(?:proj-)?[A-Za-z0-9_-]{20,}|AKIA[A-Z0-9]{16}|xox[baprs]-[A-Za-z0-9-]{20,}|AIza[A-Za-z0-9_-]{30,})|-----BEGIN (?:RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----/]
|
|
50
50
|
];
|
|
51
51
|
|
|
52
52
|
function die(msg) { console.error(`GATE SETUP ERROR: ${msg}`); process.exit(2); }
|
|
@@ -181,11 +181,9 @@ function redactByFold(text, terms) {
|
|
|
181
181
|
|
|
182
182
|
const fold = text => String(text).normalize('NFC').toLowerCase();
|
|
183
183
|
|
|
184
|
-
function allowedSpans(lineLower,
|
|
184
|
+
function allowedSpans(lineLower, foldedAllow) {
|
|
185
185
|
const spans = [];
|
|
186
|
-
for (const
|
|
187
|
-
const al = fold(a);
|
|
188
|
-
if (!al.length) continue;
|
|
186
|
+
for (const al of foldedAllow) {
|
|
189
187
|
let i = lineLower.indexOf(al);
|
|
190
188
|
while (i !== -1) { spans.push([i, i + al.length]); i = lineLower.indexOf(al, i + al.length); }
|
|
191
189
|
}
|
|
@@ -203,26 +201,54 @@ function git(root, args, input) {
|
|
|
203
201
|
|
|
204
202
|
/* Scan every reachable object and every name in every reachable tree. A git failure,
|
|
205
203
|
malformed object or oversized response refuses the scan rather than dropping coverage. */
|
|
204
|
+
function* batchCatFile(repo, oids) {
|
|
205
|
+
if (!oids.length) return;
|
|
206
|
+
for (const oid of oids) if (!/^[0-9a-f]{40,64}$/.test(oid)) throw Error('malformed object id');
|
|
207
|
+
const out = git(repo, ['cat-file', '--batch'], oids.join('\n') + '\n');
|
|
208
|
+
let pos = 0;
|
|
209
|
+
for (const oid of oids) {
|
|
210
|
+
const nl = out.indexOf(0x0a, pos);
|
|
211
|
+
if (nl === -1) throw Error(`short cat-file output for ${oid}`);
|
|
212
|
+
const header = out.subarray(pos, nl).toString('ascii');
|
|
213
|
+
const hm = header.match(/^([0-9a-f]+) (\w+) (\d+)$/);
|
|
214
|
+
if (!hm) throw Error(`unexpected cat-file header for ${oid}: ${header}`);
|
|
215
|
+
const size = Number(hm[3]);
|
|
216
|
+
const body = out.subarray(nl + 1, nl + 1 + size);
|
|
217
|
+
if (body.length !== size || out[nl + 1 + size] !== 0x0a) throw Error(`truncated cat-file body for ${oid}`);
|
|
218
|
+
pos = nl + 1 + size + 1;
|
|
219
|
+
yield { oid, type: hm[2], bytes: body };
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
206
223
|
function* historyItems(root) {
|
|
207
224
|
const repo = git(root, ['rev-parse', '--show-toplevel']).toString('utf8').trim();
|
|
208
225
|
const commits = git(repo, ['rev-list', '--all']).toString('ascii').trim().split('\n').filter(Boolean);
|
|
209
226
|
const objects = git(repo, ['rev-list', '--objects', '--all', '--no-object-names']).toString('ascii').trim().split('\n').filter(Boolean);
|
|
210
|
-
|
|
211
|
-
|
|
227
|
+
const treeNamesCache = new Map();
|
|
228
|
+
for (const { oid, type, bytes } of batchCatFile(repo, commits)) {
|
|
229
|
+
if (type !== 'commit') throw Error('malformed commit');
|
|
212
230
|
const boundary = bytes.indexOf(Buffer.from('\n\n'));
|
|
213
231
|
if (boundary < 0) throw Error('malformed commit');
|
|
214
232
|
yield { rel: '', label: `history:${oid}:message`, bytes: bytes.subarray(boundary + 2), history: true };
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
233
|
+
const treeMatch = bytes.subarray(0, boundary).toString('ascii').match(/^tree ([0-9a-f]{40,64})$/m);
|
|
234
|
+
const treeKey = treeMatch ? treeMatch[1] : oid;
|
|
235
|
+
let names = treeNamesCache.get(treeKey);
|
|
236
|
+
if (!names) {
|
|
237
|
+
const entries = git(repo, ['ls-tree', '-r', '-z', '--full-tree', treeKey]);
|
|
238
|
+
names = entries.toString('utf8').split('\0').filter(Boolean).map(entry => {
|
|
239
|
+
const tab = entry.indexOf('\t');
|
|
240
|
+
if (tab < 0) throw Error('malformed tree entry');
|
|
241
|
+
return entry.slice(tab + 1);
|
|
242
|
+
});
|
|
243
|
+
treeNamesCache.set(treeKey, names);
|
|
244
|
+
}
|
|
245
|
+
for (const name of names) {
|
|
246
|
+
yield { rel: name, label: `history:${oid}:filename`, bytes: Buffer.alloc(0), history: true, nameOnly: true };
|
|
220
247
|
}
|
|
221
248
|
}
|
|
222
|
-
for (const oid of objects) {
|
|
223
|
-
if (
|
|
224
|
-
|
|
225
|
-
yield { rel: '', label: `history:${oid}:blob`, bytes: git(repo, ['cat-file', 'blob', oid]), history: true };
|
|
249
|
+
for (const { oid, type, bytes } of batchCatFile(repo, objects)) {
|
|
250
|
+
if (type !== 'blob') continue;
|
|
251
|
+
yield { rel: '', label: `history:${oid}:blob`, bytes, history: true };
|
|
226
252
|
}
|
|
227
253
|
const tags = git(repo, ['for-each-ref', '--format=%(refname:strip=2)', 'refs/tags']).toString('utf8').split('\n').filter(Boolean);
|
|
228
254
|
for (const tag of tags) yield { rel: tag, label: 'history:tag', bytes: Buffer.alloc(0), history: true, nameOnly: true };
|
|
@@ -355,38 +381,58 @@ function scan(root, list, listFile, all, history = false) {
|
|
|
355
381
|
if (!insideGitRepo(root)) die('--history requires a git work tree');
|
|
356
382
|
try { items = [...items, ...historyItems(root)]; } catch (e) { die(`history enumeration failed: ${e.message}`); }
|
|
357
383
|
}
|
|
384
|
+
const foldedTerms = list.terms.map(fold).filter(Boolean);
|
|
385
|
+
const foldedAllow = list.allow.map(fold).filter(Boolean);
|
|
358
386
|
for (const item of items) {
|
|
359
387
|
if (skipPath && path.resolve(root, item.rel) === skipPath) {
|
|
360
388
|
if (/\(index/.test(item.label)) die(`the forbidden list itself is tracked by git (${item.rel}). It must never ship: run \`git rm --cached ${item.rel}\` and add it to .gitignore.`);
|
|
361
389
|
continue;
|
|
362
390
|
}
|
|
363
391
|
files++;
|
|
392
|
+
let decodedText = null;
|
|
393
|
+
let splitLines = null;
|
|
394
|
+
const getText = () => (decodedText === null ? (decodedText = item.bytes.toString('utf8')) : decodedText);
|
|
395
|
+
const getLines = () => (splitLines === null ? (splitLines = getText().split('\n')) : splitLines);
|
|
364
396
|
if (history) {
|
|
365
397
|
for (const [rule, pattern] of PRIVATE_CLASSES) {
|
|
366
|
-
if (pattern.test(item.rel)) hits.push({ file: item.history ? item.label : '(path)', line: 0, rule });
|
|
367
|
-
if (!item.nameOnly
|
|
368
|
-
|
|
369
|
-
|
|
398
|
+
if (item.rel && pattern.test(item.rel)) hits.push({ file: item.history ? item.label : '(path)', line: 0, rule });
|
|
399
|
+
if (!item.nameOnly && pattern.test(getText())) {
|
|
400
|
+
getLines().forEach((line, n) => {
|
|
401
|
+
if (pattern.test(line)) hits.push({ file: item.history ? item.label : item.rel, line: n + 1, rule });
|
|
402
|
+
});
|
|
403
|
+
}
|
|
370
404
|
}
|
|
371
405
|
}
|
|
372
406
|
// the PATH first: one scan per item, labelled "(path)", never covered by allow spans of the text
|
|
373
|
-
if (!scannedPaths.has(item.rel) || item.history) {
|
|
407
|
+
if (foldedTerms.length && (!scannedPaths.has(item.rel) || item.history)) {
|
|
374
408
|
if (!item.history) scannedPaths.add(item.rel);
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
const
|
|
378
|
-
|
|
409
|
+
if (item.rel) {
|
|
410
|
+
const lower = fold(item.rel);
|
|
411
|
+
const matchedPathTerms = foldedTerms.filter(t => lower.includes(t));
|
|
412
|
+
if (matchedPathTerms.length) {
|
|
413
|
+
const spans = allowedSpans(lower, foldedAllow);
|
|
414
|
+
for (const t of matchedPathTerms) {
|
|
415
|
+
let i = lower.indexOf(t);
|
|
416
|
+
while (i !== -1) {
|
|
417
|
+
if (!spans.some(([x, y]) => i >= x && i + t.length <= y)) hits.push({ file: item.history ? item.label : `${item.rel} (path)`, line: 0, rule: 'P_LIST' });
|
|
418
|
+
i = lower.indexOf(t, i + 1);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
}
|
|
379
422
|
}
|
|
380
423
|
}
|
|
424
|
+
if (!foldedTerms.length || item.nameOnly) continue;
|
|
381
425
|
if (!item.history && isBinary(item.bytes)) continue;
|
|
382
|
-
const
|
|
383
|
-
|
|
426
|
+
const fullLower = fold(getText());
|
|
427
|
+
const activeTerms = foldedTerms.filter(t => fullLower.includes(t));
|
|
428
|
+
if (!activeTerms.length) continue;
|
|
429
|
+
getLines().forEach((line, n) => {
|
|
384
430
|
const lower = fold(line);
|
|
385
|
-
|
|
386
|
-
for (const
|
|
387
|
-
const t = fold(term);
|
|
431
|
+
let spans = null;
|
|
432
|
+
for (const t of activeTerms) {
|
|
388
433
|
let i = lower.indexOf(t);
|
|
389
434
|
while (i !== -1) {
|
|
435
|
+
spans ||= allowedSpans(lower, foldedAllow);
|
|
390
436
|
const inside = spans.some(([a, b]) => i >= a && i + t.length <= b);
|
|
391
437
|
if (!inside) hits.push({ file: item.label, line: n + 1, rule: 'P_LIST' });
|
|
392
438
|
i = lower.indexOf(t, i + 1);
|
package/docs/companions.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Companion tools
|
|
2
2
|
|
|
3
|
-
This repo tells an AI *how to behave with you*. Two companions govern
|
|
3
|
+
This repo tells an AI *how to behave with you*. Two optional companions govern operations routed through them. Properly configured, they enforce folder ACLs, approval gates or context receipts on calls through that companion; they do not block direct filesystem tools, shell commands or other connectors unless your host's own tool permissions or OS sandbox restrict those paths.
|
|
4
4
|
|
|
5
|
-
| Your saved setting |
|
|
5
|
+
| Your saved setting | Without a companion | Through a configured companion |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| **Always ask before** delete / publish / send / spend | the AI remembering |
|
|
8
|
-
| **Off limits** folders | the AI remembering |
|
|
9
|
-
| **Write policy** (freely / logs and inbox only / ask first) | the AI remembering |
|
|
7
|
+
| **Always ask before** delete / publish / send / spend | the AI remembering | reliquary-tc: destructive tools fail closed until a human confirms |
|
|
8
|
+
| **Off limits** folders | the AI remembering | reliquary-tc: folder ACL deny, per caller |
|
|
9
|
+
| **Write policy** (freely / logs and inbox only / ask first) | the AI remembering | reliquary-tc: per-folder read / write / delete scopes; Context Layer: memory writes stay proposals until approved |
|
|
10
10
|
| **Evidence inline** | the AI citing what it read | Context Layer: every disclosure and action leaves a receipt |
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## reliquary-tc (for Obsidian vaults)
|
|
15
15
|
|
|
16
|
-
**What it is.** A governed MCP server over Obsidian vaults: https://github.com/The-40-Thieves/
|
|
16
|
+
**What it is.** A governed MCP server over Obsidian vaults: https://github.com/The-40-Thieves/reliquary-tc (AGPL-3.0). Its own README states the problem it exists for: an agent with raw filesystem access to a vault "can do real damage", and most Obsidian MCP servers hand that access over with an API key between the agent and everything you have written.
|
|
17
17
|
|
|
18
18
|
**What it adds** (its words, condensed):
|
|
19
19
|
- **Governed writes**: every call runs through auth → scopes → folder ACL → read-only kill switch → idempotency → throttle → human-in-the-loop confirmation → audit log. You decide which folders an agent may read, write or delete, per vault and per caller; destructive operations fail closed until a human approves.
|
|
@@ -23,11 +23,11 @@ This repo tells an AI *how to behave with you*. Two companions govern *what it c
|
|
|
23
23
|
|
|
24
24
|
**Try it**:
|
|
25
25
|
```bash
|
|
26
|
-
npx
|
|
26
|
+
npx reliquary-tc /path/to/vault
|
|
27
27
|
```
|
|
28
28
|
Lexical search and every note tool work immediately; semantic and graph retrieval need an embeddings backend (Ollama by default). Also ships as a Docker image, an `.mcpb` bundle, and standalone binaries.
|
|
29
29
|
|
|
30
|
-
**How it pairs with this repo.** Answer `notes_tool: obsidian` and `
|
|
30
|
+
**How it pairs with this repo.** Answer `notes_tool: obsidian` and `reliquary_tc: yes` and the rendered `AGENT_ONBOARDING.md` tells the AI to reach the vault through reliquary-tc rather than the filesystem; your **off-limits** and **always-ask** answers map to the folder ACL and human-in-the-loop list you configure in reliquary-tc. Calls routed through reliquary-tc enforce those rules; disable or sandbox raw filesystem and shell access in your AI host if you want the agent confined to that door. Answer `reliquary_tc: no` (the default) and the AI works on the vault folder directly, with the onboarding file naming what reliquary-tc would add.
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -43,7 +43,7 @@ Lexical search and every note tool work immediately; semantic and graph retrieva
|
|
|
43
43
|
- **Write policy** "logs and inbox only" or "ask before every write" is the Layer's rule that memory writes remain proposals until approved.
|
|
44
44
|
- **Off limits** is the Layer's vault stage: originals that never enter a bundle.
|
|
45
45
|
- **Always ask before** is the Layer's decide stage: allow, reduce, approve or deny by action and recipient.
|
|
46
|
-
Running several agents is where it earns its keep (the hand-off layer, which this repo does not install): each delegation carries a purpose-bound bundle and returns a receipt, so you can answer "who saw what, and why" after the fact. The repo's `AGENT_ONBOARDING.md` is the human-readable policy; the Context Layer
|
|
46
|
+
Running several agents is where it earns its keep (the hand-off layer, which this repo does not install): each delegation carries a purpose-bound bundle and returns a receipt, so you can answer "who saw what, and why" after the fact. The repo's `AGENT_ONBOARDING.md` is the human-readable policy; the Context Layer enforces and records it for context bundles and actions mediated by the Layer, alongside whatever host permissions or sandboxing govern direct local tools.
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
@@ -51,7 +51,7 @@ Running several agents is where it earns its keep (the hand-off layer, which thi
|
|
|
51
51
|
|
|
52
52
|
| `notes_tool` answer | How an AI reaches it | Write posture rendered into the onboarding file |
|
|
53
53
|
|---|---|---|
|
|
54
|
-
| `obsidian` |
|
|
54
|
+
| `obsidian` | reliquary-tc (above) when `reliquary_tc: yes`, else the vault folder on disk | your write policy; enforced on reliquary-tc calls when its ACL is configured (host permissions still govern direct disk tools) |
|
|
55
55
|
| `logseq` / `folder` | the folder on disk | your write policy, under each folder's README |
|
|
56
56
|
| `notion` | Notion's own MCP connector | writes only into the pages or databases you name; the AI proposes new top-level pages, never creates them unasked |
|
|
57
57
|
| `google-docs` | the Google Drive / Docs connector | the AI drafts into a doc named for the topic and never edits a shared doc's existing text without being asked |
|
package/docs/guarantees.md
CHANGED
|
@@ -21,12 +21,12 @@ The check measures rendered-file consistency. The [instruction tiers](tiers.md)
|
|
|
21
21
|
The installer validates answers, configuration, source files and target marker structure before its write phase. The renderer validates its full target plan before replacing files.
|
|
22
22
|
|
|
23
23
|
- **Paths:** paths beneath the installation root must be real files and directories. Symlinks and paths outside the root are refused. Local notes paths must sit outside tool-owned paths, including `.agent-personalizer/`.
|
|
24
|
-
- **Git
|
|
24
|
+
- **Git metadata:** local Git metadata in an enclosing Git work tree is the only write target outside the installed folder, and is never committed. On install, the installer adds `USER.md`, `LEARNED.md`, `.agent-personalizer.json` and the ChatGPT paste files to the repo's `.git/info/exclude` (the path `git rev-parse --git-path info/exclude` names) in one block marked with the install folder; re-runs replace that block. At level 3, passing `--precommit` also wraps the repo's local `hooks/pre-commit` and preserves any prior hook as `pre-commit.agent-personalizer-original` (see [Forbidden-string gate](#forbidden-string-gate)). A folder git already ignores is left alone, a symlinked or unwritable exclude file gets a warning instead, and so does a private file git already tracks. `CLAUDE.md`, `AGENTS.md`, `GEMINI.md` and `AGENT_ONBOARDING.md` stay committable with a note to review them.
|
|
25
25
|
- **Markers:** each target may have one correctly ordered generated block or be ready for its first block. Malformed blocks are refused.
|
|
26
26
|
- **Encoding:** sources and targets must contain valid UTF-8; invalid bytes are refused instead of re-encoded.
|
|
27
27
|
- **Existing work:** edited and pre-existing profiles, notes templates, rules and tools are kept and named. Untouched installer-owned files update to the current answers and package. Obsolete untouched copies are removed; edited copies stay and are named.
|
|
28
28
|
- **Recovery:** the installer validates its complete plan before writing and restores changed files on failure. The renderer stages targets and their ownership configuration together with backups and rolls back a failed write. An incomplete restore keeps and names its backup with exit `2`.
|
|
29
|
-
- **Local operation:** the tool uses HOME to find the AI apps' folders. Before consent, it may check whether `~/.claude`, `~/.codex` and `~/.gemini` exist for target pre-selection; it opens or lists their contents only after a yes. A non-interactive install and a re-run never read sessions. The tool makes no network calls and sends no telemetry. `npx` fetches the package before execution.
|
|
29
|
+
- **Local operation:** the tool uses `HOME` (and `CODEX_HOME` when set) to find the AI apps' folders. Before consent, it may check whether `~/.claude`, `~/.codex` (or `$CODEX_HOME`) and `~/.gemini` exist for target pre-selection; it opens or lists their contents only after a yes. A non-interactive install and a re-run never read sessions. The tool makes no network calls and sends no telemetry. `npx` fetches the package before execution.
|
|
30
30
|
|
|
31
31
|
On a re-run, each home-file line that byte-matches the previous template is migrated to the new template or removed when obsolete. An edited pointer stays byte for byte and is named with its file and line for manual review. Other outer text stays byte for byte. The renderer owns only the marked block.
|
|
32
32
|
|
|
@@ -79,7 +79,7 @@ The onboarding manual tells the AI where it may write, what is off limits and wh
|
|
|
79
79
|
|
|
80
80
|
To make those answers govern tool access, configure a [companion](companions.md):
|
|
81
81
|
|
|
82
|
-
- **
|
|
82
|
+
- **reliquary-tc:** folder access controls and human approval for destructive Obsidian operations.
|
|
83
83
|
- **The Context Layer:** purpose-bound context, approval decisions and receipts for actions and disclosures.
|
|
84
84
|
|
|
85
|
-
These controls live in the companion's configuration. Saved onboarding answers record the policy and render the instructions that refer to it.
|
|
85
|
+
These controls live in the companion's configuration and apply to calls routed through that companion; direct filesystem, shell or other connector access still depends on your AI host's tool permissions and sandbox. Saved onboarding answers record the policy and render the instructions that refer to it.
|
package/docs/install.md
CHANGED
|
@@ -93,7 +93,7 @@ npx agent-personalizer --global --uninstall --dry
|
|
|
93
93
|
npx agent-personalizer --global --uninstall
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
`--global` keeps the level-1 profile source (`USER.md`, `LEARNED.md`, onboarding and configuration) in `~/.agent-personalizer/`. It writes a marked block to `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md
|
|
96
|
+
`--global` keeps the level-1 profile source (`USER.md`, `LEARNED.md`, onboarding and configuration) in `~/.agent-personalizer/`. It writes a marked block to `~/.claude/CLAUDE.md`, `~/.codex/AGENTS.md` (or `$CODEX_HOME/AGENTS.md` when `CODEX_HOME` is set to a non-empty absolute path), `~/.gemini/GEMINI.md` and `~/.hermes/SOUL.md` for the selected targets. When a non-empty `AGENTS.override.md` exists in the active Codex home, Codex gives it precedence over `AGENTS.md`; the installer warns without modifying the override. For Hermes in a project, use `--ai agents` to write `AGENTS.md`. Hermes reads its global `SOUL.md` from `HERMES_HOME` when set; the installer warns if that differs from `~/.hermes`. Paths use `HOME`, with `USERPROFILE` as the Windows fallback when `HOME` is missing or empty. `HOME` (and `CODEX_HOME` when set) must be a non-empty absolute path, never a symlink. Global instructions name the profile's full path so they work from any project. Start a new AI session to load them; client instruction precedence still applies.
|
|
97
97
|
|
|
98
98
|
Select only `claude`, `agents`, `gemini` and `hermes`. Other targets, `--dir` and levels 2/3 are refused. A headless first install needs `--ai` and `--yes`; level 1 is implicit. `--answers` and `--defaults` work as with project installs. A re-run keeps saved targets and answers.
|
|
99
99
|
|
package/docs/learning.md
CHANGED
|
@@ -18,8 +18,8 @@ that Claude Code, Codex and Gemini CLI still keep, to find corrections you repea
|
|
|
18
18
|
· Other people's details in there? Add their names to your private list first.
|
|
19
19
|
· Delete it any time: npx agent-personalizer learn --forget
|
|
20
20
|
(your AI app's own history stays as it is)
|
|
21
|
-
· Codex
|
|
22
|
-
They
|
|
21
|
+
· Local Codex memory notes from your Codex home are included when you choose Codex.
|
|
22
|
+
They span sessions on this machine (or connected host), not just this folder.
|
|
23
23
|
· When your AI reads the file, its provider sees these messages again.
|
|
24
24
|
· Work or client accounts: check your agreement before reusing their sessions.
|
|
25
25
|
· Not affiliated with Anthropic, OpenAI or Google. Their formats can change.
|
|
@@ -43,13 +43,13 @@ The saved AI selection chooses the sources. The reader takes up to 20 of the new
|
|
|
43
43
|
| Selected target | Local source |
|
|
44
44
|
|---|---|
|
|
45
45
|
| `claude` | Claude Code: `~/.claude/projects/<project>/<session>.jsonl`, directly inside each project folder |
|
|
46
|
-
| `agents` | Codex: `~/.codex/sessions/**/rollout-*.jsonl`, plus `~/.codex/memories/*.md` and `~/.codex/memories_v2/**/*.md` |
|
|
46
|
+
| `agents` | Codex: `~/.codex/sessions/**/rollout-*.jsonl`, plus `~/.codex/memories/*.md` and `~/.codex/memories_v2/**/*.md` (or under `$CODEX_HOME` when set) |
|
|
47
47
|
| `gemini` | Gemini CLI: `~/.gemini/tmp/<slug-or-hash>/chats/session-*.jsonl` (and `.json`), `~/.cache/.gemini/tmp/<slug>/chats/` when sandboxed, and older `logs.json` |
|
|
48
48
|
| `chatgpt`, `prompt` | No local session reader |
|
|
49
49
|
|
|
50
50
|
By default, only sessions associated with the `--dir` folder or one of its subfolders are included. Claude Code and Codex sessions are matched by their recorded working directory; Gemini CLI resolves project slugs from `~/.gemini/projects.json` and `.project_root` markers, with its legacy SHA-256 project folder as a fallback. If a session does not provide enough path information to match it safely, it is skipped. Use `npx agent-personalizer learn --dir . --all-projects` to include sessions from every project.
|
|
51
51
|
|
|
52
|
-
The digest contains typed user messages and, when Codex is selected, up to 20 of the newest Codex memory files in a separate section. These memory notes
|
|
52
|
+
The digest contains typed user messages and, when Codex is selected, up to 20 of the newest Codex memory files in a separate section. These memory notes live in the local Codex store for this machine or connected host (`~/.codex` or `$CODEX_HOME`), so they span local Codex work beyond this folder rather than syncing across your OpenAI account. AI replies, tool output, reasoning, automation sessions and injected context are dropped. Messages and memory notes over 2,000 characters are dropped whole. Gemini chat records reconstruct final conversation state across append-only records, snapshots, patches and rewinds; a message repeated in the chat and logs is included once. The all-projects option affects session history; the memory file limit still applies.
|
|
53
53
|
|
|
54
54
|
The reader streams session files, skips oversized lines and stops a file at its size limit. Symlinks, unreadable files, other-project sessions and unknown or malformed formats are skipped and counted. Codex session headers are inspected to determine their project; message content from other projects is not scanned. The terminal lists files read and skip counts; message text is never printed there. Vendor format changes may mean fewer usable sessions until the reader is updated.
|
|
55
55
|
|
|
@@ -81,7 +81,7 @@ Each question includes a count and one short quote, such as "You've asked me to
|
|
|
81
81
|
- digest: <ISO timestamp>
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
Confirmed entries reach `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, the ChatGPT paste exports and the session-start contract. Declined entries become a "Never ask again" list; the
|
|
84
|
+
Confirmed entries reach `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, global `SOUL.md` when Hermes is selected, the ChatGPT paste exports and the session-start contract. Declined entries become a "Never ask again" list; ChatGPT exports include the complete declined list in full, flag `OVER BUDGET` in the preview when a box exceeds its target limit, and refuse to write when `--strict` is passed. Proposed entries render nowhere. The shareable system prompt carries no entries.
|
|
85
85
|
|
|
86
86
|
After recording answers, the AI marks the digest as asked and re-renders. If it has no shell, it asks you to run `npx agent-personalizer --dir .`. At level 3 you can run `node render/render.cjs --dir .` and `node render/render.cjs --dir . --check`. Re-paste changed ChatGPT exports. As you work, a second correction of the same thing prompts one evidence-backed "Make it a rule?" question.
|
|
87
87
|
|
package/docs/paste-guide.md
CHANGED
|
@@ -5,9 +5,9 @@ The renderer writes one file per AI. This page says where each AI reads it, and
|
|
|
5
5
|
| Rendered file | Who reads it | How it is read |
|
|
6
6
|
|---|---|---|
|
|
7
7
|
| `CLAUDE.md` | Claude Code | Automatically, from the project, or `~/.claude/CLAUDE.md` for every project with `--global`. Nothing to paste. |
|
|
8
|
-
| `AGENT_ONBOARDING.md` | any AI | Named as the second thing to read in `CLAUDE.md`, `AGENTS.md` and `GEMINI.md`. Paste it
|
|
9
|
-
| `AGENTS.md` | Codex CLI, Cursor, Hermes Agent, and other agents that adopted the AGENTS.md convention | Automatically, from the repository root; `--global` writes `~/.codex/AGENTS.md` for all projects. Nothing to paste. |
|
|
10
|
-
| `GEMINI.md` | Gemini CLI and
|
|
8
|
+
| `AGENT_ONBOARDING.md` | any AI | Named as the second thing to read in `CLAUDE.md`, `AGENTS.md` and `GEMINI.md`. Paste or upload it where the AI does not read your local folder directly (below). |
|
|
9
|
+
| `AGENTS.md` | Codex CLI, Cursor, Hermes Agent, and other agents that adopted the AGENTS.md convention | Automatically, from the repository root; `--global` writes `~/.codex/AGENTS.md` (or `$CODEX_HOME/AGENTS.md` when `CODEX_HOME` is set) for all projects. Nothing to paste. |
|
|
10
|
+
| `GEMINI.md` | Gemini CLI and Gemini (via Antigravity CLI) | Automatically, from the folder; `--global` writes `~/.gemini/GEMINI.md` for all projects (also read by Google Antigravity alongside `~/.gemini/config/GEMINI.md`). Nothing to paste. |
|
|
11
11
|
| `SOUL.md` | Hermes Agent | `--global --ai hermes` appends a marked block to `~/.hermes/SOUL.md`. In a project, use `--ai agents` for `AGENTS.md`. A different `HERMES_HOME` changes where Hermes reads the global file. |
|
|
12
12
|
| `chatgpt-box1.txt`, `chatgpt-box2.txt` and `chatgpt-custom-instructions.md` | ChatGPT | Profile and response text to paste, with a preview and counts. |
|
|
13
13
|
| `system-prompt.md` | anything with a system-prompt field, shared bots, API calls | Paste as the system prompt. Universal rules only, no profile, safe to share. |
|
|
@@ -21,6 +21,7 @@ Use `npx agent-personalizer --global --ai claude,agents,gemini,hermes --yes` for
|
|
|
21
21
|
1. Run the installer in the project folder. `CLAUDE.md` and `AGENT_ONBOARDING.md` land there and Claude Code reads `CLAUDE.md` on every session.
|
|
22
22
|
2. For rules that must win at the moment of decision, register the session-start hook: see [`hooks/README.md`](../hooks/README.md). It prints the inject-marked rules and your onboarding block into context before your first message.
|
|
23
23
|
3. For your output style specifically, Claude Code has a custom output-style slot that lives in the system prompt every turn (`/output-style`). Put the "How to talk" and "Output shape" lines from `AGENT_ONBOARDING.md` there; a style in the system prompt is re-sent every turn, so it does not fade the way a file read once does. Tier 1 in [tiers.md](tiers.md).
|
|
24
|
+
4. In contributor repositories that standardize on a single shared `AGENTS.md` instead of separate rendered blocks, a minimal `CLAUDE.md` containing `@AGENTS.md` imports `AGENTS.md` directly into Claude Code.
|
|
24
25
|
|
|
25
26
|
## claude.ai (web and desktop apps), Claude Projects
|
|
26
27
|
|
|
@@ -32,34 +33,35 @@ Re-paste after every re-render. `--check` verifies the files on disk; it cannot
|
|
|
32
33
|
|
|
33
34
|
## ChatGPT
|
|
34
35
|
|
|
35
|
-
Open Settings → Personalization and enable customization. Copy the exported profile and response instructions into the fields your current interface provides, checking its displayed limits.
|
|
36
|
+
Open Settings → Personalization (or Settings → Customize ChatGPT on iOS and Android) and enable customization. Copy the exported profile and response instructions into the fields your current interface provides, checking its displayed limits.
|
|
36
37
|
|
|
37
38
|
- **Profile:** `chatgpt-box1.txt` is the plain profile text. An edited or pre-existing `USER.md` is its source too. Confirmed entries from `LEARNED.md` reach the ChatGPT exports.
|
|
38
39
|
- **Response instructions:** `chatgpt-box2.txt` is the plain onboarding and selected rule text.
|
|
39
40
|
- **Preview:** `chatgpt-custom-instructions.md` carries both exports inside fences with their character counts.
|
|
40
41
|
|
|
41
|
-
The configured baseline budget is 1,500 characters per export in `render/targets.json`: ChatGPT Free and Go accounts cap
|
|
42
|
+
The configured baseline budget is 1,500 characters per export in `render/targets.json`: ChatGPT Free and Go accounts cap Custom Instructions at 1,500 characters, while Plus, Pro, Business, Enterprise and Edu accounts allow up to 5,000 characters under Settings → Personalization (`More about you` and `Custom instructions`; `Customize ChatGPT` on mobile). With onboarding answers, box 1 compacts the generated profile while its structure still parses, and preserves custom profile text in full when it does not. Box 2 places the onboarding block (always-ask, off-limits, write policy, then style) before the selected session rules. Confirmed entries and declined "Never ask again" entries are both appended in full; nothing is truncated silently. Proposed entries are omitted. The preview reports each count; over-budget text is written in full and flagged `OVER BUDGET`, while `--strict` refuses the write. Review the text against your account's displayed limits. Account-level Custom Instructions do not read your local project folder directly, whereas file access in ChatGPT depends on the surface, uploads and enabled tools; for the full onboarding, entries and rule source in a ChatGPT Project, upload `AGENT_ONBOARDING.md`, `LEARNED.md` and `rules/` as project files (or add Project instructions under Project settings).
|
|
42
43
|
|
|
43
44
|
## Codex CLI
|
|
44
45
|
|
|
45
46
|
Run the installer at the repo root, then start Codex in that project. Codex builds its instruction chain once per run:
|
|
46
47
|
|
|
47
|
-
- **Global guidance:** the first non-empty `AGENTS.override.md` or `AGENTS.md` in the Codex home directory
|
|
48
|
+
- **Global guidance:** the first non-empty `AGENTS.override.md` or `AGENTS.md` in the Codex home directory (`~/.codex`, or `$CODEX_HOME` when set). `--global --ai agents` writes to that effective Codex home and warns without modifying `AGENTS.override.md` when a non-empty override shadows `AGENTS.md`.
|
|
48
49
|
- **Project guidance:** files from the repository root down to the working directory are merged in that order. Deeper files take precedence over earlier guidance. With no project root, discovery checks the working directory.
|
|
49
|
-
- **Per directory:** `AGENTS.override.md` is tried before `AGENTS.md`, followed by configured fallback filenames. At most one file is selected per directory.
|
|
50
|
+
- **Per directory:** `AGENTS.override.md` is tried before `AGENTS.md`, followed by configured fallback filenames. At most one file is selected per directory; project installs warn if a non-empty `AGENTS.override.md` in the target folder shadows `AGENTS.md`.
|
|
50
51
|
- **Size cap:** the combined guidance has a default limit of 32 KiB, configurable with `project_doc_max_bytes`.
|
|
52
|
+
- **Verify in a fresh session:** run `codex --ask-for-approval never "Summarize the current instructions."` (or `"List the instruction sources you loaded."`) from your repository root, check `echo $CODEX_HOME` if global guidance is missing, or inspect `codex -c log_dir=./.codex-log` (`./.codex-log/codex-tui.log`) to confirm which instruction files loaded.
|
|
51
53
|
|
|
52
|
-
Verified against [OpenAI's Codex AGENTS.md documentation](https://
|
|
54
|
+
Verified against [OpenAI's Codex AGENTS.md documentation](https://developers.openai.com/codex/guides/agents-md) on 2026-11-18. Restart Codex after an update so it rebuilds the instruction chain.
|
|
53
55
|
|
|
54
56
|
## Cursor
|
|
55
57
|
|
|
56
58
|
Reads `AGENTS.md` at the project root. Older setups use `.cursor/rules/`; if yours does, point one rule file at `AGENTS.md` rather than copying its text, so there is one owner.
|
|
57
59
|
|
|
58
|
-
## Gemini CLI and
|
|
60
|
+
## Gemini CLI and Gemini (via Antigravity CLI)
|
|
59
61
|
|
|
60
|
-
Gemini CLI reads `GEMINI.md` from the folder (and parent folders), plus `~/.gemini/GEMINI.md` when installed with `--global --ai gemini`. Project installs also add `.gemini/commands/personalize.toml` for `/personalize`, and level-3 installs provide `hooks/gemini-cli/session-start.sh` for `.gemini/settings.json` (see [`hooks/README.md`](../hooks/README.md)).
|
|
62
|
+
Gemini CLI reads `GEMINI.md` from the folder (and parent folders), plus `~/.gemini/GEMINI.md` when installed with `--global --ai gemini`. Project installs also add `.gemini/commands/personalize.toml` for `/personalize`, and level-3 installs provide `hooks/gemini-cli/session-start.sh` for `.gemini/settings.json` (see [`hooks/README.md`](../hooks/README.md)). Standalone Gemini CLI consumer `Login with Google` for Google AI Pro and Ultra accounts was deprecated in June 2026 in favor of Gemini API keys or Gemini (via Antigravity CLI); both runners read the same `GEMINI.md` output.
|
|
61
63
|
|
|
62
|
-
Google Antigravity
|
|
64
|
+
Google Antigravity (including Gemini (via Antigravity CLI)) discovers directory `GEMINI.md` and `AGENTS.md` files from the current directory up to the repository root with deduplication, and reads `~/.gemini/GEMINI.md` alongside its managed global target `~/.gemini/config/GEMINI.md` (which enforces a 24,000-byte per-file limit after includes, plus modular `~/.gemini/config/rules/*.md` files with YAML frontmatter). Use `--compact` if a custom rule set approaches the 20,000-character warning budget.
|
|
63
65
|
|
|
64
66
|
## Anything else
|
|
65
67
|
|
package/examples/answers.json
CHANGED
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.10.
|
|
3
|
+
Tier 3 from the tiers doc (https://github.com/aunysillyme/agent-personalizer/blob/v0.10.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
|
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
# Gemini CLI SessionStart hook: injects the rendered session-start contract as JSON additionalContext.
|
|
3
3
|
set -eu
|
|
4
|
-
|
|
4
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
ROOT="$(cd "$HERE/../.." && pwd)"
|
|
6
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
7
|
+
echo "[agent-personalizer] node not found; session-start contract NOT injected. Rules remain reachable through GEMINI.md pointers." >&2
|
|
8
|
+
exit 1
|
|
9
|
+
fi
|
|
5
10
|
exec node -e '
|
|
6
|
-
const { spawnSync } = require("child_process");
|
|
7
11
|
const path = require("path");
|
|
8
12
|
const root = process.argv[1];
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
const chunks = [];
|
|
14
|
+
const origWrite = process.stdout.write.bind(process.stdout);
|
|
15
|
+
process.stdout.write = (chunk, encoding) => {
|
|
16
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk), typeof encoding === "string" ? encoding : "utf8"));
|
|
17
|
+
return true;
|
|
18
|
+
};
|
|
19
|
+
process.argv = [process.execPath, path.join(root, "render/render.cjs"), "--dir", root, "--contract", "--contract-target", "gemini"];
|
|
20
|
+
try {
|
|
21
|
+
require(path.join(root, "render/render.cjs")).main();
|
|
22
|
+
} finally {
|
|
23
|
+
process.stdout.write = origWrite;
|
|
13
24
|
}
|
|
14
|
-
|
|
25
|
+
const text = Buffer.concat(chunks).toString("utf8");
|
|
26
|
+
process.stdout.write(JSON.stringify({ hookSpecificOutput: { hookEventName: "SessionStart", additionalContext: text } }) + "\n");
|
|
15
27
|
' "$ROOT"
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# agent-personalizer
|
|
2
2
|
|
|
3
|
-
> AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI, Hermes Agent and ChatGPT, rendered from one source and kept in sync.
|
|
3
|
+
> AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI, Gemini (via Antigravity CLI), Hermes Agent and ChatGPT, rendered from one source and kept in sync.
|
|
4
4
|
|
|
5
5
|
Install with `npx agent-personalizer`. Node 24 or 26 (active LTS) is recommended; 22 or later runs. Headless setup: `npx agent-personalizer --dir . --ai claude,agents --level 1 --yes --defaults`.
|
|
6
6
|
|
|
@@ -30,6 +30,7 @@ Session data stays local until the user's AI reads it and sends it to its provid
|
|
|
30
30
|
- [lean-computer-use](https://github.com/aunysillyme/lean-computer-use): Background Mac computer control for AI agents: desk tools, a fresh runner subagent, retry guards and a transcript token meter, installed with one command
|
|
31
31
|
- [decompose](https://github.com/aunysillyme-dev/aunx-decompose): Task planner and wave checker for AI coding agents: splits prompts into checkable units and parallel waves, rejecting cycles and overlapping writes
|
|
32
32
|
- [aunx-skills](https://github.com/aunysillyme-dev/aunx-skills): Ten standalone agent skills for Claude Code, Codex, Cursor and Gemini CLI: full output keeper, number guard, docs fetch ladder, rename sweep and more
|
|
33
|
+
- [stack](https://github.com/aunysillyme-dev/stack): AI tools list for everything you build with AI: curated stacks of tools, models and workflows as open JSON. Video and design live, more coming.
|
|
33
34
|
<!-- set:end -->
|
|
34
35
|
|
|
35
36
|
## Optional
|
package/package.json
CHANGED
|
@@ -1,38 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-personalizer",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI
|
|
3
|
+
"version": "0.10.2",
|
|
4
|
+
"description": "AI custom instructions from approved entries: a profile and rules for Claude Code, Codex, Cursor, Gemini CLI and ChatGPT, kept in sync from one source.",
|
|
5
5
|
"author": "aunysillyme (https://github.com/aunysillyme)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/aunysillyme",
|
|
8
8
|
"repository": "github:aunysillyme/agent-personalizer",
|
|
9
|
-
"homepage": "https://
|
|
9
|
+
"homepage": "https://agent-personalizer.aunysillyme.dev",
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/aunysillyme/agent-personalizer/issues"
|
|
12
12
|
},
|
|
13
13
|
"keywords": [
|
|
14
14
|
"ai-agents",
|
|
15
|
+
"coding-agents",
|
|
15
16
|
"custom-instructions",
|
|
16
17
|
"agents-md",
|
|
18
|
+
"claude-md",
|
|
19
|
+
"gemini-md",
|
|
20
|
+
"soul-md",
|
|
17
21
|
"claude-code",
|
|
18
22
|
"codex",
|
|
23
|
+
"openai-codex",
|
|
19
24
|
"cursor",
|
|
25
|
+
"windsurf",
|
|
26
|
+
"copilot",
|
|
20
27
|
"gemini-cli",
|
|
28
|
+
"antigravity",
|
|
21
29
|
"google-antigravity",
|
|
22
30
|
"hermes-agent",
|
|
23
31
|
"chatgpt",
|
|
32
|
+
"agent-skills",
|
|
33
|
+
"skill-pack",
|
|
34
|
+
"dotfiles",
|
|
35
|
+
"context-engineering",
|
|
24
36
|
"personalization",
|
|
25
37
|
"agent-onboarding",
|
|
26
|
-
"
|
|
27
|
-
"claude-md",
|
|
28
|
-
"gemini-md",
|
|
38
|
+
"claude-code-hooks",
|
|
29
39
|
"system-prompt",
|
|
40
|
+
"prompt-engineering",
|
|
30
41
|
"ai-memory",
|
|
42
|
+
"llms-txt",
|
|
43
|
+
"obsidian",
|
|
44
|
+
"mcp",
|
|
31
45
|
"llm",
|
|
32
46
|
"cli",
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"prompt-engineering"
|
|
47
|
+
"nodejs",
|
|
48
|
+
"zero-dependencies"
|
|
36
49
|
],
|
|
37
50
|
"bin": {
|
|
38
51
|
"agent-personalizer": "bin/agent-personalizer.js"
|
package/render/onboarding.cjs
CHANGED
|
@@ -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.10.
|
|
20
|
+
const VERSION = '0.10.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 saved choice option, the
|
|
@@ -26,10 +26,10 @@ const DOCS = `https://github.com/aunysillyme/agent-personalizer/blob/v${VERSION}
|
|
|
26
26
|
readonly = no agent door today, so writes fall back to a local folder; other = named by the user,
|
|
27
27
|
conservative posture. p = location escaped for a code span, q = location escaped for prose. */
|
|
28
28
|
const TOOL = {
|
|
29
|
-
'obsidian': { kind: 'disk', label: 'an Obsidian vault (pairs with
|
|
29
|
+
'obsidian': { kind: 'disk', label: 'an Obsidian vault (pairs with reliquary-tc, see the companions doc)', name: 'Obsidian',
|
|
30
30
|
reach: (p, q, n, tc) => tc
|
|
31
|
-
? `the vault at \`${p}/\`, through **
|
|
32
|
-
: `the vault at \`${p}/\` as plain files (
|
|
31
|
+
? `the vault at \`${p}/\`, through **reliquary-tc** (governed MCP: folder ACLs, human-in-the-loop confirmation for destructive tools, audit log) rather than raw filesystem access; see ${DOCS}/companions.md`
|
|
32
|
+
: `the vault at \`${p}/\` as plain files (reliquary-tc is not installed; ${DOCS}/companions.md explains what it would add: folder ACLs, human-in-the-loop confirmation, an audit log)`, posture: null },
|
|
33
33
|
'notion': { kind: 'cloud', label: 'Notion', name: 'Notion', unit: 'page', reach: (p, q) => `the workspace "${q}" through Notion's own MCP connector`, posture: 'Write only into the pages or databases named in this file. Propose a new top-level page; never create one unasked.' },
|
|
34
34
|
'google-docs': { kind: 'cloud', label: 'Google Docs / Drive', name: 'Google Docs', unit: 'doc', reach: (p, q) => `"${q}" through the Google Drive / Docs connector`, posture: 'Draft into a doc named for the topic. Never edit the existing text of a shared doc without being asked.' },
|
|
35
35
|
'apple-notes': { kind: 'cloud', label: 'Apple Notes', name: 'Apple Notes', unit: 'note', reach: (p, q) => `the "${q}" folder through a separately installed local Apple Notes MCP (not built into any AI app; the user installs and connects it)`, posture: 'Read, and create new notes. Never edit or delete an existing note.' },
|
|
@@ -40,7 +40,7 @@ const TOOL = {
|
|
|
40
40
|
'other': { kind: 'other', label: 'something else (name it in the next answer)', name: null, reach: (p, q) => `"${q}"`, posture: 'Ask before the first write into it, and say which tool and location you mean. Until told otherwise, write only to the local fallback folder below.' },
|
|
41
41
|
};
|
|
42
42
|
/* name comes back RAW and is md-escaped exactly once at each prose render site */
|
|
43
|
-
const toolFor = (a) => { const t = TOOL[a.notes_tool]; return { kind: t.kind, unit: t.unit, posture: t.posture, name: t.name || a.notes_tool_name || 'an unnamed notes tool', reach: t.reach(esc(a.notes_path), md(a.notes_path), a.notes_tool_name || '', a.
|
|
43
|
+
const toolFor = (a) => { const t = TOOL[a.notes_tool]; return { kind: t.kind, unit: t.unit, posture: t.posture, name: t.name || a.notes_tool_name || 'an unnamed notes tool', reach: t.reach(esc(a.notes_path), md(a.notes_path), a.notes_tool_name || '', a.reliquary_tc === 'yes') }; };
|
|
44
44
|
const FALLBACK = 'notes';
|
|
45
45
|
/* kind without rendering anything (safe before validation completes) */
|
|
46
46
|
const kindOf = (a) => TOOL[a.notes_tool].kind;
|
|
@@ -96,7 +96,7 @@ const QUESTIONS = [
|
|
|
96
96
|
{ id: 'read_first', type: 'list', default: ['USER.md', 'AGENT_ONBOARDING.md'] },
|
|
97
97
|
{ id: 'notes_tool', type: 'choice', default: 'folder',
|
|
98
98
|
options: Object.entries(TOOL).map(([k, t]) => [k, t.label]) },
|
|
99
|
-
{ id: '
|
|
99
|
+
{ id: 'reliquary_tc', type: 'choice', default: 'no',
|
|
100
100
|
options: [['no', 'not installed; the AI works on the vault folder directly'], ['yes', 'installed and connected; the AI reaches the vault through it']] },
|
|
101
101
|
{ id: 'notes_tool_name', type: 'text', default: '' },
|
|
102
102
|
{ id: 'notes_path', type: 'text', default: 'notes' },
|
|
@@ -402,7 +402,7 @@ function writesLine(a, opts) {
|
|
|
402
402
|
const where = t.kind === 'cloud' ? `${md(t.name)} "${md(a.notes_path)}" through its connector, no filesystem writes`
|
|
403
403
|
: t.kind === 'readonly' ? `${md(t.name)} is read-only for you; the local fallback folder is ${esc(FALLBACK)}/`
|
|
404
404
|
: t.kind === 'other' ? `${md(t.name)} is unknown here: ask before the first write there; local fallback folder ${esc(FALLBACK)}/ meanwhile`
|
|
405
|
-
: `${md(t.name)} at ${esc(a.notes_path)}/${a.notes_tool === 'obsidian' && a.
|
|
405
|
+
: `${md(t.name)} at ${esc(a.notes_path)}/${a.notes_tool === 'obsidian' && a.reliquary_tc === 'yes' ? ', through reliquary-tc' : ''}`;
|
|
406
406
|
return `Writes: ${WRITE_POLICY[a.write_policy]}. Notes: ${where}.`;
|
|
407
407
|
}
|
|
408
408
|
function contractBlock(a, opts) {
|
|
@@ -419,7 +419,7 @@ function contractBlock(a, opts) {
|
|
|
419
419
|
'## How to work with this person', '',
|
|
420
420
|
`Always ask before: ${a.always_ask.join(', ') || 'nothing declared'}.`,
|
|
421
421
|
a.off_limits.length ? `Off limits in any output: ${a.off_limits.map(md).join(', ')}.` : null,
|
|
422
|
-
notesPending(a, opts) ? a.write_policy === 'notes-freely' ? 'Writes: no notes folder yet. Create nothing unasked. Once it exists, under its rules; nowhere else unasked.' : `Writes: no notes folder yet. ${WRITE_POLICY_PENDING[a.write_policy]}.` : kindOf(a) === 'disk' && a.write_policy === 'notes-freely' ? `Writes: under ${esc(a.notes_path)}/ rules only, nowhere else unasked. Notes: ${md(toolFor(a).name)}${a.
|
|
422
|
+
notesPending(a, opts) ? a.write_policy === 'notes-freely' ? 'Writes: no notes folder yet. Create nothing unasked. Once it exists, under its rules; nowhere else unasked.' : `Writes: no notes folder yet. ${WRITE_POLICY_PENDING[a.write_policy]}.` : kindOf(a) === 'disk' && a.write_policy === 'notes-freely' ? `Writes: under ${esc(a.notes_path)}/ rules only, nowhere else unasked. Notes: ${md(toolFor(a).name)}${a.reliquary_tc === 'yes' && a.notes_tool === 'obsidian' ? ', through reliquary-tc' : ''}.` : writesLine(a, opts),
|
|
423
423
|
`Tone: ${tone}. Length: ${length}. Wrong: ${mistakes}. Unsure: ${unsure}.`,
|
|
424
424
|
`Open with ${lead}; ${structure}; ${evidence}.${a.signature === 'yes' ? ' Sign note edits: one Last edited by line, overwritten.' : ''}`,
|
|
425
425
|
a.never.length ? `Never: ${a.never.map(md).join('; ')}.` : null,
|
package/render/render.cjs
CHANGED
|
@@ -412,7 +412,7 @@ function renderTarget(key, target, profile, rules, cfg, root, learned, boilerpla
|
|
|
412
412
|
lines.push('### Box 1: Profile ("More about you" / "What would you like ChatGPT to know about you?")', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box1.txt`, the same text as a plain file)._', '', f1, box1, f1, warn('Box 1', box1), '');
|
|
413
413
|
lines.push('### Box 2: Response instructions ("Custom instructions" / "How would you like ChatGPT to respond?")', '', '_Copy only the text inside the fence below (or paste the whole of `chatgpt-box2.txt`)._', '', f2, box2, f2, warn('Box 2', box2));
|
|
414
414
|
if (!answers) lines.push('', '> No onboarding answers in `.agent-personalizer.json`, so this is the full profile and every rule. Run the installer for the compact, budgeted form.');
|
|
415
|
-
else lines.push('', `>
|
|
415
|
+
else lines.push('', `> Account-level Custom Instructions do not read your local project folder directly (file access in ChatGPT depends on the surface, uploads and enabled tools), so only the rules marked \`inject: true\` are included here (${picked.length}). Free and Go plans allow up to 1,500 characters in Custom Instructions; Plus, Pro, Business, Enterprise and Edu plans allow up to 5,000 characters (check the limits and field names shown in Settings → Personalization, or Customize ChatGPT on mobile). The remaining rules live in \`rules/\`; for a ChatGPT Project, upload \`AGENT_ONBOARDING.md\`, \`LEARNED.md\` and \`rules/\` as project files.`);
|
|
416
416
|
renderTarget.overBudget = (renderTarget.overBudget || []).concat(over.map(l => `${target.file}: ${l}`));
|
|
417
417
|
return lines.join('\n');
|
|
418
418
|
}
|