decord/beta/source/modules/vibegrations/lib/VibegrationsTodoAgents.tsx
github-actions 6fbb1b046c chore: update source for beta 347.8
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-22 14:21:44 +00:00

71 lines
2 KiB
TypeScript

// Module ID: 17043
// Function ID: 17044
// Name: VibegrationsTodoAgents
// Dependencies: [17038, 2]
// Exports: groupAgentsByTodo, runningTodoAgents, splitAgentOverflow
// Module 17043 (VibegrationsTodoAgents)
import VibegrationsTimelineTree from "VibegrationsTimelineTree" /* 17038 */;
import size from "module_2" /* 2 */;
let result = size.fileFinishedImporting("modules/vibegrations/lib/VibegrationsTodoAgents.tsx");
export const MAX_SHOWN_AGENTS = 3;
export const runningTodoAgents = function runningTodoAgents(tasks) {
const items = [];
const iter = tasks[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp2 = nextResult;
if ("running" === nextResult.task.status) {
let obj2 = { key: null, name: null, task: null, todoId: null };
obj2.key = tmp2.taskId;
let taskId = tmp2.task.helperName;
if (taskId == null) {
taskId = tmp2.taskId;
}
obj2.name = taskId;
let obj = VibegrationsTimelineTree;
obj2.task = obj.describeNode(tmp2.task);
obj2.todoId = tmp2.task.todoId;
let arr = items.push(obj2);
}
continue;
}
return items;
};
export const groupAgentsByTodo = function groupAgentsByTodo(cResult) {
const map = new Map();
const iter = cResult[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp2 = nextResult;
if (null != nextResult.todoId) {
if ("" !== tmp2.todoId) {
value = map.get(tmp2.todoId);
let arr = value;
if (null != value) {
let arr2 = arr.push(tmp2);
} else {
let items = [tmp2];
let result = map.set(tmp2.todoId, items);
}
}
}
continue;
}
return map;
};
export const splitAgentOverflow = function splitAgentOverflow(agents) {
let num = arg1;
if (arg1 === undefined) {
num = 3;
}
if (agents.length <= num) {
const obj2 = { shown: agents, overflow: 0 };
let obj = obj2;
} else {
obj = { shown: agents.slice(0, num), overflow: agents.length - num };
}
return obj;
};