@thecorporation/cli 26.3.4 → 26.3.6

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
@@ -1624,6 +1624,15 @@ async function transferSharesCommand(opts) {
1624
1624
  const eid = resolveEntityId(cfg, opts.entityId);
1625
1625
  const client = new CorpAPIClient(cfg.api_url, cfg.api_key, cfg.workspace_id);
1626
1626
  try {
1627
+ let intentId = opts.prepareIntentId;
1628
+ if (!intentId) {
1629
+ const intent = await client.createExecutionIntent({
1630
+ entity_id: eid,
1631
+ intent_type: "share_transfer",
1632
+ description: `Transfer ${opts.shares} shares from ${opts.from} to ${opts.to}`
1633
+ });
1634
+ intentId = intent.intent_id ?? intent.id;
1635
+ }
1627
1636
  const body = {
1628
1637
  entity_id: eid,
1629
1638
  share_class_id: opts.shareClassId,
@@ -1633,7 +1642,7 @@ async function transferSharesCommand(opts) {
1633
1642
  share_count: opts.shares,
1634
1643
  governing_doc_type: opts.governingDocType,
1635
1644
  transferee_rights: opts.transfereeRights,
1636
- prepare_intent_id: opts.prepareIntentId
1645
+ prepare_intent_id: intentId
1637
1646
  };
1638
1647
  if (opts.pricePerShareCents != null) body.price_per_share_cents = opts.pricePerShareCents;
1639
1648
  if (opts.relationship) body.relationship_to_holder = opts.relationship;
@@ -1958,11 +1967,11 @@ async function governanceCreateBodyCommand(opts) {
1958
1967
  }
1959
1968
  async function governanceAddSeatCommand(bodyId, opts) {
1960
1969
  const cfg = requireConfig("api_url", "api_key", "workspace_id");
1970
+ const eid = resolveEntityId(cfg, opts.entityId);
1961
1971
  const client = new CorpAPIClient(cfg.api_url, cfg.api_key, cfg.workspace_id);
1962
1972
  try {
1963
- const data = { holder_id: opts.holder };
1964
- if (opts.title) data.title = opts.title;
1965
- const result = await client.createGovernanceSeat(bodyId, data);
1973
+ const data = { holder_id: opts.holder, role: opts.role ?? "member" };
1974
+ const result = await client.createGovernanceSeat(bodyId, eid, data);
1966
1975
  printSuccess(`Seat added: ${result.seat_id ?? "OK"}`);
1967
1976
  printJson(result);
1968
1977
  } catch (err) {
@@ -3180,7 +3189,7 @@ contactsCmd.command("show <contact-id>").option("--json", "Output as JSON").desc
3180
3189
  const { contactsShowCommand: contactsShowCommand2 } = await Promise.resolve().then(() => (init_contacts(), contacts_exports));
3181
3190
  await contactsShowCommand2(contactId, { ...opts, entityId: parent.entityId });
3182
3191
  });
3183
- contactsCmd.command("add").requiredOption("--name <name>", "Contact name").requiredOption("--email <email>", "Contact email").option("--type <type>", "Contact type (individual, organization)", "individual").option("--category <category>", "Category (employee, contractor, board_member, investor, law_firm, valuation_firm, accounting_firm, officer, advisor)").option("--phone <phone>", "Phone number").option("--notes <notes>", "Notes").description("Add a new contact").action(async (opts, cmd) => {
3192
+ contactsCmd.command("add").requiredOption("--name <name>", "Contact name").requiredOption("--email <email>", "Contact email").option("--type <type>", "Contact type (individual, organization)", "individual").option("--category <category>", "Category (employee, contractor, board_member, investor, law_firm, valuation_firm, accounting_firm, officer, founder, member, other)").option("--phone <phone>", "Phone number").option("--notes <notes>", "Notes").description("Add a new contact").action(async (opts, cmd) => {
3184
3193
  const parent = cmd.parent.opts();
3185
3194
  const { contactsAddCommand: contactsAddCommand2 } = await Promise.resolve().then(() => (init_contacts(), contacts_exports));
3186
3195
  await contactsAddCommand2({ ...opts, entityId: parent.entityId });
@@ -3214,7 +3223,7 @@ capTableCmd.command("409a").description("Current 409A valuation").action(async (
3214
3223
  const { fourOhNineACommand: fourOhNineACommand2 } = await Promise.resolve().then(() => (init_cap_table(), cap_table_exports));
3215
3224
  await fourOhNineACommand2(parent);
3216
3225
  });
3217
- capTableCmd.command("issue-equity").requiredOption("--grant-type <type>", "Grant type (e.g. founder, advisor, employee, investor)").requiredOption("--shares <n>", "Number of shares", parseInt).requiredOption("--recipient <name>", "Recipient name").option("--email <email>", "Recipient email (auto-creates contact if needed)").option("--instrument-id <id>", "Instrument ID (auto-detected from cap table if omitted)").description("Issue an equity grant (creates a round, adds security, and issues it)").action(async (opts, cmd) => {
3226
+ capTableCmd.command("issue-equity").requiredOption("--grant-type <type>", "Grant type (common, preferred, membership_unit, stock_option, iso, nso, rsa)").requiredOption("--shares <n>", "Number of shares", parseInt).requiredOption("--recipient <name>", "Recipient name").option("--email <email>", "Recipient email (auto-creates contact if needed)").option("--instrument-id <id>", "Instrument ID (auto-detected from cap table if omitted)").description("Issue an equity grant (creates a round, adds security, and issues it)").action(async (opts, cmd) => {
3218
3227
  const parent = cmd.parent.opts();
3219
3228
  const { issueEquityCommand: issueEquityCommand2 } = await Promise.resolve().then(() => (init_cap_table(), cap_table_exports));
3220
3229
  await issueEquityCommand2({ ...opts, entityId: parent.entityId });
@@ -3224,7 +3233,7 @@ capTableCmd.command("issue-safe").requiredOption("--investor <name>", "Investor
3224
3233
  const { issueSafeCommand: issueSafeCommand2 } = await Promise.resolve().then(() => (init_cap_table(), cap_table_exports));
3225
3234
  await issueSafeCommand2({ ...opts, entityId: parent.entityId });
3226
3235
  });
3227
- capTableCmd.command("transfer").requiredOption("--from <id>", "Source contact ID (from_contact_id)").requiredOption("--to <id>", "Destination contact ID (to_contact_id)").requiredOption("--shares <n>", "Number of shares to transfer", parseInt).requiredOption("--share-class-id <id>", "Share class ID").requiredOption("--governing-doc-type <type>", "Governing document type").requiredOption("--transferee-rights <rights>", "Transferee rights").requiredOption("--prepare-intent-id <id>", "Prepare intent ID").option("--type <type>", "Transfer type", "sale").option("--price-per-share-cents <n>", "Price per share in cents", parseInt).option("--relationship <rel>", "Relationship to holder").description("Create a share transfer workflow").action(async (opts, cmd) => {
3236
+ capTableCmd.command("transfer").requiredOption("--from <id>", "Source contact ID (from_contact_id)").requiredOption("--to <id>", "Destination contact ID (to_contact_id)").requiredOption("--shares <n>", "Number of shares to transfer", parseInt).requiredOption("--share-class-id <id>", "Share class ID").requiredOption("--governing-doc-type <type>", "Governing document type").requiredOption("--transferee-rights <rights>", "Transferee rights").option("--prepare-intent-id <id>", "Prepare intent ID (auto-created if omitted)").option("--type <type>", "Transfer type", "sale").option("--price-per-share-cents <n>", "Price per share in cents", parseInt).option("--relationship <rel>", "Relationship to holder").description("Create a share transfer workflow").action(async (opts, cmd) => {
3228
3237
  const parent = cmd.parent.opts();
3229
3238
  const { transferSharesCommand: transferSharesCommand2 } = await Promise.resolve().then(() => (init_cap_table(), cap_table_exports));
3230
3239
  await transferSharesCommand2({ ...opts, entityId: parent.entityId });
@@ -3304,9 +3313,10 @@ governanceCmd.command("create-body").requiredOption("--name <name>", "Body name
3304
3313
  const { governanceCreateBodyCommand: governanceCreateBodyCommand2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
3305
3314
  await governanceCreateBodyCommand2({ ...opts, entityId: parent.entityId });
3306
3315
  });
3307
- governanceCmd.command("add-seat <body-id>").requiredOption("--holder <contact-id>", "Contact ID for the seat holder").option("--title <title>", "Seat title (e.g. 'Director', 'Member')").description("Add a seat to a governance body").action(async (bodyId, opts) => {
3316
+ governanceCmd.command("add-seat <body-id>").requiredOption("--holder <contact-id>", "Contact ID for the seat holder").option("--role <role>", "Seat role (chair, member, officer, observer)", "member").description("Add a seat to a governance body").action(async (bodyId, opts, cmd) => {
3317
+ const parent = cmd.parent.opts();
3308
3318
  const { governanceAddSeatCommand: governanceAddSeatCommand2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
3309
- await governanceAddSeatCommand2(bodyId, opts);
3319
+ await governanceAddSeatCommand2(bodyId, { ...opts, entityId: parent.entityId });
3310
3320
  });
3311
3321
  governanceCmd.command("seats <body-id>").description("Seats for a governance body").action(async (bodyId, _opts, cmd) => {
3312
3322
  const parent = cmd.parent.opts();
@@ -3323,7 +3333,7 @@ governanceCmd.command("resolutions <meeting-id>").description("Resolutions for a
3323
3333
  const { governanceResolutionsCommand: governanceResolutionsCommand2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
3324
3334
  await governanceResolutionsCommand2(meetingId, parent);
3325
3335
  });
3326
- governanceCmd.command("convene").requiredOption("--body <id>", "Governance body ID").requiredOption("--type <type>", "Meeting type").requiredOption("--title <title>", "Meeting title").requiredOption("--date <date>", "Meeting date (ISO 8601)").option("--agenda <item>", "Agenda item (repeatable)", (v, a) => [...a, v], []).description("Convene a governance meeting").action(async (opts, cmd) => {
3336
+ governanceCmd.command("convene").requiredOption("--body <id>", "Governance body ID").requiredOption("--type <type>", "Meeting type (board_meeting, shareholder_meeting, member_meeting, written_consent)").requiredOption("--title <title>", "Meeting title").requiredOption("--date <date>", "Meeting date (ISO 8601)").option("--agenda <item>", "Agenda item (repeatable)", (v, a) => [...a, v], []).description("Convene a governance meeting").action(async (opts, cmd) => {
3327
3337
  const parent = cmd.parent.opts();
3328
3338
  const { governanceConveneCommand: governanceConveneCommand2 } = await Promise.resolve().then(() => (init_governance(), governance_exports));
3329
3339
  await governanceConveneCommand2({ ...opts, meetingType: opts.type, entityId: parent.entityId });