@stemtrooper/learningcode 0.4.7 → 0.4.8
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/extensions/footer.ts +13 -5
- package/package.json +1 -1
package/extensions/footer.ts
CHANGED
|
@@ -105,15 +105,21 @@ export default function sparkFooter(pi: ExtensionAPI) {
|
|
|
105
105
|
tui = footerTui;
|
|
106
106
|
return {
|
|
107
107
|
render(width: number): string[] {
|
|
108
|
+
// Every path ends with the exit hint. Students asked how to quit,
|
|
109
|
+
// and the footer is the one line that is always on screen.
|
|
110
|
+
// (ctrl+c clears the editor; pressed twice, or on an empty editor
|
|
111
|
+
// via ctrl+d, it exits. These are Pi's default bindings.)
|
|
112
|
+
const hints = theme.fg("dim", " ctrl+c exit · esc interrupt");
|
|
113
|
+
|
|
108
114
|
// Nothing to say off Spark, or no token: say so rather than draw a bar
|
|
109
115
|
// full of empties that reads as "you have spent nothing".
|
|
110
116
|
if (!TOKEN) {
|
|
111
|
-
return [theme.fg("dim", " not on Spark — /login, or use --model opencode-go/…")];
|
|
117
|
+
return [theme.fg("dim", " not on Spark — /login, or use --model opencode-go/…"), hints];
|
|
112
118
|
}
|
|
113
|
-
if (!quota) return [theme.fg("dim", " Spark quota unavailable")];
|
|
119
|
+
if (!quota) return [theme.fg("dim", " Spark quota unavailable"), hints];
|
|
114
120
|
|
|
115
121
|
if (quota.aiEnabled === false) {
|
|
116
|
-
return [theme.fg("error", " AI disabled for your account — ask your teacher")];
|
|
122
|
+
return [theme.fg("error", " AI disabled for your account — ask your teacher"), hints];
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
// No ceiling: no meter and no percentage, because a full bar implies a
|
|
@@ -122,6 +128,7 @@ export default function sparkFooter(pi: ExtensionAPI) {
|
|
|
122
128
|
return [
|
|
123
129
|
theme.fg("dim", ` ${Math.round(quota.tokensUsed / 1000)}k used today`) +
|
|
124
130
|
theme.fg("muted", " · unlimited"),
|
|
131
|
+
hints,
|
|
125
132
|
];
|
|
126
133
|
}
|
|
127
134
|
|
|
@@ -131,6 +138,7 @@ export default function sparkFooter(pi: ExtensionAPI) {
|
|
|
131
138
|
return [
|
|
132
139
|
theme.fg("dim", ` ${Math.round(quota.tokensUsed / 1000)}k used today`) +
|
|
133
140
|
theme.fg("muted", " · no daily token cap"),
|
|
141
|
+
hints,
|
|
134
142
|
];
|
|
135
143
|
}
|
|
136
144
|
|
|
@@ -141,13 +149,13 @@ export default function sparkFooter(pi: ExtensionAPI) {
|
|
|
141
149
|
|
|
142
150
|
// Narrow terminals keep the bar and the percentage only; the absolute
|
|
143
151
|
// token counts are the part that can be dropped.
|
|
144
|
-
if (width < 52) return [` ${bar} ${percent}
|
|
152
|
+
if (width < 52) return [` ${bar} ${percent}`, hints];
|
|
145
153
|
|
|
146
154
|
const numbers = theme.fg(
|
|
147
155
|
"dim",
|
|
148
156
|
`${Math.round(tokensUsed / 1000)}k / ${Math.round(limit / 1000)}k today`,
|
|
149
157
|
);
|
|
150
|
-
return [` ${bar} ${percent} ${numbers}
|
|
158
|
+
return [` ${bar} ${percent} ${numbers}`, hints];
|
|
151
159
|
},
|
|
152
160
|
};
|
|
153
161
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stemtrooper/learningcode",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.8",
|
|
4
4
|
"description": "TLC Spark coding agent for students: Pi wired to the Spark OpenAI-compatible endpoint with per-student tokens, quota and seat-queue awareness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|