@agllama/mcp 0.7.3 → 0.10.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 (118) hide show
  1. package/dist/api-client.d.ts +67 -6
  2. package/dist/api-client.d.ts.map +1 -1
  3. package/dist/api-client.js +74 -8
  4. package/dist/api-client.js.map +1 -1
  5. package/dist/index.js +0 -0
  6. package/dist/lib/__tests__/resolve-org-project.test.d.ts +2 -0
  7. package/dist/lib/__tests__/resolve-org-project.test.d.ts.map +1 -0
  8. package/dist/lib/__tests__/resolve-org-project.test.js +114 -0
  9. package/dist/lib/__tests__/resolve-org-project.test.js.map +1 -0
  10. package/dist/lib/resolve-org-project.d.ts +28 -0
  11. package/dist/lib/resolve-org-project.d.ts.map +1 -0
  12. package/dist/lib/resolve-org-project.js +16 -0
  13. package/dist/lib/resolve-org-project.js.map +1 -0
  14. package/dist/server.d.ts.map +1 -1
  15. package/dist/server.js +16 -116
  16. package/dist/server.js.map +1 -1
  17. package/dist/tools/__tests__/help.test.d.ts +2 -0
  18. package/dist/tools/__tests__/help.test.d.ts.map +1 -0
  19. package/dist/tools/__tests__/help.test.js +25 -0
  20. package/dist/tools/__tests__/help.test.js.map +1 -0
  21. package/dist/tools/__tests__/issuePlanLinks.test.d.ts +2 -0
  22. package/dist/tools/__tests__/issuePlanLinks.test.d.ts.map +1 -0
  23. package/dist/tools/__tests__/issuePlanLinks.test.js +294 -0
  24. package/dist/tools/__tests__/issuePlanLinks.test.js.map +1 -0
  25. package/dist/tools/__tests__/plans.test.d.ts +2 -0
  26. package/dist/tools/__tests__/plans.test.d.ts.map +1 -0
  27. package/dist/tools/__tests__/plans.test.js +359 -0
  28. package/dist/tools/__tests__/plans.test.js.map +1 -0
  29. package/dist/tools/__tests__/specs.test.d.ts +2 -0
  30. package/dist/tools/__tests__/specs.test.d.ts.map +1 -0
  31. package/dist/tools/__tests__/specs.test.js +262 -0
  32. package/dist/tools/__tests__/specs.test.js.map +1 -0
  33. package/dist/tools/attachments.d.ts.map +1 -1
  34. package/dist/tools/attachments.js +9 -17
  35. package/dist/tools/attachments.js.map +1 -1
  36. package/dist/tools/codeDocs.d.ts +6 -6
  37. package/dist/tools/codeDocs.d.ts.map +1 -1
  38. package/dist/tools/codeDocs.js +9 -21
  39. package/dist/tools/codeDocs.js.map +1 -1
  40. package/dist/tools/comments.d.ts.map +1 -1
  41. package/dist/tools/comments.js +2 -14
  42. package/dist/tools/comments.js.map +1 -1
  43. package/dist/tools/help.d.ts.map +1 -1
  44. package/dist/tools/help.js +28 -18
  45. package/dist/tools/help.js.map +1 -1
  46. package/dist/tools/index.d.ts +1 -1
  47. package/dist/tools/index.d.ts.map +1 -1
  48. package/dist/tools/index.js +1 -1
  49. package/dist/tools/index.js.map +1 -1
  50. package/dist/tools/issuePlanLinks.d.ts +18 -8
  51. package/dist/tools/issuePlanLinks.d.ts.map +1 -1
  52. package/dist/tools/issuePlanLinks.js +182 -67
  53. package/dist/tools/issuePlanLinks.js.map +1 -1
  54. package/dist/tools/issues.d.ts +15 -19
  55. package/dist/tools/issues.d.ts.map +1 -1
  56. package/dist/tools/issues.js +21 -7
  57. package/dist/tools/issues.js.map +1 -1
  58. package/dist/tools/labels.d.ts +2 -2
  59. package/dist/tools/notificationRules.d.ts +2 -2
  60. package/dist/tools/organizations.d.ts +2 -2
  61. package/dist/tools/plans.d.ts +37 -13
  62. package/dist/tools/plans.d.ts.map +1 -1
  63. package/dist/tools/plans.js +92 -29
  64. package/dist/tools/plans.js.map +1 -1
  65. package/dist/tools/projectErrors.d.ts.map +1 -1
  66. package/dist/tools/projectErrors.js +2 -14
  67. package/dist/tools/projectErrors.js.map +1 -1
  68. package/dist/tools/prompts.d.ts +4 -4
  69. package/dist/tools/prompts.d.ts.map +1 -1
  70. package/dist/tools/prompts.js +4 -5
  71. package/dist/tools/prompts.js.map +1 -1
  72. package/dist/tools/roadmap.d.ts +12 -12
  73. package/dist/tools/roadmap.d.ts.map +1 -1
  74. package/dist/tools/roadmap.js +3 -15
  75. package/dist/tools/roadmap.js.map +1 -1
  76. package/dist/tools/search.d.ts +2 -2
  77. package/dist/tools/skills.d.ts +8 -8
  78. package/dist/tools/specs.d.ts +30 -0
  79. package/dist/tools/specs.d.ts.map +1 -0
  80. package/dist/tools/specs.js +127 -0
  81. package/dist/tools/specs.js.map +1 -0
  82. package/dist/types.d.ts +80 -4
  83. package/dist/types.d.ts.map +1 -1
  84. package/dist/types.js +14 -2
  85. package/dist/types.js.map +1 -1
  86. package/dist/utils/__tests__/zod-json-schema.test.d.ts +2 -0
  87. package/dist/utils/__tests__/zod-json-schema.test.d.ts.map +1 -0
  88. package/dist/utils/__tests__/zod-json-schema.test.js +97 -0
  89. package/dist/utils/__tests__/zod-json-schema.test.js.map +1 -0
  90. package/dist/utils/zod-json-schema.d.ts +29 -0
  91. package/dist/utils/zod-json-schema.d.ts.map +1 -0
  92. package/dist/utils/zod-json-schema.js +128 -0
  93. package/dist/utils/zod-json-schema.js.map +1 -0
  94. package/package.json +1 -1
  95. package/dist/tools/decomposition.d.ts +0 -236
  96. package/dist/tools/decomposition.d.ts.map +0 -1
  97. package/dist/tools/decomposition.js +0 -285
  98. package/dist/tools/decomposition.js.map +0 -1
  99. package/dist/tools/documents.d.ts +0 -99
  100. package/dist/tools/documents.d.ts.map +0 -1
  101. package/dist/tools/documents.js +0 -254
  102. package/dist/tools/documents.js.map +0 -1
  103. package/dist/tools/epicSignOff.d.ts +0 -25
  104. package/dist/tools/epicSignOff.d.ts.map +0 -1
  105. package/dist/tools/epicSignOff.js +0 -89
  106. package/dist/tools/epicSignOff.js.map +0 -1
  107. package/dist/tools/integrations.d.ts +0 -38
  108. package/dist/tools/integrations.d.ts.map +0 -1
  109. package/dist/tools/integrations.js +0 -153
  110. package/dist/tools/integrations.js.map +0 -1
  111. package/dist/tools/planComments.d.ts.map +0 -1
  112. package/dist/tools/planComments.js.map +0 -1
  113. package/dist/tools/status.d.ts.map +0 -1
  114. package/dist/tools/status.js.map +0 -1
  115. package/dist/tools/workflows.d.ts +0 -169
  116. package/dist/tools/workflows.d.ts.map +0 -1
  117. package/dist/tools/workflows.js +0 -436
  118. package/dist/tools/workflows.js.map +0 -1
