@khotan/cli 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -142,7 +142,7 @@ documented surface and the executable surface cannot drift. Run `khotan help` or
142
142
  | App env | `apps env list <id>`, `apps env set <id> <KEY> --value V`, `apps env reveal <id> <KEY>`, `apps env unset <id> <KEY>`, `apps env bulk-set <id> --var A=1 --var B=2` |
143
143
  | Pipelines | same shape as apps under `pipelines …` |
144
144
  | Databases | `databases list`, `databases create --name db`, `databases connection <id>`, `databases rotate-credentials <id>`, `databases delete <id>` |
145
- | Files | `files list`, `files get <id>`, `files upload <path>`, `files download <id> --output <path>`, `files update <id> --name new.txt`, `files delete <id>` |
145
+ | Files | `files list`, `files get <id>`, `files upload <path>`, `files download <id> --output <path>`, `files download-url <id>`, `files preview-url <id>`, `files update <id> --name new.txt`, `files delete <id>` |
146
146
  | Folders | `folders list`, `folders create --name docs`, `folders rename <id> --name new`, `folders delete <id>` |
147
147
  | Context | `context list`, `context get <slug>`, `context raw <slug>`, `context create --title T --kind knowledge --content '...'`, `context update <slug> --expected-revision 3 --content '...'`, `context delete <slug>` |
148
148
 
@@ -173,6 +173,17 @@ khotan files upload ./report.pdf --folder-path /reports/2026
173
173
  khotan files download file_123 --output ./report.pdf
174
174
  ```
175
175
 
176
+ To hand a file to a browser instead of saving it locally, mint a short-lived
177
+ presigned URL and load it directly (no API key on the URL; expires in ~5 minutes):
178
+
179
+ ```bash
180
+ khotan files preview-url file_123 # inline disposition, images and PDFs only
181
+ khotan files download-url file_123 # attachment disposition, any file type
182
+ ```
183
+
184
+ See [Serving file attachments](../../docs/files-api-attachments.md) for the full
185
+ preview/download flow and the receiver wiring guidance.
186
+
176
187
  ## MCP server
177
188
 
178
189
  `khotan mcp serve` starts a local stdio MCP server that reuses the same profile,
package/dist/khotan.js CHANGED
@@ -906,6 +906,19 @@ var init_catalog = __esm(() => {
906
906
  cli: { command: ["files", "download-url"], summary: "Get a file download URL", defaultOutput: "detail" },
907
907
  mcp: { tool: { name: "khotan_files_download", title: "Get a file download URL", description: "Return a short-lived presigned GET URL for a ready file." } }
908
908
  },
909
+ {
910
+ id: "files.preview",
911
+ kind: "operation",
912
+ domain: "files",
913
+ safety: "read",
914
+ auth: true,
915
+ title: "Get a file preview URL",
916
+ description: "Return a short-lived presigned inline GET URL for a ready, preview-eligible file (images and PDFs).",
917
+ input: [idField("fileId", "The file id.")],
918
+ http: { method: "GET", path: "/api/v1/files/{fileId}/preview", operationId: "getFilePreviewUrl" },
919
+ cli: { command: ["files", "preview-url"], summary: "Get a file preview URL", defaultOutput: "detail" },
920
+ mcp: { tool: { name: "khotan_files_preview", title: "Get a file preview URL", description: "Return a short-lived presigned inline GET URL for a ready, preview-eligible file (images and PDFs)." } }
921
+ },
909
922
  {
910
923
  id: "files.resource",
911
924
  kind: "resource",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@khotan/cli",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Khotan CLI and MCP server: human- and agent-facing adapters over the Khotan /api/v1 surface.",
6
6
  "license": "SEE LICENSE IN LICENSE.md",