@opencapstack/mcp-server 0.1.2 → 0.1.4
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/auth.d.ts.map +1 -1
- package/dist/auth.js +5 -1
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +17 -5
- package/dist/client.js.map +1 -1
- package/dist/schema.d.ts +13 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +22 -0
- package/dist/schema.js.map +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +5 -1
- package/dist/server.js.map +1 -1
- package/dist/tools/dilution.d.ts.map +1 -1
- package/dist/tools/dilution.js +6 -13
- package/dist/tools/dilution.js.map +1 -1
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +3 -2
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/equityGrants.d.ts +3 -0
- package/dist/tools/equityGrants.d.ts.map +1 -0
- package/dist/tools/equityGrants.js +145 -0
- package/dist/tools/equityGrants.js.map +1 -0
- package/dist/tools/equityPlans.d.ts.map +1 -1
- package/dist/tools/equityPlans.js +30 -16
- package/dist/tools/equityPlans.js.map +1 -1
- package/dist/tools/financialReports.d.ts.map +1 -1
- package/dist/tools/financialReports.js +33 -17
- package/dist/tools/financialReports.js.map +1 -1
- package/dist/tools/meta.d.ts +3 -0
- package/dist/tools/meta.d.ts.map +1 -0
- package/dist/tools/meta.js +136 -0
- package/dist/tools/meta.js.map +1 -0
- package/dist/tools/safes.d.ts.map +1 -1
- package/dist/tools/safes.js +59 -42
- package/dist/tools/safes.js.map +1 -1
- package/dist/tools/shareClasses.d.ts.map +1 -1
- package/dist/tools/shareClasses.js +31 -23
- package/dist/tools/shareClasses.js.map +1 -1
- package/dist/tools/stakeholders.d.ts.map +1 -1
- package/dist/tools/stakeholders.js +51 -17
- package/dist/tools/stakeholders.js.map +1 -1
- package/dist/tools/valuations.d.ts.map +1 -1
- package/dist/tools/valuations.js +30 -17
- package/dist/tools/valuations.js.map +1 -1
- package/dist/tools/waterfall.d.ts.map +1 -1
- package/dist/tools/waterfall.js +7 -16
- package/dist/tools/waterfall.js.map +1 -1
- package/package.json +1 -1
- package/src/auth.ts +7 -1
- package/src/client.ts +23 -6
- package/src/schema.ts +28 -0
- package/src/server.ts +5 -1
- package/src/tools/dilution.ts +12 -13
- package/src/tools/documents.ts +3 -2
- package/src/tools/equityGrants.ts +154 -0
- package/src/tools/equityPlans.ts +30 -16
- package/src/tools/financialReports.ts +37 -17
- package/src/tools/meta.ts +142 -0
- package/src/tools/safes.ts +59 -42
- package/src/tools/shareClasses.ts +34 -23
- package/src/tools/stakeholders.ts +51 -17
- package/src/tools/valuations.ts +29 -20
- package/src/tools/waterfall.ts +13 -16
package/dist/auth.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,SAAS,IAAI,MAAM,CASlC;AAED,wBAAgB,UAAU,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,SAAS,IAAI,MAAM,CASlC;AAED,wBAAgB,UAAU,IAAI,MAAM,CAQnC"}
|
package/dist/auth.js
CHANGED
|
@@ -11,6 +11,10 @@ export function getApiKey() {
|
|
|
11
11
|
return key;
|
|
12
12
|
}
|
|
13
13
|
export function getBaseUrl() {
|
|
14
|
-
|
|
14
|
+
const url = process.env.OPENCAP_BASE_URL ?? 'https://api.opencapstack.com';
|
|
15
|
+
if (url.includes('/api/v1')) {
|
|
16
|
+
process.stderr.write(`Warning: OPENCAP_BASE_URL should not include /api/v1 — tools already prefix this path. Current value: ${url}\n`);
|
|
17
|
+
}
|
|
18
|
+
return url;
|
|
15
19
|
}
|
|
16
20
|
//# sourceMappingURL=auth.js.map
|
package/dist/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,iDAAiD;YAC/C,2DAA2D,CAC9D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,UAAU,SAAS;IACvB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACxC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,iDAAiD;YAC/C,2DAA2D,CAC9D,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,8BAA8B,CAAC;IAC3E,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,yGAAyG,GAAG,IAAI,CACjH,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIlD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAc,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAIlD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAsD1D"}
|
package/dist/client.js
CHANGED
|
@@ -15,15 +15,27 @@ export function createClient(apiKey) {
|
|
|
15
15
|
});
|
|
16
16
|
client.interceptors.response.use((response) => response, (error) => {
|
|
17
17
|
const status = error.response?.status;
|
|
18
|
+
const message = error.response?.data?.message ??
|
|
19
|
+
error.response?.data?.error ??
|
|
20
|
+
error.message ??
|
|
21
|
+
'Unknown error';
|
|
22
|
+
const path = error.config?.url ?? '';
|
|
18
23
|
if (status === 401) {
|
|
19
|
-
throw new McpError(ErrorCode.InvalidRequest, 'API key rejected or expired
|
|
24
|
+
throw new McpError(ErrorCode.InvalidRequest, 'API key rejected or expired. Regenerate at https://app.opencapstack.com/settings, or run the whoami tool to test your current key.');
|
|
20
25
|
}
|
|
21
26
|
if (status === 403) {
|
|
22
|
-
throw new McpError(ErrorCode.InvalidRequest, 'Access denied
|
|
27
|
+
throw new McpError(ErrorCode.InvalidRequest, 'Access denied. Check that your token companyId matches the companyId in your request.');
|
|
23
28
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
if (status === 404) {
|
|
30
|
+
const idHint = path.match(/\/([^/]+)$/)
|
|
31
|
+
? ' Make sure you are using the domain ID field (e.g. safeId, row_id) from a list_* call, not the _id field.'
|
|
32
|
+
: '';
|
|
33
|
+
throw new McpError(ErrorCode.InvalidRequest, `Record not found.${idHint}`);
|
|
34
|
+
}
|
|
35
|
+
if (status === 500) {
|
|
36
|
+
throw new McpError(ErrorCode.InternalError, `Server error saving record: ${message}. Check that all referenced IDs exist (e.g. equityPlanId, employeeId, companyId) and try again.`);
|
|
37
|
+
}
|
|
38
|
+
throw new McpError(ErrorCode.InternalError, `OpenCap API error (${status}): ${message}`);
|
|
27
39
|
});
|
|
28
40
|
return client;
|
|
29
41
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,UAAU,EAAE;QACrB,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAC9B,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EACtB,CAAC,KAAK,EAAE,EAAE;QACR,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAA6B,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,UAAU,YAAY,CAAC,MAAc;IACzC,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC1B,OAAO,EAAE,UAAU,EAAE;QACrB,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,MAAM,EAAE;YACjC,cAAc,EAAE,kBAAkB;SACnC;QACD,O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AAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/schema.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod coercion helpers for MCP tool input schemas.
|
|
3
|
+
*
|
|
4
|
+
* MCP clients (including Claude Code) send all arguments as strings. These
|
|
5
|
+
* helpers accept both the native type and a string representation and coerce
|
|
6
|
+
* to the appropriate JavaScript primitive so tools work correctly regardless
|
|
7
|
+
* of how the client serialises values.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export declare const coerceInt: (description: string) => z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodString]>, number, string | number>;
|
|
11
|
+
export declare const coerceFloat: (description: string) => z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodString]>, number, string | number>;
|
|
12
|
+
export declare const coerceBool: (description: string) => z.ZodEffects<z.ZodUnion<[z.ZodBoolean, z.ZodString]>, boolean, string | boolean>;
|
|
13
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,SAAS,GAAI,aAAa,MAAM,kFAInB,CAAC;AAE3B,eAAO,MAAM,WAAW,GAAI,aAAa,MAAM,kFAIrB,CAAC;AAE3B,eAAO,MAAM,UAAU,GAAI,aAAa,MAAM,qFAIpB,CAAC"}
|
package/dist/schema.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod coercion helpers for MCP tool input schemas.
|
|
3
|
+
*
|
|
4
|
+
* MCP clients (including Claude Code) send all arguments as strings. These
|
|
5
|
+
* helpers accept both the native type and a string representation and coerce
|
|
6
|
+
* to the appropriate JavaScript primitive so tools work correctly regardless
|
|
7
|
+
* of how the client serialises values.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
export const coerceInt = (description) => z
|
|
11
|
+
.union([z.number(), z.string()])
|
|
12
|
+
.transform((v) => parseInt(String(v), 10))
|
|
13
|
+
.describe(description);
|
|
14
|
+
export const coerceFloat = (description) => z
|
|
15
|
+
.union([z.number(), z.string()])
|
|
16
|
+
.transform((v) => parseFloat(String(v)))
|
|
17
|
+
.describe(description);
|
|
18
|
+
export const coerceBool = (description) => z
|
|
19
|
+
.union([z.boolean(), z.string()])
|
|
20
|
+
.transform((v) => v === true || v === 'true')
|
|
21
|
+
.describe(description);
|
|
22
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,WAAmB,EAAE,EAAE,CAC/C,CAAC;KACE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/B,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;KACzC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,WAAmB,EAAE,EAAE,CACjD,CAAC;KACE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KAC/B,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACvC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAE3B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,WAAmB,EAAE,EAAE,CAChD,CAAC;KACE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;KAChC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,MAAM,CAAC;KAC5C,QAAQ,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAQnE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAQnE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAc3C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,QAAA,MAAM,SAAS,EAAE,cAAc,EAY9B,CAAC;AAEF,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAiD1D;AAKD,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -13,10 +13,14 @@ import { valuationTools } from './tools/valuations.js';
|
|
|
13
13
|
import { dilutionTools } from './tools/dilution.js';
|
|
14
14
|
import { waterfallTools } from './tools/waterfall.js';
|
|
15
15
|
import { financialReportTools } from './tools/financialReports.js';
|
|
16
|
+
import { equityGrantTools } from './tools/equityGrants.js';
|
|
17
|
+
import { metaTools } from './tools/meta.js';
|
|
16
18
|
const ALL_TOOLS = [
|
|
19
|
+
...metaTools,
|
|
17
20
|
...stakeholderTools,
|
|
18
21
|
...shareClassTools,
|
|
19
22
|
...equityPlanTools,
|
|
23
|
+
...equityGrantTools,
|
|
20
24
|
...safeTools,
|
|
21
25
|
...documentTools,
|
|
22
26
|
...valuationTools,
|
|
@@ -27,7 +31,7 @@ const ALL_TOOLS = [
|
|
|
27
31
|
export function createServer(client) {
|
|
28
32
|
const server = new Server({
|
|
29
33
|
name: 'opencap-mcp',
|
|
30
|
-
version: '0.1.
|
|
34
|
+
version: '0.1.4',
|
|
31
35
|
}, {
|
|
32
36
|
capabilities: {
|
|
33
37
|
tools: {},
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GAGvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OA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AAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,OAAO,EAAE,EAAE,CAAC;gBAC3D,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,4DAA4D;AAC5D,KAAK,oBAAoB,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dilution.d.ts","sourceRoot":"","sources":["../../src/tools/dilution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dilution.d.ts","sourceRoot":"","sources":["../../src/tools/dilution.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,cAAc,EAgDzC,CAAC"}
|
package/dist/tools/dilution.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { coerceInt, coerceBool } from '../schema.js';
|
|
2
3
|
export const dilutionTools = [
|
|
3
4
|
{
|
|
4
5
|
name: 'calculate_dilution',
|
|
@@ -6,21 +7,13 @@ export const dilutionTools = [
|
|
|
6
7
|
'Returns pre- and post-dilution ownership percentages for each stakeholder.',
|
|
7
8
|
inputSchema: z.object({
|
|
8
9
|
companyId: z.string().describe('Company ID'),
|
|
9
|
-
newSharesIssued:
|
|
10
|
-
|
|
11
|
-
.int()
|
|
12
|
-
.positive()
|
|
13
|
-
.describe('Number of new shares to be issued in the scenario'),
|
|
14
|
-
includeOptionPool: z
|
|
15
|
-
.boolean()
|
|
10
|
+
newSharesIssued: coerceInt('Number of new shares to be issued in the scenario'),
|
|
11
|
+
includeOptionPool: coerceBool('Whether to include unissued option pool shares in the denominator')
|
|
16
12
|
.optional()
|
|
17
|
-
.default(false)
|
|
18
|
-
|
|
19
|
-
includeSafes: z
|
|
20
|
-
.boolean()
|
|
13
|
+
.default(false),
|
|
14
|
+
includeSafes: coerceBool('Whether to include SAFEs in conversion when calculating dilution')
|
|
21
15
|
.optional()
|
|
22
|
-
.default(true)
|
|
23
|
-
.describe('Whether to include SAFEs in conversion when calculating dilution'),
|
|
16
|
+
.default(true),
|
|
24
17
|
}),
|
|
25
18
|
handler: async (input, client) => {
|
|
26
19
|
const { data } = await client.post('/api/v1/dilution/calculate', input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dilution.js","sourceRoot":"","sources":["../../src/tools/dilution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"dilution.js","sourceRoot":"","sources":["../../src/tools/dilution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,qFAAqF;YACrF,4EAA4E;QAC9E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5C,eAAe,EAAE,SAAS,CACxB,mDAAmD,CACpD;YACD,iBAAiB,EAAE,UAAU,CAC3B,mEAAmE,CACpE;iBACE,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;YACjB,YAAY,EAAE,UAAU,CACtB,kEAAkE,CACnE;iBACE,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,CAAC;SACjB,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;YACxE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACjE,CAAC;QACJ,CAAC;KACF;IACD;QACE,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,0EAA0E;YAC1E,wEAAwE;QAC1E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5C,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,2EAA2E,CAAC;SACzF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,gCAAgC,EAAE;gBAClE,MAAM,EAAE,KAAK;aACd,CAAC,CAAC;YACH,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9E,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,aAAa,EAAE,cAAc,EAsEzC,CAAC"}
|
package/dist/tools/documents.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { coerceInt } from '../schema.js';
|
|
2
3
|
export const documentTools = [
|
|
3
4
|
{
|
|
4
5
|
name: 'list_documents',
|
|
@@ -20,7 +21,7 @@ export const documentTools = [
|
|
|
20
21
|
.string()
|
|
21
22
|
.optional()
|
|
22
23
|
.describe('Filter documents associated with a stakeholder'),
|
|
23
|
-
limit:
|
|
24
|
+
limit: coerceInt('Max results to return').optional().default(50),
|
|
24
25
|
}),
|
|
25
26
|
handler: async (input, client) => {
|
|
26
27
|
const { data } = await client.get('/api/v1/documents', { params: input });
|
|
@@ -58,7 +59,7 @@ export const documentTools = [
|
|
|
58
59
|
])
|
|
59
60
|
.optional()
|
|
60
61
|
.describe('Filter by document type'),
|
|
61
|
-
limit:
|
|
62
|
+
limit: coerceInt('Max results to return').optional().default(20),
|
|
62
63
|
}),
|
|
63
64
|
handler: async (input, client) => {
|
|
64
65
|
const { data } = await client.get('/api/v1/documents/search', { params: input });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/tools/documents.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,iGAAiG;QACnG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YACjE,YAAY,EAAE,CAAC;iBACZ,IAAI,CAAC;gBACJ,uBAAuB;gBACvB,cAAc;gBACd,eAAe;gBACf,MAAM;gBACN,a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 -0,0 +1,145 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { coerceInt, coerceFloat } from '../schema.js';
|
|
3
|
+
export const equityGrantTools = [
|
|
4
|
+
{
|
|
5
|
+
name: 'list_equity_grants',
|
|
6
|
+
description: 'List all equity grants (options, RSAs, RSUs, etc.) for a company. ' +
|
|
7
|
+
'Use the `grantId` field from results for follow-up operations, not the `_id` field.',
|
|
8
|
+
inputSchema: z.object({
|
|
9
|
+
companyId: z.string().describe('Company ID'),
|
|
10
|
+
limit: coerceInt('Max results to return').optional().default(50),
|
|
11
|
+
}),
|
|
12
|
+
handler: async (input, client) => {
|
|
13
|
+
const { data } = await client.get('/api/v1/equity-grants', { params: input });
|
|
14
|
+
const grants = data.grants ?? data;
|
|
15
|
+
return {
|
|
16
|
+
content: [{ type: 'text', text: JSON.stringify(grants, null, 2) }],
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'get_equity_grant',
|
|
22
|
+
description: 'Get details for a specific equity grant by ID. ' +
|
|
23
|
+
'Use the `grantId` field from `list_equity_grants`, not the `_id` field.',
|
|
24
|
+
inputSchema: z.object({
|
|
25
|
+
id: z
|
|
26
|
+
.string()
|
|
27
|
+
.describe('Grant ID — use the `grantId` field from list_equity_grants, not `_id`'),
|
|
28
|
+
}),
|
|
29
|
+
handler: async (input, client) => {
|
|
30
|
+
const { data } = await client.get(`/api/v1/equity-grants/${input.id}`);
|
|
31
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'create_equity_grant',
|
|
36
|
+
description: 'Create a new equity grant for an employee or advisor. ' +
|
|
37
|
+
'Use the `grantId` field from list_equity_grants for follow-up operations, not the `_id` field.',
|
|
38
|
+
inputSchema: z.object({
|
|
39
|
+
companyId: z.string().describe('Company ID'),
|
|
40
|
+
employeeId: z
|
|
41
|
+
.string()
|
|
42
|
+
.describe('Stakeholder ID of the grantee — use the `row_id` from list_stakeholders'),
|
|
43
|
+
equityPlanId: z
|
|
44
|
+
.string()
|
|
45
|
+
.describe('Equity plan ID — use the `row_id` from list_equity_plans'),
|
|
46
|
+
grantType: z
|
|
47
|
+
.enum(['ISO', 'NSO', 'RSA', 'RSU', 'SAR', 'other'])
|
|
48
|
+
.describe('Type of equity grant'),
|
|
49
|
+
numberOfShares: coerceInt('Number of shares in this grant'),
|
|
50
|
+
grantDate: z.string().describe('Grant date in ISO 8601 format (YYYY-MM-DD)'),
|
|
51
|
+
vestingStartDate: z
|
|
52
|
+
.string()
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('Vesting start date in ISO 8601 format (YYYY-MM-DD). Defaults to grantDate.'),
|
|
55
|
+
strikePrice: coerceFloat('Exercise/strike price per share in USD (required for options)').optional(),
|
|
56
|
+
vestingSchedule: z
|
|
57
|
+
.object({
|
|
58
|
+
totalMonths: coerceInt('Total vesting period in months'),
|
|
59
|
+
cliffMonths: coerceInt('Cliff period in months'),
|
|
60
|
+
})
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('Vesting schedule for this grant. Overrides the equity plan default.'),
|
|
63
|
+
notes: z.string().optional().describe('Free-text notes about this grant'),
|
|
64
|
+
}),
|
|
65
|
+
handler: async (input, client) => {
|
|
66
|
+
const { data: created } = await client.post('/api/v1/equity-grants', input);
|
|
67
|
+
const id = created.grantId ?? created.row_id ?? created._id;
|
|
68
|
+
try {
|
|
69
|
+
const { data: confirmed } = await client.get(`/api/v1/equity-grants/${id}`);
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: `Equity grant created:\n${JSON.stringify(confirmed, null, 2)}\n\nID for follow-up operations: ${id}`,
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return {
|
|
81
|
+
content: [
|
|
82
|
+
{
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `Equity grant created (could not confirm persisted state — verify with get_equity_grant):\n${JSON.stringify(created, null, 2)}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'update_equity_grant',
|
|
93
|
+
description: 'Update the status of an equity grant (e.g. approve, cancel, mark as exercised). ' +
|
|
94
|
+
'Use the `grantId` field from `list_equity_grants`, not the `_id` field.',
|
|
95
|
+
inputSchema: z.object({
|
|
96
|
+
id: z
|
|
97
|
+
.string()
|
|
98
|
+
.describe('Grant ID — use the `grantId` field from list_equity_grants, not `_id`'),
|
|
99
|
+
status: z
|
|
100
|
+
.enum(['pending', 'approved', 'active', 'exercised', 'cancelled', 'expired'])
|
|
101
|
+
.describe('New status for the grant'),
|
|
102
|
+
}),
|
|
103
|
+
handler: async (input, client) => {
|
|
104
|
+
const { id, ...body } = input;
|
|
105
|
+
const { data: updated } = await client.patch(`/api/v1/equity-grants/${id}/status`, body);
|
|
106
|
+
try {
|
|
107
|
+
const { data: confirmed } = await client.get(`/api/v1/equity-grants/${id}`);
|
|
108
|
+
return {
|
|
109
|
+
content: [
|
|
110
|
+
{
|
|
111
|
+
type: 'text',
|
|
112
|
+
text: `Equity grant updated:\n${JSON.stringify(confirmed, null, 2)}\n\nID for follow-up operations: ${id}`,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return {
|
|
119
|
+
content: [
|
|
120
|
+
{
|
|
121
|
+
type: 'text',
|
|
122
|
+
text: `Equity grant updated (could not confirm persisted state — verify with get_equity_grant):\n${JSON.stringify(updated, null, 2)}`,
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'get_vesting_schedule',
|
|
131
|
+
description: 'Get the full vesting schedule for a specific equity grant — shows each vesting event, ' +
|
|
132
|
+
'cliff date, and cumulative shares vested over time. ' +
|
|
133
|
+
'Use the `grantId` field from `list_equity_grants`, not the `_id` field.',
|
|
134
|
+
inputSchema: z.object({
|
|
135
|
+
id: z
|
|
136
|
+
.string()
|
|
137
|
+
.describe('Grant ID — use the `grantId` field from list_equity_grants, not `_id`'),
|
|
138
|
+
}),
|
|
139
|
+
handler: async (input, client) => {
|
|
140
|
+
const { data } = await client.get(`/api/v1/equity-grants/${input.id}/vesting`);
|
|
141
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
];
|
|
145
|
+
//# sourceMappingURL=equityGrants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"equityGrants.js","sourceRoot":"","sources":["../../src/tools/equityGrants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtD,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,oEAAoE;YACpE,qFAAqF;QACvF,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC5C,KAAK,EAAE,SAAS,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;SACjE,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;YAC9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oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,6FAA6F,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;yBACtI;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EACT,wFAAwF;YACxF,sDAAsD;YACtD,yEAAyE;QAC3E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,EAAE,EAAE,CAAC;iBACF,MAAM,EAAE;iBACR,QAAQ,CAAC,uEAAuE,CAAC;SACrF,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC/B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,yBAAyB,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;YAC/E,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9E,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equityPlans.d.ts","sourceRoot":"","sources":["../../src/tools/equityPlans.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"equityPlans.d.ts","sourceRoot":"","sources":["../../src/tools/equityPlans.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,eAAe,EAAE,cAAc,EA4E3C,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { coerceInt } from '../schema.js';
|
|
2
3
|
export const equityPlanTools = [
|
|
3
4
|
{
|
|
4
5
|
name: 'list_equity_plans',
|
|
5
6
|
description: 'List all equity plans (stock option plans, RSU plans, etc.) in the company.',
|
|
6
7
|
inputSchema: z.object({
|
|
7
8
|
companyId: z.string().optional().describe('Filter by company ID'),
|
|
8
|
-
limit:
|
|
9
|
+
limit: coerceInt('Max results to return').optional().default(50),
|
|
9
10
|
}),
|
|
10
11
|
handler: async (input, client) => {
|
|
11
12
|
const { data } = await client.get('/api/v1/equity-plans', { params: input });
|
|
@@ -17,9 +18,9 @@ export const equityPlanTools = [
|
|
|
17
18
|
},
|
|
18
19
|
{
|
|
19
20
|
name: 'get_equity_plan',
|
|
20
|
-
description: 'Get details for a specific equity plan by ID.',
|
|
21
|
+
description: 'Get details for a specific equity plan by ID. Use the `row_id` field from `list_equity_plans`.',
|
|
21
22
|
inputSchema: z.object({
|
|
22
|
-
id: z.string().describe('Equity plan ID'),
|
|
23
|
+
id: z.string().describe('Equity plan ID — use the `row_id` field from list_equity_plans'),
|
|
23
24
|
}),
|
|
24
25
|
handler: async (input, client) => {
|
|
25
26
|
const { data } = await client.get(`/api/v1/equity-plans/${input.id}`);
|
|
@@ -34,11 +35,7 @@ export const equityPlanTools = [
|
|
|
34
35
|
planType: z
|
|
35
36
|
.enum(['ISO', 'NSO', 'RSA', 'RSU', 'SAR', 'other'])
|
|
36
37
|
.describe('Type of equity plan'),
|
|
37
|
-
sharesReserved:
|
|
38
|
-
.number()
|
|
39
|
-
.int()
|
|
40
|
-
.positive()
|
|
41
|
-
.describe('Number of shares reserved for this plan'),
|
|
38
|
+
sharesReserved: coerceInt('Number of shares reserved for this plan'),
|
|
42
39
|
companyId: z.string().describe('Company ID this plan belongs to'),
|
|
43
40
|
expirationDate: z
|
|
44
41
|
.string()
|
|
@@ -46,19 +43,36 @@ export const equityPlanTools = [
|
|
|
46
43
|
.describe('Plan expiration date in ISO 8601 format (YYYY-MM-DD)'),
|
|
47
44
|
defaultVestingSchedule: z
|
|
48
45
|
.object({
|
|
49
|
-
totalMonths:
|
|
50
|
-
cliffMonths:
|
|
46
|
+
totalMonths: coerceInt('Total vesting period in months'),
|
|
47
|
+
cliffMonths: coerceInt('Cliff period in months'),
|
|
51
48
|
})
|
|
52
49
|
.optional()
|
|
53
50
|
.describe('Default vesting schedule for grants under this plan'),
|
|
54
51
|
}),
|
|
55
52
|
handler: async (input, client) => {
|
|
56
|
-
const { data } = await client.post('/api/v1/equity-plans', input);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
const { data: created } = await client.post('/api/v1/equity-plans', input);
|
|
54
|
+
const id = created.row_id ?? created._id;
|
|
55
|
+
try {
|
|
56
|
+
const { data: confirmed } = await client.get(`/api/v1/equity-plans/${id}`);
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: `Equity plan created:\n${JSON.stringify(confirmed, null, 2)}\n\nID for follow-up operations: ${id}`,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: 'text',
|
|
71
|
+
text: `Equity plan created (could not confirm persisted state — verify with get_equity_plan):\n${JSON.stringify(created, null, 2)}`,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
62
76
|
},
|
|
63
77
|
},
|
|
64
78
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equityPlans.js","sourceRoot":"","sources":["../../src/tools/equityPlans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"equityPlans.js","sourceRoot":"","sources":["../../src/tools/equityPlans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;A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AO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,yBAAyB,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,oCAAoC,EAAE,EAAE;yBAC1G;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,2FAA2F,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE;yBACpI;qBACF;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"financialReports.d.ts","sourceRoot":"","sources":["../../src/tools/financialReports.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"financialReports.d.ts","sourceRoot":"","sources":["../../src/tools/financialReports.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAiGhD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { coerceInt, coerceBool } from '../schema.js';
|
|
2
3
|
export const financialReportTools = [
|
|
3
4
|
{
|
|
4
5
|
name: 'list_financial_reports',
|
|
@@ -15,7 +16,7 @@ export const financialReportTools = [
|
|
|
15
16
|
])
|
|
16
17
|
.optional()
|
|
17
18
|
.describe('Filter by report type'),
|
|
18
|
-
limit:
|
|
19
|
+
limit: coerceInt('Max results to return').optional().default(20),
|
|
19
20
|
}),
|
|
20
21
|
handler: async (input, client) => {
|
|
21
22
|
const { data } = await client.get('/api/v1/financial-reports', { params: input });
|
|
@@ -27,9 +28,11 @@ export const financialReportTools = [
|
|
|
27
28
|
},
|
|
28
29
|
{
|
|
29
30
|
name: 'get_financial_report',
|
|
30
|
-
description: 'Get the full contents of a specific financial report by ID.',
|
|
31
|
+
description: 'Get the full contents of a specific financial report by ID. Use the `row_id` field from `list_financial_reports`.',
|
|
31
32
|
inputSchema: z.object({
|
|
32
|
-
id: z
|
|
33
|
+
id: z
|
|
34
|
+
.string()
|
|
35
|
+
.describe('Financial report ID — use the `row_id` field from list_financial_reports'),
|
|
33
36
|
}),
|
|
34
37
|
handler: async (input, client) => {
|
|
35
38
|
const { data } = await client.get(`/api/v1/financial-reports/${input.id}`);
|
|
@@ -54,25 +57,38 @@ export const financialReportTools = [
|
|
|
54
57
|
.string()
|
|
55
58
|
.optional()
|
|
56
59
|
.describe('Generate the report as of this date (ISO 8601 YYYY-MM-DD). Defaults to today.'),
|
|
57
|
-
includeConvertibles:
|
|
58
|
-
.boolean()
|
|
60
|
+
includeConvertibles: coerceBool('Include convertible instruments (SAFEs, notes) in the report')
|
|
59
61
|
.optional()
|
|
60
|
-
.default(true)
|
|
61
|
-
|
|
62
|
-
includeOptionPool: z
|
|
63
|
-
.boolean()
|
|
62
|
+
.default(true),
|
|
63
|
+
includeOptionPool: coerceBool('Include option pool (granted and unissued) in the report')
|
|
64
64
|
.optional()
|
|
65
|
-
.default(true)
|
|
66
|
-
.describe('Include option pool (granted and unissued) in the report'),
|
|
65
|
+
.default(true),
|
|
67
66
|
title: z.string().optional().describe('Custom report title'),
|
|
68
67
|
}),
|
|
69
68
|
handler: async (input, client) => {
|
|
70
|
-
const { data } = await client.post('/api/v1/financial-reports', input);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
69
|
+
const { data: created } = await client.post('/api/v1/financial-reports', input);
|
|
70
|
+
const id = created.row_id ?? created._id;
|
|
71
|
+
try {
|
|
72
|
+
const { data: confirmed } = await client.get(`/api/v1/financial-reports/${id}`);
|
|
73
|
+
return {
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: 'text',
|
|
77
|
+
text: `Financial report created:\n${JSON.stringify(confirmed, null, 2)}\n\nID for follow-up operations: ${id}`,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return {
|
|
84
|
+
content: [
|
|
85
|
+
{
|
|
86
|
+
type: 'text',
|
|
87
|
+
text: `Financial report created (could not confirm persisted state — verify with get_financial_report):\n${JSON.stringify(created, null, 2)}`,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
};
|
|
91
|
+
}
|
|
76
92
|
},
|
|
77
93
|
},
|
|
78
94
|
];
|