@vellumai/assistant 0.4.11 → 0.4.13

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.
Files changed (111) hide show
  1. package/ARCHITECTURE.md +401 -385
  2. package/package.json +1 -1
  3. package/src/__tests__/guardian-verify-setup-skill-regression.test.ts +75 -61
  4. package/src/__tests__/registry.test.ts +235 -187
  5. package/src/__tests__/secure-keys.test.ts +27 -0
  6. package/src/__tests__/session-agent-loop.test.ts +521 -256
  7. package/src/__tests__/session-surfaces-task-progress.test.ts +1 -0
  8. package/src/__tests__/session-tool-setup-app-refresh.test.ts +1 -0
  9. package/src/__tests__/session-tool-setup-memory-scope.test.ts +1 -0
  10. package/src/__tests__/session-tool-setup-side-effect-flag.test.ts +1 -0
  11. package/src/__tests__/skills.test.ts +334 -276
  12. package/src/__tests__/slack-skill.test.ts +124 -0
  13. package/src/__tests__/starter-task-flow.test.ts +7 -17
  14. package/src/agent/loop.ts +10 -3
  15. package/src/config/bundled-skills/chatgpt-import/tools/chatgpt-import.ts +449 -0
  16. package/src/config/bundled-skills/doordash/SKILL.md +171 -0
  17. package/src/config/bundled-skills/doordash/__tests__/doordash-client.test.ts +203 -0
  18. package/src/config/bundled-skills/doordash/__tests__/doordash-session.test.ts +164 -0
  19. package/src/config/bundled-skills/doordash/doordash-cli.ts +1193 -0
  20. package/src/config/bundled-skills/doordash/doordash-entry.ts +22 -0
  21. package/src/config/bundled-skills/doordash/lib/cart-queries.ts +787 -0
  22. package/src/config/bundled-skills/doordash/lib/client.ts +1071 -0
  23. package/src/config/bundled-skills/doordash/lib/order-queries.ts +85 -0
  24. package/src/config/bundled-skills/doordash/lib/queries.ts +28 -0
  25. package/src/config/bundled-skills/doordash/lib/query-extractor.ts +94 -0
  26. package/src/config/bundled-skills/doordash/lib/search-queries.ts +203 -0
  27. package/src/config/bundled-skills/doordash/lib/session.ts +93 -0
  28. package/src/config/bundled-skills/doordash/lib/shared/errors.ts +61 -0
  29. package/src/config/bundled-skills/doordash/lib/shared/ipc.ts +32 -0
  30. package/src/config/bundled-skills/doordash/lib/shared/network-recorder.ts +380 -0
  31. package/src/config/bundled-skills/doordash/lib/shared/platform.ts +35 -0
  32. package/src/config/bundled-skills/doordash/lib/shared/recording-store.ts +43 -0
  33. package/src/config/bundled-skills/doordash/lib/shared/recording-types.ts +49 -0
  34. package/src/config/bundled-skills/doordash/lib/shared/truncate.ts +6 -0
  35. package/src/config/bundled-skills/doordash/lib/store-queries.ts +246 -0
  36. package/src/config/bundled-skills/doordash/lib/types.ts +367 -0
  37. package/src/config/bundled-skills/google-calendar/SKILL.md +4 -5
  38. package/src/config/bundled-skills/google-oauth-setup/SKILL.md +41 -41
  39. package/src/config/bundled-skills/messaging/SKILL.md +59 -42
  40. package/src/config/bundled-skills/messaging/TOOLS.json +14 -92
  41. package/src/config/bundled-skills/messaging/tools/gmail-archive-by-query.ts +5 -1
  42. package/src/config/bundled-skills/messaging/tools/gmail-batch-archive.ts +11 -2
  43. package/src/config/bundled-skills/messaging/tools/gmail-outreach-scan.ts +8 -1
  44. package/src/config/bundled-skills/messaging/tools/gmail-sender-digest.ts +12 -4
  45. package/src/config/bundled-skills/messaging/tools/gmail-unsubscribe.ts +5 -1
  46. package/src/config/bundled-skills/messaging/tools/messaging-archive-by-sender.ts +5 -1
  47. package/src/config/bundled-skills/messaging/tools/messaging-sender-digest.ts +5 -2
  48. package/src/config/bundled-skills/notion/SKILL.md +240 -0
  49. package/src/config/bundled-skills/notion-oauth-setup/SKILL.md +127 -0
  50. package/src/config/bundled-skills/oauth-setup/SKILL.md +144 -0
  51. package/src/config/bundled-skills/phone-calls/SKILL.md +76 -45
  52. package/src/config/bundled-skills/skills-catalog/SKILL.md +32 -29
  53. package/src/config/bundled-skills/slack/SKILL.md +49 -0
  54. package/src/config/bundled-skills/slack/TOOLS.json +167 -0
  55. package/src/config/bundled-skills/slack/tools/shared.ts +23 -0
  56. package/src/config/bundled-skills/{messaging → slack}/tools/slack-add-reaction.ts +2 -5
  57. package/src/config/bundled-skills/slack/tools/slack-channel-details.ts +33 -0
  58. package/src/config/bundled-skills/slack/tools/slack-configure-channels.ts +75 -0
  59. package/src/config/bundled-skills/{messaging → slack}/tools/slack-delete-message.ts +2 -5
  60. package/src/config/bundled-skills/{messaging → slack}/tools/slack-leave-channel.ts +2 -5
  61. package/src/config/bundled-skills/slack/tools/slack-scan-digest.ts +193 -0
  62. package/src/config/{vellum-skills → bundled-skills}/sms-setup/SKILL.md +29 -22
  63. package/src/config/{vellum-skills → bundled-skills}/telegram-setup/SKILL.md +17 -14
  64. package/src/config/{vellum-skills → bundled-skills}/twilio-setup/SKILL.md +20 -5
  65. package/src/config/bundled-tool-registry.ts +292 -267
  66. package/src/config/schema.ts +1 -1
  67. package/src/daemon/handlers/skills.ts +334 -234
  68. package/src/daemon/ipc-contract/messages.ts +2 -0
  69. package/src/daemon/ipc-contract/surfaces.ts +2 -0
  70. package/src/daemon/lifecycle.ts +358 -221
  71. package/src/daemon/response-tier.ts +2 -0
  72. package/src/daemon/server.ts +453 -193
  73. package/src/daemon/session-agent-loop-handlers.ts +43 -2
  74. package/src/daemon/session-agent-loop.ts +3 -0
  75. package/src/daemon/session-lifecycle.ts +3 -0
  76. package/src/daemon/session-process.ts +1 -0
  77. package/src/daemon/session-surfaces.ts +22 -20
  78. package/src/daemon/session-tool-setup.ts +1 -0
  79. package/src/daemon/session.ts +5 -2
  80. package/src/messaging/outreach-classifier.ts +12 -5
  81. package/src/messaging/provider-types.ts +5 -0
  82. package/src/messaging/provider.ts +1 -1
  83. package/src/messaging/providers/gmail/adapter.ts +11 -5
  84. package/src/messaging/providers/gmail/client.ts +2 -0
  85. package/src/messaging/providers/slack/adapter.ts +1 -0
  86. package/src/messaging/providers/slack/client.ts +8 -0
  87. package/src/messaging/providers/slack/types.ts +5 -0
  88. package/src/runtime/http-errors.ts +33 -20
  89. package/src/runtime/http-server.ts +706 -291
  90. package/src/runtime/http-types.ts +26 -16
  91. package/src/runtime/routes/secret-routes.ts +57 -2
  92. package/src/runtime/routes/surface-action-routes.ts +66 -0
  93. package/src/runtime/routes/trust-rules-routes.ts +140 -0
  94. package/src/security/keychain-to-encrypted-migration.ts +59 -0
  95. package/src/security/secure-keys.ts +17 -0
  96. package/src/skills/frontmatter.ts +9 -7
  97. package/src/tools/apps/executors.ts +2 -1
  98. package/src/tools/tool-manifest.ts +44 -42
  99. package/src/tools/types.ts +9 -0
  100. package/src/__tests__/skill-mirror-parity.test.ts +0 -176
  101. package/src/config/vellum-skills/catalog.json +0 -63
  102. package/src/config/vellum-skills/chatgpt-import/tools/chatgpt-import.ts +0 -295
  103. package/src/skills/vellum-catalog-remote.ts +0 -166
  104. package/src/tools/skills/vellum-catalog.ts +0 -168
  105. /package/src/config/{vellum-skills → bundled-skills}/chatgpt-import/SKILL.md +0 -0
  106. /package/src/config/{vellum-skills → bundled-skills}/chatgpt-import/TOOLS.json +0 -0
  107. /package/src/config/{vellum-skills → bundled-skills}/deploy-fullstack-vercel/SKILL.md +0 -0
  108. /package/src/config/{vellum-skills → bundled-skills}/document-writer/SKILL.md +0 -0
  109. /package/src/config/{vellum-skills → bundled-skills}/guardian-verify-setup/SKILL.md +0 -0
  110. /package/src/config/{vellum-skills → bundled-skills}/slack-oauth-setup/SKILL.md +0 -0
  111. /package/src/config/{vellum-skills → bundled-skills}/trusted-contacts/SKILL.md +0 -0
