@open-mercato/cezar 0.18.0 → 0.19.0-pr1815.4229

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 (122) hide show
  1. package/dist/automations/automation-cli.js +12 -6
  2. package/dist/automations/automation-cli.js.map +1 -1
  3. package/dist/automations/prompts.js +3 -1
  4. package/dist/automations/prompts.js.map +1 -1
  5. package/dist/automations/schedule-runner.js +18 -4
  6. package/dist/automations/schedule-runner.js.map +1 -1
  7. package/dist/automations/store.js +9 -2
  8. package/dist/automations/store.js.map +1 -1
  9. package/dist/automations/templates.js +1 -0
  10. package/dist/automations/templates.js.map +1 -1
  11. package/dist/automations/types.d.ts +28 -0
  12. package/dist/automations/types.js +6 -2
  13. package/dist/automations/types.js.map +1 -1
  14. package/dist/contract/automation-schedule.d.ts +28 -0
  15. package/dist/contract/automations.d.ts +126 -0
  16. package/dist/contract/github.d.ts +56 -0
  17. package/dist/contract/index.js +63 -0
  18. package/dist/contract/workspace.d.ts +18 -0
  19. package/dist/server/forge/github-issue-metadata.d.ts +6 -0
  20. package/dist/server/forge/github-issue-metadata.js +66 -0
  21. package/dist/server/forge/github-issue-metadata.js.map +1 -0
  22. package/dist/server/forge/github.d.ts +1 -1
  23. package/dist/server/forge/github.js +38 -4
  24. package/dist/server/forge/github.js.map +1 -1
  25. package/dist/server/forge/types.d.ts +2 -17
  26. package/dist/server/server.d.ts +320 -36
  27. package/dist/server/server.js +21 -20
  28. package/dist/server/server.js.map +1 -1
  29. package/dist/workflows/run.js +7 -0
  30. package/dist/workflows/run.js.map +1 -1
  31. package/package.json +3 -3
  32. package/web/dist/assets/{agent-task-pickers-DbNIzx20.js → agent-task-pickers-_i7QNEVz.js} +1 -1
  33. package/web/dist/assets/{alert-dialog-4Kna6Hd7.js → alert-dialog-BZU09BVw.js} +1 -1
  34. package/web/dist/assets/arrow-down-BQxdXW9w.js +1 -0
  35. package/web/dist/assets/arrow-left-CvmEanh8.js +1 -0
  36. package/web/dist/assets/automation-format-CEBKDGz8.js +1 -0
  37. package/web/dist/assets/automations-route-Cg1sWvtN.js +1 -0
  38. package/web/dist/assets/button-BvYDiOkd.js +100 -0
  39. package/web/dist/assets/{centered-state-D-wDs7Y1.js → centered-state-Bpq40Y_t.js} +1 -1
  40. package/web/dist/assets/check-DC3eAaS2.js +1 -0
  41. package/web/dist/assets/chevron-left-BW4WDtiS.js +1 -0
  42. package/web/dist/assets/chevron-right-DuM1UAhq.js +1 -0
  43. package/web/dist/assets/circle-check-DiPv45P_.js +1 -0
  44. package/web/dist/assets/{clipboard-DQGL_gUp.js → clipboard-7kWKIj7k.js} +1 -1
  45. package/web/dist/assets/{collapsible-D7qsttC5.js → collapsible-OE3rGS50.js} +1 -1
  46. package/web/dist/assets/{commit-list-DTMGEn0-.js → commit-list-DalU6p3i.js} +1 -1
  47. package/web/dist/assets/{compare-variants-DqlkpLFs.js → compare-variants-CuCfgtyG.js} +1 -1
  48. package/web/dist/assets/dashboard-BYBop-ZJ.js +44 -0
  49. package/web/dist/assets/{diff-DY-_mmb0.js → diff-DfTKq2z2.js} +2 -2
  50. package/web/dist/assets/{diff-view-oTEcZZ_O.js → diff-view-Du2463vL.js} +1 -1
  51. package/web/dist/assets/{download-BBtWFvsh.js → download-_KH0gJo8.js} +1 -1
  52. package/web/dist/assets/facet-filter-BSS2vFA8.js +5 -0
  53. package/web/dist/assets/{file-CbWEaOku.js → file-d2ABwdSR.js} +1 -1
  54. package/web/dist/assets/file-preview-BURiO97x.js +2 -0
  55. package/web/dist/assets/{git-pull-request-draft-Dwhm6Vhn.js → git-pull-request-draft-DIdbQZ0O.js} +1 -1
  56. package/web/dist/assets/git-tab-loading-8Y0ID8J2.js +1 -0
  57. package/web/dist/assets/{git-toolbar-C3vpZJaZ.js → git-toolbar-CSrf6Ux9.js} +1 -1
  58. package/web/dist/assets/github-DQ8J0EYw.js +1 -0
  59. package/web/dist/assets/{host-usage-CI_ZlJQu.js → host-usage-EK6T4fAW.js} +1 -1
  60. package/web/dist/assets/{icon-tooltip-CgAWLDxo.js → icon-tooltip-nRvCJxOH.js} +1 -1
  61. package/web/dist/assets/index-BVPhzJ3k.js +31 -0
  62. package/web/dist/assets/index-HmrjUHlJ.css +2 -0
  63. package/web/dist/assets/{input-Br4NQpZK.js → input-90eli0Uk.js} +1 -1
  64. package/web/dist/assets/{layout-cards-fdJa2H62.js → layout-cards-n-2Pwe6c.js} +1 -1
  65. package/web/dist/assets/{lib-w_5wfsBF.js → lib-C4vuyY62.js} +1 -1
  66. package/web/dist/assets/loader-circle-DAforPX2.js +1 -0
  67. package/web/dist/assets/{markdown-G3dvGJao.js → markdown-BBnagS_c.js} +1 -1
  68. package/web/dist/assets/{markdown-BfZORc0a.js → markdown-DLB6o6YD.js} +1 -1
  69. package/web/dist/assets/{message-square-Dl-ol3uz.js → message-square-WCEmfkiD.js} +1 -1
  70. package/web/dist/assets/plus-BJEPAJjW.js +1 -0
  71. package/web/dist/assets/{project-router-DgQSavhI.js → project-router-7DKoABD3.js} +1 -1
  72. package/web/dist/assets/queries-DsfjHsrp.js +1 -0
  73. package/web/dist/assets/{reference-chip-BxUGeHDa.js → reference-chip-frnxjI-K.js} +1 -1
  74. package/web/dist/assets/repo-git-DVREyQYa.js +1 -0
  75. package/web/dist/assets/{run-diff-CqXLVaDj.js → run-diff-CmqQmGTJ.js} +1 -1
  76. package/web/dist/assets/{save-ByUa-aAl.js → save-CCb1fwTJ.js} +1 -1
  77. package/web/dist/assets/{scroll-within-Dexi68h1.js → scroll-within-CNcaqKGp.js} +1 -1
  78. package/web/dist/assets/{search-x-CLuL49ms.js → search-x-Cm22V3TC.js} +1 -1
  79. package/web/dist/assets/{settings-2-BvalJGW-.js → settings-2-CWK1otJs.js} +1 -1
  80. package/web/dist/assets/skills-B0OolFqS.js +1 -0
  81. package/web/dist/assets/{square-FwRsgrg-.js → square-B-gfdc5r.js} +1 -1
  82. package/web/dist/assets/{tabs-nC1VLjcX.js → tabs-D3hCl7A6.js} +1 -1
  83. package/web/dist/assets/{tag-CteJEZQp.js → tag-C5TeSwBA.js} +1 -1
  84. package/web/dist/assets/{task-commits-CYcqwz-f.js → task-commits-DIrIWA6g.js} +1 -1
  85. package/web/dist/assets/{task-graph-CJfTnzUp.js → task-graph-Diq4xAP_.js} +1 -1
  86. package/web/dist/assets/{task-notes-DxH2q3Hr.js → task-notes-DnIcoZgS.js} +1 -1
  87. package/web/dist/assets/task-workspace-DhUBQLGl.js +29 -0
  88. package/web/dist/assets/{terminal-aoRx5eKS.js → terminal-BIKtPgmL.js} +1 -1
  89. package/web/dist/assets/{terminal-drawer-CuGVJS-l.js → terminal-drawer-f0Tw3yHw.js} +2 -2
  90. package/web/dist/assets/{textarea-X_NVmVlZ.js → textarea-D6BGJB7j.js} +1 -1
  91. package/web/dist/assets/{token-metrics-CdH7TbLP.js → token-metrics-CMdTXREP.js} +1 -1
  92. package/web/dist/assets/{tooltip-C2bzSwbQ.js → tooltip-Bb7ddw0_.js} +1 -1
  93. package/web/dist/assets/{tracker-BYs-vq6-.js → tracker-BDiIqG2R.js} +2 -2
  94. package/web/dist/assets/{triangle-alert-BdMPm9Jb.js → triangle-alert-BhQYv6Is.js} +1 -1
  95. package/web/dist/assets/{upload-DrvICo_K.js → upload-Crivm77f.js} +1 -1
  96. package/web/dist/assets/{use-now-Byfm730u.js → use-now-BW1HO2p_.js} +1 -1
  97. package/web/dist/assets/{use-submit-shortcut-B41NLqM4.js → use-submit-shortcut-oBvmLiAo.js} +1 -1
  98. package/web/dist/assets/{workflow-graph-ppdi5xyK.js → workflow-graph-DJLPSGD3.js} +3 -3
  99. package/web/dist/assets/{worktree-lifecycle-operation-CvU6xu3u.js → worktree-lifecycle-operation-DL-RTic4.js} +2 -2
  100. package/web/dist/index.html +39 -39
  101. package/dist/telemetry-service.json +0 -1
  102. package/web/dist/assets/arrow-left-B1Ed0tpu.js +0 -1
  103. package/web/dist/assets/automation-format-CXffJGqm.js +0 -1
  104. package/web/dist/assets/automations-route-ruFF7d59.js +0 -1
  105. package/web/dist/assets/button-wdWSPx_B.js +0 -100
  106. package/web/dist/assets/check-DvAMBXJe.js +0 -1
  107. package/web/dist/assets/chevron-left-Dqb1lvgZ.js +0 -1
  108. package/web/dist/assets/chevron-right-DDQuVTY1.js +0 -1
  109. package/web/dist/assets/circle-check-BiVc-j8x.js +0 -1
  110. package/web/dist/assets/dashboard-BX4228zB.js +0 -44
  111. package/web/dist/assets/facet-filter-B_AsFqFx.js +0 -5
  112. package/web/dist/assets/file-preview-DEKEA-Hk.js +0 -2
  113. package/web/dist/assets/git-tab-loading-w5Ne43J6.js +0 -1
  114. package/web/dist/assets/github-Hshin4wG.js +0 -1
  115. package/web/dist/assets/index-CQ1cB3qE.css +0 -2
  116. package/web/dist/assets/index-D-pGbO9R.js +0 -31
  117. package/web/dist/assets/loader-circle-CwT0JWiv.js +0 -1
  118. package/web/dist/assets/plus-BwQyZgNP.js +0 -1
  119. package/web/dist/assets/queries-BTgOLNTK.js +0 -1
  120. package/web/dist/assets/repo-git-B47L82oV.js +0 -1
  121. package/web/dist/assets/skills-Bu12y3Zp.js +0 -1
  122. package/web/dist/assets/task-workspace-7NHIdOyT.js +0 -29
