@m8tes/sdk 0.1.0-alpha.7 → 0.1.0-alpha.8
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/CHANGELOG.md +13 -1
- package/README.md +29 -0
- package/dist/index.cjs +72 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +137 -2
- package/dist/index.d.ts +137 -2
- package/dist/index.js +72 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -157,6 +157,12 @@ interface Agent {
|
|
|
157
157
|
metadata: JsonObject | null;
|
|
158
158
|
default_permission_mode: string;
|
|
159
159
|
status: string;
|
|
160
|
+
/** Whether the caller may edit or configure this agent within their granted scope. */
|
|
161
|
+
can_manage: boolean;
|
|
162
|
+
/** Whether the caller may run this agent with its configured credentials. */
|
|
163
|
+
can_execute: boolean;
|
|
164
|
+
/** Whether the caller owns the Mate and may expose sharing controls. */
|
|
165
|
+
can_share: boolean;
|
|
160
166
|
created_at: string;
|
|
161
167
|
updated_at?: string | null;
|
|
162
168
|
model?: string | null;
|
|
@@ -171,6 +177,8 @@ interface Agent {
|
|
|
171
177
|
enable_task_setup_tools?: boolean | null;
|
|
172
178
|
enable_feedback?: boolean | null;
|
|
173
179
|
enable_self_improvement?: boolean | null;
|
|
180
|
+
group_id?: number | null;
|
|
181
|
+
group_name?: string | null;
|
|
174
182
|
/** Most recent run activity in the last 90 days; null if idle longer. */
|
|
175
183
|
last_active_at?: string | null;
|
|
176
184
|
/** How many runs are executing or awaiting approval right now. */
|
|
@@ -344,6 +352,63 @@ interface EndUserUsage {
|
|
|
344
352
|
period_end: string;
|
|
345
353
|
rate_per_minute?: number | null;
|
|
346
354
|
}
|
|
355
|
+
interface GroupPathItem {
|
|
356
|
+
id: number;
|
|
357
|
+
name: string;
|
|
358
|
+
}
|
|
359
|
+
type GroupMemberRole = "viewer" | "runner" | "editor";
|
|
360
|
+
/** A recursive Team folder. `path` contains visible ancestors from root to parent. */
|
|
361
|
+
interface Group {
|
|
362
|
+
id: number;
|
|
363
|
+
name: string;
|
|
364
|
+
visibility: string;
|
|
365
|
+
created_at: string;
|
|
366
|
+
display_order?: number | null;
|
|
367
|
+
user_id?: string | null;
|
|
368
|
+
updated_at?: string | null;
|
|
369
|
+
/** Null also represents a hidden ancestor, so callers only build from returned rows. */
|
|
370
|
+
parent_id: number | null;
|
|
371
|
+
path: GroupPathItem[];
|
|
372
|
+
can_manage: boolean;
|
|
373
|
+
can_leave: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface GroupMember {
|
|
376
|
+
member_id: number;
|
|
377
|
+
name: string;
|
|
378
|
+
email: string;
|
|
379
|
+
role: GroupMemberRole;
|
|
380
|
+
inherited: boolean;
|
|
381
|
+
inherited_from_group_id: number | null;
|
|
382
|
+
inherited_from_group_name: string | null;
|
|
383
|
+
can_remove: boolean;
|
|
384
|
+
}
|
|
385
|
+
interface GroupInvite {
|
|
386
|
+
id: number;
|
|
387
|
+
email: string;
|
|
388
|
+
role: GroupMemberRole;
|
|
389
|
+
status: string;
|
|
390
|
+
created_at: string;
|
|
391
|
+
expires_at: string;
|
|
392
|
+
email_sent: boolean | null;
|
|
393
|
+
}
|
|
394
|
+
interface GroupInvitePreview {
|
|
395
|
+
group_name: string;
|
|
396
|
+
inviter_name: string;
|
|
397
|
+
email: string;
|
|
398
|
+
valid: boolean;
|
|
399
|
+
matches_current_user: boolean;
|
|
400
|
+
requires_verification: boolean;
|
|
401
|
+
role: GroupMemberRole;
|
|
402
|
+
}
|
|
403
|
+
interface GroupShareSkipped {
|
|
404
|
+
agent_id: number;
|
|
405
|
+
reason: string;
|
|
406
|
+
}
|
|
407
|
+
interface GroupShareResult {
|
|
408
|
+
visibility: string;
|
|
409
|
+
updated: number[];
|
|
410
|
+
skipped: GroupShareSkipped[];
|
|
411
|
+
}
|
|
347
412
|
/**
|
|
348
413
|
* One saved memory. `user_id` is the scope: your end-user's id, or `null` for an
|
|
349
414
|
* account-level memory. `source` says who wrote it — `"api"` for ones you create
|
|
@@ -609,6 +674,8 @@ interface AgentCreateParams {
|
|
|
609
674
|
goals?: string;
|
|
610
675
|
/** Your id for the end-user who owns this agent. */
|
|
611
676
|
user_id?: string;
|
|
677
|
+
/** Optional Team (`client.groups`) to place the agent in. */
|
|
678
|
+
group_id?: number;
|
|
612
679
|
metadata?: JsonObject;
|
|
613
680
|
model?: string;
|
|
614
681
|
effort?: string;
|
|
@@ -647,6 +714,8 @@ interface AgentUpdateParams {
|
|
|
647
714
|
default_permission_mode?: PermissionMode | null;
|
|
648
715
|
/** Who can see this agent. Omit or null leaves it unchanged. */
|
|
649
716
|
visibility?: "personal" | "organization" | null;
|
|
717
|
+
/** Move into a Team, `null` to ungroup, or omit to leave unchanged. */
|
|
718
|
+
group_id?: number | null;
|
|
650
719
|
allowed_senders?: string[] | null;
|
|
651
720
|
enable_memory?: boolean | null;
|
|
652
721
|
enable_history?: boolean | null;
|
|
@@ -1033,6 +1102,71 @@ interface MemoriesResource {
|
|
|
1033
1102
|
}
|
|
1034
1103
|
declare function createMemoriesResource(http: Http): MemoriesResource;
|
|
1035
1104
|
|
|
1105
|
+
/**
|
|
1106
|
+
* `client.groups` — recursive Teams with inherited viewer, runner, and editor roles.
|
|
1107
|
+
*
|
|
1108
|
+
* Group CRUD keeps the API's optional `user_id` end-user isolation. Human membership and
|
|
1109
|
+
* invitation calls are account-scoped, so those methods deliberately do not accept `user_id`.
|
|
1110
|
+
* The legacy `share()` operation remains independent: it bulk-updates direct Mates' personal or
|
|
1111
|
+
* organization visibility and does not create a recursive Team grant.
|
|
1112
|
+
*/
|
|
1113
|
+
|
|
1114
|
+
interface GroupCreateParams {
|
|
1115
|
+
name: string;
|
|
1116
|
+
user_id?: string;
|
|
1117
|
+
display_order?: number;
|
|
1118
|
+
parent_id?: number | null;
|
|
1119
|
+
}
|
|
1120
|
+
interface GroupUpdateParams {
|
|
1121
|
+
name?: string;
|
|
1122
|
+
display_order?: number | null;
|
|
1123
|
+
/** Move under another Team, `null` for the root, or omit to leave unchanged. */
|
|
1124
|
+
parent_id?: number | null;
|
|
1125
|
+
/** End-user isolation is sent in the query and is never part of the update body. */
|
|
1126
|
+
user_id?: string;
|
|
1127
|
+
}
|
|
1128
|
+
interface GroupsResource {
|
|
1129
|
+
create(params: GroupCreateParams): Promise<Group>;
|
|
1130
|
+
list(params?: {
|
|
1131
|
+
user_id?: string;
|
|
1132
|
+
}): Promise<Page<Group>>;
|
|
1133
|
+
get(groupId: number, params?: {
|
|
1134
|
+
user_id?: string;
|
|
1135
|
+
}): Promise<Group>;
|
|
1136
|
+
update(groupId: number, params: GroupUpdateParams): Promise<Group>;
|
|
1137
|
+
/** Recursively delete this Team and its children; Mates in the subtree become ungrouped. */
|
|
1138
|
+
delete(groupId: number, params?: {
|
|
1139
|
+
user_id?: string;
|
|
1140
|
+
}): Promise<void>;
|
|
1141
|
+
/** Legacy bulk direct-Mate visibility operation, independent of Team membership grants. */
|
|
1142
|
+
share(groupId: number, params: {
|
|
1143
|
+
visibility: "personal" | "organization";
|
|
1144
|
+
user_id?: string;
|
|
1145
|
+
}): Promise<GroupShareResult>;
|
|
1146
|
+
/** Managers-only account-scoped view of direct and inherited members. */
|
|
1147
|
+
members(groupId: number): Promise<Page<GroupMember>>;
|
|
1148
|
+
/** Alias for `members()`. */
|
|
1149
|
+
listMembers(groupId: number): Promise<Page<GroupMember>>;
|
|
1150
|
+
/** Change a direct grant's role. Managers only; account-scoped. */
|
|
1151
|
+
updateMember(groupId: number, memberId: number, params: {
|
|
1152
|
+
role: GroupMemberRole;
|
|
1153
|
+
}): Promise<GroupMember>;
|
|
1154
|
+
/** Remove a direct grant. Managers and the directly granted member may call this. */
|
|
1155
|
+
removeMember(groupId: number, memberId: number): Promise<void>;
|
|
1156
|
+
/** Managers-only account-scoped list of invitations. */
|
|
1157
|
+
invites(groupId: number): Promise<Page<GroupInvite>>;
|
|
1158
|
+
/** Alias for `invites()`. */
|
|
1159
|
+
listInvites(groupId: number): Promise<Page<GroupInvite>>;
|
|
1160
|
+
invite(groupId: number, params: {
|
|
1161
|
+
email: string;
|
|
1162
|
+
role?: GroupMemberRole;
|
|
1163
|
+
}): Promise<GroupInvite>;
|
|
1164
|
+
cancelInvite(inviteId: number): Promise<void>;
|
|
1165
|
+
previewInvite(token: string): Promise<GroupInvitePreview>;
|
|
1166
|
+
acceptInvite(token: string): Promise<Group>;
|
|
1167
|
+
}
|
|
1168
|
+
declare function createGroupsResource(http: Http): GroupsResource;
|
|
1169
|
+
|
|
1036
1170
|
/**
|
|
1037
1171
|
* `client.models` — find out which `model` values are actually valid, and what
|
|
1038
1172
|
* they cost, instead of guessing from the docs.
|
|
@@ -1884,7 +2018,7 @@ interface WebhooksResource {
|
|
|
1884
2018
|
*/
|
|
1885
2019
|
|
|
1886
2020
|
/** Kept in lockstep with package.json "version" — guarded by test/version.test.ts. */
|
|
1887
|
-
declare const M8TES_SDK_VERSION = "0.1.0-alpha.
|
|
2021
|
+
declare const M8TES_SDK_VERSION = "0.1.0-alpha.8";
|
|
1888
2022
|
declare class M8tes {
|
|
1889
2023
|
readonly runs: RunsResource;
|
|
1890
2024
|
readonly agents: AgentsResource;
|
|
@@ -1896,6 +2030,7 @@ declare class M8tes {
|
|
|
1896
2030
|
readonly webhooks: WebhooksResource;
|
|
1897
2031
|
readonly settings: SettingsResource;
|
|
1898
2032
|
readonly memories: MemoriesResource;
|
|
2033
|
+
readonly groups: GroupsResource;
|
|
1899
2034
|
readonly permissions: PermissionsResource;
|
|
1900
2035
|
readonly models: ModelsResource;
|
|
1901
2036
|
readonly modelConnections: ModelConnectionsResource;
|
|
@@ -1906,4 +2041,4 @@ declare class M8tes {
|
|
|
1906
2041
|
constructor(options?: ClientOptions);
|
|
1907
2042
|
}
|
|
1908
2043
|
|
|
1909
|
-
export { type AccountDeletion, type AccountExport, type AccountResource, type AccountSettings, type AccountSettingsUpdateParams, type Agent, type AgentCreateParams, type AgentListParams, type AgentUpdateParams, type AgentsResource, type AlertThresholdParams, type App, type AppConnectionInitiation, type AppConnectionResult, type AppsResource, type AuthorizableModelConnectionProvider, type AutoReloadParams, type Balance, type BillingPlansParams, type BillingPortalParams, type BillingResource, type ClientOptions, type CodeModelConnectionProvider, ConversationState, DEFAULT_BASE_URL, type DeviceModelConnectionProvider, type EmailInbox, type EndUser, type EndUserCreateParams, type EndUserUpdateParams, type EndUserUsage, type FetchLike, type Http, type JsonObject, type ListResponse, M8TES_SDK_VERSION, M8tes, M8tesStreamEvent, type MemoriesResource, type Memory, type MemoryCreateParams, type MemoryListParams, type MemoryUpdateParams, type Model, type ModelAuthorization, type ModelConnection, type ModelConnectionProvider, type ModelConnectionsResource, type ModelPricing, type ModelsResource, Normalizer, type OverageParams, Page, type PageParams, type PermissionCreateParams, type PermissionDeleteParams, type PermissionListParams, type PermissionMode, type PermissionPolicy, type PermissionRequest, type PermissionsResource, type Plan, type PollOptions, type Receipt, type Run, type RunCreateParams, type RunFile, type RunListParams, type RunOutcome, RunPausedError, type RunReplyOptions, RunStream, type RunStreamOptions, RunTimeoutError, type RunUsage, RunWaitAbortedError, type RunsResource, type SettingsResource, type SubscriptionBillingPeriod, type SubscriptionCheckout, type SubscriptionCheckoutParams, type SubscriptionPlanId, TERMINAL_STATUSES, type Task, type TaskCreateParams, type TaskListParams, type TaskRunParams, type TaskUpdateParams, type TasksResource, type Teammate, type TokenTransaction, type TopupParams, type Trigger, type TriggerCreateParams, type TriggerType, type TriggersResource, type Usage, type UsageBucket, type UsageModelSlice, type UsageTimeseries, type UsageTimeseriesParams, type UsageTotals, type UsersResource, type VerifySignatureOptions, type WaitOptions, type Webhook, type WebhookDelivery, type WebhookToggle, type WebhooksResource, createAccountResource, createBillingResource, createHttp, createMemoriesResource, createModelConnectionsResource, createModelsResource, createPermissionsResource, isPlanApproval, planText, pollRun, verifySignature, waitForRun };
|
|
2044
|
+
export { type AccountDeletion, type AccountExport, type AccountResource, type AccountSettings, type AccountSettingsUpdateParams, type Agent, type AgentCreateParams, type AgentListParams, type AgentUpdateParams, type AgentsResource, type AlertThresholdParams, type App, type AppConnectionInitiation, type AppConnectionResult, type AppsResource, type AuthorizableModelConnectionProvider, type AutoReloadParams, type Balance, type BillingPlansParams, type BillingPortalParams, type BillingResource, type ClientOptions, type CodeModelConnectionProvider, ConversationState, DEFAULT_BASE_URL, type DeviceModelConnectionProvider, type EmailInbox, type EndUser, type EndUserCreateParams, type EndUserUpdateParams, type EndUserUsage, type FetchLike, type Group, type GroupCreateParams, type GroupInvite, type GroupInvitePreview, type GroupMember, type GroupMemberRole, type GroupPathItem, type GroupShareResult, type GroupShareSkipped, type GroupUpdateParams, type GroupsResource, type Http, type JsonObject, type ListResponse, M8TES_SDK_VERSION, M8tes, M8tesStreamEvent, type MemoriesResource, type Memory, type MemoryCreateParams, type MemoryListParams, type MemoryUpdateParams, type Model, type ModelAuthorization, type ModelConnection, type ModelConnectionProvider, type ModelConnectionsResource, type ModelPricing, type ModelsResource, Normalizer, type OverageParams, Page, type PageParams, type PermissionCreateParams, type PermissionDeleteParams, type PermissionListParams, type PermissionMode, type PermissionPolicy, type PermissionRequest, type PermissionsResource, type Plan, type PollOptions, type Receipt, type Run, type RunCreateParams, type RunFile, type RunListParams, type RunOutcome, RunPausedError, type RunReplyOptions, RunStream, type RunStreamOptions, RunTimeoutError, type RunUsage, RunWaitAbortedError, type RunsResource, type SettingsResource, type SubscriptionBillingPeriod, type SubscriptionCheckout, type SubscriptionCheckoutParams, type SubscriptionPlanId, TERMINAL_STATUSES, type Task, type TaskCreateParams, type TaskListParams, type TaskRunParams, type TaskUpdateParams, type TasksResource, type Teammate, type TokenTransaction, type TopupParams, type Trigger, type TriggerCreateParams, type TriggerType, type TriggersResource, type Usage, type UsageBucket, type UsageModelSlice, type UsageTimeseries, type UsageTimeseriesParams, type UsageTotals, type UsersResource, type VerifySignatureOptions, type WaitOptions, type Webhook, type WebhookDelivery, type WebhookToggle, type WebhooksResource, createAccountResource, createBillingResource, createGroupsResource, createHttp, createMemoriesResource, createModelConnectionsResource, createModelsResource, createPermissionsResource, isPlanApproval, planText, pollRun, verifySignature, waitForRun };
|
package/dist/index.d.ts
CHANGED
|
@@ -157,6 +157,12 @@ interface Agent {
|
|
|
157
157
|
metadata: JsonObject | null;
|
|
158
158
|
default_permission_mode: string;
|
|
159
159
|
status: string;
|
|
160
|
+
/** Whether the caller may edit or configure this agent within their granted scope. */
|
|
161
|
+
can_manage: boolean;
|
|
162
|
+
/** Whether the caller may run this agent with its configured credentials. */
|
|
163
|
+
can_execute: boolean;
|
|
164
|
+
/** Whether the caller owns the Mate and may expose sharing controls. */
|
|
165
|
+
can_share: boolean;
|
|
160
166
|
created_at: string;
|
|
161
167
|
updated_at?: string | null;
|
|
162
168
|
model?: string | null;
|
|
@@ -171,6 +177,8 @@ interface Agent {
|
|
|
171
177
|
enable_task_setup_tools?: boolean | null;
|
|
172
178
|
enable_feedback?: boolean | null;
|
|
173
179
|
enable_self_improvement?: boolean | null;
|
|
180
|
+
group_id?: number | null;
|
|
181
|
+
group_name?: string | null;
|
|
174
182
|
/** Most recent run activity in the last 90 days; null if idle longer. */
|
|
175
183
|
last_active_at?: string | null;
|
|
176
184
|
/** How many runs are executing or awaiting approval right now. */
|
|
@@ -344,6 +352,63 @@ interface EndUserUsage {
|
|
|
344
352
|
period_end: string;
|
|
345
353
|
rate_per_minute?: number | null;
|
|
346
354
|
}
|
|
355
|
+
interface GroupPathItem {
|
|
356
|
+
id: number;
|
|
357
|
+
name: string;
|
|
358
|
+
}
|
|
359
|
+
type GroupMemberRole = "viewer" | "runner" | "editor";
|
|
360
|
+
/** A recursive Team folder. `path` contains visible ancestors from root to parent. */
|
|
361
|
+
interface Group {
|
|
362
|
+
id: number;
|
|
363
|
+
name: string;
|
|
364
|
+
visibility: string;
|
|
365
|
+
created_at: string;
|
|
366
|
+
display_order?: number | null;
|
|
367
|
+
user_id?: string | null;
|
|
368
|
+
updated_at?: string | null;
|
|
369
|
+
/** Null also represents a hidden ancestor, so callers only build from returned rows. */
|
|
370
|
+
parent_id: number | null;
|
|
371
|
+
path: GroupPathItem[];
|
|
372
|
+
can_manage: boolean;
|
|
373
|
+
can_leave: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface GroupMember {
|
|
376
|
+
member_id: number;
|
|
377
|
+
name: string;
|
|
378
|
+
email: string;
|
|
379
|
+
role: GroupMemberRole;
|
|
380
|
+
inherited: boolean;
|
|
381
|
+
inherited_from_group_id: number | null;
|
|
382
|
+
inherited_from_group_name: string | null;
|
|
383
|
+
can_remove: boolean;
|
|
384
|
+
}
|
|
385
|
+
interface GroupInvite {
|
|
386
|
+
id: number;
|
|
387
|
+
email: string;
|
|
388
|
+
role: GroupMemberRole;
|
|
389
|
+
status: string;
|
|
390
|
+
created_at: string;
|
|
391
|
+
expires_at: string;
|
|
392
|
+
email_sent: boolean | null;
|
|
393
|
+
}
|
|
394
|
+
interface GroupInvitePreview {
|
|
395
|
+
group_name: string;
|
|
396
|
+
inviter_name: string;
|
|
397
|
+
email: string;
|
|
398
|
+
valid: boolean;
|
|
399
|
+
matches_current_user: boolean;
|
|
400
|
+
requires_verification: boolean;
|
|
401
|
+
role: GroupMemberRole;
|
|
402
|
+
}
|
|
403
|
+
interface GroupShareSkipped {
|
|
404
|
+
agent_id: number;
|
|
405
|
+
reason: string;
|
|
406
|
+
}
|
|
407
|
+
interface GroupShareResult {
|
|
408
|
+
visibility: string;
|
|
409
|
+
updated: number[];
|
|
410
|
+
skipped: GroupShareSkipped[];
|
|
411
|
+
}
|
|
347
412
|
/**
|
|
348
413
|
* One saved memory. `user_id` is the scope: your end-user's id, or `null` for an
|
|
349
414
|
* account-level memory. `source` says who wrote it — `"api"` for ones you create
|
|
@@ -609,6 +674,8 @@ interface AgentCreateParams {
|
|
|
609
674
|
goals?: string;
|
|
610
675
|
/** Your id for the end-user who owns this agent. */
|
|
611
676
|
user_id?: string;
|
|
677
|
+
/** Optional Team (`client.groups`) to place the agent in. */
|
|
678
|
+
group_id?: number;
|
|
612
679
|
metadata?: JsonObject;
|
|
613
680
|
model?: string;
|
|
614
681
|
effort?: string;
|
|
@@ -647,6 +714,8 @@ interface AgentUpdateParams {
|
|
|
647
714
|
default_permission_mode?: PermissionMode | null;
|
|
648
715
|
/** Who can see this agent. Omit or null leaves it unchanged. */
|
|
649
716
|
visibility?: "personal" | "organization" | null;
|
|
717
|
+
/** Move into a Team, `null` to ungroup, or omit to leave unchanged. */
|
|
718
|
+
group_id?: number | null;
|
|
650
719
|
allowed_senders?: string[] | null;
|
|
651
720
|
enable_memory?: boolean | null;
|
|
652
721
|
enable_history?: boolean | null;
|
|
@@ -1033,6 +1102,71 @@ interface MemoriesResource {
|
|
|
1033
1102
|
}
|
|
1034
1103
|
declare function createMemoriesResource(http: Http): MemoriesResource;
|
|
1035
1104
|
|
|
1105
|
+
/**
|
|
1106
|
+
* `client.groups` — recursive Teams with inherited viewer, runner, and editor roles.
|
|
1107
|
+
*
|
|
1108
|
+
* Group CRUD keeps the API's optional `user_id` end-user isolation. Human membership and
|
|
1109
|
+
* invitation calls are account-scoped, so those methods deliberately do not accept `user_id`.
|
|
1110
|
+
* The legacy `share()` operation remains independent: it bulk-updates direct Mates' personal or
|
|
1111
|
+
* organization visibility and does not create a recursive Team grant.
|
|
1112
|
+
*/
|
|
1113
|
+
|
|
1114
|
+
interface GroupCreateParams {
|
|
1115
|
+
name: string;
|
|
1116
|
+
user_id?: string;
|
|
1117
|
+
display_order?: number;
|
|
1118
|
+
parent_id?: number | null;
|
|
1119
|
+
}
|
|
1120
|
+
interface GroupUpdateParams {
|
|
1121
|
+
name?: string;
|
|
1122
|
+
display_order?: number | null;
|
|
1123
|
+
/** Move under another Team, `null` for the root, or omit to leave unchanged. */
|
|
1124
|
+
parent_id?: number | null;
|
|
1125
|
+
/** End-user isolation is sent in the query and is never part of the update body. */
|
|
1126
|
+
user_id?: string;
|
|
1127
|
+
}
|
|
1128
|
+
interface GroupsResource {
|
|
1129
|
+
create(params: GroupCreateParams): Promise<Group>;
|
|
1130
|
+
list(params?: {
|
|
1131
|
+
user_id?: string;
|
|
1132
|
+
}): Promise<Page<Group>>;
|
|
1133
|
+
get(groupId: number, params?: {
|
|
1134
|
+
user_id?: string;
|
|
1135
|
+
}): Promise<Group>;
|
|
1136
|
+
update(groupId: number, params: GroupUpdateParams): Promise<Group>;
|
|
1137
|
+
/** Recursively delete this Team and its children; Mates in the subtree become ungrouped. */
|
|
1138
|
+
delete(groupId: number, params?: {
|
|
1139
|
+
user_id?: string;
|
|
1140
|
+
}): Promise<void>;
|
|
1141
|
+
/** Legacy bulk direct-Mate visibility operation, independent of Team membership grants. */
|
|
1142
|
+
share(groupId: number, params: {
|
|
1143
|
+
visibility: "personal" | "organization";
|
|
1144
|
+
user_id?: string;
|
|
1145
|
+
}): Promise<GroupShareResult>;
|
|
1146
|
+
/** Managers-only account-scoped view of direct and inherited members. */
|
|
1147
|
+
members(groupId: number): Promise<Page<GroupMember>>;
|
|
1148
|
+
/** Alias for `members()`. */
|
|
1149
|
+
listMembers(groupId: number): Promise<Page<GroupMember>>;
|
|
1150
|
+
/** Change a direct grant's role. Managers only; account-scoped. */
|
|
1151
|
+
updateMember(groupId: number, memberId: number, params: {
|
|
1152
|
+
role: GroupMemberRole;
|
|
1153
|
+
}): Promise<GroupMember>;
|
|
1154
|
+
/** Remove a direct grant. Managers and the directly granted member may call this. */
|
|
1155
|
+
removeMember(groupId: number, memberId: number): Promise<void>;
|
|
1156
|
+
/** Managers-only account-scoped list of invitations. */
|
|
1157
|
+
invites(groupId: number): Promise<Page<GroupInvite>>;
|
|
1158
|
+
/** Alias for `invites()`. */
|
|
1159
|
+
listInvites(groupId: number): Promise<Page<GroupInvite>>;
|
|
1160
|
+
invite(groupId: number, params: {
|
|
1161
|
+
email: string;
|
|
1162
|
+
role?: GroupMemberRole;
|
|
1163
|
+
}): Promise<GroupInvite>;
|
|
1164
|
+
cancelInvite(inviteId: number): Promise<void>;
|
|
1165
|
+
previewInvite(token: string): Promise<GroupInvitePreview>;
|
|
1166
|
+
acceptInvite(token: string): Promise<Group>;
|
|
1167
|
+
}
|
|
1168
|
+
declare function createGroupsResource(http: Http): GroupsResource;
|
|
1169
|
+
|
|
1036
1170
|
/**
|
|
1037
1171
|
* `client.models` — find out which `model` values are actually valid, and what
|
|
1038
1172
|
* they cost, instead of guessing from the docs.
|
|
@@ -1884,7 +2018,7 @@ interface WebhooksResource {
|
|
|
1884
2018
|
*/
|
|
1885
2019
|
|
|
1886
2020
|
/** Kept in lockstep with package.json "version" — guarded by test/version.test.ts. */
|
|
1887
|
-
declare const M8TES_SDK_VERSION = "0.1.0-alpha.
|
|
2021
|
+
declare const M8TES_SDK_VERSION = "0.1.0-alpha.8";
|
|
1888
2022
|
declare class M8tes {
|
|
1889
2023
|
readonly runs: RunsResource;
|
|
1890
2024
|
readonly agents: AgentsResource;
|
|
@@ -1896,6 +2030,7 @@ declare class M8tes {
|
|
|
1896
2030
|
readonly webhooks: WebhooksResource;
|
|
1897
2031
|
readonly settings: SettingsResource;
|
|
1898
2032
|
readonly memories: MemoriesResource;
|
|
2033
|
+
readonly groups: GroupsResource;
|
|
1899
2034
|
readonly permissions: PermissionsResource;
|
|
1900
2035
|
readonly models: ModelsResource;
|
|
1901
2036
|
readonly modelConnections: ModelConnectionsResource;
|
|
@@ -1906,4 +2041,4 @@ declare class M8tes {
|
|
|
1906
2041
|
constructor(options?: ClientOptions);
|
|
1907
2042
|
}
|
|
1908
2043
|
|
|
1909
|
-
export { type AccountDeletion, type AccountExport, type AccountResource, type AccountSettings, type AccountSettingsUpdateParams, type Agent, type AgentCreateParams, type AgentListParams, type AgentUpdateParams, type AgentsResource, type AlertThresholdParams, type App, type AppConnectionInitiation, type AppConnectionResult, type AppsResource, type AuthorizableModelConnectionProvider, type AutoReloadParams, type Balance, type BillingPlansParams, type BillingPortalParams, type BillingResource, type ClientOptions, type CodeModelConnectionProvider, ConversationState, DEFAULT_BASE_URL, type DeviceModelConnectionProvider, type EmailInbox, type EndUser, type EndUserCreateParams, type EndUserUpdateParams, type EndUserUsage, type FetchLike, type Http, type JsonObject, type ListResponse, M8TES_SDK_VERSION, M8tes, M8tesStreamEvent, type MemoriesResource, type Memory, type MemoryCreateParams, type MemoryListParams, type MemoryUpdateParams, type Model, type ModelAuthorization, type ModelConnection, type ModelConnectionProvider, type ModelConnectionsResource, type ModelPricing, type ModelsResource, Normalizer, type OverageParams, Page, type PageParams, type PermissionCreateParams, type PermissionDeleteParams, type PermissionListParams, type PermissionMode, type PermissionPolicy, type PermissionRequest, type PermissionsResource, type Plan, type PollOptions, type Receipt, type Run, type RunCreateParams, type RunFile, type RunListParams, type RunOutcome, RunPausedError, type RunReplyOptions, RunStream, type RunStreamOptions, RunTimeoutError, type RunUsage, RunWaitAbortedError, type RunsResource, type SettingsResource, type SubscriptionBillingPeriod, type SubscriptionCheckout, type SubscriptionCheckoutParams, type SubscriptionPlanId, TERMINAL_STATUSES, type Task, type TaskCreateParams, type TaskListParams, type TaskRunParams, type TaskUpdateParams, type TasksResource, type Teammate, type TokenTransaction, type TopupParams, type Trigger, type TriggerCreateParams, type TriggerType, type TriggersResource, type Usage, type UsageBucket, type UsageModelSlice, type UsageTimeseries, type UsageTimeseriesParams, type UsageTotals, type UsersResource, type VerifySignatureOptions, type WaitOptions, type Webhook, type WebhookDelivery, type WebhookToggle, type WebhooksResource, createAccountResource, createBillingResource, createHttp, createMemoriesResource, createModelConnectionsResource, createModelsResource, createPermissionsResource, isPlanApproval, planText, pollRun, verifySignature, waitForRun };
|
|
2044
|
+
export { type AccountDeletion, type AccountExport, type AccountResource, type AccountSettings, type AccountSettingsUpdateParams, type Agent, type AgentCreateParams, type AgentListParams, type AgentUpdateParams, type AgentsResource, type AlertThresholdParams, type App, type AppConnectionInitiation, type AppConnectionResult, type AppsResource, type AuthorizableModelConnectionProvider, type AutoReloadParams, type Balance, type BillingPlansParams, type BillingPortalParams, type BillingResource, type ClientOptions, type CodeModelConnectionProvider, ConversationState, DEFAULT_BASE_URL, type DeviceModelConnectionProvider, type EmailInbox, type EndUser, type EndUserCreateParams, type EndUserUpdateParams, type EndUserUsage, type FetchLike, type Group, type GroupCreateParams, type GroupInvite, type GroupInvitePreview, type GroupMember, type GroupMemberRole, type GroupPathItem, type GroupShareResult, type GroupShareSkipped, type GroupUpdateParams, type GroupsResource, type Http, type JsonObject, type ListResponse, M8TES_SDK_VERSION, M8tes, M8tesStreamEvent, type MemoriesResource, type Memory, type MemoryCreateParams, type MemoryListParams, type MemoryUpdateParams, type Model, type ModelAuthorization, type ModelConnection, type ModelConnectionProvider, type ModelConnectionsResource, type ModelPricing, type ModelsResource, Normalizer, type OverageParams, Page, type PageParams, type PermissionCreateParams, type PermissionDeleteParams, type PermissionListParams, type PermissionMode, type PermissionPolicy, type PermissionRequest, type PermissionsResource, type Plan, type PollOptions, type Receipt, type Run, type RunCreateParams, type RunFile, type RunListParams, type RunOutcome, RunPausedError, type RunReplyOptions, RunStream, type RunStreamOptions, RunTimeoutError, type RunUsage, RunWaitAbortedError, type RunsResource, type SettingsResource, type SubscriptionBillingPeriod, type SubscriptionCheckout, type SubscriptionCheckoutParams, type SubscriptionPlanId, TERMINAL_STATUSES, type Task, type TaskCreateParams, type TaskListParams, type TaskRunParams, type TaskUpdateParams, type TasksResource, type Teammate, type TokenTransaction, type TopupParams, type Trigger, type TriggerCreateParams, type TriggerType, type TriggersResource, type Usage, type UsageBucket, type UsageModelSlice, type UsageTimeseries, type UsageTimeseriesParams, type UsageTotals, type UsersResource, type VerifySignatureOptions, type WaitOptions, type Webhook, type WebhookDelivery, type WebhookToggle, type WebhooksResource, createAccountResource, createBillingResource, createGroupsResource, createHttp, createMemoriesResource, createModelConnectionsResource, createModelsResource, createPermissionsResource, isPlanApproval, planText, pollRun, verifySignature, waitForRun };
|
package/dist/index.js
CHANGED
|
@@ -216,19 +216,19 @@ var Page = class {
|
|
|
216
216
|
* it did see rather than a hung process.
|
|
217
217
|
*/
|
|
218
218
|
async *[Symbol.asyncIterator]() {
|
|
219
|
-
let
|
|
219
|
+
let page2 = this;
|
|
220
220
|
const seen = /* @__PURE__ */ new Set();
|
|
221
221
|
for (; ; ) {
|
|
222
|
-
yield*
|
|
223
|
-
const last =
|
|
224
|
-
if (!
|
|
225
|
-
let cursor =
|
|
222
|
+
yield* page2.data;
|
|
223
|
+
const last = page2.data.at(-1);
|
|
224
|
+
if (!page2.hasMore || !last || !page2.fetchNext) return;
|
|
225
|
+
let cursor = page2.nextStartingAfter === null || page2.nextStartingAfter === void 0 ? void 0 : page2.nextStartingAfter;
|
|
226
226
|
if (cursor === void 0) {
|
|
227
227
|
cursor = typeof last.id === "number" || typeof last.id === "string" ? last.id : typeof last.name === "string" ? last.name : void 0;
|
|
228
228
|
}
|
|
229
229
|
if (cursor === void 0 || seen.has(cursor)) return;
|
|
230
230
|
seen.add(cursor);
|
|
231
|
-
|
|
231
|
+
page2 = await page2.fetchNext(cursor);
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
/** Every item across every page, collected. Prefer iteration for large sets. */
|
|
@@ -511,6 +511,69 @@ function createMemoriesResource(http) {
|
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
513
|
|
|
514
|
+
// src/resources/groups.ts
|
|
515
|
+
var page = (res) => new Page(res.data ?? [], res.has_more ?? false, void 0, res.next_starting_after);
|
|
516
|
+
function createGroupsResource(http) {
|
|
517
|
+
const members = async (groupId) => page(await http.request("GET", `/groups/${seg(groupId)}/members`));
|
|
518
|
+
const invites = async (groupId) => page(await http.request("GET", `/groups/${seg(groupId)}/invites`));
|
|
519
|
+
return {
|
|
520
|
+
create(params) {
|
|
521
|
+
return http.request("POST", "/groups", { body: toBody({ ...params }) });
|
|
522
|
+
},
|
|
523
|
+
async list(params = {}) {
|
|
524
|
+
return page(await http.request("GET", "/groups", { query: toQuery(params) }));
|
|
525
|
+
},
|
|
526
|
+
get(groupId, params = {}) {
|
|
527
|
+
return http.request("GET", `/groups/${seg(groupId)}`, { query: toQuery(params) });
|
|
528
|
+
},
|
|
529
|
+
update(groupId, params) {
|
|
530
|
+
const { user_id, ...body } = params;
|
|
531
|
+
return http.request("PATCH", `/groups/${seg(groupId)}`, {
|
|
532
|
+
query: toQuery({ user_id }),
|
|
533
|
+
body: toBody(body)
|
|
534
|
+
});
|
|
535
|
+
},
|
|
536
|
+
async delete(groupId, params = {}) {
|
|
537
|
+
await http.request("DELETE", `/groups/${seg(groupId)}`, { query: toQuery(params) });
|
|
538
|
+
},
|
|
539
|
+
share(groupId, params) {
|
|
540
|
+
const { user_id, ...body } = params;
|
|
541
|
+
return http.request("POST", `/groups/${seg(groupId)}/share`, {
|
|
542
|
+
query: toQuery({ user_id }),
|
|
543
|
+
body: toBody(body)
|
|
544
|
+
});
|
|
545
|
+
},
|
|
546
|
+
members,
|
|
547
|
+
listMembers: members,
|
|
548
|
+
updateMember(groupId, memberId, params) {
|
|
549
|
+
return http.request(
|
|
550
|
+
"PATCH",
|
|
551
|
+
`/groups/${seg(groupId)}/members/${seg(memberId)}`,
|
|
552
|
+
{ body: toBody(params) }
|
|
553
|
+
);
|
|
554
|
+
},
|
|
555
|
+
async removeMember(groupId, memberId) {
|
|
556
|
+
await http.request("DELETE", `/groups/${seg(groupId)}/members/${seg(memberId)}`);
|
|
557
|
+
},
|
|
558
|
+
invites,
|
|
559
|
+
listInvites: invites,
|
|
560
|
+
invite(groupId, params) {
|
|
561
|
+
return http.request("POST", `/groups/${seg(groupId)}/invites`, {
|
|
562
|
+
body: toBody({ role: "editor", ...params })
|
|
563
|
+
});
|
|
564
|
+
},
|
|
565
|
+
async cancelInvite(inviteId) {
|
|
566
|
+
await http.request("DELETE", `/groups/invites/${seg(inviteId)}`);
|
|
567
|
+
},
|
|
568
|
+
previewInvite(token) {
|
|
569
|
+
return http.request("GET", `/groups/invites/${seg(token)}`);
|
|
570
|
+
},
|
|
571
|
+
acceptInvite(token) {
|
|
572
|
+
return http.request("POST", "/groups/invites/accept", { body: { token } });
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
}
|
|
576
|
+
|
|
514
577
|
// src/resources/models.ts
|
|
515
578
|
function createModelsResource(http) {
|
|
516
579
|
return {
|
|
@@ -1297,7 +1360,7 @@ function createWebhooksResource(http) {
|
|
|
1297
1360
|
}
|
|
1298
1361
|
|
|
1299
1362
|
// src/index.ts
|
|
1300
|
-
var M8TES_SDK_VERSION = "0.1.0-alpha.
|
|
1363
|
+
var M8TES_SDK_VERSION = "0.1.0-alpha.8";
|
|
1301
1364
|
var M8tes = class {
|
|
1302
1365
|
runs;
|
|
1303
1366
|
agents;
|
|
@@ -1309,6 +1372,7 @@ var M8tes = class {
|
|
|
1309
1372
|
webhooks;
|
|
1310
1373
|
settings;
|
|
1311
1374
|
memories;
|
|
1375
|
+
groups;
|
|
1312
1376
|
permissions;
|
|
1313
1377
|
models;
|
|
1314
1378
|
modelConnections;
|
|
@@ -1327,6 +1391,7 @@ var M8tes = class {
|
|
|
1327
1391
|
this.webhooks = createWebhooksResource(this.http);
|
|
1328
1392
|
this.settings = createSettingsResource(this.http);
|
|
1329
1393
|
this.memories = createMemoriesResource(this.http);
|
|
1394
|
+
this.groups = createGroupsResource(this.http);
|
|
1330
1395
|
this.permissions = createPermissionsResource(this.http);
|
|
1331
1396
|
this.models = createModelsResource(this.http);
|
|
1332
1397
|
this.modelConnections = createModelConnectionsResource(this.http);
|