dsh-taskboard 0.7.0 → 0.7.2

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/lib/client.js CHANGED
@@ -10,14 +10,13 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require
10
10
  原路径:{from}
11
11
  新路径:{to}
12
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}
13
+ 迁移期间写操作会短暂排队。`,"set.storage.migrated":`迁移成功,数据已迁移到 {path}`,"set.storage.warnings":`迁移完成,但部分旧数据未能清理:{warnings}`,"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
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
15
 
16
16
  From: {from}
17
17
  To: {to}
18
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
19
+ Writes queue briefly during migration.`,"set.storage.migrated":`Migration succeeded — data now lives in {path}`,"set.storage.warnings":`Migration finished, but some old files could not be removed: {warnings}`,"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,storageNotice:void 0})}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,storageNotice:{path:t.currentDirectory,warnings:t.warnings},error:void 0}),await this.refresh(),!0}catch(e){return this.setState({error:e instanceof Error?e.message:String(e)}),!1}}dismissStorageNotice(){this.state.storageNotice!==void 0&&this.setState({storageNotice:void 0})}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
20
  `)}`,`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=`
22
21
  .dsh-atb-entry {
23
22
  display: flex; align-items: center; gap: 8px; position: relative;
@@ -900,6 +899,9 @@ color: var(--dsw-alias-state-business-primary, #3e63dd);
900
899
  .dsh-atb-storage-meta { display: grid; gap: 4px; margin-top: 8px; color: var(--dsh-atb-muted); font-size: 12px; overflow-wrap: anywhere; }
901
900
  .dsh-atb-storage-error { color: var(--dsh-atb-danger); }
902
901
  .dsh-atb-storage-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; }
902
+ .dsh-atb-storage-notice { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; }
903
+ .dsh-atb-storage-notice-ok { color: var(--dsw-alias-state-success-primary, #2e7d32); padding: 4px 8px; border-radius: 6px; background: rgba(46,125,50,.1); }
904
+ .dsh-atb-storage-notice-warn { color: var(--dsw-alias-state-warning-primary, #b8860b); padding: 4px 8px; border-radius: 6px; background: rgba(184,134,11,.1); word-break: break-word; }
903
905
 
904
906
  /* ---------- 0.5.5 SlashPromptInput & Permission Picker ---------- */
905
907
  .dsh-atb-perm-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 4px; }
@@ -988,7 +990,7 @@ color: var(--dsw-alias-state-business-primary, #3e63dd);
988
990
  `)?`
989
991
  `:``}`;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]??`
990
992
  `:`
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`;
993
+ `,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),t.dismissStorageNotice()}}),i.storageNotice!==void 0&&(0,n.jsxs)(`div`,{className:`dsh-atb-storage-notice`,role:`status`,children:[(0,n.jsxs)(`span`,{className:`dsh-atb-storage-notice-ok`,children:[`✓ `,r(`set.storage.migrated`,{path:i.storageNotice.path})]}),i.storageNotice.warnings.length>0&&(0,n.jsx)(`span`,{className:`dsh-atb-storage-notice-warn`,children:r(`set.storage.warnings`,{warnings:i.storageNotice.warnings.join(`; `)})})]}),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.1`]})]}),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`;
992
994
  return module.exports;
993
995
  }
994
996
  });