@segmentstream/ontology 0.147.0 → 0.149.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +24 -15
  3. package/dist/analyze.d.ts +11 -3
  4. package/dist/analyze.js +21 -4
  5. package/dist/connection.d.ts +20 -3
  6. package/dist/connection.js +36 -8
  7. package/dist/diagnostics.d.ts +3 -3
  8. package/dist/diagnostics.js +1 -0
  9. package/dist/files.d.ts +21 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +2 -2
  12. package/dist/internal/diagnostics.js +3 -0
  13. package/dist/manifest.d.ts +125 -77
  14. package/dist/manifest.js +34 -2
  15. package/dist/migrate/model.d.ts +68 -56
  16. package/dist/migrate/plan.js +1 -1
  17. package/dist/migrate/preview.js +4 -1
  18. package/dist/migrate/storage.d.ts +15 -3
  19. package/dist/migrate/storage.js +86 -3
  20. package/dist/runtime/agents.js +2 -0
  21. package/dist/runtime/chat-messages.d.ts +233 -0
  22. package/dist/runtime/chat-messages.js +523 -0
  23. package/dist/runtime/pipeline.js +1 -0
  24. package/dist/service/agent/archive-routes.d.ts +2 -0
  25. package/dist/service/agent/archive-routes.js +2 -1
  26. package/dist/service/agent/chat-archive.d.ts +12 -3
  27. package/dist/service/agent/chat-archive.js +5 -1
  28. package/dist/service/agent/chat-message-routes.d.ts +124 -0
  29. package/dist/service/agent/chat-message-routes.js +235 -0
  30. package/dist/service/agent/server.d.ts +5 -1
  31. package/dist/service/agent/server.js +15 -0
  32. package/dist/service/chat/local-reads.d.ts +71 -0
  33. package/dist/service/chat/local-reads.js +148 -0
  34. package/dist/service/chat/reads.js +7 -0
  35. package/dist/service/chat/routes.js +4 -1
  36. package/dist/service/chat/schemas.d.ts +5 -0
  37. package/dist/service/chat/schemas.js +5 -0
  38. package/dist/service/connection-stream.d.ts +7 -0
  39. package/dist/service/connection-stream.js +9 -1
  40. package/dist/service/connections.js +56 -5
  41. package/dist/service/cron-secret.d.ts +6 -0
  42. package/dist/service/cron-secret.js +14 -0
  43. package/dist/service/discovery-search.d.ts +1 -1
  44. package/dist/service/mcp/server.js +4 -2
  45. package/dist/service/runtime-contract.d.ts +2 -0
  46. package/dist/service/schemas.d.ts +8 -2
  47. package/dist/service/service.js +4 -1
  48. package/dist/service/workflows.js +6 -12
  49. package/dist/storage/sessions.js +26 -0
  50. package/package.json +1 -1
@@ -100,8 +100,13 @@ import { type ResolvedGuest, type ResolvedSignInOptions, type SignInPolicy } fro
100
100
  * older publication check refuses the scheme. A signature may carry `generated: true` instead of
101
101
  * `secret`: the platform derives the webhook's secret. Older readers find no secret name; an older
102
102
  * publication check refuses it.
103
+ * Version 16 changes no other field: it marks an SDK whose service keeps the chats' messages in
104
+ * the workspace's own database and purges them at `/api/ontology/agent/chats/purge`, so
105
+ * publication adds a daily cron for that route. Within version 16, `chat` may carry
106
+ * `retention_days`, written only when declared, and then also without a channel: how many days
107
+ * the workspace keeps its chats' messages. Older readers ignore it and keep them 365 days.
103
108
  */
104
- export declare const MANIFEST_VERSION = 15;
109
+ export declare const MANIFEST_VERSION = 16;
105
110
  /** The phrase used for a direction the author did not phrase. */
106
111
  export declare const DEFAULT_PHRASE = "has";
