inflight-cli 2.8.0 → 2.9.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.
@@ -103,6 +103,10 @@ async function checkAndSyncGit(cwd, opts = {}) {
103
103
  { id: "commit_push", label: "Commit and push these changes" },
104
104
  { id: "continue", label: "Continue without committing" },
105
105
  ],
106
+ instructions: {
107
+ commit_push: "Stage the changes, commit with a descriptive message, and push. Then re-run with the next_command.",
108
+ continue: "Re-run with the next_command without committing.",
109
+ },
106
110
  nextCommand: buildNextCommand("inflight share --skip-git-check", opts),
107
111
  });
108
112
  }
@@ -168,6 +172,10 @@ async function checkAndSyncGit(cwd, opts = {}) {
168
172
  { id: "push", label: "Push these commits" },
169
173
  { id: "continue", label: "Continue without pushing" },
170
174
  ],
175
+ instructions: {
176
+ push: "Run `git push` to push the commits. Then re-run with the next_command.",
177
+ continue: "Re-run with the next_command without pushing.",
178
+ },
171
179
  nextCommand: buildNextCommand("inflight share --skip-git-check", opts),
172
180
  });
173
181
  }
@@ -221,6 +229,10 @@ async function checkAndSyncGit(cwd, opts = {}) {
221
229
  { id: "push", label: "Push to create a deployment" },
222
230
  { id: "continue", label: "Continue without pushing" },
223
231
  ],
232
+ instructions: {
233
+ push: "Run `git push -u origin ${branch}` to push the branch. Then re-run with the next_command.",
234
+ continue: "Re-run with the next_command without pushing.",
235
+ },
224
236
  nextCommand: buildNextCommand("inflight share --skip-git-check", opts),
225
237
  });
226
238
  }
@@ -320,6 +332,8 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
320
332
  });
321
333
  }
322
334
  }
335
+ // At this point stagingUrl is guaranteed set — provider.resolve returned a value or agentError exited
336
+ const resolvedUrl = stagingUrl;
323
337
  // ── Resolve project ──
324
338
  let selectedProjectId;
325
339
  let overrideVersionId;
@@ -350,7 +364,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
350
364
  .join(" ") || undefined,
351
365
  })),
352
366
  ],
353
- nextCommand: `inflight share --skip-git-check --deployment ${stagingUrl} --project <ID>`,
367
+ nextCommand: `inflight share --skip-git-check --deployment ${resolvedUrl} --project <ID>`,
354
368
  });
355
369
  }
356
370
  }
@@ -368,7 +382,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
368
382
  {
369
383
  id: "override",
370
384
  label: "Update its staging URL",
371
- hint: `replace with ${new URL(stagingUrl).hostname}`,
385
+ hint: `replace with ${new URL(resolvedUrl).hostname}`,
372
386
  },
373
387
  {
374
388
  id: "new_version",
@@ -376,7 +390,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
376
390
  hint: "keep both in version history",
377
391
  },
378
392
  ],
379
- nextCommand: `inflight share --skip-git-check --deployment ${stagingUrl} --project ${selectedProjectId} --override`,
393
+ nextCommand: `inflight share --skip-git-check --deployment ${resolvedUrl} --project ${selectedProjectId} --override`,
380
394
  });
381
395
  }
382
396
  }
@@ -393,15 +407,16 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
393
407
  const result = await apiCreateVersion({
394
408
  apiKey,
395
409
  workspaceId,
396
- stagingUrl: stagingUrl,
410
+ stagingUrl: resolvedUrl,
397
411
  gitInfo,
398
412
  ...(selectedProjectId && { projectId: selectedProjectId }),
399
413
  ...(overrideVersionId && { overrideVersionId }),
400
414
  }).catch((e) => {
401
415
  agentError({ type: "create_failed", message: e.message });
402
416
  });
417
+ await open(resolvedUrl);
403
418
  agentSuccess({
404
- stagingUrl,
419
+ stagingUrl: resolvedUrl,
405
420
  ...result,
406
421
  isOverride: !!overrideVersionId,
407
422
  });
@@ -481,8 +496,10 @@ export async function shareCommand(opts = {}) {
481
496
  }
482
497
  process.exit(1);
483
498
  });
484
- if (isAgent)
499
+ if (isAgent) {
500
+ await open(stagingUrl);
485
501
  agentSuccess({ stagingUrl, ...result });
502
+ }
486
503
  if (opts.json) {
487
504
  console.log(JSON.stringify({ success: true, stagingUrl, ...result }));
488
505
  }
@@ -17,6 +17,7 @@ export declare function agentActionRequired(opts: {
17
17
  message: string;
18
18
  choices: AgentChoice[];
19
19
  nextCommand: string;
20
+ instructions?: Record<string, string>;
20
21
  }): never;
21
22
  export declare function agentError(opts: {
22
23
  type: string;
package/dist/lib/agent.js CHANGED
@@ -17,6 +17,7 @@ export function agentActionRequired(opts) {
17
17
  message: opts.message,
18
18
  choices: opts.choices,
19
19
  next_command: opts.nextCommand,
20
+ ...(opts.instructions && { instructions: opts.instructions }),
20
21
  }));
21
22
  process.exit(0);
22
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inflight-cli",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "Get feedback directly on your staging URL",
5
5
  "bin": {
6
6
  "inflight": "dist/index.js",