@hearsay-tools/squawk 0.18.0-pr3415.5969 → 0.18.0-pr3415.6071
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automations/enabled.d.ts +2 -0
- package/dist/automations/enabled.js +6 -0
- package/dist/automations/enabled.js.map +1 -0
- package/dist/automations/service.d.ts +1 -1
- package/dist/automations/service.js +1 -1
- package/dist/autosave-commit.d.ts +52 -0
- package/dist/autosave-commit.js +378 -0
- package/dist/autosave-commit.js.map +1 -0
- package/dist/ci-wait/tool-catalog.js +2 -1
- package/dist/ci-wait/tool-catalog.js.map +1 -1
- package/dist/contract/automation-schedule.d.ts +9 -0
- package/dist/contract/automations.d.ts +1 -9
- package/dist/contract/index.js +1956 -1960
- package/dist/contract/run-status.d.ts +32 -0
- package/dist/contract/runs.d.ts +1 -21
- package/dist/core/structured-output.d.ts +9 -0
- package/dist/core/structured-output.js +64 -0
- package/dist/core/structured-output.js.map +1 -0
- package/dist/delegation/routes.d.ts +21 -21
- package/dist/delegation/service.d.ts +1 -1
- package/dist/delegation/service.js +1 -1
- package/dist/delegation/transport.d.ts +21 -21
- package/dist/discovery/catalog.d.ts +2 -9
- package/dist/discovery/catalog.js +1 -18
- package/dist/discovery/catalog.js.map +1 -1
- package/dist/discovery/choices.d.ts +10 -0
- package/dist/discovery/choices.js +19 -0
- package/dist/discovery/choices.js.map +1 -0
- package/dist/git-worktree.d.ts +0 -52
- package/dist/git-worktree.js +2 -374
- package/dist/git-worktree.js.map +1 -1
- package/dist/home/recovery.d.ts +0 -1
- package/dist/home/recovery.js +0 -1
- package/dist/home/recovery.js.map +1 -1
- package/dist/planner.d.ts +1 -8
- package/dist/planner.js +2 -63
- package/dist/planner.js.map +1 -1
- package/dist/runs/auto-name.js +1 -1
- package/dist/runs/auto-name.js.map +1 -1
- package/dist/runs/run-exits.d.ts +290 -290
- package/dist/runs/webhook.d.ts +1 -3
- package/dist/runs/webhook.js +2 -10
- package/dist/runs/webhook.js.map +1 -1
- package/dist/serve-command.js +1 -0
- package/dist/serve-command.js.map +1 -1
- package/dist/server/capabilities.js +2 -1
- package/dist/server/capabilities.js.map +1 -1
- package/dist/server/forge/draft-pr.js +1 -1
- package/dist/server/forge/draft-pr.js.map +1 -1
- package/dist/server/home-recovery-routes.js +2 -1
- package/dist/server/home-recovery-routes.js.map +1 -1
- package/dist/server/project-context.d.ts +5 -1
- package/dist/server/project-context.js +7 -4
- package/dist/server/project-context.js.map +1 -1
- package/dist/server/reports-api.d.ts +2 -2
- package/dist/server/server.d.ts +1949 -1947
- package/dist/server/server.js +4 -5
- package/dist/server/server.js.map +1 -1
- package/dist/server/start-run-options.d.ts +2 -1
- package/dist/server/start-run-options.js +1 -1
- package/dist/server/start-run-options.js.map +1 -1
- package/dist/server/workspace-live-routes.d.ts +6 -6
- package/dist/server/workspace-projects.d.ts +1 -1
- package/dist/server/workspace-projects.js +1 -0
- package/dist/server/workspace-projects.js.map +1 -1
- package/dist/voice/routes.d.ts +19 -19
- package/dist/workflows/input-acknowledgement.d.ts +24 -24
- package/dist/workflows/run/continuation-session.d.ts +1 -1
- package/dist/workflows/run/input-delivery.d.ts +1 -1
- package/dist/workflows/run/input-delivery.js +3 -4
- package/dist/workflows/run/input-delivery.js.map +1 -1
- package/dist/workflows/run/launch-context.js +3 -3
- package/dist/workflows/run/launch-context.js.map +1 -1
- package/dist/workflows/run/run-settlement.d.ts +1 -1
- package/dist/workflows/run/run-settlement.js.map +1 -1
- package/dist/workflows/run/worktree-autosave.d.ts +1 -1
- package/dist/workflows/run/worktree-autosave.js +1 -1
- package/dist/workflows/run/worktree-autosave.js.map +1 -1
- package/dist/workspace/registry-entry.d.ts +4 -0
- package/dist/workspace/registry-entry.js +11 -0
- package/dist/workspace/registry-entry.js.map +1 -0
- package/package.json +4 -4
- package/scripts/benchmark-run-store.ts +2 -1
- package/scripts/benchmark-workspace-events.ts +2 -1
- package/scripts/measure-transcript-facts-health.mjs +2 -1
- package/web/dist/assets/activity-motion-uhQPLbuu.js +2 -0
- package/web/dist/assets/activity-route-Dkulydc2.js +1 -0
- package/web/dist/assets/agent-accounts-BNlpWTOY.js +18 -0
- package/web/dist/assets/attention-VmnPpwJx.js +1 -0
- package/web/dist/assets/{cez-idle-DtpdVf_5.js → cez-idle-NomdGTfa.js} +1 -1
- package/web/dist/assets/commit-diff-panel-C9GL2tao.js +1 -0
- package/web/dist/assets/diff-BbT6HX3u.js +3 -0
- package/web/dist/assets/{diff-view-BMqNpcSH.js → diff-view-oyOw4umg.js} +4 -4
- package/web/dist/assets/file-preview-BQ0R19La.js +2 -0
- package/web/dist/assets/git-toolbar-PeaVnT03.js +1 -0
- package/web/dist/assets/github-5L2qkK1k.js +1 -0
- package/web/dist/assets/global-activity-route-DLfuJ7Lw.js +1 -0
- package/web/dist/assets/index-CFbFtL5O.js +17 -0
- package/web/dist/assets/index-DI_O8V74.css +1 -0
- package/web/dist/assets/{live-protocol-BAiIX_Mf.js → live-protocol-DBPXI6ks.js} +1 -1
- package/web/dist/assets/live-refetch-CZb2VOyu.js +1 -0
- package/web/dist/assets/popover-G6KGT-qq.js +1 -0
- package/web/dist/assets/preview-pane-connected-ClnZeK7_.js +3 -0
- package/web/dist/assets/{project-router-Dd63wBeA.js → project-router-BFKfAFvq.js} +1 -1
- package/web/dist/assets/project-scope-context-DSkcNKO7.js +4 -0
- package/web/dist/assets/prompt-template-menu-D4-inlE4.js +1 -0
- package/web/dist/assets/queries-D2MPDhtr.js +1 -0
- package/web/dist/assets/reference-chip-Drpbf-MP.js +1 -0
- package/web/dist/assets/repo-git-C5kdJUtx.js +1 -0
- package/web/dist/assets/report-reader-C9f7Zevx.js +1 -0
- package/web/dist/assets/reports-DLozsIav.js +1 -0
- package/web/dist/assets/run-header-gKKxDTom.js +2 -0
- package/web/dist/assets/skills-nbFjA9HV.js +1 -0
- package/web/dist/assets/{tab-link-CDrve3Rf.js → tab-link-DDpdYMnv.js} +1 -1
- package/web/dist/assets/task-changes-DcgY25bB.js +1 -0
- package/web/dist/assets/task-commits-amSX-bTC.js +1 -0
- package/web/dist/assets/task-files-BW4uOVGM.js +1 -0
- package/web/dist/assets/task-github-item-CG8dVePG.js +1 -0
- package/web/dist/assets/task-thread-BJRqzTFi.js +9 -0
- package/web/dist/assets/{thread-state-BpcneWuV.js → thread-state-CtFtvKUi.js} +1 -1
- package/web/dist/assets/use-hand-to-agent-state-DWLpzA5t.js +1 -0
- package/web/dist/assets/{useInfiniteQuery-hrWYY8aw.js → useInfiniteQuery-BmfExLUr.js} +1 -1
- package/web/dist/assets/useQuery-8pHkglP4.js +1 -0
- package/web/dist/assets/workflows-DDM-LFxD.js +7 -0
- package/web/dist/assets/{ws-Cn8d-Fu-.js → ws-CEQH0TUT.js} +1 -1
- package/web/dist/index.html +19 -18
- package/web/dist/live-worker.js +1 -1
- package/web/dist/assets/activity-motion-XsGcc9eM.js +0 -2
- package/web/dist/assets/activity-route-DIDXHV7J.js +0 -1
- package/web/dist/assets/agent-accounts-CuRvwNoA.js +0 -18
- package/web/dist/assets/commit-diff-panel-DtHg36xc.js +0 -1
- package/web/dist/assets/control-locations-CljaLD_b.js +0 -1
- package/web/dist/assets/diff-ImdJ4tPA.js +0 -3
- package/web/dist/assets/file-preview-C58stPPw.js +0 -2
- package/web/dist/assets/git-toolbar-Dzp24LO7.js +0 -1
- package/web/dist/assets/github-Cn0hlJsH.js +0 -1
- package/web/dist/assets/github-sidebar-model-BSNdxNKJ.js +0 -1
- package/web/dist/assets/global-activity-route-D5ke1ZQa.js +0 -1
- package/web/dist/assets/index-9YmaiQ1k.css +0 -1
- package/web/dist/assets/index-lMBPAedr.js +0 -17
- package/web/dist/assets/live-refetch-CstQIN6c.js +0 -1
- package/web/dist/assets/popover-N-u5z2xh.js +0 -1
- package/web/dist/assets/preview-pane-connected-Cl-W1pDv.js +0 -3
- package/web/dist/assets/project-scope-context-wlB-Y0ii.js +0 -4
- package/web/dist/assets/queries-BPdWfTBN.js +0 -1
- package/web/dist/assets/repo-git-YYivBJ2x.js +0 -1
- package/web/dist/assets/report-reader-gGAlVnKU.js +0 -1
- package/web/dist/assets/reports-B_xpuTvK.js +0 -1
- package/web/dist/assets/run-header-CxRJxVsR.js +0 -2
- package/web/dist/assets/skills-CEFXcZA5.js +0 -1
- package/web/dist/assets/task-changes-Bm4gjXBb.js +0 -1
- package/web/dist/assets/task-commits-DYHV533w.js +0 -1
- package/web/dist/assets/task-files-Bqvj0rbX.js +0 -1
- package/web/dist/assets/task-github-item-YkTV2--_.js +0 -1
- package/web/dist/assets/task-thread-CempX7k0.js +0 -9
- package/web/dist/assets/use-hand-to-agent-state-B9qtivFb.js +0 -1
- package/web/dist/assets/useQuery-BHmKi9_o.js +0 -1
- package/web/dist/assets/workflows-z-CqJ0JW.js +0 -7
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { productEnv } from '../core/product-env.js';
|
|
2
|
+
/** Automations are on unless the value is exactly `0` (spec 2026-10-02-scheduled-automations). */
|
|
3
|
+
export function automationsEnabled(env = process.env) {
|
|
4
|
+
return productEnv('AUTOMATIONS', env) !== '0';
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=enabled.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enabled.js","sourceRoot":"","sources":["../../src/automations/enabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,kGAAkG;AAClG,MAAM,UAAU,kBAAkB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACrE,OAAO,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC;AAChD,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { Home } from '../home/home.ts';
|
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import { type AutomationListQuery, type OnceStatus } from '../contract/index.js';
|
|
4
4
|
import { automationCreateSchema, automationUpdateSchema } from '../contract/index.js';
|
|
5
|
-
import { type HostDiscovery } from '../discovery/
|
|
5
|
+
import { type HostDiscovery } from '../discovery/choices.ts';
|
|
6
6
|
import type { RunStore } from '../runs/store.ts';
|
|
7
7
|
import type { ForgeAvailability } from '../server/forge/index.ts';
|
|
8
8
|
import type { RunManager } from '../workflows/run.ts';
|
|
@@ -2,7 +2,7 @@ import { nextOccurrence, ONCE_PAST_DUE_MESSAGE, onceInstant } from '../contract/
|
|
|
2
2
|
import { SCHEDULED_TASK_NOTE } from '../contract/index.js';
|
|
3
3
|
import { MODEL_DISCOVERY_RUNNERS } from '../contract/index.js';
|
|
4
4
|
import { loadConfig } from '../config.js';
|
|
5
|
-
import { missingModelChoices } from '../discovery/
|
|
5
|
+
import { missingModelChoices } from '../discovery/choices.js';
|
|
6
6
|
import { githubBaselineState } from './github-baseline.js';
|
|
7
7
|
import { SCHEDULE_LEASE_HELD_REASON, ScheduleRunner } from './schedule-runner.js';
|
|
8
8
|
import { validateAutomationPrompt } from './task-template.js';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type AutosaveOptions } from './autosave-git.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Autosave reason. Only periodic saves are opt-in. Turn-end, finalization and timer saves
|
|
4
|
+
* require the task branch; pre-PR saves follow current HEAD.
|
|
5
|
+
*/
|
|
6
|
+
export type AutosaveReason = 'periodic' | 'turn end' | 'run finalize' | 'pre-PR';
|
|
7
|
+
/**
|
|
8
|
+
* Structured autosave outcome. Pre-PR must report refused/failed saves. A task-branch mismatch
|
|
9
|
+
* skips; an unfinished merge, cherry-pick or revert refuses a guarded save.
|
|
10
|
+
*/
|
|
11
|
+
export type AutosaveResult = 'committed' | 'nothing-to-do' | 'refused' | 'failed' | 'skipped';
|
|
12
|
+
/**
|
|
13
|
+
* The facts behind a `committed` or `skipped` save, for the caller's report
|
|
14
|
+
* (hearsay-tools/cezarion#1004). `branch` is HEAD's branch name, `null` on a
|
|
15
|
+
* detached HEAD; `sha` is the short hash of the autosave commit, `null` when
|
|
16
|
+
* the commit landed but its hash could not be read back.
|
|
17
|
+
*/
|
|
18
|
+
export type AutosaveOutcome = {
|
|
19
|
+
result: 'committed';
|
|
20
|
+
sha: string | null;
|
|
21
|
+
branch: string | null;
|
|
22
|
+
} | {
|
|
23
|
+
result: 'skipped';
|
|
24
|
+
branch: string | null;
|
|
25
|
+
changedPaths: number;
|
|
26
|
+
};
|
|
27
|
+
export interface AutosaveCommitOptions extends AutosaveOptions {
|
|
28
|
+
/** The task's own branch (`cez/<id8>`). Given, the save commits only while HEAD is
|
|
29
|
+
* `refs/heads/<taskBranch>`, and writes that ref by compare-and-swap; on any other
|
|
30
|
+
* branch or a detached HEAD it returns `skipped` and leaves the working tree alone,
|
|
31
|
+
* and the index too unless HEAD moves while it saves. */
|
|
32
|
+
taskBranch?: string;
|
|
33
|
+
/** Receives the facts behind a `committed` or `skipped` result. Never called otherwise. */
|
|
34
|
+
onOutcome?: (outcome: AutosaveOutcome) => void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Stage and commit everything in the worktree as a "cezar autosave" commit
|
|
38
|
+
* (janitor pattern) — the agent's progress is recoverable from the `cez/<id8>`
|
|
39
|
+
* branch history. Quietly a no-op when nothing changed. With `taskBranch`, a
|
|
40
|
+
* worktree whose HEAD the agent moved to another branch (or detached) is left
|
|
41
|
+
* uncommitted instead: an autosave commit there lands in the agent's own PR
|
|
42
|
+
* history (hearsay-tools/cezarion#1004).
|
|
43
|
+
*
|
|
44
|
+
* The message carries `reason` so the opt-in periodic timer and the always-on
|
|
45
|
+
* flushes are distinguishable in `git log`; the `cezar autosave` prefix is kept
|
|
46
|
+
* so existing log greps still match.
|
|
47
|
+
*
|
|
48
|
+
* Refuses to commit a worktree that is mid-merge or still carries conflict
|
|
49
|
+
* markers: the incident behind #471 was an autosave capturing a half-resolved
|
|
50
|
+
* merge, and a blind `git add -A` would do it again.
|
|
51
|
+
*/
|
|
52
|
+
export declare function autosaveCommit(dir: string, reason: AutosaveReason, options?: AutosaveCommitOptions): Promise<AutosaveResult>;
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { logPrefix } from './home/display.js';
|
|
2
|
+
import { fallbackProjectWriteError } from './project-paths.js';
|
|
3
|
+
import { autosaveGit } from './autosave-git.js';
|
|
4
|
+
import { realpathSync } from 'node:fs';
|
|
5
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
6
|
+
import { join, resolve } from 'node:path';
|
|
7
|
+
/**
|
|
8
|
+
* Leftover merge-conflict markers, anchored at line start as git writes them.
|
|
9
|
+
* All three must appear *in order*: a bare `=======` line is ordinary Markdown
|
|
10
|
+
* (a setext heading underline), and any of the three alone — or the pair
|
|
11
|
+
* `<<<<<<<`/`>>>>>>>` in either order — occurs legitimately in checked-in
|
|
12
|
+
* patch fixtures and in docs that demonstrate conflict markers. Requiring the
|
|
13
|
+
* full ordered triple is what separates a real conflict from a file that
|
|
14
|
+
* merely talks about one.
|
|
15
|
+
*/
|
|
16
|
+
const CONFLICT_START = /^<{7}(?:\s|$)/;
|
|
17
|
+
const CONFLICT_MID = /^={7}(?:\s|$)/;
|
|
18
|
+
const CONFLICT_END = /^>{7}(?:\s|$)/;
|
|
19
|
+
/**
|
|
20
|
+
* Largest file the marker scan will read. Autosave runs as often as every 90 s,
|
|
21
|
+
* and decoding a large tracked file into a JS string each time is a real memory
|
|
22
|
+
* cost for a check that only ever looks at a few marker lines. Oversized files
|
|
23
|
+
* are skipped, which fails *open* — consistent with the rest of this guard,
|
|
24
|
+
* where a false negative costs noise and a false positive costs the recovery
|
|
25
|
+
* point.
|
|
26
|
+
*/
|
|
27
|
+
const MARKER_SCAN_MAX_BYTES = 2_000_000;
|
|
28
|
+
/** Does this file carry a complete, ordered conflict hunk? */
|
|
29
|
+
function hasConflictMarkers(text) {
|
|
30
|
+
let want = 0; // 0: `<<<<<<<`, 1: `=======`, 2: `>>>>>>>`
|
|
31
|
+
for (const line of text.split('\n')) {
|
|
32
|
+
if (want === 0) {
|
|
33
|
+
if (CONFLICT_START.test(line))
|
|
34
|
+
want = 1;
|
|
35
|
+
}
|
|
36
|
+
else if (want === 1) {
|
|
37
|
+
if (CONFLICT_MID.test(line))
|
|
38
|
+
want = 2;
|
|
39
|
+
}
|
|
40
|
+
else if (CONFLICT_END.test(line)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
/** Serialize all autosave entry points, including periodic/final flush overlap. */
|
|
47
|
+
const autosaves = new Map();
|
|
48
|
+
/** HEAD's symbolic ref, `null` on a detached HEAD, `undefined` when the read failed. */
|
|
49
|
+
async function readAutosaveHead(dir, git) {
|
|
50
|
+
// Exit 1 under -q is a detached HEAD; anything else is a failed read.
|
|
51
|
+
const ref = await git(dir, ['symbolic-ref', '-q', 'HEAD']);
|
|
52
|
+
if (!ref.ok && ref.code !== 1)
|
|
53
|
+
return undefined;
|
|
54
|
+
return ref.ok ? ref.stdout.trim() : null;
|
|
55
|
+
}
|
|
56
|
+
function autosaveBranchName(head) {
|
|
57
|
+
return head?.startsWith('refs/heads/') ? head.slice('refs/heads/'.length) : head;
|
|
58
|
+
}
|
|
59
|
+
function reportAutosave(onOutcome, outcome) {
|
|
60
|
+
try {
|
|
61
|
+
onOutcome?.(outcome);
|
|
62
|
+
}
|
|
63
|
+
catch { /* Reporting must not change what the save did. */ }
|
|
64
|
+
}
|
|
65
|
+
// HEAD is not the task branch: the work stays uncommitted, reported with the paths status saw.
|
|
66
|
+
function skipAutosave(head, status, onOutcome) {
|
|
67
|
+
reportAutosave(onOutcome, { result: 'skipped', branch: autosaveBranchName(head), changedPaths: status.split('\n').filter(Boolean).length });
|
|
68
|
+
return 'skipped';
|
|
69
|
+
}
|
|
70
|
+
/** A resolved merge, cherry-pick or revert the agent has not concluded: `git commit`
|
|
71
|
+
* would conclude it under `cezar autosave`. The agent concludes it with its own
|
|
72
|
+
* message; the next flush picks the work up (hearsay-tools/cezarion#1004). Asked of
|
|
73
|
+
* Git, not looked up as files: only MERGE_HEAD is always a file. CHERRY_PICK_HEAD and
|
|
74
|
+
* REVERT_HEAD are root refs in the ref backend, which a reftable repository keeps in
|
|
75
|
+
* its reftable stack, so a file check would miss them there. */
|
|
76
|
+
async function pendingAutosaveOperation(dir, reason, git) {
|
|
77
|
+
for (const pending of ['MERGE_HEAD', 'CHERRY_PICK_HEAD', 'REVERT_HEAD']) {
|
|
78
|
+
const found = await git(dir, ['rev-parse', '--verify', '-q', pending]);
|
|
79
|
+
if (found.ok) {
|
|
80
|
+
console.warn(`${logPrefix()} skipping ${reason} autosave in ${dir}: ${pending} is set, the operation is not concluded`);
|
|
81
|
+
return 'refused';
|
|
82
|
+
}
|
|
83
|
+
if (found.code !== 1)
|
|
84
|
+
return 'failed';
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
/** Commit as the CURRENT git user, so the branch's commits (and any PR opened from it) are
|
|
89
|
+
* attributed to the real author and pass CLA / attribution checks. The old hardcoded
|
|
90
|
+
* `cezar <cezar@local>` identity made every autosave look like a non-GitHub user. Fall back to
|
|
91
|
+
* that identity ONLY when the machine has no git identity configured — otherwise `git commit`
|
|
92
|
+
* would fail and the autosave (the run's recovery point) would be lost. */
|
|
93
|
+
async function autosaveIdentityArgs(dir, git) {
|
|
94
|
+
const name = await git(dir, ['config', 'user.name']);
|
|
95
|
+
if (!name.ok && name.code !== 1)
|
|
96
|
+
return 'failed';
|
|
97
|
+
const email = await git(dir, ['config', 'user.email']);
|
|
98
|
+
if (!email.ok && email.code !== 1)
|
|
99
|
+
return 'failed';
|
|
100
|
+
return (name.ok && name.stdout.trim() && email.ok && email.stdout.trim())
|
|
101
|
+
? [] : ['-c', 'user.name=cezar', '-c', 'user.email=cezar@local'];
|
|
102
|
+
}
|
|
103
|
+
async function commitAutosaveOnHead(dir, identityArgs, message, branch, onOutcome, git) {
|
|
104
|
+
const commit = await git(dir, [...identityArgs, 'commit', '--no-verify', '-m', message]);
|
|
105
|
+
if (!commit.ok)
|
|
106
|
+
return 'failed';
|
|
107
|
+
if (onOutcome) {
|
|
108
|
+
// The commit already landed: a failed read loses the sha, never the report.
|
|
109
|
+
const sha = await git(dir, ['rev-parse', '--short', 'HEAD']);
|
|
110
|
+
reportAutosave(onOutcome, { result: 'committed', sha: (sha.ok && sha.stdout.trim()) || null, branch });
|
|
111
|
+
}
|
|
112
|
+
return 'committed';
|
|
113
|
+
}
|
|
114
|
+
/** The task branch is written by compare-and-swap, never through HEAD: the agent can
|
|
115
|
+
* check another branch out after the `symbolic-ref` check in `readAutosaveHead`, and `git commit`
|
|
116
|
+
* resolves HEAD again at its own start, so the save landed on the agent's branch
|
|
117
|
+
* (review on hearsay-tools/cezarion#1111). `update-ref <ref> <new> <old>` moves the
|
|
118
|
+
* branch only while it still points at the tip read here (an unborn one: while it
|
|
119
|
+
* still does not exist); a moved branch fails the save and the next flush retries.
|
|
120
|
+
* Unlike the porcelain this runs no prepare-commit-msg or post-commit hook
|
|
121
|
+
* (`--no-verify` already skipped pre-commit and commit-msg), and the reflog entry
|
|
122
|
+
* reads `cezar autosave (<reason>)` without the `commit: ` prefix. commit-tree
|
|
123
|
+
* stopped reading commit.gpgSign in Git 2.9 (its release notes tell scripts to read
|
|
124
|
+
* it and pass -S), so it is read here: a user who signs every commit still does. */
|
|
125
|
+
async function writeAutosaveCommit(dir, taskBranch, identityArgs, message, git) {
|
|
126
|
+
const ref = `refs/heads/${taskBranch}`;
|
|
127
|
+
const tip = await git(dir, ['rev-parse', '--verify', '-q', ref]);
|
|
128
|
+
if (!tip.ok && tip.code !== 1)
|
|
129
|
+
return 'failed';
|
|
130
|
+
const parent = tip.ok ? tip.stdout.trim() : '';
|
|
131
|
+
const written = await git(dir, ['write-tree']);
|
|
132
|
+
const tree = written.stdout.trim();
|
|
133
|
+
if (!written.ok || !tree)
|
|
134
|
+
return 'failed';
|
|
135
|
+
if (parent) {
|
|
136
|
+
// Dirty when status looked, identical once staged: nothing to save.
|
|
137
|
+
const parentTree = await git(dir, ['rev-parse', '--verify', '-q', `${parent}^{tree}`]);
|
|
138
|
+
if (!parentTree.ok)
|
|
139
|
+
return 'failed';
|
|
140
|
+
if (parentTree.stdout.trim() === tree)
|
|
141
|
+
return 'nothing-to-do';
|
|
142
|
+
}
|
|
143
|
+
const sign = await git(dir, ['config', '--type=bool', 'commit.gpgsign']);
|
|
144
|
+
if (!sign.ok && sign.code !== 1)
|
|
145
|
+
return 'failed';
|
|
146
|
+
const created = await git(dir, [
|
|
147
|
+
...identityArgs,
|
|
148
|
+
'commit-tree',
|
|
149
|
+
...(sign.ok && sign.stdout.trim() === 'true' ? ['-S'] : []),
|
|
150
|
+
tree,
|
|
151
|
+
...(parent ? ['-p', parent] : []),
|
|
152
|
+
'-m',
|
|
153
|
+
message,
|
|
154
|
+
]);
|
|
155
|
+
const sha = created.stdout.trim();
|
|
156
|
+
if (!created.ok || !sha)
|
|
157
|
+
return 'failed';
|
|
158
|
+
return { sha, parent };
|
|
159
|
+
}
|
|
160
|
+
async function publishAutosaveCommit(dir, taskBranch, sha, parent, message, status, onOutcome, reason, git) {
|
|
161
|
+
const ref = `refs/heads/${taskBranch}`;
|
|
162
|
+
// The save is not atomic against the agent's own Git commands. It guarantees that no
|
|
163
|
+
// ref other than refs/heads/<taskBranch> moves, and that no merge, cherry-pick or
|
|
164
|
+
// revert Git has recorded as pending (its MERGE_HEAD, CHERRY_PICK_HEAD or REVERT_HEAD
|
|
165
|
+
// written) by this recheck is committed: the check before `add -A` cannot see one that
|
|
166
|
+
// starts after it, and the save would record that operation's content without its
|
|
167
|
+
// ancestry (review round 4 on hearsay-tools/cezarion#1004). An operation that starts
|
|
168
|
+
// after `write-tree` cannot be in this tree; one recorded before it is still pending
|
|
169
|
+
// here, unless the agent also concluded it, which moved the branch and fails the
|
|
170
|
+
// compare-and-swap, or aborted it within those few commands, whose content the save
|
|
171
|
+
// then still records. A Git command still running during the save is not excluded:
|
|
172
|
+
// `git merge` publishes the merged index before it writes MERGE_HEAD, so a save in
|
|
173
|
+
// between records that content single-parent, as `git add -A && git commit` always
|
|
174
|
+
// did (review round 5 reproduced the same result on main). The save also commits only
|
|
175
|
+
// when HEAD names the task branch at both of its reads, before `add -A` and here after
|
|
176
|
+
// `write-tree`, so a checkout between them skips it (review round 2 on
|
|
177
|
+
// hearsay-tools/cezarion#1111). A checkout away and back again between the reads is not
|
|
178
|
+
// excluded, nor is one still running, which writes the new index and working tree
|
|
179
|
+
// before it moves HEAD, so a save in between commits the other branch's files onto the
|
|
180
|
+
// task branch, as `git add -A && git commit` on main does. A refusal or a skip here
|
|
181
|
+
// leaves what `add -A` staged in the index, as every failure after it does.
|
|
182
|
+
const moved = await readAutosaveHead(dir, git);
|
|
183
|
+
if (moved === undefined)
|
|
184
|
+
return 'failed';
|
|
185
|
+
if (moved !== ref)
|
|
186
|
+
return skipAutosave(moved, status, onOutcome);
|
|
187
|
+
const late = await pendingAutosaveOperation(dir, reason, git);
|
|
188
|
+
if (late)
|
|
189
|
+
return late;
|
|
190
|
+
if (!(await git(dir, ['update-ref', '-m', message, ref, sha, parent])).ok)
|
|
191
|
+
return 'failed';
|
|
192
|
+
if (onOutcome) {
|
|
193
|
+
// The commit already landed: a failed read loses the sha, never the report.
|
|
194
|
+
const short = await git(dir, ['rev-parse', '--short', sha]);
|
|
195
|
+
reportAutosave(onOutcome, { result: 'committed', sha: (short.ok && short.stdout.trim()) || null, branch: taskBranch });
|
|
196
|
+
}
|
|
197
|
+
return 'committed';
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Stage and commit everything in the worktree as a "cezar autosave" commit
|
|
201
|
+
* (janitor pattern) — the agent's progress is recoverable from the `cez/<id8>`
|
|
202
|
+
* branch history. Quietly a no-op when nothing changed. With `taskBranch`, a
|
|
203
|
+
* worktree whose HEAD the agent moved to another branch (or detached) is left
|
|
204
|
+
* uncommitted instead: an autosave commit there lands in the agent's own PR
|
|
205
|
+
* history (hearsay-tools/cezarion#1004).
|
|
206
|
+
*
|
|
207
|
+
* The message carries `reason` so the opt-in periodic timer and the always-on
|
|
208
|
+
* flushes are distinguishable in `git log`; the `cezar autosave` prefix is kept
|
|
209
|
+
* so existing log greps still match.
|
|
210
|
+
*
|
|
211
|
+
* Refuses to commit a worktree that is mid-merge or still carries conflict
|
|
212
|
+
* markers: the incident behind #471 was an autosave capturing a half-resolved
|
|
213
|
+
* merge, and a blind `git add -A` would do it again.
|
|
214
|
+
*/
|
|
215
|
+
export async function autosaveCommit(dir, reason, options = {}) {
|
|
216
|
+
if (fallbackProjectWriteError(dir)) {
|
|
217
|
+
console.info(`${logPrefix()} Autosave skipped 1 read-only fallback worktree under .ai/squawk/.`);
|
|
218
|
+
return 'skipped';
|
|
219
|
+
}
|
|
220
|
+
let key = resolve(dir);
|
|
221
|
+
try {
|
|
222
|
+
key = realpathSync(dir);
|
|
223
|
+
}
|
|
224
|
+
catch { /* Missing/unreadable dir fails through Git. */ }
|
|
225
|
+
const previous = autosaves.get(key);
|
|
226
|
+
const task = (async () => {
|
|
227
|
+
if (previous)
|
|
228
|
+
await previous;
|
|
229
|
+
return save();
|
|
230
|
+
})();
|
|
231
|
+
autosaves.set(key, task);
|
|
232
|
+
try {
|
|
233
|
+
return await task;
|
|
234
|
+
}
|
|
235
|
+
finally {
|
|
236
|
+
if (autosaves.get(key) === task)
|
|
237
|
+
autosaves.delete(key);
|
|
238
|
+
}
|
|
239
|
+
async function save() {
|
|
240
|
+
const git = (cwd, args) => autosaveGit(cwd, args, options);
|
|
241
|
+
const status = await git(dir, ['status', '--porcelain']);
|
|
242
|
+
if (!status.ok)
|
|
243
|
+
return 'failed';
|
|
244
|
+
if (!status.stdout.trim())
|
|
245
|
+
return 'nothing-to-do';
|
|
246
|
+
const { taskBranch, onOutcome } = options;
|
|
247
|
+
let head = null;
|
|
248
|
+
if (taskBranch !== undefined || onOutcome) {
|
|
249
|
+
const read = await readAutosaveHead(dir, git);
|
|
250
|
+
if (read === undefined)
|
|
251
|
+
return 'failed';
|
|
252
|
+
head = read;
|
|
253
|
+
}
|
|
254
|
+
const branch = autosaveBranchName(head);
|
|
255
|
+
if (taskBranch !== undefined && head !== `refs/heads/${taskBranch}`)
|
|
256
|
+
return skipAutosave(head, status.stdout, onOutcome);
|
|
257
|
+
const unresolved = await unresolvedConflicts(dir, status.stdout);
|
|
258
|
+
if (unresolved) {
|
|
259
|
+
// Losing one recovery point beats poisoning the branch with a commit that
|
|
260
|
+
// does not build. For the periodic and turn-end flushes the next one picks
|
|
261
|
+
// the work up once the merge resolves; the pre-PR flush has no next one,
|
|
262
|
+
// which is why callers get `refused` rather than a bare `false`.
|
|
263
|
+
console.warn(`${logPrefix()} skipping ${reason} autosave in ${dir}: ${unresolved}`);
|
|
264
|
+
return 'refused';
|
|
265
|
+
}
|
|
266
|
+
if (taskBranch !== undefined) {
|
|
267
|
+
// Checked before staging too, so a pending operation's index stays as the agent left it.
|
|
268
|
+
const pending = await pendingAutosaveOperation(dir, reason, git);
|
|
269
|
+
if (pending)
|
|
270
|
+
return pending;
|
|
271
|
+
}
|
|
272
|
+
if (!(await git(dir, ['add', '-A'])).ok)
|
|
273
|
+
return 'failed';
|
|
274
|
+
const identityArgs = await autosaveIdentityArgs(dir, git);
|
|
275
|
+
if (identityArgs === 'failed')
|
|
276
|
+
return 'failed';
|
|
277
|
+
const message = `cezar autosave (${reason})`;
|
|
278
|
+
if (taskBranch === undefined) {
|
|
279
|
+
return commitAutosaveOnHead(dir, identityArgs, message, branch, onOutcome, git);
|
|
280
|
+
}
|
|
281
|
+
const written = await writeAutosaveCommit(dir, taskBranch, identityArgs, message, git);
|
|
282
|
+
if (written === 'failed' || written === 'nothing-to-do')
|
|
283
|
+
return written;
|
|
284
|
+
return publishAutosaveCommit(dir, taskBranch, written.sha, written.parent, message, status.stdout, onOutcome, reason, git);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Is the worktree mid-merge or still carrying conflict markers? Returns a
|
|
289
|
+
* human-readable reason, or `null` when it is safe to autosave.
|
|
290
|
+
*
|
|
291
|
+
* Two independent checks, because they catch different failures: porcelain `U`
|
|
292
|
+
* codes catch an *unresolved* merge, while the marker scan catches the worse
|
|
293
|
+
* case — someone ran `git add` on a file they had not finished resolving, which
|
|
294
|
+
* clears the `U` code but leaves `<<<<<<<` in the text.
|
|
295
|
+
*/
|
|
296
|
+
async function unresolvedConflicts(dir, porcelain) {
|
|
297
|
+
const entries = porcelain.split('\n').filter(Boolean);
|
|
298
|
+
const unmerged = entries.filter((line) => {
|
|
299
|
+
const xy = line.slice(0, 2);
|
|
300
|
+
// Unmerged per `git status` docs: any side U, plus the AA / DD collisions.
|
|
301
|
+
return xy.includes('U') || xy === 'AA' || xy === 'DD';
|
|
302
|
+
});
|
|
303
|
+
const firstUnmerged = unmerged[0];
|
|
304
|
+
if (firstUnmerged) {
|
|
305
|
+
return `${unmerged.length} unmerged path(s), e.g. ${firstUnmerged.slice(3)}`;
|
|
306
|
+
}
|
|
307
|
+
// Deleted paths have no content to scan. Untracked (`??`) ones are skipped
|
|
308
|
+
// even though `git add -A` will commit them: a conflict always lands in a
|
|
309
|
+
// tracked file, whereas an untracked fixture or doc that legitimately
|
|
310
|
+
// contains marker-shaped lines would otherwise wedge every autosave. False
|
|
311
|
+
// negatives here cost noise; false positives would cost the recovery point.
|
|
312
|
+
const candidates = entries
|
|
313
|
+
.filter((line) => !line.startsWith('D ') && !line.startsWith(' D') && !line.startsWith('??'))
|
|
314
|
+
.map((line) => {
|
|
315
|
+
// A rename reads `old -> new`; the new path is what gets committed.
|
|
316
|
+
const raw = line.slice(3).trim();
|
|
317
|
+
const path = raw.includes(' -> ') ? (raw.split(' -> ')[1] ?? raw) : raw;
|
|
318
|
+
return unquotePath(path);
|
|
319
|
+
});
|
|
320
|
+
for (const path of candidates) {
|
|
321
|
+
// Read the working tree, not the index: this runs before `git add -A`, so
|
|
322
|
+
// the on-disk copy is what would be committed. Binary files decode to
|
|
323
|
+
// mojibake rather than throwing, but cannot match the anchored marker
|
|
324
|
+
// pattern; unreadable paths (races, symlinks) are skipped, not fatal.
|
|
325
|
+
let text;
|
|
326
|
+
try {
|
|
327
|
+
const full = join(dir, path);
|
|
328
|
+
if ((await stat(full)).size > MARKER_SCAN_MAX_BYTES)
|
|
329
|
+
continue;
|
|
330
|
+
text = await readFile(full, 'utf8');
|
|
331
|
+
}
|
|
332
|
+
catch {
|
|
333
|
+
continue;
|
|
334
|
+
}
|
|
335
|
+
if (hasConflictMarkers(text)) {
|
|
336
|
+
return `leftover conflict markers in ${path}`;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Undo `git status --porcelain` path quoting. Git quotes a path containing a
|
|
343
|
+
* space or a non-ASCII byte, escaping the latter as octal — `café.txt` reads
|
|
344
|
+
* back as `"caf\303\251.txt"`. Stripping the quotes alone leaves those escapes
|
|
345
|
+
* literal, so the file would not open and a real conflict in it would go
|
|
346
|
+
* unnoticed. Decoding the octal bytes as UTF-8 restores the actual name.
|
|
347
|
+
*/
|
|
348
|
+
function unquotePath(path) {
|
|
349
|
+
if (!path.startsWith('"') || !path.endsWith('"'))
|
|
350
|
+
return path;
|
|
351
|
+
const inner = path.slice(1, -1);
|
|
352
|
+
const bytes = [];
|
|
353
|
+
for (let i = 0; i < inner.length; i += 1) {
|
|
354
|
+
if (inner[i] !== '\\') {
|
|
355
|
+
bytes.push(...Buffer.from(inner[i], 'utf8'));
|
|
356
|
+
continue;
|
|
357
|
+
}
|
|
358
|
+
const next = inner[i + 1];
|
|
359
|
+
if (next === undefined)
|
|
360
|
+
break;
|
|
361
|
+
const octal = inner.slice(i + 1, i + 4);
|
|
362
|
+
if (/^[0-7]{3}$/.test(octal)) {
|
|
363
|
+
bytes.push(parseInt(octal, 8));
|
|
364
|
+
i += 3;
|
|
365
|
+
continue;
|
|
366
|
+
}
|
|
367
|
+
// C-style single-character escapes git also emits.
|
|
368
|
+
const simple = { n: 10, t: 9, r: 13, '"': 34, '\\': 92 };
|
|
369
|
+
const escaped = simple[next];
|
|
370
|
+
if (escaped === undefined)
|
|
371
|
+
bytes.push(...Buffer.from(next, 'utf8'));
|
|
372
|
+
else
|
|
373
|
+
bytes.push(escaped);
|
|
374
|
+
i += 1;
|
|
375
|
+
}
|
|
376
|
+
return Buffer.from(bytes).toString('utf8');
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=autosave-commit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autosave-commit.js","sourceRoot":"","sources":["../src/autosave-commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAwB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkC1C;;;;;;;;GAQG;AACH,MAAM,cAAc,GAAG,eAAe,CAAC;AACvC,MAAM,YAAY,GAAG,eAAe,CAAC;AACrC,MAAM,YAAY,GAAG,eAAe,CAAC;AAErC;;;;;;;GAOG;AACH,MAAM,qBAAqB,GAAG,SAAS,CAAC;AAExC,8DAA8D;AAC9D,SAAS,kBAAkB,CAAC,IAAY;IACtC,IAAI,IAAI,GAAc,CAAC,CAAC,CAAC,2CAA2C;IACpE,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;gBAAE,IAAI,GAAG,CAAC,CAAC;QA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';
|
|
2
3
|
import { cezarAskRequestSchema, cezarCancelWaitRequestSchema, cezarDoneRequestSchema, cezarWaitRequestSchema } from '../contract/index.js';
|
|
3
4
|
import { ASK_LIMITS } from '../contract/index.js';
|
|
4
5
|
import { previewStopRequestSchema, previewServeRequestSchema } from '../contract/index.js';
|
|
@@ -10,7 +11,7 @@ export function previewToolEnabled(env = process.env) {
|
|
|
10
11
|
}
|
|
11
12
|
/** Automations are on unless the value is exactly `0` (spec 2026-10-02-scheduled-automations). */
|
|
12
13
|
export function automationsToolEnabled(env = process.env) {
|
|
13
|
-
return
|
|
14
|
+
return automationsEnabled(env);
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* The Anthropic tool API refuses a top-level `oneOf`/`anyOf`/`allOf`, so `cezar_wait` advertises
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../../src/ci-wait/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACzJ,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACtH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACrE,OAAO,UAAU,CAAC,SAAS,EAAE,GAAG,CAAC,KAAK,GAAG,CAAC;AAC5C,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,sBAAsB,CAAC,GAAG,GAAsB,OAAO,CAAC,GAAG;IACzE,OAAO,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AAC,CAAC,CAAC,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7I,CAAC"}
|
|
@@ -15,6 +15,15 @@ export declare const ONCE_MIN_LATEST_START_MINUTES = 10;
|
|
|
15
15
|
export declare const ONCE_MAX_LATEST_START_MINUTES = 43200;
|
|
16
16
|
/** The refusal of a one-time schedule whose time has passed: the server's 400 and the editor's field message. */
|
|
17
17
|
export declare const ONCE_PAST_DUE_MESSAGE = "the due time has passed; choose a later time or use Run now";
|
|
18
|
+
/** Where a one-time schedule stands, derived by the server so clients never re-derive it. */
|
|
19
|
+
export declare const onceStatusSchema: z.ZodEnum<{
|
|
20
|
+
archived: "archived";
|
|
21
|
+
failed: "failed";
|
|
22
|
+
missed: "missed";
|
|
23
|
+
paused: "paused";
|
|
24
|
+
waiting: "waiting";
|
|
25
|
+
}>;
|
|
26
|
+
export type OnceStatus = z.infer<typeof onceStatusSchema>;
|
|
18
27
|
export declare function unknownTimeZoneMessage(zone: string): string;
|
|
19
28
|
export declare const automationScheduleSchema: z.ZodObject<{
|
|
20
29
|
type: z.ZodEnum<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export { onceStatusSchema, type OnceStatus } from './automation-schedule.ts';
|
|
2
3
|
/**
|
|
3
4
|
* Closed automation wire schemas. Storage schemas preserve unknown keys separately. Parity
|
|
4
5
|
* checks compare named response fields in both directions; open storage catchalls limit
|
|
@@ -124,15 +125,6 @@ export declare const automationArchiveSchema: z.ZodObject<{
|
|
|
124
125
|
}>>;
|
|
125
126
|
}, z.core.$strip>;
|
|
126
127
|
export type AutomationArchive = z.infer<typeof automationArchiveSchema>;
|
|
127
|
-
/** Where a one-time schedule stands, derived by the server so clients never re-derive it. */
|
|
128
|
-
export declare const onceStatusSchema: z.ZodEnum<{
|
|
129
|
-
archived: "archived";
|
|
130
|
-
failed: "failed";
|
|
131
|
-
missed: "missed";
|
|
132
|
-
paused: "paused";
|
|
133
|
-
waiting: "waiting";
|
|
134
|
-
}>;
|
|
135
|
-
export type OnceStatus = z.infer<typeof onceStatusSchema>;
|
|
136
128
|
/** One stored automation, as every route that answers a single definition serves it. */
|
|
137
129
|
export declare const automationDefinitionSchema: z.ZodObject<{
|
|
138
130
|
id: z.ZodString;
|