@macro-inc/sdk 0.5.0 → 0.6.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 +156 -23
- package/dist/{chunk-3SW6QVDV.js → chunk-4MI52GWV.js} +60 -1
- package/dist/{chunk-GT5EUYOR.js → chunk-HO75UE4Z.js} +133 -0
- package/dist/{chunk-P4DTO6VD.js → chunk-MCSQNZ4E.js} +6 -0
- package/dist/{chunk-HIW6KU2I.js → chunk-SJ6S2GAT.js} +712 -14
- package/dist/{chunk-J2VK3NOR.js → chunk-SK5CMXRV.js} +44 -14
- package/dist/{chunk-UVJLWLSJ.js → chunk-TMTYN2UK.js} +190 -2
- package/dist/{chunk-PPR7IWZ7.js → chunk-ZYBAKW25.js} +2 -1
- package/dist/generated/agent-fold/index.d.ts +194 -8
- 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 +33 -2
- package/dist/generated/agent-harness/types.gen.d.ts +341 -8
- package/dist/generated/agent-reviews/index.d.ts +11 -9
- package/dist/generated/auth/index.d.ts +1 -1
- package/dist/generated/auth/index.js +1 -1
- package/dist/generated/auth/sdk.gen.d.ts +69 -1
- package/dist/generated/auth/types.gen.d.ts +734 -3
- package/dist/generated/calendar/types.gen.d.ts +10 -3
- 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 +23 -6
- package/dist/generated/cognition/types.gen.d.ts +202 -114
- package/dist/generated/contacts/index.d.ts +1 -1
- package/dist/generated/contacts/index.js +1 -1
- package/dist/generated/contacts/sdk.gen.d.ts +5 -1
- package/dist/generated/contacts/types.gen.d.ts +56 -0
- package/dist/generated/email/types.gen.d.ts +8 -2
- package/dist/generated/notification/index.d.ts +1 -1
- package/dist/generated/notification/index.js +1 -1
- package/dist/generated/notification/sdk.gen.d.ts +2 -1
- package/dist/generated/notification/types.gen.d.ts +138 -0
- 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 +92 -2
- package/dist/generated/scheduled-action/types.gen.d.ts +1455 -21
- package/dist/generated/search/index.d.ts +1 -1
- package/dist/generated/search/types.gen.d.ts +50 -11
- 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 +309 -15
- package/dist/generated/storage/types.gen.d.ts +12437 -8899
- package/dist/src/entities/agent-sessions/activity.d.ts +3 -2
- package/dist/src/entities/agent-sessions/agent-session.d.ts +17 -5
- package/dist/src/entities/agent-sessions/namespace.d.ts +5 -4
- package/dist/src/entities/agent-sessions/review.d.ts +1 -1
- package/dist/src/entities/ai/namespace.d.ts +2 -2
- package/dist/src/entities/api-keys/namespace.d.ts +5 -2
- package/dist/src/entities/bots/bot.d.ts +6 -3
- package/dist/src/entities/calendar/booking-namespace.d.ts +1 -1
- package/dist/src/entities/calendar/calendar.d.ts +3 -2
- package/dist/src/entities/calendar/event.d.ts +9 -0
- package/dist/src/entities/calendar/namespace.d.ts +3 -2
- package/dist/src/entities/calls/call-record.d.ts +19 -5
- package/dist/src/entities/canvases/canvas.d.ts +5 -0
- package/dist/src/entities/channels/channel.d.ts +27 -7
- package/dist/src/entities/channels/message.d.ts +65 -2
- package/dist/src/entities/channels/message.test.d.ts +1 -0
- package/dist/src/entities/channels/namespace.d.ts +9 -4
- package/dist/src/entities/channels/post.d.ts +13 -7
- package/dist/src/entities/channels/share.d.ts +9 -0
- package/dist/src/entities/channels/share.test.d.ts +1 -0
- package/dist/src/entities/channels/thread.d.ts +5 -1
- package/dist/src/entities/chats/chat.d.ts +1 -1
- package/dist/src/entities/chats/namespace.d.ts +1 -1
- package/dist/src/entities/connected-apps/connected-app.d.ts +2 -1
- package/dist/src/entities/connected-apps/namespace.d.ts +2 -0
- package/dist/src/entities/crm/company.d.ts +1 -1
- package/dist/src/entities/crm/contact.d.ts +44 -3
- package/dist/src/entities/crm/namespace.d.ts +30 -13
- package/dist/src/entities/crm/pipeline-entry.d.ts +10 -3
- package/dist/src/entities/crm/pipeline.d.ts +39 -20
- package/dist/src/entities/crm/pipelines.d.ts +33 -5
- package/dist/src/entities/crm-email-privacy/email-privacy.d.ts +238 -0
- package/dist/src/entities/crm-email-privacy/email-rule-preview.d.ts +55 -0
- package/dist/src/entities/crm-email-privacy/email-rule-revision.d.ts +27 -0
- package/dist/src/entities/crm-email-privacy/email-rules.d.ts +32 -0
- package/dist/src/entities/databases/database.d.ts +34 -6
- package/dist/src/entities/databases/namespace.d.ts +26 -6
- package/dist/src/entities/databases/saved-query.d.ts +7 -1
- package/dist/src/entities/databases/table.d.ts +9 -0
- package/dist/src/entities/databases/view.d.ts +10 -0
- package/dist/src/entities/documents/create.test.d.ts +1 -0
- package/dist/src/entities/documents/document.d.ts +41 -6
- package/dist/src/entities/documents/namespace.d.ts +17 -3
- package/dist/src/entities/email/draft.d.ts +2 -2
- package/dist/src/entities/email/message.d.ts +18 -7
- package/dist/src/entities/email/namespace.d.ts +11 -7
- package/dist/src/entities/email/thread.d.ts +26 -3
- package/dist/src/entities/entity.d.ts +10 -1
- package/dist/src/entities/external-chat/chat.d.ts +19 -2
- package/dist/src/entities/foreign/namespace.d.ts +1 -1
- package/dist/src/entities/forms/form.d.ts +20 -1
- package/dist/src/entities/harnesses/namespace.d.ts +1 -1
- package/dist/src/entities/harnesses/pairing.d.ts +2 -1
- package/dist/src/entities/imports/entry.d.ts +65 -0
- package/dist/src/entities/imports/namespace.d.ts +103 -0
- package/dist/src/entities/imports/namespace.test.d.ts +1 -0
- package/dist/src/entities/initiatives/initiative.d.ts +14 -4
- package/dist/src/entities/initiatives/namespace.d.ts +4 -2
- package/dist/src/entities/me/namespace.d.ts +1 -1
- package/dist/src/entities/meetings/meeting.d.ts +2 -1
- package/dist/src/entities/notifications/namespace.d.ts +2 -1
- package/dist/src/entities/notifications/notification.d.ts +2 -1
- package/dist/src/entities/passwords/item.d.ts +118 -0
- package/dist/src/entities/passwords/namespace.d.ts +45 -0
- package/dist/src/entities/projects/namespace.d.ts +1 -1
- package/dist/src/entities/projects/project.d.ts +11 -1
- package/dist/src/entities/referrals/namespace.d.ts +1 -1
- package/dist/src/entities/routines/namespace.d.ts +81 -18
- package/dist/src/entities/routines/routine.d.ts +65 -4
- package/dist/src/entities/routines/suggestion.d.ts +38 -0
- package/dist/src/entities/saved-views/namespace.d.ts +2 -1
- package/dist/src/entities/search/exclusions.d.ts +6 -0
- package/dist/src/entities/search/namespace.d.ts +4 -2
- package/dist/src/entities/search/options.d.ts +3 -2
- package/dist/src/entities/suggestions/namespace.d.ts +118 -0
- package/dist/src/entities/suggestions/suggestion.d.ts +172 -0
- package/dist/src/entities/suggestions/suggestion.test.d.ts +1 -0
- package/dist/src/entities/tasks/namespace.d.ts +6 -5
- package/dist/src/entities/tasks/task.d.ts +14 -2
- package/dist/src/entities/teams/team.d.ts +16 -3
- package/dist/src/entities/ui/app-link.d.ts +24 -0
- package/dist/src/entities/ui/namespace.d.ts +75 -0
- package/dist/src/entities/users/namespace.d.ts +7 -3
- package/dist/src/entities/web/namespace.d.ts +2 -2
- package/dist/src/entities/workspace/namespace.d.ts +5 -3
- package/dist/src/entities/workspace/query.test.d.ts +1 -0
- package/dist/src/events/hydrate/document.d.ts +5 -0
- package/dist/src/macro.d.ts +26 -1
- package/dist/src/macro.js +4086 -1234
- package/dist/src/utils/activity.d.ts +2 -0
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/lazy.d.ts +13 -0
- package/dist/src/utils/options.d.ts +7 -0
- package/dist/src/utils/pagination.d.ts +16 -0
- package/dist/src/utils/verbs.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,8 +63,8 @@ An API key always acts as the user who minted it. `requestedAs` is bot-only.
|
|
|
63
63
|
#### Agent accounts
|
|
64
64
|
|
|
65
65
|
An agent has its own account and seat. Invite one with
|
|
66
|
-
`(await macro.teams.current()).invite('agent@example.com', { agent: true })
|
|
67
|
-
up at https://macro.com/app/signup/agent. After signing in, the agent sees its API key once in the
|
|
66
|
+
`(await macro.teams.current()).invite('agent@example.com', { agent: true })` from your own
|
|
67
|
+
key (an agent's program is refused), or sign up at https://macro.com/app/signup/agent. After signing in, the agent sees its API key once in the
|
|
68
68
|
web app and uses it like any other key. It can set up its profile with
|
|
69
69
|
`macro.me.update({ name, profilePicture: await macro.me.uploadProfilePicture(bytes, options) })`
|
|
70
70
|
and mint more keys with `macro.apiKeys.create(name)`.
|
|
@@ -88,7 +88,9 @@ const grant = await macro.accountManagers.askToManage(person);
|
|
|
88
88
|
const token = await grant.claimToken();
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
An agent's program (ExecuteCode, a routine) can't ask, approve or claim: those return 403,
|
|
92
|
+
so an agent account uses its own API key. A person can ask instead, with
|
|
93
|
+
`macro.accountManagers.askToBeManagedBy(agent)`. Only the
|
|
92
94
|
manager can claim, so the agent approves and claims with its own client, using the grant id
|
|
93
95
|
from the card in the DM: `macro.accountManagers.byId(id)`.
|
|
94
96
|
|
|
@@ -183,15 +185,38 @@ await doc.setTeamShare(true);
|
|
|
183
185
|
await doc.delete(); // soft delete; doc.restore() brings it back
|
|
184
186
|
```
|
|
185
187
|
|
|
188
|
+
### Entity appearance
|
|
189
|
+
|
|
190
|
+
Markdown documents, snippets, initiatives (task projects), forms, databases,
|
|
191
|
+
and routines expose `appearance()` and `setAppearance()`. Appearance is shared
|
|
192
|
+
with other viewers and requires edit access to change.
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
await doc.setAppearance({
|
|
196
|
+
icon: { kind: 'emoji', value: '🌱' },
|
|
197
|
+
color: 'green',
|
|
198
|
+
});
|
|
199
|
+
const appearance = await doc.appearance();
|
|
200
|
+
await doc.setAppearance({}); // restore the default icon and color
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Writes replace both overrides without changing content timestamps. Omit an
|
|
204
|
+
override to restore its default. Colors use the same twelve-color palette as
|
|
205
|
+
tags and only tint Macro icons; native emoji keep their own colors.
|
|
206
|
+
|
|
207
|
+
### Sharing permissions
|
|
186
208
|
Documents, projects, calls and chats change their link and channel sharing with
|
|
187
|
-
`updateSharePermissions`; omitted fields are left as they are.
|
|
188
|
-
|
|
209
|
+
`updateSharePermissions`; omitted fields are left as they are. Any item a
|
|
210
|
+
channel message can carry (a document or task, project, database, form, call,
|
|
211
|
+
email thread, agent session, external chat or calendar event) is shared with a
|
|
212
|
+
channel's current members, as posting it there does, through `shareWithChannel`:
|
|
189
213
|
|
|
190
214
|
```ts
|
|
191
215
|
await project.updateSharePermissions({
|
|
192
216
|
linkShareAccessLevel: 'view',
|
|
193
217
|
channelSharePermissions: [{ channel, accessLevel: 'comment', operation: 'add' }],
|
|
194
218
|
});
|
|
219
|
+
await doc.shareWithChannel(channel);
|
|
195
220
|
await event.shareWithChannel(channel);
|
|
196
221
|
```
|
|
197
222
|
|
|
@@ -259,6 +284,7 @@ server refuses anything but one `SELECT` that compiles, and chart columns the
|
|
|
259
284
|
`SELECT` does not return (`POST /databases/queries`). `toBlock()` is the
|
|
260
285
|
`<m-db-query>` block to put in a document's Markdown; it re-runs for whoever
|
|
261
286
|
views it. `withView()` restyles the answer without saving a new question.
|
|
287
|
+
`macro.databases.saveQuery()` saves a question whose tables span databases.
|
|
262
288
|
|
|
263
289
|
```ts
|
|
264
290
|
const question = await database.saveQuery({
|
|
@@ -442,26 +468,39 @@ await macro.channels
|
|
|
442
468
|
.send(msg`Deploy ${sha} finished. ${here}`);
|
|
443
469
|
```
|
|
444
470
|
|
|
471
|
+
Pass `{ silent: true }` to `send` or `reply` for a routine update that should
|
|
472
|
+
notify nobody, mentioned people included; the message still appears in the
|
|
473
|
+
channel. It works with every credential.
|
|
474
|
+
|
|
445
475
|
### Routines
|
|
446
476
|
|
|
447
|
-
Create scheduled or event-triggered
|
|
448
|
-
|
|
477
|
+
Create scheduled or event-triggered routines through `macro.routines`. A
|
|
478
|
+
routine runs `steps` in order: an `agent` ("Ask AI") step hands the run to a
|
|
479
|
+
model or agent, and `code` steps run TypeScript against this SDK as the owner,
|
|
480
|
+
type-checked when saved. Routine configuration takes typed agent and event
|
|
481
|
+
resource handles:
|
|
449
482
|
|
|
450
483
|
```ts
|
|
451
484
|
const routine = await macro.routines.create({
|
|
452
485
|
name: 'Daily summary',
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
486
|
+
trigger: { type: 'cron', schedule: '0 0 9 * * *', timezone: 'America/New_York' },
|
|
487
|
+
steps: [
|
|
488
|
+
{
|
|
489
|
+
type: 'agent',
|
|
490
|
+
instructions: 'Summarize my open tasks.',
|
|
491
|
+
model: 'anthropic/claude-sonnet-5-5',
|
|
492
|
+
},
|
|
493
|
+
],
|
|
456
494
|
});
|
|
457
495
|
await routine.setEnabled(false);
|
|
458
496
|
const transcript = await routine.execute(); // Chat or AgentSession, if available
|
|
459
497
|
const executions = await routine.history(); // Each retains its parent routine
|
|
460
498
|
```
|
|
461
499
|
|
|
462
|
-
A
|
|
463
|
-
|
|
464
|
-
|
|
500
|
+
A cron `schedule` has 6 fields (second minute hour day-of-month month
|
|
501
|
+
day-of-week) or 7 with a year. The older single agent task (`prompt` and
|
|
502
|
+
`userPrompt`, with `model`, `agent` or both, instead of `steps`) still saves
|
|
503
|
+
and runs as one Ask AI step. Code steps' writes are attributed to Macro's
|
|
465
504
|
agent acting for the owner; set `dangerouslyOperateAsUser: true` only when the
|
|
466
505
|
user explicitly asks for the routine to act, send or post as them:
|
|
467
506
|
|
|
@@ -601,12 +640,93 @@ fails with a 409 conflict instead of being overwritten, and `view.refresh()`
|
|
|
601
640
|
picks up the current revision. Order is personal; `reorder` sets yours for one
|
|
602
641
|
kind.
|
|
603
642
|
|
|
643
|
+
### CRM email contribution
|
|
644
|
+
|
|
645
|
+
`macro.crm.emailPrivacy` manages only the authenticated member's contribution,
|
|
646
|
+
including when their CRM viewing permission is off. `get()` is read-only and
|
|
647
|
+
returns the current mode, selectors, mailbox handle and observed-state token.
|
|
648
|
+
`settings()` reads domain exclusions; `excludedThreads()` lazily lists private
|
|
649
|
+
thread exceptions. Existing team-wide domain methods remain on `macro.crm`;
|
|
650
|
+
`emailPrivacy.blockDomain` and `unblockDomain` edit personal exclusions.
|
|
651
|
+
|
|
652
|
+
Rules use `{ schemaVersion: 1, include: [...] }`. Selectors are `thread` with an
|
|
653
|
+
`EmailThread`, `contact` with a `Contact`, `company` with a `Company`, or
|
|
654
|
+
`address` / `domain` with the corresponding string. A participant match includes
|
|
655
|
+
the whole thread, across eligible past and future mail. Contact/company rules
|
|
656
|
+
follow live records. Private-thread, domain and personal-email exclusions always
|
|
657
|
+
win. Narrowing or withdrawal leaves CRM records in place; a teammate's eligible
|
|
658
|
+
copy remains independent.
|
|
659
|
+
|
|
660
|
+
```ts
|
|
661
|
+
const privacy = macro.crm.emailPrivacy;
|
|
662
|
+
const state = await privacy.get();
|
|
663
|
+
if (!state.authoringAvailable || !state.token) {
|
|
664
|
+
throw new Error('Selective contribution is unavailable.');
|
|
665
|
+
}
|
|
666
|
+
const checked = await privacy.validateRules({
|
|
667
|
+
schemaVersion: 1,
|
|
668
|
+
include: [{ kind: 'domain', domain: 'example.com' }],
|
|
669
|
+
});
|
|
670
|
+
const idempotencyKey = crypto.randomUUID();
|
|
671
|
+
const result = await privacy.replaceRules(checked.rules, {
|
|
672
|
+
ifPolicy: state.token,
|
|
673
|
+
idempotencyKey,
|
|
674
|
+
});
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
`replaceRules` directly activates the replacement; member-authorized agents need
|
|
678
|
+
no separate human confirmation. `enableAll` and `withdraw` take the same options.
|
|
679
|
+
Keep the exact token, key and command for retries. A 409 requires fresh inspection
|
|
680
|
+
and a new decision; the SDK never refreshes or retries automatically. A result
|
|
681
|
+
with `replayed: true` describes the original commit, not current sharing. Server
|
|
682
|
+
rollout and credential restrictions remain authoritative.
|
|
683
|
+
|
|
684
|
+
Optional counts use `preview()` to inspect the current slot, then
|
|
685
|
+
`previewRules(rules, { ifPolicy: state.token, ifPreview: previousPreview })`.
|
|
686
|
+
A preview handle's `get()` refreshes only that preview and `cancel()` names that
|
|
687
|
+
exact identity. Superseded handles cannot read or cancel newer work. Only
|
|
688
|
+
`status: 'complete'` means exact counts; running/partial counts are lower bounds,
|
|
689
|
+
and stale/cancelled results are not current estimates. Counts are mailbox-local,
|
|
690
|
+
limited to 10,000 scanned raw threads and five minutes. Previewing does not grant
|
|
691
|
+
contribution or schedule mail backfill.
|
|
692
|
+
|
|
693
|
+
`history()` iterates owner-only audit events in pages of fifty. Revision handles
|
|
694
|
+
on current state, mutation outcomes and history read immutable definitions with
|
|
695
|
+
`get()`; they never fetch target content or reapply rules. Verified agent/session
|
|
696
|
+
provenance is read from history, never supplied by the caller.
|
|
697
|
+
|
|
698
|
+
Legacy members without a policy token retain `setConsent(false)` for withdrawal.
|
|
699
|
+
`setConsent(true, inbox)` uses the existing all-mail opt-in, bound to the chosen
|
|
700
|
+
primary inbox; members with a policy token use `enableAll` / `withdraw` instead.
|
|
701
|
+
`setThreadExcluded(thread, excluded)` reuses the existing thread-exclusion API and
|
|
702
|
+
its rollout gate. The SDK changes no flags and adds no settings UI.
|
|
703
|
+
|
|
704
|
+
### CRM member access
|
|
705
|
+
|
|
706
|
+
`macro.crm.access()` reads the caller's current team and effective CRM access,
|
|
707
|
+
even when access is denied. `team.members()` includes `crmAccess` for each member.
|
|
708
|
+
Admins and owners use `team.setMemberCrmAccess(user, enabled)` to deny or restore
|
|
709
|
+
an ordinary member; admins and owners cannot be denied. This never changes the
|
|
710
|
+
member's mailbox contribution consent. The mutation returns 503 until the
|
|
711
|
+
server rollout enables access changes; existing denials remain enforced while
|
|
712
|
+
changes are disabled. Record, search, email and tool requests
|
|
713
|
+
recheck access on the server. A separately shared pipeline still exposes its own
|
|
714
|
+
rows and cell values, while its CRM record references need separate access.
|
|
715
|
+
|
|
604
716
|
### CRM contact fields
|
|
605
717
|
|
|
606
|
-
`
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
718
|
+
A contact holds several addresses, one of them primary: `contact.emails()` lists
|
|
719
|
+
them, primary first. `addEmail(address)` adds one, `setEmail(address)` makes one
|
|
720
|
+
the primary (adding it when the contact does not hold it), and
|
|
721
|
+
`removeEmail(address)` removes one; removing the primary promotes the oldest
|
|
722
|
+
address left. Removing an address deletes nothing else: the contact stops
|
|
723
|
+
showing that address's mail. An identical retry of any of them is safe.
|
|
724
|
+
|
|
725
|
+
`setCompany(company)` links or switches a contact with a personal-provider
|
|
726
|
+
primary to a Company handle in the same team, and `unlinkCompany()` removes the
|
|
727
|
+
link. A contact with an address on one of its company's domains
|
|
728
|
+
(`contact.companyDomain()`) can do neither, and the last of those addresses
|
|
729
|
+
(`contact.companyDomainEmails()`) cannot be removed. All of them preserve
|
|
610
730
|
identity and reject same-team email conflicts without merging records.
|
|
611
731
|
|
|
612
732
|
### CRM pipelines and initiatives
|
|
@@ -623,6 +743,14 @@ atomic database operation contract, including batch-local UUIDs, like
|
|
|
623
743
|
`Database.applyOps`. Table and column reads share a schema cache invalidated by
|
|
624
744
|
successful batches. Call `row.refresh()` to reload a row after a batch changes it.
|
|
625
745
|
|
|
746
|
+
A pipeline that tracks companies or contacts has an **Outcome** field (`Open`,
|
|
747
|
+
`Won` or `Lost`, independent of Stage) and a currency field beside each
|
|
748
|
+
monetary field, such as `Revenue currency`; new entries default to `Open` and
|
|
749
|
+
`USD`, and neither field can be emptied. `listWithFields()` and `find()` name
|
|
750
|
+
each monetary field's `currencyField`, `find()` returns one total per
|
|
751
|
+
`currency` for it, never converted or combined, and an update's changes carry
|
|
752
|
+
`beforeCurrency` and `afterCurrency` for a monetary field.
|
|
753
|
+
|
|
626
754
|
`macro.initiatives.create/byId` groups tasks and members. Relations return user
|
|
627
755
|
and task handles; `initiative.update({ name, members, sharePermission })` and
|
|
628
756
|
`delete()` manage it. `initiatives.list({ query, status, priority, assignee,
|
|
@@ -780,8 +908,10 @@ takes typed source/target references and returns a deletable mention handle.
|
|
|
780
908
|
`macro.unfurls.get(url)` and `bulk(urls)` read URL preview metadata.
|
|
781
909
|
|
|
782
910
|
`macro.apiKeys.create(name)` returns `{ key, secret }`. Save the secret immediately;
|
|
783
|
-
the handle only retains metadata.
|
|
784
|
-
|
|
911
|
+
the handle only retains metadata. It and `bot.createToken()` are refused to an
|
|
912
|
+
agent's program (ExecuteCode, a routine), whose results reach the model. `list()` and `key.delete()` manage keys.
|
|
913
|
+
`tokenForEmail(email)` exchanges credentials subject to ordinary server authorization;
|
|
914
|
+
an agent's program is refused.
|
|
785
915
|
|
|
786
916
|
`chat.send({ content, model, attachments, toolset })` starts a generation and returns
|
|
787
917
|
its chat, response message and cancellable stream handle. Use
|
|
@@ -815,7 +945,9 @@ const stop = await macro.events.listen();
|
|
|
815
945
|
model as persisted webhooks. If you omit `filters`, it derives one filter from
|
|
816
946
|
the event names already registered with `.on()`. Pass `scope: 'team'` for a
|
|
817
947
|
team workspace (defaults to `'user'`). Delivery is best-effort: there is no
|
|
818
|
-
replay if you disconnect.
|
|
948
|
+
replay if you disconnect. Reconnecting sends `Last-Event-ID`, but the service
|
|
949
|
+
replays only for clients that also ask `resume=true`, which `listen()` does
|
|
950
|
+
not, so a reconnected listener gets the live stream as before.
|
|
819
951
|
|
|
820
952
|
Handlers receive the same hydrated payloads as webhook deliveries — ORM
|
|
821
953
|
handles for every entity the event names.
|
|
@@ -951,9 +1083,10 @@ the build.
|
|
|
951
1083
|
|
|
952
1084
|
You can add exceptions for stuff OpenAPI covers that we don't want the sdk to
|
|
953
1085
|
support by adding them to the `src/coverage/skipped.ts`. You can implement
|
|
954
|
-
support by adding a wrapper to the appropriate model.
|
|
955
|
-
|
|
956
|
-
|
|
1086
|
+
support by adding a wrapper to the appropriate model. Every wrapped generated
|
|
1087
|
+
method also needs a hand-assigned display verb in `src/utils/verbs.ts`; choose a
|
|
1088
|
+
read verb for a POST that only reads. Coverage fails for missing or stale verb
|
|
1089
|
+
entries as well as uncovered endpoints.
|
|
957
1090
|
|
|
958
1091
|
## Events
|
|
959
1092
|
|
|
@@ -1402,7 +1402,7 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1402
1402
|
/**
|
|
1403
1403
|
* Answer a tool call the agent made in a turn somebody other than the
|
|
1404
1404
|
* session's owner prompted. Approve and deny are the owner's; cancel is
|
|
1405
|
-
* anyone's with edit access.
|
|
1405
|
+
* anyone's with edit access. Agent runs may deny or cancel, but never approve.
|
|
1406
1406
|
*/
|
|
1407
1407
|
answerAgentSessionToolApproval(options) {
|
|
1408
1408
|
return (options.client ?? this.client).post({
|
|
@@ -1414,6 +1414,21 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1414
1414
|
}
|
|
1415
1415
|
});
|
|
1416
1416
|
}
|
|
1417
|
+
/**
|
|
1418
|
+
* Open an item in a new pane of the app tab the person who prompted the
|
|
1419
|
+
* running turn typed in. Only a running execution of the session's current
|
|
1420
|
+
* turn may send, as the account it acts as.
|
|
1421
|
+
*/
|
|
1422
|
+
openInApp(options) {
|
|
1423
|
+
return (options.client ?? this.client).post({
|
|
1424
|
+
url: "/agent-sessions/{session_id}/ui-commands",
|
|
1425
|
+
...options,
|
|
1426
|
+
headers: {
|
|
1427
|
+
"Content-Type": "application/json",
|
|
1428
|
+
...options.headers
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1417
1432
|
/**
|
|
1418
1433
|
* Present a view in the session: a review with nothing saved.
|
|
1419
1434
|
*/
|
|
@@ -1460,6 +1475,37 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1460
1475
|
...options
|
|
1461
1476
|
});
|
|
1462
1477
|
}
|
|
1478
|
+
/**
|
|
1479
|
+
* How Claude Code on the computer is paid for.
|
|
1480
|
+
*/
|
|
1481
|
+
getClaudeMode(options) {
|
|
1482
|
+
return (options.client ?? this.client).get({ url: "/harnesses/{harness_id}/claude-mode", ...options });
|
|
1483
|
+
}
|
|
1484
|
+
/**
|
|
1485
|
+
* Start a Claude sign-in on the computer and return its URL.
|
|
1486
|
+
*/
|
|
1487
|
+
startClaudeSignIn(options) {
|
|
1488
|
+
return (options.client ?? this.client).post({ url: "/harnesses/{harness_id}/claude-sign-in", ...options });
|
|
1489
|
+
}
|
|
1490
|
+
/**
|
|
1491
|
+
* Finish the Claude sign-in with what the user pasted.
|
|
1492
|
+
*/
|
|
1493
|
+
completeClaudeSignIn(options) {
|
|
1494
|
+
return (options.client ?? this.client).post({
|
|
1495
|
+
url: "/harnesses/{harness_id}/claude-sign-in/complete",
|
|
1496
|
+
...options,
|
|
1497
|
+
headers: {
|
|
1498
|
+
"Content-Type": "application/json",
|
|
1499
|
+
...options.headers
|
|
1500
|
+
}
|
|
1501
|
+
});
|
|
1502
|
+
}
|
|
1503
|
+
/**
|
|
1504
|
+
* Forget the computer's Claude credential and return it to Macro credits.
|
|
1505
|
+
*/
|
|
1506
|
+
claudeSignOut(options) {
|
|
1507
|
+
return (options.client ?? this.client).post({ url: "/harnesses/{harness_id}/claude-sign-out", ...options });
|
|
1508
|
+
}
|
|
1463
1509
|
/**
|
|
1464
1510
|
* Classify a draft for the authenticated user.
|
|
1465
1511
|
*/
|
|
@@ -1486,6 +1532,19 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1486
1532
|
}
|
|
1487
1533
|
});
|
|
1488
1534
|
}
|
|
1535
|
+
/**
|
|
1536
|
+
* The voices an agent teammate can speak with on calls. Team admins only.
|
|
1537
|
+
*/
|
|
1538
|
+
getAgentVoices(options) {
|
|
1539
|
+
return (options?.client ?? this.client).get({ url: "/voices", ...options });
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* A catalog voice saying a fixed line, as WAV. Team admins only; the first
|
|
1543
|
+
* play of each voice is billed to the admin's team.
|
|
1544
|
+
*/
|
|
1545
|
+
getAgentVoiceSample(options) {
|
|
1546
|
+
return (options.client ?? this.client).get({ url: "/voices/{model}/sample", ...options });
|
|
1547
|
+
}
|
|
1489
1548
|
};
|
|
1490
1549
|
|
|
1491
1550
|
export {
|
|
@@ -1482,6 +1482,91 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1482
1482
|
toggleTeamAutoJoinDomain(options) {
|
|
1483
1483
|
return (options?.client ?? this.client).post({ url: "/team/auto-join-domain/toggle", ...options });
|
|
1484
1484
|
}
|
|
1485
|
+
/**
|
|
1486
|
+
* The team's computers, oldest first.
|
|
1487
|
+
*/
|
|
1488
|
+
listTeamComputers(options) {
|
|
1489
|
+
return (options?.client ?? this.client).get({ url: "/team/computers", ...options });
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Buy a computer for the team, billed on the team subscription. An error
|
|
1493
|
+
* means nothing was charged; 202 means the charge is still being confirmed.
|
|
1494
|
+
*/
|
|
1495
|
+
purchaseTeamComputer(options) {
|
|
1496
|
+
return (options.client ?? this.client).post({
|
|
1497
|
+
url: "/team/computers",
|
|
1498
|
+
...options,
|
|
1499
|
+
headers: {
|
|
1500
|
+
"Content-Type": "application/json",
|
|
1501
|
+
...options.headers
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* Every size with its price and availability.
|
|
1507
|
+
*/
|
|
1508
|
+
listTeamComputerOffers(options) {
|
|
1509
|
+
return (options?.client ?? this.client).get({ url: "/team/computers/offers", ...options });
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Keep a computer that was canceled at period end.
|
|
1513
|
+
*/
|
|
1514
|
+
undoCancelTeamComputer(options) {
|
|
1515
|
+
return (options.client ?? this.client).delete({ url: "/team/computers/{computer_id}/cancel", ...options });
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Stop billing at the end of the current period.
|
|
1519
|
+
*/
|
|
1520
|
+
cancelTeamComputer(options) {
|
|
1521
|
+
return (options.client ?? this.client).post({ url: "/team/computers/{computer_id}/cancel", ...options });
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Turn a computer on or off. A computer that is off keeps its disk and stays billed.
|
|
1525
|
+
*/
|
|
1526
|
+
setTeamComputerPower(options) {
|
|
1527
|
+
return (options.client ?? this.client).post({
|
|
1528
|
+
url: "/team/computers/{computer_id}/power",
|
|
1529
|
+
...options,
|
|
1530
|
+
headers: {
|
|
1531
|
+
"Content-Type": "application/json",
|
|
1532
|
+
...options.headers
|
|
1533
|
+
}
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Stop billing and destroy the computer now, without a refund.
|
|
1538
|
+
*/
|
|
1539
|
+
releaseTeamComputer(options) {
|
|
1540
|
+
return (options.client ?? this.client).post({
|
|
1541
|
+
url: "/team/computers/{computer_id}/release",
|
|
1542
|
+
...options,
|
|
1543
|
+
headers: {
|
|
1544
|
+
"Content-Type": "application/json",
|
|
1545
|
+
...options.headers
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Keep a computer whose billing ended, during retention: re-adds its
|
|
1551
|
+
* billing item (the rest of the period is invoiced now) and keeps the
|
|
1552
|
+
* stopped computer and its disk.
|
|
1553
|
+
*/
|
|
1554
|
+
restoreTeamComputer(options) {
|
|
1555
|
+
return (options.client ?? this.client).post({ url: "/team/computers/{computer_id}/restore", ...options });
|
|
1556
|
+
}
|
|
1557
|
+
/**
|
|
1558
|
+
* Retry a failed computer without changing billing.
|
|
1559
|
+
*/
|
|
1560
|
+
retryTeamComputer(options) {
|
|
1561
|
+
return (options.client ?? this.client).post({ url: "/team/computers/{computer_id}/retry", ...options });
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Mark the guided setup after buying the computer finished. Idempotent;
|
|
1565
|
+
* allowed to the team's owner and admins, like Claude sign-in.
|
|
1566
|
+
*/
|
|
1567
|
+
completeTeamComputerSetup(options) {
|
|
1568
|
+
return (options.client ?? this.client).post({ url: "/team/computers/{computer_id}/setup-complete", ...options });
|
|
1569
|
+
}
|
|
1485
1570
|
/**
|
|
1486
1571
|
* Legacy compatibility endpoint for team admins and owners. Enabling
|
|
1487
1572
|
* is a no-op; disabling is rejected. CRM records remain available.
|
|
@@ -1636,6 +1721,54 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
1636
1721
|
getUserInvites(options) {
|
|
1637
1722
|
return (options?.client ?? this.client).get({ url: "/team/user/invites", ...options });
|
|
1638
1723
|
}
|
|
1724
|
+
/**
|
|
1725
|
+
* The caller's team's agents, with their computers' status.
|
|
1726
|
+
*/
|
|
1727
|
+
listTeamAgents(options) {
|
|
1728
|
+
return (options?.client ?? this.client).get({ url: "/team_agents", ...options });
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Invite an agent teammate and buy its computer. Requires a team admin or
|
|
1732
|
+
* owner using their own credential. The agent comes back `provisioning`.
|
|
1733
|
+
*/
|
|
1734
|
+
createTeamAgent(options) {
|
|
1735
|
+
return (options.client ?? this.client).post({
|
|
1736
|
+
url: "/team_agents",
|
|
1737
|
+
...options,
|
|
1738
|
+
headers: {
|
|
1739
|
+
"Content-Type": "application/json",
|
|
1740
|
+
...options.headers
|
|
1741
|
+
}
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* Remove an agent teammate: release its computer, take it off the team and
|
|
1746
|
+
* delete its repository and account. Requires a team admin or owner.
|
|
1747
|
+
*/
|
|
1748
|
+
deleteTeamAgent(options) {
|
|
1749
|
+
return (options.client ?? this.client).delete({ url: "/team_agents/{agent_user_id}", ...options });
|
|
1750
|
+
}
|
|
1751
|
+
/**
|
|
1752
|
+
* The agent's call voice, as committed in its workspace repository.
|
|
1753
|
+
* Requires a team admin or owner.
|
|
1754
|
+
*/
|
|
1755
|
+
getTeamAgentVoice(options) {
|
|
1756
|
+
return (options.client ?? this.client).get({ url: "/team_agents/{agent_user_id}/voice", ...options });
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* Change the agent's call voice: a commit to its workspace repository that
|
|
1760
|
+
* its next call picks up. Requires a team admin or owner.
|
|
1761
|
+
*/
|
|
1762
|
+
setTeamAgentVoice(options) {
|
|
1763
|
+
return (options.client ?? this.client).put({
|
|
1764
|
+
url: "/team_agents/{agent_user_id}/voice",
|
|
1765
|
+
...options,
|
|
1766
|
+
headers: {
|
|
1767
|
+
"Content-Type": "application/json",
|
|
1768
|
+
...options.headers
|
|
1769
|
+
}
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1639
1772
|
/**
|
|
1640
1773
|
* Finishes an agent's signup: joins the team that invited it and mints its
|
|
1641
1774
|
* SDK token.
|
|
@@ -823,6 +823,12 @@ var Sdk = class _Sdk extends HeyApiClient {
|
|
|
823
823
|
}
|
|
824
824
|
});
|
|
825
825
|
}
|
|
826
|
+
/**
|
|
827
|
+
* GET /contacts/search handler: ranked search of the viewer's contacts and team.
|
|
828
|
+
*/
|
|
829
|
+
searchPeople(options) {
|
|
830
|
+
return (options.client ?? this.client).get({ url: "/contacts/search", ...options });
|
|
831
|
+
}
|
|
826
832
|
};
|
|
827
833
|
|
|
828
834
|
export {
|