meshy-node 0.7.2 → 0.7.3

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.
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-C920K5oZ.js";/**
1
+ import{c as a}from"./index-BJilr1zc.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Meshy Dashboard</title>
7
7
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>&#x1F578;</text></svg>" />
8
- <script type="module" crossorigin src="/assets/index-C920K5oZ.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-DtAYxdhK.css">
8
+ <script type="module" crossorigin src="/assets/index-BJilr1zc.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-Dy6nrw83.css">
10
10
  </head>
11
11
  <body>
12
12
  <div id="root"></div>
package/main.cjs CHANGED
@@ -59366,7 +59366,10 @@ var TaskListQuery = external_exports.object({
59366
59366
  assignedTo: external_exports.string().optional(),
59367
59367
  priority: external_exports.enum(["low", "normal", "high", "critical"]).optional(),
59368
59368
  limit: external_exports.coerce.number().int().min(1).max(100).default(20).optional(),
59369
- offset: external_exports.coerce.number().int().min(0).default(0).optional()
59369
+ offset: external_exports.coerce.number().int().min(0).default(0).optional(),
59370
+ projectPath: external_exports.string().trim().min(1).optional(),
59371
+ cursor: external_exports.string().trim().min(1).optional(),
59372
+ completedLimitPerProject: external_exports.coerce.number().int().min(1).max(100).optional()
59370
59373
  });
