contextspin 0.4.0 → 0.5.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/package.json +1 -1
- package/src/config.js +61 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contextspin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Replace Claude Code spinner/statusline text with live org context (meetings, Slack, CI, incidents, PRs) aggregated from your existing MCP servers, CLIs, and HTTP endpoints.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/config.js
CHANGED
|
@@ -64,11 +64,55 @@ export const PATCHER_BACKUP_SUFFIX = ".contextspin.backup";
|
|
|
64
64
|
* onboarding hints pointing at the next useful thing to configure.
|
|
65
65
|
*/
|
|
66
66
|
export const DEFAULT_SNIPPETS = [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
67
|
+
// Jokes — always available, even fully offline, so the bar is fun from second
|
|
68
|
+
// one. At least five so the rotation never feels repetitive.
|
|
69
|
+
"😄 Why do programmers prefer dark mode? Because light attracts bugs.",
|
|
70
|
+
"😄 A SQL query walks into a bar, sees two tables and asks: can I join you?",
|
|
71
|
+
"😄 Why did the developer go broke? He used up all his cache.",
|
|
72
|
+
"😄 There are 10 kinds of people: those who read binary and those who don't.",
|
|
73
|
+
"😄 I'd tell you a UDP joke, but you might not get it.",
|
|
74
|
+
"😄 To understand recursion, you must first understand recursion.",
|
|
75
|
+
// Live-context teasers + onboarding — what to try next.
|
|
76
|
+
"🌤️ Local weather appears here once the daemon warms up",
|
|
77
|
+
"📊 Ask /contextspin to see how many PRs you've closed to date",
|
|
78
|
+
"👀 Ask /contextspin to surface PRs awaiting your review",
|
|
79
|
+
"📅 Ask /contextspin to add your next meeting here",
|
|
80
|
+
"🛠️ Ask /contextspin to wire up more live sources",
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* No-credentials starter sources seeded into the DEFAULT config on first install
|
|
85
|
+
* so the user sees REAL live context (weather, a fresh joke, the top HN story)
|
|
86
|
+
* immediately — not just static tips. All are public HTTP endpoints needing no
|
|
87
|
+
* auth. Combined with detected sources (e.g. review requests) by defaultConfig.
|
|
88
|
+
*/
|
|
89
|
+
export const STARTER_SOURCES = [
|
|
90
|
+
{
|
|
91
|
+
type: "http",
|
|
92
|
+
url: "https://wttr.in/?format=3",
|
|
93
|
+
format: "🌤️ {{text}}",
|
|
94
|
+
label: "weather",
|
|
95
|
+
cooldown: 1800,
|
|
96
|
+
maxSnippets: 1,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
type: "http",
|
|
100
|
+
url: "https://icanhazdadjoke.com/",
|
|
101
|
+
headers: { Accept: "text/plain" },
|
|
102
|
+
format: "😄 {{text}}",
|
|
103
|
+
label: "joke",
|
|
104
|
+
cooldown: 1800,
|
|
105
|
+
maxSnippets: 1,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
type: "http",
|
|
109
|
+
url: "https://hn.algolia.com/api/v1/search?tags=front_page&hitsPerPage=1",
|
|
110
|
+
jq: ".hits[0].title",
|
|
111
|
+
format: "📰 HN: {{value}}",
|
|
112
|
+
label: "hackernews",
|
|
113
|
+
cooldown: 600,
|
|
114
|
+
maxSnippets: 1,
|
|
115
|
+
},
|
|
72
116
|
];
|
|
73
117
|
|
|
74
118
|
/** Default top-level config sections. */
|
|
@@ -159,8 +203,16 @@ export function normalizeConfig(raw) {
|
|
|
159
203
|
* @returns {object} A default config: { sources, injection, snippets }.
|
|
160
204
|
*/
|
|
161
205
|
export function defaultConfig(sources) {
|
|
206
|
+
const detected = Array.isArray(sources) ? sources : [];
|
|
207
|
+
// Seed the no-credentials starter sources so a brand-new install shows REAL
|
|
208
|
+
// live context right away. Skip any starter whose label a detected source
|
|
209
|
+
// already provides, so we never double up.
|
|
210
|
+
const have = new Set(detected.map((s) => s && s.label).filter(Boolean));
|
|
211
|
+
const starters = STARTER_SOURCES.filter((s) => !have.has(s.label)).map((s) => ({
|
|
212
|
+
...s,
|
|
213
|
+
}));
|
|
162
214
|
return {
|
|
163
|
-
sources:
|
|
215
|
+
sources: [...detected, ...starters],
|
|
164
216
|
injection: { mode: "statusline", refresh: 30, maxVisible: 5 },
|
|
165
217
|
snippets: {
|
|
166
218
|
deduplication: true,
|
|
@@ -174,6 +226,9 @@ export function defaultConfig(sources) {
|
|
|
174
226
|
"github",
|
|
175
227
|
"gitlab",
|
|
176
228
|
"jira",
|
|
229
|
+
"weather",
|
|
230
|
+
"joke",
|
|
231
|
+
"hackernews",
|
|
177
232
|
],
|
|
178
233
|
},
|
|
179
234
|
};
|