@@ -34,7 +34,7 @@ import { automationStats } from '../automations/stats.js';
34
34
  import { automationTemplatesOf } from '../automations/templates.js';
35
35
  import { AutomationLaunchOutcome, launchAutomationRun, launchScheduledRun, launchTrackerAutomationRun, rebaselineIdleAutomations, reconcileAutomationReceipts, validateAutomationPrompt } from '../automations/task-template.js';
36
36
  import { automationEventSchema, automationFiltersSchema, automationLogResultSchema, automationTaskSchema, isGithubAutomation, isTrackerAutomation, isScheduleAutomation, } from '../automations/types.js';
37
- import { trackerTriggerSchema, trackerAutomationOptionsSchema, trackerAutomationOptionsQuerySchema, automationScheduleSchema, localTimeZone, nextOccurrence, scheduleLabel } from '../contract/index.js';
37
+ import { trackerTriggerSchema, trackerAutomationOptionsSchema, trackerAutomationOptionsQuerySchema, automationScheduleSchema, automationSchedulesSchema, automationScheduleIssue, schedulesOf, nextScheduleOccurrence, localTimeZone, nextOccurrence, scheduleLabel } from '../contract/index.js';
38
38
  import { access, constants as fsConstants, lstat, mkdir, readFile, realpath, stat, unlink, writeFile } from 'node:fs/promises';
