notte-sdk 0.0.20 → 0.0.21

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.mjs CHANGED
@@ -6,7 +6,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
6
6
  });
7
7
 
8
8
  // src/version.ts
9
- var SDK_VERSION = true ? "0.0.20" : "dev";
9
+ var SDK_VERSION = true ? "0.0.21" : "dev";
10
10
  var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
11
11
 
12
12
  // src/version-check.ts
@@ -1043,6 +1043,11 @@ var listAgents = (options) => (options?.client ?? client).get({
1043
1043
  url: "/agents",
1044
1044
  ...options
1045
1045
  });
1046
+ var functionRuntimeHealth = (options) => (options?.client ?? client).get({
1047
+ security: [{ scheme: "bearer", type: "http" }],
1048
+ url: "/functions/health",
1049
+ ...options
1050
+ });
1046
1051
  var listFunctions = (options) => (options?.client ?? client).get({
1047
1052
  security: [{ scheme: "bearer", type: "http" }],
1048
1053
  url: "/functions",
@@ -1092,6 +1097,15 @@ var functionFork = (options) => (options.client ?? client).post({
1092
1097
  url: "/functions/{function_id}/fork",
1093
1098
  ...options
1094
1099
  });
1100
+ var functionRollback = (options) => (options.client ?? client).post({
1101
+ security: [{ scheme: "bearer", type: "http" }],
1102
+ url: "/functions/{function_id}/rollback",
1103
+ ...options,
1104
+ headers: {
1105
+ "Content-Type": "application/json",
1106
+ ...options.headers
1107
+ }
1108
+ });
1095
1109
  var functionScheduleDelete = (options) => (options.client ?? client).delete({
1096
1110
  security: [{ scheme: "bearer", type: "http" }],
1097
1111
  url: "/functions/{function_id}/schedule",
@@ -1342,6 +1356,42 @@ var mailboxUpdate = (options) => (options.client ?? client).patch({
1342
1356
  ...options.headers
1343
1357
  }
1344
1358
  });
1359
+ var managedAuthConnectLinkCreate = (options) => (options.client ?? client).post({
1360
+ security: [{ scheme: "bearer", type: "http" }],
1361
+ url: "/managed-auth/connect-links",
1362
+ ...options,
1363
+ headers: {
1364
+ "Content-Type": "application/json",
1365
+ ...options.headers
1366
+ }
1367
+ });
1368
+ var connectLinkContext = (options) => (options.client ?? client).post({ url: "/managed-auth/connect-links/context", ...options });
1369
+ var connectLinkMailboxes = (options) => (options.client ?? client).post({ url: "/managed-auth/connect-links/mailboxes", ...options });
1370
+ var connectLinkMailboxConnect = (options) => (options.client ?? client).post({
1371
+ url: "/managed-auth/connect-links/mailboxes/connect",
1372
+ ...options,
1373
+ headers: {
1374
+ "Content-Type": "application/json",
1375
+ ...options.headers
1376
+ }
1377
+ });
1378
+ var connectLinkMailboxSync = (options) => (options.client ?? client).post({
1379
+ url: "/managed-auth/connect-links/mailboxes/sync",
1380
+ ...options,
1381
+ headers: {
1382
+ "Content-Type": "application/json",
1383
+ ...options.headers
1384
+ }
1385
+ });
1386
+ var connectLinkSubmit = (options) => (options.client ?? client).post({
1387
+ url: "/managed-auth/connect-links/submit",
1388
+ ...options,
1389
+ headers: {
1390
+ "Content-Type": "application/json",
1391
+ ...options.headers
1392
+ }
1393
+ });
1394
+ var connectLinkStatus = (options) => (options.client ?? client).get({ url: "/managed-auth/connect-links/status", ...options });
1345
1395
  var improvePrompt = (options) => (options.client ?? client).post({
1346
1396
  url: "/prompts/improve",
1347
1397
  ...options,
@@ -2857,6 +2907,48 @@ var NotteFunction = class {
2857
2907
  throw new Error(`Failed to get function run metadata: ${error instanceof Error ? error.message : String(error)}`);
2858
2908
  }
2859
2909
  }
2910
+ /**
2911
+ * List the runs of this function.
2912
+ *
2913
+ * `only_active` is sent as `false` unless the caller says otherwise, and that
2914
+ * is deliberate rather than redundant. `GET /functions/{function_id}/runs`
2915
+ * now defaults it to `false` server-side as well, but it used to default to
2916
+ * `true`: the request model was a bare subclass of the session one, where
2917
+ * "only active" reads sensibly as "list my running sessions" and, for "list
2918
+ * this function's runs", was a trap. Hitting the endpoint with no query
2919
+ * parameters returned only the runs executing right now - an empty list for
2920
+ * any function that had finished. That cost us a bug in the anything-api
2921
+ * console, where a function with 15 recorded runs displayed "Nothing has run
2922
+ * this endpoint yet".
2923
+ *
2924
+ * Sending it explicitly pins this method to the documented behaviour against
2925
+ * whichever API version it is talking to, including deployments that predate
2926
+ * the server-side change. Callers who want only in-flight runs pass
2927
+ * `only_active: true`.
2928
+ */
2929
+ async runs(options = {}) {
2930
+ try {
2931
+ const response = await listFunctionRunsByFunctionId({
2932
+ client: this.client.getClient(),
2933
+ path: {
2934
+ function_id: this.functionId
2935
+ },
2936
+ query: {
2937
+ ...options,
2938
+ only_active: options.only_active ?? false
2939
+ }
2940
+ });
2941
+ if (response?.error) {
2942
+ throw new Error(`Failed to list function runs: ${formatError(response.error)}`);
2943
+ }
2944
+ return response.data;
2945
+ } catch (error) {
2946
+ if (error instanceof Error && error.message.startsWith("Failed to list function runs:")) {
2947
+ throw error;
2948
+ }
2949
+ throw new Error(`Failed to list function runs: ${error instanceof Error ? error.message : String(error)}`);
2950
+ }
2951
+ }
2860
2952
  /**
2861
2953
  * Start a function run
2862
2954
  */
@@ -3153,6 +3245,12 @@ export {
3153
3245
  agentStop,
3154
3246
  anythingStart,
3155
3247
  client,
3248
+ connectLinkContext,
3249
+ connectLinkMailboxConnect,
3250
+ connectLinkMailboxSync,
3251
+ connectLinkMailboxes,
3252
+ connectLinkStatus,
3253
+ connectLinkSubmit,
3156
3254
  createClient2 as createClient,
3157
3255
  NotteClient as default,
3158
3256
  deleteSecret,
@@ -3167,10 +3265,12 @@ export {
3167
3265
  functionDownloadUrl,
3168
3266
  functionFork,
3169
3267
  functionMetadataUpdate,
3268
+ functionRollback,
3170
3269
  functionRunGetMetadata,
3171
3270
  functionRunStart,
3172
3271
  functionRunStop,
3173
3272
  functionRunUpdateMetadata,
3273
+ functionRuntimeHealth,
3174
3274
  functionScheduleDelete,
3175
3275
  functionScheduleSet,
3176
3276
  functionUpdate,
@@ -3194,6 +3294,7 @@ export {
3194
3294
  mailboxList,
3195
3295
  mailboxSync,
3196
3296
  mailboxUpdate,
3297
+ managedAuthConnectLinkCreate,
3197
3298
  nudgePrompt,
3198
3299
  pageExecute,
3199
3300
  pageObserve,