@portalshq/resolver 0.0.3 → 0.0.5

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/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @portalshq/resolver
2
2
 
3
- Thin adapter over the existing NAP v0 client. The whole point of this
3
+ Thin adapter over the existing PX v0 client. The whole point of this
4
4
  package is to NOT contain protocol logic — that already exists and is
5
5
  proven in production (studio-app, 25thChapter). This package exists so
6
6
  every *new* capability in this repo can depend on a stable
7
- `NapResolver` interface instead of reaching into NAP v0 internals.
7
+ `PxResolver` interface instead of reaching into PX v0 internals.
8
8
 
9
- Next step for whoever owns NAP: extract the v0 client out of studio-app
9
+ Next step for whoever owns PX: extract the v0 client out of studio-app
10
10
  into its own publishable package so this adapter has something concrete
11
11
  to wrap. Until then, this defines the target shape.
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "./nap-resolver-adapter.js";
1
+ export * from "./px-resolver-adapter.js";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./nap-resolver-adapter.js";
1
+ export * from "./px-resolver-adapter.js";
@@ -0,0 +1,28 @@
1
+ /**
2
+ * IMPORTANT: this does not reimplement PX. It wraps the existing PX v0
3
+ * client (already running in studio-app and 25thChapter) so that any
4
+ * capability in this repo can resolve a PX address through one stable
5
+ * interface, without depending on the v0 client's internal API surface
6
+ * directly. If/when PX moves past v0, only this adapter should need to
7
+ * change — not every capability that consumes it.
8
+ *
9
+ * TODO(integration): replace the placeholder import below with the actual
10
+ * PX v0 client package once it's extracted from studio-app into its own
11
+ * package. Until then this adapter defines the target interface so other
12
+ * packages can be built against it in parallel.
13
+ */
14
+ export interface NarrativeObject {
15
+ pxAddress: string;
16
+ kind: "narrative" | "world" | "asset" | "identity";
17
+ lineage?: string[];
18
+ payload: unknown;
19
+ }
20
+ export interface PxResolver {
21
+ resolve(pxAddress: string): Promise<NarrativeObject>;
22
+ exists(pxAddress: string): Promise<boolean>;
23
+ }
24
+ export declare class PxResolverAdapter implements PxResolver {
25
+ constructor();
26
+ resolve(pxAddress: string): Promise<NarrativeObject>;
27
+ exists(pxAddress: string): Promise<boolean>;
28
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * IMPORTANT: this does not reimplement PX. It wraps the existing PX v0
3
+ * client (already running in studio-app and 25thChapter) so that any
4
+ * capability in this repo can resolve a PX address through one stable
5
+ * interface, without depending on the v0 client's internal API surface
6
+ * directly. If/when PX moves past v0, only this adapter should need to
7
+ * change — not every capability that consumes it.
8
+ *
9
+ * TODO(integration): replace the placeholder import below with the actual
10
+ * PX v0 client package once it's extracted from studio-app into its own
11
+ * package. Until then this adapter defines the target interface so other
12
+ * packages can be built against it in parallel.
13
+ */
14
+ export class PxResolverAdapter {
15
+ constructor( /* private client: PxClientV0 */) { }
16
+ async resolve(pxAddress) {
17
+ // return this.client.resolve(pxAddress);
18
+ throw new Error("PxResolverAdapter.resolve: wire up to PX v0 client — see TODO above");
19
+ }
20
+ async exists(pxAddress) {
21
+ throw new Error("PxResolverAdapter.exists: wire up to PX v0 client — see TODO above");
22
+ }
23
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@portalshq/resolver",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
- "url": "git+https://github.com/portalshq/portals-cloud"
6
+ "url": "git+https://github.com/portalshq/portals-cloud.git",
7
+ "directory": "packages/resolver"
7
8
  },
8
- "description": "Adapter over the existing NAP v0 client. Gives NAP a stable, contract-compliant interface consumable by any capability, not just studio-app/25thChapter's bespoke integrations.",
9
+ "description": "Adapter over the existing PX v0 client. Gives PX a stable, contract-compliant interface consumable by any capability, not just studio-app/25thChapter's bespoke integrations.",
9
10
  "type": "module",
10
11
  "main": "dist/index.js",
11
12
  "types": "dist/index.d.ts",
@@ -22,5 +23,9 @@
22
23
  "devDependencies": {
23
24
  "typescript": "^5.5.0",
24
25
  "@types/node": "^20.0.0"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "registry": "https://registry.npmjs.org/"
25
30
  }
26
31
  }
@@ -1,28 +0,0 @@
1
- /**
2
- * IMPORTANT: this does not reimplement NAP. It wraps the existing NAP v0
3
- * client (already running in studio-app and 25thChapter) so that any
4
- * capability in this repo can resolve a NAP address through one stable
5
- * interface, without depending on the v0 client's internal API surface
6
- * directly. If/when NAP moves past v0, only this adapter should need to
7
- * change — not every capability that consumes it.
8
- *
9
- * TODO(integration): replace the placeholder import below with the actual
10
- * NAP v0 client package once it's extracted from studio-app into its own
11
- * package. Until then this adapter defines the target interface so other
12
- * packages can be built against it in parallel.
13
- */
14
- export interface NarrativeObject {
15
- napAddress: string;
16
- kind: "narrative" | "world" | "asset" | "identity";
17
- lineage?: string[];
18
- payload: unknown;
19
- }
20
- export interface NapResolver {
21
- resolve(napAddress: string): Promise<NarrativeObject>;
22
- exists(napAddress: string): Promise<boolean>;
23
- }
24
- export declare class NapResolverAdapter implements NapResolver {
25
- constructor();
26
- resolve(napAddress: string): Promise<NarrativeObject>;
27
- exists(napAddress: string): Promise<boolean>;
28
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * IMPORTANT: this does not reimplement NAP. It wraps the existing NAP v0
3
- * client (already running in studio-app and 25thChapter) so that any
4
- * capability in this repo can resolve a NAP address through one stable
5
- * interface, without depending on the v0 client's internal API surface
6
- * directly. If/when NAP moves past v0, only this adapter should need to
7
- * change — not every capability that consumes it.
8
- *
9
- * TODO(integration): replace the placeholder import below with the actual
10
- * NAP v0 client package once it's extracted from studio-app into its own
11
- * package. Until then this adapter defines the target interface so other
12
- * packages can be built against it in parallel.
13
- */
14
- export class NapResolverAdapter {
15
- constructor( /* private client: NapClientV0 */) { }
16
- async resolve(napAddress) {
17
- // return this.client.resolve(napAddress);
18
- throw new Error("NapResolverAdapter.resolve: wire up to NAP v0 client — see TODO above");
19
- }
20
- async exists(napAddress) {
21
- throw new Error("NapResolverAdapter.exists: wire up to NAP v0 client — see TODO above");
22
- }
23
- }