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
package/dist/commands/curate.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { configManager } from "../config.js";
|
|
3
|
-
import { addPendingMemory, ensureRepoContext, getRepoContext } from "../repo-state.js";
|
|
3
|
+
import { addPendingMemory, completeTask, createTask, ensureRepoContext, getPendingMemories, getRepoContext, recordSessionCuration, recordSessionEvent, setSessionPanel, } from "../repo-state.js";
|
|
4
4
|
export async function curateCommandAction(content, opts = {}) {
|
|
5
5
|
const config = configManager.config;
|
|
6
6
|
if (!config) {
|
|
@@ -12,6 +12,15 @@ export async function curateCommandAction(content, opts = {}) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
await ensureRepoContext(config);
|
|
15
|
+
await setSessionPanel("curate", content.trim());
|
|
16
|
+
const task = await createTask({
|
|
17
|
+
kind: "curate",
|
|
18
|
+
title: "Curate local note",
|
|
19
|
+
detail: content.trim(),
|
|
20
|
+
status: "running",
|
|
21
|
+
panel: "curate",
|
|
22
|
+
focus: content.trim(),
|
|
23
|
+
});
|
|
15
24
|
const entry = await addPendingMemory({
|
|
16
25
|
content: content.trim(),
|
|
17
26
|
tags: opts.tag ? (Array.isArray(opts.tag) ? opts.tag : [opts.tag]) : [],
|
|
@@ -19,17 +28,53 @@ export async function curateCommandAction(content, opts = {}) {
|
|
|
19
28
|
systemType: opts.type || "system1_knowledge",
|
|
20
29
|
});
|
|
21
30
|
const { umDir } = await getRepoContext();
|
|
31
|
+
await recordSessionCuration(content.trim());
|
|
32
|
+
await recordSessionEvent({
|
|
33
|
+
kind: "curate",
|
|
34
|
+
title: "Saved a new local Context note",
|
|
35
|
+
detail: `Draft ${entry.id} was added to .um for ${config.companyName} / ${config.projectName}.`,
|
|
36
|
+
panel: "curate",
|
|
37
|
+
focus: entry.id,
|
|
38
|
+
status: "success",
|
|
39
|
+
});
|
|
40
|
+
await completeTask(task.id, "completed", `Saved local draft ${entry.id} in .um.`);
|
|
22
41
|
console.log(chalk.green(`\n Saved locally to ${config.companyName} / ${config.projectName}`));
|
|
23
42
|
console.log(chalk.gray(` Pending entry: ${entry.id}`));
|
|
24
43
|
console.log(chalk.gray(` Repo context folder: ${umDir}`));
|
|
25
44
|
console.log(chalk.gray(' Run "umbrella-context push" when you want to sync this to the server.'));
|
|
26
45
|
}
|
|
46
|
+
export async function curateViewCommandAction() {
|
|
47
|
+
const config = configManager.config;
|
|
48
|
+
if (!config) {
|
|
49
|
+
console.log(chalk.red("Not configured. Run: umbrella-context setup"));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await ensureRepoContext(config);
|
|
53
|
+
await setSessionPanel("curate", "view");
|
|
54
|
+
const entries = await getPendingMemories();
|
|
55
|
+
console.log(chalk.bold(`\n Local Curations for ${config.companyName} / ${config.projectName}\n`));
|
|
56
|
+
if (entries.length === 0) {
|
|
57
|
+
console.log(chalk.yellow(" No local curations staged yet."));
|
|
58
|
+
console.log(chalk.gray(' Try: umbrella-context curate "What you learned"'));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
entries.forEach((entry, index) => {
|
|
62
|
+
const tags = entry.tags.length > 0 ? ` [${entry.tags.join(", ")}]` : "";
|
|
63
|
+
console.log(` ${index + 1}. ${entry.content}${tags}`);
|
|
64
|
+
console.log(chalk.gray(` ${entry.systemType} • ${entry.createdAt} • ${entry.id}`));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
27
67
|
export function curateCommand(cli) {
|
|
28
68
|
cli
|
|
29
|
-
.command("curate
|
|
69
|
+
.command("curate [...content]", "Save context locally in this repo so it can be pushed later")
|
|
30
70
|
.option("--tag <tag>", "Add tags (repeatable)")
|
|
31
71
|
.option("--type <type>", "system1_knowledge or system2_reasoning")
|
|
32
72
|
.action(async (content, opts) => {
|
|
33
|
-
|
|
73
|
+
const parts = Array.isArray(content) ? content : [content];
|
|
74
|
+
if (parts.length === 1 && parts[0] === "view") {
|
|
75
|
+
await curateViewCommandAction();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
await curateCommandAction(parts.join(" "), opts);
|
|
34
79
|
});
|
|
35
80
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import { configManager } from "../config.js";
|
|
3
|
+
import { ensureSessionState, getConnectorRuns, getInstalledConnectors, getInstalledHubEntries, getPendingMemories, getPulledFixes, getPulledMemories, getRepoContext, } from "../repo-state.js";
|
|
4
|
+
export async function debugCommandAction() {
|
|
5
|
+
const config = configManager.config;
|
|
6
|
+
if (!config) {
|
|
7
|
+
console.log(chalk.red("Not configured. Run: umbrella-context setup"));
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
const { repoRoot, state, umDir } = await getRepoContext();
|
|
11
|
+
const session = await ensureSessionState();
|
|
12
|
+
const pending = await getPendingMemories();
|
|
13
|
+
const pulled = await getPulledMemories();
|
|
14
|
+
const fixes = await getPulledFixes();
|
|
15
|
+
const connectors = await getInstalledConnectors();
|
|
16
|
+
const hubEntries = await getInstalledHubEntries();
|
|
17
|
+
const runs = await getConnectorRuns();
|
|
18
|
+
console.log(chalk.bold("\n Umbrella Context Debug\n"));
|
|
19
|
+
console.log(chalk.cyan(" Config"));
|
|
20
|
+
console.log(` Config Path: ${configManager.configPath}`);
|
|
21
|
+
console.log(` Umbrella URL: ${config.umbrellaUrl ?? "Not saved"}`);
|
|
22
|
+
console.log(` Server URL: ${config.serverUrl}`);
|
|
23
|
+
console.log(` Company: ${config.companyName} (${config.companyId})`);
|
|
24
|
+
console.log(` Space: ${config.projectName} (${config.projectId})`);
|
|
25
|
+
console.log(` Workspace: ${config.workspaceName} (${config.workspaceId})`);
|
|
26
|
+
console.log("");
|
|
27
|
+
console.log(chalk.cyan(" Repo State"));
|
|
28
|
+
console.log(` Repo Root: ${repoRoot}`);
|
|
29
|
+
console.log(` .um Folder: ${umDir}`);
|
|
30
|
+
console.log(` Context Initialized: ${state ? "Yes" : "No"}`);
|
|
31
|
+
console.log(` Last Push: ${state?.lastPushAt ?? "Never"}`);
|
|
32
|
+
console.log(` Last Pull: ${state?.lastPullAt ?? "Never"}`);
|
|
33
|
+
console.log("");
|
|
34
|
+
console.log(chalk.cyan(" Local Counts"));
|
|
35
|
+
console.log(` Pending Curations: ${pending.length}`);
|
|
36
|
+
console.log(` Pulled Context Notes: ${pulled.length}`);
|
|
37
|
+
console.log(` Pulled Known Fixes: ${fixes.length}`);
|
|
38
|
+
console.log(` Installed Hub Entries: ${hubEntries.length}`);
|
|
39
|
+
console.log(` Installed Connectors: ${connectors.length}`);
|
|
40
|
+
console.log(` Connector Runs: ${runs.length}`);
|
|
41
|
+
console.log("");
|
|
42
|
+
console.log(chalk.cyan(" Session"));
|
|
43
|
+
console.log(` Session ID: ${session.id}`);
|
|
44
|
+
console.log(` Started: ${session.startedAt}`);
|
|
45
|
+
console.log(` Updated: ${session.updatedAt}`);
|
|
46
|
+
console.log(` Commands: ${session.commandHistory.length}`);
|
|
47
|
+
console.log(` Queries: ${session.recentQueries.length}`);
|
|
48
|
+
console.log(` Curations: ${session.recentCurations.length}`);
|
|
49
|
+
console.log(` Last Summary: ${session.lastSummary ?? "Nothing recorded yet"}`);
|
|
50
|
+
}
|
|
51
|
+
export function debugCommand(cli) {
|
|
52
|
+
cli.command("debug", "Show detailed local runtime paths, counts, and session state").action(async () => {
|
|
53
|
+
await debugCommandAction();
|
|
54
|
+
});
|
|
55
|
+
}
|
package/dist/commands/fix.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { configManager } from "../config.js";
|
|
3
|
+
import { addTaskReasoningContent, addTaskToolCall, appendTaskStreamingContent, completeTask, createTask, patchTaskLifecycle, recordSessionEvent, setSessionPanel, } from "../repo-state.js";
|
|
3
4
|
export function fixCommand(cli) {
|
|
4
5
|
cli.command("fix <error>", "Search for known fixes to an error").action(async (error) => {
|
|
5
6
|
const config = configManager.config;
|
|
@@ -8,19 +9,72 @@ export function fixCommand(cli) {
|
|
|
8
9
|
return;
|
|
9
10
|
}
|
|
10
11
|
try {
|
|
12
|
+
await setSessionPanel("fix", error);
|
|
13
|
+
const task = await createTask({
|
|
14
|
+
kind: "query",
|
|
15
|
+
title: `Known fix lookup: ${error}`,
|
|
16
|
+
detail: "Searching shared known fixes for this error signal.",
|
|
17
|
+
status: "running",
|
|
18
|
+
panel: "fix",
|
|
19
|
+
focus: error,
|
|
20
|
+
});
|
|
21
|
+
await addTaskReasoningContent(task.id, `Starting known-fix lookup for "${error}".`);
|
|
22
|
+
await addTaskToolCall(task.id, {
|
|
23
|
+
toolName: "server.evolutions.search",
|
|
24
|
+
status: "running",
|
|
25
|
+
args: { error },
|
|
26
|
+
});
|
|
11
27
|
const res = await fetch(`${config.serverUrl}/api/evolutions/search?error=${encodeURIComponent(error)}`, {
|
|
12
28
|
headers: { Authorization: `Bearer ${config.apiKey}` },
|
|
13
29
|
});
|
|
14
30
|
if (!res.ok) {
|
|
15
31
|
const err = await res.json();
|
|
32
|
+
await addTaskToolCall(task.id, {
|
|
33
|
+
toolName: "server.evolutions.search",
|
|
34
|
+
status: "error",
|
|
35
|
+
args: { error },
|
|
36
|
+
error: err.error,
|
|
37
|
+
});
|
|
38
|
+
await completeTask(task.id, "failed", err.error || "Known fix lookup failed.");
|
|
16
39
|
console.log(chalk.red(`\n Failed: ${err.error}`));
|
|
17
40
|
return;
|
|
18
41
|
}
|
|
19
42
|
const data = await res.json();
|
|
43
|
+
await addTaskToolCall(task.id, {
|
|
44
|
+
toolName: "server.evolutions.search",
|
|
45
|
+
status: "completed",
|
|
46
|
+
args: { error },
|
|
47
|
+
result: { total: data.results.length },
|
|
48
|
+
});
|
|
49
|
+
await appendTaskStreamingContent(task.id, `fixes=${data.results.length};`);
|
|
50
|
+
await patchTaskLifecycle(task.id, {
|
|
51
|
+
status: "running",
|
|
52
|
+
detail: `Shared known-fix lookup returned ${data.results.length} candidate result${data.results.length === 1 ? "" : "s"}.`,
|
|
53
|
+
reason: "Shared known-fix lookup finished.",
|
|
54
|
+
});
|
|
55
|
+
await addTaskReasoningContent(task.id, `Server returned ${data.results.length} known fix candidate${data.results.length === 1 ? "" : "s"}.`);
|
|
20
56
|
if (data.results.length === 0) {
|
|
57
|
+
await completeTask(task.id, "completed", `No known fixes found for "${error}".`);
|
|
58
|
+
await recordSessionEvent({
|
|
59
|
+
kind: "query",
|
|
60
|
+
title: `No known fixes found for "${error}"`,
|
|
61
|
+
detail: "The shared fixes store did not contain this error signal.",
|
|
62
|
+
panel: "fix",
|
|
63
|
+
focus: error,
|
|
64
|
+
status: "warning",
|
|
65
|
+
});
|
|
21
66
|
console.log(chalk.yellow(`\n No known fixes for "${error}"`));
|
|
22
67
|
return;
|
|
23
68
|
}
|
|
69
|
+
await completeTask(task.id, "completed", `Found ${data.total} known fix result${data.total === 1 ? "" : "s"} for "${error}".`);
|
|
70
|
+
await recordSessionEvent({
|
|
71
|
+
kind: "query",
|
|
72
|
+
title: `Searched known fixes for "${error}"`,
|
|
73
|
+
detail: `Found ${data.total} candidate known fix result${data.total === 1 ? "" : "s"}.`,
|
|
74
|
+
panel: "fix",
|
|
75
|
+
focus: error,
|
|
76
|
+
status: "success",
|
|
77
|
+
});
|
|
24
78
|
console.log(chalk.bold(`\n Found ${data.total} fixes for "${error}":\n`));
|
|
25
79
|
data.results.forEach((r, i) => {
|
|
26
80
|
const pct = Math.round(r.confidence * 100);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type HubEntry = {
|
|
2
|
+
slug: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: "bundle" | "skill" | "connector";
|
|
5
|
+
description: string;
|
|
6
|
+
includes: string[];
|
|
7
|
+
nextSteps: string[];
|
|
8
|
+
installsConnector?: string;
|
|
9
|
+
};
|
|
10
|
+
export type HubCommandResult = {
|
|
11
|
+
action: "list" | "install" | "inspect" | "installed" | "registry" | "browse";
|
|
12
|
+
changed: boolean;
|
|
13
|
+
installedEntry?: HubEntry;
|
|
14
|
+
assetPath?: string;
|
|
15
|
+
filePaths?: string[];
|
|
16
|
+
recommendedConnector?: string;
|
|
17
|
+
};
|
|
18
|
+
export type HubRegistryEntry = HubEntry;
|
|
19
|
+
export declare function listHubRegistryEntries(): HubRegistryEntry[];
|
|
20
|
+
export declare function hubCommandAction(action: string, subAction?: string): Promise<HubCommandResult | void>;
|
|
21
|
+
export declare function hubCommand(cli: any): void;
|
|
22
|
+
export {};
|