@useavalon/caelence-agent 0.2.3-canary.1 → 0.2.3
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/desktop/src/App.tsx +9 -2919
- package/desktop/src/BubbleClip.tsx +1 -1
- package/desktop/src/ComposerAttach.tsx +2 -2
- package/desktop/src/DeskBoot.tsx +28 -0
- package/desktop/src/DeskChrome.tsx +360 -0
- package/desktop/src/DeskComposer.tsx +311 -0
- package/desktop/src/DeskSidebar.tsx +191 -0
- package/desktop/src/FilesPanel.tsx +104 -36
- package/desktop/src/FloatNotice.test.ts +12 -0
- package/desktop/src/FloatNotice.tsx +5 -2
- package/desktop/src/IntegrationsPanel.tsx +273 -0
- package/desktop/src/McpPanel.tsx +8 -8
- package/desktop/src/MemoryPanel.tsx +138 -0
- package/desktop/src/QueuePanel.tsx +123 -0
- package/desktop/src/SessionsPanel.tsx +174 -0
- package/desktop/src/SettingsPanel.tsx +181 -0
- package/desktop/src/SkillsPanel.tsx +28 -12
- package/desktop/src/TranscriptViews.tsx +637 -0
- package/desktop/src/api.ts +36 -0
- package/desktop/src/app.css +159 -11
- package/desktop/src/composer-files.ts +2 -2
- package/desktop/src/desk-keys.ts +45 -0
- package/desktop/src/desk-prefs.ts +29 -0
- package/desktop/src/desk-types.ts +92 -0
- package/desktop/src/desktop-turn.ts +271 -0
- package/desktop/src/queue.ts +1 -1
- package/desktop/src/session-search.test.ts +20 -0
- package/desktop/src/session-search.ts +13 -0
- package/desktop/src/session-select.test.ts +23 -0
- package/desktop/src/session-select.ts +32 -0
- package/desktop/src/useDeskDictation.ts +123 -0
- package/desktop/src/useDeskFiles.ts +180 -0
- package/desktop/src/useDeskNotice.ts +20 -0
- package/desktop/src/useDeskPicker.ts +189 -0
- package/desktop/src/useDeskPrefs.ts +30 -0
- package/desktop/src/useDeskRuntime.ts +109 -0
- package/desktop/src/useDeskSessions.ts +195 -0
- package/desktop/src/useDeskSlash.ts +31 -0
- package/desktop/src/useDeskTurns.ts +264 -0
- package/desktop/src/useDesktopApp.ts +286 -0
- package/desktop/src/user-display.ts +2 -2
- package/package.json +2 -2
- package/src/desktop/bridge.test.ts +13 -0
- package/src/desktop/bridge.ts +45 -19
- package/src/desktop/uploads.test.ts +6 -0
- package/src/desktop/uploads.ts +178 -66
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { SortAscendingIcon } from "@phosphor-icons/react/dist/csr/SortAscending";
|
|
2
|
+
import { SortDescendingIcon } from "@phosphor-icons/react/dist/csr/SortDescending";
|
|
3
|
+
import { type ReactElement, useEffect, useMemo, useState } from "react";
|
|
4
|
+
import type { PickerItem } from "./api";
|
|
5
|
+
import { type SessionSort, sessionMatches, sortSessions } from "./session-search";
|
|
6
|
+
import { pruneSelected, toggleOne, toggleVisible } from "./session-select";
|
|
7
|
+
|
|
8
|
+
export function SessionsPanel(
|
|
9
|
+
props: Readonly<{
|
|
10
|
+
sessions: PickerItem[];
|
|
11
|
+
busy: boolean;
|
|
12
|
+
onOpen: (id: string) => void;
|
|
13
|
+
onDelete: (ids: readonly string[]) => void | Promise<void>;
|
|
14
|
+
}>,
|
|
15
|
+
): ReactElement {
|
|
16
|
+
const [query, setQuery] = useState("");
|
|
17
|
+
const [sort, setSort] = useState<SessionSort>("newest");
|
|
18
|
+
const [selected, setSelected] = useState<ReadonlySet<string>>(() => new Set());
|
|
19
|
+
const [removing, setRemoving] = useState(false);
|
|
20
|
+
const visible = useMemo(
|
|
21
|
+
() =>
|
|
22
|
+
sortSessions(
|
|
23
|
+
props.sessions.filter((item) => sessionMatches(item, query)),
|
|
24
|
+
sort,
|
|
25
|
+
),
|
|
26
|
+
[props.sessions, query, sort],
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
const live = new Set(props.sessions.map((item) => item.id));
|
|
31
|
+
setSelected((prev) => pruneSelected(prev, live));
|
|
32
|
+
}, [props.sessions]);
|
|
33
|
+
|
|
34
|
+
const allVisibleSelected = visible.length > 0 && visible.every((item) => selected.has(item.id));
|
|
35
|
+
const someVisibleSelected = visible.some((item) => selected.has(item.id));
|
|
36
|
+
|
|
37
|
+
const deleteSelected = () => {
|
|
38
|
+
if (selected.size === 0 || removing) return;
|
|
39
|
+
setRemoving(true);
|
|
40
|
+
void Promise.resolve(props.onDelete([...selected])).finally(() => setRemoving(false));
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<div className="desk-integrations">
|
|
45
|
+
<p className="desk-integrations-lead">Open a past chat.</p>
|
|
46
|
+
<div className="desk-session-search">
|
|
47
|
+
<label className="desk-field">
|
|
48
|
+
<span className="visually-hidden">Search sessions</span>
|
|
49
|
+
<input
|
|
50
|
+
className="cel-input"
|
|
51
|
+
value={query}
|
|
52
|
+
placeholder="Search"
|
|
53
|
+
onChange={(event) => setQuery(event.target.value)}
|
|
54
|
+
/>
|
|
55
|
+
</label>
|
|
56
|
+
<button
|
|
57
|
+
type="button"
|
|
58
|
+
className={`desk-session-sort${sort === "oldest" ? " is-on" : ""}`}
|
|
59
|
+
aria-label={sort === "newest" ? "Newest first" : "Oldest first"}
|
|
60
|
+
aria-pressed={sort === "oldest"}
|
|
61
|
+
onClick={() => setSort((current) => (current === "newest" ? "oldest" : "newest"))}
|
|
62
|
+
>
|
|
63
|
+
{sort === "newest" ? (
|
|
64
|
+
<SortDescendingIcon size={16} weight="regular" aria-hidden="true" />
|
|
65
|
+
) : (
|
|
66
|
+
<SortAscendingIcon size={16} weight="regular" aria-hidden="true" />
|
|
67
|
+
)}
|
|
68
|
+
<span className="desk-session-sort-label">
|
|
69
|
+
<span
|
|
70
|
+
className={sort === "newest" ? "is-on" : undefined}
|
|
71
|
+
aria-hidden={sort !== "newest"}
|
|
72
|
+
>
|
|
73
|
+
Newest
|
|
74
|
+
</span>
|
|
75
|
+
<span
|
|
76
|
+
className={sort === "oldest" ? "is-on" : undefined}
|
|
77
|
+
aria-hidden={sort !== "oldest"}
|
|
78
|
+
>
|
|
79
|
+
Oldest
|
|
80
|
+
</span>
|
|
81
|
+
</span>
|
|
82
|
+
</button>
|
|
83
|
+
</div>
|
|
84
|
+
{props.sessions.length === 0 ? (
|
|
85
|
+
<p className="desk-side-empty">No saved sessions</p>
|
|
86
|
+
) : (
|
|
87
|
+
<>
|
|
88
|
+
<div className="desk-session-toolbar">
|
|
89
|
+
<SessionCheck
|
|
90
|
+
checked={allVisibleSelected}
|
|
91
|
+
indeterminate={someVisibleSelected && !allVisibleSelected}
|
|
92
|
+
disabled={visible.length === 0}
|
|
93
|
+
label="Select all"
|
|
94
|
+
onChange={() =>
|
|
95
|
+
setSelected((prev) =>
|
|
96
|
+
toggleVisible(
|
|
97
|
+
prev,
|
|
98
|
+
visible.map((item) => item.id),
|
|
99
|
+
allVisibleSelected,
|
|
100
|
+
),
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
/>
|
|
104
|
+
<span className="desk-session-toolbar-meta">
|
|
105
|
+
{selected.size > 0 ? `${selected.size} selected` : null}
|
|
106
|
+
</span>
|
|
107
|
+
<button
|
|
108
|
+
type="button"
|
|
109
|
+
className="cel-btn cel-btn--danger cel-btn--compact"
|
|
110
|
+
disabled={selected.size === 0 || removing}
|
|
111
|
+
onClick={deleteSelected}
|
|
112
|
+
>
|
|
113
|
+
{selected.size > 1 ? `Delete ${selected.size}` : "Delete"}
|
|
114
|
+
</button>
|
|
115
|
+
</div>
|
|
116
|
+
{visible.length === 0 ? (
|
|
117
|
+
<p className="desk-side-empty">No sessions match</p>
|
|
118
|
+
) : (
|
|
119
|
+
<ul className="desk-integration-list">
|
|
120
|
+
{visible.map((item) => (
|
|
121
|
+
<li key={item.id}>
|
|
122
|
+
<SessionCheck
|
|
123
|
+
checked={selected.has(item.id)}
|
|
124
|
+
label={`Select ${item.label}`}
|
|
125
|
+
onChange={() => setSelected((prev) => toggleOne(prev, item.id))}
|
|
126
|
+
/>
|
|
127
|
+
<div>
|
|
128
|
+
<p>{item.label}</p>
|
|
129
|
+
{item.hint ? <em>{item.hint}</em> : null}
|
|
130
|
+
</div>
|
|
131
|
+
<div className="desk-integration-actions">
|
|
132
|
+
<button
|
|
133
|
+
type="button"
|
|
134
|
+
className="cel-btn cel-btn--secondary cel-btn--compact"
|
|
135
|
+
disabled={props.busy}
|
|
136
|
+
onClick={() => props.onOpen(item.id)}
|
|
137
|
+
>
|
|
138
|
+
Open
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
</li>
|
|
142
|
+
))}
|
|
143
|
+
</ul>
|
|
144
|
+
)}
|
|
145
|
+
</>
|
|
146
|
+
)}
|
|
147
|
+
</div>
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function SessionCheck(
|
|
152
|
+
props: Readonly<{
|
|
153
|
+
checked: boolean;
|
|
154
|
+
indeterminate?: boolean;
|
|
155
|
+
disabled?: boolean;
|
|
156
|
+
label: string;
|
|
157
|
+
onChange: () => void;
|
|
158
|
+
}>,
|
|
159
|
+
): ReactElement {
|
|
160
|
+
return (
|
|
161
|
+
<label className="desk-session-check">
|
|
162
|
+
<input
|
|
163
|
+
type="checkbox"
|
|
164
|
+
checked={props.checked}
|
|
165
|
+
disabled={props.disabled}
|
|
166
|
+
ref={(node) => {
|
|
167
|
+
if (node) node.indeterminate = Boolean(props.indeterminate);
|
|
168
|
+
}}
|
|
169
|
+
onChange={props.onChange}
|
|
170
|
+
/>
|
|
171
|
+
<span className="visually-hidden">{props.label}</span>
|
|
172
|
+
</label>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { errorMessage } from "../../src/core/errors";
|
|
3
|
+
import {
|
|
4
|
+
type BridgeClient,
|
|
5
|
+
type DesktopSettings,
|
|
6
|
+
type DesktopState,
|
|
7
|
+
getSettings,
|
|
8
|
+
saveSettings,
|
|
9
|
+
} from "./api";
|
|
10
|
+
import type { ShowNotice, ThemeChoice } from "./desk-types";
|
|
11
|
+
|
|
12
|
+
export function SettingsPanel(
|
|
13
|
+
props: Readonly<{
|
|
14
|
+
bridge: BridgeClient;
|
|
15
|
+
theme: ThemeChoice;
|
|
16
|
+
onTheme: (theme: ThemeChoice) => void;
|
|
17
|
+
onSaved: (state: DesktopState) => void;
|
|
18
|
+
onNotice: ShowNotice;
|
|
19
|
+
}>,
|
|
20
|
+
): React.ReactElement {
|
|
21
|
+
const [settings, setSettings] = useState<DesktopSettings | null>(null);
|
|
22
|
+
const [apiKey, setApiKey] = useState("");
|
|
23
|
+
const [googleClientId, setGoogleClientId] = useState("");
|
|
24
|
+
const [microsoftClientId, setMicrosoftClientId] = useState("");
|
|
25
|
+
const [microsoftClientSecret, setMicrosoftClientSecret] = useState("");
|
|
26
|
+
const [loadFailed, setLoadFailed] = useState(false);
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
void getSettings(props.bridge)
|
|
30
|
+
.then(setSettings)
|
|
31
|
+
.catch((err: unknown) => {
|
|
32
|
+
setLoadFailed(true);
|
|
33
|
+
props.onNotice(errorMessage(err), "error");
|
|
34
|
+
});
|
|
35
|
+
}, [props.bridge, props.onNotice]);
|
|
36
|
+
|
|
37
|
+
if (!settings) {
|
|
38
|
+
return (
|
|
39
|
+
<div className="desk-settings">
|
|
40
|
+
<p className={loadFailed ? "desk-side-empty" : undefined}>
|
|
41
|
+
{loadFailed ? "Settings could not be loaded" : "Loading settings"}
|
|
42
|
+
</p>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<form
|
|
49
|
+
className="desk-settings"
|
|
50
|
+
onSubmit={(event) => {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
void (async () => {
|
|
53
|
+
try {
|
|
54
|
+
const result = await saveSettings(props.bridge, {
|
|
55
|
+
mode: settings.mode,
|
|
56
|
+
modelId: settings.modelId,
|
|
57
|
+
...(apiKey.trim() ? { apiKey: apiKey.trim() } : {}),
|
|
58
|
+
...(googleClientId.trim() ? { googleClientId: googleClientId.trim() } : {}),
|
|
59
|
+
...(microsoftClientId.trim() ? { microsoftClientId: microsoftClientId.trim() } : {}),
|
|
60
|
+
...(microsoftClientSecret.trim()
|
|
61
|
+
? { microsoftClientSecret: microsoftClientSecret.trim() }
|
|
62
|
+
: {}),
|
|
63
|
+
});
|
|
64
|
+
setSettings({
|
|
65
|
+
...settings,
|
|
66
|
+
hasApiKey: result.hasApiKey,
|
|
67
|
+
apiKeyHint: result.apiKeyHint,
|
|
68
|
+
hasGoogleOAuth: result.hasGoogleOAuth,
|
|
69
|
+
googleOAuthHint: result.googleOAuthHint,
|
|
70
|
+
hasMicrosoftOAuth: result.hasMicrosoftOAuth,
|
|
71
|
+
microsoftOAuthHint: result.microsoftOAuthHint,
|
|
72
|
+
});
|
|
73
|
+
setApiKey("");
|
|
74
|
+
setGoogleClientId("");
|
|
75
|
+
setMicrosoftClientId("");
|
|
76
|
+
setMicrosoftClientSecret("");
|
|
77
|
+
props.onSaved(result.state);
|
|
78
|
+
props.onNotice("Saved");
|
|
79
|
+
} catch (err) {
|
|
80
|
+
props.onNotice(errorMessage(err), "error");
|
|
81
|
+
}
|
|
82
|
+
})();
|
|
83
|
+
}}
|
|
84
|
+
>
|
|
85
|
+
<label>
|
|
86
|
+
<span>OpenRouter API key</span>
|
|
87
|
+
<input
|
|
88
|
+
className="cel-input"
|
|
89
|
+
type="password"
|
|
90
|
+
autoComplete="off"
|
|
91
|
+
spellCheck={false}
|
|
92
|
+
value={apiKey}
|
|
93
|
+
placeholder={settings.hasApiKey ? settings.apiKeyHint : "sk-or-…"}
|
|
94
|
+
onChange={(event) => setApiKey(event.target.value)}
|
|
95
|
+
/>
|
|
96
|
+
<em>
|
|
97
|
+
{settings.hasApiKey
|
|
98
|
+
? `Key on this machine · ${settings.apiKeyHint}`
|
|
99
|
+
: "Stored in ~/.harness on this machine"}
|
|
100
|
+
</em>
|
|
101
|
+
</label>
|
|
102
|
+
<label>
|
|
103
|
+
<span>Google OAuth client id</span>
|
|
104
|
+
<input
|
|
105
|
+
className="cel-input"
|
|
106
|
+
type="text"
|
|
107
|
+
autoComplete="off"
|
|
108
|
+
spellCheck={false}
|
|
109
|
+
value={googleClientId}
|
|
110
|
+
placeholder={settings.hasGoogleOAuth ? settings.googleOAuthHint : ""}
|
|
111
|
+
onChange={(event) => setGoogleClientId(event.target.value)}
|
|
112
|
+
/>
|
|
113
|
+
<em>
|
|
114
|
+
Google Workspace MCP has no dynamic client registration. Register a Desktop app in Google
|
|
115
|
+
Cloud. Loopback redirect and PKCE. No client secret.
|
|
116
|
+
</em>
|
|
117
|
+
</label>
|
|
118
|
+
<label>
|
|
119
|
+
<span>Microsoft Entra client id</span>
|
|
120
|
+
<input
|
|
121
|
+
className="cel-input"
|
|
122
|
+
type="text"
|
|
123
|
+
autoComplete="off"
|
|
124
|
+
spellCheck={false}
|
|
125
|
+
value={microsoftClientId}
|
|
126
|
+
placeholder={settings.hasMicrosoftOAuth ? settings.microsoftOAuthHint : ""}
|
|
127
|
+
onChange={(event) => setMicrosoftClientId(event.target.value)}
|
|
128
|
+
/>
|
|
129
|
+
</label>
|
|
130
|
+
<label>
|
|
131
|
+
<span>Microsoft Entra client secret</span>
|
|
132
|
+
<input
|
|
133
|
+
className="cel-input"
|
|
134
|
+
type="password"
|
|
135
|
+
autoComplete="off"
|
|
136
|
+
spellCheck={false}
|
|
137
|
+
value={microsoftClientSecret}
|
|
138
|
+
placeholder={settings.hasMicrosoftOAuth ? "••••" : ""}
|
|
139
|
+
onChange={(event) => setMicrosoftClientSecret(event.target.value)}
|
|
140
|
+
/>
|
|
141
|
+
<em>
|
|
142
|
+
Required for Microsoft 365 directory MCP. Register a public client in Entra. Dynamic
|
|
143
|
+
client registration is not supported. This server is users and groups, not Excel or
|
|
144
|
+
Outlook.
|
|
145
|
+
</em>
|
|
146
|
+
</label>
|
|
147
|
+
<label>
|
|
148
|
+
<span>Theme</span>
|
|
149
|
+
<span className="desk-select-wrap">
|
|
150
|
+
<select
|
|
151
|
+
className="cel-input desk-select"
|
|
152
|
+
value={props.theme}
|
|
153
|
+
onChange={(event) => props.onTheme(event.target.value as ThemeChoice)}
|
|
154
|
+
>
|
|
155
|
+
<option value="system">System</option>
|
|
156
|
+
<option value="light">Light</option>
|
|
157
|
+
<option value="dark">Dark</option>
|
|
158
|
+
</select>
|
|
159
|
+
</span>
|
|
160
|
+
<em>System follows the OS</em>
|
|
161
|
+
</label>
|
|
162
|
+
<label>
|
|
163
|
+
<span>Mode</span>
|
|
164
|
+
<span className="desk-select-wrap">
|
|
165
|
+
<select
|
|
166
|
+
className="cel-input desk-select"
|
|
167
|
+
value={settings.mode}
|
|
168
|
+
onChange={(event) => setSettings({ ...settings, mode: event.target.value })}
|
|
169
|
+
>
|
|
170
|
+
<option value="ask">Ask</option>
|
|
171
|
+
<option value="plan">Plan</option>
|
|
172
|
+
<option value="agent">Agent</option>
|
|
173
|
+
</select>
|
|
174
|
+
</span>
|
|
175
|
+
</label>
|
|
176
|
+
<button type="submit" className="cel-btn cel-btn--secondary cel-btn--compact">
|
|
177
|
+
Save
|
|
178
|
+
</button>
|
|
179
|
+
</form>
|
|
180
|
+
);
|
|
181
|
+
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type SkillsPage,
|
|
12
12
|
searchSkills,
|
|
13
13
|
} from "./api";
|
|
14
|
+
import type { ShowNotice } from "./desk-types";
|
|
14
15
|
import { formatSkillInstalls, omitCatalogSkill, skillMatches } from "./skill-search";
|
|
15
16
|
|
|
16
17
|
function skillTitle(item: PublicSkill): string {
|
|
@@ -39,6 +40,15 @@ function pendingSkillLabel(status: PublicSkill["status"]): string {
|
|
|
39
40
|
return "Adding";
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
function skillChangeNotice(
|
|
44
|
+
action: "add" | "remove",
|
|
45
|
+
status: PublicSkill["status"] | undefined,
|
|
46
|
+
): string {
|
|
47
|
+
if (action === "add") return "Added";
|
|
48
|
+
if (status === "project") return "Disabled";
|
|
49
|
+
return "Removed";
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
function SkillActions(
|
|
43
53
|
props: Readonly<{
|
|
44
54
|
item: PublicSkill;
|
|
@@ -147,7 +157,7 @@ function SkillsRemoteBlock(
|
|
|
147
157
|
}
|
|
148
158
|
if (props.remoteVisible.length === 0) return null;
|
|
149
159
|
return (
|
|
150
|
-
|
|
160
|
+
<div className="desk-integration-block">
|
|
151
161
|
<div className="desk-integration-split">
|
|
152
162
|
<p>skills.sh</p>
|
|
153
163
|
<em>Matches for “{props.query.trim()}”.</em>
|
|
@@ -158,12 +168,12 @@ function SkillsRemoteBlock(
|
|
|
158
168
|
onAdd={props.onAdd}
|
|
159
169
|
onRemove={props.onRemove}
|
|
160
170
|
/>
|
|
161
|
-
|
|
171
|
+
</div>
|
|
162
172
|
);
|
|
163
173
|
}
|
|
164
174
|
if (props.popular.length === 0) return null;
|
|
165
175
|
return (
|
|
166
|
-
|
|
176
|
+
<div className="desk-integration-block">
|
|
167
177
|
<div className="desk-integration-split">
|
|
168
178
|
<p>Popular on skills.sh</p>
|
|
169
179
|
<em>A short cached list. Type in the search bar to find more.</em>
|
|
@@ -174,7 +184,7 @@ function SkillsRemoteBlock(
|
|
|
174
184
|
onAdd={props.onAdd}
|
|
175
185
|
onRemove={props.onRemove}
|
|
176
186
|
/>
|
|
177
|
-
|
|
187
|
+
</div>
|
|
178
188
|
);
|
|
179
189
|
}
|
|
180
190
|
|
|
@@ -207,7 +217,7 @@ export function SkillsPanel(
|
|
|
207
217
|
bridge: BridgeClient;
|
|
208
218
|
query: string;
|
|
209
219
|
onQuery: (value: string) => void;
|
|
210
|
-
onNotice:
|
|
220
|
+
onNotice: ShowNotice;
|
|
211
221
|
}>,
|
|
212
222
|
): ReactElement {
|
|
213
223
|
const [page, setPage] = useState<SkillsPage | null>(null);
|
|
@@ -227,7 +237,7 @@ export function SkillsPanel(
|
|
|
227
237
|
.catch((err: unknown) => {
|
|
228
238
|
if (!alive) return;
|
|
229
239
|
setLoadFailed(true);
|
|
230
|
-
props.onNotice(errorMessage(err));
|
|
240
|
+
props.onNotice(errorMessage(err), "error");
|
|
231
241
|
});
|
|
232
242
|
void getPopularSkills(props.bridge)
|
|
233
243
|
.then((result) => {
|
|
@@ -257,7 +267,7 @@ export function SkillsPanel(
|
|
|
257
267
|
})
|
|
258
268
|
.catch((err: unknown) => {
|
|
259
269
|
if (!alive) return;
|
|
260
|
-
props.onNotice(errorMessage(err));
|
|
270
|
+
props.onNotice(errorMessage(err), "error");
|
|
261
271
|
});
|
|
262
272
|
}, 250);
|
|
263
273
|
return () => {
|
|
@@ -277,12 +287,18 @@ export function SkillsPanel(
|
|
|
277
287
|
|
|
278
288
|
const run = async (id: string, action: "add" | "remove"): Promise<void> => {
|
|
279
289
|
setPendingId(id);
|
|
290
|
+
const prior = [
|
|
291
|
+
...(page?.bundled ?? []),
|
|
292
|
+
...(page?.popular ?? []),
|
|
293
|
+
...(page?.loaded ?? []),
|
|
294
|
+
].find((item) => item.id === id);
|
|
280
295
|
try {
|
|
281
296
|
const result =
|
|
282
297
|
action === "add" ? await addSkill(props.bridge, id) : await removeSkill(props.bridge, id);
|
|
283
298
|
applyPage(result);
|
|
299
|
+
props.onNotice(skillChangeNotice(action, prior?.status));
|
|
284
300
|
} catch (err) {
|
|
285
|
-
props.onNotice(errorMessage(err));
|
|
301
|
+
props.onNotice(errorMessage(err), "error");
|
|
286
302
|
if (action === "add") {
|
|
287
303
|
setRemote((current) => (current ? omitCatalogSkill(current, id) : current));
|
|
288
304
|
setPage((current) =>
|
|
@@ -357,7 +373,7 @@ export function SkillsPanel(
|
|
|
357
373
|
) : (
|
|
358
374
|
<>
|
|
359
375
|
{!searching && loaded.length > 0 ? (
|
|
360
|
-
|
|
376
|
+
<div className="desk-integration-block">
|
|
361
377
|
<div className="desk-integration-split">
|
|
362
378
|
<p>Added</p>
|
|
363
379
|
<em>Installed for your user. Remove takes them out of ~/.harness/skills.</em>
|
|
@@ -368,10 +384,10 @@ export function SkillsPanel(
|
|
|
368
384
|
onAdd={(id) => void run(id, "add")}
|
|
369
385
|
onRemove={(id) => void run(id, "remove")}
|
|
370
386
|
/>
|
|
371
|
-
|
|
387
|
+
</div>
|
|
372
388
|
) : null}
|
|
373
389
|
{bundled.length > 0 ? (
|
|
374
|
-
|
|
390
|
+
<div className="desk-integration-block">
|
|
375
391
|
{searching ? null : (
|
|
376
392
|
<div className="desk-integration-split">
|
|
377
393
|
<p>Bundled</p>
|
|
@@ -383,7 +399,7 @@ export function SkillsPanel(
|
|
|
383
399
|
onAdd={(id) => void run(id, "add")}
|
|
384
400
|
onRemove={(id) => void run(id, "remove")}
|
|
385
401
|
/>
|
|
386
|
-
|
|
402
|
+
</div>
|
|
387
403
|
) : null}
|
|
388
404
|
<SkillsRemoteBlock
|
|
389
405
|
searching={searching}
|