@cello-protocol/cli 0.0.305 → 0.0.307
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/.claude-plugin/marketplace.json +15 -0
- package/README.md +107 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +564 -0
- package/dist/daemon/account-page-assets.d.ts +4 -0
- package/dist/daemon/account-page-assets.js +160 -0
- package/dist/daemon/account-page.d.ts +14 -0
- package/dist/daemon/account-page.js +104 -0
- package/dist/daemon/address.d.ts +10 -0
- package/dist/daemon/address.js +34 -0
- package/dist/daemon/away.d.ts +31 -0
- package/dist/daemon/away.js +65 -0
- package/dist/daemon/channel-store.d.ts +112 -0
- package/dist/daemon/channel-store.js +284 -0
- package/dist/daemon/channels.d.ts +46 -0
- package/dist/daemon/channels.js +1049 -0
- package/dist/daemon/contacts.d.ts +26 -0
- package/dist/daemon/contacts.js +74 -0
- package/dist/daemon/engine.d.ts +80 -0
- package/dist/daemon/engine.js +2882 -0
- package/dist/daemon/errors.d.ts +5 -0
- package/dist/daemon/errors.js +16 -0
- package/dist/daemon/governance.d.ts +66 -0
- package/dist/daemon/governance.js +514 -0
- package/dist/daemon/guards.d.ts +36 -0
- package/dist/daemon/guards.js +140 -0
- package/dist/daemon/issuer-client.d.ts +56 -0
- package/dist/daemon/issuer-client.js +143 -0
- package/dist/daemon/link.d.ts +30 -0
- package/dist/daemon/link.js +191 -0
- package/dist/daemon/log.d.ts +1 -0
- package/dist/daemon/log.js +4 -0
- package/dist/daemon/main.d.ts +1 -0
- package/dist/daemon/main.js +511 -0
- package/dist/daemon/paths.d.ts +6 -0
- package/dist/daemon/paths.js +21 -0
- package/dist/daemon/pii.d.ts +24 -0
- package/dist/daemon/pii.js +146 -0
- package/dist/daemon/policy-cadence.d.ts +33 -0
- package/dist/daemon/policy-cadence.js +59 -0
- package/dist/daemon/policy-proposals.d.ts +41 -0
- package/dist/daemon/policy-proposals.js +83 -0
- package/dist/daemon/policy-store.d.ts +47 -0
- package/dist/daemon/policy-store.js +144 -0
- package/dist/daemon/presented.d.ts +36 -0
- package/dist/daemon/presented.js +94 -0
- package/dist/daemon/rate-limit.d.ts +17 -0
- package/dist/daemon/rate-limit.js +44 -0
- package/dist/daemon/reach.d.ts +63 -0
- package/dist/daemon/reach.js +207 -0
- package/dist/daemon/screening.d.ts +97 -0
- package/dist/daemon/screening.js +362 -0
- package/dist/daemon/settings.d.ts +125 -0
- package/dist/daemon/settings.js +73 -0
- package/dist/daemon/signal-rules.d.ts +55 -0
- package/dist/daemon/signal-rules.js +127 -0
- package/dist/daemon/signal-store.d.ts +53 -0
- package/dist/daemon/signal-store.js +114 -0
- package/dist/daemon/store.d.ts +188 -0
- package/dist/daemon/store.js +474 -0
- package/dist/daemon/tiers.d.ts +14 -0
- package/dist/daemon/tiers.js +9 -0
- package/dist/daemon/wallet.d.ts +73 -0
- package/dist/daemon/wallet.js +428 -0
- package/dist/daemon/who-label.d.ts +3 -0
- package/dist/daemon/who-label.js +11 -0
- package/dist/guidance.d.ts +39 -0
- package/dist/guidance.js +98 -0
- package/dist/hermes-bridge.d.ts +26 -0
- package/dist/hermes-bridge.js +180 -0
- package/dist/install-mcp.d.ts +6 -0
- package/dist/install-mcp.js +77 -0
- package/dist/ipc/client.d.ts +18 -0
- package/dist/ipc/client.js +107 -0
- package/dist/ipc/operations.d.ts +30 -0
- package/dist/ipc/operations.js +835 -0
- package/dist/ipc/protocol.d.ts +21 -0
- package/dist/ipc/protocol.js +1 -0
- package/dist/issuer-list-sign.d.ts +12 -0
- package/dist/issuer-list-sign.js +43 -0
- package/dist/local-operations.d.ts +2 -0
- package/dist/local-operations.js +73 -0
- package/dist/mcp-tools.d.ts +14 -0
- package/dist/mcp-tools.js +45 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +155 -0
- package/dist/protocol/aead.d.ts +4 -0
- package/dist/protocol/aead.js +35 -0
- package/dist/protocol/cbor.d.ts +40 -0
- package/dist/protocol/cbor.js +106 -0
- package/dist/protocol/chain.d.ts +44 -0
- package/dist/protocol/chain.js +126 -0
- package/dist/protocol/channel.d.ts +153 -0
- package/dist/protocol/channel.js +298 -0
- package/dist/protocol/encode.d.ts +6 -0
- package/dist/protocol/encode.js +21 -0
- package/dist/protocol/identity.d.ts +27 -0
- package/dist/protocol/identity.js +94 -0
- package/dist/protocol/issuer-list.d.ts +56 -0
- package/dist/protocol/issuer-list.js +193 -0
- package/dist/protocol/issuer-roots.d.ts +6 -0
- package/dist/protocol/issuer-roots.js +10 -0
- package/dist/protocol/key-agreement.d.ts +20 -0
- package/dist/protocol/key-agreement.js +88 -0
- package/dist/protocol/merkle.d.ts +16 -0
- package/dist/protocol/merkle.js +166 -0
- package/dist/protocol/ml-dsa.d.ts +28 -0
- package/dist/protocol/ml-dsa.js +58 -0
- package/dist/protocol/ml-kem.d.ts +14 -0
- package/dist/protocol/ml-kem.js +57 -0
- package/dist/protocol/pq-errors.d.ts +9 -0
- package/dist/protocol/pq-errors.js +23 -0
- package/dist/protocol/pq-warnings.d.ts +1 -0
- package/dist/protocol/pq-warnings.js +18 -0
- package/dist/protocol/presented-signals.d.ts +17 -0
- package/dist/protocol/presented-signals.js +92 -0
- package/dist/protocol/salt.d.ts +5 -0
- package/dist/protocol/salt.js +47 -0
- package/dist/protocol/seal.d.ts +58 -0
- package/dist/protocol/seal.js +220 -0
- package/dist/protocol/signal.d.ts +54 -0
- package/dist/protocol/signal.js +266 -0
- package/dist/protocol/status.d.ts +41 -0
- package/dist/protocol/status.js +64 -0
- package/dist/protocol/structures.d.ts +359 -0
- package/dist/protocol/structures.js +296 -0
- package/dist/protocol/transcript.d.ts +61 -0
- package/dist/protocol/transcript.js +319 -0
- package/dist/protocol/wire.d.ts +212 -0
- package/dist/protocol/wire.js +161 -0
- package/dist/require-node.d.ts +1 -0
- package/dist/require-node.js +10 -0
- package/dist/screener/affordance.d.ts +1 -0
- package/dist/screener/affordance.js +2 -0
- package/dist/screener/classifier-selfcheck.d.ts +29 -0
- package/dist/screener/classifier-selfcheck.js +56 -0
- package/dist/screener/exfil.d.ts +11 -0
- package/dist/screener/exfil.js +45 -0
- package/dist/screener/gitleaks-rules.d.ts +9 -0
- package/dist/screener/gitleaks-rules.js +226 -0
- package/dist/screener/inbound.d.ts +25 -0
- package/dist/screener/inbound.js +102 -0
- package/dist/screener/injection-classifier-onnx.d.ts +20 -0
- package/dist/screener/injection-classifier-onnx.js +89 -0
- package/dist/screener/injection-classifier-wasm.d.ts +2 -0
- package/dist/screener/injection-classifier-wasm.js +97 -0
- package/dist/screener/injection-patterns.d.ts +8 -0
- package/dist/screener/injection-patterns.js +48 -0
- package/dist/screener/injection-windows.d.ts +9 -0
- package/dist/screener/injection-windows.js +37 -0
- package/dist/screener/language.d.ts +15 -0
- package/dist/screener/language.js +71 -0
- package/dist/screener/linear-regex.d.ts +8 -0
- package/dist/screener/linear-regex.js +27 -0
- package/dist/screener/model-installer.d.ts +14 -0
- package/dist/screener/model-installer.js +61 -0
- package/dist/screener/outbound.d.ts +19 -0
- package/dist/screener/outbound.js +62 -0
- package/dist/screener/sanitize.d.ts +44 -0
- package/dist/screener/sanitize.js +361 -0
- package/dist/screener/scan-variants.d.ts +5 -0
- package/dist/screener/scan-variants.js +146 -0
- package/dist/screener/screener-model-manifest.d.ts +16 -0
- package/dist/screener/screener-model-manifest.js +20 -0
- package/dist/screener/screener-state.d.ts +29 -0
- package/dist/screener/screener-state.js +119 -0
- package/dist/screener/secrets.d.ts +18 -0
- package/dist/screener/secrets.js +84 -0
- package/dist/screener/worker.d.ts +6 -0
- package/dist/screener/worker.js +83 -0
- package/dist/setup.d.ts +9 -0
- package/dist/setup.js +252 -0
- package/dist/shipped-issuer-list.d.ts +1 -0
- package/dist/shipped-issuer-list.js +3 -0
- package/dist/signals-text.d.ts +46 -0
- package/dist/signals-text.js +81 -0
- package/dist/verify-seal.d.ts +9 -0
- package/dist/verify-seal.js +30 -0
- package/hermes/plugin/__init__.py +1040 -0
- package/hermes/plugin/plugin.yaml +30 -0
- package/hermes/skills/cello-bridge-setup/SKILL.md +38 -0
- package/hermes/skills/cello-policy/SKILL.md +44 -0
- package/package.json +48 -16
- package/plugins/cello/.claude-plugin/plugin.json +19 -0
- package/plugins/cello/.mcp.json +7 -0
- package/plugins/cello/skills/cello/SKILL.md +117 -0
- package/dist/arg-parse.d.ts +0 -19
- package/dist/arg-parse.d.ts.map +0 -1
- package/dist/arg-parse.js +0 -29
- package/dist/arg-parse.js.map +0 -1
- package/dist/bin/cello.d.ts +0 -15
- package/dist/bin/cello.d.ts.map +0 -1
- package/dist/bin/cello.js +0 -110
- package/dist/bin/cello.js.map +0 -1
- package/dist/cli-args.d.ts +0 -62
- package/dist/cli-args.d.ts.map +0 -1
- package/dist/cli-args.js +0 -129
- package/dist/cli-args.js.map +0 -1
- package/dist/commands.d.ts +0 -196
- package/dist/commands.d.ts.map +0 -1
- package/dist/commands.js +0 -1544
- package/dist/commands.js.map +0 -1
- package/dist/hermes/assets.d.ts +0 -41
- package/dist/hermes/assets.d.ts.map +0 -1
- package/dist/hermes/assets.js +0 -2281
- package/dist/hermes/assets.js.map +0 -1
- package/dist/hermes/install-hermes.d.ts +0 -50
- package/dist/hermes/install-hermes.d.ts.map +0 -1
- package/dist/hermes/install-hermes.js +0 -232
- package/dist/hermes/install-hermes.js.map +0 -1
- package/dist/json-out.d.ts +0 -41
- package/dist/json-out.d.ts.map +0 -1
- package/dist/json-out.js +0 -59
- package/dist/json-out.js.map +0 -1
- package/dist/node-runtime-guard-init.d.ts +0 -6
- package/dist/node-runtime-guard-init.d.ts.map +0 -1
- package/dist/node-runtime-guard-init.js +0 -7
- package/dist/node-runtime-guard-init.js.map +0 -1
- package/dist/node-runtime-guard.d.ts +0 -48
- package/dist/node-runtime-guard.d.ts.map +0 -1
- package/dist/node-runtime-guard.js +0 -79
- package/dist/node-runtime-guard.js.map +0 -1
- package/dist/parity-commands.d.ts +0 -427
- package/dist/parity-commands.d.ts.map +0 -1
- package/dist/parity-commands.js +0 -953
- package/dist/parity-commands.js.map +0 -1
- package/dist/registry.d.ts +0 -120
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -2169
- package/dist/registry.js.map +0 -1
- package/dist/screener-commands.d.ts +0 -85
- package/dist/screener-commands.d.ts.map +0 -1
- package/dist/screener-commands.js +0 -313
- package/dist/screener-commands.js.map +0 -1
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// The security guards, one set per agent, with its running values written when the agent is created.
|
|
2
|
+
// Each change is judged by which way it goes. Tightening is free, and loosening asks a person. The first change to a key
|
|
3
|
+
// is judged against the baseline, not the running default, so turning off a check that was never on still asks.
|
|
4
|
+
import { LocalError } from "./errors.js";
|
|
5
|
+
import { SCRIPTS, isScript } from "../screener/language.js";
|
|
6
|
+
const SCHEMA = `
|
|
7
|
+
CREATE TABLE IF NOT EXISTS guards (
|
|
8
|
+
agent_id BLOB NOT NULL REFERENCES agents(agent_id),
|
|
9
|
+
key TEXT NOT NULL,
|
|
10
|
+
value_json TEXT NOT NULL,
|
|
11
|
+
updated_at INTEGER NOT NULL,
|
|
12
|
+
PRIMARY KEY (agent_id, key)
|
|
13
|
+
);
|
|
14
|
+
-- Every change to anything that protects this agent, so a weakening shows afterwards, whoever made it.
|
|
15
|
+
CREATE TABLE IF NOT EXISTS guard_changes (
|
|
16
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
17
|
+
agent_id BLOB NOT NULL REFERENCES agents(agent_id),
|
|
18
|
+
key TEXT NOT NULL,
|
|
19
|
+
from_json TEXT,
|
|
20
|
+
to_json TEXT NOT NULL,
|
|
21
|
+
direction TEXT NOT NULL CHECK (direction IN ('loosen', 'tighten', 'neutral')),
|
|
22
|
+
confirmed INTEGER NOT NULL,
|
|
23
|
+
at INTEGER NOT NULL
|
|
24
|
+
);
|
|
25
|
+
`;
|
|
26
|
+
const moreLoose = (from, to) => {
|
|
27
|
+
const a = new Set(from);
|
|
28
|
+
const b = new Set(to);
|
|
29
|
+
if ([...b].some((v) => !a.has(v)))
|
|
30
|
+
return "loosen";
|
|
31
|
+
return [...a].some((v) => !b.has(v)) ? "tighten" : "neutral";
|
|
32
|
+
};
|
|
33
|
+
const offLoosens = (from, to) => (from && !to ? "loosen" : !from && to ? "tighten" : "neutral");
|
|
34
|
+
const onLoosens = (from, to) => (!from && to ? "loosen" : from && !to ? "tighten" : "neutral");
|
|
35
|
+
const bool = (key) => (raw) => {
|
|
36
|
+
if (raw === "true" || raw === "false")
|
|
37
|
+
return raw === "true";
|
|
38
|
+
throw new LocalError("bad_argument", `${key} is true or false, not ${raw}`);
|
|
39
|
+
};
|
|
40
|
+
export const GUARDS = {
|
|
41
|
+
autonomous_override: { default: false, baseline: false, classify: onLoosens, coerce: bool("autonomous_override"), describes: "whether the agent may send a flagged value with no person present" },
|
|
42
|
+
pii_whitelist: {
|
|
43
|
+
default: [],
|
|
44
|
+
baseline: [],
|
|
45
|
+
classify: moreLoose,
|
|
46
|
+
coerce: (raw) => raw.split(",").map((v) => v.trim()).filter(Boolean),
|
|
47
|
+
describes: "values, such as your own email, that pass without being held. Comma-separated, and an empty string clears it",
|
|
48
|
+
},
|
|
49
|
+
pii_check_email: { default: false, baseline: true, classify: offLoosens, coerce: bool("pii_check_email"), describes: "hold outbound messages with an email address" },
|
|
50
|
+
pii_check_phone: { default: false, baseline: true, classify: offLoosens, coerce: bool("pii_check_phone"), describes: "hold outbound messages with what looks like a phone number. Lists of numbers, such as versions, can look like one" },
|
|
51
|
+
language_allow: {
|
|
52
|
+
default: ["latin"],
|
|
53
|
+
baseline: ["latin"],
|
|
54
|
+
classify: moreLoose,
|
|
55
|
+
coerce: (raw) => {
|
|
56
|
+
const list = raw.split(",").map((v) => v.trim()).filter(Boolean);
|
|
57
|
+
if (list.length === 0)
|
|
58
|
+
throw new LocalError("bad_argument", `language_allow can't be empty: with language_enforce on, that would refuse every language, including yours. Pass the scripts you read. They are: ${SCRIPTS.join(", ")}`);
|
|
59
|
+
const unknown = list.filter((v) => !isScript(v));
|
|
60
|
+
if (unknown.length > 0)
|
|
61
|
+
throw new LocalError("bad_argument", `not a script: ${unknown.join(", ")}. language_allow takes scripts, not languages: Greek is greek, Japanese is kana, Chinese is han. They are: ${SCRIPTS.join(", ")}`);
|
|
62
|
+
return list;
|
|
63
|
+
},
|
|
64
|
+
describes: "which scripts count as your languages. Only used when language_enforce is on",
|
|
65
|
+
},
|
|
66
|
+
language_enforce: { default: false, baseline: true, classify: offLoosens, coerce: bool("language_enforce"), describes: "refuse mail outside your languages, instead of delivering it with a note" },
|
|
67
|
+
rate_max_per_window: {
|
|
68
|
+
default: 0,
|
|
69
|
+
baseline: 0,
|
|
70
|
+
classify: (from, to) => {
|
|
71
|
+
const looseness = (v) => (v === 0 ? Infinity : v);
|
|
72
|
+
return looseness(to) > looseness(from) ? "loosen" : looseness(to) < looseness(from) ? "tighten" : "neutral";
|
|
73
|
+
},
|
|
74
|
+
coerce: (raw) => {
|
|
75
|
+
const value = Number(raw);
|
|
76
|
+
if (raw.trim() === "" || !Number.isInteger(value) || value < 0)
|
|
77
|
+
throw new LocalError("bad_argument", "rate_max_per_window is a whole number. 0 means no cap");
|
|
78
|
+
return value;
|
|
79
|
+
},
|
|
80
|
+
describes: "how many outbound messages are allowed per window. 0 means no cap",
|
|
81
|
+
},
|
|
82
|
+
rate_window_ms: {
|
|
83
|
+
default: 60_000,
|
|
84
|
+
baseline: 60_000,
|
|
85
|
+
classify: (from, to) => (to < from ? "loosen" : to > from ? "tighten" : "neutral"),
|
|
86
|
+
coerce: (raw) => {
|
|
87
|
+
const value = Number(raw);
|
|
88
|
+
if (!Number.isInteger(value) || value <= 0)
|
|
89
|
+
throw new LocalError("bad_argument", "rate_window_ms is a positive whole number of milliseconds");
|
|
90
|
+
return value;
|
|
91
|
+
},
|
|
92
|
+
describes: "the window the outbound cap applies to, in milliseconds. A shorter one lets more through",
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export class Guards {
|
|
96
|
+
#store;
|
|
97
|
+
constructor(store) {
|
|
98
|
+
this.#store = store;
|
|
99
|
+
store.exec(SCHEMA);
|
|
100
|
+
}
|
|
101
|
+
writeDefaults(agentId) {
|
|
102
|
+
for (const [key, guard] of Object.entries(GUARDS)) {
|
|
103
|
+
this.#store.prepare("INSERT OR IGNORE INTO guards (agent_id, key, value_json, updated_at) VALUES (?, ?, ?, ?)").run(agentId, key, JSON.stringify(guard.default), Date.now());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Read when it's needed, so a change holds from the next message.
|
|
107
|
+
value(agentId, key) {
|
|
108
|
+
const row = this.#store.prepare("SELECT value_json FROM guards WHERE agent_id = ? AND key = ?").get(agentId, key);
|
|
109
|
+
if (!row)
|
|
110
|
+
throw new LocalError("guard_missing", `this agent has no guard named ${key}`);
|
|
111
|
+
return JSON.parse(row.value_json);
|
|
112
|
+
}
|
|
113
|
+
list(agentId) {
|
|
114
|
+
return Object.entries(GUARDS).map(([key, guard]) => {
|
|
115
|
+
const last = this.#store.prepare("SELECT direction, confirmed, at FROM guard_changes WHERE agent_id = ? AND key = ? ORDER BY id DESC LIMIT 1").get(agentId, key);
|
|
116
|
+
return { key, describes: guard.describes, value: this.value(agentId, key), last_change: last ? { direction: last.direction, by_a_person: last.confirmed === 1, at: new Date(last.at).toISOString() } : null };
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
plan(agentId, key, raw) {
|
|
120
|
+
const guard = GUARDS[key];
|
|
121
|
+
if (!guard)
|
|
122
|
+
throw new LocalError("unknown_guard", `there's no guard named ${key}. They are: ${Object.keys(GUARDS).join(", ")}`);
|
|
123
|
+
const value = guard.coerce(raw);
|
|
124
|
+
const changedBefore = this.#store.prepare("SELECT 1 FROM guard_changes WHERE agent_id = ? AND key = ? LIMIT 1").get(agentId, key) !== undefined;
|
|
125
|
+
const was = this.value(agentId, key);
|
|
126
|
+
return { key, value, was, direction: guard.classify(changedBefore ? was : guard.baseline, value) };
|
|
127
|
+
}
|
|
128
|
+
apply(agentId, plan, confirmed) {
|
|
129
|
+
this.#store.transaction(() => {
|
|
130
|
+
this.#store.prepare("UPDATE guards SET value_json = ?, updated_at = ? WHERE agent_id = ? AND key = ?").run(JSON.stringify(plan.value), Date.now(), agentId, plan.key);
|
|
131
|
+
this.record(agentId, plan.key, plan.was, plan.value, plan.direction, confirmed);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
record(agentId, key, from, to, direction, confirmed) {
|
|
135
|
+
this.#store.prepare("INSERT INTO guard_changes (agent_id, key, from_json, to_json, direction, confirmed, at) VALUES (?, ?, ?, ?, ?, ?, ?)").run(agentId, key, from === undefined ? null : JSON.stringify(from), JSON.stringify(to), direction, confirmed ? 1 : 0, Date.now());
|
|
136
|
+
}
|
|
137
|
+
changes(agentId, limit) {
|
|
138
|
+
return this.#store.prepare("SELECT key, from_json, to_json, direction, confirmed, at FROM guard_changes WHERE agent_id = ? ORDER BY id DESC LIMIT ?").all(agentId, limit);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { DualSignature, IdentitySeeds, PublicIdentity } from "../protocol/identity.ts";
|
|
2
|
+
export declare const AGENT_REQUEST_DOMAIN = "cello-issuer-request-v1";
|
|
3
|
+
export declare const AGENT_REQUEST_CONTEXT = "cello-issuer-request";
|
|
4
|
+
export declare const MAX_REQUEST_LIFETIME_SECONDS = 300;
|
|
5
|
+
export type AgentRequestAction = "redeem" | "collect" | "add_agent" | "endorse" | "withdraw" | "refuse";
|
|
6
|
+
export interface AgentRequestFields {
|
|
7
|
+
action: AgentRequestAction;
|
|
8
|
+
issuerAddress: string;
|
|
9
|
+
agent: PublicIdentity;
|
|
10
|
+
nonce: Uint8Array;
|
|
11
|
+
issuedAt: number;
|
|
12
|
+
expiresAt: number;
|
|
13
|
+
code: string | null;
|
|
14
|
+
target: string | null;
|
|
15
|
+
holder: PublicIdentity | null;
|
|
16
|
+
holderSignal: Uint8Array | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function encodeAgentRequest(f: AgentRequestFields): Uint8Array;
|
|
19
|
+
export declare function framedAgentRequest(bytes: Uint8Array): Uint8Array<ArrayBuffer>;
|
|
20
|
+
export interface AgentRequestOnWire {
|
|
21
|
+
request: string;
|
|
22
|
+
signature: {
|
|
23
|
+
ed: string;
|
|
24
|
+
pq: string;
|
|
25
|
+
};
|
|
26
|
+
holderSignature?: {
|
|
27
|
+
ed: string;
|
|
28
|
+
pq: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export declare function agentRequestToWire(bytes: Uint8Array, signature: DualSignature, holderSignature?: DualSignature): AgentRequestOnWire;
|
|
32
|
+
export declare class IssuerRefused extends Error {
|
|
33
|
+
readonly reason: string;
|
|
34
|
+
constructor(reason: string, guidance: string);
|
|
35
|
+
}
|
|
36
|
+
export declare class IssuerUnreachable extends Error {
|
|
37
|
+
}
|
|
38
|
+
export declare class BadIssuerUrl extends Error {
|
|
39
|
+
}
|
|
40
|
+
export declare function parseIssuerUrl(raw: string): URL;
|
|
41
|
+
export interface AgentKeys {
|
|
42
|
+
identity: PublicIdentity;
|
|
43
|
+
seeds: IdentitySeeds;
|
|
44
|
+
}
|
|
45
|
+
export interface IssuerAnswer {
|
|
46
|
+
signals: Uint8Array[];
|
|
47
|
+
}
|
|
48
|
+
export declare class IssuerClient {
|
|
49
|
+
#private;
|
|
50
|
+
constructor(issuerUrl: string, fetcher?: typeof fetch);
|
|
51
|
+
get address(): string;
|
|
52
|
+
redeem(agent: AgentKeys, code: string): Promise<IssuerAnswer>;
|
|
53
|
+
collect(agent: AgentKeys): Promise<IssuerAnswer>;
|
|
54
|
+
addAgent(agent: AgentKeys, holder: AgentKeys, holderSignal: Uint8Array): Promise<IssuerAnswer>;
|
|
55
|
+
latestIssuerList(): Promise<Uint8Array | null>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// Every call to an issuer, and nothing else. It matches cello-issuer's src/server/trust/agent-request.ts and its api/issuer routes.
|
|
2
|
+
// The request's format and framing are copied from there by script: its signing label isn't in the protocol's list.
|
|
3
|
+
import { ed25519 } from "@noble/curves/ed25519.js";
|
|
4
|
+
import { encodeCbor } from "../protocol/cbor.js";
|
|
5
|
+
import { mlDsaProviderFromSeed } from "../protocol/ml-dsa.js";
|
|
6
|
+
export const AGENT_REQUEST_DOMAIN = "cello-issuer-request-v1";
|
|
7
|
+
export const AGENT_REQUEST_CONTEXT = "cello-issuer-request";
|
|
8
|
+
export const MAX_REQUEST_LIFETIME_SECONDS = 300;
|
|
9
|
+
const NONCE_BYTES = 16;
|
|
10
|
+
export function encodeAgentRequest(f) {
|
|
11
|
+
return new Uint8Array(encodeCbor([
|
|
12
|
+
AGENT_REQUEST_DOMAIN, f.action, f.issuerAddress, f.agent.ed, f.agent.pq, f.nonce, f.issuedAt, f.expiresAt,
|
|
13
|
+
f.code, f.target, f.holder ? new Uint8Array([...f.holder.ed, ...f.holder.pq]) : null, f.holderSignal,
|
|
14
|
+
]));
|
|
15
|
+
}
|
|
16
|
+
export function framedAgentRequest(bytes) {
|
|
17
|
+
const label = new TextEncoder().encode(AGENT_REQUEST_CONTEXT);
|
|
18
|
+
const framed = new Uint8Array(label.length + 1 + bytes.length);
|
|
19
|
+
framed.set(label, 0);
|
|
20
|
+
framed.set(bytes, label.length + 1);
|
|
21
|
+
return framed;
|
|
22
|
+
}
|
|
23
|
+
const b64 = (v) => Buffer.from(v).toString("base64");
|
|
24
|
+
export function agentRequestToWire(bytes, signature, holderSignature) {
|
|
25
|
+
return {
|
|
26
|
+
request: b64(bytes),
|
|
27
|
+
signature: { ed: b64(signature.ed), pq: b64(signature.pq) },
|
|
28
|
+
...(holderSignature ? { holderSignature: { ed: b64(holderSignature.ed), pq: b64(holderSignature.pq) } } : {}),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
// Long enough for the issuer's own call to the waitlist, and short enough that a person isn't left waiting on nothing.
|
|
32
|
+
const ISSUER_WAIT_MS = 30_000;
|
|
33
|
+
// A newer list is optional, so a slow issuer costs a person only this long.
|
|
34
|
+
const LIST_WAIT_MS = 5_000;
|
|
35
|
+
const MAX_ANSWER_BYTES = 8_000_000;
|
|
36
|
+
const REQUEST_LIFETIME_SECONDS = 120;
|
|
37
|
+
const LOOPBACK = new Set(["127.0.0.1", "localhost", "[::1]"]);
|
|
38
|
+
// A plain refusal the issuer gave, with its reason and its own words.
|
|
39
|
+
export class IssuerRefused extends Error {
|
|
40
|
+
reason;
|
|
41
|
+
constructor(reason, guidance) {
|
|
42
|
+
super(guidance);
|
|
43
|
+
this.reason = reason;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Nobody answered, or what came back isn't an issuer's answer. What happened there isn't known.
|
|
47
|
+
export class IssuerUnreachable extends Error {
|
|
48
|
+
}
|
|
49
|
+
export class BadIssuerUrl extends Error {
|
|
50
|
+
}
|
|
51
|
+
// A code travels in this request, so plain HTTP is for a test on this machine only.
|
|
52
|
+
export function parseIssuerUrl(raw) {
|
|
53
|
+
let url;
|
|
54
|
+
try {
|
|
55
|
+
url = new URL(raw);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
throw new BadIssuerUrl(`${raw} isn't an address`);
|
|
59
|
+
}
|
|
60
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && LOOPBACK.has(url.hostname)))
|
|
61
|
+
throw new BadIssuerUrl(`an issuer's address must start with https://, and ${raw} doesn't`);
|
|
62
|
+
return url;
|
|
63
|
+
}
|
|
64
|
+
async function signRequest(seeds, bytes) {
|
|
65
|
+
const framed = framedAgentRequest(bytes);
|
|
66
|
+
const pq = await mlDsaProviderFromSeed(seeds.pq);
|
|
67
|
+
return { ed: ed25519.sign(framed, seeds.ed), pq: await pq.sign(framed) };
|
|
68
|
+
}
|
|
69
|
+
export class IssuerClient {
|
|
70
|
+
#base;
|
|
71
|
+
#fetch;
|
|
72
|
+
constructor(issuerUrl, fetcher = fetch) {
|
|
73
|
+
this.#base = parseIssuerUrl(issuerUrl);
|
|
74
|
+
this.#fetch = fetcher;
|
|
75
|
+
}
|
|
76
|
+
// The name a request and a signal both carry for this issuer.
|
|
77
|
+
get address() {
|
|
78
|
+
return this.#base.hostname;
|
|
79
|
+
}
|
|
80
|
+
redeem(agent, code) {
|
|
81
|
+
return this.#send("redeem", "redeem", agent, { code, target: null, holder: null, holderSignal: null });
|
|
82
|
+
}
|
|
83
|
+
collect(agent) {
|
|
84
|
+
return this.#send("collect", "collect", agent, { code: null, target: null, holder: null, holderSignal: null });
|
|
85
|
+
}
|
|
86
|
+
// A new agent on a daemon that already has one: the holder signs too, and hands over an account-level signal it holds.
|
|
87
|
+
addAgent(agent, holder, holderSignal) {
|
|
88
|
+
return this.#send("agents", "add_agent", agent, { code: null, target: null, holder: holder.identity, holderSignal }, holder.seeds);
|
|
89
|
+
}
|
|
90
|
+
// Null when this issuer serves none. A list proves itself by its root signatures, so who hands it over doesn't matter.
|
|
91
|
+
async latestIssuerList() {
|
|
92
|
+
try {
|
|
93
|
+
const response = await this.#fetch(new URL("/api/issuer/list", this.#base), { redirect: "error", signal: AbortSignal.timeout(LIST_WAIT_MS) });
|
|
94
|
+
if (!response.ok)
|
|
95
|
+
return null;
|
|
96
|
+
const answer = JSON.parse(await response.text());
|
|
97
|
+
return typeof answer.list === "string" ? new Uint8Array(Buffer.from(answer.list, "base64")) : null;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async #send(route, action, agent, extra, holderSeeds) {
|
|
104
|
+
const issuedAt = Math.floor(Date.now() / 1000);
|
|
105
|
+
const bytes = encodeAgentRequest({
|
|
106
|
+
action,
|
|
107
|
+
issuerAddress: this.address,
|
|
108
|
+
agent: agent.identity,
|
|
109
|
+
nonce: crypto.getRandomValues(new Uint8Array(NONCE_BYTES)),
|
|
110
|
+
issuedAt,
|
|
111
|
+
expiresAt: issuedAt + REQUEST_LIFETIME_SECONDS,
|
|
112
|
+
...extra,
|
|
113
|
+
});
|
|
114
|
+
const wire = agentRequestToWire(bytes, await signRequest(agent.seeds, bytes), holderSeeds ? await signRequest(holderSeeds, bytes) : undefined);
|
|
115
|
+
let status;
|
|
116
|
+
let text;
|
|
117
|
+
try {
|
|
118
|
+
const response = await this.#fetch(new URL(`/api/issuer/${route}`, this.#base), { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(wire), redirect: "error", signal: AbortSignal.timeout(ISSUER_WAIT_MS) });
|
|
119
|
+
status = response.status;
|
|
120
|
+
text = await response.text();
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
throw new IssuerUnreachable(`nothing answered at ${this.#base.origin}: ${err instanceof Error ? err.message : String(err)}`);
|
|
124
|
+
}
|
|
125
|
+
if (text.length > MAX_ANSWER_BYTES)
|
|
126
|
+
throw new IssuerUnreachable(`the answer from ${this.#base.origin} is too large to be an issuer's`);
|
|
127
|
+
let answer;
|
|
128
|
+
try {
|
|
129
|
+
answer = JSON.parse(text);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
throw new IssuerUnreachable(`${this.#base.origin} answered with status ${status}, and not as an issuer would`);
|
|
133
|
+
}
|
|
134
|
+
if (answer.ok !== true) {
|
|
135
|
+
if (typeof answer.reason !== "string")
|
|
136
|
+
throw new IssuerUnreachable(`${this.#base.origin} answered with status ${status}, and not as an issuer would`);
|
|
137
|
+
throw new IssuerRefused(answer.reason, typeof answer.guidance === "string" ? answer.guidance : answer.reason);
|
|
138
|
+
}
|
|
139
|
+
if (!Array.isArray(answer.signals) || !answer.signals.every((s) => typeof s === "string"))
|
|
140
|
+
throw new IssuerUnreachable(`${this.#base.origin} answered without a list of signals`);
|
|
141
|
+
return { signals: answer.signals.map((s) => new Uint8Array(Buffer.from(s, "base64"))) };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type PublicIdentity } from "../protocol/identity.ts";
|
|
2
|
+
import { type ErrorCode, type PushFrame } from "../protocol/wire.ts";
|
|
3
|
+
export declare class ServerRefused extends Error {
|
|
4
|
+
readonly code: ErrorCode;
|
|
5
|
+
readonly tip: number | undefined;
|
|
6
|
+
constructor(code: ErrorCode, message: string, tip?: number);
|
|
7
|
+
}
|
|
8
|
+
export declare class ServerUnreachable extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export interface ConnectedServer {
|
|
12
|
+
identity: PublicIdentity;
|
|
13
|
+
id: Uint8Array;
|
|
14
|
+
nonce: Uint8Array;
|
|
15
|
+
}
|
|
16
|
+
export interface LinkEvents {
|
|
17
|
+
checkIdentity(identity: PublicIdentity): string | null;
|
|
18
|
+
connected(server: ConnectedServer): Promise<void>;
|
|
19
|
+
disconnected(): void;
|
|
20
|
+
push(frame: PushFrame): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class ServerLink {
|
|
23
|
+
#private;
|
|
24
|
+
constructor(url: string, events: LinkEvents, name?: string);
|
|
25
|
+
get ready(): boolean;
|
|
26
|
+
get problem(): string | null;
|
|
27
|
+
start(): void;
|
|
28
|
+
stop(): void;
|
|
29
|
+
call(method: string, params: unknown, timeoutMs?: number): Promise<unknown>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
// One WebSocket from the daemon to its server. Daemons only dial out, so NAT never matters.
|
|
2
|
+
// It reconnects by itself, and everything sent over it can be repeated safely.
|
|
3
|
+
import { randomBytes } from "node:crypto";
|
|
4
|
+
import WebSocket from "ws";
|
|
5
|
+
import { toHex } from "../protocol/encode.js";
|
|
6
|
+
import { identityId, verifySignature } from "../protocol/identity.js";
|
|
7
|
+
import { serverAuthBytes } from "../protocol/structures.js";
|
|
8
|
+
import { MAX_FRAME_BYTES, PROTOCOL_VERSION, fromB64, identityCodec, signatureCodec, toB64 } from "../protocol/wire.js";
|
|
9
|
+
import { logEvent } from "./log.js";
|
|
10
|
+
const CALL_TIMEOUT_MS = 20_000;
|
|
11
|
+
const SERVER_SILENCE_MS = 45_000;
|
|
12
|
+
// Under the server's 15-second heartbeat.
|
|
13
|
+
const KEEP_ALIVE_MS = 10_000;
|
|
14
|
+
const MAX_BACKOFF_MS = 30_000;
|
|
15
|
+
export class ServerRefused extends Error {
|
|
16
|
+
code;
|
|
17
|
+
tip;
|
|
18
|
+
constructor(code, message, tip) {
|
|
19
|
+
super(message);
|
|
20
|
+
this.name = "ServerRefused";
|
|
21
|
+
this.code = code;
|
|
22
|
+
this.tip = tip;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// The server wasn't reached, or didn't answer in time. The caller doesn't know whether it took effect.
|
|
26
|
+
export class ServerUnreachable extends Error {
|
|
27
|
+
constructor(message) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.name = "ServerUnreachable";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export class ServerLink {
|
|
33
|
+
#url;
|
|
34
|
+
#events;
|
|
35
|
+
#socket;
|
|
36
|
+
#ready = false;
|
|
37
|
+
#stopped = false;
|
|
38
|
+
#nextId = 1;
|
|
39
|
+
#backoff = 1000;
|
|
40
|
+
#problem = null;
|
|
41
|
+
#silence;
|
|
42
|
+
#keepAlive;
|
|
43
|
+
#tcp;
|
|
44
|
+
#bytesHeard = 0;
|
|
45
|
+
#waiting = new Map();
|
|
46
|
+
// Names this link's log events, so a count of reconnects means one connection.
|
|
47
|
+
#name;
|
|
48
|
+
constructor(url, events, name = "server") {
|
|
49
|
+
this.#url = url;
|
|
50
|
+
this.#events = events;
|
|
51
|
+
this.#name = name;
|
|
52
|
+
}
|
|
53
|
+
get ready() {
|
|
54
|
+
return this.#ready;
|
|
55
|
+
}
|
|
56
|
+
get problem() {
|
|
57
|
+
return this.#problem;
|
|
58
|
+
}
|
|
59
|
+
start() {
|
|
60
|
+
this.#open();
|
|
61
|
+
}
|
|
62
|
+
stop() {
|
|
63
|
+
this.#stopped = true;
|
|
64
|
+
this.#socket?.close();
|
|
65
|
+
}
|
|
66
|
+
#open() {
|
|
67
|
+
if (this.#stopped)
|
|
68
|
+
return;
|
|
69
|
+
const socket = new WebSocket(this.#url, { maxPayload: MAX_FRAME_BYTES });
|
|
70
|
+
this.#socket = socket;
|
|
71
|
+
this.#tcp = undefined;
|
|
72
|
+
socket.on("upgrade", (response) => { this.#tcp = response.socket; });
|
|
73
|
+
socket.on("open", () => {
|
|
74
|
+
// The server's heartbeat needs to hear something from us, and its ping can sit behind queued long replies.
|
|
75
|
+
// This way a daemon that's busy reading those isn't taken for a dead one.
|
|
76
|
+
this.#keepAlive = setInterval(() => socket.ping(), KEEP_ALIVE_MS);
|
|
77
|
+
void this.#greet();
|
|
78
|
+
});
|
|
79
|
+
socket.on("message", (raw) => this.#receive(raw));
|
|
80
|
+
socket.on("ping", () => this.#heardServer());
|
|
81
|
+
socket.on("close", () => this.#closed());
|
|
82
|
+
socket.on("error", (err) => {
|
|
83
|
+
this.#problem = `can't reach the server: ${err.message}`;
|
|
84
|
+
logEvent(`${this.#name}.socket_error`, { message: err.message });
|
|
85
|
+
});
|
|
86
|
+
this.#heardServer();
|
|
87
|
+
}
|
|
88
|
+
// A silent drop shows as no pings. The server pings every 15 seconds.
|
|
89
|
+
// On a slow link a ping can queue behind one long message, so bytes still arriving count as hearing the server.
|
|
90
|
+
#heardServer() {
|
|
91
|
+
clearTimeout(this.#silence);
|
|
92
|
+
this.#bytesHeard = this.#tcp?.bytesRead ?? 0;
|
|
93
|
+
this.#silence = setTimeout(() => {
|
|
94
|
+
if ((this.#tcp?.bytesRead ?? 0) > this.#bytesHeard) {
|
|
95
|
+
this.#heardServer();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
logEvent(`${this.#name}.silent`);
|
|
99
|
+
this.#socket?.terminate();
|
|
100
|
+
}, SERVER_SILENCE_MS);
|
|
101
|
+
}
|
|
102
|
+
async #greet() {
|
|
103
|
+
try {
|
|
104
|
+
const clientNonce = new Uint8Array(randomBytes(32));
|
|
105
|
+
const hello = await this.#send("hello", { clientNonce: toB64(clientNonce) });
|
|
106
|
+
const identity = identityCodec.decode(hello.server, "server");
|
|
107
|
+
const serverNonce = fromB64(hello.serverNonce, "serverNonce");
|
|
108
|
+
const id = identityId(identity);
|
|
109
|
+
const proof = serverAuthBytes({ serverId: id, clientNonce, serverNonce });
|
|
110
|
+
if (!(await verifySignature(identity, "cello-server-auth", proof, signatureCodec.decode(hello.signature, "signature")))) {
|
|
111
|
+
throw new Error("the server's proof of identity didn't verify");
|
|
112
|
+
}
|
|
113
|
+
const refusal = this.#events.checkIdentity(identity);
|
|
114
|
+
if (refusal)
|
|
115
|
+
throw new Error(refusal);
|
|
116
|
+
this.#ready = true;
|
|
117
|
+
this.#problem = null;
|
|
118
|
+
this.#backoff = 1000;
|
|
119
|
+
logEvent(`${this.#name}.connected`, { server: toHex(id) });
|
|
120
|
+
await this.#events.connected({ identity, id, nonce: serverNonce });
|
|
121
|
+
}
|
|
122
|
+
catch (err) {
|
|
123
|
+
this.#problem = err instanceof Error ? err.message : String(err);
|
|
124
|
+
logEvent(`${this.#name}.greeting_failed`, { message: this.#problem });
|
|
125
|
+
this.#socket?.close();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
#closed() {
|
|
129
|
+
clearTimeout(this.#silence);
|
|
130
|
+
clearInterval(this.#keepAlive);
|
|
131
|
+
const wasReady = this.#ready;
|
|
132
|
+
this.#ready = false;
|
|
133
|
+
for (const [id, waiter] of this.#waiting) {
|
|
134
|
+
clearTimeout(waiter.timer);
|
|
135
|
+
waiter.reject(new ServerUnreachable("the connection to the server dropped"));
|
|
136
|
+
this.#waiting.delete(id);
|
|
137
|
+
}
|
|
138
|
+
if (wasReady) {
|
|
139
|
+
this.#problem = "the connection to the server dropped";
|
|
140
|
+
this.#events.disconnected();
|
|
141
|
+
}
|
|
142
|
+
if (this.#stopped)
|
|
143
|
+
return;
|
|
144
|
+
const delay = this.#backoff * (0.5 + Math.random() / 2);
|
|
145
|
+
this.#backoff = Math.min(this.#backoff * 2, MAX_BACKOFF_MS);
|
|
146
|
+
setTimeout(() => this.#open(), delay);
|
|
147
|
+
}
|
|
148
|
+
#receive(raw) {
|
|
149
|
+
this.#heardServer();
|
|
150
|
+
let frame;
|
|
151
|
+
try {
|
|
152
|
+
frame = JSON.parse(raw.toString());
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
logEvent("server.bad_frame");
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if ("push" in frame) {
|
|
159
|
+
this.#events.push(frame);
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const waiter = this.#waiting.get(frame.id);
|
|
163
|
+
if (!waiter)
|
|
164
|
+
return;
|
|
165
|
+
this.#waiting.delete(frame.id);
|
|
166
|
+
clearTimeout(waiter.timer);
|
|
167
|
+
if (frame.ok)
|
|
168
|
+
waiter.resolve(frame.result);
|
|
169
|
+
else
|
|
170
|
+
waiter.reject(new ServerRefused(frame.error.code, frame.error.message, frame.error.tip));
|
|
171
|
+
}
|
|
172
|
+
#send(method, params, timeoutMs = CALL_TIMEOUT_MS) {
|
|
173
|
+
const socket = this.#socket;
|
|
174
|
+
if (!socket || socket.readyState !== socket.OPEN)
|
|
175
|
+
return Promise.reject(new ServerUnreachable("not connected to the server"));
|
|
176
|
+
const id = this.#nextId++;
|
|
177
|
+
return new Promise((resolve, reject) => {
|
|
178
|
+
const timer = setTimeout(() => {
|
|
179
|
+
this.#waiting.delete(id);
|
|
180
|
+
reject(new ServerUnreachable(`the server didn't answer ${method} in time`));
|
|
181
|
+
}, timeoutMs);
|
|
182
|
+
this.#waiting.set(id, { resolve, reject, timer });
|
|
183
|
+
socket.send(JSON.stringify({ v: PROTOCOL_VERSION, id, method, params }));
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
call(method, params, timeoutMs) {
|
|
187
|
+
if (!this.#ready)
|
|
188
|
+
return Promise.reject(new ServerUnreachable(this.#problem ?? "not connected to the server"));
|
|
189
|
+
return this.#send(method, params, timeoutMs);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function logEvent(event: string, fields?: Record<string, unknown>): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|