techne-sdk 0.6.0 → 0.7.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 (37) hide show
  1. package/CHANGELOG.md +23 -5
  2. package/README.md +1 -1
  3. package/dist/auth/index.d.ts +2 -2
  4. package/dist/auth/index.js +5 -3
  5. package/dist/auth/placement.gen.d.ts +1 -1
  6. package/dist/auth/placement.gen.js +4 -0
  7. package/dist/catalog/catalog.gen.d.ts +2 -2
  8. package/dist/catalog/catalog.gen.js +1394 -130
  9. package/dist/generated/index.d.ts +129 -0
  10. package/dist/generated/index.js +170 -0
  11. package/dist/generated/lexicons.d.ts +954 -134
  12. package/dist/generated/lexicons.js +511 -61
  13. package/dist/generated/nsid.d.ts +16 -1
  14. package/dist/generated/nsid.js +16 -1
  15. package/dist/generated/nsid.json +16 -1
  16. package/dist/generated/records.d.ts +148 -140
  17. package/dist/generated/types/app/certified/defs.d.ts +20 -0
  18. package/dist/generated/types/app/certified/defs.js +18 -0
  19. package/dist/generated/types/app/certified/signature/defs.d.ts +29 -0
  20. package/dist/generated/types/app/certified/signature/defs.js +18 -0
  21. package/dist/generated/types/org/hypercerts/funding/receipt.d.ts +56 -0
  22. package/dist/generated/types/org/hypercerts/funding/receipt.js +19 -0
  23. package/dist/generated/types/pub/techne/draft/financials.d.ts +26 -0
  24. package/dist/generated/types/pub/techne/draft/financials.js +12 -0
  25. package/dist/generated/types/pub/techne/draft/identity/createCollective.d.ts +5 -0
  26. package/dist/generated/types/pub/techne/draft/identity/createCollective.js +7 -0
  27. package/dist/generated/types/pub/techne/draft/identity/defs.d.ts +1 -1
  28. package/dist/generated/types/pub/techne/draft/identity/manageMethods.d.ts +4 -1
  29. package/dist/generated/types/pub/techne/draft/org.d.ts +55 -25
  30. package/dist/generated/types/pub/techne/draft/org.js +12 -5
  31. package/dist/generated/types/pub/techne/draft/orgAtPlace.d.ts +17 -0
  32. package/dist/generated/types/pub/techne/draft/orgAtPlace.js +12 -0
  33. package/dist/generated/types/pub/techne/draft/statement.d.ts +19 -0
  34. package/dist/generated/types/pub/techne/draft/statement.js +12 -0
  35. package/dist/wasm/techne-wasm.gen.js +1 -1
  36. package/dist/wasm/techne-wasm2js.gen.js +23340 -23255
  37. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -3,7 +3,10 @@
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
6
+ ## 0.7.0 (2026-11-20)
7
+
8
+ npm 0.7.0 and crate 0.7.0 are built from the same commit. The `pub.techne.draft.org` reshape below is a break, so
9
+ this is a major-line version (RELEASING.md).
7
10
 
8
11
  - **README: Where we differ from atproto.** Spaces, collectives, tokens with no scope claim, and app approval.
9
12
  Docs only.
@@ -16,10 +19,25 @@ a crate user.
16
19
  Techne's PDS (#redesign 412a8235), so an app that opted in keeps its reach only by asking for the scope. Default
17
20
  scopes are unchanged. The loopback client's keyless private-space scope is no longer narrowed to its own space
18
21
  by the PDS.
