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.
- package/bin/um.js +2 -0
- package/dist/adapters/byterover-context-runtime-store.d.ts +15 -0
- package/dist/adapters/byterover-context-runtime-store.js +57 -0
- package/dist/adapters/byterover-runtime-bridge.d.ts +218 -0
- package/dist/adapters/byterover-runtime-bridge.js +343 -0
- package/dist/adapters/byterover-transport-task-store.d.ts +13 -0
- package/dist/adapters/byterover-transport-task-store.js +50 -0
- package/dist/adapters/umbrella-onboarding.d.ts +27 -0
- package/dist/adapters/umbrella-onboarding.js +79 -0
- package/dist/adapters/umbrella-provider-runtime.d.ts +38 -0
- package/dist/adapters/umbrella-provider-runtime.js +199 -0
- package/dist/adapters/vendor-byterover.d.ts +4 -0
- package/dist/adapters/vendor-byterover.js +19 -0
- package/dist/commands/activity.d.ts +2 -0
- package/dist/commands/activity.js +82 -0
- package/dist/commands/bridge.d.ts +2 -0
- package/dist/commands/bridge.js +40 -0
- package/dist/commands/catalog.d.ts +34 -0
- package/dist/commands/catalog.js +234 -0
- package/dist/commands/connect.js +14 -14
- package/dist/commands/connectors.d.ts +24 -0
- package/dist/commands/connectors.js +626 -0
- package/dist/commands/curate.d.ts +1 -0
- package/dist/commands/curate.js +48 -3
- package/dist/commands/debug.d.ts +2 -0
- package/dist/commands/debug.js +55 -0
- package/dist/commands/fix.js +54 -0
- package/dist/commands/hub.d.ts +22 -0
- package/dist/commands/hub.js +487 -0
- package/dist/commands/interactive.d.ts +2 -0
- package/dist/commands/interactive.js +970 -62
- package/dist/commands/locations.d.ts +1 -0
- package/dist/commands/locations.js +15 -12
- package/dist/commands/logout.d.ts +2 -0
- package/dist/commands/logout.js +34 -0
- package/dist/commands/model.d.ts +11 -0
- package/dist/commands/model.js +225 -0
- package/dist/commands/providers.d.ts +17 -0
- package/dist/commands/providers.js +379 -0
- package/dist/commands/pull.js +60 -1
- package/dist/commands/push.js +62 -2
- package/dist/commands/reset.d.ts +2 -0
- package/dist/commands/reset.js +35 -0
- package/dist/commands/restart.d.ts +2 -0
- package/dist/commands/restart.js +21 -0
- package/dist/commands/search.js +65 -1
- package/dist/commands/session.d.ts +2 -0
- package/dist/commands/session.js +241 -0
- package/dist/commands/setup.js +58 -56
- package/dist/commands/space.d.ts +12 -0
- package/dist/commands/space.js +138 -42
- package/dist/commands/status.d.ts +29 -0
- package/dist/commands/status.js +120 -19
- package/dist/commands/tasks.d.ts +2 -0
- package/dist/commands/tasks.js +95 -0
- package/dist/commands/transport.d.ts +2 -0
- package/dist/commands/transport.js +88 -0
- package/dist/commands/tree.d.ts +2 -0
- package/dist/commands/tree.js +98 -0
- package/dist/commands/tui.d.ts +2 -0
- package/dist/commands/tui.js +1273 -0
- package/dist/config.d.ts +23 -0
- package/dist/config.js +69 -0
- package/dist/index.js +41 -5
- package/dist/repo-state.d.ts +227 -1
- package/dist/repo-state.js +920 -4
- package/dist/umbrella.js +29 -5
- package/package.json +11 -3
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { configManager } from "../config.js";
|
|
3
|
+
export async function locationsCommandAction() {
|
|
4
|
+
const locations = configManager.locations;
|
|
5
|
+
if (locations.length === 0) {
|
|
6
|
+
console.log(chalk.yellow("\n No repo locations saved yet."));
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
console.log(chalk.bold("\n Saved Context Locations\n"));
|
|
10
|
+
locations.forEach((location, index) => {
|
|
11
|
+
console.log(chalk.cyan(` ${index + 1}. ${location.companyName} / ${location.projectName}`));
|
|
12
|
+
console.log(chalk.gray(` ${location.repoRoot}`));
|
|
13
|
+
console.log(chalk.gray(` Updated: ${new Date(location.updatedAt).toLocaleString()}`));
|
|
14
|
+
});
|
|
15
|
+
}
|
|
3
16
|
export function locationsCommand(cli) {
|
|
4
|
-
cli.command("locations", "List repo folders that have been connected on this machine").action(() => {
|
|
5
|
-
|
|
6
|
-
if (locations.length === 0) {
|
|
7
|
-
console.log(chalk.yellow("\n No repo locations saved yet."));
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
console.log(chalk.bold("\n Saved Context Locations\n"));
|
|
11
|
-
locations.forEach((location, index) => {
|
|
12
|
-
console.log(chalk.cyan(` ${index + 1}. ${location.companyName} / ${location.projectName}`));
|
|
13
|
-
console.log(chalk.gray(` ${location.repoRoot}`));
|
|
14
|
-
console.log(chalk.gray(` Updated: ${new Date(location.updatedAt).toLocaleString()}`));
|
|
15
|
-
});
|
|
17
|
+
cli.command("locations", "List repo folders that have been connected on this machine").action(async () => {
|
|
18
|
+
await locationsCommandAction();
|
|
16
19
|
});
|
|
17
20
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import prompts from "prompts";
|
|
3
|
+
import { configManager } from "../config.js";
|
|
4
|
+
export async function logoutCommandAction(force = false) {
|
|
5
|
+
const current = configManager.config;
|
|
6
|
+
if (!current) {
|
|
7
|
+
console.log(chalk.yellow("No Umbrella session is currently saved on this device."));
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
if (!force) {
|
|
11
|
+
const answer = await prompts({
|
|
12
|
+
type: "confirm",
|
|
13
|
+
name: "value",
|
|
14
|
+
message: `Disconnect this device from ${current.companyName} / ${current.projectName}?`,
|
|
15
|
+
initial: false,
|
|
16
|
+
});
|
|
17
|
+
if (!answer.value) {
|
|
18
|
+
console.log(chalk.yellow("\n Logout cancelled."));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
configManager.clearUmbrellaSession();
|
|
23
|
+
console.log(chalk.green("\n This device is now signed out of Umbrella Context."));
|
|
24
|
+
console.log(chalk.gray(' Your local providers and hub registries were kept on this device.'));
|
|
25
|
+
console.log(chalk.gray(' Run "umbrella-context setup" to connect again.'));
|
|
26
|
+
}
|
|
27
|
+
export function logoutCommand(cli) {
|
|
28
|
+
cli
|
|
29
|
+
.command("logout", "Disconnect this device from Umbrella Context and clear saved auth")
|
|
30
|
+
.option("--yes", "Skip confirmation")
|
|
31
|
+
.action(async (opts) => {
|
|
32
|
+
await logoutCommandAction(Boolean(opts?.yes));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function getModelsForActiveProvider(): string[];
|
|
2
|
+
export type ModelCommandResult = {
|
|
3
|
+
action: "list" | "switch" | "inspect" | "ready";
|
|
4
|
+
changed: boolean;
|
|
5
|
+
activeModel: string | null;
|
|
6
|
+
providerName: string | null;
|
|
7
|
+
availableModels: string[];
|
|
8
|
+
inspectedModel?: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare function modelCommandAction(action: string, target?: string): Promise<ModelCommandResult | void>;
|
|
11
|
+
export declare function modelCommand(cli: any): void;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import prompts from "prompts";
|
|
3
|
+
import { configManager } from "../config.js";
|
|
4
|
+
import { getSessionState, recordSessionEvent, recordSessionModel, setSessionPanel } from "../repo-state.js";
|
|
5
|
+
const MODELS_BY_PROVIDER = {
|
|
6
|
+
anthropic: ["claude-3-7-sonnet", "claude-3-5-sonnet", "claude-3-5-haiku"],
|
|
7
|
+
openai: ["gpt-5.4", "gpt-5.4-mini", "gpt-4.1"],
|
|
8
|
+
google: ["gemini-2.5-pro", "gemini-2.5-flash"],
|
|
9
|
+
openrouter: ["openai/gpt-4.1", "anthropic/claude-3.7-sonnet", "google/gemini-2.5-pro"],
|
|
10
|
+
"openai-compatible": ["custom-model"],
|
|
11
|
+
};
|
|
12
|
+
function getActiveProvider() {
|
|
13
|
+
const config = configManager.config;
|
|
14
|
+
const providers = configManager.providers;
|
|
15
|
+
return providers.find((entry) => entry.id === config?.activeProvider) ?? null;
|
|
16
|
+
}
|
|
17
|
+
export function getModelsForActiveProvider() {
|
|
18
|
+
const provider = getActiveProvider();
|
|
19
|
+
if (!provider)
|
|
20
|
+
return [];
|
|
21
|
+
return MODELS_BY_PROVIDER[provider.kind] ?? ["custom-model"];
|
|
22
|
+
}
|
|
23
|
+
function resolveModel(models, target) {
|
|
24
|
+
if (!target)
|
|
25
|
+
return null;
|
|
26
|
+
const normalized = target.toLowerCase();
|
|
27
|
+
return models.find((model) => model.toLowerCase() === normalized) ?? null;
|
|
28
|
+
}
|
|
29
|
+
export async function modelCommandAction(action, target) {
|
|
30
|
+
const normalized = action.toLowerCase();
|
|
31
|
+
const config = configManager.config;
|
|
32
|
+
if (!config) {
|
|
33
|
+
console.log(chalk.red("Not configured. Run: umbrella-context setup"));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const provider = getActiveProvider();
|
|
37
|
+
if (!provider) {
|
|
38
|
+
console.log(chalk.yellow(" No active provider. Run: umbrella-context providers connect"));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const models = getModelsForActiveProvider();
|
|
42
|
+
await setSessionPanel("model", config.activeModel ?? provider.id);
|
|
43
|
+
if (normalized === "list") {
|
|
44
|
+
await setSessionPanel("model", config.activeModel ?? provider.id);
|
|
45
|
+
console.log(chalk.bold(`\n Models for ${provider.name}\n`));
|
|
46
|
+
models.forEach((model, index) => {
|
|
47
|
+
const active = config.activeModel === model ? " (active)" : "";
|
|
48
|
+
console.log(` ${index + 1}. ${model}${active}`);
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
action: "list",
|
|
52
|
+
changed: false,
|
|
53
|
+
activeModel: config.activeModel ?? null,
|
|
54
|
+
providerName: provider.name,
|
|
55
|
+
availableModels: models,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (normalized === "ready") {
|
|
59
|
+
const ready = Boolean(config.activeModel);
|
|
60
|
+
await setSessionPanel("model", config.activeModel ?? provider.id);
|
|
61
|
+
await recordSessionEvent({
|
|
62
|
+
kind: "model",
|
|
63
|
+
title: ready ? `Model runtime ready for ${provider.name}` : `Model missing for ${provider.name}`,
|
|
64
|
+
detail: ready
|
|
65
|
+
? `${config.activeModel} is ready for terminal work.`
|
|
66
|
+
: "Choose an active model before running provider-backed queries.",
|
|
67
|
+
panel: "model",
|
|
68
|
+
focus: config.activeModel ?? provider.id,
|
|
69
|
+
status: ready ? "success" : "warning",
|
|
70
|
+
});
|
|
71
|
+
console.log(chalk.bold(`\n Model readiness for ${provider.name}\n`));
|
|
72
|
+
console.log(` Active model: ${config.activeModel ?? "Not selected"}`);
|
|
73
|
+
console.log(` Available models: ${models.length}`);
|
|
74
|
+
console.log(` Runtime ready: ${ready ? "Yes" : "No"}`);
|
|
75
|
+
console.log("");
|
|
76
|
+
console.log(chalk.cyan(" Recommended Next Step"));
|
|
77
|
+
console.log(ready
|
|
78
|
+
? " - Runtime is ready. Ask a plain question or run umbrella-context query."
|
|
79
|
+
: " - Run umbrella-context model switch to choose the active model.");
|
|
80
|
+
return {
|
|
81
|
+
action: "ready",
|
|
82
|
+
changed: false,
|
|
83
|
+
activeModel: config.activeModel ?? null,
|
|
84
|
+
providerName: provider.name,
|
|
85
|
+
availableModels: models,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if (normalized === "inspect") {
|
|
89
|
+
if (models.length === 0) {
|
|
90
|
+
console.log(chalk.yellow(" No models available for the active provider."));
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
let selectedModel = target;
|
|
94
|
+
if (!selectedModel) {
|
|
95
|
+
const answer = await prompts({
|
|
96
|
+
type: "select",
|
|
97
|
+
name: "value",
|
|
98
|
+
message: `Choose a model to inspect for ${provider.name}`,
|
|
99
|
+
choices: models.map((model) => ({
|
|
100
|
+
title: model,
|
|
101
|
+
value: model,
|
|
102
|
+
})),
|
|
103
|
+
});
|
|
104
|
+
if (!answer.value) {
|
|
105
|
+
console.log(chalk.yellow("\n No model selected."));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
selectedModel = answer.value;
|
|
109
|
+
}
|
|
110
|
+
const inspectedModel = selectedModel;
|
|
111
|
+
await setSessionPanel("model", inspectedModel);
|
|
112
|
+
await recordSessionModel(inspectedModel);
|
|
113
|
+
await recordSessionEvent({
|
|
114
|
+
kind: "model",
|
|
115
|
+
title: `Inspected model ${inspectedModel}`,
|
|
116
|
+
detail: `${inspectedModel} belongs to ${provider.name} and is ${config.activeModel === inspectedModel ? "already active" : "available to activate"}.`,
|
|
117
|
+
panel: "model",
|
|
118
|
+
focus: inspectedModel,
|
|
119
|
+
status: "info",
|
|
120
|
+
});
|
|
121
|
+
console.log(chalk.bold(`\n ${inspectedModel}\n`));
|
|
122
|
+
console.log(` Provider: ${provider.name}`);
|
|
123
|
+
console.log(` Active: ${config.activeModel === inspectedModel ? "Yes" : "No"}`);
|
|
124
|
+
console.log(` Family: ${provider.kind}`);
|
|
125
|
+
console.log("");
|
|
126
|
+
console.log(chalk.cyan(" Recommended Next Step"));
|
|
127
|
+
if (config.activeModel !== inspectedModel) {
|
|
128
|
+
console.log(` - Run umbrella-context model switch and choose ${inspectedModel} to make it active.`);
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
console.log(" - Model is active. Ask a plain question or run umbrella-context query.");
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
action: "inspect",
|
|
135
|
+
changed: false,
|
|
136
|
+
activeModel: config.activeModel ?? null,
|
|
137
|
+
providerName: provider.name,
|
|
138
|
+
availableModels: models,
|
|
139
|
+
inspectedModel,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if (normalized === "recent") {
|
|
143
|
+
const session = await getSessionState();
|
|
144
|
+
const recentModel = target ?? session?.recentModels?.[0] ?? config.activeModel ?? null;
|
|
145
|
+
if (!recentModel) {
|
|
146
|
+
console.log(chalk.yellow("\n No recent model in this session yet."));
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
await setSessionPanel("model", recentModel);
|
|
150
|
+
await recordSessionModel(recentModel);
|
|
151
|
+
await recordSessionEvent({
|
|
152
|
+
kind: "model",
|
|
153
|
+
title: `Re-opened recent model ${recentModel}`,
|
|
154
|
+
detail: `Returned to the most recent model touched for ${provider.name}.`,
|
|
155
|
+
panel: "model",
|
|
156
|
+
focus: recentModel,
|
|
157
|
+
status: "info",
|
|
158
|
+
});
|
|
159
|
+
console.log(chalk.bold(`\n ${recentModel}\n`));
|
|
160
|
+
console.log(` Provider: ${provider.name}`);
|
|
161
|
+
console.log(` Active: ${config.activeModel === recentModel ? "Yes" : "No"}`);
|
|
162
|
+
console.log(` Family: ${provider.kind}`);
|
|
163
|
+
console.log("");
|
|
164
|
+
console.log(chalk.cyan(" Recommended Next Step"));
|
|
165
|
+
if (config.activeModel !== recentModel) {
|
|
166
|
+
console.log(` - Run umbrella-context model switch and choose ${recentModel} to make it active.`);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
console.log(" - Model is active. Ask a plain question or run umbrella-context query.");
|
|
170
|
+
}
|
|
171
|
+
return {
|
|
172
|
+
action: "inspect",
|
|
173
|
+
changed: false,
|
|
174
|
+
activeModel: config.activeModel ?? null,
|
|
175
|
+
providerName: provider.name,
|
|
176
|
+
availableModels: models,
|
|
177
|
+
inspectedModel: recentModel,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
if (normalized === "switch") {
|
|
181
|
+
let selectedModel = resolveModel(models, target);
|
|
182
|
+
if (!selectedModel) {
|
|
183
|
+
const answer = await prompts({
|
|
184
|
+
type: "select",
|
|
185
|
+
name: "value",
|
|
186
|
+
message: `Choose the active model for ${provider.name}`,
|
|
187
|
+
choices: models.map((model) => ({ title: model, value: model })),
|
|
188
|
+
});
|
|
189
|
+
if (!answer.value) {
|
|
190
|
+
console.log(chalk.yellow("\n No model selected."));
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
selectedModel = answer.value;
|
|
194
|
+
}
|
|
195
|
+
if (!selectedModel) {
|
|
196
|
+
console.log(chalk.yellow("\n No model selected."));
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
configManager.set({ activeModel: selectedModel });
|
|
200
|
+
await setSessionPanel("model", selectedModel);
|
|
201
|
+
await recordSessionModel(selectedModel);
|
|
202
|
+
await recordSessionEvent({
|
|
203
|
+
kind: "model",
|
|
204
|
+
title: `Switched active model to ${selectedModel}`,
|
|
205
|
+
detail: `${provider.name} is now paired with ${selectedModel} for terminal work.`,
|
|
206
|
+
panel: "model",
|
|
207
|
+
focus: selectedModel,
|
|
208
|
+
status: "success",
|
|
209
|
+
});
|
|
210
|
+
console.log(chalk.green(`\n Active model: ${selectedModel}`));
|
|
211
|
+
return {
|
|
212
|
+
action: "switch",
|
|
213
|
+
changed: true,
|
|
214
|
+
activeModel: selectedModel,
|
|
215
|
+
providerName: provider.name,
|
|
216
|
+
availableModels: models,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
console.log(chalk.red("Use one of: model list, model inspect, model recent, model ready, model switch"));
|
|
220
|
+
}
|
|
221
|
+
export function modelCommand(cli) {
|
|
222
|
+
cli.command("model <action> [target]", "List or switch the active model for the current provider").action(async (action, target) => {
|
|
223
|
+
await modelCommandAction(action, target);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type SavedProvider } from "../config.js";
|
|
2
|
+
export type ProvidersCommandResult = {
|
|
3
|
+
action: "list" | "connect" | "switch" | "disconnect" | "inspect" | "test" | "setup";
|
|
4
|
+
changed: boolean;
|
|
5
|
+
activeProvider: SavedProvider | null;
|
|
6
|
+
needsModelSelection: boolean;
|
|
7
|
+
inspectedProvider?: SavedProvider | null;
|
|
8
|
+
};
|
|
9
|
+
export declare function getActiveProvider(): SavedProvider | null;
|
|
10
|
+
export declare function getProviderReadinessSummary(): {
|
|
11
|
+
activeModel: string | null;
|
|
12
|
+
activeProvider: SavedProvider | null;
|
|
13
|
+
modelReady: boolean;
|
|
14
|
+
providerReady: boolean;
|
|
15
|
+
};
|
|
16
|
+
export declare function providersCommandAction(action: string, target?: string): Promise<ProvidersCommandResult | void>;
|
|
17
|
+
export declare function providersCommand(cli: any): void;
|