@@ -1,168 +0,0 @@
1
- import { RiskLevel } from '../../permissions/types.js';
2
- import type { ToolDefinition } from '../../providers/types.js';
3
- import { parseFrontmatterFields } from '../../skills/frontmatter.js';
4
- import { createManagedSkill } from '../../skills/managed-store.js';
5
- import { checkVellumSkill,fetchCatalogEntries, fetchSkillContent } from '../../skills/vellum-catalog-remote.js';
6
- import type { Tool, ToolContext, ToolExecutionResult } from '../types.js';
7
-
8
- export interface CatalogEntry {
9
- id: string;
10
- name: string;
11
- description: string;
12
- emoji?: string;
13
- includes?: string[];
14
- version?: string;
15
- }
16
-
17
- export { checkVellumSkill,fetchCatalogEntries as listCatalogEntries };
18
-
19
- /**
20
- * Install a skill from the vellum-skills catalog by ID.
21
- * Fetches SKILL.md from GitHub (with bundled fallback) and creates a managed skill.
22
- * Returns { success, skillName, error }.
23
- */
24
- export async function installFromVellumCatalog(skillId: string, options?: { overwrite?: boolean }): Promise<{ success: boolean; skillName?: string; error?: string }> {
25
- const trimmedId = skillId.trim();
26
-
27
- // Verify skill exists in catalog and get its metadata
28
- const catalogEntries = await fetchCatalogEntries();
29
- const catalogEntry = catalogEntries.find((e) => e.id === trimmedId);
30
- if (!catalogEntry) {
31
- return { success: false, error: `Skill "${trimmedId}" not found in the Vellum catalog` };
32
- }
33
-
34
- // Fetch SKILL.md content (remote with bundled fallback)
35
- const content = await fetchSkillContent(trimmedId);
36
- if (!content) {
37
- return { success: false, error: `Skill "${trimmedId}" SKILL.md not found` };
38
- }
39
-
40
- const parsed = parseFrontmatterFields(content);
41
- if (!parsed) {
42
- return { success: false, error: `Skill "${trimmedId}" has invalid SKILL.md` };
43
- }
44
-
45
- const { fields, body: bodyMarkdown } = parsed;
46
-
47
- const name = fields.name?.trim();
48
- const description = fields.description?.trim();
49
- if (!name || !description) {
50
- return { success: false, error: `Skill "${trimmedId}" has invalid SKILL.md (missing name or description)` };
51
- }
52
-
53
- let emoji: string | undefined;
54
- const metadataRaw = fields.metadata?.trim();
55
- if (metadataRaw) {
56
- try {
57
- const metaObj = JSON.parse(metadataRaw);
58
- if (metaObj?.vellum?.emoji) {
59
- emoji = metaObj.vellum.emoji as string;
60
- }
61
- } catch {
62
- // ignore malformed metadata
63
- }
64
- }
65
-
66
- let includes: string[] | undefined;
67
- const includesRaw = fields.includes?.trim();
68
- if (includesRaw) {
69
- try {
70
- const includesObj = JSON.parse(includesRaw);
71
- if (Array.isArray(includesObj) && includesObj.every((item: unknown) => typeof item === 'string')) {
72
- const filtered = (includesObj as string[]).map((s) => s.trim()).filter((s) => s.length > 0);
73
- if (filtered.length > 0) includes = filtered;
74
- }
75
- } catch {
76
- // ignore malformed includes
77
- }
78
- }
79
- const result = createManagedSkill({
80
- id: trimmedId,
81
- name,
82
- description,
83
- bodyMarkdown,
84
- emoji,
85
- includes,
86
- overwrite: options?.overwrite ?? true,
87
- addToIndex: true,
88
- version: catalogEntry.version,
89
- });
90
-
91
- if (!result.created) {
92
- return { success: false, error: result.error };
93
- }
94
-
95
- return { success: true, skillName: trimmedId };
96
- }
97
-
98
- class VellumSkillsCatalogTool implements Tool {
99
- name = 'vellum_skills_catalog';
100
- description = 'List and install Vellum-provided skills from the first-party catalog';
101
- category = 'skills';
102
- defaultRiskLevel = RiskLevel.Low;
103
-
104
- getDefinition(): ToolDefinition {
105
- return {
106
- name: this.name,
107
- description: this.description,
108
- input_schema: {
109
- type: 'object',
110
- properties: {
111
- action: {
112
- type: 'string',
113
- enum: ['list', 'install'],
114
- description: 'The operation to perform. "list" shows available skills; "install" copies a skill to managed skills.',
115
- },
116
- skill_id: {
117
- type: 'string',
118
- description: 'The skill ID to install (required for install action).',
119
- },
120
- overwrite: {
121
- type: 'boolean',
122
- description: 'Whether to overwrite if the skill is already installed (default: false).',
123
- },
124
- },
125
- required: ['action'],
126
- },
127
- };
128
- }
129
-
130
- async execute(input: Record<string, unknown>, _context: ToolContext): Promise<ToolExecutionResult> {
131
- const action = input.action as string;
132
-
133
- switch (action) {
134
- case 'list': {
135
- const entries = await fetchCatalogEntries();
136
- if (entries.length === 0) {
137
- return { content: 'No Vellum-provided skills available in the catalog.', isError: false };
138
- }
139
- return { content: JSON.stringify(entries, null, 2), isError: false };
140
- }
141
-
142
- case 'install': {
143
- const skillId = input.skill_id;
144
- if (typeof skillId !== 'string' || !skillId.trim()) {
145
- return { content: 'Error: skill_id is required for install action', isError: true };
146
- }
147
-
148
- const result = await installFromVellumCatalog(skillId, { overwrite: input.overwrite === true });
149
- if (!result.success) {
150
- return { content: `Error: ${result.error}`, isError: true };
151
- }
152
-
153
- return {
154
- content: JSON.stringify({
155
- installed: true,
156
- skill_id: result.skillName,
157
- }),
158
- isError: false,
159
- };
160
- }
161
-
162
- default:
163
- return { content: `Error: unknown action "${action}". Use "list" or "install".`, isError: true };
164
- }
165
- }
166
- }
167
-
168
- export const vellumSkillsCatalogTool: Tool = new VellumSkillsCatalogTool();