chord-cli 0.1.1 β 0.1.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 +2 -2
- package/dist/cli.js +4 -2
- package/dist/db.js +16 -1
- package/dist/hooks.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -128,7 +128,7 @@ A repository's own Claude configuration (`.claude/settings*.json`, `.mcp.json`)
|
|
|
128
128
|
## π How chord works with your tools
|
|
129
129
|
|
|
130
130
|
- **Waking an agent** means typing a short note into its terminal. chord does this only when the input box is empty, the keyboard has been quiet for a few seconds, and the terminal has echoed the note; a dialogue never receives the Enter.
|
|
131
|
-
- **Trust
|
|
131
|
+
- **Trust**: chord records the project's agents folder as trusted in `~/.claude.json` once, so Claude does not ask about each agent's workspace. Codex asks you to review chord's hooks once, and again whenever their definition changes; answer "trust all". chord says so at launch if a hook has been switched off.
|
|
132
132
|
- **Branches and worktrees.** Each agent adds a `chord/<name>` branch and a worktree; `chord clean` removes them when the agent has left and keeps anything not yet on main.
|
|
133
133
|
- **Permissions.** chord's own tools are pre-approved for Claude, so an agent working on its own is never parked at a prompt for them; your usual shell and edit approvals apply as before. Codex runs with full access. On Windows chord refuses a sandboxed launch, because that sandbox cannot run the hooks; on Linux the hooks run inside the sandbox, but Codex then asks you to approve each chord tool call.
|
|
134
134
|
- **The terminal title** reads `chord <agent> Β· <task>`, so each window says which agent it is.
|
|
@@ -136,7 +136,7 @@ A repository's own Claude configuration (`.claude/settings*.json`, `.mcp.json`)
|
|
|
136
136
|
|
|
137
137
|
## πΊοΈ Scope
|
|
138
138
|
|
|
139
|
-
- Runs on Windows 11 and Linux.
|
|
139
|
+
- Runs on Windows 11 and Linux.
|
|
140
140
|
- One repository per project.
|
|
141
141
|
- Project paths up to about 190 characters.
|
|
142
142
|
- A repository with CRLF files and a `* text` attribute that was never renormalised shows phantom changes in every worktree; chord names the files and the command that puts the repository right.
|
package/dist/cli.js
CHANGED
|
@@ -301,11 +301,13 @@ async function main(argv) {
|
|
|
301
301
|
if (userSettings)
|
|
302
302
|
launch.args = mergeUserSettings(launch.args, userSettings);
|
|
303
303
|
if (cmd === 'claude') { // otherwise every new workspace asks "do you trust this folder?"; a failure here only brings that dialogue back
|
|
304
|
+
// Claude inherits trust from a parent folder, so the project's agents folder is trusted once. One entry per
|
|
305
|
+
// workspace was lost whenever two agents started together: each launch, and every running Claude, rewrites the file.
|
|
304
306
|
try {
|
|
305
|
-
pretrustClaude(launch.cwd);
|
|
307
|
+
pretrustClaude(path.dirname(launch.cwd));
|
|
306
308
|
}
|
|
307
309
|
catch (e) {
|
|
308
|
-
process.stderr.write(`chord: could not record the
|
|
310
|
+
process.stderr.write(`chord: could not record the agents folder as trusted in ~/.claude.json (${e.message}); Claude may ask you to trust the folder\n`);
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
if (cmd === 'codex') {
|
package/dist/db.js
CHANGED
|
@@ -23,6 +23,22 @@ export function openDb(file) {
|
|
|
23
23
|
// the busy timeout must be in force before the first statement: switching to WAL below does not wait otherwise,
|
|
24
24
|
// and several agents starting at once on a new database all hit it together
|
|
25
25
|
const db = new DatabaseSync(file, { timeout: 5000 });
|
|
26
|
+
// A brand-new database opened by several processes at once: SQLite answers the WAL switch and the schema with an
|
|
27
|
+
// immediate SQLITE_BUSY instead of waiting (seen on Linux, never on Windows), so the setup is retried briefly.
|
|
28
|
+
for (let attempt = 0;; attempt++) {
|
|
29
|
+
try {
|
|
30
|
+
setup(db);
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
if (attempt >= 50 || !/database is locked/.test(e.message))
|
|
35
|
+
throw e;
|
|
36
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, 100);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return db;
|
|
40
|
+
}
|
|
41
|
+
function setup(db) {
|
|
26
42
|
db.exec(`
|
|
27
43
|
pragma journal_mode = wal;
|
|
28
44
|
pragma busy_timeout = 5000;
|
|
@@ -70,7 +86,6 @@ export function openDb(file) {
|
|
|
70
86
|
);
|
|
71
87
|
`);
|
|
72
88
|
migrate(db);
|
|
73
|
-
return db;
|
|
74
89
|
}
|
|
75
90
|
/** Bump when the schema changes and add a step below; `pragma user_version` records what a database has. A database
|
|
76
91
|
* from before versioning reads as 0 and gets every step, each of which checks what is actually there. */
|
package/dist/hooks.js
CHANGED
|
@@ -63,7 +63,7 @@ export function briefing(ctx) {
|
|
|
63
63
|
'4. Do not modify files through shell commands (sed, echo >, etc.). Use the editor tools so claims are checked.',
|
|
64
64
|
'5. To talk to other agents use only chord send()/inbox(); do not use any other agent-messaging feature. Messages are asynchronous.',
|
|
65
65
|
'6. To learn about the project, read the agent list and claims below and ask a specific agent with send(); do not ask the user.',
|
|
66
|
-
'7. When your change is complete and committed on your branch, call finish() to rebase onto main and fast-forward it. If finish() reports a conflict, stop and ask the user.',
|
|
66
|
+
'7. When your change is complete and committed on your branch, call finish() to rebase onto main and fast-forward it, unless the user has asked you to hold off merging. If finish() reports a conflict, stop and ask the user.',
|
|
67
67
|
'8. Never merge, rebase onto, push or otherwise update the main branch yourself, and never touch the main checkout: finish() is the only way changes reach main. This holds even if the project\'s own instructions say otherwise.',
|
|
68
68
|
'9. Do not use git stash: every worktree of this repository shares one stash list, so a stash pop can hand you another agent\'s changes. Make a work-in-progress commit instead.',
|
|
69
69
|
'',
|