@autohq/cli 0.1.212 → 0.1.213
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/agent-bridge.js +18 -4
- package/dist/index.js +58 -7
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -20843,12 +20843,20 @@ var ConnectionRemoveResponseSchema = external_exports.object({
|
|
|
20843
20843
|
|
|
20844
20844
|
// ../../packages/schemas/src/github-sync.ts
|
|
20845
20845
|
var GITHUB_SYNC_AUTO_PATH = ".auto";
|
|
20846
|
+
var GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS = 15e3;
|
|
20846
20847
|
var GithubSyncRepositoryFullNameSchema = external_exports.string().trim().min(1).regex(/^[^/\s]+\/[^/\s]+$/, {
|
|
20847
20848
|
message: "repository must be in owner/name form"
|
|
20848
20849
|
});
|
|
20849
20850
|
var GithubSyncProductionBranchSchema = external_exports.string().trim().min(1).max(255).refine((branch) => !branch.startsWith("/") && !branch.endsWith("/"), {
|
|
20850
20851
|
message: "branch must not start or end with /"
|
|
20851
20852
|
});
|
|
20853
|
+
var GithubSyncCiWatchdogWorkflowSchema = external_exports.object({
|
|
20854
|
+
workflowId: external_exports.string().trim().min(1).max(255)
|
|
20855
|
+
}).strict();
|
|
20856
|
+
var GithubSyncCiWatchdogSchema = external_exports.object({
|
|
20857
|
+
workflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
|
|
20858
|
+
checkDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
|
|
20859
|
+
}).strict();
|
|
20852
20860
|
var GithubSyncBindingSchema = external_exports.object({
|
|
20853
20861
|
id: external_exports.string().trim().min(1),
|
|
20854
20862
|
organizationId: OrganizationIdSchema,
|
|
@@ -20859,6 +20867,7 @@ var GithubSyncBindingSchema = external_exports.object({
|
|
|
20859
20867
|
repoId: external_exports.string().trim().min(1).nullable(),
|
|
20860
20868
|
productionBranch: GithubSyncProductionBranchSchema,
|
|
20861
20869
|
autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
|
|
20870
|
+
ciWatchdog: GithubSyncCiWatchdogSchema,
|
|
20862
20871
|
enabled: external_exports.boolean(),
|
|
20863
20872
|
lastPlannedSha: external_exports.string().trim().min(1).nullable(),
|
|
20864
20873
|
lastAppliedSha: external_exports.string().trim().min(1).nullable(),
|
|
@@ -20869,7 +20878,8 @@ var GithubSyncBindingCreateRequestSchema = external_exports.object({
|
|
|
20869
20878
|
connection: external_exports.string().trim().min(1).optional(),
|
|
20870
20879
|
repo: GithubSyncRepositoryFullNameSchema,
|
|
20871
20880
|
repoId: external_exports.string().trim().min(1).optional(),
|
|
20872
|
-
branch: GithubSyncProductionBranchSchema.optional()
|
|
20881
|
+
branch: GithubSyncProductionBranchSchema.optional(),
|
|
20882
|
+
ciWatchdog: GithubSyncCiWatchdogSchema.optional()
|
|
20873
20883
|
});
|
|
20874
20884
|
var GithubSyncBindingCreateResponseSchema = external_exports.object({
|
|
20875
20885
|
binding: GithubSyncBindingSchema,
|
|
@@ -21439,8 +21449,11 @@ var GithubPullRequestMergeabilityWorkflowInputSchema = external_exports.object({
|
|
|
21439
21449
|
repoFullName: external_exports.string().trim().min(1),
|
|
21440
21450
|
pullRequestNumber: external_exports.number().int().positive(),
|
|
21441
21451
|
headSha: external_exports.string().trim().min(1),
|
|
21452
|
+
headRef: external_exports.string().trim().min(1).optional(),
|
|
21442
21453
|
baseSha: external_exports.string().trim().min(1).optional(),
|
|
21443
|
-
|
|
21454
|
+
ciWatchdogWorkflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
|
|
21455
|
+
retryDelaysMs: external_exports.array(external_exports.number().int().nonnegative()).default([1e3, 2e3, 5e3, 1e4, 15e3]),
|
|
21456
|
+
ciWorkflowRunCheckDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
|
|
21444
21457
|
}).strict();
|
|
21445
21458
|
var GithubPullRequestMergeabilityWorkflowResultSchema = external_exports.union([
|
|
21446
21459
|
external_exports.object({
|
|
@@ -21457,7 +21470,8 @@ var GithubPullRequestMergeabilityWorkflowResultSchema = external_exports.union([
|
|
|
21457
21470
|
// Present when the pull request was behind its base with auto-merge
|
|
21458
21471
|
// enabled: "updated" if a branch update was requested, "skipped" if
|
|
21459
21472
|
// GitHub rejected it (e.g. the head moved since lookup).
|
|
21460
|
-
branchUpdate: external_exports.enum(["updated", "skipped"]).optional()
|
|
21473
|
+
branchUpdate: external_exports.enum(["updated", "skipped"]).optional(),
|
|
21474
|
+
ciWorkflowDispatch: external_exports.enum(["dispatched", "present", "skipped"]).optional()
|
|
21461
21475
|
})
|
|
21462
21476
|
]);
|
|
21463
21477
|
var EventRoutingTriggerResultSchema = external_exports.object({
|
|
@@ -26787,7 +26801,7 @@ Object.assign(lookup, {
|
|
|
26787
26801
|
// package.json
|
|
26788
26802
|
var package_default = {
|
|
26789
26803
|
name: "@autohq/cli",
|
|
26790
|
-
version: "0.1.
|
|
26804
|
+
version: "0.1.213",
|
|
26791
26805
|
license: "SEE LICENSE IN README.md",
|
|
26792
26806
|
publishConfig: {
|
|
26793
26807
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -16492,7 +16492,7 @@ var init_connections = __esm({
|
|
|
16492
16492
|
});
|
|
16493
16493
|
|
|
16494
16494
|
// ../../packages/schemas/src/github-sync.ts
|
|
16495
|
-
var GITHUB_SYNC_AUTO_PATH, GithubSyncRepositoryFullNameSchema, GithubSyncProductionBranchSchema, GithubSyncBindingSchema, GithubSyncBindingCreateRequestSchema, GithubSyncBindingCreateResponseSchema, GithubSyncBindingListResponseSchema, GithubSyncTriggerArtifactSchema, GithubSyncWorkflowInputSchema, GithubSyncWorkflowResultSchema;
|
|
16495
|
+
var GITHUB_SYNC_AUTO_PATH, GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS, GithubSyncRepositoryFullNameSchema, GithubSyncProductionBranchSchema, GithubSyncCiWatchdogWorkflowSchema, GithubSyncCiWatchdogSchema, GithubSyncBindingSchema, GithubSyncBindingCreateRequestSchema, GithubSyncBindingCreateResponseSchema, GithubSyncBindingListResponseSchema, GithubSyncTriggerArtifactSchema, GithubSyncWorkflowInputSchema, GithubSyncWorkflowResultSchema;
|
|
16496
16496
|
var init_github_sync = __esm({
|
|
16497
16497
|
"../../packages/schemas/src/github-sync.ts"() {
|
|
16498
16498
|
"use strict";
|
|
@@ -16500,12 +16500,20 @@ var init_github_sync = __esm({
|
|
|
16500
16500
|
init_ids();
|
|
16501
16501
|
init_primitives();
|
|
16502
16502
|
GITHUB_SYNC_AUTO_PATH = ".auto";
|
|
16503
|
+
GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS = 15e3;
|
|
16503
16504
|
GithubSyncRepositoryFullNameSchema = external_exports.string().trim().min(1).regex(/^[^/\s]+\/[^/\s]+$/, {
|
|
16504
16505
|
message: "repository must be in owner/name form"
|
|
16505
16506
|
});
|
|
16506
16507
|
GithubSyncProductionBranchSchema = external_exports.string().trim().min(1).max(255).refine((branch) => !branch.startsWith("/") && !branch.endsWith("/"), {
|
|
16507
16508
|
message: "branch must not start or end with /"
|
|
16508
16509
|
});
|
|
16510
|
+
GithubSyncCiWatchdogWorkflowSchema = external_exports.object({
|
|
16511
|
+
workflowId: external_exports.string().trim().min(1).max(255)
|
|
16512
|
+
}).strict();
|
|
16513
|
+
GithubSyncCiWatchdogSchema = external_exports.object({
|
|
16514
|
+
workflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
|
|
16515
|
+
checkDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
|
|
16516
|
+
}).strict();
|
|
16509
16517
|
GithubSyncBindingSchema = external_exports.object({
|
|
16510
16518
|
id: external_exports.string().trim().min(1),
|
|
16511
16519
|
organizationId: OrganizationIdSchema,
|
|
@@ -16516,6 +16524,7 @@ var init_github_sync = __esm({
|
|
|
16516
16524
|
repoId: external_exports.string().trim().min(1).nullable(),
|
|
16517
16525
|
productionBranch: GithubSyncProductionBranchSchema,
|
|
16518
16526
|
autoPath: external_exports.literal(GITHUB_SYNC_AUTO_PATH),
|
|
16527
|
+
ciWatchdog: GithubSyncCiWatchdogSchema,
|
|
16519
16528
|
enabled: external_exports.boolean(),
|
|
16520
16529
|
lastPlannedSha: external_exports.string().trim().min(1).nullable(),
|
|
16521
16530
|
lastAppliedSha: external_exports.string().trim().min(1).nullable(),
|
|
@@ -16526,7 +16535,8 @@ var init_github_sync = __esm({
|
|
|
16526
16535
|
connection: external_exports.string().trim().min(1).optional(),
|
|
16527
16536
|
repo: GithubSyncRepositoryFullNameSchema,
|
|
16528
16537
|
repoId: external_exports.string().trim().min(1).optional(),
|
|
16529
|
-
branch: GithubSyncProductionBranchSchema.optional()
|
|
16538
|
+
branch: GithubSyncProductionBranchSchema.optional(),
|
|
16539
|
+
ciWatchdog: GithubSyncCiWatchdogSchema.optional()
|
|
16530
16540
|
});
|
|
16531
16541
|
GithubSyncBindingCreateResponseSchema = external_exports.object({
|
|
16532
16542
|
binding: GithubSyncBindingSchema,
|
|
@@ -17052,6 +17062,7 @@ var init_trigger_router = __esm({
|
|
|
17052
17062
|
"../../packages/schemas/src/trigger-router.ts"() {
|
|
17053
17063
|
"use strict";
|
|
17054
17064
|
init_zod();
|
|
17065
|
+
init_github_sync();
|
|
17055
17066
|
init_ids();
|
|
17056
17067
|
init_primitives();
|
|
17057
17068
|
CANONICAL_ROUTE_BY_KINDS = [
|
|
@@ -17157,8 +17168,11 @@ var init_trigger_router = __esm({
|
|
|
17157
17168
|
repoFullName: external_exports.string().trim().min(1),
|
|
17158
17169
|
pullRequestNumber: external_exports.number().int().positive(),
|
|
17159
17170
|
headSha: external_exports.string().trim().min(1),
|
|
17171
|
+
headRef: external_exports.string().trim().min(1).optional(),
|
|
17160
17172
|
baseSha: external_exports.string().trim().min(1).optional(),
|
|
17161
|
-
|
|
17173
|
+
ciWatchdogWorkflows: external_exports.array(GithubSyncCiWatchdogWorkflowSchema).max(10).default([]),
|
|
17174
|
+
retryDelaysMs: external_exports.array(external_exports.number().int().nonnegative()).default([1e3, 2e3, 5e3, 1e4, 15e3]),
|
|
17175
|
+
ciWorkflowRunCheckDelayMs: external_exports.number().int().nonnegative().default(GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS)
|
|
17162
17176
|
}).strict();
|
|
17163
17177
|
GithubPullRequestMergeabilityWorkflowResultSchema = external_exports.union([
|
|
17164
17178
|
external_exports.object({
|
|
@@ -17175,7 +17189,8 @@ var init_trigger_router = __esm({
|
|
|
17175
17189
|
// Present when the pull request was behind its base with auto-merge
|
|
17176
17190
|
// enabled: "updated" if a branch update was requested, "skipped" if
|
|
17177
17191
|
// GitHub rejected it (e.g. the head moved since lookup).
|
|
17178
|
-
branchUpdate: external_exports.enum(["updated", "skipped"]).optional()
|
|
17192
|
+
branchUpdate: external_exports.enum(["updated", "skipped"]).optional(),
|
|
17193
|
+
ciWorkflowDispatch: external_exports.enum(["dispatched", "present", "skipped"]).optional()
|
|
17179
17194
|
})
|
|
17180
17195
|
]);
|
|
17181
17196
|
EventRoutingTriggerResultSchema = external_exports.object({
|
|
@@ -21814,7 +21829,7 @@ var init_package = __esm({
|
|
|
21814
21829
|
"package.json"() {
|
|
21815
21830
|
package_default = {
|
|
21816
21831
|
name: "@autohq/cli",
|
|
21817
|
-
version: "0.1.
|
|
21832
|
+
version: "0.1.213",
|
|
21818
21833
|
license: "SEE LICENSE IN README.md",
|
|
21819
21834
|
publishConfig: {
|
|
21820
21835
|
access: "public"
|
|
@@ -37590,6 +37605,9 @@ function registerSetupCommands(program, context) {
|
|
|
37590
37605
|
});
|
|
37591
37606
|
}
|
|
37592
37607
|
|
|
37608
|
+
// src/commands/sync/actions.ts
|
|
37609
|
+
init_src();
|
|
37610
|
+
|
|
37593
37611
|
// src/commands/sync/repo.ts
|
|
37594
37612
|
import { execFile as execFileWithCallback } from "child_process";
|
|
37595
37613
|
import { promisify } from "util";
|
|
@@ -37658,7 +37676,15 @@ async function enableGithubSyncAction(context, repoArgument, options) {
|
|
|
37658
37676
|
{
|
|
37659
37677
|
connection: connection.name,
|
|
37660
37678
|
repo,
|
|
37661
|
-
...options.branch ? { branch: options.branch } : {}
|
|
37679
|
+
...options.branch ? { branch: options.branch } : {},
|
|
37680
|
+
...options.ciWatchdogWorkflow?.length ? {
|
|
37681
|
+
ciWatchdog: {
|
|
37682
|
+
workflows: options.ciWatchdogWorkflow.map((workflowId) => ({
|
|
37683
|
+
workflowId
|
|
37684
|
+
})),
|
|
37685
|
+
checkDelayMs: options.ciWatchdogDelayMs ?? GITHUB_SYNC_CI_WATCHDOG_DEFAULT_DELAY_MS
|
|
37686
|
+
}
|
|
37687
|
+
} : {}
|
|
37662
37688
|
},
|
|
37663
37689
|
{ apiBaseUrl: apiUrlFromOptions(context, options) }
|
|
37664
37690
|
);
|
|
@@ -37675,6 +37701,11 @@ async function enableGithubSyncAction(context, repoArgument, options) {
|
|
|
37675
37701
|
`${style.label("branch")} ${result.binding.productionBranch}`
|
|
37676
37702
|
);
|
|
37677
37703
|
context.writeOutput(`${style.label("path")} ${result.binding.autoPath}`);
|
|
37704
|
+
if (result.binding.ciWatchdog.workflows.length > 0) {
|
|
37705
|
+
context.writeOutput(
|
|
37706
|
+
`${style.label("ci watchdog")} ${result.binding.ciWatchdog.workflows.map((workflow) => workflow.workflowId).join(", ")}`
|
|
37707
|
+
);
|
|
37708
|
+
}
|
|
37678
37709
|
}
|
|
37679
37710
|
async function listSyncBindingsAction(context, options) {
|
|
37680
37711
|
const project = await requireProjectScope({
|
|
@@ -37698,6 +37729,7 @@ async function listSyncBindingsAction(context, options) {
|
|
|
37698
37729
|
binding.repoFullName,
|
|
37699
37730
|
`branch=${binding.productionBranch}`,
|
|
37700
37731
|
`path=${binding.autoPath}`,
|
|
37732
|
+
`ciWatchdog=${binding.ciWatchdog.workflows.map((workflow) => workflow.workflowId).join(",") || "-"}`,
|
|
37701
37733
|
`lastApplied=${binding.lastAppliedSha ?? "-"}`
|
|
37702
37734
|
].join(" ")
|
|
37703
37735
|
);
|
|
@@ -37708,7 +37740,16 @@ async function listSyncBindingsAction(context, options) {
|
|
|
37708
37740
|
function registerSyncCommands(program, context) {
|
|
37709
37741
|
const sync = program.command("sync").description("Manage repository Sync bindings.");
|
|
37710
37742
|
const enable = sync.command("enable").description("Enable Sync.");
|
|
37711
|
-
enable.command("github").description("Enable Sync for a GitHub repository.").argument("[repo]", "GitHub repository in owner/name form").option("--connection <name>", "GitHub connection name or id").option("--branch <branch>", "production branch to apply from").option(
|
|
37743
|
+
enable.command("github").description("Enable Sync for a GitHub repository.").argument("[repo]", "GitHub repository in owner/name form").option("--connection <name>", "GitHub connection name or id").option("--branch <branch>", "production branch to apply from").option(
|
|
37744
|
+
"--ci-watchdog-workflow <workflow>",
|
|
37745
|
+
"GitHub Actions workflow id to re-dispatch when a PR head is missing CI; repeat for multiple workflows",
|
|
37746
|
+
collectValues,
|
|
37747
|
+
[]
|
|
37748
|
+
).option(
|
|
37749
|
+
"--ci-watchdog-delay-ms <ms>",
|
|
37750
|
+
"delay before checking for missing CI workflow runs",
|
|
37751
|
+
parseNonnegativeInteger
|
|
37752
|
+
).option("-y, --yes", "skip confirmation prompt").option("--api-url <url>", "Auto API base URL").option("--api-base-url <url>", "Auto API base URL").action(
|
|
37712
37753
|
async (repo, commandOptions) => {
|
|
37713
37754
|
await enableGithubSyncAction(context, repo, commandOptions);
|
|
37714
37755
|
}
|
|
@@ -37717,6 +37758,16 @@ function registerSyncCommands(program, context) {
|
|
|
37717
37758
|
await listSyncBindingsAction(context, commandOptions);
|
|
37718
37759
|
});
|
|
37719
37760
|
}
|
|
37761
|
+
function collectValues(value, values) {
|
|
37762
|
+
return [...values, value];
|
|
37763
|
+
}
|
|
37764
|
+
function parseNonnegativeInteger(value) {
|
|
37765
|
+
const parsed = Number(value);
|
|
37766
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
37767
|
+
throw new Error(`Expected a non-negative integer, received ${value}`);
|
|
37768
|
+
}
|
|
37769
|
+
return parsed;
|
|
37770
|
+
}
|
|
37720
37771
|
|
|
37721
37772
|
// src/lib/output/iostreams.ts
|
|
37722
37773
|
init_style();
|