techne-sdk 0.2.0 → 0.3.1

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 (68) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +21 -4
  3. package/dist/auth/app-key.d.ts +8 -0
  4. package/dist/auth/app-key.js +95 -0
  5. package/dist/auth/index.d.ts +60 -12
  6. package/dist/auth/index.js +79 -14
  7. package/dist/auth/placement.gen.d.ts +1 -1
  8. package/dist/auth/placement.gen.js +1 -0
  9. package/dist/catalog/catalog.gen.js +2147 -667
  10. package/dist/connect.d.ts +4 -1
  11. package/dist/connect.js +7 -3
  12. package/dist/generated/index.d.ts +61 -0
  13. package/dist/generated/index.js +116 -0
  14. package/dist/generated/lexicons.d.ts +3670 -1430
  15. package/dist/generated/lexicons.js +1228 -33
  16. package/dist/generated/nsid.d.ts +23 -1
  17. package/dist/generated/nsid.js +23 -19
  18. package/dist/generated/nsid.json +23 -19
  19. package/dist/generated/records.d.ts +28 -26
  20. package/dist/generated/types/pub/techne/draft/commons/getVersions.d.ts +3 -3
  21. package/dist/generated/types/pub/techne/draft/commons/runChain.d.ts +1 -1
  22. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.d.ts +5 -0
  23. package/dist/generated/types/pub/techne/draft/permissioned/deleteRecord.js +7 -0
  24. package/dist/generated/types/pub/techne/draft/permissioned/getRecord.d.ts +2 -1
  25. package/dist/generated/types/pub/techne/draft/permissioned/listChanges.d.ts +1 -1
  26. package/dist/generated/types/pub/techne/draft/permissioned/putRecord.d.ts +2 -2
  27. package/dist/generated/types/pub/techne/draft/query/composeRecords.d.ts +152 -0
  28. package/dist/generated/types/pub/techne/draft/query/composeRecords.js +55 -0
  29. package/dist/generated/types/pub/techne/draft/query/getRecords.d.ts +1 -1
  30. package/dist/generated/types/pub/techne/draft/query/listRecords.d.ts +0 -4
  31. package/dist/generated/types/pub/techne/draft/query/listRejections.d.ts +2 -2
  32. package/dist/generated/types/pub/techne/draft/registry/blockIndex.d.ts +42 -0
  33. package/dist/generated/types/pub/techne/draft/registry/blockIndex.js +34 -0
  34. package/dist/generated/types/pub/techne/draft/registry/defs.d.ts +112 -0
  35. package/dist/generated/types/pub/techne/draft/registry/defs.js +32 -0
  36. package/dist/generated/types/pub/techne/draft/registry/getType.d.ts +23 -0
  37. package/dist/generated/types/pub/techne/draft/registry/getType.js +20 -0
  38. package/dist/generated/types/pub/techne/draft/registry/getTypeRequest.d.ts +23 -0
  39. package/dist/generated/types/pub/techne/draft/registry/getTypeRequest.js +20 -0
  40. package/dist/generated/types/pub/techne/draft/registry/listTypeRequests.d.ts +27 -0
  41. package/dist/generated/types/pub/techne/draft/registry/listTypeRequests.js +7 -0
  42. package/dist/generated/types/pub/techne/draft/registry/listTypes.d.ts +34 -0
  43. package/dist/generated/types/pub/techne/draft/registry/listTypes.js +7 -0
  44. package/dist/generated/types/pub/techne/draft/registry/publishType.d.ts +77 -0
  45. package/dist/generated/types/pub/techne/draft/registry/publishType.js +83 -0
  46. package/dist/generated/types/pub/techne/draft/registry/purgeType.d.ts +39 -0
  47. package/dist/generated/types/pub/techne/draft/registry/purgeType.js +34 -0
  48. package/dist/generated/types/pub/techne/draft/registry/requestType.d.ts +53 -0
  49. package/dist/generated/types/pub/techne/draft/registry/requestType.js +76 -0
  50. package/dist/generated/types/pub/techne/draft/registry/typeRequest.d.ts +22 -0
  51. package/dist/generated/types/pub/techne/draft/registry/typeRequest.js +12 -0
  52. package/dist/generated/types/pub/techne/draft/sync/indexRecord.d.ts +1 -1
  53. package/dist/generated/types/pub/techne/draft/verdict.d.ts +2 -2
  54. package/dist/put/index.d.ts +5 -1
  55. package/dist/put/index.js +33 -10
  56. package/dist/query/index.d.ts +1 -10
  57. package/dist/query/index.js +1 -1
  58. package/dist/types-cli/emit.d.ts +20 -0
  59. package/dist/types-cli/emit.js +217 -0
  60. package/dist/types-cli/main.d.ts +5 -0
  61. package/dist/types-cli/main.js +63 -0
  62. package/dist/types-cli/resolve.d.ts +26 -0
  63. package/dist/types-cli/resolve.js +99 -0
  64. package/dist/wasm/index.d.ts +6 -1
  65. package/dist/wasm/index.js +6 -1
  66. package/dist/wasm/techne-wasm.gen.js +1 -1
  67. package/dist/wasm/techne-wasm2js.gen.js +19782 -19763
  68. package/package.json +11 -4
package/CHANGELOG.md CHANGED
@@ -3,6 +3,115 @@
3
3
  `techne-sdk` on npm and the `techne-sdk` crate share a version. Each entry names what changes for an app or
4
4
  a crate user.
5
5
 
