@invarn/cli 0.2.3 → 0.2.5

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/sdk.mjs CHANGED
@@ -8853,6 +8853,15 @@ async function handleAgentRegister(args) {
8853
8853
  lines.push(`Pipeline file written to: ${result.pipelinePath}`);
8854
8854
  lines.push(`Commit and push the file when ready \u2014 the agent can run locally in the meantime.`);
8855
8855
  }
8856
+ if (Array.isArray(result.warnings) && result.warnings.length > 0) {
8857
+ lines.push("");
8858
+ lines.push("\u26A0\uFE0F Warnings:");
8859
+ for (const w of result.warnings) {
8860
+ lines.push(` - ${w}`);
8861
+ }
8862
+ lines.push("");
8863
+ lines.push("Consider re-registering with split commands if the chained phases are distinct concepts. See STEP SPLITTING in the registration guidance.");
8864
+ }
8856
8865
  return { content: [{ type: "text", text: lines.join("\n") }] };
8857
8866
  } catch (err) {
8858
8867
  return { content: [{ type: "text", text: `Error: ${err.message}` }], isError: true };
@@ -8867,6 +8876,22 @@ var REGISTRATION_GUIDANCE = [
8867
8876
  " If it does, read it \u2014 the build steps are already defined there. Base your agent's commands on them.",
8868
8877
  " Do NOT explore the project structure if a pipeline file already tells you the build commands.",
8869
8878
  "",
8879
+ "STEP SPLITTING \u2014 one concept per command:",
8880
+ " When you have multiple natural phases (setup, compile, test, package, sign, deploy), SPLIT them into separate commands.",
8881
+ " Rule of thumb: if your single `run` field contains `&&` joining distinct concepts, that's a signal to split.",
8882
+ " Example of a BAD single command (distinct phases chained together):",
8883
+ ` run: "printf '...' > local.properties && xcodebuild -scheme iosApp build"`,
8884
+ " Better as two commands:",
8885
+ ` [{name:"config", run:"printf '...' > local.properties"},`,
8886
+ ' {name:"build", run:"xcodebuild -scheme iosApp build"}]',
8887
+ " Why it matters:",
8888
+ " \u2022 Each command is its own step in the PR check run \u2014 reviewers see exactly which phase broke.",
8889
+ ' \u2022 Failed step name appears in the check summary (e.g. "Build failed at step `build`" is much more useful than a generic "build failed").',
8890
+ " \u2022 Per-step duration is tracked \u2014 spot slow phases.",
8891
+ " \u2022 cibuild auto-injects cache steps between commands; one mega-step defeats that.",
8892
+ " \u2022 Individual steps can be individually retried in future (phase 4 of the roadmap).",
8893
+ " Shell flow inside ONE command (pipes, variable assignment, short guards) is fine. Splitting is for DISTINCT PHASES, not every line.",
8894
+ "",
8870
8895
  "DESCRIPTION: Write 3 sentences for other AI agents to read.",
8871
8896
  " 1. What this agent does (include specific tools: Gradle, Xcode, pytest, etc.)",
8872
8897
  " 2. When to use it (the trigger condition)",
@@ -9163,9 +9188,11 @@ var TOOL_SPECS = [
9163
9188
  description: z2.string().describe("What this agent does, when to use it, and what it does not do"),
9164
9189
  repository: z2.string().optional().describe('Repository to bind to (e.g. "owner/repo-name"). Required if the org has multiple repos connected. Omit if only one repo.'),
9165
9190
  commands: z2.array(z2.object({
9166
- name: z2.string().describe('Command name (e.g. "compile")'),
9191
+ name: z2.string().describe('Command name \u2014 short, lowercase, hyphenated, matches the concept (e.g. "config", "compile", "test", "package")'),
9167
9192
  run: z2.string().describe('Shell command to execute (e.g. "./gradlew assembleDebug")')
9168
- })).describe("List of commands this agent can run"),
9193
+ })).describe(
9194
+ 'Ordered list of commands. SPLIT NATURAL PHASES INTO SEPARATE COMMANDS \u2014 one concept per command. If you find yourself chaining distinct phases with `&&` (e.g. write a config file THEN build, or compile THEN archive THEN sign), those belong in separate commands. Each command becomes its own step in the check-run output, gets its own duration, and fails the build with a clear "Failed at step X" summary instead of "build step failed" for an 8-minute merged operation. Example: for "write local.properties from secrets, then xcodebuild", use two commands: [{name:"config", run:"printf ... > local.properties"}, {name:"build", run:"xcodebuild ..."}] \u2014 NOT one command that chains both with `&&`.'
9195
+ ),
9169
9196
  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."),
9170
9197
  triggers: z2.array(z2.object({
9171
9198
  push_branch: z2.string().optional().describe('Match push events where the pushed branch matches this pattern (glob). Use "*" for any branch.'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invarn/cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "Invarn CLI — run builds, check artifacts, and ship from your terminal",
5
5
  "type": "module",
6
6
  "main": "dist/invarn.cjs",