@vellumai/assistant 0.8.9 → 0.8.10-dev.202606092334.09948c8
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/AGENTS.md +1 -1
- package/examples/plugins/echo/README.md +3 -3
- package/node_modules/@vellumai/skill-host-contracts/src/tool-types.ts +2 -0
- package/openapi.yaml +38 -12
- package/package.json +1 -1
- package/scripts/sync-llm-catalog.ts +2 -0
- package/src/__tests__/agent-loop-exit-reason.test.ts +21 -15
- package/src/__tests__/approval-cascade.test.ts +1 -0
- package/src/__tests__/build-persisted-content.test.ts +75 -1
- package/src/__tests__/compaction-events.test.ts +1 -0
- package/src/__tests__/config-managed-gemini-defaults.test.ts +2 -46
- package/src/__tests__/context-overflow-reducer.test.ts +264 -124
- package/src/__tests__/context-window-manager-overflow-rung.test.ts +351 -0
- package/src/__tests__/conversation-abort-tool-results.test.ts +1 -0
- package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +11 -0
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +90 -49
- package/src/__tests__/conversation-agent-loop.test.ts +113 -64
- package/src/__tests__/conversation-confirmation-signals.test.ts +1 -0
- package/src/__tests__/conversation-fork-crud.test.ts +110 -0
- package/src/__tests__/conversation-process-callsite.test.ts +1 -0
- package/src/__tests__/conversation-provider-retry-repair.test.ts +48 -48
- package/src/__tests__/conversation-queue.test.ts +1 -0
- package/src/__tests__/conversation-runtime-assembly.test.ts +119 -8
- package/src/__tests__/conversation-slash-queue.test.ts +1 -0
- package/src/__tests__/conversation-slash-unknown.test.ts +1 -0
- package/src/__tests__/conversation-speed-override.test.ts +1 -0
- package/src/__tests__/conversation-surfaces-app-control.test.ts +4 -1
- package/src/__tests__/conversation-tool-setup-app-refresh.test.ts +91 -142
- package/src/__tests__/conversation-tool-setup-skill-attribution.test.ts +116 -0
- package/src/__tests__/conversation-tool-setup-test-helpers.ts +98 -0
- package/src/__tests__/conversation-workspace-cache-state.test.ts +1 -0
- package/src/__tests__/conversation-workspace-injection.test.ts +1 -0
- package/src/__tests__/conversation-workspace-tool-tracking.test.ts +1 -0
- package/src/__tests__/corrected-target.test.ts +93 -0
- package/src/__tests__/credential-execution-feature-gates.test.ts +3 -5
- package/src/__tests__/credential-security-invariants.test.ts +1 -0
- package/src/__tests__/embedding-managed-proxy-selection.test.ts +6 -40
- package/src/__tests__/external-plugin-loader.test.ts +0 -1
- package/src/__tests__/guardian-routing-invariants.test.ts +91 -0
- package/src/__tests__/history-repair-hook.test.ts +2 -0
- package/src/__tests__/host-app-control-proxy.test.ts +45 -0
- package/src/__tests__/llm-catalog-parity.test.ts +4 -0
- package/src/__tests__/memory-retrieval-hook.test.ts +29 -15
- package/src/__tests__/notification-decision-strategy.test.ts +3 -3
- package/src/__tests__/persistence-secret-redaction.test.ts +78 -0
- package/src/__tests__/plugin-bootstrap.test.ts +82 -73
- package/src/__tests__/plugin-tool-contribution.test.ts +7 -4
- package/src/__tests__/plugin-types.test.ts +0 -8
- package/src/__tests__/provider-catalog-visibility.test.ts +1 -9
- package/src/__tests__/retry-thinking-adaptive-only.test.ts +245 -0
- package/src/__tests__/server-history-render.test.ts +39 -0
- package/src/__tests__/skills.test.ts +123 -0
- package/src/__tests__/title-generate-hook.test.ts +2 -0
- package/src/__tests__/tool-audit-listener.test.ts +51 -0
- package/src/__tests__/tool-executor-lifecycle-events.test.ts +32 -0
- package/src/__tests__/tool-start-timestamp.test.ts +218 -0
- package/src/agent/loop.ts +26 -39
- package/src/api/events/tool-result.ts +9 -0
- package/src/api/events/tool-use-start.ts +7 -0
- package/src/api/responses/conversation-message.ts +91 -14
- package/src/approvals/guardian-request-resolvers.ts +26 -0
- package/src/cli/commands/channel-verification-sessions.ts +6 -6
- package/src/cli/commands/inference-providers.ts +0 -8
- package/src/cli/commands/plugins.ts +2 -2
- package/src/cli/lib/__tests__/install-from-github.test.ts +174 -18
- package/src/cli/lib/__tests__/plugin-catalog-cache.test.ts +1 -1
- package/src/cli/lib/__tests__/plugin-details.test.ts +1 -1
- package/src/cli/lib/__tests__/plugin-marketplace.test.ts +1 -1
- package/src/cli/lib/__tests__/search-plugins.test.ts +11 -11
- package/src/cli/lib/install-from-github.ts +130 -19
- package/src/cli/lib/plugin-catalog-cache.ts +1 -1
- package/src/cli/lib/plugin-details.ts +4 -4
- package/src/cli/lib/plugin-marketplace.ts +2 -2
- package/src/cli/lib/search-plugins.ts +6 -6
- package/src/config/bundled-skills/skill-management/SKILL.md +89 -1
- package/src/config/env-registry.ts +12 -0
- package/src/config/feature-flag-registry.json +0 -80
- package/src/config/loader.ts +5 -22
- package/src/config/seed-inference-profiles.ts +1 -1
- package/src/config/skills.ts +101 -47
- package/src/context/strip-injections.ts +7 -4
- package/src/daemon/conversation-agent-loop-handlers.ts +102 -6
- package/src/daemon/conversation-agent-loop.ts +126 -270
- package/src/daemon/conversation-runtime-assembly.ts +44 -8
- package/src/daemon/conversation-tool-setup.ts +9 -1
- package/src/daemon/conversation.ts +13 -0
- package/src/daemon/external-plugins-bootstrap.ts +33 -87
- package/src/daemon/handlers/config-channels.ts +11 -2
- package/src/daemon/handlers/shared.ts +9 -1
- package/src/daemon/handlers/skills.ts +6 -2
- package/src/daemon/host-app-control-proxy.ts +72 -57
- package/src/daemon/message-protocol.ts +0 -7
- package/src/daemon/message-types/skills.ts +4 -0
- package/src/events/tool-audit-listener.ts +7 -1
- package/src/memory/__tests__/tool-invocation-test-helpers.ts +69 -0
- package/src/memory/conversation-crud.ts +44 -1
- package/src/memory/db-init.ts +4 -0
- package/src/memory/embedding-backend.ts +5 -22
- package/src/memory/memory-retrospective-startup-cleanup.ts +1 -1
- package/src/memory/migrations/275-tool-invocations-add-skill-id.test.ts +81 -0
- package/src/memory/migrations/275-tool-invocations-add-skill-id.ts +20 -0
- package/src/memory/migrations/276-tool-invocations-created-at-id-index.test.ts +68 -0
- package/src/memory/migrations/276-tool-invocations-created-at-id-index.ts +20 -0
- package/src/memory/migrations/index.ts +2 -0
- package/src/memory/schema/conversations.ts +3 -0
- package/src/memory/tool-execution-events-store.test.ts +162 -0
- package/src/memory/tool-execution-events-store.ts +73 -0
- package/src/memory/tool-usage-store.ts +4 -3
- package/src/memory/v2/__tests__/injected-block-slugs.test.ts +51 -0
- package/src/memory/v2/activation-store.ts +50 -1
- package/src/memory/v2/injected-block-slugs.ts +30 -0
- package/src/notifications/__tests__/copy-composer.test.ts +244 -0
- package/src/notifications/access-request-copy.ts +298 -0
- package/src/notifications/adapters/slack.ts +3 -3
- package/src/notifications/adapters/telegram.ts +2 -1
- package/src/notifications/copy-composer.ts +49 -267
- package/src/notifications/decision-engine.ts +16 -35
- package/src/notifications/home-feed-side-effect.ts +1 -6
- package/src/platform/client.ts +1 -3
- package/src/platform/feature-gate.ts +3 -12
- package/src/plugin-api/constants.ts +2 -0
- package/src/plugin-api/index.ts +37 -6
- package/src/plugin-api/types.ts +75 -0
- package/src/plugins/defaults/compaction/compact.ts +39 -1
- package/src/plugins/defaults/compaction/context-overflow-reducer.ts +240 -32
- package/src/plugins/defaults/compaction/corrected-target.ts +53 -0
- package/src/plugins/defaults/compaction/window-manager.ts +195 -1
- package/src/plugins/defaults/index.ts +24 -0
- package/src/plugins/defaults/memory-retrieval/hooks/post-compact.ts +76 -112
- package/src/plugins/defaults/memory-retrieval/hooks/{user-prompt-submit-temp.ts → user-prompt-submit.ts} +36 -67
- package/src/plugins/defaults/memory-retrieval/package.json +14 -0
- package/src/plugins/external-api.ts +1 -1
- package/src/plugins/types.ts +5 -51
- package/src/providers/inference/__tests__/base-url-route-validation.test.ts +1 -2
- package/src/providers/model-catalog.ts +57 -1
- package/src/providers/registry.ts +0 -8
- package/src/providers/retry.ts +35 -7
- package/src/runtime/routes/__tests__/acp-routes.test.ts +151 -0
- package/src/runtime/routes/__tests__/inference-provider-connection-routes.test.ts +0 -62
- package/src/runtime/routes/__tests__/plugins-routes.test.ts +4 -4
- package/src/runtime/routes/acp-routes.test.ts +106 -0
- package/src/runtime/routes/acp-routes.ts +248 -2
- package/src/runtime/routes/browser-tabs-routes.ts +1 -1
- package/src/runtime/routes/channel-verification-routes.ts +14 -5
- package/src/runtime/routes/chatgpt-subscription-auth-routes.ts +0 -14
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +33 -34
- package/src/runtime/routes/inference-provider-connection-routes.ts +0 -45
- package/src/runtime/routes/plugins-routes.ts +3 -3
- package/src/runtime/verification-outbound-actions.ts +147 -2
- package/src/runtime/verification-templates.ts +29 -3
- package/src/telemetry/types.ts +25 -1
- package/src/telemetry/usage-telemetry-reporter.test.ts +141 -7
- package/src/telemetry/usage-telemetry-reporter.ts +63 -7
- package/src/tools/executor.ts +4 -1
- package/src/tools/skills/load.ts +11 -6
- package/src/tools/terminal/safe-env.ts +1 -0
- package/src/tools/types.ts +10 -0
- package/src/__tests__/plugin-skill-contribution.test.ts +0 -355
- package/src/daemon/message-types/browser.ts +0 -10
- package/src/notifications/__tests__/emit-signal-home-feed.test.ts +0 -187
- package/src/plugins/plugin-skill-contributions.ts +0 -292
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
|
|
14
|
-
import { isAssistantFeatureFlagEnabled } from "../../config/assistant-feature-flags.js";
|
|
15
|
-
import { getConfigReadOnly } from "../../config/loader.js";
|
|
16
14
|
import { getDb } from "../../memory/db-connection.js";
|
|
17
15
|
import {
|
|
18
16
|
createConnection,
|
|
@@ -29,18 +27,8 @@ import {
|
|
|
29
27
|
import { setSecureKeyAsync } from "../../security/secure-keys.js";
|
|
30
28
|
import { getLogger } from "../../util/logger.js";
|
|
31
29
|
import { ACTOR_PRINCIPALS } from "../auth/route-policy.js";
|
|
32
|
-
import { BadRequestError } from "./errors.js";
|
|
33
30
|
import type { RouteDefinition, RouteHandlerArgs } from "./types.js";
|
|
34
31
|
|
|
35
|
-
function requireFeatureFlag() {
|
|
36
|
-
const config = getConfigReadOnly();
|
|
37
|
-
if (!isAssistantFeatureFlagEnabled("chatgpt-subscription-auth", config)) {
|
|
38
|
-
throw new BadRequestError(
|
|
39
|
-
"ChatGPT subscription auth is not enabled for this assistant.",
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
32
|
const log = getLogger("chatgpt-subscription-auth");
|
|
45
33
|
|
|
46
34
|
// ---------------------------------------------------------------------------
|
|
@@ -87,7 +75,6 @@ function cleanupExpiredEntries(): void {
|
|
|
87
75
|
// ---------------------------------------------------------------------------
|
|
88
76
|
|
|
89
77
|
async function handleStartAuth(_args: RouteHandlerArgs) {
|
|
90
|
-
requireFeatureFlag();
|
|
91
78
|
cleanupExpiredEntries();
|
|
92
79
|
|
|
93
80
|
const codeVerifier = generateCodeVerifier();
|
|
@@ -115,7 +102,6 @@ async function handleStartAuth(_args: RouteHandlerArgs) {
|
|
|
115
102
|
}
|
|
116
103
|
|
|
117
104
|
async function handleExchange(args: RouteHandlerArgs) {
|
|
118
|
-
requireFeatureFlag();
|
|
119
105
|
const { code, state } = args.body as { code: string; state: string };
|
|
120
106
|
|
|
121
107
|
const pending = pendingAuths.get(state);
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
findByInviteCodeHash,
|
|
24
24
|
findByInviteCodeHashAnyChannel,
|
|
25
25
|
} from "../../../memory/invite-store.js";
|
|
26
|
-
import { MESSAGE_PREVIEW_MAX_LENGTH } from "../../../notifications/copy
|
|
26
|
+
import { MESSAGE_PREVIEW_MAX_LENGTH } from "../../../notifications/access-request-copy.js";
|
|
27
27
|
import { resolveGuardianName } from "../../../prompts/user-reference.js";
|
|
28
28
|
import { getLogger } from "../../../util/logger.js";
|
|
29
29
|
import { truncate } from "../../../util/truncate.js";
|
|
@@ -332,12 +332,12 @@ export async function enforceIngressAcl(
|
|
|
332
332
|
|
|
333
333
|
return {
|
|
334
334
|
resolvedMember: null,
|
|
335
|
-
earlyResponse:
|
|
335
|
+
earlyResponse: {
|
|
336
336
|
accepted: true,
|
|
337
337
|
denied: true,
|
|
338
338
|
reason: "verification_challenge_sent",
|
|
339
339
|
verificationSessionId: slackVerifyResult.sessionId,
|
|
340
|
-
}
|
|
340
|
+
},
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -375,12 +375,12 @@ export async function enforceIngressAcl(
|
|
|
375
375
|
|
|
376
376
|
return {
|
|
377
377
|
resolvedMember: null,
|
|
378
|
-
earlyResponse:
|
|
378
|
+
earlyResponse: {
|
|
379
379
|
accepted: true,
|
|
380
380
|
denied: true,
|
|
381
381
|
reason: "verification_challenge_sent",
|
|
382
382
|
verificationSessionId: emailVerifyResult.sessionId,
|
|
383
|
-
}
|
|
383
|
+
},
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
}
|
|
@@ -438,14 +438,14 @@ export async function enforceIngressAcl(
|
|
|
438
438
|
|
|
439
439
|
return {
|
|
440
440
|
resolvedMember: null,
|
|
441
|
-
earlyResponse:
|
|
441
|
+
earlyResponse: {
|
|
442
442
|
accepted: true,
|
|
443
443
|
denied: true,
|
|
444
444
|
reason: "not_a_member",
|
|
445
445
|
// Include reply text so the gateway can deliver directly when
|
|
446
446
|
// callback delivery failed (e.g. signing-key mismatch → 401).
|
|
447
447
|
...(!replyDelivered && { replyText }),
|
|
448
|
-
}
|
|
448
|
+
},
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
451
|
}
|
|
@@ -610,12 +610,12 @@ export async function enforceIngressAcl(
|
|
|
610
610
|
|
|
611
611
|
return {
|
|
612
612
|
resolvedMember,
|
|
613
|
-
earlyResponse:
|
|
613
|
+
earlyResponse: {
|
|
614
614
|
accepted: true,
|
|
615
615
|
denied: true,
|
|
616
616
|
reason: "verification_challenge_sent",
|
|
617
617
|
verificationSessionId: slackVerifyResult.sessionId,
|
|
618
|
-
}
|
|
618
|
+
},
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
621
|
}
|
|
@@ -682,12 +682,12 @@ export async function enforceIngressAcl(
|
|
|
682
682
|
}
|
|
683
683
|
return {
|
|
684
684
|
resolvedMember,
|
|
685
|
-
earlyResponse:
|
|
685
|
+
earlyResponse: {
|
|
686
686
|
accepted: true,
|
|
687
687
|
denied: true,
|
|
688
688
|
reason: `member_${channelStatusToMemberStatus(resolvedMember.channel.status)}`,
|
|
689
689
|
...(!inactiveReplyDelivered && { replyText: inactiveReplyText }),
|
|
690
|
-
}
|
|
690
|
+
},
|
|
691
691
|
};
|
|
692
692
|
}
|
|
693
693
|
}
|
|
@@ -722,15 +722,14 @@ export async function enforceIngressAcl(
|
|
|
722
722
|
}
|
|
723
723
|
return {
|
|
724
724
|
resolvedMember,
|
|
725
|
-
earlyResponse:
|
|
725
|
+
earlyResponse: {
|
|
726
726
|
accepted: true,
|
|
727
727
|
denied: true,
|
|
728
728
|
reason: "policy_deny",
|
|
729
729
|
...(!denyReplyDelivered && { replyText: denyReplyText }),
|
|
730
|
-
}
|
|
730
|
+
},
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
|
-
|
|
734
733
|
}
|
|
735
734
|
}
|
|
736
735
|
|
|
@@ -786,11 +785,11 @@ async function handleInviteTokenIntercept(params: {
|
|
|
786
785
|
);
|
|
787
786
|
|
|
788
787
|
if (dedupResult.duplicate) {
|
|
789
|
-
return
|
|
788
|
+
return {
|
|
790
789
|
accepted: true,
|
|
791
790
|
duplicate: true,
|
|
792
791
|
eventId: dedupResult.eventId,
|
|
793
|
-
}
|
|
792
|
+
};
|
|
794
793
|
}
|
|
795
794
|
|
|
796
795
|
const outcome = redeemInvite({
|
|
@@ -835,11 +834,11 @@ async function handleInviteTokenIntercept(params: {
|
|
|
835
834
|
}
|
|
836
835
|
}
|
|
837
836
|
markProcessed(dedupResult.eventId);
|
|
838
|
-
return
|
|
837
|
+
return {
|
|
839
838
|
accepted: true,
|
|
840
839
|
eventId: dedupResult.eventId,
|
|
841
840
|
inviteRedemption: "already_member",
|
|
842
|
-
}
|
|
841
|
+
};
|
|
843
842
|
}
|
|
844
843
|
|
|
845
844
|
const replyText = getInviteRedemptionReply(outcome);
|
|
@@ -861,22 +860,22 @@ async function handleInviteTokenIntercept(params: {
|
|
|
861
860
|
|
|
862
861
|
if (outcome.ok && outcome.type === "redeemed") {
|
|
863
862
|
markProcessed(dedupResult.eventId);
|
|
864
|
-
return
|
|
863
|
+
return {
|
|
865
864
|
accepted: true,
|
|
866
865
|
eventId: dedupResult.eventId,
|
|
867
866
|
inviteRedemption: "redeemed",
|
|
868
867
|
memberId: outcome.memberId,
|
|
869
|
-
}
|
|
868
|
+
};
|
|
870
869
|
}
|
|
871
870
|
|
|
872
871
|
// Failed redemption — inform the user and deny
|
|
873
872
|
markProcessed(dedupResult.eventId);
|
|
874
|
-
return
|
|
873
|
+
return {
|
|
875
874
|
accepted: true,
|
|
876
875
|
eventId: dedupResult.eventId,
|
|
877
876
|
denied: true,
|
|
878
877
|
inviteRedemption: outcome.reason,
|
|
879
|
-
}
|
|
878
|
+
};
|
|
880
879
|
}
|
|
881
880
|
|
|
882
881
|
// ---------------------------------------------------------------------------
|
|
@@ -942,11 +941,11 @@ async function handleInviteCodeIntercept(params: {
|
|
|
942
941
|
);
|
|
943
942
|
|
|
944
943
|
if (dedupResult.duplicate) {
|
|
945
|
-
return
|
|
944
|
+
return {
|
|
946
945
|
accepted: true,
|
|
947
946
|
duplicate: true,
|
|
948
947
|
eventId: dedupResult.eventId,
|
|
949
|
-
}
|
|
948
|
+
};
|
|
950
949
|
}
|
|
951
950
|
|
|
952
951
|
const mismatchReply = "This invite is not valid for this channel.";
|
|
@@ -965,12 +964,12 @@ async function handleInviteCodeIntercept(params: {
|
|
|
965
964
|
}
|
|
966
965
|
}
|
|
967
966
|
markProcessed(dedupResult.eventId);
|
|
968
|
-
return
|
|
967
|
+
return {
|
|
969
968
|
accepted: true,
|
|
970
969
|
eventId: dedupResult.eventId,
|
|
971
970
|
denied: true,
|
|
972
971
|
inviteRedemption: "channel_mismatch",
|
|
973
|
-
}
|
|
972
|
+
};
|
|
974
973
|
}
|
|
975
974
|
return null;
|
|
976
975
|
}
|
|
@@ -988,11 +987,11 @@ async function handleInviteCodeIntercept(params: {
|
|
|
988
987
|
);
|
|
989
988
|
|
|
990
989
|
if (dedupResult.duplicate) {
|
|
991
|
-
return
|
|
990
|
+
return {
|
|
992
991
|
accepted: true,
|
|
993
992
|
duplicate: true,
|
|
994
993
|
eventId: dedupResult.eventId,
|
|
995
|
-
}
|
|
994
|
+
};
|
|
996
995
|
}
|
|
997
996
|
|
|
998
997
|
let outcome: ReturnType<typeof redeemInviteByCode>;
|
|
@@ -1046,11 +1045,11 @@ async function handleInviteCodeIntercept(params: {
|
|
|
1046
1045
|
}
|
|
1047
1046
|
}
|
|
1048
1047
|
markProcessed(dedupResult.eventId);
|
|
1049
|
-
return
|
|
1048
|
+
return {
|
|
1050
1049
|
accepted: true,
|
|
1051
1050
|
eventId: dedupResult.eventId,
|
|
1052
1051
|
inviteRedemption: "already_member",
|
|
1053
|
-
}
|
|
1052
|
+
};
|
|
1054
1053
|
}
|
|
1055
1054
|
|
|
1056
1055
|
const replyText = getInviteRedemptionReply(outcome);
|
|
@@ -1072,22 +1071,22 @@ async function handleInviteCodeIntercept(params: {
|
|
|
1072
1071
|
|
|
1073
1072
|
if (outcome.ok && outcome.type === "redeemed") {
|
|
1074
1073
|
markProcessed(dedupResult.eventId);
|
|
1075
|
-
return
|
|
1074
|
+
return {
|
|
1076
1075
|
accepted: true,
|
|
1077
1076
|
eventId: dedupResult.eventId,
|
|
1078
1077
|
inviteRedemption: "redeemed",
|
|
1079
1078
|
memberId: outcome.memberId,
|
|
1080
|
-
}
|
|
1079
|
+
};
|
|
1081
1080
|
}
|
|
1082
1081
|
|
|
1083
1082
|
// Failed redemption (expired, revoked, etc.) — inform and deny
|
|
1084
1083
|
markProcessed(dedupResult.eventId);
|
|
1085
|
-
return
|
|
1084
|
+
return {
|
|
1086
1085
|
accepted: true,
|
|
1087
1086
|
eventId: dedupResult.eventId,
|
|
1088
1087
|
denied: true,
|
|
1089
1088
|
inviteRedemption: !outcome.ok ? outcome.reason : undefined,
|
|
1090
|
-
}
|
|
1089
|
+
};
|
|
1091
1090
|
}
|
|
1092
1091
|
|
|
1093
1092
|
// ---------------------------------------------------------------------------
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
import { z } from "zod";
|
|
12
12
|
|
|
13
|
-
import { isAssistantFeatureFlagEnabled } from "../../config/assistant-feature-flags.js";
|
|
14
13
|
import { getConfigReadOnly } from "../../config/loader.js";
|
|
15
14
|
import { getDb } from "../../memory/db-connection.js";
|
|
16
15
|
import {
|
|
@@ -44,22 +43,6 @@ import type { RouteDefinition, RouteHandlerArgs } from "./types.js";
|
|
|
44
43
|
// ---------------------------------------------------------------------------
|
|
45
44
|
|
|
46
45
|
const providerConnectionResponseSchema = ProviderConnectionSchema;
|
|
47
|
-
const OPENAI_COMPATIBLE_ENDPOINTS_FLAG = "openai-compatible-endpoints";
|
|
48
|
-
|
|
49
|
-
function openAICompatibleEndpointsEnabled(): boolean {
|
|
50
|
-
return isAssistantFeatureFlagEnabled(
|
|
51
|
-
OPENAI_COMPATIBLE_ENDPOINTS_FLAG,
|
|
52
|
-
getConfigReadOnly(),
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function rejectDisabledOpenAICompatibleProvider(provider: string): void {
|
|
57
|
-
if (provider !== "openai-compatible") return;
|
|
58
|
-
if (openAICompatibleEndpointsEnabled()) return;
|
|
59
|
-
throw new BadRequestError(
|
|
60
|
-
"OpenAI-compatible endpoints are disabled. Enable the openai-compatible-endpoints feature flag to configure this provider.",
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
46
|
|
|
64
47
|
// ---------------------------------------------------------------------------
|
|
65
48
|
// Custom provider field parsing (openai-compatible base_url + models)
|
|
@@ -170,18 +153,10 @@ async function parseCustomProviderFields(
|
|
|
170
153
|
|
|
171
154
|
function handleListConnections({ queryParams = {} }: RouteHandlerArgs) {
|
|
172
155
|
const provider = queryParams.provider;
|
|
173
|
-
if (provider) rejectDisabledOpenAICompatibleProvider(provider);
|
|
174
156
|
const connections = listConnections(
|
|
175
157
|
getDb(),
|
|
176
158
|
provider ? { provider } : undefined,
|
|
177
159
|
);
|
|
178
|
-
if (!openAICompatibleEndpointsEnabled()) {
|
|
179
|
-
return {
|
|
180
|
-
connections: connections.filter(
|
|
181
|
-
(conn) => conn.provider !== "openai-compatible",
|
|
182
|
-
),
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
160
|
return { connections };
|
|
186
161
|
}
|
|
187
162
|
|
|
@@ -191,12 +166,6 @@ function handleGetConnection({ pathParams = {} }: RouteHandlerArgs) {
|
|
|
191
166
|
|
|
192
167
|
const conn = getConnection(getDb(), name);
|
|
193
168
|
if (!conn) throw new NotFoundError(`Connection "${name}" not found.`);
|
|
194
|
-
if (
|
|
195
|
-
conn.provider === "openai-compatible" &&
|
|
196
|
-
!openAICompatibleEndpointsEnabled()
|
|
197
|
-
) {
|
|
198
|
-
throw new NotFoundError(`Connection "${name}" not found.`);
|
|
199
|
-
}
|
|
200
169
|
|
|
201
170
|
return conn;
|
|
202
171
|
}
|
|
@@ -216,8 +185,6 @@ async function handleCreateConnection({ body = {} }: RouteHandlerArgs) {
|
|
|
216
185
|
`Invalid provider "${String(provider)}". Valid: ${VALID_CONNECTION_PROVIDERS.join(", ")}`,
|
|
217
186
|
);
|
|
218
187
|
}
|
|
219
|
-
rejectDisabledOpenAICompatibleProvider(providerResult.data);
|
|
220
|
-
|
|
221
188
|
const authResult = AuthSchema.safeParse(auth);
|
|
222
189
|
if (!authResult.success) {
|
|
223
190
|
throw new BadRequestError(`Invalid auth: ${authResult.error.message}`);
|
|
@@ -280,12 +247,6 @@ async function handleUpdateConnection({
|
|
|
280
247
|
|
|
281
248
|
const existing = getConnection(getDb(), name);
|
|
282
249
|
if (!existing) throw new NotFoundError(`Connection "${name}" not found.`);
|
|
283
|
-
if (
|
|
284
|
-
existing.provider === "openai-compatible" &&
|
|
285
|
-
!openAICompatibleEndpointsEnabled()
|
|
286
|
-
) {
|
|
287
|
-
throw new NotFoundError(`Connection "${name}" not found.`);
|
|
288
|
-
}
|
|
289
250
|
|
|
290
251
|
const auth = body.auth;
|
|
291
252
|
const authResult = AuthSchema.safeParse(auth);
|
|
@@ -355,12 +316,6 @@ function handleDeleteConnection({ pathParams = {} }: RouteHandlerArgs) {
|
|
|
355
316
|
if (!existing) {
|
|
356
317
|
throw new NotFoundError(`Connection "${name}" not found.`);
|
|
357
318
|
}
|
|
358
|
-
if (
|
|
359
|
-
existing.provider === "openai-compatible" &&
|
|
360
|
-
!openAICompatibleEndpointsEnabled()
|
|
361
|
-
) {
|
|
362
|
-
throw new NotFoundError(`Connection "${name}" not found.`);
|
|
363
|
-
}
|
|
364
319
|
|
|
365
320
|
// Managed connections are write-protected: `seedCanonicalConnections` would
|
|
366
321
|
// re-upsert them on the next daemon boot anyway, so a successful delete here
|
|
@@ -128,7 +128,7 @@ const pluginSearchMatchSchema = z.object({
|
|
|
128
128
|
path: z
|
|
129
129
|
.string()
|
|
130
130
|
.describe(
|
|
131
|
-
"Human-readable origin: a repo-relative path (`
|
|
131
|
+
"Human-readable origin: a repo-relative path (`plugins/<name>`) for first-party plugins or a `github:owner/repo@ref` locator for external ones.",
|
|
132
132
|
),
|
|
133
133
|
description: z
|
|
134
134
|
.string()
|
|
@@ -517,7 +517,7 @@ export const ROUTES: RouteDefinition[] = [
|
|
|
517
517
|
},
|
|
518
518
|
summary: "Search the plugin catalog",
|
|
519
519
|
description:
|
|
520
|
-
"List installable plugins from the canonical `vellum-ai/vellum-assistant` catalog at `
|
|
520
|
+
"List installable plugins from the canonical `vellum-ai/vellum-assistant` catalog at `plugins/`. The query is an ECMAScript regex matched case-insensitively against the directory name (e.g. `memory`, `^simple`). Empty query returns every entry. Mirrors the CLI's `assistant plugins search`.",
|
|
521
521
|
tags: ["plugins"],
|
|
522
522
|
queryParams: [
|
|
523
523
|
{
|
|
@@ -546,7 +546,7 @@ export const ROUTES: RouteDefinition[] = [
|
|
|
546
546
|
},
|
|
547
547
|
summary: "Install a plugin",
|
|
548
548
|
description:
|
|
549
|
-
"Install a plugin by name from the canonical source — a whitelisted `
|
|
549
|
+
"Install a plugin by name from the canonical source — a whitelisted `plugins/marketplace.json` entry, else the first-party `plugins/<name>/` convention. Always resolves against the curated default git ref (no caller-supplied ref): installing from an unreviewed revision would bypass the marketplace/first-party curation boundary and let attacker-controlled code be loaded. Materializes the plugin under `<workspaceDir>/plugins/<name>/`; the assistant must be restarted to load it. Mirrors the CLI's `assistant plugins install <name>`. An already-installed name without `force` returns 409; a name that resolves to nothing returns 404. Sibling to `POST /v1/skills/install`.",
|
|
550
550
|
tags: ["plugins"],
|
|
551
551
|
requestBody: pluginInstallRequestSchema,
|
|
552
552
|
responseBody: pluginInstallResponseSchema,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Shared outbound verification action logic.
|
|
3
3
|
*
|
|
4
4
|
* These pure functions encapsulate the business logic for starting, resending,
|
|
5
|
-
* and cancelling outbound verification flows (Telegram, voice, Slack).
|
|
5
|
+
* and cancelling outbound verification flows (Telegram, voice, Slack, email).
|
|
6
6
|
* They return transport-agnostic result objects and are consumed by both the
|
|
7
7
|
* message handler (config-channels.ts) and the HTTP route layer (channel-verification-routes.ts).
|
|
8
8
|
*/
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
updateSessionStatus,
|
|
27
27
|
} from "./channel-verification-service.js";
|
|
28
28
|
import {
|
|
29
|
+
composeVerificationEmail,
|
|
29
30
|
composeVerificationSlack,
|
|
30
31
|
composeVerificationTelegram,
|
|
31
32
|
GUARDIAN_VERIFY_TEMPLATE_KEYS,
|
|
@@ -52,6 +53,8 @@ export const DESTINATION_RATE_WINDOW_MS = 3_600_000;
|
|
|
52
53
|
/** Session TTL in seconds (matches challenge TTL of 10 minutes). */
|
|
53
54
|
const SESSION_TTL_SECONDS = 600;
|
|
54
55
|
|
|
56
|
+
const EMAIL_VERIFICATION_SUBJECT = "Vellum Assistant Guardian Verification";
|
|
57
|
+
|
|
55
58
|
// ---------------------------------------------------------------------------
|
|
56
59
|
// Telegram destination classification
|
|
57
60
|
// ---------------------------------------------------------------------------
|
|
@@ -122,6 +125,8 @@ interface OutboundActionResult {
|
|
|
122
125
|
* reach the gateway. The daemon HTTP route handler calls
|
|
123
126
|
* deliverVerificationSlack() after receiving this payload. */
|
|
124
127
|
_pendingSlackDm?: { userId: string; text: string; assistantId: string };
|
|
128
|
+
/** Internal: email delivery payload for the caller to dispatch (same pattern as Slack). */
|
|
129
|
+
_pendingEmail?: { to: string; text: string; subject: string; assistantId: string };
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
// ---------------------------------------------------------------------------
|
|
@@ -512,6 +517,80 @@ export function deliverVerificationSlack(
|
|
|
512
517
|
deliverVerificationSlackAsync(userId, text, assistantId);
|
|
513
518
|
}
|
|
514
519
|
|
|
520
|
+
// ---------------------------------------------------------------------------
|
|
521
|
+
// Email delivery helper
|
|
522
|
+
// ---------------------------------------------------------------------------
|
|
523
|
+
|
|
524
|
+
/**
|
|
525
|
+
* Deliver a verification email via the platform email send API.
|
|
526
|
+
* Fire-and-forget wrapper for use in the daemon process (HTTP route handlers).
|
|
527
|
+
*/
|
|
528
|
+
export function deliverVerificationEmail(
|
|
529
|
+
to: string,
|
|
530
|
+
text: string,
|
|
531
|
+
subject: string,
|
|
532
|
+
_assistantId: string,
|
|
533
|
+
): void {
|
|
534
|
+
(async () => {
|
|
535
|
+
try {
|
|
536
|
+
const { VellumPlatformClient } = await import(
|
|
537
|
+
"../platform/client.js"
|
|
538
|
+
);
|
|
539
|
+
const client = await VellumPlatformClient.create();
|
|
540
|
+
if (!client?.platformAssistantId) {
|
|
541
|
+
log.error("Cannot deliver verification email: platform client not configured");
|
|
542
|
+
return;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const listResponse = await client.fetch(
|
|
546
|
+
`/v1/assistants/${client.platformAssistantId}/email-addresses/`,
|
|
547
|
+
);
|
|
548
|
+
if (!listResponse.ok) {
|
|
549
|
+
log.error({ status: listResponse.status }, "Failed to list email addresses for verification");
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
552
|
+
const listData = (await listResponse.json()) as {
|
|
553
|
+
results: { address: string }[];
|
|
554
|
+
};
|
|
555
|
+
const addresses = listData.results ?? [];
|
|
556
|
+
if (addresses.length === 0) {
|
|
557
|
+
log.error("No email address registered — cannot deliver verification email");
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
const fromAddress = addresses[0].address;
|
|
561
|
+
|
|
562
|
+
const { markdownToEmailHtml } = await import(
|
|
563
|
+
"../email/html-renderer.js"
|
|
564
|
+
);
|
|
565
|
+
const html = markdownToEmailHtml(text);
|
|
566
|
+
|
|
567
|
+
const response = await client.fetch("/v1/runtime-proxy/email/send/", {
|
|
568
|
+
method: "POST",
|
|
569
|
+
headers: { "Content-Type": "application/json" },
|
|
570
|
+
body: JSON.stringify({
|
|
571
|
+
to: [to],
|
|
572
|
+
from_address: fromAddress,
|
|
573
|
+
text,
|
|
574
|
+
subject,
|
|
575
|
+
html,
|
|
576
|
+
}),
|
|
577
|
+
});
|
|
578
|
+
|
|
579
|
+
if (response.ok) {
|
|
580
|
+
log.info({ to }, "Verification email delivered");
|
|
581
|
+
} else {
|
|
582
|
+
const respBody = await response.json().catch(() => ({}));
|
|
583
|
+
log.error(
|
|
584
|
+
{ to, status: response.status, respBody },
|
|
585
|
+
"Failed to deliver verification email",
|
|
586
|
+
);
|
|
587
|
+
}
|
|
588
|
+
} catch (err) {
|
|
589
|
+
log.error({ err, to }, "Failed to deliver verification email");
|
|
590
|
+
}
|
|
591
|
+
})();
|
|
592
|
+
}
|
|
593
|
+
|
|
515
594
|
function startOutboundSlack(
|
|
516
595
|
destination: string | undefined,
|
|
517
596
|
assistantId: string,
|
|
@@ -644,13 +723,35 @@ function startOutboundEmail(
|
|
|
644
723
|
verificationPurpose: "guardian",
|
|
645
724
|
});
|
|
646
725
|
|
|
726
|
+
const emailBody = composeVerificationEmail(
|
|
727
|
+
GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_CHALLENGE_REQUEST,
|
|
728
|
+
{
|
|
729
|
+
code: sessionResult.secret,
|
|
730
|
+
expiresInMinutes: Math.floor(SESSION_TTL_SECONDS / 60),
|
|
731
|
+
},
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
const now = Date.now();
|
|
735
|
+
const nextResendAt = now + RESEND_COOLDOWN_MS;
|
|
736
|
+
const sendCount = 1;
|
|
737
|
+
|
|
738
|
+
updateSessionDelivery(sessionResult.sessionId, now, sendCount, nextResendAt);
|
|
739
|
+
|
|
647
740
|
return {
|
|
648
741
|
success: true,
|
|
649
742
|
verificationSessionId: sessionResult.sessionId,
|
|
650
743
|
secret: sessionResult.secret,
|
|
651
744
|
expiresAt: sessionResult.expiresAt,
|
|
745
|
+
nextResendAt,
|
|
746
|
+
sendCount,
|
|
652
747
|
channel,
|
|
653
748
|
originConversationId,
|
|
749
|
+
_pendingEmail: {
|
|
750
|
+
to: normalizedEmail,
|
|
751
|
+
text: emailBody,
|
|
752
|
+
subject: EMAIL_VERIFICATION_SUBJECT,
|
|
753
|
+
assistantId,
|
|
754
|
+
},
|
|
654
755
|
};
|
|
655
756
|
}
|
|
656
757
|
|
|
@@ -851,12 +952,56 @@ export function resendOutbound(
|
|
|
851
952
|
originConversationId,
|
|
852
953
|
_pendingSlackDm: { userId: destination, text: slackBody, assistantId },
|
|
853
954
|
};
|
|
955
|
+
} else if (channel === "email") {
|
|
956
|
+
const newSession = createOutboundSession({
|
|
957
|
+
channel,
|
|
958
|
+
expectedExternalUserId: destination,
|
|
959
|
+
expectedChatId: destination,
|
|
960
|
+
identityBindingStatus: "bound",
|
|
961
|
+
destinationAddress: destination,
|
|
962
|
+
verificationPurpose: "guardian",
|
|
963
|
+
});
|
|
964
|
+
|
|
965
|
+
const emailBody = composeVerificationEmail(
|
|
966
|
+
GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_RESEND,
|
|
967
|
+
{
|
|
968
|
+
code: newSession.secret,
|
|
969
|
+
expiresInMinutes: Math.floor(SESSION_TTL_SECONDS / 60),
|
|
970
|
+
},
|
|
971
|
+
);
|
|
972
|
+
|
|
973
|
+
const now = Date.now();
|
|
974
|
+
const newSendCount = currentSendCount + 1;
|
|
975
|
+
const nextResendAt = now + RESEND_COOLDOWN_MS;
|
|
976
|
+
|
|
977
|
+
updateSessionDelivery(
|
|
978
|
+
newSession.sessionId,
|
|
979
|
+
now,
|
|
980
|
+
newSendCount,
|
|
981
|
+
nextResendAt,
|
|
982
|
+
);
|
|
983
|
+
|
|
984
|
+
return {
|
|
985
|
+
success: true,
|
|
986
|
+
verificationSessionId: newSession.sessionId,
|
|
987
|
+
secret: newSession.secret,
|
|
988
|
+
nextResendAt,
|
|
989
|
+
sendCount: newSendCount,
|
|
990
|
+
channel,
|
|
991
|
+
originConversationId,
|
|
992
|
+
_pendingEmail: {
|
|
993
|
+
to: destination,
|
|
994
|
+
text: emailBody,
|
|
995
|
+
subject: EMAIL_VERIFICATION_SUBJECT,
|
|
996
|
+
assistantId,
|
|
997
|
+
},
|
|
998
|
+
};
|
|
854
999
|
}
|
|
855
1000
|
|
|
856
1001
|
return {
|
|
857
1002
|
success: false,
|
|
858
1003
|
error: "unsupported_channel",
|
|
859
|
-
message: `Resend is only supported for Telegram, phone, and
|
|
1004
|
+
message: `Resend is only supported for Telegram, phone, Slack, and email. Got: ${channel}`,
|
|
860
1005
|
channel,
|
|
861
1006
|
};
|
|
862
1007
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Template-only copy for outbound guardian verification messages (Telegram, Slack, and voice).
|
|
2
|
+
* Template-only copy for outbound guardian verification messages (Telegram, Slack, email, and voice).
|
|
3
3
|
*
|
|
4
4
|
* All outbound verification messages are composed from these templates
|
|
5
5
|
* to prevent free-form caller/user text injection. Only typed variables
|
|
@@ -26,6 +26,10 @@ export const GUARDIAN_VERIFY_TEMPLATE_KEYS = {
|
|
|
26
26
|
"guardian_verify.slack.trusted_contact_challenge",
|
|
27
27
|
/** Resend Slack DM verification for inbound trusted contact (includes the code). */
|
|
28
28
|
SLACK_TRUSTED_CONTACT_RESEND: "guardian_verify.slack.trusted_contact_resend",
|
|
29
|
+
/** Initial outbound email verification prompt (includes the code). */
|
|
30
|
+
EMAIL_CHALLENGE_REQUEST: "guardian_verify.email.challenge_request",
|
|
31
|
+
/** Resend email verification prompt (includes the code). */
|
|
32
|
+
EMAIL_RESEND: "guardian_verify.email.resend",
|
|
29
33
|
/** Outbound voice call intro prompt: asks guardian to enter verification code via keypad. */
|
|
30
34
|
VOICE_CALL_INTRO: "guardian_verify.voice.call_intro",
|
|
31
35
|
/** Voice retry prompt after an incorrect code entry. */
|
|
@@ -42,7 +46,7 @@ export const GUARDIAN_VERIFY_TEMPLATE_KEYS = {
|
|
|
42
46
|
CHANNEL_BOOTSTRAP_BOUND: "guardian_verify.channel.bootstrap_bound",
|
|
43
47
|
} as const;
|
|
44
48
|
|
|
45
|
-
/** Template keys for Telegram/Slack text-based verification messages. */
|
|
49
|
+
/** Template keys for Telegram/Slack/email text-based verification messages. */
|
|
46
50
|
type TextVerifyTemplateKey =
|
|
47
51
|
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.ALREADY_VERIFIED
|
|
48
52
|
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.TELEGRAM_CHALLENGE_REQUEST
|
|
@@ -50,7 +54,9 @@ type TextVerifyTemplateKey =
|
|
|
50
54
|
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_CHALLENGE_REQUEST
|
|
51
55
|
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_RESEND
|
|
52
56
|
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_TRUSTED_CONTACT_CHALLENGE
|
|
53
|
-
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_TRUSTED_CONTACT_RESEND
|
|
57
|
+
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_TRUSTED_CONTACT_RESEND
|
|
58
|
+
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_CHALLENGE_REQUEST
|
|
59
|
+
| typeof GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_RESEND;
|
|
54
60
|
|
|
55
61
|
/** Template keys for deterministic channel verification reply messages. */
|
|
56
62
|
type ChannelVerifyReplyTemplateKey =
|
|
@@ -115,6 +121,14 @@ const templates: Record<
|
|
|
115
121
|
[GUARDIAN_VERIFY_TEMPLATE_KEYS.SLACK_TRUSTED_CONTACT_RESEND]: (vars) => {
|
|
116
122
|
return `Vellum assistant verification: your code is ${vars.code}. Reply with this code to verify your identity. It expires in ${vars.expiresInMinutes} minutes. (resent)`;
|
|
117
123
|
},
|
|
124
|
+
|
|
125
|
+
[GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_CHALLENGE_REQUEST]: (vars) => {
|
|
126
|
+
return `Vellum assistant guardian verification requested.\n\nYour verification code is: ${vars.code}\n\nReply to this email with only the 6-digit code above to complete verification. This code expires in ${vars.expiresInMinutes} minutes.`;
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
[GUARDIAN_VERIFY_TEMPLATE_KEYS.EMAIL_RESEND]: (vars) => {
|
|
130
|
+
return `Vellum assistant guardian verification requested.\n\nYour new verification code is: ${vars.code}\n\nReply to this email with only the 6-digit code above to complete verification. This code expires in ${vars.expiresInMinutes} minutes. (resent)`;
|
|
131
|
+
},
|
|
118
132
|
};
|
|
119
133
|
|
|
120
134
|
/**
|
|
@@ -129,6 +143,18 @@ export function composeVerificationSlack(
|
|
|
129
143
|
return composer(vars);
|
|
130
144
|
}
|
|
131
145
|
|
|
146
|
+
/**
|
|
147
|
+
* Compose an outbound verification email from a template key and typed variables.
|
|
148
|
+
* Returns plain string content suitable for email delivery.
|
|
149
|
+
*/
|
|
150
|
+
export function composeVerificationEmail(
|
|
151
|
+
templateKey: TextVerifyTemplateKey,
|
|
152
|
+
vars: GuardianVerifyTemplateVars,
|
|
153
|
+
): string {
|
|
154
|
+
const composer = templates[templateKey];
|
|
155
|
+
return composer(vars);
|
|
156
|
+
}
|
|
157
|
+
|
|
132
158
|
/**
|
|
133
159
|
* Compose an outbound verification Telegram message from a template key and typed variables.
|
|
134
160
|
* Returns plain string content suitable for Telegram delivery.
|