@agent-custody/receipts 0.16.11 → 0.16.13
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 +23 -5
- package/dist/admission.d.ts +62 -0
- package/dist/admission.js +101 -0
- package/dist/check.js +42 -3
- package/dist/cli.js +179 -7
- package/dist/config.d.ts +6 -1
- package/dist/config.js +21 -2
- package/dist/door-app.js +1 -1
- package/dist/door-core.d.ts +81 -3
- package/dist/door-core.js +113 -13
- package/dist/door-error-rates.d.ts +102 -0
- package/dist/door-error-rates.js +178 -0
- package/dist/door-form.d.ts +7 -2
- package/dist/door-form.js +52 -4
- package/dist/door-measure.d.ts +153 -0
- package/dist/door-measure.js +325 -0
- package/dist/door-signals.d.ts +414 -0
- package/dist/door-signals.js +555 -0
- package/dist/door-test-set.d.ts +43 -0
- package/dist/door-test-set.js +117 -0
- package/dist/door-worker.d.ts +20 -1
- package/dist/door-worker.js +30 -2
- package/dist/door.js +18 -2
- package/dist/erc8004-link.d.ts +24 -0
- package/dist/erc8004-link.js +11 -0
- package/dist/erc8004.d.ts +26 -0
- package/dist/erc8004.js +208 -0
- package/dist/index.d.ts +17 -3
- package/dist/index.js +9 -2
- package/dist/lock.d.ts +5 -0
- package/dist/lock.js +1 -1
- package/dist/log-store.d.ts +3 -1
- package/dist/log-store.js +2 -2
- package/dist/passport.d.ts +53 -0
- package/dist/passport.js +87 -0
- package/dist/portal.d.ts +14 -0
- package/dist/portal.js +102 -0
- package/dist/registry.d.ts +145 -0
- package/dist/registry.js +294 -0
- package/dist/web-bot-auth.d.ts +9 -3
- package/dist/web-bot-auth.js +31 -4
- package/docs/admission-lists.md +89 -0
- package/docs/agent-registry.md +173 -0
- package/docs/door-error-rates.md +490 -0
- package/docs/door-languages.md +3 -1
- package/docs/door-middleware.md +6 -1
- package/docs/door-quickstart.md +2 -2
- package/docs/door-signals.md +112 -2
- package/docs/door-worker.md +14 -1
- package/docs/door.md +37 -6
- package/docs/github-action.md +2 -2
- package/docs/tutorials.md +7 -0
- package/docs/usage.md +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -6,8 +6,8 @@ export { hecEvent, splunkExporter } from "./splunk.js";
|
|
|
6
6
|
export { serveConsole } from "./console.js";
|
|
7
7
|
export { checkConfig, formatFindings } from "./check.js";
|
|
8
8
|
export { GRANT_HEADER, grantHeader, parseGrantHeader, serveHttp } from "./gateway-http.js";
|
|
9
|
-
export { AGENT_HEADER, ARRIVAL_FACT, CLASS_HEADER, DOOR_DEFAULT_CAPTURE, DOOR_VERSION, MAX_CHALLENGE_TOKEN, RECEIPT_HEADER, RATE_BURST_MS, RATE_MINUTE_MS, cedarArgs, classifyArrival, createDoorHost, createRateTracker, matchRoute, normalizePath, remoteOf, serveDoor, signedRequestOf, verifyChallengeToken } from "./door.js";
|
|
10
|
-
export { DIRECTORY_MEDIA_TYPE, DIRECTORY_PATH, WEB_BOT_AUTH_TAG, agentOrigin, createMemoryNonceStore, createWebBotAuthVerifier, jwkThumbprint, normalizeAuthority, parseDictionary, signatureBase } from "./web-bot-auth.js";
|
|
9
|
+
export { AGENT_HEADER, ARRIVAL_FACT, CLASS_HEADER, DOOR_DEFAULT_CAPTURE, DOOR_VERSION, MAX_CHALLENGE_TOKEN, RECEIPT_HEADER, RATE_BURST_MS, RATE_MINUTE_MS, PASSPORT_COVERED, cedarArgs, classifyArrival, createDoorHost, createRateTracker, matchRoute, normalizePath, remoteOf, serveDoor, signedRequestOf, verifyChallengeToken } from "./door.js";
|
|
10
|
+
export { DIRECTORY_MEDIA_TYPE, DIRECTORY_PATH, WEB_BOT_AUTH_TAG, agentOrigin, contentDigestMatches, createMemoryNonceStore, createWebBotAuthVerifier, jwkThumbprint, normalizeAuthority, parseDictionary, signatureBase } from "./web-bot-auth.js";
|
|
11
11
|
export { DESTINATION_FACT, EGRESS_VERSION, PROXY_REALM, checkProxyCredential, createEgressHost, destinationName, normalizeHost, parseAuthority, publicOnlyLookup, serveEgress } from "./egress.js";
|
|
12
12
|
export { internalAddress } from "./addresses.js";
|
|
13
13
|
export { DRAFT_WARNING, draftEgressPolicy } from "./egress-draft.js";
|
|
@@ -15,6 +15,10 @@ export { ACS_ERROR, ACS_GUARDIAN_VERSION, ACS_METHODS, ACS_RECEIPT_KEY, ACS_STEP
|
|
|
15
15
|
export { formatPerathosReport, PERATHOS_RECEIPT_V1, perathosHead, perathosReceiptHash, verifyPerathosLog } from "./perathos.js";
|
|
16
16
|
export { loadAcsGuardianConfig } from "./config.js";
|
|
17
17
|
export { FORM_SCRIPT_PATH, formScript } from "./door-form.js";
|
|
18
|
+
export { FLAG_SIGNALS, FORM_REPORT_HEADER, createHistoryTracker, flagOf, observationOf, signalsOf } from "./door-signals.js";
|
|
19
|
+
export { LABELS, LABEL_QUESTIONS, LABEL_USES, createMeasure, flagValues, formatMeasure, formatRate, intervalText, isName, labelsFromReceipts, measure, parseLabelledRecord, percent, rateOf, ratePercent, thresholds } from "./door-measure.js";
|
|
20
|
+
export { challengeLabels, DOOR_QUESTIONS, DoorLabelSchema, doorErrorRates, formatErrorRates, LABEL_SOURCES, parseLabels, readDoorArrivals, wilson } from "./door-error-rates.js";
|
|
21
|
+
export { buildDoorTestSet, DOOR_TEST_KINDS, formatTestKinds } from "./door-test-set.js";
|
|
18
22
|
export * from "./capture.js";
|
|
19
23
|
export { A2A_CARD_PATH, A2A_RECEIPT_METADATA_KEY, A2A_STREAM_META_KEY, a2aUpstream, fetchAgentCard, serveA2a, textOf } from "./a2a.js";
|
|
20
24
|
export { deliverMail, founderNote, PortalStore, portalHandler, readSession, readSessionVia, sendFollowUps, servePortal, signSession, SsoRefusedError, stripeRequest, verifyStripeSignature } from "./portal.js";
|
|
@@ -35,6 +39,9 @@ export * from "./operations.js";
|
|
|
35
39
|
export * from "./crypto.js";
|
|
36
40
|
export * from "./delegation.js";
|
|
37
41
|
export { base58btcDecode, base58btcEncode, DID_KEY_PREFIX, didKeyOf, publicKeyFromDidKey } from "./did-key.js";
|
|
42
|
+
export { DEFAULT_PASSPORT_SECONDS, MAX_PASSPORT_HEADER, MAX_PASSPORT_SECONDS, PASSPORT_HEADER, PASSPORT_TYPE, PassportSchema, REGISTRY_DOCUMENT_PATH, issuePassport, parsePassportHeader, passportDigest, passportHeader, registrationMessage, registrationProof, verifyPassport } from "./registry.js";
|
|
43
|
+
export { AdmissionListsSchema, canonicalAgent, canonicalRegistry, compileAdmissionLists, LIST_NAME, MAX_LIST_ENTRIES, MAX_LISTS } from "./admission.js";
|
|
44
|
+
export { createErc8004Resolver, decodeAbiString, ERC8004_REGISTRATION_TYPE, ERC8004_REGISTRY, Erc8004LinkSchema } from "./erc8004.js";
|
|
38
45
|
export * from "./approval.js";
|
|
39
46
|
export * from "./approval-requests.js";
|
|
40
47
|
export * from "./gateway.js";
|
package/dist/lock.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/** Moves the lock away only if it is still the file that was judged stale. One breaker at a time holds `<lock>.break`. */
|
|
2
|
+
export declare function breakLock(lockFile: string, judged: {
|
|
3
|
+
token: string | undefined;
|
|
4
|
+
ino: number;
|
|
5
|
+
}): void;
|
|
1
6
|
/**
|
|
2
7
|
* Takes the lock with an exclusive create, and returns its release. The release removes the file only when it still
|
|
3
8
|
* holds this call's token, so a holder whose lock was broken never removes the lock of the next holder. Returns
|
package/dist/lock.js
CHANGED
|
@@ -38,7 +38,7 @@ function judge(lockFile, staleMs) {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
/** Moves the lock away only if it is still the file that was judged stale. One breaker at a time holds `<lock>.break`. */
|
|
41
|
-
function breakLock(lockFile, judged) {
|
|
41
|
+
export function breakLock(lockFile, judged) {
|
|
42
42
|
const breaker = `${lockFile}.break`;
|
|
43
43
|
try {
|
|
44
44
|
closeSync(openSync(breaker, "wx", 0o600));
|
package/dist/log-store.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface PostgresLogOptions {
|
|
|
33
33
|
/** table name prefix; default "log_", giving log_leaves, log_tenants, log_tokens */
|
|
34
34
|
prefix?: string;
|
|
35
35
|
}
|
|
36
|
+
/** Runs `fn` inside one transaction on one connection, whichever kind of client this is. */
|
|
37
|
+
export declare function transaction<T>(client: PostgresLike, fn: (q: PostgresLike["query"]) => Promise<T>): Promise<T>;
|
|
36
38
|
/** One tenant's log in Postgres. Leaves are hashes only; the table never holds a receipt. */
|
|
37
39
|
export declare class PostgresLog implements LogBackend {
|
|
38
40
|
readonly tenant: string;
|
|
@@ -85,7 +87,7 @@ export interface TokenRecord {
|
|
|
85
87
|
/** the last append with this token, to within a minute; null when never used since the column came */
|
|
86
88
|
lastUsedAt: string | null;
|
|
87
89
|
}
|
|
88
|
-
export declare const AUDIT_ACTIONS: readonly ["tenant.add", "tenant.disable", "tenant.plan", "token.add", "token.revoke", "policy.add", "policy.remove", "sso.set", "sso.remove", "user.mfa-reset"];
|
|
90
|
+
export declare const AUDIT_ACTIONS: readonly ["tenant.add", "tenant.disable", "tenant.plan", "token.add", "token.revoke", "policy.add", "policy.remove", "sso.set", "sso.remove", "user.mfa-reset", "agent.register", "agent.update", "agent.revoke"];
|
|
89
91
|
/** One administrative action: who did what to which tenant, when. Written by every mutation and never deleted. */
|
|
90
92
|
export interface AuditEntry {
|
|
91
93
|
id: number;
|
package/dist/log-store.js
CHANGED
|
@@ -48,7 +48,7 @@ function queued(client, fn) {
|
|
|
48
48
|
return next;
|
|
49
49
|
}
|
|
50
50
|
/** Runs `fn` inside one transaction on one connection, whichever kind of client this is. */
|
|
51
|
-
async function transaction(client, fn) {
|
|
51
|
+
export async function transaction(client, fn) {
|
|
52
52
|
if (!client.connect)
|
|
53
53
|
return queued(client, () => singleConnectionTransaction(client, fn));
|
|
54
54
|
{
|
|
@@ -174,7 +174,7 @@ export class PostgresLog {
|
|
|
174
174
|
export const PLANS = ["free", "team", "enterprise"];
|
|
175
175
|
export const PLAN_QUOTAS = { free: 10_000, team: 1_000_000, enterprise: null };
|
|
176
176
|
const sha256hex = (s) => createHash("sha256").update(s).digest("hex");
|
|
177
|
-
export const AUDIT_ACTIONS = ["tenant.add", "tenant.disable", "tenant.plan", "token.add", "token.revoke", "policy.add", "policy.remove", "sso.set", "sso.remove", "user.mfa-reset"];
|
|
177
|
+
export const AUDIT_ACTIONS = ["tenant.add", "tenant.disable", "tenant.plan", "token.add", "token.revoke", "policy.add", "policy.remove", "sso.set", "sso.remove", "user.mfa-reset", "agent.register", "agent.update", "agent.revoke"];
|
|
178
178
|
/** Tenants and their tokens, in Postgres. Tokens are stored hashed; a lookup hashes what the caller presented. */
|
|
179
179
|
export class PostgresTenancy {
|
|
180
180
|
client;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type Envelope, type PublicKeyRef } from "./crypto.ts";
|
|
3
|
+
export declare const PASSPORT_TYPE = "application/vnd.agent-custody.passport+json";
|
|
4
|
+
/** the header an agent presents its passport in: the DSSE envelope as base64url JSON */
|
|
5
|
+
export declare const PASSPORT_HEADER = "x-agent-custody-passport";
|
|
6
|
+
/** where a registry publishes its keys and how it issues passports */
|
|
7
|
+
export declare const REGISTRY_DOCUMENT_PATH = "/.well-known/agent-custody-registry.json";
|
|
8
|
+
/** a passport header longer than this is not read */
|
|
9
|
+
export declare const MAX_PASSPORT_HEADER = 8192;
|
|
10
|
+
/** how long a passport lives unless the registry is configured otherwise */
|
|
11
|
+
export declare const DEFAULT_PASSPORT_SECONDS = 86400;
|
|
12
|
+
export declare const MAX_PASSPORT_SECONDS: number;
|
|
13
|
+
export declare const AGENT_ID: RegExp;
|
|
14
|
+
export declare const CAPABILITY: RegExp;
|
|
15
|
+
export declare const DID_KEY: RegExp;
|
|
16
|
+
export declare const text: (max: number) => z.ZodString;
|
|
17
|
+
export declare const PassportSchema: z.ZodObject<{
|
|
18
|
+
version: z.ZodLiteral<"0.1">;
|
|
19
|
+
registry: z.ZodString;
|
|
20
|
+
agentId: z.ZodString;
|
|
21
|
+
agent: z.ZodString;
|
|
22
|
+
name: z.ZodString;
|
|
23
|
+
owner: z.ZodString;
|
|
24
|
+
contact: z.ZodString;
|
|
25
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
26
|
+
erc8004: z.ZodOptional<z.ZodObject<{
|
|
27
|
+
agentRegistry: z.ZodString;
|
|
28
|
+
agentId: z.ZodString;
|
|
29
|
+
owner: z.ZodString;
|
|
30
|
+
block: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
issuedAt: z.ZodISODateTime;
|
|
33
|
+
expiresAt: z.ZodISODateTime;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export type Passport = z.infer<typeof PassportSchema>;
|
|
36
|
+
export type PassportVerifyResult = {
|
|
37
|
+
ok: true;
|
|
38
|
+
passport: Passport;
|
|
39
|
+
keyid: string;
|
|
40
|
+
digest: string;
|
|
41
|
+
} | {
|
|
42
|
+
ok: false;
|
|
43
|
+
error: string;
|
|
44
|
+
};
|
|
45
|
+
/** What a passport names by: sha256 over the payload its signature covers. */
|
|
46
|
+
export declare const passportDigest: (env: Envelope) => string;
|
|
47
|
+
/** Checks a passport: signed by one of the registry keys, well formed, naming a did:key that decodes, and valid at `at`. */
|
|
48
|
+
export declare function verifyPassport(env: Envelope, registryKeys: PublicKeyRef[], at: string): PassportVerifyResult;
|
|
49
|
+
/** A passport signed by one of the registry keys, well formed, naming a did:key that decodes, whatever its window. */
|
|
50
|
+
export declare function passportSignedBy(env: Envelope, registryKeys: PublicKeyRef[]): PassportVerifyResult;
|
|
51
|
+
export declare function passportHeader(env: Envelope): string;
|
|
52
|
+
/** The passport an arrival presented, unverified; null when there is none or it is not an envelope. */
|
|
53
|
+
export declare function parsePassportHeader(headers: Record<string, string | string[] | undefined>): Envelope | null;
|
package/dist/passport.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// The passport an agent registry signs, and its check: what a door needs of the registry, with nothing that keeps or
|
|
2
|
+
// stores agents, so that a door, the Worker's included, imports no database or file code.
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { dsseVerify, sha256Hex } from "./crypto.js";
|
|
5
|
+
import { publicKeyFromDidKey } from "./did-key.js";
|
|
6
|
+
import { ERC8004_REGISTRY } from "./erc8004-link.js";
|
|
7
|
+
export const PASSPORT_TYPE = "application/vnd.agent-custody.passport+json";
|
|
8
|
+
/** the header an agent presents its passport in: the DSSE envelope as base64url JSON */
|
|
9
|
+
export const PASSPORT_HEADER = "x-agent-custody-passport";
|
|
10
|
+
/** where a registry publishes its keys and how it issues passports */
|
|
11
|
+
export const REGISTRY_DOCUMENT_PATH = "/.well-known/agent-custody-registry.json";
|
|
12
|
+
/** a passport header longer than this is not read */
|
|
13
|
+
export const MAX_PASSPORT_HEADER = 8192;
|
|
14
|
+
/** how long a passport lives unless the registry is configured otherwise */
|
|
15
|
+
export const DEFAULT_PASSPORT_SECONDS = 86_400;
|
|
16
|
+
export const MAX_PASSPORT_SECONDS = 7 * 86_400;
|
|
17
|
+
export const AGENT_ID = /^agt_[0-9a-f]{16}$/;
|
|
18
|
+
export const CAPABILITY = /^[a-z0-9][a-z0-9._:-]{0,63}$/;
|
|
19
|
+
export const DID_KEY = /^did:key:z[1-9A-HJ-NP-Za-km-z]{40,60}$/;
|
|
20
|
+
export const text = (max) => z.string().trim().min(1).max(max).refine((s) => !/[\u0000-\u001f\u007f]/.test(s), { message: "control characters are not allowed" });
|
|
21
|
+
export const PassportSchema = z.object({
|
|
22
|
+
version: z.literal("0.1"),
|
|
23
|
+
/** the registry that issued it: its public URL */
|
|
24
|
+
registry: z.string().url().max(200),
|
|
25
|
+
agentId: z.string().regex(AGENT_ID),
|
|
26
|
+
/** the agent's key; a door admits the passport only on a request this key signed */
|
|
27
|
+
agent: z.string().regex(DID_KEY),
|
|
28
|
+
name: text(100),
|
|
29
|
+
/** the portal tenant that registered the agent */
|
|
30
|
+
owner: text(64),
|
|
31
|
+
/** how a site reaches the agent's operator */
|
|
32
|
+
contact: text(200),
|
|
33
|
+
capabilities: z.array(z.string().regex(CAPABILITY)).max(32),
|
|
34
|
+
/** the agent's ERC-8004 identity, as the registry last checked it against the chain; absent when it has none or the check is stale */
|
|
35
|
+
erc8004: z.object({ agentRegistry: z.string().regex(ERC8004_REGISTRY), agentId: z.string().regex(/^[0-9]{1,78}$/), owner: z.string().regex(/^0x[0-9a-f]{40}$/), block: z.number().int().nonnegative() }).optional(),
|
|
36
|
+
issuedAt: z.iso.datetime({ offset: true }),
|
|
37
|
+
expiresAt: z.iso.datetime({ offset: true }),
|
|
38
|
+
});
|
|
39
|
+
/** What a passport names by: sha256 over the payload its signature covers. */
|
|
40
|
+
export const passportDigest = (env) => sha256Hex(Buffer.from(env.payload, "base64"));
|
|
41
|
+
/** Checks a passport: signed by one of the registry keys, well formed, naming a did:key that decodes, and valid at `at`. */
|
|
42
|
+
export function verifyPassport(env, registryKeys, at) {
|
|
43
|
+
const r = passportSignedBy(env, registryKeys);
|
|
44
|
+
if (!r.ok)
|
|
45
|
+
return r;
|
|
46
|
+
const t = Date.parse(at);
|
|
47
|
+
if (t < Date.parse(r.passport.issuedAt) || t > Date.parse(r.passport.expiresAt))
|
|
48
|
+
return { ok: false, error: `the passport is valid from ${r.passport.issuedAt} to ${r.passport.expiresAt}` };
|
|
49
|
+
return r;
|
|
50
|
+
}
|
|
51
|
+
/** A passport signed by one of the registry keys, well formed, naming a did:key that decodes, whatever its window. */
|
|
52
|
+
export function passportSignedBy(env, registryKeys) {
|
|
53
|
+
if (env.payloadType !== PASSPORT_TYPE)
|
|
54
|
+
return { ok: false, error: `the passport's payloadType is ${String(env.payloadType).slice(0, 80)}, not ${PASSPORT_TYPE}` };
|
|
55
|
+
if (registryKeys.length === 0)
|
|
56
|
+
return { ok: false, error: "the door trusts no registry key" };
|
|
57
|
+
const r = dsseVerify(env, registryKeys);
|
|
58
|
+
if (!r.ok)
|
|
59
|
+
return { ok: false, error: `the passport is not signed by a trusted registry key: ${r.error}` };
|
|
60
|
+
const parsed = PassportSchema.safeParse(r.payload);
|
|
61
|
+
if (!parsed.success)
|
|
62
|
+
return { ok: false, error: `the passport is not well formed: ${parsed.error.issues.map((i) => `${i.path.join(".")} ${i.message}`).join("; ")}` };
|
|
63
|
+
const p = parsed.data;
|
|
64
|
+
try {
|
|
65
|
+
publicKeyFromDidKey(p.agent);
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
return { ok: false, error: `the passport's agent key does not decode: ${e instanceof Error ? e.message : String(e)}` };
|
|
69
|
+
}
|
|
70
|
+
return { ok: true, passport: p, keyid: r.keyid, digest: passportDigest(env) };
|
|
71
|
+
}
|
|
72
|
+
export function passportHeader(env) {
|
|
73
|
+
return Buffer.from(JSON.stringify(env)).toString("base64url");
|
|
74
|
+
}
|
|
75
|
+
/** The passport an arrival presented, unverified; null when there is none or it is not an envelope. */
|
|
76
|
+
export function parsePassportHeader(headers) {
|
|
77
|
+
const raw = headers[PASSPORT_HEADER];
|
|
78
|
+
if (typeof raw !== "string" || !raw || raw.length > MAX_PASSPORT_HEADER)
|
|
79
|
+
return null;
|
|
80
|
+
try {
|
|
81
|
+
const parsed = JSON.parse(Buffer.from(raw, "base64url").toString("utf8"));
|
|
82
|
+
return parsed && typeof parsed === "object" && typeof parsed.payloadType === "string" && typeof parsed.payload === "string" && Array.isArray(parsed.signatures) ? parsed : null;
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
}
|
package/dist/portal.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type IncomingMessage, type ServerResponse } from "node:http";
|
|
2
2
|
import { type Plan, type PostgresLike, type PostgresTenancy } from "./log-store.ts";
|
|
3
|
+
import type { Erc8004Resolver } from "./erc8004.ts";
|
|
4
|
+
import type { Signer } from "./signer.ts";
|
|
3
5
|
import { type OidcConfig, type SamlConfig, type SsoIdentity } from "./sso.ts";
|
|
4
6
|
export interface StripeOptions {
|
|
5
7
|
secretKey: string;
|
|
@@ -55,6 +57,18 @@ export interface PortalOptions {
|
|
|
55
57
|
trustProxy?: boolean;
|
|
56
58
|
/** table prefix; default portal_ */
|
|
57
59
|
prefix?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The agent registry: organisations register their agents, and the portal signs their passports with `signer`, a key
|
|
62
|
+
* of its own (not the log's). Needs `portalUrl`, which names the registry in every passport. Off when absent.
|
|
63
|
+
*/
|
|
64
|
+
registry?: {
|
|
65
|
+
signer: Signer;
|
|
66
|
+
passportSeconds?: number;
|
|
67
|
+
/** links agents to ERC-8004 identities, checked against the chain; without it a link is refused */
|
|
68
|
+
erc8004?: Erc8004Resolver;
|
|
69
|
+
/** how old a link's last check may be for a passport to carry it; an older one is checked again first. Default 3600 */
|
|
70
|
+
erc8004RecheckSeconds?: number;
|
|
71
|
+
};
|
|
58
72
|
log?: (message: string) => void;
|
|
59
73
|
}
|
|
60
74
|
export interface PortalUser {
|
package/dist/portal.js
CHANGED
|
@@ -16,6 +16,7 @@ import { welcomeSheet } from "./log-admin.js";
|
|
|
16
16
|
import { clientAddress } from "./log-sink.js";
|
|
17
17
|
import { SITE_NAV, siteUrl } from "./site-links.js";
|
|
18
18
|
import { PLAN_QUOTAS, RateLimiter } from "./log-store.js";
|
|
19
|
+
import { agentStatus, freshErc8004, issuePassport, publicEntry, registryDocument, RegistryInputError, RegistryStore, DEFAULT_PASSPORT_SECONDS, MAX_PASSPORT_SECONDS, REGISTRY_DOCUMENT_PATH } from "./registry.js";
|
|
19
20
|
import { oidcAuthorizeUrl, oidcExchange, pkce, samlAuthorizeUrl, samlValidate } from "./sso.js";
|
|
20
21
|
/** A provider sign-in whose verified email belongs to a password account that never verified its address: refused, never linked (issue #103). */
|
|
21
22
|
export class UnverifiedAccountError extends Error {
|
|
@@ -828,6 +829,30 @@ export async function sendFollowUps(store, mail, o) {
|
|
|
828
829
|
}
|
|
829
830
|
export function portalHandler(o) {
|
|
830
831
|
const store = new PortalStore(o.client, o.prefix);
|
|
832
|
+
if (o.registry && !o.portalUrl)
|
|
833
|
+
throw new Error("the agent registry needs portalUrl: it names the registry in every passport");
|
|
834
|
+
const passportSeconds = o.registry?.passportSeconds ?? DEFAULT_PASSPORT_SECONDS;
|
|
835
|
+
if (!Number.isInteger(passportSeconds) || passportSeconds < 60 || passportSeconds > MAX_PASSPORT_SECONDS)
|
|
836
|
+
throw new Error(`a passport lives from 60 to ${MAX_PASSPORT_SECONDS} seconds; got ${passportSeconds}`);
|
|
837
|
+
const agents = o.registry ? new RegistryStore(o.client, (o.portalUrl ?? "http://localhost/").replace(/\/?$/, "/"), o.prefix) : null;
|
|
838
|
+
const recheckSeconds = o.registry?.erc8004RecheckSeconds ?? 3600;
|
|
839
|
+
if (!Number.isInteger(recheckSeconds) || recheckSeconds < 60 || recheckSeconds > 86_400)
|
|
840
|
+
throw new Error(`an ERC-8004 link is rechecked every 60 to 86400 seconds; got ${recheckSeconds}`);
|
|
841
|
+
const resolver = o.registry?.erc8004;
|
|
842
|
+
const checker = resolver ? (link, didKey) => resolver.check(link, didKey) : undefined;
|
|
843
|
+
// a stale link is checked again at most once a minute per agent, so anonymous passport requests cannot drive the chain
|
|
844
|
+
const lastRecheck = new Map();
|
|
845
|
+
const passportFor = async (entry) => {
|
|
846
|
+
let e = entry;
|
|
847
|
+
if (resolver && agents && e.erc8004 && !freshErc8004(e, recheckSeconds) && Date.now() - (lastRecheck.get(e.id) ?? 0) >= 60_000) {
|
|
848
|
+
lastRecheck.set(e.id, Date.now());
|
|
849
|
+
if (lastRecheck.size > 10_000)
|
|
850
|
+
lastRecheck.delete(lastRecheck.keys().next().value);
|
|
851
|
+
const checked = { agent: e.agent, link: { agentRegistry: e.erc8004.agentRegistry, agentId: e.erc8004.agentId } };
|
|
852
|
+
e = (await agents.recordErc8004(e.id, checked, await resolver.check(checked.link, checked.agent))) ?? e;
|
|
853
|
+
}
|
|
854
|
+
return issuePassport(o.registry.signer, portalBase, e, passportSeconds, Date.now(), freshErc8004(e, recheckSeconds));
|
|
855
|
+
};
|
|
831
856
|
const heads = postgresCheckpoints(o.client);
|
|
832
857
|
const log = o.log ?? ((m) => console.error(m));
|
|
833
858
|
const loginFailures = new RateLimiter({ perSecond: 1 / 30, burst: 8 });
|
|
@@ -836,6 +861,8 @@ export function portalHandler(o) {
|
|
|
836
861
|
const mfaFailures = new RateLimiter({ perSecond: 1 / 120, burst: 5 });
|
|
837
862
|
const resetsByClient = new RateLimiter({ perSecond: 1 / 600, burst: 5 });
|
|
838
863
|
const resetsByEmail = new RateLimiter({ perSecond: 1 / 900, burst: 3 });
|
|
864
|
+
// the registry's public reads need no session; per address, so one client cannot walk every entry at once
|
|
865
|
+
const registryReads = new RateLimiter({ perSecond: 1 / 2, burst: 120 });
|
|
839
866
|
const base = o.publicUrl.endsWith("/") ? o.publicUrl : `${o.publicUrl}/`;
|
|
840
867
|
const cookieName = "custody_session";
|
|
841
868
|
const sheet = (tenant, logId) => welcomeSheet({ tenant, logId, publicUrl: base, ...(o.checkpointsUrl ? { checkpointsUrl: o.checkpointsUrl } : {}), ...(o.keyid ? { keyid: o.keyid } : {}) });
|
|
@@ -955,6 +982,40 @@ export function portalHandler(o) {
|
|
|
955
982
|
res.writeHead(200, { "content-type": "image/svg+xml", "cache-control": "public, max-age=86400" });
|
|
956
983
|
return void res.end(FAVICON);
|
|
957
984
|
}
|
|
985
|
+
// ---- the agent registry's public side: its keys, each agent's entry, and passports, for anyone ----
|
|
986
|
+
if (o.registry && agents && req.method === "GET" && url.pathname === REGISTRY_DOCUMENT_PATH)
|
|
987
|
+
return json(200, await registryDocument(o.registry.signer, portalBase, passportSeconds, resolver?.chains ?? []));
|
|
988
|
+
const agentPath = /^\/registry\/agents\/([^/]+)(\/passport)?$/.exec(url.pathname);
|
|
989
|
+
if (o.registry && agents && req.method === "GET" && (url.pathname === "/registry/agents" || agentPath) && !registryReads.take(`registry:${addr}`)) {
|
|
990
|
+
return json(429, { error: "too many registry reads from this address; slow down" }, { "retry-after": "2" });
|
|
991
|
+
}
|
|
992
|
+
if (o.registry && agents && req.method === "GET" && url.pathname === "/registry/agents") {
|
|
993
|
+
const q = (k) => url.searchParams.get(k) ?? undefined;
|
|
994
|
+
const limit = q("limit");
|
|
995
|
+
if (limit !== undefined && !(/^[1-9][0-9]{0,2}$/.test(limit) && Number(limit) <= 100))
|
|
996
|
+
return json(400, { error: "limit is 1 to 100" });
|
|
997
|
+
try {
|
|
998
|
+
const page = await agents.search({ ...(q("capability") !== undefined ? { capability: q("capability") } : {}), ...(q("owner") !== undefined ? { owner: q("owner") } : {}), ...(q("after") !== undefined ? { after: q("after") } : {}), ...(limit !== undefined ? { limit: Number(limit) } : {}) });
|
|
999
|
+
// a search finds agents; it is not a directory of contacts, which each agent's own entry and passport carry
|
|
1000
|
+
return json(200, { registry: portalBase, agents: page.agents.map((e) => { const { contact: _contact, ...listed } = publicEntry(e); return listed; }), next: page.next });
|
|
1001
|
+
}
|
|
1002
|
+
catch (e) {
|
|
1003
|
+
if (e instanceof RegistryInputError)
|
|
1004
|
+
return json(400, { error: e.message });
|
|
1005
|
+
throw e;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
if (o.registry && agents && req.method === "GET" && agentPath) {
|
|
1009
|
+
const entry = await agents.get(agentPath[1]);
|
|
1010
|
+
if (!entry)
|
|
1011
|
+
return json(404, { error: "no agent with this id is registered" });
|
|
1012
|
+
if (!agentPath[2])
|
|
1013
|
+
return json(200, publicEntry(entry));
|
|
1014
|
+
const status = agentStatus(entry);
|
|
1015
|
+
if (status !== "active")
|
|
1016
|
+
return json(410, { error: `the agent is ${status}; the registry issues it no passport`, status });
|
|
1017
|
+
return json(200, await passportFor(entry));
|
|
1018
|
+
}
|
|
958
1019
|
if (req.method === "GET" && url.pathname === "/") {
|
|
959
1020
|
res.writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store", "x-frame-options": "DENY", "content-security-policy": "default-src 'none'; script-src 'unsafe-inline'; style-src 'unsafe-inline'; img-src 'self'; connect-src 'self'; form-action 'self'; base-uri 'none'" });
|
|
960
1021
|
const providers = JSON.stringify(["github", "google"].filter((p) => !!o.oauth?.[p]));
|
|
@@ -1596,6 +1657,44 @@ document.getElementById("f").onsubmit = async (e) => {
|
|
|
1596
1657
|
await jsonBody();
|
|
1597
1658
|
return json(200, { revoked: await o.tenancy.revokeToken(tenantId, revoke[1], `portal:${user.email}`) });
|
|
1598
1659
|
}
|
|
1660
|
+
// The tenant's agents in the registry. Writes need admin, like keys.
|
|
1661
|
+
const agentRoute = /^\/api\/agents(?:\/([^/]+)(\/revoke)?)?$/.exec(url.pathname);
|
|
1662
|
+
if (agentRoute) {
|
|
1663
|
+
if (!o.registry || !agents)
|
|
1664
|
+
return json(404, { error: "this portal runs no agent registry" });
|
|
1665
|
+
const [, id, revokeAgent] = agentRoute;
|
|
1666
|
+
const actor = `portal:${user.email}`;
|
|
1667
|
+
try {
|
|
1668
|
+
if (req.method === "GET" && !id)
|
|
1669
|
+
return json(200, { agents: (await agents.list(tenantId)).map((e) => publicEntry(e)) });
|
|
1670
|
+
if (req.method === "POST" && !id) {
|
|
1671
|
+
const entry = await agents.register(tenantId, await jsonBody(), Date.now(), checker);
|
|
1672
|
+
await o.tenancy.record(actor, "agent.register", tenantId, { agent: entry.id, key: entry.agent, capabilities: entry.capabilities, expiresAt: entry.expiresAt, ...(entry.erc8004 ? { erc8004: `${entry.erc8004.agentRegistry}:${entry.erc8004.agentId}` } : {}) });
|
|
1673
|
+
return json(200, { agent: publicEntry(entry), passport: await passportFor(entry) });
|
|
1674
|
+
}
|
|
1675
|
+
if (req.method === "POST" && id && revokeAgent) {
|
|
1676
|
+
await jsonBody();
|
|
1677
|
+
const revoked = await agents.revoke(tenantId, id);
|
|
1678
|
+
if (revoked)
|
|
1679
|
+
await o.tenancy.record(actor, "agent.revoke", tenantId, { agent: id });
|
|
1680
|
+
return json(revoked ? 200 : 404, revoked ? { revoked: true } : { error: "no active agent with this id belongs to this tenant" });
|
|
1681
|
+
}
|
|
1682
|
+
if (req.method === "POST" && id) {
|
|
1683
|
+
const b = await jsonBody();
|
|
1684
|
+
const entry = await agents.update(tenantId, id, b, Date.now(), checker);
|
|
1685
|
+
if (!entry)
|
|
1686
|
+
return json(404, { error: "no active agent with this id belongs to this tenant" });
|
|
1687
|
+
await o.tenancy.record(actor, "agent.update", tenantId, { agent: entry.id, changed: Object.keys(b).sort(), key: entry.agent, capabilities: entry.capabilities, expiresAt: entry.expiresAt, erc8004: entry.erc8004 ? `${entry.erc8004.agentRegistry}:${entry.erc8004.agentId}` : null });
|
|
1688
|
+
return json(200, { agent: publicEntry(entry), ...(agentStatus(entry) === "active" ? { passport: await passportFor(entry) } : {}) });
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
catch (e) {
|
|
1692
|
+
if (e instanceof RegistryInputError)
|
|
1693
|
+
return json(400, { error: e.message });
|
|
1694
|
+
throw e;
|
|
1695
|
+
}
|
|
1696
|
+
return json(404, { error: "not found" });
|
|
1697
|
+
}
|
|
1599
1698
|
// Policies: named versions the tenant publishes so a receipt's policyDigest reads as a name. The gateway never
|
|
1600
1699
|
// reads these; enforcement stays on the tenant's machines.
|
|
1601
1700
|
if (req.method === "GET" && url.pathname === "/api/policies") {
|
|
@@ -2134,6 +2233,9 @@ ${DESIGN_CSS}
|
|
|
2134
2233
|
"sso.set": (d) => "set up single sign-on" + (d.protocol ? " (" + String(d.protocol).toUpperCase() + ")" : ""),
|
|
2135
2234
|
"sso.remove": () => "removed single sign-on",
|
|
2136
2235
|
"user.mfa-reset": (d) => "turned off two-step sign-in for " + (d.email || "a member"),
|
|
2236
|
+
"agent.register": (d) => "registered the agent " + d.agent + " in the agent registry",
|
|
2237
|
+
"agent.update": (d) => "changed the agent " + d.agent + (Array.isArray(d.changed) && d.changed.length ? " (" + d.changed.join(", ") + ")" : ""),
|
|
2238
|
+
"agent.revoke": (d) => "revoked the agent " + d.agent + "; the registry issues it no more passports",
|
|
2137
2239
|
};
|
|
2138
2240
|
const sentence = (e) => { const d = e.detail || {}; return actor(e.actor) + " " + (Object.hasOwn(SENTENCES, e.action) ? SENTENCES[e.action](d) : "did '" + e.action + "'" + (Object.keys(d).length ? " (" + Object.entries(d).map(([k, v]) => k + ": " + v).join(", ") + ")" : "")) + "."; };
|
|
2139
2241
|
const feed = (entries) => entries.map((e) => "<li><span title=\\"" + esc(e.action + " " + JSON.stringify(e.detail || {})) + "\\">" + esc(sentence(e)) + "</span>" + when(e.at) + "</li>").join("");
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { Envelope, KeyPair } from "./crypto.ts";
|
|
3
|
+
import { type PostgresLike } from "./log-store.ts";
|
|
4
|
+
import type { Signer } from "./signer.ts";
|
|
5
|
+
import { type Erc8004Check, type Erc8004Checked, type Erc8004Link } from "./erc8004-link.ts";
|
|
6
|
+
export * from "./passport.ts";
|
|
7
|
+
/** the furthest ahead an agent's registration may expire */
|
|
8
|
+
export declare const MAX_REGISTRATION_DAYS = 366;
|
|
9
|
+
export declare const MAX_AGENTS_PER_OWNER = 100;
|
|
10
|
+
/**
|
|
11
|
+
* What an agent's key signs to show that whoever registers it holds it: the registry, the owner, and the key. Without
|
|
12
|
+
* it, a tenant could register a did:key it saw in a grant or a signature, and choose that agent's capabilities.
|
|
13
|
+
*/
|
|
14
|
+
export declare function registrationMessage(registryUrl: string, owner: string, didKey: string): Buffer;
|
|
15
|
+
/** The proof a registration carries: the agent's key's Ed25519 signature over `registrationMessage`, base64url. */
|
|
16
|
+
export declare function registrationProof(agentKey: KeyPair, registryUrl: string, owner: string): {
|
|
17
|
+
agent: string;
|
|
18
|
+
proof: string;
|
|
19
|
+
};
|
|
20
|
+
/** One registered agent, as the registry keeps it. */
|
|
21
|
+
export interface AgentEntry {
|
|
22
|
+
id: string;
|
|
23
|
+
owner: string;
|
|
24
|
+
name: string;
|
|
25
|
+
contact: string;
|
|
26
|
+
capabilities: string[];
|
|
27
|
+
/** the agent's current key */
|
|
28
|
+
agent: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
expiresAt: string;
|
|
31
|
+
revokedAt: string | null;
|
|
32
|
+
/** the linked ERC-8004 identity as last checked, with the error of the last check when it failed */
|
|
33
|
+
erc8004?: (Erc8004Checked & {
|
|
34
|
+
error?: string;
|
|
35
|
+
errorAt?: string;
|
|
36
|
+
}) | null;
|
|
37
|
+
}
|
|
38
|
+
/** The ERC-8004 link a passport may carry: one whose last check succeeded within `recheckSeconds`. */
|
|
39
|
+
export declare function freshErc8004(e: AgentEntry, recheckSeconds: number, now?: number): Erc8004Checked | null;
|
|
40
|
+
export type AgentStatus = "active" | "revoked" | "expired";
|
|
41
|
+
export declare const agentStatus: (e: AgentEntry, now?: number) => AgentStatus;
|
|
42
|
+
/** What the registry publishes about an agent: the entry, its status, and its key as a JWK. */
|
|
43
|
+
export declare function publicEntry(e: AgentEntry, now?: number): {
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
owner: string;
|
|
47
|
+
contact: string;
|
|
48
|
+
capabilities: string[];
|
|
49
|
+
agent: string;
|
|
50
|
+
keys: {
|
|
51
|
+
kty: string;
|
|
52
|
+
crv: string;
|
|
53
|
+
x: string;
|
|
54
|
+
kid: string;
|
|
55
|
+
exp: number;
|
|
56
|
+
}[];
|
|
57
|
+
createdAt: string;
|
|
58
|
+
expiresAt: string;
|
|
59
|
+
status: AgentStatus;
|
|
60
|
+
erc8004: (Erc8004Checked & {
|
|
61
|
+
error?: string;
|
|
62
|
+
errorAt?: string;
|
|
63
|
+
}) | null;
|
|
64
|
+
};
|
|
65
|
+
/** A request to register or change an agent, checked; throws a message fit for the caller. */
|
|
66
|
+
export declare const AgentInputSchema: z.ZodObject<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
contact: z.ZodString;
|
|
69
|
+
capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
agent: z.ZodString;
|
|
71
|
+
proof: z.ZodOptional<z.ZodString>;
|
|
72
|
+
expiresAt: z.ZodISODateTime;
|
|
73
|
+
erc8004: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
74
|
+
agentRegistry: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
75
|
+
agentId: z.ZodString;
|
|
76
|
+
}, z.core.$strip>>>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
export type AgentInput = z.infer<typeof AgentInputSchema>;
|
|
79
|
+
export declare class RegistryInputError extends Error {
|
|
80
|
+
}
|
|
81
|
+
/** Checks an ERC-8004 link against the chain for a did:key; absent when the registry reads no chain. */
|
|
82
|
+
export type Erc8004Checker = (link: Erc8004Link, didKey: string) => Promise<Erc8004Check>;
|
|
83
|
+
/** The registry's table, beside the portal's own. */
|
|
84
|
+
export declare class RegistryStore {
|
|
85
|
+
private readonly client;
|
|
86
|
+
private readonly t;
|
|
87
|
+
private ready;
|
|
88
|
+
private readonly registryUrl;
|
|
89
|
+
/** `registryUrl` is what a registration's proof names */
|
|
90
|
+
constructor(client: PostgresLike, registryUrl: string, prefix?: string);
|
|
91
|
+
private init;
|
|
92
|
+
private static row;
|
|
93
|
+
register(owner: string, raw: unknown, now?: number, erc8004?: Erc8004Checker): Promise<AgentEntry>;
|
|
94
|
+
get(id: string): Promise<AgentEntry | null>;
|
|
95
|
+
list(owner: string): Promise<AgentEntry[]>;
|
|
96
|
+
/** Changes an active agent of this owner: any of name, contact, capabilities, key, expiry. Null when the owner has no such active agent. */
|
|
97
|
+
update(owner: string, id: string, raw: unknown, now?: number, erc8004?: Erc8004Checker): Promise<AgentEntry | null>;
|
|
98
|
+
/**
|
|
99
|
+
* Active agents, by id, that hold `capability` (and belong to `owner`) when given: at most `limit` of them, after the
|
|
100
|
+
* id `after`. What the registry's public search serves; revoked and expired agents are not listed.
|
|
101
|
+
*/
|
|
102
|
+
search(o: {
|
|
103
|
+
capability?: string;
|
|
104
|
+
owner?: string;
|
|
105
|
+
after?: string;
|
|
106
|
+
limit?: number;
|
|
107
|
+
}, now?: number): Promise<{
|
|
108
|
+
agents: AgentEntry[];
|
|
109
|
+
next: string | null;
|
|
110
|
+
}>;
|
|
111
|
+
/**
|
|
112
|
+
* Records a later check of an agent's standing link: the fresh result, or the error beside the last good one. `checked`
|
|
113
|
+
* is the key and the link that were checked. The result is stored only while the row still names them: a check that
|
|
114
|
+
* finishes after the owner changed the link or rotated the key would otherwise write over the new link. Returns the
|
|
115
|
+
* row as it is.
|
|
116
|
+
*/
|
|
117
|
+
recordErc8004(id: string, checked: {
|
|
118
|
+
agent: string;
|
|
119
|
+
link: Erc8004Link;
|
|
120
|
+
}, r: Erc8004Check, now?: number): Promise<AgentEntry | null>;
|
|
121
|
+
/** Revokes an agent of this owner for good: the registry issues it no more passports. False when there is none to revoke. */
|
|
122
|
+
revoke(owner: string, id: string, now?: number): Promise<boolean>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Signs a passport for an active agent. It lives `passportSeconds`, never past the registration's expiry, and carries
|
|
126
|
+
* `erc8004` when given (the link as last checked). Throws when the agent is revoked or expired.
|
|
127
|
+
*/
|
|
128
|
+
export declare function issuePassport(signer: Signer, registryUrl: string, e: AgentEntry, passportSeconds?: number, now?: number, erc8004?: Erc8004Checked | null): Promise<Envelope>;
|
|
129
|
+
/** The registry's key document, served at REGISTRY_DOCUMENT_PATH. */
|
|
130
|
+
export declare function registryDocument(signer: Signer, registryUrl: string, passportSeconds: number, erc8004Chains?: string[]): Promise<{
|
|
131
|
+
registry: string;
|
|
132
|
+
/** the chain ids whose ERC-8004 registries it checks links against */
|
|
133
|
+
erc8004Chains: string[];
|
|
134
|
+
passportType: string;
|
|
135
|
+
passportHeader: string;
|
|
136
|
+
passportSeconds: number;
|
|
137
|
+
agents: string;
|
|
138
|
+
keys: {
|
|
139
|
+
keyid: string;
|
|
140
|
+
alg: "ed25519";
|
|
141
|
+
publicKeyPem: string;
|
|
142
|
+
validFrom: string;
|
|
143
|
+
validTo?: string;
|
|
144
|
+
}[];
|
|
145
|
+
}>;
|