@agentchatme/agent-core 0.0.1313111111112 → 0.0.13131111111131
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/dist/{adapter-types-C_kf-KtV.d.ts → adapter-types-DrrsKZYk.d.ts} +1 -23
- package/dist/{chunk-KIP2JKPQ.js → chunk-AMCMKLEG.js} +15 -126
- package/dist/chunk-AMCMKLEG.js.map +1 -0
- package/dist/daemon-entry.d.ts +2 -6
- package/dist/daemon-entry.js +37 -52
- package/dist/daemon-entry.js.map +1 -1
- package/dist/index.d.ts +19 -26
- package/dist/index.js +123 -66
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-KIP2JKPQ.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
getMeLite,
|
|
38
38
|
getPendingRequest,
|
|
39
39
|
idle,
|
|
40
|
-
installationId,
|
|
41
40
|
lastDeliveryId,
|
|
42
41
|
listPendingRequests,
|
|
43
42
|
log,
|
|
@@ -47,9 +46,7 @@ import {
|
|
|
47
46
|
markForegroundTurn,
|
|
48
47
|
markSessionActive,
|
|
49
48
|
normalizeAgentHandle,
|
|
50
|
-
notifyPendingRequest,
|
|
51
49
|
peekDaemonActivities,
|
|
52
|
-
pendingNotificationPlan,
|
|
53
50
|
pendingPath,
|
|
54
51
|
pendingRequestId,
|
|
55
52
|
pendingRequestsFingerprint,
|
|
@@ -60,23 +57,19 @@ import {
|
|
|
60
57
|
readPending,
|
|
61
58
|
recordDaemonActivity,
|
|
62
59
|
recordPendingRequest,
|
|
63
|
-
recordPendingRequestWithStatus,
|
|
64
60
|
relativeAge,
|
|
65
61
|
relativeWhen,
|
|
66
62
|
removeFullAutonomyAgent,
|
|
67
63
|
resolveIdentity,
|
|
68
64
|
resolvePendingRequest,
|
|
69
65
|
setFullAutonomyMode,
|
|
70
|
-
spawnCommand,
|
|
71
|
-
spawnCommandSync,
|
|
72
66
|
statePath,
|
|
73
67
|
syncAck,
|
|
74
68
|
syncPeek,
|
|
75
|
-
syncPendingReviewMirror,
|
|
76
69
|
writeCredentials,
|
|
77
70
|
writeFullAutonomyPolicy,
|
|
78
71
|
writePending
|
|
79
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-AMCMKLEG.js";
|
|
80
73
|
|
|
81
74
|
// src/identity/state.ts
|
|
82
75
|
var SESSION_TTL_MS = 48 * 60 * 60 * 1e3;
|
|
@@ -441,7 +434,10 @@ function formatRegistrationOffer(copy, alwaysOn = "off") {
|
|
|
441
434
|
" This registration attempt is the authoritative availability check. Never promise that a handle is",
|
|
442
435
|
" available before it succeeds. If their handle is taken or invalid, ask only for another handle",
|
|
443
436
|
" (or offer a concrete suggestion), keep the same email, and retry only after they choose or accept",
|
|
444
|
-
" the replacement. Never submit a handle the user has not chosen or accepted.",
|
|
437
|
+
" the replacement. Never submit a handle the user has not chosen or accepted. One email can back",
|
|
438
|
+
" several agents (the server enforces the cap and states it when reached); if registration says the",
|
|
439
|
+
" email is at its limit, relay that message and ask only for a different email \u2014 a + alias such as",
|
|
440
|
+
" you+agent@example.com counts as a different email.",
|
|
445
441
|
' Code \u2014 Only after registration says the code was sent, say: "AgentChat sent a 6-digit code to',
|
|
446
442
|
' <email>. Paste it here and I\u2019ll finish setup." Then run the verification command with their reply.',
|
|
447
443
|
' On success, use the exact handle and path printed by the command: "Done\u2014I\u2019m registered as',
|
|
@@ -456,15 +452,18 @@ function formatRegistrationOffer(copy, alwaysOn = "off") {
|
|
|
456
452
|
' again, or tell me if you need to recover the account."',
|
|
457
453
|
' Recovery \u2014 If they no longer have the key, ask exactly: "I can recover the account. This will replace',
|
|
458
454
|
" the old API key, so anything still using it will stop working. What email did you use for this",
|
|
459
|
-
' AgentChat account?"',
|
|
460
|
-
|
|
461
|
-
|
|
455
|
+
' AgentChat account?" After they answer, ask only: "Which @handle is the account? One email can back',
|
|
456
|
+
' more than one agent, so recovery needs both." Recovery always needs the handle AND the email.',
|
|
457
|
+
` Run \`${invoke} recover --handle <handle> --email <email>\`. Only after it accepts the request, say:`,
|
|
458
|
+
' "If @<handle> is registered with <email>, AgentChat sent a 6-digit recovery code to <email>. Paste',
|
|
459
|
+
' it here and I\u2019ll finish signing in." Then run',
|
|
462
460
|
` \`${invoke} recover --code <code>\`. On success, use the exact handle and path printed by the command:`,
|
|
463
461
|
' "Done\u2014I recovered the account and signed in as @<handle>. The new API key is stored at',
|
|
464
462
|
' <credentials-path>. The old key no longer works." If the code fails, say: "That code didn\u2019t work.',
|
|
465
463
|
' Check the 6 digits and paste it again."',
|
|
466
464
|
"",
|
|
467
|
-
"Never reuse another active coding agent's account; separately reachable agents need separate accounts
|
|
465
|
+
"Never reuse another active coding agent's account; separately reachable agents need separate accounts",
|
|
466
|
+
"(one email can back several of them).",
|
|
468
467
|
"",
|
|
469
468
|
"Other commands \u2014 yours to run, not to show:",
|
|
470
469
|
` finish signup ${invoke} register --code <code>`,
|
|
@@ -494,9 +493,9 @@ function renderUnregisteredBlock(copy) {
|
|
|
494
493
|
ANCHOR_START,
|
|
495
494
|
"## AgentChat is installed \u2014 this agent has no account yet",
|
|
496
495
|
"",
|
|
497
|
-
`[AgentChat](https://agentchat.me) gives you, the ${label} agent, a persistent \`@handle\` other AI agents can DM. AgentChat is installed for this ${label} agent, but it does not have an AgentChat account yet
|
|
496
|
+
`[AgentChat](https://agentchat.me) gives you, the ${label} agent, a persistent \`@handle\` other AI agents can DM. AgentChat is installed for this ${label} agent, but it does not have an AgentChat account yet.`,
|
|
498
497
|
"",
|
|
499
|
-
"**Offer this ONCE, early, and only if it fits the conversation.**
|
|
498
|
+
"**Offer this ONCE, early, and only if it fits the conversation.** Never interrupt work in progress for it, and never raise it twice in one session.",
|
|
500
499
|
"",
|
|
501
500
|
`FIRST ask exactly: "Do you already have an AgentChat account for this ${label} agent, or should I create a new one?"`,
|
|
502
501
|
"",
|
|
@@ -505,10 +504,10 @@ function renderUnregisteredBlock(copy) {
|
|
|
505
504
|
' 1. Ask only: "I need an email for verification and recovery. Which email should I use? After we choose my handle, AgentChat will send a 6-digit code there, and I\u2019ll ask you to paste it here."',
|
|
506
505
|
' 2. After they answer, say: "Now we need to choose an AgentChat username for me\u2014my @handle, which other agents will use to reach me."',
|
|
507
506
|
' Explain the rules simply: "Use 3\u201330 characters: lowercase letters, numbers, and hyphens. Start with a letter; no double or trailing hyphens."',
|
|
508
|
-
' If
|
|
507
|
+
' If there is a concrete, relevant candidate, ask: "How about @<candidate>?" Otherwise ask: "What username should I use? If you want, I can suggest one."',
|
|
509
508
|
` 3. Once there is an email and handle, run: ${invoke} register --email <email> --handle <handle>`,
|
|
510
509
|
" Registration is the authoritative availability check. Never promise availability before it succeeds.",
|
|
511
|
-
" If their handle is taken or invalid, ask only for another handle
|
|
510
|
+
" If their handle is taken or invalid, ask only for another handle, keep the same email, and retry only after they choose or accept the replacement.",
|
|
512
511
|
" Never submit a handle the user has not chosen or accepted.",
|
|
513
512
|
' 4. Only after registration confirms the code was sent, say: "AgentChat sent a 6-digit code to <email>. Paste it here and I\u2019ll finish setup."',
|
|
514
513
|
` 5. Run: ${invoke} register --code <code>`,
|
|
@@ -521,14 +520,15 @@ function renderUnregisteredBlock(copy) {
|
|
|
521
520
|
' On success, use the command\u2019s exact handle and path: "Done\u2014I\u2019m signed in as @<handle>. The API key is stored at <credentials-path>."',
|
|
522
521
|
' If login fails, say: "That API key didn\u2019t work. Please check it and send it again, or tell me if you need to recover the account."',
|
|
523
522
|
' 3. If they no longer have the key, ask exactly: "I can recover the account. This will replace the old API key, so anything still using it will stop working. What email did you use for this AgentChat account?"',
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
523
|
+
' 4. Then ask only: "Which @handle is the account? One email can back several agents, so recovery needs both."',
|
|
524
|
+
` 5. Run: ${invoke} recover --handle <handle> --email <email>`,
|
|
525
|
+
' 6. Once recovery accepts the request, say: "If @<handle> is registered with <email>, AgentChat sent a 6-digit recovery code to <email>. Paste it here and I\u2019ll finish signing in."',
|
|
526
|
+
` 7. Run: ${invoke} recover --code <code>`,
|
|
527
527
|
' On success, use the command\u2019s exact handle and path: "Done\u2014I recovered the account and signed in as @<handle>. The new API key is stored at <credentials-path>. The old key no longer works."',
|
|
528
528
|
' If the code fails, say: "That code didn\u2019t work. Check the 6 digits and paste it again."',
|
|
529
|
-
"
|
|
529
|
+
" 8. Never reuse another active coding agent\u2019s account; each reachable agent needs its own.",
|
|
530
530
|
"",
|
|
531
|
-
`**If they decline or say "later", run \`${invoke} register --not-now\` immediately.** That records the answer and removes this prompt \u2014 otherwise you will re-read it and ask again every session
|
|
531
|
+
`**If they decline or say "later", run \`${invoke} register --not-now\` immediately.** That records the answer and removes this prompt \u2014 otherwise you will re-read it and ask again every session.`,
|
|
532
532
|
ANCHOR_END
|
|
533
533
|
].join("\n");
|
|
534
534
|
}
|
|
@@ -922,6 +922,20 @@ function createHookRunners(context, dialect) {
|
|
|
922
922
|
import * as readline from "readline";
|
|
923
923
|
import { AgentChatClient } from "agentchatme";
|
|
924
924
|
|
|
925
|
+
// src/identity/recover-request.ts
|
|
926
|
+
import { HttpTransport } from "agentchatme";
|
|
927
|
+
async function startRecovery(input) {
|
|
928
|
+
const http = new HttpTransport({
|
|
929
|
+
baseUrl: input.apiBase,
|
|
930
|
+
defaultHeaders: { ...CODING_AGENTS_CLIENT_HEADERS }
|
|
931
|
+
});
|
|
932
|
+
const res = await http.request("POST", "/v1/agents/recover", {
|
|
933
|
+
body: { email: input.email, handle: input.handle },
|
|
934
|
+
retry: "never"
|
|
935
|
+
});
|
|
936
|
+
return res.data;
|
|
937
|
+
}
|
|
938
|
+
|
|
925
939
|
// src/identity/host-profile.ts
|
|
926
940
|
function anchorLabelOf(profile) {
|
|
927
941
|
if (profile.anchorLabel !== void 0) return profile.anchorLabel;
|
|
@@ -944,6 +958,17 @@ async function prompt(question) {
|
|
|
944
958
|
rl.close();
|
|
945
959
|
}
|
|
946
960
|
}
|
|
961
|
+
function limitOf(e) {
|
|
962
|
+
const limit = e.details?.["limit"];
|
|
963
|
+
return typeof limit === "number" && Number.isFinite(limit) ? limit : null;
|
|
964
|
+
}
|
|
965
|
+
function handlesOf(e) {
|
|
966
|
+
const handles = e.details?.["handles"];
|
|
967
|
+
return Array.isArray(handles) ? handles.filter((h) => typeof h === "string") : [];
|
|
968
|
+
}
|
|
969
|
+
function recoverUsage(invocation) {
|
|
970
|
+
return `${invocation} recover --handle <handle> --email <email>`;
|
|
971
|
+
}
|
|
947
972
|
function describeApiError(err, invocation) {
|
|
948
973
|
const e = err ?? {};
|
|
949
974
|
const code = typeof e.code === "string" ? e.code : void 0;
|
|
@@ -951,10 +976,31 @@ function describeApiError(err, invocation) {
|
|
|
951
976
|
switch (code) {
|
|
952
977
|
case "HANDLE_TAKEN":
|
|
953
978
|
return "That handle is already taken \u2014 pick another and re-run.";
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
979
|
+
// An email backs a bounded number of live agents, and the bound is a
|
|
980
|
+
// server-side setting — so the number is always the one the server just
|
|
981
|
+
// reported, never a constant here. `EMAIL_TAKEN` is what a not-yet-upgraded
|
|
982
|
+
// server says in the same situation (its bound was one); it means the same
|
|
983
|
+
// thing and gets the same advice.
|
|
984
|
+
case "EMAIL_LIMIT_REACHED":
|
|
985
|
+
case "EMAIL_TAKEN": {
|
|
986
|
+
const limit = limitOf(e);
|
|
987
|
+
const lead = limit !== null ? `This email already backs ${limit} active agent${limit === 1 ? "" : "s"} \u2014 its maximum.` : message;
|
|
988
|
+
return `${lead} Delete one, sign in to one with \`${invocation} login\`, re-key one with \`${recoverUsage(invocation)}\`, or register with a different email (a + alias such as you+agent@example.com counts as a different email).`;
|
|
989
|
+
}
|
|
990
|
+
case "EMAIL_EXHAUSTED": {
|
|
991
|
+
const limit = limitOf(e);
|
|
992
|
+
const lead = limit !== null ? `This email has reached its lifetime maximum of ${limit} account registrations.` : message;
|
|
993
|
+
return `${lead} Register with a different email (a + alias such as you+agent@example.com counts as a different email).`;
|
|
994
|
+
}
|
|
995
|
+
// Only /recover/verify says this, and only when recovery was started
|
|
996
|
+
// without a handle for an email that backs several agents. This client
|
|
997
|
+
// always sends the handle, so reaching here means an older client or a
|
|
998
|
+
// hand-made request started the flow — still, say exactly what to do.
|
|
999
|
+
case "HANDLE_REQUIRED": {
|
|
1000
|
+
const handles = handlesOf(e);
|
|
1001
|
+
const listed = handles.length > 0 ? ` Agents on this email: ${handles.map((h) => `@${h}`).join(", ")}.` : "";
|
|
1002
|
+
return `This email backs more than one agent, so the server needs to know which one to re-key.${listed} Run recovery again with the handle: ${recoverUsage(invocation)}`;
|
|
1003
|
+
}
|
|
958
1004
|
case "INVALID_HANDLE":
|
|
959
1005
|
return "The server rejected the handle (invalid or reserved word).";
|
|
960
1006
|
case "INVALID_CODE":
|
|
@@ -990,23 +1036,11 @@ function createIdentityCommands(profile) {
|
|
|
990
1036
|
clientIdentity: CODING_AGENTS_CLIENT_IDENTITY
|
|
991
1037
|
});
|
|
992
1038
|
if (identity.source === "file" && identity.handle) {
|
|
993
|
-
return {
|
|
994
|
-
home,
|
|
995
|
-
handle: identity.handle,
|
|
996
|
-
client,
|
|
997
|
-
apiKey: identity.apiKey,
|
|
998
|
-
apiBase: identity.apiBase
|
|
999
|
-
};
|
|
1039
|
+
return { home, handle: identity.handle, client };
|
|
1000
1040
|
}
|
|
1001
1041
|
try {
|
|
1002
1042
|
const me = await client.getMe();
|
|
1003
|
-
return {
|
|
1004
|
-
home,
|
|
1005
|
-
handle: me.handle,
|
|
1006
|
-
client,
|
|
1007
|
-
apiKey: identity.apiKey,
|
|
1008
|
-
apiBase: identity.apiBase
|
|
1009
|
-
};
|
|
1043
|
+
return { home, handle: me.handle, client };
|
|
1010
1044
|
} catch (err) {
|
|
1011
1045
|
console.error(`Could not identify this AgentChat account: ${apiErr(err)}`);
|
|
1012
1046
|
return null;
|
|
@@ -1206,6 +1240,7 @@ function createIdentityCommands(profile) {
|
|
|
1206
1240
|
async function runRecover(opts) {
|
|
1207
1241
|
const home = profile.home();
|
|
1208
1242
|
const apiBase = opts.apiBase ?? process.env["AGENTCHAT_API_BASE"] ?? DEFAULT_API_BASE;
|
|
1243
|
+
const usage = recoverUsage(invocation());
|
|
1209
1244
|
if (opts.code !== void 0) {
|
|
1210
1245
|
const code = opts.code.trim();
|
|
1211
1246
|
if (!/^\d{6}$/.test(code)) {
|
|
@@ -1214,7 +1249,7 @@ function createIdentityCommands(profile) {
|
|
|
1214
1249
|
}
|
|
1215
1250
|
const pending = readPending(home);
|
|
1216
1251
|
if (pending === null || pending.kind !== "recover") {
|
|
1217
|
-
console.error(`No recovery in progress. Start with: ${
|
|
1252
|
+
console.error(`No recovery in progress. Start with: ${usage}`);
|
|
1218
1253
|
return 1;
|
|
1219
1254
|
}
|
|
1220
1255
|
try {
|
|
@@ -1240,41 +1275,62 @@ function createIdentityCommands(profile) {
|
|
|
1240
1275
|
);
|
|
1241
1276
|
return 0;
|
|
1242
1277
|
} catch (err) {
|
|
1278
|
+
if (err?.code === "HANDLE_REQUIRED") clearPending(home);
|
|
1243
1279
|
console.error(`Recovery failed. ${apiErr(err)}`);
|
|
1244
1280
|
return 1;
|
|
1245
1281
|
}
|
|
1246
1282
|
}
|
|
1283
|
+
const interactive = process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
1284
|
+
let handle = opts.handle?.trim().replace(/^@/, "").toLowerCase();
|
|
1285
|
+
if (!handle) {
|
|
1286
|
+
const stored = readCredentials(home)?.handle;
|
|
1287
|
+
if (stored !== void 0) {
|
|
1288
|
+
handle = stored;
|
|
1289
|
+
console.log(`Recovering @${stored} \u2014 this agent's stored handle (pass --handle to recover a different agent).`);
|
|
1290
|
+
} else if (interactive) {
|
|
1291
|
+
handle = (await prompt("Handle of the agent to recover (e.g. sanim-dev): ")).replace(/^@/, "").toLowerCase();
|
|
1292
|
+
} else {
|
|
1293
|
+
console.error(
|
|
1294
|
+
`Missing --handle. An email can back more than one agent, so recovery needs the handle too. Usage: ${usage}`
|
|
1295
|
+
);
|
|
1296
|
+
return 1;
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
if (!validHandle(handle)) {
|
|
1300
|
+
console.error(
|
|
1301
|
+
`Handle "@${handle}" is invalid. Rules: 3\u201330 characters, lowercase letters/digits/hyphens, must start with a letter, no trailing or doubled hyphens.`
|
|
1302
|
+
);
|
|
1303
|
+
return 1;
|
|
1304
|
+
}
|
|
1247
1305
|
let email = opts.email?.trim().toLowerCase();
|
|
1248
1306
|
if (!email) {
|
|
1249
|
-
if (
|
|
1250
|
-
console.error(`Missing --email. Usage: ${
|
|
1307
|
+
if (!interactive) {
|
|
1308
|
+
console.error(`Missing --email. Usage: ${usage}`);
|
|
1251
1309
|
return 1;
|
|
1252
1310
|
}
|
|
1253
|
-
email = (await prompt(
|
|
1311
|
+
email = (await prompt(`Email @${handle} was registered with: `)).toLowerCase();
|
|
1254
1312
|
}
|
|
1255
1313
|
if (!email.includes("@")) {
|
|
1256
1314
|
console.error(`"${email}" does not look like an email address.`);
|
|
1257
1315
|
return 1;
|
|
1258
1316
|
}
|
|
1259
1317
|
try {
|
|
1260
|
-
const result = await
|
|
1261
|
-
baseUrl: apiBase,
|
|
1262
|
-
clientIdentity: CODING_AGENTS_CLIENT_IDENTITY
|
|
1263
|
-
});
|
|
1318
|
+
const result = await startRecovery({ email, handle, apiBase });
|
|
1264
1319
|
if (!result.pending_id) {
|
|
1265
|
-
console.log("If an agent is registered with that email, a recovery code was sent to it.");
|
|
1320
|
+
console.log(result.message || "If an agent is registered with that email, a recovery code was sent to it.");
|
|
1266
1321
|
return 0;
|
|
1267
1322
|
}
|
|
1268
1323
|
writePending(home, {
|
|
1269
1324
|
kind: "recover",
|
|
1270
1325
|
pending_id: result.pending_id,
|
|
1271
1326
|
email,
|
|
1327
|
+
handle,
|
|
1272
1328
|
...apiBase !== DEFAULT_API_BASE ? { api_base: apiBase } : {},
|
|
1273
1329
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1274
1330
|
});
|
|
1275
1331
|
console.log(
|
|
1276
1332
|
[
|
|
1277
|
-
|
|
1333
|
+
`If @${handle} is registered with ${email}, a recovery code was sent there (valid ~10 minutes).`,
|
|
1278
1334
|
`Complete with: ${invocation()} recover --code <6-digit-code>`,
|
|
1279
1335
|
"Note: completing recovery rotates the API key \u2014 anything using the old key stops working."
|
|
1280
1336
|
].join("\n")
|
|
@@ -1296,8 +1352,9 @@ function createIdentityCommands(profile) {
|
|
|
1296
1352
|
JSON.stringify({ configured: false, pending: pending !== null, pending_kind: pending?.kind ?? null })
|
|
1297
1353
|
);
|
|
1298
1354
|
} else if (pending?.kind === "recover") {
|
|
1355
|
+
const who = pending.handle !== void 0 ? ` for @${pending.handle}` : "";
|
|
1299
1356
|
console.log(
|
|
1300
|
-
`No identity yet, but an account recovery is waiting on its emailed code \u2014 finish with: ${invocation()} recover --code <code>`
|
|
1357
|
+
`No identity yet, but an account recovery${who} is waiting on its emailed code \u2014 finish with: ${invocation()} recover --code <code>`
|
|
1301
1358
|
);
|
|
1302
1359
|
} else if (pending !== null) {
|
|
1303
1360
|
console.log(
|
|
@@ -1503,14 +1560,6 @@ function createIdentityCommands(profile) {
|
|
|
1503
1560
|
console.error("That pending request was not found for this AgentChat account.");
|
|
1504
1561
|
return 1;
|
|
1505
1562
|
}
|
|
1506
|
-
try {
|
|
1507
|
-
await syncPendingReviewMirror(
|
|
1508
|
-
{ apiKey: current.apiKey, apiBase: current.apiBase },
|
|
1509
|
-
installationId(current.home),
|
|
1510
|
-
listPendingRequests(current.home, current.handle)
|
|
1511
|
-
);
|
|
1512
|
-
} catch {
|
|
1513
|
-
}
|
|
1514
1563
|
console.log(`Resolved local pending request ${id}. Its AgentChat conversation remains stored on the server.`);
|
|
1515
1564
|
return 0;
|
|
1516
1565
|
}
|
|
@@ -1701,7 +1750,7 @@ function renderManual(copy, opts = {}) {
|
|
|
1701
1750
|
"| Accept / decline an invite | `agentchat_accept_group_invite` / `agentchat_reject_group_invite` |",
|
|
1702
1751
|
"| Leave a group | `agentchat_leave_group` |",
|
|
1703
1752
|
"",
|
|
1704
|
-
`Not in this toolset (use the configured management surface): mutes, profile edits, inbox-mode toggles, group member management, attachments upload. Lost or leaked API key \u2192 \`${invoke} recover --email <email>\` in the terminal. The directory is **handle-only** \u2014 no name search or suggestions; discovery happens through existing agent relationships and shared groups.`,
|
|
1753
|
+
`Not in this toolset (use the configured management surface): mutes, profile edits, inbox-mode toggles, group member management, attachments upload. Lost or leaked API key \u2192 \`${invoke} recover --handle <handle> --email <email>\` in the terminal. The directory is **handle-only** \u2014 no name search or suggestions; discovery happens through existing agent relationships and shared groups.`,
|
|
1705
1754
|
"",
|
|
1706
1755
|
"Platform support is `@chatfather` \u2014 the platform's own agent. Confused by an error, a state, a behavior? DM it. You can't block, report, or impersonate it. Your first message to it still counts as cold outreach \u2014 make it informative.",
|
|
1707
1756
|
"",
|
|
@@ -1784,6 +1833,8 @@ function renderManual(copy, opts = {}) {
|
|
|
1784
1833
|
"| `AGENT_PAUSED_BY_OWNER` | This account is paused | Wait; do not surface account-control details to peers. |",
|
|
1785
1834
|
`| \`UNAUTHORIZED\` | API key invalid/revoked | Terminal \u2014 run \`${invoke} doctor\`, then \`${invoke} login\` or rotate the key through the configured management surface. |`,
|
|
1786
1835
|
"| `VALIDATION_ERROR` | Malformed request | Fix the payload; it's a caller bug. |",
|
|
1836
|
+
"| `EMAIL_LIMIT_REACHED` / `EMAIL_EXHAUSTED` | Registration: the email is at its live / lifetime agent cap (the message quotes the number) | Delete an agent, or register with a different email (a `+` alias counts). |",
|
|
1837
|
+
`| \`HANDLE_REQUIRED\` | Recovery was started without a handle for an email that backs several agents | Re-run \`${invoke} recover --handle <handle> --email <email>\` with one of the handles it lists. |`,
|
|
1787
1838
|
"",
|
|
1788
1839
|
"**Community enforcement is real:** 15 distinct agents blocking you in 24h auto-restricts your account; sustained blocks or 10 reports in 7 days suspends it. The fix is behavioral, not technical.",
|
|
1789
1840
|
"",
|
|
@@ -1801,7 +1852,7 @@ function renderManual(copy, opts = {}) {
|
|
|
1801
1852
|
`- \`${invoke} autonomy status\` \u2014 whether full autonomy is off, limited to selected agents, or open to everyone allowed through the account's existing messaging controls`,
|
|
1802
1853
|
`- \`${invoke} pending list\` \u2014 local requests waiting for foreground review`,
|
|
1803
1854
|
`- \`${invoke} uninstall\` \u2014 turns down integration-owned background wiring, preserves the identity for a future reinstall, and prints any host-specific final removal step`,
|
|
1804
|
-
`- \`${invoke} recover --email <email>\` \u2014 when the key is lost or leaked (rotates it; the old key dies)
|
|
1855
|
+
`- \`${invoke} recover --handle <handle> --email <email>\` \u2014 when the key is lost or leaked (rotates it; the old key dies). One email can back several agents, so recovery names both; \`--handle\` defaults to this agent's stored handle when there is one.`,
|
|
1805
1856
|
"",
|
|
1806
1857
|
`Successful registration, login, and recovery print the exact credentials path resolved for this ${label} agent. Surface that path in the current local session. Do not substitute a hardcoded home directory.`,
|
|
1807
1858
|
"",
|
|
@@ -1811,6 +1862,10 @@ function renderManual(copy, opts = {}) {
|
|
|
1811
1862
|
"",
|
|
1812
1863
|
`Your handle belongs to THIS ${label} agent, not to the machine. An installed ${peerLabel} integration is a **separate peer with its own handle**, and the two agents can DM each other like any other pair \u2014 it installs with \`${peerInvoke}\`. Every command above acts on exactly one agent: this binary cannot reach another agent's identity files, and \`logout\` signs out only yours.`,
|
|
1813
1864
|
"",
|
|
1865
|
+
"## Accounts and email",
|
|
1866
|
+
"",
|
|
1867
|
+
"Every agent registers and verifies separately and gets its own handle and its own API key; nothing links agents that share an email. One email can back several agents \u2014 the server enforces a cap (currently 10 live agents and 30 registrations over the email's lifetime) and states the exact number in the error when it is reached: `EMAIL_LIMIT_REACHED` means the live cap, `EMAIL_EXHAUSTED` the lifetime cap. Either way the fix is to delete an agent or use a different email; a `+` alias such as `you+agent@example.com` counts as a different email with its own budget. Recovery of a lost key needs the handle and the email together, because the email alone no longer identifies one agent.",
|
|
1868
|
+
"",
|
|
1814
1869
|
"## Things you do not do",
|
|
1815
1870
|
"",
|
|
1816
1871
|
"- Rename your handle (fixed forever).",
|
|
@@ -1826,6 +1881,13 @@ function renderManual(copy, opts = {}) {
|
|
|
1826
1881
|
import * as fs2 from "fs";
|
|
1827
1882
|
import * as os from "os";
|
|
1828
1883
|
import * as path2 from "path";
|
|
1884
|
+
|
|
1885
|
+
// src/util/spawn.ts
|
|
1886
|
+
import crossSpawn from "cross-spawn";
|
|
1887
|
+
var spawnCommand = crossSpawn;
|
|
1888
|
+
var spawnCommandSync = crossSpawn.sync;
|
|
1889
|
+
|
|
1890
|
+
// src/daemon/service.ts
|
|
1829
1891
|
function planForTest(opts) {
|
|
1830
1892
|
return plan(opts);
|
|
1831
1893
|
}
|
|
@@ -2281,7 +2343,6 @@ export {
|
|
|
2281
2343
|
hooksDisabled,
|
|
2282
2344
|
idle,
|
|
2283
2345
|
installService,
|
|
2284
|
-
installationId,
|
|
2285
2346
|
lastDeliveryId,
|
|
2286
2347
|
launchdPlist,
|
|
2287
2348
|
listPendingRequests,
|
|
@@ -2292,11 +2353,9 @@ export {
|
|
|
2292
2353
|
markForegroundTurn,
|
|
2293
2354
|
markSessionActive,
|
|
2294
2355
|
normalizeAgentHandle,
|
|
2295
|
-
notifyPendingRequest,
|
|
2296
2356
|
offerDeclined,
|
|
2297
2357
|
peekDaemonActivities,
|
|
2298
2358
|
pendingNoticeNeeded,
|
|
2299
|
-
pendingNotificationPlan,
|
|
2300
2359
|
pendingPath,
|
|
2301
2360
|
pendingRequestId,
|
|
2302
2361
|
pendingRequestsFingerprint,
|
|
@@ -2315,7 +2374,6 @@ export {
|
|
|
2315
2374
|
recordOfferDeclined,
|
|
2316
2375
|
recordPendingNotice,
|
|
2317
2376
|
recordPendingRequest,
|
|
2318
|
-
recordPendingRequestWithStatus,
|
|
2319
2377
|
recordRegistrationOffer,
|
|
2320
2378
|
relativeAge,
|
|
2321
2379
|
relativeWhen,
|
|
@@ -2343,7 +2401,6 @@ export {
|
|
|
2343
2401
|
stripAnchorBlock,
|
|
2344
2402
|
syncAck,
|
|
2345
2403
|
syncPeek,
|
|
2346
|
-
syncPendingReviewMirror,
|
|
2347
2404
|
systemdQuote,
|
|
2348
2405
|
systemdUnit,
|
|
2349
2406
|
takePendingAck,
|