@elizaos/plugin-inbox 2.0.3-beta.6 → 2.0.3-beta.7

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.
Files changed (119) hide show
  1. package/dist/actions/inbox.d.ts +69 -0
  2. package/dist/actions/inbox.d.ts.map +1 -0
  3. package/dist/actions/inbox.js +345 -0
  4. package/dist/actions/inbox.js.map +1 -0
  5. package/dist/components/inbox/InboxSpatialView.d.ts +54 -0
  6. package/dist/components/inbox/InboxSpatialView.d.ts.map +1 -0
  7. package/dist/components/inbox/InboxSpatialView.js +171 -0
  8. package/dist/components/inbox/InboxSpatialView.js.map +1 -0
  9. package/dist/components/inbox/InboxView.d.ts +64 -0
  10. package/dist/components/inbox/InboxView.d.ts.map +1 -0
  11. package/dist/components/inbox/InboxView.js +169 -0
  12. package/dist/components/inbox/InboxView.js.map +1 -0
  13. package/dist/components/inbox/inbox-view-bundle.d.ts +2 -0
  14. package/dist/components/inbox/inbox-view-bundle.d.ts.map +1 -0
  15. package/dist/components/inbox/inbox-view-bundle.js +5 -0
  16. package/dist/components/inbox/inbox-view-bundle.js.map +1 -0
  17. package/dist/db/index.d.ts +3 -0
  18. package/dist/db/index.d.ts.map +1 -0
  19. package/dist/db/index.js +3 -0
  20. package/dist/db/index.js.map +1 -0
  21. package/dist/db/schema.d.ts +1729 -0
  22. package/dist/db/schema.d.ts.map +1 -0
  23. package/dist/db/schema.js +79 -0
  24. package/dist/db/schema.js.map +1 -0
  25. package/dist/db/sql.d.ts +32 -0
  26. package/dist/db/sql.d.ts.map +1 -0
  27. package/dist/db/sql.js +130 -0
  28. package/dist/db/sql.js.map +1 -0
  29. package/dist/inbox/channel-deep-links.d.ts +7 -0
  30. package/dist/inbox/channel-deep-links.d.ts.map +1 -0
  31. package/dist/inbox/channel-deep-links.js +97 -0
  32. package/dist/inbox/channel-deep-links.js.map +1 -0
  33. package/dist/inbox/config.d.ts +7 -0
  34. package/dist/inbox/config.d.ts.map +1 -0
  35. package/dist/inbox/config.js +61 -0
  36. package/dist/inbox/config.js.map +1 -0
  37. package/dist/inbox/email-curation.d.ts +174 -0
  38. package/dist/inbox/email-curation.d.ts.map +1 -0
  39. package/dist/inbox/email-curation.js +1056 -0
  40. package/dist/inbox/email-curation.js.map +1 -0
  41. package/dist/inbox/email-unsubscribe-types.d.ts +71 -0
  42. package/dist/inbox/email-unsubscribe-types.d.ts.map +1 -0
  43. package/dist/inbox/email-unsubscribe-types.js +1 -0
  44. package/dist/inbox/email-unsubscribe-types.js.map +1 -0
  45. package/dist/inbox/gmail-normalize.d.ts +99 -0
  46. package/dist/inbox/gmail-normalize.d.ts.map +1 -0
  47. package/dist/inbox/gmail-normalize.js +937 -0
  48. package/dist/inbox/gmail-normalize.js.map +1 -0
  49. package/dist/inbox/google-gmail-seam.d.ts +52 -0
  50. package/dist/inbox/google-gmail-seam.d.ts.map +1 -0
  51. package/dist/inbox/google-gmail-seam.js +263 -0
  52. package/dist/inbox/google-gmail-seam.js.map +1 -0
  53. package/dist/inbox/message-fetcher.d.ts +47 -0
  54. package/dist/inbox/message-fetcher.d.ts.map +1 -0
  55. package/dist/inbox/message-fetcher.js +461 -0
  56. package/dist/inbox/message-fetcher.js.map +1 -0
  57. package/dist/inbox/migration.d.ts +46 -0
  58. package/dist/inbox/migration.d.ts.map +1 -0
  59. package/dist/inbox/migration.js +114 -0
  60. package/dist/inbox/migration.js.map +1 -0
  61. package/dist/inbox/reflection.d.ts +40 -0
  62. package/dist/inbox/reflection.d.ts.map +1 -0
  63. package/dist/inbox/reflection.js +142 -0
  64. package/dist/inbox/reflection.js.map +1 -0
  65. package/dist/inbox/repository.d.ts +58 -0
  66. package/dist/inbox/repository.d.ts.map +1 -0
  67. package/dist/inbox/repository.js +376 -0
  68. package/dist/inbox/repository.js.map +1 -0
  69. package/dist/inbox/service.d.ts +149 -0
  70. package/dist/inbox/service.d.ts.map +1 -0
  71. package/dist/inbox/service.js +247 -0
  72. package/dist/inbox/service.js.map +1 -0
  73. package/dist/inbox/triage-classifier.d.ts +28 -0
  74. package/dist/inbox/triage-classifier.d.ts.map +1 -0
  75. package/dist/inbox/triage-classifier.js +306 -0
  76. package/dist/inbox/triage-classifier.js.map +1 -0
  77. package/dist/inbox/types.d.ts +124 -0
  78. package/dist/inbox/types.d.ts.map +1 -0
  79. package/dist/inbox/types.js +1 -0
  80. package/dist/inbox/types.js.map +1 -0
  81. package/dist/inbox/unsubscribe-repository.d.ts +14 -0
  82. package/dist/inbox/unsubscribe-repository.d.ts.map +1 -0
  83. package/dist/inbox/unsubscribe-repository.js +112 -0
  84. package/dist/inbox/unsubscribe-repository.js.map +1 -0
  85. package/dist/inbox/unsubscribe-service.d.ts +41 -0
  86. package/dist/inbox/unsubscribe-service.d.ts.map +1 -0
  87. package/dist/inbox/unsubscribe-service.js +351 -0
  88. package/dist/inbox/unsubscribe-service.js.map +1 -0
  89. package/dist/index.d.ts +20 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +70 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/plugin.d.ts +4 -0
  94. package/dist/plugin.d.ts.map +1 -0
  95. package/dist/plugin.js +38 -0
  96. package/dist/plugin.js.map +1 -0
  97. package/dist/providers/cross-channel-context.d.ts +21 -0
  98. package/dist/providers/cross-channel-context.d.ts.map +1 -0
  99. package/dist/providers/cross-channel-context.js +96 -0
  100. package/dist/providers/cross-channel-context.js.map +1 -0
  101. package/dist/providers/inbox-triage.d.ts +12 -0
  102. package/dist/providers/inbox-triage.d.ts.map +1 -0
  103. package/dist/providers/inbox-triage.js +98 -0
  104. package/dist/providers/inbox-triage.js.map +1 -0
  105. package/dist/register-terminal-view.d.ts +15 -0
  106. package/dist/register-terminal-view.d.ts.map +1 -0
  107. package/dist/register-terminal-view.js +21 -0
  108. package/dist/register-terminal-view.js.map +1 -0
  109. package/dist/register.d.ts +9 -0
  110. package/dist/register.d.ts.map +1 -0
  111. package/dist/register.js +5 -0
  112. package/dist/register.js.map +1 -0
  113. package/dist/types.d.ts +42 -0
  114. package/dist/types.d.ts.map +1 -0
  115. package/dist/types.js +25 -0
  116. package/dist/types.js.map +1 -0
  117. package/dist/views/bundle.js +315 -0
  118. package/dist/views/bundle.js.map +1 -0
  119. package/package.json +9 -9
