@arke-institute/sdk 2.1.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.
package/openapi/spec.json CHANGED
@@ -47,6 +47,10 @@
47
47
  {
48
48
  "name": "Agents",
49
49
  "description": "Agent management and invocation"
50
+ },
51
+ {
52
+ "name": "Events",
53
+ "description": "Entity change event stream"
50
54
  }
51
55
  ],
52
56
  "components": {
@@ -373,21 +377,35 @@
373
377
  "description": "Optional note describing this change",
374
378
  "example": "Added Chapter 42: The Whiteness of the Whale"
375
379
  },
376
- "label": {
377
- "type": "string",
378
- "minLength": 1,
379
- "description": "Updated display name",
380
- "example": "Captain Ahab"
381
- },
382
380
  "properties": {
383
381
  "type": "object",
384
382
  "additionalProperties": {
385
383
  "nullable": true
386
384
  },
387
- "description": "Properties to merge with existing (partial update)",
388
- "example": {
389
- "bio": "Commander of the Pequod, hunter of the white whale"
390
- }
385
+ "description": "Properties to add or update (deep merged)"
386
+ },
387
+ "properties_remove": {
388
+ "anyOf": [
389
+ {
390
+ "type": "array",
391
+ "items": {
392
+ "type": "string"
393
+ },
394
+ "description": "Top-level property keys to remove",
395
+ "example": [
396
+ "deprecated_field",
397
+ "old_field"
398
+ ]
399
+ },
400
+ {
401
+ "type": "object",
402
+ "additionalProperties": {
403
+ "nullable": true
404
+ },
405
+ "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
406
+ }
407
+ ],
408
+ "description": "Properties to remove"
391
409
  },
392
410
  "relationships_add": {
393
411
  "type": "array",
@@ -450,7 +468,7 @@
450
468
  ],
451
469
  "description": "Relationship to add or update (upsert semantics)"
452
470
  },
453
- "description": "Relationships to add or update"
471
+ "description": "Relationships to add or update (upsert semantics)"
454
472
  },
455
473
  "relationships_remove": {
456
474
  "type": "array",
@@ -475,6 +493,12 @@
475
493
  "description": "Relationship to remove"
476
494
  },
477
495
  "description": "Relationships to remove"
496
+ },
497
+ "label": {
498
+ "type": "string",
499
+ "minLength": 1,
500
+ "description": "Updated display name",
501
+ "example": "Captain Ahab"
478
502
  }
479
503
  },
480
504
  "required": [
@@ -749,28 +773,35 @@
749
773
  "description": "Optional note describing this change",
750
774
  "example": "Added Chapter 42: The Whiteness of the Whale"
751
775
  },
752
- "label": {
753
- "type": "string",
754
- "minLength": 1,
755
- "maxLength": 200,
756
- "description": "Updated collection display name"
757
- },
758
- "description": {
759
- "type": "string",
760
- "maxLength": 2000,
761
- "description": "Updated collection description"
762
- },
763
- "display_image_url": {
764
- "type": "string",
765
- "format": "uri",
766
- "description": "Updated display image URL"
767
- },
768
776
  "properties": {
769
777
  "type": "object",
770
778
  "additionalProperties": {
771
779
  "nullable": true
772
780
  },
773
- "description": "Additional properties to merge"
781
+ "description": "Properties to add or update (deep merged)"
782
+ },
783
+ "properties_remove": {
784
+ "anyOf": [
785
+ {
786
+ "type": "array",
787
+ "items": {
788
+ "type": "string"
789
+ },
790
+ "description": "Top-level property keys to remove",
791
+ "example": [
792
+ "deprecated_field",
793
+ "old_field"
794
+ ]
795
+ },
796
+ {
797
+ "type": "object",
798
+ "additionalProperties": {
799
+ "nullable": true
800
+ },
801
+ "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
802
+ }
803
+ ],
804
+ "description": "Properties to remove"
774
805
  },
775
806
  "relationships_add": {
776
807
  "type": "array",
@@ -833,7 +864,7 @@
833
864
  ],
834
865
  "description": "Relationship to add or update (upsert semantics)"
835
866
  },
836
- "description": "Relationships to add or update"
867
+ "description": "Relationships to add or update (upsert semantics)"
837
868
  },
838
869
  "relationships_remove": {
839
870
  "type": "array",
@@ -858,6 +889,22 @@
858
889
  "description": "Relationship to remove"
859
890
  },
