@arke-institute/sdk 2.3.9 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * Source: Arke v1 API
8
8
  * Version: 1.0.0
9
- * Generated: 2026-01-12T23:27:06.100Z
9
+ * Generated: 2026-01-14T01:00:30.186Z
10
10
  */
11
11
  type paths = {
12
12
  "/auth/register": {
@@ -2484,6 +2484,121 @@ type paths = {
2484
2484
  patch?: never;
2485
2485
  trace?: never;
2486
2486
  };
2487
+ "/entities/{id}/diff": {
2488
+ parameters: {
2489
+ query?: never;
2490
+ header?: never;
2491
+ path?: never;
2492
+ cookie?: never;
2493
+ };
2494
+ /**
2495
+ * Get diff between entity versions
2496
+ * @description Computes the difference between two versions of an entity.
2497
+ *
2498
+ * Query parameters:
2499
+ * - `from`: CID of the "from" version (defaults to prev of "to" version)
2500
+ * - `to`: CID of the "to" version (defaults to current tip)
2501
+ * - `format`: Output format - "semantic" (default) or "patch" (RFC 6902)
2502
+ *
2503
+ * Modes:
2504
+ * - No params: Compare current tip with its previous version
2505
+ * - `to` only: Compare that version with its prev
2506
+ * - `from` only: Compare from that version to current tip
2507
+ * - Both: Compare any two versions
2508
+ *
2509
+ * For version 1 entities (no previous version), "from" is null and all content appears as added.
2510
+ */
2511
+ get: {
2512
+ parameters: {
2513
+ query?: {
2514
+ /** @description CID of the "from" version. Defaults to prev of "to" version. */
2515
+ from?: string;
2516
+ /** @description CID of the "to" version. Defaults to current tip. */
2517
+ to?: string;
2518
+ /** @description Output format: "semantic" (default) or "patch" (RFC 6902) */
2519
+ format?: "semantic" | "patch";
2520
+ };
2521
+ header?: never;
2522
+ path: {
2523
+ /** @description Entity ID (ULID) */
2524
+ id: string;
2525
+ };
2526
+ cookie?: never;
2527
+ };
2528
+ requestBody?: never;
2529
+ responses: {
2530
+ /** @description Diff computed */
2531
+ 200: {
2532
+ headers: {
2533
+ [name: string]: unknown;
2534
+ };
2535
+ content: {
2536
+ "application/json": components["schemas"]["DiffResponse"];
2537
+ };
2538
+ };
2539
+ /** @description Bad Request - Invalid input */
2540
+ 400: {
2541
+ headers: {
2542
+ [name: string]: unknown;
2543
+ };
2544
+ content: {
2545
+ /**
2546
+ * @example {
2547
+ * "error": "Validation failed",
2548
+ * "details": {
2549
+ * "issues": [
2550
+ * {
2551
+ * "path": [
2552
+ * "properties",
2553
+ * "label"
2554
+ * ],
2555
+ * "message": "Required"
2556
+ * }
2557
+ * ]
2558
+ * }
2559
+ * }
2560
+ */
2561
+ "application/json": components["schemas"]["ValidationErrorResponse"];
2562
+ };
2563
+ };
2564
+ /** @description Forbidden - Insufficient permissions */
2565
+ 403: {
2566
+ headers: {
2567
+ [name: string]: unknown;
2568
+ };
2569
+ content: {
2570
+ /**
2571
+ * @example {
2572
+ * "error": "Forbidden: You do not have permission to perform this action"
2573
+ * }
2574
+ */
2575
+ "application/json": components["schemas"]["ErrorResponse"];
2576
+ };
2577
+ };
2578
+ /** @description Not Found - Resource does not exist */
2579
+ 404: {
2580
+ headers: {
2581
+ [name: string]: unknown;
2582
+ };
2583
+ content: {
2584
+ /**
2585
+ * @example {
2586
+ * "error": "Entity not found"
2587
+ * }
2588
+ */
2589
+ "application/json": components["schemas"]["ErrorResponse"];
2590
+ };
2591
+ };
2592
+ };
2593
+ };
2594
+ put?: never;
2595
+ post?: never;
2596
+ delete?: never;
2597
+ options?: never;
2598
+ head?: never;
2599
+ patch?: never;
2600
+ trace?: never;
2601
+ };
2487
2602
  "/relationships": {
2488
2603
  parameters: {
2489
2604
  query?: never;
@@ -5838,9 +5953,23 @@ type paths = {
5838
5953
  * ## Query Syntax
5839
5954
  *
5840
5955
  * ```
5841
- * ENTRY_POINT [ENTRY_FILTER] [-[RELATION]{DEPTH}-> TARGET_FILTER]...
5956
+ * [SCOPE_PREFIX] ENTRY_POINT [ENTRY_FILTER] [-[RELATION]{DEPTH}-> TARGET_FILTER]...
5842
5957
  * ```
5843
5958
  *
5959
+ * ## Scope Prefixes
5960
+ *
5961
+ * Control where semantic search looks for entry points. Default is discovery mode.
5962
+ *
5963
+ * | Prefix | Description | Example |
5964
+ * |--------|-------------|---------|
5965
+ * | (none) | **Discovery mode** (default) - find relevant collections, then search within each | `"medical notes"` |
5966
+ * | `@:collections` | Search for collections themselves | `@:collections "columbia archives"` |
5967
+ * | `@:collection(id)` | Search within a specific collection | `@:collection(01JCOLL123) "meeting"` |
5968
+ * | `@:discover` | Explicit discovery mode | `@:discover "research papers"` |
5969
+ * | `@:public` | Search public domain only | `@:public "orphaned data"` |
5970
+ *
5971
+ * **Note:** Graph traversal (hops) is always cross-collection regardless of scope.
5972
+ *
5844
5973
  * ### Entry Points
5845
5974
  *
5846
5975
  * | Syntax | Description | Example |
@@ -5862,10 +5991,11 @@ type paths = {
5862
5991
  * ### Examples
5863
5992
  *
5864
5993
  * ```
5865
- * "george washington" # Simple semantic search
5866
- * "albert einstein" type:person # With type filter
5867
- * "medical college" -[*]{,4}-> type:file # Find files connected to concept
5868
- * @01KE4ZY... -[*]{,2}-> type:person # Find people near entity
5994
+ * "george washington" # Discovery mode (default)
5995
+ * @:collections "columbia university" # Find collections
5996
+ * @:collection(01JCOLL123) "faculty meeting" # Within specific collection
5997
+ * @:discover "alice" -[*]{,2}-> type:person # Discover, then traverse
5998
+ * @01KE4ZY... -[*]{,2}-> type:person # From exact entity
5869
5999
  * ```
5870
6000
  */
5871
6001
  post: {
@@ -6202,6 +6332,364 @@ type paths = {
6202
6332
  patch?: never;
6203
6333
  trace?: never;
6204
6334
  };
6335
+ "/search/collections": {
6336
+ parameters: {
6337
+ query?: never;
6338
+ header?: never;
6339
+ path?: never;
6340
+ cookie?: never;
6341
+ };
6342
+ get?: never;
6343
+ put?: never;
6344
+ /**
6345
+ * Search collections by text
6346
+ * @description Search for collections using semantic text search.
6347
+ *
6348
+ * Use this endpoint to discover collections about a topic. Results are ranked by semantic similarity to your query.
6349
+ */
6350
+ post: {
6351
+ parameters: {
6352
+ query?: never;
6353
+ header?: never;
6354
+ path?: never;
6355
+ cookie?: never;
6356
+ };
6357
+ requestBody?: {
6358
+ content: {
6359
+ "application/json": {
6360
+ /** @description Search query text */
6361
+ query: string;
6362
+ /**
6363
+ * @description Maximum results to return
6364
+ * @default 10
6365
+ */
6366
+ limit?: number;
6367
+ /** @description Filter by collection types */
6368
+ types?: string[];
6369
+ };
6370
+ };
6371
+ };
6372
+ responses: {
6373
+ /** @description Search results */
6374
+ 200: {
6375
+ headers: {
6376
+ [name: string]: unknown;
6377
+ };
6378
+ content: {
6379
+ "application/json": {
6380
+ results: {
6381
+ pi: string;
6382
+ label: string;
6383
+ type: string;
6384
+ score: number;
6385
+ created_at?: string;
6386
+ updated_at?: string;
6387
+ }[];
6388
+ metadata: {
6389
+ query: string;
6390
+ result_count: number;
6391
+ };
6392
+ };
6393
+ };
6394
+ };
6395
+ /** @description Bad Request - Invalid input */
6396
+ 400: {
6397
+ headers: {
6398
+ [name: string]: unknown;
6399
+ };
6400
+ content: {
6401
+ /**
6402
+ * @example {
6403
+ * "error": "Validation failed",
6404
+ * "details": {
6405
+ * "issues": [
6406
+ * {
6407
+ * "path": [
6408
+ * "properties",
6409
+ * "label"
6410
+ * ],
6411
+ * "message": "Required"
6412
+ * }
6413
+ * ]
6414
+ * }
6415
+ * }
6416
+ */
6417
+ "application/json": components["schemas"]["ValidationErrorResponse"];
6418
+ };
6419
+ };
6420
+ /** @description Service Unavailable - External service not available */
6421
+ 503: {
6422
+ headers: {
6423
+ [name: string]: unknown;
6424
+ };
6425
+ content: {
6426
+ /**
6427
+ * @example {
6428
+ * "error": "Service unavailable",
6429
+ * "details": {
6430
+ * "service": "pinecone"
6431
+ * }
6432
+ * }
6433
+ */
6434
+ "application/json": components["schemas"]["ErrorResponse"];
6435
+ };
6436
+ };
6437
+ };
6438
+ };
6439
+ delete?: never;
6440
+ options?: never;
6441
+ head?: never;
6442
+ patch?: never;
6443
+ trace?: never;
6444
+ };
6445
+ "/search/entities": {
6446
+ parameters: {
6447
+ query?: never;
6448
+ header?: never;
6449
+ path?: never;
6450
+ cookie?: never;
6451
+ };
6452
+ get?: never;
6453
+ put?: never;
6454
+ /**
6455
+ * Search entities within collection(s)
6456
+ * @description Search for entities within one or more collections using semantic text search.
6457
+ *
6458
+ * Provide either `collection_pi` for a single collection or `collection_pis` for multiple collections (searched in parallel).
6459
+ *
6460
+ * Use `per_collection_limit` to ensure result diversity when searching multiple collections.
6461
+ */
6462
+ post: {
6463
+ parameters: {
6464
+ query?: never;
6465
+ header?: never;
6466
+ path?: never;
6467
+ cookie?: never;
6468
+ };
6469
+ requestBody?: {
6470
+ content: {
6471
+ "application/json": {
6472
+ /** @description Single collection PI to search within */
6473
+ collection_pi?: string;
6474
+ /** @description Multiple collection PIs to search (max 20) */
6475
+ collection_pis?: string[];
6476
+ /** @description Search query text */
6477
+ query: string;
6478
+ /**
6479
+ * @description Maximum total results to return
6480
+ * @default 20
6481
+ */
6482
+ limit?: number;
6483
+ /** @description Filter by entity types */
6484
+ types?: string[];
6485
+ /** @description Max results per collection for diversity */
6486
+ per_collection_limit?: number;
6487
+ };
6488
+ };
6489
+ };
6490
+ responses: {
6491
+ /** @description Search results */
6492
+ 200: {
6493
+ headers: {
6494
+ [name: string]: unknown;
6495
+ };
6496
+ content: {
6497
+ "application/json": {
6498
+ results: {
6499
+ pi: string;
6500
+ label: string;
6501
+ type: string;
6502
+ score: number;
6503
+ collection_pi: string;
6504
+ created_at?: string;
6505
+ updated_at?: string;
6506
+ }[];
6507
+ metadata: {
6508
+ collection_pis: string[];
6509
+ query: string;
6510
+ collections_searched: number;
6511
+ result_count: number;
6512
+ };
6513
+ };
6514
+ };
6515
+ };
6516
+ /** @description Bad Request - Invalid input */
6517
+ 400: {
6518
+ headers: {
6519
+ [name: string]: unknown;
6520
+ };
6521
+ content: {
6522
+ /**
6523
+ * @example {
6524
+ * "error": "Validation failed",
6525
+ * "details": {
6526
+ * "issues": [
6527
+ * {
6528
+ * "path": [
6529
+ * "properties",
6530
+ * "label"
6531
+ * ],
6532
+ * "message": "Required"
6533
+ * }
6534
+ * ]
6535
+ * }
6536
+ * }
6537
+ */
6538
+ "application/json": components["schemas"]["ValidationErrorResponse"];
6539
+ };
6540
+ };
6541
+ /** @description Service Unavailable - External service not available */
6542
+ 503: {
6543
+ headers: {
6544
+ [name: string]: unknown;
6545
+ };
6546
+ content: {
6547
+ /**
6548
+ * @example {
6549
+ * "error": "Service unavailable",
6550
+ * "details": {
6551
+ * "service": "pinecone"
6552
+ * }
6553
+ * }
6554
+ */
6555
+ "application/json": components["schemas"]["ErrorResponse"];
6556
+ };
6557
+ };
6558
+ };
6559
+ };
6560
+ delete?: never;
6561
+ options?: never;
6562
+ head?: never;
6563
+ patch?: never;
6564
+ trace?: never;
6565
+ };
6566
+ "/search/discover": {
6567
+ parameters: {
6568
+ query?: never;
6569
+ header?: never;
6570
+ path?: never;
6571
+ cookie?: never;
6572
+ };
6573
+ get?: never;
6574
+ put?: never;
6575
+ /**
6576
+ * Discover entities across all collections
6577
+ * @description Two-step discovery search: first finds relevant collections, then searches within them.
6578
+ *
6579
+ * Use this endpoint when you don't know which collections to search. The system will:
6580
+ * 1. Find collections semantically related to your query
6581
+ * 2. Search within each collection in parallel
6582
+ * 3. Aggregate and rank results across all collections
6583
+ *
6584
+ * Great for exploration and AI agents navigating the network.
6585
+ */
6586
+ post: {
6587
+ parameters: {
6588
+ query?: never;
6589
+ header?: never;
6590
+ path?: never;
6591
+ cookie?: never;
6592
+ };
6593
+ requestBody?: {
6594
+ content: {
6595
+ "application/json": {
6596
+ /** @description Search query text */
6597
+ query: string;
6598
+ /**
6599
+ * @description Maximum total results to return
6600
+ * @default 20
6601
+ */
6602
+ limit?: number;
6603
+ /** @description Filter by entity types */
6604
+ types?: string[];
6605
+ /**
6606
+ * @description Number of collections to search
6607
+ * @default 10
6608
+ */
6609
+ collection_limit?: number;
6610
+ /**
6611
+ * @description Max results per collection
6612
+ * @default 5
6613
+ */
6614
+ per_collection_limit?: number;
6615
+ };
6616
+ };
6617
+ };
6618
+ responses: {
6619
+ /** @description Discovery results */
6620
+ 200: {
6621
+ headers: {
6622
+ [name: string]: unknown;
6623
+ };
6624
+ content: {
6625
+ "application/json": {
6626
+ results: {
6627
+ pi: string;
6628
+ label: string;
6629
+ type: string;
6630
+ score: number;
6631
+ collection_pi: string;
6632
+ created_at?: string;
6633
+ updated_at?: string;
6634
+ }[];
6635
+ metadata: {
6636
+ query: string;
6637
+ collections_searched: number;
6638
+ result_count: number;
6639
+ };
6640
+ };
6641
+ };
6642
+ };
6643
+ /** @description Bad Request - Invalid input */
6644
+ 400: {
6645
+ headers: {
6646
+ [name: string]: unknown;
6647
+ };
6648
+ content: {
6649
+ /**
6650
+ * @example {
6651
+ * "error": "Validation failed",
6652
+ * "details": {
6653
+ * "issues": [
6654
+ * {
6655
+ * "path": [
6656
+ * "properties",
6657
+ * "label"
6658
+ * ],
6659
+ * "message": "Required"
6660
+ * }
6661
+ * ]
6662
+ * }
6663
+ * }
6664
+ */
6665
+ "application/json": components["schemas"]["ValidationErrorResponse"];
6666
+ };
6667
+ };
6668
+ /** @description Service Unavailable - External service not available */
6669
+ 503: {
6670
+ headers: {
6671
+ [name: string]: unknown;
6672
+ };
6673
+ content: {
6674
+ /**
6675
+ * @example {
6676
+ * "error": "Service unavailable",
6677
+ * "details": {
6678
+ * "service": "pinecone"
6679
+ * }
6680
+ * }
6681
+ */
6682
+ "application/json": components["schemas"]["ErrorResponse"];
6683
+ };
6684
+ };
6685
+ };
6686
+ };
6687
+ delete?: never;
6688
+ options?: never;
6689
+ head?: never;
6690
+ patch?: never;
6691
+ trace?: never;
6692
+ };
6205
6693
  "/entities/{id}/attestation": {
6206
6694
  parameters: {
6207
6695
  query?: never;
@@ -7484,6 +7972,139 @@ type components = {
7484
7972
  /** @description Whether results were truncated due to limit */
7485
7973
  truncated: boolean;
7486
7974
  };
7975
+ /** @description Metadata about the "from" version (null for version 1) */
7976
+ VersionMeta: {
7977
+ /**
7978
+ * @description Content Identifier (CID) - content-addressed hash
7979
+ * @example bafyreibug443cnd4endcwinwttw3c3dzmcl2ikht64xzn5qg56bix3usfy
7980
+ */
7981
+ cid: string;
7982
+ /**
7983
+ * @description Entity version number
7984
+ * @example 1
7985
+ */
7986
+ ver: number;
7987
+ /**
7988
+ * Format: date-time
7989
+ * @description ISO 8601 datetime
7990
+ * @example 2025-12-26T12:00:00.000Z
7991
+ */
7992
+ ts: string;
7993
+ } | null;
7994
+ PropertyChange: {
7995
+ /** @description Previous value */
7996
+ from?: unknown;
7997
+ /** @description New value */
7998
+ to?: unknown;
7999
+ };
8000
+ PropertiesChanges: {
8001
+ /**
8002
+ * @description Properties that were added
8003
+ * @example {
8004
+ * "email": "new@example.com"
8005
+ * }
8006
+ */
8007
+ added: {
8008
+ [key: string]: unknown;
8009
+ };
8010
+ /**
8011
+ * @description Properties that were removed (includes old values)
8012
+ * @example {
8013
+ * "deprecated_field": "old value"
8014
+ * }
8015
+ */
8016
+ removed: {
8017
+ [key: string]: unknown;
8018
+ };
8019
+ /**
8020
+ * @description Properties that changed
8021
+ * @example {
8022
+ * "name": {
8023
+ * "from": "Old Name",
8024
+ * "to": "New Name"
8025
+ * }
8026
+ * }
8027
+ */
8028
+ changed: {
8029
+ [key: string]: components["schemas"]["PropertyChange"];
8030
+ };
8031
+ };
8032
+ RelationshipChange: {
8033
+ predicate: string;
8034
+ peer: string;
8035
+ peer_type?: string;
8036
+ peer_label?: string;
8037
+ properties: components["schemas"]["PropertyChange"];
8038
+ };
8039
+ RelationshipsChanges: {
8040
+ /** @description Relationships that were added */
8041
+ added: {
8042
+ predicate: string;
8043
+ peer: string;
8044
+ peer_type?: string;
8045
+ peer_label?: string;
8046
+ properties?: {
8047
+ [key: string]: unknown;
8048
+ };
8049
+ }[];
8050
+ /** @description Relationships that were removed */
8051
+ removed: {
8052
+ predicate: string;
8053
+ peer: string;
8054
+ peer_type?: string;
8055
+ peer_label?: string;
8056
+ properties?: {
8057
+ [key: string]: unknown;
8058
+ };
8059
+ }[];
8060
+ /** @description Relationships with changed properties */
8061
+ changed: components["schemas"]["RelationshipChange"][];
8062
+ };
8063
+ SemanticChanges: {
8064
+ properties: components["schemas"]["PropertiesChanges"];
8065
+ relationships: components["schemas"]["RelationshipsChanges"];
8066
+ };
8067
+ SemanticDiffResponse: {
8068
+ /**
8069
+ * @description Entity ID (ULID format)
8070
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
8071
+ */
8072
+ entity_id: string;
8073
+ from: components["schemas"]["VersionMeta"];
8074
+ to: components["schemas"]["VersionMeta"];
8075
+ /** @enum {string} */
8076
+ format: "semantic";
8077
+ changes: components["schemas"]["SemanticChanges"];
8078
+ };
8079
+ PatchOperation: {
8080
+ /** @enum {string} */
8081
+ op: "add";
8082
+ path: string;
8083
+ value?: unknown;
8084
+ } | {
8085
+ /** @enum {string} */
8086
+ op: "remove";
8087
+ path: string;
8088
+ } | {
8089
+ /** @enum {string} */
8090
+ op: "replace";
8091
+ path: string;
8092
+ value?: unknown;
8093
+ };
8094
+ PatchDiffResponse: {
8095
+ /**
8096
+ * @description Entity ID (ULID format)
8097
+ * @example 01KDETYWYWM0MJVKM8DK3AEXPY
8098
+ */
8099
+ entity_id: string;
8100
+ from: components["schemas"]["VersionMeta"];
8101
+ to: components["schemas"]["VersionMeta"];
8102
+ /** @enum {string} */
8103
+ format: "patch";
8104
+ /** @description RFC 6902 JSON Patch operations */
8105
+ patch: components["schemas"]["PatchOperation"][];
8106
+ };
8107
+ DiffResponse: components["schemas"]["SemanticDiffResponse"] | components["schemas"]["PatchDiffResponse"];
7487
8108
  AddRelationshipResponse: {
7488
8109
  source: components["schemas"]["EntityResponse"] & unknown;
7489
8110
  target?: components["schemas"]["EntityResponse"] & unknown;