@interncom/diplomatic 0.1.2 → 0.2.0-rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -42
- package/dist/cli/bin/host.js +6 -0
- package/dist/cli/bun/src/codec.d.ts +3 -0
- package/dist/cli/bun/src/crypto.d.ts +3 -0
- package/dist/cli/bun/src/host.d.ts +1 -0
- package/dist/cli/bun/src/storage/sqlite.d.ts +3 -0
- package/dist/cli/index.js +6020 -0
- package/dist/cli/index.mjs +6020 -0
- package/dist/{shared/crypto/libsodium.d.ts → cli/shared/crypto/noble.d.ts} +1 -6
- package/dist/{shared → cli/shared}/types.d.ts +1 -2
- package/dist/cli/src/index.d.ts +44 -0
- package/dist/{client.d.ts → web/client.d.ts} +1 -1
- package/dist/web/crypto.d.ts +3 -0
- package/dist/{index.d.ts → web/index.d.ts} +3 -3
- package/dist/web/index.js +6800 -0
- package/dist/web/index.mjs +7645 -0
- package/dist/web/shared/api/peek.d.ts +3 -0
- package/dist/web/shared/api/pull.d.ts +3 -0
- package/dist/web/shared/api/push.d.ts +4 -0
- package/dist/web/shared/api/user.d.ts +2 -0
- package/dist/web/shared/auth.d.ts +8 -0
- package/dist/web/shared/bag.d.ts +15 -0
- package/dist/web/shared/binary.d.ts +8 -0
- package/dist/web/shared/client.d.ts +22 -0
- package/dist/web/shared/clock.d.ts +13 -0
- package/dist/web/shared/codec.d.ts +43 -0
- package/dist/web/shared/codecs/authTimestamp.d.ts +8 -0
- package/dist/web/shared/codecs/bag.d.ts +3 -0
- package/dist/web/shared/codecs/eid.d.ts +10 -0
- package/dist/web/shared/codecs/messageHead.d.ts +16 -0
- package/dist/web/shared/codecs/notifItem.d.ts +7 -0
- package/dist/web/shared/codecs/peekItem.d.ts +6 -0
- package/dist/web/shared/codecs/peekItemHead.d.ts +7 -0
- package/dist/web/shared/codecs/pullItem.d.ts +6 -0
- package/dist/web/shared/codecs/pushItem.d.ts +11 -0
- package/dist/web/shared/codecs/respHead.d.ts +10 -0
- package/dist/web/shared/codecs/usageQuota.d.ts +6 -0
- package/dist/web/shared/consts.d.ts +50 -0
- package/dist/web/shared/crypto/noble.d.ts +11 -0
- package/dist/web/shared/enclave.d.ts +8 -0
- package/dist/web/shared/endpoint.d.ts +23 -0
- package/dist/web/shared/events.d.ts +8 -0
- package/dist/web/shared/http/listener.d.ts +11 -0
- package/dist/web/shared/http/server.d.ts +14 -0
- package/dist/web/shared/http.d.ts +82 -0
- package/dist/web/shared/message.d.ts +22 -0
- package/dist/web/shared/singleton.d.ts +15 -0
- package/dist/web/shared/sync.d.ts +9 -0
- package/dist/web/shared/types.d.ts +163 -0
- package/dist/web/shared/valstat.d.ts +6 -0
- package/package.json +27 -11
- package/dist/crypto.d.ts +0 -3
- package/dist/exim.d.ts +0 -0
- package/dist/index.mjs +0 -11295
- package/dist/lib.d.ts +0 -2
- /package/dist/{shared → cli/shared}/api/peek.d.ts +0 -0
- /package/dist/{shared → cli/shared}/api/pull.d.ts +0 -0
- /package/dist/{shared → cli/shared}/api/push.d.ts +0 -0
- /package/dist/{shared → cli/shared}/api/user.d.ts +0 -0
- /package/dist/{shared → cli/shared}/auth.d.ts +0 -0
- /package/dist/{shared → cli/shared}/bag.d.ts +0 -0
- /package/dist/{shared → cli/shared}/binary.d.ts +0 -0
- /package/dist/{shared → cli/shared}/client.d.ts +0 -0
- /package/dist/{shared → cli/shared}/clock.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codec.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/authTimestamp.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/bag.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/eid.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/messageHead.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/notifItem.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/peekItem.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/peekItemHead.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/pullItem.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/pushItem.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/respHead.d.ts +0 -0
- /package/dist/{shared → cli/shared}/codecs/usageQuota.d.ts +0 -0
- /package/dist/{shared → cli/shared}/consts.d.ts +0 -0
- /package/dist/{shared → cli/shared}/enclave.d.ts +0 -0
- /package/dist/{shared → cli/shared}/endpoint.d.ts +0 -0
- /package/dist/{shared → cli/shared}/events.d.ts +0 -0
- /package/dist/{shared → cli/shared}/http/listener.d.ts +0 -0
- /package/dist/{shared → cli/shared}/http/server.d.ts +0 -0
- /package/dist/{shared → cli/shared}/http.d.ts +0 -0
- /package/dist/{shared → cli/shared}/message.d.ts +0 -0
- /package/dist/{shared → cli/shared}/singleton.d.ts +0 -0
- /package/dist/{shared → cli/shared}/sync.d.ts +0 -0
- /package/dist/{shared → cli/shared}/valstat.d.ts +0 -0
- /package/dist/{entdb → web/entdb}/entdb.d.ts +0 -0
- /package/dist/{entdb → web/entdb}/idb.d.ts +0 -0
- /package/dist/{entdb → web/entdb}/memory.d.ts +0 -0
- /package/dist/{events.d.ts → web/events.d.ts} +0 -0
- /package/dist/{react → web/react}/useClient.d.ts +0 -0
- /package/dist/{react → web/react}/useEntities.d.ts +0 -0
- /package/dist/{react → web/react}/useStateWatcher.d.ts +0 -0
- /package/dist/{shared → web/shared}/codecs/file.d.ts +0 -0
- /package/dist/{shared → web/shared}/codecs/fileHead.d.ts +0 -0
- /package/dist/{shared → web/shared}/codecs/fileIndexItem.d.ts +0 -0
- /package/dist/{shared → web/shared}/exim.d.ts +0 -0
- /package/dist/{shared → web/shared}/lpc/listener.d.ts +0 -0
- /package/dist/{shared → web/shared}/lpc/pusher.d.ts +0 -0
- /package/dist/{shared → web/shared}/lpc/server.d.ts +0 -0
- /package/dist/{shared → web/shared}/storage/memory.d.ts +0 -0
- /package/dist/{state.d.ts → web/state.d.ts} +0 -0
- /package/dist/{stores → web/stores}/idb/dnlds.d.ts +0 -0
- /package/dist/{stores → web/stores}/idb/hosts.d.ts +0 -0
- /package/dist/{stores → web/stores}/idb/msgs.d.ts +0 -0
- /package/dist/{stores → web/stores}/idb/seed.d.ts +0 -0
- /package/dist/{stores → web/stores}/idb/store.d.ts +0 -0
- /package/dist/{stores → web/stores}/idb/uplds.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/dnlds.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/hosts.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/msgs.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/seed.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/store.d.ts +0 -0
- /package/dist/{stores → web/stores}/memory/uplds.d.ts +0 -0
- /package/dist/{sync.d.ts → web/sync.d.ts} +0 -0
- /package/dist/{types.d.ts → web/types.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,46 +1,73 @@
|
|
|
1
|
-
# diplomatic
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
# @interncom/diplomatic Package
|
|
2
|
+
|
|
3
|
+
This directory manages the build and packaging of the `@interncom/diplomatic` NPM module, which provides secure sync layer and CLI utilities for the DIPLOMATIC protocol.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The `@interncom/diplomatic` package exposes both web (browser) and CLI (Node.js) components from the monorepo:
|
|
8
|
+
|
|
9
|
+
- **Web components**: React hooks, client APIs, and storage utilities for browser-based applications
|
|
10
|
+
- **CLI components**: Command-line tools and host server for Node.js environments
|
|
11
|
+
|
|
12
|
+
## Building the NPM Module
|
|
13
|
+
|
|
14
|
+
First, install dependencies:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun install
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
To clean previous builds:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bun run clean
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then run the build script to generate the distribution bundles:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bun run build
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
This command:
|
|
33
|
+
1. Builds the web bundle (`dist/web/index.mjs`) from `../web/src/index.ts`
|
|
34
|
+
2. Builds the CLI bundle (`dist/cli/index.mjs`) from `../web/src/cli/index.ts` (with external dependencies like `libsodium-wrappers`)
|
|
35
|
+
3. Generates the CLI binary (`dist/cli/bin/host.js`) for the `diplomatic-host` command
|
|
36
|
+
|
|
37
|
+
Note: The CLI bundle uses external dependencies that must be installed and available at runtime.
|
|
38
|
+
|
|
39
|
+
## Package Exports
|
|
40
|
+
|
|
41
|
+
The package uses conditional exports for environment-specific loading:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
".": {
|
|
46
|
+
"browser": "./dist/web/index.mjs",
|
|
47
|
+
"node": "./dist/cli/index.mjs"
|
|
48
|
+
},
|
|
49
|
+
"./web": "./dist/web/index.mjs",
|
|
50
|
+
"./cli": "./dist/cli/index.mjs"
|
|
40
51
|
}
|
|
41
52
|
```
|
|
42
53
|
|
|
43
|
-
|
|
54
|
+
- **Browser environments**: Automatically loads web components
|
|
55
|
+
- **Node.js environments**: Automatically loads CLI components
|
|
56
|
+
- **Explicit imports**: Use `./web` or `./cli` subpaths for specific components
|
|
57
|
+
|
|
58
|
+
## Dependencies
|
|
59
|
+
|
|
60
|
+
This package pulls source code from:
|
|
61
|
+
- `../shared/`: Common TypeScript utilities
|
|
62
|
+
- `../web/`: Web client source
|
|
63
|
+
- `../bun/`: Additional utilities (via symlinks in `../web/src/`)
|
|
64
|
+
|
|
65
|
+
## Publishing
|
|
66
|
+
|
|
67
|
+
To publish the package:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm publish
|
|
71
|
+
```
|
|
44
72
|
|
|
45
|
-
|
|
46
|
-
`npm run build && npm run tsc && npm publish --public`.
|
|
73
|
+
The package is configured for public access with scoped name `@interncom/diplomatic`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function runBunHost(port?: number): Promise<void>;
|