860
891
  "description": "Relationships to remove"
892
+ },
893
+ "label": {
894
+ "type": "string",
895
+ "minLength": 1,
896
+ "maxLength": 200,
897
+ "description": "Updated collection display name"
898
+ },
899
+ "description": {
900
+ "type": "string",
901
+ "maxLength": 2000,
902
+ "description": "Updated collection description"
903
+ },
904
+ "display_image_url": {
905
+ "type": "string",
906
+ "format": "uri",
907
+ "description": "Updated display image URL"
861
908
  }
862
909
  },
863
910
  "required": [
@@ -1509,13 +1556,7 @@
1509
1556
  "additionalProperties": {
1510
1557
  "nullable": true
1511
1558
  },
1512
- "description": "Properties to add or update (deep merged with existing)",
1513
- "example": {
1514
- "label": "Chapter 1: Loomings (Revised)",
1515
- "metadata": {
1516
- "status": "reviewed"
1517
- }
1518
- }
1559
+ "description": "Properties to add or update (deep merged)"
1519
1560
  },
1520
1561
  "properties_remove": {
1521
1562
  "anyOf": [
@@ -1538,10 +1579,7 @@
1538
1579
  "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
1539
1580
  }
1540
1581
  ],
1541
- "description": "Properties to remove (string array or nested object)",
1542
- "example": [
1543
- "deprecated_field"
1544
- ]
1582
+ "description": "Properties to remove"
1545
1583
  },
1546
1584
  "relationships_add": {
1547
1585
  "type": "array",
@@ -1629,26 +1667,6 @@
1629
1667
  "description": "Relationship to remove"
1630
1668
  },
1631
1669
  "description": "Relationships to remove"
1632
- },
1633
- "components": {
1634
- "type": "object",
1635
- "additionalProperties": {
1636
- "type": "string"
1637
- },
1638
- "description": "Components to add or update (key → CID)",
1639
- "example": {
1640
- "transcript.txt": "bafyrei..."
1641
- }
1642
- },
1643
- "components_remove": {
1644
- "type": "array",
1645
- "items": {
1646
- "type": "string"
1647
- },
1648
- "description": "Component keys to remove",
1649
- "example": [
1650
- "old_version.txt"
1651
- ]
1652
1670
  }
1653
1671
  },
1654
1672
  "required": [
@@ -2131,46 +2149,35 @@
2131
2149
  "description": "Optional note describing this change",
2132
2150
  "example": "Added Chapter 42: The Whiteness of the Whale"
2133
2151
  },
2134
- "key": {
2135
- "type": "string",
2136
- "minLength": 1,
2137
- "description": "New storage key. Must already exist in S3 (for regression to old version)."
2138
- },
2139
- "filename": {
2140
- "type": "string",
2141
- "minLength": 1,
2142
- "description": "New filename"
2143
- },
2144
- "content_type": {
2145
- "type": "string",
2146
- "minLength": 1,
2147
- "description": "New MIME type"
2148
- },
2149
- "size": {
2150
- "type": "integer",
2151
- "minimum": 0,
2152
- "description": "New file size in bytes"
2153
- },
2154
- "cid": {
2155
- "type": "string",
2156
- "description": "New content identifier"
2157
- },
2158
- "description": {
2159
- "type": "string",
2160
- "description": "New description"
2161
- },
2162
2152
  "properties": {
2163
2153
  "type": "object",
2164
2154
  "additionalProperties": {
2165
2155
  "nullable": true
2166
2156
  },
2167
- "description": "Additional properties to merge into the file metadata",
2168
- "example": {
2169
- "log_data": {
2170
- "status": "done",
2171
- "entries": []
2157
+ "description": "Properties to add or update (deep merged)"
2158
+ },
2159
+ "properties_remove": {
2160
+ "anyOf": [
2161
+ {
2162
+ "type": "array",
2163
+ "items": {
2164
+ "type": "string"
2165
+ },
2166
+ "description": "Top-level property keys to remove",
2167
+ "example": [
2168
+ "deprecated_field",
2169
+ "old_field"
2170
+ ]
2171
+ },
2172
+ {
2173
+ "type": "object",
2174
+ "additionalProperties": {
2175
+ "nullable": true
2176
+ },
2177
+ "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
2172
2178
  }
2173
- }
2179
+ ],
2180
+ "description": "Properties to remove"
2174
2181
  },
2175
2182
  "relationships_add": {
2176
2183
  "type": "array",
@@ -2233,7 +2240,7 @@
2233
2240
  ],
2234
2241
  "description": "Relationship to add or update (upsert semantics)"
2235
2242
  },
