@alfe.ai/gateway 0.3.0 → 0.3.1
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 +21 -1
- package/dist/src/index.d.ts +11 -1
- package/dist/src/index.js +2 -2
- package/package.json +1 -1
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
|
@@ -5500,6 +5500,26 @@ function captureIntegrationFailure(integration, phase, cause) {
|
|
|
5500
5500
|
});
|
|
5501
5501
|
} catch {}
|
|
5502
5502
|
}
|
|
5503
|
+
/**
|
|
5504
|
+
* Capture a generic CLI failure with a `{ context }` tag. The CLI counterpart
|
|
5505
|
+
* to `captureIntegrationFailure` — used by `exitWithError` at the handled-error
|
|
5506
|
+
* `process.exit()` sites in `@alfe.ai/cli`'s commands, which otherwise report
|
|
5507
|
+
* nothing (the error was caught, never thrown). Accepts an `Error` (captured
|
|
5508
|
+
* with stack), a defined non-Error value (captured as an error-level message),
|
|
5509
|
+
* or nothing (the `context` string itself becomes the message). No-op when
|
|
5510
|
+
* Sentry is not initialised. Never throws.
|
|
5511
|
+
*/
|
|
5512
|
+
function captureCliFailure(context, cause) {
|
|
5513
|
+
if (!sentry) return;
|
|
5514
|
+
try {
|
|
5515
|
+
if (cause instanceof Error) sentry.captureException(cause, { tags: { context } });
|
|
5516
|
+
else if (cause === void 0) sentry.captureMessage(context, { level: "error" });
|
|
5517
|
+
else sentry.captureMessage(String(cause), {
|
|
5518
|
+
level: "error",
|
|
5519
|
+
tags: { context }
|
|
5520
|
+
});
|
|
5521
|
+
} catch {}
|
|
5522
|
+
}
|
|
5503
5523
|
/** Flush queued events (small timeout) so short-lived commands deliver them. */
|
|
5504
5524
|
async function flushSentry(timeoutMs = 2e3) {
|
|
5505
5525
|
if (!sentry) return;
|
|
@@ -23779,4 +23799,4 @@ function formatDuration(ms) {
|
|
|
23779
23799
|
return `${String(Math.round(seconds / 3600))}h`;
|
|
23780
23800
|
}
|
|
23781
23801
|
//#endregion
|
|
23782
|
-
export { PINNED_OPENCLAW_VERSION as S,
|
|
23802
|
+
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 };
|