@alfe.ai/gateway 0.3.0 → 0.3.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/bin/gateway.js +1 -1
- package/dist/health.js +29 -1
- package/dist/src/index.d.ts +11 -1
- package/dist/src/index.js +2 -2
- package/package.json +3 -3
package/dist/bin/gateway.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as installService, c as uninstallService, i as checkExistingDaemon, n as queryDaemonHealth, r as startDaemon, s as stopExistingDaemon, t as formatHealthReport,
|
|
2
|
+
import { a as installService, c as uninstallService, i as checkExistingDaemon, n as queryDaemonHealth, r as startDaemon, s as stopExistingDaemon, t as formatHealthReport, y as SOCKET_PATH } from "../health.js";
|
|
3
3
|
import { t as LOG_FILE } from "../logger.js";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
//#region bin/gateway.ts
|
package/dist/health.js
CHANGED
|
@@ -111,6 +111,7 @@ const ID_PREFIXES = {
|
|
|
111
111
|
directGrant: "dgr",
|
|
112
112
|
revision: "rev",
|
|
113
113
|
fact: "kfc",
|
|
114
|
+
changeRequest: "chr",
|
|
114
115
|
oauthConnection: "con",
|
|
115
116
|
channel: "chn",
|
|
116
117
|
oauthConnectionRequest: "crq",
|
|
@@ -4757,6 +4758,13 @@ enumValues({
|
|
|
4757
4758
|
InProgress: "in-progress",
|
|
4758
4759
|
Done: "done"
|
|
4759
4760
|
});
|
|
4761
|
+
enumValues({
|
|
4762
|
+
Open: "open",
|
|
4763
|
+
Approved: "approved",
|
|
4764
|
+
Rejected: "rejected",
|
|
4765
|
+
Withdrawn: "withdrawn",
|
|
4766
|
+
Superseded: "superseded"
|
|
4767
|
+
});
|
|
4760
4768
|
enumValues({ Flex: "flex" });
|
|
4761
4769
|
enumValues({
|
|
4762
4770
|
Provisioning: "provisioning",
|
|
@@ -5500,6 +5508,26 @@ function captureIntegrationFailure(integration, phase, cause) {
|
|
|
5500
5508
|
});
|
|
5501
5509
|
} catch {}
|
|
5502
5510
|
}
|
|
5511
|
+
/**
|
|
5512
|
+
* Capture a generic CLI failure with a `{ context }` tag. The CLI counterpart
|
|
5513
|
+
* to `captureIntegrationFailure` — used by `exitWithError` at the handled-error
|
|
5514
|
+
* `process.exit()` sites in `@alfe.ai/cli`'s commands, which otherwise report
|
|
5515
|
+
* nothing (the error was caught, never thrown). Accepts an `Error` (captured
|
|
5516
|
+
* with stack), a defined non-Error value (captured as an error-level message),
|
|
5517
|
+
* or nothing (the `context` string itself becomes the message). No-op when
|
|
5518
|
+
* Sentry is not initialised. Never throws.
|
|
5519
|
+
*/
|
|
5520
|
+
function captureCliFailure(context, cause) {
|
|
5521
|
+
if (!sentry) return;
|
|
5522
|
+
try {
|
|
5523
|
+
if (cause instanceof Error) sentry.captureException(cause, { tags: { context } });
|
|
5524
|
+
else if (cause === void 0) sentry.captureMessage(context, { level: "error" });
|
|
5525
|
+
else sentry.captureMessage(String(cause), {
|
|
5526
|
+
level: "error",
|
|
5527
|
+
tags: { context }
|
|
5528
|
+
});
|
|
5529
|
+
} catch {}
|
|
5530
|
+
}
|
|
5503
5531
|
/** Flush queued events (small timeout) so short-lived commands deliver them. */
|
|
5504
5532
|
async function flushSentry(timeoutMs = 2e3) {
|
|
5505
5533
|
if (!sentry) return;
|
|
@@ -23779,4 +23807,4 @@ function formatDuration(ms) {
|
|
|
23779
23807
|
return `${String(Math.round(seconds / 3600))}h`;
|
|
23780
23808
|
}
|
|
23781
23809
|
//#endregion
|
|
23782
|
-
export { PINNED_OPENCLAW_VERSION as S,
|
|
23810
|
+
export { PINNED_OPENCLAW_VERSION as C, resolveAgentIdentity as S, ALFE_DIR as _, installService as a, fetchAgentConfig as b, uninstallService as c, captureFatal as d, captureIntegrationFailure as f, PROTOCOL_VERSION as g, setAgentContext as h, checkExistingDaemon as i, AGENT_DAEMON_SENTRY_DSN as l, initAgentSentry as m, queryDaemonHealth as n, startService as o, flushSentry as p, startDaemon as r, stopExistingDaemon as s, formatHealthReport as t, captureCliFailure as u, PID_PATH as v, loadDaemonConfig as x, SOCKET_PATH as y };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -102,6 +102,16 @@ declare function setAgentContext(context: {
|
|
|
102
102
|
* Sentry is not initialised.
|
|
103
103
|
*/
|
|
104
104
|
declare function captureIntegrationFailure(integration: string, phase: string, cause: unknown): void;
|
|
105
|
+
/**
|
|
106
|
+
* Capture a generic CLI failure with a `{ context }` tag. The CLI counterpart
|
|
107
|
+
* to `captureIntegrationFailure` — used by `exitWithError` at the handled-error
|
|
108
|
+
* `process.exit()` sites in `@alfe.ai/cli`'s commands, which otherwise report
|
|
109
|
+
* nothing (the error was caught, never thrown). Accepts an `Error` (captured
|
|
110
|
+
* with stack), a defined non-Error value (captured as an error-level message),
|
|
111
|
+
* or nothing (the `context` string itself becomes the message). No-op when
|
|
112
|
+
* Sentry is not initialised. Never throws.
|
|
113
|
+
*/
|
|
114
|
+
declare function captureCliFailure(context: string, cause?: unknown): void;
|
|
105
115
|
/** Flush queued events (small timeout) so short-lived commands deliver them. */
|
|
106
116
|
declare function flushSentry(timeoutMs?: number): Promise<void>;
|
|
107
117
|
/**
|
|
@@ -283,4 +293,4 @@ declare function checkExistingDaemon(): Promise<number | null>;
|
|
|
283
293
|
*/
|
|
284
294
|
declare function stopExistingDaemon(): Promise<boolean>;
|
|
285
295
|
//#endregion
|
|
286
|
-
export { AGENT_DAEMON_SENTRY_DSN, ALFE_DIR, type AgentIdentity, type AgentWorkspaceConfig, type DaemonConfig, type DaemonHealth, type IPCEvent, type IPCRequest, type IPCResponse, type InitAgentSentryOptions, PID_PATH, PINNED_OPENCLAW_VERSION, PROTOCOL_VERSION, SOCKET_PATH, type SentrySurface, captureFatal, captureIntegrationFailure, checkExistingDaemon, fetchAgentConfig, flushSentry, formatHealthReport, initAgentSentry, installService, loadDaemonConfig, logger, queryDaemonHealth, resolveAgentIdentity, setAgentContext, startDaemon, startService, stopExistingDaemon, uninstallService };
|
|
296
|
+
export { AGENT_DAEMON_SENTRY_DSN, ALFE_DIR, type AgentIdentity, type AgentWorkspaceConfig, type DaemonConfig, type DaemonHealth, type IPCEvent, type IPCRequest, type IPCResponse, type InitAgentSentryOptions, PID_PATH, PINNED_OPENCLAW_VERSION, PROTOCOL_VERSION, SOCKET_PATH, type SentrySurface, captureCliFailure, captureFatal, captureIntegrationFailure, checkExistingDaemon, fetchAgentConfig, flushSentry, formatHealthReport, initAgentSentry, installService, loadDaemonConfig, logger, queryDaemonHealth, resolveAgentIdentity, setAgentContext, startDaemon, startService, stopExistingDaemon, uninstallService };
|
package/dist/src/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as PINNED_OPENCLAW_VERSION, S as resolveAgentIdentity, _ as ALFE_DIR, a as installService, b as fetchAgentConfig, c as uninstallService, d as captureFatal, f as captureIntegrationFailure, g as PROTOCOL_VERSION, h as setAgentContext, i as checkExistingDaemon, l as AGENT_DAEMON_SENTRY_DSN, m as initAgentSentry, n as queryDaemonHealth, o as startService, p as flushSentry, r as startDaemon, s as stopExistingDaemon, t as formatHealthReport, u as captureCliFailure, v as PID_PATH, x as loadDaemonConfig, y as SOCKET_PATH } from "../health.js";
|
|
2
2
|
import { n as logger } from "../logger.js";
|
|
3
|
-
export { AGENT_DAEMON_SENTRY_DSN, ALFE_DIR, PID_PATH, PINNED_OPENCLAW_VERSION, PROTOCOL_VERSION, SOCKET_PATH, captureFatal, captureIntegrationFailure, checkExistingDaemon, fetchAgentConfig, flushSentry, formatHealthReport, initAgentSentry, installService, loadDaemonConfig, logger, queryDaemonHealth, resolveAgentIdentity, setAgentContext, startDaemon, startService, stopExistingDaemon, uninstallService };
|
|
3
|
+
export { AGENT_DAEMON_SENTRY_DSN, ALFE_DIR, PID_PATH, PINNED_OPENCLAW_VERSION, PROTOCOL_VERSION, SOCKET_PATH, captureCliFailure, captureFatal, captureIntegrationFailure, checkExistingDaemon, fetchAgentConfig, flushSentry, formatHealthReport, initAgentSentry, installService, loadDaemonConfig, logger, queryDaemonHealth, resolveAgentIdentity, setAgentContext, startDaemon, startService, stopExistingDaemon, uninstallService };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"pino-roll": "^1.2.0",
|
|
24
24
|
"smol-toml": ">=1.6.1",
|
|
25
25
|
"ws": "^8.18.0",
|
|
26
|
-
"@alfe.ai/agent-api-client": "^0.
|
|
26
|
+
"@alfe.ai/agent-api-client": "^0.6.0",
|
|
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.2.
|
|
30
|
+
"@alfe.ai/integrations": "^0.2.8",
|
|
31
31
|
"@alfe.ai/mcp-bundler": "^0.2.2"
|
|
32
32
|
},
|
|
33
33
|
"license": "UNLICENSED",
|