@@ -1,169 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const createWorkflowToolName = "llama_create_workflow";
3
- export declare const createWorkflowToolDescription = "Create a Claude workflow (reusable procedure). Scope: project (default), organization, or personal (only you, visible across all projects in the org).";
4
- export declare const createWorkflowToolSchema: z.ZodObject<{
5
- orgSlug: z.ZodString;
6
- projectKey: z.ZodOptional<z.ZodString>;
7
- scope: z.ZodDefault<z.ZodOptional<z.ZodEnum<["project", "organization", "personal"]>>>;
8
- name: z.ZodString;
9
- description: z.ZodOptional<z.ZodString>;
10
- content: z.ZodString;
11
- parameters: z.ZodOptional<z.ZodString>;
12
- triggers: z.ZodOptional<z.ZodString>;
13
- isEnabled: z.ZodDefault<z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>>;
14
- }, "strip", z.ZodTypeAny, {
15
- scope: "organization" | "project" | "personal";
16
- orgSlug: string;
17
- name: string;
18
- content: string;
19
- isEnabled: boolean;
20
- projectKey?: string | undefined;
21
- description?: string | undefined;
22
- parameters?: string | undefined;
23
- triggers?: string | undefined;
24
- }, {
25
- orgSlug: string;
26
- name: string;
27
- content: string;
28
- scope?: "organization" | "project" | "personal" | undefined;
29
- projectKey?: string | undefined;
30
- description?: string | undefined;
31
- parameters?: string | undefined;
32
- triggers?: string | undefined;
33
- isEnabled?: unknown;
34
- }>;
35
- export type CreateWorkflowToolInput = z.infer<typeof createWorkflowToolSchema>;
36
- export declare function executeCreateWorkflow(input: CreateWorkflowToolInput): Promise<string>;
37
- export declare const updateWorkflowToolName = "llama_update_workflow";
38
- export declare const updateWorkflowToolDescription = "Update a Claude workflow. Change scope to promote/demote between project and org level.";
39
- export declare const updateWorkflowToolSchema: z.ZodObject<{
40
- orgSlug: z.ZodString;
41
- projectKey: z.ZodOptional<z.ZodString>;
42
- workflowId: z.ZodString;
43
- name: z.ZodOptional<z.ZodString>;
44
- description: z.ZodOptional<z.ZodString>;
45
- content: z.ZodOptional<z.ZodString>;
46
- parameters: z.ZodOptional<z.ZodString>;
47
- triggers: z.ZodOptional<z.ZodString>;
48
- isEnabled: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
49
- scope: z.ZodOptional<z.ZodEnum<["project", "organization"]>>;
50
- }, "strip", z.ZodTypeAny, {
51
- orgSlug: string;
52
- workflowId: string;
53
- scope?: "organization" | "project" | undefined;
54
- projectKey?: string | undefined;
55
- description?: string | undefined;
56
- name?: string | undefined;
57
- content?: string | undefined;
58
- parameters?: string | undefined;
59
- triggers?: string | undefined;
60
- isEnabled?: boolean | undefined;
61
- }, {
62
- orgSlug: string;
63
- workflowId: string;
64
- scope?: "organization" | "project" | undefined;
65
- projectKey?: string | undefined;
66
- description?: string | undefined;
67
- name?: string | undefined;
68
- content?: string | undefined;
69
- parameters?: string | undefined;
70
- triggers?: string | undefined;
71
- isEnabled?: unknown;
72
- }>;
73
- export type UpdateWorkflowToolInput = z.infer<typeof updateWorkflowToolSchema>;
74
- export declare function executeUpdateWorkflow(input: UpdateWorkflowToolInput): Promise<string>;
75
- export declare const listWorkflowsToolName = "llama_list_workflows";
76
- export declare const listWorkflowsToolDescription = "List Claude workflows for a project. Set includeHidden=true for hidden ones.";
77
- export declare const listWorkflowsToolSchema: z.ZodObject<{
78
- orgSlug: z.ZodString;
79
- projectKey: z.ZodString;
80
- includeHidden: z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
81
- }, "strip", z.ZodTypeAny, {
82
- orgSlug: string;
83
- projectKey: string;
84
- includeHidden?: boolean | undefined;
85
- }, {
86
- orgSlug: string;
87
- projectKey: string;
88
- includeHidden?: unknown;
89
- }>;
90
- export type ListWorkflowsToolInput = z.infer<typeof listWorkflowsToolSchema>;
91
- export declare function executeListWorkflows(input: ListWorkflowsToolInput): Promise<string>;
92
- export declare const getWorkflowToolName = "llama_get_workflow";
93
- export declare const getWorkflowToolDescription = "Get workflow content and parameters by ID.";
94
- export declare const getWorkflowToolSchema: z.ZodObject<{
95
- orgSlug: z.ZodString;
96
- projectKey: z.ZodString;
97
- workflowId: z.ZodString;
98
- }, "strip", z.ZodTypeAny, {
99
- orgSlug: string;
100
- projectKey: string;
101
- workflowId: string;
102
- }, {
103
- orgSlug: string;
104
- projectKey: string;
105
- workflowId: string;
106
- }>;
107
- export type GetWorkflowToolInput = z.infer<typeof getWorkflowToolSchema>;
108
- export declare function executeGetWorkflow(input: GetWorkflowToolInput): Promise<string>;
109
- export declare const runWorkflowToolName = "llama_run_workflow";
110
- export declare const runWorkflowToolDescription = "Execute a workflow with parameters. Returns filled content.";
111
- export declare const runWorkflowToolSchema: z.ZodObject<{
112
- orgSlug: z.ZodString;
113
- projectKey: z.ZodString;
114
- workflowId: z.ZodString;
115
- parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
116
- }, "strip", z.ZodTypeAny, {
117
- orgSlug: string;
118
- projectKey: string;
119
- workflowId: string;
120
- parameters?: Record<string, string> | undefined;
121
- }, {
122
- orgSlug: string;
123
- projectKey: string;
124
- workflowId: string;
125
- parameters?: Record<string, string> | undefined;
126
- }>;
127
- export type RunWorkflowToolInput = z.infer<typeof runWorkflowToolSchema>;
128
- export declare function executeRunWorkflow(input: RunWorkflowToolInput): Promise<string>;
129
- export declare const suggestWorkflowToolName = "llama_suggest_workflow";
130
- export declare const suggestWorkflowToolDescription = "Find workflows matching user intent. Returns ranked matches.";
131
- export declare const suggestWorkflowToolSchema: z.ZodObject<{
132
- orgSlug: z.ZodString;
133
- projectKey: z.ZodString;
134
- intent: z.ZodString;
135
- }, "strip", z.ZodTypeAny, {
136
- orgSlug: string;
137
- projectKey: string;
138
- intent: string;
139
- }, {
140
- orgSlug: string;
141
- projectKey: string;
142
- intent: string;
143
- }>;
144
- export type SuggestWorkflowToolInput = z.infer<typeof suggestWorkflowToolSchema>;
145
- export declare function executeSuggestWorkflow(input: SuggestWorkflowToolInput): Promise<string>;
146
- export declare const setWorkflowVisibilityToolName = "llama_set_workflow_visibility";
147
- export declare const setWorkflowVisibilityToolDescription = "Hide or unhide a workflow. Scope: user (just you) or project (everyone).";
148
- export declare const setWorkflowVisibilityToolSchema: z.ZodObject<{
149
- orgSlug: z.ZodString;
150
- projectKey: z.ZodString;
151
- workflowId: z.ZodString;
152
- action: z.ZodEnum<["hide", "unhide"]>;
153
- scope: z.ZodEnum<["user", "project"]>;
154
- }, "strip", z.ZodTypeAny, {
155
- scope: "project" | "user";
156
- orgSlug: string;
157
- projectKey: string;
158
- workflowId: string;
159
- action: "hide" | "unhide";
160
- }, {
161
- scope: "project" | "user";
162
- orgSlug: string;
163
- projectKey: string;
164
- workflowId: string;
165
- action: "hide" | "unhide";
166
- }>;
167
- export type SetWorkflowVisibilityToolInput = z.infer<typeof setWorkflowVisibilityToolSchema>;
168
- export declare function executeSetWorkflowVisibility(input: SetWorkflowVisibilityToolInput): Promise<string>;
169
- //# sourceMappingURL=workflows.d.ts.map
@@ -1 +0,0 @@
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,2JAA2J,CAAC;AAEtM,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBnC,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,CAiFjB;AAMD,eAAO,MAAM,sBAAsB,0BAA0B,CAAC;AAE9D,eAAO,MAAM,6BAA6B,4FAA4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C;AAEhE,eAAO,MAAM,8BAA8B,iEAAiE,CAAC;AAE7G,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAMpC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEjF,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAwDjB;AAMD,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAE7E,eAAO,MAAM,oCAAoC,6EAA6E,CAAC;AAE/H,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;EAM1C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAE7F,wBAAsB,4BAA4B,CAChD,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,MAAM,CAAC,CAgCjB"}
@@ -1,436 +0,0 @@
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 Claude workflow (reusable procedure). Scope: project (default), organization, or personal (only you, visible across all projects in the org).`;
8
- export const createWorkflowToolSchema = z.object({
9
- orgSlug: z.string().describe('Organization slug'),
10
- projectKey: z.string().optional().describe('Project key. Required when scope is "project" (default). Not needed for "organization" scope.'),
11
- scope: z.enum(['project', 'organization', 'personal']).optional().default('project').describe('Workflow scope: "project" (default), "organization" (shared across all projects), or "personal" (only visible to you, available in all projects in the org). Personal scope requires projectKey.'),
12
- name: z.string().describe('Workflow name (e.g., "Sprint from TODO Phase")'),
13
- description: z.string().optional().describe('Brief description of what the workflow does'),
14
- content: z.string().describe('Markdown content with {{parameterName}} placeholders for instructions'),
15
- parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]. Types: string, number, date, boolean'),
16
- triggers: z.string().optional().describe('Comma-separated trigger phrases (e.g., "create sprint, plan phase, import TODO")'),
17
- isEnabled: z
18
- .preprocess((val) => {
19
- if (typeof val === 'string') {
20
- return val.toLowerCase() === 'true';
21
- }
22
- return val;
23
- }, z.boolean())
24
- .optional()
25
- .default(true)
26
- .describe('Whether the workflow is active (default: true)'),
27
- });
28
- export async function executeCreateWorkflow(input) {
29
- try {
30
- const client = getApiClient();
31
- const scope = input.scope ?? 'project';
32
- // Validate: project and personal scopes require projectKey
33
- if ((scope === 'project' || scope === 'personal') && !input.projectKey) {
34
- return JSON.stringify({
35
- success: false,
36
- error: `projectKey is required when scope is "${scope}"`,
37
- });
38
- }
39
- // Parse parameters if provided as JSON string
40
- let parameters;
41
- if (input.parameters) {
42
- try {
43
- parameters = JSON.parse(input.parameters);
44
- }
45
- catch {
46
- return JSON.stringify({
47
- success: false,
48
- error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
49
- });
50
- }
51
- }
52
- // Parse triggers from comma-separated string
53
- let triggers;
54
- if (input.triggers) {
55
- triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
56
- }
57
- const workflowInput = {
58
- name: input.name,
59
- description: input.description,
60
- content: input.content,
61
- parameters,
62
- triggers,
63
- isEnabled: input.isEnabled ?? true,
64
- };
65
- let workflow;
66
- if (scope === 'organization') {
67
- workflow = await client.createOrgClaudeWorkflow(input.orgSlug, workflowInput);
68
- }
69
- else if (scope === 'personal') {
70
- workflow = await client.createPersonalClaudeWorkflow(input.orgSlug, input.projectKey, workflowInput);
71
- }
72
- else {
73
- workflow = await client.createClaudeWorkflow(input.orgSlug, input.projectKey, workflowInput);
74
- }
75
- return JSON.stringify({
76
- success: true,
77
- message: `Workflow "${workflow.name}" created successfully (scope: ${scope})`,
78
- workflow: {
79
- id: workflow.id,
80
- name: workflow.name,
81
- description: workflow.description,
82
- scope: workflow.scope,
83
- triggers: workflow.triggers,
84
- parametersCount: workflow.parameters.length,
85
- isEnabled: workflow.isEnabled,
86
- },
87
- });
88
- }
89
- catch (error) {
90
- if (error instanceof LlamaApiError) {
91
- return JSON.stringify({
92
- success: false,
93
- error: `Failed to create workflow: ${error.message}`,
94
- statusCode: error.statusCode,
95
- });
96
- }
97
- return JSON.stringify({
98
- success: false,
99
- error: error instanceof Error ? error.message : 'Unknown error',
100
- });
101
- }
102
- }
103
- // ============================================
104
- // Update Workflow
105
- // ============================================
106
- export const updateWorkflowToolName = 'llama_update_workflow';
107
- export const updateWorkflowToolDescription = `Update a Claude workflow. Change scope to promote/demote between project and org level.`;
108
- export const updateWorkflowToolSchema = z.object({
109
- orgSlug: z.string().describe('Organization slug'),
110
- projectKey: z.string().optional().describe('Project key. Required for project-scoped workflows, or when demoting an org workflow to project scope.'),
111
- workflowId: z.string().describe('Workflow ID to update'),
112
- name: z.string().optional().describe('New workflow name'),
113
- description: z.string().optional().describe('New description'),
114
- content: z.string().optional().describe('New markdown content with {{parameterName}} placeholders'),
115
- parameters: z.string().optional().describe('JSON array of parameter definitions: [{name, type, required, default?, description?}]'),
116
- triggers: z.string().optional().describe('Comma-separated trigger phrases'),
117
- isEnabled: z
118
- .preprocess((val) => {
119
- if (typeof val === 'string') {
120
- return val.toLowerCase() === 'true';
121
- }
122
- return val;
123
- }, z.boolean())
124
- .optional()
125
- .describe('Whether the workflow is active'),
126
- scope: z.enum(['project', 'organization']).optional().describe('Change workflow scope: "organization" to promote (share across all projects), "project" to demote (requires projectKey)'),
127
- });
128
- export async function executeUpdateWorkflow(input) {
129
- try {
130
- const client = getApiClient();
131
- // Parse parameters if provided as JSON string
132
- let parameters;
133
- if (input.parameters) {
134
- try {
135
- parameters = JSON.parse(input.parameters);
136
- }
137
- catch {
138
- return JSON.stringify({
139
- success: false,
140
- error: 'Invalid JSON for parameters. Expected array of {name, type, required, default?, description?}',
141
- });
142
- }
143
- }
144
- // Parse triggers from comma-separated string
145
- let triggers;
146
- if (input.triggers) {
147
- triggers = input.triggers.split(',').map((t) => t.trim()).filter(Boolean);
148
- }
149
- const updateData = {};
150
- if (input.name !== undefined)
151
- updateData.name = input.name;
152
- if (input.description !== undefined)
153
- updateData.description = input.description;
154
- if (input.content !== undefined)
155
- updateData.content = input.content;
156
- if (parameters !== undefined)
157
- updateData.parameters = parameters;
158
- if (triggers !== undefined)
159
- updateData.triggers = triggers;
160
- if (input.isEnabled !== undefined)
161
- updateData.isEnabled = input.isEnabled;
162
- if (input.scope !== undefined)
163
- updateData.scope = input.scope;
164
- if (input.projectKey !== undefined)
165
- updateData.projectKey = input.projectKey;
166
- // Route to org or project API based on whether projectKey is provided
167
- const workflow = input.projectKey
168
- ? await client.updateClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId, updateData)
169
- : await client.updateOrgClaudeWorkflow(input.orgSlug, input.workflowId, updateData);
170
- return JSON.stringify({
171
- success: true,
172
- message: `Workflow "${workflow.name}" updated successfully`,
173
- workflow: {
174
- id: workflow.id,
175
- name: workflow.name,
176
- description: workflow.description,
177
- scope: workflow.scope,
178
- triggers: workflow.triggers,
179
- parametersCount: workflow.parameters.length,
180
- isEnabled: workflow.isEnabled,
181
- },
182
- });
183
- }
184
- catch (error) {
185
- if (error instanceof LlamaApiError) {
186
- return JSON.stringify({
187
- success: false,
188
- error: `Failed to update workflow: ${error.message}`,
189
- statusCode: error.statusCode,
190
- });
191
- }
192
- return JSON.stringify({
193
- success: false,
194
- error: error instanceof Error ? error.message : 'Unknown error',
195
- });
196
- }
197
- }
198
- // ============================================
199
- // List Workflows
200
- // ============================================
201
- export const listWorkflowsToolName = 'llama_list_workflows';
202
- export const listWorkflowsToolDescription = `List Claude workflows for a project. Set includeHidden=true for hidden ones.`;
203
- export const listWorkflowsToolSchema = z.object({
204
- orgSlug: z.string().describe('Organization slug'),
205
- projectKey: z.string().describe('Project key'),
206
- includeHidden: z
207
- .preprocess((val) => {
208
- if (typeof val === 'string') {
209
- return val.toLowerCase() === 'true';
210
- }
211
- return val;
212
- }, z.boolean())
213
- .optional()
214
- .describe('Include hidden workflows (default: false)'),
215
- });
216
- export async function executeListWorkflows(input) {
217
- try {
218
- const client = getApiClient();
219
- const workflows = await client.listClaudeWorkflows(input.orgSlug, input.projectKey, input.includeHidden);
220
- return JSON.stringify({
221
- success: true,
222
- workflows: workflows.map((w) => ({
223
- id: w.id,
224
- name: w.name,
225
- description: w.description,
226
- scope: w.scope,
227
- triggers: w.triggers,
228
- isEnabled: w.isEnabled,
229
- usageCount: w.usageCount,
230
- lastUsedAt: w.lastUsedAt,
231
- ...(input.includeHidden && {
232
- isHidden: w.isHidden,
233
- hideScope: w.hideScope,
234
- }),
235
- })),
236
- count: workflows.length,
237
- }, null, 2);
238
- }
239
- catch (error) {
240
- if (error instanceof LlamaApiError) {
241
- return JSON.stringify({
242
- success: false,
243
- error: `Failed to list workflows: ${error.message}`,
244
- statusCode: error.statusCode,
245
- });
246
- }
247
- return JSON.stringify({
248
- success: false,
249
- error: error instanceof Error ? error.message : 'Unknown error',
250
- });
251
- }
252
- }
253
- // ============================================
254
- // Get Workflow
255
- // ============================================
256
- export const getWorkflowToolName = 'llama_get_workflow';
257
- export const getWorkflowToolDescription = `Get workflow content and parameters by ID.`;
258
- export const getWorkflowToolSchema = z.object({
259
- orgSlug: z.string().describe('Organization slug'),
260
- projectKey: z.string().describe('Project key'),
261
- workflowId: z.string().describe('Workflow ID'),
262
- });
263
- export async function executeGetWorkflow(input) {
264
- try {
265
- const client = getApiClient();
266
- const workflow = await client.getClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId);
267
- return JSON.stringify({
268
- success: true,
269
- workflow: {
270
- id: workflow.id,
271
- name: workflow.name,
272
- description: workflow.description,
273
- scope: workflow.scope,
274
- content: workflow.content,
275
- parameters: workflow.parameters,
276
- triggers: workflow.triggers,
277
- isEnabled: workflow.isEnabled,
278
- usageCount: workflow.usageCount,
279
- lastUsedAt: workflow.lastUsedAt,
280
- createdBy: workflow.createdBy,
281
- },
282
- });
283
- }
284
- catch (error) {
285
- if (error instanceof LlamaApiError) {
286
- return JSON.stringify({
287
- success: false,
288
- error: `Failed to get workflow: ${error.message}`,
289
- statusCode: error.statusCode,
290
- });
291
- }
292
- return JSON.stringify({
293
- success: false,
294
- error: error instanceof Error ? error.message : 'Unknown error',
295
- });
296
- }
297
- }
298
- // ============================================
299
- // Run Workflow
300
- // ============================================
301
- export const runWorkflowToolName = 'llama_run_workflow';
302
- export const runWorkflowToolDescription = `Execute a workflow with parameters. Returns filled content.`;
303
- export const runWorkflowToolSchema = z.object({
304
- orgSlug: z.string().describe('Organization slug'),
305
- projectKey: z.string().describe('Project key'),
306
- workflowId: z.string().describe('Workflow ID to execute'),
307
- parameters: z
308
- .record(z.string())
309
- .optional()
310
- .describe('Parameters to fill in the workflow (key-value pairs)'),
311
- });
312
- export async function executeRunWorkflow(input) {
313
- try {
314
- const client = getApiClient();
315
- const execution = await client.runClaudeWorkflow(input.orgSlug, input.projectKey, input.workflowId, input.parameters || {});
316
- return JSON.stringify({
317
- success: true,
318
- message: `Executing workflow "${execution.workflow.name}"`,
319
- workflow: {
320
- id: execution.workflow.id,
321
- name: execution.workflow.name,
322
- },
323
- filledContent: execution.filledContent,
324
- parametersUsed: execution.parameters,
325
- });
326
- }
327
- catch (error) {
328
- if (error instanceof LlamaApiError) {
329
- return JSON.stringify({
330
- success: false,
331
- error: `Failed to run workflow: ${error.message}`,
332
- statusCode: error.statusCode,
333
- });
334
- }
335
- return JSON.stringify({
336
- success: false,
337
- error: error instanceof Error ? error.message : 'Unknown error',
338
- });
339
- }
340
- }
341
- // ============================================
342
- // Suggest Workflow
343
- // ============================================
344
- export const suggestWorkflowToolName = 'llama_suggest_workflow';
345
- export const suggestWorkflowToolDescription = `Find workflows matching user intent. Returns ranked matches.`;
346
- export const suggestWorkflowToolSchema = z.object({
347
- orgSlug: z.string().describe('Organization slug'),
348
- projectKey: z.string().describe('Project key'),
349
- intent: z
350
- .string()
351
- .describe('What the user wants to do (e.g., "create a sprint", "groom the backlog")'),
352
- });
353
- export async function executeSuggestWorkflow(input) {
354
- try {
355
- const client = getApiClient();
356
- const suggestions = await client.suggestClaudeWorkflows(input.orgSlug, input.projectKey, input.intent);
357
- if (suggestions.length === 0) {
358
- return JSON.stringify({
359
- success: true,
360
- message: 'No matching workflows found for this intent.',
361
- suggestions: [],
362
- });
363
- }
364
- return JSON.stringify({
365
- success: true,
366
- message: `Found ${suggestions.length} matching workflow(s)`,
367
- suggestions: suggestions.map((s) => ({
368
- workflow: {
369
- id: s.workflow.id,
370
- name: s.workflow.name,
371
- description: s.workflow.description,
372
- },
373
- score: s.score,
374
- matchedTriggers: s.matchedTriggers,
375
- })),
376
- topMatch: {
377
- id: suggestions[0].workflow.id,
378
- name: suggestions[0].workflow.name,
379
- score: suggestions[0].score,
380
- },
381
- }, null, 2);
382
- }
383
- catch (error) {
384
- if (error instanceof LlamaApiError) {
385
- return JSON.stringify({
386
- success: false,
387
- error: `Failed to suggest workflows: ${error.message}`,
388
- statusCode: error.statusCode,
389
- });
390
- }
391
- return JSON.stringify({
392
- success: false,
393
- error: error instanceof Error ? error.message : 'Unknown error',
394
- });
395
- }
396
- }
397
- // ============================================
398
- // Set Workflow Visibility (hide/unhide consolidated)
399
- // ============================================
400
- export const setWorkflowVisibilityToolName = 'llama_set_workflow_visibility';
401
- export const setWorkflowVisibilityToolDescription = `Hide or unhide a workflow. Scope: user (just you) or project (everyone).`;
402
- export const setWorkflowVisibilityToolSchema = z.object({
403
- orgSlug: z.string().describe('Organization slug'),
404
- projectKey: z.string().describe('Project key'),
405
- workflowId: z.string().describe('Workflow ID'),
406
- action: z.enum(['hide', 'unhide']).describe('Action: "hide" or "unhide"'),
407
- scope: z.enum(['user', 'project']).describe('Scope: "user" (just for you) or "project" (for everyone in the project)'),
408
- });
409
- export async function executeSetWorkflowVisibility(input) {
410
- try {
411
- const client = getApiClient();
412
- const method = input.action === 'hide' ? 'hideClaudeWorkflow' : 'unhideClaudeWorkflow';
413
- await client[method](input.orgSlug, input.projectKey, input.workflowId, input.scope);
414
- return JSON.stringify({
415
- success: true,
416
- message: `Workflow ${input.action === 'hide' ? 'hidden' : 'unhidden'} at ${input.scope} level`,
417
- workflowId: input.workflowId,
418
- action: input.action,
419
- scope: input.scope,
420
- });
421
- }
422
- catch (error) {
423
- if (error instanceof LlamaApiError) {
424
- return JSON.stringify({
425
- success: false,
426
- error: `Failed to ${input.action} workflow: ${error.message}`,
427
- statusCode: error.statusCode,
428
- });
429
- }
430
- return JSON.stringify({
431
- success: false,
432
- error: error instanceof Error ? error.message : 'Unknown error',
433
- });
434
- }
435
- }
436
- //# sourceMappingURL=workflows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/tools/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG/D,+CAA+C;AAC/C,kBAAkB;AAClB,+CAA+C;AAE/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAE9D,MAAM,CAAC,MAAM,6BAA6B,GAAG,wJAAwJ,CAAC;AAEtM,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IACjD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,+FAA+F,CAAC;IAC3I,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,kMAAkM,CAAC;IACjS,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;IAC3E,WAAW,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