@rocksky/sdk 0.7.1 → 0.7.3
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/dist/agent.d.ts.map +1 -1
- package/dist/index.js +212 -6576
- package/package.json +2 -2
- package/src/agent.ts +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rocksky/sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "TypeScript SDK for Rocksky — built on atcute: AppView reads, AT Protocol PDS writes (scrobble, like, follow, shout), a local dedup index, and Jetstream real-time sync.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"README.md"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
-
"build": "bun build ./src/index.ts --outdir ./dist --target node --format esm --external
|
|
32
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target node --format esm --packages external && bun run build:types",
|
|
33
33
|
"build:types": "tsc -p tsconfig.build.json",
|
|
34
34
|
"typecheck": "tsc --noEmit",
|
|
35
35
|
"test": "bun test",
|
package/src/agent.ts
CHANGED
|
@@ -93,8 +93,12 @@ export class Agent {
|
|
|
93
93
|
*/
|
|
94
94
|
static async login(identifier: string, password: string): Promise<Agent> {
|
|
95
95
|
const actor = await actorResolver().resolve(identifier as never);
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
// The resolver may hand back a PDS URL with a trailing slash; strip it so
|
|
97
|
+
// callers that build `${pds}/xrpc/...` don't produce a `//xrpc` path (which
|
|
98
|
+
// some PDS hosts answer with 404).
|
|
99
|
+
const pds = actor.pds.replace(/\/+$/, "");
|
|
100
|
+
const session = await PasswordSession.login({ service: pds, identifier, password });
|
|
101
|
+
return new Agent(new Client({ handler: session }), session.did, session, pds);
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
/** Attach a local dedup index — write verbs then skip records that already exist. */
|