@hyperwindmill/caretaker-cli 0.34.0 → 0.35.0
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/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +16 -0
- package/dist/cli/orchestrator_demo.d.ts +39 -0
- package/dist/cli/orchestrator_demo.d.ts.map +1 -0
- package/dist/cli/orchestrator_demo.js +98 -0
- package/dist/cli/web/api_access.d.ts.map +1 -1
- package/dist/cli/web/api_access.js +1 -1
- package/dist/cli/web/openapi.d.ts +5 -0
- package/dist/cli/web/openapi.d.ts.map +1 -1
- package/dist/cli/web/openapi.js +37 -0
- package/dist/cli/web/orchestrator.d.ts +51 -0
- package/dist/cli/web/orchestrator.d.ts.map +1 -0
- package/dist/cli/web/orchestrator.js +596 -0
- package/dist/cli/web/orchestrator_core.d.ts +83 -0
- package/dist/cli/web/orchestrator_core.d.ts.map +1 -0
- package/dist/cli/web/orchestrator_core.js +219 -0
- package/dist/cli/web/save_config.d.ts +8 -0
- package/dist/cli/web/save_config.d.ts.map +1 -0
- package/dist/cli/web/save_config.js +9 -0
- package/dist/cli/web/scheduler/task_strategy.d.ts.map +1 -1
- package/dist/cli/web/scheduler/task_strategy.js +21 -2
- package/dist/cli/web/server.d.ts +3 -0
- package/dist/cli/web/server.d.ts.map +1 -1
- package/dist/cli/web/server.js +14 -16
- package/dist/lib/task_git.d.ts +3 -0
- package/dist/lib/task_git.d.ts.map +1 -1
- package/dist/lib/task_git.js +29 -0
- package/dist/store/orchestrator.d.ts +50 -0
- package/dist/store/orchestrator.d.ts.map +1 -0
- package/dist/store/orchestrator.js +127 -0
- package/dist/webview/standalone.css +159 -1
- package/dist/webview/standalone.css.map +2 -2
- package/dist/webview/standalone.js +784 -504
- package/dist/webview/standalone.js.map +4 -4
- package/package.json +3 -3
|
@@ -14583,11 +14583,11 @@
|
|
|
14583
14583
|
});
|
|
14584
14584
|
|
|
14585
14585
|
// src/standalone.tsx
|
|
14586
|
-
var
|
|
14586
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
14587
14587
|
var import_client = __toESM(require_client(), 1);
|
|
14588
14588
|
|
|
14589
14589
|
// src/App.tsx
|
|
14590
|
-
var
|
|
14590
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
14591
14591
|
|
|
14592
14592
|
// src/assistant_activation.ts
|
|
14593
14593
|
function beginActivation(agentId, confirmedAgentId, knownAgentIds, current) {
|
|
@@ -17392,7 +17392,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
17392
17392
|
}
|
|
17393
17393
|
|
|
17394
17394
|
// src/SettingsPanel.tsx
|
|
17395
|
-
var
|
|
17395
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
17396
17396
|
|
|
17397
17397
|
// src/ProvidersTab.tsx
|
|
17398
17398
|
var import_react7 = __toESM(require_react(), 1);
|
|
@@ -23118,8 +23118,323 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23118
23118
|
] });
|
|
23119
23119
|
}
|
|
23120
23120
|
|
|
23121
|
-
// src/
|
|
23121
|
+
// src/OrchestrationTab.tsx
|
|
23122
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
23122
23123
|
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
23124
|
+
function relativeTime(iso) {
|
|
23125
|
+
if (!iso) return "never";
|
|
23126
|
+
const diffSec = Math.max(0, Math.round((Date.now() - Date.parse(iso)) / 1e3));
|
|
23127
|
+
if (diffSec < 60) return `${diffSec}s ago`;
|
|
23128
|
+
const diffMin = Math.round(diffSec / 60);
|
|
23129
|
+
if (diffMin < 60) return `${diffMin}m ago`;
|
|
23130
|
+
return `${Math.round(diffMin / 60)}h ago`;
|
|
23131
|
+
}
|
|
23132
|
+
function formatTime(iso) {
|
|
23133
|
+
const d = new Date(iso);
|
|
23134
|
+
if (Number.isNaN(d.getTime())) return iso;
|
|
23135
|
+
return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
23136
|
+
}
|
|
23137
|
+
function statusText(status) {
|
|
23138
|
+
switch (status.state) {
|
|
23139
|
+
case "off":
|
|
23140
|
+
return "Off";
|
|
23141
|
+
case "registering":
|
|
23142
|
+
return "Registering\u2026";
|
|
23143
|
+
case "connected": {
|
|
23144
|
+
const target = status.orchestratorName ? `"${status.orchestratorName}"` : "orchestrator";
|
|
23145
|
+
return `Connected to ${target} \xB7 last poll ${relativeTime(status.lastPollAt)}`;
|
|
23146
|
+
}
|
|
23147
|
+
case "error":
|
|
23148
|
+
return `Error: ${status.lastError ?? "Unknown error"}`;
|
|
23149
|
+
}
|
|
23150
|
+
}
|
|
23151
|
+
function OrchestrationTab({ onPendingChange }) {
|
|
23152
|
+
const [view, setView] = (0, import_react23.useState)(null);
|
|
23153
|
+
const [enabled, setEnabled] = (0, import_react23.useState)(false);
|
|
23154
|
+
const [name, setName] = (0, import_react23.useState)("");
|
|
23155
|
+
const [endpoint, setEndpoint] = (0, import_react23.useState)("");
|
|
23156
|
+
const [token, setToken] = (0, import_react23.useState)("");
|
|
23157
|
+
const [pollSeconds, setPollSeconds] = (0, import_react23.useState)("15");
|
|
23158
|
+
const [policy, setPolicy] = (0, import_react23.useState)("approve");
|
|
23159
|
+
const [error, setError] = (0, import_react23.useState)(null);
|
|
23160
|
+
const [loadError, setLoadError] = (0, import_react23.useState)(null);
|
|
23161
|
+
const [testResult, setTestResult] = (0, import_react23.useState)(null);
|
|
23162
|
+
const [busy, setBusy] = (0, import_react23.useState)(false);
|
|
23163
|
+
const seededRef = (0, import_react23.useRef)(false);
|
|
23164
|
+
const seedForm = (0, import_react23.useCallback)((cfg) => {
|
|
23165
|
+
setEnabled(cfg.enabled);
|
|
23166
|
+
setName(cfg.name);
|
|
23167
|
+
setEndpoint(cfg.endpoint);
|
|
23168
|
+
setToken("");
|
|
23169
|
+
setPollSeconds(String(cfg.pollSeconds));
|
|
23170
|
+
setPolicy(cfg.policy);
|
|
23171
|
+
}, []);
|
|
23172
|
+
const call = (0, import_react23.useCallback)(
|
|
23173
|
+
async (path, init, report = setError) => {
|
|
23174
|
+
report(null);
|
|
23175
|
+
try {
|
|
23176
|
+
const res = await fetch(path, {
|
|
23177
|
+
...init,
|
|
23178
|
+
headers: init?.body ? { "content-type": "application/json" } : void 0
|
|
23179
|
+
});
|
|
23180
|
+
const data = await res.json();
|
|
23181
|
+
if (!res.ok) {
|
|
23182
|
+
report(data?.error ?? `Request failed (${res.status})`);
|
|
23183
|
+
return null;
|
|
23184
|
+
}
|
|
23185
|
+
return data;
|
|
23186
|
+
} catch {
|
|
23187
|
+
report("The server did not answer.");
|
|
23188
|
+
return null;
|
|
23189
|
+
}
|
|
23190
|
+
},
|
|
23191
|
+
[]
|
|
23192
|
+
);
|
|
23193
|
+
const refresh = (0, import_react23.useCallback)(async () => {
|
|
23194
|
+
const data = await call("/api/orchestrator", void 0, setLoadError);
|
|
23195
|
+
if (!data) return;
|
|
23196
|
+
setView(data);
|
|
23197
|
+
onPendingChange?.(data.pending);
|
|
23198
|
+
if (!seededRef.current) {
|
|
23199
|
+
seededRef.current = true;
|
|
23200
|
+
seedForm(data.config);
|
|
23201
|
+
}
|
|
23202
|
+
}, [call, onPendingChange, seedForm]);
|
|
23203
|
+
(0, import_react23.useEffect)(() => {
|
|
23204
|
+
void refresh();
|
|
23205
|
+
const timer = setInterval(() => {
|
|
23206
|
+
void refresh();
|
|
23207
|
+
}, 5e3);
|
|
23208
|
+
return () => clearInterval(timer);
|
|
23209
|
+
}, [refresh]);
|
|
23210
|
+
const handleSave = async () => {
|
|
23211
|
+
setBusy(true);
|
|
23212
|
+
setTestResult(null);
|
|
23213
|
+
const data = await call("/api/orchestrator", {
|
|
23214
|
+
method: "PUT",
|
|
23215
|
+
body: JSON.stringify({
|
|
23216
|
+
enabled,
|
|
23217
|
+
name,
|
|
23218
|
+
endpoint,
|
|
23219
|
+
token,
|
|
23220
|
+
pollSeconds: Number(pollSeconds),
|
|
23221
|
+
policy
|
|
23222
|
+
})
|
|
23223
|
+
});
|
|
23224
|
+
setBusy(false);
|
|
23225
|
+
if (data) {
|
|
23226
|
+
setView(data);
|
|
23227
|
+
onPendingChange?.(data.pending);
|
|
23228
|
+
seedForm(data.config);
|
|
23229
|
+
}
|
|
23230
|
+
};
|
|
23231
|
+
const handleTest = async () => {
|
|
23232
|
+
setBusy(true);
|
|
23233
|
+
setTestResult(null);
|
|
23234
|
+
const res = await call("/api/orchestrator/test", {
|
|
23235
|
+
method: "POST",
|
|
23236
|
+
body: JSON.stringify({ endpoint, token })
|
|
23237
|
+
});
|
|
23238
|
+
setBusy(false);
|
|
23239
|
+
if (res) setTestResult(res);
|
|
23240
|
+
};
|
|
23241
|
+
const handleDecision = async (id, decision) => {
|
|
23242
|
+
await call(`/api/orchestrator/messages/${encodeURIComponent(id)}/${decision}`, {
|
|
23243
|
+
method: "POST"
|
|
23244
|
+
});
|
|
23245
|
+
await refresh();
|
|
23246
|
+
};
|
|
23247
|
+
if (!view) {
|
|
23248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form", children: [
|
|
23249
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { children: "Orchestration" }),
|
|
23250
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "glass-form__body", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: loadError ? "form-error" : void 0, children: loadError ?? "Loading\u2026" }) })
|
|
23251
|
+
] });
|
|
23252
|
+
}
|
|
23253
|
+
const pendingMessages = view.messages.filter((m2) => m2.state === "pending");
|
|
23254
|
+
const activityMessages = view.messages.filter((m2) => m2.state !== "pending");
|
|
23255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form", children: [
|
|
23256
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__header", children: [
|
|
23257
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h4", { children: "Orchestration" }),
|
|
23258
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: `orchestration-tab__status orchestration-tab__status--${view.status.state}`, children: statusText(view.status) })
|
|
23259
|
+
] }),
|
|
23260
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "glass-form__body", children: [
|
|
23261
|
+
loadError && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "form-error", children: loadError }),
|
|
23262
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "form-error", children: error }),
|
|
23263
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-checkbox", children: [
|
|
23264
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23265
|
+
"input",
|
|
23266
|
+
{
|
|
23267
|
+
type: "checkbox",
|
|
23268
|
+
checked: enabled,
|
|
23269
|
+
onChange: (e) => setEnabled(e.target.checked)
|
|
23270
|
+
}
|
|
23271
|
+
),
|
|
23272
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Enabled" })
|
|
23273
|
+
] }),
|
|
23274
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
|
|
23275
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-name", children: "Instance name" }),
|
|
23276
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23277
|
+
"input",
|
|
23278
|
+
{
|
|
23279
|
+
id: "orch-name",
|
|
23280
|
+
type: "text",
|
|
23281
|
+
value: name,
|
|
23282
|
+
onChange: (e) => setName(e.target.value),
|
|
23283
|
+
placeholder: "My workstation"
|
|
23284
|
+
}
|
|
23285
|
+
)
|
|
23286
|
+
] }),
|
|
23287
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
|
|
23288
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-endpoint", children: "Endpoint" }),
|
|
23289
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23290
|
+
"input",
|
|
23291
|
+
{
|
|
23292
|
+
id: "orch-endpoint",
|
|
23293
|
+
type: "text",
|
|
23294
|
+
value: endpoint,
|
|
23295
|
+
onChange: (e) => setEndpoint(e.target.value),
|
|
23296
|
+
placeholder: "https://orchestrator.example.com/v1"
|
|
23297
|
+
}
|
|
23298
|
+
)
|
|
23299
|
+
] }),
|
|
23300
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
|
|
23301
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-token", children: "Token" }),
|
|
23302
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23303
|
+
"input",
|
|
23304
|
+
{
|
|
23305
|
+
id: "orch-token",
|
|
23306
|
+
type: "password",
|
|
23307
|
+
value: token,
|
|
23308
|
+
onChange: (e) => setToken(e.target.value),
|
|
23309
|
+
placeholder: view.config.hasToken ? "Leave blank to keep the saved token" : "Bearer token"
|
|
23310
|
+
}
|
|
23311
|
+
)
|
|
23312
|
+
] }),
|
|
23313
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
|
|
23314
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { htmlFor: "orch-poll", children: "Poll every (seconds)" }),
|
|
23315
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23316
|
+
"input",
|
|
23317
|
+
{
|
|
23318
|
+
id: "orch-poll",
|
|
23319
|
+
type: "number",
|
|
23320
|
+
min: 5,
|
|
23321
|
+
max: 3600,
|
|
23322
|
+
value: pollSeconds,
|
|
23323
|
+
onChange: (e) => setPollSeconds(e.target.value)
|
|
23324
|
+
}
|
|
23325
|
+
)
|
|
23326
|
+
] }),
|
|
23327
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "form-group", children: [
|
|
23328
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("label", { children: "Policy" }),
|
|
23329
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__radios", children: [
|
|
23330
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-radio", children: [
|
|
23331
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23332
|
+
"input",
|
|
23333
|
+
{
|
|
23334
|
+
type: "radio",
|
|
23335
|
+
name: "orch-policy",
|
|
23336
|
+
checked: policy === "approve",
|
|
23337
|
+
onChange: () => setPolicy("approve")
|
|
23338
|
+
}
|
|
23339
|
+
),
|
|
23340
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Ask me before applying changes" })
|
|
23341
|
+
] }),
|
|
23342
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("label", { className: "form-radio", children: [
|
|
23343
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23344
|
+
"input",
|
|
23345
|
+
{
|
|
23346
|
+
type: "radio",
|
|
23347
|
+
name: "orch-policy",
|
|
23348
|
+
checked: policy === "auto",
|
|
23349
|
+
onChange: () => setPolicy("auto")
|
|
23350
|
+
}
|
|
23351
|
+
),
|
|
23352
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: "Apply automatically" })
|
|
23353
|
+
] }),
|
|
23354
|
+
policy === "auto" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__warning", children: "The orchestrator can create projects and start tasks on this machine without asking." })
|
|
23355
|
+
] })
|
|
23356
|
+
] }),
|
|
23357
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__actions", children: [
|
|
23358
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "btn btn--secondary btn--sm", onClick: handleTest, disabled: busy, children: "Test connection" }),
|
|
23359
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", className: "btn btn--primary btn--sm", onClick: handleSave, disabled: busy, children: "Save" })
|
|
23360
|
+
] }),
|
|
23361
|
+
testResult && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: testResult.ok ? "orchestration-tab__test-ok" : "form-error", children: testResult.ok ? `\u2713 Reached "${testResult.name || "orchestrator"}" (protocol ${testResult.protocol})` : testResult.error ?? "Connection test failed." })
|
|
23362
|
+
] }),
|
|
23363
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__section", children: [
|
|
23364
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("h5", { children: [
|
|
23365
|
+
"Waiting for approval (",
|
|
23366
|
+
pendingMessages.length,
|
|
23367
|
+
")"
|
|
23368
|
+
] }),
|
|
23369
|
+
pendingMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__empty", children: "No pending messages." }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "orchestration-tab__list", children: pendingMessages.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__pending-row", children: [
|
|
23370
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__pending-main", children: [
|
|
23371
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { children: m2.method }),
|
|
23372
|
+
" ",
|
|
23373
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { children: m2.path }),
|
|
23374
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__row-actions", children: [
|
|
23375
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23376
|
+
"button",
|
|
23377
|
+
{
|
|
23378
|
+
type: "button",
|
|
23379
|
+
className: "btn btn--primary btn--xs",
|
|
23380
|
+
onClick: () => void handleDecision(m2.id, "approve"),
|
|
23381
|
+
children: "Approve"
|
|
23382
|
+
}
|
|
23383
|
+
),
|
|
23384
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23385
|
+
"button",
|
|
23386
|
+
{
|
|
23387
|
+
type: "button",
|
|
23388
|
+
className: "btn btn--secondary btn--xs",
|
|
23389
|
+
onClick: () => void handleDecision(m2.id, "reject"),
|
|
23390
|
+
children: "Reject"
|
|
23391
|
+
}
|
|
23392
|
+
)
|
|
23393
|
+
] })
|
|
23394
|
+
] }),
|
|
23395
|
+
m2.body !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("details", { className: "orchestration-tab__details", children: [
|
|
23396
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("summary", { children: "Body" }),
|
|
23397
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("pre", { children: JSON.stringify(m2.body, null, 2) })
|
|
23398
|
+
] })
|
|
23399
|
+
] }, m2.id)) })
|
|
23400
|
+
] }),
|
|
23401
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__section", children: [
|
|
23402
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h5", { children: "Activity" }),
|
|
23403
|
+
activityMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("small", { className: "orchestration-tab__empty", children: "No activity yet." }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "orchestration-tab__list", children: activityMessages.map((m2) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "orchestration-tab__activity-row", children: [
|
|
23404
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__time", children: formatTime(m2.resolvedAt ?? m2.receivedAt) }),
|
|
23405
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("code", { children: m2.method }),
|
|
23406
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__path", children: m2.path }),
|
|
23407
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "orchestration-tab__code", children: m2.status === 403 ? "403 rejected" : m2.status ?? m2.state })
|
|
23408
|
+
] }, m2.id)) })
|
|
23409
|
+
] })
|
|
23410
|
+
] });
|
|
23411
|
+
}
|
|
23412
|
+
|
|
23413
|
+
// src/settings_tabs.ts
|
|
23414
|
+
var ALL_TABS = [
|
|
23415
|
+
{ id: "providers", label: "Providers" },
|
|
23416
|
+
{ id: "projects", label: "Projects", sidebarOnly: true },
|
|
23417
|
+
{ id: "agents", label: "Agents" },
|
|
23418
|
+
{ id: "plugins", label: "Plugins" },
|
|
23419
|
+
{ id: "mcp", label: "MCP" },
|
|
23420
|
+
{ id: "services", label: "Services", sidebarOnly: true },
|
|
23421
|
+
// Voice is out of scope for the VSCode sidebar (webview CSP blocks the mic).
|
|
23422
|
+
{ id: "voice", label: "Voice", sidebarOnly: true },
|
|
23423
|
+
// The memory sweep runs only in the web server's scheduler.
|
|
23424
|
+
{ id: "memory", label: "Memory", sidebarOnly: true },
|
|
23425
|
+
// Only the Electron desktop app acts on the assistant shortcut (runs web server).
|
|
23426
|
+
{ id: "desktop", label: "Desktop", sidebarOnly: true },
|
|
23427
|
+
// The API listener belongs to the web server; /api/access exists only there.
|
|
23428
|
+
{ id: "api", label: "API", sidebarOnly: true },
|
|
23429
|
+
// Remote orchestration runs only in the web server; /api/orchestrator exists only there.
|
|
23430
|
+
{ id: "orchestration", label: "Orchestration", sidebarOnly: true }
|
|
23431
|
+
];
|
|
23432
|
+
function settingsTabs(layout) {
|
|
23433
|
+
return ALL_TABS.filter((t) => layout === "sidebar" || !t.sidebarOnly).map(({ id, label }) => ({ id, label }));
|
|
23434
|
+
}
|
|
23435
|
+
|
|
23436
|
+
// src/SettingsPanel.tsx
|
|
23437
|
+
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
23123
23438
|
function SettingsPanel({
|
|
23124
23439
|
layout = "compact",
|
|
23125
23440
|
postMessage,
|
|
@@ -23138,18 +23453,20 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23138
23453
|
setMcpAuthOutcome,
|
|
23139
23454
|
taskRuns = {},
|
|
23140
23455
|
onClose,
|
|
23141
|
-
initialTab = "providers"
|
|
23456
|
+
initialTab = "providers",
|
|
23457
|
+
orchestrationPending = 0,
|
|
23458
|
+
onOrchestrationPendingChange
|
|
23142
23459
|
}) {
|
|
23143
|
-
const [activeTab, setActiveTab] = (0,
|
|
23460
|
+
const [activeTab, setActiveTab] = (0, import_react24.useState)(initialTab);
|
|
23144
23461
|
if (!settingsData) {
|
|
23145
|
-
return /* @__PURE__ */ (0,
|
|
23146
|
-
/* @__PURE__ */ (0,
|
|
23147
|
-
/* @__PURE__ */ (0,
|
|
23462
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "settings-panel settings-panel--loading", children: [
|
|
23463
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, children: [
|
|
23464
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 14 }),
|
|
23148
23465
|
" Back to Chat"
|
|
23149
23466
|
] }),
|
|
23150
|
-
/* @__PURE__ */ (0,
|
|
23151
|
-
/* @__PURE__ */ (0,
|
|
23152
|
-
/* @__PURE__ */ (0,
|
|
23467
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "settings-panel__loading-spinner", children: [
|
|
23468
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "spinner" }),
|
|
23469
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: "Loading configurations..." })
|
|
23153
23470
|
] })
|
|
23154
23471
|
] });
|
|
23155
23472
|
}
|
|
@@ -23157,7 +23474,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23157
23474
|
const renderTabContent = () => {
|
|
23158
23475
|
switch (activeTab) {
|
|
23159
23476
|
case "providers":
|
|
23160
|
-
return /* @__PURE__ */ (0,
|
|
23477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23161
23478
|
ProvidersTab,
|
|
23162
23479
|
{
|
|
23163
23480
|
config,
|
|
@@ -23169,7 +23486,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23169
23486
|
}
|
|
23170
23487
|
);
|
|
23171
23488
|
case "projects":
|
|
23172
|
-
return /* @__PURE__ */ (0,
|
|
23489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23173
23490
|
ProjectsTabSettings,
|
|
23174
23491
|
{
|
|
23175
23492
|
config,
|
|
@@ -23178,7 +23495,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23178
23495
|
}
|
|
23179
23496
|
);
|
|
23180
23497
|
case "agents":
|
|
23181
|
-
return /* @__PURE__ */ (0,
|
|
23498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23182
23499
|
AgentsTab,
|
|
23183
23500
|
{
|
|
23184
23501
|
config,
|
|
@@ -23192,7 +23509,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23192
23509
|
}
|
|
23193
23510
|
);
|
|
23194
23511
|
case "plugins":
|
|
23195
|
-
return /* @__PURE__ */ (0,
|
|
23512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23196
23513
|
PluginsTab,
|
|
23197
23514
|
{
|
|
23198
23515
|
pluginsFile,
|
|
@@ -23203,7 +23520,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23203
23520
|
}
|
|
23204
23521
|
);
|
|
23205
23522
|
case "mcp":
|
|
23206
|
-
return /* @__PURE__ */ (0,
|
|
23523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23207
23524
|
McpTab,
|
|
23208
23525
|
{
|
|
23209
23526
|
mcpServersFile,
|
|
@@ -23213,7 +23530,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23213
23530
|
}
|
|
23214
23531
|
);
|
|
23215
23532
|
case "services":
|
|
23216
|
-
return /* @__PURE__ */ (0,
|
|
23533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23217
23534
|
ServicesTab,
|
|
23218
23535
|
{
|
|
23219
23536
|
config,
|
|
@@ -23223,7 +23540,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23223
23540
|
}
|
|
23224
23541
|
);
|
|
23225
23542
|
case "voice":
|
|
23226
|
-
return /* @__PURE__ */ (0,
|
|
23543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23227
23544
|
VoiceTab,
|
|
23228
23545
|
{
|
|
23229
23546
|
config,
|
|
@@ -23234,7 +23551,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23234
23551
|
}
|
|
23235
23552
|
);
|
|
23236
23553
|
case "memory":
|
|
23237
|
-
return /* @__PURE__ */ (0,
|
|
23554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23238
23555
|
MemoryTab,
|
|
23239
23556
|
{
|
|
23240
23557
|
config,
|
|
@@ -23243,7 +23560,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23243
23560
|
}
|
|
23244
23561
|
);
|
|
23245
23562
|
case "desktop":
|
|
23246
|
-
return /* @__PURE__ */ (0,
|
|
23563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
23247
23564
|
DesktopTab,
|
|
23248
23565
|
{
|
|
23249
23566
|
config,
|
|
@@ -23252,108 +23569,40 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23252
23569
|
}
|
|
23253
23570
|
);
|
|
23254
23571
|
case "api":
|
|
23255
|
-
return /* @__PURE__ */ (0,
|
|
23572
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ApiAccessTab, {});
|
|
23573
|
+
case "orchestration":
|
|
23574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(OrchestrationTab, { onPendingChange: onOrchestrationPendingChange });
|
|
23256
23575
|
}
|
|
23257
23576
|
};
|
|
23258
|
-
return /* @__PURE__ */ (0,
|
|
23259
|
-
/* @__PURE__ */ (0,
|
|
23260
|
-
layout !== "sidebar" && /* @__PURE__ */ (0,
|
|
23261
|
-
/* @__PURE__ */ (0,
|
|
23577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `settings-panel${layout === "sidebar" ? " settings-panel--vertical" : ""}`, children: [
|
|
23578
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("header", { className: "settings-panel__header", children: [
|
|
23579
|
+
layout !== "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("button", { className: "settings-panel__back-btn", onClick: onClose, title: "Go back to chat", children: [
|
|
23580
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowLeft, { size: 14 }),
|
|
23262
23581
|
" Chat"
|
|
23263
23582
|
] }),
|
|
23264
|
-
/* @__PURE__ */ (0,
|
|
23265
|
-
] }),
|
|
23266
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("nav", { className: "settings-panel__tabs", children: [
|
|
23267
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23268
|
-
"button",
|
|
23269
|
-
{
|
|
23270
|
-
className: `settings-panel__tab-btn ${activeTab === "providers" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23271
|
-
onClick: () => setActiveTab("providers"),
|
|
23272
|
-
children: "Providers"
|
|
23273
|
-
}
|
|
23274
|
-
),
|
|
23275
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23276
|
-
"button",
|
|
23277
|
-
{
|
|
23278
|
-
className: `settings-panel__tab-btn ${activeTab === "projects" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23279
|
-
onClick: () => setActiveTab("projects"),
|
|
23280
|
-
children: "Projects"
|
|
23281
|
-
}
|
|
23282
|
-
),
|
|
23283
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23284
|
-
"button",
|
|
23285
|
-
{
|
|
23286
|
-
className: `settings-panel__tab-btn ${activeTab === "agents" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23287
|
-
onClick: () => setActiveTab("agents"),
|
|
23288
|
-
children: "Agents"
|
|
23289
|
-
}
|
|
23290
|
-
),
|
|
23291
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23292
|
-
"button",
|
|
23293
|
-
{
|
|
23294
|
-
className: `settings-panel__tab-btn ${activeTab === "plugins" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23295
|
-
onClick: () => setActiveTab("plugins"),
|
|
23296
|
-
children: "Plugins"
|
|
23297
|
-
}
|
|
23298
|
-
),
|
|
23299
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23300
|
-
"button",
|
|
23301
|
-
{
|
|
23302
|
-
className: `settings-panel__tab-btn ${activeTab === "mcp" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23303
|
-
onClick: () => setActiveTab("mcp"),
|
|
23304
|
-
children: "MCP"
|
|
23305
|
-
}
|
|
23306
|
-
),
|
|
23307
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23308
|
-
"button",
|
|
23309
|
-
{
|
|
23310
|
-
className: `settings-panel__tab-btn ${activeTab === "services" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23311
|
-
onClick: () => setActiveTab("services"),
|
|
23312
|
-
children: "Services"
|
|
23313
|
-
}
|
|
23314
|
-
),
|
|
23315
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23316
|
-
"button",
|
|
23317
|
-
{
|
|
23318
|
-
className: `settings-panel__tab-btn ${activeTab === "voice" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23319
|
-
onClick: () => setActiveTab("voice"),
|
|
23320
|
-
children: "Voice"
|
|
23321
|
-
}
|
|
23322
|
-
),
|
|
23323
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23324
|
-
"button",
|
|
23325
|
-
{
|
|
23326
|
-
className: `settings-panel__tab-btn ${activeTab === "memory" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23327
|
-
onClick: () => setActiveTab("memory"),
|
|
23328
|
-
children: "Memory"
|
|
23329
|
-
}
|
|
23330
|
-
),
|
|
23331
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23332
|
-
"button",
|
|
23333
|
-
{
|
|
23334
|
-
className: `settings-panel__tab-btn ${activeTab === "desktop" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23335
|
-
onClick: () => setActiveTab("desktop"),
|
|
23336
|
-
children: "Desktop"
|
|
23337
|
-
}
|
|
23338
|
-
),
|
|
23339
|
-
layout === "sidebar" && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
23340
|
-
"button",
|
|
23341
|
-
{
|
|
23342
|
-
className: `settings-panel__tab-btn ${activeTab === "api" ? "settings-panel__tab-btn--active" : ""}`,
|
|
23343
|
-
onClick: () => setActiveTab("api"),
|
|
23344
|
-
children: "API"
|
|
23345
|
-
}
|
|
23346
|
-
)
|
|
23583
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { className: "settings-panel__title", children: "Caretaker Config" })
|
|
23347
23584
|
] }),
|
|
23348
|
-
/* @__PURE__ */ (0,
|
|
23585
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("nav", { className: "settings-panel__tabs", children: settingsTabs(layout).map((tab) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
23586
|
+
"button",
|
|
23587
|
+
{
|
|
23588
|
+
className: `settings-panel__tab-btn ${activeTab === tab.id ? "settings-panel__tab-btn--active" : ""}`,
|
|
23589
|
+
onClick: () => setActiveTab(tab.id),
|
|
23590
|
+
children: [
|
|
23591
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: tab.label }),
|
|
23592
|
+
tab.id === "orchestration" && orchestrationPending > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "settings-panel__badge", children: orchestrationPending })
|
|
23593
|
+
]
|
|
23594
|
+
},
|
|
23595
|
+
tab.id
|
|
23596
|
+
)) }),
|
|
23597
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("main", { className: "settings-panel__content", children: renderTabContent() })
|
|
23349
23598
|
] });
|
|
23350
23599
|
}
|
|
23351
23600
|
|
|
23352
23601
|
// src/ProjectsTab.tsx
|
|
23353
|
-
var
|
|
23602
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
23354
23603
|
|
|
23355
23604
|
// src/TaskCycleView.tsx
|
|
23356
|
-
var
|
|
23605
|
+
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
23357
23606
|
function TaskCycleView({ item, postMessage, onBack }) {
|
|
23358
23607
|
const { sessionId, agentId } = item;
|
|
23359
23608
|
const chat = useCycleStream(sessionId, {
|
|
@@ -23363,25 +23612,25 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23363
23612
|
onDone: () => postMessage({ type: "watchCycle", agentId, sessionId })
|
|
23364
23613
|
});
|
|
23365
23614
|
const running = chat.status === "streaming";
|
|
23366
|
-
return /* @__PURE__ */ (0,
|
|
23367
|
-
/* @__PURE__ */ (0,
|
|
23368
|
-
/* @__PURE__ */ (0,
|
|
23369
|
-
/* @__PURE__ */ (0,
|
|
23370
|
-
/* @__PURE__ */ (0,
|
|
23615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
|
|
23616
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "10px 14px" }, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
23617
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to the task thread", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowLeft, { size: 13 }) }),
|
|
23618
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "app__chat-header-info", children: [
|
|
23619
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
|
|
23371
23620
|
cycleRoleLabel(item.role),
|
|
23372
23621
|
" cycle",
|
|
23373
23622
|
item.label ? ` \xB7 ${item.label}` : ""
|
|
23374
23623
|
] }),
|
|
23375
|
-
/* @__PURE__ */ (0,
|
|
23624
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: running ? "running" : cycleOutcomeLabel(item.outcome) })
|
|
23376
23625
|
] })
|
|
23377
23626
|
] }) }),
|
|
23378
|
-
/* @__PURE__ */ (0,
|
|
23379
|
-
chat.errorText && /* @__PURE__ */ (0,
|
|
23627
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(MessageList, { items: chat.items, sessionId: null, isStreaming: running, agentName: item.label }),
|
|
23628
|
+
chat.errorText && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "notice notice--block", children: chat.errorText })
|
|
23380
23629
|
] });
|
|
23381
23630
|
}
|
|
23382
23631
|
|
|
23383
23632
|
// src/ProjectsTab.tsx
|
|
23384
|
-
var
|
|
23633
|
+
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
23385
23634
|
var LS_ARCHIVED_KEY = "caretaker.taskView.showArchived";
|
|
23386
23635
|
function persistLastProject(id) {
|
|
23387
23636
|
void fetch("/api/ui-state", {
|
|
@@ -23406,15 +23655,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23406
23655
|
}
|
|
23407
23656
|
var PAGE_SIZE = 20;
|
|
23408
23657
|
function ProjectsTab({ agents, onOpenSettings, postMessage }) {
|
|
23409
|
-
const [projects, setProjects] = (0,
|
|
23410
|
-
const [selectedProjectId, setSelectedProjectId] = (0,
|
|
23411
|
-
const [tasks, setTasks] = (0,
|
|
23412
|
-
const [selectedTaskId, setSelectedTaskId] = (0,
|
|
23413
|
-
const [taskMessages, setTaskMessages] = (0,
|
|
23414
|
-
const [view, setView] = (0,
|
|
23415
|
-
const [page, setPage] = (0,
|
|
23416
|
-
const [isNewTaskOpen, setIsNewTaskOpen] = (0,
|
|
23417
|
-
const [newTask, setNewTask] = (0,
|
|
23658
|
+
const [projects, setProjects] = (0, import_react25.useState)([]);
|
|
23659
|
+
const [selectedProjectId, setSelectedProjectId] = (0, import_react25.useState)(null);
|
|
23660
|
+
const [tasks, setTasks] = (0, import_react25.useState)([]);
|
|
23661
|
+
const [selectedTaskId, setSelectedTaskId] = (0, import_react25.useState)(null);
|
|
23662
|
+
const [taskMessages, setTaskMessages] = (0, import_react25.useState)([]);
|
|
23663
|
+
const [view, setView] = (0, import_react25.useState)("list");
|
|
23664
|
+
const [page, setPage] = (0, import_react25.useState)(0);
|
|
23665
|
+
const [isNewTaskOpen, setIsNewTaskOpen] = (0, import_react25.useState)(false);
|
|
23666
|
+
const [newTask, setNewTask] = (0, import_react25.useState)({
|
|
23418
23667
|
title: "",
|
|
23419
23668
|
objective: "",
|
|
23420
23669
|
checklistText: "",
|
|
@@ -23423,12 +23672,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23423
23672
|
plannerAgentId: "",
|
|
23424
23673
|
reviewerAgentId: ""
|
|
23425
23674
|
});
|
|
23426
|
-
const [isSending, setIsSending] = (0,
|
|
23427
|
-
const [showArchived, setShowArchived] = (0,
|
|
23428
|
-
const [pendingConfirm, setPendingConfirm] = (0,
|
|
23429
|
-
const [taskError, setTaskError] = (0,
|
|
23430
|
-
const threadIntervalRef = (0,
|
|
23431
|
-
(0,
|
|
23675
|
+
const [isSending, setIsSending] = (0, import_react25.useState)(false);
|
|
23676
|
+
const [showArchived, setShowArchived] = (0, import_react25.useState)(loadShowArchived);
|
|
23677
|
+
const [pendingConfirm, setPendingConfirm] = (0, import_react25.useState)(null);
|
|
23678
|
+
const [taskError, setTaskError] = (0, import_react25.useState)(null);
|
|
23679
|
+
const threadIntervalRef = (0, import_react25.useRef)(null);
|
|
23680
|
+
(0, import_react25.useEffect)(() => {
|
|
23432
23681
|
void (async () => {
|
|
23433
23682
|
try {
|
|
23434
23683
|
const res = await fetch("/api/ui-state");
|
|
@@ -23444,7 +23693,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23444
23693
|
stopThreadPolling();
|
|
23445
23694
|
};
|
|
23446
23695
|
}, []);
|
|
23447
|
-
(0,
|
|
23696
|
+
(0, import_react25.useEffect)(() => {
|
|
23448
23697
|
if (projects.length > 0 && selectedProjectId === null) {
|
|
23449
23698
|
setSelectedProjectId(projects[0].id);
|
|
23450
23699
|
}
|
|
@@ -23455,10 +23704,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23455
23704
|
setSelectedProjectId(null);
|
|
23456
23705
|
}
|
|
23457
23706
|
}, [projects]);
|
|
23458
|
-
(0,
|
|
23707
|
+
(0, import_react25.useEffect)(() => {
|
|
23459
23708
|
saveShowArchived(showArchived);
|
|
23460
23709
|
}, [showArchived]);
|
|
23461
|
-
(0,
|
|
23710
|
+
(0, import_react25.useEffect)(() => {
|
|
23462
23711
|
if (selectedProjectId !== null) {
|
|
23463
23712
|
fetchTasks(selectedProjectId);
|
|
23464
23713
|
setView("list");
|
|
@@ -23470,7 +23719,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23470
23719
|
setTasks([]);
|
|
23471
23720
|
}
|
|
23472
23721
|
}, [selectedProjectId, showArchived]);
|
|
23473
|
-
(0,
|
|
23722
|
+
(0, import_react25.useEffect)(() => {
|
|
23474
23723
|
if (selectedTaskId !== null) {
|
|
23475
23724
|
fetchTaskMessages(selectedTaskId);
|
|
23476
23725
|
startThreadPolling(selectedTaskId);
|
|
@@ -23643,7 +23892,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23643
23892
|
const cancelPendingAction = () => {
|
|
23644
23893
|
setPendingConfirm(null);
|
|
23645
23894
|
};
|
|
23646
|
-
(0,
|
|
23895
|
+
(0, import_react25.useEffect)(() => {
|
|
23647
23896
|
if (!pendingConfirm) return;
|
|
23648
23897
|
function handleKeyDown(event) {
|
|
23649
23898
|
if (event.key === "Escape") {
|
|
@@ -23653,7 +23902,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23653
23902
|
window.addEventListener("keydown", handleKeyDown);
|
|
23654
23903
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
23655
23904
|
}, [pendingConfirm]);
|
|
23656
|
-
(0,
|
|
23905
|
+
(0, import_react25.useEffect)(() => {
|
|
23657
23906
|
if (!taskError) return;
|
|
23658
23907
|
const t = setTimeout(() => setTaskError(null), 5e3);
|
|
23659
23908
|
return () => clearTimeout(t);
|
|
@@ -23784,7 +24033,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23784
24033
|
const selectedProject = projects.find((p) => p.id === selectedProjectId);
|
|
23785
24034
|
const selectedTask = tasks.find((t) => t.id === selectedTaskId);
|
|
23786
24035
|
const selectedProjectAgentName = agents.find((a2) => a2.id === selectedProject?.agentId)?.name || "Default Agent";
|
|
23787
|
-
const taskAgentLabels = (0,
|
|
24036
|
+
const taskAgentLabels = (0, import_react25.useMemo)(() => {
|
|
23788
24037
|
if (!selectedTask) return void 0;
|
|
23789
24038
|
const agentLabelFor = (agentId) => {
|
|
23790
24039
|
const a2 = agents.find((x) => x.id === agentId);
|
|
@@ -23830,14 +24079,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23830
24079
|
const safePage = Math.min(page, totalPages - 1);
|
|
23831
24080
|
const pageStart = safePage * PAGE_SIZE;
|
|
23832
24081
|
const pageTasks = tasks.slice(pageStart, pageStart + PAGE_SIZE);
|
|
23833
|
-
return /* @__PURE__ */ (0,
|
|
23834
|
-
/* @__PURE__ */ (0,
|
|
24082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app", style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
|
|
24083
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("main", { className: "app__chat-pane", style: { flex: 1, display: "flex", flexDirection: "column", background: "var(--vscode-editor-background)" }, children: projects.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { children: [
|
|
23835
24084
|
"No projects registered.",
|
|
23836
24085
|
" ",
|
|
23837
|
-
/* @__PURE__ */ (0,
|
|
24086
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__link-btn", onClick: onOpenSettings, children: "Create one in Settings" }),
|
|
23838
24087
|
" ",
|
|
23839
24088
|
"to get started."
|
|
23840
|
-
] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0,
|
|
24089
|
+
] }) }) : selectedProject ? view === "list" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23841
24090
|
TaskListView,
|
|
23842
24091
|
{
|
|
23843
24092
|
projects,
|
|
@@ -23862,7 +24111,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23862
24111
|
onArchive: handleArchiveFromList,
|
|
23863
24112
|
statusColor
|
|
23864
24113
|
}
|
|
23865
|
-
) : view === "log" && selectedTask ? /* @__PURE__ */ (0,
|
|
24114
|
+
) : view === "log" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23866
24115
|
TaskLogView,
|
|
23867
24116
|
{
|
|
23868
24117
|
task: selectedTask,
|
|
@@ -23878,7 +24127,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23878
24127
|
onToggleStatus: handleToggleTaskStatus,
|
|
23879
24128
|
statusColor
|
|
23880
24129
|
}
|
|
23881
|
-
) : view === "edit" && selectedTask ? /* @__PURE__ */ (0,
|
|
24130
|
+
) : view === "edit" && selectedTask ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23882
24131
|
TaskEditView,
|
|
23883
24132
|
{
|
|
23884
24133
|
task: selectedTask,
|
|
@@ -23896,11 +24145,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23896
24145
|
onOpenLog: () => setView("log"),
|
|
23897
24146
|
statusColor
|
|
23898
24147
|
}
|
|
23899
|
-
) : /* @__PURE__ */ (0,
|
|
23900
|
-
/* @__PURE__ */ (0,
|
|
23901
|
-
/* @__PURE__ */ (0,
|
|
24148
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__empty-state", children: [
|
|
24149
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { children: "Task not found. Go back to the list." }),
|
|
24150
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: backToList, style: { marginTop: "12px" }, children: "\u2190 Back to list" })
|
|
23902
24151
|
] }) : null }),
|
|
23903
|
-
isNewTaskOpen && /* @__PURE__ */ (0,
|
|
24152
|
+
isNewTaskOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23904
24153
|
"div",
|
|
23905
24154
|
{
|
|
23906
24155
|
style: {
|
|
@@ -23915,7 +24164,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23915
24164
|
justifyContent: "center",
|
|
23916
24165
|
zIndex: 999
|
|
23917
24166
|
},
|
|
23918
|
-
children: /* @__PURE__ */ (0,
|
|
24167
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
23919
24168
|
"form",
|
|
23920
24169
|
{
|
|
23921
24170
|
onSubmit: handleCreateTask,
|
|
@@ -23926,14 +24175,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23926
24175
|
background: "var(--vscode-sideBar-background)"
|
|
23927
24176
|
},
|
|
23928
24177
|
children: [
|
|
23929
|
-
/* @__PURE__ */ (0,
|
|
23930
|
-
/* @__PURE__ */ (0,
|
|
23931
|
-
/* @__PURE__ */ (0,
|
|
24178
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "confirm__header", children: [
|
|
24179
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "18px", display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Wrench, { size: 18 }) }),
|
|
24180
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "confirm__prompt", style: { fontSize: "14px" }, children: "Create New Task" })
|
|
23932
24181
|
] }),
|
|
23933
|
-
/* @__PURE__ */ (0,
|
|
23934
|
-
/* @__PURE__ */ (0,
|
|
24182
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "10px" }, children: [
|
|
24183
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
23935
24184
|
"Task Title",
|
|
23936
|
-
/* @__PURE__ */ (0,
|
|
24185
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23937
24186
|
"input",
|
|
23938
24187
|
{
|
|
23939
24188
|
type: "text",
|
|
@@ -23953,9 +24202,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23953
24202
|
}
|
|
23954
24203
|
)
|
|
23955
24204
|
] }),
|
|
23956
|
-
/* @__PURE__ */ (0,
|
|
24205
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
23957
24206
|
"Objective (Extended markdown goal description)",
|
|
23958
|
-
/* @__PURE__ */ (0,
|
|
24207
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23959
24208
|
"textarea",
|
|
23960
24209
|
{
|
|
23961
24210
|
required: true,
|
|
@@ -23976,9 +24225,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23976
24225
|
}
|
|
23977
24226
|
)
|
|
23978
24227
|
] }),
|
|
23979
|
-
/* @__PURE__ */ (0,
|
|
24228
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
23980
24229
|
"Checklist Items (One item per line)",
|
|
23981
|
-
/* @__PURE__ */ (0,
|
|
24230
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
23982
24231
|
"textarea",
|
|
23983
24232
|
{
|
|
23984
24233
|
placeholder: "Create route handler\nWrite unit tests\nUpdate documentation",
|
|
@@ -23998,9 +24247,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
23998
24247
|
}
|
|
23999
24248
|
)
|
|
24000
24249
|
] }),
|
|
24001
|
-
/* @__PURE__ */ (0,
|
|
24250
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
24002
24251
|
"Assigned Agent (optional \u2014 overrides project default)",
|
|
24003
|
-
/* @__PURE__ */ (0,
|
|
24252
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24004
24253
|
"select",
|
|
24005
24254
|
{
|
|
24006
24255
|
value: newTask.agentId,
|
|
@@ -24015,8 +24264,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24015
24264
|
outline: "none"
|
|
24016
24265
|
},
|
|
24017
24266
|
children: [
|
|
24018
|
-
/* @__PURE__ */ (0,
|
|
24019
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24267
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24268
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24020
24269
|
a2.name,
|
|
24021
24270
|
" (",
|
|
24022
24271
|
a2.provider,
|
|
@@ -24026,9 +24275,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24026
24275
|
}
|
|
24027
24276
|
)
|
|
24028
24277
|
] }),
|
|
24029
|
-
/* @__PURE__ */ (0,
|
|
24278
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
24030
24279
|
"Planner Agent Override (optional)",
|
|
24031
|
-
/* @__PURE__ */ (0,
|
|
24280
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24032
24281
|
"select",
|
|
24033
24282
|
{
|
|
24034
24283
|
value: newTask.plannerAgentId,
|
|
@@ -24043,8 +24292,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24043
24292
|
outline: "none"
|
|
24044
24293
|
},
|
|
24045
24294
|
children: [
|
|
24046
|
-
/* @__PURE__ */ (0,
|
|
24047
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24295
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24296
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24048
24297
|
a2.name,
|
|
24049
24298
|
" (",
|
|
24050
24299
|
a2.provider,
|
|
@@ -24054,9 +24303,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24054
24303
|
}
|
|
24055
24304
|
)
|
|
24056
24305
|
] }),
|
|
24057
|
-
/* @__PURE__ */ (0,
|
|
24306
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px" }, children: [
|
|
24058
24307
|
"Reviewer Agent Override (optional)",
|
|
24059
|
-
/* @__PURE__ */ (0,
|
|
24308
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24060
24309
|
"select",
|
|
24061
24310
|
{
|
|
24062
24311
|
value: newTask.reviewerAgentId,
|
|
@@ -24071,8 +24320,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24071
24320
|
outline: "none"
|
|
24072
24321
|
},
|
|
24073
24322
|
children: [
|
|
24074
|
-
/* @__PURE__ */ (0,
|
|
24075
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24323
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24324
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24076
24325
|
a2.name,
|
|
24077
24326
|
" (",
|
|
24078
24327
|
a2.provider,
|
|
@@ -24082,8 +24331,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24082
24331
|
}
|
|
24083
24332
|
)
|
|
24084
24333
|
] }),
|
|
24085
|
-
/* @__PURE__ */ (0,
|
|
24086
|
-
/* @__PURE__ */ (0,
|
|
24334
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "12px", display: "flex", alignItems: "center", gap: "6px", cursor: "pointer", marginTop: "4px" }, children: [
|
|
24335
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24087
24336
|
"input",
|
|
24088
24337
|
{
|
|
24089
24338
|
type: "checkbox",
|
|
@@ -24092,24 +24341,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24092
24341
|
style: { cursor: "pointer" }
|
|
24093
24342
|
}
|
|
24094
24343
|
),
|
|
24095
|
-
/* @__PURE__ */ (0,
|
|
24344
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: "Start active immediately (Heartbeat loop claims it)" })
|
|
24096
24345
|
] })
|
|
24097
24346
|
] }),
|
|
24098
|
-
/* @__PURE__ */ (0,
|
|
24099
|
-
/* @__PURE__ */ (0,
|
|
24100
|
-
/* @__PURE__ */ (0,
|
|
24347
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "confirm__buttons", style: { justifyContent: "flex-end", marginTop: "10px" }, children: [
|
|
24348
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "button", className: "confirm__btn", onClick: () => setIsNewTaskOpen(false), children: "Cancel" }),
|
|
24349
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { type: "submit", className: "confirm__btn confirm__btn--primary", children: "Create Task" })
|
|
24101
24350
|
] })
|
|
24102
24351
|
]
|
|
24103
24352
|
}
|
|
24104
24353
|
)
|
|
24105
24354
|
}
|
|
24106
24355
|
),
|
|
24107
|
-
pendingConfirm && /* @__PURE__ */ (0,
|
|
24108
|
-
/* @__PURE__ */ (0,
|
|
24109
|
-
/* @__PURE__ */ (0,
|
|
24110
|
-
/* @__PURE__ */ (0,
|
|
24111
|
-
/* @__PURE__ */ (0,
|
|
24112
|
-
/* @__PURE__ */ (0,
|
|
24356
|
+
pendingConfirm && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__confirm-overlay", onClick: cancelPendingAction, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
|
|
24357
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__confirm-title", children: pendingConfirm.type === "delete" ? "Delete task" : pendingConfirm.type === "archive" ? "Archive task" : "Discard worktree" }),
|
|
24358
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "app__confirm-message", children: pendingConfirm.type === "delete" ? `Permanently delete task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? This removes the task and all its messages from the store. This action cannot be undone.` : pendingConfirm.type === "archive" ? `Archive task #${pendingConfirm.task.id} "${pendingConfirm.task.title}"? It will be hidden from the list and excluded from the scheduler. You can unarchive it later by enabling "Show archived".` : `Discard the worktree for task #${pendingConfirm.task.id}? Pending changes are committed to branch ${pendingConfirm.task.branch}; the branch is kept.` }),
|
|
24359
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__confirm-buttons", children: [
|
|
24360
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__confirm-btn", onClick: cancelPendingAction, children: "Cancel" }),
|
|
24361
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24113
24362
|
"button",
|
|
24114
24363
|
{
|
|
24115
24364
|
className: `app__confirm-btn ${pendingConfirm.type === "delete" ? "app__confirm-btn--danger" : ""}`,
|
|
@@ -24119,7 +24368,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24119
24368
|
)
|
|
24120
24369
|
] })
|
|
24121
24370
|
] }) }),
|
|
24122
|
-
taskError && /* @__PURE__ */ (0,
|
|
24371
|
+
taskError && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__error-banner", onClick: () => setTaskError(null), title: "Click to dismiss", children: taskError })
|
|
24123
24372
|
] });
|
|
24124
24373
|
}
|
|
24125
24374
|
function TaskListView({
|
|
@@ -24142,10 +24391,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24142
24391
|
onArchive,
|
|
24143
24392
|
statusColor
|
|
24144
24393
|
}) {
|
|
24145
|
-
return /* @__PURE__ */ (0,
|
|
24146
|
-
/* @__PURE__ */ (0,
|
|
24147
|
-
/* @__PURE__ */ (0,
|
|
24148
|
-
/* @__PURE__ */ (0,
|
|
24394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
24395
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-view__header", children: [
|
|
24396
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
24397
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24149
24398
|
"select",
|
|
24150
24399
|
{
|
|
24151
24400
|
className: "task-view__project-filter",
|
|
@@ -24162,17 +24411,17 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24162
24411
|
outline: "none",
|
|
24163
24412
|
cursor: "pointer"
|
|
24164
24413
|
},
|
|
24165
|
-
children: projects.map((p) => /* @__PURE__ */ (0,
|
|
24414
|
+
children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: p.id, children: p.name }, p.id))
|
|
24166
24415
|
}
|
|
24167
24416
|
),
|
|
24168
|
-
/* @__PURE__ */ (0,
|
|
24417
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: [
|
|
24169
24418
|
"Agent: ",
|
|
24170
24419
|
agentName
|
|
24171
24420
|
] })
|
|
24172
24421
|
] }),
|
|
24173
|
-
/* @__PURE__ */ (0,
|
|
24174
|
-
/* @__PURE__ */ (0,
|
|
24175
|
-
/* @__PURE__ */ (0,
|
|
24422
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
24423
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "task-view__archived-toggle", children: [
|
|
24424
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24176
24425
|
"input",
|
|
24177
24426
|
{
|
|
24178
24427
|
type: "checkbox",
|
|
@@ -24183,42 +24432,42 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24183
24432
|
),
|
|
24184
24433
|
"Show archived"
|
|
24185
24434
|
] }),
|
|
24186
|
-
/* @__PURE__ */ (0,
|
|
24435
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "app__new-chat-btn", onClick: onNewTask, style: { padding: "4px 10px", fontSize: "11px" }, children: "+ New Task" })
|
|
24187
24436
|
] })
|
|
24188
24437
|
] }),
|
|
24189
|
-
/* @__PURE__ */ (0,
|
|
24438
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "0 16px 16px" }, children: allTasksCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("p", { children: [
|
|
24190
24439
|
"No tasks created for ",
|
|
24191
24440
|
project.name,
|
|
24192
24441
|
'. Click "+ New Task" to start.'
|
|
24193
|
-
] }) }) : /* @__PURE__ */ (0,
|
|
24194
|
-
/* @__PURE__ */ (0,
|
|
24195
|
-
/* @__PURE__ */ (0,
|
|
24196
|
-
/* @__PURE__ */ (0,
|
|
24197
|
-
/* @__PURE__ */ (0,
|
|
24198
|
-
/* @__PURE__ */ (0,
|
|
24199
|
-
/* @__PURE__ */ (0,
|
|
24200
|
-
/* @__PURE__ */ (0,
|
|
24201
|
-
/* @__PURE__ */ (0,
|
|
24202
|
-
/* @__PURE__ */ (0,
|
|
24442
|
+
] }) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("table", { className: "task-table", children: [
|
|
24443
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("tr", { children: [
|
|
24444
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "60px" }, children: "#" }),
|
|
24445
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", children: "Title" }),
|
|
24446
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "90px" }, children: "Status" }),
|
|
24447
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "100px" }, children: "Agent" }),
|
|
24448
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "120px" }, children: "Checklist" }),
|
|
24449
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "180px" }, children: "Branch" }),
|
|
24450
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "150px" }, children: "Updated" }),
|
|
24451
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("th", { className: "task-table__th", style: { width: "70px" } })
|
|
24203
24452
|
] }) }),
|
|
24204
|
-
/* @__PURE__ */ (0,
|
|
24453
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("tbody", { children: tasks.map((task) => {
|
|
24205
24454
|
const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
|
|
24206
24455
|
const totalCount = task.checklist.length;
|
|
24207
24456
|
const isArchived = !!task.archived;
|
|
24208
24457
|
const updated = new Date(task.updatedAt);
|
|
24209
24458
|
const updatedStr = isNaN(updated.getTime()) ? task.updatedAt : updated.toLocaleString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
24210
|
-
return /* @__PURE__ */ (0,
|
|
24459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24211
24460
|
"tr",
|
|
24212
24461
|
{
|
|
24213
24462
|
className: `task-table__row${isArchived ? " task-table__row--archived" : ""}`,
|
|
24214
24463
|
onClick: () => onOpenLog(task),
|
|
24215
24464
|
children: [
|
|
24216
|
-
/* @__PURE__ */ (0,
|
|
24217
|
-
/* @__PURE__ */ (0,
|
|
24218
|
-
isArchived && /* @__PURE__ */ (0,
|
|
24465
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td task-table__td--mono", children: task.id }),
|
|
24466
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__title", children: [
|
|
24467
|
+
isArchived && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 11 }),
|
|
24219
24468
|
task.title
|
|
24220
24469
|
] }) }),
|
|
24221
|
-
/* @__PURE__ */ (0,
|
|
24470
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24222
24471
|
"span",
|
|
24223
24472
|
{
|
|
24224
24473
|
className: "task-table__badge",
|
|
@@ -24226,28 +24475,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24226
24475
|
children: task.status
|
|
24227
24476
|
}
|
|
24228
24477
|
) }),
|
|
24229
|
-
/* @__PURE__ */ (0,
|
|
24230
|
-
/* @__PURE__ */ (0,
|
|
24231
|
-
/* @__PURE__ */ (0,
|
|
24478
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", style: { fontSize: "11px" }, children: task.agentId ? agents.find((a2) => a2.id === task.agentId)?.name || task.agentId : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.4 }, children: "default" }) }),
|
|
24479
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: totalCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-table__progress", children: [
|
|
24480
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "task-table__progress-bar", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24232
24481
|
"span",
|
|
24233
24482
|
{
|
|
24234
24483
|
className: "task-table__progress-fill",
|
|
24235
24484
|
style: { width: `${completedCount / totalCount * 100}%` }
|
|
24236
24485
|
}
|
|
24237
24486
|
) }),
|
|
24238
|
-
/* @__PURE__ */ (0,
|
|
24487
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__progress-text", children: [
|
|
24239
24488
|
completedCount,
|
|
24240
24489
|
"/",
|
|
24241
24490
|
totalCount
|
|
24242
24491
|
] })
|
|
24243
|
-
] }) : /* @__PURE__ */ (0,
|
|
24244
|
-
/* @__PURE__ */ (0,
|
|
24245
|
-
/* @__PURE__ */ (0,
|
|
24246
|
-
/* @__PURE__ */ (0,
|
|
24247
|
-
] }) : /* @__PURE__ */ (0,
|
|
24248
|
-
/* @__PURE__ */ (0,
|
|
24249
|
-
/* @__PURE__ */ (0,
|
|
24250
|
-
/* @__PURE__ */ (0,
|
|
24492
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
|
|
24493
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: task.branch ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__branch", children: [
|
|
24494
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 11 }),
|
|
24495
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { children: task.branch })
|
|
24496
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.4, fontSize: "11px" }, children: "\u2014" }) }),
|
|
24497
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td task-table__td--muted", children: updatedStr }),
|
|
24498
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("td", { className: "task-table__td", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "inline-flex", gap: "2px" }, children: [
|
|
24499
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24251
24500
|
"button",
|
|
24252
24501
|
{
|
|
24253
24502
|
className: "task-table__edit-btn",
|
|
@@ -24257,10 +24506,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24257
24506
|
},
|
|
24258
24507
|
title: task.archived ? "Unarchive task" : "Archive task",
|
|
24259
24508
|
"aria-label": task.archived ? "Unarchive task" : "Archive task",
|
|
24260
|
-
children: /* @__PURE__ */ (0,
|
|
24509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 13 })
|
|
24261
24510
|
}
|
|
24262
24511
|
),
|
|
24263
|
-
/* @__PURE__ */ (0,
|
|
24512
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24264
24513
|
"button",
|
|
24265
24514
|
{
|
|
24266
24515
|
className: "task-table__edit-btn",
|
|
@@ -24270,7 +24519,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24270
24519
|
},
|
|
24271
24520
|
title: "Edit task",
|
|
24272
24521
|
"aria-label": "Edit task",
|
|
24273
|
-
children: /* @__PURE__ */ (0,
|
|
24522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pencil, { size: 13 })
|
|
24274
24523
|
}
|
|
24275
24524
|
)
|
|
24276
24525
|
] }) })
|
|
@@ -24280,8 +24529,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24280
24529
|
);
|
|
24281
24530
|
}) })
|
|
24282
24531
|
] }) }),
|
|
24283
|
-
totalPages > 1 && /* @__PURE__ */ (0,
|
|
24284
|
-
/* @__PURE__ */ (0,
|
|
24532
|
+
totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-table__pagination", children: [
|
|
24533
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24285
24534
|
"button",
|
|
24286
24535
|
{
|
|
24287
24536
|
className: "task-table__page-btn",
|
|
@@ -24290,13 +24539,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24290
24539
|
children: "\u2039 Prev"
|
|
24291
24540
|
}
|
|
24292
24541
|
),
|
|
24293
|
-
/* @__PURE__ */ (0,
|
|
24542
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "task-table__page-info", children: [
|
|
24294
24543
|
"Page ",
|
|
24295
24544
|
page + 1,
|
|
24296
24545
|
" of ",
|
|
24297
24546
|
totalPages
|
|
24298
24547
|
] }),
|
|
24299
|
-
/* @__PURE__ */ (0,
|
|
24548
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24300
24549
|
"button",
|
|
24301
24550
|
{
|
|
24302
24551
|
className: "task-table__page-btn",
|
|
@@ -24324,31 +24573,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24324
24573
|
}) {
|
|
24325
24574
|
const completedCount = task.checklist.filter((c2) => c2.status === "done").length;
|
|
24326
24575
|
const totalCount = task.checklist.length;
|
|
24327
|
-
const chatItems = (0,
|
|
24328
|
-
const [openCycle, setOpenCycle] = (0,
|
|
24329
|
-
const [draft, setDraft] = (0,
|
|
24330
|
-
const openCycleItem = (0,
|
|
24331
|
-
const autoOpenedFor = (0,
|
|
24332
|
-
(0,
|
|
24576
|
+
const chatItems = (0, import_react25.useMemo)(() => taskMessagesToChatItems(taskMessages, agentLabels), [taskMessages, agentLabels]);
|
|
24577
|
+
const [openCycle, setOpenCycle] = (0, import_react25.useState)(null);
|
|
24578
|
+
const [draft, setDraft] = (0, import_react25.useState)("");
|
|
24579
|
+
const openCycleItem = (0, import_react25.useCallback)((item) => setOpenCycle(item), []);
|
|
24580
|
+
const autoOpenedFor = (0, import_react25.useRef)(null);
|
|
24581
|
+
(0, import_react25.useEffect)(() => {
|
|
24333
24582
|
if (autoOpenedFor.current === task.id || taskMessages.length === 0) return;
|
|
24334
24583
|
autoOpenedFor.current = task.id;
|
|
24335
24584
|
const latest = [...chatItems].reverse().find((i) => i.kind === "cycle");
|
|
24336
24585
|
if (latest && latest.outcome === "running") setOpenCycle(latest);
|
|
24337
24586
|
}, [task.id, taskMessages.length, chatItems]);
|
|
24338
24587
|
const liveCycle = openCycle ? chatItems.find((i) => i.kind === "cycle" && i.sessionId === openCycle.sessionId) ?? openCycle : null;
|
|
24339
|
-
return /* @__PURE__ */ (0,
|
|
24340
|
-
/* @__PURE__ */ (0,
|
|
24341
|
-
/* @__PURE__ */ (0,
|
|
24342
|
-
/* @__PURE__ */ (0,
|
|
24343
|
-
/* @__PURE__ */ (0,
|
|
24344
|
-
/* @__PURE__ */ (0,
|
|
24588
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%" }, children: [
|
|
24589
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("header", { className: "app__chat-header task-view__sub-header", style: { padding: "12px 14px" }, children: [
|
|
24590
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
24591
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowLeft, { size: 13 }) }),
|
|
24592
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "app__chat-header-info", children: [
|
|
24593
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("h3", { className: "app__chat-header-title", style: { fontSize: "13px", margin: 0 }, children: [
|
|
24345
24594
|
"Task #",
|
|
24346
24595
|
task.id,
|
|
24347
24596
|
": ",
|
|
24348
24597
|
task.title
|
|
24349
24598
|
] }),
|
|
24350
|
-
/* @__PURE__ */ (0,
|
|
24351
|
-
/* @__PURE__ */ (0,
|
|
24599
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { className: "app__chat-header-status", style: { fontSize: "10px" }, children: [
|
|
24600
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24352
24601
|
"span",
|
|
24353
24602
|
{
|
|
24354
24603
|
className: `agent-status-dot agent-status-dot--active ${isActiveLike ? "agent-status-dot--pulsing" : ""}`,
|
|
@@ -24359,24 +24608,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24359
24608
|
] })
|
|
24360
24609
|
] })
|
|
24361
24610
|
] }),
|
|
24362
|
-
/* @__PURE__ */ (0,
|
|
24363
|
-
task.status !== "done" && /* @__PURE__ */ (0,
|
|
24611
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
24612
|
+
task.status !== "done" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24364
24613
|
"button",
|
|
24365
24614
|
{
|
|
24366
24615
|
className: "confirm__btn confirm__btn--primary",
|
|
24367
24616
|
onClick: () => onToggleStatus(task),
|
|
24368
24617
|
title: isActiveLike ? "Pause this task (aborts the running agent)" : "Activate this task",
|
|
24369
24618
|
style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
|
|
24370
|
-
children: isActiveLike ? /* @__PURE__ */ (0,
|
|
24371
|
-
/* @__PURE__ */ (0,
|
|
24619
|
+
children: isActiveLike ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
24620
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pause, { size: 12 }),
|
|
24372
24621
|
" Pause"
|
|
24373
|
-
] }) : /* @__PURE__ */ (0,
|
|
24374
|
-
/* @__PURE__ */ (0,
|
|
24622
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
24623
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Play, { size: 12 }),
|
|
24375
24624
|
" Activate"
|
|
24376
24625
|
] })
|
|
24377
24626
|
}
|
|
24378
24627
|
),
|
|
24379
|
-
/* @__PURE__ */ (0,
|
|
24628
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24380
24629
|
"span",
|
|
24381
24630
|
{
|
|
24382
24631
|
className: "task-table__badge",
|
|
@@ -24386,8 +24635,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24386
24635
|
)
|
|
24387
24636
|
] })
|
|
24388
24637
|
] }),
|
|
24389
|
-
/* @__PURE__ */ (0,
|
|
24390
|
-
/* @__PURE__ */ (0,
|
|
24638
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "row" }, children: [
|
|
24639
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24391
24640
|
"aside",
|
|
24392
24641
|
{
|
|
24393
24642
|
style: {
|
|
@@ -24400,19 +24649,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24400
24649
|
background: "var(--vscode-sideBar-background, rgba(0,0,0,0.1))"
|
|
24401
24650
|
},
|
|
24402
24651
|
children: [
|
|
24403
|
-
/* @__PURE__ */ (0,
|
|
24404
|
-
/* @__PURE__ */ (0,
|
|
24405
|
-
totalCount > 0 && /* @__PURE__ */ (0,
|
|
24652
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { padding: "10px 12px", borderBottom: "1px solid var(--vscode-panel-border, rgba(255,255,255,0.05))" }, children: [
|
|
24653
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: 0, fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
|
|
24654
|
+
totalCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { fontSize: "10px", opacity: 0.5, marginTop: "2px" }, children: [
|
|
24406
24655
|
completedCount,
|
|
24407
24656
|
"/",
|
|
24408
24657
|
totalCount,
|
|
24409
24658
|
" done"
|
|
24410
24659
|
] })
|
|
24411
24660
|
] }),
|
|
24412
|
-
/* @__PURE__ */ (0,
|
|
24661
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { padding: "8px 10px", display: "flex", flexDirection: "column", gap: "4px" }, children: totalCount === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "11px", opacity: 0.4, padding: "8px 4px" }, children: "No checklist items." }) : (task.checklist || []).map((item) => {
|
|
24413
24662
|
const isDone = item.status === "done";
|
|
24414
24663
|
const isInProgress = item.status === "in_progress";
|
|
24415
|
-
return /* @__PURE__ */ (0,
|
|
24664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24416
24665
|
"label",
|
|
24417
24666
|
{
|
|
24418
24667
|
style: {
|
|
@@ -24429,7 +24678,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24429
24678
|
},
|
|
24430
24679
|
title: isInProgress ? "In progress" : isDone ? "Done" : "Pending",
|
|
24431
24680
|
children: [
|
|
24432
|
-
/* @__PURE__ */ (0,
|
|
24681
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24433
24682
|
"input",
|
|
24434
24683
|
{
|
|
24435
24684
|
type: "checkbox",
|
|
@@ -24438,7 +24687,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24438
24687
|
style: { marginTop: "2px", cursor: "pointer", flexShrink: 0 }
|
|
24439
24688
|
}
|
|
24440
24689
|
),
|
|
24441
|
-
/* @__PURE__ */ (0,
|
|
24690
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { wordBreak: "break-word" }, children: item.text })
|
|
24442
24691
|
]
|
|
24443
24692
|
},
|
|
24444
24693
|
item.id
|
|
@@ -24447,8 +24696,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24447
24696
|
]
|
|
24448
24697
|
}
|
|
24449
24698
|
),
|
|
24450
|
-
/* @__PURE__ */ (0,
|
|
24451
|
-
liveCycle ? /* @__PURE__ */ (0,
|
|
24699
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, minWidth: 0, display: "flex", flexDirection: "column" }, children: [
|
|
24700
|
+
liveCycle ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24452
24701
|
TaskCycleView,
|
|
24453
24702
|
{
|
|
24454
24703
|
item: liveCycle,
|
|
@@ -24456,8 +24705,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24456
24705
|
onBack: () => setOpenCycle(null)
|
|
24457
24706
|
},
|
|
24458
24707
|
liveCycle.sessionId
|
|
24459
|
-
) : taskMessages.length === 0 ? /* @__PURE__ */ (0,
|
|
24460
|
-
/* @__PURE__ */ (0,
|
|
24708
|
+
) : taskMessages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "messages messages--empty", children: "No messages in this execution yet. Agent will start on next tick." }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(MessageList, { items: chatItems, sessionId: null, compact: true, onOpenCycle: openCycleItem }),
|
|
24709
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24461
24710
|
Composer,
|
|
24462
24711
|
{
|
|
24463
24712
|
disabled: isSending,
|
|
@@ -24494,12 +24743,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24494
24743
|
statusColor
|
|
24495
24744
|
}) {
|
|
24496
24745
|
const isRunning = task.status === "active" || task.status === "reviewing" || task.status === "planning";
|
|
24497
|
-
const [draftTitle, setDraftTitle] = (0,
|
|
24498
|
-
const [draftObjective, setDraftObjective] = (0,
|
|
24499
|
-
const [lastTaskId, setLastTaskId] = (0,
|
|
24746
|
+
const [draftTitle, setDraftTitle] = (0, import_react25.useState)(task.title);
|
|
24747
|
+
const [draftObjective, setDraftObjective] = (0, import_react25.useState)(task.objective);
|
|
24748
|
+
const [lastTaskId, setLastTaskId] = (0, import_react25.useState)(task.id);
|
|
24500
24749
|
const trimmedTitle = draftTitle.trim();
|
|
24501
24750
|
const isDirty = trimmedTitle !== task.title.trim() || draftObjective.trim() !== task.objective.trim();
|
|
24502
|
-
(0,
|
|
24751
|
+
(0, import_react25.useEffect)(() => {
|
|
24503
24752
|
if (task.id !== lastTaskId) {
|
|
24504
24753
|
setDraftTitle(task.title);
|
|
24505
24754
|
setDraftObjective(task.objective);
|
|
@@ -24514,16 +24763,16 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24514
24763
|
setDraftTitle(task.title);
|
|
24515
24764
|
setDraftObjective(task.objective);
|
|
24516
24765
|
};
|
|
24517
|
-
return /* @__PURE__ */ (0,
|
|
24518
|
-
/* @__PURE__ */ (0,
|
|
24519
|
-
/* @__PURE__ */ (0,
|
|
24520
|
-
/* @__PURE__ */ (0,
|
|
24521
|
-
/* @__PURE__ */ (0,
|
|
24522
|
-
/* @__PURE__ */ (0,
|
|
24766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", height: "100%", overflowY: "auto" }, children: [
|
|
24767
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "task-view__sub-header", style: { padding: "12px 14px", display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
24768
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
24769
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "settings-panel__back-btn", onClick: onBack, title: "Back to task list", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowLeft, { size: 13 }) }),
|
|
24770
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 700, display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
24771
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("span", { style: { opacity: 0.6 }, children: [
|
|
24523
24772
|
"Task #",
|
|
24524
24773
|
task.id
|
|
24525
24774
|
] }),
|
|
24526
|
-
/* @__PURE__ */ (0,
|
|
24775
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24527
24776
|
"input",
|
|
24528
24777
|
{
|
|
24529
24778
|
value: draftTitle,
|
|
@@ -24544,7 +24793,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24544
24793
|
}
|
|
24545
24794
|
)
|
|
24546
24795
|
] }),
|
|
24547
|
-
/* @__PURE__ */ (0,
|
|
24796
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24548
24797
|
"span",
|
|
24549
24798
|
{
|
|
24550
24799
|
className: "task-table__badge",
|
|
@@ -24553,8 +24802,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24553
24802
|
}
|
|
24554
24803
|
)
|
|
24555
24804
|
] }),
|
|
24556
|
-
/* @__PURE__ */ (0,
|
|
24557
|
-
/* @__PURE__ */ (0,
|
|
24805
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "inline-flex", gap: "6px" }, children: [
|
|
24806
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24558
24807
|
"button",
|
|
24559
24808
|
{
|
|
24560
24809
|
className: "confirm__btn",
|
|
@@ -24564,7 +24813,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24564
24813
|
children: "View Log"
|
|
24565
24814
|
}
|
|
24566
24815
|
),
|
|
24567
|
-
task.worktreePath && /* @__PURE__ */ (0,
|
|
24816
|
+
task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24568
24817
|
"button",
|
|
24569
24818
|
{
|
|
24570
24819
|
className: "confirm__btn",
|
|
@@ -24572,12 +24821,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24572
24821
|
title: `Commit pending changes to ${task.branch} and remove the worktree`,
|
|
24573
24822
|
style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
|
|
24574
24823
|
children: [
|
|
24575
|
-
/* @__PURE__ */ (0,
|
|
24824
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 12 }),
|
|
24576
24825
|
" Discard worktree"
|
|
24577
24826
|
]
|
|
24578
24827
|
}
|
|
24579
24828
|
),
|
|
24580
|
-
/* @__PURE__ */ (0,
|
|
24829
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24581
24830
|
"button",
|
|
24582
24831
|
{
|
|
24583
24832
|
className: "confirm__btn",
|
|
@@ -24585,28 +24834,28 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24585
24834
|
title: task.archived ? "Unarchive this task" : "Archive this task (hides it from the list, excludes from scheduler)",
|
|
24586
24835
|
style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
|
|
24587
24836
|
children: [
|
|
24588
|
-
/* @__PURE__ */ (0,
|
|
24837
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Archive, { size: 12 }),
|
|
24589
24838
|
" ",
|
|
24590
24839
|
task.archived ? "Unarchive" : "Archive"
|
|
24591
24840
|
]
|
|
24592
24841
|
}
|
|
24593
24842
|
),
|
|
24594
|
-
/* @__PURE__ */ (0,
|
|
24843
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24595
24844
|
"button",
|
|
24596
24845
|
{
|
|
24597
24846
|
className: "confirm__btn confirm__btn--primary",
|
|
24598
24847
|
onClick: () => onToggleStatus(task),
|
|
24599
24848
|
style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px" },
|
|
24600
|
-
children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0,
|
|
24601
|
-
/* @__PURE__ */ (0,
|
|
24849
|
+
children: task.status === "active" || task.status === "reviewing" || task.status === "planning" ? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
24850
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Pause, { size: 12 }),
|
|
24602
24851
|
" Pause"
|
|
24603
|
-
] }) : /* @__PURE__ */ (0,
|
|
24604
|
-
/* @__PURE__ */ (0,
|
|
24852
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
|
|
24853
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Play, { size: 12 }),
|
|
24605
24854
|
" Activate"
|
|
24606
24855
|
] })
|
|
24607
24856
|
}
|
|
24608
24857
|
),
|
|
24609
|
-
/* @__PURE__ */ (0,
|
|
24858
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24610
24859
|
"button",
|
|
24611
24860
|
{
|
|
24612
24861
|
className: "confirm__btn",
|
|
@@ -24614,22 +24863,22 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24614
24863
|
title: "Permanently delete this task and all its messages",
|
|
24615
24864
|
style: { padding: "3px 10px", fontSize: "10px", display: "inline-flex", alignItems: "center", gap: "4px", color: "#ef4444" },
|
|
24616
24865
|
children: [
|
|
24617
|
-
/* @__PURE__ */ (0,
|
|
24866
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Trash, { size: 12 }),
|
|
24618
24867
|
" Delete"
|
|
24619
24868
|
]
|
|
24620
24869
|
}
|
|
24621
24870
|
)
|
|
24622
24871
|
] })
|
|
24623
24872
|
] }),
|
|
24624
|
-
/* @__PURE__ */ (0,
|
|
24625
|
-
task.branch && /* @__PURE__ */ (0,
|
|
24626
|
-
/* @__PURE__ */ (0,
|
|
24627
|
-
/* @__PURE__ */ (0,
|
|
24628
|
-
!task.worktreePath && /* @__PURE__ */ (0,
|
|
24873
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { padding: "16px", maxWidth: "720px" }, children: [
|
|
24874
|
+
task.branch && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px", display: "flex", alignItems: "center", gap: "6px", fontSize: "11px", opacity: 0.75 }, children: [
|
|
24875
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(GitBranch, { size: 12 }),
|
|
24876
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { style: { fontFamily: "monospace" }, children: task.branch }),
|
|
24877
|
+
!task.worktreePath && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { opacity: 0.6 }, children: "(worktree removed)" })
|
|
24629
24878
|
] }),
|
|
24630
|
-
/* @__PURE__ */ (0,
|
|
24631
|
-
/* @__PURE__ */ (0,
|
|
24632
|
-
/* @__PURE__ */ (0,
|
|
24879
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
|
|
24880
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Objective" }),
|
|
24881
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24633
24882
|
"textarea",
|
|
24634
24883
|
{
|
|
24635
24884
|
value: draftObjective,
|
|
@@ -24653,8 +24902,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24653
24902
|
}
|
|
24654
24903
|
}
|
|
24655
24904
|
),
|
|
24656
|
-
isDirty && /* @__PURE__ */ (0,
|
|
24657
|
-
/* @__PURE__ */ (0,
|
|
24905
|
+
isDirty && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { display: "flex", gap: "6px", alignItems: "center", marginTop: "8px" }, children: [
|
|
24906
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24658
24907
|
"button",
|
|
24659
24908
|
{
|
|
24660
24909
|
className: "confirm__btn confirm__btn--primary",
|
|
@@ -24667,13 +24916,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24667
24916
|
children: "Save"
|
|
24668
24917
|
}
|
|
24669
24918
|
),
|
|
24670
|
-
/* @__PURE__ */ (0,
|
|
24671
|
-
isRunning && /* @__PURE__ */ (0,
|
|
24919
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("button", { className: "confirm__btn", onClick: resetDraft, style: { padding: "3px 10px", fontSize: "10px" }, children: "Cancel" }),
|
|
24920
|
+
isRunning && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { style: { fontSize: "10px", opacity: 0.6 }, children: "Applies from the next cycle." })
|
|
24672
24921
|
] })
|
|
24673
24922
|
] }),
|
|
24674
|
-
/* @__PURE__ */ (0,
|
|
24675
|
-
/* @__PURE__ */ (0,
|
|
24676
|
-
/* @__PURE__ */ (0,
|
|
24923
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
|
|
24924
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Assigned Agent" }),
|
|
24925
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24677
24926
|
"select",
|
|
24678
24927
|
{
|
|
24679
24928
|
value: task.agentId || "",
|
|
@@ -24693,8 +24942,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24693
24942
|
},
|
|
24694
24943
|
title: isRunning ? "Pause the task before changing its agent" : "Choose which agent runs this task",
|
|
24695
24944
|
children: [
|
|
24696
|
-
/* @__PURE__ */ (0,
|
|
24697
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24945
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24946
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24698
24947
|
a2.name,
|
|
24699
24948
|
" (",
|
|
24700
24949
|
a2.provider,
|
|
@@ -24704,9 +24953,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24704
24953
|
}
|
|
24705
24954
|
)
|
|
24706
24955
|
] }),
|
|
24707
|
-
/* @__PURE__ */ (0,
|
|
24708
|
-
/* @__PURE__ */ (0,
|
|
24709
|
-
/* @__PURE__ */ (0,
|
|
24956
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
|
|
24957
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Planner Agent" }),
|
|
24958
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24710
24959
|
"select",
|
|
24711
24960
|
{
|
|
24712
24961
|
value: task.plannerAgentId || "",
|
|
@@ -24715,8 +24964,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24715
24964
|
style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none", width: "100%", cursor: isRunning ? "not-allowed" : "pointer", opacity: isRunning ? 0.6 : 1 },
|
|
24716
24965
|
title: isRunning ? "Pause the task before changing its planner" : "Agent that runs the planning phase (read-only). Unset: falls back to the project planner, then the developer.",
|
|
24717
24966
|
children: [
|
|
24718
|
-
/* @__PURE__ */ (0,
|
|
24719
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24967
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24968
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24720
24969
|
a2.name,
|
|
24721
24970
|
" (",
|
|
24722
24971
|
a2.provider,
|
|
@@ -24726,9 +24975,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24726
24975
|
}
|
|
24727
24976
|
)
|
|
24728
24977
|
] }),
|
|
24729
|
-
/* @__PURE__ */ (0,
|
|
24730
|
-
/* @__PURE__ */ (0,
|
|
24731
|
-
/* @__PURE__ */ (0,
|
|
24978
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
|
|
24979
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Reviewer Agent" }),
|
|
24980
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24732
24981
|
"select",
|
|
24733
24982
|
{
|
|
24734
24983
|
value: task.reviewerAgentId || "",
|
|
@@ -24737,8 +24986,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24737
24986
|
style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none", width: "100%", cursor: isRunning ? "not-allowed" : "pointer", opacity: isRunning ? 0.6 : 1 },
|
|
24738
24987
|
title: isRunning ? "Pause the task before changing its reviewer" : "Agent that reviews the branch at DONE. Unset: falls back to the project reviewer, then the developer.",
|
|
24739
24988
|
children: [
|
|
24740
|
-
/* @__PURE__ */ (0,
|
|
24741
|
-
agents.map((a2) => /* @__PURE__ */ (0,
|
|
24989
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "", children: "Project default" }),
|
|
24990
|
+
agents.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("option", { value: a2.id, children: [
|
|
24742
24991
|
a2.name,
|
|
24743
24992
|
" (",
|
|
24744
24993
|
a2.provider,
|
|
@@ -24748,31 +24997,31 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24748
24997
|
}
|
|
24749
24998
|
)
|
|
24750
24999
|
] }),
|
|
24751
|
-
/* @__PURE__ */ (0,
|
|
24752
|
-
/* @__PURE__ */ (0,
|
|
24753
|
-
/* @__PURE__ */ (0,
|
|
25000
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { style: { marginBottom: "16px" }, children: [
|
|
25001
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 6px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Phases" }),
|
|
25002
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", gap: "12px" }, children: [
|
|
24754
25003
|
{ flag: "planningEnabled", label: "Planning phase", value: task.planningEnabled },
|
|
24755
25004
|
{ flag: "reviewEnabled", label: "Review at DONE", value: task.reviewEnabled },
|
|
24756
25005
|
{ flag: "sddEnabled", label: "SDD mode (.md specs)", value: task.sddEnabled }
|
|
24757
|
-
].map(({ flag, label, value }) => /* @__PURE__ */ (0,
|
|
25006
|
+
].map(({ flag, label, value }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", flex: 1 }, children: [
|
|
24758
25007
|
label,
|
|
24759
|
-
/* @__PURE__ */ (0,
|
|
25008
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24760
25009
|
"select",
|
|
24761
25010
|
{
|
|
24762
25011
|
value: value === true ? "on" : value === false ? "off" : "inherit",
|
|
24763
25012
|
onChange: (e) => onSetFlag(task, flag, e.target.value === "inherit" ? null : e.target.value === "on"),
|
|
24764
25013
|
style: { background: "var(--vscode-input-background, #252526)", color: "var(--vscode-input-foreground)", border: "1px solid var(--vscode-input-border, #3c3c3c)", borderRadius: "4px", padding: "6px 8px", fontSize: "12px", outline: "none" },
|
|
24765
25014
|
children: [
|
|
24766
|
-
/* @__PURE__ */ (0,
|
|
24767
|
-
/* @__PURE__ */ (0,
|
|
24768
|
-
/* @__PURE__ */ (0,
|
|
25015
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "inherit", children: "Project default" }),
|
|
25016
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "on", children: "On" }),
|
|
25017
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "off", children: "Off" })
|
|
24769
25018
|
]
|
|
24770
25019
|
}
|
|
24771
25020
|
)
|
|
24772
25021
|
] }, flag)) }),
|
|
24773
|
-
/* @__PURE__ */ (0,
|
|
25022
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { style: { fontSize: "11px", display: "flex", flexDirection: "column", gap: "4px", marginTop: "12px", maxWidth: "260px" }, children: [
|
|
24774
25023
|
"Max run seconds per cycle",
|
|
24775
|
-
/* @__PURE__ */ (0,
|
|
25024
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24776
25025
|
"input",
|
|
24777
25026
|
{
|
|
24778
25027
|
type: "number",
|
|
@@ -24795,7 +25044,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24795
25044
|
)
|
|
24796
25045
|
] })
|
|
24797
25046
|
] }),
|
|
24798
|
-
task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0,
|
|
25047
|
+
task.status === "blocked" && task.blockedReason && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24799
25048
|
"div",
|
|
24800
25049
|
{
|
|
24801
25050
|
style: {
|
|
@@ -24808,19 +25057,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24808
25057
|
fontSize: "12px"
|
|
24809
25058
|
},
|
|
24810
25059
|
children: [
|
|
24811
|
-
/* @__PURE__ */ (0,
|
|
24812
|
-
/* @__PURE__ */ (0,
|
|
25060
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("strong", { children: [
|
|
25061
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TriangleAlert, { size: 13 }),
|
|
24813
25062
|
" Blocked Reason:"
|
|
24814
25063
|
] }),
|
|
24815
|
-
/* @__PURE__ */ (0,
|
|
25064
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { style: { margin: "4px 0 0 0" }, children: task.blockedReason })
|
|
24816
25065
|
]
|
|
24817
25066
|
}
|
|
24818
25067
|
),
|
|
24819
|
-
/* @__PURE__ */ (0,
|
|
24820
|
-
/* @__PURE__ */ (0,
|
|
24821
|
-
/* @__PURE__ */ (0,
|
|
25068
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
25069
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h4", { style: { margin: "0 0 8px 0", fontSize: "10px", textTransform: "uppercase", letterSpacing: "0.08em", opacity: 0.6 }, children: "Checklist" }),
|
|
25070
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: (task.checklist || []).map((item) => {
|
|
24822
25071
|
const isDone = item.status === "done";
|
|
24823
|
-
return /* @__PURE__ */ (0,
|
|
25072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
24824
25073
|
"label",
|
|
24825
25074
|
{
|
|
24826
25075
|
style: {
|
|
@@ -24837,7 +25086,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24837
25086
|
opacity: isDone ? 0.6 : 1
|
|
24838
25087
|
},
|
|
24839
25088
|
children: [
|
|
24840
|
-
/* @__PURE__ */ (0,
|
|
25089
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
24841
25090
|
"input",
|
|
24842
25091
|
{
|
|
24843
25092
|
type: "checkbox",
|
|
@@ -24846,7 +25095,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24846
25095
|
style: { marginTop: "2px", cursor: "pointer" }
|
|
24847
25096
|
}
|
|
24848
25097
|
),
|
|
24849
|
-
/* @__PURE__ */ (0,
|
|
25098
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children: item.text })
|
|
24850
25099
|
]
|
|
24851
25100
|
},
|
|
24852
25101
|
item.id
|
|
@@ -24858,7 +25107,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24858
25107
|
}
|
|
24859
25108
|
|
|
24860
25109
|
// src/useVoice.ts
|
|
24861
|
-
var
|
|
25110
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
24862
25111
|
|
|
24863
25112
|
// src/pcm_wav.ts
|
|
24864
25113
|
function encodeWavPcm16(samples, rate) {
|
|
@@ -24927,41 +25176,41 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24927
25176
|
const { voice, chatStatus, pendingConfirmCount, items, onTranscript } = opts;
|
|
24928
25177
|
const available = !!voice && voice.enabled && voice.configured && canCapture();
|
|
24929
25178
|
const canSpeak = !!voice?.canSpeak;
|
|
24930
|
-
const [phase, setPhase] = (0,
|
|
24931
|
-
const [mode, setMode] = (0,
|
|
24932
|
-
const [error, setError] = (0,
|
|
24933
|
-
const voiceRef = (0,
|
|
25179
|
+
const [phase, setPhase] = (0, import_react26.useState)("idle");
|
|
25180
|
+
const [mode, setMode] = (0, import_react26.useState)("dictate");
|
|
25181
|
+
const [error, setError] = (0, import_react26.useState)(null);
|
|
25182
|
+
const voiceRef = (0, import_react26.useRef)(voice);
|
|
24934
25183
|
voiceRef.current = voice;
|
|
24935
|
-
const bufferMsRef = (0,
|
|
25184
|
+
const bufferMsRef = (0, import_react26.useRef)(voice?.playbackBufferMs);
|
|
24936
25185
|
bufferMsRef.current = voice?.playbackBufferMs;
|
|
24937
|
-
const phaseRef = (0,
|
|
25186
|
+
const phaseRef = (0, import_react26.useRef)(phase);
|
|
24938
25187
|
phaseRef.current = phase;
|
|
24939
|
-
const modeRef = (0,
|
|
25188
|
+
const modeRef = (0, import_react26.useRef)(mode);
|
|
24940
25189
|
modeRef.current = mode;
|
|
24941
|
-
const onTranscriptRef = (0,
|
|
25190
|
+
const onTranscriptRef = (0, import_react26.useRef)(onTranscript);
|
|
24942
25191
|
onTranscriptRef.current = onTranscript;
|
|
24943
|
-
const itemsRef = (0,
|
|
25192
|
+
const itemsRef = (0, import_react26.useRef)(items);
|
|
24944
25193
|
itemsRef.current = items;
|
|
24945
|
-
const chatStatusRef = (0,
|
|
25194
|
+
const chatStatusRef = (0, import_react26.useRef)(chatStatus);
|
|
24946
25195
|
chatStatusRef.current = chatStatus;
|
|
24947
|
-
const streamRef = (0,
|
|
24948
|
-
const recorderRef = (0,
|
|
24949
|
-
const chunksRef = (0,
|
|
24950
|
-
const vadRef = (0,
|
|
24951
|
-
const speechAbortRef = (0,
|
|
24952
|
-
const idleTimerRef = (0,
|
|
24953
|
-
const heardSpeechRef = (0,
|
|
24954
|
-
const sawStreamingRef = (0,
|
|
24955
|
-
const cursorRef = (0,
|
|
24956
|
-
const queueRef = (0,
|
|
24957
|
-
const apply = (0,
|
|
25196
|
+
const streamRef = (0, import_react26.useRef)(null);
|
|
25197
|
+
const recorderRef = (0, import_react26.useRef)(null);
|
|
25198
|
+
const chunksRef = (0, import_react26.useRef)([]);
|
|
25199
|
+
const vadRef = (0, import_react26.useRef)(null);
|
|
25200
|
+
const speechAbortRef = (0, import_react26.useRef)(null);
|
|
25201
|
+
const idleTimerRef = (0, import_react26.useRef)(null);
|
|
25202
|
+
const heardSpeechRef = (0, import_react26.useRef)(false);
|
|
25203
|
+
const sawStreamingRef = (0, import_react26.useRef)(false);
|
|
25204
|
+
const cursorRef = (0, import_react26.useRef)(0);
|
|
25205
|
+
const queueRef = (0, import_react26.useRef)([]);
|
|
25206
|
+
const apply = (0, import_react26.useCallback)((event) => {
|
|
24958
25207
|
setPhase((current) => nextPhase(current, event));
|
|
24959
25208
|
}, []);
|
|
24960
25209
|
const clearIdleTimer = () => {
|
|
24961
25210
|
if (idleTimerRef.current) clearTimeout(idleTimerRef.current);
|
|
24962
25211
|
idleTimerRef.current = null;
|
|
24963
25212
|
};
|
|
24964
|
-
const teardownCapture = (0,
|
|
25213
|
+
const teardownCapture = (0, import_react26.useCallback)(() => {
|
|
24965
25214
|
clearIdleTimer();
|
|
24966
25215
|
try {
|
|
24967
25216
|
vadRef.current?.destroy();
|
|
@@ -24978,11 +25227,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24978
25227
|
chunksRef.current = [];
|
|
24979
25228
|
heardSpeechRef.current = false;
|
|
24980
25229
|
}, []);
|
|
24981
|
-
const stopPlayback = (0,
|
|
25230
|
+
const stopPlayback = (0, import_react26.useCallback)(() => {
|
|
24982
25231
|
speechAbortRef.current?.abort();
|
|
24983
25232
|
speechAbortRef.current = null;
|
|
24984
25233
|
}, []);
|
|
24985
|
-
const fail = (0,
|
|
25234
|
+
const fail = (0, import_react26.useCallback)(
|
|
24986
25235
|
(message) => {
|
|
24987
25236
|
teardownCapture();
|
|
24988
25237
|
stopPlayback();
|
|
@@ -24991,7 +25240,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
24991
25240
|
},
|
|
24992
25241
|
[apply, teardownCapture, stopPlayback]
|
|
24993
25242
|
);
|
|
24994
|
-
const finishRecording = (0,
|
|
25243
|
+
const finishRecording = (0, import_react26.useCallback)(() => {
|
|
24995
25244
|
const recorder = recorderRef.current;
|
|
24996
25245
|
if (!recorder || recorder.state === "inactive") return;
|
|
24997
25246
|
recorder.onstop = async () => {
|
|
@@ -25021,7 +25270,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25021
25270
|
};
|
|
25022
25271
|
recorder.stop();
|
|
25023
25272
|
}, [apply, fail, teardownCapture]);
|
|
25024
|
-
const startRecording = (0,
|
|
25273
|
+
const startRecording = (0, import_react26.useCallback)(async () => {
|
|
25025
25274
|
setError(null);
|
|
25026
25275
|
chunksRef.current = [];
|
|
25027
25276
|
heardSpeechRef.current = false;
|
|
@@ -25066,7 +25315,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25066
25315
|
fail(`Microphone unavailable: ${err}`);
|
|
25067
25316
|
}
|
|
25068
25317
|
}, [apply, fail, finishRecording, teardownCapture]);
|
|
25069
|
-
const speakReply = (0,
|
|
25318
|
+
const speakReply = (0, import_react26.useCallback)(async () => {
|
|
25070
25319
|
const text = queueRef.current.shift();
|
|
25071
25320
|
if (!text) {
|
|
25072
25321
|
apply({
|
|
@@ -25105,10 +25354,10 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25105
25354
|
fail(`Synthesis failed: ${err}`);
|
|
25106
25355
|
}
|
|
25107
25356
|
}, [apply, fail]);
|
|
25108
|
-
(0,
|
|
25357
|
+
(0, import_react26.useEffect)(() => {
|
|
25109
25358
|
if (chatStatus === "streaming") sawStreamingRef.current = true;
|
|
25110
25359
|
}, [chatStatus]);
|
|
25111
|
-
(0,
|
|
25360
|
+
(0, import_react26.useEffect)(() => {
|
|
25112
25361
|
if (modeRef.current !== "conversation") return;
|
|
25113
25362
|
if (phaseRef.current === "idle") return;
|
|
25114
25363
|
const { texts, cursor } = takeFinalizedBubbles(items, cursorRef.current);
|
|
@@ -25117,7 +25366,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25117
25366
|
queueRef.current.push(...texts);
|
|
25118
25367
|
apply({ kind: "speechQueued", mode: "conversation", canSpeak });
|
|
25119
25368
|
}, [items, canSpeak, apply]);
|
|
25120
|
-
(0,
|
|
25369
|
+
(0, import_react26.useEffect)(() => {
|
|
25121
25370
|
if (phase !== "awaiting") return;
|
|
25122
25371
|
if (chatStatus === "error") {
|
|
25123
25372
|
apply({ kind: "failed", mode: "conversation" });
|
|
@@ -25139,8 +25388,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25139
25388
|
pendingSpeech: queueRef.current.length
|
|
25140
25389
|
});
|
|
25141
25390
|
}, [phase, chatStatus, pendingConfirmCount, canSpeak, apply]);
|
|
25142
|
-
const prevPhase = (0,
|
|
25143
|
-
(0,
|
|
25391
|
+
const prevPhase = (0, import_react26.useRef)("idle");
|
|
25392
|
+
(0, import_react26.useEffect)(() => {
|
|
25144
25393
|
const from = prevPhase.current;
|
|
25145
25394
|
prevPhase.current = phase;
|
|
25146
25395
|
if (from === phase) return;
|
|
@@ -25152,14 +25401,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25152
25401
|
queueRef.current = [];
|
|
25153
25402
|
}
|
|
25154
25403
|
}, [phase, startRecording, speakReply, teardownCapture, stopPlayback]);
|
|
25155
|
-
(0,
|
|
25404
|
+
(0, import_react26.useEffect)(
|
|
25156
25405
|
() => () => {
|
|
25157
25406
|
teardownCapture();
|
|
25158
25407
|
stopPlayback();
|
|
25159
25408
|
},
|
|
25160
25409
|
[teardownCapture, stopPlayback]
|
|
25161
25410
|
);
|
|
25162
|
-
const toggle = (0,
|
|
25411
|
+
const toggle = (0, import_react26.useCallback)(() => {
|
|
25163
25412
|
if (!available) return;
|
|
25164
25413
|
const current = phaseRef.current;
|
|
25165
25414
|
if (current === "idle") {
|
|
@@ -25173,7 +25422,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25173
25422
|
}
|
|
25174
25423
|
apply({ kind: "userStop", mode: modeRef.current });
|
|
25175
25424
|
}, [available, apply, finishRecording]);
|
|
25176
|
-
const changeMode = (0,
|
|
25425
|
+
const changeMode = (0, import_react26.useCallback)(
|
|
25177
25426
|
(next) => {
|
|
25178
25427
|
apply({ kind: "userStop", mode: modeRef.current });
|
|
25179
25428
|
setMode(next);
|
|
@@ -25184,7 +25433,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25184
25433
|
}
|
|
25185
25434
|
|
|
25186
25435
|
// src/App.tsx
|
|
25187
|
-
var
|
|
25436
|
+
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
25188
25437
|
function takeInjectedActivation() {
|
|
25189
25438
|
const w2 = window;
|
|
25190
25439
|
const id = typeof w2.__caretakerAssistant === "string" ? w2.__caretakerAssistant : null;
|
|
@@ -25192,36 +25441,37 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25192
25441
|
return id;
|
|
25193
25442
|
}
|
|
25194
25443
|
function App({ postMessage, layout = "compact" }) {
|
|
25195
|
-
const [chatState, dispatch] = (0,
|
|
25196
|
-
const [agents, setAgents] = (0,
|
|
25197
|
-
const [sessions, setSessions] = (0,
|
|
25198
|
-
const [selectedAgentId, setSelectedAgentId] = (0,
|
|
25199
|
-
const [selectedSessionId, setSelectedSessionId] = (0,
|
|
25200
|
-
const [showSessions, setShowSessions] = (0,
|
|
25201
|
-
const [showAllAgents, setShowAllAgents] = (0,
|
|
25202
|
-
const [pendingDelete, setPendingDelete] = (0,
|
|
25203
|
-
const [activeScreen, setActiveScreen] = (0,
|
|
25204
|
-
const [settingsTab, setSettingsTab] = (0,
|
|
25205
|
-
const [
|
|
25206
|
-
const [
|
|
25207
|
-
const [
|
|
25208
|
-
const [
|
|
25209
|
-
const [
|
|
25210
|
-
const [
|
|
25211
|
-
const [
|
|
25212
|
-
const [
|
|
25213
|
-
const [
|
|
25214
|
-
const [
|
|
25215
|
-
const [
|
|
25216
|
-
const [
|
|
25217
|
-
const [
|
|
25218
|
-
const [
|
|
25219
|
-
const [
|
|
25220
|
-
const [
|
|
25221
|
-
(0,
|
|
25444
|
+
const [chatState, dispatch] = (0, import_react27.useReducer)(chatReducer, initialChatState);
|
|
25445
|
+
const [agents, setAgents] = (0, import_react27.useState)([]);
|
|
25446
|
+
const [sessions, setSessions] = (0, import_react27.useState)([]);
|
|
25447
|
+
const [selectedAgentId, setSelectedAgentId] = (0, import_react27.useState)(null);
|
|
25448
|
+
const [selectedSessionId, setSelectedSessionId] = (0, import_react27.useState)(null);
|
|
25449
|
+
const [showSessions, setShowSessions] = (0, import_react27.useState)(false);
|
|
25450
|
+
const [showAllAgents, setShowAllAgents] = (0, import_react27.useState)(false);
|
|
25451
|
+
const [pendingDelete, setPendingDelete] = (0, import_react27.useState)(null);
|
|
25452
|
+
const [activeScreen, setActiveScreen] = (0, import_react27.useState)("chat");
|
|
25453
|
+
const [settingsTab, setSettingsTab] = (0, import_react27.useState)();
|
|
25454
|
+
const [orchestrationPending, setOrchestrationPending] = (0, import_react27.useState)(0);
|
|
25455
|
+
const [settingsData, setSettingsData] = (0, import_react27.useState)(null);
|
|
25456
|
+
const [modelsResult, setModelsResult] = (0, import_react27.useState)(null);
|
|
25457
|
+
const [acpRegistry, setAcpRegistry] = (0, import_react27.useState)(null);
|
|
25458
|
+
const [acpInstall, setAcpInstall] = (0, import_react27.useState)(null);
|
|
25459
|
+
const [refreshingSourceId, setRefreshingSourceId] = (0, import_react27.useState)(null);
|
|
25460
|
+
const [refreshOutcome, setRefreshOutcome] = (0, import_react27.useState)(null);
|
|
25461
|
+
const [mcpAuthOutcome, setMcpAuthOutcome] = (0, import_react27.useState)(null);
|
|
25462
|
+
const [taskRuns, setTaskRuns] = (0, import_react27.useState)({});
|
|
25463
|
+
const [voiceConfig, setVoiceConfig] = (0, import_react27.useState)(null);
|
|
25464
|
+
const [sttCatalogResult, setSttCatalogResult] = (0, import_react27.useState)(null);
|
|
25465
|
+
const [ttsCatalogResult, setTtsCatalogResult] = (0, import_react27.useState)(null);
|
|
25466
|
+
const [composerDraft, setComposerDraft] = (0, import_react27.useState)("");
|
|
25467
|
+
const [activation, setActivation] = (0, import_react27.useState)(null);
|
|
25468
|
+
const [confirmedAgentId, setConfirmedAgentId] = (0, import_react27.useState)(null);
|
|
25469
|
+
const [pendingAssistantId, setPendingAssistantId] = (0, import_react27.useState)(() => takeInjectedActivation());
|
|
25470
|
+
const [composerFocusToken, setComposerFocusToken] = (0, import_react27.useState)(0);
|
|
25471
|
+
(0, import_react27.useEffect)(() => {
|
|
25222
25472
|
postMessage({ type: "webviewReady" });
|
|
25223
25473
|
}, []);
|
|
25224
|
-
(0,
|
|
25474
|
+
(0, import_react27.useEffect)(() => {
|
|
25225
25475
|
function handle(event) {
|
|
25226
25476
|
const msg = event.data;
|
|
25227
25477
|
if (!msg || typeof msg !== "object" || !("type" in msg)) return;
|
|
@@ -25353,15 +25603,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25353
25603
|
if (voice2) msg.voice = true;
|
|
25354
25604
|
postMessage(msg);
|
|
25355
25605
|
};
|
|
25356
|
-
const onConfirm = (0,
|
|
25606
|
+
const onConfirm = (0, import_react27.useCallback)((id, decision) => {
|
|
25357
25607
|
dispatch({ kind: "permission-resolved", id });
|
|
25358
25608
|
postMessage({ type: "permission_response", id, decision });
|
|
25359
25609
|
}, [postMessage]);
|
|
25360
25610
|
const onAbort = () => {
|
|
25361
25611
|
postMessage({ type: "abort" });
|
|
25362
25612
|
};
|
|
25363
|
-
const confirmCards = (0,
|
|
25364
|
-
() => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0,
|
|
25613
|
+
const confirmCards = (0, import_react27.useMemo)(
|
|
25614
|
+
() => chatState.pendingConfirms.map((p) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ConfirmCard, { pending: p, onDecide: onConfirm }, p.id)),
|
|
25365
25615
|
[chatState.pendingConfirms, onConfirm]
|
|
25366
25616
|
);
|
|
25367
25617
|
const onSelectAgent = (agentId) => {
|
|
@@ -25401,7 +25651,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25401
25651
|
const cancelDeleteSession = () => {
|
|
25402
25652
|
setPendingDelete(null);
|
|
25403
25653
|
};
|
|
25404
|
-
(0,
|
|
25654
|
+
(0, import_react27.useEffect)(() => {
|
|
25405
25655
|
if (!pendingDelete) return;
|
|
25406
25656
|
function handleKeyDown(event) {
|
|
25407
25657
|
if (event.key === "Escape") {
|
|
@@ -25416,7 +25666,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25416
25666
|
setShowSessions(!showSessions);
|
|
25417
25667
|
}
|
|
25418
25668
|
};
|
|
25419
|
-
(0,
|
|
25669
|
+
(0, import_react27.useEffect)(() => {
|
|
25420
25670
|
function handleClickOutside(event) {
|
|
25421
25671
|
const target = event.target;
|
|
25422
25672
|
if (showSessions && !target.closest(".app__sessions-dropdown")) {
|
|
@@ -25426,7 +25676,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25426
25676
|
document.addEventListener("mousedown", handleClickOutside);
|
|
25427
25677
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
25428
25678
|
}, [showSessions]);
|
|
25429
|
-
(0,
|
|
25679
|
+
(0, import_react27.useEffect)(() => {
|
|
25430
25680
|
if (!pendingAssistantId) return;
|
|
25431
25681
|
const r = resolvePending(pendingAssistantId, confirmedAgentId, agents.map((a2) => a2.id), activation);
|
|
25432
25682
|
setPendingAssistantId(r.pending);
|
|
@@ -25435,7 +25685,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25435
25685
|
if (r.activation?.step === "awaiting-agent") onSelectAgent(r.activation.agentId);
|
|
25436
25686
|
setActivation(r.activation);
|
|
25437
25687
|
}, [pendingAssistantId, agents]);
|
|
25438
|
-
(0,
|
|
25688
|
+
(0, import_react27.useEffect)(() => {
|
|
25439
25689
|
if (activation?.step !== "open") return;
|
|
25440
25690
|
const adopt = localSelectionFor(activation, selectedAgentId);
|
|
25441
25691
|
if (adopt) {
|
|
@@ -25451,7 +25701,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25451
25701
|
setActivation(null);
|
|
25452
25702
|
}
|
|
25453
25703
|
}, [activation]);
|
|
25454
|
-
(0,
|
|
25704
|
+
(0, import_react27.useEffect)(() => {
|
|
25455
25705
|
if (activation?.step !== "mic") return;
|
|
25456
25706
|
if (voice.mode !== "conversation" || voice.phase !== "idle") return;
|
|
25457
25707
|
voice.toggle();
|
|
@@ -25465,35 +25715,63 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25465
25715
|
setSettingsTab(tab);
|
|
25466
25716
|
if (screen === "settings") postMessage({ type: "getSettingsData" });
|
|
25467
25717
|
};
|
|
25718
|
+
(0, import_react27.useEffect)(() => {
|
|
25719
|
+
if (layout !== "sidebar") return;
|
|
25720
|
+
let cancelled = false;
|
|
25721
|
+
const pollPending = async () => {
|
|
25722
|
+
try {
|
|
25723
|
+
const res = await fetch("/api/orchestrator");
|
|
25724
|
+
if (!res.ok) {
|
|
25725
|
+
if (!cancelled) setOrchestrationPending(0);
|
|
25726
|
+
return;
|
|
25727
|
+
}
|
|
25728
|
+
const data = await res.json();
|
|
25729
|
+
if (!cancelled) {
|
|
25730
|
+
setOrchestrationPending(typeof data.pending === "number" ? data.pending : 0);
|
|
25731
|
+
}
|
|
25732
|
+
} catch {
|
|
25733
|
+
if (!cancelled) setOrchestrationPending(0);
|
|
25734
|
+
}
|
|
25735
|
+
};
|
|
25736
|
+
void pollPending();
|
|
25737
|
+
const timer = setInterval(() => {
|
|
25738
|
+
void pollPending();
|
|
25739
|
+
}, 15e3);
|
|
25740
|
+
return () => {
|
|
25741
|
+
cancelled = true;
|
|
25742
|
+
clearInterval(timer);
|
|
25743
|
+
};
|
|
25744
|
+
}, [layout]);
|
|
25468
25745
|
const navItems = [
|
|
25469
25746
|
{ id: "chat", label: "Chat", Icon: MessageSquare },
|
|
25470
25747
|
{ id: "projects", label: "Projects", Icon: FolderKanban },
|
|
25471
25748
|
{ id: "settings", label: "Settings", Icon: Settings }
|
|
25472
25749
|
];
|
|
25473
|
-
const navRail = /* @__PURE__ */ (0,
|
|
25474
|
-
/* @__PURE__ */ (0,
|
|
25475
|
-
navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0,
|
|
25750
|
+
const navRail = /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("nav", { className: "app__nav", children: [
|
|
25751
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo app__nav-logo" }),
|
|
25752
|
+
navItems.map(({ id, label, Icon: Icon2 }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25476
25753
|
"button",
|
|
25477
25754
|
{
|
|
25478
25755
|
className: `app__nav-btn ${activeScreen === id ? "app__nav-btn--active" : ""}`,
|
|
25479
25756
|
onClick: () => openScreen(id),
|
|
25480
25757
|
title: label,
|
|
25481
25758
|
children: [
|
|
25482
|
-
/* @__PURE__ */ (0,
|
|
25483
|
-
/* @__PURE__ */ (0,
|
|
25759
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Icon2, { size: 18 }),
|
|
25760
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: label }),
|
|
25761
|
+
id === "settings" && orchestrationPending > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__nav-badge", children: orchestrationPending })
|
|
25484
25762
|
]
|
|
25485
25763
|
},
|
|
25486
25764
|
id
|
|
25487
25765
|
))
|
|
25488
25766
|
] });
|
|
25489
25767
|
if (activeScreen === "projects" && layout === "sidebar") {
|
|
25490
|
-
return /* @__PURE__ */ (0,
|
|
25768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
|
|
25491
25769
|
navRail,
|
|
25492
|
-
/* @__PURE__ */ (0,
|
|
25770
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__screen", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ProjectsTab, { agents, onOpenSettings: () => openScreen("settings", "projects"), postMessage }) })
|
|
25493
25771
|
] });
|
|
25494
25772
|
}
|
|
25495
25773
|
if (activeScreen === "settings") {
|
|
25496
|
-
const panel = /* @__PURE__ */ (0,
|
|
25774
|
+
const panel = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `app ${layout === "sidebar" ? "app--settings-centered app__screen" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25497
25775
|
SettingsPanel,
|
|
25498
25776
|
{
|
|
25499
25777
|
layout,
|
|
@@ -25513,47 +25791,49 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25513
25791
|
mcpAuthOutcome,
|
|
25514
25792
|
setMcpAuthOutcome,
|
|
25515
25793
|
taskRuns,
|
|
25794
|
+
orchestrationPending,
|
|
25795
|
+
onOrchestrationPendingChange: setOrchestrationPending,
|
|
25516
25796
|
onClose: () => setActiveScreen("chat")
|
|
25517
25797
|
}
|
|
25518
25798
|
) });
|
|
25519
|
-
return layout === "sidebar" ? /* @__PURE__ */ (0,
|
|
25799
|
+
return layout === "sidebar" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
|
|
25520
25800
|
navRail,
|
|
25521
25801
|
panel
|
|
25522
25802
|
] }) : panel;
|
|
25523
25803
|
}
|
|
25524
|
-
const deleteOverlay = pendingDelete && /* @__PURE__ */ (0,
|
|
25525
|
-
/* @__PURE__ */ (0,
|
|
25526
|
-
/* @__PURE__ */ (0,
|
|
25804
|
+
const deleteOverlay = pendingDelete && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__confirm-overlay", onClick: cancelDeleteSession, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__confirm-dialog", onClick: (e) => e.stopPropagation(), children: [
|
|
25805
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__confirm-title", children: "Delete conversation" }),
|
|
25806
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("p", { className: "app__confirm-message", children: [
|
|
25527
25807
|
"Delete conversation \u201C",
|
|
25528
25808
|
pendingDelete.title,
|
|
25529
25809
|
"\u201D? This cannot be undone."
|
|
25530
25810
|
] }),
|
|
25531
|
-
/* @__PURE__ */ (0,
|
|
25532
|
-
/* @__PURE__ */ (0,
|
|
25533
|
-
/* @__PURE__ */ (0,
|
|
25811
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__confirm-buttons", children: [
|
|
25812
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { className: "app__confirm-btn", onClick: cancelDeleteSession, children: "Cancel" }),
|
|
25813
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { className: "app__confirm-btn app__confirm-btn--danger", onClick: confirmDeleteSession, children: "Delete" })
|
|
25534
25814
|
] })
|
|
25535
25815
|
] }) });
|
|
25536
25816
|
if (layout === "sidebar") {
|
|
25537
|
-
return /* @__PURE__ */ (0,
|
|
25817
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app app--with-sidebar", children: [
|
|
25538
25818
|
navRail,
|
|
25539
|
-
/* @__PURE__ */ (0,
|
|
25540
|
-
/* @__PURE__ */ (0,
|
|
25541
|
-
/* @__PURE__ */ (0,
|
|
25542
|
-
/* @__PURE__ */ (0,
|
|
25819
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("aside", { className: "app__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-content", children: [
|
|
25820
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section", children: [
|
|
25821
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-section-title", children: "Agents" }),
|
|
25822
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-agents-list", children: selectedAgentId && !showAllAgents ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25543
25823
|
"button",
|
|
25544
25824
|
{
|
|
25545
25825
|
className: "app__sidebar-agent-item app__sidebar-agent-item--collapsed-active",
|
|
25546
25826
|
onClick: () => setShowAllAgents(true),
|
|
25547
25827
|
title: "Switch Agent",
|
|
25548
25828
|
children: [
|
|
25549
|
-
/* @__PURE__ */ (0,
|
|
25550
|
-
/* @__PURE__ */ (0,
|
|
25551
|
-
/* @__PURE__ */ (0,
|
|
25829
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "agent-status-dot agent-status-dot--active" }),
|
|
25830
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-agent-name", children: activeAgent?.name || selectedAgentId }),
|
|
25831
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronDown, { className: "app__sidebar-chevron", size: 10 })
|
|
25552
25832
|
]
|
|
25553
25833
|
}
|
|
25554
|
-
) : /* @__PURE__ */ (0,
|
|
25834
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `app__sidebar-agents-list-expanded ${selectedAgentId ? "app__sidebar-agents-list-expanded--has-active" : ""}`, children: agents.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-empty-text", children: "No agents found" }) : agents.map((agent) => {
|
|
25555
25835
|
const isSelected = selectedAgentId === agent.id;
|
|
25556
|
-
return /* @__PURE__ */ (0,
|
|
25836
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25557
25837
|
"button",
|
|
25558
25838
|
{
|
|
25559
25839
|
className: `app__sidebar-agent-item ${isSelected ? "app__sidebar-agent-item--active" : ""}`,
|
|
@@ -25566,19 +25846,19 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25566
25846
|
}
|
|
25567
25847
|
},
|
|
25568
25848
|
children: [
|
|
25569
|
-
/* @__PURE__ */ (0,
|
|
25570
|
-
/* @__PURE__ */ (0,
|
|
25571
|
-
isSelected && /* @__PURE__ */ (0,
|
|
25849
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `agent-status-dot ${isSelected ? "agent-status-dot--active" : ""}` }),
|
|
25850
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-agent-name", children: agent.name }),
|
|
25851
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronUp, { className: "app__sidebar-chevron app__sidebar-chevron--up", size: 10 })
|
|
25572
25852
|
]
|
|
25573
25853
|
},
|
|
25574
25854
|
agent.id
|
|
25575
25855
|
);
|
|
25576
25856
|
}) }) })
|
|
25577
25857
|
] }),
|
|
25578
|
-
selectedAgentId && /* @__PURE__ */ (0,
|
|
25579
|
-
/* @__PURE__ */ (0,
|
|
25580
|
-
/* @__PURE__ */ (0,
|
|
25581
|
-
/* @__PURE__ */ (0,
|
|
25858
|
+
selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section", children: [
|
|
25859
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sidebar-section-header", children: [
|
|
25860
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-section-title", children: "Conversations" }),
|
|
25861
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25582
25862
|
"button",
|
|
25583
25863
|
{
|
|
25584
25864
|
className: "app__sidebar-new-chat-btn",
|
|
@@ -25588,15 +25868,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25588
25868
|
}
|
|
25589
25869
|
)
|
|
25590
25870
|
] }),
|
|
25591
|
-
/* @__PURE__ */ (0,
|
|
25871
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-sessions-list", children: sessions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sidebar-empty-text", children: "No conversations yet" }) : sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25592
25872
|
"div",
|
|
25593
25873
|
{
|
|
25594
25874
|
className: `app__sidebar-session-item ${selectedSessionId === session.id ? "app__sidebar-session-item--active" : ""}`,
|
|
25595
25875
|
onClick: () => onSelectSession(session.id),
|
|
25596
25876
|
children: [
|
|
25597
|
-
/* @__PURE__ */ (0,
|
|
25598
|
-
/* @__PURE__ */ (0,
|
|
25599
|
-
/* @__PURE__ */ (0,
|
|
25877
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-session-icon", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MessageSquare, { size: 13 }) }),
|
|
25878
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__sidebar-session-title", title: session.title, children: session.title }),
|
|
25879
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25600
25880
|
"button",
|
|
25601
25881
|
{
|
|
25602
25882
|
className: "app__sidebar-session-delete",
|
|
@@ -25605,7 +25885,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25605
25885
|
e.stopPropagation();
|
|
25606
25886
|
onDeleteSession(session.id, session.title);
|
|
25607
25887
|
},
|
|
25608
|
-
children: /* @__PURE__ */ (0,
|
|
25888
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Trash, { size: 12 })
|
|
25609
25889
|
}
|
|
25610
25890
|
)
|
|
25611
25891
|
]
|
|
@@ -25614,15 +25894,15 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25614
25894
|
)) })
|
|
25615
25895
|
] })
|
|
25616
25896
|
] }) }),
|
|
25617
|
-
/* @__PURE__ */ (0,
|
|
25618
|
-
/* @__PURE__ */ (0,
|
|
25619
|
-
/* @__PURE__ */ (0,
|
|
25620
|
-
/* @__PURE__ */ (0,
|
|
25621
|
-
/* @__PURE__ */ (0,
|
|
25897
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("main", { className: "app__chat-pane", children: selectedAgentId ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
|
|
25898
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("header", { className: "app__chat-header", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__chat-header-info", children: [
|
|
25899
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "app__chat-header-title", children: selectedAgentName }),
|
|
25900
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { className: "app__chat-header-status", children: [
|
|
25901
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `agent-status-dot agent-status-dot--active ${chatState.status === "streaming" ? "agent-status-dot--pulsing" : ""}` }),
|
|
25622
25902
|
chatState.status === "streaming" ? "Streaming response..." : "Ready"
|
|
25623
25903
|
] })
|
|
25624
25904
|
] }) }),
|
|
25625
|
-
/* @__PURE__ */ (0,
|
|
25905
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25626
25906
|
MessageList,
|
|
25627
25907
|
{
|
|
25628
25908
|
items: chatState.items,
|
|
@@ -25632,12 +25912,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25632
25912
|
trailing: confirmCards
|
|
25633
25913
|
}
|
|
25634
25914
|
),
|
|
25635
|
-
(chatState.errorText || voice.error) && /* @__PURE__ */ (0,
|
|
25636
|
-
/* @__PURE__ */ (0,
|
|
25915
|
+
(chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__error", children: [
|
|
25916
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriangleAlert, { size: 14 }),
|
|
25637
25917
|
" ",
|
|
25638
25918
|
chatState.errorText || voice.error
|
|
25639
25919
|
] }),
|
|
25640
|
-
/* @__PURE__ */ (0,
|
|
25920
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25641
25921
|
Composer,
|
|
25642
25922
|
{
|
|
25643
25923
|
disabled: composerDisabled,
|
|
@@ -25657,18 +25937,18 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25657
25937
|
onValueChange: setComposerDraft
|
|
25658
25938
|
}
|
|
25659
25939
|
)
|
|
25660
|
-
] }) : /* @__PURE__ */ (0,
|
|
25940
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: "Select an agent from the sidebar to start chatting" }) }) }),
|
|
25661
25941
|
deleteOverlay
|
|
25662
25942
|
] });
|
|
25663
25943
|
}
|
|
25664
|
-
return /* @__PURE__ */ (0,
|
|
25665
|
-
/* @__PURE__ */ (0,
|
|
25666
|
-
/* @__PURE__ */ (0,
|
|
25667
|
-
/* @__PURE__ */ (0,
|
|
25668
|
-
/* @__PURE__ */ (0,
|
|
25944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app", children: [
|
|
25945
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("header", { className: "app__header", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__header-row", children: [
|
|
25946
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__logo-title-wrapper", children: [
|
|
25947
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("img", { src: caretaker_cli_default, alt: "Caretaker", className: "app__logo" }),
|
|
25948
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: "Caretaker" })
|
|
25669
25949
|
] }),
|
|
25670
|
-
/* @__PURE__ */ (0,
|
|
25671
|
-
/* @__PURE__ */ (0,
|
|
25950
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__controls", children: [
|
|
25951
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__agent-select-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25672
25952
|
"select",
|
|
25673
25953
|
{
|
|
25674
25954
|
className: "app__agent-select",
|
|
@@ -25678,12 +25958,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25678
25958
|
onSelectAgent(e.target.value);
|
|
25679
25959
|
},
|
|
25680
25960
|
children: [
|
|
25681
|
-
/* @__PURE__ */ (0,
|
|
25682
|
-
agents.map((agent) => /* @__PURE__ */ (0,
|
|
25961
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: "", disabled: true, children: "-- Select Agent --" }),
|
|
25962
|
+
agents.map((agent) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("option", { value: agent.id, children: agent.name }, agent.id))
|
|
25683
25963
|
]
|
|
25684
25964
|
}
|
|
25685
25965
|
) }),
|
|
25686
|
-
/* @__PURE__ */ (0,
|
|
25966
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25687
25967
|
"button",
|
|
25688
25968
|
{
|
|
25689
25969
|
className: "app__sessions-btn",
|
|
@@ -25691,13 +25971,13 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25691
25971
|
disabled: !selectedAgentId,
|
|
25692
25972
|
title: "View conversations",
|
|
25693
25973
|
children: [
|
|
25694
|
-
/* @__PURE__ */ (0,
|
|
25974
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MessageSquare, { size: 13 }),
|
|
25695
25975
|
" ",
|
|
25696
25976
|
sessions.length
|
|
25697
25977
|
]
|
|
25698
25978
|
}
|
|
25699
25979
|
),
|
|
25700
|
-
/* @__PURE__ */ (0,
|
|
25980
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25701
25981
|
"button",
|
|
25702
25982
|
{
|
|
25703
25983
|
className: "app__new-chat-btn",
|
|
@@ -25707,7 +25987,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25707
25987
|
children: "+ New"
|
|
25708
25988
|
}
|
|
25709
25989
|
),
|
|
25710
|
-
/* @__PURE__ */ (0,
|
|
25990
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25711
25991
|
"button",
|
|
25712
25992
|
{
|
|
25713
25993
|
className: "app__settings-btn",
|
|
@@ -25716,24 +25996,24 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25716
25996
|
postMessage({ type: "getSettingsData" });
|
|
25717
25997
|
},
|
|
25718
25998
|
title: "Caretaker Settings",
|
|
25719
|
-
children: /* @__PURE__ */ (0,
|
|
25999
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Settings, { className: "app__settings-icon", size: 14 })
|
|
25720
26000
|
}
|
|
25721
26001
|
)
|
|
25722
26002
|
] })
|
|
25723
26003
|
] }) }),
|
|
25724
|
-
showSessions && sessions.length > 0 && /* @__PURE__ */ (0,
|
|
25725
|
-
/* @__PURE__ */ (0,
|
|
26004
|
+
showSessions && sessions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-dropdown", children: [
|
|
26005
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-title", children: [
|
|
25726
26006
|
"Conversations for ",
|
|
25727
26007
|
selectedAgentName
|
|
25728
26008
|
] }),
|
|
25729
|
-
/* @__PURE__ */ (0,
|
|
26009
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sessions-list", children: sessions.map((session) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
25730
26010
|
"div",
|
|
25731
26011
|
{
|
|
25732
26012
|
className: `app__session-item ${selectedSessionId === session.id ? "app__session-item--active" : ""}`,
|
|
25733
26013
|
onClick: () => onSelectSession(session.id),
|
|
25734
26014
|
children: [
|
|
25735
|
-
/* @__PURE__ */ (0,
|
|
25736
|
-
/* @__PURE__ */ (0,
|
|
26015
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "app__session-item-title", children: session.title }),
|
|
26016
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25737
26017
|
"button",
|
|
25738
26018
|
{
|
|
25739
26019
|
className: "app__session-item-delete",
|
|
@@ -25742,7 +26022,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25742
26022
|
e.stopPropagation();
|
|
25743
26023
|
onDeleteSession(session.id, session.title);
|
|
25744
26024
|
},
|
|
25745
|
-
children: /* @__PURE__ */ (0,
|
|
26025
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Trash, { size: 12 })
|
|
25746
26026
|
}
|
|
25747
26027
|
)
|
|
25748
26028
|
]
|
|
@@ -25750,12 +26030,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25750
26030
|
session.id
|
|
25751
26031
|
)) })
|
|
25752
26032
|
] }),
|
|
25753
|
-
showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0,
|
|
25754
|
-
/* @__PURE__ */ (0,
|
|
25755
|
-
/* @__PURE__ */ (0,
|
|
26033
|
+
showSessions && sessions.length === 0 && selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__sessions-dropdown app__sessions-dropdown--empty", children: [
|
|
26034
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__sessions-title", children: "No conversations yet" }),
|
|
26035
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "app__sessions-empty", children: "Start a new chat to create a conversation" })
|
|
25756
26036
|
] }),
|
|
25757
|
-
!selectedAgentId && /* @__PURE__ */ (0,
|
|
25758
|
-
/* @__PURE__ */ (0,
|
|
26037
|
+
!selectedAgentId && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "app__empty-state", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { children: "Select an agent to start chatting" }) }),
|
|
26038
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25759
26039
|
MessageList,
|
|
25760
26040
|
{
|
|
25761
26041
|
items: chatState.items,
|
|
@@ -25765,12 +26045,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25765
26045
|
trailing: confirmCards
|
|
25766
26046
|
}
|
|
25767
26047
|
),
|
|
25768
|
-
(chatState.errorText || voice.error) && /* @__PURE__ */ (0,
|
|
25769
|
-
/* @__PURE__ */ (0,
|
|
26048
|
+
(chatState.errorText || voice.error) && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "app__error", children: [
|
|
26049
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TriangleAlert, { size: 14 }),
|
|
25770
26050
|
" ",
|
|
25771
26051
|
chatState.errorText || voice.error
|
|
25772
26052
|
] }),
|
|
25773
|
-
/* @__PURE__ */ (0,
|
|
26053
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
25774
26054
|
Composer,
|
|
25775
26055
|
{
|
|
25776
26056
|
disabled: composerDisabled,
|
|
@@ -25795,12 +26075,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25795
26075
|
}
|
|
25796
26076
|
|
|
25797
26077
|
// src/standalone.tsx
|
|
25798
|
-
var
|
|
26078
|
+
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
25799
26079
|
function StandaloneApp() {
|
|
25800
|
-
const [ws, setWs] = (0,
|
|
25801
|
-
const [connected, setConnected] = (0,
|
|
25802
|
-
const [error, setError] = (0,
|
|
25803
|
-
(0,
|
|
26080
|
+
const [ws, setWs] = (0, import_react28.useState)(null);
|
|
26081
|
+
const [connected, setConnected] = (0, import_react28.useState)(false);
|
|
26082
|
+
const [error, setError] = (0, import_react28.useState)(null);
|
|
26083
|
+
(0, import_react28.useEffect)(() => {
|
|
25804
26084
|
let active = true;
|
|
25805
26085
|
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
|
25806
26086
|
const socket = new WebSocket(`${protocol}//${window.location.host}/api/ws`);
|
|
@@ -25846,7 +26126,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25846
26126
|
}
|
|
25847
26127
|
};
|
|
25848
26128
|
if (error) {
|
|
25849
|
-
return /* @__PURE__ */ (0,
|
|
26129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: {
|
|
25850
26130
|
display: "flex",
|
|
25851
26131
|
flexDirection: "column",
|
|
25852
26132
|
alignItems: "center",
|
|
@@ -25858,9 +26138,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25858
26138
|
padding: "20px",
|
|
25859
26139
|
textAlign: "center"
|
|
25860
26140
|
}, children: [
|
|
25861
|
-
/* @__PURE__ */ (0,
|
|
25862
|
-
/* @__PURE__ */ (0,
|
|
25863
|
-
/* @__PURE__ */ (0,
|
|
26141
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { style: { color: "#ff6b6b" }, children: "Caretaker Connection Failed" }),
|
|
26142
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { children: error }),
|
|
26143
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
25864
26144
|
"button",
|
|
25865
26145
|
{
|
|
25866
26146
|
onClick: () => setWs(null),
|
|
@@ -25879,7 +26159,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25879
26159
|
] });
|
|
25880
26160
|
}
|
|
25881
26161
|
if (!connected) {
|
|
25882
|
-
return /* @__PURE__ */ (0,
|
|
26162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { style: {
|
|
25883
26163
|
display: "flex",
|
|
25884
26164
|
flexDirection: "column",
|
|
25885
26165
|
alignItems: "center",
|
|
@@ -25889,7 +26169,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25889
26169
|
background: "#1e1e1e",
|
|
25890
26170
|
color: "#f1f1f1"
|
|
25891
26171
|
}, children: [
|
|
25892
|
-
/* @__PURE__ */ (0,
|
|
26172
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { style: {
|
|
25893
26173
|
border: "4px solid rgba(255,255,255,0.1)",
|
|
25894
26174
|
width: "36px",
|
|
25895
26175
|
height: "36px",
|
|
@@ -25898,8 +26178,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25898
26178
|
animation: "spin 1s linear infinite",
|
|
25899
26179
|
marginBottom: "16px"
|
|
25900
26180
|
} }),
|
|
25901
|
-
/* @__PURE__ */ (0,
|
|
25902
|
-
/* @__PURE__ */ (0,
|
|
26181
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Connecting to Caretaker server..." }),
|
|
26182
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("style", { children: `
|
|
25903
26183
|
@keyframes spin {
|
|
25904
26184
|
0% { transform: rotate(0deg); }
|
|
25905
26185
|
100% { transform: rotate(360deg); }
|
|
@@ -25907,12 +26187,12 @@ Please report this to https://github.com/markedjs/marked.`, e) {
|
|
|
25907
26187
|
` })
|
|
25908
26188
|
] });
|
|
25909
26189
|
}
|
|
25910
|
-
return /* @__PURE__ */ (0,
|
|
26190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(App, { postMessage, layout: "sidebar" });
|
|
25911
26191
|
}
|
|
25912
26192
|
var rootEl = document.getElementById("root");
|
|
25913
26193
|
if (!rootEl) throw new Error("#root not found");
|
|
25914
26194
|
(0, import_client.createRoot)(rootEl).render(
|
|
25915
|
-
/* @__PURE__ */ (0,
|
|
26195
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react28.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(StandaloneApp, {}) })
|
|
25916
26196
|
);
|
|
25917
26197
|
})();
|
|
25918
26198
|
/*! Bundled license information:
|