@arke-institute/sdk 2.0.0 → 2.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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Source: Arke v1 API
8
8
  * Version: 1.0.0
9
- * Generated: 2025-12-29T18:40:11.377Z
9
+ * Generated: 2026-01-01T03:48:16.864Z
10
10
  */
11
11
  type paths = {
12
12
  "/auth/register": {
@@ -1675,7 +1675,7 @@ type paths = {
1675
1675
  };
1676
1676
  /**
1677
1677
  * Update entity
1678
- * @description Updates any entity. Properties and relationships are replaced (not merged). Note: entity:update on a collection requires collection:update permission.
1678
+ * @description Updates any entity with merge semantics. Properties are deep merged, relationships use upsert semantics. Use properties_remove and relationships_remove for deletions. Note: entity:update on a collection requires collection:update permission.
1679
1679
  */
1680
1680
  put: {
1681
1681
  parameters: {
@@ -2069,9 +2069,9 @@ type paths = {
2069
2069
  *
2070
2070
  * ## Flow
2071
2071
  * 1. Call this endpoint with file metadata (key, filename, content_type, size)
2072
- * 2. Receive entity data + presigned S3 upload URL
2072
+ * 2. Receive entity data + presigned S3 upload URL (uploaded: false)
2073
2073
  * 3. PUT the file content to the upload URL
2074
- * 4. File is now stored and accessible
2074
+ * 4. Call POST /{id}/confirm-upload to verify and set uploaded: true
2075
2075
  *
2076
2076
  * ## Key Best Practice
2077
2077
  * Use the file's CID as the key for content-addressable storage.
@@ -2454,9 +2454,10 @@ type paths = {
2454
2454
  *
2455
2455
  * ## Flow
2456
2456
  * 1. Call this endpoint with new key and file metadata
2457
- * 2. Receive updated entity + presigned upload URL
2457
+ * 2. Receive updated entity + presigned upload URL (uploaded: false)
2458
2458
  * 3. PUT the new file content to the upload URL
2459
- * 4. Old file versions remain accessible via manifest history
2459
+ * 4. Call POST /{id}/confirm-upload to verify and set uploaded: true
2460
+ * 5. Old file versions remain accessible via manifest history
2460
2461
  *
2461
2462
  * ## Key Requirement
2462
2463
  * The new key must NOT already exist in S3 (no overwrites).
@@ -2580,6 +2581,149 @@ type paths = {
2580
2581
  patch?: never;
2581
2582
  trace?: never;
2582
2583
  };
2584
+ "/files/{id}/confirm-upload": {
2585
+ parameters: {
2586
+ query?: never;
2587
+ header?: never;
2588
+ path?: never;
2589
+ cookie?: never;
2590
+ };
2591
+ get?: never;
2592
+ put?: never;
2593
+ /**
2594
+ * Confirm upload completed
2595
+ * @description Confirms that file content has been uploaded to S3.
2596
+ *
2597
+ * ## Flow
2598
+ * 1. Create file entity (POST /files) - sets uploaded: false
2599
+ * 2. PUT file content to the presigned upload URL
2600
+ * 3. Call this endpoint to confirm - verifies file exists in S3, sets uploaded: true
2601
+ *
2602
+ * ## Verification
2603
+ * The server verifies the file exists in S3 before setting uploaded: true.
2604
+ * If the file doesn't exist, returns 400 error.
2605
+ *
2606
+ * ## Idempotency
2607
+ * If already uploaded: true, returns success without modification.
2608
+ */
2609
+ post: {
2610
+ parameters: {
2611
+ query?: never;
2612
+ header?: never;
2613
+ path: {
2614
+ /** @description Entity ID (ULID) */
2615
+ id: string;
2616
+ };
2617
+ cookie?: never;
2618
+ };
2619
+ requestBody?: {
2620
+ content: {
2621
+ "application/json": components["schemas"]["ConfirmUploadRequest"];
2622
+ };
2623
+ };
2624
+ responses: {
2625
+ /** @description Upload confirmed */
2626
+ 200: {
2627
+ headers: {
2628
+ [name: string]: unknown;
2629
+ };
2630
+ content: {
2631
+ "application/json": components["schemas"]["ConfirmUploadResponse"];
2632
+ };
2633
+ };
2634
+ /** @description Bad Request - Invalid input */
2635
+ 400: {
2636
+ headers: {
2637
+ [name: string]: unknown;
2638
+ };
2639
+ content: {
2640
+ /**
2641
+ * @example {
2642
+ * "error": "Validation failed",
2643
+ * "details": {
2644
+ * "issues": [
2645
+ * {
2646
+ * "path": [
2647
+ * "properties",
2648
+ * "label"
2649
+ * ],
2650
+ * "message": "Required"
2651
+ * }
2652
+ * ]
2653
+ * }
2654
+ * }
2655
+ */
2656
+ "application/json": components["schemas"]["ValidationErrorResponse"];
2657
+ };
2658
+ };
2659
+ /** @description Unauthorized - Missing or invalid authentication */
2660
+ 401: {
2661
+ headers: {
2662
+ [name: string]: unknown;
2663
+ };
2664
+ content: {
2665
+ /**
2666
+ * @example {
2667
+ * "error": "Unauthorized: Missing or invalid authentication token"
2668
+ * }
2669
+ */
2670
+ "application/json": components["schemas"]["ErrorResponse"];
2671
+ };
2672
+ };
2673
+ /** @description Forbidden - Insufficient permissions */
2674
+ 403: {
2675
+ headers: {
2676
+ [name: string]: unknown;
2677
+ };
2678
+ content: {
2679
+ /**
2680
+ * @example {
2681
+ * "error": "Forbidden: You do not have permission to perform this action"
2682
+ * }
2683
+ */
2684
+ "application/json": components["schemas"]["ErrorResponse"];
2685
+ };
2686
+ };
2687
+ /** @description Not Found - Resource does not exist */
2688
+ 404: {
2689
+ headers: {
2690
+ [name: string]: unknown;
2691
+ };
2692
+ content: {
2693
+ /**
2694
+ * @example {
2695
+ * "error": "Entity not found"
2696
+ * }
2697
+ */
2698
+ "application/json": components["schemas"]["ErrorResponse"];
2699
+ };
2700
+ };
2701
+ /** @description Conflict - CAS validation failed (entity was modified) */
2702
+ 409: {
2703
+ headers: {
2704
+ [name: string]: unknown;
2705
+ };
2706
+ content: {
2707
+ /**
2708
+ * @example {
2709
+ * "error": "Conflict: entity was modified",
2710
+ * "details": {
2711
+ * "expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
2712
+ * "actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
2713
+ * }
2714
+ * }
2715
+ */
2716
+ "application/json": components["schemas"]["CASErrorResponse"];
2717
+ };
2718
+ };
2719
+ };
2720
+ };
2721
+ delete?: never;
2722
+ options?: never;
2723
+ head?: never;
2724
+ patch?: never;
2725
+ trace?: never;
2726
+ };
2583
2727
  "/folders": {
2584
2728
  parameters: {
2585
2729
  query?: never;
@@ -3148,6 +3292,9 @@ type paths = {
3148
3292
  * Bulk add children to folder
3149
3293
  * @description Efficiently adds multiple children to a folder.
3150
3294
  *
3295
+ * **Limit**: Maximum 50 children per request. For larger batches, make multiple
3296
+ * requests, refetching the folder's CID between each to satisfy the CAS guard.
3297
+ *
3151
3298
  * **Strategy**:
3152
3299
  * 1. Updates folder once with all 'contains' relationships
3153
3300
  * 2. Updates each child in parallel with 'in' back-link
@@ -4446,6 +4593,59 @@ type paths = {
4446
4593
  patch?: never;
4447
4594
  trace?: never;
4448
4595
  };
4596
+ "/events": {
4597
+ parameters: {
4598
+ query?: never;
4599
+ header?: never;
4600
+ path?: never;
4601
+ cookie?: never;
4602
+ };
4603
+ /**
4604
+ * List events
4605
+ * @description Returns entity change events in reverse chronological order (newest first).
4606
+ *
4607
+ * Each event represents a create or update operation on an entity. Use cursor-based pagination to walk through the event history.
4608
+ *
4609
+ * **Use cases:**
4610
+ * - Syncing entity changes to external systems
4611
+ * - Building search indexes
4612
+ * - Change tracking and audit logs
4613
+ *
4614
+ * **Note:** This endpoint is public. Access control is enforced at the entity level - if you don't have permission to view an entity, you won't be able to fetch its manifest even if you see an event for it.
4615
+ */
4616
+ get: {
4617
+ parameters: {
4618
+ query?: {
4619
+ /** @description Maximum events to return (1-100, default 50) */
4620
+ limit?: number;
4621
+ /** @description Event CID to continue from (for pagination) */
4622
+ cursor?: string;
4623
+ };
4624
+ header?: never;
4625
+ path?: never;
4626
+ cookie?: never;
4627
+ };
4628
+ requestBody?: never;
4629
+ responses: {
4630
+ /** @description Event list */
4631
+ 200: {
4632
+ headers: {
4633
+ [name: string]: unknown;
4634
+ };
4635
+ content: {
4636
+ "application/json": components["schemas"]["EventsListResponse"];
4637
+ };
4638
+ };
4639
+ };
4640
+ };
4641
+ put?: never;
4642
+ post?: never;
4643
+ delete?: never;
4644
+ options?: never;
4645
+ head?: never;
4646
+ patch?: never;
4647
+ trace?: never;
4648
+ };
4449
4649
  };
4450
4650
  type components = {
4451
4651
  schemas: {
@@ -4586,26 +4786,68 @@ type components = {
4586
4786
  * @example Added Chapter 42: The Whiteness of the Whale
4587
4787
  */
4588
4788
  note?: string;
4589
- /**
4590
- * @description Properties to merge with existing (partial update)
4591
- * @example {
4592
- * "label": "Captain Ahab",
4593
- * "bio": "Commander of the Pequod, hunter of the white whale"
4594
- * }
4595
- */
4789
+ /** @description Properties to add or update (deep merged) */
4596
4790
  properties?: {
4597
4791
  [key: string]: unknown;
4598
4792
  };
4599
- /** @description Relationships to set (replaces existing) */
4600
- relationships?: {
4793
+ /** @description Properties to remove */
4794
+ properties_remove?: string[] | {
4795
+ [key: string]: unknown;
4796
+ };
4797
+ /** @description Relationships to add or update (upsert semantics) */
4798
+ relationships_add?: {
4799
+ /**
4800
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
4801
+ * @example admin
4802
+ */
4601
4803
  predicate: string;
4804
+ /**
4805
+ * @description Target entity ID
4806
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
4807
+ */
4602
4808
  peer: string;
4809
+ /**
4810
+ * @description Target entity type hint
4811
+ * @example user
4812
+ */
4603
4813
  peer_type?: string;
4814
+ /**
4815
+ * @description Target entity label hint
4816
+ * @example Captain Ahab
4817
+ */
4604
4818
  peer_label?: string;
4819
+ /**
4820
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
4821
+ * @example {
4822
+ * "expires_at": "2025-12-31T00:00:00Z"
4823
+ * }
4824
+ */
4605
4825
  properties?: {
4606
4826
  [key: string]: unknown;
4607
4827
  };
4828
+ /** @description Properties to remove from this relationship (string array or nested object) */
4829
+ properties_remove?: string[] | {
4830
+ [key: string]: unknown;
4831
+ };
4832
+ }[];
4833
+ /** @description Relationships to remove */
4834
+ relationships_remove?: {
4835
+ /**
4836
+ * @description Relationship predicate
4837
+ * @example viewer
4838
+ */
4839
+ predicate: string;
4840
+ /**
4841
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
4842
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
4843
+ */
4844
+ peer?: string;
4608
4845
  }[];
4846
+ /**
4847
+ * @description Updated display name
4848
+ * @example Captain Ahab
4849
+ */
4850
+ label?: string;
4609
4851
  };
4610
4852
  CreateApiKeyResponse: {
4611
4853
  /**
@@ -4725,6 +4967,10 @@ type components = {
4725
4967
  roles?: {
4726
4968
  [key: string]: string[];
4727
4969
  };
4970
+ /** @description Additional properties to store */
4971
+ properties?: {
4972
+ [key: string]: unknown;
4973
+ };
4728
4974
  /** @description Initial relationships */
4729
4975
  relationships?: {
4730
4976
  predicate: string;
@@ -4754,6 +5000,63 @@ type components = {
4754
5000
  * @example Added Chapter 42: The Whiteness of the Whale
4755
5001
  */
4756
5002
  note?: string;
5003
+ /** @description Properties to add or update (deep merged) */
5004
+ properties?: {
5005
+ [key: string]: unknown;
5006
+ };
5007
+ /** @description Properties to remove */
5008
+ properties_remove?: string[] | {
5009
+ [key: string]: unknown;
5010
+ };
5011
+ /** @description Relationships to add or update (upsert semantics) */
5012
+ relationships_add?: {
5013
+ /**
5014
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
5015
+ * @example admin
5016
+ */
5017
+ predicate: string;
5018
+ /**
5019
+ * @description Target entity ID
5020
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5021
+ */
5022
+ peer: string;
5023
+ /**
5024
+ * @description Target entity type hint
5025
+ * @example user
5026
+ */
5027
+ peer_type?: string;
5028
+ /**
5029
+ * @description Target entity label hint
5030
+ * @example Captain Ahab
5031
+ */
5032
+ peer_label?: string;
5033
+ /**
5034
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
5035
+ * @example {
5036
+ * "expires_at": "2025-12-31T00:00:00Z"
5037
+ * }
5038
+ */
5039
+ properties?: {
5040
+ [key: string]: unknown;
5041
+ };
5042
+ /** @description Properties to remove from this relationship (string array or nested object) */
5043
+ properties_remove?: string[] | {
5044
+ [key: string]: unknown;
5045
+ };
5046
+ }[];
5047
+ /** @description Relationships to remove */
5048
+ relationships_remove?: {
5049
+ /**
5050
+ * @description Relationship predicate
5051
+ * @example viewer
5052
+ */
5053
+ predicate: string;
5054
+ /**
5055
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
5056
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5057
+ */
5058
+ peer?: string;
5059
+ }[];
4757
5060
  /** @description Updated collection display name */
4758
5061
  label?: string;
4759
5062
  /** @description Updated collection description */
@@ -5086,42 +5389,63 @@ type components = {
5086
5389
  * @example Added Chapter 42: The Whiteness of the Whale
5087
5390
  */
5088
5391
  note?: string;
5089
- /**
5090
- * @description Updated properties (replaces all existing properties)
5091
- * @example {
5092
- * "label": "Chapter 1: Loomings (Revised)",
5093
- * "author": "Herman Melville"
5094
- * }
5095
- */
5392
+ /** @description Properties to add or update (deep merged) */
5096
5393
  properties?: {
5097
5394
  [key: string]: unknown;
5098
5395
  };
5099
- /** @description Updated relationships (replaces all existing relationships) */
5100
- relationships?: {
5396
+ /** @description Properties to remove */
5397
+ properties_remove?: string[] | {
5398
+ [key: string]: unknown;
5399
+ };
5400
+ /** @description Relationships to add or update (upsert semantics) */
5401
+ relationships_add?: {
5402
+ /**
5403
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
5404
+ * @example admin
5405
+ */
5101
5406
  predicate: string;
5407
+ /**
5408
+ * @description Target entity ID
5409
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5410
+ */
5102
5411
  peer: string;
5412
+ /**
5413
+ * @description Target entity type hint
5414
+ * @example user
5415
+ */
5103
5416
  peer_type?: string;
5417
+ /**
5418
+ * @description Target entity label hint
5419
+ * @example Captain Ahab
5420
+ */
5104
5421
  peer_label?: string;
5422
+ /**
5423
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
5424
+ * @example {
5425
+ * "expires_at": "2025-12-31T00:00:00Z"
5426
+ * }
5427
+ */
5105
5428
  properties?: {
5106
5429
  [key: string]: unknown;
5107
5430
  };
5431
+ /** @description Properties to remove from this relationship (string array or nested object) */
5432
+ properties_remove?: string[] | {
5433
+ [key: string]: unknown;
5434
+ };
5435
+ }[];
5436
+ /** @description Relationships to remove */
5437
+ relationships_remove?: {
5438
+ /**
5439
+ * @description Relationship predicate
5440
+ * @example viewer
5441
+ */
5442
+ predicate: string;
5443
+ /**
5444
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
5445
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5446
+ */
5447
+ peer?: string;
5108
5448
  }[];
5109
- /**
5110
- * @description Components to add or update (key → CID)
5111
- * @example {
5112
- * "transcript.txt": "bafyrei..."
5113
- * }
5114
- */
5115
- components?: {
5116
- [key: string]: string;
5117
- };
5118
- /**
5119
- * @description Component keys to remove
5120
- * @example [
5121
- * "old_version.txt"
5122
- * ]
5123
- */
5124
- components_remove?: string[];
5125
5449
  };
5126
5450
  AddRelationshipResponse: {
5127
5451
  source: components["schemas"]["EntityResponse"] & unknown;
@@ -5297,7 +5621,27 @@ type components = {
5297
5621
  */
5298
5622
  description?: string;
5299
5623
  /**
5300
- * @description Collection to add this file to (for permissions)
5624
+ * @description Additional properties to store
5625
+ * @example {
5626
+ * "source": "upload",
5627
+ * "category": "financial"
5628
+ * }
5629
+ */
5630
+ properties?: {
5631
+ [key: string]: unknown;
5632
+ };
5633
+ /** @description Relationships to create */
5634
+ relationships?: {
5635
+ predicate: string;
5636
+ peer: string;
5637
+ peer_type?: string;
5638
+ peer_label?: string;
5639
+ properties?: {
5640
+ [key: string]: unknown;
5641
+ };
5642
+ }[];
5643
+ /**
5644
+ * @description Collection to add this file to (for permissions). Shortcut for adding a collection relationship.
5301
5645
  * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5302
5646
  */
5303
5647
  collection?: string;
@@ -5353,6 +5697,63 @@ type components = {
5353
5697
  * @example Added Chapter 42: The Whiteness of the Whale
5354
5698
  */
5355
5699
  note?: string;
5700
+ /** @description Properties to add or update (deep merged) */
5701
+ properties?: {
5702
+ [key: string]: unknown;
5703
+ };
5704
+ /** @description Properties to remove */
5705
+ properties_remove?: string[] | {
5706
+ [key: string]: unknown;
5707
+ };
5708
+ /** @description Relationships to add or update (upsert semantics) */
5709
+ relationships_add?: {
5710
+ /**
5711
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
5712
+ * @example admin
5713
+ */
5714
+ predicate: string;
5715
+ /**
5716
+ * @description Target entity ID
5717
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5718
+ */
5719
+ peer: string;
5720
+ /**
5721
+ * @description Target entity type hint
5722
+ * @example user
5723
+ */
5724
+ peer_type?: string;
5725
+ /**
5726
+ * @description Target entity label hint
5727
+ * @example Captain Ahab
5728
+ */
5729
+ peer_label?: string;
5730
+ /**
5731
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
5732
+ * @example {
5733
+ * "expires_at": "2025-12-31T00:00:00Z"
5734
+ * }
5735
+ */
5736
+ properties?: {
5737
+ [key: string]: unknown;
5738
+ };
5739
+ /** @description Properties to remove from this relationship (string array or nested object) */
5740
+ properties_remove?: string[] | {
5741
+ [key: string]: unknown;
5742
+ };
5743
+ }[];
5744
+ /** @description Relationships to remove */
5745
+ relationships_remove?: {
5746
+ /**
5747
+ * @description Relationship predicate
5748
+ * @example viewer
5749
+ */
5750
+ predicate: string;
5751
+ /**
5752
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
5753
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5754
+ */
5755
+ peer?: string;
5756
+ }[];
5356
5757
  /** @description New storage key. Must already exist in S3 (for regression to old version). */
5357
5758
  key?: string;
5358
5759
  /** @description New filename */
@@ -5365,18 +5766,6 @@ type components = {
5365
5766
  cid?: string;
5366
5767
  /** @description New description */
5367
5768
  description?: string;
5368
- /**
5369
- * @description Additional properties to merge into the file metadata (e.g., log_data)
5370
- * @example {
5371
- * "log_data": {
5372
- * "status": "done",
5373
- * "entries": []
5374
- * }
5375
- * }
5376
- */
5377
- extra_properties?: {
5378
- [key: string]: unknown;
5379
- };
5380
5769
  };
5381
5770
  ReuploadFileResponse: components["schemas"]["UpdateFileResponse"] & {
5382
5771
  /**
@@ -5424,6 +5813,30 @@ type components = {
5424
5813
  /** @description New description */
5425
5814
  description?: string;
5426
5815
  };
5816
+ ConfirmUploadResponse: components["schemas"]["FileResponse"] & {
5817
+ /**
5818
+ * @description Previous version CID. Not present if upload was already confirmed.
5819
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
5820
+ */
5821
+ prev_cid?: string;
5822
+ /**
5823
+ * @description True if upload was already confirmed. Entity was not modified.
5824
+ * @example false
5825
+ */
5826
+ already_confirmed: boolean;
5827
+ };
5828
+ ConfirmUploadRequest: {
5829
+ /**
5830
+ * @description Current tip CID for CAS validation. Request fails with 409 if this does not match.
5831
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
5832
+ */
5833
+ expect_tip: string;
5834
+ /**
5835
+ * @description Optional note describing this change
5836
+ * @example Added Chapter 42: The Whiteness of the Whale
5837
+ */
5838
+ note?: string;
5839
+ };
5427
5840
  CreateFolderResponse: {
5428
5841
  /**
5429
5842
  * @description Entity ID (ULID format)
@@ -5491,8 +5904,22 @@ type components = {
5491
5904
  metadata?: {
5492
5905
  [key: string]: unknown;
5493
5906
  };
5907
+ /** @description Additional properties to store */
5908
+ properties?: {
5909
+ [key: string]: unknown;
5910
+ };
5911
+ /** @description Relationships to create */
5912
+ relationships?: {
5913
+ predicate: string;
5914
+ peer: string;
5915
+ peer_type?: string;
5916
+ peer_label?: string;
5917
+ properties?: {
5918
+ [key: string]: unknown;
5919
+ };
5920
+ }[];
5494
5921
  /**
5495
- * @description Collection to add folder to (for permissions)
5922
+ * @description Collection to add folder to (for permissions). Shortcut for adding a collection relationship.
5496
5923
  * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5497
5924
  */
5498
5925
  collection?: string;
@@ -5524,13 +5951,70 @@ type components = {
5524
5951
  * @example Added Chapter 42: The Whiteness of the Whale
5525
5952
  */
5526
5953
  note?: string;
5954
+ /** @description Properties to add or update (deep merged) */
5955
+ properties?: {
5956
+ [key: string]: unknown;
5957
+ };
5958
+ /** @description Properties to remove */
5959
+ properties_remove?: string[] | {
5960
+ [key: string]: unknown;
5961
+ };
5962
+ /** @description Relationships to add or update (upsert semantics) */
5963
+ relationships_add?: {
5964
+ /**
5965
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
5966
+ * @example admin
5967
+ */
5968
+ predicate: string;
5969
+ /**
5970
+ * @description Target entity ID
5971
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5972
+ */
5973
+ peer: string;
5974
+ /**
5975
+ * @description Target entity type hint
5976
+ * @example user
5977
+ */
5978
+ peer_type?: string;
5979
+ /**
5980
+ * @description Target entity label hint
5981
+ * @example Captain Ahab
5982
+ */
5983
+ peer_label?: string;
5984
+ /**
5985
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
5986
+ * @example {
5987
+ * "expires_at": "2025-12-31T00:00:00Z"
5988
+ * }
5989
+ */
5990
+ properties?: {
5991
+ [key: string]: unknown;
5992
+ };
5993
+ /** @description Properties to remove from this relationship (string array or nested object) */
5994
+ properties_remove?: string[] | {
5995
+ [key: string]: unknown;
5996
+ };
5997
+ }[];
5998
+ /** @description Relationships to remove */
5999
+ relationships_remove?: {
6000
+ /**
6001
+ * @description Relationship predicate
6002
+ * @example viewer
6003
+ */
6004
+ predicate: string;
6005
+ /**
6006
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
6007
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
6008
+ */
6009
+ peer?: string;
6010
+ }[];
5527
6011
  /** @description New display name */
5528
6012
  label?: string;
5529
6013
  /** @description New description */
5530
6014
  description?: string;
5531
6015
  /** @description New rich description */
5532
6016
  rich_description?: string;
5533
- /** @description New metadata (replaces existing) */
6017
+ /** @description New metadata (deep merged) */
5534
6018
  metadata?: {
5535
6019
  [key: string]: unknown;
5536
6020
  };
@@ -5636,7 +6120,7 @@ type components = {
5636
6120
  */
5637
6121
  note?: string;
5638
6122
  /**
5639
- * @description Children to add
6123
+ * @description Children to add (max 50 per request)
5640
6124
  * @example [
5641
6125
  * {
5642
6126
  * "id": "01JFILE123ABCDEFGHJKMNPQRS"
@@ -5672,7 +6156,7 @@ type components = {
5672
6156
  */
5673
6157
  note?: string;
5674
6158
  /**
5675
- * @description Parent folder ID to add
6159
+ * @description Parent folder or collection ID to add
5676
6160
  * @example 01KDETYWYWM0MJVKM8DK3AEXPY
5677
6161
  */
5678
6162
  parent_id: string;
@@ -5808,12 +6292,6 @@ type components = {
5808
6292
  [key: string]: unknown;
5809
6293
  };
5810
6294
  }[];
5811
- /** @description IPLD links to components (files, chunks, etc.) */
5812
- components?: {
5813
- [key: string]: {
5814
- "/": string;
5815
- };
5816
- };
5817
6295
  /**
5818
6296
  * @description Audit trail for edits
5819
6297
  * @example {
@@ -5952,11 +6430,6 @@ type components = {
5952
6430
  * @example OCR Processor
5953
6431
  */
5954
6432
  label: string;
5955
- /**
5956
- * @description Agent description
5957
- * @example Extracts text from scanned documents using OCR
5958
- */
5959
- description?: string;
5960
6433
  /**
5961
6434
  * Format: uri
5962
6435
  * @description Agent service base URL
@@ -5972,6 +6445,13 @@ type components = {
5972
6445
  * ]
5973
6446
  */
5974
6447
  actions_required: string[];
6448
+ /** @description Collection to place agent in */
6449
+ collection: string;
6450
+ /**
6451
+ * @description Agent description
6452
+ * @example Extracts text from scanned documents using OCR
6453
+ */
6454
+ description?: string;
5975
6455
  /** @description Sub-agents used by this orchestrator */
5976
6456
  uses_agents?: components["schemas"]["SubAgentRef"][];
5977
6457
  /** @description JSON Schema for input validation */
@@ -5982,8 +6462,20 @@ type components = {
5982
6462
  output_schema?: {
5983
6463
  [key: string]: unknown;
5984
6464
  };
5985
- /** @description Collection to place agent in */
5986
- collection: string;
6465
+ /** @description Additional properties to store */
6466
+ properties?: {
6467
+ [key: string]: unknown;
6468
+ };
6469
+ /** @description Relationships to create */
6470
+ relationships?: {
6471
+ predicate: string;
6472
+ peer: string;
6473
+ peer_type?: string;
6474
+ peer_label?: string;
6475
+ properties?: {
6476
+ [key: string]: unknown;
6477
+ };
6478
+ }[];
5987
6479
  };
5988
6480
  AgentUpdateResponse: components["schemas"]["AgentResponse"] & {
5989
6481
  /**
@@ -6003,6 +6495,63 @@ type components = {
6003
6495
  * @example Added Chapter 42: The Whiteness of the Whale
6004
6496
  */
6005
6497
  note?: string;
6498
+ /** @description Properties to add or update (deep merged) */
6499
+ properties?: {
6500
+ [key: string]: unknown;
6501
+ };
6502
+ /** @description Properties to remove */
6503
+ properties_remove?: string[] | {
6504
+ [key: string]: unknown;
6505
+ };
6506
+ /** @description Relationships to add or update (upsert semantics) */
6507
+ relationships_add?: {
6508
+ /**
6509
+ * @description Relationship predicate (e.g., "admin", "contains", "collection")
6510
+ * @example admin
6511
+ */
6512
+ predicate: string;
6513
+ /**
6514
+ * @description Target entity ID
6515
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
6516
+ */
6517
+ peer: string;
6518
+ /**
6519
+ * @description Target entity type hint
6520
+ * @example user
6521
+ */
6522
+ peer_type?: string;
6523
+ /**
6524
+ * @description Target entity label hint
6525
+ * @example Captain Ahab
6526
+ */
6527
+ peer_label?: string;
6528
+ /**
6529
+ * @description Properties to add/update on this relationship (deep merged if relationship exists)
6530
+ * @example {
6531
+ * "expires_at": "2025-12-31T00:00:00Z"
6532
+ * }
6533
+ */
6534
+ properties?: {
6535
+ [key: string]: unknown;
6536
+ };
6537
+ /** @description Properties to remove from this relationship (string array or nested object) */
6538
+ properties_remove?: string[] | {
6539
+ [key: string]: unknown;
6540
+ };
6541
+ }[];
6542
+ /** @description Relationships to remove */
6543
+ relationships_remove?: {
6544
+ /**
6545
+ * @description Relationship predicate
6546
+ * @example viewer
6547
+ */
6548
+ predicate: string;
6549
+ /**
6550
+ * @description Target entity ID. If omitted, removes ALL relationships with this predicate.
6551
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
6552
+ */
6553
+ peer?: string;
6554
+ }[];
6006
6555
  /** @description Updated agent display name */
6007
6556
  label?: string;
6008
6557
  /** @description Updated agent description */
@@ -6021,6 +6570,12 @@ type components = {
6021
6570
  * ]
6022
6571
  */
6023
6572
  actions_required?: string[];
6573
+ /**
6574
+ * @description Agent status
6575
+ * @example development
6576
+ * @enum {string}
6577
+ */
6578
+ status?: "development" | "active" | "disabled";
6024
6579
  /** @description Updated sub-agents */
6025
6580
  uses_agents?: components["schemas"]["SubAgentRef"][];
6026
6581
  /** @description Updated input schema */
@@ -6031,12 +6586,6 @@ type components = {
6031
6586
  output_schema?: {
6032
6587
  [key: string]: unknown;
6033
6588
  };
6034
- /**
6035
- * @description Agent status
6036
- * @example development
6037
- * @enum {string}
6038
- */
6039
- status?: "development" | "active" | "disabled";
6040
6589
  };
6041
6590
  InvokeGrant: {
6042
6591
  agent: {
@@ -6180,6 +6729,61 @@ type components = {
6180
6729
  ListAgentApiKeysResponse: {
6181
6730
  keys: components["schemas"]["AgentApiKeyInfo"][];
6182
6731
  };
6732
+ EventItem: {
6733
+ /**
6734
+ * @description CID of this event in the event chain
6735
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
6736
+ */
6737
+ event_cid: string;
6738
+ /**
6739
+ * @description Type of entity change event
6740
+ * @example create
6741
+ * @enum {string}
6742
+ */
6743
+ type: "create" | "update";
6744
+ /**
6745
+ * @description Entity ID that was created or updated
6746
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
6747
+ */
6748
+ pi: string;
6749
+ /**
6750
+ * @description Entity version number
6751
+ * @example 1
6752
+ */
6753
+ ver: number;
6754
+ /**
6755
+ * @description CID of the entity manifest at this version
6756
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
6757
+ */
6758
+ tip_cid: string;
6759
+ /**
6760
+ * Format: date-time
6761
+ * @description When the event was recorded
6762
+ * @example 2025-12-26T12:00:00.000Z
6763
+ */
6764
+ ts: string;
6765
+ };
6766
+ EventsListResponse: {
6767
+ /** @description Events in reverse chronological order */
6768
+ items: components["schemas"]["EventItem"][];
6769
+ /**
6770
+ * @description Total events in the event chain
6771
+ * @example 1542
6772
+ */
6773
+ total_events: number;
6774
+ /**
6775
+ * @description Total unique entity IDs across all events
6776
+ * @example 987
6777
+ */
6778
+ total_pis: number;
6779
+ /** @description Whether more events exist beyond this page */
6780
+ has_more: boolean;
6781
+ /**
6782
+ * @description CID to use as "cursor" parameter for next page
6783
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
6784
+ */
6785
+ next_cursor: string | null;
6786
+ };
6183
6787
  };
6184
6788
  responses: never;
6185
6789
  parameters: never;