@thecorporation/cli 26.3.34 → 26.3.36

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
@@ -1694,8 +1694,8 @@ function printSafesTable(safes) {
1694
1694
  table.push([
1695
1695
  formatReferenceCell("safe_note", s_),
1696
1696
  s2(s_.investor_name ?? s_.investor),
1697
- money2(s_.principal_amount_cents ?? s_.investment_amount ?? s_.amount, false),
1698
- money2(s_.valuation_cap_cents ?? s_.valuation_cap ?? s_.cap, false),
1697
+ money2(s_.principal_amount_cents ?? s_.investment_amount ?? s_.amount),
1698
+ money2(s_.valuation_cap_cents ?? s_.valuation_cap ?? s_.cap),
1699
1699
  s2(s_.discount_rate ?? s_.discount),
1700
1700
  s2(s_.issued_at ?? s_.date ?? s_.created_at)
1701
1701
  ]);
@@ -4686,7 +4686,7 @@ var init_cap_table = __esm({
4686
4686
  examples: [
4687
4687
  "corp cap-table",
4688
4688
  'corp cap-table issue-equity --grant-type common --shares 1000000 --recipient "Alice Smith"',
4689
- 'corp cap-table issue-safe --investor "Seed Fund" --amount-cents 50000000 --valuation-cap-cents 1000000000',
4689
+ 'corp cap-table issue-safe --investor "Seed Fund" --amount-dollars 500000 --valuation-cap-dollars 10000000',
4690
4690
  "corp cap-table create-valuation --type four_oh_nine_a --date 2026-01-01 --methodology market",
4691
4691
  "corp cap-table transfer --from alice --to bob --shares 1000 --share-class-id COMMON --governing-doc-type bylaws --transferee-rights full_member"
4692
4692
  ]
@@ -5076,7 +5076,11 @@ var init_cap_table = __esm({
5076
5076
  resolutionId
5077
5077
  });
5078
5078
  if (!result.success) {
5079
- ctx.writer.error(result.error);
5079
+ let errMsg = result.error;
5080
+ if (errMsg.includes("already bound") && !errMsg.includes("quick-approve")) {
5081
+ errMsg += '\n Each issuance needs its own board approval.\n Run: corp governance quick-approve --text "RESOLVED: authorize equity issuance"';
5082
+ }
5083
+ ctx.writer.error(errMsg);
5080
5084
  return;
5081
5085
  }
5082
5086
  const round = result.data?.round;
@@ -5114,30 +5118,30 @@ var init_cap_table = __esm({
5114
5118
  options: [
5115
5119
  { flags: "--investor <name>", description: "Investor name", required: true },
5116
5120
  { flags: "--amount-cents <n>", description: "Principal amount in cents (e.g. 50000000 = $500,000)", type: "int" },
5117
- { flags: "--amount <n>", description: "Amount in dollars (alternative to --amount-cents)", type: "int" },
5121
+ { flags: "--amount-dollars <n>", description: "Principal amount in dollars (e.g. 500000 = $500,000)", type: "int" },
5118
5122
  { flags: "--safe-type <type>", description: "SAFE type", default: "post_money", choices: ["post_money", "pre_money", "mfn"] },
5119
5123
  { flags: "--valuation-cap-cents <n>", description: "Valuation cap in cents (e.g. 100000000 = $1M)", type: "int" },
5120
- { flags: "--valuation-cap <n>", description: "Valuation cap in dollars (alternative to --valuation-cap-cents)", type: "int" },
5124
+ { flags: "--valuation-cap-dollars <n>", description: "Valuation cap in dollars (e.g. 1000000 = $1M)", type: "int" },
5121
5125
  { flags: "--meeting-id <ref>", description: "Board meeting reference required when issuing under a board-governed entity" },
5122
5126
  { flags: "--resolution-id <ref>", description: "Board resolution reference required when issuing under a board-governed entity" }
5123
5127
  ],
5124
5128
  handler: async (ctx) => {
5125
5129
  const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
5126
5130
  const investor = ctx.opts.investor;
5127
- if (ctx.opts.amountCents != null && ctx.opts.amount != null) {
5128
- throw new Error("--amount-cents and --amount are mutually exclusive. Use one or the other.");
5131
+ if (ctx.opts.amountCents != null && ctx.opts.amountDollars != null) {
5132
+ throw new Error("--amount-cents and --amount-dollars are mutually exclusive. Use one or the other.");
5129
5133
  }
5130
- const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0;
5134
+ const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amountDollars != null ? ctx.opts.amountDollars * 100 : void 0;
5131
5135
  if (amountCents == null) {
5132
- throw new Error("required option '--amount-cents <n>' or '--amount <n>' not specified");
5136
+ throw new Error("required: --amount-cents <n> or --amount-dollars <n>");
5133
5137
  }
5134
5138
  const safeType = ctx.opts.safeType ?? "post_money";
5135
- if (ctx.opts.valuationCapCents != null && ctx.opts.valuationCap != null) {
5136
- throw new Error("--valuation-cap-cents and --valuation-cap are mutually exclusive. Use one or the other.");
5139
+ if (ctx.opts.valuationCapCents != null && ctx.opts.valuationCapDollars != null) {
5140
+ throw new Error("--valuation-cap-cents and --valuation-cap-dollars are mutually exclusive. Use one or the other.");
5137
5141
  }
5138
- const valuationCapCents = ctx.opts.valuationCapCents != null ? ctx.opts.valuationCapCents : ctx.opts.valuationCap != null ? ctx.opts.valuationCap * 100 : void 0;
5142
+ const valuationCapCents = ctx.opts.valuationCapCents != null ? ctx.opts.valuationCapCents : ctx.opts.valuationCapDollars != null ? ctx.opts.valuationCapDollars * 100 : void 0;
5139
5143
  if (valuationCapCents == null) {
5140
- throw new Error("required option '--valuation-cap-cents <n>' or '--valuation-cap <n>' not specified");
5144
+ throw new Error("required: --valuation-cap-cents <n> or --valuation-cap-dollars <n>");
5141
5145
  }
5142
5146
  const email = ctx.opts.email;
5143
5147
  const optMeetingId = ctx.opts.meetingId;
@@ -5168,7 +5172,11 @@ var init_cap_table = __esm({
5168
5172
  resolutionId
5169
5173
  });
5170
5174
  if (!result.success) {
5171
- ctx.writer.error(result.error);
5175
+ let errMsg = result.error;
5176
+ if (errMsg.includes("already bound") && !errMsg.includes("quick-approve")) {
5177
+ errMsg += '\n Each issuance needs its own board approval.\n Run: corp governance quick-approve --text "RESOLVED: authorize SAFE issuance"';
5178
+ }
5179
+ ctx.writer.error(errMsg);
5172
5180
  return;
5173
5181
  }
5174
5182
  await ctx.resolver.stabilizeRecord("safe_note", result.data, eid);
@@ -5182,7 +5190,10 @@ var init_cap_table = __esm({
5182
5190
  },
5183
5191
  produces: { kind: "safe_note" },
5184
5192
  successTemplate: "SAFE created: {investor_name}",
5185
- examples: ["corp cap-table issue-safe --investor 'name' --amount-cents 'n' --valuation-cap-cents 'n'", "corp cap-table issue-safe --json"]
5193
+ examples: [
5194
+ 'corp cap-table issue-safe --investor "Seed Fund" --amount-dollars 500000 --valuation-cap-dollars 10000000',
5195
+ 'corp cap-table issue-safe --investor "Angel" --amount-cents 50000000 --valuation-cap-cents 1000000000'
5196
+ ]
5186
5197
  },
5187
5198
  // --- cap-table transfer ---
5188
5199
  {
@@ -5296,18 +5307,18 @@ var init_cap_table = __esm({
5296
5307
  dryRun: true,
5297
5308
  options: [
5298
5309
  { flags: "--amount-cents <n>", description: "Total distribution amount in cents (e.g. 100000 = $1,000.00)", required: true, type: "int" },
5299
- { flags: "--amount <n>", description: "Amount in dollars (alternative to --amount-cents)", type: "int" },
5310
+ { flags: "--amount-dollars <n>", description: "Total distribution amount in dollars (e.g. 1000 = $1,000.00)", type: "int" },
5300
5311
  { flags: "--type <type>", description: "Distribution type (dividend, return, liquidation)", default: "dividend" },
5301
5312
  { flags: "--description <desc>", description: "Distribution description", required: true }
5302
5313
  ],
5303
5314
  handler: async (ctx) => {
5304
5315
  const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
5305
- if (ctx.opts.amountCents != null && ctx.opts.amount != null) {
5306
- throw new Error("--amount-cents and --amount are mutually exclusive. Use one or the other.");
5316
+ if (ctx.opts.amountCents != null && ctx.opts.amountDollars != null) {
5317
+ throw new Error("--amount-cents and --amount-dollars are mutually exclusive. Use one or the other.");
5307
5318
  }
5308
- const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0;
5319
+ const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amountDollars != null ? ctx.opts.amountDollars * 100 : void 0;
5309
5320
  if (amountCents == null) {
5310
- throw new Error("required option '--amount-cents <n>' or '--amount <n>' not specified");
5321
+ throw new Error("required: --amount-cents <n> or --amount-dollars <n>");
5311
5322
  }
5312
5323
  const distributionType = ctx.opts.type ?? "dividend";
5313
5324
  const description = ctx.opts.description;
@@ -6469,19 +6480,19 @@ var init_finance = __esm({
6469
6480
  options: [
6470
6481
  { flags: "--customer <name>", description: "Customer name", required: true },
6471
6482
  { flags: "--amount-cents <n>", description: "Amount in cents (e.g. 500000 = $5,000.00)", type: "int" },
6472
- { flags: "--amount <n>", description: "Amount in dollars (converted to cents)", type: "int" },
6483
+ { flags: "--amount-dollars <n>", description: "Amount in dollars (e.g. 5000 = $5,000.00)", type: "int" },
6473
6484
  { flags: "--due-date <date>", description: "Due date (ISO 8601)", required: true },
6474
6485
  { flags: "--description <desc>", description: "Description text", default: "Services rendered" }
6475
6486
  ],
6476
6487
  handler: async (ctx) => {
6477
6488
  const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
6478
- if (ctx.opts.amountCents != null && ctx.opts.amount != null) {
6479
- printError("--amount-cents and --amount are mutually exclusive. Use one or the other.");
6489
+ if (ctx.opts.amountCents != null && ctx.opts.amountDollars != null) {
6490
+ printError("--amount-cents and --amount-dollars are mutually exclusive. Use one or the other.");
6480
6491
  process.exit(1);
6481
6492
  }
6482
- const amountCents = ctx.opts.amountCents ?? (ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0);
6493
+ const amountCents = ctx.opts.amountCents ?? (ctx.opts.amountDollars != null ? ctx.opts.amountDollars * 100 : void 0);
6483
6494
  if (amountCents == null) {
6484
- printError("required option '--amount-cents <n>' or '--amount <n>' not specified");
6495
+ printError("required: --amount-cents <n> or --amount-dollars <n>");
6485
6496
  process.exit(1);
6486
6497
  }
6487
6498
  const result = await ctx.client.createInvoice({
@@ -6537,19 +6548,19 @@ var init_finance = __esm({
6537
6548
  entity: true,
6538
6549
  options: [
6539
6550
  { flags: "--amount-cents <n>", description: "Amount in cents (e.g. 500000 = $5,000.00)", type: "int" },
6540
- { flags: "--amount <n>", description: "Amount in dollars (converted to cents)", type: "int" },
6551
+ { flags: "--amount-dollars <n>", description: "Amount in dollars (e.g. 5000 = $5,000.00)", type: "int" },
6541
6552
  { flags: "--recipient <name>", description: "Recipient name", required: true },
6542
6553
  { flags: "--method <method>", description: "Payment method", default: "ach" }
6543
6554
  ],
6544
6555
  handler: async (ctx) => {
6545
6556
  const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
6546
- if (ctx.opts.amountCents != null && ctx.opts.amount != null) {
6547
- printError("--amount-cents and --amount are mutually exclusive. Use one or the other.");
6557
+ if (ctx.opts.amountCents != null && ctx.opts.amountDollars != null) {
6558
+ printError("--amount-cents and --amount-dollars are mutually exclusive. Use one or the other.");
6548
6559
  process.exit(1);
6549
6560
  }
6550
- const amountCents = ctx.opts.amountCents ?? (ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0);
6561
+ const amountCents = ctx.opts.amountCents ?? (ctx.opts.amountDollars != null ? ctx.opts.amountDollars * 100 : void 0);
6551
6562
  if (amountCents == null) {
6552
- printError("required option '--amount-cents <n>' or '--amount <n>' not specified");
6563
+ printError("required: --amount-cents <n> or --amount-dollars <n>");
6553
6564
  process.exit(1);
6554
6565
  }
6555
6566
  const method = ctx.opts.method;