@vellumai/credential-executor 0.10.2-dev.202606250318.5e7cfb0 → 0.10.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/node_modules/@vellumai/service-contracts/package.json +0 -1
- package/node_modules/@vellumai/service-contracts/src/index.ts +0 -1
- package/package.json +1 -1
- package/node_modules/@vellumai/service-contracts/src/__tests__/channels.test.ts +0 -28
- package/node_modules/@vellumai/service-contracts/src/channels.ts +0 -41
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
|
|
3
|
-
import { CHANNEL_IDS, isChannelId } from "../channels.js";
|
|
4
|
-
|
|
5
|
-
describe("isChannelId", () => {
|
|
6
|
-
test("accepts every canonical channel id", () => {
|
|
7
|
-
for (const id of CHANNEL_IDS) {
|
|
8
|
-
expect(isChannelId(id)).toBe(true);
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test("includes the internal channels no external surface ingresses", () => {
|
|
13
|
-
// `platform` (control plane) and `vellum` (native app) are part of the
|
|
14
|
-
// canonical vocabulary even though the gateway never ingresses them. The
|
|
15
|
-
// gateway's narrower list is a compile-time-asserted subset of this set,
|
|
16
|
-
// so these must remain canonical for that assertion to mean anything.
|
|
17
|
-
expect(isChannelId("platform")).toBe(true);
|
|
18
|
-
expect(isChannelId("vellum")).toBe(true);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
test("rejects unknown strings and non-string values", () => {
|
|
22
|
-
expect(isChannelId("discord")).toBe(false);
|
|
23
|
-
expect(isChannelId("")).toBe(false);
|
|
24
|
-
expect(isChannelId(undefined)).toBe(false);
|
|
25
|
-
expect(isChannelId(null)).toBe(false);
|
|
26
|
-
expect(isChannelId(42)).toBe(false);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical channel-id vocabulary shared between the assistant daemon and the
|
|
3
|
-
* gateway.
|
|
4
|
-
*
|
|
5
|
-
* A "channel" is an external messaging surface an actor can reach the
|
|
6
|
-
* assistant through (Slack, Telegram, WhatsApp, phone, …) plus a couple of
|
|
7
|
-
* internal ids (`vellum` for native app conversations, `platform` for the
|
|
8
|
-
* internal control plane). This is the single source of truth for that set:
|
|
9
|
-
* the assistant adopts it wholesale as its `ChannelId`, and the gateway
|
|
10
|
-
* asserts its own (narrower) inbound list is a subset of it so the two sides
|
|
11
|
-
* cannot silently drift.
|
|
12
|
-
*
|
|
13
|
-
* Both packages depend on `@vellumai/service-contracts`, so hoisting the set
|
|
14
|
-
* here (rather than maintaining a copy on each side) means adding or renaming
|
|
15
|
-
* a channel happens in exactly one place.
|
|
16
|
-
*
|
|
17
|
-
* Note that a consumer may legitimately handle only a *subset* of these — the
|
|
18
|
-
* gateway, for example, never ingresses `platform`. Use a local list guarded
|
|
19
|
-
* by `satisfies readonly ChannelId[]` for those cases rather than redefining
|
|
20
|
-
* the union.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export const CHANNEL_IDS = [
|
|
24
|
-
"telegram",
|
|
25
|
-
"phone",
|
|
26
|
-
"vellum",
|
|
27
|
-
"whatsapp",
|
|
28
|
-
"slack",
|
|
29
|
-
"email",
|
|
30
|
-
"platform",
|
|
31
|
-
"a2a",
|
|
32
|
-
] as const;
|
|
33
|
-
|
|
34
|
-
export type ChannelId = (typeof CHANNEL_IDS)[number];
|
|
35
|
-
|
|
36
|
-
export function isChannelId(value: unknown): value is ChannelId {
|
|
37
|
-
return (
|
|
38
|
-
typeof value === "string" &&
|
|
39
|
-
(CHANNEL_IDS as readonly string[]).includes(value)
|
|
40
|
-
);
|
|
41
|
-
}
|