crewx 0.8.7-rc.26 → 0.8.7-rc.27

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.
@@ -17,45 +17,46 @@ const common_1 = require("@nestjs/common");
17
17
  const swagger_1 = require("@nestjs/swagger");
18
18
  const cron_service_js_1 = require("./cron.service.js");
19
19
  const cron_dto_js_1 = require("./dto/cron.dto.js");
20
+ const workspace_decorator_js_1 = require("../../common/decorators/workspace.decorator.js");
20
21
  let CronScheduleController = class CronScheduleController {
21
22
  cronService;
22
23
  constructor(cronService) {
23
24
  this.cronService = cronService;
24
25
  }
25
- list() {
26
- const schedules = this.cronService.list();
26
+ list(ws) {
27
+ const schedules = this.cronService.list(ws.path);
27
28
  return { success: true, data: { schedules } };
28
29
  }
29
- get(id) {
30
- const data = this.cronService.get(id);
30
+ get(id, ws) {
31
+ const data = this.cronService.get(id, ws.path);
31
32
  return { success: true, data };
32
33
  }
33
- create(dto) {
34
- const data = this.cronService.create(dto);
34
+ create(dto, ws) {
35
+ const data = this.cronService.create(dto, ws.path);
35
36
  return { success: true, data };
36
37
  }
37
- update(id, dto) {
38
- const data = this.cronService.update(id, dto);
38
+ update(id, dto, ws) {
39
+ const data = this.cronService.update(id, dto, ws.path);
39
40
  return { success: true, data };
40
41
  }
41
- remove(id) {
42
- const data = this.cronService.remove(id);
42
+ remove(id, ws) {
43
+ const data = this.cronService.remove(id, ws.path);
43
44
  return { success: true, data };
44
45
  }
45
- toggle(id, body) {
46
- const data = this.cronService.toggle(id, body.enabled);
46
+ toggle(id, body, ws) {
47
+ const data = this.cronService.toggle(id, body.enabled, ws.path);
47
48
  return { success: true, data };
48
49
  }
49
- getDaemonStatus() {
50
- const data = this.cronService.getDaemonStatus();
50
+ getDaemonStatus(ws) {
51
+ const data = this.cronService.getDaemonStatus(ws.path);
51
52
  return { success: true, data };
52
53
  }
53
- startDaemon() {
54
- const pid = this.cronService.startDaemon();
54
+ startDaemon(ws) {
55
+ const pid = this.cronService.startDaemon(ws.path);
55
56
  return { success: true, data: { pid } };
56
57
  }
57
- stopDaemon() {
58
- const stopped = this.cronService.stopDaemon();
58
+ stopDaemon(ws) {
59
+ const stopped = this.cronService.stopDaemon(ws.path);
59
60
  return { success: true, data: { stopped } };
60
61
  }
61
62
  };
@@ -63,24 +64,27 @@ exports.CronScheduleController = CronScheduleController;
63
64
  __decorate([
64
65
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.LIST', summary: 'List all cron schedules' }),
65
66
  (0, common_1.Get)('schedules'),
67
+ __param(0, (0, workspace_decorator_js_1.Workspace)()),
66
68
  __metadata("design:type", Function),
67
- __metadata("design:paramtypes", []),
69
+ __metadata("design:paramtypes", [Object]),
68
70
  __metadata("design:returntype", void 0)
69
71
  ], CronScheduleController.prototype, "list", null);
70
72
  __decorate([
71
73
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.GET', summary: 'Get a cron schedule by ID' }),
72
74
  (0, common_1.Get)('schedules/:id'),
73
75
  __param(0, (0, common_1.Param)('id')),
76
+ __param(1, (0, workspace_decorator_js_1.Workspace)()),
74
77
  __metadata("design:type", Function),
75
- __metadata("design:paramtypes", [String]),
78
+ __metadata("design:paramtypes", [String, Object]),
76
79
  __metadata("design:returntype", void 0)
77
80
  ], CronScheduleController.prototype, "get", null);
78
81
  __decorate([
79
82
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.CREATE', summary: 'Create a new cron schedule' }),
80
83
  (0, common_1.Post)('schedules'),
81
84
  __param(0, (0, common_1.Body)()),
85
+ __param(1, (0, workspace_decorator_js_1.Workspace)()),
82
86
  __metadata("design:type", Function),
83
- __metadata("design:paramtypes", [cron_dto_js_1.CreateCronScheduleDto]),
87
+ __metadata("design:paramtypes", [cron_dto_js_1.CreateCronScheduleDto, Object]),
84
88
  __metadata("design:returntype", void 0)
85
89
  ], CronScheduleController.prototype, "create", null);
86
90
  __decorate([
@@ -88,16 +92,18 @@ __decorate([
88
92
  (0, common_1.Patch)('schedules/:id'),
89
93
  __param(0, (0, common_1.Param)('id')),
90
94
  __param(1, (0, common_1.Body)()),
95
+ __param(2, (0, workspace_decorator_js_1.Workspace)()),
91
96
  __metadata("design:type", Function),
92
- __metadata("design:paramtypes", [String, cron_dto_js_1.UpdateCronScheduleDto]),
97
+ __metadata("design:paramtypes", [String, cron_dto_js_1.UpdateCronScheduleDto, Object]),
93
98
  __metadata("design:returntype", void 0)
94
99
  ], CronScheduleController.prototype, "update", null);
95
100
  __decorate([
96
101
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.DELETE', summary: 'Delete a cron schedule' }),
97
102
  (0, common_1.Delete)('schedules/:id'),
98
103
  __param(0, (0, common_1.Param)('id')),
104
+ __param(1, (0, workspace_decorator_js_1.Workspace)()),
99
105
  __metadata("design:type", Function),
100
- __metadata("design:paramtypes", [String]),
106
+ __metadata("design:paramtypes", [String, Object]),
101
107
  __metadata("design:returntype", void 0)
102
108
  ], CronScheduleController.prototype, "remove", null);
103
109
  __decorate([
@@ -105,29 +111,33 @@ __decorate([
105
111
  (0, common_1.Patch)('schedules/:id/toggle'),
106
112
  __param(0, (0, common_1.Param)('id')),
107
113
  __param(1, (0, common_1.Body)()),
114
+ __param(2, (0, workspace_decorator_js_1.Workspace)()),
108
115
  __metadata("design:type", Function),
109
- __metadata("design:paramtypes", [String, cron_dto_js_1.ToggleCronScheduleDto]),
116
+ __metadata("design:paramtypes", [String, cron_dto_js_1.ToggleCronScheduleDto, Object]),
110
117
  __metadata("design:returntype", void 0)
111
118
  ], CronScheduleController.prototype, "toggle", null);
112
119
  __decorate([
113
120
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.STATUS', summary: 'Get cron daemon status' }),
114
121
  (0, common_1.Get)('daemon'),
122
+ __param(0, (0, workspace_decorator_js_1.Workspace)()),
115
123
  __metadata("design:type", Function),
116
- __metadata("design:paramtypes", []),
124
+ __metadata("design:paramtypes", [Object]),
117
125
  __metadata("design:returntype", void 0)
118
126
  ], CronScheduleController.prototype, "getDaemonStatus", null);
119
127
  __decorate([
120
128
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.DAEMON.START', summary: 'Start cron daemon' }),
121
129
  (0, common_1.Post)('daemon/start'),
130
+ __param(0, (0, workspace_decorator_js_1.Workspace)()),
122
131
  __metadata("design:type", Function),
123
- __metadata("design:paramtypes", []),
132
+ __metadata("design:paramtypes", [Object]),
124
133
  __metadata("design:returntype", void 0)
125
134
  ], CronScheduleController.prototype, "startDaemon", null);
126
135
  __decorate([
127
136
  (0, swagger_1.ApiOperation)({ operationId: 'CRON.DAEMON.STOP', summary: 'Stop cron daemon' }),
128
137
  (0, common_1.Post)('daemon/stop'),
138
+ __param(0, (0, workspace_decorator_js_1.Workspace)()),
129
139
  __metadata("design:type", Function),
130
- __metadata("design:paramtypes", []),
140
+ __metadata("design:paramtypes", [Object]),
131
141
  __metadata("design:returntype", void 0)
132
142
  ], CronScheduleController.prototype, "stopDaemon", null);
133
143
  exports.CronScheduleController = CronScheduleController = __decorate([
@@ -10,18 +10,18 @@ exports.CronScheduleService = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const cron_1 = require("@crewx/cron");
12
12
  let CronScheduleService = class CronScheduleService {
13
- list() {
14
- return (0, cron_1.loadSchedules)();
13
+ list(workspacePath) {
14
+ return (0, cron_1.loadSchedules)(workspacePath);
15
15
  }
16
- get(id) {
17
- const schedules = (0, cron_1.loadSchedules)();
16
+ get(id, workspacePath) {
17
+ const schedules = (0, cron_1.loadSchedules)(workspacePath);
18
18
  const schedule = schedules.find(s => s.id === id);
19
19
  if (!schedule) {
20
20
  throw new common_1.NotFoundException(`Schedule not found: ${id}`);
21
21
  }
22
22
  return schedule;
23
23
  }
24
- create(dto) {
24
+ create(dto, workspacePath) {
25
25
  return (0, cron_1.addSchedule)(dto.cron, dto.command, {
26
26
  name: dto.name,
27
27
  mode: dto.mode,
@@ -29,9 +29,9 @@ let CronScheduleService = class CronScheduleService {
29
29
  dir: dto.working_directory,
30
30
  timeout: dto.timeout_ms !== undefined ? String(dto.timeout_ms) : undefined,
31
31
  allowConcurrent: dto.allow_concurrent,
32
- });
32
+ }, workspacePath);
33
33
  }
34
- update(id, dto) {
34
+ update(id, dto, workspacePath) {
35
35
  const { schedule } = (0, cron_1.updateSchedule)(id, {
36
36
  cron: dto.cron,
37
37
  command: dto.command,
@@ -41,34 +41,34 @@ let CronScheduleService = class CronScheduleService {
41
41
  working_directory: dto.working_directory,
42
42
  timeout_ms: dto.timeout_ms,
43
43
  allow_concurrent: dto.allow_concurrent,
44
- });
44
+ }, workspacePath);
45
45
  return schedule;
46
46
  }
47
- remove(id) {
48
- return (0, cron_1.removeSchedule)(id);
47
+ remove(id, workspacePath) {
48
+ return (0, cron_1.removeSchedule)(id, workspacePath);
49
49
  }
50
- toggle(id, enabled) {
51
- const schedules = (0, cron_1.loadSchedules)();
50
+ toggle(id, enabled, workspacePath) {
51
+ const schedules = (0, cron_1.loadSchedules)(workspacePath);
52
52
  const schedule = schedules.find(s => s.id === id);
53
53
  if (!schedule) {
54
54
  throw new common_1.NotFoundException(`Schedule not found: ${id}`);
55
55
  }
56
56
  const targetEnabled = enabled ?? !schedule.enabled;
57
57
  if (targetEnabled) {
58
- return (0, cron_1.enableSchedule)(id);
58
+ return (0, cron_1.enableSchedule)(id, workspacePath);
59
59
  }
60
60
  else {
61
- return (0, cron_1.disableSchedule)(id);
61
+ return (0, cron_1.disableSchedule)(id, workspacePath);
62
62
  }
63
63
  }
64
- getDaemonStatus() {
65
- return (0, cron_1.getDaemonStatus)();
64
+ getDaemonStatus(workspacePath) {
65
+ return (0, cron_1.getDaemonStatus)(workspacePath);
66
66
  }
67
- startDaemon() {
68
- return (0, cron_1.startDaemon)();
67
+ startDaemon(workspacePath) {
68
+ return (0, cron_1.startDaemon)(workspacePath);
69
69
  }
70
- stopDaemon() {
71
- return (0, cron_1.stopDaemon)();
70
+ stopDaemon(workspacePath) {
71
+ return (0, cron_1.stopDaemon)(workspacePath);
72
72
  }
73
73
  };
74
74
  exports.CronScheduleService = CronScheduleService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crewx",
3
- "version": "0.8.7-rc.26",
3
+ "version": "0.8.7-rc.27",
4
4
  "description": "CrewX — AI agent team dashboard with Electron UI and CLI (Web + Electron + Global CLI)",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -74,17 +74,17 @@
74
74
  "wink-nlp-utils": "2.1.0",
75
75
  "yargs": "17.7.0",
76
76
  "zod": "3.25.76",
77
- "@crewx/cli": "0.8.7-rc.26",
78
- "@crewx/cron": "0.1.8",
79
- "@crewx/knowledge-core": "0.1.16",
77
+ "@crewx/cli": "0.8.7-rc.27",
78
+ "@crewx/doc": "0.1.8",
80
79
  "@crewx/memory": "0.1.21",
81
- "@crewx/sdk": "0.8.7-rc.26",
80
+ "@crewx/knowledge-core": "0.1.16",
81
+ "@crewx/cron": "0.1.8",
82
82
  "@crewx/search": "0.1.9",
83
+ "@crewx/sdk": "0.8.7-rc.27",
83
84
  "@crewx/shared": "0.0.5",
84
- "@crewx/workflow": "0.3.20",
85
85
  "@crewx/wbs": "0.1.9",
86
- "@crewx/doc": "0.1.8",
87
- "@crewx/skill": "0.1.19"
86
+ "@crewx/skill": "0.1.19",
87
+ "@crewx/workflow": "0.3.20"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@ccusage/codex": "0.0.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewx/cli",
3
- "version": "0.8.7-rc.26",
3
+ "version": "0.8.7-rc.27",
4
4
  "license": "UNLICENSED",
5
5
  "engines": {
6
6
  "node": ">=20.19.0"
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }