@deepraxis/sdk 0.1.1-dev.a936efe → 0.1.1-dev.a9f73d6

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.
@@ -55511,6 +55511,288 @@ export type ComputersFilesContentResponses = {
55511
55511
  206: Blob | File;
55512
55512
  };
55513
55513
  export type ComputersFilesContentResponse = ComputersFilesContentResponses[keyof ComputersFilesContentResponses];
55514
+ export type PreviewComputerFileData = {
55515
+ body?: never;
55516
+ path: {
55517
+ /**
55518
+ * Computer id from computer creation or listing; a computer another tenant owns is not found.
55519
+ */
55520
+ computer_id: string;
55521
+ };
55522
+ query: {
55523
+ /**
55524
+ * Absolute path of the file on the computer, or a /workspace/ relative path.
55525
+ */
55526
+ path: string;
55527
+ /**
55528
+ * The file version to answer for: the file listing's version (<size>-<mtimeMs>), or the full product version (<size>-<mtimeMs>-<variant>-fmt<N>) a previous answer returned. A pinned version answers from the product registry without a stat or a wake.
55529
+ */
55530
+ v?: string;
55531
+ /**
55532
+ * The product to answer; auto picks the kind's own (image, pdf, text or original). A variant the file cannot produce answers 400 PREVIEW_VARIANT_UNAVAILABLE.
55533
+ */
55534
+ variant?: 'auto' | 'image' | 'pdf' | 'text' | 'original';
55535
+ };
55536
+ url: '/agent/v1/computers/{computer_id}/files/preview';
55537
+ };
55538
+ export type PreviewComputerFileErrors = {
55539
+ /**
55540
+ * INVALID_PARAMS: path is missing, a query parameter is unsupported, the pinned version is malformed, or PREVIEW_VARIANT_UNAVAILABLE: this file has no such variant.
55541
+ */
55542
+ 400: {
55543
+ type: 'error';
55544
+ error: {
55545
+ /**
55546
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55547
+ */
55548
+ type: string;
55549
+ message: string;
55550
+ code: string;
55551
+ retryable: boolean;
55552
+ /**
55553
+ * How to recover, for computer failures.
55554
+ */
55555
+ hint?: string;
55556
+ };
55557
+ /**
55558
+ * Equals the X-Request-Id response header.
55559
+ */
55560
+ request_id: string;
55561
+ };
55562
+ /**
55563
+ * Platform error in the one /agent/v1 error body; computer failures add error.hint
55564
+ */
55565
+ 401: {
55566
+ type: 'error';
55567
+ error: {
55568
+ /**
55569
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55570
+ */
55571
+ type: string;
55572
+ message: string;
55573
+ code: string;
55574
+ retryable: boolean;
55575
+ /**
55576
+ * How to recover, for computer failures.
55577
+ */
55578
+ hint?: string;
55579
+ };
55580
+ /**
55581
+ * Equals the X-Request-Id response header.
55582
+ */
55583
+ request_id: string;
55584
+ };
55585
+ /**
55586
+ * Platform error in the one /agent/v1 error body; computer failures add error.hint
55587
+ */
55588
+ 403: {
55589
+ type: 'error';
55590
+ error: {
55591
+ /**
55592
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55593
+ */
55594
+ type: string;
55595
+ message: string;
55596
+ code: string;
55597
+ retryable: boolean;
55598
+ /**
55599
+ * How to recover, for computer failures.
55600
+ */
55601
+ hint?: string;
55602
+ };
55603
+ /**
55604
+ * Equals the X-Request-Id response header.
55605
+ */
55606
+ request_id: string;
55607
+ };
55608
+ /**
55609
+ * Computer or path not found; foreign computers are indistinguishable from absent computers.
55610
+ */
55611
+ 404: {
55612
+ type: 'error';
55613
+ error: {
55614
+ /**
55615
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55616
+ */
55617
+ type: string;
55618
+ message: string;
55619
+ code: string;
55620
+ retryable: boolean;
55621
+ /**
55622
+ * How to recover, for computer failures.
55623
+ */
55624
+ hint?: string;
55625
+ };
55626
+ /**
55627
+ * Equals the X-Request-Id response header.
55628
+ */
55629
+ request_id: string;
55630
+ };
55631
+ /**
55632
+ * STALE_DIGEST: the file changed while its product was read; ask again.
55633
+ */
55634
+ 409: {
55635
+ type: 'error';
55636
+ error: {
55637
+ /**
55638
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55639
+ */
55640
+ type: string;
55641
+ message: string;
55642
+ code: string;
55643
+ retryable: boolean;
55644
+ /**
55645
+ * How to recover, for computer failures.
55646
+ */
55647
+ hint?: string;
55648
+ };
55649
+ /**
55650
+ * Equals the X-Request-Id response header.
55651
+ */
55652
+ request_id: string;
55653
+ };
55654
+ /**
55655
+ * FILE_TOO_LARGE: the file exceeds the preview transfer limit; read it through the sandbox connection issued by connect, or use the content door.
55656
+ */
55657
+ 413: {
55658
+ type: 'error';
55659
+ error: {
55660
+ /**
55661
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55662
+ */
55663
+ type: string;
55664
+ message: string;
55665
+ code: string;
55666
+ retryable: boolean;
55667
+ /**
55668
+ * How to recover, for computer failures.
55669
+ */
55670
+ hint?: string;
55671
+ };
55672
+ /**
55673
+ * Equals the X-Request-Id response header.
55674
+ */
55675
+ request_id: string;
55676
+ };
55677
+ /**
55678
+ * Platform error in the one /agent/v1 error body; computer failures add error.hint
55679
+ */
55680
+ 429: {
55681
+ type: 'error';
55682
+ error: {
55683
+ /**
55684
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55685
+ */
55686
+ type: string;
55687
+ message: string;
55688
+ code: string;
55689
+ retryable: boolean;
55690
+ /**
55691
+ * How to recover, for computer failures.
55692
+ */
55693
+ hint?: string;
55694
+ };
55695
+ /**
55696
+ * Equals the X-Request-Id response header.
55697
+ */
55698
+ request_id: string;
55699
+ };
55700
+ /**
55701
+ * Platform error in the one /agent/v1 error body; computer failures add error.hint
55702
+ */
55703
+ 500: {
55704
+ type: 'error';
55705
+ error: {
55706
+ /**
55707
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55708
+ */
55709
+ type: string;
55710
+ message: string;
55711
+ code: string;
55712
+ retryable: boolean;
55713
+ /**
55714
+ * How to recover, for computer failures.
55715
+ */
55716
+ hint?: string;
55717
+ };
55718
+ /**
55719
+ * Equals the X-Request-Id response header.
55720
+ */
55721
+ request_id: string;
55722
+ };
55723
+ /**
55724
+ * PREVIEW_UNAVAILABLE: preview products or image transformation are not configured for this deployment, or the File service could not be reached; retry later.
55725
+ */
55726
+ 503: {
55727
+ type: 'error';
55728
+ error: {
55729
+ /**
55730
+ * Anthropic error type, such as invalid_request_error or not_found_error.
55731
+ */
55732
+ type: string;
55733
+ message: string;
55734
+ code: string;
55735
+ retryable: boolean;
55736
+ /**
55737
+ * How to recover, for computer failures.
55738
+ */
55739
+ hint?: string;
55740
+ };
55741
+ /**
55742
+ * Equals the X-Request-Id response header.
55743
+ */
55744
+ request_id: string;
55745
+ };
55746
+ };
55747
+ export type PreviewComputerFileError = PreviewComputerFileErrors[keyof PreviewComputerFileErrors];
55748
+ export type PreviewComputerFileResponses = {
55749
+ /**
55750
+ * The preview product, or the fallback that sends the caller to the content door.
55751
+ */
55752
+ 200: {
55753
+ /**
55754
+ * The product answered: image is a 1600 px WebP, pdf a linearized PDF, text the first 64 KiB of text or source, original the file's own bytes.
55755
+ */
55756
+ variant: 'image' | 'pdf' | 'text' | 'original';
55757
+ /**
55758
+ * The product version (<size>-<mtimeMs>-<variant>-fmt<N>) this answer belongs to; absent when the file has no mtime, so nothing may be pinned.
55759
+ */
55760
+ version?: string;
55761
+ /**
55762
+ * Media type of the product, or of the original bytes.
55763
+ */
55764
+ mime_type?: string;
55765
+ /**
55766
+ * Size of the product in bytes.
55767
+ */
55768
+ size?: number;
55769
+ /**
55770
+ * File id of the stored product in the File service, when the product was stored.
55771
+ */
55772
+ file_id?: string;
55773
+ /**
55774
+ * Signed read address of the product; the caller streams it and caches by the version it pinned.
55775
+ */
55776
+ url?: string;
55777
+ /**
55778
+ * When the signed read address stops working.
55779
+ */
55780
+ expires_at?: string;
55781
+ /**
55782
+ * true when an existing product answered without regenerating it.
55783
+ */
55784
+ cached: boolean;
55785
+ /**
55786
+ * Present as content when no product was produced: the file is over the size threshold or the deployment has no File service. The caller reads the file through the content door.
55787
+ */
55788
+ fallback?: 'content';
55789
+ /**
55790
+ * true only on a pre-generation request over the kind's threshold, where generation was skipped.
55791
+ */
55792
+ skipped?: boolean;
55793
+ };
55794
+ };
55795
+ export type PreviewComputerFileResponse = PreviewComputerFileResponses[keyof PreviewComputerFileResponses];
55514
55796
  export type ComputersFilesConvertData = {
55515
55797
  body?: never;
55516
55798
  path: {
@@ -1360,6 +1360,50 @@ export const operations = [
1360
1360
  }
1361
1361
  ]
1362
1362
  },
