@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
|
@@ -17,21 +17,55 @@ export declare class SessionReview extends MacroEntity<ReviewRecord> {
|
|
|
17
17
|
protected fetch(): Promise<ReviewRecord>;
|
|
18
18
|
readonly title: () => Promise<string>;
|
|
19
19
|
readonly kind: () => Promise<"email" | "calendar" | "import">;
|
|
20
|
+
/**
|
|
21
|
+
* The session this review belongs to.
|
|
22
|
+
*
|
|
23
|
+
* @readonly
|
|
24
|
+
*/
|
|
20
25
|
session(): AgentSession;
|
|
21
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Compact reference for main()'s returned reviews array.
|
|
28
|
+
*
|
|
29
|
+
* @readonly
|
|
30
|
+
*/
|
|
22
31
|
reference(): Promise<{
|
|
23
32
|
kind: ReviewRecord['kind'];
|
|
24
33
|
id: string;
|
|
25
34
|
}>;
|
|
35
|
+
/**
|
|
36
|
+
* The review's items, each with its draft, status and result.
|
|
37
|
+
*
|
|
38
|
+
* @readonly
|
|
39
|
+
*/
|
|
26
40
|
items(): Promise<ReviewItem[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Reload the saved review, for example after a decision or a conflict.
|
|
43
|
+
*
|
|
44
|
+
* @readonly
|
|
45
|
+
*/
|
|
27
46
|
refresh(): Promise<this>;
|
|
28
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Submit the saved pending drafts. Never retries a conflict or ambiguous send.
|
|
49
|
+
*
|
|
50
|
+
* @destructive
|
|
51
|
+
* @openworld
|
|
52
|
+
*/
|
|
29
53
|
submitAll(): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Dismiss every pending draft without sending it.
|
|
56
|
+
*
|
|
57
|
+
* @destructive
|
|
58
|
+
* @idempotent
|
|
59
|
+
*/
|
|
30
60
|
dismissAll(): Promise<void>;
|
|
31
61
|
/** @internal Handles attach the cached revision; callers must refresh after a conflict. */
|
|
32
62
|
private decide;
|
|
33
63
|
}
|
|
34
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* An item handle scopes edits and decisions to its persisted review.
|
|
66
|
+
*
|
|
67
|
+
* @mcp-exclude Built from a listing record; no id-only reference an MCP call can pass.
|
|
68
|
+
*/
|
|
35
69
|
export declare class ReviewItem {
|
|
36
70
|
private readonly snapshot;
|
|
37
71
|
private readonly actions;
|
|
@@ -45,9 +79,26 @@ export declare class ReviewItem {
|
|
|
45
79
|
get draft(): ReviewRecord['items'][number]['draft'];
|
|
46
80
|
/** The action's confirmed response, `null` until it completes. */
|
|
47
81
|
get result(): ReviewRecord['items'][number]['result'];
|
|
48
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* Replace this pending draft; `kind` must match the review's.
|
|
84
|
+
*
|
|
85
|
+
* @write
|
|
86
|
+
* @idempotent
|
|
87
|
+
*/
|
|
49
88
|
edit(draft: ReviewDraft): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Submit this pending draft, sending the email or creating the event it holds.
|
|
91
|
+
*
|
|
92
|
+
* @destructive
|
|
93
|
+
* @openworld
|
|
94
|
+
*/
|
|
50
95
|
submit(): Promise<void>;
|
|
96
|
+
/**
|
|
97
|
+
* Dismiss this pending draft without sending it.
|
|
98
|
+
*
|
|
99
|
+
* @destructive
|
|
100
|
+
* @idempotent
|
|
101
|
+
*/
|
|
51
102
|
dismiss(): Promise<void>;
|
|
52
103
|
}
|
|
53
104
|
/** A replacement draft keyed by its review's kind. */
|
|
@@ -11,7 +11,11 @@ export declare class ToolApproval {
|
|
|
11
11
|
private constructor();
|
|
12
12
|
/** Construct a scoped approval handle. */
|
|
13
13
|
static byId(client: MacroClient, session: AgentSession, id: string): ToolApproval;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* Answer the approval using the generated discriminated answer contract.
|
|
16
|
+
*
|
|
17
|
+
* @write
|
|
18
|
+
*/
|
|
15
19
|
answer(answer: AnswerToolApprovalRequest['answer']): Promise<import("../../../generated/agent-harness").AnswerToolApprovalResponse>;
|
|
16
20
|
/** Serialize scoped identity only. */
|
|
17
21
|
toJSON(): {
|
|
@@ -4,6 +4,38 @@ import { Channel } from '../channels/channel';
|
|
|
4
4
|
import { MacroEntity } from '../entity';
|
|
5
5
|
import { Harness } from '../harnesses/harness';
|
|
6
6
|
import type { Team } from '../teams/team';
|
|
7
|
+
/**
|
|
8
|
+
* The settings {@link Agent.update} changes; each one left out keeps its
|
|
9
|
+
* current value.
|
|
10
|
+
*/
|
|
11
|
+
export type AgentPatch = {
|
|
12
|
+
/** New instructions, whole. */
|
|
13
|
+
instructions?: string;
|
|
14
|
+
/**
|
|
15
|
+
* New runtime: `in-memory`, `cursor`, or `macrod` with the registered
|
|
16
|
+
* `host` that serves it. The current model may not exist on the new
|
|
17
|
+
* runtime, so usually pass `defaultModel` with it.
|
|
18
|
+
*/
|
|
19
|
+
runtime?: {
|
|
20
|
+
harness: string;
|
|
21
|
+
host?: Harness;
|
|
22
|
+
};
|
|
23
|
+
/** New default model, as the runtime names it. */
|
|
24
|
+
defaultModel?: string;
|
|
25
|
+
/** Mentionable in every channel, or only in `channels`. */
|
|
26
|
+
channels?: {
|
|
27
|
+
scope: 'all';
|
|
28
|
+
} | {
|
|
29
|
+
scope: 'selected';
|
|
30
|
+
channels: Channel[];
|
|
31
|
+
};
|
|
32
|
+
/** The connected apps its sessions are handed. */
|
|
33
|
+
apps?: AgentApps;
|
|
34
|
+
/** Approve tool permission requests without asking, where the runtime allows it. */
|
|
35
|
+
autoAcceptPermissions?: boolean;
|
|
36
|
+
/** A coding agent (`true`) or a chat agent (`false`). */
|
|
37
|
+
isCoding?: boolean;
|
|
38
|
+
};
|
|
7
39
|
/** Agent creation and replacement settings. */
|
|
8
40
|
export type AgentOptions = Omit<CreateAgentRequest, 'channel_ids' | 'team_id' | 'harness_id' | 'auto_accept_permissions' | 'avatar_url' | 'channel_scope' | 'default_model' | 'is_coding'> & {
|
|
9
41
|
/** Channels the agent can access. */
|
|
@@ -23,7 +55,27 @@ export type AgentOptions = Omit<CreateAgentRequest, 'channel_ids' | 'team_id' |
|
|
|
23
55
|
/** Whether this is a coding agent. */
|
|
24
56
|
isCoding: boolean;
|
|
25
57
|
};
|
|
26
|
-
/**
|
|
58
|
+
/** The connected apps an agent's sessions are handed. */
|
|
59
|
+
export type AgentApps = {
|
|
60
|
+
/** Whatever apps the person running the session has connected. */
|
|
61
|
+
scope: 'owner_connections';
|
|
62
|
+
} | {
|
|
63
|
+
/** Exactly `servers`. */
|
|
64
|
+
scope: 'selected';
|
|
65
|
+
/** The apps, in the order the agent's author picked them. */
|
|
66
|
+
servers: {
|
|
67
|
+
/** Pipedream app slug, e.g. `linear`. */
|
|
68
|
+
appSlug: string;
|
|
69
|
+
/** Display name, e.g. `Linear`. */
|
|
70
|
+
name: string;
|
|
71
|
+
}[];
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* An agent persona backed by a bot identity. Its settings load from
|
|
75
|
+
* {@link AgentNamespace.list}, so they exist only for configurable agents;
|
|
76
|
+
* built-in personas such as Cursor have none, and are listed with
|
|
77
|
+
* {@link AgentNamespace.coding}.
|
|
78
|
+
*/
|
|
27
79
|
export declare class Agent extends MacroEntity<AgentRecord> {
|
|
28
80
|
/** Construct a lazy agent handle. */
|
|
29
81
|
static byId(client: MacroClient, id: string): Agent;
|
|
@@ -32,6 +84,31 @@ export declare class Agent extends MacroEntity<AgentRecord> {
|
|
|
32
84
|
protected fetch(): Promise<AgentRecord>;
|
|
33
85
|
/** Display name. */
|
|
34
86
|
readonly name: () => Promise<string>;
|
|
87
|
+
/** Handle people `@` mention it by. */
|
|
88
|
+
readonly handle: () => Promise<string>;
|
|
89
|
+
/** What the agent is for, when its author said. */
|
|
90
|
+
readonly description: () => Promise<string | undefined>;
|
|
91
|
+
/**
|
|
92
|
+
* Runtime its sessions run on: `in-memory` (Macro), `cursor`,
|
|
93
|
+
* `codex-cloud`, or `macrod` (a registered machine, named by
|
|
94
|
+
* {@link Agent.host}).
|
|
95
|
+
*/
|
|
96
|
+
readonly harness: () => Promise<string>;
|
|
97
|
+
/**
|
|
98
|
+
* Whether it is a coding agent, which works in a repository and answers a
|
|
99
|
+
* mention with a live session, rather than a chat agent replying in the
|
|
100
|
+
* thread.
|
|
101
|
+
*/
|
|
102
|
+
readonly isCoding: () => Promise<boolean>;
|
|
103
|
+
/**
|
|
104
|
+
* Whether its sessions approve tool permission requests without asking,
|
|
105
|
+
* where the runtime allows it.
|
|
106
|
+
*/
|
|
107
|
+
readonly autoAcceptPermissions: () => Promise<NonNullable<boolean | null | undefined>>;
|
|
108
|
+
/** `all`: mentionable everywhere; `selected`: only in {@link Agent.channels}. */
|
|
109
|
+
readonly channelScope: () => Promise<import("../../../generated/storage").AgentChannelScope>;
|
|
110
|
+
/** The connected apps its sessions are handed. */
|
|
111
|
+
readonly apps: () => Promise<AgentApps>;
|
|
35
112
|
/** Agent instructions. */
|
|
36
113
|
readonly instructions: () => Promise<string>;
|
|
37
114
|
/** Default model. */
|
|
@@ -40,8 +117,26 @@ export declare class Agent extends MacroEntity<AgentRecord> {
|
|
|
40
117
|
readonly channels: () => Promise<Channel[]>;
|
|
41
118
|
/** Host running this agent. */
|
|
42
119
|
readonly host: () => Promise<Harness | undefined>;
|
|
43
|
-
/**
|
|
44
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Change only the settings in `patch`; every setting left out keeps its
|
|
122
|
+
* current value. Instructions, channel and app lists are replaced whole:
|
|
123
|
+
* to edit one, apply your change to the current value and pass the result.
|
|
124
|
+
* Changes apply to sessions opened afterwards. Built-in personas cannot be
|
|
125
|
+
* updated.
|
|
126
|
+
*
|
|
127
|
+
* @write
|
|
128
|
+
* @idempotent
|
|
129
|
+
*/
|
|
130
|
+
update(patch: AgentPatch): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Replace every setting, including the name, handle and owning team:
|
|
133
|
+
* fields left out of `options` return to their defaults. Use
|
|
134
|
+
* {@link Agent.update} to change some settings and keep the rest.
|
|
135
|
+
*
|
|
136
|
+
* @destructive
|
|
137
|
+
* @idempotent
|
|
138
|
+
*/
|
|
139
|
+
replace(options: AgentOptions): Promise<void>;
|
|
45
140
|
}
|
|
46
141
|
/** Convert entity references into the generated agent request. */
|
|
47
142
|
export declare function agentBody(options: AgentOptions): CreateAgentRequest;
|
|
@@ -1,22 +1,66 @@
|
|
|
1
1
|
import type { MacroClient } from '../../utils/client';
|
|
2
2
|
import { Agent, type AgentOptions } from './agent';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* A coding agent the caller can start a session as right now: a built-in
|
|
5
|
+
* persona such as Cursor once its runtime is connected, or one of their
|
|
6
|
+
* configured coding agents whose runtime is reachable.
|
|
7
|
+
*/
|
|
8
|
+
export type CodingAgent = {
|
|
9
|
+
/** Pass as `agent` to {@link AgentSessionNamespace.createManaged}. */
|
|
10
|
+
agent: Agent;
|
|
11
|
+
/** Display name. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** What the persona is for, when known. */
|
|
14
|
+
description: string | undefined;
|
|
15
|
+
/** Saved guidance on its repositories and specialties; empty for built-ins. */
|
|
16
|
+
instructions: string;
|
|
17
|
+
/** Runtime its sessions run on, e.g. `cursor` or `macrod`. */
|
|
18
|
+
harness: string;
|
|
19
|
+
/** Default model, absent when the runtime chooses. */
|
|
20
|
+
model: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Agent personas: the built-in ones Macro ships and the agents the user configures.
|
|
5
24
|
*
|
|
6
|
-
* @routing Use when the user wants to change
|
|
25
|
+
* @routing Use when the user wants to pick, read or change one of their Macro agent personas: its instructions, model, runtime, channels, apps or hosts; not any request the user asks you, the agent, to carry out.
|
|
7
26
|
*/
|
|
8
27
|
export declare class AgentNamespace {
|
|
9
28
|
private readonly client;
|
|
10
29
|
constructor(client: MacroClient);
|
|
11
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* A lazy handle to a configurable agent. Get handles from
|
|
32
|
+
* {@link AgentNamespace.list} or {@link AgentNamespace.coding} instead of
|
|
33
|
+
* constructing one from an id.
|
|
34
|
+
*/
|
|
12
35
|
byId(id: string): Agent;
|
|
13
36
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* {@link
|
|
37
|
+
* The configurable agents the user can manage (their own, their teams', and
|
|
38
|
+
* channel agents they can mention), coding and chat, with their full
|
|
39
|
+
* settings. Built-in personas such as Cursor are not here; list those with
|
|
40
|
+
* {@link AgentNamespace.coding}. Pass one as `agent` to
|
|
41
|
+
* {@link AgentSessionNamespace.createManaged} to start a session as it.
|
|
42
|
+
*
|
|
43
|
+
* @readonly
|
|
18
44
|
*/
|
|
19
45
|
list(): Promise<Agent[]>;
|
|
20
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Choose a coding agent from this list before delegating coding work: the
|
|
48
|
+
* coding personas the user can start a session as right now, built-in ones
|
|
49
|
+
* such as Cursor first, then their configured coding agents whose runtime
|
|
50
|
+
* is connected. Prefer the agent the user named, otherwise the one whose
|
|
51
|
+
* name, description, instructions and runtime best fit the repository and
|
|
52
|
+
* task, and pass its `agent` to {@link AgentSessionNamespace.createManaged}.
|
|
53
|
+
* Empty when nothing is connected; tell the user to connect Cursor or
|
|
54
|
+
* configure a coding agent. Macro's own default persona is not listed:
|
|
55
|
+
* omit `agent` to use it.
|
|
56
|
+
*
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
coding(): Promise<CodingAgent[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Create an agent.
|
|
62
|
+
*
|
|
63
|
+
* @write
|
|
64
|
+
*/
|
|
21
65
|
create(options: AgentOptions): Promise<Agent>;
|
|
22
66
|
}
|
|
@@ -9,7 +9,11 @@ export type { DecisionRequest, DecisionResponse, StructuredCompletionRequest, St
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class AiNamespace {
|
|
11
11
|
private readonly client;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Read AI usage over a time range, optionally restricting it to users.
|
|
14
|
+
*
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
13
17
|
usage(options?: Omit<UsageRequest, 'include_users'> & {
|
|
14
18
|
users?: User[];
|
|
15
19
|
}): Promise<import("../../../generated/cognition").UsageSummary>;
|
|
@@ -18,11 +22,15 @@ export declare class AiNamespace {
|
|
|
18
22
|
* Generate an answer matching a JSON Schema. Set toolset to { type: 'none' }
|
|
19
23
|
* to use only supplied context. Other toolsets can perform the requested
|
|
20
24
|
* actions; always inspect outcome and toolActivity, including interruptions.
|
|
25
|
+
*
|
|
26
|
+
* @write
|
|
21
27
|
*/
|
|
22
28
|
structuredCompletion(request: StructuredCompletionRequest): Promise<StructuredCompletionResponse>;
|
|
23
29
|
/**
|
|
24
30
|
* Ask named yes/no questions about JSON input. Each probability estimates
|
|
25
31
|
* yes, from 0 to 1. This classifies supplied data without running tools.
|
|
32
|
+
*
|
|
33
|
+
* @write
|
|
26
34
|
*/
|
|
27
35
|
decide(request: DecisionRequest): Promise<DecisionResponse>;
|
|
28
36
|
}
|
|
@@ -12,6 +12,11 @@ export declare class UserApiKey extends MacroEntity<UserApiKeyInfo> {
|
|
|
12
12
|
readonly name: () => Promise<string>;
|
|
13
13
|
/** Creation time. */
|
|
14
14
|
readonly createdAt: () => Promise<string>;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Revoke this key.
|
|
17
|
+
*
|
|
18
|
+
* @destructive
|
|
19
|
+
* @idempotent
|
|
20
|
+
*/
|
|
16
21
|
delete(): Promise<void>;
|
|
17
22
|
}
|
|
@@ -10,13 +10,25 @@ export declare class ApiKeyNamespace {
|
|
|
10
10
|
constructor(client: MacroClient);
|
|
11
11
|
/** Construct a lazy key handle. */
|
|
12
12
|
byId(id: string): UserApiKey;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* List metadata for the caller's API keys.
|
|
15
|
+
*
|
|
16
|
+
* @readonly
|
|
17
|
+
*/
|
|
14
18
|
list(): Promise<UserApiKey[]>;
|
|
15
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Create a key. Save the secret now; it cannot be retrieved later.
|
|
21
|
+
*
|
|
22
|
+
* @write
|
|
23
|
+
*/
|
|
16
24
|
create(name: string): Promise<{
|
|
17
25
|
key: UserApiKey;
|
|
18
26
|
secret: string;
|
|
19
27
|
}>;
|
|
20
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Exchange an email address for a Macro API token, subject to server authorization.
|
|
30
|
+
*
|
|
31
|
+
* @write
|
|
32
|
+
*/
|
|
21
33
|
tokenForEmail(email: string): Promise<import("../../../generated/auth").MacroApiTokenResponse>;
|
|
22
34
|
}
|
|
@@ -75,28 +75,60 @@ export declare class Bot extends MacroEntity<BotRecord> {
|
|
|
75
75
|
readonly updatedAt: () => Promise<string>;
|
|
76
76
|
/** The owning user or team. */
|
|
77
77
|
readonly owner: () => Promise<BotOwner | undefined>;
|
|
78
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Change the bot's profile; pass only the fields that should change.
|
|
80
|
+
*
|
|
81
|
+
* @write
|
|
82
|
+
* @idempotent
|
|
83
|
+
*/
|
|
79
84
|
update(changes: UpdateBotOptions): Promise<void>;
|
|
80
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Delete the bot. Its tokens stop working and it leaves every channel.
|
|
87
|
+
*
|
|
88
|
+
* @destructive
|
|
89
|
+
* @idempotent
|
|
90
|
+
*/
|
|
81
91
|
delete(): Promise<void>;
|
|
82
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Channels the bot can post to.
|
|
94
|
+
*
|
|
95
|
+
* @readonly
|
|
96
|
+
*/
|
|
83
97
|
channels(): Promise<Channel[]>;
|
|
84
98
|
/**
|
|
85
99
|
* One webhook per channel the bot can post to. POST JSON `{ content }` with
|
|
86
100
|
* a token from {@link createToken} in the `x-macro-bot-token` header and
|
|
87
101
|
* `x-macro-bot-scope: user`. Empty until {@link grantChannel}.
|
|
102
|
+
*
|
|
103
|
+
* @readonly
|
|
88
104
|
*/
|
|
89
105
|
webhooks(): Promise<BotWebhook[]>;
|
|
90
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Let the bot post to a channel. The caller must be a member of it and manage the bot.
|
|
108
|
+
*
|
|
109
|
+
* @write
|
|
110
|
+
* @idempotent
|
|
111
|
+
*/
|
|
91
112
|
grantChannel(channel: Channel): Promise<void>;
|
|
92
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* Remove the bot from a channel. Works after the caller has left the channel.
|
|
115
|
+
*
|
|
116
|
+
* @destructive
|
|
117
|
+
* @idempotent
|
|
118
|
+
*/
|
|
93
119
|
revokeChannel(channel: Channel): Promise<void>;
|
|
94
|
-
/**
|
|
120
|
+
/**
|
|
121
|
+
* The bot's tokens, including revoked and expired ones. Secrets are never returned.
|
|
122
|
+
*
|
|
123
|
+
* @readonly
|
|
124
|
+
*/
|
|
95
125
|
tokens(): Promise<BotToken[]>;
|
|
96
126
|
/**
|
|
97
127
|
* Mint a bearer token for the bot's webhooks and API. The secret is returned
|
|
98
128
|
* once and cannot be read again; never write it into chat, documents or
|
|
99
129
|
* results. To hand a user a token, have them mint it in bot settings.
|
|
130
|
+
*
|
|
131
|
+
* @write
|
|
100
132
|
*/
|
|
101
133
|
createToken(options?: {
|
|
102
134
|
label?: string;
|
|
@@ -13,26 +13,38 @@ export declare class BotsNamespace {
|
|
|
13
13
|
constructor(client: MacroClient);
|
|
14
14
|
/** A handle to a bot by id. */
|
|
15
15
|
byId(id: string): Bot;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The bots the user can manage: their own and their teams'.
|
|
18
|
+
*
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
17
21
|
list(): Promise<Bot[]>;
|
|
18
22
|
/**
|
|
19
23
|
* Create a bot. It can post nowhere until `bot.grantChannel(channel)`; then
|
|
20
24
|
* `bot.webhooks()` and `bot.createToken()` give an integration what it needs.
|
|
25
|
+
*
|
|
26
|
+
* @write
|
|
21
27
|
*/
|
|
22
28
|
create(options: CreateBotOptions): Promise<Bot>;
|
|
23
29
|
/**
|
|
24
30
|
* The authenticated bot's own record. Requires bot auth; with a user API
|
|
25
31
|
* key this throws (a user token has no bot identity).
|
|
32
|
+
*
|
|
33
|
+
* @readonly
|
|
26
34
|
*/
|
|
27
35
|
me(): Promise<BotRecord>;
|
|
28
36
|
/**
|
|
29
37
|
* Channels containing the authenticated bot. Requires bot auth.
|
|
38
|
+
*
|
|
39
|
+
* @readonly
|
|
30
40
|
*/
|
|
31
41
|
channels(): Promise<BotChannel[]>;
|
|
32
42
|
/**
|
|
33
43
|
* The authenticated bot's canonical principal id (`bot|<uuid>`) — the form
|
|
34
44
|
* used for bot mentions, senders, and webhook `ids` filters. Cached on the
|
|
35
45
|
* client; see {@link MacroClient.myPrincipalId}.
|
|
46
|
+
*
|
|
47
|
+
* @readonly
|
|
36
48
|
*/
|
|
37
49
|
myPrincipalId(): Promise<string>;
|
|
38
50
|
}
|
|
@@ -24,7 +24,12 @@ export declare class BotToken extends MacroEntity<BotTokenRecord> {
|
|
|
24
24
|
readonly revokedAt: () => Promise<string | undefined>;
|
|
25
25
|
/** Creation time. */
|
|
26
26
|
readonly createdAt: () => Promise<string>;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* Revoke the token; requests using it fail from now on.
|
|
29
|
+
*
|
|
30
|
+
* @destructive
|
|
31
|
+
* @idempotent
|
|
32
|
+
*/
|
|
28
33
|
revoke(): Promise<void>;
|
|
29
34
|
toJSON(): {
|
|
30
35
|
id: string;
|
|
@@ -21,7 +21,11 @@ export declare class BookingLink extends MacroEntity<BookingLinkRecord> {
|
|
|
21
21
|
readonly draft: () => Promise<BookingLinkDraft>;
|
|
22
22
|
/** The profile revision this link was read at; {@link edit} saves against it. */
|
|
23
23
|
readonly revision: () => Promise<number>;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* The shareable URL guests book through.
|
|
26
|
+
*
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
25
29
|
webUrl(): Promise<string>;
|
|
26
30
|
/**
|
|
27
31
|
* Replace this link's whole configuration, only after the user replied
|
|
@@ -32,6 +36,8 @@ export declare class BookingLink extends MacroEntity<BookingLinkRecord> {
|
|
|
32
36
|
* against {@link revision}; when someone saved in between it is refused
|
|
33
37
|
* (409): read the link again and confirm the updated proposal instead of
|
|
34
38
|
* overwriting their change. Returns the saved link.
|
|
39
|
+
*
|
|
40
|
+
* @write
|
|
35
41
|
*/
|
|
36
42
|
edit(draft: BookingLinkDraft, options: {
|
|
37
43
|
userConfirmation: string;
|
|
@@ -58,6 +58,8 @@ export declare class BookingNamespace {
|
|
|
58
58
|
*
|
|
59
59
|
* `query` matches link title, slug and description; omit it for every link
|
|
60
60
|
* (at most 100).
|
|
61
|
+
*
|
|
62
|
+
* @readonly
|
|
61
63
|
*/
|
|
62
64
|
links(options?: BookingScope & {
|
|
63
65
|
query?: string;
|
|
@@ -83,6 +85,9 @@ export declare class BookingNamespace {
|
|
|
83
85
|
* Replaying an identical draft at the same slug returns the saved link; a
|
|
84
86
|
* different draft at that slug conflicts (409). Share the link's
|
|
85
87
|
* {@link BookingLink.webUrl} as an `<m-booking-link-mention>` chip.
|
|
88
|
+
*
|
|
89
|
+
* @write
|
|
90
|
+
* @idempotent
|
|
86
91
|
*/
|
|
87
92
|
createLink(draft: BookingLinkDraft, options: BookingScope & {
|
|
88
93
|
userConfirmation: string;
|
|
@@ -91,6 +96,8 @@ export declare class BookingNamespace {
|
|
|
91
96
|
* Read every booking setting of the user (or a team): booking-page name and
|
|
92
97
|
* introduction, reusable schedules, default hours and every link. Reading
|
|
93
98
|
* never creates settings.
|
|
99
|
+
*
|
|
100
|
+
* @readonly
|
|
94
101
|
*/
|
|
95
102
|
settings(options?: BookingScope): Promise<BookingSettings>;
|
|
96
103
|
/**
|
|
@@ -104,6 +111,8 @@ export declare class BookingNamespace {
|
|
|
104
111
|
* hosting, so name the affected links before changing them. Deleting a link
|
|
105
112
|
* cancels none of its bookings. Saving at a stale revision is refused (409):
|
|
106
113
|
* read again and reconcile instead of overwriting.
|
|
114
|
+
*
|
|
115
|
+
* @destructive
|
|
107
116
|
*/
|
|
108
117
|
saveSettings(profile: BookingProfile, options?: BookingScope): Promise<BookingSettings>;
|
|
109
118
|
/**
|
|
@@ -112,6 +121,8 @@ export declare class BookingNamespace {
|
|
|
112
121
|
* guests, answers, attendance and reschedule history. An oversized result
|
|
113
122
|
* fails rather than truncating: narrow the range. Use {@link insights} for
|
|
114
123
|
* statistics.
|
|
124
|
+
*
|
|
125
|
+
* @readonly
|
|
115
126
|
*/
|
|
116
127
|
bookings(options: BookingScope & {
|
|
117
128
|
from: string;
|
|
@@ -125,6 +136,8 @@ export declare class BookingNamespace {
|
|
|
125
136
|
* Failed and processing requests are excluded. Completed means confirmed
|
|
126
137
|
* and ended without a recorded no-show, not verified attendance; minutes
|
|
127
138
|
* are scheduled duration, not call length. No guest contact details.
|
|
139
|
+
*
|
|
140
|
+
* @readonly
|
|
128
141
|
*/
|
|
129
142
|
insights(query: BookingInsightsQuery): Promise<BookingInsights>;
|
|
130
143
|
}
|
|
@@ -49,28 +49,43 @@ export declare class Booking extends MacroEntity<BookingRecord> {
|
|
|
49
49
|
* Available replacement starts on one date (`YYYY-MM-DD`, in the booking
|
|
50
50
|
* schedule's time zone), for {@link reschedule}. Availability is checked
|
|
51
51
|
* again when the meeting moves.
|
|
52
|
+
*
|
|
53
|
+
* @readonly
|
|
52
54
|
*/
|
|
53
55
|
rescheduleSlots(date: string): Promise<BookingSlot[]>;
|
|
54
56
|
/**
|
|
55
57
|
* Move the meeting to a start returned by {@link rescheduleSlots}; only on
|
|
56
58
|
* the user's go-ahead, since the guest and hosts are notified. Returns the
|
|
57
59
|
* saved booking.
|
|
60
|
+
*
|
|
61
|
+
* @destructive
|
|
62
|
+
* @openworld
|
|
58
63
|
*/
|
|
59
64
|
reschedule(startsAt: string): Promise<Booking>;
|
|
60
65
|
/**
|
|
61
66
|
* Cancel the meeting; only on the user's go-ahead, since the guest and
|
|
62
67
|
* hosts are notified. The booking link stays as it is. Returns the saved
|
|
63
68
|
* booking.
|
|
69
|
+
*
|
|
70
|
+
* @destructive
|
|
71
|
+
* @openworld
|
|
72
|
+
* @idempotent
|
|
64
73
|
*/
|
|
65
74
|
cancel(): Promise<Booking>;
|
|
66
75
|
/**
|
|
67
76
|
* Approve a legacy pending booking and send its invitations; only on the
|
|
68
77
|
* user's go-ahead. Returns the saved booking.
|
|
78
|
+
*
|
|
79
|
+
* @destructive
|
|
80
|
+
* @openworld
|
|
69
81
|
*/
|
|
70
82
|
approve(): Promise<Booking>;
|
|
71
83
|
/**
|
|
72
84
|
* Record or clear attendance once a confirmed meeting has ended. Returns
|
|
73
85
|
* the saved booking.
|
|
86
|
+
*
|
|
87
|
+
* @write
|
|
88
|
+
* @idempotent
|
|
74
89
|
*/
|
|
75
90
|
setAttendance(attendance: BookingAttendance): Promise<Booking>;
|
|
76
91
|
private change;
|
|
@@ -9,7 +9,13 @@ import { MacroEntity } from '../entity';
|
|
|
9
9
|
* handle loads its detail by listing the caller's calendars and matching on id.
|
|
10
10
|
*/
|
|
11
11
|
export declare class Calendar extends MacroEntity<VisibleCalendar> {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Set whether this calendar contributes to the caller's availability.
|
|
14
|
+
*
|
|
15
|
+
* @write
|
|
16
|
+
* @openworld
|
|
17
|
+
* @idempotent
|
|
18
|
+
*/
|
|
13
19
|
setContributesToAvailability(contributesToAvailability: boolean): Promise<void>;
|
|
14
20
|
protected fetch(): Promise<VisibleCalendar>;
|
|
15
21
|
/** A handle to a calendar by id. Detail loads on first access. */
|