2236
- "description": "Relationships to add or update"
2243
+ "description": "Relationships to add or update (upsert semantics)"
2237
2244
  },
2238
2245
  "relationships_remove": {
2239
2246
  "type": "array",
@@ -2258,6 +2265,34 @@
2258
2265
  "description": "Relationship to remove"
2259
2266
  },
2260
2267
  "description": "Relationships to remove"
2268
+ },
2269
+ "key": {
2270
+ "type": "string",
2271
+ "minLength": 1,
2272
+ "description": "New storage key. Must already exist in S3 (for regression to old version)."
2273
+ },
2274
+ "filename": {
2275
+ "type": "string",
2276
+ "minLength": 1,
2277
+ "description": "New filename"
2278
+ },
2279
+ "content_type": {
2280
+ "type": "string",
2281
+ "minLength": 1,
2282
+ "description": "New MIME type"
2283
+ },
2284
+ "size": {
2285
+ "type": "integer",
2286
+ "minimum": 0,
2287
+ "description": "New file size in bytes"
2288
+ },
2289
+ "cid": {
2290
+ "type": "string",
2291
+ "description": "New content identifier"
2292
+ },
2293
+ "description": {
2294
+ "type": "string",
2295
+ "description": "New description"
2261
2296
  }
2262
2297
  },
2263
2298
  "required": [
@@ -2344,6 +2379,51 @@
2344
2379
  "size"
2345
2380
  ]
2346
2381
  },
2382
+ "ConfirmUploadResponse": {
2383
+ "allOf": [
2384
+ {
2385
+ "$ref": "#/components/schemas/FileResponse"
2386
+ },
2387
+ {
2388
+ "type": "object",
2389
+ "properties": {
2390
+ "prev_cid": {
2391
+ "type": "string",
2392
+ "minLength": 1,
2393
+ "description": "Previous version CID. Not present if upload was already confirmed.",
2394
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
2395
+ },
2396
+ "already_confirmed": {
2397
+ "type": "boolean",
2398
+ "description": "True if upload was already confirmed. Entity was not modified.",
2399
+ "example": false
2400
+ }
2401
+ },
2402
+ "required": [
2403
+ "already_confirmed"
2404
+ ]
2405
+ }
2406
+ ]
2407
+ },
2408
+ "ConfirmUploadRequest": {
2409
+ "type": "object",
2410
+ "properties": {
2411
+ "expect_tip": {
2412
+ "type": "string",
2413
+ "minLength": 1,
2414
+ "description": "Current tip CID for CAS validation. Request fails with 409 if this does not match.",
2415
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
2416
+ },
2417
+ "note": {
2418
+ "type": "string",
2419
+ "description": "Optional note describing this change",
2420
+ "example": "Added Chapter 42: The Whiteness of the Whale"
2421
+ }
2422
+ },
2423
+ "required": [
2424
+ "expect_tip"
2425
+ ]
2426
+ },
2347
2427
  "CreateFolderResponse": {
2348
2428
  "type": "object",
2349
2429
  "properties": {
@@ -2590,32 +2670,35 @@
2590
2670
  "description": "Optional note describing this change",
2591
2671
  "example": "Added Chapter 42: The Whiteness of the Whale"
2592
2672
  },
2593
- "label": {
2594
- "type": "string",
2595
- "minLength": 1,
2596
- "description": "New display name"
2597
- },
2598
- "description": {
2599
- "type": "string",
2600
- "description": "New description"
2601
- },
2602
- "rich_description": {
2603
- "type": "string",
2604
- "description": "New rich description"
2605
- },
2606
- "metadata": {
2607
- "type": "object",
2608
- "additionalProperties": {
2609
- "nullable": true
2610
- },
2611
- "description": "New metadata (deep merged)"
2612
- },
2613
2673
  "properties": {
2614
2674
  "type": "object",
2615
2675
  "additionalProperties": {
2616
2676
  "nullable": true
2617
2677
  },
2618
- "description": "Additional properties to merge"
2678
+ "description": "Properties to add or update (deep merged)"
2679
+ },
2680
+ "properties_remove": {
2681
+ "anyOf": [
2682
+ {
2683
+ "type": "array",
2684
+ "items": {
2685
+ "type": "string"
2686
+ },
2687
+ "description": "Top-level property keys to remove",
2688
+ "example": [
2689
+ "deprecated_field",
2690
+ "old_field"
2691
+ ]
2692
+ },
2693
+ {
2694
+ "type": "object",
2695
+ "additionalProperties": {
2696
+ "nullable": true
2697
+ },
2698
+ "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
2699
+ }
2700
+ ],
2701
+ "description": "Properties to remove"
2619
2702
  },
2620
2703
  "relationships_add": {
2621
2704
  "type": "array",
@@ -2678,7 +2761,7 @@
2678
2761
  ],
2679
2762
  "description": "Relationship to add or update (upsert semantics)"
2680
2763
  },
