@elizaos/plugin-imessage 2.0.0-beta.1 → 2.0.3-beta.3
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/LICENSE +21 -0
- package/README.md +13 -18
- package/auto-enable.ts +1 -1
- package/dist/accounts.d.ts +2 -2
- package/dist/accounts.js +3 -3
- package/dist/accounts.js.map +1 -1
- package/dist/api/bluebubbles-routes.d.ts +1 -1
- package/dist/api/bluebubbles-routes.d.ts.map +1 -1
- package/dist/api/imessage-routes.d.ts +9 -21
- package/dist/api/imessage-routes.d.ts.map +1 -1
- package/dist/api/imessage-routes.js +5 -7
- package/dist/api/imessage-routes.js.map +1 -1
- package/dist/chatdb-reader.d.ts +1 -1
- package/dist/chatdb-reader.d.ts.map +1 -1
- package/dist/chatdb-reader.js +21 -1
- package/dist/chatdb-reader.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/connector-account-provider.d.ts +1 -1
- package/dist/connector-account-provider.js +5 -5
- package/dist/connector-account-provider.js.map +1 -1
- package/dist/contacts-reader.d.ts +23 -29
- package/dist/contacts-reader.d.ts.map +1 -1
- package/dist/contacts-reader.js +250 -372
- package/dist/contacts-reader.js.map +1 -1
- package/dist/data-routes.d.ts +21 -0
- package/dist/data-routes.d.ts.map +1 -0
- package/dist/data-routes.js +280 -0
- package/dist/data-routes.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/rpc.js +5 -5
- package/dist/rpc.js.map +1 -1
- package/dist/service.d.ts +20 -22
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +65 -54
- package/dist/service.js.map +1 -1
- package/dist/setup-routes.d.ts +15 -27
- package/dist/setup-routes.d.ts.map +1 -1
- package/dist/setup-routes.js +101 -284
- package/dist/setup-routes.js.map +1 -1
- package/package.json +22 -4
- package/registry-entry.json +103 -0
|
@@ -10,20 +10,16 @@
|
|
|
10
10
|
*
|
|
11
11
|
* ---
|
|
12
12
|
*
|
|
13
|
-
* Backend: **
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* vocabulary covering `person`, `phone`, and `email` classes. Reading
|
|
17
|
-
* contacts this way is the Apple-blessed path and does not require Full
|
|
18
|
-
* Disk Access — only the macOS "Contacts" TCC permission, which the OS
|
|
19
|
-
* prompts for on first use.
|
|
13
|
+
* Backend: **CNContactStore** through the shared native macOS dylib. This
|
|
14
|
+
* keeps the feature aligned with the macOS Contacts privacy grant and avoids
|
|
15
|
+
* asking for Automation access to the Contacts app.
|
|
20
16
|
*
|
|
21
|
-
* The
|
|
22
|
-
* rarely change mid-session, so
|
|
23
|
-
*
|
|
17
|
+
* The service calls this lazily when it actually needs name resolution or
|
|
18
|
+
* contact CRUD. Contacts rarely change mid-session, so the iMessage service
|
|
19
|
+
* caches the returned map for v1.
|
|
24
20
|
*
|
|
25
21
|
* Graceful degradation: if Contacts is not authorized, or returns no
|
|
26
|
-
* rows, or
|
|
22
|
+
* rows, or the native bridge fails for any other reason, the reader returns
|
|
27
23
|
* an empty map. The service treats that as "handles remain anonymous"
|
|
28
24
|
* and proceeds normally — no crash, no hard failure.
|
|
29
25
|
*/
|
|
@@ -33,7 +29,7 @@
|
|
|
33
29
|
* same name can appear under multiple handles.
|
|
34
30
|
*/
|
|
35
31
|
export interface ResolvedContact {
|
|
36
|
-
/** The contact's display name as stored in Contacts.
|
|
32
|
+
/** The contact's display name as stored in Apple Contacts. */
|
|
37
33
|
name: string;
|
|
38
34
|
}
|
|
39
35
|
/**
|
|
@@ -43,6 +39,8 @@ export interface ResolvedContact {
|
|
|
43
39
|
* {@link normalizeContactHandle} before querying.
|
|
44
40
|
*/
|
|
45
41
|
export type ContactsMap = Map<string, ResolvedContact>;
|
|
42
|
+
type ContactsFailure = "bridge_unavailable" | "native_error" | "permission" | null;
|
|
43
|
+
export declare function getLastContactsFailure(): ContactsFailure;
|
|
46
44
|
/**
|
|
47
45
|
* Normalize a handle to the canonical form used as a key in the
|
|
48
46
|
* ContactsMap. Strips whitespace, parentheses, hyphens, and dots from
|
|
@@ -50,34 +48,30 @@ export type ContactsMap = Map<string, ResolvedContact>;
|
|
|
50
48
|
*/
|
|
51
49
|
export declare function normalizeContactHandle(raw: string): string;
|
|
52
50
|
/**
|
|
53
|
-
* Parse
|
|
54
|
-
*
|
|
55
|
-
* without needing a live Contacts.app.
|
|
51
|
+
* Parse legacy tab-delimited contact fixture output into a ContactsMap.
|
|
52
|
+
* Exported so tests can exercise normalization without a live address book.
|
|
56
53
|
*
|
|
57
54
|
* Input format per line: `kind\thandle\tname`.
|
|
58
55
|
* Empty lines are skipped. Lines with fewer than 3 fields are skipped.
|
|
59
|
-
* Empty handles are skipped. Duplicate handles keep the first entry
|
|
60
|
-
* (AppleScript's iteration order is generally stable).
|
|
56
|
+
* Empty handles are skipped. Duplicate handles keep the first entry.
|
|
61
57
|
*/
|
|
62
58
|
export declare function parseContactsOutput(raw: string): ContactsMap;
|
|
63
59
|
/**
|
|
64
|
-
*
|
|
60
|
+
* Read Apple Contacts through CNContactStore and return a ContactsMap. Returns
|
|
65
61
|
* an empty map (with a warning log) on any failure — most commonly, the
|
|
66
|
-
* user hasn't authorized Contacts access yet
|
|
67
|
-
* surfaces a one-time system prompt and this call returns empty until
|
|
68
|
-
* the user accepts on a subsequent run.
|
|
62
|
+
* user hasn't authorized Contacts access yet.
|
|
69
63
|
*/
|
|
70
64
|
export declare function loadContacts(): Promise<ContactsMap>;
|
|
71
65
|
/**
|
|
72
66
|
* A full contact record, richer than ContactsMap's handle-keyed entries.
|
|
73
67
|
* Returned by `listAllContacts` and the single-contact CRUD helpers.
|
|
74
|
-
* Each phone/email carries its Contacts
|
|
68
|
+
* Each phone/email carries its Apple Contacts label when available
|
|
75
69
|
* (`home`, `work`, `mobile`, etc.) so the UI can surface context.
|
|
76
70
|
*/
|
|
77
71
|
export interface FullContact {
|
|
78
|
-
/** Contacts
|
|
72
|
+
/** Apple Contacts stable person id. Used for update/delete. */
|
|
79
73
|
id: string;
|
|
80
|
-
/** Display name as stored in Contacts.
|
|
74
|
+
/** Display name as stored in Apple Contacts. */
|
|
81
75
|
name: string;
|
|
82
76
|
firstName: string | null;
|
|
83
77
|
lastName: string | null;
|
|
@@ -106,15 +100,14 @@ export interface NewContactInput {
|
|
|
106
100
|
/**
|
|
107
101
|
* List every contact in the user's address book as a full `FullContact`
|
|
108
102
|
* record. Returns an empty array on any failure (permission denied,
|
|
109
|
-
*
|
|
103
|
+
* native bridge error, etc.) with a warning log.
|
|
110
104
|
*/
|
|
111
105
|
export declare function listAllContacts(): Promise<FullContact[]>;
|
|
112
106
|
/**
|
|
113
|
-
* Create a new
|
|
107
|
+
* Create a new Apple Contacts record. Returns the new person's id on
|
|
114
108
|
* success, or null on failure (permission denied, validation, etc.).
|
|
115
109
|
*
|
|
116
|
-
* Requires Contacts
|
|
117
|
-
* first write call. Read-only sessions never trigger this prompt.
|
|
110
|
+
* Requires the Contacts privacy grant.
|
|
118
111
|
*/
|
|
119
112
|
export declare function addContact(input: NewContactInput): Promise<string | null>;
|
|
120
113
|
/**
|
|
@@ -140,8 +133,9 @@ export interface ContactPatch {
|
|
|
140
133
|
}
|
|
141
134
|
export declare function updateContact(personId: string, patch: ContactPatch): Promise<boolean>;
|
|
142
135
|
/**
|
|
143
|
-
* Delete a contact by Contacts
|
|
136
|
+
* Delete a contact by Apple Contacts id. Requires the Contacts privacy grant.
|
|
144
137
|
* Returns false on any failure (not found, permission denied, etc.).
|
|
145
138
|
*/
|
|
146
139
|
export declare function deleteContact(personId: string): Promise<boolean>;
|
|
140
|
+
export {};
|
|
147
141
|
//# sourceMappingURL=contacts-reader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts-reader.d.ts","sourceRoot":"","sources":["../src/contacts-reader.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"contacts-re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