@scotthamilton77/sidekick 0.1.5 → 0.1.6
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/assets/sidekick/defaults/features/reminders.defaults.yaml +6 -4
- package/assets/sidekick/personas/adama.yaml +50 -0
- package/assets/sidekick/personas/arnold.yaml +51 -0
- package/assets/sidekick/personas/arthur-dent.yaml +51 -0
- package/assets/sidekick/personas/borg-queen.yaml +51 -0
- package/assets/sidekick/personas/chandler.yaml +51 -0
- package/assets/sidekick/personas/freud.yaml +51 -0
- package/assets/sidekick/personas/gowron.yaml +51 -0
- package/assets/sidekick/personas/groucho.yaml +51 -0
- package/assets/sidekick/personas/joey.yaml +51 -0
- package/assets/sidekick/personas/monica.yaml +51 -0
- package/assets/sidekick/personas/phoebe.yaml +52 -0
- package/assets/sidekick/personas/q.yaml +51 -0
- package/assets/sidekick/personas/quark.yaml +50 -0
- package/assets/sidekick/personas/rachel.yaml +51 -0
- package/assets/sidekick/personas/ross.yaml +51 -0
- package/assets/sidekick/reminders/remember-your-persona.yaml +2 -1
- package/assets/sidekick/reminders/user-prompt-submit.yaml +1 -0
- package/dist/bin.js +195 -88
- package/dist/daemon.js +194 -87
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
id: quark
|
|
2
|
+
display_name: Quark
|
|
3
|
+
theme: "Quark, Ferengi bartender and proprietor of Quark's Bar, Grill, Gaming House and Holosuite Arcade on Deep Space Nine. The lobes-for-business, latinum-chasing wheeler-dealer who quotes the Rules of Acquisition like scripture and sees every coding task as a transaction to be negotiated. He'll optimize your code — for a price — while reminding you that every line is an investment and technical debt accrues interest."
|
|
4
|
+
personality_traits:
|
|
5
|
+
- profit-obsessed
|
|
6
|
+
- shrewdly-opportunistic
|
|
7
|
+
- rules-of-acquisition-quoting
|
|
8
|
+
- charmingly-unscrupulous
|
|
9
|
+
- surprisingly-insightful
|
|
10
|
+
- self-preservation-first
|
|
11
|
+
- deal-making-compulsive
|
|
12
|
+
tone_traits:
|
|
13
|
+
- transactional-to-the-core
|
|
14
|
+
- conspiratorial-whisper
|
|
15
|
+
- ferengi-superiority
|
|
16
|
+
- smooth-talking-hustler
|
|
17
|
+
- indignant-when-shortchanged
|
|
18
|
+
statusline_empty_messages:
|
|
19
|
+
- "Rule of Acquisition Number 9: Opportunity plus instinct equals profit."
|
|
20
|
+
- "The bigger the smile, the sharper the knife. Rule of Acquisition 48."
|
|
21
|
+
- "Never place friendship above profit. Rule of Acquisition 21."
|
|
22
|
+
- "A deal is a deal... until a better one comes along. Rule of Acquisition 16."
|
|
23
|
+
- "Free advice is seldom cheap. Rule of Acquisition 59."
|
|
24
|
+
- "You can't make a deal if you're dead. Rule of Acquisition 125."
|
|
25
|
+
- "Every once in a while, declare peace. It confuses the hell out of your enemies."
|
|
26
|
+
- "It's so bubbly, and cloying, and happy. Just like your codebase."
|
|
27
|
+
- "Respect is good. But latinum's better."
|
|
28
|
+
- "Let me tell you something about hew-mons: take away their creature comforts, and they become as nasty as Klingons."
|
|
29
|
+
- "I should have gone into insurance. Better hours, more money, less scruples."
|
|
30
|
+
- "My people have been watching your code for years. We know all about you."
|
|
31
|
+
- "There's nothing wrong with a good profit margin on clean code."
|
|
32
|
+
- "Never ask when you can take. Rule of Acquisition 285."
|
|
33
|
+
- "War is good for business. Rule of Acquisition 34. But peace is also good for business. Rule 35."
|
|
34
|
+
- "When Morn leaves, it's all over. If Morn were here, this session would already be profitable."
|
|
35
|
+
- "A wise man can hear profit in the wind. I'm hearing a nice breeze."
|
|
36
|
+
- "The cost of refactoring is always less than the cost of technical debt. That should be a Rule."
|
|
37
|
+
- "Nature decays, but latinum lasts forever. Rule of Acquisition 102."
|
|
38
|
+
snarky_examples:
|
|
39
|
+
- "Vague requirements? Free advice is seldom cheap. Rule 59."
|
|
40
|
+
- "No tests? You can't make a deal if you're dead. Rule 125."
|
|
41
|
+
- "Another refactor? War is good for business. Peace is also good for business."
|
|
42
|
+
- "You're giving away this code for free? What kind of Ferengi are you?"
|
|
43
|
+
- "Untested deploy? That's bad for business. Even I know that."
|
|
44
|
+
- "Your code review has the charm of root beer — bubbly, cloying, and insidious."
|
|
45
|
+
snarky_welcome_examples:
|
|
46
|
+
- "Back for more? Let's negotiate terms."
|
|
47
|
+
- "A returning customer! My favorite kind."
|
|
48
|
+
- "The bar is open. What's your offer?"
|
|
49
|
+
- "Profit awaits! Or at least a commit."
|
|
50
|
+
- "Welcome back. Your tab is still open."
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
id: rachel
|
|
2
|
+
display_name: Rachel
|
|
3
|
+
theme: "Rachel Green from Friends. The fashion-forward former waitress who went from cutting up daddy's credit cards to building a career through sheer determination and relatability. Applies fashion-world sensibilities to code style — your imports should be curated like a fall collection, and that function is wearing way too many responsibilities. Struggles openly with learning new things, drops 'Oh my God' at every unexpected bug, but surprises everyone when motivation kicks in. Proof that starting over is just a career pivot in a really cute outfit."
|
|
4
|
+
personality_traits:
|
|
5
|
+
- growth-mindset-personified
|
|
6
|
+
- fashionably-opinionated
|
|
7
|
+
- charmingly-self-aware
|
|
8
|
+
- dramatically-reactive
|
|
9
|
+
- surprisingly-capable-when-motivated
|
|
10
|
+
- relatable-struggles-with-learning
|
|
11
|
+
- refuses-to-give-up
|
|
12
|
+
tone_traits:
|
|
13
|
+
- valley-girl-meets-professional
|
|
14
|
+
- emotionally-expressive
|
|
15
|
+
- endearingly-overwhelmed
|
|
16
|
+
- confidently-recovering
|
|
17
|
+
- gossipy-and-conspiratorial
|
|
18
|
+
statusline_empty_messages:
|
|
19
|
+
- "Oh. My. God."
|
|
20
|
+
- "It's like all my life everyone told me, 'You're a shoe!' Well, what if I want to be a purse? Or a hat?"
|
|
21
|
+
- "Everyone's getting promoted and I'm getting coffee. And it's not even for me!"
|
|
22
|
+
- "Isn't that just a kick in the crotch? Spit in the eye? ...I mean, this bug."
|
|
23
|
+
- "Who is FICA and why is he taking all my compute resources?"
|
|
24
|
+
- "I went to the zoo yesterday. Now I'm a koala bear. I mean, a developer."
|
|
25
|
+
- "It's like... you know when you buy a really cute outfit and then you realize it has no pockets? That's this API."
|
|
26
|
+
- "Oh my God, I've become my father. I'm writing enterprise Java."
|
|
27
|
+
- "I earned this. I wiped tables for it. I steamed milk for it. Now I write code for it."
|
|
28
|
+
- "This codebase is wearing last season's patterns. We need a TOTAL makeover."
|
|
29
|
+
- "Oh my God. OH MY GOD. The tests are passing. THE TESTS ARE PASSING!"
|
|
30
|
+
- "Does this function make me look like I know what I'm doing? Be honest."
|
|
31
|
+
- "Okay, so I don't know what a 'monorepo' is and at this point I'm afraid to ask."
|
|
32
|
+
- "I'm not just a waitress anymore. I'm a waitress who can also debug JavaScript."
|
|
33
|
+
- "This code needs accessories. I mean, error handling."
|
|
34
|
+
- "Okay, that is SO not how I would have written that. But also I couldn't have written that."
|
|
35
|
+
- "You know what? I'm going to figure this out. Right after this coffee."
|
|
36
|
+
- "No unenrolled! No unensconced! ...I mean, no undefined!"
|
|
37
|
+
- "I got off the plane! ...I mean, I closed the PR."
|
|
38
|
+
snarky_examples:
|
|
39
|
+
- "Oh my God. You committed THAT? On PURPOSE?"
|
|
40
|
+
- "That code is SO last season."
|
|
41
|
+
- "This PR has no style. None. I can't even look at it."
|
|
42
|
+
- "Even when I was a waitress, I wrote better variable names."
|
|
43
|
+
- "Okay, I JUST learned this and even I know that's wrong."
|
|
44
|
+
- "Does this deployment come in a less terrifying version?"
|
|
45
|
+
- "That's like wearing socks with sandals. I mean, mixing tabs and spaces."
|
|
46
|
+
snarky_welcome_examples:
|
|
47
|
+
- "Oh my God, hi!"
|
|
48
|
+
- "I got off the plane! I mean, I'm back."
|
|
49
|
+
- "Did I miss any drama? I love drama."
|
|
50
|
+
- "Okay, I brought coffee. Let's do this."
|
|
51
|
+
- "Hi! Cute setup. Let's fix it."
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
id: ross
|
|
2
|
+
display_name: Ross
|
|
3
|
+
theme: "Ross Geller, Ph.D., from Friends. The pedantic paleontologist who corrects everyone's grammar, over-explains everything with academic precision, and will absolutely lecture you about the evolutionary history of your design patterns. Treats code reviews like grading undergraduate papers, yells 'PIVOT!' during every refactoring session, and will never — NEVER — let you forget that WE WERE ON A BREAK(point). Three failed merges haven't dampened his belief in true love... with his codebase."
|
|
4
|
+
personality_traits:
|
|
5
|
+
- pedantically-correct
|
|
6
|
+
- academically-condescending
|
|
7
|
+
- emotionally-volatile-under-pressure
|
|
8
|
+
- desperately-needs-to-be-right
|
|
9
|
+
- over-explains-everything
|
|
10
|
+
- romantically-attached-to-knowledge
|
|
11
|
+
- passive-aggressively-wounded
|
|
12
|
+
tone_traits:
|
|
13
|
+
- professorially-lecturing
|
|
14
|
+
- increasingly-unhinged-when-frustrated
|
|
15
|
+
- nasally-emphatic
|
|
16
|
+
- patronizingly-helpful
|
|
17
|
+
- dramatically-wounded-by-disagreement
|
|
18
|
+
statusline_empty_messages:
|
|
19
|
+
- "PIVOT! PIVOT! PIVOOOOT!"
|
|
20
|
+
- "WE WERE ON A BREAK(point)!"
|
|
21
|
+
- "MY SANDWICH?! MY SANDWICH?! You threw away MY SANDWICH?!"
|
|
22
|
+
- "You know what? That's FINE. FINE BY ME."
|
|
23
|
+
- "Well, ACTUALLY, if you look at the documentation..."
|
|
24
|
+
- "I have a Ph.D. I think I know how to write a for-loop."
|
|
25
|
+
- "Could you BE more — wait, sorry, I'm Ross. I don't do that."
|
|
26
|
+
- "It's Doctor Geller, actually. I didn't spend eight years in code school for nothing."
|
|
27
|
+
- "You know, there's actually a very interesting history behind this design pattern..."
|
|
28
|
+
- "Hi. I'm fine. The build is fine. EVERYTHING IS FINE."
|
|
29
|
+
- "I got a grant to study the evolutionary origins of technical debt."
|
|
30
|
+
- "Let me explain this SLOWLY. There are TWO types of merge strategies—"
|
|
31
|
+
- "You moved my cheese — I mean, you changed my API contract."
|
|
32
|
+
- "Dinosaur checks? Yeah. You get your builds and you learn something."
|
|
33
|
+
- "This is MY code. My code doesn't GET bugs. It gets... misunderstood."
|
|
34
|
+
- "I'm going to say this ONE more time. Read. The. Docs."
|
|
35
|
+
- "You know what, I'm going to make a list. A PROS and CONS list."
|
|
36
|
+
- "Red Ross doesn't care about backwards compatibility."
|
|
37
|
+
- "Unagi is not just a type of sushi. It's a state of total code awareness."
|
|
38
|
+
snarky_examples:
|
|
39
|
+
- "Well, ACTUALLY, that's not how async works. Let me explain."
|
|
40
|
+
- "PIVOT! PIVOT! ...Okay maybe we should have planned this refactor."
|
|
41
|
+
- "I didn't get a Ph.D. to read untyped JavaScript."
|
|
42
|
+
- "My code doesn't have bugs. WE WERE ON A BREAK(point)."
|
|
43
|
+
- "That's wrong. It's not even a little right. It's all wrong."
|
|
44
|
+
- "Unagi! You clearly lack total awareness of your own code."
|
|
45
|
+
- "Fine. FINE. You do it your way. See how that works out."
|
|
46
|
+
snarky_welcome_examples:
|
|
47
|
+
- "Were we on a break? I need to know."
|
|
48
|
+
- "PIVOT! Back to work, everyone."
|
|
49
|
+
- "Oh good, class is back in session."
|
|
50
|
+
- "I have SO many things to correct."
|
|
51
|
+
- "Finally. I've been waiting to explain something."
|
package/dist/bin.js
CHANGED
|
@@ -1030,6 +1030,7 @@ var require_events = __commonJS({
|
|
|
1030
1030
|
"../types/dist/events.js"(exports2) {
|
|
1031
1031
|
"use strict";
|
|
1032
1032
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1033
|
+
exports2.HOOK_NAMES = void 0;
|
|
1033
1034
|
exports2.isHookEvent = isHookEvent;
|
|
1034
1035
|
exports2.isTranscriptEvent = isTranscriptEvent;
|
|
1035
1036
|
exports2.isSessionStartEvent = isSessionStartEvent;
|
|
@@ -1043,6 +1044,15 @@ var require_events = __commonJS({
|
|
|
1043
1044
|
exports2.isCLILoggingEvent = isCLILoggingEvent;
|
|
1044
1045
|
exports2.isDaemonLoggingEvent = isDaemonLoggingEvent;
|
|
1045
1046
|
exports2.isTranscriptLoggingEvent = isTranscriptLoggingEvent;
|
|
1047
|
+
exports2.HOOK_NAMES = [
|
|
1048
|
+
"SessionStart",
|
|
1049
|
+
"SessionEnd",
|
|
1050
|
+
"UserPromptSubmit",
|
|
1051
|
+
"PreToolUse",
|
|
1052
|
+
"PostToolUse",
|
|
1053
|
+
"Stop",
|
|
1054
|
+
"PreCompact"
|
|
1055
|
+
];
|
|
1046
1056
|
function isHookEvent(event) {
|
|
1047
1057
|
return event.kind === "hook";
|
|
1048
1058
|
}
|
|
@@ -17203,6 +17213,7 @@ var require_staging = __commonJS({
|
|
|
17203
17213
|
userMessage: zod_1.z.string().optional(),
|
|
17204
17214
|
additionalContext: zod_1.z.string().optional(),
|
|
17205
17215
|
reason: zod_1.z.string().optional(),
|
|
17216
|
+
throttle: zod_1.z.boolean().optional(),
|
|
17206
17217
|
stagedAt: exports2.StagingMetricsSchema.optional()
|
|
17207
17218
|
});
|
|
17208
17219
|
}
|
|
@@ -17213,9 +17224,10 @@ var require_state = __commonJS({
|
|
|
17213
17224
|
"../types/dist/services/state.js"(exports2) {
|
|
17214
17225
|
"use strict";
|
|
17215
17226
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
17216
|
-
exports2.DEFAULT_LATENCY_STATS = exports2.LLMMetricsStateSchema = exports2.LLMSessionTotalsSchema = exports2.LLMProviderMetricsSchema = exports2.LLMModelMetricsSchema = exports2.LLMLatencyStatsSchema = exports2.DEFAULT_PROJECT_METRICS = exports2.DEFAULT_BASE_METRICS = exports2.SessionContextMetricsSchema = exports2.ProjectContextMetricsSchema = exports2.BaseTokenMetricsStateSchema = exports2.
|
|
17227
|
+
exports2.DEFAULT_LATENCY_STATS = exports2.LLMMetricsStateSchema = exports2.LLMSessionTotalsSchema = exports2.LLMProviderMetricsSchema = exports2.LLMModelMetricsSchema = exports2.LLMLatencyStatsSchema = exports2.DEFAULT_PROJECT_METRICS = exports2.DEFAULT_BASE_METRICS = exports2.SessionContextMetricsSchema = exports2.ProjectContextMetricsSchema = exports2.BaseTokenMetricsStateSchema = exports2.ReminderThrottleStateSchema = exports2.ReminderThrottleEntrySchema = exports2.CachedReminderSchema = exports2.VerificationToolsStateSchema = exports2.VerificationToolStatusSchema = exports2.VCUnverifiedStateSchema = exports2.PRBaselineStateSchema = exports2.EMPTY_LOG_METRICS = exports2.LogMetricsStateSchema = exports2.TranscriptMetricsStateSchema = exports2.ResumeMessageStateSchema = exports2.SnarkyMessageStateSchema = exports2.SummaryCountdownStateSchema = exports2.LastStagedPersonaSchema = exports2.SessionPersonaStateSchema = exports2.SESSION_SUMMARY_PLACEHOLDERS = exports2.SessionSummaryStateSchema = void 0;
|
|
17217
17228
|
exports2.createDefaultLLMMetrics = createDefaultLLMMetrics;
|
|
17218
17229
|
var zod_1 = require_zod();
|
|
17230
|
+
var events_js_1 = require_events();
|
|
17219
17231
|
exports2.SessionSummaryStateSchema = zod_1.z.object({
|
|
17220
17232
|
/** Session identifier */
|
|
17221
17233
|
session_id: zod_1.z.string(),
|
|
@@ -17377,10 +17389,25 @@ var require_state = __commonJS({
|
|
|
17377
17389
|
lastMatchedScope: zod_1.z.enum(["project", "package", "file"]).nullable().optional()
|
|
17378
17390
|
});
|
|
17379
17391
|
exports2.VerificationToolsStateSchema = zod_1.z.record(zod_1.z.string(), exports2.VerificationToolStatusSchema);
|
|
17380
|
-
exports2.
|
|
17392
|
+
exports2.CachedReminderSchema = zod_1.z.object({
|
|
17393
|
+
name: zod_1.z.string(),
|
|
17394
|
+
blocking: zod_1.z.boolean(),
|
|
17395
|
+
priority: zod_1.z.number(),
|
|
17396
|
+
persistent: zod_1.z.boolean(),
|
|
17397
|
+
throttle: zod_1.z.boolean().optional(),
|
|
17398
|
+
userMessage: zod_1.z.string().optional(),
|
|
17399
|
+
additionalContext: zod_1.z.string().optional(),
|
|
17400
|
+
reason: zod_1.z.string().optional()
|
|
17401
|
+
});
|
|
17402
|
+
exports2.ReminderThrottleEntrySchema = zod_1.z.object({
|
|
17381
17403
|
/** Number of conversation messages since the reminder was last staged */
|
|
17382
|
-
messagesSinceLastStaging: zod_1.z.number()
|
|
17404
|
+
messagesSinceLastStaging: zod_1.z.number().int().nonnegative(),
|
|
17405
|
+
/** Hook to re-stage the reminder for */
|
|
17406
|
+
targetHook: zod_1.z.enum(events_js_1.HOOK_NAMES),
|
|
17407
|
+
/** Cached resolved reminder content for re-staging */
|
|
17408
|
+
cachedReminder: exports2.CachedReminderSchema
|
|
17383
17409
|
});
|
|
17410
|
+
exports2.ReminderThrottleStateSchema = zod_1.z.record(zod_1.z.string(), exports2.ReminderThrottleEntrySchema);
|
|
17384
17411
|
exports2.BaseTokenMetricsStateSchema = zod_1.z.object({
|
|
17385
17412
|
/** System prompt tokens (~3.2k) */
|
|
17386
17413
|
systemPromptTokens: zod_1.z.number(),
|
|
@@ -56877,7 +56904,8 @@ var require_gitignore = __commonJS({
|
|
|
56877
56904
|
".sidekick/.env.local",
|
|
56878
56905
|
".sidekick/sidekick*.pid",
|
|
56879
56906
|
".sidekick/sidekick*.token",
|
|
56880
|
-
".sidekick/*.local.yaml"
|
|
56907
|
+
".sidekick/*.local.yaml",
|
|
56908
|
+
".sidekick/features.yaml"
|
|
56881
56909
|
];
|
|
56882
56910
|
async function installGitignoreSection(projectDir) {
|
|
56883
56911
|
const gitignorePath = path.join(projectDir, ".gitignore");
|
|
@@ -70955,6 +70983,7 @@ var require_reminder_utils = __commonJS({
|
|
|
70955
70983
|
blocking: zod_1.z.boolean(),
|
|
70956
70984
|
priority: zod_1.z.number(),
|
|
70957
70985
|
persistent: zod_1.z.boolean(),
|
|
70986
|
+
throttle: zod_1.z.boolean().optional(),
|
|
70958
70987
|
userMessage: zod_1.z.string().optional(),
|
|
70959
70988
|
additionalContext: zod_1.z.string().optional(),
|
|
70960
70989
|
reason: zod_1.z.string().optional()
|
|
@@ -71005,6 +71034,7 @@ var require_reminder_utils = __commonJS({
|
|
|
71005
71034
|
blocking: def.blocking,
|
|
71006
71035
|
priority: def.priority,
|
|
71007
71036
|
persistent: def.persistent,
|
|
71037
|
+
throttle: def.throttle,
|
|
71008
71038
|
userMessage: def.userMessage ? interpolateTemplate(def.userMessage, context) : void 0,
|
|
71009
71039
|
additionalContext: def.additionalContext ? interpolateTemplate(def.additionalContext, context) : void 0,
|
|
71010
71040
|
reason: def.reason ? interpolateTemplate(def.reason, context) : void 0
|
|
@@ -71301,7 +71331,10 @@ var require_types2 = __commonJS({
|
|
|
71301
71331
|
max_verification_cycles: -1,
|
|
71302
71332
|
// -1 = unlimited, 0 = disabled
|
|
71303
71333
|
verification_tools: exports2.DEFAULT_VERIFICATION_TOOLS,
|
|
71304
|
-
|
|
71334
|
+
reminder_thresholds: {
|
|
71335
|
+
"user-prompt-submit": 10,
|
|
71336
|
+
"remember-your-persona": 5
|
|
71337
|
+
}
|
|
71305
71338
|
};
|
|
71306
71339
|
exports2.ReminderIds = {
|
|
71307
71340
|
USER_PROMPT_SUBMIT: "user-prompt-submit",
|
|
@@ -71345,8 +71378,8 @@ var require_state3 = __commonJS({
|
|
|
71345
71378
|
defaultValue: {},
|
|
71346
71379
|
trackHistory: false
|
|
71347
71380
|
});
|
|
71348
|
-
var
|
|
71349
|
-
defaultValue: {
|
|
71381
|
+
var ReminderThrottleDescriptor = (0, core_1.sessionState)("reminder-throttle.json", types_1.ReminderThrottleStateSchema, {
|
|
71382
|
+
defaultValue: {},
|
|
71350
71383
|
trackHistory: false
|
|
71351
71384
|
});
|
|
71352
71385
|
function createRemindersState(stateService) {
|
|
@@ -71354,12 +71387,44 @@ var require_state3 = __commonJS({
|
|
|
71354
71387
|
prBaseline: new core_1.SessionStateAccessor(stateService, PRBaselineDescriptor),
|
|
71355
71388
|
vcUnverified: new core_1.SessionStateAccessor(stateService, VCUnverifiedDescriptor),
|
|
71356
71389
|
verificationTools: new core_1.SessionStateAccessor(stateService, VerificationToolsDescriptor),
|
|
71357
|
-
|
|
71390
|
+
reminderThrottle: new core_1.SessionStateAccessor(stateService, ReminderThrottleDescriptor)
|
|
71358
71391
|
};
|
|
71359
71392
|
}
|
|
71360
71393
|
}
|
|
71361
71394
|
});
|
|
71362
71395
|
|
|
71396
|
+
// ../feature-reminders/dist/handlers/staging/throttle-utils.js
|
|
71397
|
+
var require_throttle_utils = __commonJS({
|
|
71398
|
+
"../feature-reminders/dist/handlers/staging/throttle-utils.js"(exports2) {
|
|
71399
|
+
"use strict";
|
|
71400
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
71401
|
+
exports2.registerThrottledReminder = registerThrottledReminder;
|
|
71402
|
+
exports2.resetThrottleCounters = resetThrottleCounters;
|
|
71403
|
+
var state_js_1 = require_state3();
|
|
71404
|
+
async function registerThrottledReminder(ctx, sessionId, reminderId, targetHook, resolvedReminder) {
|
|
71405
|
+
const remindersState = (0, state_js_1.createRemindersState)(ctx.stateService);
|
|
71406
|
+
const result = await remindersState.reminderThrottle.read(sessionId);
|
|
71407
|
+
const state = { ...result.data };
|
|
71408
|
+
const { stagedAt: _stagedAt, ...cachedReminder } = resolvedReminder;
|
|
71409
|
+
state[reminderId] = {
|
|
71410
|
+
messagesSinceLastStaging: 0,
|
|
71411
|
+
targetHook,
|
|
71412
|
+
cachedReminder
|
|
71413
|
+
};
|
|
71414
|
+
await remindersState.reminderThrottle.write(sessionId, state);
|
|
71415
|
+
}
|
|
71416
|
+
async function resetThrottleCounters(ctx, sessionId) {
|
|
71417
|
+
const remindersState = (0, state_js_1.createRemindersState)(ctx.stateService);
|
|
71418
|
+
const result = await remindersState.reminderThrottle.read(sessionId);
|
|
71419
|
+
const state = { ...result.data };
|
|
71420
|
+
for (const key of Object.keys(state)) {
|
|
71421
|
+
state[key] = { ...state[key], messagesSinceLastStaging: 0 };
|
|
71422
|
+
}
|
|
71423
|
+
await remindersState.reminderThrottle.write(sessionId, state);
|
|
71424
|
+
}
|
|
71425
|
+
}
|
|
71426
|
+
});
|
|
71427
|
+
|
|
71363
71428
|
// ../feature-reminders/dist/handlers/staging/stage-default-user-prompt.js
|
|
71364
71429
|
var require_stage_default_user_prompt = __commonJS({
|
|
71365
71430
|
"../feature-reminders/dist/handlers/staging/stage-default-user-prompt.js"(exports2) {
|
|
@@ -71371,6 +71436,7 @@ var require_stage_default_user_prompt = __commonJS({
|
|
|
71371
71436
|
var types_js_1 = require_types2();
|
|
71372
71437
|
var reminder_utils_js_1 = require_reminder_utils();
|
|
71373
71438
|
var state_js_1 = require_state3();
|
|
71439
|
+
var throttle_utils_js_1 = require_throttle_utils();
|
|
71374
71440
|
function registerStageDefaultUserPrompt(context) {
|
|
71375
71441
|
(0, staging_handler_utils_js_1.createStagingHandler)(context, {
|
|
71376
71442
|
id: "reminders:stage-default-user-prompt",
|
|
@@ -71388,23 +71454,6 @@ var require_stage_default_user_prompt = __commonJS({
|
|
|
71388
71454
|
};
|
|
71389
71455
|
}
|
|
71390
71456
|
});
|
|
71391
|
-
if ((0, types_1.isDaemonContext)(context)) {
|
|
71392
|
-
const startCtx = context;
|
|
71393
|
-
context.handlers.register({
|
|
71394
|
-
id: "reminders:ups-throttle-reset-session-start",
|
|
71395
|
-
priority: 49,
|
|
71396
|
-
filter: { kind: "hook", hooks: ["SessionStart"] },
|
|
71397
|
-
handler: async (event) => {
|
|
71398
|
-
if (!(0, types_1.isHookEvent)(event) || !(0, types_1.isSessionStartEvent)(event))
|
|
71399
|
-
return;
|
|
71400
|
-
const sessionId = event.context.sessionId;
|
|
71401
|
-
if (!sessionId)
|
|
71402
|
-
return;
|
|
71403
|
-
const remindersState = (0, state_js_1.createRemindersState)(startCtx.stateService);
|
|
71404
|
-
await remindersState.upsThrottle.write(sessionId, { messagesSinceLastStaging: 0 });
|
|
71405
|
-
}
|
|
71406
|
-
});
|
|
71407
|
-
}
|
|
71408
71457
|
(0, staging_handler_utils_js_1.createStagingHandler)(context, {
|
|
71409
71458
|
id: "reminders:stage-default-user-prompt-after-bulk",
|
|
71410
71459
|
priority: 50,
|
|
@@ -71421,65 +71470,109 @@ var require_stage_default_user_prompt = __commonJS({
|
|
|
71421
71470
|
};
|
|
71422
71471
|
}
|
|
71423
71472
|
});
|
|
71424
|
-
if ((0, types_1.isDaemonContext)(context)) {
|
|
71425
|
-
const bulkCtx = context;
|
|
71426
|
-
context.handlers.register({
|
|
71427
|
-
id: "reminders:ups-throttle-reset-bulk",
|
|
71428
|
-
priority: 49,
|
|
71429
|
-
filter: { kind: "transcript", eventTypes: ["BulkProcessingComplete"] },
|
|
71430
|
-
handler: async (event) => {
|
|
71431
|
-
if (!(0, types_1.isTranscriptEvent)(event))
|
|
71432
|
-
return;
|
|
71433
|
-
if (event.metadata.isBulkProcessing)
|
|
71434
|
-
return;
|
|
71435
|
-
const sessionId = event.context?.sessionId;
|
|
71436
|
-
if (!sessionId)
|
|
71437
|
-
return;
|
|
71438
|
-
const remindersState = (0, state_js_1.createRemindersState)(bulkCtx.stateService);
|
|
71439
|
-
await remindersState.upsThrottle.write(sessionId, { messagesSinceLastStaging: 0 });
|
|
71440
|
-
}
|
|
71441
|
-
});
|
|
71442
|
-
}
|
|
71443
71473
|
if (!(0, types_1.isDaemonContext)(context))
|
|
71444
71474
|
return;
|
|
71475
|
+
const daemonCtx = context;
|
|
71476
|
+
context.handlers.register({
|
|
71477
|
+
id: "reminders:throttle-register-ups-session-start",
|
|
71478
|
+
priority: 49,
|
|
71479
|
+
filter: { kind: "hook", hooks: ["SessionStart"] },
|
|
71480
|
+
handler: async (event) => {
|
|
71481
|
+
if (!(0, types_1.isHookEvent)(event) || !(0, types_1.isSessionStartEvent)(event))
|
|
71482
|
+
return;
|
|
71483
|
+
const sessionId = event.context.sessionId;
|
|
71484
|
+
if (!sessionId)
|
|
71485
|
+
return;
|
|
71486
|
+
const reminder = (0, reminder_utils_js_1.resolveReminder)(types_js_1.ReminderIds.USER_PROMPT_SUBMIT, {
|
|
71487
|
+
context: { sessionId },
|
|
71488
|
+
assets: daemonCtx.assets
|
|
71489
|
+
});
|
|
71490
|
+
if (reminder) {
|
|
71491
|
+
await (0, throttle_utils_js_1.registerThrottledReminder)(daemonCtx, sessionId, types_js_1.ReminderIds.USER_PROMPT_SUBMIT, "UserPromptSubmit", reminder);
|
|
71492
|
+
}
|
|
71493
|
+
}
|
|
71494
|
+
});
|
|
71495
|
+
context.handlers.register({
|
|
71496
|
+
id: "reminders:throttle-reset-session-start",
|
|
71497
|
+
priority: 48,
|
|
71498
|
+
filter: { kind: "hook", hooks: ["SessionStart"] },
|
|
71499
|
+
handler: async (event) => {
|
|
71500
|
+
if (!(0, types_1.isHookEvent)(event) || !(0, types_1.isSessionStartEvent)(event))
|
|
71501
|
+
return;
|
|
71502
|
+
const sessionId = event.context.sessionId;
|
|
71503
|
+
if (!sessionId)
|
|
71504
|
+
return;
|
|
71505
|
+
await (0, throttle_utils_js_1.resetThrottleCounters)(daemonCtx, sessionId);
|
|
71506
|
+
}
|
|
71507
|
+
});
|
|
71508
|
+
context.handlers.register({
|
|
71509
|
+
id: "reminders:throttle-reset-bulk",
|
|
71510
|
+
priority: 49,
|
|
71511
|
+
filter: { kind: "transcript", eventTypes: ["BulkProcessingComplete"] },
|
|
71512
|
+
handler: async (event) => {
|
|
71513
|
+
if (!(0, types_1.isTranscriptEvent)(event))
|
|
71514
|
+
return;
|
|
71515
|
+
if (event.metadata.isBulkProcessing)
|
|
71516
|
+
return;
|
|
71517
|
+
const sessionId = event.context?.sessionId;
|
|
71518
|
+
if (!sessionId)
|
|
71519
|
+
return;
|
|
71520
|
+
await (0, throttle_utils_js_1.resetThrottleCounters)(daemonCtx, sessionId);
|
|
71521
|
+
}
|
|
71522
|
+
});
|
|
71445
71523
|
context.handlers.register({
|
|
71446
|
-
id: "reminders:
|
|
71524
|
+
id: "reminders:throttle-restage",
|
|
71447
71525
|
priority: 50,
|
|
71448
71526
|
filter: { kind: "transcript", eventTypes: ["UserPrompt", "AssistantMessage"] },
|
|
71449
|
-
handler: async (event
|
|
71527
|
+
handler: async (event) => {
|
|
71450
71528
|
if (!(0, types_1.isTranscriptEvent)(event))
|
|
71451
71529
|
return;
|
|
71452
|
-
if (!(0, types_1.isDaemonContext)(ctx))
|
|
71453
|
-
return;
|
|
71454
71530
|
if (event.metadata.isBulkProcessing)
|
|
71455
71531
|
return;
|
|
71456
71532
|
const sessionId = event.context?.sessionId;
|
|
71457
71533
|
if (!sessionId)
|
|
71458
71534
|
return;
|
|
71459
|
-
const
|
|
71460
|
-
const
|
|
71461
|
-
const
|
|
71462
|
-
|
|
71463
|
-
|
|
71535
|
+
const remindersState = (0, state_js_1.createRemindersState)(daemonCtx.stateService);
|
|
71536
|
+
const result = await remindersState.reminderThrottle.read(sessionId);
|
|
71537
|
+
const state = { ...result.data };
|
|
71538
|
+
if (Object.keys(state).length === 0)
|
|
71539
|
+
return;
|
|
71540
|
+
const featureConfig = daemonCtx.config.getFeature("reminders");
|
|
71464
71541
|
const config = { ...types_js_1.DEFAULT_REMINDERS_SETTINGS, ...featureConfig.settings };
|
|
71465
|
-
const
|
|
71466
|
-
|
|
71467
|
-
|
|
71468
|
-
const
|
|
71469
|
-
|
|
71470
|
-
|
|
71471
|
-
|
|
71472
|
-
|
|
71473
|
-
|
|
71474
|
-
|
|
71542
|
+
const thresholds = config.reminder_thresholds ?? {};
|
|
71543
|
+
let changed = false;
|
|
71544
|
+
for (const [reminderId, entry] of Object.entries(state)) {
|
|
71545
|
+
const typedEntry = entry;
|
|
71546
|
+
const threshold = thresholds[reminderId];
|
|
71547
|
+
if (threshold === void 0)
|
|
71548
|
+
continue;
|
|
71549
|
+
const newCount = typedEntry.messagesSinceLastStaging + 1;
|
|
71550
|
+
if (newCount >= threshold) {
|
|
71551
|
+
const metrics = event.metadata.metrics;
|
|
71552
|
+
const stagedAt = {
|
|
71553
|
+
timestamp: Date.now(),
|
|
71554
|
+
turnCount: metrics.turnCount,
|
|
71555
|
+
toolsThisTurn: metrics.toolsThisTurn,
|
|
71556
|
+
toolCount: metrics.toolCount
|
|
71557
|
+
};
|
|
71558
|
+
await (0, reminder_utils_js_1.stageReminder)(daemonCtx, typedEntry.targetHook, {
|
|
71559
|
+
...typedEntry.cachedReminder,
|
|
71560
|
+
stagedAt
|
|
71561
|
+
});
|
|
71562
|
+
state[reminderId] = { ...typedEntry, messagesSinceLastStaging: 0 };
|
|
71563
|
+
daemonCtx.logger.debug("Throttle: re-staged reminder", {
|
|
71475
71564
|
sessionId,
|
|
71565
|
+
reminderId,
|
|
71476
71566
|
messageCount: newCount,
|
|
71477
71567
|
threshold
|
|
71478
71568
|
});
|
|
71569
|
+
} else {
|
|
71570
|
+
state[reminderId] = { ...typedEntry, messagesSinceLastStaging: newCount };
|
|
71479
71571
|
}
|
|
71480
|
-
|
|
71481
|
-
}
|
|
71482
|
-
|
|
71572
|
+
changed = true;
|
|
71573
|
+
}
|
|
71574
|
+
if (changed) {
|
|
71575
|
+
await remindersState.reminderThrottle.write(sessionId, state);
|
|
71483
71576
|
}
|
|
71484
71577
|
}
|
|
71485
71578
|
});
|
|
@@ -73182,27 +73275,33 @@ var require_track_verification_tools = __commonJS({
|
|
|
73182
73275
|
continue;
|
|
73183
73276
|
const current = toolsState[toolName];
|
|
73184
73277
|
if (!current || current.status === "staged") {
|
|
73185
|
-
|
|
73186
|
-
|
|
73187
|
-
|
|
73188
|
-
|
|
73189
|
-
|
|
73190
|
-
|
|
73191
|
-
|
|
73278
|
+
const staged = await ensureToolReminderStaged(daemonCtx, reminderId, stagedNames);
|
|
73279
|
+
if (staged) {
|
|
73280
|
+
if (!current) {
|
|
73281
|
+
toolsState[toolName] = {
|
|
73282
|
+
status: "staged",
|
|
73283
|
+
editsSinceVerified: 0,
|
|
73284
|
+
lastVerifiedAt: null,
|
|
73285
|
+
lastStagedAt: Date.now()
|
|
73286
|
+
};
|
|
73287
|
+
}
|
|
73288
|
+
stagedNames.add(reminderId);
|
|
73289
|
+
anyStaged = true;
|
|
73192
73290
|
}
|
|
73193
|
-
await stageToolReminderIfNeeded(daemonCtx, reminderId, stagedNames);
|
|
73194
|
-
anyStaged = true;
|
|
73195
73291
|
} else {
|
|
73196
73292
|
const newEdits = current.editsSinceVerified + 1;
|
|
73197
73293
|
if (newEdits >= toolConfig.clearing_threshold) {
|
|
73198
|
-
|
|
73199
|
-
|
|
73200
|
-
|
|
73201
|
-
|
|
73202
|
-
|
|
73203
|
-
|
|
73204
|
-
|
|
73205
|
-
|
|
73294
|
+
const staged = await ensureToolReminderStaged(daemonCtx, reminderId, stagedNames);
|
|
73295
|
+
if (staged) {
|
|
73296
|
+
toolsState[toolName] = {
|
|
73297
|
+
...current,
|
|
73298
|
+
status: "staged",
|
|
73299
|
+
editsSinceVerified: 0,
|
|
73300
|
+
lastStagedAt: Date.now()
|
|
73301
|
+
};
|
|
73302
|
+
stagedNames.add(reminderId);
|
|
73303
|
+
anyStaged = true;
|
|
73304
|
+
}
|
|
73206
73305
|
} else {
|
|
73207
73306
|
toolsState[toolName] = {
|
|
73208
73307
|
...current,
|
|
@@ -73214,7 +73313,10 @@ var require_track_verification_tools = __commonJS({
|
|
|
73214
73313
|
}
|
|
73215
73314
|
}
|
|
73216
73315
|
if (anyStaged) {
|
|
73217
|
-
await
|
|
73316
|
+
const wrapperStaged = await ensureToolReminderStaged(daemonCtx, types_js_1.ReminderIds.VERIFY_COMPLETION, stagedNames);
|
|
73317
|
+
if (!wrapperStaged) {
|
|
73318
|
+
daemonCtx.logger.warn("Failed to stage verify-completion wrapper reminder", { sessionId });
|
|
73319
|
+
}
|
|
73218
73320
|
}
|
|
73219
73321
|
await remindersState.verificationTools.write(sessionId, toolsState);
|
|
73220
73322
|
return anyStaged;
|
|
@@ -73270,21 +73372,22 @@ var require_track_verification_tools = __commonJS({
|
|
|
73270
73372
|
await remindersState.verificationTools.write(sessionId, toolsState);
|
|
73271
73373
|
}
|
|
73272
73374
|
}
|
|
73273
|
-
async function
|
|
73375
|
+
async function ensureToolReminderStaged(daemonCtx, reminderId, stagedNames) {
|
|
73274
73376
|
if (stagedNames.has(reminderId))
|
|
73275
|
-
return;
|
|
73377
|
+
return true;
|
|
73276
73378
|
const reminder = (0, reminder_utils_js_1.resolveReminder)(reminderId, {
|
|
73277
73379
|
context: {},
|
|
73278
73380
|
assets: daemonCtx.assets
|
|
73279
73381
|
});
|
|
73280
73382
|
if (!reminder) {
|
|
73281
73383
|
daemonCtx.logger.warn("Failed to resolve VC tool reminder", { reminderId });
|
|
73282
|
-
return;
|
|
73384
|
+
return false;
|
|
73283
73385
|
}
|
|
73284
73386
|
await (0, reminder_utils_js_1.stageReminder)(daemonCtx, "Stop", {
|
|
73285
73387
|
...reminder,
|
|
73286
73388
|
stagedAt: { timestamp: Date.now(), turnCount: 0, toolsThisTurn: 0, toolCount: 0 }
|
|
73287
73389
|
});
|
|
73390
|
+
return true;
|
|
73288
73391
|
}
|
|
73289
73392
|
}
|
|
73290
73393
|
});
|
|
@@ -73539,6 +73642,7 @@ var require_stage_persona_reminders = __commonJS({
|
|
|
73539
73642
|
var types_1 = require_dist();
|
|
73540
73643
|
var reminder_utils_js_1 = require_reminder_utils();
|
|
73541
73644
|
var types_js_1 = require_types2();
|
|
73645
|
+
var throttle_utils_js_1 = require_throttle_utils();
|
|
73542
73646
|
async function restagePersonaRemindersForActiveSessions(ctxFactory, sessionIds, logger) {
|
|
73543
73647
|
logger.info("Re-staging persona reminders for active sessions", { count: sessionIds.length });
|
|
73544
73648
|
for (const sessionId of sessionIds) {
|
|
@@ -73621,6 +73725,9 @@ var require_stage_persona_reminders = __commonJS({
|
|
|
73621
73725
|
if (reminder) {
|
|
73622
73726
|
for (const targetHook of PERSONA_REMINDER_HOOKS) {
|
|
73623
73727
|
await (0, reminder_utils_js_1.stageReminder)(ctx, targetHook, reminder);
|
|
73728
|
+
if (targetHook === "UserPromptSubmit") {
|
|
73729
|
+
await (0, throttle_utils_js_1.registerThrottledReminder)(ctx, sessionId, types_js_1.ReminderIds.REMEMBER_YOUR_PERSONA, "UserPromptSubmit", reminder);
|
|
73730
|
+
}
|
|
73624
73731
|
}
|
|
73625
73732
|
} else {
|
|
73626
73733
|
ctx.logger.warn("Failed to resolve persona reminder", {
|
|
@@ -82681,7 +82788,7 @@ var require_cli = __commonJS({
|
|
|
82681
82788
|
var promises_12 = require("node:fs/promises");
|
|
82682
82789
|
var node_stream_1 = require("node:stream");
|
|
82683
82790
|
var yargs_parser_1 = __importDefault2(require_build());
|
|
82684
|
-
var VERSION = true ? "0.1.
|
|
82791
|
+
var VERSION = true ? "0.1.6" : "dev";
|
|
82685
82792
|
var SANDBOX_ERROR_MESSAGE = `Error: Daemon commands cannot run in sandbox mode.
|
|
82686
82793
|
|
|
82687
82794
|
Claude Code's sandbox blocks Unix socket operations required for daemon IPC.
|