@thecorporation/cli 26.3.36 → 26.3.38

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/index.js CHANGED
@@ -3552,6 +3552,10 @@ async function formCommand(opts) {
3552
3552
  right_of_first_refusal: rofr
3553
3553
  };
3554
3554
  if (companyAddress) payload.company_address = companyAddress;
3555
+ if (entityType === "llc") {
3556
+ const principalName = opts.principalName ?? founders[0]?.name;
3557
+ if (principalName) payload.principal_name = principalName;
3558
+ }
3555
3559
  if (opts.dryRun) {
3556
3560
  printDryRun("formation.create_with_cap_table", payload);
3557
3561
  return;
@@ -3619,12 +3623,25 @@ async function formCommand(opts) {
3619
3623
  } catch (err) {
3620
3624
  if (err instanceof Error && err.message.includes("exit")) throw err;
3621
3625
  const msg = String(err);
3626
+ const hints = [];
3627
+ if (msg.includes("incorporator_address")) {
3628
+ hints.push('Add an address to a founder: --member "Name,email,director,100,street|city|state|zip,ceo,true"');
3629
+ }
3630
+ if (msg.includes("company_address")) {
3631
+ hints.push('Add --address "street,city,state,zip" for the company address (required for C-Corps)');
3632
+ }
3633
+ if (msg.includes("principal_name")) {
3634
+ hints.push('Add --principal-name "Manager Name" (auto-set from first member for LLCs)');
3635
+ }
3622
3636
  if (msg.includes("officers_list") || msg.includes("officer")) {
3637
+ hints.push('C-Corp directors need an officer_title: --member "Name,email,director,100,,,ceo"');
3638
+ }
3639
+ if (hints.length > 0) {
3623
3640
  printError(
3624
3641
  `Formation failed: ${msg}
3625
- Hint: C-Corp directors need an officer_title. Use --member with officer_title field, e.g.:
3626
- --member 'name=Alice,email=a@co.com,role=director,officer_title=ceo,pct=100'
3627
- Or use --member-json with {"officer_title": "ceo"}`
3642
+
3643
+ Missing fields \u2014 fix all at once:
3644
+ ` + hints.map((h) => ` - ${h}`).join("\n")
3628
3645
  );
3629
3646
  } else {
3630
3647
  printError(`Failed to create formation: ${err}`);
@@ -3976,7 +3993,9 @@ async function formCreateHandler(ctx) {
3976
3993
  await ctx.resolver.stabilizeRecord("entity", result);
3977
3994
  ctx.resolver.rememberFromRecord("entity", result);
3978
3995
  if (result.entity_id) {
3979
- setActiveEntityId(cfg, String(result.entity_id));
3996
+ const newEntityId = String(result.entity_id);
3997
+ setActiveEntityId(cfg, newEntityId);
3998
+ ctx.resolver.remember("entity", newEntityId);
3980
3999
  saveConfig(cfg);
3981
4000
  }
3982
4001
  if (ctx.quiet) {
@@ -4119,11 +4138,31 @@ async function formFinalizeHandler(ctx) {
4119
4138
  }
4120
4139
  } catch (err) {
4121
4140
  const msg = String(err);
4141
+ const hints = [];
4142
+ if (msg.includes("incorporator_address")) {
4143
+ hints.push('--incorporator-address "123 Main St,City,ST,12345"');
4144
+ }
4145
+ if (msg.includes("company_address")) {
4146
+ hints.push('--company-address "123 Main St,City,ST,12345"');
4147
+ }
4148
+ if (msg.includes("principal_name")) {
4149
+ hints.push('--principal-name "Managing Member Name"');
4150
+ }
4122
4151
  if (msg.includes("officers_list") || msg.includes("officer")) {
4152
+ hints.push("Add a founder with --officer-title: corp form add-founder @last --role director --officer-title ceo ...");
4153
+ }
4154
+ if (msg.includes("incorporator_name")) {
4155
+ hints.push('--incorporator-name "Incorporator Name"');
4156
+ }
4157
+ if (hints.length > 0) {
4123
4158
  printError(
4124
4159
  `Finalization failed: ${msg}
4125
- Hint: C-Corp entities require at least one founder with an officer_title.
4126
- Add a founder with: corp form add-founder @last:entity --name '...' --email '...' --role director --pct 100 --officer-title ceo`
4160
+
4161
+ To fix, re-run finalize with the missing fields:
4162
+ ` + hints.map((h) => ` ${h}`).join("\n") + `
4163
+
4164
+ Example:
4165
+ corp form finalize @last ${hints.filter((h) => h.startsWith("--")).join(" ")}`
4127
4166
  );
4128
4167
  } else {
4129
4168
  printError(`Failed to finalize formation: ${err}`);
@@ -4210,7 +4249,8 @@ var init_formation = __esm({
4210
4249
  { flags: "--fiscal-year-end <date>", description: "Fiscal year end (MM-DD)", default: "12-31" },
4211
4250
  { flags: "--s-corp", description: "Elect S-Corp status" },
4212
4251
  { flags: "--transfer-restrictions", description: "Enable transfer restrictions" },
4213
- { flags: "--rofr", description: "Enable right of first refusal" }
4252
+ { flags: "--rofr", description: "Enable right of first refusal" },
4253
+ { flags: "--principal-name <name>", description: "Managing member name for LLCs (auto-set from first member if omitted)" }
4214
4254
  ],
4215
4255
  handler: formHandler,
4216
4256
  produces: { kind: "entity", trackEntity: true },
@@ -4250,7 +4290,7 @@ var init_formation = __esm({
4250
4290
  successTemplate: "Pending entity created: {legal_name}",
4251
4291
  examples: [
4252
4292
  'corp form create --type c_corp --name "Acme Inc" --jurisdiction US-DE --address "123 Main,City,ST,12345"',
4253
- 'corp form create --type llc --name "My LLC" --jurisdiction US-WY'
4293
+ 'corp form create --type llc --name "My LLC" --jurisdiction US-WY --principal-name "Carlos"'
4254
4294
  ]
4255
4295
  },
4256
4296
  {