umbrella-context 0.1.2 → 0.1.32

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.
Files changed (68) hide show
  1. package/bin/um.js +2 -0
  2. package/dist/adapters/byterover-context-runtime-store.d.ts +15 -0
  3. package/dist/adapters/byterover-context-runtime-store.js +57 -0
  4. package/dist/adapters/byterover-runtime-bridge.d.ts +218 -0
  5. package/dist/adapters/byterover-runtime-bridge.js +343 -0
  6. package/dist/adapters/byterover-transport-task-store.d.ts +13 -0
  7. package/dist/adapters/byterover-transport-task-store.js +50 -0
  8. package/dist/adapters/umbrella-onboarding.d.ts +27 -0
  9. package/dist/adapters/umbrella-onboarding.js +79 -0
  10. package/dist/adapters/umbrella-provider-runtime.d.ts +38 -0
  11. package/dist/adapters/umbrella-provider-runtime.js +199 -0
  12. package/dist/adapters/vendor-byterover.d.ts +4 -0
  13. package/dist/adapters/vendor-byterover.js +19 -0
  14. package/dist/commands/activity.d.ts +2 -0
  15. package/dist/commands/activity.js +82 -0
  16. package/dist/commands/bridge.d.ts +2 -0
  17. package/dist/commands/bridge.js +40 -0
  18. package/dist/commands/catalog.d.ts +34 -0
  19. package/dist/commands/catalog.js +234 -0
  20. package/dist/commands/connect.js +14 -14
  21. package/dist/commands/connectors.d.ts +24 -0
  22. package/dist/commands/connectors.js +626 -0
  23. package/dist/commands/curate.d.ts +1 -0
  24. package/dist/commands/curate.js +48 -3
  25. package/dist/commands/debug.d.ts +2 -0
  26. package/dist/commands/debug.js +55 -0
  27. package/dist/commands/fix.js +54 -0
  28. package/dist/commands/hub.d.ts +22 -0
  29. package/dist/commands/hub.js +487 -0
  30. package/dist/commands/interactive.d.ts +2 -0
  31. package/dist/commands/interactive.js +970 -62
  32. package/dist/commands/locations.d.ts +1 -0
  33. package/dist/commands/locations.js +15 -12
  34. package/dist/commands/logout.d.ts +2 -0
  35. package/dist/commands/logout.js +34 -0
  36. package/dist/commands/model.d.ts +11 -0
  37. package/dist/commands/model.js +225 -0
  38. package/dist/commands/providers.d.ts +17 -0
  39. package/dist/commands/providers.js +379 -0
  40. package/dist/commands/pull.js +60 -1
  41. package/dist/commands/push.js +62 -2
  42. package/dist/commands/reset.d.ts +2 -0
  43. package/dist/commands/reset.js +35 -0
  44. package/dist/commands/restart.d.ts +2 -0
  45. package/dist/commands/restart.js +21 -0
  46. package/dist/commands/search.js +65 -1
  47. package/dist/commands/session.d.ts +2 -0
  48. package/dist/commands/session.js +241 -0
  49. package/dist/commands/setup.js +58 -56
  50. package/dist/commands/space.d.ts +12 -0
  51. package/dist/commands/space.js +138 -42
  52. package/dist/commands/status.d.ts +29 -0
  53. package/dist/commands/status.js +120 -19
  54. package/dist/commands/tasks.d.ts +2 -0
  55. package/dist/commands/tasks.js +95 -0
  56. package/dist/commands/transport.d.ts +2 -0
  57. package/dist/commands/transport.js +88 -0
  58. package/dist/commands/tree.d.ts +2 -0
  59. package/dist/commands/tree.js +98 -0
  60. package/dist/commands/tui.d.ts +2 -0
  61. package/dist/commands/tui.js +1273 -0
  62. package/dist/config.d.ts +23 -0
  63. package/dist/config.js +69 -0
  64. package/dist/index.js +41 -5
  65. package/dist/repo-state.d.ts +227 -1
  66. package/dist/repo-state.js +920 -4
  67. package/dist/umbrella.js +29 -5
  68. package/package.json +11 -3
