notte-sdk 0.0.21 → 0.0.22

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.js CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  NotteProxyAuthError: () => NotteProxyAuthError,
39
39
  NotteVault: () => NotteVault,
40
40
  Session: () => Session,
41
+ SessionFiles: () => SessionFiles,
41
42
  agentStart: () => agentStart,
42
43
  agentStatus: () => agentStatus,
43
44
  agentStop: () => agentStop,
@@ -52,12 +53,8 @@ __export(index_exports, {
52
53
  createClient: () => createClient2,
53
54
  default: () => NotteClient,
54
55
  deleteSecret: () => deleteSecret,
55
- fileDownload: () => fileDownload,
56
- fileDownloadUploadedFile: () => fileDownloadUploadedFile,
57
- fileListDownloads: () => fileListDownloads,
58
- fileListUploads: () => fileListUploads,
59
- fileUpload: () => fileUpload,
60
- fileUploadDownloadedFile: () => fileUploadDownloadedFile,
56
+ deleteSessionFile: () => deleteSessionFile,
57
+ downloadSessionFile: () => downloadSessionFile,
61
58
  functionCreate: () => functionCreate,
62
59
  functionDelete: () => functionDelete,
63
60
  functionDownloadUrl: () => functionDownloadUrl,
@@ -84,6 +81,7 @@ __export(index_exports, {
84
81
  listFunctions: () => listFunctions,
85
82
  listPersonas: () => listPersonas,
86
83
  listSecrets: () => listSecrets,
84
+ listSessionFiles: () => listSessionFiles,
87
85
  listSessions: () => listSessions,
88
86
  listVaults: () => listVaults,
89
87
  mailboxConnectToken: () => mailboxConnectToken,
@@ -93,6 +91,7 @@ __export(index_exports, {
93
91
  mailboxSync: () => mailboxSync,
94
92
  mailboxUpdate: () => mailboxUpdate,
95
93
  managedAuthConnectLinkCreate: () => managedAuthConnectLinkCreate,
94
+ mintProxyCredentials: () => mintProxyCredentials,
96
95
  nudgePrompt: () => nudgePrompt,
97
96
  pageExecute: () => pageExecute,
98
97
  pageObserve: () => pageObserve,
@@ -125,6 +124,7 @@ __export(index_exports, {
125
124
  sessionStatus: () => sessionStatus,
126
125
  sessionStop: () => sessionStop,
127
126
  storeSecret: () => storeSecret,
127
+ uploadSessionFile: () => uploadSessionFile,
128
128
  vaultCreate: () => vaultCreate,
129
129
  vaultCredentialsAdd: () => vaultCredentialsAdd,
130
130
  vaultCredentialsDelete: () => vaultCredentialsDelete,
@@ -139,7 +139,7 @@ __export(index_exports, {
139
139
  module.exports = __toCommonJS(index_exports);
140
140
 
141
141
  // src/version.ts
142
- var SDK_VERSION = true ? "0.0.21" : "dev";
142
+ var SDK_VERSION = true ? "0.0.22" : "dev";
143
143
  var SDK_PACKAGE_NAME = true ? "notte-sdk" : "notte-sdk";
144
144
 
145
145
  // src/version-check.ts
@@ -1147,6 +1147,31 @@ var sessionReplay = (options) => (options.client ?? client).get({
1147
1147
  url: "/sessions/{session_id}/replay",
1148
1148
  ...options
1149
1149
  });
1150
+ var listSessionFiles = (options) => (options.client ?? client).get({
1151
+ security: [{ scheme: "bearer", type: "http" }],
1152
+ url: "/sessions/{session_id}/files",
1153
+ ...options
1154
+ });
1155
+ var uploadSessionFile = (options) => (options.client ?? client).post({
1156
+ ...formDataBodySerializer,
1157
+ security: [{ scheme: "bearer", type: "http" }],
1158
+ url: "/sessions/{session_id}/files",
1159
+ ...options,
1160
+ headers: {
1161
+ "Content-Type": null,
1162
+ ...options.headers
1163
+ }
1164
+ });
1165
+ var deleteSessionFile = (options) => (options.client ?? client).delete({
1166
+ security: [{ scheme: "bearer", type: "http" }],
1167
+ url: "/sessions/{session_id}/files/{file_id}",
1168
+ ...options
1169
+ });
1170
+ var downloadSessionFile = (options) => (options.client ?? client).get({
1171
+ security: [{ scheme: "bearer", type: "http" }],
1172
+ url: "/sessions/{session_id}/files/{file_id}",
1173
+ ...options
1174
+ });
1150
1175
  var agentStart = (options) => (options.client ?? client).post({
1151
1176
  security: [{ scheme: "bearer", type: "http" }],
1152
1177
  url: "/agents/start",
@@ -1551,46 +1576,6 @@ var getUsageLogs = (options) => (options?.client ?? client).get({
1551
1576
  url: "/usage/logs",
1552
1577
  ...options
1553
1578
  });
1554
- var fileDownload = (options) => (options.client ?? client).get({
1555
- security: [{ scheme: "bearer", type: "http" }],
1556
- url: "/storage/{session_id}/downloads/{filename}",
1557
- ...options
1558
- });
1559
- var fileUploadDownloadedFile = (options) => (options.client ?? client).post({
1560
- ...formDataBodySerializer,
1561
- security: [{ scheme: "bearer", type: "http" }],
1562
- url: "/storage/{session_id}/downloads/{filename}",
1563
- ...options,
1564
- headers: {
1565
- "Content-Type": null,
1566
- ...options.headers
1567
- }
1568
- });
1569
- var fileListDownloads = (options) => (options.client ?? client).get({
1570
- security: [{ scheme: "bearer", type: "http" }],
1571
- url: "/storage/{session_id}/downloads",
1572
- ...options
1573
- });
1574
- var fileDownloadUploadedFile = (options) => (options.client ?? client).get({
1575
- security: [{ scheme: "bearer", type: "http" }],
1576
- url: "/storage/uploads/{filename}",
1577
- ...options
1578
- });
1579
- var fileUpload = (options) => (options.client ?? client).post({
1580
- ...formDataBodySerializer,
1581
- security: [{ scheme: "bearer", type: "http" }],
1582
- url: "/storage/uploads/{filename}",
1583
- ...options,
1584
- headers: {
1585
- "Content-Type": null,
1586
- ...options.headers
1587
- }
1588
- });
1589
- var fileListUploads = (options) => (options?.client ?? client).get({
1590
- security: [{ scheme: "bearer", type: "http" }],
1591
- url: "/storage/uploads",
1592
- ...options
1593
- });
1594
1579
  var anythingStart = (options) => (options.client ?? client).post({
1595
1580
  security: [{ scheme: "bearer", type: "http" }],
1596
1581
  url: "/anything/start",
@@ -1624,6 +1609,15 @@ var deleteSecret = (options) => (options.client ?? client).delete({
1624
1609
  url: "/secrets/{secret_id}",
1625
1610
  ...options
1626
1611
  });
1612
+ var mintProxyCredentials = (options) => (options.client ?? client).post({
1613
+ security: [{ scheme: "bearer", type: "http" }],
1614
+ url: "/proxies/gateway/credentials",
1615
+ ...options,
1616
+ headers: {
1617
+ "Content-Type": "application/json",
1618
+ ...options.headers
1619
+ }
1620
+ });
1627
1621
  var healthCheck = (options) => (options?.client ?? client).get({ url: "/health", ...options });
1628
1622
  var readyCheck = (options) => (options?.client ?? client).get({ url: "/ready", ...options });
1629
1623
  var scrapeWebpage = (options) => (options.client ?? client).post({
@@ -2825,6 +2819,18 @@ var NottePersona = class {
2825
2819
  }
2826
2820
  return this.response.persona_id;
2827
2821
  }
2822
+ /**
2823
+ * Public, human-readable email address of the persona
2824
+ */
2825
+ get email() {
2826
+ return this.info.email;
2827
+ }
2828
+ /**
2829
+ * Internal UUID-backed mailbox address of the persona
2830
+ */
2831
+ get internalEmail() {
2832
+ return this.info.internal_email;
2833
+ }
2828
2834
  /**
2829
2835
  * Start the persona - ensures initialization
2830
2836
  */
@@ -3085,7 +3091,7 @@ var NotteFunction = class {
3085
3091
  /**
3086
3092
  * Start a function run
3087
3093
  */
3088
- async run(variables = {}) {
3094
+ async run(variables = {}, options = {}) {
3089
3095
  const apiKey = this.client.getConfig().apiKey || "";
3090
3096
  if (!apiKey) {
3091
3097
  throw new Error("API key is required. Provide it via config.apiKey or set the NOTTE_API_KEY environment variable.");
@@ -3104,7 +3110,8 @@ var NotteFunction = class {
3104
3110
  body: {
3105
3111
  workflow_id: this.functionId,
3106
3112
  variables,
3107
- stream: false
3113
+ stream: false,
3114
+ ...options.runtime ? { runtime: options.runtime } : {}
3108
3115
  }
3109
3116
  });
3110
3117
  if (response?.error) {
@@ -3197,6 +3204,53 @@ function isHttpUrl(value) {
3197
3204
 
3198
3205
  // src/client.ts
3199
3206
  var import_zod3 = require("zod");
3207
+
3208
+ // src/files.ts
3209
+ var SessionFiles = class {
3210
+ constructor(client2, sessionId) {
3211
+ this.client = client2;
3212
+ this.sessionId = sessionId;
3213
+ }
3214
+ path(fileId) {
3215
+ const root = `/sessions/${encodeURIComponent(this.sessionId)}/files`;
3216
+ return fileId ? `${root}/${encodeURIComponent(fileId)}` : root;
3217
+ }
3218
+ async upload(file, filename = "file") {
3219
+ const body = new FormData();
3220
+ body.append("file", file, filename);
3221
+ const result = await this.client.request({
3222
+ method: "POST",
3223
+ url: this.path(),
3224
+ body
3225
+ });
3226
+ if (result.error || !result.data) throw new Error("Failed to upload session file");
3227
+ return result.data;
3228
+ }
3229
+ async list(options = {}) {
3230
+ const result = await this.client.request({
3231
+ method: "GET",
3232
+ url: this.path(),
3233
+ query: { limit: options.limit ?? 100, offset: options.offset ?? 0, source: options.source }
3234
+ });
3235
+ if (result.error || !result.data) throw new Error("Failed to list session files");
3236
+ return result.data;
3237
+ }
3238
+ async download(fileId) {
3239
+ const result = await this.client.request({
3240
+ method: "GET",
3241
+ url: this.path(fileId),
3242
+ parseAs: "blob"
3243
+ });
3244
+ if (result.error || !result.data) throw new Error(`Failed to download session file ${fileId}`);
3245
+ return result.data;
3246
+ }
3247
+ async delete(fileId) {
3248
+ const result = await this.client.request({ method: "DELETE", url: this.path(fileId) });
3249
+ if (result.error) throw new Error(`Failed to delete session file ${fileId}`);
3250
+ }
3251
+ };
3252
+
3253
+ // src/client.ts
3200
3254
  var NotteClient = class {
3201
3255
  constructor(config = {}) {
3202
3256
  const apiKey = config.apiKey || process.env.NOTTE_API_KEY;
@@ -3253,6 +3307,10 @@ var NotteClient = class {
3253
3307
  Session(options = {}) {
3254
3308
  return new Session(this, options);
3255
3309
  }
3310
+ /** Access files owned by a specific session, including closed sessions. */
3311
+ Files(sessionId) {
3312
+ return new SessionFiles(this.getClient(), sessionId);
3313
+ }
3256
3314
  /**
3257
3315
  * Create a new agent
3258
3316
  */
@@ -3374,6 +3432,7 @@ var createClient2 = (config) => {
3374
3432
  NotteProxyAuthError,
3375
3433
  NotteVault,
3376
3434
  Session,
3435
+ SessionFiles,
3377
3436
  agentStart,
3378
3437
  agentStatus,
3379
3438
  agentStop,
@@ -3387,12 +3446,8 @@ var createClient2 = (config) => {
3387
3446
  connectLinkSubmit,
3388
3447
  createClient,
3389
3448
  deleteSecret,
3390
- fileDownload,
3391
- fileDownloadUploadedFile,
3392
- fileListDownloads,
3393
- fileListUploads,
3394
- fileUpload,
3395
- fileUploadDownloadedFile,
3449
+ deleteSessionFile,
3450
+ downloadSessionFile,
3396
3451
  functionCreate,
3397
3452
  functionDelete,
3398
3453
  functionDownloadUrl,
@@ -3419,6 +3474,7 @@ var createClient2 = (config) => {
3419
3474
  listFunctions,
3420
3475
  listPersonas,
3421
3476
  listSecrets,
3477
+ listSessionFiles,
3422
3478
  listSessions,
3423
3479
  listVaults,
3424
3480
  mailboxConnectToken,
@@ -3428,6 +3484,7 @@ var createClient2 = (config) => {
3428
3484
  mailboxSync,
3429
3485
  mailboxUpdate,
3430
3486
  managedAuthConnectLinkCreate,
3487
+ mintProxyCredentials,
3431
3488
  nudgePrompt,
3432
3489
  pageExecute,
3433
3490
  pageObserve,
@@ -3460,6 +3517,7 @@ var createClient2 = (config) => {
3460
3517
  sessionStatus,
3461
3518
  sessionStop,
3462
3519
  storeSecret,
3520
+ uploadSessionFile,
3463
3521
  vaultCreate,
3464
3522
  vaultCredentialsAdd,
3465
3523
  vaultCredentialsDelete,