@dain-os/mcp-server 0.10.0 → 0.11.0

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.
Files changed (52) hide show
  1. package/dist/tools/proposal-content-catalogue.d.ts.map +1 -1
  2. package/dist/tools/proposal-content-catalogue.js +42 -0
  3. package/dist/tools/proposal-content-catalogue.js.map +1 -1
  4. package/package.json +1 -1
  5. package/dist/tools/cadence.d.ts +0 -4
  6. package/dist/tools/cadence.d.ts.map +0 -1
  7. package/dist/tools/cadence.js +0 -245
  8. package/dist/tools/cadence.js.map +0 -1
  9. package/dist/tools/comments.d.ts +0 -3
  10. package/dist/tools/comments.d.ts.map +0 -1
  11. package/dist/tools/comments.js +0 -19
  12. package/dist/tools/comments.js.map +0 -1
  13. package/dist/tools/developer.d.ts +0 -3
  14. package/dist/tools/developer.d.ts.map +0 -1
  15. package/dist/tools/developer.js +0 -349
  16. package/dist/tools/developer.js.map +0 -1
  17. package/dist/tools/iam.d.ts +0 -3
  18. package/dist/tools/iam.d.ts.map +0 -1
  19. package/dist/tools/iam.js +0 -38
  20. package/dist/tools/iam.js.map +0 -1
  21. package/dist/tools/log-time-entry.d.ts +0 -3
  22. package/dist/tools/log-time-entry.d.ts.map +0 -1
  23. package/dist/tools/log-time-entry.js +0 -54
  24. package/dist/tools/log-time-entry.js.map +0 -1
  25. package/dist/tools/pr-review.d.ts +0 -3
  26. package/dist/tools/pr-review.d.ts.map +0 -1
  27. package/dist/tools/pr-review.js +0 -83
  28. package/dist/tools/pr-review.js.map +0 -1
  29. package/dist/tools/products.d.ts +0 -3
  30. package/dist/tools/products.d.ts.map +0 -1
  31. package/dist/tools/products.js +0 -37
  32. package/dist/tools/products.js.map +0 -1
  33. package/dist/tools/projects.d.ts +0 -3
  34. package/dist/tools/projects.d.ts.map +0 -1
  35. package/dist/tools/projects.js +0 -151
  36. package/dist/tools/projects.js.map +0 -1
  37. package/dist/tools/proposal-content.d.ts +0 -3
  38. package/dist/tools/proposal-content.d.ts.map +0 -1
  39. package/dist/tools/proposal-content.js +0 -136
  40. package/dist/tools/proposal-content.js.map +0 -1
  41. package/dist/tools/proposal-options.d.ts +0 -3
  42. package/dist/tools/proposal-options.d.ts.map +0 -1
  43. package/dist/tools/proposal-options.js +0 -132
  44. package/dist/tools/proposal-options.js.map +0 -1
  45. package/dist/tools/proposals.d.ts +0 -22
  46. package/dist/tools/proposals.d.ts.map +0 -1
  47. package/dist/tools/proposals.js +0 -179
  48. package/dist/tools/proposals.js.map +0 -1
  49. package/dist/tools/tasks.d.ts +0 -3
  50. package/dist/tools/tasks.d.ts.map +0 -1
  51. package/dist/tools/tasks.js +0 -255
  52. package/dist/tools/tasks.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AAEH,8EAA8E;AAC9E,gEAAgE;AAChE,8EAA8E;AAE9E,MAAM,kBAAkB,GAAmB;IACzC,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EACT,2PAA2P;IAC7P,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,sDAAsD,CAAC;QACzF,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;KAC5E,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,KAAe,CAAC,CAAC;QAC3C,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,IAAc,CAAC,CAAC;QACzC,OAAO,MAAM,CAAC,GAAG,CAAC,0BAA0B,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;CACF,CAAC;AAEF,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAE9E,MAAM,qBAAqB,GAAmB;IAC5C,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EACT,+WAA+W;IACjX,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;KAC3D,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAC/B,MAAM,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,SAAmB,gBAAgB,CAAC;CACrE,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAqB,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ToolDefinition } from './types.js';