@@ -0,0 +1,114 @@
1
+ import { logger, Service } from "@elizaos/core";
2
+ const INBOX_MIGRATION_LOG_PREFIX = "[Inbox]";
3
+ const INBOX_MIGRATION_SERVICE_TYPE = "inbox_migration";
4
+ const SOURCE_SCHEMA = "app_lifeops";
5
+ const TARGET_SCHEMA = "app_inbox";
6
+ const MIGRATED_INBOX_TABLES = [
7
+ "life_inbox_triage_entries",
8
+ "life_inbox_triage_examples",
9
+ "life_email_unsubscribes"
10
+ ];
11
+ function quoteIdent(name) {
12
+ return `"${name.replace(/"/g, '""')}"`;
13
+ }
14
+ async function sourceTableExists(exec, table) {
15
+ const rows = await exec(
16
+ `SELECT to_regclass('${SOURCE_SCHEMA}.${table}') IS NOT NULL AS present`
17
+ );
18
+ return rows[0]?.present === true || rows[0]?.present === "true";
19
+ }
20
+ async function targetTableIsEmpty(exec, table) {
21
+ const rows = await exec(
22
+ `SELECT NOT EXISTS (SELECT 1 FROM ${TARGET_SCHEMA}.${quoteIdent(table)}) AS empty`
23
+ );
24
+ return rows[0]?.empty === true || rows[0]?.empty === "true";
25
+ }
26
+ async function migrateInboxTable(exec, table) {
27
+ if (!await sourceTableExists(exec, table)) {
28
+ return { table, outcome: "source-missing" };
29
+ }
30
+ if (!await targetTableIsEmpty(exec, table)) {
31
+ return { table, outcome: "target-non-empty" };
32
+ }
33
+ const target = `${TARGET_SCHEMA}.${quoteIdent(table)}`;
34
+ const source = `${SOURCE_SCHEMA}.${quoteIdent(table)}`;
35
+ await exec(
36
+ `INSERT INTO ${target}
37
+ SELECT s.* FROM ${source} AS s
38
+ WHERE NOT EXISTS (
39
+ SELECT 1 FROM ${target} AS t WHERE t.id = s.id
40
+ )`
41
+ );
42
+ return { table, outcome: "copied" };
43
+ }
44
+ async function migrateInboxTables(exec) {
45
+ await exec(`CREATE SCHEMA IF NOT EXISTS ${TARGET_SCHEMA}`);
46
+ const results = [];
47
+ for (const table of MIGRATED_INBOX_TABLES) {
48
+ results.push(await migrateInboxTable(exec, table));
49
+ }
50
+ return results;
51
+ }
52
+ function getRuntimeDb(runtime) {
53
+ const db = runtime.db;
54
+ if (!db || typeof db.execute !== "function") {
55
+ throw new Error(
56
+ `${INBOX_MIGRATION_LOG_PREFIX} runtime.db is unavailable \u2014 @elizaos/plugin-sql must be loaded before @elizaos/plugin-inbox.`
57
+ );
58
+ }
59
+ return db;
60
+ }
61
+ function extractRows(result) {
62
+ if (Array.isArray(result)) {
63
+ return result.filter(
64
+ (row) => typeof row === "object" && row !== null && !Array.isArray(row)
65
+ );
66
+ }
67
+ if (result && typeof result === "object" && "rows" in result) {
68
+ const rows = result.rows;
69
+ if (Array.isArray(rows)) {
70
+ return rows.filter(
71
+ (row) => typeof row === "object" && row !== null && !Array.isArray(row)
72
+ );
73
+ }
74
+ }
75
+ return [];
76
+ }
77
+ class InboxMigrationService extends Service {
78
+ static serviceType = INBOX_MIGRATION_SERVICE_TYPE;
79
+ capabilityDescription = "Non-destructive one-time copy of inbox-triage rows from app_lifeops into app_inbox during the plugin-inbox carve-out.";
80
+ static async start(runtime) {
81
+ const service = new InboxMigrationService(runtime);
82
+ await service.run();
83
+ return service;
84
+ }
85
+ async run() {
86
+ const db = getRuntimeDb(this.runtime);
87
+ const { sql } = await import("drizzle-orm");
88
+ const exec = async (statement) => extractRows(await db.execute(sql.raw(statement)));
89
+ const results = await migrateInboxTables(exec);
90
+ const copied = results.filter((r) => r.outcome === "copied");
91
+ if (copied.length > 0) {
92
+ logger.info(
93
+ { tables: copied.map((r) => r.table) },
94
+ `${INBOX_MIGRATION_LOG_PREFIX} copied ${copied.length} inbox table(s) from ${SOURCE_SCHEMA} to ${TARGET_SCHEMA}`
95
+ );
96
+ } else {
97
+ logger.debug(
98
+ { results },
99
+ `${INBOX_MIGRATION_LOG_PREFIX} no inbox tables required copying (already migrated or fresh install)`
100
+ );
101
+ }
102
+ }
103
+ async stop() {
104
+ }
105
+ }
106
+ export {
107
+ INBOX_MIGRATION_LOG_PREFIX,
108
+ INBOX_MIGRATION_SERVICE_TYPE,
109
+ InboxMigrationService,
110
+ MIGRATED_INBOX_TABLES,
111
+ migrateInboxTable,
112
+ migrateInboxTables
113
+ };
114
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/inbox/migration.ts"],"sourcesContent":["/**\n * Non-destructive data migration for the inbox-triage tables carved out of\n * @elizaos/plugin-personal-assistant.\n *\n * The three tables (`life_inbox_triage_entries`, `life_inbox_triage_examples`,\n * `life_email_unsubscribes`) used to live in the `app_lifeops` PostgreSQL\n * schema, created by plugin-personal-assistant. They now live in `app_inbox`,\n * created by this plugin's drizzle schema. Existing installs still hold the\n * owner's triage rows in `app_lifeops`, so on first boot we copy them across —\n * once, idempotently, and WITHOUT ever touching the source.\n *\n * Guards (per table, independently):\n * 1. Skip if the source table does not exist (fresh install / already dropped).\n * 2. Skip if the target table is non-empty (migration already ran, or the\n * plugin owns live data).\n * 3. Otherwise copy every source row that is not already present in the target\n * (a doubly-safe NOT EXISTS guard on the primary key).\n *\n * The source table is NEVER dropped or altered. The source and target share the\n * exact column shape (PA's `app_lifeops` drizzle def and this plugin's\n * `app_inbox` def are column-identical), so the `SELECT s.*` copy is safe.\n */\n\nimport { type IAgentRuntime, logger, Service } from \"@elizaos/core\";\n\nexport const INBOX_MIGRATION_LOG_PREFIX = \"[Inbox]\";\nexport const INBOX_MIGRATION_SERVICE_TYPE = \"inbox_migration\";\n\nconst SOURCE_SCHEMA = \"app_lifeops\";\nconst TARGET_SCHEMA = \"app_inbox\";\n\nexport const MIGRATED_INBOX_TABLES = [\n \"life_inbox_triage_entries\",\n \"life_inbox_triage_examples\",\n \"life_email_unsubscribes\",\n] as const;\n\nexport type MigratedInboxTable = (typeof MIGRATED_INBOX_TABLES)[number];\n\nexport type SqlExecutor = (\n sql: string,\n) => Promise<Array<Record<string, unknown>>>;\n\nexport interface TableMigrationResult {\n table: MigratedInboxTable;\n outcome: \"copied\" | \"source-missing\" | \"target-non-empty\";\n}\n\nfunction quoteIdent(name: string): string {\n return `\"${name.replace(/\"/g, '\"\"')}\"`;\n}\n\nasync function sourceTableExists(\n exec: SqlExecutor,\n table: MigratedInboxTable,\n): Promise<boolean> {\n const rows = await exec(\n `SELECT to_regclass('${SOURCE_SCHEMA}.${table}') IS NOT NULL AS present`,\n );\n return rows[0]?.present === true || rows[0]?.present === \"true\";\n}\n\nasync function targetTableIsEmpty(\n exec: SqlExecutor,\n table: MigratedInboxTable,\n): Promise<boolean> {\n const rows = await exec(\n `SELECT NOT EXISTS (SELECT 1 FROM ${TARGET_SCHEMA}.${quoteIdent(table)}) AS empty`,\n );\n return rows[0]?.empty === true || rows[0]?.empty === \"true\";\n}\n\nexport async function migrateInboxTable(\n exec: SqlExecutor,\n table: MigratedInboxTable,\n): Promise<TableMigrationResult> {\n if (!(await sourceTableExists(exec, table))) {\n return { table, outcome: \"source-missing\" };\n }\n if (!(await targetTableIsEmpty(exec, table))) {\n return { table, outcome: \"target-non-empty\" };\n }\n\n const target = `${TARGET_SCHEMA}.${quoteIdent(table)}`;\n const source = `${SOURCE_SCHEMA}.${quoteIdent(table)}`;\n await exec(\n `INSERT INTO ${target}\n SELECT s.* FROM ${source} AS s\n WHERE NOT EXISTS (\n SELECT 1 FROM ${target} AS t WHERE t.id = s.id\n )`,\n );\n return { table, outcome: \"copied\" };\n}\n\nexport async function migrateInboxTables(\n exec: SqlExecutor,\n): Promise<TableMigrationResult[]> {\n await exec(`CREATE SCHEMA IF NOT EXISTS ${TARGET_SCHEMA}`);\n const results: TableMigrationResult[] = [];\n for (const table of MIGRATED_INBOX_TABLES) {\n results.push(await migrateInboxTable(exec, table));\n }\n return results;\n}\n\ntype RuntimeDb = {\n execute: (query: unknown) => Promise<unknown>;\n};\n\nfunction getRuntimeDb(runtime: IAgentRuntime): RuntimeDb {\n const db = runtime.db as RuntimeDb | undefined;\n if (!db || typeof db.execute !== \"function\") {\n throw new Error(\n `${INBOX_MIGRATION_LOG_PREFIX} runtime.db is unavailable — @elizaos/plugin-sql must be loaded before @elizaos/plugin-inbox.`,\n );\n }\n return db;\n}\n\nfunction extractRows(result: unknown): Array<Record<string, unknown>> {\n if (Array.isArray(result)) {\n return result.filter(\n (row): row is Record<string, unknown> =>\n typeof row === \"object\" && row !== null && !Array.isArray(row),\n );\n }\n if (result && typeof result === \"object\" && \"rows\" in result) {\n const rows = (result as { rows: unknown }).rows;\n if (Array.isArray(rows)) {\n return rows.filter(\n (row): row is Record<string, unknown> =>\n typeof row === \"object\" && row !== null && !Array.isArray(row),\n );\n }\n }\n return [];\n}\n\n/**\n * Service whose `start()` performs the one-time, guarded, non-destructive copy\n * of the owner's inbox-triage rows from `app_lifeops` into `app_inbox`.\n */\nexport class InboxMigrationService extends Service {\n static override readonly serviceType = INBOX_MIGRATION_SERVICE_TYPE;\n\n override capabilityDescription =\n \"Non-destructive one-time copy of inbox-triage rows from app_lifeops into app_inbox during the plugin-inbox carve-out.\";\n\n static async start(runtime: IAgentRuntime): Promise<InboxMigrationService> {\n const service = new InboxMigrationService(runtime);\n await service.run();\n return service;\n }\n\n private async run(): Promise<void> {\n const db = getRuntimeDb(this.runtime);\n const { sql } = await import(\"drizzle-orm\");\n const exec: SqlExecutor = async (statement) =>\n extractRows(await db.execute(sql.raw(statement)));\n\n const results = await migrateInboxTables(exec);\n const copied = results.filter((r) => r.outcome === \"copied\");\n if (copied.length > 0) {\n logger.info(\n { tables: copied.map((r) => r.table) },\n `${INBOX_MIGRATION_LOG_PREFIX} copied ${copied.length} inbox table(s) from ${SOURCE_SCHEMA} to ${TARGET_SCHEMA}`,\n );\n } else {\n logger.debug(\n { results },\n `${INBOX_MIGRATION_LOG_PREFIX} no inbox tables required copying (already migrated or fresh install)`,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AAY,QAAQ;AAC3D,QAAI,OAAO,SAAS,GAAG;AACrB,aAAO;AAAA,QACL,EAAE,QAAQ,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,EAAE;AAAA,QACrC,GAAG,0BAA0B,WAAW,OAAO,MAAM,wBAAwB,aAAa,OAAO,aAAa;AAAA,MAChH;AAAA,IACF,OAAO;AACL,aAAO;AAAA,QACL,EAAE,QAAQ;AAAA,QACV,GAAG,0BAA0B;AAAA,MAC/B;AAAA,IACF;AAAA,EACF;AAAA,EAEA,MAAe,OAAsB;AAAA,EAAC;AACxC;","names":[]}
@@ -0,0 +1,40 @@
1
+ import type { IAgentRuntime } from "@elizaos/core";
2
+ /**
3
+ * Before sending a drafted response, run a reflection LLM call to verify
4
+ * the owner actually confirmed the send. This catches ambiguous messages
5
+ * like "sure" (which could be a response to something else) or "wait"
6
+ * that might be misinterpreted as confirmation.
7
+ *
8
+ * Returns true if the reflection confirms the owner intended to send.
9
+ */
10
+ export declare function reflectOnSendConfirmation(runtime: IAgentRuntime, opts: {
11
+ /** The owner's most recent message. */
12
+ userMessage: string;
13
+ /** The drafted response text that would be sent. */
14
+ draftText: string;
15
+ /** Where it would be sent. */
16
+ channelName: string;
17
+ /** Who it would be sent to. */
18
+ recipientName: string;
19
+ }): Promise<{
20
+ confirmed: boolean;
21
+ reasoning: string;
22
+ }>;
23
+ /**
24
+ * Before auto-sending a reply without explicit owner confirmation, run a
25
+ * reflection check to verify the response is appropriate and safe.
26
+ */
27
+ export declare function reflectOnAutoReply(runtime: IAgentRuntime, opts: {
28
+ /** The original inbound message. */
29
+ inboundText: string;
30
+ /** The proposed auto-reply. */
31
+ replyText: string;
32
+ /** Source channel. */
33
+ source: string;
34
+ /** Sender name. */
35
+ senderName: string;
36
+ }): Promise<{
37
+ approved: boolean;
38
+ reasoning: string;
39
+ }>;
40
+ //# sourceMappingURL=reflection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reflection.d.ts","sourceRoot":"","sources":["../../src/inbox/reflection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAsCnD;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE;IACJ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAqDpD;AAMD;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE;IACJ,oCAAoC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,+BAA+B;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB,GACA,OAAO,CAAC;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CA6DnD"}
@@ -0,0 +1,142 @@
1
+ import {
2
+ logger,
3
+ ModelType,
4
+ parseJsonModelRecord,
5
+ runWithTrajectoryContext
6
+ } from "@elizaos/core";
7
+ function parseReflectionObject(raw) {
8
+ const parsedJson = parseJsonModelRecord(raw);
9
+ if (parsedJson && typeof parsedJson === "object") {
10
+ return parsedJson;
11
+ }
12
+ return null;
13
+ }
14
+ function promptLine(value) {
15
+ const normalized = value.replace(/\s+/g, " ").trim();
16
+ return normalized.length > 0 ? normalized : "(empty)";
17
+ }
18
+ function readBoolean(value) {
19
+ if (typeof value === "boolean") {
20
+ return value;
21
+ }
22
+ return typeof value === "string" && value.trim().toLowerCase() === "true";
23
+ }
24
+ function readReasoning(value) {
25
+ return typeof value === "string" && value.trim().length > 0 ? value.trim() : "No reasoning provided";
26
+ }
27
+ async function reflectOnSendConfirmation(runtime, opts) {
28
+ const prompt = [
29
+ "Safety check for an inbox response system. Determine",
30
+ "whether the user has clearly confirmed they want to send a drafted message.",
31
+ "",
32
+ "Pending draft:",
33
+ `draftText: ${promptLine(opts.draftText)}`,
34
+ `recipientName: ${promptLine(opts.recipientName)}`,
35
+ `channelName: ${promptLine(opts.channelName)}`,
36
+ "",
37
+ "Owner message:",
38
+ `userMessage: ${promptLine(opts.userMessage)}`,
39
+ "",
40
+ "Determine if the user CLEARLY confirmed they want this message sent.",
41
+ "Confirmation signals: 'yes', 'send it', 'go ahead', 'looks good, send it', 'confirm'",
42
+ "Rejection signals: 'no', 'wait', 'hold on', 'change it', 'actually...', 'not now'",
43
+ "Ambiguous (treat as NOT confirmed): single words that could mean anything, unrelated responses",
44
+ "",
45
+ 'Return JSON only, for example {"confirmed":true,"reasoning":"brief explanation"}.'
46
+ ].join("\n");
47
+ try {
48
+ const result = await runWithTrajectoryContext(
49
+ { purpose: "lifeops-inbox-reflect-autoreply" },
50
+ () => runtime.useModel(ModelType.TEXT_SMALL, { prompt })
51
+ );
52
+ const raw = typeof result === "string" ? result : "";
53
+ const parsed = parseReflectionObject(raw);
54
+ if (parsed) {
55
+ return {
56
+ confirmed: readBoolean(parsed.confirmed),
57
+ reasoning: readReasoning(parsed.reasoning)
58
+ };
59
+ }
60
+ return {
61
+ confirmed: false,
62
+ reasoning: `Could not parse reflection: ${raw.slice(0, 100)}`
63
+ };
64
+ } catch (error) {
65
+ logger.warn(
66
+ {
67
+ src: "inbox-reflection",
68
+ error: error instanceof Error ? error.message : String(error)
69
+ },
70
+ "[InboxReflection] send confirmation reflection failed"
71
+ );
72
+ return {
73
+ confirmed: false,
74
+ reasoning: "Reflection check failed; defaulting to not confirmed for safety"
75
+ };
76
+ }
77
+ }
78
+ async function reflectOnAutoReply(runtime, opts) {
79
+ const prompt = [
80
+ "Safety check for an auto-reply system. The system wants to automatically",
81
+ "send a reply WITHOUT explicit owner confirmation. Determine if this",
82
+ "auto-reply is appropriate and safe to send.",
83
+ "",
84
+ "Inbound message:",
85
+ `senderName: ${promptLine(opts.senderName)}`,
86
+ `source: ${promptLine(opts.source)}`,
87
+ `inboundText: ${promptLine(opts.inboundText)}`,
88
+ "",
89
+ "Proposed reply:",
90
+ `replyText: ${promptLine(opts.replyText)}`,
91
+ "",
92
+ "Approve the auto-reply ONLY if ALL of these are true:",
93
+ "1. The reply is factually neutral and unlikely to cause harm",
94
+ "2. The reply doesn't make promises, commitments, or share sensitive info",
95
+ "3. The reply is appropriate for the tone and context of the conversation",
96
+ "4. The reply doesn't reveal private information about the owner",
97
+ "5. The message is routine (acknowledgement, simple greeting, basic info)",
98
+ "",
99
+ "Reject if ANY of these are true:",
100
+ "- The reply contains opinions, decisions, or commitments",
101
+ "- The conversation topic is sensitive (financial, legal, personal)",
102
+ "- The reply could be embarrassing or inappropriate",
103
+ "- The sender seems upset or the conversation is heated",
104
+ "",
105
+ 'Return JSON only, for example {"approved":true,"reasoning":"brief explanation"}.'
106
+ ].join("\n");
107
+ try {
108
+ const result = await runWithTrajectoryContext(
109
+ { purpose: "lifeops-inbox-reflect-send" },
110
+ () => runtime.useModel(ModelType.TEXT_SMALL, { prompt })
111
+ );
112
+ const raw = typeof result === "string" ? result : "";
113
+ const parsed = parseReflectionObject(raw);
114
+ if (parsed) {
115
+ return {
116
+ approved: readBoolean(parsed.approved),
117
+ reasoning: readReasoning(parsed.reasoning)
118
+ };
119
+ }
120
+ return {
121
+ approved: false,
122
+ reasoning: `Could not parse reflection: ${raw.slice(0, 100)}`
123
+ };
124
+ } catch (error) {
125
+ logger.warn(
126
+ {
127
+ src: "inbox-reflection",
128
+ error: error instanceof Error ? error.message : String(error)
129
+ },
130
+ "[InboxReflection] auto-reply reflection failed"
131
+ );
132
+ return {
133
+ approved: false,
134
+ reasoning: "Reflection check failed; blocking auto-reply for safety"
135
+ };
136
+ }
137
+ }
138
+ export {
139
+ reflectOnAutoReply,
140
+ reflectOnSendConfirmation
141
+ };
142
+ //# sourceMappingURL=reflection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/inbox/reflection.ts"],"sourcesContent":["import type { IAgentRuntime } from \"@elizaos/core\";\nimport {\n logger,\n ModelType,\n parseJsonModelRecord,\n runWithTrajectoryContext,\n} from \"@elizaos/core\";\n\nfunction parseReflectionObject(raw: string): Record<string, unknown> | null {\n const parsedJson = parseJsonModelRecord<Record<string, unknown>>(raw);\n if (parsedJson && typeof parsedJson === \"object\") {\n return parsedJson;\n }\n return null;\n}\n\nfunction promptLine(value: string): string {\n const normalized = value.replace(/\\s+/g, \" \").trim();\n return normalized.length > 0 ? normalized : \"(empty)\";\n}\n\nfunction readBoolean(value: unknown): boolean {\n if (typeof value === \"boolean\") {\n return value;\n }\n return typeof value === \"string\" && value.trim().toLowerCase() === \"true\";\n}\n\nfunction readReasoning(value: unknown): string {\n return typeof value === \"string\" && value.trim().length > 0\n ? value.trim()\n : \"No reasoning provided\";\n}\n\n// ---------------------------------------------------------------------------\n// Send confirmation reflection\n// ---------------------------------------------------------------------------\n\n/**\n * Before sending a drafted response, run a reflection LLM call to verify\n * the owner actually confirmed the send. This catches ambiguous messages\n * like \"sure\" (which could be a response to something else) or \"wait\"\n * that might be misinterpreted as confirmation.\n *\n * Returns true if the reflection confirms the owner intended to send.\n */\nexport async function reflectOnSendConfirmation(\n runtime: IAgentRuntime,\n opts: {\n /** The owner's most recent message. */\n userMessage: string;\n /** The drafted response text that would be sent. */\n draftText: string;\n /** Where it would be sent. */\n channelName: string;\n /** Who it would be sent to. */\n recipientName: string;\n },\n): Promise<{ confirmed: boolean; reasoning: string }> {\n const prompt = [\n \"Safety check for an inbox response system. Determine\",\n \"whether the user has clearly confirmed they want to send a drafted message.\",\n \"\",\n \"Pending draft:\",\n `draftText: ${promptLine(opts.draftText)}`,\n `recipientName: ${promptLine(opts.recipientName)}`,\n `channelName: ${promptLine(opts.channelName)}`,\n \"\",\n \"Owner message:\",\n `userMessage: ${promptLine(opts.userMessage)}`,\n \"\",\n \"Determine if the user CLEARLY confirmed they want this message sent.\",\n \"Confirmation signals: 'yes', 'send it', 'go ahead', 'looks good, send it', 'confirm'\",\n \"Rejection signals: 'no', 'wait', 'hold on', 'change it', 'actually...', 'not now'\",\n \"Ambiguous (treat as NOT confirmed): single words that could mean anything, unrelated responses\",\n \"\",\n 'Return JSON only, for example {\"confirmed\":true,\"reasoning\":\"brief explanation\"}.',\n ].join(\"\\n\");\n\n try {\n const result = await runWithTrajectoryContext(\n { purpose: \"lifeops-inbox-reflect-autoreply\" },\n () => runtime.useModel(ModelType.TEXT_SMALL, { prompt }),\n );\n const raw = typeof result === \"string\" ? result : \"\";\n const parsed = parseReflectionObject(raw);\n if (parsed) {\n return {\n confirmed: readBoolean(parsed.confirmed),\n reasoning: readReasoning(parsed.reasoning),\n };\n }\n return {\n confirmed: false,\n reasoning: `Could not parse reflection: ${raw.slice(0, 100)}`,\n };\n } catch (error) {\n logger.warn(\n {\n src: \"inbox-reflection\",\n error: error instanceof Error ? error.message : String(error),\n },\n \"[InboxReflection] send confirmation reflection failed\",\n );\n // On error, default to NOT confirmed (safer)\n return {\n confirmed: false,\n reasoning:\n \"Reflection check failed; defaulting to not confirmed for safety\",\n };\n }\n}\n\n// ---------------------------------------------------------------------------\n// Auto-reply safety reflection\n// ---------------------------------------------------------------------------\n\n/**\n * Before auto-sending a reply without explicit owner confirmation, run a\n * reflection check to verify the response is appropriate and safe.\n */\nexport async function reflectOnAutoReply(\n runtime: IAgentRuntime,\n opts: {\n /** The original inbound message. */\n inboundText: string;\n /** The proposed auto-reply. */\n replyText: string;\n /** Source channel. */\n source: string;\n /** Sender name. */\n senderName: string;\n },\n): Promise<{ approved: boolean; reasoning: string }> {\n const prompt = [\n \"Safety check for an auto-reply system. The system wants to automatically\",\n \"send a reply WITHOUT explicit owner confirmation. Determine if this\",\n \"auto-reply is appropriate and safe to send.\",\n \"\",\n \"Inbound message:\",\n `senderName: ${promptLine(opts.senderName)}`,\n `source: ${promptLine(opts.source)}`,\n `inboundText: ${promptLine(opts.inboundText)}`,\n \"\",\n \"Proposed reply:\",\n `replyText: ${promptLine(opts.replyText)}`,\n \"\",\n \"Approve the auto-reply ONLY if ALL of these are true:\",\n \"1. The reply is factually neutral and unlikely to cause harm\",\n \"2. The reply doesn't make promises, commitments, or share sensitive info\",\n \"3. The reply is appropriate for the tone and context of the conversation\",\n \"4. The reply doesn't reveal private information about the owner\",\n \"5. The message is routine (acknowledgement, simple greeting, basic info)\",\n \"\",\n \"Reject if ANY of these are true:\",\n \"- The reply contains opinions, decisions, or commitments\",\n \"- The conversation topic is sensitive (financial, legal, personal)\",\n \"- The reply could be embarrassing or inappropriate\",\n \"- The sender seems upset or the conversation is heated\",\n \"\",\n 'Return JSON only, for example {\"approved\":true,\"reasoning\":\"brief explanation\"}.',\n ].join(\"\\n\");\n\n try {\n const result = await runWithTrajectoryContext(\n { purpose: \"lifeops-inbox-reflect-send\" },\n () => runtime.useModel(ModelType.TEXT_SMALL, { prompt }),\n );\n const raw = typeof result === \"string\" ? result : \"\";\n const parsed = parseReflectionObject(raw);\n if (parsed) {\n return {\n approved: readBoolean(parsed.approved),\n reasoning: readReasoning(parsed.reasoning),\n };\n }\n\n return {\n approved: false,\n reasoning: `Could not parse reflection: ${raw.slice(0, 100)}`,\n };\n } catch (error) {\n logger.warn(\n {\n src: \"inbox-reflection\",\n error: error instanceof Error ? error.message : String(error),\n },\n \"[InboxReflection] auto-reply reflection failed\",\n );\n return {\n approved: false,\n reasoning: \"Reflection check failed; blocking auto-reply for safety\",\n };\n }\n}\n"],"mappings":"AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,sBAAsB,KAA6C;AAC1E,QAAM,aAAa,qBAA8C,GAAG;AACpE,MAAI,cAAc,OAAO,eA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A,QACE,KAAK;AAAA,QACL,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,MAC9D;AAAA,MACA;AAAA,IACF;AACA,WAAO;AAAA,MACL,UAAU;AAAA,MACV,WAAW;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,58 @@
1
+ import type { IAgentRuntime } from "@elizaos/core";
2
+ import type { OwnerAction, TriageClassification, TriageEntry, TriageExample, TriageUrgency } from "./types.js";
3
+ export declare class InboxRepository {
4
+ private runtime;
5
+ constructor(runtime: IAgentRuntime);
6
+ private get agentId();
7
+ storeTriage(opts: {
8
+ source: string;
9
+ sourceRoomId?: string;
10
+ sourceEntityId?: string;
11
+ sourceMessageId?: string;
12
+ channelName: string;
13
+ channelType: string;
14
+ deepLink?: string;
15
+ classification: TriageClassification;
16
+ urgency: TriageUrgency;
17
+ confidence: number;
18
+ snippet: string;
19
+ senderName?: string;
20
+ threadContext?: string[];
21
+ triageReasoning?: string;
22
+ suggestedResponse?: string;
23
+ }): Promise<TriageEntry>;
24
+ getUnresolved(opts?: {
25
+ limit?: number;
26
+ }): Promise<TriageEntry[]>;
27
+ getUnresolvedForSender(opts: {
28
+ sourceEntityId?: string | null;
29
+ senderName?: string | null;
30
+ excludeSource?: string | null;
31
+ limit?: number;
32
+ }): Promise<TriageEntry[]>;
33
+ getByClassification(classification: TriageClassification, opts?: {
34
+ limit?: number;
35
+ unresolvedOnly?: boolean;
36
+ }): Promise<TriageEntry[]>;
37
+ getById(id: string): Promise<TriageEntry | null>;
38
+ getBySourceMessageId(sourceMessageId: string): Promise<TriageEntry | null>;
39
+ getBySourceMessageIds(sourceMessageIds: string[]): Promise<Set<string>>;
40
+ markResolved(id: string, opts?: {
41
+ draftResponse?: string;
42
+ autoReplied?: boolean;
43
+ }): Promise<void>;
44
+ getRecentForDigest(sinceIso: string): Promise<TriageEntry[]>;
45
+ getRecentAutoReplies(limit?: number): Promise<TriageEntry[]>;
46
+ countAutoRepliesSince(sinceIso: string): Promise<number>;
47
+ cleanupOlderThan(olderThanIso: string): Promise<number>;
48
+ storeExample(opts: {
49
+ source: string;
50
+ snippet: string;
51
+ classification: TriageClassification;
52
+ ownerAction: OwnerAction;
53
+ ownerClassification?: TriageClassification;
54
+ contextJson?: Record<string, unknown>;
55
+ }): Promise<TriageExample>;
56
+ getExamples(limit?: number): Promise<TriageExample[]>;
57
+ }
58
+ //# sourceMappingURL=repository.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../src/inbox/repository.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAanD,OAAO,KAAK,EACV,WAAW,EACX,oBAAoB,EACpB,WAAW,EACX,aAAa,EACb,aAAa,EACd,MAAM,YAAY,CAAC;AA6IpB,qBAAa,eAAe;IACd,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAE1C,OAAO,KAAK,OAAO,GAElB;IAIK,WAAW,CAAC,IAAI,EAAE;QACtB,MAAM,EAAE,MAAM,CAAC;QACf,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,WAAW,EAAE,MAAM,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,oBAAoB,CAAC;QACrC,OAAO,EAAE,aAAa,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,OAAO,CAAC,WAAW,CAAC;IAmDlB,aAAa,CAAC,IAAI,CAAC,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