techne-sdk 0.10.0 → 0.12.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 (35) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/README.md +89 -6
  3. package/dist/auth/app-key.d.ts +2 -1
  4. package/dist/auth/app-key.js +2 -1
  5. package/dist/catalog/catalog.gen.js +320 -25
  6. package/dist/connect.d.ts +5 -2
  7. package/dist/generated/lexicons.d.ts +74 -20
  8. package/dist/generated/lexicons.js +42 -10
  9. package/dist/generated/nsid.d.ts +5 -0
  10. package/dist/generated/nsid.js +5 -0
  11. package/dist/generated/nsid.json +5 -0
  12. package/dist/generated/types/pub/techne/draft/identity/createCollective.d.ts +4 -1
  13. package/dist/generated/types/pub/techne/draft/identity/createCollective.js +7 -0
  14. package/dist/generated/types/pub/techne/draft/orgAtPlace.d.ts +2 -2
  15. package/dist/generated/types/pub/techne/draft/place.d.ts +4 -0
  16. package/dist/generated/types/pub/techne/draft/query/composeRecords.d.ts +2 -2
  17. package/dist/generated/types/pub/techne/draft/query/countRecords.d.ts +6 -0
  18. package/dist/generated/types/pub/techne/draft/query/countRecords.js +14 -0
  19. package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +7 -1
  20. package/dist/generated/types/pub/techne/draft/query/listRecords.js +14 -0
  21. package/dist/item.d.ts +3 -1
  22. package/dist/item.js +1 -1
  23. package/dist/query/hosts.d.ts +1 -1
  24. package/dist/query/hosts.js +5 -3
  25. package/dist/query/index.d.ts +32 -5
  26. package/dist/read/index.js +5 -4
  27. package/dist/session/own-session.d.ts +6 -6
  28. package/dist/session/own-session.js +45 -44
  29. package/dist/session/phone.d.ts +27 -8
  30. package/dist/session/phone.js +73 -14
  31. package/dist/session/relay.d.ts +23 -0
  32. package/dist/session/relay.js +44 -0
  33. package/dist/wasm/techne-wasm.gen.js +1 -1
  34. package/dist/wasm/techne-wasm2js.gen.js +21892 -21892
  35. package/package.json +1 -1