@@ -0,0 +1,487 @@
1
+ import { randomUUID } from "crypto";
2
+ import chalk from "chalk";
3
+ import prompts from "prompts";
4
+ import { configManager } from "../config.js";
5
+ import { getInstalledHubEntries, getSessionState, recordSessionEvent, recordSessionHubEntry, setInstalledHubEntries, setSessionPanel, writeHubAsset, writeHubAssetFiles } from "../repo-state.js";
6
+ import { connectorsCommandAction } from "./connectors.js";
7
+ async function runHubBrowseFlow() {
8
+ const answer = await prompts({
9
+ type: "select",
10
+ name: "value",
11
+ message: "Choose a hub entry to browse",
12
+ choices: DEFAULT_HUB_ENTRIES.map((entry) => ({
13
+ title: `${entry.name} (${entry.type})`,
14
+ description: entry.description,
15
+ value: entry.slug,
16
+ })),
17
+ });
18
+ if (!answer.value) {
19
+ console.log(chalk.yellow("\n No hub entry selected."));
20
+ return;
21
+ }
22
+ const inspectResult = await hubCommandAction("inspect", answer.value);
23
+ if (!inspectResult?.installedEntry)
24
+ return;
25
+ const next = await prompts({
26
+ type: "select",
27
+ name: "value",
28
+ message: `What do you want to do with ${inspectResult.installedEntry.name}?`,
29
+ choices: [
30
+ { title: "Install it into this repo", value: "install" },
31
+ ...(inspectResult.recommendedConnector
32
+ ? [{ title: `Install and run ${inspectResult.recommendedConnector}`, value: "connector" }]
33
+ : []),
34
+ { title: "Back", value: "back" },
35
+ ],
36
+ });
37
+ if (!next.value || next.value === "back") {
38
+ return {
39
+ action: "browse",
40
+ changed: false,
41
+ installedEntry: inspectResult.installedEntry,
42
+ recommendedConnector: inspectResult.recommendedConnector,
43
+ };
44
+ }
45
+ const installResult = await hubCommandAction("install", inspectResult.installedEntry.slug);
46
+ if (next.value === "connector" && inspectResult.recommendedConnector) {
47
+ await connectorsCommandAction("run", inspectResult.recommendedConnector);
48
+ }
49
+ return {
50
+ action: "browse",
51
+ changed: Boolean(installResult?.changed),
52
+ installedEntry: installResult?.installedEntry ?? inspectResult.installedEntry,
53
+ assetPath: installResult?.assetPath,
54
+ filePaths: installResult?.filePaths,
55
+ recommendedConnector: inspectResult.recommendedConnector,
56
+ };
57
+ }
58
+ const DEFAULT_HUB_ENTRIES = [
59
+ {
60
+ slug: "quick-ping-growth-bundle",
61
+ name: "Quick Ping Growth Bundle",
62
+ type: "bundle",
63
+ description: "Context prompts, SEO helpers, and research habits for the Quick Ping growth team.",
64
+ includes: ["Growth query pack", "Capture template", "Quick Ping growth playbook"],
65
+ nextSteps: [
66
+ "umbrella-context query \"What messaging already worked for Quick Ping?\"",
67
+ "umbrella-context curate \"...\"",
68
+ "umbrella-context push",
69
+ ],
70
+ },
71
+ {
72
+ slug: "engineering-debug-skill-pack",
73
+ name: "Engineering Debug Skill Pack",
74
+ type: "skill",
75
+ description: "A reusable troubleshooting pack for recurring engineering bugs and known-fix workflows.",
76
+ includes: ["Debug checklist", "Root cause template"],
77
+ nextSteps: [
78
+ "umbrella-context fix \"<error signal>\"",
79
+ "umbrella-context record <id> success",
80
+ ],
81
+ },
82
+ {
83
+ slug: "umbrella-context-mcp-connector",
84
+ name: "Umbrella Context MCP Connector",
85
+ type: "connector",
86
+ description: "A ready-made MCP connector bundle for IDE agents that should talk to Context.",
87
+ includes: ["Connector install notes", "Repo MCP bridge wiring"],
88
+ nextSteps: [
89
+ "umbrella-context connectors install codex-mcp",
90
+ "umbrella-context connectors run codex-mcp",
91
+ "umbrella-context status",
92
+ ],
93
+ installsConnector: "codex-mcp",
94
+ },
95
+ ];
96
+ export function listHubRegistryEntries() {
97
+ return [...DEFAULT_HUB_ENTRIES];
98
+ }
99
+ function buildHubAsset(entry) {
100
+ return [
101
+ `# ${entry.name}`,
102
+ "",
103
+ `Type: ${entry.type}`,
104
+ `Slug: ${entry.slug}`,
105
+ "",
106
+ "## Why this exists",
107
+ "",
108
+ entry.description,
109
+ "",
110
+ "## Suggested use",
111
+ "",
112
+ "- Review this file before running related Context workflows.",
113
+ "- Copy the reusable parts into prompts, rules, or team playbooks as needed.",
114
+ "- Keep the repo-specific details nearby so future operators reuse the same pattern.",
115
+ "",
116
+ "## Next commands",
117
+ "",
118
+ ...entry.nextSteps.map((step) => `- \`${step}\``),
119
+ "",
120
+ ].join("\n");
121
+ }
122
+ function buildHubFiles(entry) {
123
+ if (entry.slug === "quick-ping-growth-bundle") {
124
+ return [
125
+ {
126
+ name: "overview.md",
127
+ content: [
128
+ "# Quick Ping Growth Bundle",
129
+ "",
130
+ "Use this bundle when you are working on Quick Ping growth work inside this repo.",
131
+ "",
132
+ "## What is inside",
133
+ "",
134
+ "- Growth context reminders",
135
+ "- Reusable query prompts",
136
+ "- Capture patterns for turning work into shared context",
137
+ "",
138
+ "## Recommended flow",
139
+ "",
140
+ "1. Run `umbrella-context query \"What do we already know about this audience?\"`",
141
+ "2. Do the work.",
142
+ "3. Run `umbrella-context curate \"...\"` with the result.",
143
+ "4. Run `umbrella-context push` when it is worth sharing.",
144
+ "",
145
+ ].join("\n"),
146
+ },
147
+ {
148
+ name: "queries.md",
149
+ content: [
150
+ "# Growth Queries",
151
+ "",
152
+ "- `umbrella-context query \"What messaging already worked for Quick Ping?\"`",
153
+ "- `umbrella-context query \"What objections have job seekers shown before?\"`",
154
+ "- `umbrella-context query \"Which channels have we already tested?\"`",
155
+ "",
156
+ ].join("\n"),
157
+ },
158
+ {
159
+ name: "capture-template.md",
160
+ content: [
161
+ "# Capture Template",
162
+ "",
163
+ "Use this shape when you turn work into shared context:",
164
+ "",
165
+ "```text",
166
+ "We learned that ...",
167
+ "Why it mattered: ...",
168
+ "Where we saw it: ...",
169
+ "What to do next time: ...",
170
+ "```",
171
+ "",
172
+ ].join("\n"),
173
+ },
174
+ ];
175
+ }
176
+ if (entry.slug === "engineering-debug-skill-pack") {
177
+ return [
178
+ {
179
+ name: "debug-checklist.md",
180
+ content: [
181
+ "# Engineering Debug Checklist",
182
+ "",
183
+ "1. Reproduce the problem.",
184
+ "2. Search Context for prior fixes.",
185
+ "3. Capture the exact error signal.",
186
+ "4. Write down the root cause once confirmed.",
187
+ "5. Record the fix outcome with `umbrella-context record`.",
188
+ "",
189
+ ].join("\n"),
190
+ },
191
+ {
192
+ name: "root-cause-template.md",
193
+ content: [
194
+ "# Root Cause Template",
195
+ "",
196
+ "```text",
197
+ "Bug: ...",
198
+ "Signal: ...",
199
+ "Root cause: ...",
200
+ "Fix: ...",
201
+ "How to prevent it next time: ...",
202
+ "```",
203
+ "",
204
+ ].join("\n"),
205
+ },
206
+ ];
207
+ }
208
+ if (entry.slug === "umbrella-context-mcp-connector") {
209
+ return [
210
+ {
211
+ name: "install-next.md",
212
+ content: [
213
+ "# Umbrella Context MCP Connector",
214
+ "",
215
+ "This bundle pairs with the `codex-mcp` connector.",
216
+ "",
217
+ "## Next step",
218
+ "",
219
+ "Run:",
220
+ "",
221
+ "```bash",
222
+ "umbrella-context connectors install codex-mcp",
223
+ "```",
224
+ "",
225
+ "Then verify with:",
226
+ "",
227
+ "```bash",
228
+ "umbrella-context connectors run codex-mcp",
229
+ "```",
230
+ "",
231
+ ].join("\n"),
232
+ },
233
+ ];
234
+ }
235
+ return [];
236
+ }
237
+ function printInstalled(installed) {
238
+ console.log(chalk.bold("\n Installed Hub Entries\n"));
239
+ if (installed.length === 0) {
240
+ console.log(chalk.yellow(" No hub entries installed in this repo yet."));
241
+ return;
242
+ }
243
+ installed.forEach((entry, index) => {
244
+ console.log(` ${index + 1}. ${entry.name} [${entry.type}]`);
245
+ console.log(chalk.gray(` ${entry.description}`));
246
+ console.log(chalk.gray(` Installed from ${entry.registryName} at ${new Date(entry.installedAt).toLocaleString()}`));
247
+ });
248
+ }
249
+ function printRegistryList() {
250
+ console.log(chalk.bold("\n Hub Registries\n"));
251
+ configManager.hubRegistries.forEach((registry, index) => {
252
+ console.log(` ${index + 1}. ${registry.name}`);
253
+ console.log(chalk.gray(` ${registry.url}`));
254
+ });
255
+ }
256
+ export async function hubCommandAction(action, subAction) {
257
+ const normalized = action.toLowerCase();
258
+ await setSessionPanel("hub", subAction ?? normalized);
259
+ if (normalized === "list") {
260
+ await setSessionPanel("hub", "list");
261
+ console.log(chalk.bold("\n Hub Catalog\n"));
262
+ DEFAULT_HUB_ENTRIES.forEach((entry, index) => {
263
+ console.log(` ${index + 1}. ${entry.name} [${entry.type}]`);
264
+ console.log(chalk.gray(` ${entry.description}`));
265
+ });
266
+ const installed = await getInstalledHubEntries();
267
+ if (installed.length > 0) {
268
+ console.log(chalk.gray(`\n Installed in this repo: ${installed.length}`));
269
+ }
270
+ return { action: "list", changed: false };
271
+ }
272
+ if (normalized === "browse") {
273
+ await setSessionPanel("hub", "browse");
274
+ return runHubBrowseFlow();
275
+ }
276
+ if (normalized === "install") {
277
+ const installed = await getInstalledHubEntries();
278
+ let selected = subAction ? DEFAULT_HUB_ENTRIES.find((entry) => entry.slug === subAction) : undefined;
279
+ if (!selected) {
280
+ const answer = await prompts({
281
+ type: "select",
282
+ name: "value",
283
+ message: "Choose a hub entry to install into this repo",
284
+ choices: DEFAULT_HUB_ENTRIES.map((entry) => ({
285
+ title: `${entry.name} (${entry.type})`,
286
+ description: entry.description,
287
+ value: entry.slug,
288
+ })),
289
+ });
290
+ selected = DEFAULT_HUB_ENTRIES.find((entry) => entry.slug === answer.value);
291
+ }
292
+ if (!selected) {
293
+ console.log(chalk.yellow("\n No hub entry selected."));
294
+ return;
295
+ }
296
+ await setSessionPanel("hub", selected.slug);
297
+ await recordSessionHubEntry(selected.slug);
298
+ if (installed.some((entry) => entry.slug === selected.slug)) {
299
+ await recordSessionEvent({
300
+ kind: "hub",
301
+ title: `${selected.name} was already installed`,
302
+ detail: "No repo files changed because this bundle was already present.",
303
+ panel: "hub",
304
+ focus: selected.slug,
305
+ status: "info",
306
+ });
307
+ console.log(chalk.yellow(`\n ${selected.name} is already installed in this repo.`));
308
+ return {
309
+ action: "install",
310
+ changed: false,
311
+ installedEntry: selected,
312
+ };
313
+ }
314
+ const registry = configManager.hubRegistries[0];
315
+ await setInstalledHubEntries([
316
+ ...installed,
317
+ {
318
+ id: randomUUID(),
319
+ slug: selected.slug,
320
+ name: selected.name,
321
+ type: selected.type,
322
+ description: selected.description,
323
+ installedAt: new Date().toISOString(),
324
+ registryName: registry?.name ?? "Umbrella Hub",
325
+ },
326
+ ]);
327
+ const assetPath = await writeHubAsset(selected.slug, buildHubAsset(selected));
328
+ const filePaths = await writeHubAssetFiles(selected.slug, buildHubFiles(selected));
329
+ await recordSessionEvent({
330
+ kind: "hub",
331
+ title: `Installed hub entry ${selected.name}`,
332
+ detail: `${selected.includes.length} packaged item${selected.includes.length === 1 ? "" : "s"} are now available in this repo.`,
333
+ panel: "hub",
334
+ focus: selected.slug,
335
+ status: "success",
336
+ });
337
+ console.log(chalk.green(`\n Installed ${selected.name} into this repo.`));
338
+ console.log(chalk.gray(` Asset written to ${assetPath}`));
339
+ filePaths.forEach((filePath) => {
340
+ console.log(chalk.gray(` Added bundle file ${filePath}`));
341
+ });
342
+ if (selected.slug === "umbrella-context-mcp-connector") {
343
+ console.log(chalk.gray(" Installing the recommended codex-mcp connector next..."));
344
+ await connectorsCommandAction("install", selected.installsConnector ?? "codex-mcp");
345
+ }
346
+ return {
347
+ action: "install",
348
+ changed: true,
349
+ installedEntry: selected,
350
+ assetPath,
351
+ filePaths,
352
+ recommendedConnector: selected.installsConnector,
353
+ };
354
+ }
355
+ if (normalized === "inspect") {
356
+ const target = subAction
357
+ ? DEFAULT_HUB_ENTRIES.find((entry) => entry.slug === subAction)
358
+ : undefined;
359
+ if (!target) {
360
+ console.log(chalk.red("Use: hub inspect <slug>"));
361
+ return;
362
+ }
363
+ const installed = await getInstalledHubEntries();
364
+ const isInstalled = installed.some((entry) => entry.slug === target.slug);
365
+ await setSessionPanel("hub", target.slug);
366
+ await recordSessionHubEntry(target.slug);
367
+ await recordSessionEvent({
368
+ kind: "hub",
369
+ title: `Inspected hub entry ${target.name}`,
370
+ detail: `Viewed the bundle details and next steps for ${target.slug}.`,
371
+ panel: "hub",
372
+ focus: target.slug,
373
+ status: "info",
374
+ });
375
+ console.log(chalk.bold(`\n ${target.name}\n`));
376
+ console.log(` Type: ${target.type}`);
377
+ console.log(` Slug: ${target.slug}`);
378
+ console.log(` Installed: ${isInstalled ? "Yes" : "No"}`);
379
+ console.log(chalk.gray(` ${target.description}`));
380
+ console.log("");
381
+ console.log(chalk.cyan(" Includes"));
382
+ target.includes.forEach((item) => {
383
+ console.log(` - ${item}`);
384
+ });
385
+ console.log("");
386
+ console.log(chalk.cyan(" Next Steps"));
387
+ target.nextSteps.forEach((step) => {
388
+ console.log(` - ${step}`);
389
+ });
390
+ if (target.installsConnector) {
391
+ console.log("");
392
+ console.log(chalk.cyan(" Connector"));
393
+ console.log(` - Installs ${target.installsConnector}`);
394
+ }
395
+ return {
396
+ action: "inspect",
397
+ changed: false,
398
+ installedEntry: target,
399
+ recommendedConnector: target.installsConnector,
400
+ };
401
+ }
402
+ if (normalized === "recent") {
403
+ const session = await getSessionState();
404
+ const slug = session?.recentHubSlugs?.[0];
405
+ if (!slug) {
406
+ console.log(chalk.yellow("\n No recent hub entry in this session yet."));
407
+ return;
408
+ }
409
+ return hubCommandAction("inspect", slug);
410
+ }
411
+ if (normalized === "installed") {
412
+ await setSessionPanel("hub", "installed");
413
+ await printInstalled(await getInstalledHubEntries());
414
+ return { action: "installed", changed: false };
415
+ }
416
+ if (normalized === "registry") {
417
+ await setSessionPanel("hub", `registry:${subAction ?? "list"}`);
418
+ const mode = (subAction ?? "list").toLowerCase();
419
+ if (mode === "list") {
420
+ printRegistryList();
421
+ return { action: "registry", changed: false };
422
+ }
423
+ if (mode === "add") {
424
+ const answer = await prompts([
425
+ { type: "text", name: "name", message: "Registry name" },
426
+ { type: "text", name: "url", message: "Registry URL" },
427
+ ]);
428
+ if (!answer.name || !answer.url) {
429
+ console.log(chalk.yellow("\n Registry add cancelled."));
430
+ return;
431
+ }
432
+ configManager.upsertHubRegistry({
433
+ id: randomUUID(),
434
+ name: answer.name,
435
+ url: answer.url,
436
+ updatedAt: new Date().toISOString(),
437
+ });
438
+ await recordSessionEvent({
439
+ kind: "hub",
440
+ title: `Added hub registry ${answer.name}`,
441
+ detail: `The CLI can now see bundles from ${answer.url}.`,
442
+ panel: "hub",
443
+ focus: `registry:${answer.name}`,
444
+ status: "success",
445
+ });
446
+ console.log(chalk.green(`\n Added registry ${answer.name}.`));
447
+ return { action: "registry", changed: true };
448
+ }
449
+ if (mode === "remove") {
450
+ const registries = configManager.hubRegistries;
451
+ const answer = await prompts({
452
+ type: "select",
453
+ name: "value",
454
+ message: "Choose a registry to remove",
455
+ choices: registries.map((entry) => ({
456
+ title: entry.name,
457
+ description: entry.url,
458
+ value: entry.id,
459
+ })),
460
+ });
461
+ if (!answer.value) {
462
+ console.log(chalk.yellow("\n No registry selected."));
463
+ return;
464
+ }
465
+ const selected = registries.find((entry) => entry.id === answer.value);
466
+ configManager.removeHubRegistry(answer.value);
467
+ await recordSessionEvent({
468
+ kind: "hub",
469
+ title: `Removed hub registry ${selected?.name ?? "registry"}`,
470
+ detail: "The registry was removed from this device configuration.",
471
+ panel: "hub",
472
+ focus: `registry:${selected?.name ?? "removed"}`,
473
+ status: "warning",
474
+ });
475
+ console.log(chalk.green(`\n Removed registry ${selected?.name ?? "registry"}.`));
476
+ return { action: "registry", changed: true };
477
+ }
478
+ console.log(chalk.red("Use: hub registry list | add | remove"));
479
+ return;
480
+ }
481
+ console.log(chalk.red("Use: hub list | hub browse | hub install [slug] | hub inspect <slug> | hub recent | hub installed | hub registry list|add|remove"));
482
+ }
483
+ export function hubCommand(cli) {
484
+ cli.command("hub <action> [subAction]", "Browse and install skills, bundles, and registries").action(async (action, subAction) => {
485
+ await hubCommandAction(action, subAction);
486
+ });
487
+ }
@@ -1 +1,3 @@
1
+ import { renderCommandList } from "./catalog.js";
1
2
  export declare function interactiveCommand(_args: string[]): Promise<void>;
3
+ export { renderCommandList };