@invarn/cli 0.2.1 → 0.2.2
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/invarn.cjs +7 -7
- package/dist/sdk.mjs +11 -3
- package/package.json +1 -1
package/dist/sdk.mjs
CHANGED
|
@@ -6995,10 +6995,11 @@ async function cancelBuild(buildId) {
|
|
|
6995
6995
|
body: "{}"
|
|
6996
6996
|
});
|
|
6997
6997
|
}
|
|
6998
|
-
async function registerAgent({ name, type, description, repository, commands, overwrite }) {
|
|
6998
|
+
async function registerAgent({ name, type, description, repository, commands, overwrite, triggers }) {
|
|
6999
6999
|
const body = { name, type, description, commands };
|
|
7000
7000
|
if (repository) body.repository = repository;
|
|
7001
7001
|
if (overwrite) body.overwrite = true;
|
|
7002
|
+
if (Array.isArray(triggers) && triggers.length > 0) body.triggers = triggers;
|
|
7002
7003
|
const res = await request("/agent/register", {
|
|
7003
7004
|
method: "POST",
|
|
7004
7005
|
body: JSON.stringify(body)
|
|
@@ -8820,7 +8821,8 @@ async function handleAgentRegister(args) {
|
|
|
8820
8821
|
description: args.description,
|
|
8821
8822
|
repository: args.repository,
|
|
8822
8823
|
commands,
|
|
8823
|
-
overwrite: args.overwrite
|
|
8824
|
+
overwrite: args.overwrite,
|
|
8825
|
+
triggers: args.triggers
|
|
8824
8826
|
});
|
|
8825
8827
|
if (result.pipelinePath && result.yamlContent) {
|
|
8826
8828
|
try {
|
|
@@ -9144,7 +9146,13 @@ var TOOL_SPECS = [
|
|
|
9144
9146
|
name: z2.string().describe('Command name (e.g. "compile")'),
|
|
9145
9147
|
run: z2.string().describe('Shell command to execute (e.g. "./gradlew assembleDebug")')
|
|
9146
9148
|
})).describe("List of commands this agent can run"),
|
|
9147
|
-
overwrite: z2.boolean().optional().describe("Set true to replace a pipeline file that already exists at .ci/pipelines/agent-<name>.yml in the repo. Use this when re-registering an agent \u2014 e.g. the same repo is connected under another org, or a prior registration was deleted without cleaning up the committed file. Do NOT set this when the existing file is hand-authored YAML unrelated to a prior agent.")
|
|
9149
|
+
overwrite: z2.boolean().optional().describe("Set true to replace a pipeline file that already exists at .ci/pipelines/agent-<name>.yml in the repo. Use this when re-registering an agent \u2014 e.g. the same repo is connected under another org, or a prior registration was deleted without cleaning up the committed file. Do NOT set this when the existing file is hand-authored YAML unrelated to a prior agent."),
|
|
9150
|
+
triggers: z2.array(z2.object({
|
|
9151
|
+
push_branch: z2.string().optional().describe('Match push events where the pushed branch matches this pattern (glob). Use "*" for any branch.'),
|
|
9152
|
+
pull_request_source_branch: z2.string().optional().describe("Match PR events where the source (head) branch matches this pattern."),
|
|
9153
|
+
pull_request_target_branch: z2.string().optional().describe("Match PR events where the target (base) branch matches this pattern."),
|
|
9154
|
+
workflow: z2.string().describe('Workflow to run on match \u2014 must be one of the command names, or the combined "a-and-b-and-c" workflow when multiple commands exist.')
|
|
9155
|
+
})).optional().describe("Events that should trigger this agent automatically. Each rule mirrors cibuild.yml trigger_map entries. Omit to keep the agent manual-only (runnable only via invarn_agent_run). See docs/AGENTS-ROADMAP.md item #2.")
|
|
9148
9156
|
},
|
|
9149
9157
|
handler: async (args) => handleAgentRegister(args)
|
|
9150
9158
|
},
|