@agllama/mcp 0.1.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 (87) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +249 -0
  3. package/dist/api-client.d.ts +71 -0
  4. package/dist/api-client.d.ts.map +1 -0
  5. package/dist/api-client.js +315 -0
  6. package/dist/api-client.js.map +1 -0
  7. package/dist/index.d.ts +3 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +18 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/server.d.ts +4 -0
  12. package/dist/server.d.ts.map +1 -0
  13. package/dist/server.js +495 -0
  14. package/dist/server.js.map +1 -0
  15. package/dist/tools/backlog.d.ts +16 -0
  16. package/dist/tools/backlog.d.ts.map +1 -0
  17. package/dist/tools/backlog.js +59 -0
  18. package/dist/tools/backlog.js.map +1 -0
  19. package/dist/tools/boards.d.ts +62 -0
  20. package/dist/tools/boards.d.ts.map +1 -0
  21. package/dist/tools/boards.js +158 -0
  22. package/dist/tools/boards.js.map +1 -0
  23. package/dist/tools/comments.d.ts +82 -0
  24. package/dist/tools/comments.d.ts.map +1 -0
  25. package/dist/tools/comments.js +162 -0
  26. package/dist/tools/comments.js.map +1 -0
  27. package/dist/tools/connect.d.ts +7 -0
  28. package/dist/tools/connect.d.ts.map +1 -0
  29. package/dist/tools/connect.js +61 -0
  30. package/dist/tools/connect.js.map +1 -0
  31. package/dist/tools/context.d.ts +16 -0
  32. package/dist/tools/context.d.ts.map +1 -0
  33. package/dist/tools/context.js +79 -0
  34. package/dist/tools/context.js.map +1 -0
  35. package/dist/tools/help.d.ts +13 -0
  36. package/dist/tools/help.d.ts.map +1 -0
  37. package/dist/tools/help.js +421 -0
  38. package/dist/tools/help.js.map +1 -0
  39. package/dist/tools/index.d.ts +17 -0
  40. package/dist/tools/index.d.ts.map +1 -0
  41. package/dist/tools/index.js +17 -0
  42. package/dist/tools/index.js.map +1 -0
  43. package/dist/tools/issueLinks.d.ts +45 -0
  44. package/dist/tools/issueLinks.d.ts.map +1 -0
  45. package/dist/tools/issueLinks.js +90 -0
  46. package/dist/tools/issueLinks.js.map +1 -0
  47. package/dist/tools/issues.d.ts +127 -0
  48. package/dist/tools/issues.d.ts.map +1 -0
  49. package/dist/tools/issues.js +262 -0
  50. package/dist/tools/issues.js.map +1 -0
  51. package/dist/tools/labels.d.ts +56 -0
  52. package/dist/tools/labels.d.ts.map +1 -0
  53. package/dist/tools/labels.js +123 -0
  54. package/dist/tools/labels.js.map +1 -0
  55. package/dist/tools/members.d.ts +13 -0
  56. package/dist/tools/members.d.ts.map +1 -0
  57. package/dist/tools/members.js +43 -0
  58. package/dist/tools/members.js.map +1 -0
  59. package/dist/tools/organizations.d.ts +35 -0
  60. package/dist/tools/organizations.d.ts.map +1 -0
  61. package/dist/tools/organizations.js +116 -0
  62. package/dist/tools/organizations.js.map +1 -0
  63. package/dist/tools/projects.d.ts +67 -0
  64. package/dist/tools/projects.d.ts.map +1 -0
  65. package/dist/tools/projects.js +165 -0
  66. package/dist/tools/projects.js.map +1 -0
  67. package/dist/tools/search.d.ts +34 -0
  68. package/dist/tools/search.d.ts.map +1 -0
  69. package/dist/tools/search.js +62 -0
  70. package/dist/tools/search.js.map +1 -0
  71. package/dist/tools/sprints.d.ts +141 -0
  72. package/dist/tools/sprints.d.ts.map +1 -0
  73. package/dist/tools/sprints.js +380 -0
  74. package/dist/tools/sprints.js.map +1 -0
  75. package/dist/tools/status.d.ts +22 -0
  76. package/dist/tools/status.d.ts.map +1 -0
  77. package/dist/tools/status.js +44 -0
  78. package/dist/tools/status.js.map +1 -0
  79. package/dist/tools/workflows.d.ts +137 -0
  80. package/dist/tools/workflows.d.ts.map +1 -0
  81. package/dist/tools/workflows.js +355 -0
  82. package/dist/tools/workflows.js.map +1 -0
  83. package/dist/types.d.ts +312 -0
  84. package/dist/types.d.ts.map +1 -0
  85. package/dist/types.js +5 -0
  86. package/dist/types.js.map +1 -0
  87. package/package.json +63 -0
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+ import { getApiClient, LlamaApiError } from '../api-client.js';
3
+ export const updateStatusToolName = 'llama_update_status';
4
+ export const updateStatusToolDescription = `Move an issue to a different status in the workflow.
5
+ First use llama_context to see available statuses for the project.
6
+
7
+ Common status names: "To Do", "In Progress", "In Review", "Done"
8
+ The exact names depend on the project's workflow configuration.`;
9
+ export const updateStatusToolSchema = z.object({
10
+ orgSlug: z.string().describe('Organization slug'),
11
+ projectKey: z.string().describe('Project key'),
12
+ issueKey: z.string().describe('Issue key to update'),
13
+ statusId: z.string().describe('Status ID to transition to (from workflow.statuses)'),
14
+ });
15
+ export async function executeUpdateStatus(input) {
16
+ try {
17
+ const client = getApiClient();
18
+ const issue = await client.updateIssue(input.orgSlug, input.projectKey, input.issueKey, { statusId: input.statusId });
19
+ return JSON.stringify({
20
+ success: true,
21
+ message: `Moved ${issue.key} to status "${issue.status}"`,
22
+ issue: {
23
+ key: issue.key,
24
+ summary: issue.summary,
25
+ status: issue.status,
26
+ statusCategory: issue.statusCategory,
27
+ },
28
+ }, null, 2);
29
+ }
30
+ catch (error) {
31
+ if (error instanceof LlamaApiError) {
32
+ return JSON.stringify({
33
+ success: false,
34
+ error: `Failed to update status: ${error.message}`,
35
+ statusCode: error.statusCode,
36
+ }, null, 2);
37
+ }
38
+ return JSON.stringify({
39
+ success: false,
40
+ error: error instanceof Error ? error.message : 'Unknown error',
41
+ }, null, 2);
42
+ }
43
+ }
44
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/tools/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAAqB,CAAC;AAE1D,MAAM,CAAC,MAAM,2BA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,OAAO,EAAE;gBAClD,UAAU,EAAE,KAAK,CAAC,UAAU;aAC7B,EACD,IAAI,EACJ,CAAC,CACF,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CACnB;YACE,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAChE,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,137 @@
1
+ import { z } from 'zod';
2
+ export declare const createWorkflowToolName = "llama_create_workflow";
3
+ export declare const createWorkflowToolDescription = "Create a new Claude workflow for a project.\n\nWorkflows are reusable procedures that Claude can execute. They contain:\n- **content**: Markdown instructions with {{parameter}} placeholders\n- **parameters**: Typed inputs (string, number, date, boolean) with defaults\n- **triggers**: Keywords that help suggest this workflow (e.g., \"create sprint\", \"plan phase\")\n\nUse workflows to standardize common tasks like sprint planning, backlog grooming, or issue creation patterns.";
4
+ export declare const createWorkflowToolSchema: z.ZodObject<{
5
+ orgSlug: z.ZodString;
6
+ projectKey: z.ZodString;
7
+ name: z.ZodString;
8
+ description: z.ZodOptional<z.ZodString>;
9
+ content: z.ZodString;
10
+ parameters: z.ZodOptional<z.ZodString>;
11
+ triggers: z.ZodOptional<z.ZodString>;
12
+ isEnabled: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ orgSlug: string;
15
+ projectKey: string;
16
+ name: string;
17
+ content: string;
18
+ isEnabled: boolean;
19
+ description?: string | undefined;
20
+ parameters?: string | undefined;
21
+ triggers?: string | undefined;
22
+ }, {
23
+ orgSlug: string;
24
+ projectKey: string;
25
+ name: string;
26
+ content: string;
27
+ description?: string | undefined;
28
+ parameters?: string | undefined;
29
+ triggers?: string | undefined;
30
+ isEnabled?: boolean | undefined;
31
+ }>;
32
+ export type CreateWorkflowToolInput = z.infer<typeof createWorkflowToolSchema>;
33
+ export declare function executeCreateWorkflow(input: CreateWorkflowToolInput): Promise<string>;
34
+ export declare const updateWorkflowToolName = "llama_update_workflow";
35
+ export declare const updateWorkflowToolDescription = "Update an existing Claude workflow.\nOnly include the fields you want to change. All fields are optional except the workflow ID.";
36
+ export declare const updateWorkflowToolSchema: z.ZodObject<{
37
+ orgSlug: z.ZodString;
38
+ projectKey: z.ZodString;
39
+ workflowId: z.ZodString;
40
+ name: z.ZodOptional<z.ZodString>;
41
+ description: z.ZodOptional<z.ZodString>;
42
+ content: z.ZodOptional<z.ZodString>;
43
+ parameters: z.ZodOptional<z.ZodString>;
44
+ triggers: z.ZodOptional<z.ZodString>;
45
+ isEnabled: z.ZodOptional<z.ZodBoolean>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ orgSlug: string;
48
+ projectKey: string;
49
+ workflowId: string;
50
+ description?: string | undefined;
51
+ name?: string | undefined;
52
+ content?: string | undefined;
53
+ parameters?: string | undefined;
54
+ triggers?: string | undefined;
55
+ isEnabled?: boolean | undefined;
56
+ }, {
57
+ orgSlug: string;
58
+ projectKey: string;
59
+ workflowId: string;
60
+ description?: string | undefined;
61
+ name?: string | undefined;
62
+ content?: string | undefined;
63
+ parameters?: string | undefined;
64
+ triggers?: string | undefined;
65
+ isEnabled?: boolean | undefined;
66
+ }>;
67
+ export type UpdateWorkflowToolInput = z.infer<typeof updateWorkflowToolSchema>;
68
+ export declare function executeUpdateWorkflow(input: UpdateWorkflowToolInput): Promise<string>;
69
+ export declare const listWorkflowsToolName = "llama_list_workflows";
70
+ export declare const listWorkflowsToolDescription = "List available Claude workflows for a project.\nReturns both project-level workflows and inherited organization-level workflows.\nUse this to discover reusable procedures before starting common tasks.";
71
+ export declare const listWorkflowsToolSchema: z.ZodObject<{
72
+ orgSlug: z.ZodString;
73
+ projectKey: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ orgSlug: string;
76
+ projectKey: string;
77
+ }, {
78
+ orgSlug: string;
79
+ projectKey: string;
80
+ }>;
81
+ export type ListWorkflowsToolInput = z.infer<typeof listWorkflowsToolSchema>;
82
+ export declare function executeListWorkflows(input: ListWorkflowsToolInput): Promise<string>;
83
+ export declare const getWorkflowToolName = "llama_get_workflow";
84
+ export declare const getWorkflowToolDescription = "Get full details of a Claude workflow including its content and parameters.\nUse this to view the complete workflow procedure and understand what parameters are needed.";
85
+ export declare const getWorkflowToolSchema: z.ZodObject<{
86
+ orgSlug: z.ZodString;
87
+ projectKey: z.ZodString;
88
+ workflowId: z.ZodString;
89
+ }, "strip", z.ZodTypeAny, {
90
+ orgSlug: string;
91
+ projectKey: string;
92
+ workflowId: string;
93
+ }, {
94
+ orgSlug: string;
95
+ projectKey: string;
96
+ workflowId: string;
97
+ }>;
98
+ export type GetWorkflowToolInput = z.infer<typeof getWorkflowToolSchema>;
99
+ export declare function executeGetWorkflow(input: GetWorkflowToolInput): Promise<string>;
100
+ export declare const runWorkflowToolName = "llama_run_workflow";
101
+ export declare const runWorkflowToolDescription = "Execute a Claude workflow with the provided parameters.\nReturns the workflow content with all parameter placeholders filled in.\nThe content can then be followed as a step-by-step procedure.";
102
+ export declare const runWorkflowToolSchema: z.ZodObject<{
103
+ orgSlug: z.ZodString;
104
+ projectKey: z.ZodString;
105
+ workflowId: z.ZodString;
106
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ orgSlug: string;
109
+ projectKey: string;
110
+ workflowId: string;
111
+ parameters?: Record<string, string> | undefined;
112
+ }, {
113
+ orgSlug: string;
114
+ projectKey: string;
115
+ workflowId: string;
116
+ parameters?: Record<string, string> | undefined;
117
+ }>;
118
+ export type RunWorkflowToolInput = z.infer<typeof runWorkflowToolSchema>;
119
+ export declare function executeRunWorkflow(input: RunWorkflowToolInput): Promise<string>;
120
+ export declare const suggestWorkflowToolName = "llama_suggest_workflow";
121
+ export declare const suggestWorkflowToolDescription = "Find matching workflows based on what the user wants to do.\nSearches workflow triggers for matches with the user's intent.\nReturns the top matching workflows with relevance scores.\n\nUse this when the user describes a task to see if there's a saved procedure for it.";
122
+ export declare const suggestWorkflowToolSchema: z.ZodObject<{
123
+ orgSlug: z.ZodString;
124
+ projectKey: z.ZodString;
125
+ intent: z.ZodString;
126
+ }, "strip", z.ZodTypeAny, {
127
+ orgSlug: string;
128
+ projectKey: string;
129
+ intent: string;
130
+ }, {
131
+ orgSlug: string;
132
+ projectKey: string;
133
+ intent: string;
134
+ }>;
135
+ export type SuggestWorkflowToolInput = z.infer<typeof suggestWorkflowToolSchema>;
136
+ export declare function executeSuggestWorkflow(input: SuggestWorkflowToolInput): Promise<string>;
137
+ //# sourceMappingURL=workflows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/tools/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,eAAO,MAAM,6BAA6B,qeAOoE,CAAC;AAE/G,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;EASnC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,MAAM,CAAC,CA8EjB;AAMD,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,eAAO,MAAM,6BAA6B,qIACkD,CAAC;AAE7F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUnC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE/E,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,MAAM,C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AM,CAAC,CAiEjB"}
@@ -0,0 +1,355 @@
1
+ import { z } from 'zod';
2
+ import { getApiClient, LlamaApiError } from '../api-client.js';
3
+ // ============================================
4
+ // Create Workflow
5
+ // ============================================
6
+ export const createWorkflowToolName = 'llama_create_workflow';
7
+ export const createWorkflowToolDescription = `Create a new Claude workflow for a project.
8
+
9
+ Workflows are reusable procedures that Claude can execute. They contain:
10
+ - **content**: Markdown instructions with {{parameter}} placeholders
11
+ - **parameters**: Typed inputs (string, number, date, boolean) with defaults
12
+ - **triggers**: Keywords that help suggest this workflow (e.g., "create sprint", "plan phase")
13
+
14
+ Use workflows to standardize common tasks like sprint planning, backlog grooming, or issue creation patterns.`;
15
+ export const createWorkflowToolSchema = z.object({
16
+ orgSlug: z.string().describe('Organization slug'),
17
+ projectKey: z.string().describe('Project key'),
18
+ name: z.string().describe('Workflow name (e.g., "Sprint from TODO Phase")'),
19
+ description: z.string().optional().describe('Brief description of what the workflow does'),
20
+ content: z.string().describe('Markdown content with {{parameterName}} placeholders for instructions'),
21
+ parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]. Types: string, number, date, boolean'),
22
+ triggers: z.string().optional().describe('Comma-separated trigger phrases (e.g., "create sprint, plan phase, import TODO")'),
23
+ isEnabled: z.boolean().optional().default(true).describe('Whether the workflow is active (default: true)'),
24
+ });
25
+ export async function executeCreateWorkflow(input) {
26
+ try {
27
+ const client = getApiClient();
28
+ // Parse parameters if provided as JSON string
29
+ let parameters;
30
+ if (input.parameters) {
31
+ try {
32
+ parameters = JSON.parse(input.parameters);
33
+ }
34
+ catch {
35
+ return JSON.stringify({
36
+ success: false,
37
+ error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
38
+ }, null, 2);
39
+ }
40
+ }
41
+ // Parse triggers from comma-separated string
42
+ let triggers;
43
+ if (input.triggers) {
44
+ triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
45
+ }
46
+ const workflow = await client.createClaudeWorkflow(input.orgSlug, input.projectKey, {
47
+ name: input.name,
48
+ description: input.description,
49
+ content: input.content,
50
+ parameters,
51
+ triggers,
52
+ isEnabled: input.isEnabled ?? true,
53
+ });
54
+ return JSON.stringify({
55
+ success: true,
56
+ message: `Workflow "${workflow.name}" created successfully`,
57
+ workflow: {
58
+ id: workflow.id,
59
+ name: workflow.name,
60
+ description: workflow.description,
61
+ triggers: workflow.triggers,
62
+ parametersCount: workflow.parameters.length,
63
+ isEnabled: workflow.isEnabled,
64
+ },
65
+ }, null, 2);
66
+ }
67
+ catch (error) {
68
+ if (error instanceof LlamaApiError) {
69
+ return JSON.stringify({
70
+ success: false,
71
+ error: `Failed to create workflow: ${error.message}`,
72
+ statusCode: error.statusCode,
73
+ }, null, 2);
74
+ }
75
+ return JSON.stringify({
76
+ success: false,
77
+ error: error instanceof Error ? error.message : 'Unknown error',
78
+ }, null, 2);
79
+ }
80
+ }
81
+ // ============================================
82
+ // Update Workflow
83
+ // ============================================
84
+ export const updateWorkflowToolName = 'llama_update_workflow';
85
+ export const updateWorkflowToolDescription = `Update an existing Claude workflow.
86
+ Only include the fields you want to change. All fields are optional except the workflow ID.`;
87
+ export const updateWorkflowToolSchema = z.object({
88
+ orgSlug: z.string().describe('Organization slug'),
89
+ projectKey: z.string().describe('Project key'),
90
+ workflowId: z.string().describe('Workflow ID to update'),
91
+ name: z.string().optional().describe('New workflow name'),
92
+ description: z.string().optional().describe('New description'),
93
+ content: z.string().optional().describe('New markdown content with {{parameterName}} placeholders'),
94
+ parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]'),
95
+ triggers: z.string().optional().describe('Comma-separated trigger phrases'),
96
+ isEnabled: z.boolean().optional().describe('Whether the workflow is active'),
97
+ });
98
+ export async function executeUpdateWorkflow(input) {
99
+ try {
100
+ const client = getApiClient();
101
+ // Parse parameters if provided as JSON string
102
+ let parameters;
103
+ if (input.parameters) {
104
+ try {
105
+ parameters = JSON.parse(input.parameters);
106
+ }
107
+ catch {
108
+ return JSON.stringify({
109
+ success: false,
110
+ error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
111
+ }, null, 2);
112
+ }
113
+ }
114
+ // Parse triggers from comma-separated string
115
+ let triggers;
116
+ if (input.triggers) {
117
+ triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
118
+ }
119
+ const updateData = {};
120
+ if (input.name !== undefined)
121
+ updateData.name = input.name;
122
+ if (input.description !== undefined)
123
+ updateData.description = input.description;
124
+ if (input.content !== undefined)
125
+ updateData.content = input.content;
126
+ if (parameters !== undefined)
127
+ updateData.parameters = parameters;
128
+ if (triggers !== undefined)
129
+ updateData.triggers = triggers;
130
+ if (input.isEnabled !== undefined)
131
+ updateData.isEnabled = input.isEnabled;
132
+ const workflow = await client.updateClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId, updateData);
133
+ return JSON.stringify({
134
+ success: true,
135
+ message: `Workflow "${workflow.name}" updated successfully`,
136
+ workflow: {
137
+ id: workflow.id,
138
+ name: workflow.name,
139
+ description: workflow.description,
140
+ triggers: workflow.triggers,
141
+ parametersCount: workflow.parameters.length,
142
+ isEnabled: workflow.isEnabled,
143
+ },
144
+ }, null, 2);
145
+ }
146
+ catch (error) {
147
+ if (error instanceof LlamaApiError) {
148
+ return JSON.stringify({
149
+ success: false,
150
+ error: `Failed to update workflow: ${error.message}`,
151
+ statusCode: error.statusCode,
152
+ }, null, 2);
153
+ }
154
+ return JSON.stringify({
155
+ success: false,
156
+ error: error instanceof Error ? error.message : 'Unknown error',
157
+ }, null, 2);
158
+ }
159
+ }
160
+ // ============================================
161
+ // List Workflows
162
+ // ============================================
163
+ export const listWorkflowsToolName = 'llama_list_workflows';
164
+ export const listWorkflowsToolDescription = `List available Claude workflows for a project.
165
+ Returns both project-level workflows and inherited organization-level workflows.
166
+ Use this to discover reusable procedures before starting common tasks.`;
167
+ export const listWorkflowsToolSchema = z.object({
168
+ orgSlug: z.string().describe('Organization slug'),
169
+ projectKey: z.string().describe('Project key'),
170
+ });
171
+ export async function executeListWorkflows(input) {
172
+ try {
173
+ const client = getApiClient();
174
+ const workflows = await client.listClaudeWorkflows(input.orgSlug, input.projectKey);
175
+ return JSON.stringify({
176
+ success: true,
177
+ workflows: workflows.map((w) => ({
178
+ id: w.id,
179
+ name: w.name,
180
+ description: w.description,
181
+ scope: w.scope,
182
+ triggers: w.triggers,
183
+ isEnabled: w.isEnabled,
184
+ usageCount: w.usageCount,
185
+ lastUsedAt: w.lastUsedAt,
186
+ })),
187
+ count: workflows.length,
188
+ }, null, 2);
189
+ }
190
+ catch (error) {
191
+ if (error instanceof LlamaApiError) {
192
+ return JSON.stringify({
193
+ success: false,
194
+ error: `Failed to list workflows: ${error.message}`,
195
+ statusCode: error.statusCode,
196
+ }, null, 2);
197
+ }
198
+ return JSON.stringify({
199
+ success: false,
200
+ error: error instanceof Error ? error.message : 'Unknown error',
201
+ }, null, 2);
202
+ }
203
+ }
204
+ // ============================================
205
+ // Get Workflow
206
+ // ============================================
207
+ export const getWorkflowToolName = 'llama_get_workflow';
208
+ export const getWorkflowToolDescription = `Get full details of a Claude workflow including its content and parameters.
209
+ Use this to view the complete workflow procedure and understand what parameters are needed.`;
210
+ export const getWorkflowToolSchema = z.object({
211
+ orgSlug: z.string().describe('Organization slug'),
212
+ projectKey: z.string().describe('Project key'),
213
+ workflowId: z.string().describe('Workflow ID'),
214
+ });
215
+ export async function executeGetWorkflow(input) {
216
+ try {
217
+ const client = getApiClient();
218
+ const workflow = await client.getClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId);
219
+ return JSON.stringify({
220
+ success: true,
221
+ workflow: {
222
+ id: workflow.id,
223
+ name: workflow.name,
224
+ description: workflow.description,
225
+ scope: workflow.scope,
226
+ content: workflow.content,
227
+ parameters: workflow.parameters,
228
+ triggers: workflow.triggers,
229
+ isEnabled: workflow.isEnabled,
230
+ usageCount: workflow.usageCount,
231
+ lastUsedAt: workflow.lastUsedAt,
232
+ createdBy: workflow.createdBy,
233
+ },
234
+ }, null, 2);
235
+ }
236
+ catch (error) {
237
+ if (error instanceof LlamaApiError) {
238
+ return JSON.stringify({
239
+ success: false,
240
+ error: `Failed to get workflow: ${error.message}`,
241
+ statusCode: error.statusCode,
242
+ }, null, 2);
243
+ }
244
+ return JSON.stringify({
245
+ success: false,
246
+ error: error instanceof Error ? error.message : 'Unknown error',
247
+ }, null, 2);
248
+ }
249
+ }
250
+ // ============================================
251
+ // Run Workflow
252
+ // ============================================
253
+ export const runWorkflowToolName = 'llama_run_workflow';
254
+ export const runWorkflowToolDescription = `Execute a Claude workflow with the provided parameters.
255
+ Returns the workflow content with all parameter placeholders filled in.
256
+ The content can then be followed as a step-by-step procedure.`;
257
+ export const runWorkflowToolSchema = z.object({
258
+ orgSlug: z.string().describe('Organization slug'),
259
+ projectKey: z.string().describe('Project key'),
260
+ workflowId: z.string().describe('Workflow ID to execute'),
261
+ parameters: z
262
+ .record(z.string())
263
+ .optional()
264
+ .describe('Parameters to fill in the workflow (key-value pairs)'),
265
+ });
266
+ export async function executeRunWorkflow(input) {
267
+ try {
268
+ const client = getApiClient();
269
+ const execution = await client.runClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId, input.parameters || {});
270
+ return JSON.stringify({
271
+ success: true,
272
+ message: `Executing workflow "${execution.workflow.name}"`,
273
+ workflow: {
274
+ id: execution.workflow.id,
275
+ name: execution.workflow.name,
276
+ },
277
+ filledContent: execution.filledContent,
278
+ parametersUsed: execution.parameters,
279
+ }, null, 2);
280
+ }
281
+ catch (error) {
282
+ if (error instanceof LlamaApiError) {
283
+ return JSON.stringify({
284
+ success: false,
285
+ error: `Failed to run workflow: ${error.message}`,
286
+ statusCode: error.statusCode,
287
+ }, null, 2);
288
+ }
289
+ return JSON.stringify({
290
+ success: false,
291
+ error: error instanceof Error ? error.message : 'Unknown error',
292
+ }, null, 2);
293
+ }
294
+ }
295
+ // ============================================
296
+ // Suggest Workflow
297
+ // ============================================
298
+ export const suggestWorkflowToolName = 'llama_suggest_workflow';
299
+ export const suggestWorkflowToolDescription = `Find matching workflows based on what the user wants to do.
300
+ Searches workflow triggers for matches with the user's intent.
301
+ Returns the top matching workflows with relevance scores.
302
+
303
+ Use this when the user describes a task to see if there's a saved procedure for it.`;
304
+ export const suggestWorkflowToolSchema = z.object({
305
+ orgSlug: z.string().describe('Organization slug'),
306
+ projectKey: z.string().describe('Project key'),
307
+ intent: z
308
+ .string()
309
+ .describe('What the user wants to do (e.g., "create a sprint", "groom the backlog")'),
310
+ });
311
+ export async function executeSuggestWorkflow(input) {
312
+ try {
313
+ const client = getApiClient();
314
+ const suggestions = await client.suggestClaudeWorkflows(input.orgSlug, input.projectKey, input.intent);
315
+ if (suggestions.length === 0) {
316
+ return JSON.stringify({
317
+ success: true,
318
+ message: 'No matching workflows found for this intent.',
319
+ suggestions: [],
320
+ }, null, 2);
321
+ }
322
+ return JSON.stringify({
323
+ success: true,
324
+ message: `Found ${suggestions.length} matching workflow(s)`,
325
+ suggestions: suggestions.map((s) => ({
326
+ workflow: {
327
+ id: s.workflow.id,
328
+ name: s.workflow.name,
329
+ description: s.workflow.description,
330
+ },
331
+ score: s.score,
332
+ matchedTriggers: s.matchedTriggers,
333
+ })),
334
+ topMatch: {
335
+ id: suggestions[0].workflow.id,
336
+ name: suggestions[0].workflow.name,
337
+ score: suggestions[0].score,
338
+ },
339
+ }, null, 2);
340
+ }
341
+ catch (error) {
342
+ if (error instanceof LlamaApiError) {
343
+ return JSON.stringify({
344
+ success: false,
345
+ error: `Failed to suggest workflows: ${error.message}`,
346
+ statusCode: error.statusCode,
347
+ }, null, 2);
348
+ }
349
+ return JSON.stringify({
350
+ success: false,
351
+ error: error instanceof Error ? error.message : 'Unknown error',
352
+ }, null, 2);
353
+ }
354
+ }
355
+ //# sourceMappingURL=workflows.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/tools/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EA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