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
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentMemoryConfig } from "../config.js";
|
|
2
|
+
export type InteractiveContext = {
|
|
3
|
+
config: AgentMemoryConfig;
|
|
4
|
+
handleFix: (error: string, config: AgentMemoryConfig) => Promise<void>;
|
|
5
|
+
handleRecord: (parts: string[], config: AgentMemoryConfig) => Promise<void>;
|
|
6
|
+
handleSpaces: (config: AgentMemoryConfig) => Promise<void>;
|
|
7
|
+
handleHome: (config: AgentMemoryConfig) => Promise<void>;
|
|
8
|
+
handleRecent: (config: AgentMemoryConfig) => Promise<void>;
|
|
9
|
+
handleTimeline: () => Promise<void>;
|
|
10
|
+
handleHistory: () => Promise<void>;
|
|
11
|
+
handleSession: () => Promise<void>;
|
|
12
|
+
handleNewSession: () => Promise<void>;
|
|
13
|
+
handleRestart: () => Promise<void>;
|
|
14
|
+
handleDebug: () => Promise<void>;
|
|
15
|
+
handleLogout: () => Promise<void>;
|
|
16
|
+
handlePanel: () => Promise<void>;
|
|
17
|
+
handleContinue: () => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
export type CommandSpec = {
|
|
20
|
+
key: string;
|
|
21
|
+
usage: string;
|
|
22
|
+
description: string;
|
|
23
|
+
aliases?: string[];
|
|
24
|
+
action: (args: string[], context: InteractiveContext) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export declare const COMMAND_SPECS: CommandSpec[];
|
|
27
|
+
export declare function parseInteractiveInput(input: string): {
|
|
28
|
+
command: string;
|
|
29
|
+
args: string[];
|
|
30
|
+
raw: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function resolveCommand(name: string): CommandSpec | null;
|
|
33
|
+
export declare function renderCommandList(): string;
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { curateCommandAction } from "./curate.js";
|
|
2
|
+
import { pushCommandAction } from "./push.js";
|
|
3
|
+
import { pullCommandAction } from "./pull.js";
|
|
4
|
+
import { searchCommandAction } from "./search.js";
|
|
5
|
+
import { statusCommandAction } from "./status.js";
|
|
6
|
+
import { providersCommandAction } from "./providers.js";
|
|
7
|
+
import { modelCommandAction } from "./model.js";
|
|
8
|
+
import { spaceCommandAction } from "./space.js";
|
|
9
|
+
import { locationsCommandAction } from "./locations.js";
|
|
10
|
+
import { hubCommandAction } from "./hub.js";
|
|
11
|
+
import { connectorsCommandAction } from "./connectors.js";
|
|
12
|
+
export const COMMAND_SPECS = [
|
|
13
|
+
{
|
|
14
|
+
key: "home",
|
|
15
|
+
usage: "/home",
|
|
16
|
+
aliases: ["dashboard"],
|
|
17
|
+
description: "Show the current Context home view",
|
|
18
|
+
action: async (_args, context) => context.handleHome(context.config),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: "curate",
|
|
22
|
+
usage: "/curate <content>",
|
|
23
|
+
description: "Save a local context note into .um",
|
|
24
|
+
action: async (args) => {
|
|
25
|
+
if (args[0] === "view") {
|
|
26
|
+
const { curateViewCommandAction } = await import("./curate.js");
|
|
27
|
+
await curateViewCommandAction();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
await curateCommandAction(args.join(" "));
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "query",
|
|
35
|
+
usage: "/query <question>",
|
|
36
|
+
aliases: ["search"],
|
|
37
|
+
description: "Search local context first, then the server",
|
|
38
|
+
action: async (args) => searchCommandAction(args.join(" ")),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "push",
|
|
42
|
+
usage: "/push",
|
|
43
|
+
description: "Sync local .um notes to the server",
|
|
44
|
+
action: async () => pushCommandAction(),
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "pull",
|
|
48
|
+
usage: "/pull",
|
|
49
|
+
description: "Refresh the local .um snapshot from the server",
|
|
50
|
+
action: async () => pullCommandAction(),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "fix",
|
|
54
|
+
usage: "/fix <error>",
|
|
55
|
+
description: "Search known fixes",
|
|
56
|
+
action: async (args, context) => context.handleFix(args.join(" "), context.config),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "record",
|
|
60
|
+
usage: "/record <id> <success|failure>",
|
|
61
|
+
description: "Record whether a known fix worked",
|
|
62
|
+
action: async (args, context) => context.handleRecord(args, context.config),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "space",
|
|
66
|
+
usage: "/space list | /space switch",
|
|
67
|
+
aliases: ["spaces", "projects"],
|
|
68
|
+
description: "List or switch company spaces",
|
|
69
|
+
action: async (args, context) => {
|
|
70
|
+
if (args[0] === "list" || args[0] === "switch") {
|
|
71
|
+
await spaceCommandAction(args[0], args[1]);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
await context.handleSpaces(context.config);
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: "providers",
|
|
79
|
+
usage: "/providers list|inspect|recent|test|connect|switch|disconnect",
|
|
80
|
+
description: "Manage LLM providers on this device",
|
|
81
|
+
action: async (args) => {
|
|
82
|
+
await providersCommandAction(args[0] ?? "list");
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: "model",
|
|
87
|
+
usage: "/model list|inspect|recent|ready|switch",
|
|
88
|
+
description: "Choose the active model for the current provider",
|
|
89
|
+
action: async (args) => {
|
|
90
|
+
await modelCommandAction(args[0] ?? "list");
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: "status",
|
|
95
|
+
usage: "/status",
|
|
96
|
+
description: "Show current sync and model status",
|
|
97
|
+
action: async () => statusCommandAction(),
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
key: "panel",
|
|
101
|
+
usage: "/panel",
|
|
102
|
+
aliases: ["focus"],
|
|
103
|
+
description: "Show the current live session panel and focus",
|
|
104
|
+
action: async (_args, context) => context.handlePanel(),
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
key: "continue",
|
|
108
|
+
usage: "/continue",
|
|
109
|
+
aliases: ["resume"],
|
|
110
|
+
description: "Re-open the last session panel or focus",
|
|
111
|
+
action: async (_args, context) => context.handleContinue(),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
key: "locations",
|
|
115
|
+
usage: "/locations",
|
|
116
|
+
description: "List repos connected on this device",
|
|
117
|
+
action: async () => locationsCommandAction(),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: "recent",
|
|
121
|
+
usage: "/recent",
|
|
122
|
+
aliases: ["activity"],
|
|
123
|
+
description: "Show recent local drafts, pulls, and connector runs",
|
|
124
|
+
action: async (_args, context) => context.handleRecent(context.config),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: "timeline",
|
|
128
|
+
usage: "/timeline",
|
|
129
|
+
aliases: ["events"],
|
|
130
|
+
description: "Show the recent session timeline for this repo",
|
|
131
|
+
action: async (_args, context) => context.handleTimeline(),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: "history",
|
|
135
|
+
usage: "/history",
|
|
136
|
+
description: "Show commands used in this session",
|
|
137
|
+
action: async (_args, context) => context.handleHistory(),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: "session",
|
|
141
|
+
usage: "/session",
|
|
142
|
+
description: "Show the current terminal session summary",
|
|
143
|
+
action: async (_args, context) => context.handleSession(),
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: "new",
|
|
147
|
+
usage: "/new",
|
|
148
|
+
description: "Start a fresh terminal session without clearing repo context data",
|
|
149
|
+
action: async (_args, context) => context.handleNewSession(),
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: "restart",
|
|
153
|
+
usage: "/restart",
|
|
154
|
+
description: "Refresh the live terminal session and keep local .um data",
|
|
155
|
+
action: async (_args, context) => context.handleRestart(),
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "debug",
|
|
159
|
+
usage: "/debug",
|
|
160
|
+
description: "Show config paths, repo state, and session details",
|
|
161
|
+
action: async (_args, context) => context.handleDebug(),
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
key: "logout",
|
|
165
|
+
usage: "/logout",
|
|
166
|
+
description: "Disconnect this device from Umbrella Context",
|
|
167
|
+
action: async (_args, context) => context.handleLogout(),
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
key: "hub",
|
|
171
|
+
usage: "/hub list|install|inspect|recent|installed|registry",
|
|
172
|
+
description: "Browse, inspect, and install bundles, skills, and hub registries",
|
|
173
|
+
action: async (args) => {
|
|
174
|
+
await hubCommandAction(args[0] ?? "list", args[1]);
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
key: "connectors",
|
|
179
|
+
usage: "/connectors list|inspect|recent|outputs|install|run",
|
|
180
|
+
description: "Install and run repo connectors for hooks, MCP, rules, and skills",
|
|
181
|
+
action: async (args) => {
|
|
182
|
+
await connectorsCommandAction(args[0] ?? "list", args[1]);
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
];
|
|
186
|
+
function tokenizeInput(raw) {
|
|
187
|
+
const matches = raw.match(/"([^"]*)"|'([^']*)'|`([^`]*)`|[^\s]+/g) ?? [];
|
|
188
|
+
return matches.map((part) => part.replace(/^['"`]|['"`]$/g, ""));
|
|
189
|
+
}
|
|
190
|
+
export function parseInteractiveInput(input) {
|
|
191
|
+
const trimmed = input.trim();
|
|
192
|
+
const normalized = trimmed.startsWith("/") ? trimmed.slice(1) : trimmed;
|
|
193
|
+
const tokens = tokenizeInput(normalized);
|
|
194
|
+
const command = (tokens[0] ?? "").toLowerCase();
|
|
195
|
+
const args = tokens.slice(1);
|
|
196
|
+
return { command, args, raw: trimmed };
|
|
197
|
+
}
|
|
198
|
+
export function resolveCommand(name) {
|
|
199
|
+
return COMMAND_SPECS.find((entry) => entry.key === name || entry.aliases?.includes(name)) ?? null;
|
|
200
|
+
}
|
|
201
|
+
export function renderCommandList() {
|
|
202
|
+
const rows = COMMAND_SPECS.map((entry) => `${entry.usage.padEnd(34)} ${entry.description}`);
|
|
203
|
+
return [
|
|
204
|
+
"COMMANDS",
|
|
205
|
+
"------------------------------------------------------------",
|
|
206
|
+
...rows,
|
|
207
|
+
"------------------------------------------------------------",
|
|
208
|
+
"/help or / Show this command list",
|
|
209
|
+
"/exit Quit",
|
|
210
|
+
].join("\n");
|
|
211
|
+
}
|
package/dist/commands/connect.js
CHANGED
|
@@ -17,14 +17,14 @@ export function connectCommand(cli) {
|
|
|
17
17
|
.option("--api-key <key>", "Context API key")
|
|
18
18
|
.action(async (options) => {
|
|
19
19
|
const serverUrl = options.serverUrl?.trim();
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
20
|
+
const companyId = options.companyId?.trim() ?? options.workspaceId?.trim();
|
|
21
|
+
const companyName = options.companyName?.trim() ?? options.workspaceName?.trim();
|
|
22
|
+
const spaceId = options.spaceId?.trim() ?? options.projectId?.trim();
|
|
23
|
+
const spaceName = options.spaceName?.trim() ?? options.projectName?.trim();
|
|
24
|
+
const workspaceId = options.workspaceId?.trim() ?? companyId;
|
|
25
|
+
const workspaceName = options.workspaceName?.trim() ?? companyName;
|
|
26
26
|
const apiKey = options.apiKey?.trim();
|
|
27
|
-
if (!serverUrl || !
|
|
27
|
+
if (!serverUrl || !companyId || !companyName || !spaceId || !spaceName || !apiKey) {
|
|
28
28
|
console.log(chalk.red("\n Missing required connection details."));
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
@@ -46,20 +46,20 @@ export function connectCommand(cli) {
|
|
|
46
46
|
companyName,
|
|
47
47
|
workspaceId,
|
|
48
48
|
workspaceName,
|
|
49
|
-
projectId,
|
|
50
|
-
projectName,
|
|
49
|
+
projectId: spaceId,
|
|
50
|
+
projectName: spaceName,
|
|
51
51
|
apiKey,
|
|
52
52
|
});
|
|
53
53
|
configManager.upsertLocation({
|
|
54
54
|
repoRoot: process.cwd(),
|
|
55
|
-
companyId
|
|
56
|
-
companyName
|
|
57
|
-
projectId,
|
|
58
|
-
projectName,
|
|
55
|
+
companyId,
|
|
56
|
+
companyName,
|
|
57
|
+
projectId: spaceId,
|
|
58
|
+
projectName: spaceName,
|
|
59
59
|
updatedAt: new Date().toISOString(),
|
|
60
60
|
});
|
|
61
61
|
await ensureRepoContext(configManager.config);
|
|
62
|
-
console.log(chalk.green(`\n Connected: ${companyName} / ${
|
|
62
|
+
console.log(chalk.green(`\n Connected: ${companyName} / ${spaceName}`));
|
|
63
63
|
console.log(chalk.gray(` Config saved to ${configManager.configPath}`));
|
|
64
64
|
}
|
|
65
65
|
catch (err) {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ConnectorsCommandResult = {
|
|
2
|
+
action: "list" | "install" | "run" | "inspect" | "outputs";
|
|
3
|
+
changed: boolean;
|
|
4
|
+
connectorName?: string;
|
|
5
|
+
status?: "success" | "failure";
|
|
6
|
+
summary?: string;
|
|
7
|
+
assetPath?: string;
|
|
8
|
+
filePaths?: string[];
|
|
9
|
+
repoConfigPath?: string | null;
|
|
10
|
+
stagedMemoryId?: string | null;
|
|
11
|
+
reportPath?: string;
|
|
12
|
+
inspectedConnector?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function connectorsCommandAction(action: string, target?: string): Promise<ConnectorsCommandResult | void>;
|
|
15
|
+
export declare function connectorsCommand(cli: any): void;
|