kitty-agent 8.3.0 → 8.5.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.
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright 2020 Andrey Sitnik <andrey@sitnik.ru>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2016-2023 Ryan Carniato
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2016-2025 [these people](https://github.com/sveltejs/svelte/graphs/contributors)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/out/index.d.ts CHANGED
@@ -3,5 +3,6 @@ export * from './cid.js';
3
3
  export * from './rkey.js';
4
4
  export * from './pds-helpers.js';
5
5
  export * from './shortid.js';
6
+ export * from './sample-authenticated-client.js';
6
7
  export { resolveHandleAnonymously } from './handles/resolve.js';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
package/out/index.js CHANGED
@@ -3,5 +3,6 @@ export * from './cid.js';
3
3
  export * from './rkey.js';
4
4
  export * from './pds-helpers.js';
5
5
  export * from './shortid.js';
6
+ export * from './sample-authenticated-client.js';
6
7
  export { resolveHandleAnonymously } from './handles/resolve.js';
7
8
  //# sourceMappingURL=index.js.map
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,311 @@
1
+ import type { At } from "@atcute/client/lexicons";
2
+ import type { KittyAgent } from "./agent.js";
3
+ import { BaseStatefulOAuthClient, type Account, type LoginState } from "./oauth-stateful-base.js";
4
+ import type { XRPC } from "@atcute/client";
5
+ export declare namespace Nanostores {
6
+ namespace Atom {
7
+ export type AllKeys<T> = T extends any ? keyof T : never;
8
+ type Primitive = boolean | number | string;
9
+ export type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends (...args: any) => any ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
10
+ /**
11
+ * Store object.
12
+ */
13
+ export interface ReadableAtom<Value = any> {
14
+ /**
15
+ * Get store value.
16
+ *
17
+ * In contrast with {@link ReadableAtom#value} this value will be always
18
+ * initialized even if store had no listeners.
19
+ *
20
+ * ```js
21
+ * $store.get()
22
+ * ```
23
+ *
24
+ * @returns Store value.
25
+ */
26
+ get(): Value;
27
+ /**
28
+ * Listeners count.
29
+ */
30
+ readonly lc: number;
31
+ /**
32
+ * Subscribe to store changes.
33
+ *
34
+ * In contrast with {@link Store#subscribe} it do not call listener
35
+ * immediately.
36
+ *
37
+ * @param listener Callback with store value and old value.
38
+ * @returns Function to remove listener.
39
+ */
40
+ listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value>) => void): () => void;
41
+ /**
42
+ * Low-level method to notify listeners about changes in the store.
43
+ *
44
+ * Can cause unexpected behaviour when combined with frontend frameworks
45
+ * that perform equality checks for values, such as React.
46
+ */
47
+ notify(oldValue?: ReadonlyIfObject<Value>): void;
48
+ /**
49
+ * Unbind all listeners.
50
+ */
51
+ off(): void;
52
+ /**
53
+ * Subscribe to store changes and call listener immediately.
54
+ *
55
+ * ```
56
+ * import { $router } from '../store'
57
+ *
58
+ * $router.subscribe(page => {
59
+ * console.log(page)
60
+ * })
61
+ * ```
62
+ *
63
+ * @param listener Callback with store value and old value.
64
+ * @returns Function to remove listener.
65
+ */
66
+ subscribe(listener: (value: ReadonlyIfObject<Value>, oldValue?: ReadonlyIfObject<Value>) => void): () => void;
67
+ /**
68
+ * Low-level method to read store’s value without calling `onStart`.
69
+ *
70
+ * Try to use only {@link ReadableAtom#get}.
71
+ * Without subscribers, value can be undefined.
72
+ */
73
+ readonly value: undefined | Value;
74
+ }
75
+ /**
76
+ * Store with a way to manually change the value.
77
+ */
78
+ export interface WritableAtom<Value = any> extends ReadableAtom<Value> {
79
+ /**
80
+ * Change store value.
81
+ *
82
+ * ```js
83
+ * $router.set({ path: location.pathname, page: parse(location.pathname) })
84
+ * ```
85
+ *
86
+ * @param newValue New store value.
87
+ */
88
+ set(newValue: Value): void;
89
+ }
90
+ export interface PreinitializedWritableAtom<Value extends any> extends WritableAtom<Value> {
91
+ readonly value: Value;
92
+ }
93
+ export type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
94
+ export let notifyId: number;
95
+ /**
96
+ * Create store with atomic value. It could be a string or an object, which you
97
+ * will replace completely.
98
+ *
99
+ * If you want to change keys in the object inside store, use {@link map}.
100
+ *
101
+ * ```js
102
+ * import { atom, onMount } from 'nanostores'
103
+ *
104
+ * // Initial value
105
+ * export const $router = atom({ path: '', page: 'home' })
106
+ *
107
+ * function parse () {
108
+ * $router.set({ path: location.pathname, page: parse(location.pathname) })
109
+ * }
110
+ *
111
+ * // Listen for URL changes on first store’s listener.
112
+ * onMount($router, () => {
113
+ * parse()
114
+ * window.addEventListener('popstate', parse)
115
+ * return () => {
116
+ * window.removeEventListener('popstate', parse)
117
+ * }
118
+ * })
119
+ * ```
120
+ *
121
+ * @param initialValue Initial value of the store.
122
+ * @returns The store object with methods to subscribe.
123
+ */
124
+ export type atom = <Value, StoreExt = {}>(...args: undefined extends Value ? [] | [Value] : [Value]) => PreinitializedWritableAtom<Value> & StoreExt;
125
+ export {};
126
+ }
127
+ namespace Map {
128
+ type AllKeys<T> = Nanostores.Atom.AllKeys<T>;
129
+ type ReadableAtom<Value = any> = Nanostores.Atom.ReadableAtom<Value>;
130
+ type ReadonlyIfObject<Value> = Nanostores.Atom.ReadonlyIfObject<Value>;
131
+ type WritableAtom<Value = any> = Nanostores.Atom.WritableAtom<Value>;
132
+ type KeyofBase = keyof any;
133
+ type Get<T, K extends KeyofBase> = Extract<T, {
134
+ [K1 in K]: any;
135
+ }>[K];
136
+ export type WritableStore<Value = any> = (Value extends object ? MapStore<Value> : never) | WritableAtom<Value>;
137
+ export type Store<Value = any> = ReadableAtom<Value> | WritableStore<Value>;
138
+ export type AnyStore<Value = any> = {
139
+ get(): Value;
140
+ readonly value: undefined | Value;
141
+ };
142
+ export type StoreValue<SomeStore> = SomeStore extends {
143
+ get(): infer Value;
144
+ } ? Value : any;
145
+ export type BaseMapStore<Value = any> = {
146
+ setKey: (key: any, value: any) => any;
147
+ } & WritableAtom<Value>;
148
+ export type MapStoreKeys<SomeStore> = SomeStore extends {
149
+ setKey: (key: infer K, ...args: any[]) => any;
150
+ } ? K : AllKeys<StoreValue<SomeStore>>;
151
+ export interface MapStore<Value extends object = any> extends WritableAtom<Value> {
152
+ /**
153
+ * Subscribe to store changes.
154
+ *
155
+ * In contrast with {@link Store#subscribe} it do not call listener
156
+ * immediately.
157
+ *
158
+ * @param listener Callback with store value and old value.
159
+ * @param changedKey Key that was changed. Will present only if `setKey`
160
+ * has been used to change a store.
161
+ * @returns Function to remove listener.
162
+ */
163
+ listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value>, changedKey: AllKeys<Value>) => void): () => void;
164
+ /**
165
+ * Low-level method to notify listeners about changes in the store.
166
+ *
167
+ * Can cause unexpected behaviour when combined with frontend frameworks
168
+ * that perform equality checks for values, such as React.
169
+ */
170
+ notify(oldValue?: ReadonlyIfObject<Value>, changedKey?: AllKeys<Value>): void;
171
+ /**
172
+ * Change store value.
173
+ *
174
+ * ```js
175
+ * $settings.set({ theme: 'dark' })
176
+ * ```
177
+ *
178
+ * Operation is atomic, subscribers will be notified once with the new value.
179
+ * `changedKey` will be undefined
180
+ *
181
+ * @param newValue New store value.
182
+ */
183
+ set(newValue: Value): void;
184
+ /**
185
+ * Change key in store value.
186
+ *
187
+ * ```js
188
+ * $settings.setKey('theme', 'dark')
189
+ * ```
190
+ *
191
+ * To delete key set `undefined`.
192
+ *
193
+ * ```js
194
+ * $settings.setKey('theme', undefined)
195
+ * ```
196
+ *
197
+ * @param key The key name.
198
+ * @param value New value.
199
+ */
200
+ setKey<Key extends AllKeys<Value>>(key: Key, value: Get<Value, Key> | Value[Key]): void;
201
+ /**
202
+ * Subscribe to store changes and call listener immediately.
203
+ *
204
+ * ```
205
+ * import { $router } from '../store'
206
+ *
207
+ * $router.subscribe(page => {
208
+ * console.log(page)
209
+ * })
210
+ * ```
211
+ *
212
+ * @param listener Callback with store value and old value.
213
+ * @param changedKey Key that was changed. Will present only
214
+ * if `setKey` has been used to change a store.
215
+ * @returns Function to remove listener.
216
+ */
217
+ subscribe(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined, changedKey: AllKeys<Value> | undefined) => void): () => void;
218
+ }
219
+ export interface PreinitializedMapStore<Value extends object = any> extends MapStore<Value> {
220
+ readonly value: Value;
221
+ }
222
+ /**
223
+ * Create map store. Map store is a store with key-value object
224
+ * as a store value.
225
+ *
226
+ * @param init Initialize store and return store destructor.
227
+ * @returns The store object with methods to subscribe.
228
+ */
229
+ export type map = <Value extends object, StoreExt extends object = {}>(value?: Value) => PreinitializedMapStore<Value> & StoreExt;
230
+ export {};
231
+ }
232
+ namespace Task {
233
+ interface Task<Value> extends Promise<Value> {
234
+ t: true;
235
+ }
236
+ }
237
+ namespace Computed {
238
+ type ReadableAtom<Value = any> = Nanostores.Atom.ReadableAtom<Value>;
239
+ type AnyStore<Value = any> = Nanostores.Map.AnyStore<Value>;
240
+ type Store<Value = any> = Nanostores.Map.Store<Value>;
241
+ type StoreValue<SomeStore> = Nanostores.Map.StoreValue<SomeStore>;
242
+ type Task<Value> = Nanostores.Task.Task<Value>;
243
+ export type StoreValues<Stores extends AnyStore[]> = {
244
+ [Index in keyof Stores]: StoreValue<Stores[Index]>;
245
+ };
246
+ export interface computed {
247
+ <Value extends any, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Task<Value>): ReadableAtom<undefined | Value>;
248
+ <Value extends any, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value>): ReadableAtom<undefined | Value>;
249
+ <Value extends any, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Value): ReadableAtom<Value>;
250
+ /**
251
+ * Create derived store, which use generates value from another stores.
252
+ *
253
+ * ```js
254
+ * import { computed } from 'nanostores'
255
+ *
256
+ * import { $users } from './users.js'
257
+ *
258
+ * export const $admins = computed($users, users => {
259
+ * return users.filter(user => user.isAdmin)
260
+ * })
261
+ * ```
262
+ *
263
+ * An async function can be evaluated by using {@link task}.
264
+ *
265
+ * ```js
266
+ * import { computed, task } from 'nanostores'
267
+ *
268
+ * import { $userId } from './users.js'
269
+ *
270
+ * export const $user = computed($userId, userId => task(async () => {
271
+ * const response = await fetch(`https://my-api/users/${userId}`)
272
+ * return response.json()
273
+ * }))
274
+ * ```
275
+ */
276
+ <Value extends any, OriginStores extends AnyStore[]>(stores: [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
277
+ }
278
+ export {};
279
+ }
280
+ }
281
+ export declare class StatefulSvelteOAuthClient<TClient> extends BaseStatefulOAuthClient<TClient> {
282
+ private _account;
283
+ private _agent;
284
+ private _client;
285
+ get account(): Nanostores.Atom.ReadableAtom<Account | undefined>;
286
+ readonly user: Nanostores.Atom.ReadableAtom<LoginState<TClient> | undefined>;
287
+ readonly handle: Nanostores.Atom.ReadableAtom<string | undefined>;
288
+ readonly did: Nanostores.Atom.ReadableAtom<At.DID | undefined>;
289
+ readonly pds: Nanostores.Atom.ReadableAtom<string | undefined>;
290
+ protected get internal_account(): Account | undefined;
291
+ protected get internal_user(): LoginState<TClient> | undefined;
292
+ protected get internal_agent(): KittyAgent<XRPC> | undefined;
293
+ protected get internal_client(): TClient | undefined;
294
+ protected set internal_account(value: Account | undefined);
295
+ protected set internal_agent(value: KittyAgent<XRPC> | undefined);
296
+ protected set internal_client(value: TClient | undefined);
297
+ constructor(options: {
298
+ clientId: string;
299
+ redirectUri: string;
300
+ scope: string;
301
+ }, nanostores: {
302
+ atom: Nanostores.Atom.atom;
303
+ computed: Nanostores.Computed.computed;
304
+ }, createClient: (loginState: {
305
+ readonly handle: string;
306
+ readonly did: At.DID;
307
+ readonly pds: string;
308
+ readonly agent: KittyAgent;
309
+ }) => TClient);
310
+ }
311
+ //# sourceMappingURL=oauth-nanostores.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-nanostores.d.ts","sourceRoot":"","sources":["../src/oauth-nanostores.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,uBAAuB,EAAkB,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAClH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,yBAAiB,UAAU,CAAC;IACxB,UAAiB,IAAI,CAAC;QAClB,MAAM,MAAM,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC;QAEzD,KAAK,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;QAE3C,MAAM,MAAM,gBAAgB,CAAC,KAAK,IAAI,KAAK,SAAS,SAAS,GACvD,KAAK,GACL,KAAK,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,GACnC,KAAK,GACL,KAAK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,UAAU,CAAC,IAAI,CAAC,GAAG,SAAS,EAA6B;IAC7F,SAAS,KAAK,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,EAA8B;gBAGlF,OAAO,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACjB,EACD,UAAU,EAAE;QACR,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;QAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC1C,EACD,YAAY,EAAE,CAAC,UAAU,EAAE;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;KAC9B,KAAK,OAAO;CAgCpB"}
@@ -0,0 +1,52 @@
1
+ import { OAuthClient } from "./oauth.js";
2
+ import { getDidAndPds } from "./pds-helpers.js";
3
+ import { BaseStatefulOAuthClient, LoginStateImpl } from "./oauth-stateful-base.js";
4
+ export var Nanostores;
5
+ (function (Nanostores) {
6
+ let Atom;
7
+ (function (Atom) {
8
+ })(Atom = Nanostores.Atom || (Nanostores.Atom = {}));
9
+ })(Nanostores || (Nanostores = {}));
10
+ export class StatefulSvelteOAuthClient extends BaseStatefulOAuthClient {
11
+ _account;
12
+ _agent;
13
+ _client;
14
+ get account() { return this._account; }
15
+ user;
16
+ handle;
17
+ did;
18
+ pds;
19
+ get internal_account() { return this._account.get(); }
20
+ get internal_user() { return this.user.get(); }
21
+ get internal_agent() { return this._agent.get(); }
22
+ get internal_client() { return this._client.get(); }
23
+ set internal_account(value) { this._account.set(value); }
24
+ set internal_agent(value) { this._agent.set(value); }
25
+ set internal_client(value) { this._client.set(value); }
26
+ constructor(options, nanostores, createClient) {
27
+ super(options, createClient);
28
+ function useLocalStorage(key, initialValue, options) {
29
+ const value = nanostores.atom(initialValue);
30
+ if (key in localStorage) {
31
+ value.set(options.deserializer(localStorage[key]));
32
+ }
33
+ value.subscribe(newValue => {
34
+ localStorage[key] = options.serializer(newValue);
35
+ });
36
+ return value;
37
+ }
38
+ this._account = useLocalStorage('user', undefined, {
39
+ deserializer(raw) { return raw === 'null' ? undefined : JSON.parse(raw); },
40
+ serializer(value) { return value === undefined ? 'null' : JSON.stringify(value); },
41
+ });
42
+ this._agent = nanostores.atom(undefined);
43
+ this._client = nanostores.atom(undefined);
44
+ this.user = nanostores.computed([this._account, this._agent, this._client], (account, agent, client) => {
45
+ return account && agent && client ? new LoginStateImpl(account, agent, client) : undefined;
46
+ });
47
+ this.handle = nanostores.computed([this._account], (account) => account?.handle);
48
+ this.did = nanostores.computed([this._account], (account) => account?.did);
49
+ this.pds = nanostores.computed([this._account], (account) => account?.pds);
50
+ }
51
+ }
52
+ //# sourceMappingURL=oauth-nanostores.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oauth-nanostores.js","sourceRoot":"","sources":["../src/oauth-nanostores.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAAiC,MAAM,0BAA0B,CAAC;AAGlH,MAAM,KAAW,UAAU,CA+W1B;AA/WD,WAAiB,UAAU;IACvB,IAAiB,IAAI,CAiJpB;IAjJD,WAAiB,IAAI;IAiJrB,CAAC,EAjJgB,IAAI,GAAJ,eAAI,KAAJ,eAAI,QAiJpB;AA6NL,CAAC,EA/WgB,UAAU,KAAV,UAAU,QA+W1B;AAED,MAAM,OAAO,yBAAmC,SAAQ,uBAAgC;IAC5E,QAAQ,CAAoD;IAC5D,MAAM,CAAuD;IAC7D,OAAO,CAAoD;IAEnE,IAAI,OAAO,KAAwD,OA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CAAC,IAAI,SAAS,IAAI,EAAE,IAAI,GAAG,IAAI,EACrC,EAAE,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAC5D,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1B,YAAY,CAAC,IAAI,EACb,EAAE,EAAE,OAAO,CAAC,cAAc,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GAC5D,IAAI,CAAC;QACR,EAAE,CAAC,CAAC,EAAE,IAAI,SAAS,IAAI,EAAE,IAAI,GAAG,IAAI,EAChC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EACpD,EAAE,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,GACjE,OAAO,CAAC,cAAc,CAAC,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;KACvE,EACD,YAAY,EAAE,CAAC,UAAU,EAAE;QACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;KAC9B,KAAK,OAAO;CAqCpB"}
@@ -0,0 +1,19 @@
1
+ import type { At } from "@atcute/client/lexicons";
2
+ import type { KittyAgent } from "./agent.js";
3
+ export declare class SampleAuthenticatedClient {
4
+ private readonly loginState;
5
+ constructor(loginState: {
6
+ readonly handle: string;
7
+ readonly did: At.DID;
8
+ readonly pds: string;
9
+ readonly agent: KittyAgent;
10
+ });
11
+ protected get agent(): KittyAgent;
12
+ protected get user(): {
13
+ readonly handle: string;
14
+ readonly did: At.DID;
15
+ readonly pds: string;
16
+ readonly agent: KittyAgent;
17
+ };
18
+ }
19
+ //# sourceMappingURL=sample-authenticated-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-authenticated-client.d.ts","sourceRoot":"","sources":["../src/sample-authenticated-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,yBAAyB;IACtB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE;QACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;KAC9B;IAED,SAAS,KAAK,KAAK,IAAI,UAAU,CAEhC;IAED,SAAS,KAAK,IAAI;yBAVG,MAAM;sBACT,EAAE,CAAC,GAAG;sBACN,MAAM;wBACJ,UAAU;MAS7B;CACJ"}
@@ -0,0 +1,13 @@
1
+ export class SampleAuthenticatedClient {
2
+ loginState;
3
+ constructor(loginState) {
4
+ this.loginState = loginState;
5
+ }
6
+ get agent() {
7
+ return this.loginState.agent;
8
+ }
9
+ get user() {
10
+ return this.loginState;
11
+ }
12
+ }
13
+ //# sourceMappingURL=sample-authenticated-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sample-authenticated-client.js","sourceRoot":"","sources":["../src/sample-authenticated-client.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,yBAAyB;IACL;IAA7B,YAA6B,UAK5B;QAL4B,eAAU,GAAV,UAAU,CAKtC;IAAG,CAAC;IAEL,IAAc,KAAK;QACf,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,CAAC;IAED,IAAc,IAAI;QACd,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;CACJ"}
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "kitty-agent",
3
3
  "type": "module",
4
- "version": "8.3.0",
4
+ "version": "8.5.0",
5
5
  "description": "Helpers for @atcute/client",
6
6
  "main": "out/index.js",
7
7
  "types": "out/index.d.ts",
8
8
  "files": [
9
- "out"
9
+ "out",
10
+ "LICENSE.nanostores.md",
11
+ "LICENSE.solidjs.md",
12
+ "LICENSE.svelte.md"
10
13
  ],
11
14
  "exports": {
12
15
  ".": {
@@ -20,6 +23,10 @@
20
23
  "./oauth-solidjs": {
21
24
  "default": "./out/oauth-solidjs.js",
22
25
  "types": "./out/oauth-solidjs.d.ts"
26
+ },
27
+ "./oauth-nanostores": {
28
+ "default": "./out/oauth-nanostores.js",
29
+ "types": "./out/oauth-nanostores.d.ts"
23
30
  }
24
31
  },
25
32
  "keywords": [],