@chrysb/alphaclaw 0.8.1-beta.6 → 0.8.1-beta.7
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.
|
@@ -93,6 +93,7 @@ export const GmailSetupWizard = ({
|
|
|
93
93
|
const [watchEnabled, setWatchEnabled] = useState(false);
|
|
94
94
|
const [sendingToAgent, setSendingToAgent] = useState(false);
|
|
95
95
|
const [agentMessageSent, setAgentMessageSent] = useState(false);
|
|
96
|
+
const [existingWebhookAtOpen, setExistingWebhookAtOpen] = useState(false);
|
|
96
97
|
|
|
97
98
|
const {
|
|
98
99
|
selectedSessionKey,
|
|
@@ -123,6 +124,7 @@ export const GmailSetupWizard = ({
|
|
|
123
124
|
setWatchEnabled(false);
|
|
124
125
|
setSendingToAgent(false);
|
|
125
126
|
setAgentMessageSent(false);
|
|
127
|
+
setExistingWebhookAtOpen(Boolean(clientConfig?.webhookExists));
|
|
126
128
|
}, [visible, account?.id]);
|
|
127
129
|
|
|
128
130
|
const commands = clientConfig?.commands || null;
|
|
@@ -135,7 +137,7 @@ export const GmailSetupWizard = ({
|
|
|
135
137
|
String(projectIdInput || "").trim() ||
|
|
136
138
|
String(clientConfig?.projectId || "").trim() ||
|
|
137
139
|
"<project-id>";
|
|
138
|
-
const hasExistingWebhookSetup =
|
|
140
|
+
const hasExistingWebhookSetup = existingWebhookAtOpen;
|
|
139
141
|
const stepTitles = hasExistingWebhookSetup ? kTutorialStepTitles : kSetupStepTitles;
|
|
140
142
|
const totalSteps = stepTitles.length;
|
|
141
143
|
const client =
|
|
@@ -26,40 +26,43 @@ export const SessionSelectField = ({
|
|
|
26
26
|
statusClassName = "text-xs text-gray-500",
|
|
27
27
|
errorClassName = "text-xs text-red-400",
|
|
28
28
|
}) => {
|
|
29
|
+
const resolvedValue = selectedSessionKey || (allowNone ? noneValue : "");
|
|
30
|
+
const isDisabled = disabled || loading;
|
|
29
31
|
return html`
|
|
30
32
|
<div class=${containerClassName}>
|
|
31
33
|
${label
|
|
32
34
|
? html`<label class=${labelClassName}>${label}</label>`
|
|
33
35
|
: null}
|
|
34
36
|
<select
|
|
35
|
-
value=${
|
|
37
|
+
value=${resolvedValue}
|
|
36
38
|
onInput=${(event) => {
|
|
37
39
|
const nextValue = String(event.currentTarget?.value || "");
|
|
38
40
|
onChangeSessionKey(allowNone && nextValue === noneValue ? "" : nextValue);
|
|
39
41
|
}}
|
|
40
|
-
disabled=${
|
|
42
|
+
disabled=${isDisabled}
|
|
41
43
|
class=${selectClassName}
|
|
42
44
|
>
|
|
43
|
-
${
|
|
44
|
-
? html`<option value=${
|
|
45
|
-
:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
${
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
${loading
|
|
46
|
+
? html`<option value=${resolvedValue || ""}>${loadingLabel}</option>`
|
|
47
|
+
: html`
|
|
48
|
+
${allowNone
|
|
49
|
+
? html`<option value=${noneValue}>${noneLabel}</option>`
|
|
50
|
+
: null}
|
|
51
|
+
${!allowNone && sessions.length === 0
|
|
52
|
+
? html`<option value="">${emptyOptionLabel}</option>`
|
|
53
|
+
: null}
|
|
54
|
+
${sessions.map(
|
|
55
|
+
(sessionRow) => html`
|
|
56
|
+
<option value=${getSessionRowKey(sessionRow)}>
|
|
57
|
+
${String(sessionRow?.label || getSessionRowKey(sessionRow) || "Session")}
|
|
58
|
+
</option>
|
|
59
|
+
`,
|
|
60
|
+
)}
|
|
61
|
+
`}
|
|
56
62
|
</select>
|
|
57
63
|
${helperText
|
|
58
64
|
? html`<div class=${helperClassName}>${helperText}</div>`
|
|
59
65
|
: null}
|
|
60
|
-
${loading
|
|
61
|
-
? html`<div class=${statusClassName}>${loadingLabel}</div>`
|
|
62
|
-
: null}
|
|
63
66
|
${error
|
|
64
67
|
? html`<div class=${errorClassName}>${error}</div>`
|
|
65
68
|
: null}
|
|
@@ -16,9 +16,17 @@ const buildGithubHeaders = (githubToken) => ({
|
|
|
16
16
|
const parseGithubErrorMessage = async (response) => {
|
|
17
17
|
try {
|
|
18
18
|
const payload = await response.json();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const base =
|
|
20
|
+
typeof payload?.message === "string" ? payload.message.trim() : "";
|
|
21
|
+
const detail = Array.isArray(payload?.errors)
|
|
22
|
+
? payload.errors
|
|
23
|
+
.map((e) => (typeof e?.message === "string" ? e.message.trim() : ""))
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join("; ")
|
|
26
|
+
: "";
|
|
27
|
+
if (base && detail) return `${base} (${detail})`;
|
|
28
|
+
if (base) return base;
|
|
29
|
+
if (detail) return detail;
|
|
22
30
|
} catch {}
|
|
23
31
|
return response.statusText || `HTTP ${response.status}`;
|
|
24
32
|
};
|
|
@@ -165,7 +173,7 @@ const ensureGithubRepoAccessible = async ({
|
|
|
165
173
|
return {
|
|
166
174
|
ok: false,
|
|
167
175
|
status: 400,
|
|
168
|
-
error: `Failed to create repo: ${details}
|
|
176
|
+
error: `Failed to create repo: ${details.replace(/\.$/, "")}${hint ? `. ${hint.trim()}` : ""}`,
|
|
169
177
|
};
|
|
170
178
|
}
|
|
171
179
|
console.log(`[onboard] Repo ${repoUrl} created`);
|