6
+ ## Unreleased
7
+
8
+ - **A private record must name its space.** The platform now refuses a `permissioned.putRecord(s)` write
9
+ with no `space` (400 `InvalidRequest`; lucian 2026-11-09). `put` checks first: a record that is written
10
+ privately (a type with no public home) and names no `space` throws `PutError` with `InvalidRequest`, and
11
+ nothing is written. A record only the person reads goes in their own `space.personal`
12
+ (`at://{did}/pub.techne.draft.space.personal/self`). Public records are unchanged. The generated types
13
+ follow when the lexicons pin moves to the tag that carries the change (v0.1.22-techne.62).
14
+
15
+ ## 0.3.1
16
+
17
+ Fixes found by a developer building on 0.3.0 from the public docs alone (techne.computer, 2026-11-09).
18
+
19
+ - **`connect(session, platform)` works with an atproto `OAuthSession`.** It passed `session.fetchHandler`
20
+ on unbound, and an `OAuthSession`'s is a method that reads its own token set, so the first call threw
21
+ `Cannot read properties of undefined (reading 'getTokenSet')`. It now calls it on the session. The doc
22
+ comment names the platform DID as `did:web:techne.computer` (`TECHNE_PLATFORM_DID`).
23
+ - **`put` writes a community draft (`pub.techne.draft.c.*`) to the user's repo.** It counted the community
24
+ namespace as the platform's own and sent those records to the private batch write. A community draft
25
+ record is public now, like another app's own type; with a `space` it is private, as any record.
26
+ - **`scopes({ publish: true })`** (and `signIn`, `clientMetadata`): adds
27
+ `rpc:pub.techne.draft.registry.publishType` at the platform, so an app can publish its own community
28
+ type as the signed-in person. Off by default.
29
+
30
+ ## 0.3.0
31
+
32
+ Built on lexicons `agent/devplatform` b10ae5d and the platform's published API at regenOS `e3814f0f6`
33
+ (`inputs.pin.json`). Before publishing, the lexicons pin moves to the release tag (RELEASING.md: a tag,
34
+ never a branch).
35
+
36
+ ### Added: community and requested types
37
+
38
+ - **Registry methods** on the generated client: `pub.techne.draft.registry.publishType`, `getType`,
39
+ `listTypes`, `requestType`, `getTypeRequest`, `listTypeRequests`, `purgeType` and `blockIndex`, with
40
+ their record `pub.techne.draft.registry.typeRequest` and views in `registry.defs`.
41
+ - **`npx techne-sdk types <nsid>`** (the package's new `bin`): prints TypeScript types for any record
42
+ NSID. It asks the platform's `registry.getType` first and falls back to atproto lexicon resolution
43
+ (the authority's `_lexicon` TXT record names a DID, whose PDS holds the schema).
44
+ - **`scopes({ types })`** in `techne-sdk/auth`: an app names the types it writes (its own public types, a
45
+ community draft `pub.techne.draft.c.*`, an approved requested type), and each adds
46
+ `repo:<nsid>?action=create&action=update&action=delete`, the same scope the platform's own
47
+ least-privilege list asks for. `signIn` and `clientMetadata` take `types` too; pass the same list to
48
+ both, since the PDS refuses a request beyond what the metadata declares. A name that is not an NSID
49
+ throws a `TypeError`.
50
+ - **`appKey(clientId)` and `appSpace(did, clientId)`** in `techne-sdk/auth`: the key of the app's own
51
+ private space (the platform's `sidecar_rkey(client_id)`: base32, lowercase, no padding, of the client
52
+ id's SHA-256) and its address, `at://{did}/pub.techne.draft.space.private/{appKey}`. Write there with
53
+ `put(techne, [{ record, space }])` and read with `permissioned.listRecords({ space })`.
54
+ - **`scopes({ everything })`**: the opt-in to everything the person can reach. `'read'` adds the
55
+ `authRead` set; `'write'` adds `authRead`, `authWrite` and the `repo:` scope for the public
56
+ `community.lexicon.*` records (what the default was in 0.2.0).
57
+ - **Deletes are hinted.** `put(techne, records, { deletes })` now hints `sync.indexRecord` for each
58
+ public delete the PDS carried out, so the platform drops the record from its index without waiting for
59
+ the relay (which never brings it for a type that is not yet approved). A failed hint is ignored.
60
+ Deletes alone are `put(techne, [], { deletes })`.
61
+ - **The app's private space type** `pub.techne.draft.space.private` (one per app per person, keyed by
62
+ `appKey`) and the `pub.techne.draft.authPermissioned` permission set (the `permissioned.*` calls;
63
+ which spaces they reach is set by the `space:` scopes the app also asks for). `NSID.AUTH_PERMISSIONED`,
64
+ `NSID.SPACE_PRIVATE`.
65
+ - **`pub.techne.draft.query.composeRecords`**: up to 12 reads (`listRecords` or `getRecords` steps) in
66
+ one call, a later step binding to an earlier one's records.
67
+ - **Query `has`** (`pub.techne.draft.query#has`): a condition that some readable record names this one
68
+ through a role.
69
+ - `query.listRejections` reasons can say `budget`: a runtime type's record skipped because its author,
70
+ or the type, used up the day's indexing budget.
71
+
72
+ ### Changed
73
+
74
+ - `validate` (`techne-sdk/wasm`) knows the lexicons built into this version only. A community or
75
+ requested type answers `valid: false`, "no record lexicon"; the platform checks such records against
76
+ their lexicon when they are written. There is no `validateWith` in this release.
77
+ - `permissioned.getRecord` takes the 0016 space record address
78
+ (`at://{spaceAuthority}/space/{spaceType}/{skey}/{did}/{collection}/{rkey}`) as well as the 3-part one.
79
+
80
+ ### Changed (breaking)
81
+
82
+ - **The default sign-in scopes are narrowed to least privilege.** `scopes({ clientId })` (and so
83
+ `signIn` and `clientMetadata` without `scope`) asks for `atproto`,
84
+ `include:pub.techne.draft.authPermissioned?aud=<platform>%23atproto_appview`,
85
+ `space:pub.techne.draft.space.private?skey=<appKey>`, one
86
+ `rpc:<nsid>?aud=<platform>%23atproto_appview` for each signed-in read the SDK makes
87
+ (`query.listRecords`, `query.countRecords`, `query.getRecords`: `techne-sdk/query` and `put`'s
88
+ `curation`; `registry.getType`, `registry.listTypes`), which the platform narrows by the token's space
89
+ scopes to public data and the app's own space, and the `types` repo scopes (with
90
+ `rpc:pub.techne.draft.sync.indexRecord`, for `put`'s hint, when there are types), no longer `authRead`,
91
+ `authWrite` and the `community.lexicon.*` repo scope. `query.composeRecords` (which the SDK does not
92
+ call) still needs `everything: 'read'`. `scopes()` now needs `clientId` (it keys the
93
+ space; `TypeError` without it). An app that read or wrote beyond its own space and types passes
94
+ `everything: 'read'` or `'write'` (`everything: 'write'` is a superset of 0.2.0's default); its people re-consent
95
+ either way, since the scope changes. Without `everything: 'write'`, an app writing our public types
96
+ (a profile, an event) names them in `types`.
97
+
98
+ ### Removed (breaking)
99
+
100
+ - **`authPrivate` and the `appSpace.*` methods are gone** (they were in no published release):
101
+ `pub.techne.draft.appSpace.putRecord`, `getRecord`, `listRecords`, `deleteRecord`,
102
+ `NSID.AUTH_PRIVATE` and the `NSID.APP_SPACE_*` constants. The app's private space is an ordinary space
103
+ now: name `appSpace(did, clientId)` as the `space` of the `permissioned.*` calls (`put` does).
104
+ - **Query `include`.** `pub.techne.draft.query` no longer has `include`, and `listRecords` answers no
105
+ `included`; the platform refuses a query that names it. `Query.include` and `QueryRecord.included` are
106
+ gone from `techne-sdk/query`, and `NSID.QUERY_INCLUDE` from the NSID table. Read the related records with
107
+ `composeRecords` (one call), or a second `getRecords`.
108
+ - The old `coop.lexicon.draft.commons.*` names of methods the platform no longer serves
109
+ (`adjudicatePair`, `endorseRule`, `grantOperator`, `revokeOperator`, `revokeRule`, `restoreRecord`,
110
+ `takedownRecord`, `retireIdentity`, `unretireIdentity`) left the rename table.
111
+
112
+ The crate `techne-sdk` moves to 0.3.0 with the package (they share a version); its API is unchanged, it
113
+ builds on `techne-lexicon-check` 0.3.1.
114
+
6
115
  ## 0.2.0
7
116
 
8
117
  ### Changed: the verifier trusts operator-issued credentials (option (b))
package/README.md CHANGED
@@ -25,12 +25,12 @@ Every import goes through the package's `exports`, so the resolver has to read t
25
25
  | `techne-sdk/types/<nsid path>` | one lexicon's types, e.g. `techne-sdk/types/social/scenius/getContactInvite` |
26
26
  | `techne-sdk/react` | `useEvent(uri)`: one commons event or place as its versions, with the check's verdict |
27
27
  | `techne-sdk/versions` | the same state without React: `eventState`, `verifyAnswer`, version labels |
28
- | `techne-sdk/auth` | sign-in ("Sign in with Techne"): `signIn`, `signUp`, `restore`, `signOut`, `clientMetadata`, `scopes` (browser OAuth) |
28
+ | `techne-sdk/auth` | sign-in ("Sign in with Techne"): `signIn`, `signUp`, `restore`, `signOut`, `clientMetadata`, `scopes`, `appKey`, `appSpace` (browser OAuth) |
29
29
  | `techne-sdk/connect` | `connect(session, platform)` / `connectHosted(did, fetchHandler)`: the clients over one session |
30
- | `techne-sdk/put` | `put(techne, records, { deletes })`: the one write, deletes included |
30
+ | `techne-sdk/put` | `put(techne, records, { deletes })`: the one write, deletes included (public deletes hinted to the platform); `put(techne, [], { deletes })` for deletes alone |
31
31
  | `techne-sdk/query` | the platform's generic queries: `listRecords`, `getRecords`, hosts |
32
32
  | `techne-sdk/links` | link tokens: create, redeem, check, revoke |
33
- | `techne-sdk/wasm` | the check itself: `validate`, `decide`, `verify` |
33
+ | `techne-sdk/wasm` | the check itself: `validate`, `decide`, `verify` (`validate` knows the built-in lexicons only; a runtime type is checked by the platform on write) |
34
34
  | `techne-sdk/catalog` | the browsable lexicon catalog |
35
35
  | `techne-sdk/nsid`, `techne-sdk/nsid.json` | every NSID as a constant (`NSID`, `METHOD`) |
36
36
 
@@ -55,6 +55,20 @@ function Event({ uri }: { uri: string }) {
55
55
 
56
56
  Pass `{ claims }` too, and `verification` holds the check's answer for every record (valid, signer, chain verified).
57
57
 
58
+ ## Types for any type
59
+
60
+ The generated client covers the platform's own lexicons. For a community draft, a requested type or any other
61
+ published NSID, print its types:
62
+
63
+ ```sh
64
+ npx techne-sdk types pub.techne.draft.c.<id>.toolListing > src/toolListing.ts
65
+ ```
66
+
67
+ It asks the platform's registry (`registry.getType`) first, then atproto lexicon resolution (the NSID's
68
+ `_lexicon` TXT record, then the schema record on that DID's PDS). `--platform <url>` (or `TECHNE_PLATFORM_URL`)
69
+ picks the platform; `--out <file>` writes the file. A ref to another document comes out as `unknown`, with the
70
+ ref in a comment.
71
+
58
72
  ## Sign in with Techne
59
73
 
60
74
  `techne-sdk/auth` signs a person in from the browser. Each app is its own atproto OAuth client, the way "Sign in with Google" works: the app serves its client metadata at its client id, the person signs in at their own PDS, and the app keeps the session (an `OAuthSession`, with `did` and `fetchHandler`) that `connect` takes. It runs on `@atproto/oauth-client-browser`, loaded the first time it is used.
@@ -77,7 +91,9 @@ else {
77
91
  ```
78
92
 
79
93
  - **Who:** with no `handle`, the sign-in starts at the default PDS (techne.town), which asks who you are. A bare name (`alice`) is a handle on the default handle domain. A full handle, a DID or a PDS URL from any PDS is used as given. `signUp({ clientId })` opens the PDS's create-account screen.
80
- - **Scopes:** `scopes()` is what it asks for by default: `atproto`, the platform's `authRead` and `authWrite` permission sets with the platform as their audience, and a `repo:` scope for the public `community.lexicon.*` records. `clientMetadata` lists the same scopes, so the two always match. Pass `scope` to ask for other scopes, and pass it to both.
94
+ - **Scopes:** `scopes({ clientId })` is what it asks for by default, least privilege: `atproto`; the platform's `authPermissioned` permission set with the platform as its audience (the `permissioned.*` calls: private writes, reads and deletes); the app's own private space, `space:pub.techne.draft.space.private?skey=<appKey>`; and an `rpc:<nsid>?aud=<platform>%23atproto_appview` scope for each generic read the SDK makes signed in: `query.listRecords`, `query.countRecords` and `query.getRecords` (`techne-sdk/query`, `put`'s curation answer) and `registry.getType` and `registry.listTypes`. The platform narrows those reads by the token's space scopes, so they reach public data and the app's own space. An app passes the types it writes as `types: [nsid, ...]`, and each adds a `repo:<nsid>` scope (create, update, delete), as the platform's own least-privilege list does, plus `rpc:pub.techne.draft.sync.indexRecord` so `put` can hint the platform what it wrote (a pending type's records are indexed no other way); without `types` the app writes no public record. `query.composeRecords` is not in the default (the SDK makes no such call); an app that calls it asks for `everything: 'read'`. Everything the person can reach (their personal space, their circles, beacons shared with them) is an opt-in: `everything: 'read'` adds the `authRead` set, `everything: 'write'` adds `authRead`, `authWrite` and a `repo:` scope for the public `community.lexicon.*` records (then our own public types need no `types` entry). The consent page shows those with a large warning; ask only if the app needs them. Pass the same `types` and `everything` to `signIn` and `clientMetadata`, since the PDS refuses a request beyond what the metadata declares. Pass `scope` to ask for other scopes, and pass it to both. An app that publishes its own community type (`pub.techne.draft.c.*`) as the signed-in person passes `publish: true`, which adds `rpc:pub.techne.draft.registry.publishType` (publishing a type is a public act). The type's NSID is the registry's answer, so its `repo:` scope can be asked for only after publishing: publish once (a setup sign-in with `publish: true`), then sign in with the published NSID in `types`.
95
+ - **A private record names its space:** a record of a type with no public home is written privately, and it must name the `space` it is for; `put` throws `PutError` (`InvalidRequest`) with nothing written when one does not, as the platform's `permissioned.putRecords` refuses it. A record only the person reads goes in their own `space.personal`: `` { record, space: `at://${did}/pub.techne.draft.space.personal/self` } ``. Public records name no space and go to the person's PDS.
96
+ - **The app's private space:** `appSpace(session.did, clientId)` is `at://{did}/pub.techne.draft.space.private/{appKey}`, where `appKey(clientId)` is the client id hashed (base32, lowercase, no padding, of its SHA-256; the platform's `sidecar_rkey`). Write there with `put(techne, [{ record, space: appSpace(did, clientId) }])` and read with `permissioned.listRecords({ space })`. Only that person reads it, and only through this app. In development the client id is the loopback client's, `resolveClientId(options)` with the same options `signIn` took: it carries the scope, so it changes with the port, `types` and `everything`, and so does the space. Its scope names the space type without a key (an id cannot carry its own hash); Techne's PDS reads that keyless scope from a loopback client as its own space, adds the key when it calls the platform, and shows the own-space line on the consent page. The browser keeps one stored session per origin, so a page that switches between client ids (other `types`, another port's id) signs out first; `restore` hands back whichever session the origin holds.
81
97
  - **Development:** on `localhost` or `127.0.0.1` you can leave `clientId` out. The SDK then uses atproto's loopback client, so you don't need to host anything.
82
98
  - **Sessions:** the library refreshes tokens itself. `restore` returns the session, `null` when nobody is signed in, and rejects when a sign-in or refresh failed. `signOut({ clientId, session })` revokes the session. `onSessionDeleted` tells you when the library drops a session. A `state` passed to `signIn` comes back from `redirectState({ clientId })` on the page the redirect lands on.
83
99
  - **Another deployment:** `platform` names the platform's DID (`TECHNE_PLATFORM_DID` by default). `pds`, `plcUrl` and `handleDomain` name the PDS people sign in at, its PLC directory and its handle domain. Pass them the same way to every call.
@@ -89,6 +105,7 @@ else {
89
105
  | Path | What |
90
106
  |---|---|
91
107
  | `src/` | the TypeScript package. `src/generated/`, `src/catalog/catalog.gen.ts` and `src/wasm/*.gen.*` are generated and committed |
108
+ | `src/types-cli/` | the `techne-sdk types <nsid>` bin: resolve (`resolve.ts`), emit (`emit.ts`), golden files in `testdata/` (`UPDATE_GOLDEN=1 npm run test:types-cli`) |
92
109
  | `crates/techne-sdk/` | the Rust crate, with the shared fixtures (`fixtures/cases.json`) both languages must answer identically |
93
110
  | `inputs/` | the codegen inputs, copied by `scripts/inputs-sync.mjs` and pinned in `inputs.pin.json`: `inputs/lexicons/` (the lexicons repo at `lexicons.tag`) and `inputs/platform-api/` (the platform's routed method lexicons, the atproto methods it serves and its NSID rename map, at `platformApi.rev`) |
94
111
  | `lexicons-base/` | standard atproto repo-op lexicons the generated client needs |
@@ -0,0 +1,8 @@
1
+ /** SHA-256 (FIPS 180-4) of `bytes`. */
2
+ export declare function sha256(bytes: Uint8Array): Uint8Array;
3
+ /** The key of the app `clientId`'s private space: the platform's `sidecar_rkey(client_id)`. */
4
+ export declare function appKey(clientId: string): string;
5
+ /** The address of `did`'s private space for the app `clientId`: `at://{did}/pub.techne.draft.space.private/{appKey}`,
6
+ * the `space` a `put` or `permissioned.listRecords` names. In development (the loopback client) pass the
7
+ * loopback client id, `resolveClientId(options)`. */
8
+ export declare function appSpace(did: string, clientId: string): string;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * An app's own private space (`pub.techne.draft.space.private`): its key and address. The key is the
3
+ * platform's `sidecar_rkey(client_id)` (regenOS crates/regenos-lexicons/src/sidecar.rs): RFC 4648 base32,
4
+ * lowercase, no padding, of the SHA-256 of the client id's UTF-8 bytes. Synchronous (no WebCrypto), so
5
+ * `scopes()` and `clientMetadata()` stay synchronous.
6
+ */
7
+ import { NSID } from '../generated/nsid.js';
8
+ const K = new Uint32Array([
9
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
10
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
11
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
12
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
13
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
14
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
15
+ ]);
16
+ /** SHA-256 (FIPS 180-4) of `bytes`. */
17
+ export function sha256(bytes) {
18
+ const bitLen = bytes.length * 8;
19
+ const padded = new Uint8Array(Math.ceil((bytes.length + 9) / 64) * 64);
20
+ padded.set(bytes);
21
+ padded[bytes.length] = 0x80;
22
+ const view = new DataView(padded.buffer);
23
+ view.setUint32(padded.length - 8, Math.floor(bitLen / 2 ** 32));
24
+ view.setUint32(padded.length - 4, bitLen >>> 0);
25
+ const h = new Uint32Array([0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19]);
26
+ const w = new Uint32Array(64);
27
+ const rotr = (x, n) => (x >>> n) | (x << (32 - n));
28
+ for (let off = 0; off < padded.length; off += 64) {
29
+ for (let i = 0; i < 16; i++)
30
+ w[i] = view.getUint32(off + i * 4);
31
+ for (let i = 16; i < 64; i++) {
32
+ const s0 = rotr(w[i - 15], 7) ^ rotr(w[i - 15], 18) ^ (w[i - 15] >>> 3);
33
+ const s1 = rotr(w[i - 2], 17) ^ rotr(w[i - 2], 19) ^ (w[i - 2] >>> 10);
34
+ w[i] = w[i - 16] + s0 + w[i - 7] + s1;
35
+ }
36
+ let [a, b, c, d, e, f, g, hh] = h;
37
+ for (let i = 0; i < 64; i++) {
38
+ const t1 = (hh + (rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25)) + ((e & f) ^ (~e & g)) + K[i] + w[i]) >>> 0;
39
+ const t2 = ((rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22)) + ((a & b) ^ (a & c) ^ (b & c))) >>> 0;
40
+ hh = g;
41
+ g = f;
42
+ f = e;
43
+ e = (d + t1) >>> 0;
44
+ d = c;
45
+ c = b;
46
+ b = a;
47
+ a = (t1 + t2) >>> 0;
48
+ }
49
+ h[0] += a;
50
+ h[1] += b;
51
+ h[2] += c;
52
+ h[3] += d;
53
+ h[4] += e;
54
+ h[5] += f;
55
+ h[6] += g;
56
+ h[7] += hh;
57
+ }
58
+ const out = new Uint8Array(32);
59
+ const outView = new DataView(out.buffer);
60
+ for (let i = 0; i < 8; i++)
61
+ outView.setUint32(i * 4, h[i]);
62
+ return out;
63
+ }
64
+ /** RFC 4648 base32, lowercase, no padding (regenOS `base32_lower_nopad`). */
65
+ function base32LowerNoPad(bytes) {
66
+ const alphabet = 'abcdefghijklmnopqrstuvwxyz234567';
67
+ let out = '';
68
+ let buffer = 0;
69
+ let bits = 0;
70
+ for (const byte of bytes) {
71
+ buffer = ((buffer << 8) | byte) & 0xffff;
72
+ bits += 8;
73
+ while (bits >= 5) {
74
+ bits -= 5;
75
+ out += alphabet[(buffer >> bits) & 31];
76
+ }
77
+ }
78
+ if (bits > 0)
79
+ out += alphabet[(buffer << (5 - bits)) & 31];
80
+ return out;
81
+ }
82
+ /** The key of the app `clientId`'s private space: the platform's `sidecar_rkey(client_id)`. */
83
+ export function appKey(clientId) {
84
+ if (!clientId)
85
+ throw new TypeError('techne-sdk/auth: appKey needs the client id');
86
+ return base32LowerNoPad(sha256(new TextEncoder().encode(clientId)));
87
+ }
88
+ /** The address of `did`'s private space for the app `clientId`: `at://{did}/pub.techne.draft.space.private/{appKey}`,
89
+ * the `space` a `put` or `permissioned.listRecords` names. In development (the loopback client) pass the
90
+ * loopback client id, `resolveClientId(options)`. */
91
+ export function appSpace(did, clientId) {
92
+ if (!did.startsWith('did:'))
93
+ throw new TypeError(`techne-sdk/auth: appSpace takes a DID (got ${JSON.stringify(did)})`);
94
+ return `at://${did}/${NSID.SPACE_PRIVATE}/${appKey(clientId)}`;
95
+ }
@@ -11,11 +11,25 @@
11
11
  * const techne = connect(session, TECHNE_PLATFORM_DID)
12
12
  * ```
13
13
  *
14
- * What it asks for ({@link scopes}): `atproto`, the platform's two permission sets with the platform's
15
- * appview as their audience (`include:…authRead?aud=<platform>%23atproto_appview`, and authWrite), and a
16
- * `repo:` scope for the public homes outside our namespace (`community.lexicon.*`, which a pub.techne set
17
- * may not name), read from the placement manifest (`placement.gen.ts`). The platform is
18
- * {@link TECHNE_PLATFORM_DID} unless a `platform` option names another (a test deployment's did:plc).
14
+ * What it asks for ({@link scopes}), least privilege by default: `atproto`; the platform's
15
+ * `authPermissioned` permission set with the platform's appview as its audience
16
+ * (`include:pub.techne.draft.authPermissioned?aud=<platform>%23atproto_appview`: the `permissioned.*` calls);
17
+ * the app's own private space, `space:pub.techne.draft.space.private?skey=<appKey>` ({@link appKey}: the
18
+ * client id hashed, so the scope names this app's space and no other); `rpc:<nsid>?aud=<platform>%23atproto_appview`
19
+ * for each generic read the SDK makes signed in (`query.listRecords`, `countRecords` and
20
+ * `getRecords`, behind `techne-sdk/query` and `put`'s curation read, and `registry.getType` and `listTypes`),
21
+ * which the platform narrows by the token's space scopes to public data and the app's own space; and one `repo:<nsid>` scope
22
+ * (create, update, delete) per type the app writes, named with the `types` option, sorted, as the platform's
23
+ * own least-privilege list does (a scope names whole NSIDs only, and no published permission set can name a
24
+ * type minted after it), with `rpc:pub.techne.draft.sync.indexRecord` at the platform so `put` can hint
25
+ * what it wrote.
26
+ * Everything the person can reach (their personal space, their circles, beacons
27
+ * shared with them) is an opt-in, `everything: 'read'` (the `authRead` set) or `everything: 'write'`
28
+ * (`authRead` and `authWrite`, plus a `repo:` scope for our public homes outside our namespace,
29
+ * `community.lexicon.*`, from the placement manifest, `placement.gen.ts`); the consent page shows those
30
+ * with a large warning. Pass the same options to {@link clientMetadata} and {@link signIn}: the PDS refuses
31
+ * a request beyond what the metadata declares. The platform is {@link TECHNE_PLATFORM_DID} unless a
32
+ * `platform` option names another (a test deployment's did:plc).
19
33
  *
20
34
  * Where it starts: no handle starts at the techne.town PDS ({@link TECHNE_TOWN_PDS}), which asks who you
21
35
  * are; a bare name (`alice`) is a techne.town handle (`alice.techne.town`); a full handle, a DID or a PDS
@@ -24,9 +38,12 @@
24
38
  * option, and its PLC directory with `plcUrl`: handles then resolve at that PDS, a sign-in with no
25
39
  * handle and every sign-up start there, a bare name takes `handleDomain`, and DIDs resolve at that PLC.
26
40
  *
27
- * On localhost (or 127.0.0.1), or with no client id, the client is atproto's loopback client
28
- * (`http://localhost?redirect_uri=http://127.0.0.1:<port>/&scope=…`), so an app runs in development with
29
- * nothing hosted. A page elsewhere with no client id cannot sign in.
41
+ * On localhost (or 127.0.0.1) the client is atproto's loopback client
42
+ * (`http://localhost?redirect_uri=http://127.0.0.1:<port>/&scope=…`), with or without a client id, so an app
43
+ * runs in development with nothing hosted. A page elsewhere with no client id cannot sign in. The loopback
44
+ * id carries its scope, so its private-space scope names no key (and the consent page shows the
45
+ * private-data warning); its {@link appSpace} is keyed by the whole id ({@link resolveClientId} with the
46
+ * same options as {@link signIn}), which changes with the port and the scope.
30
47
  *
31
48
  * Restore and refresh. {@link restore} is the library's `init()`: it finishes a sign-in when the page is
32
49
  * the redirect back, else restores the session kept in IndexedDB. It does not force a refresh: the
@@ -45,6 +62,7 @@
45
62
  import type { AuthorizeOptions, OAuthSession } from '@atproto/oauth-client-browser';
46
63
  import { type OAuthClientMetadataInput } from '@atproto/oauth-types';
47
64
  import { TECHNE_PLATFORM_DID } from '../platform.js';
65
+ export { appKey, appSpace } from './app-key.js';
48
66
  export { TECHNE_PLATFORM_DID };
49
67
  export type { OAuthSession };
50
68
  /** The techne.town handle domain: a bare name signs in as `<name>.techne.town`. */
@@ -84,6 +102,12 @@ export interface ClientOptions {
84
102
  platform?: string;
85
103
  /** The scopes to ask for; {@link scopes} by default. */
86
104
  scope?: string | readonly string[];
105
+ /** The types the app writes, for the default {@link scopes} (ignored with `scope`). */
106
+ types?: readonly string[];
107
+ /** Ask for everything the person can reach, for the default {@link scopes} (ignored with `scope`). */
108
+ everything?: Everything;
109
+ /** Ask to publish community types, for the default {@link scopes} (ignored with `scope`). */
110
+ publish?: boolean;
87
111
  /** The page's location; `globalThis.location` by default. */
88
112
  location?: Pick<Location, 'protocol' | 'hostname' | 'port'>;
89
113
  /** The home PDS: where handles resolve, and where a sign-in with no handle and every sign-up start.
@@ -99,10 +123,28 @@ export interface ClientOptions {
99
123
  * `include:<nsid>?aud=<platform>%23atproto_appview`. {@link TECHNE_PLATFORM_DID} by default; another
100
124
  * platform (a local stack, a test deployment) passes its own DID. */
101
125
  export declare function includeScope(nsid: string, platform?: string): string;
102
- /** The scopes signIn asks for by default (see the module doc). */
103
- export declare function scopes({ platform }?: {
126
+ /** The opt-in to everything the person can reach: `'read'` adds the platform's `authRead` set, `'write'`
127
+ * `authRead` and `authWrite` (and the `repo:` scope for our public `community.lexicon.*` homes). */
128
+ export type Everything = 'read' | 'write';
129
+ /** What {@link scopes} takes. */
130
+ export interface ScopesOptions {
131
+ /** The app's client id: the key of its private space ({@link appKey}). */
132
+ clientId: string;
133
+ /** The platform's service DID; {@link TECHNE_PLATFORM_DID} by default. */
104
134
  platform?: string;
105
- }): string[];
135
+ /** The types the app writes: one `repo:<nsid>` scope each. */
136
+ types?: readonly string[];
137
+ /** Everything the person can reach, an opt-in (see {@link Everything}); none by default. */
138
+ everything?: Everything;
139
+ /** Ask to publish community types (`registry.publishType`), for an app that publishes its own type
140
+ * (`pub.techne.draft.c.*`) as the signed-in person. Off by default. */
141
+ publish?: boolean;
142
+ }
143
+ /** The scopes signIn asks for by default (see the module doc): least privilege, the permissioned calls,
144
+ * the app's own private space, an `rpc` scope per read in `READ_METHODS` and a `repo` scope per type
145
+ * in `types`; `everything` widens it. A name in
146
+ * `types` that is not an NSID throws a TypeError. */
147
+ export declare function scopes(o: ScopesOptions): string[];
106
148
  /** What {@link clientMetadata} takes. */
107
149
  export interface ClientMetadataOptions {
108
150
  /** The https URL the document is served at. */
@@ -114,13 +156,19 @@ export interface ClientMetadataOptions {
114
156
  logoUri?: string;
115
157
  /** The scopes, as {@link ClientOptions.scope}. */
116
158
  scope?: string | readonly string[];
159
+ /** The types the app writes, as {@link ClientOptions.types}. */
160
+ types?: readonly string[];
161
+ /** As {@link ClientOptions.everything}. */
162
+ everything?: Everything;
163
+ /** As {@link ClientOptions.publish}. */
164
+ publish?: boolean;
117
165
  platform?: string;
118
166
  }
119
167
  /** The client-metadata document an app serves at its client id: a public browser client (no secret,
120
168
  * DPoP-bound tokens), asking for {@link scopes} by default. */
121
169
  export declare function clientMetadata(o: ClientMetadataOptions): OAuthClientMetadataInput;
122
170
  /** The client id a call signs in as: the loopback client on a loopback page or with no client id, else
123
- * `clientId`. */
171
+ * `clientId`. Its {@link appSpace} is the app's private space. */
124
172
  export declare function resolveClientId(o: ClientOptions): string;
125
173
  /** Listen for the library deleting a session of this client (a refresh that failed, a revocation
126
174
  * elsewhere). Answers the unsubscribe. */
@@ -1,7 +1,10 @@
1
1
  import { buildAtprotoLoopbackClientId, isLoopbackHost } from '@atproto/oauth-types';
2
+ import { isValidNsid } from '@atproto/syntax';
2
3
  import { NSID } from '../generated/nsid.js';
3
4
  import { appviewRef, TECHNE_PLATFORM_DID } from '../platform.js';
5
+ import { appKey } from './app-key.js';
4
6
  import { PUBLIC_HOMES } from './placement.gen.js';
7
+ export { appKey, appSpace } from './app-key.js';
5
8
  export { TECHNE_PLATFORM_DID };
6
9
  /** The techne.town handle domain: a bare name signs in as `<name>.techne.town`. */
7
10
  export const TECHNE_TOWN = 'techne.town';
@@ -28,19 +31,74 @@ export function setOAuthClientFactory(make) {
28
31
  * `include:<nsid>?aud=<platform>%23atproto_appview`. {@link TECHNE_PLATFORM_DID} by default; another
29
32
  * platform (a local stack, a test deployment) passes its own DID. */
30
33
  export function includeScope(nsid, platform = TECHNE_PLATFORM_DID) {
31
- return `include:${nsid}?aud=${appviewRef(platform).replace('#', '%23')}`;
34
+ return `include:${nsid}?aud=${audParam(platform)}`;
32
35
  }
33
- /** The scopes signIn asks for by default (see the module doc). */
34
- export function scopes({ platform = TECHNE_PLATFORM_DID } = {}) {
35
- const community = PUBLIC_HOMES.filter((c) => c.startsWith(`${NSID.COMMUNITY_AUTHORITY}.`));
36
- return ['atproto', includeScope(NSID.AUTH_READ, platform), includeScope(NSID.AUTH_WRITE, platform), ...(community.length ? [repoScope(community)] : [])];
36
+ /** `platform`'s appview as a scope's `aud` value (its `#` encoded). */
37
+ const audParam = (platform) => appviewRef(platform).replace('#', '%23');
38
+ /** The platform's generic reads the SDK makes signed in (`techne-sdk/query`, `put`'s curation read through
39
+ * `getRecords`) and the registry reads: one `rpc:` scope each in the default {@link scopes}, so they work
40
+ * without `authRead`. The platform narrows them by the token's space scopes (public data and the app's
41
+ * own space). Not `composeRecords`: the SDK makes no such call (an app that does asks for `authRead`). */
42
+ const READ_METHODS = [
43
+ NSID.QUERY_LIST_RECORDS,
44
+ NSID.QUERY_COUNT_RECORDS,
45
+ NSID.QUERY_GET_RECORDS,
46
+ NSID.REGISTRY_GET_TYPE,
47
+ NSID.REGISTRY_LIST_TYPES,
48
+ ];
49
+ /** The scopes signIn asks for by default (see the module doc): least privilege, the permissioned calls,
50
+ * the app's own private space, an `rpc` scope per read in `READ_METHODS` and a `repo` scope per type
51
+ * in `types`; `everything` widens it. A name in
52
+ * `types` that is not an NSID throws a TypeError. */
53
+ export function scopes(o) {
54
+ if (!o?.clientId)
55
+ throw new TypeError('techne-sdk/auth: scopes needs the client id (its private space is keyed by it)');
56
+ return scopeList(o, skey(o.clientId));
37
57
  }
38
- /** A `repo` scope for `collections`, every action (Rust `nsid_rewrite::repo_scope`). */
58
+ /** {@link scopes}, with `space` the private-space scope's query: the app's key, or nothing for the
59
+ * loopback client (whose id is built from its scope, so the scope cannot name the id's hash). */
60
+ function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything, publish }, space) {
61
+ if (everything !== undefined && everything !== 'read' && everything !== 'write') {
62
+ throw new TypeError(`techne-sdk/auth: everything is 'read' or 'write' (got ${JSON.stringify(everything)})`);
63
+ }
64
+ for (const t of types)
65
+ if (!isValidNsid(t))
66
+ throw new TypeError(`techne-sdk/auth: a type is an NSID (got ${JSON.stringify(t)})`);
67
+ const write = everything === 'write';
68
+ const community = write ? PUBLIC_HOMES.filter((c) => c.startsWith(`${NSID.COMMUNITY_AUTHORITY}.`)) : [];
69
+ // With authWrite (and the community repo scope) our public homes are covered already.
70
+ const own = [...new Set(types)].filter((t) => !(write && PUBLIC_HOMES.includes(t))).sort();
71
+ const aud = audParam(platform);
72
+ return [
73
+ 'atproto',
74
+ includeScope(NSID.AUTH_PERMISSIONED, platform),
75
+ `space:${NSID.SPACE_PRIVATE}${space}`,
76
+ // Signed-in reads (query, put's curation read, the registry); kept with authRead, which lacks the registry.
77
+ ...READ_METHODS.map((m) => `rpc:${m}?aud=${aud}`),
78
+ ...(everything ? [includeScope(NSID.AUTH_READ, platform)] : []),
79
+ ...(write ? [includeScope(NSID.AUTH_WRITE, platform)] : []),
80
+ ...(community.length ? [repoScope(community)] : []),
81
+ ...own.map((t) => repoScope([t])),
82
+ // `put` hints each public write to the platform (the only way a pending type's records are indexed);
83
+ // authWrite carries that call, so without it an app that writes public types asks for it alone.
84
+ ...(own.length && !write ? [`rpc:${NSID.SYNC_INDEX_RECORD}?aud=${aud}`] : []),
85
+ // Publishing a community type: a public act, asked for only by an app that does it.
86
+ ...(publish ? [`rpc:${NSID.REGISTRY_PUBLISH_TYPE}?aud=${aud}`] : []),
87
+ ];
88
+ }
89
+ /** A `repo` scope for `collections`, every action (regenOS `regenos_appview::nsid_rewrite::repo_scope`,
90
+ * crates/regenos-appview/src/nsid_rewrite.rs). */
39
91
  function repoScope(collections) {
40
92
  const actions = 'action=create&action=update&action=delete';
41
93
  return collections.length === 1 ? `repo:${collections[0]}?${actions}` : `repo?${collections.map((c) => `collection=${c}`).join('&')}&${actions}`;
42
94
  }
43
- const scopeString = (o) => typeof o.scope === 'string' ? o.scope : (o.scope ?? scopes({ platform: o.platform })).join(' ');
95
+ /** The scope string a client asks for: `scope` as given, else the default with `space` as the private-space
96
+ * scope's query: `?skey=<appKey(clientId)>`, or `''` for the loopback client (its id carries its scope, so
97
+ * it cannot carry the id's own hash; the platform still admits and serves the space only for the app its
98
+ * key names, the loopback id's hash). */
99
+ const scopeString = (o, space) => (typeof o.scope === 'string' ? o.scope : (o.scope ?? scopeList(o, space)).join(' '));
100
+ /** The private-space scope's query for the https client `clientId`: its key. */
101
+ const skey = (clientId) => `?skey=${appKey(clientId)}`;
44
102
  /** The client-metadata document an app serves at its client id: a public browser client (no secret,
45
103
  * DPoP-bound tokens), asking for {@link scopes} by default. */
46
104
  export function clientMetadata(o) {
@@ -57,22 +115,28 @@ export function clientMetadata(o) {
57
115
  dpop_bound_access_tokens: true,
58
116
  grant_types: ['authorization_code', 'refresh_token'],
59
117
  response_types: ['code'],
60
- scope: scopeString(o),
118
+ scope: scopeString(o, skey(o.clientId)),
61
119
  redirect_uris: o.redirectUris ?? [`${url.origin}/`],
62
120
  };
63
121
  }
64
- /** The client id a call signs in as: the loopback client on a loopback page or with no client id, else
65
- * `clientId`. */
66
- export function resolveClientId(o) {
122
+ /** The client a call signs in as and the scope it asks for: the loopback client on a loopback page or
123
+ * with no client id, else `clientId`. */
124
+ function resolveClient(o) {
67
125
  const location = o.location ?? globalThis.location;
68
126
  if (location && isLoopbackHost(location.hostname)) {
69
127
  const host = location.hostname === 'localhost' ? '127.0.0.1' : location.hostname;
70
128
  const redirect = `http://${host}${location.port ? `:${location.port}` : ''}/`;
71
- return buildAtprotoLoopbackClientId({ scope: scopeString(o), redirect_uris: [redirect] });
129
+ const scope = scopeString(o, '');
130
+ return { clientId: buildAtprotoLoopbackClientId({ scope, redirect_uris: [redirect] }), scope };
72
131
  }
73
132
  if (!o.clientId)
74
133
  throw new Error('techne-sdk/auth: no clientId (the https URL of the client metadata the app serves); only a localhost page may leave it out');
75
- return o.clientId;
134
+ return { clientId: o.clientId, scope: scopeString(o, skey(o.clientId)) };
135
+ }
136
+ /** The client id a call signs in as: the loopback client on a loopback page or with no client id, else
137
+ * `clientId`. Its {@link appSpace} is the app's private space. */
138
+ export function resolveClientId(o) {
139
+ return resolveClient(o).clientId;
76
140
  }
77
141
  const homePds = (o) => o.pds ?? TECHNE_TOWN_PDS;
78
142
  /** The OAuth client for these options: one per client id (made with the first call's `pds` and `plcUrl`;
@@ -117,10 +181,11 @@ function signInTarget(handle, o = {}) {
117
181
  }
118
182
  /** Sign in: redirects to the person's PDS, and comes back to the app's redirect URI (then {@link restore}). */
119
183
  export async function signIn(o = {}) {
184
+ const { scope } = resolveClient(o);
120
185
  const client = await oauthClient(o);
121
186
  // A sign-up is at the home PDS unless the app names another PDS by its URL.
122
187
  const input = o.signUp ? (o.handle && /^https:\/\//.test(o.handle) ? o.handle : homePds(o)) : signInTarget(o.handle, o);
123
- const options = { scope: scopeString(o) };
188
+ const options = { scope };
124
189
  if (o.signUp)
125
190
  options.prompt = 'create';
126
191
  if (o.state !== undefined)
@@ -1 +1 @@
1
- export declare const PUBLIC_HOMES: readonly ["pub.techne.draft.appConfig", "pub.techne.draft.approval", "pub.techne.draft.connection", "pub.techne.draft.contactChannel", "pub.techne.draft.channelVerification", "pub.techne.draft.containedIn", "pub.techne.draft.derivation", "pub.techne.draft.distinctFrom", "pub.techne.draft.geo", "pub.techne.draft.heldAt", "pub.techne.draft.operator", "pub.techne.draft.org", "pub.techne.draft.profile", "pub.techne.draft.assessment", "pub.techne.draft.provenance", "pub.techne.draft.questionSet", "pub.techne.draft.receipt", "pub.techne.draft.verdict", "pub.techne.draft.verification", "pub.techne.draft.retirement", "pub.techne.draft.credential", "pub.techne.draft.credentialRevocation", "pub.techne.draft.publisher", "pub.techne.draft.sameAs", "pub.techne.draft.source", "pub.techne.draft.sourceAttribution", "pub.techne.draft.sourceRef", "pub.techne.draft.evaluation", "pub.techne.draft.event.config", "pub.techne.draft.event.listing", "pub.techne.draft.feed.recipe", "pub.techne.draft.query", "pub.techne.draft.invite", "pub.techne.draft.market.ask", "pub.techne.draft.market.offer", "pub.techne.draft.membership", "pub.techne.draft.place", "pub.techne.draft.presence", "pub.techne.draft.actor.profile", "pub.techne.draft.collective", "community.lexicon.calendar.event", "community.lexicon.calendar.rsvp"];
1
+ export declare const PUBLIC_HOMES: readonly ["pub.techne.draft.appConfig", "pub.techne.draft.approval", "pub.techne.draft.connection", "pub.techne.draft.contactChannel", "pub.techne.draft.channelVerification", "pub.techne.draft.containedIn", "pub.techne.draft.derivation", "pub.techne.draft.distinctFrom", "pub.techne.draft.geo", "pub.techne.draft.heldAt", "pub.techne.draft.operator", "pub.techne.draft.org", "pub.techne.draft.profile", "pub.techne.draft.assessment", "pub.techne.draft.provenance", "pub.techne.draft.questionSet", "pub.techne.draft.receipt", "pub.techne.draft.registry.typeRequest", "pub.techne.draft.verdict", "pub.techne.draft.verification", "pub.techne.draft.retirement", "pub.techne.draft.credential", "pub.techne.draft.credentialRevocation", "pub.techne.draft.publisher", "pub.techne.draft.sameAs", "pub.techne.draft.source", "pub.techne.draft.sourceAttribution", "pub.techne.draft.sourceRef", "pub.techne.draft.evaluation", "pub.techne.draft.event.config", "pub.techne.draft.event.listing", "pub.techne.draft.feed.recipe", "pub.techne.draft.query", "pub.techne.draft.invite", "pub.techne.draft.market.ask", "pub.techne.draft.market.offer", "pub.techne.draft.membership", "pub.techne.draft.place", "pub.techne.draft.presence", "pub.techne.draft.actor.profile", "pub.techne.draft.collective", "community.lexicon.calendar.event", "community.lexicon.calendar.rsvp"];
@@ -21,6 +21,7 @@ export const PUBLIC_HOMES = [
21
21
  NSID.PROVENANCE,
22
22
  NSID.QUESTION_SET,
23
23
  NSID.RECEIPT,
24
+ NSID.REGISTRY_TYPE_REQUEST,
24
25
  NSID.VERDICT,
25
26
  NSID.VERIFICATION,
26
27
  NSID.RETIREMENT,