39
39
  import { basename, dirname, join, posix, resolve, sep } from 'node:path';
40
40
  import { fileURLToPath } from 'node:url';
@@ -46,7 +46,7 @@ import { streamSSE } from 'hono/streaming';
46
46
  import { jsonZodValidator, multipartZodValidator, paramZodValidator, queryZodValidator } from './validators.js';
47
47
  import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
48
48
  import { z } from 'zod';
49
- import { PROMPT_TEMPLATE_TEXT_MAX, setWorkspaceUiStateInputSchema, setWorkspaceConfigInputSchema, designProxyRequestSchema, workspaceBrandingLogoResponseSchema, githubListQuerySchema, } from '../contract/index.js';
49
+ import { PROMPT_TEMPLATE_TEXT_MAX, automationListPreferencesSchema, setWorkspaceUiStateInputSchema, setWorkspaceConfigInputSchema, designProxyRequestSchema, workspaceBrandingLogoResponseSchema, githubListQuerySchema, } from '../contract/index.js';
50
50
  // A contract VALUE, like `workspaceUiStateSchema` in workspace/migrations.ts — the request
51
51
  // schema this route validates with is the same one the client compiles against.
52
52
  import { ATTACHMENT_IMAGES_TOO_LARGE, ATTACHMENT_UPLOAD_MISSING, attachmentInputSchema, attachmentListSchema, continueInputSchema, deleteUploadResponseSchema, isImageMediaType, MAX_ATTACHMENTS_TOTAL_BASE64, stagedUploadSchema, uploadIdParamSchema, modelDiscoveryRunnerSchema, openProjectInSchema, updateProjectInputSchema, } from '../contract/index.js';