2
- export declare const projectTools: ToolDefinition[];
3
- //# sourceMappingURL=projects.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAiKjD,eAAO,MAAM,YAAY,EAAE,cAAc,EAQxC,CAAC"}
@@ -1,151 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Project tools. Five operations: list, get, create, update, archive.
4
- *
5
- * Descriptions are written for the model, not the user — they appear in the
6
- * tool-discovery output and shape how the model decides which tool to call.
7
- */
8
- const projectStatusEnum = z.enum([
9
- 'planning',
10
- 'active',
11
- 'on_hold',
12
- 'completed',
13
- 'archived',
14
- 'cancelled',
15
- ]);
16
- const listProjects = {
17
- name: 'list_projects',
18
- description: 'List projects in the current workspace. Returns id, name, code, status, and progress for each. Use this to discover project ids before calling get_project / create_task / list_tasks.',
19
- inputSchema: z.object({
20
- status: projectStatusEnum
21
- .optional()
22
- .describe('Filter by status. Omit to return all non-archived projects.'),
23
- limit: z.coerce.number().int().min(1).max(100).optional().describe('Default 25, max 100.'),
24
- }),
25
- handler: async (client, input) => {
26
- const params = new URLSearchParams();
27
- if (input.status)
28
- params.set('status', input.status);
29
- if (input.limit !== undefined)
30
- params.set('limit', String(input.limit));
31
- const query = params.toString() ? `?${params.toString()}` : '';
32
- const result = await client.get(`/projects${query}`);
33
- // The API returns all statuses regardless of filter, so when the caller
34
- // didn't specify a status we hide archived projects client-side to honour
35
- // the documented "no longer appears in list_projects by default" contract.
36
- if (input.status === undefined && Array.isArray(result)) {
37
- return result.filter((project) => typeof project === 'object' &&
38
- project !== null &&
39
- project.status !== 'archived');
40
- }
41
- return result;
42
- },
43
- };
44
- const getProject = {
45
- name: 'get_project',
46
- description: 'Get one project by id. Returns full project details including tasks count, members, owner, and client company.',
47
- inputSchema: z.object({
48
- id: z.string().uuid().describe('Project id (UUID). Get one from list_projects.'),
49
- }),
50
- handler: async (client, input) => client.get(`/projects/${input.id}`),
51
- };
52
- const createProject = {
53
- name: 'create_project',
54
- description: 'Create a new project. Only `name` is required. Returns the created project with its id.',
55
- inputSchema: z.object({
56
- name: z.string().min(1).max(200).describe('Project name. Required.'),
57
- description: z.string().max(2000).optional(),
58
- clientCompanyId: z.string().uuid().optional().describe('Link to a client company.'),
59
- ownerId: z.string().uuid().optional().describe('User id of the project owner.'),
60
- projectType: z
61
- .enum(['internal', 'client', 'product', 'research'])
62
- .optional()
63
- .describe('Defaults to "client" on the server.'),
64
- billingMethod: z
65
- .enum(['fixed', 'hourly', 'retainer', 'non_billable'])
66
- .optional(),
67
- startDate: z.string().optional().describe('ISO 8601 date.'),
68
- targetEndDate: z.string().optional().describe('ISO 8601 date.'),
69
- budgetHours: z.coerce.number().min(0).optional(),
70
- budgetAmount: z.coerce.number().min(0).optional(),
71
- priority: z.coerce.number().int().min(0).max(100).optional(),
72
- tags: z.array(z.string()).optional(),
73
- }),
74
- handler: async (client, input) => client.post('/projects', input),
75
- };
76
- const updateProject = {
77
- name: 'update_project',
78
- description: 'Update an existing project. Pass any subset of fields; omitted fields are left unchanged. Use this to rename, change status, retarget the end date, etc.',
79
- inputSchema: z.object({
80
- id: z.string().uuid(),
81
- name: z.string().min(1).max(200).optional(),
82
- description: z.string().max(2000).optional(),
83
- status: projectStatusEnum.optional(),
84
- ownerId: z.string().uuid().optional(),
85
- startDate: z.string().optional(),
86
- targetEndDate: z.string().optional(),
87
- budgetHours: z.coerce.number().min(0).optional(),
88
- budgetAmount: z.coerce.number().min(0).optional(),
89
- priority: z.coerce.number().int().min(0).max(100).optional(),
90
- tags: z.array(z.string()).optional(),
91
- }),
92
- handler: async (client, input) => {
93
- const { id, ...rest } = input;
94
- return client.put(`/projects/${id}`, rest);
95
- },
96
- };
97
- const archiveProject = {
98
- name: 'archive_project',
99
- description: 'Archive a project. The project is soft-deleted (status -> archived) and no longer appears in list_projects by default. Existing tasks remain accessible by id.',
100
- inputSchema: z.object({
101
- id: z.string().uuid(),
102
- }),
103
- handler: async (client, input) => client.delete(`/projects/${input.id}`),
104
- };
105
- const listMilestones = {
106
- name: 'list_milestones',
107
- description: 'List milestones for a project. Returns id, name, status, start/due dates, and tasks_count for each. Call this before create_task so the new task can be attached to the right milestone — orphan tasks (projectId without milestoneId) are a code smell and clutter the project view.',
108
- inputSchema: z.object({
109
- projectId: z
110
- .string()
111
- .uuid()
112
- .describe('Project id (UUID). Get one from list_projects.'),
113
- }),
114
- handler: async (client, input) => client.get(`/projects/${input.projectId}/milestones`),
115
- };
116
- const milestoneStatusEnum = z.enum([
117
- 'pending',
118
- 'in_progress',
119
- 'completed',
120
- 'cancelled',
121
- ]);
122
- const updateMilestone = {
123
- name: 'update_milestone',
124
- description: 'Update a milestone on a project. Pass any subset of fields. Covers rename, schedule (startDate/dueDate), status walk, billing toggle, and sort order. projectId + milestoneId are both required because the server route is nested.',
125
- inputSchema: z.object({
126
- projectId: z.string().uuid().describe('Parent project id. Get one from list_projects.'),
127
- milestoneId: z.string().uuid().describe('Milestone id. Get one from list_milestones.'),
128
- name: z.string().min(1).max(200).optional(),
129
- description: z.string().max(2000).nullable().optional(),
130
- startDate: z.string().nullable().optional().describe('ISO 8601 or null to clear.'),
131
- dueDate: z.string().nullable().optional().describe('ISO 8601 or null to clear.'),
132
- status: milestoneStatusEnum.optional(),
133
- isBillable: z.boolean().optional(),
134
- billableAmount: z.coerce.number().min(0).nullable().optional(),
135
- sortOrder: z.coerce.number().int().min(0).optional(),
136
- }),
137
- handler: async (client, input) => {
138
- const { projectId, milestoneId, ...rest } = input;
139
- return client.put(`/projects/${projectId}/milestones/${milestoneId}`, rest);
140
- },
141
- };
142
- export const projectTools = [
143
- listProjects,
144
- getProject,
145
- createProject,
146
- updateProject,
147
- archiveProject,
148
- listMilestones,
149
- updateMilestone,
150
- ];
151
- //# sourceMappingURL=projects.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/tools/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;GAKG;AAEH,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/B,UAAU;IACV,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,YAAY,GAAmB;IACnC,IAAI,EAAE,eAAe;IACrB,WAAW,EACT,wLAAwL;IAC1L,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,iBAAiB;aACtB,QAAQ,EAAE;aACV,QAAQ,CAAC,6DAA6D,CAAC;QAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GA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AAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACrD,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;QAC/B,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;QAClD,OAAO,MAAM,CAAC,GAAG,CAAC,aAAa,SAAS,eAAe,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC;IAC9E,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,YAAY;IACZ,UAAU;IACV,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,eAAe;CAChB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ToolDefinition } from './types.js';
2
- export declare const proposalContentTools: ToolDefinition[];
3
- //# sourceMappingURL=proposal-content.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-content.d.ts","sourceRoot":"","sources":["../../src/tools/proposal-content.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA6JjD,eAAO,MAAM,oBAAoB,EAAE,cAAc,EAShD,CAAC"}
@@ -1,136 +0,0 @@
1
- import { z } from 'zod';
2
- import { buildBlockCatalogue } from './proposal-content-catalogue.js';
3
- /**
4
- * Proposal content tools (8). Granular ops let the LLM ship only the bytes
5
- * it is changing rather than re-sending the whole content_json blob.
6
- *
7
- * Content shape (v2): `{ version: 2, sections: [{ id, key, title, visible?,
8
- * blocks: ContentBlock[] }] }`.
9
- *
10
- * Block types (8): text, cards, diagram, chart, table, image, gantt, iframe.
11
- * For the full schema of each block call `describe_proposal_block_types`.
12
- *
13
- * All mutations are validated server-side. An ops batch is rejected as
14
- * INVALID_FINAL_STATE if the resulting content doesn't pass the API's
15
- * `proposalContentV2Schema` (e.g. iframe block on a non-allowlisted host).
16
- */
17
- // Section / block payloads. These are intentionally permissive at the JSON
18
- // Schema layer -- the API enforces the strict shape. The LLM uses the
19
- // description fields + describe_proposal_block_types for guidance.
20
- const blockSchema = z.record(z.unknown()).describe('A content block. Required fields: `id` (string), `type` (one of: text, cards, diagram, chart, table, image, gantt, iframe). Per-type extra fields are documented by the describe_proposal_block_types tool.');
21
- const sectionSchema = z.record(z.unknown()).describe('A section. Required fields: `id` (string), `key` (slug), `title` (string), `blocks` (array of block objects). Optional: `visible` (boolean, defaults true).');
22
- const getProposalContent = {
23
- name: 'get_proposal_content',
24
- description: 'Get the structured content (sections + blocks) for a proposal. Returns `{ version: 2, sections: [...] }`. Lighter than get_proposal -- use this when you only need the section/block structure (e.g. before editing). Empty / legacy-version content_json returns an empty v2 envelope; mutations against legacy content require starting with a `replaceAll` op.',
25
- inputSchema: z.object({
26
- proposalId: z.string().uuid(),
27
- }),
28
- handler: async (client, input) => client.get(`/crm/proposals/${input.proposalId}/content`),
29
- };
30
- const describeProposalBlockTypes = {
31
- name: 'describe_proposal_block_types',
32
- description: 'Return the catalogue of available proposal content block types: their schemas, minimal + rich examples, when to use each, default section keys, and any gotchas (e.g. the iframe host allowlist). Call this first when drafting new content -- it is the canonical reference for what you can put inside a proposal section.',
33
- inputSchema: z.object({}),
34
- handler: async () => buildBlockCatalogue(),
35
- };
36
- const upsertProposalSection = {
37
- name: 'upsert_proposal_section',
38
- description: 'Add a new section or replace an existing one (matched by `key`). The section is a full object including its blocks array, so the API can validate cohesively. To edit a single block inside an existing section without re-sending the whole section, use upsert_proposal_block instead.',
39
- inputSchema: z.object({
40
- proposalId: z.string().uuid(),
41
- section: sectionSchema,
42
- }),
43
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
44
- ops: [{ kind: 'upsertSection', section: input.section }],
45
- }),
46
- };
47
- const deleteProposalSection = {
48
- name: 'delete_proposal_section',
49
- description: 'Delete a section from the proposal content by `key`. Returns SECTION_NOT_FOUND if the key does not match any section. All blocks in that section are removed with it.',
50
- inputSchema: z.object({
51
- proposalId: z.string().uuid(),
52
- key: z.string().min(1).max(120).describe('The section key, e.g. "executive_summary".'),
53
- }),
54
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
55
- ops: [{ kind: 'deleteSection', key: input.key }],
56
- }),
57
- };
58
- const upsertProposalBlock = {
59
- name: 'upsert_proposal_block',
60
- description: 'Add a new block to a section or replace an existing block by id within that section. The block must conform to the schema for its `type` -- see describe_proposal_block_types for per-type fields. This is the right tool for fine-grained content edits because you only send one block, not the whole section.',
61
- inputSchema: z.object({
62
- proposalId: z.string().uuid(),
63
- sectionKey: z.string().min(1).max(120).describe('The key of the parent section.'),
64
- block: blockSchema,
65
- }),
66
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
67
- ops: [
68
- {
69
- kind: 'upsertBlock',
70
- sectionKey: input.sectionKey,
71
- block: input.block,
72
- },
73
- ],
74
- }),
75
- };
76
- const deleteProposalBlock = {
77
- name: 'delete_proposal_block',
78
- description: 'Delete a block from a section by id. Returns BLOCK_NOT_FOUND if the id does not match any block in that section.',
79
- inputSchema: z.object({
80
- proposalId: z.string().uuid(),
81
- sectionKey: z.string().min(1).max(120),
82
- blockId: z.string().min(1).max(120),
83
- }),
84
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
85
- ops: [
86
- {
87
- kind: 'deleteBlock',
88
- sectionKey: input.sectionKey,
89
- blockId: input.blockId,
90
- },
91
- ],
92
- }),
93
- };
94
- const reorderProposalBlocks = {
95
- name: 'reorder_proposal_blocks',
96
- description: 'Reorder the blocks within a single section. `blockIds` must be a permutation of every current block id in that section -- the API returns REORDER_MISMATCH if any id is missing or duplicated.',
97
- inputSchema: z.object({
98
- proposalId: z.string().uuid(),
99
- sectionKey: z.string().min(1).max(120),
100
- blockIds: z
101
- .array(z.string().min(1).max(120))
102
- .min(1)
103
- .describe('Every block id currently in the section, in the new desired order.'),
104
- }),
105
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
106
- ops: [
107
- {
108
- kind: 'reorderBlocks',
109
- sectionKey: input.sectionKey,
110
- blockIds: input.blockIds,
111
- },
112
- ],
113
- }),
114
- };
115
- const replaceProposalContent = {
116
- name: 'replace_proposal_content',
117
- description: 'Replace ALL sections of the proposal with a new sections array. Use this sparingly: only for full regeneration, wholesale rewrites, or migrating a legacy (non-v2) content_json to v2. For fine-grained edits prefer upsert_proposal_section / upsert_proposal_block etc. -- they are token-cheap and easier to reason about.',
118
- inputSchema: z.object({
119
- proposalId: z.string().uuid(),
120
- sections: z.array(sectionSchema),
121
- }),
122
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/content`, {
123
- ops: [{ kind: 'replaceAll', sections: input.sections }],
124
- }),
125
- };
126
- export const proposalContentTools = [
127
- getProposalContent,
128
- describeProposalBlockTypes,
129
- upsertProposalSection,
130
- deleteProposalSection,
131
- upsertProposalBlock,
132
- deleteProposalBlock,
133
- reorderProposalBlocks,
134
- replaceProposalContent,
135
- ];
136
- //# sourceMappingURL=proposal-content.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-content.js","sourceRoot":"","sources":["../../src/tools/proposal-content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;;;;;;;;;;GAaG;AAEH,2EAA2E;AAC3E,sEAAsE;AACtE,mEAAmE;AAEnE,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAChD,6MAA6M,CAC9M,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAClD,6JAA6J,CAC9J,CAAC;AAEF,MAAM,kBAAkB,GAAmB;IACzC,I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C7C,IAAI,EAAE,0BAA0B;IAChC,WAAW,EACT,+TAA+T;IACjU,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAC7B,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;KACjC,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAC/B,MAAM,CAAC,KAAK,CAAC,kBAAkB,KAAK,CAAC,UAAU,UAAU,EAAE;QACzD,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;KACxD,CAAC;CACL,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAqB;IACpD,kBAAkB;IAClB,0BAA0B;IAC1B,qBAAqB;IACrB,qBAAqB;IACrB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,sBAAsB;CACvB,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { ToolDefinition } from './types.js';
2
- export declare const proposalOptionTools: ToolDefinition[];
3
- //# sourceMappingURL=proposal-options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-options.d.ts","sourceRoot":"","sources":["../../src/tools/proposal-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA6IjD,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAM/C,CAAC"}
@@ -1,132 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Proposal-options tools. Five operations: list, create, update, delete,
4
- * set_recommended.
5
- *
6
- * Pricing model semantics (mirrors the API's `applyPricingModelRefinement`):
7
- * - retainer -> monthlyAmount required
8
- * - fixed_fee -> oneTimeAmount required
9
- * - ad_hoc -> dayRate required
10
- * - blended -> oneTimeAmount AND dayRate required
11
- *
12
- * Only one option per proposal may be marked `recommended`. The API enforces
13
- * this atomically (partial UNIQUE index + sibling-clear inside one
14
- * transaction), so calling `set_recommended_option` will safely swap the
15
- * recommended flag from any previously-recommended option onto the target.
16
- */
17
- const pricingModelEnum = z.enum(['retainer', 'fixed_fee', 'ad_hoc', 'blended']);
18
- const baseOptionFields = z.object({
19
- title: z.string().min(1).max(255).describe('Display title for this option (e.g. "Retainer", "Fixed-fee build").'),
20
- description: z.string().max(10_000).nullable().optional(),
21
- pricingModel: pricingModelEnum,
22
- currencyId: z.string().uuid().nullable().optional(),
23
- monthlyAmount: z
24
- .number()
25
- .nonnegative()
26
- .nullable()
27
- .optional()
28
- .describe('Required when pricingModel is "retainer".'),
29
- oneTimeAmount: z
30
- .number()
31
- .nonnegative()
32
- .nullable()
33
- .optional()
34
- .describe('Required when pricingModel is "fixed_fee" or "blended".'),
35
- dayRate: z
36
- .number()
37
- .nonnegative()
38
- .nullable()
39
- .optional()
40
- .describe('Required when pricingModel is "ad_hoc" or "blended".'),
41
- discountPercentage: z.coerce.number().min(0).max(100).nullable().optional(),
42
- discountAmount: z.coerce.number().nonnegative().nullable().optional(),
43
- taxRate: z.coerce.number().min(0).max(100).nullable().optional(),
44
- taxAmount: z.coerce.number().nonnegative().nullable().optional(),
45
- termMonths: z.coerce.number().int().nonnegative().nullable().optional(),
46
- noticePeriodWeeks: z.coerce.number().int().nonnegative().nullable().optional(),
47
- recommended: z
48
- .boolean()
49
- .optional()
50
- .describe('Mark this option as the recommended one. At most one option per proposal can be recommended; the API atomically clears the previous recommendation when set.'),
51
- clauseSetKey: z
52
- .string()
53
- .min(1)
54
- .max(255)
55
- .describe('Identifier for the contract clause set this option will compose against on accept.'),
56
- servicesSchedule: z.string().nullable().optional(),
57
- });
58
- const listProposalOptions = {
59
- name: 'list_proposal_options',
60
- description: 'List the pricing options for a proposal, in display order. Each option carries its pricing-model-specific amounts, term, notice period, and a `recommended` flag (at most one option per proposal is recommended at a time).',
61
- inputSchema: z.object({
62
- proposalId: z.string().uuid(),
63
- }),
64
- handler: async (client, input) => client.get(`/crm/proposals/${input.proposalId}/options`),
65
- };
66
- const createProposalOption = {
67
- name: 'create_proposal_option',
68
- description: 'Create a new pricing option on a proposal. The new option is appended to the end of the existing options (display_order = max + 1). Pricing-model-specific amount fields are required: retainer needs monthlyAmount; fixed_fee needs oneTimeAmount; ad_hoc needs dayRate; blended needs both oneTimeAmount and dayRate. Setting `recommended: true` here will atomically clear the recommended flag on any other option of this proposal.',
69
- inputSchema: baseOptionFields.extend({
70
- proposalId: z.string().uuid(),
71
- }),
72
- handler: async (client, input) => {
73
- const { proposalId, ...body } = input;
74
- return client.post(`/crm/proposals/${proposalId}/options`, body);
75
- },
76
- };
77
- const updateProposalOption = {
78
- name: 'update_proposal_option',
79
- description: 'Update a proposal option. Pass any subset of fields; omitted fields are left unchanged. Pricing-model refinement still applies when `pricingModel` is sent (e.g. switching to retainer requires monthlyAmount). To mark this option as recommended, prefer `set_recommended_option` for clarity, though passing `recommended: true` here works too.',
80
- inputSchema: z.object({
81
- proposalId: z.string().uuid(),
82
- optionId: z.string().uuid(),
83
- title: z.string().min(1).max(255).optional(),
84
- description: z.string().max(10_000).nullable().optional(),
85
- pricingModel: pricingModelEnum.optional(),
86
- currencyId: z.string().uuid().nullable().optional(),
87
- monthlyAmount: z.coerce.number().nonnegative().nullable().optional(),
88
- oneTimeAmount: z.coerce.number().nonnegative().nullable().optional(),
89
- dayRate: z.coerce.number().nonnegative().nullable().optional(),
90
- discountPercentage: z.coerce.number().min(0).max(100).nullable().optional(),
91
- discountAmount: z.coerce.number().nonnegative().nullable().optional(),
92
- taxRate: z.coerce.number().min(0).max(100).nullable().optional(),
93
- taxAmount: z.coerce.number().nonnegative().nullable().optional(),
94
- termMonths: z.coerce.number().int().nonnegative().nullable().optional(),
95
- noticePeriodWeeks: z.coerce.number().int().nonnegative().nullable().optional(),
96
- recommended: z.boolean().optional(),
97
- clauseSetKey: z.string().min(1).max(255).optional(),
98
- servicesSchedule: z.string().nullable().optional(),
99
- }),
100
- handler: async (client, input) => {
101
- const { proposalId, optionId, ...body } = input;
102
- return client.patch(`/crm/proposals/${proposalId}/options/${optionId}`, body);
103
- },
104
- };
105
- const setRecommendedOption = {
106
- name: 'set_recommended_option',
107
- description: 'Mark one option as the recommended option on its proposal. Atomically clears the recommended flag from any other option of the same proposal. Use this in preference to `update_proposal_option` when the only change is the recommendation, to make the intent explicit.',
108
- inputSchema: z.object({
109
- proposalId: z.string().uuid(),
110
- optionId: z.string().uuid(),
111
- }),
112
- handler: async (client, input) => client.patch(`/crm/proposals/${input.proposalId}/options/${input.optionId}`, {
113
- recommended: true,
114
- }),
115
- };
116
- const deleteProposalOption = {
117
- name: 'delete_proposal_option',
118
- description: 'Delete a proposal option. Cascades to any line items scoped to that option. Display order on remaining options is left as-is; the API treats display_order as a sort key, not a contiguous sequence.',
119
- inputSchema: z.object({
120
- proposalId: z.string().uuid(),
121
- optionId: z.string().uuid(),
122
- }),
123
- handler: async (client, input) => client.delete(`/crm/proposals/${input.proposalId}/options/${input.optionId}`),
124
- };
125
- export const proposalOptionTools = [
126
- listProposalOptions,
127
- createProposalOption,
128
- updateProposalOption,
129
- setRecommendedOption,
130
- deleteProposalOption,
131
- ];
132
- //# sourceMappingURL=proposal-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposal-options.js","sourceRoot":"","sources":["../../src/tools/proposal-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;GAcG;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,C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,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;KAC5B,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAC/B,MAAM,CAAC,KAAK,CAAC,kBAAkB,KAAK,CAAC,UAAU,YAAY,KAAK,CAAC,QAAQ,EAAE,EAAE;QAC3E,WAAW,EAAE,IAAI;KAClB,CAAC;CACL,CAAC;AAEF,MAAM,oBAAoB,GAAmB;IAC3C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EACT,sMAAsM;IACxM,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;QAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;KAC5B,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAC/B,MAAM,CAAC,MAAM,CAAC,kBAAkB,KAAK,CAAC,UAAU,YAAY,KAAK,CAAC,QAAQ,EAAE,CAAC;CAChF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,mBAAmB;IACnB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;IACpB,oBAAoB;CACrB,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { ToolDefinition } from './types.js';
2
- /**
3
- * Coerce a proposal payload from the API into a shape that includes a
4
- * computed `shareUrl`. The API already returns `shareToken` -- we layer the
5
- * fully-qualified URL on top so the LLM never has to construct it from
6
- * fragments.
7
- */
8
- declare function addShareUrl<T extends Record<string, unknown>>(proposal: T): T & {
9
- shareUrl: string | null;
10
- };
11
- export declare const proposalTools: ToolDefinition[];
12
- /**
13
- * Exported for tests so they can assert on the computed shareUrl rule
14
- * without spinning up the full handler stack.
15
- */
16
- export declare const __testables: {
17
- addShareUrl: typeof addShareUrl;
18
- SHARE_URL_BASE: string;
19
- SHAREABLE_STATUSES: Set<string>;
20
- };
21
- export {};
22
- //# sourceMappingURL=proposals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"proposals.d.ts","sourceRoot":"","sources":["../../src/tools/proposals.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA4CjD;;;;;GAKG;AACH,iBAAS,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAMpG;AA+HD,eAAO,MAAM,aAAa,EAAE,cAAc,EAOzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;CAAsD,CAAC"}