@vellumai/assistant 0.12.5 → 0.12.6-dev.202609292019.a6f6d85
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/.env.example +2 -0
- package/ARCHITECTURE.md +23 -0
- package/docs/automatic-done.md +32 -0
- package/docs/desktop-browser-cli.md +3 -2
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/node_modules/@vellumai/environments/src/shell.test.ts +13 -1
- package/node_modules/@vellumai/environments/src/shell.ts +22 -1
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/node_modules/@vellumai/gateway-client/src/__tests__/status-contracts.test.ts +39 -0
- package/node_modules/@vellumai/gateway-client/src/gateway-ipc-contracts.ts +25 -0
- package/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/service-contracts/src/__tests__/mcp-oauth.test.ts +53 -0
- package/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/service-contracts/src/mcp-oauth.ts +60 -0
- package/openapi.yaml +270 -10
- package/package.json +1 -1
- package/src/__tests__/agent-loop.test.ts +76 -0
- package/src/__tests__/anthropic-provider.test.ts +2 -0
- package/src/__tests__/byok-default-profile-ensure.test.ts +7 -0
- package/src/__tests__/config-get-vision-flag.test.ts +1 -1
- package/src/__tests__/config-loader-validation-reset-notice.test.ts +2 -2
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +160 -154
- package/src/__tests__/conversation-evictor.test.ts +54 -0
- package/src/__tests__/conversation-pairing.test.ts +112 -0
- package/src/__tests__/document-append-idempotency.test.ts +13 -0
- package/src/__tests__/document-create-dedupe.test.ts +13 -0
- package/src/__tests__/document-find-replace.test.ts +13 -0
- package/src/__tests__/document-revision-history.test.ts +390 -0
- package/src/__tests__/document-revision.test.ts +425 -0
- package/src/__tests__/document-tool-security.test.ts +13 -0
- package/src/__tests__/document-update-default-surface.test.ts +13 -0
- package/src/__tests__/emit-signal-routing-intent.test.ts +270 -0
- package/src/__tests__/gateway-flag-listener.test.ts +59 -6
- package/src/__tests__/headless-browser-navigate.test.ts +20 -30
- package/src/__tests__/host-cu-proxy.test.ts +79 -0
- package/src/__tests__/host-cu-routes-targeted.test.ts +14 -5
- package/src/__tests__/host-shell-tool.test.ts +6 -2
- package/src/__tests__/identity-routes.test.ts +4 -3
- package/src/__tests__/llm-catalog-parity.test.ts +4 -4
- package/src/__tests__/llm-schema.test.ts +1 -1
- package/src/__tests__/notification-platform-adapter.test.ts +83 -1
- package/src/__tests__/oauth2-gateway-transport.test.ts +2 -0
- package/src/__tests__/openai-provider.test.ts +11 -11
- package/src/__tests__/pricing.test.ts +11 -0
- package/src/__tests__/public-ingress-urls.test.ts +26 -0
- package/src/__tests__/retry-thinking-tool-choice.test.ts +47 -0
- package/src/__tests__/usage-attribution.test.ts +31 -0
- package/src/__tests__/workspace-migration-133-collapse-provider-connections.test.ts +3 -3
- package/src/__tests__/workspace-migration-160-repair-retired-fireworks-model-ids.test.ts +262 -0
- package/src/__tests__/workspace-migration-161-repair-retired-fireworks-glm-5p2-model-id.test.ts +233 -0
- package/src/acp/agent-process.ts +6 -1
- package/src/acp/client-handler.ts +6 -1
- package/src/agent/loop.ts +29 -6
- package/src/api/events/document-editor-show.ts +5 -0
- package/src/api/events/document-editor-update.ts +10 -0
- package/src/api/events/tool-result.ts +1 -0
- package/src/calls/__tests__/voice-session-bridge.test.ts +54 -0
- package/src/calls/channel-admission-reader.ts +15 -9
- package/src/calls/twilio-provider.ts +14 -31
- package/src/calls/voice-session-bridge.ts +18 -1
- package/src/cli/commands/browser.ts +1 -2
- package/src/cli/lib/__tests__/plugin-artifact.test.ts +23 -0
- package/src/cli/lib/__tests__/plugin-catalog-visibility.test.ts +2 -0
- package/src/cli/lib/__tests__/plugin-details.test.ts +16 -0
- package/src/cli/lib/bundled-marketplace.json +41 -2
- package/src/cli/lib/inspect-plugin.ts +15 -15
- package/src/cli/lib/list-installed-plugins.ts +29 -28
- package/src/cli/lib/plugin-artifact.ts +74 -63
- package/src/cli/lib/plugin-catalog-visibility.ts +1 -0
- package/src/cli/lib/plugin-details.ts +27 -42
- package/src/cli/lib/plugin-marketplace.ts +6 -8
- package/src/cli/lib/plugin-surfaces.ts +8 -7
- package/src/cli.ts +1 -3
- package/src/config/__tests__/chat-settings.test.ts +121 -0
- package/src/config/assistant-feature-flags.ts +28 -23
- package/src/config/bundled-skills/computer-use/SKILL.md +20 -0
- package/src/config/bundled-skills/computer-use/TOOLS.json +11 -11
- package/src/config/chat-settings.ts +100 -0
- package/src/config/default-profile-catalog.ts +1 -1
- package/src/config/feature-flag-cache.ts +7 -25
- package/src/config/feature-flag-registry.json +1 -9
- package/src/config/loader.ts +5 -1
- package/src/config/profile-text-generation.ts +25 -21
- package/src/config/schemas/conversations.ts +14 -0
- package/src/config/schemas/llm.ts +1 -0
- package/src/config/schemas/notifications.ts +8 -1
- package/src/contacts/gateway-channel-read.ts +1 -1
- package/src/conversations/__tests__/auto-archive-activity.test.ts +136 -0
- package/src/conversations/__tests__/auto-archive.test.ts +304 -0
- package/src/conversations/auto-archive-activity.ts +61 -0
- package/src/conversations/auto-archive.ts +201 -0
- package/src/daemon/computer-use-observation.test.ts +81 -0
- package/src/daemon/computer-use-observation.ts +23 -0
- package/src/daemon/conversation-agent-loop.ts +11 -6
- package/src/daemon/conversation-evictor.ts +50 -16
- package/src/daemon/doordash-steps.ts +1 -3
- package/src/daemon/handlers/__tests__/config-a2a-accept.test.ts +43 -1
- package/src/daemon/handlers/__tests__/config-channels.test.ts +1 -1
- package/src/daemon/handlers/config-a2a.ts +75 -2
- package/src/daemon/host-cu-proxy.ts +34 -3
- package/src/daemon/lifecycle.ts +15 -2
- package/src/daemon/shutdown-handlers.ts +3 -0
- package/src/daemon/turn-finalization.ts +4 -0
- package/src/desktop/desktop-browser-endpoint.ts +11 -2
- package/src/desktop/desktop-chrome-policy.test.ts +1 -0
- package/src/desktop/desktop-chrome-policy.ts +7 -1
- package/src/desktop/desktop-computer-use.test.ts +14 -4
- package/src/desktop/desktop-session-manager.ts +5 -3
- package/src/documents/document-revisions-store.ts +153 -0
- package/src/documents/document-store.ts +471 -133
- package/src/followups/followup-store.ts +0 -4
- package/src/inbound/__tests__/oauth-callback-url.test.ts +25 -2
- package/src/inbound/oauth-callback-url.ts +30 -1
- package/src/inbound/public-ingress-urls.ts +12 -2
- package/src/ipc/gateway-client.test.ts +40 -0
- package/src/ipc/gateway-client.ts +12 -29
- package/src/ipc/gateway-flag-listener.ts +7 -10
- package/src/live-voice/__tests__/live-voice-agent-turn.test.ts +71 -0
- package/src/live-voice/__tests__/live-voice-flux-turn-end.test.ts +83 -0
- package/src/live-voice/__tests__/protocol.test.ts +77 -0
- package/src/live-voice/__tests__/share-targets.test.ts +163 -0
- package/src/live-voice/live-voice-session.ts +23 -6
- package/src/live-voice/protocol.ts +22 -0
- package/src/live-voice/share-targets.ts +225 -0
- package/src/mcp/__tests__/mcp-oauth-client-registration.test.ts +144 -3
- package/src/mcp/__tests__/mcp-oauth-provider.test.ts +2 -0
- package/src/mcp/client.ts +1 -19
- package/src/mcp/mcp-oauth-provider.ts +66 -49
- package/src/media/openrouter-image-service.ts +39 -22
- package/src/monitoring/__tests__/oom-inheritance-sweep.test.ts +86 -0
- package/src/monitoring/__tests__/oom-kill-reporter.test.ts +374 -0
- package/src/monitoring/control.ts +2 -1
- package/src/monitoring/oom-inheritance-sweep.ts +96 -0
- package/src/monitoring/oom-kill-reporter.ts +469 -0
- package/src/monitoring/resource-sampler.ts +30 -0
- package/src/notifications/README.md +53 -4
- package/src/notifications/__tests__/assistant-initiated-thread.test.ts +254 -0
- package/src/notifications/__tests__/broadcaster.test.ts +558 -6
- package/src/notifications/__tests__/completion-policy.test.ts +37 -0
- package/src/notifications/__tests__/from-me-alert-integration.test.ts +192 -0
- package/src/notifications/adapters/platform.ts +14 -0
- package/src/notifications/assistant-initiated-thread.ts +101 -0
- package/src/notifications/broadcaster.ts +94 -16
- package/src/notifications/chat-reply-policy.ts +11 -0
- package/src/notifications/completion-policy.ts +12 -2
- package/src/notifications/conversation-pairing.ts +15 -70
- package/src/notifications/emit-signal.ts +34 -3
- package/src/notifications/types.ts +2 -0
- package/src/oauth/connect-orchestrator.ts +1 -2
- package/src/persistence/__tests__/conversation-auto-archive.test.ts +330 -0
- package/src/persistence/conversation-auto-archive.ts +170 -0
- package/src/persistence/conversation-crud.ts +2 -1
- package/src/persistence/conversation-queries.ts +15 -8
- package/src/persistence/embeddings/embed.test.ts +96 -0
- package/src/persistence/embeddings/embed.ts +20 -2
- package/src/persistence/embeddings/embedding-gemini.test.ts +39 -3
- package/src/persistence/embeddings/embedding-gemini.ts +39 -1
- package/src/persistence/embeddings/embedding-local.ts +6 -0
- package/src/persistence/embeddings/qdrant-manager.ts +5 -0
- package/src/persistence/job-utils.ts +10 -0
- package/src/persistence/migrations/384-add-document-revision.test.ts +83 -0
- package/src/persistence/migrations/384-add-document-revision.ts +21 -0
- package/src/persistence/migrations/385-create-document-revisions.test.ts +67 -0
- package/src/persistence/migrations/385-create-document-revisions.ts +28 -0
- package/src/persistence/migrations/386-conversations-last-reopened-at.ts +10 -0
- package/src/persistence/migrations/__tests__/386-conversations-last-reopened-at.test.ts +32 -0
- package/src/persistence/schema/conversations.ts +1 -0
- package/src/persistence/schema/documents.ts +20 -0
- package/src/persistence/steps.ts +6 -0
- package/src/platform/managed-speech.ts +42 -46
- package/src/plugin-api/vision-support.test.ts +21 -21
- package/src/plugins/defaults/empty-response/hooks/post-model-call.ts +11 -6
- package/src/providers/__tests__/dispatch-connection-routing.test.ts +1 -1
- package/src/providers/__tests__/search-provider-catalog.test.ts +8 -0
- package/src/providers/anthropic/client.ts +1 -1
- package/src/providers/fireworks/client.test.ts +168 -0
- package/src/providers/fireworks/client.ts +24 -0
- package/src/providers/inference/adapter-factory.ts +6 -0
- package/src/providers/ionet/client.test.ts +143 -0
- package/src/providers/ionet/client.ts +37 -0
- package/src/providers/model-catalog.ts +141 -84
- package/src/providers/model-intents.ts +4 -4
- package/src/providers/openai/chat-completions-provider.ts +23 -1
- package/src/providers/retry.ts +56 -4
- package/src/providers/search-provider-catalog.ts +10 -0
- package/src/providers/types.ts +10 -2
- package/src/providers/usage-tracking.ts +5 -3
- package/src/runtime/assistant-event-hub.ts +23 -0
- package/src/runtime/auth/__tests__/guard-tests.test.ts +0 -7
- package/src/runtime/auth/__tests__/route-policy.test.ts +1 -1
- package/src/runtime/channel-retry-sweep.ts +1 -2
- package/src/runtime/migrations/__tests__/vbundle-streaming-validator.test.ts +35 -10
- package/src/runtime/migrations/__tests__/vbundle-validator-v1-schema.test.ts +48 -0
- package/src/runtime/migrations/vbundle-builder.ts +19 -3
- package/src/runtime/migrations/vbundle-streaming-importer.ts +14 -19
- package/src/runtime/migrations/vbundle-streaming-validator.ts +14 -7
- package/src/runtime/migrations/vbundle-validator.ts +54 -1
- package/src/runtime/pending-interactions.ts +20 -2
- package/src/runtime/routes/__tests__/contact-routes.test.ts +5 -3
- package/src/runtime/routes/__tests__/conversation-list-routes.test.ts +36 -0
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +375 -2
- package/src/runtime/routes/__tests__/inference-send-routes.test.ts +1 -1
- package/src/runtime/routes/__tests__/user-route-dispatcher.test.ts +12 -0
- package/src/runtime/routes/contact-routes.ts +2 -2
- package/src/runtime/routes/conversation-list-routes.ts +10 -2
- package/src/runtime/routes/conversation-query-routes.ts +48 -10
- package/src/runtime/routes/documents-routes.ts +185 -47
- package/src/runtime/routes/events-routes.ts +1 -3
- package/src/runtime/routes/host-app-control-routes.ts +1 -0
- package/src/runtime/routes/host-bash-routes.ts +1 -0
- package/src/runtime/routes/host-browser-routes.ts +15 -0
- package/src/runtime/routes/host-cu-routes.ts +4 -1
- package/src/runtime/routes/host-file-routes.ts +1 -0
- package/src/runtime/routes/host-proxy-result-binding.test.ts +83 -0
- package/src/runtime/routes/host-proxy-result-binding.ts +25 -0
- package/src/runtime/routes/host-transfer-routes.ts +1 -0
- package/src/runtime/routes/identity-routes.ts +3 -3
- package/src/runtime/routes/integrations/a2a.ts +4 -1
- package/src/runtime/routes/migration-routes.ts +3 -1
- package/src/runtime/routes/notification-routes.ts +1 -2
- package/src/runtime/routes/ui-snapshot-routes.test.ts +1 -0
- package/src/runtime/routes/user-route-dispatcher.ts +5 -1
- package/src/runtime/verification-templates.ts +1 -2
- package/src/sequence/analytics.ts +0 -4
- package/src/sequence/engine.ts +1 -11
- package/src/sequence/guardrails.ts +1 -6
- package/src/sequence/importer.ts +0 -8
- package/src/sequence/store.ts +0 -10
- package/src/signals/user-message.ts +0 -6
- package/src/skills/catalog-install.ts +52 -23
- package/src/tools/browser/browser-execution.ts +20 -23
- package/src/tools/browser/cdp-client/cdp-inspect/ws-transport.ts +1 -3
- package/src/tools/document/document-tool.ts +13 -11
- package/src/tools/executor.ts +1 -2
- package/src/tools/host-terminal/host-shell.ts +4 -2
- package/src/tools/network/__tests__/web-search.test.ts +105 -0
- package/src/tools/network/web-fetch.ts +2 -4
- package/src/tools/network/web-search.ts +239 -12
- package/src/tools/shared/filesystem/format-diff.ts +1 -2
- package/src/tools/shared/shell-output.test.ts +42 -0
- package/src/tools/shared/shell-output.ts +27 -4
- package/src/tools/terminal/shell.ts +3 -3
- package/src/tools/ui-surface/visual-validation.ts +1 -2
- package/src/usage/attribution.ts +18 -1
- package/src/util/__tests__/oom-priority.test.ts +55 -0
- package/src/util/__tests__/worker-memory.test.ts +16 -0
- package/src/util/debounce.ts +0 -4
- package/src/util/oom-priority.ts +79 -0
- package/src/util/platform.ts +0 -2
- package/src/util/plugin-manifest.ts +5 -7
- package/src/util/pricing.ts +25 -0
- package/src/util/worker-memory.ts +9 -3
- package/src/util/worker-process.ts +8 -0
- package/src/workspace/byok-default-profile-ensure.ts +11 -0
- package/src/workspace/hatched-date.ts +11 -4
- package/src/workspace/migrations/160-repair-retired-fireworks-model-ids.ts +209 -0
- package/src/workspace/migrations/161-repair-retired-fireworks-glm-5p2-model-id.ts +197 -0
- package/src/workspace/migrations/registry.ts +4 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { beforeAll, expect, mock, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import type { NotificationSignal } from "../signal.js";
|
|
4
|
+
import type {
|
|
5
|
+
ChannelAdapter,
|
|
6
|
+
ChannelDeliveryPayload,
|
|
7
|
+
NotificationChannel,
|
|
8
|
+
NotificationDecision,
|
|
9
|
+
} from "../types.js";
|
|
10
|
+
|
|
11
|
+
mock.module("../../config/assistant-initiated-threads-gate.js", () => ({
|
|
12
|
+
isAssistantInitiatedThreadsEnabled: () => true,
|
|
13
|
+
}));
|
|
14
|
+
const guardianReader =
|
|
15
|
+
await import("../../contacts/guardian-delivery-reader.js");
|
|
16
|
+
mock.module("../../contacts/guardian-delivery-reader.js", () => ({
|
|
17
|
+
...guardianReader,
|
|
18
|
+
getGuardianDelivery: async () => null,
|
|
19
|
+
}));
|
|
20
|
+
mock.module("../destination-resolver.js", () => ({
|
|
21
|
+
resolveDestinations: (channels: NotificationChannel[]) =>
|
|
22
|
+
new Map(channels.map((channel) => [channel, { channel }])),
|
|
23
|
+
}));
|
|
24
|
+
|
|
25
|
+
const { createConversation, getConversation, getMessageById, getMessages } =
|
|
26
|
+
await import("../../persistence/conversation-crud.js");
|
|
27
|
+
const { initializeDb } = await import("../../persistence/db-init.js");
|
|
28
|
+
const { resolveAssistantInitiatedThread } =
|
|
29
|
+
await import("../assistant-initiated-thread.js");
|
|
30
|
+
const { NotificationBroadcaster } = await import("../broadcaster.js");
|
|
31
|
+
const { createDecision } = await import("../decisions-store.js");
|
|
32
|
+
const { findDeliveryByDecisionAndChannel } =
|
|
33
|
+
await import("../deliveries-store.js");
|
|
34
|
+
const { createEvent } = await import("../events-store.js");
|
|
35
|
+
|
|
36
|
+
beforeAll(async () => {
|
|
37
|
+
await initializeDb();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
function persistedShare() {
|
|
41
|
+
const producer = createConversation({ conversationType: "background" });
|
|
42
|
+
const signal: NotificationSignal = {
|
|
43
|
+
signalId: crypto.randomUUID(),
|
|
44
|
+
createdAt: Date.now(),
|
|
45
|
+
sourceChannel: "assistant_tool",
|
|
46
|
+
sourceContextId: producer.id,
|
|
47
|
+
sourceEventName: "assistant.share",
|
|
48
|
+
contextPayload: {},
|
|
49
|
+
attentionHints: {
|
|
50
|
+
requiresAction: false,
|
|
51
|
+
urgency: "low",
|
|
52
|
+
isAsyncBackground: true,
|
|
53
|
+
visibleInSourceNow: false,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
createEvent({
|
|
57
|
+
id: signal.signalId,
|
|
58
|
+
sourceEventName: signal.sourceEventName,
|
|
59
|
+
sourceChannel: signal.sourceChannel,
|
|
60
|
+
sourceContextId: signal.sourceContextId,
|
|
61
|
+
attentionHints: signal.attentionHints,
|
|
62
|
+
payload: signal.contextPayload,
|
|
63
|
+
});
|
|
64
|
+
const decision: NotificationDecision & { persistedDecisionId: string } = {
|
|
65
|
+
persistedDecisionId: crypto.randomUUID(),
|
|
66
|
+
shouldNotify: true,
|
|
67
|
+
selectedChannels: ["vellum", "platform"],
|
|
68
|
+
reasoningSummary: "Share a useful update",
|
|
69
|
+
renderedCopy: {
|
|
70
|
+
vellum: { title: "A useful update", body: "The report is ready." },
|
|
71
|
+
},
|
|
72
|
+
dedupeKey: signal.signalId,
|
|
73
|
+
confidence: 1,
|
|
74
|
+
fallbackUsed: false,
|
|
75
|
+
};
|
|
76
|
+
createDecision({
|
|
77
|
+
...decision,
|
|
78
|
+
id: decision.persistedDecisionId,
|
|
79
|
+
notificationEventId: signal.signalId,
|
|
80
|
+
});
|
|
81
|
+
return {
|
|
82
|
+
signal,
|
|
83
|
+
decision,
|
|
84
|
+
options: {
|
|
85
|
+
assistantInitiatedThread: {
|
|
86
|
+
resolution: resolveAssistantInitiatedThread(signal),
|
|
87
|
+
platformAdded: true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function recordingAdapter(channel: "vellum" | "platform") {
|
|
94
|
+
const sent: ChannelDeliveryPayload[] = [];
|
|
95
|
+
const readableAtSend: boolean[] = [];
|
|
96
|
+
const adapter: ChannelAdapter = {
|
|
97
|
+
channel,
|
|
98
|
+
async send(payload) {
|
|
99
|
+
const conversationId = payload.deepLinkTarget?.conversationId;
|
|
100
|
+
const messageId = payload.deepLinkTarget?.messageId;
|
|
101
|
+
readableAtSend.push(
|
|
102
|
+
typeof conversationId === "string" &&
|
|
103
|
+
typeof messageId === "string" &&
|
|
104
|
+
getConversation(conversationId)?.source === "assistant_initiated" &&
|
|
105
|
+
getMessageById(messageId, conversationId) != null,
|
|
106
|
+
);
|
|
107
|
+
sent.push(payload);
|
|
108
|
+
return {
|
|
109
|
+
success: true,
|
|
110
|
+
...(channel === "platform"
|
|
111
|
+
? { remotePushAccepted: true, remotePushPlatforms: ["ios" as const] }
|
|
112
|
+
: {}),
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
return { adapter, sent, readableAtSend };
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
test("new From me alerts address the saved chat and seed before either adapter sends", async () => {
|
|
120
|
+
const { signal, decision, options } = persistedShare();
|
|
121
|
+
const local = recordingAdapter("vellum");
|
|
122
|
+
const push = recordingAdapter("platform");
|
|
123
|
+
const broadcaster = new NotificationBroadcaster([
|
|
124
|
+
local.adapter,
|
|
125
|
+
push.adapter,
|
|
126
|
+
]);
|
|
127
|
+
const created: Array<{
|
|
128
|
+
source?: string;
|
|
129
|
+
silent: boolean;
|
|
130
|
+
seedCount: number;
|
|
131
|
+
}> = [];
|
|
132
|
+
broadcaster.setOnConversationCreated((info) => {
|
|
133
|
+
created.push({
|
|
134
|
+
source: info.source,
|
|
135
|
+
silent: info.silent,
|
|
136
|
+
seedCount: getMessages(info.conversationId).length,
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
await broadcaster.broadcastDecision(signal, decision, options);
|
|
141
|
+
|
|
142
|
+
expect(created).toEqual([
|
|
143
|
+
{ source: "assistant_initiated", silent: false, seedCount: 1 },
|
|
144
|
+
]);
|
|
145
|
+
expect(local.readableAtSend).toEqual([true]);
|
|
146
|
+
expect(push.readableAtSend).toEqual([true]);
|
|
147
|
+
expect(local.sent[0]).toMatchObject({
|
|
148
|
+
silent: false,
|
|
149
|
+
urgency: "low",
|
|
150
|
+
correlationId: signal.signalId,
|
|
151
|
+
remotePushDispatched: true,
|
|
152
|
+
remotePushPlatforms: ["ios"],
|
|
153
|
+
});
|
|
154
|
+
expect(push.sent[0].deepLinkTarget).toEqual(local.sent[0].deepLinkTarget);
|
|
155
|
+
const conversationId = local.sent[0].deepLinkTarget?.conversationId as string;
|
|
156
|
+
expect(conversationId).not.toBe(signal.sourceContextId);
|
|
157
|
+
expect(getMessages(conversationId)).toHaveLength(1);
|
|
158
|
+
expect(getMessages(signal.sourceContextId)).toHaveLength(0);
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
test("a missing platform delivery reuses the saved initial-creation audit without reseeding", async () => {
|
|
162
|
+
const { signal, decision, options } = persistedShare();
|
|
163
|
+
const local = recordingAdapter("vellum");
|
|
164
|
+
await new NotificationBroadcaster([local.adapter]).broadcastDecision(
|
|
165
|
+
signal,
|
|
166
|
+
decision,
|
|
167
|
+
options,
|
|
168
|
+
);
|
|
169
|
+
const initial = findDeliveryByDecisionAndChannel(
|
|
170
|
+
decision.persistedDecisionId,
|
|
171
|
+
"vellum",
|
|
172
|
+
);
|
|
173
|
+
expect(initial).toMatchObject({
|
|
174
|
+
conversationStrategy: "start_new_conversation",
|
|
175
|
+
conversationAction: "start_new",
|
|
176
|
+
status: "sent",
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
const push = recordingAdapter("platform");
|
|
180
|
+
const retry = new NotificationBroadcaster([local.adapter, push.adapter]);
|
|
181
|
+
await retry.broadcastDecision(signal, decision, options);
|
|
182
|
+
await retry.broadcastDecision(signal, decision, options);
|
|
183
|
+
|
|
184
|
+
expect(local.sent).toHaveLength(1);
|
|
185
|
+
expect(push.sent).toHaveLength(1);
|
|
186
|
+
expect(push.readableAtSend).toEqual([true]);
|
|
187
|
+
expect(push.sent[0].deepLinkTarget).toMatchObject({
|
|
188
|
+
conversationId: initial?.conversationId,
|
|
189
|
+
messageId: initial?.messageId,
|
|
190
|
+
});
|
|
191
|
+
expect(getMessages(initial!.conversationId!)).toHaveLength(1);
|
|
192
|
+
});
|
|
@@ -20,6 +20,10 @@ import {
|
|
|
20
20
|
isRetryableStatus,
|
|
21
21
|
sleep,
|
|
22
22
|
} from "../../util/retry.js";
|
|
23
|
+
import {
|
|
24
|
+
areChatReplyAlertsDisabled,
|
|
25
|
+
CHAT_REPLY_ALERTS_DISABLED,
|
|
26
|
+
} from "../chat-reply-policy.js";
|
|
23
27
|
import {
|
|
24
28
|
isCompletionNotification,
|
|
25
29
|
isCompletionRecipientUnavailable,
|
|
@@ -162,6 +166,16 @@ export class PlatformPushAdapter implements ChannelAdapter {
|
|
|
162
166
|
platformsReported ? [...accumulatedPlatforms] : undefined;
|
|
163
167
|
|
|
164
168
|
for (let attempt = 0; attempt <= RETRY_DELAYS_MS.length; attempt++) {
|
|
169
|
+
if (areChatReplyAlertsDisabled(payload.sourceEventName)) {
|
|
170
|
+
const remotePushAccepted = accumulatedPlatforms.size > 0;
|
|
171
|
+
return {
|
|
172
|
+
success: remotePushAccepted,
|
|
173
|
+
skipped: !remotePushAccepted,
|
|
174
|
+
error: CHAT_REPLY_ALERTS_DISABLED,
|
|
175
|
+
remotePushAccepted,
|
|
176
|
+
remotePushPlatforms: remotePushPlatforms(),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
165
179
|
let response: Response;
|
|
166
180
|
try {
|
|
167
181
|
response = await client.fetch(path, {
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { isAssistantInitiatedThreadsEnabled } from "../config/assistant-initiated-threads-gate.js";
|
|
2
|
+
import {
|
|
3
|
+
getConversation,
|
|
4
|
+
getDisplayMetaForConversations,
|
|
5
|
+
getMessageById,
|
|
6
|
+
} from "../persistence/conversation-crud.js";
|
|
7
|
+
import {
|
|
8
|
+
ASSISTANT_INITIATED_SOURCE,
|
|
9
|
+
UNGROUPED_GROUP_ID,
|
|
10
|
+
} from "../persistence/conversation-types.js";
|
|
11
|
+
import { getLogger } from "../util/logger.js";
|
|
12
|
+
import type { NotificationSignal } from "./signal.js";
|
|
13
|
+
|
|
14
|
+
const log = getLogger("assistant-initiated-thread");
|
|
15
|
+
|
|
16
|
+
export interface AssistantInitiatedThreadResolution {
|
|
17
|
+
/** Eligible for automatic promotion; creation and sidebar membership are not guaranteed. */
|
|
18
|
+
isCandidate: boolean;
|
|
19
|
+
/** Prepared for vellum pairing only. Other channels retain the producer's signal. */
|
|
20
|
+
vellumSignal: NotificationSignal;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Background shares need a visible thread because their producer is hidden from the sidebar. */
|
|
24
|
+
export function resolveAssistantInitiatedThread(
|
|
25
|
+
signal: NotificationSignal,
|
|
26
|
+
): AssistantInitiatedThreadResolution {
|
|
27
|
+
if (
|
|
28
|
+
signal.sourceEventName !== "assistant.share" ||
|
|
29
|
+
signal.requiresConversation === true ||
|
|
30
|
+
signal.conversationMetadata?.source !== undefined ||
|
|
31
|
+
!isAssistantInitiatedThreadsEnabled()
|
|
32
|
+
) {
|
|
33
|
+
return { isCandidate: false, vellumSignal: signal };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
const producing = getConversation(signal.sourceContextId);
|
|
38
|
+
if (
|
|
39
|
+
producing &&
|
|
40
|
+
producing.conversationType !== "background" &&
|
|
41
|
+
producing.conversationType !== "scheduled"
|
|
42
|
+
) {
|
|
43
|
+
return { isCandidate: false, vellumSignal: signal };
|
|
44
|
+
}
|
|
45
|
+
} catch (err) {
|
|
46
|
+
log.warn(
|
|
47
|
+
{ err, sourceContextId: signal.sourceContextId },
|
|
48
|
+
"Unable to resolve the assistant-initiated thread candidate",
|
|
49
|
+
);
|
|
50
|
+
return { isCandidate: false, vellumSignal: signal };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
isCandidate: true,
|
|
55
|
+
vellumSignal: {
|
|
56
|
+
...signal,
|
|
57
|
+
requiresConversation: true,
|
|
58
|
+
conversationMetadata: {
|
|
59
|
+
...signal.conversationMetadata,
|
|
60
|
+
source: ASSISTANT_INITIATED_SOURCE,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** A new thread can alert only after its visible destination and seed are durable. */
|
|
67
|
+
export function isPersistedAssistantInitiatedThread(
|
|
68
|
+
conversationId: string | null,
|
|
69
|
+
messageId: string | null,
|
|
70
|
+
): boolean {
|
|
71
|
+
if (!conversationId || !messageId) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const conversation = getConversation(conversationId);
|
|
76
|
+
if (
|
|
77
|
+
!conversation ||
|
|
78
|
+
conversation.source !== ASSISTANT_INITIATED_SOURCE ||
|
|
79
|
+
conversation.conversationType !== "standard" ||
|
|
80
|
+
conversation.archivedAt !== null
|
|
81
|
+
) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
const placement = getDisplayMetaForConversations([conversationId]).get(
|
|
85
|
+
conversationId,
|
|
86
|
+
);
|
|
87
|
+
return (
|
|
88
|
+
placement !== undefined &&
|
|
89
|
+
!placement.isPinned &&
|
|
90
|
+
(placement.groupId === null ||
|
|
91
|
+
placement.groupId === UNGROUPED_GROUP_ID) &&
|
|
92
|
+
getMessageById(messageId, conversationId) !== null
|
|
93
|
+
);
|
|
94
|
+
} catch (err) {
|
|
95
|
+
log.warn(
|
|
96
|
+
{ err, conversationId },
|
|
97
|
+
"Unable to verify the notification thread and seed",
|
|
98
|
+
);
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -23,11 +23,21 @@ import {
|
|
|
23
23
|
} from "./access-request-copy.js";
|
|
24
24
|
import { isGuardianSensitiveEvent } from "./adapters/macos.js";
|
|
25
25
|
import { resolveMessageText } from "./adapters/shared.js";
|
|
26
|
+
import {
|
|
27
|
+
type AssistantInitiatedThreadResolution,
|
|
28
|
+
isPersistedAssistantInitiatedThread,
|
|
29
|
+
resolveAssistantInitiatedThread,
|
|
30
|
+
} from "./assistant-initiated-thread.js";
|
|
31
|
+
import {
|
|
32
|
+
areChatReplyAlertsDisabled,
|
|
33
|
+
CHAT_REPLY_ALERTS_DISABLED,
|
|
34
|
+
} from "./chat-reply-policy.js";
|
|
26
35
|
import {
|
|
27
36
|
isCompletionNotification,
|
|
28
37
|
isCompletionRecipientUnavailable,
|
|
29
38
|
isLocalNotificationSilent,
|
|
30
39
|
notificationConversationId,
|
|
40
|
+
type NotificationPresentationContext,
|
|
31
41
|
resolveCompletionRecipient,
|
|
32
42
|
} from "./completion-policy.js";
|
|
33
43
|
import {
|
|
@@ -247,10 +257,7 @@ export interface ConversationCreatedInfo {
|
|
|
247
257
|
groupId?: string;
|
|
248
258
|
/** Semantic source from the signal producer (e.g. "schedule", "reminder"). */
|
|
249
259
|
source?: string;
|
|
250
|
-
/**
|
|
251
|
-
* Mirrors the vellum adapter's `silent` flag (true for low- and
|
|
252
|
-
* medium-urgency signals).
|
|
253
|
-
*/
|
|
260
|
+
/** Mirrors the vellum adapter's resolved local presentation policy. */
|
|
254
261
|
silent: boolean;
|
|
255
262
|
}
|
|
256
263
|
/**
|
|
@@ -263,6 +270,10 @@ export type OnConversationCreatedFn = (
|
|
|
263
270
|
) => void | Promise<void>;
|
|
264
271
|
export interface BroadcastDecisionOptions {
|
|
265
272
|
onConversationCreated?: OnConversationCreatedFn;
|
|
273
|
+
assistantInitiatedThread?: {
|
|
274
|
+
resolution: AssistantInitiatedThreadResolution;
|
|
275
|
+
platformAdded: boolean;
|
|
276
|
+
};
|
|
266
277
|
/** Deadline override for tests; defaults to PLATFORM_OUTCOME_DEADLINE_MS. */
|
|
267
278
|
platformOutcomeDeadlineMs?: number;
|
|
268
279
|
/**
|
|
@@ -293,6 +304,7 @@ interface PendingChannelDispatch {
|
|
|
293
304
|
destinationLabel: string;
|
|
294
305
|
pairing: PairingResult;
|
|
295
306
|
hasPersistedDecision: boolean;
|
|
307
|
+
presentation: NotificationPresentationContext;
|
|
296
308
|
}
|
|
297
309
|
|
|
298
310
|
/**
|
|
@@ -358,10 +370,15 @@ export class NotificationBroadcaster {
|
|
|
358
370
|
decision.selectedChannels,
|
|
359
371
|
guardians,
|
|
360
372
|
);
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
373
|
+
const assistantInitiatedThread =
|
|
374
|
+
options?.assistantInitiatedThread?.resolution ??
|
|
375
|
+
resolveAssistantInitiatedThread(signal);
|
|
376
|
+
const presentation: NotificationPresentationContext = {};
|
|
377
|
+
const resolveSilent = () =>
|
|
378
|
+
isLocalNotificationSilent(
|
|
379
|
+
{ ...signal, urgency: signal.attentionHints.urgency },
|
|
380
|
+
presentation,
|
|
381
|
+
);
|
|
365
382
|
|
|
366
383
|
// Ensure vellum is processed first so the notification_conversation_created
|
|
367
384
|
// event fires immediately, before slower channel sends (e.g. Telegram 30s
|
|
@@ -438,6 +455,21 @@ export class NotificationBroadcaster {
|
|
|
438
455
|
await flushDeferredVellumSend();
|
|
439
456
|
}
|
|
440
457
|
|
|
458
|
+
if (
|
|
459
|
+
channel === "platform" &&
|
|
460
|
+
options?.assistantInitiatedThread?.platformAdded &&
|
|
461
|
+
(!presentation.assistantInitiatedThreadCreated ||
|
|
462
|
+
signal.contextPayload.quiet === true)
|
|
463
|
+
) {
|
|
464
|
+
results.push({
|
|
465
|
+
channel,
|
|
466
|
+
destination: destinations.get(channel)?.endpoint ?? channel,
|
|
467
|
+
status: "skipped",
|
|
468
|
+
errorMessage: "No newly persisted From me conversation for push",
|
|
469
|
+
});
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
|
|
441
473
|
const adapter = this.adapters.get(channel);
|
|
442
474
|
if (!adapter) {
|
|
443
475
|
log.warn(
|
|
@@ -567,6 +599,17 @@ export class NotificationBroadcaster {
|
|
|
567
599
|
conversationId: existingDelivery.conversationId,
|
|
568
600
|
messageId: existingDelivery.messageId,
|
|
569
601
|
};
|
|
602
|
+
presentation.assistantInitiatedThreadCreated =
|
|
603
|
+
assistantInitiatedThread.isCandidate &&
|
|
604
|
+
existingDelivery.conversationStrategy ===
|
|
605
|
+
"start_new_conversation" &&
|
|
606
|
+
(existingDelivery.conversationAction === "start_new" ||
|
|
607
|
+
(existingDelivery.conversationAction === "reuse_existing" &&
|
|
608
|
+
existingDelivery.conversationFallbackUsed === 1)) &&
|
|
609
|
+
isPersistedAssistantInitiatedThread(
|
|
610
|
+
existingDelivery.conversationId,
|
|
611
|
+
existingDelivery.messageId,
|
|
612
|
+
);
|
|
570
613
|
}
|
|
571
614
|
log.info(
|
|
572
615
|
{
|
|
@@ -596,7 +639,12 @@ export class NotificationBroadcaster {
|
|
|
596
639
|
signal,
|
|
597
640
|
channel,
|
|
598
641
|
copy,
|
|
599
|
-
{
|
|
642
|
+
{
|
|
643
|
+
conversationAction,
|
|
644
|
+
bindingContext: destination.bindingContext,
|
|
645
|
+
assistantInitiatedThread:
|
|
646
|
+
channel === "vellum" ? assistantInitiatedThread : undefined,
|
|
647
|
+
},
|
|
600
648
|
);
|
|
601
649
|
|
|
602
650
|
if (channel === "vellum" && pairing.conversationId) {
|
|
@@ -604,6 +652,14 @@ export class NotificationBroadcaster {
|
|
|
604
652
|
conversationId: pairing.conversationId,
|
|
605
653
|
messageId: pairing.messageId,
|
|
606
654
|
};
|
|
655
|
+
presentation.assistantInitiatedThreadCreated =
|
|
656
|
+
assistantInitiatedThread.isCandidate &&
|
|
657
|
+
pairing.createdNewConversation &&
|
|
658
|
+
pairing.strategy === "start_new_conversation" &&
|
|
659
|
+
isPersistedAssistantInitiatedThread(
|
|
660
|
+
pairing.conversationId,
|
|
661
|
+
pairing.messageId,
|
|
662
|
+
);
|
|
607
663
|
}
|
|
608
664
|
|
|
609
665
|
// For the vellum and platform channels, merge the conversationId into
|
|
@@ -660,9 +716,13 @@ export class NotificationBroadcaster {
|
|
|
660
716
|
title: conversationTitle,
|
|
661
717
|
sourceEventName: signal.sourceEventName,
|
|
662
718
|
targetGuardianPrincipalId,
|
|
663
|
-
groupId:
|
|
664
|
-
|
|
665
|
-
|
|
719
|
+
groupId:
|
|
720
|
+
assistantInitiatedThread.vellumSignal.conversationMetadata
|
|
721
|
+
?.groupId,
|
|
722
|
+
source:
|
|
723
|
+
assistantInitiatedThread.vellumSignal.conversationMetadata
|
|
724
|
+
?.source,
|
|
725
|
+
silent: resolveSilent(),
|
|
666
726
|
};
|
|
667
727
|
|
|
668
728
|
// The per-dispatch onConversationCreated callback fires whenever a vellum
|
|
@@ -692,6 +752,7 @@ export class NotificationBroadcaster {
|
|
|
692
752
|
) {
|
|
693
753
|
if (this.onConversationCreated) {
|
|
694
754
|
try {
|
|
755
|
+
info.silent = resolveSilent();
|
|
695
756
|
await this.onConversationCreated(info);
|
|
696
757
|
} catch (err) {
|
|
697
758
|
log.error(
|
|
@@ -714,7 +775,7 @@ export class NotificationBroadcaster {
|
|
|
714
775
|
deepLinkTarget,
|
|
715
776
|
contextPayload: signal.contextPayload,
|
|
716
777
|
urgency: signal.attentionHints.urgency,
|
|
717
|
-
silent,
|
|
778
|
+
silent: resolveSilent(),
|
|
718
779
|
approvalContext,
|
|
719
780
|
accessRequestContext,
|
|
720
781
|
toolApprovalSource,
|
|
@@ -729,6 +790,7 @@ export class NotificationBroadcaster {
|
|
|
729
790
|
destinationLabel,
|
|
730
791
|
pairing,
|
|
731
792
|
hasPersistedDecision,
|
|
793
|
+
presentation,
|
|
732
794
|
};
|
|
733
795
|
|
|
734
796
|
// Compute conversation decision audit fields for the delivery record
|
|
@@ -915,7 +977,22 @@ export class NotificationBroadcaster {
|
|
|
915
977
|
hasPersistedDecision,
|
|
916
978
|
} = dispatch;
|
|
917
979
|
try {
|
|
918
|
-
|
|
980
|
+
if (channel === "vellum") {
|
|
981
|
+
payload.silent = isLocalNotificationSilent(
|
|
982
|
+
payload,
|
|
983
|
+
dispatch.presentation,
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
const adapterResult: DeliveryResult =
|
|
987
|
+
channel === "platform" &&
|
|
988
|
+
areChatReplyAlertsDisabled(signal.sourceEventName)
|
|
989
|
+
? {
|
|
990
|
+
success: false,
|
|
991
|
+
skipped: true,
|
|
992
|
+
error: CHAT_REPLY_ALERTS_DISABLED,
|
|
993
|
+
remotePushAccepted: false,
|
|
994
|
+
}
|
|
995
|
+
: await adapter.send(payload, destination, observer);
|
|
919
996
|
|
|
920
997
|
if (adapterResult.success) {
|
|
921
998
|
// Prefer the channel-native id the adapter just captured (e.g.
|
|
@@ -966,13 +1043,14 @@ export class NotificationBroadcaster {
|
|
|
966
1043
|
}),
|
|
967
1044
|
);
|
|
968
1045
|
} else {
|
|
1046
|
+
const status = adapterResult.skipped ? "skipped" : "failed";
|
|
969
1047
|
if (hasPersistedDecision) {
|
|
970
|
-
updateDeliveryStatus(deliveryId,
|
|
1048
|
+
updateDeliveryStatus(deliveryId, status, {
|
|
971
1049
|
message: adapterResult.error,
|
|
972
1050
|
});
|
|
973
1051
|
}
|
|
974
1052
|
results.push(
|
|
975
|
-
buildDeliveryResult(dispatch,
|
|
1053
|
+
buildDeliveryResult(dispatch, status, {
|
|
976
1054
|
errorMessage: adapterResult.error,
|
|
977
1055
|
}),
|
|
978
1056
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { getConfig } from "../config/loader.js";
|
|
2
|
+
|
|
3
|
+
export const CHAT_REPLY_ALERTS_DISABLED =
|
|
4
|
+
"Chat reply notifications are disabled";
|
|
5
|
+
|
|
6
|
+
export function areChatReplyAlertsDisabled(sourceEventName: string): boolean {
|
|
7
|
+
return (
|
|
8
|
+
sourceEventName === "chat.assistant_reply" &&
|
|
9
|
+
!getConfig().notifications.newMessageEnabled
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
|
+
import { areChatReplyAlertsDisabled } from "./chat-reply-policy.js";
|
|
3
4
|
import type { ChannelDestination } from "./types.js";
|
|
4
5
|
import type { Urgency } from "./urgency.js";
|
|
5
6
|
|
|
@@ -61,14 +62,23 @@ export function notificationConversationId(
|
|
|
61
62
|
return readCompletionContext(event)?.conversationId ?? event.sourceContextId;
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
|
|
65
|
+
export interface NotificationPresentationContext {
|
|
66
|
+
assistantInitiatedThreadCreated?: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Presentation is independent of urgency and channel routing. */
|
|
65
70
|
export function isLocalNotificationSilent(
|
|
66
71
|
event: CompletionEvent & { urgency: Urgency },
|
|
72
|
+
presentation?: NotificationPresentationContext,
|
|
67
73
|
): boolean {
|
|
68
|
-
if (
|
|
74
|
+
if (
|
|
75
|
+
event.contextPayload?.quiet === true ||
|
|
76
|
+
areChatReplyAlertsDisabled(event.sourceEventName)
|
|
77
|
+
) {
|
|
69
78
|
return true;
|
|
70
79
|
}
|
|
71
80
|
return (
|
|
81
|
+
!presentation?.assistantInitiatedThreadCreated &&
|
|
72
82
|
!isCompletionNotification(event) &&
|
|
73
83
|
event.urgency !== "high" &&
|
|
74
84
|
event.urgency !== "critical"
|