2681
- "description": "Relationships to add or update"
2764
+ "description": "Relationships to add or update (upsert semantics)"
2682
2765
  },
2683
2766
  "relationships_remove": {
2684
2767
  "type": "array",
@@ -2703,6 +2786,26 @@
2703
2786
  "description": "Relationship to remove"
2704
2787
  },
2705
2788
  "description": "Relationships to remove"
2789
+ },
2790
+ "label": {
2791
+ "type": "string",
2792
+ "minLength": 1,
2793
+ "description": "New display name"
2794
+ },
2795
+ "description": {
2796
+ "type": "string",
2797
+ "description": "New description"
2798
+ },
2799
+ "rich_description": {
2800
+ "type": "string",
2801
+ "description": "New rich description"
2802
+ },
2803
+ "metadata": {
2804
+ "type": "object",
2805
+ "additionalProperties": {
2806
+ "nullable": true
2807
+ },
2808
+ "description": "New metadata (deep merged)"
2706
2809
  }
2707
2810
  },
2708
2811
  "required": [
@@ -2938,7 +3041,8 @@
2938
3041
  ]
2939
3042
  },
2940
3043
  "minItems": 1,
2941
- "description": "Children to add",
3044
+ "maxItems": 50,
3045
+ "description": "Children to add (max 50 per request)",
2942
3046
  "example": [
2943
3047
  {
2944
3048
  "id": "01JFILE123ABCDEFGHJKMNPQRS"
@@ -3277,26 +3381,6 @@
3277
3381
  }
3278
3382
  }
3279
3383
  },
3280
- "components": {
3281
- "type": "object",
3282
- "additionalProperties": {
3283
- "type": "object",
3284
- "properties": {
3285
- "/": {
3286
- "type": "string",
3287
- "minLength": 1
3288
- }
3289
- },
3290
- "required": [
3291
- "/"
3292
- ],
3293
- "description": "IPLD link object",
3294
- "example": {
3295
- "/": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
3296
- }
3297
- },
3298
- "description": "IPLD links to components (files, chunks, etc.)"
3299
- },
3300
3384
  "edited_by": {
3301
3385
  "type": "object",
3302
3386
  "properties": {
@@ -3714,73 +3798,35 @@
3714
3798
  "description": "Optional note describing this change",
3715
3799
  "example": "Added Chapter 42: The Whiteness of the Whale"
3716
3800
  },
3717
- "label": {
3718
- "type": "string",
3719
- "minLength": 1,
3720
- "maxLength": 200,
3721
- "description": "Updated agent display name"
3722
- },
3723
- "description": {
3724
- "type": "string",
3725
- "maxLength": 2000,
3726
- "description": "Updated agent description"
3727
- },
3728
- "endpoint": {
3729
- "type": "string",
3730
- "format": "uri",
3731
- "description": "Updated agent service URL"
3732
- },
3733
- "actions_required": {
3734
- "type": "array",
3735
- "items": {
3736
- "type": "string",
3737
- "pattern": "^[a-z_]+:[a-z_]+$"
3738
- },
3739
- "minItems": 1,
3740
- "description": "Actions this agent requires on target collections",
3741
- "example": [
3742
- "entity:view",
3743
- "entity:update",
3744
- "file:create"
3745
- ]
3746
- },
3747
- "status": {
3748
- "type": "string",
3749
- "enum": [
3750
- "development",
3751
- "active",
3752
- "disabled"
3753
- ],
3754
- "description": "Agent status",
3755
- "example": "development"
3756
- },
3757
- "uses_agents": {
3758
- "type": "array",
3759
- "items": {
3760
- "$ref": "#/components/schemas/SubAgentRef"
3761
- },
3762
- "description": "Updated sub-agents"
3763
- },
3764
- "input_schema": {
3765
- "type": "object",
3766
- "additionalProperties": {
3767
- "nullable": true
3768
- },
3769
- "description": "Updated input schema"
3770
- },
3771
- "output_schema": {
3772
- "type": "object",
3773
- "additionalProperties": {
3774
- "nullable": true
3775
- },
3776
- "description": "Updated output schema"
3777
- },
3778
3801
  "properties": {
3779
3802
  "type": "object",
3780
3803
  "additionalProperties": {
3781
3804
  "nullable": true
3782
3805
  },
3783
- "description": "Additional properties to merge"
3806
+ "description": "Properties to add or update (deep merged)"
3807
+ },
3808
+ "properties_remove": {
3809
+ "anyOf": [
3810
+ {
3811
+ "type": "array",
3812
+ "items": {
3813
+ "type": "string"
3814
+ },
3815
+ "description": "Top-level property keys to remove",
3816
+ "example": [
3817
+ "deprecated_field",
3818
+ "old_field"
3819
+ ]
3820
+ },
3821
+ {
3822
+ "type": "object",
3823
+ "additionalProperties": {
3824
+ "nullable": true
3825
+ },
3826
+ "description": "Nested removal structure (recursive: values can be string[] or nested objects)"
3827
+ }
3828
+ ],
3829
+ "description": "Properties to remove"
3784
3830
  },
3785
3831
  "relationships_add": {
3786
3832
  "type": "array",
@@ -3843,7 +3889,7 @@
3843
3889
  ],
3844
3890
  "description": "Relationship to add or update (upsert semantics)"
3845
3891
  },
