@idapt/browser-app-sdk 0.1.0 → 0.2.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.
@@ -937,8 +937,8 @@ async function executeCommand(binding, args = {}, ctx, opts = {}) {
937
937
  }
938
938
  async function awaitOperation(binding, operationId, ctx, opts = {}) {
939
939
  const sleep = opts.sleep ?? defaultSleep;
940
- const interval = opts.pollIntervalMs ?? 1500;
941
- const maxAttempts = opts.maxPollAttempts ?? 120;
940
+ const interval = opts.pollIntervalMs ?? binding.pollHint?.intervalMs ?? 1500;
941
+ const maxAttempts = opts.maxPollAttempts ?? binding.pollHint?.maxAttempts ?? 120;
942
942
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
943
943
  if (opts.signal?.aborted) {
944
944
  throw new IdaptError({
@@ -1689,46 +1689,6 @@ var COMMAND_BINDINGS = {
1689
1689
  "responseKind": "created",
1690
1690
  "async": false
1691
1691
  },
1692
- "code execute": {
1693
- "command": "code execute",
1694
- "method": "POST",
1695
- "path": "/code-runs",
1696
- "pathParams": [],
1697
- "argLocation": "body",
1698
- "responseKind": "created",
1699
- "async": true
1700
- },
1701
- "code get": {
1702
- "command": "code get",
1703
- "method": "GET",
1704
- "path": "/code-runs/:id",
1705
- "pathParams": [
1706
- "id"
1707
- ],
1708
- "argLocation": "query",
1709
- "responseKind": "single",
1710
- "async": false
1711
- },
1712
- "code interrupt": {
1713
- "command": "code interrupt",
1714
- "method": "POST",
1715
- "path": "/code-runs/:id/interrupt",
1716
- "pathParams": [
1717
- "id"
1718
- ],
1719
- "argLocation": "body",
1720
- "responseKind": "single",
1721
- "async": false
1722
- },
1723
- "code list": {
1724
- "command": "code list",
1725
- "method": "GET",
1726
- "path": "/code-runs",
1727
- "pathParams": [],
1728
- "argLocation": "query",
1729
- "responseKind": "list",
1730
- "async": false
1731
- },
1732
1692
  "computer activity": {
1733
1693
  "command": "computer activity",
1734
1694
  "method": "GET",
@@ -2042,6 +2002,26 @@ var COMMAND_BINDINGS = {
2042
2002
  "application/gzip"
2043
2003
  ]
2044
2004
  },
2005
+ "computer download-to-drive": {
2006
+ "command": "computer download-to-drive",
2007
+ "method": "POST",
2008
+ "path": "/computers/:id/sftp/download",
2009
+ "pathParams": [
2010
+ "id"
2011
+ ],
2012
+ "argLocation": "body",
2013
+ "responseKind": "single",
2014
+ "async": false
2015
+ },
2016
+ "computer ephemeral": {
2017
+ "command": "computer ephemeral",
2018
+ "method": "POST",
2019
+ "path": "/computers/ephemeral",
2020
+ "pathParams": [],
2021
+ "argLocation": "body",
2022
+ "responseKind": "created",
2023
+ "async": false
2024
+ },
2045
2025
  "computer exec": {
2046
2026
  "command": "computer exec",
2047
2027
  "method": "POST",
@@ -2659,6 +2639,141 @@ var COMMAND_BINDINGS = {
2659
2639
  "responseKind": "created",
2660
2640
  "async": false
2661
2641
  },
2642
+ "functions create": {
2643
+ "command": "functions create",
2644
+ "method": "POST",
2645
+ "path": "/functions",
2646
+ "pathParams": [],
2647
+ "argLocation": "body",
2648
+ "responseKind": "created",
2649
+ "async": false
2650
+ },
2651
+ "functions delete": {
2652
+ "command": "functions delete",
2653
+ "method": "DELETE",
2654
+ "path": "/functions/:id",
2655
+ "pathParams": [
2656
+ "id"
2657
+ ],
2658
+ "argLocation": "query",
2659
+ "responseKind": "deleted",
2660
+ "async": false
2661
+ },
2662
+ "functions deploy": {
2663
+ "command": "functions deploy",
2664
+ "method": "POST",
2665
+ "path": "/functions/:id/deploy",
2666
+ "pathParams": [
2667
+ "id"
2668
+ ],
2669
+ "argLocation": "body",
2670
+ "responseKind": "created",
2671
+ "async": false
2672
+ },
2673
+ "functions deployments": {
2674
+ "command": "functions deployments",
2675
+ "method": "GET",
2676
+ "path": "/functions/:id/deployments",
2677
+ "pathParams": [
2678
+ "id"
2679
+ ],
2680
+ "argLocation": "query",
2681
+ "responseKind": "list",
2682
+ "async": false
2683
+ },
2684
+ "functions get": {
2685
+ "command": "functions get",
2686
+ "method": "GET",
2687
+ "path": "/functions/:id",
2688
+ "pathParams": [
2689
+ "id"
2690
+ ],
2691
+ "argLocation": "query",
2692
+ "responseKind": "single",
2693
+ "async": false
2694
+ },
2695
+ "functions invoke": {
2696
+ "command": "functions invoke",
2697
+ "method": "POST",
2698
+ "path": "/functions/:id/invoke",
2699
+ "pathParams": [
2700
+ "id"
2701
+ ],
2702
+ "argLocation": "body",
2703
+ "responseKind": "single",
2704
+ "async": false
2705
+ },
2706
+ "functions list": {
2707
+ "command": "functions list",
2708
+ "method": "GET",
2709
+ "path": "/functions",
2710
+ "pathParams": [],
2711
+ "argLocation": "query",
2712
+ "responseKind": "list",
2713
+ "async": false
2714
+ },
2715
+ "functions promote": {
2716
+ "command": "functions promote",
2717
+ "method": "POST",
2718
+ "path": "/functions/:id/promote",
2719
+ "pathParams": [
2720
+ "id"
2721
+ ],
2722
+ "argLocation": "body",
2723
+ "responseKind": "single",
2724
+ "async": false
2725
+ },
2726
+ "functions run": {
2727
+ "command": "functions run",
2728
+ "method": "POST",
2729
+ "path": "/functions/runs",
2730
+ "pathParams": [],
2731
+ "argLocation": "body",
2732
+ "responseKind": "created",
2733
+ "async": true
2734
+ },
2735
+ "functions run-get": {
2736
+ "command": "functions run-get",
2737
+ "method": "GET",
2738
+ "path": "/functions/runs/:id",
2739
+ "pathParams": [
2740
+ "id"
2741
+ ],
2742
+ "argLocation": "query",
2743
+ "responseKind": "single",
2744
+ "async": false
2745
+ },
2746
+ "functions run-interrupt": {
2747
+ "command": "functions run-interrupt",
2748
+ "method": "POST",
2749
+ "path": "/functions/runs/:id/interrupt",
2750
+ "pathParams": [
2751
+ "id"
2752
+ ],
2753
+ "argLocation": "body",
2754
+ "responseKind": "single",
2755
+ "async": false
2756
+ },
2757
+ "functions run-list": {
2758
+ "command": "functions run-list",
2759
+ "method": "GET",
2760
+ "path": "/functions/runs",
2761
+ "pathParams": [],
2762
+ "argLocation": "query",
2763
+ "responseKind": "list",
2764
+ "async": false
2765
+ },
2766
+ "functions update": {
2767
+ "command": "functions update",
2768
+ "method": "PATCH",
2769
+ "path": "/functions/:id",
2770
+ "pathParams": [
2771
+ "id"
2772
+ ],
2773
+ "argLocation": "body",
2774
+ "responseKind": "single",
2775
+ "async": false
2776
+ },
2662
2777
  "guide get": {
2663
2778
  "command": "guide get",
2664
2779
  "method": "GET",
@@ -2866,6 +2981,125 @@ var COMMAND_BINDINGS = {
2866
2981
  "responseKind": "single",
2867
2982
  "async": false
2868
2983
  },
2984
+ "memory box-delete": {
2985
+ "command": "memory box-delete",
2986
+ "method": "DELETE",
2987
+ "path": "/memory/boxes/:id",
2988
+ "pathParams": [
2989
+ "id"
2990
+ ],
2991
+ "argLocation": "body",
2992
+ "responseKind": "deleted",
2993
+ "async": false
2994
+ },
2995
+ "memory box-get": {
2996
+ "command": "memory box-get",
2997
+ "method": "GET",
2998
+ "path": "/memory/boxes/:id",
2999
+ "pathParams": [
3000
+ "id"
3001
+ ],
3002
+ "argLocation": "query",
3003
+ "responseKind": "single",
3004
+ "async": false
3005
+ },
3006
+ "memory box-list": {
3007
+ "command": "memory box-list",
3008
+ "method": "GET",
3009
+ "path": "/memory/boxes",
3010
+ "pathParams": [],
3011
+ "argLocation": "query",
3012
+ "responseKind": "list",
3013
+ "async": false
3014
+ },
3015
+ "memory box-update": {
3016
+ "command": "memory box-update",
3017
+ "method": "PATCH",
3018
+ "path": "/memory/boxes/:id",
3019
+ "pathParams": [
3020
+ "id"
3021
+ ],
3022
+ "argLocation": "body",
3023
+ "responseKind": "single",
3024
+ "async": false
3025
+ },
3026
+ "memory delete": {
3027
+ "command": "memory delete",
3028
+ "method": "DELETE",
3029
+ "path": "/memory/boxes/:id/note",
3030
+ "pathParams": [
3031
+ "id"
3032
+ ],
3033
+ "argLocation": "query",
3034
+ "responseKind": "deleted",
3035
+ "async": false
3036
+ },
3037
+ "memory index-read": {
3038
+ "command": "memory index-read",
3039
+ "method": "GET",
3040
+ "path": "/memory/boxes/:id/index",
3041
+ "pathParams": [
3042
+ "id"
3043
+ ],
3044
+ "argLocation": "query",
3045
+ "responseKind": "single",
3046
+ "async": false
3047
+ },
3048
+ "memory index-write": {
3049
+ "command": "memory index-write",
3050
+ "method": "POST",
3051
+ "path": "/memory/boxes/:id/index",
3052
+ "pathParams": [
3053
+ "id"
3054
+ ],
3055
+ "argLocation": "body",
3056
+ "responseKind": "single",
3057
+ "async": false
3058
+ },
3059
+ "memory list": {
3060
+ "command": "memory list",
3061
+ "method": "GET",
3062
+ "path": "/memory/boxes/:id/notes",
3063
+ "pathParams": [
3064
+ "id"
3065
+ ],
3066
+ "argLocation": "query",
3067
+ "responseKind": "list",
3068
+ "async": false
3069
+ },
3070
+ "memory read": {
3071
+ "command": "memory read",
3072
+ "method": "GET",
3073
+ "path": "/memory/boxes/:id/note",
3074
+ "pathParams": [
3075
+ "id"
3076
+ ],
3077
+ "argLocation": "query",
3078
+ "responseKind": "single",
3079
+ "async": false
3080
+ },
3081
+ "memory search": {
3082
+ "command": "memory search",
3083
+ "method": "GET",
3084
+ "path": "/memory/boxes/:id/search",
3085
+ "pathParams": [
3086
+ "id"
3087
+ ],
3088
+ "argLocation": "query",
3089
+ "responseKind": "list",
3090
+ "async": false
3091
+ },
3092
+ "memory write": {
3093
+ "command": "memory write",
3094
+ "method": "POST",
3095
+ "path": "/memory/boxes/:id/notes",
3096
+ "pathParams": [
3097
+ "id"
3098
+ ],
3099
+ "argLocation": "body",
3100
+ "responseKind": "single",
3101
+ "async": false
3102
+ },
2869
3103
  "models list": {
2870
3104
  "command": "models list",
2871
3105
  "method": "GET",
@@ -2946,6 +3180,61 @@ var COMMAND_BINDINGS = {
2946
3180
  "responseKind": "deleted",
2947
3181
  "async": false
2948
3182
  },
3183
+ "notes folder-create": {
3184
+ "command": "notes folder-create",
3185
+ "method": "POST",
3186
+ "path": "/notes/boxes/:id/folders",
3187
+ "pathParams": [
3188
+ "id"
3189
+ ],
3190
+ "argLocation": "body",
3191
+ "responseKind": "created",
3192
+ "async": false
3193
+ },
3194
+ "notes folder-delete": {
3195
+ "command": "notes folder-delete",
3196
+ "method": "DELETE",
3197
+ "path": "/notes/folders/:folderId",
3198
+ "pathParams": [
3199
+ "folderId"
3200
+ ],
3201
+ "argLocation": "body",
3202
+ "responseKind": "deleted",
3203
+ "async": false
3204
+ },
3205
+ "notes folder-list": {
3206
+ "command": "notes folder-list",
3207
+ "method": "GET",
3208
+ "path": "/notes/boxes/:id/folders",
3209
+ "pathParams": [
3210
+ "id"
3211
+ ],
3212
+ "argLocation": "query",
3213
+ "responseKind": "list",
3214
+ "async": false
3215
+ },
3216
+ "notes folder-move": {
3217
+ "command": "notes folder-move",
3218
+ "method": "POST",
3219
+ "path": "/notes/folders/:folderId/move",
3220
+ "pathParams": [
3221
+ "folderId"
3222
+ ],
3223
+ "argLocation": "body",
3224
+ "responseKind": "single",
3225
+ "async": false
3226
+ },
3227
+ "notes folder-rename": {
3228
+ "command": "notes folder-rename",
3229
+ "method": "PATCH",
3230
+ "path": "/notes/folders/:folderId",
3231
+ "pathParams": [
3232
+ "folderId"
3233
+ ],
3234
+ "argLocation": "body",
3235
+ "responseKind": "single",
3236
+ "async": false
3237
+ },
2949
3238
  "notes graph": {
2950
3239
  "command": "notes graph",
2951
3240
  "method": "GET",
@@ -2957,6 +3246,17 @@ var COMMAND_BINDINGS = {
2957
3246
  "responseKind": "single",
2958
3247
  "async": false
2959
3248
  },
3249
+ "notes import": {
3250
+ "command": "notes import",
3251
+ "method": "POST",
3252
+ "path": "/notes/boxes/:id/import",
3253
+ "pathParams": [
3254
+ "id"
3255
+ ],
3256
+ "argLocation": "body",
3257
+ "responseKind": "single",
3258
+ "async": false
3259
+ },
2960
3260
  "notes index-read": {
2961
3261
  "command": "notes index-read",
2962
3262
  "method": "GET",
@@ -3001,6 +3301,17 @@ var COMMAND_BINDINGS = {
3001
3301
  "responseKind": "list",
3002
3302
  "async": false
3003
3303
  },
3304
+ "notes note-move": {
3305
+ "command": "notes note-move",
3306
+ "method": "POST",
3307
+ "path": "/notes/boxes/:id/notes/move",
3308
+ "pathParams": [
3309
+ "id"
3310
+ ],
3311
+ "argLocation": "body",
3312
+ "responseKind": "single",
3313
+ "async": false
3314
+ },
3004
3315
  "notes note-rename": {
3005
3316
  "command": "notes note-rename",
3006
3317
  "method": "POST",
@@ -3012,6 +3323,15 @@ var COMMAND_BINDINGS = {
3012
3323
  "responseKind": "single",
3013
3324
  "async": false
3014
3325
  },
3326
+ "notes purge": {
3327
+ "command": "notes purge",
3328
+ "method": "POST",
3329
+ "path": "/notes/trash/purge",
3330
+ "pathParams": [],
3331
+ "argLocation": "body",
3332
+ "responseKind": "deleted",
3333
+ "async": false
3334
+ },
3015
3335
  "notes read": {
3016
3336
  "command": "notes read",
3017
3337
  "method": "GET",
@@ -3023,6 +3343,15 @@ var COMMAND_BINDINGS = {
3023
3343
  "responseKind": "single",
3024
3344
  "async": false
3025
3345
  },
3346
+ "notes restore": {
3347
+ "command": "notes restore",
3348
+ "method": "POST",
3349
+ "path": "/notes/trash/restore",
3350
+ "pathParams": [],
3351
+ "argLocation": "body",
3352
+ "responseKind": "deleted",
3353
+ "async": false
3354
+ },
3026
3355
  "notes search": {
3027
3356
  "command": "notes search",
3028
3357
  "method": "GET",
@@ -3065,6 +3394,35 @@ var COMMAND_BINDINGS = {
3065
3394
  "responseKind": "single",
3066
3395
  "async": false
3067
3396
  },
3397
+ "notes trash-empty": {
3398
+ "command": "notes trash-empty",
3399
+ "method": "DELETE",
3400
+ "path": "/notes/trash",
3401
+ "pathParams": [],
3402
+ "argLocation": "query",
3403
+ "responseKind": "single",
3404
+ "async": false
3405
+ },
3406
+ "notes trash-list": {
3407
+ "command": "notes trash-list",
3408
+ "method": "GET",
3409
+ "path": "/notes/trash",
3410
+ "pathParams": [],
3411
+ "argLocation": "query",
3412
+ "responseKind": "list",
3413
+ "async": false
3414
+ },
3415
+ "notes tree": {
3416
+ "command": "notes tree",
3417
+ "method": "GET",
3418
+ "path": "/notes/boxes/:id/tree",
3419
+ "pathParams": [
3420
+ "id"
3421
+ ],
3422
+ "argLocation": "query",
3423
+ "responseKind": "single",
3424
+ "async": false
3425
+ },
3068
3426
  "notes write": {
3069
3427
  "command": "notes write",
3070
3428
  "method": "POST",
@@ -4034,6 +4392,17 @@ var COMMAND_BINDINGS = {
4034
4392
  "responseKind": "single",
4035
4393
  "async": false
4036
4394
  },
4395
+ "tasks import": {
4396
+ "command": "tasks import",
4397
+ "method": "POST",
4398
+ "path": "/tasks/lists/:id/import",
4399
+ "pathParams": [
4400
+ "id"
4401
+ ],
4402
+ "argLocation": "body",
4403
+ "responseKind": "single",
4404
+ "async": false
4405
+ },
4037
4406
  "tasks label-create": {
4038
4407
  "command": "tasks label-create",
4039
4408
  "method": "POST",
@@ -4312,6 +4681,37 @@ var COMMAND_BINDINGS = {
4312
4681
  "responseKind": "single",
4313
4682
  "async": false
4314
4683
  },
4684
+ "video generate": {
4685
+ "command": "video generate",
4686
+ "method": "POST",
4687
+ "path": "/videos/generations",
4688
+ "pathParams": [],
4689
+ "argLocation": "body",
4690
+ "responseKind": "single",
4691
+ "async": true,
4692
+ "pollHint": {
4693
+ "intervalMs": 5e3,
4694
+ "maxAttempts": 240
4695
+ }
4696
+ },
4697
+ "video models": {
4698
+ "command": "video models",
4699
+ "method": "GET",
4700
+ "path": "/videos/models",
4701
+ "pathParams": [],
4702
+ "argLocation": "query",
4703
+ "responseKind": "list",
4704
+ "async": false
4705
+ },
4706
+ "video search": {
4707
+ "command": "video search",
4708
+ "method": "GET",
4709
+ "path": "/videos/models/search",
4710
+ "pathParams": [],
4711
+ "argLocation": "query",
4712
+ "responseKind": "single",
4713
+ "async": false
4714
+ },
4315
4715
  "web fetch": {
4316
4716
  "command": "web fetch",
4317
4717
  "method": "POST",
@@ -4727,46 +5127,6 @@ var ChatsApi = class {
4727
5127
  }
4728
5128
  };
4729
5129
 
4730
- // ../sdk/src/api/code.ts
4731
- var CodeRunsApi = class {
4732
- constructor(ctx) {
4733
- this.ctx = ctx;
4734
- }
4735
- /**
4736
- * Execute a code file. Returns the full `ExecutionRun` row — `id`,
4737
- * `status`, `stdout`, `stderr`, `exit_code`, and the run timestamps —
4738
- * the same shape as `GET /code-runs/:id`.
4739
- */
4740
- async run(input, opts = {}) {
4741
- const res = await request(this.ctx, {
4742
- method: "POST",
4743
- path: "/api/v1/code-runs",
4744
- body: input,
4745
- signal: opts.signal
4746
- });
4747
- return res.data;
4748
- }
4749
- /** List recent execution runs. */
4750
- async list(query = {}, opts = {}) {
4751
- const res = await request(this.ctx, {
4752
- method: "GET",
4753
- path: "/api/v1/code-runs",
4754
- query,
4755
- signal: opts.signal
4756
- });
4757
- return res.data;
4758
- }
4759
- /** Get a single execution run by id. */
4760
- async get(id, opts = {}) {
4761
- const res = await request(this.ctx, {
4762
- method: "GET",
4763
- path: `/api/v1/code-runs/${id}`,
4764
- signal: opts.signal
4765
- });
4766
- return res.data;
4767
- }
4768
- };
4769
-
4770
5130
  // ../sdk/src/api/computers.ts
4771
5131
  var ComputersApi = class {
4772
5132
  constructor(ctx) {
@@ -5403,6 +5763,156 @@ var FilesApi = class {
5403
5763
  }
5404
5764
  };
5405
5765
 
5766
+ // ../sdk/src/api/functions.ts
5767
+ var enc3 = encodeURIComponent;
5768
+ var FunctionRunsApi = class {
5769
+ constructor(ctx) {
5770
+ this.ctx = ctx;
5771
+ }
5772
+ /** List one-off function runs (cursor-paginated). */
5773
+ async list(query = {}, opts = {}) {
5774
+ const res = await request(this.ctx, {
5775
+ method: "GET",
5776
+ path: "/api/v1/functions/runs",
5777
+ query,
5778
+ signal: opts.signal
5779
+ });
5780
+ return res.data;
5781
+ }
5782
+ /** Get a single one-off run by id. */
5783
+ async get(id, opts = {}) {
5784
+ const res = await request(this.ctx, {
5785
+ method: "GET",
5786
+ path: `/api/v1/functions/runs/${enc3(id)}`,
5787
+ signal: opts.signal
5788
+ });
5789
+ return res.data;
5790
+ }
5791
+ /**
5792
+ * Interrupt a running run. Only computer-backed runs can be interrupted;
5793
+ * Lambda-backed runs return 409 (`ConflictError`).
5794
+ */
5795
+ async interrupt(id, opts = {}) {
5796
+ const res = await request(this.ctx, {
5797
+ method: "POST",
5798
+ path: `/api/v1/functions/runs/${enc3(id)}/interrupt`,
5799
+ body: {},
5800
+ signal: opts.signal
5801
+ });
5802
+ return res.data;
5803
+ }
5804
+ };
5805
+ var FunctionsApi = class {
5806
+ constructor(ctx) {
5807
+ this.ctx = ctx;
5808
+ this.runs = new FunctionRunsApi(ctx);
5809
+ }
5810
+ /**
5811
+ * Run a script ONCE in the sandbox. Pass EITHER inline `script` (+ optional
5812
+ * `language`) OR an existing Drive `file_id`. Returns the full `FunctionRun`
5813
+ * row — `id`, `status`, `stdout`, `stderr`, `exit_code`, the run timestamps,
5814
+ * and any `output_files` the script wrote under `/tmp/output/`.
5815
+ */
5816
+ async run(input, opts = {}) {
5817
+ const res = await request(this.ctx, {
5818
+ method: "POST",
5819
+ path: "/api/v1/functions/runs",
5820
+ body: input,
5821
+ signal: opts.signal
5822
+ });
5823
+ return res.data;
5824
+ }
5825
+ /** List deployed functions in the workspace. */
5826
+ async list(query = {}, opts = {}) {
5827
+ const res = await request(this.ctx, {
5828
+ method: "GET",
5829
+ path: "/api/v1/functions",
5830
+ query,
5831
+ signal: opts.signal
5832
+ });
5833
+ return res.data;
5834
+ }
5835
+ /** Get a deployed function by its resourceId. */
5836
+ async get(id, opts = {}) {
5837
+ const res = await request(this.ctx, {
5838
+ method: "GET",
5839
+ path: `/api/v1/functions/${enc3(id)}`,
5840
+ signal: opts.signal
5841
+ });
5842
+ return res.data;
5843
+ }
5844
+ /** Create a deployed function (config only — `deploy` adds a bundle). */
5845
+ async create(input, opts = {}) {
5846
+ const res = await request(this.ctx, {
5847
+ method: "POST",
5848
+ path: "/api/v1/functions",
5849
+ body: input,
5850
+ signal: opts.signal
5851
+ });
5852
+ return res.data;
5853
+ }
5854
+ /** Update a deployed function's config. */
5855
+ async update(id, patch, opts = {}) {
5856
+ const res = await request(this.ctx, {
5857
+ method: "PATCH",
5858
+ path: `/api/v1/functions/${enc3(id)}`,
5859
+ body: patch,
5860
+ signal: opts.signal
5861
+ });
5862
+ return res.data;
5863
+ }
5864
+ /** Delete a deployed function + all its deployments. */
5865
+ async delete(id, opts = {}) {
5866
+ return request(this.ctx, {
5867
+ method: "DELETE",
5868
+ path: `/api/v1/functions/${enc3(id)}`,
5869
+ signal: opts.signal
5870
+ });
5871
+ }
5872
+ /**
5873
+ * Deploy a new bundle (inline base64 files). Promotes the new deployment to
5874
+ * live immediately unless `promote: false`. Returns the new deployment.
5875
+ */
5876
+ async deploy(id, input, opts = {}) {
5877
+ const res = await request(this.ctx, {
5878
+ method: "POST",
5879
+ path: `/api/v1/functions/${enc3(id)}/deploy`,
5880
+ body: input,
5881
+ signal: opts.signal
5882
+ });
5883
+ return res.data;
5884
+ }
5885
+ /** List a function's deployments (newest-first). */
5886
+ async deployments(id, opts = {}) {
5887
+ const res = await request(this.ctx, {
5888
+ method: "GET",
5889
+ path: `/api/v1/functions/${enc3(id)}/deployments`,
5890
+ signal: opts.signal
5891
+ });
5892
+ return res.data;
5893
+ }
5894
+ /** Promote (or roll back to) a deployment — flips the active one. */
5895
+ async promote(id, input, opts = {}) {
5896
+ const res = await request(this.ctx, {
5897
+ method: "POST",
5898
+ path: `/api/v1/functions/${enc3(id)}/promote`,
5899
+ body: input,
5900
+ signal: opts.signal
5901
+ });
5902
+ return res.data;
5903
+ }
5904
+ /** Invoke a deployed function synchronously; returns its response. */
5905
+ async invoke(id, input = {}, opts = {}) {
5906
+ const res = await request(this.ctx, {
5907
+ method: "POST",
5908
+ path: `/api/v1/functions/${enc3(id)}/invoke`,
5909
+ body: input,
5910
+ signal: opts.signal
5911
+ });
5912
+ return res.data;
5913
+ }
5914
+ };
5915
+
5406
5916
  // ../sdk/src/api/guide.ts
5407
5917
  var GuideApi = class {
5408
5918
  constructor(ctx) {
@@ -5705,7 +6215,7 @@ var ProviderEndpointsApi = class {
5705
6215
  };
5706
6216
 
5707
6217
  // ../sdk/src/api/realtime.ts
5708
- var enc3 = encodeURIComponent;
6218
+ var enc4 = encodeURIComponent;
5709
6219
  var RECONNECT_MIN_MS = 1e3;
5710
6220
  var RECONNECT_MAX_MS = 3e4;
5711
6221
  var RealtimeApi = class {
@@ -5716,7 +6226,7 @@ var RealtimeApi = class {
5716
6226
  async broadcast(channel, message, opts = {}) {
5717
6227
  const res = await request(this.ctx, {
5718
6228
  method: "POST",
5719
- path: `/api/v1/realtime/${enc3(channel)}/broadcast`,
6229
+ path: `/api/v1/realtime/${enc4(channel)}/broadcast`,
5720
6230
  body: { message },
5721
6231
  signal: opts.signal
5722
6232
  });
@@ -5726,7 +6236,7 @@ var RealtimeApi = class {
5726
6236
  async heartbeat(channel, opts = {}) {
5727
6237
  const res = await request(this.ctx, {
5728
6238
  method: "POST",
5729
- path: `/api/v1/realtime/${enc3(channel)}/presence`,
6239
+ path: `/api/v1/realtime/${enc4(channel)}/presence`,
5730
6240
  body: { meta: opts.meta, ttl_seconds: opts.ttlSeconds },
5731
6241
  signal: opts.signal
5732
6242
  });
@@ -5736,7 +6246,7 @@ var RealtimeApi = class {
5736
6246
  async presence(channel, opts = {}) {
5737
6247
  const res = await request(this.ctx, {
5738
6248
  method: "GET",
5739
- path: `/api/v1/realtime/${enc3(channel)}/presence`,
6249
+ path: `/api/v1/realtime/${enc4(channel)}/presence`,
5740
6250
  signal: opts.signal
5741
6251
  });
5742
6252
  return res.data;
@@ -6143,7 +6653,7 @@ var SubscriptionApi = class {
6143
6653
  };
6144
6654
 
6145
6655
  // ../sdk/src/api/tables.ts
6146
- var enc4 = encodeURIComponent;
6656
+ var enc5 = encodeURIComponent;
6147
6657
  var TablesApi = class {
6148
6658
  constructor(ctx) {
6149
6659
  this.ctx = ctx;
@@ -6164,7 +6674,7 @@ var TablesApi = class {
6164
6674
  async get(id, opts = {}) {
6165
6675
  const res = await request(this.ctx, {
6166
6676
  method: "GET",
6167
- path: `/api/v1/tables/${enc4(id)}`,
6677
+ path: `/api/v1/tables/${enc5(id)}`,
6168
6678
  signal: opts.signal
6169
6679
  });
6170
6680
  return res.data;
@@ -6181,7 +6691,7 @@ var TablesApi = class {
6181
6691
  async update(id, input, opts = {}) {
6182
6692
  const res = await request(this.ctx, {
6183
6693
  method: "PATCH",
6184
- path: `/api/v1/tables/${enc4(id)}`,
6694
+ path: `/api/v1/tables/${enc5(id)}`,
6185
6695
  body: input,
6186
6696
  signal: opts.signal
6187
6697
  });
@@ -6190,7 +6700,7 @@ var TablesApi = class {
6190
6700
  async delete(id, opts = {}) {
6191
6701
  return request(this.ctx, {
6192
6702
  method: "DELETE",
6193
- path: `/api/v1/tables/${enc4(id)}`,
6703
+ path: `/api/v1/tables/${enc5(id)}`,
6194
6704
  signal: opts.signal
6195
6705
  });
6196
6706
  }
@@ -6198,7 +6708,7 @@ var TablesApi = class {
6198
6708
  async query(id, query = {}, opts = {}) {
6199
6709
  const res = await request(this.ctx, {
6200
6710
  method: "POST",
6201
- path: `/api/v1/tables/${enc4(id)}/query`,
6711
+ path: `/api/v1/tables/${enc5(id)}/query`,
6202
6712
  body: query,
6203
6713
  signal: opts.signal
6204
6714
  });
@@ -6207,7 +6717,7 @@ var TablesApi = class {
6207
6717
  async createRecord(id, values, opts = {}) {
6208
6718
  const res = await request(this.ctx, {
6209
6719
  method: "POST",
6210
- path: `/api/v1/tables/${enc4(id)}/records`,
6720
+ path: `/api/v1/tables/${enc5(id)}/records`,
6211
6721
  body: { values },
6212
6722
  signal: opts.signal
6213
6723
  });
@@ -6216,7 +6726,7 @@ var TablesApi = class {
6216
6726
  async getRecord(id, recordId, opts = {}) {
6217
6727
  const res = await request(this.ctx, {
6218
6728
  method: "GET",
6219
- path: `/api/v1/tables/${enc4(id)}/records/${enc4(recordId)}`,
6729
+ path: `/api/v1/tables/${enc5(id)}/records/${enc5(recordId)}`,
6220
6730
  signal: opts.signal
6221
6731
  });
6222
6732
  return res.data;
@@ -6224,7 +6734,7 @@ var TablesApi = class {
6224
6734
  async updateRecord(id, recordId, values, opts = {}) {
6225
6735
  const res = await request(this.ctx, {
6226
6736
  method: "PATCH",
6227
- path: `/api/v1/tables/${enc4(id)}/records/${enc4(recordId)}`,
6737
+ path: `/api/v1/tables/${enc5(id)}/records/${enc5(recordId)}`,
6228
6738
  body: { values },
6229
6739
  signal: opts.signal
6230
6740
  });
@@ -6233,7 +6743,7 @@ var TablesApi = class {
6233
6743
  async deleteRecord(id, recordId, opts = {}) {
6234
6744
  return request(this.ctx, {
6235
6745
  method: "DELETE",
6236
- path: `/api/v1/tables/${enc4(id)}/records/${enc4(recordId)}`,
6746
+ path: `/api/v1/tables/${enc5(id)}/records/${enc5(recordId)}`,
6237
6747
  signal: opts.signal
6238
6748
  });
6239
6749
  }
@@ -6241,7 +6751,7 @@ var TablesApi = class {
6241
6751
  async exportCsv(id, opts = {}) {
6242
6752
  const res = await requestRaw(this.ctx, {
6243
6753
  method: "GET",
6244
- path: `/api/v1/tables/${enc4(id)}/export`,
6754
+ path: `/api/v1/tables/${enc5(id)}/export`,
6245
6755
  signal: opts.signal,
6246
6756
  expectJson: false
6247
6757
  });
@@ -6251,7 +6761,7 @@ var TablesApi = class {
6251
6761
  async importCsv(id, csv, opts = {}) {
6252
6762
  const res = await request(this.ctx, {
6253
6763
  method: "POST",
6254
- path: `/api/v1/tables/${enc4(id)}/import`,
6764
+ path: `/api/v1/tables/${enc5(id)}/import`,
6255
6765
  body: { csv },
6256
6766
  signal: opts.signal
6257
6767
  });
@@ -6449,6 +6959,55 @@ var UserApi = class {
6449
6959
  }
6450
6960
  };
6451
6961
 
6962
+ // ../sdk/src/api/videos.ts
6963
+ var GENERATE_BINDING = COMMAND_BINDINGS["video generate"];
6964
+ var VideosApi = class {
6965
+ constructor(ctx) {
6966
+ this.ctx = ctx;
6967
+ }
6968
+ async listModels(opts = {}) {
6969
+ const res = await request(this.ctx, {
6970
+ method: "GET",
6971
+ path: "/api/v1/videos/models",
6972
+ signal: opts.signal
6973
+ });
6974
+ return res.data;
6975
+ }
6976
+ async searchModels(input = {}, opts = {}) {
6977
+ const res = await request(
6978
+ this.ctx,
6979
+ {
6980
+ method: "GET",
6981
+ path: "/api/v1/videos/models/search",
6982
+ query: input,
6983
+ signal: opts.signal
6984
+ }
6985
+ );
6986
+ return res.data;
6987
+ }
6988
+ async generate(input, opts = {}) {
6989
+ const res = await request(this.ctx, {
6990
+ method: "POST",
6991
+ path: "/api/v1/videos/generations",
6992
+ body: input,
6993
+ signal: opts.signal
6994
+ });
6995
+ const handle = res.data;
6996
+ if (opts.wait === false) return handle;
6997
+ const pollOpts = {
6998
+ signal: opts.signal,
6999
+ pollIntervalMs: opts.pollIntervalMs,
7000
+ maxPollAttempts: opts.maxPollAttempts
7001
+ };
7002
+ return await awaitOperation(
7003
+ GENERATE_BINDING,
7004
+ handle.id,
7005
+ this.ctx,
7006
+ pollOpts
7007
+ );
7008
+ }
7009
+ };
7010
+
6452
7011
  // ../sdk/src/api/web.ts
6453
7012
  var WebSearchApi = class {
6454
7013
  constructor(ctx) {
@@ -6612,7 +7171,7 @@ var WorkspacesApi = class {
6612
7171
  };
6613
7172
 
6614
7173
  // ../sdk/src/version.ts
6615
- var VERSION = "0.1.0" ;
7174
+ var VERSION = "0.2.0" ;
6616
7175
 
6617
7176
  // src/api/app.ts
6618
7177
  var RemoteBundleReader = class {
@@ -7074,6 +7633,6 @@ function isDataStore(x) {
7074
7633
  return typeof x.write === "function" && typeof x.upload === "function" && typeof x.getMetadata === "function";
7075
7634
  }
7076
7635
 
7077
- export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, BlobsApi, COMMAND_BINDINGS, ChatsApi, CodeRunsApi, ComputersApi, ConflictError, DataFolder, DatastoreApi, DocsApi, FilesApi, GuideApi, IdaptError, ImagesApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, StoreApi, SubscriptionApi, TablesApi, TriggersApi, UserApi, VERSION, WebSearchApi, WorkspacesApi, awaitOperation, buildUrl, errorFromStatus, executeCommand, getFileBlob, getFileText, listFiles, request, requestRaw };
7078
- //# sourceMappingURL=chunk-AQZ2QVBK.js.map
7079
- //# sourceMappingURL=chunk-AQZ2QVBK.js.map
7636
+ export { AgentsApi, AiGatewayApi, ApiKeysApi, AppFolder, AudioApi, AuthError, BlobsApi, COMMAND_BINDINGS, ChatsApi, ComputersApi, ConflictError, DataFolder, DatastoreApi, DocsApi, FilesApi, FunctionsApi, GuideApi, IdaptError, ImagesApi, InvalidRequestError, ModelsApi, NetworkError, NotFoundError, NotificationsApi, PermissionError, ProviderEndpointsApi, RateLimitError, RealtimeApi, RemoteBundleReader, RemoteDataStore, SearchApi, SecretsApi, ServerError, ServiceUnavailableError, SettingsApi, SharingApi, StoreApi, SubscriptionApi, TablesApi, TriggersApi, UserApi, VERSION, VideosApi, WebSearchApi, WorkspacesApi, awaitOperation, buildUrl, errorFromStatus, executeCommand, getFileBlob, getFileText, listFiles, request, requestRaw };
7637
+ //# sourceMappingURL=chunk-KHPTFRT3.js.map
7638
+ //# sourceMappingURL=chunk-KHPTFRT3.js.map