inflight-cli 2.8.0 → 2.10.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.
@@ -98,11 +98,15 @@ async function checkAndSyncGit(cwd, opts = {}) {
98
98
  if (isAgent) {
99
99
  agentActionRequired({
100
100
  type: "git_uncommitted",
101
- message: "You have uncommitted changes. Your deployment won't include them.",
101
+ message: "There are uncommitted changes that won't be in the deployment. Ask the user what to do.",
102
102
  choices: [
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
  }
@@ -163,11 +167,15 @@ async function checkAndSyncGit(cwd, opts = {}) {
163
167
  if (isAgent) {
164
168
  agentActionRequired({
165
169
  type: "git_unpushed",
166
- message: "You have unpushed commits. Your deployment won't include them.",
170
+ message: "There are unpushed commits that won't be in the deployment. Ask the user what to do.",
167
171
  choices: [
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
  }
@@ -216,11 +224,15 @@ async function checkAndSyncGit(cwd, opts = {}) {
216
224
  if (isAgent) {
217
225
  agentActionRequired({
218
226
  type: "git_no_remote",
219
- message: `Branch "${branch}" hasn't been pushed yet — no deployment exists.`,
227
+ message: `Branch "${branch}" hasn't been pushed yet — no deployment exists. Ask the user what to do.`,
220
228
  choices: [
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
  }
@@ -292,7 +304,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
292
304
  else {
293
305
  agentActionRequired({
294
306
  type: "choose_provider",
295
- message: "Could not auto-detect deployment provider.",
307
+ message: "Could not auto-detect deployment provider. Ask the user which one they use.",
296
308
  choices: [
297
309
  { id: "vercel", label: "Vercel" },
298
310
  { id: "netlify", label: "Netlify" },
@@ -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;
@@ -336,7 +350,7 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
336
350
  const currentBranch = gitInfo.branch;
337
351
  agentActionRequired({
338
352
  type: "choose_project",
339
- message: "Select a project or create new.",
353
+ message: "Ask the user which project to share into. Present all choices below as a numbered list.",
340
354
  choices: [
341
355
  { id: "new", label: "Start a new project" },
342
356
  ...projects.map((proj) => ({
@@ -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
  }
@@ -363,12 +377,12 @@ async function agentShareFlow(cwd, apiKey, workspaceId, opts) {
363
377
  if (selectedProject && selectedProject.latestVersion.commentCount === 0) {
364
378
  agentActionRequired({
365
379
  type: "choose_override",
366
- message: `"${selectedProject.latestVersion.title}" has no feedback yet.`,
380
+ message: `"${selectedProject.latestVersion.title}" has no feedback yet. Ask the user whether to update it or create a new version.`,
367
381
  choices: [
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
  }
@@ -58,7 +58,7 @@ export async function resolveWorkspace(workspaces, opts = {}) {
58
58
  if (isAgent) {
59
59
  agentActionRequired({
60
60
  type: "choose_workspace",
61
- message: "Multiple workspaces found. Re-run with --workspace <id>.",
61
+ message: "Multiple workspaces found. Ask the user which one to use.",
62
62
  choices: workspaces.map((w) => ({ id: w.id, label: w.name })),
63
63
  nextCommand: `${commandForNext} --workspace <ID>`,
64
64
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inflight-cli",
3
- "version": "2.8.0",
3
+ "version": "2.10.0",
4
4
  "description": "Get feedback directly on your staging URL",
5
5
  "bin": {
6
6
  "inflight": "dist/index.js",