3846
- "description": "Relationships to add or update"
3892
+ "description": "Relationships to add or update (upsert semantics)"
3847
3893
  },
3848
3894
  "relationships_remove": {
3849
3895
  "type": "array",
@@ -3867,7 +3913,68 @@
3867
3913
  ],
3868
3914
  "description": "Relationship to remove"
3869
3915
  },
3870
- "description": "Relationships to remove"
3916
+ "description": "Relationships to remove"
3917
+ },
3918
+ "label": {
3919
+ "type": "string",
3920
+ "minLength": 1,
3921
+ "maxLength": 200,
3922
+ "description": "Updated agent display name"
3923
+ },
3924
+ "description": {
3925
+ "type": "string",
3926
+ "maxLength": 2000,
3927
+ "description": "Updated agent description"
3928
+ },
3929
+ "endpoint": {
3930
+ "type": "string",
3931
+ "format": "uri",
3932
+ "description": "Updated agent service URL"
3933
+ },
3934
+ "actions_required": {
3935
+ "type": "array",
3936
+ "items": {
3937
+ "type": "string",
3938
+ "pattern": "^[a-z_]+:[a-z_]+$"
3939
+ },
3940
+ "minItems": 1,
3941
+ "description": "Actions this agent requires on target collections",
3942
+ "example": [
3943
+ "entity:view",
3944
+ "entity:update",
3945
+ "file:create"
3946
+ ]
3947
+ },
3948
+ "status": {
3949
+ "type": "string",
3950
+ "enum": [
3951
+ "development",
3952
+ "active",
3953
+ "disabled"
3954
+ ],
3955
+ "description": "Agent status",
3956
+ "example": "development"
3957
+ },
3958
+ "uses_agents": {
3959
+ "type": "array",
3960
+ "items": {
3961
+ "$ref": "#/components/schemas/SubAgentRef"
3962
+ },
3963
+ "description": "Updated sub-agents"
3964
+ },
3965
+ "input_schema": {
3966
+ "type": "object",
3967
+ "additionalProperties": {
3968
+ "nullable": true
3969
+ },
3970
+ "description": "Updated input schema"
3971
+ },
3972
+ "output_schema": {
3973
+ "type": "object",
3974
+ "additionalProperties": {
3975
+ "nullable": true
3976
+ },
3977
+ "description": "Updated output schema"
3871
3978
  }
3872
3979
  },