@@ -6415,7 +6415,7 @@ export const catalog = {
6415
6415
  "properties": {
6416
6416
  "founderMembershipVisibility": {
6417
6417
  "type": "string",
6418
- "knownValues": [
6418
+ "enum": [
6419
6419
  "public",
6420
6420
  "members"
6421
6421
  ],
@@ -6450,7 +6450,11 @@ export const catalog = {
6450
6450
  "errors": [
6451
6451
  {
6452
6452
  "name": "InvalidRequest",
6453
- "description": "HTTP 400. The input is not JSON, or `founderMembershipVisibility` is neither `public` nor `members`."
6453
+ "description": "HTTP 400, and nothing is made. The input does not parse: it is not JSON, it has a field this input does not name (a `roster` from an older shape, say), or `founderMembershipVisibility` is neither `public` nor `members`. An empty body is the defaults."
6454
+ },
6455
+ {
6456
+ "name": "PublicWriteFailed",
6457
+ "description": "HTTP 502. The account was made but its founding membership could not be written, so the platform starts deleting the account again before it answers. The caller may retry."
6454
6458
  },
6455
6459
  {
6456
6460
  "name": "RateLimitExceeded",
@@ -10129,10 +10133,11 @@ export const catalog = {
10129
10133
  "name": "role",
10130
10134
  "type": "string (enum)",
10131
10135
  "required": false,
10132
- "description": "What the place is to the organization. Values beyond the known set are permitted.",
10136
+ "description": "What the place is to the organization: `office`, `storefront`, or `operator` (the organization runs or maintains the place, such as a park's conservancy or a community fridge's host). Values beyond the known set are permitted.",
10133
10137
  "knownValues": [
10134
10138
  "office",
10135
- "storefront"
10139
+ "storefront",
10140
+ "operator"
10136
10141
  ]
10137
10142
  },
10138
10143
  {
@@ -10144,7 +10149,7 @@ export const catalog = {
10144
10149
  "doc": ({
10145
10150
  "lexicon": 1,
10146
10151
  "id": "pub.techne.draft.orgAtPlace",
10147
- "description": "A relationship: an organization is at a place (its office or its storefront). Draft tier, PUBLIC. Its own record, not a field on either end, because an org can be at many places, a place can hold many orgs, and someone in particular claims each link (lexicon constitution, rule 2).",
10152
+ "description": "A relationship: an organization is at a place (its office, its storefront, or a place it operates). Draft tier, PUBLIC. Its own record, not a field on either end, because an org can be at many places, a place can hold many orgs, and someone in particular claims each link (lexicon constitution, rule 2).",
10148
10153
  "defs": {
10149
10154
  "main": {
10150
10155
  "type": "record",
@@ -10173,9 +10178,10 @@ export const catalog = {
10173
10178
  "maxLength": 64,
10174
10179
  "knownValues": [
10175
10180
  "office",
10176
- "storefront"
10181
+ "storefront",
10182
+ "operator"
10177
10183
  ],
10178
- "description": "What the place is to the organization. Values beyond the known set are permitted."
10184
+ "description": "What the place is to the organization: `office`, `storefront`, or `operator` (the organization runs or maintains the place, such as a park's conservancy or a community fridge's host). Values beyond the known set are permitted."
10179
10185
  },
10180
10186
  "createdAt": {
10181
10187
  "type": "string",
@@ -11254,6 +11260,18 @@ export const catalog = {
11254
11260
  "required": false,
11255
11261
  "description": "Named links associated with this place, such as its website. Data-source credits belong in a separate attribution record."
11256
11262
  },
11263
+ {
11264
+ "name": "openingHours",
11265
+ "type": "string",
11266
+ "required": false,
11267
+ "description": "When the place is open, in OpenStreetMap `opening_hours` syntax (https://wiki.openstreetmap.org/wiki/Key:opening_hours), e.g. `Mo-Fr 09:00-17:00; Sa 10:00-14:00; PH off`. Local time at the place. A source's hours that do not parse as that syntax may be kept as it wrote them; a reader that cannot parse the value shows it as text. Absent when unknown, never a guess."
11268
+ },
11269
+ {
11270
+ "name": "description",
11271
+ "type": "string",
11272
+ "required": false,
11273
+ "description": "Prose about the place: what it is and what happens there. PUBLIC, like the rest of this record. Text a source allows only behind a permission belongs in the permissioned pub.techne.draft.description, not here."
11274
+ },
11257
11275
  {
11258
11276
  "name": "sameAs",
11259
11277
  "type": "array<→ pub.techne.draft.place#externalRef>",
@@ -11320,6 +11338,18 @@ export const catalog = {
11320
11338
  "ref": "community.lexicon.calendar.event#uri"
11321
11339
  }
11322
11340
  },
11341
+ "openingHours": {
11342
+ "type": "string",
11343
+ "maxLength": 1024,
11344
+ "maxGraphemes": 512,
11345
+ "description": "When the place is open, in OpenStreetMap `opening_hours` syntax (https://wiki.openstreetmap.org/wiki/Key:opening_hours), e.g. `Mo-Fr 09:00-17:00; Sa 10:00-14:00; PH off`. Local time at the place. A source's hours that do not parse as that syntax may be kept as it wrote them; a reader that cannot parse the value shows it as text. Absent when unknown, never a guess."
11346
+ },
11347
+ "description": {
11348
+ "type": "string",
11349
+ "maxLength": 30000,
11350
+ "maxGraphemes": 3000,
11351
+ "description": "Prose about the place: what it is and what happens there. PUBLIC, like the rest of this record. Text a source allows only behind a permission belongs in the permissioned pub.techne.draft.description, not here."
11352
+ },
11323
11353
  "sameAs": {
11324
11354
  "type": "array",
11325
11355
  "description": "External identity reconciliation — an ARRAY so a provider reissuance (e.g. a GERS id change) appends, never destroys. Absent/empty for app-created entries — NEVER a placeholder id.",
@@ -12580,10 +12610,27 @@ export const catalog = {
12580
12610
  "key": "any",
12581
12611
  "description": "A query over indexed records, as data: sent inline to pub.techne.draft.query.listRecords or countRecords, or published as a record in an app's own repo and run by its URI, so what an app reads is public. The platform runs it only over what the caller may read: every query is scoped to the viewer by the platform (public records not hidden; permissioned records the caller's own, or in a space whose read policy admits the caller now and not an act the reach limit withholds for its author: a held share or circle add), so there is no operator for access. Values that start with `$` are parameters: `$viewer` (the caller: compared with a DID, it matches any DID of the caller's person now, every account linked with the signed-in one, or only the signed-in DID while a sign-in method of one of them is frozen) and `$now` (the instant of the call) are filled by the platform, any other the caller passes in `params`; a published query is a template. Each record type declares which of its fields fill the shared roles in its `{collection}.query` document; a type with none is still listable by the roles every record has (`type`, `author`, `space`, `subject`, `written`, `uri`). Before running, the platform checks that every top-level `any` branch is driven by an index and refuses, naming the branch, if not. A feed is a query plus the signals it asks for plus its `weights`, which only the client applies. Draft tier.",
12582
12612
  "fields": [
12613
+ {
12614
+ "name": "view",
12615
+ "type": "string (enum)",
12616
+ "required": false,
12617
+ "description": "Which public records the branches of `where` read: `curated` (the commons' listed records: one curated record per thing, merged from its sources by a curator the commons root trusts, moderated, not hidden; an event only inside the supported areas) or `asWritten` (every public record as its author wrote it: each source copy and the curated record, not hidden, not superseded). Required with `where`, never beside `any` (each branch names its own there): there is no default. `curated` on a branch whose `type` names a type no curator covers is refused with NotCurated, naming the type. A permissioned record is read the same way in both views (it is never curated). Beacon builds from before views, which name none, are answered with the old default through 2027-03-01 (the last day).",
12618
+ "knownValues": [
12619
+ "curated",
12620
+ "asWritten"
12621
+ ]
12622
+ },
12583
12623
  {
12584
12624
  "name": "where",
12585
12625
  "type": "→ #node",
12586
- "required": true
12626
+ "required": false,
12627
+ "description": "What to select; with `view`. Give `where` or `any`, not both."
12628
+ },
12629
+ {
12630
+ "name": "any",
12631
+ "type": "array<→ #branch>",
12632
+ "required": false,
12633
+ "description": "Branches, each naming its own view, for a list that reads curated records of one kind and records as written of another in one request (a feed of curated events and beacons). A record that matches two branches comes once. Instead of `where` and `view`."
12587
12634
  },
12588
12635
  {
12589
12636
  "name": "signals",
@@ -12613,7 +12660,7 @@ export const catalog = {
12613
12660
  "name": "curated",
12614
12661
  "type": "boolean",
12615
12662
  "required": false,
12616
- "description": "A list across authors answers curated public records (the commons' listed records); false asks for public records as written. A list scoped to named authors, subjects or URIs answers as written either way."
12663
+ "description": "Deprecated: `view` replaced it. It has no default. Accepted beside `view` only when it agrees (true with `curated`, false with `asWritten`); alone, it is refused like a missing view, except from Beacon builds from before views through 2027-03-01, where true or absent reads unscoped branches curated and false reads every branch as written."
12617
12664
  },
12618
12665
  {
12619
12666
  "name": "held",
@@ -12643,13 +12690,30 @@ export const catalog = {
12643
12690
  "key": "any",
12644
12691
  "record": {
12645
12692
  "type": "object",
12646
- "required": [
12647
- "where"
12648
- ],
12649
12693
  "properties": {
12694
+ "view": {
12695
+ "type": "string",
12696
+ "maxLength": 16,
12697
+ "knownValues": [
12698
+ "curated",
12699
+ "asWritten"
12700
+ ],
12701
+ "description": "Which public records the branches of `where` read: `curated` (the commons' listed records: one curated record per thing, merged from its sources by a curator the commons root trusts, moderated, not hidden; an event only inside the supported areas) or `asWritten` (every public record as its author wrote it: each source copy and the curated record, not hidden, not superseded). Required with `where`, never beside `any` (each branch names its own there): there is no default. `curated` on a branch whose `type` names a type no curator covers is refused with NotCurated, naming the type. A permissioned record is read the same way in both views (it is never curated). Beacon builds from before views, which name none, are answered with the old default through 2027-03-01 (the last day)."
12702
+ },
12650
12703
  "where": {
12651
12704
  "type": "ref",
12652
- "ref": "#node"
12705
+ "ref": "#node",
12706
+ "description": "What to select; with `view`. Give `where` or `any`, not both."
12707
+ },
12708
+ "any": {
12709
+ "type": "array",
12710
+ "minLength": 1,
12711
+ "maxLength": 8,
12712
+ "items": {
12713
+ "type": "ref",
12714
+ "ref": "#branch"
12715
+ },
12716
+ "description": "Branches, each naming its own view, for a list that reads curated records of one kind and records as written of another in one request (a feed of curated events and beacons). A record that matches two branches comes once. Instead of `where` and `view`."
12653
12717
  },
12654
12718
  "signals": {
12655
12719
  "type": "array",
@@ -12680,8 +12744,7 @@ export const catalog = {
12680
12744
  },
12681
12745
  "curated": {
12682
12746
  "type": "boolean",
12683
- "default": true,
12684
- "description": "A list across authors answers curated public records (the commons' listed records); false asks for public records as written. A list scoped to named authors, subjects or URIs answers as written either way."
12747
+ "description": "Deprecated: `view` replaced it. It has no default. Accepted beside `view` only when it agrees (true with `curated`, false with `asWritten`); alone, it is refused like a missing view, except from Beacon builds from before views through 2027-03-01, where true or absent reads unscoped branches curated and false reads every branch as written."
12685
12748
  },
12686
12749
  "held": {
12687
12750
  "type": "boolean",
@@ -12704,6 +12767,29 @@ export const catalog = {
12704
12767
  }
12705
12768
  }
12706
12769
  },
12770
+ "branch": {
12771
+ "type": "object",
12772
+ "required": [
12773
+ "view",
12774
+ "where"
12775
+ ],
12776
+ "description": "One branch of a query's `any`: its view and what it selects. A `where` whose top is itself an `any` makes one branch of each child, all in this view.",
12777
+ "properties": {
12778
+ "view": {
12779
+ "type": "string",
12780
+ "maxLength": 16,
12781
+ "knownValues": [
12782
+ "curated",
12783
+ "asWritten"
12784
+ ],
12785
+ "description": "This branch's view: as the query's `view`."
12786
+ },
12787
+ "where": {
12788
+ "type": "ref",
12789
+ "ref": "#node"
12790
+ }
12791
+ }
12792
+ },
12707
12793
  "node": {
12708
12794
  "type": "object",
12709
12795
  "description": "One node of the `where` tree: exactly one property. `all` (every child holds), `any` (at least one holds; at the top level each child is a branch the platform runs on its own index), `not` (a list of one node that must not hold; it narrows and never drives a branch), `has` (some other record names this one; it narrows and never drives a branch), or a leaf naming one role with one condition. A leaf that produces a number (`near`, `matches`) is allowed only at the top of a branch.",
@@ -13348,7 +13434,7 @@ export const catalog = {
13348
13434
  },
13349
13435
  "curated": {
13350
13436
  "type": "boolean",
13351
- "description": "A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Absent otherwise."
13437
+ "description": "A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Always answered when the step's `envelope` includes it (or names none): false for every other record."
13352
13438
  },
13353
13439
  "held": {
13354
13440
  "type": "boolean",
@@ -13375,7 +13461,7 @@ export const catalog = {
13375
13461
  "properties": {
13376
13462
  "error": {
13377
13463
  "type": "string",
13378
- "description": "The error name the step's method would answer (InvalidRequest, NotFound, ...); InvalidRequest for a step past a call limit (#stepError); or `Skipped`: a step it binds to failed."
13464
+ "description": "The error name the step's method would answer (InvalidRequest, NotFound, ViewRequired and NotCurated for a list step, ...); InvalidRequest for a step past a call limit (#stepError); or `Skipped`: a step it binds to failed."
13379
13465
  },
13380
13466
  "message": {
13381
13467
  "type": "string",
@@ -13464,6 +13550,14 @@ export const catalog = {
13464
13550
  "name": "InvalidRequest",
13465
13551
  "description": "HTTP 400. A malformed or refused query or parameter."
13466
13552
  },
13553
+ {
13554
+ "name": "ViewRequired",
13555
+ "description": "HTTP 400. A branch of the query names no `view` (curated or asWritten): there is no default. The message names the branch."
13556
+ },
13557
+ {
13558
+ "name": "NotCurated",
13559
+ "description": "HTTP 400. A branch read with view `curated` names a type (`type is`/`type in`) no curator the commons root trusts covers; the message names the type. Read it with view `asWritten`."
13560
+ },
13467
13561
  {
13468
13562
  "name": "NotFound",
13469
13563
  "description": "HTTP 404. `queryUri` names no query record the caller may read."
@@ -13493,14 +13587,14 @@ export const catalog = {
13493
13587
  "name": "draft.query.getRecords",
13494
13588
  "group": "pub.techne",
13495
13589
  "kind": "query",
13496
- "description": "Records by URI, as listRecords answers them: the query `{\"where\": {\"uri\": {\"in\": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the curated record it resolves to instead (see `curated`). Draft tier.",
13590
+ "description": "Records by URI, as listRecords answers them: the query `{\"view\": \"asWritten\", \"where\": {\"uri\": {\"in\": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the curated record it resolves to instead (see `curated`). Draft tier.",
13497
13591
  "doc": ({
13498
13592
  "lexicon": 1,
13499
13593
  "id": "pub.techne.draft.query.getRecords",
13500
13594
  "defs": {
13501
13595
  "main": {
13502
13596
  "type": "query",
13503
- "description": "Records by URI, as listRecords answers them: the query `{\"where\": {\"uri\": {\"in\": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the curated record it resolves to instead (see `curated`). Draft tier.",
13597
+ "description": "Records by URI, as listRecords answers them: the query `{\"view\": \"asWritten\", \"where\": {\"uri\": {\"in\": uris}}}`, as written (a read scoped to named records), each only if the caller may read it. A URI the caller may not read, or that names nothing, is left out: as in every generic read, that includes a record whose author is blocked either way with a signed-in caller (see `includeBlockedByMe`), or whose account is hidden or suspended. In the order asked. With `curated`, each URI answers as the curated record it resolves to instead (see `curated`). Draft tier.",
13504
13598
  "parameters": {
13505
13599
  "type": "params",
13506
13600
  "required": [
@@ -13724,14 +13818,14 @@ export const catalog = {
13724
13818
  "name": "draft.query.listRecords",
13725
13819
  "group": "pub.techne",
13726
13820
  "kind": "query",
13727
- "description": "The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned record is answered only when it is the caller's own or counts in a space whose read policy admits the caller now, not taken down (in a space whose authority is the caller, a block does not hide its records from them), and (in a member-owned circle space) only while its author is a current member by a claim the caller can read. A branch scoped to named authors, subjects or URIs, and a query with `curated: false`, answers public records as written; any other branch crosses sources and answers curated public records (the commons' listed records). A curated record every source of which is by a hidden or suspended account is left out for everyone, and one every source of which is by an author blocked either way is left out for a signed-in caller. Anyone may call it, signed in or not; an anonymous caller gets public records only. Each top-level `any` branch runs on its own index and the branches are merged in order, so a record that matches two branches comes once. A permissioned record, and a public record answered as written, is answered only while the platform's `decide` calls its version valid, and because that check runs on the page already read, a page can hold fewer records than `limit` and still carry a cursor: keep paging until none comes back. Draft tier.",
13821
+ "description": "The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned record is answered only when it is the caller's own or counts in a space whose read policy admits the caller now, not taken down (in a space whose authority is the caller, a block does not hide its records from them), and (in a member-owned circle space) only while its author is a current member by a claim the caller can read. Each branch reads the public records of the view it names (the query's `view`, or its branch's in `any`, `pub.techne.draft.query#branch`): `asWritten`, every record as its author wrote it, or `curated`, the commons' listed records; there is no default (ViewRequired), and a curated branch naming a type no curator covers is refused (NotCurated). A curated record every source of which is by a hidden or suspended account is left out for everyone, and one every source of which is by an author blocked either way is left out for a signed-in caller. Anyone may call it, signed in or not; an anonymous caller gets public records only. Each top-level `any` branch runs on its own index and the branches are merged in order, so a record that matches two branches comes once. A permissioned record, and a public record answered as written, is answered only while the platform's `decide` calls its version valid, and because that check runs on the page already read, a page can hold fewer records than `limit` and still carry a cursor: keep paging until none comes back. Draft tier.",
13728
13822
  "doc": ({
13729
13823
  "lexicon": 1,
13730
13824
  "id": "pub.techne.draft.query.listRecords",
13731
13825
  "defs": {
13732
13826
  "main": {
13733
13827
  "type": "query",
13734
- "description": "The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned record is answered only when it is the caller's own or counts in a space whose read policy admits the caller now, not taken down (in a space whose authority is the caller, a block does not hide its records from them), and (in a member-owned circle space) only while its author is a current member by a claim the caller can read. A branch scoped to named authors, subjects or URIs, and a query with `curated: false`, answers public records as written; any other branch crosses sources and answers curated public records (the commons' listed records). A curated record every source of which is by a hidden or suspended account is left out for everyone, and one every source of which is by an author blocked either way is left out for a signed-in caller. Anyone may call it, signed in or not; an anonymous caller gets public records only. Each top-level `any` branch runs on its own index and the branches are merged in order, so a record that matches two branches comes once. A permissioned record, and a public record answered as written, is answered only while the platform's `decide` calls its version valid, and because that check runs on the page already read, a page can hold fewer records than `limit` and still carry a cursor: keep paging until none comes back. Draft tier.",
13828
+ "description": "The platform's generic list query: one page of the records a pub.techne.draft.query names, in its order. Every record is read through the platform's one read path, whatever the query says: no record of a hidden or suspended account is answered, nor, to a signed-in caller, another's record across a block either way (the caller blocked its author, or its author blocked the caller); a public record also leaves out anything moderation holds back (a trusted verdict or `!takedown`); a permissioned record is answered only when it is the caller's own or counts in a space whose read policy admits the caller now, not taken down (in a space whose authority is the caller, a block does not hide its records from them), and (in a member-owned circle space) only while its author is a current member by a claim the caller can read. Each branch reads the public records of the view it names (the query's `view`, or its branch's in `any`, `pub.techne.draft.query#branch`): `asWritten`, every record as its author wrote it, or `curated`, the commons' listed records; there is no default (ViewRequired), and a curated branch naming a type no curator covers is refused (NotCurated). A curated record every source of which is by a hidden or suspended account is left out for everyone, and one every source of which is by an author blocked either way is left out for a signed-in caller. Anyone may call it, signed in or not; an anonymous caller gets public records only. Each top-level `any` branch runs on its own index and the branches are merged in order, so a record that matches two branches comes once. A permissioned record, and a public record answered as written, is answered only while the platform's `decide` calls its version valid, and because that check runs on the page already read, a page can hold fewer records than `limit` and still carry a cursor: keep paging until none comes back. Draft tier.",
13735
13829
  "parameters": {
13736
13830
  "type": "params",
13737
13831
  "properties": {
@@ -13803,6 +13897,14 @@ export const catalog = {
13803
13897
  "name": "InvalidRequest",
13804
13898
  "description": "HTTP 400. A malformed or refused query (naming the branch or condition), parameter or cursor."
13805
13899
  },
13900
+ {
13901
+ "name": "ViewRequired",
13902
+ "description": "HTTP 400. A branch of the query names no `view` (curated or asWritten): there is no default. The message names the branch."
13903
+ },
13904
+ {
13905
+ "name": "NotCurated",
13906
+ "description": "HTTP 400. A branch read with view `curated` names a type (`type is`/`type in`) no curator the commons root trusts covers; the message names the type. Read it with view `asWritten`."
13907
+ },
13806
13908
  {
13807
13909
  "name": "NotFound",
13808
13910
  "description": "HTTP 404. `queryUri` names no query record the caller may read."
@@ -13863,7 +13965,7 @@ export const catalog = {
13863
13965
  },
13864
13966
  "curated": {
13865
13967
  "type": "boolean",
13866
- "description": "A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Absent otherwise."
13968
+ "description": "A public record that is a live curated record: a curator the commons root trusts merged it from its sources, and it is not superseded. Its `pub.techne.draft.provenance` (same author, subject this record) names who it is from. Always answered: false for every other record (a source copy, a superseded one, a permissioned one)."
13867
13969
  },
13868
13970
  "held": {
13869
13971
  "type": "boolean",
@@ -17989,14 +18091,14 @@ export const catalog = {
17989
18091
  }
17990
18092
  }),
17991
18093
  "policyNsid": "pub.techne.draft.space.private.policy",
17992
- "policyDescription": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a caller with none reaches every one), not from this policy.",
18094
+ "policyDescription": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a call whose token carries no scope claim at all reaches every one; one whose claim, from Techne's ePDS, names no `space:` scope reaches none), not from this policy.",
17993
18095
  "policyDoc": ({
17994
18096
  "lexicon": 1,
17995
18097
  "id": "pub.techne.draft.space.private.policy",
17996
18098
  "defs": {
17997
18099
  "main": {
17998
18100
  "type": "spacePolicy",
17999
- "description": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a caller with none reaches every one), not from this policy.",
18101
+ "description": "Access policy for pub.techne.draft.space.private: owner only, all capabilities. Which of the owner's apps reach an instance follows from the call's `space:` scopes (a call whose token carries no scope claim at all reaches every one; one whose claim, from Techne's ePDS, names no `space:` scope reaches none), not from this policy.",
18000
18102
  "policy": {
18001
18103
  "read": {
18002
18104
  "$type": "pub.techne.draft.policy#authorityOnly"
@@ -18796,6 +18898,104 @@ export const catalog = {
18796
18898
  }
18797
18899
  })
18798
18900
  },
18901
+ {
18902
+ "nsid": "social.scenius.ackOwnLinkRedemptions",
18903
+ "name": "ackOwnLinkRedemptions",
18904
+ "group": "social.scenius",
18905
+ "kind": "procedure",
18906
+ "class": "write",
18907
+ "description": "The caller's own app has acted on these redemptions from social.scenius.listOwnLinkRedemptions: they are not listed again. Each is named by its link id and redeemer. Only the caller's own rows the platform left to its app and not yet acked are acked; any other entry (another account's, unknown, already acked) is ignored. Idempotent.",
18908
+ "input": [
18909
+ {
18910
+ "name": "redemptions",
18911
+ "type": "array<→ #redemptionRef>",
18912
+ "required": true
18913
+ },
18914
+ {
18915
+ "name": "app",
18916
+ "type": "string",
18917
+ "required": false,
18918
+ "description": "Only rows of links labelled with this `app`, as listOwnLinkRedemptions' `app`; others named are ignored. Omitted: any app's."
18919
+ }
18920
+ ],
18921
+ "output": [
18922
+ {
18923
+ "name": "acked",
18924
+ "type": "integer",
18925
+ "required": true,
18926
+ "description": "How many rows this call acked."
18927
+ }
18928
+ ],
18929
+ "doc": ({
18930
+ "lexicon": 1,
18931
+ "id": "social.scenius.ackOwnLinkRedemptions",
18932
+ "defs": {
18933
+ "main": {
18934
+ "type": "procedure",
18935
+ "description": "The caller's own app has acted on these redemptions from social.scenius.listOwnLinkRedemptions: they are not listed again. Each is named by its link id and redeemer. Only the caller's own rows the platform left to its app and not yet acked are acked; any other entry (another account's, unknown, already acked) is ignored. Idempotent.",
18936
+ "input": {
18937
+ "encoding": "application/json",
18938
+ "schema": {
18939
+ "type": "object",
18940
+ "required": [
18941
+ "redemptions"
18942
+ ],
18943
+ "properties": {
18944
+ "redemptions": {
18945
+ "type": "array",
18946
+ "minLength": 1,
18947
+ "maxLength": 200,
18948
+ "items": {
18949
+ "type": "ref",
18950
+ "ref": "#redemptionRef"
18951
+ }
18952
+ },
18953
+ "app": {
18954
+ "type": "string",
18955
+ "minLength": 1,
18956
+ "maxLength": 256,
18957
+ "description": "Only rows of links labelled with this `app`, as listOwnLinkRedemptions' `app`; others named are ignored. Omitted: any app's."
18958
+ }
18959
+ }
18960
+ }
18961
+ },
18962
+ "output": {
18963
+ "encoding": "application/json",
18964
+ "schema": {
18965
+ "type": "object",
18966
+ "required": [
18967
+ "acked"
18968
+ ],
18969
+ "properties": {
18970
+ "acked": {
18971
+ "type": "integer",
18972
+ "minimum": 0,
18973
+ "description": "How many rows this call acked."
18974
+ }
18975
+ }
18976
+ }
18977
+ }
18978
+ },
18979
+ "redemptionRef": {
18980
+ "type": "object",
18981
+ "required": [
18982
+ "link",
18983
+ "redeemer"
18984
+ ],
18985
+ "properties": {
18986
+ "link": {
18987
+ "type": "string",
18988
+ "description": "The link's id at the identity PDS."
18989
+ },
18990
+ "redeemer": {
18991
+ "type": "string",
18992
+ "format": "did"
18993
+ }
18994
+ }
18995
+ }
18996
+ }
18997
+ })
18998
+ },
18799
18999
  {
18800
19000
  "nsid": "social.scenius.addBeaconAudience",
18801
19001
  "name": "addBeaconAudience",
@@ -29311,6 +29511,101 @@ export const catalog = {
29311
29511
  }
29312
29512
  })
29313
29513
  },
29514
+ {
29515
+ "nsid": "social.scenius.listOwnLinkRedemptions",
29516
+ "name": "listOwnLinkRedemptions",
29517
+ "group": "social.scenius",
29518
+ "kind": "query",
29519
+ "class": "read",
29520
+ "description": "The redemptions of the caller's links that the platform left to the caller's own app and the app has not acked yet, newest first, at most 200. For an account whose app holds its own session the platform writes nothing as the account because someone tapped one of its links: a redemption of a link with no grant whose target is a record in the caller's own repo (a contact link, to a saved person, `contact`; or a share link to another record of the caller's, which an app with its own session makes without a grant), whichever build made it, or of an older build's link whose grant writes as the caller (an app's share link) is closed with nothing written, and listed here. A grantless link whose target is a DID (a personal \"add me\" link) is never listed, nor is a collective's link (its grant writes as the collective and is released). These are the rows the platform closed that way, not ones it acted on; a later revoke of the link does not remove a row. The app acts on each row itself, in the foreground, as the account (bind the contact to the redeemer; share the link's target with the redeemer), whichever device or build made the link, then acks it with social.scenius.ackOwnLinkRedemptions. An unacked row is listed again on the next call; an acked row never is, so something the owner removed later is not written back. A repeat redemption of a reusable link is listed again. A redemption by the caller (any account of the caller's person) or across a block either way is never listed: a row that becomes so after it was closed is acked by this call and left out. Says nothing about the target as it is now: the app reads it at its home before it writes, and writes only where nothing is there yet. An unacked row is kept up to 366 days after the platform received it, an acked one 30 days.",
29521
+ "params": [
29522
+ {
29523
+ "name": "app",
29524
+ "type": "string",
29525
+ "required": false,
29526
+ "description": "Only redemptions of links whose maker labelled them with this `app` (createLinkToken's `app`). Omitted: every app's. The platform cannot tell on its own which app a row is for (a link's `app` is its maker's label, not an OAuth client), so an app passes the label it makes its links with and acks with the same `app`; rows another app of the account leaves unacked then never fill its 200."
29527
+ }
29528
+ ],
29529
+ "output": [
29530
+ {
29531
+ "name": "redemptions",
29532
+ "type": "array<→ #redemption>",
29533
+ "required": true
29534
+ }
29535
+ ],
29536
+ "doc": ({
29537
+ "lexicon": 1,
29538
+ "id": "social.scenius.listOwnLinkRedemptions",
29539
+ "defs": {
29540
+ "main": {
29541
+ "type": "query",
29542
+ "description": "The redemptions of the caller's links that the platform left to the caller's own app and the app has not acked yet, newest first, at most 200. For an account whose app holds its own session the platform writes nothing as the account because someone tapped one of its links: a redemption of a link with no grant whose target is a record in the caller's own repo (a contact link, to a saved person, `contact`; or a share link to another record of the caller's, which an app with its own session makes without a grant), whichever build made it, or of an older build's link whose grant writes as the caller (an app's share link) is closed with nothing written, and listed here. A grantless link whose target is a DID (a personal \"add me\" link) is never listed, nor is a collective's link (its grant writes as the collective and is released). These are the rows the platform closed that way, not ones it acted on; a later revoke of the link does not remove a row. The app acts on each row itself, in the foreground, as the account (bind the contact to the redeemer; share the link's target with the redeemer), whichever device or build made the link, then acks it with social.scenius.ackOwnLinkRedemptions. An unacked row is listed again on the next call; an acked row never is, so something the owner removed later is not written back. A repeat redemption of a reusable link is listed again. A redemption by the caller (any account of the caller's person) or across a block either way is never listed: a row that becomes so after it was closed is acked by this call and left out. Says nothing about the target as it is now: the app reads it at its home before it writes, and writes only where nothing is there yet. An unacked row is kept up to 366 days after the platform received it, an acked one 30 days.",
29543
+ "parameters": {
29544
+ "type": "params",
29545
+ "properties": {
29546
+ "app": {
29547
+ "type": "string",
29548
+ "minLength": 1,
29549
+ "maxLength": 256,
29550
+ "description": "Only redemptions of links whose maker labelled them with this `app` (createLinkToken's `app`). Omitted: every app's. The platform cannot tell on its own which app a row is for (a link's `app` is its maker's label, not an OAuth client), so an app passes the label it makes its links with and acks with the same `app`; rows another app of the account leaves unacked then never fill its 200."
29551
+ }
29552
+ }
29553
+ },
29554
+ "output": {
29555
+ "encoding": "application/json",
29556
+ "schema": {
29557
+ "type": "object",
29558
+ "required": [
29559
+ "redemptions"
29560
+ ],
29561
+ "properties": {
29562
+ "redemptions": {
29563
+ "type": "array",
29564
+ "items": {
29565
+ "type": "ref",
29566
+ "ref": "#redemption"
29567
+ }
29568
+ }
29569
+ }
29570
+ }
29571
+ }
29572
+ },
29573
+ "redemption": {
29574
+ "type": "object",
29575
+ "required": [
29576
+ "link",
29577
+ "app",
29578
+ "target",
29579
+ "redeemer",
29580
+ "redeemedAt"
29581
+ ],
29582
+ "properties": {
29583
+ "link": {
29584
+ "type": "string",
29585
+ "description": "The link's id at the identity PDS. With `redeemer`, what ackOwnLinkRedemptions takes."
29586
+ },
29587
+ "app": {
29588
+ "type": "string",
29589
+ "description": "The app the link was made for, as its maker labelled it."
29590
+ },
29591
+ "target": {
29592
+ "type": "string",
29593
+ "format": "uri",
29594
+ "description": "The link's target, as made: an AT-URI of a record in the caller's repo (a `contact` for a contact link, else the record a share link is for), or for an older build's grant link what its grant is for, an AT-URI or DID of the caller."
29595
+ },
29596
+ "redeemer": {
29597
+ "type": "string",
29598
+ "format": "did"
29599
+ },
29600
+ "redeemedAt": {
29601
+ "type": "string",
29602
+ "format": "datetime"
29603
+ }
29604
+ }
29605
+ }
29606
+ }
29607
+ })
29608
+ },
29314
29609
  {
29315
29610
  "nsid": "social.scenius.matchAsk",
29316
29611
  "name": "matchAsk",
@@ -34768,6 +35063,6 @@ export const catalog = {
34768
35063
  "records": 162,
34769
35064
  "spaces": 13,
34770
35065
  "predicates": 9,
34771
- "methods": 130
35066
+ "methods": 132
34772
35067
  }
34773
35068
  };
package/dist/connect.d.ts CHANGED
@@ -33,7 +33,10 @@ export interface Session {
33
33
  did: string;
34
34
  fetchHandler: FetchHandler;
35
35
  }
36
- /** What `connect` and `connectHosted` take beside the session. */
36
+ /** What `connect` and `connectHosted` take beside the session. There is no `plcUrl` here: a signed-in
37
+ * client reaches the platform through the user's PDS (`atproto-proxy`), and the PDS resolves the
38
+ * platform's DID at its own PLC directory, so staging's did:plc platform needs nothing more. Only
39
+ * `connectAnonymous`, which resolves the DID itself, takes one ({@link AnonymousOptions.plcUrl}). */
37
40
  export interface ConnectOptions {
38
41
  /**
39
42
  * The claims the app holds (the commons root, the credentials and declarations it has read): every
@@ -64,7 +67,7 @@ export type WriteAsCollectiveInput = PubTechneDraftIdentityWriteAsCollective.Inp
64
67
  export type WriteAsCollectiveOutput = PubTechneDraftIdentityWriteAsCollective.OutputSchema;
65
68
  /** The SDK's client for one signed-in user: its clients, its reads and its writes. */
66
69
  export interface Techne extends Clients {
67
- /** One page of a query document; a list across authors answers curated records. Valid items by default
70
+ /** One page of a query document, in the view it names (`curated` or `asWritten`). Valid items by default
68
71
  * (`ValidItem<T>`); `{ include: 'all' }` any verdict (`Item<T>`). */
69
72
  query<Q extends Query, O extends QueryOpts = {}>(q: Q, opts?: O): Promise<Page<RecordOfQuery<Q>, IncludeOf<O>>>;
70
73
  /** One record: the curated view by default, `{ prefer: 'mine' }` the user's own version, `{ exact: true }`