@trops/dash-core 0.1.408 → 0.1.409

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.
@@ -235,6 +235,14 @@ async function createFolder(token, parentId, name) {
235
235
  );
236
236
  }
237
237
 
238
+ async function getFileMetadata(token, fileId) {
239
+ const fields = encodeURIComponent("id,name,mimeType");
240
+ return await driveRequest(
241
+ `/drive/v3/files/${fileId}?fields=${fields}`,
242
+ token,
243
+ );
244
+ }
245
+
238
246
  async function readFile(token, fileId) {
239
247
  return await driveRequest(`/drive/v3/files/${fileId}?alt=media`, token);
240
248
  }
@@ -515,6 +523,21 @@ if (process.argv[2] === "auth") {
515
523
  required: ["path"],
516
524
  },
517
525
  },
526
+ {
527
+ name: "get_folder_info",
528
+ description:
529
+ "Return metadata (id, name, mimeType) for a folder or file by ID. Primarily used to resolve a Drive folder's own name from an ID (the other list/read tools only describe a folder's children, not the folder itself).",
530
+ inputSchema: {
531
+ type: "object",
532
+ properties: {
533
+ fileId: {
534
+ type: "string",
535
+ description: "Drive file or folder ID",
536
+ },
537
+ },
538
+ required: ["fileId"],
539
+ },
540
+ },
518
541
  ],
519
542
  }));
520
543
 
@@ -694,6 +717,21 @@ if (process.argv[2] === "auth") {
694
717
  };
695
718
  }
696
719
 
720
+ case "get_folder_info": {
721
+ if (!args.fileId) {
722
+ return {
723
+ content: [
724
+ { type: "text", text: "Missing required argument: fileId" },
725
+ ],
726
+ isError: true,
727
+ };
728
+ }
729
+ const meta = await getFileMetadata(token, args.fileId);
730
+ return {
731
+ content: [{ type: "text", text: JSON.stringify(meta) }],
732
+ };
733
+ }
734
+
697
735
  default:
698
736
  return {
699
737
  content: [{ type: "text", text: `Unknown tool: ${toolName}` }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trops/dash-core",
3
- "version": "0.1.408",
3
+ "version": "0.1.409",
4
4
  "description": "Core framework for Dash dashboard applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",