@m8tes/sdk 0.1.0-alpha.3 → 0.1.0-alpha.4

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/dist/index.d.cts CHANGED
@@ -171,6 +171,12 @@ interface Agent {
171
171
  enable_task_setup_tools?: boolean | null;
172
172
  enable_feedback?: boolean | null;
173
173
  enable_self_improvement?: boolean | null;
174
+ /** Most recent run activity in the last 90 days; null if idle longer. */
175
+ last_active_at?: string | null;
176
+ /** How many runs are executing or awaiting approval right now. */
177
+ active_run_count?: number;
178
+ /** Sole live run id when active_run_count is exactly 1; otherwise null. */
179
+ active_run_id?: number | null;
174
180
  }
175
181
  /** Permanent alias — the platform term is "agent", the DB model is `Teammate`. */
176
182
  type Teammate = Agent;
@@ -212,6 +218,9 @@ interface RunOutcome {
212
218
  summary: string | null;
213
219
  headline: string | null;
214
220
  needs_reply: boolean;
221
+ needs_reply_count: number | null;
222
+ /** How the agent chose to deliver this outcome: email, slack, or none. */
223
+ delivery_channel: string;
215
224
  output_data: JsonObject | null;
216
225
  message_count: number;
217
226
  input_tokens: number;
@@ -257,6 +266,7 @@ interface Task {
257
266
  enable_task_setup_tools?: boolean | null;
258
267
  enable_feedback?: boolean | null;
259
268
  enable_lessons?: boolean;
269
+ permission_mode?: PermissionMode | null;
260
270
  }
261
271
  type TriggerType = "schedule" | "webhook" | "email" | "app";
262
272
  interface Trigger {
@@ -596,6 +606,8 @@ interface AgentUpdateParams {
596
606
  model?: string | null;
597
607
  effort?: string | null;
598
608
  default_permission_mode?: PermissionMode | null;
609
+ /** Who can see this agent. Omit or null leaves it unchanged. */
610
+ visibility?: "personal" | "organization" | null;
599
611
  allowed_senders?: string[] | null;
600
612
  enable_memory?: boolean | null;
601
613
  enable_history?: boolean | null;
@@ -1036,6 +1048,8 @@ interface ModelConnectionsResource {
1036
1048
  cancelAuthorization(provider: AuthorizableModelConnectionProvider, state: string): Promise<void>;
1037
1049
  /** Delete m8tes' encrypted copy of the provider credentials. */
1038
1050
  disconnect(provider: ModelConnectionProvider): Promise<ModelConnection>;
1051
+ /** Clear the account model-plan default so platform mates use m8tes credits again. */
1052
+ clearDefault(): Promise<boolean>;
1039
1053
  }
1040
1054
  declare function createModelConnectionsResource(http: Http): ModelConnectionsResource;
1041
1055
 
@@ -1387,6 +1401,7 @@ interface RunsResource {
1387
1401
  */
1388
1402
  retry(runId: number, params?: {
1389
1403
  confirm?: boolean;
1404
+ use_credits?: boolean;
1390
1405
  }): Promise<Run>;
1391
1406
  /** Join a run already in flight. Throws `RunNotStreamingError` if it has finished. */
1392
1407
  stream(runId: number, options?: RunStreamOptions): RunStream;
@@ -1507,6 +1522,8 @@ interface TaskCreateFields {
1507
1522
  enable_feedback?: boolean;
1508
1523
  /** Accumulate self-improvement lessons across this task's runs. Default true. */
1509
1524
  enable_lessons?: boolean;
1525
+ /** How this task's runs ask for approval. Default: the agent's default. */
1526
+ permission_mode?: PermissionMode;
1510
1527
  }
1511
1528
  /**
1512
1529
  * PATCH /tasks/{id} accepts exactly these fields (backend `DevTaskUpdate`).
@@ -1528,6 +1545,7 @@ interface TaskUpdateParams {
1528
1545
  enable_task_setup_tools?: boolean | null;
1529
1546
  enable_feedback?: boolean | null;
1530
1547
  enable_lessons?: boolean | null;
1548
+ permission_mode?: PermissionMode | null;
1531
1549
  }
1532
1550
  interface TaskListParams {
1533
1551
  user_id?: string;
@@ -1698,7 +1716,7 @@ interface WebhooksResource {
1698
1716
  */
1699
1717
 
1700
1718
  /** Kept in lockstep with package.json "version" — guarded by test/version.test.ts. */
1701
- declare const M8TES_SDK_VERSION = "0.1.0-alpha.3";
1719
+ declare const M8TES_SDK_VERSION = "0.1.0-alpha.4";
1702
1720
  declare class M8tes {
1703
1721
  readonly runs: RunsResource;
1704
1722
  readonly agents: AgentsResource;
package/dist/index.d.ts CHANGED
@@ -171,6 +171,12 @@ interface Agent {
171
171
  enable_task_setup_tools?: boolean | null;
172
172
  enable_feedback?: boolean | null;
173
173
  enable_self_improvement?: boolean | null;
174
+ /** Most recent run activity in the last 90 days; null if idle longer. */
175
+ last_active_at?: string | null;
176
+ /** How many runs are executing or awaiting approval right now. */
177
+ active_run_count?: number;
178
+ /** Sole live run id when active_run_count is exactly 1; otherwise null. */
179
+ active_run_id?: number | null;
174
180
  }
175
181
  /** Permanent alias — the platform term is "agent", the DB model is `Teammate`. */
176
182
  type Teammate = Agent;
@@ -212,6 +218,9 @@ interface RunOutcome {
212
218
  summary: string | null;
213
219
  headline: string | null;
214
220
  needs_reply: boolean;
221
+ needs_reply_count: number | null;
222
+ /** How the agent chose to deliver this outcome: email, slack, or none. */
223
+ delivery_channel: string;
215
224
  output_data: JsonObject | null;
216
225
  message_count: number;
217
226
  input_tokens: number;
@@ -257,6 +266,7 @@ interface Task {
257
266
  enable_task_setup_tools?: boolean | null;
258
267
  enable_feedback?: boolean | null;
259
268
  enable_lessons?: boolean;
269
+ permission_mode?: PermissionMode | null;
260
270
  }
261
271
  type TriggerType = "schedule" | "webhook" | "email" | "app";
262
272
  interface Trigger {
@@ -596,6 +606,8 @@ interface AgentUpdateParams {
596
606
  model?: string | null;
597
607
  effort?: string | null;
598
608
  default_permission_mode?: PermissionMode | null;
609
+ /** Who can see this agent. Omit or null leaves it unchanged. */
610
+ visibility?: "personal" | "organization" | null;
599
611
  allowed_senders?: string[] | null;
600
612
  enable_memory?: boolean | null;
601
613
  enable_history?: boolean | null;
@@ -1036,6 +1048,8 @@ interface ModelConnectionsResource {
1036
1048
  cancelAuthorization(provider: AuthorizableModelConnectionProvider, state: string): Promise<void>;
1037
1049
  /** Delete m8tes' encrypted copy of the provider credentials. */
1038
1050
  disconnect(provider: ModelConnectionProvider): Promise<ModelConnection>;
1051
+ /** Clear the account model-plan default so platform mates use m8tes credits again. */
1052
+ clearDefault(): Promise<boolean>;
1039
1053
  }
1040
1054
  declare function createModelConnectionsResource(http: Http): ModelConnectionsResource;
1041
1055
 
@@ -1387,6 +1401,7 @@ interface RunsResource {
1387
1401
  */
1388
1402
  retry(runId: number, params?: {
1389
1403
  confirm?: boolean;
1404
+ use_credits?: boolean;
1390
1405
  }): Promise<Run>;
1391
1406
  /** Join a run already in flight. Throws `RunNotStreamingError` if it has finished. */
1392
1407
  stream(runId: number, options?: RunStreamOptions): RunStream;
@@ -1507,6 +1522,8 @@ interface TaskCreateFields {
1507
1522
  enable_feedback?: boolean;
1508
1523
  /** Accumulate self-improvement lessons across this task's runs. Default true. */
1509
1524
  enable_lessons?: boolean;
1525
+ /** How this task's runs ask for approval. Default: the agent's default. */
1526
+ permission_mode?: PermissionMode;
1510
1527
  }
1511
1528
  /**
1512
1529
  * PATCH /tasks/{id} accepts exactly these fields (backend `DevTaskUpdate`).
@@ -1528,6 +1545,7 @@ interface TaskUpdateParams {
1528
1545
  enable_task_setup_tools?: boolean | null;
1529
1546
  enable_feedback?: boolean | null;
1530
1547
  enable_lessons?: boolean | null;
1548
+ permission_mode?: PermissionMode | null;
1531
1549
  }
1532
1550
  interface TaskListParams {
1533
1551
  user_id?: string;
@@ -1698,7 +1716,7 @@ interface WebhooksResource {
1698
1716
  */
1699
1717
 
1700
1718
  /** Kept in lockstep with package.json "version" — guarded by test/version.test.ts. */
1701
- declare const M8TES_SDK_VERSION = "0.1.0-alpha.3";
1719
+ declare const M8TES_SDK_VERSION = "0.1.0-alpha.4";
1702
1720
  declare class M8tes {
1703
1721
  readonly runs: RunsResource;
1704
1722
  readonly agents: AgentsResource;
package/dist/index.js CHANGED
@@ -510,6 +510,13 @@ function createModelConnectionsResource(http) {
510
510
  },
511
511
  disconnect(provider) {
512
512
  return http.request("DELETE", `/model-connections/${seg(provider)}`);
513
+ },
514
+ async clearDefault() {
515
+ const res = await http.request(
516
+ "DELETE",
517
+ "/model-connections/preferred-default"
518
+ );
519
+ return Boolean(res?.cleared);
513
520
  }
514
521
  };
515
522
  }
@@ -989,11 +996,14 @@ function createRunsResource(http) {
989
996
  wait(runId, options = {}) {
990
997
  return waitForRun(pollDeps(options.user_id), runId, options);
991
998
  },
992
- // `confirm` is a QUERY param and the route takes no body (verified against
993
- // fastapi/app/routers/v2/runs.py::retry_run), so send neither.
999
+ // `confirm` / `use_credits` are QUERY params and the route takes no body
1000
+ // (verified against fastapi/app/routers/v2/runs.py::retry_run).
994
1001
  retry(runId, params = {}) {
995
1002
  return http.request("POST", `/runs/${seg(runId)}/retry`, {
996
- query: params.confirm ? toQuery({ confirm: true }) : ""
1003
+ query: toQuery({
1004
+ confirm: params.confirm ? true : void 0,
1005
+ use_credits: params.use_credits ? true : void 0
1006
+ })
997
1007
  });
998
1008
  },
999
1009
  stream(runId, options) {
@@ -1228,7 +1238,7 @@ function createWebhooksResource(http) {
1228
1238
  }
1229
1239
 
1230
1240
  // src/index.ts
1231
- var M8TES_SDK_VERSION = "0.1.0-alpha.3";
1241
+ var M8TES_SDK_VERSION = "0.1.0-alpha.4";
1232
1242
  var M8tes = class {
1233
1243
  runs;
1234
1244
  agents;