@macro-inc/sdk 0.4.0 → 0.5.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/CALLS.md +82 -0
- package/README.md +176 -7
- package/dist/chunk-2IVGAIGQ.js +80 -0
- package/dist/{chunk-PTX2RV2N.js → chunk-3SW6QVDV.js} +33 -0
- package/dist/{chunk-XFA7NCJ5.js → chunk-GT5EUYOR.js} +13 -15
- package/dist/{chunk-ZLBDES7U.js → chunk-HIW6KU2I.js} +490 -4
- package/dist/{chunk-AZJUIUIV.js → chunk-J2VK3NOR.js} +56 -0
- package/dist/{chunk-PZPTJI6F.js → chunk-UVJLWLSJ.js} +41 -2
- package/dist/generated/agent-fold/index.d.ts +8 -6
- package/dist/generated/agent-harness/index.d.ts +1 -1
- package/dist/generated/agent-harness/index.js +1 -1
- package/dist/generated/agent-harness/sdk.gen.d.ts +17 -1
- package/dist/generated/agent-harness/types.gen.d.ts +188 -3
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +13 -15
- package/dist/generated/auth/types.gen.d.ts +36 -17
- package/dist/generated/cognition/index.d.ts +1 -1
- package/dist/generated/cognition/index.js +1 -1
- package/dist/generated/cognition/sdk.gen.d.ts +38 -1
- package/dist/generated/cognition/types.gen.d.ts +473 -4
- package/dist/generated/connection/types.gen.d.ts +1 -1
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/types.gen.d.ts +36 -1
- package/dist/generated/scheduled-action/index.d.ts +1 -1
- package/dist/generated/scheduled-action/index.js +1 -1
- package/dist/generated/scheduled-action/sdk.gen.d.ts +17 -2
- package/dist/generated/scheduled-action/types.gen.d.ts +642 -104
- package/dist/generated/storage/index.d.ts +1 -1
- package/dist/generated/storage/index.js +1 -1
- package/dist/generated/storage/sdk.gen.d.ts +204 -5
- package/dist/generated/storage/types.gen.d.ts +3969 -374
- package/dist/src/calls/browser.d.ts +14 -0
- package/dist/src/calls/browser.js +102 -0
- package/dist/src/calls/common.d.ts +18 -0
- package/dist/src/calls/node.d.ts +24 -0
- package/dist/src/calls/node.js +145 -0
- package/dist/src/calls/telemetry.d.ts +5 -0
- package/dist/src/entities/account-managers/grant.d.ts +28 -5
- package/dist/src/entities/account-managers/namespace.d.ts +15 -3
- package/dist/src/entities/activity/entity.d.ts +7 -0
- package/dist/src/entities/activity/namespace.d.ts +58 -0
- package/dist/src/entities/activity/namespace.test.d.ts +1 -0
- package/dist/src/entities/agent-sessions/activity.d.ts +10 -2
- package/dist/src/entities/agent-sessions/agent-session.d.ts +193 -18
- package/dist/src/entities/agent-sessions/code-execution.d.ts +15 -3
- package/dist/src/entities/agent-sessions/conversation.d.ts +46 -9
- package/dist/src/entities/agent-sessions/namespace.d.ts +71 -16
- package/dist/src/entities/agent-sessions/origin.d.ts +1 -1
- package/dist/src/entities/agent-sessions/queued-action.d.ts +17 -3
- package/dist/src/entities/agent-sessions/review.d.ts +55 -4
- package/dist/src/entities/agent-sessions/tool-approval.d.ts +5 -1
- package/dist/src/entities/agents/agent.d.ts +98 -3
- package/dist/src/entities/agents/namespace.d.ts +52 -8
- package/dist/src/entities/ai/namespace.d.ts +9 -1
- package/dist/src/entities/api-keys/api-key.d.ts +6 -1
- package/dist/src/entities/api-keys/namespace.d.ts +15 -3
- package/dist/src/entities/bots/bot.d.ts +38 -6
- package/dist/src/entities/bots/namespace.d.ts +13 -1
- package/dist/src/entities/bots/token.d.ts +6 -1
- package/dist/src/entities/calendar/booking-link.d.ts +7 -1
- package/dist/src/entities/calendar/booking-namespace.d.ts +13 -0
- package/dist/src/entities/calendar/booking.d.ts +15 -0
- package/dist/src/entities/calendar/calendar.d.ts +7 -1
- package/dist/src/entities/calendar/event.d.ts +59 -9
- package/dist/src/entities/calendar/namespace.d.ts +88 -10
- package/dist/src/entities/calendar/replacement.d.ts +19 -3
- package/dist/src/entities/calls/call-record.d.ts +90 -14
- package/dist/src/entities/calls/connection.d.ts +7 -1
- package/dist/src/entities/calls/message.d.ts +27 -5
- package/dist/src/entities/calls/namespace.d.ts +15 -3
- package/dist/src/entities/canvases/canvas.d.ts +324 -0
- package/dist/src/entities/channels/access-request.d.ts +10 -2
- package/dist/src/entities/channels/activity.d.ts +20 -4
- package/dist/src/entities/channels/channel.d.ts +130 -23
- package/dist/src/entities/channels/labels.d.ts +41 -7
- package/dist/src/entities/channels/message.d.ts +41 -7
- package/dist/src/entities/channels/namespace.d.ts +28 -3
- package/dist/src/entities/channels/post.test.d.ts +1 -0
- package/dist/src/entities/channels/thread.d.ts +19 -3
- package/dist/src/entities/chats/chat.d.ts +56 -6
- package/dist/src/entities/chats/generation.d.ts +11 -2
- package/dist/src/entities/chats/namespace.d.ts +10 -2
- package/dist/src/entities/connected-apps/connected-app.d.ts +14 -1
- package/dist/src/entities/connected-apps/connector.d.ts +3 -0
- package/dist/src/entities/connected-apps/namespace.d.ts +16 -0
- package/dist/src/entities/crm/company.d.ts +63 -15
- package/dist/src/entities/crm/contact.d.ts +60 -13
- package/dist/src/entities/crm/namespace.d.ts +85 -11
- package/dist/src/entities/crm/pipeline-entry.d.ts +102 -0
- package/dist/src/entities/crm/pipeline.d.ts +271 -27
- package/dist/src/entities/crm/pipelines.d.ts +39 -2
- package/dist/src/entities/databases/column.d.ts +54 -7
- package/dist/src/entities/databases/database.d.ts +126 -12
- package/dist/src/entities/databases/namespace.d.ts +16 -4
- package/dist/src/entities/databases/row.d.ts +2 -0
- package/dist/src/entities/databases/saved-query.d.ts +145 -0
- package/dist/src/entities/databases/table.d.ts +64 -10
- package/dist/src/entities/databases/view.d.ts +27 -5
- package/dist/src/entities/databases/webhook.d.ts +8 -1
- package/dist/src/entities/documents/ai-edit.d.ts +2 -0
- package/dist/src/entities/documents/anchor.d.ts +12 -2
- package/dist/src/entities/documents/comment.d.ts +29 -5
- package/dist/src/entities/documents/document.d.ts +243 -20
- package/dist/src/entities/documents/markdown.d.ts +25 -0
- package/dist/src/entities/documents/namespace.d.ts +132 -13
- package/dist/src/entities/documents/skills.test.d.ts +1 -0
- package/dist/src/entities/documents/system-skill.d.ts +21 -1
- package/dist/src/entities/documents/text-comment.d.ts +41 -0
- package/dist/src/entities/documents/text-comment.test.d.ts +1 -0
- package/dist/src/entities/documents/version.d.ts +5 -1
- package/dist/src/entities/email/attachment.d.ts +3 -0
- package/dist/src/entities/email/draft.d.ts +61 -9
- package/dist/src/entities/email/filter.d.ts +12 -2
- package/dist/src/entities/email/label.d.ts +7 -1
- package/dist/src/entities/email/link.d.ts +5 -1
- package/dist/src/entities/email/message.d.ts +55 -8
- package/dist/src/entities/email/namespace.d.ts +127 -21
- package/dist/src/entities/email/thread.d.ts +99 -16
- package/dist/src/entities/entity-mentions/mention.d.ts +6 -1
- package/dist/src/entities/entity-mentions/namespace.d.ts +5 -1
- package/dist/src/entities/entity.d.ts +56 -6
- package/dist/src/entities/external-chat/chat.d.ts +62 -11
- package/dist/src/entities/external-chat/message.d.ts +1 -1
- package/dist/src/entities/external-chat/namespace.d.ts +5 -1
- package/dist/src/entities/external-chat/send.d.ts +10 -2
- package/dist/src/entities/favorites/namespace.d.ts +20 -3
- package/dist/src/entities/foreign/foreign-entity.d.ts +5 -1
- package/dist/src/entities/foreign/namespace.d.ts +4 -0
- package/dist/src/entities/forms/form.d.ts +71 -13
- package/dist/src/entities/forms/namespace.d.ts +10 -2
- package/dist/src/entities/forms/question.d.ts +35 -7
- package/dist/src/entities/forms/response.d.ts +25 -5
- package/dist/src/entities/forms/section.d.ts +15 -3
- package/dist/src/entities/github-pull-requests/namespace.d.ts +5 -1
- package/dist/src/entities/github-pull-requests/pull-request.d.ts +15 -3
- package/dist/src/entities/harnesses/harness.d.ts +51 -3
- package/dist/src/entities/harnesses/namespace.d.ts +53 -7
- package/dist/src/entities/harnesses/pairing.d.ts +12 -2
- package/dist/src/entities/images/image.d.ts +16 -5
- package/dist/src/entities/images/namespace.d.ts +8 -1
- package/dist/src/entities/initiatives/initiative.d.ts +117 -3
- package/dist/src/entities/initiatives/initiative.test.d.ts +1 -0
- package/dist/src/entities/initiatives/namespace.d.ts +69 -7
- package/dist/src/entities/me/namespace.d.ts +27 -2
- package/dist/src/entities/meetings/meeting.d.ts +45 -8
- package/dist/src/entities/meetings/namespace.d.ts +20 -4
- package/dist/src/entities/memory/namespace.d.ts +49 -0
- package/dist/src/entities/memory/namespace.test.d.ts +1 -0
- package/dist/src/entities/messages/discussion.d.ts +84 -0
- package/dist/src/entities/messages/thread.d.ts +19 -5
- package/dist/src/entities/notifications/namespace.d.ts +40 -7
- package/dist/src/entities/notifications/notification.d.ts +29 -5
- package/dist/src/entities/pins/namespace.d.ts +23 -4
- package/dist/src/entities/projects/namespace.d.ts +29 -0
- package/dist/src/entities/projects/project.d.ts +47 -6
- package/dist/src/entities/properties/namespace.d.ts +67 -11
- package/dist/src/entities/properties/namespace.test.d.ts +1 -0
- package/dist/src/entities/properties/property-definition.d.ts +30 -5
- package/dist/src/entities/properties/property-option.d.ts +14 -2
- package/dist/src/entities/referrals/namespace.d.ts +8 -1
- package/dist/src/entities/routines/namespace.d.ts +128 -7
- package/dist/src/entities/routines/routine.d.ts +111 -25
- package/dist/src/entities/saved-views/namespace.d.ts +57 -0
- package/dist/src/entities/saved-views/saved-view.d.ts +78 -0
- package/dist/src/entities/search/namespace.d.ts +5 -1
- package/dist/src/entities/sharing/access.d.ts +50 -9
- package/dist/src/entities/spreadsheets/spreadsheet.d.ts +201 -0
- package/dist/src/entities/tasks/namespace.d.ts +13 -1
- package/dist/src/entities/tasks/task.d.ts +7 -1
- package/dist/src/entities/teams/invite.d.ts +3 -0
- package/dist/src/entities/teams/namespace.d.ts +10 -2
- package/dist/src/entities/teams/team.d.ts +7 -0
- package/dist/src/entities/unfurls/namespace.d.ts +12 -2
- package/dist/src/entities/users/namespace.d.ts +19 -1
- package/dist/src/entities/users/profile-picture.d.ts +29 -0
- package/dist/src/entities/users/profile-picture.test.d.ts +1 -0
- package/dist/src/entities/users/user.d.ts +52 -1
- package/dist/src/entities/web/namespace.d.ts +6 -0
- package/dist/src/entities/webhooks/namespace.d.ts +5 -0
- package/dist/src/entities/webhooks/webhook.d.ts +47 -7
- package/dist/src/entities/whatsapp/account.d.ts +5 -1
- package/dist/src/entities/whatsapp/chat.d.ts +9 -1
- package/dist/src/entities/whatsapp/namespace.d.ts +7 -1
- package/dist/src/entities/workspace/namespace.d.ts +7 -1
- package/dist/src/entities/workspace/query.d.ts +5 -1
- package/dist/src/events/hydrate/user.d.ts +14 -0
- package/dist/src/events/receiver.d.ts +2 -0
- package/dist/src/events/types.d.ts +2 -1
- package/dist/src/macro.d.ts +33 -5
- package/dist/src/macro.js +15635 -10132
- package/dist/src/utils/lazy.d.ts +7 -1
- package/package.json +32 -5
- package/dist/src/entities/crm/comment.d.ts +0 -64
package/dist/src/utils/lazy.d.ts
CHANGED
|
@@ -9,10 +9,16 @@ export declare class Lazy<T> {
|
|
|
9
9
|
private readonly loader;
|
|
10
10
|
private value?;
|
|
11
11
|
private inflight?;
|
|
12
|
+
private generation;
|
|
12
13
|
constructor(loader: () => Promise<T>, seed?: T);
|
|
13
14
|
get(): Promise<T>;
|
|
14
15
|
/** The cached value, if already loaded — never triggers a fetch. */
|
|
15
16
|
peek(): T | undefined;
|
|
16
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* Replace the cached value with one known to be current, such as a write's
|
|
19
|
+
* response, and fence older loads so they cannot overwrite it.
|
|
20
|
+
*/
|
|
21
|
+
set(value: T): void;
|
|
22
|
+
/** Drop cached detail and fence older loads so the next read refetches. */
|
|
17
23
|
clear(): void;
|
|
18
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@macro-inc/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/macro-inc/macro.git",
|
|
@@ -20,9 +20,20 @@
|
|
|
20
20
|
"./generated/*": {
|
|
21
21
|
"types": "./dist/generated/*/index.d.ts",
|
|
22
22
|
"import": "./dist/generated/*/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./calls/node": {
|
|
25
|
+
"types": "./dist/src/calls/node.d.ts",
|
|
26
|
+
"import": "./dist/src/calls/node.js"
|
|
27
|
+
},
|
|
28
|
+
"./calls/browser": {
|
|
29
|
+
"types": "./dist/src/calls/browser.d.ts",
|
|
30
|
+
"import": "./dist/src/calls/browser.js"
|
|
23
31
|
}
|
|
24
32
|
},
|
|
25
|
-
"files": [
|
|
33
|
+
"files": [
|
|
34
|
+
"dist",
|
|
35
|
+
"CALLS.md"
|
|
36
|
+
],
|
|
26
37
|
"publishConfig": {
|
|
27
38
|
"access": "public"
|
|
28
39
|
},
|
|
@@ -38,11 +49,13 @@
|
|
|
38
49
|
"prepublishOnly": "bun run build",
|
|
39
50
|
"check": "tsc --noEmit",
|
|
40
51
|
"lint": "biome check",
|
|
41
|
-
"format": "biome format --write"
|
|
52
|
+
"format": "biome format --write",
|
|
53
|
+
"check:pack": "bun scripts/check-pack.ts"
|
|
42
54
|
},
|
|
43
55
|
"dependencies": {
|
|
44
56
|
"ts-pattern": "^5.8.0",
|
|
45
|
-
"uuid": "^11.1.1"
|
|
57
|
+
"uuid": "^11.1.1",
|
|
58
|
+
"@opentelemetry/api": "^1.9.1"
|
|
46
59
|
},
|
|
47
60
|
"devDependencies": {
|
|
48
61
|
"@biomejs/biome": "2.4.12",
|
|
@@ -52,6 +65,20 @@
|
|
|
52
65
|
"esbuild": "^0.28.1",
|
|
53
66
|
"hono": "^4.12.27",
|
|
54
67
|
"semver": "^7.8.5",
|
|
55
|
-
"typescript": "^5.9.2"
|
|
68
|
+
"typescript": "^5.9.2",
|
|
69
|
+
"@livekit/rtc-node": "^1.2.1",
|
|
70
|
+
"livekit-client": "^2.18.0"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@livekit/rtc-node": "^1.2.1",
|
|
74
|
+
"livekit-client": "^2.18.0"
|
|
75
|
+
},
|
|
76
|
+
"peerDependenciesMeta": {
|
|
77
|
+
"@livekit/rtc-node": {
|
|
78
|
+
"optional": true
|
|
79
|
+
},
|
|
80
|
+
"livekit-client": {
|
|
81
|
+
"optional": true
|
|
82
|
+
}
|
|
56
83
|
}
|
|
57
84
|
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Message as MessageRecord, ThreadState } from '../../../generated/storage/types.gen';
|
|
2
|
-
import { type RichMessage } from '../../mentions';
|
|
3
|
-
import type { MacroClient } from '../../utils/client';
|
|
4
|
-
import { MacroEntity } from '../entity';
|
|
5
|
-
import { User } from '../users/user';
|
|
6
|
-
/** The CRM record a discussion hangs off. */
|
|
7
|
-
export interface CrmCommentParent {
|
|
8
|
-
type: 'crm_company' | 'crm_contact';
|
|
9
|
-
id: string;
|
|
10
|
-
}
|
|
11
|
-
/** One of a CRM record's comment threads: its state and its comments. */
|
|
12
|
-
export interface CrmCommentThread {
|
|
13
|
-
/** The thread state: root id, resolved flag, owner, timestamps. */
|
|
14
|
-
thread: ThreadState;
|
|
15
|
-
/** The thread's comments, root first, then replies oldest first. */
|
|
16
|
-
comments: CrmComment[];
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A comment on a CRM company or contact: a message whose parent is the
|
|
20
|
-
* record, addressed by the record and the message UUID. Its record and
|
|
21
|
-
* mutations are the ones document comments and channel messages use.
|
|
22
|
-
*/
|
|
23
|
-
export declare class CrmComment extends MacroEntity<MessageRecord> {
|
|
24
|
-
/** The company or contact this comment belongs to. */
|
|
25
|
-
readonly parent: CrmCommentParent;
|
|
26
|
-
private constructor();
|
|
27
|
-
private get path();
|
|
28
|
-
protected fetch(): Promise<MessageRecord>;
|
|
29
|
-
/** A handle to a comment by id. Fields load on first access. */
|
|
30
|
-
static byId(client: MacroClient, parent: CrmCommentParent, id: string): CrmComment;
|
|
31
|
-
/** Build a comment from a message record (pre-seeded, no fetch). */
|
|
32
|
-
static from(client: MacroClient, parent: CrmCommentParent, record: MessageRecord): CrmComment;
|
|
33
|
-
/** The comment's text (markdown). */
|
|
34
|
-
readonly text: () => Promise<string>;
|
|
35
|
-
/** When the comment was created. */
|
|
36
|
-
readonly createdAt: () => Promise<string>;
|
|
37
|
-
/** When the comment was last updated. */
|
|
38
|
-
readonly updatedAt: () => Promise<string>;
|
|
39
|
-
/** When the comment was deleted, if it has been. */
|
|
40
|
-
readonly deletedAt: () => Promise<string | undefined>;
|
|
41
|
-
/** The id of the thread this comment belongs to: its root, or itself for a root. */
|
|
42
|
-
threadId(): Promise<string>;
|
|
43
|
-
/** The user who wrote this comment. */
|
|
44
|
-
author(): Promise<User>;
|
|
45
|
-
/** Reply in this comment's thread. */
|
|
46
|
-
reply(body: string | RichMessage): Promise<CrmComment>;
|
|
47
|
-
/**
|
|
48
|
-
* Replace the comment's text. Only its author may.
|
|
49
|
-
*
|
|
50
|
-
* @param body - Plain text, or a rich body composed with {@link msg}.
|
|
51
|
-
*/
|
|
52
|
-
edit(body: string | RichMessage): Promise<this>;
|
|
53
|
-
/** Delete this comment. Deleting a thread's root keeps its replies. */
|
|
54
|
-
delete(): Promise<void>;
|
|
55
|
-
}
|
|
56
|
-
/** A CRM record's live comment threads, each with its comments, newest thread first. */
|
|
57
|
-
export declare function listCrmCommentThreads(client: MacroClient, parent: CrmCommentParent): Promise<CrmCommentThread[]>;
|
|
58
|
-
/**
|
|
59
|
-
* Post a comment on a CRM record: a new thread, or a reply when `threadId`
|
|
60
|
-
* (the thread's root comment id) is given.
|
|
61
|
-
*/
|
|
62
|
-
export declare function postCrmComment(client: MacroClient, parent: CrmCommentParent, body: string | RichMessage, opts?: {
|
|
63
|
-
threadId?: string;
|
|
64
|
-
}): Promise<CrmComment>;
|