@alfe.ai/gateway 0.7.0 → 0.7.2
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/health.js +34 -4
- package/dist/src/index.d.ts +6 -4
- package/package.json +2 -2
package/dist/health.js
CHANGED
|
@@ -536,6 +536,15 @@ var AuthService = class {
|
|
|
536
536
|
body: JSON.stringify(input)
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
|
+
/**
|
|
540
|
+
* Accept an approved Startup Program invite. Call after the applicant has a
|
|
541
|
+
* card on file (confirmed or freshly added) — this mints the Professional
|
|
542
|
+
* grant subscription. Idempotent: a repeat call on an already-accepted
|
|
543
|
+
* application returns `{ status: "accepted" }` without re-charging.
|
|
544
|
+
*/
|
|
545
|
+
acceptStartup() {
|
|
546
|
+
return this.client.request(`${this.prefix}/subscription/accept-startup`, { method: "POST" });
|
|
547
|
+
}
|
|
539
548
|
createCheckoutSession(input) {
|
|
540
549
|
return this.client.request(`${this.prefix}/subscription/checkout`, {
|
|
541
550
|
method: "POST",
|
|
@@ -4484,6 +4493,7 @@ enumValues({
|
|
|
4484
4493
|
enumValues({
|
|
4485
4494
|
Pending: "pending",
|
|
4486
4495
|
Approved: "approved",
|
|
4496
|
+
Accepted: "accepted",
|
|
4487
4497
|
Denied: "denied"
|
|
4488
4498
|
});
|
|
4489
4499
|
enumValues({
|
|
@@ -5413,11 +5423,13 @@ const CLI_SENTRY_DSN = "https://82dde4631336561f2fcc89d7531623de@o45110082394521
|
|
|
5413
5423
|
const AGENT_RUNTIME_SENTRY_DSN = "https://feb7fb2e3b8e723aec518e74715bfa6d@o4511008239452160.ingest.us.sentry.io/4511683667558400";
|
|
5414
5424
|
/**
|
|
5415
5425
|
* MCP tool/server failures on agent VMs — reported by the daemon-hosted MCP
|
|
5416
|
-
* bundler (tool errors, child crashes, stderr output).
|
|
5417
|
-
* project
|
|
5418
|
-
*
|
|
5426
|
+
* bundler (tool errors, child crashes, stderr output). Dedicated `local-mcp`
|
|
5427
|
+
* project for the locally-installed MCP surface: the cloud MCP Fly service
|
|
5428
|
+
* keeps the `mcp` project (`SENTRY_DSNS.mcp`), so planned daemon restarts
|
|
5429
|
+
* tearing down MCP children never pollute the remote service's signal.
|
|
5430
|
+
* The `source: agent-daemon` + `agentId` tags are kept for continuity.
|
|
5419
5431
|
*/
|
|
5420
|
-
const AGENT_MCP_SENTRY_DSN = "https://
|
|
5432
|
+
const AGENT_MCP_SENTRY_DSN = "https://b4c4b4e19135692206bacabcd12a7fd3@o4511008239452160.ingest.us.sentry.io/4511697094377472";
|
|
5421
5433
|
/** Surface → Sentry project: `cli` and `agent-daemon` respectively. */
|
|
5422
5434
|
const SURFACE_DSNS = {
|
|
5423
5435
|
cli: CLI_SENTRY_DSN,
|
|
@@ -7164,6 +7176,12 @@ Type=simple
|
|
|
7164
7176
|
ExecStart=${alfeBin} gateway daemon
|
|
7165
7177
|
Restart=always
|
|
7166
7178
|
RestartSec=10
|
|
7179
|
+
# SIGTERM only the daemon on stop/restart; it closes its MCP/runtime children
|
|
7180
|
+
# itself. The default (control-group) SIGTERMs the children simultaneously, so
|
|
7181
|
+
# they die before the daemon's orderly dispose reaches them and every planned
|
|
7182
|
+
# restart reports MCP "server-crash" noise to Sentry. Stragglers still get
|
|
7183
|
+
# SIGKILL when the stop timeout expires.
|
|
7184
|
+
KillMode=mixed
|
|
7167
7185
|
Environment=NODE_ENV=production${root ? "\nEnvironment=HOME=/root\nWorkingDirectory=/root" : ""}
|
|
7168
7186
|
${envLines}
|
|
7169
7187
|
|
|
@@ -23340,7 +23358,15 @@ function createMcpErrorHooks() {
|
|
|
23340
23358
|
const throttleFor = (kind) => kind === "tool-result-error" ? resultErrorThrottle : kind === "server-crash" ? crashThrottle : errorThrottle;
|
|
23341
23359
|
const detectors = /* @__PURE__ */ new Map();
|
|
23342
23360
|
const flushTimers = /* @__PURE__ */ new Map();
|
|
23361
|
+
let shuttingDown = false;
|
|
23343
23362
|
const capture = (opts) => {
|
|
23363
|
+
if (shuttingDown) {
|
|
23364
|
+
log.debug({
|
|
23365
|
+
server: opts.server,
|
|
23366
|
+
kind: opts.kind
|
|
23367
|
+
}, "MCP failure capture suppressed — daemon shutting down");
|
|
23368
|
+
return;
|
|
23369
|
+
}
|
|
23344
23370
|
const { allow, suppressedCount } = throttleFor(opts.kind).allowErrorCapture(opts.fingerprintKey);
|
|
23345
23371
|
if (!allow) {
|
|
23346
23372
|
log.debug({
|
|
@@ -23412,6 +23438,9 @@ function createMcpErrorHooks() {
|
|
|
23412
23438
|
dispose: () => {
|
|
23413
23439
|
for (const timer of flushTimers.values()) clearTimeout(timer);
|
|
23414
23440
|
flushTimers.clear();
|
|
23441
|
+
},
|
|
23442
|
+
beginShutdown: () => {
|
|
23443
|
+
shuttingDown = true;
|
|
23415
23444
|
}
|
|
23416
23445
|
};
|
|
23417
23446
|
}
|
|
@@ -23919,6 +23948,7 @@ async function startDaemon() {
|
|
|
23919
23948
|
const shutdown = async (signal) => {
|
|
23920
23949
|
if (shuttingDown) return;
|
|
23921
23950
|
shuttingDown = true;
|
|
23951
|
+
mcpErrorHooks.beginShutdown();
|
|
23922
23952
|
logger$1.info({ signal }, "Shutting down...");
|
|
23923
23953
|
if (stopPairingApprovalPoller) {
|
|
23924
23954
|
stopPairingApprovalPoller();
|
package/dist/src/index.d.ts
CHANGED
|
@@ -92,11 +92,13 @@ declare const AGENT_DAEMON_SENTRY_DSN = "https://a47f010d8d39fb4350f913492189f28
|
|
|
92
92
|
declare const AGENT_RUNTIME_SENTRY_DSN = "https://feb7fb2e3b8e723aec518e74715bfa6d@o4511008239452160.ingest.us.sentry.io/4511683667558400";
|
|
93
93
|
/**
|
|
94
94
|
* MCP tool/server failures on agent VMs — reported by the daemon-hosted MCP
|
|
95
|
-
* bundler (tool errors, child crashes, stderr output).
|
|
96
|
-
* project
|
|
97
|
-
*
|
|
95
|
+
* bundler (tool errors, child crashes, stderr output). Dedicated `local-mcp`
|
|
96
|
+
* project for the locally-installed MCP surface: the cloud MCP Fly service
|
|
97
|
+
* keeps the `mcp` project (`SENTRY_DSNS.mcp`), so planned daemon restarts
|
|
98
|
+
* tearing down MCP children never pollute the remote service's signal.
|
|
99
|
+
* The `source: agent-daemon` + `agentId` tags are kept for continuity.
|
|
98
100
|
*/
|
|
99
|
-
declare const AGENT_MCP_SENTRY_DSN = "https://
|
|
101
|
+
declare const AGENT_MCP_SENTRY_DSN = "https://b4c4b4e19135692206bacabcd12a7fd3@o4511008239452160.ingest.us.sentry.io/4511697094377472";
|
|
100
102
|
/** Which surface initialised Sentry — tagged on every event. */
|
|
101
103
|
type SentrySurface = "cli" | "daemon";
|
|
102
104
|
interface InitAgentSentryOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@alfe.ai/ai-proxy-local": "^0.0.13",
|
|
28
28
|
"@alfe.ai/config": "^0.3.0",
|
|
29
29
|
"@alfe.ai/integration-manifest": "^0.3.1",
|
|
30
|
-
"@alfe.ai/integrations": "^0.4.
|
|
30
|
+
"@alfe.ai/integrations": "^0.4.1",
|
|
31
31
|
"@alfe.ai/mcp-bundler": "^0.3.0"
|
|
32
32
|
},
|
|
33
33
|
"license": "UNLICENSED",
|