19
- - **Inputs:** lexicons `v0.1.22-techne.89` (commit `64c3caeb`, techne-lexicon-check `=0.3.27`) and the platform API at
20
- `26f9c6e69` (the scopes branch on platform main `69fbf4986`; its published API is unchanged from `b9ca69248`).
21
- `space.private` and the permissioned write descriptions: an app space is reached by `space:` scopes that cover
22
- it, or by a token with none; which app is calling is not asked.
22
+ - **Nonprofit types (#nonprofit-data).** New record types `pub.techne.draft.orgAtPlace` {subject (the org), place, role},
23
+ `pub.techne.draft.financials` (one per org per tax year), `pub.techne.draft.statement` (facts about another
24
+ record, `fields` an open union of `<type>#fields`, with `org#fields`), and the adopted
25
+ `org.hypercerts.funding.receipt` (with `app.certified.defs`). **Break:** `pub.techne.draft.org` is reshaped to the
26
+ naming register (`identifiers`/`category`/`status` as `{scheme, value}`, `founded`, `description`, `url`,
27
+ `phone`, `locations`); `address`, `identifier`, `email`, `entityType`, `jurisdictionOfFormation`, `telephone`
28
+ and `#schemeTag` are gone (no org records existed). Hence 0.7.0.
29
+ - **`everything: 'write'` asks a `repo:` scope for every public home outside `pub.techne.*`**: the adopted
30
+ `org.hypercerts.funding.receipt` joins the `community.lexicon.calendar.*` pair (`authWrite` names only
31
+ `pub.techne.*`), so the consent page lists one more collection.
32
+ - **Platform API at platform `main` `6c1a6f485`** (the merge that ships #nonprofit-data). It also carries the
33
+ platform's own-session methods, added to `NSID` and the method catalog: `social.scenius.refreshOwnSession`,
34
+ `revokeOwnSession`, `adoptHeldSession` (DEPRECATED, a one-time move), and the `#ownStart`/`#ownFinish`/`#ownSession`
35
+ shapes of `startPhoneSignup` and `finishPhoneSignup`. Additions only.
36
+ - **Inputs:** lexicons `v0.1.22-techne.95` (commit `7c4e0f12`, on techne.94) with `techne-lexicon-check` `=0.3.31`
37
+ from crates.io (checksum `e4bb36df`), and the platform API at `main` `6c1a6f485`. Codegen, the catalog and the
38
+ WebAssembly are regenerated. Also carries techne.90-.94:
39
+ `space.private` and the permissioned write descriptions (an app space is reached by `space:` scopes that cover
40
+ it, or by a token with none), createCollective's `founderMembershipVisibility`, no creator window.
23
41
 
24
42
  ## 0.6.0 (2026-11-19)
25
43
 
package/README.md CHANGED
@@ -92,7 +92,7 @@ else {
92
92
  ```
93
93
 
94
94
  - **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.
95
- - **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 by its exact key, `ownAppSpace(clientId)` = `space:pub.techne.draft.space.private?skey=<appKey>` (ask for your own space this way: a keyless `space.private` scope, or `skey=*`, is every app's private data, and the consent page shows it as a red warning); 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 and `space:*?authority=*&action=read` (`WHOLE_STORE_READ`), `everything: 'write'` adds `authRead`, `authWrite`, `space:*?authority=*&manage=create&manage=update` (`WHOLE_STORE`) and a `repo:` scope for the public `community.lexicon.*` records (then our own public types need no `types` entry). The sets reach no space on Techne's PDS; the `space:` scope, asked for by name, does. 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
+ - **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 by its exact key, `ownAppSpace(clientId)` = `space:pub.techne.draft.space.private?skey=<appKey>` (ask for your own space this way: a keyless `space.private` scope, or `skey=*`, is every app's private data, and the consent page shows it as a red warning); 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 and `space:*?authority=*&action=read` (`WHOLE_STORE_READ`), `everything: 'write'` adds `authRead`, `authWrite`, `space:*?authority=*&manage=create&manage=update` (`WHOLE_STORE`) and a `repo:` scope for the public records outside `pub.techne.*` (`community.lexicon.*`, `org.hypercerts.funding.receipt`; then our own public types need no `types` entry). The sets reach no space on Techne's PDS; the `space:` scope, asked for by name, does. 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`.
96
96
  - **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.
97
97
  - **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, through a token whose `space:` scopes cover it or one with no scope claim at all (below). 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), which is every app's private space: Techne's PDS no longer narrows it to the loopback app's own, and the consent page shows the red every-app warning. That is development only; a hosted app asks with `ownAppSpace(clientId)`. 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.
98
98
  - **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.
@@ -26,7 +26,7 @@
26
26
  * Everything the person can reach (their personal space, their circles, beacons
27
27
  * shared with them) is an opt-in, `everything: 'read'` (the `authRead` set and {@link WHOLE_STORE_READ})
28
28
  * or `everything: 'write'` (`authRead` and `authWrite`, {@link WHOLE_STORE}, plus a `repo:` scope for our
29
- * public homes outside our namespace, `community.lexicon.*`, from the placement manifest,
29
+ * public homes outside our namespace, `community.lexicon.*` and `org.hypercerts.*`, from the placement manifest,
30
30
  * `placement.gen.ts`). The sets reach no space on the Techne ePDS; the `space:` scope, asked for by name,
31
31
  * does. The consent page shows those with a large warning: they include what other apps keep private. Pass the same options to {@link clientMetadata} and {@link signIn}: the PDS refuses
32
32
  * a request beyond what the metadata declares. The platform is {@link TECHNE_PLATFORM_DID} unless a
@@ -141,7 +141,7 @@ export interface ClientOptions {
141
141
  export declare function includeScope(nsid: string, platform?: string): string;
142
142
  /** The opt-in to everything the person can reach: `'read'` adds the platform's `authRead` set and
143
143
  * {@link WHOLE_STORE_READ}, `'write'` `authRead`, `authWrite` and {@link WHOLE_STORE} (and the `repo:` scope
144
- * for our public `community.lexicon.*` homes). The sets carry no space reach; the `space:` scope does. */
144
+ * for our public homes outside `pub.techne.*`). The sets carry no space reach; the `space:` scope does. */
145
145
  export type Everything = 'read' | 'write';
146
146
  /** The 0016 `space:` scope over every space the person can reach, every app's private space included, with
147
147
  * `manage=create` and `manage=update`, making spaces and changing their settings (`everything: 'write'`): the
@@ -70,8 +70,10 @@ function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything, pub
70
70
  if (!isValidNsid(t))
71
71
  throw new TypeError(`techne-sdk/auth: a type is an NSID (got ${JSON.stringify(t)})`);
72
72
  const write = everything === 'write';
73
- const community = write ? PUBLIC_HOMES.filter((c) => c.startsWith(`${NSID.COMMUNITY_AUTHORITY}.`)) : [];
74
- // With authWrite (and the community repo scope) our public homes are covered already.
73
+ // Our public homes outside our namespace (adopted: community.lexicon.*, org.hypercerts.*): authWrite names
74
+ // only pub.techne.*, so these need their own repo scope.
75
+ const adopted = write ? PUBLIC_HOMES.filter((c) => !c.startsWith(`${NSID.AUTHORITY}.`)) : [];
76
+ // With authWrite (and the adopted repo scope) our public homes are covered already.
75
77
  const own = [...new Set(types)].filter((t) => !(write && PUBLIC_HOMES.includes(t))).sort();
76
78
  const aud = audParam(platform);
77
79
  return [
@@ -84,7 +86,7 @@ function scopeList({ platform = TECHNE_PLATFORM_DID, types = [], everything, pub
84
86
  ...(write ? [includeScope(NSID.AUTH_WRITE, platform)] : []),
85
87
  // The sets reach no space: the opt-in names the whole store by its `space:` scope.
86
88
  ...(everything ? [write ? WHOLE_STORE : WHOLE_STORE_READ] : []),
87
- ...(community.length ? [repoScope(community)] : []),
89
+ ...(adopted.length ? [repoScope(adopted)] : []),
88
90
  ...own.map((t) => repoScope([t])),
89
91
  // `put` hints each public write to the platform (the only way a pending type's records are indexed);
90
92
  // authWrite carries that call, so without it an app that writes public types asks for it alone.
@@ -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.placeResearch", "pub.techne.draft.summary", "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"];
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.orgAtPlace", "pub.techne.draft.financials", "pub.techne.draft.statement", "pub.techne.draft.profile", "pub.techne.draft.assessment", "pub.techne.draft.placeResearch", "pub.techne.draft.summary", "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", "org.hypercerts.funding.receipt"];
@@ -16,6 +16,9 @@ export const PUBLIC_HOMES = [
16
16
  NSID.HELD_AT,
17
17
  NSID.OPERATOR,
18
18
  NSID.ORG,
19
+ NSID.ORG_AT_PLACE,
20
+ NSID.FINANCIALS,
21
+ NSID.STATEMENT,
19
22
  NSID.PROFILE,
20
23
  NSID.ASSESSMENT,
21
24
  NSID.PLACE_RESEARCH,
@@ -49,4 +52,5 @@ export const PUBLIC_HOMES = [
49
52
  NSID.COLLECTIVE,
50
53
  NSID.CALENDAR_EVENT,
51
54
  NSID.CALENDAR_RSVP,
55
+ NSID.FUNDING_RECEIPT,
52
56
  ];
@@ -4,8 +4,8 @@ export declare const catalog: {
4
4
  name: string;
5
5
  group: string;
6
6
  kind: string;
7
+ description: string;
7
8
  doc: unknown;
8
- description?: undefined;
9
9
  fields?: undefined;
10
10
  key?: undefined;
11
11
  homes?: undefined;
@@ -14,8 +14,8 @@ export declare const catalog: {
14
14
  name: string;
15
15
  group: string;
16
16
  kind: string;
17
- description: string;
18
17
  doc: unknown;
18
+ description?: undefined;
19
19
  fields?: undefined;
20
20
  key?: undefined;
21
21
  homes?: undefined;