olonghon-sdk 0.2.0-alpha.1 → 0.2.0-alpha.2

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 ADDED
@@ -0,0 +1,12 @@
1
+ # Olonghon SDK
2
+
3
+ Olonghon authorizes agent actions, records intent before dispatch and verifies the outcome against the provider.
4
+
5
+ ```sh
6
+ npm install olonghon-sdk
7
+ npx olonghon-sdk self-test
8
+ ```
9
+
10
+ The self-test runs offline after installation. It simulates a lost reply and checks that the provider recorded exactly one credit. Three PASS lines indicate success. The package bundles the native CLI for macOS, Linux and Windows on x64 and ARM64.
11
+
12
+ For an SDK walkthrough and the shared runtime, see the [Olonghon quickstart](https://github.com/ponickkhan/olonghon#install-an-sdk).
package/cli.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ const system = { darwin: 'darwin', linux: 'linux', win32: 'windows' }[process.platform];
6
+ const arch = { x64: 'amd64', arm64: 'arm64' }[process.arch];
7
+
8
+ if (!system || !arch) {
9
+ console.error(`Bundled Olonghon CLI is unavailable for ${process.platform} ${process.arch}. Supported systems: Linux, macOS and Windows on x64 or ARM64.`);
10
+ process.exitCode = 1;
11
+ } else {
12
+ const suffix = system === 'windows' ? '.exe' : '';
13
+ const binary = fileURLToPath(new URL(`./runtime/olonghon-${system}-${arch}${suffix}`, import.meta.url));
14
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: 'inherit' });
15
+ if (result.error) {
16
+ console.error(`Unable to start the bundled Olonghon CLI: ${result.error.message}`);
17
+ process.exitCode = 1;
18
+ } else if (result.signal) {
19
+ process.kill(process.pid, result.signal);
20
+ } else {
21
+ process.exitCode = result.status;
22
+ }
23
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "olonghon-sdk",
3
- "version": "0.2.0-alpha.1",
3
+ "version": "0.2.0-alpha.2",
4
4
  "description": "Typed client for the Olonghon developer preview",
5
5
  "type": "module",
6
6
  "exports": { ".": { "types": "./index.d.ts", "import": "./index.js" } },
7
7
  "engines": { "node": ">=18" },
8
- "files": ["index.js", "index.d.ts", "LICENSE"],
8
+ "bin": { "olonghon-sdk": "./cli.js" },
9
+ "files": ["index.js", "index.d.ts", "cli.js", "runtime", "LICENSE"],
9
10
  "repository": { "type": "git", "url": "git+https://github.com/ponickkhan/olonghon.git", "directory": "clients/typescript" },
10
11
  "license": "MIT"
11
12
  }
@@ -0,0 +1,81 @@
1
+ Go
2
+ Copyright 2009 The Go Authors.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above
11
+ copyright notice, this list of conditions and the following disclaimer
12
+ in the documentation and/or other materials provided with the
13
+ distribution.
14
+ * Neither the name of Google LLC nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+
30
+
31
+ go.etcd.io/bbolt
32
+ The MIT License (MIT)
33
+
34
+ Copyright (c) 2013 Ben Johnson
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
37
+ this software and associated documentation files (the "Software"), to deal in
38
+ the Software without restriction, including without limitation the rights to
39
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
40
+ the Software, and to permit persons to whom the Software is furnished to do so,
41
+ subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in all
44
+ copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
48
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
49
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
50
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
51
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
52
+
53
+
54
+ golang.org/x/sys
55
+ Copyright 2009 The Go Authors.
56
+
57
+ Redistribution and use in source and binary forms, with or without
58
+ modification, are permitted provided that the following conditions are
59
+ met:
60
+
61
+ * Redistributions of source code must retain the above copyright
62
+ notice, this list of conditions and the following disclaimer.
63
+ * Redistributions in binary form must reproduce the above
64
+ copyright notice, this list of conditions and the following disclaimer
65
+ in the documentation and/or other materials provided with the
66
+ distribution.
67
+ * Neither the name of Google LLC nor the names of its
68
+ contributors may be used to endorse or promote products derived from
69
+ this software without specific prior written permission.
70
+
71
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
72
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
73
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
74
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
75
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
76
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
77
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
78
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
79
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
80
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
81
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Binary file
Binary file
Binary file
Binary file