3873
3980
  "required": [
@@ -4258,6 +4365,101 @@
4258
4365
  "required": [
4259
4366
  "keys"
4260
4367
  ]
4368
+ },
4369
+ "EventItem": {
4370
+ "type": "object",
4371
+ "properties": {
4372
+ "event_cid": {
4373
+ "type": "string",
4374
+ "minLength": 1,
4375
+ "description": "CID of this event in the event chain",
4376
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
4377
+ },
4378
+ "type": {
4379
+ "type": "string",
4380
+ "enum": [
4381
+ "create",
4382
+ "update"
4383
+ ],
4384
+ "description": "Type of entity change event",
4385
+ "example": "create"
4386
+ },
4387
+ "pi": {
4388
+ "type": "string",
4389
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
4390
+ "description": "Entity ID that was created or updated",
4391
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
4392
+ },
4393
+ "ver": {
4394
+ "type": "integer",
4395
+ "minimum": 0,
4396
+ "exclusiveMinimum": true,
4397
+ "description": "Entity version number",
4398
+ "example": 1
4399
+ },
4400
+ "tip_cid": {
4401
+ "type": "string",
4402
+ "minLength": 1,
4403
+ "description": "CID of the entity manifest at this version",
4404
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
4405
+ },
4406
+ "ts": {
4407
+ "type": "string",
4408
+ "format": "date-time",
4409
+ "description": "When the event was recorded",
4410
+ "example": "2025-12-26T12:00:00.000Z"
4411
+ }
4412
+ },
4413
+ "required": [
4414
+ "event_cid",
4415
+ "type",
4416
+ "pi",
4417
+ "ver",
4418
+ "tip_cid",
4419
+ "ts"
4420
+ ]
4421
+ },
4422
+ "EventsListResponse": {
4423
+ "type": "object",
4424
+ "properties": {
4425
+ "items": {
4426
+ "type": "array",
4427
+ "items": {
4428
+ "$ref": "#/components/schemas/EventItem"
4429
+ },
4430
+ "description": "Events in reverse chronological order"
4431
+ },
4432
+ "total_events": {
4433
+ "type": "integer",
4434
+ "minimum": 0,
4435
+ "description": "Total events in the event chain",
4436
+ "example": 1542
4437
+ },
4438
+ "total_pis": {
4439
+ "type": "integer",
4440
+ "minimum": 0,
4441
+ "description": "Total unique entity IDs across all events",
4442
+ "example": 987
4443
+ },
4444
+ "has_more": {
4445
+ "type": "boolean",
4446
+ "description": "Whether more events exist beyond this page"
4447
+ },
4448
+ "next_cursor": {
4449
+ "type": "string",
4450
+ "nullable": true,
4451
+ "minLength": 1,
4452
+ "description": "CID to use as \"cursor\" parameter for next page",
4453
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
4454
+ }
4455
+ },
4456
+ "required": [
4457
+ "items",
4458
+ "total_events",
4459
+ "total_pis",
4460
+ "has_more",
4461
+ "next_cursor"
4462
+ ]
4261
4463
  }
4262
4464
  },
4263
4465
  "parameters": {}
@@ -6309,7 +6511,7 @@
6309
6511
  "Files"
6310
6512
  ],
6311
6513
  "summary": "Create file entity",
6312
- "description": "Creates a new file entity and returns a presigned upload URL.\n\n## Flow\n1. Call this endpoint with file metadata (key, filename, content_type, size)\n2. Receive entity data + presigned S3 upload URL\n3. PUT the file content to the upload URL\n4. File is now stored and accessible\n\n## Key Best Practice\nUse the file's CID as the key for content-addressable storage.\nThe system does NOT verify the CID - it's just metadata.",
6514
+ "description": "Creates a new file entity and returns a presigned upload URL.\n\n## Flow\n1. Call this endpoint with file metadata (key, filename, content_type, size)\n2. Receive entity data + presigned S3 upload URL (uploaded: false)\n3. PUT the file content to the upload URL\n4. Call POST /{id}/confirm-upload to verify and set uploaded: true\n\n## Key Best Practice\nUse the file's CID as the key for content-addressable storage.\nThe system does NOT verify the CID - it's just metadata.",
6313
6515
  "x-arke-action": "file:create",
6314
6516
  "x-arke-auth": "required",
6315
6517
  "security": [
@@ -6668,7 +6870,7 @@
6668
6870
  "Files"
6669
6871
  ],
6670
6872
  "summary": "Upload new file version",
