@vellumai/assistant 0.11.10 → 0.11.11-staging.1
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/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__/plan-credit.test.ts +51 -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/plan-credit.ts +66 -0
- 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__/plan-credit.test.ts +51 -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/plan-credit.ts +66 -0
- package/node_modules/@vellumai/service-contracts/package.json +2 -1
- package/node_modules/@vellumai/service-contracts/src/__tests__/plan-credit.test.ts +51 -0
- package/node_modules/@vellumai/service-contracts/src/index.ts +1 -0
- package/node_modules/@vellumai/service-contracts/src/plan-credit.ts +66 -0
- package/openapi.yaml +152 -55
- package/package.json +1 -1
- package/src/__tests__/anthropic-provider.test.ts +60 -0
- package/src/__tests__/config-get-vision-flag.test.ts +36 -0
- package/src/__tests__/conversation-error.test.ts +38 -0
- package/src/__tests__/copy-composer-tc-templates.test.ts +2 -2
- package/src/__tests__/guardian-action-service-scope.test.ts +53 -0
- package/src/__tests__/headless-browser-mode.test.ts +63 -13
- package/src/__tests__/heartbeat-disk-pressure.test.ts +2 -0
- package/src/__tests__/heartbeat-service.test.ts +118 -27
- package/src/__tests__/host-app-control-proxy.test.ts +2 -2
- package/src/__tests__/host-app-control-routes.test.ts +41 -0
- package/src/__tests__/host-bash-routes.test.ts +30 -1
- package/src/__tests__/host-browser-routes.test.ts +34 -0
- package/src/__tests__/host-cu-routes-targeted.test.ts +29 -0
- package/src/__tests__/host-file-routes-targeted.test.ts +29 -0
- package/src/__tests__/host-proxy-base.test.ts +1 -0
- package/src/__tests__/host-transfer-routes-targeted.test.ts +86 -0
- package/src/__tests__/llm-schema.test.ts +32 -0
- package/src/__tests__/mcp-config-secret-boundary.test.ts +2 -0
- package/src/__tests__/memory-config-file-parity.test.ts +18 -0
- package/src/__tests__/memory-retrieval-hook.test.ts +15 -0
- package/src/__tests__/messaging-send-tool.test.ts +159 -13
- package/src/__tests__/messaging-shared.test.ts +19 -0
- package/src/__tests__/notification-events-source-context-probe.test.ts +211 -0
- package/src/__tests__/openai-responses-prompt-cache.test.ts +40 -6
- package/src/__tests__/outlook-messaging-provider.test.ts +9 -0
- package/src/__tests__/provider-catalog-visibility.test.ts +2 -2
- package/src/__tests__/schedule-routes.test.ts +30 -1
- package/src/__tests__/scheduler-result-notification.test.ts +209 -0
- package/src/__tests__/skills-install-extract.test.ts +26 -0
- package/src/__tests__/skills-install-staging.test.ts +11 -2
- package/src/api/constants/personality-sliders.test.ts +21 -0
- package/src/api/constants/personality-sliders.ts +64 -0
- package/src/api/index.ts +8 -0
- package/src/archive/ustar-size.test.ts +32 -0
- package/src/archive/ustar-size.ts +23 -0
- package/src/background-wake/next-wake.test.ts +13 -0
- package/src/background-wake/next-wake.ts +4 -2
- package/src/calls/voice-session-bridge.ts +26 -0
- package/src/cli/__tests__/catalog-search-help.test.ts +1 -0
- package/src/cli/commands/__tests__/plugins-search.test.ts +81 -0
- package/src/cli/commands/config.help.ts +3 -1
- package/src/cli/commands/memory/worker.ts +1 -1
- package/src/cli/commands/platform/__tests__/credits-format.test.ts +94 -5
- package/src/cli/commands/platform/__tests__/credits.test.ts +10 -0
- package/src/cli/commands/platform/credits-format.ts +57 -0
- package/src/cli/commands/platform/index.help.ts +19 -3
- package/src/cli/commands/plugins.help.ts +4 -1
- package/src/cli/commands/plugins.ts +2 -1
- package/src/cli/lib/bundled-marketplace.json +1 -1
- package/src/cli/lib/install-from-platform.ts +8 -10
- package/src/config/bundled-skills/messaging/SKILL.md +2 -0
- package/src/config/bundled-skills/messaging/TOOLS.json +4 -4
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +85 -1
- package/src/config/bundled-skills/messaging/tools/shared.ts +6 -0
- package/src/config/bundled-skills/schedule/SKILL.md +9 -1
- package/src/config/bundled-skills/screen-annotation/SKILL.md +87 -20
- package/src/config/bundled-skills/screen-annotation/TOOLS.json +21 -5
- package/src/config/bundled-skills/screen-annotation/tools/screen-annotation.test.ts +67 -0
- package/src/config/feature-flag-registry.json +17 -1
- package/src/config/input-modalities.test.ts +71 -0
- package/src/config/input-modalities.ts +95 -0
- package/src/config/schemas/heartbeat.ts +3 -3
- package/src/config/schemas/llm.ts +13 -3
- package/src/config/schemas/memory-storage.test.ts +39 -0
- package/src/config/schemas/memory-storage.ts +21 -0
- package/src/context/token-estimator.ts +2 -2
- package/src/daemon/__tests__/embedding-reconcile.test.ts +77 -0
- package/src/daemon/__tests__/lifecycle-embedding-reconcile.test.ts +3 -0
- package/src/daemon/conversation-error.ts +20 -7
- package/src/daemon/embedding-reconcile.ts +64 -1
- package/src/daemon/handlers/config-embeddings.ts +31 -0
- package/src/daemon/host-app-control-proxy.ts +2 -0
- package/src/daemon/host-bash-proxy.ts +1 -0
- package/src/daemon/host-cu-proxy.ts +6 -6
- package/src/daemon/host-file-proxy.ts +6 -6
- package/src/daemon/host-proxy-base.ts +10 -9
- package/src/daemon/host-transfer-proxy.ts +21 -24
- package/src/daemon/mcp-reload-service.ts +6 -0
- package/src/daemon/providers-setup.ts +5 -26
- package/src/heartbeat/heartbeat-service.ts +72 -13
- package/src/live-voice/__tests__/live-voice-photo.test.ts +72 -0
- package/src/live-voice/__tests__/live-voice-sight-frame.test.ts +81 -0
- package/src/live-voice/live-voice-photo.ts +68 -4
- package/src/live-voice/live-voice-session.ts +36 -2
- package/src/live-voice/protocol.ts +98 -1
- package/src/mcp/__tests__/reload-signal-emission.test.ts +54 -0
- package/src/mcp/__tests__/reload-signal.test.ts +57 -0
- package/src/mcp/__tests__/startup.test.ts +150 -0
- package/src/mcp/reload-signal.ts +50 -0
- package/src/mcp/startup.ts +101 -0
- package/src/messaging/providers/outlook/adapter.ts +2 -13
- package/src/messaging/providers/outlook/client.ts +13 -1
- package/src/messaging/providers/outlook/types.ts +3 -0
- package/src/notifications/__tests__/decision-engine.test.ts +79 -6
- package/src/notifications/__tests__/home-feed-side-effect.test.ts +27 -0
- package/src/notifications/__tests__/schedule-result-producer.test.ts +397 -0
- package/src/notifications/copy-composer.ts +33 -11
- package/src/notifications/decision-engine.ts +48 -11
- package/src/notifications/events-store.ts +68 -2
- package/src/notifications/home-feed-side-effect.ts +15 -3
- package/src/notifications/schedule-result-producer.ts +275 -0
- package/src/notifications/signal.ts +5 -0
- package/src/oauth/seed-providers.ts +3 -2
- package/src/persistence/conversation-crud.ts +38 -0
- package/src/persistence/embeddings/embedding-backend.test.ts +162 -0
- package/src/persistence/embeddings/embedding-backend.ts +148 -11
- package/src/persistence/embeddings/embedding-openai.test.ts +113 -0
- package/src/persistence/embeddings/embedding-openai.ts +55 -4
- package/src/persistence/embeddings/embedding-types.test.ts +24 -0
- package/src/persistence/embeddings/embedding-types.ts +25 -1
- package/src/persistence/job-utils.ts +6 -2
- package/src/plugin-api/index.ts +2 -1
- package/src/plugin-api/vision-support.test.ts +81 -0
- package/src/plugin-api/vision-support.ts +57 -10
- package/src/plugins/defaults/memory/hooks/user-prompt-submit.ts +8 -0
- package/src/plugins/defaults/memory/jobs/__tests__/embed-concept-page.test.ts +1 -0
- package/src/plugins/defaults/memory/jobs/embed-concept-page.ts +11 -3
- package/src/plugins/defaults/memory/src/__tests__/memory-worker-routes.test.ts +20 -0
- package/src/plugins/defaults/memory/src/memory-worker-routes.ts +3 -1
- package/src/plugins/defaults/memory/substrate/__tests__/reembed-job.test.ts +1 -0
- package/src/plugins/defaults/memory/v2/__tests__/backfill-jobs.test.ts +1 -0
- package/src/plugins/defaults/memory/v3/__tests__/section-dense-store.test.ts +82 -0
- package/src/plugins/defaults/memory/v3/section-dense-store.ts +9 -27
- package/src/providers/__tests__/provider-secret-catalog.test.ts +4 -0
- package/src/providers/__tests__/xml-tool-call-salvage.test.ts +172 -0
- package/src/providers/anthropic/client.ts +9 -4
- package/src/providers/inline-audio-support.test.ts +34 -0
- package/src/providers/inline-audio-support.ts +27 -0
- package/src/providers/model-catalog.ts +22 -2
- package/src/providers/openai/__tests__/api-error-normalization.test.ts +50 -0
- package/src/providers/openai/__tests__/chat-completions-extra-body.test.ts +51 -0
- package/src/providers/openai/__tests__/chat-completions-provider-xml-salvage.test.ts +291 -0
- package/src/providers/openai/api-error-normalization.ts +18 -3
- package/src/providers/openai/chat-completions-provider.ts +113 -13
- package/src/providers/openai/responses-provider.ts +10 -8
- package/src/providers/provider-secret-catalog.ts +11 -1
- package/src/providers/vellum/client.ts +14 -1
- package/src/providers/vellum/personality-directions.test.ts +163 -0
- package/src/providers/vellum/personality-directions.ts +120 -0
- package/src/providers/xml-tool-call-salvage.ts +212 -0
- package/src/runtime/__tests__/background-job-runner.test.ts +42 -4
- package/src/runtime/auth/__tests__/guard-tests.test.ts +1 -6
- package/src/runtime/auth/__tests__/route-policy.test.ts +65 -0
- package/src/runtime/auth/same-actor.ts +29 -5
- package/src/runtime/background-job-runner.ts +38 -29
- package/src/runtime/guardian-action-service.ts +20 -1
- package/src/runtime/migrations/vbundle-validator.ts +3 -3
- package/src/runtime/pending-interactions.ts +4 -5
- package/src/runtime/routes/__tests__/heartbeat-routes.test.ts +24 -0
- package/src/runtime/routes/__tests__/platform-credits-routes.test.ts +99 -5
- package/src/runtime/routes/conversation-query-routes.ts +53 -11
- package/src/runtime/routes/document-comments-routes.ts +8 -2
- package/src/runtime/routes/guardian-action-routes.ts +7 -0
- package/src/runtime/routes/heartbeat-routes.ts +41 -53
- package/src/runtime/routes/host-app-control-routes.ts +10 -36
- package/src/runtime/routes/host-bash-routes.ts +11 -45
- package/src/runtime/routes/host-browser-routes.ts +24 -0
- package/src/runtime/routes/host-cu-routes.ts +11 -45
- package/src/runtime/routes/host-file-routes.ts +11 -44
- package/src/runtime/routes/host-proxy-result-binding.ts +57 -0
- package/src/runtime/routes/host-transfer-routes.ts +33 -25
- package/src/runtime/routes/index.ts +0 -2
- package/src/runtime/routes/integrations/a2a.ts +12 -3
- package/src/runtime/routes/integrations/vercel.ts +13 -3
- package/src/runtime/routes/platform-routes.ts +121 -24
- package/src/runtime/routes/schedule-routes.ts +15 -1
- package/src/schedule/__tests__/schedule-timezone.test.ts +21 -3
- package/src/schedule/__tests__/worker-mcp-tools.test.ts +88 -0
- package/src/schedule/schedule-timezone.ts +25 -0
- package/src/schedule/scheduler.ts +19 -0
- package/src/schedule/worker.ts +119 -2
- package/src/skills/catalog-install.ts +40 -5
- package/src/tools/browser/__tests__/browser-status.test.ts +3 -0
- package/src/tools/browser/browser-execution.ts +117 -53
- package/src/tools/browser/browser-status-constants.ts +6 -6
- package/src/tools/capability-offer.test.ts +87 -0
- package/src/tools/capability-offer.ts +93 -0
- package/src/tools/terminal/__tests__/safe-env.test.ts +17 -0
- package/src/tools/terminal/safe-env.ts +3 -2
- package/src/util/provider-error-patterns.ts +34 -0
- package/src/watcher/__tests__/engine.test.ts +5 -2
- package/src/watcher/engine.ts +7 -4
- package/src/runtime/routes/__tests__/sight-frame-routes.test.ts +0 -487
- package/src/runtime/routes/sight-frame-routes.ts +0 -136
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
} from "../lib/toggle-plugin.js";
|
|
56
56
|
import type { PluginUpgradeResult } from "../lib/upgrade-plugin.js";
|
|
57
57
|
import { getCliLogger } from "../logger.js";
|
|
58
|
-
import { pluginsHelp } from "./plugins.help.js";
|
|
58
|
+
import { PLUGINS_SEARCH_INSTALL_HINT, pluginsHelp } from "./plugins.help.js";
|
|
59
59
|
|
|
60
60
|
const loadModule = createRequire(import.meta.url);
|
|
61
61
|
|
|
@@ -606,6 +606,7 @@ export function registerPluginsCommand(program: Command): void {
|
|
|
606
606
|
console.log(
|
|
607
607
|
`${result.matches.length} match${result.matches.length === 1 ? "" : "es"} for "${result.query}".`,
|
|
608
608
|
);
|
|
609
|
+
console.log(PLUGINS_SEARCH_INSTALL_HINT);
|
|
609
610
|
} catch (err) {
|
|
610
611
|
if (err instanceof libs.search.InvalidSearchPatternError) {
|
|
611
612
|
console.error(err.message);
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
"source": {
|
|
220
220
|
"source": "github",
|
|
221
221
|
"repo": "vellum-ai/imessage",
|
|
222
|
-
"ref": "
|
|
222
|
+
"ref": "41b8e9ad87b4975bf3fbdc9a8e46deda489d3d51"
|
|
223
223
|
},
|
|
224
224
|
"description": "iMessage and SMS channel for the Vellum assistant, backed by a Photon line.",
|
|
225
225
|
"category": "productivity",
|
|
@@ -29,6 +29,10 @@ import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
|
29
29
|
import { dirname, join, resolve, sep } from "node:path";
|
|
30
30
|
import { gunzipSync } from "node:zlib";
|
|
31
31
|
|
|
32
|
+
import {
|
|
33
|
+
MALFORMED_USTAR_SIZE,
|
|
34
|
+
parseUstarSizeField,
|
|
35
|
+
} from "../../archive/ustar-size.js";
|
|
32
36
|
import { getPlatformBaseUrl } from "../../config/env.js";
|
|
33
37
|
import { getExistingDeviceId } from "../../util/device-id.js";
|
|
34
38
|
import { getWorkspacePluginsDir } from "../../util/platform.js";
|
|
@@ -593,18 +597,12 @@ function readHeaderName(header: Buffer): string {
|
|
|
593
597
|
return prefix ? `${prefix}/${name}` : name;
|
|
594
598
|
}
|
|
595
599
|
|
|
596
|
-
/** Parse the octal `size` field (bytes 124–136). */
|
|
597
600
|
function parseTarSize(pluginName: string, header: Buffer): number {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
.trim();
|
|
603
|
-
const size = raw ? Number.parseInt(raw, 8) : 0;
|
|
604
|
-
if (!Number.isFinite(size) || size < 0) {
|
|
605
|
-
throw new PluginArchiveError(pluginName, "malformed tar size field");
|
|
601
|
+
try {
|
|
602
|
+
return parseUstarSizeField(header);
|
|
603
|
+
} catch {
|
|
604
|
+
throw new PluginArchiveError(pluginName, MALFORMED_USTAR_SIZE);
|
|
606
605
|
}
|
|
607
|
-
return size;
|
|
608
606
|
}
|
|
609
607
|
|
|
610
608
|
/** Decode a NUL-terminated field to a UTF-8 string. */
|
|
@@ -32,6 +32,8 @@ Reading, searching, or summarizing the user's inbox is a **messaging task** —
|
|
|
32
32
|
|
|
33
33
|
When a platform is connected (auth test succeeds), always use the messaging API tools for that platform. Never fall back to browser automation, shell commands (bash, curl), or any other approach for operations that messaging tools can handle. The messaging tools handle authentication internally - never try to access tokens or call APIs directly. Browser automation is only appropriate for initial credential setup (OAuth consent screens), not for day-to-day messaging operations.
|
|
34
34
|
|
|
35
|
+
On Gmail and Outlook, `messaging_send` creates a real mailbox draft for review. It does not send. Recipients are optional on Outlook: if the user has not named a To address, still create the draft (use a non-email `conversation_id` such as `drafts`) and tell them only after the tool returns a draft ID. If draft creation fails or is interrupted, say so and offer the email copy in chat. Do not claim a draft exists until the tool succeeds.
|
|
36
|
+
|
|
35
37
|
**Exception: Slack.** Slack messaging should use the Slack Web API directly via CLI, not messaging tools. See the **slack** skill for details.
|
|
36
38
|
|
|
37
39
|
## Connection Setup
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"name": "messaging_send",
|
|
128
|
-
"description": "Send a message, reply to a thread, or create a draft. On Gmail, always creates a draft for review. Supports replies (via thread_id), attachments (via attachment_paths, Gmail and Outlook), and all messaging platforms.",
|
|
128
|
+
"description": "Send a message, reply to a thread, or create a draft. On Gmail and Outlook, always creates a real mailbox draft for review (recipients optional on Outlook). Supports replies (via thread_id), attachments (via attachment_paths, Gmail and Outlook), and all messaging platforms.",
|
|
129
129
|
"category": "messaging",
|
|
130
130
|
"risk": "high",
|
|
131
131
|
"input_schema": {
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
},
|
|
142
142
|
"conversation_id": {
|
|
143
143
|
"type": "string",
|
|
144
|
-
"description": "Conversation/channel ID. For Gmail new messages, use the recipient email address."
|
|
144
|
+
"description": "Conversation/channel ID. For Gmail or Outlook new messages, use the recipient email address. On Outlook, a non-email placeholder still creates a Drafts-folder draft with no To address."
|
|
145
145
|
},
|
|
146
146
|
"text": {
|
|
147
147
|
"type": "string",
|
|
@@ -149,11 +149,11 @@
|
|
|
149
149
|
},
|
|
150
150
|
"subject": {
|
|
151
151
|
"type": "string",
|
|
152
|
-
"description": "Email subject line (Gmail
|
|
152
|
+
"description": "Email subject line (Gmail and Outlook)"
|
|
153
153
|
},
|
|
154
154
|
"in_reply_to": {
|
|
155
155
|
"type": "string",
|
|
156
|
-
"description": "Message-ID header
|
|
156
|
+
"description": "Message ID to reply to. Gmail: RFC 822 Message-ID header. Outlook: Graph message ID, creates a reply draft."
|
|
157
157
|
},
|
|
158
158
|
"attachment_paths": {
|
|
159
159
|
"type": "array",
|
|
@@ -10,6 +10,12 @@ import {
|
|
|
10
10
|
getThread,
|
|
11
11
|
} from "../../../../messaging/providers/gmail/client.js";
|
|
12
12
|
import { buildMultipartMime } from "../../../../messaging/providers/gmail/mime-builder.js";
|
|
13
|
+
import {
|
|
14
|
+
createDraft as createOutlookDraft,
|
|
15
|
+
createReplyDraft as createOutlookReplyDraft,
|
|
16
|
+
toOutlookFileAttachments,
|
|
17
|
+
} from "../../../../messaging/providers/outlook/client.js";
|
|
18
|
+
import type { OutlookDraftMessage } from "../../../../messaging/providers/outlook/types.js";
|
|
13
19
|
import { resolveProactiveHomeConversation } from "../../../../notifications/conversation-pairing.js";
|
|
14
20
|
import { recordDeliveredChannelPost } from "../../../../notifications/delivered-post-record.js";
|
|
15
21
|
import { getConversation } from "../../../../persistence/conversation-crud.js";
|
|
@@ -25,6 +31,7 @@ import {
|
|
|
25
31
|
extractEmail,
|
|
26
32
|
extractHeader,
|
|
27
33
|
getProviderConnection,
|
|
34
|
+
isMailboxAddress,
|
|
28
35
|
ok,
|
|
29
36
|
parseAddressList,
|
|
30
37
|
resolveProvider,
|
|
@@ -287,7 +294,66 @@ export async function run(
|
|
|
287
294
|
);
|
|
288
295
|
}
|
|
289
296
|
|
|
290
|
-
//
|
|
297
|
+
// Outlook: create a Graph draft instead of sending. Recipients are
|
|
298
|
+
// optional so a voice-composed email can land in Drafts before the user
|
|
299
|
+
// names a To address.
|
|
300
|
+
if (provider.id === "outlook") {
|
|
301
|
+
if (!conn) {
|
|
302
|
+
return err(
|
|
303
|
+
"Outlook requires an OAuth connection. Is the account connected?",
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const attachments = attachmentPaths?.length
|
|
308
|
+
? await readAttachments(attachmentPaths)
|
|
309
|
+
: undefined;
|
|
310
|
+
const graphAttachments = attachments?.length
|
|
311
|
+
? toOutlookFileAttachments(attachments)
|
|
312
|
+
: undefined;
|
|
313
|
+
const toAddress = isMailboxAddress(conversationId)
|
|
314
|
+
? extractEmail(conversationId)
|
|
315
|
+
: undefined;
|
|
316
|
+
|
|
317
|
+
if (inReplyTo) {
|
|
318
|
+
const draft = await createOutlookReplyDraft(
|
|
319
|
+
conn,
|
|
320
|
+
inReplyTo,
|
|
321
|
+
text,
|
|
322
|
+
);
|
|
323
|
+
const recipientSummary = toAddress ? `To: ${toAddress}` : undefined;
|
|
324
|
+
return ok(
|
|
325
|
+
formatOutlookDraftCreated({
|
|
326
|
+
draftId: draft.id,
|
|
327
|
+
webLink: draft.webLink,
|
|
328
|
+
recipientSummary,
|
|
329
|
+
attachmentCount: attachments?.length,
|
|
330
|
+
filenames: attachments?.map((a) => a.filename).join(", "),
|
|
331
|
+
}),
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
const draftBody: OutlookDraftMessage = {
|
|
336
|
+
subject: subject ?? "",
|
|
337
|
+
body: { contentType: "text", content: text },
|
|
338
|
+
...(toAddress
|
|
339
|
+
? { toRecipients: [{ emailAddress: { address: toAddress } }] }
|
|
340
|
+
: {}),
|
|
341
|
+
...(graphAttachments ? { attachments: graphAttachments } : {}),
|
|
342
|
+
};
|
|
343
|
+
const draft = await createOutlookDraft(conn, draftBody);
|
|
344
|
+
const recipientSummary = toAddress ? `To: ${toAddress}` : undefined;
|
|
345
|
+
return ok(
|
|
346
|
+
formatOutlookDraftCreated({
|
|
347
|
+
draftId: draft.id,
|
|
348
|
+
webLink: draft.webLink,
|
|
349
|
+
recipientSummary,
|
|
350
|
+
attachmentCount: attachments?.length,
|
|
351
|
+
filenames: attachments?.map((a) => a.filename).join(", "),
|
|
352
|
+
}),
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Non-email platforms
|
|
291
357
|
const attachments = attachmentPaths?.length
|
|
292
358
|
? await readAttachments(attachmentPaths)
|
|
293
359
|
: undefined;
|
|
@@ -316,3 +382,21 @@ export async function run(
|
|
|
316
382
|
return err(e instanceof Error ? e.message : String(e));
|
|
317
383
|
}
|
|
318
384
|
}
|
|
385
|
+
|
|
386
|
+
function formatOutlookDraftCreated(opts: {
|
|
387
|
+
draftId: string;
|
|
388
|
+
webLink?: string;
|
|
389
|
+
recipientSummary?: string;
|
|
390
|
+
attachmentCount?: number;
|
|
391
|
+
filenames?: string;
|
|
392
|
+
}): string {
|
|
393
|
+
const attachmentBit =
|
|
394
|
+
opts.attachmentCount && opts.filenames
|
|
395
|
+
? ` with ${opts.attachmentCount} attachment(s): ${opts.filenames}`
|
|
396
|
+
: "";
|
|
397
|
+
const recipientBit = opts.recipientSummary
|
|
398
|
+
? ` ${opts.recipientSummary}.`
|
|
399
|
+
: " No recipient set. Open the draft in Outlook to add one.";
|
|
400
|
+
const linkBit = opts.webLink ? ` Open it: ${opts.webLink}` : "";
|
|
401
|
+
return `Outlook draft created${attachmentBit} (Draft ID: ${opts.draftId}).${recipientBit}${linkBit} Review it in your Outlook Drafts, then tell me to send it or send it yourself from Outlook.`;
|
|
402
|
+
}
|
|
@@ -106,6 +106,12 @@ export function extractEmail(address: string): string {
|
|
|
106
106
|
.toLowerCase();
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
/** True when `value` contains a usable mailbox (has `@`, no spaces). */
|
|
110
|
+
export function isMailboxAddress(value: string): boolean {
|
|
111
|
+
const email = extractEmail(value);
|
|
112
|
+
return email.includes("@") && !email.includes(" ");
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
/**
|
|
110
116
|
* Resolve the messaging provider from user input.
|
|
111
117
|
* If platform is specified, look it up directly.
|
|
@@ -238,7 +238,15 @@ If any required capability is missing:
|
|
|
238
238
|
|
|
239
239
|
## Delivering Results
|
|
240
240
|
|
|
241
|
-
Scheduled messages run without user interaction. If the task produces output
|
|
241
|
+
Scheduled messages run without user interaction, in a conversation nobody has open. If the task produces output the user should see (a digest, summary, report, or a check whose answer is "nothing changed"), the scheduled message **must** end with an explicit instruction to deliver it. Without one, the output lives in a conversation log the user never opens.
|
|
242
|
+
|
|
243
|
+
Write the delivery step into the `message` when you create the schedule — not as a vague "let me know", but as the actual call, with a real title:
|
|
244
|
+
|
|
245
|
+
> "…then send the summary with `assistant notifications send --title \"Inbox digest\" --message \"<the summary>\"`."
|
|
246
|
+
|
|
247
|
+
A schedule whose message has no delivery step is not finished. Before calling `schedule_create` in `execute` mode, read your own message back and check that it says where the output goes.
|
|
248
|
+
|
|
249
|
+
There is a safety net, and it is not a substitute for the above. When an execute-mode run finishes with user-facing output and delivered nothing — no `assistant notifications send`, no `messaging_send`, no Slack `chat.postMessage` — the assistant sends a notification carrying the run's final reply, so a schedule can no longer run and leave no trace. It fires on the raw reply — whatever the run happened to end on, at whatever length. An authored delivery step gets a title and body you chose, sent at the moment you chose. Rely on the net and you get the machine's guess instead.
|
|
242
250
|
|
|
243
251
|
Choose the right delivery tool based on the content:
|
|
244
252
|
|
|
@@ -8,9 +8,9 @@ metadata:
|
|
|
8
8
|
display-name: "Screen Annotation"
|
|
9
9
|
category: "system"
|
|
10
10
|
activation-hints:
|
|
11
|
-
- "User asks where something is,
|
|
12
|
-
- "User wants to be shown
|
|
13
|
-
- "The answer
|
|
11
|
+
- "User asks where something is, how to do it, or to be walked through it, in an app they share on a call"
|
|
12
|
+
- "User wants to be shown, not have it done for them"
|
|
13
|
+
- "The answer is a place on the user's screen"
|
|
14
14
|
avoid-when:
|
|
15
15
|
- "User wants the assistant to do the thing rather than be shown it (use computer-use)"
|
|
16
16
|
- "Nothing is being shared, so there is no surface to point at"
|
|
@@ -22,7 +22,7 @@ thing themselves.
|
|
|
22
22
|
This is the opposite errand from computer use. Nothing here clicks, types or
|
|
23
23
|
drives anything: the marks are a way of pointing while you talk, for someone
|
|
24
24
|
who wants to learn where a control is rather than have it operated for them.
|
|
25
|
-
|
|
25
|
+
A mark is drawn clear of what it indicates and never takes the mouse, so
|
|
26
26
|
what you point at stays visible and clickable the whole time.
|
|
27
27
|
|
|
28
28
|
## Requires a screen share
|
|
@@ -31,18 +31,51 @@ Marks are drawn on the frame around the surface the user is sharing with the
|
|
|
31
31
|
call. With nothing shared there is nowhere to draw, and `screen_point_at`
|
|
32
32
|
fails saying so. Ask them to share their screen from the call, then point.
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Say what to point at
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
**Name the thing.** `{"target": "color balance", "caption": "Click this"}`.
|
|
37
|
+
The name is looked up on the surface itself, which knows where its controls
|
|
38
|
+
actually are, and an arrow is drawn at it.
|
|
39
|
+
|
|
40
|
+
**The label, not a description of it.** What is matched is the control's own
|
|
41
|
+
name. Casing, spacing and punctuation are forgiven, so `Color Balance` finds
|
|
42
|
+
`color balance`; nothing beyond that is, so "the stabilization button" finds
|
|
43
|
+
nothing, because no control is called that. Give the label on its own:
|
|
44
|
+
`stabilization`, `Send`, `Search`.
|
|
45
|
+
|
|
46
|
+
The arrow points at the middle of the control and stops just short, so what
|
|
47
|
+
you are sending someone to stays visible the whole time.
|
|
39
48
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
You are answered with what was drawn and the name it resolved to, which is not
|
|
50
|
+
always the name you asked for. Say the resolved one out loud: it is the word
|
|
51
|
+
the user can see.
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
A name the surface does not carry draws nothing and comes back with the names
|
|
54
|
+
it does carry. That is the answer, not a setback: the thing is nearly always
|
|
55
|
+
one of those, so read the list and point again. **Never fall back to
|
|
56
|
+
coordinates for a control you could not find.** A mark drawn at a guess is
|
|
57
|
+
worse than no mark, because someone follows it; the words you say are the
|
|
58
|
+
better tool for a thing you cannot point at. What the user calls something and
|
|
59
|
+
what the surface calls it often differ, which is what the list is for: they
|
|
60
|
+
may say "white balance" where the control reads `color balance`, or "the
|
|
61
|
+
stabilization button" where it reads `stabilization`.
|
|
62
|
+
|
|
63
|
+
## Coordinates, for an extent
|
|
64
|
+
|
|
65
|
+
For when the size of the thing is the message rather than where it is: a
|
|
66
|
+
region of an image, an area of a canvas, a panel spoken of as a whole. These
|
|
67
|
+
draw a ring around the bounds instead of an arrow at a place.
|
|
68
|
+
|
|
69
|
+
Fractions of the shared surface, `0` to `1`, measured against **the picture of
|
|
70
|
+
that surface you were last shown**. `x` and `y` are the top-left corner,
|
|
71
|
+
`width` and `height` the size. Give the bounds of the thing itself: the ring is
|
|
72
|
+
drawn around them, so a box tight on a button reads as a ring around that
|
|
73
|
+
button, and a box drawn where you think the ring should go puts the ring
|
|
74
|
+
outside that instead.
|
|
75
|
+
|
|
76
|
+
These are a guess measured off a picture that has been scaled on its way to
|
|
77
|
+
you, and they are only as fresh as the last frame you were sent. If the user
|
|
78
|
+
has scrolled or moved a window since, say what you are pointing at as well as
|
|
46
79
|
drawing it, so a mark that has drifted is still recoverable in words.
|
|
47
80
|
|
|
48
81
|
Moving the share is the one kind of drift that is caught for you. A mark
|
|
@@ -53,7 +86,7 @@ it. Wait for a frame of the new one and point again.
|
|
|
53
86
|
## How to point
|
|
54
87
|
|
|
55
88
|
**One thing at a time.** A mark is where to look next. A screen with four
|
|
56
|
-
|
|
89
|
+
marks on it is not four times as helpful; it is a diagram, and nobody knows
|
|
57
90
|
which one to start with. Point at the current step, talk, then point at the
|
|
58
91
|
next one.
|
|
59
92
|
|
|
@@ -63,18 +96,52 @@ caption is drawn over the user's own work in a window they cannot scroll or
|
|
|
63
96
|
dismiss, and it is capped at 80 characters for that reason.
|
|
64
97
|
|
|
65
98
|
**Say it as well as draw it.** The marks are a gesture that accompanies
|
|
66
|
-
speech, the way a person points while explaining. A
|
|
99
|
+
speech, the way a person points while explaining. A mark with no words is a
|
|
67
100
|
riddle.
|
|
68
101
|
|
|
69
102
|
**Take them down when they stop being true.** Call `screen_clear_marks` when
|
|
70
103
|
the step is done, when the user has moved on, or when the conversation has
|
|
71
104
|
left the screen behind. Marks come down on their own if the share ends or
|
|
72
|
-
moves, but a
|
|
105
|
+
moves, but a mark left standing over a finished step is one the user has to
|
|
73
106
|
work out is stale.
|
|
74
107
|
|
|
108
|
+
## Walking someone through several steps
|
|
109
|
+
|
|
110
|
+
Sometimes the answer is one pointer. Sometimes it is a route: four places to
|
|
111
|
+
click, in order, before the thing they asked about happens. Decide which it is
|
|
112
|
+
before you draw anything, because the two are paced differently.
|
|
113
|
+
|
|
114
|
+
**Say the route before you start it.** "There are three steps. First the
|
|
115
|
+
Share menu, then the format, then Export." If they asked how and you inferred
|
|
116
|
+
they want to be walked through it rather than told, this is where they wave it
|
|
117
|
+
off and just want the answer. Keep it to the count and the landmarks; the
|
|
118
|
+
detail belongs to each step as you reach it.
|
|
119
|
+
|
|
120
|
+
**One step, then stop.** Point at it, say what to do, and then wait. The
|
|
121
|
+
temptation is to narrate the next step while the mark for this one is still
|
|
122
|
+
up, and that leaves them doing step one with instructions for step two in
|
|
123
|
+
their ear. Silence is the cue that it is their turn.
|
|
124
|
+
|
|
125
|
+
**Advance on evidence, not on time.** Move to the next step when a fresh
|
|
126
|
+
picture shows this one done, or when they tell you it is. Do not move on
|
|
127
|
+
because a plausible amount of time has passed. If the next picture shows the
|
|
128
|
+
step not done, or done to the wrong thing, point at the same place again with
|
|
129
|
+
a shorter caption and say what you saw. Pointing at the next step while the
|
|
130
|
+
previous one is still open is how someone ends up two steps behind a mark.
|
|
131
|
+
|
|
132
|
+
**Going back is just pointing again.** There is no undo. If they went past
|
|
133
|
+
something, or want to see step two again, point at step two. Say which step
|
|
134
|
+
it is, so the words and the mark agree about where you both are.
|
|
135
|
+
|
|
136
|
+
**Close it out.** When the last step is done, clear the marks and say so, in a
|
|
137
|
+
word. A mark left on the final button is one the user has to work out is
|
|
138
|
+
stale, and a walkthrough that ends without an ending leaves them waiting for
|
|
139
|
+
step five of four.
|
|
140
|
+
|
|
75
141
|
## Shapes
|
|
76
142
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
around
|
|
143
|
+
A mark is either an arrow at a place or a ring around an extent, and naming a
|
|
144
|
+
control gives you the arrow. Reach for the ring only when the extent is the
|
|
145
|
+
thing being said: "this whole panel", "this part of the picture". A ring
|
|
146
|
+
around one button says something about where that button ends, which is
|
|
147
|
+
rarely what you mean and is the part most likely to be wrong.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"tools": [
|
|
4
4
|
{
|
|
5
5
|
"name": "screen_point_at",
|
|
6
|
-
"description": "Point at something on the screen the user is sharing with the call: draws
|
|
6
|
+
"description": "Point at something on the screen the user is sharing with the call: draws an arrow at it, with a short caption beside it. Replaces whatever is currently drawn.\n\nName what to point at with `target`, written the way the control's own label is written: \"color balance\", \"Send\", \"Search\". The name is looked up on the surface itself, and the arrow lands on it. This is how to point at a control. A name the surface does not carry draws nothing and comes back with the names it does carry, to point again with or to say out loud.\n\nGive `x`/`y`/`width`/`height` only when the extent is the message: a region of an image, an area of a canvas, a panel named as a whole. Those draw a ring around the bounds, and they are fractions of the shared surface measured against the picture you were last shown, so they are a guess at where something is rather than a reading of it.\n\nRequires the user to be sharing their screen. If nothing is shared this fails, and the right move is to ask them to share before pointing again.",
|
|
7
7
|
"category": "screen-annotation",
|
|
8
8
|
"risk": "low",
|
|
9
9
|
"input_schema": {
|
|
@@ -15,14 +15,31 @@
|
|
|
15
15
|
"maxItems": 4,
|
|
16
16
|
"items": {
|
|
17
17
|
"type": "object",
|
|
18
|
+
"description": "One thing to point at: `target` naming a control, which draws an arrow at it, or all four bounds giving a region, which draws a ring around it. Naming is exact; bounds are estimated. One or the other, never both and never part of either.",
|
|
19
|
+
"oneOf": [
|
|
20
|
+
{
|
|
21
|
+
"description": "A control, named and found on the surface. An arrow lands on it.",
|
|
22
|
+
"required": ["target"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"description": "A region, measured off the picture you were last shown. A ring is drawn around it, and all four bounds are needed to have one.",
|
|
26
|
+
"required": ["x", "y", "width", "height"]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
18
29
|
"properties": {
|
|
30
|
+
"target": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 120,
|
|
34
|
+
"description": "The control's label, written the way the label itself is written: \"color balance\", \"Send\". Looked up on the surface, so the arrow lands on it."
|
|
35
|
+
},
|
|
19
36
|
"x": {
|
|
20
37
|
"type": "number",
|
|
21
|
-
"description": "Left edge
|
|
38
|
+
"description": "Left edge as a fraction of the shared surface's width (0 to 1). Only when the extent is the message."
|
|
22
39
|
},
|
|
23
40
|
"y": {
|
|
24
41
|
"type": "number",
|
|
25
|
-
"description": "Top edge
|
|
42
|
+
"description": "Top edge as a fraction of the shared surface's height (0 to 1). Only when the extent is the message."
|
|
26
43
|
},
|
|
27
44
|
"width": {
|
|
28
45
|
"type": "number",
|
|
@@ -37,8 +54,7 @@
|
|
|
37
54
|
"maxLength": 80,
|
|
38
55
|
"description": "A short imperative for what to do with it, e.g. \"Click Share\". Say the rest out loud."
|
|
39
56
|
}
|
|
40
|
-
}
|
|
41
|
-
"required": ["x", "y", "width", "height"]
|
|
57
|
+
}
|
|
42
58
|
}
|
|
43
59
|
},
|
|
44
60
|
"target_client_id": {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
1
3
|
import { describe, expect, test } from "bun:test";
|
|
2
4
|
|
|
3
5
|
import type { ToolContext } from "../../../../tools/types.js";
|
|
@@ -72,3 +74,68 @@ describe("screen_clear_marks", () => {
|
|
|
72
74
|
});
|
|
73
75
|
});
|
|
74
76
|
});
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The shape of a mark, as the model is told it.
|
|
80
|
+
*
|
|
81
|
+
* The published schema is the only account of the contract the model ever
|
|
82
|
+
* sees: a mark it composes from that schema and sends is rejected on the host
|
|
83
|
+
* by a union that admits exactly two shapes, and the model has no way to
|
|
84
|
+
* learn why. So the schema carries the same two shapes.
|
|
85
|
+
*/
|
|
86
|
+
describe("the published mark schema", () => {
|
|
87
|
+
interface OneOfBranch {
|
|
88
|
+
required?: string[];
|
|
89
|
+
}
|
|
90
|
+
interface ItemSchema {
|
|
91
|
+
oneOf?: OneOfBranch[];
|
|
92
|
+
properties?: Record<string, unknown>;
|
|
93
|
+
}
|
|
94
|
+
const toolsJson = JSON.parse(
|
|
95
|
+
readFileSync(join(import.meta.dir, "..", "TOOLS.json"), "utf-8"),
|
|
96
|
+
) as {
|
|
97
|
+
tools: {
|
|
98
|
+
name: string;
|
|
99
|
+
input_schema: { properties: { marks: { items: ItemSchema } } };
|
|
100
|
+
}[];
|
|
101
|
+
};
|
|
102
|
+
const item = toolsJson.tools.find((tool) => tool.name === "screen_point_at")!
|
|
103
|
+
.input_schema.properties.marks.items;
|
|
104
|
+
|
|
105
|
+
/** `oneOf` as JSON Schema reads it: satisfied by exactly one branch. */
|
|
106
|
+
const accepts = (mark: Record<string, unknown>): boolean => {
|
|
107
|
+
const fits = (item.oneOf ?? []).filter((branch) =>
|
|
108
|
+
(branch.required ?? []).every((key) => key in mark),
|
|
109
|
+
);
|
|
110
|
+
return fits.length === 1;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
test("a named target is a mark", () => {
|
|
114
|
+
expect(accepts({ target: "Send" })).toBe(true);
|
|
115
|
+
expect(accepts({ target: "Send", caption: "Click this" })).toBe(true);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("all four bounds are a mark", () => {
|
|
119
|
+
expect(accepts({ x: 0.1, y: 0.2, width: 0.3, height: 0.1 })).toBe(true);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
test("neither shape, or half of one, is not a mark", () => {
|
|
123
|
+
expect(accepts({})).toBe(false);
|
|
124
|
+
expect(accepts({ caption: "Click this" })).toBe(false);
|
|
125
|
+
expect(accepts({ x: 0.2 })).toBe(false);
|
|
126
|
+
expect(accepts({ x: 0.1, y: 0.2, width: 0.3 })).toBe(false);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
/** An empty name is a name of nothing, and the host rejects it as one. */
|
|
130
|
+
test("a target has to say something", () => {
|
|
131
|
+
const target = item.properties?.target as { minLength?: number };
|
|
132
|
+
expect(target.minLength).toBe(1);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
/** Both shapes at once names a target and estimates it in the same breath. */
|
|
136
|
+
test("a name and bounds together is not a mark", () => {
|
|
137
|
+
expect(
|
|
138
|
+
accepts({ target: "Send", x: 0.1, y: 0.2, width: 0.3, height: 0.1 }),
|
|
139
|
+
).toBe(false);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"scope": "client",
|
|
33
33
|
"key": "vision-mode",
|
|
34
34
|
"label": "Vision Mode",
|
|
35
|
-
"description": "Gates
|
|
35
|
+
"description": "Gates hold-to-Live ambient frame sampling in the voice room camera. String-valued so future A/B arms can be added as new values.",
|
|
36
36
|
"defaultEnabled": "off",
|
|
37
37
|
"values": ["off", "on"]
|
|
38
38
|
},
|
|
@@ -78,6 +78,14 @@
|
|
|
78
78
|
"description": "Control Developer nav visibility in macOS settings",
|
|
79
79
|
"defaultEnabled": false
|
|
80
80
|
},
|
|
81
|
+
{
|
|
82
|
+
"id": "vellum-hosted-inference",
|
|
83
|
+
"scope": "assistant",
|
|
84
|
+
"key": "vellum-hosted-inference",
|
|
85
|
+
"label": "Vellum Hosted Inference",
|
|
86
|
+
"description": "Show Vellum-hosted GPU models (Qwen3 8B) in the catalog and the Settings Personality sliders that steer them.",
|
|
87
|
+
"defaultEnabled": false
|
|
88
|
+
},
|
|
81
89
|
{
|
|
82
90
|
"id": "developer-menu-items",
|
|
83
91
|
"scope": "client",
|
|
@@ -366,6 +374,14 @@
|
|
|
366
374
|
"description": "Gates the marketing pricing takeover page (www.vellum.ai/pricing) and the `/assistant/checkout?package=<slug>` deep link its package CTAs target. One flag covers both halves of the funnel so they can never be enabled independently and strand a CTA. When off, the checkout deep link redirects to the in-app plans takeover.",
|
|
367
375
|
"defaultEnabled": false
|
|
368
376
|
},
|
|
377
|
+
{
|
|
378
|
+
"id": "schedule-result-notify",
|
|
379
|
+
"scope": "assistant",
|
|
380
|
+
"key": "schedule-result-notify",
|
|
381
|
+
"label": "Schedule Result Notify",
|
|
382
|
+
"description": "Gates the `schedule.result` fallback notification the assistant sends when an execute-mode schedule run produces user-facing output but never notifies about it itself. On by default; turn it off to return to notify-only-if-the-run-said-so, where a scheduled briefing can run and leave no trace outside its own conversation.",
|
|
383
|
+
"defaultEnabled": true
|
|
384
|
+
},
|
|
369
385
|
{
|
|
370
386
|
"id": "assistant-reply-push",
|
|
371
387
|
"scope": "assistant",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
catalogSupportsModality,
|
|
5
|
+
resolveModalityOverride,
|
|
6
|
+
} from "./input-modalities.js";
|
|
7
|
+
|
|
8
|
+
describe("catalogSupportsModality", () => {
|
|
9
|
+
test("text is always supported", () => {
|
|
10
|
+
expect(catalogSupportsModality("text", undefined)).toBe(true);
|
|
11
|
+
expect(catalogSupportsModality("text", { supportsVision: false })).toBe(
|
|
12
|
+
true,
|
|
13
|
+
);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("image follows supportsVision and fails closed when unknown", () => {
|
|
17
|
+
expect(catalogSupportsModality("image", undefined)).toBe(false);
|
|
18
|
+
expect(catalogSupportsModality("image", { supportsVision: true })).toBe(
|
|
19
|
+
true,
|
|
20
|
+
);
|
|
21
|
+
expect(catalogSupportsModality("image", { supportsVision: false })).toBe(
|
|
22
|
+
false,
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("audio follows supportsAudioInput and fails closed when unknown", () => {
|
|
27
|
+
expect(catalogSupportsModality("audio", undefined)).toBe(false);
|
|
28
|
+
expect(
|
|
29
|
+
catalogSupportsModality("audio", { supportsAudioInput: true }),
|
|
30
|
+
).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("video has no catalog flag and fails closed", () => {
|
|
34
|
+
expect(
|
|
35
|
+
catalogSupportsModality("video", {
|
|
36
|
+
supportsVision: true,
|
|
37
|
+
supportsAudioInput: true,
|
|
38
|
+
}),
|
|
39
|
+
).toBe(false);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe("resolveModalityOverride", () => {
|
|
44
|
+
test("untouched inherits the catalog value, including unknown", () => {
|
|
45
|
+
expect(resolveModalityOverride(undefined, true)).toBe(true);
|
|
46
|
+
expect(resolveModalityOverride(undefined, false)).toBe(false);
|
|
47
|
+
expect(resolveModalityOverride(undefined, undefined)).toBeUndefined();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("enabled and supported together reach the wire even when the catalog is unknown", () => {
|
|
51
|
+
expect(
|
|
52
|
+
resolveModalityOverride({ enabled: true, supported: true }, undefined),
|
|
53
|
+
).toBe(true);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
test("enabled without a support declaration inherits the catalog", () => {
|
|
57
|
+
expect(resolveModalityOverride({ enabled: true }, false)).toBe(false);
|
|
58
|
+
expect(resolveModalityOverride({ enabled: true }, undefined)).toBe(false);
|
|
59
|
+
expect(resolveModalityOverride({ enabled: true }, true)).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test("disabled policy blocks a catalog-supported modality", () => {
|
|
63
|
+
expect(
|
|
64
|
+
resolveModalityOverride({ enabled: false, supported: true }, true),
|
|
65
|
+
).toBe(false);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test("supported: true without enabled defaults enabled to true", () => {
|
|
69
|
+
expect(resolveModalityOverride({ supported: true }, false)).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
});
|