refactor(agent): dedupe harness and command workflows

This commit is contained in:
Peter Steinberger
2026-02-16 14:52:09 +00:00
parent 04892ee230
commit f717a13039
204 changed files with 7366 additions and 11540 deletions

View File

@@ -114,21 +114,7 @@ function parseGmailSetupOptions(raw: Record<string, unknown>): GmailSetupOptions
return {
account,
project: stringOption(raw.project),
topic: common.topic,
subscription: common.subscription,
label: common.label,
hookUrl: common.hookUrl,
hookToken: common.hookToken,
pushToken: common.pushToken,
bind: common.bind,
port: common.port,
path: common.path,
includeBody: common.includeBody,
maxBytes: common.maxBytes,
renewEveryMinutes: common.renewEveryMinutes,
tailscale: common.tailscaleRaw as GmailSetupOptions["tailscale"],
tailscalePath: common.tailscalePath,
tailscaleTarget: common.tailscaleTarget,
...gmailOptionsFromCommon(common),
pushEndpoint: stringOption(raw.pushEndpoint),
json: Boolean(raw.json),
};
@@ -138,21 +124,7 @@ function parseGmailRunOptions(raw: Record<string, unknown>): GmailRunOptions {
const common = parseGmailCommonOptions(raw);
return {
account: stringOption(raw.account),
topic: common.topic,
subscription: common.subscription,
label: common.label,
hookUrl: common.hookUrl,
hookToken: common.hookToken,
pushToken: common.pushToken,
bind: common.bind,
port: common.port,
path: common.path,
includeBody: common.includeBody,
maxBytes: common.maxBytes,
renewEveryMinutes: common.renewEveryMinutes,
tailscale: common.tailscaleRaw as GmailRunOptions["tailscale"],
tailscalePath: common.tailscalePath,
tailscaleTarget: common.tailscaleTarget,
...gmailOptionsFromCommon(common),
};
}
@@ -176,6 +148,28 @@ function parseGmailCommonOptions(raw: Record<string, unknown>) {
};
}
function gmailOptionsFromCommon(
common: ReturnType<typeof parseGmailCommonOptions>,
): Omit<GmailRunOptions, "account"> {
return {
topic: common.topic,
subscription: common.subscription,
label: common.label,
hookUrl: common.hookUrl,
hookToken: common.hookToken,
pushToken: common.pushToken,
bind: common.bind,
port: common.port,
path: common.path,
includeBody: common.includeBody,
maxBytes: common.maxBytes,
renewEveryMinutes: common.renewEveryMinutes,
tailscale: common.tailscaleRaw as GmailRunOptions["tailscale"],
tailscalePath: common.tailscalePath,
tailscaleTarget: common.tailscaleTarget,
};
}
function stringOption(value: unknown): string | undefined {
if (typeof value !== "string") {
return undefined;