@rubytech/create-realagent 1.0.624 → 1.0.626
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/index.js +2 -1
- package/package.json +1 -1
- package/payload/platform/lib/anthropic-key/dist/index.d.ts +1 -0
- package/payload/platform/lib/anthropic-key/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/anthropic-key/dist/index.js +30 -0
- package/payload/platform/lib/anthropic-key/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +25 -15
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +1 -1
- package/payload/platform/plugins/docs/references/cloudflare.md +1 -1
- package/payload/platform/plugins/memory/PLUGIN.md +24 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js +141 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.d.ts +66 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.js +411 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-prune.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/scripts/graph-prune.d.ts +18 -0
- package/payload/platform/plugins/memory/mcp/dist/scripts/graph-prune.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/scripts/graph-prune.js +80 -0
- package/payload/platform/plugins/memory/mcp/dist/scripts/graph-prune.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.d.ts +8 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.js +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/conversation-memory-expunge.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.js +28 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-add.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.js +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-list.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.js +27 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-denylist-remove.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-run.d.ts +7 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-run.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-run.js +10 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/graph-prune-run.js.map +1 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +20 -4
- package/payload/platform/templates/agents/public/IDENTITY.md +18 -0
- package/payload/platform/templates/specialists/agents/content-producer.md +18 -0
- package/payload/platform/templates/specialists/agents/personal-assistant.md +18 -0
- package/payload/platform/templates/specialists/agents/project-manager.md +18 -0
- package/payload/platform/templates/specialists/agents/research-assistant.md +18 -0
- package/payload/server/server.js +44 -4
package/dist/index.js
CHANGED
|
@@ -1300,6 +1300,7 @@ function installCrons() {
|
|
|
1300
1300
|
`* * * * * mkdir -p ${accountLogDir} && PLATFORM_ROOT=${platformRoot} ${accountEnv}${nodeBin} ${platformRoot}/plugins/scheduling/mcp/dist/scripts/check-due-events.js >> ${accountLogDir}/check-due-events.log 2>&1 # heartbeat`,
|
|
1301
1301
|
`* * * * * mkdir -p ${accountLogDir} && PLATFORM_ROOT=${platformRoot} ${accountEnv}${nodeBin} ${platformRoot}/plugins/email/mcp/dist/scripts/email-fetch.js >> ${accountLogDir}/email-fetch.log 2>&1 # email-fetch`,
|
|
1302
1302
|
`* * * * * mkdir -p ${accountLogDir} && PLATFORM_ROOT=${platformRoot} ${accountEnv}${nodeBin} ${platformRoot}/plugins/email/mcp/dist/scripts/email-auto-respond.js >> ${accountLogDir}/email-auto-respond.log 2>&1 # email-auto-respond`,
|
|
1303
|
+
`0 3 * * * mkdir -p ${accountLogDir} && PLATFORM_ROOT=${platformRoot} ${accountEnv}${nodeBin} ${platformRoot}/plugins/memory/mcp/dist/scripts/graph-prune.js >> ${accountLogDir}/graph-prune.log 2>&1 # graph-prune`,
|
|
1303
1304
|
];
|
|
1304
1305
|
// Read existing crontab (empty string if none)
|
|
1305
1306
|
const existing = spawnSync("crontab", ["-l"], { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] });
|
|
@@ -1321,7 +1322,7 @@ function installCrons() {
|
|
|
1321
1322
|
stdio: ["pipe", "pipe", "pipe"],
|
|
1322
1323
|
});
|
|
1323
1324
|
if (write.status === 0) {
|
|
1324
|
-
console.log(" Cron jobs: registered (heartbeat, email-fetch, email-auto-respond)");
|
|
1325
|
+
console.log(" Cron jobs: registered (heartbeat, email-fetch, email-auto-respond, graph-prune)");
|
|
1325
1326
|
}
|
|
1326
1327
|
else {
|
|
1327
1328
|
console.error(` Cron jobs: failed to register — ${(write.stderr || "").trim()}`);
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
export declare function readKey(): string | null;
|
|
12
12
|
export declare function writeKey(key: string): void;
|
|
13
13
|
export declare function hasKey(): boolean;
|
|
14
|
+
export declare function deleteKey(): void;
|
|
14
15
|
export type KeyStatus = "valid" | "billing" | "auth_error" | "missing" | "error";
|
|
15
16
|
export interface KeyValidation {
|
|
16
17
|
status: KeyStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoEH,wBAAgB,OAAO,IAAI,MAAM,GAAG,IAAI,CAiDvC;AAMD,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAiB1C;AAMD,wBAAgB,MAAM,IAAI,OAAO,CAEhC;AAaD,wBAAgB,SAAS,IAAI,IAAI,CAsBhC;AAUD,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAEjF,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAsB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAsFtE;AAOD,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.readKey = readKey;
|
|
14
14
|
exports.writeKey = writeKey;
|
|
15
15
|
exports.hasKey = hasKey;
|
|
16
|
+
exports.deleteKey = deleteKey;
|
|
16
17
|
exports.validateKey = validateKey;
|
|
17
18
|
exports.keyFilePath = keyFilePath;
|
|
18
19
|
const index_js_1 = require("../../models/dist/index.js");
|
|
@@ -125,6 +126,35 @@ function writeKey(key) {
|
|
|
125
126
|
function hasKey() {
|
|
126
127
|
return readKey() !== null;
|
|
127
128
|
}
|
|
129
|
+
// ---------------------------------------------------------------------------
|
|
130
|
+
// deleteKey — remove the stored key file; idempotent on ENOENT
|
|
131
|
+
//
|
|
132
|
+
// Throws on unexpected fs errors (EACCES, EBUSY, EPERM) so callers can
|
|
133
|
+
// surface a structured failure. ENOENT is treated as a no-op because the
|
|
134
|
+
// intended post-condition ("no key file on disk") is already satisfied.
|
|
135
|
+
// Per Task 531 learning, never use `{ force: true }` — it swallows the
|
|
136
|
+
// error classes that matter (permission, busy) and leaves the caller
|
|
137
|
+
// believing removal succeeded.
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
function deleteKey() {
|
|
140
|
+
const keyFilePath = resolveKeyFilePath();
|
|
141
|
+
try {
|
|
142
|
+
(0, node_fs_1.unlinkSync)(keyFilePath);
|
|
143
|
+
console.error(`[anthropic-key] deleteKey: removed ${keyFilePath}`);
|
|
144
|
+
}
|
|
145
|
+
catch (err) {
|
|
146
|
+
const code = err instanceof Error && "code" in err
|
|
147
|
+
? err.code
|
|
148
|
+
: undefined;
|
|
149
|
+
if (code === "ENOENT") {
|
|
150
|
+
console.error(`[anthropic-key] deleteKey: nothing to remove (ENOENT): ${keyFilePath}`);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
154
|
+
console.error(`[anthropic-key] deleteKey: failed to remove ${keyFilePath}: ${msg}`);
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
128
158
|
async function validateKey(key) {
|
|
129
159
|
const effectiveKey = key ?? readKey();
|
|
130
160
|
if (!effectiveKey) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAoEH,0BAiDC;AAMD,4BAiBC;AAMD,wBAEC;AAaD,8BAsBC;A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AC,IAAI,CAAC,EACnD,CAAC;YACD,OAAO,CAAC,KAAK,CACX,yCAAyC,GAAG,CAAC,MAAM,KAAK,OAAO,KAAK,CACrE,CAAC;YACF,OAAO;gBACL,MAAM,EAAE,YAAY;gBACpB,OAAO,EACL,wIAAwI;aAC3I,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,KAAK,CACX,oCAAoC,GAAG,CAAC,MAAM,KAAK,OAAO,KAAK,CAChE,CAAC;QACF,OAAO;YACL,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,gDAAgD,GAAG,CAAC,MAAM,qDAAqD;SACzH,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;QACnC,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,KAAK,CACX,qDAAqD,OAAO,QAAQ,GAAG,EAAE,CAC1E,CAAC;QACF,OAAO;YACL,MAAM,EAAE,OAAO;YACf,OAAO,EAAE,sCAAsC,GAAG,+BAA+B;SAClF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,kEAAkE;AAClE,yEAAyE;AACzE,8EAA8E;AAE9E,SAAgB,WAAW;IACzB,OAAO,kBAAkB,EAAE,CAAC;AAC9B,CAAC"}
|
|
@@ -7,7 +7,7 @@ import { readFile, writeFile } from "node:fs/promises";
|
|
|
7
7
|
import { resolve, join } from "node:path";
|
|
8
8
|
import { execFileSync } from "node:child_process";
|
|
9
9
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
|
|
10
|
-
import { writeKey, validateKey, hasKey, keyFilePath } from "../../../../lib/anthropic-key/dist/index.js";
|
|
10
|
+
import { writeKey, validateKey, hasKey, keyFilePath, deleteKey } from "../../../../lib/anthropic-key/dist/index.js";
|
|
11
11
|
import { deviceUrlBlock } from "../../../../lib/device-url/dist/index.js";
|
|
12
12
|
import { createHash, randomInt, randomUUID } from "node:crypto";
|
|
13
13
|
import { createConnection } from "node:net";
|
|
@@ -353,7 +353,7 @@ server.tool("remote-auth-status", "Check whether the remote access password is c
|
|
|
353
353
|
? `Remote access password is configured.`
|
|
354
354
|
: `Remote access password is not configured. The admin interface will refuse to expose over the tunnel until one is set.\n\n` +
|
|
355
355
|
`${deviceUrlBlock({ url: setupUrl, intent: "Set remote access password", hostname: osHostname() })}\n\n` +
|
|
356
|
-
`
|
|
356
|
+
`Ask the operator to set a password — either by clicking the button above (opens the setup page on the device) or by telling you one you can pass to \`remote-auth-set-password\`.`;
|
|
357
357
|
return {
|
|
358
358
|
content: [{ type: "text", text }],
|
|
359
359
|
};
|
|
@@ -1234,13 +1234,10 @@ server.tool("session-reset", "Reset the current session. Compacts conversation h
|
|
|
1234
1234
|
server.tool("session-resume", "Resume a previous session. Loads the selected session's message history into the chat timeline " +
|
|
1235
1235
|
"and routes new messages to that conversation. Call after the user selects a session from the " +
|
|
1236
1236
|
"session-list results. Pass the conversationId from the selected session.", { conversationId: z.string().uuid().describe("The conversationId of the session to resume") }, async () => ({ content: [{ type: "text", text: "resumed" }] }));
|
|
1237
|
-
server.tool("remote-auth-set-password", "
|
|
1238
|
-
"
|
|
1239
|
-
"
|
|
1240
|
-
"
|
|
1241
|
-
"The remote access password protects the admin interface when accessed over the internet — " +
|
|
1242
|
-
"it has no effect on the public endpoint or the tunnel itself. " +
|
|
1243
|
-
"Set this before invoking setup-tunnel.sh; the script's post-restart verification curls the admin hostname, which fails unless the remote-auth gate is configured (admin must not be exposed unauthenticated).", { password: z.string() }, async ({ password }) => {
|
|
1237
|
+
server.tool("remote-auth-set-password", "Set the remote access password. Hashes with scrypt and writes to the platform's brand-specific config directory with mode 0600. " +
|
|
1238
|
+
"Validates strength (8+ chars, digit, special character, no leading/trailing spaces). " +
|
|
1239
|
+
"Protects the admin interface when exposed over the tunnel — has no effect on the public endpoint or the tunnel itself. " +
|
|
1240
|
+
"Set before `setup-tunnel.sh` — the script's post-restart verification curls the admin hostname and fails if remote-auth is not configured.", { password: z.string() }, async ({ password }) => {
|
|
1244
1241
|
const trimmed = password.trim();
|
|
1245
1242
|
// Validate strength — same rules as the web server's validatePasswordStrength
|
|
1246
1243
|
const checks = [
|
|
@@ -1421,12 +1418,25 @@ server.tool("anthropic-setup", "Deterministic state machine for Anthropic API ke
|
|
|
1421
1418
|
data: { url: `${CONSOLE_BASE}/settings/billing` },
|
|
1422
1419
|
});
|
|
1423
1420
|
case "auth_error":
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1421
|
+
// Deterministic transition: the state machine knows the key file
|
|
1422
|
+
// path and the only recovery is to delete and restart sign-in.
|
|
1423
|
+
// Auto-reset here so the agent never has to rediscover the path
|
|
1424
|
+
// via filesystem probes.
|
|
1425
|
+
log(`auth_error → auto-resetting: deleting revoked key at ${keyFilePath()}`);
|
|
1426
|
+
try {
|
|
1427
|
+
deleteKey();
|
|
1428
|
+
}
|
|
1429
|
+
catch (err) {
|
|
1430
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1431
|
+
log(`auto-reset failed: ${msg}`);
|
|
1432
|
+
return anthropicResult({
|
|
1433
|
+
status: "error",
|
|
1434
|
+
message: `The stored API key was rejected and auto-reset failed: ${msg}. ` +
|
|
1435
|
+
`Manual intervention needed — remove ${keyFilePath()} and call this tool again.`,
|
|
1436
|
+
});
|
|
1437
|
+
}
|
|
1438
|
+
// Fall through to the awaiting_signin path below.
|
|
1439
|
+
break;
|
|
1430
1440
|
case "missing":
|
|
1431
1441
|
// hasKey() returned true but readKey() returned null — shouldn't happen
|
|
1432
1442
|
log("hasKey true but validate returned missing — proceeding to setup");
|