@automagik/omni 2.260922.16 → 2.260923.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/commands/instances.d.ts +6 -0
- package/dist/commands/instances.d.ts.map +1 -1
- package/dist/commands/sources.d.ts.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/webhooks.d.ts +13 -0
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/index.js +66 -8
- package/dist/sdk/types.generated.d.ts +10 -7
- package/dist/sdk/types.generated.d.ts.map +1 -1
- package/dist/server/index.js +93 -20
- package/package.json +1 -1
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
* omni instances syncs cancel <id> <job-id>
|
|
23
23
|
*/
|
|
24
24
|
import { Command } from 'commander';
|
|
25
|
+
/**
|
|
26
|
+
* --clear-reply-filter on an instance that keeps its agent must not store null
|
|
27
|
+
* (reply-to-everything, #1248): swap in the documented default instead.
|
|
28
|
+
* Returns true when it did, so the caller can say so.
|
|
29
|
+
*/
|
|
30
|
+
export declare function defaultClearedReplyFilter(body: Record<string, unknown>, currentAgentId: () => Promise<string | null | undefined>): Promise<boolean>;
|
|
25
31
|
/** Mask a secret for display, matching the API's `get` shape (`xoxp-****9bdc`) */
|
|
26
32
|
declare function maskSecret(secret: string): string;
|
|
27
33
|
/** Copy of a request/response body safe to print: secret strings masked, `null` clears kept */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/commands/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/commands/instances.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;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,SAAS,GAAG,eAAe,GAAG,gBAAgB,CAAC,GACzF,MAAM,EAAE,CAcV;AAED,eAAO,MAAM,KAAK,yFAA0F,CAAC;AAE7G,wBAAsB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CA4E/E;AAMD,wBAAgB,oBAAoB,IAAI,OAAO,CA6J9C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwMpC,wBAAgB,mBAAmB,IAAI,OAAO,CAU7C"}
|
|
@@ -86,6 +86,19 @@ declare function buildUpdateSourcePatch(options: UpdateSourceOptions): Promise<U
|
|
|
86
86
|
declare function assertPairedSignatureOnCreate(signatureConfig: WebhookSignatureConfigBody | undefined, signatureSecret: string | undefined): void;
|
|
87
87
|
declare const WINDOW_SEMANTICS: readonly ["future_only", "includes_in_progress"];
|
|
88
88
|
declare const MUTATION_POLICIES: readonly ["same_id", "new_id"];
|
|
89
|
+
/** Names of stalled and poll-disabled sources (#1239/#1241), surfaced by `omni status` and `omni webhooks list`. */
|
|
90
|
+
export declare function sourceHealthAlerts(sources: Array<{
|
|
91
|
+
name: string;
|
|
92
|
+
livenessStatus?: string | null;
|
|
93
|
+
}>): {
|
|
94
|
+
stalled: string[];
|
|
95
|
+
pollDisabled: string[];
|
|
96
|
+
};
|
|
97
|
+
/** One-line banner for the alerts above; null when every source is fine. */
|
|
98
|
+
export declare function formatSourceHealthAlerts(alerts: {
|
|
99
|
+
stalled: string[];
|
|
100
|
+
pollDisabled: string[];
|
|
101
|
+
}): string | null;
|
|
89
102
|
export declare function createWebhooksCommand(): Command;
|
|
90
103
|
/** Test-only surface — not part of the CLI contract. */
|
|
91
104
|
export declare const __testables: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/commands/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,2GAA2G;AAC3G,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,qBAAsB,GAAG,MAAM,CAItE;AASD,UAAU,sBAAsB;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAcD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,sBAAsB,EAC/B,SAAS,GAAE,MAAM,OAAO,CAAC,MAAM,CAAuB,GACrD,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAqC7B;AAED,6FAA6F;AAC7F,iBAAS,oBAAoB,CAAC,OAAO,EAAE;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,0BAA0B,GAAG,SAAS,CAczC;AAoBD;;;;;;GAMG;AACH,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,2BAA2B,GAAG,SAAS,CA0BjG;AAED,UAAU,mBAAoB,SAAQ,sBAAsB;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OA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AC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyB9F;AAED;;;;;GAKG;AACH,iBAAS,6BAA6B,CACpC,eAAe,EAAE,0BAA0B,GAAG,SAAS,EACvD,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,IAAI,CAQN;AAID,QAAA,MAAM,gBAAgB,kDAAmD,CAAC;AAC1E,QAAA,MAAM,iBAAiB,gCAAiC,CAAC;AAuDzD,oHAAoH;AACpH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,GAAG;IACpG,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAKA;AAED,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,MAAM,GAAG,IAAI,CAS7G;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAkV/C;AAED,wDAAwD;AACxD,eAAO,MAAM,WAAW;;;;;;;;CAQvB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -42633,6 +42633,8 @@ async function processRow2(row, now, deps, stats) {
|
|
|
42633
42633
|
const silentMs = Math.max(0, now.getTime() - signal.at.getTime());
|
|
42634
42634
|
const overdue = silentMs > row.expectedIntervalSeconds * 1000;
|
|
42635
42635
|
const silentForSeconds = Math.round(silentMs / 1000);
|
|
42636
|
+
if (row.livenessStatus === "disabled")
|
|
42637
|
+
return;
|
|
42636
42638
|
if (overdue) {
|
|
42637
42639
|
if (row.livenessStatus === "stalled")
|
|
42638
42640
|
return;
|
|
@@ -42647,6 +42649,7 @@ async function processRow2(row, now, deps, stats) {
|
|
|
42647
42649
|
silentForSeconds,
|
|
42648
42650
|
stalledAt: now.getTime()
|
|
42649
42651
|
};
|
|
42652
|
+
deps.logger.warn("connector stalled", { sourceName: row.name, silentForSeconds });
|
|
42650
42653
|
await publishTransition(deps, "system.connector.stalled", { ...payload }, row);
|
|
42651
42654
|
stats.stalled += 1;
|
|
42652
42655
|
return;
|
|
@@ -42663,6 +42666,10 @@ async function processRow2(row, now, deps, stats) {
|
|
|
42663
42666
|
recoveredBy: signal.kind,
|
|
42664
42667
|
recoveredAt: now.getTime()
|
|
42665
42668
|
};
|
|
42669
|
+
deps.logger.info("connector recovered", {
|
|
42670
|
+
sourceName: row.name,
|
|
42671
|
+
stalledForSeconds: payload.stalledForSeconds
|
|
42672
|
+
});
|
|
42666
42673
|
await publishTransition(deps, "system.connector.recovered", { ...payload }, row);
|
|
42667
42674
|
stats.recovered += 1;
|
|
42668
42675
|
}
|
|
@@ -83274,7 +83281,7 @@ var init_schema2 = __esm(() => {
|
|
|
83274
83281
|
eventStageIdx: index("event_payloads_event_stage_idx").on(table3.eventId, table3.stage)
|
|
83275
83282
|
}));
|
|
83276
83283
|
webhookSignatureAlgorithms = ["hmac-sha256", "hmac-sha1", "token-match"];
|
|
83277
|
-
connectorLivenessStatuses = ["healthy", "stalled"];
|
|
83284
|
+
connectorLivenessStatuses = ["healthy", "stalled", "disabled"];
|
|
83278
83285
|
connectorWindowSemanticsValues = ["future_only", "includes_in_progress"];
|
|
83279
83286
|
connectorMutationPolicies = ["same_id", "new_id"];
|
|
83280
83287
|
webhookSources = pgTable("webhook_sources", {
|
|
@@ -115977,7 +115984,7 @@ var require_client2 = __commonJS((exports) => {
|
|
|
115977
115984
|
|
|
115978
115985
|
// ../../node_modules/.bun/@sentry+node-core@10.52.0+2c50d7e904f6cfd7/node_modules/@sentry/node-core/build/cjs/sdk/esmLoader.js
|
|
115979
115986
|
var require_esmLoader = __commonJS((exports) => {
|
|
115980
|
-
var __filename = "/home/runner/work/omni/omni
|
|
115987
|
+
var __filename = "/home/runner/work/omni/omni/node_modules/.bun/@sentry+node-core@10.52.0+2c50d7e904f6cfd7/node_modules/@sentry/node-core/build/cjs/sdk/esmLoader.js";
|
|
115981
115988
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
115982
115989
|
var core = require_cjs();
|
|
115983
115990
|
var importInTheMiddle = require_import_in_the_middle();
|
|
@@ -137453,7 +137460,7 @@ import { fileURLToPath } from "url";
|
|
|
137453
137460
|
// package.json
|
|
137454
137461
|
var package_default = {
|
|
137455
137462
|
name: "@automagik/omni",
|
|
137456
|
-
version: "2.
|
|
137463
|
+
version: "2.260923.2",
|
|
137457
137464
|
repository: {
|
|
137458
137465
|
type: "git",
|
|
137459
137466
|
url: "git+https://github.com/automagik-dev/omni.git",
|
|
@@ -146021,7 +146028,7 @@ function setBool(body, key, val) {
|
|
|
146021
146028
|
body[key] = false;
|
|
146022
146029
|
}
|
|
146023
146030
|
function applyAgentFields(body, opts) {
|
|
146024
|
-
setVal(body, "agentId", opts.agentFkId);
|
|
146031
|
+
setVal(body, "agentId", opts.agentFkId ?? opts.agent);
|
|
146025
146032
|
if (opts.agentTimeout !== undefined)
|
|
146026
146033
|
body.agentTimeout = opts.agentTimeout;
|
|
146027
146034
|
if (Array.isArray(opts.agentErrorMessage)) {
|
|
@@ -146055,6 +146062,15 @@ function applyReplyFilter(body, opts) {
|
|
|
146055
146062
|
}
|
|
146056
146063
|
body.agentReplyFilter = { mode: opts.replyFilterMode, conditions: cond };
|
|
146057
146064
|
}
|
|
146065
|
+
var DEFAULT_AGENT_REPLY_FILTER = { mode: "all", conditions: { onDm: true } };
|
|
146066
|
+
async function defaultClearedReplyFilter(body, currentAgentId) {
|
|
146067
|
+
if (body.agentReplyFilter !== null || body.agentId === null)
|
|
146068
|
+
return false;
|
|
146069
|
+
if (!(body.agentId ?? await currentAgentId()))
|
|
146070
|
+
return false;
|
|
146071
|
+
body.agentReplyFilter = DEFAULT_AGENT_REPLY_FILTER;
|
|
146072
|
+
return true;
|
|
146073
|
+
}
|
|
146058
146074
|
function applyFormatFields(body, opts) {
|
|
146059
146075
|
setBool(body, "enableAutoSplit", opts.enableAutoSplit);
|
|
146060
146076
|
setVal(body, "messageFormatMode", opts.messageFormatMode);
|
|
@@ -146644,7 +146660,7 @@ function createInstancesCommand() {
|
|
|
146644
146660
|
throw new Error(err2?.error?.message ?? `HTTP ${response.status}`);
|
|
146645
146661
|
}
|
|
146646
146662
|
}
|
|
146647
|
-
instances.command("update <id>").description("Update an instance (supports all API fields)").option("--name <name>", "Instance name").option("--is-default", "Set as default instance for channel").option("--no-is-default", "Unset as default instance for channel").option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear). When assigning an agent on an instance with no reply filter, the filter defaults to {mode:"all", onDm:true} so messages are dispatched instead of silently dropped (omni#443).').option("--agent-provider <id>", "Removed: set the provider on the agent (omni agents update <agentId> --agent-provider)").option("--agent <id>", 'Agent ID (use "null" to clear)').option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v4) => Number.parseInt(v4, 10)).option("--agent-error-message <text>", 'Customer-facing reply when agent dispatch fails; repeat the flag for multiple variants (one is picked at random per failure). Use "null" to clear; falls back to OMNI_AGENT_DISPATCH_ERROR_MESSAGE env, then built-in default', (value, previous = []) => [...previous, value]).option("--agent-stream-mode", "Enable streaming responses").option("--no-agent-stream-mode", "Disable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs (requires --reply-filter-mode filtered)").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--clear-reply-filter",
|
|
146663
|
+
instances.command("update <id>").description("Update an instance (supports all API fields)").option("--name <name>", "Instance name").option("--is-default", "Set as default instance for channel").option("--no-is-default", "Unset as default instance for channel").option("--agent-fk-id <uuid>", 'Agent FK UUID (references agents table, use "null" to clear). When assigning an agent on an instance with no reply filter, the filter defaults to {mode:"all", onDm:true} so messages are dispatched instead of silently dropped (omni#443).').option("--agent-provider <id>", "Removed: set the provider on the agent (omni agents update <agentId> --agent-provider)").option("--agent <id>", 'Agent ID (use "null" to clear)').option("--agent-type <type>", "Agent type: agent, team, or workflow").option("--agent-timeout <seconds>", "Agent timeout in seconds", (v4) => Number.parseInt(v4, 10)).option("--agent-error-message <text>", 'Customer-facing reply when agent dispatch fails; repeat the flag for multiple variants (one is picked at random per failure). Use "null" to clear; falls back to OMNI_AGENT_DISPATCH_ERROR_MESSAGE env, then built-in default', (value, previous = []) => [...previous, value]).option("--agent-stream-mode", "Enable streaming responses").option("--no-agent-stream-mode", "Disable streaming responses").option("--agent-session-strategy <strategy>", "Session strategy: per_user, per_chat, per_user_per_chat").option("--agent-prefix-sender-name", "Prefix messages with sender name").option("--no-agent-prefix-sender-name", "Disable sender name prefix").option("--agent-wait-for-media", "Wait for media processing before dispatch").option("--no-agent-wait-for-media", "Dispatch immediately without waiting for media").option("--agent-send-media-path", "Include file path in formatted media text").option("--no-agent-send-media-path", "Exclude file path from formatted media text").option("--agent-send-media-path-types <types>", "Content types that receive file path (comma-separated: image,video,document)").option("--reply-filter-mode <mode>", "Reply filter: all or filtered").option("--reply-on-dm", "Reply to DMs (requires --reply-filter-mode filtered)").option("--no-reply-on-dm", "Ignore DMs").option("--reply-on-mention", "Reply when @mentioned").option("--no-reply-on-mention", "Ignore @mentions").option("--reply-on-reply", "Reply when message is reply to bot").option("--no-reply-on-reply", "Ignore replies").option("--reply-on-name", "Reply when bot name appears in text").option("--no-reply-on-name", "Ignore name matches").option("--reply-name-patterns <patterns>", "Custom name patterns (comma-separated)").option("--clear-reply-filter", 'Remove reply filter (set to null). On an instance that keeps its agent, resets to the default {mode:"all", onDm:true} instead').option("--enable-auto-split", "Split responses on double newlines").option("--no-enable-auto-split", "Disable auto-split").option("--message-format-mode <mode>", "Format mode: convert or passthrough").option("--debounce-mode <mode>", "Debounce mode: disabled, fixed, randomized, or presence").option("--debounce-min <ms>", "Minimum debounce delay in ms", (v4) => Number.parseInt(v4, 10)).option("--debounce-max <ms>", "Maximum debounce delay in ms", (v4) => Number.parseInt(v4, 10)).option("--debounce-restart-on-typing", "Restart debounce timer on typing").option("--no-debounce-restart-on-typing", "Do not restart debounce on typing").option("--debounce-group <ms>", 'Group chat debounce in ms (use "null" to inherit)', (v4) => v4 === "null" ? null : Number.parseInt(v4, 10)).option("--debounce-max-wait <ms>", 'Presence-mode hard cap in ms (use "null" to inherit)', (v4) => v4 === "null" ? null : Number.parseInt(v4, 10)).option("--split-delay-mode <mode>", "Split delay mode: disabled, fixed, or randomized").option("--split-delay-fixed <ms>", "Fixed delay between split chunks in ms", (v4) => Number.parseInt(v4, 10)).option("--split-delay-min <ms>", "Minimum delay between split chunks in ms", (v4) => Number.parseInt(v4, 10)).option("--split-delay-max <ms>", "Maximum delay between split chunks in ms", (v4) => Number.parseInt(v4, 10)).option("--agent-gate", "Enable LLM response gate").option("--no-agent-gate", "Disable LLM response gate").option("--agent-gate-model <model>", 'Model for response gate (use "null" for default)').option("--agent-gate-prompt <prompt>", 'Custom gate prompt (use "null" for default)').option("--tts-voice <id>", 'ElevenLabs voice ID (use "null" to clear)').option("--tts-model <id>", 'ElevenLabs model ID (use "null" to clear)').option("--read-receipts <mode>", "Read receipts mode: on, off, or exclude-self").addOption(new Option("--history-identity <identity>", "WhatsApp pairing identity: desktop (macOS Desktop + group history, fuller sync) or web (Ubuntu/Chrome). Applies on next pairing (default: desktop)").choices(["desktop", "web"])).option("--sync-full-history", "WhatsApp: request full message history on connect (default: off)").option("--no-sync-full-history", "WhatsApp: do not request full message history on connect").option("--access-mode <mode>", "Access mode: disabled, blocklist, or allowlist").option("--reaction-ack <mode>", "Reaction ack mode (on|off)").option("--reaction-ack-emoji <json>", "Per-channel emoji map as JSON").option("--ack-timeout <ms>", "Ack timeout in milliseconds", (v4) => Number.parseInt(v4, 10)).option("--agent-stalled-timeout-ms <ms>", "Idle threshold in ms before the internal turn.stalled event fires (no channel message is ever sent)", (v4) => Number.parseInt(v4, 10)).option("--token <token>", "Generic bot token (auto-resolves to channel-specific field)").option("--telegram-token <token>", 'Telegram bot token (use "null" to clear)').option("--discord-token <token>", 'Discord bot token (use "null" to clear)').option("--slack-bot-token <token>", 'Slack bot token (use "null" to clear)').option("--slack-app-token <token>", 'Slack app token (use "null" to clear)').option("--slack-user-token <token>", 'Slack user token xoxp-... (use "null" to clear)').option("--slack-user-token-env <VAR>", "Read the Slack user token from environment variable VAR").option("--slack-user-token-stdin", "Read the Slack user token from stdin").option("--slack-auth-mode <mode>", 'Slack identity: bot or user (use "null" to clear)').option("--twilio-account-sid <sid>", 'Twilio Account SID (use "null" to clear)').option("--twilio-auth-token <token>", 'Twilio Auth Token (use "null" to clear)').option("--twilio-from <address>", 'Twilio WhatsApp sender address (use "null" to clear)').option("--twilio-messaging-service-sid <sid>", 'Twilio Messaging Service SID (use "null" to clear)').option("--twilio-status-callback-url <url>", 'Twilio outbound status callback URL (use "null" to clear)').option("--twilio-webhook-url <url>", 'Public Twilio webhook URL for signature validation (use "null" to clear)').option("--twilio-validate-signature", "Validate X-Twilio-Signature on webhooks").option("--no-twilio-validate-signature", "Disable X-Twilio-Signature validation").option("--gupshup-handoff-options <json>", 'Gupshup HANDOFF routing defaults and customerFields template (JSON object, use "null" to clear). The plugin reads it at connect: restart the instance for the change to take effect').option("--trigger-events <events>", 'Trigger events (comma-separated, use "null" to clear)').option("--profile-name <name>", "Update WhatsApp display name (push name)").option("--bridge-tmux-session <name>", 'Tmux session name the genie bridge spawns into for this instance (propagated as GENIE_TMUX_SESSION via NATS). Use "null" to clear.').option("--require-genie-signature", "Require a verified X-Genie-Signature on requests targeting this instance. Bearer-only requests will be rejected with 401.").option("--no-require-genie-signature", "Allow bearer-only requests targeting this instance (default).").option("--allow-first-party", "Process (do not drop) inbound messages whose sender matches another active instance owner. Lets this instance reply to messages from your own personal number.").option("--no-allow-first-party", "Drop inbound messages whose sender matches another active instance owner (default, loop-protection).").option("--force", "Proceed even if another active Slack instance uses the same app token").action(async (rawId, options) => {
|
|
146648
146664
|
const client = getClient();
|
|
146649
146665
|
if (options.agentProvider !== undefined) {
|
|
146650
146666
|
error("instances update no longer accepts --agent-provider: the provider belongs to the agent. Use `omni agents update <agentId> --agent-provider <providerId>`.");
|
|
@@ -146659,6 +146675,9 @@ function createInstancesCommand() {
|
|
|
146659
146675
|
setVal(body, "name", options.name);
|
|
146660
146676
|
setBool(body, "isDefault", options.isDefault);
|
|
146661
146677
|
setBool(body, "force", options.force);
|
|
146678
|
+
if (await defaultClearedReplyFilter(body, async () => (await client.instances.get(id)).agentId)) {
|
|
146679
|
+
warn('Instance has an agent: --clear-reply-filter stored the default reply filter {mode:"all", onDm:true}, which replies to every message. To stop replies use --agent null or --reply-filter-mode filtered.');
|
|
146680
|
+
}
|
|
146662
146681
|
if (Object.keys(body).length > 0) {
|
|
146663
146682
|
await client.instances.update(id, body);
|
|
146664
146683
|
success(`Instance updated: ${id}`, maskSecretFields(body));
|
|
@@ -151946,6 +151965,21 @@ function buildLifecycleUpdates(options3) {
|
|
|
151946
151965
|
updates.mutationPolicy = mutationPolicy;
|
|
151947
151966
|
return updates;
|
|
151948
151967
|
}
|
|
151968
|
+
function sourceHealthAlerts(sources) {
|
|
151969
|
+
return {
|
|
151970
|
+
stalled: sources.filter((s2) => s2.livenessStatus === "stalled").map((s2) => s2.name),
|
|
151971
|
+
pollDisabled: sources.filter((s2) => s2.livenessStatus === "disabled").map((s2) => s2.name)
|
|
151972
|
+
};
|
|
151973
|
+
}
|
|
151974
|
+
function formatSourceHealthAlerts(alerts) {
|
|
151975
|
+
const parts = [];
|
|
151976
|
+
if (alerts.stalled.length > 0)
|
|
151977
|
+
parts.push(`${alerts.stalled.length} stalled (${alerts.stalled.join(", ")})`);
|
|
151978
|
+
if (alerts.pollDisabled.length > 0) {
|
|
151979
|
+
parts.push(`${alerts.pollDisabled.length} poll disabled, no OMNI_POLL_COMMAND_DIR (${alerts.pollDisabled.join(", ")})`);
|
|
151980
|
+
}
|
|
151981
|
+
return parts.length > 0 ? `Sources: ${parts.join("; ")}` : null;
|
|
151982
|
+
}
|
|
151949
151983
|
function createWebhooksCommand() {
|
|
151950
151984
|
const webhooks = new Command("webhooks").description("Manage webhook sources");
|
|
151951
151985
|
webhooks.command("list").description("List webhook sources").option("--enabled", "Show only enabled sources").option("--disabled", "Show only disabled sources").action(async (options3) => {
|
|
@@ -151963,11 +151997,14 @@ function createWebhooksCommand() {
|
|
|
151963
151997
|
id: w.id,
|
|
151964
151998
|
name: w.name,
|
|
151965
151999
|
enabled: w.enabled ? "yes" : "no",
|
|
151966
|
-
health: w.livenessStatus ?? "-",
|
|
152000
|
+
health: w.livenessStatus === "disabled" ? "poll disabled" : w.livenessStatus ?? "-",
|
|
151967
152001
|
cadence: w.expectedIntervalSeconds != null ? `${w.expectedIntervalSeconds}s` : "-",
|
|
151968
152002
|
url: ingressUrl(w.name),
|
|
151969
152003
|
createdAt: w.createdAt
|
|
151970
152004
|
}));
|
|
152005
|
+
const banner = formatSourceHealthAlerts(sourceHealthAlerts(result));
|
|
152006
|
+
if (banner)
|
|
152007
|
+
warn(banner);
|
|
151971
152008
|
list(items, { emptyMessage: "No webhook sources found." });
|
|
151972
152009
|
} catch (err2) {
|
|
151973
152010
|
const message2 = err2 instanceof Error ? err2.message : "Unknown error";
|
|
@@ -152319,7 +152356,14 @@ function createSourcesCommand() {
|
|
|
152319
152356
|
error(`Failed to add source: ${err2 instanceof Error ? err2.message : String(err2)}`);
|
|
152320
152357
|
}
|
|
152321
152358
|
});
|
|
152322
|
-
sources.command("add-poll <name>").description("Create a supervised pull connector: omni runs --command every --interval seconds and ingests each JSON stdout line (command must live inside the API host OMNI_POLL_COMMAND_DIR)").requiredOption("--command <path>", "Executable to run (no shell, no arguments)").requiredOption("--interval <seconds>", "Seconds between runs (min 10); failures back off exponentially").requiredOption("--emit-type <type>", "Event type for each stdout line (custom.*)").option("--dedup-key <template>", "Idempotency key template, e.g. '{payload.message_id}'").option("--expected-interval <seconds>", "Liveness window (default: 2x --interval)").option("--env <KEY=VALUE...>", "Environment variables for the command (repeatable)").option("--description <desc>", "Description").
|
|
152359
|
+
sources.command("add-poll <name>").description("Create a supervised pull connector: omni runs --command every --interval seconds and ingests each JSON stdout line (command must live inside the API host OMNI_POLL_COMMAND_DIR)").requiredOption("--command <path>", "Executable to run (no shell, no arguments)").requiredOption("--interval <seconds>", "Seconds between runs (min 10); failures back off exponentially up to --max-backoff").option("--max-backoff <seconds>", "Backoff ceiling in seconds (default 3600)").requiredOption("--emit-type <type>", "Event type for each stdout line (custom.*)").option("--dedup-key <template>", "Idempotency key template, e.g. '{payload.message_id}'").option("--expected-interval <seconds>", "Liveness window (default: 2x --interval)").option("--env <KEY=VALUE...>", "Environment variables for the command (repeatable)").option("--description <desc>", "Description").addHelpText("after", `
|
|
152360
|
+
Exit codes:
|
|
152361
|
+
exit 0 success: each JSON stdout line is ingested (empty stdout = nothing new)
|
|
152362
|
+
exit != 0 failure, EVEN WITH EMPTY STDOUT, and backs off. Shell pipelines often
|
|
152363
|
+
exit 1 on "no matches" (grep, set -o pipefail): end them with "|| true"
|
|
152364
|
+
or "exit 0" when an empty result is normal.
|
|
152365
|
+
Config errors (OMNI_POLL_COMMAND_DIR unset, command missing) retry every min(interval, 300s)
|
|
152366
|
+
without backing off.`).action(async (name, options3) => {
|
|
152323
152367
|
const intervalSeconds = Number(options3.interval);
|
|
152324
152368
|
const env2 = Object.fromEntries((options3.env ?? []).map((pair) => [pair.slice(0, pair.indexOf("=")), pair.slice(pair.indexOf("=") + 1)]));
|
|
152325
152369
|
try {
|
|
@@ -152335,7 +152379,8 @@ function createSourcesCommand() {
|
|
|
152335
152379
|
intervalSeconds,
|
|
152336
152380
|
emitType: options3.emitType,
|
|
152337
152381
|
...options3.dedupKey && { dedupKeyTemplate: options3.dedupKey },
|
|
152338
|
-
...options3.env && { env: env2 }
|
|
152382
|
+
...options3.env && { env: env2 },
|
|
152383
|
+
...options3.maxBackoff && { maxBackoffSeconds: Number(options3.maxBackoff) }
|
|
152339
152384
|
}
|
|
152340
152385
|
})
|
|
152341
152386
|
});
|
|
@@ -152643,6 +152688,18 @@ async function validateAuthKey(statusInfo, client) {
|
|
|
152643
152688
|
statusInfo.keyValid = false;
|
|
152644
152689
|
}
|
|
152645
152690
|
}
|
|
152691
|
+
async function checkSourceHealth(statusInfo, client) {
|
|
152692
|
+
try {
|
|
152693
|
+
const alerts = sourceHealthAlerts(await client.webhooks.listSources({ enabled: true }));
|
|
152694
|
+
if (alerts.stalled.length > 0)
|
|
152695
|
+
statusInfo.stalledSources = alerts.stalled;
|
|
152696
|
+
if (alerts.pollDisabled.length > 0)
|
|
152697
|
+
statusInfo.pollDisabledSources = alerts.pollDisabled;
|
|
152698
|
+
const banner = formatSourceHealthAlerts(alerts);
|
|
152699
|
+
if (banner)
|
|
152700
|
+
warn(banner);
|
|
152701
|
+
} catch {}
|
|
152702
|
+
}
|
|
152646
152703
|
async function collectStatusInfo() {
|
|
152647
152704
|
const config2 = loadConfig();
|
|
152648
152705
|
const isAuthenticated = hasAuth();
|
|
@@ -152659,6 +152716,7 @@ async function collectStatusInfo() {
|
|
|
152659
152716
|
const client = getOptionalClient();
|
|
152660
152717
|
if (client) {
|
|
152661
152718
|
await validateAuthKey(statusInfo, client);
|
|
152719
|
+
await checkSourceHealth(statusInfo, client);
|
|
152662
152720
|
}
|
|
152663
152721
|
}
|
|
152664
152722
|
const processes = await getProcessStatus();
|
|
@@ -4970,7 +4970,7 @@ export interface components {
|
|
|
4970
4970
|
* @description Liveness state; null = unsupervised. Transitions emit system.connector.* events
|
|
4971
4971
|
* @enum {string|null}
|
|
4972
4972
|
*/
|
|
4973
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
4973
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
4974
4974
|
/**
|
|
4975
4975
|
* Format: date-time
|
|
4976
4976
|
* @description When the cadence was (re)declared
|
|
@@ -5059,6 +5059,7 @@ export interface components {
|
|
|
5059
5059
|
env?: {
|
|
5060
5060
|
[key: string]: string;
|
|
5061
5061
|
};
|
|
5062
|
+
maxBackoffSeconds?: number;
|
|
5062
5063
|
} | null;
|
|
5063
5064
|
/**
|
|
5064
5065
|
* @description Whether enabled
|
|
@@ -5130,7 +5131,7 @@ export interface components {
|
|
|
5130
5131
|
* @description Status before this heartbeat (a stalled source recovers on the next sweep tick)
|
|
5131
5132
|
* @enum {string|null}
|
|
5132
5133
|
*/
|
|
5133
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
5134
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
5134
5135
|
/** @description Declared cadence, if any */
|
|
5135
5136
|
expectedIntervalSeconds: number | null;
|
|
5136
5137
|
};
|
|
@@ -14034,7 +14035,7 @@ export interface operations {
|
|
|
14034
14035
|
* @description Liveness state; null = unsupervised. Transitions emit system.connector.* events
|
|
14035
14036
|
* @enum {string|null}
|
|
14036
14037
|
*/
|
|
14037
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
14038
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
14038
14039
|
/**
|
|
14039
14040
|
* Format: date-time
|
|
14040
14041
|
* @description When the cadence was (re)declared
|
|
@@ -14137,6 +14138,7 @@ export interface operations {
|
|
|
14137
14138
|
env?: {
|
|
14138
14139
|
[key: string]: string;
|
|
14139
14140
|
};
|
|
14141
|
+
maxBackoffSeconds?: number;
|
|
14140
14142
|
} | null;
|
|
14141
14143
|
/**
|
|
14142
14144
|
* @description Whether enabled
|
|
@@ -14242,7 +14244,7 @@ export interface operations {
|
|
|
14242
14244
|
* @description Liveness state; null = unsupervised. Transitions emit system.connector.* events
|
|
14243
14245
|
* @enum {string|null}
|
|
14244
14246
|
*/
|
|
14245
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
14247
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
14246
14248
|
/**
|
|
14247
14249
|
* Format: date-time
|
|
14248
14250
|
* @description When the cadence was (re)declared
|
|
@@ -14394,7 +14396,7 @@ export interface operations {
|
|
|
14394
14396
|
* @description Liveness state; null = unsupervised. Transitions emit system.connector.* events
|
|
14395
14397
|
* @enum {string|null}
|
|
14396
14398
|
*/
|
|
14397
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
14399
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
14398
14400
|
/**
|
|
14399
14401
|
* Format: date-time
|
|
14400
14402
|
* @description When the cadence was (re)declared
|
|
@@ -14568,6 +14570,7 @@ export interface operations {
|
|
|
14568
14570
|
env?: {
|
|
14569
14571
|
[key: string]: string;
|
|
14570
14572
|
};
|
|
14573
|
+
maxBackoffSeconds?: number;
|
|
14571
14574
|
} | null;
|
|
14572
14575
|
/**
|
|
14573
14576
|
* @description Whether enabled
|
|
@@ -14673,7 +14676,7 @@ export interface operations {
|
|
|
14673
14676
|
* @description Liveness state; null = unsupervised. Transitions emit system.connector.* events
|
|
14674
14677
|
* @enum {string|null}
|
|
14675
14678
|
*/
|
|
14676
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
14679
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
14677
14680
|
/**
|
|
14678
14681
|
* Format: date-time
|
|
14679
14682
|
* @description When the cadence was (re)declared
|
|
@@ -14826,7 +14829,7 @@ export interface operations {
|
|
|
14826
14829
|
* @description Status before this heartbeat (a stalled source recovers on the next sweep tick)
|
|
14827
14830
|
* @enum {string|null}
|
|
14828
14831
|
*/
|
|
14829
|
-
livenessStatus: "healthy" | "stalled" | null;
|
|
14832
|
+
livenessStatus: "healthy" | "stalled" | "disabled" | null;
|
|
14830
14833
|
/** @description Declared cadence, if any */
|
|
14831
14834
|
expectedIntervalSeconds: number | null;
|
|
14832
14835
|
};
|