opencode-windows-scheduler 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/README.md +11 -5
  3. package/ROADMAP-STRATEGY.md +45 -26
  4. package/ROADMAP.md +279 -35
  5. package/dist/core/audit.d.ts +68 -0
  6. package/dist/core/audit.d.ts.map +1 -0
  7. package/dist/core/audit.js +206 -0
  8. package/dist/core/dry-run.d.ts +31 -0
  9. package/dist/core/dry-run.d.ts.map +1 -1
  10. package/dist/core/dry-run.js +129 -1
  11. package/dist/core/file-watcher.d.ts.map +1 -1
  12. package/dist/core/file-watcher.js +53 -10
  13. package/dist/core/git-trigger.d.ts +80 -0
  14. package/dist/core/git-trigger.d.ts.map +1 -0
  15. package/dist/core/git-trigger.js +288 -0
  16. package/dist/core/glob.d.ts +38 -0
  17. package/dist/core/glob.d.ts.map +1 -0
  18. package/dist/core/glob.js +233 -0
  19. package/dist/core/ps-wrapper.d.ts.map +1 -1
  20. package/dist/core/ps-wrapper.js +7 -0
  21. package/dist/core/schedule-gate.js +55 -30
  22. package/dist/core/schedule-v2.d.ts +29 -1
  23. package/dist/core/schedule-v2.d.ts.map +1 -1
  24. package/dist/core/schedule-v2.js +81 -3
  25. package/dist/core/scheduler/types.d.ts +1 -1
  26. package/dist/core/scheduler/types.d.ts.map +1 -1
  27. package/dist/core/secrets.d.ts +57 -0
  28. package/dist/core/secrets.d.ts.map +1 -0
  29. package/dist/core/secrets.js +331 -0
  30. package/dist/core/structured-log.d.ts.map +1 -1
  31. package/dist/core/structured-log.js +9 -0
  32. package/dist/core/wrappers/bash.d.ts.map +1 -1
  33. package/dist/core/wrappers/bash.js +4 -0
  34. package/dist/db/git-state-repo.d.ts +16 -0
  35. package/dist/db/git-state-repo.d.ts.map +1 -0
  36. package/dist/db/git-state-repo.js +38 -0
  37. package/dist/db/schema.d.ts +1 -1
  38. package/dist/db/schema.d.ts.map +1 -1
  39. package/dist/db/schema.js +23 -0
  40. package/dist/index.d.ts +68 -4
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +589 -45
  43. package/dist/rpc.d.ts +623 -0
  44. package/dist/rpc.d.ts.map +1 -1
  45. package/dist/rpc.js +219 -0
  46. package/dist/server.d.ts.map +1 -1
  47. package/dist/server.js +67 -0
  48. package/dist/settings.d.ts +16 -0
  49. package/dist/settings.d.ts.map +1 -1
  50. package/dist/settings.js +29 -0
  51. package/dist/task-transfer.d.ts +30 -3
  52. package/dist/task-transfer.d.ts.map +1 -1
  53. package/dist/task-transfer.js +83 -6
  54. package/dist/templates.d.ts +1 -1
  55. package/dist/templates.d.ts.map +1 -1
  56. package/dist/workspaces.d.ts +8 -2
  57. package/dist/workspaces.d.ts.map +1 -1
  58. package/dist/workspaces.js +21 -4
  59. package/docs/ARCHITECTURE.md +14 -5
  60. package/docs/FEATURES.md +80 -1
  61. package/docs/README.ru.md +15 -5
  62. package/gui-experimental.cjs +9 -4
  63. package/package.json +8 -3
  64. package/src/core/audit.ts +291 -0
  65. package/src/core/dry-run.ts +188 -1
  66. package/src/core/file-watcher.ts +65 -10
  67. package/src/core/git-trigger.ts +367 -0
  68. package/src/core/glob.ts +226 -0
  69. package/src/core/ps-wrapper.ts +7 -0
  70. package/src/core/schedule-gate.ts +67 -33
  71. package/src/core/schedule-v2.ts +108 -3
  72. package/src/core/scheduler/types.ts +1 -1
  73. package/src/core/secrets.ts +385 -0
  74. package/src/core/structured-log.ts +9 -0
  75. package/src/core/wrappers/bash.ts +4 -0
  76. package/src/db/git-state-repo.ts +62 -0
  77. package/src/db/schema.ts +23 -0
  78. package/src/gui.tsx +548 -4
  79. package/src/index.ts +790 -47
  80. package/src/rpc.ts +230 -0
  81. package/src/server.ts +67 -0
  82. package/src/settings.ts +51 -0
  83. package/src/task-transfer.ts +124 -5
  84. package/src/templates.ts +1 -1
  85. package/src/workspaces.ts +22 -4
@@ -1,4 +1,9 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("solid-js/web"),s=require("solid-js"),fo=require("@opencode/plugin/gui"),za=require("@opencode/plugin/rpc"),ri={type:["object","null"],properties:{server:{type:"string"},event:{type:"string"},filter:{type:"string"}},required:["server","event"]},mo={type:["object","null"],properties:{workspaceIds:{type:"array",items:{type:"string"}},strategy:{type:["string","null"]},failureMode:{type:["string","null"]},aggregation:{type:["string","null"]},createAggregator:{type:["boolean","null"]},concurrency:{type:["number","null"]},overrides:{type:["object","null"],additionalProperties:{type:"object",properties:{prompt:{type:["string","null"]},model:{type:["string","null"]},qualityGate:{type:["string","null"]},beforeScript:{type:["string","null"]},afterScript:{type:["string","null"]}}}}},required:["workspaceIds"]},Ta={type:"object",properties:{name:{type:"string"},schedule:{type:"string"},status:{type:"string"},nextRun:{type:["string","null"]},model:{type:["string","null"]},priority:{type:["number","null"]},retryCount:{type:["number","null"]},retryDelay:{type:["number","null"]},qualityGate:{type:["string","null"]},nextTaskOnSuccess:{type:["string","null"]},nextTaskOnError:{type:["string","null"]},dependsOn:{type:"array",items:{type:"string"}},prompt:{type:"string"},beforeScript:{type:["string","null"]},afterScript:{type:["string","null"]},triggerType:{type:["string","null"]},runAt:{type:["string","null"]},session:{type:["string","null"]},sessionId:{type:["string","null"]},sessionMaxRuns:{type:["number","null"]},mcpEvent:ri,watchPath:{type:["string","null"]},timezone:{type:["string","null"]},notBefore:{type:["string","null"]},notAfter:{type:["string","null"]},pausedUntil:{type:["string","null"]},workingDirectory:{type:["string","null"]},workspaceId:{type:["string","null"]},workspaceName:{type:["string","null"]},workspaceColor:{type:["string","null"]},allowedTools:{type:["array","null"],items:{type:"string"}},deniedTools:{type:["array","null"],items:{type:"string"}},matrix:mo,matrixParentId:{type:["string","null"]},isMatrixParent:{type:"boolean"},paused:{type:"boolean"},orphaned:{type:"boolean"},runsTotal:{type:"number"},runsSuccess:{type:"number"},runsError:{type:"number"},runsPartial:{type:"number"},matrixSummary:{type:["object","null"],properties:{totalCount:{type:"number"},successCount:{type:"number"},errorCount:{type:"number"},pendingCount:{type:"number"},status:{type:"string"},message:{type:"string"}}}},required:["name","schedule","status"]},go={type:"object",properties:{},additionalProperties:!1},Ea={type:"object",properties:{tasks:{type:"array",items:Ta}},required:["tasks"]},Aa={type:"object",properties:{name:{type:"string"},schedule:{type:"string"},prompt:{type:"string"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},runAt:{type:"string"},delaySeconds:{type:"number"},session:{type:"string"},sessionMaxRuns:{type:"number"},mcpEvent:ri,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}},matrix:mo,timezone:{type:"string"},notBefore:{type:"string"},notAfter:{type:"string"}},required:["name","prompt"]},Pa={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},vn={type:"object",properties:{name:{type:"string"}},required:["name"]},Ma=vn,La=vn,ti={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},Ra=ti,Oa=vn,Ia={type:"object",properties:{success:{type:"boolean"},logs:{type:"string"},error:{type:"string"}},required:["success","logs"]},qa={type:"object",properties:{taskName:{type:"string"},status:{type:"string"},startedAt:{type:"string"},finishedAt:{type:"string"},durationMs:{type:"number"},error:{type:["string","null"]},nextTask:{type:["string","null"]},model:{type:["string","null"]},preFlightStatus:{type:["string","null"]},postFlightStatus:{type:["string","null"]},allowedTools:{type:["array","null"],items:{type:"string"}},deniedTools:{type:["array","null"],items:{type:"string"}}},required:["taskName","status","startedAt","finishedAt","durationMs","error"]},Da={type:"object",properties:{limit:{type:"number"},taskName:{type:"string"},status:{type:"string"}},additionalProperties:!1},ja={type:"object",properties:{records:{type:"array",items:qa}},required:["records"]},Na={type:"object",properties:{total:{type:"number"},success:{type:"number"},error:{type:"number"}},required:["total","success","error"]},Ba={type:"object",properties:{},additionalProperties:!1},Fa=Na,Ga={type:"object",properties:{},additionalProperties:!1},Wa={type:"object",properties:{port:{type:["number","null"]}},required:["port"]},Ua={type:"object",properties:{},additionalProperties:!1},Ha={type:"object",properties:{platform:{type:"string"},title:{type:"string"}},required:["platform","title"]},Ja={type:"object",properties:{},additionalProperties:!1},Qa={type:"object",properties:{success:{type:"boolean"},data:{type:"string"},count:{type:"number"},error:{type:"string"}},required:["success"]},Va={type:"object",properties:{data:{type:"string"}},required:["data"]},Ka={type:"object",properties:{success:{type:"boolean"},imported:{type:"number"},errors:{type:"array",items:{type:"string"}},error:{type:"string"}},required:["success"]},Ya={type:"object",properties:{},additionalProperties:!1},xo={type:"object",properties:{enabled:{type:"boolean"},onlyOnError:{type:"boolean"},webhook:{type:"object",properties:{enabled:{type:"boolean"},url:{type:"string"},timeoutMs:{type:"number"},retryCount:{type:"number"},retryDelayMs:{type:"number"}},required:["enabled","url"]},templates:{type:"object",properties:{success:{type:"string"},error:{type:"string"}},required:["success","error"]},filters:{type:"object",properties:{include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},required:["include","exclude"]},matrix:{type:"object",properties:{enabled:{type:"boolean"},onPartial:{type:"boolean"},onAllFailed:{type:"boolean"},stuckAfterMinutes:{type:"number"}},required:["enabled","onPartial","onAllFailed","stuckAfterMinutes"]},digest:{type:"object",properties:{enabled:{type:"boolean"},frequency:{type:"string",enum:["daily","weekly"]},time:{type:"string"},lastSentAt:{type:["string","null"]}},required:["enabled","frequency","time"]}},required:["enabled","onlyOnError"]},vo={type:"object",properties:{retentionDays:{type:"number"},maxRecords:{type:"number"},lastCleanupAt:{type:["string","null"]},lastCleanupDeleted:{type:"number"}},required:["retentionDays","maxRecords"]},Za={type:"object",properties:{maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:xo,history:vo},required:["maxConcurrent","winterMode","notifications"]},Xa={type:"object",properties:{maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:xo,history:vo},additionalProperties:!1},ep={type:"object",properties:{success:{type:"boolean"},maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:xo,history:vo},required:["success","maxConcurrent","winterMode","notifications"]},tp={type:"object",properties:{retentionDays:{type:"number"},maxRecords:{type:"number"}},additionalProperties:!1},rp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},deleted:{type:"number"},deletedByAge:{type:"number"},deletedByCount:{type:"number"},kept:{type:"number"},retentionDays:{type:"number"},maxRecords:{type:"number"},vacuumed:{type:"boolean"}},required:["success","message","deleted","kept"]},ip={type:"object",properties:{days:{type:"number"},topLimit:{type:"number"}},additionalProperties:!1},np={type:"object",properties:{success:{type:"boolean"},report:{type:["object","null"]},error:{type:"string"}},required:["success","report"]},op={type:"object",properties:{},additionalProperties:!1},lp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},sp={type:"object",properties:{},additionalProperties:!1},ap={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},os={type:"object",properties:{id:{type:"string"},name:{type:"string"},prompt:{type:"string"},schedule:{type:"string"},timeoutSeconds:{type:"number"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},mcpEvent:ri,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}}},required:["id","name","prompt"]},pp={type:"object",properties:{},additionalProperties:!1},dp={type:"object",properties:{templates:{type:"array",items:os}},required:["templates"]},cp={type:"object",properties:{id:{type:"string"},name:{type:"string"},prompt:{type:"string"},schedule:{type:"string"},timeoutSeconds:{type:"number"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},mcpEvent:ri,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}}},required:["name","prompt"],additionalProperties:!1},up={type:"object",properties:{success:{type:"boolean"},template:os,error:{type:"string"}},required:["success"]},fp={type:"object",properties:{id:{type:"string"}},required:["id"]},gp={type:"object",properties:{success:{type:"boolean"},error:{type:"string"}},required:["success"]},Xl={type:"object",properties:{name:{type:"string"},until:{type:"string"}},required:["name"]},yp={type:"object",properties:{name:{type:"string"},newSchedule:{type:"string"},newPrompt:{type:"string"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},runAt:{type:"string"},delaySeconds:{type:"number"},session:{type:"string"},sessionMaxRuns:{type:"number"},mcpEvent:ri,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}},matrix:mo,timezone:{type:"string"},notBefore:{type:"string"},notAfter:{type:"string"}},required:["name"]},bp=ti,ls={type:"object",properties:{id:{type:"string"},name:{type:"string"},path:{type:"string"},gitRemote:{type:["string","null"]},gitBranch:{type:["string","null"]},color:{type:["string","null"]},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]},createdAt:{type:"string"}},required:["id","name","path","createdAt"]},mp={type:"object",properties:{},additionalProperties:!1},xp={type:"object",properties:{workspaces:{type:"array",items:ls}},required:["workspaces"]},vp={type:"object",properties:{name:{type:"string"},path:{type:"string"},color:{type:"string"},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]}},required:["path"],additionalProperties:!1},es={type:"object",properties:{success:{type:"boolean"},workspace:ls,error:{type:"string"}},required:["success"]},hp={type:"object",properties:{id:{type:"string"},name:{type:"string"},path:{type:"string"},color:{type:"string"},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]}},required:["id"],additionalProperties:!1},$p={type:"object",properties:{id:{type:"string"}},required:["id"]},wp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success"]},_p={type:"object",properties:{eventName:{type:"string"},payload:{type:["object","null","string","number","boolean","array"]}},required:["eventName"]},kp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},triggered:{type:"array",items:{type:"string"}}},required:["success","triggered"]},Sp={type:"object",properties:{name:{type:"string"},order:{type:"number"},trigger:{type:"string"},cwd:{type:"string"},command:{type:"string"},workspace:{type:["object","null"],properties:{name:{type:"string"},path:{type:"string"}},required:["name","path"]},preFlight:{type:["string","null"]},postFlight:{type:["string","null"]},qualityGate:{type:["string","null"]},roleScoped:{type:["object","null"],properties:{allowed:{type:"array",items:{type:"string"}},denied:{type:"array",items:{type:"string"}}}},estimatedDurationSec:{type:["number","null"]},estimatedCostUsd:{type:["number","null"]},estimatedTokens:{type:["number","null"]},matrixParent:{type:"string"}},required:["name","order","trigger","cwd","command"]},ss={type:"object",properties:{success:{type:"boolean"},taskName:{type:"string"},tasks:{type:"array",items:Sp},totals:{type:"object",properties:{estimatedDurationSec:{type:["number","null"]},estimatedCostUsd:{type:["number","null"]},estimatedTokens:{type:["number","null"]}},required:[]},warnings:{type:"array",items:{type:"string"}},error:{type:"string"}},required:["success","taskName","tasks","warnings"]},Cp={type:"object",properties:{taskName:{type:"string"}},required:["taskName"],additionalProperties:!1},zp={type:"object",properties:{success:{type:"boolean"},reports:{type:"array",items:ss}},required:["success","reports"]},Tp={type:"object",properties:{name:{type:"string"},workspaceId:{type:["string","null"]},workspaceName:{type:["string","null"]},status:{type:"string"},error:{type:["string","null"]},finishedAt:{type:["string","null"]}},required:["name","status"]},Ep={type:"object",properties:{parentId:{type:"string"}},required:["parentId"],additionalProperties:!1},Ap={type:"object",properties:{parentId:{type:"string"},totalCount:{type:"number"},successCount:{type:"number"},errorCount:{type:"number"},pendingCount:{type:"number"},status:{type:"string"},message:{type:"string"},clones:{type:"array",items:Tp}},required:["parentId","totalCount","successCount","errorCount","status"]},Pp={type:"object",properties:{success:{type:"boolean"},report:Ap,error:{type:"string"}},required:["success"]},Mp={type:"object",properties:{name:{type:"string"},workspaceIds:{type:"array",items:{type:"string"}},strategy:{type:"string"},failureMode:{type:"string"},aggregation:{type:"string"}},required:["workspaceIds"],additionalProperties:!1},Lp={type:"object",properties:{success:{type:"boolean"},clones:{type:"array",items:{type:"object",properties:{name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:["string","null"]}},required:["name","workspaceId"]}},error:{type:"string"}},required:["success","clones"]},Rp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},cancelled:{type:"array",items:{type:"string"}}},required:["success","message","cancelled"]},Op={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},removed:{type:"array",items:{type:"string"}}},required:["success","message","removed"]},as={type:"object",properties:{name:{type:"string"},dir:{type:"string"},port:{type:["number","null"]},isDefault:{type:"boolean"},active:{type:"boolean"}},required:["name","dir","isDefault","active"]},Ip={type:"object",properties:{},additionalProperties:!1},qp={type:"object",properties:{current:{type:"string"},pinnedByEnv:{type:"boolean"},profiles:{type:"array",items:as}},required:["current","pinnedByEnv","profiles"]},Dp={type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1},jp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},current:{type:"string"},restartRequired:{type:"boolean"}},required:["success","message","current","restartRequired"]},Np={type:"object",properties:{name:{type:"string"},port:{type:"number"}},required:["name"],additionalProperties:!1},Bp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},profile:as,error:{type:"string"}},required:["success"]},Fp={type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1},Gp={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},Wp=za.Rpc.define({id:"opencode-windows-scheduler",methods:{get_tasks:{input:go,output:Ea},create_task:{input:Aa,output:Pa},delete_task:{input:Ma,output:ti},run_task:{input:La,output:Ra},pause_task:{input:Xl,output:ti},resume_task:{input:Xl,output:ti},update_task:{input:yp,output:bp},get_task_logs:{input:Oa,output:Ia},get_history:{input:Da,output:ja},get_metrics:{input:Ba,output:Fa},get_dashboard_port:{input:Ga,output:Wa},get_platform:{input:Ua,output:Ha},dry_run:{input:Cp,output:ss},dry_run_all:{input:go,output:zp},get_matrix_results:{input:Ep,output:Pp},cancel_matrix:{input:vn,output:Rp},cleanup_matrix_orphans:{input:go,output:Op},cleanup_history:{input:tp,output:rp},get_analytics:{input:ip,output:np},expand_matrix_preview:{input:Mp,output:Lp},get_workspaces:{input:mp,output:xp},add_workspace:{input:vp,output:es},update_workspace:{input:hp,output:es},delete_workspace:{input:$p,output:wp},get_profiles:{input:Ip,output:qp},set_profile:{input:Dp,output:jp},create_profile:{input:Np,output:Bp},delete_profile:{input:Fp,output:Gp},export_tasks:{input:Ja,output:Qa},import_tasks:{input:Va,output:Ka},get_settings:{input:Ya,output:Za},save_settings:{input:Xa,output:ep},get_templates:{input:pp,output:dp},save_template:{input:cp,output:up},delete_template:{input:fp,output:gp},emit_event:{input:_p,output:kp},test_notification:{input:op,output:lp},send_digest:{input:sp,output:ap}},events:{}});var Up=e.template('<div><div style=display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%><div style=display:flex;align-items:center;gap:12px;flex:1;min-width:0><div style=flex:1;min-width:0><div style=display:flex;align-items:center;gap:6px;min-width:0><div style=font-weight:700;font-size:16px;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis></div></div><div title="Запуски именно этой задачи: успешные / частичные / ошибки и таймауты"style=font-size:12px;color:#a0a0a6;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>📊 Всего: <!> | ✅ <!> | 🟠 <!> | ❌ </div></div><div style=display:flex;align-items:center;gap:8px;flex-shrink:0;min-width:110px></div></div><div style=display:flex;gap:6px><button></button><button></button><button>📄</button><button>🧪</button><button>📜</button><button>✏️'),Hp=e.template("<span>📦 "),Jp=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ff9f0a;color:#ff9f0a;background:rgba(255,159,10,0.12)">📦 Matrix (<!>)'),Qp=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #8e8e93;color:#b0b0b6;background:rgba(142,142,147,0.12)">↳ matrix '),Vp=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>👁️"),Kp=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #64d2ff;color:#64d2ff;background:rgba(100,210,255,0.12)">🌍 '),Yp=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #bf5af2;color:#bf5af2;background:rgba(191,90,242,0.12)">🪟 <!>–'),Zp=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ffd60a;color:#ffd60a;background:rgba(255,214,10,0.12)">⏸ до '),Xp=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>⚡"),ed=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>📡"),td=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #30d158;color:#30d158;background:rgba(48,209,88,0.12)">'),rd=e.template("<span style=font-size:12px;flex-shrink:0;cursor:help;color:#c084fc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px>🧠 "),id=e.template("<span style=font-size:12px;flex-shrink:0;cursor:help;color:#f5a623;white-space:nowrap>🚀 "),nd=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>🔒"),od=e.template("<div style=display:flex;flex-direction:column;gap:2px;margin-top:4px;font-size:11px;line-height:1.35><span style=color:#5ac8fa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>🔗 Зависит от: "),ld=e.template("<div style=display:flex;flex-direction:column;gap:2px;margin-top:4px;font-size:11px;line-height:1.35><span>📦 Matrix: <!>/<!> успешных"),sd=e.template("<div style=display:flex;align-items:center;gap:8px;font-size:12px;color:#a0a0a6;margin-top:2px><span style=white-space:nowrap;overflow:hidden;text-overflow:ellipsis>"),ad=e.template("<span>→ "),pd=e.template("<div style=font-size:12px;color:#f5a623;font-weight:600;white-space:nowrap>🟡 Выполняется: <!> сек"),dd=e.template("<div style=font-size:12px;font-weight:600;white-space:nowrap>"),cd=e.template("<button>⛔"),ud=e.template("<button>🗑"),fd=e.template('<div style="margin-top:8px;padding:8px 12px;background:#1e1e1e;border:1px solid #333;border-radius:6px;display:flex;flex-direction:column;gap:6px;width:100%"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;align-items:center;gap:6px>📜 История последних запусков<button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),gd=e.template('<div style="font-size:12px;color:#8e8e93;padding:6px 0">Запусков пока нет.'),yd=e.template('<div style="display:flex;align-items:flex-start;gap:10px;font-size:12px;color:#e0e0e0;padding:4px 0;border-bottom:1px solid #333"><span style=color:#8e8e93;white-space:nowrap></span><span style=fontWeight:600;whiteSpace:nowrap></span><span style=color:#b0b0b0;white-space:nowrap> мс'),bd=e.template("<span style=color:#c084fc;white-space:nowrap>🧠 "),md=e.template("<span style=whiteSpace:nowrap>⚡ pre: "),xd=e.template("<span style=whiteSpace:nowrap>⚡ post: "),vd=e.template("<div style=margin-top:2px;color:#ff6b6b;font-size:11px;white-space:pre-wrap;word-break:break-word>"),hd=e.template('<span title="Запущена следующая задача в цепочке"style=color:#5ac8fa;font-size:11px;white-space:nowrap>🔗 → '),$d=e.template('<div style="margin-top:8px;padding:8px 12px;background:#1e1e1e;border:1px solid #333;border-radius:6px;display:flex;flex-direction:column;gap:6px;width:100%"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;align-items:center;gap:6px>🧪 Dry-Run: <button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),wd=e.template('<div style="font-size:12px;color:#8e8e93;padding:6px 0">Симуляция…'),_d=e.template('<div style="font-size:12px;color:#ff6b6b;padding:6px 0">❌ '),kd=e.template("<div style=display:flex;flex-direction:column;gap:4px>"),Sd=e.template('<div style="font-size:11px;color:#f5a623;padding:4px 0">⚠ '),Cd=e.template('<div style="font-size:11px;color:#e0e0e0;padding:4px 0;border-bottom:1px solid #333;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline"><span style=color:#8e8e93;white-space:nowrap>#<!> </span><span style=font-weight:600;white-space:nowrap>🧪 </span><span style=color:#8e8e93;white-space:nowrap>cwd: </span><div style=width:100%;color:#a0a0a6;overflow-wrap:anywhere>$ '),zd=e.template("<span style=color:#5ac8fa;white-space:nowrap>📦 "),Td=e.template("<span style=color:#ff9f0a;white-space:nowrap>↳ matrix "),Ed=e.template("<span style=cursor:help>🔒"),Ad=e.template("<span style=color:#8e8e93;white-space:nowrap>⏱ ~<!> с"),Pd=e.template("<span style=color:#8e8e93;white-space:nowrap>· ~<!> ток."),Md=e.template("<span style=color:#8e8e93;white-space:nowrap>· ~$"),Ld=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>⚡ pre: "),Rd=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>⚡ post: "),Od=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>✅ QG: "),Id=e.template('<div style="font-size:11px;color:#b0b0b0;padding:4px 0">Σ '),qd=e.template('<div><div style=display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap><div style=min-width:0><h2 style=margin:0;font-size:22px;font-weight:800;letter-spacing:0.2px;line-height:1.2;color:#ffffff></h2><div style=margin-top:5px;font-size:11px;font-weight:600;letter-spacing:1.2px;text-transform:uppercase;color:#8e8e93>Local AI CI/CD Orchestrator</div><div title="Суммарные метрики по всем задачам (включая архивные записи метрик)"style=margin-top:4px;font-size:11px;color:#8e8e93>📊 Всего по всем задачам: <!> · ✅ <!> · ❌ </div></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><select title="Фильтр задач по workspace"style="padding:6px 10px;border-radius:999px;cursor:pointer;font-size:12px;border:1px solid #333;background:#1e1e1e;color:#e0e0e0;outline:none;max-width:200px"><option value=all>Все workspace</option><option value=none>Без workspace</option></select><button>👤 </button><button title="Открыть локальный веб-дашборд (фактический порт сервера)"style="display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;transition:background 0.2s ease, border-color 0.2s ease;border:1px solid #333;background:#1e1e1e;color:#e0e0e0">🌐 Открыть дашборд</button><label title="Переключить зимнюю тему"><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>❄️ Зимний режим</label></div></div><div style=display:flex;gap:8px;flex-wrap:wrap;margin-top:8px><button></button><input type=file accept=.json style=display:none><button></button></div><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px><label style=font-size:12px;color:#b0b0b0;font-weight:500;white-space:nowrap>Макс. одновременных задач:</label><input type=number min=0 style="width:60px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93;white-space:nowrap>(0 = без ограничений)</span></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><button style="display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;padding:10px 14px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left"><span>🔔 Уведомления</span><span style=display:flex;align-items:center;gap:8px;font-size:11px;font-weight:400;color:#8e8e93><span></span></span></button></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><button style="display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;padding:10px 14px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left"><span>🧹 История и ретеншн</span><span style=display:flex;align-items:center;gap:8px;font-size:11px;font-weight:400;color:#8e8e93> · <span></span></span></button></div><div style="width:100%;max-width:700px;box-sizing:border-box;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><div style="display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px"><button style=display:flex;align-items:center;gap:8px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left;padding:0><span>📦 Workspaces</span><span style=font-size:11px;font-weight:400;color:#8e8e93></span><span style=font-size:11px;color:#8e8e93></span></button><button title="Добавить workspace (git-репозиторий)">+ Добавить</button></div></div><div style=display:block;width:100%;margin-top:24px><h3 style=margin:0;margin-bottom:8px;font-size:14px;font-weight:600;color:#ffffff>Задачи'),ts=e.template("<div style=padding:16px;color:#ff3b30;font-size:13px>Ошибка UI: "),rs=e.template("<option>📦 "),Dd=e.template('<div style="background:#1e1e1e;border:1px solid #333;border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:8px"><div style=display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap><div style=font-size:12px;font-weight:600;color:#e0e0e0>👤 Профили</div><button>+ Создать</button></div><div style=display:flex;flex-direction:column;gap:6px></div><div style=font-size:11px;color:#8e8e93>У каждого профиля своя БД, настройки, логи и порт дашборда. После переключения перезапустите OpenCode.'),jd=e.template("<div style=font-size:11px;color:#ffd60a>Профиль задан переменной OPENCODE_SCHEDULER_PROFILE. Переключение в GUI недоступно."),Nd=e.template("<div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px><span></span><span style=font-size:11px;color:#8e8e93></span><span style=font-size:11px;color:#8e8e93;overflow:hidden;text-overflow:ellipsis;max-width:340px>"),Bd=e.template("<span style=font-size:11px;color:#34c759>активен"),Fd=e.template("<button>Переключить"),Gd=e.template("<button>Удалить"),Wd=e.template('<div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><label style=display:flex;align-items:center;gap:8px;font-size:12px;color:#e0e0e0;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Включить уведомления</label><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Только при ошибке</label><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Webhook (Discord / Slack / generic)</label><input type=url placeholder=https://discord.com/api/webhooks/...><div style=font-size:11px;color:#8e8e93>POST с JSON { content, text } — совместимо с Discord и Slack.</div><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:#b0b0b0><span>Таймаут, мс:</span><input type=number min=1000 max=120000 step=1000 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>повторов:</span><input type=number min=0 max=5 style="width:56px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>пауза, мс:</span><input type=number min=100 max=60000 step=100 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>Повтор при сетевой ошибке, таймауте, 5xx и 429 (экспоненциальная пауза).</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Telegram</label><input type=password autocomplete=off placeholder="Токен бота из @BotFather"><input type=text placeholder="chat_id (например, 123456789 или -100...)"><div><span>разметка:</span><select style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><option value=HTML>HTML</option><option value=MarkdownV2>MarkdownV2</option><option value=Markdown>Markdown</option><option value>plain text</option></select><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>без звука</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>ссылка на дашборд</label></div><div style=font-size:11px;color:#8e8e93>Токен можно не хранить в settings.json: задайте OPENCODE_SCHEDULER_TELEGRAM_BOT_TOKEN и OPENCODE_SCHEDULER_TELEGRAM_CHAT_ID.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Нативные уведомления ОС</label><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>со звуком</label><div style=font-size:11px;color:#8e8e93>Windows Toast, macOS Notification Center, Linux notify-send. Без внешних зависимостей.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Тихие часы</label><div><span>с</span><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>до</span><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>В тихие часы success и partial подавляются, ошибки и таймауты отправляются.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Фильтры по задачам</div><input type=text placeholder="Только эти задачи (через запятую, * — маска)"><input type=text placeholder="Исключить задачи (через запятую, * — маска)"><div style=font-size:11px;color:#8e8e93>Пустой список «только» = все задачи. Исключения важнее включений.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Шаблоны сообщений</div><input type=text placeholder="✅ Задача &quot;{task}&quot; выполнена ({duration})"><input type=text placeholder="❌ Задача &quot;{task}&quot; упала ({duration}){error}"><div style=font-size:11px;color:#8e8e93>Плейсхолдеры: {task} {status} {duration} {error} {emoji} {cost} {tokens}. Пусто = шаблон по умолчанию.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Матрицы</div><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Уведомлять о завершении матриц</label><div><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>partial</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>все упали</label><span>зависший клон, мин:</span><input type=number min=0 max=10080 style="width:72px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>Клон, выполняющийся дольше указанного времени, уведомляется один раз. 0 — выключить.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Дайджест</div><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Отправлять дайджест</label><div><select style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><option value=daily>ежедневно</option><option value=weekly>еженедельно (Пн)</option></select><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93></span></div><div style=font-size:11px;color:#8e8e93>Запуски, success rate, стоимость и топ ошибок за сутки/неделю.</div></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><button></button><button></button><span style=font-size:11px;color:#8e8e93>Каналы: webhook, Telegram, нативные уведомления ОС.'),Ud=e.template('<div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Удалять записи старше, дней</label><input type=number min=0 style="width:70px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = не удалять по возрасту</span></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Хранить не более записей</label><input type=number min=0 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = без ограничения</span></div><div style=font-size:11px;color:#8e8e93>Последняя очистка: </div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><button></button><span style=font-size:11px;color:#8e8e93>Удаляются только завершённые записи; незавершённые запуски не трогаются.'),Hd=e.template('<div style="display:flex;flex-direction:column;gap:6px;padding:0 14px 12px">'),Jd=e.template('<div style="font-size:12px;color:#8e8e93;padding:4px 0">Workspace не добавлен. Задача без workspace использует рабочую директорию проекта.'),Qd=e.template('<div style="display:flex;align-items:center;gap:10px;padding:8px 10px;background:#252526;border:1px solid #333;border-radius:8px;min-width:0"><span></span><div style=display:flex;flex-direction:column;gap:2px;flex:1;min-width:0><span style=font-size:12px;font-weight:700;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>📦 </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis></span><span style=font-size:10px;color:#a0a0a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>git: <!> · </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>env: </span></div><div style=display:flex;gap:4px;flex-shrink:0><button title="Env-переменные workspace (секреты маскируются в логах)"style=background:transparent;border:none;color:#a0a0a6;cursor:pointer;font-size:14px;padding:2px>🔑</button><button title="Редактировать workspace"style=background:transparent;border:none;color:#a0a0a6;cursor:pointer;font-size:14px;padding:2px>✏️</button><button title="Удалить workspace (задачи сохраняются)"style=background:transparent;border:none;color:#ff3b30;cursor:pointer;font-size:14px;padding:2px>🗑'),Vd=e.template('<button title="Развернуть форму создания задачи"style="display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:700px;box-sizing:border-box;padding:12px 16px;background:#1e1e1e;border:1px dashed #3a3a3a;border-radius:10px;color:#e0e0e0;font-size:13px;font-weight:600;cursor:pointer;transition:border-color 0.18s ease, background 0.18s ease">➕ Создать задачу'),Kd=e.template('<div style="display:block;width:100%;max-width:700px;box-sizing:border-box;background:#1e1e1e;padding:20px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,0.2)"><div style=display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px><h3 style=margin:0;font-size:14px;font-weight:600;color:#ffffff></h3><div style=display:flex;align-items:center;gap:8px><button title="Сохранить текущие настройки формы как шаблон"style="background:transparent;border:1px solid #333;border-radius:6px;padding:4px 10px;color:#a0a0a6;font-size:11px;cursor:pointer;white-space:nowrap;transition:color 0.18s ease, border-color 0.18s ease">💾 Сохранить как шаблон</button><button title="Свернуть форму"style="background:transparent;border:1px solid #333;border-radius:6px;padding:4px 10px;color:#a0a0a6;font-size:11px;cursor:pointer;white-space:nowrap;transition:color 0.18s ease, border-color 0.18s ease">Скрыть форму ▴</button></div></div><div style="display:block;width:100%;margin-bottom:12px;padding:10px 12px;background:#1a1a1a;border:1px solid #333;border-radius:8px"><label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;font-weight:600;color:#fff><input type=checkbox style=accent-color:#ff9f0a>📦 Matrix (Fan-Out)</label><div style=font-size:11px;color:#8e8e93;margin-top:4px;line-height:1.45>Задача-шаблон раскладывается на клоны по workspace. Родитель сам не выполняется — он запускает клоны и агрегирует результат.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Имя задачи</label><input type=text placeholder="например, Gui-Test"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Тип триггера</label><div style=display:flex;gap:8px;flex-wrap:wrap><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>По расписанию (Cron)</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>При изменении файла</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>MCP Event</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>Разово</label></div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Сессия OpenCode</label><div style=display:flex;gap:8px;flex-wrap:wrap><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Новая</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Переиспользовать</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Последняя (--continue)</label></div></div><div style=width:100%;marginBottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Расписание</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select><div style=display:block;width:100%;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Часовой пояс (IANA)</label><input type=text list=iana-timezones placeholder="Пусто — системный пояс"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><datalist id=iana-timezones><option value=Europe/Moscow></option><option value=Europe/London></option><option value=Europe/Berlin></option><option value=America/New_York></option><option value=America/Los_Angeles></option><option value=Asia/Almaty></option><option value=Asia/Tokyo></option><option value=UTC></option></datalist><div style=display:block;margin-top:6px;font-size:11px;color:#808080>Другая зона — задача будится каждую минуту, cron проверяется с учётом пояса.</div></div><div style=display:block;width:100%;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Окно запуска (необязательно)</label><div style=display:flex;gap:8px;align-items:center><input type=time title="Начало окна"style="display:block;flex:1;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><span style=color:#808080;font-size:12px>—</span><input type=time title="Конец окна (может быть меньше начала)"style="display:block;flex:1;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;margin-top:6px;font-size:11px;color:#808080>Вне окна запуск переносится на его открытие, а не пропускается. Например 22:00 — 06:00.</div></div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Промпт</label><textarea placeholder="Напиши краткий отчет о состоянии рынка"rows=2 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical"></textarea></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Шаблон промпта</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Модель LLM</label><input type=text list=scheduler-model-presets placeholder="по умолчанию (как в OpenCode)"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><datalist id=scheduler-model-presets><option value=anthropic/claude-3-5-sonnet></option><option value=openai/gpt-4o></option><option value=deepseek/deepseek-coder></option><option value=google/gemini-2.5-pro></option><option value=openai/gpt-4o-mini></option></datalist><div style=font-size:11px;color:#8e8e93;margin-top:6px>Пусто — модель OpenCode по умолчанию. Иначе будет передан флаг --model.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Приоритет</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select><div style=font-size:11px;color:#8e8e93;margin-top:6px>Если готовы несколько задач сразу, первой запускается задача с более высоким приоритетом.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Кол-во повторов при ошибке</label><input type=number min=0 placeholder=0 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Задержка перед повтором (сек)</label><input type=number min=1 placeholder=60 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Проверочная команда (Quality Gate)</label><input type=text placeholder="например: npm run test"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Выполняется после успешного ответа ИИ. Ненулевой код = ошибка задачи.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Команда перед запуском (Pre-flight)</label><input type=text placeholder="например: git pull"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Например: git pull или npm install. Выполняется в рабочей директории задачи. Ненулевой код отменяет запуск (Pre-flight script failed).</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Команда после запуска (Post-flight)</label><input type=text placeholder="например: git push"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Например: git push или npm run build. Выполняется в рабочей директории задачи даже при ошибке основной задачи.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Зависит от задач (успешное завершение)</label><div style="display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;min-height:38px;box-sizing:border-box"></div><div style=font-size:11px;color:#8e8e93;margin-top:6px>Задача запустится автоматически, когда все отмеченные задачи завершатся успешно.</div></div><details style=display:block;width:100%;margin-bottom:12px><summary style=cursor:pointer;font-size:12px;color:#b0b0b0;font-weight:500;margin-bottom:8px;user-select:none>🔒 Ограничения инструментов</summary><div style="display:block;width:100%;padding:10px;background:#1e1e1e;border:1px solid #333;border-radius:6px;box-sizing:border-box"><div style=font-size:11px;color:#8e8e93;margin-bottom:8px>⚠ Metadata-only: opencode 2.2.3 не поддерживает allow/deny флаги — ограничения фиксируются в логе и истории. При конфликте приоритет у <b>denied</b>. Пустой allowedTools запрещён.</div><div style=font-size:11px;color:#b0b0b0;margin-bottom:4px>Белый список (allowedTools)</div><div style=display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px></div><div style=font-size:11px;color:#b0b0b0;margin-bottom:4px>Чёрный список (deniedTools)</div><div style=display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px></div><div style=display:flex;gap:6px><input type=text placeholder="свой инструмент, например websearch"style="flex:1;padding:6px 8px;background:#141414;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><button style="padding:6px 10px;background:transparent;border:1px solid #34c759;color:#34c759;border-radius:6px;cursor:pointer;font-size:12px">+ allowed</button><button style="padding:6px 10px;background:transparent;border:1px solid #ff3b30;color:#ff3b30;border-radius:6px;cursor:pointer;font-size:12px">+ denied</button></div></div></details><div style=display:block;width:100%;margin-top:8px><button title="Локальное превью команды по текущим полям формы (без RPC и без запуска)"style="display:block;width:100%;padding:8px;margin-top:4px;background:transparent;border:1px solid #333;border-radius:6px;color:#d4e6ff;cursor:pointer;font-size:12px">🧪 Превью</button><button>'),Yd=e.template('<div style=margin-top:10px;display:flex;flex-direction:column;gap:10px><div><div style=font-size:12px;color:#b0b0b0;font-weight:500;margin-bottom:6px>Workspaces (для матрицы) — выбрано </div></div><div style=display:flex;gap:8px;flex-wrap:wrap><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>Стратегия<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=parallel>parallel — все сразу</option><option value=sequential>sequential — по одному</option></select></label><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>При ошибке<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=continue>continue — продолжать</option><option value=stop>stop — остановить</option></select></label><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>Агрегация<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=summary>summary — сводка</option><option value=per-task>per-task — по задачам</option></select></label></div><label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:#e0e0e0><input type=checkbox style=accent-color:#ff9f0a>Создать aggregator-задачу matrix-complete (запустится после всех клонов)</label><label style=font-size:11px;color:#b0b0b0;max-width:240px>Одновременно клонов (concurrency)<input type=number min=1 step=1 style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"></label><div style="padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px;font-size:11px;line-height:1.55;color:#a0a0a6">'),Zd=e.template("<div style=font-size:11px;color:#f5a623>Сначала добавьте хотя бы один workspace."),Xd=e.template('<div style="display:flex;flex-direction:column;gap:4px;max-height:170px;overflow:auto;padding:6px 8px;background:#141414;border:1px solid #333;border-radius:6px">'),ec=e.template("<label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:#e0e0e0><input type=checkbox style=accent-color:#ff9f0a><span>📦 </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>"),tc=e.template('<details style="padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px"><summary style=cursor:pointer;font-size:12px;color:#b0b0b0;font-weight:500>⚙ Настройки по workspace — переопределено </summary><div style=margin-top:8px;display:flex;flex-direction:column;gap:8px;max-height:340px;overflow:auto>'),rc=e.template('<div style="padding:8px;background:#101010;border:1px solid #2a2a2a;border-radius:6px"><div>📦 <span style=margin-left:6px;font-size:10px;color:#8e8e93></span></div><div style=display:flex;flex-direction:column;gap:6px><textarea rows=2 placeholder="Промпт (по умолчанию — общий промпт формы)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;width:100%;resize:vertical;font-family:inherit"></textarea><div style=display:flex;gap:6px;flex-wrap:wrap><input placeholder="Модель (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"><input placeholder="Quality Gate (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"></div><div style=display:flex;gap:6px;flex-wrap:wrap><input placeholder="beforeScript (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"><input placeholder="afterScript (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px">'),ic=e.template("<div style=color:#ff9f0a;font-weight:600>Будет создано <!> клон(а/ов):"),nc=e.template("<div style=color:#e0e0e0;word-break:break-all>"),oc=e.template("<span style=color:#f5a623>Выберите хотя бы один workspace — превью клонов появится здесь."),lc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Workspace (multi-repo)</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><option value>Без workspace — рабочая директория'),sc=e.template('<div style="margin-top:8px;padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px;font-size:11px;line-height:1.55;color:#a0a0a6"><div>cwd = <span style=color:#e0e0e0></span></div><div>git branch = <span style=color:#5ac8fa></span></div><div>git remote = <span style=color:#e0e0e0>'),ac=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Рабочая директория</label><input type=text placeholder="по умолчанию — папка проекта"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>В этой папке задача запустит opencode run — здесь подхватятся MCP-серверы из opencode.json.'),pc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Путь к файлу для отслеживания</label><input type=text placeholder="например, C:\\project\\src\\main.ts"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),dc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>MCP-сервер / источник</label><input type=text placeholder="например, github"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),cc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Имя события</label><input type=text placeholder="например, github.pr.opened"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),uc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Фильтр (опционально)</label><input type=text placeholder="например, repo=&quot;my-project&quot; или regex"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>key=value сравнивается с полем payload, иначе фильтр считается regex/подстрокой. События приходят через RPC emit_event.'),fc=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Время однократного запуска</label><input type=text placeholder="2026-11-14T10:00:00.000Z или локальная дата"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style="font-size:11px;color:#8e8e93;margin:6px 0">Или задержка в секундах от нажатия кнопки «Создать задачу»:</div><input type=number min=1 placeholder="например, 3600"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Приоритет у runAt: если задано время, delaySeconds игнорируется. После запуска задача больше не повторится.'),gc=e.template('<div style=margin-top:8px><label style=display:block;margin-bottom:6px;font-size:11px;color:#8e8e93>Сколько запусков переживает сессия (sessionMaxRuns, необязательно)</label><input type=number min=1 placeholder="без ограничения"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>sessionId генерируется плагином автоматически. При достижении лимита сессия удаляется, следующий запуск начинает чистую сессию.'),xn=e.template("<option>"),yc=e.template('<div style=display:block;width:100%;margin-top:8px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Cron-выражение</label><input type=text placeholder="* * * * *"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),bc=e.template('<div style="display:block;max-height:80px;overflow-y:auto;margin-top:8px;padding:8px;background:#2a1113;border:1px solid #5a1d21;border-radius:6px;font-size:11px;line-height:1.4;color:#ff6b6b;white-space:pre-wrap;word-break:break-word">'),mc=e.template('<div style=display:flex;align-items:center;gap:6px;margin-top:8px><span style=font-size:10px;color:#8e8e93>Кастомный шаблон:</span><button title="Удалить шаблон"style=background:transparent;border:none;color:#ff3b30;cursor:pointer;font-size:14px;line-height:1;padding:0>🗑'),xc=e.template("<span style=font-size:11px;color:#ff3b30;font-weight:500;cursor:default>"),vc=e.template("<option>Другой (<!>)"),hc=e.template("<span style=font-size:12px;color:#8e8e93>Других задач пока нет"),yo=e.template("<label><input type=checkbox style=margin:0>"),$c=e.template("<span style=color:#5ac8fa;font-size:11px;margin-left:6px>(<!> allowed · <!> denied)"),wc=e.template("<div style=font-size:11px;color:#cfcfd2;margin-top:8px>"),_c=e.template("<div>allowed: [<!>]"),kc=e.template("<div>denied: [<!>]"),Sc=e.template('<button style="background:transparent;border:1px solid #333;border-radius:6px;padding:8px 16px;color:#ff3b30;cursor:pointer;font-size:13px;width:100%">Отмена'),Cc=e.template('<div style="display:block;width:100%;margin-top:8px;padding:10px;background:#1e1e1e;border:1px solid #333;border-radius:6px"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;justify-content:space-between;align-items:center>🧪 Превью (локальное, по полям формы)<button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),zc=e.template("<div style=display:flex;flex-direction:column;gap:4px;font-size:11px;color:#e0e0e0;margin-top:6px><div style=overflow-wrap:anywhere>$ </div><div style=color:#8e8e93>cwd: "),Tc=e.template("<div style=color:#8e8e93>🔒 allowed=[<!>] · denied=[<!>]"),Ec=e.template("<div style=color:#8e8e93>⚡ pre: "),Ac=e.template("<div style=color:#8e8e93>⚡ post: "),Pc=e.template("<div style=color:#8e8e93>✅ QG: "),Mc=e.template("<div style=color:#f5a623>⚠ "),Lc=e.template("<div style=font-size:11px;color:#8e8e93;margin-bottom:8px>Фильтр: <!> · показано <!> из "),Rc=e.template('<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px 16px;color:#a0a0a6;font-size:13px;gap:10px"><span style=font-size:40px;line-height:1></span><span style=max-width:380px;line-height:1.5>'),Oc=e.template("<div style=display:flex;flex-direction:column;gap:0>"),Ic=e.template('<div style=position:fixed;inset:0;background:rgba(0,0,0,0.55);display:flex;align-items:center;justify-content:center;z-index:2000;padding:20px><div style="width:min(540px,100%);background:#1e1e1e;border:1px solid #444;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 40px rgba(0,0,0,0.6)"><div style=font-size:13px;font-weight:600;color:#e0e0e0;white-space:pre-wrap></div><div style=display:flex;justify-content:flex-end;gap:8px><button style="padding:6px 14px;border-radius:6px;border:1px solid #3a3a3a;background:#262626;color:#e0e0e0;font-size:12px;cursor:pointer">Отмена</button><button style="padding:6px 14px;border-radius:6px;border:1px solid #0a84ff;background:#0a84ff;color:#fff;font-size:12px;font-weight:600;cursor:pointer">ОК'),qc=e.template(`<textarea autofocus rows=6 style="width:100%;box-sizing:border-box;resize:vertical;padding:8px 10px;border-radius:8px;border:1px solid #3a3a3a;background:#141414;color:#e0e0e0;font-family:Menlo, Monaco, 'Courier New', monospace;font-size:12px;outline:none">`),Dc=e.template('<input autofocus style="width:100%;box-sizing:border-box;padding:8px 10px;border-radius:8px;border:1px solid #3a3a3a;background:#141414;color:#e0e0e0;font-size:13px;outline:none">'),jc=e.template("<div style=font-size:11px;color:#8e8e93>Ctrl+Enter — сохранить, Escape — отмена"),Nc=e.template(`<div style="position:fixed;bottom:16px;left:16px;right:16px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:0;max-height:300px;overflow:hidden;display:flex;flex-direction:column;z-index:1000"><div style="display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #333;background:#252526;border-radius:8px 8px 0 0"><div style=display:flex;align-items:center;gap:8px><span style=font-size:13px;font-weight:600;color:#ffffff>Логи</span><span style=font-size:11px;color:#8e8e93></span></div><button style=background:transparent;border:none;color:#8e8e93;cursor:pointer;font-size:18px;line-height:1;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center>✕</button></div><div style="flex:1;overflow-y:auto;padding:12px;font-family:Menlo, Monaco, 'Courier New', monospace;font-size:11px;line-height:1.5;color:#d4d4d4;background:#1e1e1e;border-radius:0 0 8px 8px">`),Bc=e.template("<div style=white-space:pre-wrap;margin-bottom:2px>"),Fc=e.template(`<div style="padding:16px;display:flex;flex-direction:column;gap:16px;font-size:13px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;color:#e0e0e0;background:#0f0f0f"><h2 style=margin:0;font-size:22px;font-weight:800;color:#ffffff></h2><div style=margin-top:5px;font-size:11px;font-weight:600;letter-spacing:1.2px;text-transform:uppercase;color:#8e8e93>Local AI CI/CD Orchestrator</div><div style="background:#2a1a1a;border:1px solid #ff3b30;border-radius:8px;padding:16px;color:#ff3b30">Произошла ошибка отображения. Попробуйте перезагрузить панель.`);function Gc(c){switch(c){case"running":return"#f5a623";case"success":return"#34c759";case"error":return"#ff3b30";case"partial":return"#ff9f0a";default:return"#8e8e93"}}const Ve=5;function is(c){const _=typeof c=="number"&&Number.isFinite(c)?Math.min(10,Math.max(0,Math.floor(c))):Ve;return _>=10?"Критический":_>=8?"Высокий":_<=3?"Низкий":"Обычный"}const ns=[{value:2,label:"Низкий"},{value:5,label:"Обычный"},{value:8,label:"Высокий"},{value:10,label:"Критический"}];function H(c){return c instanceof Error?c.message:typeof c=="object"&&c!==null&&"message"in c?String(c.message):JSON.stringify(c)}function Oe(c,_=150){const ct=(c||"").split(/\r?\n/).map(hn=>hn.trim()).find(Boolean)??"";return ct.length>_?ct.slice(0,_-1).trimEnd()+"…":ct}const bo=[{label:"Каждую минуту",value:"* * * * *"},{label:"Каждый час",value:"0 * * * *"},{label:"Каждый день в 09:00",value:"0 9 * * *"},{label:"Каждый понедельник в 10:00",value:"0 10 * * 1"},{label:"Свое расписание…",value:"__custom__"}],Wc=fo.Plugin.define({setup(c){const _=c.client.rpc(Wp),[ct,hn]=s.createSignal([]),[fe,ps]=s.createSignal([]),[$n,ds]=s.createSignal(!1),[Lt,ho]=s.createSignal("all"),[Rt,Ke]=s.createSignal(!1),[Ot,Ye]=s.createSignal(""),[cs,us]=s.createSignal([]),[$o,wo]=s.createSignal("default"),[It,fs]=s.createSignal(!1),[ii,gs]=s.createSignal(!1),[qt,Dt]=s.createSignal(!1),[ys,_o]=s.createSignal(!1),[wn,bs]=s.createSignal(""),[or,_n]=s.createSignal("");let ni=null;function Ze(r,t=""){return ni?.(null),new Promise(n=>{ni=n,bs(r),_n(t),_o(!0)})}function ut(r){const t=ni;ni=null,_o(!1),t?.(r)}const[ms,jt]=s.createSignal(""),[kn,Sn]=s.createSignal(null),[lr,ko]=s.createSignal(!1),[So,oi]=s.createSignal(""),[Cn,xs]=s.createSignal({total:0,success:0,error:0}),[li,Co]=s.createSignal(null),[zo,vs]=s.createSignal([]),To=[{label:"Свой промпт",value:"custom",prompt:""},{label:"Ночной сторож (тесты)",value:"night-watch",prompt:"Запусти ночные проверки: прогнали тесты, зафиксируй ошибки и составь краткий отчёт о состоянии репозитория."},{label:"Утренний дайджест",value:"morning-digest",prompt:"Собери утренний дайджест: какие изменения были за ночь, есть ли проваленные сборки, что требует внимания сегодня."},{label:"Гигиена кода",value:"code-hygiene",prompt:"Проведи аудит гигиены кода: найди неиспользуемые импорты, неиспользуемые переменные, лишние зависимости и предложи правки."}],[sr,si]=s.createSignal("custom"),[ai,hs]=s.createSignal([]),[$s,ws]=s.createSignal(0);setInterval(()=>ws(r=>r+1),1e3);const[_s,zn]=s.createSignal(1),[Ce,Tn]=s.createSignal(!1),[x,Eo]=s.createSignal(!1),[En,Ao]=s.createSignal(!0),[ge,Po]=s.createSignal(!1),[Mo,Lo]=s.createSignal(""),[An,ks]=s.createSignal(!0),[pi,Ro]=s.createSignal(!1),[Oo,Io]=s.createSignal(1e4),[qo,Do]=s.createSignal(2),[jo,No]=s.createSignal(1e3),[Bo,Fo]=s.createSignal(""),[Go,Wo]=s.createSignal(""),[Uo,Ho]=s.createSignal(""),[Jo,Qo]=s.createSignal(""),[Nt,Vo]=s.createSignal(!0),[Ko,Yo]=s.createSignal(!0),[Zo,Xo]=s.createSignal(!0),[el,tl]=s.createSignal(60),[ar,rl]=s.createSignal(!1),[il,nl]=s.createSignal("daily"),[ol,ll]=s.createSignal("09:00"),[Pn,Ss]=s.createSignal(null),[ne,sl]=s.createSignal(!1),[al,pl]=s.createSignal(""),[dl,cl]=s.createSignal(""),[ul,fl]=s.createSignal("HTML"),[gl,yl]=s.createSignal(!1),[bl,ml]=s.createSignal(!0),[Cs,zs]=s.createSignal("https://api.telegram.org"),[Ts,Es]=s.createSignal(null),[ze,xl]=s.createSignal(!1),[vl,hl]=s.createSignal(!0),[pr,$l]=s.createSignal(!1),[wl,_l]=s.createSignal("22:00"),[kl,Sl]=s.createSignal("08:00"),[di,Cl]=s.createSignal(!1),[ci,ui]=s.createSignal(30),[fi,gi]=s.createSignal(5e3),[Mn,Ln]=s.createSignal(null),[zl,Rn]=s.createSignal(0),[On,As]=s.createSignal(!0),[yi,Tl]=s.createSignal(!1),Bt=new Map;s.onCleanup(()=>{for(const r of Bt.values())clearInterval(r);Bt.clear()});const[In,Ps]=s.createSignal("Планировщик задач");async function Ms(){try{const r=await _.get_platform({});r?.title&&Ps(r.title)}catch(r){console.error("RPC Error (get_platform):",r)}}function El(r){Eo(!!r?.enabled),Ao(r?.onlyOnError!==!1),Po(!!r?.webhook?.enabled),Lo(r?.webhook?.url??""),Io(Number(r?.webhook?.timeoutMs??1e4)),Do(Number(r?.webhook?.retryCount??2)),No(Number(r?.webhook?.retryDelayMs??1e3)),Fo(r?.templates?.success??""),Wo(r?.templates?.error??""),Ho((r?.filters?.include??[]).join(", ")),Qo((r?.filters?.exclude??[]).join(", ")),Vo(r?.matrix?.enabled!==!1),Yo(r?.matrix?.onPartial!==!1),Xo(r?.matrix?.onAllFailed!==!1),tl(Number(r?.matrix?.stuckAfterMinutes??60)),rl(!!r?.digest?.enabled),nl(r?.digest?.frequency==="weekly"?"weekly":"daily"),ll(r?.digest?.time??"09:00"),Ss(r?.digest?.lastSentAt??null),sl(!!r?.telegram?.enabled),pl(r?.telegram?.botToken??""),cl(r?.telegram?.chatId??""),fl(r?.telegram?.parseMode??"HTML"),yl(!!r?.telegram?.disableNotification),ml(r?.telegram?.includeDashboardLink!==!1),zs(r?.telegram?.apiBase??"https://api.telegram.org"),Es(typeof r?.telegram?.messageThreadId=="number"?r.telegram.messageThreadId:null),xl(!!r?.native?.enabled),hl(r?.native?.sound!==!1),$l(!!r?.quietHours?.enabled),_l(r?.quietHours?.from??"22:00"),Sl(r?.quietHours?.to??"08:00")}async function Ls(){try{const r=await _.get_settings({});zn(r.maxConcurrent??1),Tn(!!r.winterMode),El(r.notifications);const t=r.history;ui(Number(t?.retentionDays??30)),gi(Number(t?.maxRecords??5e3)),Ln(t?.lastCleanupAt??null),Rn(Number(t?.lastCleanupDeleted??0))}catch(r){console.error("RPC Error (get_settings):",r)}}function Rs(){const r=t=>t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return{enabled:x(),onlyOnError:En(),webhook:{enabled:ge(),url:(Mo()||"").trim(),timeoutMs:Math.max(1e3,Math.min(12e4,Math.floor(Number(Oo())||1e4))),retryCount:Math.max(0,Math.min(5,Math.floor(Number(qo())||0))),retryDelayMs:Math.max(100,Math.min(6e4,Math.floor(Number(jo())||1e3)))},templates:{success:Bo().trim(),error:Go().trim()},filters:{include:r(Uo()),exclude:r(Jo())},telegram:{enabled:ne(),botToken:(al()||"").trim(),chatId:(dl()||"").trim(),parseMode:ul(),disableNotification:gl(),messageThreadId:Ts(),includeDashboardLink:bl(),apiBase:Cs()},native:{enabled:ze(),sound:vl()},quietHours:{enabled:pr(),from:(wl()||"22:00").trim(),to:(kl()||"08:00").trim()},matrix:{enabled:Nt(),onPartial:Ko(),onAllFailed:Zo(),stuckAfterMinutes:Math.max(0,Math.min(10080,Math.floor(Number(el())||0)))},digest:{enabled:ar(),frequency:il(),time:(ol()||"09:00").trim(),lastSentAt:Pn()}}}function Al(){return{retentionDays:Math.max(0,Math.floor(Number(ci())||0)),maxRecords:Math.max(0,Math.floor(Number(fi())||0)),lastCleanupAt:Mn(),lastCleanupDeleted:Math.max(0,Math.floor(Number(zl())||0))}}async function dr(r){try{const t=await _.save_settings(r);if(r.maxConcurrent!==void 0&&zn(t.maxConcurrent),r.winterMode!==void 0&&Tn(!!t.winterMode),r.notifications!==void 0&&El(t.notifications),r.history!==void 0){const n=t.history;ui(Number(n?.retentionDays??30)),gi(Number(n?.maxRecords??5e3)),Ln(n?.lastCleanupAt??null),Rn(Number(n?.lastCleanupDeleted??0))}}catch(t){console.error("RPC Error (save_settings):",t),c.toast.show({title:"Не удалось сохранить настройки",variant:"error",description:H(t)})}}async function M(){await dr({notifications:Rs()})}async function Pl(){await dr({history:Al()})}async function Os(){Tl(!0);try{await dr({history:Al()});const r=await _.cleanup_history({}),n=(await _.get_settings({})).history;ui(Number(n?.retentionDays??30)),gi(Number(n?.maxRecords??5e3)),Ln(n?.lastCleanupAt??null),Rn(Number(n?.lastCleanupDeleted??0)),c.toast.show({title:r.success?"Очистка истории завершена":"Очистка не удалась",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (cleanup_history):",r),c.toast.show({title:"Очистка не удалась",variant:"error",description:H(r)})}finally{Tl(!1)}}async function Is(){Ro(!0);try{await M();const r=await _.test_notification({});c.toast.show({title:r.success?"Тестовое уведомление отправлено":"Тест не удался",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (test_notification):",r),c.toast.show({title:"Тест не удался",variant:"error",description:H(r)})}finally{Ro(!1)}}async function qs(){Cl(!0);try{await M();const r=await _.send_digest({});c.toast.show({title:r.success?"Дайджест отправлен":"Дайджест не отправлен",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (send_digest):",r),c.toast.show({title:"Дайджест не отправлен",variant:"error",description:H(r)})}finally{Cl(!1)}}async function Ds(r){zn(r),await dr({maxConcurrent:r})}async function js(r){Tn(r),await dr({winterMode:r})}const[qn,bi]=s.createSignal(null),[Ns,Dn]=s.createSignal(!1),[Te,mi]=s.createSignal(""),[xi,Ft]=s.createSignal("* * * * *"),[Gt,Wt]=s.createSignal(""),[Ml,cr]=s.createSignal("* * * * *"),[vi,ur]=s.createSignal(0),[hi,fr]=s.createSignal(60),[gr,yr]=s.createSignal(""),[ft,br]=s.createSignal(Ve),[$i,mr]=s.createSignal(""),[gt,xr]=s.createSignal([]),[wi,vr]=s.createSignal(""),[_i,hr]=s.createSignal(""),[se,Xe]=s.createSignal("cron"),[jn,$r]=s.createSignal(""),[Nn,ki]=s.createSignal(""),[Si,Ci]=s.createSignal(""),[Ie,Ut]=s.createSignal("new"),[wr,zi]=s.createSignal(""),[Ti,_r]=s.createSignal(""),[Ei,kr]=s.createSignal(""),[Ai,Sr]=s.createSignal(""),[Bn,Cr]=s.createSignal(""),[Fn,zr]=s.createSignal(""),[Tr,Er]=s.createSignal(""),[Pi,Ht]=s.createSignal(""),[ee,Jt]=s.createSignal([]),[te,Qt]=s.createSignal([]),[Ll,Rl]=s.createSignal(""),[qe,Mi]=s.createSignal(!1),[De,Ar]=s.createSignal([]),[Gn,Li]=s.createSignal("parallel"),[Ol,Ri]=s.createSignal("continue"),[Il,Oi]=s.createSignal("summary"),[ql,Ii]=s.createSignal(!1),[qi,Di]=s.createSignal(""),[Wn,ji]=s.createSignal({}),[Pr,Un]=s.createSignal(!1),[Hn,Dl]=s.createSignal(!1),[re,Mr]=s.createSignal(null),[Lr,Jn]=s.createSignal(""),jl=["bash","edit","write","read","grep","glob","webfetch"];function Nl(r,t){r==="allowed"?Jt(n=>n.includes(t)?n.filter(a=>a!==t):[...n,t]):Qt(n=>n.includes(t)?n.filter(a=>a!==t):[...n,t])}function Bl(r){const t=Ll().trim();t&&(r==="allowed"?ee().includes(t)||Jt([...ee(),t]):te().includes(t)||Qt([...te(),t]),Rl(""))}function Bs(r,t){Ar(n=>t?n.includes(r)?n:[...n,r]:n.filter(a=>a!==r))}function Qn(r,t){const n=r.trim()||"task",a=t.trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-");return`${n}-matrix-${a||"workspace"}`}const Vn=()=>De().map(r=>fe().find(t=>t.id===r)).filter(r=>!!r).map(r=>Qn(Te(),r.name));function Rr(r,t,n){ji(a=>{const F={...a[r]??{}};n.trim()?F[t]=n:delete F[t];const Q={...a};return Object.keys(F).length>0?Q[r]=F:delete Q[r],Q})}const Fs=()=>Object.keys(Wn()).length,Fl=()=>{if(!qe())return;const r=qi().trim(),t=r?Number(r):void 0,n=Wn();return{workspaceIds:De(),strategy:Gn(),failureMode:Ol(),aggregation:Il(),createAggregator:ql(),...t!==void 0&&Number.isFinite(t)&&t>=1?{concurrency:Math.floor(t)}:{},...Object.keys(n).length>0?{overrides:n}:{}}};function Ni(){Mi(!1),Ar([]),Li("parallel"),Ri("continue"),Oi("summary"),Ii(!1),Di(""),ji({})}function Gs(){const r=gr().trim()?` --model ${gr().trim()}`:"",t=Ie()==="last"?" --continue":Ie()==="reuse"?" --session <id>":"";return`opencode run${r}${t} "${Gt().replace(/\s+/g," ").trim()}"`}const[Uc,Ws]=s.createSignal(null),[Bi,Gl]=s.createSignal(!1),[Fi,Hc]=s.createSignal(!1),[Jc,Us]=s.createSignal(null);async function Hs(){Gl(!0);try{const r=await _.export_tasks({});if(!r.success){c.toast.show({title:"Ошибка экспорта",variant:"error",description:r.error});return}Ws(r.data);const t=new Blob([r.data],{type:"application/json"}),n=URL.createObjectURL(t),a=document.createElement("a");a.href=n,a.download=`windows-scheduler-tasks-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),c.toast.show({title:`Экспортировано задач: ${r.count}`,variant:"success"})}catch(r){console.error("RPC Error (export_tasks):",r),c.toast.show({title:"Ошибка экспорта",variant:"error",description:H(r)})}finally{Gl(!1)}}function Js(r){const n=r.target.files?.[0]??null;Us(n)}async function Kn(){try{const r=await _.get_templates({}),t=Array.isArray(r?.templates)?r.templates:[];hs(t)}catch(r){console.error("RPC Error (get_templates):",r)}}async function Or(){try{const r=await _.get_workspaces({}),t=Array.isArray(r?.workspaces)?r.workspaces:[];ps(t)}catch(r){console.error("RPC Error (get_workspaces):",r)}}const Ir=()=>fe().find(r=>r.id===Ot());async function Gi(){try{const r=await _.get_profiles({}),t=Array.isArray(r?.profiles)?r.profiles:[];us(t),r?.current&&wo(r.current),fs(!!r?.pinnedByEnv)}catch(r){console.error("RPC Error (get_profiles):",r)}}async function Qs(r){if(!(!r||r===$o())){Dt(!0);try{const t=await _.set_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось переключить профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}wo(t.current??r),c.toast.show({title:"Профиль переключён",variant:"success",description:t.message}),await Gi()}catch(t){console.error("RPC Error (set_profile):",t),c.toast.show({title:"Ошибка переключения профиля",variant:"error",description:Oe(H(t))})}finally{Dt(!1)}}}async function Vs(){const r=(await Ze("Имя нового профиля (латиница, цифры, - и _)","")??"").trim();if(r){Dt(!0);try{const t=await _.create_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось создать профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}await Gi(),c.toast.show({title:"Профиль создан",variant:"success",description:t.message})}catch(t){console.error("RPC Error (create_profile):",t),c.toast.show({title:"Ошибка создания профиля",variant:"error",description:Oe(H(t))})}finally{Dt(!1)}}}async function Ks(r){if(!(!r||r==="default")&&window.confirm(`Удалить профиль "${r}" вместе с его БД, настройками и логами?`)){Dt(!0);try{const t=await _.delete_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось удалить профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}await Gi(),c.toast.show({title:"Профиль удалён",variant:"success"})}catch(t){console.error("RPC Error (delete_profile):",t),c.toast.show({title:"Ошибка удаления профиля",variant:"error",description:Oe(H(t))})}finally{Dt(!1)}}}function Ys(r){return r?Object.entries(r).map(([t,n])=>`${t}=${n}`).join(`
2
- `):""}function Zs(r){const t={};for(const n of r.split(/\r?\n/)){const a=n.trim();if(!a||a.startsWith("#"))continue;const F=a.indexOf("=");if(F<=0)return null;const Q=a.slice(0,F).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Q))return null;t[Q]=a.slice(F+1).trim()}return t}async function Xs(r){const t=await Ze(`Env-переменные workspace, по одной в строке KEY=VALUE
3
- (пустое поле — очистить)`,Ys(r.env));if(t===null)return;const n=Zs(t);if(!n){c.toast.show({title:"Неверный формат env",variant:"error",description:"Нужны строки KEY=VALUE, имя — латиница/цифры/_"});return}const a=await Ze("Путь к .env-файлу workspace (необязательно, пусто — без файла)",r.envFile??"");if(a!==null){Ke(!0);try{const F=await _.update_workspace({id:r.id,env:Object.keys(n).length?n:null,envFile:a.trim()||null});if(!F.success){c.toast.show({title:"Не удалось сохранить env",variant:"error",description:F.error??"Неизвестная ошибка"});return}await Or(),c.toast.show({title:"Env-переменные сохранены",variant:"success",description:"Секреты маскируются в логах"})}catch(F){console.error("RPC Error (update_workspace env):",F),c.toast.show({title:"Ошибка сохранения env",variant:"error",description:Oe(H(F))})}finally{Ke(!1)}}}async function ea(){const r=(await Ze("Путь к git-репозиторию (workspace)","")??"").trim();if(!r)return;const t=(await Ze("Название workspace (необязательно)","")??"").trim();Ke(!0);try{const n=await _.add_workspace({path:r,...t?{name:t}:{}});if(!n.success){c.toast.show({title:"Ошибка добавления workspace",variant:"error",description:n.error??"Неизвестная ошибка"});return}await Or(),n.workspace?.id&&Ye(n.workspace.id),c.toast.show({title:"Workspace добавлен",variant:"success"})}catch(n){console.error("RPC Error (add_workspace):",n),c.toast.show({title:"Ошибка добавления workspace",variant:"error",description:Oe(H(n))})}finally{Ke(!1)}}async function ta(r){const t=(await Ze("Путь к git-репозиторию",r.path)??"").trim();if(!t)return;const n=(await Ze("Название workspace",r.name)??"").trim();Ke(!0);try{const a=await _.update_workspace({id:r.id,path:t,...n?{name:n}:{}});if(!a.success){c.toast.show({title:"Ошибка обновления workspace",variant:"error",description:a.error??"Неизвестная ошибка"});return}await Or(),c.toast.show({title:"Workspace обновлён",variant:"success"})}catch(a){console.error("RPC Error (update_workspace):",a),c.toast.show({title:"Ошибка обновления workspace",variant:"error",description:Oe(H(a))})}finally{Ke(!1)}}async function ra(r){if(window.confirm(`Удалить workspace "${r.name}"? Задачи сохранены, привязка будет очищена.`)){Ke(!0);try{const t=await _.delete_workspace({id:r.id});if(!t.success){c.toast.show({title:"Ошибка удаления workspace",variant:"error",description:t.message??"Неизвестная ошибка"});return}Ot()===r.id&&Ye(""),Lt()===r.id&&ho("all"),await Or(),await Ee(),c.toast.show({title:"Workspace удалён",variant:"success",description:t.message})}catch(t){console.error("RPC Error (delete_workspace):",t),c.toast.show({title:"Ошибка удаления workspace",variant:"error",description:Oe(H(t))})}finally{Ke(!1)}}}const ia=r=>{if(si(r),r.startsWith("custom:")){const n=ai().find(a=>`custom:${a.id}`===r);if(!n)return;if(Wt(n.prompt??""),n.schedule){Ft(n.schedule);const a=bo.find(F=>F.value===n.schedule);cr(a?a.value:"__custom__")}if(ur(n.retryCount??0),fr(n.retryDelay??60),mr(n.qualityGate??""),yr(n.model??""),br(typeof n.priority=="number"?n.priority:Ve),xr(Array.isArray(n.dependsOn)?n.dependsOn:[]),vr(n.beforeScript??""),hr(n.afterScript??""),Xe(n.triggerType==="file"?"file":n.triggerType==="mcp-event"?"mcp-event":"cron"),$r(n.watchPath??""),_r(n.timezone??""),kr(n.notBefore??""),Sr(n.notAfter??""),Cr(n.mcpEvent?.server??""),zr(n.mcpEvent?.event??""),Er(n.mcpEvent?.filter??""),Ht(n.workingDirectory??""),Ye(n.workspaceId??""),Jt(Array.isArray(n.allowedTools)?n.allowedTools:[]),Qt(Array.isArray(n.deniedTools)?n.deniedTools:[]),n.matrix){Mi(!0),Ar(Array.isArray(n.matrix.workspaceIds)?n.matrix.workspaceIds:[]),Li(n.matrix.strategy==="sequential"?"sequential":"parallel"),Ri(n.matrix.failureMode==="stop"?"stop":"continue"),Oi(n.matrix.aggregation==="per-task"?"per-task":"summary"),Ii(!!n.matrix.createAggregator),Di(typeof n.matrix.concurrency=="number"?String(n.matrix.concurrency):"");const a=n.matrix.overrides;ji(a?{...a}:{})}else Ni();return}const t=To.find(n=>n.value===r);t&&Wt(t.prompt)};async function na(){if(!(Gt()||"").trim()){c.toast.show({title:"Нечего сохранять",variant:"error",description:"Сначала заполните промпт — он обязателен для шаблона."});return}const r=(await Ze("Название шаблона","")??"").trim();if(r)try{const t=await _.save_template({name:r,prompt:(Gt()||"").trim(),schedule:(xi()||"").trim(),timeoutSeconds:3600,model:(gr()||"").trim(),priority:ft(),retryCount:vi(),retryDelay:hi(),qualityGate:($i()||"").trim(),beforeScript:(wi()||"").trim(),afterScript:(_i()||"").trim(),dependsOn:gt(),triggerType:se(),timezone:(Ti()||"").trim()||void 0,notBefore:(Ei()||"").trim()||void 0,notAfter:(Ai()||"").trim()||void 0,mcpEvent:se()==="mcp-event"?{server:(Bn()||"").trim(),event:(Fn()||"").trim(),...Tr().trim()?{filter:Tr().trim()}:{}}:void 0,watchPath:(jn()||"").trim(),workingDirectory:(Pi()||"").trim(),workspaceId:(Ot()||"").trim()||void 0,allowedTools:ee().length>0?ee():void 0,deniedTools:te().length>0?te():void 0,matrix:Fl()});if(!t.success){c.toast.show({title:"Не удалось сохранить шаблон",variant:"error",description:t.error||"Неизвестная ошибка"});return}await Kn();const n=t.template;n?.id&&si(`custom:${n.id}`),c.toast.show({title:`Шаблон "${r}" сохранён`,variant:"success"})}catch(t){console.error("RPC Error (save_template):",t),c.toast.show({title:"Ошибка сохранения шаблона",variant:"error",description:H(t)})}}async function oa(r){if(window.confirm(`Удалить шаблон "${r.name}"?`))try{const t=await _.delete_template({id:r.id});if(!t.success){c.toast.show({title:"Не удалось удалить шаблон",variant:"error",description:t.error||"Неизвестная ошибка"});return}sr()===`custom:${r.id}`&&si("custom"),await Kn(),c.toast.show({title:`Шаблон "${r.name}" удалён`,variant:"success"})}catch(t){console.error("RPC Error (delete_template):",t),c.toast.show({title:"Ошибка удаления шаблона",variant:"error",description:H(t)})}}async function Ee(){try{const r=await _.get_tasks({});console.log("[GUI] Received tasks:",r);const t=Array.isArray(r?.tasks)?r.tasks:[];console.log("[GUI] tasks count:",t.length);const n=t.map(a=>({name:a.name,schedule:a.schedule,status:a.status??"unknown",runsTotal:typeof a.runsTotal=="number"?a.runsTotal:0,runsSuccess:typeof a.runsSuccess=="number"?a.runsSuccess:0,runsError:typeof a.runsError=="number"?a.runsError:0,runsPartial:typeof a.runsPartial=="number"?a.runsPartial:0,nextRun:a.nextRun??void 0,paused:!!a.paused,orphaned:!!a.orphaned,retryCount:a.retryCount??0,retryDelay:a.retryDelay??60,qualityGate:a.qualityGate??void 0,dependsOn:Array.isArray(a.dependsOn)?a.dependsOn:void 0,model:a.model??void 0,priority:typeof a.priority=="number"?a.priority:Ve,beforeScript:a.beforeScript??void 0,afterScript:a.afterScript??void 0,triggerType:a.triggerType??"cron",runAt:a.runAt??void 0,session:a.session??void 0,sessionMaxRuns:a.sessionMaxRuns??void 0,mcpEvent:a.mcpEvent??void 0,watchPath:a.watchPath??void 0,timezone:a.timezone??void 0,notBefore:a.notBefore??void 0,notAfter:a.notAfter??void 0,pausedUntil:a.pausedUntil??void 0,workingDirectory:a.workingDirectory??void 0,workspaceId:a.workspaceId??void 0,workspaceName:a.workspaceName??void 0,workspaceColor:a.workspaceColor??void 0,allowedTools:Array.isArray(a.allowedTools)?a.allowedTools:void 0,deniedTools:Array.isArray(a.deniedTools)?a.deniedTools:void 0,matrix:a.matrix??null,matrixParentId:a.matrixParentId??null,isMatrixParent:!!a.isMatrixParent,matrixSummary:a.matrixSummary??null,prompt:a.prompt??""}));hn(n),console.log("[GUI] jobs:",ct()),await la()}catch(r){console.error("RPC Error (get_tasks):",r),c.toast.show({title:"Ошибка загрузки задач",variant:"error",description:Oe(H(r))})}}async function la(){try{const r=await _.get_metrics({});xs({total:r.total??0,success:r.success??0,error:r.error??0})}catch(r){console.error("RPC Error (get_metrics):",r)}}async function sa(r){Co(r);try{const t=await _.get_history({limit:10,taskName:r});vs(t.records??[])}catch(t){console.error("RPC Error (get_history):",t),c.toast.show({title:"Ошибка загрузки истории",variant:"error",description:H(t)})}}async function aa(r){Un(!0),Jn(r),Dl(!0),Mr(null);try{const t=await _.dry_run({taskName:r});Mr(t)}catch(t){console.error("RPC Error (dry_run):",t),Mr({success:!1,error:H(t),tasks:[],warnings:[]})}finally{Dl(!1)}}function Wl(){Un(!1),Jn(""),Mr(null)}async function pa(){ko(!0),oi("");try{const r=await _.create_task({name:(Te()||"").trim(),schedule:(xi()||"").trim(),prompt:(Gt()||"").trim(),model:(gr()||"").trim(),priority:ft(),retryCount:vi(),retryDelay:hi(),qualityGate:($i()||"").trim(),beforeScript:(wi()||"").trim(),afterScript:(_i()||"").trim(),dependsOn:gt(),triggerType:se(),session:Ie(),...Ie()==="reuse"&&(wr()||"").trim()?{sessionMaxRuns:Number((wr()||"").trim())}:{},...se()==="once"?{runAt:(Nn()||"").trim()||void 0,delaySeconds:(Si()||"").trim()?Number(Si().trim()):void 0}:{},timezone:(Ti()||"").trim()||void 0,notBefore:(Ei()||"").trim()||void 0,notAfter:(Ai()||"").trim()||void 0,mcpEvent:se()==="mcp-event"?{server:(Bn()||"").trim(),event:(Fn()||"").trim(),...Tr().trim()?{filter:Tr().trim()}:{}}:void 0,watchPath:(jn()||"").trim(),workingDirectory:(Pi()||"").trim(),workspaceId:(Ot()||"").trim()||void 0,allowedTools:ee().length>0?ee():void 0,deniedTools:te().length>0?te():void 0,matrix:Fl()});if(!r.success){const t=Oe(r.message);oi(t),c.toast.show({title:"Ошибка создания задачи",variant:"error",description:t});return}await new Promise(t=>setTimeout(t,500)),await Ee(),mi(""),Ft("* * * * *"),Wt(""),cr("* * * * *"),ur(0),fr(60),mr(""),xr([]),yr(""),br(Ve),vr(""),hr(""),Xe("cron"),$r(""),ki(""),Ci(""),Ut("new"),zi(""),_r(""),kr(""),Sr(""),Cr(""),zr(""),Er(""),Ht(""),Ye(""),Jt([]),Qt([]),Ni(),bi(null),si("custom"),c.toast.show({title:"Задача создана",variant:"success"})}catch(r){console.error("RPC Error (create_task):",r);const t=Oe(H(r));oi(t),c.toast.show({title:"Ошибка создания задачи",variant:"error",description:t})}finally{ko(!1)}}function da(r){const t=new Date().toISOString(),n=Bt.get(r);n&&clearInterval(n);let a=0;const F=setInterval(()=>{if(a+=1,a>900){clearInterval(F),Bt.delete(r);return}(async()=>{try{const Ae=((await _.get_history({limit:50})).records??[]).find(yt=>String(yt.taskName??"").toLowerCase()===r.toLowerCase()&&typeof yt.startedAt=="string"&&yt.startedAt>=t);if(!Ae)return;clearInterval(F),Bt.delete(r);const be=Ae.status==="success",Vt=((Number(Ae.durationMs)||0)/1e3).toFixed(1),Dr=Ae.error?`: ${Ae.error}`:"";c.toast.show({title:be?`Задача "${r}" выполнена`:`Задача "${r}" упала`,variant:be?"success":"error",description:`${Vt}s${Dr}`}),await Ee()}catch(Q){console.error("RPC Error (get_history):",Q)}})()},2e3);Bt.set(r,F)}async function ca(r){if(!r||typeof r!="string"){console.error("[GUI] run_task aborted: empty task name");return}try{const t=await _.run_task({name:r});if(!t.success){c.toast.show({title:`Не удалось запустить "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:t.message||`Задача "${r}" запущена`,variant:"success"}),/уже выполняется/i.test(t.message||"")||da(r),await Ee()}catch(t){console.error("RPC Error (run_task):",t),c.toast.show({title:"Ошибка запуска",variant:"error",description:H(t)})}}async function ua(r){try{const t=await _.pause_task({name:r});if(!t.success){c.toast.show({title:`Не удалось поставить на паузу "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:`Задача "${r}" поставлена на паузу`,variant:"success"}),await Ee()}catch(t){console.error("RPC Error (pause_task):",t),c.toast.show({title:"Ошибка паузы",variant:"error",description:H(t)})}}async function fa(r){try{const t=await _.resume_task({name:r});if(!t.success){c.toast.show({title:`Не удалось возобновить "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:`Задача "${r}" возобновлена`,variant:"success"}),await Ee()}catch(t){console.error("RPC Error (resume_task):",t),c.toast.show({title:"Ошибка возобновления",variant:"error",description:H(t)})}}async function ga(r){if(window.confirm(`Отменить выполняющиеся клоны матрицы "${r}"?`))try{const t=await _.cancel_matrix({name:r});if(!t.success){c.toast.show({title:"Не удалось отменить матрицу",variant:"error",description:t.message});return}c.toast.show({title:t.message,variant:"success"}),await Ee()}catch(t){console.error("RPC Error (cancel_matrix):",t),c.toast.show({title:"Ошибка отмены матрицы",variant:"error",description:H(t)})}}async function ya(r){const n=ct().find(a=>a.name===r)?.matrix?`Удалить матрицу "${r}" вместе со всеми клонами и агрегатором?`:`Удалить задачу "${r}"?`;if(window.confirm(n))try{const a=await _.delete_task({name:r});if(!a.success){c.toast.show({title:"Ошибка удаления",variant:"error",description:a.message});return}c.toast.show({title:`Задача "${r}" удалена`,variant:"success"}),kn()===r&&(jt(""),Sn(null)),qn()?.name===r&&bi(null),await Ee()}catch(a){console.error("RPC Error (delete_task):",a),c.toast.show({title:"Ошибка удаления",variant:"error",description:H(a)})}}async function ba(r){Sn(r),jt("Загрузка логов…");try{const t=await _.get_task_logs({name:r});if(!t.success){jt(t.error||"Не удалось загрузить логи"),c.toast.show({title:"Ошибка чтения логов",variant:"error",description:t.error});return}jt(t.logs||"(пусто)")}catch(t){console.error("RPC Error (get_task_logs):",t),jt("Ошибка чтения логов: "+H(t))}}function ma(r){bi(r),Dn(!1),mi(r.name),Ft(r.schedule),Wt(r.prompt??""),yr(r.model??""),br(typeof r.priority=="number"?r.priority:Ve),ur(r.retryCount??0),fr(r.retryDelay??60),mr(r.qualityGate??""),xr(Array.isArray(r.dependsOn)?r.dependsOn:[]),vr(r.beforeScript??""),hr(r.afterScript??""),Xe(r.triggerType??"cron"),$r(r.watchPath??""),ki(r.runAt??""),Ci(""),Ut(r.session==="reuse"||r.session==="last"?r.session:"new"),zi(typeof r.sessionMaxRuns=="number"?String(r.sessionMaxRuns):""),_r(r.timezone??""),kr(r.notBefore??""),Sr(r.notAfter??""),Cr(r.mcpEvent?.server??""),zr(r.mcpEvent?.event??""),Er(r.mcpEvent?.filter??""),Ht(r.workingDirectory??""),Ye(r.workspaceId??""),Jt(Array.isArray(r.allowedTools)?r.allowedTools:[]),Qt(Array.isArray(r.deniedTools)?r.deniedTools:[]),r.matrix?(Mi(!0),Ar(Array.isArray(r.matrix.workspaceIds)?r.matrix.workspaceIds:[]),Li(r.matrix.strategy==="sequential"?"sequential":"parallel"),Ri(r.matrix.failureMode==="stop"?"stop":"continue"),Oi(r.matrix.aggregation==="per-task"?"per-task":"summary"),Ii(!!r.matrix.createAggregator),Di(typeof r.matrix.concurrency=="number"?String(r.matrix.concurrency):""),ji(r.matrix.overrides?{...r.matrix.overrides}:{})):Ni();const t=bo.find(n=>n.value===r.schedule);cr(t?t.value:"__custom__")}Ee(),Or(),Gi(),Ls(),Ms(),Kn();const xa=setInterval(Ee,5e3);s.onCleanup(()=>clearInterval(xa));const va=Ml()==="__custom__",Yn=qn()!==null,ha=()=>{const r=(Ti()||"").trim();if(!r)return!0;try{return new Intl.DateTimeFormat("en-US",{timeZone:r}),!0}catch{return!1}},Zn=(r,t,n)=>Number.isInteger(r)&&r>=t&&(n===void 0||r<=n),Ul=()=>{const r=(Te()||"").trim();if(!r)return"Укажите имя задачи.";if(!(Gt()||"").trim())return"Укажите промпт.";if(se()==="cron"&&!(xi()||"").trim())return"Укажите cron-расписание.";if(se()==="once"&&!(Nn()||"").trim()&&!(Si()||"").trim())return"Укажите время запуска или задержку.";if(qe()&&De().length===0)return"Выберите хотя бы один workspace для матрицы.";if(Ie()==="reuse"&&(wr()||"").trim()&&!/^[1-9]\d*$/.test(wr().trim()))return"Лимит запусков сессии — целое положительное число.";if(qe()&&(qi()||"").trim()&&!/^[1-9]\d*$/.test(qi().trim()))return"Concurrency матрицы — целое положительное число.";if((Ei()||"").trim()===""!=((Ai()||"").trim()===""))return"Окно запуска задаётся только парой «с/по».";if(!ha())return"Неизвестная таймзона. Укажите IANA-пояс, например Europe/Moscow.";if(!Zn(ft(),0,10))return"Приоритет — целое число от 0 до 10.";if(!Zn(vi(),0))return"Количество повторов — целое число ≥ 0.";if(!Zn(hi(),0))return"Задержка повтора — целое число секунд ≥ 0.";const t=r.toLowerCase();return gt().some(n=>n.trim().toLowerCase()===t)?"Задача не может зависеть от самой себя.":""},Wi=()=>Ul()==="",qr=()=>ct()??[],Xn=()=>{const r=Lt();return r==="all"?qr():r==="none"?qr().filter(t=>!t.workspaceId):qr().filter(t=>t.workspaceId===r)},Hl=()=>{const r=(qn()?.name??Te()).trim().toLowerCase();return qr().map(t=>t.name).filter(t=>t.trim().toLowerCase()!==r)};function $a(r,t){xr(n=>t?n.some(a=>a.toLowerCase()===r.toLowerCase())?n:[...n,r]:n.filter(a=>a.toLowerCase()!==r.toLowerCase()))}const[wa,Jl]=s.createSignal(null);function et(r=!1){return`background:${r?"rgba(90,200,250,0.16)":"transparent"};border:1px solid ${r?"rgba(90,200,250,0.5)":"#333"};border-radius:6px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:${r?"#5ac8fa":"#cfcfd2"};font-size:14px;line-height:1;padding:0;transition:background 0.18s ease, border-color 0.18s ease, color 0.18s ease`}function oe(r,t,n=!1){const a=r.currentTarget;a&&(a.style.background=t?"rgba(255,255,255,0.09)":n?"rgba(90,200,250,0.16)":"transparent",a.style.borderColor=t?"#5ac8fa":n?"rgba(90,200,250,0.5)":"#333",a.style.color=t||n?"#5ac8fa":"#cfcfd2")}const _a=r=>{const t=r.job;return!t||!t.name?null:(()=>{var n=Up(),a=n.firstChild,F=a.firstChild,Q=F.firstChild,Y=Q.firstChild,Ae=Y.firstChild,be=Y.nextSibling,Vt=be.firstChild,Dr=Vt.nextSibling,yt=Dr.nextSibling,tt=yt.nextSibling,eo=tt.nextSibling,Ui=eo.nextSibling;Ui.nextSibling;var je=Q.nextSibling,Hi=F.nextSibling,me=Hi.firstChild,$e=me.nextSibling,Ne=$e.nextSibling,Pe=Ne.nextSibling,xe=Pe.nextSibling,rt=xe.nextSibling;return e.insert(Ae,()=>t.name),e.insert(Y,(()=>{var d=e.memo(()=>!!t.workspaceName);return()=>d()&&(()=>{var p=Hp();return p.firstChild,e.insert(p,()=>t.workspaceName,null),e.effect(b=>{var R=`Workspace: ${t.workspaceName}${t.workingDirectory?` (${t.workingDirectory})`:""}`,O=`font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid ${t.workspaceColor||"#5ac8fa"};color:${t.workspaceColor||"#5ac8fa"};background:${t.workspaceColor||"#5ac8fa"}1a`;return R!==b.e&&e.setAttribute(p,"title",b.e=R),b.t=e.style(p,O,b.t),b},{e:void 0,t:void 0}),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.isMatrixParent&&t.matrix));return()=>d()&&(()=>{var p=Jp(),b=p.firstChild,R=b.nextSibling;return R.nextSibling,e.insert(p,()=>t.matrix.workspaceIds.length,R),e.insert(p,(()=>{var O=e.memo(()=>!!t.matrix.concurrency);return()=>O()?` ⚙${t.matrix.concurrency}`:""})(),null),e.effect(()=>e.setAttribute(p,"title",`Matrix fan-out: ${t.matrix.workspaceIds.length} клонов, стратегия: ${t.matrix.strategy??"parallel"}, при ошибке: ${t.matrix.failureMode??"continue"}${t.matrix.concurrency?`, одновременно: ${t.matrix.concurrency}`:""}${t.matrix.overrides?`, переопределено workspace: ${Object.keys(t.matrix.overrides).length}`:""}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!t.matrixParentId);return()=>d()&&(()=>{var p=Qp();return p.firstChild,e.insert(p,()=>t.matrixParentId,null),e.effect(()=>e.setAttribute(p,"title",`Клон матрицы. Родитель: ${t.matrixParentId}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!t.watchPath);return()=>d()&&(()=>{var p=Vp();return e.effect(()=>e.setAttribute(p,"title",`Отслеживание файла: ${t.watchPath}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!t.timezone);return()=>d()&&(()=>{var p=Kp();return p.firstChild,e.insert(p,()=>t.timezone,null),e.effect(()=>e.setAttribute(p,"title",`Часовой пояс задачи: ${t.timezone}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.notBefore&&t.notAfter));return()=>d()&&(()=>{var p=Yp(),b=p.firstChild,R=b.nextSibling;return R.nextSibling,e.insert(p,()=>t.notBefore,R),e.insert(p,()=>t.notAfter,null),e.effect(()=>e.setAttribute(p,"title",`Окно запуска: ${t.notBefore}–${t.notAfter}. Вне окна запуск переносится на его открытие.`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!t.pausedUntil);return()=>d()&&(()=>{var p=Zp();return p.firstChild,e.insert(p,()=>new Date(t.pausedUntil).toLocaleDateString(),null),e.effect(()=>e.setAttribute(p,"title",`Пауза до ${new Date(t.pausedUntil).toLocaleString()} — задача включится автоматически.`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.beforeScript||t.afterScript));return()=>d()&&(()=>{var p=Xp();return e.effect(()=>e.setAttribute(p,"title",`Lifecycle hooks: ${[t.beforeScript?`pre: ${t.beforeScript}`:"",t.afterScript?`post: ${t.afterScript}`:""].filter(Boolean).join(" · ")}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>t.triggerType==="mcp-event");return()=>d()&&(()=>{var p=ed();return e.effect(()=>e.setAttribute(p,"title",`MCP-событие: ${t.mcpEvent?.event??"—"}${t.mcpEvent?.filter?` (фильтр: ${t.mcpEvent.filter})`:""}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.session&&t.session!=="new"));return()=>d()&&(()=>{var p=td();return e.insert(p,()=>t.session==="reuse"?"⟳ сессия":"↪ продолжение"),e.effect(()=>e.setAttribute(p,"title",t.session==="reuse"?`Переиспользуемая сессия OpenCode${t.sessionId?`: ${t.sessionId}`:""}`:"Продолжение последней сессии OpenCode (--continue)")),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!t.model);return()=>d()&&(()=>{var p=rd();return p.firstChild,e.insert(p,()=>t.model,null),e.effect(()=>e.setAttribute(p,"title",`Модель LLM: ${t.model}`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>typeof t.priority=="number"&&t.priority!==Ve);return()=>d()&&(()=>{var p=id();return p.firstChild,e.insert(p,()=>is(t.priority),null),e.effect(()=>e.setAttribute(p,"title",`Приоритет: ${is(t.priority)} (${t.priority})`)),p})()})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(Array.isArray(t.allowedTools)&&t.allowedTools.length>0||Array.isArray(t.deniedTools)&&t.deniedTools.length>0));return()=>d()?(()=>{var p=nd();return e.effect(()=>e.setAttribute(p,"title",`Ограничения инструментов: ${[t.allowedTools?.length?`allowed=[${t.allowedTools.join(", ")}]`:"",t.deniedTools?.length?`denied=[${t.deniedTools.join(", ")}]`:""].filter(Boolean).join(" · ")}`)),p})():null})(),null),e.insert(Q,(()=>{var d=e.memo(()=>!!(Array.isArray(t.dependsOn)&&t.dependsOn.length>0));return()=>d()&&(()=>{var p=od(),b=p.firstChild;return b.firstChild,e.insert(b,()=>t.dependsOn.join(" + "),null),p})()})(),be),e.insert(Q,(()=>{var d=e.memo(()=>!!(t.isMatrixParent&&t.matrixSummary));return()=>d()&&(()=>{var p=ld(),b=p.firstChild,R=b.firstChild,O=R.nextSibling,J=O.nextSibling,S=J.nextSibling;return S.nextSibling,e.insert(b,()=>t.matrixSummary.successCount,O),e.insert(b,()=>t.matrixSummary.totalCount,S),e.insert(b,(()=>{var m=e.memo(()=>t.matrixSummary.errorCount>0);return()=>m()?` · ❌ ${t.matrixSummary.errorCount}`:""})(),null),e.insert(b,(()=>{var m=e.memo(()=>t.matrixSummary.pendingCount>0);return()=>m()?` · ⏳ ${t.matrixSummary.pendingCount}`:""})(),null),e.effect(m=>{var L=t.matrixSummary.message,K=`cursor:help;color:${Gc(t.matrixSummary.status)};white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;return L!==m.e&&e.setAttribute(b,"title",m.e=L),m.t=e.style(b,K,m.t),m},{e:void 0,t:void 0}),p})()})(),be),e.insert(be,()=>t.runsTotal??0,Dr),e.insert(be,()=>t.runsSuccess??0,tt),e.insert(be,()=>t.runsPartial??0,Ui),e.insert(be,()=>t.runsError??0,null),e.insert(Q,(()=>{var d=e.memo(()=>!!(t.schedule||t.nextRun));return()=>d()&&(()=>{var p=sd(),b=p.firstChild;return e.insert(b,()=>t.schedule),e.insert(p,(()=>{var R=e.memo(()=>!!t.nextRun);return()=>R()&&(()=>{var O=ad();return O.firstChild,e.insert(O,()=>t.nextRun,null),O})()})(),null),p})()})(),null),e.insert(je,(()=>{var d=e.memo(()=>t.status==="running");return()=>d()?(()=>{var p=pd(),b=p.firstChild,R=b.nextSibling;return R.nextSibling,e.insert(p,$s,R),p})():(()=>{var p=dd();return e.insert(p,(()=>{var b=e.memo(()=>!!t.orphaned);return()=>b()?"🧟 Нет в планировщике":e.memo(()=>!!t.paused)()?"⏸ Пауза":e.memo(()=>t.status==="success")()?"🟢 Готова":e.memo(()=>t.status==="error")()?"🔴 Ошибка":e.memo(()=>t.status==="partial")()?"🟠 Частично":t.status==="idle"?"⚪ Не запускалась":"⚪ Неизвестно"})()),p})()})()),me.addEventListener("mouseleave",d=>{oe(d,!1),Jl(p=>p===t.name?null:p)}),me.addEventListener("mouseenter",d=>{oe(d,!0),Ce()&&Jl(t.name)}),me.$$click=()=>{ca(t.name)},e.insert(me,()=>Ce()&&wa()===t.name?"❄️":"▶"),$e.addEventListener("mouseleave",d=>oe(d,!1)),$e.addEventListener("mouseenter",d=>oe(d,!0)),$e.$$click=()=>{t.orphaned||(t.paused?fa(t.name):ua(t.name))},e.insert($e,()=>t.paused?"▶":"⏸"),Ne.addEventListener("mouseleave",d=>oe(d,!1)),Ne.addEventListener("mouseenter",d=>oe(d,!0)),Ne.$$click=()=>{ba(t.name)},Pe.addEventListener("mouseleave",d=>oe(d,!1,Pr()&&Lr()===t.name)),Pe.addEventListener("mouseenter",d=>oe(d,!0,Pr()&&Lr()===t.name)),Pe.$$click=()=>{aa(t.name)},xe.addEventListener("mouseleave",d=>oe(d,!1,li()===t.name)),xe.addEventListener("mouseenter",d=>oe(d,!0,li()===t.name)),xe.$$click=()=>{sa(t.name)},rt.addEventListener("mouseleave",d=>oe(d,!1)),rt.addEventListener("mouseenter",d=>oe(d,!0)),rt.$$click=()=>{ma(t)},e.insert(Hi,(()=>{var d=e.memo(()=>!!t.matrix);return()=>d()&&(()=>{var p=cd();return p.addEventListener("mouseleave",b=>oe(b,!1)),p.addEventListener("mouseenter",b=>oe(b,!0)),p.$$click=()=>{ga(t.name)},e.effect(b=>{var R=`Отменить выполняющиеся клоны матрицы "${t.name}"`,O=et();return R!==b.e&&e.setAttribute(p,"title",b.e=R),b.t=e.style(p,O,b.t),b},{e:void 0,t:void 0}),p})()})(),null),e.insert(Hi,(()=>{var d=e.memo(()=>!t.matrixParentId);return()=>d()&&(()=>{var p=ud();return p.addEventListener("mouseleave",b=>oe(b,!1)),p.addEventListener("mouseenter",b=>oe(b,!0)),p.$$click=()=>{ya(t.name)},e.effect(b=>{var R=t.matrix?`Удалить матрицу "${t.name}" вместе с клонами`:`Удалить "${t.name}"`,O=et();return R!==b.e&&e.setAttribute(p,"title",b.e=R),b.t=e.style(p,O,b.t),b},{e:void 0,t:void 0}),p})()})(),null),e.insert(n,(()=>{var d=e.memo(()=>li()===t.name);return()=>d()&&(()=>{var p=fd(),b=p.firstChild,R=b.firstChild,O=R.nextSibling;return O.addEventListener("mouseleave",J=>{J.target.style.color="#8e8e93"}),O.addEventListener("mouseenter",J=>{J.target.style.color="#ffffff"}),O.$$click=()=>Co(null),e.insert(p,(()=>{var J=e.memo(()=>zo().length===0);return()=>J()?gd():zo().map(S=>(()=>{var m=yd(),L=m.firstChild,K=L.nextSibling,Be=K.nextSibling,Fe=Be.firstChild;return e.insert(L,()=>new Date(S.startedAt).toLocaleString()),e.insert(K,()=>S.status==="success"?"✅ Успех":"❌ Ошибка"),e.insert(Be,()=>S.durationMs,Fe),e.insert(m,(()=>{var G=e.memo(()=>!!S.model);return()=>G()&&(()=>{var C=bd();return C.firstChild,e.insert(C,()=>S.model,null),e.effect(()=>e.setAttribute(C,"title",`Модель: ${S.model}`)),C})()})(),null),e.insert(m,(()=>{var G=e.memo(()=>!!(S.preFlightStatus&&S.preFlightStatus!=="skipped"));return()=>G()&&(()=>{var C=md();return C.firstChild,e.insert(C,()=>S.preFlightStatus==="success"?"✅":"❌",null),e.effect(N=>{var D=`Pre-flight: ${S.preFlightStatus}`,$=S.preFlightStatus==="success"?"#34c759":"#ff3b30";return D!==N.e&&e.setAttribute(C,"title",N.e=D),$!==N.t&&e.setStyleProperty(C,"color",N.t=$),N},{e:void 0,t:void 0}),C})()})(),null),e.insert(m,(()=>{var G=e.memo(()=>!!(S.postFlightStatus&&S.postFlightStatus!=="skipped"));return()=>G()&&(()=>{var C=xd();return C.firstChild,e.insert(C,()=>S.postFlightStatus==="success"?"✅":"❌",null),e.effect(N=>{var D=`Post-flight: ${S.postFlightStatus}`,$=S.postFlightStatus==="success"?"#34c759":"#ff3b30";return D!==N.e&&e.setAttribute(C,"title",N.e=D),$!==N.t&&e.setStyleProperty(C,"color",N.t=$),N},{e:void 0,t:void 0}),C})()})(),null),e.insert(m,(()=>{var G=e.memo(()=>!!S.error);return()=>G()&&(()=>{var C=vd();return e.insert(C,()=>S.error),C})()})(),null),e.insert(m,(()=>{var G=e.memo(()=>!!S.nextTask);return()=>G()&&(()=>{var C=hd();return C.firstChild,e.insert(C,()=>S.nextTask,null),C})()})(),null),e.effect(G=>{var C=S.startedAt+S.durationMs,N=S.status==="success"?"#34c759":"#ff3b30";return C!==G.e&&e.setAttribute(m,"key",G.e=C),N!==G.t&&e.setStyleProperty(K,"color",G.t=N),G},{e:void 0,t:void 0}),m})())})(),null),p})()})(),null),e.insert(n,(()=>{var d=e.memo(()=>!!(Pr()&&Lr()===t.name));return()=>d()&&(()=>{var p=$d(),b=p.firstChild,R=b.firstChild,O=R.nextSibling;return e.insert(b,()=>t.name,O),O.addEventListener("mouseleave",J=>{J.target.style.color="#8e8e93"}),O.addEventListener("mouseenter",J=>{J.target.style.color="#ffffff"}),O.$$click=()=>Wl(),e.insert(p,(()=>{var J=e.memo(()=>!!Hn());return()=>J()&&wd()})(),null),e.insert(p,(()=>{var J=e.memo(()=>!!(!Hn()&&re()&&!re().success));return()=>J()&&(()=>{var S=_d();return S.firstChild,e.insert(S,()=>re().error??"Симуляция не удалась",null),S})()})(),null),e.insert(p,(()=>{var J=e.memo(()=>!!(!Hn()&&re()&&re().success));return()=>J()&&(()=>{var S=kd();return e.insert(S,(()=>{var m=e.memo(()=>!!(Array.isArray(re().warnings)&&re().warnings.length>0));return()=>m()&&(()=>{var L=Sd();return L.firstChild,e.insert(L,()=>re().warnings.map(K=>`· ${K}`).join(" | "),null),L})()})(),null),e.insert(S,()=>re().tasks.map(m=>(()=>{var L=Cd(),K=L.firstChild,Be=K.firstChild,Fe=Be.nextSibling;Fe.nextSibling;var G=K.nextSibling;G.firstChild;var C=G.nextSibling;C.firstChild;var N=C.nextSibling;return N.firstChild,e.insert(K,()=>(m.order??0)+1,Fe),e.insert(K,()=>m.trigger,null),e.insert(G,()=>m.name,null),e.insert(L,(()=>{var D=e.memo(()=>!!m.workspace);return()=>D()&&(()=>{var $=zd();return $.firstChild,e.insert($,()=>m.workspace.name,null),$})()})(),C),e.insert(L,(()=>{var D=e.memo(()=>!!m.matrixParent);return()=>D()&&(()=>{var $=Td();return $.firstChild,e.insert($,()=>m.matrixParent,null),$})()})(),C),e.insert(C,()=>m.cwd||"(папка проекта)",null),e.insert(L,(()=>{var D=e.memo(()=>!!m.roleScoped);return()=>D()&&(()=>{var $=Ed();return e.effect(()=>e.setAttribute($,"title",`allowed=[${(m.roleScoped.allowed??[]).join(", ")}] · denied=[${(m.roleScoped.denied??[]).join(", ")}]`)),$})()})(),N),e.insert(L,(()=>{var D=e.memo(()=>m.estimatedDurationSec!=null);return()=>D()&&(()=>{var $=Ad(),bt=$.firstChild,mt=bt.nextSibling;return mt.nextSibling,e.insert($,()=>m.estimatedDurationSec,mt),$})()})(),N),e.insert(L,(()=>{var D=e.memo(()=>m.estimatedTokens!=null);return()=>D()&&(()=>{var $=Pd(),bt=$.firstChild,mt=bt.nextSibling;return mt.nextSibling,e.insert($,()=>m.estimatedTokens,mt),$})()})(),N),e.insert(L,(()=>{var D=e.memo(()=>m.estimatedCostUsd!=null);return()=>D()&&(()=>{var $=Md();return $.firstChild,e.insert($,()=>Number(m.estimatedCostUsd).toFixed(4),null),$})()})(),N),e.insert(N,()=>m.command,null),e.insert(L,(()=>{var D=e.memo(()=>!!m.preFlight);return()=>D()&&(()=>{var $=Ld();return $.firstChild,e.insert($,()=>m.preFlight,null),$})()})(),null),e.insert(L,(()=>{var D=e.memo(()=>!!m.postFlight);return()=>D()&&(()=>{var $=Rd();return $.firstChild,e.insert($,()=>m.postFlight,null),$})()})(),null),e.insert(L,(()=>{var D=e.memo(()=>!!m.qualityGate);return()=>D()&&(()=>{var $=Od();return $.firstChild,e.insert($,()=>m.qualityGate,null),$})()})(),null),e.effect(()=>e.setAttribute(L,"key",`${m.name}-${m.order}`)),L})()),null),e.insert(S,(()=>{var m=e.memo(()=>!!(re().totals&&(re().totals.estimatedDurationSec!=null||re().totals.estimatedTokens!=null)));return()=>m()&&(()=>{var L=Id();return L.firstChild,e.insert(L,()=>(re().totals.estimatedDurationSec??"—")+" с · "+(re().totals.estimatedTokens??"—")+" токенов"+(re().totals.estimatedCostUsd!=null?` · ~$${Number(re().totals.estimatedCostUsd).toFixed(4)}`:""),null),L})()})(),null),S})()})(),null),p})()})(),null),e.effect(d=>{var p=`background:#252526;border-radius:10px;padding:16px;margin-bottom:12px;display:flex;flex-direction:column;gap:10px;border:1px solid ${Ce()?"rgba(135, 206, 250, 0.4)":"#333"}`,b=`Запустить "${t.name}"`,R=et(),O=!!t.orphaned,J=t.orphaned?`Задача "${t.name}" отсутствует в планировщике ОС — пауза недоступна`:t.paused?`Возобновить "${t.name}"`:`Поставить на паузу "${t.name}"`,S=et(),m=`Логи "${t.name}"`,L=et(),K=`Dry-Run симуляция "${t.name}"`,Be=et(Pr()&&Lr()===t.name),Fe=`История "${t.name}"`,G=et(li()===t.name),C=`Редактировать "${t.name}"`,N=et();return d.e=e.style(n,p,d.e),b!==d.t&&e.setAttribute(me,"title",d.t=b),d.a=e.style(me,R,d.a),O!==d.o&&($e.disabled=d.o=O),J!==d.i&&e.setAttribute($e,"title",d.i=J),d.n=e.style($e,S,d.n),m!==d.s&&e.setAttribute(Ne,"title",d.s=m),d.h=e.style(Ne,L,d.h),K!==d.r&&e.setAttribute(Pe,"title",d.r=K),d.d=e.style(Pe,Be,d.d),Fe!==d.l&&e.setAttribute(xe,"title",d.l=Fe),d.u=e.style(xe,G,d.u),C!==d.c&&e.setAttribute(rt,"title",d.c=C),d.w=e.style(rt,N,d.w),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0}),n})()};try{return c.add(fo.Panel,{id:"scheduler-jobs",region:"side",list:()=>[{id:"jobs",title:"Планировщик",pinned:!0}],render:()=>e.createComponent(s.ErrorBoundary,{fallback:r=>(()=>{var t=ts(),n=t.firstChild;return e.insert(t,()=>r.message,null),t})(),get children(){var r=qd(),t=r.firstChild,n=t.firstChild,a=n.firstChild,F=a.nextSibling,Q=F.nextSibling,Y=Q.firstChild,Ae=Y.nextSibling,be=Ae.nextSibling,Vt=be.nextSibling,Dr=Vt.nextSibling,yt=n.nextSibling,tt=yt.firstChild,eo=tt.firstChild,Ui=eo.nextSibling,je=tt.nextSibling,Hi=je.firstChild,me=je.nextSibling,$e=me.nextSibling,Ne=$e.firstChild,Pe=t.nextSibling,xe=Pe.firstChild,rt=xe.nextSibling,d=rt.nextSibling,p=Pe.nextSibling,b=p.firstChild,R=b.nextSibling,O=p.nextSibling,J=O.firstChild,S=J.firstChild,m=S.nextSibling,L=m.firstChild,K=O.nextSibling,Be=K.firstChild,Fe=Be.firstChild,G=Fe.nextSibling,C=G.firstChild,N=C.nextSibling,D=K.nextSibling,$=D.firstChild,bt=$.firstChild,mt=bt.firstChild,Ql=mt.nextSibling,ka=Ql.nextSibling,to=bt.nextSibling,Ji=D.nextSibling,Qc=Ji.firstChild;return e.insert(a,(()=>{var f=e.memo(()=>!!Ce());return()=>f()?`❄️ ${In()} ❄️`:In()})()),e.insert(Q,()=>Cn().total,Ae),e.insert(Q,()=>Cn().success,Vt),e.insert(Q,()=>Cn().error,null),tt.addEventListener("change",f=>ho(f.currentTarget.value)),e.insert(tt,()=>fe().map(f=>(()=>{var g=rs(),k=g.firstChild;return e.insert(g,()=>f.name,null),e.effect(()=>e.setAttribute(g,"key",f.id)),e.effect(()=>g.value=f.id),g})()),Ui),je.$$click=()=>gs(f=>!f),e.insert(je,$o,null),e.insert(je,()=>It()?" 🔒":"",null),me.addEventListener("mouseleave",f=>{const g=f.currentTarget;g.style.borderColor="#333",g.style.background="#1e1e1e",g.style.color="#e0e0e0"}),me.addEventListener("mouseenter",f=>{const g=f.currentTarget;g.style.borderColor="#5ac8fa",g.style.background="rgba(90,200,250,0.12)",g.style.color="#5ac8fa"}),me.$$click=async()=>{const f=window.open("","_blank");let g=3782;try{const v=await _.get_dashboard_port({});v&&typeof v.port=="number"&&v.port>0&&(g=v.port)}catch(v){console.warn("[scheduler] Не удалось получить порт дашборда:",v)}const k="http://localhost:"+g;f?f.location.href=k:window.open(k,"_blank")},Ne.addEventListener("change",f=>{js(f.currentTarget.checked)}),e.insert(r,(()=>{var f=e.memo(()=>!!ii());return()=>f()&&(()=>{var g=Dd(),k=g.firstChild,v=k.firstChild,W=v.nextSibling,q=k.nextSibling;return W.$$click=()=>{Vs()},e.insert(g,(()=>{var w=e.memo(()=>!!It());return()=>w()&&jd()})(),q),e.insert(q,()=>cs().map(w=>(()=>{var A=Nd(),z=A.firstChild,T=z.nextSibling,Z=T.nextSibling;return e.insert(z,()=>w.name,null),e.insert(z,()=>w.isDefault?" (по умолчанию)":"",null),e.insert(T,(()=>{var U=e.memo(()=>!!w.port);return()=>U()?`порт ${w.port}`:"порт по умолчанию"})()),e.insert(Z,()=>w.dir),e.insert(A,(()=>{var U=e.memo(()=>!!w.active);return()=>U()?Bd():(()=>{var I=Fd();return I.$$click=()=>{Qs(w.name)},e.effect(j=>{var ie=qt()||It(),ve=`padding:2px 8px;border-radius:6px;border:1px solid #333;background:#262626;color:#e0e0e0;font-size:11px;cursor:${qt()||It()?"not-allowed":"pointer"};opacity:${It()?.5:1}`;return ie!==j.e&&(I.disabled=j.e=ie),j.t=e.style(I,ve,j.t),j},{e:void 0,t:void 0}),I})()})(),null),e.insert(A,(()=>{var U=e.memo(()=>!w.isDefault&&!w.active);return()=>U()&&(()=>{var I=Gd();return I.$$click=()=>{Ks(w.name)},e.effect(j=>{var ie=qt(),ve=`padding:2px 8px;border-radius:6px;border:1px solid rgba(255,59,48,0.4);background:rgba(255,59,48,0.12);color:#ff3b30;font-size:11px;cursor:${qt()?"not-allowed":"pointer"}`;return ie!==j.e&&(I.disabled=j.e=ie),j.t=e.style(I,ve,j.t),j},{e:void 0,t:void 0}),I})()})(),null),e.effect(U=>{var I=`font-weight:${w.active?700:400};color:${w.active?"#bf5af2":"#e0e0e0"}`,j=w.dir;return U.e=e.style(z,I,U.e),j!==U.t&&e.setAttribute(Z,"title",U.t=j),U},{e:void 0,t:void 0}),A})())),e.effect(w=>{var A=qt(),z=`padding:4px 10px;border-radius:6px;border:1px solid #333;background:#262626;color:#e0e0e0;font-size:11px;cursor:${qt()?"not-allowed":"pointer"}`;return A!==w.e&&(W.disabled=w.e=A),w.t=e.style(W,z,w.t),w},{e:void 0,t:void 0}),g})()})(),Pe),xe.$$click=Hs,e.insert(xe,()=>Bi()?"Экспорт...":"Экспорт"),rt.addEventListener("change",Js),d.$$click=()=>document.querySelector('input[type="file"]')?.click(),e.insert(d,()=>Fi()?"Импорт...":"Импорт"),R.addEventListener("change",f=>Ds(Number(f.currentTarget.value)||1)),J.$$click=()=>ks(!An()),e.insert(m,(()=>{var f=e.memo(()=>!!x());return()=>f()?En()?"только ошибки":"все запуски":"выключены"})(),L),e.insert(L,()=>An()?"▾":"▴"),e.insert(O,(()=>{var f=e.memo(()=>!An());return()=>f()&&(()=>{var g=Wd(),k=g.firstChild,v=k.firstChild,W=k.nextSibling,q=W.firstChild,w=W.nextSibling,A=w.firstChild,z=A.firstChild,T=A.nextSibling,Z=T.nextSibling,U=Z.nextSibling,I=U.firstChild,j=I.nextSibling,ie=j.nextSibling,ve=ie.nextSibling,jr=ve.nextSibling,we=jr.nextSibling,Ge=w.nextSibling,We=Ge.firstChild,V=We.firstChild,_e=We.nextSibling,he=_e.nextSibling,xt=he.nextSibling,vt=xt.firstChild,de=vt.nextSibling,Qi=de.nextSibling,Nr=Qi.firstChild,Vi=Qi.nextSibling,Kt=Vi.firstChild,Br=Ge.nextSibling,Yt=Br.firstChild,Fr=Yt.firstChild,Gr=Yt.nextSibling,Ue=Gr.firstChild,Ki=Br.nextSibling,it=Ki.firstChild,nt=it.firstChild,Yi=it.nextSibling,Zi=Yi.firstChild,ht=Zi.nextSibling,ro=ht.nextSibling,Zt=ro.nextSibling,Xt=Ki.nextSibling,io=Xt.firstChild,He=io.nextSibling,ot=He.nextSibling,Xi=Xt.nextSibling,en=Xi.firstChild,Me=en.nextSibling,$t=Me.nextSibling,wt=Xi.nextSibling,tn=wt.firstChild,Wr=tn.nextSibling,er=Wr.firstChild,Ur=Wr.nextSibling,rn=Ur.firstChild,lt=rn.firstChild,Hr=rn.nextSibling,Jr=Hr.firstChild,nn=Hr.nextSibling,_t=nn.nextSibling,on=wt.nextSibling,ln=on.firstChild,tr=ln.nextSibling,Qr=tr.firstChild,Vr=tr.nextSibling,kt=Vr.firstChild,St=kt.nextSibling,sn=St.nextSibling,an=on.nextSibling,Ct=an.firstChild,zt=Ct.nextSibling;return v.addEventListener("change",i=>{Eo(i.currentTarget.checked),M()}),q.addEventListener("change",i=>{Ao(i.currentTarget.checked),M()}),z.addEventListener("change",i=>{Po(i.currentTarget.checked),M()}),T.addEventListener("change",()=>{M()}),T.$$input=i=>Lo(i.currentTarget.value),j.addEventListener("change",()=>{M()}),j.$$input=i=>Io(Number(i.currentTarget.value)||1e4),ve.addEventListener("change",()=>{M()}),ve.$$input=i=>Do(Number(i.currentTarget.value)||0),we.addEventListener("change",()=>{M()}),we.$$input=i=>No(Number(i.currentTarget.value)||1e3),V.addEventListener("change",i=>{sl(i.currentTarget.checked),M()}),_e.addEventListener("change",()=>{M()}),_e.$$input=i=>pl(i.currentTarget.value),he.addEventListener("change",()=>{M()}),he.$$input=i=>cl(i.currentTarget.value),de.addEventListener("change",i=>{fl(i.currentTarget.value),M()}),Nr.addEventListener("change",i=>{yl(i.currentTarget.checked),M()}),Kt.addEventListener("change",i=>{ml(i.currentTarget.checked),M()}),Fr.addEventListener("change",i=>{xl(i.currentTarget.checked),M()}),Ue.addEventListener("change",i=>{hl(i.currentTarget.checked),M()}),nt.addEventListener("change",i=>{$l(i.currentTarget.checked),M()}),ht.addEventListener("change",()=>{M()}),ht.$$input=i=>_l(i.currentTarget.value),Zt.addEventListener("change",()=>{M()}),Zt.$$input=i=>Sl(i.currentTarget.value),He.addEventListener("change",()=>{M()}),He.$$input=i=>Ho(i.currentTarget.value),ot.addEventListener("change",()=>{M()}),ot.$$input=i=>Qo(i.currentTarget.value),Me.addEventListener("change",()=>{M()}),Me.$$input=i=>Fo(i.currentTarget.value),$t.addEventListener("change",()=>{M()}),$t.$$input=i=>Wo(i.currentTarget.value),er.addEventListener("change",i=>{Vo(i.currentTarget.checked),M()}),lt.addEventListener("change",i=>{Yo(i.currentTarget.checked),M()}),Jr.addEventListener("change",i=>{Xo(i.currentTarget.checked),M()}),_t.addEventListener("change",()=>{M()}),_t.$$input=i=>tl(Number(i.currentTarget.value)||0),Qr.addEventListener("change",i=>{rl(i.currentTarget.checked),M()}),kt.addEventListener("change",i=>{nl(i.currentTarget.value==="weekly"?"weekly":"daily"),M()}),St.addEventListener("change",()=>{M()}),St.$$input=i=>ll(i.currentTarget.value),e.insert(sn,(()=>{var i=e.memo(()=>!!Pn());return()=>i()?`последняя отправка: ${new Date(Pn()).toLocaleString()}`:"ещё не отправлялся"})()),Ct.$$click=()=>{Is()},e.insert(Ct,()=>pi()?"Отправка...":"🧪 Тестовое уведомление"),zt.$$click=()=>{qs()},e.insert(zt,()=>di()?"Отправка...":"📊 Отправить дайджест сейчас"),e.effect(i=>{var no=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,pn=!x(),dn=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,rr=!x(),oo=!x()||!ge(),cn=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${x()&&ge()?1:.5}`,un=!x()||!ge(),fn=!x()||!ge(),Kr=!x()||!ge(),lo=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,Yr=!x(),gn=!x()||!ne(),Zr=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${x()&&ne()?1:.5}`,Xr=!x()||!ne(),so=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${x()&&ne()?1:.5}`,yn=`display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${x()&&ne()?1:.5}`,ei=!x()||!ne(),st=!x()||!ne(),l=!x()||!ne(),o=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,y=!x(),u=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()&&ze()?1:.5}`,h=!x()||!ze(),E=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,P=!x(),ae=`display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${x()&&pr()?1:.5}`,ke=!x()||!pr(),at=!x()||!pr(),Le=!x(),Tt=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${x()?1:.5}`,le=!x(),B=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${x()?1:.5}`,ye=!x(),Je=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;opacity:${x()?1:.5}`,Et=!x(),At=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;opacity:${x()?1:.5}`,bn=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,ir=!x(),mn=`display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${x()&&Nt()?1:.5}`,X=!x()||!Nt(),pe=!x()||!Nt(),ce=!x()||!Nt(),pt=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${x()?1:.5}`,Qe=!x(),ue=`display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${x()&&ar()?1:.5}`,dt=!x()||!ar(),Re=!x()||!ar(),Pt=pi()||!(ge()||ne()||ze()),nr=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${pi()||!(ge()||ne()||ze())?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${pi()||!(ge()||ne()||ze())?.6:1}`,Mt=di()||!(ge()||ne()||ze()),ao=`padding:6px 12px;background:#2d7d46;color:white;border:none;border-radius:6px;cursor:${di()||!(ge()||ne()||ze())?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${di()||!(ge()||ne()||ze())?.6:1}`;return i.e=e.style(W,no,i.e),pn!==i.t&&(q.disabled=i.t=pn),i.a=e.style(A,dn,i.a),rr!==i.o&&(z.disabled=i.o=rr),oo!==i.i&&(T.disabled=i.i=oo),i.n=e.style(T,cn,i.n),un!==i.s&&(j.disabled=i.s=un),fn!==i.h&&(ve.disabled=i.h=fn),Kr!==i.r&&(we.disabled=i.r=Kr),i.d=e.style(We,lo,i.d),Yr!==i.l&&(V.disabled=i.l=Yr),gn!==i.u&&(_e.disabled=i.u=gn),i.c=e.style(_e,Zr,i.c),Xr!==i.w&&(he.disabled=i.w=Xr),i.m=e.style(he,so,i.m),i.f=e.style(xt,yn,i.f),ei!==i.y&&(de.disabled=i.y=ei),st!==i.g&&(Nr.disabled=i.g=st),l!==i.p&&(Kt.disabled=i.p=l),i.b=e.style(Yt,o,i.b),y!==i.T&&(Fr.disabled=i.T=y),i.A=e.style(Gr,u,i.A),h!==i.O&&(Ue.disabled=i.O=h),i.I=e.style(it,E,i.I),P!==i.S&&(nt.disabled=i.S=P),i.W=e.style(Yi,ae,i.W),ke!==i.C&&(ht.disabled=i.C=ke),at!==i.B&&(Zt.disabled=i.B=at),Le!==i.v&&(He.disabled=i.v=Le),i.k=e.style(He,Tt,i.k),le!==i.x&&(ot.disabled=i.x=le),i.j=e.style(ot,B,i.j),ye!==i.q&&(Me.disabled=i.q=ye),i.z=e.style(Me,Je,i.z),Et!==i.P&&($t.disabled=i.P=Et),i.H=e.style($t,At,i.H),i.F=e.style(Wr,bn,i.F),ir!==i.M&&(er.disabled=i.M=ir),i.D=e.style(Ur,mn,i.D),X!==i.R&&(lt.disabled=i.R=X),pe!==i.E&&(Jr.disabled=i.E=pe),ce!==i.L&&(_t.disabled=i.L=ce),i.N=e.style(tr,pt,i.N),Qe!==i.G&&(Qr.disabled=i.G=Qe),i.U=e.style(Vr,ue,i.U),dt!==i.K&&(kt.disabled=i.K=dt),Re!==i.V&&(St.disabled=i.V=Re),Pt!==i.Y&&(Ct.disabled=i.Y=Pt),i.J=e.style(Ct,nr,i.J),Mt!==i.Q&&(zt.disabled=i.Q=Mt),i.Z=e.style(zt,ao,i.Z),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0,S:void 0,W:void 0,C:void 0,B:void 0,v:void 0,k:void 0,x:void 0,j:void 0,q:void 0,z:void 0,P:void 0,H:void 0,F:void 0,M:void 0,D:void 0,R:void 0,E:void 0,L:void 0,N:void 0,G:void 0,U:void 0,K:void 0,V:void 0,Y:void 0,J:void 0,Q:void 0,Z:void 0}),e.effect(()=>v.checked=x()),e.effect(()=>q.checked=En()),e.effect(()=>z.checked=ge()),e.effect(()=>T.value=Mo()||""),e.effect(()=>j.value=Oo()),e.effect(()=>ve.value=qo()),e.effect(()=>we.value=jo()),e.effect(()=>V.checked=ne()),e.effect(()=>_e.value=al()||""),e.effect(()=>he.value=dl()||""),e.effect(()=>de.value=ul()),e.effect(()=>Nr.checked=gl()),e.effect(()=>Kt.checked=bl()),e.effect(()=>Fr.checked=ze()),e.effect(()=>Ue.checked=vl()),e.effect(()=>nt.checked=pr()),e.effect(()=>ht.value=wl()),e.effect(()=>Zt.value=kl()),e.effect(()=>He.value=Uo()||""),e.effect(()=>ot.value=Jo()||""),e.effect(()=>Me.value=Bo()||""),e.effect(()=>$t.value=Go()||""),e.effect(()=>er.checked=Nt()),e.effect(()=>lt.checked=Ko()),e.effect(()=>Jr.checked=Zo()),e.effect(()=>_t.value=el()),e.effect(()=>Qr.checked=ar()),e.effect(()=>kt.value=il()),e.effect(()=>St.value=ol()),g})()})(),null),Be.$$click=()=>As(!On()),e.insert(G,(()=>{var f=e.memo(()=>ci()>0);return()=>f()?`старше ${ci()} дн.`:"без срока"})(),C),e.insert(G,(()=>{var f=e.memo(()=>fi()>0);return()=>f()?`до ${fi()} записей`:"без лимита"})(),N),e.insert(N,()=>On()?"▾":"▴"),e.insert(K,(()=>{var f=e.memo(()=>!On());return()=>f()&&(()=>{var g=Ud(),k=g.firstChild,v=k.firstChild,W=v.nextSibling,q=k.nextSibling,w=q.firstChild,A=w.nextSibling,z=q.nextSibling,T=z.firstChild,Z=z.nextSibling,U=Z.firstChild;return W.addEventListener("change",I=>{ui(Math.max(0,Math.floor(Number(I.currentTarget.value)||0))),Pl()}),A.addEventListener("change",I=>{gi(Math.max(0,Math.floor(Number(I.currentTarget.value)||0))),Pl()}),e.insert(z,(()=>{var I=e.memo(()=>!!Mn());return()=>I()?`${new Date(Mn()).toLocaleString()} · удалено ${zl()}`:"ещё не выполнялась"})(),null),U.$$click=()=>{Os()},e.insert(U,()=>yi()?"Очистка...":"🧹 Очистить сейчас"),e.effect(I=>{var j=yi(),ie=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${yi()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${yi()?.6:1}`;return j!==I.e&&(U.disabled=I.e=j),I.t=e.style(U,ie,I.t),I},{e:void 0,t:void 0}),e.effect(()=>W.value=ci()),e.effect(()=>A.value=fi()),g})()})(),null),bt.$$click=()=>ds(!$n()),e.insert(Ql,()=>fe().length),e.insert(ka,()=>$n()?"▾":"▴"),to.$$click=()=>{ea()},e.insert(D,(()=>{var f=e.memo(()=>!$n());return()=>f()&&(()=>{var g=Hd();return e.insert(g,(()=>{var k=e.memo(()=>fe().length===0);return()=>k()?Jd():fe().map(v=>(()=>{var W=Qd(),q=W.firstChild,w=q.nextSibling,A=w.firstChild,z=A.firstChild,T=A.nextSibling,Z=T.nextSibling,U=Z.firstChild,I=U.nextSibling,j=I.nextSibling,ie=Z.nextSibling,ve=ie.firstChild,jr=w.nextSibling,we=jr.firstChild,Ge=we.nextSibling,We=Ge.nextSibling;return e.insert(A,()=>v.name,null),e.insert(T,()=>v.path),e.insert(Z,()=>v.gitBranch||"—",I),e.insert(Z,()=>v.gitRemote||"remote не задан",null),e.insert(ie,(()=>{var V=e.memo(()=>!!v.env);return()=>V()?`${Object.keys(v.env).length} перем.`:"—"})(),null),e.insert(ie,()=>v.envFile?" · .env-файл":"",null),we.$$click=()=>{Xs(v)},Ge.$$click=()=>{ta(v)},We.$$click=()=>{ra(v)},e.effect(V=>{var _e=`width:9px;height:9px;border-radius:50%;background:${v.color||"#5ac8fa"};flex-shrink:0`,he=v.path,xt=Rt(),vt=Rt(),de=Rt();return V.e=e.style(q,_e,V.e),he!==V.t&&e.setAttribute(T,"title",V.t=he),xt!==V.a&&(we.disabled=V.a=xt),vt!==V.o&&(Ge.disabled=V.o=vt),de!==V.i&&(We.disabled=V.i=de),V},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),W})())})()),g})()})(),null),e.insert(r,(()=>{var f=e.memo(()=>!!Ns());return()=>f()?(()=>{var g=Vd();return g.addEventListener("mouseleave",k=>{const v=k.currentTarget;v.style.borderColor="#3a3a3a",v.style.background="#1e1e1e"}),g.addEventListener("mouseenter",k=>{const v=k.currentTarget;v.style.borderColor="#5ac8fa",v.style.background="#232326"}),g.$$click=()=>Dn(!1),g})():(()=>{var g=Kd(),k=g.firstChild,v=k.firstChild,W=v.nextSibling,q=W.firstChild,w=q.nextSibling,A=k.nextSibling,z=A.firstChild,T=z.firstChild,Z=z.nextSibling,U=A.nextSibling,I=U.firstChild,j=I.nextSibling,ie=U.nextSibling,ve=ie.firstChild,jr=ve.nextSibling,we=jr.firstChild,Ge=we.firstChild,We=we.nextSibling,V=We.firstChild,_e=We.nextSibling,he=_e.firstChild,xt=_e.nextSibling,vt=xt.firstChild,de=ie.nextSibling,Qi=de.firstChild,Nr=Qi.nextSibling,Vi=Nr.firstChild,Kt=Vi.firstChild,Br=Vi.nextSibling,Yt=Br.firstChild,Fr=Br.nextSibling,Gr=Fr.firstChild,Ue=de.nextSibling,Ki=Ue.firstChild,it=Ki.nextSibling,nt=it.nextSibling,Yi=nt.firstChild,Zi=Yi.nextSibling,ht=nt.nextSibling,ro=ht.firstChild,Zt=ro.nextSibling,Xt=Zt.firstChild,io=Xt.nextSibling,He=io.nextSibling,ot=Ue.nextSibling,Xi=ot.firstChild,en=Xi.nextSibling,Me=ot.nextSibling,$t=Me.firstChild,wt=$t.nextSibling,tn=Me.nextSibling,Wr=tn.firstChild,er=Wr.nextSibling,Ur=tn.nextSibling,rn=Ur.firstChild,lt=rn.nextSibling,Hr=Ur.nextSibling,Jr=Hr.firstChild,nn=Jr.nextSibling,_t=Hr.nextSibling,on=_t.firstChild,ln=on.nextSibling,tr=_t.nextSibling,Qr=tr.firstChild,Vr=Qr.nextSibling,kt=tr.nextSibling,St=kt.firstChild,sn=St.nextSibling,an=kt.nextSibling,Ct=an.firstChild,zt=Ct.nextSibling,i=an.nextSibling,no=i.firstChild,pn=no.nextSibling,dn=i.nextSibling,rr=dn.firstChild,oo=rr.firstChild,cn=rr.nextSibling,un=cn.firstChild,fn=un.nextSibling,Kr=fn.nextSibling,lo=Kr.nextSibling,Yr=lo.nextSibling,gn=Yr.nextSibling,Zr=gn.firstChild,Xr=Zr.nextSibling,so=Xr.nextSibling,yn=dn.nextSibling,ei=yn.firstChild,st=ei.nextSibling;return e.insert(v,Yn?"Редактирование задачи":"Новая задача"),q.addEventListener("mouseleave",l=>{const o=l.currentTarget;o.style.color="#a0a0a6",o.style.borderColor="#333"}),q.addEventListener("mouseenter",l=>{const o=l.currentTarget;o.style.color="#5ac8fa",o.style.borderColor="#5ac8fa"}),q.$$click=na,w.addEventListener("mouseleave",l=>{const o=l.currentTarget;o.style.color="#a0a0a6",o.style.borderColor="#333"}),w.addEventListener("mouseenter",l=>{const o=l.currentTarget;o.style.color="#5ac8fa",o.style.borderColor="#5ac8fa"}),w.$$click=()=>Dn(!0),T.addEventListener("change",l=>{const o=l.currentTarget.checked;Mi(o),o&&(Ye(""),De().length===0&&Ar(fe().map(y=>y.id)))}),e.insert(A,(()=>{var l=e.memo(()=>!!qe());return()=>l()&&(()=>{var o=Yd(),y=o.firstChild,u=y.firstChild,h=u.firstChild,E=y.nextSibling,P=E.firstChild,ae=P.firstChild,ke=ae.nextSibling,at=P.nextSibling,Le=at.firstChild,Tt=Le.nextSibling,le=at.nextSibling,B=le.firstChild,ye=B.nextSibling,Je=E.nextSibling,Et=Je.firstChild,At=Je.nextSibling,bn=At.firstChild,ir=bn.nextSibling,mn=At.nextSibling;return e.insert(u,()=>De().length,null),e.insert(y,(()=>{var X=e.memo(()=>fe().length===0);return()=>X()?Zd():(()=>{var pe=Xd();return e.insert(pe,()=>fe().map(ce=>(()=>{var pt=ec(),Qe=pt.firstChild,ue=Qe.nextSibling,dt=ue.firstChild,Re=ue.nextSibling;return Qe.addEventListener("change",Pt=>Bs(ce.id,Pt.currentTarget.checked)),e.insert(ue,()=>ce.name,null),e.insert(Re,()=>ce.path),e.effect(Pt=>e.style(ue,`color:${ce.color||"#5ac8fa"}`,Pt)),e.effect(()=>Qe.checked=De().includes(ce.id)),pt})())),pe})()})(),null),ke.addEventListener("change",X=>Li(X.currentTarget.value==="sequential"?"sequential":"parallel")),Tt.addEventListener("change",X=>Ri(X.currentTarget.value==="stop"?"stop":"continue")),ye.addEventListener("change",X=>Oi(X.currentTarget.value==="per-task"?"per-task":"summary")),Et.addEventListener("change",X=>Ii(X.currentTarget.checked)),ir.$$input=X=>Di(X.currentTarget.value),e.insert(o,(()=>{var X=e.memo(()=>De().length>0);return()=>X()&&(()=>{var pe=tc(),ce=pe.firstChild,pt=ce.firstChild,Qe=ce.nextSibling;return e.insert(ce,Fs,null),e.insert(Qe,()=>De().map(ue=>{const dt=fe().find(nr=>nr.id===ue);if(!dt)return null;const Re=Wn()[ue]??{},Pt="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box";return(()=>{var nr=rc(),Mt=nr.firstChild,ao=Mt.firstChild,Vl=ao.nextSibling,Sa=Mt.nextSibling,po=Sa.firstChild,Kl=po.nextSibling,co=Kl.firstChild,Yl=co.nextSibling,Ca=Kl.nextSibling,uo=Ca.firstChild,Zl=uo.nextSibling;return e.insert(Mt,()=>dt.name,Vl),e.insert(Vl,()=>Qn(Te(),dt.name)),po.$$input=Se=>Rr(ue,"prompt",Se.currentTarget.value),co.$$input=Se=>Rr(ue,"model",Se.currentTarget.value),Yl.$$input=Se=>Rr(ue,"qualityGate",Se.currentTarget.value),uo.$$input=Se=>Rr(ue,"beforeScript",Se.currentTarget.value),Zl.$$input=Se=>Rr(ue,"afterScript",Se.currentTarget.value),e.effect(Se=>e.style(Mt,`font-size:12px;font-weight:600;margin-bottom:6px;color:${dt.color||"#5ac8fa"}`,Se)),e.effect(()=>po.value=Re.prompt??""),e.effect(()=>co.value=Re.model??""),e.effect(()=>Yl.value=Re.qualityGate??""),e.effect(()=>uo.value=Re.beforeScript??""),e.effect(()=>Zl.value=Re.afterScript??""),nr})()})),pe})()})(),mn),e.insert(mn,(()=>{var X=e.memo(()=>Vn().length>0);return()=>X()?[(()=>{var pe=ic(),ce=pe.firstChild,pt=ce.nextSibling,Qe=pt.nextSibling;return e.insert(pe,()=>Vn().length,pt),pe})(),(()=>{var pe=nc();return e.insert(pe,()=>Vn().join(", ")),pe})()]:oc()})()),e.effect(()=>e.setAttribute(ir,"placeholder",Gn()==="sequential"?"1 (sequential)":"без лимита")),e.effect(()=>ke.value=Gn()),e.effect(()=>Tt.value=Ol()),e.effect(()=>ye.value=Il()),e.effect(()=>Et.checked=ql()),e.effect(()=>ir.value=qi()),o})()})(),null),e.insert(g,(()=>{var l=e.memo(()=>!qe());return()=>l()&&(()=>{var o=lc(),y=o.firstChild,u=y.nextSibling,h=u.firstChild;return u.addEventListener("change",E=>{Ye(E.currentTarget.value),E.currentTarget.value&&Ht("")}),e.insert(u,()=>fe().map(E=>(()=>{var P=rs(),ae=P.firstChild;return e.insert(P,()=>E.name,null),e.effect(()=>e.setAttribute(P,"key",E.id)),e.effect(()=>P.value=E.id),P})()),null),e.insert(o,(()=>{var E=e.memo(()=>!!Ir());return()=>E()&&(()=>{var P=sc(),ae=P.firstChild,ke=ae.firstChild,at=ke.nextSibling,Le=ae.nextSibling,Tt=Le.firstChild,le=Tt.nextSibling,B=Le.nextSibling,ye=B.firstChild,Je=ye.nextSibling;return e.insert(at,()=>Ir().path),e.insert(le,()=>Ir().gitBranch||"—"),e.insert(Je,()=>Ir().gitRemote||"—"),P})()})(),null),e.effect(()=>u.value=Ot()),o})()})(),U),j.$$input=l=>mi(l.currentTarget.value),e.insert(g,(()=>{var l=e.memo(()=>!Ot()&&!qe());return()=>l()&&(()=>{var o=ac(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>Ht(h.currentTarget.value),e.effect(()=>u.value=Pi()||""),o})()})(),ie),Ge.addEventListener("change",()=>Xe("cron")),V.addEventListener("change",()=>Xe("file")),he.addEventListener("change",()=>Xe("mcp-event")),vt.addEventListener("change",()=>Xe("once")),e.insert(g,(()=>{var l=e.memo(()=>se()==="file");return()=>l()&&(()=>{var o=pc(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>$r(h.currentTarget.value),e.effect(()=>u.value=jn()||""),o})()})(),de),e.insert(g,(()=>{var l=e.memo(()=>se()==="mcp-event");return()=>l()&&[(()=>{var o=dc(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>Cr(h.currentTarget.value),e.effect(()=>u.value=Bn()||""),o})(),(()=>{var o=cc(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>zr(h.currentTarget.value),e.effect(()=>u.value=Fn()||""),o})(),(()=>{var o=uc(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>Er(h.currentTarget.value),e.effect(()=>u.value=Tr()||""),o})()]})(),de),e.insert(g,(()=>{var l=e.memo(()=>se()==="once");return()=>l()&&(()=>{var o=fc(),y=o.firstChild,u=y.nextSibling,h=u.nextSibling,E=h.nextSibling;return u.$$input=P=>ki(P.currentTarget.value),E.$$input=P=>Ci(P.currentTarget.value),e.effect(()=>u.value=Nn()||""),e.effect(()=>E.value=Si()||""),o})()})(),de),Kt.addEventListener("change",()=>Ut("new")),Yt.addEventListener("change",()=>Ut("reuse")),Gr.addEventListener("change",()=>Ut("last")),e.insert(de,(()=>{var l=e.memo(()=>Ie()==="reuse");return()=>l()&&(()=>{var o=gc(),y=o.firstChild,u=y.nextSibling;return u.$$input=h=>zi(h.currentTarget.value),e.effect(()=>u.value=wr()||""),o})()})(),null),it.addEventListener("change",l=>{const o=l.currentTarget.value;cr(o),o!=="__custom__"&&Ft(o)}),e.insert(it,()=>bo.map(l=>(()=>{var o=xn();return e.insert(o,()=>l.label),e.effect(()=>e.setAttribute(o,"key",l.value)),e.effect(()=>o.value=l.value),o})())),e.insert(Ue,va&&(()=>{var l=yc(),o=l.firstChild,y=o.nextSibling;return y.$$input=u=>Ft(u.currentTarget.value),e.effect(()=>y.value=xi()||""),l})(),nt),e.insert(Ue,(()=>{var l=e.memo(()=>!!So());return()=>l()&&(()=>{var o=bc();return e.insert(o,So),o})()})(),nt),Zi.$$input=l=>_r(l.currentTarget.value),Xt.$$input=l=>kr(l.currentTarget.value),He.$$input=l=>Sr(l.currentTarget.value),en.$$input=l=>Wt(l.currentTarget.value),wt.addEventListener("change",l=>ia(l.currentTarget.value)),e.insert(wt,()=>To.map(l=>(()=>{var o=xn();return e.insert(o,()=>l.label),e.effect(()=>e.setAttribute(o,"key",l.value)),e.effect(()=>o.value=l.value),o})()),null),e.insert(wt,()=>ai().map(l=>(()=>{var o=xn();return e.insert(o,()=>l.name),e.effect(()=>e.setAttribute(o,"key",l.id)),e.effect(()=>o.value=`custom:${l.id}`),o})()),null),e.insert(Me,(()=>{var l=e.memo(()=>!!sr().startsWith("custom:"));return()=>l()&&(()=>{var o=mc(),y=o.firstChild,u=y.nextSibling;return e.insert(o,()=>ai().map(h=>`custom:${h.id}`!==sr()?null:(()=>{var E=xc();return e.insert(E,()=>h.name),e.effect(()=>e.setAttribute(E,"key",h.id)),E})()),u),u.addEventListener("mouseleave",h=>{h.currentTarget.style.color="#ff3b30"}),u.addEventListener("mouseenter",h=>{h.currentTarget.style.color="#c92a2a"}),u.$$click=()=>{const h=ai().find(E=>`custom:${E.id}`===sr());h&&oa(h)},o})()})(),null),er.$$input=l=>yr(l.currentTarget.value),lt.addEventListener("change",l=>br(Number(l.currentTarget.value)||Ve)),e.insert(lt,()=>ns.map(l=>(()=>{var o=xn();return e.insert(o,()=>l.label),e.effect(()=>e.setAttribute(o,"key",l.value)),e.effect(()=>o.value=String(l.value)),o})()),null),e.insert(lt,(()=>{var l=e.memo(()=>!ns.some(o=>o.value===ft()));return()=>l()&&(()=>{var o=vc(),y=o.firstChild,u=y.nextSibling,h=u.nextSibling;return e.insert(o,ft,u),e.effect(()=>o.value=String(ft())),o})()})(),null),nn.$$input=l=>ur(Number(l.currentTarget.value)||0),ln.$$input=l=>fr(Number(l.currentTarget.value)||60),Vr.$$input=l=>mr(l.currentTarget.value),sn.$$input=l=>vr(l.currentTarget.value),zt.$$input=l=>hr(l.currentTarget.value),e.insert(pn,(()=>{var l=e.memo(()=>Hl().length===0);return()=>l()?hc():Hl().map(o=>(()=>{var y=yo(),u=y.firstChild;return u.addEventListener("change",h=>$a(o,h.currentTarget.checked)),e.insert(y,o,null),e.effect(h=>e.style(y,`display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:14px;border:1px solid ${gt().includes(o)?"#5ac8fa":"#333"};background:${gt().includes(o)?"rgba(90,200,250,0.12)":"transparent"};color:${gt().includes(o)?"#5ac8fa":"#cfcfd2"};font-size:12px;cursor:pointer;user-select:none`,h)),e.effect(()=>u.checked=gt().includes(o)),y})())})()),e.insert(rr,(()=>{var l=e.memo(()=>ee().length>0||te().length>0);return()=>l()&&(()=>{var o=$c(),y=o.firstChild,u=y.nextSibling,h=u.nextSibling,E=h.nextSibling,P=E.nextSibling;return e.insert(o,()=>ee().length,u),e.insert(o,()=>te().length,E),o})()})(),null),e.insert(Kr,()=>jl.map(l=>(()=>{var o=yo(),y=o.firstChild;return y.addEventListener("change",()=>Nl("allowed",l)),e.insert(o,l,null),e.effect(u=>e.style(o,`display:flex;align-items:center;gap:5px;padding:4px 9px;border-radius:12px;border:1px solid ${ee().includes(l)?"#34c759":"#333"};background:${ee().includes(l)?"rgba(52,199,89,0.12)":"transparent"};color:${ee().includes(l)?"#34c759":"#cfcfd2"};font-size:11px;cursor:pointer;user-select:none`,u)),e.effect(()=>y.checked=ee().includes(l)),o})())),e.insert(Yr,()=>jl.map(l=>(()=>{var o=yo(),y=o.firstChild;return y.addEventListener("change",()=>Nl("denied",l)),e.insert(o,l,null),e.effect(u=>e.style(o,`display:flex;align-items:center;gap:5px;padding:4px 9px;border-radius:12px;border:1px solid ${te().includes(l)?"#ff3b30":"#333"};background:${te().includes(l)?"rgba(255,59,48,0.12)":"transparent"};color:${te().includes(l)?"#ff3b30":"#cfcfd2"};font-size:11px;cursor:pointer;user-select:none`,u)),e.effect(()=>y.checked=te().includes(l)),o})())),Zr.$$input=l=>Rl(l.currentTarget.value),Xr.$$click=()=>Bl("allowed"),so.$$click=()=>Bl("denied"),e.insert(cn,(()=>{var l=e.memo(()=>ee().length>0||te().length>0);return()=>l()&&(()=>{var o=wc();return e.insert(o,(()=>{var y=e.memo(()=>ee().length>0);return()=>y()&&(()=>{var u=_c(),h=u.firstChild,E=h.nextSibling,P=E.nextSibling;return e.insert(u,()=>ee().join(", "),E),u})()})(),null),e.insert(o,(()=>{var y=e.memo(()=>te().length>0);return()=>y()&&(()=>{var u=kc(),h=u.firstChild,E=h.nextSibling,P=E.nextSibling;return e.insert(u,()=>te().join(", "),E),u})()})(),null),o})()})(),null),ei.$$click=()=>{Jn("(форма)");const l={order:0,trigger:"manual",command:Gs(),roleScoped:ee().length>0||te().length>0?{allowed:ee(),denied:te()}:null,preFlight:(wi()||"").trim()||null,postFlight:(_i()||"").trim()||null,qualityGate:($i()||"").trim()||null},o=De().map(y=>fe().find(u=>u.id===y)).filter(y=>!!y).map((y,u)=>({...l,name:Qn(Te(),y.name),order:u,cwd:y.path,matrixParent:Te()||"(без имени)"}));Mr({tasks:qe()?o:[{...l,name:Te()||"(без имени)",cwd:Ir()?.path||(Pi()||"").trim()||"(папка проекта)"}],totals:{},warnings:[...Te().trim()?[]:["Не указано имя — превью локальное (форма не сохранена)."],...qe()?[`Matrix: будет создано ${o.length} клон(а/ов) по workspace; родитель сам не выполняется.`]:[]]}),Un(!0)},st.$$click=pa,e.insert(st,()=>lr()?"Создание...":Yn?"Сохранить":"Создать задачу"),e.insert(yn,Yn&&(()=>{var l=Sc();return l.$$click=()=>{bi(null),mi(""),Ft("* * * * *"),Wt(""),yr(""),br(Ve),ur(0),fr(60),mr(""),xr([]),vr(""),hr(""),Xe("cron"),$r(""),ki(""),Ci(""),Ut("new"),zi(""),_r(""),kr(""),Sr(""),Cr(""),zr(""),Er(""),Ht(""),Ye(""),Jt([]),Qt([]),Ni(),cr("* * * * *"),oi("")},l})(),null),e.insert(g,(()=>{var l=e.memo(()=>!!(Pr()&&Lr()==="(форма)"));return()=>l()&&(()=>{var o=Cc(),y=o.firstChild,u=y.firstChild,h=u.nextSibling;return h.$$click=()=>Wl(),e.insert(o,()=>{const E=re();if(!E)return null;const P=E.tasks?.[0];return(()=>{var ae=zc(),ke=ae.firstChild,at=ke.firstChild,Le=ke.nextSibling,Tt=Le.firstChild;return e.insert(ke,()=>P?.command,null),e.insert(Le,()=>P?.cwd,null),e.insert(ae,(()=>{var le=e.memo(()=>!!P?.roleScoped);return()=>le()&&(()=>{var B=Tc(),ye=B.firstChild,Je=ye.nextSibling,Et=Je.nextSibling,At=Et.nextSibling,bn=At.nextSibling;return e.insert(B,()=>(P.roleScoped.allowed??[]).join(", "),Je),e.insert(B,()=>(P.roleScoped.denied??[]).join(", "),At),B})()})(),null),e.insert(ae,(()=>{var le=e.memo(()=>!!P?.preFlight);return()=>le()&&(()=>{var B=Ec(),ye=B.firstChild;return e.insert(B,()=>P.preFlight,null),B})()})(),null),e.insert(ae,(()=>{var le=e.memo(()=>!!P?.postFlight);return()=>le()&&(()=>{var B=Ac(),ye=B.firstChild;return e.insert(B,()=>P.postFlight,null),B})()})(),null),e.insert(ae,(()=>{var le=e.memo(()=>!!P?.qualityGate);return()=>le()&&(()=>{var B=Pc(),ye=B.firstChild;return e.insert(B,()=>P.qualityGate,null),B})()})(),null),e.insert(ae,(()=>{var le=e.memo(()=>!!(Array.isArray(E.warnings)&&E.warnings.length>0));return()=>le()&&(()=>{var B=Mc(),ye=B.firstChild;return e.insert(B,()=>E.warnings.join(" | "),null),B})()})(),null),ae})()},null),o})()})(),null),e.effect(l=>{var o=se()!=="cron"?"none":"block",y=lr()||!Wi(),u=Wi()?void 0:Ul(),h=`display:block;width:100%;padding:10px;margin-top:8px;background:${lr()?"#666":"#007acc"};color:white;border-radius:6px;border:none;cursor:${lr()||!Wi()?"not-allowed":"pointer"};font-size:13px;font-weight:500;opacity:${lr()||!Wi()?.6:1}`;return o!==l.e&&e.setStyleProperty(Ue,"display",l.e=o),y!==l.t&&(st.disabled=l.t=y),u!==l.a&&e.setAttribute(st,"title",l.a=u),l.o=e.style(st,h,l.o),l},{e:void 0,t:void 0,a:void 0,o:void 0}),e.effect(()=>T.checked=qe()),e.effect(()=>j.value=Te()||""),e.effect(()=>Ge.checked=se()==="cron"),e.effect(()=>V.checked=se()==="file"),e.effect(()=>he.checked=se()==="mcp-event"),e.effect(()=>vt.checked=se()==="once"),e.effect(()=>Kt.checked=Ie()==="new"),e.effect(()=>Yt.checked=Ie()==="reuse"),e.effect(()=>Gr.checked=Ie()==="last"),e.effect(()=>it.value=Ml()),e.effect(()=>Zi.value=Ti()||""),e.effect(()=>Xt.value=Ei()||""),e.effect(()=>He.value=Ai()||""),e.effect(()=>en.value=Gt()||""),e.effect(()=>wt.value=sr()),e.effect(()=>er.value=gr()||""),e.effect(()=>lt.value=String(ft())),e.effect(()=>nn.value=vi()),e.effect(()=>ln.value=hi()),e.effect(()=>Vr.value=$i()||""),e.effect(()=>sn.value=wi()||""),e.effect(()=>zt.value=_i()||""),e.effect(()=>Zr.value=Ll()),g})()})(),Ji),e.insert(Ji,(()=>{var f=e.memo(()=>Lt()!=="all");return()=>f()&&(()=>{var g=Lc(),k=g.firstChild,v=k.nextSibling,W=v.nextSibling,q=W.nextSibling,w=q.nextSibling;return e.insert(g,(()=>{var A=e.memo(()=>Lt()==="none");return()=>A()?"без workspace":`📦 ${fe().find(z=>z.id===Lt())?.name??"workspace"}`})(),v),e.insert(g,()=>Xn().length,q),e.insert(g,()=>qr().length,null),g})()})(),null),e.insert(Ji,(()=>{var f=e.memo(()=>Xn().length===0);return()=>f()?(()=>{var g=Rc(),k=g.firstChild,v=k.nextSibling;return e.insert(k,()=>Ce()?"🎄":"📅"),e.insert(v,()=>Ce()?"Задач пока нет. Самое время украсить ёлку!":"Нет активных задач. Создайте первую и доверьте рутину ИИ!"),g})():(()=>{var g=Oc();return e.insert(g,()=>Xn().map(k=>e.createComponent(_a,{get key(){return k.name},job:k}))),g})()})(),null),e.insert(r,(()=>{var f=e.memo(()=>!!ys());return()=>f()&&(()=>{var g=Ic(),k=g.firstChild,v=k.firstChild,W=v.nextSibling,q=W.firstChild,w=q.nextSibling;return g.$$click=()=>ut(null),k.$$click=A=>A.stopPropagation(),e.insert(v,wn),e.insert(k,(()=>{var A=e.memo(()=>!!wn().includes("KEY=VALUE"));return()=>A()?(()=>{var z=qc();return z.$$keydown=T=>{T.key==="Escape"&&ut(null),T.key==="Enter"&&(T.ctrlKey||T.metaKey)&&(T.preventDefault(),ut(or())),T.stopPropagation()},z.$$input=T=>_n(T.currentTarget.value),e.effect(()=>z.value=or()),z})():(()=>{var z=Dc();return z.$$keydown=T=>{T.key==="Escape"&&ut(null),T.key==="Enter"&&(T.preventDefault(),ut(or())),T.stopPropagation()},z.$$input=T=>_n(T.currentTarget.value),e.effect(()=>z.value=or()),z})()})(),W),q.$$click=()=>ut(null),w.$$click=()=>ut(or()),e.insert(k,(()=>{var A=e.memo(()=>!!wn().includes("KEY=VALUE"));return()=>A()&&jc()})(),null),g})()})(),null),e.insert(r,(()=>{var f=e.memo(()=>!!kn());return()=>f()&&(()=>{var g=Nc(),k=g.firstChild,v=k.firstChild,W=v.firstChild,q=W.nextSibling,w=v.nextSibling,A=k.nextSibling;return e.insert(q,kn),w.addEventListener("mouseleave",z=>{z.target.style.color="#8e8e93"}),w.addEventListener("mouseenter",z=>{z.target.style.color="#ff3b30"}),w.$$click=()=>{Sn(null),jt("")},e.insert(A,()=>ms().split(`
4
- `).map((z,T)=>(()=>{var Z=Bc();return e.setAttribute(Z,"key",T),e.insert(Z,z),Z})())),g})()})(),null),e.effect(f=>{var g=`display:flex;flex-direction:column;width:100%;height:100%;max-height:100vh;min-height:0;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;gap:24px;padding:20px;font-size:13px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;color:#e0e0e0;transition:background 0.3s ease;scrollbar-width:thin;scrollbar-color:#444 transparent;background:${Ce()?"linear-gradient(180deg, #0f172a 0%, #000000 100%)":"#0f0f0f"}`,k=It()?"Профиль задан переменной окружения OPENCODE_SCHEDULER_PROFILE — переключение в GUI недоступно":"Профили: отдельные БД, настройки и порт дашборда",v=`display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;border:1px solid ${ii()?"#bf5af2":"#333"};background:${ii()?"rgba(191,90,242,0.12)":"#1e1e1e"};color:${ii()?"#bf5af2":"#e0e0e0"}`,W=`display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;transition:background 0.2s ease, border-color 0.2s ease;border:1px solid ${Ce()?"rgba(135, 206, 250, 0.5)":"#333"};background:${Ce()?"rgba(135, 206, 250, 0.12)":"#1e1e1e"};color:#e0e0e0`,q=Bi(),w=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${Bi()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${Bi()?.6:1};transition:background 0.18s ease`,A=Fi(),z=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${Fi()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${Fi()?.6:1};transition:background 0.18s ease`,T=Rt(),Z=`padding:5px 10px;border-radius:6px;border:1px solid #333;background:#252526;color:${Rt()?"#666":"#5ac8fa"};font-size:11px;font-weight:600;cursor:${Rt()?"not-allowed":"pointer"}`;return f.e=e.style(r,g,f.e),k!==f.t&&e.setAttribute(je,"title",f.t=k),f.a=e.style(je,v,f.a),f.o=e.style($e,W,f.o),q!==f.i&&(xe.disabled=f.i=q),f.n=e.style(xe,w,f.n),A!==f.s&&(d.disabled=f.s=A),f.h=e.style(d,z,f.h),T!==f.r&&(to.disabled=f.r=T),f.d=e.style(to,Z,f.d),f},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e.effect(()=>tt.value=Lt()),e.effect(()=>Ne.checked=Ce()),e.effect(()=>R.value=_s()),r}})})}catch(r){return console.error("GUI render error:",r),c.add(fo.Panel,{id:"scheduler-jobs",region:"side",list:()=>[{id:"jobs",title:"Планировщик",pinned:!0}],render:()=>e.createComponent(s.ErrorBoundary,{fallback:t=>(()=>{var n=ts();return n.firstChild,e.insert(n,()=>t.message,null),n})(),get children(){var t=Fc(),n=t.firstChild;return e.insert(n,In),t}})})}}});e.delegateEvents(["click","input","keydown"]);exports.default=Wc;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("solid-js/web"),o=require("solid-js"),tl=require("@opencode/plugin/gui"),Zp=require("@opencode/plugin/rpc"),bi={type:["object","null"],properties:{server:{type:"string"},event:{type:"string"},filter:{type:"string"}},required:["server","event"]},ol={type:["object","null"],properties:{workspaceIds:{type:"array",items:{type:"string"}},strategy:{type:["string","null"]},failureMode:{type:["string","null"]},aggregation:{type:["string","null"]},createAggregator:{type:["boolean","null"]},concurrency:{type:["number","null"]},overrides:{type:["object","null"],additionalProperties:{type:"object",properties:{prompt:{type:["string","null"]},model:{type:["string","null"]},qualityGate:{type:["string","null"]},beforeScript:{type:["string","null"]},afterScript:{type:["string","null"]}}}}},required:["workspaceIds"]},Xp={type:"object",properties:{name:{type:"string"},schedule:{type:"string"},status:{type:"string"},nextRun:{type:["string","null"]},model:{type:["string","null"]},priority:{type:["number","null"]},retryCount:{type:["number","null"]},retryDelay:{type:["number","null"]},qualityGate:{type:["string","null"]},nextTaskOnSuccess:{type:["string","null"]},nextTaskOnError:{type:["string","null"]},dependsOn:{type:"array",items:{type:"string"}},prompt:{type:"string"},beforeScript:{type:["string","null"]},afterScript:{type:["string","null"]},triggerType:{type:["string","null"]},runAt:{type:["string","null"]},session:{type:["string","null"]},sessionId:{type:["string","null"]},sessionMaxRuns:{type:["number","null"]},mcpEvent:bi,watchPath:{type:["string","null"]},timezone:{type:["string","null"]},notBefore:{type:["string","null"]},notAfter:{type:["string","null"]},activeDays:{type:["array","null"],items:{type:"number"}},windowPolicy:{type:["string","null"]},watchGlobs:{type:["array","null"],items:{type:"string"}},watchIgnore:{type:["array","null"],items:{type:"string"}},gitBranch:{type:["string","null"]},gitPaths:{type:["array","null"],items:{type:"string"}},gitIgnore:{type:["array","null"],items:{type:"string"}},gitPollSeconds:{type:["number","null"]},pausedUntil:{type:["string","null"]},workingDirectory:{type:["string","null"]},workspaceId:{type:["string","null"]},workspaceName:{type:["string","null"]},workspaceColor:{type:["string","null"]},allowedTools:{type:["array","null"],items:{type:"string"}},deniedTools:{type:["array","null"],items:{type:"string"}},matrix:ol,matrixParentId:{type:["string","null"]},isMatrixParent:{type:"boolean"},paused:{type:"boolean"},orphaned:{type:"boolean"},runsTotal:{type:"number"},runsSuccess:{type:"number"},runsError:{type:"number"},runsPartial:{type:"number"},matrixSummary:{type:["object","null"],properties:{totalCount:{type:"number"},successCount:{type:"number"},errorCount:{type:"number"},pendingCount:{type:"number"},status:{type:"string"},message:{type:"string"}}}},required:["name","schedule","status"]},rl={type:"object",properties:{},additionalProperties:!1},ed={type:"object",properties:{tasks:{type:"array",items:Xp}},required:["tasks"]},td={type:"object",properties:{name:{type:"string"},schedule:{type:"string"},prompt:{type:"string"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},runAt:{type:"string"},delaySeconds:{type:"number"},session:{type:"string"},sessionMaxRuns:{type:"number"},mcpEvent:bi,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}},matrix:ol,timezone:{type:"string"},notBefore:{type:"string"},notAfter:{type:"string"},activeDays:{type:"array",items:{type:"number"}},windowPolicy:{type:"string"},watchGlobs:{type:"array",items:{type:"string"}},watchIgnore:{type:"array",items:{type:"string"}},gitBranch:{type:"string"},gitPaths:{type:"array",items:{type:"string"}},gitIgnore:{type:"array",items:{type:"string"}},gitPollSeconds:{type:"number"}},required:["name","prompt"]},rd={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},Fn={type:"object",properties:{name:{type:"string"}},required:["name"]},id=Fn,nd=Fn,yi={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},od=yi,ld=Fn,sd={type:"object",properties:{success:{type:"boolean"},logs:{type:"string"},error:{type:"string"}},required:["success","logs"]},ad={type:"object",properties:{taskName:{type:"string"},status:{type:"string"},startedAt:{type:"string"},finishedAt:{type:"string"},durationMs:{type:"number"},error:{type:["string","null"]},nextTask:{type:["string","null"]},model:{type:["string","null"]},preFlightStatus:{type:["string","null"]},postFlightStatus:{type:["string","null"]},allowedTools:{type:["array","null"],items:{type:"string"}},deniedTools:{type:["array","null"],items:{type:"string"}}},required:["taskName","status","startedAt","finishedAt","durationMs","error"]},pd={type:"object",properties:{limit:{type:"number"},taskName:{type:"string"},status:{type:"string"}},additionalProperties:!1},dd={type:"object",properties:{records:{type:"array",items:ad}},required:["records"]},cd={type:"object",properties:{total:{type:"number"},success:{type:"number"},error:{type:"number"}},required:["total","success","error"]},ud={type:"object",properties:{},additionalProperties:!1},gd=cd,fd={type:"object",properties:{},additionalProperties:!1},yd={type:"object",properties:{port:{type:["number","null"]}},required:["port"]},bd={type:"object",properties:{},additionalProperties:!1},xd={type:"object",properties:{platform:{type:"string"},title:{type:"string"}},required:["platform","title"]},md={type:"object",properties:{},additionalProperties:!1},vd={type:"object",properties:{success:{type:"boolean"},data:{type:"string"},count:{type:"number"},error:{type:"string"}},required:["success"]},hd={type:"object",properties:{data:{type:"string"}},required:["data"]},$d={type:"object",properties:{success:{type:"boolean"},imported:{type:"number"},errors:{type:"array",items:{type:"string"}},error:{type:"string"}},required:["success"]},wd={type:"object",properties:{},additionalProperties:!1},ll={type:"object",properties:{enabled:{type:"boolean"},onlyOnError:{type:"boolean"},webhook:{type:"object",properties:{enabled:{type:"boolean"},url:{type:"string"},timeoutMs:{type:"number"},retryCount:{type:"number"},retryDelayMs:{type:"number"}},required:["enabled","url"]},templates:{type:"object",properties:{success:{type:"string"},error:{type:"string"}},required:["success","error"]},filters:{type:"object",properties:{include:{type:"array",items:{type:"string"}},exclude:{type:"array",items:{type:"string"}}},required:["include","exclude"]},telegram:{type:"object",properties:{enabled:{type:"boolean"},botToken:{type:"string"},chatId:{type:"string"},parseMode:{type:"string",enum:["","HTML","Markdown","MarkdownV2"]},disableNotification:{type:"boolean"},messageThreadId:{type:["number","null"]},includeDashboardLink:{type:"boolean"},apiBase:{type:"string"}},required:["enabled"]},native:{type:"object",properties:{enabled:{type:"boolean"},sound:{type:"boolean"}},required:["enabled"]},quietHours:{type:"object",properties:{enabled:{type:"boolean"},from:{type:"string"},to:{type:"string"}},required:["enabled","from","to"]},dashboardUrl:{type:"string"},matrix:{type:"object",properties:{enabled:{type:"boolean"},onPartial:{type:"boolean"},onAllFailed:{type:"boolean"},stuckAfterMinutes:{type:"number"}},required:["enabled","onPartial","onAllFailed","stuckAfterMinutes"]},digest:{type:"object",properties:{enabled:{type:"boolean"},frequency:{type:"string",enum:["daily","weekly"]},time:{type:"string"},lastSentAt:{type:["string","null"]}},required:["enabled","frequency","time"]}},required:["enabled","onlyOnError"]},sl={type:"object",properties:{retentionDays:{type:"number"},maxRecords:{type:"number"},lastCleanupAt:{type:["string","null"]},lastCleanupDeleted:{type:"number"}},required:["retentionDays","maxRecords"]},al={type:"object",properties:{enabled:{type:"boolean"},retentionDays:{type:"number"},maxRecords:{type:"number"}},required:["enabled","retentionDays","maxRecords"]},_d={type:"object",properties:{maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:ll,history:sl,audit:al},required:["maxConcurrent","winterMode","notifications"]},kd={type:"object",properties:{maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:ll,history:sl,audit:al},additionalProperties:!1},Sd={type:"object",properties:{success:{type:"boolean"},maxConcurrent:{type:"number"},winterMode:{type:"boolean"},notifications:ll,history:sl,audit:al},required:["success","maxConcurrent","winterMode","notifications"]},Cd={type:"object",properties:{retentionDays:{type:"number"},maxRecords:{type:"number"}},additionalProperties:!1},zd={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},deleted:{type:"number"},deletedByAge:{type:"number"},deletedByCount:{type:"number"},kept:{type:"number"},retentionDays:{type:"number"},maxRecords:{type:"number"},vacuumed:{type:"boolean"}},required:["success","message","deleted","kept"]},Td={type:"object",properties:{days:{type:"number"},topLimit:{type:"number"}},additionalProperties:!1},Ed={type:"object",properties:{success:{type:"boolean"},report:{type:["object","null"]},error:{type:"string"}},required:["success","report"]},Pd={type:"object",properties:{},additionalProperties:!1},Ad={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},Md={type:"object",properties:{},additionalProperties:!1},Ld={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},ga={type:"object",properties:{name:{type:"string"},preview:{type:"string"},updatedAt:{type:"string"}},required:["name","preview"]},Id={type:"object",properties:{},additionalProperties:!1},Dd={type:"object",properties:{success:{type:"boolean"},secrets:{type:"array",items:ga}},required:["success","secrets"]},Rd={type:"object",properties:{name:{type:"string"},value:{type:"string"}},required:["name","value"],additionalProperties:!1},qd={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},secret:ga},required:["success"]},Od={type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1},jd={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},Bd={type:"object",properties:{id:{type:"number"},ts:{type:"string"},action:{type:"string"},targetType:{type:["string","null"]},target:{type:["string","null"]},actor:{type:"string"},source:{type:["string","null"]},details:{},remote:{type:["string","null"]}},required:["id","ts","action","actor"]},Nd={type:"object",properties:{action:{type:"string"},target:{type:"string"},actor:{type:"string"},since:{type:"string"},until:{type:"string"},limit:{type:"number"}},additionalProperties:!1},Gd={type:"object",properties:{success:{type:"boolean"},records:{type:"array",items:Bd},total:{type:"number"}},required:["success","records","total"]},fa={type:"object",properties:{id:{type:"string"},name:{type:"string"},prompt:{type:"string"},schedule:{type:"string"},timeoutSeconds:{type:"number"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},mcpEvent:bi,watchPath:{type:"string"},watchGlobs:{type:"array",items:{type:"string"}},watchIgnore:{type:"array",items:{type:"string"}},gitBranch:{type:"string"},gitPaths:{type:"array",items:{type:"string"}},gitIgnore:{type:"array",items:{type:"string"}},gitPollSeconds:{type:"number"},activeDays:{type:"array",items:{type:"number"}},windowPolicy:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}}},required:["id","name","prompt"]},Fd={type:"object",properties:{},additionalProperties:!1},Wd={type:"object",properties:{templates:{type:"array",items:fa}},required:["templates"]},Ud={type:"object",properties:{id:{type:"string"},name:{type:"string"},prompt:{type:"string"},schedule:{type:"string"},timeoutSeconds:{type:"number"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},mcpEvent:bi,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}}},required:["name","prompt"],additionalProperties:!1},Hd={type:"object",properties:{success:{type:"boolean"},template:fa,error:{type:"string"}},required:["success"]},Vd={type:"object",properties:{id:{type:"string"}},required:["id"]},Jd={type:"object",properties:{success:{type:"boolean"},error:{type:"string"}},required:["success"]},sa={type:"object",properties:{name:{type:"string"},until:{type:"string"}},required:["name"]},Qd={type:"object",properties:{name:{type:"string"},newSchedule:{type:"string"},newPrompt:{type:"string"},model:{type:"string"},priority:{type:"number"},retryCount:{type:"number"},retryDelay:{type:"number"},qualityGate:{type:"string"},nextTaskOnSuccess:{type:"string"},nextTaskOnError:{type:"string"},dependsOn:{type:"array",items:{type:"string"}},beforeScript:{type:"string"},afterScript:{type:"string"},triggerType:{type:"string"},runAt:{type:"string"},delaySeconds:{type:"number"},session:{type:"string"},sessionMaxRuns:{type:"number"},mcpEvent:bi,watchPath:{type:"string"},workspaceId:{type:"string"},workingDirectory:{type:"string"},allowedTools:{type:"array",items:{type:"string"}},deniedTools:{type:"array",items:{type:"string"}},matrix:ol,timezone:{type:"string"},notBefore:{type:"string"},notAfter:{type:"string"},activeDays:{type:"array",items:{type:"number"}},windowPolicy:{type:"string"},watchGlobs:{type:"array",items:{type:"string"}},watchIgnore:{type:"array",items:{type:"string"}},gitBranch:{type:"string"},gitPaths:{type:"array",items:{type:"string"}},gitIgnore:{type:"array",items:{type:"string"}},gitPollSeconds:{type:"number"}},required:["name"]},Kd=yi,ya={type:"object",properties:{id:{type:"string"},name:{type:"string"},path:{type:"string"},gitRemote:{type:["string","null"]},gitBranch:{type:["string","null"]},color:{type:["string","null"]},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]},createdAt:{type:"string"}},required:["id","name","path","createdAt"]},Yd={type:"object",properties:{},additionalProperties:!1},Zd={type:"object",properties:{workspaces:{type:"array",items:ya}},required:["workspaces"]},Xd={type:"object",properties:{name:{type:"string"},path:{type:"string"},color:{type:"string"},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]}},required:["path"],additionalProperties:!1},aa={type:"object",properties:{success:{type:"boolean"},workspace:ya,error:{type:"string"}},required:["success"]},ec={type:"object",properties:{id:{type:"string"},name:{type:"string"},path:{type:"string"},color:{type:"string"},env:{type:["object","null"],additionalProperties:{type:"string"}},envFile:{type:["string","null"]}},required:["id"],additionalProperties:!1},tc={type:"object",properties:{id:{type:"string"}},required:["id"]},rc={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success"]},ic={type:"object",properties:{eventName:{type:"string"},payload:{type:["object","null","string","number","boolean","array"]}},required:["eventName"]},nc={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},triggered:{type:"array",items:{type:"string"}}},required:["success","triggered"]},oc={type:"object",properties:{name:{type:"string"},order:{type:"number"},trigger:{type:"string"},cwd:{type:"string"},command:{type:"string"},workspace:{type:["object","null"],properties:{name:{type:"string"},path:{type:"string"}},required:["name","path"]},preFlight:{type:["string","null"]},postFlight:{type:["string","null"]},qualityGate:{type:["string","null"]},roleScoped:{type:["object","null"],properties:{allowed:{type:"array",items:{type:"string"}},denied:{type:"array",items:{type:"string"}}}},estimatedDurationSec:{type:["number","null"]},estimatedCostUsd:{type:["number","null"]},estimatedTokens:{type:["number","null"]},matrixParent:{type:"string"}},required:["name","order","trigger","cwd","command"]},ba={type:"object",properties:{success:{type:"boolean"},taskName:{type:"string"},tasks:{type:"array",items:oc},totals:{type:"object",properties:{estimatedDurationSec:{type:["number","null"]},estimatedCostUsd:{type:["number","null"]},estimatedTokens:{type:["number","null"]}},required:[]},warnings:{type:"array",items:{type:"string"}},error:{type:"string"}},required:["success","taskName","tasks","warnings"]},lc={type:"object",properties:{taskName:{type:"string"}},required:["taskName"],additionalProperties:!1},sc={type:"object",properties:{success:{type:"boolean"},reports:{type:"array",items:ba}},required:["success","reports"]},ac={type:"object",properties:{name:{type:"string"},workspaceId:{type:["string","null"]},workspaceName:{type:["string","null"]},status:{type:"string"},error:{type:["string","null"]},finishedAt:{type:["string","null"]}},required:["name","status"]},pc={type:"object",properties:{parentId:{type:"string"}},required:["parentId"],additionalProperties:!1},dc={type:"object",properties:{parentId:{type:"string"},totalCount:{type:"number"},successCount:{type:"number"},errorCount:{type:"number"},pendingCount:{type:"number"},status:{type:"string"},message:{type:"string"},clones:{type:"array",items:ac}},required:["parentId","totalCount","successCount","errorCount","status"]},cc={type:"object",properties:{success:{type:"boolean"},report:dc,error:{type:"string"}},required:["success"]},uc={type:"object",properties:{name:{type:"string"},workspaceIds:{type:"array",items:{type:"string"}},strategy:{type:"string"},failureMode:{type:"string"},aggregation:{type:"string"}},required:["workspaceIds"],additionalProperties:!1},gc={type:"object",properties:{success:{type:"boolean"},clones:{type:"array",items:{type:"object",properties:{name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:["string","null"]}},required:["name","workspaceId"]}},error:{type:"string"}},required:["success","clones"]},fc={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},cancelled:{type:"array",items:{type:"string"}}},required:["success","message","cancelled"]},yc={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},removed:{type:"array",items:{type:"string"}}},required:["success","message","removed"]},xa={type:"object",properties:{name:{type:"string"},dir:{type:"string"},port:{type:["number","null"]},isDefault:{type:"boolean"},active:{type:"boolean"}},required:["name","dir","isDefault","active"]},bc={type:"object",properties:{},additionalProperties:!1},xc={type:"object",properties:{current:{type:"string"},pinnedByEnv:{type:"boolean"},profiles:{type:"array",items:xa}},required:["current","pinnedByEnv","profiles"]},mc={type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1},vc={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},current:{type:"string"},restartRequired:{type:"boolean"}},required:["success","message","current","restartRequired"]},hc={type:"object",properties:{name:{type:"string"},port:{type:"number"}},required:["name"],additionalProperties:!1},$c={type:"object",properties:{success:{type:"boolean"},message:{type:"string"},profile:xa,error:{type:"string"}},required:["success"]},wc={type:"object",properties:{name:{type:"string"}},required:["name"],additionalProperties:!1},_c={type:"object",properties:{success:{type:"boolean"},message:{type:"string"}},required:["success","message"]},kc=Zp.Rpc.define({id:"opencode-windows-scheduler",methods:{get_tasks:{input:rl,output:ed},create_task:{input:td,output:rd},delete_task:{input:id,output:yi},run_task:{input:nd,output:od},pause_task:{input:sa,output:yi},resume_task:{input:sa,output:yi},update_task:{input:Qd,output:Kd},get_task_logs:{input:ld,output:sd},get_history:{input:pd,output:dd},get_metrics:{input:ud,output:gd},get_dashboard_port:{input:fd,output:yd},get_platform:{input:bd,output:xd},dry_run:{input:lc,output:ba},dry_run_all:{input:rl,output:sc},get_matrix_results:{input:pc,output:cc},cancel_matrix:{input:Fn,output:fc},cleanup_matrix_orphans:{input:rl,output:yc},cleanup_history:{input:Cd,output:zd},get_analytics:{input:Td,output:Ed},expand_matrix_preview:{input:uc,output:gc},get_workspaces:{input:Yd,output:Zd},add_workspace:{input:Xd,output:aa},update_workspace:{input:ec,output:aa},delete_workspace:{input:tc,output:rc},get_profiles:{input:bc,output:xc},set_profile:{input:mc,output:vc},create_profile:{input:hc,output:$c},delete_profile:{input:wc,output:_c},export_tasks:{input:md,output:vd},import_tasks:{input:hd,output:$d},get_settings:{input:wd,output:_d},save_settings:{input:kd,output:Sd},get_templates:{input:Fd,output:Wd},save_template:{input:Ud,output:Hd},delete_template:{input:Vd,output:Jd},emit_event:{input:ic,output:nc},test_notification:{input:Pd,output:Ad},send_digest:{input:Md,output:Ld},list_secrets:{input:Id,output:Dd},save_secret:{input:Rd,output:qd},delete_secret:{input:Od,output:jd},get_audit:{input:Nd,output:Gd}},events:{}});var Sc=e.template('<div><div style=display:flex;justify-content:space-between;align-items:center;gap:12px;width:100%><div style=display:flex;align-items:center;gap:12px;flex:1;min-width:0><div style=flex:1;min-width:0><div style=display:flex;align-items:center;gap:6px;min-width:0><div style=font-weight:700;font-size:16px;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis></div></div><div title="Запуски именно этой задачи: успешные / частичные / ошибки и таймауты"style=font-size:12px;color:#a0a0a6;margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>📊 Всего: <!> | ✅ <!> | 🟠 <!> | ❌ </div></div><div style=display:flex;align-items:center;gap:8px;flex-shrink:0;min-width:110px></div></div><div style=display:flex;gap:6px><button></button><button></button><button>📄</button><button>🧪</button><button>📜</button><button>✏️'),Cc=e.template("<span>📦 "),zc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ff9f0a;color:#ff9f0a;background:rgba(255,159,10,0.12)">📦 Matrix (<!>)'),Tc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #8e8e93;color:#b0b0b6;background:rgba(142,142,147,0.12)">↳ matrix '),Ec=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>👁️"),Pc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #5ac8fa;color:#5ac8fa;background:rgba(90,200,250,0.12)">✳ <!> масок'),Ac=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ff9f0a;color:#ff9f0a;background:rgba(255,159,10,0.12)">🔀 git'),Mc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #30d158;color:#30d158;background:rgba(48,209,88,0.12)">📅 <!>/7'),Lc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #64d2ff;color:#64d2ff;background:rgba(100,210,255,0.12)">🌍 '),Ic=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #bf5af2;color:#bf5af2;background:rgba(191,90,242,0.12)">🪟 <!>–'),Dc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #ffd60a;color:#ffd60a;background:rgba(255,214,10,0.12)">⏸ до '),Rc=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>⚡"),qc=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>📡"),Oc=e.template('<span style="font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid #30d158;color:#30d158;background:rgba(48,209,88,0.12)">'),jc=e.template("<span style=font-size:12px;flex-shrink:0;cursor:help;color:#c084fc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:200px>🧠 "),Bc=e.template("<span style=font-size:12px;flex-shrink:0;cursor:help;color:#f5a623;white-space:nowrap>🚀 "),Nc=e.template("<span style=font-size:13px;flex-shrink:0;cursor:help>🔒"),Gc=e.template("<div style=display:flex;flex-direction:column;gap:2px;margin-top:4px;font-size:11px;line-height:1.35><span style=color:#5ac8fa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>🔗 Зависит от: "),Fc=e.template("<div style=display:flex;flex-direction:column;gap:2px;margin-top:4px;font-size:11px;line-height:1.35><span>📦 Matrix: <!>/<!> успешных"),Wc=e.template("<div style=display:flex;align-items:center;gap:8px;font-size:12px;color:#a0a0a6;margin-top:2px><span style=white-space:nowrap;overflow:hidden;text-overflow:ellipsis>"),Uc=e.template("<span>→ "),Hc=e.template("<div style=font-size:12px;color:#f5a623;font-weight:600;white-space:nowrap>🟡 Выполняется: <!> сек"),Vc=e.template("<div style=font-size:12px;font-weight:600;white-space:nowrap>"),Jc=e.template("<button>⛔"),Qc=e.template("<button>🗑"),Kc=e.template('<div style="margin-top:8px;padding:8px 12px;background:#1e1e1e;border:1px solid #333;border-radius:6px;display:flex;flex-direction:column;gap:6px;width:100%"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;align-items:center;gap:6px>📜 История последних запусков<button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),Yc=e.template('<div style="font-size:12px;color:#8e8e93;padding:6px 0">Запусков пока нет.'),Zc=e.template('<div style="display:flex;align-items:flex-start;gap:10px;font-size:12px;color:#e0e0e0;padding:4px 0;border-bottom:1px solid #333"><span style=color:#8e8e93;white-space:nowrap></span><span style=fontWeight:600;whiteSpace:nowrap></span><span style=color:#b0b0b0;white-space:nowrap> мс'),Xc=e.template("<span style=color:#c084fc;white-space:nowrap>🧠 "),eu=e.template("<span style=whiteSpace:nowrap>⚡ pre: "),tu=e.template("<span style=whiteSpace:nowrap>⚡ post: "),ru=e.template("<div style=margin-top:2px;color:#ff6b6b;font-size:11px;white-space:pre-wrap;word-break:break-word>"),iu=e.template('<span title="Запущена следующая задача в цепочке"style=color:#5ac8fa;font-size:11px;white-space:nowrap>🔗 → '),nu=e.template('<div style="margin-top:8px;padding:8px 12px;background:#1e1e1e;border:1px solid #333;border-radius:6px;display:flex;flex-direction:column;gap:6px;width:100%"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;align-items:center;gap:6px>🧪 Dry-Run: <button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),ou=e.template('<div style="font-size:12px;color:#8e8e93;padding:6px 0">Симуляция…'),lu=e.template('<div style="font-size:12px;color:#ff6b6b;padding:6px 0">❌ '),su=e.template("<div style=display:flex;flex-direction:column;gap:4px>"),au=e.template('<div style="font-size:11px;color:#f5a623;padding:4px 0">⚠ '),pu=e.template('<div style="font-size:11px;color:#e0e0e0;padding:4px 0;border-bottom:1px solid #333;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline"><span style=color:#8e8e93;white-space:nowrap>#<!> </span><span style=font-weight:600;white-space:nowrap>🧪 </span><span style=color:#8e8e93;white-space:nowrap>cwd: </span><div style=width:100%;color:#a0a0a6;overflow-wrap:anywhere>$ '),du=e.template("<span style=color:#5ac8fa;white-space:nowrap>📦 "),cu=e.template("<span style=color:#ff9f0a;white-space:nowrap>↳ matrix "),uu=e.template("<span style=cursor:help>🔒"),gu=e.template("<span style=color:#8e8e93;white-space:nowrap>⏱ ~<!> с"),fu=e.template("<span style=color:#8e8e93;white-space:nowrap>· ~<!> ток."),yu=e.template("<span style=color:#8e8e93;white-space:nowrap>· ~$"),bu=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>⚡ pre: "),xu=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>⚡ post: "),mu=e.template("<div style=width:100%;color:#8e8e93;overflow-wrap:anywhere>✅ QG: "),vu=e.template('<div style="font-size:11px;color:#b0b0b0;padding:4px 0">Σ '),hu=e.template('<div><div style=display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap><div style=min-width:0><h2 style=margin:0;font-size:22px;font-weight:800;letter-spacing:0.2px;line-height:1.2;color:#ffffff></h2><div style=margin-top:5px;font-size:11px;font-weight:600;letter-spacing:1.2px;text-transform:uppercase;color:#8e8e93>Local AI CI/CD Orchestrator</div><div title="Суммарные метрики по всем задачам (включая архивные записи метрик)"style=margin-top:4px;font-size:11px;color:#8e8e93>📊 Всего по всем задачам: <!> · ✅ <!> · ❌ </div></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><select title="Фильтр задач по workspace"style="padding:6px 10px;border-radius:999px;cursor:pointer;font-size:12px;border:1px solid #333;background:#1e1e1e;color:#e0e0e0;outline:none;max-width:200px"><option value=all>Все workspace</option><option value=none>Без workspace</option></select><button>👤 </button><button title="Открыть локальный веб-дашборд (фактический порт сервера)"style="display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;transition:background 0.2s ease, border-color 0.2s ease;border:1px solid #333;background:#1e1e1e;color:#e0e0e0">🌐 Открыть дашборд</button><label title="Переключить зимнюю тему"><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>❄️ Зимний режим</label></div></div><div style=display:flex;gap:8px;flex-wrap:wrap;margin-top:8px><button></button><input type=file accept=.json style=display:none><button></button></div><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px><label style=font-size:12px;color:#b0b0b0;font-weight:500;white-space:nowrap>Макс. одновременных задач:</label><input type=number min=0 style="width:60px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93;white-space:nowrap>(0 = без ограничений)</span></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><button style="display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;padding:10px 14px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left"><span>🔔 Уведомления</span><span style=display:flex;align-items:center;gap:8px;font-size:11px;font-weight:400;color:#8e8e93><span></span></span></button></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><button style="display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;box-sizing:border-box;padding:10px 14px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left"><span>🧹 История и ретеншн</span><span style=display:flex;align-items:center;gap:8px;font-size:11px;font-weight:400;color:#8e8e93> · <span></span></span></button></div><div style="width:100%;max-width:900px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><div style="display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px"><button style=display:flex;align-items:center;gap:8px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left;padding:0><span>📜 Журнал аудита</span><span style=font-size:11px;font-weight:400;color:#8e8e93></span><span style=font-size:11px;color:#8e8e93></span></button></div></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><div style="display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px"><span style=font-size:12px;font-weight:600;color:#e0e0e0>Журнал аудита — хранение</span></div><div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap><label style=display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Включить аудит</label></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Удалять записи старше, дней</label><input type=number min=0 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = не удалять по возрасту</span></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Хранить не более записей</label><input type=number min=0 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = без ограничения</span></div></div></div><div style="width:100%;max-width:700px;box-sizing:border-box;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><div style="display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px"><button style=display:flex;align-items:center;gap:8px;background:transparent;border:none;color:#e0e0e0;font-size:12px;font-weight:600;cursor:pointer;text-align:left;padding:0><span>📦 Workspaces</span><span style=font-size:11px;font-weight:400;color:#8e8e93></span><span style=font-size:11px;color:#8e8e93></span></button><button title="Добавить workspace (git-репозиторий)">+ Добавить</button></div></div><div style=display:block;width:100%;margin-top:24px><h3 style=margin:0;margin-bottom:8px;font-size:14px;font-weight:600;color:#ffffff>Задачи'),pa=e.template("<div style=padding:16px;color:#ff3b30;font-size:13px>Ошибка UI: "),da=e.template("<option>📦 "),$u=e.template('<div style="background:#1e1e1e;border:1px solid #333;border-radius:10px;padding:12px 14px;display:flex;flex-direction:column;gap:8px"><div style=display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap><div style=font-size:12px;font-weight:600;color:#e0e0e0>👤 Профили</div><button>+ Создать</button></div><div style=display:flex;flex-direction:column;gap:6px></div><div style=font-size:11px;color:#8e8e93>У каждого профиля своя БД, настройки, логи и порт дашборда. После переключения перезапустите OpenCode.'),wu=e.template("<div style=font-size:11px;color:#ffd60a>Профиль задан переменной OPENCODE_SCHEDULER_PROFILE. Переключение в GUI недоступно."),_u=e.template("<div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px><span></span><span style=font-size:11px;color:#8e8e93></span><span style=font-size:11px;color:#8e8e93;overflow:hidden;text-overflow:ellipsis;max-width:340px>"),ku=e.template("<span style=font-size:11px;color:#34c759>активен"),Su=e.template("<button>Переключить"),Cu=e.template("<button>Удалить"),zu=e.template('<div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><label style=display:flex;align-items:center;gap:8px;font-size:12px;color:#e0e0e0;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Включить уведомления</label><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Только при ошибке</label><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Webhook (Discord / Slack / generic)</label><input type=url placeholder=https://discord.com/api/webhooks/...><div style=font-size:11px;color:#8e8e93>POST с JSON { content, text } — совместимо с Discord и Slack.</div><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;color:#b0b0b0><span>Таймаут, мс:</span><input type=number min=1000 max=120000 step=1000 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>повторов:</span><input type=number min=0 max=5 style="width:56px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>пауза, мс:</span><input type=number min=100 max=60000 step=100 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>Повтор при сетевой ошибке, таймауте, 5xx и 429 (экспоненциальная пауза).</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Telegram</label><input type=password autocomplete=off placeholder="Токен бота из @BotFather"><input type=text placeholder="chat_id (например, 123456789 или -100...)"><div><span>разметка:</span><select style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><option value=HTML>HTML</option><option value=MarkdownV2>MarkdownV2</option><option value=Markdown>Markdown</option><option value>plain text</option></select><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>без звука</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>ссылка на дашборд</label></div><div style=font-size:11px;color:#8e8e93>Токен можно не хранить в settings.json: задайте OPENCODE_SCHEDULER_TELEGRAM_BOT_TOKEN и OPENCODE_SCHEDULER_TELEGRAM_CHAT_ID.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Нативные уведомления ОС</label><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>со звуком</label><div style=font-size:11px;color:#8e8e93>Windows Toast, macOS Notification Center, Linux notify-send. Без внешних зависимостей.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Тихие часы</label><div><span>с</span><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span>до</span><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>В тихие часы success и partial подавляются, ошибки и таймауты отправляются.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Фильтры по задачам</div><input type=text placeholder="Только эти задачи (через запятую, * — маска)"><input type=text placeholder="Исключить задачи (через запятую, * — маска)"><div style=font-size:11px;color:#8e8e93>Пустой список «только» = все задачи. Исключения важнее включений.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Шаблоны сообщений</div><input type=text placeholder="✅ Задача &quot;{task}&quot; выполнена ({duration})"><input type=text placeholder="❌ Задача &quot;{task}&quot; упала ({duration}){error}"><div style=font-size:11px;color:#8e8e93>Плейсхолдеры: {task} {status} {duration} {error} {emoji} {cost} {tokens}. Пусто = шаблон по умолчанию.</div></div><div style="width:100%;max-width:700px;box-sizing:border-box;margin-top:8px;background:#1e1e1e;border:1px solid #333;border-radius:10px;overflow:hidden"><div style="display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 14px"><span style=font-size:12px;font-weight:600;color:#e0e0e0>🔐 Секреты</span><span style=font-size:11px;color:#8e8e93></span></div><div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap><input type=text placeholder="Имя секрета (A-Za-z0-9_.-)"style="width:220px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><input type=password autocomplete=new-password placeholder="Значение (не возвращается при чтении)"style="width:320px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><button></button></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap;overflow:auto></div><div style=font-size:11px;color:#8e8e93>В задачах используйте ссылку <code style=color:#dcdcaa>${secret:NAME}</code> — значение подставляется из хранилища при запуске и маскируется в логах.</div></div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Матрицы</div><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Уведомлять о завершении матриц</label><div><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>partial</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>все упали</label><span>зависший клон, мин:</span><input type=number min=0 max=10080 style="width:72px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"></div><div style=font-size:11px;color:#8e8e93>Клон, выполняющийся дольше указанного времени, уведомляется один раз. 0 — выключить.</div></div><div style="border-top:1px solid #333;padding-top:10px;display:flex;flex-direction:column;gap:8px"><div style=font-size:12px;color:#e0e0e0;font-weight:600>Дайджест</div><label><input type=checkbox style=accent-color:#5ac8fa;cursor:pointer;margin:0>Отправлять дайджест</label><div><select style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><option value=daily>ежедневно</option><option value=weekly>еженедельно (Пн)</option></select><input type=time style="padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93></span></div><div style=font-size:11px;color:#8e8e93>Запуски, success rate, стоимость и топ ошибок за сутки/неделю.</div></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><button></button><button></button><span style=font-size:11px;color:#8e8e93>Каналы: webhook, Telegram, нативные уведомления ОС.'),Tu=e.template('<span style="display:flex;align-items:center;gap:6px;padding:4px 8px;background:#252526;border:1px solid #333;border-radius:4px;font-size:11px;color:#e0e0e0"><span style=font-weight:600;color:#569cd6></span><span style=color:#ce9178>•••• </span><button title=Удалить style="padding:2px 6px;background:#c43b2b;color:white;border:none;border-radius:3px;cursor:pointer;font-size:10px;font-weight:600;line-height:1">×'),Eu=e.template("<span style=font-size:11px;color:#8e8e93>Секретов нет. Значения хранятся зашифрованно в secrets.json."),Pu=e.template('<div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Удалять записи старше, дней</label><input type=number min=0 style="width:70px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = не удалять по возрасту</span></div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Хранить не более записей</label><input type=number min=0 style="width:80px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><span style=font-size:11px;color:#8e8e93>0 = без ограничения</span></div><div style=font-size:11px;color:#8e8e93>Последняя очистка: </div><div style=display:flex;align-items:center;gap:10px;flex-wrap:wrap><button></button><span style=font-size:11px;color:#8e8e93>Удаляются только завершённые записи; незавершённые запуски не трогаются.'),Au=e.template('<div style="padding:0 14px 14px;display:flex;flex-direction:column;gap:10px"><div style=display:flex;align-items:center;gap:8px;flex-wrap:wrap><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Действие</label><input type=text placeholder="например task.create"style="width:150px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Источник</label><input type=text placeholder=mcp/gui/http style="width:110px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><label style=font-size:12px;color:#e0e0e0;white-space:nowrap>Цель</label><input type=text placeholder="имя задачи/секрета"style="width:180px;padding:4px 6px;background:#1e1e1e;border:1px solid #333;border-radius:4px;color:#fff;font-size:12px;outline:none"><button></button></div><div style="width:100%;overflow:auto;border:1px solid #333;border-radius:6px;background:#0f0f0f"><table style=width:100%;border-collapse:collapse;font-size:11px><thead><tr style="border-bottom:1px solid #333"><th style="text-align:left;padding:6px 8px;color:#8e8e93">Время</th><th style="text-align:left;padding:6px 8px;color:#8e8e93">Действие</th><th style="text-align:left;padding:6px 8px;color:#8e8e93">Цель</th><th style="text-align:left;padding:6px 8px;color:#8e8e93">Источник</th><th style="text-align:left;padding:6px 8px;color:#8e8e93">Автор</th><th style="text-align:left;padding:6px 8px;color:#8e8e93">Удалён с</th></tr></thead><tbody></tbody></table></div><div style=font-size:11px;color:#8e8e93>Записываются мутации задач, настроек, шаблонов, профилей, рабочих зон, секретов, импорта и очистки истории. Детали маскируются (секреты заменены на <code style=color:#dcdcaa>***</code>).'),Mu=e.template('<tr style="border-bottom:1px solid #222"><td style="padding:5px 8px;color:#e0e0e0;white-space:nowrap"></td><td style="padding:5px 8px;color:#569cd6"></td><td style="padding:5px 8px;color:#e0e0e0;white-space:nowrap">: </td><td style="padding:5px 8px;color:#ce9178"></td><td style="padding:5px 8px;color:#e0e0e0"></td><td style="padding:5px 8px;color:#8e8e93;white-space:nowrap">'),Lu=e.template('<tr><td colspan=6 style="padding:10px 8px;color:#8e8e93;text-align:center">Записей аудита нет.'),Iu=e.template('<div style="display:flex;flex-direction:column;gap:6px;padding:0 14px 12px">'),Du=e.template('<div style="font-size:12px;color:#8e8e93;padding:4px 0">Workspace не добавлен. Задача без workspace использует рабочую директорию проекта.'),Ru=e.template('<div style="display:flex;align-items:center;gap:10px;padding:8px 10px;background:#252526;border:1px solid #333;border-radius:8px;min-width:0"><span></span><div style=display:flex;flex-direction:column;gap:2px;flex:1;min-width:0><span style=font-size:12px;font-weight:700;color:#ffffff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>📦 </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis></span><span style=font-size:10px;color:#a0a0a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>git: <!> · </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>env: </span></div><div style=display:flex;gap:4px;flex-shrink:0><button title="Env-переменные workspace (секреты маскируются в логах)"style=background:transparent;border:none;color:#a0a0a6;cursor:pointer;font-size:14px;padding:2px>🔑</button><button title="Редактировать workspace"style=background:transparent;border:none;color:#a0a0a6;cursor:pointer;font-size:14px;padding:2px>✏️</button><button title="Удалить workspace (задачи сохраняются)"style=background:transparent;border:none;color:#ff3b30;cursor:pointer;font-size:14px;padding:2px>🗑'),qu=e.template('<button title="Развернуть форму создания задачи"style="display:flex;align-items:center;justify-content:center;gap:8px;width:100%;max-width:700px;box-sizing:border-box;padding:12px 16px;background:#1e1e1e;border:1px dashed #3a3a3a;border-radius:10px;color:#e0e0e0;font-size:13px;font-weight:600;cursor:pointer;transition:border-color 0.18s ease, background 0.18s ease">➕ Создать задачу'),Ou=e.template('<div style="display:block;width:100%;max-width:700px;box-sizing:border-box;background:#1e1e1e;padding:20px;border-radius:10px;box-shadow:0 4px 12px rgba(0,0,0,0.2)"><div style=display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:16px><h3 style=margin:0;font-size:14px;font-weight:600;color:#ffffff></h3><div style=display:flex;align-items:center;gap:8px><button title="Сохранить текущие настройки формы как шаблон"style="background:transparent;border:1px solid #333;border-radius:6px;padding:4px 10px;color:#a0a0a6;font-size:11px;cursor:pointer;white-space:nowrap;transition:color 0.18s ease, border-color 0.18s ease">💾 Сохранить как шаблон</button><button title="Свернуть форму"style="background:transparent;border:1px solid #333;border-radius:6px;padding:4px 10px;color:#a0a0a6;font-size:11px;cursor:pointer;white-space:nowrap;transition:color 0.18s ease, border-color 0.18s ease">Скрыть форму ▴</button></div></div><div style="display:block;width:100%;margin-bottom:12px;padding:10px 12px;background:#1a1a1a;border:1px solid #333;border-radius:8px"><label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;font-weight:600;color:#fff><input type=checkbox style=accent-color:#ff9f0a>📦 Matrix (Fan-Out)</label><div style=font-size:11px;color:#8e8e93;margin-top:4px;line-height:1.45>Задача-шаблон раскладывается на клоны по workspace. Родитель сам не выполняется — он запускает клоны и агрегирует результат.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Имя задачи</label><input type=text placeholder="например, Gui-Test"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Тип триггера</label><div style=display:flex;gap:8px;flex-wrap:wrap><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>По расписанию (Cron)</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>При изменении файла</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>Новый коммит (Git)</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>MCP Event</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=triggerType style=accent-color:#007acc>Разово</label></div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Сессия OpenCode</label><div style=display:flex;gap:8px;flex-wrap:wrap><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Новая</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Переиспользовать</label><label style=display:flex;align-items:center;gap:6px;cursor:pointer;flex:1><input type=radio name=sessionMode style=accent-color:#007acc>Последняя (--continue)</label></div></div><div style=width:100%;marginBottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Расписание</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select><div style=display:block;width:100%;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Часовой пояс (IANA)</label><input type=text list=iana-timezones placeholder="Пусто — системный пояс"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><datalist id=iana-timezones><option value=Europe/Moscow></option><option value=Europe/London></option><option value=Europe/Berlin></option><option value=America/New_York></option><option value=America/Los_Angeles></option><option value=Asia/Almaty></option><option value=Asia/Tokyo></option><option value=UTC></option></datalist><div style=display:block;margin-top:6px;font-size:11px;color:#808080>Другая зона — задача будится каждую минуту, cron проверяется с учётом пояса.</div></div><div style=display:block;width:100%;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Окно запуска (необязательно)</label><div style=display:flex;gap:8px;align-items:center><input type=time title="Начало окна"style="display:block;flex:1;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><span style=color:#808080;font-size:12px>—</span><input type=time title="Конец окна (может быть меньше начала)"style="display:block;flex:1;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;margin-top:6px;font-size:11px;color:#808080>Вне окна запуск переносится на его открытие, а не пропускается. Например 22:00 — 06:00.</div><div style=display:block;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Дни недели (пусто — все дни)</label><div style=display:flex;gap:10px;flex-wrap:wrap></div></div><div style=display:block;margin-top:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Вне окна или в неразрешённый день</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><option value=postpone>Перенести на открытие окна (по умолчанию)</option><option value=skip>Пропустить запуск</option><option value=run>Выполнить всё равно</option></select><div style=display:block;margin-top:6px;font-size:11px;color:#808080>Для cron политика применяется в обёртке, для файловых и git-триггеров — при обработке события. Перенос ждёт не дольше 12 часов.</div></div></div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Промпт</label><textarea placeholder="Напиши краткий отчет о состоянии рынка"rows=2 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical"></textarea></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Шаблон промпта</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Модель LLM</label><input type=text list=scheduler-model-presets placeholder="по умолчанию (как в OpenCode)"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><datalist id=scheduler-model-presets><option value=anthropic/claude-3-5-sonnet></option><option value=openai/gpt-4o></option><option value=deepseek/deepseek-coder></option><option value=google/gemini-2.5-pro></option><option value=openai/gpt-4o-mini></option></datalist><div style=font-size:11px;color:#8e8e93;margin-top:6px>Пусто — модель OpenCode по умолчанию. Иначе будет передан флаг --model.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Приоритет</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></select><div style=font-size:11px;color:#8e8e93;margin-top:6px>Если готовы несколько задач сразу, первой запускается задача с более высоким приоритетом.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Кол-во повторов при ошибке</label><input type=number min=0 placeholder=0 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Задержка перед повтором (сек)</label><input type=number min=1 placeholder=60 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Проверочная команда (Quality Gate)</label><input type=text placeholder="например: npm run test"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Выполняется после успешного ответа ИИ. Ненулевой код = ошибка задачи.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Команда перед запуском (Pre-flight)</label><input type=text placeholder="например: git pull"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Например: git pull или npm install. Выполняется в рабочей директории задачи. Ненулевой код отменяет запуск (Pre-flight script failed).</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Команда после запуска (Post-flight)</label><input type=text placeholder="например: git push"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Например: git push или npm run build. Выполняется в рабочей директории задачи даже при ошибке основной задачи.</div></div><div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Зависит от задач (успешное завершение)</label><div style="display:flex;flex-wrap:wrap;gap:6px;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;min-height:38px;box-sizing:border-box"></div><div style=font-size:11px;color:#8e8e93;margin-top:6px>Задача запустится автоматически, когда все отмеченные задачи завершатся успешно.</div></div><details style=display:block;width:100%;margin-bottom:12px><summary style=cursor:pointer;font-size:12px;color:#b0b0b0;font-weight:500;margin-bottom:8px;user-select:none>🔒 Ограничения инструментов</summary><div style="display:block;width:100%;padding:10px;background:#1e1e1e;border:1px solid #333;border-radius:6px;box-sizing:border-box"><div style=font-size:11px;color:#8e8e93;margin-bottom:8px>⚠ Metadata-only: opencode 2.2.3 не поддерживает allow/deny флаги — ограничения фиксируются в логе и истории. При конфликте приоритет у <b>denied</b>. Пустой allowedTools запрещён.</div><div style=font-size:11px;color:#b0b0b0;margin-bottom:4px>Белый список (allowedTools)</div><div style=display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px></div><div style=font-size:11px;color:#b0b0b0;margin-bottom:4px>Чёрный список (deniedTools)</div><div style=display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px></div><div style=display:flex;gap:6px><input type=text placeholder="свой инструмент, например websearch"style="flex:1;padding:6px 8px;background:#141414;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><button style="padding:6px 10px;background:transparent;border:1px solid #34c759;color:#34c759;border-radius:6px;cursor:pointer;font-size:12px">+ allowed</button><button style="padding:6px 10px;background:transparent;border:1px solid #ff3b30;color:#ff3b30;border-radius:6px;cursor:pointer;font-size:12px">+ denied</button></div></div></details><div style=display:block;width:100%;margin-top:8px><button title="Локальное превью команды по текущим полям формы (без RPC и без запуска)"style="display:block;width:100%;padding:8px;margin-top:4px;background:transparent;border:1px solid #333;border-radius:6px;color:#d4e6ff;cursor:pointer;font-size:12px">🧪 Превью</button><button>'),ju=e.template('<div style=margin-top:10px;display:flex;flex-direction:column;gap:10px><div><div style=font-size:12px;color:#b0b0b0;font-weight:500;margin-bottom:6px>Workspaces (для матрицы) — выбрано </div></div><div style=display:flex;gap:8px;flex-wrap:wrap><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>Стратегия<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=parallel>parallel — все сразу</option><option value=sequential>sequential — по одному</option></select></label><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>При ошибке<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=continue>continue — продолжать</option><option value=stop>stop — остановить</option></select></label><label style=flex:1;min-width:150px;font-size:11px;color:#b0b0b0>Агрегация<select style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"><option value=summary>summary — сводка</option><option value=per-task>per-task — по задачам</option></select></label></div><label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:#e0e0e0><input type=checkbox style=accent-color:#ff9f0a>Создать aggregator-задачу matrix-complete (запустится после всех клонов)</label><label style=font-size:11px;color:#b0b0b0;max-width:240px>Одновременно клонов (concurrency)<input type=number min=1 step=1 style="display:block;width:100%;box-sizing:border-box;margin-top:4px;padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none"></label><div style="padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px;font-size:11px;line-height:1.55;color:#a0a0a6">'),Bu=e.template("<div style=font-size:11px;color:#f5a623>Сначала добавьте хотя бы один workspace."),Nu=e.template('<div style="display:flex;flex-direction:column;gap:4px;max-height:170px;overflow:auto;padding:6px 8px;background:#141414;border:1px solid #333;border-radius:6px">'),Gu=e.template("<label style=display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:#e0e0e0><input type=checkbox style=accent-color:#ff9f0a><span>📦 </span><span style=font-size:10px;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis>"),Fu=e.template('<details style="padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px"><summary style=cursor:pointer;font-size:12px;color:#b0b0b0;font-weight:500>⚙ Настройки по workspace — переопределено </summary><div style=margin-top:8px;display:flex;flex-direction:column;gap:8px;max-height:340px;overflow:auto>'),Wu=e.template('<div style="padding:8px;background:#101010;border:1px solid #2a2a2a;border-radius:6px"><div>📦 <span style=margin-left:6px;font-size:10px;color:#8e8e93></span></div><div style=display:flex;flex-direction:column;gap:6px><textarea rows=2 placeholder="Промпт (по умолчанию — общий промпт формы)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;width:100%;resize:vertical;font-family:inherit"></textarea><div style=display:flex;gap:6px;flex-wrap:wrap><input placeholder="Модель (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"><input placeholder="Quality Gate (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"></div><div style=display:flex;gap:6px;flex-wrap:wrap><input placeholder="beforeScript (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px"><input placeholder="afterScript (override)"style="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box;flex:1;min-width:150px">'),Uu=e.template("<div style=color:#ff9f0a;font-weight:600>Будет создано <!> клон(а/ов):"),Hu=e.template("<div style=color:#e0e0e0;word-break:break-all>"),Vu=e.template("<span style=color:#f5a623>Выберите хотя бы один workspace — превью клонов появится здесь."),Ju=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Workspace (multi-repo)</label><select style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><option value>Без workspace — рабочая директория'),Qu=e.template('<div style="margin-top:8px;padding:8px 10px;background:#141414;border:1px solid #333;border-radius:6px;font-size:11px;line-height:1.55;color:#a0a0a6"><div>cwd = <span style=color:#e0e0e0></span></div><div>git branch = <span style=color:#5ac8fa></span></div><div>git remote = <span style=color:#e0e0e0>'),Ku=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Рабочая директория</label><input type=text placeholder="по умолчанию — папка проекта"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>В этой папке задача запустит opencode run — здесь подхватятся MCP-серверы из opencode.json.'),Yu=e.template(`<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Путь к файлу для отслеживания</label><input type=text placeholder="например, C:\\project\\src\\main.ts"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><label style="display:block;margin:12px 0 6px;font-size:12px;color:#b0b0b0;font-weight:500">Glob-маски (по одной в строке, пусто — любое изменение)</label><textarea rows=3 placeholder="**/*.md
2
+ src/**"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"></textarea><label style="display:block;margin:12px 0 6px;font-size:12px;color:#b0b0b0;font-weight:500">Исключения (glob, по одной в строке)</label><textarea rows=2 placeholder="node_modules/**
3
+ *.log"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace"></textarea><div style=font-size:11px;color:#8e8e93;margin-top:6px>Маски считаются от пути watchPath. Поддерживаются *, **, ? и классы [abc]; маска каталога с /** рекурсивна.`),Zu=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Ветки (glob, через запятую; пусто — любая)</label><input type=text placeholder="main, release/*"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),Xu=e.template(`<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Пути изменений (glob, по одной в строке; пусто — любой файл)</label><textarea rows=3 placeholder="src/**
4
+ **/*.md"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace">`),eg=e.template(`<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Игнорируемые пути (glob, по одной в строке)</label><textarea rows=2 placeholder="docs/**
5
+ *.lock"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;resize:vertical;font-family:ui-monospace,Consolas,monospace">`),tg=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Период опроса, секунды (минимум 5, по умолчанию 60)</label><input type=number min=5 placeholder=60 style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Первый опрос запоминает текущий HEAD без запуска задачи — дальше задача стартует на новом коммите, затронувшем подходящие файлы.'),rg=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>MCP-сервер / источник</label><input type=text placeholder="например, github"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),ig=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Имя события</label><input type=text placeholder="например, github.pr.opened"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),ng=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Фильтр (опционально)</label><input type=text placeholder="например, repo=&quot;my-project&quot; или regex"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>key=value сравнивается с полем payload, иначе фильтр считается regex/подстрокой. События приходят через RPC emit_event.'),og=e.template('<div style=display:block;width:100%;margin-bottom:12px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Время однократного запуска</label><input type=text placeholder="2026-11-14T10:00:00.000Z или локальная дата"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style="font-size:11px;color:#8e8e93;margin:6px 0">Или задержка в секундах от нажатия кнопки «Создать задачу»:</div><input type=number min=1 placeholder="например, 3600"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>Приоритет у runAt: если задано время, delaySeconds игнорируется. После запуска задача больше не повторится.'),lg=e.template('<div style=margin-top:8px><label style=display:block;margin-bottom:6px;font-size:11px;color:#8e8e93>Сколько запусков переживает сессия (sessionMaxRuns, необязательно)</label><input type=number min=1 placeholder="без ограничения"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none"><div style=font-size:11px;color:#8e8e93;margin-top:6px>sessionId генерируется плагином автоматически. При достижении лимита сессия удаляется, следующий запуск начинает чистую сессию.'),Nn=e.template("<option>"),sg=e.template('<div style=display:block;width:100%;margin-top:8px><label style=display:block;margin-bottom:8px;font-size:12px;color:#b0b0b0;font-weight:500>Cron-выражение</label><input type=text placeholder="* * * * *"style="display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none">'),ag=e.template('<div style="display:block;max-height:80px;overflow-y:auto;margin-top:8px;padding:8px;background:#2a1113;border:1px solid #5a1d21;border-radius:6px;font-size:11px;line-height:1.4;color:#ff6b6b;white-space:pre-wrap;word-break:break-word">'),pg=e.template("<label style=display:flex;align-items:center;gap:5px;cursor:pointer;font-size:12px;color:#d0d0d5><input type=checkbox style=accent-color:#007acc>"),dg=e.template('<div style=display:flex;align-items:center;gap:6px;margin-top:8px><span style=font-size:10px;color:#8e8e93>Кастомный шаблон:</span><button title="Удалить шаблон"style=background:transparent;border:none;color:#ff3b30;cursor:pointer;font-size:14px;line-height:1;padding:0>🗑'),cg=e.template("<span style=font-size:11px;color:#ff3b30;font-weight:500;cursor:default>"),ug=e.template("<option>Другой (<!>)"),gg=e.template("<span style=font-size:12px;color:#8e8e93>Других задач пока нет"),il=e.template("<label><input type=checkbox style=margin:0>"),fg=e.template("<span style=color:#5ac8fa;font-size:11px;margin-left:6px>(<!> allowed · <!> denied)"),yg=e.template("<div style=font-size:11px;color:#cfcfd2;margin-top:8px>"),bg=e.template("<div>allowed: [<!>]"),xg=e.template("<div>denied: [<!>]"),mg=e.template('<button style="background:transparent;border:1px solid #333;border-radius:6px;padding:8px 16px;color:#ff3b30;cursor:pointer;font-size:13px;width:100%">Отмена'),vg=e.template('<div style="display:block;width:100%;margin-top:8px;padding:10px;background:#1e1e1e;border:1px solid #333;border-radius:6px"><div style=font-size:12px;font-weight:600;color:#ffffff;display:flex;justify-content:space-between;align-items:center>🧪 Превью (локальное, по полям формы)<button style=background:none;border:none;color:#8e8e93;cursor:pointer;font-size:14px;padding:0>✕'),hg=e.template("<div style=display:flex;flex-direction:column;gap:4px;font-size:11px;color:#e0e0e0;margin-top:6px><div style=overflow-wrap:anywhere>$ </div><div style=color:#8e8e93>cwd: "),$g=e.template("<div style=color:#8e8e93>🔒 allowed=[<!>] · denied=[<!>]"),wg=e.template("<div style=color:#8e8e93>⚡ pre: "),_g=e.template("<div style=color:#8e8e93>⚡ post: "),kg=e.template("<div style=color:#8e8e93>✅ QG: "),Sg=e.template("<div style=color:#f5a623>⚠ "),Cg=e.template("<div style=font-size:11px;color:#8e8e93;margin-bottom:8px>Фильтр: <!> · показано <!> из "),zg=e.template('<div style="display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px 16px;color:#a0a0a6;font-size:13px;gap:10px"><span style=font-size:40px;line-height:1></span><span style=max-width:380px;line-height:1.5>'),Tg=e.template("<div style=display:flex;flex-direction:column;gap:0>"),Eg=e.template('<div style=position:fixed;inset:0;background:rgba(0,0,0,0.55);display:flex;align-items:center;justify-content:center;z-index:2000;padding:20px><div style="width:min(540px,100%);background:#1e1e1e;border:1px solid #444;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:0 12px 40px rgba(0,0,0,0.6)"><div style=font-size:13px;font-weight:600;color:#e0e0e0;white-space:pre-wrap></div><div style=display:flex;justify-content:flex-end;gap:8px><button style="padding:6px 14px;border-radius:6px;border:1px solid #3a3a3a;background:#262626;color:#e0e0e0;font-size:12px;cursor:pointer">Отмена</button><button style="padding:6px 14px;border-radius:6px;border:1px solid #0a84ff;background:#0a84ff;color:#fff;font-size:12px;font-weight:600;cursor:pointer">ОК'),Pg=e.template(`<textarea autofocus rows=6 style="width:100%;box-sizing:border-box;resize:vertical;padding:8px 10px;border-radius:8px;border:1px solid #3a3a3a;background:#141414;color:#e0e0e0;font-family:Menlo, Monaco, 'Courier New', monospace;font-size:12px;outline:none">`),Ag=e.template('<input autofocus style="width:100%;box-sizing:border-box;padding:8px 10px;border-radius:8px;border:1px solid #3a3a3a;background:#141414;color:#e0e0e0;font-size:13px;outline:none">'),Mg=e.template("<div style=font-size:11px;color:#8e8e93>Ctrl+Enter — сохранить, Escape — отмена"),Lg=e.template(`<div style="position:fixed;bottom:16px;left:16px;right:16px;background:#1e1e1e;border:1px solid #333;border-radius:8px;padding:0;max-height:300px;overflow:hidden;display:flex;flex-direction:column;z-index:1000"><div style="display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid #333;background:#252526;border-radius:8px 8px 0 0"><div style=display:flex;align-items:center;gap:8px><span style=font-size:13px;font-weight:600;color:#ffffff>Логи</span><span style=font-size:11px;color:#8e8e93></span></div><button style=background:transparent;border:none;color:#8e8e93;cursor:pointer;font-size:18px;line-height:1;padding:0;width:24px;height:24px;display:flex;align-items:center;justify-content:center>✕</button></div><div style="flex:1;overflow-y:auto;padding:12px;font-family:Menlo, Monaco, 'Courier New', monospace;font-size:11px;line-height:1.5;color:#d4d4d4;background:#1e1e1e;border-radius:0 0 8px 8px">`),Ig=e.template("<div style=white-space:pre-wrap;margin-bottom:2px>"),Dg=e.template(`<div style="padding:16px;display:flex;flex-direction:column;gap:16px;font-size:13px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;color:#e0e0e0;background:#0f0f0f"><h2 style=margin:0;font-size:22px;font-weight:800;color:#ffffff></h2><div style=margin-top:5px;font-size:11px;font-weight:600;letter-spacing:1.2px;text-transform:uppercase;color:#8e8e93>Local AI CI/CD Orchestrator</div><div style="background:#2a1a1a;border:1px solid #ff3b30;border-radius:8px;padding:16px;color:#ff3b30">Произошла ошибка отображения. Попробуйте перезагрузить панель.`);function Rg(c){switch(c){case"running":return"#f5a623";case"success":return"#34c759";case"error":return"#ff3b30";case"partial":return"#ff9f0a";default:return"#8e8e93"}}const et=5;function ca(c){const w=typeof c=="number"&&Number.isFinite(c)?Math.min(10,Math.max(0,Math.floor(c))):et;return w>=10?"Критический":w>=8?"Высокий":w<=3?"Низкий":"Обычный"}const ua=[{value:2,label:"Низкий"},{value:5,label:"Обычный"},{value:8,label:"Высокий"},{value:10,label:"Критический"}];function U(c){return c instanceof Error?c.message:typeof c=="object"&&c!==null&&"message"in c?String(c.message):JSON.stringify(c)}function je(c,w=150){const bt=(c||"").split(/\r?\n/).map(Wn=>Wn.trim()).find(Boolean)??"";return bt.length>w?bt.slice(0,w-1).trimEnd()+"…":bt}function Gn(c){return(c||"").split(/[\r\n,]+/).map(w=>w.trim()).filter(Boolean)}function yt(c){return Array.isArray(c)?c.join(`
6
+ `):""}const nl=[{label:"Каждую минуту",value:"* * * * *"},{label:"Каждый час",value:"0 * * * *"},{label:"Каждый день в 09:00",value:"0 9 * * *"},{label:"Каждый понедельник в 10:00",value:"0 10 * * 1"},{label:"Свое расписание…",value:"__custom__"}],qg=tl.Plugin.define({setup(c){const w=c.client.rpc(kc),[bt,Wn]=o.createSignal([]),[xe,ma]=o.createSignal([]),[Un,va]=o.createSignal(!1),[qt,pl]=o.createSignal("all"),[Ot,tt]=o.createSignal(!1),[xt,rt]=o.createSignal(""),[ha,$a]=o.createSignal([]),[dl,cl]=o.createSignal("default"),[jt,wa]=o.createSignal(!1),[xi,_a]=o.createSignal(!1),[Bt,Nt]=o.createSignal(!1),[ka,ul]=o.createSignal(!1),[Hn,Sa]=o.createSignal(""),[vr,Vn]=o.createSignal("");let mi=null;function it(r,t=""){return mi?.(null),new Promise(n=>{mi=n,Sa(r),Vn(t),ul(!0)})}function mt(r){const t=mi;mi=null,ul(!1),t?.(r)}const[Ca,Gt]=o.createSignal(""),[Jn,Qn]=o.createSignal(null),[hr,gl]=o.createSignal(!1),[fl,vi]=o.createSignal(""),[Kn,za]=o.createSignal({total:0,success:0,error:0}),[hi,yl]=o.createSignal(null),[bl,Ta]=o.createSignal([]),xl=[{label:"Свой промпт",value:"custom",prompt:""},{label:"Ночной сторож (тесты)",value:"night-watch",prompt:"Запусти ночные проверки: прогнали тесты, зафиксируй ошибки и составь краткий отчёт о состоянии репозитория."},{label:"Утренний дайджест",value:"morning-digest",prompt:"Собери утренний дайджест: какие изменения были за ночь, есть ли проваленные сборки, что требует внимания сегодня."},{label:"Гигиена кода",value:"code-hygiene",prompt:"Проведи аудит гигиены кода: найди неиспользуемые импорты, неиспользуемые переменные, лишние зависимости и предложи правки."}],[$r,$i]=o.createSignal("custom"),[wi,Ea]=o.createSignal([]),[Pa,Aa]=o.createSignal(0);setInterval(()=>Aa(r=>r+1),1e3);const[Ma,Yn]=o.createSignal(1),[Te,Zn]=o.createSignal(!1),[v,ml]=o.createSignal(!1),[Xn,vl]=o.createSignal(!0),[me,hl]=o.createSignal(!1),[$l,wl]=o.createSignal(""),[eo,La]=o.createSignal(!0),[_i,_l]=o.createSignal(!1),[kl,Sl]=o.createSignal(1e4),[Cl,zl]=o.createSignal(2),[Tl,El]=o.createSignal(1e3),[Pl,Al]=o.createSignal(""),[Ml,Ll]=o.createSignal(""),[Il,Dl]=o.createSignal(""),[Rl,ql]=o.createSignal(""),[Ft,Ol]=o.createSignal(!0),[jl,Bl]=o.createSignal(!0),[Nl,Gl]=o.createSignal(!0),[Fl,Wl]=o.createSignal(60),[wr,Ul]=o.createSignal(!1),[Hl,Vl]=o.createSignal("daily"),[Jl,Ql]=o.createSignal("09:00"),[to,Ia]=o.createSignal(null),[se,Kl]=o.createSignal(!1),[Yl,Zl]=o.createSignal(""),[Xl,es]=o.createSignal(""),[ts,rs]=o.createSignal("HTML"),[is,ns]=o.createSignal(!1),[os,ls]=o.createSignal(!0),[Da,Ra]=o.createSignal("https://api.telegram.org"),[qa,Oa]=o.createSignal(null),[Ee,ss]=o.createSignal(!1),[as,ps]=o.createSignal(!0),[_r,ds]=o.createSignal(!1),[cs,us]=o.createSignal("22:00"),[gs,fs]=o.createSignal("08:00"),[ki,ys]=o.createSignal(!1),[ro,ja]=o.createSignal([]),[io,Wt]=o.createSignal(!1),[Si,bs]=o.createSignal(""),[Ci,xs]=o.createSignal(""),[no,Ba]=o.createSignal([]),[oo,ms]=o.createSignal(!1),[lo,Na]=o.createSignal(!0),[vs,Ga]=o.createSignal(""),[hs,Fa]=o.createSignal(""),[$s,Wa]=o.createSignal(""),[so,zi]=o.createSignal(!0),[ao,Ti]=o.createSignal(90),[po,Ei]=o.createSignal(1e4),[Pi,Ai]=o.createSignal(30),[Mi,Li]=o.createSignal(5e3),[co,uo]=o.createSignal(null),[ws,go]=o.createSignal(0),[fo,Ua]=o.createSignal(!0),[Ii,_s]=o.createSignal(!1),Ut=new Map;o.onCleanup(()=>{for(const r of Ut.values())clearInterval(r);Ut.clear()});const[yo,Ha]=o.createSignal("Планировщик задач");async function Va(){try{const r=await w.get_platform({});r?.title&&Ha(r.title)}catch(r){console.error("RPC Error (get_platform):",r)}}function ks(r){ml(!!r?.enabled),vl(r?.onlyOnError!==!1),hl(!!r?.webhook?.enabled),wl(r?.webhook?.url??""),Sl(Number(r?.webhook?.timeoutMs??1e4)),zl(Number(r?.webhook?.retryCount??2)),El(Number(r?.webhook?.retryDelayMs??1e3)),Al(r?.templates?.success??""),Ll(r?.templates?.error??""),Dl((r?.filters?.include??[]).join(", ")),ql((r?.filters?.exclude??[]).join(", ")),Ol(r?.matrix?.enabled!==!1),Bl(r?.matrix?.onPartial!==!1),Gl(r?.matrix?.onAllFailed!==!1),Wl(Number(r?.matrix?.stuckAfterMinutes??60)),Ul(!!r?.digest?.enabled),Vl(r?.digest?.frequency==="weekly"?"weekly":"daily"),Ql(r?.digest?.time??"09:00"),Ia(r?.digest?.lastSentAt??null),Kl(!!r?.telegram?.enabled),Zl(r?.telegram?.botToken??""),es(r?.telegram?.chatId??""),rs(r?.telegram?.parseMode??"HTML"),ns(!!r?.telegram?.disableNotification),ls(r?.telegram?.includeDashboardLink!==!1),Ra(r?.telegram?.apiBase??"https://api.telegram.org"),Oa(typeof r?.telegram?.messageThreadId=="number"?r.telegram.messageThreadId:null),ss(!!r?.native?.enabled),ps(r?.native?.sound!==!1),ds(!!r?.quietHours?.enabled),us(r?.quietHours?.from??"22:00"),fs(r?.quietHours?.to??"08:00");const t=r?.audit;zi(t?.enabled!==!1),Ti(Number(t?.retentionDays??90)),Ei(Number(t?.maxRecords??1e4))}async function Ja(){try{const r=await w.get_settings({});Yn(r.maxConcurrent??1),Zn(!!r.winterMode),ks(r.notifications);const t=r.history;Ai(Number(t?.retentionDays??30)),Li(Number(t?.maxRecords??5e3)),uo(t?.lastCleanupAt??null),go(Number(t?.lastCleanupDeleted??0));const n=r.audit;zi(n?.enabled!==!1),Ti(Number(n?.retentionDays??90)),Ei(Number(n?.maxRecords??1e4))}catch(r){console.error("RPC Error (get_settings):",r)}bo(),kr()}function Qa(){const r=t=>t.split(",").map(n=>n.trim()).filter(n=>n.length>0);return{enabled:v(),onlyOnError:Xn(),webhook:{enabled:me(),url:($l()||"").trim(),timeoutMs:Math.max(1e3,Math.min(12e4,Math.floor(Number(kl())||1e4))),retryCount:Math.max(0,Math.min(5,Math.floor(Number(Cl())||0))),retryDelayMs:Math.max(100,Math.min(6e4,Math.floor(Number(Tl())||1e3)))},templates:{success:Pl().trim(),error:Ml().trim()},filters:{include:r(Il()),exclude:r(Rl())},telegram:{enabled:se(),botToken:(Yl()||"").trim(),chatId:(Xl()||"").trim(),parseMode:ts(),disableNotification:is(),messageThreadId:qa(),includeDashboardLink:os(),apiBase:Da()},native:{enabled:Ee(),sound:as()},quietHours:{enabled:_r(),from:(cs()||"22:00").trim(),to:(gs()||"08:00").trim()},matrix:{enabled:Ft(),onPartial:jl(),onAllFailed:Nl(),stuckAfterMinutes:Math.max(0,Math.min(10080,Math.floor(Number(Fl())||0)))},digest:{enabled:wr(),frequency:Hl(),time:(Jl()||"09:00").trim(),lastSentAt:to()},audit:{enabled:so(),retentionDays:ao(),maxRecords:po()}}}function Ss(){return{retentionDays:Math.max(0,Math.floor(Number(Pi())||0)),maxRecords:Math.max(0,Math.floor(Number(Mi())||0)),lastCleanupAt:co(),lastCleanupDeleted:Math.max(0,Math.floor(Number(ws())||0))}}async function Ht(r){try{const t=await w.save_settings(r);if(r.maxConcurrent!==void 0&&Yn(t.maxConcurrent),r.winterMode!==void 0&&Zn(!!t.winterMode),r.notifications!==void 0&&ks(t.notifications),r.history!==void 0){const n=t.history;Ai(Number(n?.retentionDays??30)),Li(Number(n?.maxRecords??5e3)),uo(n?.lastCleanupAt??null),go(Number(n?.lastCleanupDeleted??0))}if(r.audit!==void 0){const n=t.audit;zi(n?.enabled!==!1),Ti(Number(n?.retentionDays??90)),Ei(Number(n?.maxRecords??1e4))}}catch(t){console.error("RPC Error (save_settings):",t),c.toast.show({title:"Не удалось сохранить настройки",variant:"error",description:U(t)})}}async function R(){await Ht({notifications:Qa()})}async function Cs(){await Ht({history:Ss()})}async function Ka(){_s(!0);try{await Ht({history:Ss()});const r=await w.cleanup_history({}),n=(await w.get_settings({})).history;Ai(Number(n?.retentionDays??30)),Li(Number(n?.maxRecords??5e3)),uo(n?.lastCleanupAt??null),go(Number(n?.lastCleanupDeleted??0)),c.toast.show({title:r.success?"Очистка истории завершена":"Очистка не удалась",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (cleanup_history):",r),c.toast.show({title:"Очистка не удалась",variant:"error",description:U(r)})}finally{_s(!1)}}async function bo(){Wt(!0);try{const r=await w.list_secrets({});ja(r?.secrets??[])}catch(r){console.error("RPC Error (list_secrets):",r)}finally{Wt(!1)}}async function Ya(){const r=Si().trim(),t=Ci();if(!(!r||!t)){Wt(!0);try{const n=await w.save_secret({name:r,value:t});n?.success?(bs(""),xs(""),c.toast.show({title:"Секрет сохранён",variant:"success",description:n.message}),bo()):c.toast.show({title:"Секрет не сохранён",variant:"error",description:n?.message??""})}catch(n){console.error("RPC Error (save_secret):",n),c.toast.show({title:"Секрет не сохранён",variant:"error",description:U(n)})}finally{Wt(!1)}}}async function Za(r){Wt(!0);try{const t=await w.delete_secret({name:r});t?.success?(c.toast.show({title:"Секрет удалён",variant:"success",description:t?.message??""}),bo()):c.toast.show({title:"Секрет не удалён",variant:"error",description:t?.message??""})}catch(t){console.error("RPC Error (delete_secret):",t),c.toast.show({title:"Секрет не удалён",variant:"error",description:U(t)})}finally{Wt(!1)}}async function kr(){ms(!0);try{const r=await w.get_audit({action:vs()||void 0,actor:hs()||void 0,target:$s()||void 0,limit:200});r?.success&&Ba(r?.records??[])}catch(r){console.error("RPC Error (get_audit):",r)}finally{ms(!1)}}async function xo(){await Ht({audit:{enabled:so(),retentionDays:ao(),maxRecords:po()}})}async function Xa(){_l(!0);try{await R();const r=await w.test_notification({});c.toast.show({title:r.success?"Тестовое уведомление отправлено":"Тест не удался",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (test_notification):",r),c.toast.show({title:"Тест не удался",variant:"error",description:U(r)})}finally{_l(!1)}}async function ep(){ys(!0);try{await R();const r=await w.send_digest({});c.toast.show({title:r.success?"Дайджест отправлен":"Дайджест не отправлен",variant:r.success?"success":"error",description:r.message})}catch(r){console.error("RPC Error (send_digest):",r),c.toast.show({title:"Дайджест не отправлен",variant:"error",description:U(r)})}finally{ys(!1)}}async function tp(r){Yn(r),await Ht({maxConcurrent:r})}async function rp(r){Zn(r),await Ht({winterMode:r})}const[mo,Di]=o.createSignal(null),[ip,vo]=o.createSignal(!1),[Pe,Ri]=o.createSignal(""),[qi,Vt]=o.createSignal("* * * * *"),[Jt,Qt]=o.createSignal(""),[zs,Sr]=o.createSignal("* * * * *"),[Oi,Cr]=o.createSignal(0),[ji,zr]=o.createSignal(60),[Tr,Er]=o.createSignal(""),[vt,Pr]=o.createSignal(et),[Bi,Ar]=o.createSignal(""),[ht,Mr]=o.createSignal([]),[Ni,Lr]=o.createSignal(""),[Gi,Ir]=o.createSignal(""),[re,Be]=o.createSignal("cron"),[ho,Dr]=o.createSignal(""),[$o,Fi]=o.createSignal(""),[Wi,Ui]=o.createSignal(""),[Ne,Kt]=o.createSignal("new"),[Rr,Hi]=o.createSignal(""),[Vi,qr]=o.createSignal(""),[Ji,Or]=o.createSignal(""),[Qi,jr]=o.createSignal(""),[Br,wo]=o.createSignal([]),[Ts,_o]=o.createSignal("postpone"),[Es,ko]=o.createSignal(""),[Ps,So]=o.createSignal(""),[As,Co]=o.createSignal(""),[Ms,zo]=o.createSignal(""),[Ls,To]=o.createSignal(""),[Ki,Eo]=o.createSignal(""),[Po,Nr]=o.createSignal(""),[Ao,Gr]=o.createSignal(""),[Fr,Wr]=o.createSignal(""),[Ur,Yt]=o.createSignal(""),[ie,Zt]=o.createSignal([]),[ne,Xt]=o.createSignal([]),[Is,Ds]=o.createSignal(""),[Ge,Yi]=o.createSignal(!1),[Fe,Hr]=o.createSignal([]),[Mo,Zi]=o.createSignal("parallel"),[Rs,Xi]=o.createSignal("continue"),[qs,en]=o.createSignal("summary"),[Os,tn]=o.createSignal(!1),[rn,nn]=o.createSignal(""),[Lo,on]=o.createSignal({}),[Vr,Io]=o.createSignal(!1),[Do,js]=o.createSignal(!1),[oe,Jr]=o.createSignal(null),[Qr,Ro]=o.createSignal(""),Bs=["bash","edit","write","read","grep","glob","webfetch"];function Ns(r,t){r==="allowed"?Zt(n=>n.includes(t)?n.filter(p=>p!==t):[...n,t]):Xt(n=>n.includes(t)?n.filter(p=>p!==t):[...n,t])}function Gs(r){const t=Is().trim();t&&(r==="allowed"?ie().includes(t)||Zt([...ie(),t]):ne().includes(t)||Xt([...ne(),t]),Ds(""))}function np(r,t){Hr(n=>t?n.includes(r)?n:[...n,r]:n.filter(p=>p!==r))}function qo(r,t){const n=r.trim()||"task",p=t.trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-");return`${n}-matrix-${p||"workspace"}`}const Oo=()=>Fe().map(r=>xe().find(t=>t.id===r)).filter(r=>!!r).map(r=>qo(Pe(),r.name));function Kr(r,t,n){on(p=>{const H={...p[r]??{}};n.trim()?H[t]=n:delete H[t];const Y={...p};return Object.keys(H).length>0?Y[r]=H:delete Y[r],Y})}const op=()=>Object.keys(Lo()).length,Fs=()=>{if(!Ge())return;const r=rn().trim(),t=r?Number(r):void 0,n=Lo();return{workspaceIds:Fe(),strategy:Mo(),failureMode:Rs(),aggregation:qs(),createAggregator:Os(),...t!==void 0&&Number.isFinite(t)&&t>=1?{concurrency:Math.floor(t)}:{},...Object.keys(n).length>0?{overrides:n}:{}}},Ws=()=>{const r=Ki().trim(),t=r?Number(r):void 0;return{activeDays:Br().length>0?Br():void 0,windowPolicy:Ts(),watchGlobs:Gn(Es()),watchIgnore:Gn(Ps()),gitBranch:(As()||"").trim(),gitPaths:Gn(Ms()),gitIgnore:Gn(Ls()),...t!==void 0&&Number.isFinite(t)&&t>=5?{gitPollSeconds:Math.floor(t)}:{}}};function ln(){Yi(!1),Hr([]),Zi("parallel"),Xi("continue"),en("summary"),tn(!1),nn(""),on({})}function lp(){const r=Tr().trim()?` --model ${Tr().trim()}`:"",t=Ne()==="last"?" --continue":Ne()==="reuse"?" --session <id>":"";return`opencode run${r}${t} "${Jt().replace(/\s+/g," ").trim()}"`}const[Og,sp]=o.createSignal(null),[sn,Us]=o.createSignal(!1),[an,jg]=o.createSignal(!1),[Bg,ap]=o.createSignal(null);async function pp(){Us(!0);try{const r=await w.export_tasks({});if(!r.success){c.toast.show({title:"Ошибка экспорта",variant:"error",description:r.error});return}sp(r.data);const t=new Blob([r.data],{type:"application/json"}),n=URL.createObjectURL(t),p=document.createElement("a");p.href=n,p.download=`windows-scheduler-tasks-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(n),c.toast.show({title:`Экспортировано задач: ${r.count}`,variant:"success"})}catch(r){console.error("RPC Error (export_tasks):",r),c.toast.show({title:"Ошибка экспорта",variant:"error",description:U(r)})}finally{Us(!1)}}function dp(r){const n=r.target.files?.[0]??null;ap(n)}async function jo(){try{const r=await w.get_templates({}),t=Array.isArray(r?.templates)?r.templates:[];Ea(t)}catch(r){console.error("RPC Error (get_templates):",r)}}async function Yr(){try{const r=await w.get_workspaces({}),t=Array.isArray(r?.workspaces)?r.workspaces:[];ma(t)}catch(r){console.error("RPC Error (get_workspaces):",r)}}const Zr=()=>xe().find(r=>r.id===xt());async function pn(){try{const r=await w.get_profiles({}),t=Array.isArray(r?.profiles)?r.profiles:[];$a(t),r?.current&&cl(r.current),wa(!!r?.pinnedByEnv)}catch(r){console.error("RPC Error (get_profiles):",r)}}async function cp(r){if(!(!r||r===dl())){Nt(!0);try{const t=await w.set_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось переключить профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}cl(t.current??r),c.toast.show({title:"Профиль переключён",variant:"success",description:t.message}),await pn()}catch(t){console.error("RPC Error (set_profile):",t),c.toast.show({title:"Ошибка переключения профиля",variant:"error",description:je(U(t))})}finally{Nt(!1)}}}async function up(){const r=(await it("Имя нового профиля (латиница, цифры, - и _)","")??"").trim();if(r){Nt(!0);try{const t=await w.create_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось создать профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}await pn(),c.toast.show({title:"Профиль создан",variant:"success",description:t.message})}catch(t){console.error("RPC Error (create_profile):",t),c.toast.show({title:"Ошибка создания профиля",variant:"error",description:je(U(t))})}finally{Nt(!1)}}}async function gp(r){if(!(!r||r==="default")&&window.confirm(`Удалить профиль "${r}" вместе с его БД, настройками и логами?`)){Nt(!0);try{const t=await w.delete_profile({name:r});if(!t.success){c.toast.show({title:"Не удалось удалить профиль",variant:"error",description:t.message??"Неизвестная ошибка"});return}await pn(),c.toast.show({title:"Профиль удалён",variant:"success"})}catch(t){console.error("RPC Error (delete_profile):",t),c.toast.show({title:"Ошибка удаления профиля",variant:"error",description:je(U(t))})}finally{Nt(!1)}}}function fp(r){return r?Object.entries(r).map(([t,n])=>`${t}=${n}`).join(`
7
+ `):""}function yp(r){const t={};for(const n of r.split(/\r?\n/)){const p=n.trim();if(!p||p.startsWith("#"))continue;const H=p.indexOf("=");if(H<=0)return null;const Y=p.slice(0,H).trim();if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(Y))return null;t[Y]=p.slice(H+1).trim()}return t}async function bp(r){const t=await it(`Env-переменные workspace, по одной в строке KEY=VALUE
8
+ (пустое поле — очистить)`,fp(r.env));if(t===null)return;const n=yp(t);if(!n){c.toast.show({title:"Неверный формат env",variant:"error",description:"Нужны строки KEY=VALUE, имя — латиница/цифры/_"});return}const p=await it("Путь к .env-файлу workspace (необязательно, пусто — без файла)",r.envFile??"");if(p!==null){tt(!0);try{const H=await w.update_workspace({id:r.id,env:Object.keys(n).length?n:null,envFile:p.trim()||null});if(!H.success){c.toast.show({title:"Не удалось сохранить env",variant:"error",description:H.error??"Неизвестная ошибка"});return}await Yr(),c.toast.show({title:"Env-переменные сохранены",variant:"success",description:"Секреты маскируются в логах"})}catch(H){console.error("RPC Error (update_workspace env):",H),c.toast.show({title:"Ошибка сохранения env",variant:"error",description:je(U(H))})}finally{tt(!1)}}}async function xp(){const r=(await it("Путь к git-репозиторию (workspace)","")??"").trim();if(!r)return;const t=(await it("Название workspace (необязательно)","")??"").trim();tt(!0);try{const n=await w.add_workspace({path:r,...t?{name:t}:{}});if(!n.success){c.toast.show({title:"Ошибка добавления workspace",variant:"error",description:n.error??"Неизвестная ошибка"});return}await Yr(),n.workspace?.id&&rt(n.workspace.id),c.toast.show({title:"Workspace добавлен",variant:"success"})}catch(n){console.error("RPC Error (add_workspace):",n),c.toast.show({title:"Ошибка добавления workspace",variant:"error",description:je(U(n))})}finally{tt(!1)}}async function mp(r){const t=(await it("Путь к git-репозиторию",r.path)??"").trim();if(!t)return;const n=(await it("Название workspace",r.name)??"").trim();tt(!0);try{const p=await w.update_workspace({id:r.id,path:t,...n?{name:n}:{}});if(!p.success){c.toast.show({title:"Ошибка обновления workspace",variant:"error",description:p.error??"Неизвестная ошибка"});return}await Yr(),c.toast.show({title:"Workspace обновлён",variant:"success"})}catch(p){console.error("RPC Error (update_workspace):",p),c.toast.show({title:"Ошибка обновления workspace",variant:"error",description:je(U(p))})}finally{tt(!1)}}async function vp(r){if(window.confirm(`Удалить workspace "${r.name}"? Задачи сохранены, привязка будет очищена.`)){tt(!0);try{const t=await w.delete_workspace({id:r.id});if(!t.success){c.toast.show({title:"Ошибка удаления workspace",variant:"error",description:t.message??"Неизвестная ошибка"});return}xt()===r.id&&rt(""),qt()===r.id&&pl("all"),await Yr(),await Ae(),c.toast.show({title:"Workspace удалён",variant:"success",description:t.message})}catch(t){console.error("RPC Error (delete_workspace):",t),c.toast.show({title:"Ошибка удаления workspace",variant:"error",description:je(U(t))})}finally{tt(!1)}}}const hp=r=>{if($i(r),r.startsWith("custom:")){const n=wi().find(p=>`custom:${p.id}`===r);if(!n)return;if(Qt(n.prompt??""),n.schedule){Vt(n.schedule);const p=nl.find(H=>H.value===n.schedule);Sr(p?p.value:"__custom__")}if(Cr(n.retryCount??0),zr(n.retryDelay??60),Ar(n.qualityGate??""),Er(n.model??""),Pr(typeof n.priority=="number"?n.priority:et),Mr(Array.isArray(n.dependsOn)?n.dependsOn:[]),Lr(n.beforeScript??""),Ir(n.afterScript??""),Be(n.triggerType==="file"?"file":n.triggerType==="git"?"git":n.triggerType==="mcp-event"?"mcp-event":"cron"),Dr(n.watchPath??""),ko(yt(n.watchGlobs)),So(yt(n.watchIgnore)),Co(n.gitBranch??""),zo(yt(n.gitPaths)),To(yt(n.gitIgnore)),Eo(n.gitPollSeconds?String(n.gitPollSeconds):""),wo(Array.isArray(n.activeDays)?n.activeDays:[]),_o(n.windowPolicy??"postpone"),qr(n.timezone??""),Or(n.notBefore??""),jr(n.notAfter??""),Nr(n.mcpEvent?.server??""),Gr(n.mcpEvent?.event??""),Wr(n.mcpEvent?.filter??""),Yt(n.workingDirectory??""),rt(n.workspaceId??""),Zt(Array.isArray(n.allowedTools)?n.allowedTools:[]),Xt(Array.isArray(n.deniedTools)?n.deniedTools:[]),n.matrix){Yi(!0),Hr(Array.isArray(n.matrix.workspaceIds)?n.matrix.workspaceIds:[]),Zi(n.matrix.strategy==="sequential"?"sequential":"parallel"),Xi(n.matrix.failureMode==="stop"?"stop":"continue"),en(n.matrix.aggregation==="per-task"?"per-task":"summary"),tn(!!n.matrix.createAggregator),nn(typeof n.matrix.concurrency=="number"?String(n.matrix.concurrency):"");const p=n.matrix.overrides;on(p?{...p}:{})}else ln();return}const t=xl.find(n=>n.value===r);t&&Qt(t.prompt)};async function $p(){if(!(Jt()||"").trim()){c.toast.show({title:"Нечего сохранять",variant:"error",description:"Сначала заполните промпт — он обязателен для шаблона."});return}const r=(await it("Название шаблона","")??"").trim();if(r)try{const t=await w.save_template({name:r,prompt:(Jt()||"").trim(),schedule:(qi()||"").trim(),timeoutSeconds:3600,model:(Tr()||"").trim(),priority:vt(),retryCount:Oi(),retryDelay:ji(),qualityGate:(Bi()||"").trim(),beforeScript:(Ni()||"").trim(),afterScript:(Gi()||"").trim(),dependsOn:ht(),triggerType:re(),timezone:(Vi()||"").trim()||void 0,notBefore:(Ji()||"").trim()||void 0,notAfter:(Qi()||"").trim()||void 0,mcpEvent:re()==="mcp-event"?{server:(Po()||"").trim(),event:(Ao()||"").trim(),...Fr().trim()?{filter:Fr().trim()}:{}}:void 0,watchPath:(ho()||"").trim(),...Ws(),workingDirectory:(Ur()||"").trim(),workspaceId:(xt()||"").trim()||void 0,allowedTools:ie().length>0?ie():void 0,deniedTools:ne().length>0?ne():void 0,matrix:Fs()});if(!t.success){c.toast.show({title:"Не удалось сохранить шаблон",variant:"error",description:t.error||"Неизвестная ошибка"});return}await jo();const n=t.template;n?.id&&$i(`custom:${n.id}`),c.toast.show({title:`Шаблон "${r}" сохранён`,variant:"success"})}catch(t){console.error("RPC Error (save_template):",t),c.toast.show({title:"Ошибка сохранения шаблона",variant:"error",description:U(t)})}}async function wp(r){if(window.confirm(`Удалить шаблон "${r.name}"?`))try{const t=await w.delete_template({id:r.id});if(!t.success){c.toast.show({title:"Не удалось удалить шаблон",variant:"error",description:t.error||"Неизвестная ошибка"});return}$r()===`custom:${r.id}`&&$i("custom"),await jo(),c.toast.show({title:`Шаблон "${r.name}" удалён`,variant:"success"})}catch(t){console.error("RPC Error (delete_template):",t),c.toast.show({title:"Ошибка удаления шаблона",variant:"error",description:U(t)})}}async function Ae(){try{const r=await w.get_tasks({});console.log("[GUI] Received tasks:",r);const t=Array.isArray(r?.tasks)?r.tasks:[];console.log("[GUI] tasks count:",t.length);const n=t.map(p=>({name:p.name,schedule:p.schedule,status:p.status??"unknown",runsTotal:typeof p.runsTotal=="number"?p.runsTotal:0,runsSuccess:typeof p.runsSuccess=="number"?p.runsSuccess:0,runsError:typeof p.runsError=="number"?p.runsError:0,runsPartial:typeof p.runsPartial=="number"?p.runsPartial:0,nextRun:p.nextRun??void 0,paused:!!p.paused,orphaned:!!p.orphaned,retryCount:p.retryCount??0,retryDelay:p.retryDelay??60,qualityGate:p.qualityGate??void 0,dependsOn:Array.isArray(p.dependsOn)?p.dependsOn:void 0,model:p.model??void 0,priority:typeof p.priority=="number"?p.priority:et,beforeScript:p.beforeScript??void 0,afterScript:p.afterScript??void 0,triggerType:p.triggerType??"cron",runAt:p.runAt??void 0,session:p.session??void 0,sessionMaxRuns:p.sessionMaxRuns??void 0,mcpEvent:p.mcpEvent??void 0,watchPath:p.watchPath??void 0,timezone:p.timezone??void 0,notBefore:p.notBefore??void 0,notAfter:p.notAfter??void 0,pausedUntil:p.pausedUntil??void 0,workingDirectory:p.workingDirectory??void 0,workspaceId:p.workspaceId??void 0,workspaceName:p.workspaceName??void 0,workspaceColor:p.workspaceColor??void 0,allowedTools:Array.isArray(p.allowedTools)?p.allowedTools:void 0,deniedTools:Array.isArray(p.deniedTools)?p.deniedTools:void 0,matrix:p.matrix??null,matrixParentId:p.matrixParentId??null,isMatrixParent:!!p.isMatrixParent,matrixSummary:p.matrixSummary??null,prompt:p.prompt??""}));Wn(n),console.log("[GUI] jobs:",bt()),await _p()}catch(r){console.error("RPC Error (get_tasks):",r),c.toast.show({title:"Ошибка загрузки задач",variant:"error",description:je(U(r))})}}async function _p(){try{const r=await w.get_metrics({});za({total:r.total??0,success:r.success??0,error:r.error??0})}catch(r){console.error("RPC Error (get_metrics):",r)}}async function kp(r){yl(r);try{const t=await w.get_history({limit:10,taskName:r});Ta(t.records??[])}catch(t){console.error("RPC Error (get_history):",t),c.toast.show({title:"Ошибка загрузки истории",variant:"error",description:U(t)})}}async function Sp(r){Io(!0),Ro(r),js(!0),Jr(null);try{const t=await w.dry_run({taskName:r});Jr(t)}catch(t){console.error("RPC Error (dry_run):",t),Jr({success:!1,error:U(t),tasks:[],warnings:[]})}finally{js(!1)}}function Hs(){Io(!1),Ro(""),Jr(null)}async function Cp(){gl(!0),vi("");try{const r=await w.create_task({name:(Pe()||"").trim(),schedule:(qi()||"").trim(),prompt:(Jt()||"").trim(),model:(Tr()||"").trim(),priority:vt(),retryCount:Oi(),retryDelay:ji(),qualityGate:(Bi()||"").trim(),beforeScript:(Ni()||"").trim(),afterScript:(Gi()||"").trim(),dependsOn:ht(),triggerType:re(),session:Ne(),...Ne()==="reuse"&&(Rr()||"").trim()?{sessionMaxRuns:Number((Rr()||"").trim())}:{},...re()==="once"?{runAt:($o()||"").trim()||void 0,delaySeconds:(Wi()||"").trim()?Number(Wi().trim()):void 0}:{},timezone:(Vi()||"").trim()||void 0,notBefore:(Ji()||"").trim()||void 0,notAfter:(Qi()||"").trim()||void 0,mcpEvent:re()==="mcp-event"?{server:(Po()||"").trim(),event:(Ao()||"").trim(),...Fr().trim()?{filter:Fr().trim()}:{}}:void 0,watchPath:(ho()||"").trim(),...Ws(),workingDirectory:(Ur()||"").trim(),workspaceId:(xt()||"").trim()||void 0,allowedTools:ie().length>0?ie():void 0,deniedTools:ne().length>0?ne():void 0,matrix:Fs()});if(!r.success){const t=je(r.message);vi(t),c.toast.show({title:"Ошибка создания задачи",variant:"error",description:t});return}await new Promise(t=>setTimeout(t,500)),await Ae(),Ri(""),Vt("* * * * *"),Qt(""),Sr("* * * * *"),Cr(0),zr(60),Ar(""),Mr([]),Er(""),Pr(et),Lr(""),Ir(""),Be("cron"),Dr(""),Fi(""),Ui(""),Kt("new"),Hi(""),qr(""),Or(""),jr(""),Nr(""),Gr(""),Wr(""),Yt(""),rt(""),Zt([]),Xt([]),ln(),Di(null),$i("custom"),c.toast.show({title:"Задача создана",variant:"success"})}catch(r){console.error("RPC Error (create_task):",r);const t=je(U(r));vi(t),c.toast.show({title:"Ошибка создания задачи",variant:"error",description:t})}finally{gl(!1)}}function zp(r){const t=new Date().toISOString(),n=Ut.get(r);n&&clearInterval(n);let p=0;const H=setInterval(()=>{if(p+=1,p>900){clearInterval(H),Ut.delete(r);return}(async()=>{try{const Me=((await w.get_history({limit:50})).records??[]).find($t=>String($t.taskName??"").toLowerCase()===r.toLowerCase()&&typeof $t.startedAt=="string"&&$t.startedAt>=t);if(!Me)return;clearInterval(H),Ut.delete(r);const he=Me.status==="success",er=((Number(Me.durationMs)||0)/1e3).toFixed(1),ei=Me.error?`: ${Me.error}`:"";c.toast.show({title:he?`Задача "${r}" выполнена`:`Задача "${r}" упала`,variant:he?"success":"error",description:`${er}s${ei}`}),await Ae()}catch(Y){console.error("RPC Error (get_history):",Y)}})()},2e3);Ut.set(r,H)}async function Tp(r){if(!r||typeof r!="string"){console.error("[GUI] run_task aborted: empty task name");return}try{const t=await w.run_task({name:r});if(!t.success){c.toast.show({title:`Не удалось запустить "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:t.message||`Задача "${r}" запущена`,variant:"success"}),/уже выполняется/i.test(t.message||"")||zp(r),await Ae()}catch(t){console.error("RPC Error (run_task):",t),c.toast.show({title:"Ошибка запуска",variant:"error",description:U(t)})}}async function Ep(r){try{const t=await w.pause_task({name:r});if(!t.success){c.toast.show({title:`Не удалось поставить на паузу "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:`Задача "${r}" поставлена на паузу`,variant:"success"}),await Ae()}catch(t){console.error("RPC Error (pause_task):",t),c.toast.show({title:"Ошибка паузы",variant:"error",description:U(t)})}}async function Pp(r){try{const t=await w.resume_task({name:r});if(!t.success){c.toast.show({title:`Не удалось возобновить "${r}"`,variant:"error",description:t.message});return}c.toast.show({title:`Задача "${r}" возобновлена`,variant:"success"}),await Ae()}catch(t){console.error("RPC Error (resume_task):",t),c.toast.show({title:"Ошибка возобновления",variant:"error",description:U(t)})}}async function Ap(r){if(window.confirm(`Отменить выполняющиеся клоны матрицы "${r}"?`))try{const t=await w.cancel_matrix({name:r});if(!t.success){c.toast.show({title:"Не удалось отменить матрицу",variant:"error",description:t.message});return}c.toast.show({title:t.message,variant:"success"}),await Ae()}catch(t){console.error("RPC Error (cancel_matrix):",t),c.toast.show({title:"Ошибка отмены матрицы",variant:"error",description:U(t)})}}async function Mp(r){const n=bt().find(p=>p.name===r)?.matrix?`Удалить матрицу "${r}" вместе со всеми клонами и агрегатором?`:`Удалить задачу "${r}"?`;if(window.confirm(n))try{const p=await w.delete_task({name:r});if(!p.success){c.toast.show({title:"Ошибка удаления",variant:"error",description:p.message});return}c.toast.show({title:`Задача "${r}" удалена`,variant:"success"}),Jn()===r&&(Gt(""),Qn(null)),mo()?.name===r&&Di(null),await Ae()}catch(p){console.error("RPC Error (delete_task):",p),c.toast.show({title:"Ошибка удаления",variant:"error",description:U(p)})}}async function Lp(r){Qn(r),Gt("Загрузка логов…");try{const t=await w.get_task_logs({name:r});if(!t.success){Gt(t.error||"Не удалось загрузить логи"),c.toast.show({title:"Ошибка чтения логов",variant:"error",description:t.error});return}Gt(t.logs||"(пусто)")}catch(t){console.error("RPC Error (get_task_logs):",t),Gt("Ошибка чтения логов: "+U(t))}}function Ip(r){Di(r),vo(!1),Ri(r.name),Vt(r.schedule),Qt(r.prompt??""),Er(r.model??""),Pr(typeof r.priority=="number"?r.priority:et),Cr(r.retryCount??0),zr(r.retryDelay??60),Ar(r.qualityGate??""),Mr(Array.isArray(r.dependsOn)?r.dependsOn:[]),Lr(r.beforeScript??""),Ir(r.afterScript??""),Be(r.triggerType??"cron"),Dr(r.watchPath??""),ko(yt(r.watchGlobs)),So(yt(r.watchIgnore)),Co(r.gitBranch??""),zo(yt(r.gitPaths)),To(yt(r.gitIgnore)),Eo(typeof r.gitPollSeconds=="number"?String(r.gitPollSeconds):""),wo(Array.isArray(r.activeDays)?r.activeDays:[]),_o(r.windowPolicy??"postpone"),Fi(r.runAt??""),Ui(""),Kt(r.session==="reuse"||r.session==="last"?r.session:"new"),Hi(typeof r.sessionMaxRuns=="number"?String(r.sessionMaxRuns):""),qr(r.timezone??""),Or(r.notBefore??""),jr(r.notAfter??""),Nr(r.mcpEvent?.server??""),Gr(r.mcpEvent?.event??""),Wr(r.mcpEvent?.filter??""),Yt(r.workingDirectory??""),rt(r.workspaceId??""),Zt(Array.isArray(r.allowedTools)?r.allowedTools:[]),Xt(Array.isArray(r.deniedTools)?r.deniedTools:[]),r.matrix?(Yi(!0),Hr(Array.isArray(r.matrix.workspaceIds)?r.matrix.workspaceIds:[]),Zi(r.matrix.strategy==="sequential"?"sequential":"parallel"),Xi(r.matrix.failureMode==="stop"?"stop":"continue"),en(r.matrix.aggregation==="per-task"?"per-task":"summary"),tn(!!r.matrix.createAggregator),nn(typeof r.matrix.concurrency=="number"?String(r.matrix.concurrency):""),on(r.matrix.overrides?{...r.matrix.overrides}:{})):ln();const t=nl.find(n=>n.value===r.schedule);Sr(t?t.value:"__custom__")}Ae(),Yr(),pn(),Ja(),Va(),jo();const Dp=setInterval(Ae,5e3);o.onCleanup(()=>clearInterval(Dp));const Rp=zs()==="__custom__",Bo=mo()!==null,qp=()=>{const r=(Vi()||"").trim();if(!r)return!0;try{return new Intl.DateTimeFormat("en-US",{timeZone:r}),!0}catch{return!1}},No=(r,t,n)=>Number.isInteger(r)&&r>=t&&(n===void 0||r<=n),Vs=()=>{const r=(Pe()||"").trim();if(!r)return"Укажите имя задачи.";if(!(Jt()||"").trim())return"Укажите промпт.";if(re()==="cron"&&!(qi()||"").trim())return"Укажите cron-расписание.";if(re()==="once"&&!($o()||"").trim()&&!(Wi()||"").trim())return"Укажите время запуска или задержку.";if(re()==="git"&&!(xt()||"").trim()&&!(Ur()||"").trim())return"Для git-триггера выберите workspace или укажите рабочую директорию.";if((Ki()||"").trim()&&!/^([5-9]|[1-9]\d+)$/.test(Ki().trim()))return"Период опроса git — целое число секунд не меньше 5.";if(Ge()&&Fe().length===0)return"Выберите хотя бы один workspace для матрицы.";if(Ne()==="reuse"&&(Rr()||"").trim()&&!/^[1-9]\d*$/.test(Rr().trim()))return"Лимит запусков сессии — целое положительное число.";if(Ge()&&(rn()||"").trim()&&!/^[1-9]\d*$/.test(rn().trim()))return"Concurrency матрицы — целое положительное число.";if((Ji()||"").trim()===""!=((Qi()||"").trim()===""))return"Окно запуска задаётся только парой «с/по».";if(!qp())return"Неизвестная таймзона. Укажите IANA-пояс, например Europe/Moscow.";if(!No(vt(),0,10))return"Приоритет — целое число от 0 до 10.";if(!No(Oi(),0))return"Количество повторов — целое число ≥ 0.";if(!No(ji(),0))return"Задержка повтора — целое число секунд ≥ 0.";const t=r.toLowerCase();return ht().some(n=>n.trim().toLowerCase()===t)?"Задача не может зависеть от самой себя.":""},dn=()=>Vs()==="",Xr=()=>bt()??[],Go=()=>{const r=qt();return r==="all"?Xr():r==="none"?Xr().filter(t=>!t.workspaceId):Xr().filter(t=>t.workspaceId===r)},Js=()=>{const r=(mo()?.name??Pe()).trim().toLowerCase();return Xr().map(t=>t.name).filter(t=>t.trim().toLowerCase()!==r)};function Op(r,t){Mr(n=>t?n.some(p=>p.toLowerCase()===r.toLowerCase())?n:[...n,r]:n.filter(p=>p.toLowerCase()!==r.toLowerCase()))}const[jp,Qs]=o.createSignal(null);function nt(r=!1){return`background:${r?"rgba(90,200,250,0.16)":"transparent"};border:1px solid ${r?"rgba(90,200,250,0.5)":"#333"};border-radius:6px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;color:${r?"#5ac8fa":"#cfcfd2"};font-size:14px;line-height:1;padding:0;transition:background 0.18s ease, border-color 0.18s ease, color 0.18s ease`}function ae(r,t,n=!1){const p=r.currentTarget;p&&(p.style.background=t?"rgba(255,255,255,0.09)":n?"rgba(90,200,250,0.16)":"transparent",p.style.borderColor=t?"#5ac8fa":n?"rgba(90,200,250,0.5)":"#333",p.style.color=t||n?"#5ac8fa":"#cfcfd2")}const Bp=r=>{const t=r.job;return!t||!t.name?null:(()=>{var n=Sc(),p=n.firstChild,H=p.firstChild,Y=H.firstChild,K=Y.firstChild,Me=K.firstChild,he=K.nextSibling,er=he.firstChild,ei=er.nextSibling,$t=ei.nextSibling,ot=$t.nextSibling,Fo=ot.nextSibling,cn=Fo.nextSibling;cn.nextSibling;var We=Y.nextSibling,un=H.nextSibling,$e=un.firstChild,ke=$e.nextSibling,Ue=ke.nextSibling,Le=Ue.nextSibling,we=Le.nextSibling,lt=we.nextSibling;return e.insert(Me,()=>t.name),e.insert(K,(()=>{var d=e.memo(()=>!!t.workspaceName);return()=>d()&&(()=>{var a=Cc();return a.firstChild,e.insert(a,()=>t.workspaceName,null),e.effect(b=>{var M=`Workspace: ${t.workspaceName}${t.workingDirectory?` (${t.workingDirectory})`:""}`,I=`font-size:11px;font-weight:600;flex-shrink:0;cursor:help;white-space:nowrap;padding:2px 7px;border-radius:999px;border:1px solid ${t.workspaceColor||"#5ac8fa"};color:${t.workspaceColor||"#5ac8fa"};background:${t.workspaceColor||"#5ac8fa"}1a`;return M!==b.e&&e.setAttribute(a,"title",b.e=M),b.t=e.style(a,I,b.t),b},{e:void 0,t:void 0}),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(t.isMatrixParent&&t.matrix));return()=>d()&&(()=>{var a=zc(),b=a.firstChild,M=b.nextSibling;return M.nextSibling,e.insert(a,()=>t.matrix.workspaceIds.length,M),e.insert(a,(()=>{var I=e.memo(()=>!!t.matrix.concurrency);return()=>I()?` ⚙${t.matrix.concurrency}`:""})(),null),e.effect(()=>e.setAttribute(a,"title",`Matrix fan-out: ${t.matrix.workspaceIds.length} клонов, стратегия: ${t.matrix.strategy??"parallel"}, при ошибке: ${t.matrix.failureMode??"continue"}${t.matrix.concurrency?`, одновременно: ${t.matrix.concurrency}`:""}${t.matrix.overrides?`, переопределено workspace: ${Object.keys(t.matrix.overrides).length}`:""}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!t.matrixParentId);return()=>d()&&(()=>{var a=Tc();return a.firstChild,e.insert(a,()=>t.matrixParentId,null),e.effect(()=>e.setAttribute(a,"title",`Клон матрицы. Родитель: ${t.matrixParentId}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!t.watchPath);return()=>d()&&(()=>{var a=Ec();return e.effect(()=>e.setAttribute(a,"title",`Отслеживание файла: ${t.watchPath}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(Array.isArray(t.watchGlobs)&&t.watchGlobs.length>0));return()=>d()&&(()=>{var a=Pc(),b=a.firstChild,M=b.nextSibling;return M.nextSibling,e.insert(a,()=>t.watchGlobs.length,M),e.effect(()=>e.setAttribute(a,"title",`Glob-маски файлового триггера: ${t.watchGlobs.join(", ")}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>t.triggerType==="git");return()=>d()&&(()=>{var a=Ac();return e.effect(()=>e.setAttribute(a,"title",`Git-триггер: новый коммит${t.gitBranch?` в ветке ${t.gitBranch}`:""}${Array.isArray(t.gitPaths)&&t.gitPaths.length>0?`, пути: ${t.gitPaths.join(", ")}`:""}. Опрос каждые ${t.gitPollSeconds??60} с.`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(Array.isArray(t.activeDays)&&t.activeDays.length>0));return()=>d()&&(()=>{var a=Mc(),b=a.firstChild,M=b.nextSibling;return M.nextSibling,e.insert(a,()=>t.activeDays.length,M),e.effect(()=>e.setAttribute(a,"title",`Запуск только в дни: ${t.activeDays.map(I=>["Вс","Пн","Вт","Ср","Чт","Пт","Сб"][I]??I).join(", ")}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!t.timezone);return()=>d()&&(()=>{var a=Lc();return a.firstChild,e.insert(a,()=>t.timezone,null),e.effect(()=>e.setAttribute(a,"title",`Часовой пояс задачи: ${t.timezone}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(t.notBefore&&t.notAfter));return()=>d()&&(()=>{var a=Ic(),b=a.firstChild,M=b.nextSibling;return M.nextSibling,e.insert(a,()=>t.notBefore,M),e.insert(a,()=>t.notAfter,null),e.effect(()=>e.setAttribute(a,"title",`Окно запуска: ${t.notBefore}–${t.notAfter}. Вне окна запуск переносится на его открытие.`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!t.pausedUntil);return()=>d()&&(()=>{var a=Dc();return a.firstChild,e.insert(a,()=>new Date(t.pausedUntil).toLocaleDateString(),null),e.effect(()=>e.setAttribute(a,"title",`Пауза до ${new Date(t.pausedUntil).toLocaleString()} — задача включится автоматически.`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(t.beforeScript||t.afterScript));return()=>d()&&(()=>{var a=Rc();return e.effect(()=>e.setAttribute(a,"title",`Lifecycle hooks: ${[t.beforeScript?`pre: ${t.beforeScript}`:"",t.afterScript?`post: ${t.afterScript}`:""].filter(Boolean).join(" · ")}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>t.triggerType==="mcp-event");return()=>d()&&(()=>{var a=qc();return e.effect(()=>e.setAttribute(a,"title",`MCP-событие: ${t.mcpEvent?.event??"—"}${t.mcpEvent?.filter?` (фильтр: ${t.mcpEvent.filter})`:""}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(t.session&&t.session!=="new"));return()=>d()&&(()=>{var a=Oc();return e.insert(a,()=>t.session==="reuse"?"⟳ сессия":"↪ продолжение"),e.effect(()=>e.setAttribute(a,"title",t.session==="reuse"?`Переиспользуемая сессия OpenCode${t.sessionId?`: ${t.sessionId}`:""}`:"Продолжение последней сессии OpenCode (--continue)")),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!t.model);return()=>d()&&(()=>{var a=jc();return a.firstChild,e.insert(a,()=>t.model,null),e.effect(()=>e.setAttribute(a,"title",`Модель LLM: ${t.model}`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>typeof t.priority=="number"&&t.priority!==et);return()=>d()&&(()=>{var a=Bc();return a.firstChild,e.insert(a,()=>ca(t.priority),null),e.effect(()=>e.setAttribute(a,"title",`Приоритет: ${ca(t.priority)} (${t.priority})`)),a})()})(),null),e.insert(K,(()=>{var d=e.memo(()=>!!(Array.isArray(t.allowedTools)&&t.allowedTools.length>0||Array.isArray(t.deniedTools)&&t.deniedTools.length>0));return()=>d()?(()=>{var a=Nc();return e.effect(()=>e.setAttribute(a,"title",`Ограничения инструментов: ${[t.allowedTools?.length?`allowed=[${t.allowedTools.join(", ")}]`:"",t.deniedTools?.length?`denied=[${t.deniedTools.join(", ")}]`:""].filter(Boolean).join(" · ")}`)),a})():null})(),null),e.insert(Y,(()=>{var d=e.memo(()=>!!(Array.isArray(t.dependsOn)&&t.dependsOn.length>0));return()=>d()&&(()=>{var a=Gc(),b=a.firstChild;return b.firstChild,e.insert(b,()=>t.dependsOn.join(" + "),null),a})()})(),he),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.isMatrixParent&&t.matrixSummary));return()=>d()&&(()=>{var a=Fc(),b=a.firstChild,M=b.firstChild,I=M.nextSibling,J=I.nextSibling,E=J.nextSibling;return E.nextSibling,e.insert(b,()=>t.matrixSummary.successCount,I),e.insert(b,()=>t.matrixSummary.totalCount,E),e.insert(b,(()=>{var x=e.memo(()=>t.matrixSummary.errorCount>0);return()=>x()?` · ❌ ${t.matrixSummary.errorCount}`:""})(),null),e.insert(b,(()=>{var x=e.memo(()=>t.matrixSummary.pendingCount>0);return()=>x()?` · ⏳ ${t.matrixSummary.pendingCount}`:""})(),null),e.effect(x=>{var q=t.matrixSummary.message,X=`cursor:help;color:${Rg(t.matrixSummary.status)};white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;return q!==x.e&&e.setAttribute(b,"title",x.e=q),x.t=e.style(b,X,x.t),x},{e:void 0,t:void 0}),a})()})(),he),e.insert(he,()=>t.runsTotal??0,ei),e.insert(he,()=>t.runsSuccess??0,ot),e.insert(he,()=>t.runsPartial??0,cn),e.insert(he,()=>t.runsError??0,null),e.insert(Y,(()=>{var d=e.memo(()=>!!(t.schedule||t.nextRun));return()=>d()&&(()=>{var a=Wc(),b=a.firstChild;return e.insert(b,()=>t.schedule),e.insert(a,(()=>{var M=e.memo(()=>!!t.nextRun);return()=>M()&&(()=>{var I=Uc();return I.firstChild,e.insert(I,()=>t.nextRun,null),I})()})(),null),a})()})(),null),e.insert(We,(()=>{var d=e.memo(()=>t.status==="running");return()=>d()?(()=>{var a=Hc(),b=a.firstChild,M=b.nextSibling;return M.nextSibling,e.insert(a,Pa,M),a})():(()=>{var a=Vc();return e.insert(a,(()=>{var b=e.memo(()=>!!t.orphaned);return()=>b()?"🧟 Нет в планировщике":e.memo(()=>!!t.paused)()?"⏸ Пауза":e.memo(()=>t.status==="success")()?"🟢 Готова":e.memo(()=>t.status==="error")()?"🔴 Ошибка":e.memo(()=>t.status==="partial")()?"🟠 Частично":t.status==="idle"?"⚪ Не запускалась":"⚪ Неизвестно"})()),a})()})()),$e.addEventListener("mouseleave",d=>{ae(d,!1),Qs(a=>a===t.name?null:a)}),$e.addEventListener("mouseenter",d=>{ae(d,!0),Te()&&Qs(t.name)}),$e.$$click=()=>{Tp(t.name)},e.insert($e,()=>Te()&&jp()===t.name?"❄️":"▶"),ke.addEventListener("mouseleave",d=>ae(d,!1)),ke.addEventListener("mouseenter",d=>ae(d,!0)),ke.$$click=()=>{t.orphaned||(t.paused?Pp(t.name):Ep(t.name))},e.insert(ke,()=>t.paused?"▶":"⏸"),Ue.addEventListener("mouseleave",d=>ae(d,!1)),Ue.addEventListener("mouseenter",d=>ae(d,!0)),Ue.$$click=()=>{Lp(t.name)},Le.addEventListener("mouseleave",d=>ae(d,!1,Vr()&&Qr()===t.name)),Le.addEventListener("mouseenter",d=>ae(d,!0,Vr()&&Qr()===t.name)),Le.$$click=()=>{Sp(t.name)},we.addEventListener("mouseleave",d=>ae(d,!1,hi()===t.name)),we.addEventListener("mouseenter",d=>ae(d,!0,hi()===t.name)),we.$$click=()=>{kp(t.name)},lt.addEventListener("mouseleave",d=>ae(d,!1)),lt.addEventListener("mouseenter",d=>ae(d,!0)),lt.$$click=()=>{Ip(t)},e.insert(un,(()=>{var d=e.memo(()=>!!t.matrix);return()=>d()&&(()=>{var a=Jc();return a.addEventListener("mouseleave",b=>ae(b,!1)),a.addEventListener("mouseenter",b=>ae(b,!0)),a.$$click=()=>{Ap(t.name)},e.effect(b=>{var M=`Отменить выполняющиеся клоны матрицы "${t.name}"`,I=nt();return M!==b.e&&e.setAttribute(a,"title",b.e=M),b.t=e.style(a,I,b.t),b},{e:void 0,t:void 0}),a})()})(),null),e.insert(un,(()=>{var d=e.memo(()=>!t.matrixParentId);return()=>d()&&(()=>{var a=Qc();return a.addEventListener("mouseleave",b=>ae(b,!1)),a.addEventListener("mouseenter",b=>ae(b,!0)),a.$$click=()=>{Mp(t.name)},e.effect(b=>{var M=t.matrix?`Удалить матрицу "${t.name}" вместе с клонами`:`Удалить "${t.name}"`,I=nt();return M!==b.e&&e.setAttribute(a,"title",b.e=M),b.t=e.style(a,I,b.t),b},{e:void 0,t:void 0}),a})()})(),null),e.insert(n,(()=>{var d=e.memo(()=>hi()===t.name);return()=>d()&&(()=>{var a=Kc(),b=a.firstChild,M=b.firstChild,I=M.nextSibling;return I.addEventListener("mouseleave",J=>{J.target.style.color="#8e8e93"}),I.addEventListener("mouseenter",J=>{J.target.style.color="#ffffff"}),I.$$click=()=>yl(null),e.insert(a,(()=>{var J=e.memo(()=>bl().length===0);return()=>J()?Yc():bl().map(E=>(()=>{var x=Zc(),q=x.firstChild,X=q.nextSibling,He=X.nextSibling,Ve=He.firstChild;return e.insert(q,()=>new Date(E.startedAt).toLocaleString()),e.insert(X,()=>E.status==="success"?"✅ Успех":"❌ Ошибка"),e.insert(He,()=>E.durationMs,Ve),e.insert(x,(()=>{var V=e.memo(()=>!!E.model);return()=>V()&&(()=>{var P=Xc();return P.firstChild,e.insert(P,()=>E.model,null),e.effect(()=>e.setAttribute(P,"title",`Модель: ${E.model}`)),P})()})(),null),e.insert(x,(()=>{var V=e.memo(()=>!!(E.preFlightStatus&&E.preFlightStatus!=="skipped"));return()=>V()&&(()=>{var P=eu();return P.firstChild,e.insert(P,()=>E.preFlightStatus==="success"?"✅":"❌",null),e.effect(F=>{var N=`Pre-flight: ${E.preFlightStatus}`,z=E.preFlightStatus==="success"?"#34c759":"#ff3b30";return N!==F.e&&e.setAttribute(P,"title",F.e=N),z!==F.t&&e.setStyleProperty(P,"color",F.t=z),F},{e:void 0,t:void 0}),P})()})(),null),e.insert(x,(()=>{var V=e.memo(()=>!!(E.postFlightStatus&&E.postFlightStatus!=="skipped"));return()=>V()&&(()=>{var P=tu();return P.firstChild,e.insert(P,()=>E.postFlightStatus==="success"?"✅":"❌",null),e.effect(F=>{var N=`Post-flight: ${E.postFlightStatus}`,z=E.postFlightStatus==="success"?"#34c759":"#ff3b30";return N!==F.e&&e.setAttribute(P,"title",F.e=N),z!==F.t&&e.setStyleProperty(P,"color",F.t=z),F},{e:void 0,t:void 0}),P})()})(),null),e.insert(x,(()=>{var V=e.memo(()=>!!E.error);return()=>V()&&(()=>{var P=ru();return e.insert(P,()=>E.error),P})()})(),null),e.insert(x,(()=>{var V=e.memo(()=>!!E.nextTask);return()=>V()&&(()=>{var P=iu();return P.firstChild,e.insert(P,()=>E.nextTask,null),P})()})(),null),e.effect(V=>{var P=E.startedAt+E.durationMs,F=E.status==="success"?"#34c759":"#ff3b30";return P!==V.e&&e.setAttribute(x,"key",V.e=P),F!==V.t&&e.setStyleProperty(X,"color",V.t=F),V},{e:void 0,t:void 0}),x})())})(),null),a})()})(),null),e.insert(n,(()=>{var d=e.memo(()=>!!(Vr()&&Qr()===t.name));return()=>d()&&(()=>{var a=nu(),b=a.firstChild,M=b.firstChild,I=M.nextSibling;return e.insert(b,()=>t.name,I),I.addEventListener("mouseleave",J=>{J.target.style.color="#8e8e93"}),I.addEventListener("mouseenter",J=>{J.target.style.color="#ffffff"}),I.$$click=()=>Hs(),e.insert(a,(()=>{var J=e.memo(()=>!!Do());return()=>J()&&ou()})(),null),e.insert(a,(()=>{var J=e.memo(()=>!!(!Do()&&oe()&&!oe().success));return()=>J()&&(()=>{var E=lu();return E.firstChild,e.insert(E,()=>oe().error??"Симуляция не удалась",null),E})()})(),null),e.insert(a,(()=>{var J=e.memo(()=>!!(!Do()&&oe()&&oe().success));return()=>J()&&(()=>{var E=su();return e.insert(E,(()=>{var x=e.memo(()=>!!(Array.isArray(oe().warnings)&&oe().warnings.length>0));return()=>x()&&(()=>{var q=au();return q.firstChild,e.insert(q,()=>oe().warnings.map(X=>`· ${X}`).join(" | "),null),q})()})(),null),e.insert(E,()=>oe().tasks.map(x=>(()=>{var q=pu(),X=q.firstChild,He=X.firstChild,Ve=He.nextSibling;Ve.nextSibling;var V=X.nextSibling;V.firstChild;var P=V.nextSibling;P.firstChild;var F=P.nextSibling;return F.firstChild,e.insert(X,()=>(x.order??0)+1,Ve),e.insert(X,()=>x.trigger,null),e.insert(V,()=>x.name,null),e.insert(q,(()=>{var N=e.memo(()=>!!x.workspace);return()=>N()&&(()=>{var z=du();return z.firstChild,e.insert(z,()=>x.workspace.name,null),z})()})(),P),e.insert(q,(()=>{var N=e.memo(()=>!!x.matrixParent);return()=>N()&&(()=>{var z=cu();return z.firstChild,e.insert(z,()=>x.matrixParent,null),z})()})(),P),e.insert(P,()=>x.cwd||"(папка проекта)",null),e.insert(q,(()=>{var N=e.memo(()=>!!x.roleScoped);return()=>N()&&(()=>{var z=uu();return e.effect(()=>e.setAttribute(z,"title",`allowed=[${(x.roleScoped.allowed??[]).join(", ")}] · denied=[${(x.roleScoped.denied??[]).join(", ")}]`)),z})()})(),F),e.insert(q,(()=>{var N=e.memo(()=>x.estimatedDurationSec!=null);return()=>N()&&(()=>{var z=gu(),tr=z.firstChild,wt=tr.nextSibling;return wt.nextSibling,e.insert(z,()=>x.estimatedDurationSec,wt),z})()})(),F),e.insert(q,(()=>{var N=e.memo(()=>x.estimatedTokens!=null);return()=>N()&&(()=>{var z=fu(),tr=z.firstChild,wt=tr.nextSibling;return wt.nextSibling,e.insert(z,()=>x.estimatedTokens,wt),z})()})(),F),e.insert(q,(()=>{var N=e.memo(()=>x.estimatedCostUsd!=null);return()=>N()&&(()=>{var z=yu();return z.firstChild,e.insert(z,()=>Number(x.estimatedCostUsd).toFixed(4),null),z})()})(),F),e.insert(F,()=>x.command,null),e.insert(q,(()=>{var N=e.memo(()=>!!x.preFlight);return()=>N()&&(()=>{var z=bu();return z.firstChild,e.insert(z,()=>x.preFlight,null),z})()})(),null),e.insert(q,(()=>{var N=e.memo(()=>!!x.postFlight);return()=>N()&&(()=>{var z=xu();return z.firstChild,e.insert(z,()=>x.postFlight,null),z})()})(),null),e.insert(q,(()=>{var N=e.memo(()=>!!x.qualityGate);return()=>N()&&(()=>{var z=mu();return z.firstChild,e.insert(z,()=>x.qualityGate,null),z})()})(),null),e.effect(()=>e.setAttribute(q,"key",`${x.name}-${x.order}`)),q})()),null),e.insert(E,(()=>{var x=e.memo(()=>!!(oe().totals&&(oe().totals.estimatedDurationSec!=null||oe().totals.estimatedTokens!=null)));return()=>x()&&(()=>{var q=vu();return q.firstChild,e.insert(q,()=>(oe().totals.estimatedDurationSec??"—")+" с · "+(oe().totals.estimatedTokens??"—")+" токенов"+(oe().totals.estimatedCostUsd!=null?` · ~$${Number(oe().totals.estimatedCostUsd).toFixed(4)}`:""),null),q})()})(),null),E})()})(),null),a})()})(),null),e.effect(d=>{var a=`background:#252526;border-radius:10px;padding:16px;margin-bottom:12px;display:flex;flex-direction:column;gap:10px;border:1px solid ${Te()?"rgba(135, 206, 250, 0.4)":"#333"}`,b=`Запустить "${t.name}"`,M=nt(),I=!!t.orphaned,J=t.orphaned?`Задача "${t.name}" отсутствует в планировщике ОС — пауза недоступна`:t.paused?`Возобновить "${t.name}"`:`Поставить на паузу "${t.name}"`,E=nt(),x=`Логи "${t.name}"`,q=nt(),X=`Dry-Run симуляция "${t.name}"`,He=nt(Vr()&&Qr()===t.name),Ve=`История "${t.name}"`,V=nt(hi()===t.name),P=`Редактировать "${t.name}"`,F=nt();return d.e=e.style(n,a,d.e),b!==d.t&&e.setAttribute($e,"title",d.t=b),d.a=e.style($e,M,d.a),I!==d.o&&(ke.disabled=d.o=I),J!==d.i&&e.setAttribute(ke,"title",d.i=J),d.n=e.style(ke,E,d.n),x!==d.s&&e.setAttribute(Ue,"title",d.s=x),d.h=e.style(Ue,q,d.h),X!==d.r&&e.setAttribute(Le,"title",d.r=X),d.d=e.style(Le,He,d.d),Ve!==d.l&&e.setAttribute(we,"title",d.l=Ve),d.u=e.style(we,V,d.u),P!==d.c&&e.setAttribute(lt,"title",d.c=P),d.w=e.style(lt,F,d.w),d},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0}),n})()};try{return c.add(tl.Panel,{id:"scheduler-jobs",region:"side",list:()=>[{id:"jobs",title:"Планировщик",pinned:!0}],render:()=>e.createComponent(o.ErrorBoundary,{fallback:r=>(()=>{var t=pa(),n=t.firstChild;return e.insert(t,()=>r.message,null),t})(),get children(){var r=hu(),t=r.firstChild,n=t.firstChild,p=n.firstChild,H=p.nextSibling,Y=H.nextSibling,K=Y.firstChild,Me=K.nextSibling,he=Me.nextSibling,er=he.nextSibling,ei=er.nextSibling,$t=n.nextSibling,ot=$t.firstChild,Fo=ot.firstChild,cn=Fo.nextSibling,We=ot.nextSibling,un=We.firstChild,$e=We.nextSibling,ke=$e.nextSibling,Ue=ke.firstChild,Le=t.nextSibling,we=Le.firstChild,lt=we.nextSibling,d=lt.nextSibling,a=Le.nextSibling,b=a.firstChild,M=b.nextSibling,I=a.nextSibling,J=I.firstChild,E=J.firstChild,x=E.nextSibling,q=x.firstChild,X=I.nextSibling,He=X.firstChild,Ve=He.firstChild,V=Ve.nextSibling,P=V.firstChild,F=P.nextSibling,N=X.nextSibling,z=N.firstChild,tr=z.firstChild,wt=tr.firstChild,Ks=wt.nextSibling,Np=Ks.nextSibling,Ys=N.nextSibling,Gp=Ys.firstChild,Fp=Gp.nextSibling,Zs=Fp.firstChild,Wp=Zs.firstChild,Xs=Wp.firstChild,ea=Zs.nextSibling,Up=ea.firstChild,ta=Up.nextSibling,Hp=ea.nextSibling,Vp=Hp.firstChild,ra=Vp.nextSibling,Wo=Ys.nextSibling,Jp=Wo.firstChild,Uo=Jp.firstChild,Qp=Uo.firstChild,ia=Qp.nextSibling,Kp=ia.nextSibling,Ho=Uo.nextSibling,gn=Wo.nextSibling,Ng=gn.firstChild;return e.insert(p,(()=>{var g=e.memo(()=>!!Te());return()=>g()?`❄️ ${yo()} ❄️`:yo()})()),e.insert(Y,()=>Kn().total,Me),e.insert(Y,()=>Kn().success,er),e.insert(Y,()=>Kn().error,null),ot.addEventListener("change",g=>pl(g.currentTarget.value)),e.insert(ot,()=>xe().map(g=>(()=>{var y=da(),k=y.firstChild;return e.insert(y,()=>g.name,null),e.effect(()=>e.setAttribute(y,"key",g.id)),e.effect(()=>y.value=g.id),y})()),cn),We.$$click=()=>_a(g=>!g),e.insert(We,dl,null),e.insert(We,()=>jt()?" 🔒":"",null),$e.addEventListener("mouseleave",g=>{const y=g.currentTarget;y.style.borderColor="#333",y.style.background="#1e1e1e",y.style.color="#e0e0e0"}),$e.addEventListener("mouseenter",g=>{const y=g.currentTarget;y.style.borderColor="#5ac8fa",y.style.background="rgba(90,200,250,0.12)",y.style.color="#5ac8fa"}),$e.$$click=async()=>{const g=window.open("","_blank");let y=3782;try{const h=await w.get_dashboard_port({});h&&typeof h.port=="number"&&h.port>0&&(y=h.port)}catch(h){console.warn("[scheduler] Не удалось получить порт дашборда:",h)}const k="http://localhost:"+y;g?g.location.href=k:window.open(k,"_blank")},Ue.addEventListener("change",g=>{rp(g.currentTarget.checked)}),e.insert(r,(()=>{var g=e.memo(()=>!!xi());return()=>g()&&(()=>{var y=$u(),k=y.firstChild,h=k.firstChild,B=h.nextSibling,O=k.nextSibling;return B.$$click=()=>{up()},e.insert(y,(()=>{var $=e.memo(()=>!!jt());return()=>$()&&wu()})(),O),e.insert(O,()=>ha().map($=>(()=>{var A=_u(),S=A.firstChild,C=S.nextSibling,Z=C.nextSibling;return e.insert(S,()=>$.name,null),e.insert(S,()=>$.isDefault?" (по умолчанию)":"",null),e.insert(C,(()=>{var W=e.memo(()=>!!$.port);return()=>W()?`порт ${$.port}`:"порт по умолчанию"})()),e.insert(Z,()=>$.dir),e.insert(A,(()=>{var W=e.memo(()=>!!$.active);return()=>W()?ku():(()=>{var D=Su();return D.$$click=()=>{cp($.name)},e.effect(j=>{var T=Bt()||jt(),ee=`padding:2px 8px;border-radius:6px;border:1px solid #333;background:#262626;color:#e0e0e0;font-size:11px;cursor:${Bt()||jt()?"not-allowed":"pointer"};opacity:${jt()?.5:1}`;return T!==j.e&&(D.disabled=j.e=T),j.t=e.style(D,ee,j.t),j},{e:void 0,t:void 0}),D})()})(),null),e.insert(A,(()=>{var W=e.memo(()=>!$.isDefault&&!$.active);return()=>W()&&(()=>{var D=Cu();return D.$$click=()=>{gp($.name)},e.effect(j=>{var T=Bt(),ee=`padding:2px 8px;border-radius:6px;border:1px solid rgba(255,59,48,0.4);background:rgba(255,59,48,0.12);color:#ff3b30;font-size:11px;cursor:${Bt()?"not-allowed":"pointer"}`;return T!==j.e&&(D.disabled=j.e=T),j.t=e.style(D,ee,j.t),j},{e:void 0,t:void 0}),D})()})(),null),e.effect(W=>{var D=`font-weight:${$.active?700:400};color:${$.active?"#bf5af2":"#e0e0e0"}`,j=$.dir;return W.e=e.style(S,D,W.e),j!==W.t&&e.setAttribute(Z,"title",W.t=j),W},{e:void 0,t:void 0}),A})())),e.effect($=>{var A=Bt(),S=`padding:4px 10px;border-radius:6px;border:1px solid #333;background:#262626;color:#e0e0e0;font-size:11px;cursor:${Bt()?"not-allowed":"pointer"}`;return A!==$.e&&(B.disabled=$.e=A),$.t=e.style(B,S,$.t),$},{e:void 0,t:void 0}),y})()})(),Le),we.$$click=pp,e.insert(we,()=>sn()?"Экспорт...":"Экспорт"),lt.addEventListener("change",dp),d.$$click=()=>document.querySelector('input[type="file"]')?.click(),e.insert(d,()=>an()?"Импорт...":"Импорт"),M.addEventListener("change",g=>tp(Number(g.currentTarget.value)||1)),J.$$click=()=>La(!eo()),e.insert(x,(()=>{var g=e.memo(()=>!!v());return()=>g()?Xn()?"только ошибки":"все запуски":"выключены"})(),q),e.insert(q,()=>eo()?"▾":"▴"),e.insert(I,(()=>{var g=e.memo(()=>!eo());return()=>g()&&(()=>{var y=zu(),k=y.firstChild,h=k.firstChild,B=k.nextSibling,O=B.firstChild,$=B.nextSibling,A=$.firstChild,S=A.firstChild,C=A.nextSibling,Z=C.nextSibling,W=Z.nextSibling,D=W.firstChild,j=D.nextSibling,T=j.nextSibling,ee=T.nextSibling,Ie=ee.nextSibling,ge=Ie.nextSibling,fe=$.nextSibling,Se=fe.firstChild,Q=Se.firstChild,ye=Se.nextSibling,be=ye.nextSibling,st=be.nextSibling,_t=st.firstChild,Je=_t.nextSibling,ti=Je.nextSibling,Ce=ti.firstChild,Vo=ti.nextSibling,ri=Vo.firstChild,ii=fe.nextSibling,rr=ii.firstChild,ir=rr.firstChild,ni=rr.nextSibling,oi=ni.firstChild,li=ii.nextSibling,Qe=li.firstChild,si=Qe.firstChild,kt=Qe.nextSibling,nr=kt.firstChild,St=nr.nextSibling,fn=St.nextSibling,or=fn.nextSibling,yn=li.nextSibling,bn=yn.firstChild,De=bn.nextSibling,Ct=De.nextSibling,ai=yn.nextSibling,Jo=ai.firstChild,Ke=Jo.nextSibling,zt=Ke.nextSibling,xn=ai.nextSibling,mn=xn.firstChild,Qo=mn.firstChild,vn=Qo.nextSibling,hn=mn.nextSibling,$n=hn.firstChild,lr=$n.firstChild,Tt=lr.nextSibling,sr=Tt.nextSibling,Et=$n.nextSibling,pi=xn.nextSibling,Ko=pi.firstChild,ar=Ko.nextSibling,pr=ar.firstChild,wn=ar.nextSibling,Pt=wn.firstChild,dr=Pt.firstChild,_n=Pt.nextSibling,cr=_n.firstChild,kn=_n.nextSibling,ur=kn.nextSibling,di=pi.nextSibling,Sn=di.firstChild,ci=Sn.nextSibling,gr=ci.firstChild,ui=ci.nextSibling,fr=ui.firstChild,at=fr.nextSibling,Cn=at.nextSibling,Yo=di.nextSibling,pt=Yo.firstChild,At=pt.nextSibling;return h.addEventListener("change",i=>{ml(i.currentTarget.checked),R()}),O.addEventListener("change",i=>{vl(i.currentTarget.checked),R()}),S.addEventListener("change",i=>{hl(i.currentTarget.checked),R()}),C.addEventListener("change",()=>{R()}),C.$$input=i=>wl(i.currentTarget.value),j.addEventListener("change",()=>{R()}),j.$$input=i=>Sl(Number(i.currentTarget.value)||1e4),ee.addEventListener("change",()=>{R()}),ee.$$input=i=>zl(Number(i.currentTarget.value)||0),ge.addEventListener("change",()=>{R()}),ge.$$input=i=>El(Number(i.currentTarget.value)||1e3),Q.addEventListener("change",i=>{Kl(i.currentTarget.checked),R()}),ye.addEventListener("change",()=>{R()}),ye.$$input=i=>Zl(i.currentTarget.value),be.addEventListener("change",()=>{R()}),be.$$input=i=>es(i.currentTarget.value),Je.addEventListener("change",i=>{rs(i.currentTarget.value),R()}),Ce.addEventListener("change",i=>{ns(i.currentTarget.checked),R()}),ri.addEventListener("change",i=>{ls(i.currentTarget.checked),R()}),ir.addEventListener("change",i=>{ss(i.currentTarget.checked),R()}),oi.addEventListener("change",i=>{ps(i.currentTarget.checked),R()}),si.addEventListener("change",i=>{ds(i.currentTarget.checked),R()}),St.addEventListener("change",()=>{R()}),St.$$input=i=>us(i.currentTarget.value),or.addEventListener("change",()=>{R()}),or.$$input=i=>fs(i.currentTarget.value),De.addEventListener("change",()=>{R()}),De.$$input=i=>Dl(i.currentTarget.value),Ct.addEventListener("change",()=>{R()}),Ct.$$input=i=>ql(i.currentTarget.value),Ke.addEventListener("change",()=>{R()}),Ke.$$input=i=>Al(i.currentTarget.value),zt.addEventListener("change",()=>{R()}),zt.$$input=i=>Ll(i.currentTarget.value),e.insert(vn,()=>ro().length),lr.$$input=i=>bs(i.currentTarget.value),Tt.$$input=i=>xs(i.currentTarget.value),sr.$$click=()=>{Ya()},e.insert(sr,()=>io()?"Сохранение...":"💾 Сохранить"),e.insert(Et,()=>ro().map(i=>(()=>{var Mt=Tu(),dt=Mt.firstChild,Ye=dt.nextSibling,zn=Ye.firstChild,Lt=Ye.nextSibling;return e.insert(dt,()=>i.name),e.insert(Ye,()=>i.preview,null),Lt.$$click=()=>{Za(i.name)},e.effect(()=>e.setAttribute(Mt,"key",i.name)),Mt})()),null),e.insert(Et,(()=>{var i=e.memo(()=>ro().length===0);return()=>i()&&Eu()})(),null),pr.addEventListener("change",i=>{Ol(i.currentTarget.checked),R()}),dr.addEventListener("change",i=>{Bl(i.currentTarget.checked),R()}),cr.addEventListener("change",i=>{Gl(i.currentTarget.checked),R()}),ur.addEventListener("change",()=>{R()}),ur.$$input=i=>Wl(Number(i.currentTarget.value)||0),gr.addEventListener("change",i=>{Ul(i.currentTarget.checked),R()}),fr.addEventListener("change",i=>{Vl(i.currentTarget.value==="weekly"?"weekly":"daily"),R()}),at.addEventListener("change",()=>{R()}),at.$$input=i=>Ql(i.currentTarget.value),e.insert(Cn,(()=>{var i=e.memo(()=>!!to());return()=>i()?`последняя отправка: ${new Date(to()).toLocaleString()}`:"ещё не отправлялся"})()),pt.$$click=()=>{Xa()},e.insert(pt,()=>_i()?"Отправка...":"🧪 Тестовое уведомление"),At.$$click=()=>{ep()},e.insert(At,()=>ki()?"Отправка...":"📊 Отправить дайджест сейчас"),e.effect(i=>{var Mt=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,dt=!v(),Ye=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,zn=!v(),Lt=!v()||!me(),Zo=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${v()&&me()?1:.5}`,Tn=!v()||!me(),gi=!v()||!me(),En=!v()||!me(),Pn=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,An=!v(),yr=!v()||!se(),Mn=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${v()&&se()?1:.5}`,Ln=!v()||!se(),In=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${v()&&se()?1:.5}`,Dn=`display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${v()&&se()?1:.5}`,ct=!v()||!se(),s=!v()||!se(),l=!v()||!se(),f=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,u=!v(),m=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()&&Ee()?1:.5}`,_=!v()||!Ee(),L=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,te=!v(),pe=`display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${v()&&_r()?1:.5}`,ut=!v()||!_r(),Re=!v()||!_r(),gt=!v(),de=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${v()?1:.5}`,G=!v(),_e=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:13px;outline:none;opacity:${v()?1:.5}`,qe=!v(),br=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;opacity:${v()?1:.5}`,ft=!v(),Rn=`display:block;width:100%;box-sizing:border-box;padding:8px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;opacity:${v()?1:.5}`,xr=io()||!Si().trim()||!Ci(),qn=io()||!Si().trim()||!Ci()?"padding:6px 12px;background:#666;color:white;border:none;border-radius:6px;cursor:not-allowed;font-size:12px;font-weight:500;opacity:0.6":"padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;opacity:1",le=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,ce=!v(),ve=`display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${v()&&Ft()?1:.5}`,Ze=!v()||!Ft(),Xe=!v()||!Ft(),ue=!v()||!Ft(),It=`display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;opacity:${v()?1:.5}`,Oe=!v(),mr=`display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:#b0b0b0;opacity:${v()&&wr()?1:.5}`,Dt=!v()||!wr(),Rt=!v()||!wr(),On=_i()||!(me()||se()||Ee()),jn=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${_i()||!(me()||se()||Ee())?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${_i()||!(me()||se()||Ee())?.6:1}`,Bn=ki()||!(me()||se()||Ee()),fi=`padding:6px 12px;background:#2d7d46;color:white;border:none;border-radius:6px;cursor:${ki()||!(me()||se()||Ee())?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${ki()||!(me()||se()||Ee())?.6:1}`;return i.e=e.style(B,Mt,i.e),dt!==i.t&&(O.disabled=i.t=dt),i.a=e.style(A,Ye,i.a),zn!==i.o&&(S.disabled=i.o=zn),Lt!==i.i&&(C.disabled=i.i=Lt),i.n=e.style(C,Zo,i.n),Tn!==i.s&&(j.disabled=i.s=Tn),gi!==i.h&&(ee.disabled=i.h=gi),En!==i.r&&(ge.disabled=i.r=En),i.d=e.style(Se,Pn,i.d),An!==i.l&&(Q.disabled=i.l=An),yr!==i.u&&(ye.disabled=i.u=yr),i.c=e.style(ye,Mn,i.c),Ln!==i.w&&(be.disabled=i.w=Ln),i.m=e.style(be,In,i.m),i.f=e.style(st,Dn,i.f),ct!==i.y&&(Je.disabled=i.y=ct),s!==i.g&&(Ce.disabled=i.g=s),l!==i.p&&(ri.disabled=i.p=l),i.b=e.style(rr,f,i.b),u!==i.T&&(ir.disabled=i.T=u),i.A=e.style(ni,m,i.A),_!==i.O&&(oi.disabled=i.O=_),i.I=e.style(Qe,L,i.I),te!==i.S&&(si.disabled=i.S=te),i.W=e.style(kt,pe,i.W),ut!==i.C&&(St.disabled=i.C=ut),Re!==i.B&&(or.disabled=i.B=Re),gt!==i.v&&(De.disabled=i.v=gt),i.k=e.style(De,de,i.k),G!==i.x&&(Ct.disabled=i.x=G),i.j=e.style(Ct,_e,i.j),qe!==i.q&&(Ke.disabled=i.q=qe),i.z=e.style(Ke,br,i.z),ft!==i.P&&(zt.disabled=i.P=ft),i.H=e.style(zt,Rn,i.H),xr!==i.F&&(sr.disabled=i.F=xr),i.M=e.style(sr,qn,i.M),i.D=e.style(ar,le,i.D),ce!==i.R&&(pr.disabled=i.R=ce),i.E=e.style(wn,ve,i.E),Ze!==i.L&&(dr.disabled=i.L=Ze),Xe!==i.N&&(cr.disabled=i.N=Xe),ue!==i.G&&(ur.disabled=i.G=ue),i.U=e.style(ci,It,i.U),Oe!==i.K&&(gr.disabled=i.K=Oe),i.V=e.style(ui,mr,i.V),Dt!==i.Y&&(fr.disabled=i.Y=Dt),Rt!==i.J&&(at.disabled=i.J=Rt),On!==i.Q&&(pt.disabled=i.Q=On),i.Z=e.style(pt,jn,i.Z),Bn!==i.X&&(At.disabled=i.X=Bn),i._=e.style(At,fi,i._),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0,T:void 0,A:void 0,O:void 0,I:void 0,S:void 0,W:void 0,C:void 0,B:void 0,v:void 0,k:void 0,x:void 0,j:void 0,q:void 0,z:void 0,P:void 0,H:void 0,F:void 0,M:void 0,D:void 0,R:void 0,E:void 0,L:void 0,N:void 0,G:void 0,U:void 0,K:void 0,V:void 0,Y:void 0,J:void 0,Q:void 0,Z:void 0,X:void 0,_:void 0}),e.effect(()=>h.checked=v()),e.effect(()=>O.checked=Xn()),e.effect(()=>S.checked=me()),e.effect(()=>C.value=$l()||""),e.effect(()=>j.value=kl()),e.effect(()=>ee.value=Cl()),e.effect(()=>ge.value=Tl()),e.effect(()=>Q.checked=se()),e.effect(()=>ye.value=Yl()||""),e.effect(()=>be.value=Xl()||""),e.effect(()=>Je.value=ts()),e.effect(()=>Ce.checked=is()),e.effect(()=>ri.checked=os()),e.effect(()=>ir.checked=Ee()),e.effect(()=>oi.checked=as()),e.effect(()=>si.checked=_r()),e.effect(()=>St.value=cs()),e.effect(()=>or.value=gs()),e.effect(()=>De.value=Il()||""),e.effect(()=>Ct.value=Rl()||""),e.effect(()=>Ke.value=Pl()||""),e.effect(()=>zt.value=Ml()||""),e.effect(()=>lr.value=Si()),e.effect(()=>Tt.value=Ci()),e.effect(()=>pr.checked=Ft()),e.effect(()=>dr.checked=jl()),e.effect(()=>cr.checked=Nl()),e.effect(()=>ur.value=Fl()),e.effect(()=>gr.checked=wr()),e.effect(()=>fr.value=Hl()),e.effect(()=>at.value=Jl()),y})()})(),null),He.$$click=()=>Ua(!fo()),e.insert(V,(()=>{var g=e.memo(()=>Pi()>0);return()=>g()?`старше ${Pi()} дн.`:"без срока"})(),P),e.insert(V,(()=>{var g=e.memo(()=>Mi()>0);return()=>g()?`до ${Mi()} записей`:"без лимита"})(),F),e.insert(F,()=>fo()?"▾":"▴"),e.insert(X,(()=>{var g=e.memo(()=>!fo());return()=>g()&&(()=>{var y=Pu(),k=y.firstChild,h=k.firstChild,B=h.nextSibling,O=k.nextSibling,$=O.firstChild,A=$.nextSibling,S=O.nextSibling,C=S.firstChild,Z=S.nextSibling,W=Z.firstChild;return B.addEventListener("change",D=>{Ai(Math.max(0,Math.floor(Number(D.currentTarget.value)||0))),Cs()}),A.addEventListener("change",D=>{Li(Math.max(0,Math.floor(Number(D.currentTarget.value)||0))),Cs()}),e.insert(S,(()=>{var D=e.memo(()=>!!co());return()=>D()?`${new Date(co()).toLocaleString()} · удалено ${ws()}`:"ещё не выполнялась"})(),null),W.$$click=()=>{Ka()},e.insert(W,()=>Ii()?"Очистка...":"🧹 Очистить сейчас"),e.effect(D=>{var j=Ii(),T=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${Ii()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${Ii()?.6:1}`;return j!==D.e&&(W.disabled=D.e=j),D.t=e.style(W,T,D.t),D},{e:void 0,t:void 0}),e.effect(()=>B.value=Pi()),e.effect(()=>A.value=Mi()),y})()})(),null),tr.$$click=()=>Na(!lo()),e.insert(Ks,()=>no().length),e.insert(Np,()=>lo()?"▾":"▴"),e.insert(N,(()=>{var g=e.memo(()=>!lo());return()=>g()&&(()=>{var y=Au(),k=y.firstChild,h=k.firstChild,B=h.nextSibling,O=B.nextSibling,$=O.nextSibling,A=$.nextSibling,S=A.nextSibling,C=S.nextSibling,Z=k.nextSibling,W=Z.firstChild,D=W.firstChild,j=D.nextSibling;return B.addEventListener("change",()=>{kr()}),B.$$input=T=>Ga(T.currentTarget.value),$.addEventListener("change",()=>{kr()}),$.$$input=T=>Fa(T.currentTarget.value),S.addEventListener("change",()=>{kr()}),S.$$input=T=>Wa(T.currentTarget.value),C.$$click=()=>{kr()},e.insert(C,()=>oo()?"Загрузка...":"Обновить"),e.insert(j,()=>no().map(T=>(()=>{var ee=Mu(),Ie=ee.firstChild,ge=Ie.nextSibling,fe=ge.nextSibling,Se=fe.firstChild,Q=fe.nextSibling,ye=Q.nextSibling,be=ye.nextSibling;return e.insert(Ie,()=>new Date(T.ts).toLocaleString()),e.insert(ge,()=>T.action),e.insert(fe,()=>T.targetType??"",Se),e.insert(fe,()=>T.target??"—",null),e.insert(Q,()=>T.source??"—"),e.insert(ye,()=>T.actor),e.insert(be,()=>T.remote??"—"),e.effect(()=>e.setAttribute(ee,"key",T.id)),ee})()),null),e.insert(j,(()=>{var T=e.memo(()=>no().length===0);return()=>T()&&Lu()})(),null),e.effect(T=>{var ee=oo(),Ie=oo()?"padding:6px 12px;background:#666;color:white;border:none;border-radius:6px;cursor:not-allowed;font-size:12px;font-weight:500;opacity:0.6":"padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:pointer;font-size:12px;font-weight:500;opacity:1";return ee!==T.e&&(C.disabled=T.e=ee),T.t=e.style(C,Ie,T.t),T},{e:void 0,t:void 0}),e.effect(()=>B.value=vs()),e.effect(()=>$.value=hs()),e.effect(()=>S.value=$s()),y})()})(),null),Xs.addEventListener("change",g=>{zi(g.currentTarget.checked),xo()}),ta.addEventListener("change",g=>{Ti(Math.max(0,Math.floor(Number(g.currentTarget.value)||0))),xo()}),ra.addEventListener("change",g=>{Ei(Math.max(0,Math.floor(Number(g.currentTarget.value)||0))),xo()}),Uo.$$click=()=>va(!Un()),e.insert(ia,()=>xe().length),e.insert(Kp,()=>Un()?"▾":"▴"),Ho.$$click=()=>{xp()},e.insert(Wo,(()=>{var g=e.memo(()=>!Un());return()=>g()&&(()=>{var y=Iu();return e.insert(y,(()=>{var k=e.memo(()=>xe().length===0);return()=>k()?Du():xe().map(h=>(()=>{var B=Ru(),O=B.firstChild,$=O.nextSibling,A=$.firstChild,S=A.firstChild,C=A.nextSibling,Z=C.nextSibling,W=Z.firstChild,D=W.nextSibling,j=D.nextSibling,T=Z.nextSibling,ee=T.firstChild,Ie=$.nextSibling,ge=Ie.firstChild,fe=ge.nextSibling,Se=fe.nextSibling;return e.insert(A,()=>h.name,null),e.insert(C,()=>h.path),e.insert(Z,()=>h.gitBranch||"—",D),e.insert(Z,()=>h.gitRemote||"remote не задан",null),e.insert(T,(()=>{var Q=e.memo(()=>!!h.env);return()=>Q()?`${Object.keys(h.env).length} перем.`:"—"})(),null),e.insert(T,()=>h.envFile?" · .env-файл":"",null),ge.$$click=()=>{bp(h)},fe.$$click=()=>{mp(h)},Se.$$click=()=>{vp(h)},e.effect(Q=>{var ye=`width:9px;height:9px;border-radius:50%;background:${h.color||"#5ac8fa"};flex-shrink:0`,be=h.path,st=Ot(),_t=Ot(),Je=Ot();return Q.e=e.style(O,ye,Q.e),be!==Q.t&&e.setAttribute(C,"title",Q.t=be),st!==Q.a&&(ge.disabled=Q.a=st),_t!==Q.o&&(fe.disabled=Q.o=_t),Je!==Q.i&&(Se.disabled=Q.i=Je),Q},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),B})())})()),y})()})(),null),e.insert(r,(()=>{var g=e.memo(()=>!!ip());return()=>g()?(()=>{var y=qu();return y.addEventListener("mouseleave",k=>{const h=k.currentTarget;h.style.borderColor="#3a3a3a",h.style.background="#1e1e1e"}),y.addEventListener("mouseenter",k=>{const h=k.currentTarget;h.style.borderColor="#5ac8fa",h.style.background="#232326"}),y.$$click=()=>vo(!1),y})():(()=>{var y=Ou(),k=y.firstChild,h=k.firstChild,B=h.nextSibling,O=B.firstChild,$=O.nextSibling,A=k.nextSibling,S=A.firstChild,C=S.firstChild,Z=S.nextSibling,W=A.nextSibling,D=W.firstChild,j=D.nextSibling,T=W.nextSibling,ee=T.firstChild,Ie=ee.nextSibling,ge=Ie.firstChild,fe=ge.firstChild,Se=ge.nextSibling,Q=Se.firstChild,ye=Se.nextSibling,be=ye.firstChild,st=ye.nextSibling,_t=st.firstChild,Je=st.nextSibling,ti=Je.firstChild,Ce=T.nextSibling,Vo=Ce.firstChild,ri=Vo.nextSibling,ii=ri.firstChild,rr=ii.firstChild,ir=ii.nextSibling,ni=ir.firstChild,oi=ir.nextSibling,li=oi.firstChild,Qe=Ce.nextSibling,si=Qe.firstChild,kt=si.nextSibling,nr=kt.nextSibling,St=nr.firstChild,fn=St.nextSibling,or=nr.nextSibling,yn=or.firstChild,bn=yn.nextSibling,De=bn.firstChild,Ct=De.nextSibling,ai=Ct.nextSibling,Jo=bn.nextSibling,Ke=Jo.nextSibling,zt=Ke.firstChild,xn=zt.nextSibling,mn=Ke.nextSibling,Qo=mn.firstChild,vn=Qo.nextSibling,hn=Qe.nextSibling,$n=hn.firstChild,lr=$n.nextSibling,Tt=hn.nextSibling,sr=Tt.firstChild,Et=sr.nextSibling,pi=Tt.nextSibling,Ko=pi.firstChild,ar=Ko.nextSibling,pr=pi.nextSibling,wn=pr.firstChild,Pt=wn.nextSibling,dr=pr.nextSibling,_n=dr.firstChild,cr=_n.nextSibling,kn=dr.nextSibling,ur=kn.firstChild,di=ur.nextSibling,Sn=kn.nextSibling,ci=Sn.firstChild,gr=ci.nextSibling,ui=Sn.nextSibling,fr=ui.firstChild,at=fr.nextSibling,Cn=ui.nextSibling,Yo=Cn.firstChild,pt=Yo.nextSibling,At=Cn.nextSibling,i=At.firstChild,Mt=i.nextSibling,dt=At.nextSibling,Ye=dt.firstChild,zn=Ye.firstChild,Lt=Ye.nextSibling,Zo=Lt.firstChild,Tn=Zo.nextSibling,gi=Tn.nextSibling,En=gi.nextSibling,Pn=En.nextSibling,An=Pn.nextSibling,yr=An.firstChild,Mn=yr.nextSibling,Ln=Mn.nextSibling,In=dt.nextSibling,Dn=In.firstChild,ct=Dn.nextSibling;return e.insert(h,Bo?"Редактирование задачи":"Новая задача"),O.addEventListener("mouseleave",s=>{const l=s.currentTarget;l.style.color="#a0a0a6",l.style.borderColor="#333"}),O.addEventListener("mouseenter",s=>{const l=s.currentTarget;l.style.color="#5ac8fa",l.style.borderColor="#5ac8fa"}),O.$$click=$p,$.addEventListener("mouseleave",s=>{const l=s.currentTarget;l.style.color="#a0a0a6",l.style.borderColor="#333"}),$.addEventListener("mouseenter",s=>{const l=s.currentTarget;l.style.color="#5ac8fa",l.style.borderColor="#5ac8fa"}),$.$$click=()=>vo(!0),C.addEventListener("change",s=>{const l=s.currentTarget.checked;Yi(l),l&&(rt(""),Fe().length===0&&Hr(xe().map(f=>f.id)))}),e.insert(A,(()=>{var s=e.memo(()=>!!Ge());return()=>s()&&(()=>{var l=ju(),f=l.firstChild,u=f.firstChild,m=u.firstChild,_=f.nextSibling,L=_.firstChild,te=L.firstChild,pe=te.nextSibling,ut=L.nextSibling,Re=ut.firstChild,gt=Re.nextSibling,de=ut.nextSibling,G=de.firstChild,_e=G.nextSibling,qe=_.nextSibling,br=qe.firstChild,ft=qe.nextSibling,Rn=ft.firstChild,xr=Rn.nextSibling,qn=ft.nextSibling;return e.insert(u,()=>Fe().length,null),e.insert(f,(()=>{var le=e.memo(()=>xe().length===0);return()=>le()?Bu():(()=>{var ce=Nu();return e.insert(ce,()=>xe().map(ve=>(()=>{var Ze=Gu(),Xe=Ze.firstChild,ue=Xe.nextSibling,It=ue.firstChild,Oe=ue.nextSibling;return Xe.addEventListener("change",mr=>np(ve.id,mr.currentTarget.checked)),e.insert(ue,()=>ve.name,null),e.insert(Oe,()=>ve.path),e.effect(mr=>e.style(ue,`color:${ve.color||"#5ac8fa"}`,mr)),e.effect(()=>Xe.checked=Fe().includes(ve.id)),Ze})())),ce})()})(),null),pe.addEventListener("change",le=>Zi(le.currentTarget.value==="sequential"?"sequential":"parallel")),gt.addEventListener("change",le=>Xi(le.currentTarget.value==="stop"?"stop":"continue")),_e.addEventListener("change",le=>en(le.currentTarget.value==="per-task"?"per-task":"summary")),br.addEventListener("change",le=>tn(le.currentTarget.checked)),xr.$$input=le=>nn(le.currentTarget.value),e.insert(l,(()=>{var le=e.memo(()=>Fe().length>0);return()=>le()&&(()=>{var ce=Fu(),ve=ce.firstChild,Ze=ve.firstChild,Xe=ve.nextSibling;return e.insert(ve,op,null),e.insert(Xe,()=>Fe().map(ue=>{const It=xe().find(Dt=>Dt.id===ue);if(!It)return null;const Oe=Lo()[ue]??{},mr="padding:6px;background:#1e1e1e;border:1px solid #333;border-radius:6px;color:#fff;font-size:12px;outline:none;box-sizing:border-box";return(()=>{var Dt=Wu(),Rt=Dt.firstChild,On=Rt.firstChild,jn=On.nextSibling,Bn=Rt.nextSibling,fi=Bn.firstChild,na=fi.nextSibling,Xo=na.firstChild,oa=Xo.nextSibling,Yp=na.nextSibling,el=Yp.firstChild,la=el.nextSibling;return e.insert(Rt,()=>It.name,jn),e.insert(jn,()=>qo(Pe(),It.name)),fi.$$input=ze=>Kr(ue,"prompt",ze.currentTarget.value),Xo.$$input=ze=>Kr(ue,"model",ze.currentTarget.value),oa.$$input=ze=>Kr(ue,"qualityGate",ze.currentTarget.value),el.$$input=ze=>Kr(ue,"beforeScript",ze.currentTarget.value),la.$$input=ze=>Kr(ue,"afterScript",ze.currentTarget.value),e.effect(ze=>e.style(Rt,`font-size:12px;font-weight:600;margin-bottom:6px;color:${It.color||"#5ac8fa"}`,ze)),e.effect(()=>fi.value=Oe.prompt??""),e.effect(()=>Xo.value=Oe.model??""),e.effect(()=>oa.value=Oe.qualityGate??""),e.effect(()=>el.value=Oe.beforeScript??""),e.effect(()=>la.value=Oe.afterScript??""),Dt})()})),ce})()})(),qn),e.insert(qn,(()=>{var le=e.memo(()=>Oo().length>0);return()=>le()?[(()=>{var ce=Uu(),ve=ce.firstChild,Ze=ve.nextSibling,Xe=Ze.nextSibling;return e.insert(ce,()=>Oo().length,Ze),ce})(),(()=>{var ce=Hu();return e.insert(ce,()=>Oo().join(", ")),ce})()]:Vu()})()),e.effect(()=>e.setAttribute(xr,"placeholder",Mo()==="sequential"?"1 (sequential)":"без лимита")),e.effect(()=>pe.value=Mo()),e.effect(()=>gt.value=Rs()),e.effect(()=>_e.value=qs()),e.effect(()=>br.checked=Os()),e.effect(()=>xr.value=rn()),l})()})(),null),e.insert(y,(()=>{var s=e.memo(()=>!Ge());return()=>s()&&(()=>{var l=Ju(),f=l.firstChild,u=f.nextSibling,m=u.firstChild;return u.addEventListener("change",_=>{rt(_.currentTarget.value),_.currentTarget.value&&Yt("")}),e.insert(u,()=>xe().map(_=>(()=>{var L=da(),te=L.firstChild;return e.insert(L,()=>_.name,null),e.effect(()=>e.setAttribute(L,"key",_.id)),e.effect(()=>L.value=_.id),L})()),null),e.insert(l,(()=>{var _=e.memo(()=>!!Zr());return()=>_()&&(()=>{var L=Qu(),te=L.firstChild,pe=te.firstChild,ut=pe.nextSibling,Re=te.nextSibling,gt=Re.firstChild,de=gt.nextSibling,G=Re.nextSibling,_e=G.firstChild,qe=_e.nextSibling;return e.insert(ut,()=>Zr().path),e.insert(de,()=>Zr().gitBranch||"—"),e.insert(qe,()=>Zr().gitRemote||"—"),L})()})(),null),e.effect(()=>u.value=xt()),l})()})(),W),j.$$input=s=>Ri(s.currentTarget.value),e.insert(y,(()=>{var s=e.memo(()=>!xt()&&!Ge());return()=>s()&&(()=>{var l=Ku(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Yt(m.currentTarget.value),e.effect(()=>u.value=Ur()||""),l})()})(),T),fe.addEventListener("change",()=>Be("cron")),Q.addEventListener("change",()=>Be("file")),be.addEventListener("change",()=>Be("git")),_t.addEventListener("change",()=>Be("mcp-event")),ti.addEventListener("change",()=>Be("once")),e.insert(y,(()=>{var s=e.memo(()=>re()==="file");return()=>s()&&(()=>{var l=Yu(),f=l.firstChild,u=f.nextSibling,m=u.nextSibling,_=m.nextSibling,L=_.nextSibling,te=L.nextSibling;return u.$$input=pe=>Dr(pe.currentTarget.value),_.$$input=pe=>ko(pe.currentTarget.value),te.$$input=pe=>So(pe.currentTarget.value),e.effect(()=>u.value=ho()||""),e.effect(()=>_.value=Es()||""),e.effect(()=>te.value=Ps()||""),l})()})(),Ce),e.insert(y,(()=>{var s=e.memo(()=>re()==="git");return()=>s()&&[(()=>{var l=Zu(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Co(m.currentTarget.value),e.effect(()=>u.value=As()||""),l})(),(()=>{var l=Xu(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>zo(m.currentTarget.value),e.effect(()=>u.value=Ms()||""),l})(),(()=>{var l=eg(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>To(m.currentTarget.value),e.effect(()=>u.value=Ls()||""),l})(),(()=>{var l=tg(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Eo(m.currentTarget.value),e.effect(()=>u.value=Ki()||""),l})()]})(),Ce),e.insert(y,(()=>{var s=e.memo(()=>re()==="mcp-event");return()=>s()&&[(()=>{var l=rg(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Nr(m.currentTarget.value),e.effect(()=>u.value=Po()||""),l})(),(()=>{var l=ig(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Gr(m.currentTarget.value),e.effect(()=>u.value=Ao()||""),l})(),(()=>{var l=ng(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Wr(m.currentTarget.value),e.effect(()=>u.value=Fr()||""),l})()]})(),Ce),e.insert(y,(()=>{var s=e.memo(()=>re()==="once");return()=>s()&&(()=>{var l=og(),f=l.firstChild,u=f.nextSibling,m=u.nextSibling,_=m.nextSibling;return u.$$input=L=>Fi(L.currentTarget.value),_.$$input=L=>Ui(L.currentTarget.value),e.effect(()=>u.value=$o()||""),e.effect(()=>_.value=Wi()||""),l})()})(),Ce),rr.addEventListener("change",()=>Kt("new")),ni.addEventListener("change",()=>Kt("reuse")),li.addEventListener("change",()=>Kt("last")),e.insert(Ce,(()=>{var s=e.memo(()=>Ne()==="reuse");return()=>s()&&(()=>{var l=lg(),f=l.firstChild,u=f.nextSibling;return u.$$input=m=>Hi(m.currentTarget.value),e.effect(()=>u.value=Rr()||""),l})()})(),null),kt.addEventListener("change",s=>{const l=s.currentTarget.value;Sr(l),l!=="__custom__"&&Vt(l)}),e.insert(kt,()=>nl.map(s=>(()=>{var l=Nn();return e.insert(l,()=>s.label),e.effect(()=>e.setAttribute(l,"key",s.value)),e.effect(()=>l.value=s.value),l})())),e.insert(Qe,Rp&&(()=>{var s=sg(),l=s.firstChild,f=l.nextSibling;return f.$$input=u=>Vt(u.currentTarget.value),e.effect(()=>f.value=qi()||""),s})(),nr),e.insert(Qe,(()=>{var s=e.memo(()=>!!fl());return()=>s()&&(()=>{var l=ag();return e.insert(l,fl),l})()})(),nr),fn.$$input=s=>qr(s.currentTarget.value),De.$$input=s=>Or(s.currentTarget.value),ai.$$input=s=>jr(s.currentTarget.value),e.insert(xn,()=>[{value:1,label:"Пн"},{value:2,label:"Вт"},{value:3,label:"Ср"},{value:4,label:"Чт"},{value:5,label:"Пт"},{value:6,label:"Сб"},{value:0,label:"Вс"}].map(s=>(()=>{var l=pg(),f=l.firstChild;return f.addEventListener("change",u=>{const m=u.currentTarget.checked?[...Br(),s.value]:Br().filter(_=>_!==s.value);wo([...m].sort((_,L)=>_-L))}),e.insert(l,()=>s.label,null),e.effect(()=>f.checked=Br().includes(s.value)),l})())),vn.addEventListener("change",s=>_o(s.currentTarget.value)),lr.$$input=s=>Qt(s.currentTarget.value),Et.addEventListener("change",s=>hp(s.currentTarget.value)),e.insert(Et,()=>xl.map(s=>(()=>{var l=Nn();return e.insert(l,()=>s.label),e.effect(()=>e.setAttribute(l,"key",s.value)),e.effect(()=>l.value=s.value),l})()),null),e.insert(Et,()=>wi().map(s=>(()=>{var l=Nn();return e.insert(l,()=>s.name),e.effect(()=>e.setAttribute(l,"key",s.id)),e.effect(()=>l.value=`custom:${s.id}`),l})()),null),e.insert(Tt,(()=>{var s=e.memo(()=>!!$r().startsWith("custom:"));return()=>s()&&(()=>{var l=dg(),f=l.firstChild,u=f.nextSibling;return e.insert(l,()=>wi().map(m=>`custom:${m.id}`!==$r()?null:(()=>{var _=cg();return e.insert(_,()=>m.name),e.effect(()=>e.setAttribute(_,"key",m.id)),_})()),u),u.addEventListener("mouseleave",m=>{m.currentTarget.style.color="#ff3b30"}),u.addEventListener("mouseenter",m=>{m.currentTarget.style.color="#c92a2a"}),u.$$click=()=>{const m=wi().find(_=>`custom:${_.id}`===$r());m&&wp(m)},l})()})(),null),ar.$$input=s=>Er(s.currentTarget.value),Pt.addEventListener("change",s=>Pr(Number(s.currentTarget.value)||et)),e.insert(Pt,()=>ua.map(s=>(()=>{var l=Nn();return e.insert(l,()=>s.label),e.effect(()=>e.setAttribute(l,"key",s.value)),e.effect(()=>l.value=String(s.value)),l})()),null),e.insert(Pt,(()=>{var s=e.memo(()=>!ua.some(l=>l.value===vt()));return()=>s()&&(()=>{var l=ug(),f=l.firstChild,u=f.nextSibling,m=u.nextSibling;return e.insert(l,vt,u),e.effect(()=>l.value=String(vt())),l})()})(),null),cr.$$input=s=>Cr(Number(s.currentTarget.value)||0),di.$$input=s=>zr(Number(s.currentTarget.value)||60),gr.$$input=s=>Ar(s.currentTarget.value),at.$$input=s=>Lr(s.currentTarget.value),pt.$$input=s=>Ir(s.currentTarget.value),e.insert(Mt,(()=>{var s=e.memo(()=>Js().length===0);return()=>s()?gg():Js().map(l=>(()=>{var f=il(),u=f.firstChild;return u.addEventListener("change",m=>Op(l,m.currentTarget.checked)),e.insert(f,l,null),e.effect(m=>e.style(f,`display:flex;align-items:center;gap:6px;padding:6px 10px;border-radius:14px;border:1px solid ${ht().includes(l)?"#5ac8fa":"#333"};background:${ht().includes(l)?"rgba(90,200,250,0.12)":"transparent"};color:${ht().includes(l)?"#5ac8fa":"#cfcfd2"};font-size:12px;cursor:pointer;user-select:none`,m)),e.effect(()=>u.checked=ht().includes(l)),f})())})()),e.insert(Ye,(()=>{var s=e.memo(()=>ie().length>0||ne().length>0);return()=>s()&&(()=>{var l=fg(),f=l.firstChild,u=f.nextSibling,m=u.nextSibling,_=m.nextSibling,L=_.nextSibling;return e.insert(l,()=>ie().length,u),e.insert(l,()=>ne().length,_),l})()})(),null),e.insert(gi,()=>Bs.map(s=>(()=>{var l=il(),f=l.firstChild;return f.addEventListener("change",()=>Ns("allowed",s)),e.insert(l,s,null),e.effect(u=>e.style(l,`display:flex;align-items:center;gap:5px;padding:4px 9px;border-radius:12px;border:1px solid ${ie().includes(s)?"#34c759":"#333"};background:${ie().includes(s)?"rgba(52,199,89,0.12)":"transparent"};color:${ie().includes(s)?"#34c759":"#cfcfd2"};font-size:11px;cursor:pointer;user-select:none`,u)),e.effect(()=>f.checked=ie().includes(s)),l})())),e.insert(Pn,()=>Bs.map(s=>(()=>{var l=il(),f=l.firstChild;return f.addEventListener("change",()=>Ns("denied",s)),e.insert(l,s,null),e.effect(u=>e.style(l,`display:flex;align-items:center;gap:5px;padding:4px 9px;border-radius:12px;border:1px solid ${ne().includes(s)?"#ff3b30":"#333"};background:${ne().includes(s)?"rgba(255,59,48,0.12)":"transparent"};color:${ne().includes(s)?"#ff3b30":"#cfcfd2"};font-size:11px;cursor:pointer;user-select:none`,u)),e.effect(()=>f.checked=ne().includes(s)),l})())),yr.$$input=s=>Ds(s.currentTarget.value),Mn.$$click=()=>Gs("allowed"),Ln.$$click=()=>Gs("denied"),e.insert(Lt,(()=>{var s=e.memo(()=>ie().length>0||ne().length>0);return()=>s()&&(()=>{var l=yg();return e.insert(l,(()=>{var f=e.memo(()=>ie().length>0);return()=>f()&&(()=>{var u=bg(),m=u.firstChild,_=m.nextSibling,L=_.nextSibling;return e.insert(u,()=>ie().join(", "),_),u})()})(),null),e.insert(l,(()=>{var f=e.memo(()=>ne().length>0);return()=>f()&&(()=>{var u=xg(),m=u.firstChild,_=m.nextSibling,L=_.nextSibling;return e.insert(u,()=>ne().join(", "),_),u})()})(),null),l})()})(),null),Dn.$$click=()=>{Ro("(форма)");const s={order:0,trigger:"manual",command:lp(),roleScoped:ie().length>0||ne().length>0?{allowed:ie(),denied:ne()}:null,preFlight:(Ni()||"").trim()||null,postFlight:(Gi()||"").trim()||null,qualityGate:(Bi()||"").trim()||null},l=Fe().map(f=>xe().find(u=>u.id===f)).filter(f=>!!f).map((f,u)=>({...s,name:qo(Pe(),f.name),order:u,cwd:f.path,matrixParent:Pe()||"(без имени)"}));Jr({tasks:Ge()?l:[{...s,name:Pe()||"(без имени)",cwd:Zr()?.path||(Ur()||"").trim()||"(папка проекта)"}],totals:{},warnings:[...Pe().trim()?[]:["Не указано имя — превью локальное (форма не сохранена)."],...Ge()?[`Matrix: будет создано ${l.length} клон(а/ов) по workspace; родитель сам не выполняется.`]:[]]}),Io(!0)},ct.$$click=Cp,e.insert(ct,()=>hr()?"Создание...":Bo?"Сохранить":"Создать задачу"),e.insert(In,Bo&&(()=>{var s=mg();return s.$$click=()=>{Di(null),Ri(""),Vt("* * * * *"),Qt(""),Er(""),Pr(et),Cr(0),zr(60),Ar(""),Mr([]),Lr(""),Ir(""),Be("cron"),Dr(""),Fi(""),Ui(""),Kt("new"),Hi(""),qr(""),Or(""),jr(""),Nr(""),Gr(""),Wr(""),Yt(""),rt(""),Zt([]),Xt([]),ln(),Sr("* * * * *"),vi("")},s})(),null),e.insert(y,(()=>{var s=e.memo(()=>!!(Vr()&&Qr()==="(форма)"));return()=>s()&&(()=>{var l=vg(),f=l.firstChild,u=f.firstChild,m=u.nextSibling;return m.$$click=()=>Hs(),e.insert(l,()=>{const _=oe();if(!_)return null;const L=_.tasks?.[0];return(()=>{var te=hg(),pe=te.firstChild,ut=pe.firstChild,Re=pe.nextSibling,gt=Re.firstChild;return e.insert(pe,()=>L?.command,null),e.insert(Re,()=>L?.cwd,null),e.insert(te,(()=>{var de=e.memo(()=>!!L?.roleScoped);return()=>de()&&(()=>{var G=$g(),_e=G.firstChild,qe=_e.nextSibling,br=qe.nextSibling,ft=br.nextSibling,Rn=ft.nextSibling;return e.insert(G,()=>(L.roleScoped.allowed??[]).join(", "),qe),e.insert(G,()=>(L.roleScoped.denied??[]).join(", "),ft),G})()})(),null),e.insert(te,(()=>{var de=e.memo(()=>!!L?.preFlight);return()=>de()&&(()=>{var G=wg(),_e=G.firstChild;return e.insert(G,()=>L.preFlight,null),G})()})(),null),e.insert(te,(()=>{var de=e.memo(()=>!!L?.postFlight);return()=>de()&&(()=>{var G=_g(),_e=G.firstChild;return e.insert(G,()=>L.postFlight,null),G})()})(),null),e.insert(te,(()=>{var de=e.memo(()=>!!L?.qualityGate);return()=>de()&&(()=>{var G=kg(),_e=G.firstChild;return e.insert(G,()=>L.qualityGate,null),G})()})(),null),e.insert(te,(()=>{var de=e.memo(()=>!!(Array.isArray(_.warnings)&&_.warnings.length>0));return()=>de()&&(()=>{var G=Sg(),_e=G.firstChild;return e.insert(G,()=>_.warnings.join(" | "),null),G})()})(),null),te})()},null),l})()})(),null),e.effect(s=>{var l=re()!=="cron"?"none":"block",f=hr()||!dn(),u=dn()?void 0:Vs(),m=`display:block;width:100%;padding:10px;margin-top:8px;background:${hr()?"#666":"#007acc"};color:white;border-radius:6px;border:none;cursor:${hr()||!dn()?"not-allowed":"pointer"};font-size:13px;font-weight:500;opacity:${hr()||!dn()?.6:1}`;return l!==s.e&&e.setStyleProperty(Qe,"display",s.e=l),f!==s.t&&(ct.disabled=s.t=f),u!==s.a&&e.setAttribute(ct,"title",s.a=u),s.o=e.style(ct,m,s.o),s},{e:void 0,t:void 0,a:void 0,o:void 0}),e.effect(()=>C.checked=Ge()),e.effect(()=>j.value=Pe()||""),e.effect(()=>fe.checked=re()==="cron"),e.effect(()=>Q.checked=re()==="file"),e.effect(()=>be.checked=re()==="git"),e.effect(()=>_t.checked=re()==="mcp-event"),e.effect(()=>ti.checked=re()==="once"),e.effect(()=>rr.checked=Ne()==="new"),e.effect(()=>ni.checked=Ne()==="reuse"),e.effect(()=>li.checked=Ne()==="last"),e.effect(()=>kt.value=zs()),e.effect(()=>fn.value=Vi()||""),e.effect(()=>De.value=Ji()||""),e.effect(()=>ai.value=Qi()||""),e.effect(()=>vn.value=Ts()),e.effect(()=>lr.value=Jt()||""),e.effect(()=>Et.value=$r()),e.effect(()=>ar.value=Tr()||""),e.effect(()=>Pt.value=String(vt())),e.effect(()=>cr.value=Oi()),e.effect(()=>di.value=ji()),e.effect(()=>gr.value=Bi()||""),e.effect(()=>at.value=Ni()||""),e.effect(()=>pt.value=Gi()||""),e.effect(()=>yr.value=Is()),y})()})(),gn),e.insert(gn,(()=>{var g=e.memo(()=>qt()!=="all");return()=>g()&&(()=>{var y=Cg(),k=y.firstChild,h=k.nextSibling,B=h.nextSibling,O=B.nextSibling,$=O.nextSibling;return e.insert(y,(()=>{var A=e.memo(()=>qt()==="none");return()=>A()?"без workspace":`📦 ${xe().find(S=>S.id===qt())?.name??"workspace"}`})(),h),e.insert(y,()=>Go().length,O),e.insert(y,()=>Xr().length,null),y})()})(),null),e.insert(gn,(()=>{var g=e.memo(()=>Go().length===0);return()=>g()?(()=>{var y=zg(),k=y.firstChild,h=k.nextSibling;return e.insert(k,()=>Te()?"🎄":"📅"),e.insert(h,()=>Te()?"Задач пока нет. Самое время украсить ёлку!":"Нет активных задач. Создайте первую и доверьте рутину ИИ!"),y})():(()=>{var y=Tg();return e.insert(y,()=>Go().map(k=>e.createComponent(Bp,{get key(){return k.name},job:k}))),y})()})(),null),e.insert(r,(()=>{var g=e.memo(()=>!!ka());return()=>g()&&(()=>{var y=Eg(),k=y.firstChild,h=k.firstChild,B=h.nextSibling,O=B.firstChild,$=O.nextSibling;return y.$$click=()=>mt(null),k.$$click=A=>A.stopPropagation(),e.insert(h,Hn),e.insert(k,(()=>{var A=e.memo(()=>!!Hn().includes("KEY=VALUE"));return()=>A()?(()=>{var S=Pg();return S.$$keydown=C=>{C.key==="Escape"&&mt(null),C.key==="Enter"&&(C.ctrlKey||C.metaKey)&&(C.preventDefault(),mt(vr())),C.stopPropagation()},S.$$input=C=>Vn(C.currentTarget.value),e.effect(()=>S.value=vr()),S})():(()=>{var S=Ag();return S.$$keydown=C=>{C.key==="Escape"&&mt(null),C.key==="Enter"&&(C.preventDefault(),mt(vr())),C.stopPropagation()},S.$$input=C=>Vn(C.currentTarget.value),e.effect(()=>S.value=vr()),S})()})(),B),O.$$click=()=>mt(null),$.$$click=()=>mt(vr()),e.insert(k,(()=>{var A=e.memo(()=>!!Hn().includes("KEY=VALUE"));return()=>A()&&Mg()})(),null),y})()})(),null),e.insert(r,(()=>{var g=e.memo(()=>!!Jn());return()=>g()&&(()=>{var y=Lg(),k=y.firstChild,h=k.firstChild,B=h.firstChild,O=B.nextSibling,$=h.nextSibling,A=k.nextSibling;return e.insert(O,Jn),$.addEventListener("mouseleave",S=>{S.target.style.color="#8e8e93"}),$.addEventListener("mouseenter",S=>{S.target.style.color="#ff3b30"}),$.$$click=()=>{Qn(null),Gt("")},e.insert(A,()=>Ca().split(`
9
+ `).map((S,C)=>(()=>{var Z=Ig();return e.setAttribute(Z,"key",C),e.insert(Z,S),Z})())),y})()})(),null),e.effect(g=>{var y=`display:flex;flex-direction:column;width:100%;height:100%;max-height:100vh;min-height:0;box-sizing:border-box;overflow-y:auto;overflow-x:hidden;gap:24px;padding:20px;font-size:13px;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;color:#e0e0e0;transition:background 0.3s ease;scrollbar-width:thin;scrollbar-color:#444 transparent;background:${Te()?"linear-gradient(180deg, #0f172a 0%, #000000 100%)":"#0f0f0f"}`,k=jt()?"Профиль задан переменной окружения OPENCODE_SCHEDULER_PROFILE — переключение в GUI недоступно":"Профили: отдельные БД, настройки и порт дашборда",h=`display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;border:1px solid ${xi()?"#bf5af2":"#333"};background:${xi()?"rgba(191,90,242,0.12)":"#1e1e1e"};color:${xi()?"#bf5af2":"#e0e0e0"}`,B=`display:flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;cursor:pointer;font-size:12px;user-select:none;white-space:nowrap;transition:background 0.2s ease, border-color 0.2s ease;border:1px solid ${Te()?"rgba(135, 206, 250, 0.5)":"#333"};background:${Te()?"rgba(135, 206, 250, 0.12)":"#1e1e1e"};color:#e0e0e0`,O=sn(),$=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${sn()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${sn()?.6:1};transition:background 0.18s ease`,A=an(),S=`padding:6px 12px;background:#007acc;color:white;border:none;border-radius:6px;cursor:${an()?"not-allowed":"pointer"};font-size:12px;font-weight:500;opacity:${an()?.6:1};transition:background 0.18s ease`,C=Ot(),Z=`padding:5px 10px;border-radius:6px;border:1px solid #333;background:#252526;color:${Ot()?"#666":"#5ac8fa"};font-size:11px;font-weight:600;cursor:${Ot()?"not-allowed":"pointer"}`;return g.e=e.style(r,y,g.e),k!==g.t&&e.setAttribute(We,"title",g.t=k),g.a=e.style(We,h,g.a),g.o=e.style(ke,B,g.o),O!==g.i&&(we.disabled=g.i=O),g.n=e.style(we,$,g.n),A!==g.s&&(d.disabled=g.s=A),g.h=e.style(d,S,g.h),C!==g.r&&(Ho.disabled=g.r=C),g.d=e.style(Ho,Z,g.d),g},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e.effect(()=>ot.value=qt()),e.effect(()=>Ue.checked=Te()),e.effect(()=>M.value=Ma()),e.effect(()=>Xs.checked=so()),e.effect(()=>ta.value=ao()),e.effect(()=>ra.value=po()),r}})})}catch(r){return console.error("GUI render error:",r),c.add(tl.Panel,{id:"scheduler-jobs",region:"side",list:()=>[{id:"jobs",title:"Планировщик",pinned:!0}],render:()=>e.createComponent(o.ErrorBoundary,{fallback:t=>(()=>{var n=pa();return n.firstChild,e.insert(n,()=>t.message,null),n})(),get children(){var t=Dg(),n=t.firstChild;return e.insert(n,yo),t}})})}}});e.delegateEvents(["click","input","keydown"]);exports.default=qg;