Update hivegrid-cloud reference to latest main
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e98d38e716
commit
7b21524c86
3781 files changed
+373484
-225607
No files matched your search
@@ -4,9 +4,6 @@ import {
|
||||
JOB_PRIORITY_HIGH,
|
||||
JOB_PRIORITY_LOW,
|
||||
JOB_PRIORITY_NORMAL,
|
||||
buildAiBrowserTaskJob,
|
||||
buildAiChatCompletionJob,
|
||||
buildAiEmbeddingJob,
|
||||
buildBrowserSessionCleanupJob,
|
||||
buildBrowserSessionRunJob,
|
||||
buildBrowserUsageFlushJob,
|
||||
@@ -232,75 +229,6 @@ describe("queue producers", () => {
|
||||
expect(descriptor.jobName).not.toBe("run-export");
|
||||
});
|
||||
|
||||
test("builds AI chat completion descriptors", () => {
|
||||
expect(
|
||||
buildAiChatCompletionJob({
|
||||
tenantId: "tenant_1",
|
||||
userId: "user_1",
|
||||
conversationId: "conversation_1",
|
||||
model: "model-chat",
|
||||
messages: [{ role: "user", content: "Summarize this." }],
|
||||
metadata: { requestId: "req_ai_chat_1" },
|
||||
})
|
||||
).toEqual({
|
||||
queueName: queueNames.aiChatbot,
|
||||
jobName: "chat-completion",
|
||||
payload: {
|
||||
kind: "ai.chat-completion",
|
||||
tenantId: "tenant_1",
|
||||
userId: "user_1",
|
||||
conversationId: "conversation_1",
|
||||
model: "model-chat",
|
||||
messages: [{ role: "user", content: "Summarize this." }],
|
||||
metadata: { requestId: "req_ai_chat_1" },
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test("builds AI embedding descriptors", () => {
|
||||
expect(
|
||||
buildAiEmbeddingJob({
|
||||
tenantId: "tenant_2",
|
||||
userId: "user_2",
|
||||
model: "model-embedding",
|
||||
messages: [{ role: "user", content: "Index this document." }],
|
||||
metadata: { documentId: "doc_1" },
|
||||
})
|
||||
).toEqual({
|
||||
queueName: queueNames.aiChatbot,
|
||||
jobName: "create-embedding",
|
||||
payload: {
|
||||
kind: "ai.embedding",
|
||||
tenantId: "tenant_2",
|
||||
userId: "user_2",
|
||||
model: "model-embedding",
|
||||
messages: [{ role: "user", content: "Index this document." }],
|
||||
metadata: { documentId: "doc_1" },
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test("builds AI browser task descriptors on the AI queue", () => {
|
||||
expect(
|
||||
buildAiBrowserTaskJob({
|
||||
tenantId: "tenant_3",
|
||||
userId: "user_3",
|
||||
task: { action: "research", url: "https://example.test" },
|
||||
metadata: { requestId: "req_ai_browser_1" },
|
||||
})
|
||||
).toEqual({
|
||||
queueName: queueNames.aiChatbot,
|
||||
jobName: "browser-task",
|
||||
payload: {
|
||||
kind: "ai.browser-task",
|
||||
tenantId: "tenant_3",
|
||||
userId: "user_3",
|
||||
task: { action: "research", url: "https://example.test" },
|
||||
metadata: { requestId: "req_ai_browser_1" },
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test("builds browser automation session run descriptors on the browser automation queue", () => {
|
||||
expect(
|
||||
buildBrowserSessionRunJob({
|
||||
@@ -729,26 +657,6 @@ describe("queue producers", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("keeps AI browser task descriptors separate from browser automation session jobs", () => {
|
||||
const aiBrowserTask = buildAiBrowserTaskJob({
|
||||
tenantId: "tenant_shared",
|
||||
task: { action: "research" },
|
||||
});
|
||||
const browserSessionRun = buildBrowserSessionRunJob({
|
||||
tenantId: "tenant_shared",
|
||||
sessionId: "session_shared",
|
||||
policyId: "policy_shared",
|
||||
task: { action: "research" },
|
||||
});
|
||||
|
||||
expect(aiBrowserTask.queueName).toBe(queueNames.aiChatbot);
|
||||
expect(aiBrowserTask.jobName).toBe("browser-task");
|
||||
expect(aiBrowserTask.payload.kind).toBe("ai.browser-task");
|
||||
expect(browserSessionRun.queueName).toBe(queueNames.browserAutomation);
|
||||
expect(browserSessionRun.jobName).toBe("browser-session-run");
|
||||
expect(browserSessionRun.payload.kind).toBe("browser.session-run");
|
||||
});
|
||||
|
||||
test("preserves requestId metadata on every producer descriptor", () => {
|
||||
const descriptors = [
|
||||
buildTransactionalMailJob({
|
||||
@@ -771,21 +679,6 @@ describe("queue producers", () => {
|
||||
metadata: { requestId: "req_notification_1" },
|
||||
}),
|
||||
buildCleanupJob({ task: "expired-sessions", metadata: { requestId: "req_cleanup_1" } }),
|
||||
buildAiChatCompletionJob({
|
||||
tenantId: "tenant_1",
|
||||
messages: [{ role: "user", content: "Hello" }],
|
||||
metadata: { requestId: "req_ai_chat_1" },
|
||||
}),
|
||||
buildAiEmbeddingJob({
|
||||
tenantId: "tenant_1",
|
||||
messages: [{ role: "user", content: "Embed this" }],
|
||||
metadata: { requestId: "req_ai_embedding_1" },
|
||||
}),
|
||||
buildAiBrowserTaskJob({
|
||||
tenantId: "tenant_1",
|
||||
task: { action: "research" },
|
||||
metadata: { requestId: "req_ai_browser_1" },
|
||||
}),
|
||||
buildBrowserSessionRunJob({
|
||||
tenantId: "tenant_1",
|
||||
sessionId: "session_1",
|
||||
@@ -828,9 +721,6 @@ describe("queue producers", () => {
|
||||
}),
|
||||
buildNotificationJob({ tenantId: "tenant_1", userId: "user_1", channel: "in-app", messageKey: "message.ready" }),
|
||||
buildCleanupJob({ task: "expired-sessions" }),
|
||||
buildAiChatCompletionJob({ tenantId: "tenant_1", messages: [{ role: "user", content: "Hello" }] }),
|
||||
buildAiEmbeddingJob({ tenantId: "tenant_1", messages: [{ role: "user", content: "Embed this" }] }),
|
||||
buildAiBrowserTaskJob({ tenantId: "tenant_1", task: { action: "research" } }),
|
||||
buildBrowserSessionRunJob({ tenantId: "tenant_1", sessionId: "session_1", task: { action: "capture" } }),
|
||||
buildBrowserSessionCleanupJob({ tenantId: "tenant_1", sessionId: "session_1" }),
|
||||
buildBrowserUsageFlushJob({ tenantId: "tenant_1", sessionId: "session_1" }),
|
||||
|
||||
Reference in new issue
Block a user