portable-agent-layer 0.50.0 → 0.51.1
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/statusline.ps1 +45 -0
- package/assets/statusline.sh +47 -0
- package/package.json +1 -1
- package/src/cli/index.ts +1 -1
package/assets/statusline.ps1
CHANGED
|
@@ -88,6 +88,7 @@ $GREEN = $ESC + "[32m"
|
|
|
88
88
|
$YELLOW = $ESC + "[33m"
|
|
89
89
|
$RED = $ESC + "[31m"
|
|
90
90
|
$DIM = $ESC + "[90m"
|
|
91
|
+
$ITALIC = $ESC + "[3m"
|
|
91
92
|
$RESET = $ESC + "[0m"
|
|
92
93
|
|
|
93
94
|
# Choose bar color based on context usage
|
|
@@ -140,3 +141,47 @@ Write-Host ($BAR_COLOR + $BAR + $RESET + " " + $CTX_STR + $DIM + $RATE_STR + $RE
|
|
|
140
141
|
|
|
141
142
|
# Line 3: Update available (only when cache says available AND versions differ)
|
|
142
143
|
if ($UPDATE_LINE) { Write-Host ($YELLOW + $UPDATE_LINE + $RESET) }
|
|
144
|
+
|
|
145
|
+
# Line 4: Rotating quote (changes every 30 minutes)
|
|
146
|
+
$QUOTES = @(
|
|
147
|
+
"Make it work, make it right, make it fast.|Kent Beck"
|
|
148
|
+
"Simplicity is the soul of efficiency.|Austin Freeman"
|
|
149
|
+
"Talk is cheap. Show me the code.|Linus Torvalds"
|
|
150
|
+
"First, solve the problem. Then, write the code.|John Johnson"
|
|
151
|
+
"Premature optimization is the root of all evil.|Donald Knuth"
|
|
152
|
+
"The art of programming is organizing complexity.|Edsger Dijkstra"
|
|
153
|
+
"The best code is no code at all.|Jeff Atwood"
|
|
154
|
+
"Truth can only be found in one place: the code.|Robert C. Martin"
|
|
155
|
+
"A ship in harbor is safe - but that is not what ships are for.|John A. Shedd"
|
|
156
|
+
"Before software can be reusable, it first has to be usable.|Ralph Johnson"
|
|
157
|
+
"Good software makes the complex appear simple.|Grady Booch"
|
|
158
|
+
"Measure twice, cut once.|traditional"
|
|
159
|
+
"An expert has made all possible mistakes in a narrow field.|Niels Bohr"
|
|
160
|
+
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe.|Abraham Lincoln"
|
|
161
|
+
"Don't believe everything you read on the internet.|Abraham Lincoln"
|
|
162
|
+
"Good judgement is the result of experience and experience the result of bad judgement.|Mark Twain"
|
|
163
|
+
"We are what we repeatedly do. Excellence is not an act, but a habit.|Aristotle"
|
|
164
|
+
"Knowing yourself is the beginning of all wisdom.|Aristotle"
|
|
165
|
+
"Do what you can, with what you have, where you are.|Theodore Roosevelt"
|
|
166
|
+
"The two most powerful warriors are patience and time.|Leo Tolstoy"
|
|
167
|
+
"Comparison is the thief of joy.|Theodore Roosevelt"
|
|
168
|
+
"To improve is to change; to be perfect is to change often.|Winston Churchill"
|
|
169
|
+
"Absorb what is useful, discard what is useless, add what is essentially your own.|Bruce Lee"
|
|
170
|
+
"It is not what happens to you, but how you react that matters.|Epictetus"
|
|
171
|
+
"He who has a why can bear almost any how.|Friedrich Nietzsche"
|
|
172
|
+
"In the middle of difficulty lies opportunity.|Albert Einstein"
|
|
173
|
+
"A person who never made a mistake never tried anything new.|Albert Einstein"
|
|
174
|
+
"The journey of a thousand miles begins with one step.|Lao Tzu"
|
|
175
|
+
"The obstacle is the way.|Marcus Aurelius"
|
|
176
|
+
"Whether you think you can or you think you can't — you are right.|Henry Ford"
|
|
177
|
+
"Everything should be made as simple as possible, but not simpler.|Albert Einstein"
|
|
178
|
+
"You miss 100% of the shots you don't take.|Wayne Gretzky"
|
|
179
|
+
)
|
|
180
|
+
$EPOCH = [DateTimeOffset]::UtcNow.ToUnixTimeSeconds()
|
|
181
|
+
$SLOT = [int]([math]::Floor($EPOCH / 5400))
|
|
182
|
+
$SLOT_OFFSET = $EPOCH % 5400
|
|
183
|
+
if ($SLOT_OFFSET -lt 1800) {
|
|
184
|
+
$QUOTE_IDX = $SLOT % $QUOTES.Count
|
|
185
|
+
$QUOTE_PARTS = $QUOTES[$QUOTE_IDX] -split '\|'
|
|
186
|
+
Write-Host ($DIM + $ITALIC + '"' + $QUOTE_PARTS[0] + '" - ' + $QUOTE_PARTS[1] + $RESET)
|
|
187
|
+
}
|
package/assets/statusline.sh
CHANGED
|
@@ -112,6 +112,7 @@ GREEN='\033[32m'
|
|
|
112
112
|
YELLOW='\033[33m'
|
|
113
113
|
RED='\033[31m'
|
|
114
114
|
DIM='\033[90m'
|
|
115
|
+
ITALIC='\033[3m'
|
|
115
116
|
RESET='\033[0m'
|
|
116
117
|
|
|
117
118
|
# Choose bar color based on context usage
|
|
@@ -176,4 +177,50 @@ fi
|
|
|
176
177
|
|
|
177
178
|
# Line 3: Update available (only when cache says available AND versions differ)
|
|
178
179
|
[ -n "$UPDATE_LINE" ] && echo -e "${YELLOW}${UPDATE_LINE}${RESET}"
|
|
180
|
+
|
|
181
|
+
# Line 4: Rotating quote (changes every 30 minutes)
|
|
182
|
+
QUOTES=(
|
|
183
|
+
"Make it work, make it right, make it fast.|Kent Beck"
|
|
184
|
+
"Simplicity is the soul of efficiency.|Austin Freeman"
|
|
185
|
+
"Talk is cheap. Show me the code.|Linus Torvalds"
|
|
186
|
+
"First, solve the problem. Then, write the code.|John Johnson"
|
|
187
|
+
"Premature optimization is the root of all evil.|Donald Knuth"
|
|
188
|
+
"The art of programming is organizing complexity.|Edsger Dijkstra"
|
|
189
|
+
"The best code is no code at all.|Jeff Atwood"
|
|
190
|
+
"Truth can only be found in one place: the code.|Robert C. Martin"
|
|
191
|
+
"A ship in harbor is safe — but that is not what ships are for.|John A. Shedd"
|
|
192
|
+
"Before software can be reusable, it first has to be usable.|Ralph Johnson"
|
|
193
|
+
"Good software makes the complex appear simple.|Grady Booch"
|
|
194
|
+
"Measure twice, cut once.|traditional"
|
|
195
|
+
"An expert has made all possible mistakes in a narrow field.|Niels Bohr"
|
|
196
|
+
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe.|Abraham Lincoln"
|
|
197
|
+
"Don't believe everything you read on the internet.|Abraham Lincoln"
|
|
198
|
+
"Good judgement is the result of experience and experience the result of bad judgement.|Mark Twain"
|
|
199
|
+
"We are what we repeatedly do. Excellence is not an act, but a habit.|Aristotle"
|
|
200
|
+
"Knowing yourself is the beginning of all wisdom.|Aristotle"
|
|
201
|
+
"Do what you can, with what you have, where you are.|Theodore Roosevelt"
|
|
202
|
+
"The two most powerful warriors are patience and time.|Leo Tolstoy"
|
|
203
|
+
"Comparison is the thief of joy.|Theodore Roosevelt"
|
|
204
|
+
"To improve is to change; to be perfect is to change often.|Winston Churchill"
|
|
205
|
+
"Absorb what is useful, discard what is useless, add what is essentially your own.|Bruce Lee"
|
|
206
|
+
"It is not what happens to you, but how you react that matters.|Epictetus"
|
|
207
|
+
"He who has a why can bear almost any how.|Friedrich Nietzsche"
|
|
208
|
+
"In the middle of difficulty lies opportunity.|Albert Einstein"
|
|
209
|
+
"A person who never made a mistake never tried anything new.|Albert Einstein"
|
|
210
|
+
"The journey of a thousand miles begins with one step.|Lao Tzu"
|
|
211
|
+
"The obstacle is the way.|Marcus Aurelius"
|
|
212
|
+
"Whether you think you can or you think you can't — you are right.|Henry Ford"
|
|
213
|
+
"Everything should be made as simple as possible, but not simpler.|Albert Einstein"
|
|
214
|
+
"You miss 100% of the shots you don't take.|Wayne Gretzky"
|
|
215
|
+
)
|
|
216
|
+
SLOT=$(( $(date +%s) / 5400 ))
|
|
217
|
+
SLOT_OFFSET=$(( $(date +%s) % 5400 ))
|
|
218
|
+
if [ $SLOT_OFFSET -lt 1800 ]; then
|
|
219
|
+
QUOTE_IDX=$(( SLOT % ${#QUOTES[@]} ))
|
|
220
|
+
QUOTE_ENTRY="${QUOTES[$QUOTE_IDX]}"
|
|
221
|
+
QUOTE_TEXT="${QUOTE_ENTRY%|*}"
|
|
222
|
+
QUOTE_AUTHOR="${QUOTE_ENTRY##*|}"
|
|
223
|
+
echo -e "${DIM}${ITALIC}\"${QUOTE_TEXT}\" — ${QUOTE_AUTHOR}${RESET}"
|
|
224
|
+
fi
|
|
225
|
+
|
|
179
226
|
exit 0
|
package/package.json
CHANGED
package/src/cli/index.ts
CHANGED
|
@@ -439,7 +439,7 @@ function checkAgentHookPrefix(filePath: string, agentName: string): HookPrefixCh
|
|
|
439
439
|
if (!existsSync(filePath)) return { ok: false, total: 0, missing: 0 };
|
|
440
440
|
try {
|
|
441
441
|
const data = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
442
|
-
const commands = extractAllHookCommands(data);
|
|
442
|
+
const commands = extractAllHookCommands(data.hooks ?? data);
|
|
443
443
|
const prefix = `PAL_AGENT=${agentName} `;
|
|
444
444
|
const missing = commands.filter((c) => !c.startsWith(prefix));
|
|
445
445
|
return {
|