6671
- "description": "Uploads a new version of a file.\n\n## Flow\n1. Call this endpoint with new key and file metadata\n2. Receive updated entity + presigned upload URL\n3. PUT the new file content to the upload URL\n4. Old file versions remain accessible via manifest history\n\n## Key Requirement\nThe new key must NOT already exist in S3 (no overwrites).\nPrevious file versions are preserved.",
6873
+ "description": "Uploads a new version of a file.\n\n## Flow\n1. Call this endpoint with new key and file metadata\n2. Receive updated entity + presigned upload URL (uploaded: false)\n3. PUT the new file content to the upload URL\n4. Call POST /{id}/confirm-upload to verify and set uploaded: true\n5. Old file versions remain accessible via manifest history\n\n## Key Requirement\nThe new key must NOT already exist in S3 (no overwrites).\nPrevious file versions are preserved.",
6672
6874
  "x-arke-action": "file:reupload",
6673
6875
  "x-arke-auth": "required",
6674
6876
  "security": [
@@ -6793,6 +6995,137 @@
6793
6995
  }
6794
6996
  }
6795
6997
  },
6998
+ "/files/{id}/confirm-upload": {
6999
+ "post": {
7000
+ "tags": [
7001
+ "Files"
7002
+ ],
7003
+ "summary": "Confirm upload completed",
7004
+ "description": "Confirms that file content has been uploaded to S3.\n\n## Flow\n1. Create file entity (POST /files) - sets uploaded: false\n2. PUT file content to the presigned upload URL\n3. Call this endpoint to confirm - verifies file exists in S3, sets uploaded: true\n\n## Verification\nThe server verifies the file exists in S3 before setting uploaded: true.\nIf the file doesn't exist, returns 400 error.\n\n## Idempotency\nIf already uploaded: true, returns success without modification.",
7005
+ "x-arke-action": "file:update",
7006
+ "x-arke-auth": "required",
7007
+ "security": [
7008
+ {
7009
+ "bearerAuth": []
7010
+ }
7011
+ ],
7012
+ "parameters": [
7013
+ {
7014
+ "schema": {
7015
+ "type": "string",
7016
+ "pattern": "^(?:II[0-9A-HJKMNP-TV-Z]{24}|[FC][0-9A-HJKMNP-TV-Z]{25}|[0-9A-HJKMNP-TV-Z]{26})$",
7017
+ "description": "Entity ID (ULID format)",
7018
+ "example": "01KDETYWYWM0MJVKM8DK3AEXPY"
7019
+ },
7020
+ "required": true,
7021
+ "description": "Entity ID (ULID)",
7022
+ "name": "id",
7023
+ "in": "path"
7024
+ }
7025
+ ],
7026
+ "requestBody": {
7027
+ "content": {
7028
+ "application/json": {
7029
+ "schema": {
7030
+ "$ref": "#/components/schemas/ConfirmUploadRequest"
7031
+ }
7032
+ }
7033
+ }
7034
+ },
7035
+ "responses": {
7036
+ "200": {
7037
+ "description": "Upload confirmed",
7038
+ "content": {
7039
+ "application/json": {
7040
+ "schema": {
7041
+ "$ref": "#/components/schemas/ConfirmUploadResponse"
7042
+ }
7043
+ }
7044
+ }
7045
+ },
7046
+ "400": {
7047
+ "description": "Bad Request - Invalid input",
7048
+ "content": {
7049
+ "application/json": {
7050
+ "schema": {
7051
+ "$ref": "#/components/schemas/ValidationErrorResponse"
7052
+ },
7053
+ "example": {
7054
+ "error": "Validation failed",
7055
+ "details": {
7056
+ "issues": [
7057
+ {
7058
+ "path": [
7059
+ "properties",
7060
+ "label"
7061
+ ],
7062
+ "message": "Required"
7063
+ }
7064
+ ]
7065
+ }
7066
+ }
7067
+ }
7068
+ }
7069
+ },
7070
+ "401": {
7071
+ "description": "Unauthorized - Missing or invalid authentication",
7072
+ "content": {
7073
+ "application/json": {
7074
+ "schema": {
7075
+ "$ref": "#/components/schemas/ErrorResponse"
7076
+ },
7077
+ "example": {
7078
+ "error": "Unauthorized: Missing or invalid authentication token"
7079
+ }
7080
+ }
7081
+ }
7082
+ },
7083
+ "403": {
7084
+ "description": "Forbidden - Insufficient permissions",
7085
+ "content": {
7086
+ "application/json": {
7087
+ "schema": {
7088
+ "$ref": "#/components/schemas/ErrorResponse"
7089
+ },
7090
+ "example": {
7091
+ "error": "Forbidden: You do not have permission to perform this action"
7092
+ }
7093
+ }
7094
+ }
7095
+ },
7096
+ "404": {
7097
+ "description": "Not Found - Resource does not exist",
7098
+ "content": {
7099
+ "application/json": {
7100
+ "schema": {
7101
+ "$ref": "#/components/schemas/ErrorResponse"
7102
+ },
7103
+ "example": {
7104
+ "error": "Entity not found"
7105
+ }
7106
+ }
7107
+ }
7108
+ },
7109
+ "409": {
7110
+ "description": "Conflict - CAS validation failed (entity was modified)",
7111
+ "content": {
7112
+ "application/json": {
7113
+ "schema": {
7114
+ "$ref": "#/components/schemas/CASErrorResponse"
7115
+ },
7116
+ "example": {
7117
+ "error": "Conflict: entity was modified",
7118
+ "details": {
7119
+ "expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
7120
+ "actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
7121
+ }
7122
+ }
7123
+ }
7124
+ }
7125
+ }
7126
+ }
7127
+ }
7128
+ },
6796
7129
  "/folders": {
6797
7130
  "post": {
6798
7131
  "tags": [
@@ -7352,7 +7685,7 @@
7352
7685
  "Folders"
7353
7686
  ],
7354
7687
  "summary": "Bulk add children to folder",
7355
- "description": "Efficiently adds multiple children to a folder.\n\n**Strategy**:\n1. Updates folder once with all 'contains' relationships\n2. Updates each child in parallel with 'in' back-link\n\n**Idempotent**: skips children that already have the relationship.\nReturns both added and skipped children in the response.",
7688
+ "description": "Efficiently adds multiple children to a folder.\n\n**Limit**: Maximum 50 children per request. For larger batches, make multiple\nrequests, refetching the folder's CID between each to satisfy the CAS guard.\n\n**Strategy**:\n1. Updates folder once with all 'contains' relationships\n2. Updates each child in parallel with 'in' back-link\n\n**Idempotent**: skips children that already have the relationship.\nReturns both added and skipped children in the response.",
7356
7689
  "x-arke-action": "folder:update",
7357
7690
  "x-arke-auth": "required",
7358
7691
  "security": [
@@ -8643,6 +8976,56 @@
8643
8976
  }
8644
8977
  }
8645
8978
  }
