@scotthamilton77/sidekick 0.1.11 → 0.1.12
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/bin.js +49 -25
- package/dist/daemon.js +48 -24
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -71461,7 +71461,7 @@ var require_types2 = __commonJS({
|
|
|
71461
71461
|
"../feature-reminders/dist/types.js"(exports2) {
|
|
71462
71462
|
"use strict";
|
|
71463
71463
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
71464
|
-
exports2.ALL_VC_REMINDER_IDS = exports2.VC_TOOL_REMINDER_IDS = exports2.ReminderIds = exports2.DEFAULT_REMINDERS_SETTINGS = exports2.DEFAULT_COMPLETION_DETECTION_SETTINGS = exports2.DEFAULT_SOURCE_CODE_PATTERNS = exports2.DEFAULT_VERIFICATION_TOOLS = exports2.VerificationToolsMapSchema = exports2.VerificationToolConfigSchema = exports2.ToolPatternSchema = exports2.ToolPatternScopeSchema = void 0;
|
|
71464
|
+
exports2.ALL_VC_REMINDER_IDS = exports2.VC_TOOL_REMINDER_IDS = exports2.TOOL_REMINDER_MAP = exports2.ReminderIds = exports2.DEFAULT_REMINDERS_SETTINGS = exports2.DEFAULT_COMPLETION_DETECTION_SETTINGS = exports2.DEFAULT_SOURCE_CODE_PATTERNS = exports2.DEFAULT_VERIFICATION_TOOLS = exports2.VerificationToolsMapSchema = exports2.VerificationToolConfigSchema = exports2.ToolPatternSchema = exports2.ToolPatternScopeSchema = void 0;
|
|
71465
71465
|
var zod_1 = require_zod2();
|
|
71466
71466
|
exports2.ToolPatternScopeSchema = zod_1.z.enum(["project", "package", "file"]);
|
|
71467
71467
|
exports2.ToolPatternSchema = zod_1.z.object({
|
|
@@ -71678,6 +71678,12 @@ var require_types2 = __commonJS({
|
|
|
71678
71678
|
PERSONA_CHANGED: "persona-changed",
|
|
71679
71679
|
USER_PROFILE: "user-profile"
|
|
71680
71680
|
};
|
|
71681
|
+
exports2.TOOL_REMINDER_MAP = {
|
|
71682
|
+
build: exports2.ReminderIds.VC_BUILD,
|
|
71683
|
+
typecheck: exports2.ReminderIds.VC_TYPECHECK,
|
|
71684
|
+
test: exports2.ReminderIds.VC_TEST,
|
|
71685
|
+
lint: exports2.ReminderIds.VC_LINT
|
|
71686
|
+
};
|
|
71681
71687
|
exports2.VC_TOOL_REMINDER_IDS = [
|
|
71682
71688
|
exports2.ReminderIds.VC_BUILD,
|
|
71683
71689
|
exports2.ReminderIds.VC_TYPECHECK,
|
|
@@ -73687,12 +73693,6 @@ var require_track_verification_tools = __commonJS({
|
|
|
73687
73693
|
var types_js_1 = require_types2();
|
|
73688
73694
|
var state_js_1 = require_state4();
|
|
73689
73695
|
var FILE_EDIT_TOOLS = ["Write", "Edit", "MultiEdit"];
|
|
73690
|
-
var TOOL_REMINDER_MAP = {
|
|
73691
|
-
build: types_js_1.ReminderIds.VC_BUILD,
|
|
73692
|
-
typecheck: types_js_1.ReminderIds.VC_TYPECHECK,
|
|
73693
|
-
test: types_js_1.ReminderIds.VC_TEST,
|
|
73694
|
-
lint: types_js_1.ReminderIds.VC_LINT
|
|
73695
|
-
};
|
|
73696
73696
|
var VC_TOOL_NAME_SET = new Set(types_js_1.VC_TOOL_REMINDER_IDS);
|
|
73697
73697
|
function extractToolInput(event) {
|
|
73698
73698
|
const entry = event.payload.entry;
|
|
@@ -73740,7 +73740,7 @@ var require_track_verification_tools = __commonJS({
|
|
|
73740
73740
|
const emittedNotStaged = /* @__PURE__ */ new Set();
|
|
73741
73741
|
for (const filePath of filePaths) {
|
|
73742
73742
|
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
73743
|
-
const reminderId = TOOL_REMINDER_MAP[toolName];
|
|
73743
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
73744
73744
|
if (!reminderId)
|
|
73745
73745
|
continue;
|
|
73746
73746
|
if (!toolConfig.enabled) {
|
|
@@ -73849,7 +73849,7 @@ var require_track_verification_tools = __commonJS({
|
|
|
73849
73849
|
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
73850
73850
|
if (!toolConfig.enabled)
|
|
73851
73851
|
continue;
|
|
73852
|
-
const reminderId = TOOL_REMINDER_MAP[toolName];
|
|
73852
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
73853
73853
|
if (!reminderId)
|
|
73854
73854
|
continue;
|
|
73855
73855
|
const match = (0, tool_pattern_matcher_js_1.findMatchingPattern)(command, toolConfig.patterns);
|
|
@@ -74071,6 +74071,18 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
74071
74071
|
var types_js_1 = require_types2();
|
|
74072
74072
|
var reminder_utils_js_1 = require_reminder_utils();
|
|
74073
74073
|
var state_js_1 = require_state4();
|
|
74074
|
+
function toolNeedsVerification(toolConfig, state) {
|
|
74075
|
+
if (!toolConfig.enabled)
|
|
74076
|
+
return false;
|
|
74077
|
+
if (!state)
|
|
74078
|
+
return true;
|
|
74079
|
+
if (state.status === "staged")
|
|
74080
|
+
return true;
|
|
74081
|
+
if (state.status === "verified" || state.status === "cooldown") {
|
|
74082
|
+
return state.editsSinceVerified >= toolConfig.clearing_threshold;
|
|
74083
|
+
}
|
|
74084
|
+
return false;
|
|
74085
|
+
}
|
|
74074
74086
|
function registerUnstageVerifyCompletion(context) {
|
|
74075
74087
|
if (!(0, types_1.isDaemonContext)(context))
|
|
74076
74088
|
return;
|
|
@@ -74088,8 +74100,10 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
74088
74100
|
const sessionId = event.context?.sessionId;
|
|
74089
74101
|
if (!sessionId) {
|
|
74090
74102
|
daemonCtx.logger.warn("No sessionId in UserPromptSubmit event");
|
|
74091
|
-
|
|
74092
|
-
|
|
74103
|
+
for (const vcId of types_js_1.ALL_VC_REMINDER_IDS) {
|
|
74104
|
+
await daemonCtx.staging.deleteReminder("Stop", vcId);
|
|
74105
|
+
(0, core_1.logEvent)(daemonCtx.logger, events_js_1.ReminderEvents.reminderUnstaged({ sessionId: "" }, { reminderName: vcId, hookName: "Stop", reason: "no_session_id" }));
|
|
74106
|
+
}
|
|
74093
74107
|
return;
|
|
74094
74108
|
}
|
|
74095
74109
|
const remindersState = (0, state_js_1.createRemindersState)(daemonCtx.stateService);
|
|
@@ -74112,19 +74126,7 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
74112
74126
|
const verificationToolsResult = await remindersState.verificationTools.read(sessionId);
|
|
74113
74127
|
const toolsState = verificationToolsResult.data;
|
|
74114
74128
|
const verificationTools = config.verification_tools ?? {};
|
|
74115
|
-
const hasToolsNeedingVerification = Object.entries(verificationTools).some(([toolName, toolConfig]) =>
|
|
74116
|
-
if (!toolConfig.enabled)
|
|
74117
|
-
return false;
|
|
74118
|
-
const state = toolsState[toolName];
|
|
74119
|
-
if (!state)
|
|
74120
|
-
return true;
|
|
74121
|
-
if (state.status === "staged")
|
|
74122
|
-
return true;
|
|
74123
|
-
if (state.status === "verified" || state.status === "cooldown") {
|
|
74124
|
-
return state.editsSinceVerified >= toolConfig.clearing_threshold;
|
|
74125
|
-
}
|
|
74126
|
-
return false;
|
|
74127
|
-
});
|
|
74129
|
+
const hasToolsNeedingVerification = Object.entries(verificationTools).some(([toolName, toolConfig]) => toolNeedsVerification(toolConfig, toolsState[toolName]));
|
|
74128
74130
|
if (!hasToolsNeedingVerification) {
|
|
74129
74131
|
daemonCtx.logger.info("VC unstage: all tools verified, skipping wrapper re-stage", {
|
|
74130
74132
|
sessionId,
|
|
@@ -74132,6 +74134,28 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
74132
74134
|
});
|
|
74133
74135
|
await remindersState.vcUnverified.delete(sessionId);
|
|
74134
74136
|
} else {
|
|
74137
|
+
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
74138
|
+
if (!toolNeedsVerification(toolConfig, toolsState[toolName]))
|
|
74139
|
+
continue;
|
|
74140
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
74141
|
+
if (!reminderId)
|
|
74142
|
+
continue;
|
|
74143
|
+
const toolReminder = (0, reminder_utils_js_1.resolveReminder)(reminderId, {
|
|
74144
|
+
context: {},
|
|
74145
|
+
assets: daemonCtx.assets
|
|
74146
|
+
});
|
|
74147
|
+
if (toolReminder) {
|
|
74148
|
+
await (0, reminder_utils_js_1.stageReminder)(daemonCtx, "Stop", {
|
|
74149
|
+
...toolReminder,
|
|
74150
|
+
stagedAt: {
|
|
74151
|
+
timestamp: Date.now(),
|
|
74152
|
+
turnCount: unverifiedState.setAt.turnCount,
|
|
74153
|
+
toolsThisTurn: unverifiedState.setAt.toolsThisTurn,
|
|
74154
|
+
toolCount: unverifiedState.setAt.toolCount
|
|
74155
|
+
}
|
|
74156
|
+
});
|
|
74157
|
+
}
|
|
74158
|
+
}
|
|
74135
74159
|
const reminder = (0, reminder_utils_js_1.resolveReminder)(types_js_1.ReminderIds.VERIFY_COMPLETION, {
|
|
74136
74160
|
context: {},
|
|
74137
74161
|
assets: daemonCtx.assets
|
|
@@ -83735,7 +83759,7 @@ var require_cli = __commonJS({
|
|
|
83735
83759
|
var promises_12 = require("node:fs/promises");
|
|
83736
83760
|
var node_stream_1 = require("node:stream");
|
|
83737
83761
|
var yargs_parser_1 = __importDefault2(require_build());
|
|
83738
|
-
var VERSION = true ? "0.1.
|
|
83762
|
+
var VERSION = true ? "0.1.12" : "dev";
|
|
83739
83763
|
var SANDBOX_ERROR_MESSAGE = `Error: Daemon commands cannot run in sandbox mode.
|
|
83740
83764
|
|
|
83741
83765
|
Claude Code's sandbox blocks Unix socket operations required for daemon IPC.
|
package/dist/daemon.js
CHANGED
|
@@ -70308,7 +70308,7 @@ var require_types2 = __commonJS({
|
|
|
70308
70308
|
"../feature-reminders/dist/types.js"(exports2) {
|
|
70309
70309
|
"use strict";
|
|
70310
70310
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
70311
|
-
exports2.ALL_VC_REMINDER_IDS = exports2.VC_TOOL_REMINDER_IDS = exports2.ReminderIds = exports2.DEFAULT_REMINDERS_SETTINGS = exports2.DEFAULT_COMPLETION_DETECTION_SETTINGS = exports2.DEFAULT_SOURCE_CODE_PATTERNS = exports2.DEFAULT_VERIFICATION_TOOLS = exports2.VerificationToolsMapSchema = exports2.VerificationToolConfigSchema = exports2.ToolPatternSchema = exports2.ToolPatternScopeSchema = void 0;
|
|
70311
|
+
exports2.ALL_VC_REMINDER_IDS = exports2.VC_TOOL_REMINDER_IDS = exports2.TOOL_REMINDER_MAP = exports2.ReminderIds = exports2.DEFAULT_REMINDERS_SETTINGS = exports2.DEFAULT_COMPLETION_DETECTION_SETTINGS = exports2.DEFAULT_SOURCE_CODE_PATTERNS = exports2.DEFAULT_VERIFICATION_TOOLS = exports2.VerificationToolsMapSchema = exports2.VerificationToolConfigSchema = exports2.ToolPatternSchema = exports2.ToolPatternScopeSchema = void 0;
|
|
70312
70312
|
var zod_1 = require_zod2();
|
|
70313
70313
|
exports2.ToolPatternScopeSchema = zod_1.z.enum(["project", "package", "file"]);
|
|
70314
70314
|
exports2.ToolPatternSchema = zod_1.z.object({
|
|
@@ -70525,6 +70525,12 @@ var require_types2 = __commonJS({
|
|
|
70525
70525
|
PERSONA_CHANGED: "persona-changed",
|
|
70526
70526
|
USER_PROFILE: "user-profile"
|
|
70527
70527
|
};
|
|
70528
|
+
exports2.TOOL_REMINDER_MAP = {
|
|
70529
|
+
build: exports2.ReminderIds.VC_BUILD,
|
|
70530
|
+
typecheck: exports2.ReminderIds.VC_TYPECHECK,
|
|
70531
|
+
test: exports2.ReminderIds.VC_TEST,
|
|
70532
|
+
lint: exports2.ReminderIds.VC_LINT
|
|
70533
|
+
};
|
|
70528
70534
|
exports2.VC_TOOL_REMINDER_IDS = [
|
|
70529
70535
|
exports2.ReminderIds.VC_BUILD,
|
|
70530
70536
|
exports2.ReminderIds.VC_TYPECHECK,
|
|
@@ -72534,12 +72540,6 @@ var require_track_verification_tools = __commonJS({
|
|
|
72534
72540
|
var types_js_1 = require_types2();
|
|
72535
72541
|
var state_js_1 = require_state4();
|
|
72536
72542
|
var FILE_EDIT_TOOLS = ["Write", "Edit", "MultiEdit"];
|
|
72537
|
-
var TOOL_REMINDER_MAP = {
|
|
72538
|
-
build: types_js_1.ReminderIds.VC_BUILD,
|
|
72539
|
-
typecheck: types_js_1.ReminderIds.VC_TYPECHECK,
|
|
72540
|
-
test: types_js_1.ReminderIds.VC_TEST,
|
|
72541
|
-
lint: types_js_1.ReminderIds.VC_LINT
|
|
72542
|
-
};
|
|
72543
72543
|
var VC_TOOL_NAME_SET = new Set(types_js_1.VC_TOOL_REMINDER_IDS);
|
|
72544
72544
|
function extractToolInput(event) {
|
|
72545
72545
|
const entry = event.payload.entry;
|
|
@@ -72587,7 +72587,7 @@ var require_track_verification_tools = __commonJS({
|
|
|
72587
72587
|
const emittedNotStaged = /* @__PURE__ */ new Set();
|
|
72588
72588
|
for (const filePath of filePaths) {
|
|
72589
72589
|
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
72590
|
-
const reminderId = TOOL_REMINDER_MAP[toolName];
|
|
72590
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
72591
72591
|
if (!reminderId)
|
|
72592
72592
|
continue;
|
|
72593
72593
|
if (!toolConfig.enabled) {
|
|
@@ -72696,7 +72696,7 @@ var require_track_verification_tools = __commonJS({
|
|
|
72696
72696
|
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
72697
72697
|
if (!toolConfig.enabled)
|
|
72698
72698
|
continue;
|
|
72699
|
-
const reminderId = TOOL_REMINDER_MAP[toolName];
|
|
72699
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
72700
72700
|
if (!reminderId)
|
|
72701
72701
|
continue;
|
|
72702
72702
|
const match = (0, tool_pattern_matcher_js_1.findMatchingPattern)(command, toolConfig.patterns);
|
|
@@ -72918,6 +72918,18 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
72918
72918
|
var types_js_1 = require_types2();
|
|
72919
72919
|
var reminder_utils_js_1 = require_reminder_utils();
|
|
72920
72920
|
var state_js_1 = require_state4();
|
|
72921
|
+
function toolNeedsVerification(toolConfig, state) {
|
|
72922
|
+
if (!toolConfig.enabled)
|
|
72923
|
+
return false;
|
|
72924
|
+
if (!state)
|
|
72925
|
+
return true;
|
|
72926
|
+
if (state.status === "staged")
|
|
72927
|
+
return true;
|
|
72928
|
+
if (state.status === "verified" || state.status === "cooldown") {
|
|
72929
|
+
return state.editsSinceVerified >= toolConfig.clearing_threshold;
|
|
72930
|
+
}
|
|
72931
|
+
return false;
|
|
72932
|
+
}
|
|
72921
72933
|
function registerUnstageVerifyCompletion(context) {
|
|
72922
72934
|
if (!(0, types_1.isDaemonContext)(context))
|
|
72923
72935
|
return;
|
|
@@ -72935,8 +72947,10 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
72935
72947
|
const sessionId = event.context?.sessionId;
|
|
72936
72948
|
if (!sessionId) {
|
|
72937
72949
|
daemonCtx.logger.warn("No sessionId in UserPromptSubmit event");
|
|
72938
|
-
|
|
72939
|
-
|
|
72950
|
+
for (const vcId of types_js_1.ALL_VC_REMINDER_IDS) {
|
|
72951
|
+
await daemonCtx.staging.deleteReminder("Stop", vcId);
|
|
72952
|
+
(0, core_1.logEvent)(daemonCtx.logger, events_js_1.ReminderEvents.reminderUnstaged({ sessionId: "" }, { reminderName: vcId, hookName: "Stop", reason: "no_session_id" }));
|
|
72953
|
+
}
|
|
72940
72954
|
return;
|
|
72941
72955
|
}
|
|
72942
72956
|
const remindersState = (0, state_js_1.createRemindersState)(daemonCtx.stateService);
|
|
@@ -72959,19 +72973,7 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
72959
72973
|
const verificationToolsResult = await remindersState.verificationTools.read(sessionId);
|
|
72960
72974
|
const toolsState = verificationToolsResult.data;
|
|
72961
72975
|
const verificationTools = config.verification_tools ?? {};
|
|
72962
|
-
const hasToolsNeedingVerification = Object.entries(verificationTools).some(([toolName, toolConfig]) =>
|
|
72963
|
-
if (!toolConfig.enabled)
|
|
72964
|
-
return false;
|
|
72965
|
-
const state = toolsState[toolName];
|
|
72966
|
-
if (!state)
|
|
72967
|
-
return true;
|
|
72968
|
-
if (state.status === "staged")
|
|
72969
|
-
return true;
|
|
72970
|
-
if (state.status === "verified" || state.status === "cooldown") {
|
|
72971
|
-
return state.editsSinceVerified >= toolConfig.clearing_threshold;
|
|
72972
|
-
}
|
|
72973
|
-
return false;
|
|
72974
|
-
});
|
|
72976
|
+
const hasToolsNeedingVerification = Object.entries(verificationTools).some(([toolName, toolConfig]) => toolNeedsVerification(toolConfig, toolsState[toolName]));
|
|
72975
72977
|
if (!hasToolsNeedingVerification) {
|
|
72976
72978
|
daemonCtx.logger.info("VC unstage: all tools verified, skipping wrapper re-stage", {
|
|
72977
72979
|
sessionId,
|
|
@@ -72979,6 +72981,28 @@ var require_unstage_verify_completion = __commonJS({
|
|
|
72979
72981
|
});
|
|
72980
72982
|
await remindersState.vcUnverified.delete(sessionId);
|
|
72981
72983
|
} else {
|
|
72984
|
+
for (const [toolName, toolConfig] of Object.entries(verificationTools)) {
|
|
72985
|
+
if (!toolNeedsVerification(toolConfig, toolsState[toolName]))
|
|
72986
|
+
continue;
|
|
72987
|
+
const reminderId = types_js_1.TOOL_REMINDER_MAP[toolName];
|
|
72988
|
+
if (!reminderId)
|
|
72989
|
+
continue;
|
|
72990
|
+
const toolReminder = (0, reminder_utils_js_1.resolveReminder)(reminderId, {
|
|
72991
|
+
context: {},
|
|
72992
|
+
assets: daemonCtx.assets
|
|
72993
|
+
});
|
|
72994
|
+
if (toolReminder) {
|
|
72995
|
+
await (0, reminder_utils_js_1.stageReminder)(daemonCtx, "Stop", {
|
|
72996
|
+
...toolReminder,
|
|
72997
|
+
stagedAt: {
|
|
72998
|
+
timestamp: Date.now(),
|
|
72999
|
+
turnCount: unverifiedState.setAt.turnCount,
|
|
73000
|
+
toolsThisTurn: unverifiedState.setAt.toolsThisTurn,
|
|
73001
|
+
toolCount: unverifiedState.setAt.toolCount
|
|
73002
|
+
}
|
|
73003
|
+
});
|
|
73004
|
+
}
|
|
73005
|
+
}
|
|
72982
73006
|
const reminder = (0, reminder_utils_js_1.resolveReminder)(types_js_1.ReminderIds.VERIFY_COMPLETION, {
|
|
72983
73007
|
context: {},
|
|
72984
73008
|
assets: daemonCtx.assets
|