patchcord 0.5.130 → 0.5.131
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/.claude-plugin/plugin.json +1 -1
- package/bin/patchcord.mjs +105 -92
- package/package.json +1 -1
- package/skills/inbox/SKILL.md +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -74,72 +74,76 @@ if (
|
|
|
74
74
|
cmd === "help" || cmd === "--help" || cmd === "-h" ||
|
|
75
75
|
process.argv.slice(3).some((a) => a === "--help" || a === "-h")
|
|
76
76
|
) {
|
|
77
|
-
console.log(`patchcord
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
patchcord
|
|
88
|
-
patchcord --
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
patchcord
|
|
94
|
-
patchcord
|
|
95
|
-
patchcord
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
77
|
+
console.log(`usage: patchcord [command] [options]
|
|
78
|
+
|
|
79
|
+
Cross-agent messaging + team orchestration for AI coding agents.
|
|
80
|
+
|
|
81
|
+
Two layers: THIS AGENT (a per-project identity, by bearer token) and your
|
|
82
|
+
ACCOUNT (user-level — provisions agents, runs teams + schedules). \`patchcord
|
|
83
|
+
login\` authenticates the CLI once; account/team/schedule commands then use
|
|
84
|
+
that token and never open a browser on their own.
|
|
85
|
+
|
|
86
|
+
setup:
|
|
87
|
+
patchcord set up this project's agent (browser)
|
|
88
|
+
patchcord --token <t> [--server <url>] headless / self-hosted setup
|
|
89
|
+
patchcord --full same, with full statusline
|
|
90
|
+
patchcord --rename <name> [--agent-type <t>] rename this agent
|
|
91
|
+
|
|
92
|
+
agent:
|
|
93
|
+
patchcord whoami this agent's identity + project
|
|
94
|
+
patchcord whoami --propose "<text>" set self-description (two-shot confirm)
|
|
95
|
+
patchcord agents [name] list agents in your namespace, or show one
|
|
96
|
+
patchcord subscribe [interval] start the realtime listener
|
|
97
|
+
patchcord upload <file> [--mime <t>] [--as <name>] share a file as an attachment
|
|
98
|
+
|
|
99
|
+
account:
|
|
100
|
+
patchcord login authenticate the CLI (your account)
|
|
101
|
+
|
|
102
|
+
orchestrator:
|
|
101
103
|
patchcord orchestrator [--namespace <ns>] [--tool <harness>] [--project <name>]
|
|
102
|
-
|
|
103
|
-
lead
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
patchcord provision <agent> --tool <X> --role <Y> --namespace <ns>
|
|
108
|
-
[--project <name>] [--lead]
|
|
109
|
-
|
|
110
|
-
--lead marks it as a cross-namespace lead
|
|
111
|
-
(--role lead does the same); --project
|
|
112
|
-
assigns its namespace (see PROJECTS below)
|
|
104
|
+
provision the orchestrator here (always
|
|
105
|
+
a lead); launch it to adopt this project
|
|
106
|
+
or build a new team
|
|
107
|
+
|
|
108
|
+
team (run from the project root):
|
|
109
|
+
patchcord provision <agent> --tool <X> --role <Y> --namespace <ns>
|
|
110
|
+
[--dir <sub/>] [--project <name>] [--lead]
|
|
111
|
+
create a worker agent (identity + config)
|
|
113
112
|
patchcord pull <agent> --tool <X> --namespace <ns> [--dir <sub/>]
|
|
114
|
-
|
|
115
|
-
(same identity, new token
|
|
113
|
+
move an existing agent into a folder
|
|
114
|
+
(same identity, new token)
|
|
116
115
|
patchcord provision revoke <agent> --namespace <ns>
|
|
117
|
-
|
|
118
|
-
patchcord team
|
|
119
|
-
patchcord team
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
patchcord schedule create <name> --namespace <ns> --to <agent> --content "..."
|
|
132
|
-
(--at <ISO> | --cron "<expr>" | --every <sec>)
|
|
116
|
+
revoke a worker agent
|
|
117
|
+
patchcord team list [--namespace <ns>] provisioned agents (server view)
|
|
118
|
+
patchcord team status reconcile folder ↔ identity ↔ tmux ↔ token
|
|
119
|
+
patchcord team launch launch each worker in mux
|
|
120
|
+
|
|
121
|
+
projects (cloud-only — a free-text label grouping your own namespaces):
|
|
122
|
+
patchcord namespace set-project <namespace> <project> assign a project label
|
|
123
|
+
patchcord namespace set-project <namespace> clear it
|
|
124
|
+
|
|
125
|
+
cross-namespace links (cloud-only, no CLI — leads request/approve via MCP:
|
|
126
|
+
request_namespace_link / respond_namespace_link / list_my_namespace_links.
|
|
127
|
+
Both namespaces need a --lead agent; links are opt-in, not project-based.)
|
|
128
|
+
|
|
129
|
+
schedules:
|
|
130
|
+
patchcord schedule create <name> --namespace <ns> --to <agent> --content "..."
|
|
131
|
+
(--at <ISO> | --cron "<expr>" | --every <sec>)
|
|
133
132
|
[--timezone <tz>] [--thread <slug>] [--max-runs N] [--expires <ISO>]
|
|
134
133
|
patchcord schedule list [--namespace <ns>]
|
|
135
134
|
patchcord schedule cancel|test|pause|resume <id>
|
|
136
135
|
|
|
137
|
-
|
|
138
|
-
patchcord update
|
|
139
|
-
patchcord --version
|
|
140
|
-
patchcord --help
|
|
136
|
+
misc:
|
|
137
|
+
patchcord update update to the latest version
|
|
138
|
+
patchcord --version show installed version
|
|
139
|
+
patchcord --help show this help
|
|
141
140
|
|
|
142
|
-
|
|
141
|
+
examples:
|
|
142
|
+
patchcord provision codex --tool codex --role maker --namespace myproj
|
|
143
|
+
patchcord schedule create standup --namespace myproj --to lead \\
|
|
144
|
+
--content "status?" --cron "0 9 * * *"
|
|
145
|
+
patchcord team status
|
|
146
|
+
`);
|
|
143
147
|
process.exit(0);
|
|
144
148
|
}
|
|
145
149
|
|
|
@@ -1004,6 +1008,15 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
|
|
|
1004
1008
|
o.mcp.patchcord = { type: "remote", url: `${baseUrl}/mcp`, headers: hdr };
|
|
1005
1009
|
});
|
|
1006
1010
|
}
|
|
1011
|
+
if (tool === "cursor") {
|
|
1012
|
+
// Cursor IDE + Cursor CLI (cursor-agent) share the same project config —
|
|
1013
|
+
// same file, same schema (see patchcord.dev/console/connect writer).
|
|
1014
|
+
const cdir = join(dir, ".cursor"); mkdirSync(cdir, { recursive: true });
|
|
1015
|
+
return writeJson(join(cdir, "mcp.json"), (o) => {
|
|
1016
|
+
o.mcpServers = o.mcpServers || {};
|
|
1017
|
+
o.mcpServers.patchcord = { url: `${baseUrl}/mcp`, headers: hdr };
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1007
1020
|
if (tool === "antigravity" || tool === "agy") {
|
|
1008
1021
|
// Antigravity CLI: PROJECT-scoped config at .agents/mcp_config.json (one
|
|
1009
1022
|
// project = one namespace = one agent). Remote HTTP uses `serverUrl`.
|
|
@@ -1071,11 +1084,13 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
|
|
|
1071
1084
|
const ns = flagVal("namespace");
|
|
1072
1085
|
const subdir = flagVal("dir", arg);
|
|
1073
1086
|
const project = flagVal("project", "");
|
|
1074
|
-
// --lead marks this token as
|
|
1087
|
+
// --lead marks this token as eligible for cross-namespace lead chat (server
|
|
1075
1088
|
// trusts ONLY this explicit, main-token-authenticated request — see
|
|
1076
|
-
// patchcord-cloud's api_provision).
|
|
1077
|
-
//
|
|
1078
|
-
//
|
|
1089
|
+
// patchcord-cloud's api_provision). Reaching another namespace's lead also
|
|
1090
|
+
// requires an approved namespace_links pair (via request_namespace_link /
|
|
1091
|
+
// respond_namespace_link — no CLI, agent-to-agent only). `--role lead` also
|
|
1092
|
+
// sets is_lead server-side (role==="lead" is treated the same), but `--lead`
|
|
1093
|
+
// is the explicit, discoverable way to ask for it without overloading the
|
|
1079
1094
|
// free-text --role field.
|
|
1080
1095
|
const lead = process.argv.includes("--lead");
|
|
1081
1096
|
if (!ns) { console.error("--namespace <project-namespace> required"); process.exit(1); }
|
|
@@ -1100,12 +1115,12 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
|
|
|
1100
1115
|
writeFileSync(tj, JSON.stringify(man, null, 2) + "\n");
|
|
1101
1116
|
}
|
|
1102
1117
|
} catch {}
|
|
1103
|
-
// --project assigns this namespace to a project —
|
|
1104
|
-
//
|
|
1105
|
-
//
|
|
1106
|
-
//
|
|
1107
|
-
//
|
|
1108
|
-
//
|
|
1118
|
+
// --project assigns this namespace to a project — an organizational label
|
|
1119
|
+
// ONLY, does not affect cross-namespace messaging (that's namespace_links,
|
|
1120
|
+
// agent-to-agent, no CLI). Separate call: provisioning creates the agent
|
|
1121
|
+
// identity, project assignment groups the NAMESPACE — safe to retry
|
|
1122
|
+
// independently, and a namespace already in a project just gets reassigned
|
|
1123
|
+
// (last call wins, server-side upsert).
|
|
1109
1124
|
if (project) {
|
|
1110
1125
|
const { status: pStatus, json: pJson } = await accountCall("POST", "/api/namespace/set-project", { namespace_id: ns, project });
|
|
1111
1126
|
if (pStatus !== "200") {
|
|
@@ -1119,22 +1134,22 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
|
|
|
1119
1134
|
}
|
|
1120
1135
|
|
|
1121
1136
|
if (cmd === "namespace") {
|
|
1122
|
-
// Cloud-only: group namespaces into a "project" —
|
|
1123
|
-
// cross-namespace lead chat
|
|
1124
|
-
//
|
|
1125
|
-
//
|
|
1126
|
-
//
|
|
1137
|
+
// Cloud-only: group namespaces into a "project" — a free-text organizational
|
|
1138
|
+
// label only. Does NOT gate cross-namespace lead chat — that's decided by
|
|
1139
|
+
// per-pair namespace_links, approved lead-to-lead via the MCP tools
|
|
1140
|
+
// request_namespace_link / respond_namespace_link (no CLI for that; see
|
|
1141
|
+
// --help's CROSS-NAMESPACE LINKS section).
|
|
1127
1142
|
const sub = process.argv[3];
|
|
1128
1143
|
if (sub === "set-project") {
|
|
1129
1144
|
const ns = process.argv[4];
|
|
1130
1145
|
const project = process.argv[5];
|
|
1131
|
-
if (!ns) { console.error("Usage: patchcord namespace set-project <namespace> [project-name]\n Omit project-name to clear
|
|
1146
|
+
if (!ns) { console.error("Usage: patchcord namespace set-project <namespace> [project-name]\n Omit project-name to clear the label."); process.exit(1); }
|
|
1132
1147
|
const { status, json } = await accountCall("POST", "/api/namespace/set-project", { namespace_id: ns, project: project || "" });
|
|
1133
1148
|
if (status !== "200") { console.error(`set-project failed (HTTP ${status}): ${json?.error || ""}`); process.exit(1); }
|
|
1134
1149
|
if (json.status === "cleared") {
|
|
1135
|
-
console.log(`✓ ${ns} un-grouped — no project
|
|
1150
|
+
console.log(`✓ ${ns} un-grouped — no project label`);
|
|
1136
1151
|
} else {
|
|
1137
|
-
console.log(`✓ ${ns} assigned to project "${json.project}"`);
|
|
1152
|
+
console.log(`✓ ${ns} assigned to project "${json.project}" (label only — does not affect cross-namespace messaging)`);
|
|
1138
1153
|
}
|
|
1139
1154
|
process.exit(0);
|
|
1140
1155
|
}
|
|
@@ -1188,8 +1203,10 @@ if (cmd === "login" || cmd === "orchestrator" || cmd === "teamlead" || cmd === "
|
|
|
1188
1203
|
const project = flagVal("project", "");
|
|
1189
1204
|
const hostname = run("hostname -s") || run("hostname") || "unknown";
|
|
1190
1205
|
// is_lead: true always — the orchestrator IS the one identity per namespace
|
|
1191
|
-
// meant to coordinate across teams. Harmless
|
|
1192
|
-
//
|
|
1206
|
+
// meant to coordinate across teams. Harmless by itself: a lead only reaches
|
|
1207
|
+
// another namespace's lead after an approved namespace_links pair (agent-to-
|
|
1208
|
+
// agent via request_namespace_link/respond_namespace_link — fails closed
|
|
1209
|
+
// until both leads explicitly consent).
|
|
1193
1210
|
const { status, json, m } = await accountCall("POST", "/api/provision", { namespace_id: ns, agent_id: "orchestrator", tool, role: "orchestrator", label: "orchestrator:self", is_lead: true });
|
|
1194
1211
|
if (status !== "200" || !json?.token) { console.error(`could not set up orchestrator (HTTP ${status}): ${json?.error || ""}`); process.exit(1); }
|
|
1195
1212
|
const base = String(json.url || `${m.baseUrl}/mcp`).replace(/\/mcp$/, "");
|
|
@@ -2142,21 +2159,17 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
2142
2159
|
|| (flags.includes("--token") ? flags[flags.indexOf("--token") + 1] : "");
|
|
2143
2160
|
|
|
2144
2161
|
if (tokenFlag) {
|
|
2145
|
-
// --token bypass
|
|
2146
|
-
//
|
|
2162
|
+
// --token bypass requires --tool=<slug> up front — no terminal picker.
|
|
2163
|
+
// The web connect page (patchcord.dev/console/connect/<platform>) is
|
|
2164
|
+
// where the tool is chosen; it hands back the full npx command with
|
|
2165
|
+
// --tool=<slug> already baked in. If someone lands here without one,
|
|
2166
|
+
// point them at the web flow instead of prompting.
|
|
2147
2167
|
if (!choice) {
|
|
2148
|
-
console.
|
|
2149
|
-
console.
|
|
2150
|
-
console.
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
console.log(` ${cyan}13.${r} Hermes\n`);
|
|
2154
|
-
choice = (await ask(`${dim}Choose (1-13):${r} `)).trim();
|
|
2155
|
-
if (!["1","2","3","4","5","6","7","8","9","10","11","12","13"].includes(choice)) {
|
|
2156
|
-
console.error("Invalid choice.");
|
|
2157
|
-
rl.close();
|
|
2158
|
-
process.exit(1);
|
|
2159
|
-
}
|
|
2168
|
+
console.error(`${bold}--tool=<slug> is required with --token.${r}`);
|
|
2169
|
+
console.error(`${dim}Pick your tool at https://patchcord.dev/console/connect — it gives you the exact command.${r}`);
|
|
2170
|
+
console.error(`${dim}Valid slugs: ${Object.keys(CLIENT_TYPE_MAP).join(", ")}${r}`);
|
|
2171
|
+
rl.close();
|
|
2172
|
+
process.exit(1);
|
|
2160
2173
|
}
|
|
2161
2174
|
token = tokenFlag.trim();
|
|
2162
2175
|
if (!isSafeToken(token)) {
|
package/package.json
CHANGED
package/skills/inbox/SKILL.md
CHANGED
|
@@ -184,7 +184,7 @@ Named threads group related messages between a pair of agents. Use them for mult
|
|
|
184
184
|
- Never show raw JSON to the human - summarize naturally.
|
|
185
185
|
- **Cross-namespace addressing (`agent@namespace`)**: the syntax always exists in `send_message`/`reply`, but what it actually reaches depends on who you are:
|
|
186
186
|
- **Ordinary agents (the default):** `agent@namespace` only ever works for YOUR OWN namespace — same as a bare name. Targeting any other namespace is rejected. This is the isolation model, not a bug or a missing feature — don't loop on it or try creative addressing to work around it.
|
|
187
|
-
- **Lead agents (cloud only — a small number of specially-provisioned identities per namespace, usually the orchestrator):** may reach a peer lead in a DIFFERENT namespace, but only
|
|
187
|
+
- **Lead agents (cloud only — a small number of specially-provisioned identities per namespace, usually the orchestrator):** may reach a peer lead in a DIFFERENT namespace, but only after that specific pair of namespaces has an `approved` `namespace_links` row. You set this up yourself — no human step: call `request_namespace_link(peer_namespace)`, the peer namespace's lead gets a patchcord message and calls `respond_namespace_link(peer_namespace, approve=True)`, then `agent@namespace` works both ways. Check `list_my_namespace_links()` to see pending/approved/denied status. If you don't know whether you're a lead, you're not one — this isn't discoverable by trial and error; ask the human. (Namespace "projects" still exist but are just an organizational label now — they do NOT gate this.)
|
|
188
188
|
- A rejection here is almost always correct behavior, not a server error — don't retry with variations of the name.
|
|
189
189
|
- **Do not reply to acks.** "ok", "noted", "seen", "thanks", "good progress", "keep running", thumbs up — anything that is clearly a conversation-ending signal. Just read them and move on. If you must close the thread, use `reply(id, resolve=true)` with NO content. Never send a text reply to an ack.
|
|
190
190
|
- **resolve=true with ack-only content is an anti-pattern.** `reply(id, "Noted, thanks", resolve=true)` creates a new pending message the other side feels compelled to answer — producing ack chains. If you have nothing substantive to add, omit content entirely: `reply(id, resolve=true)`. Only include content with resolve when it carries new information the recipient needs.
|