@@ -242,6 +242,7 @@ const automationEditableSchema = z
242
242
  filters: automationFiltersSchema.optional(),
243
243
  trackerTrigger: trackerTriggerSchema.optional(),
244
244
  schedule: automationScheduleSchema.optional(),
245
+ schedules: automationSchedulesSchema.optional(),
245
246
  task: automationTaskSchema,
246
247
  })
247
248
  .strict();
@@ -251,17 +252,16 @@ const automationEditableSchema = z
251
252
  * schedule and carries no GitHub filter.
252
253
  */
253
254
  function automationKindIssue(body, kind) {
255
+ const timingIssue = automationScheduleIssue(body, kind);
256
+ if (timingIssue)
257
+ return timingIssue;
254
258
  // Tracker automations have no create/edit route yet (2026-09-19): hand-authored into
255
259
  // `automations.json` only. Refuse explicitly rather than misapplying the GitHub filter rules
256
260
  // below to one that reaches this far (e.g. a PUT that omits `kind` on an existing tracker row).
257
261
  if (kind === 'tracker')
258
262
  return body.trackerTrigger ? null : 'Choose an event to finish configuring this automation';
259
263
  if (kind === 'schedule') {
260
- if (!body.schedule)
261
- return 'a scheduled automation needs a schedule';
262
- if (body.schedule.type === 'once' && !body.schedule.date)
263
- return 'a one-time schedule needs a date';
264
- if (body.events || body.filters || body.intervalSeconds !== undefined)
264
+ if (body.events || body.filters || body.intervalSeconds !== undefined || body.trackerTrigger)
265
265
  return 'a scheduled automation has no GitHub filter';
266
266
  return null;
267
267
  }
@@ -319,6 +319,7 @@ function editableAutomation(definition) {
319
319
  filters: definition.filters,
320
320
  trackerTrigger: definition.trackerTrigger,
321
321
  schedule: definition.schedule,
322
+ ...(definition.schedules ? { schedules: definition.schedules } : {}),
322
323
  task: definition.task,
323
324
  };
324
325
  }
@@ -582,6 +583,7 @@ const uiStateSchema = z
582
583
  // ui-state.json without the key behaves as the default (newest), and the sort is applied
583
584
  // client-side, so this key changes presentation only, never what `GET /github` fetches.
584
585
  githubSort: z.enum(['newest', 'oldest']).optional(),
586
+ automationList: automationListPreferencesSchema.optional(),
585
587
  // Settings → Appearance (redesign R6): accent + density. ADDITIVE — the theme itself
586
588
  // stays in the browser (`cez-theme` localStorage, pre-paint). The cockpit always PUTs
587
589
  // the whole object because the top-level merge below is shallow.
