umbrella-context 0.1.2 → 0.1.20
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/dist/commands/catalog.d.ts +33 -0
- package/dist/commands/catalog.js +211 -0
- package/dist/commands/connect.js +14 -14
- package/dist/commands/connectors.d.ts +15 -0
- package/dist/commands/connectors.js +620 -0
- package/dist/commands/curate.d.ts +1 -0
- package/dist/commands/curate.js +39 -3
- package/dist/commands/debug.d.ts +2 -0
- package/dist/commands/debug.js +55 -0
- package/dist/commands/hub.d.ts +20 -0
- package/dist/commands/hub.js +429 -0
- package/dist/commands/interactive.d.ts +2 -0
- package/dist/commands/interactive.js +918 -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 +211 -0
- package/dist/commands/providers.d.ts +17 -0
- package/dist/commands/providers.js +344 -0
- package/dist/commands/pull.js +10 -1
- package/dist/commands/push.js +18 -1
- package/dist/commands/restart.d.ts +2 -0
- package/dist/commands/restart.js +21 -0
- package/dist/commands/search.js +19 -1
- package/dist/commands/session.d.ts +2 -0
- package/dist/commands/session.js +128 -0
- package/dist/commands/space.d.ts +1 -0
- package/dist/commands/space.js +81 -63
- package/dist/commands/status.d.ts +25 -0
- package/dist/commands/status.js +104 -16
- package/dist/config.d.ts +23 -0
- package/dist/config.js +69 -0
- package/dist/index.js +26 -4
- package/dist/repo-state.d.ts +84 -0
- package/dist/repo-state.js +419 -3
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -21,6 +21,8 @@ export class ConfigManager {
|
|
|
21
21
|
projectName: this.conf.get("projectName"),
|
|
22
22
|
workspaceId: this.conf.get("workspaceId"),
|
|
23
23
|
workspaceName: this.conf.get("workspaceName"),
|
|
24
|
+
activeProvider: this.conf.get("activeProvider"),
|
|
25
|
+
activeModel: this.conf.get("activeModel"),
|
|
24
26
|
}
|
|
25
27
|
: null;
|
|
26
28
|
}
|
|
@@ -43,21 +45,88 @@ export class ConfigManager {
|
|
|
43
45
|
this.conf.set("workspaceId", config.workspaceId);
|
|
44
46
|
if (config.workspaceName)
|
|
45
47
|
this.conf.set("workspaceName", config.workspaceName);
|
|
48
|
+
if (Object.prototype.hasOwnProperty.call(config, "activeProvider")) {
|
|
49
|
+
if (config.activeProvider === undefined) {
|
|
50
|
+
this.conf.delete("activeProvider");
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.conf.set("activeProvider", config.activeProvider);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (Object.prototype.hasOwnProperty.call(config, "activeModel")) {
|
|
57
|
+
if (config.activeModel === undefined) {
|
|
58
|
+
this.conf.delete("activeModel");
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.conf.set("activeModel", config.activeModel);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
46
64
|
}
|
|
47
65
|
clear() {
|
|
48
66
|
this.conf.clear();
|
|
49
67
|
}
|
|
68
|
+
clearUmbrellaSession() {
|
|
69
|
+
this.conf.delete("umbrellaUrl");
|
|
70
|
+
this.conf.delete("serverUrl");
|
|
71
|
+
this.conf.delete("apiKey");
|
|
72
|
+
this.conf.delete("companyId");
|
|
73
|
+
this.conf.delete("companyName");
|
|
74
|
+
this.conf.delete("projectId");
|
|
75
|
+
this.conf.delete("projectName");
|
|
76
|
+
this.conf.delete("workspaceId");
|
|
77
|
+
this.conf.delete("workspaceName");
|
|
78
|
+
}
|
|
50
79
|
get locations() {
|
|
51
80
|
return this.conf.get("locations") ?? [];
|
|
52
81
|
}
|
|
82
|
+
get providers() {
|
|
83
|
+
return this.conf.get("providers") ?? [];
|
|
84
|
+
}
|
|
53
85
|
upsertLocation(location) {
|
|
54
86
|
const locations = this.locations.filter((entry) => entry.repoRoot !== location.repoRoot);
|
|
55
87
|
locations.push(location);
|
|
56
88
|
this.conf.set("locations", locations.sort((a, b) => a.repoRoot.localeCompare(b.repoRoot)));
|
|
57
89
|
}
|
|
90
|
+
upsertProvider(provider) {
|
|
91
|
+
const providers = this.providers.filter((entry) => entry.id !== provider.id && entry.name.toLowerCase() !== provider.name.toLowerCase());
|
|
92
|
+
providers.push(provider);
|
|
93
|
+
this.conf.set("providers", providers.sort((a, b) => a.name.localeCompare(b.name)));
|
|
94
|
+
}
|
|
95
|
+
removeProvider(id) {
|
|
96
|
+
const providers = this.providers.filter((entry) => entry.id !== id);
|
|
97
|
+
this.conf.set("providers", providers);
|
|
98
|
+
const current = this.config;
|
|
99
|
+
if (current?.activeProvider === id) {
|
|
100
|
+
this.conf.delete("activeProvider");
|
|
101
|
+
this.conf.delete("activeModel");
|
|
102
|
+
}
|
|
103
|
+
}
|
|
58
104
|
get configPath() {
|
|
59
105
|
return this.conf.path
|
|
60
106
|
?? path.join(os.homedir(), ".config", "umbrella-context", "config.json");
|
|
61
107
|
}
|
|
108
|
+
get hubRegistries() {
|
|
109
|
+
const stored = this.conf.get("hubRegistries") ?? [];
|
|
110
|
+
if (stored.length > 0) {
|
|
111
|
+
return stored;
|
|
112
|
+
}
|
|
113
|
+
return [
|
|
114
|
+
{
|
|
115
|
+
id: "umbrella-default",
|
|
116
|
+
name: "Umbrella Hub",
|
|
117
|
+
url: "https://hub.umbrella.local/default",
|
|
118
|
+
updatedAt: new Date(0).toISOString(),
|
|
119
|
+
},
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
upsertHubRegistry(registry) {
|
|
123
|
+
const registries = this.hubRegistries.filter((entry) => entry.id !== registry.id && entry.url !== registry.url);
|
|
124
|
+
registries.push(registry);
|
|
125
|
+
this.conf.set("hubRegistries", registries.sort((a, b) => a.name.localeCompare(b.name)));
|
|
126
|
+
}
|
|
127
|
+
removeHubRegistry(id) {
|
|
128
|
+
const registries = this.hubRegistries.filter((entry) => entry.id !== id);
|
|
129
|
+
this.conf.set("hubRegistries", registries);
|
|
130
|
+
}
|
|
62
131
|
}
|
|
63
132
|
export const configManager = new ConfigManager();
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,15 @@ import { curateCommand } from "./commands/curate.js";
|
|
|
13
13
|
import { statusCommand } from "./commands/status.js";
|
|
14
14
|
import { locationsCommand } from "./commands/locations.js";
|
|
15
15
|
import { spaceCommand } from "./commands/space.js";
|
|
16
|
+
import { providersCommand } from "./commands/providers.js";
|
|
17
|
+
import { modelCommand } from "./commands/model.js";
|
|
18
|
+
import { hubCommand } from "./commands/hub.js";
|
|
19
|
+
import { connectorsCommand } from "./commands/connectors.js";
|
|
20
|
+
import { logoutCommand } from "./commands/logout.js";
|
|
21
|
+
import { restartCommand } from "./commands/restart.js";
|
|
22
|
+
import { debugCommand } from "./commands/debug.js";
|
|
23
|
+
import { sessionCommand } from "./commands/session.js";
|
|
24
|
+
import { curateViewCommandAction } from "./commands/curate.js";
|
|
16
25
|
const cli = cac("umbrella-context");
|
|
17
26
|
cli.option("--config <path>", "Path to config file");
|
|
18
27
|
import { seedCommand } from "./commands/seed.js";
|
|
@@ -30,13 +39,26 @@ curateCommand(cli);
|
|
|
30
39
|
statusCommand(cli);
|
|
31
40
|
locationsCommand(cli);
|
|
32
41
|
spaceCommand(cli);
|
|
42
|
+
providersCommand(cli);
|
|
43
|
+
modelCommand(cli);
|
|
44
|
+
hubCommand(cli);
|
|
45
|
+
connectorsCommand(cli);
|
|
46
|
+
logoutCommand(cli);
|
|
47
|
+
restartCommand(cli);
|
|
48
|
+
debugCommand(cli);
|
|
49
|
+
sessionCommand(cli);
|
|
33
50
|
cli.command("query [...args]", "Alias for search").action(async (args) => {
|
|
34
51
|
const { searchCommandAction } = await import("./commands/search.js");
|
|
35
52
|
await searchCommandAction(args.join(" "));
|
|
36
53
|
});
|
|
37
|
-
cli.command("", "Interactive mode").action(async () => {
|
|
38
|
-
await interactiveCommand([]);
|
|
39
|
-
});
|
|
40
54
|
cli.help();
|
|
41
|
-
cli.version("0.1.
|
|
55
|
+
cli.version("0.1.20");
|
|
56
|
+
const argv = process.argv.slice(2);
|
|
57
|
+
if (argv[0] === "curate" && argv[1] === "view" && argv.length === 2) {
|
|
58
|
+
await curateViewCommandAction();
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
42
61
|
cli.parse();
|
|
62
|
+
if (process.argv.length <= 2 && process.stdin.isTTY && process.stdout.isTTY) {
|
|
63
|
+
await interactiveCommand([]);
|
|
64
|
+
}
|
package/dist/repo-state.d.ts
CHANGED
|
@@ -34,6 +34,59 @@ export type RepoContextState = {
|
|
|
34
34
|
lastPushAt: null | string;
|
|
35
35
|
lastPullAt: null | string;
|
|
36
36
|
};
|
|
37
|
+
export type LocalConnectorEntry = {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
type: "hook" | "mcp" | "rule" | "skill";
|
|
41
|
+
description: string;
|
|
42
|
+
installedAt: string;
|
|
43
|
+
source: string;
|
|
44
|
+
};
|
|
45
|
+
export type LocalHubInstall = {
|
|
46
|
+
id: string;
|
|
47
|
+
slug: string;
|
|
48
|
+
name: string;
|
|
49
|
+
type: "bundle" | "skill" | "connector";
|
|
50
|
+
description: string;
|
|
51
|
+
installedAt: string;
|
|
52
|
+
registryName: string;
|
|
53
|
+
};
|
|
54
|
+
export type LocalConnectorRun = {
|
|
55
|
+
id: string;
|
|
56
|
+
connectorId: string;
|
|
57
|
+
connectorName: string;
|
|
58
|
+
status: "success" | "failure";
|
|
59
|
+
summary: string;
|
|
60
|
+
ranAt: string;
|
|
61
|
+
};
|
|
62
|
+
export type RepoSessionState = {
|
|
63
|
+
version: 1;
|
|
64
|
+
id: string;
|
|
65
|
+
startedAt: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
commandHistory: string[];
|
|
68
|
+
recentQueries: string[];
|
|
69
|
+
recentCurations: string[];
|
|
70
|
+
lastSummary: string | null;
|
|
71
|
+
currentPanel: string | null;
|
|
72
|
+
currentFocus: string | null;
|
|
73
|
+
panelHistory: string[];
|
|
74
|
+
recentProviderIds: string[];
|
|
75
|
+
recentModels: string[];
|
|
76
|
+
recentHubSlugs: string[];
|
|
77
|
+
recentConnectorSources: string[];
|
|
78
|
+
events: RepoSessionEvent[];
|
|
79
|
+
};
|
|
80
|
+
export type RepoSessionEvent = {
|
|
81
|
+
id: string;
|
|
82
|
+
at: string;
|
|
83
|
+
kind: "query" | "curate" | "push" | "pull" | "space" | "provider" | "model" | "hub" | "connector" | "session";
|
|
84
|
+
title: string;
|
|
85
|
+
detail: string | null;
|
|
86
|
+
panel: string | null;
|
|
87
|
+
focus: string | null;
|
|
88
|
+
status: "info" | "success" | "warning" | "failure";
|
|
89
|
+
};
|
|
37
90
|
export declare function findRepoRoot(startDir?: string): Promise<string>;
|
|
38
91
|
export declare function ensureRepoContext(config: AgentMemoryConfig, cwd?: string): Promise<string>;
|
|
39
92
|
export declare function getRepoContext(cwd?: string): Promise<{
|
|
@@ -50,4 +103,35 @@ export declare function getPulledMemories(cwd?: string): Promise<LocalMemoryEntr
|
|
|
50
103
|
export declare function setPulledFixes(fixes: LocalFixEntry[], cwd?: string): Promise<void>;
|
|
51
104
|
export declare function getPulledFixes(cwd?: string): Promise<LocalFixEntry[]>;
|
|
52
105
|
export declare function markPushCompleted(cwd?: string): Promise<RepoContextState>;
|
|
106
|
+
export declare function getInstalledConnectors(cwd?: string): Promise<LocalConnectorEntry[]>;
|
|
107
|
+
export declare function setInstalledConnectors(connectors: LocalConnectorEntry[], cwd?: string): Promise<void>;
|
|
108
|
+
export declare function getInstalledHubEntries(cwd?: string): Promise<LocalHubInstall[]>;
|
|
109
|
+
export declare function setInstalledHubEntries(entries: LocalHubInstall[], cwd?: string): Promise<void>;
|
|
110
|
+
export declare function writeHubAsset(slug: string, content: string, cwd?: string): Promise<string>;
|
|
111
|
+
export declare function writeHubAssetFiles(slug: string, files: Array<{
|
|
112
|
+
name: string;
|
|
113
|
+
content: string;
|
|
114
|
+
}>, cwd?: string): Promise<string[]>;
|
|
115
|
+
export declare function writeConnectorAsset(source: string, content: unknown, cwd?: string): Promise<string>;
|
|
116
|
+
export declare function writeConnectorAssetFiles(source: string, files: Array<{
|
|
117
|
+
name: string;
|
|
118
|
+
content: string;
|
|
119
|
+
}>, cwd?: string): Promise<string[]>;
|
|
120
|
+
export declare function getConnectorRuns(cwd?: string): Promise<LocalConnectorRun[]>;
|
|
121
|
+
export declare function addConnectorRun(input: Omit<LocalConnectorRun, "id" | "ranAt">, cwd?: string): Promise<LocalConnectorRun>;
|
|
122
|
+
export declare function writeConnectorRunReport(run: LocalConnectorRun, cwd?: string): Promise<string>;
|
|
123
|
+
export declare function getSessionState(cwd?: string): Promise<RepoSessionState | null>;
|
|
124
|
+
export declare function ensureSessionState(cwd?: string): Promise<RepoSessionState>;
|
|
125
|
+
export declare function resetSessionState(cwd?: string): Promise<RepoSessionState>;
|
|
126
|
+
export declare function updateSessionState(updater: (current: RepoSessionState) => RepoSessionState | Promise<RepoSessionState>, cwd?: string): Promise<RepoSessionState>;
|
|
127
|
+
export declare function recordSessionCommand(command: string, cwd?: string): Promise<RepoSessionState>;
|
|
128
|
+
export declare function recordSessionQuery(query: string, cwd?: string): Promise<RepoSessionState>;
|
|
129
|
+
export declare function recordSessionCuration(content: string, cwd?: string): Promise<RepoSessionState>;
|
|
130
|
+
export declare function setSessionSummary(summary: string | null, cwd?: string): Promise<RepoSessionState>;
|
|
131
|
+
export declare function setSessionPanel(panel: string | null, focus?: string | null, cwd?: string): Promise<RepoSessionState>;
|
|
132
|
+
export declare function recordSessionProvider(providerId: string, cwd?: string): Promise<RepoSessionState>;
|
|
133
|
+
export declare function recordSessionModel(modelId: string, cwd?: string): Promise<RepoSessionState>;
|
|
134
|
+
export declare function recordSessionHubEntry(slug: string, cwd?: string): Promise<RepoSessionState>;
|
|
135
|
+
export declare function recordSessionConnector(source: string, cwd?: string): Promise<RepoSessionState>;
|
|
136
|
+
export declare function recordSessionEvent(event: Omit<RepoSessionEvent, "at" | "id">, cwd?: string): Promise<RepoSessionState>;
|
|
53
137
|
export declare function summarizeLocalMemoryMatches(entries: LocalMemoryEntry[], query: string): LocalMemoryEntry[];
|