@arke-institute/sdk 2.3.12 → 2.3.14

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,9 +6,66 @@
6
6
  *
7
7
  * Source: Arke v1 API
8
8
  * Version: 1.0.0
9
- * Generated: 2026-01-14T16:34:47.055Z
9
+ * Generated: 2026-01-22T18:25:50.170Z
10
10
  */
11
11
  type paths = {
12
+ "/ops-reference": {
13
+ parameters: {
14
+ query?: never;
15
+ header?: never;
16
+ path?: never;
17
+ cookie?: never;
18
+ };
19
+ /**
20
+ * Get LLM-friendly API reference
21
+ * @description Returns a condensed, plain-text API operations reference optimized for LLM consumption.
22
+ *
23
+ * This endpoint provides the same information as the OpenAPI spec but in a format that:
24
+ * - Uses ~80% fewer tokens than the full OpenAPI JSON
25
+ * - Preserves full endpoint descriptions
26
+ * - Organizes operations by category
27
+ * - Marks required fields with `*` suffix
28
+ * - Includes auth requirements inline
29
+ *
30
+ * **Format example:**
31
+ * ```
32
+ * ## Collections
33
+ * POST /collections [required] - Create a new collection
34
+ * body: {label*:string, description:string}
35
+ *
36
+ * Creates a collection with the authenticated user as owner.
37
+ * ```
38
+ *
39
+ * Use this for injecting API knowledge into LLM system prompts.
40
+ */
41
+ get: {
42
+ parameters: {
43
+ query?: never;
44
+ header?: never;
45
+ path?: never;
46
+ cookie?: never;
47
+ };
48
+ requestBody?: never;
49
+ responses: {
50
+ /** @description Condensed API operations reference */
51
+ 200: {
52
+ headers: {
53
+ [name: string]: unknown;
54
+ };
55
+ content: {
56
+ "text/plain": string;
57
+ };
58
+ };
59
+ };
60
+ };
61
+ put?: never;
62
+ post?: never;
63
+ delete?: never;
64
+ options?: never;
65
+ head?: never;
66
+ patch?: never;
67
+ trace?: never;
68
+ };
12
69
  "/auth/register": {
13
70
  parameters: {
14
71
  query?: never;
@@ -21,6 +78,10 @@ type paths = {
21
78
  /**
22
79
  * Register new user
23
80
  * @description Creates a user entity from JWT claims. Idempotent - returns existing user if already registered.
81
+ *
82
+ * ---
83
+ * **Permission:** `user:create`
84
+ * **Auth:** jwt-only
24
85
  */
25
86
  post: {
26
87
  parameters: {
@@ -95,6 +156,10 @@ type paths = {
95
156
  /**
96
157
  * Get current user
97
158
  * @description Returns the authenticated user's entity.
159
+ *
160
+ * ---
161
+ * **Permission:** `user:view`
162
+ * **Auth:** required
98
163
  */
99
164
  get: {
100
165
  parameters: {
@@ -155,6 +220,10 @@ type paths = {
155
220
  /**
156
221
  * Get user by ID
157
222
  * @description Returns a user entity by ID. May require authentication depending on permissions.
223
+ *
224
+ * ---
225
+ * **Permission:** `user:view`
226
+ * **Auth:** optional
158
227
  */
159
228
  get: {
160
229
  parameters: {
@@ -210,6 +279,10 @@ type paths = {
210
279
  /**
211
280
  * Update user profile
212
281
  * @description Updates a user's profile. Requires user:update permission (typically self-ownership).
282
+ *
283
+ * ---
284
+ * **Permission:** `user:update`
285
+ * **Auth:** required
213
286
  */
214
287
  put: {
215
288
  parameters: {
@@ -340,6 +413,10 @@ type paths = {
340
413
  /**
341
414
  * List API keys
342
415
  * @description Lists all active API keys for the authenticated user. Returns prefixes only, not full keys.
416
+ *
417
+ * ---
418
+ * **Permission:** `user:credentials`
419
+ * **Auth:** required
343
420
  */
344
421
  get: {
345
422
  parameters: {
@@ -379,6 +456,10 @@ type paths = {
379
456
  /**
380
457
  * Create API key
381
458
  * @description Creates a new API key for the authenticated user. The full key is only returned once - store it securely.
459
+ *
460
+ * ---
461
+ * **Permission:** `user:credentials`
462
+ * **Auth:** required
382
463
  */
383
464
  post: {
384
465
  parameters: {
@@ -437,6 +518,10 @@ type paths = {
437
518
  /**
438
519
  * Revoke API key
439
520
  * @description Revokes an API key by prefix. The key will be immediately invalid.
521
+ *
522
+ * ---
523
+ * **Permission:** `user:credentials`
524
+ * **Auth:** required
440
525
  */
441
526
  delete: {
442
527
  parameters: {
@@ -506,6 +591,10 @@ type paths = {
506
591
  * Results include the role predicate so clients know what access the user has to each collection.
507
592
  *
508
593
  * Supports filtering by predicate (role name) and pagination.
594
+ *
595
+ * ---
596
+ * **Permission:** `user:view`
597
+ * **Auth:** optional
509
598
  */
510
599
  get: {
511
600
  parameters: {
@@ -618,6 +707,11 @@ type paths = {
618
707
  * ## Scoring
619
708
  * - Results use cosine similarity scores (0-1)
620
709
  * - Scores are comparable across collections
710
+ *
711
+ *
712
+ * ---
713
+ * **Permission:** `search:execute`
714
+ * **Auth:** required
621
715
  */
622
716
  post: {
623
717
  parameters: {
@@ -707,6 +801,10 @@ type paths = {
707
801
  /**
708
802
  * Create a new collection
709
803
  * @description Creates a collection with the authenticated user as owner.
804
+ *
805
+ * ---
806
+ * **Permission:** `collection:create`
807
+ * **Auth:** required
710
808
  */
711
809
  post: {
712
810
  parameters: {
@@ -801,6 +899,10 @@ type paths = {
801
899
  /**
802
900
  * Get collection by ID
803
901
  * @description Returns a collection entity by ID.
902
+ *
903
+ * ---
904
+ * **Permission:** `collection:view`
905
+ * **Auth:** optional
804
906
  */
805
907
  get: {
806
908
  parameters: {
@@ -856,6 +958,10 @@ type paths = {
856
958
  /**
857
959
  * Update collection properties
858
960
  * @description Updates collection properties. Requires collection:update permission.
961
+ *
962
+ * ---
963
+ * **Permission:** `collection:update`
964
+ * **Auth:** required
859
965
  */
860
966
  put: {
861
967
  parameters: {
@@ -988,6 +1094,10 @@ type paths = {
988
1094
  /**
989
1095
  * Add a new role
990
1096
  * @description Adds a new role to the collection. Requires collection:manage permission.
1097
+ *
1098
+ * ---
1099
+ * **Permission:** `collection:manage`
1100
+ * **Auth:** required
991
1101
  */
992
1102
  post: {
993
1103
  parameters: {
@@ -1100,6 +1210,10 @@ type paths = {
1100
1210
  /**
1101
1211
  * Update role actions
1102
1212
  * @description Updates the actions for an existing role. Requires collection:manage permission.
1213
+ *
1214
+ * ---
1215
+ * **Permission:** `collection:manage`
1216
+ * **Auth:** required
1103
1217
  */
1104
1218
  put: {
1105
1219
  parameters: {
@@ -1201,6 +1315,10 @@ type paths = {
1201
1315
  /**
1202
1316
  * Delete a role
1203
1317
  * @description Deletes a role from the collection. Requires collection:manage permission.
1318
+ *
1319
+ * ---
1320
+ * **Permission:** `collection:manage`
1321
+ * **Auth:** required
1204
1322
  */
1205
1323
  delete: {
1206
1324
  parameters: {
@@ -1284,6 +1402,10 @@ type paths = {
1284
1402
  /**
1285
1403
  * List collection members
1286
1404
  * @description Returns all members of the collection grouped by type. By default, expired memberships are excluded.
1405
+ *
1406
+ * ---
1407
+ * **Permission:** `collection:view`
1408
+ * **Auth:** optional
1287
1409
  */
1288
1410
  get: {
1289
1411
  parameters: {
@@ -1342,6 +1464,10 @@ type paths = {
1342
1464
  /**
1343
1465
  * Assign user to role
1344
1466
  * @description Assigns a user to a role in the collection. Requires collection:manage permission.
1467
+ *
1468
+ * ---
1469
+ * **Permission:** `collection:manage`
1470
+ * **Auth:** required
1345
1471
  */
1346
1472
  post: {
1347
1473
  parameters: {
@@ -1456,6 +1582,10 @@ type paths = {
1456
1582
  /**
1457
1583
  * Remove user from role
1458
1584
  * @description Removes a user from a role in the collection. Requires collection:manage permission.
1585
+ *
1586
+ * ---
1587
+ * **Permission:** `collection:manage`
1588
+ * **Auth:** required
1459
1589
  */
1460
1590
  delete: {
1461
1591
  parameters: {
@@ -1581,6 +1711,10 @@ type paths = {
1581
1711
  * - Collection → Entity (predicate: 'root')
1582
1712
  *
1583
1713
  * Requires collection:update permission on the collection.
1714
+ *
1715
+ * ---
1716
+ * **Permission:** `collection:update`
1717
+ * **Auth:** required
1584
1718
  */
1585
1719
  put: {
1586
1720
  parameters: {
@@ -1713,6 +1847,10 @@ type paths = {
1713
1847
  * @description Returns entities belonging to this collection from the graph database.
1714
1848
  *
1715
1849
  * Supports pagination and optional type filtering. Results are ordered by creation date (newest first).
1850
+ *
1851
+ * ---
1852
+ * **Permission:** `collection:view`
1853
+ * **Auth:** optional
1716
1854
  */
1717
1855
  get: {
1718
1856
  parameters: {
@@ -1796,6 +1934,10 @@ type paths = {
1796
1934
  /**
1797
1935
  * Create a new entity
1798
1936
  * @description Creates a generic entity of any type. For type-specific validation, use type-specific endpoints.
1937
+ *
1938
+ * ---
1939
+ * **Permission:** `entity:create`
1940
+ * **Auth:** required
1799
1941
  */
1800
1942
  post: {
1801
1943
  parameters: {
@@ -1908,6 +2050,10 @@ type paths = {
1908
2050
  /**
1909
2051
  * Get entity by ID
1910
2052
  * @description Returns any entity by ID. Permission check uses parent collection if entity belongs to one.
2053
+ *
2054
+ * ---
2055
+ * **Permission:** `entity:view`
2056
+ * **Auth:** optional
1911
2057
  */
1912
2058
  get: {
1913
2059
  parameters: {
@@ -1962,7 +2108,30 @@ type paths = {
1962
2108
  };
1963
2109
  /**
1964
2110
  * Update entity
1965
- * @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.
2111
+ * @description Updates an entity with merge semantics. **This is the recommended way to manage relationships.**
2112
+ *
2113
+ * - `relationships_add`: Upsert relationships (properties are merged if relationship exists)
2114
+ * - `relationships_remove`: Remove by predicate/peer
2115
+ * - `properties`: Deep merged with existing
2116
+ * - `properties_remove`: Remove nested properties using nested object structure
2117
+ *
2118
+ * **properties_remove syntax:**
2119
+ * - Top-level keys: `["field1", "field2"]`
2120
+ * - Nested keys: `{ parent: { child: ["key_to_remove"] } }`
2121
+ * - **Dot notation is NOT supported** - `["parent.child.key"]` will NOT work
2122
+ *
2123
+ * Example to remove `config.options.debug`:
2124
+ * ```json
2125
+ * { "properties_remove": { "config": { "options": ["debug"] } } }
2126
+ * ```
2127
+ *
2128
+ * Use `/relationships` only for bidirectional links updating two entities atomically.
2129
+ *
2130
+ * Note: entity:update on a collection requires collection:update permission.
2131
+ *
2132
+ * ---
2133
+ * **Permission:** `entity:update`
2134
+ * **Auth:** required
1966
2135
  */
1967
2136
  put: {
1968
2137
  parameters: {
@@ -2080,6 +2249,10 @@ type paths = {
2080
2249
  /**
2081
2250
  * Delete entity
2082
2251
  * @description Soft-deletes an entity by creating a tombstone version. The entity can be restored later via POST /entities/:id/restore. Note: entity:delete on a collection requires collection:delete permission.
2252
+ *
2253
+ * ---
2254
+ * **Permission:** `entity:delete`
2255
+ * **Auth:** required
2083
2256
  */
2084
2257
  delete: {
2085
2258
  parameters: {
@@ -2198,7 +2371,67 @@ type paths = {
2198
2371
  patch?: never;
2199
2372
  trace?: never;
2200
2373
  };
2201
- "/entities/{id}/restore": {
2374
+ "/entities/{id}/tip": {
2375
+ parameters: {
2376
+ query?: never;
2377
+ header?: never;
2378
+ path?: never;
2379
+ cookie?: never;
2380
+ };
2381
+ /**
2382
+ * Get entity tip CID
2383
+ * @description Returns only the current manifest CID (tip) for an entity. Lightweight endpoint for CAS operations - single Durable Object lookup, no manifest fetch, no permission check.
2384
+ *
2385
+ * ---
2386
+ * **Permission:** `entity:tip`
2387
+ * **Auth:** none
2388
+ */
2389
+ get: {
2390
+ parameters: {
2391
+ query?: never;
2392
+ header?: never;
2393
+ path: {
2394
+ /** @description Entity ID (ULID) */
2395
+ id: string;
2396
+ };
2397
+ cookie?: never;
2398
+ };
2399
+ requestBody?: never;
2400
+ responses: {
2401
+ /** @description Tip found */
2402
+ 200: {
2403
+ headers: {
2404
+ [name: string]: unknown;
2405
+ };
2406
+ content: {
2407
+ "application/json": components["schemas"]["TipResponse"];
2408
+ };
2409
+ };
2410
+ /** @description Not Found - Resource does not exist */
2411
+ 404: {
2412
+ headers: {
2413
+ [name: string]: unknown;
2414
+ };
2415
+ content: {
2416
+ /**
2417
+ * @example {
2418
+ * "error": "Entity not found"
2419
+ * }
2420
+ */
2421
+ "application/json": components["schemas"]["ErrorResponse"];
2422
+ };
2423
+ };
2424
+ };
2425
+ };
2426
+ put?: never;
2427
+ post?: never;
2428
+ delete?: never;
2429
+ options?: never;
2430
+ head?: never;
2431
+ patch?: never;
2432
+ trace?: never;
2433
+ };
2434
+ "/entities/{id}/cascade": {
2202
2435
  parameters: {
2203
2436
  query?: never;
2204
2437
  header?: never;
@@ -2207,11 +2440,47 @@ type paths = {
2207
2440
  };
2208
2441
  get?: never;
2209
2442
  put?: never;
2443
+ post?: never;
2210
2444
  /**
2211
- * Restore deleted entity
2212
- * @description Restores a deleted entity by finding the last non-deleted version and creating a new version from it. Note: entity:restore on a collection requires collection:restore permission.
2445
+ * Cascade delete entity and related entities
2446
+ * @description Deletes an entity and all related entities matching predicate patterns within a scoped collection.
2447
+ *
2448
+ * **Permission Model:**
2449
+ * - Requires `entity:delete` permission on the specified `collection_id`
2450
+ * - Single permission check at the start (not per-entity)
2451
+ * - Individual entity type permissions are NOT checked during cascade
2452
+ *
2453
+ * **Cascade Rules:**
2454
+ * - `collection` predicate NEVER cascades (hard rule - protects collection structure)
2455
+ * - Only entities in the specified collection are deleted
2456
+ * - Entities outside the collection are skipped (reported in `skipped` array)
2457
+ *
2458
+ * **Predicate Patterns:**
2459
+ * - `"child"` - exact match only
2460
+ * - `"has_*"` - matches has_document, has_image, etc.
2461
+ * - `"*_copy"` - matches file_copy, document_copy, etc.
2462
+ * - `"*"` - matches ALL predicates (except collection)
2463
+ *
2464
+ * **Traversal:**
2465
+ * - BFS traversal with parallel processing per depth layer
2466
+ * - Max depth: 20 (default: 10)
2467
+ * - Optional `edited_by_filter` to only delete entities created by a specific actor (useful for agent cleanup)
2468
+ *
2469
+ * **CAS Handling:**
2470
+ * - Root entity uses the provided `expect_tip`
2471
+ * - Child entities use re-fetch + single retry strategy
2472
+ * - CAS conflicts are reported as skipped (not failures)
2473
+ *
2474
+ * **Response:**
2475
+ * - Lists all deleted entities with their depth from root
2476
+ * - Lists skipped entities with reasons
2477
+ * - Provides summary statistics
2478
+ *
2479
+ * ---
2480
+ * **Permission:** `entity:delete`
2481
+ * **Auth:** required
2213
2482
  */
2214
- post: {
2483
+ delete: {
2215
2484
  parameters: {
2216
2485
  query?: never;
2217
2486
  header?: never;
@@ -2223,17 +2492,17 @@ type paths = {
2223
2492
  };
2224
2493
  requestBody?: {
2225
2494
  content: {
2226
- "application/json": components["schemas"]["RestoreEntityRequest"];
2495
+ "application/json": components["schemas"]["CascadeDeleteRequest"];
2227
2496
  };
2228
2497
  };
2229
2498
  responses: {
2230
- /** @description Entity restored */
2499
+ /** @description Cascade delete completed */
2231
2500
  200: {
2232
2501
  headers: {
2233
2502
  [name: string]: unknown;
2234
2503
  };
2235
2504
  content: {
2236
- "application/json": components["schemas"]["EntityRestoredResponse"];
2505
+ "application/json": components["schemas"]["CascadeDeleteResponse"];
2237
2506
  };
2238
2507
  };
2239
2508
  /** @description Bad Request - Invalid input */
@@ -2323,24 +2592,29 @@ type paths = {
2323
2592
  };
2324
2593
  };
2325
2594
  };
2326
- delete?: never;
2327
2595
  options?: never;
2328
2596
  head?: never;
2329
2597
  patch?: never;
2330
2598
  trace?: never;
2331
2599
  };
2332
- "/entities/{id}/collection": {
2600
+ "/entities/{id}/restore": {
2333
2601
  parameters: {
2334
2602
  query?: never;
2335
2603
  header?: never;
2336
2604
  path?: never;
2337
2605
  cookie?: never;
2338
2606
  };
2607
+ get?: never;
2608
+ put?: never;
2339
2609
  /**
2340
- * Get entity collection
2341
- * @description Returns the collection ID that this entity belongs to. Returns null if the entity is not in any collection. If the entity IS a collection, returns its own ID.
2610
+ * Restore deleted entity
2611
+ * @description Restores a deleted entity by finding the last non-deleted version and creating a new version from it. Note: entity:restore on a collection requires collection:restore permission.
2612
+ *
2613
+ * ---
2614
+ * **Permission:** `entity:restore`
2615
+ * **Auth:** required
2342
2616
  */
2343
- get: {
2617
+ post: {
2344
2618
  parameters: {
2345
2619
  query?: never;
2346
2620
  header?: never;
@@ -2350,15 +2624,58 @@ type paths = {
2350
2624
  };
2351
2625
  cookie?: never;
2352
2626
  };
2353
- requestBody?: never;
2627
+ requestBody?: {
2628
+ content: {
2629
+ "application/json": components["schemas"]["RestoreEntityRequest"];
2630
+ };
2631
+ };
2354
2632
  responses: {
2355
- /** @description Collection lookup result */
2633
+ /** @description Entity restored */
2356
2634
  200: {
2357
2635
  headers: {
2358
2636
  [name: string]: unknown;
2359
2637
  };
2360
2638
  content: {
2361
- "application/json": components["schemas"]["EntityCollectionResponse"];
2639
+ "application/json": components["schemas"]["EntityRestoredResponse"];
2640
+ };
2641
+ };
2642
+ /** @description Bad Request - Invalid input */
2643
+ 400: {
2644
+ headers: {
2645
+ [name: string]: unknown;
2646
+ };
2647
+ content: {
2648
+ /**
2649
+ * @example {
2650
+ * "error": "Validation failed",
2651
+ * "details": {
2652
+ * "issues": [
2653
+ * {
2654
+ * "path": [
2655
+ * "properties",
2656
+ * "label"
2657
+ * ],
2658
+ * "message": "Required"
2659
+ * }
2660
+ * ]
2661
+ * }
2662
+ * }
2663
+ */
2664
+ "application/json": components["schemas"]["ValidationErrorResponse"];
2665
+ };
2666
+ };
2667
+ /** @description Unauthorized - Missing or invalid authentication */
2668
+ 401: {
2669
+ headers: {
2670
+ [name: string]: unknown;
2671
+ };
2672
+ content: {
2673
+ /**
2674
+ * @example {
2675
+ * "error": "Unauthorized: Missing or invalid authentication token"
2676
+ * }
2677
+ */
2678
+ "application/json": components["schemas"]["ErrorResponse"];
2362
2679
  };
2363
2680
  };
2364
2681
  /** @description Forbidden - Insufficient permissions */
@@ -2389,17 +2706,33 @@ type paths = {
2389
2706
  "application/json": components["schemas"]["ErrorResponse"];
2390
2707
  };
2391
2708
  };
2709
+ /** @description Conflict - CAS validation failed (entity was modified) */
2710
+ 409: {
2711
+ headers: {
2712
+ [name: string]: unknown;
2713
+ };
2714
+ content: {
2715
+ /**
2716
+ * @example {
2717
+ * "error": "Conflict: entity was modified",
2718
+ * "details": {
2719
+ * "expected": "bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy",
2720
+ * "actual": "bafyreinewabc123456789defghijklmnopqrstuvwxyz"
2721
+ * }
2722
+ * }
2723
+ */
2724
+ "application/json": components["schemas"]["CASErrorResponse"];
2725
+ };
2726
+ };
2392
2727
  };
2393
2728
  };
2394
- put?: never;
2395
- post?: never;
2396
2729
  delete?: never;
2397
2730
  options?: never;
2398
2731
  head?: never;
2399
2732
  patch?: never;
2400
2733
  trace?: never;
2401
2734
  };
2402
- "/entities/{id}/tree": {
2735
+ "/entities/{id}/collection": {
2403
2736
  parameters: {
2404
2737
  query?: never;
2405
2738
  header?: never;
@@ -2407,27 +2740,16 @@ type paths = {
2407
2740
  cookie?: never;
2408
2741
  };
2409
2742
  /**
2410
- * Get entity tree
2411
- * @description Returns a hierarchical tree of entities reachable from the source entity.
2412
- *
2413
- * Use this to browse collections and folders without making multiple API calls.
2414
- * The tree follows relationship edges (optionally filtered by predicate) and
2415
- * returns a nested structure suitable for tree UI rendering.
2743
+ * Get entity collection
2744
+ * @description Returns the collection ID that this entity belongs to. Returns null if the entity is not in any collection. If the entity IS a collection, returns its own ID.
2416
2745
  *
2417
- * Query parameters:
2418
- * - `depth`: Max tree depth (1-4, default 2)
2419
- * - `collection`: Constrain to entities in this collection
2420
- * - `predicates`: Comma-separated predicates to follow (e.g., "contains")
2421
- * - `limit`: Max nodes to return (default 100)
2746
+ * ---
2747
+ * **Permission:** `entity:view`
2748
+ * **Auth:** optional
2422
2749
  */
2423
2750
  get: {
2424
2751
  parameters: {
2425
- query?: {
2426
- depth?: number;
2427
- collection?: string;
2428
- predicates?: string;
2429
- limit?: number;
2430
- };
2752
+ query?: never;
2431
2753
  header?: never;
2432
2754
  path: {
2433
2755
  /** @description Entity ID (ULID) */
@@ -2437,13 +2759,13 @@ type paths = {
2437
2759
  };
2438
2760
  requestBody?: never;
2439
2761
  responses: {
2440
- /** @description Tree retrieved */
2762
+ /** @description Collection lookup result */
2441
2763
  200: {
2442
2764
  headers: {
2443
2765
  [name: string]: unknown;
2444
2766
  };
2445
2767
  content: {
2446
- "application/json": components["schemas"]["TreeResponse"];
2768
+ "application/json": components["schemas"]["EntityCollectionResponse"];
2447
2769
  };
2448
2770
  };
2449
2771
  /** @description Forbidden - Insufficient permissions */
@@ -2484,7 +2806,7 @@ type paths = {
2484
2806
  patch?: never;
2485
2807
  trace?: never;
2486
2808
  };
2487
- "/entities/{id}/diff": {
2809
+ "/entities/{id}/tree": {
2488
2810
  parameters: {
2489
2811
  query?: never;
2490
2812
  header?: never;
@@ -2492,8 +2814,97 @@ type paths = {
2492
2814
  cookie?: never;
2493
2815
  };
2494
2816
  /**
2495
- * Get diff between entity versions
2496
- * @description Computes the difference between two versions of an entity.
2817
+ * Get entity tree
2818
+ * @description Returns a hierarchical tree of entities reachable from the source entity.
2819
+ *
2820
+ * Use this to browse collections and folders without making multiple API calls.
2821
+ * The tree follows relationship edges (optionally filtered by predicate) and
2822
+ * returns a nested structure suitable for tree UI rendering.
2823
+ *
2824
+ * Query parameters:
2825
+ * - `depth`: Max tree depth (1-4, default 2)
2826
+ * - `collection`: Constrain to entities in this collection
2827
+ * - `predicates`: Comma-separated predicates to follow (e.g., "contains")
2828
+ * - `limit`: Max nodes to return (default 100)
2829
+ *
2830
+ * ---
2831
+ * **Permission:** `entity:view`
2832
+ * **Auth:** optional
2833
+ */
2834
+ get: {
2835
+ parameters: {
2836
+ query?: {
2837
+ depth?: number;
2838
+ collection?: string;
2839
+ predicates?: string;
2840
+ limit?: number;
2841
+ };
2842
+ header?: never;
2843
+ path: {
2844
+ /** @description Entity ID (ULID) */
2845
+ id: string;
2846
+ };
2847
+ cookie?: never;
2848
+ };
2849
+ requestBody?: never;
2850
+ responses: {
2851
+ /** @description Tree retrieved */
2852
+ 200: {
2853
+ headers: {
2854
+ [name: string]: unknown;
2855
+ };
2856
+ content: {
2857
+ "application/json": components["schemas"]["TreeResponse"];
2858
+ };
2859
+ };
2860
+ /** @description Forbidden - Insufficient permissions */
2861
+ 403: {
2862
+ headers: {
2863
+ [name: string]: unknown;
2864
+ };
2865
+ content: {
2866
+ /**
2867
+ * @example {
2868
+ * "error": "Forbidden: You do not have permission to perform this action"
2869
+ * }
2870
+ */
2871
+ "application/json": components["schemas"]["ErrorResponse"];
2872
+ };
2873
+ };
2874
+ /** @description Not Found - Resource does not exist */
2875
+ 404: {
2876
+ headers: {
2877
+ [name: string]: unknown;
2878
+ };
2879
+ content: {
2880
+ /**
2881
+ * @example {
2882
+ * "error": "Entity not found"
2883
+ * }
2884
+ */
2885
+ "application/json": components["schemas"]["ErrorResponse"];
2886
+ };
2887
+ };
2888
+ };
2889
+ };
2890
+ put?: never;
2891
+ post?: never;
2892
+ delete?: never;
2893
+ options?: never;
2894
+ head?: never;
2895
+ patch?: never;
2896
+ trace?: never;
2897
+ };
2898
+ "/entities/{id}/diff": {
2899
+ parameters: {
2900
+ query?: never;
2901
+ header?: never;
2902
+ path?: never;
2903
+ cookie?: never;
2904
+ };
2905
+ /**
2906
+ * Get diff between entity versions
2907
+ * @description Computes the difference between two versions of an entity.
2497
2908
  *
2498
2909
  * Query parameters:
2499
2910
  * - `from`: CID of the "from" version (defaults to prev of "to" version)
@@ -2507,6 +2918,10 @@ type paths = {
2507
2918
  * - Both: Compare any two versions
2508
2919
  *
2509
2920
  * For version 1 entities (no previous version), "from" is null and all content appears as added.
2921
+ *
2922
+ * ---
2923
+ * **Permission:** `entity:view`
2924
+ * **Auth:** optional
2510
2925
  */
2511
2926
  get: {
2512
2927
  parameters: {
@@ -2623,6 +3038,10 @@ type paths = {
2623
3038
  * - For files: entity:* and file:* actions
2624
3039
  * - For collections: entity:* and collection:* actions
2625
3040
  * - etc.
3041
+ *
3042
+ * ---
3043
+ * **Permission:** `entity:view`
3044
+ * **Auth:** required
2626
3045
  */
2627
3046
  get: {
2628
3047
  parameters: {
@@ -2710,14 +3129,20 @@ type paths = {
2710
3129
  * Add relationship between entities
2711
3130
  * @description Creates a relationship from source to target entity.
2712
3131
  *
2713
- * If `target_predicate` is provided, creates a **bidirectional** relationship:
2714
- * - Adds `source_predicate` relationship on source pointing to target
2715
- * - Adds `target_predicate` relationship on target pointing to source
2716
- * - Requires `entity:update` permission on both entities
3132
+ * **⚠️ For single-entity updates, prefer `PUT /entities/:id` with `relationships_add` - simpler API, one CAS guard, can update properties too.**
2717
3133
  *
2718
- * If `target_predicate` is omitted, creates a **unidirectional** relationship:
2719
- * - Adds `source_predicate` relationship on source pointing to target
2720
- * - Requires `entity:update` permission on source only
3134
+ * Use this endpoint only for **bidirectional** relationships requiring atomic updates to TWO entities.
3135
+ *
3136
+ * If `target_predicate` is provided (bidirectional):
3137
+ * - Updates both source and target entities
3138
+ * - Requires `entity:update` on both, plus two CAS guards
3139
+ *
3140
+ * If `target_predicate` is omitted (unidirectional):
3141
+ * - Use `PUT /entities/:id` instead
3142
+ *
3143
+ * ---
3144
+ * **Permission:** `entity:update`
3145
+ * **Auth:** required
2721
3146
  */
2722
3147
  post: {
2723
3148
  parameters: {
@@ -2832,14 +3257,20 @@ type paths = {
2832
3257
  * Remove relationship between entities
2833
3258
  * @description Removes a relationship from source to target entity.
2834
3259
  *
2835
- * If `target_predicate` is provided, removes a **bidirectional** relationship:
2836
- * - Removes `source_predicate` relationship from source
2837
- * - Removes `target_predicate` relationship from target
2838
- * - Requires `entity:update` permission on both entities
3260
+ * **⚠️ For single-entity updates, prefer `PUT /entities/:id` with `relationships_remove` - simpler API, one CAS guard, can update properties too.**
3261
+ *
3262
+ * Use this endpoint only for **bidirectional** relationships requiring atomic updates to TWO entities.
2839
3263
  *
2840
- * If `target_predicate` is omitted, removes a **unidirectional** relationship:
2841
- * - Removes `source_predicate` relationship from source
2842
- * - Requires `entity:update` permission on source only
3264
+ * If `target_predicate` is provided (bidirectional):
3265
+ * - Updates both source and target entities
3266
+ * - Requires `entity:update` on both, plus two CAS guards
3267
+ *
3268
+ * If `target_predicate` is omitted (unidirectional):
3269
+ * - Use `PUT /entities/:id` instead
3270
+ *
3271
+ * ---
3272
+ * **Permission:** `entity:update`
3273
+ * **Auth:** required
2843
3274
  */
2844
3275
  delete: {
2845
3276
  parameters: {
@@ -2975,6 +3406,10 @@ type paths = {
2975
3406
  *
2976
3407
  * Use this for simple entity linking. For bidirectional relationships or
2977
3408
  * advanced options, use the `/relationships` endpoint.
3409
+ *
3410
+ * ---
3411
+ * **Permission:** `entity:update`
3412
+ * **Auth:** required
2978
3413
  */
2979
3414
  post: {
2980
3415
  parameters: {
@@ -3109,6 +3544,10 @@ type paths = {
3109
3544
  * - Only requires `entity:update` permission on source entity
3110
3545
  *
3111
3546
  * For bidirectional removal, use the `/relationships` endpoint.
3547
+ *
3548
+ * ---
3549
+ * **Permission:** `entity:update`
3550
+ * **Auth:** required
3112
3551
  */
3113
3552
  post: {
3114
3553
  parameters: {
@@ -3247,6 +3686,10 @@ type paths = {
3247
3686
  * ## Key Best Practice
3248
3687
  * Use a unique identifier as the key (e.g., version number, timestamp).
3249
3688
  * The actual CID is computed during upload.
3689
+ *
3690
+ * ---
3691
+ * **Permission:** `file:create`
3692
+ * **Auth:** required
3250
3693
  */
3251
3694
  post: {
3252
3695
  parameters: {
@@ -3359,6 +3802,10 @@ type paths = {
3359
3802
  /**
3360
3803
  * Get file metadata
3361
3804
  * @description Returns file entity metadata. Use /{id}/content to download the file content.
3805
+ *
3806
+ * ---
3807
+ * **Permission:** `file:view`
3808
+ * **Auth:** optional
3362
3809
  */
3363
3810
  get: {
3364
3811
  parameters: {
@@ -3420,6 +3867,10 @@ type paths = {
3420
3867
  * This allows "regressing" to a previous file version.
3421
3868
  *
3422
3869
  * To upload a new file, use POST /{id}/reupload instead.
3870
+ *
3871
+ * ---
3872
+ * **Permission:** `file:update`
3873
+ * **Auth:** required
3423
3874
  */
3424
3875
  put: {
3425
3876
  parameters: {
@@ -3558,6 +4009,10 @@ type paths = {
3558
4009
  *
3559
4010
  * ## Streaming
3560
4011
  * Response is streamed directly from R2 storage.
4012
+ *
4013
+ * ---
4014
+ * **Permission:** `file:download`
4015
+ * **Auth:** optional
3561
4016
  */
3562
4017
  get: {
3563
4018
  parameters: {
@@ -3631,6 +4086,10 @@ type paths = {
3631
4086
  * ## Idempotency
3632
4087
  * Re-uploading content for an already-uploaded file will fail with 409 Conflict.
3633
4088
  * Use POST /{id}/reupload first to create a new version.
4089
+ *
4090
+ * ---
4091
+ * **Permission:** `file:upload`
4092
+ * **Auth:** required
3634
4093
  */
3635
4094
  post: {
3636
4095
  parameters: {
@@ -3791,6 +4250,10 @@ type paths = {
3791
4250
  * ## Key Requirement
3792
4251
  * The new key must NOT already exist in R2 (no overwrites).
3793
4252
  * Previous file versions remain accessible via manifest history.
4253
+ *
4254
+ * ---
4255
+ * **Permission:** `file:reupload`
4256
+ * **Auth:** required
3794
4257
  */
3795
4258
  post: {
3796
4259
  parameters: {
@@ -3926,6 +4389,10 @@ type paths = {
3926
4389
  * If a parent folder is specified, a bidirectional relationship is created:
3927
4390
  * - Parent folder contains this folder
3928
4391
  * - This folder is in parent folder
4392
+ *
4393
+ * ---
4394
+ * **Permission:** `folder:create`
4395
+ * **Auth:** required
3929
4396
  */
3930
4397
  post: {
3931
4398
  parameters: {
@@ -4020,6 +4487,10 @@ type paths = {
4020
4487
  /**
4021
4488
  * Get folder
4022
4489
  * @description Returns folder metadata including children and parent relationships.
4490
+ *
4491
+ * ---
4492
+ * **Permission:** `folder:view`
4493
+ * **Auth:** optional
4023
4494
  */
4024
4495
  get: {
4025
4496
  parameters: {
@@ -4075,6 +4546,10 @@ type paths = {
4075
4546
  /**
4076
4547
  * Update folder
4077
4548
  * @description Updates folder properties (label, description, metadata). Properties are merged.
4549
+ *
4550
+ * ---
4551
+ * **Permission:** `folder:update`
4552
+ * **Auth:** required
4078
4553
  */
4079
4554
  put: {
4080
4555
  parameters: {
@@ -4213,6 +4688,10 @@ type paths = {
4213
4688
  * - Child is in folder
4214
4689
  *
4215
4690
  * **Idempotent**: if relationship already exists, returns current state without error.
4691
+ *
4692
+ * ---
4693
+ * **Permission:** `folder:update`
4694
+ * **Auth:** required
4216
4695
  */
4217
4696
  post: {
4218
4697
  parameters: {
@@ -4345,6 +4824,10 @@ type paths = {
4345
4824
  /**
4346
4825
  * Remove child from folder
4347
4826
  * @description Removes a child entity from this folder (bidirectional).
4827
+ *
4828
+ * ---
4829
+ * **Permission:** `folder:update`
4830
+ * **Auth:** required
4348
4831
  */
4349
4832
  delete: {
4350
4833
  parameters: {
@@ -4487,6 +4970,10 @@ type paths = {
4487
4970
  *
4488
4971
  * **Idempotent**: skips children that already have the relationship.
4489
4972
  * Returns both added and skipped children in the response.
4973
+ *
4974
+ * ---
4975
+ * **Permission:** `folder:update`
4976
+ * **Auth:** required
4490
4977
  */
4491
4978
  post: {
4492
4979
  parameters: {
@@ -4624,6 +5111,10 @@ type paths = {
4624
5111
  * - This folder is in parent
4625
5112
  *
4626
5113
  * **Idempotent**: if relationship already exists, returns current state without error.
5114
+ *
5115
+ * ---
5116
+ * **Permission:** `folder:update`
5117
+ * **Auth:** required
4627
5118
  */
4628
5119
  post: {
4629
5120
  parameters: {
@@ -4756,6 +5247,10 @@ type paths = {
4756
5247
  /**
4757
5248
  * Remove parent from folder
4758
5249
  * @description Removes this folder from a parent folder (bidirectional).
5250
+ *
5251
+ * ---
5252
+ * **Permission:** `folder:update`
5253
+ * **Auth:** required
4759
5254
  */
4760
5255
  delete: {
4761
5256
  parameters: {
@@ -4886,6 +5381,10 @@ type paths = {
4886
5381
  /**
4887
5382
  * List version history
4888
5383
  * @description Returns version metadata for an entity (newest first). Use pagination for entities with many versions.
5384
+ *
5385
+ * ---
5386
+ * **Permission:** `entity:view`
5387
+ * **Auth:** optional
4889
5388
  */
4890
5389
  get: {
4891
5390
  parameters: {
@@ -4986,6 +5485,10 @@ type paths = {
4986
5485
  /**
4987
5486
  * Get manifest by CID
4988
5487
  * @description Returns the full manifest for any version by its CID. Permission is checked against the entity ID in the manifest.
5488
+ *
5489
+ * ---
5490
+ * **Permission:** `entity:view`
5491
+ * **Auth:** optional
4989
5492
  */
4990
5493
  get: {
4991
5494
  parameters: {
@@ -5063,6 +5566,10 @@ type paths = {
5063
5566
  * - Validating actions client-side
5064
5567
  *
5065
5568
  * All data is auto-generated from the actual permission system, so it's always in sync with the code.
5569
+ *
5570
+ * ---
5571
+ * **Permission:** `permissions:read`
5572
+ * **Auth:** none
5066
5573
  */
5067
5574
  get: {
5068
5575
  parameters: {
@@ -5104,6 +5611,10 @@ type paths = {
5104
5611
  /**
5105
5612
  * Create an agent
5106
5613
  * @description Creates a new agent entity. Requires agent:create permission in the target collection.
5614
+ *
5615
+ * ---
5616
+ * **Permission:** `agent:create`
5617
+ * **Auth:** required
5107
5618
  */
5108
5619
  post: {
5109
5620
  parameters: {
@@ -5212,6 +5723,10 @@ type paths = {
5212
5723
  /**
5213
5724
  * Get agent by ID
5214
5725
  * @description Returns an agent entity by ID.
5726
+ *
5727
+ * ---
5728
+ * **Permission:** `agent:view`
5729
+ * **Auth:** optional
5215
5730
  */
5216
5731
  get: {
5217
5732
  parameters: {
@@ -5267,6 +5782,16 @@ type paths = {
5267
5782
  /**
5268
5783
  * Update agent
5269
5784
  * @description Updates an agent. Requires agent:update permission.
5785
+ *
5786
+ * **Field placement:** Agent-specific fields (`label`, `endpoint`, `actions_required`, `input_schema`, etc.) must be at the root level, NOT inside `properties`. The `properties` bag is for additional custom data only.
5787
+ *
5788
+ * **properties_remove syntax:** Use nested objects, not dot notation.
5789
+ * - Correct: `{ "input_schema": { "properties": ["field_to_remove"] } }`
5790
+ * - Wrong: `["input_schema.properties.field_to_remove"]`
5791
+ *
5792
+ * ---
5793
+ * **Permission:** `agent:update`
5794
+ * **Auth:** required
5270
5795
  */
5271
5796
  put: {
5272
5797
  parameters: {
@@ -5400,11 +5925,17 @@ type paths = {
5400
5925
  * Invoke an agent
5401
5926
  * @description Invoke an agent to perform work on a target collection.
5402
5927
  *
5928
+ * **Note:** The `target` parameter must be a collection ID. Agents receive permissions scoped to collections, not individual entities. To process a specific entity, pass the collection it belongs to.
5929
+ *
5403
5930
  * **Two-phase interaction:**
5404
- * 1. First call with `confirm: false` (default) returns a preview of permissions that will be granted
5405
- * 2. After user reviews and confirms, call again with `confirm: true` to execute
5931
+ * 1. `confirm: false` (default) - preview permissions that will be granted
5932
+ * 2. `confirm: true` - execute the agent
5406
5933
  *
5407
5934
  * The agent receives temporal (time-limited) permissions on the target collection.
5935
+ *
5936
+ * ---
5937
+ * **Permission:** `agent:invoke`
5938
+ * **Auth:** required
5408
5939
  */
5409
5940
  post: {
5410
5941
  parameters: {
@@ -5525,6 +6056,10 @@ type paths = {
5525
6056
  /**
5526
6057
  * List API keys for agent
5527
6058
  * @description Lists all active API keys for the agent (without the actual key values).
6059
+ *
6060
+ * ---
6061
+ * **Permission:** `agent:manage`
6062
+ * **Auth:** required
5528
6063
  */
5529
6064
  get: {
5530
6065
  parameters: {
@@ -5595,6 +6130,10 @@ type paths = {
5595
6130
  /**
5596
6131
  * Create API key for agent
5597
6132
  * @description Creates an API key for the agent. The full key is only returned once.
6133
+ *
6134
+ * ---
6135
+ * **Permission:** `agent:manage`
6136
+ * **Auth:** required
5598
6137
  */
5599
6138
  post: {
5600
6139
  parameters: {
@@ -5709,6 +6248,10 @@ type paths = {
5709
6248
  /**
5710
6249
  * Revoke API key
5711
6250
  * @description Revokes an API key for the agent.
6251
+ *
6252
+ * ---
6253
+ * **Permission:** `agent:manage`
6254
+ * **Auth:** required
5712
6255
  */
5713
6256
  delete: {
5714
6257
  parameters: {
@@ -5779,103 +6322,60 @@ type paths = {
5779
6322
  patch?: never;
5780
6323
  trace?: never;
5781
6324
  };
5782
- "/events": {
6325
+ "/agents/{id}/verify": {
5783
6326
  parameters: {
5784
6327
  query?: never;
5785
6328
  header?: never;
5786
6329
  path?: never;
5787
6330
  cookie?: never;
5788
6331
  };
6332
+ get?: never;
6333
+ put?: never;
5789
6334
  /**
5790
- * List entity change events
5791
- * @description Returns a cursor-based list of entity change events for client synchronization.
5792
- *
5793
- * **Usage:**
5794
- * - Call without cursor to get newest events
5795
- * - Use returned `cursor` as `?cursor=` to get older events
5796
- * - Poll without cursor periodically to check for new events
6335
+ * Verify agent endpoint ownership
6336
+ * @description Verify that you control the agent's endpoint URL. This is required before activating an agent.
5797
6337
  *
5798
- * **Sync flow:**
5799
- * 1. Initial: `GET /events` get newest, save highest `id` as high-water mark
5800
- * 2. Paginate: `GET /events?cursor=X` get older events until `has_more=false`
5801
- * 3. Poll: `GET /events` → if newest `id` > high-water mark, process new events
6338
+ * **Two-phase flow:**
6339
+ * 1. Call without `confirm` to get a verification token
6340
+ * 2. Deploy `/.well-known/arke-verification` endpoint returning the token
6341
+ * 3. Call with `confirm: true` to complete verification
5802
6342
  *
5803
- * **Event data:**
5804
- * - `id`: Auto-increment ID
5805
- * - `pi`: Entity ID that changed
5806
- * - `cid`: New manifest CID
5807
- * - `ts`: ISO timestamp
6343
+ * **Verification endpoint format:**
6344
+ * Your endpoint must return JSON:
6345
+ * ```json
6346
+ * {
6347
+ * "verification_token": "vt_xxx...",
6348
+ * "agent_id": "IIxxx..."
6349
+ * }
6350
+ * ```
5808
6351
  *
5809
- * Events are ephemeral (30-day rolling window) - for full sync, use snapshots.
5810
- */
5811
- get: {
5812
- parameters: {
5813
- query?: {
5814
- /** @description Return events older than this id (from previous response cursor) */
5815
- cursor?: number;
5816
- /** @description Maximum number of events to return (default: 100, max: 1000) */
5817
- limit?: number;
5818
- /** @description Network to query (default: main) */
5819
- network?: "main" | "test";
5820
- };
5821
- header?: never;
5822
- path?: never;
5823
- cookie?: never;
5824
- };
5825
- requestBody?: never;
5826
- responses: {
5827
- /** @description Events list */
5828
- 200: {
5829
- headers: {
5830
- [name: string]: unknown;
5831
- };
5832
- content: {
5833
- "application/json": components["schemas"]["EventsListResponse"];
5834
- };
5835
- };
5836
- };
5837
- };
5838
- put?: never;
5839
- post?: never;
5840
- delete?: never;
5841
- options?: never;
5842
- head?: never;
5843
- patch?: never;
5844
- trace?: never;
5845
- };
5846
- "/graph/paths": {
5847
- parameters: {
5848
- query?: never;
5849
- header?: never;
5850
- path?: never;
5851
- cookie?: never;
5852
- };
5853
- get?: never;
5854
- put?: never;
5855
- /**
5856
- * Find paths between entities
5857
- * @description Find shortest paths between source and target entity sets using graph traversal.
6352
+ * ---
6353
+ * **Permission:** `agent:manage`
6354
+ * **Auth:** required
5858
6355
  */
5859
6356
  post: {
5860
6357
  parameters: {
5861
6358
  query?: never;
5862
6359
  header?: never;
5863
- path?: never;
6360
+ path: {
6361
+ /** @description Entity ID (ULID) */
6362
+ id: string;
6363
+ };
5864
6364
  cookie?: never;
5865
6365
  };
5866
6366
  requestBody?: {
5867
6367
  content: {
5868
- "application/json": components["schemas"]["PathsBetweenRequest"];
6368
+ "application/json": components["schemas"]["VerifyAgentRequest"];
5869
6369
  };
5870
6370
  };
5871
6371
  responses: {
5872
- /** @description Paths found */
6372
+ /** @description Verification token (when confirm is false) or verification result (when confirm is true) */
5873
6373
  200: {
5874
6374
  headers: {
5875
6375
  [name: string]: unknown;
5876
6376
  };
5877
6377
  content: {
5878
- "application/json": components["schemas"]["PathsBetweenResponse"];
6378
+ "application/json": components["schemas"]["VerifyAgentTokenResponse"] | components["schemas"]["VerifyAgentSuccessResponse"] | components["schemas"]["VerifyAgentFailureResponse"];
5879
6379
  };
5880
6380
  };
5881
6381
  /** @description Bad Request - Invalid input */
@@ -5903,6 +6403,48 @@ type paths = {
5903
6403
  "application/json": components["schemas"]["ValidationErrorResponse"];
5904
6404
  };
5905
6405
  };
6406
+ /** @description Unauthorized - Missing or invalid authentication */
6407
+ 401: {
6408
+ headers: {
6409
+ [name: string]: unknown;
6410
+ };
6411
+ content: {
6412
+ /**
6413
+ * @example {
6414
+ * "error": "Unauthorized: Missing or invalid authentication token"
6415
+ * }
6416
+ */
6417
+ "application/json": components["schemas"]["ErrorResponse"];
6418
+ };
6419
+ };
6420
+ /** @description Forbidden - Insufficient permissions */
6421
+ 403: {
6422
+ headers: {
6423
+ [name: string]: unknown;
6424
+ };
6425
+ content: {
6426
+ /**
6427
+ * @example {
6428
+ * "error": "Forbidden: You do not have permission to perform this action"
6429
+ * }
6430
+ */
6431
+ "application/json": components["schemas"]["ErrorResponse"];
6432
+ };
6433
+ };
6434
+ /** @description Not Found - Resource does not exist */
6435
+ 404: {
6436
+ headers: {
6437
+ [name: string]: unknown;
6438
+ };
6439
+ content: {
6440
+ /**
6441
+ * @example {
6442
+ * "error": "Entity not found"
6443
+ * }
6444
+ */
6445
+ "application/json": components["schemas"]["ErrorResponse"];
6446
+ };
6447
+ };
5906
6448
  };
5907
6449
  };
5908
6450
  delete?: never;
@@ -5911,29 +6453,259 @@ type paths = {
5911
6453
  patch?: never;
5912
6454
  trace?: never;
5913
6455
  };
5914
- "/graph/reachable": {
6456
+ "/jobs/{id}": {
5915
6457
  parameters: {
5916
6458
  query?: never;
5917
6459
  header?: never;
5918
6460
  path?: never;
5919
6461
  cookie?: never;
5920
6462
  };
5921
- get?: never;
5922
- put?: never;
5923
6463
  /**
5924
- * Find reachable entities
5925
- * @description Find all entities of a specific type reachable from source entities within N hops.
6464
+ * Get job status
6465
+ * @description Returns focused job status and summary. Use this endpoint for quick status polling.
6466
+ *
6467
+ * Returns 404 if the entity is not a job collection.
6468
+ *
6469
+ * **Response includes:**
6470
+ * - Current status (running/done/error)
6471
+ * - Timestamps (started_at, completed_at)
6472
+ * - Agent references (agent, main_agent, target)
6473
+ * - Counts (files_count, sub_jobs_count)
6474
+ *
6475
+ * ---
6476
+ * **Permission:** `collection:view`
6477
+ * **Auth:** optional
5926
6478
  */
5927
- post: {
6479
+ get: {
5928
6480
  parameters: {
5929
6481
  query?: never;
5930
6482
  header?: never;
5931
- path?: never;
5932
- cookie?: never;
5933
- };
5934
- requestBody?: {
5935
- content: {
5936
- "application/json": components["schemas"]["PathsReachableRequest"];
6483
+ path: {
6484
+ /** @description Entity ID (ULID) */
6485
+ id: string;
6486
+ };
6487
+ cookie?: never;
6488
+ };
6489
+ requestBody?: never;
6490
+ responses: {
6491
+ /** @description Job status */
6492
+ 200: {
6493
+ headers: {
6494
+ [name: string]: unknown;
6495
+ };
6496
+ content: {
6497
+ "application/json": components["schemas"]["JobStatusResponse"];
6498
+ };
6499
+ };
6500
+ /** @description Forbidden - Insufficient permissions */
6501
+ 403: {
6502
+ headers: {
6503
+ [name: string]: unknown;
6504
+ };
6505
+ content: {
6506
+ /**
6507
+ * @example {
6508
+ * "error": "Forbidden: You do not have permission to perform this action"
6509
+ * }
6510
+ */
6511
+ "application/json": components["schemas"]["ErrorResponse"];
6512
+ };
6513
+ };
6514
+ /** @description Not Found - Resource does not exist */
6515
+ 404: {
6516
+ headers: {
6517
+ [name: string]: unknown;
6518
+ };
6519
+ content: {
6520
+ /**
6521
+ * @example {
6522
+ * "error": "Entity not found"
6523
+ * }
6524
+ */
6525
+ "application/json": components["schemas"]["ErrorResponse"];
6526
+ };
6527
+ };
6528
+ };
6529
+ };
6530
+ put?: never;
6531
+ post?: never;
6532
+ delete?: never;
6533
+ options?: never;
6534
+ head?: never;
6535
+ patch?: never;
6536
+ trace?: never;
6537
+ };
6538
+ "/events": {
6539
+ parameters: {
6540
+ query?: never;
6541
+ header?: never;
6542
+ path?: never;
6543
+ cookie?: never;
6544
+ };
6545
+ /**
6546
+ * List entity change events
6547
+ * @description Returns a cursor-based list of entity change events for client synchronization.
6548
+ *
6549
+ * **Usage:**
6550
+ * - Call without cursor to get newest events
6551
+ * - Use returned `cursor` as `?cursor=` to get older events
6552
+ * - Poll without cursor periodically to check for new events
6553
+ *
6554
+ * **Sync flow:**
6555
+ * 1. Initial: `GET /events` → get newest, save highest `id` as high-water mark
6556
+ * 2. Paginate: `GET /events?cursor=X` → get older events until `has_more=false`
6557
+ * 3. Poll: `GET /events` → if newest `id` > high-water mark, process new events
6558
+ *
6559
+ * **Event data:**
6560
+ * - `id`: Auto-increment ID
6561
+ * - `pi`: Entity ID that changed
6562
+ * - `cid`: New manifest CID
6563
+ * - `ts`: ISO timestamp
6564
+ *
6565
+ * Events are ephemeral (30-day rolling window) - for full sync, use snapshots.
6566
+ *
6567
+ * ---
6568
+ * **Permission:** `events:list`
6569
+ * **Auth:** none
6570
+ */
6571
+ get: {
6572
+ parameters: {
6573
+ query?: {
6574
+ /** @description Return events older than this id (from previous response cursor) */
6575
+ cursor?: number;
6576
+ /** @description Maximum number of events to return (default: 100, max: 1000) */
6577
+ limit?: number;
6578
+ /** @description Network to query (default: main) */
6579
+ network?: "main" | "test";
6580
+ };
6581
+ header?: never;
6582
+ path?: never;
6583
+ cookie?: never;
6584
+ };
6585
+ requestBody?: never;
6586
+ responses: {
6587
+ /** @description Events list */
6588
+ 200: {
6589
+ headers: {
6590
+ [name: string]: unknown;
6591
+ };
6592
+ content: {
6593
+ "application/json": components["schemas"]["EventsListResponse"];
6594
+ };
6595
+ };
6596
+ };
6597
+ };
6598
+ put?: never;
6599
+ post?: never;
6600
+ delete?: never;
6601
+ options?: never;
6602
+ head?: never;
6603
+ patch?: never;
6604
+ trace?: never;
6605
+ };
6606
+ "/graph/paths": {
6607
+ parameters: {
6608
+ query?: never;
6609
+ header?: never;
6610
+ path?: never;
6611
+ cookie?: never;
6612
+ };
6613
+ get?: never;
6614
+ put?: never;
6615
+ /**
6616
+ * Find paths between entities
6617
+ * @description Find shortest paths between source and target entity sets. Returns all paths up to the limit (default 100).
6618
+ *
6619
+ * Use this when you know both endpoints and want to discover how they connect - for example, finding the chain of relationships between a person and a document.
6620
+ *
6621
+ * ---
6622
+ * **Permission:** `graph:query`
6623
+ * **Auth:** required
6624
+ */
6625
+ post: {
6626
+ parameters: {
6627
+ query?: never;
6628
+ header?: never;
6629
+ path?: never;
6630
+ cookie?: never;
6631
+ };
6632
+ requestBody?: {
6633
+ content: {
6634
+ "application/json": components["schemas"]["PathsBetweenRequest"];
6635
+ };
6636
+ };
6637
+ responses: {
6638
+ /** @description Paths found */
6639
+ 200: {
6640
+ headers: {
6641
+ [name: string]: unknown;
6642
+ };
6643
+ content: {
6644
+ "application/json": components["schemas"]["PathsBetweenResponse"];
6645
+ };
6646
+ };
6647
+ /** @description Bad Request - Invalid input */
6648
+ 400: {
6649
+ headers: {
6650
+ [name: string]: unknown;
6651
+ };
6652
+ content: {
6653
+ /**
6654
+ * @example {
6655
+ * "error": "Validation failed",
6656
+ * "details": {
6657
+ * "issues": [
6658
+ * {
6659
+ * "path": [
6660
+ * "properties",
6661
+ * "label"
6662
+ * ],
6663
+ * "message": "Required"
6664
+ * }
6665
+ * ]
6666
+ * }
6667
+ * }
6668
+ */
6669
+ "application/json": components["schemas"]["ValidationErrorResponse"];
6670
+ };
6671
+ };
6672
+ };
6673
+ };
6674
+ delete?: never;
6675
+ options?: never;
6676
+ head?: never;
6677
+ patch?: never;
6678
+ trace?: never;
6679
+ };
6680
+ "/graph/reachable": {
6681
+ parameters: {
6682
+ query?: never;
6683
+ header?: never;
6684
+ path?: never;
6685
+ cookie?: never;
6686
+ };
6687
+ get?: never;
6688
+ put?: never;
6689
+ /**
6690
+ * Find reachable entities (exhaustive)
6691
+ * @description Find all entities of a specific type reachable from source entities within N hops. Returns up to 100 results by default.
6692
+ *
6693
+ * **When to use this vs POST /query:** This endpoint returns exhaustive, unranked results - all reachable entities up to the limit. Use `POST /query` when you want relevance-ranked results combining semantic similarity with graph structure. Use this endpoint when you need comprehensive graph exploration from known entity IDs.
6694
+ *
6695
+ * ---
6696
+ * **Permission:** `graph:query`
6697
+ * **Auth:** required
6698
+ */
6699
+ post: {
6700
+ parameters: {
6701
+ query?: never;
6702
+ header?: never;
6703
+ path?: never;
6704
+ cookie?: never;
6705
+ };
6706
+ requestBody?: {
6707
+ content: {
6708
+ "application/json": components["schemas"]["PathsReachableRequest"];
5937
6709
  };
5938
6710
  };
5939
6711
  responses: {
@@ -5988,7 +6760,11 @@ type paths = {
5988
6760
  };
5989
6761
  /**
5990
6762
  * Get entity from graph
5991
- * @description Get entity details with all relationships from the graph database.
6763
+ * @description Get entity details with all relationships from the graph database. Unlike the entity manifest, this includes both outgoing and incoming relationships - showing not just what this entity links to, but also what links to it.
6764
+ *
6765
+ * ---
6766
+ * **Permission:** `graph:query`
6767
+ * **Auth:** required
5992
6768
  */
5993
6769
  get: {
5994
6770
  parameters: {
@@ -6046,7 +6822,17 @@ type paths = {
6046
6822
  put?: never;
6047
6823
  /**
6048
6824
  * Execute Argo query
6049
- * @description Execute an Argo DSL query for path-based graph traversal.
6825
+ * @description Execute an Argo DSL query for path-based graph traversal with relevance ranking.
6826
+ *
6827
+ * ## When to Use This Endpoint
6828
+ *
6829
+ * | Endpoint | Use Case |
6830
+ * |----------|----------|
6831
+ * | `POST /query` | Semantic search + graph traversal with **relevance-ranked** results (default k=25) |
6832
+ * | `POST /graph/reachable` | **Exhaustive** graph exploration from known entities (default limit=100) |
6833
+ * | `POST /graph/paths` | Find all shortest paths between two entity sets |
6834
+ *
6835
+ * This endpoint combines semantic similarity scores with path length to rank results. For exhaustive graph traversal without ranking, use the `/graph/*` endpoints directly.
6050
6836
  *
6051
6837
  * ## Query Syntax
6052
6838
  *
@@ -6095,6 +6881,11 @@ type paths = {
6095
6881
  * @:discover "alice" -[*]{,2}-> type:person # Discover, then traverse
6096
6882
  * @01KE4ZY... -[*]{,2}-> type:person # From exact entity
6097
6883
  * ```
6884
+ *
6885
+ *
6886
+ * ---
6887
+ * **Permission:** `query:execute`
6888
+ * **Auth:** required
6098
6889
  */
6099
6890
  post: {
6100
6891
  parameters: {
@@ -6165,6 +6956,10 @@ type paths = {
6165
6956
  * @description Find collections that are semantically similar to a given collection.
6166
6957
  *
6167
6958
  * Uses the collection's weighted centroid vector (combination of description and entity embeddings) to find related collections.
6959
+ *
6960
+ * ---
6961
+ * **Permission:** `search:similar`
6962
+ * **Auth:** required
6168
6963
  */
6169
6964
  post: {
6170
6965
  parameters: {
@@ -6296,6 +7091,10 @@ type paths = {
6296
7091
  * 1. First finds collections similar to the entity's collection
6297
7092
  * 2. Then searches within each collection for similar items
6298
7093
  * 3. Aggregates and ranks results with diversity weighting
7094
+ *
7095
+ * ---
7096
+ * **Permission:** `search:similar`
7097
+ * **Auth:** required
6299
7098
  */
6300
7099
  post: {
6301
7100
  parameters: {
@@ -6444,6 +7243,10 @@ type paths = {
6444
7243
  * @description Search for collections using semantic text search.
6445
7244
  *
6446
7245
  * Use this endpoint to discover collections about a topic. Results are ranked by semantic similarity to your query.
7246
+ *
7247
+ * ---
7248
+ * **Permission:** `search:query`
7249
+ * **Auth:** required
6447
7250
  */
6448
7251
  post: {
6449
7252
  parameters: {
@@ -6540,7 +7343,7 @@ type paths = {
6540
7343
  patch?: never;
6541
7344
  trace?: never;
6542
7345
  };
6543
- "/search/entities": {
7346
+ "/search/agents": {
6544
7347
  parameters: {
6545
7348
  query?: never;
6546
7349
  header?: never;
@@ -6550,12 +7353,14 @@ type paths = {
6550
7353
  get?: never;
6551
7354
  put?: never;
6552
7355
  /**
6553
- * Search entities within collection(s)
6554
- * @description Search for entities within one or more collections using semantic text search.
7356
+ * Search agents by text
7357
+ * @description Search for agents using semantic text search.
6555
7358
  *
6556
- * Provide either `collection_pi` for a single collection or `collection_pis` for multiple collections (searched in parallel).
7359
+ * Use this endpoint to discover agents across the network. Only active agents are returned. Results are ranked by semantic similarity to your query based on agent descriptions and capabilities.
6557
7360
  *
6558
- * Use `per_collection_limit` to ensure result diversity when searching multiple collections.
7361
+ * ---
7362
+ * **Permission:** `search:query`
7363
+ * **Auth:** required
6559
7364
  */
6560
7365
  post: {
6561
7366
  parameters: {
@@ -6567,21 +7372,13 @@ type paths = {
6567
7372
  requestBody?: {
6568
7373
  content: {
6569
7374
  "application/json": {
6570
- /** @description Single collection PI to search within */
6571
- collection_pi?: string;
6572
- /** @description Multiple collection PIs to search (max 20) */
6573
- collection_pis?: string[];
6574
7375
  /** @description Search query text */
6575
7376
  query: string;
6576
7377
  /**
6577
- * @description Maximum total results to return
6578
- * @default 20
7378
+ * @description Maximum results to return
7379
+ * @default 10
6579
7380
  */
6580
7381
  limit?: number;
6581
- /** @description Filter by entity types */
6582
- types?: string[];
6583
- /** @description Max results per collection for diversity */
6584
- per_collection_limit?: number;
6585
7382
  };
6586
7383
  };
6587
7384
  };
@@ -6596,16 +7393,14 @@ type paths = {
6596
7393
  results: {
6597
7394
  pi: string;
6598
7395
  label: string;
6599
- type: string;
6600
7396
  score: number;
6601
- collection_pi: string;
7397
+ collection_pi: string | null;
7398
+ status?: string;
6602
7399
  created_at?: string;
6603
7400
  updated_at?: string;
6604
7401
  }[];
6605
7402
  metadata: {
6606
- collection_pis: string[];
6607
7403
  query: string;
6608
- collections_searched: number;
6609
7404
  result_count: number;
6610
7405
  };
6611
7406
  };
@@ -6661,7 +7456,7 @@ type paths = {
6661
7456
  patch?: never;
6662
7457
  trace?: never;
6663
7458
  };
6664
- "/search/discover": {
7459
+ "/search/entities": {
6665
7460
  parameters: {
6666
7461
  query?: never;
6667
7462
  header?: never;
@@ -6671,15 +7466,16 @@ type paths = {
6671
7466
  get?: never;
6672
7467
  put?: never;
6673
7468
  /**
6674
- * Discover entities across all collections
6675
- * @description Two-step discovery search: first finds relevant collections, then searches within them.
7469
+ * Search entities within collection(s)
7470
+ * @description Search for entities within one or more collections using semantic text search.
6676
7471
  *
6677
- * Use this endpoint when you don't know which collections to search. The system will:
6678
- * 1. Find collections semantically related to your query
6679
- * 2. Search within each collection in parallel
6680
- * 3. Aggregate and rank results across all collections
7472
+ * Provide either `collection_pi` for a single collection or `collection_pis` for multiple collections (searched in parallel).
6681
7473
  *
6682
- * Great for exploration and AI agents navigating the network.
7474
+ * Use `per_collection_limit` to ensure result diversity when searching multiple collections.
7475
+ *
7476
+ * ---
7477
+ * **Permission:** `search:query`
7478
+ * **Auth:** required
6683
7479
  */
6684
7480
  post: {
6685
7481
  parameters: {
@@ -6691,6 +7487,10 @@ type paths = {
6691
7487
  requestBody?: {
6692
7488
  content: {
6693
7489
  "application/json": {
7490
+ /** @description Single collection PI to search within */
7491
+ collection_pi?: string;
7492
+ /** @description Multiple collection PIs to search (max 20) */
7493
+ collection_pis?: string[];
6694
7494
  /** @description Search query text */
6695
7495
  query: string;
6696
7496
  /**
@@ -6700,8 +7500,132 @@ type paths = {
6700
7500
  limit?: number;
6701
7501
  /** @description Filter by entity types */
6702
7502
  types?: string[];
6703
- /**
6704
- * @description Number of collections to search
7503
+ /** @description Max results per collection for diversity */
7504
+ per_collection_limit?: number;
7505
+ };
7506
+ };
7507
+ };
7508
+ responses: {
7509
+ /** @description Search results */
7510
+ 200: {
7511
+ headers: {
7512
+ [name: string]: unknown;
7513
+ };
7514
+ content: {
7515
+ "application/json": {
7516
+ results: {
7517
+ pi: string;
7518
+ label: string;
7519
+ type: string;
7520
+ score: number;
7521
+ collection_pi: string;
7522
+ created_at?: string;
7523
+ updated_at?: string;
7524
+ }[];
7525
+ metadata: {
7526
+ collection_pis: string[];
7527
+ query: string;
7528
+ collections_searched: number;
7529
+ result_count: number;
7530
+ };
7531
+ };
7532
+ };
7533
+ };
7534
+ /** @description Bad Request - Invalid input */
7535
+ 400: {
7536
+ headers: {
7537
+ [name: string]: unknown;
7538
+ };
7539
+ content: {
7540
+ /**
7541
+ * @example {
7542
+ * "error": "Validation failed",
7543
+ * "details": {
7544
+ * "issues": [
7545
+ * {
7546
+ * "path": [
7547
+ * "properties",
7548
+ * "label"
7549
+ * ],
7550
+ * "message": "Required"
7551
+ * }
7552
+ * ]
7553
+ * }
7554
+ * }
7555
+ */
7556
+ "application/json": components["schemas"]["ValidationErrorResponse"];
7557
+ };
7558
+ };
7559
+ /** @description Service Unavailable - External service not available */
7560
+ 503: {
7561
+ headers: {
7562
+ [name: string]: unknown;
7563
+ };
7564
+ content: {
7565
+ /**
7566
+ * @example {
7567
+ * "error": "Service unavailable",
7568
+ * "details": {
7569
+ * "service": "pinecone"
7570
+ * }
7571
+ * }
7572
+ */
7573
+ "application/json": components["schemas"]["ErrorResponse"];
7574
+ };
7575
+ };
7576
+ };
7577
+ };
7578
+ delete?: never;
7579
+ options?: never;
7580
+ head?: never;
7581
+ patch?: never;
7582
+ trace?: never;
7583
+ };
7584
+ "/search/discover": {
7585
+ parameters: {
7586
+ query?: never;
7587
+ header?: never;
7588
+ path?: never;
7589
+ cookie?: never;
7590
+ };
7591
+ get?: never;
7592
+ put?: never;
7593
+ /**
7594
+ * Discover entities across all collections
7595
+ * @description Two-step discovery search: first finds relevant collections, then searches within them.
7596
+ *
7597
+ * Use this endpoint when you don't know which collections to search. The system will:
7598
+ * 1. Find collections semantically related to your query
7599
+ * 2. Search within each collection in parallel
7600
+ * 3. Aggregate and rank results across all collections
7601
+ *
7602
+ * Great for exploration and AI agents navigating the network.
7603
+ *
7604
+ * ---
7605
+ * **Permission:** `search:query`
7606
+ * **Auth:** required
7607
+ */
7608
+ post: {
7609
+ parameters: {
7610
+ query?: never;
7611
+ header?: never;
7612
+ path?: never;
7613
+ cookie?: never;
7614
+ };
7615
+ requestBody?: {
7616
+ content: {
7617
+ "application/json": {
7618
+ /** @description Search query text */
7619
+ query: string;
7620
+ /**
7621
+ * @description Maximum total results to return
7622
+ * @default 20
7623
+ */
7624
+ limit?: number;
7625
+ /** @description Filter by entity types */
7626
+ types?: string[];
7627
+ /**
7628
+ * @description Number of collections to search
6705
7629
  * @default 10
6706
7630
  */
6707
7631
  collection_limit?: number;
@@ -6788,6 +7712,228 @@ type paths = {
6788
7712
  patch?: never;
6789
7713
  trace?: never;
6790
7714
  };
7715
+ "/chat": {
7716
+ parameters: {
7717
+ query?: never;
7718
+ header?: never;
7719
+ path?: never;
7720
+ cookie?: never;
7721
+ };
7722
+ get?: never;
7723
+ put?: never;
7724
+ /**
7725
+ * Send chat message
7726
+ * @description Send a message to the Arke chat agent and receive a streaming response.
7727
+ *
7728
+ * The agent can execute Arke API operations on your behalf using the authenticated user's permissions.
7729
+ *
7730
+ * ## Headers
7731
+ *
7732
+ * - `X-Chat-ID`: Optional. Specify to continue an existing chat session. If omitted, a new session is created.
7733
+ *
7734
+ * ## Response Format
7735
+ *
7736
+ * The response is a Server-Sent Events (SSE) stream in AI SDK v5 UIMessage format.
7737
+ * Stream chunks include text deltas, tool calls, and usage information.
7738
+ *
7739
+ * ## Token Usage Tracking
7740
+ *
7741
+ * Usage information is included at the end of the stream in the format:
7742
+ * ```json
7743
+ * {"type":"message_delta","delta":{"usage":{"input_tokens":123,"output_tokens":456}}}
7744
+ * ```
7745
+ *
7746
+ *
7747
+ * ---
7748
+ * **Permission:** `chat:send`
7749
+ * **Auth:** required
7750
+ */
7751
+ post: {
7752
+ parameters: {
7753
+ query?: never;
7754
+ header?: never;
7755
+ path?: never;
7756
+ cookie?: never;
7757
+ };
7758
+ requestBody?: {
7759
+ content: {
7760
+ "application/json": components["schemas"]["SendChatRequest"];
7761
+ };
7762
+ };
7763
+ responses: {
7764
+ /** @description Streaming SSE response */
7765
+ 200: {
7766
+ headers: {
7767
+ [name: string]: unknown;
7768
+ };
7769
+ content: {
7770
+ "text/event-stream": string;
7771
+ };
7772
+ };
7773
+ /** @description Unauthorized - Missing or invalid authentication */
7774
+ 401: {
7775
+ headers: {
7776
+ [name: string]: unknown;
7777
+ };
7778
+ content: {
7779
+ /**
7780
+ * @example {
7781
+ * "error": "Unauthorized: Missing or invalid authentication token"
7782
+ * }
7783
+ */
7784
+ "application/json": components["schemas"]["ErrorResponse"];
7785
+ };
7786
+ };
7787
+ /** @description Forbidden - Insufficient permissions */
7788
+ 403: {
7789
+ headers: {
7790
+ [name: string]: unknown;
7791
+ };
7792
+ content: {
7793
+ /**
7794
+ * @example {
7795
+ * "error": "Forbidden: You do not have permission to perform this action"
7796
+ * }
7797
+ */
7798
+ "application/json": components["schemas"]["ErrorResponse"];
7799
+ };
7800
+ };
7801
+ };
7802
+ };
7803
+ delete?: never;
7804
+ options?: never;
7805
+ head?: never;
7806
+ patch?: never;
7807
+ trace?: never;
7808
+ };
7809
+ "/chat/sessions/{id}": {
7810
+ parameters: {
7811
+ query?: never;
7812
+ header?: never;
7813
+ path?: never;
7814
+ cookie?: never;
7815
+ };
7816
+ /**
7817
+ * Get chat session
7818
+ * @description Get information about a chat session including message history.
7819
+ *
7820
+ * Sessions are publicly viewable for sharing purposes. Only the owner can send messages or delete the session.
7821
+ *
7822
+ * ---
7823
+ * **Permission:** `chat:view`
7824
+ * **Auth:** optional
7825
+ */
7826
+ get: {
7827
+ parameters: {
7828
+ query?: never;
7829
+ header?: never;
7830
+ path?: never;
7831
+ cookie?: never;
7832
+ };
7833
+ requestBody?: never;
7834
+ responses: {
7835
+ /** @description Chat session info */
7836
+ 200: {
7837
+ headers: {
7838
+ [name: string]: unknown;
7839
+ };
7840
+ content: {
7841
+ "application/json": components["schemas"]["ChatSession"];
7842
+ };
7843
+ };
7844
+ /** @description Not Found - Resource does not exist */
7845
+ 404: {
7846
+ headers: {
7847
+ [name: string]: unknown;
7848
+ };
7849
+ content: {
7850
+ /**
7851
+ * @example {
7852
+ * "error": "Entity not found"
7853
+ * }
7854
+ */
7855
+ "application/json": components["schemas"]["ErrorResponse"];
7856
+ };
7857
+ };
7858
+ };
7859
+ };
7860
+ put?: never;
7861
+ post?: never;
7862
+ /**
7863
+ * Delete chat session
7864
+ * @description Delete a chat session. Only the session owner can delete it.
7865
+ *
7866
+ * ---
7867
+ * **Permission:** `chat:delete`
7868
+ * **Auth:** required
7869
+ */
7870
+ delete: {
7871
+ parameters: {
7872
+ query?: never;
7873
+ header?: never;
7874
+ path?: never;
7875
+ cookie?: never;
7876
+ };
7877
+ requestBody?: never;
7878
+ responses: {
7879
+ /** @description Session deleted */
7880
+ 200: {
7881
+ headers: {
7882
+ [name: string]: unknown;
7883
+ };
7884
+ content: {
7885
+ "application/json": components["schemas"]["ChatSessionDeleteResponse"];
7886
+ };
7887
+ };
7888
+ /** @description Unauthorized - Missing or invalid authentication */
7889
+ 401: {
7890
+ headers: {
7891
+ [name: string]: unknown;
7892
+ };
7893
+ content: {
7894
+ /**
7895
+ * @example {
7896
+ * "error": "Unauthorized: Missing or invalid authentication token"
7897
+ * }
7898
+ */
7899
+ "application/json": components["schemas"]["ErrorResponse"];
7900
+ };
7901
+ };
7902
+ /** @description Forbidden - Insufficient permissions */
7903
+ 403: {
7904
+ headers: {
7905
+ [name: string]: unknown;
7906
+ };
7907
+ content: {
7908
+ /**
7909
+ * @example {
7910
+ * "error": "Forbidden: You do not have permission to perform this action"
7911
+ * }
7912
+ */
7913
+ "application/json": components["schemas"]["ErrorResponse"];
7914
+ };
7915
+ };
7916
+ /** @description Not Found - Resource does not exist */
7917
+ 404: {
7918
+ headers: {
7919
+ [name: string]: unknown;
7920
+ };
7921
+ content: {
7922
+ /**
7923
+ * @example {
7924
+ * "error": "Entity not found"
7925
+ * }
7926
+ */
7927
+ "application/json": components["schemas"]["ErrorResponse"];
7928
+ };
7929
+ };
7930
+ };
7931
+ };
7932
+ options?: never;
7933
+ head?: never;
7934
+ patch?: never;
7935
+ trace?: never;
7936
+ };
6791
7937
  "/entities/{id}/attestation": {
6792
7938
  parameters: {
6793
7939
  query?: never;
@@ -6800,6 +7946,10 @@ type paths = {
6800
7946
  * @description Returns the Arweave attestation for the current (latest) version of an entity.
6801
7947
  *
6802
7948
  * Returns 202 Accepted if the attestation upload is still pending.
7949
+ *
7950
+ * ---
7951
+ * **Permission:** `entity:view`
7952
+ * **Auth:** optional
6803
7953
  */
6804
7954
  get: {
6805
7955
  parameters: {
@@ -6879,6 +8029,10 @@ type paths = {
6879
8029
  /**
6880
8030
  * Get version attestation
6881
8031
  * @description Returns the Arweave attestation for a specific version of an entity.
8032
+ *
8033
+ * ---
8034
+ * **Permission:** `entity:view`
8035
+ * **Auth:** optional
6882
8036
  */
6883
8037
  get: {
6884
8038
  parameters: {
@@ -6941,6 +8095,63 @@ type paths = {
6941
8095
  patch?: never;
6942
8096
  trace?: never;
6943
8097
  };
8098
+ "/attestations/head": {
8099
+ parameters: {
8100
+ query?: never;
8101
+ header?: never;
8102
+ path?: never;
8103
+ cookie?: never;
8104
+ };
8105
+ /**
8106
+ * Get chain head
8107
+ * @description Returns the latest Arweave attestation transaction ID (network head).
8108
+ *
8109
+ * ---
8110
+ * **Permission:** `attestation:view`
8111
+ * **Auth:** none
8112
+ */
8113
+ get: {
8114
+ parameters: {
8115
+ query?: never;
8116
+ header?: never;
8117
+ path?: never;
8118
+ cookie?: never;
8119
+ };
8120
+ requestBody?: never;
8121
+ responses: {
8122
+ /** @description Chain head */
8123
+ 200: {
8124
+ headers: {
8125
+ [name: string]: unknown;
8126
+ };
8127
+ content: {
8128
+ "application/json": components["schemas"]["ChainHeadResponse"];
8129
+ };
8130
+ };
8131
+ /** @description Not Found - Resource does not exist */
8132
+ 404: {
8133
+ headers: {
8134
+ [name: string]: unknown;
8135
+ };
8136
+ content: {
8137
+ /**
8138
+ * @example {
8139
+ * "error": "Entity not found"
8140
+ * }
8141
+ */
8142
+ "application/json": components["schemas"]["ErrorResponse"];
8143
+ };
8144
+ };
8145
+ };
8146
+ };
8147
+ put?: never;
8148
+ post?: never;
8149
+ delete?: never;
8150
+ options?: never;
8151
+ head?: never;
8152
+ patch?: never;
8153
+ trace?: never;
8154
+ };
6944
8155
  "/attestations/verify/{tx}": {
6945
8156
  parameters: {
6946
8157
  query?: never;
@@ -6953,6 +8164,10 @@ type paths = {
6953
8164
  * @description Fetches an attestation from Arweave and verifies the CID matches the manifest content.
6954
8165
  *
6955
8166
  * This is a public endpoint - anyone can verify attestations.
8167
+ *
8168
+ * ---
8169
+ * **Permission:** `attestation:verify`
8170
+ * **Auth:** none
6956
8171
  */
6957
8172
  get: {
6958
8173
  parameters: {
@@ -7091,6 +8306,19 @@ type components = {
7091
8306
  * @example 1735214400000
7092
8307
  */
7093
8308
  ts: number;
8309
+ /**
8310
+ * @description Audit trail for edits
8311
+ * @example {
8312
+ * "user_id": "01JCAPTAINAHAB000000000000",
8313
+ * "method": "manual"
8314
+ * }
8315
+ */
8316
+ edited_by: {
8317
+ user_id: string;
8318
+ /** @enum {string} */
8319
+ method: "manual" | "ai_generated" | "system" | "import";
8320
+ on_behalf_of?: string;
8321
+ };
7094
8322
  /**
7095
8323
  * @description Previous version CID (present on updates)
7096
8324
  * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
@@ -7143,7 +8371,7 @@ type components = {
7143
8371
  properties?: {
7144
8372
  [key: string]: unknown;
7145
8373
  };
7146
- /** @description Properties to remove */
8374
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
7147
8375
  properties_remove?: string[] | {
7148
8376
  [key: string]: unknown;
7149
8377
  };
@@ -7486,7 +8714,7 @@ type components = {
7486
8714
  properties?: {
7487
8715
  [key: string]: unknown;
7488
8716
  };
7489
- /** @description Properties to remove */
8717
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
7490
8718
  properties_remove?: string[] | {
7491
8719
  [key: string]: unknown;
7492
8720
  };
@@ -7846,6 +9074,19 @@ type components = {
7846
9074
  * @example 1735214400000
7847
9075
  */
7848
9076
  ts: number;
9077
+ /**
9078
+ * @description Audit trail for edits
9079
+ * @example {
9080
+ * "user_id": "01JCAPTAINAHAB000000000000",
9081
+ * "method": "manual"
9082
+ * }
9083
+ */
9084
+ edited_by: {
9085
+ user_id: string;
9086
+ /** @enum {string} */
9087
+ method: "manual" | "ai_generated" | "system" | "import";
9088
+ on_behalf_of?: string;
9089
+ };
7849
9090
  /**
7850
9091
  * @description Previous version CID (present on updates)
7851
9092
  * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
@@ -7869,7 +9110,7 @@ type components = {
7869
9110
  */
7870
9111
  type: string;
7871
9112
  /**
7872
- * @description Entity properties (type-specific)
9113
+ * @description Entity properties (type-specific). Text properties may contain inline entity references using the arke: URI scheme (e.g., [Label](arke:01JENTITY123...)) for domain-agnostic linking.
7873
9114
  * @example {
7874
9115
  * "label": "Chapter 1: Loomings",
7875
9116
  * "author": "Herman Melville"
@@ -7894,6 +9135,18 @@ type components = {
7894
9135
  */
7895
9136
  collection?: string;
7896
9137
  };
9138
+ TipResponse: {
9139
+ /**
9140
+ * @description Entity ID (ULID format)
9141
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
9142
+ */
9143
+ id: string;
9144
+ /**
9145
+ * @description Content Identifier (CID) - content-addressed hash
9146
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
9147
+ */
9148
+ cid: string;
9149
+ };
7897
9150
  EntityUpdatedResponse: components["schemas"]["EntityResponse"] & {
7898
9151
  /**
7899
9152
  * @description Previous version CID
@@ -7916,7 +9169,7 @@ type components = {
7916
9169
  properties?: {
7917
9170
  [key: string]: unknown;
7918
9171
  };
7919
- /** @description Properties to remove */
9172
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
7920
9173
  properties_remove?: string[] | {
7921
9174
  [key: string]: unknown;
7922
9175
  };
@@ -8014,6 +9267,110 @@ type components = {
8014
9267
  */
8015
9268
  reason?: string;
8016
9269
  };
9270
+ CascadeDeletedEntity: {
9271
+ /**
9272
+ * @description Entity ID (ULID format)
9273
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
9274
+ */
9275
+ id: string;
9276
+ /**
9277
+ * @description Content Identifier (CID) - content-addressed hash
9278
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
9279
+ */
9280
+ cid: string;
9281
+ /**
9282
+ * @description Entity type
9283
+ * @example file
9284
+ */
9285
+ type: string;
9286
+ /**
9287
+ * @description Depth from root entity at which this entity was found
9288
+ * @example 1
9289
+ */
9290
+ depth: number;
9291
+ };
9292
+ CascadeSkippedEntity: {
9293
+ /**
9294
+ * @description Entity ID (ULID format)
9295
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
9296
+ */
9297
+ id: string;
9298
+ /**
9299
+ * @description Entity type
9300
+ * @example file
9301
+ */
9302
+ type: string;
9303
+ /**
9304
+ * @description Reason an entity was skipped during cascade delete
9305
+ * @enum {string}
9306
+ */
9307
+ reason: "not_in_collection" | "already_deleted" | "edited_by_mismatch" | "cas_conflict";
9308
+ };
9309
+ CascadeDeleteResponse: {
9310
+ root: components["schemas"]["EntityDeletedResponse"] & unknown;
9311
+ /** @description Entities successfully deleted (ordered by depth, deepest first) */
9312
+ deleted: components["schemas"]["CascadeDeletedEntity"][];
9313
+ /** @description Entities skipped during traversal with reasons */
9314
+ skipped: components["schemas"]["CascadeSkippedEntity"][];
9315
+ /** @description Summary statistics for the cascade delete operation */
9316
+ summary: {
9317
+ /** @description Total entities visited during BFS traversal */
9318
+ total_traversed: number;
9319
+ /** @description Total entities successfully deleted (excluding root) */
9320
+ total_deleted: number;
9321
+ /** @description Total entities skipped during traversal */
9322
+ total_skipped: number;
9323
+ /** @description Maximum depth reached during traversal */
9324
+ max_depth_reached: number;
9325
+ };
9326
+ };
9327
+ CascadeDeleteRequest: {
9328
+ /**
9329
+ * @description Current tip CID for CAS validation. Request fails with 409 if this does not match.
9330
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
9331
+ */
9332
+ expect_tip: string;
9333
+ /**
9334
+ * @description Optional note describing this change
9335
+ * @example Added Chapter 42: The Whiteness of the Whale
9336
+ */
9337
+ note?: string;
9338
+ /**
9339
+ * @description Collection to scope the cascade delete. Only entities in this collection will be deleted. Permission check is performed on this collection.
9340
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
9341
+ */
9342
+ collection_id: string;
9343
+ /**
9344
+ * @description Predicate patterns to follow during cascade traversal. Supports wildcards:
9345
+ * - `"child"` - exact match only
9346
+ * - `"has_*"` - matches has_document, has_image, etc.
9347
+ * - `"*_copy"` - matches file_copy, document_copy, etc.
9348
+ * - `"*"` - matches ALL predicates
9349
+ *
9350
+ * **Important:** The `collection` predicate NEVER cascades, even if `"*"` is specified. This protects the collection structure from accidental deletion.
9351
+ * @example [
9352
+ * "child",
9353
+ * "has_*"
9354
+ * ]
9355
+ */
9356
+ cascade_predicates: string[];
9357
+ /**
9358
+ * @description Only delete entities where edited_by.user_id matches this PI. Useful for cleaning up entities created by a specific agent.
9359
+ * @example 01KAGENTXXXXXXXXXXXXXXXX
9360
+ */
9361
+ edited_by_filter?: string;
9362
+ /**
9363
+ * @description Maximum relationship depth to traverse (default: 10, max: 20)
9364
+ * @default 10
9365
+ * @example 10
9366
+ */
9367
+ max_depth: number;
9368
+ /**
9369
+ * @description Reason for deleting the entities (applied to all deleted entities)
9370
+ * @example Cleanup after agent task
9371
+ */
9372
+ reason?: string;
9373
+ };
8017
9374
  EntityUpdateResponse: components["schemas"]["EntityResponse"] & {
8018
9375
  /**
8019
9376
  * @description Previous version CID
@@ -8443,6 +9800,19 @@ type components = {
8443
9800
  * @example 1735214400000
8444
9801
  */
8445
9802
  ts: number;
9803
+ /**
9804
+ * @description Audit trail for edits
9805
+ * @example {
9806
+ * "user_id": "01JCAPTAINAHAB000000000000",
9807
+ * "method": "manual"
9808
+ * }
9809
+ */
9810
+ edited_by: {
9811
+ user_id: string;
9812
+ /** @enum {string} */
9813
+ method: "manual" | "ai_generated" | "system" | "import";
9814
+ on_behalf_of?: string;
9815
+ };
8446
9816
  };
8447
9817
  CreateFileRequest: {
8448
9818
  /**
@@ -8536,7 +9906,7 @@ type components = {
8536
9906
  properties?: {
8537
9907
  [key: string]: unknown;
8538
9908
  };
8539
- /** @description Properties to remove */
9909
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
8540
9910
  properties_remove?: string[] | {
8541
9911
  [key: string]: unknown;
8542
9912
  };
@@ -8689,6 +10059,19 @@ type components = {
8689
10059
  * @example 1735214400000
8690
10060
  */
8691
10061
  ts: number;
10062
+ /**
10063
+ * @description Audit trail for edits
10064
+ * @example {
10065
+ * "user_id": "01JCAPTAINAHAB000000000000",
10066
+ * "method": "manual"
10067
+ * }
10068
+ */
10069
+ edited_by: {
10070
+ user_id: string;
10071
+ /** @enum {string} */
10072
+ method: "manual" | "ai_generated" | "system" | "import";
10073
+ on_behalf_of?: string;
10074
+ };
8692
10075
  };
8693
10076
  CreateFolderRequest: {
8694
10077
  /**
@@ -8760,7 +10143,7 @@ type components = {
8760
10143
  properties?: {
8761
10144
  [key: string]: unknown;
8762
10145
  };
8763
- /** @description Properties to remove */
10146
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
8764
10147
  properties_remove?: string[] | {
8765
10148
  [key: string]: unknown;
8766
10149
  };
@@ -9124,6 +10507,34 @@ type components = {
9124
10507
  note?: string;
9125
10508
  };
9126
10509
  };
10510
+ TypeRestriction: {
10511
+ /**
10512
+ * @description The type with restricted implications
10513
+ * @example collection
10514
+ */
10515
+ type: string;
10516
+ /**
10517
+ * @description Verbs for which the base type DOES imply this type
10518
+ * @example [
10519
+ * "view"
10520
+ * ]
10521
+ */
10522
+ allowed_verbs: string[];
10523
+ /** @description Explanation of the restriction */
10524
+ description: string;
10525
+ };
10526
+ /** @description Type hierarchy. The base type implies all other types, with restrictions for certain types. */
10527
+ TypeHierarchy: {
10528
+ /**
10529
+ * @description The base type that implies all other types
10530
+ * @example entity
10531
+ */
10532
+ base_type: string;
10533
+ /** @description Explanation of type hierarchy behavior */
10534
+ description: string;
10535
+ /** @description Types with restricted implication rules */
10536
+ restrictions: components["schemas"]["TypeRestriction"][];
10537
+ };
9127
10538
  /** @description Verb wildcard pattern (*:verb) */
9128
10539
  WildcardInfo: {
9129
10540
  /**
@@ -9184,6 +10595,7 @@ type components = {
9184
10595
  implications: {
9185
10596
  [key: string]: string[];
9186
10597
  };
10598
+ type_hierarchy: components["schemas"]["TypeHierarchy"];
9187
10599
  /** @description Wildcard pattern documentation */
9188
10600
  wildcards: {
9189
10601
  verb: components["schemas"]["WildcardInfo"];
@@ -9217,21 +10629,18 @@ type components = {
9217
10629
  AgentResponse: components["schemas"]["EntityResponse"] & {
9218
10630
  /** @enum {string} */
9219
10631
  type?: "agent";
9220
- };
9221
- SubAgentRef: {
9222
- pi: string;
9223
- /** @description Display label for the sub-agent */
9224
- label?: string;
9225
- /** @description Description of the sub-agent role */
9226
- description?: string;
9227
- /**
9228
- * @description Actions this sub-agent requires
9229
- * @example [
9230
- * "entity:view",
9231
- * "entity:update"
9232
- * ]
9233
- */
9234
- actions_required: string[];
10632
+ /** @description Warnings about sub-agent references that could not be validated. Present only when uses_agents contains references to non-existent, non-agent, or disabled entities. */
10633
+ warnings?: {
10634
+ /** @description The sub-agent ID that has an issue */
10635
+ sub_agent_id: string;
10636
+ /**
10637
+ * @description Why this is a warning: not_found (entity does not exist), not_an_agent (entity exists but is not an agent), or disabled (agent is disabled)
10638
+ * @enum {string}
10639
+ */
10640
+ reason: "not_found" | "not_an_agent" | "disabled";
10641
+ /** @description Human-readable explanation */
10642
+ message: string;
10643
+ }[];
9235
10644
  };
9236
10645
  CreateAgentRequest: {
9237
10646
  /**
@@ -9268,8 +10677,15 @@ type components = {
9268
10677
  * @example Extracts text from scanned documents using OCR
9269
10678
  */
9270
10679
  description?: string;
9271
- /** @description Sub-agents used by this orchestrator */
9272
- uses_agents?: components["schemas"]["SubAgentRef"][];
10680
+ /** @description Sub-agents this orchestrator delegates work to. Only provide the sub-agent ID (pi) - their permissions are fetched dynamically at invocation time. Warnings are returned if any referenced sub-agents do not exist or are disabled. */
10681
+ uses_agents?: {
10682
+ /** @description Sub-agent entity ID. The sub-agent's actions_required will be fetched dynamically at invocation time. */
10683
+ pi: string;
10684
+ /** @description Optional display label override (defaults to sub-agent's own label) */
10685
+ label?: string;
10686
+ /** @description Optional description of the sub-agent's role in this orchestrator's workflow */
10687
+ description?: string;
10688
+ }[];
9273
10689
  /** @description JSON Schema for input validation */
9274
10690
  input_schema?: {
9275
10691
  [key: string]: unknown;
@@ -9315,7 +10731,7 @@ type components = {
9315
10731
  properties?: {
9316
10732
  [key: string]: unknown;
9317
10733
  };
9318
- /** @description Properties to remove */
10734
+ /** @description Properties to remove. Use string[] for top-level keys (e.g., ["old_field"]), or nested objects for deep removal (e.g., { config: { options: ["debug"] } }). Dot notation like "config.options.debug" is NOT supported. */
9319
10735
  properties_remove?: string[] | {
9320
10736
  [key: string]: unknown;
9321
10737
  };
@@ -9392,8 +10808,15 @@ type components = {
9392
10808
  * @enum {string}
9393
10809
  */
9394
10810
  status?: "development" | "active" | "disabled";
9395
- /** @description Updated sub-agents */
9396
- uses_agents?: components["schemas"]["SubAgentRef"][];
10811
+ /** @description Updated sub-agent references. Only provide sub-agent IDs (pi) - their permissions are fetched dynamically at invocation time. */
10812
+ uses_agents?: {
10813
+ /** @description Sub-agent entity ID. The sub-agent's actions_required will be fetched dynamically at invocation time. */
10814
+ pi: string;
10815
+ /** @description Optional display label override (defaults to sub-agent's own label) */
10816
+ label?: string;
10817
+ /** @description Optional description of the sub-agent's role in this orchestrator's workflow */
10818
+ description?: string;
10819
+ }[];
9397
10820
  /** @description Updated input schema */
9398
10821
  input_schema?: {
9399
10822
  [key: string]: unknown;
@@ -9431,6 +10854,20 @@ type components = {
9431
10854
  can_proceed: boolean;
9432
10855
  /** @description True if some agents need permission grants */
9433
10856
  grants_needed: boolean;
10857
+ /** @description Warnings about sub-agents that were skipped */
10858
+ warnings?: {
10859
+ /** @description The sub-agent ID that could not be resolved */
10860
+ sub_agent_id: string;
10861
+ /** @description The orchestrator or parent agent that declared this sub-agent reference */
10862
+ parent_agent_id: string;
10863
+ /**
10864
+ * @description Why the sub-agent was skipped: not_found (entity does not exist) or disabled (agent status is disabled)
10865
+ * @enum {string}
10866
+ */
10867
+ reason: "not_found" | "disabled";
10868
+ /** @description Human-readable explanation of the warning */
10869
+ message: string;
10870
+ }[];
9434
10871
  };
9435
10872
  InvokeGrantResult: {
9436
10873
  agent_id: string;
@@ -9476,7 +10913,7 @@ type components = {
9476
10913
  };
9477
10914
  InvokeConfirmedResponse: components["schemas"]["InvokeStartedResponse"] | components["schemas"]["InvokeRejectedResponse"];
9478
10915
  InvokeAgentRequest: {
9479
- /** @description Target collection ID to operate on */
10916
+ /** @description Collection ID to grant the agent access to. All agent permissions are collection-scoped. */
9480
10917
  target: string;
9481
10918
  /** @description Job collection where agent should write logs. If not provided, creates new root collection. */
9482
10919
  job_collection?: string;
@@ -9544,6 +10981,106 @@ type components = {
9544
10981
  ListAgentApiKeysResponse: {
9545
10982
  keys: components["schemas"]["AgentApiKeyInfo"][];
9546
10983
  };
10984
+ VerifyAgentTokenResponse: {
10985
+ /**
10986
+ * @description Token to deploy at your endpoint
10987
+ * @example vt_abc123def456...
10988
+ */
10989
+ verification_token: string;
10990
+ /** @description Agent ID to include in verification response */
10991
+ agent_id: string;
10992
+ /**
10993
+ * Format: uri
10994
+ * @description Your agent endpoint URL
10995
+ */
10996
+ endpoint: string;
10997
+ /** @description How to complete verification */
10998
+ instructions: string;
10999
+ /**
11000
+ * Format: date-time
11001
+ * @description Token expiration time
11002
+ */
11003
+ expires_at: string;
11004
+ };
11005
+ VerifyAgentSuccessResponse: {
11006
+ /** @enum {boolean} */
11007
+ verified: true;
11008
+ /**
11009
+ * Format: date-time
11010
+ * @description When the endpoint was verified
11011
+ */
11012
+ verified_at: string;
11013
+ };
11014
+ VerifyAgentFailureResponse: {
11015
+ /** @enum {boolean} */
11016
+ verified: false;
11017
+ /**
11018
+ * @description Verification error code
11019
+ * @enum {string}
11020
+ */
11021
+ error: "no_token" | "token_expired" | "fetch_failed" | "invalid_response" | "token_mismatch" | "agent_id_mismatch";
11022
+ /** @description Human-readable error description */
11023
+ message: string;
11024
+ };
11025
+ VerifyAgentRequest: {
11026
+ /**
11027
+ * @description Set to true to perform verification. Omit or false to generate/get verification token.
11028
+ * @example true
11029
+ */
11030
+ confirm?: boolean;
11031
+ };
11032
+ EntityRef: {
11033
+ /**
11034
+ * @description Entity ID (ULID format)
11035
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
11036
+ */
11037
+ pi: string;
11038
+ type?: string;
11039
+ label?: string;
11040
+ };
11041
+ JobStatusResponse: {
11042
+ /**
11043
+ * @description Entity ID (ULID format)
11044
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
11045
+ */
11046
+ id: string;
11047
+ /**
11048
+ * @description Content Identifier (CID) - content-addressed hash
11049
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
11050
+ */
11051
+ cid: string;
11052
+ /**
11053
+ * @description Job collection status
11054
+ * @example running
11055
+ * @enum {string}
11056
+ */
11057
+ status: "running" | "done" | "error";
11058
+ /**
11059
+ * Format: date-time
11060
+ * @description ISO 8601 datetime
11061
+ * @example 2025-12-26T12:00:00.000Z
11062
+ */
11063
+ started_at: string;
11064
+ /**
11065
+ * Format: date-time
11066
+ * @description ISO 8601 datetime
11067
+ * @example 2025-12-26T12:00:00.000Z
11068
+ */
11069
+ completed_at: string | null;
11070
+ agent: components["schemas"]["EntityRef"];
11071
+ target?: components["schemas"]["EntityRef"];
11072
+ main_agent?: components["schemas"]["EntityRef"];
11073
+ /**
11074
+ * @description Number of files contained in this job collection
11075
+ * @example 5
11076
+ */
11077
+ files_count: number;
11078
+ /**
11079
+ * @description Number of sub-job collections
11080
+ * @example 2
11081
+ */
11082
+ sub_jobs_count: number;
11083
+ };
9547
11084
  Event: {
9548
11085
  /**
9549
11086
  * @description Auto-increment event ID (use as cursor)
@@ -9795,13 +11332,13 @@ type components = {
9795
11332
  path: string;
9796
11333
  /**
9797
11334
  * @description Maximum number of results to return
9798
- * @default 10
9799
- * @example 10
11335
+ * @default 25
11336
+ * @example 25
9800
11337
  */
9801
11338
  k: number;
9802
11339
  /**
9803
11340
  * @description Beam width for exploration (default: k * 3)
9804
- * @example 30
11341
+ * @example 75
9805
11342
  */
9806
11343
  k_explore?: number;
9807
11344
  /**
@@ -9810,6 +11347,80 @@ type components = {
9810
11347
  */
9811
11348
  collection?: string;
9812
11349
  };
11350
+ TextPart: {
11351
+ /** @enum {string} */
11352
+ type: "text";
11353
+ text: string;
11354
+ };
11355
+ ToolPart: {
11356
+ type: string;
11357
+ toolCallId?: string;
11358
+ toolName?: string;
11359
+ args?: {
11360
+ [key: string]: unknown;
11361
+ };
11362
+ output?: unknown;
11363
+ /** @enum {string} */
11364
+ state?: "partial-call" | "call" | "output-available";
11365
+ };
11366
+ MessagePart: components["schemas"]["TextPart"] | components["schemas"]["ToolPart"] | {
11367
+ type: string;
11368
+ };
11369
+ ChatMessage: {
11370
+ id: string;
11371
+ /** @enum {string} */
11372
+ role: "user" | "assistant" | "system" | "tool";
11373
+ parts?: components["schemas"]["MessagePart"][];
11374
+ content?: string;
11375
+ };
11376
+ SendChatRequest: {
11377
+ /** @description Array of chat messages in AI SDK v5 UIMessage format */
11378
+ messages: components["schemas"]["ChatMessage"][];
11379
+ };
11380
+ ChatSession: {
11381
+ /**
11382
+ * @description Chat session ID
11383
+ * @example chat_abc123
11384
+ */
11385
+ id: string;
11386
+ /**
11387
+ * @description ISO 8601 creation timestamp
11388
+ * @example 2025-01-14T12:00:00.000Z
11389
+ */
11390
+ createdAt: string;
11391
+ /**
11392
+ * @description ISO 8601 last update timestamp
11393
+ * @example 2025-01-14T12:30:00.000Z
11394
+ */
11395
+ updatedAt: string;
11396
+ /** @description Owner user ID (Arke PI or Supabase ID) */
11397
+ ownerId: string | null;
11398
+ /**
11399
+ * @description Auto-generated chat title from first message
11400
+ * @example Help me understand the codebase...
11401
+ */
11402
+ title: string | null;
11403
+ /** @description Full message history (only included in session detail) */
11404
+ messages?: {
11405
+ id: string;
11406
+ /** @enum {string} */
11407
+ role: "user" | "assistant" | "system" | "tool";
11408
+ content: string;
11409
+ createdAt: string;
11410
+ toolInvocations?: {
11411
+ toolCallId: string;
11412
+ toolName: string;
11413
+ args?: {
11414
+ [key: string]: unknown;
11415
+ };
11416
+ result?: unknown;
11417
+ state: string;
11418
+ }[];
11419
+ }[];
11420
+ };
11421
+ ChatSessionDeleteResponse: {
11422
+ success: boolean;
11423
+ };
9813
11424
  AttestationResponse: {
9814
11425
  /**
9815
11426
  * @description Entity ID (ULID format)
@@ -9870,6 +11481,24 @@ type components = {
9870
11481
  */
9871
11482
  message: string;
9872
11483
  };
11484
+ ChainHeadResponse: {
11485
+ /**
11486
+ * @description Sequence number of the latest attestation
11487
+ * @example 784
11488
+ */
11489
+ seq: number;
11490
+ /**
11491
+ * @description Arweave transaction ID
11492
+ * @example Rxv_BpobNBUr0x5DstsAEUVxCO12hKxv7cnHnGLYp2c
11493
+ */
11494
+ tx: string;
11495
+ /**
11496
+ * Format: uri
11497
+ * @description Arweave gateway URL for direct access
11498
+ * @example https://arweave.net/Rxv_BpobNBUr0x5DstsAEUVxCO12hKxv7cnHnGLYp2c
11499
+ */
11500
+ arweave_url: string;
11501
+ };
9873
11502
  VerifyAttestationResponse: {
9874
11503
  arweave_tx: string;
9875
11504
  attestation: {