@olane/o-gateway-olane 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Olane Gateways
|
|
2
|
+
|
|
3
|
+
TLDR; think DNS registrars but for olane. These bad boys help organize how the first term in the olane addresses are resolved (`o://brendon`).
|
|
4
|
+
|
|
5
|
+
## What is this?
|
|
6
|
+
An Olane gateway is a registry tool. These registries help prevent conflicting namespaces, bridge into walled gardens, broker communication, and much more.
|
|
7
|
+
|
|
8
|
+
The Olane gateway dream: to create a system of trust for AI agents, Humans, and other future entities to collaborate safely.
|
|
9
|
+
|
|
10
|
+
## Approved Gateways
|
|
11
|
+
If you would like to apply to become an approved gateway, please reach out to us at [gateways@olane.com](mailto:gateways@olane.com).
|
|
12
|
+
1. Copass - https://copass.id, where you can create your AI twin.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './router/o-gateway.resolver.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { oAddress, oAddressResolver, oTransport, ResolveRequest, RouteResponse } from '@olane/o-core';
|
|
2
|
+
export declare class oGatewayResolver extends oAddressResolver {
|
|
3
|
+
protected readonly address: oAddress;
|
|
4
|
+
constructor(address: oAddress);
|
|
5
|
+
get customTransports(): oTransport[];
|
|
6
|
+
resolve(request: ResolveRequest): Promise<RouteResponse>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=o-gateway.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"o-gateway.resolver.d.ts","sourceRoot":"","sources":["../../src/router/o-gateway.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,gBAAgB,EAEhB,UAAU,EACV,cAAc,EACd,aAAa,EACd,MAAM,eAAe,CAAC;AAGvB,qBAAa,gBAAiB,SAAQ,gBAAgB;IACxC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBAAjB,OAAO,EAAE,QAAQ;IAIhD,IAAI,gBAAgB,IAAI,UAAU,EAAE,CAEnC;IAEK,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAyB/D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { oAddress, oAddressResolver, oCustomTransport, } from '@olane/o-core';
|
|
2
|
+
import { oNodeTransport } from '@olane/o-node';
|
|
3
|
+
export class oGatewayResolver extends oAddressResolver {
|
|
4
|
+
constructor(address) {
|
|
5
|
+
super(address);
|
|
6
|
+
this.address = address;
|
|
7
|
+
}
|
|
8
|
+
get customTransports() {
|
|
9
|
+
return [new oCustomTransport('/olane')];
|
|
10
|
+
}
|
|
11
|
+
async resolve(request) {
|
|
12
|
+
const { address, node, request: resolveRequest, targetAddress } = request;
|
|
13
|
+
if (!address.paths.startsWith('olane') ||
|
|
14
|
+
targetAddress?.customTransports?.some((t) => this.customTransports.some((ct) => ct.value === t.value))) {
|
|
15
|
+
return {
|
|
16
|
+
nextHopAddress: address,
|
|
17
|
+
targetAddress: targetAddress,
|
|
18
|
+
requestOverride: resolveRequest,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
// this is destined for the olane gateway
|
|
22
|
+
const olaneAddress = oAddress.leader();
|
|
23
|
+
olaneAddress.setTransports([
|
|
24
|
+
new oNodeTransport('/dns4/leader.olane.com/tcp/3000/tls'),
|
|
25
|
+
]);
|
|
26
|
+
return {
|
|
27
|
+
nextHopAddress: olaneAddress,
|
|
28
|
+
targetAddress: targetAddress,
|
|
29
|
+
requestOverride: resolveRequest,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@olane/o-gateway-olane",
|
|
3
|
+
"version": "0.7.3",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"default": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**/*",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "echo 'No tests'",
|
|
20
|
+
"dev": "DEBUG=o-protocol:* npx tsx src/tests/index.ts",
|
|
21
|
+
"build": "tsc",
|
|
22
|
+
"deep:clean": "rm -rf node_modules && rm package-lock.json",
|
|
23
|
+
"start:prod": "node dist/index.js",
|
|
24
|
+
"prepublishOnly": "npm run build",
|
|
25
|
+
"update:lib": "npm install @olane/o-core@latest",
|
|
26
|
+
"update:peers": "npm install @olane/o-core@latest @olane/o-config@latest @olane/o-protocol@latest @olane/o-tool@latest --save-peer",
|
|
27
|
+
"lint": "eslint src/**/*.ts"
|
|
28
|
+
},
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/olane-labs/olane.git"
|
|
32
|
+
},
|
|
33
|
+
"author": "oLane Inc.",
|
|
34
|
+
"license": "(MIT OR Apache-2.0)",
|
|
35
|
+
"description": "oLane gateway interface",
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
38
|
+
"@eslint/js": "^9.29.0",
|
|
39
|
+
"@tsconfig/node20": "^20.1.6",
|
|
40
|
+
"@types/jest": "^30.0.0",
|
|
41
|
+
"@typescript-eslint/eslint-plugin": "^8.34.1",
|
|
42
|
+
"@typescript-eslint/parser": "^8.34.1",
|
|
43
|
+
"eslint": "^9.29.0",
|
|
44
|
+
"eslint-config-prettier": "^10.1.6",
|
|
45
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
46
|
+
"globals": "^16.2.0",
|
|
47
|
+
"jest": "^30.0.0",
|
|
48
|
+
"prettier": "^3.5.3",
|
|
49
|
+
"ts-jest": "^29.4.0",
|
|
50
|
+
"ts-node": "^10.9.2",
|
|
51
|
+
"tsconfig-paths": "^4.2.0",
|
|
52
|
+
"tsx": "^4.20.3",
|
|
53
|
+
"typescript": "5.4.5"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@olane/o-config": "^0.7.2",
|
|
57
|
+
"@olane/o-core": "^0.7.2",
|
|
58
|
+
"@olane/o-node": "^0.7.2",
|
|
59
|
+
"@olane/o-protocol": "^0.7.2",
|
|
60
|
+
"@olane/o-tool": "^0.7.2"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"debug": "^4.4.1",
|
|
64
|
+
"dotenv": "^16.5.0"
|
|
65
|
+
}
|
|
66
|
+
}
|