feat: integrate pi rust lab runtime
This commit is contained in:
@@ -33,20 +33,20 @@ async function setupWorkspaceAccess(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "setupWorkspace",
|
||||
userId: actorId,
|
||||
user_id: actorId,
|
||||
email: options.email || `${actorId}@example.com`,
|
||||
username: options.username || actorId,
|
||||
displayName: options.displayName || actorId,
|
||||
display_name: options.displayName || actorId,
|
||||
role: options.role || "user",
|
||||
workspaceId: options.workspaceId,
|
||||
workspaceName: options.workspaceName || "MNote Smoke Workspace",
|
||||
rootUri,
|
||||
rootPath,
|
||||
sourceKind: options.sourceKind || "local_folder",
|
||||
workspace_id: options.workspaceId,
|
||||
workspace_name: options.workspaceName || "MNote Smoke Workspace",
|
||||
root_uri: rootUri,
|
||||
root_path: rootPath,
|
||||
source_kind: options.sourceKind || "local_folder",
|
||||
permission: options.permission || "write",
|
||||
capabilities: options.capabilities || ["ai"],
|
||||
grantSource: options.grantSource || "smoke",
|
||||
grantCreatedBy: options.grantCreatedBy || actorId,
|
||||
grant_source: options.grantSource || "smoke",
|
||||
grant_created_by: options.grantCreatedBy || actorId,
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -61,19 +61,42 @@ async function seedAiRuntime(requestContext, baseUrl, options) {
|
||||
{
|
||||
kind: "seedAiRuntime",
|
||||
id: options.id,
|
||||
userId: options.userId,
|
||||
workspaceId: options.workspaceId,
|
||||
documentId: options.documentId,
|
||||
sessionId: options.sessionId,
|
||||
runId: options.runId,
|
||||
user_id: options.userId,
|
||||
workspace_id: options.workspaceId,
|
||||
document_id: options.documentId,
|
||||
session_id: options.sessionId,
|
||||
run_id: options.runId,
|
||||
title: options.title,
|
||||
profile: options.profile || "reasonix",
|
||||
acpRuntime: options.acpRuntime || options.profile || "reasonix",
|
||||
traceId: options.traceId,
|
||||
acp_runtime: options.acpRuntime || options.profile || "reasonix",
|
||||
trace_id: options.traceId,
|
||||
status: options.status || "running",
|
||||
runtimeJson: options.runtimeJson || {},
|
||||
payloadJson: options.payloadJson || {},
|
||||
events: options.events || [],
|
||||
runtime_json: options.runtimeJson || {},
|
||||
payload_json: options.payloadJson || {},
|
||||
events: (options.events || []).map((event) => ({
|
||||
id: event.id,
|
||||
event_type: event.event_type || event.eventType,
|
||||
payload_json: event.payload_json || event.payloadJson || {},
|
||||
})),
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
);
|
||||
}
|
||||
|
||||
async function seedAiPolicy(requestContext, baseUrl, options) {
|
||||
return postDevSeed(
|
||||
requestContext,
|
||||
baseUrl,
|
||||
[
|
||||
{
|
||||
kind: "seedAiPolicy",
|
||||
id: options.id,
|
||||
user_id: options.userId,
|
||||
workspace_id: options.workspaceId,
|
||||
allowed_roots_json: options.allowedRootsJson || [],
|
||||
model_policy_json: options.modelPolicyJson || {},
|
||||
quota_json: options.quotaJson || {},
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -87,8 +110,8 @@ async function clearRuntimeEvents(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "clearRuntimeEvents",
|
||||
userId: options.userId,
|
||||
runId: options.runId,
|
||||
user_id: options.userId,
|
||||
run_id: options.runId,
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -102,8 +125,8 @@ async function getAiRuntimeRun(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "getAiRuntimeRun",
|
||||
userId: options.userId,
|
||||
runId: options.runId,
|
||||
user_id: options.userId,
|
||||
run_id: options.runId,
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -118,10 +141,10 @@ async function listAiRuntimeRuns(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "listAiRuntimeRuns",
|
||||
userId: options.userId,
|
||||
workspaceId: options.workspaceId,
|
||||
documentId: options.documentId,
|
||||
sessionId: options.sessionId,
|
||||
user_id: options.userId,
|
||||
workspace_id: options.workspaceId,
|
||||
document_id: options.documentId,
|
||||
session_id: options.sessionId,
|
||||
limit: options.limit,
|
||||
},
|
||||
],
|
||||
@@ -137,10 +160,10 @@ async function listAiRuntimeEvents(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "listAiRuntimeEvents",
|
||||
userId: options.userId,
|
||||
runId: options.runId,
|
||||
user_id: options.userId,
|
||||
run_id: options.runId,
|
||||
limit: options.limit,
|
||||
eventType: options.eventType,
|
||||
event_type: options.eventType,
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -155,9 +178,9 @@ async function countAiRuntimeEvents(requestContext, baseUrl, options) {
|
||||
[
|
||||
{
|
||||
kind: "countAiRuntimeEvents",
|
||||
userId: options.userId,
|
||||
runId: options.runId,
|
||||
eventType: options.eventType,
|
||||
user_id: options.userId,
|
||||
run_id: options.runId,
|
||||
event_type: options.eventType,
|
||||
},
|
||||
],
|
||||
options.timeoutMs,
|
||||
@@ -172,9 +195,9 @@ async function findExternalConversationBinding(requestContext, baseUrl, options)
|
||||
[
|
||||
{
|
||||
kind: "findExternalConversationBinding",
|
||||
userId: options.userId,
|
||||
workspaceId: options.workspaceId,
|
||||
mnoteSessionId: options.mnoteSessionId,
|
||||
user_id: options.userId,
|
||||
workspace_id: options.workspaceId,
|
||||
mnote_session_id: options.mnoteSessionId,
|
||||
provider: options.provider,
|
||||
},
|
||||
],
|
||||
@@ -190,9 +213,9 @@ async function listExternalConversationBindings(requestContext, baseUrl, options
|
||||
[
|
||||
{
|
||||
kind: "listExternalConversationBindings",
|
||||
userId: options.userId,
|
||||
workspaceId: options.workspaceId,
|
||||
mnoteSessionId: options.mnoteSessionId,
|
||||
user_id: options.userId,
|
||||
workspace_id: options.workspaceId,
|
||||
mnote_session_id: options.mnoteSessionId,
|
||||
limit: options.limit,
|
||||
},
|
||||
],
|
||||
@@ -205,6 +228,7 @@ module.exports = {
|
||||
postDevSeed,
|
||||
setupWorkspaceAccess,
|
||||
seedAiRuntime,
|
||||
seedAiPolicy,
|
||||
clearRuntimeEvents,
|
||||
getAiRuntimeRun,
|
||||
listAiRuntimeRuns,
|
||||
|
||||
Reference in New Issue
Block a user