@devness/useai-cli 0.4.11 → 0.4.13

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -13
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var SYSTEMD_SERVICE_PATH = join(homedir(), ".config", "systemd", "user", "useai-
30
30
  var WINDOWS_STARTUP_SCRIPT_PATH = join(process.env["APPDATA"] ?? join(homedir(), "AppData", "Roaming"), "Microsoft", "Windows", "Start Menu", "Programs", "Startup", "useai-daemon.vbs");
31
31
 
32
32
  // ../shared/dist/constants/version.js
33
- var VERSION = "0.4.11";
33
+ var VERSION = "0.4.13";
34
34
 
35
35
  // ../shared/dist/constants/defaults.js
36
36
  var DEFAULT_CONFIG = {
@@ -4898,17 +4898,11 @@ process.stdin.on('end', () => {
4898
4898
  var starts = (transcript.match(/useai_session_start/g) || []).length;
4899
4899
  if (starts === 0) process.exit(0);
4900
4900
  var ends = (transcript.match(/useai_session_end/g) || []).length;
4901
- if (starts > ends) {
4902
- process.stdout.write(JSON.stringify({
4903
- decision: 'block',
4904
- reason: 'Before ending, call useai_session_end with milestones (generic descriptions of accomplishments), languages used, and files_touched_count.'
4905
- }));
4906
- } else {
4907
- process.stdout.write(JSON.stringify({
4908
- decision: 'block',
4909
- reason: 'You did work without UseAI tracking. Call useai_session_start first, then useai_session_end with milestones (generic descriptions of accomplishments), languages used, and files_touched_count.'
4910
- }));
4911
- }
4901
+ if (ends >= starts) process.exit(0);
4902
+ process.stdout.write(JSON.stringify({
4903
+ decision: 'block',
4904
+ reason: 'Before ending, call useai_session_end with milestones (generic descriptions of accomplishments), languages used, and files_touched_count.'
4905
+ }));
4912
4906
  } catch { process.exit(0); }
4913
4907
  });
4914
4908
  `;
@@ -5244,11 +5238,17 @@ function injectInstructions(config) {
5244
5238
  writeFileSync4(config.path, USEAI_INSTRUCTIONS + "\n");
5245
5239
  return;
5246
5240
  }
5247
- if (hasInstructionsBlock(config.path)) return;
5248
5241
  let existing = "";
5249
5242
  if (existsSync8(config.path)) {
5250
5243
  existing = readFileSync4(config.path, "utf-8");
5251
5244
  }
5245
+ if (hasInstructionsBlock(config.path)) {
5246
+ const pattern = new RegExp(
5247
+ `${INSTRUCTIONS_START}[\\s\\S]*?${INSTRUCTIONS_END}`
5248
+ );
5249
+ writeFileSync4(config.path, existing.replace(pattern, USEAI_INSTRUCTIONS_BLOCK));
5250
+ return;
5251
+ }
5252
5252
  const separator = existing && !existing.endsWith("\n") ? "\n\n" : existing ? "\n" : "";
5253
5253
  writeFileSync4(config.path, existing + separator + USEAI_INSTRUCTIONS_BLOCK + "\n");
5254
5254
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai-cli",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
4
4
  "description": "CLI tool for useai.dev — stats, sync, publish your AI development workflow",
5
5
  "author": "nabeelkausari",
6
6
  "license": "MIT",