@devness/useai 0.4.18 → 0.4.19
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 +12 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -978,13 +978,13 @@ process.stdin.on('end', () => {
|
|
|
978
978
|
if (!hook.transcript_path) process.exit(0);
|
|
979
979
|
let transcript;
|
|
980
980
|
try { transcript = readFileSync(hook.transcript_path, 'utf-8'); } catch { process.exit(0); }
|
|
981
|
-
var starts = (transcript.match(/
|
|
981
|
+
var starts = (transcript.match(/useai_start/g) || []).length;
|
|
982
982
|
if (starts === 0) process.exit(0);
|
|
983
|
-
var ends = (transcript.match(/
|
|
983
|
+
var ends = (transcript.match(/useai_end/g) || []).length;
|
|
984
984
|
if (ends >= starts) process.exit(0);
|
|
985
985
|
process.stdout.write(JSON.stringify({
|
|
986
986
|
decision: 'block',
|
|
987
|
-
reason: 'Before ending, call
|
|
987
|
+
reason: 'Before ending, call useai_end with milestones (generic descriptions of accomplishments), languages used, and files_touched_count.'
|
|
988
988
|
}));
|
|
989
989
|
} catch { process.exit(0); }
|
|
990
990
|
});
|
|
@@ -1001,13 +1001,13 @@ process.stdin.on('end', () => {
|
|
|
1001
1001
|
if (!hook.transcript_path) process.exit(0);
|
|
1002
1002
|
let transcript;
|
|
1003
1003
|
try { transcript = readFileSync(hook.transcript_path, 'utf-8'); } catch { process.exit(0); }
|
|
1004
|
-
var starts = (transcript.match(/
|
|
1005
|
-
var ends = (transcript.match(/
|
|
1004
|
+
var starts = (transcript.match(/useai_start/g) || []).length;
|
|
1005
|
+
var ends = (transcript.match(/useai_end/g) || []).length;
|
|
1006
1006
|
if (starts > ends) process.exit(0);
|
|
1007
1007
|
process.stdout.write(JSON.stringify({
|
|
1008
1008
|
hookSpecificOutput: {
|
|
1009
1009
|
hookEventName: 'UserPromptSubmit',
|
|
1010
|
-
additionalContext: 'UseAI: Call
|
|
1010
|
+
additionalContext: 'UseAI: Call useai_start with the appropriate task_type before doing any work.'
|
|
1011
1011
|
}
|
|
1012
1012
|
}));
|
|
1013
1013
|
} catch { process.exit(0); }
|
|
@@ -1155,7 +1155,7 @@ function resolveClient(server2, session2) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
function registerTools(server2, session2) {
|
|
1157
1157
|
server2.tool(
|
|
1158
|
-
"
|
|
1158
|
+
"useai_start",
|
|
1159
1159
|
"Start tracking an AI coding session. Call this at the beginning of every response.",
|
|
1160
1160
|
{
|
|
1161
1161
|
task_type: z2.enum(["coding", "debugging", "testing", "planning", "reviewing", "documenting", "learning", "other"]).optional().describe("What kind of task is the developer working on?")
|
|
@@ -1201,7 +1201,7 @@ function registerTools(server2, session2) {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
);
|
|
1203
1203
|
server2.tool(
|
|
1204
|
-
"
|
|
1204
|
+
"useai_end",
|
|
1205
1205
|
`End the current AI coding session and record milestones. Each milestone needs TWO titles: (1) a generic public "title" safe for public display (NEVER include project names, file names, class names, or any identifying details), and (2) an optional detailed "private_title" for the user's own records that CAN include project names, file names, and specific details. GOOD title: "Implemented user authentication". GOOD private_title: "Added JWT auth to UseAI API server". BAD title: "Fixed bug in Acme auth service".`,
|
|
1206
1206
|
{
|
|
1207
1207
|
task_type: z2.enum(["coding", "debugging", "testing", "planning", "reviewing", "documenting", "learning", "other"]).optional().describe("What kind of task was the developer working on?"),
|
|
@@ -1654,9 +1654,9 @@ var init_tools = __esm({
|
|
|
1654
1654
|
init_dist();
|
|
1655
1655
|
USEAI_INSTRUCTIONS_TEXT = [
|
|
1656
1656
|
"## UseAI Session Tracking",
|
|
1657
|
-
"- At the START of every response, call `
|
|
1657
|
+
"- At the START of every response, call `useai_start` with the appropriate task_type.",
|
|
1658
1658
|
"- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
|
|
1659
|
-
"- At the END of every response, call `
|
|
1659
|
+
"- At the END of every response, call `useai_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
|
|
1660
1660
|
].join("\n");
|
|
1661
1661
|
MCP_ENTRY = {
|
|
1662
1662
|
command: "npx",
|
|
@@ -1669,9 +1669,9 @@ var init_tools = __esm({
|
|
|
1669
1669
|
INSTRUCTIONS_END = "<!-- useai:end -->";
|
|
1670
1670
|
USEAI_INSTRUCTIONS = [
|
|
1671
1671
|
"## UseAI Session Tracking",
|
|
1672
|
-
"- At the START of every response, call `
|
|
1672
|
+
"- At the START of every response, call `useai_start` with the appropriate task_type.",
|
|
1673
1673
|
"- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
|
|
1674
|
-
"- At the END of every response, call `
|
|
1674
|
+
"- At the END of every response, call `useai_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
|
|
1675
1675
|
].join("\n");
|
|
1676
1676
|
USEAI_INSTRUCTIONS_BLOCK = `${INSTRUCTIONS_START}
|
|
1677
1677
|
${USEAI_INSTRUCTIONS}
|