@vellumai/assistant 0.11.6-dev.202608270454.8569d2d → 0.11.6-dev.202608271936.fef1c19
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/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/node_modules/@vellumai/ces-client/src/http-credentials.ts +161 -0
- package/node_modules/@vellumai/ces-client/src/index.ts +1 -0
- package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/node_modules/@vellumai/gateway-client/src/__tests__/inbound-event-kind.test.ts +128 -0
- package/node_modules/@vellumai/gateway-client/src/inbound-contract.ts +18 -0
- package/node_modules/@vellumai/gateway-client/src/inbound-event-kind.ts +128 -0
- package/node_modules/@vellumai/gateway-client/src/index.ts +12 -0
- package/node_modules/@vellumai/service-contracts/src/rpc.ts +174 -0
- package/openapi.yaml +29 -1
- package/package.json +1 -1
- package/scripts/sync-llm-catalog.ts +6 -0
- package/src/__tests__/channel-inbound-disk-pressure.test.ts +1 -0
- package/src/__tests__/conversation-fork-referential.test.ts +13 -65
- package/src/__tests__/conversation-fork-retrospective.test.ts +99 -74
- package/src/__tests__/credential-record-write-through.test.ts +78 -0
- package/src/__tests__/delete-propagation.test.ts +213 -5
- package/src/__tests__/edit-propagation.test.ts +42 -2
- package/src/__tests__/evict-conversations-for-reload.test.ts +46 -6
- package/src/__tests__/headless-browser-mode.test.ts +27 -0
- package/src/__tests__/helpers/mock-conversation.ts +2 -0
- package/src/__tests__/llm-catalog-parity.test.ts +4 -0
- package/src/__tests__/oauth-connect-orchestrator.test.ts +95 -0
- package/src/__tests__/provider-catalog-visibility.test.ts +17 -0
- package/src/__tests__/provider-platform-proxy-integration.test.ts +8 -1
- package/src/__tests__/reaction-persistence.test.ts +17 -62
- package/src/__tests__/slack-reaction-approvals.test.ts +14 -19
- package/src/__tests__/slack-reaction-guardian-approval.test.ts +5 -1
- package/src/__tests__/subagent-fork-notifications.test.ts +2 -0
- package/src/__tests__/subagent-manager-notify.test.ts +2 -0
- package/src/__tests__/subagent-notify-parent.test.ts +2 -0
- package/src/__tests__/subagent-notify-stale-rebuild.test.ts +85 -0
- package/src/acp/__tests__/acp-auth-marker-store.test.ts +191 -0
- package/src/acp/__tests__/acp-claude-oauth.test.ts +262 -0
- package/src/acp/__tests__/acp-connect-card-state.test.ts +17 -0
- package/src/acp/__tests__/helpers/acp-history-db.ts +10 -3
- package/src/acp/acp-auth-marker-store.ts +196 -0
- package/src/acp/acp-claude-oauth.ts +154 -4
- package/src/acp/acp-connect-card-state.ts +49 -8
- package/src/acp/prepare-agent-env.ts +79 -1
- package/src/acp/resolve-agent.ts +12 -0
- package/src/acp/session-manager.test.ts +183 -0
- package/src/acp/session-manager.ts +110 -6
- package/src/acp/types.ts +17 -0
- package/src/calls/__tests__/voice-session-bridge.test.ts +37 -0
- package/src/calls/voice-session-bridge.ts +13 -0
- package/src/cli/commands/__tests__/browser.test.ts +63 -1
- package/src/cli/commands/browser.ts +30 -10
- package/src/cli/lib/install-from-github.ts +18 -19
- package/src/cli/lib/install-plugin-dependencies.ts +2 -5
- package/src/config/__tests__/memory-retrospective-schema.test.ts +12 -15
- package/src/config/feature-flag-registry.json +16 -0
- package/src/config/schemas/llm.ts +4 -4
- package/src/config/schemas/memory-retrospective.ts +1 -19
- package/src/daemon/conversation-store.ts +18 -28
- package/src/daemon/conversation.ts +12 -0
- package/src/daemon/message-types/sync.ts +4 -0
- package/src/live-voice/__tests__/live-voice-session-telemetry.test.ts +64 -0
- package/src/live-voice/__tests__/live-voice-text-turn.test.ts +37 -0
- package/src/live-voice/__tests__/protocol.test.ts +55 -0
- package/src/live-voice/live-voice-session.ts +24 -2
- package/src/live-voice/protocol.ts +31 -1
- package/src/messaging/read-provider-metadata.ts +32 -0
- package/src/oauth/connect-orchestrator.ts +16 -0
- package/src/oauth/seed-providers.ts +1 -0
- package/src/persistence/__tests__/bulk-write-gate.test.ts +0 -38
- package/src/persistence/bulk-write-gate.ts +9 -10
- package/src/persistence/conversation-crud.ts +88 -134
- package/src/persistence/delivery-crud.ts +27 -0
- package/src/persistence/migrations/370-acp-session-history-auth-error-code.ts +36 -0
- package/src/persistence/migrations/371-acp-session-history-auth-error-credential.ts +40 -0
- package/src/persistence/migrations/372-create-acp-refused-credentials.ts +34 -0
- package/src/persistence/migrations/373-acp-auth-marker-index.ts +27 -0
- package/src/persistence/migrations/__tests__/370-acp-session-history-auth-error-code.test.ts +65 -0
- package/src/persistence/migrations/__tests__/371-acp-session-history-auth-error-credential.test.ts +68 -0
- package/src/persistence/migrations/__tests__/372-create-acp-refused-credentials.test.ts +64 -0
- package/src/persistence/migrations/__tests__/373-acp-auth-marker-index.test.ts +82 -0
- package/src/persistence/schema/acp.ts +25 -0
- package/src/persistence/steps.ts +8 -0
- package/src/platform/platform-patch-queue.test.ts +43 -41
- package/src/plugins/defaults/memory/memory-retrospective-job.ts +6 -6
- package/src/providers/__tests__/provider-secret-catalog.test.ts +1 -0
- package/src/providers/__tests__/vellum-connection-routing.test.ts +21 -3
- package/src/providers/inference/adapter-factory.ts +15 -0
- package/src/providers/inference/auth.ts +14 -14
- package/src/providers/model-catalog.ts +81 -0
- package/src/providers/platform-proxy/constants.ts +5 -0
- package/src/providers/provider-secret-catalog.ts +3 -2
- package/src/providers/vellum/client.ts +29 -0
- package/src/providers/vellum-model-routing.test.ts +2 -0
- package/src/providers/vellum-model-routing.ts +3 -3
- package/src/runtime/guardian-reply-router.ts +12 -9
- package/src/runtime/routes/__tests__/acp-routes.test.ts +527 -0
- package/src/runtime/routes/__tests__/app-management-shared-apps.test.ts +74 -0
- package/src/runtime/routes/acp-routes-list.test.ts +58 -0
- package/src/runtime/routes/acp-routes.ts +253 -47
- package/src/runtime/routes/app-management-routes.ts +80 -47
- package/src/runtime/routes/channel-route-shared.ts +2 -6
- package/src/runtime/routes/credential-prompt-routes.ts +10 -1
- package/src/runtime/routes/inbound-message-handler.ts +94 -65
- package/src/runtime/routes/inbound-stages/acl-enforcement.ts +16 -3
- package/src/runtime/routes/inbound-stages/edit-intercept.ts +20 -2
- package/src/runtime/routes/inbound-stages/guardian-reply-intercept.ts +6 -1
- package/src/runtime/routes/inbound-stages/reaction-intercept.test.ts +18 -14
- package/src/runtime/routes/inbound-stages/reaction-intercept.ts +60 -64
- package/src/runtime/routes/migration-routes.ts +3 -1
- package/src/security/ces-rpc-record-backend.ts +123 -0
- package/src/security/secure-keys.ts +70 -8
- package/src/subagent/notify.ts +49 -3
- package/src/tools/acp/spawn.ts +2 -2
- package/src/tools/browser/__tests__/browser-status.test.ts +7 -0
- package/src/tools/browser/browser-execution.ts +6 -3
- package/src/tools/browser/browser-status-constants.ts +7 -0
- package/src/tools/credentials/metadata-store.ts +65 -16
- package/src/tools/credentials/store.ts +2 -0
- package/src/util/bun-runtime.ts +43 -13
- package/src/util/platform.ts +65 -1
- package/src/util/sqlite3-runtime.ts +25 -5
- package/src/watch/__tests__/watch-retro.test.ts +48 -1
- package/src/watch/watch-retro.ts +46 -4
- package/src/workspace/git-service.ts +2 -12
- package/src/persistence/fork-message-copy.ts +0 -239
- package/src/plugins/defaults/memory/__tests__/fork-message-copy.test.ts +0 -221
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The kind derivation is the single reader of the field encodings, so its
|
|
3
|
+
* matrix is the compatibility contract: every shape an unstamped replayed
|
|
4
|
+
* retry payload can carry must classify exactly as the consumers that read
|
|
5
|
+
* those fields directly would classify it.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, expect, test } from "bun:test";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
inboundEventRefersToAnotherMessage,
|
|
11
|
+
resolveInboundEventKind,
|
|
12
|
+
resolveInboundReactionPayload,
|
|
13
|
+
} from "../inbound-event-kind.js";
|
|
14
|
+
|
|
15
|
+
describe("resolveInboundEventKind", () => {
|
|
16
|
+
test("a stamped kind wins over every legacy field", () => {
|
|
17
|
+
expect(
|
|
18
|
+
resolveInboundEventKind({
|
|
19
|
+
eventKind: "edit",
|
|
20
|
+
callbackData: "message_deleted",
|
|
21
|
+
}),
|
|
22
|
+
).toBe("edit");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("an unrecognized stamp falls back to legacy derivation", () => {
|
|
26
|
+
expect(
|
|
27
|
+
resolveInboundEventKind({ eventKind: "future-kind", isEdit: true }),
|
|
28
|
+
).toBe("edit");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("legacy isEdit classifies as edit", () => {
|
|
32
|
+
expect(resolveInboundEventKind({ isEdit: true })).toBe("edit");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
test("the delete sentinel classifies as delete", () => {
|
|
36
|
+
expect(resolveInboundEventKind({ callbackData: "message_deleted" })).toBe(
|
|
37
|
+
"delete",
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("reaction prefixes classify as reaction, both directions", () => {
|
|
42
|
+
expect(resolveInboundEventKind({ callbackData: "reaction:+1" })).toBe(
|
|
43
|
+
"reaction",
|
|
44
|
+
);
|
|
45
|
+
expect(
|
|
46
|
+
resolveInboundEventKind({ callbackData: "reaction_removed:+1" }),
|
|
47
|
+
).toBe("reaction");
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test("any other callbackData classifies as button", () => {
|
|
51
|
+
expect(
|
|
52
|
+
resolveInboundEventKind({ callbackData: "apr:req-1:approve_once" }),
|
|
53
|
+
).toBe("button");
|
|
54
|
+
expect(resolveInboundEventKind({ callbackData: "some-action-id" })).toBe(
|
|
55
|
+
"button",
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("an empty callbackData is not a family", () => {
|
|
60
|
+
// Mirrors the old hasCallbackData predicate, which required length > 0.
|
|
61
|
+
expect(resolveInboundEventKind({ callbackData: "" })).toBe("message");
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test("callbackQueryId alone classifies as button", () => {
|
|
65
|
+
expect(resolveInboundEventKind({ callbackQueryId: "cbq-1" })).toBe(
|
|
66
|
+
"button",
|
|
67
|
+
);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test("nothing stated is a plain message", () => {
|
|
71
|
+
expect(resolveInboundEventKind({})).toBe("message");
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
describe("inboundEventRefersToAnotherMessage", () => {
|
|
76
|
+
test("only a plain message stands alone", () => {
|
|
77
|
+
expect(inboundEventRefersToAnotherMessage("message")).toBe(false);
|
|
78
|
+
expect(inboundEventRefersToAnotherMessage("edit")).toBe(true);
|
|
79
|
+
expect(inboundEventRefersToAnotherMessage("delete")).toBe(true);
|
|
80
|
+
expect(inboundEventRefersToAnotherMessage("reaction")).toBe(true);
|
|
81
|
+
expect(inboundEventRefersToAnotherMessage("button")).toBe(true);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe("resolveInboundReactionPayload", () => {
|
|
86
|
+
test("a structured payload wins outright", () => {
|
|
87
|
+
expect(
|
|
88
|
+
resolveInboundReactionPayload({
|
|
89
|
+
eventKind: "reaction",
|
|
90
|
+
reaction: { op: "removed", emoji: "+1", targetMessageId: "11.22" },
|
|
91
|
+
callbackData: "reaction:eyes",
|
|
92
|
+
}),
|
|
93
|
+
).toEqual({ op: "removed", emoji: "+1", targetMessageId: "11.22" });
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("a replayed payload parses its sentinel and wire target", () => {
|
|
97
|
+
expect(
|
|
98
|
+
resolveInboundReactionPayload({
|
|
99
|
+
callbackData: "reaction:thumbsup",
|
|
100
|
+
sourceMetadata: { messageId: "33.44" },
|
|
101
|
+
}),
|
|
102
|
+
).toEqual({ op: "added", emoji: "thumbsup", targetMessageId: "33.44" });
|
|
103
|
+
expect(
|
|
104
|
+
resolveInboundReactionPayload({
|
|
105
|
+
callbackData: "reaction_removed:thumbsup",
|
|
106
|
+
sourceMetadata: { messageId: "33.44" },
|
|
107
|
+
}),
|
|
108
|
+
).toEqual({ op: "removed", emoji: "thumbsup", targetMessageId: "33.44" });
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
test("no emoji or no target is not a reaction payload", () => {
|
|
112
|
+
expect(
|
|
113
|
+
resolveInboundReactionPayload({
|
|
114
|
+
callbackData: "reaction:",
|
|
115
|
+
sourceMetadata: { messageId: "33.44" },
|
|
116
|
+
}),
|
|
117
|
+
).toBeNull();
|
|
118
|
+
expect(
|
|
119
|
+
resolveInboundReactionPayload({ callbackData: "reaction:thumbsup" }),
|
|
120
|
+
).toBeNull();
|
|
121
|
+
expect(
|
|
122
|
+
resolveInboundReactionPayload({
|
|
123
|
+
callbackData: "apr:req-1:approve_once",
|
|
124
|
+
sourceMetadata: { messageId: "33.44" },
|
|
125
|
+
}),
|
|
126
|
+
).toBeNull();
|
|
127
|
+
});
|
|
128
|
+
});
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* it in `handleChannelInbound()`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { INBOUND_EVENT_KINDS } from "./inbound-event-kind.js";
|
|
13
14
|
import { z } from "zod";
|
|
14
15
|
|
|
15
16
|
import { ChannelConversationTypeSchema } from "./channel-permission-contract.js";
|
|
@@ -138,6 +139,11 @@ export const SourceMetadataSchema = z
|
|
|
138
139
|
* "not provided", never as a decision.
|
|
139
140
|
*/
|
|
140
141
|
trustVerdict: TrustVerdictSchema.optional(),
|
|
142
|
+
/**
|
|
143
|
+
* The platform named no actor for this event; the actor id is the
|
|
144
|
+
* channel's synthetic system identity, never an identity claim.
|
|
145
|
+
*/
|
|
146
|
+
actorUnattributed: z.boolean().optional(),
|
|
141
147
|
|
|
142
148
|
// Email-specific fields
|
|
143
149
|
/**
|
|
@@ -168,6 +174,18 @@ export const RuntimeInboundPayloadSchema = z.object({
|
|
|
168
174
|
conversationExternalId: z.string(),
|
|
169
175
|
externalMessageId: z.string(),
|
|
170
176
|
content: z.string(),
|
|
177
|
+
/** The named event family; absent only on replayed retry payloads,
|
|
178
|
+
* where resolveInboundEventKind derives it from the legacy fields. */
|
|
179
|
+
eventKind: z.enum(INBOUND_EVENT_KINDS).optional(),
|
|
180
|
+
/** Structured reaction payload; replayed retry payloads carry the
|
|
181
|
+
* callbackData string form resolveInboundReactionPayload reads. */
|
|
182
|
+
reaction: z
|
|
183
|
+
.object({
|
|
184
|
+
op: z.enum(["added", "removed"]),
|
|
185
|
+
emoji: z.string(),
|
|
186
|
+
targetMessageId: z.string(),
|
|
187
|
+
})
|
|
188
|
+
.optional(),
|
|
171
189
|
isEdit: z.boolean().optional(),
|
|
172
190
|
callbackQueryId: z.string().optional(),
|
|
173
191
|
callbackData: z.string().optional(),
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The inbound event families, named.
|
|
3
|
+
*
|
|
4
|
+
* Every inbound event is one of these, and the kind decides which pipeline
|
|
5
|
+
* stages apply: only user-authored text (message, edit) can carry a
|
|
6
|
+
* verification code or an invite, only a message starts an agent turn, and
|
|
7
|
+
* edit/delete/reaction/button all refer to another message rather than
|
|
8
|
+
* standing alone. A payload can also encode its family in the field that
|
|
9
|
+
* carries it: `isEdit`, the sentinel string `"message_deleted"`, the
|
|
10
|
+
* `"reaction:"` prefix, the presence of `callbackData` at all. Replayed
|
|
11
|
+
* retry payloads arrive with only those encodings, so
|
|
12
|
+
* {@link resolveInboundEventKind} derives the kind from them exactly once;
|
|
13
|
+
* nothing else may sniff them.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export const INBOUND_EVENT_KINDS = [
|
|
17
|
+
"message",
|
|
18
|
+
"edit",
|
|
19
|
+
"delete",
|
|
20
|
+
"reaction",
|
|
21
|
+
"button",
|
|
22
|
+
] as const;
|
|
23
|
+
|
|
24
|
+
export type InboundEventKind = (typeof INBOUND_EVENT_KINDS)[number];
|
|
25
|
+
|
|
26
|
+
export function isInboundEventKind(value: string): value is InboundEventKind {
|
|
27
|
+
return (INBOUND_EVENT_KINDS as readonly string[]).includes(value);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The one place the field encodings are read. A payload stamped with a
|
|
32
|
+
* kind wins outright; an unstamped one (a replayed retry payload) is
|
|
33
|
+
* classified by the fields that carry its family. The fallback order is
|
|
34
|
+
* specific-before-generic: reaction prefixes and the delete sentinel are
|
|
35
|
+
* particular `callbackData` values, so they are tested before the generic
|
|
36
|
+
* button reading.
|
|
37
|
+
*/
|
|
38
|
+
export function resolveInboundEventKind(fields: {
|
|
39
|
+
eventKind?: string;
|
|
40
|
+
isEdit?: boolean;
|
|
41
|
+
callbackData?: string;
|
|
42
|
+
callbackQueryId?: string;
|
|
43
|
+
}): InboundEventKind {
|
|
44
|
+
if (fields.eventKind !== undefined && isInboundEventKind(fields.eventKind)) {
|
|
45
|
+
return fields.eventKind;
|
|
46
|
+
}
|
|
47
|
+
if (fields.isEdit === true) {
|
|
48
|
+
return "edit";
|
|
49
|
+
}
|
|
50
|
+
const cb = fields.callbackData;
|
|
51
|
+
if (cb !== undefined && cb.length > 0) {
|
|
52
|
+
if (cb === "message_deleted") {
|
|
53
|
+
return "delete";
|
|
54
|
+
}
|
|
55
|
+
if (cb.startsWith("reaction:") || cb.startsWith("reaction_removed:")) {
|
|
56
|
+
return "reaction";
|
|
57
|
+
}
|
|
58
|
+
return "button";
|
|
59
|
+
}
|
|
60
|
+
if (fields.callbackQueryId !== undefined) {
|
|
61
|
+
return "button";
|
|
62
|
+
}
|
|
63
|
+
return "message";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether an event of this kind refers to another message rather than
|
|
68
|
+
* standing alone as new content. Referring events never mint a
|
|
69
|
+
* conversation of their own and never carry ingestable attachments.
|
|
70
|
+
*/
|
|
71
|
+
export function inboundEventRefersToAnotherMessage(
|
|
72
|
+
kind: InboundEventKind,
|
|
73
|
+
): boolean {
|
|
74
|
+
return kind !== "message";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** The structured payload of a reaction event. */
|
|
78
|
+
export interface InboundReactionPayload {
|
|
79
|
+
op: "added" | "removed";
|
|
80
|
+
/**
|
|
81
|
+
* The emoji as the channel names it: Slack a colon-name ("+1"), Telegram
|
|
82
|
+
* and Discord the unicode character, a Discord custom emoji its name.
|
|
83
|
+
* Decision vocabulary is product policy resolved in the daemon, never
|
|
84
|
+
* normalized here.
|
|
85
|
+
*/
|
|
86
|
+
emoji: string;
|
|
87
|
+
/**
|
|
88
|
+
* Provider id of the message reacted to, in the same namespace as
|
|
89
|
+
* `source.messageId`.
|
|
90
|
+
*/
|
|
91
|
+
targetMessageId: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The one reader of a reaction event's payload. A structured `reaction`
|
|
96
|
+
* field wins; a replayed retry payload persisted before the field carries
|
|
97
|
+
* the `"reaction:<emoji>"` / `"reaction_removed:<emoji>"` string in
|
|
98
|
+
* `callbackData` with the target on `sourceMetadata.messageId`, and is
|
|
99
|
+
* parsed here alone. Returns null when the event is not a reaction or
|
|
100
|
+
* names no emoji or target.
|
|
101
|
+
*/
|
|
102
|
+
export function resolveInboundReactionPayload(fields: {
|
|
103
|
+
eventKind?: string;
|
|
104
|
+
reaction?: InboundReactionPayload;
|
|
105
|
+
callbackData?: string;
|
|
106
|
+
sourceMetadata?: { messageId?: string };
|
|
107
|
+
}): InboundReactionPayload | null {
|
|
108
|
+
if (fields.reaction) {
|
|
109
|
+
const { op, emoji, targetMessageId } = fields.reaction;
|
|
110
|
+
return emoji.length > 0 && targetMessageId.length > 0
|
|
111
|
+
? { op, emoji, targetMessageId }
|
|
112
|
+
: null;
|
|
113
|
+
}
|
|
114
|
+
const cb = fields.callbackData;
|
|
115
|
+
const target = fields.sourceMetadata?.messageId;
|
|
116
|
+
if (cb === undefined || target === undefined || target.length === 0) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
const removed = cb.startsWith("reaction_removed:");
|
|
120
|
+
const added = !removed && cb.startsWith("reaction:");
|
|
121
|
+
if (!added && !removed) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const emoji = cb.slice(cb.indexOf(":") + 1);
|
|
125
|
+
return emoji.length > 0
|
|
126
|
+
? { op: removed ? "removed" : "added", emoji, targetMessageId: target }
|
|
127
|
+
: null;
|
|
128
|
+
}
|
|
@@ -83,6 +83,18 @@ export {
|
|
|
83
83
|
|
|
84
84
|
export type { AdmissionPolicy } from "./admission-policy-contract.js";
|
|
85
85
|
|
|
86
|
+
export {
|
|
87
|
+
INBOUND_EVENT_KINDS,
|
|
88
|
+
inboundEventRefersToAnotherMessage,
|
|
89
|
+
isInboundEventKind,
|
|
90
|
+
resolveInboundEventKind,
|
|
91
|
+
resolveInboundReactionPayload,
|
|
92
|
+
} from "./inbound-event-kind.js";
|
|
93
|
+
export type {
|
|
94
|
+
InboundEventKind,
|
|
95
|
+
InboundReactionPayload,
|
|
96
|
+
} from "./inbound-event-kind.js";
|
|
97
|
+
|
|
86
98
|
// Plugin admission-denied notice (gateway → plugin) — canned deny copy + envelope
|
|
87
99
|
export {
|
|
88
100
|
ACCESS_DENIED_NOT_APPROVED_REPLY,
|
|
@@ -16,6 +16,13 @@
|
|
|
16
16
|
* - `delete_credential` — Delete a credential by account name
|
|
17
17
|
* - `list_credentials` — List all credential account names
|
|
18
18
|
* - `bulk_set_credentials` — Store multiple credentials at once
|
|
19
|
+
*
|
|
20
|
+
* **Credential records** (non-secret identity + policy)
|
|
21
|
+
* - `get_credential_record` — Retrieve a credential record by account name
|
|
22
|
+
* - `set_credential_record` — Store or update a credential record
|
|
23
|
+
* - `delete_credential_record` — Delete a credential record by account name
|
|
24
|
+
* - `list_credential_records` — List all credential records
|
|
25
|
+
* - `bulk_set_credential_records` — Store multiple credential records at once
|
|
19
26
|
*/
|
|
20
27
|
|
|
21
28
|
import { z } from "zod";
|
|
@@ -38,6 +45,16 @@ export const CesRpcMethod = {
|
|
|
38
45
|
ListCredentials: "list_credentials",
|
|
39
46
|
/** Bulk-import credentials (set multiple at once). */
|
|
40
47
|
BulkSetCredentials: "bulk_set_credentials",
|
|
48
|
+
/** Retrieve a single credential record (identity + policy) by account name. */
|
|
49
|
+
GetCredentialRecord: "get_credential_record",
|
|
50
|
+
/** Store or update a credential record by account name. */
|
|
51
|
+
SetCredentialRecord: "set_credential_record",
|
|
52
|
+
/** Delete a credential record by account name. */
|
|
53
|
+
DeleteCredentialRecord: "delete_credential_record",
|
|
54
|
+
/** List all credential records. */
|
|
55
|
+
ListCredentialRecords: "list_credential_records",
|
|
56
|
+
/** Bulk-import credential records. */
|
|
57
|
+
BulkSetCredentialRecords: "bulk_set_credential_records",
|
|
41
58
|
} as const;
|
|
42
59
|
|
|
43
60
|
export type CesRpcMethod = (typeof CesRpcMethod)[keyof typeof CesRpcMethod];
|
|
@@ -168,6 +185,123 @@ export type BulkSetCredentialsResponse = z.infer<
|
|
|
168
185
|
typeof BulkSetCredentialsResponseSchema
|
|
169
186
|
>;
|
|
170
187
|
|
|
188
|
+
// ---------------------------------------------------------------------------
|
|
189
|
+
// Credential records (identity + policy, never secret values)
|
|
190
|
+
// ---------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
export const CredentialInjectionTemplateSchema = z.object({
|
|
193
|
+
hostPattern: z.string(),
|
|
194
|
+
injectionType: z.enum(["header", "query"]),
|
|
195
|
+
headerName: z.string().optional(),
|
|
196
|
+
valuePrefix: z.string().optional(),
|
|
197
|
+
queryParamName: z.string().optional(),
|
|
198
|
+
composeWith: z
|
|
199
|
+
.object({
|
|
200
|
+
service: z.string(),
|
|
201
|
+
field: z.string(),
|
|
202
|
+
separator: z.string(),
|
|
203
|
+
})
|
|
204
|
+
.optional(),
|
|
205
|
+
valueTransform: z.enum(["base64"]).optional(),
|
|
206
|
+
});
|
|
207
|
+
export type CredentialInjectionTemplate = z.infer<
|
|
208
|
+
typeof CredentialInjectionTemplateSchema
|
|
209
|
+
>;
|
|
210
|
+
|
|
211
|
+
export const CredentialRecordSchema = z.object({
|
|
212
|
+
credentialId: z.string(),
|
|
213
|
+
service: z.string(),
|
|
214
|
+
field: z.string(),
|
|
215
|
+
allowedTools: z.array(z.string()),
|
|
216
|
+
allowedDomains: z.array(z.string()),
|
|
217
|
+
usageDescription: z.string().optional(),
|
|
218
|
+
alias: z.string().optional(),
|
|
219
|
+
injectionTemplates: z.array(CredentialInjectionTemplateSchema).optional(),
|
|
220
|
+
createdAt: z.number(),
|
|
221
|
+
updatedAt: z.number(),
|
|
222
|
+
});
|
|
223
|
+
export type CredentialRecord = z.infer<typeof CredentialRecordSchema>;
|
|
224
|
+
|
|
225
|
+
export const GetCredentialRecordSchema = z.object({
|
|
226
|
+
/** The account name to look up (`credential/{service}/{field}`). */
|
|
227
|
+
account: z.string(),
|
|
228
|
+
});
|
|
229
|
+
export type GetCredentialRecord = z.infer<typeof GetCredentialRecordSchema>;
|
|
230
|
+
|
|
231
|
+
export const GetCredentialRecordResponseSchema = z.object({
|
|
232
|
+
found: z.boolean(),
|
|
233
|
+
record: CredentialRecordSchema.optional(),
|
|
234
|
+
});
|
|
235
|
+
export type GetCredentialRecordResponse = z.infer<
|
|
236
|
+
typeof GetCredentialRecordResponseSchema
|
|
237
|
+
>;
|
|
238
|
+
|
|
239
|
+
export const SetCredentialRecordSchema = z.object({
|
|
240
|
+
account: z.string(),
|
|
241
|
+
record: CredentialRecordSchema,
|
|
242
|
+
});
|
|
243
|
+
export type SetCredentialRecord = z.infer<typeof SetCredentialRecordSchema>;
|
|
244
|
+
|
|
245
|
+
export const SetCredentialRecordResponseSchema = z.object({
|
|
246
|
+
ok: z.boolean(),
|
|
247
|
+
});
|
|
248
|
+
export type SetCredentialRecordResponse = z.infer<
|
|
249
|
+
typeof SetCredentialRecordResponseSchema
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
export const DeleteCredentialRecordSchema = z.object({
|
|
253
|
+
account: z.string(),
|
|
254
|
+
});
|
|
255
|
+
export type DeleteCredentialRecord = z.infer<
|
|
256
|
+
typeof DeleteCredentialRecordSchema
|
|
257
|
+
>;
|
|
258
|
+
|
|
259
|
+
export const DeleteCredentialRecordResponseSchema = z.object({
|
|
260
|
+
result: z.enum(["deleted", "not-found", "error"]),
|
|
261
|
+
});
|
|
262
|
+
export type DeleteCredentialRecordResponse = z.infer<
|
|
263
|
+
typeof DeleteCredentialRecordResponseSchema
|
|
264
|
+
>;
|
|
265
|
+
|
|
266
|
+
export const ListCredentialRecordsSchema = z.object({});
|
|
267
|
+
export type ListCredentialRecords = z.infer<typeof ListCredentialRecordsSchema>;
|
|
268
|
+
|
|
269
|
+
export const ListCredentialRecordsResponseSchema = z.object({
|
|
270
|
+
records: z.array(
|
|
271
|
+
z.object({
|
|
272
|
+
account: z.string(),
|
|
273
|
+
record: CredentialRecordSchema,
|
|
274
|
+
}),
|
|
275
|
+
),
|
|
276
|
+
});
|
|
277
|
+
export type ListCredentialRecordsResponse = z.infer<
|
|
278
|
+
typeof ListCredentialRecordsResponseSchema
|
|
279
|
+
>;
|
|
280
|
+
|
|
281
|
+
export const BulkSetCredentialRecordsSchema = z.object({
|
|
282
|
+
records: z.array(
|
|
283
|
+
z.object({
|
|
284
|
+
account: z.string(),
|
|
285
|
+
record: CredentialRecordSchema,
|
|
286
|
+
}),
|
|
287
|
+
),
|
|
288
|
+
});
|
|
289
|
+
export type BulkSetCredentialRecords = z.infer<
|
|
290
|
+
typeof BulkSetCredentialRecordsSchema
|
|
291
|
+
>;
|
|
292
|
+
|
|
293
|
+
export const BulkSetCredentialRecordsResponseSchema = z.object({
|
|
294
|
+
results: z.array(
|
|
295
|
+
z.object({
|
|
296
|
+
account: z.string(),
|
|
297
|
+
ok: z.boolean(),
|
|
298
|
+
}),
|
|
299
|
+
),
|
|
300
|
+
});
|
|
301
|
+
export type BulkSetCredentialRecordsResponse = z.infer<
|
|
302
|
+
typeof BulkSetCredentialRecordsResponseSchema
|
|
303
|
+
>;
|
|
304
|
+
|
|
171
305
|
// ---------------------------------------------------------------------------
|
|
172
306
|
// Full RPC contract type map
|
|
173
307
|
// ---------------------------------------------------------------------------
|
|
@@ -201,6 +335,26 @@ export interface CesRpcContract {
|
|
|
201
335
|
request: BulkSetCredentials;
|
|
202
336
|
response: BulkSetCredentialsResponse;
|
|
203
337
|
};
|
|
338
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
339
|
+
request: GetCredentialRecord;
|
|
340
|
+
response: GetCredentialRecordResponse;
|
|
341
|
+
};
|
|
342
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
343
|
+
request: SetCredentialRecord;
|
|
344
|
+
response: SetCredentialRecordResponse;
|
|
345
|
+
};
|
|
346
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
347
|
+
request: DeleteCredentialRecord;
|
|
348
|
+
response: DeleteCredentialRecordResponse;
|
|
349
|
+
};
|
|
350
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
351
|
+
request: ListCredentialRecords;
|
|
352
|
+
response: ListCredentialRecordsResponse;
|
|
353
|
+
};
|
|
354
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
355
|
+
request: BulkSetCredentialRecords;
|
|
356
|
+
response: BulkSetCredentialRecordsResponse;
|
|
357
|
+
};
|
|
204
358
|
}
|
|
205
359
|
|
|
206
360
|
/**
|
|
@@ -231,4 +385,24 @@ export const CesRpcSchemas = {
|
|
|
231
385
|
request: BulkSetCredentialsSchema,
|
|
232
386
|
response: BulkSetCredentialsResponseSchema,
|
|
233
387
|
},
|
|
388
|
+
[CesRpcMethod.GetCredentialRecord]: {
|
|
389
|
+
request: GetCredentialRecordSchema,
|
|
390
|
+
response: GetCredentialRecordResponseSchema,
|
|
391
|
+
},
|
|
392
|
+
[CesRpcMethod.SetCredentialRecord]: {
|
|
393
|
+
request: SetCredentialRecordSchema,
|
|
394
|
+
response: SetCredentialRecordResponseSchema,
|
|
395
|
+
},
|
|
396
|
+
[CesRpcMethod.DeleteCredentialRecord]: {
|
|
397
|
+
request: DeleteCredentialRecordSchema,
|
|
398
|
+
response: DeleteCredentialRecordResponseSchema,
|
|
399
|
+
},
|
|
400
|
+
[CesRpcMethod.ListCredentialRecords]: {
|
|
401
|
+
request: ListCredentialRecordsSchema,
|
|
402
|
+
response: ListCredentialRecordsResponseSchema,
|
|
403
|
+
},
|
|
404
|
+
[CesRpcMethod.BulkSetCredentialRecords]: {
|
|
405
|
+
request: BulkSetCredentialRecordsSchema,
|
|
406
|
+
response: BulkSetCredentialRecordsResponseSchema,
|
|
407
|
+
},
|
|
234
408
|
} as const;
|
package/openapi.yaml
CHANGED
|
@@ -467,6 +467,8 @@ paths:
|
|
|
467
467
|
type: string
|
|
468
468
|
parentToolUseId:
|
|
469
469
|
type: string
|
|
470
|
+
authErrorCode:
|
|
471
|
+
type: string
|
|
470
472
|
usedTokens:
|
|
471
473
|
type: number
|
|
472
474
|
contextSize:
|
|
@@ -4190,6 +4192,30 @@ paths:
|
|
|
4190
4192
|
type: string
|
|
4191
4193
|
content:
|
|
4192
4194
|
type: string
|
|
4195
|
+
eventKind:
|
|
4196
|
+
type: string
|
|
4197
|
+
enum:
|
|
4198
|
+
- message
|
|
4199
|
+
- edit
|
|
4200
|
+
- delete
|
|
4201
|
+
- reaction
|
|
4202
|
+
- button
|
|
4203
|
+
reaction:
|
|
4204
|
+
type: object
|
|
4205
|
+
properties:
|
|
4206
|
+
op:
|
|
4207
|
+
type: string
|
|
4208
|
+
enum:
|
|
4209
|
+
- added
|
|
4210
|
+
- removed
|
|
4211
|
+
emoji:
|
|
4212
|
+
type: string
|
|
4213
|
+
targetMessageId:
|
|
4214
|
+
type: string
|
|
4215
|
+
required:
|
|
4216
|
+
- op
|
|
4217
|
+
- emoji
|
|
4218
|
+
- targetMessageId
|
|
4193
4219
|
isEdit:
|
|
4194
4220
|
type: boolean
|
|
4195
4221
|
callbackQueryId:
|
|
@@ -4358,6 +4384,8 @@ paths:
|
|
|
4358
4384
|
required:
|
|
4359
4385
|
- trustClass
|
|
4360
4386
|
- canonicalSenderId
|
|
4387
|
+
actorUnattributed:
|
|
4388
|
+
type: boolean
|
|
4361
4389
|
emailProvider:
|
|
4362
4390
|
type: string
|
|
4363
4391
|
emailSubject:
|
|
@@ -15038,7 +15066,7 @@ paths:
|
|
|
15038
15066
|
type: string
|
|
15039
15067
|
description:
|
|
15040
15068
|
"Filter by provider id. One of: anthropic, openai, gemini, ollama, fireworks, together, openrouter,
|
|
15041
|
-
vercel-ai-gateway, litellm, opencode, openai-compatible, minimax, atlascloud, baseten, poolside"
|
|
15069
|
+
vercel-ai-gateway, litellm, opencode, openai-compatible, minimax, atlascloud, baseten, poolside, vellum"
|
|
15042
15070
|
responses:
|
|
15043
15071
|
"200":
|
|
15044
15072
|
description: Successful response
|
package/package.json
CHANGED
|
@@ -86,6 +86,9 @@ function projectModel(model: CatalogModel): Record<string, unknown> {
|
|
|
86
86
|
if (model.pricing !== undefined) {
|
|
87
87
|
projected.pricing = model.pricing;
|
|
88
88
|
}
|
|
89
|
+
if (model.featureFlag !== undefined) {
|
|
90
|
+
projected.featureFlag = model.featureFlag;
|
|
91
|
+
}
|
|
89
92
|
return projected;
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -115,6 +118,9 @@ function projectProvider(entry: ProviderCatalogEntry): Record<string, unknown> {
|
|
|
115
118
|
if (entry.supportsPlatformAuth !== undefined) {
|
|
116
119
|
projected.supportsPlatformAuth = entry.supportsPlatformAuth;
|
|
117
120
|
}
|
|
121
|
+
if (entry.featureFlag !== undefined) {
|
|
122
|
+
projected.featureFlag = entry.featureFlag;
|
|
123
|
+
}
|
|
118
124
|
projected.defaultModel = entry.defaultModel;
|
|
119
125
|
projected.models = entry.models.map(projectModel);
|
|
120
126
|
// NOTE: `apiKeyUrl` intentionally omitted — clients use
|
|
@@ -243,6 +243,7 @@ describe("channel inbound disk pressure gate", () => {
|
|
|
243
243
|
content: "reaction:thumbsup",
|
|
244
244
|
actorExternalId: "slack-user-1",
|
|
245
245
|
callbackData: "reaction:thumbsup",
|
|
246
|
+
sourceMetadata: { messageId: "1700000000.1" },
|
|
246
247
|
replyCallbackUrl: "https://gateway.test/deliver/slack",
|
|
247
248
|
}),
|
|
248
249
|
);
|