@automagik/omni 2.260902.1 → 2.260902.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/send.d.ts +5 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/webhooks.d.ts +8 -0
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/index.js +16 -6
- package/dist/sdk/types.generated.d.ts +44 -2
- package/dist/sdk/types.generated.d.ts.map +1 -1
- package/dist/server/index.js +299 -272
- package/package.json +1 -1
package/dist/commands/send.d.ts
CHANGED
|
@@ -7,5 +7,10 @@
|
|
|
7
7
|
* etc.
|
|
8
8
|
*/
|
|
9
9
|
import { Command } from 'commander';
|
|
10
|
+
import { z } from 'zod';
|
|
10
11
|
export declare function createSendCommand(): Command;
|
|
12
|
+
/** Test-only surface — not part of the CLI contract. */
|
|
13
|
+
export declare const __testables: {
|
|
14
|
+
sentBySchema: z.ZodEnum<["agent", "user"]>;
|
|
15
|
+
};
|
|
11
16
|
//# sourceMappingURL=send.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"send.d.ts","sourceRoot":"","sources":["../../src/commands/send.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6dxB,wBAAgB,iBAAiB,IAAI,OAAO,CAiG3C;AAED,wDAAwD;AACxD,eAAO,MAAM,WAAW;;CAAmB,CAAC"}
|
|
@@ -32,11 +32,19 @@ declare function buildSignatureConfig(options: {
|
|
|
32
32
|
signatureHeader?: string;
|
|
33
33
|
signaturePrefix?: string;
|
|
34
34
|
}): WebhookSignatureConfigBody | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Create-only pairing: the API rejects a `signatureConfig` without a secret
|
|
37
|
+
* and a secret without a config (CreateWebhookSourceSchema). Fail here, before
|
|
38
|
+
* the request, the same way the secret bounds do. Update is deliberately not
|
|
39
|
+
* covered — a secret-only update rotates the secret against the stored config.
|
|
40
|
+
*/
|
|
41
|
+
declare function assertPairedSignatureOnCreate(signatureConfig: WebhookSignatureConfigBody | undefined, signatureSecret: string | undefined): void;
|
|
35
42
|
export declare function createWebhooksCommand(): Command;
|
|
36
43
|
/** Test-only surface — not part of the CLI contract. */
|
|
37
44
|
export declare const __testables: {
|
|
38
45
|
resolveSignatureSecret: typeof resolveSignatureSecret;
|
|
39
46
|
buildSignatureConfig: typeof buildSignatureConfig;
|
|
47
|
+
assertPairedSignatureOnCreate: typeof assertPairedSignatureOnCreate;
|
|
40
48
|
};
|
|
41
49
|
export {};
|
|
42
50
|
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/commands/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,UAAU,sBAAsB;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAcD;;;;;GAKG;AACH,iBAAe,sBAAsB,CACnC,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;AAED,wBAAgB,qBAAqB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/commands/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC,UAAU,sBAAsB;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAcD;;;;;GAKG;AACH,iBAAe,sBAAsB,CACnC,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;AAED;;;;;GAKG;AACH,iBAAS,6BAA6B,CACpC,eAAe,EAAE,0BAA0B,GAAG,SAAS,EACvD,eAAe,EAAE,MAAM,GAAG,SAAS,GAClC,IAAI,CAQN;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CA2P/C;AAED,wDAAwD;AACxD,eAAO,MAAM,WAAW;;;;CAAkF,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -128289,7 +128289,7 @@ import { fileURLToPath } from "url";
|
|
|
128289
128289
|
// package.json
|
|
128290
128290
|
var package_default = {
|
|
128291
128291
|
name: "@automagik/omni",
|
|
128292
|
-
version: "2.260902.
|
|
128292
|
+
version: "2.260902.2",
|
|
128293
128293
|
description: "LLM-optimized CLI for Omni",
|
|
128294
128294
|
type: "module",
|
|
128295
128295
|
bin: {
|
|
@@ -140103,6 +140103,7 @@ function createSeeCommand() {
|
|
|
140103
140103
|
import { existsSync as existsSync17, readFileSync as readFileSync14 } from "fs";
|
|
140104
140104
|
import { basename as basename5, extname as extname5 } from "path";
|
|
140105
140105
|
init_source();
|
|
140106
|
+
init_zod();
|
|
140106
140107
|
init_config();
|
|
140107
140108
|
init_output();
|
|
140108
140109
|
init_output();
|
|
@@ -140127,15 +140128,15 @@ function parseLoadingMessages(value) {
|
|
|
140127
140128
|
const messages3 = value?.split(",").map((item) => item.trim()).filter(Boolean);
|
|
140128
140129
|
return messages3?.length ? messages3 : undefined;
|
|
140129
140130
|
}
|
|
140130
|
-
var
|
|
140131
|
+
var sentBySchema = exports_external.enum(["agent", "user"]);
|
|
140131
140132
|
function resolveSentBy(value) {
|
|
140132
140133
|
if (value === undefined)
|
|
140133
140134
|
return;
|
|
140134
|
-
const
|
|
140135
|
-
if (!
|
|
140136
|
-
error(`Invalid --sent-by: ${value}`, { validValues:
|
|
140135
|
+
const parsed = sentBySchema.safeParse(value);
|
|
140136
|
+
if (!parsed.success) {
|
|
140137
|
+
error(`Invalid --sent-by: ${value}`, { validValues: sentBySchema.options });
|
|
140137
140138
|
}
|
|
140138
|
-
return
|
|
140139
|
+
return parsed.data;
|
|
140139
140140
|
}
|
|
140140
140141
|
var messageSenders = {
|
|
140141
140142
|
async text(client, instanceId, options3) {
|
|
@@ -142670,6 +142671,14 @@ function buildSignatureConfig(options3) {
|
|
|
142670
142671
|
}
|
|
142671
142672
|
return { algorithm, header: signatureHeader, prefix: signaturePrefix };
|
|
142672
142673
|
}
|
|
142674
|
+
function assertPairedSignatureOnCreate(signatureConfig, signatureSecret) {
|
|
142675
|
+
if (signatureConfig === undefined === (signatureSecret === undefined))
|
|
142676
|
+
return;
|
|
142677
|
+
if (signatureConfig === undefined) {
|
|
142678
|
+
throw new Error(`a signature secret (${SECRET_SOURCE_FLAGS}) requires --signature-algorithm and --signature-header`);
|
|
142679
|
+
}
|
|
142680
|
+
throw new Error(`--signature-algorithm and --signature-header require a signature secret (${SECRET_SOURCE_FLAGS})`);
|
|
142681
|
+
}
|
|
142673
142682
|
function createWebhooksCommand() {
|
|
142674
142683
|
const webhooks = new Command("webhooks").description("Manage webhook sources");
|
|
142675
142684
|
webhooks.command("list").description("List webhook sources").option("--enabled", "Show only enabled sources").option("--disabled", "Show only disabled sources").action(async (options3) => {
|
|
@@ -142719,6 +142728,7 @@ function createWebhooksCommand() {
|
|
|
142719
142728
|
}
|
|
142720
142729
|
const signatureConfig = buildSignatureConfig(options3);
|
|
142721
142730
|
const signatureSecret = await resolveSignatureSecret(options3);
|
|
142731
|
+
assertPairedSignatureOnCreate(signatureConfig, signatureSecret);
|
|
142722
142732
|
const source = await client.webhooks.createSource({
|
|
142723
142733
|
name: options3.name,
|
|
142724
142734
|
description: options3.description,
|
|
@@ -970,7 +970,7 @@ export interface paths {
|
|
|
970
970
|
put?: never;
|
|
971
971
|
/**
|
|
972
972
|
* Receive webhook
|
|
973
|
-
* @description Receive webhook from external system. Creates a custom event.
|
|
973
|
+
* @description Receive webhook from external system. Creates a custom event. An empty body is accepted as an empty payload; a non-empty body that is not a JSON object (malformed, array, scalar) is rejected.
|
|
974
974
|
*/
|
|
975
975
|
post: operations["receiveWebhook"];
|
|
976
976
|
delete?: never;
|
|
@@ -990,7 +990,7 @@ export interface paths {
|
|
|
990
990
|
put?: never;
|
|
991
991
|
/**
|
|
992
992
|
* Public webhook ingress
|
|
993
|
-
* @description Auth-exempt receiver for third-party webhook senders. Requires the source to have a signature configuration; the request is verified against it (HMAC over the raw body, or token match) before any event is published. Unknown, disabled, unconfigured, or badly signed requests all return the same 401.
|
|
993
|
+
* @description Auth-exempt receiver for third-party webhook senders. Requires the source to have a signature configuration; the request is verified against it (HMAC over the raw body, or token match) before any event is published. Unknown, disabled, unconfigured, or badly signed requests all return the same 401. A non-empty body that is not a JSON object (malformed, array, scalar) is rejected with 400.
|
|
994
994
|
*/
|
|
995
995
|
post: operations["receiveWebhookIngress"];
|
|
996
996
|
delete?: never;
|
|
@@ -10653,6 +10653,27 @@ export interface operations {
|
|
|
10653
10653
|
};
|
|
10654
10654
|
};
|
|
10655
10655
|
};
|
|
10656
|
+
/** @description Body is not a JSON object */
|
|
10657
|
+
400: {
|
|
10658
|
+
headers: {
|
|
10659
|
+
[name: string]: unknown;
|
|
10660
|
+
};
|
|
10661
|
+
content: {
|
|
10662
|
+
"application/json": {
|
|
10663
|
+
error: {
|
|
10664
|
+
/**
|
|
10665
|
+
* @description Error code
|
|
10666
|
+
* @example NOT_FOUND
|
|
10667
|
+
*/
|
|
10668
|
+
code: string;
|
|
10669
|
+
/** @description Human-readable error message */
|
|
10670
|
+
message: string;
|
|
10671
|
+
/** @description Additional error details */
|
|
10672
|
+
details?: unknown;
|
|
10673
|
+
};
|
|
10674
|
+
};
|
|
10675
|
+
};
|
|
10676
|
+
};
|
|
10656
10677
|
};
|
|
10657
10678
|
};
|
|
10658
10679
|
receiveWebhookIngress: {
|
|
@@ -10691,6 +10712,27 @@ export interface operations {
|
|
|
10691
10712
|
};
|
|
10692
10713
|
};
|
|
10693
10714
|
};
|
|
10715
|
+
/** @description Body is not a JSON object */
|
|
10716
|
+
400: {
|
|
10717
|
+
headers: {
|
|
10718
|
+
[name: string]: unknown;
|
|
10719
|
+
};
|
|
10720
|
+
content: {
|
|
10721
|
+
"application/json": {
|
|
10722
|
+
error: {
|
|
10723
|
+
/**
|
|
10724
|
+
* @description Error code
|
|
10725
|
+
* @example NOT_FOUND
|
|
10726
|
+
*/
|
|
10727
|
+
code: string;
|
|
10728
|
+
/** @description Human-readable error message */
|
|
10729
|
+
message: string;
|
|
10730
|
+
/** @description Additional error details */
|
|
10731
|
+
details?: unknown;
|
|
10732
|
+
};
|
|
10733
|
+
};
|
|
10734
|
+
};
|
|
10735
|
+
};
|
|
10694
10736
|
/** @description Verification failed */
|
|
10695
10737
|
401: {
|
|
10696
10738
|
headers: {
|