@vellumai/assistant 0.10.9-staging.1 → 0.10.9
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 +4 -0
- package/knip.json +1 -4
- package/openapi.yaml +27 -17
- package/package.json +1 -1
- package/src/__tests__/always-loaded-tools-guard.test.ts +4 -6
- package/src/__tests__/app-routes-csp.test.ts +13 -4
- package/src/__tests__/conversation-tool-setup-tools-disabled.test.ts +4 -8
- package/src/__tests__/disk-pressure-tools.test.ts +4 -4
- package/src/__tests__/file-list-tool.test.ts +22 -12
- package/src/__tests__/list-all-apps.test.ts +204 -0
- package/src/__tests__/messaging-send-tool.test.ts +67 -0
- package/src/__tests__/mtime-cache.test.ts +42 -0
- package/src/__tests__/oauth-provider-profiles.test.ts +3 -2
- package/src/__tests__/outlook-messaging-provider.test.ts +71 -0
- package/src/__tests__/plugin-app-serve-routes.test.ts +163 -0
- package/src/__tests__/plugin-import-boundary-guard.test.ts +1 -0
- package/src/__tests__/scaffold-managed-skill-tool.test.ts +47 -0
- package/src/__tests__/subagent-notify-parent.test.ts +4 -3
- package/src/__tests__/subagent-tool-filtering.test.ts +21 -21
- package/src/__tests__/subagent-tool-gate-mode.test.ts +6 -6
- package/src/apps/app-store.ts +302 -2
- package/src/cli/AGENTS.md +17 -0
- package/src/cli/commands/__tests__/gateway.test.ts +55 -0
- package/src/cli/commands/apps.help.ts +17 -11
- package/src/cli/commands/apps.ts +5 -15
- package/src/cli/commands/gateway.help.ts +30 -0
- package/src/cli/commands/gateway.ts +40 -1
- package/src/cli/commands/platform/__tests__/status.test.ts +0 -90
- package/src/cli/commands/platform/index.help.ts +3 -2
- package/src/cli/commands/platform/index.ts +0 -9
- package/src/cli/commands/routes.help.ts +13 -7
- package/src/cli/commands/routes.ts +5 -3
- package/src/cli/commands/status.help.ts +24 -0
- package/src/cli/commands/status.ts +29 -0
- package/src/cli/lib/__tests__/global-json-option.test.ts +97 -0
- package/src/cli/lib/__tests__/plugin-catalog-local.test.ts +1 -0
- package/src/cli/lib/__tests__/plugin-fingerprint.test.ts +31 -0
- package/src/cli/lib/bundled-marketplace.json +187 -173
- package/src/cli/lib/global-json-option.ts +41 -0
- package/src/cli/lib/plugin-fingerprint.ts +18 -7
- package/src/cli/program.ts +5 -0
- package/src/config/bundled-skills/messaging/TOOLS.json +2 -2
- package/src/config/bundled-skills/messaging/tools/messaging-send.ts +27 -19
- package/src/config/bundled-skills/phone-calls/references/TROUBLESHOOTING.md +3 -3
- package/src/config/feature-flag-registry.json +1 -9
- package/src/daemon/__tests__/conversation-tool-setup-exclude.test.ts +3 -6
- package/src/daemon/__tests__/conversation-tool-setup-plugin-scope.test.ts +3 -6
- package/src/daemon/__tests__/conversation-tool-setup.test.ts +8 -5
- package/src/daemon/conversation-tool-setup.ts +5 -90
- package/src/daemon/conversation.ts +2 -2
- package/src/messaging/provider-types.ts +9 -0
- package/src/messaging/providers/outlook/adapter.ts +17 -2
- package/src/messaging/providers/outlook/client.ts +11 -2
- package/src/messaging/providers/outlook/types.ts +9 -0
- package/src/monitoring/__tests__/plugin-source-watch.test.ts +37 -0
- package/src/monitoring/plugin-source-watch.ts +53 -0
- package/src/oauth/seed-providers.ts +6 -0
- package/src/persistence/embeddings/__tests__/messages-lexical-index.test.ts +3 -0
- package/src/persistence/embeddings/messages-lexical-index.ts +11 -0
- package/src/plugin-api/conversation-turn.ts +234 -0
- package/src/plugin-api/index.ts +12 -0
- package/src/plugins/__tests__/source-fingerprint.test.ts +41 -0
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-job.test.ts +48 -0
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-skill-card.test.ts +46 -5
- package/src/plugins/defaults/memory/graph/tool-handlers.ts +2 -2
- package/src/plugins/defaults/memory/graph-topology/__tests__/build-memory-graph.test.ts +81 -2
- package/src/plugins/defaults/memory/graph-topology/build-memory-graph.ts +80 -33
- package/src/plugins/defaults/memory/memory-retrospective-job.ts +40 -1
- package/src/plugins/defaults/memory/memory-retrospective-skill-card.ts +28 -2
- package/src/plugins/mtime-cache.ts +26 -13
- package/src/plugins/plugin-tree-walk.ts +30 -0
- package/src/plugins/source-fingerprint.ts +9 -2
- package/src/plugins/surface-import.ts +28 -0
- package/src/providers/speech-to-text/__tests__/vellum-managed-realtime.test.ts +1 -1
- package/src/providers/speech-to-text/__tests__/vellum-speech-relay-connection.test.ts +4 -1
- package/src/providers/speech-to-text/vellum-speech-relay-connection.ts +5 -0
- package/src/runtime/routes/__tests__/gateway-status-routes.test.ts +84 -0
- package/src/runtime/routes/__tests__/plugins-routes.test.ts +47 -3
- package/src/runtime/routes/__tests__/user-routes-cli.test.ts +154 -0
- package/src/runtime/routes/app-management-routes.ts +96 -32
- package/src/runtime/routes/app-routes.ts +33 -17
- package/src/runtime/routes/gateway-status-routes.ts +69 -0
- package/src/runtime/routes/index.ts +2 -0
- package/src/runtime/routes/platform-routes.ts +4 -14
- package/src/runtime/routes/plugins-routes.ts +58 -1
- package/src/runtime/routes/settings-routes.ts +8 -6
- package/src/runtime/routes/user-route-dispatcher.ts +6 -86
- package/src/runtime/routes/user-route-resolution.ts +141 -0
- package/src/runtime/routes/user-routes-cli.ts +56 -35
- package/src/telemetry/AGENTS.md +15 -0
- package/src/telemetry/__tests__/telemetry-event-fixtures.ts +258 -0
- package/src/telemetry/telemetry-wire-source.json +1 -1
- package/src/telemetry/telemetry-wire-validation.test.ts +157 -0
- package/src/telemetry/telemetry-wire-validation.ts +125 -0
- package/src/telemetry/telemetry-wire.generated.ts +60 -9
- package/src/telemetry/types.test.ts +38 -0
- package/src/telemetry/types.ts +183 -91
- package/src/telemetry/usage-telemetry-reporter.ts +5 -0
- package/src/telemetry/watchdog-direct-emit.ts +6 -0
- package/src/tools/skills/scaffold-managed.ts +43 -11
|
@@ -12,11 +12,15 @@ import {
|
|
|
12
12
|
createManagedSkill,
|
|
13
13
|
getManagedSkillDir,
|
|
14
14
|
} from "../../skills/managed-store.js";
|
|
15
|
+
import { recordWatchdogEvent } from "../../telemetry/watchdog-events-store.js";
|
|
15
16
|
import { getLogger } from "../../util/logger.js";
|
|
16
17
|
import type { ToolContext, ToolExecutionResult } from "../types.js";
|
|
17
18
|
|
|
18
19
|
const log = getLogger("scaffold-managed-skill");
|
|
19
20
|
|
|
21
|
+
/** Watchdog check_name for the per-creation skill-authoring counter. */
|
|
22
|
+
const SKILL_AUTHORED_CHECK_NAME = "skill_authored";
|
|
23
|
+
|
|
20
24
|
/** Strip embedded newlines/carriage returns to prevent YAML frontmatter injection. */
|
|
21
25
|
function sanitizeFrontmatterValue(value: string): string {
|
|
22
26
|
return value.replace(/[\r\n]+/g, " ").trim();
|
|
@@ -37,7 +41,9 @@ function normalizeOptionalStringArray(
|
|
|
37
41
|
raw: unknown,
|
|
38
42
|
field: string,
|
|
39
43
|
): { value?: string[]; error?: string } {
|
|
40
|
-
if (raw === undefined)
|
|
44
|
+
if (raw === undefined) {
|
|
45
|
+
return {};
|
|
46
|
+
}
|
|
41
47
|
if (!Array.isArray(raw)) {
|
|
42
48
|
return { error: `${field} must be an array of strings` };
|
|
43
49
|
}
|
|
@@ -51,7 +57,9 @@ function normalizeOptionalStringArray(
|
|
|
51
57
|
if (!cleaned) {
|
|
52
58
|
return { error: `each element in ${field} must be a non-empty string` };
|
|
53
59
|
}
|
|
54
|
-
if (seen.has(cleaned))
|
|
60
|
+
if (seen.has(cleaned)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
55
63
|
seen.add(cleaned);
|
|
56
64
|
normalized.push(cleaned);
|
|
57
65
|
}
|
|
@@ -199,12 +207,14 @@ export async function executeScaffoldManagedSkill(
|
|
|
199
207
|
context.requestOrigin === MEMORY_RETROSPECTIVE_ORIGIN;
|
|
200
208
|
const author = fromRetrospective ? "assistant" : "user";
|
|
201
209
|
|
|
202
|
-
// Whether a managed SKILL.md already existed before this call.
|
|
203
|
-
//
|
|
204
|
-
//
|
|
205
|
-
// genuine CREATE (no pre-existing skill, regardless of the `overwrite`
|
|
206
|
-
// gets a card.
|
|
207
|
-
|
|
210
|
+
// Whether a managed SKILL.md already existed before this call. Drives the
|
|
211
|
+
// ownership backstop below, the created-vs-refined discriminant for the
|
|
212
|
+
// skill-card enqueue, and the `skill_authored` telemetry counter: only a
|
|
213
|
+
// genuine CREATE (no pre-existing skill, regardless of the `overwrite`
|
|
214
|
+
// flag) gets a card or a counter event.
|
|
215
|
+
const managedSkillExistedBefore = existsSync(
|
|
216
|
+
join(getManagedSkillDir(id), "SKILL.md"),
|
|
217
|
+
);
|
|
208
218
|
|
|
209
219
|
// Ownership backstop (retrospective origin only): the retrospective may author
|
|
210
220
|
// a skill ONLY if it owns it. Fail closed on either of two collisions.
|
|
@@ -234,11 +244,9 @@ export async function executeScaffoldManagedSkill(
|
|
|
234
244
|
// exactly "assistant". This fails closed on user-authored, untagged, and
|
|
235
245
|
// unverifiable (missing/corrupt meta) managed skills alike, matching the
|
|
236
246
|
// prune side where such skills are never pruned.
|
|
237
|
-
const managedDir = getManagedSkillDir(id);
|
|
238
|
-
managedSkillExistedBefore = existsSync(join(managedDir, "SKILL.md"));
|
|
239
247
|
if (
|
|
240
248
|
managedSkillExistedBefore &&
|
|
241
|
-
readInstallMeta(
|
|
249
|
+
readInstallMeta(getManagedSkillDir(id))?.author !== "assistant"
|
|
242
250
|
) {
|
|
243
251
|
return {
|
|
244
252
|
content: `Error: skill "${id}" is not verifiably assistant-authored; the retrospective may not overwrite it or write companion files into it. Author a new skill instead.`,
|
|
@@ -298,6 +306,30 @@ export async function executeScaffoldManagedSkill(
|
|
|
298
306
|
|
|
299
307
|
refreshSkillCapabilityMemories();
|
|
300
308
|
|
|
309
|
+
// Central adoption counter for skill authoring (admin analytics groups on
|
|
310
|
+
// the watchdog check_name). Genuine creates only — refinements of a
|
|
311
|
+
// pre-existing skill are not new capabilities and would double-count.
|
|
312
|
+
// `authored_by` distinguishes proactive retrospective authoring from
|
|
313
|
+
// user-directed scaffolds; the skill id itself stays out of the detail
|
|
314
|
+
// bag — ids derive from user/model content (a name can encode a
|
|
315
|
+
// customer or procedure), and watchdog events are metadata-only with no
|
|
316
|
+
// deletion-redaction tie to the source conversation. Never throws: a
|
|
317
|
+
// telemetry failure must not fail a scaffold that already succeeded.
|
|
318
|
+
if (!managedSkillExistedBefore) {
|
|
319
|
+
try {
|
|
320
|
+
recordWatchdogEvent({
|
|
321
|
+
checkName: SKILL_AUTHORED_CHECK_NAME,
|
|
322
|
+
value: 1,
|
|
323
|
+
detail: {
|
|
324
|
+
authored_by: fromRetrospective ? "retrospective" : "user",
|
|
325
|
+
},
|
|
326
|
+
});
|
|
327
|
+
} catch {
|
|
328
|
+
// recordWatchdogEvent already no-ops on opt-out and a missing
|
|
329
|
+
// telemetry DB; anything past that is not worth surfacing here.
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
301
333
|
// Surface a genuine retrospective CREATE to the user as a skill card on the
|
|
302
334
|
// source conversation, via the durable `skill_card_insert` delivery job
|
|
303
335
|
// (memory-retrospective-skill-card.ts). The creation site is the one place
|