8979
+ },
8980
+ "/events": {
8981
+ "get": {
8982
+ "tags": [
8983
+ "Events"
8984
+ ],
8985
+ "summary": "List events",
8986
+ "description": "Returns entity change events in reverse chronological order (newest first).\n\nEach event represents a create or update operation on an entity. Use cursor-based pagination to walk through the event history.\n\n**Use cases:**\n- Syncing entity changes to external systems\n- Building search indexes\n- Change tracking and audit logs\n\n**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.",
8987
+ "x-arke-action": "events:list",
8988
+ "x-arke-auth": "none",
8989
+ "parameters": [
8990
+ {
8991
+ "schema": {
8992
+ "type": "integer",
8993
+ "minimum": 1,
8994
+ "maximum": 100,
8995
+ "default": 50,
8996
+ "example": 50
8997
+ },
8998
+ "required": false,
8999
+ "description": "Maximum events to return (1-100, default 50)",
9000
+ "name": "limit",
9001
+ "in": "query"
9002
+ },
9003
+ {
9004
+ "schema": {
9005
+ "type": "string",
9006
+ "minLength": 1,
9007
+ "description": "IPFS Content Identifier (CID)",
9008
+ "example": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy"
9009
+ },
9010
+ "required": false,
9011
+ "description": "Event CID to continue from (for pagination)",
9012
+ "name": "cursor",
9013
+ "in": "query"
9014
+ }
9015
+ ],
9016
+ "responses": {
9017
+ "200": {
9018
+ "description": "Event list",
9019
+ "content": {
9020
+ "application/json": {
9021
+ "schema": {
9022
+ "$ref": "#/components/schemas/EventsListResponse"
9023
+ }
9024
+ }
9025
+ }
9026
+ }
9027
+ }
9028
+ }
8646
9029
  }
8647
9030
  }
8648
9031
  }