techne-sdk 0.14.0 → 0.15.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,63 @@
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
+ ## 0.15.0 (2026-12-01)
7
+
8
+ Inputs: the hidden guest list, curator follows and notification switches, an evaluation's photo. Exports are
9
+ added; none is removed or renamed, and no function changes meaning. Ship after the platform that reads these lexicons is on prod: an
10
+ older platform refuses a write to `pub.techne.draft.space.audience`, `pub.techne.draft.follow` or
11
+ `pub.techne.draft.notificationPref`, and its policy check denies a `policy#sharedWithIn` leaf. npm 0.15.0
12
+ and crate 0.15.0 are built from the same commit; the crate's code is unchanged and moves to check 0.3.44.
13
+
14
+ ### Added
15
+
16
+ - **`NSID.SPACE_AUDIENCE` and `NSID.SPACE_AUDIENCE_POLICY`** (`pub.techne.draft.space.audience`): the
17
+ kept-apart audience of another space. The shares that admit people to a space sit in its authority's
18
+ audience space at the same key, which only the authority reads, so guests are not listed to each other.
19
+ - **`NSID.POLICY_SHARED_WITH_IN`** (`pub.techne.draft.policy#sharedWithIn`): a policy leaf that admits V when
20
+ the authority's share naming V is in the named sibling space at the same key.
21
+ - **`NSID.FOLLOW`** (`pub.techne.draft.follow`, key = the followed DID; `subject`, `createdAt`) and
22
+ **`NSID.NOTIFICATION_PREF`** (`pub.techne.draft.notificationPref`, key = the kind; `kind`, `enabled`,
23
+ `createdAt`), with their record types. Both are private: write them with `put` and
24
+ `space: at://<your DID>/pub.techne.draft.space.personal/self` (`put` refuses a private record that names no
25
+ space).
26
+ - **`pub.techne.draft.beacon` `guestsHidden`** (optional boolean): the beacon's guests do not see who else it
27
+ was shared with or how they answered. `pub.techne.draft.space.beaconDecline` then holds every answer (its
28
+ name is now "Beacon answer"), and the `space.beacon` read policy gains a `sharedWithIn` leaf naming
29
+ `space.audience`.
30
+ - **NSID constants for the phone sign-in attestation** (`NSID.START_PHONE_SIGNUP_ATTEST`, `_IOS_ATTEST`,
31
+ `_ANDROID_ATTEST`), from the platform's published API. Constants only: `startPhoneSignIn` sends no
32
+ attestation (the platform records it and does not require it).
33
+ - `pub.techne.draft.derivation` signal `name` gains the known value `ladderRung` (the field stays open).
34
+ - **`pub.techne.draft.evaluation` `image`** (optional blob: PNG, JPEG or WebP, at most 2,000,000 bytes): a
35
+ photo of the subject, set by the evaluator and kept in the evaluator's repo. Show it only when the subject
36
+ has no picture of its own. The platform serves it through `getAvatar` (`did` = the evaluator) while a
37
+ public evaluation names it.
38
+
39
+ ### Changed
40
+
41
+ - **Phone sign-in refusals** (`OwnSessionError.code`, the platform's error name passed through). On the
42
+ platform this release pins, `startPhoneSignIn` answers `Unavailable` where it answered
43
+ `OwnSessionUnavailable` (no code could be sent: try again), and `finishPhoneSignIn` drops
44
+ `NewCodeSent` and `OwnSessionUnavailable` and adds `AccountUnavailable` (the number can't sign in here) and
45
+ `NumberRemoved` (sign in with the current number). `created` is true when the platform records the account
46
+ for the first time. The SDK's code is unchanged: these come from the platform, so an app gets them from
47
+ that platform whatever SDK it pins. `addBeaconAudience`, `addGroupMembers`, `createGroup` and `lightBeacon`
48
+ name `RateLimitExceeded`.
49
+ - **`techne-sdk/query` docs**: a query naming no `view` is answered with the old default through 2027-03-01
50
+ (UTC) and refused with `ViewRequired` from 2027-03-02 (the docs said it was refused already). The types
51
+ still require a view.
52
+
53
+ ### Inputs
54
+
55
+ - **Lexicons `v0.1.22-techne.109`, check crate `techne-lexicon-check` 0.3.44** (exact). Also description
56
+ fixes: `space.beaconDecline` (an answer counts for the lighter only from someone they shared the beacon
57
+ with), `placement` (`unbuilt` covers app-written placements), `query` `view` (a query naming no view gets
58
+ the old default until 2027-03-01), `org` and `statement#locations` (curated location statements), `geo`,
59
+ `placeV2` (same-rkey replaces `place`).
60
+ - **Platform API at platform `main` `50a33d887`**. Adds the phone sign-in
61
+ attestation and the refusals above; the other method lexicons change only in descriptions.
62
+
6
63
  ## 0.14.0 (2026-11-30)
7
64
 
8
65
  The sign-in form and the "Sign in with Techne" button. Needs the Techne sign-in page (ePDS) that reads a phone
package/README.md CHANGED
@@ -86,9 +86,12 @@ for (;;) {
86
86
  - **Paging:** `limit` defaults to 50. Keep it at 500 or less: `query` accepts up to 50000, but past 500 the
87
87
  platform reads page after page and charges every row to your budget (below). Keep paging until `cursor` is absent: a page can be shorter than
88
88
  `limit` and still have one. `{ count: true }` adds `count` and `capped` (counting stops at 1000).
89
- - **Two views:** every query names its view, and there is no default (a query naming none is refused with
90
- `ViewRequired`). `view: 'curated'` reads the commons' listed records: one curated record per thing, merged
91
- from its sources by a curator the commons root trusts, moderated (an event only inside the supported areas).
89
+ - **Two views:** every query names its view (the types require it). The platform answers a query naming
90
+ none the way it did before views (curated, except as written for a branch scoped to named authors,
91
+ subjects or URIs, or with `curated: false`) through 2027-03-01 (UTC), whoever sends it, and refuses it
92
+ with `ViewRequired` from 2027-03-02; a query naming a view on some branches only is refused now. `view: 'curated'` reads the
93
+ commons' listed records: one curated record per thing, merged from its sources by a curator the commons
94
+ root trusts, moderated (an event only inside the supported areas).
92
95
  A type no curator covers is refused with `NotCurated`, naming the type, rather than answered as an empty list.
93
96
  `view: 'asWritten'` reads every public record as its author wrote it: each source copy and the curated record
94
97
  (counts in this view hold both copies of a curated thing). A private record reads the same in both. To mix
@@ -249,7 +252,7 @@ const techne = connect(session, TECHNE_PLATFORM_DID)
249
252
  - **Sign-in:** the device makes the DPoP key and the PKCE pair and signs every proof; the platform runs the
250
253
  door and answers the tokens bound to that key, plus a narrow device credential. A `UseDpopNonce` answer is
251
254
  signed again once, with the same code. A refusal is an `OwnSessionError` whose `code` is the platform's error
252
- (`OwnSessionUnavailable`: sign in the old way; `InvalidRequest`: wrong code; `CodeExpired`; `RateLimitExceeded`
255
+ (`Unavailable`: no code could be sent, try again; `InvalidRequest`: wrong code; `CodeExpired`; `RateLimitExceeded`
253
256
  with `retryAfter`).
254
257
  - **Calls** to the PDS carry the access token and a proof per request; a `use_dpop_nonce` answer is signed again
255
258
  once, an `invalid_token` one refreshes and sends again.
@@ -197,10 +197,9 @@ function pageParams(o) {
197
197
  throw new TypeError(`techne-sdk/auth: email is an address (got ${JSON.stringify(o.email)})`);
198
198
  if (phone && !E164.test(phone))
199
199
  throw new TypeError(`techne-sdk/auth: phone is an E.164 number, +<country code><number> (got ${JSON.stringify(o.phone)})`);
200
- if (email)
201
- return { login_hint: email };
202
- if (phone)
203
- return { login_hint: phone };
200
+ const hint = email || phone;
201
+ if (hint)
202
+ return { login_hint: hint };
204
203
  return { epds_other_ways: '1' };
205
204
  }
206
205
  /** What BrowserOAuthClient's signInRedirect does, with `params` on the URL: navigate, and if the page is still
@@ -125,6 +125,35 @@ export declare const catalog: {
125
125
  homes?: undefined;
126
126
  })[];
127
127
  spaces: ({
128
+ nsid: string;
129
+ name: string;
130
+ kind: string;
131
+ key: string;
132
+ description: string;
133
+ collections: string[];
134
+ policy: {
135
+ read: {
136
+ $type: string;
137
+ of?: undefined;
138
+ atLeast?: undefined;
139
+ includeMemberCollectives?: undefined;
140
+ };
141
+ write: {
142
+ $type: string;
143
+ of?: undefined;
144
+ atLeast?: undefined;
145
+ };
146
+ manage: {
147
+ $type: string;
148
+ of?: undefined;
149
+ atLeast?: undefined;
150
+ };
151
+ };
152
+ doc: unknown;
153
+ policyNsid: string;
154
+ policyDescription: string;
155
+ policyDoc: unknown;
156
+ } | {
128
157
  nsid: string;
129
158
  name: string;
130
159
  kind: string;
@@ -137,9 +166,15 @@ export declare const catalog: {
137
166
  of: ({
138
167
  $type: string;
139
168
  of?: undefined;
169
+ spaceType?: undefined;
140
170
  } | {
141
171
  $type: string;
142
172
  of: string;
173
+ spaceType?: undefined;
174
+ } | {
175
+ $type: string;
176
+ spaceType: string;
177
+ of?: undefined;
143
178
  })[];
144
179
  atLeast?: undefined;
145
180
  includeMemberCollectives?: undefined;
@@ -437,35 +472,6 @@ export declare const catalog: {
437
472
  policyNsid: string;
438
473
  policyDescription: string;
439
474
  policyDoc: unknown;
440
- } | {
441
- nsid: string;
442
- name: string;
443
- kind: string;
444
- key: string;
445
- description: string;
446
- collections: string[];
447
- policy: {
448
- read: {
449
- $type: string;
450
- of?: undefined;
451
- atLeast?: undefined;
452
- includeMemberCollectives?: undefined;
453
- };
454
- write: {
455
- $type: string;
456
- of?: undefined;
457
- atLeast?: undefined;
458
- };
459
- manage: {
460
- $type: string;
461
- of?: undefined;
462
- atLeast?: undefined;
463
- };
464
- };
465
- doc: unknown;
466
- policyNsid: string;
467
- policyDescription: string;
468
- policyDoc: unknown;
469
475
  })[];
470
476
  algebra: {
471
477
  nsid: string;