@digipair/skill-cron 0.26.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
package/index.cjs.js CHANGED
@@ -9958,7 +9958,7 @@ let CronService = class CronService {
9958
9958
  this.startTask = startTask;
9959
9959
  }
9960
9960
  async start(path) {
9961
- const content = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
9961
+ const content = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
9962
9962
  const lines = content.split('\n').filter((line)=>line !== '');
9963
9963
  const planning = lines.map((line)=>JSON.parse(line));
9964
9964
  for (const plan of planning){
@@ -10003,7 +10003,7 @@ let CronService = class CronService {
10003
10003
  var _context_privates;
10004
10004
  var _context_privates_EDITOR_PATH;
10005
10005
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
10006
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10006
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10007
10007
  const lines = text.split('\n').filter((line)=>line !== '');
10008
10008
  const crons = lines.map((line)=>JSON.parse(line));
10009
10009
  return crons;
@@ -10019,7 +10019,7 @@ let CronService = class CronService {
10019
10019
  reasoning,
10020
10020
  enabled: true
10021
10021
  };
10022
- await fs.promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
10022
+ await fs.promises.appendFile(`${path}/planning.jsonl`, '\n' + JSON.stringify(cron), 'utf8');
10023
10023
  this.addJob(path, cron.id, digipair, reasoning, time);
10024
10024
  return cron;
10025
10025
  }
@@ -10027,12 +10027,12 @@ let CronService = class CronService {
10027
10027
  var _context_privates;
10028
10028
  var _context_privates_EDITOR_PATH;
10029
10029
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10030
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10030
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10031
10031
  const lines = text.split('\n').filter((line)=>line !== '');
10032
10032
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10033
10033
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10034
10034
  this.deleteJob(id);
10035
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10035
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10036
10036
  return {
10037
10037
  id
10038
10038
  };
@@ -10041,13 +10041,13 @@ let CronService = class CronService {
10041
10041
  var _context_privates;
10042
10042
  var _context_privates_EDITOR_PATH;
10043
10043
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10044
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10044
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10045
10045
  const lines = text.split('\n').filter((line)=>line !== '');
10046
10046
  const crons = lines.map((line)=>JSON.parse(line));
10047
10047
  const cron = crons.find((cron)=>cron.id === id);
10048
10048
  cron.enabled = true;
10049
10049
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10050
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10050
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10051
10051
  this.enableJob(id);
10052
10052
  return cron;
10053
10053
  }
@@ -10055,14 +10055,14 @@ let CronService = class CronService {
10055
10055
  var _context_privates;
10056
10056
  var _context_privates_EDITOR_PATH;
10057
10057
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10058
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10058
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10059
10059
  const lines = text.split('\n').filter((line)=>line !== '');
10060
10060
  const crons = lines.map((line)=>JSON.parse(line));
10061
10061
  const cron = crons.find((cron)=>cron.id === id);
10062
10062
  cron.enabled = false;
10063
10063
  this.disableJob(id);
10064
10064
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10065
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10065
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10066
10066
  return cron;
10067
10067
  }
10068
10068
  constructor(){
package/index.esm.js CHANGED
@@ -9950,7 +9950,7 @@ let CronService = class CronService {
9950
9950
  this.startTask = startTask;
9951
9951
  }
9952
9952
  async start(path) {
9953
- const content = await promises.readFile(`${path}/planning.json`, 'utf8');
9953
+ const content = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
9954
9954
  const lines = content.split('\n').filter((line)=>line !== '');
9955
9955
  const planning = lines.map((line)=>JSON.parse(line));
9956
9956
  for (const plan of planning){
@@ -9995,7 +9995,7 @@ let CronService = class CronService {
9995
9995
  var _context_privates;
9996
9996
  var _context_privates_EDITOR_PATH;
9997
9997
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
9998
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
9998
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
9999
9999
  const lines = text.split('\n').filter((line)=>line !== '');
10000
10000
  const crons = lines.map((line)=>JSON.parse(line));
10001
10001
  return crons;
@@ -10011,7 +10011,7 @@ let CronService = class CronService {
10011
10011
  reasoning,
10012
10012
  enabled: true
10013
10013
  };
10014
- await promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
10014
+ await promises.appendFile(`${path}/planning.jsonl`, '\n' + JSON.stringify(cron), 'utf8');
10015
10015
  this.addJob(path, cron.id, digipair, reasoning, time);
10016
10016
  return cron;
10017
10017
  }
@@ -10019,12 +10019,12 @@ let CronService = class CronService {
10019
10019
  var _context_privates;
10020
10020
  var _context_privates_EDITOR_PATH;
10021
10021
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10022
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10022
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10023
10023
  const lines = text.split('\n').filter((line)=>line !== '');
10024
10024
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10025
10025
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10026
10026
  this.deleteJob(id);
10027
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10027
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10028
10028
  return {
10029
10029
  id
10030
10030
  };
@@ -10033,13 +10033,13 @@ let CronService = class CronService {
10033
10033
  var _context_privates;
10034
10034
  var _context_privates_EDITOR_PATH;
10035
10035
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10036
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10036
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10037
10037
  const lines = text.split('\n').filter((line)=>line !== '');
10038
10038
  const crons = lines.map((line)=>JSON.parse(line));
10039
10039
  const cron = crons.find((cron)=>cron.id === id);
10040
10040
  cron.enabled = true;
10041
10041
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10042
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10042
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10043
10043
  this.enableJob(id);
10044
10044
  return cron;
10045
10045
  }
@@ -10047,14 +10047,14 @@ let CronService = class CronService {
10047
10047
  var _context_privates;
10048
10048
  var _context_privates_EDITOR_PATH;
10049
10049
  const { path = (_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10050
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10050
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10051
10051
  const lines = text.split('\n').filter((line)=>line !== '');
10052
10052
  const crons = lines.map((line)=>JSON.parse(line));
10053
10053
  const cron = crons.find((cron)=>cron.id === id);
10054
10054
  cron.enabled = false;
10055
10055
  this.disableJob(id);
10056
10056
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10057
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10057
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10058
10058
  return cron;
10059
10059
  }
10060
10060
  constructor(){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-cron",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "dependencies": {
5
5
  "cron": "^3.1.7"
6
6
  },