@idapt/cli 1.11.0 → 1.12.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/dist/index.cjs CHANGED
@@ -5714,6 +5714,8 @@ var noteBoxSchema = zod.z.object({
5714
5714
  var noteSchema = zod.z.object({
5715
5715
  /** Public resourceId of the note. */
5716
5716
  id: zod.z.string(),
5717
+ /** Containing folder's resourceId, or null at the box root. */
5718
+ folder_id: zod.z.string().nullable(),
5717
5719
  title: zod.z.string(),
5718
5720
  content: zod.z.string(),
5719
5721
  /** "note" or "index". */
@@ -5723,6 +5725,38 @@ var noteSchema = zod.z.object({
5723
5725
  created_at: zod.z.string(),
5724
5726
  updated_at: zod.z.string()
5725
5727
  }).meta({ id: "Note" });
5728
+ var noteFolderSchema = zod.z.object({
5729
+ /** Public resourceId of the folder. */
5730
+ id: zod.z.string(),
5731
+ /** Parent folder's resourceId, or null at the box root. */
5732
+ parent_id: zod.z.string().nullable(),
5733
+ name: zod.z.string(),
5734
+ created_at: zod.z.string(),
5735
+ updated_at: zod.z.string()
5736
+ }).meta({ id: "NoteFolder" });
5737
+ var noteTreeSchema = zod.z.object({
5738
+ folders: zod.z.array(noteFolderSchema),
5739
+ notes: zod.z.array(noteSchema)
5740
+ }).meta({ id: "NoteTree" });
5741
+ var noteTrashEntrySchema = zod.z.object({
5742
+ /** "note", "folder", or "box". */
5743
+ kind: zod.z.string(),
5744
+ /** Public resourceId of the trashed root. */
5745
+ id: zod.z.string(),
5746
+ /** Owning box resourceId (null for a box entry). */
5747
+ note_box_id: zod.z.string().nullable(),
5748
+ /** Note title / folder name / box name. */
5749
+ name: zod.z.string(),
5750
+ /** Location hint (box name for notes/folders). */
5751
+ path: zod.z.string().nullable(),
5752
+ child_count: zod.z.number().int(),
5753
+ trashed_at: zod.z.string()
5754
+ }).meta({ id: "NoteTrashEntry" });
5755
+ var noteImportResultSchema = zod.z.object({
5756
+ imported_notes: zod.z.number().int(),
5757
+ created_folders: zod.z.number().int(),
5758
+ skipped: zod.z.number().int()
5759
+ }).meta({ id: "NoteImportResult" });
5726
5760
  var noteHitSchema = zod.z.object({
5727
5761
  id: zod.z.string(),
5728
5762
  title: zod.z.string(),
@@ -5803,6 +5837,47 @@ var noteRenameRequestSchema = zod.z.object({
5803
5837
  retarget_wikilinks: zod.z.coerce.boolean().optional()
5804
5838
  });
5805
5839
  var noteRenameResponseSchema = zod.z.object({ note: noteSchema, retargeted_count: zod.z.number().int() }).meta({ id: "NoteRenameResult" });
5840
+ var folderCreateRequestSchema = zod.z.object({
5841
+ name: zod.z.string().min(1).max(100),
5842
+ /** Parent folder resourceId (null/omitted = box root). */
5843
+ parent_id: zod.z.string().max(64).nullable().optional()
5844
+ });
5845
+ var folderRenameRequestSchema = zod.z.object({
5846
+ name: zod.z.string().min(1).max(100)
5847
+ });
5848
+ var folderMoveRequestSchema = zod.z.object({
5849
+ /** New parent folder resourceId (null/omitted = box root). */
5850
+ parent_id: zod.z.string().max(64).nullable().optional()
5851
+ });
5852
+ var noteMoveRequestSchema = zod.z.object({
5853
+ /** The note's title (identifies it within the box). */
5854
+ title: zod.z.string().min(1).max(200),
5855
+ /** Destination folder resourceId (null/omitted = box root). */
5856
+ folder_id: zod.z.string().max(64).nullable().optional()
5857
+ });
5858
+ var noteImportRequestSchema = zod.z.object({
5859
+ /** Text files to import; folders are derived from the `/`-separated path. */
5860
+ items: zod.z.array(
5861
+ zod.z.object({
5862
+ /** Relative path incl. filename, e.g. `sub/dir/Readme.md`. */
5863
+ path: zod.z.string().min(1).max(1024),
5864
+ content: zod.z.string().max(262144)
5865
+ })
5866
+ ).min(1).max(5e3)
5867
+ });
5868
+ var trashListRequestSchema = zod.z.object({
5869
+ workspace_id: zod.z.string().max(64).optional()
5870
+ });
5871
+ var trashActionRequestSchema = zod.z.object({
5872
+ /** "note", "folder", or "box". */
5873
+ kind: zod.z.enum(["note", "folder", "box"]),
5874
+ /** The trashed root's public resourceId. */
5875
+ id: zod.z.string().max(64)
5876
+ });
5877
+ var trashEmptyRequestSchema = zod.z.object({
5878
+ workspace_id: zod.z.string().max(64).optional()
5879
+ });
5880
+ var trashCountResponseSchema = zod.z.object({ purged_count: zod.z.number().int() }).meta({ id: "NoteTrashPurgeResult" });
5806
5881
  var notesCommands = [
5807
5882
  cmd({
5808
5883
  resource: "notes",
@@ -6054,6 +6129,167 @@ var notesCommands = [
6054
6129
  responseKind: "single",
6055
6130
  request: noteRenameRequestSchema,
6056
6131
  response: noteRenameResponseSchema
6132
+ }),
6133
+ cmd({
6134
+ resource: "notes",
6135
+ verb: "note-move",
6136
+ method: "POST",
6137
+ path: "/notes/boxes/:id/notes/move",
6138
+ permission: ["notes", "write"],
6139
+ summary: "Move a note into a folder (or the box root).",
6140
+ tags: ["Notes"],
6141
+ errors: [404, 422],
6142
+ responseKind: "single",
6143
+ request: noteMoveRequestSchema,
6144
+ response: noteSchema
6145
+ }),
6146
+ cmd({
6147
+ resource: "notes",
6148
+ verb: "tree",
6149
+ method: "GET",
6150
+ path: "/notes/boxes/:id/tree",
6151
+ permission: ["notes", "read"],
6152
+ summary: "Get a box's full tree (folders + notes) in one call.",
6153
+ tags: ["Notes"],
6154
+ errors: [404],
6155
+ responseKind: "single",
6156
+ response: noteTreeSchema
6157
+ }),
6158
+ cmd({
6159
+ resource: "notes",
6160
+ verb: "folder-list",
6161
+ method: "GET",
6162
+ path: "/notes/boxes/:id/folders",
6163
+ permission: ["notes", "read"],
6164
+ summary: "List a box's folders.",
6165
+ tags: ["Notes"],
6166
+ errors: [404],
6167
+ responseKind: "list",
6168
+ response: noteFolderSchema,
6169
+ columns: [
6170
+ { header: "Name", field: "name" },
6171
+ { header: "ID", field: "id" }
6172
+ ]
6173
+ }),
6174
+ cmd({
6175
+ resource: "notes",
6176
+ verb: "folder-create",
6177
+ method: "POST",
6178
+ path: "/notes/boxes/:id/folders",
6179
+ permission: ["notes", "write"],
6180
+ summary: "Create a folder in a box (optionally under a parent folder).",
6181
+ tags: ["Notes"],
6182
+ errors: [404, 409, 422],
6183
+ responseKind: "created",
6184
+ request: folderCreateRequestSchema,
6185
+ response: noteFolderSchema
6186
+ }),
6187
+ cmd({
6188
+ resource: "notes",
6189
+ verb: "folder-rename",
6190
+ method: "PATCH",
6191
+ path: "/notes/folders/:folderId",
6192
+ permission: ["notes", "write"],
6193
+ summary: "Rename a folder.",
6194
+ tags: ["Notes"],
6195
+ errors: [404, 409, 422],
6196
+ responseKind: "single",
6197
+ request: folderRenameRequestSchema,
6198
+ response: noteFolderSchema
6199
+ }),
6200
+ cmd({
6201
+ resource: "notes",
6202
+ verb: "folder-move",
6203
+ method: "POST",
6204
+ path: "/notes/folders/:folderId/move",
6205
+ permission: ["notes", "write"],
6206
+ summary: "Move a folder under another folder (or the box root).",
6207
+ tags: ["Notes"],
6208
+ errors: [404, 409, 422],
6209
+ responseKind: "single",
6210
+ request: folderMoveRequestSchema,
6211
+ response: noteFolderSchema
6212
+ }),
6213
+ cmd({
6214
+ resource: "notes",
6215
+ verb: "folder-delete",
6216
+ method: "DELETE",
6217
+ path: "/notes/folders/:folderId",
6218
+ permission: ["notes", "write"],
6219
+ summary: "Delete a folder \u2192 moves it and its contents to the trash.",
6220
+ tags: ["Notes"],
6221
+ errors: [404],
6222
+ responseKind: "deleted",
6223
+ response: deletedEnvelopeSchema
6224
+ }),
6225
+ cmd({
6226
+ resource: "notes",
6227
+ verb: "import",
6228
+ method: "POST",
6229
+ path: "/notes/boxes/:id/import",
6230
+ permission: ["notes", "write"],
6231
+ summary: "Import text files into a box, recreating their folder hierarchy. 413 over quota.",
6232
+ tags: ["Notes"],
6233
+ errors: [404, 413, 422],
6234
+ responseKind: "single",
6235
+ request: noteImportRequestSchema,
6236
+ response: noteImportResultSchema
6237
+ }),
6238
+ cmd({
6239
+ resource: "notes",
6240
+ verb: "trash-list",
6241
+ method: "GET",
6242
+ path: "/notes/trash",
6243
+ permission: ["notes", "read"],
6244
+ summary: "List the trashed notes, folders, and boxes in a workspace.",
6245
+ tags: ["Notes"],
6246
+ responseKind: "list",
6247
+ request: trashListRequestSchema,
6248
+ response: noteTrashEntrySchema,
6249
+ argLocation: "query",
6250
+ columns: [
6251
+ { header: "Kind", field: "kind" },
6252
+ { header: "Name", field: "name" }
6253
+ ]
6254
+ }),
6255
+ cmd({
6256
+ resource: "notes",
6257
+ verb: "restore",
6258
+ method: "POST",
6259
+ path: "/notes/trash/restore",
6260
+ permission: ["notes", "write"],
6261
+ summary: "Restore a trashed note, folder, or box.",
6262
+ tags: ["Notes"],
6263
+ errors: [404],
6264
+ responseKind: "deleted",
6265
+ request: trashActionRequestSchema,
6266
+ response: deletedEnvelopeSchema
6267
+ }),
6268
+ cmd({
6269
+ resource: "notes",
6270
+ verb: "purge",
6271
+ method: "POST",
6272
+ path: "/notes/trash/purge",
6273
+ permission: ["notes", "write"],
6274
+ summary: "Permanently delete a trashed note, folder, or box (irreversible).",
6275
+ tags: ["Notes"],
6276
+ errors: [404, 422],
6277
+ responseKind: "deleted",
6278
+ request: trashActionRequestSchema,
6279
+ response: deletedEnvelopeSchema
6280
+ }),
6281
+ cmd({
6282
+ resource: "notes",
6283
+ verb: "trash-empty",
6284
+ method: "DELETE",
6285
+ path: "/notes/trash",
6286
+ permission: ["notes", "write"],
6287
+ summary: "Permanently delete every trashed item in a workspace (irreversible).",
6288
+ tags: ["Notes"],
6289
+ responseKind: "single",
6290
+ request: trashEmptyRequestSchema,
6291
+ response: trashCountResponseSchema,
6292
+ argLocation: "query"
6057
6293
  })
6058
6294
  ];
6059
6295
  var notesPlaybook = {
@@ -6075,6 +6311,14 @@ var notesPlaybook = {
6075
6311
  " references a note. Search BEFORE writing to avoid duplicates.",
6076
6312
  "- After adding a note worth surfacing, update the Index with `notes",
6077
6313
  " index-write` so the map stays accurate. The Index cannot be deleted.",
6314
+ "- Organize with FOLDERS: `notes folder-create --box <box> --name` (optionally",
6315
+ " `--parent-id`), then `notes note-move --box <box> --title --folder-id` to",
6316
+ " place a note. Folders are organizational only \u2014 titles stay unique per box,",
6317
+ " so `[[wikilinks]]` resolve the same regardless of folder. `notes tree` returns",
6318
+ " the whole folders+notes hierarchy in one call.",
6319
+ "- Deleting a note/folder/box moves it to the TRASH (recoverable). `notes",
6320
+ " trash-list` shows trashed roots; `notes restore --kind --id` brings one back;",
6321
+ " `notes purge --kind --id` deletes it forever. Trash auto-purges after 30 days.",
6078
6322
  "- Writes that would exceed your account's Notes size quota fail with 413 \u2014",
6079
6323
  " prune or consolidate notes."
6080
6324
  ].join("\n")
@@ -26102,6 +26346,336 @@ var commandCatalog = [
26102
26346
  422
26103
26347
  ]
26104
26348
  },
26349
+ {
26350
+ "command": "notes folder-create",
26351
+ "resource": "notes",
26352
+ "verb": "folder-create",
26353
+ "summary": "Create a folder in a box (optionally under a parent folder).",
26354
+ "method": "POST",
26355
+ "path": "/notes/boxes/:id/folders",
26356
+ "pathParams": [
26357
+ "id"
26358
+ ],
26359
+ "argLocation": "body",
26360
+ "responseKind": "created",
26361
+ "permission": [
26362
+ "notes",
26363
+ "write"
26364
+ ],
26365
+ "async": false,
26366
+ "inputSchema": {
26367
+ "type": "object",
26368
+ "properties": {
26369
+ "name": {
26370
+ "type": "string",
26371
+ "minLength": 1,
26372
+ "maxLength": 100
26373
+ },
26374
+ "parent_id": {
26375
+ "anyOf": [
26376
+ {
26377
+ "type": "string",
26378
+ "maxLength": 64
26379
+ },
26380
+ {
26381
+ "type": "null"
26382
+ }
26383
+ ]
26384
+ }
26385
+ },
26386
+ "required": [
26387
+ "name"
26388
+ ]
26389
+ },
26390
+ "outputSchema": {
26391
+ "type": "object",
26392
+ "properties": {
26393
+ "id": {
26394
+ "type": "string"
26395
+ },
26396
+ "parent_id": {
26397
+ "anyOf": [
26398
+ {
26399
+ "type": "string"
26400
+ },
26401
+ {
26402
+ "type": "null"
26403
+ }
26404
+ ]
26405
+ },
26406
+ "name": {
26407
+ "type": "string"
26408
+ },
26409
+ "created_at": {
26410
+ "type": "string"
26411
+ },
26412
+ "updated_at": {
26413
+ "type": "string"
26414
+ }
26415
+ },
26416
+ "required": [
26417
+ "id",
26418
+ "parent_id",
26419
+ "name",
26420
+ "created_at",
26421
+ "updated_at"
26422
+ ],
26423
+ "additionalProperties": false
26424
+ },
26425
+ "errors": [
26426
+ 404,
26427
+ 409,
26428
+ 422
26429
+ ]
26430
+ },
26431
+ {
26432
+ "command": "notes folder-delete",
26433
+ "resource": "notes",
26434
+ "verb": "folder-delete",
26435
+ "summary": "Delete a folder \u2192 moves it and its contents to the trash.",
26436
+ "method": "DELETE",
26437
+ "path": "/notes/folders/:folderId",
26438
+ "pathParams": [
26439
+ "folderId"
26440
+ ],
26441
+ "argLocation": "body",
26442
+ "responseKind": "deleted",
26443
+ "permission": [
26444
+ "notes",
26445
+ "write"
26446
+ ],
26447
+ "async": false,
26448
+ "inputSchema": {
26449
+ "type": "object",
26450
+ "properties": {},
26451
+ "additionalProperties": {}
26452
+ },
26453
+ "outputSchema": {
26454
+ "type": "object",
26455
+ "properties": {
26456
+ "deleted": {
26457
+ "type": "boolean",
26458
+ "const": true
26459
+ },
26460
+ "id": {
26461
+ "type": "string"
26462
+ }
26463
+ },
26464
+ "required": [
26465
+ "deleted",
26466
+ "id"
26467
+ ],
26468
+ "additionalProperties": false
26469
+ },
26470
+ "errors": [
26471
+ 404
26472
+ ]
26473
+ },
26474
+ {
26475
+ "command": "notes folder-list",
26476
+ "resource": "notes",
26477
+ "verb": "folder-list",
26478
+ "summary": "List a box's folders.",
26479
+ "method": "GET",
26480
+ "path": "/notes/boxes/:id/folders",
26481
+ "pathParams": [
26482
+ "id"
26483
+ ],
26484
+ "argLocation": "query",
26485
+ "responseKind": "list",
26486
+ "permission": [
26487
+ "notes",
26488
+ "read"
26489
+ ],
26490
+ "async": false,
26491
+ "inputSchema": {
26492
+ "type": "object",
26493
+ "properties": {}
26494
+ },
26495
+ "outputSchema": {
26496
+ "type": "object",
26497
+ "properties": {
26498
+ "id": {
26499
+ "type": "string"
26500
+ },
26501
+ "parent_id": {
26502
+ "anyOf": [
26503
+ {
26504
+ "type": "string"
26505
+ },
26506
+ {
26507
+ "type": "null"
26508
+ }
26509
+ ]
26510
+ },
26511
+ "name": {
26512
+ "type": "string"
26513
+ },
26514
+ "created_at": {
26515
+ "type": "string"
26516
+ },
26517
+ "updated_at": {
26518
+ "type": "string"
26519
+ }
26520
+ },
26521
+ "required": [
26522
+ "id",
26523
+ "parent_id",
26524
+ "name",
26525
+ "created_at",
26526
+ "updated_at"
26527
+ ],
26528
+ "additionalProperties": false
26529
+ },
26530
+ "errors": [
26531
+ 404
26532
+ ]
26533
+ },
26534
+ {
26535
+ "command": "notes folder-move",
26536
+ "resource": "notes",
26537
+ "verb": "folder-move",
26538
+ "summary": "Move a folder under another folder (or the box root).",
26539
+ "method": "POST",
26540
+ "path": "/notes/folders/:folderId/move",
26541
+ "pathParams": [
26542
+ "folderId"
26543
+ ],
26544
+ "argLocation": "body",
26545
+ "responseKind": "single",
26546
+ "permission": [
26547
+ "notes",
26548
+ "write"
26549
+ ],
26550
+ "async": false,
26551
+ "inputSchema": {
26552
+ "type": "object",
26553
+ "properties": {
26554
+ "parent_id": {
26555
+ "anyOf": [
26556
+ {
26557
+ "type": "string",
26558
+ "maxLength": 64
26559
+ },
26560
+ {
26561
+ "type": "null"
26562
+ }
26563
+ ]
26564
+ }
26565
+ }
26566
+ },
26567
+ "outputSchema": {
26568
+ "type": "object",
26569
+ "properties": {
26570
+ "id": {
26571
+ "type": "string"
26572
+ },
26573
+ "parent_id": {
26574
+ "anyOf": [
26575
+ {
26576
+ "type": "string"
26577
+ },
26578
+ {
26579
+ "type": "null"
26580
+ }
26581
+ ]
26582
+ },
26583
+ "name": {
26584
+ "type": "string"
26585
+ },
26586
+ "created_at": {
26587
+ "type": "string"
26588
+ },
26589
+ "updated_at": {
26590
+ "type": "string"
26591
+ }
26592
+ },
26593
+ "required": [
26594
+ "id",
26595
+ "parent_id",
26596
+ "name",
26597
+ "created_at",
26598
+ "updated_at"
26599
+ ],
26600
+ "additionalProperties": false
26601
+ },
26602
+ "errors": [
26603
+ 404,
26604
+ 409,
26605
+ 422
26606
+ ]
26607
+ },
26608
+ {
26609
+ "command": "notes folder-rename",
26610
+ "resource": "notes",
26611
+ "verb": "folder-rename",
26612
+ "summary": "Rename a folder.",
26613
+ "method": "PATCH",
26614
+ "path": "/notes/folders/:folderId",
26615
+ "pathParams": [
26616
+ "folderId"
26617
+ ],
26618
+ "argLocation": "body",
26619
+ "responseKind": "single",
26620
+ "permission": [
26621
+ "notes",
26622
+ "write"
26623
+ ],
26624
+ "async": false,
26625
+ "inputSchema": {
26626
+ "type": "object",
26627
+ "properties": {
26628
+ "name": {
26629
+ "type": "string",
26630
+ "minLength": 1,
26631
+ "maxLength": 100
26632
+ }
26633
+ },
26634
+ "required": [
26635
+ "name"
26636
+ ]
26637
+ },
26638
+ "outputSchema": {
26639
+ "type": "object",
26640
+ "properties": {
26641
+ "id": {
26642
+ "type": "string"
26643
+ },
26644
+ "parent_id": {
26645
+ "anyOf": [
26646
+ {
26647
+ "type": "string"
26648
+ },
26649
+ {
26650
+ "type": "null"
26651
+ }
26652
+ ]
26653
+ },
26654
+ "name": {
26655
+ "type": "string"
26656
+ },
26657
+ "created_at": {
26658
+ "type": "string"
26659
+ },
26660
+ "updated_at": {
26661
+ "type": "string"
26662
+ }
26663
+ },
26664
+ "required": [
26665
+ "id",
26666
+ "parent_id",
26667
+ "name",
26668
+ "created_at",
26669
+ "updated_at"
26670
+ ],
26671
+ "additionalProperties": false
26672
+ },
26673
+ "errors": [
26674
+ 404,
26675
+ 409,
26676
+ 422
26677
+ ]
26678
+ },
26105
26679
  {
26106
26680
  "command": "notes graph",
26107
26681
  "resource": "notes",
@@ -26179,6 +26753,86 @@ var commandCatalog = [
26179
26753
  404
26180
26754
  ]
26181
26755
  },
26756
+ {
26757
+ "command": "notes import",
26758
+ "resource": "notes",
26759
+ "verb": "import",
26760
+ "summary": "Import text files into a box, recreating their folder hierarchy. 413 over quota.",
26761
+ "method": "POST",
26762
+ "path": "/notes/boxes/:id/import",
26763
+ "pathParams": [
26764
+ "id"
26765
+ ],
26766
+ "argLocation": "body",
26767
+ "responseKind": "single",
26768
+ "permission": [
26769
+ "notes",
26770
+ "write"
26771
+ ],
26772
+ "async": false,
26773
+ "inputSchema": {
26774
+ "type": "object",
26775
+ "properties": {
26776
+ "items": {
26777
+ "minItems": 1,
26778
+ "maxItems": 5e3,
26779
+ "type": "array",
26780
+ "items": {
26781
+ "type": "object",
26782
+ "properties": {
26783
+ "path": {
26784
+ "type": "string",
26785
+ "minLength": 1,
26786
+ "maxLength": 1024
26787
+ },
26788
+ "content": {
26789
+ "type": "string",
26790
+ "maxLength": 262144
26791
+ }
26792
+ },
26793
+ "required": [
26794
+ "path",
26795
+ "content"
26796
+ ]
26797
+ }
26798
+ }
26799
+ },
26800
+ "required": [
26801
+ "items"
26802
+ ]
26803
+ },
26804
+ "outputSchema": {
26805
+ "type": "object",
26806
+ "properties": {
26807
+ "imported_notes": {
26808
+ "type": "integer",
26809
+ "minimum": -9007199254740991,
26810
+ "maximum": 9007199254740991
26811
+ },
26812
+ "created_folders": {
26813
+ "type": "integer",
26814
+ "minimum": -9007199254740991,
26815
+ "maximum": 9007199254740991
26816
+ },
26817
+ "skipped": {
26818
+ "type": "integer",
26819
+ "minimum": -9007199254740991,
26820
+ "maximum": 9007199254740991
26821
+ }
26822
+ },
26823
+ "required": [
26824
+ "imported_notes",
26825
+ "created_folders",
26826
+ "skipped"
26827
+ ],
26828
+ "additionalProperties": false
26829
+ },
26830
+ "errors": [
26831
+ 404,
26832
+ 413,
26833
+ 422
26834
+ ]
26835
+ },
26182
26836
  {
26183
26837
  "command": "notes index-read",
26184
26838
  "resource": "notes",
@@ -26206,6 +26860,16 @@ var commandCatalog = [
26206
26860
  "id": {
26207
26861
  "type": "string"
26208
26862
  },
26863
+ "folder_id": {
26864
+ "anyOf": [
26865
+ {
26866
+ "type": "string"
26867
+ },
26868
+ {
26869
+ "type": "null"
26870
+ }
26871
+ ]
26872
+ },
26209
26873
  "title": {
26210
26874
  "type": "string"
26211
26875
  },
@@ -26229,6 +26893,7 @@ var commandCatalog = [
26229
26893
  },
26230
26894
  "required": [
26231
26895
  "id",
26896
+ "folder_id",
26232
26897
  "title",
26233
26898
  "content",
26234
26899
  "kind",
@@ -26277,6 +26942,16 @@ var commandCatalog = [
26277
26942
  "id": {
26278
26943
  "type": "string"
26279
26944
  },
26945
+ "folder_id": {
26946
+ "anyOf": [
26947
+ {
26948
+ "type": "string"
26949
+ },
26950
+ {
26951
+ "type": "null"
26952
+ }
26953
+ ]
26954
+ },
26280
26955
  "title": {
26281
26956
  "type": "string"
26282
26957
  },
@@ -26300,6 +26975,7 @@ var commandCatalog = [
26300
26975
  },
26301
26976
  "required": [
26302
26977
  "id",
26978
+ "folder_id",
26303
26979
  "title",
26304
26980
  "content",
26305
26981
  "kind",
@@ -26415,6 +27091,16 @@ var commandCatalog = [
26415
27091
  "id": {
26416
27092
  "type": "string"
26417
27093
  },
27094
+ "folder_id": {
27095
+ "anyOf": [
27096
+ {
27097
+ "type": "string"
27098
+ },
27099
+ {
27100
+ "type": "null"
27101
+ }
27102
+ ]
27103
+ },
26418
27104
  "title": {
26419
27105
  "type": "string"
26420
27106
  },
@@ -26438,6 +27124,7 @@ var commandCatalog = [
26438
27124
  },
26439
27125
  "required": [
26440
27126
  "id",
27127
+ "folder_id",
26441
27128
  "title",
26442
27129
  "content",
26443
27130
  "kind",
@@ -26451,6 +27138,101 @@ var commandCatalog = [
26451
27138
  404
26452
27139
  ]
26453
27140
  },
27141
+ {
27142
+ "command": "notes note-move",
27143
+ "resource": "notes",
27144
+ "verb": "note-move",
27145
+ "summary": "Move a note into a folder (or the box root).",
27146
+ "method": "POST",
27147
+ "path": "/notes/boxes/:id/notes/move",
27148
+ "pathParams": [
27149
+ "id"
27150
+ ],
27151
+ "argLocation": "body",
27152
+ "responseKind": "single",
27153
+ "permission": [
27154
+ "notes",
27155
+ "write"
27156
+ ],
27157
+ "async": false,
27158
+ "inputSchema": {
27159
+ "type": "object",
27160
+ "properties": {
27161
+ "title": {
27162
+ "type": "string",
27163
+ "minLength": 1,
27164
+ "maxLength": 200
27165
+ },
27166
+ "folder_id": {
27167
+ "anyOf": [
27168
+ {
27169
+ "type": "string",
27170
+ "maxLength": 64
27171
+ },
27172
+ {
27173
+ "type": "null"
27174
+ }
27175
+ ]
27176
+ }
27177
+ },
27178
+ "required": [
27179
+ "title"
27180
+ ]
27181
+ },
27182
+ "outputSchema": {
27183
+ "type": "object",
27184
+ "properties": {
27185
+ "id": {
27186
+ "type": "string"
27187
+ },
27188
+ "folder_id": {
27189
+ "anyOf": [
27190
+ {
27191
+ "type": "string"
27192
+ },
27193
+ {
27194
+ "type": "null"
27195
+ }
27196
+ ]
27197
+ },
27198
+ "title": {
27199
+ "type": "string"
27200
+ },
27201
+ "content": {
27202
+ "type": "string"
27203
+ },
27204
+ "kind": {
27205
+ "type": "string"
27206
+ },
27207
+ "version": {
27208
+ "type": "integer",
27209
+ "minimum": -9007199254740991,
27210
+ "maximum": 9007199254740991
27211
+ },
27212
+ "created_at": {
27213
+ "type": "string"
27214
+ },
27215
+ "updated_at": {
27216
+ "type": "string"
27217
+ }
27218
+ },
27219
+ "required": [
27220
+ "id",
27221
+ "folder_id",
27222
+ "title",
27223
+ "content",
27224
+ "kind",
27225
+ "version",
27226
+ "created_at",
27227
+ "updated_at"
27228
+ ],
27229
+ "additionalProperties": false
27230
+ },
27231
+ "errors": [
27232
+ 404,
27233
+ 422
27234
+ ]
27235
+ },
26454
27236
  {
26455
27237
  "command": "notes note-rename",
26456
27238
  "resource": "notes",
@@ -26514,6 +27296,16 @@ var commandCatalog = [
26514
27296
  "id": {
26515
27297
  "type": "string"
26516
27298
  },
27299
+ "folder_id": {
27300
+ "anyOf": [
27301
+ {
27302
+ "type": "string"
27303
+ },
27304
+ {
27305
+ "type": "null"
27306
+ }
27307
+ ]
27308
+ },
26517
27309
  "title": {
26518
27310
  "type": "string"
26519
27311
  },
@@ -26537,6 +27329,7 @@ var commandCatalog = [
26537
27329
  },
26538
27330
  "required": [
26539
27331
  "id",
27332
+ "folder_id",
26540
27333
  "title",
26541
27334
  "content",
26542
27335
  "kind",
@@ -26554,6 +27347,64 @@ var commandCatalog = [
26554
27347
  422
26555
27348
  ]
26556
27349
  },
27350
+ {
27351
+ "command": "notes purge",
27352
+ "resource": "notes",
27353
+ "verb": "purge",
27354
+ "summary": "Permanently delete a trashed note, folder, or box (irreversible).",
27355
+ "method": "POST",
27356
+ "path": "/notes/trash/purge",
27357
+ "pathParams": [],
27358
+ "argLocation": "body",
27359
+ "responseKind": "deleted",
27360
+ "permission": [
27361
+ "notes",
27362
+ "write"
27363
+ ],
27364
+ "async": false,
27365
+ "inputSchema": {
27366
+ "type": "object",
27367
+ "properties": {
27368
+ "kind": {
27369
+ "type": "string",
27370
+ "enum": [
27371
+ "note",
27372
+ "folder",
27373
+ "box"
27374
+ ]
27375
+ },
27376
+ "id": {
27377
+ "type": "string",
27378
+ "maxLength": 64
27379
+ }
27380
+ },
27381
+ "required": [
27382
+ "kind",
27383
+ "id"
27384
+ ]
27385
+ },
27386
+ "outputSchema": {
27387
+ "type": "object",
27388
+ "properties": {
27389
+ "deleted": {
27390
+ "type": "boolean",
27391
+ "const": true
27392
+ },
27393
+ "id": {
27394
+ "type": "string"
27395
+ }
27396
+ },
27397
+ "required": [
27398
+ "deleted",
27399
+ "id"
27400
+ ],
27401
+ "additionalProperties": false
27402
+ },
27403
+ "errors": [
27404
+ 404,
27405
+ 422
27406
+ ]
27407
+ },
26557
27408
  {
26558
27409
  "command": "notes read",
26559
27410
  "resource": "notes",
@@ -26590,6 +27441,16 @@ var commandCatalog = [
26590
27441
  "id": {
26591
27442
  "type": "string"
26592
27443
  },
27444
+ "folder_id": {
27445
+ "anyOf": [
27446
+ {
27447
+ "type": "string"
27448
+ },
27449
+ {
27450
+ "type": "null"
27451
+ }
27452
+ ]
27453
+ },
26593
27454
  "title": {
26594
27455
  "type": "string"
26595
27456
  },
@@ -26613,6 +27474,7 @@ var commandCatalog = [
26613
27474
  },
26614
27475
  "required": [
26615
27476
  "id",
27477
+ "folder_id",
26616
27478
  "title",
26617
27479
  "content",
26618
27480
  "kind",
@@ -26626,6 +27488,63 @@ var commandCatalog = [
26626
27488
  404
26627
27489
  ]
26628
27490
  },
27491
+ {
27492
+ "command": "notes restore",
27493
+ "resource": "notes",
27494
+ "verb": "restore",
27495
+ "summary": "Restore a trashed note, folder, or box.",
27496
+ "method": "POST",
27497
+ "path": "/notes/trash/restore",
27498
+ "pathParams": [],
27499
+ "argLocation": "body",
27500
+ "responseKind": "deleted",
27501
+ "permission": [
27502
+ "notes",
27503
+ "write"
27504
+ ],
27505
+ "async": false,
27506
+ "inputSchema": {
27507
+ "type": "object",
27508
+ "properties": {
27509
+ "kind": {
27510
+ "type": "string",
27511
+ "enum": [
27512
+ "note",
27513
+ "folder",
27514
+ "box"
27515
+ ]
27516
+ },
27517
+ "id": {
27518
+ "type": "string",
27519
+ "maxLength": 64
27520
+ }
27521
+ },
27522
+ "required": [
27523
+ "kind",
27524
+ "id"
27525
+ ]
27526
+ },
27527
+ "outputSchema": {
27528
+ "type": "object",
27529
+ "properties": {
27530
+ "deleted": {
27531
+ "type": "boolean",
27532
+ "const": true
27533
+ },
27534
+ "id": {
27535
+ "type": "string"
27536
+ }
27537
+ },
27538
+ "required": [
27539
+ "deleted",
27540
+ "id"
27541
+ ],
27542
+ "additionalProperties": false
27543
+ },
27544
+ "errors": [
27545
+ 404
27546
+ ]
27547
+ },
26629
27548
  {
26630
27549
  "command": "notes search",
26631
27550
  "resource": "notes",
@@ -26899,6 +27818,255 @@ var commandCatalog = [
26899
27818
  422
26900
27819
  ]
26901
27820
  },
27821
+ {
27822
+ "command": "notes trash-empty",
27823
+ "resource": "notes",
27824
+ "verb": "trash-empty",
27825
+ "summary": "Permanently delete every trashed item in a workspace (irreversible).",
27826
+ "method": "DELETE",
27827
+ "path": "/notes/trash",
27828
+ "pathParams": [],
27829
+ "argLocation": "query",
27830
+ "responseKind": "single",
27831
+ "permission": [
27832
+ "notes",
27833
+ "write"
27834
+ ],
27835
+ "async": false,
27836
+ "inputSchema": {
27837
+ "type": "object",
27838
+ "properties": {
27839
+ "workspace_id": {
27840
+ "type": "string",
27841
+ "maxLength": 64
27842
+ }
27843
+ }
27844
+ },
27845
+ "outputSchema": {
27846
+ "type": "object",
27847
+ "properties": {
27848
+ "purged_count": {
27849
+ "type": "integer",
27850
+ "minimum": -9007199254740991,
27851
+ "maximum": 9007199254740991
27852
+ }
27853
+ },
27854
+ "required": [
27855
+ "purged_count"
27856
+ ],
27857
+ "additionalProperties": false
27858
+ }
27859
+ },
27860
+ {
27861
+ "command": "notes trash-list",
27862
+ "resource": "notes",
27863
+ "verb": "trash-list",
27864
+ "summary": "List the trashed notes, folders, and boxes in a workspace.",
27865
+ "method": "GET",
27866
+ "path": "/notes/trash",
27867
+ "pathParams": [],
27868
+ "argLocation": "query",
27869
+ "responseKind": "list",
27870
+ "permission": [
27871
+ "notes",
27872
+ "read"
27873
+ ],
27874
+ "async": false,
27875
+ "inputSchema": {
27876
+ "type": "object",
27877
+ "properties": {
27878
+ "workspace_id": {
27879
+ "type": "string",
27880
+ "maxLength": 64
27881
+ }
27882
+ }
27883
+ },
27884
+ "outputSchema": {
27885
+ "type": "object",
27886
+ "properties": {
27887
+ "kind": {
27888
+ "type": "string"
27889
+ },
27890
+ "id": {
27891
+ "type": "string"
27892
+ },
27893
+ "note_box_id": {
27894
+ "anyOf": [
27895
+ {
27896
+ "type": "string"
27897
+ },
27898
+ {
27899
+ "type": "null"
27900
+ }
27901
+ ]
27902
+ },
27903
+ "name": {
27904
+ "type": "string"
27905
+ },
27906
+ "path": {
27907
+ "anyOf": [
27908
+ {
27909
+ "type": "string"
27910
+ },
27911
+ {
27912
+ "type": "null"
27913
+ }
27914
+ ]
27915
+ },
27916
+ "child_count": {
27917
+ "type": "integer",
27918
+ "minimum": -9007199254740991,
27919
+ "maximum": 9007199254740991
27920
+ },
27921
+ "trashed_at": {
27922
+ "type": "string"
27923
+ }
27924
+ },
27925
+ "required": [
27926
+ "kind",
27927
+ "id",
27928
+ "note_box_id",
27929
+ "name",
27930
+ "path",
27931
+ "child_count",
27932
+ "trashed_at"
27933
+ ],
27934
+ "additionalProperties": false
27935
+ }
27936
+ },
27937
+ {
27938
+ "command": "notes tree",
27939
+ "resource": "notes",
27940
+ "verb": "tree",
27941
+ "summary": "Get a box's full tree (folders + notes) in one call.",
27942
+ "method": "GET",
27943
+ "path": "/notes/boxes/:id/tree",
27944
+ "pathParams": [
27945
+ "id"
27946
+ ],
27947
+ "argLocation": "query",
27948
+ "responseKind": "single",
27949
+ "permission": [
27950
+ "notes",
27951
+ "read"
27952
+ ],
27953
+ "async": false,
27954
+ "inputSchema": {
27955
+ "type": "object",
27956
+ "properties": {}
27957
+ },
27958
+ "outputSchema": {
27959
+ "type": "object",
27960
+ "properties": {
27961
+ "folders": {
27962
+ "type": "array",
27963
+ "items": {
27964
+ "$ref": "#/$defs/NoteFolder"
27965
+ }
27966
+ },
27967
+ "notes": {
27968
+ "type": "array",
27969
+ "items": {
27970
+ "$ref": "#/$defs/Note"
27971
+ }
27972
+ }
27973
+ },
27974
+ "required": [
27975
+ "folders",
27976
+ "notes"
27977
+ ],
27978
+ "additionalProperties": false,
27979
+ "$defs": {
27980
+ "NoteFolder": {
27981
+ "type": "object",
27982
+ "properties": {
27983
+ "id": {
27984
+ "type": "string"
27985
+ },
27986
+ "parent_id": {
27987
+ "anyOf": [
27988
+ {
27989
+ "type": "string"
27990
+ },
27991
+ {
27992
+ "type": "null"
27993
+ }
27994
+ ]
27995
+ },
27996
+ "name": {
27997
+ "type": "string"
27998
+ },
27999
+ "created_at": {
28000
+ "type": "string"
28001
+ },
28002
+ "updated_at": {
28003
+ "type": "string"
28004
+ }
28005
+ },
28006
+ "required": [
28007
+ "id",
28008
+ "parent_id",
28009
+ "name",
28010
+ "created_at",
28011
+ "updated_at"
28012
+ ],
28013
+ "additionalProperties": false
28014
+ },
28015
+ "Note": {
28016
+ "type": "object",
28017
+ "properties": {
28018
+ "id": {
28019
+ "type": "string"
28020
+ },
28021
+ "folder_id": {
28022
+ "anyOf": [
28023
+ {
28024
+ "type": "string"
28025
+ },
28026
+ {
28027
+ "type": "null"
28028
+ }
28029
+ ]
28030
+ },
28031
+ "title": {
28032
+ "type": "string"
28033
+ },
28034
+ "content": {
28035
+ "type": "string"
28036
+ },
28037
+ "kind": {
28038
+ "type": "string"
28039
+ },
28040
+ "version": {
28041
+ "type": "integer",
28042
+ "minimum": -9007199254740991,
28043
+ "maximum": 9007199254740991
28044
+ },
28045
+ "created_at": {
28046
+ "type": "string"
28047
+ },
28048
+ "updated_at": {
28049
+ "type": "string"
28050
+ }
28051
+ },
28052
+ "required": [
28053
+ "id",
28054
+ "folder_id",
28055
+ "title",
28056
+ "content",
28057
+ "kind",
28058
+ "version",
28059
+ "created_at",
28060
+ "updated_at"
28061
+ ],
28062
+ "additionalProperties": false
28063
+ }
28064
+ }
28065
+ },
28066
+ "errors": [
28067
+ 404
28068
+ ]
28069
+ },
26902
28070
  {
26903
28071
  "command": "notes write",
26904
28072
  "resource": "notes",
@@ -26945,6 +28113,16 @@ var commandCatalog = [
26945
28113
  "id": {
26946
28114
  "type": "string"
26947
28115
  },
28116
+ "folder_id": {
28117
+ "anyOf": [
28118
+ {
28119
+ "type": "string"
28120
+ },
28121
+ {
28122
+ "type": "null"
28123
+ }
28124
+ ]
28125
+ },
26948
28126
  "title": {
26949
28127
  "type": "string"
26950
28128
  },
@@ -26968,6 +28146,7 @@ var commandCatalog = [
26968
28146
  },
26969
28147
  "required": [
26970
28148
  "id",
28149
+ "folder_id",
26971
28150
  "title",
26972
28151
  "content",
26973
28152
  "kind",
@@ -45454,6 +46633,11 @@ function mapArgsToV1(path, pathParams, args) {
45454
46633
  delete out.content;
45455
46634
  delete out.path;
45456
46635
  }
46636
+ if (path === "drive create-folder" && out.name === void 0 && typeof out.path === "string") {
46637
+ const target = out.path;
46638
+ out.name = target.split("/").pop() || target;
46639
+ delete out.path;
46640
+ }
45457
46641
  const resolvedParent = out.resolved_parent_id;
45458
46642
  for (const [from, to] of Object.entries(RESOLVED_FIELD_TO_V1)) {
45459
46643
  const val = out[from];
@@ -45491,6 +46675,13 @@ function mapArgsToV1(path, pathParams, args) {
45491
46675
  }
45492
46676
 
45493
46677
  // src/execute.ts
46678
+ function requestDeclaresWorkspaceId(request) {
46679
+ const shape = request?.shape;
46680
+ return !!shape && Object.hasOwn(shape, "workspace_id");
46681
+ }
46682
+ function hasWorkspaceArg(args) {
46683
+ return args.workspace_id !== void 0 || args.workspace !== void 0;
46684
+ }
45494
46685
  var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
45495
46686
  function isOperationHandle(data) {
45496
46687
  return typeof data === "object" && data !== null && typeof data.id === "string" && typeof data.status === "string";
@@ -45587,10 +46778,11 @@ async function execute(cmd2, opts) {
45587
46778
  rendered: renderInstructions(spec.resource)
45588
46779
  };
45589
46780
  }
46781
+ const mergedArgs = opts.defaultWorkspaceRef && !hasWorkspaceArg(mappedArgs) && requestDeclaresWorkspaceId(spec.request) ? { ...mappedArgs, workspace_id: opts.defaultWorkspaceRef } : mappedArgs;
45590
46782
  return runSpec(
45591
46783
  spec,
45592
46784
  positionals,
45593
- mappedArgs,
46785
+ mergedArgs,
45594
46786
  opts,
45595
46787
  mode,
45596
46788
  opts.background ?? inv.background