@napplet/sdk 0.7.0 → 0.8.1
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/index.d.ts +117 -2
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Subscription, NostrEvent, NostrFilter, EventTemplate } from '@napplet/core';
|
|
1
|
+
import { Subscription, CvmDiscoverQuery, CvmServer, CvmServerRef, McpMessage, CvmRequestOptions, McpTool, McpToolResult, McpResource, McpResourceContent, NostrEvent, NostrFilter, OutboxQueryOptions, OutboxResult, OutboxSubscribeOptions, OutboxSubscription, EventTemplate, OutboxPublishOptions, OutboxPublishResult, OutboxTarget, OutboxRelayPlan } from '@napplet/core';
|
|
2
2
|
export { EventTemplate, NAP_DOMAINS, NamespacedCapability, NapDomain, NapProtocolId, NappletMessage, NostrEvent, NostrFilter, ProtocolId, ShellSupports, Subscription } from '@napplet/core';
|
|
3
3
|
import { MediaSessionCreate, MediaSessionResult, MediaMetadata, MediaState, MediaAction } from '@napplet/nap/media';
|
|
4
4
|
export { DOMAIN as MEDIA_DOMAIN, MediaAction, MediaArtwork, MediaCapabilitiesMessage, MediaCommandMessage, MediaControlsMessage, MediaMessage, MediaMetadata, MediaNapMessage, MediaPlaybackOwner, MediaRequestMessage, MediaResultMessage, MediaSessionCreate, MediaSessionCreateMessage, MediaSessionCreateResultMessage, MediaSessionDestroyMessage, MediaSessionResult, MediaSessionUpdateMessage, MediaSourceRef, MediaState, MediaStateMessage, installMediaShim, mediaCreateSession, mediaDestroySession, mediaOnCapabilities, mediaOnCommand, mediaOnControls, mediaOnState, mediaReportCapabilities, mediaReportState, mediaSendCommand, mediaUpdateSession } from '@napplet/nap/media';
|
|
@@ -14,6 +14,8 @@ export { DOMAIN as CONFIG_DOMAIN, ConfigGetMessage, ConfigMessage, ConfigNapMess
|
|
|
14
14
|
export { DOMAIN as RESOURCE_DOMAIN, ResourceBytesErrorMessage, ResourceBytesMessage, ResourceBytesResultMessage, ResourceCancelMessage, ResourceErrorCode, ResourceMessage, ResourceNapMessage, ResourceRequestMessage, ResourceResultMessage, ResourceScheme, ResourceSidecarEntry, installResourceShim, resourceBytes, resourceBytesAsObjectURL } from '@napplet/nap/resource';
|
|
15
15
|
export { DOMAIN as CONNECT_DOMAIN, NappletConnect, connectGranted, connectOrigins, installConnectShim, normalizeConnectOrigin } from '@napplet/nap/connect';
|
|
16
16
|
export { DOMAIN as CLASS_DOMAIN, ClassAssignedMessage, ClassMessage, ClassNapMessage, NappletClass, getClass, installClassShim } from '@napplet/nap/class';
|
|
17
|
+
export { DOMAIN as CVM_DOMAIN, CvmCloseMessage, CvmCloseResultMessage, CvmDiscoverMessage, CvmDiscoverQuery, CvmDiscoverResultMessage, CvmEventMessage, CvmInboundMessage, CvmMessage, CvmNapMessage, CvmOutboundMessage, CvmRequestMessage, CvmRequestOptions, CvmRequestResultMessage, CvmServer, CvmServerRef, McpBlobResourceContents, McpContentBlock, McpMessage, McpResource, McpResourceContent, McpTextResourceContents, McpTool, McpToolResult, cvmCallTool, cvmClose, cvmDiscover, cvmListResources, cvmListTools, cvmOnEvent, cvmReadResource, cvmRequest, installCvmShim } from '@napplet/nap/cvm';
|
|
18
|
+
export { DOMAIN as OUTBOX_DOMAIN, OutboxCloseMessage, OutboxClosedMessage, OutboxEoseMessage, OutboxEventMessage, OutboxInboundMessage, OutboxMessage, OutboxNapMessage, OutboxOutboundMessage, OutboxPublishMessage, OutboxPublishOptions, OutboxPublishResult, OutboxPublishResultMessage, OutboxQueryMessage, OutboxQueryOptions, OutboxQueryResultMessage, OutboxRelayPlan, OutboxResolveRelaysMessage, OutboxResolveRelaysResultMessage, OutboxResult, OutboxStrategy, OutboxSubscribeMessage, OutboxSubscribeOptions, OutboxSubscription, OutboxTarget, installOutboxShim, outboxPublish, outboxQuery, outboxResolveRelays, outboxSubscribe } from '@napplet/nap/outbox';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* @napplet/sdk -- Typed named exports wrapping window.napplet.
|
|
@@ -612,5 +614,118 @@ declare const resource: {
|
|
|
612
614
|
revoke: () => void;
|
|
613
615
|
};
|
|
614
616
|
};
|
|
617
|
+
/**
|
|
618
|
+
* Native ContextVM bridge (NAP-CVM): MCP-over-Nostr access mediated by the shell.
|
|
619
|
+
* The shell owns ContextVM transport, signing, encryption, correlation, policy,
|
|
620
|
+
* and payment; napplets supply a server identity and the MCP operation they want.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```ts
|
|
624
|
+
* import { cvm } from '@napplet/sdk';
|
|
625
|
+
*
|
|
626
|
+
* const servers = await cvm.discover({ search: 'relay' });
|
|
627
|
+
* const tools = await cvm.listTools(servers[0]);
|
|
628
|
+
* const result = await cvm.callTool(servers[0], tools[0].name, {});
|
|
629
|
+
* ```
|
|
630
|
+
*/
|
|
631
|
+
declare const cvm: {
|
|
632
|
+
/**
|
|
633
|
+
* Discover public ContextVM servers known to the shell.
|
|
634
|
+
* @param query Optional discovery filter
|
|
635
|
+
* @returns Promise resolving to the discovered servers
|
|
636
|
+
*/
|
|
637
|
+
discover(query?: CvmDiscoverQuery): Promise<CvmServer[]>;
|
|
638
|
+
/**
|
|
639
|
+
* Send a raw MCP JSON-RPC message to a ContextVM server.
|
|
640
|
+
* @param server Target ContextVM server
|
|
641
|
+
* @param message MCP JSON-RPC message
|
|
642
|
+
* @param options Optional per-request options
|
|
643
|
+
* @returns Promise resolving to the MCP response message
|
|
644
|
+
*/
|
|
645
|
+
request(server: CvmServerRef, message: McpMessage, options?: CvmRequestOptions): Promise<McpMessage>;
|
|
646
|
+
/**
|
|
647
|
+
* List the tools exposed by a ContextVM server (MCP `tools/list`).
|
|
648
|
+
* @param server Target ContextVM server
|
|
649
|
+
* @param options Optional per-request options
|
|
650
|
+
*/
|
|
651
|
+
listTools(server: CvmServerRef, options?: CvmRequestOptions): Promise<McpTool[]>;
|
|
652
|
+
/**
|
|
653
|
+
* Call a tool on a ContextVM server (MCP `tools/call`).
|
|
654
|
+
* @param server Target ContextVM server
|
|
655
|
+
* @param name Tool name
|
|
656
|
+
* @param args Tool arguments
|
|
657
|
+
* @param options Optional per-request options
|
|
658
|
+
*/
|
|
659
|
+
callTool(server: CvmServerRef, name: string, args?: Record<string, unknown>, options?: CvmRequestOptions): Promise<McpToolResult>;
|
|
660
|
+
/**
|
|
661
|
+
* List the resources exposed by a ContextVM server (MCP `resources/list`).
|
|
662
|
+
* @param server Target ContextVM server
|
|
663
|
+
* @param options Optional per-request options
|
|
664
|
+
*/
|
|
665
|
+
listResources(server: CvmServerRef, options?: CvmRequestOptions): Promise<McpResource[]>;
|
|
666
|
+
/**
|
|
667
|
+
* Read a resource from a ContextVM server (MCP `resources/read`).
|
|
668
|
+
* @param server Target ContextVM server
|
|
669
|
+
* @param uri Resource URI
|
|
670
|
+
* @param options Optional per-request options
|
|
671
|
+
*/
|
|
672
|
+
readResource(server: CvmServerRef, uri: string, options?: CvmRequestOptions): Promise<McpResourceContent>;
|
|
673
|
+
/**
|
|
674
|
+
* Close shell-maintained session state for a server.
|
|
675
|
+
* @param server Server whose session should be torn down
|
|
676
|
+
*/
|
|
677
|
+
close(server: CvmServerRef): Promise<void>;
|
|
678
|
+
/**
|
|
679
|
+
* Listen for server-pushed MCP messages (`cvm.event`).
|
|
680
|
+
* @param callback Called with `(server, message)` for each server event
|
|
681
|
+
* @returns A Subscription with `close()` to stop listening
|
|
682
|
+
*/
|
|
683
|
+
onEvent(callback: (server: CvmServerRef, message: McpMessage) => void): Subscription;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Outbox-aware relay routing (NAP-OUTBOX): supply Nostr filters and intent and
|
|
687
|
+
* let the shell discover the correct relays (NIP-65 write/read relays, fallbacks,
|
|
688
|
+
* relay intelligence), query/deduplicate, validate signatures, and stream updates.
|
|
689
|
+
* The shell owns relay discovery, routing, fallback, deduplication, signing, and
|
|
690
|
+
* publish fanout.
|
|
691
|
+
*
|
|
692
|
+
* @example
|
|
693
|
+
* ```ts
|
|
694
|
+
* import { outbox } from '@napplet/sdk';
|
|
695
|
+
*
|
|
696
|
+
* const { events } = await outbox.query([{ authors: ['ab12...'], kinds: [1] }], { strategy: 'outbox' });
|
|
697
|
+
* const sub = outbox.subscribe([{ kinds: [1] }], { live: true });
|
|
698
|
+
* sub.on('event', (event, relay) => render(event, relay));
|
|
699
|
+
* ```
|
|
700
|
+
*/
|
|
701
|
+
declare const outbox: {
|
|
702
|
+
/**
|
|
703
|
+
* Perform a one-shot outbox-aware query.
|
|
704
|
+
* @param filters NIP-01 filter or filters
|
|
705
|
+
* @param options Optional query options
|
|
706
|
+
* @returns Promise resolving to the outbox result
|
|
707
|
+
*/
|
|
708
|
+
query(filters: NostrFilter | NostrFilter[], options?: OutboxQueryOptions): Promise<OutboxResult>;
|
|
709
|
+
/**
|
|
710
|
+
* Open a live outbox-aware subscription.
|
|
711
|
+
* @param filters NIP-01 filter or filters
|
|
712
|
+
* @param options Optional subscribe options
|
|
713
|
+
* @returns An OutboxSubscription handle with `on(...)` and `close()`
|
|
714
|
+
*/
|
|
715
|
+
subscribe(filters: NostrFilter | NostrFilter[], options?: OutboxSubscribeOptions): OutboxSubscription;
|
|
716
|
+
/**
|
|
717
|
+
* Publish a shell-signed event using outbox-aware relay fanout.
|
|
718
|
+
* @param template Unsigned event template
|
|
719
|
+
* @param options Optional publish options
|
|
720
|
+
* @returns Promise resolving to the outbox publish result
|
|
721
|
+
*/
|
|
722
|
+
publish(template: EventTemplate, options?: OutboxPublishOptions): Promise<OutboxPublishResult>;
|
|
723
|
+
/**
|
|
724
|
+
* Resolve the relay plan the shell would use for a read/write target.
|
|
725
|
+
* @param target The read/write target
|
|
726
|
+
* @returns Promise resolving to the relay plan
|
|
727
|
+
*/
|
|
728
|
+
resolveRelays(target: OutboxTarget): Promise<OutboxRelayPlan>;
|
|
729
|
+
};
|
|
615
730
|
|
|
616
|
-
export { config, identity, ifc, inc, keys, media, notify, relay, resource, storage };
|
|
731
|
+
export { config, cvm, identity, ifc, inc, keys, media, notify, outbox, relay, resource, storage };
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import { DOMAIN as DOMAIN10 } from "@napplet/nap/config";
|
|
|
13
13
|
import { DOMAIN as DOMAIN11 } from "@napplet/nap/resource";
|
|
14
14
|
import { DOMAIN as DOMAIN12 } from "@napplet/nap/connect";
|
|
15
15
|
import { DOMAIN as DOMAIN13 } from "@napplet/nap/class";
|
|
16
|
+
import { DOMAIN as DOMAIN14 } from "@napplet/nap/cvm";
|
|
17
|
+
import { DOMAIN as DOMAIN15 } from "@napplet/nap/outbox";
|
|
16
18
|
import { installRelayShim } from "@napplet/nap/relay";
|
|
17
19
|
import { installIdentityShim } from "@napplet/nap/identity";
|
|
18
20
|
import { installStorageShim } from "@napplet/nap/storage";
|
|
@@ -25,6 +27,8 @@ import { installConfigShim } from "@napplet/nap/config";
|
|
|
25
27
|
import { installResourceShim } from "@napplet/nap/resource";
|
|
26
28
|
import { installConnectShim } from "@napplet/nap/connect";
|
|
27
29
|
import { installClassShim } from "@napplet/nap/class";
|
|
30
|
+
import { installCvmShim } from "@napplet/nap/cvm";
|
|
31
|
+
import { installOutboxShim } from "@napplet/nap/outbox";
|
|
28
32
|
import { relaySubscribe, relayPublish, relayPublishEncrypted, relayQuery } from "@napplet/nap/relay";
|
|
29
33
|
import {
|
|
30
34
|
identityGetPublicKey,
|
|
@@ -47,6 +51,22 @@ import { notifySend, notifyDismiss, notifyBadge, notifyRegisterChannel, notifyRe
|
|
|
47
51
|
import { resourceBytes, resourceBytesAsObjectURL } from "@napplet/nap/resource";
|
|
48
52
|
import { connectGranted, connectOrigins, normalizeConnectOrigin } from "@napplet/nap/connect";
|
|
49
53
|
import { getClass } from "@napplet/nap/class";
|
|
54
|
+
import {
|
|
55
|
+
cvmDiscover,
|
|
56
|
+
cvmRequest,
|
|
57
|
+
cvmListTools,
|
|
58
|
+
cvmCallTool,
|
|
59
|
+
cvmListResources,
|
|
60
|
+
cvmReadResource,
|
|
61
|
+
cvmClose,
|
|
62
|
+
cvmOnEvent
|
|
63
|
+
} from "@napplet/nap/cvm";
|
|
64
|
+
import {
|
|
65
|
+
outboxQuery,
|
|
66
|
+
outboxSubscribe,
|
|
67
|
+
outboxPublish,
|
|
68
|
+
outboxResolveRelays
|
|
69
|
+
} from "@napplet/nap/outbox";
|
|
50
70
|
function requireNapplet() {
|
|
51
71
|
const w = window;
|
|
52
72
|
if (!w.napplet) {
|
|
@@ -509,10 +529,118 @@ var resource = {
|
|
|
509
529
|
return requireNapplet().resource.bytesAsObjectURL(url);
|
|
510
530
|
}
|
|
511
531
|
};
|
|
532
|
+
var cvm = {
|
|
533
|
+
/**
|
|
534
|
+
* Discover public ContextVM servers known to the shell.
|
|
535
|
+
* @param query Optional discovery filter
|
|
536
|
+
* @returns Promise resolving to the discovered servers
|
|
537
|
+
*/
|
|
538
|
+
discover(query) {
|
|
539
|
+
return requireNapplet().cvm.discover(query);
|
|
540
|
+
},
|
|
541
|
+
/**
|
|
542
|
+
* Send a raw MCP JSON-RPC message to a ContextVM server.
|
|
543
|
+
* @param server Target ContextVM server
|
|
544
|
+
* @param message MCP JSON-RPC message
|
|
545
|
+
* @param options Optional per-request options
|
|
546
|
+
* @returns Promise resolving to the MCP response message
|
|
547
|
+
*/
|
|
548
|
+
request(server, message, options) {
|
|
549
|
+
return requireNapplet().cvm.request(server, message, options);
|
|
550
|
+
},
|
|
551
|
+
/**
|
|
552
|
+
* List the tools exposed by a ContextVM server (MCP `tools/list`).
|
|
553
|
+
* @param server Target ContextVM server
|
|
554
|
+
* @param options Optional per-request options
|
|
555
|
+
*/
|
|
556
|
+
listTools(server, options) {
|
|
557
|
+
return requireNapplet().cvm.listTools(server, options);
|
|
558
|
+
},
|
|
559
|
+
/**
|
|
560
|
+
* Call a tool on a ContextVM server (MCP `tools/call`).
|
|
561
|
+
* @param server Target ContextVM server
|
|
562
|
+
* @param name Tool name
|
|
563
|
+
* @param args Tool arguments
|
|
564
|
+
* @param options Optional per-request options
|
|
565
|
+
*/
|
|
566
|
+
callTool(server, name, args, options) {
|
|
567
|
+
return requireNapplet().cvm.callTool(server, name, args, options);
|
|
568
|
+
},
|
|
569
|
+
/**
|
|
570
|
+
* List the resources exposed by a ContextVM server (MCP `resources/list`).
|
|
571
|
+
* @param server Target ContextVM server
|
|
572
|
+
* @param options Optional per-request options
|
|
573
|
+
*/
|
|
574
|
+
listResources(server, options) {
|
|
575
|
+
return requireNapplet().cvm.listResources(server, options);
|
|
576
|
+
},
|
|
577
|
+
/**
|
|
578
|
+
* Read a resource from a ContextVM server (MCP `resources/read`).
|
|
579
|
+
* @param server Target ContextVM server
|
|
580
|
+
* @param uri Resource URI
|
|
581
|
+
* @param options Optional per-request options
|
|
582
|
+
*/
|
|
583
|
+
readResource(server, uri, options) {
|
|
584
|
+
return requireNapplet().cvm.readResource(server, uri, options);
|
|
585
|
+
},
|
|
586
|
+
/**
|
|
587
|
+
* Close shell-maintained session state for a server.
|
|
588
|
+
* @param server Server whose session should be torn down
|
|
589
|
+
*/
|
|
590
|
+
close(server) {
|
|
591
|
+
return requireNapplet().cvm.close(server);
|
|
592
|
+
},
|
|
593
|
+
/**
|
|
594
|
+
* Listen for server-pushed MCP messages (`cvm.event`).
|
|
595
|
+
* @param callback Called with `(server, message)` for each server event
|
|
596
|
+
* @returns A Subscription with `close()` to stop listening
|
|
597
|
+
*/
|
|
598
|
+
onEvent(callback) {
|
|
599
|
+
return requireNapplet().cvm.onEvent(callback);
|
|
600
|
+
}
|
|
601
|
+
};
|
|
602
|
+
var outbox = {
|
|
603
|
+
/**
|
|
604
|
+
* Perform a one-shot outbox-aware query.
|
|
605
|
+
* @param filters NIP-01 filter or filters
|
|
606
|
+
* @param options Optional query options
|
|
607
|
+
* @returns Promise resolving to the outbox result
|
|
608
|
+
*/
|
|
609
|
+
query(filters, options) {
|
|
610
|
+
return requireNapplet().outbox.query(filters, options);
|
|
611
|
+
},
|
|
612
|
+
/**
|
|
613
|
+
* Open a live outbox-aware subscription.
|
|
614
|
+
* @param filters NIP-01 filter or filters
|
|
615
|
+
* @param options Optional subscribe options
|
|
616
|
+
* @returns An OutboxSubscription handle with `on(...)` and `close()`
|
|
617
|
+
*/
|
|
618
|
+
subscribe(filters, options) {
|
|
619
|
+
return requireNapplet().outbox.subscribe(filters, options);
|
|
620
|
+
},
|
|
621
|
+
/**
|
|
622
|
+
* Publish a shell-signed event using outbox-aware relay fanout.
|
|
623
|
+
* @param template Unsigned event template
|
|
624
|
+
* @param options Optional publish options
|
|
625
|
+
* @returns Promise resolving to the outbox publish result
|
|
626
|
+
*/
|
|
627
|
+
publish(template, options) {
|
|
628
|
+
return requireNapplet().outbox.publish(template, options);
|
|
629
|
+
},
|
|
630
|
+
/**
|
|
631
|
+
* Resolve the relay plan the shell would use for a read/write target.
|
|
632
|
+
* @param target The read/write target
|
|
633
|
+
* @returns Promise resolving to the relay plan
|
|
634
|
+
*/
|
|
635
|
+
resolveRelays(target) {
|
|
636
|
+
return requireNapplet().outbox.resolveRelays(target);
|
|
637
|
+
}
|
|
638
|
+
};
|
|
512
639
|
export {
|
|
513
640
|
DOMAIN13 as CLASS_DOMAIN,
|
|
514
641
|
DOMAIN10 as CONFIG_DOMAIN,
|
|
515
642
|
DOMAIN12 as CONNECT_DOMAIN,
|
|
643
|
+
DOMAIN14 as CVM_DOMAIN,
|
|
516
644
|
DOMAIN2 as IDENTITY_DOMAIN,
|
|
517
645
|
DOMAIN5 as IFC_DOMAIN,
|
|
518
646
|
DOMAIN4 as INC_DOMAIN,
|
|
@@ -520,6 +648,7 @@ export {
|
|
|
520
648
|
DOMAIN8 as MEDIA_DOMAIN,
|
|
521
649
|
NAP_DOMAINS,
|
|
522
650
|
DOMAIN9 as NOTIFY_DOMAIN,
|
|
651
|
+
DOMAIN15 as OUTBOX_DOMAIN,
|
|
523
652
|
DOMAIN as RELAY_DOMAIN,
|
|
524
653
|
DOMAIN11 as RESOURCE_DOMAIN,
|
|
525
654
|
DOMAIN3 as STORAGE_DOMAIN,
|
|
@@ -527,6 +656,15 @@ export {
|
|
|
527
656
|
config,
|
|
528
657
|
connectGranted,
|
|
529
658
|
connectOrigins,
|
|
659
|
+
cvm,
|
|
660
|
+
cvmCallTool,
|
|
661
|
+
cvmClose,
|
|
662
|
+
cvmDiscover,
|
|
663
|
+
cvmListResources,
|
|
664
|
+
cvmListTools,
|
|
665
|
+
cvmOnEvent,
|
|
666
|
+
cvmReadResource,
|
|
667
|
+
cvmRequest,
|
|
530
668
|
getClass,
|
|
531
669
|
identity,
|
|
532
670
|
identityGetBadges,
|
|
@@ -548,12 +686,14 @@ export {
|
|
|
548
686
|
installClassShim,
|
|
549
687
|
installConfigShim,
|
|
550
688
|
installConnectShim,
|
|
689
|
+
installCvmShim,
|
|
551
690
|
installIdentityShim,
|
|
552
691
|
installIfcShim,
|
|
553
692
|
installIncShim,
|
|
554
693
|
installKeysShim,
|
|
555
694
|
installMediaShim,
|
|
556
695
|
installNotifyShim,
|
|
696
|
+
installOutboxShim,
|
|
557
697
|
installRelayShim,
|
|
558
698
|
installResourceShim,
|
|
559
699
|
installStorageShim,
|
|
@@ -584,6 +724,11 @@ export {
|
|
|
584
724
|
notifyRegisterChannel,
|
|
585
725
|
notifyRequestPermission,
|
|
586
726
|
notifySend,
|
|
727
|
+
outbox,
|
|
728
|
+
outboxPublish,
|
|
729
|
+
outboxQuery,
|
|
730
|
+
outboxResolveRelays,
|
|
731
|
+
outboxSubscribe,
|
|
587
732
|
relay,
|
|
588
733
|
relayPublish,
|
|
589
734
|
relayPublishEncrypted,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @napplet/sdk -- Typed named exports wrapping window.napplet.\n *\n * Provides `relay`, `inc`, `storage`, and `keys` objects that delegate\n * to `window.napplet.*` at call time. Developers using a bundler can import\n * individual namespaces without depending on the shim's side-effect install:\n *\n * ```ts\n * import { relay, inc } from '@napplet/sdk';\n * ```\n *\n * The shim must still be imported somewhere in the application to install\n * the `window.napplet` global. The SDK only wraps it -- it does not install it.\n *\n * Domain-specific SDK helpers are also available directly from NAP packages:\n * ```ts\n * import { relaySubscribe } from '@napplet/nap/relay';\n * import { storageGetItem } from '@napplet/nap/storage';\n * ```\n *\n * @packageDocumentation\n */\n\nimport type {\n NappletGlobal,\n NostrEvent,\n NostrFilter,\n Subscription,\n EventTemplate,\n} from '@napplet/core';\nimport type {\n MediaSessionCreate,\n MediaSessionResult,\n MediaMetadata,\n MediaState,\n MediaAction,\n} from '@napplet/nap/media';\n\n/**\n * Retrieve the `window.napplet` global, throwing a clear error if it is absent.\n *\n * Every SDK method calls this at invocation time -- not at module load time --\n * so the shim can be imported in any order relative to the SDK.\n */\nfunction requireNapplet(): NappletGlobal {\n const w = window as Window & { napplet?: NappletGlobal };\n if (!w.napplet) {\n throw new Error('window.napplet not installed -- import @napplet/shim first');\n }\n return w.napplet;\n}\n\n/**\n * NIP-01 relay operations: subscribe to events, publish events, one-shot queries.\n *\n * Each method delegates to `window.napplet.relay.*` at call time, which in turn\n * routes through the shell's relay pool via postMessage.\n *\n * @example\n * ```ts\n * import { relay } from '@napplet/sdk';\n *\n * const sub = relay.subscribe(\n * { kinds: [1], limit: 10 },\n * (event) => console.log(event),\n * () => console.log('EOSE'),\n * );\n * ```\n */\nexport const relay = {\n /**\n * Open a live NIP-01 subscription through the shell's relay pool.\n * @param filters One or more NIP-01 subscription filters\n * @param onEvent Called for each matching event\n * @param onEose Called when the shell signals end of stored events (EOSE)\n * @param options Optional: `{ relay, group }` for NIP-29 scoped relay subscriptions\n * @returns A Subscription handle with a `close()` method\n */\n subscribe(\n filters: NostrFilter | NostrFilter[],\n onEvent: (event: NostrEvent) => void,\n onEose: () => void,\n options?: { relay?: string; group?: string },\n ): Subscription {\n return requireNapplet().relay.subscribe(filters, onEvent, onEose, options);\n },\n\n /**\n * Sign and publish a Nostr event through the shell.\n * @param template Unsigned event template\n * @param options Optional: `{ relay: true }` to publish via scoped relay\n * @returns The signed NostrEvent after successful publication\n */\n publish(\n template: EventTemplate,\n options?: { relay?: boolean },\n ): Promise<NostrEvent> {\n return requireNapplet().relay.publish(template, options);\n },\n\n /**\n * Publish an encrypted Nostr event through the shell.\n * @param template Unsigned event template\n * @param recipient Hex-encoded recipient public key\n * @param encryption Encryption scheme: 'nip44' (default) or 'nip04'\n * @returns The signed encrypted NostrEvent after successful publication\n */\n publishEncrypted(\n template: EventTemplate,\n recipient: string,\n encryption: 'nip44' | 'nip04' = 'nip44',\n ): Promise<NostrEvent> {\n return requireNapplet().relay.publishEncrypted(template, recipient, encryption);\n },\n\n /**\n * One-shot query: subscribe, collect events until EOSE, then resolve.\n * @param filters NIP-01 subscription filters\n * @returns Promise resolving to array of matching NostrEvent objects\n */\n query(filters: NostrFilter | NostrFilter[]): Promise<NostrEvent[]> {\n return requireNapplet().relay.query(filters);\n },\n};\n\n/**\n * Inter-napplet pubsub: broadcast and receive INC-PEER events through the shell.\n *\n * @example\n * ```ts\n * import { inc } from '@napplet/sdk';\n *\n * inc.emit('profile:open', [], JSON.stringify({ pubkey: '...' }));\n *\n * const sub = inc.on('profile:open', (payload) => {\n * console.log('Profile requested:', payload);\n * });\n * ```\n */\nexport const inc = {\n /**\n * Broadcast an INC-PEER event to other napplets via the shell.\n * @param topic The 't' tag value (e.g., 'profile:open')\n * @param extraTags Additional NIP-01 tags beyond the 't' tag (default: [])\n * @param content Event content (default: empty string)\n */\n emit(topic: string, extraTags?: string[][], content?: string): void {\n requireNapplet().inc.emit(topic, extraTags, content);\n },\n\n /**\n * Subscribe to INC-PEER events on a specific topic.\n * @param topic The 't' tag value to listen for\n * @param callback Called with `(payload, event)` for each matching event\n * @returns A Subscription handle with a `close()` method\n */\n on(\n topic: string,\n callback: (payload: unknown, event: NostrEvent) => void,\n ): Subscription {\n return requireNapplet().inc.on(topic, callback);\n },\n};\n\n/**\n * @deprecated Use {@link inc}. NAP-IFC was renamed to NAP-INC; this package\n * alias is kept only to ease downstream migration.\n */\nexport const ifc = inc;\n\n/**\n * Napplet-scoped storage: async localStorage-like API proxied through the shell.\n * Each napplet's storage is isolated by identity.\n *\n * @example\n * ```ts\n * import { storage } from '@napplet/sdk';\n *\n * await storage.setItem('theme', 'dark');\n * const theme = await storage.getItem('theme'); // 'dark'\n * ```\n */\nexport const storage = {\n /**\n * Retrieve a stored value by key. Returns null if the key does not exist.\n * @param key The storage key\n * @returns The stored string value, or null if not found\n */\n getItem(key: string): Promise<string | null> {\n return requireNapplet().storage.getItem(key);\n },\n\n /**\n * Store a key-value pair.\n * @param key The storage key\n * @param value The string value to store\n */\n setItem(key: string, value: string): Promise<void> {\n return requireNapplet().storage.setItem(key, value);\n },\n\n /**\n * Remove a stored key.\n * @param key The storage key to remove\n */\n removeItem(key: string): Promise<void> {\n return requireNapplet().storage.removeItem(key);\n },\n\n /**\n * List all keys stored by this napplet.\n * @returns Array of storage key strings\n */\n keys(): Promise<string[]> {\n return requireNapplet().storage.keys();\n },\n};\n\n/**\n * Media session control: create sessions, report state and metadata,\n * declare capabilities, receive commands from the shell.\n *\n * @example\n * ```ts\n * import { media } from '@napplet/sdk';\n *\n * const { sessionId } = await media.createSession({\n * owner: 'napplet',\n * metadata: { title: 'My Song', artist: 'The Artist' },\n * });\n *\n * media.reportState(sessionId, { status: 'playing', position: 42.5 });\n * ```\n */\nexport const media = {\n /**\n * Create a new media session with the shell.\n * @param options Ownership-aware session options\n * @returns The shell result with canonical sessionId and owner, or error\n */\n createSession(options: MediaSessionCreate): Promise<MediaSessionResult> {\n return requireNapplet().media.createSession(options);\n },\n\n /**\n * Update metadata for an existing session.\n * @param sessionId The session to update\n * @param metadata Partial metadata fields to update\n */\n updateSession(sessionId: string, metadata: Partial<MediaMetadata>): void {\n requireNapplet().media.updateSession(sessionId, metadata);\n },\n\n /**\n * Destroy a media session.\n * @param sessionId The session to destroy\n */\n destroySession(sessionId: string): void {\n requireNapplet().media.destroySession(sessionId);\n },\n\n /**\n * Report current playback state for a session.\n * @param sessionId The session to report state for\n * @param state Current playback state\n */\n reportState(sessionId: string, state: MediaState): void {\n requireNapplet().media.reportState(sessionId, state);\n },\n\n /**\n * Declare which media actions the session currently supports.\n * @param sessionId The session to update capabilities for\n * @param actions Currently supported actions\n */\n reportCapabilities(sessionId: string, actions: MediaAction[]): void {\n requireNapplet().media.reportCapabilities(sessionId, actions);\n },\n\n /**\n * Send a command to the current playback owner.\n * @param sessionId The session to control\n * @param action The media action to request\n * @param value Optional value for seek/volume\n */\n sendCommand(sessionId: string, action: MediaAction, value?: number): void {\n requireNapplet().media.sendCommand(sessionId, action, value);\n },\n\n /**\n * Listen for media commands from the shell.\n * @param sessionId The session to listen for commands on\n * @param callback Called with (action, value?) when a command is received\n * @returns A Subscription with `close()` to stop listening\n */\n onCommand(\n sessionId: string,\n callback: (action: MediaAction, value?: number) => void,\n ): Subscription {\n return requireNapplet().media.onCommand(sessionId, callback);\n },\n\n /**\n * Listen for shell-reported playback state for shell-owned sessions.\n * @param sessionId The session to listen for state on\n * @param callback Called with playback state\n * @returns A Subscription with `close()` to stop listening\n */\n onState(\n sessionId: string,\n callback: (state: MediaState) => void,\n ): Subscription {\n return requireNapplet().media.onState(sessionId, callback);\n },\n\n /**\n * Listen for shell-reported capabilities for shell-owned sessions.\n * @param sessionId The session to listen for capabilities on\n * @param callback Called with available actions\n * @returns A Subscription with `close()` to stop listening\n */\n onCapabilities(\n sessionId: string,\n callback: (actions: MediaAction[]) => void,\n ): Subscription {\n return requireNapplet().media.onCapabilities(sessionId, callback);\n },\n\n /**\n * Listen for the shell's media control list.\n * @param sessionId The session to associate controls with\n * @param callback Called with the shell's supported controls\n * @returns A Subscription with `close()` to stop listening\n */\n onControls(\n sessionId: string,\n callback: (controls: MediaAction[]) => void,\n ): Subscription {\n return requireNapplet().media.onControls(sessionId, callback);\n },\n};\n\n/**\n * Shell-rendered notifications: send notifications, set badge counts,\n * register channels, request permission, listen for user interaction.\n *\n * @example\n * ```ts\n * import { notify } from '@napplet/sdk';\n *\n * const { notificationId } = await notify.send({\n * title: 'New message', body: 'Alice: hey!',\n * });\n *\n * notify.badge(3);\n * ```\n */\nexport const notify = {\n /**\n * Send a notification to the shell.\n * @param notification Notification payload (title required)\n * @returns The shell-assigned notificationId\n */\n send(notification: {\n title: string;\n body?: string;\n icon?: string;\n actions?: { id: string; label: string }[];\n channel?: string;\n priority?: 'low' | 'normal' | 'high' | 'urgent';\n }): Promise<{ notificationId: string }> {\n return requireNapplet().notify.send(notification);\n },\n\n /**\n * Dismiss a notification by ID.\n * @param notificationId The notification to dismiss\n */\n dismiss(notificationId: string): void {\n requireNapplet().notify.dismiss(notificationId);\n },\n\n /**\n * Set the badge count for this napplet. Pass 0 to clear.\n * @param count Badge count\n */\n badge(count: number): void {\n requireNapplet().notify.badge(count);\n },\n\n /**\n * Register a notification channel.\n * @param channel Channel definition\n */\n registerChannel(channel: {\n channelId: string;\n label: string;\n description?: string;\n defaultPriority?: 'low' | 'normal' | 'high' | 'urgent';\n }): void {\n requireNapplet().notify.registerChannel(channel);\n },\n\n /**\n * Request permission to send notifications.\n * @param channel Optional channel to request permission for\n * @returns Whether permission was granted\n */\n requestPermission(channel?: string): Promise<{ granted: boolean }> {\n return requireNapplet().notify.requestPermission(channel);\n },\n\n /**\n * Listen for action button clicks on notifications.\n * @param callback Called with (notificationId, actionId)\n * @returns A Subscription with `close()` to stop listening\n */\n onAction(\n callback: (notificationId: string, actionId: string) => void,\n ): Subscription {\n return requireNapplet().notify.onAction(callback);\n },\n\n /**\n * Listen for notification body clicks.\n * @param callback Called with (notificationId)\n * @returns A Subscription with `close()` to stop listening\n */\n onClicked(\n callback: (notificationId: string) => void,\n ): Subscription {\n return requireNapplet().notify.onClicked(callback);\n },\n\n /**\n * Listen for notification dismissals.\n * @param callback Called with (notificationId, reason?)\n * @returns A Subscription with `close()` to stop listening\n */\n onDismissed(\n callback: (notificationId: string, reason?: string) => void,\n ): Subscription {\n return requireNapplet().notify.onDismissed(callback);\n },\n\n /**\n * Listen for the shell's notification capability list.\n * @param callback Called with supported controls\n * @returns A Subscription with `close()` to stop listening\n */\n onControls(\n callback: (controls: ('toasts' | 'badges' | 'actions' | 'channels' | 'system')[]) => void,\n ): Subscription {\n return requireNapplet().notify.onControls(callback);\n },\n};\n\n/**\n * Keyboard forwarding and action keybindings: register named actions the shell\n * can bind to keys, listen for shell-triggered actions locally.\n *\n * @example\n * ```ts\n * import { keys } from '@napplet/sdk';\n *\n * const result = await keys.registerAction({\n * id: 'editor.save',\n * label: 'Save',\n * defaultKey: 'Ctrl+S',\n * });\n *\n * const sub = keys.onAction('editor.save', () => {\n * console.log('Save triggered!');\n * });\n * ```\n */\nexport const keys = {\n /**\n * Declare a named action that the shell can bind to a key.\n * @param action The action to register (id, label, optional defaultKey)\n * @returns The assigned binding, if any\n */\n registerAction(action: {\n id: string;\n label: string;\n defaultKey?: string;\n }): Promise<{ actionId: string; binding?: string }> {\n return requireNapplet().keys.registerAction(action);\n },\n\n /**\n * Remove a previously registered action.\n * @param actionId The action to unregister\n */\n unregisterAction(actionId: string): void {\n requireNapplet().keys.unregisterAction(actionId);\n },\n\n /**\n * Register a local handler for when a bound key is pressed.\n * @param actionId The action to listen for\n * @param callback Called when the action is triggered\n * @returns A Subscription with `close()` to stop listening\n */\n onAction(actionId: string, callback: () => void): Subscription {\n return requireNapplet().keys.onAction(actionId, callback);\n },\n\n /**\n * Convenience: register a named action AND wire a local handler in one call.\n * Returns a handle whose `close()` both unregisters the action and removes\n * the onAction listener.\n *\n * @param action The action to register (id, label, optional defaultKey)\n * @param handler Called when the shell triggers this action\n * @returns The assigned binding plus a `close()` teardown function\n *\n * @example\n * ```ts\n * import { keys } from '@napplet/sdk';\n *\n * const handle = await keys.register(\n * { id: 'editor.save', label: 'Save', defaultKey: 'Ctrl+S' },\n * () => saveDocument(),\n * );\n *\n * // Later, tear down both registration and listener:\n * handle.close();\n * ```\n */\n async register(\n action: { id: string; label: string; defaultKey?: string },\n handler: () => void,\n ): Promise<{ actionId: string; binding?: string; close: () => void }> {\n const n = requireNapplet();\n const result = await n.keys.registerAction(action);\n const sub = n.keys.onAction(action.id, handler);\n return {\n ...result,\n close() {\n sub.close();\n n.keys.unregisterAction(action.id);\n },\n };\n },\n};\n\n/**\n * Read-only user identity queries: public key, profile, follows, relays,\n * lists, zaps, mutes, blocked, badges.\n *\n * @example\n * ```ts\n * import { identity } from '@napplet/sdk';\n *\n * const pubkey = await identity.getPublicKey();\n * const profile = await identity.getProfile();\n * const follows = await identity.getFollows();\n * ```\n */\nexport const identity = {\n /**\n * Get the user's hex-encoded public key. Always succeeds.\n * @returns Hex-encoded public key string\n */\n getPublicKey(): Promise<string> {\n return requireNapplet().identity.getPublicKey();\n },\n\n /**\n * Listen for shell-pushed user identity changes.\n * @param handler Called with a hex pubkey, or \"\" when no user/signer is connected\n * @returns Subscription with close() to detach the handler\n */\n onChanged(handler: (pubkey: string) => void): Subscription {\n return requireNapplet().identity.onChanged(handler);\n },\n\n /**\n * Get the user's relay list (NIP-65).\n * @returns Record mapping relay URLs to read/write permissions\n */\n getRelays(): Promise<Record<string, { read: boolean; write: boolean }>> {\n return requireNapplet().identity.getRelays();\n },\n\n /**\n * Get the user's profile metadata (kind 0).\n * @returns Profile data, or null if not found\n */\n getProfile(): Promise<{\n name?: string;\n displayName?: string;\n about?: string;\n picture?: string;\n banner?: string;\n nip05?: string;\n lud16?: string;\n website?: string;\n } | null> {\n return requireNapplet().identity.getProfile();\n },\n\n /**\n * Get the user's follow list (kind 3 contact list).\n * @returns Array of hex-encoded public keys\n */\n getFollows(): Promise<string[]> {\n return requireNapplet().identity.getFollows();\n },\n\n /**\n * Get entries from a user's categorized list.\n * @param listType List category (e.g., \"bookmarks\", \"interests\", \"pins\")\n * @returns Array of list entry values\n */\n getList(listType: string): Promise<string[]> {\n return requireNapplet().identity.getList(listType);\n },\n\n /**\n * Get zap receipts sent to the user.\n * @returns Array of zap receipt objects\n */\n getZaps(): Promise<{\n eventId: string;\n sender: string;\n amount: number;\n content?: string;\n }[]> {\n return requireNapplet().identity.getZaps();\n },\n\n /**\n * Get the user's mute list (kind 10000).\n * @returns Array of hex-encoded muted public keys\n */\n getMutes(): Promise<string[]> {\n return requireNapplet().identity.getMutes();\n },\n\n /**\n * Get the user's block list.\n * @returns Array of hex-encoded blocked public keys\n */\n getBlocked(): Promise<string[]> {\n return requireNapplet().identity.getBlocked();\n },\n\n /**\n * Get badges awarded to the user (NIP-58).\n * @returns Array of badge objects\n */\n getBadges(): Promise<{\n id: string;\n name?: string;\n description?: string;\n image?: string;\n thumbs?: string[];\n awardedBy: string;\n }[]> {\n return requireNapplet().identity.getBadges();\n },\n};\n\n/**\n * Per-napplet declarative configuration (NAP-CONFIG): register a schema,\n * read current values, subscribe to live updates, deep-link into the\n * shell-owned settings UI, and listen for schema errors.\n *\n * @example\n * ```ts\n * import { config } from '@napplet/sdk';\n *\n * await config.registerSchema({\n * type: 'object',\n * properties: { theme: { type: 'string', enum: ['light', 'dark'], default: 'dark' } },\n * });\n *\n * const sub = config.subscribe((values) => { applyTheme(values.theme); });\n *\n * config.openSettings({ section: 'appearance' });\n * ```\n */\nexport const config = {\n /**\n * Snapshot current validated + defaulted config values.\n * @returns A one-shot ConfigValues object.\n */\n get(): Promise<Record<string, unknown>> {\n return requireNapplet().config.get();\n },\n\n /**\n * Subscribe to live configuration updates.\n * First delivery is an immediate snapshot; subsequent deliveries fire on change.\n * @param callback Invoked with the full ConfigValues on every change.\n * @returns A Subscription with close() to stop listening.\n */\n subscribe(\n callback: (values: Record<string, unknown>) => void,\n ): Subscription {\n return requireNapplet().config.subscribe(callback);\n },\n\n /**\n * Request the shell open its settings UI for this napplet.\n * @param options Optional { section } to deep-link by x-napplet-section name.\n */\n openSettings(options?: { section?: string }): void {\n requireNapplet().config.openSettings(options);\n },\n\n /**\n * Register a napplet configuration schema at runtime (escape hatch;\n * prefer manifest-declared via @napplet/vite-plugin's configSchema option).\n * @param schema JSON Schema (draft-07+) describing the config surface.\n * @param version Optional `$version` migration hint.\n */\n registerSchema(\n schema: Record<string, unknown>,\n version?: number,\n ): Promise<void> {\n return requireNapplet().config.registerSchema(schema, version);\n },\n\n /**\n * Listen for schema-registration errors pushed by the shell\n * (manifest parse failure, no-schema on subscribe-before-schema, etc.).\n * @param callback Invoked with { code, error } on every push.\n * @returns A plain teardown function that detaches the listener.\n */\n onSchemaError(\n callback: (err: { code: string; error: string }) => void,\n ): () => void {\n return requireNapplet().config.onSchemaError(callback);\n },\n\n /**\n * Current schema snapshot (readonly). Populated from the\n * `<meta name=\"napplet-config-schema\">` manifest tag at shim install,\n * updated on successful registerSchema responses.\n * @returns The registered schema, or null if none.\n */\n get schema(): Record<string, unknown> | null {\n return requireNapplet().config.schema;\n },\n};\n\n/**\n * Browser-enforced byte-fetching primitive: napplets request bytes by URL,\n * shell fetches and returns a Blob. URL space is scheme-pluggable\n * (`data:`, `https:`, `blossom:`, `nostr:`).\n *\n * @example\n * ```ts\n * import { resource } from '@napplet/sdk';\n *\n * const blob = await resource.bytes('https://example.com/avatar.png');\n * const handle = resource.bytesAsObjectURL('blossom:abc123...');\n * imgEl.src = handle.url;\n * imgEl.onload = () => handle.revoke();\n * ```\n */\nexport const resource = {\n /**\n * Fetch bytes for a URL through the shell's resource pipeline.\n * @param url URL identifying the resource (any registered scheme).\n * @returns Promise resolving to the fetched bytes as a Blob.\n */\n bytes(url: string): Promise<Blob> {\n return requireNapplet().resource.bytes(url);\n },\n\n /**\n * Fetch bytes and return a managed object URL handle.\n * Call `revoke()` to release the underlying Blob URL.\n * @param url URL identifying the resource.\n * @returns Synchronous handle `{ url, revoke }`.\n */\n bytesAsObjectURL(url: string): { url: string; revoke: () => void } {\n return requireNapplet().resource.bytesAsObjectURL(url);\n },\n};\n\nexport type { NostrEvent } from '@napplet/core';\nexport type { NostrFilter } from '@napplet/core';\nexport type { Subscription } from '@napplet/core';\nexport type { EventTemplate } from '@napplet/core';\n\nexport type {\n NappletMessage,\n NapDomain,\n NamespacedCapability,\n NapProtocolId,\n ProtocolId,\n ShellSupports,\n} from '@napplet/core';\nexport { NAP_DOMAINS } from '@napplet/core';\n\n// Relay NAP\nexport type {\n RelayMessage,\n RelaySubscribeMessage,\n RelayCloseMessage,\n RelayPublishMessage,\n RelayPublishEncryptedMessage,\n RelayQueryMessage,\n RelayEventMessage,\n RelayEoseMessage,\n RelayClosedMessage,\n RelayPublishResultMessage,\n RelayPublishEncryptedResultMessage,\n RelayQueryResultMessage,\n RelayOutboundMessage,\n RelayInboundMessage,\n RelayNapMessage,\n} from '@napplet/nap/relay';\n\n// Identity NAP\nexport type {\n ProfileData,\n ZapReceipt,\n Badge,\n RelayPermission as IdentityRelayPermission,\n IdentityMessage,\n IdentityGetPublicKeyMessage,\n IdentityGetRelaysMessage,\n IdentityGetProfileMessage,\n IdentityGetFollowsMessage,\n IdentityGetListMessage,\n IdentityGetZapsMessage,\n IdentityGetMutesMessage,\n IdentityGetBlockedMessage,\n IdentityGetBadgesMessage,\n IdentityGetPublicKeyResultMessage,\n IdentityGetRelaysResultMessage,\n IdentityGetProfileResultMessage,\n IdentityGetFollowsResultMessage,\n IdentityGetListResultMessage,\n IdentityGetZapsResultMessage,\n IdentityGetMutesResultMessage,\n IdentityGetBlockedResultMessage,\n IdentityGetBadgesResultMessage,\n IdentityChangedMessage,\n IdentityRequestMessage,\n IdentityResultMessage,\n IdentityNapMessage,\n} from '@napplet/nap/identity';\n\n// Storage NAP\nexport type {\n StorageMessage,\n StorageGetMessage,\n StorageSetMessage,\n StorageRemoveMessage,\n StorageKeysMessage,\n StorageGetResultMessage,\n StorageSetResultMessage,\n StorageRemoveResultMessage,\n StorageKeysResultMessage,\n StorageRequestMessage,\n StorageResultMessage,\n StorageNapMessage,\n} from '@napplet/nap/storage';\n\n// INC NAP\nexport type {\n IncMessage,\n IncEmitMessage,\n IncSubscribeMessage,\n IncSubscribeResultMessage,\n IncUnsubscribeMessage,\n IncEventMessage,\n IncChannelOpenMessage,\n IncChannelOpenResultMessage,\n IncChannelEmitMessage,\n IncChannelEventMessage,\n IncChannelBroadcastMessage,\n IncChannelListMessage,\n IncChannelListResultMessage,\n IncChannelCloseMessage,\n IncChannelClosedMessage,\n IncTopicMessage,\n IncChannelMessage,\n IncOutboundMessage,\n IncInboundMessage,\n IncNapMessage,\n} from '@napplet/nap/inc';\n\n// Deprecated IFC compatibility aliases\nexport type {\n IfcMessage,\n IfcEmitMessage,\n IfcSubscribeMessage,\n IfcSubscribeResultMessage,\n IfcUnsubscribeMessage,\n IfcEventMessage,\n IfcChannelOpenMessage,\n IfcChannelOpenResultMessage,\n IfcChannelEmitMessage,\n IfcChannelEventMessage,\n IfcChannelBroadcastMessage,\n IfcChannelListMessage,\n IfcChannelListResultMessage,\n IfcChannelCloseMessage,\n IfcChannelClosedMessage,\n IfcTopicMessage,\n IfcChannelMessage,\n IfcOutboundMessage,\n IfcInboundMessage,\n IfcNapMessage,\n} from '@napplet/nap/ifc';\n\n// Theme NAP\nexport type {\n ThemeColors,\n ThemeFont,\n ThemeBackground,\n Theme,\n ThemeMessage,\n ThemeGetMessage,\n ThemeGetResultMessage,\n ThemeChangedMessage,\n ThemeRequestMessage,\n ThemeResultMessage,\n ThemeNapMessage,\n} from '@napplet/nap/theme';\n\n// Keys NAP\nexport type {\n Action,\n RegisterResult,\n KeyBinding,\n KeysMessage,\n KeysForwardMessage,\n KeysRegisterActionMessage,\n KeysRegisterActionResultMessage,\n KeysUnregisterActionMessage,\n KeysBindingsMessage,\n KeysActionMessage,\n KeysRequestMessage,\n KeysResultMessage,\n KeysNapMessage,\n} from '@napplet/nap/keys';\n\n// Media NAP\nexport type {\n MediaMetadata,\n MediaArtwork,\n MediaPlaybackOwner,\n MediaSourceRef,\n MediaSessionCreate,\n MediaSessionResult,\n MediaState,\n MediaAction,\n MediaMessage,\n MediaSessionCreateMessage,\n MediaSessionCreateResultMessage,\n MediaSessionUpdateMessage,\n MediaSessionDestroyMessage,\n MediaStateMessage,\n MediaCapabilitiesMessage,\n MediaCommandMessage,\n MediaControlsMessage,\n MediaRequestMessage,\n MediaResultMessage,\n MediaNapMessage,\n} from '@napplet/nap/media';\n\n// Notify NAP\nexport type {\n NotificationPriority,\n NotificationAction,\n NotificationChannel,\n NotifyControl,\n NotifyMessage,\n NotifySendMessage,\n NotifySendResultMessage,\n NotifyDismissMessage,\n NotifyBadgeMessage,\n NotifyChannelRegisterMessage,\n NotifyPermissionRequestMessage,\n NotifyPermissionResultMessage,\n NotifyActionMessage,\n NotifyClickedMessage,\n NotifyDismissedMessage,\n NotifyControlsMessage,\n NotifyRequestMessage,\n NotifyResultMessage,\n NotifyNapMessage,\n} from '@napplet/nap/notify';\n\n// Config NAP\nexport type {\n NappletConfigSchema,\n ConfigSchema,\n ConfigValues,\n ConfigSchemaErrorCode,\n NappletConfigSchemaExtensions,\n ConfigMessage,\n ConfigRegisterSchemaMessage,\n ConfigGetMessage,\n ConfigSubscribeMessage,\n ConfigUnsubscribeMessage,\n ConfigOpenSettingsMessage,\n ConfigRegisterSchemaResultMessage,\n ConfigValuesMessage,\n ConfigSchemaErrorMessage,\n ConfigRequestMessage,\n ConfigResultMessage,\n ConfigNapMessage,\n} from '@napplet/nap/config';\n\n// Resource NAP\nexport type {\n ResourceErrorCode,\n ResourceScheme,\n ResourceMessage,\n ResourceBytesMessage,\n ResourceCancelMessage,\n ResourceBytesResultMessage,\n ResourceBytesErrorMessage,\n ResourceSidecarEntry,\n ResourceRequestMessage,\n ResourceResultMessage,\n ResourceNapMessage,\n} from '@napplet/nap/resource';\n\n// Connect NAP\nexport type {\n NappletConnect,\n} from '@napplet/nap/connect';\n\n// Class NAP\nexport type {\n ClassMessage,\n ClassAssignedMessage,\n NappletClass,\n ClassNapMessage,\n} from '@napplet/nap/class';\n\nexport { DOMAIN as RELAY_DOMAIN } from '@napplet/nap/relay';\nexport { DOMAIN as IDENTITY_DOMAIN } from '@napplet/nap/identity';\nexport { DOMAIN as STORAGE_DOMAIN } from '@napplet/nap/storage';\nexport { DOMAIN as INC_DOMAIN } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link INC_DOMAIN}. This compatibility export resolves to\n * the canonical `inc` domain string.\n */\nexport { DOMAIN as IFC_DOMAIN } from '@napplet/nap/ifc';\nexport { DOMAIN as THEME_DOMAIN } from '@napplet/nap/theme';\nexport { DOMAIN as KEYS_DOMAIN } from '@napplet/nap/keys';\nexport { DOMAIN as MEDIA_DOMAIN } from '@napplet/nap/media';\nexport { DOMAIN as NOTIFY_DOMAIN } from '@napplet/nap/notify';\nexport { DOMAIN as CONFIG_DOMAIN } from '@napplet/nap/config';\nexport { DOMAIN as RESOURCE_DOMAIN } from '@napplet/nap/resource';\nexport { DOMAIN as CONNECT_DOMAIN } from '@napplet/nap/connect';\nexport { DOMAIN as CLASS_DOMAIN } from '@napplet/nap/class';\n\nexport { installRelayShim } from '@napplet/nap/relay';\nexport { installIdentityShim } from '@napplet/nap/identity';\nexport { installStorageShim } from '@napplet/nap/storage';\nexport { installIncShim } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link installIncShim}.\n */\nexport { installIfcShim } from '@napplet/nap/ifc';\nexport { installKeysShim } from '@napplet/nap/keys';\nexport { installMediaShim } from '@napplet/nap/media';\nexport { installNotifyShim } from '@napplet/nap/notify';\nexport { installConfigShim } from '@napplet/nap/config';\nexport { installResourceShim } from '@napplet/nap/resource';\nexport { installConnectShim } from '@napplet/nap/connect';\nexport { installClassShim } from '@napplet/nap/class';\n\nexport { relaySubscribe, relayPublish, relayPublishEncrypted, relayQuery } from '@napplet/nap/relay';\nexport {\n identityGetPublicKey,\n identityOnChanged,\n identityGetRelays,\n identityGetProfile,\n identityGetFollows,\n identityGetList,\n identityGetZaps,\n identityGetMutes,\n identityGetBlocked,\n identityGetBadges,\n} from '@napplet/nap/identity';\nexport { storageGetItem, storageSetItem, storageRemoveItem, storageKeys } from '@napplet/nap/storage';\nexport { incEmit, incOn } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link incEmit} and {@link incOn}.\n */\nexport { ifcEmit, ifcOn } from '@napplet/nap/ifc';\nexport { keysRegisterAction, keysUnregisterAction, keysOnAction, keysRegister } from '@napplet/nap/keys';\nexport { mediaCreateSession, mediaUpdateSession, mediaDestroySession, mediaReportState, mediaReportCapabilities, mediaSendCommand, mediaOnCommand, mediaOnState, mediaOnCapabilities, mediaOnControls } from '@napplet/nap/media';\nexport { notifySend, notifyDismiss, notifyBadge, notifyRegisterChannel, notifyRequestPermission, notifyOnAction, notifyOnClicked, notifyOnDismissed, notifyOnControls } from '@napplet/nap/notify';\nexport { resourceBytes, resourceBytesAsObjectURL } from '@napplet/nap/resource';\nexport { connectGranted, connectOrigins, normalizeConnectOrigin } from '@napplet/nap/connect';\nexport { getClass } from '@napplet/nap/class';\n"],"mappings":";AA8xBA,SAAS,mBAAmB;AAoP5B,SAAmB,cAAoB;AACvC,SAAmB,UAAVA,eAAiC;AAC1C,SAAmB,UAAVA,eAAgC;AACzC,SAAmB,UAAVA,eAA4B;AAKrC,SAAmB,UAAVA,eAA4B;AACrC,SAAmB,UAAVA,eAA8B;AACvC,SAAmB,UAAVA,eAA6B;AACtC,SAAmB,UAAVA,eAA8B;AACvC,SAAmB,UAAVA,eAA+B;AACxC,SAAmB,UAAVA,gBAA+B;AACxC,SAAmB,UAAVA,gBAAiC;AAC1C,SAAmB,UAAVA,gBAAgC;AACzC,SAAmB,UAAVA,gBAA8B;AAEvC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAI/B,SAAS,sBAAsB;AAC/B,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAClC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AAEjC,SAAS,gBAAgB,c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;AAAA,EAQA,UACE,UACc;AACd,WAAO,eAAe,EAAE,OAAO,UAAU,QAAQ;AAAA,EACnD;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,SAAsC;AACjD,mBAAe,EAAE,OAAO,aAAa,OAAO;AAAA,EAC9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,eACE,QACA,SACe;AACf,WAAO,eAAe,EAAE,OAAO,eAAe,QAAQ,OAAO;AAAA,EAC/D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,cACE,UACY;AACZ,WAAO,eAAe,EAAE,OAAO,cAAc,QAAQ;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,IAAI,SAAyC;AAC3C,WAAO,eAAe,EAAE,OAAO;AAAA,EACjC;AACF;AAiBO,IAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMtB,MAAM,KAA4B;AAChC,WAAO,eAAe,EAAE,SAAS,MAAM,GAAG;AAAA,EAC5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,iBAAiB,KAAkD;AACjE,WAAO,eAAe,EAAE,SAAS,iBAAiB,GAAG;AAAA,EACvD;AACF;","names":["DOMAIN"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @napplet/sdk -- Typed named exports wrapping window.napplet.\n *\n * Provides `relay`, `inc`, `storage`, and `keys` objects that delegate\n * to `window.napplet.*` at call time. Developers using a bundler can import\n * individual namespaces without depending on the shim's side-effect install:\n *\n * ```ts\n * import { relay, inc } from '@napplet/sdk';\n * ```\n *\n * The shim must still be imported somewhere in the application to install\n * the `window.napplet` global. The SDK only wraps it -- it does not install it.\n *\n * Domain-specific SDK helpers are also available directly from NAP packages:\n * ```ts\n * import { relaySubscribe } from '@napplet/nap/relay';\n * import { storageGetItem } from '@napplet/nap/storage';\n * ```\n *\n * @packageDocumentation\n */\n\nimport type {\n NappletGlobal,\n NostrEvent,\n NostrFilter,\n Subscription,\n EventTemplate,\n CvmServerRef,\n CvmServer,\n CvmDiscoverQuery,\n CvmRequestOptions,\n McpMessage,\n McpTool,\n McpToolResult,\n McpResource,\n McpResourceContent,\n OutboxQueryOptions,\n OutboxSubscribeOptions,\n OutboxPublishOptions,\n OutboxTarget,\n OutboxRelayPlan,\n OutboxResult,\n OutboxPublishResult,\n OutboxSubscription,\n} from '@napplet/core';\nimport type {\n MediaSessionCreate,\n MediaSessionResult,\n MediaMetadata,\n MediaState,\n MediaAction,\n} from '@napplet/nap/media';\n\n/**\n * Retrieve the `window.napplet` global, throwing a clear error if it is absent.\n *\n * Every SDK method calls this at invocation time -- not at module load time --\n * so the shim can be imported in any order relative to the SDK.\n */\nfunction requireNapplet(): NappletGlobal {\n const w = window as Window & { napplet?: NappletGlobal };\n if (!w.napplet) {\n throw new Error('window.napplet not installed -- import @napplet/shim first');\n }\n return w.napplet;\n}\n\n/**\n * NIP-01 relay operations: subscribe to events, publish events, one-shot queries.\n *\n * Each method delegates to `window.napplet.relay.*` at call time, which in turn\n * routes through the shell's relay pool via postMessage.\n *\n * @example\n * ```ts\n * import { relay } from '@napplet/sdk';\n *\n * const sub = relay.subscribe(\n * { kinds: [1], limit: 10 },\n * (event) => console.log(event),\n * () => console.log('EOSE'),\n * );\n * ```\n */\nexport const relay = {\n /**\n * Open a live NIP-01 subscription through the shell's relay pool.\n * @param filters One or more NIP-01 subscription filters\n * @param onEvent Called for each matching event\n * @param onEose Called when the shell signals end of stored events (EOSE)\n * @param options Optional: `{ relay, group }` for NIP-29 scoped relay subscriptions\n * @returns A Subscription handle with a `close()` method\n */\n subscribe(\n filters: NostrFilter | NostrFilter[],\n onEvent: (event: NostrEvent) => void,\n onEose: () => void,\n options?: { relay?: string; group?: string },\n ): Subscription {\n return requireNapplet().relay.subscribe(filters, onEvent, onEose, options);\n },\n\n /**\n * Sign and publish a Nostr event through the shell.\n * @param template Unsigned event template\n * @param options Optional: `{ relay: true }` to publish via scoped relay\n * @returns The signed NostrEvent after successful publication\n */\n publish(\n template: EventTemplate,\n options?: { relay?: boolean },\n ): Promise<NostrEvent> {\n return requireNapplet().relay.publish(template, options);\n },\n\n /**\n * Publish an encrypted Nostr event through the shell.\n * @param template Unsigned event template\n * @param recipient Hex-encoded recipient public key\n * @param encryption Encryption scheme: 'nip44' (default) or 'nip04'\n * @returns The signed encrypted NostrEvent after successful publication\n */\n publishEncrypted(\n template: EventTemplate,\n recipient: string,\n encryption: 'nip44' | 'nip04' = 'nip44',\n ): Promise<NostrEvent> {\n return requireNapplet().relay.publishEncrypted(template, recipient, encryption);\n },\n\n /**\n * One-shot query: subscribe, collect events until EOSE, then resolve.\n * @param filters NIP-01 subscription filters\n * @returns Promise resolving to array of matching NostrEvent objects\n */\n query(filters: NostrFilter | NostrFilter[]): Promise<NostrEvent[]> {\n return requireNapplet().relay.query(filters);\n },\n};\n\n/**\n * Inter-napplet pubsub: broadcast and receive INC-PEER events through the shell.\n *\n * @example\n * ```ts\n * import { inc } from '@napplet/sdk';\n *\n * inc.emit('profile:open', [], JSON.stringify({ pubkey: '...' }));\n *\n * const sub = inc.on('profile:open', (payload) => {\n * console.log('Profile requested:', payload);\n * });\n * ```\n */\nexport const inc = {\n /**\n * Broadcast an INC-PEER event to other napplets via the shell.\n * @param topic The 't' tag value (e.g., 'profile:open')\n * @param extraTags Additional NIP-01 tags beyond the 't' tag (default: [])\n * @param content Event content (default: empty string)\n */\n emit(topic: string, extraTags?: string[][], content?: string): void {\n requireNapplet().inc.emit(topic, extraTags, content);\n },\n\n /**\n * Subscribe to INC-PEER events on a specific topic.\n * @param topic The 't' tag value to listen for\n * @param callback Called with `(payload, event)` for each matching event\n * @returns A Subscription handle with a `close()` method\n */\n on(\n topic: string,\n callback: (payload: unknown, event: NostrEvent) => void,\n ): Subscription {\n return requireNapplet().inc.on(topic, callback);\n },\n};\n\n/**\n * @deprecated Use {@link inc}. NAP-IFC was renamed to NAP-INC; this package\n * alias is kept only to ease downstream migration.\n */\nexport const ifc = inc;\n\n/**\n * Napplet-scoped storage: async localStorage-like API proxied through the shell.\n * Each napplet's storage is isolated by identity.\n *\n * @example\n * ```ts\n * import { storage } from '@napplet/sdk';\n *\n * await storage.setItem('theme', 'dark');\n * const theme = await storage.getItem('theme'); // 'dark'\n * ```\n */\nexport const storage = {\n /**\n * Retrieve a stored value by key. Returns null if the key does not exist.\n * @param key The storage key\n * @returns The stored string value, or null if not found\n */\n getItem(key: string): Promise<string | null> {\n return requireNapplet().storage.getItem(key);\n },\n\n /**\n * Store a key-value pair.\n * @param key The storage key\n * @param value The string value to store\n */\n setItem(key: string, value: string): Promise<void> {\n return requireNapplet().storage.setItem(key, value);\n },\n\n /**\n * Remove a stored key.\n * @param key The storage key to remove\n */\n removeItem(key: string): Promise<void> {\n return requireNapplet().storage.removeItem(key);\n },\n\n /**\n * List all keys stored by this napplet.\n * @returns Array of storage key strings\n */\n keys(): Promise<string[]> {\n return requireNapplet().storage.keys();\n },\n};\n\n/**\n * Media session control: create sessions, report state and metadata,\n * declare capabilities, receive commands from the shell.\n *\n * @example\n * ```ts\n * import { media } from '@napplet/sdk';\n *\n * const { sessionId } = await media.createSession({\n * owner: 'napplet',\n * metadata: { title: 'My Song', artist: 'The Artist' },\n * });\n *\n * media.reportState(sessionId, { status: 'playing', position: 42.5 });\n * ```\n */\nexport const media = {\n /**\n * Create a new media session with the shell.\n * @param options Ownership-aware session options\n * @returns The shell result with canonical sessionId and owner, or error\n */\n createSession(options: MediaSessionCreate): Promise<MediaSessionResult> {\n return requireNapplet().media.createSession(options);\n },\n\n /**\n * Update metadata for an existing session.\n * @param sessionId The session to update\n * @param metadata Partial metadata fields to update\n */\n updateSession(sessionId: string, metadata: Partial<MediaMetadata>): void {\n requireNapplet().media.updateSession(sessionId, metadata);\n },\n\n /**\n * Destroy a media session.\n * @param sessionId The session to destroy\n */\n destroySession(sessionId: string): void {\n requireNapplet().media.destroySession(sessionId);\n },\n\n /**\n * Report current playback state for a session.\n * @param sessionId The session to report state for\n * @param state Current playback state\n */\n reportState(sessionId: string, state: MediaState): void {\n requireNapplet().media.reportState(sessionId, state);\n },\n\n /**\n * Declare which media actions the session currently supports.\n * @param sessionId The session to update capabilities for\n * @param actions Currently supported actions\n */\n reportCapabilities(sessionId: string, actions: MediaAction[]): void {\n requireNapplet().media.reportCapabilities(sessionId, actions);\n },\n\n /**\n * Send a command to the current playback owner.\n * @param sessionId The session to control\n * @param action The media action to request\n * @param value Optional value for seek/volume\n */\n sendCommand(sessionId: string, action: MediaAction, value?: number): void {\n requireNapplet().media.sendCommand(sessionId, action, value);\n },\n\n /**\n * Listen for media commands from the shell.\n * @param sessionId The session to listen for commands on\n * @param callback Called with (action, value?) when a command is received\n * @returns A Subscription with `close()` to stop listening\n */\n onCommand(\n sessionId: string,\n callback: (action: MediaAction, value?: number) => void,\n ): Subscription {\n return requireNapplet().media.onCommand(sessionId, callback);\n },\n\n /**\n * Listen for shell-reported playback state for shell-owned sessions.\n * @param sessionId The session to listen for state on\n * @param callback Called with playback state\n * @returns A Subscription with `close()` to stop listening\n */\n onState(\n sessionId: string,\n callback: (state: MediaState) => void,\n ): Subscription {\n return requireNapplet().media.onState(sessionId, callback);\n },\n\n /**\n * Listen for shell-reported capabilities for shell-owned sessions.\n * @param sessionId The session to listen for capabilities on\n * @param callback Called with available actions\n * @returns A Subscription with `close()` to stop listening\n */\n onCapabilities(\n sessionId: string,\n callback: (actions: MediaAction[]) => void,\n ): Subscription {\n return requireNapplet().media.onCapabilities(sessionId, callback);\n },\n\n /**\n * Listen for the shell's media control list.\n * @param sessionId The session to associate controls with\n * @param callback Called with the shell's supported controls\n * @returns A Subscription with `close()` to stop listening\n */\n onControls(\n sessionId: string,\n callback: (controls: MediaAction[]) => void,\n ): Subscription {\n return requireNapplet().media.onControls(sessionId, callback);\n },\n};\n\n/**\n * Shell-rendered notifications: send notifications, set badge counts,\n * register channels, request permission, listen for user interaction.\n *\n * @example\n * ```ts\n * import { notify } from '@napplet/sdk';\n *\n * const { notificationId } = await notify.send({\n * title: 'New message', body: 'Alice: hey!',\n * });\n *\n * notify.badge(3);\n * ```\n */\nexport const notify = {\n /**\n * Send a notification to the shell.\n * @param notification Notification payload (title required)\n * @returns The shell-assigned notificationId\n */\n send(notification: {\n title: string;\n body?: string;\n icon?: string;\n actions?: { id: string; label: string }[];\n channel?: string;\n priority?: 'low' | 'normal' | 'high' | 'urgent';\n }): Promise<{ notificationId: string }> {\n return requireNapplet().notify.send(notification);\n },\n\n /**\n * Dismiss a notification by ID.\n * @param notificationId The notification to dismiss\n */\n dismiss(notificationId: string): void {\n requireNapplet().notify.dismiss(notificationId);\n },\n\n /**\n * Set the badge count for this napplet. Pass 0 to clear.\n * @param count Badge count\n */\n badge(count: number): void {\n requireNapplet().notify.badge(count);\n },\n\n /**\n * Register a notification channel.\n * @param channel Channel definition\n */\n registerChannel(channel: {\n channelId: string;\n label: string;\n description?: string;\n defaultPriority?: 'low' | 'normal' | 'high' | 'urgent';\n }): void {\n requireNapplet().notify.registerChannel(channel);\n },\n\n /**\n * Request permission to send notifications.\n * @param channel Optional channel to request permission for\n * @returns Whether permission was granted\n */\n requestPermission(channel?: string): Promise<{ granted: boolean }> {\n return requireNapplet().notify.requestPermission(channel);\n },\n\n /**\n * Listen for action button clicks on notifications.\n * @param callback Called with (notificationId, actionId)\n * @returns A Subscription with `close()` to stop listening\n */\n onAction(\n callback: (notificationId: string, actionId: string) => void,\n ): Subscription {\n return requireNapplet().notify.onAction(callback);\n },\n\n /**\n * Listen for notification body clicks.\n * @param callback Called with (notificationId)\n * @returns A Subscription with `close()` to stop listening\n */\n onClicked(\n callback: (notificationId: string) => void,\n ): Subscription {\n return requireNapplet().notify.onClicked(callback);\n },\n\n /**\n * Listen for notification dismissals.\n * @param callback Called with (notificationId, reason?)\n * @returns A Subscription with `close()` to stop listening\n */\n onDismissed(\n callback: (notificationId: string, reason?: string) => void,\n ): Subscription {\n return requireNapplet().notify.onDismissed(callback);\n },\n\n /**\n * Listen for the shell's notification capability list.\n * @param callback Called with supported controls\n * @returns A Subscription with `close()` to stop listening\n */\n onControls(\n callback: (controls: ('toasts' | 'badges' | 'actions' | 'channels' | 'system')[]) => void,\n ): Subscription {\n return requireNapplet().notify.onControls(callback);\n },\n};\n\n/**\n * Keyboard forwarding and action keybindings: register named actions the shell\n * can bind to keys, listen for shell-triggered actions locally.\n *\n * @example\n * ```ts\n * import { keys } from '@napplet/sdk';\n *\n * const result = await keys.registerAction({\n * id: 'editor.save',\n * label: 'Save',\n * defaultKey: 'Ctrl+S',\n * });\n *\n * const sub = keys.onAction('editor.save', () => {\n * console.log('Save triggered!');\n * });\n * ```\n */\nexport const keys = {\n /**\n * Declare a named action that the shell can bind to a key.\n * @param action The action to register (id, label, optional defaultKey)\n * @returns The assigned binding, if any\n */\n registerAction(action: {\n id: string;\n label: string;\n defaultKey?: string;\n }): Promise<{ actionId: string; binding?: string }> {\n return requireNapplet().keys.registerAction(action);\n },\n\n /**\n * Remove a previously registered action.\n * @param actionId The action to unregister\n */\n unregisterAction(actionId: string): void {\n requireNapplet().keys.unregisterAction(actionId);\n },\n\n /**\n * Register a local handler for when a bound key is pressed.\n * @param actionId The action to listen for\n * @param callback Called when the action is triggered\n * @returns A Subscription with `close()` to stop listening\n */\n onAction(actionId: string, callback: () => void): Subscription {\n return requireNapplet().keys.onAction(actionId, callback);\n },\n\n /**\n * Convenience: register a named action AND wire a local handler in one call.\n * Returns a handle whose `close()` both unregisters the action and removes\n * the onAction listener.\n *\n * @param action The action to register (id, label, optional defaultKey)\n * @param handler Called when the shell triggers this action\n * @returns The assigned binding plus a `close()` teardown function\n *\n * @example\n * ```ts\n * import { keys } from '@napplet/sdk';\n *\n * const handle = await keys.register(\n * { id: 'editor.save', label: 'Save', defaultKey: 'Ctrl+S' },\n * () => saveDocument(),\n * );\n *\n * // Later, tear down both registration and listener:\n * handle.close();\n * ```\n */\n async register(\n action: { id: string; label: string; defaultKey?: string },\n handler: () => void,\n ): Promise<{ actionId: string; binding?: string; close: () => void }> {\n const n = requireNapplet();\n const result = await n.keys.registerAction(action);\n const sub = n.keys.onAction(action.id, handler);\n return {\n ...result,\n close() {\n sub.close();\n n.keys.unregisterAction(action.id);\n },\n };\n },\n};\n\n/**\n * Read-only user identity queries: public key, profile, follows, relays,\n * lists, zaps, mutes, blocked, badges.\n *\n * @example\n * ```ts\n * import { identity } from '@napplet/sdk';\n *\n * const pubkey = await identity.getPublicKey();\n * const profile = await identity.getProfile();\n * const follows = await identity.getFollows();\n * ```\n */\nexport const identity = {\n /**\n * Get the user's hex-encoded public key. Always succeeds.\n * @returns Hex-encoded public key string\n */\n getPublicKey(): Promise<string> {\n return requireNapplet().identity.getPublicKey();\n },\n\n /**\n * Listen for shell-pushed user identity changes.\n * @param handler Called with a hex pubkey, or \"\" when no user/signer is connected\n * @returns Subscription with close() to detach the handler\n */\n onChanged(handler: (pubkey: string) => void): Subscription {\n return requireNapplet().identity.onChanged(handler);\n },\n\n /**\n * Get the user's relay list (NIP-65).\n * @returns Record mapping relay URLs to read/write permissions\n */\n getRelays(): Promise<Record<string, { read: boolean; write: boolean }>> {\n return requireNapplet().identity.getRelays();\n },\n\n /**\n * Get the user's profile metadata (kind 0).\n * @returns Profile data, or null if not found\n */\n getProfile(): Promise<{\n name?: string;\n displayName?: string;\n about?: string;\n picture?: string;\n banner?: string;\n nip05?: string;\n lud16?: string;\n website?: string;\n } | null> {\n return requireNapplet().identity.getProfile();\n },\n\n /**\n * Get the user's follow list (kind 3 contact list).\n * @returns Array of hex-encoded public keys\n */\n getFollows(): Promise<string[]> {\n return requireNapplet().identity.getFollows();\n },\n\n /**\n * Get entries from a user's categorized list.\n * @param listType List category (e.g., \"bookmarks\", \"interests\", \"pins\")\n * @returns Array of list entry values\n */\n getList(listType: string): Promise<string[]> {\n return requireNapplet().identity.getList(listType);\n },\n\n /**\n * Get zap receipts sent to the user.\n * @returns Array of zap receipt objects\n */\n getZaps(): Promise<{\n eventId: string;\n sender: string;\n amount: number;\n content?: string;\n }[]> {\n return requireNapplet().identity.getZaps();\n },\n\n /**\n * Get the user's mute list (kind 10000).\n * @returns Array of hex-encoded muted public keys\n */\n getMutes(): Promise<string[]> {\n return requireNapplet().identity.getMutes();\n },\n\n /**\n * Get the user's block list.\n * @returns Array of hex-encoded blocked public keys\n */\n getBlocked(): Promise<string[]> {\n return requireNapplet().identity.getBlocked();\n },\n\n /**\n * Get badges awarded to the user (NIP-58).\n * @returns Array of badge objects\n */\n getBadges(): Promise<{\n id: string;\n name?: string;\n description?: string;\n image?: string;\n thumbs?: string[];\n awardedBy: string;\n }[]> {\n return requireNapplet().identity.getBadges();\n },\n};\n\n/**\n * Per-napplet declarative configuration (NAP-CONFIG): register a schema,\n * read current values, subscribe to live updates, deep-link into the\n * shell-owned settings UI, and listen for schema errors.\n *\n * @example\n * ```ts\n * import { config } from '@napplet/sdk';\n *\n * await config.registerSchema({\n * type: 'object',\n * properties: { theme: { type: 'string', enum: ['light', 'dark'], default: 'dark' } },\n * });\n *\n * const sub = config.subscribe((values) => { applyTheme(values.theme); });\n *\n * config.openSettings({ section: 'appearance' });\n * ```\n */\nexport const config = {\n /**\n * Snapshot current validated + defaulted config values.\n * @returns A one-shot ConfigValues object.\n */\n get(): Promise<Record<string, unknown>> {\n return requireNapplet().config.get();\n },\n\n /**\n * Subscribe to live configuration updates.\n * First delivery is an immediate snapshot; subsequent deliveries fire on change.\n * @param callback Invoked with the full ConfigValues on every change.\n * @returns A Subscription with close() to stop listening.\n */\n subscribe(\n callback: (values: Record<string, unknown>) => void,\n ): Subscription {\n return requireNapplet().config.subscribe(callback);\n },\n\n /**\n * Request the shell open its settings UI for this napplet.\n * @param options Optional { section } to deep-link by x-napplet-section name.\n */\n openSettings(options?: { section?: string }): void {\n requireNapplet().config.openSettings(options);\n },\n\n /**\n * Register a napplet configuration schema at runtime (escape hatch;\n * prefer manifest-declared via @napplet/vite-plugin's configSchema option).\n * @param schema JSON Schema (draft-07+) describing the config surface.\n * @param version Optional `$version` migration hint.\n */\n registerSchema(\n schema: Record<string, unknown>,\n version?: number,\n ): Promise<void> {\n return requireNapplet().config.registerSchema(schema, version);\n },\n\n /**\n * Listen for schema-registration errors pushed by the shell\n * (manifest parse failure, no-schema on subscribe-before-schema, etc.).\n * @param callback Invoked with { code, error } on every push.\n * @returns A plain teardown function that detaches the listener.\n */\n onSchemaError(\n callback: (err: { code: string; error: string }) => void,\n ): () => void {\n return requireNapplet().config.onSchemaError(callback);\n },\n\n /**\n * Current schema snapshot (readonly). Populated from the\n * `<meta name=\"napplet-config-schema\">` manifest tag at shim install,\n * updated on successful registerSchema responses.\n * @returns The registered schema, or null if none.\n */\n get schema(): Record<string, unknown> | null {\n return requireNapplet().config.schema;\n },\n};\n\n/**\n * Browser-enforced byte-fetching primitive: napplets request bytes by URL,\n * shell fetches and returns a Blob. URL space is scheme-pluggable\n * (`data:`, `https:`, `blossom:`, `nostr:`).\n *\n * @example\n * ```ts\n * import { resource } from '@napplet/sdk';\n *\n * const blob = await resource.bytes('https://example.com/avatar.png');\n * const handle = resource.bytesAsObjectURL('blossom:abc123...');\n * imgEl.src = handle.url;\n * imgEl.onload = () => handle.revoke();\n * ```\n */\nexport const resource = {\n /**\n * Fetch bytes for a URL through the shell's resource pipeline.\n * @param url URL identifying the resource (any registered scheme).\n * @returns Promise resolving to the fetched bytes as a Blob.\n */\n bytes(url: string): Promise<Blob> {\n return requireNapplet().resource.bytes(url);\n },\n\n /**\n * Fetch bytes and return a managed object URL handle.\n * Call `revoke()` to release the underlying Blob URL.\n * @param url URL identifying the resource.\n * @returns Synchronous handle `{ url, revoke }`.\n */\n bytesAsObjectURL(url: string): { url: string; revoke: () => void } {\n return requireNapplet().resource.bytesAsObjectURL(url);\n },\n};\n\n/**\n * Native ContextVM bridge (NAP-CVM): MCP-over-Nostr access mediated by the shell.\n * The shell owns ContextVM transport, signing, encryption, correlation, policy,\n * and payment; napplets supply a server identity and the MCP operation they want.\n *\n * @example\n * ```ts\n * import { cvm } from '@napplet/sdk';\n *\n * const servers = await cvm.discover({ search: 'relay' });\n * const tools = await cvm.listTools(servers[0]);\n * const result = await cvm.callTool(servers[0], tools[0].name, {});\n * ```\n */\nexport const cvm = {\n /**\n * Discover public ContextVM servers known to the shell.\n * @param query Optional discovery filter\n * @returns Promise resolving to the discovered servers\n */\n discover(query?: CvmDiscoverQuery): Promise<CvmServer[]> {\n return requireNapplet().cvm.discover(query);\n },\n\n /**\n * Send a raw MCP JSON-RPC message to a ContextVM server.\n * @param server Target ContextVM server\n * @param message MCP JSON-RPC message\n * @param options Optional per-request options\n * @returns Promise resolving to the MCP response message\n */\n request(\n server: CvmServerRef,\n message: McpMessage,\n options?: CvmRequestOptions,\n ): Promise<McpMessage> {\n return requireNapplet().cvm.request(server, message, options);\n },\n\n /**\n * List the tools exposed by a ContextVM server (MCP `tools/list`).\n * @param server Target ContextVM server\n * @param options Optional per-request options\n */\n listTools(server: CvmServerRef, options?: CvmRequestOptions): Promise<McpTool[]> {\n return requireNapplet().cvm.listTools(server, options);\n },\n\n /**\n * Call a tool on a ContextVM server (MCP `tools/call`).\n * @param server Target ContextVM server\n * @param name Tool name\n * @param args Tool arguments\n * @param options Optional per-request options\n */\n callTool(\n server: CvmServerRef,\n name: string,\n args?: Record<string, unknown>,\n options?: CvmRequestOptions,\n ): Promise<McpToolResult> {\n return requireNapplet().cvm.callTool(server, name, args, options);\n },\n\n /**\n * List the resources exposed by a ContextVM server (MCP `resources/list`).\n * @param server Target ContextVM server\n * @param options Optional per-request options\n */\n listResources(server: CvmServerRef, options?: CvmRequestOptions): Promise<McpResource[]> {\n return requireNapplet().cvm.listResources(server, options);\n },\n\n /**\n * Read a resource from a ContextVM server (MCP `resources/read`).\n * @param server Target ContextVM server\n * @param uri Resource URI\n * @param options Optional per-request options\n */\n readResource(\n server: CvmServerRef,\n uri: string,\n options?: CvmRequestOptions,\n ): Promise<McpResourceContent> {\n return requireNapplet().cvm.readResource(server, uri, options);\n },\n\n /**\n * Close shell-maintained session state for a server.\n * @param server Server whose session should be torn down\n */\n close(server: CvmServerRef): Promise<void> {\n return requireNapplet().cvm.close(server);\n },\n\n /**\n * Listen for server-pushed MCP messages (`cvm.event`).\n * @param callback Called with `(server, message)` for each server event\n * @returns A Subscription with `close()` to stop listening\n */\n onEvent(\n callback: (server: CvmServerRef, message: McpMessage) => void,\n ): Subscription {\n return requireNapplet().cvm.onEvent(callback);\n },\n};\n\n/**\n * Outbox-aware relay routing (NAP-OUTBOX): supply Nostr filters and intent and\n * let the shell discover the correct relays (NIP-65 write/read relays, fallbacks,\n * relay intelligence), query/deduplicate, validate signatures, and stream updates.\n * The shell owns relay discovery, routing, fallback, deduplication, signing, and\n * publish fanout.\n *\n * @example\n * ```ts\n * import { outbox } from '@napplet/sdk';\n *\n * const { events } = await outbox.query([{ authors: ['ab12...'], kinds: [1] }], { strategy: 'outbox' });\n * const sub = outbox.subscribe([{ kinds: [1] }], { live: true });\n * sub.on('event', (event, relay) => render(event, relay));\n * ```\n */\nexport const outbox = {\n /**\n * Perform a one-shot outbox-aware query.\n * @param filters NIP-01 filter or filters\n * @param options Optional query options\n * @returns Promise resolving to the outbox result\n */\n query(\n filters: NostrFilter | NostrFilter[],\n options?: OutboxQueryOptions,\n ): Promise<OutboxResult> {\n return requireNapplet().outbox.query(filters, options);\n },\n\n /**\n * Open a live outbox-aware subscription.\n * @param filters NIP-01 filter or filters\n * @param options Optional subscribe options\n * @returns An OutboxSubscription handle with `on(...)` and `close()`\n */\n subscribe(\n filters: NostrFilter | NostrFilter[],\n options?: OutboxSubscribeOptions,\n ): OutboxSubscription {\n return requireNapplet().outbox.subscribe(filters, options);\n },\n\n /**\n * Publish a shell-signed event using outbox-aware relay fanout.\n * @param template Unsigned event template\n * @param options Optional publish options\n * @returns Promise resolving to the outbox publish result\n */\n publish(\n template: EventTemplate,\n options?: OutboxPublishOptions,\n ): Promise<OutboxPublishResult> {\n return requireNapplet().outbox.publish(template, options);\n },\n\n /**\n * Resolve the relay plan the shell would use for a read/write target.\n * @param target The read/write target\n * @returns Promise resolving to the relay plan\n */\n resolveRelays(target: OutboxTarget): Promise<OutboxRelayPlan> {\n return requireNapplet().outbox.resolveRelays(target);\n },\n};\n\nexport type { NostrEvent } from '@napplet/core';\nexport type { NostrFilter } from '@napplet/core';\nexport type { Subscription } from '@napplet/core';\nexport type { EventTemplate } from '@napplet/core';\n\nexport type {\n NappletMessage,\n NapDomain,\n NamespacedCapability,\n NapProtocolId,\n ProtocolId,\n ShellSupports,\n} from '@napplet/core';\nexport { NAP_DOMAINS } from '@napplet/core';\n\n// Relay NAP\nexport type {\n RelayMessage,\n RelaySubscribeMessage,\n RelayCloseMessage,\n RelayPublishMessage,\n RelayPublishEncryptedMessage,\n RelayQueryMessage,\n RelayEventMessage,\n RelayEoseMessage,\n RelayClosedMessage,\n RelayPublishResultMessage,\n RelayPublishEncryptedResultMessage,\n RelayQueryResultMessage,\n RelayOutboundMessage,\n RelayInboundMessage,\n RelayNapMessage,\n} from '@napplet/nap/relay';\n\n// Identity NAP\nexport type {\n ProfileData,\n ZapReceipt,\n Badge,\n RelayPermission as IdentityRelayPermission,\n IdentityMessage,\n IdentityGetPublicKeyMessage,\n IdentityGetRelaysMessage,\n IdentityGetProfileMessage,\n IdentityGetFollowsMessage,\n IdentityGetListMessage,\n IdentityGetZapsMessage,\n IdentityGetMutesMessage,\n IdentityGetBlockedMessage,\n IdentityGetBadgesMessage,\n IdentityGetPublicKeyResultMessage,\n IdentityGetRelaysResultMessage,\n IdentityGetProfileResultMessage,\n IdentityGetFollowsResultMessage,\n IdentityGetListResultMessage,\n IdentityGetZapsResultMessage,\n IdentityGetMutesResultMessage,\n IdentityGetBlockedResultMessage,\n IdentityGetBadgesResultMessage,\n IdentityChangedMessage,\n IdentityRequestMessage,\n IdentityResultMessage,\n IdentityNapMessage,\n} from '@napplet/nap/identity';\n\n// Storage NAP\nexport type {\n StorageMessage,\n StorageGetMessage,\n StorageSetMessage,\n StorageRemoveMessage,\n StorageKeysMessage,\n StorageGetResultMessage,\n StorageSetResultMessage,\n StorageRemoveResultMessage,\n StorageKeysResultMessage,\n StorageRequestMessage,\n StorageResultMessage,\n StorageNapMessage,\n} from '@napplet/nap/storage';\n\n// INC NAP\nexport type {\n IncMessage,\n IncEmitMessage,\n IncSubscribeMessage,\n IncSubscribeResultMessage,\n IncUnsubscribeMessage,\n IncEventMessage,\n IncChannelOpenMessage,\n IncChannelOpenResultMessage,\n IncChannelEmitMessage,\n IncChannelEventMessage,\n IncChannelBroadcastMessage,\n IncChannelListMessage,\n IncChannelListResultMessage,\n IncChannelCloseMessage,\n IncChannelClosedMessage,\n IncTopicMessage,\n IncChannelMessage,\n IncOutboundMessage,\n IncInboundMessage,\n IncNapMessage,\n} from '@napplet/nap/inc';\n\n// Deprecated IFC compatibility aliases\nexport type {\n IfcMessage,\n IfcEmitMessage,\n IfcSubscribeMessage,\n IfcSubscribeResultMessage,\n IfcUnsubscribeMessage,\n IfcEventMessage,\n IfcChannelOpenMessage,\n IfcChannelOpenResultMessage,\n IfcChannelEmitMessage,\n IfcChannelEventMessage,\n IfcChannelBroadcastMessage,\n IfcChannelListMessage,\n IfcChannelListResultMessage,\n IfcChannelCloseMessage,\n IfcChannelClosedMessage,\n IfcTopicMessage,\n IfcChannelMessage,\n IfcOutboundMessage,\n IfcInboundMessage,\n IfcNapMessage,\n} from '@napplet/nap/ifc';\n\n// Theme NAP\nexport type {\n ThemeColors,\n ThemeFont,\n ThemeBackground,\n Theme,\n ThemeMessage,\n ThemeGetMessage,\n ThemeGetResultMessage,\n ThemeChangedMessage,\n ThemeRequestMessage,\n ThemeResultMessage,\n ThemeNapMessage,\n} from '@napplet/nap/theme';\n\n// Keys NAP\nexport type {\n Action,\n RegisterResult,\n KeyBinding,\n KeysMessage,\n KeysForwardMessage,\n KeysRegisterActionMessage,\n KeysRegisterActionResultMessage,\n KeysUnregisterActionMessage,\n KeysBindingsMessage,\n KeysActionMessage,\n KeysRequestMessage,\n KeysResultMessage,\n KeysNapMessage,\n} from '@napplet/nap/keys';\n\n// Media NAP\nexport type {\n MediaMetadata,\n MediaArtwork,\n MediaPlaybackOwner,\n MediaSourceRef,\n MediaSessionCreate,\n MediaSessionResult,\n MediaState,\n MediaAction,\n MediaMessage,\n MediaSessionCreateMessage,\n MediaSessionCreateResultMessage,\n MediaSessionUpdateMessage,\n MediaSessionDestroyMessage,\n MediaStateMessage,\n MediaCapabilitiesMessage,\n MediaCommandMessage,\n MediaControlsMessage,\n MediaRequestMessage,\n MediaResultMessage,\n MediaNapMessage,\n} from '@napplet/nap/media';\n\n// Notify NAP\nexport type {\n NotificationPriority,\n NotificationAction,\n NotificationChannel,\n NotifyControl,\n NotifyMessage,\n NotifySendMessage,\n NotifySendResultMessage,\n NotifyDismissMessage,\n NotifyBadgeMessage,\n NotifyChannelRegisterMessage,\n NotifyPermissionRequestMessage,\n NotifyPermissionResultMessage,\n NotifyActionMessage,\n NotifyClickedMessage,\n NotifyDismissedMessage,\n NotifyControlsMessage,\n NotifyRequestMessage,\n NotifyResultMessage,\n NotifyNapMessage,\n} from '@napplet/nap/notify';\n\n// Config NAP\nexport type {\n NappletConfigSchema,\n ConfigSchema,\n ConfigValues,\n ConfigSchemaErrorCode,\n NappletConfigSchemaExtensions,\n ConfigMessage,\n ConfigRegisterSchemaMessage,\n ConfigGetMessage,\n ConfigSubscribeMessage,\n ConfigUnsubscribeMessage,\n ConfigOpenSettingsMessage,\n ConfigRegisterSchemaResultMessage,\n ConfigValuesMessage,\n ConfigSchemaErrorMessage,\n ConfigRequestMessage,\n ConfigResultMessage,\n ConfigNapMessage,\n} from '@napplet/nap/config';\n\n// Resource NAP\nexport type {\n ResourceErrorCode,\n ResourceScheme,\n ResourceMessage,\n ResourceBytesMessage,\n ResourceCancelMessage,\n ResourceBytesResultMessage,\n ResourceBytesErrorMessage,\n ResourceSidecarEntry,\n ResourceRequestMessage,\n ResourceResultMessage,\n ResourceNapMessage,\n} from '@napplet/nap/resource';\n\n// Connect NAP\nexport type {\n NappletConnect,\n} from '@napplet/nap/connect';\n\n// Class NAP\nexport type {\n ClassMessage,\n ClassAssignedMessage,\n NappletClass,\n ClassNapMessage,\n} from '@napplet/nap/class';\n\n// CVM NAP (ContextVM bridge)\nexport type {\n McpMessage,\n McpTool,\n McpContentBlock,\n McpToolResult,\n McpResource,\n McpTextResourceContents,\n McpBlobResourceContents,\n McpResourceContent,\n CvmServerRef,\n CvmDiscoverQuery,\n CvmServer,\n CvmRequestOptions,\n CvmMessage,\n CvmDiscoverMessage,\n CvmDiscoverResultMessage,\n CvmRequestMessage,\n CvmRequestResultMessage,\n CvmCloseMessage,\n CvmCloseResultMessage,\n CvmEventMessage,\n CvmOutboundMessage,\n CvmInboundMessage,\n CvmNapMessage,\n} from '@napplet/nap/cvm';\n\n// OUTBOX NAP (outbox-aware relay routing)\nexport type {\n OutboxStrategy,\n OutboxQueryOptions,\n OutboxSubscribeOptions,\n OutboxPublishOptions,\n OutboxTarget,\n OutboxRelayPlan,\n OutboxResult,\n OutboxPublishResult,\n OutboxSubscription,\n OutboxMessage,\n OutboxQueryMessage,\n OutboxQueryResultMessage,\n OutboxSubscribeMessage,\n OutboxEventMessage,\n OutboxEoseMessage,\n OutboxClosedMessage,\n OutboxCloseMessage,\n OutboxPublishMessage,\n OutboxPublishResultMessage,\n OutboxResolveRelaysMessage,\n OutboxResolveRelaysResultMessage,\n OutboxOutboundMessage,\n OutboxInboundMessage,\n OutboxNapMessage,\n} from '@napplet/nap/outbox';\n\nexport { DOMAIN as RELAY_DOMAIN } from '@napplet/nap/relay';\nexport { DOMAIN as IDENTITY_DOMAIN } from '@napplet/nap/identity';\nexport { DOMAIN as STORAGE_DOMAIN } from '@napplet/nap/storage';\nexport { DOMAIN as INC_DOMAIN } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link INC_DOMAIN}. This compatibility export resolves to\n * the canonical `inc` domain string.\n */\nexport { DOMAIN as IFC_DOMAIN } from '@napplet/nap/ifc';\nexport { DOMAIN as THEME_DOMAIN } from '@napplet/nap/theme';\nexport { DOMAIN as KEYS_DOMAIN } from '@napplet/nap/keys';\nexport { DOMAIN as MEDIA_DOMAIN } from '@napplet/nap/media';\nexport { DOMAIN as NOTIFY_DOMAIN } from '@napplet/nap/notify';\nexport { DOMAIN as CONFIG_DOMAIN } from '@napplet/nap/config';\nexport { DOMAIN as RESOURCE_DOMAIN } from '@napplet/nap/resource';\nexport { DOMAIN as CONNECT_DOMAIN } from '@napplet/nap/connect';\nexport { DOMAIN as CLASS_DOMAIN } from '@napplet/nap/class';\nexport { DOMAIN as CVM_DOMAIN } from '@napplet/nap/cvm';\nexport { DOMAIN as OUTBOX_DOMAIN } from '@napplet/nap/outbox';\n\nexport { installRelayShim } from '@napplet/nap/relay';\nexport { installIdentityShim } from '@napplet/nap/identity';\nexport { installStorageShim } from '@napplet/nap/storage';\nexport { installIncShim } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link installIncShim}.\n */\nexport { installIfcShim } from '@napplet/nap/ifc';\nexport { installKeysShim } from '@napplet/nap/keys';\nexport { installMediaShim } from '@napplet/nap/media';\nexport { installNotifyShim } from '@napplet/nap/notify';\nexport { installConfigShim } from '@napplet/nap/config';\nexport { installResourceShim } from '@napplet/nap/resource';\nexport { installConnectShim } from '@napplet/nap/connect';\nexport { installClassShim } from '@napplet/nap/class';\nexport { installCvmShim } from '@napplet/nap/cvm';\nexport { installOutboxShim } from '@napplet/nap/outbox';\n\nexport { relaySubscribe, relayPublish, relayPublishEncrypted, relayQuery } from '@napplet/nap/relay';\nexport {\n identityGetPublicKey,\n identityOnChanged,\n identityGetRelays,\n identityGetProfile,\n identityGetFollows,\n identityGetList,\n identityGetZaps,\n identityGetMutes,\n identityGetBlocked,\n identityGetBadges,\n} from '@napplet/nap/identity';\nexport { storageGetItem, storageSetItem, storageRemoveItem, storageKeys } from '@napplet/nap/storage';\nexport { incEmit, incOn } from '@napplet/nap/inc';\n/**\n * @deprecated Use {@link incEmit} and {@link incOn}.\n */\nexport { ifcEmit, ifcOn } from '@napplet/nap/ifc';\nexport { keysRegisterAction, keysUnregisterAction, keysOnAction, keysRegister } from '@napplet/nap/keys';\nexport { mediaCreateSession, mediaUpdateSession, mediaDestroySession, mediaReportState, mediaReportCapabilities, mediaSendCommand, mediaOnCommand, mediaOnState, mediaOnCapabilities, mediaOnControls } from '@napplet/nap/media';\nexport { notifySend, notifyDismiss, notifyBadge, notifyRegisterChannel, notifyRequestPermission, notifyOnAction, notifyOnClicked, notifyOnDismissed, notifyOnControls } from '@napplet/nap/notify';\nexport { resourceBytes, resourceBytesAsObjectURL } from '@napplet/nap/resource';\nexport { connectGranted, connectOrigins, normalizeConnectOrigin } from '@napplet/nap/connect';\nexport { getClass } from '@napplet/nap/class';\nexport {\n cvmDiscover,\n cvmRequest,\n cvmListTools,\n cvmCallTool,\n cvmListResources,\n cvmReadResource,\n cvmClose,\n cvmOnEvent,\n} from '@napplet/nap/cvm';\nexport {\n outboxQuery,\n outboxSubscribe,\n outboxPublish,\n outboxResolveRelays,\n} from '@napplet/nap/outbox';\n"],"mappings":";AA49BA,SAAS,mBAAmB;AA2S5B,SAAmB,cAAoB;AACvC,SAAmB,UAAVA,eAAiC;AAC1C,SAAmB,UAAVA,eAAgC;AACzC,SAAmB,UAAVA,eAA4B;AAKrC,SAAmB,UAAVA,eAA4B;AACrC,SAAmB,UAAVA,eAA8B;AACvC,SAAmB,UAAVA,eAA6B;AACtC,SAAmB,UAAVA,eAA8B;AACvC,SAAmB,UAAVA,eAA+B;AACxC,SAAmB,UAAVA,gBAA+B;AACxC,SAAmB,UAAVA,gBAAiC;AAC1C,SAAmB,UAAVA,gBAAgC;AACzC,SAAmB,UAAVA,gBAA8B;AACvC,SAAmB,UAAVA,gBAA4B;AACrC,SAAmB,UAAVA,gBAA+B;AAExC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,0BAA0B;AACnC,SAAS,sBAAsB;AAI/B,SAAS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AA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QACE,UACA,SAC8B;AAC9B,WAAO,eAAe,EAAE,OAAO,QAAQ,UAAU,OAAO;AAAA,EAC1D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,cAAc,QAAgD;AAC5D,WAAO,eAAe,EAAE,OAAO,cAAc,MAAM;AAAA,EACrD;AACF;","names":["DOMAIN"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@napplet/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Typed named exports wrapping window.napplet for bundler-consuming napplet developers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@napplet/core": "0.
|
|
24
|
-
"@napplet/nap": "0.
|
|
23
|
+
"@napplet/core": "0.8.0",
|
|
24
|
+
"@napplet/nap": "0.8.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"tsup": "^8.5.0",
|