1363
+ {
1364
+ "resource": "agent.computers.files",
1365
+ "method": "retrievePreview",
1366
+ "summary": "Preview a computer file",
1367
+ "description": "The preview product of one version of one computer file: an image becomes a 1600 px WebP, an Office document a linearized PDF, text and source the first 64 KiB, and PDF, xlsx, epub, GIF, SVG and unknown types their original bytes. Products live in the File service and are keyed by computer, path, size, mtime, variant and format version. A request that pins `v` answers from that registry without stat'ing or waking the computer; without `v` the file is read and the product generated once. A file over the size threshold, or a deployment without the File service, answers `fallback: \"content\"` so the caller keeps the ordinary content door.",
1368
+ "http": "GET",
1369
+ "path": "/agent/v1/computers/{computer_id}/files/preview",
1370
+ "streaming": "no",
1371
+ "pagination": false,
1372
+ "pathParams": [
1373
+ {
1374
+ "name": "computer_id",
1375
+ "sdkName": "computer_id",
1376
+ "description": "Computer id from computer creation or listing; a computer another tenant owns is not found."
1377
+ }
1378
+ ],
1379
+ "query": [
1380
+ {
1381
+ "name": "path",
1382
+ "type": "string",
1383
+ "required": true,
1384
+ "description": "Absolute path of the file on the computer, or a /workspace/ relative path."
1385
+ },
1386
+ {
1387
+ "name": "v",
1388
+ "type": "string",
1389
+ "required": false,
1390
+ "description": "The file version to answer for: the file listing's version (<size>-<mtimeMs>), or the full product version (<size>-<mtimeMs>-<variant>-fmt<N>) a previous answer returned. A pinned version answers from the product registry without a stat or a wake."
1391
+ },
1392
+ {
1393
+ "name": "variant",
1394
+ "type": "string",
1395
+ "enum": [
1396
+ "auto",
1397
+ "image",
1398
+ "pdf",
1399
+ "text",
1400
+ "original"
1401
+ ],
1402
+ "required": false,
1403
+ "description": "The product to answer; auto picks the kind's own (image, pdf, text or original). A variant the file cannot produce answers 400 PREVIEW_VARIANT_UNAVAILABLE."
1404
+ }
1405
+ ]
1406
+ },
1363
1407
  {
1364
1408
  "resource": "agent.computers.leases",
1365
1409
  "method": "delete",
@@ -2364,6 +2364,18 @@ export declare function createAgent(transport: Transport): {
2364
2364
  tier: "light" | "heavy";
2365
2365
  }>;
2366
2366
  retrieveContent: (options: import("./core/transport.js").CallOptions<Types.ComputersFilesContentData>) => Promise<Blob | File>;
2367
+ retrievePreview: (options: import("./core/transport.js").CallOptions<Types.PreviewComputerFileData>) => Promise<{
2368
+ variant: "image" | "pdf" | "text" | "original";
2369
+ version?: string;
2370
+ mime_type?: string;
2371
+ size?: number;
2372
+ file_id?: string;
2373
+ url?: string;
2374
+ expires_at?: string;
2375
+ cached: boolean;
2376
+ fallback?: "content";
2377
+ skipped?: boolean;
2378
+ }>;
2367
2379
  };
2368
2380
  leases: {
2369
2381
  delete: (options: import("./core/transport.js").CallOptions<Types.ReleaseComputerLeaseData>) => Promise<{
@@ -64,6 +64,7 @@ export function createAgent(transport) {
64
64
  },
65
65
  list: bind(transport, sdk.computersFilesList),
66
66
  retrieveContent: bind(transport, sdk.computersFilesContent),
67
+ retrievePreview: bind(transport, sdk.previewComputerFile),
67
68
  },
68
69
  leases: {
69
70
  delete: bind(transport, sdk.releaseComputerLease),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepraxis/sdk",
3
- "version": "0.1.1-dev.a936efe",
3
+ "version": "0.1.1-dev.a9f73d6",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {