@vellumai/assistant 0.8.11-dev.202606112057.e4bc22e → 0.8.11-dev.202606112241.9ae2fdc

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 (45) hide show
  1. package/node_modules/@vellumai/gateway-client/bun.lock +1 -0
  2. package/node_modules/@vellumai/gateway-client/package.json +3 -1
  3. package/node_modules/@vellumai/gateway-client/src/__tests__/gateway-client.test.ts +1 -1
  4. package/node_modules/@vellumai/gateway-client/src/gateway-ipc-contracts.ts +87 -0
  5. package/node_modules/@vellumai/gateway-client/src/index.ts +3 -5
  6. package/openapi.yaml +7 -3
  7. package/package.json +1 -1
  8. package/src/__tests__/agent-loop-compaction-events.test.ts +7 -6
  9. package/src/__tests__/conversation-history-web-search.test.ts +7 -0
  10. package/src/__tests__/credential-security-invariants.test.ts +1 -1
  11. package/src/__tests__/exploration-drift-hook.test.ts +692 -0
  12. package/src/__tests__/guardian-action-store.test.ts +0 -167
  13. package/src/__tests__/subagent-role-registry.test.ts +24 -1
  14. package/src/__tests__/subagent-tools.test.ts +1 -0
  15. package/src/__tests__/tool-error-hook.test.ts +1 -0
  16. package/src/__tests__/tool-result-truncate-hook.test.ts +1 -0
  17. package/src/agent/loop.ts +22 -22
  18. package/src/calls/call-controller.ts +1 -1
  19. package/src/cli/lib/__tests__/plugin-artifact.test.ts +67 -0
  20. package/src/cli/lib/__tests__/plugin-details.test.ts +3 -1
  21. package/src/cli/lib/plugin-artifact.ts +21 -2
  22. package/src/config/bundled-skills/subagent/SKILL.md +2 -0
  23. package/src/config/bundled-skills/subagent/TOOLS.json +8 -2
  24. package/src/daemon/conversation-agent-loop-handlers.ts +41 -16
  25. package/src/ipc/routes/trust-rules.test.ts +66 -72
  26. package/src/memory/__tests__/compaction-log-store-clickhouse.test.ts +432 -0
  27. package/src/memory/{compaction-log-writer-clickhouse.ts → compaction-log-store-clickhouse.ts} +264 -55
  28. package/src/memory/guardian-action-store.ts +1 -376
  29. package/src/plugin-api/types.ts +7 -0
  30. package/src/plugins/defaults/exploration-drift/hooks/post-tool-use.ts +300 -0
  31. package/src/plugins/defaults/exploration-drift/package.json +15 -0
  32. package/src/plugins/defaults/index.ts +25 -0
  33. package/src/runtime/agent-wake.ts +1 -1
  34. package/src/runtime/routes/__tests__/conversation-compaction-routes.test.ts +241 -0
  35. package/src/runtime/routes/__tests__/gateway-log-routes.test.ts +97 -185
  36. package/src/runtime/routes/conversation-compaction-routes.ts +86 -19
  37. package/src/runtime/routes/gateway-log-routes.ts +14 -64
  38. package/src/runtime/routes/plugins-routes.ts +6 -0
  39. package/src/runtime/routes/trust-rules-routes.ts +14 -67
  40. package/src/subagent/types.ts +26 -1
  41. package/src/__tests__/guardian-action-followup-executor.test.ts +0 -322
  42. package/src/__tests__/guardian-action-followup-store.test.ts +0 -373
  43. package/src/__tests__/guardian-action-late-reply.test.ts +0 -1083
  44. package/src/memory/__tests__/compaction-log-writer-clickhouse.test.ts +0 -227
  45. package/src/runtime/guardian-action-followup-executor.ts +0 -306
@@ -6,6 +6,7 @@
6
6
  "name": "@vellumai/gateway-client",
7
7
  "dependencies": {
8
8
  "@vellumai/service-contracts": "file:../service-contracts",
9
+ "zod": "4.3.6",
9
10
  },
10
11
  "devDependencies": {
11
12
  "@types/bun": "1.3.10",
@@ -6,6 +6,7 @@
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": "./src/index.ts",
9
+ "./gateway-ipc-contracts": "./src/gateway-ipc-contracts.ts",
9
10
  "./http-delivery": "./src/http-delivery.ts",
10
11
  "./ipc-client": "./src/ipc-client.ts"
11
12
  },
@@ -14,7 +15,8 @@
14
15
  "test": "bun test src/"
15
16
  },
16
17
  "dependencies": {
17
- "@vellumai/service-contracts": "file:../service-contracts"
18
+ "@vellumai/service-contracts": "file:../service-contracts",
19
+ "zod": "4.3.6"
18
20
  },