107
112
  export declare const SelectOptionManifest: Schema.Struct<{
@@ -1291,7 +1296,7 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1291
1296
  * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
1292
1297
  * from; no chat post goes to it, nor to another channel of its kind.
1293
1298
  */
1294
- readonly chat: Schema.optionalKey<Schema.Struct<{
1299
+ readonly chat: Schema.optionalKey<Schema.encodeKeys<Schema.Struct<{
1295
1300
  readonly telegram: Schema.optionalKey<Schema.Struct<{
1296
1301
  readonly connection: Schema.String;
1297
1302
  }>>;
@@ -1312,6 +1317,10 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1312
1317
  readonly template: Schema.optionalKey<Schema.String>;
1313
1318
  readonly separator: Schema.optionalKey<Schema.String>;
1314
1319
  }>>;
1320
+ /** How many days the workspace keeps its chats' messages; absent keeps them 365. */
1321
+ readonly retentionDays: Schema.optionalKey<Schema.Int>;
1322
+ }>, {
1323
+ readonly retentionDays: "retention_days";
1315
1324
  }>>;
1316
1325
  /**
1317
1326
  * Whose private chats join the inbox, within version 15: the wire names of their roles, the
@@ -1495,8 +1504,8 @@ export declare const OntologyManifestWire: Schema.encodeKeys<Schema.Struct<{
1495
1504
  export declare const OntologyManifest: Schema.declareConstructor<{
1496
1505
  readonly version: number;
1497
1506
  readonly roles: readonly {
1498
- readonly name: string;
1499
1507
  readonly description: string;
1508
+ readonly name: string;
1500
1509
  readonly builtIn: boolean;
1501
1510
  readonly scopes?: readonly {
1502
1511
  readonly permission: string;
@@ -1509,8 +1518,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1509
1518
  readonly hash: string;
1510
1519
  readonly entities: readonly {
1511
1520
  readonly id: string;
1512
- readonly name: string;
1513
1521
  readonly description: string;
1522
+ readonly name: string;
1514
1523
  readonly label: string;
1515
1524
  readonly properties: readonly {
1516
1525
  readonly optional: boolean;
@@ -1539,8 +1548,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1539
1548
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
1540
1549
  }[];
1541
1550
  readonly relationships: readonly {
1542
- readonly name: string;
1543
1551
  readonly description: string;
1552
+ readonly name: string;
1544
1553
  readonly to: string;
1545
1554
  readonly cardinality: "one" | "many";
1546
1555
  readonly phrase: readonly [string, string];
@@ -1558,8 +1567,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1558
1567
  readonly unique: boolean;
1559
1568
  }[];
1560
1569
  readonly actions: readonly {
1561
- readonly name: string;
1562
1570
  readonly description: string;
1571
+ readonly name: string;
1563
1572
  readonly input: {
1564
1573
  readonly [x: string]: Schema.Json;
1565
1574
  };
@@ -1588,8 +1597,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1588
1597
  readonly currency?: string | undefined;
1589
1598
  } | undefined;
1590
1599
  readonly metrics?: readonly {
1591
- readonly name: string;
1592
1600
  readonly description: string;
1601
+ readonly name: string;
1593
1602
  readonly label: string;
1594
1603
  readonly unit: "number" | "currency" | "ratio" | "percent";
1595
1604
  readonly format: "decimal" | "currency" | "percent";
@@ -1631,10 +1640,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1631
1640
  readonly template?: string | undefined;
1632
1641
  readonly separator?: string | undefined;
1633
1642
  } | undefined;
1643
+ readonly retentionDays?: number | undefined;
1634
1644
  } | undefined;
1635
1645
  readonly workflows?: readonly {
1636
- readonly name: string;
1637
1646
  readonly description: string;
1647
+ readonly name: string;
1638
1648
  readonly input: {
1639
1649
  readonly [x: string]: Schema.Json;
1640
1650
  };
@@ -1649,13 +1659,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1649
1659
  } | {
1650
1660
  readonly kind: "action";
1651
1661
  readonly entity: string;
1652
- readonly name: string;
1653
1662
  readonly description: string;
1663
+ readonly name: string;
1654
1664
  readonly action?: string | undefined;
1655
1665
  } | {
1656
1666
  readonly kind: "webhook";
1657
- readonly name: string;
1658
1667
  readonly description: string;
1668
+ readonly name: string;
1659
1669
  readonly connection?: string | undefined;
1660
1670
  readonly headers?: readonly string[] | undefined;
1661
1671
  readonly signature?: {
@@ -1825,8 +1835,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1825
1835
  };
1826
1836
  }[];
1827
1837
  readonly actions: readonly {
1828
- readonly name: string;
1829
1838
  readonly description: string;
1839
+ readonly name: string;
1830
1840
  readonly input: {
1831
1841
  readonly [x: string]: Schema.Json;
1832
1842
  };
@@ -1850,8 +1860,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1850
1860
  } | {
1851
1861
  readonly version: number;
1852
1862
  readonly roles: readonly {
1853
- readonly name: string;
1854
1863
  readonly description: string;
1864
+ readonly name: string;
1855
1865
  readonly builtIn: boolean;
1856
1866
  readonly scopes?: readonly {
1857
1867
  readonly permission: string;
@@ -1864,8 +1874,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1864
1874
  readonly hash: string;
1865
1875
  readonly entities: readonly {
1866
1876
  readonly id: string;
1867
- readonly name: string;
1868
1877
  readonly description: string;
1878
+ readonly name: string;
1869
1879
  readonly label: string;
1870
1880
  readonly properties: readonly {
1871
1881
  readonly optional: boolean;
@@ -1894,8 +1904,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1894
1904
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
1895
1905
  }[];
1896
1906
  readonly relationships: readonly {
1897
- readonly name: string;
1898
1907
  readonly description: string;
1908
+ readonly name: string;
1899
1909
  readonly to: string;
1900
1910
  readonly cardinality: "one" | "many";
1901
1911
  readonly phrase: readonly [string, string];
@@ -1913,8 +1923,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1913
1923
  readonly unique: boolean;
1914
1924
  }[];
1915
1925
  readonly actions: readonly {
1916
- readonly name: string;
1917
1926
  readonly description: string;
1927
+ readonly name: string;
1918
1928
  readonly input: {
1919
1929
  readonly [x: string]: Schema.Json;
1920
1930
  };
@@ -1943,8 +1953,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1943
1953
  readonly currency?: string | undefined;
1944
1954
  } | undefined;
1945
1955
  readonly metrics?: readonly {
1946
- readonly name: string;
1947
1956
  readonly description: string;
1957
+ readonly name: string;
1948
1958
  readonly label: string;
1949
1959
  readonly unit: "number" | "currency" | "ratio" | "percent";
1950
1960
  readonly format: "decimal" | "currency" | "percent";
@@ -1986,10 +1996,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
1986
1996
  readonly template?: string | undefined;
1987
1997
  readonly separator?: string | undefined;
1988
1998
  } | undefined;
1999
+ readonly retentionDays?: number | undefined;
1989
2000
  } | undefined;
1990
2001
  readonly workflows?: readonly {
1991
- readonly name: string;
1992
2002
  readonly description: string;
2003
+ readonly name: string;
1993
2004
  readonly input: {
1994
2005
  readonly [x: string]: Schema.Json;
1995
2006
  };
@@ -2004,13 +2015,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2004
2015
  } | {
2005
2016
  readonly kind: "action";
2006
2017
  readonly entity: string;
2007
- readonly name: string;
2008
2018
  readonly description: string;
2019
+ readonly name: string;
2009
2020
  readonly action?: string | undefined;
2010
2021
  } | {
2011
2022
  readonly kind: "webhook";
2012
- readonly name: string;
2013
2023
  readonly description: string;
2024
+ readonly name: string;
2014
2025
  readonly connection?: string | undefined;
2015
2026
  readonly headers?: readonly string[] | undefined;
2016
2027
  readonly signature?: {
@@ -2180,8 +2191,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2180
2191
  };
2181
2192
  }[];
2182
2193
  readonly actions: readonly {
2183
- readonly name: string;
2184
2194
  readonly description: string;
2195
+ readonly name: string;
2185
2196
  readonly input: {
2186
2197
  readonly [x: string]: Schema.Json;
2187
2198
  };
@@ -2205,8 +2216,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2205
2216
  }, {
2206
2217
  readonly version: number;
2207
2218
  readonly roles: readonly {
2208
- readonly name: string;
2209
2219
  readonly description: string;
2220
+ readonly name: string;
2210
2221
  readonly built_in: boolean;
2211
2222
  readonly scopes?: readonly {
2212
2223
  readonly permission: string;
@@ -2219,8 +2230,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2219
2230
  readonly hash: string;
2220
2231
  readonly entities: readonly {
2221
2232
  readonly id: string;
2222
- readonly name: string;
2223
2233
  readonly description: string;
2234
+ readonly name: string;
2224
2235
  readonly label: string;
2225
2236
  readonly properties: readonly {
2226
2237
  readonly optional: boolean;
@@ -2249,8 +2260,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2249
2260
  readonly exclude_from_replication?: boolean | undefined;
2250
2261
  }[];
2251
2262
  readonly relationships: readonly {
2252
- readonly name: string;
2253
2263
  readonly description: string;
2264
+ readonly name: string;
2254
2265
  readonly to: string;
2255
2266
  readonly cardinality: "one" | "many";
2256
2267
  readonly phrase: readonly [string, string];
@@ -2268,8 +2279,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2268
2279
  readonly unique: boolean;
2269
2280
  }[];
2270
2281
  readonly actions: readonly {
2271
- readonly name: string;
2272
2282
  readonly description: string;
2283
+ readonly name: string;
2273
2284
  readonly input: {
2274
2285
  readonly [x: string]: Schema.Json;
2275
2286
  };
@@ -2298,8 +2309,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2298
2309
  readonly currency?: string | undefined;
2299
2310
  } | undefined;
2300
2311
  readonly metrics?: readonly {
2301
- readonly name: string;
2302
2312
  readonly description: string;
2313
+ readonly name: string;
2303
2314
  readonly label: string;
2304
2315
  readonly unit: "number" | "currency" | "ratio" | "percent";
2305
2316
  readonly format: "decimal" | "currency" | "percent";
@@ -2341,10 +2352,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2341
2352
  readonly template?: string | undefined;
2342
2353
  readonly separator?: string | undefined;
2343
2354
  } | undefined;
2355
+ readonly retention_days?: number | undefined;
2344
2356
  } | undefined;
2345
2357
  readonly workflows?: readonly {
2346
- readonly name: string;
2347
2358
  readonly description: string;
2359
+ readonly name: string;
2348
2360
  readonly input: {
2349
2361
  readonly [x: string]: Schema.Json;
2350
2362
  };
@@ -2361,13 +2373,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2361
2373
  } | {
2362
2374
  readonly kind: "action";
2363
2375
  readonly entity: string;
2364
- readonly name: string;
2365
2376
  readonly description: string;
2377
+ readonly name: string;
2366
2378
  readonly action?: string | undefined;
2367
2379
  } | {
2368
2380
  readonly kind: "webhook";
2369
- readonly name: string;
2370
2381
  readonly description: string;
2382
+ readonly name: string;
2371
2383
  readonly connection?: string | undefined;
2372
2384
  readonly headers?: readonly string[] | undefined;
2373
2385
  readonly signature?: {
@@ -2498,8 +2510,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2498
2510
  };
2499
2511
  }[];
2500
2512
  readonly actions: readonly {
2501
- readonly name: string;
2502
2513
  readonly description: string;
2514
+ readonly name: string;
2503
2515
  readonly input: {
2504
2516
  readonly [x: string]: Schema.Json;
2505
2517
  };
@@ -2560,8 +2572,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2560
2572
  } | {
2561
2573
  readonly version: number;
2562
2574
  readonly roles: readonly {
2563
- readonly name: string;
2564
2575
  readonly description: string;
2576
+ readonly name: string;
2565
2577
  readonly builtIn: boolean;
2566
2578
  readonly scopes?: readonly {
2567
2579
  readonly permission: string;
@@ -2574,8 +2586,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2574
2586
  readonly hash: string;
2575
2587
  readonly entities: readonly {
2576
2588
  readonly id: string;
2577
- readonly name: string;
2578
2589
  readonly description: string;
2590
+ readonly name: string;
2579
2591
  readonly label: string;
2580
2592
  readonly properties: readonly {
2581
2593
  readonly optional: boolean;
@@ -2604,8 +2616,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2604
2616
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
2605
2617
  }[];
2606
2618
  readonly relationships: readonly {
2607
- readonly name: string;
2608
2619
  readonly description: string;
2620
+ readonly name: string;
2609
2621
  readonly to: string;
2610
2622
  readonly cardinality: "one" | "many";
2611
2623
  readonly phrase: readonly [string, string];
@@ -2623,8 +2635,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2623
2635
  readonly unique: boolean;
2624
2636
  }[];
2625
2637
  readonly actions: readonly {
2626
- readonly name: string;
2627
2638
  readonly description: string;
2639
+ readonly name: string;
2628
2640
  readonly input: {
2629
2641
  readonly [x: string]: Schema.Json;
2630
2642
  };
@@ -2653,8 +2665,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2653
2665
  readonly currency?: string | undefined;
2654
2666
  } | undefined;
2655
2667
  readonly metrics?: readonly {
2656
- readonly name: string;
2657
2668
  readonly description: string;
2669
+ readonly name: string;
2658
2670
  readonly label: string;
2659
2671
  readonly unit: "number" | "currency" | "ratio" | "percent";
2660
2672
  readonly format: "decimal" | "currency" | "percent";
@@ -2696,10 +2708,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2696
2708
  readonly template?: string | undefined;
2697
2709
  readonly separator?: string | undefined;
2698
2710
  } | undefined;
2711
+ readonly retention_days?: number | undefined;
2699
2712
  } | undefined;
2700
2713
  readonly workflows?: readonly {
2701
- readonly name: string;
2702
2714
  readonly description: string;
2715
+ readonly name: string;
2703
2716
  readonly input: {
2704
2717
  readonly [x: string]: Schema.Json;
2705
2718
  };
@@ -2716,13 +2729,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2716
2729
  } | {
2717
2730
  readonly kind: "action";
2718
2731
  readonly entity: string;
2719
- readonly name: string;
2720
2732
  readonly description: string;
2733
+ readonly name: string;
2721
2734
  readonly action?: string | undefined;
2722
2735
  } | {
2723
2736
  readonly kind: "webhook";
2724
- readonly name: string;
2725
2737
  readonly description: string;
2738
+ readonly name: string;
2726
2739
  readonly connection?: string | undefined;
2727
2740
  readonly headers?: readonly string[] | undefined;
2728
2741
  readonly signature?: {
@@ -2890,8 +2903,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
2890
2903
  };
2891
2904
  }[];
2892
2905
  readonly actions: readonly {
2893
- readonly name: string;
2894
2906
  readonly description: string;
2907
+ readonly name: string;
2895
2908
  readonly input: {
2896
2909
  readonly [x: string]: Schema.Json;
2897
2910
  };
@@ -3204,7 +3217,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3204
3217
  * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
3205
3218
  * from; no chat post goes to it, nor to another channel of its kind.
3206
3219
  */
3207
- readonly chat: Schema.optionalKey<Schema.Struct<{
3220
+ readonly chat: Schema.optionalKey<Schema.encodeKeys<Schema.Struct<{
3208
3221
  readonly telegram: Schema.optionalKey<Schema.Struct<{
3209
3222
  readonly connection: Schema.String;
3210
3223
  }>>;
@@ -3225,6 +3238,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3225
3238
  readonly template: Schema.optionalKey<Schema.String>;
3226
3239
  readonly separator: Schema.optionalKey<Schema.String>;
3227
3240
  }>>;
3241
+ /** How many days the workspace keeps its chats' messages; absent keeps them 365. */
3242
+ readonly retentionDays: Schema.optionalKey<Schema.Int>;
3243
+ }>, {
3244
+ readonly retentionDays: "retention_days";
3228
3245
  }>>;
3229
3246
  /**
3230
3247
  * Whose private chats join the inbox, within version 15: the wire names of their roles, the
@@ -3683,7 +3700,7 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3683
3700
  * with their kinds. `email`, within version 15, is the mailbox reviewed replies to mail leave
3684
3701
  * from; no chat post goes to it, nor to another channel of its kind.
3685
3702
  */
3686
- readonly chat: Schema.optionalKey<Schema.Struct<{
3703
+ readonly chat: Schema.optionalKey<Schema.encodeKeys<Schema.Struct<{
3687
3704
  readonly telegram: Schema.optionalKey<Schema.Struct<{
3688
3705
  readonly connection: Schema.String;
3689
3706
  }>>;
@@ -3704,6 +3721,10 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3704
3721
  readonly template: Schema.optionalKey<Schema.String>;
3705
3722
  readonly separator: Schema.optionalKey<Schema.String>;
3706
3723
  }>>;
3724
+ /** How many days the workspace keeps its chats' messages; absent keeps them 365. */
3725
+ readonly retentionDays: Schema.optionalKey<Schema.Int>;
3726
+ }>, {
3727
+ readonly retentionDays: "retention_days";
3707
3728
  }>>;
3708
3729
  /**
3709
3730
  * Whose private chats join the inbox, within version 15: the wire names of their roles, the
@@ -3879,8 +3900,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3879
3900
  }>]>], {
3880
3901
  readonly version: number;
3881
3902
  readonly roles: readonly {
3882
- readonly name: string;
3883
3903
  readonly description: string;
3904
+ readonly name: string;
3884
3905
  readonly builtIn: boolean;
3885
3906
  readonly scopes?: readonly {
3886
3907
  readonly permission: string;
@@ -3893,8 +3914,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3893
3914
  readonly hash: string;
3894
3915
  readonly entities: readonly {
3895
3916
  readonly id: string;
3896
- readonly name: string;
3897
3917
  readonly description: string;
3918
+ readonly name: string;
3898
3919
  readonly label: string;
3899
3920
  readonly properties: readonly {
3900
3921
  readonly optional: boolean;
@@ -3923,8 +3944,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3923
3944
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
3924
3945
  }[];
3925
3946
  readonly relationships: readonly {
3926
- readonly name: string;
3927
3947
  readonly description: string;
3948
+ readonly name: string;
3928
3949
  readonly to: string;
3929
3950
  readonly cardinality: "one" | "many";
3930
3951
  readonly phrase: readonly [string, string];
@@ -3942,8 +3963,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3942
3963
  readonly unique: boolean;
3943
3964
  }[];
3944
3965
  readonly actions: readonly {
3945
- readonly name: string;
3946
3966
  readonly description: string;
3967
+ readonly name: string;
3947
3968
  readonly input: {
3948
3969
  readonly [x: string]: Schema.Json;
3949
3970
  };
@@ -3972,8 +3993,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
3972
3993
  readonly currency?: string | undefined;
3973
3994
  } | undefined;
3974
3995
  readonly metrics?: readonly {
3975
- readonly name: string;
3976
3996
  readonly description: string;
3997
+ readonly name: string;
3977
3998
  readonly label: string;
3978
3999
  readonly unit: "number" | "currency" | "ratio" | "percent";
3979
4000
  readonly format: "decimal" | "currency" | "percent";
@@ -4015,10 +4036,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4015
4036
  readonly template?: string | undefined;
4016
4037
  readonly separator?: string | undefined;
4017
4038
  } | undefined;
4039
+ readonly retentionDays?: number | undefined;
4018
4040
  } | undefined;
4019
4041
  readonly workflows?: readonly {
4020
- readonly name: string;
4021
4042
  readonly description: string;
4043
+ readonly name: string;
4022
4044
  readonly input: {
4023
4045
  readonly [x: string]: Schema.Json;
4024
4046
  };
@@ -4033,13 +4055,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4033
4055
  } | {
4034
4056
  readonly kind: "action";
4035
4057
  readonly entity: string;
4036
- readonly name: string;
4037
4058
  readonly description: string;
4059
+ readonly name: string;
4038
4060
  readonly action?: string | undefined;
4039
4061
  } | {
4040
4062
  readonly kind: "webhook";
4041
- readonly name: string;
4042
4063
  readonly description: string;
4064
+ readonly name: string;
4043
4065
  readonly connection?: string | undefined;
4044
4066
  readonly headers?: readonly string[] | undefined;
4045
4067
  readonly signature?: {
@@ -4209,8 +4231,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4209
4231
  };
4210
4232
  }[];
4211
4233
  readonly actions: readonly {
4212
- readonly name: string;
4213
4234
  readonly description: string;
4235
+ readonly name: string;
4214
4236
  readonly input: {
4215
4237
  readonly [x: string]: Schema.Json;
4216
4238
  };
@@ -4234,8 +4256,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4234
4256
  } | {
4235
4257
  readonly version: number;
4236
4258
  readonly roles: readonly {
4237
- readonly name: string;
4238
4259
  readonly description: string;
4260
+ readonly name: string;
4239
4261
  readonly builtIn: boolean;
4240
4262
  readonly scopes?: readonly {
4241
4263
  readonly permission: string;
@@ -4248,8 +4270,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4248
4270
  readonly hash: string;
4249
4271
  readonly entities: readonly {
4250
4272
  readonly id: string;
4251
- readonly name: string;
4252
4273
  readonly description: string;
4274
+ readonly name: string;
4253
4275
  readonly label: string;
4254
4276
  readonly properties: readonly {
4255
4277
  readonly optional: boolean;
@@ -4278,8 +4300,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4278
4300
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
4279
4301
  }[];
4280
4302
  readonly relationships: readonly {
4281
- readonly name: string;
4282
4303
  readonly description: string;
4304
+ readonly name: string;
4283
4305
  readonly to: string;
4284
4306
  readonly cardinality: "one" | "many";
4285
4307
  readonly phrase: readonly [string, string];
@@ -4297,8 +4319,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4297
4319
  readonly unique: boolean;
4298
4320
  }[];
4299
4321
  readonly actions: readonly {
4300
- readonly name: string;
4301
4322
  readonly description: string;
4323
+ readonly name: string;
4302
4324
  readonly input: {
4303
4325
  readonly [x: string]: Schema.Json;
4304
4326
  };
@@ -4327,8 +4349,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4327
4349
  readonly currency?: string | undefined;
4328
4350
  } | undefined;
4329
4351
  readonly metrics?: readonly {
4330
- readonly name: string;
4331
4352
  readonly description: string;
4353
+ readonly name: string;
4332
4354
  readonly label: string;
4333
4355
  readonly unit: "number" | "currency" | "ratio" | "percent";
4334
4356
  readonly format: "decimal" | "currency" | "percent";
@@ -4370,10 +4392,11 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4370
4392
  readonly template?: string | undefined;
4371
4393
  readonly separator?: string | undefined;
4372
4394
  } | undefined;
4395
+ readonly retentionDays?: number | undefined;
4373
4396
  } | undefined;
4374
4397
  readonly workflows?: readonly {
4375
- readonly name: string;
4376
4398
  readonly description: string;
4399
+ readonly name: string;
4377
4400
  readonly input: {
4378
4401
  readonly [x: string]: Schema.Json;
4379
4402
  };
@@ -4388,13 +4411,13 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4388
4411
  } | {
4389
4412
  readonly kind: "action";
4390
4413
  readonly entity: string;
4391
- readonly name: string;
4392
4414
  readonly description: string;
4415
+ readonly name: string;
4393
4416
  readonly action?: string | undefined;
4394
4417
  } | {
4395
4418
  readonly kind: "webhook";
4396
- readonly name: string;
4397
4419
  readonly description: string;
4420
+ readonly name: string;
4398
4421
  readonly connection?: string | undefined;
4399
4422
  readonly headers?: readonly string[] | undefined;
4400
4423
  readonly signature?: {
@@ -4564,8 +4587,8 @@ export declare const OntologyManifest: Schema.declareConstructor<{
4564
4587
  };
4565
4588
  }[];
4566
4589
  readonly actions: readonly {
4567
- readonly name: string;
4568
4590
  readonly description: string;
4591
+ readonly name: string;
4569
4592
  readonly input: {
4570
4593
  readonly [x: string]: Schema.Json;
4571
4594
  };
@@ -4595,8 +4618,8 @@ export type OntologyManifest = typeof OntologyManifest.Type;
4595
4618
  export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4596
4619
  readonly version: number;
4597
4620
  readonly roles: readonly {
4598
- readonly name: string;
4599
4621
  readonly description: string;
4622
+ readonly name: string;
4600
4623
  readonly builtIn: boolean;
4601
4624
  readonly scopes?: readonly {
4602
4625
  readonly permission: string;
@@ -4609,8 +4632,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4609
4632
  readonly hash: string;
4610
4633
  readonly entities: readonly {
4611
4634
  readonly id: string;
4612
- readonly name: string;
4613
4635
  readonly description: string;
4636
+ readonly name: string;
4614
4637
  readonly label: string;
4615
4638
  readonly properties: readonly {
4616
4639
  readonly optional: boolean;
@@ -4639,8 +4662,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4639
4662
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
4640
4663
  }[];
4641
4664
  readonly relationships: readonly {
4642
- readonly name: string;
4643
4665
  readonly description: string;
4666
+ readonly name: string;
4644
4667
  readonly to: string;
4645
4668
  readonly cardinality: "one" | "many";
4646
4669
  readonly phrase: readonly [string, string];
@@ -4658,8 +4681,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4658
4681
  readonly unique: boolean;
4659
4682
  }[];
4660
4683
  readonly actions: readonly {
4661
- readonly name: string;
4662
4684
  readonly description: string;
4685
+ readonly name: string;
4663
4686
  readonly input: {
4664
4687
  readonly [x: string]: Schema.Json;
4665
4688
  };
@@ -4688,8 +4711,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4688
4711
  readonly currency?: string | undefined;
4689
4712
  } | undefined;
4690
4713
  readonly metrics?: readonly {
4691
- readonly name: string;
4692
4714
  readonly description: string;
4715
+ readonly name: string;
4693
4716
  readonly label: string;
4694
4717
  readonly unit: "number" | "currency" | "ratio" | "percent";
4695
4718
  readonly format: "decimal" | "currency" | "percent";
@@ -4731,10 +4754,11 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4731
4754
  readonly template?: string | undefined;
4732
4755
  readonly separator?: string | undefined;
4733
4756
  } | undefined;
4757
+ readonly retentionDays?: number | undefined;
4734
4758
  } | undefined;
4735
4759
  readonly workflows?: readonly {
4736
- readonly name: string;
4737
4760
  readonly description: string;
4761
+ readonly name: string;
4738
4762
  readonly input: {
4739
4763
  readonly [x: string]: Schema.Json;
4740
4764
  };
@@ -4749,13 +4773,13 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4749
4773
  } | {
4750
4774
  readonly kind: "action";
4751
4775
  readonly entity: string;
4752
- readonly name: string;
4753
4776
  readonly description: string;
4777
+ readonly name: string;
4754
4778
  readonly action?: string | undefined;
4755
4779
  } | {
4756
4780
  readonly kind: "webhook";
4757
- readonly name: string;
4758
4781
  readonly description: string;
4782
+ readonly name: string;
4759
4783
  readonly connection?: string | undefined;
4760
4784
  readonly headers?: readonly string[] | undefined;
4761
4785
  readonly signature?: {
@@ -4925,8 +4949,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4925
4949
  };
4926
4950
  }[];
4927
4951
  readonly actions: readonly {
4928
- readonly name: string;
4929
4952
  readonly description: string;
4953
+ readonly name: string;
4930
4954
  readonly input: {
4931
4955
  readonly [x: string]: Schema.Json;
4932
4956
  };
@@ -4950,8 +4974,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4950
4974
  } | {
4951
4975
  readonly version: number;
4952
4976
  readonly roles: readonly {
4953
- readonly name: string;
4954
4977
  readonly description: string;
4978
+ readonly name: string;
4955
4979
  readonly builtIn: boolean;
4956
4980
  readonly scopes?: readonly {
4957
4981
  readonly permission: string;
@@ -4964,8 +4988,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4964
4988
  readonly hash: string;
4965
4989
  readonly entities: readonly {
4966
4990
  readonly id: string;
4967
- readonly name: string;
4968
4991
  readonly description: string;
4992
+ readonly name: string;
4969
4993
  readonly label: string;
4970
4994
  readonly properties: readonly {
4971
4995
  readonly optional: boolean;
@@ -4994,8 +5018,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
4994
5018
  readonly items?: "number" | "boolean" | "email" | "text" | "url" | "date" | "timestamp" | "select" | "integer" | "json" | "blob" | "list" | undefined;
4995
5019
  }[];
4996
5020
  readonly relationships: readonly {
4997
- readonly name: string;
4998
5021
  readonly description: string;
5022
+ readonly name: string;
4999
5023
  readonly to: string;
5000
5024
  readonly cardinality: "one" | "many";
5001
5025
  readonly phrase: readonly [string, string];
@@ -5013,8 +5037,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
5013
5037
  readonly unique: boolean;
5014
5038
  }[];
5015
5039
  readonly actions: readonly {
5016
- readonly name: string;
5017
5040
  readonly description: string;
5041
+ readonly name: string;
5018
5042
  readonly input: {
5019
5043
  readonly [x: string]: Schema.Json;
5020
5044
  };
@@ -5043,8 +5067,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
5043
5067
  readonly currency?: string | undefined;
5044
5068
  } | undefined;
5045
5069
  readonly metrics?: readonly {
5046
- readonly name: string;
5047
5070
  readonly description: string;
5071
+ readonly name: string;
5048
5072
  readonly label: string;
5049
5073
  readonly unit: "number" | "currency" | "ratio" | "percent";
5050
5074
  readonly format: "decimal" | "currency" | "percent";
@@ -5086,10 +5110,11 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
5086
5110
  readonly template?: string | undefined;
5087
5111
  readonly separator?: string | undefined;
5088
5112
  } | undefined;
5113
+ readonly retentionDays?: number | undefined;
5089
5114
  } | undefined;
5090
5115
  readonly workflows?: readonly {
5091
- readonly name: string;
5092
5116
  readonly description: string;
5117
+ readonly name: string;
5093
5118
  readonly input: {
5094
5119
  readonly [x: string]: Schema.Json;
5095
5120
  };
@@ -5104,13 +5129,13 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
5104
5129
  } | {
5105
5130
  readonly kind: "action";
5106
5131
  readonly entity: string;
5107
- readonly name: string;
5108
5132
  readonly description: string;
5133
+ readonly name: string;
5109
5134
  readonly action?: string | undefined;
5110
5135
  } | {
5111
5136
  readonly kind: "webhook";
5112
- readonly name: string;
5113
5137
  readonly description: string;
5138
+ readonly name: string;
5114
5139
  readonly connection?: string | undefined;
5115
5140
  readonly headers?: readonly string[] | undefined;
5116
5141
  readonly signature?: {
@@ -5280,8 +5305,8 @@ export declare const decodeManifestDocument: (value: unknown) => Effect.Effect<{
5280
5305
  };
5281
5306
  }[];
5282
5307
  readonly actions: readonly {
5283
- readonly name: string;
5284
5308
  readonly description: string;
5309
+ readonly name: string;
5285
5310
  readonly input: {
5286
5311
  readonly [x: string]: Schema.Json;
5287
5312
  };
@@ -5315,6 +5340,25 @@ export declare function signInPolicyOf(manifest: Pick<OntologyManifest, "signIn"
5315
5340
  * the channel is closed to sign-up: not a channel this reader knows, or no well-formed entry.
5316
5341
  */
5317
5342
  export declare function signUpRolesOf(manifest: Pick<OntologyManifest, "signIn">, channel: string): ReadonlyArray<string> | undefined;
5343
+ /**
5344
+ * `chat.retentionDays` of `defineOntology`: how many days the workspace keeps its chats' messages,
5345
+ * a whole number in this range; 365 when the ontology declares none.
5346
+ */
5347
+ export declare const CHAT_RETENTION_DAYS: {
5348
+ readonly default: 365;
5349
+ readonly minimum: 1;
5350
+ readonly maximum: 3650;
5351
+ };
5352
+ /**
5353
+ * The days the ontology declares it keeps its chats' messages, as {@link chatRetentionDaysOf}
5354
+ * reads them; `undefined` when it declares none.
5355
+ */
5356
+ export declare function declaredChatRetentionDaysOf(manifest: Pick<OntologyManifest, "chat">): number | undefined;
5357
+ /**
5358
+ * How many days the workspace keeps its chats' messages: `chat.retentionDays` where it is a whole
5359
+ * number in range, else the default.
5360
+ */
5361
+ export declare function chatRetentionDaysOf(manifest: Pick<OntologyManifest, "chat">): number;
5318
5362
  /** The wire names of the roles whose people's private chats join the inbox; empty without one. */
5319
5363
  export declare function inboxRolesOf(manifest: Pick<OntologyManifest, "inbox">): ReadonlySet<string>;
5320
5364
  /** The channels whose private chats staff may take over from the agent; empty without any. */
@@ -5355,7 +5399,10 @@ export declare function manifestHash(manifest: Readonly<Record<string, unknown>>
5355
5399
  * aggregates, top-level or inside arithmetic: `check` lets them name one property at most.
5356
5400
  */
5357
5401
  export declare function metricsManifest(resolved: ResolvedEntity): ReadonlyArray<MetricManifest>;
5358
- /** `chat` as the manifest writes it: the channel of each kind, the other channels, attribution. */
5402
+ /**
5403
+ * `chat` as the manifest writes it: the channel of each kind, the other channels, attribution, and
5404
+ * how long the chats' messages are kept.
5405
+ */
5359
5406
  export interface ChatManifestInput {
5360
5407
  readonly telegram?: {
5361
5408
  readonly connection: string;
@@ -5374,6 +5421,7 @@ export interface ChatManifestInput {
5374
5421
  readonly connection?: string;
5375
5422
  }>>;
5376
5423
  readonly attribution?: ChatAttributionSettings;
5424
+ readonly retentionDays?: number;
5377
5425
  }
5378
5426
  /** Builds the manifest of a resolved ontology that passed `check`. */
5379
5427
  export declare function buildManifest(input: {