dsh-taskboard 0.6.7 → 0.7.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/README.md +24 -14
- package/lib/client.js +56 -8
- package/lib/host/assets.js +139 -0
- package/lib/host/assets.js.map +1 -0
- package/lib/host/routes.js +87 -0
- package/lib/host/routes.js.map +1 -1
- package/lib/host/storage-queue.js +14 -0
- package/lib/host/storage-queue.js.map +1 -0
- package/lib/host/storage.js +249 -0
- package/lib/host/storage.js.map +1 -0
- package/lib/host/store.js +34 -7
- package/lib/host/store.js.map +1 -1
- package/lib/host/templates.js +62 -38
- package/lib/host/templates.js.map +1 -1
- package/lib/host/tools.js +6 -4
- package/lib/host/tools.js.map +1 -1
- package/lib/index.js +83 -27
- package/lib/index.js.map +1 -1
- package/lib/shared/api.js.map +1 -1
- package/package.json +12 -11
- package/src/client/api.ts +30 -0
- package/src/client/board/SettingsModal.tsx +67 -4
- package/src/client/board/SlashPromptInput.tsx +80 -1
- package/src/client/board/TaskDetail.tsx +71 -8
- package/src/client/board/TaskFormModal.tsx +8 -5
- package/src/client/controller.ts +44 -2
- package/src/client/i18n/en.ts +17 -3
- package/src/client/i18n/zh.ts +17 -3
- package/src/client/image-insert.ts +29 -0
- package/src/client/styles.ts +34 -1
- package/src/host/assets.ts +120 -0
- package/src/host/routes.ts +92 -0
- package/src/host/storage-queue.ts +10 -0
- package/src/host/storage.ts +212 -0
- package/src/host/store.ts +40 -12
- package/src/host/templates.ts +30 -7
- package/src/host/tools.ts +8 -4
- package/src/index.ts +88 -33
- package/src/shared/api.ts +26 -0
- package/src/shared/version.ts +1 -1
package/lib/client.js
CHANGED
|
@@ -4,10 +4,21 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react-dom/client"),n=require("react/jsx-runtime"),r=require("react-dom");async function i(e){let t=await e,n=await t.json().catch(()=>null);if(n===null)throw Error(`taskboard: HTTP ${t.status}`);if(!n.ok)throw Error(`taskboard: ${n.error.code}: ${n.error.message}`);return n.value}const a=1e4;async function o(e){return i(fetch(e,{signal:AbortSignal.timeout(a)}))}async function s(e,t){return i(await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(a)}))}function c(){return{state:()=>o(`/dsh-taskboard/state`),workspaces:()=>o(`/dsh-taskboard/workspaces`),create:e=>s(`/dsh-taskboard/tasks`,e),get:e=>o(`/dsh-taskboard/tasks/${encodeURIComponent(e)}`),update:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/update`,t),move:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/move`,t),archiveSessions:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/archive-sessions`,{}),reject:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/reject`,t),comment:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/comment`,{body:t}),remove:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/delete`,t),run:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/run`,t??{}),cancel:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/cancel`,{}),mergeBranch:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/merge`,{}),worktreeRemove:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/worktree-remove`,t),diagnostics:()=>o(`/dsh-taskboard/diagnostics`),worktreeCleanup:(e,t)=>s(`/dsh-taskboard/worktree-cleanup`,{workspaceId:e,taskId:t}),diff:(e,t)=>{let n=new URLSearchParams({execution:t.execution});return t.commit!==void 0&&n.set(`commit`,t.commit),t.path!==void 0&&n.set(`path`,t.path),t.repo!==void 0&&n.set(`repo`,t.repo),o(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/diff?${n.toString()}`)},importPreview:e=>s(`/dsh-taskboard/import/preview`,e),importCommit:(e,t)=>s(`/dsh-taskboard/import`,{mode:e,ledger:t}),templates:()=>o(`/dsh-taskboard/templates`),templateUpsert:e=>s(`/dsh-taskboard/templates`,e),templateDelete:e=>s(`/dsh-taskboard/templates/delete`,{id:e}),settings:()=>o(`/dsh-taskboard/settings`),updateSettings:e=>s(`/dsh-taskboard/settings/update`,e),promptCompletions:()=>o(`/dsh-taskboard/prompt-completions`),modelCatalog:()=>o(`/dsh-taskboard/model-catalog`),stream(e,t){let n=new EventSource(`/dsh-taskboard/events`),r;return n.addEventListener(`hello`,e=>{let n;try{n=JSON.parse(e.data)}catch{return}r!==void 0&&n.revision!==r&&t(),r=n.revision}),n.addEventListener(`change`,n=>{let i;try{i=JSON.parse(n.data)}catch{return}r!==void 0&&i.revision!==r+1&&t(),r=i.revision,e(i)}),n.onerror=()=>{},()=>{n.close()}}}}const l=[`backlog`,`todo`,`in_progress`,`in_review`,`done`],u=[`canceled`,`archived`];[...l,...u];const d={backlog:[`todo`,`canceled`],todo:[`in_progress`,`backlog`,`canceled`],in_progress:[`in_review`,`todo`,`canceled`],in_review:[`in_progress`,`todo`,`done`,`canceled`],done:[`archived`],canceled:[`archived`,`todo`],archived:[]};function f(e,t){return d[e].includes(t)}function p(e){if(typeof e!=`string`)return`workspace-write`;let t=e.trim();if(t===`workspace-write`||t===`workspaceWrite`)return`workspace-write`;if(t===`read-only`||t===`readOnly`)return`read-only`;if(t===`danger-full-access`||t===`fullAccess`)return`danger-full-access`;throw Error(`permission must be 'workspace-write', 'read-only', or 'danger-full-access'`)}function m(e){return e?.defaultIsolation??`none`}function h(e){return e?.syncExternalSessions??!1}function g(e){return e?.defaultPermission??`workspace-write`}function _(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=[[0,59],[0,23],[1,31],[1,12],[0,7]],r=[];for(let e=0;e<5;e++){let[i,a]=n[e],o=new Set;if(!v(t[e],i,a,o))return null;r.push(o)}let i=new Set;for(let e of r[4])i.add(e===7?0:e);return{minutes:r[0],hours:r[1],days:r[2],months:r[3],weekdays:i}}function v(e,t,n,r){for(let i of e.split(`,`)){let[e,a]=i.split(`/`),o=a===void 0?1:Number.parseInt(a,10);if(!Number.isInteger(o)||o<1)return!1;let s,c;if(e===void 0||e===``)return!1;if(e===`*`)s=t,c=n;else if(e.includes(`-`)){let[t,n]=e.split(`-`);if(s=Number.parseInt(t??``,10),c=Number.parseInt(n??``,10),!Number.isInteger(s)||!Number.isInteger(c))return!1}else{if(s=Number.parseInt(e,10),!Number.isInteger(s))return!1;c=a===void 0?s:n}if(s<t||c>n||s>c)return!1;for(let e=s;e<=c;e+=o)r.add(e)}return r.size>0}function y(e,t){let n=new Date(t);n.setSeconds(0,0),n.setMinutes(n.getMinutes()+1);let r=t+4*366*24*60*60*1e3,i=n.getTime();for(;i<=r;){let t=new Date(i);if(e.months.has(t.getMonth()+1)&&e.days.has(t.getDate())&&e.weekdays.has(t.getDay())&&e.hours.has(t.getHours())&&e.minutes.has(t.getMinutes()))return i;i+=6e4}return null}function b(){return{schemaVersion:1,revision:0,tasks:[]}}function x(e){let t=new Set,n=[],r=e=>{if(typeof e==`string`){let r=e.trim();r.length>0&&!t.has(r)&&(t.add(r),n.push(r))}};if(Array.isArray(e.executions))for(let t of e.executions)typeof t==`object`&&t&&r(t.sessionId);return n}function S(e){let t=e.checklist??[];return{done:t.filter(e=>e.checked).length,total:t.length}}const C={zh:{"shared.close":`关闭`,"shared.cancel":`取消`,"shared.loading":`读取中…`,"shared.blocked":`受阻`,"shared.permission":`权限`,"shared.confirmDelete":`确认删除`,"shared.current":`(当前:{name})`,"shared.entry.aria":`Agent 任务看板`,"shared.entry.label":`任务看板`,"shared.stats.title":`待办 {todo} | 进行中 {doing} | 待验收 {review}(待办|进行中|待验收)`,"shared.duplicate.suffix":`(副本)`,"status.column.backlog":`待规划`,"status.column.todo":`待办`,"status.column.in_progress":`进行中`,"status.column.in_review":`待验收`,"status.column.done":`已完成`,"status.column.canceled":`已取消`,"status.column.archived":`已归档`,"status.pill.backlog":`待规划`,"status.pill.todo":`待办`,"status.pill.in_progress":`进行中`,"status.pill.in_review":`待验收`,"status.pill.done":`完成`,"status.pill.canceled":`取消`,"status.pill.archived":`归档`,"status.move.backlog":`待规划`,"status.move.todo":`待办`,"status.move.in_progress":`进行中`,"status.move.in_review":`待验收`,"status.move.done":`完成`,"status.move.canceled":`取消`,"status.move.archived":`归档`,"urgency.urgent":`紧急`,"urgency.normal":`一般`,"urgency.relaxed":`不急`,"outcome.running":`执行中`,"outcome.succeeded":`成功`,"outcome.failed":`失败`,"outcome.cancelled":`已取消`,"board.title":`Agent 任务看板`,"board.count.tasks":`{n} 任务 · rev {rev}`,"board.action.newTask":`+ 新建任务 ▼`,"board.action.blankTask":`空白任务`,"board.action.manageTemplates":`⌗ 管理模板…`,"board.search.placeholder":`搜索标题 / ID…`,"board.filter.allProjects":`全部项目`,"board.sort.title":`列内排序`,"board.sort.default":`默认排序`,"board.sort.updated":`最近更新`,"board.sort.urgency":`按紧急度`,"board.sort.created":`创建时间`,"board.sort.byTitle":`按标题`,"board.action.backToBoard":`返回看板`,"board.action.otherTasks":`其它任务`,"board.action.settingsTitle":`看板设置:新建任务的默认执行隔离等`,"board.action.settings":`🛠 设置`,"board.action.diagTitle":`健康诊断:遗留 worktree、台账基本项`,"board.action.diag":`⚙ 诊断`,"board.action.importTitle":`从 JSON 备份文件导入台账(预览后合并或整册替换)`,"board.action.import":`⬆ 导入`,"board.action.exportTitle":`导出台账:完整 JSON 备份或任务清单 CSV`,"board.action.export":`⬇ 导出 ▼`,"board.export.jsonTitle":`完整台账备份(含执行历史与看板设置),可用于导入恢复`,"board.export.json":`完整台账(JSON)`,"board.export.csvTitle":`任务清单表格(Excel 可直接打开,中文已加 BOM)`,"board.export.csv":`任务清单(CSV)`,"board.drag.forbidden":`无法从「{from}」拖至「{to}」`,"board.empty":`无任务`,"board.secondary.empty":`无已取消 / 已归档 / 已删除任务`,"board.group.trashed":`已删除`,"diag.title":`健康诊断`,"diag.subtitle":`台账基本项与 worktree 遗留清理`,"diag.revision":`台账修订号`,"diag.tasks":`任务总数`,"diag.running":`执行中`,"diag.orphans":`遗留 worktree`,"diag.orphans.heading":`遗留 worktree(台账无主但目录存在)`,"diag.orphans.none":`无遗留 — 各项目 .dsh-worktrees 目录干净`,"diag.orphans.cleanup":`清理`,"diag.orphans.hint":`提示:有未提交修改的遗留目录会被拒绝清理,请先手动处理其内容。live 任务的 worktree 请在任务详情页删除。`,"diag.gitignore.heading":`gitignore 建议`,"diag.gitignore.none":`无待办 — 各 git 项目已忽略 .dsh-worktrees 目录`,"diag.gitignore.suggestA":`建议在 .gitignore 加入一行`,"diag.gitignore.suggestB":`(不会自动修改)`,"card.drag.running":`该任务正由会话执行中({title}),不能拖动`,"card.badge.stale":`⏱ 认领超时`,"card.badge.modelTitle":`固定模型: {model}`,"card.badge.modelEffort":` · 思考强度: {effort}`,"card.badge.checklistReview":`待验收:清单未全部勾选`,"card.badge.checklist":`验收清单进度`,"card.badge.pendingPurge":`待清除`,"card.session.jumpTitle":`点击一键跳转到会话:{id}`,"card.session.missing":`该会话已被删除({id}),无法打开`,"card.session.archived":`该会话已归档({id}),已从会话列表隐藏`,"card.session.unavailable":`会话导航不可用,会话 ID:{id}`,"card.reject.placeholder":`退回原因(可选,agent 开工前会读)…`,"card.reject.confirm":`退回待办`,"card.action.doneTitle":`验收完成:移至已完成`,"card.action.done":`✓ 完成`,"card.action.rejectTitle":`退回待办,可附退回原因`,"card.action.reject":`✗ 退回`,"alert.ok":`知道了`,"diff.commit":`提交 {hash}`,"diff.file":`文件 {path}`,"diff.truncated":`⚠ 内容过长已截断`,"diff.failed":`获取失败(原因见看板顶部错误条;对象可能已随 worktree 删除丢失)`,"checklist.title":`验收清单(DoD)`,"checklist.unchecked":` · {n} 项未完成`,"checklist.allDone":` · 全部完成`,"checklist.byUser":`👤 用户`,"checklist.uncheckedItem":`未完成`,"checklist.evidence":`证据:{note}`,"report.title":`执行报告`,"report.submitted":`由执行会话提交 · {time}`,"report.changedFiles":`改动文件`,"report.checks":`自验情况`,"report.artifacts":`产物`,"report.risk":`剩余风险`,"iso.title":`执行隔离`,"iso.none":`📁 原目录执行`,"iso.worktreeTitle":`执行隔离 · Worktree`,"iso.branch":`🌿 分支`,"iso.baseline":`基线 {base} → {head}`,"iso.changed":`改动 {n} 个文件`,"iso.commit.openTitle":`点击展开该提交的 diff`,"iso.commits.more":`… 共 {n} 个提交`,"iso.nocommit":`该次执行没有产生提交(改动可能未提交,见下方警告)`,"iso.dirty.toggle":`⚠ 有 {n} 处未提交修改(合并前请让 agent 提交,或手动处理)`,"iso.dirty.expand":` ▼ 查看文件`,"iso.dirty.collapse":` ▲`,"iso.dirty.openTitle":`点击查看该文件的未提交 diff`,"iso.dirty.more":`… 共 {n} 处(完整列表见任务台账)`,"iso.hint.running":`执行中 — 结束后可合并或清理`,"iso.merge.confirm":`将分支以 --no-ff 合并到主工作区?`,"iso.merge.go":`确认合并`,"iso.merge.title":`在主工作区 git merge --no-ff 该任务分支(要求主区干净;冲突会原样报告)`,"iso.merge.button":`⇥ 合并到主工作区`,"iso.merge.failed":`合并失败:{error}`,"iso.merge.noop":`该分支没有领先主工作区的新提交,无需合并(可退回续跑或直接清理)`,"iso.merge.done":`已按仓库合并(--no-ff):{summary}`,"iso.merge.partial":`部分仓库合并失败:{summary}
|
|
8
|
-
{error}`,"iso.repo.root":`根仓库`,"iso.remove.wt":`🗑 删除 worktree`,"iso.remove.wtTitle":`git worktree remove(有未提交修改时拒绝)`,"iso.remove.wtb":`🗑 删 worktree + 分支`,"iso.remove.wtbTitle":`删除 worktree 并删除任务分支(有未提交修改时拒绝)`,"iso.remove.confirmWt":`删除 worktree 目录?`,"iso.remove.confirmWtb":`删除 worktree 并删除分支?`,"iso.remove.failed":`删除失败:{error}`,"iso.remove.branchFailed":`worktree 已删除,但分支删除失败:{error}`,"iso.hint.keep":`分支与 worktree 保留中 — 可退回继续修改`,"detail.session.jumpTitle":`一键跳转到对应会话:{id}`,"detail.session.jump":`🤖 跳转会话 ↗`,"detail.action.edit":`✎ 编辑`,"detail.action.duplicateTitle":`复制此任务的全部配置为一张新卡(待办列)`,"detail.action.duplicate":`⧉ 复制`,"detail.action.saveTplTitle":`把此任务的配置(含清单)保存为模板,新建任务时可用`,"detail.action.saveTplDone":`已存为模板(新建任务 ▼ 下拉可用,可在模板管理中改名)`,"detail.action.saveTpl":`⌗ 存为模板`,"detail.action.reuseTitle":`续跑:保留现有 worktree 与分支(上次的改动和提交都在原处),在其上继续执行;默认「立即执行」会重置为全新基线`,"detail.action.reuse":`↻ 续跑`,"detail.action.runTitleModel":`新会话执行({model})`,"detail.action.runTitleDefault":`新会话执行(默认模型)`,"detail.action.run":`▶ 立即执行`,"detail.action.stopConfirm":`停止该执行会话?`,"detail.action.stop":`停止`,"detail.action.stopTitle":`停止执行会话 {id}(任务回到待办)`,"detail.action.stopExec":`■ 停止执行`,"detail.chip.nextRun":`{cron} · 下次 {time}`,"detail.chip.checklist":`清单 {done}/{total}`,"detail.chip.isolated":`Worktree 隔离`,"detail.chip.holderTitle":`点击跳转至该会话:{id}`,"detail.chip.holderStale":`认领超时 · `,"detail.chip.holderBy":`由 `,"detail.chip.holderSuffix":` 持有 ↗`,"detail.chip.trashed":`已删除待清除`,"detail.sub.line":`更新 {time} · 最近操作 {who}`,"detail.updatedBy.system":`⚙️ 系统`,"detail.updatedBy.user":`👤 用户`,"detail.field.description":`描述`,"detail.field.prompt":`执行 Prompt`,"detail.move.to":`移至→{status}`,"detail.move.confirmDoneUnchecked":`仍有 {n} 项清单未勾选,确认完成?`,"detail.move.confirmDone":`确认完成?`,"detail.move.confirmArchive":`确认归档该任务?`,"detail.move.confirmArchiveSessionWithId":`是否连同执行会话 {id} 一同归档?`,"detail.move.confirmArchiveSessionCount":`是否连同 {n} 个执行会话一同归档?`,"detail.move.archiveWithSession":`连同会话归档`,"detail.move.archiveUnsupported":`当前宿主不支持会话归档`,"detail.move.archiveResult":`卡片已归档;执行会话归档成功 {n} 个。失败会话如下(如有):`,"detail.move.archiveRetry":`归档 / 重试归档执行会话`,"detail.move.archiveCardOnly":`仅归档卡片`,"detail.move.confirm":`确认`,"detail.blocked.unmark":`✓ 解除受阻`,"detail.blocked.mark":`⛔ 标记受阻`,"detail.release.title":`释放 {id} 的认领:任务回到待办(持有会话可能仍在工作,确认它已停止后再释放)`,"detail.release.button":`🔓 释放认领`,"detail.comments.title":`评论`,"detail.comments.empty":`暂无评论 — agent 交接时会在这里汇报改动与验证结果`,"detail.comments.user":`用户`,"detail.composer.placeholder":`以用户身份留言(agent 开工前会读)…`,"detail.composer.send":`发表`,"detail.exec.title":`执行记录`,"detail.exec.prunedTitle":`更早的 {n} 条执行记录已按保留上限清理`,"detail.exec.pruned":`+{n} 已清理`,"detail.exec.trigger.manual":`手动`,"detail.exec.trigger.scheduled":`定时`,"detail.exec.openTitle":`点击打开该执行会话:{id}`,"detail.danger.delete":`🗑 删除(标记待清除)`,"detail.danger.purgeConfirm":`物理清除不可恢复`,"detail.danger.purgeGo":`确认清除`,"detail.danger.purge":`🔥 物理清除(需确认)`,"form.title.create":`新建任务`,"form.title.edit":`编辑任务`,"form.subtitle.create":`推入看板,项目内会话可认领执行`,"form.subtitle.edit":`调整任务内容与执行配置`,"form.field.title":`标题`,"form.field.titlePlaceholder":`一句话说清要做什么`,"form.field.project":`项目`,"form.field.model":`模型(默认 = 会话默认模型)`,"form.field.modelDefault":`默认模型`,"form.model.option":`{name}({provider})`,"form.field.effort":`思考强度(Reasoning Effort)`,"form.field.effortTitle":`设置模型的思考强度(如 low/medium/high);默认 = 跟随模型/提供商默认`,"form.effort.follow":`跟随模型默认`,"form.effort.low":`低 (low)`,"form.effort.medium":`中 (medium)`,"form.effort.high":`高 (high)`,"form.effort.none":`关闭思考 (none)`,"form.field.preset":`执行模式(preset)`,"form.field.presetTitle":`执行会话按该 preset 组合(决定工具集与人设);默认 = 部署默认 preset`,"form.preset.follow":`跟随部署默认`,"form.preset.defaultTag":`(部署默认)`,"form.field.urgency":`紧急度`,"form.urgency.urgent":`紧急`,"form.urgency.urgentHint":`优先处理`,"form.urgency.normal":`一般`,"form.urgency.normalHint":`正常排期`,"form.urgency.relaxed":`不急`,"form.urgency.relaxedHint":`有空再做`,"form.field.description":`描述`,"form.field.descriptionOptional":`描述(可选)`,"form.desc.placeholder":`需求细节、背景说明、验收标准…`,"form.field.prompt":`执行 Prompt(实际 Prompt = 标题+任务描述+Prompt)`,"form.field.promptOptional":`执行 Prompt(可选;实际 Prompt = 标题+任务描述+Prompt)`,"form.prompt.placeholder":`追加在「标题+任务描述」之后发给执行会话的补充指令。支持模板变量:{{lastExecution}}(上次执行结果)、{{lastComments}}(最近 3 条评论)`,"form.field.mode":`执行方式`,"form.mode.claim":`🤝 认领制`,"form.mode.claimHint":`项目内会话认领`,"form.mode.scheduled":`⏰ 定时执行`,"form.mode.scheduledHint":`到点自动开跑`,"form.field.cron":`Cron 表达式`,"form.cron.placeholder":`分 时 日 月 周`,"form.cron.daily":`每天 09:00`,"form.cron.hourly":`每小时`,"form.cron.every10min":`每 10 分钟`,"form.cron.weekly":`每周一 09:00`,"form.cron.next":`下次 {time}`,"form.field.isolation":`执行隔离`,"form.iso.locked":`任务已有执行记录,隔离方式已锁定`,"form.iso.lockedShort":`已锁定(执行开始后不可更改)`,"form.iso.nonGit":`当前项目非 git 仓库`,"form.iso.worktree":`🌿 Worktree 隔离`,"form.iso.worktreeTitle":`每次执行在独立 worktree 分支上进行`,"form.iso.worktreeHint":`独立分支 task/标题+ID,互不污染`,"form.iso.none":`📁 原目录执行`,"form.iso.noneTitle":`直接在项目目录执行(不使用 git)`,"form.iso.noneHintNonGit":`当前项目非 git 仓库,将在原目录执行`,"form.iso.noneHint":`不使用 git,直接在项目目录工作`,"form.iso.nonGitNote":`当前项目非 git 仓库,将在原目录执行(任务仍按默认配置创建,运行时自动降级)`,"form.iso.mirrorNote":`多仓库工作区:Worktree 隔离将自动整区镜像 {n} 个仓库——每仓库独立任务分支,验收按仓库合并`,"form.field.checklist":`验收清单(DoD)`,"form.field.checklistOptional":`验收清单(DoD,可选)`,"form.check.itemPlaceholder":`验收项 {n}(完成标准)`,"form.check.removeTitle":`删除该验收项`,"form.check.add":`+ 添加验收项`,"form.check.checkedTitle":`勾选状态随保存保留(当前勾选人:{who})`,"form.check.notCheckedYet":`未勾选`,"form.check.hintCreate":`共 {n} 项,执行会话按清单干活并逐项勾选,未完成项验收时高亮`,"form.check.hintEdit":`已勾选 {checked}/{total}(保存将整体覆盖清单,勾选状态保留)`,"form.hint.needTitle":`请填写标题`,"form.hint.needProject":`请选择项目`,"form.hint.cronBad":`Cron 表达式无效(分 时 日 月 周)`,"form.hint.nextRun":`下次运行 {time}`,"form.hint.saveVersion":`保存后版本 v{v} → v{next}`,"form.hint.createClaim":`创建后项目内会话可认领执行`,"form.action.runBlockedTitle":`任务正在执行中,不能重复发起`,"form.action.runBusyTitle":`正在提交…`,"form.action.runTitle":`保存后立即发起执行(新会话)`,"form.action.run":`⚡ 立即执行`,"form.action.save":`保存修改`,"form.action.create":`创建任务`,"tpl.aria":`管理模板`,"tpl.title":`任务模板`,"tpl.subtitle":`新建任务 ▼ 下拉的模板:改名 / 删除 / 直接使用;任务详情页「存为模板」可新增`,"tpl.empty":`暂无模板 — 在任务详情页点「存为模板」把常用配置沉淀下来`,"tpl.name.aria":`模板名 {name}`,"tpl.builtin":`内置`,"tpl.custom":`自建`,"tpl.meta.checklist":` · 清单 {n} 项`,"tpl.rename.title":`保存改名`,"tpl.rename.button":`改名`,"tpl.use.title":`用此模板打开新建表单`,"tpl.use.button":`用此新建`,"tpl.delete.title":`删除该模板`,"tpl.renamed":`模板已改名`,"tpl.foot.hint":`模板随台账一同保存在 DSH 主目录,升级不丢`,"imp.aria":`导入台账`,"imp.title":`导入台账`,"imp.subtitle":`选择导出的 JSON 备份文件:先预览、再合并或整册替换`,"imp.parseError":`文件不是合法 JSON`,"imp.note":`⬇ JSON 导出的文件即为同格式备份,可直接导入恢复;导入文件的 schemaVersion 必须与当前版本一致。`,"imp.previewing":`预览中…`,"imp.stat.create":`新增`,"imp.stat.overwrite":`覆盖(同 id)`,"imp.stat.invalid":`无效(跳过)`,"imp.sec.create":`新增任务`,"imp.sec.overwrite":`覆盖任务(整卡替换,含执行历史与评论)`,"imp.sec.invalid":`无效条目(不会导入)`,"imp.noId":`(无 id)`,"imp.mode.merge":`⊕ 合并`,"imp.mode.mergeHint":`新增 + 按 id 覆盖,其余不动`,"imp.mode.replace":`💣 整册替换`,"imp.mode.replaceHint":`清空当前台账,以导入文件为准(先自动备份)`,"imp.result.replace":`整册替换完成:导入 {n} 张(原 {total} 张已整册备份)`,"imp.result.merge":`合并完成:新增 {n} 张、覆盖 {m} 张`,"imp.foot.replaceConfirm":`⚠ 再次点击确认执行整册替换(不可撤销,已自动备份)`,"imp.foot.replaceNeedConfirm":`整册替换需要二次确认`,"imp.foot.mergeHint":`合并只写入预览中列出的任务`,"imp.action.run":`执行导入`,"imp.action.confirmReplace":`确认整册替换`,"set.aria":`看板设置`,"set.title":`看板设置`,"set.subtitle":`新建任务与会话同步的全局默认值`,"set.iso.heading":`默认执行隔离`,"set.iso.noneHint":`不使用 git,直接在项目目录工作(出厂默认)`,"set.iso.worktreeHint":`每次执行在独立 worktree 分支上进行(task/标题+ID),互不污染;多仓库工作区自动整区镜像(每仓库独立分支)`,"set.iso.current":`当前保存的默认:{current}。仅影响之后新建的任务;已有任务保持创建时的选择,非 git 项目运行时仍自动降级原目录。`,"set.sync.heading":`自动同步工作区会话`,"set.sync.off.name":`🚫 关闭同步`,"set.sync.off.title":`仅管理在任务看板中创建和触发的任务`,"set.sync.off.hint":`仅管理看板任务(出厂默认)`,"set.sync.on.name":`🔄 自动纳入会话`,"set.sync.on.title":`各工作区直接新建的会话也会在看板展示,运行中进入「进行中」,完成后自动进入「待验收」`,"set.sync.on.hint":`跟踪运行并在完成后进入待验收`,"set.sync.stateOn":`已开启:工作区直接新建并执行的会话将自动在看板生成任务卡片,并在完成后流转至「待验收」列。`,"set.sync.stateOff":`已关闭:仅在看板内部创建与触发执行的任务会出现在看板上。`,"set.foot.dirty":`有未保存的修改`,"set.foot.clean":`与看板当前设置一致`,"set.action.save":`保存设置`,"form.field.permission":`执行权限`,"form.perm.write":`可写入工作区`,"form.perm.writeHint":`可读写工作区及临时目录(推荐默认)`,"form.perm.readOnly":`仅可查看`,"form.perm.readOnlyHint":`只读查看与检索,禁止修改文件或执行外部命令`,"form.perm.fullAccess":`完全权限`,"form.perm.fullAccessHint":`完全无限制权限,可访问全盘及执行外部命令`,"form.perm.defaultTag":`(默认)`,"set.perm.heading":`默认执行权限`,"set.perm.writeName":`📁 可写入工作区(出厂默认)`,"set.perm.writeHint":`可读写工作区及临时目录,写操作无需二次确认`,"set.perm.readOnlyName":`🔒 仅可查看`,"set.perm.readOnlyHint":`仅允许只读查看与检索,禁止修改文件或破坏性命令`,"set.perm.fullName":`⚡ 完全权限`,"set.perm.fullHint":`完全无限制权限,可访问全盘及执行系统外部命令`,"set.perm.current":`当前保存的默认:{current}。新建任务时预设的执行权限。`,"card.badge.permReadOnly":`🔒 仅查看`,"card.badge.permReadOnlyTitle":`权限:仅可查看`,"card.badge.permFull":`⚡ 全权限`,"card.badge.permFullTitle":`权限:完全权限`,"detail.chip.permReadOnly":`仅可查看`,"detail.chip.permFull":`完全权限`,"detail.chip.permWrite":`可写入工作区`,"tpl.meta.permReadOnly":`仅查看`,"tpl.meta.permFull":`全权限`,"md.imageAlt":`图片 {n}`,"md.imageTitle":`点击查看大图 ({alt})`,"md.lightboxAlt":`大图预览`,"md.closePreview":`关闭预览`,"slash.aria":`快捷命令与技能`,"slash.title":`快捷命令与技能补全`,"slash.hint":`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`,"slash.badge.command":`⚡ 命令`,"slash.badge.skill":`🧩 技能`,"slash.tipA":`💡 输入`,"slash.tipB":`可快速补全 Slash 命令与 Agent 技能`,"slash.cmd.goal.desc":`自主完成长期目标任务,持续深度推进`,"slash.cmd.goal.hint":`<目标描述>`,"slash.cmd.schedule.desc":`设置一次性定时或周期性 Cron 调度`,"slash.cmd.schedule.hint":`<时间/表达式>`,"slash.cmd.plan.desc":`在行动前制定分步实施计划并由用户确认`,"slash.cmd.browser.desc":`启动网页浏览器交互与实时页面检索`,"slash.cmd.grill-me.desc":`通过多轮单题访谈深入对齐需求与设计意图`,"slash.cmd.teamwork-preview.desc":`多智能体协作与团队工作流预览`,"slash.cmd.learn.desc":`沉淀解决经验与新规则到知识库`,"slash.cmd.review.desc":`多维度代码审查(正确性、架构与安全)`,"slash.cmd.security.desc":`安全加固与代码漏洞扫描`,"slash.cmd.permission.desc":`切换当前会话权限级别 (read-only / workspace-write / full-access)`,"slash.cmd.permission.hint":`<preset>`,"slash.skill.frontend-ui-engineering":`构建生产级、可访问的高品质前端界面与组件`,"slash.skill.api-and-interface-design":`设计稳定契约、清晰边界的 REST / RPC 接口`,"slash.skill.test-driven-development":`测试驱动开发(TDD),编写单元与集成测试`,"slash.skill.debugging-and-error-recovery":`系统化定位 Bug 根因并恢复错误`,"slash.skill.performance-optimization":`前后端性能调优、减少渲染开销与查询优化`,"slash.skill.ci-cd-and-automation":`自动化构建、CI/CD 流水线与质量门禁`,"slash.skill.code-review-and-quality":`多轴向代码审查与重构指导`,"slash.skill.code-simplification":`精简复杂逻辑,提升可读性与可维护性`,"slash.skill.context-engineering":`优化上下文结构与提示词工程`,"slash.skill.doubt-driven-development":`以怀疑驱动的对抗式审查,确保核心逻辑正确`,"slash.skill.git-workflow-and-versioning":`Git 工作流、分支管理、语义化版本与变更日志`,"slash.skill.idea-refine":`通过发散与收敛思维细化方案与假设检验`,"slash.skill.incremental-implementation":`小步快跑、增量交付多文件变更`,"slash.skill.interview-me":`深度访谈挖掘真实意图`,"slash.skill.memory-leak-debugging":`排查诊断 JavaScript/Node.js 内存泄漏`,"slash.skill.observability-and-instrumentation":`添加日志、指标打点与链路追踪`,"slash.skill.planning-and-task-breakdown":`将复杂需求拆解为有序可执行任务`,"slash.skill.security-and-hardening":`防御安全漏洞、输入过滤与鉴权加固`,"slash.skill.shipping-and-launch":`生产发布前检查清单与回滚策略`,"slash.skill.source-driven-development":`基于权威官方文档与源码进行设计实现`,"slash.skill.spec-driven-development":`在编码前制定清晰的技术规范`,"slash.skill.using-agent-skills":`发现并动态调用智能体各项专业技能`,"sys.execFailed":`[系统] 执行失败:{error};任务已退回待办。`,"sys.endedWithComment":`[系统] 执行会话已结束并留有评论,但未移至待验收;系统自动移入待验收。`,"sys.endedNoHandoff":`[系统] 执行会话已结束,但未按协议交接(无评论、未移至待验收);系统自动移入待验收,请审查后退回或验收。`,"sys.sessionError":`[系统] 会话执行异常:{error};任务已退回待办。`,"sys.sessionDone":`[系统] 会话执行完毕,已自动进入待验收。`,"sys.cronDead":`[系统] 定时表达式 {cron} 在 4 年内没有可触发时间,已停用定时;请修正 cron 后重新开启。`,"sys.mergeSingle":`[系统] 分支 {branch} 已合并到主工作区(--no-ff)。`,"sys.mergeMulti":`[系统] 分支已按仓库合并(--no-ff):{summary}`},en:{"shared.close":`Close`,"shared.cancel":`Cancel`,"shared.loading":`Loading…`,"shared.blocked":`Blocked`,"shared.permission":`Permission`,"shared.confirmDelete":`Delete`,"shared.current":` (current: {name})`,"shared.entry.aria":`Agent task board`,"shared.entry.label":`Task board`,"shared.stats.title":`To do {todo} | In progress {doing} | In review {review} (todo | in progress | in review)`,"shared.duplicate.suffix":` (copy)`,"status.column.backlog":`Backlog`,"status.column.todo":`To do`,"status.column.in_progress":`In progress`,"status.column.in_review":`In review`,"status.column.done":`Done`,"status.column.canceled":`Canceled`,"status.column.archived":`Archived`,"status.pill.backlog":`Planned`,"status.pill.todo":`To do`,"status.pill.in_progress":`In progress`,"status.pill.in_review":`In review`,"status.pill.done":`Done`,"status.pill.canceled":`Canceled`,"status.pill.archived":`Archived`,"status.move.backlog":`Backlog`,"status.move.todo":`To do`,"status.move.in_progress":`In progress`,"status.move.in_review":`In review`,"status.move.done":`Done`,"status.move.canceled":`Canceled`,"status.move.archived":`Archived`,"urgency.urgent":`Urgent`,"urgency.normal":`Normal`,"urgency.relaxed":`Relaxed`,"outcome.running":`Running`,"outcome.succeeded":`Succeeded`,"outcome.failed":`Failed`,"outcome.cancelled":`Canceled`,"board.title":`Agent Task Board`,"board.count.tasks":`{n} tasks · rev {rev}`,"board.action.newTask":`+ New Task ▼`,"board.action.blankTask":`Blank task`,"board.action.manageTemplates":`⌗ Manage templates…`,"board.search.placeholder":`Search title / ID…`,"board.filter.allProjects":`All projects`,"board.sort.title":`Sort within columns`,"board.sort.default":`Default order`,"board.sort.updated":`Recently updated`,"board.sort.urgency":`By urgency`,"board.sort.created":`Creation time`,"board.sort.byTitle":`By title`,"board.action.backToBoard":`Back to board`,"board.action.otherTasks":`Other tasks`,"board.action.settingsTitle":`Board settings: default execution isolation for new tasks, etc.`,"board.action.settings":`🛠 Settings`,"board.action.diagTitle":`Health diagnostics: orphan worktrees, ledger basics`,"board.action.diag":`⚙ Diagnostics`,"board.action.importTitle":`Import the ledger from a JSON backup (preview, then merge or replace)`,"board.action.import":`⬆ Import`,"board.action.exportTitle":`Export the ledger: full JSON backup or task-list CSV`,"board.action.export":`⬇ Export ▼`,"board.export.jsonTitle":`Full ledger backup (execution history and board settings included); import it to restore`,"board.export.json":`Full ledger (JSON)`,"board.export.csvTitle":`Task-list spreadsheet (opens directly in Excel; BOM added for CJK text)`,"board.export.csv":`Task list (CSV)`,"board.drag.forbidden":`Cannot drag from "{from}" to "{to}"`,"board.empty":`No tasks`,"board.secondary.empty":`No canceled / archived / deleted tasks`,"board.group.trashed":`Deleted`,"diag.title":`Health diagnostics`,"diag.subtitle":`Ledger basics and orphan-worktree cleanup`,"diag.revision":`Ledger revision`,"diag.tasks":`Total tasks`,"diag.running":`Running`,"diag.orphans":`Orphan worktrees`,"diag.orphans.heading":`Orphan worktrees (no owning task, directory still present)`,"diag.orphans.none":`None — every project’s .dsh-worktrees directory is clean`,"diag.orphans.cleanup":`Clean up`,"diag.orphans.hint":`Note: orphan directories with uncommitted changes are refused; handle their contents manually first. Remove a live task’s worktree from its task detail pane.`,"diag.gitignore.heading":`gitignore suggestions`,"diag.gitignore.none":`Nothing to do — every git project already ignores .dsh-worktrees`,"diag.gitignore.suggestA":`suggests adding one line to .gitignore:`,"diag.gitignore.suggestB":`(no automatic edits)`,"card.drag.running":`This task is being executed by a session ({title}) and cannot be dragged`,"card.badge.stale":`⏱ Claim stale`,"card.badge.modelTitle":`Pinned model: {model}`,"card.badge.modelEffort":` · reasoning effort: {effort}`,"card.badge.checklistReview":`In review: checklist has unchecked items`,"card.badge.checklist":`Acceptance checklist progress`,"card.badge.pendingPurge":`Pending purge`,"card.session.jumpTitle":`Click to jump to the session: {id}`,"card.session.missing":`The session has been deleted ({id}) and cannot be opened`,"card.session.archived":`The session is archived ({id}) and hidden from the session list`,"card.session.unavailable":`Session navigation unavailable; session id: {id}`,"card.reject.placeholder":`Reason for sending back (optional; the agent reads it before starting)…`,"card.reject.confirm":`Send back to todo`,"card.action.doneTitle":`Accept and complete: move to Done`,"card.action.done":`✓ Done`,"card.action.rejectTitle":`Send back to todo, optionally with a reason`,"card.action.reject":`✗ Send back`,"alert.ok":`Got it`,"diff.commit":`Commit {hash}`,"diff.file":`File {path}`,"diff.truncated":`⚠ Content truncated (too long)`,"diff.failed":`Failed to fetch (see the error bar at the top of the board; the object may be gone with a removed worktree)`,"checklist.title":`Acceptance checklist (DoD)`,"checklist.unchecked":` · {n} unchecked`,"checklist.allDone":` · all done`,"checklist.byUser":`👤 User`,"checklist.uncheckedItem":`Unchecked`,"checklist.evidence":`Evidence: {note}`,"report.title":`Execution report`,"report.submitted":`Submitted by the execution session · {time}`,"report.changedFiles":`Changed files`,"report.checks":`Self-verification`,"report.artifacts":`Artifacts`,"report.risk":`Remaining risks`,"iso.title":`Execution isolation`,"iso.none":`📁 Run in the original directory`,"iso.worktreeTitle":`Execution isolation · Worktree`,"iso.branch":`🌿 Branch`,"iso.baseline":`Baseline {base} → {head}`,"iso.changed":`{n} files changed`,"iso.commit.openTitle":`Click to expand this commit’s diff`,"iso.commits.more":`… {n} commits in total`,"iso.nocommit":`This execution produced no commits (changes may be uncommitted — see the warning below)`,"iso.dirty.toggle":`⚠ {n} uncommitted changes (have the agent commit before merging, or handle them manually)`,"iso.dirty.expand":` ▼ view files`,"iso.dirty.collapse":` ▲`,"iso.dirty.openTitle":`Click to view the uncommitted diff of this file`,"iso.dirty.more":`… {n} in total (full list in the task ledger)`,"iso.hint.running":`Running — merge or clean up after it ends`,"iso.merge.confirm":`Merge the branch into the main worktree with --no-ff?`,"iso.merge.go":`Merge`,"iso.merge.title":`git merge --no-ff the task branch into the main worktree (requires a clean main worktree; conflicts are reported as-is)`,"iso.merge.button":`⇥ Merge into main worktree`,"iso.merge.failed":`Merge failed: {error}`,"iso.merge.noop":`The branch has no commits ahead of the main worktree — nothing to merge (send it back to continue running, or clean it up)`,"iso.merge.done":`Merged per repo (--no-ff): {summary}`,"iso.merge.partial":`Some repos failed to merge: {summary}
|
|
9
|
-
{error}`,"iso.repo.root":`Root repo`,"iso.remove.wt":`🗑 Remove worktree`,"iso.remove.wtTitle":`git worktree remove (refused when uncommitted changes exist)`,"iso.remove.wtb":`🗑 Remove worktree + branch`,"iso.remove.wtbTitle":`Remove the worktree and delete the task branch (refused when uncommitted changes exist)`,"iso.remove.confirmWt":`Remove the worktree directory?`,"iso.remove.confirmWtb":`Remove the worktree and delete the branch?`,"iso.remove.failed":`Removal failed: {error}`,"iso.remove.branchFailed":`Worktree removed, but branch deletion failed: {error}`,"iso.hint.keep":`Branch and worktree kept — send back to continue editing`,"detail.session.jumpTitle":`Jump to the corresponding session: {id}`,"detail.session.jump":`🤖 Jump to session ↗`,"detail.action.edit":`✎ Edit`,"detail.action.duplicateTitle":`Duplicate this task’s full configuration as a new card (todo column)`,"detail.action.duplicate":`⧉ Duplicate`,"detail.action.saveTplTitle":`Save this task’s configuration (checklist included) as a template for new tasks`,"detail.action.saveTplDone":`Saved as a template (available in the New Task ▼ menu; rename it in template management)`,"detail.action.saveTpl":`⌗ Save as template`,"detail.action.reuseTitle":`Reuse-run: keep the existing worktree and branch (last run’s changes and commits stay in place) and continue on top of them; the default "Run" resets to a fresh baseline`,"detail.action.reuse":`↻ Reuse-run`,"detail.action.runTitleModel":`Run in a new session ({model})`,"detail.action.runTitleDefault":`Run in a new session (default model)`,"detail.action.run":`▶ Run`,"detail.action.stopConfirm":`Stop this execution session?`,"detail.action.stop":`Stop`,"detail.action.stopTitle":`Stop execution session {id} (the task returns to todo)`,"detail.action.stopExec":`■ Stop execution`,"detail.chip.nextRun":`{cron} · next {time}`,"detail.chip.checklist":`Checklist {done}/{total}`,"detail.chip.isolated":`Worktree isolation`,"detail.chip.holderTitle":`Click to jump to the session: {id}`,"detail.chip.holderStale":`Claim stale · `,"detail.chip.holderBy":`Held by `,"detail.chip.holderSuffix":` ↗`,"detail.chip.trashed":`Deleted, pending purge`,"detail.sub.line":`Updated {time} · last change by {who}`,"detail.updatedBy.system":`⚙️ System`,"detail.updatedBy.user":`👤 User`,"detail.field.description":`Description`,"detail.field.prompt":`Execution prompt`,"detail.move.to":`Move to → {status}`,"detail.move.confirmDoneUnchecked":`{n} checklist items are still unchecked — confirm done?`,"detail.move.confirmDone":`Confirm done?`,"detail.move.confirmArchive":`Confirm archive this task?`,"detail.move.confirmArchiveSessionWithId":`Archive execution session {id} together?`,"detail.move.confirmArchiveSessionCount":`Archive {n} execution sessions together?`,"detail.move.archiveWithSession":`With session`,"detail.move.archiveUnsupported":`Session archiving is unavailable on this host`,"detail.move.archiveResult":`Card archived; {n} execution sessions archived. Failed sessions, if any:`,"detail.move.archiveRetry":`Archive / retry execution sessions`,"detail.move.archiveCardOnly":`Card only`,"detail.move.confirm":`Confirm`,"detail.blocked.unmark":`✓ Unblock`,"detail.blocked.mark":`⛔ Mark blocked`,"detail.release.title":`Release {id}’s claim: the task returns to todo (the holding session may still be working — make sure it has stopped first)`,"detail.release.button":`🔓 Release claim`,"detail.comments.title":`Comments`,"detail.comments.empty":`No comments yet — the agent reports changes and verification here at handoff`,"detail.comments.user":`User`,"detail.composer.placeholder":`Leave a comment as the user (the agent reads it before starting)…`,"detail.composer.send":`Post`,"detail.exec.title":`Executions`,"detail.exec.prunedTitle":`{n} older execution records were pruned at the retention cap`,"detail.exec.pruned":`+{n} pruned`,"detail.exec.trigger.manual":`Manual`,"detail.exec.trigger.scheduled":`Scheduled`,"detail.exec.openTitle":`Click to open the execution session: {id}`,"detail.danger.delete":`🗑 Delete (mark for purge)`,"detail.danger.purgeConfirm":`Physical purge is irreversible`,"detail.danger.purgeGo":`Purge`,"detail.danger.purge":`🔥 Purge physically (confirm required)`,"form.title.create":`New task`,"form.title.edit":`Edit task`,"form.subtitle.create":`Push onto the board; sessions in the project can claim and run it`,"form.subtitle.edit":`Adjust the task content and execution configuration`,"form.field.title":`Title`,"form.field.titlePlaceholder":`One line: what should be done`,"form.field.project":`Project`,"form.field.model":`Model (default = session default model)`,"form.field.modelDefault":`Default model`,"form.model.option":`{name} ({provider})`,"form.field.effort":`Reasoning effort`,"form.field.effortTitle":`Set the model’s reasoning effort (e.g. low/medium/high); default = follow the model/provider default`,"form.effort.follow":`Follow model default`,"form.effort.low":`Low (low)`,"form.effort.medium":`Medium (medium)`,"form.effort.high":`High (high)`,"form.effort.none":`Off (none)`,"form.field.preset":`Execution preset`,"form.field.presetTitle":`The execution session is composed from this preset (tool set and persona); default = the deployment default preset`,"form.preset.follow":`Follow deployment default`,"form.preset.defaultTag":` (deployment default)`,"form.field.urgency":`Urgency`,"form.urgency.urgent":`Urgent`,"form.urgency.urgentHint":`Handle first`,"form.urgency.normal":`Normal`,"form.urgency.normalHint":`Normal scheduling`,"form.urgency.relaxed":`Relaxed`,"form.urgency.relaxedHint":`When there is time`,"form.field.description":`Description`,"form.field.descriptionOptional":`Description (optional)`,"form.desc.placeholder":`Requirement details, background, acceptance criteria…`,"form.field.prompt":`Execution prompt (the actual prompt = title + description + prompt)`,"form.field.promptOptional":`Execution prompt (optional; the actual prompt = title + description + prompt)`,"form.prompt.placeholder":`Extra instructions appended after "title + task description" and sent to the execution session. Template variables: {{lastExecution}} (last execution result), {{lastComments}} (latest 3 comments)`,"form.field.mode":`Execution mode`,"form.mode.claim":`🤝 Claim-based`,"form.mode.claimHint":`Sessions in the project claim it`,"form.mode.scheduled":`⏰ Scheduled`,"form.mode.scheduledHint":`Starts automatically on schedule`,"form.field.cron":`Cron expression`,"form.cron.placeholder":`min hour day month weekday`,"form.cron.daily":`Daily 09:00`,"form.cron.hourly":`Hourly`,"form.cron.every10min":`Every 10 minutes`,"form.cron.weekly":`Mondays 09:00`,"form.cron.next":`Next {time}`,"form.field.isolation":`Execution isolation`,"form.iso.locked":`The task has execution history; isolation is locked`,"form.iso.lockedShort":`Locked (cannot change once execution has started)`,"form.iso.nonGit":`This project is not a git repository`,"form.iso.worktree":`🌿 Worktree isolation`,"form.iso.worktreeTitle":`Each execution runs on its own worktree branch`,"form.iso.worktreeHint":`Isolated branch task/title+ID, no cross-contamination`,"form.iso.none":`📁 Run in the project directory`,"form.iso.noneTitle":`Run directly in the project directory (no git)`,"form.iso.noneHintNonGit":`Not a git repository; will run in the project directory`,"form.iso.noneHint":`No git; works directly in the project directory`,"form.iso.nonGitNote":`This project is not a git repository; the task will run in its directory (still created with the default configuration; the runtime degrades automatically)`,"form.iso.mirrorNote":`Multi-repo workspace: worktree isolation automatically mirrors all {n} repos — one task branch each, merged per repo at acceptance`,"form.field.checklist":`Acceptance checklist (DoD)`,"form.field.checklistOptional":`Acceptance checklist (DoD, optional)`,"form.check.itemPlaceholder":`Checklist item {n} (definition of done)`,"form.check.removeTitle":`Remove this checklist item`,"form.check.add":`+ Add checklist item`,"form.check.checkedTitle":`Checked state is preserved on save (currently checked by: {who})`,"form.check.notCheckedYet":`not checked yet`,"form.check.hintCreate":`{n} items; the execution session works through them and checks each off; unfinished items are highlighted at review`,"form.check.hintEdit":`{checked}/{total} checked (saving replaces the whole list; checked state is preserved)`,"form.hint.needTitle":`Enter a title`,"form.hint.needProject":`Select a project`,"form.hint.cronBad":`Invalid cron expression (min hour day month weekday)`,"form.hint.nextRun":`Next run {time}`,"form.hint.saveVersion":`On save: v{v} → v{next}`,"form.hint.createClaim":`After creation, sessions in the project can claim and run it`,"form.action.runBlockedTitle":`The task is running; cannot start another`,"form.action.runBusyTitle":`Submitting…`,"form.action.runTitle":`Save, then immediately start an execution (new session)`,"form.action.run":`⚡ Run now`,"form.action.save":`Save changes`,"form.action.create":`Create task`,"tpl.aria":`Manage templates`,"tpl.title":`Task templates`,"tpl.subtitle":`Templates from the New Task ▼ menu: rename / delete / use directly; "Save as template" in the task detail pane adds new ones`,"tpl.empty":`No templates yet — click "Save as template" in a task detail pane to capture a common configuration`,"tpl.name.aria":`Template name {name}`,"tpl.builtin":`Built-in`,"tpl.custom":`Custom`,"tpl.meta.checklist":` · {n} checklist items`,"tpl.rename.title":`Save rename`,"tpl.rename.button":`Rename`,"tpl.use.title":`Open the new-task form with this template`,"tpl.use.button":`Use`,"tpl.delete.title":`Delete this template`,"tpl.renamed":`Template renamed`,"tpl.foot.hint":`Templates are stored with the ledger in the DSH home directory and survive upgrades`,"imp.aria":`Import ledger`,"imp.title":`Import ledger`,"imp.subtitle":`Pick an exported JSON backup: preview first, then merge or replace everything`,"imp.parseError":`The file is not valid JSON`,"imp.note":`The ⬇ JSON export is a same-format backup and can be imported to restore; the file’s schemaVersion must match the current version.`,"imp.previewing":`Previewing…`,"imp.stat.create":`New`,"imp.stat.overwrite":`Overwrite (same id)`,"imp.stat.invalid":`Invalid (skipped)`,"imp.sec.create":`New tasks`,"imp.sec.overwrite":`Overwritten tasks (whole-card replacement, execution history and comments included)`,"imp.sec.invalid":`Invalid entries (not imported)`,"imp.noId":`(no id)`,"imp.mode.merge":`⊕ Merge`,"imp.mode.mergeHint":`Adds new + overwrites by id; everything else untouched`,"imp.mode.replace":`💣 Replace all`,"imp.mode.replaceHint":`Clears the current ledger and adopts the imported file (automatic backup first)`,"imp.result.replace":`Replace complete: imported {n} tasks ({total} former tasks backed up)`,"imp.result.merge":`Merge complete: {n} added, {m} overwritten`,"imp.foot.replaceConfirm":`⚠ Click again to confirm the full replacement (irreversible; a backup has been taken)`,"imp.foot.replaceNeedConfirm":`Full replacement requires a second confirmation`,"imp.foot.mergeHint":`Merge writes only the tasks listed in the preview`,"imp.action.run":`Import`,"imp.action.confirmReplace":`Confirm replace`,"set.aria":`Board settings`,"set.title":`Board settings`,"set.subtitle":`Global defaults for new tasks and session sync`,"set.iso.heading":`Default execution isolation`,"set.iso.noneHint":`No git; works directly in the project directory (factory default)`,"set.iso.worktreeHint":`Each execution runs on its own worktree branch (task/title+ID), isolated from the others; multi-repo workspaces are mirrored whole (one branch per repo)`,"set.iso.current":`Currently saved default: {current}. Affects only tasks created hereafter; existing tasks keep their creation-time choice, and non-git projects still degrade to the project directory at run time.`,"set.sync.heading":`Auto-sync workspace sessions`,"set.sync.off.name":`🚫 Sync off`,"set.sync.off.title":`Manage only tasks created and triggered in the task board`,"set.sync.off.hint":`Board tasks only (factory default)`,"set.sync.on.name":`🔄 Auto-include sessions`,"set.sync.on.title":`Sessions created directly in workspaces also appear on the board: In progress while running, In review automatically when done`,"set.sync.on.hint":`Tracks runs and enters review on completion`,"set.sync.stateOn":`On: sessions created and run directly in workspaces automatically become board cards and flow to the "In review" column when done.`,"set.sync.stateOff":`Off: only tasks created and triggered inside the board appear on the board.`,"set.foot.dirty":`Unsaved changes`,"set.foot.clean":`Matches the current board settings`,"set.action.save":`Save settings`,"form.field.permission":`Execution permission`,"form.perm.write":`Workspace write`,"form.perm.writeHint":`Read-write access to the workspace and temp directories (recommended default)`,"form.perm.readOnly":`Read-only`,"form.perm.readOnlyHint":`View and search only; no file changes or external commands`,"form.perm.fullAccess":`Full access`,"form.perm.fullAccessHint":`Unrestricted: whole-disk access and external commands`,"form.perm.defaultTag":` (default)`,"set.perm.heading":`Default execution permission`,"set.perm.writeName":`📁 Workspace write (factory default)`,"set.perm.writeHint":`Read-write access to the workspace and temp directories; writes need no extra confirmation`,"set.perm.readOnlyName":`🔒 Read-only`,"set.perm.readOnlyHint":`Read-only viewing and search only; no file changes or destructive commands`,"set.perm.fullName":`⚡ Full access`,"set.perm.fullHint":`Unrestricted: whole-disk access and external system commands`,"set.perm.current":`Currently saved default: {current}. The execution permission preset applied to new tasks.`,"card.badge.permReadOnly":`🔒 Read-only`,"card.badge.permReadOnlyTitle":`Permission: read-only`,"card.badge.permFull":`⚡ Full access`,"card.badge.permFullTitle":`Permission: full access`,"detail.chip.permReadOnly":`Read-only`,"detail.chip.permFull":`Full access`,"detail.chip.permWrite":`Workspace write`,"tpl.meta.permReadOnly":`read-only`,"tpl.meta.permFull":`full access`,"md.imageAlt":`Image {n}`,"md.imageTitle":`Click to view full size ({alt})`,"md.lightboxAlt":`Full-size preview`,"md.closePreview":`Close preview`,"slash.aria":`Quick commands and skills`,"slash.title":`Quick command and skill completion`,"slash.hint":`↑↓ navigate · Enter / Tab pick · Esc close`,"slash.badge.command":`⚡ command`,"slash.badge.skill":`🧩 skill`,"slash.tipA":`💡 Type`,"slash.tipB":`to autocomplete slash commands and agent skills`,"slash.cmd.goal.desc":`Autonomously drive long-horizon goals to completion`,"slash.cmd.goal.hint":`<goal description>`,"slash.cmd.schedule.desc":`Set one-off or recurring cron schedules`,"slash.cmd.schedule.hint":`<time or expression>`,"slash.cmd.plan.desc":`Draft a step-by-step plan and get user confirmation before acting`,"slash.cmd.browser.desc":`Launch a browser for page interaction and live search`,"slash.cmd.grill-me.desc":`Align requirements and design intent through one-question-at-a-time interviews`,"slash.cmd.teamwork-preview.desc":`Multi-agent collaboration and team workflow preview`,"slash.cmd.learn.desc":`Capture solutions and new rules into the knowledge base`,"slash.cmd.review.desc":`Multi-axis code review (correctness, architecture, security)`,"slash.cmd.security.desc":`Security hardening and vulnerability scanning`,"slash.cmd.permission.desc":`Switch the session permission level (read-only / workspace-write / full-access)`,"slash.cmd.permission.hint":`<preset>`,"slash.skill.frontend-ui-engineering":`Build production-grade, accessible frontend interfaces and components`,"slash.skill.api-and-interface-design":`Design stable, well-bounded REST / RPC interfaces`,"slash.skill.test-driven-development":`Test-driven development (TDD): unit and integration tests`,"slash.skill.debugging-and-error-recovery":`Systematically locate bug root causes and recover`,"slash.skill.performance-optimization":`Frontend/backend performance tuning and query optimization`,"slash.skill.ci-cd-and-automation":`Build automation, CI/CD pipelines and quality gates`,"slash.skill.code-review-and-quality":`Multi-axis code review and refactoring guidance`,"slash.skill.code-simplification":`Simplify complex logic for readability and maintainability`,"slash.skill.context-engineering":`Optimize context structure and prompt engineering`,"slash.skill.doubt-driven-development":`Adversarial, doubt-driven review of core logic`,"slash.skill.git-workflow-and-versioning":`Git workflow, branching, semantic versioning and changelogs`,"slash.skill.idea-refine":`Refine ideas and test hypotheses via divergent-convergent thinking`,"slash.skill.incremental-implementation":`Deliver multi-file changes in small, incremental steps`,"slash.skill.interview-me":`Deep interviews to surface true intent`,"slash.skill.memory-leak-debugging":`Diagnose JavaScript/Node.js memory leaks`,"slash.skill.observability-and-instrumentation":`Add logging, metrics and distributed tracing`,"slash.skill.planning-and-task-breakdown":`Break complex requirements into ordered, executable tasks`,"slash.skill.security-and-hardening":`Harden against vulnerabilities; input filtering and auth hardening`,"slash.skill.shipping-and-launch":`Pre-launch checklists and rollback strategies`,"slash.skill.source-driven-development":`Design from authoritative docs and source code`,"slash.skill.spec-driven-development":`Write clear technical specs before coding`,"slash.skill.using-agent-skills":`Discover and invoke agent skills dynamically`,"sys.execFailed":`[System] Execution failed: {error}; the task was returned to todo.`,"sys.endedWithComment":`[System] The execution session ended with comments but was not moved to in review; the system moved it to in review automatically.`,"sys.endedNoHandoff":`[System] The execution session ended without a protocol handoff (no comments, not moved to in review); the system moved it to in review automatically — review it, then send back or accept.`,"sys.sessionError":`[System] Session execution error: {error}; the task was returned to todo.`,"sys.sessionDone":`[System] The session finished; automatically moved to in review.`,"sys.cronDead":`[System] The cron expression {cron} has no trigger time within 4 years; scheduling disabled — fix the cron and re-enable.`,"sys.mergeSingle":`[System] Branch {branch} merged into the main worktree (--no-ff).`,"sys.mergeMulti":`[System] Branches merged per repo (--no-ff): {summary}`}};let w,T,E={active:M(),revision:0};const D=new Set;let O,k;function A(){k!==void 0&&(clearInterval(k),k=void 0);try{O?.disconnect()}catch{}O=void 0}function j(e){return e===`zh`||e===`en`}function M(){try{if(typeof document<`u`){let e=document.documentElement.lang;if(typeof e==`string`&&e.length>0){let t=e.toLowerCase();if(t.startsWith(`zh`))return`zh`;if(t.startsWith(`en`))return`en`}}}catch{}try{if(typeof navigator<`u`)return(navigator.language??`en`).toLowerCase().startsWith(`zh`)?`zh`:`en`}catch{}return`en`}function N(e){let t=e;if(!(t==null||typeof t.getSnapshot!=`function`||typeof t.subscribe!=`function`))return t}function P(e){A();try{typeof MutationObserver<`u`&&typeof document<`u`&&(O=new MutationObserver(()=>{if(w!==void 0)return;let e=M();e!==E.active&&F({active:e,revision:E.revision+1})}),O.observe(document.documentElement,{attributes:!0,attributeFilter:[`lang`]}))}catch{}if(e===void 0)return;let t=0;k=setInterval(()=>{t+=1;let n;try{n=N(e())}catch{n=void 0}if(n!==void 0){ee(n);return}t>=8&&A()},250)}function F(e){if(!(e.active===E.active&&e.revision===E.revision)){E=e;for(let e of D)e()}}function ee(e,t){let n=N(e);if(n===void 0){F({active:M(),revision:0}),P(t);return}A(),w=n;let r=()=>{try{let e=n.getSnapshot();F({active:j(e.active)?e.active:M(),revision:e.revision})}catch{}};r(),T=n.subscribe(r)}function te(){A();try{T?.()}catch{}T=void 0,w=void 0,F({active:M(),revision:0})}const I={getSnapshot(){return E},subscribe(e){return D.add(e),()=>{D.delete(e)}}},ne=/\{(\w+)\}/g,L=(e,t)=>{let n=C[E.active][e]??C.en[e]??e;return t===void 0?n:n.replace(ne,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})};function R(){return(0,e.useSyncExternalStore)(I.subscribe,I.getSnapshot),L}const z=`dsh-taskboard-view-v1`;function re(){try{let e=localStorage.getItem(z);if(e===null)return{urgencies:[],sortBy:`default`};let t=JSON.parse(e),n=t.sortBy===`updated`||t.sortBy===`urgency`||t.sortBy===`created`||t.sortBy===`title`?t.sortBy:`default`;return{workspaceId:typeof t.workspaceId==`string`?t.workspaceId:void 0,urgencies:Array.isArray(t.urgencies)?t.urgencies.filter(e=>e===`urgent`||e===`normal`||e===`relaxed`):[],sortBy:n}}catch{return{urgencies:[],sortBy:`default`}}}function ie(){let e=re();return{boardOpen:!1,ledger:b(),workspaces:[],filters:{workspaceId:e.workspaceId,urgencies:e.urgencies},search:``,sortBy:e.sortBy,composerOpen:!1,secondaryOpen:!1,diagOpen:!1,templates:[],tplManagerOpen:!1,importOpen:!1,settingsOpen:!1}}var ae=class{client;state=ie();subscribers=new Set;disposed=!1;disposeStream;refreshInFlight;seenRevision;sessionJumper;catalogFaces={};constructor(e){this.client=e}getSnapshot(){return this.state}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}emit(){if(!this.disposed)for(let e of this.subscribers)e()}setState(e){this.state={...this.state,...e},this.emit()}start(){this.refresh(),this.disposeStream=this.client.stream(e=>{this.seenRevision=e.revision,this.refresh()},()=>{this.refresh()})}async refresh(){return this.refreshInFlight===void 0&&(this.refreshInFlight=(async()=>{try{for(let e=0;e<3;e++){let[e,t]=await Promise.all([this.client.state(),this.client.workspaces()]),n;if(this.state.selectedId!==void 0&&(n=e.tasks.find(e=>e.id===this.state.selectedId)),this.setState({archiveSessionsSupported:e.capabilities?.archiveSessions===!0,ledger:e,workspaces:t,error:void 0,selectedId:n===void 0?void 0:this.state.selectedId}),this.seenRevision===void 0||e.revision>=this.seenRevision)break}}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}finally{this.refreshInFlight=void 0}})()),this.refreshInFlight}dispose(){this.disposed=!0,this.disposeStream?.(),this.subscribers.clear()}openBoard(){this.setState({boardOpen:!0})}closeBoard(){this.setState({boardOpen:!1})}toggleBoard(){this.setState({boardOpen:!this.state.boardOpen})}setWorkspaceFilter(e){this.setState({filters:{...this.state.filters,workspaceId:e}}),this.persistView()}toggleUrgency(e){let t=new Set(this.state.filters.urgencies);t.has(e)?t.delete(e):t.add(e),this.setState({filters:{...this.state.filters,urgencies:[...t]}}),this.persistView()}setSearch(e){this.setState({search:e})}setSortBy(e){this.setState({sortBy:e}),this.persistView()}persistView(){try{localStorage.setItem(z,JSON.stringify({workspaceId:this.state.filters.workspaceId,urgencies:this.state.filters.urgencies,sortBy:this.state.sortBy}))}catch{}}select(e){this.setState({selectedId:e})}setComposer(e){this.setState({composerOpen:e,editingId:void 0,templatePrefill:void 0})}newFromTemplate(e){this.setState({composerOpen:!0,editingId:void 0,templatePrefill:e})}openEditor(e){this.setState({composerOpen:!0,editingId:e,templatePrefill:void 0})}closeForm(){this.setState({composerOpen:!1,editingId:void 0,templatePrefill:void 0})}toggleSecondary(){this.setState({secondaryOpen:!this.state.secondaryOpen})}gitAvailable(e){return e===void 0||this.state.workspaces.find(t=>t.id===e)?.gitAvailable===!0}repoCount(e){return e===void 0?1:this.state.workspaces.find(t=>t.id===e)?.repoCount??1}installSessionJumper(e){this.sessionJumper=e}installModelCatalog(e){this.catalogFaces.models=e}installPresetRoster(e){this.catalogFaces.presets=e}get modelCatalog(){return this.catalogFaces.models}get presetCatalog(){return this.catalogFaces.presets}async fetchModelCatalog(){if(this.catalogFaces.models!==void 0)try{let e=await this.catalogFaces.models();if(e!==void 0&&e.length>0)return e}catch{}try{return(await this.client.modelCatalog()).models??[]}catch{return[]}}async fetchPresetCatalog(){if(this.catalogFaces.presets!==void 0)try{let e=await this.catalogFaces.presets();if(e!==void 0&&e.presets!==void 0&&e.presets.length>0)return e}catch{}try{let e=await this.client.modelCatalog();return{presets:e.presets??[],...e.defaultPresetId===void 0?{}:{defaultId:e.defaultPresetId}}}catch{return{presets:[]}}}async openSession(e){if(this.sessionJumper===void 0)return`unavailable`;let t;try{t=await this.sessionJumper(e)}catch{return`unavailable`}return t===`opened`&&this.closeBoard(),t}async create(e){try{let t=await this.client.create(e);return this.setState({composerOpen:!1,error:void 0}),await this.refresh(),t.id}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async update(e,t,n){try{return await this.client.update(e,{ifVersion:t,...n}),this.setState({composerOpen:!1,editingId:void 0,error:void 0}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async retryArchiveSessions(e){try{if(this.client.archiveSessions===void 0)return;let t=await this.client.archiveSessions(e);this.setState({sessionArchive:{taskId:e,result:t}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async move(e,t,n,r){try{let i=await this.client.move(e,{ifVersion:t,status:n,...r?.archiveSessions===void 0?{}:{archiveSessions:r.archiveSessions}});i.sessionArchive!==void 0&&this.setState({sessionArchive:{taskId:e,result:i.sessionArchive}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async reject(e,t,n){let r=n!==void 0&&n.trim().length>0?n.trim():void 0;try{return await this.client.reject(e,r===void 0?{ifVersion:t}:{ifVersion:t,body:r}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async toggleBlocked(e){try{await this.client.update(e.id,{ifVersion:e.version,blocked:!e.blocked}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async toggleChecklistItem(e,t){let n=(e.checklist??[]).map(e=>e.id===t?e.checked?{id:e.id,text:e.text,checked:!1}:{id:e.id,text:e.text,checked:!0,checkedBy:`user`,checkedAt:Date.now(),...e.note===void 0?{}:{note:e.note}}:e);try{await this.client.update(e.id,{ifVersion:e.version,checklist:n}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async fetchDiff(e,t){try{return await this.client.diff(e,t)}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async comment(e,t){try{return await this.client.comment(e,t),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async run(e,t=!1){try{await this.client.run(e,t?{reuse:!0}:{}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async cancel(e){try{await this.client.cancel(e),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async mergeBranch(e){try{let t=await this.client.mergeBranch(e);return await this.refresh(),t.noop===!0?{ok:!0,noop:!0}:t.results===void 0?{ok:!0}:{ok:!0,results:t.results}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async removeWorktree(e,t){try{let n=await this.client.worktreeRemove(e,{deleteBranch:t});return await this.refresh(),n.branchError===void 0?{ok:!0}:{ok:!0,branchError:n.branchError}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}openDiagnostics(){this.setState({diagOpen:!0}),this.client.diagnostics().then(e=>this.setState({diagnostics:e})).catch(e=>this.setState({error:e instanceof Error?e.message:String(e)}))}closeDiagnostics(){this.setState({diagOpen:!1})}openSettings(){this.setState({settingsOpen:!0})}closeSettings(){this.setState({settingsOpen:!1})}async updateSettings(e){try{return await this.client.updateSettings(e),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async cleanupOrphan(e,t){try{await this.client.worktreeCleanup(e,t);let n=await this.client.diagnostics();this.setState({diagnostics:n,error:void 0})}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async remove(e,t,n){try{await this.client.remove(e,n?{purge:!0}:{ifVersion:t}),n&&this.setState({selectedId:void 0}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async duplicate(e){try{await this.client.create({title:e.title.slice(0,196)+L(`shared.duplicate.suffix`),workspaceId:e.workspaceId,urgency:e.urgency,description:e.description.length>0?e.description:void 0,prompt:e.prompt.length>0?e.prompt:void 0,execution:e.execution.mode===`scheduled`&&e.execution.cron!==void 0?{mode:`scheduled`,cron:e.execution.cron}:{mode:`claim`},model:e.model,isolation:e.isolation,...e.presetId===void 0?{}:{presetId:e.presetId},...e.permission===void 0?{}:{permission:e.permission},...e.checklist!==void 0&&e.checklist.length>0?{checklist:e.checklist.map(e=>e.text)}:{}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async loadTemplates(){try{let e=await this.client.templates();return this.setState({templates:e.templates,error:void 0}),e.templates}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),[]}}prepareTemplateMenu(){this.state.templates.length===0&&this.loadTemplates()}openTemplateManager(){this.setState({tplManagerOpen:!0}),this.loadTemplates()}closeTemplateManager(){this.setState({tplManagerOpen:!1})}async upsertTemplate(e){try{return await this.client.templateUpsert(e),await this.loadTemplates(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async deleteTemplate(e){try{await this.client.templateDelete(e),await this.loadTemplates()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async saveAsTemplate(e){return this.upsertTemplate({name:e.title.slice(0,60),task:{title:e.title,description:e.description.length>0?e.description:void 0,prompt:e.prompt.length>0?e.prompt:void 0,urgency:e.urgency,execution:e.execution.mode===`scheduled`&&e.execution.cron!==void 0?{mode:`scheduled`,cron:e.execution.cron}:{mode:`claim`},model:e.model,isolation:e.isolation,...e.presetId===void 0?{}:{presetId:e.presetId},...e.permission===void 0?{}:{permission:e.permission},...e.checklist!==void 0&&e.checklist.length>0?{checklist:e.checklist.map(e=>e.text)}:{}}})}async fetchPromptCompletions(){try{return await this.client.promptCompletions()}catch{return}}openImport(){this.setState({importOpen:!0})}closeImport(){this.setState({importOpen:!1})}async importPreview(e){try{return(await this.client.importPreview(e)).plan}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async importCommit(e,t){try{let n=await this.client.importCommit(e,t);return await this.refresh(),n}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}exportJson(){let e=new Date,t=e=>String(e).padStart(2,`0`),n=`dsh-taskboard-${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}.json`,r=JSON.stringify(this.state.ledger,null,2);this.download(n,r,`application/json`)}exportCsv(){let e=e=>{let t=String(e??``);return/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\n\r]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},t=[`id`,`title`,`status`,`urgency`,`blocked`,`project`,`claimedBy`,`mode`,`cron`,`nextRunAt`,`model`,`createdAt`,`updatedAt`,`comments`,`executions`],n=this.state.ledger.tasks.map(t=>[t.id,t.title,t.status,t.urgency,t.blocked?`yes`:`no`,t.workspaceId,t.claimedBy??``,t.execution.mode,t.execution.cron??``,t.execution.nextRunAt===void 0?``:new Date(t.execution.nextRunAt).toISOString(),t.model===void 0?``:`${t.model.provider}/${t.model.model}`,new Date(t.createdAt).toISOString(),new Date(t.updatedAt).toISOString(),t.comments.length,t.executions.length].map(e).join(`,`)),r=new Date,i=e=>String(e).padStart(2,`0`),a=`dsh-taskboard-${r.getFullYear()}${i(r.getMonth()+1)}${i(r.getDate())}.csv`;this.download(a,`\uFEFF${[t.join(`,`),...n].join(`\r
|
|
10
|
-
|
|
7
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react"),t=require("react-dom/client"),n=require("react/jsx-runtime"),r=require("react-dom");async function i(e){let t=await e,n=await t.json().catch(()=>null);if(n===null)throw Error(`taskboard: HTTP ${t.status}`);if(!n.ok)throw Error(`taskboard: ${n.error.code}: ${n.error.message}`);return n.value}const a=1e4;async function o(e){return i(fetch(e,{signal:AbortSignal.timeout(a)}))}async function s(e,t){return i(await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t),signal:AbortSignal.timeout(a)}))}async function c(e){return i(await fetch(`/dsh-taskboard/assets`,{method:`POST`,headers:{"content-type":e.type,"x-dsh-taskboard-upload":`1`},body:e,signal:AbortSignal.timeout(3e4)}))}function l(){return{state:()=>o(`/dsh-taskboard/state`),workspaces:()=>o(`/dsh-taskboard/workspaces`),create:e=>s(`/dsh-taskboard/tasks`,e),get:e=>o(`/dsh-taskboard/tasks/${encodeURIComponent(e)}`),update:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/update`,t),move:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/move`,t),archiveSessions:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/archive-sessions`,{}),reject:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/reject`,t),comment:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/comment`,{body:t}),uploadImage:c,remove:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/delete`,t),run:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/run`,t??{}),cancel:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/cancel`,{}),mergeBranch:e=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/merge`,{}),worktreeRemove:(e,t)=>s(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/worktree-remove`,t),diagnostics:()=>o(`/dsh-taskboard/diagnostics`),worktreeCleanup:(e,t)=>s(`/dsh-taskboard/worktree-cleanup`,{workspaceId:e,taskId:t}),diff:(e,t)=>{let n=new URLSearchParams({execution:t.execution});return t.commit!==void 0&&n.set(`commit`,t.commit),t.path!==void 0&&n.set(`path`,t.path),t.repo!==void 0&&n.set(`repo`,t.repo),o(`/dsh-taskboard/tasks/${encodeURIComponent(e)}/diff?${n.toString()}`)},importPreview:e=>s(`/dsh-taskboard/import/preview`,e),importCommit:(e,t)=>s(`/dsh-taskboard/import`,{mode:e,ledger:t}),templates:()=>o(`/dsh-taskboard/templates`),templateUpsert:e=>s(`/dsh-taskboard/templates`,e),templateDelete:e=>s(`/dsh-taskboard/templates/delete`,{id:e}),settings:()=>o(`/dsh-taskboard/settings`),updateSettings:e=>s(`/dsh-taskboard/settings/update`,e),storage:()=>o(`/dsh-taskboard/storage`),checkStorage:e=>s(`/dsh-taskboard/storage/check`,{directory:e}),migrateStorage:e=>i(fetch(`/dsh-taskboard/storage/migrate`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({directory:e}),signal:AbortSignal.timeout(12e4)})),promptCompletions:()=>o(`/dsh-taskboard/prompt-completions`),modelCatalog:()=>o(`/dsh-taskboard/model-catalog`),stream(e,t){let n=new EventSource(`/dsh-taskboard/events`),r;return n.addEventListener(`hello`,e=>{let n;try{n=JSON.parse(e.data)}catch{return}r!==void 0&&n.revision!==r&&t(),r=n.revision}),n.addEventListener(`change`,n=>{let i;try{i=JSON.parse(n.data)}catch{return}r!==void 0&&i.revision!==r+1&&t(),r=i.revision,e(i)}),n.onerror=()=>{},()=>{n.close()}}}}const u=[`backlog`,`todo`,`in_progress`,`in_review`,`done`],d=[`canceled`,`archived`];[...u,...d];const f={backlog:[`todo`,`canceled`],todo:[`in_progress`,`backlog`,`canceled`],in_progress:[`in_review`,`todo`,`canceled`],in_review:[`in_progress`,`todo`,`done`,`canceled`],done:[`archived`],canceled:[`archived`,`todo`],archived:[]};function p(e,t){return f[e].includes(t)}function m(e){if(typeof e!=`string`)return`workspace-write`;let t=e.trim();if(t===`workspace-write`||t===`workspaceWrite`)return`workspace-write`;if(t===`read-only`||t===`readOnly`)return`read-only`;if(t===`danger-full-access`||t===`fullAccess`)return`danger-full-access`;throw Error(`permission must be 'workspace-write', 'read-only', or 'danger-full-access'`)}function h(e){return e?.defaultIsolation??`none`}function g(e){return e?.syncExternalSessions??!1}function _(e){return e?.defaultPermission??`workspace-write`}function v(e){let t=e.trim().split(/\s+/);if(t.length!==5)return null;let n=[[0,59],[0,23],[1,31],[1,12],[0,7]],r=[];for(let e=0;e<5;e++){let[i,a]=n[e],o=new Set;if(!y(t[e],i,a,o))return null;r.push(o)}let i=new Set;for(let e of r[4])i.add(e===7?0:e);return{minutes:r[0],hours:r[1],days:r[2],months:r[3],weekdays:i}}function y(e,t,n,r){for(let i of e.split(`,`)){let[e,a]=i.split(`/`),o=a===void 0?1:Number.parseInt(a,10);if(!Number.isInteger(o)||o<1)return!1;let s,c;if(e===void 0||e===``)return!1;if(e===`*`)s=t,c=n;else if(e.includes(`-`)){let[t,n]=e.split(`-`);if(s=Number.parseInt(t??``,10),c=Number.parseInt(n??``,10),!Number.isInteger(s)||!Number.isInteger(c))return!1}else{if(s=Number.parseInt(e,10),!Number.isInteger(s))return!1;c=a===void 0?s:n}if(s<t||c>n||s>c)return!1;for(let e=s;e<=c;e+=o)r.add(e)}return r.size>0}function b(e,t){let n=new Date(t);n.setSeconds(0,0),n.setMinutes(n.getMinutes()+1);let r=t+4*366*24*60*60*1e3,i=n.getTime();for(;i<=r;){let t=new Date(i);if(e.months.has(t.getMonth()+1)&&e.days.has(t.getDate())&&e.weekdays.has(t.getDay())&&e.hours.has(t.getHours())&&e.minutes.has(t.getMinutes()))return i;i+=6e4}return null}function x(){return{schemaVersion:1,revision:0,tasks:[]}}function S(e){let t=new Set,n=[],r=e=>{if(typeof e==`string`){let r=e.trim();r.length>0&&!t.has(r)&&(t.add(r),n.push(r))}};if(Array.isArray(e.executions))for(let t of e.executions)typeof t==`object`&&t&&r(t.sessionId);return n}function C(e){let t=e.checklist??[];return{done:t.filter(e=>e.checked).length,total:t.length}}const w={zh:{"shared.close":`关闭`,"shared.cancel":`取消`,"shared.loading":`读取中…`,"shared.blocked":`受阻`,"shared.permission":`权限`,"shared.confirmDelete":`确认删除`,"shared.current":`(当前:{name})`,"shared.entry.aria":`Agent 任务看板`,"shared.entry.label":`任务看板`,"shared.stats.title":`待办 {todo} | 进行中 {doing} | 待验收 {review}(待办|进行中|待验收)`,"shared.duplicate.suffix":`(副本)`,"status.column.backlog":`待规划`,"status.column.todo":`待办`,"status.column.in_progress":`进行中`,"status.column.in_review":`待验收`,"status.column.done":`已完成`,"status.column.canceled":`已取消`,"status.column.archived":`已归档`,"status.pill.backlog":`待规划`,"status.pill.todo":`待办`,"status.pill.in_progress":`进行中`,"status.pill.in_review":`待验收`,"status.pill.done":`完成`,"status.pill.canceled":`取消`,"status.pill.archived":`归档`,"status.move.backlog":`待规划`,"status.move.todo":`待办`,"status.move.in_progress":`进行中`,"status.move.in_review":`待验收`,"status.move.done":`完成`,"status.move.canceled":`取消`,"status.move.archived":`归档`,"urgency.urgent":`紧急`,"urgency.normal":`一般`,"urgency.relaxed":`不急`,"outcome.running":`执行中`,"outcome.succeeded":`成功`,"outcome.failed":`失败`,"outcome.cancelled":`已取消`,"board.title":`Agent 任务看板`,"board.count.tasks":`{n} 任务 · rev {rev}`,"board.action.newTask":`+ 新建任务 ▼`,"board.action.blankTask":`空白任务`,"board.action.manageTemplates":`⌗ 管理模板…`,"board.search.placeholder":`搜索标题 / ID…`,"board.filter.allProjects":`全部项目`,"board.sort.title":`列内排序`,"board.sort.default":`默认排序`,"board.sort.updated":`最近更新`,"board.sort.urgency":`按紧急度`,"board.sort.created":`创建时间`,"board.sort.byTitle":`按标题`,"board.action.backToBoard":`返回看板`,"board.action.otherTasks":`其它任务`,"board.action.settingsTitle":`看板设置:新建任务的默认执行隔离等`,"board.action.settings":`🛠 设置`,"board.action.diagTitle":`健康诊断:遗留 worktree、台账基本项`,"board.action.diag":`⚙ 诊断`,"board.action.importTitle":`从 JSON 备份文件导入台账(预览后合并或整册替换)`,"board.action.import":`⬆ 导入`,"board.action.exportTitle":`导出台账:完整 JSON 备份或任务清单 CSV`,"board.action.export":`⬇ 导出 ▼`,"board.export.jsonTitle":`完整台账备份(含执行历史与看板设置),可用于导入恢复`,"board.export.json":`完整台账(JSON)`,"board.export.csvTitle":`任务清单表格(Excel 可直接打开,中文已加 BOM)`,"board.export.csv":`任务清单(CSV)`,"board.drag.forbidden":`无法从「{from}」拖至「{to}」`,"board.empty":`无任务`,"board.secondary.empty":`无已取消 / 已归档 / 已删除任务`,"board.group.trashed":`已删除`,"diag.title":`健康诊断`,"diag.subtitle":`台账基本项与 worktree 遗留清理`,"diag.revision":`台账修订号`,"diag.tasks":`任务总数`,"diag.running":`执行中`,"diag.orphans":`遗留 worktree`,"diag.orphans.heading":`遗留 worktree(台账无主但目录存在)`,"diag.orphans.none":`无遗留 — 各项目 .dsh-worktrees 目录干净`,"diag.orphans.cleanup":`清理`,"diag.orphans.hint":`提示:有未提交修改的遗留目录会被拒绝清理,请先手动处理其内容。live 任务的 worktree 请在任务详情页删除。`,"diag.gitignore.heading":`gitignore 建议`,"diag.gitignore.none":`无待办 — 各 git 项目已忽略 .dsh-worktrees 目录`,"diag.gitignore.suggestA":`建议在 .gitignore 加入一行`,"diag.gitignore.suggestB":`(不会自动修改)`,"card.drag.running":`该任务正由会话执行中({title}),不能拖动`,"card.badge.stale":`⏱ 认领超时`,"card.badge.modelTitle":`固定模型: {model}`,"card.badge.modelEffort":` · 思考强度: {effort}`,"card.badge.checklistReview":`待验收:清单未全部勾选`,"card.badge.checklist":`验收清单进度`,"card.badge.pendingPurge":`待清除`,"card.session.jumpTitle":`点击一键跳转到会话:{id}`,"card.session.missing":`该会话已被删除({id}),无法打开`,"card.session.archived":`该会话已归档({id}),已从会话列表隐藏`,"card.session.unavailable":`会话导航不可用,会话 ID:{id}`,"card.reject.placeholder":`退回原因(可选,agent 开工前会读)…`,"card.reject.confirm":`退回待办`,"card.action.doneTitle":`验收完成:移至已完成`,"card.action.done":`✓ 完成`,"card.action.rejectTitle":`退回待办,可附退回原因`,"card.action.reject":`✗ 退回`,"alert.ok":`知道了`,"diff.commit":`提交 {hash}`,"diff.file":`文件 {path}`,"diff.truncated":`⚠ 内容过长已截断`,"diff.failed":`获取失败(原因见看板顶部错误条;对象可能已随 worktree 删除丢失)`,"checklist.title":`验收清单(DoD)`,"checklist.unchecked":` · {n} 项未完成`,"checklist.allDone":` · 全部完成`,"checklist.byUser":`👤 用户`,"checklist.uncheckedItem":`未完成`,"checklist.evidence":`证据:{note}`,"report.title":`执行报告`,"report.submitted":`由执行会话提交 · {time}`,"report.changedFiles":`改动文件`,"report.checks":`自验情况`,"report.artifacts":`产物`,"report.risk":`剩余风险`,"iso.title":`执行隔离`,"iso.none":`📁 原目录执行`,"iso.worktreeTitle":`执行隔离 · Worktree`,"iso.branch":`🌿 分支`,"iso.baseline":`基线 {base} → {head}`,"iso.changed":`改动 {n} 个文件`,"iso.commit.openTitle":`点击展开该提交的 diff`,"iso.commits.more":`… 共 {n} 个提交`,"iso.nocommit":`该次执行没有产生提交(改动可能未提交,见下方警告)`,"iso.dirty.toggle":`⚠ 有 {n} 处未提交修改(合并前请让 agent 提交,或手动处理)`,"iso.dirty.expand":` ▼ 查看文件`,"iso.dirty.collapse":` ▲`,"iso.dirty.openTitle":`点击查看该文件的未提交 diff`,"iso.dirty.more":`… 共 {n} 处(完整列表见任务台账)`,"iso.hint.running":`执行中 — 结束后可合并或清理`,"iso.merge.confirm":`将分支以 --no-ff 合并到主工作区?`,"iso.merge.go":`确认合并`,"iso.merge.title":`在主工作区 git merge --no-ff 该任务分支(要求主区干净;冲突会原样报告)`,"iso.merge.button":`⇥ 合并到主工作区`,"iso.merge.failed":`合并失败:{error}`,"iso.merge.noop":`该分支没有领先主工作区的新提交,无需合并(可退回续跑或直接清理)`,"iso.merge.done":`已按仓库合并(--no-ff):{summary}`,"iso.merge.partial":`部分仓库合并失败:{summary}
|
|
8
|
+
{error}`,"iso.repo.root":`根仓库`,"iso.remove.wt":`🗑 删除 worktree`,"iso.remove.wtTitle":`git worktree remove(有未提交修改时拒绝)`,"iso.remove.wtb":`🗑 删 worktree + 分支`,"iso.remove.wtbTitle":`删除 worktree 并删除任务分支(有未提交修改时拒绝)`,"iso.remove.confirmWt":`删除 worktree 目录?`,"iso.remove.confirmWtb":`删除 worktree 并删除分支?`,"iso.remove.failed":`删除失败:{error}`,"iso.remove.branchFailed":`worktree 已删除,但分支删除失败:{error}`,"iso.hint.keep":`分支与 worktree 保留中 — 可退回继续修改`,"detail.session.jumpTitle":`一键跳转到对应会话:{id}`,"detail.session.jump":`🤖 跳转会话 ↗`,"detail.action.edit":`✎ 编辑`,"detail.action.duplicateTitle":`复制此任务的全部配置为一张新卡(待办列)`,"detail.action.duplicate":`⧉ 复制`,"detail.action.saveTplTitle":`把此任务的配置(含清单)保存为模板,新建任务时可用`,"detail.action.saveTplDone":`已存为模板(新建任务 ▼ 下拉可用,可在模板管理中改名)`,"detail.action.saveTpl":`⌗ 存为模板`,"detail.action.reuseTitle":`续跑:保留现有 worktree 与分支(上次的改动和提交都在原处),在其上继续执行;默认「立即执行」会重置为全新基线`,"detail.action.reuse":`↻ 续跑`,"detail.action.runTitleModel":`新会话执行({model})`,"detail.action.runTitleDefault":`新会话执行(默认模型)`,"detail.action.run":`▶ 立即执行`,"detail.action.stopConfirm":`停止该执行会话?`,"detail.action.stop":`停止`,"detail.action.stopTitle":`停止执行会话 {id}(任务回到待办)`,"detail.action.stopExec":`■ 停止执行`,"detail.chip.nextRun":`{cron} · 下次 {time}`,"detail.chip.checklist":`清单 {done}/{total}`,"detail.chip.isolated":`Worktree 隔离`,"detail.chip.holderTitle":`点击跳转至该会话:{id}`,"detail.chip.holderStale":`认领超时 · `,"detail.chip.holderBy":`由 `,"detail.chip.holderSuffix":` 持有 ↗`,"detail.chip.trashed":`已删除待清除`,"detail.sub.line":`更新 {time} · 最近操作 {who}`,"detail.updatedBy.system":`⚙️ 系统`,"detail.updatedBy.user":`👤 用户`,"detail.field.description":`描述`,"detail.field.prompt":`执行 Prompt`,"detail.move.to":`移至→{status}`,"detail.move.confirmDoneUnchecked":`仍有 {n} 项清单未勾选,确认完成?`,"detail.move.confirmDone":`确认完成?`,"detail.move.confirmArchive":`确认归档该任务?`,"detail.move.confirmArchiveSessionWithId":`是否连同执行会话 {id} 一同归档?`,"detail.move.confirmArchiveSessionCount":`是否连同 {n} 个执行会话一同归档?`,"detail.move.archiveWithSession":`连同会话归档`,"detail.move.archiveUnsupported":`当前宿主不支持会话归档`,"detail.move.archiveResult":`卡片已归档;执行会话归档成功 {n} 个。失败会话如下(如有):`,"detail.move.archiveRetry":`归档 / 重试归档执行会话`,"detail.move.archiveCardOnly":`仅归档卡片`,"detail.move.confirm":`确认`,"detail.blocked.unmark":`✓ 解除受阻`,"detail.blocked.mark":`⛔ 标记受阻`,"detail.release.title":`释放 {id} 的认领:任务回到待办(持有会话可能仍在工作,确认它已停止后再释放)`,"detail.release.button":`🔓 释放认领`,"detail.comments.title":`评论`,"detail.comments.empty":`暂无评论 — agent 交接时会在这里汇报改动与验证结果`,"detail.comments.user":`用户`,"detail.composer.placeholder":`以用户身份留言(agent 开工前会读)…`,"detail.composer.send":`发表`,"detail.exec.title":`执行记录`,"detail.exec.prunedTitle":`更早的 {n} 条执行记录已按保留上限清理`,"detail.exec.pruned":`+{n} 已清理`,"detail.exec.trigger.manual":`手动`,"detail.exec.trigger.scheduled":`定时`,"detail.exec.openTitle":`点击打开该执行会话:{id}`,"detail.danger.delete":`🗑 删除(标记待清除)`,"detail.danger.purgeConfirm":`物理清除不可恢复`,"detail.danger.purgeGo":`确认清除`,"detail.danger.purge":`🔥 物理清除(需确认)`,"form.title.create":`新建任务`,"form.title.edit":`编辑任务`,"form.subtitle.create":`推入看板,项目内会话可认领执行`,"form.subtitle.edit":`调整任务内容与执行配置`,"form.field.title":`标题`,"form.field.titlePlaceholder":`一句话说清要做什么`,"form.field.project":`项目`,"form.field.model":`模型(默认 = 会话默认模型)`,"form.field.modelDefault":`默认模型`,"form.model.option":`{name}({provider})`,"form.field.effort":`思考强度(Reasoning Effort)`,"form.field.effortTitle":`设置模型的思考强度(如 low/medium/high);默认 = 跟随模型/提供商默认`,"form.effort.follow":`跟随模型默认`,"form.effort.low":`低 (low)`,"form.effort.medium":`中 (medium)`,"form.effort.high":`高 (high)`,"form.effort.none":`关闭思考 (none)`,"form.field.preset":`执行模式(preset)`,"form.field.presetTitle":`执行会话按该 preset 组合(决定工具集与人设);默认 = 部署默认 preset`,"form.preset.follow":`跟随部署默认`,"form.preset.defaultTag":`(部署默认)`,"form.field.urgency":`紧急度`,"form.urgency.urgent":`紧急`,"form.urgency.urgentHint":`优先处理`,"form.urgency.normal":`一般`,"form.urgency.normalHint":`正常排期`,"form.urgency.relaxed":`不急`,"form.urgency.relaxedHint":`有空再做`,"form.field.description":`描述`,"form.field.descriptionOptional":`描述(可选)`,"form.desc.placeholder":`需求细节、背景说明、验收标准…`,"form.field.prompt":`执行 Prompt(实际 Prompt = 标题+任务描述+Prompt)`,"form.field.promptOptional":`执行 Prompt(可选;实际 Prompt = 标题+任务描述+Prompt)`,"form.prompt.placeholder":`追加在「标题+任务描述」之后发给执行会话的补充指令。支持模板变量:{{lastExecution}}(上次执行结果)、{{lastComments}}(最近 3 条评论)`,"form.field.mode":`执行方式`,"form.mode.claim":`🤝 认领制`,"form.mode.claimHint":`项目内会话认领`,"form.mode.scheduled":`⏰ 定时执行`,"form.mode.scheduledHint":`到点自动开跑`,"form.field.cron":`Cron 表达式`,"form.cron.placeholder":`分 时 日 月 周`,"form.cron.daily":`每天 09:00`,"form.cron.hourly":`每小时`,"form.cron.every10min":`每 10 分钟`,"form.cron.weekly":`每周一 09:00`,"form.cron.next":`下次 {time}`,"form.field.isolation":`执行隔离`,"form.iso.locked":`任务已有执行记录,隔离方式已锁定`,"form.iso.lockedShort":`已锁定(执行开始后不可更改)`,"form.iso.nonGit":`当前项目非 git 仓库`,"form.iso.worktree":`🌿 Worktree 隔离`,"form.iso.worktreeTitle":`每次执行在独立 worktree 分支上进行`,"form.iso.worktreeHint":`独立分支 task/标题+ID,互不污染`,"form.iso.none":`📁 原目录执行`,"form.iso.noneTitle":`直接在项目目录执行(不使用 git)`,"form.iso.noneHintNonGit":`当前项目非 git 仓库,将在原目录执行`,"form.iso.noneHint":`不使用 git,直接在项目目录工作`,"form.iso.nonGitNote":`当前项目非 git 仓库,将在原目录执行(任务仍按默认配置创建,运行时自动降级)`,"form.iso.mirrorNote":`多仓库工作区:Worktree 隔离将自动整区镜像 {n} 个仓库——每仓库独立任务分支,验收按仓库合并`,"form.field.checklist":`验收清单(DoD)`,"form.field.checklistOptional":`验收清单(DoD,可选)`,"form.check.itemPlaceholder":`验收项 {n}(完成标准)`,"form.check.removeTitle":`删除该验收项`,"form.check.add":`+ 添加验收项`,"form.check.checkedTitle":`勾选状态随保存保留(当前勾选人:{who})`,"form.check.notCheckedYet":`未勾选`,"form.check.hintCreate":`共 {n} 项,执行会话按清单干活并逐项勾选,未完成项验收时高亮`,"form.check.hintEdit":`已勾选 {checked}/{total}(保存将整体覆盖清单,勾选状态保留)`,"form.hint.needTitle":`请填写标题`,"form.hint.needProject":`请选择项目`,"form.hint.cronBad":`Cron 表达式无效(分 时 日 月 周)`,"form.hint.nextRun":`下次运行 {time}`,"form.hint.saveVersion":`保存后版本 v{v} → v{next}`,"form.hint.createClaim":`创建后项目内会话可认领执行`,"form.action.runBlockedTitle":`任务正在执行中,不能重复发起`,"form.action.runBusyTitle":`正在提交…`,"form.action.runTitle":`保存后立即发起执行(新会话)`,"form.action.run":`⚡ 立即执行`,"form.action.save":`保存修改`,"form.action.create":`创建任务`,"tpl.aria":`管理模板`,"tpl.title":`任务模板`,"tpl.subtitle":`新建任务 ▼ 下拉的模板:改名 / 删除 / 直接使用;任务详情页「存为模板」可新增`,"tpl.empty":`暂无模板 — 在任务详情页点「存为模板」把常用配置沉淀下来`,"tpl.name.aria":`模板名 {name}`,"tpl.builtin":`内置`,"tpl.custom":`自建`,"tpl.meta.checklist":` · 清单 {n} 项`,"tpl.rename.title":`保存改名`,"tpl.rename.button":`改名`,"tpl.use.title":`用此模板打开新建表单`,"tpl.use.button":`用此新建`,"tpl.delete.title":`删除该模板`,"tpl.renamed":`模板已改名`,"tpl.foot.hint":`模板随台账一同保存在当前数据目录,升级不丢`,"imp.aria":`导入台账`,"imp.title":`导入台账`,"imp.subtitle":`选择导出的 JSON 备份文件:先预览、再合并或整册替换`,"imp.parseError":`文件不是合法 JSON`,"imp.note":`⬇ JSON 导出可恢复台账;图片附件需同时备份设置页所示数据目录下的 dsh-taskboard-assets 文件夹。导入文件的 schemaVersion 必须与当前版本一致。`,"imp.previewing":`预览中…`,"imp.stat.create":`新增`,"imp.stat.overwrite":`覆盖(同 id)`,"imp.stat.invalid":`无效(跳过)`,"imp.sec.create":`新增任务`,"imp.sec.overwrite":`覆盖任务(整卡替换,含执行历史与评论)`,"imp.sec.invalid":`无效条目(不会导入)`,"imp.noId":`(无 id)`,"imp.mode.merge":`⊕ 合并`,"imp.mode.mergeHint":`新增 + 按 id 覆盖,其余不动`,"imp.mode.replace":`💣 整册替换`,"imp.mode.replaceHint":`清空当前台账,以导入文件为准(先自动备份)`,"imp.result.replace":`整册替换完成:导入 {n} 张(原 {total} 张已整册备份)`,"imp.result.merge":`合并完成:新增 {n} 张、覆盖 {m} 张`,"imp.foot.replaceConfirm":`⚠ 再次点击确认执行整册替换(不可撤销,已自动备份)`,"imp.foot.replaceNeedConfirm":`整册替换需要二次确认`,"imp.foot.mergeHint":`合并只写入预览中列出的任务`,"imp.action.run":`执行导入`,"imp.action.confirmReplace":`确认整册替换`,"set.aria":`看板设置`,"set.title":`看板设置`,"set.subtitle":`新建任务、会话同步与本地数据存储`,"set.iso.heading":`默认执行隔离`,"set.iso.noneHint":`不使用 git,直接在项目目录工作(出厂默认)`,"set.iso.worktreeHint":`每次执行在独立 worktree 分支上进行(task/标题+ID),互不污染;多仓库工作区自动整区镜像(每仓库独立分支)`,"set.iso.current":`当前保存的默认:{current}。仅影响之后新建的任务;已有任务保持创建时的选择,非 git 项目运行时仍自动降级原目录。`,"set.sync.heading":`自动同步工作区会话`,"set.sync.off.name":`🚫 关闭同步`,"set.sync.off.title":`仅管理在任务看板中创建和触发的任务`,"set.sync.off.hint":`仅管理看板任务(出厂默认)`,"set.sync.on.name":`🔄 自动纳入会话`,"set.sync.on.title":`各工作区直接新建的会话也会在看板展示,运行中进入「进行中」,完成后自动进入「待验收」`,"set.sync.on.hint":`跟踪运行并在完成后进入待验收`,"set.sync.stateOn":`已开启:工作区直接新建并执行的会话将自动在看板生成任务卡片,并在完成后流转至「待验收」列。`,"set.sync.stateOff":`已关闭:仅在看板内部创建与触发执行的任务会出现在看板上。`,"set.foot.dirty":`有未保存的修改`,"set.foot.clean":`与看板当前设置一致`,"set.action.save":`保存设置`,"set.storage.heading":`数据存储位置`,"set.storage.hint":`任务台账、模板和图片附件统一存放在此目录。修改路径会先完整复制并校验,再切换到新位置。`,"set.storage.loading":`正在读取当前路径…`,"set.storage.current":`当前路径:{path}`,"set.storage.assets":`图片附件:{count} 个,{size} MiB`,"set.storage.default":`恢复默认路径`,"set.storage.check":`检查路径`,"set.storage.migrate":`迁移数据`,"set.storage.migrating":`迁移中…`,"set.storage.confirm":`确认迁移全部任务台账、模板和图片附件?
|
|
9
|
+
|
|
10
|
+
原路径:{from}
|
|
11
|
+
新路径:{to}
|
|
12
|
+
|
|
13
|
+
迁移期间写操作会短暂排队。`,"form.field.permission":`执行权限`,"form.perm.write":`可写入工作区`,"form.perm.writeHint":`可读写工作区及临时目录(推荐默认)`,"form.perm.readOnly":`仅可查看`,"form.perm.readOnlyHint":`只读查看与检索,禁止修改文件或执行外部命令`,"form.perm.fullAccess":`完全权限`,"form.perm.fullAccessHint":`完全无限制权限,可访问全盘及执行外部命令`,"form.perm.defaultTag":`(默认)`,"set.perm.heading":`默认执行权限`,"set.perm.writeName":`📁 可写入工作区(出厂默认)`,"set.perm.writeHint":`可读写工作区及临时目录,写操作无需二次确认`,"set.perm.readOnlyName":`🔒 仅可查看`,"set.perm.readOnlyHint":`仅允许只读查看与检索,禁止修改文件或破坏性命令`,"set.perm.fullName":`⚡ 完全权限`,"set.perm.fullHint":`完全无限制权限,可访问全盘及执行系统外部命令`,"set.perm.current":`当前保存的默认:{current}。新建任务时预设的执行权限。`,"card.badge.permReadOnly":`🔒 仅查看`,"card.badge.permReadOnlyTitle":`权限:仅可查看`,"card.badge.permFull":`⚡ 全权限`,"card.badge.permFullTitle":`权限:完全权限`,"detail.chip.permReadOnly":`仅可查看`,"detail.chip.permFull":`完全权限`,"detail.chip.permWrite":`可写入工作区`,"tpl.meta.permReadOnly":`仅查看`,"tpl.meta.permFull":`全权限`,"md.imageAlt":`图片 {n}`,"md.imageTitle":`点击查看大图 ({alt})`,"md.lightboxAlt":`大图预览`,"md.closePreview":`关闭预览`,"image.add":`插入图片`,"image.uploading":`正在上传…`,"image.hint":`支持选择、粘贴或拖入 PNG/JPEG/GIF/WebP,单张不超过 5 MB`,"image.defaultAlt":`图片`,"slash.aria":`快捷命令与技能`,"slash.title":`快捷命令与技能补全`,"slash.hint":`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`,"slash.badge.command":`⚡ 命令`,"slash.badge.skill":`🧩 技能`,"slash.tipA":`💡 输入`,"slash.tipB":`可快速补全 Slash 命令与 Agent 技能`,"slash.cmd.goal.desc":`自主完成长期目标任务,持续深度推进`,"slash.cmd.goal.hint":`<目标描述>`,"slash.cmd.schedule.desc":`设置一次性定时或周期性 Cron 调度`,"slash.cmd.schedule.hint":`<时间/表达式>`,"slash.cmd.plan.desc":`在行动前制定分步实施计划并由用户确认`,"slash.cmd.browser.desc":`启动网页浏览器交互与实时页面检索`,"slash.cmd.grill-me.desc":`通过多轮单题访谈深入对齐需求与设计意图`,"slash.cmd.teamwork-preview.desc":`多智能体协作与团队工作流预览`,"slash.cmd.learn.desc":`沉淀解决经验与新规则到知识库`,"slash.cmd.review.desc":`多维度代码审查(正确性、架构与安全)`,"slash.cmd.security.desc":`安全加固与代码漏洞扫描`,"slash.cmd.permission.desc":`切换当前会话权限级别 (read-only / workspace-write / full-access)`,"slash.cmd.permission.hint":`<preset>`,"slash.skill.frontend-ui-engineering":`构建生产级、可访问的高品质前端界面与组件`,"slash.skill.api-and-interface-design":`设计稳定契约、清晰边界的 REST / RPC 接口`,"slash.skill.test-driven-development":`测试驱动开发(TDD),编写单元与集成测试`,"slash.skill.debugging-and-error-recovery":`系统化定位 Bug 根因并恢复错误`,"slash.skill.performance-optimization":`前后端性能调优、减少渲染开销与查询优化`,"slash.skill.ci-cd-and-automation":`自动化构建、CI/CD 流水线与质量门禁`,"slash.skill.code-review-and-quality":`多轴向代码审查与重构指导`,"slash.skill.code-simplification":`精简复杂逻辑,提升可读性与可维护性`,"slash.skill.context-engineering":`优化上下文结构与提示词工程`,"slash.skill.doubt-driven-development":`以怀疑驱动的对抗式审查,确保核心逻辑正确`,"slash.skill.git-workflow-and-versioning":`Git 工作流、分支管理、语义化版本与变更日志`,"slash.skill.idea-refine":`通过发散与收敛思维细化方案与假设检验`,"slash.skill.incremental-implementation":`小步快跑、增量交付多文件变更`,"slash.skill.interview-me":`深度访谈挖掘真实意图`,"slash.skill.memory-leak-debugging":`排查诊断 JavaScript/Node.js 内存泄漏`,"slash.skill.observability-and-instrumentation":`添加日志、指标打点与链路追踪`,"slash.skill.planning-and-task-breakdown":`将复杂需求拆解为有序可执行任务`,"slash.skill.security-and-hardening":`防御安全漏洞、输入过滤与鉴权加固`,"slash.skill.shipping-and-launch":`生产发布前检查清单与回滚策略`,"slash.skill.source-driven-development":`基于权威官方文档与源码进行设计实现`,"slash.skill.spec-driven-development":`在编码前制定清晰的技术规范`,"slash.skill.using-agent-skills":`发现并动态调用智能体各项专业技能`,"sys.execFailed":`[系统] 执行失败:{error};任务已退回待办。`,"sys.endedWithComment":`[系统] 执行会话已结束并留有评论,但未移至待验收;系统自动移入待验收。`,"sys.endedNoHandoff":`[系统] 执行会话已结束,但未按协议交接(无评论、未移至待验收);系统自动移入待验收,请审查后退回或验收。`,"sys.sessionError":`[系统] 会话执行异常:{error};任务已退回待办。`,"sys.sessionDone":`[系统] 会话执行完毕,已自动进入待验收。`,"sys.cronDead":`[系统] 定时表达式 {cron} 在 4 年内没有可触发时间,已停用定时;请修正 cron 后重新开启。`,"sys.mergeSingle":`[系统] 分支 {branch} 已合并到主工作区(--no-ff)。`,"sys.mergeMulti":`[系统] 分支已按仓库合并(--no-ff):{summary}`},en:{"shared.close":`Close`,"shared.cancel":`Cancel`,"shared.loading":`Loading…`,"shared.blocked":`Blocked`,"shared.permission":`Permission`,"shared.confirmDelete":`Delete`,"shared.current":` (current: {name})`,"shared.entry.aria":`Agent task board`,"shared.entry.label":`Task board`,"shared.stats.title":`To do {todo} | In progress {doing} | In review {review} (todo | in progress | in review)`,"shared.duplicate.suffix":` (copy)`,"status.column.backlog":`Backlog`,"status.column.todo":`To do`,"status.column.in_progress":`In progress`,"status.column.in_review":`In review`,"status.column.done":`Done`,"status.column.canceled":`Canceled`,"status.column.archived":`Archived`,"status.pill.backlog":`Planned`,"status.pill.todo":`To do`,"status.pill.in_progress":`In progress`,"status.pill.in_review":`In review`,"status.pill.done":`Done`,"status.pill.canceled":`Canceled`,"status.pill.archived":`Archived`,"status.move.backlog":`Backlog`,"status.move.todo":`To do`,"status.move.in_progress":`In progress`,"status.move.in_review":`In review`,"status.move.done":`Done`,"status.move.canceled":`Canceled`,"status.move.archived":`Archived`,"urgency.urgent":`Urgent`,"urgency.normal":`Normal`,"urgency.relaxed":`Relaxed`,"outcome.running":`Running`,"outcome.succeeded":`Succeeded`,"outcome.failed":`Failed`,"outcome.cancelled":`Canceled`,"board.title":`Agent Task Board`,"board.count.tasks":`{n} tasks · rev {rev}`,"board.action.newTask":`+ New Task ▼`,"board.action.blankTask":`Blank task`,"board.action.manageTemplates":`⌗ Manage templates…`,"board.search.placeholder":`Search title / ID…`,"board.filter.allProjects":`All projects`,"board.sort.title":`Sort within columns`,"board.sort.default":`Default order`,"board.sort.updated":`Recently updated`,"board.sort.urgency":`By urgency`,"board.sort.created":`Creation time`,"board.sort.byTitle":`By title`,"board.action.backToBoard":`Back to board`,"board.action.otherTasks":`Other tasks`,"board.action.settingsTitle":`Board settings: default execution isolation for new tasks, etc.`,"board.action.settings":`🛠 Settings`,"board.action.diagTitle":`Health diagnostics: orphan worktrees, ledger basics`,"board.action.diag":`⚙ Diagnostics`,"board.action.importTitle":`Import the ledger from a JSON backup (preview, then merge or replace)`,"board.action.import":`⬆ Import`,"board.action.exportTitle":`Export the ledger: full JSON backup or task-list CSV`,"board.action.export":`⬇ Export ▼`,"board.export.jsonTitle":`Full ledger backup (execution history and board settings included); import it to restore`,"board.export.json":`Full ledger (JSON)`,"board.export.csvTitle":`Task-list spreadsheet (opens directly in Excel; BOM added for CJK text)`,"board.export.csv":`Task list (CSV)`,"board.drag.forbidden":`Cannot drag from "{from}" to "{to}"`,"board.empty":`No tasks`,"board.secondary.empty":`No canceled / archived / deleted tasks`,"board.group.trashed":`Deleted`,"diag.title":`Health diagnostics`,"diag.subtitle":`Ledger basics and orphan-worktree cleanup`,"diag.revision":`Ledger revision`,"diag.tasks":`Total tasks`,"diag.running":`Running`,"diag.orphans":`Orphan worktrees`,"diag.orphans.heading":`Orphan worktrees (no owning task, directory still present)`,"diag.orphans.none":`None — every project’s .dsh-worktrees directory is clean`,"diag.orphans.cleanup":`Clean up`,"diag.orphans.hint":`Note: orphan directories with uncommitted changes are refused; handle their contents manually first. Remove a live task’s worktree from its task detail pane.`,"diag.gitignore.heading":`gitignore suggestions`,"diag.gitignore.none":`Nothing to do — every git project already ignores .dsh-worktrees`,"diag.gitignore.suggestA":`suggests adding one line to .gitignore:`,"diag.gitignore.suggestB":`(no automatic edits)`,"card.drag.running":`This task is being executed by a session ({title}) and cannot be dragged`,"card.badge.stale":`⏱ Claim stale`,"card.badge.modelTitle":`Pinned model: {model}`,"card.badge.modelEffort":` · reasoning effort: {effort}`,"card.badge.checklistReview":`In review: checklist has unchecked items`,"card.badge.checklist":`Acceptance checklist progress`,"card.badge.pendingPurge":`Pending purge`,"card.session.jumpTitle":`Click to jump to the session: {id}`,"card.session.missing":`The session has been deleted ({id}) and cannot be opened`,"card.session.archived":`The session is archived ({id}) and hidden from the session list`,"card.session.unavailable":`Session navigation unavailable; session id: {id}`,"card.reject.placeholder":`Reason for sending back (optional; the agent reads it before starting)…`,"card.reject.confirm":`Send back to todo`,"card.action.doneTitle":`Accept and complete: move to Done`,"card.action.done":`✓ Done`,"card.action.rejectTitle":`Send back to todo, optionally with a reason`,"card.action.reject":`✗ Send back`,"alert.ok":`Got it`,"diff.commit":`Commit {hash}`,"diff.file":`File {path}`,"diff.truncated":`⚠ Content truncated (too long)`,"diff.failed":`Failed to fetch (see the error bar at the top of the board; the object may be gone with a removed worktree)`,"checklist.title":`Acceptance checklist (DoD)`,"checklist.unchecked":` · {n} unchecked`,"checklist.allDone":` · all done`,"checklist.byUser":`👤 User`,"checklist.uncheckedItem":`Unchecked`,"checklist.evidence":`Evidence: {note}`,"report.title":`Execution report`,"report.submitted":`Submitted by the execution session · {time}`,"report.changedFiles":`Changed files`,"report.checks":`Self-verification`,"report.artifacts":`Artifacts`,"report.risk":`Remaining risks`,"iso.title":`Execution isolation`,"iso.none":`📁 Run in the original directory`,"iso.worktreeTitle":`Execution isolation · Worktree`,"iso.branch":`🌿 Branch`,"iso.baseline":`Baseline {base} → {head}`,"iso.changed":`{n} files changed`,"iso.commit.openTitle":`Click to expand this commit’s diff`,"iso.commits.more":`… {n} commits in total`,"iso.nocommit":`This execution produced no commits (changes may be uncommitted — see the warning below)`,"iso.dirty.toggle":`⚠ {n} uncommitted changes (have the agent commit before merging, or handle them manually)`,"iso.dirty.expand":` ▼ view files`,"iso.dirty.collapse":` ▲`,"iso.dirty.openTitle":`Click to view the uncommitted diff of this file`,"iso.dirty.more":`… {n} in total (full list in the task ledger)`,"iso.hint.running":`Running — merge or clean up after it ends`,"iso.merge.confirm":`Merge the branch into the main worktree with --no-ff?`,"iso.merge.go":`Merge`,"iso.merge.title":`git merge --no-ff the task branch into the main worktree (requires a clean main worktree; conflicts are reported as-is)`,"iso.merge.button":`⇥ Merge into main worktree`,"iso.merge.failed":`Merge failed: {error}`,"iso.merge.noop":`The branch has no commits ahead of the main worktree — nothing to merge (send it back to continue running, or clean it up)`,"iso.merge.done":`Merged per repo (--no-ff): {summary}`,"iso.merge.partial":`Some repos failed to merge: {summary}
|
|
14
|
+
{error}`,"iso.repo.root":`Root repo`,"iso.remove.wt":`🗑 Remove worktree`,"iso.remove.wtTitle":`git worktree remove (refused when uncommitted changes exist)`,"iso.remove.wtb":`🗑 Remove worktree + branch`,"iso.remove.wtbTitle":`Remove the worktree and delete the task branch (refused when uncommitted changes exist)`,"iso.remove.confirmWt":`Remove the worktree directory?`,"iso.remove.confirmWtb":`Remove the worktree and delete the branch?`,"iso.remove.failed":`Removal failed: {error}`,"iso.remove.branchFailed":`Worktree removed, but branch deletion failed: {error}`,"iso.hint.keep":`Branch and worktree kept — send back to continue editing`,"detail.session.jumpTitle":`Jump to the corresponding session: {id}`,"detail.session.jump":`🤖 Jump to session ↗`,"detail.action.edit":`✎ Edit`,"detail.action.duplicateTitle":`Duplicate this task’s full configuration as a new card (todo column)`,"detail.action.duplicate":`⧉ Duplicate`,"detail.action.saveTplTitle":`Save this task’s configuration (checklist included) as a template for new tasks`,"detail.action.saveTplDone":`Saved as a template (available in the New Task ▼ menu; rename it in template management)`,"detail.action.saveTpl":`⌗ Save as template`,"detail.action.reuseTitle":`Reuse-run: keep the existing worktree and branch (last run’s changes and commits stay in place) and continue on top of them; the default "Run" resets to a fresh baseline`,"detail.action.reuse":`↻ Reuse-run`,"detail.action.runTitleModel":`Run in a new session ({model})`,"detail.action.runTitleDefault":`Run in a new session (default model)`,"detail.action.run":`▶ Run`,"detail.action.stopConfirm":`Stop this execution session?`,"detail.action.stop":`Stop`,"detail.action.stopTitle":`Stop execution session {id} (the task returns to todo)`,"detail.action.stopExec":`■ Stop execution`,"detail.chip.nextRun":`{cron} · next {time}`,"detail.chip.checklist":`Checklist {done}/{total}`,"detail.chip.isolated":`Worktree isolation`,"detail.chip.holderTitle":`Click to jump to the session: {id}`,"detail.chip.holderStale":`Claim stale · `,"detail.chip.holderBy":`Held by `,"detail.chip.holderSuffix":` ↗`,"detail.chip.trashed":`Deleted, pending purge`,"detail.sub.line":`Updated {time} · last change by {who}`,"detail.updatedBy.system":`⚙️ System`,"detail.updatedBy.user":`👤 User`,"detail.field.description":`Description`,"detail.field.prompt":`Execution prompt`,"detail.move.to":`Move to → {status}`,"detail.move.confirmDoneUnchecked":`{n} checklist items are still unchecked — confirm done?`,"detail.move.confirmDone":`Confirm done?`,"detail.move.confirmArchive":`Confirm archive this task?`,"detail.move.confirmArchiveSessionWithId":`Archive execution session {id} together?`,"detail.move.confirmArchiveSessionCount":`Archive {n} execution sessions together?`,"detail.move.archiveWithSession":`With session`,"detail.move.archiveUnsupported":`Session archiving is unavailable on this host`,"detail.move.archiveResult":`Card archived; {n} execution sessions archived. Failed sessions, if any:`,"detail.move.archiveRetry":`Archive / retry execution sessions`,"detail.move.archiveCardOnly":`Card only`,"detail.move.confirm":`Confirm`,"detail.blocked.unmark":`✓ Unblock`,"detail.blocked.mark":`⛔ Mark blocked`,"detail.release.title":`Release {id}’s claim: the task returns to todo (the holding session may still be working — make sure it has stopped first)`,"detail.release.button":`🔓 Release claim`,"detail.comments.title":`Comments`,"detail.comments.empty":`No comments yet — the agent reports changes and verification here at handoff`,"detail.comments.user":`User`,"detail.composer.placeholder":`Leave a comment as the user (the agent reads it before starting)…`,"detail.composer.send":`Post`,"detail.exec.title":`Executions`,"detail.exec.prunedTitle":`{n} older execution records were pruned at the retention cap`,"detail.exec.pruned":`+{n} pruned`,"detail.exec.trigger.manual":`Manual`,"detail.exec.trigger.scheduled":`Scheduled`,"detail.exec.openTitle":`Click to open the execution session: {id}`,"detail.danger.delete":`🗑 Delete (mark for purge)`,"detail.danger.purgeConfirm":`Physical purge is irreversible`,"detail.danger.purgeGo":`Purge`,"detail.danger.purge":`🔥 Purge physically (confirm required)`,"form.title.create":`New task`,"form.title.edit":`Edit task`,"form.subtitle.create":`Push onto the board; sessions in the project can claim and run it`,"form.subtitle.edit":`Adjust the task content and execution configuration`,"form.field.title":`Title`,"form.field.titlePlaceholder":`One line: what should be done`,"form.field.project":`Project`,"form.field.model":`Model (default = session default model)`,"form.field.modelDefault":`Default model`,"form.model.option":`{name} ({provider})`,"form.field.effort":`Reasoning effort`,"form.field.effortTitle":`Set the model’s reasoning effort (e.g. low/medium/high); default = follow the model/provider default`,"form.effort.follow":`Follow model default`,"form.effort.low":`Low (low)`,"form.effort.medium":`Medium (medium)`,"form.effort.high":`High (high)`,"form.effort.none":`Off (none)`,"form.field.preset":`Execution preset`,"form.field.presetTitle":`The execution session is composed from this preset (tool set and persona); default = the deployment default preset`,"form.preset.follow":`Follow deployment default`,"form.preset.defaultTag":` (deployment default)`,"form.field.urgency":`Urgency`,"form.urgency.urgent":`Urgent`,"form.urgency.urgentHint":`Handle first`,"form.urgency.normal":`Normal`,"form.urgency.normalHint":`Normal scheduling`,"form.urgency.relaxed":`Relaxed`,"form.urgency.relaxedHint":`When there is time`,"form.field.description":`Description`,"form.field.descriptionOptional":`Description (optional)`,"form.desc.placeholder":`Requirement details, background, acceptance criteria…`,"form.field.prompt":`Execution prompt (the actual prompt = title + description + prompt)`,"form.field.promptOptional":`Execution prompt (optional; the actual prompt = title + description + prompt)`,"form.prompt.placeholder":`Extra instructions appended after "title + task description" and sent to the execution session. Template variables: {{lastExecution}} (last execution result), {{lastComments}} (latest 3 comments)`,"form.field.mode":`Execution mode`,"form.mode.claim":`🤝 Claim-based`,"form.mode.claimHint":`Sessions in the project claim it`,"form.mode.scheduled":`⏰ Scheduled`,"form.mode.scheduledHint":`Starts automatically on schedule`,"form.field.cron":`Cron expression`,"form.cron.placeholder":`min hour day month weekday`,"form.cron.daily":`Daily 09:00`,"form.cron.hourly":`Hourly`,"form.cron.every10min":`Every 10 minutes`,"form.cron.weekly":`Mondays 09:00`,"form.cron.next":`Next {time}`,"form.field.isolation":`Execution isolation`,"form.iso.locked":`The task has execution history; isolation is locked`,"form.iso.lockedShort":`Locked (cannot change once execution has started)`,"form.iso.nonGit":`This project is not a git repository`,"form.iso.worktree":`🌿 Worktree isolation`,"form.iso.worktreeTitle":`Each execution runs on its own worktree branch`,"form.iso.worktreeHint":`Isolated branch task/title+ID, no cross-contamination`,"form.iso.none":`📁 Run in the project directory`,"form.iso.noneTitle":`Run directly in the project directory (no git)`,"form.iso.noneHintNonGit":`Not a git repository; will run in the project directory`,"form.iso.noneHint":`No git; works directly in the project directory`,"form.iso.nonGitNote":`This project is not a git repository; the task will run in its directory (still created with the default configuration; the runtime degrades automatically)`,"form.iso.mirrorNote":`Multi-repo workspace: worktree isolation automatically mirrors all {n} repos — one task branch each, merged per repo at acceptance`,"form.field.checklist":`Acceptance checklist (DoD)`,"form.field.checklistOptional":`Acceptance checklist (DoD, optional)`,"form.check.itemPlaceholder":`Checklist item {n} (definition of done)`,"form.check.removeTitle":`Remove this checklist item`,"form.check.add":`+ Add checklist item`,"form.check.checkedTitle":`Checked state is preserved on save (currently checked by: {who})`,"form.check.notCheckedYet":`not checked yet`,"form.check.hintCreate":`{n} items; the execution session works through them and checks each off; unfinished items are highlighted at review`,"form.check.hintEdit":`{checked}/{total} checked (saving replaces the whole list; checked state is preserved)`,"form.hint.needTitle":`Enter a title`,"form.hint.needProject":`Select a project`,"form.hint.cronBad":`Invalid cron expression (min hour day month weekday)`,"form.hint.nextRun":`Next run {time}`,"form.hint.saveVersion":`On save: v{v} → v{next}`,"form.hint.createClaim":`After creation, sessions in the project can claim and run it`,"form.action.runBlockedTitle":`The task is running; cannot start another`,"form.action.runBusyTitle":`Submitting…`,"form.action.runTitle":`Save, then immediately start an execution (new session)`,"form.action.run":`⚡ Run now`,"form.action.save":`Save changes`,"form.action.create":`Create task`,"tpl.aria":`Manage templates`,"tpl.title":`Task templates`,"tpl.subtitle":`Templates from the New Task ▼ menu: rename / delete / use directly; "Save as template" in the task detail pane adds new ones`,"tpl.empty":`No templates yet — click "Save as template" in a task detail pane to capture a common configuration`,"tpl.name.aria":`Template name {name}`,"tpl.builtin":`Built-in`,"tpl.custom":`Custom`,"tpl.meta.checklist":` · {n} checklist items`,"tpl.rename.title":`Save rename`,"tpl.rename.button":`Rename`,"tpl.use.title":`Open the new-task form with this template`,"tpl.use.button":`Use`,"tpl.delete.title":`Delete this template`,"tpl.renamed":`Template renamed`,"tpl.foot.hint":`Templates are stored with the ledger in the active data directory and survive upgrades`,"imp.aria":`Import ledger`,"imp.title":`Import ledger`,"imp.subtitle":`Pick an exported JSON backup: preview first, then merge or replace everything`,"imp.parseError":`The file is not valid JSON`,"imp.note":`The ⬇ JSON export restores the ledger. Back up the dsh-taskboard-assets folder in the data directory shown in Settings as well. The file’s schemaVersion must match the current version.`,"imp.previewing":`Previewing…`,"imp.stat.create":`New`,"imp.stat.overwrite":`Overwrite (same id)`,"imp.stat.invalid":`Invalid (skipped)`,"imp.sec.create":`New tasks`,"imp.sec.overwrite":`Overwritten tasks (whole-card replacement, execution history and comments included)`,"imp.sec.invalid":`Invalid entries (not imported)`,"imp.noId":`(no id)`,"imp.mode.merge":`⊕ Merge`,"imp.mode.mergeHint":`Adds new + overwrites by id; everything else untouched`,"imp.mode.replace":`💣 Replace all`,"imp.mode.replaceHint":`Clears the current ledger and adopts the imported file (automatic backup first)`,"imp.result.replace":`Replace complete: imported {n} tasks ({total} former tasks backed up)`,"imp.result.merge":`Merge complete: {n} added, {m} overwritten`,"imp.foot.replaceConfirm":`⚠ Click again to confirm the full replacement (irreversible; a backup has been taken)`,"imp.foot.replaceNeedConfirm":`Full replacement requires a second confirmation`,"imp.foot.mergeHint":`Merge writes only the tasks listed in the preview`,"imp.action.run":`Import`,"imp.action.confirmReplace":`Confirm replace`,"set.aria":`Board settings`,"set.title":`Board settings`,"set.subtitle":`New-task defaults, session sync, and local data storage`,"set.iso.heading":`Default execution isolation`,"set.iso.noneHint":`No git; works directly in the project directory (factory default)`,"set.iso.worktreeHint":`Each execution runs on its own worktree branch (task/title+ID), isolated from the others; multi-repo workspaces are mirrored whole (one branch per repo)`,"set.iso.current":`Currently saved default: {current}. Affects only tasks created hereafter; existing tasks keep their creation-time choice, and non-git projects still degrade to the project directory at run time.`,"set.sync.heading":`Auto-sync workspace sessions`,"set.sync.off.name":`🚫 Sync off`,"set.sync.off.title":`Manage only tasks created and triggered in the task board`,"set.sync.off.hint":`Board tasks only (factory default)`,"set.sync.on.name":`🔄 Auto-include sessions`,"set.sync.on.title":`Sessions created directly in workspaces also appear on the board: In progress while running, In review automatically when done`,"set.sync.on.hint":`Tracks runs and enters review on completion`,"set.sync.stateOn":`On: sessions created and run directly in workspaces automatically become board cards and flow to the "In review" column when done.`,"set.sync.stateOff":`Off: only tasks created and triggered inside the board appear on the board.`,"set.foot.dirty":`Unsaved changes`,"set.foot.clean":`Matches the current board settings`,"set.action.save":`Save settings`,"set.storage.heading":`Data storage location`,"set.storage.hint":`The task ledger, templates, and image attachments live together in this directory. Changing it copies and verifies everything before switching.`,"set.storage.loading":`Loading the current path…`,"set.storage.current":`Current path: {path}`,"set.storage.assets":`Image attachments: {count}, {size} MiB`,"set.storage.default":`Restore default path`,"set.storage.check":`Check path`,"set.storage.migrate":`Migrate data`,"set.storage.migrating":`Migrating…`,"set.storage.confirm":`Migrate the complete task ledger, templates, and image attachments?
|
|
15
|
+
|
|
16
|
+
From: {from}
|
|
17
|
+
To: {to}
|
|
18
|
+
|
|
19
|
+
Writes queue briefly during migration.`,"form.field.permission":`Execution permission`,"form.perm.write":`Workspace write`,"form.perm.writeHint":`Read-write access to the workspace and temp directories (recommended default)`,"form.perm.readOnly":`Read-only`,"form.perm.readOnlyHint":`View and search only; no file changes or external commands`,"form.perm.fullAccess":`Full access`,"form.perm.fullAccessHint":`Unrestricted: whole-disk access and external commands`,"form.perm.defaultTag":` (default)`,"set.perm.heading":`Default execution permission`,"set.perm.writeName":`📁 Workspace write (factory default)`,"set.perm.writeHint":`Read-write access to the workspace and temp directories; writes need no extra confirmation`,"set.perm.readOnlyName":`🔒 Read-only`,"set.perm.readOnlyHint":`Read-only viewing and search only; no file changes or destructive commands`,"set.perm.fullName":`⚡ Full access`,"set.perm.fullHint":`Unrestricted: whole-disk access and external system commands`,"set.perm.current":`Currently saved default: {current}. The execution permission preset applied to new tasks.`,"card.badge.permReadOnly":`🔒 Read-only`,"card.badge.permReadOnlyTitle":`Permission: read-only`,"card.badge.permFull":`⚡ Full access`,"card.badge.permFullTitle":`Permission: full access`,"detail.chip.permReadOnly":`Read-only`,"detail.chip.permFull":`Full access`,"detail.chip.permWrite":`Workspace write`,"tpl.meta.permReadOnly":`read-only`,"tpl.meta.permFull":`full access`,"md.imageAlt":`Image {n}`,"md.imageTitle":`Click to view full size ({alt})`,"md.lightboxAlt":`Full-size preview`,"md.closePreview":`Close preview`,"image.add":`Insert image`,"image.uploading":`Uploading…`,"image.hint":`Choose, paste, or drop PNG/JPEG/GIF/WebP images up to 5 MB each`,"image.defaultAlt":`Image`,"slash.aria":`Quick commands and skills`,"slash.title":`Quick command and skill completion`,"slash.hint":`↑↓ navigate · Enter / Tab pick · Esc close`,"slash.badge.command":`⚡ command`,"slash.badge.skill":`🧩 skill`,"slash.tipA":`💡 Type`,"slash.tipB":`to autocomplete slash commands and agent skills`,"slash.cmd.goal.desc":`Autonomously drive long-horizon goals to completion`,"slash.cmd.goal.hint":`<goal description>`,"slash.cmd.schedule.desc":`Set one-off or recurring cron schedules`,"slash.cmd.schedule.hint":`<time or expression>`,"slash.cmd.plan.desc":`Draft a step-by-step plan and get user confirmation before acting`,"slash.cmd.browser.desc":`Launch a browser for page interaction and live search`,"slash.cmd.grill-me.desc":`Align requirements and design intent through one-question-at-a-time interviews`,"slash.cmd.teamwork-preview.desc":`Multi-agent collaboration and team workflow preview`,"slash.cmd.learn.desc":`Capture solutions and new rules into the knowledge base`,"slash.cmd.review.desc":`Multi-axis code review (correctness, architecture, security)`,"slash.cmd.security.desc":`Security hardening and vulnerability scanning`,"slash.cmd.permission.desc":`Switch the session permission level (read-only / workspace-write / full-access)`,"slash.cmd.permission.hint":`<preset>`,"slash.skill.frontend-ui-engineering":`Build production-grade, accessible frontend interfaces and components`,"slash.skill.api-and-interface-design":`Design stable, well-bounded REST / RPC interfaces`,"slash.skill.test-driven-development":`Test-driven development (TDD): unit and integration tests`,"slash.skill.debugging-and-error-recovery":`Systematically locate bug root causes and recover`,"slash.skill.performance-optimization":`Frontend/backend performance tuning and query optimization`,"slash.skill.ci-cd-and-automation":`Build automation, CI/CD pipelines and quality gates`,"slash.skill.code-review-and-quality":`Multi-axis code review and refactoring guidance`,"slash.skill.code-simplification":`Simplify complex logic for readability and maintainability`,"slash.skill.context-engineering":`Optimize context structure and prompt engineering`,"slash.skill.doubt-driven-development":`Adversarial, doubt-driven review of core logic`,"slash.skill.git-workflow-and-versioning":`Git workflow, branching, semantic versioning and changelogs`,"slash.skill.idea-refine":`Refine ideas and test hypotheses via divergent-convergent thinking`,"slash.skill.incremental-implementation":`Deliver multi-file changes in small, incremental steps`,"slash.skill.interview-me":`Deep interviews to surface true intent`,"slash.skill.memory-leak-debugging":`Diagnose JavaScript/Node.js memory leaks`,"slash.skill.observability-and-instrumentation":`Add logging, metrics and distributed tracing`,"slash.skill.planning-and-task-breakdown":`Break complex requirements into ordered, executable tasks`,"slash.skill.security-and-hardening":`Harden against vulnerabilities; input filtering and auth hardening`,"slash.skill.shipping-and-launch":`Pre-launch checklists and rollback strategies`,"slash.skill.source-driven-development":`Design from authoritative docs and source code`,"slash.skill.spec-driven-development":`Write clear technical specs before coding`,"slash.skill.using-agent-skills":`Discover and invoke agent skills dynamically`,"sys.execFailed":`[System] Execution failed: {error}; the task was returned to todo.`,"sys.endedWithComment":`[System] The execution session ended with comments but was not moved to in review; the system moved it to in review automatically.`,"sys.endedNoHandoff":`[System] The execution session ended without a protocol handoff (no comments, not moved to in review); the system moved it to in review automatically — review it, then send back or accept.`,"sys.sessionError":`[System] Session execution error: {error}; the task was returned to todo.`,"sys.sessionDone":`[System] The session finished; automatically moved to in review.`,"sys.cronDead":`[System] The cron expression {cron} has no trigger time within 4 years; scheduling disabled — fix the cron and re-enable.`,"sys.mergeSingle":`[System] Branch {branch} merged into the main worktree (--no-ff).`,"sys.mergeMulti":`[System] Branches merged per repo (--no-ff): {summary}`}};let T,E,D={active:N(),revision:0};const O=new Set;let k,A;function j(){A!==void 0&&(clearInterval(A),A=void 0);try{k?.disconnect()}catch{}k=void 0}function M(e){return e===`zh`||e===`en`}function N(){try{if(typeof document<`u`){let e=document.documentElement.lang;if(typeof e==`string`&&e.length>0){let t=e.toLowerCase();if(t.startsWith(`zh`))return`zh`;if(t.startsWith(`en`))return`en`}}}catch{}try{if(typeof navigator<`u`)return(navigator.language??`en`).toLowerCase().startsWith(`zh`)?`zh`:`en`}catch{}return`en`}function P(e){let t=e;if(!(t==null||typeof t.getSnapshot!=`function`||typeof t.subscribe!=`function`))return t}function F(e){j();try{typeof MutationObserver<`u`&&typeof document<`u`&&(k=new MutationObserver(()=>{if(T!==void 0)return;let e=N();e!==D.active&&I({active:e,revision:D.revision+1})}),k.observe(document.documentElement,{attributes:!0,attributeFilter:[`lang`]}))}catch{}if(e===void 0)return;let t=0;A=setInterval(()=>{t+=1;let n;try{n=P(e())}catch{n=void 0}if(n!==void 0){L(n);return}t>=8&&j()},250)}function I(e){if(!(e.active===D.active&&e.revision===D.revision)){D=e;for(let e of O)e()}}function L(e,t){let n=P(e);if(n===void 0){I({active:N(),revision:0}),F(t);return}j(),T=n;let r=()=>{try{let e=n.getSnapshot();I({active:M(e.active)?e.active:N(),revision:e.revision})}catch{}};r(),E=n.subscribe(r)}function R(){j();try{E?.()}catch{}E=void 0,T=void 0,I({active:N(),revision:0})}const z={getSnapshot(){return D},subscribe(e){return O.add(e),()=>{O.delete(e)}}},B=/\{(\w+)\}/g,V=(e,t)=>{let n=w[D.active][e]??w.en[e]??e;return t===void 0?n:n.replace(B,(e,n)=>{let r=t[n];return r===void 0?e:String(r)})};function H(){return(0,e.useSyncExternalStore)(z.subscribe,z.getSnapshot),V}const ee=`dsh-taskboard-view-v1`;function te(){try{let e=localStorage.getItem(ee);if(e===null)return{urgencies:[],sortBy:`default`};let t=JSON.parse(e),n=t.sortBy===`updated`||t.sortBy===`urgency`||t.sortBy===`created`||t.sortBy===`title`?t.sortBy:`default`;return{workspaceId:typeof t.workspaceId==`string`?t.workspaceId:void 0,urgencies:Array.isArray(t.urgencies)?t.urgencies.filter(e=>e===`urgent`||e===`normal`||e===`relaxed`):[],sortBy:n}}catch{return{urgencies:[],sortBy:`default`}}}function ne(){let e=te();return{boardOpen:!1,ledger:x(),workspaces:[],filters:{workspaceId:e.workspaceId,urgencies:e.urgencies},search:``,sortBy:e.sortBy,composerOpen:!1,secondaryOpen:!1,diagOpen:!1,templates:[],tplManagerOpen:!1,importOpen:!1,settingsOpen:!1}}var re=class{client;state=ne();subscribers=new Set;disposed=!1;disposeStream;refreshInFlight;seenRevision;sessionJumper;catalogFaces={};constructor(e){this.client=e}getSnapshot(){return this.state}subscribe(e){return this.subscribers.add(e),()=>this.subscribers.delete(e)}emit(){if(!this.disposed)for(let e of this.subscribers)e()}setState(e){this.state={...this.state,...e},this.emit()}start(){this.refresh(),this.disposeStream=this.client.stream(e=>{this.seenRevision=e.revision,this.refresh()},()=>{this.refresh()})}async refresh(){return this.refreshInFlight===void 0&&(this.refreshInFlight=(async()=>{try{for(let e=0;e<3;e++){let[e,t]=await Promise.all([this.client.state(),this.client.workspaces()]),n;if(this.state.selectedId!==void 0&&(n=e.tasks.find(e=>e.id===this.state.selectedId)),this.setState({archiveSessionsSupported:e.capabilities?.archiveSessions===!0,ledger:e,workspaces:t,error:void 0,selectedId:n===void 0?void 0:this.state.selectedId}),this.seenRevision===void 0||e.revision>=this.seenRevision)break}}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}finally{this.refreshInFlight=void 0}})()),this.refreshInFlight}dispose(){this.disposed=!0,this.disposeStream?.(),this.subscribers.clear()}openBoard(){this.setState({boardOpen:!0})}closeBoard(){this.setState({boardOpen:!1})}toggleBoard(){this.setState({boardOpen:!this.state.boardOpen})}setWorkspaceFilter(e){this.setState({filters:{...this.state.filters,workspaceId:e}}),this.persistView()}toggleUrgency(e){let t=new Set(this.state.filters.urgencies);t.has(e)?t.delete(e):t.add(e),this.setState({filters:{...this.state.filters,urgencies:[...t]}}),this.persistView()}setSearch(e){this.setState({search:e})}setSortBy(e){this.setState({sortBy:e}),this.persistView()}persistView(){try{localStorage.setItem(ee,JSON.stringify({workspaceId:this.state.filters.workspaceId,urgencies:this.state.filters.urgencies,sortBy:this.state.sortBy}))}catch{}}select(e){this.setState({selectedId:e})}setComposer(e){this.setState({composerOpen:e,editingId:void 0,templatePrefill:void 0})}newFromTemplate(e){this.setState({composerOpen:!0,editingId:void 0,templatePrefill:e})}openEditor(e){this.setState({composerOpen:!0,editingId:e,templatePrefill:void 0})}closeForm(){this.setState({composerOpen:!1,editingId:void 0,templatePrefill:void 0})}toggleSecondary(){this.setState({secondaryOpen:!this.state.secondaryOpen})}gitAvailable(e){return e===void 0||this.state.workspaces.find(t=>t.id===e)?.gitAvailable===!0}repoCount(e){return e===void 0?1:this.state.workspaces.find(t=>t.id===e)?.repoCount??1}installSessionJumper(e){this.sessionJumper=e}installModelCatalog(e){this.catalogFaces.models=e}installPresetRoster(e){this.catalogFaces.presets=e}get modelCatalog(){return this.catalogFaces.models}get presetCatalog(){return this.catalogFaces.presets}async fetchModelCatalog(){if(this.catalogFaces.models!==void 0)try{let e=await this.catalogFaces.models();if(e!==void 0&&e.length>0)return e}catch{}try{return(await this.client.modelCatalog()).models??[]}catch{return[]}}async fetchPresetCatalog(){if(this.catalogFaces.presets!==void 0)try{let e=await this.catalogFaces.presets();if(e!==void 0&&e.presets!==void 0&&e.presets.length>0)return e}catch{}try{let e=await this.client.modelCatalog();return{presets:e.presets??[],...e.defaultPresetId===void 0?{}:{defaultId:e.defaultPresetId}}}catch{return{presets:[]}}}async openSession(e){if(this.sessionJumper===void 0)return`unavailable`;let t;try{t=await this.sessionJumper(e)}catch{return`unavailable`}return t===`opened`&&this.closeBoard(),t}async create(e){try{let t=await this.client.create(e);return this.setState({composerOpen:!1,error:void 0}),await this.refresh(),t.id}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async update(e,t,n){try{return await this.client.update(e,{ifVersion:t,...n}),this.setState({composerOpen:!1,editingId:void 0,error:void 0}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async retryArchiveSessions(e){try{if(this.client.archiveSessions===void 0)return;let t=await this.client.archiveSessions(e);this.setState({sessionArchive:{taskId:e,result:t}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async move(e,t,n,r){try{let i=await this.client.move(e,{ifVersion:t,status:n,...r?.archiveSessions===void 0?{}:{archiveSessions:r.archiveSessions}});i.sessionArchive!==void 0&&this.setState({sessionArchive:{taskId:e,result:i.sessionArchive}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async reject(e,t,n){let r=n!==void 0&&n.trim().length>0?n.trim():void 0;try{return await this.client.reject(e,r===void 0?{ifVersion:t}:{ifVersion:t,body:r}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async toggleBlocked(e){try{await this.client.update(e.id,{ifVersion:e.version,blocked:!e.blocked}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async toggleChecklistItem(e,t){let n=(e.checklist??[]).map(e=>e.id===t?e.checked?{id:e.id,text:e.text,checked:!1}:{id:e.id,text:e.text,checked:!0,checkedBy:`user`,checkedAt:Date.now(),...e.note===void 0?{}:{note:e.note}}:e);try{await this.client.update(e.id,{ifVersion:e.version,checklist:n}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async fetchDiff(e,t){try{return await this.client.diff(e,t)}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async comment(e,t){try{return await this.client.comment(e,t),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async uploadImage(e){try{return await this.client.uploadImage(e)}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async run(e,t=!1){try{await this.client.run(e,t?{reuse:!0}:{}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async cancel(e){try{await this.client.cancel(e),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async mergeBranch(e){try{let t=await this.client.mergeBranch(e);return await this.refresh(),t.noop===!0?{ok:!0,noop:!0}:t.results===void 0?{ok:!0}:{ok:!0,results:t.results}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async removeWorktree(e,t){try{let n=await this.client.worktreeRemove(e,{deleteBranch:t});return await this.refresh(),n.branchError===void 0?{ok:!0}:{ok:!0,branchError:n.branchError}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}openDiagnostics(){this.setState({diagOpen:!0}),this.client.diagnostics().then(e=>this.setState({diagnostics:e})).catch(e=>this.setState({error:e instanceof Error?e.message:String(e)}))}closeDiagnostics(){this.setState({diagOpen:!1})}openSettings(){this.setState({settingsOpen:!0}),this.client.storage().then(e=>this.setState({storage:e,error:void 0})).catch(e=>this.setState({error:e instanceof Error?e.message:String(e)}))}closeSettings(){this.setState({settingsOpen:!1})}async updateSettings(e){try{return await this.client.updateSettings(e),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async checkStorage(e){try{let t=await this.client.checkStorage(e);return this.setState({storage:t,error:void 0}),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async migrateStorage(e){try{let t=await this.client.migrateStorage(e);return this.setState({storage:t,error:t.warnings.length===0?void 0:t.warnings.join(`
|
|
20
|
+
`)}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async cleanupOrphan(e,t){try{await this.client.worktreeCleanup(e,t);let n=await this.client.diagnostics();this.setState({diagnostics:n,error:void 0})}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async remove(e,t,n){try{await this.client.remove(e,n?{purge:!0}:{ifVersion:t}),n&&this.setState({selectedId:void 0}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async duplicate(e){try{await this.client.create({title:e.title.slice(0,196)+V(`shared.duplicate.suffix`),workspaceId:e.workspaceId,urgency:e.urgency,description:e.description.length>0?e.description:void 0,prompt:e.prompt.length>0?e.prompt:void 0,execution:e.execution.mode===`scheduled`&&e.execution.cron!==void 0?{mode:`scheduled`,cron:e.execution.cron}:{mode:`claim`},model:e.model,isolation:e.isolation,...e.presetId===void 0?{}:{presetId:e.presetId},...e.permission===void 0?{}:{permission:e.permission},...e.checklist!==void 0&&e.checklist.length>0?{checklist:e.checklist.map(e=>e.text)}:{}}),await this.refresh()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async loadTemplates(){try{let e=await this.client.templates();return this.setState({templates:e.templates,error:void 0}),e.templates}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),[]}}prepareTemplateMenu(){this.state.templates.length===0&&this.loadTemplates()}openTemplateManager(){this.setState({tplManagerOpen:!0}),this.loadTemplates()}closeTemplateManager(){this.setState({tplManagerOpen:!1})}async upsertTemplate(e){try{return await this.client.templateUpsert(e),await this.loadTemplates(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}async deleteTemplate(e){try{await this.client.templateDelete(e),await this.loadTemplates()}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}async saveAsTemplate(e){return this.upsertTemplate({name:e.title.slice(0,60),task:{title:e.title,description:e.description.length>0?e.description:void 0,prompt:e.prompt.length>0?e.prompt:void 0,urgency:e.urgency,execution:e.execution.mode===`scheduled`&&e.execution.cron!==void 0?{mode:`scheduled`,cron:e.execution.cron}:{mode:`claim`},model:e.model,isolation:e.isolation,...e.presetId===void 0?{}:{presetId:e.presetId},...e.permission===void 0?{}:{permission:e.permission},...e.checklist!==void 0&&e.checklist.length>0?{checklist:e.checklist.map(e=>e.text)}:{}}})}async fetchPromptCompletions(){try{return await this.client.promptCompletions()}catch{return}}openImport(){this.setState({importOpen:!0})}closeImport(){this.setState({importOpen:!1})}async importPreview(e){try{return(await this.client.importPreview(e)).plan}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}async importCommit(e,t){try{let n=await this.client.importCommit(e,t);return await this.refresh(),n}catch(e){this.setState({error:e instanceof Error?e.message:String(e)});return}}exportJson(){let e=new Date,t=e=>String(e).padStart(2,`0`),n=`dsh-taskboard-${e.getFullYear()}${t(e.getMonth()+1)}${t(e.getDate())}-${t(e.getHours())}${t(e.getMinutes())}.json`,r=JSON.stringify(this.state.ledger,null,2);this.download(n,r,`application/json`)}exportCsv(){let e=e=>{let t=String(e??``);return/^[=+\-@\t\r]/.test(t)&&(t=`'${t}`),/[",\n\r]/.test(t)?`"${t.replace(/"/g,`""`)}"`:t},t=[`id`,`title`,`status`,`urgency`,`blocked`,`project`,`claimedBy`,`mode`,`cron`,`nextRunAt`,`model`,`createdAt`,`updatedAt`,`comments`,`executions`],n=this.state.ledger.tasks.map(t=>[t.id,t.title,t.status,t.urgency,t.blocked?`yes`:`no`,t.workspaceId,t.claimedBy??``,t.execution.mode,t.execution.cron??``,t.execution.nextRunAt===void 0?``:new Date(t.execution.nextRunAt).toISOString(),t.model===void 0?``:`${t.model.provider}/${t.model.model}`,new Date(t.createdAt).toISOString(),new Date(t.updatedAt).toISOString(),t.comments.length,t.executions.length].map(e).join(`,`)),r=new Date,i=e=>String(e).padStart(2,`0`),a=`dsh-taskboard-${r.getFullYear()}${i(r.getMonth()+1)}${i(r.getDate())}.csv`;this.download(a,`\uFEFF${[t.join(`,`),...n].join(`\r
|
|
21
|
+
`)}`,`text/csv`)}download(e,t,n){try{let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=e,a.click(),setTimeout(()=>URL.revokeObjectURL(i),5e3)}catch(e){this.setState({error:e instanceof Error?e.message:String(e)})}}};const ie=`dsh-taskboard-styles`;function ae(){if(typeof document>`u`)return;let e=document.getElementById(ie);e===null&&(e=document.createElement(`style`),e.id=ie,e.textContent=`
|
|
11
22
|
.dsh-atb-entry {
|
|
12
23
|
display: flex; align-items: center; gap: 8px; position: relative;
|
|
13
24
|
width: calc(100% - 8px); margin: 2px 4px; padding: 6px 10px;
|
|
@@ -397,6 +408,27 @@ button.dsh-atb-chip2.dsh-atb-chip-btn:hover {
|
|
|
397
408
|
.dsh-atb-bubble-meta span { font-size: 10.5px; color: var(--dsw-text-secondary, gray); }
|
|
398
409
|
.dsh-atb-bubble-body { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
|
|
399
410
|
|
|
411
|
+
.dsh-atb-markdown-body { white-space: pre-wrap; word-break: break-word; }
|
|
412
|
+
.dsh-atb-detail-img-wrap {
|
|
413
|
+
display: inline-flex; flex-direction: column; gap: 4px; max-width: min(100%, 520px); margin: 6px 8px 6px 0;
|
|
414
|
+
vertical-align: top;
|
|
415
|
+
}
|
|
416
|
+
.dsh-atb-detail-img {
|
|
417
|
+
display: block; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; cursor: zoom-in;
|
|
418
|
+
border: 1px solid var(--dsw-border, rgba(128,128,128,.22)); background: var(--dsw-bg-inset, rgba(128,128,128,.08));
|
|
419
|
+
}
|
|
420
|
+
.dsh-atb-detail-img-caption { font-size: 10.5px; color: var(--dsw-text-secondary, gray); overflow-wrap: anywhere; }
|
|
421
|
+
.dsh-atb-lightbox-backdrop {
|
|
422
|
+
position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 28px;
|
|
423
|
+
background: rgba(0,0,0,.76); backdrop-filter: blur(3px);
|
|
424
|
+
}
|
|
425
|
+
.dsh-atb-lightbox-content { position: relative; max-width: 96vw; max-height: 92vh; }
|
|
426
|
+
.dsh-atb-lightbox-img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 10px; }
|
|
427
|
+
.dsh-atb-lightbox-close {
|
|
428
|
+
position: absolute; top: -14px; right: -14px; width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
|
|
429
|
+
border: 1px solid rgba(255,255,255,.38); background: rgba(20,20,20,.9); color: #fff;
|
|
430
|
+
}
|
|
431
|
+
|
|
400
432
|
.dsh-atb-composer { display: flex; gap: 7px; align-items: flex-end; margin-top: 2px; }
|
|
401
433
|
.dsh-atb-composer-input {
|
|
402
434
|
flex: 1; font: inherit; font-size: 12.5px; line-height: 1.5; padding: 7px 10px; border-radius: 9px;
|
|
@@ -409,6 +441,14 @@ button.dsh-atb-chip2.dsh-atb-chip-btn:hover {
|
|
|
409
441
|
border: 1px solid transparent; background: var(--dsw-alias-button-primary-fill, var(--dsw-alias-brand-primary, #1f2328)); color: var(--dsw-alias-label-primary-foreground, #fff);
|
|
410
442
|
}
|
|
411
443
|
.dsh-atb-composer-send:disabled { opacity: .4; cursor: default; }
|
|
444
|
+
.dsh-atb-image-actions { display: flex; align-items: center; gap: 8px; padding: 5px 1px 0; }
|
|
445
|
+
.dsh-atb-image-add {
|
|
446
|
+
flex: none; font: inherit; font-size: 11.5px; line-height: 1.4; padding: 4px 8px; border-radius: 7px; cursor: pointer;
|
|
447
|
+
border: 1px solid var(--dsw-border, rgba(128,128,128,.3)); background: var(--dsw-bg-elevated, rgba(128,128,128,.08)); color: inherit;
|
|
448
|
+
}
|
|
449
|
+
.dsh-atb-image-add:hover:not(:disabled) { background: var(--dsw-bg-hover, rgba(128,128,128,.14)); }
|
|
450
|
+
.dsh-atb-image-add:disabled { opacity: .45; cursor: default; }
|
|
451
|
+
.dsh-atb-image-hint { font-size: 10.5px; color: var(--dsw-text-secondary, gray); }
|
|
412
452
|
|
|
413
453
|
.dsh-atb-execlist { display: flex; flex-direction: column; gap: 5px; }
|
|
414
454
|
.dsh-atb-exec-row {
|
|
@@ -853,9 +893,13 @@ color: var(--dsw-alias-state-business-primary, #3e63dd);
|
|
|
853
893
|
.dsh-atb-imp-result { font-size: 12px; color: var(--dsw-alias-state-success-primary, #30a46c); margin-top: 10px; }
|
|
854
894
|
.dsh-atb-badge[data-kind="checklist"] { color: var(--dsw-alias-label-secondary, inherit); }
|
|
855
895
|
/* ---------- 0.5.0 board settings ---------- */
|
|
856
|
-
.dsh-atb-set { max-width:
|
|
896
|
+
.dsh-atb-set { max-width: 620px; width: min(620px, 92vw); }
|
|
857
897
|
.dsh-atb-set .dsh-atb-mode-picker { margin-top: 8px; }
|
|
858
898
|
.dsh-atb-set .dsh-atb-isolation-note { margin-top: 10px; }
|
|
899
|
+
.dsh-atb-storage-path { width: 100%; margin-top: 10px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
|
|
900
|
+
.dsh-atb-storage-meta { display: grid; gap: 4px; margin-top: 8px; color: var(--dsh-atb-muted); font-size: 12px; overflow-wrap: anywhere; }
|
|
901
|
+
.dsh-atb-storage-error { color: var(--dsh-atb-danger); }
|
|
902
|
+
.dsh-atb-storage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
|
|
859
903
|
|
|
860
904
|
/* ---------- 0.5.5 SlashPromptInput & Permission Picker ---------- */
|
|
861
905
|
.dsh-atb-perm-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 4px; }
|
|
@@ -932,15 +976,19 @@ color: var(--dsw-alias-state-business-primary, #3e63dd);
|
|
|
932
976
|
.dsh-atb-prompt-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
|
933
977
|
.dsh-atb-prompt-tip { font-size: 11px; color: var(--dsw-alias-label-tertiary, gray); }
|
|
934
978
|
.dsh-atb-prompt-tip code { font-size: 10.5px; padding: 1px 4px; border-radius: 4px; background: rgba(128,128,128,.14); }
|
|
935
|
-
`,document.head.append(e)),e.dataset.plugin=`dsh-taskboard`,e.dataset.pluginCss=`dsh-taskboard/styles`}function
|
|
979
|
+
`,document.head.append(e)),e.dataset.plugin=`dsh-taskboard`,e.dataset.pluginCss=`dsh-taskboard/styles`}function oe(){let e=document.querySelector(`[data-pane="sidebar"], [class*="sidebarCol"], .dshDesktopUpstreamSidebar, .dshDesktopSidebarSurface`);if(e!==null)return e.querySelector(`[class*="logoRow"]`)?.parentElement??e.firstElementChild}function se(e){let t=e.querySelector(`button[class*="newSession"]`);if(t!==null)return t;for(let t of e.children)if(t instanceof HTMLButtonElement&&!t.matches(`[data-dsh-atb-entry]`))return t;let n=e.querySelector(`button[aria-label="新建会话"], button[aria-label="New Session"], button[aria-label*="新会话"], button[aria-label*="new session" i]`);return n===null?Array.from(e.querySelectorAll(`button`)).find(e=>!e.matches(`[data-dsh-atb-entry]`)&&/新会话|新建会话|new session/i.test(e.textContent??``)):n}function ce(e){let t=document.createElement(`button`);return t.type=`button`,t.dataset.dshAtbEntry=``,t.className=`dsh-atb-entry`,t.setAttribute(`aria-label`,V(`shared.entry.aria`)),t.innerHTML=`<span class="dsh-atb-entry-icon"><svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="2" width="12" height="12" rx="2"/><path d="M6 2v12M10 2v12"/></svg></span><span class="dsh-atb-entry-label">${V(`shared.entry.label`)}</span><span class="dsh-atb-entry-stats"></span>`,t.addEventListener(`click`,()=>{e.toggleBoard()}),t}function le(e){let t=0,n=0,r=0;for(let i of e.getSnapshot().ledger.tasks)i.trashedAt===void 0&&(i.status===`todo`?t++:i.status===`in_progress`?n++:i.status===`in_review`&&r++);return[t,n,r]}function ue(e,t){let n=String(t);if(e.dataset.value===n)return;let r=e.dataset.value;if(e.dataset.value=n,e.style.minWidth=`${n.length}ch`,r===void 0){e.textContent=n;return}e.dataset.busy===`1`&&(e.dataset.busy=``,e.dataset.anim=``);let i=document.createElement(`span`);i.className=`dsh-atb-rn`,i.textContent=r;let a=document.createElement(`span`);a.className=`dsh-atb-rn dsh-atb-rn-next`,a.textContent=n,e.replaceChildren(i,a),e.dataset.dir=t>Number(r)?`up`:`down`,e.dataset.busy=`1`,requestAnimationFrame(()=>{e.dataset.anim=`1`});let o=()=>{e.dataset.busy===`1`&&(e.dataset.busy=``,e.dataset.anim=``,e.textContent=e.dataset.value??``)};e.addEventListener(`transitionend`,o,{once:!0}),setTimeout(o,400)}function U(e,t){let n=e.querySelector(`.dsh-atb-entry-stats`);if(n===null)return()=>{};let r=[`todo`,`in_progress`,`in_review`],i=[];for(let e=0;e<3;e++){if(e>0){let e=document.createElement(`span`);e.className=`dsh-atb-entry-sep`,e.textContent=`|`,n.append(e)}let t=document.createElement(`span`);t.className=`dsh-atb-roll`,t.dataset.stat=r[e],n.append(t),i.push(t)}return()=>{let[e,r,a]=le(t);ue(i[0],e),ue(i[1],r),ue(i[2],a),n.title=V(`shared.stats.title`,{todo:e,doing:r,review:a})}}function de(e,t){let n=se(e);if(n===void 0)return!1;if(t.parentElement!==e){let r=n.closest(`[class*="logoRow"]`),i=r!==null&&r.parentElement===e?r:n,a=Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.matches(`[data-dsh-atb-entry], [data-dsh-taskboard-entry], [data-dsh-ssh-entry]`)),o=a.length>0?a[0]??null:i.nextElementSibling??null;e.insertBefore(t,o)}return!0}function W(e){let t=ce(e),n={attempts:0,found:!1,placed:!1},r=globalThis.location?.hostname;(r===`localhost`||r===`127.0.0.1`)&&(window.__atbDebug=n);let i,a=!1,o=()=>{if(n.attempts++,i!==void 0&&!i.isConnected&&(c.disconnect(),i=void 0,a=!1),a){if(document.body.contains(t))return;c.disconnect(),i=void 0,a=!1}i??=oe(),i!==void 0&&(n.found=se(i)!==void 0,a=de(i,t),n.placed=a,a&&c.observe(i,{childList:!0,subtree:!0}))},s=new MutationObserver(()=>{o()});s.observe(document.body,{childList:!0,subtree:!0});let c=new MutationObserver(()=>{if(i===void 0||!i.isConnected){a=!1,o();return}i.contains(t)||(a=de(i,t))}),l=setInterval(()=>{o()},2e3),u=U(t,e),d=()=>{e.getSnapshot().boardOpen?t.dataset.active=`true`:delete t.dataset.active,u()},f=e.subscribe(d),p=z.subscribe(()=>{t.setAttribute(`aria-label`,V(`shared.entry.aria`));let e=t.querySelector(`.dsh-atb-entry-label`);e!==null&&(e.textContent=V(`shared.entry.label`)),u()});return d(),o(),()=>{clearInterval(l),s.disconnect(),c.disconnect(),p(),f(),t.remove()}}const fe={backlog:`status.column.backlog`,todo:`status.column.todo`,in_progress:`status.column.in_progress`,in_review:`status.column.in_review`,done:`status.column.done`,canceled:`status.column.canceled`,archived:`status.column.archived`},G={backlog:`status.pill.backlog`,todo:`status.pill.todo`,in_progress:`status.pill.in_progress`,in_review:`status.pill.in_review`,done:`status.pill.done`,canceled:`status.pill.canceled`,archived:`status.pill.archived`},K={backlog:`status.move.backlog`,todo:`status.move.todo`,in_progress:`status.move.in_progress`,in_review:`status.move.in_review`,done:`status.move.done`,canceled:`status.move.canceled`,archived:`status.move.archived`},q={urgent:`urgency.urgent`,normal:`urgency.normal`,relaxed:`urgency.relaxed`},pe={running:`outcome.running`,succeeded:`outcome.succeeded`,failed:`outcome.failed`,cancelled:`outcome.cancelled`},me=[`tpl-feature`,`tpl-bugfix`,`tpl-release`,`tpl-patrol`],he={zh:{"tpl-feature":{name:`新增功能`,task:{title:`新增:`,prompt:[`实现以上新功能并按序交接:`,`1. 明确需求边界与验收标准,列出实现要点`,`2. 实现功能(含类型定义与错误处理)`,`3. 补充测试(单测/回归)`,`4. 运行相关测试套件确认通过`].join(`
|
|
936
980
|
`),urgency:`normal`,checklist:[`实现要点已明确(需求边界与验收标准)`,`功能已实现并补充测试`,`相关测试套件通过`]}},"tpl-bugfix":{name:`Bug 修复`,task:{title:`修复:`,prompt:[`修复以上问题并按序交接:`,`1. 复现问题(写最小复现步骤或测试)`,`2. 定位根因,说明为什么会发生`,`3. 修复并补回归测试`,`4. 运行相关测试套件确认无回归`].join(`
|
|
937
981
|
`),urgency:`urgent`,checklist:[`已复现并定位根因`,`修复已提交到任务分支`,`回归测试通过`]}},"tpl-release":{name:`发布检查`,task:{title:`发布:`,prompt:`执行发布流程:版本号更新、构建、测试、变更记录,完成后按序交接(不要实际推送/发布,等用户确认)。`,urgency:`normal`,checklist:[`版本号已更新(package.json 与版本常量同步)`,`构建通过`,`全部测试通过`,`变更记录已写`]}},"tpl-patrol":{name:`例行巡检`,task:{title:`巡检:`,prompt:[`例行巡检:检查依赖更新、失败测试、明显代码问题与未处理的告警。`,`发现的问题逐条列出(严重度/位置/建议),小问题直接修复,大问题只报告不动手。`,`输出巡检摘要(用 {{lastComments}} 可回看上次巡检结论)。`].join(`
|
|
938
982
|
`),urgency:`relaxed`,execution:{mode:`scheduled`,cron:`0 9 * * 1`}}}},en:{"tpl-feature":{name:`New feature`,task:{title:`New feature:`,prompt:[`Implement the new feature above and hand off in order:`,`1. Clarify the requirement boundaries and acceptance criteria; list the implementation points`,`2. Implement the feature (including type definitions and error handling)`,`3. Add tests (unit / regression)`,`4. Run the relevant test suites and confirm they pass`].join(`
|
|
939
983
|
`),urgency:`normal`,checklist:[`Implementation points clarified (requirement boundaries and acceptance criteria)`,`Feature implemented with tests added`,`Relevant test suites pass`]}},"tpl-bugfix":{name:`Bug fix`,task:{title:`Fix:`,prompt:[`Fix the issue above and hand off in order:`,`1. Reproduce the issue (write minimal reproduction steps or a test)`,`2. Locate the root cause and explain why it happens`,`3. Fix it and add regression tests`,`4. Run the relevant test suites and confirm there are no regressions`].join(`
|
|
940
984
|
`),urgency:`urgent`,checklist:[`Issue reproduced and root cause located`,`Fix committed to the task branch`,`Regression tests pass`]}},"tpl-release":{name:`Release check`,task:{title:`Release:`,prompt:`Run the release process: bump the version, build, test, and update the changelog, then hand off in order (do not actually push / publish — wait for user confirmation).`,urgency:`normal`,checklist:[`Version bumped (package.json and version constants in sync)`,`Build passes`,`All tests pass`,`Changelog written`]}},"tpl-patrol":{name:`Routine patrol`,task:{title:`Patrol:`,prompt:[`Routine patrol: check dependency updates, failing tests, obvious code issues, and unhandled alerts.`,`List each finding (severity / location / suggestion); fix small issues directly, and only report (do not touch) large ones.`,`Output a patrol summary (use {{lastComments}} to review the last patrol’s conclusions).`].join(`
|
|
941
|
-
`),urgency:`relaxed`,execution:{mode:`scheduled`,cron:`0 9 * * 1`}}}}};function J(e,t){if(pe.includes(e))return me[t][e]}function Y(e){return e.builtin===!0?J(e.id,I.getSnapshot().active)?.name??e.name:e.name}function he(e){return e.builtin===!0?J(e.id,I.getSnapshot().active)?.task??e.task:e.task}function X(e){if(e===void 0)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function ge(e,t){return e.status===`in_progress`&&e.claimedAt!==void 0&&t-e.claimedAt>18e5}const _e=`application/x-dsh-atb-task`;function ve(e){return e===void 0?``:e.replace(/^session-(taskboard-)?/,``).slice(0,8)}function ye({task:t,controller:r,draggable:i=!1,now:a,onAlert:o}){let s=R(),[c,l]=(0,e.useState)(!1),[u,d]=(0,e.useState)(``),f=t.executions.length>0?t.executions[t.executions.length-1]:void 0,p=t.executions.find(e=>e.outcome===`running`),m=a!==void 0&&ge(t,a),h=t.status===`in_review`&&t.trashedAt===void 0,g=[...t.executions].reverse().find(e=>e.sessionId!==void 0),_=p?.sessionId??g?.sessionId??(t.claimedBy?.startsWith(`session-`)?t.claimedBy:void 0),v=()=>{r.reject(t.id,t.version,u).then(e=>{e&&(l(!1),d(``))})};return(0,n.jsxs)(`div`,{role:`button`,tabIndex:0,className:`dsh-atb-card`,"data-urgency":t.urgency,draggable:i&&!c,onDragStart:e=>{if(p!==void 0){e.preventDefault();let n=s(`card.drag.running`,{title:t.title});o===void 0?alert(n):o(n);return}e.dataTransfer.setData(_e,t.id),e.dataTransfer.effectAllowed=`move`,e.currentTarget.dataset.dragging=`true`},onDragEnd:e=>{delete e.currentTarget.dataset.dragging},onClick:()=>r.select(t.id),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r.select(t.id))},children:[(0,n.jsx)(`div`,{className:`dsh-atb-card-title`,children:t.title}),(0,n.jsxs)(`div`,{className:`dsh-atb-card-meta`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-badge`,children:s(q[t.urgency])}),t.blocked&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`blocked`,children:s(`shared.blocked`)}),m&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`stale`,children:s(`card.badge.stale`)}),t.execution.mode===`scheduled`&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,"data-kind":`scheduled`,children:[`⏰ `,X(t.execution.nextRunAt)]}),t.model!==void 0&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,title:s(`card.badge.modelTitle`,{model:t.model.provider+`/`+t.model.model})+(t.model.reasoningEffort===void 0?``:s(`card.badge.modelEffort`,{effort:t.model.reasoningEffort})),children:[t.model.model,t.model.reasoningEffort===void 0?``:` (${t.model.reasoningEffort})`]}),t.permission===`read-only`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`blocked`,title:s(`card.badge.permReadOnlyTitle`),children:s(`card.badge.permReadOnly`)}),t.permission===`danger-full-access`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`urgent`,title:s(`card.badge.permFullTitle`),children:s(`card.badge.permFull`)}),t.checklist!==void 0&&t.checklist.length>0&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,"data-kind":t.status===`in_review`&&t.checklist.some(e=>!e.checked)?`blocked`:`checklist`,title:t.status===`in_review`&&t.checklist.some(e=>!e.checked)?s(`card.badge.checklistReview`):s(`card.badge.checklist`),children:[`☑ `,t.checklist.filter(e=>e.checked).length,`/`,t.checklist.length]}),t.status===`done`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`done`,children:s(`status.pill.done`)}),f!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":f.outcome===`running`?`running`:f.outcome,children:s(fe[f.outcome]??f.outcome)}),_!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-card-session`,title:s(`card.session.jumpTitle`,{id:_}),onClick:e=>{e.stopPropagation(),r.openSession(_).then(e=>{if(e===`missing`){let e=s(`card.session.missing`,{id:ve(_)});o===void 0?alert(e):o(e)}else if(e===`archived`){let e=s(`card.session.archived`,{id:ve(_)});o===void 0?alert(e):o(e)}else if(e===`unavailable`){let e=s(`card.session.unavailable`,{id:_});o===void 0?alert(e):o(e)}})},children:[`🤖 `,ve(_),` ↗`]}),t.comments.length>0&&(0,n.jsxs)(`span`,{children:[`💬 `,t.comments.length]}),t.trashedAt!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`trashed`,children:s(`card.badge.pendingPurge`)}),(0,n.jsx)(`span`,{style:{marginLeft:`auto`},children:X(t.updatedAt)})]}),h&&(c?(0,n.jsxs)(`div`,{className:`dsh-atb-quick-reject`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`input`,{className:`dsh-atb-input dsh-atb-quick-note`,value:u,placeholder:s(`card.reject.placeholder`),autoFocus:!0,spellCheck:!1,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`?v():e.key===`Escape`&&(l(!1),d(``))}}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject-confirm`,onClick:v,children:s(`card.reject.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject-cancel`,onClick:()=>{l(!1),d(``)},children:s(`shared.cancel`)})]}):(0,n.jsxs)(`div`,{className:`dsh-atb-quick`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`done`,title:s(`card.action.doneTitle`),onClick:()=>void r.move(t.id,t.version,`done`),children:s(`card.action.done`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject`,title:s(`card.action.rejectTitle`),onClick:()=>l(!0),children:s(`card.action.reject`)})]}))]})}function be(){let[t,r]=(0,e.useState)(null);return{alert:e=>r(e),el:t===null?null:(0,n.jsx)(xe,{message:t,onClose:()=>r(null)})}}function xe({message:t,onClose:r}){let i=R();return(0,e.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,n.jsx)(`div`,{className:`dsh-atb-alert-backdrop`,onClick:r,children:(0,n.jsxs)(`div`,{className:`dsh-atb-alert`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`div`,{className:`dsh-atb-alert-icon`,children:`⛔`}),(0,n.jsx)(`div`,{className:`dsh-atb-alert-msg`,children:t}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:r,children:i(`alert.ok`)})]})})}function Se(e){return[`backlog`,`todo`,`in_progress`,`in_review`,`done`,`canceled`,`archived`].filter(t=>f(e.status,t))}function Z(e){return e===void 0?``:e.replace(/^session-(taskboard-)?/,``).slice(0,8)}function Ce(e,t){if(t.systemKey===void 0)return t.body;if(t.systemRows!==void 0){let n=t.systemRows.map(t=>{let n=t.repo===``?e(`iso.repo.root`):t.repo,r=t.outcome===`merged`?`✓`:t.outcome===`noop`?`⟲`:`✗`;return t.outcome===`failed`&&t.error!==void 0?`${n} ${r} ${t.error}`:`${n} ${r}`}).join(` · `);return e(t.systemKey,{summary:n})}return e(t.systemKey,t.systemParams)}function we(e,t){if(e===void 0||t===void 0)return``;let n=Math.max(0,Math.round((t-e)/1e3));return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m${n%60}s`:`${Math.floor(n/3600)}h${Math.floor(n%3600/60)}m`}function Q({icon:e,children:t,tone:r,title:i}){return(0,n.jsxs)(`span`,{className:`dsh-atb-chip2`,"data-tone":r,title:i,children:[e!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-chip2-icon`,children:e}),t]})}function Te({text:t}){let r=R(),[i,a]=(0,e.useState)(null),o=/!\[(.*?)\]\(((?:data:image\/[^)]+)|(?:https?:\/\/[^)]+)|(?:[^)]+\.(?:png|jpg|jpeg|gif|webp|svg)))\)/gi,s=[],c=0,l,u=0;for(;(l=o.exec(t))!==null;){l.index>c&&s.push((0,n.jsx)(`span`,{children:t.slice(c,l.index)},`txt-${c}`));let e=l[1]||r(`md.imageAlt`,{n:++u}),i=l[2]??``;s.push((0,n.jsxs)(`div`,{className:`dsh-atb-detail-img-wrap`,children:[(0,n.jsx)(`img`,{src:i,alt:e,className:`dsh-atb-detail-img`,onClick:()=>a(i),title:r(`md.imageTitle`,{alt:e})}),(0,n.jsx)(`span`,{className:`dsh-atb-detail-img-caption`,children:e})]},`img-${l.index}`)),c=o.lastIndex}return c<t.length&&s.push((0,n.jsx)(`span`,{children:t.slice(c)},`txt-${c}`)),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-markdown-body`,children:s}),i!==null&&(0,n.jsx)(`div`,{className:`dsh-atb-lightbox-backdrop`,onClick:()=>a(null),children:(0,n.jsxs)(`div`,{className:`dsh-atb-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`img`,{src:i,alt:r(`md.lightboxAlt`),className:`dsh-atb-lightbox-img`}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-lightbox-close`,title:r(`md.closePreview`),onClick:()=>a(null),children:`✕`})]})})]})}function Ee(e){return[...e.executions].reverse().find(e=>e.isolation!==void 0||e.worktreePath!==void 0||e.isolationNote!==void 0)}function De(e){return e===void 0?``:e.slice(0,8)}function Oe(e){let t=e.slice(3),n=t.indexOf(` -> `);return n>=0&&(t=t.slice(n+4)),t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>1&&(t=t.slice(1,-1)),t}function ke({controller:t,task:r,execution:i,commit:a,path:o,repo:s}){let c=R(),[l,u]=(0,e.useState)({loading:!0});return(0,e.useEffect)(()=>{let e=!0;return u({loading:!0}),t.fetchDiff(r.id,{execution:i.id,...a===void 0?{path:o??``}:{commit:a},...s===void 0?{}:{repo:s}}).then(t=>{e&&u(t===void 0?{loading:!1,failed:!0}:{loading:!1,diff:t.diff,truncated:t.truncated})}),()=>{e=!1}},[t,r.id,i.id,a,o,s]),(0,n.jsxs)(`div`,{className:`dsh-atb-diffview`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diffview-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-diffview-title`,children:a===void 0?c(`diff.file`,{path:o??``}):c(`diff.commit`,{hash:De(a)})}),l.loading&&(0,n.jsx)(`span`,{className:`dsh-atb-diffview-hint`,children:c(`shared.loading`)}),l.truncated===!0&&(0,n.jsx)(`span`,{className:`dsh-atb-diffview-hint`,children:c(`diff.truncated`)})]}),l.failed===!0?(0,n.jsx)(`div`,{className:`dsh-atb-diffview-error`,children:c(`diff.failed`)}):(0,n.jsx)(`pre`,{className:`dsh-atb-diffview-pre`,children:l.diff??``})]})}function Ae({task:e,controller:t}){let r=R(),i=e.checklist??[];if(i.length===0)return null;let{done:a,total:o}=S(e),s=o-a,c=e.status===`in_review`;return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`checklist`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard-label`,children:[r(`checklist.title`),(0,n.jsxs)(`span`,{className:`dsh-atb-cl-progress`,"data-tone":c&&s>0?`bad`:void 0,children:[`☑ `,a,`/`,o,c&&s>0?r(`checklist.unchecked`,{n:s}):a===o?r(`checklist.allDone`):``]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-cl-items`,children:i.map(i=>(0,n.jsxs)(`label`,{className:`dsh-atb-cl-item`,"data-checked":i.checked?`true`:void 0,"data-alert":c&&!i.checked?`true`:void 0,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:i.checked,onChange:()=>void t.toggleChecklistItem(e,i.id)}),(0,n.jsx)(`span`,{className:`dsh-atb-cl-text`,children:i.text}),(0,n.jsxs)(`span`,{className:`dsh-atb-cl-meta`,children:[i.checked?`${i.checkedBy===`user`?r(`checklist.byUser`):`🤖 ${Z(i.checkedBy)}`} · ${X(i.checkedAt)}`:r(`checklist.uncheckedItem`),i.note!==void 0&&i.note.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-cl-note`,title:i.note,children:r(`checklist.evidence`,{note:i.note})})]})]},i.id))})]})}function je({task:e}){let t=R(),r=[...e.executions].reverse().find(e=>e.report!==void 0),i=r?.report;if(r===void 0||i===void 0)return null;let a=(e,t)=>t!==void 0&&t.length>0?(0,n.jsxs)(`div`,{className:`dsh-atb-rpt-sec`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-rpt-label`,children:e}),(0,n.jsx)(`ul`,{className:`dsh-atb-rpt-list`,children:t.map((e,t)=>(0,n.jsx)(`li`,{children:e},t))})]}):null;return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`report`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard-label`,children:[t(`report.title`),(0,n.jsx)(`span`,{className:`dsh-atb-cl-progress`,children:t(`report.submitted`,{time:X(r.endedAt??r.startedAt)})})]}),(0,n.jsx)(`div`,{className:`dsh-atb-rpt-summary`,children:i.summary}),a(t(`report.changedFiles`),i.changedFiles),a(t(`report.checks`),i.checks),a(t(`report.artifacts`),i.artifacts),i.risk.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-rpt-sec`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-rpt-label`,children:t(`report.risk`)}),(0,n.jsx)(`div`,{className:`dsh-atb-rpt-risk`,children:i.risk})]})]})}function Me({task:t,controller:r}){let i=R(),{alert:a,el:o}=be(),[s,c]=(0,e.useState)(!1),[l,u]=(0,e.useState)(null),[d,f]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null),[h,g]=(0,e.useState)(!1),_=Ee(t),v=t.executions.some(e=>e.outcome===`running`);if(_===void 0)return null;let y=()=>{f(!0),r.mergeBranch(t.id).then(e=>{if(f(!1),c(!1),!e.ok)a(i(`iso.merge.failed`,{error:e.error}));else if(e.results!==void 0){let t=e=>e===``?i(`iso.repo.root`):e,n=e.results.map(e=>`${t(e.repo)} ${e.outcome===`merged`?`✓`:e.outcome===`noop`?`⟲`:`✗`}`).join(` · `),r=e.results.some(e=>e.outcome===`failed`),o=e.results.find(e=>e.outcome===`failed`)?.error;a(r?i(`iso.merge.partial`,{summary:n,error:o??``}):i(`iso.merge.done`,{summary:n}))}else e.noop===!0&&a(i(`iso.merge.noop`))})},b=e=>{f(!0),r.removeWorktree(t.id,e).then(e=>{f(!1),u(null),e.ok?e.branchError!==void 0&&a(i(`iso.remove.branchFailed`,{error:e.branchError})):a(i(`iso.remove.failed`,{error:e.error}))})};if(_.isolation!==`worktree`||_.worktreePath===void 0)return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`isolation`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:i(`iso.title`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-none`,children:[i(`iso.none`),_.isolationNote===void 0?``:` · ${_.isolationNote}`]}),o]});let x=_.repos!==void 0&&_.repos.length>0,S=x?(_.repos??[]).map(e=>({repo:e.repo,label:e.repo===``?i(`iso.repo.root`):e.repo,branch:e.branch,worktreePath:e.worktreePath,baseCommit:e.baseCommit,headCommit:e.headCommit,commits:e.commits??[],commitTotal:e.commitsTotal??(e.commits??[]).length,dirty:e.dirtyFiles??[],dirtyTotal:e.dirtyFilesTotal??(e.dirtyFiles??[]).length,...e.diffStat===void 0?{}:{diffStat:e.diffStat},...e.changedFiles===void 0?{}:{changedFiles:e.changedFiles}})):[{label:i(`iso.repo.root`),branch:_.branch??t.branch,worktreePath:_.worktreePath,baseCommit:_.baseCommit,headCommit:_.headCommit,commits:_.commits??[],commitTotal:_.commitsTotal??(_.commits??[]).length,dirty:_.dirtyFiles??[],dirtyTotal:_.dirtyFilesTotal??(_.dirtyFiles??[]).length,..._.diffStat===void 0?{}:{diffStat:_.diffStat},..._.changedFiles===void 0?{}:{changedFiles:_.changedFiles}}];return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`isolation`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:i(`iso.worktreeTitle`)}),S.map(e=>(0,n.jsxs)(`section`,{className:`dsh-atb-iso-repo`,"data-multi":x?`true`:void 0,children:[x&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-repohead`,title:e.worktreePath,children:[(0,n.jsx)(`code`,{children:e.label}),(0,n.jsxs)(`span`,{className:`dsh-atb-iso-fact`,children:[i(`iso.branch`),` `,(0,n.jsx)(`b`,{children:e.branch})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-facts`,children:[!x&&(0,n.jsxs)(`span`,{className:`dsh-atb-iso-fact`,title:e.worktreePath,children:[i(`iso.branch`),` `,(0,n.jsx)(`b`,{children:e.branch})]}),(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,children:i(`iso.baseline`,{base:De(e.baseCommit),head:De(e.headCommit)})}),e.changedFiles!==void 0&&e.changedFiles>0&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,children:i(`iso.changed`,{n:e.changedFiles})}),e.diffStat!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,title:e.diffStat,children:e.diffStat})]}),e.commits.length>0?(0,n.jsxs)(`div`,{className:`dsh-atb-iso-commits`,children:[e.commits.slice(0,10).map(a=>(0,n.jsxs)(`div`,{className:`dsh-atb-iso-commit`,"data-open":p?.commit===a.hash&&p?.repo===e.repo?`true`:void 0,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-commit-btn`,title:i(`iso.commit.openTitle`),onClick:()=>m(p?.commit===a.hash&&p?.repo===e.repo?null:{commit:a.hash,...e.repo===void 0?{}:{repo:e.repo}}),children:[(0,n.jsx)(`code`,{children:De(a.hash)}),(0,n.jsx)(`span`,{children:a.subject})]}),p?.commit===a.hash&&p?.repo===e.repo&&(0,n.jsx)(ke,{controller:r,task:t,execution:_,commit:a.hash,repo:e.repo})]},a.hash)),e.commitTotal>10&&(0,n.jsx)(`div`,{className:`dsh-atb-iso-more`,children:i(`iso.commits.more`,{n:e.commitTotal})})]}):(0,n.jsx)(`div`,{className:`dsh-atb-iso-nocommit`,children:i(`iso.nocommit`)}),e.dirtyTotal>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-dirty`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-dirty-toggle`,onClick:()=>g(!h),children:[i(`iso.dirty.toggle`,{n:e.dirtyTotal}),i(h?`iso.dirty.collapse`:`iso.dirty.expand`)]}),h&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-dirty-files`,children:[e.dirty.slice(0,30).map((t,r)=>{let a=Oe(t);return(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-dirty-file`,title:i(`iso.dirty.openTitle`),onClick:()=>m(p?.path===a&&p?.repo===e.repo?null:{path:a,...e.repo===void 0?{}:{repo:e.repo}}),children:[(0,n.jsx)(`code`,{children:t.slice(0,2)}),` `,a]},`${t}-${r}`)}),e.dirtyTotal>30&&(0,n.jsx)(`div`,{className:`dsh-atb-iso-more`,children:i(`iso.dirty.more`,{n:e.dirtyTotal})})]}),p?.path!==void 0&&p?.repo===e.repo&&h&&(0,n.jsx)(ke,{controller:r,task:t,execution:_,path:p.path,repo:e.repo})]})]},e.repo??`root`)),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-actions`,children:[v?(0,n.jsx)(`span`,{className:`dsh-atb-iso-hint`,children:i(`iso.hint.running`)}):s?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:i(`iso.merge.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:d,onClick:y,children:i(`iso.merge.go`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>c(!1),children:i(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:d,title:i(`iso.merge.title`),onClick:()=>c(!0),children:i(`iso.merge.button`)}),!v&&(l===null?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,title:i(`iso.remove.wtTitle`),onClick:()=>u(`wt`),children:i(`iso.remove.wt`)}),t.branch!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,title:i(`iso.remove.wtbTitle`),onClick:()=>u(`wtb`),children:i(`iso.remove.wtb`)})]}):(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:i(l===`wtb`?`iso.remove.confirmWtb`:`iso.remove.confirmWt`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,onClick:()=>b(l===`wtb`),children:i(`shared.confirmDelete`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>u(null),children:i(`shared.cancel`)})]})),!v&&l===null&&!s&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-hint`,children:i(`iso.hint.keep`)})]}),o]})}function Ne({task:t,controller:r,now:i}){let a=R(),[o,s]=(0,e.useState)(``),[c,l]=(0,e.useState)(!1),[u,d]=(0,e.useState)(!1),[f,p]=(0,e.useState)(!1),[m,h]=(0,e.useState)(!1),[g,_]=(0,e.useState)(!1),{alert:v,el:y}=be(),b=r.getSnapshot().workspaces.find(e=>e.id===t.workspaceId),C=t.status!==`in_progress`&&t.status!==`done`&&t.status!==`archived`,w=t.executions.find(e=>e.outcome===`running`),T=t.status===`in_progress`?t.claimedBy:void 0,E=i!==void 0&&ge(t,i),D=(t.checklist??[]).filter(e=>!e.checked).length,O=[...t.executions].reverse().find(e=>e.sessionId!==void 0),k=w?.sessionId??O?.sessionId??(t.claimedBy?.startsWith(`session-`)?t.claimedBy:void 0),A=x(t),j=r.getSnapshot(),M=j.sessionArchive?.taskId===t.id?j.sessionArchive.result:void 0,N=e=>{g||(_(!0),e().catch(()=>void 0).finally(()=>_(!1)))},P=e=>{r.openSession(e).then(t=>{t===`missing`?v(a(`card.session.missing`,{id:Z(e)})):t===`archived`?v(a(`card.session.archived`,{id:Z(e)})):t===`unavailable`&&v(a(`card.session.unavailable`,{id:e}))})};return(0,n.jsxs)(`div`,{className:`dsh-atb-detail`,"data-urgency":t.urgency,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-head`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-titlewrap`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-titlebar`,children:[(0,n.jsx)(`h3`,{children:t.title}),(0,n.jsx)(`span`,{className:`dsh-atb-statuspill`,"data-status":t.status,children:a(G[t.status]??t.status)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-detail-chips`,children:[(0,n.jsxs)(Q,{tone:t.urgency,children:[`● `,a(q[t.urgency]??t.urgency)]}),(0,n.jsx)(Q,{icon:`📁`,children:b?.title??Z(t.workspaceId)}),t.model!==void 0&&(0,n.jsxs)(Q,{icon:`✦`,title:a(`card.badge.modelTitle`,{model:t.model.provider+`/`+t.model.model})+(t.model.reasoningEffort===void 0?``:a(`card.badge.modelEffort`,{effort:t.model.reasoningEffort})),children:[t.model.model,t.model.reasoningEffort===void 0?``:` · ${t.model.reasoningEffort}`]}),t.presetId!==void 0&&(0,n.jsx)(Q,{icon:`🎛`,children:t.presetId}),t.execution.mode===`scheduled`&&(0,n.jsx)(Q,{icon:`⏰`,children:a(`detail.chip.nextRun`,{cron:t.execution.cron??``,time:X(t.execution.nextRunAt)})}),t.blocked&&(0,n.jsx)(Q,{icon:`⛔`,tone:`urgent`,children:a(`shared.blocked`)}),t.checklist!==void 0&&t.checklist.length>0&&(0,n.jsx)(Q,{icon:`☑`,tone:t.status===`in_review`&&t.checklist.some(e=>!e.checked)?`urgent`:void 0,children:a(`detail.chip.checklist`,{done:S(t).done,total:t.checklist.length})}),t.branch!==void 0&&(0,n.jsxs)(Q,{icon:`🌿`,tone:void 0,children:[`Worktree · `,t.branch.length>28?`${t.branch.slice(0,28)}…`:t.branch]}),(t.isolation===void 0||t.isolation===`worktree`)&&t.branch===void 0&&(0,n.jsx)(Q,{icon:`🌿`,children:a(`detail.chip.isolated`)}),t.permission===`read-only`&&(0,n.jsx)(Q,{icon:`🔒`,tone:`urgent`,children:a(`detail.chip.permReadOnly`)}),t.permission===`danger-full-access`&&(0,n.jsx)(Q,{icon:`⚡`,tone:`urgent`,children:a(`detail.chip.permFull`)}),(t.permission===`workspace-write`||t.permission===void 0)&&(0,n.jsx)(Q,{icon:`📁`,children:a(`detail.chip.permWrite`)}),T!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-chip2 dsh-atb-chip-btn`,"data-tone":E?`urgent`:void 0,title:a(`detail.chip.holderTitle`,{id:T}),onClick:()=>P(T),children:[(0,n.jsx)(`span`,{className:`dsh-atb-chip2-icon`,children:E?`⏱`:`🤖`}),a(E?`detail.chip.holderStale`:`detail.chip.holderBy`),Z(T),a(`detail.chip.holderSuffix`)]}),t.trashedAt!==void 0&&(0,n.jsx)(Q,{icon:`🗑`,tone:`urgent`,children:a(`detail.chip.trashed`)}),(0,n.jsxs)(Q,{children:[`v`,t.version]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-detail-sub`,children:a(`detail.sub.line`,{time:X(t.updatedAt),who:t.updatedBy.kind===`agent`?`🤖 ${Z(t.updatedBy.sessionId)}`:t.updatedBy.kind===`system`?a(`detail.updatedBy.system`):a(`detail.updatedBy.user`)})})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-detail-topbtns`,children:[k!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-session`,title:a(`detail.session.jumpTitle`,{id:k}),onClick:()=>P(k),children:a(`detail.session.jump`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,onClick:()=>r.openEditor(t.id),children:a(`detail.action.edit`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,title:a(`detail.action.duplicateTitle`),disabled:g,onClick:()=>N(()=>r.duplicate(t)),children:a(`detail.action.duplicate`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,title:a(`detail.action.saveTplTitle`),disabled:g,onClick:()=>N(async()=>{await r.saveAsTemplate(t)&&v(a(`detail.action.saveTplDone`))}),children:a(`detail.action.saveTpl`)}),C&&t.branch!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,title:a(`detail.action.reuseTitle`),disabled:g,onClick:()=>N(()=>r.run(t.id,!0)),children:a(`detail.action.reuse`)}),C&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,title:t.model===void 0?a(`detail.action.runTitleDefault`):a(`detail.action.runTitleModel`,{model:t.model.model}),disabled:g,onClick:()=>N(()=>r.run(t.id)),children:a(`detail.action.run`)}),w!==void 0&&(f?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:a(`detail.action.stopConfirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{r.cancel(t.id),p(!1)},children:a(`detail.action.stop`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>p(!1),children:a(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,"data-danger":`true`,title:a(`detail.action.stopTitle`,{id:w.sessionId??``}),onClick:()=>p(!0),children:a(`detail.action.stopExec`)})),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-close`,"aria-label":a(`shared.close`),onClick:()=>r.select(void 0),children:`✕`})]})]}),t.description.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:a(`detail.field.description`)}),(0,n.jsx)(`div`,{className:`dsh-atb-desc`,children:(0,n.jsx)(Te,{text:t.description})})]}),t.prompt.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`prompt`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:a(`detail.field.prompt`)}),(0,n.jsx)(`div`,{className:`dsh-atb-promptbox`,children:(0,n.jsx)(Te,{text:t.prompt})})]}),(0,n.jsx)(Me,{task:t,controller:r}),(0,n.jsx)(je,{task:t}),(0,n.jsx)(Ae,{task:t,controller:r}),M!==void 0&&(0,n.jsxs)(`div`,{role:`status`,className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{children:a(`detail.move.archiveResult`,{n:M.archived.length})}),M.failed.map(e=>(0,n.jsxs)(`span`,{children:[e.sessionId,`: `,e.error]},e.sessionId)),M.unsupported.length>0&&(0,n.jsxs)(`span`,{children:[a(`detail.move.archiveUnsupported`),` `,M.unsupported.join(`, `)]})]}),t.status===`archived`&&A.length>0&&j.archiveSessionsSupported&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:g,onClick:()=>N(()=>r.retryArchiveSessions(t.id)),children:a(`detail.move.archiveRetry`)}),(0,n.jsx)(`div`,{className:`dsh-atb-detail-actions`,children:(0,n.jsxs)(`div`,{className:`dsh-atb-movebtns`,children:[Se(t).map(e=>e===`done`?c?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,"data-tone":D>0?`bad`:void 0,children:D>0?a(`detail.move.confirmDoneUnchecked`,{n:D}):a(`detail.move.confirmDone`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{r.move(t.id,t.version,`done`),l(!1)},children:a(`detail.move.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>l(!1),children:a(`shared.cancel`)})]},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>{l(!0),h(!1)},children:a(`detail.move.to`,{status:a(K[e])})},e):e===`archived`?m?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:A.length===1?a(`detail.move.confirmArchiveSessionWithId`,{id:Z(A[0])}):A.length>1?a(`detail.move.confirmArchiveSessionCount`,{n:A.length}):a(`detail.move.confirmArchive`)}),A.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:A.join(`, `)}),A.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:!j.archiveSessionsSupported||g,title:j.archiveSessionsSupported?void 0:a(`detail.move.archiveUnsupported`),onClick:()=>{N(()=>r.move(t.id,t.version,`archived`,{archiveSessions:!0})),h(!1)},children:a(`detail.move.archiveWithSession`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>{N(()=>r.move(t.id,t.version,`archived`,{archiveSessions:!1})),h(!1)},children:a(`detail.move.archiveCardOnly`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{r.move(t.id,t.version,`archived`),h(!1)},children:a(`detail.move.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>h(!1),children:a(`shared.cancel`)})]},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>{h(!0),l(!1)},children:a(`detail.move.to`,{status:a(K[e])})},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>void r.move(t.id,t.version,e),children:a(`detail.move.to`,{status:a(K[e])})},e)),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":`blocked`,onClick:()=>void r.toggleBlocked(t),children:t.blocked?a(`detail.blocked.unmark`):a(`detail.blocked.mark`)}),T!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":`release`,title:a(`detail.release.title`,{id:T}),onClick:()=>void r.move(t.id,t.version,`todo`),children:a(`detail.release.button`)})]})}),(0,n.jsxs)(`div`,{className:`dsh-atb-section`,children:[(0,n.jsxs)(`h4`,{children:[a(`detail.comments.title`),t.comments.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-count2`,children:t.comments.length})]}),t.comments.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:a(`detail.comments.empty`)}):(0,n.jsx)(`div`,{className:`dsh-atb-commentlist`,children:t.comments.map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-bubble`,"data-from":e.threadId===void 0?`user`:`agent`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-bubble-avatar`,children:e.threadId===void 0?`👤`:`🤖`}),(0,n.jsxs)(`div`,{className:`dsh-atb-bubble-main`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-bubble-meta`,children:[(0,n.jsx)(`b`,{children:e.threadId===void 0?a(`detail.comments.user`):`agent ${Z(e.threadId)}`}),(0,n.jsx)(`span`,{children:X(e.createdAt)})]}),(0,n.jsx)(`div`,{className:`dsh-atb-bubble-body`,children:Ce(a,e)})]})]},e.id))}),(0,n.jsxs)(`div`,{className:`dsh-atb-composer`,children:[(0,n.jsx)(`textarea`,{className:`dsh-atb-composer-input`,value:o,placeholder:a(`detail.composer.placeholder`),onChange:e=>s(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&o.trim().length>0&&r.comment(t.id,o).then(e=>{e&&s(``)})}}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-composer-send`,disabled:o.trim().length===0,onClick:()=>{r.comment(t.id,o).then(e=>{e&&s(``)})},children:a(`detail.composer.send`)})]})]}),t.executions.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-section`,children:[(0,n.jsxs)(`h4`,{children:[a(`detail.exec.title`),(0,n.jsx)(`span`,{className:`dsh-atb-count2`,children:t.executions.length}),t.executionsPruned!==void 0&&t.executionsPruned>0&&(0,n.jsx)(`span`,{className:`dsh-atb-count2`,title:a(`detail.exec.prunedTitle`,{n:t.executionsPruned}),children:a(`detail.exec.pruned`,{n:t.executionsPruned})})]}),(0,n.jsx)(`div`,{className:`dsh-atb-execlist`,children:[...t.executions].reverse().map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-exec-row`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-exec-dot`,"data-outcome":e.outcome}),(0,n.jsx)(`span`,{className:`dsh-atb-exec-trigger`,children:e.trigger===`manual`?a(`detail.exec.trigger.manual`):a(`detail.exec.trigger.scheduled`)}),(0,n.jsx)(`span`,{className:`dsh-atb-exec-outcome`,"data-outcome":e.outcome,children:a(fe[e.outcome]??e.outcome)}),(0,n.jsxs)(`span`,{className:`dsh-atb-exec-time`,children:[X(e.startedAt),e.endedAt!==void 0&&` · ${we(e.startedAt,e.endedAt)}`]}),e.sessionId!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-exec-session`,title:a(`detail.exec.openTitle`,{id:e.sessionId}),onClick:()=>P(e.sessionId),children:[`🤖 `,Z(e.sessionId),` ↗`]}),e.error!==void 0&&(0,n.jsxs)(`span`,{className:`dsh-atb-exec-error`,title:e.error,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]},e.id))})]}),(0,n.jsx)(`div`,{className:`dsh-atb-dangerzone`,children:t.trashedAt===void 0?(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>void r.remove(t.id,t.version,!1),children:a(`detail.danger.delete`)}):u?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:a(`detail.danger.purgeConfirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{r.remove(t.id,t.version,!0),d(!1)},children:a(`detail.danger.purgeGo`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>d(!1),children:a(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>d(!0),children:a(`detail.danger.purge`)})}),y]})}const Pe=e=>[{name:`goal`,kind:`command`,description:e(`slash.cmd.goal.desc`),hint:e(`slash.cmd.goal.hint`)},{name:`schedule`,kind:`command`,description:e(`slash.cmd.schedule.desc`),hint:e(`slash.cmd.schedule.hint`)},{name:`plan`,kind:`command`,description:e(`slash.cmd.plan.desc`)},{name:`browser`,kind:`command`,description:e(`slash.cmd.browser.desc`)},{name:`grill-me`,kind:`command`,description:e(`slash.cmd.grill-me.desc`)},{name:`teamwork-preview`,kind:`command`,description:e(`slash.cmd.teamwork-preview.desc`)},{name:`learn`,kind:`command`,description:e(`slash.cmd.learn.desc`)},{name:`review`,kind:`command`,description:e(`slash.cmd.review.desc`)},{name:`security`,kind:`command`,description:e(`slash.cmd.security.desc`)},{name:`permission`,kind:`command`,description:e(`slash.cmd.permission.desc`),hint:e(`slash.cmd.permission.hint`)}],Fe=e=>[{name:`frontend-ui-engineering`,kind:`skill`,description:e(`slash.skill.frontend-ui-engineering`)},{name:`api-and-interface-design`,kind:`skill`,description:e(`slash.skill.api-and-interface-design`)},{name:`test-driven-development`,kind:`skill`,description:e(`slash.skill.test-driven-development`)},{name:`debugging-and-error-recovery`,kind:`skill`,description:e(`slash.skill.debugging-and-error-recovery`)},{name:`performance-optimization`,kind:`skill`,description:e(`slash.skill.performance-optimization`)},{name:`ci-cd-and-automation`,kind:`skill`,description:e(`slash.skill.ci-cd-and-automation`)},{name:`code-review-and-quality`,kind:`skill`,description:e(`slash.skill.code-review-and-quality`)},{name:`code-simplification`,kind:`skill`,description:e(`slash.skill.code-simplification`)},{name:`context-engineering`,kind:`skill`,description:e(`slash.skill.context-engineering`)},{name:`doubt-driven-development`,kind:`skill`,description:e(`slash.skill.doubt-driven-development`)},{name:`git-workflow-and-versioning`,kind:`skill`,description:e(`slash.skill.git-workflow-and-versioning`)},{name:`idea-refine`,kind:`skill`,description:e(`slash.skill.idea-refine`)},{name:`incremental-implementation`,kind:`skill`,description:e(`slash.skill.incremental-implementation`)},{name:`interview-me`,kind:`skill`,description:e(`slash.skill.interview-me`)},{name:`memory-leak-debugging`,kind:`skill`,description:e(`slash.skill.memory-leak-debugging`)},{name:`observability-and-instrumentation`,kind:`skill`,description:e(`slash.skill.observability-and-instrumentation`)},{name:`planning-and-task-breakdown`,kind:`skill`,description:e(`slash.skill.planning-and-task-breakdown`)},{name:`security-and-hardening`,kind:`skill`,description:e(`slash.skill.security-and-hardening`)},{name:`shipping-and-launch`,kind:`skill`,description:e(`slash.skill.shipping-and-launch`)},{name:`source-driven-development`,kind:`skill`,description:e(`slash.skill.source-driven-development`)},{name:`spec-driven-development`,kind:`skill`,description:e(`slash.skill.spec-driven-development`)},{name:`using-agent-skills`,kind:`skill`,description:e(`slash.skill.using-agent-skills`)}];function Ie({value:t,onChange:i,controller:a,placeholder:o,rows:s=4,maxLength:c=8e3,disabled:l=!1,autoFocus:u=!1,className:d,ariaLabel:f}){let p=R(),m=(0,e.useRef)(null),h=(0,e.useRef)(null),g=(0,e.useRef)(null),[_,v]=(0,e.useState)({}),[y,b]=(0,e.useState)(void 0),x=(0,e.useMemo)(()=>{let e=(e,t)=>{let n=new Map;for(let t of e)n.set(t.name,t);for(let e of t??[])n.set(e.name,e);return Array.from(n.values())};return{commands:e(Pe(p),y?.commands),skills:e(Fe(p),y?.skills)}},[p,y]),[S,C]=(0,e.useState)(!1),[w,T]=(0,e.useState)(``),[E,D]=(0,e.useState)(-1),[O,k]=(0,e.useState)(0);(0,e.useEffect)(()=>{if(a===void 0)return;let e=!0;return a.fetchPromptCompletions().then(t=>{!e||t===void 0||b({commands:t.commands.map(e=>({...e,kind:`command`})),skills:t.skills.map(e=>({...e,kind:`skill`}))})}),()=>{e=!1}},[a]);let A=(0,e.useMemo)(()=>{let e=w.toLowerCase().trim(),t=[...x.commands,...x.skills];return e.length===0?t:t.filter(t=>t.name.toLowerCase().includes(e)||t.description!==void 0&&t.description.toLowerCase().includes(e))},[x,w]);(0,e.useEffect)(()=>{O>=A.length&&k(Math.max(0,A.length-1))},[A.length,O]),(0,e.useLayoutEffect)(()=>{if(!S)return;let e=g.current,t=e?.children[O];if(e===null||!(t instanceof HTMLElement))return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.top<n.top?e.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(e.scrollTop+=r.bottom-n.bottom)},[S,O,A]);let j=()=>{let e=m.current;if(e===null)return;let t=e.selectionStart,n=e.value.slice(0,t),r=n.lastIndexOf(`/`);if(r>=0){let e=r>0?n[r-1]??`
|
|
985
|
+
`),urgency:`relaxed`,execution:{mode:`scheduled`,cron:`0 9 * * 1`}}}}};function ge(e,t){if(me.includes(e))return he[t][e]}function J(e){return e.builtin===!0?ge(e.id,z.getSnapshot().active)?.name??e.name:e.name}function Y(e){return e.builtin===!0?ge(e.id,z.getSnapshot().active)?.task??e.task:e.task}function X(e){if(e===void 0)return``;let t=new Date(e),n=e=>String(e).padStart(2,`0`);return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function _e(e,t){return e.status===`in_progress`&&e.claimedAt!==void 0&&t-e.claimedAt>18e5}const ve=`application/x-dsh-atb-task`;function ye(e){return e===void 0?``:e.replace(/^session-(taskboard-)?/,``).slice(0,8)}function be({task:t,controller:r,draggable:i=!1,now:a,onAlert:o}){let s=H(),[c,l]=(0,e.useState)(!1),[u,d]=(0,e.useState)(``),f=t.executions.length>0?t.executions[t.executions.length-1]:void 0,p=t.executions.find(e=>e.outcome===`running`),m=a!==void 0&&_e(t,a),h=t.status===`in_review`&&t.trashedAt===void 0,g=[...t.executions].reverse().find(e=>e.sessionId!==void 0),_=p?.sessionId??g?.sessionId??(t.claimedBy?.startsWith(`session-`)?t.claimedBy:void 0),v=()=>{r.reject(t.id,t.version,u).then(e=>{e&&(l(!1),d(``))})};return(0,n.jsxs)(`div`,{role:`button`,tabIndex:0,className:`dsh-atb-card`,"data-urgency":t.urgency,draggable:i&&!c,onDragStart:e=>{if(p!==void 0){e.preventDefault();let n=s(`card.drag.running`,{title:t.title});o===void 0?alert(n):o(n);return}e.dataTransfer.setData(ve,t.id),e.dataTransfer.effectAllowed=`move`,e.currentTarget.dataset.dragging=`true`},onDragEnd:e=>{delete e.currentTarget.dataset.dragging},onClick:()=>r.select(t.id),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r.select(t.id))},children:[(0,n.jsx)(`div`,{className:`dsh-atb-card-title`,children:t.title}),(0,n.jsxs)(`div`,{className:`dsh-atb-card-meta`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-badge`,children:s(q[t.urgency])}),t.blocked&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`blocked`,children:s(`shared.blocked`)}),m&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`stale`,children:s(`card.badge.stale`)}),t.execution.mode===`scheduled`&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,"data-kind":`scheduled`,children:[`⏰ `,X(t.execution.nextRunAt)]}),t.model!==void 0&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,title:s(`card.badge.modelTitle`,{model:t.model.provider+`/`+t.model.model})+(t.model.reasoningEffort===void 0?``:s(`card.badge.modelEffort`,{effort:t.model.reasoningEffort})),children:[t.model.model,t.model.reasoningEffort===void 0?``:` (${t.model.reasoningEffort})`]}),t.permission===`read-only`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`blocked`,title:s(`card.badge.permReadOnlyTitle`),children:s(`card.badge.permReadOnly`)}),t.permission===`danger-full-access`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`urgent`,title:s(`card.badge.permFullTitle`),children:s(`card.badge.permFull`)}),t.checklist!==void 0&&t.checklist.length>0&&(0,n.jsxs)(`span`,{className:`dsh-atb-badge`,"data-kind":t.status===`in_review`&&t.checklist.some(e=>!e.checked)?`blocked`:`checklist`,title:t.status===`in_review`&&t.checklist.some(e=>!e.checked)?s(`card.badge.checklistReview`):s(`card.badge.checklist`),children:[`☑ `,t.checklist.filter(e=>e.checked).length,`/`,t.checklist.length]}),t.status===`done`&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`done`,children:s(`status.pill.done`)}),f!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":f.outcome===`running`?`running`:f.outcome,children:s(pe[f.outcome]??f.outcome)}),_!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-card-session`,title:s(`card.session.jumpTitle`,{id:_}),onClick:e=>{e.stopPropagation(),r.openSession(_).then(e=>{if(e===`missing`){let e=s(`card.session.missing`,{id:ye(_)});o===void 0?alert(e):o(e)}else if(e===`archived`){let e=s(`card.session.archived`,{id:ye(_)});o===void 0?alert(e):o(e)}else if(e===`unavailable`){let e=s(`card.session.unavailable`,{id:_});o===void 0?alert(e):o(e)}})},children:[`🤖 `,ye(_),` ↗`]}),t.comments.length>0&&(0,n.jsxs)(`span`,{children:[`💬 `,t.comments.length]}),t.trashedAt!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-badge`,"data-kind":`trashed`,children:s(`card.badge.pendingPurge`)}),(0,n.jsx)(`span`,{style:{marginLeft:`auto`},children:X(t.updatedAt)})]}),h&&(c?(0,n.jsxs)(`div`,{className:`dsh-atb-quick-reject`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`input`,{className:`dsh-atb-input dsh-atb-quick-note`,value:u,placeholder:s(`card.reject.placeholder`),autoFocus:!0,spellCheck:!1,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`?v():e.key===`Escape`&&(l(!1),d(``))}}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject-confirm`,onClick:v,children:s(`card.reject.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject-cancel`,onClick:()=>{l(!1),d(``)},children:s(`shared.cancel`)})]}):(0,n.jsxs)(`div`,{className:`dsh-atb-quick`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`done`,title:s(`card.action.doneTitle`),onClick:()=>void r.move(t.id,t.version,`done`),children:s(`card.action.done`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-quickbtn`,"data-act":`reject`,title:s(`card.action.rejectTitle`),onClick:()=>l(!0),children:s(`card.action.reject`)})]}))]})}function xe(){let[t,r]=(0,e.useState)(null);return{alert:e=>r(e),el:t===null?null:(0,n.jsx)(Se,{message:t,onClose:()=>r(null)})}}function Se({message:t,onClose:r}){let i=H();return(0,e.useEffect)(()=>{let e=e=>{e.key===`Escape`&&r()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]),(0,n.jsx)(`div`,{className:`dsh-atb-alert-backdrop`,onClick:r,children:(0,n.jsxs)(`div`,{className:`dsh-atb-alert`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`div`,{className:`dsh-atb-alert-icon`,children:`⛔`}),(0,n.jsx)(`div`,{className:`dsh-atb-alert-msg`,children:t}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:r,children:i(`alert.ok`)})]})})}const Ce=`image/png,image/jpeg,image/gif,image/webp`,we=new Set(Ce.split(`,`));function Te(e,t){let n=e.replace(/\.(?:png|jpe?g|gif|webp)$/i,``).replace(/[\[\]\r\n]/g,` `).replace(/\s+/g,` `).trim();return n.length>0?n.slice(0,120):t}function Ee(e,t){return``}function De(e,t,n,r){let i=e.slice(0,t),a=e.slice(n),o=`${i.length>0&&!i.endsWith(`
|
|
986
|
+
`)?`
|
|
987
|
+
`:``}${r}${a.length>0&&!a.startsWith(`
|
|
988
|
+
`)?`
|
|
989
|
+
`:``}`;return{value:i+o+a,cursor:i.length+o.length}}function Oe(e){return Array.from(e).filter(e=>we.has(e.type)).slice(0,10)}function ke(e){return[`backlog`,`todo`,`in_progress`,`in_review`,`done`,`canceled`,`archived`].filter(t=>p(e.status,t))}function Z(e){return e===void 0?``:e.replace(/^session-(taskboard-)?/,``).slice(0,8)}function Ae(e,t){if(t.systemKey===void 0)return t.body;if(t.systemRows!==void 0){let n=t.systemRows.map(t=>{let n=t.repo===``?e(`iso.repo.root`):t.repo,r=t.outcome===`merged`?`✓`:t.outcome===`noop`?`⟲`:`✗`;return t.outcome===`failed`&&t.error!==void 0?`${n} ${r} ${t.error}`:`${n} ${r}`}).join(` · `);return e(t.systemKey,{summary:n})}return e(t.systemKey,t.systemParams)}function je(e,t){if(e===void 0||t===void 0)return``;let n=Math.max(0,Math.round((t-e)/1e3));return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m${n%60}s`:`${Math.floor(n/3600)}h${Math.floor(n%3600/60)}m`}function Q({icon:e,children:t,tone:r,title:i}){return(0,n.jsxs)(`span`,{className:`dsh-atb-chip2`,"data-tone":r,title:i,children:[e!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-chip2-icon`,children:e}),t]})}function Me({text:t}){let r=H(),[i,a]=(0,e.useState)(null),o=/!\[(.*?)\]\(((?:data:image\/[^)]+)|(?:https?:\/\/[^)]+)|(?:[^)]+\.(?:png|jpg|jpeg|gif|webp|svg)))\)/gi,s=[],c=0,l,u=0;for(;(l=o.exec(t))!==null;){l.index>c&&s.push((0,n.jsx)(`span`,{children:t.slice(c,l.index)},`txt-${c}`));let e=l[1]||r(`md.imageAlt`,{n:++u}),i=l[2]??``;s.push((0,n.jsxs)(`div`,{className:`dsh-atb-detail-img-wrap`,children:[(0,n.jsx)(`img`,{src:i,alt:e,className:`dsh-atb-detail-img`,onClick:()=>a(i),title:r(`md.imageTitle`,{alt:e})}),(0,n.jsx)(`span`,{className:`dsh-atb-detail-img-caption`,children:e})]},`img-${l.index}`)),c=o.lastIndex}return c<t.length&&s.push((0,n.jsx)(`span`,{children:t.slice(c)},`txt-${c}`)),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-markdown-body`,children:s}),i!==null&&(0,n.jsx)(`div`,{className:`dsh-atb-lightbox-backdrop`,onClick:()=>a(null),children:(0,n.jsxs)(`div`,{className:`dsh-atb-lightbox-content`,onClick:e=>e.stopPropagation(),children:[(0,n.jsx)(`img`,{src:i,alt:r(`md.lightboxAlt`),className:`dsh-atb-lightbox-img`}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-lightbox-close`,title:r(`md.closePreview`),onClick:()=>a(null),children:`✕`})]})})]})}function Ne(e){return[...e.executions].reverse().find(e=>e.isolation!==void 0||e.worktreePath!==void 0||e.isolationNote!==void 0)}function Pe(e){return e===void 0?``:e.slice(0,8)}function Fe(e){let t=e.slice(3),n=t.indexOf(` -> `);return n>=0&&(t=t.slice(n+4)),t.startsWith(`"`)&&t.endsWith(`"`)&&t.length>1&&(t=t.slice(1,-1)),t}function Ie({controller:t,task:r,execution:i,commit:a,path:o,repo:s}){let c=H(),[l,u]=(0,e.useState)({loading:!0});return(0,e.useEffect)(()=>{let e=!0;return u({loading:!0}),t.fetchDiff(r.id,{execution:i.id,...a===void 0?{path:o??``}:{commit:a},...s===void 0?{}:{repo:s}}).then(t=>{e&&u(t===void 0?{loading:!1,failed:!0}:{loading:!1,diff:t.diff,truncated:t.truncated})}),()=>{e=!1}},[t,r.id,i.id,a,o,s]),(0,n.jsxs)(`div`,{className:`dsh-atb-diffview`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diffview-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-diffview-title`,children:a===void 0?c(`diff.file`,{path:o??``}):c(`diff.commit`,{hash:Pe(a)})}),l.loading&&(0,n.jsx)(`span`,{className:`dsh-atb-diffview-hint`,children:c(`shared.loading`)}),l.truncated===!0&&(0,n.jsx)(`span`,{className:`dsh-atb-diffview-hint`,children:c(`diff.truncated`)})]}),l.failed===!0?(0,n.jsx)(`div`,{className:`dsh-atb-diffview-error`,children:c(`diff.failed`)}):(0,n.jsx)(`pre`,{className:`dsh-atb-diffview-pre`,children:l.diff??``})]})}function Le({task:e,controller:t}){let r=H(),i=e.checklist??[];if(i.length===0)return null;let{done:a,total:o}=C(e),s=o-a,c=e.status===`in_review`;return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`checklist`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard-label`,children:[r(`checklist.title`),(0,n.jsxs)(`span`,{className:`dsh-atb-cl-progress`,"data-tone":c&&s>0?`bad`:void 0,children:[`☑ `,a,`/`,o,c&&s>0?r(`checklist.unchecked`,{n:s}):a===o?r(`checklist.allDone`):``]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-cl-items`,children:i.map(i=>(0,n.jsxs)(`label`,{className:`dsh-atb-cl-item`,"data-checked":i.checked?`true`:void 0,"data-alert":c&&!i.checked?`true`:void 0,children:[(0,n.jsx)(`input`,{type:`checkbox`,checked:i.checked,onChange:()=>void t.toggleChecklistItem(e,i.id)}),(0,n.jsx)(`span`,{className:`dsh-atb-cl-text`,children:i.text}),(0,n.jsxs)(`span`,{className:`dsh-atb-cl-meta`,children:[i.checked?`${i.checkedBy===`user`?r(`checklist.byUser`):`🤖 ${Z(i.checkedBy)}`} · ${X(i.checkedAt)}`:r(`checklist.uncheckedItem`),i.note!==void 0&&i.note.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-cl-note`,title:i.note,children:r(`checklist.evidence`,{note:i.note})})]})]},i.id))})]})}function Re({task:e}){let t=H(),r=[...e.executions].reverse().find(e=>e.report!==void 0),i=r?.report;if(r===void 0||i===void 0)return null;let a=(e,t)=>t!==void 0&&t.length>0?(0,n.jsxs)(`div`,{className:`dsh-atb-rpt-sec`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-rpt-label`,children:e}),(0,n.jsx)(`ul`,{className:`dsh-atb-rpt-list`,children:t.map((e,t)=>(0,n.jsx)(`li`,{children:e},t))})]}):null;return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`report`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard-label`,children:[t(`report.title`),(0,n.jsx)(`span`,{className:`dsh-atb-cl-progress`,children:t(`report.submitted`,{time:X(r.endedAt??r.startedAt)})})]}),(0,n.jsx)(`div`,{className:`dsh-atb-rpt-summary`,children:i.summary}),a(t(`report.changedFiles`),i.changedFiles),a(t(`report.checks`),i.checks),a(t(`report.artifacts`),i.artifacts),i.risk.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-rpt-sec`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-rpt-label`,children:t(`report.risk`)}),(0,n.jsx)(`div`,{className:`dsh-atb-rpt-risk`,children:i.risk})]})]})}function ze({task:t,controller:r}){let i=H(),{alert:a,el:o}=xe(),[s,c]=(0,e.useState)(!1),[l,u]=(0,e.useState)(null),[d,f]=(0,e.useState)(!1),[p,m]=(0,e.useState)(null),[h,g]=(0,e.useState)(!1),_=Ne(t),v=t.executions.some(e=>e.outcome===`running`);if(_===void 0)return null;let y=()=>{f(!0),r.mergeBranch(t.id).then(e=>{if(f(!1),c(!1),!e.ok)a(i(`iso.merge.failed`,{error:e.error}));else if(e.results!==void 0){let t=e=>e===``?i(`iso.repo.root`):e,n=e.results.map(e=>`${t(e.repo)} ${e.outcome===`merged`?`✓`:e.outcome===`noop`?`⟲`:`✗`}`).join(` · `),r=e.results.some(e=>e.outcome===`failed`),o=e.results.find(e=>e.outcome===`failed`)?.error;a(r?i(`iso.merge.partial`,{summary:n,error:o??``}):i(`iso.merge.done`,{summary:n}))}else e.noop===!0&&a(i(`iso.merge.noop`))})},b=e=>{f(!0),r.removeWorktree(t.id,e).then(e=>{f(!1),u(null),e.ok?e.branchError!==void 0&&a(i(`iso.remove.branchFailed`,{error:e.branchError})):a(i(`iso.remove.failed`,{error:e.error}))})};if(_.isolation!==`worktree`||_.worktreePath===void 0)return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`isolation`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:i(`iso.title`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-none`,children:[i(`iso.none`),_.isolationNote===void 0?``:` · ${_.isolationNote}`]}),o]});let x=_.repos!==void 0&&_.repos.length>0,S=x?(_.repos??[]).map(e=>({repo:e.repo,label:e.repo===``?i(`iso.repo.root`):e.repo,branch:e.branch,worktreePath:e.worktreePath,baseCommit:e.baseCommit,headCommit:e.headCommit,commits:e.commits??[],commitTotal:e.commitsTotal??(e.commits??[]).length,dirty:e.dirtyFiles??[],dirtyTotal:e.dirtyFilesTotal??(e.dirtyFiles??[]).length,...e.diffStat===void 0?{}:{diffStat:e.diffStat},...e.changedFiles===void 0?{}:{changedFiles:e.changedFiles}})):[{label:i(`iso.repo.root`),branch:_.branch??t.branch,worktreePath:_.worktreePath,baseCommit:_.baseCommit,headCommit:_.headCommit,commits:_.commits??[],commitTotal:_.commitsTotal??(_.commits??[]).length,dirty:_.dirtyFiles??[],dirtyTotal:_.dirtyFilesTotal??(_.dirtyFiles??[]).length,..._.diffStat===void 0?{}:{diffStat:_.diffStat},..._.changedFiles===void 0?{}:{changedFiles:_.changedFiles}}];return(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`isolation`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:i(`iso.worktreeTitle`)}),S.map(e=>(0,n.jsxs)(`section`,{className:`dsh-atb-iso-repo`,"data-multi":x?`true`:void 0,children:[x&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-repohead`,title:e.worktreePath,children:[(0,n.jsx)(`code`,{children:e.label}),(0,n.jsxs)(`span`,{className:`dsh-atb-iso-fact`,children:[i(`iso.branch`),` `,(0,n.jsx)(`b`,{children:e.branch})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-facts`,children:[!x&&(0,n.jsxs)(`span`,{className:`dsh-atb-iso-fact`,title:e.worktreePath,children:[i(`iso.branch`),` `,(0,n.jsx)(`b`,{children:e.branch})]}),(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,children:i(`iso.baseline`,{base:Pe(e.baseCommit),head:Pe(e.headCommit)})}),e.changedFiles!==void 0&&e.changedFiles>0&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,children:i(`iso.changed`,{n:e.changedFiles})}),e.diffStat!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-fact`,title:e.diffStat,children:e.diffStat})]}),e.commits.length>0?(0,n.jsxs)(`div`,{className:`dsh-atb-iso-commits`,children:[e.commits.slice(0,10).map(a=>(0,n.jsxs)(`div`,{className:`dsh-atb-iso-commit`,"data-open":p?.commit===a.hash&&p?.repo===e.repo?`true`:void 0,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-commit-btn`,title:i(`iso.commit.openTitle`),onClick:()=>m(p?.commit===a.hash&&p?.repo===e.repo?null:{commit:a.hash,...e.repo===void 0?{}:{repo:e.repo}}),children:[(0,n.jsx)(`code`,{children:Pe(a.hash)}),(0,n.jsx)(`span`,{children:a.subject})]}),p?.commit===a.hash&&p?.repo===e.repo&&(0,n.jsx)(Ie,{controller:r,task:t,execution:_,commit:a.hash,repo:e.repo})]},a.hash)),e.commitTotal>10&&(0,n.jsx)(`div`,{className:`dsh-atb-iso-more`,children:i(`iso.commits.more`,{n:e.commitTotal})})]}):(0,n.jsx)(`div`,{className:`dsh-atb-iso-nocommit`,children:i(`iso.nocommit`)}),e.dirtyTotal>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-dirty`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-dirty-toggle`,onClick:()=>g(!h),children:[i(`iso.dirty.toggle`,{n:e.dirtyTotal}),i(h?`iso.dirty.collapse`:`iso.dirty.expand`)]}),h&&(0,n.jsxs)(`div`,{className:`dsh-atb-iso-dirty-files`,children:[e.dirty.slice(0,30).map((t,r)=>{let a=Fe(t);return(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-iso-dirty-file`,title:i(`iso.dirty.openTitle`),onClick:()=>m(p?.path===a&&p?.repo===e.repo?null:{path:a,...e.repo===void 0?{}:{repo:e.repo}}),children:[(0,n.jsx)(`code`,{children:t.slice(0,2)}),` `,a]},`${t}-${r}`)}),e.dirtyTotal>30&&(0,n.jsx)(`div`,{className:`dsh-atb-iso-more`,children:i(`iso.dirty.more`,{n:e.dirtyTotal})})]}),p?.path!==void 0&&p?.repo===e.repo&&h&&(0,n.jsx)(Ie,{controller:r,task:t,execution:_,path:p.path,repo:e.repo})]})]},e.repo??`root`)),(0,n.jsxs)(`div`,{className:`dsh-atb-iso-actions`,children:[v?(0,n.jsx)(`span`,{className:`dsh-atb-iso-hint`,children:i(`iso.hint.running`)}):s?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:i(`iso.merge.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:d,onClick:y,children:i(`iso.merge.go`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>c(!1),children:i(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:d,title:i(`iso.merge.title`),onClick:()=>c(!0),children:i(`iso.merge.button`)}),!v&&(l===null?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,title:i(`iso.remove.wtTitle`),onClick:()=>u(`wt`),children:i(`iso.remove.wt`)}),t.branch!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,title:i(`iso.remove.wtbTitle`),onClick:()=>u(`wtb`),children:i(`iso.remove.wtb`)})]}):(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:i(l===`wtb`?`iso.remove.confirmWtb`:`iso.remove.confirmWt`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,disabled:d,onClick:()=>b(l===`wtb`),children:i(`shared.confirmDelete`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>u(null),children:i(`shared.cancel`)})]})),!v&&l===null&&!s&&(0,n.jsx)(`span`,{className:`dsh-atb-iso-hint`,children:i(`iso.hint.keep`)})]}),o]})}function Be({task:t,controller:r,now:i}){let a=H(),[o,s]=(0,e.useState)(``),[c,l]=(0,e.useState)(!1),u=(0,e.useRef)(null),d=(0,e.useRef)(null),[f,p]=(0,e.useState)(!1),[m,h]=(0,e.useState)(!1),[g,_]=(0,e.useState)(!1),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(!1),{alert:w,el:T}=xe(),E=r.getSnapshot().workspaces.find(e=>e.id===t.workspaceId),D=t.status!==`in_progress`&&t.status!==`done`&&t.status!==`archived`,O=t.executions.find(e=>e.outcome===`running`),k=t.status===`in_progress`?t.claimedBy:void 0,A=i!==void 0&&_e(t,i),j=(t.checklist??[]).filter(e=>!e.checked).length,M=[...t.executions].reverse().find(e=>e.sessionId!==void 0),N=O?.sessionId??M?.sessionId??(t.claimedBy?.startsWith(`session-`)?t.claimedBy:void 0),P=S(t),F=r.getSnapshot(),I=F.sessionArchive?.taskId===t.id?F.sessionArchive.result:void 0,L=e=>{b||(x(!0),e().catch(()=>void 0).finally(()=>x(!1)))},R=()=>{c||o.trim().length===0||r.comment(t.id,o).then(e=>{e&&s(``)})},z=async e=>{let t=Oe(e);if(t.length===0||c)return;l(!0);let n=u.current,i=n?.value??o,d=n?.selectionStart??i.length,f=n?.selectionEnd??d,p=!1;try{for(let e of t){let t=await r.uploadImage(e);if(t===void 0)continue;let n=De(i,d,f,Ee(t,Te(e.name,a(`image.defaultAlt`))));i=n.value,d=n.cursor,f=d,p=!0}p&&(s(i),setTimeout(()=>{u.current?.focus(),u.current?.setSelectionRange(d,d)},0))}finally{l(!1)}},B=e=>{r.openSession(e).then(t=>{t===`missing`?w(a(`card.session.missing`,{id:Z(e)})):t===`archived`?w(a(`card.session.archived`,{id:Z(e)})):t===`unavailable`&&w(a(`card.session.unavailable`,{id:e}))})};return(0,n.jsxs)(`div`,{className:`dsh-atb-detail`,"data-urgency":t.urgency,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-head`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-titlewrap`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-detail-titlebar`,children:[(0,n.jsx)(`h3`,{children:t.title}),(0,n.jsx)(`span`,{className:`dsh-atb-statuspill`,"data-status":t.status,children:a(G[t.status]??t.status)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-detail-chips`,children:[(0,n.jsxs)(Q,{tone:t.urgency,children:[`● `,a(q[t.urgency]??t.urgency)]}),(0,n.jsx)(Q,{icon:`📁`,children:E?.title??Z(t.workspaceId)}),t.model!==void 0&&(0,n.jsxs)(Q,{icon:`✦`,title:a(`card.badge.modelTitle`,{model:t.model.provider+`/`+t.model.model})+(t.model.reasoningEffort===void 0?``:a(`card.badge.modelEffort`,{effort:t.model.reasoningEffort})),children:[t.model.model,t.model.reasoningEffort===void 0?``:` · ${t.model.reasoningEffort}`]}),t.presetId!==void 0&&(0,n.jsx)(Q,{icon:`🎛`,children:t.presetId}),t.execution.mode===`scheduled`&&(0,n.jsx)(Q,{icon:`⏰`,children:a(`detail.chip.nextRun`,{cron:t.execution.cron??``,time:X(t.execution.nextRunAt)})}),t.blocked&&(0,n.jsx)(Q,{icon:`⛔`,tone:`urgent`,children:a(`shared.blocked`)}),t.checklist!==void 0&&t.checklist.length>0&&(0,n.jsx)(Q,{icon:`☑`,tone:t.status===`in_review`&&t.checklist.some(e=>!e.checked)?`urgent`:void 0,children:a(`detail.chip.checklist`,{done:C(t).done,total:t.checklist.length})}),t.branch!==void 0&&(0,n.jsxs)(Q,{icon:`🌿`,tone:void 0,children:[`Worktree · `,t.branch.length>28?`${t.branch.slice(0,28)}…`:t.branch]}),(t.isolation===void 0||t.isolation===`worktree`)&&t.branch===void 0&&(0,n.jsx)(Q,{icon:`🌿`,children:a(`detail.chip.isolated`)}),t.permission===`read-only`&&(0,n.jsx)(Q,{icon:`🔒`,tone:`urgent`,children:a(`detail.chip.permReadOnly`)}),t.permission===`danger-full-access`&&(0,n.jsx)(Q,{icon:`⚡`,tone:`urgent`,children:a(`detail.chip.permFull`)}),(t.permission===`workspace-write`||t.permission===void 0)&&(0,n.jsx)(Q,{icon:`📁`,children:a(`detail.chip.permWrite`)}),k!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-chip2 dsh-atb-chip-btn`,"data-tone":A?`urgent`:void 0,title:a(`detail.chip.holderTitle`,{id:k}),onClick:()=>B(k),children:[(0,n.jsx)(`span`,{className:`dsh-atb-chip2-icon`,children:A?`⏱`:`🤖`}),a(A?`detail.chip.holderStale`:`detail.chip.holderBy`),Z(k),a(`detail.chip.holderSuffix`)]}),t.trashedAt!==void 0&&(0,n.jsx)(Q,{icon:`🗑`,tone:`urgent`,children:a(`detail.chip.trashed`)}),(0,n.jsxs)(Q,{children:[`v`,t.version]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-detail-sub`,children:a(`detail.sub.line`,{time:X(t.updatedAt),who:t.updatedBy.kind===`agent`?`🤖 ${Z(t.updatedBy.sessionId)}`:t.updatedBy.kind===`system`?a(`detail.updatedBy.system`):a(`detail.updatedBy.user`)})})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-detail-topbtns`,children:[N!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-session`,title:a(`detail.session.jumpTitle`,{id:N}),onClick:()=>B(N),children:a(`detail.session.jump`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,onClick:()=>r.openEditor(t.id),children:a(`detail.action.edit`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,title:a(`detail.action.duplicateTitle`),disabled:b,onClick:()=>L(()=>r.duplicate(t)),children:a(`detail.action.duplicate`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-edit`,title:a(`detail.action.saveTplTitle`),disabled:b,onClick:()=>L(async()=>{await r.saveAsTemplate(t)&&w(a(`detail.action.saveTplDone`))}),children:a(`detail.action.saveTpl`)}),D&&t.branch!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,title:a(`detail.action.reuseTitle`),disabled:b,onClick:()=>L(()=>r.run(t.id,!0)),children:a(`detail.action.reuse`)}),D&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,title:t.model===void 0?a(`detail.action.runTitleDefault`):a(`detail.action.runTitleModel`,{model:t.model.model}),disabled:b,onClick:()=>L(()=>r.run(t.id)),children:a(`detail.action.run`)}),O!==void 0&&(g?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:a(`detail.action.stopConfirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{r.cancel(t.id),_(!1)},children:a(`detail.action.stop`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>_(!1),children:a(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-run`,"data-danger":`true`,title:a(`detail.action.stopTitle`,{id:O.sessionId??``}),onClick:()=>_(!0),children:a(`detail.action.stopExec`)})),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-detail-close`,"aria-label":a(`shared.close`),onClick:()=>r.select(void 0),children:`✕`})]})]}),t.description.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:a(`detail.field.description`)}),(0,n.jsx)(`div`,{className:`dsh-atb-desc`,children:(0,n.jsx)(Me,{text:t.description})})]}),t.prompt.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-fieldcard`,"data-kind":`prompt`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-fieldcard-label`,children:a(`detail.field.prompt`)}),(0,n.jsx)(`div`,{className:`dsh-atb-promptbox`,children:(0,n.jsx)(Me,{text:t.prompt})})]}),(0,n.jsx)(ze,{task:t,controller:r}),(0,n.jsx)(Re,{task:t}),(0,n.jsx)(Le,{task:t,controller:r}),I!==void 0&&(0,n.jsxs)(`div`,{role:`status`,className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{children:a(`detail.move.archiveResult`,{n:I.archived.length})}),I.failed.map(e=>(0,n.jsxs)(`span`,{children:[e.sessionId,`: `,e.error]},e.sessionId)),I.unsupported.length>0&&(0,n.jsxs)(`span`,{children:[a(`detail.move.archiveUnsupported`),` `,I.unsupported.join(`, `)]})]}),t.status===`archived`&&P.length>0&&F.archiveSessionsSupported&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:b,onClick:()=>L(()=>r.retryArchiveSessions(t.id)),children:a(`detail.move.archiveRetry`)}),(0,n.jsx)(`div`,{className:`dsh-atb-detail-actions`,children:(0,n.jsxs)(`div`,{className:`dsh-atb-movebtns`,children:[ke(t).map(e=>e===`done`?f?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,"data-tone":j>0?`bad`:void 0,children:j>0?a(`detail.move.confirmDoneUnchecked`,{n:j}):a(`detail.move.confirmDone`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{r.move(t.id,t.version,`done`),p(!1)},children:a(`detail.move.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>p(!1),children:a(`shared.cancel`)})]},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>{p(!0),y(!1)},children:a(`detail.move.to`,{status:a(K[e])})},e):e===`archived`?v?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:P.length===1?a(`detail.move.confirmArchiveSessionWithId`,{id:Z(P[0])}):P.length>1?a(`detail.move.confirmArchiveSessionCount`,{n:P.length}):a(`detail.move.confirmArchive`)}),P.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:P.join(`, `)}),P.length>0?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:!F.archiveSessionsSupported||b,title:F.archiveSessionsSupported?void 0:a(`detail.move.archiveUnsupported`),onClick:()=>{L(()=>r.move(t.id,t.version,`archived`,{archiveSessions:!0})),y(!1)},children:a(`detail.move.archiveWithSession`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>{L(()=>r.move(t.id,t.version,`archived`,{archiveSessions:!1})),y(!1)},children:a(`detail.move.archiveCardOnly`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{r.move(t.id,t.version,`archived`),y(!1)},children:a(`detail.move.confirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>y(!1),children:a(`shared.cancel`)})]},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>{y(!0),p(!1)},children:a(`detail.move.to`,{status:a(K[e])})},e):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":e,onClick:()=>void r.move(t.id,t.version,e),children:a(`detail.move.to`,{status:a(K[e])})},e)),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":`blocked`,onClick:()=>void r.toggleBlocked(t),children:t.blocked?a(`detail.blocked.unmark`):a(`detail.blocked.mark`)}),k!==void 0&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-movebtn`,"data-to":`release`,title:a(`detail.release.title`,{id:k}),onClick:()=>void r.move(t.id,t.version,`todo`),children:a(`detail.release.button`)})]})}),(0,n.jsxs)(`div`,{className:`dsh-atb-section`,children:[(0,n.jsxs)(`h4`,{children:[a(`detail.comments.title`),t.comments.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-count2`,children:t.comments.length})]}),t.comments.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:a(`detail.comments.empty`)}):(0,n.jsx)(`div`,{className:`dsh-atb-commentlist`,children:t.comments.map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-bubble`,"data-from":e.threadId===void 0?`user`:`agent`,children:[(0,n.jsx)(`div`,{className:`dsh-atb-bubble-avatar`,children:e.threadId===void 0?`👤`:`🤖`}),(0,n.jsxs)(`div`,{className:`dsh-atb-bubble-main`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-bubble-meta`,children:[(0,n.jsx)(`b`,{children:e.threadId===void 0?a(`detail.comments.user`):`agent ${Z(e.threadId)}`}),(0,n.jsx)(`span`,{children:X(e.createdAt)})]}),(0,n.jsx)(`div`,{className:`dsh-atb-bubble-body`,children:(0,n.jsx)(Me,{text:Ae(a,e)})})]})]},e.id))}),(0,n.jsxs)(`div`,{className:`dsh-atb-composer`,children:[(0,n.jsx)(`textarea`,{ref:u,className:`dsh-atb-composer-input`,value:o,placeholder:a(`detail.composer.placeholder`),disabled:c,onChange:e=>s(e.target.value),onKeyDown:e=>{(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&o.trim().length>0&&!c&&R()},onPaste:e=>{let t=Oe(e.clipboardData.files);t.length>0&&(e.preventDefault(),z(t))},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&e.preventDefault()},onDrop:e=>{let t=Oe(e.dataTransfer.files);t.length>0&&(e.preventDefault(),z(t))}}),(0,n.jsx)(`input`,{ref:d,type:`file`,accept:Ce,multiple:!0,hidden:!0,onChange:e=>{e.target.files!==null&&z(e.target.files),e.target.value=``}}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-image-add`,disabled:c,title:a(`image.add`),onClick:()=>d.current?.click(),children:c?`…`:`🖼`}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-composer-send`,disabled:o.trim().length===0||c,onClick:R,children:a(`detail.composer.send`)})]})]}),t.executions.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-section`,children:[(0,n.jsxs)(`h4`,{children:[a(`detail.exec.title`),(0,n.jsx)(`span`,{className:`dsh-atb-count2`,children:t.executions.length}),t.executionsPruned!==void 0&&t.executionsPruned>0&&(0,n.jsx)(`span`,{className:`dsh-atb-count2`,title:a(`detail.exec.prunedTitle`,{n:t.executionsPruned}),children:a(`detail.exec.pruned`,{n:t.executionsPruned})})]}),(0,n.jsx)(`div`,{className:`dsh-atb-execlist`,children:[...t.executions].reverse().map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-exec-row`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-exec-dot`,"data-outcome":e.outcome}),(0,n.jsx)(`span`,{className:`dsh-atb-exec-trigger`,children:e.trigger===`manual`?a(`detail.exec.trigger.manual`):a(`detail.exec.trigger.scheduled`)}),(0,n.jsx)(`span`,{className:`dsh-atb-exec-outcome`,"data-outcome":e.outcome,children:a(pe[e.outcome]??e.outcome)}),(0,n.jsxs)(`span`,{className:`dsh-atb-exec-time`,children:[X(e.startedAt),e.endedAt!==void 0&&` · ${je(e.startedAt,e.endedAt)}`]}),e.sessionId!==void 0&&(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-exec-session`,title:a(`detail.exec.openTitle`,{id:e.sessionId}),onClick:()=>B(e.sessionId),children:[`🤖 `,Z(e.sessionId),` ↗`]}),e.error!==void 0&&(0,n.jsxs)(`span`,{className:`dsh-atb-exec-error`,title:e.error,children:[e.error.slice(0,80),e.error.length>80?`…`:``]})]},e.id))})]}),(0,n.jsx)(`div`,{className:`dsh-atb-dangerzone`,children:t.trashedAt===void 0?(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>void r.remove(t.id,t.version,!1),children:a(`detail.danger.delete`)}):m?(0,n.jsxs)(`span`,{className:`dsh-atb-confirm`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-confirm-label`,children:a(`detail.danger.purgeConfirm`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{r.remove(t.id,t.version,!0),h(!1)},children:a(`detail.danger.purgeGo`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>h(!1),children:a(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>h(!0),children:a(`detail.danger.purge`)})}),T]})}const Ve=e=>[{name:`goal`,kind:`command`,description:e(`slash.cmd.goal.desc`),hint:e(`slash.cmd.goal.hint`)},{name:`schedule`,kind:`command`,description:e(`slash.cmd.schedule.desc`),hint:e(`slash.cmd.schedule.hint`)},{name:`plan`,kind:`command`,description:e(`slash.cmd.plan.desc`)},{name:`browser`,kind:`command`,description:e(`slash.cmd.browser.desc`)},{name:`grill-me`,kind:`command`,description:e(`slash.cmd.grill-me.desc`)},{name:`teamwork-preview`,kind:`command`,description:e(`slash.cmd.teamwork-preview.desc`)},{name:`learn`,kind:`command`,description:e(`slash.cmd.learn.desc`)},{name:`review`,kind:`command`,description:e(`slash.cmd.review.desc`)},{name:`security`,kind:`command`,description:e(`slash.cmd.security.desc`)},{name:`permission`,kind:`command`,description:e(`slash.cmd.permission.desc`),hint:e(`slash.cmd.permission.hint`)}],He=e=>[{name:`frontend-ui-engineering`,kind:`skill`,description:e(`slash.skill.frontend-ui-engineering`)},{name:`api-and-interface-design`,kind:`skill`,description:e(`slash.skill.api-and-interface-design`)},{name:`test-driven-development`,kind:`skill`,description:e(`slash.skill.test-driven-development`)},{name:`debugging-and-error-recovery`,kind:`skill`,description:e(`slash.skill.debugging-and-error-recovery`)},{name:`performance-optimization`,kind:`skill`,description:e(`slash.skill.performance-optimization`)},{name:`ci-cd-and-automation`,kind:`skill`,description:e(`slash.skill.ci-cd-and-automation`)},{name:`code-review-and-quality`,kind:`skill`,description:e(`slash.skill.code-review-and-quality`)},{name:`code-simplification`,kind:`skill`,description:e(`slash.skill.code-simplification`)},{name:`context-engineering`,kind:`skill`,description:e(`slash.skill.context-engineering`)},{name:`doubt-driven-development`,kind:`skill`,description:e(`slash.skill.doubt-driven-development`)},{name:`git-workflow-and-versioning`,kind:`skill`,description:e(`slash.skill.git-workflow-and-versioning`)},{name:`idea-refine`,kind:`skill`,description:e(`slash.skill.idea-refine`)},{name:`incremental-implementation`,kind:`skill`,description:e(`slash.skill.incremental-implementation`)},{name:`interview-me`,kind:`skill`,description:e(`slash.skill.interview-me`)},{name:`memory-leak-debugging`,kind:`skill`,description:e(`slash.skill.memory-leak-debugging`)},{name:`observability-and-instrumentation`,kind:`skill`,description:e(`slash.skill.observability-and-instrumentation`)},{name:`planning-and-task-breakdown`,kind:`skill`,description:e(`slash.skill.planning-and-task-breakdown`)},{name:`security-and-hardening`,kind:`skill`,description:e(`slash.skill.security-and-hardening`)},{name:`shipping-and-launch`,kind:`skill`,description:e(`slash.skill.shipping-and-launch`)},{name:`source-driven-development`,kind:`skill`,description:e(`slash.skill.source-driven-development`)},{name:`spec-driven-development`,kind:`skill`,description:e(`slash.skill.spec-driven-development`)},{name:`using-agent-skills`,kind:`skill`,description:e(`slash.skill.using-agent-skills`)}];function Ue({value:t,onChange:i,controller:a,placeholder:o,rows:s=4,maxLength:c=8e3,disabled:l=!1,autoFocus:u=!1,className:d,ariaLabel:f,allowImages:p=!1,onUploadingChange:m}){let h=H(),g=(0,e.useRef)(null),_=(0,e.useRef)(null),v=(0,e.useRef)(null),y=(0,e.useRef)(null),[b,x]=(0,e.useState)({}),[S,C]=(0,e.useState)(void 0),w=(0,e.useMemo)(()=>{let e=(e,t)=>{let n=new Map;for(let t of e)n.set(t.name,t);for(let e of t??[])n.set(e.name,e);return Array.from(n.values())};return{commands:e(Ve(h),S?.commands),skills:e(He(h),S?.skills)}},[h,S]),[T,E]=(0,e.useState)(!1),[D,O]=(0,e.useState)(``),[k,A]=(0,e.useState)(-1),[j,M]=(0,e.useState)(0),[N,P]=(0,e.useState)(!1),F=async e=>{let n=Oe(e);if(!p||a===void 0||n.length===0||N)return;P(!0),m?.(!0);let r=g.current,o=r?.value??t,s=r?.selectionStart??o.length,c=r?.selectionEnd??s,l=!1;try{for(let e of n){let t=await a.uploadImage(e);if(t===void 0)continue;let n=De(o,s,c,Ee(t,Te(e.name,h(`image.defaultAlt`))));o=n.value,s=n.cursor,c=s,l=!0}l&&(i(o),setTimeout(()=>{g.current?.focus(),g.current?.setSelectionRange(s,s)},0))}finally{P(!1),m?.(!1)}};(0,e.useEffect)(()=>{if(a===void 0)return;let e=!0;return a.fetchPromptCompletions().then(t=>{!e||t===void 0||C({commands:t.commands.map(e=>({...e,kind:`command`})),skills:t.skills.map(e=>({...e,kind:`skill`}))})}),()=>{e=!1}},[a]);let I=(0,e.useMemo)(()=>{let e=D.toLowerCase().trim(),t=[...w.commands,...w.skills];return e.length===0?t:t.filter(t=>t.name.toLowerCase().includes(e)||t.description!==void 0&&t.description.toLowerCase().includes(e))},[w,D]);(0,e.useEffect)(()=>{j>=I.length&&M(Math.max(0,I.length-1))},[I.length,j]),(0,e.useLayoutEffect)(()=>{if(!T)return;let e=v.current,t=e?.children[j];if(e===null||!(t instanceof HTMLElement))return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.top<n.top?e.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(e.scrollTop+=r.bottom-n.bottom)},[T,j,I]);let L=()=>{let e=g.current;if(e===null)return;let t=e.selectionStart,n=e.value.slice(0,t),r=n.lastIndexOf(`/`);if(r>=0){let e=r>0?n[r-1]??`
|
|
942
990
|
`:`
|
|
943
|
-
`,t=/\s/.test(e)||r===0,i=n.slice(r+1),a=!/\s/.test(i);if(t&&a){D(r),T(i),C(!0);return}}C(!1)},M=e=>{let n=m.current;if(n===null||E<0)return;let r=n.selectionStart,a=t.slice(0,E),o=t.slice(r),s=`/${e.name} `;i(a+s+o),C(!1),setTimeout(()=>{if(m.current!==null){let e=E+s.length;m.current.focus(),m.current.setSelectionRange(e,e)}},0)},N=e=>{if(S&&A.length>0){if(e.key===`ArrowDown`){e.preventDefault(),k(e=>(e+1)%A.length);return}if(e.key===`ArrowUp`){e.preventDefault(),k(e=>(e-1+A.length)%A.length);return}if(e.key===`Enter`||e.key===`Tab`){let t=A[O];if(t!==void 0){e.preventDefault(),M(t);return}}if(e.key===`Escape`){e.preventDefault(),C(!1);return}}},P=(0,e.useCallback)(()=>{let e=m.current;if(e===null)return;let t=e.getBoundingClientRect(),n=window.innerHeight,r=h.current?.offsetHeight??0,i=r>0?r:240,a=t.top-6-8,o=n-8-(t.bottom+6),s=o>a,c=Math.min(i,Math.max(s?o:a,120)),l=s?t.bottom+6:t.top-6-c;v(e=>e.left===t.left&&e.top===l&&e.width===t.width&&e.maxHeight===c?e:{position:`fixed`,left:t.left,top:l,width:t.width,maxHeight:c,zIndex:100})},[]);return(0,e.useLayoutEffect)(()=>{S&&P()}),(0,e.useEffect)(()=>{if(S)return window.addEventListener(`scroll`,P,!0),window.addEventListener(`resize`,P),()=>{window.removeEventListener(`scroll`,P,!0),window.removeEventListener(`resize`,P)}},[S,P]),(0,n.jsxs)(`div`,{className:`dsh-atb-prompt-wrap ${d??``}`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-prompt-inner`,children:[(0,n.jsx)(`textarea`,{ref:m,className:`dsh-atb-prompt-input`,value:t,rows:s,maxLength:c,disabled:l,autoFocus:u,placeholder:o,"aria-label":f,onChange:e=>{i(e.target.value),j()},onKeyUp:j,onClick:j,onKeyDown:N}),S&&A.length>0&&(0,r.createPortal)((0,n.jsxs)(`div`,{ref:h,className:`dsh-atb-slash-popup`,style:_,role:`listbox`,"aria-label":p(`slash.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-slash-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-slash-title`,children:p(`slash.title`)}),(0,n.jsx)(`span`,{className:`dsh-atb-slash-hint`,children:p(`slash.hint`)})]}),(0,n.jsx)(`div`,{ref:g,className:`dsh-atb-slash-list`,children:A.map((e,t)=>(0,n.jsxs)(`div`,{role:`option`,"aria-selected":t===O,className:`dsh-atb-slash-item`,"data-active":t===O?`true`:void 0,"data-kind":e.kind,onClick:()=>M(e),onMouseEnter:()=>k(t),children:[(0,n.jsx)(`span`,{className:`dsh-atb-slash-badge`,"data-kind":e.kind,children:e.kind===`command`?p(`slash.badge.command`):p(`slash.badge.skill`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-slash-name`,children:[`/`,e.name]}),e.hint&&(0,n.jsx)(`span`,{className:`dsh-atb-slash-param`,children:e.hint}),e.description&&(0,n.jsx)(`span`,{className:`dsh-atb-slash-desc`,children:e.description})]},`${e.kind}-${e.name}`))})]}),document.body)]}),(0,n.jsx)(`div`,{className:`dsh-atb-prompt-foot`,children:(0,n.jsxs)(`span`,{className:`dsh-atb-prompt-tip`,children:[p(`slash.tipA`),` `,(0,n.jsx)(`code`,{children:`/`}),` `,p(`slash.tipB`)]})})]})}const Le=`dsh-taskboard-last-model-v1`;function Re(){try{let e=localStorage.getItem(Le);if(e===null)return;let t=JSON.parse(e);if(typeof t==`object`&&t){let{provider:e,model:n,reasoningEffort:r}=t;if(typeof e==`string`&&typeof n==`string`&&e.trim().length>0&&n.trim().length>0)return{provider:e.trim(),model:n.trim(),...typeof r==`string`&&r.trim().length>0?{reasoningEffort:r.trim()}:{}}}return}catch{return}}function ze(e){try{e===void 0?localStorage.removeItem(Le):localStorage.setItem(Le,JSON.stringify(e))}catch{}}const Be=e=>[{value:`urgent`,label:e(`form.urgency.urgent`),hint:e(`form.urgency.urgentHint`)},{value:`normal`,label:e(`form.urgency.normal`),hint:e(`form.urgency.normalHint`)},{value:`relaxed`,label:e(`form.urgency.relaxed`),hint:e(`form.urgency.relaxedHint`)}],Ve=e=>[{label:e(`form.cron.daily`),cron:`0 9 * * *`},{label:e(`form.cron.hourly`),cron:`0 * * * *`},{label:e(`form.cron.every10min`),cron:`*/10 * * * *`},{label:e(`form.cron.weekly`),cron:`0 9 * * 1`}],He=e=>[{value:`workspace-write`,label:e(`form.perm.write`),hint:e(`form.perm.writeHint`),icon:`📁`},{value:`read-only`,label:e(`form.perm.readOnly`),hint:e(`form.perm.readOnlyHint`),icon:`🔒`},{value:`danger-full-access`,label:e(`form.perm.fullAccess`),hint:e(`form.perm.fullAccessHint`),icon:`⚡`}];function $({label:e,required:t=!1,full:r=!1,children:i}){return(0,n.jsxs)(`label`,{className:`dsh-atb-field`,"data-span":r?`full`:void 0,children:[(0,n.jsxs)(`span`,{className:`dsh-atb-field-label`,children:[e,t&&(0,n.jsx)(`em`,{className:`dsh-atb-req`,children:`*`})]}),i]})}function Ue({rows:e,onChange:t,editing:r}){let i=R(),a=(n,r)=>{t(e.map((e,t)=>t===n?{...e,...r}:e))},o=e.filter(e=>e.checked).length;return(0,n.jsxs)(`div`,{className:`dsh-atb-cke`,children:[e.map((o,s)=>(0,n.jsxs)(`div`,{className:`dsh-atb-cke-row`,children:[r&&(0,n.jsx)(`input`,{type:`checkbox`,className:`dsh-atb-cke-box`,checked:o.checked,title:i(`form.check.checkedTitle`,{who:o.checkedBy??i(`form.check.notCheckedYet`)}),onChange:e=>a(s,{checked:e.target.checked})}),(0,n.jsx)(`input`,{className:`dsh-atb-cke-text`,value:o.text,maxLength:200,placeholder:i(`form.check.itemPlaceholder`,{n:s+1}),spellCheck:!1,onChange:e=>a(s,{text:e.target.value})}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cke-del`,title:i(`form.check.removeTitle`),onClick:()=>t(e.filter((e,t)=>t!==s)),children:`✕`})]},o.id??`new-${s}`)),e.length<30&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cke-add`,onClick:()=>t([...e,{text:``,checked:!1}]),children:i(`form.check.add`)}),e.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-cke-hint`,children:r?i(`form.check.hintEdit`,{checked:o,total:e.length}):i(`form.check.hintCreate`,{n:e.length})})]})}function We({controller:t,task:r}){let i=R(),a=t.getSnapshot(),o=a.templatePrefill,s=r!==void 0,[c,l]=(0,e.useState)(r?.title??o?.title??``),[u,d]=(0,e.useState)(r?.description??o?.description??``),[f,h]=(0,e.useState)(r?.prompt??o?.prompt??``),[v,b]=(0,e.useState)(r?.workspaceId??a.filters.workspaceId??a.workspaces[0]?.id??``),[x,S]=(0,e.useState)(r?.urgency??(o?.urgency===`urgent`||o?.urgency===`relaxed`?o.urgency:`normal`)),[C,w]=(0,e.useState)(r?.execution.mode===`scheduled`||o?.execution?.mode===`scheduled`?`scheduled`:`claim`),[T,E]=(0,e.useState)(r?.execution.cron??o?.execution?.cron??`0 9 * * *`),[D,O]=(0,e.useState)([]),k=r?.model??o?.model??(s?void 0:Re()),[A,j]=(0,e.useState)(k===void 0?``:JSON.stringify({provider:k.provider,model:k.model})),[M,N]=(0,e.useState)(k?.reasoningEffort??``),P=r?.presetId??o?.presetId??``,[F,ee]=(0,e.useState)(P),[te,I]=(0,e.useState)([]),[ne,L]=(0,e.useState)(void 0),[z,re]=(0,e.useState)(r?.permission??(o?.permission?p(o.permission):g(a.ledger.settings))),[ie,ae]=(0,e.useState)(r?.isolation??(o?.isolation===`none`?`none`:o?.isolation===`worktree`?`worktree`:m(a.ledger.settings))),[oe,se]=(0,e.useState)(r?.checklist!==void 0&&r.checklist.length>0?r.checklist.map(e=>({...e})):(o?.checklist??[]).map(e=>({text:e,checked:!1}))),ce=(0,e.useRef)(null),[B,V]=(0,e.useState)(!1);(0,e.useEffect)(()=>{ce.current?.focus();let e=e=>{e.key===`Escape`&&t.closeForm()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,e.useEffect)(()=>{t.fetchModelCatalog().then(O).catch(()=>O([]))},[t]),(0,e.useEffect)(()=>{t.fetchPresetCatalog().then(e=>{I(e.presets),L(e.defaultId),!s&&P===``&&e.defaultId!==void 0&&ee(e.defaultId)}).catch(()=>I([]))},[t,s,r?.presetId,P]);let le=C===`scheduled`?_(T.trim()):null,H=le===null?null:y(le,Date.now()),ue=C===`scheduled`&&(le===null||H===null),U=c.trim().length>0&&v!==``&&!ue,de=s&&r.status===`in_progress`,W=s&&((r.executions?.length??0)>0||r.status===`in_progress`),G=t.gitAvailable(v),K=t.repoCount(v),q=W||!G,fe=()=>{if(G)return ie},pe=()=>F.trim().length>0?F.trim():void 0,me=()=>oe.map(e=>({...e,text:e.text.trim()})).filter(e=>e.text.length>0),J=A===``?void 0:JSON.parse(A),Y=(J===void 0?void 0:D.find(e=>e.provider===J.provider&&e.model===J.model))?.reasoning,he=()=>{if(J===void 0)return;let e=M.trim();return{provider:J.provider,model:J.model,...e.length>0?{reasoningEffort:e}:{}}},ge=()=>{if(!U||B)return;let e=he();s||ze(e);let n=fe(),i=pe(),a=me();V(!0),(s?t.update(r.id,r.version,{title:c,description:u,prompt:f,urgency:x,workspaceId:v,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e??null,...n!==void 0&&!W?{isolation:n}:{},presetId:i??null,permission:z,checklist:a.length>0?a:null}):t.create({title:c,workspaceId:v,urgency:x,description:u.length>0?u:void 0,prompt:f.length>0?f:void 0,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e,...n===void 0?{}:{isolation:n},...i===void 0?{}:{presetId:i},permission:z,...a.length>0?{checklist:a.map(e=>e.text)}:{}})).catch(()=>void 0).finally(()=>V(!1))},_e=()=>{if(!U||de||B)return;let e=he();s||ze(e);let n=fe(),i=pe(),a=me();V(!0),(async()=>{if(s)await t.update(r.id,r.version,{title:c,description:u,prompt:f,urgency:x,workspaceId:v,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e??null,...n!==void 0&&!W?{isolation:n}:{},presetId:i??null,permission:z,checklist:a.length>0?a:null})&&await t.run(r.id);else{let r=await t.create({title:c,workspaceId:v,urgency:x,description:u.length>0?u:void 0,prompt:f.length>0?f:void 0,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e,...n===void 0?{}:{isolation:n},...i===void 0?{}:{presetId:i},permission:z,...a.length>0?{checklist:a.map(e=>e.text)}:{}});r!==void 0&&await t.run(r)}})().catch(()=>void 0).finally(()=>V(!1))},ve=U?C===`scheduled`&&H!==null?i(`form.hint.nextRun`,{time:X(H)}):s?i(`form.hint.saveVersion`,{v:r.version,next:r.version+1}):i(`form.hint.createClaim`):c.trim().length===0?i(`form.hint.needTitle`):i(v===``?`form.hint.needProject`:`form.hint.cronBad`);return(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&t.closeForm()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-taskform-modal`,"data-mode":s?`edit`:`create`,role:`dialog`,"aria-modal":`true`,"aria-label":i(s?`form.title.edit`:`form.title.create`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:s?`✎`:`✚`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:i(s?`form.title.edit`:`form.title.create`)}),(0,n.jsx)(`p`,{children:i(s?`form.subtitle.edit`:`form.subtitle.create`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":i(`shared.close`),onClick:()=>t.closeForm(),children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body dsh-atb-taskform-body`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-form-col dsh-atb-form-left`,children:[(0,n.jsx)($,{label:i(`form.field.title`),required:!0,full:!0,children:(0,n.jsx)(`input`,{ref:ce,value:c,onChange:e=>l(e.target.value),placeholder:i(`form.field.titlePlaceholder`),maxLength:200})}),(0,n.jsxs)(`div`,{className:`dsh-atb-form-subgrid`,children:[(0,n.jsx)($,{label:i(`form.field.project`),required:!0,children:(0,n.jsx)(`select`,{value:v,onChange:e=>b(e.target.value),children:a.workspaces.map(e=>(0,n.jsx)(`option`,{value:e.id,children:e.title||e.path},e.id))})}),(0,n.jsx)($,{label:i(`form.field.model`),children:(0,n.jsxs)(`select`,{value:A,onChange:e=>{let t=e.target.value;if(j(t),t===``)N(``);else{let e=JSON.parse(t),n=D.find(t=>t.provider===e.provider&&t.model===e.model);n?.reasoning?.defaultEffort===void 0?N(``):N(n.reasoning.defaultEffort)}},children:[(0,n.jsx)(`option`,{value:``,children:i(`form.field.modelDefault`)}),D.map(e=>(0,n.jsx)(`option`,{value:JSON.stringify({provider:e.provider,model:e.model}),children:i(`form.model.option`,{name:e.name??e.model,provider:e.provider})},`${e.provider}/${e.model}`))]})}),J!==void 0&&(0,n.jsx)($,{label:i(`form.field.effort`),children:(0,n.jsxs)(`select`,{value:M,onChange:e=>N(e.target.value),title:i(`form.field.effortTitle`),children:[(0,n.jsxs)(`option`,{value:``,children:[i(`form.effort.follow`),Y?.defaultEffort===void 0?``:i(`shared.current`,{name:Y.efforts.find(e=>e.id===Y.defaultEffort)?.name??Y.defaultEffort})]}),Y!==void 0&&Y.efforts.length>0?Y.efforts.map(e=>(0,n.jsxs)(`option`,{value:e.id,children:[e.name,e.description?` (${e.description})`:``]},e.id)):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`option`,{value:`low`,children:i(`form.effort.low`)}),(0,n.jsx)(`option`,{value:`medium`,children:i(`form.effort.medium`)}),(0,n.jsx)(`option`,{value:`high`,children:i(`form.effort.high`)}),(0,n.jsx)(`option`,{value:`none`,children:i(`form.effort.none`)})]})]})}),te.length>0&&(0,n.jsx)($,{label:i(`form.field.preset`),children:(0,n.jsxs)(`select`,{value:F,onChange:e=>ee(e.target.value),title:i(`form.field.presetTitle`),children:[(0,n.jsxs)(`option`,{value:``,children:[i(`form.preset.follow`),ne===void 0?``:i(`shared.current`,{name:te.find(e=>e.id===ne)?.name??ne})]}),te.map(e=>(0,n.jsxs)(`option`,{value:e.id,children:[e.name??e.id,e.id===ne?i(`form.preset.defaultTag`):``]},e.id))]})})]}),(0,n.jsx)($,{label:i(`form.field.urgency`),full:!0,children:(0,n.jsx)(`div`,{className:`dsh-atb-urgency-picker`,children:Be(i).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-urgency-opt`,"data-urgency":e.value,"data-on":x===e.value,onClick:()=>S(e.value),children:[(0,n.jsxs)(`span`,{className:`dsh-atb-urgency-name`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-urgency":e.value}),e.label]}),(0,n.jsx)(`span`,{className:`dsh-atb-urgency-hint`,children:e.hint})]},e.value))})}),(0,n.jsx)($,{label:i(`form.field.permission`),full:!0,children:(0,n.jsx)(`div`,{className:`dsh-atb-perm-picker`,children:He(i).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":z===e.value,onClick:()=>re(e.value),children:[(0,n.jsxs)(`span`,{className:`dsh-atb-perm-name`,children:[e.icon,` `,e.label,e.value===`workspace-write`?i(`form.perm.defaultTag`):``]}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:e.hint})]},e.value))})}),(0,n.jsx)($,{label:i(`form.field.mode`),full:!0,children:(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":C===`claim`,onClick:()=>w(`claim`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.mode.claim`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(`form.mode.claimHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":C===`scheduled`,onClick:()=>w(`scheduled`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.mode.scheduled`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(`form.mode.scheduledHint`)})]})]})}),C===`scheduled`&&(0,n.jsxs)($,{label:i(`form.field.cron`),required:!0,full:!0,children:[(0,n.jsx)(`input`,{className:ue?`dsh-atb-input-bad`:void 0,value:T,onChange:e=>E(e.target.value),placeholder:i(`form.cron.placeholder`),spellCheck:!1}),(0,n.jsxs)(`span`,{className:`dsh-atb-cron-presets`,children:[Ve(i).map(e=>(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cron-preset`,"data-on":T.trim()===e.cron,onClick:()=>E(e.cron),children:e.label},e.cron)),!ue&&H!==null&&(0,n.jsx)(`span`,{className:`dsh-atb-cron-next`,children:i(`form.cron.next`,{time:X(H)})})]})]}),(0,n.jsxs)($,{label:i(`form.field.isolation`),full:!0,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,"data-disabled":q?`true`:void 0,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":ie===`worktree`,disabled:q,title:i(W?`form.iso.locked`:G?`form.iso.worktreeTitle`:`form.iso.nonGit`),onClick:()=>ae(`worktree`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.iso.worktree`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(W?`form.iso.lockedShort`:G?`form.iso.worktreeHint`:`form.iso.nonGit`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":ie===`none`,disabled:q,title:i(W?`form.iso.locked`:`form.iso.noneTitle`),onClick:()=>ae(`none`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.iso.none`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(W?`form.iso.lockedShort`:G?`form.iso.noneHint`:`form.iso.noneHintNonGit`)})]})]}),!G&&!W&&(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:i(`form.iso.nonGitNote`)}),G&&!W&&K>1&&(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,"data-mirror":`true`,children:i(`form.iso.mirrorNote`,{n:K})})]}),(0,n.jsx)($,{label:i(s?`form.field.checklist`:`form.field.checklistOptional`),full:!0,children:(0,n.jsx)(Ue,{rows:oe,onChange:se,editing:s})})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-form-col dsh-atb-form-right`,children:[(0,n.jsx)($,{label:i(s?`form.field.description`:`form.field.descriptionOptional`),full:!0,children:(0,n.jsx)(Ie,{value:u,onChange:d,controller:t,rows:7,placeholder:i(`form.desc.placeholder`)})}),(0,n.jsx)($,{label:i(s?`form.field.prompt`:`form.field.promptOptional`),full:!0,children:(0,n.jsx)(Ie,{value:f,onChange:h,controller:t,rows:7,placeholder:i(`form.prompt.placeholder`)})})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,"data-tone":U?void 0:`bad`,children:ve}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.closeForm(),children:i(`shared.cancel`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:!U||de||B,title:i(de?`form.action.runBlockedTitle`:B?`form.action.runBusyTitle`:`form.action.runTitle`),onClick:_e,children:i(`form.action.run`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:!U||B,onClick:ge,children:i(s?`form.action.save`:`form.action.create`)})]})]})]})})}const Ge=e=>[{value:`none`,name:e(`form.iso.none`),hint:e(`set.iso.noneHint`)},{value:`worktree`,name:e(`form.iso.worktree`),hint:e(`set.iso.worktreeHint`)}];function Ke({controller:t}){let r=R(),i=t.getSnapshot(),a=i.ledger.settings?.defaultIsolation??`none`,o=h(i.ledger.settings),s=g(i.ledger.settings),[c,l]=(0,e.useState)(a),[u,d]=(0,e.useState)(o),[f,p]=(0,e.useState)(s),m=c!==a||u!==o||f!==s;return(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&t.closeSettings()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-set`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`set.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`🛠`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`set.title`)}),(0,n.jsx)(`p`,{children:r(`set.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:()=>t.closeSettings(),children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body`,children:[(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.iso.heading`)}),(0,n.jsx)(`div`,{className:`dsh-atb-mode-picker`,children:Ge(r).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":c===e.value,title:e.hint,onClick:()=>l(e.value),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:e.name}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:e.hint})]},e.value))}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(`set.iso.current`,{current:r(a===`worktree`?`form.iso.worktree`:`form.iso.none`)})})]}),(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.sync.heading`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":!u,title:r(`set.sync.off.title`),onClick:()=>d(!1),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`set.sync.off.name`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`set.sync.off.hint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":u,title:r(`set.sync.on.title`),onClick:()=>d(!0),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`set.sync.on.name`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`set.sync.on.hint`)})]})]}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(o?`set.sync.stateOn`:`set.sync.stateOff`)})]}),(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.perm.heading`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-perm-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`workspace-write`,onClick:()=>p(`workspace-write`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.writeName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.writeHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`read-only`,onClick:()=>p(`read-only`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.readOnlyName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.readOnlyHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`danger-full-access`,onClick:()=>p(`danger-full-access`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.fullName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.fullHint`)})]})]}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(`set.perm.current`,{current:r(s===`read-only`?`set.perm.readOnlyName`:s===`danger-full-access`?`set.perm.fullName`:`set.perm.writeName`)})})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(m?`set.foot.dirty`:`set.foot.clean`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.closeSettings(),children:r(`shared.cancel`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:!m,onClick:()=>{t.updateSettings({defaultIsolation:c,syncExternalSessions:u,defaultPermission:f}).then(e=>{e&&t.closeSettings()})},children:r(`set.action.save`)})]})]})]})})}function qe({row:e}){return(0,n.jsxs)(`div`,{className:`dsh-atb-imp-row`,title:e.id,children:[(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-title`,children:e.title}),(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-status`,children:e.status})]})}function Je({controller:t}){let r=R(),[i,a]=(0,e.useState)(``),[o,s]=(0,e.useState)(null),[c,l]=(0,e.useState)(void 0),[u,d]=(0,e.useState)(void 0),[f,p]=(0,e.useState)(`merge`),[m,h]=(0,e.useState)(!1),[g,_]=(0,e.useState)(void 0),[v,y]=(0,e.useState)(!1),b=(0,e.useRef)(null),{alert:x,el:S}=be(),C=e=>{d(void 0),l(void 0),_(void 0),y(!1),a(``),s(null),e!==void 0&&e.text().then(n=>{try{let r=JSON.parse(n);s(r),a(e.name),t.importPreview(r).then(e=>{e!==void 0&&d(e)})}catch{l(r(`imp.parseError`))}})},w=()=>{if(!(o===null||u===void 0||m)){if(f===`replace`&&!v){y(!0);return}h(!0),t.importCommit(f,o).then(e=>{h(!1),y(!1),e!==void 0&&_(e.mode===`replace`?r(`imp.result.replace`,{n:e.created+e.overwritten,total:e.replacedTotal??0}):r(`imp.result.merge`,{n:e.created,m:e.overwritten}))})}},T=()=>t.closeImport();return(0,n.jsxs)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&T()},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-imp`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`imp.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⬆`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`imp.title`)}),(0,n.jsx)(`p`,{children:r(`imp.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:T,children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-picker`,children:[(0,n.jsx)(`input`,{ref:b,type:`file`,accept:`.json,application/json`,onChange:e=>C(e.target.files?.[0])}),i.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-imp-filename`,children:i})]}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-note`,children:r(`imp.note`)}),c!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-imp-error`,children:c}),u===void 0&&c===void 0&&i.length>0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:r(`imp.previewing`)}),u!==void 0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stats`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":`ok`,children:[(0,n.jsx)(`b`,{children:u.create.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.create`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":`warn`,children:[(0,n.jsx)(`b`,{children:u.overwrite.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.overwrite`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":u.invalid.length>0?`bad`:void 0,children:[(0,n.jsx)(`b`,{children:u.invalid.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.invalid`)})]})]}),u.create.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.create`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.create.map(e=>(0,n.jsx)(qe,{row:e},e.id))})]}),u.overwrite.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.overwrite`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.overwrite.map(e=>(0,n.jsx)(qe,{row:e},e.id))})]}),u.invalid.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.invalid`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.invalid.map((e,t)=>(0,n.jsxs)(`div`,{className:`dsh-atb-imp-row`,"data-tone":`bad`,title:e.id??``,children:[(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-title`,children:e.id??r(`imp.noId`)}),(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-status`,children:e.reason})]},e.id??`invalid-${t}`))})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":f===`merge`,onClick:()=>{p(`merge`),y(!1)},children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`imp.mode.merge`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`imp.mode.mergeHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":f===`replace`,onClick:()=>p(`replace`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`imp.mode.replace`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`imp.mode.replaceHint`)})]})]}),g!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-imp-result`,children:g})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(f===`replace`?v?`imp.foot.replaceConfirm`:`imp.foot.replaceNeedConfirm`:`imp.foot.mergeHint`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:T,children:r(g===void 0?`shared.cancel`:`shared.close`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,"data-danger":f===`replace`&&v?`true`:void 0,disabled:u===void 0||m,onClick:w,children:r(f===`replace`&&v?`imp.action.confirmReplace`:`imp.action.run`)})]})]})]}),S]})}function Ye({controller:t}){let r=R(),i=t.getSnapshot(),[a,o]=(0,e.useState)({}),[s,c]=(0,e.useState)(void 0),{alert:l,el:u}=be(),d=()=>t.closeTemplateManager(),f=e=>a[e.id]??Y(e),p=e=>{if(e===void 0)return``;let t=q[e];return t===void 0?` · ${e}`:` · ${r(t)}`},m=(e,n)=>{let a=i.templates.find(t=>t.id===e);a===void 0||n===Y(a)||t.upsertTemplate({id:e,name:n,task:a.task}).then(t=>{t&&(o(t=>{let n={...t};return delete n[e],n}),l(r(`tpl.renamed`)))})};return(0,n.jsxs)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&d()},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-tplm`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`tpl.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⌗`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`tpl.title`)}),(0,n.jsx)(`p`,{children:r(`tpl.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:d,children:`✕`})]}),(0,n.jsx)(`div`,{className:`dsh-atb-modal-body`,children:i.templates.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:r(`tpl.empty`)}):(0,n.jsx)(`div`,{className:`dsh-atb-tplm-list`,children:i.templates.map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-tplm-row`,children:[(0,n.jsx)(`input`,{className:`dsh-atb-tplm-name`,value:f(e),maxLength:60,spellCheck:!1,"aria-label":r(`tpl.name.aria`,{name:Y(e)}),onChange:t=>o(n=>({...n,[e.id]:t.target.value})),onKeyDown:t=>{t.key===`Enter`&&m(e.id,f(e))}}),(0,n.jsxs)(`span`,{className:`dsh-atb-tplm-meta`,title:`${e.builtin===!0?r(`tpl.builtin`):r(`tpl.custom`)}${e.task.checklist!==void 0&&e.task.checklist.length>0?r(`tpl.meta.checklist`,{n:e.task.checklist.length}):``}${p(e.task.urgency)}${e.task.permission===void 0?``:` · ${r(`shared.permission`)}: ${e.task.permission}`}`,children:[e.builtin===!0?r(`tpl.builtin`):r(`tpl.custom`),e.task.checklist!==void 0&&e.task.checklist.length>0?r(`tpl.meta.checklist`,{n:e.task.checklist.length}):``,p(e.task.urgency),e.task.permission!==void 0&&e.task.permission!==`workspace-write`?` · ${e.task.permission===`read-only`?r(`tpl.meta.permReadOnly`):r(`tpl.meta.permFull`)}`:``]}),(0,n.jsxs)(`span`,{className:`dsh-atb-tplm-btns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:f(e)===Y(e)||f(e).trim().length===0,title:r(`tpl.rename.title`),onClick:()=>m(e.id,f(e)),children:r(`tpl.rename.button`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`tpl.use.title`),onClick:()=>{d(),t.newFromTemplate(he(e))},children:r(`tpl.use.button`)}),s===e.id?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{t.deleteTemplate(e.id),c(void 0)},children:r(`shared.confirmDelete`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>c(void 0),children:r(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,title:r(`tpl.delete.title`),onClick:()=>c(e.id),children:`🗑`})]})]},e.id))})}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(`tpl.foot.hint`)}),(0,n.jsx)(`span`,{className:`dsh-atb-modal-footbtns`,children:(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:d,children:r(`shared.close`)})})]})]}),u]})}const Xe={urgent:0,normal:1,relaxed:2};function Ze(e,t){let n=e.search.trim().toLowerCase(),r=t.filter(t=>(e.filters.workspaceId===void 0||t.workspaceId===e.filters.workspaceId)&&(e.filters.urgencies.length===0||e.filters.urgencies.includes(t.urgency))&&(n.length===0||t.title.toLowerCase().includes(n)||t.id.toLowerCase().includes(n)));if(e.sortBy==="default")return r;let i=[...r];return e.sortBy===`updated`?i.sort((e,t)=>t.updatedAt-e.updatedAt):e.sortBy===`created`?i.sort((e,t)=>t.createdAt-e.createdAt):e.sortBy===`urgency`?i.sort((e,t)=>Xe[e.urgency]-Xe[t.urgency]||t.updatedAt-e.updatedAt):e.sortBy===`title`&&i.sort((e,t)=>e.title.localeCompare(t.title,void 0,{numeric:!0})),i}function Qe({controller:t}){let r=R(),i=(0,e.useSyncExternalStore)(e=>t.subscribe(e),()=>t.getSnapshot()),[a,o]=(0,e.useState)(()=>Date.now());(0,e.useEffect)(()=>{let e=setInterval(()=>o(Date.now()),6e4);return()=>clearInterval(e)},[]);let s=Ze(i,i.ledger.tasks.filter(e=>e.trashedAt===void 0)),c=i.selectedId===void 0?void 0:i.ledger.tasks.find(e=>e.id===i.selectedId),{alert:u,el:d}=be(),[p,m]=(0,e.useState)(!1),h=()=>m(!1),[g,_]=(0,e.useState)(!1),v=()=>_(!1);return(0,n.jsxs)(`div`,{className:`dsh-atb-board`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-toolbar`,children:[(0,n.jsx)(`h2`,{className:`dsh-atb-title`,children:r(`board.title`)}),(0,n.jsx)(`span`,{className:`dsh-atb-count`,children:r(`board.count.tasks`,{n:s.length,rev:i.ledger.revision})}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{let e=!p;m(e),e&&t.prepareTemplateMenu()},children:r(`board.action.newTask`)}),p&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-backdrop`,onClick:h}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu-list`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,onClick:()=>{h(),t.setComposer(!0)},children:r(`board.action.blankTask`)}),i.templates.map(e=>{let r=Y(e),i=he(e);return(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:i.description!==void 0&&i.description.length>0?i.description.slice(0,120):r,onClick:()=>{h(),t.newFromTemplate(i)},children:r},e.id)}),(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-sep`}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,onClick:()=>{h(),t.openTemplateManager()},children:r(`board.action.manageTemplates`)})]})]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-spacer`}),(0,n.jsx)(`input`,{className:`dsh-atb-input dsh-atb-search`,value:i.search,placeholder:r(`board.search.placeholder`),spellCheck:!1,onChange:e=>t.setSearch(e.target.value)}),(0,n.jsxs)(`select`,{className:`dsh-atb-select`,value:i.filters.workspaceId??``,onChange:e=>t.setWorkspaceFilter(e.target.value===``?void 0:e.target.value),children:[(0,n.jsx)(`option`,{value:``,children:r(`board.filter.allProjects`)}),i.workspaces.map(e=>(0,n.jsx)(`option`,{value:e.id,children:e.title||e.path},e.id))]}),(0,n.jsxs)(`select`,{className:`dsh-atb-select`,value:i.sortBy,title:r(`board.sort.title`),onChange:e=>t.setSortBy(e.target.value),children:[(0,n.jsx)(`option`,{value:`default`,children:r(`board.sort.default`)}),(0,n.jsx)(`option`,{value:`updated`,children:r(`board.sort.updated`)}),(0,n.jsx)(`option`,{value:`urgency`,children:r(`board.sort.urgency`)}),(0,n.jsx)(`option`,{value:`created`,children:r(`board.sort.created`)}),(0,n.jsx)(`option`,{value:`title`,children:r(`board.sort.byTitle`)})]}),[`urgent`,`normal`,`relaxed`].map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-chip`,"data-urgency":e,"data-on":i.filters.urgencies.includes(e),onClick:()=>t.toggleUrgency(e),children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-urgency":e}),r(q[e])]},e)),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.toggleSecondary(),children:i.secondaryOpen?r(`board.action.backToBoard`):r(`board.action.otherTasks`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.settingsTitle`),onClick:()=>t.openSettings(),children:r(`board.action.settings`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.diagTitle`),onClick:()=>t.openDiagnostics(),children:r(`board.action.diag`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.importTitle`),onClick:()=>t.openImport(),children:r(`board.action.import`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.exportTitle`),onClick:()=>_(!g),children:r(`board.action.export`)}),g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-backdrop`,onClick:v}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu-list`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:r(`board.export.jsonTitle`),onClick:()=>{v(),t.exportJson()},children:r(`board.export.json`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:r(`board.export.csvTitle`),onClick:()=>{v(),t.exportCsv()},children:r(`board.export.csv`)})]})]})]}),(0,n.jsxs)(`a`,{className:`dsh-atb-ver`,href:`https://github.com/cloader/dsh-taskboard`,target:`_blank`,rel:`noopener noreferrer`,children:[`V`,`0.6.7`]})]}),i.error!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-error`,children:i.error}),i.secondaryOpen?(0,n.jsx)(et,{controller:t,tasks:Ze(i,i.ledger.tasks)}):(0,n.jsx)(`div`,{className:`dsh-atb-columns`,children:l.map(e=>{let o=s.filter(t=>t.status===e);return(0,n.jsxs)(`div`,{className:`dsh-atb-column`,onDragOver:e=>{e.dataTransfer.types.includes(`application/x-dsh-atb-task`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,e.currentTarget.dataset.dragover=`true`)},onDragLeave:e=>{delete e.currentTarget.dataset.dragover},onDrop:n=>{n.preventDefault(),delete n.currentTarget.dataset.dragover;let a=n.dataTransfer.getData(_e);if(a.length===0)return;let o=i.ledger.tasks.find(e=>e.id===a);if(!(o===void 0||o.status===e)){if(!f(o.status,e)){u(r(`board.drag.forbidden`,{from:r(W[o.status]),to:r(W[e])}));return}t.move(a,o.version,e)}},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-colhead`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-status":e}),r(W[e]),(0,n.jsx)(`span`,{className:`dsh-atb-colcount`,children:o.length})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-cards`,children:[o.map(e=>(0,n.jsx)(ye,{task:e,controller:t,draggable:!0,now:a,onAlert:u},e.id)),o.length===0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.empty`)})]})]},e)})}),c!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-detailpanel`,children:(0,n.jsx)(Ne,{task:c,controller:t,now:a},c.id)}),i.composerOpen&&(0,n.jsx)(We,{controller:t,task:i.editingId===void 0?void 0:i.ledger.tasks.find(e=>e.id===i.editingId)}),i.diagOpen&&(0,n.jsx)($e,{controller:t}),i.settingsOpen&&(0,n.jsx)(Ke,{controller:t}),i.importOpen&&(0,n.jsx)(Je,{controller:t}),i.tplManagerOpen&&(0,n.jsx)(Ye,{controller:t}),d]})}function $e({controller:e}){let t=R(),r=e.getSnapshot(),i=r.diagnostics,a=e=>{let t=r.workspaces.find(t=>t.id===e);return t?.title??t?.path??e.slice(0,8)};return(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:t=>{t.target===t.currentTarget&&e.closeDiagnostics()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-diag`,role:`dialog`,"aria-modal":`true`,"aria-label":t(`diag.title`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⚙`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:t(`diag.title`)}),(0,n.jsx)(`p`,{children:t(`diag.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":t(`shared.close`),onClick:()=>e.closeDiagnostics(),children:`✕`})]}),(0,n.jsx)(`div`,{className:`dsh-atb-modal-body`,children:i===void 0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`shared.loading`)}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diag-grid`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,children:[(0,n.jsx)(`b`,{children:i.revision}),(0,n.jsx)(`span`,{children:t(`diag.revision`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,children:[(0,n.jsx)(`b`,{children:i.tasks}),(0,n.jsx)(`span`,{children:t(`diag.tasks`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,"data-bad":i.staleRunning>0?`true`:void 0,children:[(0,n.jsx)(`b`,{children:i.staleRunning}),(0,n.jsx)(`span`,{children:t(`diag.running`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,"data-bad":i.orphanWorktrees.length>0?`true`:void 0,children:[(0,n.jsx)(`b`,{children:i.orphanWorktrees.length}),(0,n.jsx)(`span`,{children:t(`diag.orphans`)})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:t(`diag.orphans.heading`)}),i.orphanWorktrees.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.orphans.none`)}):(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphans`,children:i.orphanWorktrees.map(r=>(0,n.jsxs)(`div`,{className:`dsh-atb-diag-orphan`,children:[(0,n.jsxs)(`span`,{className:`dsh-atb-diag-orphan-path`,title:r.path,children:[a(r.workspaceId),` · `,r.taskId]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>void e.cleanupOrphan(r.workspaceId,r.taskId),children:t(`diag.orphans.cleanup`)})]},r.path))}),(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.orphans.hint`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:t(`diag.gitignore.heading`)}),(i.gitIgnoreSuggestions??[]).length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.gitignore.none`)}):(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphans`,children:i.gitIgnoreSuggestions.map(e=>(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphan`,children:(0,n.jsxs)(`span`,{className:`dsh-atb-diag-orphan-path`,title:e.workspacePath,children:[a(e.workspaceId),` · `,t(`diag.gitignore.suggestA`),` `,(0,n.jsx)(`code`,{children:`.dsh-worktrees/`}),t(`diag.gitignore.suggestB`)]})},e.workspaceId))})]})]})})]})})}function et({controller:e,tasks:t}){let r=R(),i=t.filter(e=>e.trashedAt!==void 0),a=t.filter(e=>e.trashedAt===void 0&&e.status===`archived`),o=t.filter(e=>e.trashedAt===void 0&&e.status===`canceled`),s=[{label:r(`status.column.canceled`),dot:`canceled`,rows:o},{label:r(`status.column.archived`),dot:`archived`,rows:a},{label:r(`board.group.trashed`),dot:`trashed`,rows:i}];return i.length+a.length+o.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-secondary`,children:(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.secondary.empty`)})}):(0,n.jsx)(`div`,{className:`dsh-atb-columns`,children:s.map(t=>(0,n.jsxs)(`div`,{className:`dsh-atb-column`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-colhead`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-status":t.dot}),t.label,(0,n.jsx)(`span`,{className:`dsh-atb-colcount`,children:t.rows.length})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-cards`,children:[t.rows.map(t=>(0,n.jsx)(ye,{task:t,controller:e},t.id)),t.rows.length===0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.empty`)})]})]},t.label))})}function tt(e){let t=()=>{if((document.body.getAttribute(`data-dsh-desktop-platform`)??new URLSearchParams(window.location.search).get(`dsh-desktop-platform`))!==`win32`){delete e.dataset.dshAtbWindows,e.style.removeProperty(`--dsh-atb-viewport-top`);return}e.dataset.dshAtbWindows=``,e.style.setProperty(`--dsh-atb-viewport-top`,`${e.getBoundingClientRect().top}px`)},n,r=()=>{n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,t()}))},i=new MutationObserver(r);i.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:[`class`,`data-dsh-desktop-platform`,`data-dsh-desktop-mode`,`data-details-collapsed`]}),i.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dsh-atb-active`]});let a=typeof ResizeObserver>`u`?void 0:new ResizeObserver(r);return a?.observe(e),e.parentElement!==null&&a?.observe(e.parentElement),window.addEventListener(`resize`,r),r(),()=>{i.disconnect(),a?.disconnect(),window.removeEventListener(`resize`,r),n!==void 0&&cancelAnimationFrame(n),delete e.dataset.dshAtbWindows,e.style.removeProperty(`--dsh-atb-viewport-top`)}}const nt=`data-dsh-atb-active`,rt=[`data-dsh-taskboard-active`,`data-dsh-ssh-active`],it=`dsh-panel-activate`,at=`dsh-taskboard`;function ot(){return document.querySelector(`[data-pane="conversation"], [class*="centerCol"], .dshDesktopConversationSurface`)??void 0}function st(e){let r,i,a,o=()=>{if(i!==void 0)return;let o=ot();o!==void 0&&(i=document.createElement(`div`),i.dataset.dshAtbView=``,i.className=`dsh-atb-view`,o.appendChild(i),a=tt(i),r=(0,t.createRoot)(i),r.render((0,n.jsx)(Qe,{controller:e})))},s=new MutationObserver(()=>{o()});s.observe(document.body,{childList:!0,subtree:!0});let c=()=>{if(e.getSnapshot().boardOpen){for(let e of rt)document.documentElement.removeAttribute(e);document.documentElement.setAttribute(nt,``),document.dispatchEvent(new CustomEvent(it,{detail:at}))}else document.documentElement.removeAttribute(nt)},l=t=>{t.detail!==at&&e.getSnapshot().boardOpen&&e.closeBoard()},u=t=>{if(!e.getSnapshot().boardOpen)return;let n=t.target;n!==null&&n.closest(`[data-dsh-atb-entry]`)===null&&n.closest(`[class*="sessionRow"], [class*="projectRow"], [class*="searchResultRow"], [class*="searchResultWorkspace"], [class*="newSession"]`)!==null&&e.closeBoard()};document.addEventListener(`click`,u,!0),document.addEventListener(it,l);let d=e.subscribe(c);return c(),o(),()=>{document.removeEventListener(`click`,u,!0),document.removeEventListener(it,l),s.disconnect(),d(),a?.(),document.documentElement.removeAttribute(nt),r?.unmount(),i?.remove()}}function ct(e){let t=(e,t,n)=>e.list.getSnapshot().byId[n]===void 0?`absent`:t?.list.getSnapshot().archivedSessionIds.includes(n)??!1?`archived`:`openable`;return async n=>{let r=e.getSessions();if(r===void 0)return`unavailable`;try{let i=t(r,e.getWorkspaces(),n);if(i===`absent`){try{await r.refresh()}catch{}i=t(r,e.getWorkspaces(),n)}return i===`archived`?`archived`:i===`absent`?`missing`:(r.open(n),`opened`)}catch{return`unavailable`}}}const lt=[`connection`];function ut(e){try{se(),ee(e.get?.(`locale`),()=>e.get?.(`locale`));let t=c(),n=new ae(t);n.installModelCatalog(async()=>{try{let t=e.get?.(`modelDirectories`)??e.modelDirectories;if(t?.catalog?.load!==void 0){let e=await t.catalog.load();if(e?.groups!==void 0&&e.groups.length>0){let t=[];for(let n of e.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let t=e.get?.(`remote`)??e.remote;if(t?.session?.modelCatalog!==void 0){let e=await t.session.modelCatalog();if(e.ok&&e.value?.groups!==void 0&&e.value.groups.length>0){let t=[];for(let n of e.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}if(t?.llm?.models!==void 0){let e=await t.llm.models({});if(e.result.ok&&e.result.value?.groups!==void 0&&e.result.value.groups.length>0){let t=[];for(let n of e.result.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let t=e.get?.(`connection`)??e.connection;if(t?.api?.llm?.models!==void 0){let e=await t.api.llm.models({});if(e.result.ok&&e.result.value?.groups!==void 0&&e.result.value.groups.length>0){let t=[];for(let n of e.result.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let e=await t.modelCatalog();if(e.models!==void 0&&e.models.length>0)return e.models}catch{}return[]}),n.installPresetRoster(async()=>{try{let t=e.get?.(`remote`)??e.remote;if(t?.agentPresets?.list!==void 0){let e=await t.agentPresets.list(),n=e.ok===!0?e.value.presets:e.result?.ok===!0?e.result.value.presets:void 0;if(n!==void 0&&n.length>0){let e=n.map(e=>({id:e.id,name:e.name})),t=n.find(e=>e.isDefault);return{presets:e,...t===void 0?{}:{defaultId:t.id}}}}}catch{}try{let t=e.get?.(`connection`)??e.connection;if(t?.api?.agentPresets?.list!==void 0){let e=await t.api.agentPresets.list({});if(e.result.ok&&e.result.value?.presets!==void 0&&e.result.value.presets.length>0){let t=e.result.value.presets.map(e=>({id:e.id,name:e.name})),n=e.result.value.presets.find(e=>e.isDefault);return{presets:t,...n===void 0?{}:{defaultId:n.id}}}}}catch{}try{let e=await t.modelCatalog();if(e.presets!==void 0&&e.presets.length>0)return{presets:e.presets,...e.defaultPresetId===void 0?{}:{defaultId:e.defaultPresetId}}}catch{}return{presets:[]}}),n.installSessionJumper(ct({getSessions:()=>e.get?.(`sessions`),getWorkspaces:()=>e.get?.(`workspaces`)})),n.start();let r=[];try{r.push(de(n)),r.push(st(n))}catch(e){console.error(`[dsh-taskboard] mount failed:`,e)}e.effect?.(()=>()=>{for(let e of r.splice(0))e();n.dispose(),te()},`dsh-taskboard: client mount`)}catch(e){console.error(`[dsh-taskboard] client half failed to start:`,e)}}exports.apply=ut,exports.inject=lt,exports.name=`dsh-taskboard/client`;
|
|
991
|
+
`,t=/\s/.test(e)||r===0,i=n.slice(r+1),a=!/\s/.test(i);if(t&&a){A(r),O(i),E(!0);return}}E(!1)},R=e=>{let n=g.current;if(n===null||k<0)return;let r=n.selectionStart,a=t.slice(0,k),o=t.slice(r),s=`/${e.name} `;i(a+s+o),E(!1),setTimeout(()=>{if(g.current!==null){let e=k+s.length;g.current.focus(),g.current.setSelectionRange(e,e)}},0)},z=e=>{if(T&&I.length>0){if(e.key===`ArrowDown`){e.preventDefault(),M(e=>(e+1)%I.length);return}if(e.key===`ArrowUp`){e.preventDefault(),M(e=>(e-1+I.length)%I.length);return}if(e.key===`Enter`||e.key===`Tab`){let t=I[j];if(t!==void 0){e.preventDefault(),R(t);return}}if(e.key===`Escape`){e.preventDefault(),E(!1);return}}},B=(0,e.useCallback)(()=>{let e=g.current;if(e===null)return;let t=e.getBoundingClientRect(),n=window.innerHeight,r=_.current?.offsetHeight??0,i=r>0?r:240,a=t.top-6-8,o=n-8-(t.bottom+6),s=o>a,c=Math.min(i,Math.max(s?o:a,120)),l=s?t.bottom+6:t.top-6-c;x(e=>e.left===t.left&&e.top===l&&e.width===t.width&&e.maxHeight===c?e:{position:`fixed`,left:t.left,top:l,width:t.width,maxHeight:c,zIndex:100})},[]);return(0,e.useLayoutEffect)(()=>{T&&B()}),(0,e.useEffect)(()=>{if(T)return window.addEventListener(`scroll`,B,!0),window.addEventListener(`resize`,B),()=>{window.removeEventListener(`scroll`,B,!0),window.removeEventListener(`resize`,B)}},[T,B]),(0,n.jsxs)(`div`,{className:`dsh-atb-prompt-wrap ${d??``}`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-prompt-inner`,children:[(0,n.jsx)(`textarea`,{ref:g,className:`dsh-atb-prompt-input`,value:t,rows:s,maxLength:c,disabled:l||N,autoFocus:u,placeholder:o,"aria-label":f,onChange:e=>{i(e.target.value),L()},onKeyUp:L,onClick:L,onKeyDown:z,onPaste:e=>{let t=Oe(e.clipboardData.files);p&&t.length>0&&(e.preventDefault(),F(t))},onDragOver:e=>{p&&e.dataTransfer.types.includes(`Files`)&&e.preventDefault()},onDrop:e=>{let t=Oe(e.dataTransfer.files);p&&t.length>0&&(e.preventDefault(),F(t))}}),T&&I.length>0&&(0,r.createPortal)((0,n.jsxs)(`div`,{ref:_,className:`dsh-atb-slash-popup`,style:b,role:`listbox`,"aria-label":h(`slash.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-slash-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-slash-title`,children:h(`slash.title`)}),(0,n.jsx)(`span`,{className:`dsh-atb-slash-hint`,children:h(`slash.hint`)})]}),(0,n.jsx)(`div`,{ref:v,className:`dsh-atb-slash-list`,children:I.map((e,t)=>(0,n.jsxs)(`div`,{role:`option`,"aria-selected":t===j,className:`dsh-atb-slash-item`,"data-active":t===j?`true`:void 0,"data-kind":e.kind,onClick:()=>R(e),onMouseEnter:()=>M(t),children:[(0,n.jsx)(`span`,{className:`dsh-atb-slash-badge`,"data-kind":e.kind,children:e.kind===`command`?h(`slash.badge.command`):h(`slash.badge.skill`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-slash-name`,children:[`/`,e.name]}),e.hint&&(0,n.jsx)(`span`,{className:`dsh-atb-slash-param`,children:e.hint}),e.description&&(0,n.jsx)(`span`,{className:`dsh-atb-slash-desc`,children:e.description})]},`${e.kind}-${e.name}`))})]}),document.body)]}),p&&(0,n.jsxs)(`div`,{className:`dsh-atb-image-actions`,children:[(0,n.jsx)(`input`,{ref:y,type:`file`,accept:`image/png,image/jpeg,image/gif,image/webp`,multiple:!0,hidden:!0,onChange:e=>{e.target.files!==null&&F(e.target.files),e.target.value=``}}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-image-add`,disabled:l||N,onClick:()=>y.current?.click(),children:h(N?`image.uploading`:`image.add`)}),(0,n.jsx)(`span`,{className:`dsh-atb-image-hint`,children:h(`image.hint`)})]}),(0,n.jsx)(`div`,{className:`dsh-atb-prompt-foot`,children:(0,n.jsxs)(`span`,{className:`dsh-atb-prompt-tip`,children:[h(`slash.tipA`),` `,(0,n.jsx)(`code`,{children:`/`}),` `,h(`slash.tipB`)]})})]})}const We=`dsh-taskboard-last-model-v1`;function Ge(){try{let e=localStorage.getItem(We);if(e===null)return;let t=JSON.parse(e);if(typeof t==`object`&&t){let{provider:e,model:n,reasoningEffort:r}=t;if(typeof e==`string`&&typeof n==`string`&&e.trim().length>0&&n.trim().length>0)return{provider:e.trim(),model:n.trim(),...typeof r==`string`&&r.trim().length>0?{reasoningEffort:r.trim()}:{}}}return}catch{return}}function Ke(e){try{e===void 0?localStorage.removeItem(We):localStorage.setItem(We,JSON.stringify(e))}catch{}}const qe=e=>[{value:`urgent`,label:e(`form.urgency.urgent`),hint:e(`form.urgency.urgentHint`)},{value:`normal`,label:e(`form.urgency.normal`),hint:e(`form.urgency.normalHint`)},{value:`relaxed`,label:e(`form.urgency.relaxed`),hint:e(`form.urgency.relaxedHint`)}],Je=e=>[{label:e(`form.cron.daily`),cron:`0 9 * * *`},{label:e(`form.cron.hourly`),cron:`0 * * * *`},{label:e(`form.cron.every10min`),cron:`*/10 * * * *`},{label:e(`form.cron.weekly`),cron:`0 9 * * 1`}],Ye=e=>[{value:`workspace-write`,label:e(`form.perm.write`),hint:e(`form.perm.writeHint`),icon:`📁`},{value:`read-only`,label:e(`form.perm.readOnly`),hint:e(`form.perm.readOnlyHint`),icon:`🔒`},{value:`danger-full-access`,label:e(`form.perm.fullAccess`),hint:e(`form.perm.fullAccessHint`),icon:`⚡`}];function $({label:e,required:t=!1,full:r=!1,children:i}){return(0,n.jsxs)(`label`,{className:`dsh-atb-field`,"data-span":r?`full`:void 0,children:[(0,n.jsxs)(`span`,{className:`dsh-atb-field-label`,children:[e,t&&(0,n.jsx)(`em`,{className:`dsh-atb-req`,children:`*`})]}),i]})}function Xe({rows:e,onChange:t,editing:r}){let i=H(),a=(n,r)=>{t(e.map((e,t)=>t===n?{...e,...r}:e))},o=e.filter(e=>e.checked).length;return(0,n.jsxs)(`div`,{className:`dsh-atb-cke`,children:[e.map((o,s)=>(0,n.jsxs)(`div`,{className:`dsh-atb-cke-row`,children:[r&&(0,n.jsx)(`input`,{type:`checkbox`,className:`dsh-atb-cke-box`,checked:o.checked,title:i(`form.check.checkedTitle`,{who:o.checkedBy??i(`form.check.notCheckedYet`)}),onChange:e=>a(s,{checked:e.target.checked})}),(0,n.jsx)(`input`,{className:`dsh-atb-cke-text`,value:o.text,maxLength:200,placeholder:i(`form.check.itemPlaceholder`,{n:s+1}),spellCheck:!1,onChange:e=>a(s,{text:e.target.value})}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cke-del`,title:i(`form.check.removeTitle`),onClick:()=>t(e.filter((e,t)=>t!==s)),children:`✕`})]},o.id??`new-${s}`)),e.length<30&&(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cke-add`,onClick:()=>t([...e,{text:``,checked:!1}]),children:i(`form.check.add`)}),e.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-cke-hint`,children:r?i(`form.check.hintEdit`,{checked:o,total:e.length}):i(`form.check.hintCreate`,{n:e.length})})]})}function Ze({controller:t,task:r}){let i=H(),a=t.getSnapshot(),o=a.templatePrefill,s=r!==void 0,[c,l]=(0,e.useState)(r?.title??o?.title??``),[u,d]=(0,e.useState)(r?.description??o?.description??``),[f,p]=(0,e.useState)(r?.prompt??o?.prompt??``),[g,y]=(0,e.useState)(r?.workspaceId??a.filters.workspaceId??a.workspaces[0]?.id??``),[x,S]=(0,e.useState)(r?.urgency??(o?.urgency===`urgent`||o?.urgency===`relaxed`?o.urgency:`normal`)),[C,w]=(0,e.useState)(r?.execution.mode===`scheduled`||o?.execution?.mode===`scheduled`?`scheduled`:`claim`),[T,E]=(0,e.useState)(r?.execution.cron??o?.execution?.cron??`0 9 * * *`),[D,O]=(0,e.useState)([]),k=r?.model??o?.model??(s?void 0:Ge()),[A,j]=(0,e.useState)(k===void 0?``:JSON.stringify({provider:k.provider,model:k.model})),[M,N]=(0,e.useState)(k?.reasoningEffort??``),P=r?.presetId??o?.presetId??``,[F,I]=(0,e.useState)(P),[L,R]=(0,e.useState)([]),[z,B]=(0,e.useState)(void 0),[V,ee]=(0,e.useState)(r?.permission??(o?.permission?m(o.permission):_(a.ledger.settings))),[te,ne]=(0,e.useState)(r?.isolation??(o?.isolation===`none`?`none`:o?.isolation===`worktree`?`worktree`:h(a.ledger.settings))),[re,ie]=(0,e.useState)(r?.checklist!==void 0&&r.checklist.length>0?r.checklist.map(e=>({...e})):(o?.checklist??[]).map(e=>({text:e,checked:!1}))),ae=(0,e.useRef)(null),[oe,se]=(0,e.useState)(!1),[ce,le]=(0,e.useState)(!1);(0,e.useEffect)(()=>{ae.current?.focus();let e=e=>{e.key===`Escape`&&t.closeForm()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[t]),(0,e.useEffect)(()=>{t.fetchModelCatalog().then(O).catch(()=>O([]))},[t]),(0,e.useEffect)(()=>{t.fetchPresetCatalog().then(e=>{R(e.presets),B(e.defaultId),!s&&P===``&&e.defaultId!==void 0&&I(e.defaultId)}).catch(()=>R([]))},[t,s,r?.presetId,P]);let ue=C===`scheduled`?v(T.trim()):null,U=ue===null?null:b(ue,Date.now()),de=C===`scheduled`&&(ue===null||U===null),W=c.trim().length>0&&g!==``&&!de,fe=s&&r.status===`in_progress`,G=s&&((r.executions?.length??0)>0||r.status===`in_progress`),K=t.gitAvailable(g),q=t.repoCount(g),pe=G||!K,me=()=>{if(K)return te},he=()=>F.trim().length>0?F.trim():void 0,ge=()=>re.map(e=>({...e,text:e.text.trim()})).filter(e=>e.text.length>0),J=A===``?void 0:JSON.parse(A),Y=(J===void 0?void 0:D.find(e=>e.provider===J.provider&&e.model===J.model))?.reasoning,_e=()=>{if(J===void 0)return;let e=M.trim();return{provider:J.provider,model:J.model,...e.length>0?{reasoningEffort:e}:{}}},ve=()=>{if(!W||oe||ce)return;let e=_e();s||Ke(e);let n=me(),i=he(),a=ge();se(!0),(s?t.update(r.id,r.version,{title:c,description:u,prompt:f,urgency:x,workspaceId:g,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e??null,...n!==void 0&&!G?{isolation:n}:{},presetId:i??null,permission:V,checklist:a.length>0?a:null}):t.create({title:c,workspaceId:g,urgency:x,description:u.length>0?u:void 0,prompt:f.length>0?f:void 0,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e,...n===void 0?{}:{isolation:n},...i===void 0?{}:{presetId:i},permission:V,...a.length>0?{checklist:a.map(e=>e.text)}:{}})).catch(()=>void 0).finally(()=>se(!1))},ye=()=>{if(!W||fe||oe||ce)return;let e=_e();s||Ke(e);let n=me(),i=he(),a=ge();se(!0),(async()=>{if(s)await t.update(r.id,r.version,{title:c,description:u,prompt:f,urgency:x,workspaceId:g,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e??null,...n!==void 0&&!G?{isolation:n}:{},presetId:i??null,permission:V,checklist:a.length>0?a:null})&&await t.run(r.id);else{let r=await t.create({title:c,workspaceId:g,urgency:x,description:u.length>0?u:void 0,prompt:f.length>0?f:void 0,execution:C===`scheduled`?{mode:C,cron:T.trim()}:{mode:C},model:e,...n===void 0?{}:{isolation:n},...i===void 0?{}:{presetId:i},permission:V,...a.length>0?{checklist:a.map(e=>e.text)}:{}});r!==void 0&&await t.run(r)}})().catch(()=>void 0).finally(()=>se(!1))},be=W?C===`scheduled`&&U!==null?i(`form.hint.nextRun`,{time:X(U)}):s?i(`form.hint.saveVersion`,{v:r.version,next:r.version+1}):i(`form.hint.createClaim`):c.trim().length===0?i(`form.hint.needTitle`):i(g===``?`form.hint.needProject`:`form.hint.cronBad`);return(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&t.closeForm()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-taskform-modal`,"data-mode":s?`edit`:`create`,role:`dialog`,"aria-modal":`true`,"aria-label":i(s?`form.title.edit`:`form.title.create`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:s?`✎`:`✚`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:i(s?`form.title.edit`:`form.title.create`)}),(0,n.jsx)(`p`,{children:i(s?`form.subtitle.edit`:`form.subtitle.create`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":i(`shared.close`),onClick:()=>t.closeForm(),children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body dsh-atb-taskform-body`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-form-col dsh-atb-form-left`,children:[(0,n.jsx)($,{label:i(`form.field.title`),required:!0,full:!0,children:(0,n.jsx)(`input`,{ref:ae,value:c,onChange:e=>l(e.target.value),placeholder:i(`form.field.titlePlaceholder`),maxLength:200})}),(0,n.jsxs)(`div`,{className:`dsh-atb-form-subgrid`,children:[(0,n.jsx)($,{label:i(`form.field.project`),required:!0,children:(0,n.jsx)(`select`,{value:g,onChange:e=>y(e.target.value),children:a.workspaces.map(e=>(0,n.jsx)(`option`,{value:e.id,children:e.title||e.path},e.id))})}),(0,n.jsx)($,{label:i(`form.field.model`),children:(0,n.jsxs)(`select`,{value:A,onChange:e=>{let t=e.target.value;if(j(t),t===``)N(``);else{let e=JSON.parse(t),n=D.find(t=>t.provider===e.provider&&t.model===e.model);n?.reasoning?.defaultEffort===void 0?N(``):N(n.reasoning.defaultEffort)}},children:[(0,n.jsx)(`option`,{value:``,children:i(`form.field.modelDefault`)}),D.map(e=>(0,n.jsx)(`option`,{value:JSON.stringify({provider:e.provider,model:e.model}),children:i(`form.model.option`,{name:e.name??e.model,provider:e.provider})},`${e.provider}/${e.model}`))]})}),J!==void 0&&(0,n.jsx)($,{label:i(`form.field.effort`),children:(0,n.jsxs)(`select`,{value:M,onChange:e=>N(e.target.value),title:i(`form.field.effortTitle`),children:[(0,n.jsxs)(`option`,{value:``,children:[i(`form.effort.follow`),Y?.defaultEffort===void 0?``:i(`shared.current`,{name:Y.efforts.find(e=>e.id===Y.defaultEffort)?.name??Y.defaultEffort})]}),Y!==void 0&&Y.efforts.length>0?Y.efforts.map(e=>(0,n.jsxs)(`option`,{value:e.id,children:[e.name,e.description?` (${e.description})`:``]},e.id)):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`option`,{value:`low`,children:i(`form.effort.low`)}),(0,n.jsx)(`option`,{value:`medium`,children:i(`form.effort.medium`)}),(0,n.jsx)(`option`,{value:`high`,children:i(`form.effort.high`)}),(0,n.jsx)(`option`,{value:`none`,children:i(`form.effort.none`)})]})]})}),L.length>0&&(0,n.jsx)($,{label:i(`form.field.preset`),children:(0,n.jsxs)(`select`,{value:F,onChange:e=>I(e.target.value),title:i(`form.field.presetTitle`),children:[(0,n.jsxs)(`option`,{value:``,children:[i(`form.preset.follow`),z===void 0?``:i(`shared.current`,{name:L.find(e=>e.id===z)?.name??z})]}),L.map(e=>(0,n.jsxs)(`option`,{value:e.id,children:[e.name??e.id,e.id===z?i(`form.preset.defaultTag`):``]},e.id))]})})]}),(0,n.jsx)($,{label:i(`form.field.urgency`),full:!0,children:(0,n.jsx)(`div`,{className:`dsh-atb-urgency-picker`,children:qe(i).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-urgency-opt`,"data-urgency":e.value,"data-on":x===e.value,onClick:()=>S(e.value),children:[(0,n.jsxs)(`span`,{className:`dsh-atb-urgency-name`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-urgency":e.value}),e.label]}),(0,n.jsx)(`span`,{className:`dsh-atb-urgency-hint`,children:e.hint})]},e.value))})}),(0,n.jsx)($,{label:i(`form.field.permission`),full:!0,children:(0,n.jsx)(`div`,{className:`dsh-atb-perm-picker`,children:Ye(i).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":V===e.value,onClick:()=>ee(e.value),children:[(0,n.jsxs)(`span`,{className:`dsh-atb-perm-name`,children:[e.icon,` `,e.label,e.value===`workspace-write`?i(`form.perm.defaultTag`):``]}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:e.hint})]},e.value))})}),(0,n.jsx)($,{label:i(`form.field.mode`),full:!0,children:(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":C===`claim`,onClick:()=>w(`claim`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.mode.claim`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(`form.mode.claimHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":C===`scheduled`,onClick:()=>w(`scheduled`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.mode.scheduled`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(`form.mode.scheduledHint`)})]})]})}),C===`scheduled`&&(0,n.jsxs)($,{label:i(`form.field.cron`),required:!0,full:!0,children:[(0,n.jsx)(`input`,{className:de?`dsh-atb-input-bad`:void 0,value:T,onChange:e=>E(e.target.value),placeholder:i(`form.cron.placeholder`),spellCheck:!1}),(0,n.jsxs)(`span`,{className:`dsh-atb-cron-presets`,children:[Je(i).map(e=>(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-cron-preset`,"data-on":T.trim()===e.cron,onClick:()=>E(e.cron),children:e.label},e.cron)),!de&&U!==null&&(0,n.jsx)(`span`,{className:`dsh-atb-cron-next`,children:i(`form.cron.next`,{time:X(U)})})]})]}),(0,n.jsxs)($,{label:i(`form.field.isolation`),full:!0,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,"data-disabled":pe?`true`:void 0,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":te===`worktree`,disabled:pe,title:i(G?`form.iso.locked`:K?`form.iso.worktreeTitle`:`form.iso.nonGit`),onClick:()=>ne(`worktree`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.iso.worktree`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(G?`form.iso.lockedShort`:K?`form.iso.worktreeHint`:`form.iso.nonGit`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":te===`none`,disabled:pe,title:i(G?`form.iso.locked`:`form.iso.noneTitle`),onClick:()=>ne(`none`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:i(`form.iso.none`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:i(G?`form.iso.lockedShort`:K?`form.iso.noneHint`:`form.iso.noneHintNonGit`)})]})]}),!K&&!G&&(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:i(`form.iso.nonGitNote`)}),K&&!G&&q>1&&(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,"data-mirror":`true`,children:i(`form.iso.mirrorNote`,{n:q})})]}),(0,n.jsx)($,{label:i(s?`form.field.checklist`:`form.field.checklistOptional`),full:!0,children:(0,n.jsx)(Xe,{rows:re,onChange:ie,editing:s})})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-form-col dsh-atb-form-right`,children:[(0,n.jsx)($,{label:i(s?`form.field.description`:`form.field.descriptionOptional`),full:!0,children:(0,n.jsx)(Ue,{value:u,onChange:d,controller:t,rows:7,placeholder:i(`form.desc.placeholder`),allowImages:!0,onUploadingChange:le})}),(0,n.jsx)($,{label:i(s?`form.field.prompt`:`form.field.promptOptional`),full:!0,children:(0,n.jsx)(Ue,{value:f,onChange:p,controller:t,rows:7,placeholder:i(`form.prompt.placeholder`)})})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,"data-tone":W?void 0:`bad`,children:be}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.closeForm(),children:i(`shared.cancel`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:!W||fe||oe||ce,title:i(fe?`form.action.runBlockedTitle`:oe||ce?`form.action.runBusyTitle`:`form.action.runTitle`),onClick:ye,children:i(`form.action.run`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:!W||oe||ce,onClick:ve,children:i(s?`form.action.save`:`form.action.create`)})]})]})]})})}const Qe=e=>[{value:`none`,name:e(`form.iso.none`),hint:e(`set.iso.noneHint`)},{value:`worktree`,name:e(`form.iso.worktree`),hint:e(`set.iso.worktreeHint`)}];function $e({controller:t}){let r=H(),i=t.getSnapshot(),a=i.ledger.settings?.defaultIsolation??`none`,o=g(i.ledger.settings),s=_(i.ledger.settings),[c,l]=(0,e.useState)(a),[u,d]=(0,e.useState)(o),[f,p]=(0,e.useState)(s),[m,h]=(0,e.useState)(i.storage?.currentDirectory??``),[v,y]=(0,e.useState)(!1),[b,x]=(0,e.useState)(!1),S=c!==a||u!==o||f!==s,C=m.trim().length===0?i.storage?.defaultDirectory??``:m.trim(),w=i.storage!==void 0&&C!==i.storage.currentDirectory;return(0,e.useEffect)(()=>{!v&&i.storage!==void 0&&h(i.storage.currentDirectory)},[i.storage,v]),(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&t.closeSettings()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-set`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`set.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`🛠`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`set.title`)}),(0,n.jsx)(`p`,{children:r(`set.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:()=>t.closeSettings(),children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body`,children:[(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.iso.heading`)}),(0,n.jsx)(`div`,{className:`dsh-atb-mode-picker`,children:Qe(r).map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":c===e.value,title:e.hint,onClick:()=>l(e.value),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:e.name}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:e.hint})]},e.value))}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(`set.iso.current`,{current:r(a===`worktree`?`form.iso.worktree`:`form.iso.none`)})})]}),(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.sync.heading`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":!u,title:r(`set.sync.off.title`),onClick:()=>d(!1),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`set.sync.off.name`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`set.sync.off.hint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":u,title:r(`set.sync.on.title`),onClick:()=>d(!0),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`set.sync.on.name`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`set.sync.on.hint`)})]})]}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(o?`set.sync.stateOn`:`set.sync.stateOff`)})]}),(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.perm.heading`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-perm-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`workspace-write`,onClick:()=>p(`workspace-write`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.writeName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.writeHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`read-only`,onClick:()=>p(`read-only`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.readOnlyName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.readOnlyHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-perm-opt`,"data-on":f===`danger-full-access`,onClick:()=>p(`danger-full-access`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-perm-name`,children:r(`set.perm.fullName`)}),(0,n.jsx)(`span`,{className:`dsh-atb-perm-hint`,children:r(`set.perm.fullHint`)})]})]}),(0,n.jsx)(`span`,{className:`dsh-atb-isolation-note`,children:r(`set.perm.current`,{current:r(s===`read-only`?`set.perm.readOnlyName`:s===`danger-full-access`?`set.perm.fullName`:`set.perm.writeName`)})})]}),(0,n.jsxs)(`section`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:r(`set.storage.heading`)}),(0,n.jsx)(`p`,{className:`dsh-atb-isolation-note`,children:r(`set.storage.hint`)}),(0,n.jsx)(`input`,{className:`dsh-atb-input dsh-atb-storage-path`,value:m,disabled:i.storage===void 0||b,placeholder:i.storage?.defaultDirectory??r(`set.storage.loading`),onChange:e=>{h(e.target.value),y(!0)}}),i.storage!==void 0&&(0,n.jsxs)(`div`,{className:`dsh-atb-storage-meta`,children:[(0,n.jsx)(`span`,{children:r(`set.storage.current`,{path:i.storage.currentDirectory})}),(0,n.jsx)(`span`,{children:r(`set.storage.assets`,{count:i.storage.assetCount,size:(i.storage.assetBytes/1024/1024).toFixed(1)})}),i.storage.error!==void 0&&(0,n.jsx)(`span`,{className:`dsh-atb-storage-error`,children:i.storage.error})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-storage-actions`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:i.storage===void 0||b,onClick:()=>{h(i.storage?.defaultDirectory??``),y(!0)},children:r(`set.storage.default`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:i.storage===void 0||b||C.length===0,onClick:()=>{x(!0),t.checkStorage(C).finally(()=>x(!1))},children:r(`set.storage.check`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:!w||b,onClick:()=>{window.confirm(r(`set.storage.confirm`,{from:i.storage?.currentDirectory??``,to:C}))&&(x(!0),t.migrateStorage(C).then(e=>{e&&(y(!1),h(C))}).finally(()=>x(!1)))},children:r(b?`set.storage.migrating`:`set.storage.migrate`)})]})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(S?`set.foot.dirty`:`set.foot.clean`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.closeSettings(),children:r(`shared.cancel`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,disabled:!S,onClick:()=>{t.updateSettings({defaultIsolation:c,syncExternalSessions:u,defaultPermission:f}).then(e=>{e&&t.closeSettings()})},children:r(`set.action.save`)})]})]})]})})}function et({row:e}){return(0,n.jsxs)(`div`,{className:`dsh-atb-imp-row`,title:e.id,children:[(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-title`,children:e.title}),(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-status`,children:e.status})]})}function tt({controller:t}){let r=H(),[i,a]=(0,e.useState)(``),[o,s]=(0,e.useState)(null),[c,l]=(0,e.useState)(void 0),[u,d]=(0,e.useState)(void 0),[f,p]=(0,e.useState)(`merge`),[m,h]=(0,e.useState)(!1),[g,_]=(0,e.useState)(void 0),[v,y]=(0,e.useState)(!1),b=(0,e.useRef)(null),{alert:x,el:S}=xe(),C=e=>{d(void 0),l(void 0),_(void 0),y(!1),a(``),s(null),e!==void 0&&e.text().then(n=>{try{let r=JSON.parse(n);s(r),a(e.name),t.importPreview(r).then(e=>{e!==void 0&&d(e)})}catch{l(r(`imp.parseError`))}})},w=()=>{if(!(o===null||u===void 0||m)){if(f===`replace`&&!v){y(!0);return}h(!0),t.importCommit(f,o).then(e=>{h(!1),y(!1),e!==void 0&&_(e.mode===`replace`?r(`imp.result.replace`,{n:e.created+e.overwritten,total:e.replacedTotal??0}):r(`imp.result.merge`,{n:e.created,m:e.overwritten}))})}},T=()=>t.closeImport();return(0,n.jsxs)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&T()},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-imp`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`imp.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⬆`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`imp.title`)}),(0,n.jsx)(`p`,{children:r(`imp.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:T,children:`✕`})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-body`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-picker`,children:[(0,n.jsx)(`input`,{ref:b,type:`file`,accept:`.json,application/json`,onChange:e=>C(e.target.files?.[0])}),i.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-imp-filename`,children:i})]}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-note`,children:r(`imp.note`)}),c!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-imp-error`,children:c}),u===void 0&&c===void 0&&i.length>0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:r(`imp.previewing`)}),u!==void 0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stats`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":`ok`,children:[(0,n.jsx)(`b`,{children:u.create.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.create`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":`warn`,children:[(0,n.jsx)(`b`,{children:u.overwrite.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.overwrite`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-imp-stat`,"data-tone":u.invalid.length>0?`bad`:void 0,children:[(0,n.jsx)(`b`,{children:u.invalid.length}),(0,n.jsx)(`span`,{children:r(`imp.stat.invalid`)})]})]}),u.create.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.create`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.create.map(e=>(0,n.jsx)(et,{row:e},e.id))})]}),u.overwrite.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.overwrite`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.overwrite.map(e=>(0,n.jsx)(et,{row:e},e.id))})]}),u.invalid.length>0&&(0,n.jsxs)(`div`,{className:`dsh-atb-imp-sec`,children:[(0,n.jsx)(`h4`,{children:r(`imp.sec.invalid`)}),(0,n.jsx)(`div`,{className:`dsh-atb-imp-list`,children:u.invalid.map((e,t)=>(0,n.jsxs)(`div`,{className:`dsh-atb-imp-row`,"data-tone":`bad`,title:e.id??``,children:[(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-title`,children:e.id??r(`imp.noId`)}),(0,n.jsx)(`span`,{className:`dsh-atb-imp-row-status`,children:e.reason})]},e.id??`invalid-${t}`))})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-mode-picker`,children:[(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":f===`merge`,onClick:()=>{p(`merge`),y(!1)},children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`imp.mode.merge`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`imp.mode.mergeHint`)})]}),(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-mode-opt`,"data-on":f===`replace`,onClick:()=>p(`replace`),children:[(0,n.jsx)(`span`,{className:`dsh-atb-mode-name`,children:r(`imp.mode.replace`)}),(0,n.jsx)(`span`,{className:`dsh-atb-mode-hint`,children:r(`imp.mode.replaceHint`)})]})]}),g!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-imp-result`,children:g})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(f===`replace`?v?`imp.foot.replaceConfirm`:`imp.foot.replaceNeedConfirm`:`imp.foot.mergeHint`)}),(0,n.jsxs)(`span`,{className:`dsh-atb-modal-footbtns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:T,children:r(g===void 0?`shared.cancel`:`shared.close`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,"data-danger":f===`replace`&&v?`true`:void 0,disabled:u===void 0||m,onClick:w,children:r(f===`replace`&&v?`imp.action.confirmReplace`:`imp.action.run`)})]})]})]}),S]})}function nt({controller:t}){let r=H(),i=t.getSnapshot(),[a,o]=(0,e.useState)({}),[s,c]=(0,e.useState)(void 0),{alert:l,el:u}=xe(),d=()=>t.closeTemplateManager(),f=e=>a[e.id]??J(e),p=e=>{if(e===void 0)return``;let t=q[e];return t===void 0?` · ${e}`:` · ${r(t)}`},m=(e,n)=>{let a=i.templates.find(t=>t.id===e);a===void 0||n===J(a)||t.upsertTemplate({id:e,name:n,task:a.task}).then(t=>{t&&(o(t=>{let n={...t};return delete n[e],n}),l(r(`tpl.renamed`)))})};return(0,n.jsxs)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:e=>{e.target===e.currentTarget&&d()},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-tplm`,role:`dialog`,"aria-modal":`true`,"aria-label":r(`tpl.aria`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⌗`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:r(`tpl.title`)}),(0,n.jsx)(`p`,{children:r(`tpl.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":r(`shared.close`),onClick:d,children:`✕`})]}),(0,n.jsx)(`div`,{className:`dsh-atb-modal-body`,children:i.templates.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:r(`tpl.empty`)}):(0,n.jsx)(`div`,{className:`dsh-atb-tplm-list`,children:i.templates.map(e=>(0,n.jsxs)(`div`,{className:`dsh-atb-tplm-row`,children:[(0,n.jsx)(`input`,{className:`dsh-atb-tplm-name`,value:f(e),maxLength:60,spellCheck:!1,"aria-label":r(`tpl.name.aria`,{name:J(e)}),onChange:t=>o(n=>({...n,[e.id]:t.target.value})),onKeyDown:t=>{t.key===`Enter`&&m(e.id,f(e))}}),(0,n.jsxs)(`span`,{className:`dsh-atb-tplm-meta`,title:`${e.builtin===!0?r(`tpl.builtin`):r(`tpl.custom`)}${e.task.checklist!==void 0&&e.task.checklist.length>0?r(`tpl.meta.checklist`,{n:e.task.checklist.length}):``}${p(e.task.urgency)}${e.task.permission===void 0?``:` · ${r(`shared.permission`)}: ${e.task.permission}`}`,children:[e.builtin===!0?r(`tpl.builtin`):r(`tpl.custom`),e.task.checklist!==void 0&&e.task.checklist.length>0?r(`tpl.meta.checklist`,{n:e.task.checklist.length}):``,p(e.task.urgency),e.task.permission!==void 0&&e.task.permission!==`workspace-write`?` · ${e.task.permission===`read-only`?r(`tpl.meta.permReadOnly`):r(`tpl.meta.permFull`)}`:``]}),(0,n.jsxs)(`span`,{className:`dsh-atb-tplm-btns`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,disabled:f(e)===J(e)||f(e).trim().length===0,title:r(`tpl.rename.title`),onClick:()=>m(e.id,f(e)),children:r(`tpl.rename.button`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`tpl.use.title`),onClick:()=>{d(),t.newFromTemplate(Y(e))},children:r(`tpl.use.button`)}),s===e.id?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>{t.deleteTemplate(e.id),c(void 0)},children:r(`shared.confirmDelete`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>c(void 0),children:r(`shared.cancel`)})]}):(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,title:r(`tpl.delete.title`),onClick:()=>c(e.id),children:`🗑`})]})]},e.id))})}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-foot`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-hint`,children:r(`tpl.foot.hint`)}),(0,n.jsx)(`span`,{className:`dsh-atb-modal-footbtns`,children:(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:d,children:r(`shared.close`)})})]})]}),u]})}const rt={urgent:0,normal:1,relaxed:2};function it(e,t){let n=e.search.trim().toLowerCase(),r=t.filter(t=>(e.filters.workspaceId===void 0||t.workspaceId===e.filters.workspaceId)&&(e.filters.urgencies.length===0||e.filters.urgencies.includes(t.urgency))&&(n.length===0||t.title.toLowerCase().includes(n)||t.id.toLowerCase().includes(n)));if(e.sortBy==="default")return r;let i=[...r];return e.sortBy===`updated`?i.sort((e,t)=>t.updatedAt-e.updatedAt):e.sortBy===`created`?i.sort((e,t)=>t.createdAt-e.createdAt):e.sortBy===`urgency`?i.sort((e,t)=>rt[e.urgency]-rt[t.urgency]||t.updatedAt-e.updatedAt):e.sortBy===`title`&&i.sort((e,t)=>e.title.localeCompare(t.title,void 0,{numeric:!0})),i}function at({controller:t}){let r=H(),i=(0,e.useSyncExternalStore)(e=>t.subscribe(e),()=>t.getSnapshot()),[a,o]=(0,e.useState)(()=>Date.now());(0,e.useEffect)(()=>{let e=setInterval(()=>o(Date.now()),6e4);return()=>clearInterval(e)},[]);let s=it(i,i.ledger.tasks.filter(e=>e.trashedAt===void 0)),c=i.selectedId===void 0?void 0:i.ledger.tasks.find(e=>e.id===i.selectedId),{alert:l,el:d}=xe(),[f,m]=(0,e.useState)(!1),h=()=>m(!1),[g,_]=(0,e.useState)(!1),v=()=>_(!1);return(0,n.jsxs)(`div`,{className:`dsh-atb-board`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-toolbar`,children:[(0,n.jsx)(`h2`,{className:`dsh-atb-title`,children:r(`board.title`)}),(0,n.jsx)(`span`,{className:`dsh-atb-count`,children:r(`board.count.tasks`,{n:s.length,rev:i.ledger.revision})}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-primary":`true`,onClick:()=>{let e=!f;m(e),e&&t.prepareTemplateMenu()},children:r(`board.action.newTask`)}),f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-backdrop`,onClick:h}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu-list`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,onClick:()=>{h(),t.setComposer(!0)},children:r(`board.action.blankTask`)}),i.templates.map(e=>{let r=J(e),i=Y(e);return(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:i.description!==void 0&&i.description.length>0?i.description.slice(0,120):r,onClick:()=>{h(),t.newFromTemplate(i)},children:r},e.id)}),(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-sep`}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,onClick:()=>{h(),t.openTemplateManager()},children:r(`board.action.manageTemplates`)})]})]})]}),(0,n.jsx)(`div`,{className:`dsh-atb-spacer`}),(0,n.jsx)(`input`,{className:`dsh-atb-input dsh-atb-search`,value:i.search,placeholder:r(`board.search.placeholder`),spellCheck:!1,onChange:e=>t.setSearch(e.target.value)}),(0,n.jsxs)(`select`,{className:`dsh-atb-select`,value:i.filters.workspaceId??``,onChange:e=>t.setWorkspaceFilter(e.target.value===``?void 0:e.target.value),children:[(0,n.jsx)(`option`,{value:``,children:r(`board.filter.allProjects`)}),i.workspaces.map(e=>(0,n.jsx)(`option`,{value:e.id,children:e.title||e.path},e.id))]}),(0,n.jsxs)(`select`,{className:`dsh-atb-select`,value:i.sortBy,title:r(`board.sort.title`),onChange:e=>t.setSortBy(e.target.value),children:[(0,n.jsx)(`option`,{value:`default`,children:r(`board.sort.default`)}),(0,n.jsx)(`option`,{value:`updated`,children:r(`board.sort.updated`)}),(0,n.jsx)(`option`,{value:`urgency`,children:r(`board.sort.urgency`)}),(0,n.jsx)(`option`,{value:`created`,children:r(`board.sort.created`)}),(0,n.jsx)(`option`,{value:`title`,children:r(`board.sort.byTitle`)})]}),[`urgent`,`normal`,`relaxed`].map(e=>(0,n.jsxs)(`button`,{type:`button`,className:`dsh-atb-chip`,"data-urgency":e,"data-on":i.filters.urgencies.includes(e),onClick:()=>t.toggleUrgency(e),children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-urgency":e}),r(q[e])]},e)),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,onClick:()=>t.toggleSecondary(),children:i.secondaryOpen?r(`board.action.backToBoard`):r(`board.action.otherTasks`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.settingsTitle`),onClick:()=>t.openSettings(),children:r(`board.action.settings`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.diagTitle`),onClick:()=>t.openDiagnostics(),children:r(`board.action.diag`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.importTitle`),onClick:()=>t.openImport(),children:r(`board.action.import`)}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,title:r(`board.action.exportTitle`),onClick:()=>_(!g),children:r(`board.action.export`)}),g&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(`div`,{className:`dsh-atb-newmenu-backdrop`,onClick:v}),(0,n.jsxs)(`div`,{className:`dsh-atb-newmenu-list`,children:[(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:r(`board.export.jsonTitle`),onClick:()=>{v(),t.exportJson()},children:r(`board.export.json`)}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-newmenu-opt`,title:r(`board.export.csvTitle`),onClick:()=>{v(),t.exportCsv()},children:r(`board.export.csv`)})]})]})]}),(0,n.jsxs)(`a`,{className:`dsh-atb-ver`,href:`https://github.com/cloader/dsh-taskboard`,target:`_blank`,rel:`noopener noreferrer`,children:[`V`,`0.7.0`]})]}),i.error!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-error`,children:i.error}),i.secondaryOpen?(0,n.jsx)(st,{controller:t,tasks:it(i,i.ledger.tasks)}):(0,n.jsx)(`div`,{className:`dsh-atb-columns`,children:u.map(e=>{let o=s.filter(t=>t.status===e);return(0,n.jsxs)(`div`,{className:`dsh-atb-column`,onDragOver:e=>{e.dataTransfer.types.includes(`application/x-dsh-atb-task`)&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,e.currentTarget.dataset.dragover=`true`)},onDragLeave:e=>{delete e.currentTarget.dataset.dragover},onDrop:n=>{n.preventDefault(),delete n.currentTarget.dataset.dragover;let a=n.dataTransfer.getData(ve);if(a.length===0)return;let o=i.ledger.tasks.find(e=>e.id===a);if(!(o===void 0||o.status===e)){if(!p(o.status,e)){l(r(`board.drag.forbidden`,{from:r(fe[o.status]),to:r(fe[e])}));return}t.move(a,o.version,e)}},children:[(0,n.jsxs)(`div`,{className:`dsh-atb-colhead`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-status":e}),r(fe[e]),(0,n.jsx)(`span`,{className:`dsh-atb-colcount`,children:o.length})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-cards`,children:[o.map(e=>(0,n.jsx)(be,{task:e,controller:t,draggable:!0,now:a,onAlert:l},e.id)),o.length===0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.empty`)})]})]},e)})}),c!==void 0&&(0,n.jsx)(`div`,{className:`dsh-atb-detailpanel`,children:(0,n.jsx)(Be,{task:c,controller:t,now:a},c.id)}),i.composerOpen&&(0,n.jsx)(Ze,{controller:t,task:i.editingId===void 0?void 0:i.ledger.tasks.find(e=>e.id===i.editingId)}),i.diagOpen&&(0,n.jsx)(ot,{controller:t}),i.settingsOpen&&(0,n.jsx)($e,{controller:t}),i.importOpen&&(0,n.jsx)(tt,{controller:t}),i.tplManagerOpen&&(0,n.jsx)(nt,{controller:t}),d]})}function ot({controller:e}){let t=H(),r=e.getSnapshot(),i=r.diagnostics,a=e=>{let t=r.workspaces.find(t=>t.id===e);return t?.title??t?.path??e.slice(0,8)};return(0,n.jsx)(`div`,{className:`dsh-atb-modal-backdrop`,onClick:t=>{t.target===t.currentTarget&&e.closeDiagnostics()},children:(0,n.jsxs)(`div`,{className:`dsh-atb-modal dsh-atb-diag`,role:`dialog`,"aria-modal":`true`,"aria-label":t(`diag.title`),children:[(0,n.jsxs)(`div`,{className:`dsh-atb-modal-head`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-modal-headicon`,children:`⚙`}),(0,n.jsxs)(`div`,{className:`dsh-atb-modal-headtext`,children:[(0,n.jsx)(`h3`,{children:t(`diag.title`)}),(0,n.jsx)(`p`,{children:t(`diag.subtitle`)})]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-modal-close`,"aria-label":t(`shared.close`),onClick:()=>e.closeDiagnostics(),children:`✕`})]}),(0,n.jsx)(`div`,{className:`dsh-atb-modal-body`,children:i===void 0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`shared.loading`)}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diag-grid`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,children:[(0,n.jsx)(`b`,{children:i.revision}),(0,n.jsx)(`span`,{children:t(`diag.revision`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,children:[(0,n.jsx)(`b`,{children:i.tasks}),(0,n.jsx)(`span`,{children:t(`diag.tasks`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,"data-bad":i.staleRunning>0?`true`:void 0,children:[(0,n.jsx)(`b`,{children:i.staleRunning}),(0,n.jsx)(`span`,{children:t(`diag.running`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-item`,"data-bad":i.orphanWorktrees.length>0?`true`:void 0,children:[(0,n.jsx)(`b`,{children:i.orphanWorktrees.length}),(0,n.jsx)(`span`,{children:t(`diag.orphans`)})]})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:t(`diag.orphans.heading`)}),i.orphanWorktrees.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.orphans.none`)}):(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphans`,children:i.orphanWorktrees.map(r=>(0,n.jsxs)(`div`,{className:`dsh-atb-diag-orphan`,children:[(0,n.jsxs)(`span`,{className:`dsh-atb-diag-orphan-path`,title:r.path,children:[a(r.workspaceId),` · `,r.taskId]}),(0,n.jsx)(`button`,{type:`button`,className:`dsh-atb-btn`,"data-danger":`true`,onClick:()=>void e.cleanupOrphan(r.workspaceId,r.taskId),children:t(`diag.orphans.cleanup`)})]},r.path))}),(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.orphans.hint`)})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-diag-sec`,children:[(0,n.jsx)(`h4`,{children:t(`diag.gitignore.heading`)}),(i.gitIgnoreSuggestions??[]).length===0?(0,n.jsx)(`div`,{className:`dsh-atb-empty2`,children:t(`diag.gitignore.none`)}):(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphans`,children:i.gitIgnoreSuggestions.map(e=>(0,n.jsx)(`div`,{className:`dsh-atb-diag-orphan`,children:(0,n.jsxs)(`span`,{className:`dsh-atb-diag-orphan-path`,title:e.workspacePath,children:[a(e.workspaceId),` · `,t(`diag.gitignore.suggestA`),` `,(0,n.jsx)(`code`,{children:`.dsh-worktrees/`}),t(`diag.gitignore.suggestB`)]})},e.workspaceId))})]})]})})]})})}function st({controller:e,tasks:t}){let r=H(),i=t.filter(e=>e.trashedAt!==void 0),a=t.filter(e=>e.trashedAt===void 0&&e.status===`archived`),o=t.filter(e=>e.trashedAt===void 0&&e.status===`canceled`),s=[{label:r(`status.column.canceled`),dot:`canceled`,rows:o},{label:r(`status.column.archived`),dot:`archived`,rows:a},{label:r(`board.group.trashed`),dot:`trashed`,rows:i}];return i.length+a.length+o.length===0?(0,n.jsx)(`div`,{className:`dsh-atb-secondary`,children:(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.secondary.empty`)})}):(0,n.jsx)(`div`,{className:`dsh-atb-columns`,children:s.map(t=>(0,n.jsxs)(`div`,{className:`dsh-atb-column`,children:[(0,n.jsxs)(`div`,{className:`dsh-atb-colhead`,children:[(0,n.jsx)(`span`,{className:`dsh-atb-dot`,"data-status":t.dot}),t.label,(0,n.jsx)(`span`,{className:`dsh-atb-colcount`,children:t.rows.length})]}),(0,n.jsxs)(`div`,{className:`dsh-atb-cards`,children:[t.rows.map(t=>(0,n.jsx)(be,{task:t,controller:e},t.id)),t.rows.length===0&&(0,n.jsx)(`div`,{className:`dsh-atb-empty`,children:r(`board.empty`)})]})]},t.label))})}function ct(e){let t=()=>{if((document.body.getAttribute(`data-dsh-desktop-platform`)??new URLSearchParams(window.location.search).get(`dsh-desktop-platform`))!==`win32`){delete e.dataset.dshAtbWindows,e.style.removeProperty(`--dsh-atb-viewport-top`);return}e.dataset.dshAtbWindows=``,e.style.setProperty(`--dsh-atb-viewport-top`,`${e.getBoundingClientRect().top}px`)},n,r=()=>{n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,t()}))},i=new MutationObserver(r);i.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeFilter:[`class`,`data-dsh-desktop-platform`,`data-dsh-desktop-mode`,`data-details-collapsed`]}),i.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-dsh-atb-active`]});let a=typeof ResizeObserver>`u`?void 0:new ResizeObserver(r);return a?.observe(e),e.parentElement!==null&&a?.observe(e.parentElement),window.addEventListener(`resize`,r),r(),()=>{i.disconnect(),a?.disconnect(),window.removeEventListener(`resize`,r),n!==void 0&&cancelAnimationFrame(n),delete e.dataset.dshAtbWindows,e.style.removeProperty(`--dsh-atb-viewport-top`)}}const lt=`data-dsh-atb-active`,ut=[`data-dsh-taskboard-active`,`data-dsh-ssh-active`],dt=`dsh-panel-activate`,ft=`dsh-taskboard`;function pt(){return document.querySelector(`[data-pane="conversation"], [class*="centerCol"], .dshDesktopConversationSurface`)??void 0}function mt(e){let r,i,a,o=()=>{if(i!==void 0)return;let o=pt();o!==void 0&&(i=document.createElement(`div`),i.dataset.dshAtbView=``,i.className=`dsh-atb-view`,o.appendChild(i),a=ct(i),r=(0,t.createRoot)(i),r.render((0,n.jsx)(at,{controller:e})))},s=new MutationObserver(()=>{o()});s.observe(document.body,{childList:!0,subtree:!0});let c=()=>{if(e.getSnapshot().boardOpen){for(let e of ut)document.documentElement.removeAttribute(e);document.documentElement.setAttribute(lt,``),document.dispatchEvent(new CustomEvent(dt,{detail:ft}))}else document.documentElement.removeAttribute(lt)},l=t=>{t.detail!==ft&&e.getSnapshot().boardOpen&&e.closeBoard()},u=t=>{if(!e.getSnapshot().boardOpen)return;let n=t.target;n!==null&&n.closest(`[data-dsh-atb-entry]`)===null&&n.closest(`[class*="sessionRow"], [class*="projectRow"], [class*="searchResultRow"], [class*="searchResultWorkspace"], [class*="newSession"]`)!==null&&e.closeBoard()};document.addEventListener(`click`,u,!0),document.addEventListener(dt,l);let d=e.subscribe(c);return c(),o(),()=>{document.removeEventListener(`click`,u,!0),document.removeEventListener(dt,l),s.disconnect(),d(),a?.(),document.documentElement.removeAttribute(lt),r?.unmount(),i?.remove()}}function ht(e){let t=(e,t,n)=>e.list.getSnapshot().byId[n]===void 0?`absent`:t?.list.getSnapshot().archivedSessionIds.includes(n)??!1?`archived`:`openable`;return async n=>{let r=e.getSessions();if(r===void 0)return`unavailable`;try{let i=t(r,e.getWorkspaces(),n);if(i===`absent`){try{await r.refresh()}catch{}i=t(r,e.getWorkspaces(),n)}return i===`archived`?`archived`:i===`absent`?`missing`:(r.open(n),`opened`)}catch{return`unavailable`}}}const gt=[`connection`];function _t(e){try{ae(),L(e.get?.(`locale`),()=>e.get?.(`locale`));let t=l(),n=new re(t);n.installModelCatalog(async()=>{try{let t=e.get?.(`modelDirectories`)??e.modelDirectories;if(t?.catalog?.load!==void 0){let e=await t.catalog.load();if(e?.groups!==void 0&&e.groups.length>0){let t=[];for(let n of e.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let t=e.get?.(`remote`)??e.remote;if(t?.session?.modelCatalog!==void 0){let e=await t.session.modelCatalog();if(e.ok&&e.value?.groups!==void 0&&e.value.groups.length>0){let t=[];for(let n of e.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}if(t?.llm?.models!==void 0){let e=await t.llm.models({});if(e.result.ok&&e.result.value?.groups!==void 0&&e.result.value.groups.length>0){let t=[];for(let n of e.result.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let t=e.get?.(`connection`)??e.connection;if(t?.api?.llm?.models!==void 0){let e=await t.api.llm.models({});if(e.result.ok&&e.result.value?.groups!==void 0&&e.result.value.groups.length>0){let t=[];for(let n of e.result.value.groups)for(let e of n.models)t.push({provider:n.id,model:e.id,name:e.name,...e.description===void 0?{}:{description:e.description},...e.reasoning===void 0?{}:{reasoning:e.reasoning}});if(t.length>0)return t}}}catch{}try{let e=await t.modelCatalog();if(e.models!==void 0&&e.models.length>0)return e.models}catch{}return[]}),n.installPresetRoster(async()=>{try{let t=e.get?.(`remote`)??e.remote;if(t?.agentPresets?.list!==void 0){let e=await t.agentPresets.list(),n=e.ok===!0?e.value.presets:e.result?.ok===!0?e.result.value.presets:void 0;if(n!==void 0&&n.length>0){let e=n.map(e=>({id:e.id,name:e.name})),t=n.find(e=>e.isDefault);return{presets:e,...t===void 0?{}:{defaultId:t.id}}}}}catch{}try{let t=e.get?.(`connection`)??e.connection;if(t?.api?.agentPresets?.list!==void 0){let e=await t.api.agentPresets.list({});if(e.result.ok&&e.result.value?.presets!==void 0&&e.result.value.presets.length>0){let t=e.result.value.presets.map(e=>({id:e.id,name:e.name})),n=e.result.value.presets.find(e=>e.isDefault);return{presets:t,...n===void 0?{}:{defaultId:n.id}}}}}catch{}try{let e=await t.modelCatalog();if(e.presets!==void 0&&e.presets.length>0)return{presets:e.presets,...e.defaultPresetId===void 0?{}:{defaultId:e.defaultPresetId}}}catch{}return{presets:[]}}),n.installSessionJumper(ht({getSessions:()=>e.get?.(`sessions`),getWorkspaces:()=>e.get?.(`workspaces`)})),n.start();let r=[];try{r.push(W(n)),r.push(mt(n))}catch(e){console.error(`[dsh-taskboard] mount failed:`,e)}e.effect?.(()=>()=>{for(let e of r.splice(0))e();n.dispose(),R()},`dsh-taskboard: client mount`)}catch(e){console.error(`[dsh-taskboard] client half failed to start:`,e)}}exports.apply=_t,exports.inject=gt,exports.name=`dsh-taskboard/client`;
|
|
944
992
|
return module.exports;
|
|
945
993
|
}
|
|
946
994
|
});
|