59371
59374
  var TaskListResponse = external_exports.object({
59372
59375
  tasks: external_exports.array(external_exports.object({
@@ -59397,7 +59400,17 @@ var TaskListResponse = external_exports.object({
59397
59400
  createdAt: external_exports.number(),
59398
59401
  updatedAt: external_exports.number()
59399
59402
  })),
59400
- total: external_exports.number().int().min(0)
59403
+ total: external_exports.number().int().min(0),
59404
+ hasMore: external_exports.boolean().optional(),
59405
+ nextCursor: external_exports.string().nullable().optional(),
59406
+ completedGroups: external_exports.array(external_exports.object({
59407
+ assignedTo: external_exports.string().nullable(),
59408
+ projectPath: external_exports.string(),
59409
+ total: external_exports.number().int().min(0),
59410
+ returned: external_exports.number().int().min(0),
59411
+ hasMore: external_exports.boolean(),
59412
+ nextCursor: external_exports.string().nullable()
59413
+ })).optional()
59401
59414
  });
59402
59415
  var UpdateTaskBody = external_exports.object({
59403
59416
  title: external_exports.string().trim().min(1).optional(),
@@ -65011,6 +65024,136 @@ async function drainNextQueuedTaskMessage(deps, taskId) {
65011
65024
  }
65012
65025
  }
65013
65026
 
65027
+ // ../../packages/api/src/tasks/task-list-response.ts
65028
+ var DEFAULT_WORKSPACE_PATH = "default workspace";
65029
+ function normalizeGroupPath(value) {
65030
+ const normalized = value.replace(/\\/g, "/");
65031
+ if (normalized === "/" || /^[A-Za-z]:\/$/.test(normalized)) {
65032
+ return normalized;
65033
+ }
65034
+ return normalized.replace(/\/+$/g, "") || normalized;
65035
+ }
65036
+ function isAbsoluteGroupPath(value) {
65037
+ const normalized = value.replace(/\\/g, "/");
65038
+ return normalized.startsWith("/") || normalized.startsWith("//") || /^[A-Za-z]:\//.test(normalized);
65039
+ }
65040
+ function joinGroupPath(basePath, relativePath) {
65041
+ const base = normalizeGroupPath(basePath);
65042
+ const relative2 = relativePath.replace(/\\/g, "/").replace(/^\/+|\/+$/g, "");
65043
+ if (!relative2 || relative2 === ".") return base;
65044
+ if (base === "/" || /^[A-Za-z]:\/$/.test(base)) return `${base}${relative2}`;
65045
+ return `${base}/${relative2}`;
65046
+ }
65047
+ function resolveTaskListProjectPath(task, nodeRegistry) {
65048
+ const effectivePath = task.effectiveProjectPath?.trim();
65049
+ if (effectivePath) {
65050
+ return normalizeGroupPath(effectivePath);
65051
+ }
65052
+ const projectPath = task.project?.trim();
65053
+ if (!projectPath) {
65054
+ return DEFAULT_WORKSPACE_PATH;
65055
+ }
65056
+ if (isAbsoluteGroupPath(projectPath) || !task.assignedTo) {
65057
+ return normalizeGroupPath(projectPath);
65058
+ }
65059
+ const nodeWorkDir = nodeRegistry.getNode(task.assignedTo)?.workDir?.trim();
65060
+ return nodeWorkDir ? joinGroupPath(nodeWorkDir, projectPath) : normalizeGroupPath(projectPath);
65061
+ }
65062
+ function compareTasks(left, right) {
65063
+ const updatedDelta = right.updatedAt - left.updatedAt;
65064
+ if (updatedDelta !== 0) return updatedDelta;
65065
+ const createdDelta = right.createdAt - left.createdAt;
65066
+ if (createdDelta !== 0) return createdDelta;
65067
+ return left.id.localeCompare(right.id);
65068
+ }
65069
+ function encodeCursor(task) {
65070
+ return Buffer.from(JSON.stringify({
65071
+ updatedAt: task.updatedAt,
65072
+ createdAt: task.createdAt,
65073
+ id: task.id
65074
+ }), "utf8").toString("base64url");
65075
+ }
65076
+ function decodeCursor(cursor) {
65077
+ if (!cursor) return null;
65078
+ try {
65079
+ const parsed = JSON.parse(Buffer.from(cursor, "base64url").toString("utf8"));
65080
+ if (typeof parsed.updatedAt !== "number" || typeof parsed.createdAt !== "number" || typeof parsed.id !== "string") {
65081
+ return null;
65082
+ }
65083
+ return { updatedAt: parsed.updatedAt, createdAt: parsed.createdAt, id: parsed.id };
65084
+ } catch {
65085
+ return null;
65086
+ }
65087
+ }
65088
+ function isTaskAfterCursor(task, cursor) {
65089
+ if (task.updatedAt !== cursor.updatedAt) return task.updatedAt < cursor.updatedAt;
65090
+ if (task.createdAt !== cursor.createdAt) return task.createdAt < cursor.createdAt;
65091
+ return task.id.localeCompare(cursor.id) > 0;
65092
+ }
65093
+ function paginateTasks(tasks, options) {
65094
+ const cursor = decodeCursor(options.cursor);
65095
+ const offset = cursor ? 0 : options.offset ?? 0;
65096
+ const afterCursor = cursor ? tasks.filter((task) => isTaskAfterCursor(task, cursor)) : tasks.slice(offset);
65097
+ const limit = options.limit;
65098
+ const pageTasks = limit === void 0 ? afterCursor : afterCursor.slice(0, limit);
65099
+ const hasMore = limit !== void 0 && afterCursor.length > limit;
65100
+ const nextCursor = hasMore && pageTasks.length > 0 ? encodeCursor(pageTasks[pageTasks.length - 1]) : null;
65101
+ return {
65102
+ tasks: pageTasks,
65103
+ total: tasks.length,
65104
+ hasMore,
65105
+ nextCursor
65106
+ };
65107
+ }
65108
+ function buildTaskListResult(tasks, nodeRegistry, options) {
65109
+ const orderedTasks = [...tasks].sort(compareTasks);
65110
+ const projectPath = options.projectPath?.trim();
65111
+ const filteredTasks = projectPath ? orderedTasks.filter((task) => resolveTaskListProjectPath(task, nodeRegistry) === normalizeGroupPath(projectPath)) : orderedTasks;
65112
+ if (options.completedLimitPerProject === void 0) {
65113
+ return paginateTasks(filteredTasks, options);
65114
+ }
65115
+ const completedLimit = options.completedLimitPerProject;
65116
+ const visibleIds = /* @__PURE__ */ new Set();
65117
+ const completedByGroup = /* @__PURE__ */ new Map();
65118
+ for (const task of filteredTasks) {
65119
+ if (task.status !== "completed") {
65120
+ visibleIds.add(task.id);
65121
+ continue;
65122
+ }
65123
+ const resolvedProjectPath = resolveTaskListProjectPath(task, nodeRegistry);
65124
+ const groupKey = `${task.assignedTo ?? "__unassigned__"}::${resolvedProjectPath}`;
65125
+ if (!completedByGroup.has(groupKey)) {
65126
+ completedByGroup.set(groupKey, { assignedTo: task.assignedTo ?? null, projectPath: resolvedProjectPath, tasks: [] });
65127
+ }
65128
+ completedByGroup.get(groupKey).tasks.push(task);
65129
+ }
65130
+ const completedGroups = [];
65131
+ for (const group of completedByGroup.values()) {
65132
+ const visibleCompleted = group.tasks.slice(0, completedLimit);
65133
+ for (const task of visibleCompleted) {
65134
+ visibleIds.add(task.id);
65135
+ }
65136
+ const hasMore = group.tasks.length > visibleCompleted.length;
65137
+ if (hasMore) {
65138
+ completedGroups.push({
65139
+ assignedTo: group.assignedTo,
65140
+ projectPath: group.projectPath,
65141
+ total: group.tasks.length,
65142
+ returned: visibleCompleted.length,
65143
+ hasMore,
65144
+ nextCursor: visibleCompleted.length > 0 ? encodeCursor(visibleCompleted[visibleCompleted.length - 1]) : null
65145
+ });
65146
+ }
65147
+ }
65148
+ return {
65149
+ tasks: filteredTasks.filter((task) => visibleIds.has(task.id)),
65150
+ total: filteredTasks.length,
65151
+ hasMore: false,
65152
+ nextCursor: null,
65153
+ completedGroups
65154
+ };
65155
+ }
65156
+
65014
65157
  // ../../packages/api/src/routes/task-output.ts
65015
65158
  var import_express8 = __toESM(require_express2(), 1);
65016
65159
 
@@ -65494,6 +65637,19 @@ function withShareMetadata(task, taskEngine, shareOrigin) {
65494
65637
  function toTaskResponse(task, nodeRegistry, taskEngine, shareOrigin) {
65495
65638
  return withShareMetadata(withAssignedNodeMetadata(task, nodeRegistry), taskEngine, shareOrigin);
65496
65639
  }
65640
+ function filterUnavailableAssignedTasks(tasks, nodeRegistry) {
65641
+ let selfNode = null;
65642
+ try {
65643
+ selfNode = nodeRegistry.getSelf();
65644
+ } catch {
65645
+ selfNode = null;
65646
+ }
65647
+ return tasks.filter((task) => {
65648
+ if (!task.assignedTo) return true;
65649
+ const assignedNode = selfNode?.id === task.assignedTo ? selfNode : nodeRegistry.getNode(task.assignedTo);
65650
+ return Boolean(assignedNode && assignedNode.status !== "offline");
65651
+ });
65652
+ }
65497
65653
  async function proxyJoinSnapshotTaskDetail(deps) {
65498
65654
  if (deps.req.get(TASK_DETAIL_PROXY_HEADER) === "1") {
65499
65655
  return null;
@@ -65626,14 +65782,28 @@ function createTaskRoutes() {
65626
65782
  const query = TaskListQuery.parse(req.query);
65627
65783
  const filter = {};
65628
65784
  if (query.status) filter.status = query.status;
65629
- if (query.assignedTo) filter.assignedTo = query.assignedTo;
65785
+ if (query.assignedTo && query.assignedTo !== "__unassigned__") filter.assignedTo = query.assignedTo;
65630
65786
  if (query.priority) filter.priority = query.priority;
65631
- if (query.limit) filter.limit = query.limit;
65632
- if (query.offset) filter.offset = query.offset;
65633
- const result = taskEngine.listTasks(filter);
65787
+ const tasks = taskEngine.listTasks(filter).tasks;
65788
+ const assignedTasks = query.assignedTo === "__unassigned__" ? tasks.filter((task) => !task.assignedTo) : tasks;
65789
+ const visibleTasks = query.assignedTo ? assignedTasks : filterUnavailableAssignedTasks(assignedTasks, nodeRegistry);
65790
+ const result = buildTaskListResult(
65791
+ visibleTasks,
65792
+ nodeRegistry,
65793
+ {
65794
+ projectPath: query.projectPath,
65795
+ cursor: query.cursor,
65796
+ limit: query.limit,
65797
+ offset: query.offset,
65798
+ completedLimitPerProject: query.completedLimitPerProject
65799
+ }
65800
+ );
65634
65801
  res.json({
65635
65802
  tasks: result.tasks.map((task) => toTaskResponse(task, nodeRegistry, taskEngine, shareOrigin)),
65636
- total: result.total
65803
+ total: result.total,
65804
+ hasMore: result.hasMore,
65805
+ nextCursor: result.nextCursor,
65806
+ ...result.completedGroups ? { completedGroups: result.completedGroups } : {}
65637
65807
  });
65638
65808
  }));
65639
65809
  router.post("/batch/delete", asyncHandler7(async (req, res) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meshy-node",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "private": false,
5
5
  "description": "Standalone Meshy node package with bundled runtime and dashboard assets.",
6
6
  "type": "commonjs",
@@ -8,6 +8,10 @@
8
8
  "meshy": "main.cjs"
9
9
  },
10
10
  "main": "main.cjs",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/ai-microsoft/meshy.git"
14
+ },
11
15
  "files": [
12
16
  "main.cjs",
13
17
  "runtime-metadata.json",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "packageName": "meshy-node",
3
- "packageVersion": "0.7.2",
3
+ "packageVersion": "0.7.3",
4
4
  "packages": {
5
5
  "workspace": {
6
6
  "name": "meshy",
7
- "version": "0.7.2"
7
+ "version": "0.7.3"
8
8
  },
9
9
  "node": {
10
10
  "name": "meshy-node",
11
- "version": "0.7.2"
11
+ "version": "0.7.3"
12
12
  },
13
13
  "core": {
14
14
  "name": "@meshy/core",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "repository": {
27
27
  "url": "https://github.com/ai-microsoft/meshy",
28
- "branch": "DesktopInputCheck",
29
- "commit": "c231ea4"
28
+ "branch": "main",
29
+ "commit": "5c5c945"
30
30
  }
31
31
  }