@thecorporation/cli 26.3.25 → 26.3.32
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 +3140 -221
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -678,7 +678,7 @@ var init_config = __esm({
|
|
|
678
678
|
CONFIG_LOCK_TIMEOUT_MS = 5e3;
|
|
679
679
|
CONFIG_LOCK_RETRY_MS = 25;
|
|
680
680
|
CONFIG_STALE_LOCK_MS = 6e4;
|
|
681
|
-
MAX_LAST_REFERENCES =
|
|
681
|
+
MAX_LAST_REFERENCES = 4096;
|
|
682
682
|
TRUSTED_API_HOST_SUFFIXES = ["thecorporation.ai"];
|
|
683
683
|
CONFIG_WAIT_BUFFER = new SharedArrayBuffer(4);
|
|
684
684
|
CONFIG_WAIT_SIGNAL = new Int32Array(CONFIG_WAIT_BUFFER);
|
|
@@ -793,6 +793,11 @@ var init_references = __esm({
|
|
|
793
793
|
this.tracker = new ReferenceTracker(new NodeReferenceStorage(cfg));
|
|
794
794
|
}
|
|
795
795
|
async resolveEntity(ref) {
|
|
796
|
+
if (ref !== void 0 && ref !== null && !ref.trim()) {
|
|
797
|
+
throw new Error(
|
|
798
|
+
"Entity reference is empty or whitespace. If you want the active entity, omit --entity-id entirely."
|
|
799
|
+
);
|
|
800
|
+
}
|
|
796
801
|
if (!ref || !ref.trim()) {
|
|
797
802
|
const activeEntityId = getActiveEntityId(this.cfg);
|
|
798
803
|
if (!activeEntityId) {
|
|
@@ -907,6 +912,9 @@ var init_references = __esm({
|
|
|
907
912
|
const records = await this.listRecords(kind, scope);
|
|
908
913
|
return this.tracker.findMatches(kind, query, records);
|
|
909
914
|
}
|
|
915
|
+
getLastId(kind, entityId) {
|
|
916
|
+
return getLastReference(this.cfg, kind, entityId);
|
|
917
|
+
}
|
|
910
918
|
remember(kind, referenceId, entityId) {
|
|
911
919
|
setLastReference(this.cfg, kind, referenceId, entityId);
|
|
912
920
|
updateConfig((cfg) => {
|
|
@@ -1063,18 +1071,23 @@ var init_references = __esm({
|
|
|
1063
1071
|
if (missing.length === 0) {
|
|
1064
1072
|
return records;
|
|
1065
1073
|
}
|
|
1066
|
-
const
|
|
1067
|
-
kind,
|
|
1068
|
-
missing.map(({ described }) => ({
|
|
1069
|
-
resource_id: described.id,
|
|
1070
|
-
label: described.label
|
|
1071
|
-
})),
|
|
1072
|
-
isEntityScopedKind(kind) ? entityId : void 0
|
|
1073
|
-
);
|
|
1074
|
+
const SYNC_BATCH_SIZE = 400;
|
|
1074
1075
|
const handleById = /* @__PURE__ */ new Map();
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
const scopeEntityId = isEntityScopedKind(kind) ? entityId : void 0;
|
|
1077
|
+
for (let i = 0; i < missing.length; i += SYNC_BATCH_SIZE) {
|
|
1078
|
+
const batch = missing.slice(i, i + SYNC_BATCH_SIZE);
|
|
1079
|
+
const response = await this.client.syncReferences(
|
|
1080
|
+
kind,
|
|
1081
|
+
batch.map(({ described }) => ({
|
|
1082
|
+
resource_id: described.id,
|
|
1083
|
+
label: described.label
|
|
1084
|
+
})),
|
|
1085
|
+
scopeEntityId
|
|
1086
|
+
);
|
|
1087
|
+
for (const reference of response.references) {
|
|
1088
|
+
if (typeof reference.resource_id === "string" && typeof reference.handle === "string") {
|
|
1089
|
+
handleById.set(reference.resource_id, reference.handle);
|
|
1090
|
+
}
|
|
1078
1091
|
}
|
|
1079
1092
|
}
|
|
1080
1093
|
for (const { record, described } of missing) {
|
|
@@ -1890,7 +1903,7 @@ function printSeatsTable(seats) {
|
|
|
1890
1903
|
for (const st of seats) {
|
|
1891
1904
|
table.push([
|
|
1892
1905
|
formatReferenceCell("seat", st),
|
|
1893
|
-
s2(st.holder_name ?? st.holder),
|
|
1906
|
+
s2(st.holder_name ?? st.holder ?? st.holder_id),
|
|
1894
1907
|
s2(st.role),
|
|
1895
1908
|
s2(st.status)
|
|
1896
1909
|
]);
|
|
@@ -2164,7 +2177,8 @@ var init_workspace = __esm({
|
|
|
2164
2177
|
ctx.writer.error(`Failed to fetch status: ${err}`);
|
|
2165
2178
|
process.exit(1);
|
|
2166
2179
|
}
|
|
2167
|
-
}
|
|
2180
|
+
},
|
|
2181
|
+
examples: ["corp status"]
|
|
2168
2182
|
},
|
|
2169
2183
|
// --- context / whoami ---
|
|
2170
2184
|
{
|
|
@@ -2236,7 +2250,8 @@ var init_workspace = __esm({
|
|
|
2236
2250
|
ctx.writer.error(`Failed to fetch context: ${err}`);
|
|
2237
2251
|
process.exit(1);
|
|
2238
2252
|
}
|
|
2239
|
-
}
|
|
2253
|
+
},
|
|
2254
|
+
examples: ["corp context", "corp context --json"]
|
|
2240
2255
|
},
|
|
2241
2256
|
// --- use <entity-ref> ---
|
|
2242
2257
|
{
|
|
@@ -2258,7 +2273,8 @@ var init_workspace = __esm({
|
|
|
2258
2273
|
ctx.writer.error(`Failed to resolve entity: ${err}`);
|
|
2259
2274
|
process.exit(1);
|
|
2260
2275
|
}
|
|
2261
|
-
}
|
|
2276
|
+
},
|
|
2277
|
+
examples: ["corp use", "corp use --json"]
|
|
2262
2278
|
},
|
|
2263
2279
|
// --- next ---
|
|
2264
2280
|
{
|
|
@@ -2323,8 +2339,34 @@ var init_workspace = __esm({
|
|
|
2323
2339
|
printNextSteps(data);
|
|
2324
2340
|
}
|
|
2325
2341
|
} catch (err) {
|
|
2326
|
-
|
|
2327
|
-
|
|
2342
|
+
const msg = String(err);
|
|
2343
|
+
if (msg.includes("Not found") || msg.includes("404")) {
|
|
2344
|
+
if (localItems.length > 0) {
|
|
2345
|
+
const top = localItems[0];
|
|
2346
|
+
const backlog = localItems.slice(1);
|
|
2347
|
+
const summary = { critical: 0, high: 0, medium: 0, low: 0 };
|
|
2348
|
+
for (const item of [top, ...backlog]) {
|
|
2349
|
+
const key = item.urgency;
|
|
2350
|
+
if (key in summary) summary[key]++;
|
|
2351
|
+
}
|
|
2352
|
+
const response = { top, backlog, summary };
|
|
2353
|
+
if (opts.json) {
|
|
2354
|
+
ctx.writer.json(response);
|
|
2355
|
+
} else {
|
|
2356
|
+
printNextSteps(response);
|
|
2357
|
+
}
|
|
2358
|
+
} else {
|
|
2359
|
+
console.log("No entities found yet. Get started:\n");
|
|
2360
|
+
console.log(' corp form --type c_corp --name "My Company" --member "Name,email,director,100,street|city|state|zip,ceo,true"');
|
|
2361
|
+
console.log("\n Or use the staged flow:");
|
|
2362
|
+
console.log(' corp form create --type llc --name "My LLC"');
|
|
2363
|
+
console.log(' corp form add-founder @last --name "Alice" --email "a@co.com" --role member --ownership-pct 100');
|
|
2364
|
+
console.log(" corp form finalize @last");
|
|
2365
|
+
}
|
|
2366
|
+
} else {
|
|
2367
|
+
ctx.writer.error(`Failed to fetch next steps: ${err}`);
|
|
2368
|
+
process.exit(1);
|
|
2369
|
+
}
|
|
2328
2370
|
}
|
|
2329
2371
|
}
|
|
2330
2372
|
},
|
|
@@ -2345,7 +2387,8 @@ var init_workspace = __esm({
|
|
|
2345
2387
|
]
|
|
2346
2388
|
},
|
|
2347
2389
|
optQP: ["tier"],
|
|
2348
|
-
options: [{ flags: "--tier <tier>", description: "Filter by urgency tier" }]
|
|
2390
|
+
options: [{ flags: "--tier <tier>", description: "Filter by urgency tier" }],
|
|
2391
|
+
examples: ["corp obligations"]
|
|
2349
2392
|
},
|
|
2350
2393
|
// --- digest ---
|
|
2351
2394
|
{
|
|
@@ -2393,7 +2436,8 @@ var init_workspace = __esm({
|
|
|
2393
2436
|
ctx.writer.error(`Failed: ${err}`);
|
|
2394
2437
|
process.exit(1);
|
|
2395
2438
|
}
|
|
2396
|
-
}
|
|
2439
|
+
},
|
|
2440
|
+
examples: ["corp digest"]
|
|
2397
2441
|
},
|
|
2398
2442
|
// --- billing ---
|
|
2399
2443
|
{
|
|
@@ -2416,7 +2460,8 @@ var init_workspace = __esm({
|
|
|
2416
2460
|
ctx.writer.error(`Failed to fetch billing info: ${err}`);
|
|
2417
2461
|
process.exit(1);
|
|
2418
2462
|
}
|
|
2419
|
-
}
|
|
2463
|
+
},
|
|
2464
|
+
examples: ["corp billing"]
|
|
2420
2465
|
},
|
|
2421
2466
|
// --- billing portal ---
|
|
2422
2467
|
{
|
|
@@ -2437,7 +2482,8 @@ var init_workspace = __esm({
|
|
|
2437
2482
|
ctx.writer.error(`Failed to create portal session: ${err}`);
|
|
2438
2483
|
process.exit(1);
|
|
2439
2484
|
}
|
|
2440
|
-
}
|
|
2485
|
+
},
|
|
2486
|
+
examples: ["corp billing portal"]
|
|
2441
2487
|
},
|
|
2442
2488
|
// --- billing upgrade ---
|
|
2443
2489
|
{
|
|
@@ -2467,7 +2513,24 @@ var init_workspace = __esm({
|
|
|
2467
2513
|
ctx.writer.error(`Failed to create checkout session: ${err}`);
|
|
2468
2514
|
process.exit(1);
|
|
2469
2515
|
}
|
|
2470
|
-
}
|
|
2516
|
+
},
|
|
2517
|
+
examples: ["corp billing upgrade"]
|
|
2518
|
+
},
|
|
2519
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
2520
|
+
{
|
|
2521
|
+
name: "entities next-steps",
|
|
2522
|
+
description: "View recommended next actions for an entity",
|
|
2523
|
+
route: { method: "GET", path: "/v1/entities/{eid}/next-steps" },
|
|
2524
|
+
entity: true,
|
|
2525
|
+
display: { title: "Entities Next Steps", cols: ["backlog>Backlog", "summary>Summary", "top>Top"] },
|
|
2526
|
+
examples: ["corp entities next-steps", "corp entities next-steps --json"]
|
|
2527
|
+
},
|
|
2528
|
+
{
|
|
2529
|
+
name: "workspaces next-steps",
|
|
2530
|
+
description: "View recommended next actions across the workspace",
|
|
2531
|
+
route: { method: "GET", path: "/v1/workspaces/{workspace_id}/next-steps" },
|
|
2532
|
+
display: { title: "Workspaces Next Steps", cols: ["backlog>Backlog", "summary>Summary", "top>Top"] },
|
|
2533
|
+
examples: ["corp workspaces next-steps"]
|
|
2471
2534
|
}
|
|
2472
2535
|
];
|
|
2473
2536
|
}
|
|
@@ -2496,6 +2559,7 @@ async function entitiesHandler(ctx) {
|
|
|
2496
2559
|
async function entitiesShowHandler(ctx) {
|
|
2497
2560
|
const entityRef = ctx.positional[0];
|
|
2498
2561
|
const jsonOutput = !!ctx.opts.json;
|
|
2562
|
+
const quiet = !!ctx.opts.quiet;
|
|
2499
2563
|
try {
|
|
2500
2564
|
const resolvedEntityId = await ctx.resolver.resolveEntity(entityRef);
|
|
2501
2565
|
const entities = await ctx.client.listEntities();
|
|
@@ -2505,6 +2569,10 @@ async function entitiesShowHandler(ctx) {
|
|
|
2505
2569
|
process.exit(1);
|
|
2506
2570
|
}
|
|
2507
2571
|
await ctx.resolver.stabilizeRecord("entity", entity);
|
|
2572
|
+
if (quiet) {
|
|
2573
|
+
console.log(String(entity.entity_id ?? resolvedEntityId));
|
|
2574
|
+
return;
|
|
2575
|
+
}
|
|
2508
2576
|
if (jsonOutput) {
|
|
2509
2577
|
printJson(entity);
|
|
2510
2578
|
} else {
|
|
@@ -2705,14 +2773,16 @@ var init_entities = __esm({
|
|
|
2705
2773
|
// ── entities ──
|
|
2706
2774
|
{
|
|
2707
2775
|
name: "entities",
|
|
2708
|
-
description: "List entities
|
|
2709
|
-
handler: entitiesHandler
|
|
2776
|
+
description: "List all entities",
|
|
2777
|
+
handler: entitiesHandler,
|
|
2778
|
+
examples: ["corp entities"]
|
|
2710
2779
|
},
|
|
2711
2780
|
{
|
|
2712
2781
|
name: "entities show",
|
|
2713
2782
|
description: "Show entity detail",
|
|
2714
2783
|
args: [{ name: "entity-ref", required: true }],
|
|
2715
|
-
handler: entitiesShowHandler
|
|
2784
|
+
handler: entitiesShowHandler,
|
|
2785
|
+
examples: ["corp entities show"]
|
|
2716
2786
|
},
|
|
2717
2787
|
{
|
|
2718
2788
|
name: "entities convert",
|
|
@@ -2723,7 +2793,8 @@ var init_entities = __esm({
|
|
|
2723
2793
|
{ flags: "--to <type>", description: "Target entity type (llc, c_corp)", required: true },
|
|
2724
2794
|
{ flags: "--jurisdiction <jurisdiction>", description: "New jurisdiction" }
|
|
2725
2795
|
],
|
|
2726
|
-
handler: entitiesConvertHandler
|
|
2796
|
+
handler: entitiesConvertHandler,
|
|
2797
|
+
examples: ["corp entities convert <entity-ref> --to 'type'", "corp entities convert --json"]
|
|
2727
2798
|
},
|
|
2728
2799
|
{
|
|
2729
2800
|
name: "entities dissolve",
|
|
@@ -2735,7 +2806,8 @@ var init_entities = __esm({
|
|
|
2735
2806
|
{ flags: "--effective-date <date>", description: "Effective date (ISO 8601)" },
|
|
2736
2807
|
{ flags: "--yes, -y", description: "Skip confirmation prompt" }
|
|
2737
2808
|
],
|
|
2738
|
-
handler: entitiesDissolveHandler
|
|
2809
|
+
handler: entitiesDissolveHandler,
|
|
2810
|
+
examples: ["corp entities dissolve <entity-ref> --reason 'reason'", "corp entities dissolve --json"]
|
|
2739
2811
|
},
|
|
2740
2812
|
// ── contacts ──
|
|
2741
2813
|
{
|
|
@@ -2747,7 +2819,8 @@ var init_entities = __esm({
|
|
|
2747
2819
|
title: "Contacts",
|
|
2748
2820
|
cols: ["name>Name", "email>Email", "category>Category", "#contact_id>ID"]
|
|
2749
2821
|
},
|
|
2750
|
-
handler: contactsHandler
|
|
2822
|
+
handler: contactsHandler,
|
|
2823
|
+
examples: ["corp contacts", "corp contacts --json"]
|
|
2751
2824
|
},
|
|
2752
2825
|
{
|
|
2753
2826
|
name: "contacts show",
|
|
@@ -2756,7 +2829,8 @@ var init_entities = __esm({
|
|
|
2756
2829
|
entity: "query",
|
|
2757
2830
|
display: { title: "Contact Profile" },
|
|
2758
2831
|
args: [{ name: "contact-ref", required: true }],
|
|
2759
|
-
handler: contactsShowHandler
|
|
2832
|
+
handler: contactsShowHandler,
|
|
2833
|
+
examples: ["corp contacts show", "corp contacts show --json"]
|
|
2760
2834
|
},
|
|
2761
2835
|
{
|
|
2762
2836
|
name: "contacts add",
|
|
@@ -2772,11 +2846,12 @@ var init_entities = __esm({
|
|
|
2772
2846
|
{ flags: "--address <address>", description: "Mailing address" },
|
|
2773
2847
|
{ flags: "--mailing-address <address>", description: "Alias for --address" },
|
|
2774
2848
|
{ flags: "--phone <phone>", description: "Phone number" },
|
|
2775
|
-
{ flags: "--notes <notes>", description: "
|
|
2849
|
+
{ flags: "--notes <notes>", description: "Additional notes" }
|
|
2776
2850
|
],
|
|
2777
2851
|
handler: contactsAddHandler,
|
|
2778
2852
|
produces: { kind: "contact" },
|
|
2779
|
-
successTemplate: "Contact created: {name}"
|
|
2853
|
+
successTemplate: "Contact created: {name}",
|
|
2854
|
+
examples: ["corp contacts add --name 'name' --email 'email'", "corp contacts add --json"]
|
|
2780
2855
|
},
|
|
2781
2856
|
{
|
|
2782
2857
|
name: "contacts edit",
|
|
@@ -2792,9 +2867,32 @@ var init_entities = __esm({
|
|
|
2792
2867
|
{ flags: "--address <address>", description: "Mailing address" },
|
|
2793
2868
|
{ flags: "--mailing-address <address>", description: "Alias for --address" },
|
|
2794
2869
|
{ flags: "--phone <phone>", description: "Phone number" },
|
|
2795
|
-
{ flags: "--notes <notes>", description: "
|
|
2870
|
+
{ flags: "--notes <notes>", description: "Additional notes" }
|
|
2871
|
+
],
|
|
2872
|
+
handler: contactsEditHandler,
|
|
2873
|
+
examples: ["corp contacts edit <contact-ref>", "corp contacts edit --json"]
|
|
2874
|
+
},
|
|
2875
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
2876
|
+
{
|
|
2877
|
+
name: "contacts notification-prefs",
|
|
2878
|
+
description: "View notification preferences for a contact",
|
|
2879
|
+
route: { method: "GET", path: "/v1/contacts/{pos}/notification-prefs" },
|
|
2880
|
+
args: [{ name: "contact-id", required: true, description: "Contact ID" }],
|
|
2881
|
+
display: { title: "Contacts Notification Prefs", cols: ["#contact_id>ID", "email_enabled>Email Enabled", "sms_enabled>Sms Enabled", "@updated_at>Updated At", "webhook_enabled>Webhook Enabled"] },
|
|
2882
|
+
examples: ["corp contacts notification-prefs"]
|
|
2883
|
+
},
|
|
2884
|
+
{
|
|
2885
|
+
name: "contacts update-notification-prefs",
|
|
2886
|
+
description: "View notification preferences for a contact",
|
|
2887
|
+
route: { method: "PATCH", path: "/v1/contacts/{pos}/notification-prefs" },
|
|
2888
|
+
args: [{ name: "contact-id", required: true, description: "Contact ID" }],
|
|
2889
|
+
options: [
|
|
2890
|
+
{ flags: "--email-enabled <email-enabled>", description: "Email Enabled" },
|
|
2891
|
+
{ flags: "--sms-enabled <sms-enabled>", description: "Sms Enabled" },
|
|
2892
|
+
{ flags: "--webhook-enabled <webhook-enabled>", description: "Webhook Enabled" }
|
|
2796
2893
|
],
|
|
2797
|
-
|
|
2894
|
+
examples: ["corp contacts notification-prefs <contact-id>", "corp contacts notification-prefs --json"],
|
|
2895
|
+
successTemplate: "Notification Prefs updated"
|
|
2798
2896
|
}
|
|
2799
2897
|
];
|
|
2800
2898
|
}
|
|
@@ -2901,6 +2999,9 @@ async function activateFormationEntity(client, resolver, entityId, options = {})
|
|
|
2901
2999
|
for (let i = 0; i < 10; i += 1) {
|
|
2902
3000
|
const status = String(formation.formation_status ?? "");
|
|
2903
3001
|
if (status === "active") {
|
|
3002
|
+
if (initialStatus === "active") {
|
|
3003
|
+
steps.push("entity is already active \u2014 no action needed");
|
|
3004
|
+
}
|
|
2904
3005
|
return {
|
|
2905
3006
|
entity_id: entityId,
|
|
2906
3007
|
initial_status: initialStatus,
|
|
@@ -2912,7 +3013,9 @@ async function activateFormationEntity(client, resolver, entityId, options = {})
|
|
|
2912
3013
|
};
|
|
2913
3014
|
}
|
|
2914
3015
|
if (status === "pending") {
|
|
2915
|
-
throw new Error(
|
|
3016
|
+
throw new Error(
|
|
3017
|
+
"Formation is still pending \u2014 finalize before activation.\n Run: corp form finalize " + entityId
|
|
3018
|
+
);
|
|
2916
3019
|
}
|
|
2917
3020
|
if (status === "documents_generated") {
|
|
2918
3021
|
const signed = await autoSignFormationDocuments(client, resolver, entityId);
|
|
@@ -3095,7 +3198,7 @@ function parseLegacyMemberSpec(raw) {
|
|
|
3095
3198
|
const parts = raw.split(",").map((p) => p.trim());
|
|
3096
3199
|
if (parts.length < 3) {
|
|
3097
3200
|
throw new Error(
|
|
3098
|
-
`Invalid member format: ${raw}. Expected: name,email,role[,pct[,
|
|
3201
|
+
`Invalid member format: ${raw}. Expected: name,email,role[,pct[,street|city|state|zip[,officer_title[,is_incorporator]]]]`
|
|
3099
3202
|
);
|
|
3100
3203
|
}
|
|
3101
3204
|
const founder = { name: parts[0], email: parts[1], role: parts[2] };
|
|
@@ -3133,6 +3236,28 @@ function readSafeJsonFile(filePath, label) {
|
|
|
3133
3236
|
`--${label} must stay inside the current working directory unless CORP_ALLOW_UNSAFE_FILE_INPUT=1 is set.`
|
|
3134
3237
|
);
|
|
3135
3238
|
}
|
|
3239
|
+
function validateFounders(founders) {
|
|
3240
|
+
const seenEmails = /* @__PURE__ */ new Set();
|
|
3241
|
+
for (const f of founders) {
|
|
3242
|
+
const email = f.email.toLowerCase().trim();
|
|
3243
|
+
if (seenEmails.has(email)) {
|
|
3244
|
+
throw new Error(`Duplicate founder email: ${email}. Each founder must have a unique email address.`);
|
|
3245
|
+
}
|
|
3246
|
+
seenEmails.add(email);
|
|
3247
|
+
}
|
|
3248
|
+
let totalOwnership = 0;
|
|
3249
|
+
for (const f of founders) {
|
|
3250
|
+
if (f.ownership_pct != null) {
|
|
3251
|
+
if (f.ownership_pct <= 0 || f.ownership_pct > 100) {
|
|
3252
|
+
throw new Error(`Invalid ownership_pct ${f.ownership_pct} for ${f.name}. Must be between 0 and 100.`);
|
|
3253
|
+
}
|
|
3254
|
+
totalOwnership += f.ownership_pct;
|
|
3255
|
+
}
|
|
3256
|
+
}
|
|
3257
|
+
if (totalOwnership > 100.000001) {
|
|
3258
|
+
throw new Error(`Total ownership_pct is ${totalOwnership.toFixed(2)}%, which exceeds 100%. Reduce ownership percentages.`);
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3136
3261
|
function parseScriptedFounders(opts) {
|
|
3137
3262
|
const founders = [];
|
|
3138
3263
|
for (const raw of opts.member ?? []) {
|
|
@@ -3158,6 +3283,7 @@ function parseScriptedFounders(opts) {
|
|
|
3158
3283
|
founders.push(normalizeFounderInfo(entry));
|
|
3159
3284
|
}
|
|
3160
3285
|
}
|
|
3286
|
+
validateFounders(founders);
|
|
3161
3287
|
return founders;
|
|
3162
3288
|
}
|
|
3163
3289
|
async function promptAddress() {
|
|
@@ -3371,8 +3497,26 @@ async function formCommand(opts) {
|
|
|
3371
3497
|
}
|
|
3372
3498
|
const { entityType, name, jurisdiction, companyAddress, fiscalYearEnd, sCorpElection } = await phaseEntityDetails(opts, serverCfg, scripted);
|
|
3373
3499
|
const founders = await phasePeople(opts, entityType, scripted);
|
|
3500
|
+
if (isCorp(entityType) && scripted) {
|
|
3501
|
+
const missing = [];
|
|
3502
|
+
const hasAddress = founders.some((f) => f.address);
|
|
3503
|
+
const hasOfficer = founders.some((f) => f.officer_title);
|
|
3504
|
+
const hasIncorporator = founders.some((f) => f.is_incorporator);
|
|
3505
|
+
if (!hasAddress) missing.push("At least one member with an address (for incorporator filing)");
|
|
3506
|
+
if (!hasOfficer) missing.push("At least one member with --officer-title (for initial board consent)");
|
|
3507
|
+
if (!hasIncorporator && founders.length === 1) {
|
|
3508
|
+
} else if (!hasIncorporator && founders.length > 1) {
|
|
3509
|
+
missing.push("At least one member marked as --incorporator");
|
|
3510
|
+
}
|
|
3511
|
+
if (missing.length > 0) {
|
|
3512
|
+
printError(
|
|
3513
|
+
"C-Corp formation requires:\n" + missing.map((m) => ` - ${m}`).join("\n") + '\n Example: --member "Name,email,director,100,street|city|state|zip,ceo,true"'
|
|
3514
|
+
);
|
|
3515
|
+
process.exit(1);
|
|
3516
|
+
}
|
|
3517
|
+
}
|
|
3374
3518
|
const { transferRestrictions, rofr } = await phaseStock(opts, entityType, founders, scripted);
|
|
3375
|
-
if (!opts.quiet) {
|
|
3519
|
+
if (!opts.quiet && !opts.json) {
|
|
3376
3520
|
printSummary(entityType, name, jurisdiction, fiscalYearEnd, sCorpElection, founders, transferRestrictions, rofr);
|
|
3377
3521
|
}
|
|
3378
3522
|
const shouldProceed = scripted ? true : await confirm2({ message: "Proceed with formation?", default: true });
|
|
@@ -3418,7 +3562,6 @@ async function formCommand(opts) {
|
|
|
3418
3562
|
if (result.entity_id) {
|
|
3419
3563
|
setActiveEntityId(cfg, String(result.entity_id));
|
|
3420
3564
|
saveConfig(cfg);
|
|
3421
|
-
console.log(chalk5.dim(` Active entity set to ${result.entity_id}`));
|
|
3422
3565
|
}
|
|
3423
3566
|
if (opts.quiet) {
|
|
3424
3567
|
const id = result.entity_id ?? result.formation_id;
|
|
@@ -3429,6 +3572,9 @@ async function formCommand(opts) {
|
|
|
3429
3572
|
printJson(result);
|
|
3430
3573
|
return;
|
|
3431
3574
|
}
|
|
3575
|
+
if (result.entity_id) {
|
|
3576
|
+
console.log(chalk5.dim(` Active entity set to ${result.entity_id}`));
|
|
3577
|
+
}
|
|
3432
3578
|
printSuccess(`Formation created: ${result.formation_id ?? "OK"}`);
|
|
3433
3579
|
if (result.entity_id) {
|
|
3434
3580
|
printReferenceSummary("entity", result, { showReuseHint: true });
|
|
@@ -3453,8 +3599,22 @@ async function formCommand(opts) {
|
|
|
3453
3599
|
console.log(table.toString());
|
|
3454
3600
|
}
|
|
3455
3601
|
if (result.next_action) {
|
|
3456
|
-
|
|
3602
|
+
const entityRef = result.entity_id ? `${result.entity_id}` : "@last:entity";
|
|
3603
|
+
const actionHint = {
|
|
3604
|
+
sign_documents: `corp form activate ${entityRef}`,
|
|
3605
|
+
submit_state_filing: `corp form activate ${entityRef}`,
|
|
3606
|
+
confirm_state_filing: `corp form activate ${entityRef} --filing-id "..."`,
|
|
3607
|
+
apply_for_ein: `corp form activate ${entityRef}`,
|
|
3608
|
+
confirm_ein: `corp form activate ${entityRef} --ein "..."`
|
|
3609
|
+
};
|
|
3610
|
+
const hint = actionHint[result.next_action];
|
|
3611
|
+
if (hint) {
|
|
3612
|
+
console.log(chalk5.yellow(`
|
|
3613
|
+
Next step: ${hint}`));
|
|
3614
|
+
} else {
|
|
3615
|
+
console.log(chalk5.yellow(`
|
|
3457
3616
|
Next: ${result.next_action}`));
|
|
3617
|
+
}
|
|
3458
3618
|
}
|
|
3459
3619
|
} catch (err) {
|
|
3460
3620
|
if (err instanceof Error && err.message.includes("exit")) throw err;
|
|
@@ -3767,6 +3927,12 @@ async function resolveEntityRefForFormCommand2(resolver, entityRef, dryRun) {
|
|
|
3767
3927
|
}
|
|
3768
3928
|
async function formCreateHandler(ctx) {
|
|
3769
3929
|
const opts = ctx.opts;
|
|
3930
|
+
if (opts.shares || opts.authorizedShares) {
|
|
3931
|
+
ctx.writer.error(
|
|
3932
|
+
"--shares / --authorized-shares is not accepted on form create.\n Set authorized shares during finalize:\n corp form finalize @last:entity --authorized-shares 10000000"
|
|
3933
|
+
);
|
|
3934
|
+
process.exit(1);
|
|
3935
|
+
}
|
|
3770
3936
|
const resolvedType = opts.type;
|
|
3771
3937
|
const resolvedName = opts.name;
|
|
3772
3938
|
if (!resolvedType) {
|
|
@@ -3800,7 +3966,7 @@ async function formCreateHandler(ctx) {
|
|
|
3800
3966
|
if (opts.sCorp !== void 0) payload.s_corp_election = opts.sCorp;
|
|
3801
3967
|
if (opts.transferRestrictions !== void 0) payload.transfer_restrictions = opts.transferRestrictions;
|
|
3802
3968
|
if (opts.rofr !== void 0) payload.right_of_first_refusal = opts.rofr;
|
|
3803
|
-
const companyAddress = parseCsvAddress2(opts.companyAddress);
|
|
3969
|
+
const companyAddress = parseCsvAddress2(opts.companyAddress ?? opts.address);
|
|
3804
3970
|
if (companyAddress) payload.company_address = companyAddress;
|
|
3805
3971
|
if (ctx.dryRun) {
|
|
3806
3972
|
printDryRun("formation.create_pending", payload);
|
|
@@ -3840,11 +4006,21 @@ async function formAddFounderHandler(ctx) {
|
|
|
3840
4006
|
const opts = ctx.opts;
|
|
3841
4007
|
try {
|
|
3842
4008
|
const resolvedEntityId = await resolveEntityRefForFormCommand2(ctx.resolver, entityRef, ctx.dryRun);
|
|
4009
|
+
const rawPct = opts.ownershipPct ?? opts.pct;
|
|
4010
|
+
if (!rawPct) {
|
|
4011
|
+
ctx.writer.error("required option '--ownership-pct <percent>' not specified");
|
|
4012
|
+
process.exit(1);
|
|
4013
|
+
}
|
|
4014
|
+
const pctValue = parseFloat(rawPct);
|
|
4015
|
+
if (isNaN(pctValue) || pctValue <= 0 || pctValue > 100) {
|
|
4016
|
+
ctx.writer.error(`--ownership-pct must be between 0 and 100 (e.g. 60 for 60%), got: ${rawPct}`);
|
|
4017
|
+
process.exit(1);
|
|
4018
|
+
}
|
|
3843
4019
|
const payload = {
|
|
3844
4020
|
name: opts.name,
|
|
3845
4021
|
email: opts.email,
|
|
3846
4022
|
role: opts.role,
|
|
3847
|
-
ownership_pct:
|
|
4023
|
+
ownership_pct: pctValue
|
|
3848
4024
|
};
|
|
3849
4025
|
if (opts.officerTitle) payload.officer_title = opts.officerTitle.toLowerCase();
|
|
3850
4026
|
if (opts.incorporator) payload.is_incorporator = true;
|
|
@@ -3997,6 +4173,11 @@ async function formActivateHandler(ctx) {
|
|
|
3997
4173
|
}
|
|
3998
4174
|
console.log(` Signatures added: ${result.signatures_added}`);
|
|
3999
4175
|
console.log(` Documents updated: ${result.documents_signed}`);
|
|
4176
|
+
if (result.final_status === "active") {
|
|
4177
|
+
console.log(chalk6.yellow("\n Next steps:"));
|
|
4178
|
+
console.log(chalk6.yellow(" corp cap-table View your cap table"));
|
|
4179
|
+
console.log(chalk6.yellow(" corp next See all recommended actions"));
|
|
4180
|
+
}
|
|
4000
4181
|
} catch (err) {
|
|
4001
4182
|
printError(`Failed to activate formation: ${err}`);
|
|
4002
4183
|
process.exit(1);
|
|
@@ -4017,15 +4198,15 @@ var init_formation = __esm({
|
|
|
4017
4198
|
passThroughOptions: true,
|
|
4018
4199
|
dryRun: true,
|
|
4019
4200
|
options: [
|
|
4020
|
-
{ flags: "--type <type>", description: "Entity type
|
|
4201
|
+
{ flags: "--type <type>", description: "Entity type", choices: ["llc", "c_corp", "s_corp"] },
|
|
4021
4202
|
{ flags: "--entity-type <type>", description: "Entity type (alias for --type)" },
|
|
4022
4203
|
{ flags: "--name <name>", description: "Legal name" },
|
|
4023
4204
|
{ flags: "--legal-name <name>", description: "Legal name (alias for --name)" },
|
|
4024
4205
|
{ flags: "--jurisdiction <jurisdiction>", description: "Jurisdiction (e.g. US-DE, US-WY)" },
|
|
4025
|
-
{ flags: "--member <member>", description: "Founder as 'name,email,role[,pct[,
|
|
4206
|
+
{ flags: "--member <member>", description: "Founder as 'name,email,role[,pct[,street|city|state|zip[,officer_title[,is_incorporator]]]]' (repeatable)", type: "array", default: [] },
|
|
4026
4207
|
{ flags: "--member-json <json>", description: "Founder JSON object (repeatable)", type: "array", default: [] },
|
|
4027
4208
|
{ flags: "--members-file <path>", description: 'Path to a JSON array of founders or {"members": [...]}' },
|
|
4028
|
-
{ flags: "--address <address>", description: "Company address as 'street,city,state,zip'" },
|
|
4209
|
+
{ flags: "--address <address>", description: "Company address as 'street,city,state,zip' (required for c_corp)" },
|
|
4029
4210
|
{ flags: "--fiscal-year-end <date>", description: "Fiscal year end (MM-DD)", default: "12-31" },
|
|
4030
4211
|
{ flags: "--s-corp", description: "Elect S-Corp status" },
|
|
4031
4212
|
{ flags: "--transfer-restrictions", description: "Enable transfer restrictions" },
|
|
@@ -4036,9 +4217,10 @@ var init_formation = __esm({
|
|
|
4036
4217
|
successTemplate: "Entity formed: {legal_name}",
|
|
4037
4218
|
examples: [
|
|
4038
4219
|
'corp form --type llc --name "My LLC" --member "Alice,alice@co.com,member,100"',
|
|
4220
|
+
'corp form --type c_corp --name "Acme Inc" --member "Bob,bob@co.com,director,100,123 Main|City|DE|19801,ceo,true"',
|
|
4039
4221
|
`corp form --type c_corp --name "Acme Inc" --jurisdiction US-DE --member-json '{"name":"Bob","email":"bob@acme.com","role":"director","pct":100}'`,
|
|
4040
4222
|
'corp form create --type llc --name "My LLC"',
|
|
4041
|
-
'corp form add-founder @last:entity --name "Alice" --email "alice@co.com" --role member --pct 100',
|
|
4223
|
+
'corp form add-founder @last:entity --name "Alice" --email "alice@co.com" --role member --ownership-pct 100',
|
|
4042
4224
|
"corp form finalize @last:entity",
|
|
4043
4225
|
"corp form activate @last:entity"
|
|
4044
4226
|
]
|
|
@@ -4048,7 +4230,7 @@ var init_formation = __esm({
|
|
|
4048
4230
|
description: "Create a pending entity (staged flow step 1)",
|
|
4049
4231
|
dryRun: true,
|
|
4050
4232
|
options: [
|
|
4051
|
-
{ flags: "--type <type>", description: "Entity type
|
|
4233
|
+
{ flags: "--type <type>", description: "Entity type", choices: ["llc", "c_corp", "s_corp"] },
|
|
4052
4234
|
{ flags: "--name <name>", description: "Legal name" },
|
|
4053
4235
|
{ flags: "--jurisdiction <jurisdiction>", description: "Jurisdiction (e.g. US-DE, US-WY)" },
|
|
4054
4236
|
{ flags: "--registered-agent-name <name>", description: "Registered agent legal name" },
|
|
@@ -4058,11 +4240,18 @@ var init_formation = __esm({
|
|
|
4058
4240
|
{ flags: "--s-corp", description: "Elect S-Corp status" },
|
|
4059
4241
|
{ flags: "--transfer-restrictions", description: "Enable transfer restrictions" },
|
|
4060
4242
|
{ flags: "--rofr", description: "Enable right of first refusal" },
|
|
4061
|
-
{ flags: "--company-address <address>", description: "Company address as 'street,city,state,zip'" }
|
|
4243
|
+
{ flags: "--company-address <address>", description: "Company address as 'street,city,state,zip'" },
|
|
4244
|
+
{ flags: "--address <address>", description: "Company address (alias for --company-address)" },
|
|
4245
|
+
{ flags: "--shares <count>", description: "", hidden: true },
|
|
4246
|
+
{ flags: "--authorized-shares <count>", description: "", hidden: true }
|
|
4062
4247
|
],
|
|
4063
4248
|
handler: formCreateHandler,
|
|
4064
4249
|
produces: { kind: "entity", trackEntity: true },
|
|
4065
|
-
successTemplate: "Pending entity created: {legal_name}"
|
|
4250
|
+
successTemplate: "Pending entity created: {legal_name}",
|
|
4251
|
+
examples: [
|
|
4252
|
+
'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'
|
|
4254
|
+
]
|
|
4066
4255
|
},
|
|
4067
4256
|
{
|
|
4068
4257
|
name: "form add-founder",
|
|
@@ -4072,13 +4261,18 @@ var init_formation = __esm({
|
|
|
4072
4261
|
options: [
|
|
4073
4262
|
{ flags: "--name <name>", description: "Founder name", required: true },
|
|
4074
4263
|
{ flags: "--email <email>", description: "Founder email", required: true },
|
|
4075
|
-
{ flags: "--role <role>", description: "
|
|
4076
|
-
{ flags: "--pct <
|
|
4264
|
+
{ flags: "--role <role>", description: "Founder role", required: true, choices: ["director", "officer", "manager", "member", "chair"] },
|
|
4265
|
+
{ flags: "--ownership-pct <percent>", description: "Ownership percentage (e.g. 60 for 60%)", required: true },
|
|
4266
|
+
{ flags: "--pct <percent>", description: "Alias for --ownership-pct" },
|
|
4077
4267
|
{ flags: "--officer-title <title>", description: "Officer title (corporations only)", choices: ["ceo", "cfo", "cto", "coo", "secretary", "treasurer", "president", "vp", "other"] },
|
|
4078
4268
|
{ flags: "--incorporator", description: "Mark as sole incorporator (corporations only)" },
|
|
4079
4269
|
{ flags: "--address <address>", description: "Founder address as 'street,city,state,zip'" }
|
|
4080
4270
|
],
|
|
4081
|
-
handler: formAddFounderHandler
|
|
4271
|
+
handler: formAddFounderHandler,
|
|
4272
|
+
examples: [
|
|
4273
|
+
'corp form add-founder @last --name "Alice" --email "alice@co.com" --role director --ownership-pct 60 --officer-title ceo --incorporator',
|
|
4274
|
+
'corp form add-founder @last --name "Bob" --email "bob@co.com" --role member --ownership-pct 40 --address "123 Main|City|ST|12345"'
|
|
4275
|
+
]
|
|
4082
4276
|
},
|
|
4083
4277
|
{
|
|
4084
4278
|
name: "form finalize",
|
|
@@ -4101,7 +4295,8 @@ var init_formation = __esm({
|
|
|
4101
4295
|
{ flags: "--incorporator-name <name>", description: "Incorporator legal name (overrides founder)" },
|
|
4102
4296
|
{ flags: "--incorporator-address <address>", description: "Incorporator mailing address (overrides founder)" }
|
|
4103
4297
|
],
|
|
4104
|
-
handler: formFinalizeHandler
|
|
4298
|
+
handler: formFinalizeHandler,
|
|
4299
|
+
examples: ["corp form finalize"]
|
|
4105
4300
|
},
|
|
4106
4301
|
{
|
|
4107
4302
|
name: "form activate",
|
|
@@ -4115,7 +4310,308 @@ var init_formation = __esm({
|
|
|
4115
4310
|
{ flags: "--receipt-reference <ref>", description: "External receipt reference to record" },
|
|
4116
4311
|
{ flags: "--ein <ein>", description: "EIN to confirm (defaults to a deterministic simulated EIN)" }
|
|
4117
4312
|
],
|
|
4118
|
-
handler: formActivateHandler
|
|
4313
|
+
handler: formActivateHandler,
|
|
4314
|
+
examples: ["corp form activate"]
|
|
4315
|
+
},
|
|
4316
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
4317
|
+
{
|
|
4318
|
+
name: "contracts",
|
|
4319
|
+
description: "Generate a contract document",
|
|
4320
|
+
route: { method: "POST", path: "/v1/contracts" },
|
|
4321
|
+
options: [
|
|
4322
|
+
{ flags: "--counterparty-name <counterparty-name>", description: "Counterparty Name", required: true },
|
|
4323
|
+
{ flags: "--effective-date <effective-date>", description: "Effective Date", required: true },
|
|
4324
|
+
{ flags: "--parameters <parameters>", description: "Parameters" },
|
|
4325
|
+
{ flags: "--template-type <template-type>", description: "Template type for generated contracts.", required: true, choices: ["consulting_agreement", "employment_offer", "contractor_agreement", "nda", "safe_agreement", "custom"] }
|
|
4326
|
+
],
|
|
4327
|
+
examples: ["corp contracts --counterparty-name 'counterparty-name' --effective-date 'effective-date' --template-type consulting_agreement", "corp contracts --json"],
|
|
4328
|
+
successTemplate: "Contracts created"
|
|
4329
|
+
},
|
|
4330
|
+
{
|
|
4331
|
+
name: "documents show",
|
|
4332
|
+
description: "View a document by ID",
|
|
4333
|
+
route: { method: "GET", path: "/v1/documents/{pos}" },
|
|
4334
|
+
entity: true,
|
|
4335
|
+
args: [{ name: "document-id", required: true, description: "Document ID" }],
|
|
4336
|
+
display: { title: "Document", cols: ["document_type>Type", "status>Status", "title>Title", "signature_count>Signatures", "@created_at>Created", "#document_id>ID"] },
|
|
4337
|
+
examples: ["corp documents show <document-id>", "corp documents show <document-id> --json"]
|
|
4338
|
+
},
|
|
4339
|
+
{
|
|
4340
|
+
name: "documents amendment-history",
|
|
4341
|
+
description: "View amendment history for a document",
|
|
4342
|
+
route: { method: "GET", path: "/v1/documents/{pos}/amendment-history" },
|
|
4343
|
+
entity: true,
|
|
4344
|
+
args: [{ name: "document-id", required: true, description: "Document ID" }],
|
|
4345
|
+
display: { title: "Documents Amendment History", cols: ["amended_at>Amended At", "description>Description", "version>Version"] },
|
|
4346
|
+
examples: ["corp documents amendment-history", "corp documents amendment-history --json"]
|
|
4347
|
+
},
|
|
4348
|
+
{
|
|
4349
|
+
name: "documents pdf",
|
|
4350
|
+
description: "Download a document as PDF",
|
|
4351
|
+
route: { method: "GET", path: "/v1/documents/{pos}/pdf" },
|
|
4352
|
+
entity: true,
|
|
4353
|
+
args: [{ name: "document-id", required: true, description: "Document ID" }],
|
|
4354
|
+
examples: ["corp documents pdf", "corp documents pdf --json"]
|
|
4355
|
+
},
|
|
4356
|
+
{
|
|
4357
|
+
name: "documents request-copy",
|
|
4358
|
+
description: "Request a certified copy of a document",
|
|
4359
|
+
route: { method: "POST", path: "/v1/documents/{pos}/request-copy" },
|
|
4360
|
+
args: [{ name: "document-id", required: true, description: "Document ID" }],
|
|
4361
|
+
options: [
|
|
4362
|
+
{ flags: "--recipient-email <recipient-email>", description: "Recipient Email" }
|
|
4363
|
+
],
|
|
4364
|
+
examples: ["corp documents request-copy <document-id>", "corp documents request-copy --json"],
|
|
4365
|
+
successTemplate: "Request Copy created"
|
|
4366
|
+
},
|
|
4367
|
+
{
|
|
4368
|
+
name: "entities list",
|
|
4369
|
+
description: "List all entities in the workspace",
|
|
4370
|
+
route: { method: "GET", path: "/v1/entities" },
|
|
4371
|
+
display: { title: "Entities", cols: ["legal_name>Name", "entity_type>Type", "formation_status>Status", "jurisdiction>Jurisdiction", "#entity_id>ID"] },
|
|
4372
|
+
examples: ["corp entities list", "corp entities list --json"]
|
|
4373
|
+
},
|
|
4374
|
+
{
|
|
4375
|
+
name: "entities governance-documents",
|
|
4376
|
+
description: "List governance documents for an entity",
|
|
4377
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance-documents" },
|
|
4378
|
+
entity: true,
|
|
4379
|
+
display: { title: "Entities Governance Documents", cols: ["@created_at>Created At", "#document_id>ID", "document_type>Document Type", "signature_count>Signature Count", "status>Status", "title>Title"] },
|
|
4380
|
+
examples: ["corp entities governance-documents", "corp entities governance-documents --json"]
|
|
4381
|
+
},
|
|
4382
|
+
{
|
|
4383
|
+
name: "entities governance-documents-current",
|
|
4384
|
+
description: "View current governance documents",
|
|
4385
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance-documents/current" },
|
|
4386
|
+
entity: true,
|
|
4387
|
+
display: { title: "Entities Governance Documents Current", cols: ["@created_at>Created At", "#document_id>ID", "document_type>Document Type", "signature_count>Signature Count", "status>Status", "title>Title"] },
|
|
4388
|
+
examples: ["corp entities governance-documents-current", "corp entities governance-documents-current --json"]
|
|
4389
|
+
},
|
|
4390
|
+
{
|
|
4391
|
+
name: "formations create",
|
|
4392
|
+
description: "View formation status for an entity",
|
|
4393
|
+
route: { method: "POST", path: "/v1/formations" },
|
|
4394
|
+
options: [
|
|
4395
|
+
{ flags: "--authorized-shares <authorized-shares>", description: "Number of authorized shares" },
|
|
4396
|
+
{ flags: "--company-address <company-address>", description: "Company mailing address" },
|
|
4397
|
+
{ flags: "--entity-type <entity-type>", description: "The legal structure of a business entity.", required: true, choices: ["c_corp", "llc"] },
|
|
4398
|
+
{ flags: "--fiscal-year-end <fiscal-year-end>", description: 'Fiscal year end, e.g. "12-31". Defaults to "12-31".' },
|
|
4399
|
+
{ flags: "--formation-date <formation-date>", description: "Optional formation date for importing pre-formed entities." },
|
|
4400
|
+
{ flags: "--jurisdiction <jurisdiction>", description: "Jurisdiction (e.g. Delaware, US-DE)", required: true },
|
|
4401
|
+
{ flags: "--legal-name <legal-name>", description: "Legal name of the entity", required: true },
|
|
4402
|
+
{ flags: "--members <members>", description: "LLC member entries", required: true, type: "array" },
|
|
4403
|
+
{ flags: "--par-value <par-value>", description: "Par value per share" },
|
|
4404
|
+
{ flags: "--registered-agent-address <registered-agent-address>", description: "Registered agent mailing address" },
|
|
4405
|
+
{ flags: "--registered-agent-name <registered-agent-name>", description: "Registered agent name" },
|
|
4406
|
+
{ flags: "--right-of-first-refusal <right-of-first-refusal>", description: "Include right of first refusal in bylaws (corp). Default true." },
|
|
4407
|
+
{ flags: "--s-corp-election <s-corp-election>", description: "Whether the company will elect S-Corp tax treatment." },
|
|
4408
|
+
{ flags: "--transfer-restrictions <transfer-restrictions>", description: "Include transfer restrictions in bylaws (corp). Default true." }
|
|
4409
|
+
],
|
|
4410
|
+
examples: ["corp formations --entity-type c_corp --jurisdiction 'jurisdiction' --legal-name 'legal-name' --members 'members'", "corp formations --json"],
|
|
4411
|
+
successTemplate: "Formations created"
|
|
4412
|
+
},
|
|
4413
|
+
{
|
|
4414
|
+
name: "formations pending",
|
|
4415
|
+
description: "List entities with pending formations",
|
|
4416
|
+
route: { method: "POST", path: "/v1/formations/pending" },
|
|
4417
|
+
options: [
|
|
4418
|
+
{ flags: "--company-address <company-address>", description: "Company mailing address" },
|
|
4419
|
+
{ flags: "--entity-type <entity-type>", description: "The legal structure of a business entity.", required: true, choices: ["c_corp", "llc"] },
|
|
4420
|
+
{ flags: "--fiscal-year-end <fiscal-year-end>", description: "Fiscal year end (e.g. 12-31)" },
|
|
4421
|
+
{ flags: "--formation-date <formation-date>", description: "Date of formation (ISO 8601)" },
|
|
4422
|
+
{ flags: "--jurisdiction <jurisdiction>", description: "Jurisdiction (e.g. Delaware, US-DE)" },
|
|
4423
|
+
{ flags: "--legal-name <legal-name>", description: "Legal name of the entity", required: true },
|
|
4424
|
+
{ flags: "--registered-agent-address <registered-agent-address>", description: "Registered agent mailing address" },
|
|
4425
|
+
{ flags: "--registered-agent-name <registered-agent-name>", description: "Registered agent name" },
|
|
4426
|
+
{ flags: "--right-of-first-refusal <right-of-first-refusal>", description: "Include ROFR in bylaws (true/false)" },
|
|
4427
|
+
{ flags: "--s-corp-election <s-corp-election>", description: "S Corp Election" },
|
|
4428
|
+
{ flags: "--transfer-restrictions <transfer-restrictions>", description: "Transfer Restrictions" }
|
|
4429
|
+
],
|
|
4430
|
+
examples: ["corp formations pending --entity-type c_corp --legal-name 'legal-name'", "corp formations pending --json"],
|
|
4431
|
+
successTemplate: "Pending created"
|
|
4432
|
+
},
|
|
4433
|
+
{
|
|
4434
|
+
name: "formations with-cap-table",
|
|
4435
|
+
description: "Create entity with formation and initial cap table",
|
|
4436
|
+
route: { method: "POST", path: "/v1/formations/with-cap-table" },
|
|
4437
|
+
options: [
|
|
4438
|
+
{ flags: "--authorized-shares <authorized-shares>", description: "Number of authorized shares" },
|
|
4439
|
+
{ flags: "--company-address <company-address>", description: "Company mailing address" },
|
|
4440
|
+
{ flags: "--entity-type <entity-type>", description: "The legal structure of a business entity.", required: true, choices: ["c_corp", "llc"] },
|
|
4441
|
+
{ flags: "--fiscal-year-end <fiscal-year-end>", description: 'Fiscal year end, e.g. "12-31". Defaults to "12-31".' },
|
|
4442
|
+
{ flags: "--formation-date <formation-date>", description: "Optional formation date for importing pre-formed entities." },
|
|
4443
|
+
{ flags: "--jurisdiction <jurisdiction>", description: "Jurisdiction (e.g. Delaware, US-DE)", required: true },
|
|
4444
|
+
{ flags: "--legal-name <legal-name>", description: "Legal name of the entity", required: true },
|
|
4445
|
+
{ flags: "--members <members>", description: "LLC member entries", required: true, type: "array" },
|
|
4446
|
+
{ flags: "--par-value <par-value>", description: "Par value per share" },
|
|
4447
|
+
{ flags: "--registered-agent-address <registered-agent-address>", description: "Registered agent mailing address" },
|
|
4448
|
+
{ flags: "--registered-agent-name <registered-agent-name>", description: "Registered agent name" },
|
|
4449
|
+
{ flags: "--right-of-first-refusal <right-of-first-refusal>", description: "Include right of first refusal in bylaws (corp). Default true." },
|
|
4450
|
+
{ flags: "--s-corp-election <s-corp-election>", description: "Whether the company will elect S-Corp tax treatment." },
|
|
4451
|
+
{ flags: "--transfer-restrictions <transfer-restrictions>", description: "Include transfer restrictions in bylaws (corp). Default true." }
|
|
4452
|
+
],
|
|
4453
|
+
examples: ["corp formations with-cap-table --entity-type c_corp --jurisdiction 'jurisdiction' --legal-name 'legal-name' --members 'members'", "corp formations with-cap-table --json"],
|
|
4454
|
+
successTemplate: "With Cap Table created"
|
|
4455
|
+
},
|
|
4456
|
+
{
|
|
4457
|
+
name: "formations",
|
|
4458
|
+
description: "View formation status for an entity",
|
|
4459
|
+
route: { method: "GET", path: "/v1/formations/{eid}" },
|
|
4460
|
+
entity: true,
|
|
4461
|
+
display: { title: "Formations", cols: ["entity_type>Entity Type", "formation_date>Formation Date", "formation_state>Formation State", "formation_status>Formation Status", "#entity_id>ID"] },
|
|
4462
|
+
examples: ["corp formations", "corp formations --json"]
|
|
4463
|
+
},
|
|
4464
|
+
{
|
|
4465
|
+
name: "formations apply-ein",
|
|
4466
|
+
description: "Submit EIN application",
|
|
4467
|
+
route: { method: "POST", path: "/v1/formations/{eid}/apply-ein" },
|
|
4468
|
+
entity: true,
|
|
4469
|
+
examples: ["corp formations apply-ein"],
|
|
4470
|
+
successTemplate: "Apply Ein created"
|
|
4471
|
+
},
|
|
4472
|
+
{
|
|
4473
|
+
name: "formations ein-confirmation",
|
|
4474
|
+
description: "Confirm EIN received from IRS",
|
|
4475
|
+
route: { method: "POST", path: "/v1/formations/{eid}/ein-confirmation" },
|
|
4476
|
+
entity: true,
|
|
4477
|
+
options: [
|
|
4478
|
+
{ flags: "--ein <ein>", description: "Employer Identification Number", required: true }
|
|
4479
|
+
],
|
|
4480
|
+
examples: ["corp formations ein-confirmation --ein 'ein'"],
|
|
4481
|
+
successTemplate: "Ein Confirmation created"
|
|
4482
|
+
},
|
|
4483
|
+
{
|
|
4484
|
+
name: "formations filing-attestation",
|
|
4485
|
+
description: "Attest to filing accuracy",
|
|
4486
|
+
route: { method: "POST", path: "/v1/formations/{eid}/filing-attestation" },
|
|
4487
|
+
entity: true,
|
|
4488
|
+
options: [
|
|
4489
|
+
{ flags: "--consent-text <consent-text>", description: "Consent Text" },
|
|
4490
|
+
{ flags: "--notes <notes>", description: "Additional notes" },
|
|
4491
|
+
{ flags: "--signer-email <signer-email>", description: "Signer Email", required: true },
|
|
4492
|
+
{ flags: "--signer-name <signer-name>", description: "Signer Name", required: true },
|
|
4493
|
+
{ flags: "--signer-role <signer-role>", description: "Signer Role", required: true }
|
|
4494
|
+
],
|
|
4495
|
+
examples: ["corp formations filing-attestation --signer-email 'signer-email' --signer-name 'signer-name' --signer-role 'signer-role'", "corp formations filing-attestation --json"],
|
|
4496
|
+
successTemplate: "Filing Attestation created"
|
|
4497
|
+
},
|
|
4498
|
+
{
|
|
4499
|
+
name: "formations filing-confirmation",
|
|
4500
|
+
description: "Confirm state filing received",
|
|
4501
|
+
route: { method: "POST", path: "/v1/formations/{eid}/filing-confirmation" },
|
|
4502
|
+
entity: true,
|
|
4503
|
+
options: [
|
|
4504
|
+
{ flags: "--external-filing-id <external-filing-id>", description: "External Filing Id", required: true },
|
|
4505
|
+
{ flags: "--receipt-reference <receipt-reference>", description: "Receipt Reference" }
|
|
4506
|
+
],
|
|
4507
|
+
examples: ["corp formations filing-confirmation --external-filing-id 'external-filing-id'", "corp formations filing-confirmation --json"],
|
|
4508
|
+
successTemplate: "Filing Confirmation created"
|
|
4509
|
+
},
|
|
4510
|
+
{
|
|
4511
|
+
name: "formations finalize",
|
|
4512
|
+
description: "Finalize a formation (lock documents)",
|
|
4513
|
+
route: { method: "POST", path: "/v1/formations/{eid}/finalize" },
|
|
4514
|
+
entity: true,
|
|
4515
|
+
options: [
|
|
4516
|
+
{ flags: "--authorized-shares <authorized-shares>", description: "Number of authorized shares" },
|
|
4517
|
+
{ flags: "--board-size <board-size>", description: "Board Size" },
|
|
4518
|
+
{ flags: "--company-address <company-address>", description: "Company mailing address" },
|
|
4519
|
+
{ flags: "--fiscal-year-end <fiscal-year-end>", description: "Fiscal year end (e.g. 12-31)" },
|
|
4520
|
+
{ flags: "--formation-date <formation-date>", description: "Date of formation (ISO 8601)" },
|
|
4521
|
+
{ flags: "--incorporator-address <incorporator-address>", description: "Incorporator Address" },
|
|
4522
|
+
{ flags: "--incorporator-name <incorporator-name>", description: "Incorporator Name" },
|
|
4523
|
+
{ flags: "--par-value <par-value>", description: "Par value per share" },
|
|
4524
|
+
{ flags: "--principal-name <principal-name>", description: "Principal Name" },
|
|
4525
|
+
{ flags: "--registered-agent-address <registered-agent-address>", description: "Registered agent mailing address" },
|
|
4526
|
+
{ flags: "--registered-agent-name <registered-agent-name>", description: "Registered agent name" },
|
|
4527
|
+
{ flags: "--right-of-first-refusal <right-of-first-refusal>", description: "Include ROFR in bylaws (true/false)" },
|
|
4528
|
+
{ flags: "--s-corp-election <s-corp-election>", description: "S Corp Election" },
|
|
4529
|
+
{ flags: "--transfer-restrictions <transfer-restrictions>", description: "Transfer Restrictions" }
|
|
4530
|
+
],
|
|
4531
|
+
examples: ["corp formations finalize", "corp formations finalize --json"],
|
|
4532
|
+
successTemplate: "Finalize created"
|
|
4533
|
+
},
|
|
4534
|
+
{
|
|
4535
|
+
name: "formations founders",
|
|
4536
|
+
description: "Add founders to a formation",
|
|
4537
|
+
route: { method: "POST", path: "/v1/formations/{eid}/founders" },
|
|
4538
|
+
entity: true,
|
|
4539
|
+
options: [
|
|
4540
|
+
{ flags: "--address <address>", description: "Address" },
|
|
4541
|
+
{ flags: "--email <email>", description: "Email" },
|
|
4542
|
+
{ flags: "--is-incorporator <is-incorporator>", description: "Is Incorporator" },
|
|
4543
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
4544
|
+
{ flags: "--officer-title <officer-title>", description: "Officer Title", choices: ["ceo", "cfo", "cto", "coo", "secretary", "treasurer", "president", "vp", "other"] },
|
|
4545
|
+
{ flags: "--ownership-pct <ownership-pct>", description: "Ownership Pct" },
|
|
4546
|
+
{ flags: "--role <role>", description: "Role", choices: ["director", "officer", "manager", "member", "chair"] }
|
|
4547
|
+
],
|
|
4548
|
+
examples: ["corp formations founders --name ceo", "corp formations founders --json"],
|
|
4549
|
+
successTemplate: "Founders created"
|
|
4550
|
+
},
|
|
4551
|
+
{
|
|
4552
|
+
name: "formations gates",
|
|
4553
|
+
description: "View formation gate status (checklist)",
|
|
4554
|
+
route: { method: "GET", path: "/v1/formations/{eid}/gates" },
|
|
4555
|
+
entity: true,
|
|
4556
|
+
display: { title: "Formations Gates", cols: ["attestation_recorded>Attestation Recorded", "designated_attestor_email>Designated Attestor Email", "designated_attestor_name>Designated Attestor Name", "designated_attestor_role>Designated Attestor Role", "#entity_id>ID"] },
|
|
4557
|
+
examples: ["corp formations gates", "corp formations gates --json"]
|
|
4558
|
+
},
|
|
4559
|
+
{
|
|
4560
|
+
name: "formations mark-documents-signed",
|
|
4561
|
+
description: "Mark formation documents as signed",
|
|
4562
|
+
route: { method: "POST", path: "/v1/formations/{eid}/mark-documents-signed" },
|
|
4563
|
+
entity: true,
|
|
4564
|
+
examples: ["corp formations mark-documents-signed"],
|
|
4565
|
+
successTemplate: "Mark Documents Signed created"
|
|
4566
|
+
},
|
|
4567
|
+
{
|
|
4568
|
+
name: "formations registered-agent-consent-evidence",
|
|
4569
|
+
description: "Provide registered agent consent evidence",
|
|
4570
|
+
route: { method: "POST", path: "/v1/formations/{eid}/registered-agent-consent-evidence" },
|
|
4571
|
+
entity: true,
|
|
4572
|
+
options: [
|
|
4573
|
+
{ flags: "--evidence-type <evidence-type>", description: "Evidence Type" },
|
|
4574
|
+
{ flags: "--evidence-uri <evidence-uri>", description: "Evidence Uri", required: true },
|
|
4575
|
+
{ flags: "--notes <notes>", description: "Additional notes" }
|
|
4576
|
+
],
|
|
4577
|
+
examples: ["corp formations registered-agent-consent-evidence --evidence-uri 'evidence-uri'", "corp formations registered-agent-consent-evidence --json"],
|
|
4578
|
+
successTemplate: "Registered Agent Consent Evidence created"
|
|
4579
|
+
},
|
|
4580
|
+
{
|
|
4581
|
+
name: "formations service-agreement-execute",
|
|
4582
|
+
description: "Execute the service agreement",
|
|
4583
|
+
route: { method: "POST", path: "/v1/formations/{eid}/service-agreement/execute" },
|
|
4584
|
+
entity: true,
|
|
4585
|
+
options: [
|
|
4586
|
+
{ flags: "--contract-id <contract-id>", description: "Contract Id" },
|
|
4587
|
+
{ flags: "--document-id <document-id>", description: "Document ID" },
|
|
4588
|
+
{ flags: "--notes <notes>", description: "Additional notes" }
|
|
4589
|
+
],
|
|
4590
|
+
examples: ["corp formations service-agreement-execute", "corp formations service-agreement-execute --json"],
|
|
4591
|
+
successTemplate: "Service Agreement Execute created"
|
|
4592
|
+
},
|
|
4593
|
+
{
|
|
4594
|
+
name: "formations submit-filing",
|
|
4595
|
+
description: "Submit state filing for a formation",
|
|
4596
|
+
route: { method: "POST", path: "/v1/formations/{eid}/submit-filing" },
|
|
4597
|
+
entity: true,
|
|
4598
|
+
examples: ["corp formations submit-filing"],
|
|
4599
|
+
successTemplate: "Submit Filing created"
|
|
4600
|
+
},
|
|
4601
|
+
{
|
|
4602
|
+
name: "governance catalog",
|
|
4603
|
+
description: "Browse the governance document catalog",
|
|
4604
|
+
route: { method: "GET", path: "/v1/governance/catalog" },
|
|
4605
|
+
display: { title: "Governance Catalog", cols: ["categories>Categories"] },
|
|
4606
|
+
examples: ["corp governance catalog"]
|
|
4607
|
+
},
|
|
4608
|
+
{
|
|
4609
|
+
name: "governance catalog-markdown",
|
|
4610
|
+
description: "View a governance document in markdown",
|
|
4611
|
+
route: { method: "GET", path: "/v1/governance/catalog/{pos}/markdown" },
|
|
4612
|
+
args: [{ name: "document-id", required: true, description: "Document ID" }],
|
|
4613
|
+
display: { title: "Governance Catalog Markdown", cols: ["category>Category", "entity_scope>Entity Scope", "id>Id", "markdown>Markdown", "title>Title", "variants>Variants"] },
|
|
4614
|
+
examples: ["corp governance catalog-markdown"]
|
|
4119
4615
|
}
|
|
4120
4616
|
];
|
|
4121
4617
|
}
|
|
@@ -4158,7 +4654,16 @@ var init_cap_table = __esm({
|
|
|
4158
4654
|
},
|
|
4159
4655
|
handler: async (ctx) => {
|
|
4160
4656
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
4161
|
-
|
|
4657
|
+
let data;
|
|
4658
|
+
try {
|
|
4659
|
+
data = await ctx.client.getCapTable(eid);
|
|
4660
|
+
} catch (err) {
|
|
4661
|
+
const msg = String(err);
|
|
4662
|
+
if (msg.includes("no linked legal entity") || msg.includes("Not found")) {
|
|
4663
|
+
throw new Error("No cap table found. Finalize formation first: corp form finalize " + eid);
|
|
4664
|
+
}
|
|
4665
|
+
throw err;
|
|
4666
|
+
}
|
|
4162
4667
|
const instruments = Array.isArray(data.instruments) ? data.instruments : [];
|
|
4163
4668
|
const shareClasses = Array.isArray(data.share_classes) ? data.share_classes : [];
|
|
4164
4669
|
await ctx.resolver.stabilizeRecords("instrument", instruments, eid);
|
|
@@ -4189,7 +4694,7 @@ var init_cap_table = __esm({
|
|
|
4189
4694
|
// --- cap-table safes ---
|
|
4190
4695
|
{
|
|
4191
4696
|
name: "cap-table safes",
|
|
4192
|
-
description: "SAFE notes",
|
|
4697
|
+
description: "List SAFE notes",
|
|
4193
4698
|
route: { method: "GET", path: "/v1/entities/{eid}/safe-notes" },
|
|
4194
4699
|
entity: true,
|
|
4195
4700
|
display: {
|
|
@@ -4209,7 +4714,8 @@ var init_cap_table = __esm({
|
|
|
4209
4714
|
return;
|
|
4210
4715
|
}
|
|
4211
4716
|
printSafesTable(safes);
|
|
4212
|
-
}
|
|
4717
|
+
},
|
|
4718
|
+
examples: ["corp cap-table safes", "corp cap-table safes --json"]
|
|
4213
4719
|
},
|
|
4214
4720
|
// --- cap-table transfers ---
|
|
4215
4721
|
{
|
|
@@ -4234,7 +4740,8 @@ var init_cap_table = __esm({
|
|
|
4234
4740
|
return;
|
|
4235
4741
|
}
|
|
4236
4742
|
printTransfersTable(transfers);
|
|
4237
|
-
}
|
|
4743
|
+
},
|
|
4744
|
+
examples: ["corp cap-table transfers", "corp cap-table transfers --json"]
|
|
4238
4745
|
},
|
|
4239
4746
|
// --- cap-table instruments ---
|
|
4240
4747
|
{
|
|
@@ -4261,12 +4768,13 @@ var init_cap_table = __esm({
|
|
|
4261
4768
|
return;
|
|
4262
4769
|
}
|
|
4263
4770
|
printInstrumentsTable(instruments);
|
|
4264
|
-
}
|
|
4771
|
+
},
|
|
4772
|
+
examples: ["corp cap-table instruments", "corp cap-table instruments --json"]
|
|
4265
4773
|
},
|
|
4266
4774
|
// --- cap-table share-classes ---
|
|
4267
4775
|
{
|
|
4268
4776
|
name: "cap-table share-classes",
|
|
4269
|
-
description: "
|
|
4777
|
+
description: "List share classes",
|
|
4270
4778
|
route: { method: "GET", path: "/v1/entities/{eid}/cap-table" },
|
|
4271
4779
|
entity: true,
|
|
4272
4780
|
display: {
|
|
@@ -4288,7 +4796,8 @@ var init_cap_table = __esm({
|
|
|
4288
4796
|
return;
|
|
4289
4797
|
}
|
|
4290
4798
|
printShareClassesTable(shareClasses);
|
|
4291
|
-
}
|
|
4799
|
+
},
|
|
4800
|
+
examples: ["corp cap-table share-classes", "corp cap-table share-classes --json"]
|
|
4292
4801
|
},
|
|
4293
4802
|
// --- cap-table rounds ---
|
|
4294
4803
|
{
|
|
@@ -4313,7 +4822,8 @@ var init_cap_table = __esm({
|
|
|
4313
4822
|
return;
|
|
4314
4823
|
}
|
|
4315
4824
|
printRoundsTable(rounds);
|
|
4316
|
-
}
|
|
4825
|
+
},
|
|
4826
|
+
examples: ["corp cap-table rounds", "corp cap-table rounds --json"]
|
|
4317
4827
|
},
|
|
4318
4828
|
// --- cap-table valuations ---
|
|
4319
4829
|
{
|
|
@@ -4338,7 +4848,8 @@ var init_cap_table = __esm({
|
|
|
4338
4848
|
return;
|
|
4339
4849
|
}
|
|
4340
4850
|
printValuationsTable(valuations);
|
|
4341
|
-
}
|
|
4851
|
+
},
|
|
4852
|
+
examples: ["corp cap-table valuations", "corp cap-table valuations --json"]
|
|
4342
4853
|
},
|
|
4343
4854
|
// --- cap-table 409a ---
|
|
4344
4855
|
{
|
|
@@ -4388,7 +4899,8 @@ var init_cap_table = __esm({
|
|
|
4388
4899
|
}
|
|
4389
4900
|
process.exit(1);
|
|
4390
4901
|
}
|
|
4391
|
-
}
|
|
4902
|
+
},
|
|
4903
|
+
examples: ["corp cap-table 409a", "corp cap-table 409a --json"]
|
|
4392
4904
|
},
|
|
4393
4905
|
// --- cap-table control-map ---
|
|
4394
4906
|
{
|
|
@@ -4429,7 +4941,8 @@ var init_cap_table = __esm({
|
|
|
4429
4941
|
return;
|
|
4430
4942
|
}
|
|
4431
4943
|
ctx.writer.json(result);
|
|
4432
|
-
}
|
|
4944
|
+
},
|
|
4945
|
+
examples: ["corp cap-table control-map", "corp cap-table control-map --json"]
|
|
4433
4946
|
},
|
|
4434
4947
|
// --- cap-table dilution ---
|
|
4435
4948
|
{
|
|
@@ -4454,7 +4967,8 @@ var init_cap_table = __esm({
|
|
|
4454
4967
|
console.log(chalk7.dim(" For scenario modeling, create a new round with: corp cap-table start-round --name '...' --issuer-legal-entity-id '...'"));
|
|
4455
4968
|
}
|
|
4456
4969
|
ctx.writer.json(result);
|
|
4457
|
-
}
|
|
4970
|
+
},
|
|
4971
|
+
examples: ["corp cap-table dilution", "corp cap-table dilution --json"]
|
|
4458
4972
|
},
|
|
4459
4973
|
// --- cap-table create-instrument ---
|
|
4460
4974
|
{
|
|
@@ -4507,7 +5021,8 @@ var init_cap_table = __esm({
|
|
|
4507
5021
|
printReferenceSummary("instrument", result, { showReuseHint: true });
|
|
4508
5022
|
},
|
|
4509
5023
|
produces: { kind: "instrument" },
|
|
4510
|
-
successTemplate: "Instrument created: {symbol}"
|
|
5024
|
+
successTemplate: "Instrument created: {symbol}",
|
|
5025
|
+
examples: ["corp cap-table create-instrument --kind 'kind' --symbol 'symbol'", "corp cap-table create-instrument --json"]
|
|
4511
5026
|
},
|
|
4512
5027
|
// --- cap-table issue-equity ---
|
|
4513
5028
|
{
|
|
@@ -4583,7 +5098,11 @@ var init_cap_table = __esm({
|
|
|
4583
5098
|
}
|
|
4584
5099
|
},
|
|
4585
5100
|
produces: { kind: "round" },
|
|
4586
|
-
successTemplate: "Equity issued: {round_name}"
|
|
5101
|
+
successTemplate: "Equity issued: {round_name}",
|
|
5102
|
+
examples: [
|
|
5103
|
+
'corp cap-table issue-equity --grant-type common --shares 50000 --recipient "Alice Smith"',
|
|
5104
|
+
'corp cap-table issue-equity --grant-type iso --shares 10000 --recipient "Bob" --email "bob@co.com"'
|
|
5105
|
+
]
|
|
4587
5106
|
},
|
|
4588
5107
|
// --- cap-table issue-safe ---
|
|
4589
5108
|
{
|
|
@@ -4594,20 +5113,32 @@ var init_cap_table = __esm({
|
|
|
4594
5113
|
dryRun: true,
|
|
4595
5114
|
options: [
|
|
4596
5115
|
{ flags: "--investor <name>", description: "Investor name", required: true },
|
|
4597
|
-
{ flags: "--amount-cents <n>", description: "Principal amount in cents (e.g.
|
|
4598
|
-
{ flags: "--amount <n>", description: "", type: "int" },
|
|
4599
|
-
{ flags: "--safe-type <type>", description: "SAFE type", default: "post_money" },
|
|
4600
|
-
{ flags: "--valuation-cap-cents <n>", description: "Valuation cap in cents (e.g.
|
|
4601
|
-
{ flags: "--valuation-cap <n>", description: "", type: "int" },
|
|
5116
|
+
{ 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" },
|
|
5118
|
+
{ flags: "--safe-type <type>", description: "SAFE type", default: "post_money", choices: ["post_money", "pre_money", "mfn"] },
|
|
5119
|
+
{ 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" },
|
|
4602
5121
|
{ flags: "--meeting-id <ref>", description: "Board meeting reference required when issuing under a board-governed entity" },
|
|
4603
5122
|
{ flags: "--resolution-id <ref>", description: "Board resolution reference required when issuing under a board-governed entity" }
|
|
4604
5123
|
],
|
|
4605
5124
|
handler: async (ctx) => {
|
|
4606
5125
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
4607
5126
|
const investor = ctx.opts.investor;
|
|
4608
|
-
|
|
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.");
|
|
5129
|
+
}
|
|
5130
|
+
const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0;
|
|
5131
|
+
if (amountCents == null) {
|
|
5132
|
+
throw new Error("required option '--amount-cents <n>' or '--amount <n>' not specified");
|
|
5133
|
+
}
|
|
4609
5134
|
const safeType = ctx.opts.safeType ?? "post_money";
|
|
4610
|
-
|
|
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.");
|
|
5137
|
+
}
|
|
5138
|
+
const valuationCapCents = ctx.opts.valuationCapCents != null ? ctx.opts.valuationCapCents : ctx.opts.valuationCap != null ? ctx.opts.valuationCap * 100 : void 0;
|
|
5139
|
+
if (valuationCapCents == null) {
|
|
5140
|
+
throw new Error("required option '--valuation-cap-cents <n>' or '--valuation-cap <n>' not specified");
|
|
5141
|
+
}
|
|
4611
5142
|
const email = ctx.opts.email;
|
|
4612
5143
|
const optMeetingId = ctx.opts.meetingId;
|
|
4613
5144
|
const optResolutionId = ctx.opts.resolutionId;
|
|
@@ -4650,7 +5181,8 @@ var init_cap_table = __esm({
|
|
|
4650
5181
|
printReferenceSummary("safe_note", result.data, { showReuseHint: true });
|
|
4651
5182
|
},
|
|
4652
5183
|
produces: { kind: "safe_note" },
|
|
4653
|
-
successTemplate: "SAFE created: {investor_name}"
|
|
5184
|
+
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"]
|
|
4654
5186
|
},
|
|
4655
5187
|
// --- cap-table transfer ---
|
|
4656
5188
|
{
|
|
@@ -4663,9 +5195,9 @@ var init_cap_table = __esm({
|
|
|
4663
5195
|
{ flags: "--from <ref>", description: "Source contact reference (from_contact_id)", required: true },
|
|
4664
5196
|
{ flags: "--to <ref>", description: "Destination contact reference (to_contact_id)", required: true },
|
|
4665
5197
|
{ flags: "--shares <n>", description: "Number of shares to transfer", required: true, type: "int" },
|
|
4666
|
-
{ flags: "--share-class-id <ref>", description: "Share class reference
|
|
4667
|
-
{ flags: "--governing-doc-type <type>", description: "Governing doc type (bylaws, operating_agreement, shareholder_agreement, other)",
|
|
4668
|
-
{ flags: "--transferee-rights <rights>", description: "Transferee rights (full_member, economic_only, limited)",
|
|
5198
|
+
{ flags: "--share-class-id <ref>", description: "Share class reference (auto-resolved if only one exists)" },
|
|
5199
|
+
{ flags: "--governing-doc-type <type>", description: "Governing doc type (bylaws, operating_agreement, shareholder_agreement, other)", default: "bylaws" },
|
|
5200
|
+
{ flags: "--transferee-rights <rights>", description: "Transferee rights (full_member, economic_only, limited)", default: "full_member" },
|
|
4669
5201
|
{ flags: "--prepare-intent-id <id>", description: "Prepare intent ID (auto-created if omitted)" },
|
|
4670
5202
|
{ flags: "--type <type>", description: "Transfer type (gift, trust_transfer, secondary_sale, estate, other)", default: "secondary_sale" },
|
|
4671
5203
|
{ flags: "--price-per-share-cents <n>", description: "Price per share in cents", type: "int" },
|
|
@@ -4675,7 +5207,21 @@ var init_cap_table = __esm({
|
|
|
4675
5207
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
4676
5208
|
const fromContactId = await ctx.resolver.resolveContact(eid, ctx.opts.from);
|
|
4677
5209
|
const toContactId = await ctx.resolver.resolveContact(eid, ctx.opts.to);
|
|
4678
|
-
|
|
5210
|
+
let shareClassId;
|
|
5211
|
+
if (ctx.opts.shareClassId) {
|
|
5212
|
+
shareClassId = await ctx.resolver.resolveShareClass(eid, ctx.opts.shareClassId);
|
|
5213
|
+
} else {
|
|
5214
|
+
const capTable = await ctx.client.getCapTable(eid);
|
|
5215
|
+
const instruments = capTable.instruments ?? [];
|
|
5216
|
+
const classIds = [...new Set(instruments.map((i) => i.share_class_id).filter(Boolean))];
|
|
5217
|
+
if (classIds.length === 1) {
|
|
5218
|
+
shareClassId = classIds[0];
|
|
5219
|
+
} else if (classIds.length === 0) {
|
|
5220
|
+
throw new Error("No share classes found. Create one first or specify --share-class-id.");
|
|
5221
|
+
} else {
|
|
5222
|
+
throw new Error(`Multiple share classes found (${classIds.length}). Specify --share-class-id to disambiguate.`);
|
|
5223
|
+
}
|
|
5224
|
+
}
|
|
4679
5225
|
const shares = ctx.opts.shares;
|
|
4680
5226
|
const pricePerShareCents = ctx.opts.pricePerShareCents;
|
|
4681
5227
|
const relationship = ctx.opts.relationship;
|
|
@@ -4738,7 +5284,8 @@ var init_cap_table = __esm({
|
|
|
4738
5284
|
printReferenceSummary("share_transfer", result, { label: "Transfer Ref:", showReuseHint: true });
|
|
4739
5285
|
},
|
|
4740
5286
|
produces: { kind: "share_transfer" },
|
|
4741
|
-
successTemplate: "Transfer created"
|
|
5287
|
+
successTemplate: "Transfer created",
|
|
5288
|
+
examples: ["corp cap-table transfer --from 'ref' --to 'ref' --shares 'n' --share-class-id 'ref' --governing-doc-type 'type' --transferee-rights 'rights'", "corp cap-table transfer --json"]
|
|
4742
5289
|
},
|
|
4743
5290
|
// --- cap-table distribute ---
|
|
4744
5291
|
{
|
|
@@ -4749,13 +5296,19 @@ var init_cap_table = __esm({
|
|
|
4749
5296
|
dryRun: true,
|
|
4750
5297
|
options: [
|
|
4751
5298
|
{ flags: "--amount-cents <n>", description: "Total distribution amount in cents (e.g. 100000 = $1,000.00)", required: true, type: "int" },
|
|
4752
|
-
{ flags: "--amount <n>", description: "", type: "int" },
|
|
5299
|
+
{ flags: "--amount <n>", description: "Amount in dollars (alternative to --amount-cents)", type: "int" },
|
|
4753
5300
|
{ flags: "--type <type>", description: "Distribution type (dividend, return, liquidation)", default: "dividend" },
|
|
4754
5301
|
{ flags: "--description <desc>", description: "Distribution description", required: true }
|
|
4755
5302
|
],
|
|
4756
5303
|
handler: async (ctx) => {
|
|
4757
5304
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
4758
|
-
|
|
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.");
|
|
5307
|
+
}
|
|
5308
|
+
const amountCents = ctx.opts.amountCents != null ? ctx.opts.amountCents : ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0;
|
|
5309
|
+
if (amountCents == null) {
|
|
5310
|
+
throw new Error("required option '--amount-cents <n>' or '--amount <n>' not specified");
|
|
5311
|
+
}
|
|
4759
5312
|
const distributionType = ctx.opts.type ?? "dividend";
|
|
4760
5313
|
const description = ctx.opts.description;
|
|
4761
5314
|
const payload = {
|
|
@@ -4777,7 +5330,8 @@ var init_cap_table = __esm({
|
|
|
4777
5330
|
}
|
|
4778
5331
|
ctx.writer.success(`Distribution calculated: ${result.distribution_id ?? "OK"}`);
|
|
4779
5332
|
printReferenceSummary("distribution", result, { showReuseHint: true });
|
|
4780
|
-
}
|
|
5333
|
+
},
|
|
5334
|
+
examples: ["corp cap-table distribute --amount-cents 'n' --description 'desc'", "corp cap-table distribute --json"]
|
|
4781
5335
|
},
|
|
4782
5336
|
// --- cap-table start-round ---
|
|
4783
5337
|
{
|
|
@@ -4788,11 +5342,19 @@ var init_cap_table = __esm({
|
|
|
4788
5342
|
dryRun: true,
|
|
4789
5343
|
options: [
|
|
4790
5344
|
{ flags: "--name <name>", description: "Round name", required: true },
|
|
4791
|
-
{ flags: "--issuer-legal-entity-id <ref>", description: "Issuer legal entity reference
|
|
5345
|
+
{ flags: "--issuer-legal-entity-id <ref>", description: "Issuer legal entity reference (auto-resolved from cap table if omitted)" }
|
|
4792
5346
|
],
|
|
4793
5347
|
handler: async (ctx) => {
|
|
4794
5348
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
4795
|
-
|
|
5349
|
+
let issuerLegalEntityId = ctx.opts.issuerLegalEntityId;
|
|
5350
|
+
if (!issuerLegalEntityId) {
|
|
5351
|
+
const capTable = await ctx.client.getCapTable(eid);
|
|
5352
|
+
issuerLegalEntityId = capTable.issuer_legal_entity_id;
|
|
5353
|
+
}
|
|
5354
|
+
if (!issuerLegalEntityId) {
|
|
5355
|
+
throw new Error("No issuer legal entity found. Provide --issuer-legal-entity-id or ensure the entity has a cap table.");
|
|
5356
|
+
}
|
|
5357
|
+
issuerLegalEntityId = await ctx.resolver.resolveEntity(issuerLegalEntityId);
|
|
4796
5358
|
const payload = {
|
|
4797
5359
|
entity_id: eid,
|
|
4798
5360
|
name: ctx.opts.name,
|
|
@@ -4813,7 +5375,8 @@ var init_cap_table = __esm({
|
|
|
4813
5375
|
printReferenceSummary("round", result, { showReuseHint: true });
|
|
4814
5376
|
},
|
|
4815
5377
|
produces: { kind: "round" },
|
|
4816
|
-
successTemplate: "Round started: {round_name}"
|
|
5378
|
+
successTemplate: "Round started: {round_name}",
|
|
5379
|
+
examples: ["corp cap-table start-round --name 'name' --issuer-legal-entity-id 'ref'"]
|
|
4817
5380
|
},
|
|
4818
5381
|
// --- cap-table add-security ---
|
|
4819
5382
|
{
|
|
@@ -4856,7 +5419,8 @@ var init_cap_table = __esm({
|
|
|
4856
5419
|
return;
|
|
4857
5420
|
}
|
|
4858
5421
|
ctx.writer.success(`Security added for ${ctx.opts.recipientName}`);
|
|
4859
|
-
}
|
|
5422
|
+
},
|
|
5423
|
+
examples: ["corp cap-table add-security --round-id 'ref' --instrument-id 'ref' --quantity 'n' --recipient-name 'name'", "corp cap-table add-security --json"]
|
|
4860
5424
|
},
|
|
4861
5425
|
// --- cap-table issue-round ---
|
|
4862
5426
|
{
|
|
@@ -4867,8 +5431,8 @@ var init_cap_table = __esm({
|
|
|
4867
5431
|
dryRun: true,
|
|
4868
5432
|
options: [
|
|
4869
5433
|
{ flags: "--round-id <ref>", description: "Round reference", required: true },
|
|
4870
|
-
{ flags: "--meeting-id <ref>", description: "Board meeting reference required
|
|
4871
|
-
{ flags: "--resolution-id <ref>", description: "Board resolution reference required
|
|
5434
|
+
{ flags: "--meeting-id <ref>", description: "Board meeting reference (required if entity has an active board)" },
|
|
5435
|
+
{ flags: "--resolution-id <ref>", description: "Board resolution reference (required if entity has an active board)" }
|
|
4872
5436
|
],
|
|
4873
5437
|
handler: async (ctx) => {
|
|
4874
5438
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
@@ -4886,7 +5450,8 @@ var init_cap_table = __esm({
|
|
|
4886
5450
|
}
|
|
4887
5451
|
if ((!meetingId || !resolutionId) && await entityHasActiveBoard(ctx.client, eid)) {
|
|
4888
5452
|
throw new Error(
|
|
4889
|
-
|
|
5453
|
+
`Board approval is required before issuing this round. Pass --meeting-id and --resolution-id from a passed board vote.
|
|
5454
|
+
Tip: Use 'corp governance quick-approve --text "RESOLVED: ..."' for one-step approval.`
|
|
4890
5455
|
);
|
|
4891
5456
|
}
|
|
4892
5457
|
const body = { entity_id: eid };
|
|
@@ -4903,7 +5468,8 @@ var init_cap_table = __esm({
|
|
|
4903
5468
|
if (roundMatch) {
|
|
4904
5469
|
printReferenceSummary("round", roundMatch.raw, { showReuseHint: true });
|
|
4905
5470
|
}
|
|
4906
|
-
}
|
|
5471
|
+
},
|
|
5472
|
+
examples: ["corp cap-table issue-round --round-id 'ref'", "corp cap-table issue-round --json"]
|
|
4907
5473
|
},
|
|
4908
5474
|
// --- cap-table create-valuation ---
|
|
4909
5475
|
{
|
|
@@ -4915,9 +5481,10 @@ var init_cap_table = __esm({
|
|
|
4915
5481
|
options: [
|
|
4916
5482
|
{ flags: "--type <type>", description: "Valuation type (four_oh_nine_a, fair_market_value, etc.)", required: true },
|
|
4917
5483
|
{ flags: "--date <date>", description: "Effective date (ISO 8601)", required: true },
|
|
4918
|
-
{ flags: "--methodology <method>", description: "Methodology
|
|
5484
|
+
{ flags: "--methodology <method>", description: "Methodology", required: true, choices: ["income", "market", "asset", "backsolve", "hybrid", "other"] },
|
|
4919
5485
|
{ flags: "--fmv <cents>", description: "FMV per share in cents", type: "int" },
|
|
4920
|
-
{ flags: "--enterprise-value <cents>", description: "Enterprise value in cents", type: "int" }
|
|
5486
|
+
{ flags: "--enterprise-value <cents>", description: "Enterprise value in cents", type: "int" },
|
|
5487
|
+
{ flags: "--auto-approve", description: "Automatically submit and approve the valuation (skips board workflow)" }
|
|
4921
5488
|
],
|
|
4922
5489
|
handler: async (ctx) => {
|
|
4923
5490
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
@@ -4936,6 +5503,25 @@ var init_cap_table = __esm({
|
|
|
4936
5503
|
const result = await ctx.client.createValuation(body);
|
|
4937
5504
|
await ctx.resolver.stabilizeRecord("valuation", result, eid);
|
|
4938
5505
|
ctx.resolver.rememberFromRecord("valuation", result, eid);
|
|
5506
|
+
const valuationId = String(result.valuation_id ?? result.id);
|
|
5507
|
+
if (ctx.opts.autoApprove && valuationId) {
|
|
5508
|
+
try {
|
|
5509
|
+
await ctx.client.submitValuationForApproval(valuationId, eid);
|
|
5510
|
+
const approved = await ctx.client.approveValuation(valuationId, eid);
|
|
5511
|
+
await ctx.resolver.stabilizeRecord("valuation", approved, eid);
|
|
5512
|
+
if (ctx.opts.json) {
|
|
5513
|
+
ctx.writer.json(approved);
|
|
5514
|
+
return;
|
|
5515
|
+
}
|
|
5516
|
+
ctx.writer.success(`Valuation created and approved: ${valuationId}`);
|
|
5517
|
+
printReferenceSummary("valuation", approved, { showReuseHint: true });
|
|
5518
|
+
return;
|
|
5519
|
+
} catch (err) {
|
|
5520
|
+
if (!ctx.opts.json) {
|
|
5521
|
+
ctx.writer.warning(`Auto-approve failed (board approval may be required): ${err}`);
|
|
5522
|
+
}
|
|
5523
|
+
}
|
|
5524
|
+
}
|
|
4939
5525
|
if (ctx.opts.json) {
|
|
4940
5526
|
ctx.writer.json(result);
|
|
4941
5527
|
return;
|
|
@@ -4944,7 +5530,8 @@ var init_cap_table = __esm({
|
|
|
4944
5530
|
printReferenceSummary("valuation", result, { showReuseHint: true });
|
|
4945
5531
|
},
|
|
4946
5532
|
produces: { kind: "valuation" },
|
|
4947
|
-
successTemplate: "Valuation created"
|
|
5533
|
+
successTemplate: "Valuation created",
|
|
5534
|
+
examples: ["corp cap-table create-valuation --type 'type' --date 'date' --methodology 'method'", "corp cap-table create-valuation --json"]
|
|
4948
5535
|
},
|
|
4949
5536
|
// --- cap-table submit-valuation <valuation-ref> ---
|
|
4950
5537
|
{
|
|
@@ -5002,7 +5589,8 @@ var init_cap_table = __esm({
|
|
|
5002
5589
|
}
|
|
5003
5590
|
process.exit(1);
|
|
5004
5591
|
}
|
|
5005
|
-
}
|
|
5592
|
+
},
|
|
5593
|
+
examples: ["corp cap-table submit-valuation <valuation-ref>"]
|
|
5006
5594
|
},
|
|
5007
5595
|
// --- cap-table approve-valuation <valuation-ref> ---
|
|
5008
5596
|
{
|
|
@@ -5046,7 +5634,8 @@ var init_cap_table = __esm({
|
|
|
5046
5634
|
}
|
|
5047
5635
|
process.exit(1);
|
|
5048
5636
|
}
|
|
5049
|
-
}
|
|
5637
|
+
},
|
|
5638
|
+
examples: ["corp cap-table approve-valuation <valuation-ref>", "corp cap-table approve-valuation --json"]
|
|
5050
5639
|
},
|
|
5051
5640
|
// --- cap-table preview-conversion ---
|
|
5052
5641
|
{
|
|
@@ -5075,7 +5664,8 @@ var init_cap_table = __esm({
|
|
|
5075
5664
|
if (result.shares_issued) console.log(` Shares to issue: ${result.shares_issued}`);
|
|
5076
5665
|
if (result.ownership_pct) console.log(` Post-conversion ownership: ${result.ownership_pct}%`);
|
|
5077
5666
|
ctx.writer.json(result);
|
|
5078
|
-
}
|
|
5667
|
+
},
|
|
5668
|
+
examples: ["corp cap-table preview-conversion", "corp cap-table preview-conversion --json"]
|
|
5079
5669
|
},
|
|
5080
5670
|
// --- cap-table convert ---
|
|
5081
5671
|
{
|
|
@@ -5108,20 +5698,632 @@ var init_cap_table = __esm({
|
|
|
5108
5698
|
return;
|
|
5109
5699
|
}
|
|
5110
5700
|
ctx.writer.success(`Conversion executed for SAFE ${safeId}`);
|
|
5111
|
-
}
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5701
|
+
},
|
|
5702
|
+
examples: ["corp cap-table convert --safe-id 'ref' --price-per-share-cents 'n'"]
|
|
5703
|
+
},
|
|
5704
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
5705
|
+
{
|
|
5706
|
+
name: "equity control-links",
|
|
5707
|
+
description: "Create a control link between legal entities",
|
|
5708
|
+
route: { method: "POST", path: "/v1/equity/control-links" },
|
|
5709
|
+
entity: true,
|
|
5710
|
+
options: [
|
|
5711
|
+
{ flags: "--child-legal-entity-id <child-legal-entity-id>", description: "Child entity in the control relationship", required: true },
|
|
5712
|
+
{ flags: "--control-type <control-type>", description: "Type of control relationship.", required: true, choices: ["voting", "board", "economic", "contractual"] },
|
|
5713
|
+
{ flags: "--notes <notes>", description: "Additional notes" },
|
|
5714
|
+
{ flags: "--parent-legal-entity-id <parent-legal-entity-id>", description: "Parent entity in the control relationship", required: true },
|
|
5715
|
+
{ flags: "--voting-power-bps <voting-power-bps>", description: "Voting power in basis points (0-10000)" }
|
|
5716
|
+
],
|
|
5717
|
+
examples: ["corp equity control-links --child-legal-entity-id voting --control-type voting --parent-legal-entity-id 'parent-legal-entity-id'", "corp equity control-links --json"],
|
|
5718
|
+
successTemplate: "Control Links created"
|
|
5719
|
+
},
|
|
5720
|
+
{
|
|
5721
|
+
name: "equity control-map",
|
|
5722
|
+
description: "View the equity control map",
|
|
5723
|
+
route: { method: "GET", path: "/v1/equity/control-map" },
|
|
5724
|
+
entity: true,
|
|
5725
|
+
display: { title: "Equity Control Map", cols: ["edges>Edges", "#root_entity_id>ID", "traversed_entities>Traversed Entities"] },
|
|
5726
|
+
examples: ["corp equity control-map", "corp equity control-map --json"]
|
|
5727
|
+
},
|
|
5728
|
+
{
|
|
5729
|
+
name: "equity conversions-execute",
|
|
5730
|
+
description: "Execute a SAFE/note conversion into equity",
|
|
5731
|
+
route: { method: "POST", path: "/v1/equity/conversions/execute" },
|
|
5732
|
+
options: [
|
|
5733
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true },
|
|
5734
|
+
{ flags: "--round-id <round-id>", description: "Equity round ID", required: true },
|
|
5735
|
+
{ flags: "--source-reference <source-reference>", description: "Source reference for the conversion" }
|
|
5736
|
+
],
|
|
5737
|
+
examples: ["corp equity conversions-execute --intent-id 'intent-id' --round-id 'round-id'", "corp equity conversions-execute --json"],
|
|
5738
|
+
successTemplate: "Conversions Execute created"
|
|
5739
|
+
},
|
|
5740
|
+
{
|
|
5741
|
+
name: "equity conversions-preview",
|
|
5742
|
+
description: "Preview a SAFE/note conversion without executing",
|
|
5743
|
+
route: { method: "POST", path: "/v1/equity/conversions/preview" },
|
|
5744
|
+
entity: true,
|
|
5745
|
+
options: [
|
|
5746
|
+
{ flags: "--round-id <round-id>", description: "Equity round ID", required: true },
|
|
5747
|
+
{ flags: "--source-reference <source-reference>", description: "Source reference for the conversion" }
|
|
5748
|
+
],
|
|
5749
|
+
examples: ["corp equity conversions-preview --round-id 'round-id'", "corp equity conversions-preview --json"],
|
|
5750
|
+
successTemplate: "Conversions Preview created"
|
|
5751
|
+
},
|
|
5752
|
+
{
|
|
5753
|
+
name: "equity dilution-preview",
|
|
5754
|
+
description: "Preview dilution impact of a potential issuance",
|
|
5755
|
+
route: { method: "GET", path: "/v1/equity/dilution/preview" },
|
|
5756
|
+
entity: true,
|
|
5757
|
+
display: { title: "Equity Dilution Preview", cols: ["#issuer_legal_entity_id>ID", "pre_round_outstanding_units>Pre Round Outstanding Units", "projected_dilution_bps>Projected Dilution Bps", "projected_new_units>Projected New Units", "projected_post_outstanding_units>Projected Post Outstanding Units", "#round_id>ID"] },
|
|
5758
|
+
examples: ["corp equity dilution-preview", "corp equity dilution-preview --json"]
|
|
5759
|
+
},
|
|
5760
|
+
{
|
|
5761
|
+
name: "equity entities",
|
|
5762
|
+
description: "Register a legal entity in the equity system",
|
|
5763
|
+
route: { method: "POST", path: "/v1/equity/entities" },
|
|
5764
|
+
entity: true,
|
|
5765
|
+
options: [
|
|
5766
|
+
{ flags: "--linked-entity-id <linked-entity-id>", description: "ID of the entity to link" },
|
|
5767
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
5768
|
+
{ flags: "--role <role>", description: "Role this legal entity plays in the ownership/control graph.", required: true, choices: ["operating", "control", "investment", "nonprofit", "spv", "other"] }
|
|
5769
|
+
],
|
|
5770
|
+
examples: ["corp equity entities --name 'name' --role operating", "corp equity entities --json"],
|
|
5771
|
+
successTemplate: "Entities created"
|
|
5772
|
+
},
|
|
5773
|
+
{
|
|
5774
|
+
name: "equity create-fundraising-workflow",
|
|
5775
|
+
description: "Start or view a fundraising workflow",
|
|
5776
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows" },
|
|
5777
|
+
options: [
|
|
5778
|
+
{ flags: "--conversion-target-instrument-id <conversion-target-instrument-id>", description: "Target instrument for conversion" },
|
|
5779
|
+
{ flags: "--issuer-legal-entity-id <issuer-legal-entity-id>", description: "Legal entity issuing the securities", required: true },
|
|
5780
|
+
{ flags: "--metadata <metadata>", description: "Additional metadata (JSON)" },
|
|
5781
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
5782
|
+
{ flags: "--pre-money-cents <pre-money-cents>", description: "Pre-money valuation in cents" },
|
|
5783
|
+
{ flags: "--prepare-intent-id <prepare-intent-id>", description: "Execution intent ID for preparation", required: true },
|
|
5784
|
+
{ flags: "--round-price-cents <round-price-cents>", description: "Round share price in cents" },
|
|
5785
|
+
{ flags: "--target-raise-cents <target-raise-cents>", description: "Target fundraising amount in cents" }
|
|
5786
|
+
],
|
|
5787
|
+
examples: ["corp equity fundraising-workflows --issuer-legal-entity-id 'issuer-legal-entity-id' --name 'name' --prepare-intent-id 'prepare-intent-id'", "corp equity fundraising-workflows --json"],
|
|
5788
|
+
successTemplate: "Fundraising Workflows created"
|
|
5789
|
+
},
|
|
5790
|
+
{
|
|
5791
|
+
name: "equity fundraising-workflows",
|
|
5792
|
+
description: "Start or view a fundraising workflow",
|
|
5793
|
+
route: { method: "GET", path: "/v1/equity/fundraising-workflows/{pos}" },
|
|
5794
|
+
entity: true,
|
|
5795
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5796
|
+
display: { title: "Equity Fundraising Workflows", cols: ["board_packet_documents>Board Packet Documents", "closing_packet_documents>Closing Packet Documents", "@created_at>Created At", "#accept_intent_id>ID"] },
|
|
5797
|
+
examples: ["corp equity fundraising-workflows", "corp equity fundraising-workflows --json"]
|
|
5798
|
+
},
|
|
5799
|
+
{
|
|
5800
|
+
name: "equity fundraising-workflows-apply-terms",
|
|
5801
|
+
description: "Apply term sheet to a fundraising round",
|
|
5802
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/apply-terms" },
|
|
5803
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5804
|
+
options: [
|
|
5805
|
+
{ flags: "--anti-dilution-method <anti-dilution-method>", description: "Anti-dilution protection method", required: true, choices: ["none", "broad_based_weighted_average", "narrow_based_weighted_average", "full_ratchet"] },
|
|
5806
|
+
{ flags: "--conversion-precedence <conversion-precedence>", description: "Conversion priority ordering", type: "array" },
|
|
5807
|
+
{ flags: "--protective-provisions <protective-provisions>", description: "Protective provision terms" }
|
|
5808
|
+
],
|
|
5809
|
+
examples: ["corp equity fundraising-workflows-apply-terms <workflow-id> --anti-dilution-method none", "corp equity fundraising-workflows-apply-terms --json"],
|
|
5810
|
+
successTemplate: "Fundraising Workflows Apply Terms created"
|
|
5811
|
+
},
|
|
5812
|
+
{
|
|
5813
|
+
name: "equity fundraising-workflows-compile-packet",
|
|
5814
|
+
description: "Compile the document packet for a fundraising round",
|
|
5815
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/compile-packet" },
|
|
5816
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5817
|
+
options: [
|
|
5818
|
+
{ flags: "--phase <phase>", description: "Workflow phase" },
|
|
5819
|
+
{ flags: "--required-signers <required-signers>", description: "List of required signers", type: "array" }
|
|
5820
|
+
],
|
|
5821
|
+
examples: ["corp equity fundraising-workflows-compile-packet <workflow-id>", "corp equity fundraising-workflows-compile-packet --json"],
|
|
5822
|
+
successTemplate: "Fundraising Workflows Compile Packet created"
|
|
5823
|
+
},
|
|
5824
|
+
{
|
|
5825
|
+
name: "equity fundraising-workflows-finalize",
|
|
5826
|
+
description: "Finalize and close a fundraising workflow",
|
|
5827
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/finalize" },
|
|
5828
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5829
|
+
options: [
|
|
5830
|
+
{ flags: "--phase <phase>", description: "Workflow phase" }
|
|
5831
|
+
],
|
|
5832
|
+
examples: ["corp equity fundraising-workflows-finalize <workflow-id>", "corp equity fundraising-workflows-finalize --json"],
|
|
5833
|
+
successTemplate: "Fundraising Workflows Finalize created"
|
|
5834
|
+
},
|
|
5835
|
+
{
|
|
5836
|
+
name: "equity fundraising-workflows-generate-board-packet",
|
|
5837
|
+
description: "Generate board approval packet for fundraising",
|
|
5838
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/generate-board-packet" },
|
|
5839
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5840
|
+
options: [
|
|
5841
|
+
{ flags: "--documents <documents>", description: "Document references or content", type: "array" }
|
|
5842
|
+
],
|
|
5843
|
+
examples: ["corp equity fundraising-workflows-generate-board-packet <workflow-id>", "corp equity fundraising-workflows-generate-board-packet --json"],
|
|
5844
|
+
successTemplate: "Fundraising Workflows Generate Board Packet created"
|
|
5845
|
+
},
|
|
5846
|
+
{
|
|
5847
|
+
name: "equity fundraising-workflows-generate-closing-packet",
|
|
5848
|
+
description: "Generate closing documents for fundraising",
|
|
5849
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/generate-closing-packet" },
|
|
5850
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5851
|
+
options: [
|
|
5852
|
+
{ flags: "--documents <documents>", description: "Document references or content", type: "array" }
|
|
5853
|
+
],
|
|
5854
|
+
examples: ["corp equity fundraising-workflows-generate-closing-packet <workflow-id>", "corp equity fundraising-workflows-generate-closing-packet --json"],
|
|
5855
|
+
successTemplate: "Fundraising Workflows Generate Closing Packet created"
|
|
5856
|
+
},
|
|
5857
|
+
{
|
|
5858
|
+
name: "equity fundraising-workflows-prepare-execution",
|
|
5859
|
+
description: "Prepare fundraising for execution",
|
|
5860
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/prepare-execution" },
|
|
5861
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5862
|
+
options: [
|
|
5863
|
+
{ flags: "--approval-artifact-id <approval-artifact-id>", description: "Approval artifact ID to bind", required: true },
|
|
5864
|
+
{ flags: "--document-request-ids <document-request-ids>", description: "Comma-separated document request IDs", type: "array" },
|
|
5865
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true },
|
|
5866
|
+
{ flags: "--phase <phase>", description: "Workflow phase" }
|
|
5867
|
+
],
|
|
5868
|
+
examples: ["corp equity fundraising-workflows-prepare-execution <workflow-id> --approval-artifact-id 'approval-artifact-id' --intent-id 'intent-id'", "corp equity fundraising-workflows-prepare-execution --json"],
|
|
5869
|
+
successTemplate: "Fundraising Workflows Prepare Execution created"
|
|
5870
|
+
},
|
|
5871
|
+
{
|
|
5872
|
+
name: "equity fundraising-workflows-record-board-approval",
|
|
5873
|
+
description: "Record board approval for fundraising",
|
|
5874
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/record-board-approval" },
|
|
5875
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5876
|
+
options: [
|
|
5877
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID", required: true },
|
|
5878
|
+
{ flags: "--resolution-id <resolution-id>", description: "Resolution ID", required: true }
|
|
5879
|
+
],
|
|
5880
|
+
examples: ["corp equity fundraising-workflows-record-board-approval <workflow-id> --meeting-id 'meeting-id' --resolution-id 'resolution-id'"],
|
|
5881
|
+
successTemplate: "Fundraising Workflows Record Board Approval created"
|
|
5882
|
+
},
|
|
5883
|
+
{
|
|
5884
|
+
name: "equity fundraising-workflows-record-close",
|
|
5885
|
+
description: "Record closing of a fundraising round",
|
|
5886
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/record-close" },
|
|
5887
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5888
|
+
options: [
|
|
5889
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true }
|
|
5890
|
+
],
|
|
5891
|
+
examples: ["corp equity fundraising-workflows-record-close <workflow-id> --intent-id 'intent-id'"],
|
|
5892
|
+
successTemplate: "Fundraising Workflows Record Close created"
|
|
5893
|
+
},
|
|
5894
|
+
{
|
|
5895
|
+
name: "equity fundraising-workflows-record-investor-acceptance",
|
|
5896
|
+
description: "Record investor acceptance of terms",
|
|
5897
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/record-investor-acceptance" },
|
|
5898
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5899
|
+
options: [
|
|
5900
|
+
{ flags: "--accepted-by-contact-id <accepted-by-contact-id>", description: "Contact ID of the accepting party" },
|
|
5901
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true }
|
|
5902
|
+
],
|
|
5903
|
+
examples: ["corp equity fundraising-workflows-record-investor-acceptance <workflow-id> --intent-id 'intent-id'", "corp equity fundraising-workflows-record-investor-acceptance --json"],
|
|
5904
|
+
successTemplate: "Fundraising Workflows Record Investor Acceptance created"
|
|
5905
|
+
},
|
|
5906
|
+
{
|
|
5907
|
+
name: "equity fundraising-workflows-record-signature",
|
|
5908
|
+
description: "Record a signature on fundraising documents",
|
|
5909
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/record-signature" },
|
|
5910
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5911
|
+
options: [
|
|
5912
|
+
{ flags: "--channel <channel>", description: "Approval channel (board_vote, written_consent, etc.)" },
|
|
5913
|
+
{ flags: "--signer-identity <signer-identity>", description: "Identity of the signer", required: true }
|
|
5914
|
+
],
|
|
5915
|
+
examples: ["corp equity fundraising-workflows-record-signature <workflow-id> --signer-identity 'signer-identity'", "corp equity fundraising-workflows-record-signature --json"],
|
|
5916
|
+
successTemplate: "Fundraising Workflows Record Signature created"
|
|
5917
|
+
},
|
|
5918
|
+
{
|
|
5919
|
+
name: "equity fundraising-workflows-start-signatures",
|
|
5920
|
+
description: "Start the signature collection process",
|
|
5921
|
+
route: { method: "POST", path: "/v1/equity/fundraising-workflows/{pos}/start-signatures" },
|
|
5922
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
5923
|
+
examples: ["corp equity fundraising-workflows-start-signatures <workflow-id>"],
|
|
5924
|
+
successTemplate: "Fundraising Workflows Start Signatures created"
|
|
5925
|
+
},
|
|
5926
|
+
{
|
|
5927
|
+
name: "equity grants",
|
|
5928
|
+
description: "Issue an equity grant (options, RSUs, etc.)",
|
|
5929
|
+
route: { method: "POST", path: "/v1/equity/grants" },
|
|
5930
|
+
entity: true,
|
|
5931
|
+
options: [
|
|
5932
|
+
{ flags: "--grant-type <grant-type>", description: "The type of equity grant.", required: true, choices: ["common", "common_stock", "preferred", "preferred_stock", "membership_unit", "stock_option", "iso", "nso", "rsa", "svu"] },
|
|
5933
|
+
{ flags: "--recipient-name <recipient-name>", description: "Payment recipient name", required: true },
|
|
5934
|
+
{ flags: "--shares <shares>", description: "Shares", required: true, type: "int" }
|
|
5935
|
+
],
|
|
5936
|
+
examples: ["corp equity grants --grant-type common_stock --recipient-name 'recipient-name' --shares 'shares'"],
|
|
5937
|
+
successTemplate: "Grants created"
|
|
5938
|
+
},
|
|
5939
|
+
{
|
|
5940
|
+
name: "equity holders",
|
|
5941
|
+
description: "Register a new equity holder",
|
|
5942
|
+
route: { method: "POST", path: "/v1/equity/holders" },
|
|
5943
|
+
entity: true,
|
|
5944
|
+
options: [
|
|
5945
|
+
{ flags: "--contact-id <contact-id>", description: "Contact ID", required: true },
|
|
5946
|
+
{ flags: "--external-reference <external-reference>", description: "External Reference" },
|
|
5947
|
+
{ flags: "--holder-type <holder-type>", description: "Type of holder represented in the cap table.", required: true, choices: ["individual", "organization", "fund", "nonprofit", "trust", "other"] },
|
|
5948
|
+
{ flags: "--linked-entity-id <linked-entity-id>", description: "ID of the entity to link" },
|
|
5949
|
+
{ flags: "--name <name>", description: "Display name", required: true }
|
|
5950
|
+
],
|
|
5951
|
+
examples: ["corp equity holders --contact-id 'contact-id' --holder-type individual --name 'name'", "corp equity holders --json"],
|
|
5952
|
+
successTemplate: "Holders created"
|
|
5953
|
+
},
|
|
5954
|
+
{
|
|
5955
|
+
name: "equity instruments",
|
|
5956
|
+
description: "Create a new equity instrument",
|
|
5957
|
+
route: { method: "POST", path: "/v1/equity/instruments" },
|
|
5958
|
+
entity: true,
|
|
5959
|
+
options: [
|
|
5960
|
+
{ flags: "--authorized-units <authorized-units>", description: "Authorized Units" },
|
|
5961
|
+
{ flags: "--issue-price-cents <issue-price-cents>", description: "Issue Price Cents" },
|
|
5962
|
+
{ flags: "--issuer-legal-entity-id <issuer-legal-entity-id>", description: "Legal entity issuing the securities", required: true },
|
|
5963
|
+
{ flags: "--kind <kind>", description: "Instrument kind in the ownership model.", required: true, choices: ["common_equity", "preferred_equity", "membership_unit", "option_grant", "safe", "convertible_note", "warrant"] },
|
|
5964
|
+
{ flags: "--symbol <symbol>", description: "Symbol", required: true },
|
|
5965
|
+
{ flags: "--terms <terms>", description: "Terms" }
|
|
5966
|
+
],
|
|
5967
|
+
examples: ["corp equity instruments --issuer-legal-entity-id 'issuer-legal-entity-id' --kind common_equity --symbol 'symbol'", "corp equity instruments --json"],
|
|
5968
|
+
successTemplate: "Instruments created"
|
|
5969
|
+
},
|
|
5970
|
+
{
|
|
5971
|
+
name: "equity positions-adjust",
|
|
5972
|
+
description: "Adjust an equity position (split, correction)",
|
|
5973
|
+
route: { method: "POST", path: "/v1/equity/positions/adjust" },
|
|
5974
|
+
entity: true,
|
|
5975
|
+
options: [
|
|
5976
|
+
{ flags: "--holder-id <holder-id>", description: "Equity holder ID", required: true },
|
|
5977
|
+
{ flags: "--instrument-id <instrument-id>", description: "Instrument Id", required: true },
|
|
5978
|
+
{ flags: "--issuer-legal-entity-id <issuer-legal-entity-id>", description: "Legal entity issuing the securities", required: true },
|
|
5979
|
+
{ flags: "--principal-delta-cents <principal-delta-cents>", description: "Principal Delta Cents", type: "int" },
|
|
5980
|
+
{ flags: "--quantity-delta <quantity-delta>", description: "Quantity Delta", required: true, type: "int" },
|
|
5981
|
+
{ flags: "--source-reference <source-reference>", description: "Source reference for the conversion" }
|
|
5982
|
+
],
|
|
5983
|
+
examples: ["corp equity positions-adjust --holder-id 'holder-id' --instrument-id 'instrument-id' --issuer-legal-entity-id 'issuer-legal-entity-id' --quantity-delta 'quantity-delta'", "corp equity positions-adjust --json"],
|
|
5984
|
+
successTemplate: "Positions Adjust created"
|
|
5985
|
+
},
|
|
5986
|
+
{
|
|
5987
|
+
name: "equity rounds",
|
|
5988
|
+
description: "Create a new equity round (prefer cap-table start-round which auto-resolves issuer)",
|
|
5989
|
+
route: { method: "POST", path: "/v1/equity/rounds" },
|
|
5990
|
+
entity: true,
|
|
5991
|
+
options: [
|
|
5992
|
+
{ flags: "--conversion-target-instrument-id <conversion-target-instrument-id>", description: "Target instrument for conversion" },
|
|
5993
|
+
{ flags: "--issuer-legal-entity-id <issuer-legal-entity-id>", description: "Issuer legal entity (run 'corp cap-table --json' to find this)", required: true },
|
|
5994
|
+
{ flags: "--metadata <metadata>", description: "Additional metadata (JSON)" },
|
|
5995
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
5996
|
+
{ flags: "--pre-money-cents <pre-money-cents>", description: "Pre-money valuation in cents" },
|
|
5997
|
+
{ flags: "--round-price-cents <round-price-cents>", description: "Round share price in cents" },
|
|
5998
|
+
{ flags: "--target-raise-cents <target-raise-cents>", description: "Target fundraising amount in cents" }
|
|
5999
|
+
],
|
|
6000
|
+
examples: ["corp equity rounds --issuer-legal-entity-id 'issuer-legal-entity-id' --name 'name'", "corp equity rounds --json"],
|
|
6001
|
+
successTemplate: "Rounds created"
|
|
6002
|
+
},
|
|
6003
|
+
{
|
|
6004
|
+
name: "equity rounds-staged",
|
|
6005
|
+
description: "Create a staged (draft) equity round (prefer cap-table start-round which auto-resolves issuer)",
|
|
6006
|
+
route: { method: "POST", path: "/v1/equity/rounds/staged" },
|
|
6007
|
+
entity: true,
|
|
6008
|
+
options: [
|
|
6009
|
+
{ flags: "--issuer-legal-entity-id <issuer-legal-entity-id>", description: "Issuer legal entity (run 'corp cap-table --json' to find this)", required: true },
|
|
6010
|
+
{ flags: "--metadata <metadata>", description: "Additional metadata (JSON)" },
|
|
6011
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
6012
|
+
{ flags: "--pre-money-cents <pre-money-cents>", description: "Pre-money valuation in cents" },
|
|
6013
|
+
{ flags: "--round-price-cents <round-price-cents>", description: "Round share price in cents" },
|
|
6014
|
+
{ flags: "--target-raise-cents <target-raise-cents>", description: "Target fundraising amount in cents" }
|
|
6015
|
+
],
|
|
6016
|
+
examples: ["corp equity rounds-staged --issuer-legal-entity-id 'issuer-legal-entity-id' --name 'name'", "corp equity rounds-staged --json"],
|
|
6017
|
+
successTemplate: "Rounds Staged created"
|
|
6018
|
+
},
|
|
6019
|
+
{
|
|
6020
|
+
name: "equity rounds-accept",
|
|
6021
|
+
description: "Accept terms for an equity round",
|
|
6022
|
+
route: { method: "POST", path: "/v1/equity/rounds/{pos}/accept" },
|
|
6023
|
+
entity: true,
|
|
6024
|
+
args: [{ name: "round-id", required: true, description: "Equity round ID" }],
|
|
6025
|
+
options: [
|
|
6026
|
+
{ flags: "--accepted-by-contact-id <accepted-by-contact-id>", description: "Contact ID of the accepting party" },
|
|
6027
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true }
|
|
6028
|
+
],
|
|
6029
|
+
examples: ["corp equity rounds-accept <round-id> --intent-id 'intent-id'", "corp equity rounds-accept --json"],
|
|
6030
|
+
successTemplate: "Rounds Accept created"
|
|
6031
|
+
},
|
|
6032
|
+
{
|
|
6033
|
+
name: "equity rounds-apply-terms",
|
|
6034
|
+
description: "Apply term sheet to an equity round",
|
|
6035
|
+
route: { method: "POST", path: "/v1/equity/rounds/{pos}/apply-terms" },
|
|
6036
|
+
entity: true,
|
|
6037
|
+
args: [{ name: "round-id", required: true, description: "Equity round ID" }],
|
|
6038
|
+
options: [
|
|
6039
|
+
{ flags: "--anti-dilution-method <anti-dilution-method>", description: "Anti-dilution protection method", required: true, choices: ["none", "broad_based_weighted_average", "narrow_based_weighted_average", "full_ratchet"] },
|
|
6040
|
+
{ flags: "--conversion-precedence <conversion-precedence>", description: "Conversion priority ordering", type: "array" },
|
|
6041
|
+
{ flags: "--protective-provisions <protective-provisions>", description: "Protective provision terms" }
|
|
6042
|
+
],
|
|
6043
|
+
examples: ["corp equity rounds-apply-terms <round-id> --anti-dilution-method none", "corp equity rounds-apply-terms --json"],
|
|
6044
|
+
successTemplate: "Rounds Apply Terms created"
|
|
6045
|
+
},
|
|
6046
|
+
{
|
|
6047
|
+
name: "equity rounds-board-approve",
|
|
6048
|
+
description: "Record board approval for an equity round",
|
|
6049
|
+
route: { method: "POST", path: "/v1/equity/rounds/{pos}/board-approve" },
|
|
6050
|
+
entity: true,
|
|
6051
|
+
args: [{ name: "round-id", required: true, description: "Equity round ID" }],
|
|
6052
|
+
options: [
|
|
6053
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID", required: true },
|
|
6054
|
+
{ flags: "--resolution-id <resolution-id>", description: "Resolution ID", required: true }
|
|
6055
|
+
],
|
|
6056
|
+
examples: ["corp equity rounds-board-approve <round-id> --meeting-id 'meeting-id' --resolution-id 'resolution-id'"],
|
|
6057
|
+
successTemplate: "Rounds Board Approve created"
|
|
6058
|
+
},
|
|
6059
|
+
{
|
|
6060
|
+
name: "equity rounds-issue",
|
|
6061
|
+
description: "Issue shares for an equity round",
|
|
6062
|
+
route: { method: "POST", path: "/v1/equity/rounds/{pos}/issue" },
|
|
6063
|
+
entity: true,
|
|
6064
|
+
args: [{ name: "round-id", required: true, description: "Equity round ID" }],
|
|
6065
|
+
options: [
|
|
6066
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID" },
|
|
6067
|
+
{ flags: "--resolution-id <resolution-id>", description: "Resolution ID" }
|
|
6068
|
+
],
|
|
6069
|
+
examples: ["corp equity rounds-issue <round-id>", "corp equity rounds-issue --json"],
|
|
6070
|
+
successTemplate: "Rounds Issue created"
|
|
6071
|
+
},
|
|
6072
|
+
{
|
|
6073
|
+
name: "equity rounds-securities",
|
|
6074
|
+
description: "Add securities to an equity round",
|
|
6075
|
+
route: { method: "POST", path: "/v1/equity/rounds/{pos}/securities" },
|
|
6076
|
+
entity: true,
|
|
6077
|
+
args: [{ name: "round-id", required: true, description: "Equity round ID" }],
|
|
6078
|
+
options: [
|
|
6079
|
+
{ flags: "--email <email>", description: "Email" },
|
|
6080
|
+
{ flags: "--grant-type <grant-type>", description: "Grant Type" },
|
|
6081
|
+
{ flags: "--holder-id <holder-id>", description: "Equity holder ID" },
|
|
6082
|
+
{ flags: "--instrument-id <instrument-id>", description: "Instrument Id", required: true },
|
|
6083
|
+
{ flags: "--principal-cents <principal-cents>", description: "Principal Cents", type: "int" },
|
|
6084
|
+
{ flags: "--quantity <quantity>", description: "Quantity", required: true, type: "int" },
|
|
6085
|
+
{ flags: "--recipient-name <recipient-name>", description: "Payment recipient name", required: true }
|
|
6086
|
+
],
|
|
6087
|
+
examples: ["corp equity rounds-securities <round-id> --instrument-id 'instrument-id' --quantity 'quantity' --recipient-name 'recipient-name'", "corp equity rounds-securities --json"],
|
|
6088
|
+
successTemplate: "Rounds Securities created"
|
|
6089
|
+
},
|
|
6090
|
+
{
|
|
6091
|
+
name: "equity create-transfer-workflow",
|
|
6092
|
+
description: "Start or view a share transfer workflow",
|
|
6093
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows" },
|
|
6094
|
+
options: [
|
|
6095
|
+
{ flags: "--from-contact-id <from-contact-id>", description: "From Contact Id", required: true },
|
|
6096
|
+
{ flags: "--governing-doc-type <governing-doc-type>", description: "The type of governing document for a share transfer.", required: true, choices: ["bylaws", "operating_agreement", "shareholder_agreement", "other"] },
|
|
6097
|
+
{ flags: "--prepare-intent-id <prepare-intent-id>", description: "Execution intent ID for preparation", required: true },
|
|
6098
|
+
{ flags: "--price-per-share-cents <price-per-share-cents>", description: "Price Per Share Cents" },
|
|
6099
|
+
{ flags: "--relationship-to-holder <relationship-to-holder>", description: "Relationship To Holder" },
|
|
6100
|
+
{ flags: "--share-class-id <share-class-id>", description: "Share class ID", required: true },
|
|
6101
|
+
{ flags: "--share-count <share-count>", description: "Number of shares", required: true, type: "int" },
|
|
6102
|
+
{ flags: "--to-contact-id <to-contact-id>", description: "To Contact Id", required: true },
|
|
6103
|
+
{ flags: "--transfer-type <transfer-type>", description: "Type of share transfer.", required: true, choices: ["gift", "trust_transfer", "secondary_sale", "estate", "other"] },
|
|
6104
|
+
{ flags: "--transferee-rights <transferee-rights>", description: "Rights granted to the transferee.", required: true, choices: ["full_member", "economic_only", "limited"] }
|
|
6105
|
+
],
|
|
6106
|
+
examples: ["corp equity transfer-workflows --from-contact-id 'from-contact-id' --governing-doc-type bylaws --prepare-intent-id 'prepare-intent-id' --share-class-id 'share-class-id' --share-count 'share-count' --to-contact-id gift --transfer-type gift --transferee-rights full_member", "corp equity transfer-workflows --json"],
|
|
6107
|
+
successTemplate: "Transfer Workflows created"
|
|
6108
|
+
},
|
|
6109
|
+
{
|
|
6110
|
+
name: "equity transfer-workflows",
|
|
6111
|
+
description: "Start or view a share transfer workflow",
|
|
6112
|
+
route: { method: "GET", path: "/v1/equity/transfer-workflows/{pos}" },
|
|
6113
|
+
entity: true,
|
|
6114
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6115
|
+
display: { title: "Equity Transfer Workflows", cols: ["execution_status>Execution Status", "generated_documents>Generated Documents", "last_packet_hash>Last Packet Hash", "@created_at>Created At", "#active_packet_id>ID"] },
|
|
6116
|
+
examples: ["corp equity transfer-workflows", "corp equity transfer-workflows --json"]
|
|
6117
|
+
},
|
|
6118
|
+
{
|
|
6119
|
+
name: "equity transfer-workflows-compile-packet",
|
|
6120
|
+
description: "Compile documents for a share transfer",
|
|
6121
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/compile-packet" },
|
|
6122
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6123
|
+
options: [
|
|
6124
|
+
{ flags: "--phase <phase>", description: "Workflow phase" },
|
|
6125
|
+
{ flags: "--required-signers <required-signers>", description: "List of required signers", type: "array" }
|
|
6126
|
+
],
|
|
6127
|
+
examples: ["corp equity transfer-workflows-compile-packet <workflow-id>", "corp equity transfer-workflows-compile-packet --json"],
|
|
6128
|
+
successTemplate: "Transfer Workflows Compile Packet created"
|
|
6129
|
+
},
|
|
6130
|
+
{
|
|
6131
|
+
name: "equity transfer-workflows-finalize",
|
|
6132
|
+
description: "Finalize a share transfer workflow",
|
|
6133
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/finalize" },
|
|
6134
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6135
|
+
options: [
|
|
6136
|
+
{ flags: "--phase <phase>", description: "Workflow phase" }
|
|
6137
|
+
],
|
|
6138
|
+
examples: ["corp equity transfer-workflows-finalize <workflow-id>", "corp equity transfer-workflows-finalize --json"],
|
|
6139
|
+
successTemplate: "Transfer Workflows Finalize created"
|
|
6140
|
+
},
|
|
6141
|
+
{
|
|
6142
|
+
name: "equity transfer-workflows-generate-docs",
|
|
6143
|
+
description: "Generate documents for a share transfer",
|
|
6144
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/generate-docs" },
|
|
6145
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6146
|
+
options: [
|
|
6147
|
+
{ flags: "--documents <documents>", description: "Document references or content", type: "array" }
|
|
6148
|
+
],
|
|
6149
|
+
examples: ["corp equity transfer-workflows-generate-docs <workflow-id>", "corp equity transfer-workflows-generate-docs --json"],
|
|
6150
|
+
successTemplate: "Transfer Workflows Generate Docs created"
|
|
6151
|
+
},
|
|
6152
|
+
{
|
|
6153
|
+
name: "equity transfer-workflows-prepare-execution",
|
|
6154
|
+
description: "Prepare transfer for execution",
|
|
6155
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/prepare-execution" },
|
|
6156
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6157
|
+
options: [
|
|
6158
|
+
{ flags: "--approval-artifact-id <approval-artifact-id>", description: "Approval artifact ID to bind", required: true },
|
|
6159
|
+
{ flags: "--document-request-ids <document-request-ids>", description: "Comma-separated document request IDs", type: "array" },
|
|
6160
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true },
|
|
6161
|
+
{ flags: "--phase <phase>", description: "Workflow phase" }
|
|
6162
|
+
],
|
|
6163
|
+
examples: ["corp equity transfer-workflows-prepare-execution <workflow-id> --approval-artifact-id 'approval-artifact-id' --intent-id 'intent-id'", "corp equity transfer-workflows-prepare-execution --json"],
|
|
6164
|
+
successTemplate: "Transfer Workflows Prepare Execution created"
|
|
6165
|
+
},
|
|
6166
|
+
{
|
|
6167
|
+
name: "equity transfer-workflows-record-board-approval",
|
|
6168
|
+
description: "Record board approval for a transfer",
|
|
6169
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/record-board-approval" },
|
|
6170
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6171
|
+
options: [
|
|
6172
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID", required: true },
|
|
6173
|
+
{ flags: "--resolution-id <resolution-id>", description: "Resolution ID", required: true }
|
|
6174
|
+
],
|
|
6175
|
+
examples: ["corp equity transfer-workflows-record-board-approval <workflow-id> --meeting-id 'meeting-id' --resolution-id 'resolution-id'"],
|
|
6176
|
+
successTemplate: "Transfer Workflows Record Board Approval created"
|
|
6177
|
+
},
|
|
6178
|
+
{
|
|
6179
|
+
name: "equity transfer-workflows-record-execution",
|
|
6180
|
+
description: "Record execution of a share transfer",
|
|
6181
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/record-execution" },
|
|
6182
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6183
|
+
options: [
|
|
6184
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID", required: true }
|
|
6185
|
+
],
|
|
6186
|
+
examples: ["corp equity transfer-workflows-record-execution <workflow-id> --intent-id 'intent-id'"],
|
|
6187
|
+
successTemplate: "Transfer Workflows Record Execution created"
|
|
6188
|
+
},
|
|
6189
|
+
{
|
|
6190
|
+
name: "equity transfer-workflows-record-review",
|
|
6191
|
+
description: "Record review of a share transfer",
|
|
6192
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/record-review" },
|
|
6193
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6194
|
+
options: [
|
|
6195
|
+
{ flags: "--approved", description: "Approved", required: true },
|
|
6196
|
+
{ flags: "--notes <notes>", description: "Additional notes", required: true },
|
|
6197
|
+
{ flags: "--reviewer <reviewer>", description: "Reviewer", required: true }
|
|
6198
|
+
],
|
|
6199
|
+
examples: ["corp equity transfer-workflows-record-review <workflow-id> --approved --notes 'notes' --reviewer 'reviewer'"],
|
|
6200
|
+
successTemplate: "Transfer Workflows Record Review created"
|
|
6201
|
+
},
|
|
6202
|
+
{
|
|
6203
|
+
name: "equity transfer-workflows-record-rofr",
|
|
6204
|
+
description: "Record right of first refusal waiver",
|
|
6205
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/record-rofr" },
|
|
6206
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6207
|
+
options: [
|
|
6208
|
+
{ flags: "--offered", description: "Offered", required: true },
|
|
6209
|
+
{ flags: "--waived", description: "Waived", required: true }
|
|
6210
|
+
],
|
|
6211
|
+
examples: ["corp equity transfer-workflows-record-rofr <workflow-id> --offered --waived"],
|
|
6212
|
+
successTemplate: "Transfer Workflows Record Rofr created"
|
|
6213
|
+
},
|
|
6214
|
+
{
|
|
6215
|
+
name: "equity transfer-workflows-record-signature",
|
|
6216
|
+
description: "Record a signature on transfer documents",
|
|
6217
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/record-signature" },
|
|
6218
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6219
|
+
options: [
|
|
6220
|
+
{ flags: "--channel <channel>", description: "Approval channel (board_vote, written_consent, etc.)" },
|
|
6221
|
+
{ flags: "--signer-identity <signer-identity>", description: "Identity of the signer", required: true }
|
|
6222
|
+
],
|
|
6223
|
+
examples: ["corp equity transfer-workflows-record-signature <workflow-id> --signer-identity 'signer-identity'", "corp equity transfer-workflows-record-signature --json"],
|
|
6224
|
+
successTemplate: "Transfer Workflows Record Signature created"
|
|
6225
|
+
},
|
|
6226
|
+
{
|
|
6227
|
+
name: "equity transfer-workflows-start-signatures",
|
|
6228
|
+
description: "Start signature collection for transfer",
|
|
6229
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/start-signatures" },
|
|
6230
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6231
|
+
examples: ["corp equity transfer-workflows-start-signatures <workflow-id>"],
|
|
6232
|
+
successTemplate: "Transfer Workflows Start Signatures created"
|
|
6233
|
+
},
|
|
6234
|
+
{
|
|
6235
|
+
name: "equity transfer-workflows-submit-review",
|
|
6236
|
+
description: "Submit a share transfer for review",
|
|
6237
|
+
route: { method: "POST", path: "/v1/equity/transfer-workflows/{pos}/submit-review" },
|
|
6238
|
+
args: [{ name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6239
|
+
examples: ["corp equity transfer-workflows-submit-review <workflow-id>"],
|
|
6240
|
+
successTemplate: "Transfer Workflows Submit Review created"
|
|
6241
|
+
},
|
|
6242
|
+
{
|
|
6243
|
+
name: "equity workflows-status",
|
|
6244
|
+
description: "Check status of an equity workflow",
|
|
6245
|
+
route: { method: "GET", path: "/v1/equity/workflows/{pos}/{pos2}/status" },
|
|
6246
|
+
entity: true,
|
|
6247
|
+
args: [{ name: "workflow-type", required: true, description: "Workflow Type" }, { name: "workflow-id", required: true, description: "Workflow ID" }],
|
|
6248
|
+
display: { title: "Equity Workflows Status", cols: ["execution_status>Execution Status", "fundraising_workflow>Fundraising Workflow", "packet>Packet", "transfer_workflow>Transfer Workflow", "#active_packet_id>ID"] },
|
|
6249
|
+
examples: ["corp equity workflows-status", "corp equity workflows-status --json"]
|
|
6250
|
+
},
|
|
6251
|
+
{
|
|
6252
|
+
name: "safe-notes",
|
|
6253
|
+
description: "Issue a new SAFE note",
|
|
6254
|
+
route: { method: "POST", path: "/v1/safe-notes" },
|
|
6255
|
+
options: [
|
|
6256
|
+
{ flags: "--conversion-unit-type <conversion-unit-type>", description: "Conversion Unit Type" },
|
|
6257
|
+
{ flags: "--discount-rate <discount-rate>", description: "SAFE discount rate (0-100)" },
|
|
6258
|
+
{ flags: "--document-id <document-id>", description: "Document ID" },
|
|
6259
|
+
{ flags: "--email <email>", description: "Email" },
|
|
6260
|
+
{ flags: "--investor-contact-id <investor-contact-id>", description: "Investor Contact Id" },
|
|
6261
|
+
{ flags: "--investor-name <investor-name>", description: "Investor name", required: true },
|
|
6262
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID" },
|
|
6263
|
+
{ flags: "--principal-amount-cents <principal-amount-cents>", description: "Principal Amount Cents", required: true, type: "int" },
|
|
6264
|
+
{ flags: "--pro-rata-rights", description: "Pro Rata Rights" },
|
|
6265
|
+
{ flags: "--resolution-id <resolution-id>", description: "Resolution ID" },
|
|
6266
|
+
{ flags: "--safe-type <safe-type>", description: "Safe Type", choices: ["post_money", "pre_money", "mfn"] },
|
|
6267
|
+
{ flags: "--valuation-cap-cents <valuation-cap-cents>", description: "Valuation Cap Cents" }
|
|
6268
|
+
],
|
|
6269
|
+
examples: ["corp safe-notes --investor-name 'investor-name' --principal-amount-cents 'principal-amount-cents'", "corp safe-notes --json"],
|
|
6270
|
+
successTemplate: "Safe Notes created"
|
|
6271
|
+
},
|
|
6272
|
+
{
|
|
6273
|
+
name: "share-transfers",
|
|
6274
|
+
description: "Execute a share transfer between parties",
|
|
6275
|
+
route: { method: "POST", path: "/v1/share-transfers" },
|
|
6276
|
+
options: [
|
|
6277
|
+
{ flags: "--from-holder <from-holder>", description: "From Holder", required: true },
|
|
6278
|
+
{ flags: "--governing-doc-type <governing-doc-type>", description: "Governing Doc Type", choices: ["bylaws", "operating_agreement", "shareholder_agreement", "other"] },
|
|
6279
|
+
{ flags: "--share-class-id <share-class-id>", description: "Share class ID", required: true },
|
|
6280
|
+
{ flags: "--shares <shares>", description: "Shares", required: true, type: "int" },
|
|
6281
|
+
{ flags: "--to-holder <to-holder>", description: "To Holder", required: true },
|
|
6282
|
+
{ flags: "--transfer-type <transfer-type>", description: "Type of share transfer.", required: true, choices: ["gift", "trust_transfer", "secondary_sale", "estate", "other"] },
|
|
6283
|
+
{ flags: "--transferee-rights <transferee-rights>", description: "Transferee Rights", choices: ["full_member", "economic_only", "limited"] }
|
|
6284
|
+
],
|
|
6285
|
+
examples: ["corp share-transfers --from-holder bylaws --share-class-id 'share-class-id' --shares 'shares' --to-holder gift --transfer-type gift", "corp share-transfers --json"],
|
|
6286
|
+
successTemplate: "Share Transfers created"
|
|
6287
|
+
},
|
|
6288
|
+
{
|
|
6289
|
+
name: "valuations",
|
|
6290
|
+
description: "Create a new company valuation",
|
|
6291
|
+
route: { method: "POST", path: "/v1/valuations" },
|
|
6292
|
+
options: [
|
|
6293
|
+
{ flags: "--dlom <dlom>", description: "Dlom" },
|
|
6294
|
+
{ flags: "--effective-date <effective-date>", description: "Effective Date", required: true },
|
|
6295
|
+
{ flags: "--enterprise-value-cents <enterprise-value-cents>", description: "Enterprise Value Cents" },
|
|
6296
|
+
{ flags: "--fmv-per-share-cents <fmv-per-share-cents>", description: "Fmv Per Share Cents" },
|
|
6297
|
+
{ flags: "--hurdle-amount-cents <hurdle-amount-cents>", description: "Hurdle Amount Cents" },
|
|
6298
|
+
{ flags: "--methodology <methodology>", description: "Methodology used for a valuation.", required: true, choices: ["income", "market", "asset", "backsolve", "hybrid", "other"] },
|
|
6299
|
+
{ flags: "--provider-contact-id <provider-contact-id>", description: "Provider Contact Id" },
|
|
6300
|
+
{ flags: "--report-date <report-date>", description: "Report Date" },
|
|
6301
|
+
{ flags: "--report-document-id <report-document-id>", description: "Report Document Id" },
|
|
6302
|
+
{ flags: "--valuation-type <valuation-type>", description: "Type of 409A or equivalent valuation.", required: true, choices: ["four_oh_nine_a", "llc_profits_interest", "fair_market_value", "gift", "estate", "other"] }
|
|
6303
|
+
],
|
|
6304
|
+
examples: ["corp valuations --effective-date 'effective-date' --methodology income --valuation-type four_oh_nine_a", "corp valuations --json"],
|
|
6305
|
+
successTemplate: "Valuations created"
|
|
6306
|
+
},
|
|
6307
|
+
{
|
|
6308
|
+
name: "valuations submit-for-approval",
|
|
6309
|
+
description: "Submit a valuation for board approval",
|
|
6310
|
+
route: { method: "POST", path: "/v1/valuations/{pos}/submit-for-approval" },
|
|
6311
|
+
args: [{ name: "valuation-id", required: true, description: "Valuation ID" }],
|
|
6312
|
+
examples: ["corp valuations submit-for-approval <valuation-id>"],
|
|
6313
|
+
successTemplate: "Submit For Approval created"
|
|
6314
|
+
}
|
|
6315
|
+
];
|
|
6316
|
+
}
|
|
6317
|
+
});
|
|
6318
|
+
|
|
6319
|
+
// src/registry/finance.ts
|
|
6320
|
+
function sumAmounts(records, candidates) {
|
|
6321
|
+
return records.reduce((sum, record) => {
|
|
6322
|
+
for (const key of candidates) {
|
|
6323
|
+
if (typeof record[key] === "number" && Number.isFinite(record[key])) {
|
|
6324
|
+
return sum + Number(record[key]);
|
|
6325
|
+
}
|
|
6326
|
+
}
|
|
5125
6327
|
return sum;
|
|
5126
6328
|
}, 0);
|
|
5127
6329
|
}
|
|
@@ -5255,7 +6457,8 @@ var init_finance = __esm({
|
|
|
5255
6457
|
return;
|
|
5256
6458
|
}
|
|
5257
6459
|
printInvoicesTable(invoices);
|
|
5258
|
-
}
|
|
6460
|
+
},
|
|
6461
|
+
examples: ["corp finance invoices", "corp finance invoices --json"]
|
|
5259
6462
|
},
|
|
5260
6463
|
// --- finance invoice (create) ---
|
|
5261
6464
|
{
|
|
@@ -5268,10 +6471,14 @@ var init_finance = __esm({
|
|
|
5268
6471
|
{ flags: "--amount-cents <n>", description: "Amount in cents (e.g. 500000 = $5,000.00)", type: "int" },
|
|
5269
6472
|
{ flags: "--amount <n>", description: "Amount in dollars (converted to cents)", type: "int" },
|
|
5270
6473
|
{ flags: "--due-date <date>", description: "Due date (ISO 8601)", required: true },
|
|
5271
|
-
{ flags: "--description <desc>", description: "Description", default: "Services rendered" }
|
|
6474
|
+
{ flags: "--description <desc>", description: "Description text", default: "Services rendered" }
|
|
5272
6475
|
],
|
|
5273
6476
|
handler: async (ctx) => {
|
|
5274
6477
|
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.");
|
|
6480
|
+
process.exit(1);
|
|
6481
|
+
}
|
|
5275
6482
|
const amountCents = ctx.opts.amountCents ?? (ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0);
|
|
5276
6483
|
if (amountCents == null) {
|
|
5277
6484
|
printError("required option '--amount-cents <n>' or '--amount <n>' not specified");
|
|
@@ -5293,7 +6500,8 @@ var init_finance = __esm({
|
|
|
5293
6500
|
});
|
|
5294
6501
|
},
|
|
5295
6502
|
produces: { kind: "invoice" },
|
|
5296
|
-
successTemplate: "Invoice created: {customer_name}"
|
|
6503
|
+
successTemplate: "Invoice created: {customer_name}",
|
|
6504
|
+
examples: ["corp finance invoice --customer 'name' --due-date 'date'", "corp finance invoice --json"]
|
|
5297
6505
|
},
|
|
5298
6506
|
// --- finance payments ---
|
|
5299
6507
|
{
|
|
@@ -5318,7 +6526,8 @@ var init_finance = __esm({
|
|
|
5318
6526
|
return;
|
|
5319
6527
|
}
|
|
5320
6528
|
printPaymentsTable(payments);
|
|
5321
|
-
}
|
|
6529
|
+
},
|
|
6530
|
+
examples: ["corp finance payments", "corp finance payments --json"]
|
|
5322
6531
|
},
|
|
5323
6532
|
// --- finance pay ---
|
|
5324
6533
|
{
|
|
@@ -5334,6 +6543,10 @@ var init_finance = __esm({
|
|
|
5334
6543
|
],
|
|
5335
6544
|
handler: async (ctx) => {
|
|
5336
6545
|
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.");
|
|
6548
|
+
process.exit(1);
|
|
6549
|
+
}
|
|
5337
6550
|
const amountCents = ctx.opts.amountCents ?? (ctx.opts.amount != null ? ctx.opts.amount * 100 : void 0);
|
|
5338
6551
|
if (amountCents == null) {
|
|
5339
6552
|
printError("required option '--amount-cents <n>' or '--amount <n>' not specified");
|
|
@@ -5356,7 +6569,8 @@ var init_finance = __esm({
|
|
|
5356
6569
|
});
|
|
5357
6570
|
},
|
|
5358
6571
|
produces: { kind: "payment" },
|
|
5359
|
-
successTemplate: "Payment submitted: {recipient_name}"
|
|
6572
|
+
successTemplate: "Payment submitted: {recipient_name}",
|
|
6573
|
+
examples: ["corp finance pay --recipient 'name'", "corp finance pay --json"]
|
|
5360
6574
|
},
|
|
5361
6575
|
// --- finance bank-accounts ---
|
|
5362
6576
|
{
|
|
@@ -5381,7 +6595,8 @@ var init_finance = __esm({
|
|
|
5381
6595
|
return;
|
|
5382
6596
|
}
|
|
5383
6597
|
printBankAccountsTable(accounts);
|
|
5384
|
-
}
|
|
6598
|
+
},
|
|
6599
|
+
examples: ["corp finance bank-accounts", "corp finance bank-accounts --json"]
|
|
5385
6600
|
},
|
|
5386
6601
|
// --- finance open-account ---
|
|
5387
6602
|
{
|
|
@@ -5404,7 +6619,8 @@ var init_finance = __esm({
|
|
|
5404
6619
|
});
|
|
5405
6620
|
},
|
|
5406
6621
|
produces: { kind: "bank_account" },
|
|
5407
|
-
successTemplate: "Bank account opened: {bank_name}"
|
|
6622
|
+
successTemplate: "Bank account opened: {bank_name}",
|
|
6623
|
+
examples: ["corp finance open-account", "corp finance open-account --json"]
|
|
5408
6624
|
},
|
|
5409
6625
|
// --- finance activate-account <account-ref> ---
|
|
5410
6626
|
{
|
|
@@ -5425,7 +6641,8 @@ var init_finance = __esm({
|
|
|
5425
6641
|
referenceKind: "bank_account",
|
|
5426
6642
|
showReuseHint: true
|
|
5427
6643
|
});
|
|
5428
|
-
}
|
|
6644
|
+
},
|
|
6645
|
+
examples: ["corp finance activate-account <account-ref>"]
|
|
5429
6646
|
},
|
|
5430
6647
|
// --- finance payroll-runs ---
|
|
5431
6648
|
{
|
|
@@ -5450,7 +6667,8 @@ var init_finance = __esm({
|
|
|
5450
6667
|
return;
|
|
5451
6668
|
}
|
|
5452
6669
|
printPayrollRunsTable(runs);
|
|
5453
|
-
}
|
|
6670
|
+
},
|
|
6671
|
+
examples: ["corp finance payroll-runs", "corp finance payroll-runs --json"]
|
|
5454
6672
|
},
|
|
5455
6673
|
// --- finance payroll ---
|
|
5456
6674
|
{
|
|
@@ -5478,7 +6696,8 @@ var init_finance = __esm({
|
|
|
5478
6696
|
});
|
|
5479
6697
|
},
|
|
5480
6698
|
produces: { kind: "payroll_run" },
|
|
5481
|
-
successTemplate: "Payroll run created"
|
|
6699
|
+
successTemplate: "Payroll run created",
|
|
6700
|
+
examples: ["corp finance payroll --period-start 'date' --period-end 'date'"]
|
|
5482
6701
|
},
|
|
5483
6702
|
// --- finance distributions ---
|
|
5484
6703
|
{
|
|
@@ -5503,7 +6722,8 @@ var init_finance = __esm({
|
|
|
5503
6722
|
return;
|
|
5504
6723
|
}
|
|
5505
6724
|
printDistributionsTable(distributions);
|
|
5506
|
-
}
|
|
6725
|
+
},
|
|
6726
|
+
examples: ["corp finance distributions", "corp finance distributions --json"]
|
|
5507
6727
|
},
|
|
5508
6728
|
// --- finance reconciliations ---
|
|
5509
6729
|
{
|
|
@@ -5528,7 +6748,8 @@ var init_finance = __esm({
|
|
|
5528
6748
|
return;
|
|
5529
6749
|
}
|
|
5530
6750
|
printReconciliationsTable(reconciliations);
|
|
5531
|
-
}
|
|
6751
|
+
},
|
|
6752
|
+
examples: ["corp finance reconciliations", "corp finance reconciliations --json"]
|
|
5532
6753
|
},
|
|
5533
6754
|
// --- finance reconcile ---
|
|
5534
6755
|
{
|
|
@@ -5556,7 +6777,8 @@ var init_finance = __esm({
|
|
|
5556
6777
|
});
|
|
5557
6778
|
},
|
|
5558
6779
|
produces: { kind: "reconciliation" },
|
|
5559
|
-
successTemplate: "Reconciliation created"
|
|
6780
|
+
successTemplate: "Reconciliation created",
|
|
6781
|
+
examples: ["corp finance reconcile --start-date 'date' --end-date 'date'"]
|
|
5560
6782
|
},
|
|
5561
6783
|
// --- finance classifications ---
|
|
5562
6784
|
{
|
|
@@ -5581,7 +6803,8 @@ var init_finance = __esm({
|
|
|
5581
6803
|
return;
|
|
5582
6804
|
}
|
|
5583
6805
|
printClassificationsTable(classifications);
|
|
5584
|
-
}
|
|
6806
|
+
},
|
|
6807
|
+
examples: ["corp finance classifications", "corp finance classifications --json"]
|
|
5585
6808
|
},
|
|
5586
6809
|
// --- finance classify-contractor ---
|
|
5587
6810
|
{
|
|
@@ -5617,7 +6840,8 @@ var init_finance = __esm({
|
|
|
5617
6840
|
});
|
|
5618
6841
|
},
|
|
5619
6842
|
produces: { kind: "classification" },
|
|
5620
|
-
successTemplate: "Classification created: {contractor_name}"
|
|
6843
|
+
successTemplate: "Classification created: {contractor_name}",
|
|
6844
|
+
examples: ["corp finance classify-contractor --name 'name' --state 'code' --hours 'n' --duration 'n'", "corp finance classify-contractor --json"]
|
|
5621
6845
|
},
|
|
5622
6846
|
// --- finance statements ---
|
|
5623
6847
|
{
|
|
@@ -5639,7 +6863,8 @@ var init_finance = __esm({
|
|
|
5639
6863
|
return;
|
|
5640
6864
|
}
|
|
5641
6865
|
printJson(result);
|
|
5642
|
-
}
|
|
6866
|
+
},
|
|
6867
|
+
examples: ["corp finance statements", "corp finance statements --json"]
|
|
5643
6868
|
}
|
|
5644
6869
|
];
|
|
5645
6870
|
}
|
|
@@ -5716,6 +6941,9 @@ var init_governance = __esm({
|
|
|
5716
6941
|
},
|
|
5717
6942
|
handler: async (ctx) => {
|
|
5718
6943
|
const bodyRef = ctx.positional[0];
|
|
6944
|
+
if (!bodyRef) {
|
|
6945
|
+
throw new Error("Missing required argument <body-ref>.\n List bodies first: corp governance\n Then: corp governance seats <body-id>");
|
|
6946
|
+
}
|
|
5719
6947
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
5720
6948
|
const resolvedBodyId = await ctx.resolver.resolveBody(eid, bodyRef);
|
|
5721
6949
|
const seats = await ctx.client.getGovernanceSeats(resolvedBodyId, eid);
|
|
@@ -5729,7 +6957,8 @@ var init_governance = __esm({
|
|
|
5729
6957
|
return;
|
|
5730
6958
|
}
|
|
5731
6959
|
printSeatsTable(seats);
|
|
5732
|
-
}
|
|
6960
|
+
},
|
|
6961
|
+
examples: ["corp governance seats <body-ref>", "corp governance seats <body-ref> --json"]
|
|
5733
6962
|
},
|
|
5734
6963
|
// --- governance meetings <body-ref> ---
|
|
5735
6964
|
{
|
|
@@ -5744,6 +6973,9 @@ var init_governance = __esm({
|
|
|
5744
6973
|
},
|
|
5745
6974
|
handler: async (ctx) => {
|
|
5746
6975
|
const bodyRef = ctx.positional[0];
|
|
6976
|
+
if (!bodyRef) {
|
|
6977
|
+
throw new Error("Missing required argument <body-ref>.\n List bodies first: corp governance\n Then: corp governance meetings <body-id>");
|
|
6978
|
+
}
|
|
5747
6979
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
5748
6980
|
const resolvedBodyId = await ctx.resolver.resolveBody(eid, bodyRef);
|
|
5749
6981
|
const meetings = await ctx.client.listMeetings(resolvedBodyId, eid);
|
|
@@ -5757,7 +6989,8 @@ var init_governance = __esm({
|
|
|
5757
6989
|
return;
|
|
5758
6990
|
}
|
|
5759
6991
|
printMeetingsTable(meetings);
|
|
5760
|
-
}
|
|
6992
|
+
},
|
|
6993
|
+
examples: ["corp governance meetings <body-ref>", "corp governance meetings <body-ref> --json"]
|
|
5761
6994
|
},
|
|
5762
6995
|
// --- governance resolutions <meeting-ref> ---
|
|
5763
6996
|
{
|
|
@@ -5772,6 +7005,9 @@ var init_governance = __esm({
|
|
|
5772
7005
|
},
|
|
5773
7006
|
handler: async (ctx) => {
|
|
5774
7007
|
const meetingRef = ctx.positional[0];
|
|
7008
|
+
if (!meetingRef) {
|
|
7009
|
+
throw new Error("Missing required argument <meeting-ref>.\n List meetings first: corp governance meetings <body-ref>\n Then: corp governance resolutions <meeting-id>");
|
|
7010
|
+
}
|
|
5775
7011
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
5776
7012
|
const resolvedMeetingId = await ctx.resolver.resolveMeeting(eid, meetingRef);
|
|
5777
7013
|
const resolutions = await ctx.client.getMeetingResolutions(resolvedMeetingId, eid);
|
|
@@ -5785,7 +7021,8 @@ var init_governance = __esm({
|
|
|
5785
7021
|
return;
|
|
5786
7022
|
}
|
|
5787
7023
|
printResolutionsTable(resolutions);
|
|
5788
|
-
}
|
|
7024
|
+
},
|
|
7025
|
+
examples: ["corp governance resolutions <meeting-ref>", "corp governance resolutions <meeting-ref> --json"]
|
|
5789
7026
|
},
|
|
5790
7027
|
// --- governance agenda-items <meeting-ref> ---
|
|
5791
7028
|
{
|
|
@@ -5800,6 +7037,9 @@ var init_governance = __esm({
|
|
|
5800
7037
|
},
|
|
5801
7038
|
handler: async (ctx) => {
|
|
5802
7039
|
const meetingRef = ctx.positional[0];
|
|
7040
|
+
if (!meetingRef) {
|
|
7041
|
+
throw new Error("Missing required argument <meeting-ref>.\n List meetings first: corp governance meetings <body-ref>\n Then: corp governance agenda-items <meeting-id>");
|
|
7042
|
+
}
|
|
5803
7043
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
5804
7044
|
const resolvedMeetingId = await ctx.resolver.resolveMeeting(eid, meetingRef);
|
|
5805
7045
|
const items = await ctx.client.listAgendaItems(resolvedMeetingId, eid);
|
|
@@ -5813,12 +7053,13 @@ var init_governance = __esm({
|
|
|
5813
7053
|
return;
|
|
5814
7054
|
}
|
|
5815
7055
|
printAgendaItemsTable(items);
|
|
5816
|
-
}
|
|
7056
|
+
},
|
|
7057
|
+
examples: ["corp governance agenda-items <meeting-ref>", "corp governance agenda-items <meeting-ref> --json"]
|
|
5817
7058
|
},
|
|
5818
7059
|
// --- governance incidents ---
|
|
5819
7060
|
{
|
|
5820
7061
|
name: "governance incidents",
|
|
5821
|
-
description: "
|
|
7062
|
+
description: "Report a governance incident",
|
|
5822
7063
|
route: { method: "GET", path: "/v1/entities/{eid}/governance/incidents" },
|
|
5823
7064
|
entity: true,
|
|
5824
7065
|
display: { title: "Governance Incidents" },
|
|
@@ -5838,7 +7079,8 @@ var init_governance = __esm({
|
|
|
5838
7079
|
const colored = status === "resolved" ? chalk8.green(status) : chalk8.red(status);
|
|
5839
7080
|
console.log(` [${colored}] ${inc.incident_type ?? "unknown"}: ${inc.description ?? inc.id}`);
|
|
5840
7081
|
}
|
|
5841
|
-
}
|
|
7082
|
+
},
|
|
7083
|
+
examples: ["corp governance incidents", "corp governance incidents --json"]
|
|
5842
7084
|
},
|
|
5843
7085
|
// --- governance profile ---
|
|
5844
7086
|
{
|
|
@@ -5863,7 +7105,8 @@ var init_governance = __esm({
|
|
|
5863
7105
|
}
|
|
5864
7106
|
}
|
|
5865
7107
|
console.log(chalk8.blue("\u2500".repeat(40)));
|
|
5866
|
-
}
|
|
7108
|
+
},
|
|
7109
|
+
examples: ["corp governance profile", "corp governance profile --json"]
|
|
5867
7110
|
},
|
|
5868
7111
|
// --- governance mode ---
|
|
5869
7112
|
{
|
|
@@ -5898,7 +7141,8 @@ var init_governance = __esm({
|
|
|
5898
7141
|
console.log(` ${chalk8.bold("Governance Mode:")} ${result.mode ?? "N/A"}`);
|
|
5899
7142
|
if (result.reason) console.log(` ${chalk8.bold("Reason:")} ${result.reason}`);
|
|
5900
7143
|
}
|
|
5901
|
-
}
|
|
7144
|
+
},
|
|
7145
|
+
examples: ["corp governance mode", "corp governance mode --json"]
|
|
5902
7146
|
},
|
|
5903
7147
|
// --- governance create-body ---
|
|
5904
7148
|
{
|
|
@@ -5909,9 +7153,9 @@ var init_governance = __esm({
|
|
|
5909
7153
|
dryRun: true,
|
|
5910
7154
|
options: [
|
|
5911
7155
|
{ flags: "--name <name>", description: "Body name (e.g. 'Board of Directors')", required: true },
|
|
5912
|
-
{ flags: "--body-type <type>", description: "Body type
|
|
5913
|
-
{ flags: "--quorum <rule>", description: "Quorum rule
|
|
5914
|
-
{ flags: "--voting <method>", description: "Voting method
|
|
7156
|
+
{ flags: "--body-type <type>", description: "Body type", required: true, choices: ["board_of_directors", "llc_member_vote"] },
|
|
7157
|
+
{ flags: "--quorum <rule>", description: "Quorum rule", default: "majority", choices: ["majority", "supermajority", "unanimous"] },
|
|
7158
|
+
{ flags: "--voting <method>", description: "Voting method", default: "per_capita", choices: ["per_capita", "per_unit"] }
|
|
5915
7159
|
],
|
|
5916
7160
|
handler: async (ctx) => {
|
|
5917
7161
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
@@ -5941,7 +7185,8 @@ var init_governance = __esm({
|
|
|
5941
7185
|
console.log(chalk8.dim(` corp governance seats @last:body`));
|
|
5942
7186
|
},
|
|
5943
7187
|
produces: { kind: "body" },
|
|
5944
|
-
successTemplate: "Governance body created: {name}"
|
|
7188
|
+
successTemplate: "Governance body created: {name}",
|
|
7189
|
+
examples: ["corp governance create-body --name 'name' --body-type 'type'", "corp governance create-body --json"]
|
|
5945
7190
|
},
|
|
5946
7191
|
// --- governance add-seat <body-ref> ---
|
|
5947
7192
|
{
|
|
@@ -5976,7 +7221,8 @@ var init_governance = __esm({
|
|
|
5976
7221
|
printReferenceSummary("seat", result, { showReuseHint: true });
|
|
5977
7222
|
},
|
|
5978
7223
|
produces: { kind: "seat" },
|
|
5979
|
-
successTemplate: "Seat added to {body_id}"
|
|
7224
|
+
successTemplate: "Seat added to {body_id}",
|
|
7225
|
+
examples: ["corp governance add-seat <body-ref> --holder 'contact-ref'", "corp governance add-seat --json"]
|
|
5980
7226
|
},
|
|
5981
7227
|
// --- governance convene ---
|
|
5982
7228
|
{
|
|
@@ -6023,7 +7269,8 @@ var init_governance = __esm({
|
|
|
6023
7269
|
console.log(chalk8.dim(` corp governance agenda-items @last:meeting`));
|
|
6024
7270
|
},
|
|
6025
7271
|
produces: { kind: "meeting" },
|
|
6026
|
-
successTemplate: "Meeting scheduled: {title}"
|
|
7272
|
+
successTemplate: "Meeting scheduled: {title}",
|
|
7273
|
+
examples: ["corp governance convene --body 'ref' --type 'type' --title 'title'", "corp governance convene --json"]
|
|
6027
7274
|
},
|
|
6028
7275
|
// --- governance open <meeting-ref> ---
|
|
6029
7276
|
{
|
|
@@ -6041,9 +7288,18 @@ var init_governance = __esm({
|
|
|
6041
7288
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
6042
7289
|
const resolvedMeetingId = await ctx.resolver.resolveMeeting(eid, meetingRef);
|
|
6043
7290
|
const presentSeats = ctx.opts.presentSeat;
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
7291
|
+
let resolvedSeats;
|
|
7292
|
+
try {
|
|
7293
|
+
resolvedSeats = await Promise.all(
|
|
7294
|
+
presentSeats.map((seatRef) => ctx.resolver.resolveSeat(eid, seatRef))
|
|
7295
|
+
);
|
|
7296
|
+
} catch (err) {
|
|
7297
|
+
throw new Error(
|
|
7298
|
+
`Failed to resolve seat reference: ${err}
|
|
7299
|
+
--present-seat expects seat IDs, not contact IDs.
|
|
7300
|
+
Find seat IDs with: corp governance seats <body-ref>`
|
|
7301
|
+
);
|
|
7302
|
+
}
|
|
6047
7303
|
const payload = { present_seat_ids: resolvedSeats };
|
|
6048
7304
|
if (ctx.dryRun) {
|
|
6049
7305
|
ctx.writer.dryRun("governance.open_meeting", { entity_id: eid, meeting_id: resolvedMeetingId, ...payload });
|
|
@@ -6055,7 +7311,8 @@ var init_governance = __esm({
|
|
|
6055
7311
|
return;
|
|
6056
7312
|
}
|
|
6057
7313
|
ctx.writer.success(`Meeting opened: ${resolvedMeetingId}`);
|
|
6058
|
-
}
|
|
7314
|
+
},
|
|
7315
|
+
examples: ["corp governance open <meeting-ref> --present-seat 'ref'"]
|
|
6059
7316
|
},
|
|
6060
7317
|
// --- governance vote <meeting-ref> <item-ref> ---
|
|
6061
7318
|
{
|
|
@@ -6108,7 +7365,8 @@ var init_governance = __esm({
|
|
|
6108
7365
|
throw err;
|
|
6109
7366
|
}
|
|
6110
7367
|
}
|
|
6111
|
-
}
|
|
7368
|
+
},
|
|
7369
|
+
examples: ["corp governance vote <meeting-ref> <item-ref> --voter for --vote for"]
|
|
6112
7370
|
},
|
|
6113
7371
|
// --- governance notice <meeting-ref> ---
|
|
6114
7372
|
{
|
|
@@ -6132,7 +7390,8 @@ var init_governance = __esm({
|
|
|
6132
7390
|
return;
|
|
6133
7391
|
}
|
|
6134
7392
|
ctx.writer.success(`Notice sent for meeting ${resolvedMeetingId}`);
|
|
6135
|
-
}
|
|
7393
|
+
},
|
|
7394
|
+
examples: ["corp governance notice <meeting-ref>"]
|
|
6136
7395
|
},
|
|
6137
7396
|
// --- governance adjourn <meeting-ref> ---
|
|
6138
7397
|
{
|
|
@@ -6156,7 +7415,8 @@ var init_governance = __esm({
|
|
|
6156
7415
|
return;
|
|
6157
7416
|
}
|
|
6158
7417
|
ctx.writer.success(`Meeting ${resolvedMeetingId} adjourned`);
|
|
6159
|
-
}
|
|
7418
|
+
},
|
|
7419
|
+
examples: ["corp governance adjourn <meeting-ref>"]
|
|
6160
7420
|
},
|
|
6161
7421
|
// --- governance reopen <meeting-ref> ---
|
|
6162
7422
|
{
|
|
@@ -6180,7 +7440,8 @@ var init_governance = __esm({
|
|
|
6180
7440
|
return;
|
|
6181
7441
|
}
|
|
6182
7442
|
ctx.writer.success(`Meeting ${resolvedMeetingId} re-opened`);
|
|
6183
|
-
}
|
|
7443
|
+
},
|
|
7444
|
+
examples: ["corp governance reopen <meeting-ref>"]
|
|
6184
7445
|
},
|
|
6185
7446
|
// --- governance cancel <meeting-ref> ---
|
|
6186
7447
|
{
|
|
@@ -6217,7 +7478,8 @@ var init_governance = __esm({
|
|
|
6217
7478
|
return;
|
|
6218
7479
|
}
|
|
6219
7480
|
ctx.writer.success(`Meeting ${resolvedMeetingId} cancelled`);
|
|
6220
|
-
}
|
|
7481
|
+
},
|
|
7482
|
+
examples: ["corp governance cancel <meeting-ref>", "corp governance cancel --json"]
|
|
6221
7483
|
},
|
|
6222
7484
|
// --- governance finalize-item <meeting-ref> <item-ref> ---
|
|
6223
7485
|
{
|
|
@@ -6255,7 +7517,8 @@ var init_governance = __esm({
|
|
|
6255
7517
|
return;
|
|
6256
7518
|
}
|
|
6257
7519
|
ctx.writer.success(`Agenda item ${resolvedItemId} finalized as ${ctx.opts.status}`);
|
|
6258
|
-
}
|
|
7520
|
+
},
|
|
7521
|
+
examples: ["corp governance finalize-item <meeting-ref> <item-ref>"]
|
|
6259
7522
|
},
|
|
6260
7523
|
// --- governance resolve <meeting-ref> <item-ref> ---
|
|
6261
7524
|
{
|
|
@@ -6298,7 +7561,8 @@ var init_governance = __esm({
|
|
|
6298
7561
|
printReferenceSummary("resolution", result, { showReuseHint: true });
|
|
6299
7562
|
},
|
|
6300
7563
|
produces: { kind: "resolution" },
|
|
6301
|
-
successTemplate: "Resolution computed"
|
|
7564
|
+
successTemplate: "Resolution computed",
|
|
7565
|
+
examples: ["corp governance resolve <meeting-ref> <item-ref> --text 'resolution_text'"]
|
|
6302
7566
|
},
|
|
6303
7567
|
// --- governance written-consent ---
|
|
6304
7568
|
{
|
|
@@ -6310,7 +7574,7 @@ var init_governance = __esm({
|
|
|
6310
7574
|
options: [
|
|
6311
7575
|
{ flags: "--body <ref>", description: "Governance body reference", required: true },
|
|
6312
7576
|
{ flags: "--title <title>", description: "Title", required: true },
|
|
6313
|
-
{ flags: "--description <desc>", description: "Description", required: true }
|
|
7577
|
+
{ flags: "--description <desc>", description: "Description text", required: true }
|
|
6314
7578
|
],
|
|
6315
7579
|
handler: async (ctx) => {
|
|
6316
7580
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
@@ -6349,7 +7613,104 @@ var init_governance = __esm({
|
|
|
6349
7613
|
console.log(chalk8.dim(` corp governance vote @last:meeting <item-ref> --voter <contact-ref> --vote for`));
|
|
6350
7614
|
},
|
|
6351
7615
|
produces: { kind: "meeting" },
|
|
6352
|
-
successTemplate: "Written consent created: {title}"
|
|
7616
|
+
successTemplate: "Written consent created: {title}",
|
|
7617
|
+
examples: ["corp governance written-consent --body 'ref' --title 'title' --description 'desc'"]
|
|
7618
|
+
},
|
|
7619
|
+
// --- governance quick-approve ---
|
|
7620
|
+
{
|
|
7621
|
+
name: "governance quick-approve",
|
|
7622
|
+
description: "One-step board approval: create written consent, auto-vote, return meeting + resolution IDs",
|
|
7623
|
+
entity: true,
|
|
7624
|
+
dryRun: true,
|
|
7625
|
+
options: [
|
|
7626
|
+
{ flags: "--body <ref>", description: "Governance body reference (auto-detected if only one exists)" },
|
|
7627
|
+
{ flags: "--text <resolution_text>", description: "Resolution text (e.g. 'RESOLVED: authorize SAFE issuance')", required: true }
|
|
7628
|
+
],
|
|
7629
|
+
handler: async (ctx) => {
|
|
7630
|
+
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
7631
|
+
let resolvedBodyId;
|
|
7632
|
+
if (ctx.opts.body) {
|
|
7633
|
+
resolvedBodyId = await ctx.resolver.resolveBody(eid, ctx.opts.body);
|
|
7634
|
+
} else {
|
|
7635
|
+
const bodies = await ctx.client.listGovernanceBodies(eid);
|
|
7636
|
+
const active = bodies.filter((b) => b.status === "active");
|
|
7637
|
+
if (active.length === 1) {
|
|
7638
|
+
resolvedBodyId = String(active[0].body_id);
|
|
7639
|
+
} else if (active.length === 0) {
|
|
7640
|
+
throw new Error("No active governance bodies found. Create one first: corp governance create-body");
|
|
7641
|
+
} else {
|
|
7642
|
+
throw new Error(`Multiple governance bodies found (${active.length}). Specify --body <ref>.`);
|
|
7643
|
+
}
|
|
7644
|
+
}
|
|
7645
|
+
const resolutionText = ctx.opts.text;
|
|
7646
|
+
const title = `Board Approval: ${resolutionText.slice(0, 60)}`;
|
|
7647
|
+
if (ctx.dryRun) {
|
|
7648
|
+
ctx.writer.dryRun("governance.quick_approve", {
|
|
7649
|
+
entity_id: eid,
|
|
7650
|
+
body_id: resolvedBodyId,
|
|
7651
|
+
title,
|
|
7652
|
+
resolution_text: resolutionText
|
|
7653
|
+
});
|
|
7654
|
+
return;
|
|
7655
|
+
}
|
|
7656
|
+
const consentResult = await writtenConsentWorkflow(ctx.client, {
|
|
7657
|
+
entityId: eid,
|
|
7658
|
+
bodyId: resolvedBodyId,
|
|
7659
|
+
title,
|
|
7660
|
+
description: resolutionText
|
|
7661
|
+
});
|
|
7662
|
+
if (!consentResult.success) {
|
|
7663
|
+
throw new Error(`Written consent failed: ${consentResult.error}`);
|
|
7664
|
+
}
|
|
7665
|
+
const meetingId = String(consentResult.data?.meeting_id);
|
|
7666
|
+
ctx.resolver.remember("meeting", meetingId, eid);
|
|
7667
|
+
const agendaItems = await ctx.client.listAgendaItems(meetingId, eid);
|
|
7668
|
+
if (agendaItems.length === 0) {
|
|
7669
|
+
throw new Error("Written consent created but no agenda items found.");
|
|
7670
|
+
}
|
|
7671
|
+
const itemId = String(agendaItems[0].agenda_item_id);
|
|
7672
|
+
const seats = await ctx.client.getGovernanceSeats(resolvedBodyId, eid);
|
|
7673
|
+
const filledSeats = seats.filter((s3) => s3.status === "filled" || s3.status === "active");
|
|
7674
|
+
const seatIds = filledSeats.map((s3) => String(s3.seat_id));
|
|
7675
|
+
if (seatIds.length === 0) {
|
|
7676
|
+
throw new Error("No filled seats found on this governance body. Add seats first: corp governance add-seat <body-ref>");
|
|
7677
|
+
}
|
|
7678
|
+
const meetingStatus = consentResult.data?.status ?? consentResult.data?.meeting_status;
|
|
7679
|
+
if (meetingStatus !== "convened") {
|
|
7680
|
+
await ctx.client.conveneMeeting(meetingId, eid, { present_seat_ids: seatIds });
|
|
7681
|
+
}
|
|
7682
|
+
for (const seatId of seatIds) {
|
|
7683
|
+
try {
|
|
7684
|
+
await ctx.client.castVote(eid, meetingId, itemId, {
|
|
7685
|
+
seat_id: seatId,
|
|
7686
|
+
vote: "for"
|
|
7687
|
+
});
|
|
7688
|
+
} catch {
|
|
7689
|
+
}
|
|
7690
|
+
}
|
|
7691
|
+
const resolution = await ctx.client.computeResolution(meetingId, itemId, eid, {
|
|
7692
|
+
resolution_text: resolutionText
|
|
7693
|
+
});
|
|
7694
|
+
const resolutionId = String(resolution.resolution_id);
|
|
7695
|
+
ctx.resolver.remember("resolution", resolutionId, eid);
|
|
7696
|
+
const passed = resolution.passed === true;
|
|
7697
|
+
if (ctx.opts.json) {
|
|
7698
|
+
ctx.writer.json({ meeting_id: meetingId, resolution_id: resolutionId, passed, votes: filledSeats.length });
|
|
7699
|
+
return;
|
|
7700
|
+
}
|
|
7701
|
+
ctx.writer.success(passed ? "Board approval completed" : "Board vote completed (resolution did not pass)");
|
|
7702
|
+
console.log(` Meeting: ${meetingId}`);
|
|
7703
|
+
console.log(` Resolution: ${resolutionId}`);
|
|
7704
|
+
console.log(chalk8.dim("\n Use with:"));
|
|
7705
|
+
console.log(chalk8.dim(` --meeting-id ${meetingId} --resolution-id ${resolutionId}`));
|
|
7706
|
+
console.log(chalk8.dim(` or: --meeting-id @last:meeting --resolution-id @last:resolution`));
|
|
7707
|
+
},
|
|
7708
|
+
produces: { kind: "resolution" },
|
|
7709
|
+
successTemplate: "Board approval completed",
|
|
7710
|
+
examples: [
|
|
7711
|
+
'corp governance quick-approve --text "RESOLVED: authorize SAFE issuance to Seed Fund"',
|
|
7712
|
+
'corp governance quick-approve --body @last:body --text "RESOLVED: issue Series A equity round"'
|
|
7713
|
+
]
|
|
6353
7714
|
},
|
|
6354
7715
|
// --- governance resign <seat-ref> ---
|
|
6355
7716
|
{
|
|
@@ -6372,7 +7733,284 @@ var init_governance = __esm({
|
|
|
6372
7733
|
return;
|
|
6373
7734
|
}
|
|
6374
7735
|
ctx.writer.success(`Seat ${seatId} resigned.`);
|
|
6375
|
-
}
|
|
7736
|
+
},
|
|
7737
|
+
examples: ["corp governance resign <seat-ref>", "corp governance resign --json"]
|
|
7738
|
+
},
|
|
7739
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
7740
|
+
{
|
|
7741
|
+
name: "entities governance-audit-checkpoints",
|
|
7742
|
+
description: "List governance audit checkpoints",
|
|
7743
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/audit/checkpoints" },
|
|
7744
|
+
entity: true,
|
|
7745
|
+
display: { title: "Entities Governance Audit Checkpoints", cols: ["#checkpoint_id>ID", "@created_at>Created At", "#entity_id>ID", "latest_entry_hash>Latest Entry Hash", "#latest_entry_id>ID", "total_entries>Total Entries"] },
|
|
7746
|
+
examples: ["corp entities governance-audit-checkpoints", "corp entities governance-audit-checkpoints --json"]
|
|
7747
|
+
},
|
|
7748
|
+
{
|
|
7749
|
+
name: "entities governance-audit-entries",
|
|
7750
|
+
description: "List governance audit log entries",
|
|
7751
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/audit/entries" },
|
|
7752
|
+
entity: true,
|
|
7753
|
+
display: { title: "Entities Governance Audit Entries", cols: ["action>Action", "details>Details", "entry_hash>Entry Hash", "event_type>Event Type", "@created_at>Created At", "#audit_entry_id>ID"] },
|
|
7754
|
+
examples: ["corp entities governance-audit-entries", "corp entities governance-audit-entries --json"]
|
|
7755
|
+
},
|
|
7756
|
+
{
|
|
7757
|
+
name: "entities governance-audit-verifications",
|
|
7758
|
+
description: "List governance audit verifications",
|
|
7759
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/audit/verifications" },
|
|
7760
|
+
entity: true,
|
|
7761
|
+
display: { title: "Entities Governance Audit Verifications", cols: ["anomalies>Anomalies", "latest_entry_hash>Latest Entry Hash", "ok>Ok", "total_entries>Total Entries", "@created_at>Created At", "#entity_id>ID"] },
|
|
7762
|
+
examples: ["corp entities governance-audit-verifications", "corp entities governance-audit-verifications --json"]
|
|
7763
|
+
},
|
|
7764
|
+
{
|
|
7765
|
+
name: "entities governance-doc-bundles",
|
|
7766
|
+
description: "List governance document bundles",
|
|
7767
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/doc-bundles" },
|
|
7768
|
+
entity: true,
|
|
7769
|
+
display: { title: "Entities Governance Doc Bundles", cols: ["document_count>Document Count", "entity_type>Entity Type", "generated_at>Generated At", "profile_version>Profile Version", "#bundle_id>ID"] },
|
|
7770
|
+
examples: ["corp entities governance-doc-bundles", "corp entities governance-doc-bundles --json"]
|
|
7771
|
+
},
|
|
7772
|
+
{
|
|
7773
|
+
name: "entities governance-doc-bundles-current",
|
|
7774
|
+
description: "View the current governance document bundle",
|
|
7775
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/doc-bundles/current" },
|
|
7776
|
+
entity: true,
|
|
7777
|
+
display: { title: "Entities Governance Doc Bundles Current", cols: ["#bundle_id>ID", "#entity_id>ID", "generated_at>Generated At", "manifest_path>Manifest Path", "template_version>Template Version"] },
|
|
7778
|
+
examples: ["corp entities governance-doc-bundles-current", "corp entities governance-doc-bundles-current --json"]
|
|
7779
|
+
},
|
|
7780
|
+
{
|
|
7781
|
+
name: "entities governance-doc-bundles-generate",
|
|
7782
|
+
description: "Generate a new governance document bundle",
|
|
7783
|
+
route: { method: "POST", path: "/v1/entities/{eid}/governance/doc-bundles/generate" },
|
|
7784
|
+
entity: true,
|
|
7785
|
+
options: [
|
|
7786
|
+
{ flags: "--template-version <template-version>", description: "Template Version" }
|
|
7787
|
+
],
|
|
7788
|
+
examples: ["corp entities governance-doc-bundles-generate", "corp entities governance-doc-bundles-generate --json"],
|
|
7789
|
+
successTemplate: "Governance Doc Bundles Generate created"
|
|
7790
|
+
},
|
|
7791
|
+
{
|
|
7792
|
+
name: "entities governance-doc-bundle",
|
|
7793
|
+
description: "List governance document bundles",
|
|
7794
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/doc-bundles/{pos}" },
|
|
7795
|
+
entity: true,
|
|
7796
|
+
args: [{ name: "bundle-id", required: true, description: "Document bundle ID" }],
|
|
7797
|
+
display: { title: "Entities Governance Doc Bundles", cols: ["documents>Documents", "entity_type>Entity Type", "generated_at>Generated At", "profile_version>Profile Version", "#bundle_id>ID"] },
|
|
7798
|
+
examples: ["corp entities governance-doc-bundles", "corp entities governance-doc-bundles --json"]
|
|
7799
|
+
},
|
|
7800
|
+
{
|
|
7801
|
+
name: "entities governance-mode-history",
|
|
7802
|
+
description: "View governance mode change history",
|
|
7803
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/mode-history" },
|
|
7804
|
+
entity: true,
|
|
7805
|
+
display: { title: "Entities Governance Mode History", cols: ["evidence_refs>Evidence Refs", "from_mode>From Mode", "incident_ids>Incident Ids", "reason>Reason", "@created_at>Created At", "#entity_id>ID"] },
|
|
7806
|
+
examples: ["corp entities governance-mode-history", "corp entities governance-mode-history --json"]
|
|
7807
|
+
},
|
|
7808
|
+
{
|
|
7809
|
+
name: "entities governance-triggers",
|
|
7810
|
+
description: "List governance triggers for an entity",
|
|
7811
|
+
route: { method: "GET", path: "/v1/entities/{eid}/governance/triggers" },
|
|
7812
|
+
entity: true,
|
|
7813
|
+
display: { title: "Entities Governance Triggers", cols: ["description>Description", "evidence_refs>Evidence Refs", "idempotency_key_hash>Idempotency Key Hash", "@created_at>Created At", "#entity_id>ID"] },
|
|
7814
|
+
examples: ["corp entities governance-triggers", "corp entities governance-triggers --json"]
|
|
7815
|
+
},
|
|
7816
|
+
{
|
|
7817
|
+
name: "governance-bodies",
|
|
7818
|
+
description: "List all governance bodies",
|
|
7819
|
+
route: { method: "GET", path: "/v1/governance-bodies" },
|
|
7820
|
+
entity: true,
|
|
7821
|
+
display: { title: "Governance Bodies", cols: ["body_type>Body Type", "name>Name", "quorum_rule>Quorum Rule", "status>Status", "@created_at>Created At", "#body_id>ID"] },
|
|
7822
|
+
examples: ["corp governance-bodies", "corp governance-bodies --json"]
|
|
7823
|
+
},
|
|
7824
|
+
{
|
|
7825
|
+
name: "governance-bodies create",
|
|
7826
|
+
description: "List all governance bodies",
|
|
7827
|
+
route: { method: "POST", path: "/v1/governance-bodies" },
|
|
7828
|
+
options: [
|
|
7829
|
+
{ flags: "--body-type <body-type>", description: "The type of governance body.", required: true, choices: ["board_of_directors", "llc_member_vote"] },
|
|
7830
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
7831
|
+
{ flags: "--quorum-rule <quorum-rule>", description: "The threshold required for a vote to pass.", required: true, choices: ["majority", "supermajority", "unanimous"] },
|
|
7832
|
+
{ flags: "--voting-method <voting-method>", description: "How votes are counted.", required: true, choices: ["per_capita", "per_unit"] }
|
|
7833
|
+
],
|
|
7834
|
+
examples: ["corp governance-bodies --body-type board_of_directors --name majority --quorum-rule majority --voting-method per_capita"],
|
|
7835
|
+
successTemplate: "Governance Bodies created"
|
|
7836
|
+
},
|
|
7837
|
+
{
|
|
7838
|
+
name: "governance-seats scan-expired",
|
|
7839
|
+
description: "Scan for and flag expired governance seats",
|
|
7840
|
+
route: { method: "POST", path: "/v1/governance-seats/scan-expired" },
|
|
7841
|
+
entity: true,
|
|
7842
|
+
examples: ["corp governance-seats scan-expired"],
|
|
7843
|
+
successTemplate: "Scan Expired created"
|
|
7844
|
+
},
|
|
7845
|
+
{
|
|
7846
|
+
name: "governance-seats resign",
|
|
7847
|
+
description: "Resign from a governance seat",
|
|
7848
|
+
route: { method: "POST", path: "/v1/governance-seats/{pos}/resign" },
|
|
7849
|
+
entity: true,
|
|
7850
|
+
args: [{ name: "seat-id", required: true, description: "Governance seat ID" }],
|
|
7851
|
+
examples: ["corp governance-seats resign <seat-id>"],
|
|
7852
|
+
successTemplate: "Resign created"
|
|
7853
|
+
},
|
|
7854
|
+
{
|
|
7855
|
+
name: "governance audit-checkpoints",
|
|
7856
|
+
description: "Create a governance audit checkpoint",
|
|
7857
|
+
route: { method: "POST", path: "/v1/governance/audit/checkpoints" },
|
|
7858
|
+
entity: true,
|
|
7859
|
+
examples: ["corp governance audit-checkpoints"],
|
|
7860
|
+
successTemplate: "Audit Checkpoints created"
|
|
7861
|
+
},
|
|
7862
|
+
{
|
|
7863
|
+
name: "governance audit-events",
|
|
7864
|
+
description: "Record a governance audit event",
|
|
7865
|
+
route: { method: "POST", path: "/v1/governance/audit/events" },
|
|
7866
|
+
entity: true,
|
|
7867
|
+
options: [
|
|
7868
|
+
{ flags: "--action <action>", description: "Action", required: true },
|
|
7869
|
+
{ flags: "--details <details>", description: "Details" },
|
|
7870
|
+
{ flags: "--event-type <event-type>", description: "Event Type", required: true, choices: ["mode_changed", "lockdown_trigger_applied", "manual_event", "checkpoint_written", "chain_verified", "chain_verification_failed"] },
|
|
7871
|
+
{ flags: "--evidence-refs <evidence-refs>", description: "Evidence Refs", type: "array" },
|
|
7872
|
+
{ flags: "--linked-incident-id <linked-incident-id>", description: "Linked Incident Id" },
|
|
7873
|
+
{ flags: "--linked-intent-id <linked-intent-id>", description: "Linked Intent Id" },
|
|
7874
|
+
{ flags: "--linked-mode-event-id <linked-mode-event-id>", description: "Linked Mode Event Id" },
|
|
7875
|
+
{ flags: "--linked-trigger-id <linked-trigger-id>", description: "Linked Trigger Id" }
|
|
7876
|
+
],
|
|
7877
|
+
examples: ["corp governance audit-events --action 'action' --event-type mode_changed", "corp governance audit-events --json"],
|
|
7878
|
+
successTemplate: "Audit Events created"
|
|
7879
|
+
},
|
|
7880
|
+
{
|
|
7881
|
+
name: "governance audit-verify",
|
|
7882
|
+
description: "Verify governance state integrity",
|
|
7883
|
+
route: { method: "POST", path: "/v1/governance/audit/verify" },
|
|
7884
|
+
entity: true,
|
|
7885
|
+
examples: ["corp governance audit-verify"],
|
|
7886
|
+
successTemplate: "Audit Verify created"
|
|
7887
|
+
},
|
|
7888
|
+
{
|
|
7889
|
+
name: "governance delegation-schedule",
|
|
7890
|
+
description: "View the current delegation schedule",
|
|
7891
|
+
route: { method: "GET", path: "/v1/governance/delegation-schedule" },
|
|
7892
|
+
entity: true,
|
|
7893
|
+
display: { title: "Governance Delegation Schedule", cols: ["allowed_tier1_intent_types>Allowed Tier1 Intent Types", "last_reauthorized_at>Last Reauthorized At", "next_mandatory_review_at>Next Mandatory Review At", "reauth_full_suspension_at_days>Reauth Full Suspension At Days", "@created_at>Created At", "#adopted_resolution_id>ID"] },
|
|
7894
|
+
examples: ["corp governance delegation-schedule", "corp governance delegation-schedule --json"]
|
|
7895
|
+
},
|
|
7896
|
+
{
|
|
7897
|
+
name: "governance delegation-schedule-amend",
|
|
7898
|
+
description: "Amend the delegation schedule",
|
|
7899
|
+
route: { method: "POST", path: "/v1/governance/delegation-schedule/amend" },
|
|
7900
|
+
entity: true,
|
|
7901
|
+
options: [
|
|
7902
|
+
{ flags: "--adopted-resolution-id <adopted-resolution-id>", description: "Adopted Resolution Id" },
|
|
7903
|
+
{ flags: "--allowed-tier1-intent-types <allowed-tier1-intent-types>", description: "Allowed Tier1 Intent Types" },
|
|
7904
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID" },
|
|
7905
|
+
{ flags: "--next-mandatory-review-at <next-mandatory-review-at>", description: "Next Mandatory Review At" },
|
|
7906
|
+
{ flags: "--rationale <rationale>", description: "Rationale" },
|
|
7907
|
+
{ flags: "--tier1-max-amount-cents <tier1-max-amount-cents>", description: "Tier1 Max Amount Cents" }
|
|
7908
|
+
],
|
|
7909
|
+
examples: ["corp governance delegation-schedule-amend", "corp governance delegation-schedule-amend --json"],
|
|
7910
|
+
successTemplate: "Delegation Schedule Amend created"
|
|
7911
|
+
},
|
|
7912
|
+
{
|
|
7913
|
+
name: "governance delegation-schedule-history",
|
|
7914
|
+
description: "View delegation schedule change history",
|
|
7915
|
+
route: { method: "GET", path: "/v1/governance/delegation-schedule/history" },
|
|
7916
|
+
entity: true,
|
|
7917
|
+
display: { title: "Governance Delegation Schedule History", cols: ["added_tier1_intent_types>Added Tier1 Intent Types", "authority_expansion>Authority Expansion", "from_version>From Version", "new_tier1_max_amount_cents>New Tier1 Max Amount Cents", "@created_at>Created At", "#adopted_resolution_id>ID"] },
|
|
7918
|
+
examples: ["corp governance delegation-schedule-history", "corp governance delegation-schedule-history --json"]
|
|
7919
|
+
},
|
|
7920
|
+
{
|
|
7921
|
+
name: "governance delegation-schedule-reauthorize",
|
|
7922
|
+
description: "Reauthorize the delegation schedule",
|
|
7923
|
+
route: { method: "POST", path: "/v1/governance/delegation-schedule/reauthorize" },
|
|
7924
|
+
entity: true,
|
|
7925
|
+
options: [
|
|
7926
|
+
{ flags: "--adopted-resolution-id <adopted-resolution-id>", description: "Adopted Resolution Id", required: true },
|
|
7927
|
+
{ flags: "--meeting-id <meeting-id>", description: "Meeting ID", required: true },
|
|
7928
|
+
{ flags: "--rationale <rationale>", description: "Rationale" }
|
|
7929
|
+
],
|
|
7930
|
+
examples: ["corp governance delegation-schedule-reauthorize --adopted-resolution-id 'adopted-resolution-id' --meeting-id 'meeting-id'", "corp governance delegation-schedule-reauthorize --json"],
|
|
7931
|
+
successTemplate: "Delegation Schedule Reauthorize created"
|
|
7932
|
+
},
|
|
7933
|
+
{
|
|
7934
|
+
name: "governance evaluate",
|
|
7935
|
+
description: "Evaluate governance compliance for an action",
|
|
7936
|
+
route: { method: "POST", path: "/v1/governance/evaluate" },
|
|
7937
|
+
entity: true,
|
|
7938
|
+
options: [
|
|
7939
|
+
{ flags: "--intent-type <intent-type>", description: "Type of intent", required: true },
|
|
7940
|
+
{ flags: "--metadata <metadata>", description: "Additional metadata (JSON)" }
|
|
7941
|
+
],
|
|
7942
|
+
examples: ["corp governance evaluate --intent-type 'intent-type'", "corp governance evaluate --json"],
|
|
7943
|
+
successTemplate: "Evaluate created"
|
|
7944
|
+
},
|
|
7945
|
+
{
|
|
7946
|
+
name: "governance report-incident",
|
|
7947
|
+
description: "Report a governance incident",
|
|
7948
|
+
route: { method: "POST", path: "/v1/governance/incidents" },
|
|
7949
|
+
entity: true,
|
|
7950
|
+
options: [
|
|
7951
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
7952
|
+
{ flags: "--severity <severity>", description: "Severity level", required: true, choices: ["low", "medium", "high", "critical"] },
|
|
7953
|
+
{ flags: "--title <title>", description: "Title", required: true }
|
|
7954
|
+
],
|
|
7955
|
+
examples: ["corp governance incidents --description low --severity low --title 'title'"],
|
|
7956
|
+
successTemplate: "Incidents created"
|
|
7957
|
+
},
|
|
7958
|
+
{
|
|
7959
|
+
name: "governance incidents-resolve",
|
|
7960
|
+
description: "Resolve a governance incident",
|
|
7961
|
+
route: { method: "POST", path: "/v1/governance/incidents/{pos}/resolve" },
|
|
7962
|
+
entity: true,
|
|
7963
|
+
args: [{ name: "incident-id", required: true, description: "Incident ID" }],
|
|
7964
|
+
examples: ["corp governance incidents-resolve <incident-id>"],
|
|
7965
|
+
successTemplate: "Incidents Resolve created"
|
|
7966
|
+
},
|
|
7967
|
+
{
|
|
7968
|
+
name: "meetings written-consent",
|
|
7969
|
+
description: "Create a written consent resolution (no meeting)",
|
|
7970
|
+
route: { method: "POST", path: "/v1/meetings/written-consent" },
|
|
7971
|
+
options: [
|
|
7972
|
+
{ flags: "--body-id <body-id>", description: "Governance body ID", required: true },
|
|
7973
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
7974
|
+
{ flags: "--title <title>", description: "Title", required: true }
|
|
7975
|
+
],
|
|
7976
|
+
examples: ["corp meetings written-consent --body-id 'body-id' --description 'description' --title 'title'"],
|
|
7977
|
+
successTemplate: "Written Consent created"
|
|
7978
|
+
},
|
|
7979
|
+
{
|
|
7980
|
+
name: "meetings agenda-items-vote",
|
|
7981
|
+
description: "Cast a vote on a meeting agenda item",
|
|
7982
|
+
route: { method: "POST", path: "/v1/meetings/{pos}/agenda-items/{pos2}/vote" },
|
|
7983
|
+
entity: true,
|
|
7984
|
+
args: [{ name: "meeting-id", required: true, description: "Meeting ID" }, { name: "item-id", required: true, description: "Agenda item ID" }],
|
|
7985
|
+
options: [
|
|
7986
|
+
{ flags: "--vote-value <vote-value>", description: "How a participant voted.", required: true, choices: ["for", "against", "abstain", "recusal"] },
|
|
7987
|
+
{ flags: "--voter-id <voter-id>", description: "Voter Id", required: true }
|
|
7988
|
+
],
|
|
7989
|
+
examples: ["corp meetings agenda-items-vote <meeting-id> <item-id> --vote-value for --voter-id 'voter-id'"],
|
|
7990
|
+
successTemplate: "Agenda Items Vote created"
|
|
7991
|
+
},
|
|
7992
|
+
{
|
|
7993
|
+
name: "meetings convene",
|
|
7994
|
+
description: "Convene a scheduled meeting (start it)",
|
|
7995
|
+
route: { method: "POST", path: "/v1/meetings/{pos}/convene" },
|
|
7996
|
+
entity: true,
|
|
7997
|
+
args: [{ name: "meeting-id", required: true, description: "Meeting ID" }],
|
|
7998
|
+
options: [
|
|
7999
|
+
{ flags: "--present-seat-ids <present-seat-ids>", description: "Present Seat Ids", required: true, type: "array" }
|
|
8000
|
+
],
|
|
8001
|
+
examples: ["corp meetings convene <meeting-id> --present-seat-ids 'present-seat-ids'"],
|
|
8002
|
+
successTemplate: "Convene created"
|
|
8003
|
+
},
|
|
8004
|
+
{
|
|
8005
|
+
name: "meetings resolutions-attach-document",
|
|
8006
|
+
description: "Attach a document to a meeting resolution",
|
|
8007
|
+
route: { method: "POST", path: "/v1/meetings/{pos}/resolutions/{pos2}/attach-document" },
|
|
8008
|
+
args: [{ name: "meeting-id", required: true, description: "Meeting ID" }, { name: "resolution-id", required: true, description: "Resolution ID" }],
|
|
8009
|
+
options: [
|
|
8010
|
+
{ flags: "--document-id <document-id>", description: "Document ID", required: true }
|
|
8011
|
+
],
|
|
8012
|
+
examples: ["corp meetings resolutions-attach-document <meeting-id> <resolution-id> --document-id 'document-id'"],
|
|
8013
|
+
successTemplate: "Resolutions Attach Document created"
|
|
6376
8014
|
}
|
|
6377
8015
|
];
|
|
6378
8016
|
}
|
|
@@ -6416,7 +8054,7 @@ var init_documents = __esm({
|
|
|
6416
8054
|
// --- documents (list) ---
|
|
6417
8055
|
{
|
|
6418
8056
|
name: "documents",
|
|
6419
|
-
description: "
|
|
8057
|
+
description: "List formation and governance documents",
|
|
6420
8058
|
route: { method: "GET", path: "/v1/formations/{eid}/documents" },
|
|
6421
8059
|
entity: true,
|
|
6422
8060
|
display: {
|
|
@@ -6436,7 +8074,8 @@ var init_documents = __esm({
|
|
|
6436
8074
|
return;
|
|
6437
8075
|
}
|
|
6438
8076
|
printDocumentsTable(docs);
|
|
6439
|
-
}
|
|
8077
|
+
},
|
|
8078
|
+
examples: ["corp documents", "corp documents --json"]
|
|
6440
8079
|
},
|
|
6441
8080
|
// --- documents signing-link <doc-ref> ---
|
|
6442
8081
|
{
|
|
@@ -6468,7 +8107,8 @@ var init_documents = __esm({
|
|
|
6468
8107
|
printReferenceSummary("document", summaryRecord, { label: "Document Ref:" });
|
|
6469
8108
|
}
|
|
6470
8109
|
console.log(shareUrl);
|
|
6471
|
-
}
|
|
8110
|
+
},
|
|
8111
|
+
examples: ["corp documents signing-link", "corp documents signing-link --json"]
|
|
6472
8112
|
},
|
|
6473
8113
|
// --- documents sign <doc-ref> ---
|
|
6474
8114
|
{
|
|
@@ -6521,7 +8161,8 @@ var init_documents = __esm({
|
|
|
6521
8161
|
);
|
|
6522
8162
|
printReferenceSummary("document", result.document, { showReuseHint: true });
|
|
6523
8163
|
printJson(result.document);
|
|
6524
|
-
}
|
|
8164
|
+
},
|
|
8165
|
+
examples: ["corp documents sign <doc-ref>", "corp documents sign --json"]
|
|
6525
8166
|
},
|
|
6526
8167
|
// --- documents sign-all ---
|
|
6527
8168
|
{
|
|
@@ -6545,7 +8186,8 @@ var init_documents = __esm({
|
|
|
6545
8186
|
status: document.status,
|
|
6546
8187
|
signatures: Array.isArray(document.signatures) ? document.signatures.length : document.signatures
|
|
6547
8188
|
})));
|
|
6548
|
-
}
|
|
8189
|
+
},
|
|
8190
|
+
examples: ["corp documents sign-all"]
|
|
6549
8191
|
},
|
|
6550
8192
|
// --- documents generate ---
|
|
6551
8193
|
{
|
|
@@ -6576,6 +8218,11 @@ var init_documents = __esm({
|
|
|
6576
8218
|
if (!key) throw new Error(`Invalid --param value: ${raw}. Expected key=value.`);
|
|
6577
8219
|
parameters[key] = coerceParamValue(value);
|
|
6578
8220
|
}
|
|
8221
|
+
if (template === "employment_offer" && !parameters.base_salary) {
|
|
8222
|
+
throw new Error(
|
|
8223
|
+
"base_salary is required for employment_offer template.\n Use: --base-salary 150000\n Or: --param base_salary=150000"
|
|
8224
|
+
);
|
|
8225
|
+
}
|
|
6579
8226
|
try {
|
|
6580
8227
|
const result = await ctx.client.generateContract({
|
|
6581
8228
|
entity_id: eid,
|
|
@@ -6619,7 +8266,8 @@ var init_documents = __esm({
|
|
|
6619
8266
|
}
|
|
6620
8267
|
},
|
|
6621
8268
|
produces: { kind: "document" },
|
|
6622
|
-
successTemplate: "Document generated: {title}"
|
|
8269
|
+
successTemplate: "Document generated: {title}",
|
|
8270
|
+
examples: ["corp documents generate --template 'type' --counterparty 'name'", "corp documents generate --json"]
|
|
6623
8271
|
},
|
|
6624
8272
|
// --- documents preview-pdf ---
|
|
6625
8273
|
{
|
|
@@ -6642,7 +8290,8 @@ var init_documents = __esm({
|
|
|
6642
8290
|
const url = ctx.client.getPreviewPdfUrl(eid, documentId);
|
|
6643
8291
|
ctx.writer.success(`Preview PDF URL: ${url}`);
|
|
6644
8292
|
console.log("The document definition was validated successfully. Use your API key to download the PDF.");
|
|
6645
|
-
}
|
|
8293
|
+
},
|
|
8294
|
+
examples: ["corp documents preview-pdf", "corp documents preview-pdf --json"]
|
|
6646
8295
|
}
|
|
6647
8296
|
];
|
|
6648
8297
|
}
|
|
@@ -6708,12 +8357,13 @@ var init_compliance = __esm({
|
|
|
6708
8357
|
}
|
|
6709
8358
|
if (filings.length > 0) printTaxFilingsTable(filings);
|
|
6710
8359
|
if (deadlines.length > 0) printDeadlinesTable(deadlines);
|
|
6711
|
-
}
|
|
8360
|
+
},
|
|
8361
|
+
examples: ["corp tax", "corp tax --json"]
|
|
6712
8362
|
},
|
|
6713
8363
|
// --- tax filings ---
|
|
6714
8364
|
{
|
|
6715
8365
|
name: "tax filings",
|
|
6716
|
-
description: "
|
|
8366
|
+
description: "Create a tax filing record",
|
|
6717
8367
|
route: { method: "GET", path: "/v1/entities/{eid}/tax-filings" },
|
|
6718
8368
|
entity: true,
|
|
6719
8369
|
display: {
|
|
@@ -6733,7 +8383,8 @@ var init_compliance = __esm({
|
|
|
6733
8383
|
return;
|
|
6734
8384
|
}
|
|
6735
8385
|
printTaxFilingsTable(filings);
|
|
6736
|
-
}
|
|
8386
|
+
},
|
|
8387
|
+
examples: ["corp tax filings", "corp tax filings --json"]
|
|
6737
8388
|
},
|
|
6738
8389
|
// --- tax file ---
|
|
6739
8390
|
{
|
|
@@ -6748,17 +8399,21 @@ var init_compliance = __esm({
|
|
|
6748
8399
|
required: true,
|
|
6749
8400
|
choices: [...TAX_DOCUMENT_TYPE_CHOICES]
|
|
6750
8401
|
},
|
|
6751
|
-
{ flags: "--year <year>", description: "Tax year", required: true, type: "int" }
|
|
8402
|
+
{ flags: "--year <year>", description: "Tax year", required: true, type: "int" },
|
|
8403
|
+
{ flags: "--filer-contact-id <ref>", description: "Contact reference for per-person filings (e.g. 83(b) elections)" }
|
|
6752
8404
|
],
|
|
6753
8405
|
handler: async (ctx) => {
|
|
6754
8406
|
const eid = await ctx.resolver.resolveEntity(ctx.opts.entityId);
|
|
6755
8407
|
const rawType = ctx.opts.type;
|
|
6756
8408
|
const docType = TAX_DOCUMENT_TYPE_ALIASES[rawType] ?? rawType;
|
|
6757
|
-
const
|
|
8409
|
+
const filerContactId = ctx.opts.filerContactId ? await ctx.resolver.resolveContact(eid, ctx.opts.filerContactId) : void 0;
|
|
8410
|
+
const payload = {
|
|
6758
8411
|
entity_id: eid,
|
|
6759
8412
|
document_type: docType,
|
|
6760
8413
|
tax_year: ctx.opts.year
|
|
6761
|
-
}
|
|
8414
|
+
};
|
|
8415
|
+
if (filerContactId) payload.filer_contact_id = filerContactId;
|
|
8416
|
+
const result = await ctx.client.fileTaxDocument(payload);
|
|
6762
8417
|
await ctx.resolver.stabilizeRecord("tax_filing", result, eid);
|
|
6763
8418
|
ctx.resolver.rememberFromRecord("tax_filing", result, eid);
|
|
6764
8419
|
ctx.writer.writeResult(result, `Tax document filed: ${result.filing_id ?? "OK"}`, {
|
|
@@ -6768,7 +8423,8 @@ var init_compliance = __esm({
|
|
|
6768
8423
|
});
|
|
6769
8424
|
},
|
|
6770
8425
|
produces: { kind: "tax_filing" },
|
|
6771
|
-
successTemplate: "Tax filing created"
|
|
8426
|
+
successTemplate: "Tax filing created",
|
|
8427
|
+
examples: ["corp tax file --year 'year'"]
|
|
6772
8428
|
},
|
|
6773
8429
|
// --- tax deadlines ---
|
|
6774
8430
|
{
|
|
@@ -6793,7 +8449,8 @@ var init_compliance = __esm({
|
|
|
6793
8449
|
return;
|
|
6794
8450
|
}
|
|
6795
8451
|
printDeadlinesTable(deadlines);
|
|
6796
|
-
}
|
|
8452
|
+
},
|
|
8453
|
+
examples: ["corp tax deadlines", "corp tax deadlines --json"]
|
|
6797
8454
|
},
|
|
6798
8455
|
// --- tax deadline ---
|
|
6799
8456
|
{
|
|
@@ -6804,7 +8461,7 @@ var init_compliance = __esm({
|
|
|
6804
8461
|
options: [
|
|
6805
8462
|
{ flags: "--type <type>", description: "Deadline type", required: true },
|
|
6806
8463
|
{ flags: "--due-date <date>", description: "Due date (ISO 8601)", required: true },
|
|
6807
|
-
{ flags: "--description <desc>", description: "Description", required: true },
|
|
8464
|
+
{ flags: "--description <desc>", description: "Description text", required: true },
|
|
6808
8465
|
{ flags: "--recurrence <recurrence>", description: "Recurrence (e.g. annual; 'yearly' is normalized). Required for annual_report type." }
|
|
6809
8466
|
],
|
|
6810
8467
|
handler: async (ctx) => {
|
|
@@ -6830,7 +8487,83 @@ var init_compliance = __esm({
|
|
|
6830
8487
|
});
|
|
6831
8488
|
},
|
|
6832
8489
|
produces: { kind: "deadline" },
|
|
6833
|
-
successTemplate: "Deadline tracked"
|
|
8490
|
+
successTemplate: "Deadline tracked",
|
|
8491
|
+
examples: ["corp tax deadline --type 'type' --due-date 'date' --description 'desc'", "corp tax deadline --json"]
|
|
8492
|
+
},
|
|
8493
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
8494
|
+
{
|
|
8495
|
+
name: "compliance escalations-scan",
|
|
8496
|
+
description: "Scan for compliance issues and create escalations",
|
|
8497
|
+
route: { method: "POST", path: "/v1/compliance/escalations/scan" },
|
|
8498
|
+
examples: ["corp compliance escalations-scan"],
|
|
8499
|
+
successTemplate: "Escalations Scan created"
|
|
8500
|
+
},
|
|
8501
|
+
{
|
|
8502
|
+
name: "compliance escalations-resolve-with-evidence",
|
|
8503
|
+
description: "Resolve a compliance escalation with evidence",
|
|
8504
|
+
route: { method: "POST", path: "/v1/compliance/escalations/{pos}/resolve-with-evidence" },
|
|
8505
|
+
args: [{ name: "escalation-id", required: true, description: "Escalation ID" }],
|
|
8506
|
+
options: [
|
|
8507
|
+
{ flags: "--evidence-type <evidence-type>", description: "Evidence Type" },
|
|
8508
|
+
{ flags: "--filing-reference <filing-reference>", description: "Filing Reference" },
|
|
8509
|
+
{ flags: "--notes <notes>", description: "Additional notes" },
|
|
8510
|
+
{ flags: "--packet-id <packet-id>", description: "Document packet ID" },
|
|
8511
|
+
{ flags: "--resolve-incident", description: "Resolve Incident" },
|
|
8512
|
+
{ flags: "--resolve-obligation", description: "Resolve Obligation" }
|
|
8513
|
+
],
|
|
8514
|
+
examples: ["corp compliance escalations-resolve-with-evidence <escalation-id>", "corp compliance escalations-resolve-with-evidence --json"],
|
|
8515
|
+
successTemplate: "Escalations Resolve With Evidence created"
|
|
8516
|
+
},
|
|
8517
|
+
{
|
|
8518
|
+
name: "contractors classify",
|
|
8519
|
+
description: "Classify a worker as employee or contractor",
|
|
8520
|
+
route: { method: "POST", path: "/v1/contractors/classify" },
|
|
8521
|
+
entity: true,
|
|
8522
|
+
options: [
|
|
8523
|
+
{ flags: "--contractor-name <contractor-name>", description: "Contractor Name", required: true },
|
|
8524
|
+
{ flags: "--duration-months <duration-months>", description: "Duration Months" },
|
|
8525
|
+
{ flags: "--exclusive-client <exclusive-client>", description: "Exclusive Client" },
|
|
8526
|
+
{ flags: "--factors <factors>", description: "Factors" },
|
|
8527
|
+
{ flags: "--hours-per-week <hours-per-week>", description: "Hours Per Week" },
|
|
8528
|
+
{ flags: "--provides-tools <provides-tools>", description: "Provides Tools" },
|
|
8529
|
+
{ flags: "--state <state>", description: "State" }
|
|
8530
|
+
],
|
|
8531
|
+
examples: ["corp contractors classify --contractor-name 'contractor-name'", "corp contractors classify --json"],
|
|
8532
|
+
successTemplate: "Classify created"
|
|
8533
|
+
},
|
|
8534
|
+
{
|
|
8535
|
+
name: "deadlines",
|
|
8536
|
+
description: "Create a compliance deadline",
|
|
8537
|
+
route: { method: "POST", path: "/v1/deadlines" },
|
|
8538
|
+
options: [
|
|
8539
|
+
{ flags: "--deadline-type <deadline-type>", description: "Deadline Type", required: true },
|
|
8540
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
8541
|
+
{ flags: "--due-date <due-date>", description: "Due date (ISO 8601, e.g. 2026-06-30)", required: true },
|
|
8542
|
+
{ flags: "--recurrence <recurrence>", description: "Recurrence pattern for a deadline.", choices: ["one_time", "monthly", "quarterly", "annual"] },
|
|
8543
|
+
{ flags: "--severity <severity>", description: "Risk severity of missing a deadline.", choices: ["low", "medium", "high", "critical"] }
|
|
8544
|
+
],
|
|
8545
|
+
examples: ["corp deadlines --deadline-type 'deadline-type' --description 'description' --due-date one_time", "corp deadlines --json"],
|
|
8546
|
+
successTemplate: "Deadlines created"
|
|
8547
|
+
},
|
|
8548
|
+
{
|
|
8549
|
+
name: "entities compliance-escalations",
|
|
8550
|
+
description: "List compliance escalations for an entity",
|
|
8551
|
+
route: { method: "GET", path: "/v1/entities/{eid}/compliance/escalations" },
|
|
8552
|
+
entity: true,
|
|
8553
|
+
display: { title: "Entities Compliance Escalations", cols: ["action>Action", "authority>Authority", "milestone>Milestone", "@created_at>Created At", "#deadline_id>ID"] },
|
|
8554
|
+
examples: ["corp entities compliance-escalations", "corp entities compliance-escalations --json"]
|
|
8555
|
+
},
|
|
8556
|
+
{
|
|
8557
|
+
name: "tax create-filing",
|
|
8558
|
+
description: "Create a tax filing record",
|
|
8559
|
+
route: { method: "POST", path: "/v1/tax/filings" },
|
|
8560
|
+
entity: true,
|
|
8561
|
+
options: [
|
|
8562
|
+
{ flags: "--document-type <document-type>", description: "Type of document required", required: true },
|
|
8563
|
+
{ flags: "--tax-year <tax-year>", description: "Tax Year", required: true, type: "int" }
|
|
8564
|
+
],
|
|
8565
|
+
examples: ["corp tax filings --document-type 'document-type' --tax-year 'tax-year'"],
|
|
8566
|
+
successTemplate: "Filings created"
|
|
6834
8567
|
}
|
|
6835
8568
|
];
|
|
6836
8569
|
}
|
|
@@ -6932,7 +8665,8 @@ var init_agents = __esm({
|
|
|
6932
8665
|
console.log(` ${chalk9.bold("Skills:")} ${agent.skills.map((s3) => s3.name ?? "?").join(", ")}`);
|
|
6933
8666
|
}
|
|
6934
8667
|
console.log(chalk9.magenta("\u2500".repeat(40)));
|
|
6935
|
-
}
|
|
8668
|
+
},
|
|
8669
|
+
examples: ["corp agents show"]
|
|
6936
8670
|
},
|
|
6937
8671
|
// --- agents create ---
|
|
6938
8672
|
{
|
|
@@ -6942,7 +8676,7 @@ var init_agents = __esm({
|
|
|
6942
8676
|
options: [
|
|
6943
8677
|
{ flags: "--name <name>", description: "Agent name", required: true },
|
|
6944
8678
|
{ flags: "--prompt <prompt>", description: "System prompt", required: true },
|
|
6945
|
-
{ flags: "--model <model>", description: "
|
|
8679
|
+
{ flags: "--model <model>", description: "LLM model name" }
|
|
6946
8680
|
],
|
|
6947
8681
|
handler: async (ctx) => {
|
|
6948
8682
|
const data = {
|
|
@@ -6973,12 +8707,13 @@ var init_agents = __esm({
|
|
|
6973
8707
|
}
|
|
6974
8708
|
},
|
|
6975
8709
|
produces: { kind: "agent" },
|
|
6976
|
-
successTemplate: "Agent created: {name}"
|
|
8710
|
+
successTemplate: "Agent created: {name}",
|
|
8711
|
+
examples: ["corp agents create --name 'name' --prompt 'prompt'", "corp agents create --json"]
|
|
6977
8712
|
},
|
|
6978
8713
|
// --- agents pause <agent-ref> ---
|
|
6979
8714
|
{
|
|
6980
8715
|
name: "agents pause",
|
|
6981
|
-
description: "Pause an agent",
|
|
8716
|
+
description: "Pause an active agent",
|
|
6982
8717
|
route: { method: "POST", path: "/v1/agents/{pos}/pause" },
|
|
6983
8718
|
args: [{ name: "agent-ref", required: true, description: "Agent reference" }],
|
|
6984
8719
|
handler: async (ctx) => {
|
|
@@ -6986,7 +8721,8 @@ var init_agents = __esm({
|
|
|
6986
8721
|
const resolvedAgentId = await ctx.resolver.resolveAgent(agentRef);
|
|
6987
8722
|
const result = await ctx.client.updateAgent(resolvedAgentId, { status: "paused" });
|
|
6988
8723
|
ctx.writer.writeResult(result, `Agent ${resolvedAgentId} paused.`, { jsonOnly: ctx.opts.json });
|
|
6989
|
-
}
|
|
8724
|
+
},
|
|
8725
|
+
examples: ["corp agents pause <agent-ref>"]
|
|
6990
8726
|
},
|
|
6991
8727
|
// --- agents resume <agent-ref> ---
|
|
6992
8728
|
{
|
|
@@ -7013,7 +8749,8 @@ var init_agents = __esm({
|
|
|
7013
8749
|
}
|
|
7014
8750
|
process.exit(1);
|
|
7015
8751
|
}
|
|
7016
|
-
}
|
|
8752
|
+
},
|
|
8753
|
+
examples: ["corp agents resume <agent-ref>"]
|
|
7017
8754
|
},
|
|
7018
8755
|
// --- agents delete <agent-ref> ---
|
|
7019
8756
|
{
|
|
@@ -7039,7 +8776,8 @@ var init_agents = __esm({
|
|
|
7039
8776
|
}
|
|
7040
8777
|
const result = await ctx.client.deleteAgent(resolvedAgentId);
|
|
7041
8778
|
ctx.writer.writeResult(result, `Agent ${resolvedAgentId} deleted.`, { jsonOnly: ctx.opts.json });
|
|
7042
|
-
}
|
|
8779
|
+
},
|
|
8780
|
+
examples: ["corp agents delete <agent-ref>", "corp agents delete --json"]
|
|
7043
8781
|
},
|
|
7044
8782
|
// --- agents message <agent-ref> ---
|
|
7045
8783
|
{
|
|
@@ -7070,7 +8808,8 @@ var init_agents = __esm({
|
|
|
7070
8808
|
}
|
|
7071
8809
|
process.exit(1);
|
|
7072
8810
|
}
|
|
7073
|
-
}
|
|
8811
|
+
},
|
|
8812
|
+
examples: ["corp agents message <agent-ref>", "corp agents message --json"]
|
|
7074
8813
|
},
|
|
7075
8814
|
// --- agents skill <agent-ref> ---
|
|
7076
8815
|
{
|
|
@@ -7081,7 +8820,7 @@ var init_agents = __esm({
|
|
|
7081
8820
|
options: [
|
|
7082
8821
|
{ flags: "--name <name>", description: "Skill name", required: true },
|
|
7083
8822
|
{ flags: "--description <desc>", description: "Skill description", required: true },
|
|
7084
|
-
{ flags: "--instructions <text>", description: "
|
|
8823
|
+
{ flags: "--instructions <text>", description: "Skill instructions text" },
|
|
7085
8824
|
{ flags: "--instructions-file <path>", description: "Read skill instructions from a file" }
|
|
7086
8825
|
],
|
|
7087
8826
|
handler: async (ctx) => {
|
|
@@ -7098,7 +8837,8 @@ var init_agents = __esm({
|
|
|
7098
8837
|
parameters: instructions ? { instructions } : {}
|
|
7099
8838
|
});
|
|
7100
8839
|
ctx.writer.writeResult(result, `Skill '${ctx.opts.name}' added to agent ${resolvedAgentId}.`, { jsonOnly: ctx.opts.json });
|
|
7101
|
-
}
|
|
8840
|
+
},
|
|
8841
|
+
examples: ["corp agents skill <agent-ref> --name 'name' --description 'desc'", "corp agents skill --json"]
|
|
7102
8842
|
},
|
|
7103
8843
|
// --- agents execution <agent-ref> <execution-id> ---
|
|
7104
8844
|
{
|
|
@@ -7128,7 +8868,8 @@ var init_agents = __esm({
|
|
|
7128
8868
|
if (result.started_at) console.log(` ${chalk9.bold("Started:")} ${result.started_at}`);
|
|
7129
8869
|
if (result.completed_at) console.log(` ${chalk9.bold("Completed:")} ${result.completed_at}`);
|
|
7130
8870
|
console.log(chalk9.magenta("\u2500".repeat(40)));
|
|
7131
|
-
}
|
|
8871
|
+
},
|
|
8872
|
+
examples: ["corp agents execution"]
|
|
7132
8873
|
},
|
|
7133
8874
|
// --- agents execution-result <agent-ref> <execution-id> ---
|
|
7134
8875
|
{
|
|
@@ -7151,7 +8892,8 @@ var init_agents = __esm({
|
|
|
7151
8892
|
}
|
|
7152
8893
|
ctx.writer.success(`Result for execution ${executionId}:`);
|
|
7153
8894
|
printJson(result);
|
|
7154
|
-
}
|
|
8895
|
+
},
|
|
8896
|
+
examples: ["corp agents execution-result"]
|
|
7155
8897
|
},
|
|
7156
8898
|
// --- agents kill <agent-ref> <execution-id> ---
|
|
7157
8899
|
{
|
|
@@ -7178,7 +8920,26 @@ var init_agents = __esm({
|
|
|
7178
8920
|
}
|
|
7179
8921
|
const result = await ctx.client.killAgentExecution(resolvedAgentId, executionId);
|
|
7180
8922
|
ctx.writer.writeResult(result, `Execution ${executionId} killed.`, { jsonOnly: ctx.opts.json });
|
|
7181
|
-
}
|
|
8923
|
+
},
|
|
8924
|
+
examples: ["corp agents kill <agent-ref> <execution-id>", "corp agents kill --json"]
|
|
8925
|
+
},
|
|
8926
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
8927
|
+
{
|
|
8928
|
+
name: "agents executions-logs",
|
|
8929
|
+
description: "View execution logs for an agent run",
|
|
8930
|
+
route: { method: "GET", path: "/v1/agents/{pos}/executions/{pos2}/logs" },
|
|
8931
|
+
args: [{ name: "agent-id", required: true, description: "Agent ID" }, { name: "execution-id", required: true, description: "Agent execution ID" }],
|
|
8932
|
+
display: { title: "Execution Logs", cols: ["@timestamp>Time", "level>Level", "message>Message"] },
|
|
8933
|
+
examples: ["corp agents executions-logs"]
|
|
8934
|
+
},
|
|
8935
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
8936
|
+
{
|
|
8937
|
+
name: "agents messages",
|
|
8938
|
+
description: "View a specific agent message",
|
|
8939
|
+
route: { method: "GET", path: "/v1/agents/{pos}/messages/{pos2}" },
|
|
8940
|
+
args: [{ name: "agent-id", required: true, description: "Agent ID" }, { name: "message-id", required: true, description: "Message Id" }],
|
|
8941
|
+
display: { title: "Agent Message" },
|
|
8942
|
+
examples: ["corp agents messages"]
|
|
7182
8943
|
}
|
|
7183
8944
|
];
|
|
7184
8945
|
}
|
|
@@ -7284,7 +9045,8 @@ var init_work_items = __esm({
|
|
|
7284
9045
|
if (createdBy) console.log(` ${chalk10.bold("Created by:")} ${createdBy}`);
|
|
7285
9046
|
console.log(` ${chalk10.bold("Created at:")} ${w.created_at ?? "N/A"}`);
|
|
7286
9047
|
console.log(chalk10.cyan("\u2500".repeat(40)));
|
|
7287
|
-
}
|
|
9048
|
+
},
|
|
9049
|
+
examples: ["corp work-items show", "corp work-items show --json"]
|
|
7288
9050
|
},
|
|
7289
9051
|
// --- work-items create ---
|
|
7290
9052
|
{
|
|
@@ -7294,8 +9056,8 @@ var init_work_items = __esm({
|
|
|
7294
9056
|
entity: true,
|
|
7295
9057
|
options: [
|
|
7296
9058
|
{ flags: "--title <title>", description: "Work item title", required: true },
|
|
7297
|
-
{ flags: "--category <category>", description: "Work item category" },
|
|
7298
|
-
{ flags: "--description <desc>", description: "Description" },
|
|
9059
|
+
{ flags: "--category <category>", description: "Work item category", required: true },
|
|
9060
|
+
{ flags: "--description <desc>", description: "Description text" },
|
|
7299
9061
|
{ flags: "--deadline <date>", description: "Deadline (YYYY-MM-DD)" },
|
|
7300
9062
|
{ flags: "--asap", description: "Mark as ASAP priority" },
|
|
7301
9063
|
{ flags: "--created-by <name>", description: "Creator identifier" }
|
|
@@ -7322,7 +9084,8 @@ var init_work_items = __esm({
|
|
|
7322
9084
|
);
|
|
7323
9085
|
},
|
|
7324
9086
|
produces: { kind: "work_item" },
|
|
7325
|
-
successTemplate: "Work item created: {title}"
|
|
9087
|
+
successTemplate: "Work item created: {title}",
|
|
9088
|
+
examples: ["corp work-items create --title 'title'", "corp work-items create --json"]
|
|
7326
9089
|
},
|
|
7327
9090
|
// --- work-items claim <item-ref> ---
|
|
7328
9091
|
{
|
|
@@ -7351,7 +9114,8 @@ var init_work_items = __esm({
|
|
|
7351
9114
|
if (ctx.opts.ttl != null) data.ttl_seconds = ctx.opts.ttl;
|
|
7352
9115
|
const result = await ctx.client.claimWorkItem(eid, resolvedWorkItemId, data);
|
|
7353
9116
|
ctx.writer.writeResult(result, `Work item ${resolvedWorkItemId} claimed by ${claimedBy}.`, { jsonOnly: ctx.opts.json });
|
|
7354
|
-
}
|
|
9117
|
+
},
|
|
9118
|
+
examples: ["corp work-items claim <item-ref>", "corp work-items claim --json"]
|
|
7355
9119
|
},
|
|
7356
9120
|
// --- work-items complete <item-ref> ---
|
|
7357
9121
|
{
|
|
@@ -7382,7 +9146,8 @@ var init_work_items = __esm({
|
|
|
7382
9146
|
if (resultText) data.result = resultText;
|
|
7383
9147
|
const result = await ctx.client.completeWorkItem(eid, resolvedWorkItemId, data);
|
|
7384
9148
|
ctx.writer.writeResult(result, `Work item ${resolvedWorkItemId} completed.`, { jsonOnly: ctx.opts.json });
|
|
7385
|
-
}
|
|
9149
|
+
},
|
|
9150
|
+
examples: ["corp work-items complete <item-ref>", "corp work-items complete --json"]
|
|
7386
9151
|
},
|
|
7387
9152
|
// --- work-items release <item-ref> ---
|
|
7388
9153
|
{
|
|
@@ -7397,7 +9162,8 @@ var init_work_items = __esm({
|
|
|
7397
9162
|
const resolvedWorkItemId = await ctx.resolver.resolveWorkItem(eid, itemRef);
|
|
7398
9163
|
const result = await ctx.client.releaseWorkItem(eid, resolvedWorkItemId);
|
|
7399
9164
|
ctx.writer.writeResult(result, `Work item ${resolvedWorkItemId} claim released.`, { jsonOnly: ctx.opts.json });
|
|
7400
|
-
}
|
|
9165
|
+
},
|
|
9166
|
+
examples: ["corp work-items release <item-ref>"]
|
|
7401
9167
|
},
|
|
7402
9168
|
// --- work-items cancel <item-ref> ---
|
|
7403
9169
|
{
|
|
@@ -7425,7 +9191,8 @@ var init_work_items = __esm({
|
|
|
7425
9191
|
}
|
|
7426
9192
|
const result = await ctx.client.cancelWorkItem(eid, resolvedWorkItemId);
|
|
7427
9193
|
ctx.writer.writeResult(result, `Work item ${resolvedWorkItemId} cancelled.`, { jsonOnly: ctx.opts.json });
|
|
7428
|
-
}
|
|
9194
|
+
},
|
|
9195
|
+
examples: ["corp work-items cancel <item-ref>", "corp work-items cancel --json"]
|
|
7429
9196
|
}
|
|
7430
9197
|
];
|
|
7431
9198
|
}
|
|
@@ -7456,7 +9223,8 @@ var init_services = __esm({
|
|
|
7456
9223
|
return;
|
|
7457
9224
|
}
|
|
7458
9225
|
printServiceCatalogTable(items);
|
|
7459
|
-
}
|
|
9226
|
+
},
|
|
9227
|
+
examples: ["corp services", "corp services --json"]
|
|
7460
9228
|
},
|
|
7461
9229
|
// --- services catalog ---
|
|
7462
9230
|
{
|
|
@@ -7474,7 +9242,8 @@ var init_services = __esm({
|
|
|
7474
9242
|
return;
|
|
7475
9243
|
}
|
|
7476
9244
|
printServiceCatalogTable(items);
|
|
7477
|
-
}
|
|
9245
|
+
},
|
|
9246
|
+
examples: ["corp services catalog"]
|
|
7478
9247
|
},
|
|
7479
9248
|
// --- services list ---
|
|
7480
9249
|
{
|
|
@@ -7495,7 +9264,8 @@ var init_services = __esm({
|
|
|
7495
9264
|
return;
|
|
7496
9265
|
}
|
|
7497
9266
|
printServiceRequestsTable(stable);
|
|
7498
|
-
}
|
|
9267
|
+
},
|
|
9268
|
+
examples: ["corp services list", "corp services list --json"]
|
|
7499
9269
|
},
|
|
7500
9270
|
// --- services show <ref> ---
|
|
7501
9271
|
{
|
|
@@ -7518,7 +9288,8 @@ var init_services = __esm({
|
|
|
7518
9288
|
}
|
|
7519
9289
|
printReferenceSummary("service_request", result);
|
|
7520
9290
|
printJson(result);
|
|
7521
|
-
}
|
|
9291
|
+
},
|
|
9292
|
+
examples: ["corp services show", "corp services show --json"]
|
|
7522
9293
|
},
|
|
7523
9294
|
// --- services buy <slug> ---
|
|
7524
9295
|
{
|
|
@@ -7563,7 +9334,8 @@ var init_services = __esm({
|
|
|
7563
9334
|
}
|
|
7564
9335
|
},
|
|
7565
9336
|
produces: { kind: "service_request" },
|
|
7566
|
-
successTemplate: "Service request created"
|
|
9337
|
+
successTemplate: "Service request created",
|
|
9338
|
+
examples: ["corp services buy <slug>"]
|
|
7567
9339
|
},
|
|
7568
9340
|
// --- services fulfill <ref> ---
|
|
7569
9341
|
{
|
|
@@ -7592,7 +9364,8 @@ var init_services = __esm({
|
|
|
7592
9364
|
ctx.writer.success(`Service request fulfilled: ${requestId}`);
|
|
7593
9365
|
printReferenceSummary("service_request", result, { showReuseHint: true });
|
|
7594
9366
|
printJson(result);
|
|
7595
|
-
}
|
|
9367
|
+
},
|
|
9368
|
+
examples: ["corp services fulfill <ref>", "corp services fulfill --json"]
|
|
7596
9369
|
},
|
|
7597
9370
|
// --- services cancel <ref> ---
|
|
7598
9371
|
{
|
|
@@ -7617,7 +9390,56 @@ var init_services = __esm({
|
|
|
7617
9390
|
ctx.writer.success(`Service request cancelled: ${requestId}`);
|
|
7618
9391
|
printReferenceSummary("service_request", result, { showReuseHint: true });
|
|
7619
9392
|
printJson(result);
|
|
7620
|
-
}
|
|
9393
|
+
},
|
|
9394
|
+
examples: ["corp services cancel <ref>"]
|
|
9395
|
+
},
|
|
9396
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
9397
|
+
{
|
|
9398
|
+
name: "services create-request",
|
|
9399
|
+
description: "Submit a new service request",
|
|
9400
|
+
route: { method: "POST", path: "/v1/services/requests" },
|
|
9401
|
+
options: [
|
|
9402
|
+
{ flags: "--obligation-id <obligation-id>", description: "Obligation ID" },
|
|
9403
|
+
{ flags: "--service-slug <service-slug>", description: "Service Slug", required: true }
|
|
9404
|
+
],
|
|
9405
|
+
examples: ["corp services requests --service-slug 'service-slug'", "corp services requests --json"],
|
|
9406
|
+
successTemplate: "Requests created"
|
|
9407
|
+
},
|
|
9408
|
+
{
|
|
9409
|
+
name: "services requests",
|
|
9410
|
+
description: "Submit a new service request",
|
|
9411
|
+
route: { method: "GET", path: "/v1/services/requests/{pos}" },
|
|
9412
|
+
entity: true,
|
|
9413
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
9414
|
+
display: { title: "Services Requests", cols: ["amount_cents>Amount Cents", "checkout_url>Checkout Url", "failed_at>Failed At", "fulfilled_at>Fulfilled At", "@created_at>Created At", "#entity_id>ID"] },
|
|
9415
|
+
examples: ["corp services requests", "corp services requests --json"]
|
|
9416
|
+
},
|
|
9417
|
+
{
|
|
9418
|
+
name: "services requests-cancel",
|
|
9419
|
+
description: "Cancel a service request",
|
|
9420
|
+
route: { method: "POST", path: "/v1/services/requests/{pos}/cancel" },
|
|
9421
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
9422
|
+
examples: ["corp services requests-cancel <request-id>"],
|
|
9423
|
+
successTemplate: "Requests Cancel created"
|
|
9424
|
+
},
|
|
9425
|
+
{
|
|
9426
|
+
name: "services requests-checkout",
|
|
9427
|
+
description: "Start checkout for a service request",
|
|
9428
|
+
route: { method: "POST", path: "/v1/services/requests/{pos}/checkout" },
|
|
9429
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
9430
|
+
examples: ["corp services requests-checkout <request-id>"],
|
|
9431
|
+
successTemplate: "Requests Checkout created"
|
|
9432
|
+
},
|
|
9433
|
+
{
|
|
9434
|
+
name: "services requests-fulfill",
|
|
9435
|
+
description: "Fulfill a service request",
|
|
9436
|
+
route: { method: "POST", path: "/v1/services/requests/{pos}/fulfill" },
|
|
9437
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
9438
|
+
options: [
|
|
9439
|
+
{ flags: "--note <note>", description: "Note" }
|
|
9440
|
+
],
|
|
9441
|
+
examples: ["corp services requests-fulfill <request-id>", "corp services requests-fulfill --json"],
|
|
9442
|
+
successTemplate: "Requests Fulfill created"
|
|
7621
9443
|
}
|
|
7622
9444
|
];
|
|
7623
9445
|
}
|
|
@@ -9055,13 +10877,15 @@ var init_admin = __esm({
|
|
|
9055
10877
|
handler: async () => {
|
|
9056
10878
|
const { setupCommand: setupCommand2 } = await Promise.resolve().then(() => (init_setup(), setup_exports));
|
|
9057
10879
|
await setupCommand2();
|
|
9058
|
-
}
|
|
10880
|
+
},
|
|
10881
|
+
examples: ["corp setup"]
|
|
9059
10882
|
},
|
|
9060
10883
|
// ── config (local) ──────────────────────────────────────────────────
|
|
9061
10884
|
{
|
|
9062
10885
|
name: "config",
|
|
9063
10886
|
description: "Manage configuration",
|
|
9064
|
-
local: true
|
|
10887
|
+
local: true,
|
|
10888
|
+
examples: ["corp config"]
|
|
9065
10889
|
},
|
|
9066
10890
|
{
|
|
9067
10891
|
name: "config set",
|
|
@@ -9081,7 +10905,8 @@ var init_admin = __esm({
|
|
|
9081
10905
|
ctx.positional[1],
|
|
9082
10906
|
{ force: ctx.opts.force }
|
|
9083
10907
|
);
|
|
9084
|
-
}
|
|
10908
|
+
},
|
|
10909
|
+
examples: ["corp config set"]
|
|
9085
10910
|
},
|
|
9086
10911
|
{
|
|
9087
10912
|
name: "config get",
|
|
@@ -9093,7 +10918,8 @@ var init_admin = __esm({
|
|
|
9093
10918
|
handler: async (ctx) => {
|
|
9094
10919
|
const { configGetCommand: configGetCommand2 } = await Promise.resolve().then(() => (init_config2(), config_exports));
|
|
9095
10920
|
configGetCommand2(ctx.positional[0]);
|
|
9096
|
-
}
|
|
10921
|
+
},
|
|
10922
|
+
examples: ["corp config get"]
|
|
9097
10923
|
},
|
|
9098
10924
|
{
|
|
9099
10925
|
name: "config list",
|
|
@@ -9102,7 +10928,8 @@ var init_admin = __esm({
|
|
|
9102
10928
|
handler: async () => {
|
|
9103
10929
|
const { configListCommand: configListCommand2 } = await Promise.resolve().then(() => (init_config2(), config_exports));
|
|
9104
10930
|
configListCommand2();
|
|
9105
|
-
}
|
|
10931
|
+
},
|
|
10932
|
+
examples: ["corp config list"]
|
|
9106
10933
|
},
|
|
9107
10934
|
// ── schema (local, special) ─────────────────────────────────────────
|
|
9108
10935
|
{
|
|
@@ -9134,7 +10961,8 @@ var init_admin = __esm({
|
|
|
9134
10961
|
} else {
|
|
9135
10962
|
ctx.writer.json(schema);
|
|
9136
10963
|
}
|
|
9137
|
-
}
|
|
10964
|
+
},
|
|
10965
|
+
examples: ["corp schema"]
|
|
9138
10966
|
},
|
|
9139
10967
|
// ── serve (local, complex) ──────────────────────────────────────────
|
|
9140
10968
|
{
|
|
@@ -9151,7 +10979,8 @@ var init_admin = __esm({
|
|
|
9151
10979
|
port: ctx.opts.port ?? "8000",
|
|
9152
10980
|
dataDir: ctx.opts.dataDir ?? "./data/repos"
|
|
9153
10981
|
});
|
|
9154
|
-
}
|
|
10982
|
+
},
|
|
10983
|
+
examples: ["corp serve"]
|
|
9155
10984
|
},
|
|
9156
10985
|
// ── demo (complex, uses API) ────────────────────────────────────────
|
|
9157
10986
|
{
|
|
@@ -9172,7 +11001,8 @@ var init_admin = __esm({
|
|
|
9172
11001
|
minimal: ctx.opts.minimal,
|
|
9173
11002
|
json: ctx.opts.json
|
|
9174
11003
|
});
|
|
9175
|
-
}
|
|
11004
|
+
},
|
|
11005
|
+
examples: ["corp demo"]
|
|
9176
11006
|
},
|
|
9177
11007
|
// ── chat (local, interactive) ───────────────────────────────────────
|
|
9178
11008
|
{
|
|
@@ -9182,7 +11012,8 @@ var init_admin = __esm({
|
|
|
9182
11012
|
handler: async () => {
|
|
9183
11013
|
const { chatCommand: chatCommand2 } = await Promise.resolve().then(() => (init_chat(), chat_exports));
|
|
9184
11014
|
await chatCommand2();
|
|
9185
|
-
}
|
|
11015
|
+
},
|
|
11016
|
+
examples: ["corp chat"]
|
|
9186
11017
|
},
|
|
9187
11018
|
// ── api-keys (API, parent + subcommands) ────────────────────────────
|
|
9188
11019
|
{
|
|
@@ -9196,7 +11027,8 @@ var init_admin = __esm({
|
|
|
9196
11027
|
handler: async (ctx) => {
|
|
9197
11028
|
const { apiKeysListCommand: apiKeysListCommand2 } = await Promise.resolve().then(() => (init_api_keys(), api_keys_exports));
|
|
9198
11029
|
await apiKeysListCommand2({ json: ctx.opts.json });
|
|
9199
|
-
}
|
|
11030
|
+
},
|
|
11031
|
+
examples: ["corp api-keys"]
|
|
9200
11032
|
},
|
|
9201
11033
|
{
|
|
9202
11034
|
name: "api-keys create",
|
|
@@ -9216,7 +11048,8 @@ var init_admin = __esm({
|
|
|
9216
11048
|
});
|
|
9217
11049
|
},
|
|
9218
11050
|
produces: { kind: "api_key" },
|
|
9219
|
-
successTemplate: "API key created"
|
|
11051
|
+
successTemplate: "API key created",
|
|
11052
|
+
examples: ["corp api-keys create --name 'name'", "corp api-keys create --json"]
|
|
9220
11053
|
},
|
|
9221
11054
|
{
|
|
9222
11055
|
name: "api-keys revoke",
|
|
@@ -9235,7 +11068,8 @@ var init_admin = __esm({
|
|
|
9235
11068
|
yes: ctx.opts.yes,
|
|
9236
11069
|
json: ctx.opts.json
|
|
9237
11070
|
});
|
|
9238
|
-
}
|
|
11071
|
+
},
|
|
11072
|
+
examples: ["corp api-keys revoke <key-id>", "corp api-keys revoke --json"]
|
|
9239
11073
|
},
|
|
9240
11074
|
{
|
|
9241
11075
|
name: "api-keys rotate",
|
|
@@ -9254,7 +11088,8 @@ var init_admin = __esm({
|
|
|
9254
11088
|
});
|
|
9255
11089
|
},
|
|
9256
11090
|
produces: { kind: "api_key" },
|
|
9257
|
-
successTemplate: "API key rotated"
|
|
11091
|
+
successTemplate: "API key rotated",
|
|
11092
|
+
examples: ["corp api-keys rotate <key-id>", "corp api-keys rotate --json"]
|
|
9258
11093
|
},
|
|
9259
11094
|
// ── link (API, write) ───────────────────────────────────────────────
|
|
9260
11095
|
{
|
|
@@ -9271,7 +11106,8 @@ var init_admin = __esm({
|
|
|
9271
11106
|
externalId: ctx.opts.externalId,
|
|
9272
11107
|
provider: ctx.opts.provider
|
|
9273
11108
|
});
|
|
9274
|
-
}
|
|
11109
|
+
},
|
|
11110
|
+
examples: ["corp link --external-id 'id' --provider 'provider'"]
|
|
9275
11111
|
},
|
|
9276
11112
|
// ── claim (API, write) ──────────────────────────────────────────────
|
|
9277
11113
|
{
|
|
@@ -9285,7 +11121,8 @@ var init_admin = __esm({
|
|
|
9285
11121
|
const { claimCommand: claimCommand2 } = await Promise.resolve().then(() => (init_claim(), claim_exports));
|
|
9286
11122
|
await claimCommand2(ctx.positional[0]);
|
|
9287
11123
|
},
|
|
9288
|
-
produces: { kind: "entity", trackEntity: true }
|
|
11124
|
+
produces: { kind: "entity", trackEntity: true },
|
|
11125
|
+
examples: ["corp claim <code>"]
|
|
9289
11126
|
},
|
|
9290
11127
|
// ── feedback (API, write) ───────────────────────────────────────────
|
|
9291
11128
|
{
|
|
@@ -9306,7 +11143,8 @@ var init_admin = __esm({
|
|
|
9306
11143
|
email: ctx.opts.email,
|
|
9307
11144
|
json: ctx.opts.json
|
|
9308
11145
|
});
|
|
9309
|
-
}
|
|
11146
|
+
},
|
|
11147
|
+
examples: ["corp feedback <message>", "corp feedback --json"]
|
|
9310
11148
|
},
|
|
9311
11149
|
// ── resolve (API, read) ─────────────────────────────────────────────
|
|
9312
11150
|
{
|
|
@@ -9328,7 +11166,8 @@ var init_admin = __esm({
|
|
|
9328
11166
|
bodyId: ctx.opts.bodyId,
|
|
9329
11167
|
meetingId: ctx.opts.meetingId
|
|
9330
11168
|
});
|
|
9331
|
-
}
|
|
11169
|
+
},
|
|
11170
|
+
examples: ["corp resolve"]
|
|
9332
11171
|
},
|
|
9333
11172
|
// ── find (API, read) ────────────────────────────────────────────────
|
|
9334
11173
|
{
|
|
@@ -9352,7 +11191,8 @@ var init_admin = __esm({
|
|
|
9352
11191
|
meetingId: ctx.opts.meetingId,
|
|
9353
11192
|
json: ctx.opts.json
|
|
9354
11193
|
});
|
|
9355
|
-
}
|
|
11194
|
+
},
|
|
11195
|
+
examples: ["corp find"]
|
|
9356
11196
|
},
|
|
9357
11197
|
// ── approvals (informational) ───────────────────────────────────────
|
|
9358
11198
|
{
|
|
@@ -9364,7 +11204,951 @@ var init_admin = __esm({
|
|
|
9364
11204
|
'Approvals are managed through governance meetings and execution intents.\nUse these commands to manage approvals:\n\n Board approval via meeting vote:\n corp governance convene --body <body> --type board_meeting --title "Approve X"\n corp governance vote <meeting> <item> --voter <contact> --vote for\n\n Written consent (no meeting needed):\n corp governance written-consent --body <body> --title "Approve X" --description "..."\n\n View pending items:\n corp governance meetings <body> # see scheduled meetings\n corp governance agenda-items <meeting> # see items awaiting votes\n corp cap-table valuations # see pending valuations\n'
|
|
9365
11205
|
);
|
|
9366
11206
|
process.exit(1);
|
|
9367
|
-
}
|
|
11207
|
+
},
|
|
11208
|
+
examples: ["corp approvals"]
|
|
11209
|
+
},
|
|
11210
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
11211
|
+
{
|
|
11212
|
+
name: "admin audit-events",
|
|
11213
|
+
description: "View audit log of workspace events",
|
|
11214
|
+
route: { method: "GET", path: "/v1/admin/audit-events" },
|
|
11215
|
+
display: { title: "Admin Audit Events", cols: ["details>Details", "#event_id>ID", "event_type>Event Type", "timestamp>Timestamp"] },
|
|
11216
|
+
examples: ["corp admin audit-events"]
|
|
11217
|
+
},
|
|
11218
|
+
{
|
|
11219
|
+
name: "admin system-health",
|
|
11220
|
+
description: "Check API server health and uptime",
|
|
11221
|
+
route: { method: "GET", path: "/v1/admin/system-health" },
|
|
11222
|
+
display: { title: "Admin System Health", cols: ["git_storage>Git Storage", "status>Status", "uptime_seconds>Uptime Seconds", "version>Version", "workspace_count>Workspace Count"] },
|
|
11223
|
+
examples: ["corp admin system-health"]
|
|
11224
|
+
},
|
|
11225
|
+
{
|
|
11226
|
+
name: "admin workspaces",
|
|
11227
|
+
description: "List all workspaces (admin)",
|
|
11228
|
+
route: { method: "GET", path: "/v1/admin/workspaces" },
|
|
11229
|
+
display: { title: "Admin Workspaces", cols: ["entity_count>Entity Count", "name>Name", "#workspace_id>ID"] },
|
|
11230
|
+
examples: ["corp admin workspaces"]
|
|
11231
|
+
},
|
|
11232
|
+
{
|
|
11233
|
+
name: "billing plans",
|
|
11234
|
+
description: "View available billing plans",
|
|
11235
|
+
route: { method: "GET", path: "/v1/billing/plans" },
|
|
11236
|
+
display: { title: "Billing Plans", cols: ["plans>Plans"] },
|
|
11237
|
+
examples: ["corp billing plans"]
|
|
11238
|
+
},
|
|
11239
|
+
{
|
|
11240
|
+
name: "billing status",
|
|
11241
|
+
description: "Check current billing and subscription status",
|
|
11242
|
+
route: { method: "GET", path: "/v1/billing/status" },
|
|
11243
|
+
display: { title: "Billing Status", cols: ["current_period_end>Current Period End", "plan>Plan", "status>Status", "#workspace_id>ID"] },
|
|
11244
|
+
examples: ["corp billing status"]
|
|
11245
|
+
},
|
|
11246
|
+
{
|
|
11247
|
+
name: "server-config",
|
|
11248
|
+
description: "View server configuration (environment, version, features)",
|
|
11249
|
+
route: { method: "GET", path: "/v1/config" },
|
|
11250
|
+
display: { title: "Server Config", cols: ["environment>Environment", "version>Version", "features>Features"] },
|
|
11251
|
+
examples: ["corp server-config", "corp server-config --json"]
|
|
11252
|
+
},
|
|
11253
|
+
{
|
|
11254
|
+
name: "demo seed",
|
|
11255
|
+
description: "Seed a demo workspace with sample data",
|
|
11256
|
+
route: { method: "POST", path: "/v1/demo/seed" },
|
|
11257
|
+
options: [
|
|
11258
|
+
{ flags: "--name <name>", description: "Display name" },
|
|
11259
|
+
{ flags: "--scenario <scenario>", description: "Demo scenario to use" }
|
|
11260
|
+
],
|
|
11261
|
+
examples: ["corp demo seed", "corp demo seed --json"],
|
|
11262
|
+
successTemplate: "Seed created"
|
|
11263
|
+
},
|
|
11264
|
+
{
|
|
11265
|
+
name: "digests trigger",
|
|
11266
|
+
description: "Trigger digest generation now",
|
|
11267
|
+
route: { method: "POST", path: "/v1/digests/trigger" },
|
|
11268
|
+
examples: ["corp digests trigger"],
|
|
11269
|
+
successTemplate: "Trigger created"
|
|
11270
|
+
},
|
|
11271
|
+
{
|
|
11272
|
+
name: "digests",
|
|
11273
|
+
description: "View a specific digest by key",
|
|
11274
|
+
route: { method: "GET", path: "/v1/digests/{pos}" },
|
|
11275
|
+
args: [{ name: "digest-key", required: true, description: "Digest key" }],
|
|
11276
|
+
display: { title: "Digest" },
|
|
11277
|
+
examples: ["corp digests"]
|
|
11278
|
+
},
|
|
11279
|
+
{
|
|
11280
|
+
name: "service-token",
|
|
11281
|
+
description: "Get a service authentication token",
|
|
11282
|
+
route: { method: "GET", path: "/v1/service-token" },
|
|
11283
|
+
display: { title: "Service Token", cols: ["#api_key_id>ID", "expires_in>Expires In", "token>Token", "token_type>Token Type"] },
|
|
11284
|
+
examples: ["corp service-token"]
|
|
11285
|
+
},
|
|
11286
|
+
{
|
|
11287
|
+
name: "workspace entities",
|
|
11288
|
+
description: "List entities in current workspace",
|
|
11289
|
+
route: { method: "GET", path: "/v1/workspace/entities" },
|
|
11290
|
+
display: { title: "Workspace Entities", cols: ["#entity_id>ID"] },
|
|
11291
|
+
examples: ["corp workspace entities"]
|
|
11292
|
+
},
|
|
11293
|
+
{
|
|
11294
|
+
name: "workspace status",
|
|
11295
|
+
description: "Show current workspace status",
|
|
11296
|
+
route: { method: "GET", path: "/v1/workspace/status" },
|
|
11297
|
+
display: { title: "Workspace Status", cols: ["entity_count>Entity Count", "name>Name", "status>Status", "#workspace_id>ID"] },
|
|
11298
|
+
examples: ["corp workspace status"]
|
|
11299
|
+
},
|
|
11300
|
+
{
|
|
11301
|
+
name: "workspaces claim",
|
|
11302
|
+
description: "Claim a workspace using a claim token",
|
|
11303
|
+
route: { method: "POST", path: "/v1/workspaces/claim" },
|
|
11304
|
+
options: [
|
|
11305
|
+
{ flags: "--claim-token <claim-token>", description: "Workspace claim token", required: true }
|
|
11306
|
+
],
|
|
11307
|
+
examples: ["corp workspaces claim --claim-token 'claim-token'"],
|
|
11308
|
+
successTemplate: "Claim created"
|
|
11309
|
+
},
|
|
11310
|
+
{
|
|
11311
|
+
name: "workspaces contacts",
|
|
11312
|
+
description: "List contacts across the workspace",
|
|
11313
|
+
route: { method: "GET", path: "/v1/workspaces/{workspace_id}/contacts" },
|
|
11314
|
+
display: { title: "Workspaces Contacts", cols: ["#contact_id>ID", "#entity_id>ID"] },
|
|
11315
|
+
examples: ["corp workspaces contacts"]
|
|
11316
|
+
},
|
|
11317
|
+
{
|
|
11318
|
+
name: "workspaces entities",
|
|
11319
|
+
description: "List all entities in a workspace",
|
|
11320
|
+
route: { method: "GET", path: "/v1/workspaces/{workspace_id}/entities" },
|
|
11321
|
+
display: { title: "Workspaces Entities", cols: ["#entity_id>ID"] },
|
|
11322
|
+
examples: ["corp workspaces entities"]
|
|
11323
|
+
},
|
|
11324
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
11325
|
+
{
|
|
11326
|
+
name: "auth token-exchange",
|
|
11327
|
+
description: "Exchange an API key for a short-lived JWT",
|
|
11328
|
+
route: { method: "POST", path: "/v1/auth/token-exchange" },
|
|
11329
|
+
options: [
|
|
11330
|
+
{ flags: "--api-key <api-key>", description: "API key (starts with sk_)", required: true },
|
|
11331
|
+
{ flags: "--ttl-seconds <ttl-seconds>", description: "Token TTL in seconds (60-86400)", type: "int" }
|
|
11332
|
+
],
|
|
11333
|
+
examples: ["corp auth token-exchange --api-key 'api-key'", "corp auth token-exchange --json"],
|
|
11334
|
+
successTemplate: "Token Exchange created"
|
|
11335
|
+
},
|
|
11336
|
+
{
|
|
11337
|
+
name: "ssh-keys",
|
|
11338
|
+
description: "List registered SSH public keys",
|
|
11339
|
+
route: { method: "GET", path: "/v1/ssh-keys" },
|
|
11340
|
+
display: { title: "SSH Keys", cols: ["name>Name", "algorithm>Algorithm", "fingerprint>Fingerprint", "@created_at>Created", "#key_id>ID"] },
|
|
11341
|
+
examples: ["corp ssh-keys"]
|
|
11342
|
+
},
|
|
11343
|
+
{
|
|
11344
|
+
name: "ssh-keys add",
|
|
11345
|
+
description: "Register a new SSH public key",
|
|
11346
|
+
route: { method: "POST", path: "/v1/ssh-keys" },
|
|
11347
|
+
options: [
|
|
11348
|
+
{ flags: "--name <name>", description: "Key name/label", required: true },
|
|
11349
|
+
{ flags: "--public-key <key>", description: "SSH public key in OpenSSH format", required: true },
|
|
11350
|
+
{ flags: "--scopes <scopes>", description: "Comma-separated scopes (e.g. git_read,git_write)", type: "array" },
|
|
11351
|
+
{ flags: "--entity-ids <ids>", description: "Restrict key to specific entity IDs" },
|
|
11352
|
+
{ flags: "--contact-id <id>", description: "Associate with a contact" }
|
|
11353
|
+
],
|
|
11354
|
+
examples: ["corp ssh-keys add --name laptop --public-key 'ssh-ed25519 AAAA...'", "corp ssh-keys add --name ci --public-key 'ssh-ed25519 AAAA...' --scopes git_read,git_write"],
|
|
11355
|
+
successTemplate: "SSH key {name} added ({fingerprint})"
|
|
11356
|
+
},
|
|
11357
|
+
{
|
|
11358
|
+
name: "ssh-keys revoke",
|
|
11359
|
+
description: "Revoke an SSH public key",
|
|
11360
|
+
route: { method: "DELETE", path: "/v1/ssh-keys/{pos}" },
|
|
11361
|
+
args: [{ name: "key-id", required: true, description: "SSH key ID to revoke" }],
|
|
11362
|
+
examples: ["corp ssh-keys revoke <key-id>"],
|
|
11363
|
+
successTemplate: "SSH key revoked"
|
|
11364
|
+
},
|
|
11365
|
+
{
|
|
11366
|
+
name: "workspaces provision",
|
|
11367
|
+
description: "Provision a new workspace",
|
|
11368
|
+
route: { method: "POST", path: "/v1/workspaces/provision" },
|
|
11369
|
+
options: [
|
|
11370
|
+
{ flags: "--name <name>", description: "Display name", required: true },
|
|
11371
|
+
{ flags: "--owner-email <owner-email>", description: "Workspace owner email address" }
|
|
11372
|
+
],
|
|
11373
|
+
examples: ["corp workspaces provision --name 'name'", "corp workspaces provision --json"],
|
|
11374
|
+
successTemplate: "Provision created"
|
|
11375
|
+
},
|
|
11376
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
11377
|
+
{
|
|
11378
|
+
name: "references sync",
|
|
11379
|
+
description: "Sync reference aliases for a resource kind",
|
|
11380
|
+
route: { method: "POST", path: "/v1/references/sync" },
|
|
11381
|
+
options: [
|
|
11382
|
+
{ flags: "--items <items>", description: "Items to sync (JSON array)", required: true, type: "array" },
|
|
11383
|
+
{ flags: "--kind <kind>", description: "Resource kind", required: true, choices: ["entity", "contact", "share_transfer", "invoice", "bank_account", "payment", "payroll_run", "distribution", "reconciliation", "tax_filing", "deadline", "classification", "body", "meeting", "seat", "agenda_item", "resolution", "document", "work_item", "agent", "valuation", "safe_note", "instrument", "share_class", "round"] }
|
|
11384
|
+
],
|
|
11385
|
+
examples: ["corp references sync --items 'items' --kind 'kind'"],
|
|
11386
|
+
successTemplate: "Sync created"
|
|
11387
|
+
},
|
|
11388
|
+
// ── Auto-generated from OpenAPI ──────────────────────────────
|
|
11389
|
+
{
|
|
11390
|
+
name: "secrets interpolate",
|
|
11391
|
+
description: "Interpolate secrets into a template string",
|
|
11392
|
+
route: { method: "POST", path: "/v1/secrets/interpolate" },
|
|
11393
|
+
options: [
|
|
11394
|
+
{ flags: "--execution-id <execution-id>", description: "Agent execution ID", required: true },
|
|
11395
|
+
{ flags: "--template <template>", description: "Template string with {{secret}} placeholders", required: true }
|
|
11396
|
+
],
|
|
11397
|
+
examples: ["corp secrets interpolate --execution-id 'execution-id' --template 'template'"],
|
|
11398
|
+
successTemplate: "Interpolate created"
|
|
11399
|
+
},
|
|
11400
|
+
{
|
|
11401
|
+
name: "secrets resolve",
|
|
11402
|
+
description: "Resolve a secrets token to its values",
|
|
11403
|
+
route: { method: "POST", path: "/v1/secrets/resolve" },
|
|
11404
|
+
options: [
|
|
11405
|
+
{ flags: "--token <token>", description: "Secrets access token", required: true }
|
|
11406
|
+
],
|
|
11407
|
+
examples: ["corp secrets resolve --token 'token'"],
|
|
11408
|
+
successTemplate: "Resolve created"
|
|
11409
|
+
},
|
|
11410
|
+
{
|
|
11411
|
+
name: "documents validate-preview",
|
|
11412
|
+
description: "Validate a document preview without generating PDF",
|
|
11413
|
+
route: { method: "GET", path: "/v1/documents/preview/pdf/validate" },
|
|
11414
|
+
entity: true,
|
|
11415
|
+
display: { title: "Document Preview Validation" },
|
|
11416
|
+
examples: ["corp documents validate-preview", "corp documents validate-preview --json"]
|
|
11417
|
+
}
|
|
11418
|
+
];
|
|
11419
|
+
}
|
|
11420
|
+
});
|
|
11421
|
+
|
|
11422
|
+
// src/registry/execution.ts
|
|
11423
|
+
var executionCommands;
|
|
11424
|
+
var init_execution = __esm({
|
|
11425
|
+
"src/registry/execution.ts"() {
|
|
11426
|
+
"use strict";
|
|
11427
|
+
executionCommands = [
|
|
11428
|
+
{
|
|
11429
|
+
name: "document-requests fulfill",
|
|
11430
|
+
description: "Fulfill a document request with uploaded content",
|
|
11431
|
+
route: { method: "PATCH", path: "/v1/document-requests/{pos}/fulfill" },
|
|
11432
|
+
entity: true,
|
|
11433
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
11434
|
+
examples: ["corp document-requests fulfill <request-id>"],
|
|
11435
|
+
successTemplate: "Fulfill updated"
|
|
11436
|
+
},
|
|
11437
|
+
{
|
|
11438
|
+
name: "document-requests not-applicable",
|
|
11439
|
+
description: "Mark a document request as not applicable",
|
|
11440
|
+
route: { method: "PATCH", path: "/v1/document-requests/{pos}/not-applicable" },
|
|
11441
|
+
entity: true,
|
|
11442
|
+
args: [{ name: "request-id", required: true, description: "Document request ID" }],
|
|
11443
|
+
examples: ["corp document-requests not-applicable <request-id>"],
|
|
11444
|
+
successTemplate: "Not Applicable updated"
|
|
11445
|
+
},
|
|
11446
|
+
{
|
|
11447
|
+
name: "entities approval-artifacts",
|
|
11448
|
+
description: "List approval artifacts for an entity",
|
|
11449
|
+
route: { method: "GET", path: "/v1/entities/{eid}/approval-artifacts" },
|
|
11450
|
+
entity: true,
|
|
11451
|
+
display: { title: "Entities Approval Artifacts", cols: ["approved_at>Approved At", "approver_identity>Approver Identity", "channel>Channel", "expires_at>Expires At", "@created_at>Created At", "#approval_artifact_id>ID"] },
|
|
11452
|
+
examples: ["corp entities approval-artifacts", "corp entities approval-artifacts --json"]
|
|
11453
|
+
},
|
|
11454
|
+
{
|
|
11455
|
+
name: "entities intents",
|
|
11456
|
+
description: "List execution intents for an entity",
|
|
11457
|
+
route: { method: "GET", path: "/v1/entities/{eid}/intents" },
|
|
11458
|
+
entity: true,
|
|
11459
|
+
display: { title: "Entities Intents", cols: ["authority_tier>Authority Tier", "authorized_at>Authorized At", "bound_document_request_ids>Bound Document Request Ids", "cancelled_at>Cancelled At", "@created_at>Created At", "#bound_approval_artifact_id>ID"] },
|
|
11460
|
+
examples: ["corp entities intents", "corp entities intents --json"]
|
|
11461
|
+
},
|
|
11462
|
+
{
|
|
11463
|
+
name: "entities obligations",
|
|
11464
|
+
description: "List obligations for an entity",
|
|
11465
|
+
route: { method: "GET", path: "/v1/entities/{eid}/obligations" },
|
|
11466
|
+
entity: true,
|
|
11467
|
+
display: { title: "Entities Obligations", cols: ["assignee_type>Assignee Type", "description>Description", "expired_at>Expired At", "fulfilled_at>Fulfilled At", "@created_at>Created At", "#assignee_id>ID"] },
|
|
11468
|
+
examples: ["corp entities obligations", "corp entities obligations --json"]
|
|
11469
|
+
},
|
|
11470
|
+
{
|
|
11471
|
+
name: "entities obligations-human",
|
|
11472
|
+
description: "List human-actionable obligations for an entity",
|
|
11473
|
+
route: { method: "GET", path: "/v1/entities/{eid}/obligations/human" },
|
|
11474
|
+
entity: true,
|
|
11475
|
+
display: { title: "Entities Obligations Human", cols: ["assignee_type>Assignee Type", "description>Description", "expired_at>Expired At", "fulfilled_at>Fulfilled At", "@created_at>Created At", "#assignee_id>ID"] },
|
|
11476
|
+
examples: ["corp entities obligations-human", "corp entities obligations-human --json"]
|
|
11477
|
+
},
|
|
11478
|
+
{
|
|
11479
|
+
name: "entities obligations-summary",
|
|
11480
|
+
description: "View obligation summary (pending/fulfilled/expired)",
|
|
11481
|
+
route: { method: "GET", path: "/v1/entities/{eid}/obligations/summary" },
|
|
11482
|
+
entity: true,
|
|
11483
|
+
display: { title: "Entities Obligations Summary", cols: ["expired>Expired", "fulfilled>Fulfilled", "pending>Pending", "total>Total", "waived>Waived"] },
|
|
11484
|
+
examples: ["corp entities obligations-summary", "corp entities obligations-summary --json"]
|
|
11485
|
+
},
|
|
11486
|
+
{
|
|
11487
|
+
name: "entities packets",
|
|
11488
|
+
description: "List document packets for an entity",
|
|
11489
|
+
route: { method: "GET", path: "/v1/entities/{eid}/packets" },
|
|
11490
|
+
entity: true,
|
|
11491
|
+
display: { title: "Entities Packets", cols: ["finalized_at>Finalized At", "items>Items", "manifest_hash>Manifest Hash", "required_signers>Required Signers", "@created_at>Created At", "#entity_id>ID"] },
|
|
11492
|
+
examples: ["corp entities packets", "corp entities packets --json"]
|
|
11493
|
+
},
|
|
11494
|
+
{
|
|
11495
|
+
name: "execution approval-artifacts",
|
|
11496
|
+
description: "Create an approval artifact (e.g. board vote record)",
|
|
11497
|
+
route: { method: "POST", path: "/v1/execution/approval-artifacts" },
|
|
11498
|
+
entity: true,
|
|
11499
|
+
options: [
|
|
11500
|
+
{ flags: "--approved-at <approved-at>", description: "Timestamp of approval (ISO 8601)" },
|
|
11501
|
+
{ flags: "--approver-identity <approver-identity>", description: "Identity of the approver", required: true },
|
|
11502
|
+
{ flags: "--channel <channel>", description: "Approval channel (board_vote, written_consent, etc.)", required: true },
|
|
11503
|
+
{ flags: "--expires-at <expires-at>", description: "Expiration timestamp (ISO 8601)" },
|
|
11504
|
+
{ flags: "--explicit", description: "Whether approval is explicit (vs implied)" },
|
|
11505
|
+
{ flags: "--intent-type <intent-type>", description: "Type of intent", required: true },
|
|
11506
|
+
{ flags: "--max-amount-cents <max-amount-cents>", description: "Maximum authorized amount in cents" },
|
|
11507
|
+
{ flags: "--scope <scope>", description: "Authorization scope", required: true }
|
|
11508
|
+
],
|
|
11509
|
+
examples: ["corp execution approval-artifacts --approver-identity 'approver-identity' --channel 'channel' --intent-type 'intent-type' --scope 'scope'", "corp execution approval-artifacts --json"],
|
|
11510
|
+
successTemplate: "Approval Artifacts created"
|
|
11511
|
+
},
|
|
11512
|
+
{
|
|
11513
|
+
name: "execution intents",
|
|
11514
|
+
description: "Create an execution intent (action requiring authorization)",
|
|
11515
|
+
route: { method: "POST", path: "/v1/execution/intents" },
|
|
11516
|
+
entity: true,
|
|
11517
|
+
options: [
|
|
11518
|
+
{ flags: "--authority-tier <authority-tier>", description: "Authority tier required (tier_1, tier_2, tier_3)", choices: ["tier_1", "tier_2", "tier_3"] },
|
|
11519
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11520
|
+
{ flags: "--intent-type <intent-type>", description: "Type of intent", required: true },
|
|
11521
|
+
{ flags: "--metadata <metadata>", description: "Additional metadata (JSON)" }
|
|
11522
|
+
],
|
|
11523
|
+
examples: ["corp execution intents --description 'description' --intent-type 'intent-type'", "corp execution intents --json"],
|
|
11524
|
+
successTemplate: "Intents created"
|
|
11525
|
+
},
|
|
11526
|
+
{
|
|
11527
|
+
name: "execution obligations",
|
|
11528
|
+
description: "Create an obligation (task assigned to a party)",
|
|
11529
|
+
route: { method: "POST", path: "/v1/execution/obligations" },
|
|
11530
|
+
entity: true,
|
|
11531
|
+
options: [
|
|
11532
|
+
{ flags: "--assignee-id <assignee-id>", description: "ID of the party to assign to" },
|
|
11533
|
+
{ flags: "--assignee-type <assignee-type>", description: "Who is responsible for fulfilling an obligation.", required: true, choices: ["internal", "third_party", "human"] },
|
|
11534
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11535
|
+
{ flags: "--due-date <due-date>", description: "Due date (ISO 8601, e.g. 2026-06-30)" },
|
|
11536
|
+
{ flags: "--intent-id <intent-id>", description: "Execution intent ID" },
|
|
11537
|
+
{ flags: "--obligation-type <obligation-type>", description: "Type of obligation", required: true }
|
|
11538
|
+
],
|
|
11539
|
+
examples: ["corp execution obligations --assignee-type internal --description 'description' --obligation-type 'obligation-type'", "corp execution obligations --json"],
|
|
11540
|
+
successTemplate: "Obligations created"
|
|
11541
|
+
},
|
|
11542
|
+
{
|
|
11543
|
+
name: "execution packets",
|
|
11544
|
+
description: "View a document packet",
|
|
11545
|
+
route: { method: "GET", path: "/v1/execution/packets/{pos}" },
|
|
11546
|
+
entity: true,
|
|
11547
|
+
args: [{ name: "packet-id", required: true, description: "Document packet ID" }],
|
|
11548
|
+
display: { title: "Execution Packets", cols: ["finalized_at>Finalized At", "items>Items", "manifest_hash>Manifest Hash", "required_signers>Required Signers", "@created_at>Created At", "#entity_id>ID"] },
|
|
11549
|
+
examples: ["corp execution packets", "corp execution packets --json"]
|
|
11550
|
+
},
|
|
11551
|
+
{
|
|
11552
|
+
name: "intents authorize",
|
|
11553
|
+
description: "Authorize an execution intent",
|
|
11554
|
+
route: { method: "POST", path: "/v1/intents/{pos}/authorize" },
|
|
11555
|
+
entity: true,
|
|
11556
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11557
|
+
examples: ["corp intents authorize <intent-id>"],
|
|
11558
|
+
successTemplate: "Authorize created"
|
|
11559
|
+
},
|
|
11560
|
+
{
|
|
11561
|
+
name: "intents bind-approval-artifact",
|
|
11562
|
+
description: "Bind an approval artifact to an intent",
|
|
11563
|
+
route: { method: "POST", path: "/v1/intents/{pos}/bind-approval-artifact" },
|
|
11564
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11565
|
+
options: [
|
|
11566
|
+
{ flags: "--approval-artifact-id <approval-artifact-id>", description: "Approval artifact ID to bind", required: true }
|
|
11567
|
+
],
|
|
11568
|
+
examples: ["corp intents bind-approval-artifact <intent-id> --approval-artifact-id 'approval-artifact-id'"],
|
|
11569
|
+
successTemplate: "Bind Approval Artifact created"
|
|
11570
|
+
},
|
|
11571
|
+
{
|
|
11572
|
+
name: "intents bind-document-request",
|
|
11573
|
+
description: "Bind a document request to an intent",
|
|
11574
|
+
route: { method: "POST", path: "/v1/intents/{pos}/bind-document-request" },
|
|
11575
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11576
|
+
options: [
|
|
11577
|
+
{ flags: "--request-id <request-id>", description: "Document request ID", required: true }
|
|
11578
|
+
],
|
|
11579
|
+
examples: ["corp intents bind-document-request <intent-id> --request-id 'request-id'"],
|
|
11580
|
+
successTemplate: "Bind Document Request created"
|
|
11581
|
+
},
|
|
11582
|
+
{
|
|
11583
|
+
name: "intents cancel",
|
|
11584
|
+
description: "Cancel an execution intent",
|
|
11585
|
+
route: { method: "POST", path: "/v1/intents/{pos}/cancel" },
|
|
11586
|
+
entity: true,
|
|
11587
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11588
|
+
examples: ["corp intents cancel <intent-id>"],
|
|
11589
|
+
successTemplate: "Cancel created"
|
|
11590
|
+
},
|
|
11591
|
+
{
|
|
11592
|
+
name: "intents evaluate",
|
|
11593
|
+
description: "Evaluate whether an intent meets its requirements",
|
|
11594
|
+
route: { method: "POST", path: "/v1/intents/{pos}/evaluate" },
|
|
11595
|
+
entity: true,
|
|
11596
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11597
|
+
examples: ["corp intents evaluate <intent-id>"],
|
|
11598
|
+
successTemplate: "Evaluate created"
|
|
11599
|
+
},
|
|
11600
|
+
{
|
|
11601
|
+
name: "intents execute",
|
|
11602
|
+
description: "Execute an authorized intent",
|
|
11603
|
+
route: { method: "POST", path: "/v1/intents/{pos}/execute" },
|
|
11604
|
+
entity: true,
|
|
11605
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11606
|
+
examples: ["corp intents execute <intent-id>"],
|
|
11607
|
+
successTemplate: "Execute created"
|
|
11608
|
+
},
|
|
11609
|
+
{
|
|
11610
|
+
name: "intents receipts",
|
|
11611
|
+
description: "View execution receipts for an intent",
|
|
11612
|
+
route: { method: "GET", path: "/v1/intents/{pos}/receipts" },
|
|
11613
|
+
entity: true,
|
|
11614
|
+
args: [{ name: "intent-id", required: true, description: "Execution intent ID" }],
|
|
11615
|
+
display: { title: "Intents Receipts", cols: ["executed_at>Executed At", "idempotency_key>Idempotency Key", "request_hash>Request Hash", "response_hash>Response Hash", "@created_at>Created At", "#intent_id>ID"] },
|
|
11616
|
+
examples: ["corp intents receipts", "corp intents receipts --json"]
|
|
11617
|
+
},
|
|
11618
|
+
{
|
|
11619
|
+
name: "obligations assign",
|
|
11620
|
+
description: "Assign an obligation to a party",
|
|
11621
|
+
route: { method: "POST", path: "/v1/obligations/{pos}/assign" },
|
|
11622
|
+
entity: true,
|
|
11623
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11624
|
+
options: [
|
|
11625
|
+
{ flags: "--assignee-id <assignee-id>", description: "ID of the party to assign to", required: true }
|
|
11626
|
+
],
|
|
11627
|
+
examples: ["corp obligations assign <obligation-id> --assignee-id 'assignee-id'"],
|
|
11628
|
+
successTemplate: "Assign created"
|
|
11629
|
+
},
|
|
11630
|
+
{
|
|
11631
|
+
name: "obligations document-requests",
|
|
11632
|
+
description: "List or create document requests for an obligation",
|
|
11633
|
+
route: { method: "GET", path: "/v1/obligations/{pos}/document-requests" },
|
|
11634
|
+
entity: true,
|
|
11635
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11636
|
+
display: { title: "Obligations Document Requests", cols: ["description>Description", "document_type>Document Type", "fulfilled_at>Fulfilled At", "not_applicable_at>Not Applicable At", "@created_at>Created At", "#entity_id>ID"] },
|
|
11637
|
+
examples: ["corp obligations document-requests", "corp obligations document-requests --json"]
|
|
11638
|
+
},
|
|
11639
|
+
{
|
|
11640
|
+
name: "obligations create-document-request",
|
|
11641
|
+
description: "List or create document requests for an obligation",
|
|
11642
|
+
route: { method: "POST", path: "/v1/obligations/{pos}/document-requests" },
|
|
11643
|
+
entity: true,
|
|
11644
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11645
|
+
options: [
|
|
11646
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11647
|
+
{ flags: "--document-type <document-type>", description: "Type of document required", required: true }
|
|
11648
|
+
],
|
|
11649
|
+
examples: ["corp obligations document-requests <obligation-id> --description 'description' --document-type 'document-type'"],
|
|
11650
|
+
successTemplate: "Document Requests created"
|
|
11651
|
+
},
|
|
11652
|
+
{
|
|
11653
|
+
name: "obligations expire",
|
|
11654
|
+
description: "Mark an obligation as expired",
|
|
11655
|
+
route: { method: "POST", path: "/v1/obligations/{pos}/expire" },
|
|
11656
|
+
entity: true,
|
|
11657
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11658
|
+
examples: ["corp obligations expire <obligation-id>"],
|
|
11659
|
+
successTemplate: "Expire created"
|
|
11660
|
+
},
|
|
11661
|
+
{
|
|
11662
|
+
name: "obligations fulfill",
|
|
11663
|
+
description: "Mark an obligation as fulfilled",
|
|
11664
|
+
route: { method: "POST", path: "/v1/obligations/{pos}/fulfill" },
|
|
11665
|
+
entity: true,
|
|
11666
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11667
|
+
examples: ["corp obligations fulfill <obligation-id>"],
|
|
11668
|
+
successTemplate: "Fulfill created"
|
|
11669
|
+
},
|
|
11670
|
+
{
|
|
11671
|
+
name: "obligations waive",
|
|
11672
|
+
description: "Waive an obligation",
|
|
11673
|
+
route: { method: "POST", path: "/v1/obligations/{pos}/waive" },
|
|
11674
|
+
entity: true,
|
|
11675
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11676
|
+
examples: ["corp obligations waive <obligation-id>"],
|
|
11677
|
+
successTemplate: "Waive created"
|
|
11678
|
+
},
|
|
11679
|
+
{
|
|
11680
|
+
name: "receipts",
|
|
11681
|
+
description: "View an execution receipt",
|
|
11682
|
+
route: { method: "GET", path: "/v1/receipts/{pos}" },
|
|
11683
|
+
entity: true,
|
|
11684
|
+
args: [{ name: "receipt-id", required: true, description: "Execution receipt ID" }],
|
|
11685
|
+
display: { title: "Receipts", cols: ["executed_at>Executed At", "idempotency_key>Idempotency Key", "request_hash>Request Hash", "response_hash>Response Hash", "@created_at>Created At", "#intent_id>ID"] },
|
|
11686
|
+
examples: ["corp receipts", "corp receipts --json"]
|
|
11687
|
+
},
|
|
11688
|
+
// ── Human obligations ───────────────────────────────────────────────
|
|
11689
|
+
{
|
|
11690
|
+
name: "human-obligations",
|
|
11691
|
+
description: "List obligations requiring human action (signing, upload)",
|
|
11692
|
+
route: { method: "GET", path: "/v1/human-obligations" },
|
|
11693
|
+
display: {
|
|
11694
|
+
title: "Human Obligations",
|
|
11695
|
+
cols: ["obligation_type>Type", "status>Status", "@due_at>Due", "#obligation_id>ID"]
|
|
11696
|
+
},
|
|
11697
|
+
examples: ["corp human-obligations"]
|
|
11698
|
+
},
|
|
11699
|
+
{
|
|
11700
|
+
name: "human-obligations fulfill",
|
|
11701
|
+
description: "Fulfill a human obligation",
|
|
11702
|
+
route: { method: "POST", path: "/v1/human-obligations/{pos}/fulfill" },
|
|
11703
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11704
|
+
successTemplate: "Obligation fulfilled",
|
|
11705
|
+
examples: ["corp human-obligations fulfill <obligation-id>"]
|
|
11706
|
+
},
|
|
11707
|
+
{
|
|
11708
|
+
name: "human-obligations signer-token",
|
|
11709
|
+
description: "Get a signing token for a human obligation",
|
|
11710
|
+
route: { method: "POST", path: "/v1/human-obligations/{pos}/signer-token" },
|
|
11711
|
+
args: [{ name: "obligation-id", required: true, description: "Obligation ID" }],
|
|
11712
|
+
successTemplate: "Signer token issued",
|
|
11713
|
+
examples: ["corp human-obligations signer-token <obligation-id>"]
|
|
11714
|
+
}
|
|
11715
|
+
];
|
|
11716
|
+
}
|
|
11717
|
+
});
|
|
11718
|
+
|
|
11719
|
+
// src/registry/secret-proxies.ts
|
|
11720
|
+
var secretProxyCommands;
|
|
11721
|
+
var init_secret_proxies = __esm({
|
|
11722
|
+
"src/registry/secret-proxies.ts"() {
|
|
11723
|
+
"use strict";
|
|
11724
|
+
secretProxyCommands = [
|
|
11725
|
+
{
|
|
11726
|
+
name: "secret-proxies",
|
|
11727
|
+
description: "List secret proxies for the workspace",
|
|
11728
|
+
route: { method: "GET", path: "/v1/workspaces/{wid}/secret-proxies" },
|
|
11729
|
+
display: {
|
|
11730
|
+
title: "Secret Proxies",
|
|
11731
|
+
cols: ["name>Name", "url>URL", "description>Description", "secret_count>Secrets", "@created_at>Created"]
|
|
11732
|
+
},
|
|
11733
|
+
examples: ["corp secret-proxies"]
|
|
11734
|
+
},
|
|
11735
|
+
{
|
|
11736
|
+
name: "secret-proxies create",
|
|
11737
|
+
description: "Create a secret proxy",
|
|
11738
|
+
route: { method: "POST", path: "/v1/workspaces/{wid}/secret-proxies" },
|
|
11739
|
+
options: [
|
|
11740
|
+
{ flags: "--name <name>", description: "Proxy name", required: true },
|
|
11741
|
+
{ flags: "--url <url>", description: "Proxy URL (or 'self' for local encrypted secrets)", required: true },
|
|
11742
|
+
{ flags: "--description <desc>", description: "Description text" }
|
|
11743
|
+
],
|
|
11744
|
+
successTemplate: "Secret proxy {name} created",
|
|
11745
|
+
examples: ["corp secret-proxies create --name 'name' --url 'url'", "corp secret-proxies create --json"]
|
|
11746
|
+
},
|
|
11747
|
+
{
|
|
11748
|
+
name: "secret-proxies show",
|
|
11749
|
+
description: "Show a secret proxy",
|
|
11750
|
+
route: { method: "GET", path: "/v1/workspaces/{wid}/secret-proxies/{pos}" },
|
|
11751
|
+
args: [{ name: "proxy-name", required: true, description: "Proxy name" }],
|
|
11752
|
+
display: {
|
|
11753
|
+
title: "Secret Proxy",
|
|
11754
|
+
cols: ["name>Name", "url>URL", "description>Description", "secret_count>Secrets", "@created_at>Created"]
|
|
11755
|
+
},
|
|
11756
|
+
examples: ["corp secret-proxies show"]
|
|
11757
|
+
},
|
|
11758
|
+
{
|
|
11759
|
+
name: "secret-proxies secrets",
|
|
11760
|
+
description: "List secret names in a proxy",
|
|
11761
|
+
route: { method: "GET", path: "/v1/workspaces/{wid}/secret-proxies/{pos}/secrets" },
|
|
11762
|
+
args: [{ name: "proxy-name", required: true, description: "Proxy name" }],
|
|
11763
|
+
display: {
|
|
11764
|
+
title: "Secrets",
|
|
11765
|
+
cols: ["names>Secret Names", "proxy_name>Proxy"]
|
|
11766
|
+
},
|
|
11767
|
+
examples: ["corp secret-proxies secrets"]
|
|
11768
|
+
},
|
|
11769
|
+
{
|
|
11770
|
+
name: "secret-proxies set-secrets",
|
|
11771
|
+
description: "Set secrets in a proxy (key-value pairs, server encrypts)",
|
|
11772
|
+
route: { method: "PUT", path: "/v1/workspaces/{wid}/secret-proxies/{pos}/secrets" },
|
|
11773
|
+
args: [{ name: "proxy-name", required: true, description: "Proxy name" }],
|
|
11774
|
+
options: [
|
|
11775
|
+
{ flags: "--secrets <json>", description: "JSON object of key-value secret pairs", required: true }
|
|
11776
|
+
],
|
|
11777
|
+
successTemplate: "Secrets updated for {proxy_name}",
|
|
11778
|
+
examples: ["corp secret-proxies set-secrets <proxy-name> --secrets 'json'"]
|
|
11779
|
+
}
|
|
11780
|
+
];
|
|
11781
|
+
}
|
|
11782
|
+
});
|
|
11783
|
+
|
|
11784
|
+
// src/registry/treasury.ts
|
|
11785
|
+
var treasuryCommands;
|
|
11786
|
+
var init_treasury = __esm({
|
|
11787
|
+
"src/registry/treasury.ts"() {
|
|
11788
|
+
"use strict";
|
|
11789
|
+
treasuryCommands = [
|
|
11790
|
+
{
|
|
11791
|
+
name: "bank-accounts close",
|
|
11792
|
+
description: "Close a bank account",
|
|
11793
|
+
route: { method: "POST", path: "/v1/bank-accounts/{pos}/close" },
|
|
11794
|
+
entity: true,
|
|
11795
|
+
args: [{ name: "bank-account-id", required: true, description: "Bank account ID" }],
|
|
11796
|
+
examples: ["corp bank-accounts close <bank-account-id>"],
|
|
11797
|
+
successTemplate: "Close created"
|
|
11798
|
+
},
|
|
11799
|
+
{
|
|
11800
|
+
name: "distributions",
|
|
11801
|
+
description: "Record a distribution (dividend, member draw)",
|
|
11802
|
+
route: { method: "POST", path: "/v1/distributions" },
|
|
11803
|
+
options: [
|
|
11804
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11805
|
+
{ flags: "--distribution-type <distribution-type>", description: "Type of distribution.", choices: ["dividend", "return", "liquidation"] },
|
|
11806
|
+
{ flags: "--total-amount-cents <total-amount-cents>", description: "Total Amount Cents", required: true, type: "int" }
|
|
11807
|
+
],
|
|
11808
|
+
examples: ["corp distributions --description dividend --total-amount-cents 'total-amount-cents'", "corp distributions --json"],
|
|
11809
|
+
successTemplate: "Distributions created"
|
|
11810
|
+
},
|
|
11811
|
+
{
|
|
11812
|
+
name: "entities accounts",
|
|
11813
|
+
description: "List ledger accounts for an entity",
|
|
11814
|
+
route: { method: "GET", path: "/v1/entities/{eid}/accounts" },
|
|
11815
|
+
entity: true,
|
|
11816
|
+
display: { title: "Entities Accounts", cols: ["account_code>Account Code", "account_name>Account Name", "account_type>Account Type", "currency>Currency", "@created_at>Created At", "#account_id>ID"] },
|
|
11817
|
+
examples: ["corp entities accounts", "corp entities accounts --json"]
|
|
11818
|
+
},
|
|
11819
|
+
{
|
|
11820
|
+
name: "entities journal-entries",
|
|
11821
|
+
description: "List journal entries for an entity",
|
|
11822
|
+
route: { method: "GET", path: "/v1/entities/{eid}/journal-entries" },
|
|
11823
|
+
entity: true,
|
|
11824
|
+
display: { title: "Entities Journal Entries", cols: ["description>Description", "effective_date>Effective Date", "status>Status", "total_credits_cents>Total Credits Cents", "@created_at>Created At", "#entity_id>ID"] },
|
|
11825
|
+
examples: ["corp entities journal-entries", "corp entities journal-entries --json"]
|
|
11826
|
+
},
|
|
11827
|
+
{
|
|
11828
|
+
name: "entities spending-limits",
|
|
11829
|
+
description: "List spending limits for an entity",
|
|
11830
|
+
route: { method: "GET", path: "/v1/entities/{eid}/spending-limits" },
|
|
11831
|
+
entity: true,
|
|
11832
|
+
display: { title: "Entities Spending Limits", cols: ["amount_cents>Amount Cents", "category>Category", "@created_at>Created At", "#entity_id>ID", "period>Period", "#spending_limit_id>ID"] },
|
|
11833
|
+
examples: ["corp entities spending-limits", "corp entities spending-limits --json"]
|
|
11834
|
+
},
|
|
11835
|
+
{
|
|
11836
|
+
name: "entities stripe-account",
|
|
11837
|
+
description: "View Stripe account for an entity",
|
|
11838
|
+
route: { method: "GET", path: "/v1/entities/{eid}/stripe-account" },
|
|
11839
|
+
entity: true,
|
|
11840
|
+
display: { title: "Entities Stripe Account", cols: ["@created_at>Created At", "#entity_id>ID", "status>Status", "#stripe_account_id>ID"] },
|
|
11841
|
+
examples: ["corp entities stripe-account", "corp entities stripe-account --json"]
|
|
11842
|
+
},
|
|
11843
|
+
{
|
|
11844
|
+
name: "invoices from-agent-request",
|
|
11845
|
+
description: "Create an invoice from an agent request",
|
|
11846
|
+
route: { method: "POST", path: "/v1/invoices/from-agent-request" },
|
|
11847
|
+
entity: true,
|
|
11848
|
+
options: [
|
|
11849
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
11850
|
+
{ flags: "--customer-name <customer-name>", description: "Customer name for the invoice", required: true },
|
|
11851
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11852
|
+
{ flags: "--due-date <due-date>", description: "Due date (ISO 8601, e.g. 2026-06-30)", required: true }
|
|
11853
|
+
],
|
|
11854
|
+
examples: ["corp invoices from-agent-request --amount-cents 'amount-cents' --customer-name 'customer-name' --description 'description' --due-date 'due-date'"],
|
|
11855
|
+
successTemplate: "From Agent Request created"
|
|
11856
|
+
},
|
|
11857
|
+
{
|
|
11858
|
+
name: "invoices",
|
|
11859
|
+
description: "Create a new invoice",
|
|
11860
|
+
route: { method: "GET", path: "/v1/invoices/{pos}" },
|
|
11861
|
+
entity: true,
|
|
11862
|
+
args: [{ name: "invoice-id", required: true, description: "Invoice ID" }],
|
|
11863
|
+
display: { title: "Invoices", cols: ["amount_cents>Amount Cents", "customer_name>Customer Name", "description>Description", "status>Status", "@created_at>Created At", "#entity_id>ID"] },
|
|
11864
|
+
examples: ["corp invoices", "corp invoices --json"]
|
|
11865
|
+
},
|
|
11866
|
+
{
|
|
11867
|
+
name: "invoices mark-paid",
|
|
11868
|
+
description: "Mark an invoice as paid",
|
|
11869
|
+
route: { method: "POST", path: "/v1/invoices/{pos}/mark-paid" },
|
|
11870
|
+
entity: true,
|
|
11871
|
+
args: [{ name: "invoice-id", required: true, description: "Invoice ID" }],
|
|
11872
|
+
examples: ["corp invoices mark-paid <invoice-id>"],
|
|
11873
|
+
successTemplate: "Mark Paid created"
|
|
11874
|
+
},
|
|
11875
|
+
{
|
|
11876
|
+
name: "invoices pay-instructions",
|
|
11877
|
+
description: "Get payment instructions for an invoice",
|
|
11878
|
+
route: { method: "GET", path: "/v1/invoices/{pos}/pay-instructions" },
|
|
11879
|
+
entity: true,
|
|
11880
|
+
args: [{ name: "invoice-id", required: true, description: "Invoice ID" }],
|
|
11881
|
+
display: { title: "Invoices Pay Instructions", cols: ["amount_cents>Amount Cents", "currency>Currency", "instructions>Instructions", "#invoice_id>ID", "payment_method>Payment Method"] },
|
|
11882
|
+
examples: ["corp invoices pay-instructions", "corp invoices pay-instructions --json"]
|
|
11883
|
+
},
|
|
11884
|
+
{
|
|
11885
|
+
name: "invoices send",
|
|
11886
|
+
description: "Send an invoice to the recipient",
|
|
11887
|
+
route: { method: "POST", path: "/v1/invoices/{pos}/send" },
|
|
11888
|
+
entity: true,
|
|
11889
|
+
args: [{ name: "invoice-id", required: true, description: "Invoice ID" }],
|
|
11890
|
+
examples: ["corp invoices send <invoice-id>"],
|
|
11891
|
+
successTemplate: "Send created"
|
|
11892
|
+
},
|
|
11893
|
+
{
|
|
11894
|
+
name: "invoices status",
|
|
11895
|
+
description: "Check invoice payment status",
|
|
11896
|
+
route: { method: "GET", path: "/v1/invoices/{pos}/status" },
|
|
11897
|
+
entity: true,
|
|
11898
|
+
args: [{ name: "invoice-id", required: true, description: "Invoice ID" }],
|
|
11899
|
+
display: { title: "Invoices Status", cols: ["amount_cents>Amount Cents", "customer_name>Customer Name", "description>Description", "status>Status", "@created_at>Created At", "#entity_id>ID"] },
|
|
11900
|
+
examples: ["corp invoices status", "corp invoices status --json"]
|
|
11901
|
+
},
|
|
11902
|
+
{
|
|
11903
|
+
name: "journal-entries post",
|
|
11904
|
+
description: "Post a journal entry (make it permanent)",
|
|
11905
|
+
route: { method: "POST", path: "/v1/journal-entries/{pos}/post" },
|
|
11906
|
+
entity: true,
|
|
11907
|
+
args: [{ name: "entry-id", required: true, description: "Journal entry ID" }],
|
|
11908
|
+
examples: ["corp journal-entries post <entry-id>"],
|
|
11909
|
+
successTemplate: "Post created"
|
|
11910
|
+
},
|
|
11911
|
+
{
|
|
11912
|
+
name: "journal-entries void",
|
|
11913
|
+
description: "Void a journal entry",
|
|
11914
|
+
route: { method: "POST", path: "/v1/journal-entries/{pos}/void" },
|
|
11915
|
+
entity: true,
|
|
11916
|
+
args: [{ name: "entry-id", required: true, description: "Journal entry ID" }],
|
|
11917
|
+
examples: ["corp journal-entries void <entry-id>"],
|
|
11918
|
+
successTemplate: "Void created"
|
|
11919
|
+
},
|
|
11920
|
+
{
|
|
11921
|
+
name: "ledger reconcile",
|
|
11922
|
+
description: "Reconcile the ledger",
|
|
11923
|
+
route: { method: "POST", path: "/v1/ledger/reconcile" },
|
|
11924
|
+
entity: true,
|
|
11925
|
+
options: [
|
|
11926
|
+
{ flags: "--as-of-date <as-of-date>", description: "As Of Date" },
|
|
11927
|
+
{ flags: "--end-date <end-date>", description: "End Date" },
|
|
11928
|
+
{ flags: "--start-date <start-date>", description: "Start Date" }
|
|
11929
|
+
],
|
|
11930
|
+
examples: ["corp ledger reconcile", "corp ledger reconcile --json"],
|
|
11931
|
+
successTemplate: "Reconcile created"
|
|
11932
|
+
},
|
|
11933
|
+
{
|
|
11934
|
+
name: "payments",
|
|
11935
|
+
description: "Record a new payment",
|
|
11936
|
+
route: { method: "POST", path: "/v1/payments" },
|
|
11937
|
+
entity: true,
|
|
11938
|
+
options: [
|
|
11939
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
11940
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11941
|
+
{ flags: "--payment-method <payment-method>", description: "How a payment is made or received.", choices: ["bank_transfer", "card", "check", "wire", "ach"] },
|
|
11942
|
+
{ flags: "--recipient <recipient>", description: "Recipient", required: true }
|
|
11943
|
+
],
|
|
11944
|
+
examples: ["corp payments --amount-cents 'amount-cents' --description bank_transfer --recipient 'recipient'", "corp payments --json"],
|
|
11945
|
+
successTemplate: "Payments created"
|
|
11946
|
+
},
|
|
11947
|
+
{
|
|
11948
|
+
name: "payments execute",
|
|
11949
|
+
description: "Execute a pending payment",
|
|
11950
|
+
route: { method: "POST", path: "/v1/payments/execute" },
|
|
11951
|
+
entity: true,
|
|
11952
|
+
options: [
|
|
11953
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
11954
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
11955
|
+
{ flags: "--payment-method <payment-method>", description: "How a payment is made or received.", choices: ["bank_transfer", "card", "check", "wire", "ach"] },
|
|
11956
|
+
{ flags: "--recipient <recipient>", description: "Recipient", required: true }
|
|
11957
|
+
],
|
|
11958
|
+
examples: ["corp payments execute --amount-cents 'amount-cents' --description bank_transfer --recipient 'recipient'", "corp payments execute --json"],
|
|
11959
|
+
successTemplate: "Execute created"
|
|
11960
|
+
},
|
|
11961
|
+
{
|
|
11962
|
+
name: "payroll runs",
|
|
11963
|
+
description: "Create a payroll run",
|
|
11964
|
+
route: { method: "POST", path: "/v1/payroll/runs" },
|
|
11965
|
+
entity: true,
|
|
11966
|
+
options: [
|
|
11967
|
+
{ flags: "--pay-period-end <pay-period-end>", description: "Pay Period End", required: true },
|
|
11968
|
+
{ flags: "--pay-period-start <pay-period-start>", description: "Pay Period Start", required: true }
|
|
11969
|
+
],
|
|
11970
|
+
examples: ["corp payroll runs --pay-period-end 'pay-period-end' --pay-period-start 'pay-period-start'"],
|
|
11971
|
+
successTemplate: "Runs created"
|
|
11972
|
+
},
|
|
11973
|
+
{
|
|
11974
|
+
name: "spending-limits",
|
|
11975
|
+
description: "Set a spending limit",
|
|
11976
|
+
route: { method: "POST", path: "/v1/spending-limits" },
|
|
11977
|
+
entity: true,
|
|
11978
|
+
options: [
|
|
11979
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
11980
|
+
{ flags: "--category <category>", description: "Category", required: true },
|
|
11981
|
+
{ flags: "--period <period>", description: "Period", required: true }
|
|
11982
|
+
],
|
|
11983
|
+
examples: ["corp spending-limits --amount-cents 'amount-cents' --category 'category' --period 'period'"],
|
|
11984
|
+
successTemplate: "Spending Limits created"
|
|
11985
|
+
},
|
|
11986
|
+
{
|
|
11987
|
+
name: "treasury accounts",
|
|
11988
|
+
description: "Create a new ledger account",
|
|
11989
|
+
route: { method: "POST", path: "/v1/treasury/accounts" },
|
|
11990
|
+
entity: true,
|
|
11991
|
+
options: [
|
|
11992
|
+
{ flags: "--account-code <account-code>", description: "Standard GL account codes with integer discriminants matching the code number.", required: true, choices: ["Cash", "AccountsReceivable", "AccountsPayable", "AccruedExpenses", "FounderCapital", "Revenue", "OperatingExpenses", "Cogs"] }
|
|
11993
|
+
],
|
|
11994
|
+
examples: ["corp treasury accounts --account-code Cash"],
|
|
11995
|
+
successTemplate: "Accounts created"
|
|
11996
|
+
},
|
|
11997
|
+
{
|
|
11998
|
+
name: "treasury bank-accounts",
|
|
11999
|
+
description: "Register a new bank account",
|
|
12000
|
+
route: { method: "POST", path: "/v1/treasury/bank-accounts" },
|
|
12001
|
+
entity: true,
|
|
12002
|
+
options: [
|
|
12003
|
+
{ flags: "--account-type <account-type>", description: "Account type (checking, savings)", choices: ["checking", "savings"] },
|
|
12004
|
+
{ flags: "--bank-name <bank-name>", description: "Bank name", required: true }
|
|
12005
|
+
],
|
|
12006
|
+
examples: ["corp treasury bank-accounts --bank-name 'bank-name'", "corp treasury bank-accounts --json"],
|
|
12007
|
+
successTemplate: "Bank Accounts created"
|
|
12008
|
+
},
|
|
12009
|
+
{
|
|
12010
|
+
name: "treasury chart-of-accounts",
|
|
12011
|
+
description: "View chart of accounts for an entity",
|
|
12012
|
+
route: { method: "GET", path: "/v1/treasury/chart-of-accounts/{eid}" },
|
|
12013
|
+
entity: true,
|
|
12014
|
+
display: { title: "Treasury Chart Of Accounts", cols: ["accounts>Accounts", "#entity_id>ID"] },
|
|
12015
|
+
examples: ["corp treasury chart-of-accounts", "corp treasury chart-of-accounts --json"]
|
|
12016
|
+
},
|
|
12017
|
+
{
|
|
12018
|
+
name: "treasury invoices",
|
|
12019
|
+
description: "Create a new invoice",
|
|
12020
|
+
route: { method: "POST", path: "/v1/treasury/invoices" },
|
|
12021
|
+
entity: true,
|
|
12022
|
+
options: [
|
|
12023
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
12024
|
+
{ flags: "--customer-name <customer-name>", description: "Customer name for the invoice", required: true },
|
|
12025
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
12026
|
+
{ flags: "--due-date <due-date>", description: "Due date (ISO 8601, e.g. 2026-06-30)", required: true }
|
|
12027
|
+
],
|
|
12028
|
+
examples: ["corp treasury invoices --amount-cents 'amount-cents' --customer-name 'customer-name' --description 'description' --due-date 'due-date'"],
|
|
12029
|
+
successTemplate: "Invoices created"
|
|
12030
|
+
},
|
|
12031
|
+
{
|
|
12032
|
+
name: "treasury journal-entries",
|
|
12033
|
+
description: "Create a journal entry",
|
|
12034
|
+
route: { method: "POST", path: "/v1/treasury/journal-entries" },
|
|
12035
|
+
entity: true,
|
|
12036
|
+
options: [
|
|
12037
|
+
{ flags: "--description <description>", description: "Description text", required: true },
|
|
12038
|
+
{ flags: "--effective-date <effective-date>", description: "Effective Date", required: true },
|
|
12039
|
+
{ flags: "--lines <lines>", description: "Lines", required: true, type: "array" }
|
|
12040
|
+
],
|
|
12041
|
+
examples: ["corp treasury journal-entries --description 'description' --effective-date 'effective-date' --lines 'lines'"],
|
|
12042
|
+
successTemplate: "Journal Entries created"
|
|
12043
|
+
},
|
|
12044
|
+
{
|
|
12045
|
+
name: "treasury payment-intents",
|
|
12046
|
+
description: "Create a payment intent",
|
|
12047
|
+
route: { method: "POST", path: "/v1/treasury/payment-intents" },
|
|
12048
|
+
entity: true,
|
|
12049
|
+
options: [
|
|
12050
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
12051
|
+
{ flags: "--currency <currency>", description: "Currency code (e.g. USD)" },
|
|
12052
|
+
{ flags: "--description <description>", description: "Description text" }
|
|
12053
|
+
],
|
|
12054
|
+
examples: ["corp treasury payment-intents --amount-cents 'amount-cents'", "corp treasury payment-intents --json"],
|
|
12055
|
+
successTemplate: "Payment Intents created"
|
|
12056
|
+
},
|
|
12057
|
+
{
|
|
12058
|
+
name: "treasury payouts",
|
|
12059
|
+
description: "Create a payout",
|
|
12060
|
+
route: { method: "POST", path: "/v1/treasury/payouts" },
|
|
12061
|
+
entity: true,
|
|
12062
|
+
options: [
|
|
12063
|
+
{ flags: "--amount-cents <amount-cents>", description: "Amount in cents", required: true, type: "int" },
|
|
12064
|
+
{ flags: "--description <description>", description: "Description text" },
|
|
12065
|
+
{ flags: "--destination <destination>", description: "Destination", required: true }
|
|
12066
|
+
],
|
|
12067
|
+
examples: ["corp treasury payouts --amount-cents 'amount-cents' --destination 'destination'", "corp treasury payouts --json"],
|
|
12068
|
+
successTemplate: "Payouts created"
|
|
12069
|
+
},
|
|
12070
|
+
{
|
|
12071
|
+
name: "treasury seed-chart-of-accounts",
|
|
12072
|
+
description: "Initialize chart of accounts for an entity",
|
|
12073
|
+
route: { method: "POST", path: "/v1/treasury/seed-chart-of-accounts" },
|
|
12074
|
+
entity: true,
|
|
12075
|
+
options: [
|
|
12076
|
+
{ flags: "--template <template>", description: "Template string with {{secret}} placeholders" }
|
|
12077
|
+
],
|
|
12078
|
+
examples: ["corp treasury seed-chart-of-accounts", "corp treasury seed-chart-of-accounts --json"],
|
|
12079
|
+
successTemplate: "Seed Chart Of Accounts created"
|
|
12080
|
+
},
|
|
12081
|
+
{
|
|
12082
|
+
name: "treasury stripe-accounts",
|
|
12083
|
+
description: "Register a Stripe account",
|
|
12084
|
+
route: { method: "POST", path: "/v1/treasury/stripe-accounts" },
|
|
12085
|
+
entity: true,
|
|
12086
|
+
examples: ["corp treasury stripe-accounts"],
|
|
12087
|
+
successTemplate: "Stripe Accounts created"
|
|
12088
|
+
}
|
|
12089
|
+
];
|
|
12090
|
+
}
|
|
12091
|
+
});
|
|
12092
|
+
|
|
12093
|
+
// src/registry/branches.ts
|
|
12094
|
+
var branchCommands;
|
|
12095
|
+
var init_branches = __esm({
|
|
12096
|
+
"src/registry/branches.ts"() {
|
|
12097
|
+
"use strict";
|
|
12098
|
+
branchCommands = [
|
|
12099
|
+
{
|
|
12100
|
+
name: "branches",
|
|
12101
|
+
description: "List branches for an entity repo",
|
|
12102
|
+
route: { method: "GET", path: "/v1/branches" },
|
|
12103
|
+
entity: "query",
|
|
12104
|
+
display: {
|
|
12105
|
+
title: "Branches",
|
|
12106
|
+
cols: ["name>Branch", "head_oid>HEAD"]
|
|
12107
|
+
},
|
|
12108
|
+
examples: ["corp branches", "corp branches --json"]
|
|
12109
|
+
},
|
|
12110
|
+
{
|
|
12111
|
+
name: "branches create",
|
|
12112
|
+
description: "Create a new branch from an existing one",
|
|
12113
|
+
route: { method: "POST", path: "/v1/branches" },
|
|
12114
|
+
entity: "query",
|
|
12115
|
+
options: [
|
|
12116
|
+
{ flags: "--name <name>", description: "Branch name", required: true },
|
|
12117
|
+
{ flags: "--from <branch>", description: "Base branch (default: main)", default: "main" }
|
|
12118
|
+
],
|
|
12119
|
+
successTemplate: "Branch {branch} created at {base_commit}",
|
|
12120
|
+
examples: ["corp branches create --name 'name'", "corp branches create --json"]
|
|
12121
|
+
},
|
|
12122
|
+
{
|
|
12123
|
+
name: "branches merge",
|
|
12124
|
+
description: "Merge a branch into another (default: main)",
|
|
12125
|
+
route: { method: "POST", path: "/v1/branches/{pos}/merge" },
|
|
12126
|
+
entity: "query",
|
|
12127
|
+
args: [{ name: "branch", required: true, description: "Branch to merge" }],
|
|
12128
|
+
options: [
|
|
12129
|
+
{ flags: "--into <branch>", description: "Target branch (default: main)", default: "main" },
|
|
12130
|
+
{ flags: "--squash", description: "Squash merge (default: true)" }
|
|
12131
|
+
],
|
|
12132
|
+
successTemplate: "Merge {strategy}: {commit}",
|
|
12133
|
+
examples: ["corp branches merge <branch>", "corp branches merge --json"]
|
|
12134
|
+
},
|
|
12135
|
+
{
|
|
12136
|
+
name: "branches delete",
|
|
12137
|
+
description: "Delete a branch",
|
|
12138
|
+
route: { method: "DELETE", path: "/v1/branches/{pos}" },
|
|
12139
|
+
entity: "query",
|
|
12140
|
+
args: [{ name: "branch", required: true, description: "Branch to delete" }],
|
|
12141
|
+
successTemplate: "Branch deleted",
|
|
12142
|
+
examples: ["corp branches delete <branch>"]
|
|
12143
|
+
},
|
|
12144
|
+
{
|
|
12145
|
+
name: "branches prune",
|
|
12146
|
+
description: "Prune a merged branch",
|
|
12147
|
+
route: { method: "POST", path: "/v1/branches/{pos}/prune" },
|
|
12148
|
+
entity: "query",
|
|
12149
|
+
args: [{ name: "branch", required: true, description: "Branch to prune" }],
|
|
12150
|
+
successTemplate: "Branch pruned",
|
|
12151
|
+
examples: ["corp branches prune <branch>"]
|
|
9368
12152
|
}
|
|
9369
12153
|
];
|
|
9370
12154
|
}
|
|
@@ -9517,6 +12301,10 @@ var init_registry = __esm({
|
|
|
9517
12301
|
init_work_items();
|
|
9518
12302
|
init_services();
|
|
9519
12303
|
init_admin();
|
|
12304
|
+
init_execution();
|
|
12305
|
+
init_secret_proxies();
|
|
12306
|
+
init_treasury();
|
|
12307
|
+
init_branches();
|
|
9520
12308
|
registry = [
|
|
9521
12309
|
...workspaceCommands,
|
|
9522
12310
|
...entityCommands,
|
|
@@ -9529,7 +12317,11 @@ var init_registry = __esm({
|
|
|
9529
12317
|
...agentCommands,
|
|
9530
12318
|
...workItemCommands,
|
|
9531
12319
|
...serviceCommands,
|
|
9532
|
-
...adminCommands
|
|
12320
|
+
...adminCommands,
|
|
12321
|
+
...executionCommands,
|
|
12322
|
+
...secretProxyCommands,
|
|
12323
|
+
...treasuryCommands,
|
|
12324
|
+
...branchCommands
|
|
9533
12325
|
];
|
|
9534
12326
|
}
|
|
9535
12327
|
});
|
|
@@ -9684,6 +12476,7 @@ async function executeGenericRead(def, ctx) {
|
|
|
9684
12476
|
path = path.replace("{pos}", encodeURIComponent(ctx.positional[posIdx++]));
|
|
9685
12477
|
}
|
|
9686
12478
|
path = path.replace("{wid}", encodeURIComponent(ctx.client.workspaceId));
|
|
12479
|
+
path = path.replace("{workspace_id}", encodeURIComponent(ctx.client.workspaceId));
|
|
9687
12480
|
if (def.optQP) {
|
|
9688
12481
|
for (const optName of def.optQP) {
|
|
9689
12482
|
const val = ctx.opts[optName];
|
|
@@ -9721,6 +12514,77 @@ async function executeGenericRead(def, ctx) {
|
|
|
9721
12514
|
ctx.writer.json(data);
|
|
9722
12515
|
}
|
|
9723
12516
|
}
|
|
12517
|
+
async function executeGenericWrite(def, ctx) {
|
|
12518
|
+
if (!def.route?.path || !def.route?.method) {
|
|
12519
|
+
ctx.writer.error("No route defined for this command");
|
|
12520
|
+
return;
|
|
12521
|
+
}
|
|
12522
|
+
let path = def.route.path;
|
|
12523
|
+
let posIdx = 0;
|
|
12524
|
+
if (def.entity) {
|
|
12525
|
+
let eid;
|
|
12526
|
+
const explicitEid = ctx.opts["entity-id"];
|
|
12527
|
+
if (explicitEid) {
|
|
12528
|
+
eid = await ctx.resolver.resolveEntity(explicitEid);
|
|
12529
|
+
} else if (def.entity === true && !path.includes("{pos}") && ctx.positional[posIdx]) {
|
|
12530
|
+
eid = await ctx.resolver.resolveEntity(ctx.positional[posIdx++]);
|
|
12531
|
+
} else {
|
|
12532
|
+
eid = ctx.entityId;
|
|
12533
|
+
}
|
|
12534
|
+
if (eid) {
|
|
12535
|
+
path = path.replace("{eid}", encodeURIComponent(eid));
|
|
12536
|
+
} else if (path.includes("{eid}")) {
|
|
12537
|
+
ctx.writer.error("Entity ID required. Use --entity-id or set active entity with 'corp use <name>'.");
|
|
12538
|
+
return;
|
|
12539
|
+
}
|
|
12540
|
+
}
|
|
12541
|
+
if (path.includes("{pos}")) {
|
|
12542
|
+
if (!ctx.positional[posIdx]) {
|
|
12543
|
+
ctx.writer.error("Missing required argument (ID or reference).");
|
|
12544
|
+
return;
|
|
12545
|
+
}
|
|
12546
|
+
path = path.replace("{pos}", encodeURIComponent(ctx.positional[posIdx++]));
|
|
12547
|
+
}
|
|
12548
|
+
if (path.includes("{pos2}")) {
|
|
12549
|
+
if (!ctx.positional[posIdx]) {
|
|
12550
|
+
ctx.writer.error("Missing required second argument (ID or reference).");
|
|
12551
|
+
return;
|
|
12552
|
+
}
|
|
12553
|
+
path = path.replace("{pos2}", encodeURIComponent(ctx.positional[posIdx++]));
|
|
12554
|
+
}
|
|
12555
|
+
path = path.replace("{wid}", encodeURIComponent(ctx.client.workspaceId));
|
|
12556
|
+
path = path.replace("{workspace_id}", encodeURIComponent(ctx.client.workspaceId));
|
|
12557
|
+
const body = {};
|
|
12558
|
+
if (def.entity && ctx.entityId) {
|
|
12559
|
+
body.entity_id = ctx.entityId;
|
|
12560
|
+
}
|
|
12561
|
+
for (const opt of def.options ?? []) {
|
|
12562
|
+
const match = opt.flags.match(/^--([a-z0-9-]+)/);
|
|
12563
|
+
if (!match) continue;
|
|
12564
|
+
const camelKey = match[1].replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
12565
|
+
const val = ctx.opts[camelKey];
|
|
12566
|
+
if (val != null && camelKey !== "entityId" && camelKey !== "json") {
|
|
12567
|
+
body[match[1].replace(/-/g, "_")] = val;
|
|
12568
|
+
}
|
|
12569
|
+
}
|
|
12570
|
+
if (ctx.dryRun) {
|
|
12571
|
+
ctx.writer.dryRun(def.name.replace(/ /g, "."), body);
|
|
12572
|
+
return;
|
|
12573
|
+
}
|
|
12574
|
+
const data = await withSpinner(
|
|
12575
|
+
"Submitting",
|
|
12576
|
+
() => ctx.client.submitJSON(def.route.method, path, Object.keys(body).length ? body : void 0),
|
|
12577
|
+
ctx.opts.json
|
|
12578
|
+
);
|
|
12579
|
+
if (ctx.opts.json) {
|
|
12580
|
+
ctx.writer.json(data);
|
|
12581
|
+
return;
|
|
12582
|
+
}
|
|
12583
|
+
const result = data;
|
|
12584
|
+
const idKey = result ? Object.keys(result).find((k) => k.endsWith("_id")) : void 0;
|
|
12585
|
+
const idVal = idKey && result ? result[idKey] : void 0;
|
|
12586
|
+
ctx.writer.success(`${def.description ?? def.name}: ${idVal ?? "OK"}`);
|
|
12587
|
+
}
|
|
9724
12588
|
|
|
9725
12589
|
// src/writer.ts
|
|
9726
12590
|
init_output();
|
|
@@ -9810,7 +12674,45 @@ function buildCLI(commands, version) {
|
|
|
9810
12674
|
for (const [parentName, childDefs] of children) {
|
|
9811
12675
|
let parentCmd = parentCmds.get(parentName);
|
|
9812
12676
|
if (!parentCmd) {
|
|
9813
|
-
|
|
12677
|
+
const parentDescriptions = {
|
|
12678
|
+
workspaces: "Workspace management",
|
|
12679
|
+
workspace: "Workspace settings",
|
|
12680
|
+
equity: "Equity system (low-level grants, holders, instruments)",
|
|
12681
|
+
execution: "Execution intents, obligations, and approval artifacts",
|
|
12682
|
+
meetings: "Meeting management (convene, adjourn, notice)",
|
|
12683
|
+
compliance: "Compliance escalations and monitoring",
|
|
12684
|
+
contractors: "Contractor classification",
|
|
12685
|
+
admin: "Admin tools (audit, billing, SSH keys, secrets)",
|
|
12686
|
+
auth: "Authentication and API key management",
|
|
12687
|
+
references: "Reference tracking and sync",
|
|
12688
|
+
secrets: "Secret management and proxy configuration",
|
|
12689
|
+
"document-requests": "Document request fulfillment",
|
|
12690
|
+
intents: "Execution intent management",
|
|
12691
|
+
"bank-accounts": "Bank account management",
|
|
12692
|
+
"journal-entries": "Ledger journal entries",
|
|
12693
|
+
ledger: "Ledger operations and reconciliation",
|
|
12694
|
+
payroll: "Payroll runs",
|
|
12695
|
+
payments: "Payment submission and tracking",
|
|
12696
|
+
invoices: "Invoice management",
|
|
12697
|
+
treasury: "Treasury, invoices, payments, and payouts",
|
|
12698
|
+
"governance-seats": "Governance seat management",
|
|
12699
|
+
"governance-bodies": "Governance body management",
|
|
12700
|
+
"human-obligations": "Human obligation fulfillment",
|
|
12701
|
+
"ssh-keys": "SSH key management",
|
|
12702
|
+
"secret-proxies": "Secret proxy configuration",
|
|
12703
|
+
formations: "Formation workflows (low-level API)",
|
|
12704
|
+
valuations: "Valuation management",
|
|
12705
|
+
branches: "Git branch management",
|
|
12706
|
+
digests: "Digest generation and viewing",
|
|
12707
|
+
obligations: "Obligation tracking and fulfillment",
|
|
12708
|
+
"spending-limits": "Spending limit management",
|
|
12709
|
+
receipts: "Execution receipts",
|
|
12710
|
+
"share-transfers": "Share transfer workflows",
|
|
12711
|
+
"safe-notes": "SAFE note management",
|
|
12712
|
+
distributions: "Distribution management",
|
|
12713
|
+
deadlines: "Compliance deadline management"
|
|
12714
|
+
};
|
|
12715
|
+
parentCmd = program2.command(parentName).description(parentDescriptions[parentName] ?? "");
|
|
9814
12716
|
parentCmds.set(parentName, parentCmd);
|
|
9815
12717
|
}
|
|
9816
12718
|
for (const def of childDefs) {
|
|
@@ -9855,6 +12757,13 @@ function wireCommand(parent, def) {
|
|
|
9855
12757
|
...prev || [],
|
|
9856
12758
|
v
|
|
9857
12759
|
];
|
|
12760
|
+
if (opt.hidden) {
|
|
12761
|
+
const o = new Option(opt.flags, opt.description);
|
|
12762
|
+
o.hideHelp();
|
|
12763
|
+
if (coerce) o.argParser(coerce);
|
|
12764
|
+
cmd.addOption(o);
|
|
12765
|
+
continue;
|
|
12766
|
+
}
|
|
9858
12767
|
if (opt.choices && opt.choices.length > 0) {
|
|
9859
12768
|
const o = new Option(opt.flags, opt.description);
|
|
9860
12769
|
o.choices(opt.choices);
|
|
@@ -9945,10 +12854,20 @@ function wireCommand(parent, def) {
|
|
|
9945
12854
|
await def.handler(ctx);
|
|
9946
12855
|
} else if (def.display) {
|
|
9947
12856
|
await executeGenericRead(def, ctx);
|
|
12857
|
+
} else if (def.route && def.route.method !== "GET") {
|
|
12858
|
+
await executeGenericWrite(def, ctx);
|
|
9948
12859
|
} else {
|
|
9949
12860
|
writer.error(`Command "${def.name}" has no handler or display config`);
|
|
9950
12861
|
process.exit(1);
|
|
9951
12862
|
}
|
|
12863
|
+
if (def.produces?.kind && !def.handler && !quiet && !mergedOpts.json) {
|
|
12864
|
+
const kind = def.produces.kind;
|
|
12865
|
+
const lastId = resolver.getLastId(kind);
|
|
12866
|
+
if (lastId) {
|
|
12867
|
+
const shortRef = lastId.length > 12 ? lastId.slice(0, 8) + "\u2026" : lastId;
|
|
12868
|
+
console.log(` Ref: @last:${kind} \u2192 ${shortRef}`);
|
|
12869
|
+
}
|
|
12870
|
+
}
|
|
9952
12871
|
} catch (err) {
|
|
9953
12872
|
writer.error(`Failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
9954
12873
|
process.exit(1);
|