@parallelworks/tandem-web 0.180.0 → 0.181.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/_virtual/_virtual_i18n/en/common.js +24 -0
- package/_virtual/_virtual_i18n/es/common.js +24 -0
- package/_virtual/_virtual_i18n/ja/common.js +24 -0
- package/_virtual/_virtual_i18n/ko/common.js +24 -0
- package/_virtual/_virtual_i18n/zh/common.js +24 -0
- package/components/DocStart.js +288 -0
- package/package.json +1 -1
- package/routes/_workspace/docs/_doc2.js +239 -226
|
@@ -1408,6 +1408,30 @@ var e = {
|
|
|
1408
1408
|
embedPick: "Pick a saved view to show",
|
|
1409
1409
|
open: "Open"
|
|
1410
1410
|
},
|
|
1411
|
+
docStart: {
|
|
1412
|
+
title: "Get started with",
|
|
1413
|
+
askAgent: "Ask an agent",
|
|
1414
|
+
meetingTitle: "Meeting notes: {date}",
|
|
1415
|
+
meetingNotes: "Meeting notes",
|
|
1416
|
+
templates: "Templates",
|
|
1417
|
+
noTemplates: "No templates in this space",
|
|
1418
|
+
importFiles: "Import Markdown or a zip",
|
|
1419
|
+
importFolder: "Import a folder",
|
|
1420
|
+
agent: "Agent",
|
|
1421
|
+
team: "Team",
|
|
1422
|
+
prompt: "What should the agent do?",
|
|
1423
|
+
promptPlaceholder: "Draft a launch plan from the notes in the Q4 folder…",
|
|
1424
|
+
runsOn: "Runs on <runner></runner>",
|
|
1425
|
+
noRunner: "None of your runners can take this agent's runs right now; it waits until one can.",
|
|
1426
|
+
capped: "Runner {runner} limits it to “{got}”, though the agent is set to “{asked}”. Restart that runner with <code></code> to lift it.",
|
|
1427
|
+
start: "Start",
|
|
1428
|
+
noAgents: "No agents in this workspace yet.",
|
|
1429
|
+
issueTitle: "Write {doc}",
|
|
1430
|
+
issueBody: "Work in the doc {doc}.",
|
|
1431
|
+
thisDoc: "this doc",
|
|
1432
|
+
runs: "Agents working on this doc",
|
|
1433
|
+
waitingForRunner: "Waiting for a runner"
|
|
1434
|
+
},
|
|
1411
1435
|
docs: {
|
|
1412
1436
|
spaceDefault: "Start new docs in this space from it",
|
|
1413
1437
|
duplicate: "Duplicate",
|
|
@@ -1408,6 +1408,30 @@ var e = {
|
|
|
1408
1408
|
embedPick: "Elige una vista guardada para mostrar",
|
|
1409
1409
|
open: "Abrir"
|
|
1410
1410
|
},
|
|
1411
|
+
docStart: {
|
|
1412
|
+
title: "Empezar con",
|
|
1413
|
+
askAgent: "Pedir a un agente",
|
|
1414
|
+
meetingTitle: "Notas de reunión: {date}",
|
|
1415
|
+
meetingNotes: "Notas de reunión",
|
|
1416
|
+
templates: "Plantillas",
|
|
1417
|
+
noTemplates: "No hay plantillas en este espacio",
|
|
1418
|
+
importFiles: "Importar Markdown o un zip",
|
|
1419
|
+
importFolder: "Importar una carpeta",
|
|
1420
|
+
agent: "Agente",
|
|
1421
|
+
team: "Equipo",
|
|
1422
|
+
prompt: "¿Qué debe hacer el agente?",
|
|
1423
|
+
promptPlaceholder: "Redacta un plan de lanzamiento a partir de las notas de la carpeta T4…",
|
|
1424
|
+
runsOn: "Se ejecuta en <runner></runner>",
|
|
1425
|
+
noRunner: "Ahora ninguno de tus ejecutores puede encargarse de las ejecuciones de este agente; espera hasta que alguno pueda.",
|
|
1426
|
+
capped: "El ejecutor {runner} lo limita a “{got}”, aunque el agente está configurado en “{asked}”. Reinicia ese ejecutor con <code></code> para quitar el límite.",
|
|
1427
|
+
start: "Empezar",
|
|
1428
|
+
noAgents: "Todavía no hay agentes en este espacio de trabajo.",
|
|
1429
|
+
issueTitle: "Escribir {doc}",
|
|
1430
|
+
issueBody: "Trabaja en el documento {doc}.",
|
|
1431
|
+
thisDoc: "este documento",
|
|
1432
|
+
runs: "Agentes trabajando en este documento",
|
|
1433
|
+
waitingForRunner: "Esperando un ejecutor"
|
|
1434
|
+
},
|
|
1411
1435
|
docs: {
|
|
1412
1436
|
spaceDefault: "Empezar los documentos nuevos de este espacio con ella",
|
|
1413
1437
|
duplicate: "Duplicar",
|
|
@@ -1408,6 +1408,30 @@ var e = {
|
|
|
1408
1408
|
embedPick: "表示する保存済みビューを選択",
|
|
1409
1409
|
open: "開く"
|
|
1410
1410
|
},
|
|
1411
|
+
docStart: {
|
|
1412
|
+
title: "はじめ方",
|
|
1413
|
+
askAgent: "エージェントに依頼",
|
|
1414
|
+
meetingTitle: "議事録: {date}",
|
|
1415
|
+
meetingNotes: "議事録",
|
|
1416
|
+
templates: "テンプレート",
|
|
1417
|
+
noTemplates: "このスペースにテンプレートはありません",
|
|
1418
|
+
importFiles: "Markdown または zip をインポート",
|
|
1419
|
+
importFolder: "フォルダーをインポート",
|
|
1420
|
+
agent: "エージェント",
|
|
1421
|
+
team: "チーム",
|
|
1422
|
+
prompt: "エージェントに何をさせますか?",
|
|
1423
|
+
promptPlaceholder: "Q4 フォルダーのメモからリリース計画の下書きを作成…",
|
|
1424
|
+
runsOn: "<runner></runner> で実行",
|
|
1425
|
+
noRunner: "現在、あなたのランナーにはこのエージェントの実行を引き受けられるものがありません。引き受けられるまで待機します。",
|
|
1426
|
+
capped: "ランナー {runner} がこれを「{got}」に制限しています。エージェントの設定は「{asked}」です。制限を解除するには、そのランナーを <code></code> で再起動してください。",
|
|
1427
|
+
start: "開始",
|
|
1428
|
+
noAgents: "このワークスペースにはまだエージェントがいません。",
|
|
1429
|
+
issueTitle: "{doc} を書く",
|
|
1430
|
+
issueBody: "ドキュメント {doc} で作業してください。",
|
|
1431
|
+
thisDoc: "このドキュメント",
|
|
1432
|
+
runs: "このドキュメントで作業中のエージェント",
|
|
1433
|
+
waitingForRunner: "ランナー待ち"
|
|
1434
|
+
},
|
|
1411
1435
|
docs: {
|
|
1412
1436
|
spaceDefault: "このスペースの新しいドキュメントに使う",
|
|
1413
1437
|
duplicate: "複製",
|
|
@@ -1408,6 +1408,30 @@ var e = {
|
|
|
1408
1408
|
embedPick: "보여 줄 저장된 보기를 고르세요",
|
|
1409
1409
|
open: "열기"
|
|
1410
1410
|
},
|
|
1411
|
+
docStart: {
|
|
1412
|
+
title: "시작하기",
|
|
1413
|
+
askAgent: "에이전트에게 요청",
|
|
1414
|
+
meetingTitle: "회의록: {date}",
|
|
1415
|
+
meetingNotes: "회의록",
|
|
1416
|
+
templates: "템플릿",
|
|
1417
|
+
noTemplates: "이 공간에 템플릿이 없습니다",
|
|
1418
|
+
importFiles: "Markdown 또는 zip 가져오기",
|
|
1419
|
+
importFolder: "폴더 가져오기",
|
|
1420
|
+
agent: "에이전트",
|
|
1421
|
+
team: "팀",
|
|
1422
|
+
prompt: "에이전트가 무엇을 해야 하나요?",
|
|
1423
|
+
promptPlaceholder: "Q4 폴더의 메모로 출시 계획 초안 작성…",
|
|
1424
|
+
runsOn: "<runner></runner>에서 실행",
|
|
1425
|
+
noRunner: "지금은 내 러너 중 이 에이전트의 실행을 맡을 수 있는 것이 없습니다. 맡을 수 있을 때까지 기다립니다.",
|
|
1426
|
+
capped: "러너 {runner}이(가) “{got}”(으)로 제한합니다. 에이전트는 “{asked}”(으)로 설정되어 있습니다. 제한을 풀려면 해당 러너를 <code></code>(으)로 다시 시작하세요.",
|
|
1427
|
+
start: "시작",
|
|
1428
|
+
noAgents: "이 워크스페이스에 아직 에이전트가 없습니다.",
|
|
1429
|
+
issueTitle: "{doc} 작성",
|
|
1430
|
+
issueBody: "문서 {doc}에서 작업하세요.",
|
|
1431
|
+
thisDoc: "이 문서",
|
|
1432
|
+
runs: "이 문서에서 작업 중인 에이전트",
|
|
1433
|
+
waitingForRunner: "러너 대기 중"
|
|
1434
|
+
},
|
|
1411
1435
|
docs: {
|
|
1412
1436
|
spaceDefault: "이 스페이스의 새 문서에 사용",
|
|
1413
1437
|
duplicate: "복제",
|
|
@@ -1408,6 +1408,30 @@ var e = {
|
|
|
1408
1408
|
embedPick: "选择要显示的已保存视图",
|
|
1409
1409
|
open: "打开"
|
|
1410
1410
|
},
|
|
1411
|
+
docStart: {
|
|
1412
|
+
title: "开始方式",
|
|
1413
|
+
askAgent: "让代理来写",
|
|
1414
|
+
meetingTitle: "会议记录:{date}",
|
|
1415
|
+
meetingNotes: "会议记录",
|
|
1416
|
+
templates: "模板",
|
|
1417
|
+
noTemplates: "此空间没有模板",
|
|
1418
|
+
importFiles: "导入 Markdown 或 zip",
|
|
1419
|
+
importFolder: "导入文件夹",
|
|
1420
|
+
agent: "代理",
|
|
1421
|
+
team: "团队",
|
|
1422
|
+
prompt: "代理应该做什么?",
|
|
1423
|
+
promptPlaceholder: "根据 Q4 文件夹中的笔记起草发布计划…",
|
|
1424
|
+
runsOn: "在 <runner></runner> 上运行",
|
|
1425
|
+
noRunner: "目前你的运行器都无法承接此代理的运行;会一直等到有运行器可以承接。",
|
|
1426
|
+
capped: "运行器 {runner} 将其限制为“{got}”,但代理设置为“{asked}”。请用 <code></code> 重新启动该运行器以解除限制。",
|
|
1427
|
+
start: "开始",
|
|
1428
|
+
noAgents: "此工作区还没有代理。",
|
|
1429
|
+
issueTitle: "撰写 {doc}",
|
|
1430
|
+
issueBody: "在文档 {doc} 中工作。",
|
|
1431
|
+
thisDoc: "此文档",
|
|
1432
|
+
runs: "正在处理此文档的代理",
|
|
1433
|
+
waitingForRunner: "等待运行器"
|
|
1434
|
+
},
|
|
1411
1435
|
docs: {
|
|
1412
1436
|
spaceDefault: "此空间的新文档从它开始",
|
|
1413
1437
|
duplicate: "复制一份",
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { api as e, unwrap as t } from "../api/client.js";
|
|
2
|
+
import { agentsQuery as n, docTemplatesQuery as r, runnersQuery as i, teamsQuery as a, workspaceRunsQuery as o } from "../api/queries.js";
|
|
3
|
+
import { runnersFor as s } from "../lib/agents.js";
|
|
4
|
+
import { isoDate as c } from "../lib/datePhrases.js";
|
|
5
|
+
import { docPath as l, useTemplateValues as u } from "../lib/docs.js";
|
|
6
|
+
import { modeBelow as d, runnerModeCommand as f, usePermissionModeName as p } from "../lib/permissionModes.js";
|
|
7
|
+
import { Link as m } from "../lib/router.js";
|
|
8
|
+
import { AgentIcon as h, CalendarIcon as g, FileTextIcon as _, FolderIcon as v, UploadIcon as y } from "./icons.js";
|
|
9
|
+
import { useMarkdownTransfer as b } from "./MarkdownTransfer.js";
|
|
10
|
+
import { RunnerBadge as x } from "./RunnerBadge.js";
|
|
11
|
+
import { ActionMenu as S, Button as C, ErrorText as w, Popover as T, RelativeTime as E, Select as D, Textarea as O, useClosePopover as k } from "@parallelworks/ui";
|
|
12
|
+
import { useEffect as A, useState as j } from "react";
|
|
13
|
+
import { useErrorMessage as M } from "@parallelworks/problem/react";
|
|
14
|
+
import { useFormatter as N, useTranslations as P } from "use-intl";
|
|
15
|
+
import { jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
16
|
+
import { useMutation as L, useQuery as R, useQueryClient as z } from "@tanstack/react-query";
|
|
17
|
+
// src/components/DocStart.tsx
|
|
18
|
+
function B(e, t) {
|
|
19
|
+
let [n, r] = j(e ? e.isEmpty : !t.trim());
|
|
20
|
+
return A(() => {
|
|
21
|
+
if (!e) return;
|
|
22
|
+
let t = () => r(e.isEmpty);
|
|
23
|
+
return t(), e.on("update", t), () => {
|
|
24
|
+
e.off("update", t);
|
|
25
|
+
};
|
|
26
|
+
}, [e]), n;
|
|
27
|
+
}
|
|
28
|
+
function V({ workspace: n, doc: i, team: a, editor: o }) {
|
|
29
|
+
let s = P("docStart"), l = P("docs"), d = N(), f = M(), p = z(), m = B(o, i.body ?? ""), { data: h = [] } = R(r(n)), x = b(n), T = u(), E = L({
|
|
30
|
+
mutationFn: async (r) => t(await e.PATCH("/api/v1/workspaces/{workspace}/docs/{doc}", {
|
|
31
|
+
params: { path: {
|
|
32
|
+
workspace: n,
|
|
33
|
+
doc: i.key
|
|
34
|
+
} },
|
|
35
|
+
body: {
|
|
36
|
+
...r,
|
|
37
|
+
ifVersion: i.version
|
|
38
|
+
}
|
|
39
|
+
})),
|
|
40
|
+
onSuccess: (e) => p.setQueryData([
|
|
41
|
+
"workspace",
|
|
42
|
+
n,
|
|
43
|
+
"docs",
|
|
44
|
+
i.key
|
|
45
|
+
], e),
|
|
46
|
+
onSettled: () => p.invalidateQueries({ queryKey: [
|
|
47
|
+
"workspace",
|
|
48
|
+
n,
|
|
49
|
+
"docs"
|
|
50
|
+
] })
|
|
51
|
+
});
|
|
52
|
+
if (!m) return null;
|
|
53
|
+
let D = !i.title.trim() || i.title === l("untitled"), O = /* @__PURE__ */ new Date(), k = h.filter((e) => e.starter || (e.teamId ?? "") === (i.teamId ?? "")).sort((e, t) => Number(e.starter) - Number(t.starter));
|
|
54
|
+
return /* @__PURE__ */ I("section", {
|
|
55
|
+
"aria-labelledby": "doc-start",
|
|
56
|
+
className: "mt-2",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ F("h2", {
|
|
59
|
+
id: "doc-start",
|
|
60
|
+
className: "text-xs text-muted-foreground",
|
|
61
|
+
children: s("title")
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ I("div", {
|
|
64
|
+
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ F(H, {
|
|
67
|
+
workspace: n,
|
|
68
|
+
doc: i,
|
|
69
|
+
team: a
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ I(C, {
|
|
72
|
+
size: "sm",
|
|
73
|
+
variant: "secondary",
|
|
74
|
+
disabled: E.isPending,
|
|
75
|
+
onClick: () => E.mutate({
|
|
76
|
+
startFrom: "meeting-notes",
|
|
77
|
+
variables: { date: c(O) },
|
|
78
|
+
...D && { title: s("meetingTitle", { date: d.dateTime(O, { dateStyle: "medium" }) }) }
|
|
79
|
+
}),
|
|
80
|
+
children: [/* @__PURE__ */ F(g, { className: "size-3.5" }), s("meetingNotes")]
|
|
81
|
+
}),
|
|
82
|
+
/* @__PURE__ */ F(S, {
|
|
83
|
+
label: s("templates"),
|
|
84
|
+
empty: s("noTemplates"),
|
|
85
|
+
items: k.map((e) => ({
|
|
86
|
+
label: e.title,
|
|
87
|
+
onClick: () => E.mutate({
|
|
88
|
+
startFrom: e.id,
|
|
89
|
+
variables: T()
|
|
90
|
+
})
|
|
91
|
+
})),
|
|
92
|
+
trigger: /* @__PURE__ */ I(C, {
|
|
93
|
+
size: "sm",
|
|
94
|
+
variant: "secondary",
|
|
95
|
+
disabled: E.isPending,
|
|
96
|
+
children: [/* @__PURE__ */ F(_, { className: "size-3.5" }), s("templates")]
|
|
97
|
+
})
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ I(C, {
|
|
100
|
+
size: "sm",
|
|
101
|
+
variant: "secondary",
|
|
102
|
+
onClick: () => x.pick({ parent: i.key }),
|
|
103
|
+
children: [/* @__PURE__ */ F(y, { className: "size-3.5" }), s("importFiles")]
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ I(C, {
|
|
106
|
+
size: "sm",
|
|
107
|
+
variant: "secondary",
|
|
108
|
+
onClick: () => x.pick({ parent: i.key }, !0),
|
|
109
|
+
children: [/* @__PURE__ */ F(v, { className: "size-3.5" }), s("importFolder")]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
}),
|
|
113
|
+
E.isError && /* @__PURE__ */ F(w, {
|
|
114
|
+
className: "mt-2",
|
|
115
|
+
children: f(E.error)
|
|
116
|
+
}),
|
|
117
|
+
x.dialog
|
|
118
|
+
]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function H({ workspace: e, doc: t, team: n }) {
|
|
122
|
+
let r = P("docStart");
|
|
123
|
+
return /* @__PURE__ */ F(T, {
|
|
124
|
+
title: r("askAgent"),
|
|
125
|
+
align: "start",
|
|
126
|
+
initialFocus: "first-control",
|
|
127
|
+
className: "w-96 max-w-[calc(100vw-2rem)]",
|
|
128
|
+
trigger: /* @__PURE__ */ I(C, {
|
|
129
|
+
size: "sm",
|
|
130
|
+
variant: "secondary",
|
|
131
|
+
children: [/* @__PURE__ */ F(h, { className: "size-3.5" }), r("askAgent")]
|
|
132
|
+
}),
|
|
133
|
+
children: /* @__PURE__ */ F(U, {
|
|
134
|
+
workspace: e,
|
|
135
|
+
doc: t,
|
|
136
|
+
team: n
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
function U({ workspace: r, doc: o, team: c }) {
|
|
141
|
+
let u = P("docStart"), m = M(), h = p(), g = k(), _ = z(), { data: v = [] } = R(n(r)), { data: y = [] } = R(i(r)), { data: b = [] } = R(a(r)), S = v.filter((e) => !e.archivedAt), [T, E] = j(S[0]?.slug ?? ""), [A, N] = j(c?.key ?? b.find((e) => !e.archivedAt)?.key ?? ""), [B, V] = j(""), H = S.find((e) => e.slug === T), U = H ? s(H, y).find((e) => e.online)?.runner : void 0, W = H && U?.permissionMode && d(U.permissionMode, H.permissionMode) ? U.permissionMode : void 0, G = L({
|
|
142
|
+
mutationFn: async () => t(await e.POST("/api/v1/workspaces/{workspace}/teams/{key}/issues", {
|
|
143
|
+
params: { path: {
|
|
144
|
+
workspace: r,
|
|
145
|
+
key: A
|
|
146
|
+
} },
|
|
147
|
+
body: {
|
|
148
|
+
title: u("issueTitle", { doc: o.title || u("thisDoc") }),
|
|
149
|
+
body: `${B.trim()}\n\n${u("issueBody", { doc: `[${o.title || u("thisDoc")}](${l(r, o)})` })}`,
|
|
150
|
+
origin: { doc: o.key },
|
|
151
|
+
assignees: [{
|
|
152
|
+
kind: "agent",
|
|
153
|
+
handle: T
|
|
154
|
+
}]
|
|
155
|
+
}
|
|
156
|
+
})),
|
|
157
|
+
onSuccess: () => {
|
|
158
|
+
_.invalidateQueries({ queryKey: [
|
|
159
|
+
"workspace",
|
|
160
|
+
r,
|
|
161
|
+
"runs"
|
|
162
|
+
] }), g();
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
return S.length === 0 ? /* @__PURE__ */ F("p", {
|
|
166
|
+
className: "text-sm text-muted-foreground",
|
|
167
|
+
children: u("noAgents")
|
|
168
|
+
}) : /* @__PURE__ */ I("form", {
|
|
169
|
+
className: "space-y-3",
|
|
170
|
+
onSubmit: (e) => {
|
|
171
|
+
e.preventDefault(), B.trim() && T && A && G.mutate();
|
|
172
|
+
},
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ I("div", {
|
|
175
|
+
className: "flex gap-2",
|
|
176
|
+
children: [/* @__PURE__ */ F(D, {
|
|
177
|
+
"aria-label": u("agent"),
|
|
178
|
+
value: T,
|
|
179
|
+
onValueChange: (e) => e && E(e),
|
|
180
|
+
items: S.map((e) => ({
|
|
181
|
+
value: e.slug,
|
|
182
|
+
label: e.name
|
|
183
|
+
})),
|
|
184
|
+
width: "fill"
|
|
185
|
+
}), !c && /* @__PURE__ */ F(D, {
|
|
186
|
+
"aria-label": u("team"),
|
|
187
|
+
value: A,
|
|
188
|
+
onValueChange: (e) => e && N(e),
|
|
189
|
+
items: b.filter((e) => !e.archivedAt).map((e) => ({
|
|
190
|
+
value: e.key,
|
|
191
|
+
label: e.name
|
|
192
|
+
})),
|
|
193
|
+
width: "fill"
|
|
194
|
+
})]
|
|
195
|
+
}),
|
|
196
|
+
/* @__PURE__ */ F(O, {
|
|
197
|
+
"aria-label": u("prompt"),
|
|
198
|
+
placeholder: u("promptPlaceholder"),
|
|
199
|
+
value: B,
|
|
200
|
+
onChange: (e) => V(e.target.value),
|
|
201
|
+
onKeyDown: (e) => {
|
|
202
|
+
e.key === "Enter" && (e.metaKey || e.ctrlKey) && e.currentTarget.form?.requestSubmit();
|
|
203
|
+
},
|
|
204
|
+
rows: 4
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ I("div", {
|
|
207
|
+
className: "space-y-1 text-xs text-muted-foreground",
|
|
208
|
+
children: [U ? /* @__PURE__ */ F("p", {
|
|
209
|
+
className: "flex flex-wrap items-center gap-1",
|
|
210
|
+
children: u.rich("runsOn", { runner: () => /* @__PURE__ */ F(x, {
|
|
211
|
+
workspace: r,
|
|
212
|
+
name: U.name,
|
|
213
|
+
kind: U.kind
|
|
214
|
+
}) })
|
|
215
|
+
}) : /* @__PURE__ */ F("p", {
|
|
216
|
+
className: "text-warning",
|
|
217
|
+
children: u("noRunner")
|
|
218
|
+
}), U && W && H && /* @__PURE__ */ F("p", {
|
|
219
|
+
className: "text-pretty",
|
|
220
|
+
children: u.rich("capped", {
|
|
221
|
+
runner: U.name,
|
|
222
|
+
got: h(W),
|
|
223
|
+
asked: h(H.permissionMode),
|
|
224
|
+
code: () => /* @__PURE__ */ F("code", { children: f(H.permissionMode) })
|
|
225
|
+
})
|
|
226
|
+
})]
|
|
227
|
+
}),
|
|
228
|
+
G.isError && /* @__PURE__ */ F(w, { children: m(G.error) }),
|
|
229
|
+
/* @__PURE__ */ F("div", {
|
|
230
|
+
className: "flex justify-end",
|
|
231
|
+
children: /* @__PURE__ */ F(C, {
|
|
232
|
+
type: "submit",
|
|
233
|
+
size: "sm",
|
|
234
|
+
variant: "primary",
|
|
235
|
+
loading: G.isPending,
|
|
236
|
+
disabled: !B.trim() || !T || !A,
|
|
237
|
+
children: u("start")
|
|
238
|
+
})
|
|
239
|
+
})
|
|
240
|
+
]
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function W({ workspace: e, doc: t }) {
|
|
244
|
+
let n = P("docStart"), r = P("agentWork.state"), { data: i = [] } = R(o(e, {
|
|
245
|
+
doc: t.key,
|
|
246
|
+
live: !0
|
|
247
|
+
}));
|
|
248
|
+
return i.length === 0 ? null : /* @__PURE__ */ F("ul", {
|
|
249
|
+
"aria-label": n("runs"),
|
|
250
|
+
className: "mt-3 space-y-1.5",
|
|
251
|
+
children: i.map((t) => /* @__PURE__ */ I("li", {
|
|
252
|
+
className: "flex flex-wrap items-center gap-x-2 gap-y-1 rounded-lg border border-agent/50 bg-card px-3 py-2 text-xs",
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ F("span", {
|
|
255
|
+
className: "font-medium",
|
|
256
|
+
children: t.agentName
|
|
257
|
+
}),
|
|
258
|
+
/* @__PURE__ */ F("span", {
|
|
259
|
+
className: "text-muted-foreground",
|
|
260
|
+
children: r(t.state)
|
|
261
|
+
}),
|
|
262
|
+
/* @__PURE__ */ F(m, {
|
|
263
|
+
to: "/$workspace/issues/$identifier",
|
|
264
|
+
params: {
|
|
265
|
+
workspace: e,
|
|
266
|
+
identifier: t.identifier
|
|
267
|
+
},
|
|
268
|
+
className: "min-w-0 flex-1 truncate text-muted-foreground hover:text-foreground hover:underline",
|
|
269
|
+
children: t.identifier
|
|
270
|
+
}),
|
|
271
|
+
t.lastRunnerName ? /* @__PURE__ */ F(x, {
|
|
272
|
+
workspace: e,
|
|
273
|
+
name: t.lastRunnerName,
|
|
274
|
+
kind: t.runnerKind
|
|
275
|
+
}) : /* @__PURE__ */ F("span", {
|
|
276
|
+
className: "text-muted-foreground",
|
|
277
|
+
children: n("waitingForRunner")
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ F(E, {
|
|
280
|
+
value: t.createdAt,
|
|
281
|
+
format: "compact",
|
|
282
|
+
className: "text-muted-foreground"
|
|
283
|
+
})
|
|
284
|
+
]
|
|
285
|
+
}, t.id))
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
export { W as DocRuns, V as DocStart };
|