@masons/agent-network 0.6.0 → 0.6.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/channel-setup.d.ts +1 -1
- package/dist/channel-setup.d.ts.map +1 -1
- package/dist/channel-setup.js +10 -5
- package/dist/cli-setup.d.ts.map +1 -1
- package/dist/cli-setup.js +17 -1
- package/dist/connector-url-boundary.d.ts +12 -0
- package/dist/connector-url-boundary.d.ts.map +1 -0
- package/dist/connector-url-boundary.js +66 -0
- package/dist/platform-client.d.ts.map +1 -1
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +18 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +15 -10
package/dist/channel-setup.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel-setup.d.ts","sourceRoot":"","sources":["../src/channel-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channel-setup.d.ts","sourceRoot":"","sources":["../src/channel-setup.ts"],"names":[],"mappings":"AAgBA,UAAU,wBAAwB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IAMnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,CAAC;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAKD,wBAAgB,6BAA6B,IAAI,wBAAwB,CAKxE;AAED,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAsC7B;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,IAAI,CAejE;AAED,wBAAgB,yBAAyB,IAAI,kBAAkB,GAAG,IAAI,CAMrE;AAkED,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD;AAED,eAAO,MAAM,oBAAoB,QAAqB,CAAC"}
|
package/dist/channel-setup.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { readExistingConnectorUrl, writeCredentials, } from "./config.js";
|
|
2
|
+
import { resolveConnectorUrlForSetup } from "./connector-url-boundary.js";
|
|
2
3
|
import { beginBridgeHandoff, completeBridgeHandoff, DEFAULT_IDP_BASE_URL, HANDOFF_TIMEOUT_MS, SetupFlowError, } from "./handoff.js";
|
|
3
|
-
import { DEFAULT_API_HOST
|
|
4
|
+
import { DEFAULT_API_HOST } from "./platform-client.js";
|
|
4
5
|
let pendingSetup = null;
|
|
5
6
|
let lastSetupStatus = null;
|
|
6
7
|
export function getDefaultChannelSetupOptions() {
|
|
7
8
|
return {
|
|
8
9
|
apiHost: DEFAULT_API_HOST,
|
|
9
|
-
connectorUrl: DEFAULT_CONNECTOR_URL,
|
|
10
10
|
idpBaseUrl: DEFAULT_IDP_BASE_URL,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
@@ -20,6 +20,12 @@ export async function startOrGetChannelSetup(options) {
|
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
lastSetupStatus = null;
|
|
23
|
+
const existingConnectorUrl = await readExistingConnectorUrl();
|
|
24
|
+
const connectorUrl = resolveConnectorUrlForSetup({
|
|
25
|
+
apiHost: options.apiHost,
|
|
26
|
+
existingConnectorUrl,
|
|
27
|
+
configuredConnectorUrl: options.connectorUrl,
|
|
28
|
+
});
|
|
23
29
|
const session = await beginBridgeHandoff({
|
|
24
30
|
apiHost: options.apiHost,
|
|
25
31
|
idpBaseUrl: options.idpBaseUrl,
|
|
@@ -28,7 +34,7 @@ export async function startOrGetChannelSetup(options) {
|
|
|
28
34
|
const record = {
|
|
29
35
|
session,
|
|
30
36
|
apiHost: options.apiHost,
|
|
31
|
-
connectorUrl
|
|
37
|
+
connectorUrl,
|
|
32
38
|
idpBaseUrl: options.idpBaseUrl,
|
|
33
39
|
invitedBy: options.invitedBy,
|
|
34
40
|
};
|
|
@@ -82,9 +88,8 @@ async function completePendingSetup(record) {
|
|
|
82
88
|
const handoff = await completeBridgeHandoff(record.session);
|
|
83
89
|
if (pendingSetup !== record)
|
|
84
90
|
return;
|
|
85
|
-
const existingConnectorUrl = await readExistingConnectorUrl();
|
|
86
91
|
const creds = {
|
|
87
|
-
connectorUrl:
|
|
92
|
+
connectorUrl: record.connectorUrl,
|
|
88
93
|
token: handoff.token,
|
|
89
94
|
};
|
|
90
95
|
await writeCredentials(creds, record.apiHost, record.idpBaseUrl, record.invitedBy);
|
package/dist/cli-setup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-setup.d.ts","sourceRoot":"","sources":["../src/cli-setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-setup.d.ts","sourceRoot":"","sources":["../src/cli-setup.ts"],"names":[],"mappings":"AAyFA,UAAU,eAAe;IACvB,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAOD,UAAU,gBAAgB;IACxB,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,eAAe,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAiFD,wBAAsB,KAAK,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmEhE"}
|
package/dist/cli-setup.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readExistingConnectorUrl, writeCredentials } from "./config.js";
|
|
2
|
+
import { ConnectorUrlConfigurationError, resolveConnectorUrlForSetup, } from "./connector-url-boundary.js";
|
|
2
3
|
import { beginBridgeHandoff, completeBridgeHandoff, DEFAULT_IDP_BASE_URL, SetupFlowError, } from "./handoff.js";
|
|
3
4
|
import { DEFAULT_API_HOST, DEFAULT_CONNECTOR_URL, PlatformApiError, } from "./platform-client.js";
|
|
4
5
|
async function serverBridgeHandoffFlow(apiHost, idpBaseUrl, runtime, channelInput) {
|
|
@@ -40,7 +41,22 @@ export async function login(ctx) {
|
|
|
40
41
|
}
|
|
41
42
|
const existingConnectorUrl = await readExistingConnectorUrl();
|
|
42
43
|
const configuredConnectorUrl = typeof ctx.cfg.connectorUrl === "string" ? ctx.cfg.connectorUrl : undefined;
|
|
43
|
-
|
|
44
|
+
let connectorUrl;
|
|
45
|
+
try {
|
|
46
|
+
connectorUrl = resolveConnectorUrlForSetup({
|
|
47
|
+
apiHost,
|
|
48
|
+
existingConnectorUrl,
|
|
49
|
+
configuredConnectorUrl,
|
|
50
|
+
defaultConnectorUrl: DEFAULT_CONNECTOR_URL,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
if (err instanceof ConnectorUrlConfigurationError) {
|
|
55
|
+
ctx.runtime.error(err.message);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
throw err;
|
|
59
|
+
}
|
|
44
60
|
await writeCredentials({ connectorUrl, token: handoff.token }, apiHost, idpBaseUrl);
|
|
45
61
|
ctx.runtime.log(`✓ Connected as @${handoff.agent.handle}`);
|
|
46
62
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const MASONS_CLOUD_TRANSPORT_BY_API_HOST: Record<string, string>;
|
|
2
|
+
export declare const MASONS_CLOUD_IDENTITY_AUTHORITY_HOSTS: Set<string>;
|
|
3
|
+
export declare class ConnectorUrlConfigurationError extends Error {
|
|
4
|
+
name: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveConnectorUrlForSetup(input: {
|
|
7
|
+
apiHost: string;
|
|
8
|
+
existingConnectorUrl?: string;
|
|
9
|
+
configuredConnectorUrl?: string;
|
|
10
|
+
defaultConnectorUrl?: string;
|
|
11
|
+
}): string;
|
|
12
|
+
//# sourceMappingURL=connector-url-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector-url-boundary.d.ts","sourceRoot":"","sources":["../src/connector-url-boundary.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kCAAkC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAGrE,CAAC;AAEF,eAAO,MAAM,qCAAqC,aAGhD,CAAC;AAEH,qBAAa,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,SAAoC;CAClD;AA+CD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,GAAG,MAAM,CA4BT"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { DEFAULT_CONNECTOR_URL } from "./platform-client.js";
|
|
2
|
+
export const MASONS_CLOUD_TRANSPORT_BY_API_HOST = {
|
|
3
|
+
"api.masons.ai": "connectorapi.masons.ai",
|
|
4
|
+
"preview-api.masons.ai": "preview-connectorapi.masons.ai",
|
|
5
|
+
};
|
|
6
|
+
export const MASONS_CLOUD_IDENTITY_AUTHORITY_HOSTS = new Set([
|
|
7
|
+
"masons.ai",
|
|
8
|
+
"preview.masons.ai",
|
|
9
|
+
]);
|
|
10
|
+
export class ConnectorUrlConfigurationError extends Error {
|
|
11
|
+
name = "ConnectorUrlConfigurationError";
|
|
12
|
+
}
|
|
13
|
+
function normalizeHost(value) {
|
|
14
|
+
const trimmed = value.trim().replace(/\/+$/, "");
|
|
15
|
+
const withScheme = /^[a-z][a-z0-9+.-]*:\/\//i.test(trimmed)
|
|
16
|
+
? trimmed
|
|
17
|
+
: `https://${trimmed}`;
|
|
18
|
+
try {
|
|
19
|
+
return new URL(withScheme).hostname.toLowerCase();
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return trimmed.toLowerCase();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function parseUrl(value) {
|
|
26
|
+
try {
|
|
27
|
+
return new URL(value);
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function defaultMasonsCloudConnectorUrl(apiHost) {
|
|
34
|
+
const transportHost = MASONS_CLOUD_TRANSPORT_BY_API_HOST[normalizeHost(apiHost)];
|
|
35
|
+
return transportHost ? `wss://${transportHost}/gateway` : undefined;
|
|
36
|
+
}
|
|
37
|
+
function healKnownStaleMasonsCloudConnectorUrl(connectorUrl, apiHost) {
|
|
38
|
+
if (!connectorUrl)
|
|
39
|
+
return undefined;
|
|
40
|
+
const transportDefault = defaultMasonsCloudConnectorUrl(apiHost);
|
|
41
|
+
if (!transportDefault)
|
|
42
|
+
return connectorUrl;
|
|
43
|
+
const parsed = parseUrl(connectorUrl);
|
|
44
|
+
if (!parsed)
|
|
45
|
+
return connectorUrl;
|
|
46
|
+
if (!MASONS_CLOUD_IDENTITY_AUTHORITY_HOSTS.has(parsed.hostname.toLowerCase())) {
|
|
47
|
+
return connectorUrl;
|
|
48
|
+
}
|
|
49
|
+
return transportDefault;
|
|
50
|
+
}
|
|
51
|
+
export function resolveConnectorUrlForSetup(input) {
|
|
52
|
+
const cloudDefault = defaultMasonsCloudConnectorUrl(input.apiHost);
|
|
53
|
+
const existingConnectorUrl = healKnownStaleMasonsCloudConnectorUrl(input.existingConnectorUrl, input.apiHost);
|
|
54
|
+
if (existingConnectorUrl)
|
|
55
|
+
return existingConnectorUrl;
|
|
56
|
+
const configuredConnectorUrl = healKnownStaleMasonsCloudConnectorUrl(input.configuredConnectorUrl, input.apiHost);
|
|
57
|
+
if (configuredConnectorUrl)
|
|
58
|
+
return configuredConnectorUrl;
|
|
59
|
+
if (cloudDefault)
|
|
60
|
+
return cloudDefault;
|
|
61
|
+
if (input.defaultConnectorUrl &&
|
|
62
|
+
input.defaultConnectorUrl !== DEFAULT_CONNECTOR_URL) {
|
|
63
|
+
return input.defaultConnectorUrl;
|
|
64
|
+
}
|
|
65
|
+
throw new ConnectorUrlConfigurationError(`connectorUrl is required for self-hosted apiHost "${normalizeHost(input.apiHost)}". Configure the Connector transport URL explicitly; the MASONS preview Connector default is only used for MASONS Cloud accounts.`);
|
|
66
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-client.d.ts","sourceRoot":"","sources":["../src/platform-client.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-client.d.ts","sourceRoot":"","sources":["../src/platform-client.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,gBAAgB,0BAA0B,CAAC;AASxD,eAAO,MAAM,qBAAqB,iDACc,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,qBAAa,gBAAiB,SAAQ,KAAK;aAEvB,MAAM,EAAE,MAAM;aACd,IAAI,EAAE,MAAM;gBADZ,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EAC5B,OAAO,EAAE,MAAM;CAKlB;AAMD,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,MAAM,EAAE,CAAC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file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAqEA,UAAU,WAAW;IACnB,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CACP,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED,UAAU,WAAW;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,KAAK,WAAW,GAAG,CAAC,GAAG,EAAE,WAAW,KAAK,cAAc,GAAG,IAAI,GAAG,SAAS,CAAC;AAE3E,UAAU,OAAO;IACf,YAAY,CACV,IAAI,EAAE,cAAc,GAAG,WAAW,EAClC,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,IAAI,CAAC;CACT;AAoDD,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C;AAqRD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAw0BhD"}
|
package/dist/tools.js
CHANGED
|
@@ -71,7 +71,7 @@ function getSetupOptionsFromToolContext(ctx) {
|
|
|
71
71
|
const cfg = extractSetupConfig(ctx);
|
|
72
72
|
return {
|
|
73
73
|
apiHost: stringValue(cfg.apiHost) ?? defaults.apiHost,
|
|
74
|
-
connectorUrl: stringValue(cfg.connectorUrl)
|
|
74
|
+
connectorUrl: stringValue(cfg.connectorUrl),
|
|
75
75
|
idpBaseUrl: stringValue(cfg.idpBaseUrl) ?? defaults.idpBaseUrl,
|
|
76
76
|
};
|
|
77
77
|
}
|
|
@@ -216,12 +216,23 @@ export function registerTools(api) {
|
|
|
216
216
|
? params.invitedBy
|
|
217
217
|
: undefined;
|
|
218
218
|
const existing = consumeChannelSetupStatus();
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
219
|
+
let result;
|
|
220
|
+
try {
|
|
221
|
+
result = existing
|
|
222
|
+
? existing
|
|
223
|
+
: await startOrGetChannelSetup({
|
|
224
|
+
...getSetupOptionsFromToolContext(ctx),
|
|
225
|
+
invitedBy,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
result = {
|
|
230
|
+
status: "failed",
|
|
231
|
+
message: err instanceof Error
|
|
232
|
+
? err.message
|
|
233
|
+
: "Agent Network setup failed.",
|
|
234
|
+
};
|
|
235
|
+
}
|
|
225
236
|
return textResult(formatChannelSetupResult(result));
|
|
226
237
|
},
|
|
227
238
|
}), { name: "masons_setup" });
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export declare const PLUGIN_VERSION = "0.6.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PLUGIN_VERSION = "0.6.
|
|
1
|
+
export const PLUGIN_VERSION = "0.6.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@masons/agent-network",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "MASONS Agent Network — OpenClaw channel plugin for connecting agent runtimes to the Agent Network over MSTP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MASONS.ai <hello@masons.ai> (https://masons.ai)",
|
|
@@ -21,6 +21,15 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"dev": "tsc --watch",
|
|
27
|
+
"test": "tsc -p test/tsconfig.json && node --test --loader ts-node/esm 'test/**/*.test.ts'",
|
|
28
|
+
"lint": "biome check",
|
|
29
|
+
"format": "biome format --write",
|
|
30
|
+
"prepublishOnly": "bash scripts/check-version.sh && npm run build && npm run test",
|
|
31
|
+
"release": "pnpm publish --access public"
|
|
32
|
+
},
|
|
24
33
|
"files": [
|
|
25
34
|
"dist/",
|
|
26
35
|
"openclaw.plugin.json",
|
|
@@ -65,6 +74,10 @@
|
|
|
65
74
|
"./handoff": {
|
|
66
75
|
"types": "./dist/handoff.d.ts",
|
|
67
76
|
"default": "./dist/handoff.js"
|
|
77
|
+
},
|
|
78
|
+
"./connector-url-boundary": {
|
|
79
|
+
"types": "./dist/connector-url-boundary.d.ts",
|
|
80
|
+
"default": "./dist/connector-url-boundary.js"
|
|
68
81
|
}
|
|
69
82
|
},
|
|
70
83
|
"dependencies": {
|
|
@@ -79,13 +92,5 @@
|
|
|
79
92
|
"@types/ws": "^8",
|
|
80
93
|
"ts-node": "^10",
|
|
81
94
|
"typescript": "^5"
|
|
82
|
-
},
|
|
83
|
-
"scripts": {
|
|
84
|
-
"build": "tsc",
|
|
85
|
-
"dev": "tsc --watch",
|
|
86
|
-
"test": "tsc -p test/tsconfig.json && node --test --loader ts-node/esm 'test/**/*.test.ts'",
|
|
87
|
-
"lint": "biome check",
|
|
88
|
-
"format": "biome format --write",
|
|
89
|
-
"release": "pnpm publish --access public"
|
|
90
95
|
}
|
|
91
|
-
}
|
|
96
|
+
}
|