@rcpooley/concord 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +318 -0
- package/bin/concord.service +69 -0
- package/dist/age.d.ts +20 -0
- package/dist/age.d.ts.map +1 -0
- package/dist/age.js +58 -0
- package/dist/age.js.map +1 -0
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +301 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/daemon.d.ts +4 -0
- package/dist/daemon.d.ts.map +1 -0
- package/dist/daemon.js +394 -0
- package/dist/daemon.js.map +1 -0
- package/dist/eval-config.d.ts +2 -0
- package/dist/eval-config.d.ts.map +1 -0
- package/dist/eval-config.js +45 -0
- package/dist/eval-config.js.map +1 -0
- package/dist/exec.d.ts +168 -0
- package/dist/exec.d.ts.map +1 -0
- package/dist/exec.js +313 -0
- package/dist/exec.js.map +1 -0
- package/dist/git.d.ts +59 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +265 -0
- package/dist/git.js.map +1 -0
- package/dist/hook.d.ts +37 -0
- package/dist/hook.d.ts.map +1 -0
- package/dist/hook.js +89 -0
- package/dist/hook.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +76 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +236 -0
- package/dist/init.js.map +1 -0
- package/dist/loader.d.ts +35 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +230 -0
- package/dist/loader.js.map +1 -0
- package/dist/module.d.ts +116 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +100 -0
- package/dist/module.js.map +1 -0
- package/dist/modules/apt/index.d.ts +45 -0
- package/dist/modules/apt/index.d.ts.map +1 -0
- package/dist/modules/apt/index.js +249 -0
- package/dist/modules/apt/index.js.map +1 -0
- package/dist/modules/apt/schema.d.ts +63 -0
- package/dist/modules/apt/schema.d.ts.map +1 -0
- package/dist/modules/apt/schema.js +75 -0
- package/dist/modules/apt/schema.js.map +1 -0
- package/dist/modules/checkout/index.d.ts +88 -0
- package/dist/modules/checkout/index.d.ts.map +1 -0
- package/dist/modules/checkout/index.js +382 -0
- package/dist/modules/checkout/index.js.map +1 -0
- package/dist/modules/checkout/schema.d.ts +52 -0
- package/dist/modules/checkout/schema.d.ts.map +1 -0
- package/dist/modules/checkout/schema.js +132 -0
- package/dist/modules/checkout/schema.js.map +1 -0
- package/dist/modules/cloudflare/api.d.ts +64 -0
- package/dist/modules/cloudflare/api.d.ts.map +1 -0
- package/dist/modules/cloudflare/api.js +98 -0
- package/dist/modules/cloudflare/api.js.map +1 -0
- package/dist/modules/cloudflare/index.d.ts +74 -0
- package/dist/modules/cloudflare/index.d.ts.map +1 -0
- package/dist/modules/cloudflare/index.js +374 -0
- package/dist/modules/cloudflare/index.js.map +1 -0
- package/dist/modules/cloudflare/schema.d.ts +62 -0
- package/dist/modules/cloudflare/schema.d.ts.map +1 -0
- package/dist/modules/cloudflare/schema.js +85 -0
- package/dist/modules/cloudflare/schema.js.map +1 -0
- package/dist/modules/docker/index.d.ts +83 -0
- package/dist/modules/docker/index.d.ts.map +1 -0
- package/dist/modules/docker/index.js +470 -0
- package/dist/modules/docker/index.js.map +1 -0
- package/dist/modules/docker/registry.d.ts +35 -0
- package/dist/modules/docker/registry.d.ts.map +1 -0
- package/dist/modules/docker/registry.js +95 -0
- package/dist/modules/docker/registry.js.map +1 -0
- package/dist/modules/docker/render.d.ts +45 -0
- package/dist/modules/docker/render.d.ts.map +1 -0
- package/dist/modules/docker/render.js +162 -0
- package/dist/modules/docker/render.js.map +1 -0
- package/dist/modules/docker/schema.d.ts +231 -0
- package/dist/modules/docker/schema.d.ts.map +1 -0
- package/dist/modules/docker/schema.js +335 -0
- package/dist/modules/docker/schema.js.map +1 -0
- package/dist/modules/docker/sweeper.d.ts +64 -0
- package/dist/modules/docker/sweeper.d.ts.map +1 -0
- package/dist/modules/docker/sweeper.js +94 -0
- package/dist/modules/docker/sweeper.js.map +1 -0
- package/dist/modules/file/index.d.ts +79 -0
- package/dist/modules/file/index.d.ts.map +1 -0
- package/dist/modules/file/index.js +305 -0
- package/dist/modules/file/index.js.map +1 -0
- package/dist/modules/file/schema.d.ts +45 -0
- package/dist/modules/file/schema.d.ts.map +1 -0
- package/dist/modules/file/schema.js +114 -0
- package/dist/modules/file/schema.js.map +1 -0
- package/dist/modules/index.d.ts +20 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/index.js +11 -0
- package/dist/modules/index.js.map +1 -0
- package/dist/modules/porkbun/api.d.ts +36 -0
- package/dist/modules/porkbun/api.d.ts.map +1 -0
- package/dist/modules/porkbun/api.js +62 -0
- package/dist/modules/porkbun/api.js.map +1 -0
- package/dist/modules/porkbun/index.d.ts +50 -0
- package/dist/modules/porkbun/index.d.ts.map +1 -0
- package/dist/modules/porkbun/index.js +236 -0
- package/dist/modules/porkbun/index.js.map +1 -0
- package/dist/modules/porkbun/schema.d.ts +38 -0
- package/dist/modules/porkbun/schema.d.ts.map +1 -0
- package/dist/modules/porkbun/schema.js +39 -0
- package/dist/modules/porkbun/schema.js.map +1 -0
- package/dist/modules/script/index.d.ts +43 -0
- package/dist/modules/script/index.d.ts.map +1 -0
- package/dist/modules/script/index.js +116 -0
- package/dist/modules/script/index.js.map +1 -0
- package/dist/modules/script/schema.d.ts +25 -0
- package/dist/modules/script/schema.d.ts.map +1 -0
- package/dist/modules/script/schema.js +63 -0
- package/dist/modules/script/schema.js.map +1 -0
- package/dist/modules/systemd/index.d.ts +93 -0
- package/dist/modules/systemd/index.d.ts.map +1 -0
- package/dist/modules/systemd/index.js +394 -0
- package/dist/modules/systemd/index.js.map +1 -0
- package/dist/modules/systemd/render.d.ts +41 -0
- package/dist/modules/systemd/render.d.ts.map +1 -0
- package/dist/modules/systemd/render.js +252 -0
- package/dist/modules/systemd/render.js.map +1 -0
- package/dist/modules/systemd/schema.d.ts +293 -0
- package/dist/modules/systemd/schema.d.ts.map +1 -0
- package/dist/modules/systemd/schema.js +302 -0
- package/dist/modules/systemd/schema.js.map +1 -0
- package/dist/modules/systemd/sweeper.d.ts +31 -0
- package/dist/modules/systemd/sweeper.d.ts.map +1 -0
- package/dist/modules/systemd/sweeper.js +77 -0
- package/dist/modules/systemd/sweeper.js.map +1 -0
- package/dist/plans.d.ts +132 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +315 -0
- package/dist/plans.js.map +1 -0
- package/dist/records.d.ts +37 -0
- package/dist/records.d.ts.map +1 -0
- package/dist/records.js +100 -0
- package/dist/records.js.map +1 -0
- package/dist/registry.d.ts +38 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +31 -0
- package/dist/registry.js.map +1 -0
- package/dist/runner.d.ts +48 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +150 -0
- package/dist/runner.js.map +1 -0
- package/dist/scheduler.d.ts +36 -0
- package/dist/scheduler.d.ts.map +1 -0
- package/dist/scheduler.js +77 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/schema.d.ts +762 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +185 -0
- package/dist/schema.js.map +1 -0
- package/dist/secret.d.ts +24 -0
- package/dist/secret.d.ts.map +1 -0
- package/dist/secret.js +3 -0
- package/dist/secret.js.map +1 -0
- package/dist/ui.d.ts +62 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +288 -0
- package/dist/ui.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Unit directives are STRICTLY typed — there is no `extra: Record<string,string>`
|
|
4
|
+
* escape hatch on purpose.
|
|
5
|
+
*
|
|
6
|
+
* `.strict()` turns an undeclared directive into a loud config error instead of
|
|
7
|
+
* a silently-ignored one, and adding a field here is a two-line change. This is
|
|
8
|
+
* the deliberate loosening point if an exotic directive ever justifies it.
|
|
9
|
+
*/
|
|
10
|
+
const UnitName = z
|
|
11
|
+
.string()
|
|
12
|
+
.regex(/^[a-zA-Z0-9@:._\\-]+\.(service|timer|socket|target|mount|path)$/, 'must be a unit name including its suffix, e.g. "docker.service"');
|
|
13
|
+
const Deps = z.array(z.string().min(1)).min(1);
|
|
14
|
+
/** systemd accepts bare seconds or a span like "30s" / "5min" / "infinity". */
|
|
15
|
+
const TimeSpan = z.union([z.number().int().nonnegative(), z.string().min(1)]);
|
|
16
|
+
const Command = z.string().min(1);
|
|
17
|
+
// ------------------------------------------------------------------ [Unit] ---
|
|
18
|
+
const UnitSectionFields = {
|
|
19
|
+
description: z.string().min(1),
|
|
20
|
+
documentation: z.array(z.string().url()).optional(),
|
|
21
|
+
after: Deps.optional(),
|
|
22
|
+
before: Deps.optional(),
|
|
23
|
+
wants: Deps.optional(),
|
|
24
|
+
requires: Deps.optional(),
|
|
25
|
+
bindsTo: Deps.optional(),
|
|
26
|
+
partOf: Deps.optional(),
|
|
27
|
+
conflicts: Deps.optional(),
|
|
28
|
+
conditionPathExists: z.string().startsWith('/').optional(),
|
|
29
|
+
/**
|
|
30
|
+
* Rate-limit the restart loop. Both or neither — systemd reads them as a
|
|
31
|
+
* pair, and setting one alone silently keeps the default for the other.
|
|
32
|
+
*
|
|
33
|
+
* They live in `[Unit]`, not `[Service]`, which is exactly the trap a
|
|
34
|
+
* hand-written drop-in falls into: put them under `[Service]` and systemd ignores them without a word.
|
|
35
|
+
*/
|
|
36
|
+
startLimitIntervalSec: TimeSpan.optional(),
|
|
37
|
+
startLimitBurst: z.number().int().nonnegative().max(1000).optional(),
|
|
38
|
+
};
|
|
39
|
+
// --------------------------------------------------------------- [Service] ---
|
|
40
|
+
const ServiceSectionSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
type: z.enum(['simple', 'exec', 'forking', 'oneshot', 'notify', 'idle']).optional(),
|
|
43
|
+
/** An array renders repeated `ExecStart=` lines — valid only for `oneshot`. */
|
|
44
|
+
execStart: z.union([Command, z.array(Command).min(1)]),
|
|
45
|
+
execStartPre: z.array(Command).min(1).optional(),
|
|
46
|
+
execStartPost: z.array(Command).min(1).optional(),
|
|
47
|
+
execStop: Command.optional(),
|
|
48
|
+
/** Declaring this is what makes `onChange: 'reload'` legal for the unit. */
|
|
49
|
+
execReload: Command.optional(),
|
|
50
|
+
user: z.string().min(1).optional(),
|
|
51
|
+
group: z.string().min(1).optional(),
|
|
52
|
+
workingDirectory: z.string().startsWith('/').optional(),
|
|
53
|
+
/**
|
|
54
|
+
* Literal values: Concord escapes the quotes and backslashes it would
|
|
55
|
+
* otherwise break. `%` specifiers still expand (write `%%` for a percent).
|
|
56
|
+
* Names follow systemd's own rule, which rejects anything else at load.
|
|
57
|
+
*/
|
|
58
|
+
environment: z
|
|
59
|
+
.record(z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/, 'must be a valid environment variable name'), z.string())
|
|
60
|
+
.optional(),
|
|
61
|
+
environmentFile: z
|
|
62
|
+
.union([z.string().startsWith('/'), z.array(z.string().startsWith('/')).min(1)])
|
|
63
|
+
.optional(),
|
|
64
|
+
restart: z
|
|
65
|
+
.enum(['no', 'always', 'on-success', 'on-failure', 'on-abnormal', 'on-abort', 'on-watchdog'])
|
|
66
|
+
.optional(),
|
|
67
|
+
restartSec: TimeSpan.optional(),
|
|
68
|
+
/**
|
|
69
|
+
* What gets killed on stop or restart.
|
|
70
|
+
*
|
|
71
|
+
* `process` kills ONLY the main process and leaves the rest of the cgroup
|
|
72
|
+
* running, which matters for a service that spawns long-lived children (a
|
|
73
|
+
* tmux server, say) inside its cgroup: the default (`control-group`)
|
|
74
|
+
* would take every one of them down with a restart.
|
|
75
|
+
* `mixed` sends SIGTERM to the main process and SIGKILL to the rest.
|
|
76
|
+
*/
|
|
77
|
+
killMode: z.enum(['control-group', 'mixed', 'process', 'none']).optional(),
|
|
78
|
+
/**
|
|
79
|
+
* Exit codes to treat as success, verbatim (e.g. `0 1 128`).
|
|
80
|
+
*
|
|
81
|
+
* For a oneshot whose failure is expected and benign — a `git pull
|
|
82
|
+
* --ff-only` that correctly refuses a diverged branch has done its job,
|
|
83
|
+
* and marking the unit failed for it only teaches people to ignore
|
|
84
|
+
* failures.
|
|
85
|
+
*/
|
|
86
|
+
successExitStatus: z.string().min(1).optional(),
|
|
87
|
+
remainAfterExit: z.boolean().optional(),
|
|
88
|
+
timeoutStartSec: TimeSpan.optional(),
|
|
89
|
+
timeoutStopSec: TimeSpan.optional(),
|
|
90
|
+
standardOutput: z.string().min(1).optional(),
|
|
91
|
+
standardError: z.string().min(1).optional(),
|
|
92
|
+
syslogIdentifier: z.string().min(1).optional(),
|
|
93
|
+
oomScoreAdjust: z.number().int().min(-1000).max(1000).optional(),
|
|
94
|
+
})
|
|
95
|
+
.strict()
|
|
96
|
+
.superRefine((s, ctx) => {
|
|
97
|
+
if (Array.isArray(s.execStart) && s.execStart.length > 1 && s.type !== 'oneshot') {
|
|
98
|
+
ctx.addIssue({
|
|
99
|
+
code: 'custom',
|
|
100
|
+
path: ['execStart'],
|
|
101
|
+
message: 'multiple ExecStart lines require type: "oneshot"',
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
// ----------------------------------------------------------------- [Timer] ---
|
|
106
|
+
const TimerSectionSchema = z
|
|
107
|
+
.object({
|
|
108
|
+
onCalendar: z.union([z.string().min(1), z.array(z.string().min(1)).min(1)]).optional(),
|
|
109
|
+
onBootSec: TimeSpan.optional(),
|
|
110
|
+
onStartupSec: TimeSpan.optional(),
|
|
111
|
+
onActiveSec: TimeSpan.optional(),
|
|
112
|
+
onUnitActiveSec: TimeSpan.optional(),
|
|
113
|
+
randomizedDelaySec: TimeSpan.optional(),
|
|
114
|
+
/** Run immediately if the trigger was missed while the host was down. */
|
|
115
|
+
persistent: z.boolean().optional(),
|
|
116
|
+
accuracySec: TimeSpan.optional(),
|
|
117
|
+
/** Defaults to the same basename with `.service`. */
|
|
118
|
+
unit: UnitName.optional(),
|
|
119
|
+
})
|
|
120
|
+
.strict();
|
|
121
|
+
/**
|
|
122
|
+
* [Path] — activate a unit when a filesystem path changes.
|
|
123
|
+
*
|
|
124
|
+
* The one way a container can ask the host to do something without a socket, a
|
|
125
|
+
* docker socket mount, or any privilege: it writes a file, and systemd on the
|
|
126
|
+
* host reacts. Used by the webhook receiver to trigger a reconcile.
|
|
127
|
+
*/
|
|
128
|
+
export const PathSectionSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
/** Fires when the file is written and closed. The usual choice. */
|
|
131
|
+
pathModified: z.array(z.string().startsWith('/')).min(1).optional(),
|
|
132
|
+
pathExists: z.array(z.string().startsWith('/')).min(1).optional(),
|
|
133
|
+
directoryNotEmpty: z.array(z.string().startsWith('/')).min(1).optional(),
|
|
134
|
+
/** Defaults to the same basename with `.service`. */
|
|
135
|
+
unit: UnitName.optional(),
|
|
136
|
+
/**
|
|
137
|
+
* systemd creates the WATCHED PATH ITSELF as a directory — not its parent.
|
|
138
|
+
* So this is only ever right with `directoryNotEmpty`; using it with
|
|
139
|
+
* `pathModified` produces a directory where a file was meant to go, and the
|
|
140
|
+
* writer then fails with EISDIR. Declare the parent with the `file` module
|
|
141
|
+
* instead.
|
|
142
|
+
*/
|
|
143
|
+
makeDirectory: z.boolean().optional(),
|
|
144
|
+
})
|
|
145
|
+
.strict()
|
|
146
|
+
.superRefine((p, ctx) => {
|
|
147
|
+
if (!p.pathModified && !p.pathExists && !p.directoryNotEmpty) {
|
|
148
|
+
ctx.addIssue({ code: 'custom', message: 'a path unit needs something to watch' });
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
// ------------------------------------------------------------- unit file ----
|
|
152
|
+
export const UnitFileSchema = z
|
|
153
|
+
.object({
|
|
154
|
+
...UnitSectionFields,
|
|
155
|
+
service: ServiceSectionSchema.optional(),
|
|
156
|
+
timer: TimerSectionSchema.optional(),
|
|
157
|
+
path: PathSectionSchema.optional(),
|
|
158
|
+
/** [Install]. Without one of these, `enabled: true` has nothing to link. */
|
|
159
|
+
wantedBy: Deps.optional(),
|
|
160
|
+
requiredBy: Deps.optional(),
|
|
161
|
+
})
|
|
162
|
+
.strict()
|
|
163
|
+
.superRefine((u, ctx) => {
|
|
164
|
+
const kinds = [u.service, u.timer, u.path].filter(Boolean).length;
|
|
165
|
+
// "needs a section" is enforced on UnitSchema instead, where the unit NAME
|
|
166
|
+
// is in scope — a .target legitimately has none.
|
|
167
|
+
if (kinds > 1) {
|
|
168
|
+
ctx.addIssue({
|
|
169
|
+
code: 'custom',
|
|
170
|
+
message: 'service, timer and path sections are mutually exclusive — one unit, one kind',
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
// --------------------------------------------------------------- watches ----
|
|
175
|
+
export const WatchSchema = z
|
|
176
|
+
.object({
|
|
177
|
+
paths: z.array(z.string().startsWith('/')).min(1),
|
|
178
|
+
/**
|
|
179
|
+
* Required, with no default, on purpose.
|
|
180
|
+
*
|
|
181
|
+
* `reload` is far gentler — dockerd's ExecReload is a SIGHUP and does not
|
|
182
|
+
* drop containers — but it silently does NOTHING for settings read only at
|
|
183
|
+
* startup, such as `daemon.json`'s address pool. A default would make that
|
|
184
|
+
* silent no-op the easy path.
|
|
185
|
+
*/
|
|
186
|
+
onChange: z.enum(['restart', 'reload']),
|
|
187
|
+
})
|
|
188
|
+
.strict();
|
|
189
|
+
// ---------------------------------------------------------------- module ----
|
|
190
|
+
export const UnitSchema = z
|
|
191
|
+
.object({
|
|
192
|
+
name: UnitName,
|
|
193
|
+
/** `[Install]` symlinks — i.e. does it come up at boot. */
|
|
194
|
+
enabled: z.boolean().optional(),
|
|
195
|
+
/** Is it running right now. Independent of `enabled`. */
|
|
196
|
+
active: z.boolean().optional(),
|
|
197
|
+
/**
|
|
198
|
+
* Present = Concord owns the unit FILE at /etc/systemd/system/<name>.
|
|
199
|
+
* Absent = a vendor unit whose state is managed but whose file is not.
|
|
200
|
+
*/
|
|
201
|
+
unit: UnitFileSchema.optional(),
|
|
202
|
+
/**
|
|
203
|
+
* Files whose change should restart or reload this unit.
|
|
204
|
+
*
|
|
205
|
+
* Stateless: a watched file's mtime is compared to the unit's
|
|
206
|
+
* `ActiveEnterTimestamp`. If the unit started after the file was written,
|
|
207
|
+
* the config is already loaded. No hash database, and correct on the very
|
|
208
|
+
* first run on a bare host — where a hash baseline would not exist yet.
|
|
209
|
+
*/
|
|
210
|
+
watches: z.array(WatchSchema).min(1).optional(),
|
|
211
|
+
/** Seconds to wait for a started unit to settle. */
|
|
212
|
+
healthTimeout: z.number().int().positive().max(600).optional(),
|
|
213
|
+
})
|
|
214
|
+
.strict()
|
|
215
|
+
.superRefine((u, ctx) => {
|
|
216
|
+
if (u.unit && !/\.(service|timer|path|target)$/.test(u.name)) {
|
|
217
|
+
ctx.addIssue({
|
|
218
|
+
code: 'custom',
|
|
219
|
+
path: ['unit'],
|
|
220
|
+
message: 'only .service, .timer, .path and .target units can be generated',
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// A .target is PURE grouping: its whole content is the [Unit] section —
|
|
224
|
+
// `Wants=` the things it pulls in — and systemd starts and stops them
|
|
225
|
+
// together. Every other kind needs a section saying what it DOES.
|
|
226
|
+
if (u.unit && !u.unit.service && !u.unit.timer && !u.unit.path && !u.name.endsWith('.target')) {
|
|
227
|
+
ctx.addIssue({
|
|
228
|
+
code: 'custom',
|
|
229
|
+
path: ['unit'],
|
|
230
|
+
message: 'a generated unit needs a service, timer or path section (or be a .target)',
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (u.unit?.service && u.name.endsWith('.target')) {
|
|
234
|
+
ctx.addIssue({
|
|
235
|
+
code: 'custom',
|
|
236
|
+
path: ['unit', 'service'],
|
|
237
|
+
message: 'a .target groups other units — it cannot have a service section',
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
if (u.unit?.timer && !u.name.endsWith('.timer')) {
|
|
241
|
+
ctx.addIssue({ code: 'custom', path: ['unit', 'timer'], message: 'timer section requires a .timer unit' });
|
|
242
|
+
}
|
|
243
|
+
if (u.unit?.path && !u.name.endsWith('.path')) {
|
|
244
|
+
ctx.addIssue({ code: 'custom', path: ['unit', 'path'], message: 'path section requires a .path unit' });
|
|
245
|
+
}
|
|
246
|
+
if (u.unit?.service && !u.name.endsWith('.service')) {
|
|
247
|
+
ctx.addIssue({
|
|
248
|
+
code: 'custom',
|
|
249
|
+
path: ['unit', 'service'],
|
|
250
|
+
message: 'service section requires a .service unit',
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (u.watches && u.active === false) {
|
|
254
|
+
ctx.addIssue({
|
|
255
|
+
code: 'custom',
|
|
256
|
+
path: ['watches'],
|
|
257
|
+
message: 'watches are meaningless on a unit declared inactive',
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (u.enabled === true && u.unit && !u.unit.wantedBy && !u.unit.requiredBy) {
|
|
261
|
+
ctx.addIssue({
|
|
262
|
+
code: 'custom',
|
|
263
|
+
path: ['unit'],
|
|
264
|
+
message: 'enabled: true needs wantedBy or requiredBy — systemctl enable has nothing to link',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
// Catchable here rather than at 3am: a reload of a unit with no ExecReload
|
|
268
|
+
// is accepted by systemd and does nothing.
|
|
269
|
+
if (u.unit?.service && u.watches?.some((w) => w.onChange === 'reload') && !u.unit.service.execReload) {
|
|
270
|
+
ctx.addIssue({
|
|
271
|
+
code: 'custom',
|
|
272
|
+
path: ['watches'],
|
|
273
|
+
message: 'onChange "reload" needs service.execReload, or it silently does nothing',
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
export const SystemdConfigSchema = z
|
|
278
|
+
.object({
|
|
279
|
+
type: z.literal('systemd'),
|
|
280
|
+
id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/, 'must be kebab-case, starting alphanumeric'),
|
|
281
|
+
/**
|
|
282
|
+
* ⚠️ ADDITIVE, like `apt` and `file`. This host has 184 static + 59 enabled
|
|
283
|
+
* units; undeclared ones are never read and never touched.
|
|
284
|
+
*/
|
|
285
|
+
/**
|
|
286
|
+
* Which host this runs on — a key of the config's `hosts` registry.
|
|
287
|
+
*
|
|
288
|
+
* REQUIRED, with no default. A silently-defaulting host is a way to run
|
|
289
|
+
* something on the wrong machine, and "wherever Concord happens to be
|
|
290
|
+
* running" is not a property a config should depend on.
|
|
291
|
+
*/
|
|
292
|
+
host: z.string().min(1),
|
|
293
|
+
units: z.array(UnitSchema).optional(),
|
|
294
|
+
/** Stopped, then masked — the only way to say "never run this, ever". */
|
|
295
|
+
masked: z.array(UnitName).optional(),
|
|
296
|
+
// There is deliberately no `absent`. Every unit Concord writes carries
|
|
297
|
+
// `X-Concord=1`, and the per-host sweeper withdraws any tagged unit no
|
|
298
|
+
// module declares — removal is DERIVED from what is declared, never
|
|
299
|
+
// declared itself. Hand-written cruft is a human's to remove.
|
|
300
|
+
})
|
|
301
|
+
.strict();
|
|
302
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../src/modules/systemd/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;GAOG;AAEH,MAAM,QAAQ,GAAG,CAAC;KACf,MAAM,EAAE;KACR,KAAK,CACJ,iEAAiE,EACjE,iEAAiE,CAClE,CAAA;AAEH,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;AAC9C,+EAA+E;AAC/E,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GA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,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACrG,GAAG,CAAC,QAAQ,CAAC;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,SAAS,CAAC;YACjB,OAAO,EAAE,yEAAyE;SACnF,CAAC,CAAA;IACJ,CAAC;AACH,CAAC,CAAC,CAAA;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC;KACjC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,sBAAsB,EAAE,2CAA2C,CAAC;IAEzF;;;OAGG;IAEH;;;;;;OAMG;IACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;IAErC,yEAAyE;IACzE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE;IAEpC,uEAAuE;IACvE,uEAAuE;IACvE,oEAAoE;IACpE,8DAA8D;CAC/D,CAAC;KACD,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Module } from '../../module.js';
|
|
2
|
+
import { type SystemdOp } from './index.js';
|
|
3
|
+
/**
|
|
4
|
+
* End-of-run host-truth enforcement for systemd units.
|
|
5
|
+
*
|
|
6
|
+
* Every unit file Concord writes carries `X-Concord=1` in `[Unit]` (see
|
|
7
|
+
* render.ts). This module reads the tagged set off the host, subtracts the
|
|
8
|
+
* keep-set — every unit name any systemd module on the host writes, unioned
|
|
9
|
+
* by the loader from `owned()` — and withdraws the remainder. Hand-written
|
|
10
|
+
* and vendor units never carry the tag, so they are structurally invisible:
|
|
11
|
+
* the sweep can only ever remove what Concord itself created.
|
|
12
|
+
*
|
|
13
|
+
* Never declared in config. The loader synthesizes one per registry host
|
|
14
|
+
* (every host — a host whose last systemd module was deleted still gets its
|
|
15
|
+
* orphans removed) and appends it after every declared module, so removals
|
|
16
|
+
* run last, exactly like the docker sweep's tail position.
|
|
17
|
+
*/
|
|
18
|
+
export interface SweepState {
|
|
19
|
+
/** Unit names carrying the ownership tag. */
|
|
20
|
+
tagged: string[];
|
|
21
|
+
}
|
|
22
|
+
export declare class SystemdSweeper extends Module<SweepState, SystemdOp> {
|
|
23
|
+
private readonly keep;
|
|
24
|
+
readonly kind = "systemd";
|
|
25
|
+
constructor(host: string, keep: ReadonlySet<string>);
|
|
26
|
+
desired(): Promise<SweepState>;
|
|
27
|
+
read(): Promise<SweepState>;
|
|
28
|
+
diff(actual: SweepState, desired: SweepState): SystemdOp[];
|
|
29
|
+
apply(ops: SystemdOp[]): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=sweeper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweeper.d.ts","sourceRoot":"","sources":["../../../src/modules/systemd/sweeper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAA4C,KAAK,SAAS,EAAE,MAAM,YAAY,CAAA;AAErF;;;;;;;;;;;;;;GAcG;AAEH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB;AAUD,qBAAa,cAAe,SAAQ,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC;IAK7D,OAAO,CAAC,QAAQ,CAAC,IAAI;IAJvB,SAAkB,IAAI,aAAY;gBAGhC,IAAI,EAAE,MAAM,EACK,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC;IAKtC,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC;IAI9B,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;IA8BjC,IAAI,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,EAAE;IAgBpD,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAa7C"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Module } from '../../module.js';
|
|
2
|
+
import { SELF_UNITS, UNIT_DIR, selfUnit, unitPath } from './index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A discovered filename is untrusted input off the host: it becomes argv to
|
|
5
|
+
* `systemctl` and `rm`, so anything that does not look like a unit name is
|
|
6
|
+
* reported and refused rather than passed through.
|
|
7
|
+
*/
|
|
8
|
+
const UNIT_FILE_NAME = /^[A-Za-z0-9][A-Za-z0-9:_.\\@-]*\.(service|socket|target|timer|path|mount|automount|swap|slice|scope)$/;
|
|
9
|
+
export class SystemdSweeper extends Module {
|
|
10
|
+
keep;
|
|
11
|
+
kind = 'systemd';
|
|
12
|
+
constructor(host, keep) {
|
|
13
|
+
super('sweep', host);
|
|
14
|
+
this.keep = keep;
|
|
15
|
+
}
|
|
16
|
+
async desired() {
|
|
17
|
+
return { tagged: [...this.keep].sort() };
|
|
18
|
+
}
|
|
19
|
+
async read() {
|
|
20
|
+
// Top-level files only: never inside .d/, .wants/, .requires/ — drop-ins
|
|
21
|
+
// and enablement symlinks belong to their unit, not to the sweep. grep -l
|
|
22
|
+
// exits 1 when nothing is tagged; that is an answer, not an error, and
|
|
23
|
+
// run() never throws on exit codes.
|
|
24
|
+
const r = this.exec.run('find', [
|
|
25
|
+
UNIT_DIR, '-maxdepth', '1', '-type', 'f',
|
|
26
|
+
'-exec', 'grep', '-l', '^X-Concord=', '{}', '+',
|
|
27
|
+
]);
|
|
28
|
+
const tagged = [];
|
|
29
|
+
for (const line of r.stdout.split('\n')) {
|
|
30
|
+
const name = line.trim().split('/').pop() ?? '';
|
|
31
|
+
if (!line.trim())
|
|
32
|
+
continue;
|
|
33
|
+
if (!UNIT_FILE_NAME.test(name)) {
|
|
34
|
+
this.log(` ⚠ ignoring tagged file with a name that is not a unit name: ${JSON.stringify(name)}`);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
// The bootstrap boundary, defense in depth: Concord never writes its own
|
|
38
|
+
// units, so a tagged self-unit means someone tagged it by hand. Refuse
|
|
39
|
+
// loudly rather than ever letting "sweep" and "concord.service" meet.
|
|
40
|
+
if (SELF_UNITS.has(name) || name === selfUnit()) {
|
|
41
|
+
this.log(` ⚠ ${name} carries X-Concord but is Concord's own unit — refusing to consider it`);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
tagged.push(name);
|
|
45
|
+
}
|
|
46
|
+
return { tagged: tagged.sort() };
|
|
47
|
+
}
|
|
48
|
+
diff(actual, desired) {
|
|
49
|
+
const keep = new Set(desired.tagged);
|
|
50
|
+
// One direction only: tagged-but-undeclared is withdrawn. Declared-but-
|
|
51
|
+
// untagged is the writing module's business (it rewrites the file), and
|
|
52
|
+
// undeclared-untagged is not Concord's at all.
|
|
53
|
+
return actual.tagged
|
|
54
|
+
.filter((name) => !keep.has(name))
|
|
55
|
+
.map((name) => ({
|
|
56
|
+
kind: 'delete',
|
|
57
|
+
entity: 'removal',
|
|
58
|
+
id: `unit/${name}`,
|
|
59
|
+
summary: `withdraw ${name} (tagged X-Concord, no longer declared)`,
|
|
60
|
+
name,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
async apply(ops) {
|
|
64
|
+
for (const op of ops) {
|
|
65
|
+
// `disable --now` stops and unlinks enablement in one step, and
|
|
66
|
+
// tolerates a unit that is already stopped or already disabled.
|
|
67
|
+
this.exec.sudoCombined(['systemctl', 'disable', '--now', op.name]);
|
|
68
|
+
this.exec.sudo(['rm', '-f', unitPath(op.name)]);
|
|
69
|
+
this.log(` ✓ delete: ${op.summary}`);
|
|
70
|
+
}
|
|
71
|
+
if (ops.length) {
|
|
72
|
+
this.exec.sudo(['systemctl', 'daemon-reload']);
|
|
73
|
+
this.log(' ✓ systemctl daemon-reload');
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=sweeper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sweeper.js","sourceRoot":"","sources":["../../../src/modules/systemd/sweeper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAkB,MAAM,YAAY,CAAA;AAuBrF;;;;GAIG;AACH,MAAM,cAAc,GAClB,uGAAuG,CAAA;AAEzG,MAAM,OAAO,cAAe,SAAQ,MAA6B;IAK5C;IAJD,IAAI,GAAG,SAAS,CAAA;IAElC,YACE,IAAY,EACK,IAAyB;QAE1C,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAFH,SAAI,GAAJ,IAAI,CAAqB;IAG5C,CAAC;IAED,KAAK,CAAC,OAAO;QACX,OAAO,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAA;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI;QACR,yEAAyE;QACzE,0EAA0E;QAC1E,uEAAuE;QACvE,oCAAoC;QACpC,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;YAC9B,QAAQ,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG;YACxC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG;SAChD,CAAC,CAAA;QAEF,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,MA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KAAK,CAAC,GAAgB;QAC1B,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACrB,gEAAgE;YAChE,gEAAgE;YAChE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;YAClE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAC/C,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;QACvC,CAAC;QACD,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC,CAAA;YAC9C,IAAI,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;QACzC,CAAC;IACH,CAAC;CACF"}
|
package/dist/plans.d.ts
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans on request: "what would Concord do if this BRANCH of the config were
|
|
3
|
+
* main?" — so anyone (or any agent) who can reach the UI can see a change's
|
|
4
|
+
* effect before merging it, without a shell on the reconciler host.
|
|
5
|
+
*
|
|
6
|
+
* Three rules shape everything here:
|
|
7
|
+
*
|
|
8
|
+
* 1. **A plan never touches the daemon's own checkout or state.** It has its
|
|
9
|
+
* own clone (`<home>/plans/config`) and its own CONCORD_HOME, so a plan
|
|
10
|
+
* cannot reset the config the daemon deploys from, or race it on the
|
|
11
|
+
* docker module's git mirrors.
|
|
12
|
+
*
|
|
13
|
+
* 2. **A plan runs in a child process.** `concord plan` evaluates the
|
|
14
|
+
* branch's config and drives every module's read() — code that can hang,
|
|
15
|
+
* throw or leak. In a child, the worst case is a killed child; the
|
|
16
|
+
* reconcile loop never notices (daemon rule 2).
|
|
17
|
+
*
|
|
18
|
+
* 3. **A branch that is behind main is REFUSED, not planned.** A plan shows
|
|
19
|
+
* the branch's entire desired state, not a diff against main, so a branch
|
|
20
|
+
* cut before someone else's push plans that push being UNDONE — and
|
|
21
|
+
* merging it would really undo it. Rebase, then plan.
|
|
22
|
+
*
|
|
23
|
+
* Plans run one at a time, alongside (never instead of) real reconciles.
|
|
24
|
+
* There is no apply here: applying is merging to main.
|
|
25
|
+
*/
|
|
26
|
+
export type PlanStatus = 'queued' | 'running' | 'refused' | 'failed' | 'planned';
|
|
27
|
+
/** One module's part of a plan — what `concord plan --result` writes. */
|
|
28
|
+
export interface PlanModule {
|
|
29
|
+
scope: string;
|
|
30
|
+
kind: string;
|
|
31
|
+
id: string;
|
|
32
|
+
host?: string;
|
|
33
|
+
ops: {
|
|
34
|
+
kind: string;
|
|
35
|
+
id: string;
|
|
36
|
+
summary: string;
|
|
37
|
+
}[];
|
|
38
|
+
error?: string;
|
|
39
|
+
unreachable?: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface PlanResult {
|
|
42
|
+
sha: string;
|
|
43
|
+
totalOps: number;
|
|
44
|
+
failed: boolean;
|
|
45
|
+
skipped: string[];
|
|
46
|
+
unreachable: string[];
|
|
47
|
+
warnings: {
|
|
48
|
+
scope: string;
|
|
49
|
+
message: string;
|
|
50
|
+
}[];
|
|
51
|
+
modules: PlanModule[];
|
|
52
|
+
}
|
|
53
|
+
export interface PlanRecord {
|
|
54
|
+
id: string;
|
|
55
|
+
branch: string;
|
|
56
|
+
/** The sha the caller said the branch should be at, if any. */
|
|
57
|
+
expectedSha?: string;
|
|
58
|
+
/** What the branch actually resolved to — the commit that was planned. */
|
|
59
|
+
sha?: string;
|
|
60
|
+
mainSha?: string;
|
|
61
|
+
/** Commits on the branch that are not on main, newest first. */
|
|
62
|
+
ahead?: {
|
|
63
|
+
sha: string;
|
|
64
|
+
subject: string;
|
|
65
|
+
}[];
|
|
66
|
+
status: PlanStatus;
|
|
67
|
+
/** Why a plan was refused or failed, in one line. */
|
|
68
|
+
error?: string;
|
|
69
|
+
/** A real reconcile was running at some point during this plan. */
|
|
70
|
+
overlappedRun?: boolean;
|
|
71
|
+
requestedAt: string;
|
|
72
|
+
startedAt?: string;
|
|
73
|
+
finishedAt?: string;
|
|
74
|
+
result?: PlanResult;
|
|
75
|
+
log: string[];
|
|
76
|
+
}
|
|
77
|
+
/** The fields a list shows. Logs and results stay on the detail. */
|
|
78
|
+
export type PlanSummary = Omit<PlanRecord, 'log' | 'result'> & {
|
|
79
|
+
totalOps?: number;
|
|
80
|
+
};
|
|
81
|
+
export declare function summarize(p: PlanRecord): PlanSummary;
|
|
82
|
+
/** How the service starts one plan child. Injectable so tests need no reconciler. */
|
|
83
|
+
export type PlanCommand = (opts: {
|
|
84
|
+
configDir: string;
|
|
85
|
+
home: string;
|
|
86
|
+
resultPath: string;
|
|
87
|
+
}) => {
|
|
88
|
+
command: string;
|
|
89
|
+
args: string[];
|
|
90
|
+
env: NodeJS.ProcessEnv;
|
|
91
|
+
};
|
|
92
|
+
export interface PlanServiceOptions {
|
|
93
|
+
/** Where the config repo is cloned from — the daemon's CONCORD_CONFIG_REPO. */
|
|
94
|
+
repoUrl: string;
|
|
95
|
+
/** The plan workspace: its clone, its CONCORD_HOME and its records. */
|
|
96
|
+
root: string;
|
|
97
|
+
command: PlanCommand;
|
|
98
|
+
/** Whether a real reconcile is in flight right now. */
|
|
99
|
+
reconcileRunning?: () => boolean;
|
|
100
|
+
/** The branch everything is planned against. */
|
|
101
|
+
mainBranch?: string;
|
|
102
|
+
/** Most plans waiting at once; past it, requests are turned away. */
|
|
103
|
+
maxQueued?: number;
|
|
104
|
+
timeoutMs?: number;
|
|
105
|
+
keep?: number;
|
|
106
|
+
log?: (scope: string, message: string) => void;
|
|
107
|
+
}
|
|
108
|
+
export declare class PlanError extends Error {
|
|
109
|
+
readonly status: number;
|
|
110
|
+
constructor(message: string, status: number);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Whether `name` is acceptable as a branch to plan.
|
|
114
|
+
*
|
|
115
|
+
* The name reaches git as an argument, never through a shell, so this is not
|
|
116
|
+
* the injection barrier — it is the barrier against option injection (a
|
|
117
|
+
* leading `-`) and against names git would reject anyway, with a message a
|
|
118
|
+
* caller can act on.
|
|
119
|
+
*/
|
|
120
|
+
export declare function validBranch(name: unknown): name is string;
|
|
121
|
+
export declare function validSha(sha: unknown): sha is string;
|
|
122
|
+
export declare class PlanService {
|
|
123
|
+
#private;
|
|
124
|
+
constructor(opts: PlanServiceOptions);
|
|
125
|
+
/** Queue a plan. Throws PlanError for a request that can never succeed. */
|
|
126
|
+
request(branch: unknown, expectedSha?: unknown): PlanRecord;
|
|
127
|
+
get(id: string): PlanRecord | undefined;
|
|
128
|
+
list(limit?: number): PlanSummary[];
|
|
129
|
+
/** Resolves with the record once it is finished, or after `ms`, whichever is first. */
|
|
130
|
+
wait(id: string, ms: number): Promise<PlanRecord | undefined>;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAEhF,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,C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