my-pi 0.1.2 → 0.1.3
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/{api-BVS4nqfD.js → api-q7uQTUHx.js} +6 -35
- package/dist/{api-BVS4nqfD.js.map → api-q7uQTUHx.js.map} +1 -1
- package/dist/api.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/extensions/working-indicator-config.test.ts +2 -2
- package/src/extensions/working-indicator-config.ts +3 -14
- package/src/extensions/working-indicator.test.ts +1 -6
- package/src/extensions/working-indicator.ts +4 -51
|
@@ -5114,7 +5114,7 @@ create_telemetry_extension();
|
|
|
5114
5114
|
//#region src/extensions/working-indicator-config.ts
|
|
5115
5115
|
const DEFAULT_CONFIG = {
|
|
5116
5116
|
version: 1,
|
|
5117
|
-
mode: "
|
|
5117
|
+
mode: "default"
|
|
5118
5118
|
};
|
|
5119
5119
|
function get_working_indicator_config_path() {
|
|
5120
5120
|
return join(getAgentDir(), "working-indicator.json");
|
|
@@ -5144,46 +5144,19 @@ function save_working_indicator_config(config) {
|
|
|
5144
5144
|
renameSync(tmp, path);
|
|
5145
5145
|
}
|
|
5146
5146
|
function is_working_indicator_mode(value) {
|
|
5147
|
-
return value === "default" || value === "dot" || value === "none"
|
|
5147
|
+
return value === "default" || value === "dot" || value === "none";
|
|
5148
5148
|
}
|
|
5149
5149
|
//#endregion
|
|
5150
5150
|
//#region src/extensions/working-indicator.ts
|
|
5151
5151
|
const COMMAND_MODES = [
|
|
5152
5152
|
"dot",
|
|
5153
5153
|
"none",
|
|
5154
|
-
"pulse",
|
|
5155
|
-
"spinner",
|
|
5156
5154
|
"reset"
|
|
5157
5155
|
];
|
|
5158
|
-
const SPINNER_FRAMES = [
|
|
5159
|
-
"⠋",
|
|
5160
|
-
"⠙",
|
|
5161
|
-
"⠹",
|
|
5162
|
-
"⠸",
|
|
5163
|
-
"⠼",
|
|
5164
|
-
"⠴",
|
|
5165
|
-
"⠦",
|
|
5166
|
-
"⠧",
|
|
5167
|
-
"⠇",
|
|
5168
|
-
"⠏"
|
|
5169
|
-
];
|
|
5170
5156
|
function get_working_indicator(ctx, mode) {
|
|
5171
5157
|
switch (mode) {
|
|
5172
5158
|
case "dot": return { frames: [ctx.ui.theme.fg("accent", "●")] };
|
|
5173
5159
|
case "none": return { frames: [] };
|
|
5174
|
-
case "pulse": return {
|
|
5175
|
-
frames: [
|
|
5176
|
-
ctx.ui.theme.fg("dim", "·"),
|
|
5177
|
-
ctx.ui.theme.fg("muted", "•"),
|
|
5178
|
-
ctx.ui.theme.fg("accent", "●"),
|
|
5179
|
-
ctx.ui.theme.fg("muted", "•")
|
|
5180
|
-
],
|
|
5181
|
-
intervalMs: 120
|
|
5182
|
-
};
|
|
5183
|
-
case "spinner": return {
|
|
5184
|
-
frames: SPINNER_FRAMES.map((frame, index) => ctx.ui.theme.fg(index % 2 === 0 ? "accent" : "muted", frame)),
|
|
5185
|
-
intervalMs: 80
|
|
5186
|
-
};
|
|
5187
5160
|
case "default": return;
|
|
5188
5161
|
}
|
|
5189
5162
|
}
|
|
@@ -5191,8 +5164,6 @@ function describe_working_indicator_mode(mode) {
|
|
|
5191
5164
|
switch (mode) {
|
|
5192
5165
|
case "dot": return "static dot";
|
|
5193
5166
|
case "none": return "hidden";
|
|
5194
|
-
case "pulse": return "pulse";
|
|
5195
|
-
case "spinner": return "custom spinner";
|
|
5196
5167
|
case "default": return "pi default spinner";
|
|
5197
5168
|
}
|
|
5198
5169
|
}
|
|
@@ -5200,7 +5171,7 @@ function parse_working_indicator_mode(input) {
|
|
|
5200
5171
|
const normalized = input.trim().toLowerCase();
|
|
5201
5172
|
if (!normalized) return null;
|
|
5202
5173
|
if (normalized === "reset" || normalized === "default") return "default";
|
|
5203
|
-
if (normalized === "dot" || normalized === "none"
|
|
5174
|
+
if (normalized === "dot" || normalized === "none") return normalized;
|
|
5204
5175
|
return null;
|
|
5205
5176
|
}
|
|
5206
5177
|
function apply_working_indicator(ctx, mode) {
|
|
@@ -5213,7 +5184,7 @@ async function working_indicator(pi) {
|
|
|
5213
5184
|
apply_working_indicator(ctx, mode);
|
|
5214
5185
|
});
|
|
5215
5186
|
pi.registerCommand("working-indicator", {
|
|
5216
|
-
description: "Set the streaming working indicator: dot,
|
|
5187
|
+
description: "Set the streaming working indicator: dot, none, or reset",
|
|
5217
5188
|
getArgumentCompletions: (prefix) => {
|
|
5218
5189
|
const value = prefix.trim().toLowerCase();
|
|
5219
5190
|
return COMMAND_MODES.filter((entry) => entry.startsWith(value)).map((entry) => ({
|
|
@@ -5228,7 +5199,7 @@ async function working_indicator(pi) {
|
|
|
5228
5199
|
ctx.ui.notify(`Working indicator: ${describe_working_indicator_mode(mode)}`, "info");
|
|
5229
5200
|
return;
|
|
5230
5201
|
}
|
|
5231
|
-
ctx.ui.notify("Usage: /working-indicator [dot|
|
|
5202
|
+
ctx.ui.notify("Usage: /working-indicator [dot|none|reset]", "error");
|
|
5232
5203
|
return;
|
|
5233
5204
|
}
|
|
5234
5205
|
mode = next;
|
|
@@ -5371,4 +5342,4 @@ async function create_my_pi(options = {}) {
|
|
|
5371
5342
|
//#endregion
|
|
5372
5343
|
export { create_my_pi as n, runPrintMode$1 as r, InteractiveMode$1 as t };
|
|
5373
5344
|
|
|
5374
|
-
//# sourceMappingURL=api-
|
|
5345
|
+
//# sourceMappingURL=api-q7uQTUHx.js.map
|