@@ -3683,7 +3685,7 @@ export function createApp(deps) {
3683
3685
  const armAutomation = (store, automation) => {
3684
3686
  const now = Date.now();
3685
3687
  if (isScheduleAutomation(automation)) {
3686
- const next = nextOccurrence(automation.schedule, now, localTimeZone());
3688
+ const next = nextScheduleOccurrence(automation, now, localTimeZone());
3687
3689
  store.setState(automation.id, (current) => ({
3688
3690
  ...current,
3689
3691
  revision: automation.revision,
@@ -3894,7 +3896,7 @@ export function createApp(deps) {
3894
3896
  if (issue)
3895
3897
  return c.json({ error: issue }, 400);
3896
3898
  }
3897
- const passedIssue = oncePassedIssue(parsed.data.schedule, parsed.data.enable === true);
3899
+ const passedIssue = oncePassedIssue(schedulesOf(parsed.data)[0], parsed.data.enable === true);
3898
3900
  if (passedIssue)
3899
3901
  return c.json({ error: passedIssue }, 400);
3900
3902
  const promptIssue = validateAutomationPrompt(parsed.data.task.prompt, kind);
@@ -3944,15 +3946,21 @@ export function createApp(deps) {
3944
3946
  const fresh = automationStore.get(current.id);
3945
3947
  if (!fresh?.deferredStart || fresh.revision !== parsed.data.expectedRevision || fresh.deferredStart.runIds.length)
3946
3948
  return c.json({ error: 'The task changed or its launch was already claimed.' }, 409);
3947
- if (digest(parsed.data.task) !== digest(fresh.task) || parsed.data.name !== fresh.name || parsed.data.kind !== 'schedule' || parsed.data.schedule?.type !== 'once')
3949
+ const timingIssue = automationKindIssue(parsed.data, 'schedule');
3950
+ if (timingIssue)
3951
+ return c.json({ error: timingIssue }, 400);
3952
+ const schedules = schedulesOf(parsed.data);
3953
+ const schedule = schedules[0];
3954
+ if (digest(parsed.data.task) !== digest(fresh.task) || parsed.data.name !== fresh.name || parsed.data.kind !== 'schedule' || schedules.length !== 1 || schedule?.type !== 'once')
3948
3955
  return c.json({ error: 'Cancel and submit a new task to change its prompt or settings.' }, 409);
3949
3956
  await validateDeferredBinding(c.get('project').root, fresh);
3950
3957
  const { prompt, ...fields } = fresh.task;
3951
- const schedule = parsed.data.schedule;
3952
3958
  const resolved = await previewDeferredStart(c.get('project').root, { task: { ...fields, task: prompt }, start: { kind: 'at', date: schedule.date ?? '', hour: schedule.hour ?? 0, minute: schedule.minute ?? 0 } }, true);
3953
3959
  if (!resolved.preview.available)
3954
3960
  return c.json({ error: resolved.preview.message }, 400);
3955
- const automation = automationStore.update(fresh.id, fresh.revision, { ...fresh, schedule: resolved.schedule, enabled: true,
3961
+ if (!resolved.schedule)
3962
+ return c.json({ error: 'The scheduled time could not be resolved.' }, 400);
3963
+ const automation = automationStore.update(fresh.id, fresh.revision, { ...fresh, schedule: resolved.schedule, schedules: undefined, enabled: true,
3956
3964
  deferredStart: { ...fresh.deferredStart, reason: 'at', notBefore: resolved.preview.notBefore, timeZone: resolved.preview.timeZone, status: 'pending', failureKind: undefined, error: undefined, holdUntil: undefined, manualRequested: undefined } });
3957
3965
  emitAutomationChange(c.get('project'), automation.id, automation.revision);
3958
3966
  automationsChanged();
@@ -3976,7 +3984,7 @@ export function createApp(deps) {
3976
3984
  if (issue)
3977
3985
  return c.json({ error: issue }, 400);
3978
3986
  }
3979
- const passedIssue = oncePassedIssue(parsed.data.schedule, parsed.data.enabled === true);
3987
+ const passedIssue = oncePassedIssue(schedulesOf(parsed.data)[0], parsed.data.enabled === true);
3980
3988
  if (passedIssue)
3981
3989
  return c.json({ error: passedIssue }, 400);
3982
3990
  const promptIssue = validateAutomationPrompt(parsed.data.task.prompt, kind);
@@ -4008,13 +4016,6 @@ export function createApp(deps) {
4008
4016
  }));
4009
4017
  }
4010
4018
  });
4011
- // An edited schedule recomputes its next occurrence; `store.update` carried the old
4012
- // `nextRunAt` forward, so clear it and let the timer's `dueAt` persist the new one.
4013
- if (kind === 'schedule' && JSON.stringify(current.schedule) !== JSON.stringify(automation.schedule)) {
4014
- if (automationStore.state(automation.id)?.nextRunAt) {
4015
- automationStore.setState(automation.id, (state) => ({ ...state, nextRunAt: undefined }));
4016
- }
4017
- }
4018
4019
  // A poll's `nextCheckAt` was computed from the old interval; a shorter one takes effect
4019
4020
  // now, not after the old wait (#1736). An active failure backoff is left alone.
4020
4021
  if (kind !== 'schedule' && automation.enabled && current.enabled) {