@kingcrab/pi-imessage 0.0.42 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +101 -108
- package/dist/agent/behavior.js +79 -0
- package/dist/agent/chats.js +67 -0
- package/dist/agent/commands.js +163 -0
- package/dist/agent/compaction.js +51 -0
- package/dist/agent/deliver.js +139 -0
- package/dist/agent/direct-send.js +68 -0
- package/dist/agent/harness.js +79 -0
- package/dist/agent/health.js +32 -0
- package/dist/agent/models.js +69 -0
- package/dist/agent/progress-format.js +87 -0
- package/dist/agent/progress.js +135 -0
- package/dist/agent/prompt.js +79 -0
- package/dist/agent/replies.js +9 -0
- package/dist/agent/run.js +159 -0
- package/dist/agent/scheduling.js +290 -0
- package/dist/agent/time.js +18 -0
- package/dist/cli.js +88 -191
- package/dist/config/settings.js +60 -0
- package/dist/extensions/browser.js +326 -0
- package/dist/extensions/final-text.js +23 -0
- package/dist/extensions/memory.js +109 -0
- package/dist/extensions/message.js +33 -0
- package/dist/extensions/read-image.js +72 -0
- package/dist/extensions/schedules.js +41 -0
- package/dist/extensions/subagent.js +54 -0
- package/dist/extensions/web.js +99 -0
- package/dist/extensions/workspace.js +98 -0
- package/dist/main.js +571 -74
- package/dist/transport/attachments.js +37 -0
- package/dist/transport/http.js +110 -0
- package/dist/{rich-text.js → transport/rich-text.js} +25 -13
- package/dist/{send.js → transport/send.js} +13 -13
- package/dist/transport/watch.js +124 -0
- package/dist/web/app.js +748 -0
- package/dist/web/history.js +87 -0
- package/dist/web/memory.js +81 -0
- package/dist/web/page.js +28 -0
- package/dist/web/schedules.js +74 -0
- package/dist/web/server.js +348 -0
- package/dist/web/style.css +543 -0
- package/dist/web/tasks.js +63 -0
- package/docs/adr/0001-durable-owns-state.md +11 -0
- package/docs/adr/0002-module-layering.md +11 -0
- package/docs/adr/0003-replies-at-most-once.md +11 -0
- package/docs/adr/0004-native-extensions.md +11 -0
- package/docs/adr/0005-history-migration.md +11 -0
- package/docs/adr/0006-jsonl-storage.md +11 -0
- package/docs/adr/0007-images-by-path.md +11 -0
- package/docs/adr/0008-compaction-and-run.md +11 -0
- package/docs/adr/0009-one-shot-cutover.md +11 -0
- package/docs/adr/0010-test-budget.md +11 -0
- package/docs/adr/0011-reconcile-unsent-answers.md +24 -0
- package/docs/adr/0012-run-in-owned-conversation.md +22 -0
- package/docs/adr/0013-thin-adapters-around-durable.md +18 -0
- package/docs/adr/0014-ephemeral-private-storage.md +13 -0
- package/docs/adr/0015-ordinary-stop-keeps-native-inbox.md +21 -0
- package/docs/adr/0016-process-http-transport.md +21 -0
- package/docs/adr/0017-browser-cli-owned-scope.md +22 -0
- package/docs/adr/0018-tasks-without-prompt-api.md +19 -0
- package/docs/adr/0019-remove-scheduled-services.md +41 -0
- package/docs/adr/0020-chat-task-progress.md +41 -0
- package/docs/adr/0021-readable-progress-without-link-previews.md +33 -0
- package/docs/adr/0022-progress-admission-and-settlement.md +35 -0
- package/docs/adr/0023-retain-progress-type-prefixes.md +18 -0
- package/docs/adr/0024-status-marker-before-type-prefix.md +13 -0
- package/docs/adr/0025-reusable-progress-and-command-preview.md +49 -0
- package/docs/adr/0026-inline-command-only-requests.md +16 -0
- package/docs/adr/0027-command-preview-width.md +10 -0
- package/docs/adr/0028-command-preview-120.md +8 -0
- package/docs/adr/0030-shared-web-read-cache.md +33 -0
- package/docs/adr/0031-quiet-compaction-progress.md +32 -0
- package/docs/adr/0032-native-background-schedules.md +58 -0
- package/docs/adr/0033-operator-scheduled-run.md +23 -0
- package/docs/adr/0034-machine-local-schedule-time.md +36 -0
- package/docs/adr/0035-external-business-task-extensions.md +56 -0
- package/docs/adr/0036-workspace-policy-and-neutral-service-id.md +37 -0
- package/docs/adr/0037-restart-during-in-flight-work.md +30 -0
- package/docs/adr/0038-restart-any-time.md +25 -0
- package/docs/adr/0039-rerun-interrupted-tools.md +24 -0
- package/docs/adr/0040-chat-progress-notices.md +44 -0
- package/docs/adr/0041-restart-and-recovery.md +28 -0
- package/docs/adr/0042-background-schedules-and-workspace-extensions.md +44 -0
- package/docs/adr/0043-remove-legacy-migration.md +23 -0
- package/docs/adr/0044-message-channels.md +32 -0
- package/docs/adr/0045-chat-scheduling-tools.md +51 -0
- package/docs/adr/0046-selective-command-redaction.md +31 -0
- package/docs/adr/0047-one-scheduling-path.md +158 -0
- package/docs/adr/README.md +50 -0
- package/docs/api.md +92 -0
- package/docs/architecture.md +164 -0
- package/docs/browser.md +93 -0
- package/docs/memory.md +27 -0
- package/docs/screenshot.png +0 -0
- package/docs/workspace-extensions.md +133 -0
- package/examples/workspace-extensions/system-context/index.ts +69 -0
- package/examples/workspace-extensions/system-context/package.json +3 -0
- package/ops/README.md +267 -0
- package/ops/preflight.mjs +28 -0
- package/package.json +33 -45
- package/dist/agent.d.ts +0 -60
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -715
- package/dist/agent.js.map +0 -1
- package/dist/cli.d.ts +0 -15
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/imessage.d.ts +0 -33
- package/dist/imessage.d.ts.map +0 -1
- package/dist/imessage.js +0 -76
- package/dist/imessage.js.map +0 -1
- package/dist/logger.d.ts +0 -33
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -104
- package/dist/logger.js.map +0 -1
- package/dist/main.d.ts +0 -5
- package/dist/main.d.ts.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/memory.d.ts +0 -53
- package/dist/memory.d.ts.map +0 -1
- package/dist/memory.js +0 -196
- package/dist/memory.js.map +0 -1
- package/dist/model-health.d.ts +0 -11
- package/dist/model-health.d.ts.map +0 -1
- package/dist/model-health.js +0 -67
- package/dist/model-health.js.map +0 -1
- package/dist/pipeline.d.ts +0 -27
- package/dist/pipeline.d.ts.map +0 -1
- package/dist/pipeline.js +0 -59
- package/dist/pipeline.js.map +0 -1
- package/dist/queue.d.ts +0 -23
- package/dist/queue.d.ts.map +0 -1
- package/dist/queue.js +0 -89
- package/dist/queue.js.map +0 -1
- package/dist/rich-text.d.ts +0 -26
- package/dist/rich-text.d.ts.map +0 -1
- package/dist/rich-text.js.map +0 -1
- package/dist/self-echo.d.ts +0 -19
- package/dist/self-echo.d.ts.map +0 -1
- package/dist/self-echo.js +0 -54
- package/dist/self-echo.js.map +0 -1
- package/dist/send.d.ts +0 -24
- package/dist/send.d.ts.map +0 -1
- package/dist/send.js.map +0 -1
- package/dist/settings.d.ts +0 -44
- package/dist/settings.d.ts.map +0 -1
- package/dist/settings.js +0 -80
- package/dist/settings.js.map +0 -1
- package/dist/store.d.ts +0 -57
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -124
- package/dist/store.js.map +0 -1
- package/dist/tasks.d.ts +0 -95
- package/dist/tasks.d.ts.map +0 -1
- package/dist/tasks.js +0 -384
- package/dist/tasks.js.map +0 -1
- package/dist/types.d.ts +0 -93
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/watch.d.ts +0 -21
- package/dist/watch.d.ts.map +0 -1
- package/dist/watch.js +0 -219
- package/dist/watch.js.map +0 -1
- package/dist/web/data.d.ts +0 -11
- package/dist/web/data.d.ts.map +0 -1
- package/dist/web/data.js +0 -56
- package/dist/web/data.js.map +0 -1
- package/dist/web/html.d.ts +0 -5
- package/dist/web/html.d.ts.map +0 -1
- package/dist/web/html.js +0 -16
- package/dist/web/html.js.map +0 -1
- package/dist/web/index.d.ts +0 -23
- package/dist/web/index.d.ts.map +0 -1
- package/dist/web/index.js +0 -279
- package/dist/web/index.js.map +0 -1
- package/dist/web/render.d.ts +0 -11
- package/dist/web/render.d.ts.map +0 -1
- package/dist/web/render.js +0 -56
- package/dist/web/render.js.map +0 -1
- package/dist/web/templates/logs.eta +0 -75
- package/dist/web/templates/memory.eta +0 -91
- package/dist/web/templates/page.eta +0 -98
package/dist/settings.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Settings — workspace-level configuration for the iMessage bot.
|
|
3
|
-
*
|
|
4
|
-
* Loaded from ~/.pi/imessage/settings.json (or WORKING_DIR/settings.json).
|
|
5
|
-
*
|
|
6
|
-
* ### Chat allowlist
|
|
7
|
-
*
|
|
8
|
-
* Controls whether the bot should reply to a given chat.
|
|
9
|
-
* Messages are always logged regardless of this setting.
|
|
10
|
-
*
|
|
11
|
-
* Resolution priority (highest to lowest):
|
|
12
|
-
*
|
|
13
|
-
* blacklist["chatGuid"] > whitelist["chatGuid"] > blacklist["*"] > whitelist["*"]
|
|
14
|
-
*
|
|
15
|
-
* Examples:
|
|
16
|
-
* whitelist: ["*"], blacklist: [] → reply to everyone
|
|
17
|
-
* whitelist: ["1"], blacklist: [] → reply only to "1"
|
|
18
|
-
* whitelist: ["*"], blacklist: ["2"] → reply to everyone except "2"
|
|
19
|
-
* blacklist: ["*"], whitelist: [] → reply to nobody (log-only)
|
|
20
|
-
* whitelist: ["1"], blacklist: ["*"] → reply only to "1"
|
|
21
|
-
* whitelist: ["1"], blacklist: ["1"] → no reply (blacklist wins)
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
25
|
-
import { join } from "node:path";
|
|
26
|
-
const DEFAULT_CHAT_ALLOWLIST = { whitelist: [], blacklist: ["*"] };
|
|
27
|
-
const DEFAULT_RICH_TEXT = { enabled: false, markdown: true };
|
|
28
|
-
const DEFAULT_SETTINGS = { chatAllowlist: DEFAULT_CHAT_ALLOWLIST, richText: DEFAULT_RICH_TEXT };
|
|
29
|
-
/**
|
|
30
|
-
* Determine whether the bot should reply to a given chatGuid.
|
|
31
|
-
*
|
|
32
|
-
* Priority: blacklist[chatGuid] > whitelist[chatGuid] > blacklist["*"] > whitelist["*"]
|
|
33
|
-
*/
|
|
34
|
-
export function isReplyEnabled(settings, chatGuid) {
|
|
35
|
-
const { whitelist, blacklist } = settings.chatAllowlist;
|
|
36
|
-
if (blacklist.includes(chatGuid))
|
|
37
|
-
return false;
|
|
38
|
-
if (whitelist.includes(chatGuid))
|
|
39
|
-
return true;
|
|
40
|
-
if (blacklist.includes("*"))
|
|
41
|
-
return false;
|
|
42
|
-
if (whitelist.includes("*"))
|
|
43
|
-
return true;
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
// ── Persistence ───────────────────────────────────────────────────────────────
|
|
47
|
-
function settingsPath(workingDir) {
|
|
48
|
-
return join(workingDir, "settings.json");
|
|
49
|
-
}
|
|
50
|
-
export function readSettings(workingDir) {
|
|
51
|
-
const filePath = settingsPath(workingDir);
|
|
52
|
-
if (!existsSync(filePath))
|
|
53
|
-
return { ...DEFAULT_SETTINGS };
|
|
54
|
-
try {
|
|
55
|
-
const raw = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
56
|
-
const chatAllowlistRaw = (raw.chatAllowlist ?? {});
|
|
57
|
-
const richTextRaw = (raw.richText ?? {});
|
|
58
|
-
return {
|
|
59
|
-
chatAllowlist: {
|
|
60
|
-
whitelist: Array.isArray(chatAllowlistRaw.whitelist)
|
|
61
|
-
? chatAllowlistRaw.whitelist
|
|
62
|
-
: DEFAULT_CHAT_ALLOWLIST.whitelist,
|
|
63
|
-
blacklist: Array.isArray(chatAllowlistRaw.blacklist)
|
|
64
|
-
? chatAllowlistRaw.blacklist
|
|
65
|
-
: DEFAULT_CHAT_ALLOWLIST.blacklist,
|
|
66
|
-
},
|
|
67
|
-
richText: {
|
|
68
|
-
enabled: typeof richTextRaw.enabled === "boolean" ? richTextRaw.enabled : DEFAULT_RICH_TEXT.enabled,
|
|
69
|
-
markdown: typeof richTextRaw.markdown === "boolean" ? richTextRaw.markdown : DEFAULT_RICH_TEXT.markdown,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
catch {
|
|
74
|
-
return { ...DEFAULT_SETTINGS };
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
export function writeSettings(workingDir, settings) {
|
|
78
|
-
writeFileSync(settingsPath(workingDir), `${JSON.stringify(settings, null, 2)}\n`, "utf-8");
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=settings.js.map
|
package/dist/settings.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../src/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAiBjC,MAAM,sBAAsB,GAAkB,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;AAClF,MAAM,iBAAiB,GAAqB,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC/E,MAAM,gBAAgB,GAAa,EAAE,aAAa,EAAE,sBAAsB,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC;AAE1G;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,QAAkB,EAAE,QAAgB;IAClE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC;IACxD,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC1C,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO,KAAK,CAAC;AACd,CAAC;AAED,iFAAiF;AAEjF,SAAS,YAAY,CAAC,UAAkB;IACvC,OAAO,IAAI,CAAC,UAAU,EA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aAAa,CAAC,UAAkB,EAAE,QAAkB;IACnE,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC5F,CAAC"}
|
package/dist/store.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ChatStore — persistent message log for each iMessage chat.
|
|
3
|
-
*
|
|
4
|
-
* Workspace layout:
|
|
5
|
-
*
|
|
6
|
-
* workingDir/
|
|
7
|
-
* <chatGuid>/ e.g. "iMessage;-;+16501234567"
|
|
8
|
-
* log.jsonl one JSON line per message, append-only
|
|
9
|
-
*
|
|
10
|
-
* Each line is a Message serialised as JSON.
|
|
11
|
-
* The file is never rewritten — only appended to.
|
|
12
|
-
*/
|
|
13
|
-
import type { IncomingMessage, MessageType } from "./types.js";
|
|
14
|
-
/**
|
|
15
|
-
* A message in a chat — user or bot.
|
|
16
|
-
*
|
|
17
|
-
* Both incoming (fromAgent=false) and outgoing (fromAgent=true) messages share
|
|
18
|
-
* the same shape; the only structural difference is the sender.
|
|
19
|
-
*/
|
|
20
|
-
export interface Message {
|
|
21
|
-
/** ISO 8601 timestamp. */
|
|
22
|
-
date: string;
|
|
23
|
-
/** Sender handle (phone / email), or "bot" for agent replies. */
|
|
24
|
-
sender: string;
|
|
25
|
-
text: string | null;
|
|
26
|
-
/** Local paths of attachments, relative to workingDir. */
|
|
27
|
-
attachments: string[];
|
|
28
|
-
fromAgent: boolean;
|
|
29
|
-
messageType: MessageType;
|
|
30
|
-
/** Group name, only present when messageType is "group". */
|
|
31
|
-
groupName?: string;
|
|
32
|
-
}
|
|
33
|
-
/** Sender label for display: "bot" for agent messages, otherwise the raw sender handle. */
|
|
34
|
-
export declare function senderLabel(message: Message): string;
|
|
35
|
-
/** Collapse multiline text to its first line with "..." appended. */
|
|
36
|
-
export declare function firstLinePreview(text: string | null): string;
|
|
37
|
-
export interface ChatStoreConfig {
|
|
38
|
-
workingDir: string;
|
|
39
|
-
}
|
|
40
|
-
export interface ArchivedImageRecord {
|
|
41
|
-
date: string;
|
|
42
|
-
day: string;
|
|
43
|
-
sender: string;
|
|
44
|
-
chatGuid: string;
|
|
45
|
-
originalPath: string;
|
|
46
|
-
archivedPath: string;
|
|
47
|
-
mimeType: string | null;
|
|
48
|
-
sha256: string;
|
|
49
|
-
sizeBytes: number;
|
|
50
|
-
text: string | null;
|
|
51
|
-
}
|
|
52
|
-
export interface ChatStore {
|
|
53
|
-
log(chatGuid: string, message: Omit<Message, "date">): Promise<void>;
|
|
54
|
-
archiveImages(chatGuid: string, incoming: IncomingMessage): Promise<ArchivedImageRecord[]>;
|
|
55
|
-
}
|
|
56
|
-
export declare function createChatStore(config: ChatStoreConfig): ChatStore;
|
|
57
|
-
//# sourceMappingURL=store.d.ts.map
|
package/dist/store.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAI/D;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACvB,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,0DAA0D;IAC1D,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAID,2FAA2F;AAC3F,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAI5D;AAoCD,MAAM,WAAW,eAAe;IAC/B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACzB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC;CAC3F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,CA4ElE"}
|
package/dist/store.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ChatStore — persistent message log for each iMessage chat.
|
|
3
|
-
*
|
|
4
|
-
* Workspace layout:
|
|
5
|
-
*
|
|
6
|
-
* workingDir/
|
|
7
|
-
* <chatGuid>/ e.g. "iMessage;-;+16501234567"
|
|
8
|
-
* log.jsonl one JSON line per message, append-only
|
|
9
|
-
*
|
|
10
|
-
* Each line is a Message serialised as JSON.
|
|
11
|
-
* The file is never rewritten — only appended to.
|
|
12
|
-
*/
|
|
13
|
-
import { createHash } from "node:crypto";
|
|
14
|
-
import { existsSync, mkdirSync } from "node:fs";
|
|
15
|
-
import { appendFile, copyFile, readFile, stat } from "node:fs/promises";
|
|
16
|
-
import { extname, join, relative } from "node:path";
|
|
17
|
-
// ── Display helpers ───────────────────────────────────────────────────────────
|
|
18
|
-
/** Sender label for display: "bot" for agent messages, otherwise the raw sender handle. */
|
|
19
|
-
export function senderLabel(message) {
|
|
20
|
-
return message.fromAgent ? "bot" : message.sender;
|
|
21
|
-
}
|
|
22
|
-
/** Collapse multiline text to its first line with "..." appended. */
|
|
23
|
-
export function firstLinePreview(text) {
|
|
24
|
-
const full = text && text.trim() !== "" ? text : "[image]";
|
|
25
|
-
const firstLine = full.split("\n")[0] ?? "";
|
|
26
|
-
return full.includes("\n") ? `${firstLine}...` : full;
|
|
27
|
-
}
|
|
28
|
-
function localDay(date) {
|
|
29
|
-
const year = date.getFullYear();
|
|
30
|
-
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
31
|
-
const day = String(date.getDate()).padStart(2, "0");
|
|
32
|
-
return `${year}-${month}-${day}`;
|
|
33
|
-
}
|
|
34
|
-
function extensionFor(mimeType, path) {
|
|
35
|
-
const fromPath = extname(path);
|
|
36
|
-
if (fromPath)
|
|
37
|
-
return fromPath.toLowerCase();
|
|
38
|
-
switch (mimeType) {
|
|
39
|
-
case "image/jpeg":
|
|
40
|
-
return ".jpg";
|
|
41
|
-
case "image/png":
|
|
42
|
-
return ".png";
|
|
43
|
-
case "image/gif":
|
|
44
|
-
return ".gif";
|
|
45
|
-
case "image/webp":
|
|
46
|
-
return ".webp";
|
|
47
|
-
case "image/heic":
|
|
48
|
-
return ".heic";
|
|
49
|
-
case "image/heif":
|
|
50
|
-
return ".heif";
|
|
51
|
-
default:
|
|
52
|
-
return ".img";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
function safeSegment(value) {
|
|
56
|
-
return value.replace(/[^a-zA-Z0-9._+-]+/g, "_").slice(0, 80) || "unknown";
|
|
57
|
-
}
|
|
58
|
-
export function createChatStore(config) {
|
|
59
|
-
const { workingDir } = config;
|
|
60
|
-
if (!existsSync(workingDir)) {
|
|
61
|
-
mkdirSync(workingDir, { recursive: true });
|
|
62
|
-
}
|
|
63
|
-
function chatDir(chatGuid) {
|
|
64
|
-
const dir = join(workingDir, chatGuid);
|
|
65
|
-
if (!existsSync(dir)) {
|
|
66
|
-
mkdirSync(dir, { recursive: true });
|
|
67
|
-
}
|
|
68
|
-
return dir;
|
|
69
|
-
}
|
|
70
|
-
function logPath(chatGuid) {
|
|
71
|
-
return join(chatDir(chatGuid), "log.jsonl");
|
|
72
|
-
}
|
|
73
|
-
async function append(chatGuid, message) {
|
|
74
|
-
await appendFile(logPath(chatGuid), `${JSON.stringify(message)}\n`, "utf-8");
|
|
75
|
-
}
|
|
76
|
-
async function archiveImages(chatGuid, incoming) {
|
|
77
|
-
const now = new Date();
|
|
78
|
-
const date = now.toISOString();
|
|
79
|
-
const day = localDay(now);
|
|
80
|
-
const imageDir = join(chatDir(chatGuid), "images", day);
|
|
81
|
-
mkdirSync(imageDir, { recursive: true });
|
|
82
|
-
const records = [];
|
|
83
|
-
for (const attachment of incoming.attachments) {
|
|
84
|
-
if (!attachment.mimeType?.startsWith("image/"))
|
|
85
|
-
continue;
|
|
86
|
-
const originalPath = attachment.path;
|
|
87
|
-
const bytes = await readFile(originalPath);
|
|
88
|
-
const sha256 = createHash("sha256").update(bytes).digest("hex");
|
|
89
|
-
const extension = extensionFor(attachment.mimeType, originalPath);
|
|
90
|
-
const filename = `${date.replace(/[:.]/g, "-")}-${safeSegment(incoming.sender)}-${sha256.slice(0, 12)}${extension}`;
|
|
91
|
-
const archivedAbsPath = join(imageDir, filename);
|
|
92
|
-
if (!existsSync(archivedAbsPath)) {
|
|
93
|
-
await copyFile(attachment.path, archivedAbsPath);
|
|
94
|
-
}
|
|
95
|
-
const sizeBytes = (await stat(archivedAbsPath)).size;
|
|
96
|
-
const archivedPath = relative(workingDir, archivedAbsPath);
|
|
97
|
-
attachment.path = archivedAbsPath;
|
|
98
|
-
records.push({
|
|
99
|
-
date,
|
|
100
|
-
day,
|
|
101
|
-
sender: incoming.sender,
|
|
102
|
-
chatGuid,
|
|
103
|
-
originalPath,
|
|
104
|
-
archivedPath,
|
|
105
|
-
mimeType: attachment.mimeType,
|
|
106
|
-
sha256,
|
|
107
|
-
sizeBytes,
|
|
108
|
-
text: incoming.text,
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
if (records.length > 0) {
|
|
112
|
-
const indexPath = join(chatDir(chatGuid), "images", "index.jsonl");
|
|
113
|
-
await appendFile(indexPath, `${records.map((record) => JSON.stringify(record)).join("\n")}\n`, "utf-8");
|
|
114
|
-
}
|
|
115
|
-
return records;
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
async log(chatGuid, message) {
|
|
119
|
-
await append(chatGuid, { date: new Date().toISOString(), ...message });
|
|
120
|
-
},
|
|
121
|
-
archiveImages,
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=store.js.map
|
package/dist/store.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAyBpD,iFAAiF;AAEjF,2FAA2F;AAC3F,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC3C,OAAO,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACnD,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,gBAAgB,CAAC,IAAm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AElC,OAAO,CAAC,IAAI,CAAC;gBACZ,IAAI;gBACJ,GAAG;gBACH,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,QAAQ;gBACR,YAAY;gBACZ,YAAY;gBACZ,QAAQ,EAAE,UAAU,CAAC,QAAQ;gBAC7B,MAAM;gBACN,SAAS;gBACT,IAAI,EAAE,QAAQ,CAAC,IAAI;aACnB,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;YACnE,MAAM,UAAU,CAAC,SAAS,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACzG,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;IAED,OAAO;QACN,KAAK,CAAC,GAAG,CAAC,QAAgB,EAAE,OAA8B;YACzD,MAAM,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,aAAa;KACb,CAAC;AACH,CAAC"}
|
package/dist/tasks.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pipeline task factories — each function creates a task for a specific
|
|
3
|
-
* pipeline phase. Tasks are pure functions with injected dependencies;
|
|
4
|
-
* the bot registers them without containing any business logic itself.
|
|
5
|
-
*
|
|
6
|
-
* before:
|
|
7
|
-
* logIncoming — logs the received message
|
|
8
|
-
* dropSelfEcho — drops messages that are echoes of the bot's own replies
|
|
9
|
-
* archiveImages — copies image attachments into chat/images/YYYY-MM-DD
|
|
10
|
-
* storeIncoming — persists the incoming message to log.jsonl
|
|
11
|
-
* checkReplyEnabled — drops messages when reply is disabled by settings
|
|
12
|
-
* downloadImages — reads image attachments from disk and populates incoming.images
|
|
13
|
-
* resizeImages — normalizes images for model-compatible input via macOS sips
|
|
14
|
-
*
|
|
15
|
-
* start:
|
|
16
|
-
* commandHandler — intercepts slash commands (/help, /new, /status, /reload) before the agent
|
|
17
|
-
* callAgent — sends the message to the agent and yields replies as they arrive
|
|
18
|
-
*
|
|
19
|
-
* end:
|
|
20
|
-
* sendReply — remembers echo, sends reply via Messages.app
|
|
21
|
-
* logOutgoing — logs the outgoing reply
|
|
22
|
-
* storeOutgoing — persists the outgoing reply to log.jsonl
|
|
23
|
-
*/
|
|
24
|
-
import type { AgentManager } from "./agent.js";
|
|
25
|
-
import type { DigestLogger } from "./logger.js";
|
|
26
|
-
import type { BeforeTask, EndTask, StartTask } from "./pipeline.js";
|
|
27
|
-
import type { SelfEchoFilter } from "./self-echo.js";
|
|
28
|
-
import type { MessageSender } from "./send.js";
|
|
29
|
-
import type { Settings } from "./settings.js";
|
|
30
|
-
import type { ChatStore } from "./store.js";
|
|
31
|
-
/**
|
|
32
|
-
* Log the incoming message to console. Always passes through.
|
|
33
|
-
*
|
|
34
|
-
* Examples:
|
|
35
|
-
* [sid] <- [DM] +16501234567: hey what's up
|
|
36
|
-
* [sid] <- [SMS] +16501234567: can you call me
|
|
37
|
-
* [sid] <- [GROUP] Family|+16501234567: dinner at 6? [2 attachment(s)]
|
|
38
|
-
*/
|
|
39
|
-
export declare function createLogIncomingTask(digestLogger: DigestLogger): BeforeTask;
|
|
40
|
-
/** Copy image attachments into the chat workspace and update their paths before logging/reading. */
|
|
41
|
-
export declare function createArchiveImagesTask(store: ChatStore): BeforeTask;
|
|
42
|
-
/** Persist the incoming message to log.jsonl. Always passes through. */
|
|
43
|
-
export declare function createStoreIncomingTask(store: ChatStore): BeforeTask;
|
|
44
|
-
/** Drop messages that are echoes of the bot's own replies. */
|
|
45
|
-
export declare function createDropSelfEchoTask(echoFilter: SelfEchoFilter): BeforeTask;
|
|
46
|
-
/**
|
|
47
|
-
* Drop messages when reply is disabled for this chat by settings.
|
|
48
|
-
*
|
|
49
|
-
* Resolution priority (highest to lowest):
|
|
50
|
-
* blacklist["chatGuid"] > whitelist["chatGuid"] > blacklist["*"] > whitelist["*"]
|
|
51
|
-
*
|
|
52
|
-
* Examples:
|
|
53
|
-
* whitelist: ["*"] → reply to everyone
|
|
54
|
-
* whitelist: ["1"] → reply only to "1"
|
|
55
|
-
* whitelist: ["*"], bl: ["2"] → reply to everyone except "2"
|
|
56
|
-
* blacklist: ["*"] → log-only for all
|
|
57
|
-
* whitelist: ["1"], bl: ["*"] → reply only to "1"
|
|
58
|
-
* whitelist: ["1"], bl: ["1"] → no reply (blacklist wins)
|
|
59
|
-
*/
|
|
60
|
-
export declare function createCheckReplyEnabledTask(getSettings: () => Settings): BeforeTask;
|
|
61
|
-
/**
|
|
62
|
-
* Read image attachments from local disk and populate incoming.images in-place.
|
|
63
|
-
* Non-image attachments are skipped; failed reads are logged and silently skipped.
|
|
64
|
-
*/
|
|
65
|
-
export declare function createDownloadImagesTask(): BeforeTask;
|
|
66
|
-
export declare function createResizeImagesTask(): BeforeTask;
|
|
67
|
-
/**
|
|
68
|
-
* Intercept slash commands (e.g. "/help", "/new", "/status") before they reach the agent.
|
|
69
|
-
* Sets shouldContinue=false on the outgoing message to skip subsequent start tasks.
|
|
70
|
-
*
|
|
71
|
-
* Supported commands:
|
|
72
|
-
* /help — list available commands.
|
|
73
|
-
* /new — reset the agent session for this chat (equivalent to /new in pi coding agent).
|
|
74
|
-
* /status — show session stats: tokens, cost, context usage, model, thinking level.
|
|
75
|
-
* /compact [text] — compact context with optional custom instructions.
|
|
76
|
-
* /stop — stop the current agent run (handled before the per-chat queue).
|
|
77
|
-
* /reload — reload models and clear all sessions.
|
|
78
|
-
*/
|
|
79
|
-
export declare function createCommandHandlerTask(agent: AgentManager): StartTask;
|
|
80
|
-
/** Send the message to the agent and dispatch a reply for each agent turn. */
|
|
81
|
-
export declare function createCallAgentTask(agent: AgentManager): StartTask;
|
|
82
|
-
/** Remember echo and send reply via Messages.app AppleScript. */
|
|
83
|
-
export declare function createSendReplyTask(echoFilter: SelfEchoFilter, sender: MessageSender, getSettings: () => Settings): EndTask;
|
|
84
|
-
/**
|
|
85
|
-
* Log the outgoing reply to console.
|
|
86
|
-
*
|
|
87
|
-
* Examples:
|
|
88
|
-
* [sid] -> [DM] +16501234567: sure, I'll check
|
|
89
|
-
* [sid] -> [SMS] +16501234567: got it
|
|
90
|
-
* [sid] -> [GROUP] Family: sounds good!
|
|
91
|
-
*/
|
|
92
|
-
export declare function createLogOutgoingTask(digestLogger: DigestLogger): EndTask;
|
|
93
|
-
/** Persist the outgoing reply to log.jsonl. */
|
|
94
|
-
export declare function createStoreOutgoingTask(store: ChatStore): EndTask;
|
|
95
|
-
//# sourceMappingURL=tasks.d.ts.map
|
package/dist/tasks.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAU,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,YAAY,CAAC;AA2BrD;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,YAAY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