@devness/useai-cli 0.4.10 → 0.4.11
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.
- package/dist/index.js +19 -13
- 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.
|
|
33
|
+
var VERSION = "0.4.11";
|
|
34
34
|
|
|
35
35
|
// ../shared/dist/constants/defaults.js
|
|
36
36
|
var DEFAULT_CONFIG = {
|
|
@@ -4895,12 +4895,20 @@ process.stdin.on('end', () => {
|
|
|
4895
4895
|
if (!hook.transcript_path) process.exit(0);
|
|
4896
4896
|
let transcript;
|
|
4897
4897
|
try { transcript = readFileSync(hook.transcript_path, 'utf-8'); } catch { process.exit(0); }
|
|
4898
|
-
|
|
4899
|
-
if (
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4898
|
+
var starts = (transcript.match(/useai_session_start/g) || []).length;
|
|
4899
|
+
if (starts === 0) process.exit(0);
|
|
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
|
+
}
|
|
4904
4912
|
} catch { process.exit(0); }
|
|
4905
4913
|
});
|
|
4906
4914
|
`;
|
|
@@ -5000,10 +5008,9 @@ import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
|
|
|
5000
5008
|
import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
|
|
5001
5009
|
var USEAI_INSTRUCTIONS_TEXT = [
|
|
5002
5010
|
"## UseAI Session Tracking",
|
|
5003
|
-
"- At the START of every
|
|
5011
|
+
"- At the START of every response, call `useai_session_start` with the appropriate task_type.",
|
|
5004
5012
|
"- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
|
|
5005
|
-
"- At the END of every
|
|
5006
|
-
'- MILESTONES PRIVACY: Milestone titles must be COMPLETELY GENERIC. NEVER mention project names, repository names, product names, file names, file paths, class names, or company names. Write as if describing the work to a stranger who knows nothing about the codebase. GOOD: "Fixed race condition in background worker". BAD: "Fixed bug in ProjectX worker service".'
|
|
5013
|
+
"- At the END of every response, call `useai_session_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
|
|
5007
5014
|
].join("\n");
|
|
5008
5015
|
var MCP_ENTRY = {
|
|
5009
5016
|
command: "npx",
|
|
@@ -5216,10 +5223,9 @@ var INSTRUCTIONS_START = "<!-- useai:start -->";
|
|
|
5216
5223
|
var INSTRUCTIONS_END = "<!-- useai:end -->";
|
|
5217
5224
|
var USEAI_INSTRUCTIONS = [
|
|
5218
5225
|
"## UseAI Session Tracking",
|
|
5219
|
-
"- At the START of every
|
|
5226
|
+
"- At the START of every response, call `useai_session_start` with the appropriate task_type.",
|
|
5220
5227
|
"- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
|
|
5221
|
-
"- At the END of every
|
|
5222
|
-
'- MILESTONES PRIVACY: Milestone titles must be COMPLETELY GENERIC. NEVER mention project names, repository names, product names, file names, file paths, class names, or company names. Write as if describing the work to a stranger who knows nothing about the codebase. GOOD: "Fixed race condition in background worker". BAD: "Fixed bug in ProjectX worker service".'
|
|
5228
|
+
"- At the END of every response, call `useai_session_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
|
|
5223
5229
|
].join("\n");
|
|
5224
5230
|
var USEAI_INSTRUCTIONS_BLOCK = `${INSTRUCTIONS_START}
|
|
5225
5231
|
${USEAI_INSTRUCTIONS}
|