19
21
  "devDependencies": {
20
22
  "@types/bun": "1.3.10",
@@ -29,7 +29,7 @@ describe("package independence", () => {
29
29
  "../types.ts",
30
30
  "../http-delivery.ts",
31
31
  "../ipc-client.ts",
32
- "../trust-rules.ts",
32
+ "../gateway-ipc-contracts.ts",
33
33
  ];
34
34
 
35
35
  for (const file of sourceFiles) {
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Shared IPC contracts for assistant-to-gateway gateway-owned reads.
3
+ */
4
+
5
+ import { z } from "zod";
6
+
7
+ export const GATEWAY_LOG_LEVEL_NAMES = [
8
+ "trace",
9
+ "debug",
10
+ "info",
11
+ "warn",
12
+ "error",
13
+ "fatal",
14
+ ] as const;
15
+ export type GatewayLogLevelName = (typeof GATEWAY_LOG_LEVEL_NAMES)[number];
16
+
17
+ const GatewayLogsTailIpcParamsShape = {
18
+ n: z.number().int().min(1).max(1000).optional(),
19
+ level: z.enum(GATEWAY_LOG_LEVEL_NAMES).optional(),
20
+ module: z.string().optional(),
21
+ };
22
+
23
+ export const GatewayLogsTailIpcParamsSchema = z
24
+ .object(GatewayLogsTailIpcParamsShape)
25
+ .strict()
26
+ .default({});
27
+
28
+ export type GatewayLogsTailIpcParams = z.infer<
29
+ typeof GatewayLogsTailIpcParamsSchema
30
+ >;
31
+
32
+ export const GatewayLogsTailRouteParamsSchema = z
33
+ .object({
34
+ ...GatewayLogsTailIpcParamsShape,
35
+ n: z.coerce.number().int().min(1).max(1000).optional(),
36
+ })
37
+ .strict();
38
+
39
+ export type GatewayLogsTailRouteParams = z.infer<
40
+ typeof GatewayLogsTailRouteParamsSchema
41
+ >;
42
+
43
+ export const GatewayLogsTailIpcResponseSchema = z.object({
44
+ lines: z.array(z.record(z.string(), z.unknown())),
45
+ truncated: z.boolean(),
46
+ });
47
+
48
+ export type GatewayLogsTailIpcResponse = z.infer<
49
+ typeof GatewayLogsTailIpcResponseSchema
50
+ >;
51
+
52
+ export const TrustRulesListIpcParamsSchema = z
53
+ .object({
54
+ origin: z.string().optional(),
55
+ tool: z.string().optional(),
56
+ include_all: z.boolean().optional(),
57
+ include_deleted: z.boolean().optional(),
58
+ })
59
+ .strict()
60
+ .default({});
61
+
62
+ export type TrustRulesListIpcParams = z.infer<
63
+ typeof TrustRulesListIpcParamsSchema
64
+ >;
65
+
66
+ export const TrustRuleSchema = z.object({
67
+ id: z.string(),
68
+ tool: z.string(),
69
+ pattern: z.string(),
70
+ risk: z.enum(["low", "medium", "high"]),
71
+ description: z.string(),
72
+ origin: z.enum(["default", "user_defined"]),
73
+ userModified: z.boolean(),
74
+ deleted: z.boolean(),
75
+ createdAt: z.string(),
76
+ updatedAt: z.string(),
77
+ });
78
+
79
+ export type TrustRule = z.infer<typeof TrustRuleSchema>;
80
+
81
+ export const TrustRulesListIpcResponseSchema = z.object({
82
+ rules: z.array(TrustRuleSchema),
83
+ });
84
+
85
+ export type TrustRulesListIpcResponse = z.infer<
86
+ typeof TrustRulesListIpcResponseSchema
87
+ >;
@@ -15,11 +15,9 @@ export {
15
15
  deliverChannelReply,
16
16
  } from "./http-delivery.js";
17
17
 
18
- export {
19
- ipcCall,
20
- IpcCallError,
21
- PersistentIpcClient,
22
- } from "./ipc-client.js";
18
+ export * from "./gateway-ipc-contracts.js";
19
+
20
+ export { ipcCall, IpcCallError, PersistentIpcClient } from "./ipc-client.js";
23
21
 
24
22
  export type {
25
23
  ApprovalActionOption,
package/openapi.yaml CHANGED
@@ -6631,9 +6631,10 @@ paths:
6631
6631
  description:
6632
6632
  Return the chronological list of compaction events that ran in the same agent turn as the call identified
6633
6633
  by `callId`. Turn bounds are walked from the `messages` table (real user messages — tool-result user messages
6634
- are not boundaries). Projected from `llm_request_logs` rows where `call_site = "compactionAgent"`. When the
6635
- conversation has no other messages around the selected call, every compaction strictly before the call's
6636
- `createdAt` is in scope. Drives the Inspector's Compaction tab.
6634
+ are not boundaries). Served from the first-class compaction log when `compactionLogs.destination = "clickhouse"`
6635
+ is configured, falling back to the legacy projection over `llm_request_logs` rows where `call_site =
6636
+ "compactionAgent"`. When the conversation has no other messages around the selected call, every compaction
6637
+ strictly before the call's `createdAt` is in scope. Drives the Inspector's Compaction tab.
6637
6638
  tags:
6638
6639
  - conversations
6639
6640
  responses:
@@ -19573,6 +19574,9 @@ paths:
19573
19574
  sha256:
19574
19575
  type: string
19575
19576
  description: Lowercase 64-char hex SHA-256 the download is verified against.
19577
+ label:
19578
+ description: Optional human label for the download (e.g. "Download for macOS"); absent when the plugin doesn't name it.
19579
+ type: string
19576
19580
  required:
19577
19581
  - url
19578
19582
  - sha256
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellumai/assistant",
3
- "version": "0.8.11-dev.202606112057.e4bc22e",
3
+ "version": "0.8.11-dev.202606112241.9ae2fdc",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -4,8 +4,9 @@
4
4
  * The compaction pipeline between `context_compacting` (start) and
5
5
  * `compaction_completed` (end) is plugin-owned, so consumers reconstruct a
6
6
  * compaction attempt purely from the pair — correlated by `compactionId`.
7
- * These tests pin the pairing contract: shared id, trigger, timestamps, and
8
- * pre-compaction state on the start event.
7
+ * These tests pin the pairing contract: shared id, trigger, timestamps,
8
+ * pre-compaction state on the start event, and the unnested
9
+ * `ContextWindowResult` fields on the end event.
9
10
  */
10
11
  import { afterEach, beforeEach, describe, expect, test } from "bun:test";
11
12
 
@@ -185,11 +186,11 @@ describe("AgentLoop compaction start/end event pair", () => {
185
186
  expect(end!.finishedAt).toBeGreaterThanOrEqual(end!.startedAt);
186
187
  expect(end!.finishedAt).toBeLessThanOrEqual(after);
187
188
 
188
- // Start carries the pre-compaction history; end carries the result and
189
- // the stripped history the summary was built from.
189
+ // Start carries the pre-compaction history; end carries the
190
+ // ContextWindowResult fields unnested on the event.
190
191
  expect(start!.messages.length).toBeGreaterThan(0);
191
- expect(end!.result.compacted).toBe(true);
192
- expect(end!.messages.length).toBeGreaterThan(0);
192
+ expect(end!.compacted).toBe(true);
193
+ expect(end!.exhausted).toBe(false);
193
194
 
194
195
  // Start precedes end in the event stream.
195
196
  expect(events.indexOf(start!)).toBeLessThan(events.indexOf(end!));
@@ -788,6 +788,13 @@ describe("web_search_tool_result structural guard", () => {
788
788
  // tool_result is relevant. Same reasoning as agent/loop.ts above.
789
789
  "plugins/defaults/tool-error/hooks/post-tool-use.ts",
790
790
 
791
+ // Counts unbroken runs of locally-executed exploration tools (bash,
792
+ // file_read, file_list) to detect inline drift. Server-side web search
793
+ // results (web_search_tool_result) are not produced by the tool executor;
794
+ // any non-exploration block simply bounds the trailing run, which is the
795
+ // conservative direction (fewer nudges). Same reasoning as agent/loop.ts.
796
+ "plugins/defaults/exploration-drift/hooks/post-tool-use.ts",
797
+
791
798
  // Reconciles synthesized cancellation tool_results for locally-executed
792
799
  // tools only. Same reasoning as agent/loop.ts above.
793
800
  "daemon/conversation-agent-loop.ts",
@@ -216,7 +216,7 @@ describe("Invariant 2: no generic plaintext secret read API", () => {
216
216
  "media/image-credentials.ts", // shared image-gen credential resolver (provider API key lookup)
217
217
  "memory/embedding-backend.ts", // embedding backend API key lookup
218
218
  "memory/llm-request-log-source-clickhouse.ts", // ClickHouse read source — lazy lookup of clickhouse:url + clickhouse:password + vellum:platform_assistant_id for self-scoped mirror reads
219
- "memory/compaction-log-writer-clickhouse.ts", // ClickHouse compaction log writer — lazy lookup of clickhouse:url + clickhouse:password + vellum:platform_assistant_id for self-scoped event writes
219
+ "memory/compaction-log-store-clickhouse.ts", // ClickHouse compaction log writer — lazy lookup of clickhouse:url + clickhouse:password + vellum:platform_assistant_id for self-scoped event writes
220
220
  "daemon/providers-setup.ts", // provider initialization API key lookup
221
221
  "workspace/migrations/006-services-config.ts", // services config migration reads provider API keys
222
222
  "workspace/migrations/018-rekey-compound-credential-keys.ts", // re-key compound credential storage keys