@useavalon/caelence-agent 0.1.0 → 0.1.1-canary.1
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/LICENSE +21 -0
- package/README.md +129 -137
- package/brand/logo/favicon-agent-bg-16.svg +7 -0
- package/brand/logo/favicon-agent-bg-32.svg +7 -0
- package/brand/previews/desktop-chat.png +0 -0
- package/brand/previews/desktop-commands.png +0 -0
- package/brand/previews/desktop-integrations.png +0 -0
- package/brand/previews/desktop-skills.png +0 -0
- package/package.json +5 -3
- package/skills/impeccable/LICENSE +13 -0
- package/skills/impeccable/NOTICE +14 -0
- package/skills/impeccable/SKILL.md +2 -1
- package/src/agent-cwd.ts +51 -0
- package/src/cli/agent-cwd.test.ts +65 -0
- package/src/cli/main.test.ts +5 -0
- package/src/cli/main.ts +282 -201
- package/src/cli/picker.test.ts +59 -1
- package/src/cli/picker.ts +46 -0
- package/src/cli/slash-dispatch.test.ts +116 -7
- package/src/cli/slash-dispatch.ts +343 -174
- package/src/cli/slash.test.ts +25 -2
- package/src/cli/slash.ts +37 -8
- package/src/cli/theme.test.ts +7 -0
- package/src/cli/theme.ts +6 -6
- package/src/cli/tui.tsx +385 -217
- package/src/config.ts +1 -1
- package/src/core/strands.ts +10 -1
- package/src/desktop/bridge.test.ts +56 -1
- package/src/desktop/bridge.ts +527 -390
- package/src/desktop/uploads.test.ts +57 -0
- package/src/desktop/uploads.ts +92 -0
- package/src/index.ts +26 -2
- package/src/init.test.ts +19 -2
- package/src/init.ts +25 -17
- package/src/integrations/loopback.test.ts +17 -0
- package/src/integrations/loopback.ts +91 -0
- package/src/observability/prompts.ts +1 -1
- package/src/product.ts +3 -1
- package/src/runtime.test.ts +24 -0
- package/src/runtime.ts +48 -5
- package/src/skills/catalog.test.ts +188 -0
- package/src/skills/catalog.ts +279 -0
- package/src/skills/disabled.test.ts +27 -0
- package/src/skills/disabled.ts +59 -0
- package/src/skills/loader.test.ts +31 -0
- package/src/skills/loader.ts +31 -4
- package/src/skills/registry.test.ts +64 -3
- package/src/skills/registry.ts +248 -93
- package/src/skills/skill-command.ts +2 -0
package/src/cli/slash.ts
CHANGED
|
@@ -10,9 +10,10 @@ export const SLASH_COMMANDS: SlashCommand[] = [
|
|
|
10
10
|
{ name: "help", hint: "this list" },
|
|
11
11
|
{ name: "skills", hint: "loaded skills" },
|
|
12
12
|
{ name: "skill add", hint: "install a bundled or skills.sh skill", arg: true },
|
|
13
|
-
{ name: "skill find", hint: "
|
|
13
|
+
{ name: "skill find", hint: "browse bundled and skills.sh", arg: true, slot: "[query]" },
|
|
14
14
|
{ name: "skill new", hint: "author a project skill", arg: true },
|
|
15
15
|
{ name: "skill remove", hint: "remove a user skill", arg: true },
|
|
16
|
+
{ name: "integrations", hint: "connect MCP servers" },
|
|
16
17
|
{ name: "eval", hint: "run an eval suite", arg: true, slot: "[name]" },
|
|
17
18
|
{ name: "clear", hint: "new session" },
|
|
18
19
|
{ name: "resume", hint: "pick a session by title" },
|
|
@@ -60,6 +61,8 @@ export const PICKS_WHEN_EMPTY = new Set([
|
|
|
60
61
|
"image",
|
|
61
62
|
"video",
|
|
62
63
|
"transcribe",
|
|
64
|
+
"integrations",
|
|
65
|
+
"skill find",
|
|
63
66
|
]);
|
|
64
67
|
|
|
65
68
|
/** Empty submit stays in the composer until the argument is typed. */
|
|
@@ -70,20 +73,27 @@ export type SlashSubmit =
|
|
|
70
73
|
| { action: "complete"; line: string }
|
|
71
74
|
| { action: "hold" };
|
|
72
75
|
|
|
76
|
+
function acceptSlashChoice(command: SlashCommand): SlashSubmit {
|
|
77
|
+
if (REQUIRES_ARG.has(command.name)) {
|
|
78
|
+
return { action: "complete", line: completeSlashCommand(command) };
|
|
79
|
+
}
|
|
80
|
+
return { action: "send", line: `/${command.name}` };
|
|
81
|
+
}
|
|
82
|
+
|
|
73
83
|
/**
|
|
74
|
-
* Enter on a slash line.
|
|
75
|
-
*
|
|
84
|
+
* Enter on a slash line. A highlighted menu item is accepted even when the
|
|
85
|
+
* typed prefix is still ambiguous. Unique prefixes complete. Unknown prefixes
|
|
86
|
+
* are not sent as chat.
|
|
76
87
|
*/
|
|
77
|
-
export function resolveSlashSubmit(raw: string): SlashSubmit | null {
|
|
88
|
+
export function resolveSlashSubmit(raw: string, selected?: SlashCommand): SlashSubmit | null {
|
|
78
89
|
const trimmed = raw.trim();
|
|
79
90
|
if (!trimmed.startsWith("/") && !isHelpAlias(trimmed)) return null;
|
|
80
91
|
if (isHelpAlias(trimmed)) return { action: "send", line: "/help" };
|
|
81
|
-
if (trimmed === "/") return { action: "hold" };
|
|
82
92
|
|
|
83
93
|
const { cmd, arg } = parseSlashLine(trimmed);
|
|
84
94
|
const typed = trimmed.replace(/^\//, "").trim().toLowerCase();
|
|
85
95
|
const exact = SLASH_COMMANDS.find((item) => item.name === cmd);
|
|
86
|
-
if (exact && (typed === exact.name || typed.startsWith(`${exact.name} `))) {
|
|
96
|
+
if (exact && typed && (typed === exact.name || typed.startsWith(`${exact.name} `))) {
|
|
87
97
|
if (!arg && REQUIRES_ARG.has(exact.name)) {
|
|
88
98
|
return { action: "complete", line: completeSlashCommand(exact) };
|
|
89
99
|
}
|
|
@@ -92,6 +102,9 @@ export function resolveSlashSubmit(raw: string): SlashSubmit | null {
|
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
const matches = filterSlashCommands(trimmed);
|
|
105
|
+
if (selected && matches.some((item) => item.name === selected.name)) {
|
|
106
|
+
return acceptSlashChoice(selected);
|
|
107
|
+
}
|
|
95
108
|
if (matches.length === 1 && matches[0]) {
|
|
96
109
|
return { action: "complete", line: completeSlashCommand(matches[0]) };
|
|
97
110
|
}
|
|
@@ -110,8 +123,24 @@ export function isHelpAlias(text: string): boolean {
|
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
export function formatSkillList(skills: Array<{ name: string; source: string }>): string {
|
|
113
|
-
if (skills.length === 0)
|
|
114
|
-
|
|
126
|
+
if (skills.length === 0) {
|
|
127
|
+
return "No skills loaded. /skill add copywriting or /skill find";
|
|
128
|
+
}
|
|
129
|
+
return skills
|
|
130
|
+
.map((skill) => `${skill.name} ${skill.source === "host" ? "project" : skill.source}`)
|
|
131
|
+
.join("\n");
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function formatIntegrationList(
|
|
135
|
+
items: Array<{ label: string; connected: boolean; auth?: string }>,
|
|
136
|
+
): string {
|
|
137
|
+
if (items.length === 0) return "No integrations.";
|
|
138
|
+
return items
|
|
139
|
+
.map((item) => {
|
|
140
|
+
const state = item.connected ? "on" : "off";
|
|
141
|
+
return `${item.label} ${state}`;
|
|
142
|
+
})
|
|
143
|
+
.join("\n");
|
|
115
144
|
}
|
|
116
145
|
|
|
117
146
|
export const SLASH_HELP = SLASH_COMMANDS.map(
|
package/src/cli/theme.test.ts
CHANGED
|
@@ -7,4 +7,11 @@ describe("theme", () => {
|
|
|
7
7
|
expect(resolveTheme("plain").name).toBe(PLAIN_THEME.name);
|
|
8
8
|
expect(resolveTheme({ ...CAELENCE_THEME, danger: "#ff0000" }).danger).toBe("#ff0000");
|
|
9
9
|
});
|
|
10
|
+
|
|
11
|
+
test("uses instrument blue instead of brand green", () => {
|
|
12
|
+
expect(CAELENCE_THEME.brand).toBe("#6e93b8");
|
|
13
|
+
expect(CAELENCE_THEME.action).toBe("#6e93b8");
|
|
14
|
+
expect(CAELENCE_THEME.done).toBe("#6e93b8");
|
|
15
|
+
expect(PLAIN_THEME.brand).toBe("blue");
|
|
16
|
+
});
|
|
10
17
|
});
|
package/src/cli/theme.ts
CHANGED
|
@@ -15,26 +15,26 @@ export interface Theme {
|
|
|
15
15
|
/** Dark-terminal mapping of Caelence role colours. */
|
|
16
16
|
export const CAELENCE_THEME: Theme = {
|
|
17
17
|
name: "caelence",
|
|
18
|
-
brand: "#
|
|
19
|
-
action: "#
|
|
18
|
+
brand: "#6e93b8",
|
|
19
|
+
action: "#6e93b8",
|
|
20
20
|
ink: "#E8E4DC",
|
|
21
21
|
muted: "#9A958C",
|
|
22
22
|
line: "#5C5A55",
|
|
23
23
|
danger: "#E4796E",
|
|
24
24
|
warning: "#D4A054",
|
|
25
|
-
done: "#
|
|
25
|
+
done: "#6e93b8",
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export const PLAIN_THEME: Theme = {
|
|
29
29
|
name: "plain",
|
|
30
|
-
brand: "
|
|
31
|
-
action: "
|
|
30
|
+
brand: "blue",
|
|
31
|
+
action: "blue",
|
|
32
32
|
ink: "white",
|
|
33
33
|
muted: "gray",
|
|
34
34
|
line: "gray",
|
|
35
35
|
danger: "red",
|
|
36
36
|
warning: "yellow",
|
|
37
|
-
done: "
|
|
37
|
+
done: "blue",
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export function resolveTheme(theme: ThemeName | Theme | undefined): Theme {
|