@tool-bridge/server 0.24.0 → 0.25.0
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/admin.js +164 -5
- package/dist/{airtable-Z6KEL3MA.js → airtable-4HFPBKO2.js} +6 -6
- package/dist/{alt_text_generator_ai-RM2GHSNM.js → alt_text_generator_ai-TBGJCAWO.js} +5 -5
- package/dist/{amap-YEJLGIKY.js → amap-V2WZ4GP4.js} +5 -5
- package/dist/{anthropic-62M4MUVQ.js → anthropic-HVNDGFRH.js} +6 -6
- package/dist/{apify-AHRNDBCB.js → apify-TI5DOAUG.js} +6 -6
- package/dist/{brave_search-JAHWOMQC.js → brave_search-7GFBVUIH.js} +6 -6
- package/dist/{chunk-TH3H5YAG.js → chunk-3VF7MQJX.js} +40 -3
- package/dist/{chunk-FZV7CF7L.js → chunk-CXRQCZBS.js} +3 -3
- package/dist/{chunk-NG4C7YB3.js → chunk-G6GI7EMV.js} +3 -3
- package/dist/{chunk-U2UGFSOX.js → chunk-KVLI7ZFI.js} +2 -2
- package/dist/{chunk-GQ4O7NK5.js → chunk-N7ZFZWGA.js} +1 -1
- package/dist/{chunk-7MUNQNXG.js → chunk-TF2N67HN.js} +1731 -1358
- package/dist/{chunk-LD7KQRQ3.js → chunk-UKITQ6LN.js} +3773 -2879
- package/dist/{chunk-SU6Q4RAY.js → chunk-UVG4PNWV.js} +2 -2
- package/dist/{circleci-UJUYBIAO.js → circleci-75NMIPKV.js} +6 -6
- package/dist/{clerk-FCFM3WJK.js → clerk-PB2SJAMC.js} +6 -6
- package/dist/{cohere-OTSYSMPC.js → cohere-UBIMGBOU.js} +6 -6
- package/dist/{confluence-LPANSCGT.js → confluence-5436ZQBW.js} +6 -6
- package/dist/{convertapi-AJZOVUHT.js → convertapi-CZILNAZL.js} +4 -4
- package/dist/{currencyapi-HGK5FSGO.js → currencyapi-IPUUA4ZC.js} +6 -6
- package/dist/{deepseek-7HMTFJRV.js → deepseek-F2JV4HEE.js} +6 -6
- package/dist/{docker_hub-FCNVKJZW.js → docker_hub-TRH7EULS.js} +5 -5
- package/dist/{dropbox-2XVKCQZE.js → dropbox-4DCC6FQ7.js} +6 -6
- package/dist/{dub-CTUKPX2A.js → dub-RSI5NDXK.js} +6 -6
- package/dist/{e2b-ULEWTRKI.js → e2b-KM4FJOXS.js} +6 -6
- package/dist/{exa-QENFV3AU.js → exa-MF26RJSD.js} +6 -6
- package/dist/{fal_ai-TQYUBBAF.js → fal_ai-4I4QJKBZ.js} +6 -6
- package/dist/{feishu-OYCWDSHD.js → feishu-KEBTN5OD.js} +3 -3
- package/dist/{feishu_custom_bot-VYQ7A3PU.js → feishu_custom_bot-KJTIB3PG.js} +4 -4
- package/dist/{figma-5DLOKAQQ.js → figma-OFW54Q54.js} +6 -6
- package/dist/{firehydrant-X4MGP2OI.js → firehydrant-RU3B7DXC.js} +6 -6
- package/dist/{fixer-LMIWM3ZX.js → fixer-QZ4WCQN3.js} +5 -5
- package/dist/{fly-J5HN5L2I.js → fly-ZPUXZ5Y7.js} +6 -6
- package/dist/{front-E3SMBQW3.js → front-SCMVKIEA.js} +6 -6
- package/dist/{geocodio-AOINRPLA.js → geocodio-N3QYPBRC.js} +5 -5
- package/dist/{ghost-E4CBGZWJ.js → ghost-VMSBR3TP.js} +5 -5
- package/dist/{github-PGR6U3FC.js → github-XOML5UVH.js} +6 -6
- package/dist/github_events-5FCIB5E3.js +78 -0
- package/dist/{gmail-XNQHMQ6F.js → gmail-FX3TTLAE.js} +6 -6
- package/dist/{googlecalendar-RE6DGG7L.js → googlecalendar-LWMUNEF5.js} +6 -6
- package/dist/{googledocs-CX2BZDQH.js → googledocs-ZGVN66MU.js} +4 -4
- package/dist/{grafana-GX75ZA5X.js → grafana-NKZPJG5L.js} +6 -6
- package/dist/{graphhopper-XMUYLWHS.js → graphhopper-XCRPVZNX.js} +5 -5
- package/dist/index.d.ts +315 -5
- package/dist/index.js +7 -5
- package/dist/{ip2proxy-ZGIRBAG5.js → ip2proxy-RDDJFPLQ.js} +5 -5
- package/dist/{ipgeolocation_io-MAP27QMO.js → ipgeolocation_io-RTUJKI3Z.js} +5 -5
- package/dist/{ipqualityscore-6IIUUAQ2.js → ipqualityscore-5NG5KR33.js} +5 -5
- package/dist/{jina_ai-GGH77RQH.js → jina_ai-VG5X5JBE.js} +6 -6
- package/dist/{jira-7GPZW6HZ.js → jira-LS6ITOSL.js} +6 -6
- package/dist/{langsmith-CJXYE7WM.js → langsmith-TT26W3A4.js} +6 -6
- package/dist/{lemlist-OYPOX6GN.js → lemlist-25WLR36L.js} +6 -6
- package/dist/{linear-TPQ6X4XZ.js → linear-JLE2CHI3.js} +4 -4
- package/dist/{logsnag-HT2PRLIV.js → logsnag-OI67GLMG.js} +6 -6
- package/dist/main.js +6 -5
- package/dist/{mattermost-6IYTWTM5.js → mattermost-AYJAUGNG.js} +6 -6
- package/dist/{mem0-7AVGBGOX.js → mem0-ZGEAZPCF.js} +6 -6
- package/dist/{memos-CTOXWZ6X.js → memos-PS2QHWZX.js} +6 -6
- package/dist/{metabase-AFJXQ5SQ.js → metabase-6F5P4YNZ.js} +6 -6
- package/dist/{mistral_ai-QDKM4N3R.js → mistral_ai-GKF6H3PY.js} +6 -6
- package/dist/{mother_duck-XSKR4GVL.js → mother_duck-C7KWG5OB.js} +6 -6
- package/dist/{ngrok-NQMLM24P.js → ngrok-UZQYPMSO.js} +6 -6
- package/dist/{notes-ZWMVZQWJ.js → notes-DO7GGFTP.js} +2 -2
- package/dist/{notion-6544KSMM.js → notion-JSLD5P5J.js} +6 -6
- package/dist/{open_exchange_rates-4CLN7O2N.js → open_exchange_rates-NZYN73GB.js} +5 -5
- package/dist/{openai-HLFGPVI5.js → openai-KOXCZZVV.js} +6 -6
- package/dist/{opengraph_io-57JDHT3M.js → opengraph_io-DVAV6AK6.js} +5 -5
- package/dist/{openrouter-WDAVB2OP.js → openrouter-MPMSFAEY.js} +6 -6
- package/dist/{outline-A6MDLZVH.js → outline-E2SNFTFE.js} +6 -6
- package/dist/{paddle-WX5ULOPP.js → paddle-QOZOMZ6T.js} +6 -6
- package/dist/{perplexity-LYTWWWCZ.js → perplexity-VRWYDYRW.js} +6 -6
- package/dist/{pinecone-7KAF3S7U.js → pinecone-LDU3YSBJ.js} +6 -6
- package/dist/{pipedrive-YQY243G7.js → pipedrive-ZN6NDUPL.js} +6 -6
- package/dist/{polar-A5HKXSQY.js → polar-H5GK75YP.js} +6 -6
- package/dist/{posthog-CF2LHLS4.js → posthog-XVJMSCPA.js} +6 -6
- package/dist/{postmark-W756TMJM.js → postmark-IVXNOXFI.js} +6 -6
- package/dist/{prerender-ZYM4UQ5R.js → prerender-FH4SBVJY.js} +5 -5
- package/dist/{pubmed-QXTUQCTQ.js → pubmed-TM7LBALS.js} +4 -4
- package/dist/{railway-F4MOZ3LQ.js → railway-FJ4XQ2NF.js} +4 -4
- package/dist/{readwise-S7MF5SR5.js → readwise-4VQNTOLQ.js} +6 -6
- package/dist/{render-D7EIVDUA.js → render-CX7AWO6F.js} +6 -6
- package/dist/{replicate-ABNKPZR7.js → replicate-U6T7GYMR.js} +6 -6
- package/dist/{resend-7VJEY4KC.js → resend-RDQXZGY6.js} +6 -6
- package/dist/{rootly-UMFJOKXC.js → rootly-AWTSRSIZ.js} +6 -6
- package/dist/{scrapfly-UDT4KNFL.js → scrapfly-UWX6TBH7.js} +5 -5
- package/dist/{scrapingbee-XTFD54NB.js → scrapingbee-BKCOLELF.js} +5 -5
- package/dist/{screenshot_fyi-5GTW3SFY.js → screenshot_fyi-3OYHV6ZZ.js} +5 -5
- package/dist/{semantic_scholar-Y6WK2MST.js → semantic_scholar-EV2HDKRA.js} +6 -6
- package/dist/{sentry-ZFPGDA6C.js → sentry-BPEKPIFX.js} +6 -6
- package/dist/{shodan-3SCDBOQ3.js → shodan-RYTNBHVJ.js} +5 -5
- package/dist/{shopify-LMTBS2I2.js → shopify-JGWZFCNO.js} +6 -6
- package/dist/{stripe-4JQJ2CUG.js → stripe-RBWCW52X.js} +4 -4
- package/dist/{supabase-7HA3BEFK.js → supabase-TX5J2UBD.js} +6 -6
- package/dist/{tavily-H34ZBPGC.js → tavily-33ZRT2RT.js} +6 -6
- package/dist/{telegram-CRX4YWQ3.js → telegram-HX3UKW3Y.js} +5 -5
- package/dist/{telnyx-TIKGEU34.js → telnyx-5J74OO5R.js} +6 -6
- package/dist/{todoist-LU563DGZ.js → todoist-6CUCDWTH.js} +6 -6
- package/dist/{trello-NTRGEROX.js → trello-FTFDRPZ7.js} +5 -5
- package/dist/{turso-EY3CNVPZ.js → turso-33T4OAJR.js} +6 -6
- package/dist/{twilio-ICX3WRQH.js → twilio-ZBX6EHFG.js} +4 -4
- package/dist/{umami-NPMRVI3M.js → umami-QCVTF7WS.js} +6 -6
- package/dist/{unsplash-TIHBZFIM.js → unsplash-M6XCQKQE.js} +6 -6
- package/dist/{upstash_redis-2DO6EHCN.js → upstash_redis-57JQ3XMB.js} +6 -6
- package/dist/{uptimerobot-BGYOCKGI.js → uptimerobot-KDS5YBKZ.js} +4 -4
- package/dist/{v2ex-GOWDPGGA.js → v2ex-5YPZ6BIT.js} +6 -6
- package/dist/{vercel-G33RXVBI.js → vercel-6VWZHALZ.js} +6 -6
- package/dist/{wolfram_alpha_api-IRZSMD3P.js → wolfram_alpha_api-4YNRTVTQ.js} +5 -5
- package/dist/{wordpress-ATWGGUC3.js → wordpress-LKN2EV4B.js} +6 -6
- package/dist/{workos-LHJDETBX.js → workos-DTPEULYR.js} +6 -6
- package/dist/{zhihu-IAH53YPP.js → zhihu-LFQRTQS7.js} +6 -6
- package/package.json +5 -5
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPlugin
|
|
3
|
+
} from "./chunk-3VF7MQJX.js";
|
|
4
|
+
import {
|
|
5
|
+
TBError
|
|
6
|
+
} from "./chunk-TF2N67HN.js";
|
|
7
|
+
import "./chunk-U67V476Y.js";
|
|
8
|
+
|
|
9
|
+
// ../../node_modules/.pnpm/@octokit+webhooks-methods@6.0.0/node_modules/@octokit/webhooks-methods/dist-node/index.js
|
|
10
|
+
import { createHmac } from "crypto";
|
|
11
|
+
import { timingSafeEqual } from "crypto";
|
|
12
|
+
import { Buffer } from "buffer";
|
|
13
|
+
var VERSION = "6.0.0";
|
|
14
|
+
async function sign(secret, payload) {
|
|
15
|
+
if (!secret || !payload) {
|
|
16
|
+
throw new TypeError(
|
|
17
|
+
"[@octokit/webhooks-methods] secret & payload required for sign()"
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
if (typeof payload !== "string") {
|
|
21
|
+
throw new TypeError("[@octokit/webhooks-methods] payload must be a string");
|
|
22
|
+
}
|
|
23
|
+
const algorithm = "sha256";
|
|
24
|
+
return `${algorithm}=${createHmac(algorithm, secret).update(payload).digest("hex")}`;
|
|
25
|
+
}
|
|
26
|
+
sign.VERSION = VERSION;
|
|
27
|
+
async function verify(secret, eventPayload, signature) {
|
|
28
|
+
if (!secret || !eventPayload || !signature) {
|
|
29
|
+
throw new TypeError(
|
|
30
|
+
"[@octokit/webhooks-methods] secret, eventPayload & signature required"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (typeof eventPayload !== "string") {
|
|
34
|
+
throw new TypeError(
|
|
35
|
+
"[@octokit/webhooks-methods] eventPayload must be a string"
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
const signatureBuffer = Buffer.from(signature);
|
|
39
|
+
const verificationBuffer = Buffer.from(await sign(secret, eventPayload));
|
|
40
|
+
if (signatureBuffer.length !== verificationBuffer.length) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return timingSafeEqual(signatureBuffer, verificationBuffer);
|
|
44
|
+
}
|
|
45
|
+
verify.VERSION = VERSION;
|
|
46
|
+
|
|
47
|
+
// ../plugins/src/github_events/index.ts
|
|
48
|
+
import { z } from "zod/v4";
|
|
49
|
+
var dataSchema = z.object({ repository: z.string(), ref: z.string(), after: z.string() });
|
|
50
|
+
var pushSchema = z.object({
|
|
51
|
+
repository: z.object({ full_name: z.string() }),
|
|
52
|
+
ref: z.string(),
|
|
53
|
+
after: z.string()
|
|
54
|
+
});
|
|
55
|
+
var plugin = createPlugin({ token: (env) => env.PLUGIN_TOKEN });
|
|
56
|
+
plugin.events("pushes", {
|
|
57
|
+
description: "Signed GitHub push events",
|
|
58
|
+
headers: ["x-hub-signature-256"],
|
|
59
|
+
types: { "github.push": { version: 1, schema: dataSchema } },
|
|
60
|
+
async verify({ headers, rawBody }, ctx) {
|
|
61
|
+
const signature = headers["x-hub-signature-256"];
|
|
62
|
+
if (!signature || !ctx.upstreamAuth || !await verify(ctx.upstreamAuth, rawBody, signature)) {
|
|
63
|
+
throw TBError.unauthenticated();
|
|
64
|
+
}
|
|
65
|
+
const body = JSON.parse(rawBody);
|
|
66
|
+
if (z.object({ zen: z.string(), hook_id: z.number() }).safeParse(body).success) return null;
|
|
67
|
+
const result = pushSchema.safeParse(body);
|
|
68
|
+
if (!result.success) throw new TBError("invalid_argument", "expected a GitHub push payload");
|
|
69
|
+
const { repository, ref, after } = result.data;
|
|
70
|
+
const digest = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(rawBody));
|
|
71
|
+
const idempotencyKey = Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
72
|
+
return { type: "github.push", data: { repository: repository.full_name, ref, after }, subject: repository.full_name, idempotencyKey };
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var github_events_default = plugin;
|
|
76
|
+
export {
|
|
77
|
+
github_events_default as default
|
|
78
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CXRQCZBS.js";
|
|
4
|
+
import "./chunk-G6GI7EMV.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject
|
|
7
7
|
} from "./chunk-JXHMDBAY.js";
|
|
8
8
|
import {
|
|
9
9
|
createProviderPlugin,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UVG4PNWV.js";
|
|
12
|
+
import "./chunk-N7ZFZWGA.js";
|
|
13
|
+
import "./chunk-3VF7MQJX.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TF2N67HN.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/gmail/api/shared.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CXRQCZBS.js";
|
|
4
|
+
import "./chunk-G6GI7EMV.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
compactDefined,
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
createProviderPlugin,
|
|
12
12
|
upstreamError
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-UVG4PNWV.js";
|
|
14
|
+
import "./chunk-N7ZFZWGA.js";
|
|
15
|
+
import "./chunk-3VF7MQJX.js";
|
|
16
16
|
import {
|
|
17
17
|
TBError,
|
|
18
18
|
isTBError
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-TF2N67HN.js";
|
|
20
20
|
import "./chunk-U67V476Y.js";
|
|
21
21
|
|
|
22
22
|
// ../plugins/src/googlecalendar/api/shared.ts
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
createProviderPlugin,
|
|
10
10
|
requireApiKey,
|
|
11
11
|
upstreamError
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UVG4PNWV.js";
|
|
13
13
|
import {
|
|
14
14
|
guardedFetch
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-N7ZFZWGA.js";
|
|
16
|
+
import "./chunk-3VF7MQJX.js";
|
|
17
17
|
import {
|
|
18
18
|
TBError,
|
|
19
19
|
isTBError
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-TF2N67HN.js";
|
|
21
21
|
import "./chunk-U67V476Y.js";
|
|
22
22
|
|
|
23
23
|
// ../plugins/src/googledocs/api/shared.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAuthedClient
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-CXRQCZBS.js";
|
|
4
|
+
import "./chunk-G6GI7EMV.js";
|
|
5
5
|
import {
|
|
6
6
|
asJsonObject,
|
|
7
7
|
booleanValue,
|
|
@@ -13,14 +13,14 @@ import {
|
|
|
13
13
|
createProviderPlugin,
|
|
14
14
|
requireApiKey,
|
|
15
15
|
upstreamError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-UVG4PNWV.js";
|
|
17
17
|
import {
|
|
18
18
|
assertPublicHttpUrl
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
} from "./chunk-N7ZFZWGA.js";
|
|
20
|
+
import "./chunk-3VF7MQJX.js";
|
|
21
21
|
import {
|
|
22
22
|
TBError
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TF2N67HN.js";
|
|
24
24
|
import "./chunk-U67V476Y.js";
|
|
25
25
|
|
|
26
26
|
// ../plugins/src/grafana/api.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProviderHttpClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-G6GI7EMV.js";
|
|
4
4
|
import {
|
|
5
5
|
asJsonObject
|
|
6
6
|
} from "./chunk-JXHMDBAY.js";
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
createProviderPlugin,
|
|
9
9
|
requireApiKey,
|
|
10
10
|
upstreamError
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-UVG4PNWV.js";
|
|
12
|
+
import "./chunk-N7ZFZWGA.js";
|
|
13
|
+
import "./chunk-3VF7MQJX.js";
|
|
14
14
|
import {
|
|
15
15
|
TBError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-TF2N67HN.js";
|
|
17
17
|
import "./chunk-U67V476Y.js";
|
|
18
18
|
|
|
19
19
|
// ../plugins/src/graphhopper/api.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -29,6 +29,199 @@ interface ListOptions {
|
|
|
29
29
|
}
|
|
30
30
|
/** "user:alice" | "agent:researcher" | "device:build-01"。 */
|
|
31
31
|
type OwnerRef = string;
|
|
32
|
+
interface CallContext {
|
|
33
|
+
/** 平台→Plugin envelope 专用:本次调用命中该 plugin 的哪个 export(v2 多 export 路由)。 */
|
|
34
|
+
exportId?: string;
|
|
35
|
+
/** 本次调用使用的 SK 的 id(非明文)。 */
|
|
36
|
+
keyId: string;
|
|
37
|
+
/** 平台→Plugin envelope 专用:挂载节点 config.providerConfig 透传(每挂载非敏感配置)。 */
|
|
38
|
+
mountConfig?: Record<string, unknown>;
|
|
39
|
+
/** 平台→Plugin envelope 专用:本次调用来自哪个挂载节点(同一 plugin 可多路径挂载)。 */
|
|
40
|
+
mountPath?: TreePath;
|
|
41
|
+
owner: OwnerRef;
|
|
42
|
+
/** 反向注册路径收紧规则;缺省按非保留根放行。 */
|
|
43
|
+
registerPaths?: TreePath[];
|
|
44
|
+
scopes: Scope[];
|
|
45
|
+
/** 全链路观测。 */
|
|
46
|
+
traceId: string;
|
|
47
|
+
}
|
|
48
|
+
type Action = 'read' | 'write' | 'call' | 'register' | 'admin';
|
|
49
|
+
interface Scope {
|
|
50
|
+
actions: Action[];
|
|
51
|
+
/** 默认 allow;deny 优先于一切 allow。 */
|
|
52
|
+
effect?: 'allow' | 'deny';
|
|
53
|
+
/** 树路径 glob:"**" | "docs/**" | "device/build-01/**"。 */
|
|
54
|
+
pattern: string;
|
|
55
|
+
}
|
|
56
|
+
type NodeKind = 'topic' | 'directory' | 'mcp' | 'http' | 'builtin' | 'context' | 'device' | 'remote' | 'tool' | 'skillhub';
|
|
57
|
+
interface TreeNode {
|
|
58
|
+
/** 按 kind 区分。 */
|
|
59
|
+
config?: NodeConfig;
|
|
60
|
+
createdAt: Timestamp;
|
|
61
|
+
/** 一句话;上级 ~help 列子节点时展示。 */
|
|
62
|
+
description: string;
|
|
63
|
+
/** 设备最后一次 hello 的环境快照;仅网关写入,不作为权限依据。 */
|
|
64
|
+
deviceEnvironment?: DeviceEnvironment;
|
|
65
|
+
/** 仅设备挂载根:hello 中声明的稳定设备身份。由设备注册流程写入,不接受普通 NodeInput。 */
|
|
66
|
+
deviceId?: string;
|
|
67
|
+
deviceReportedAt?: Timestamp;
|
|
68
|
+
kind: NodeKind;
|
|
69
|
+
/** 仅 device:最近一次观察到设备存活(hello / 心跳 / 成功调用)的时刻。缺省表示从未观察或旧数据;
|
|
70
|
+
* freshness 判定见 device/presence.ts。写路径专用,不经普通注册面。 */
|
|
71
|
+
lastSeenAt?: Timestamp;
|
|
72
|
+
/** 仅 device:连接是否已建立(hello 落库 true,连接拆除 false)。是否"可立即路由"还须看
|
|
73
|
+
* `lastSeenAt` 的新鲜度——投影时由 derivePresence 综合成三态 presence,不要直接把它当在线。 */
|
|
74
|
+
online?: boolean;
|
|
75
|
+
/** 唯一键。 */
|
|
76
|
+
path: TreePath;
|
|
77
|
+
/** keyId;device 节点由 Gateway 代写;自动物化 directory 为 'system:auto'。 */
|
|
78
|
+
registeredBy: string;
|
|
79
|
+
updatedAt: Timestamp;
|
|
80
|
+
/** 工具虚拟化(mcp/http 适用)。 */
|
|
81
|
+
virtualize?: Virtualize;
|
|
82
|
+
}
|
|
83
|
+
interface Virtualize {
|
|
84
|
+
/** description override。 */
|
|
85
|
+
describe?: Record<string, string>;
|
|
86
|
+
/** 隐藏的工具名。 */
|
|
87
|
+
hide?: string[];
|
|
88
|
+
/** 工具名统一加前缀。 */
|
|
89
|
+
prefix?: string;
|
|
90
|
+
/** 原名 → 虚拟名。 */
|
|
91
|
+
rename?: Record<string, string>;
|
|
92
|
+
}
|
|
93
|
+
interface HttpToolDef {
|
|
94
|
+
description: string;
|
|
95
|
+
/** 工具副作用词汇;缺省由 Provider 按 method/schema 派生。 */
|
|
96
|
+
effect?: 'read' | 'write' | 'destructive';
|
|
97
|
+
/** JSON Schema;~help 的数据源。 */
|
|
98
|
+
inputSchema?: unknown;
|
|
99
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
100
|
+
name: string;
|
|
101
|
+
/** 相对 endpoint;支持 {param} 占位。 */
|
|
102
|
+
pathTemplate: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* MCP 托管 OAuth 的预注册客户端。clientId 是可回显标识;机密只允许通过
|
|
106
|
+
* clientSecretRef 指向 SecretStore,不能直接进入节点 config。
|
|
107
|
+
*/
|
|
108
|
+
interface McpOAuthClientConfig {
|
|
109
|
+
clientId: string;
|
|
110
|
+
clientSecretRef?: string;
|
|
111
|
+
}
|
|
112
|
+
/** 有界的设备自报环境;禁止自动携带路径、环境变量或凭据。 */
|
|
113
|
+
interface DeviceEnvironment {
|
|
114
|
+
arch?: string;
|
|
115
|
+
platform: 'darwin' | 'linux' | 'win32' | 'android' | 'ios' | 'other';
|
|
116
|
+
runtime?: 'node' | 'bun' | 'react-native' | 'other';
|
|
117
|
+
runtimeId?: string;
|
|
118
|
+
runtimeVersion?: string;
|
|
119
|
+
}
|
|
120
|
+
interface DeviceExpose {
|
|
121
|
+
/** 宿主显式提供,neutral SDK 不采集本机信息。 */
|
|
122
|
+
environment?: DeviceEnvironment;
|
|
123
|
+
/** 挂 `<mountPath>/fs` context 节点(file provider);支持多根。 */
|
|
124
|
+
fs?: {
|
|
125
|
+
readOnly?: boolean;
|
|
126
|
+
roots: string[];
|
|
127
|
+
};
|
|
128
|
+
/** SDK 自定义节点(路径相对 mountPath)。 */
|
|
129
|
+
nodes?: DeviceNodeInput[];
|
|
130
|
+
/** 挂 `<mountPath>/shell` 工具节点;allow 白名单语义:缺省 [] = 全拒。 */
|
|
131
|
+
shell?: {
|
|
132
|
+
allow?: string[];
|
|
133
|
+
description?: string;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
/** 设备命令的投递声明;缺省等价 realtime,mailbox/both 才允许显式 enqueue。 */
|
|
137
|
+
type DeviceCommandDelivery = 'realtime' | 'mailbox' | 'both';
|
|
138
|
+
/**
|
|
139
|
+
* expose.nodes 元素:NodeInput + 可选工具表 `cmds`(ToolSpec 形状,
|
|
140
|
+
* SDK 随注册上送;网关存入代写节点的 providerConfig 作 `~help` 数据源,不新增帧类型)。
|
|
141
|
+
*/
|
|
142
|
+
type DeviceNodeInput = NodeInput & {
|
|
143
|
+
cmds?: DeviceNodeCmd[];
|
|
144
|
+
};
|
|
145
|
+
/** 设备自定义节点随注册上送的单条工具元数据(与 tool/types.ts 的 ToolSpec 同形)。 */
|
|
146
|
+
interface DeviceNodeCmd {
|
|
147
|
+
confirm?: boolean;
|
|
148
|
+
delivery?: DeviceCommandDelivery;
|
|
149
|
+
description?: string;
|
|
150
|
+
effect?: string;
|
|
151
|
+
inputSchema?: unknown;
|
|
152
|
+
name: string;
|
|
153
|
+
outputSchema?: unknown;
|
|
154
|
+
}
|
|
155
|
+
type NodeConfig = {
|
|
156
|
+
auth?: 'oauth';
|
|
157
|
+
/** authRef 凭证注入的头名(默认 Authorization)。 */
|
|
158
|
+
authHeader?: string;
|
|
159
|
+
authRef?: string;
|
|
160
|
+
/** 凭证前缀;空串 = 原样注入(默认 Bearer)。 */
|
|
161
|
+
authScheme?: string;
|
|
162
|
+
/** 静态明文请求头(非机密,如上游要求的工具白名单头);authRef 头优先。 */
|
|
163
|
+
headers?: Record<string, string>;
|
|
164
|
+
kind: 'mcp';
|
|
165
|
+
/** 缺省走 DCR;配置后使用预注册 public/confidential client,不尝试 DCR。 */
|
|
166
|
+
oauthClient?: McpOAuthClientConfig;
|
|
167
|
+
url: string;
|
|
168
|
+
} | {
|
|
169
|
+
authHeader?: string;
|
|
170
|
+
authRef?: string;
|
|
171
|
+
authScheme?: string;
|
|
172
|
+
endpoint: string;
|
|
173
|
+
kind: 'http';
|
|
174
|
+
tools: HttpToolDef[];
|
|
175
|
+
} | {
|
|
176
|
+
authRef: string;
|
|
177
|
+
export: string;
|
|
178
|
+
kind: 'topic';
|
|
179
|
+
provider: string;
|
|
180
|
+
} | {
|
|
181
|
+
kind: 'builtin';
|
|
182
|
+
module: string;
|
|
183
|
+
} | {
|
|
184
|
+
authRef?: string;
|
|
185
|
+
/** 多 export plugin:挂载的 export id;单 export 可省。 */
|
|
186
|
+
export?: string;
|
|
187
|
+
kind: 'context';
|
|
188
|
+
provider: string;
|
|
189
|
+
providerConfig?: Record<string, unknown>;
|
|
190
|
+
readOnly?: boolean;
|
|
191
|
+
/** ttl 秒:到期整节点回收(临时 namespace)。 */
|
|
192
|
+
ttl?: number;
|
|
193
|
+
} | {
|
|
194
|
+
deviceId: string;
|
|
195
|
+
expose: DeviceExpose;
|
|
196
|
+
kind: 'device';
|
|
197
|
+
} | {
|
|
198
|
+
baseUrl: string;
|
|
199
|
+
kind: 'remote';
|
|
200
|
+
skRef?: string;
|
|
201
|
+
}
|
|
202
|
+
/** tool-provider 挂载:provider = plugin id 或 SDK 内部保留 id(如 '@local')。
|
|
203
|
+
* providerConfig:设备自定义节点的转发标记(deviceId+mountPath+cmds,网关代写)。
|
|
204
|
+
* authRef:上游凭证引用,调用时平台 resolve 后经 X-TB-Upstream-Auth 注入 plugin。 */
|
|
205
|
+
| {
|
|
206
|
+
authRef?: string;
|
|
207
|
+
/** 多 export plugin:挂载的 export id;单 export 可省(见 plugin/contract resolvePluginExport)。 */
|
|
208
|
+
export?: string;
|
|
209
|
+
kind: 'tool';
|
|
210
|
+
provider: string;
|
|
211
|
+
providerConfig?: Record<string, unknown>;
|
|
212
|
+
}
|
|
213
|
+
/** skillhub:与 context 同形的内容型 kind,存 Agent Skill(每 skill = <id>/SKILL.md + 若干文本文件)。
|
|
214
|
+
* 底层复用 context 的对象存储(provider storage 用平台自带桶,无需外部凭证;s3 需 authRef)。 */
|
|
215
|
+
| {
|
|
216
|
+
authRef?: string;
|
|
217
|
+
kind: 'skillhub';
|
|
218
|
+
provider: string;
|
|
219
|
+
providerConfig?: Record<string, unknown>;
|
|
220
|
+
readOnly?: boolean;
|
|
221
|
+
/** ttl 秒:到期整节点回收(临时 hub)。 */
|
|
222
|
+
ttl?: number;
|
|
223
|
+
};
|
|
224
|
+
type NodeInput = Omit<TreeNode, 'registeredBy' | 'online' | 'lastSeenAt' | 'deviceId' | 'deviceEnvironment' | 'deviceReportedAt' | 'createdAt' | 'updatedAt'>;
|
|
32
225
|
|
|
33
226
|
/**
|
|
34
227
|
* StateStore:宿主注入的状态存储接口。
|
|
@@ -51,6 +244,9 @@ type OwnerRef = string;
|
|
|
51
244
|
* store:call-capability:<id> → CallUploadCapability(token 仅存 hash)
|
|
52
245
|
* store:share:<id> → ShareGrant(token 仅存 hash)
|
|
53
246
|
*/
|
|
247
|
+
|
|
248
|
+
/** A synchronous node edit. Storage holds the row stable until the edit commits. */
|
|
249
|
+
type NodeEdit = (current: TreeNode) => TreeNode;
|
|
54
250
|
interface StateStore {
|
|
55
251
|
/**
|
|
56
252
|
* 可选原子 compare-and-swap 原语,供带 `revision` 的权威记录做跨副本状态转换。
|
|
@@ -87,6 +283,7 @@ interface StateStore {
|
|
|
87
283
|
* 可选而非必选:必选会破坏 SDK 消费者已实现的自定义 StateStore。
|
|
88
284
|
*/
|
|
89
285
|
putIfAbsent?(key: string, value: unknown): Promise<boolean>;
|
|
286
|
+
updateNode?(key: string, edit: NodeEdit): Promise<TreeNode | null>;
|
|
90
287
|
}
|
|
91
288
|
|
|
92
289
|
/**
|
|
@@ -179,6 +376,16 @@ declare class SecretStoreImpl {
|
|
|
179
376
|
}>;
|
|
180
377
|
}
|
|
181
378
|
|
|
379
|
+
/** Portable event source metadata shared by plugin and catalog views. */
|
|
380
|
+
interface PluginEventSource {
|
|
381
|
+
headers: string[];
|
|
382
|
+
types: Array<{
|
|
383
|
+
dataSchema: Record<string, unknown>;
|
|
384
|
+
type: string;
|
|
385
|
+
version: number;
|
|
386
|
+
}>;
|
|
387
|
+
}
|
|
388
|
+
|
|
182
389
|
/**
|
|
183
390
|
* Provider 型 OAuth2 的声明契约(与 mcp 上游的托管 OAuth 是**两套机制**)。
|
|
184
391
|
*
|
|
@@ -236,7 +443,7 @@ interface PluginOAuth {
|
|
|
236
443
|
*/
|
|
237
444
|
|
|
238
445
|
/** export 的语义档位。 */
|
|
239
|
-
type PluginProfile = 'tools/v1' | 'context/v1';
|
|
446
|
+
type PluginProfile = 'tools/v1' | 'context/v1' | 'events/v1';
|
|
240
447
|
/** 单个 export 的声明。 */
|
|
241
448
|
interface PluginExport {
|
|
242
449
|
/** 明确声明无需凭证,或声明单值凭证的展示/必填语义;与 oauth/credentialFields 三选一。 */
|
|
@@ -269,6 +476,7 @@ interface PluginExport {
|
|
|
269
476
|
*/
|
|
270
477
|
credentialProbe?: string;
|
|
271
478
|
description?: string;
|
|
479
|
+
eventSource?: PluginEventSource;
|
|
272
480
|
id: string;
|
|
273
481
|
methods?: string[];
|
|
274
482
|
/**
|
|
@@ -362,6 +570,8 @@ interface BuiltinCatalogEntry {
|
|
|
362
570
|
/** binding 名 → 目录项。 */
|
|
363
571
|
type BuiltinCatalog = Record<string, BuiltinCatalogEntry>;
|
|
364
572
|
|
|
573
|
+
type PreparePluginImage = (id: string, image: string) => Promise<string>;
|
|
574
|
+
|
|
365
575
|
/**
|
|
366
576
|
* ObjectStore:对象存储抽象。
|
|
367
577
|
*
|
|
@@ -1323,6 +1533,61 @@ interface DeviceCallAttempt {
|
|
|
1323
1533
|
result: DeviceCallResult;
|
|
1324
1534
|
}
|
|
1325
1535
|
|
|
1536
|
+
/** Portable public types; SDK declaration consumers do not need the validator package. */
|
|
1537
|
+
type EventData = string | number | boolean | null | EventData[] | {
|
|
1538
|
+
[key: string]: EventData;
|
|
1539
|
+
};
|
|
1540
|
+
interface EventPublishInput {
|
|
1541
|
+
data: EventData;
|
|
1542
|
+
idempotencyKey?: string;
|
|
1543
|
+
schemaVersion?: number;
|
|
1544
|
+
subject?: string;
|
|
1545
|
+
type: string;
|
|
1546
|
+
}
|
|
1547
|
+
interface EventReadInput {
|
|
1548
|
+
after?: string;
|
|
1549
|
+
limit?: number;
|
|
1550
|
+
type?: string;
|
|
1551
|
+
waitMs?: number;
|
|
1552
|
+
}
|
|
1553
|
+
interface EventReceipt {
|
|
1554
|
+
cursor: string;
|
|
1555
|
+
id: string;
|
|
1556
|
+
}
|
|
1557
|
+
interface EventEnvelope extends EventReceipt {
|
|
1558
|
+
data: EventData;
|
|
1559
|
+
recordedAt: string;
|
|
1560
|
+
schemaVersion: number;
|
|
1561
|
+
source: string;
|
|
1562
|
+
subject?: string;
|
|
1563
|
+
type: string;
|
|
1564
|
+
}
|
|
1565
|
+
interface EventReadResult {
|
|
1566
|
+
events: EventEnvelope[];
|
|
1567
|
+
gap?: {
|
|
1568
|
+
earliestCursor: string;
|
|
1569
|
+
reason: 'generation' | 'retention';
|
|
1570
|
+
};
|
|
1571
|
+
nextCursor: string;
|
|
1572
|
+
timedOut: boolean;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
interface EventTopicBinding {
|
|
1576
|
+
authRef: string;
|
|
1577
|
+
export: string;
|
|
1578
|
+
generation: string;
|
|
1579
|
+
provider: string;
|
|
1580
|
+
}
|
|
1581
|
+
interface EventRepository {
|
|
1582
|
+
acquireWait(keyId: string): Promise<() => Promise<void>>;
|
|
1583
|
+
/** One snapshot of the authenticated ingress binding. Null for absent or user topics. */
|
|
1584
|
+
binding(path: string): Promise<EventTopicBinding | null>;
|
|
1585
|
+
publish(path: string, actor: Pick<CallContext, 'keyId' | 'owner'>, input: EventPublishInput, expectedBinding?: EventTopicBinding): Promise<EventReceipt>;
|
|
1586
|
+
read(path: string, input: EventReadInput): Promise<EventReadResult>;
|
|
1587
|
+
/** A wake is only a hint. Each reader independently queries its durable position. */
|
|
1588
|
+
watch(path: string, wake: () => void): () => void;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1326
1591
|
interface RuntimeRemoteSettings {
|
|
1327
1592
|
allowInsecure: boolean;
|
|
1328
1593
|
allowlist: string[];
|
|
@@ -1400,7 +1665,14 @@ interface ToolSearchDocument extends ToolSearchHit {
|
|
|
1400
1665
|
* 可变索引的宿主契约。写入单位是节点快照,避免逐条 upsert 遗留已删除工具;
|
|
1401
1666
|
* rebuild 用于首次 seed 与运维修复,removePrefix 用于设备子树回收。
|
|
1402
1667
|
*/
|
|
1668
|
+
interface SearchRegistrySnapshot {
|
|
1669
|
+
items: TreeNode[];
|
|
1670
|
+
truncated: boolean;
|
|
1671
|
+
}
|
|
1672
|
+
type BuildSearchDocuments = (nodes: readonly TreeNode[], getMany: (keys: readonly string[]) => Promise<Map<string, unknown>>) => Promise<ToolSearchDocument[]>;
|
|
1403
1673
|
interface MutableSearchIndex extends SearchIndex {
|
|
1674
|
+
/** Optional for hosts sharing a transaction between canonical state and the index. */
|
|
1675
|
+
auditCanonical?(build: BuildSearchDocuments): Promise<SearchRegistrySnapshot>;
|
|
1404
1676
|
initialized(): Promise<boolean>;
|
|
1405
1677
|
rebuild(documents: readonly ToolSearchDocument[]): Promise<void>;
|
|
1406
1678
|
remove(path: TreePath): Promise<void>;
|
|
@@ -1663,6 +1935,8 @@ interface TbAppDeps {
|
|
|
1663
1935
|
encryptionKeyring?: EncryptionKeyring;
|
|
1664
1936
|
/** 认证前的实例就绪钩子(引导/延迟注册 flush);每请求调用,幂等由宿主保证。 */
|
|
1665
1937
|
ensureReady?: () => Promise<void>;
|
|
1938
|
+
eventRepository?: EventRepository;
|
|
1939
|
+
eventStreamShutdown?: AbortSignal;
|
|
1666
1940
|
keyManagement?: KeyManagement;
|
|
1667
1941
|
/** SDK 进程内 Provider 表(缺省无)。 */
|
|
1668
1942
|
locals?: LocalProviderHooks;
|
|
@@ -1687,6 +1961,7 @@ interface TbAppDeps {
|
|
|
1687
1961
|
* 那个插件解析不出 export;反之则解析得出但调不动(unavailable)。宿主该两者同源装配。
|
|
1688
1962
|
*/
|
|
1689
1963
|
pluginCatalog?: BuiltinCatalog;
|
|
1964
|
+
preparePluginImage?: PreparePluginImage;
|
|
1690
1965
|
/**
|
|
1691
1966
|
* Provider OAuth 令牌端点的宿主出站通道。必须由宿主显式注入;缺省时 OAuth
|
|
1692
1967
|
* 发起、回调兑换与 access-token 解析全部 fail closed,绝不回退到全局 fetch。
|
|
@@ -1765,6 +2040,7 @@ interface ServerConfig extends Partial<RuntimeConfig> {
|
|
|
1765
2040
|
objectStore?: S3StoreConfig;
|
|
1766
2041
|
pluginBindings?: PluginBindings;
|
|
1767
2042
|
pluginCatalog?: BuiltinCatalog;
|
|
2043
|
+
pluginRunnerSocket?: string;
|
|
1768
2044
|
port: number;
|
|
1769
2045
|
redisUrl?: string;
|
|
1770
2046
|
remote: RuntimeRemoteSettings;
|
|
@@ -1887,6 +2163,8 @@ declare class DeviceHub {
|
|
|
1887
2163
|
private readonly upgradeHandler;
|
|
1888
2164
|
private readonly store;
|
|
1889
2165
|
private readonly search;
|
|
2166
|
+
private readonly publishedReclaimSec?;
|
|
2167
|
+
private resweepRequired;
|
|
1890
2168
|
private reclaimSec;
|
|
1891
2169
|
private readonly wss;
|
|
1892
2170
|
private readonly activeByDevice;
|
|
@@ -1897,6 +2175,7 @@ declare class DeviceHub {
|
|
|
1897
2175
|
private router;
|
|
1898
2176
|
constructor(opts: {
|
|
1899
2177
|
heartbeatMs?: number;
|
|
2178
|
+
publishedReclaimSec?: () => Promise<number>;
|
|
1900
2179
|
reclaimSec: number;
|
|
1901
2180
|
/** 多副本部署的调用路由工厂;拿到 onLocalCall 回调后构造(避免循环依赖)。 */
|
|
1902
2181
|
router?: (onLocalCall: DeviceLocalCall) => DeviceRouter;
|
|
@@ -2034,6 +2313,7 @@ declare class MaintenanceManager implements MaintenanceManagement {
|
|
|
2034
2313
|
interface ManagedServerOptions {
|
|
2035
2314
|
directory: string;
|
|
2036
2315
|
host?: string;
|
|
2316
|
+
pluginRunnerSocket?: string;
|
|
2037
2317
|
port?: number;
|
|
2038
2318
|
uiDir?: string;
|
|
2039
2319
|
}
|
|
@@ -2049,6 +2329,25 @@ declare function createManagedServer(options: ManagedServerOptions): Promise<{
|
|
|
2049
2329
|
shutdown(): Promise<void>;
|
|
2050
2330
|
}>;
|
|
2051
2331
|
|
|
2332
|
+
/** Registry mutations and topic generations change in the same database transaction. */
|
|
2333
|
+
declare class PgEventRepository implements EventRepository {
|
|
2334
|
+
private readonly sql;
|
|
2335
|
+
private readonly watchers;
|
|
2336
|
+
private listener?;
|
|
2337
|
+
constructor(sql: Sql);
|
|
2338
|
+
ensureSchema(): Promise<void>;
|
|
2339
|
+
watch(path: string, wake: () => void): () => void;
|
|
2340
|
+
close(): Promise<void>;
|
|
2341
|
+
cleanup(): Promise<void>;
|
|
2342
|
+
acquireWait(keyId: string): Promise<() => Promise<void>>;
|
|
2343
|
+
binding(path: string): Promise<EventTopicBinding | null>;
|
|
2344
|
+
publish(path: string, actor: {
|
|
2345
|
+
keyId: string;
|
|
2346
|
+
owner: string;
|
|
2347
|
+
}, input: EventPublishInput, expectedBinding?: EventTopicBinding): Promise<EventReceipt>;
|
|
2348
|
+
read(path: string, input: EventReadInput): Promise<EventReadResult>;
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2052
2351
|
interface KeyRotationJob {
|
|
2053
2352
|
changed: number;
|
|
2054
2353
|
cursor: string | null;
|
|
@@ -2096,11 +2395,16 @@ declare class PgMailboxRepository implements MailboxRepository {
|
|
|
2096
2395
|
private writeUnderLease;
|
|
2097
2396
|
}
|
|
2098
2397
|
|
|
2099
|
-
/** PostgreSQL driver: transactions and bounded VALUES batches; search SQL is owned by core/pgSearchSql. */
|
|
2100
|
-
|
|
2101
2398
|
/** Node 自托管宿主的 postgres.js SearchIndex。 */
|
|
2102
2399
|
declare class PgSearchIndex extends SqlSearchIndex {
|
|
2400
|
+
private readonly sql;
|
|
2401
|
+
private snapshot?;
|
|
2402
|
+
private auditing?;
|
|
2403
|
+
auditCanonical?: (build: BuildSearchDocuments) => Promise<SearchRegistrySnapshot>;
|
|
2103
2404
|
constructor(sql: Sql);
|
|
2405
|
+
/** Install only when the standard host owns both tb_kv and this index. */
|
|
2406
|
+
enableCanonicalAudit(): Promise<void>;
|
|
2407
|
+
private audit;
|
|
2104
2408
|
}
|
|
2105
2409
|
|
|
2106
2410
|
/**
|
|
@@ -2126,7 +2430,10 @@ declare class PgStateStore implements StateStore {
|
|
|
2126
2430
|
ensureContextReferencesSchema(): Promise<void>;
|
|
2127
2431
|
get(key: string): Promise<unknown | null>;
|
|
2128
2432
|
getMany(keys: readonly string[]): Promise<Map<string, unknown>>;
|
|
2433
|
+
private upsert;
|
|
2129
2434
|
put(key: string, value: unknown): Promise<void>;
|
|
2435
|
+
private syncContextReference;
|
|
2436
|
+
updateNode(key: string, edit: (current: TreeNode) => TreeNode): Promise<TreeNode | null>;
|
|
2130
2437
|
compareAndSwap(key: string, expectedRevision: number | null, value: unknown | null): Promise<boolean>;
|
|
2131
2438
|
putIfAbsent(key: string, value: unknown): Promise<boolean>;
|
|
2132
2439
|
delete(key: string): Promise<void>;
|
|
@@ -2251,11 +2558,14 @@ declare class StorageManager implements StorageManagement, StoreBackendResolver
|
|
|
2251
2558
|
declare class ConfigManager implements ConfigManagement {
|
|
2252
2559
|
private readonly sql;
|
|
2253
2560
|
private readonly onApply;
|
|
2561
|
+
private readonly onPublished?;
|
|
2254
2562
|
private localRevision;
|
|
2255
2563
|
private localEffective;
|
|
2256
2564
|
private localError;
|
|
2565
|
+
private committedRevision;
|
|
2257
2566
|
private serial;
|
|
2258
|
-
constructor(sql: Sql, onApply: (settings: RuntimeConfig) => Promise<void>);
|
|
2567
|
+
constructor(sql: Sql, onApply: (settings: RuntimeConfig) => Promise<void>, onPublished?: ((settings: RuntimeConfig) => Promise<void>) | undefined);
|
|
2568
|
+
private activatePublished;
|
|
2259
2569
|
ensureSchema(defaults?: {
|
|
2260
2570
|
canonicalOrigin: string;
|
|
2261
2571
|
remoteAllowlist: string[];
|
|
@@ -2318,4 +2628,4 @@ interface TbServer {
|
|
|
2318
2628
|
}
|
|
2319
2629
|
declare function createTbServer(config: ServerConfig): TbServer;
|
|
2320
2630
|
|
|
2321
|
-
export { BootstrapStateStore, DEVICE_FORWARD_TIMEOUT_MS, DEVICE_ROUTE_TTL_SEC, DEVICE_WS_PATH, DeviceHub, type DeviceLocalCall, DeviceRouter, type DeviceRouterBackend, type KeyManagementHooks, KeyManager, type MaintenanceHooks, MaintenanceManager, type ManagedServerOptions, PgKeyRotation, PgMailboxRepository, PgSearchIndex, PgStateStore, PgStoreRepository, RedisDeviceRouterBackend, type S3ObjectStore, type S3ObjectStoreOptions, type S3ProbeResult, type ServerConfig, StorageManager, type TbServer, createManagedServer, createS3ObjectStore, createTbServer, probeS3ObjectStore, runtimeAppSettings };
|
|
2631
|
+
export { BootstrapStateStore, DEVICE_FORWARD_TIMEOUT_MS, DEVICE_ROUTE_TTL_SEC, DEVICE_WS_PATH, DeviceHub, type DeviceLocalCall, DeviceRouter, type DeviceRouterBackend, type KeyManagementHooks, KeyManager, type MaintenanceHooks, MaintenanceManager, type ManagedServerOptions, PgEventRepository, PgKeyRotation, PgMailboxRepository, PgSearchIndex, PgStateStore, PgStoreRepository, RedisDeviceRouterBackend, type S3ObjectStore, type S3ObjectStoreOptions, type S3ProbeResult, type ServerConfig, StorageManager, type TbServer, createManagedServer, createS3ObjectStore, createTbServer, probeS3ObjectStore, runtimeAppSettings };
|