@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.
@@ -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, v as SOCKET_PATH } from "../health.js";
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, PID_PATH as _, installService as a, loadDaemonConfig as b, uninstallService as c, captureIntegrationFailure as d, flushSentry as f, ALFE_DIR as g, PROTOCOL_VERSION as h, checkExistingDaemon as i, AGENT_DAEMON_SENTRY_DSN as l, setAgentContext as m, queryDaemonHealth as n, startService as o, initAgentSentry as p, startDaemon as r, stopExistingDaemon as s, formatHealthReport as t, captureFatal as u, SOCKET_PATH as v, resolveAgentIdentity as x, fetchAgentConfig as y };
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 };
@@ -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 { S as PINNED_OPENCLAW_VERSION, _ as PID_PATH, a as installService, b as loadDaemonConfig, c as uninstallService, d as captureIntegrationFailure, f as flushSentry, g as ALFE_DIR, h as PROTOCOL_VERSION, i as checkExistingDaemon, l as AGENT_DAEMON_SENTRY_DSN, m as setAgentContext, n as queryDaemonHealth, o as startService, p as initAgentSentry, r as startDaemon, s as stopExistingDaemon, t as formatHealthReport, u as captureFatal, v as SOCKET_PATH, x as resolveAgentIdentity, y as fetchAgentConfig } from "../health.js";
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.0",
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.5.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.7",
30
+ "@alfe.ai/integrations": "^0.2.8",
31
31
  "@alfe.ai/mcp-bundler": "^0.2.2"
32
32
  },
33
33
  "license": "UNLICENSED",