@forloop-cc/forloop-opencode-plugin-planner 2.2.14 → 2.2.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -5
- package/package.json +1 -1
- package/plugins/capabilities/api-client.ts +1 -1
- package/plugins/capabilities/mime-types.ts +4 -0
- package/plugins/tools/agent-sprint-tools.ts +1 -1
- package/plugins/tools/ai-trigger-tools.ts +70 -2
- package/plugins/tools/developer-status-tool.ts +3 -1
- package/plugins/tools/file-tools.ts +6 -2
- package/plugins/tools/sprint-tools.ts +16 -16
package/CHANGELOG.md
CHANGED
|
@@ -10,10 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
10
10
|
### Added - Sprint & Story API Enhancements
|
|
11
11
|
|
|
12
12
|
#### New Sprint Tools
|
|
13
|
-
- **forloopSpaceSprintCreate** - Create new
|
|
13
|
+
- **forloopSpaceSprintCreate** - Create new space with dates and settings
|
|
14
14
|
- Arguments: title, description, startDate, endDate, isPrivate, organizationId
|
|
15
|
-
- Confirmation messages with
|
|
16
|
-
- **forloopSpaceSprintUpdate** - Update
|
|
15
|
+
- Confirmation messages with space details
|
|
16
|
+
- **forloopSpaceSprintUpdate** - Update space details
|
|
17
17
|
- Arguments: sprintId, title, description, startDate, endDate, isPrivate
|
|
18
18
|
- Partial updates supported
|
|
19
19
|
- **forloopSpaceSprintDelete** - Delete sprint (with confirmation)
|
|
@@ -155,8 +155,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
155
155
|
#### Core Features
|
|
156
156
|
- `forloopTokenSet` - Set/update ForLoop API token
|
|
157
157
|
- `forloopTokenGet` - Check if API token is configured
|
|
158
|
-
- `forloopSpaceSprintGet` - Get
|
|
159
|
-
- `forloopSpaceSprintList` - List all accessible
|
|
158
|
+
- `forloopSpaceSprintGet` - Get space details with stories and files
|
|
159
|
+
- `forloopSpaceSprintList` - List all accessible spaces
|
|
160
160
|
- `forloopStoryCreate` - Create new stories
|
|
161
161
|
- `forloopStoryUpdate` - Update existing stories
|
|
162
162
|
- `forloopStoryDelete` - Delete stories
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@forloop-cc/forloop-opencode-plugin-planner",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.16",
|
|
5
5
|
"description": "ForLoop integration plugin for opencode — Sprint, story, and agent tools for the ForLoop platform",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -76,7 +76,7 @@ export interface ChatRequest {
|
|
|
76
76
|
message: string;
|
|
77
77
|
sprintId?: number;
|
|
78
78
|
selectedAgentKey?: string;
|
|
79
|
-
type?: 'chat' | 'summary' | 'suggestion' | 'analysis' | 'translation' | 'feature' | 'planner.chat' | 'developer.sprint';
|
|
79
|
+
type?: 'chat' | 'summary' | 'suggestion' | 'analysis' | 'translation' | 'feature' | 'planner.chat' | 'developer.sprint' | 'creator.generate';
|
|
80
80
|
conversationId?: string;
|
|
81
81
|
metadata?: any;
|
|
82
82
|
}
|
|
@@ -44,7 +44,7 @@ export function createAgentListTool(client: ForLoopAPIClient) {
|
|
|
44
44
|
|
|
45
45
|
export function createSprintAiAgentsUpdateTool(client: ForLoopAPIClient) {
|
|
46
46
|
return tool({
|
|
47
|
-
description: 'Enable or disable AI agents for a
|
|
47
|
+
description: 'Enable or disable AI agents for a space',
|
|
48
48
|
args: {
|
|
49
49
|
sprintId: tool.schema.number()
|
|
50
50
|
.optional()
|
|
@@ -9,17 +9,18 @@ export function createAITriggerTools(client: ForLoopAPIClient) {
|
|
|
9
9
|
const tools: Record<string, ReturnType<typeof tool>> = {};
|
|
10
10
|
|
|
11
11
|
tools['forloopAiDeveloperSpaceSprint'] = createDeveloperSprintTool(client);
|
|
12
|
+
tools['forloopCreatorGenerate'] = createCreatorGenerateTool(client);
|
|
12
13
|
|
|
13
14
|
return tools;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
|
-
* forloopAiDeveloperSpaceSprint - Trigger developer agent for
|
|
18
|
+
* forloopAiDeveloperSpaceSprint - Trigger developer agent for space work
|
|
18
19
|
* Triggers the forLoopTaskSupervisor agent via EventBridge → Step Functions → ECS
|
|
19
20
|
*/
|
|
20
21
|
function createDeveloperSprintTool(client: ForLoopAPIClient) {
|
|
21
22
|
return tool({
|
|
22
|
-
description: 'Trigger forLoopTaskSupervisor agent to execute
|
|
23
|
+
description: 'Trigger forLoopTaskSupervisor agent to execute space work. This sends stories to the developer agent for implementation via EventBridge → Step Functions → ECS Fargate.',
|
|
23
24
|
args: {
|
|
24
25
|
sprintId: tool.schema.number()
|
|
25
26
|
.describe('Sprint ID to execute'),
|
|
@@ -77,3 +78,70 @@ function createDeveloperSprintTool(client: ForLoopAPIClient) {
|
|
|
77
78
|
},
|
|
78
79
|
});
|
|
79
80
|
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* forloopCreatorGenerate - Trigger forLoopCreator agent on-demand during planning.
|
|
84
|
+
* Dispatches the Creator via EventBridge → Step Functions → ECS (same path as
|
|
85
|
+
* developer.sprint) using selectedAgentKey=forLoopCreator and type=creator.generate.
|
|
86
|
+
* The planner MUST pre-create a Creator story (forloopStoryTemplate with
|
|
87
|
+
* assigneeAgentKey="forLoopCreator") before dispatching.
|
|
88
|
+
*/
|
|
89
|
+
function createCreatorGenerateTool(client: ForLoopAPIClient) {
|
|
90
|
+
return tool({
|
|
91
|
+
description: 'Trigger the forLoopCreator agent on-demand during planning to generate files (documents, presentations, spreadsheets, music, images, video). Requires a story to be pre-created via forloopStoryTemplate(assigneeAgentKey="forLoopCreator") first. Generated files land under frontend/public/ and auto-deploy via CI/CD.',
|
|
92
|
+
args: {
|
|
93
|
+
sprintId: tool.schema.number()
|
|
94
|
+
.describe('Sprint ID'),
|
|
95
|
+
storyId: tool.schema.number()
|
|
96
|
+
.describe('Pre-created Creator story ID (from forloopStoryTemplate with assigneeAgentKey="forLoopCreator")'),
|
|
97
|
+
message: tool.schema.string()
|
|
98
|
+
.optional()
|
|
99
|
+
.describe('Generation instructions, including the story ID and desired output')
|
|
100
|
+
.default('Generate the files described in the assigned story'),
|
|
101
|
+
},
|
|
102
|
+
async execute(args, _context) {
|
|
103
|
+
const tokenResult = await validateToken();
|
|
104
|
+
if (!tokenResult.valid) {
|
|
105
|
+
return tokenResult.error;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
console.log('[forloopCreatorGenerate] Triggering creator agent', {
|
|
110
|
+
sprintId: args.sprintId,
|
|
111
|
+
storyId: args.storyId,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const response = await client.chatWithAI({
|
|
115
|
+
sprintId: args.sprintId,
|
|
116
|
+
message: args.message,
|
|
117
|
+
selectedAgentKey: 'forLoopCreator',
|
|
118
|
+
type: 'creator.generate',
|
|
119
|
+
metadata: { channel: 'creator_generate', storyId: args.storyId },
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const taskId = response.taskId || response.id || 'unknown';
|
|
123
|
+
const trackingId = response.trackingId || 'unknown';
|
|
124
|
+
|
|
125
|
+
return `🎨 Creator dispatched for file generation
|
|
126
|
+
|
|
127
|
+
**Details:**
|
|
128
|
+
- Task ID: \`${taskId}\`
|
|
129
|
+
- Tracking ID: \`${trackingId}\`
|
|
130
|
+
- Sprint: #${args.sprintId}
|
|
131
|
+
- Story: #${args.storyId}
|
|
132
|
+
- Agent: forLoopCreator
|
|
133
|
+
|
|
134
|
+
**What happens next:**
|
|
135
|
+
1. Sprint lock is acquired (conflicts if a developer task is running)
|
|
136
|
+
2. ECS Fargate task starts the forLoopCreator agent
|
|
137
|
+
3. Files are generated under frontend/public/ and committed
|
|
138
|
+
4. Story is updated with a completion comment
|
|
139
|
+
|
|
140
|
+
**Monitor:** poll \`forloopDeveloperStatus(sprintId=${args.sprintId})\` for completion.`;
|
|
141
|
+
} catch (error: any) {
|
|
142
|
+
console.error('[forloopCreatorGenerate] Failed to trigger creator', error);
|
|
143
|
+
return `❌ Failed to trigger forLoopCreator: ${error.message}`;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
@@ -49,9 +49,11 @@ export function createDeveloperStatusTool(client: ForLoopAPIClient) {
|
|
|
49
49
|
const exec = status.execution || {};
|
|
50
50
|
const sprint = status.sprint || {};
|
|
51
51
|
const execIcon = SFN_ICONS[exec.status] || '❓';
|
|
52
|
+
const isCreator = String(task.agentKey || '').toLowerCase() === 'forloopcreator';
|
|
53
|
+
const taskLabel = isCreator ? 'Creator Task' : 'Developer Task';
|
|
52
54
|
|
|
53
55
|
const lines = [
|
|
54
|
-
`${execIcon}
|
|
56
|
+
`${execIcon} ${taskLabel}: ${exec.status}`,
|
|
55
57
|
'',
|
|
56
58
|
`**Sprint**: #${resolution.sprintId}`,
|
|
57
59
|
`**Task Status**: ${task.status} (${task.id ? task.id.substring(0, 8) : '?'})`,
|
|
@@ -82,6 +82,7 @@ export function createFileUploadTool(client: ForLoopAPIClient) {
|
|
|
82
82
|
`✅ File uploaded successfully!`,
|
|
83
83
|
'',
|
|
84
84
|
`**File**: ${fileName}`,
|
|
85
|
+
`**File ID**: ${complete.id}`,
|
|
85
86
|
`**Size**: ${formatFileSize(fileSize)}`,
|
|
86
87
|
`**URL**: ${complete.url}`,
|
|
87
88
|
args.description ? `**Description**: ${args.description}` : null,
|
|
@@ -192,13 +193,16 @@ export function createFileDownloadUrlTool(client: ForLoopAPIClient) {
|
|
|
192
193
|
// Fire-and-forget audit log — don't block download on audit failure
|
|
193
194
|
client.logFileRead(args.fileId).catch(() => {});
|
|
194
195
|
|
|
195
|
-
|
|
196
|
+
// Use open-url (returns JSON {url}) rather than download (which 302-redirects
|
|
197
|
+
// to the signed URL — the plugin's fetch would follow it and fail JSON parsing).
|
|
198
|
+
const open = await client.getFileOpenUrl(args.fileId);
|
|
199
|
+
const url = String(open?.openUrl || open?.url || '');
|
|
196
200
|
|
|
197
201
|
return [
|
|
198
202
|
`📥 Download URL`,
|
|
199
203
|
'',
|
|
200
204
|
`**File ID**: ${args.fileId}`,
|
|
201
|
-
`**URL**: ${
|
|
205
|
+
`**URL**: ${url}`,
|
|
202
206
|
'',
|
|
203
207
|
'⚠️ This URL may expire. Download the file soon.',
|
|
204
208
|
].join('\n');
|
|
@@ -6,7 +6,7 @@ import { getToken } from '../capabilities/token-storage';
|
|
|
6
6
|
|
|
7
7
|
export function createSprintGetTool(client: ForLoopAPIClient) {
|
|
8
8
|
return tool({
|
|
9
|
-
description: 'Get
|
|
9
|
+
description: 'Get space details including stories, files, and AI agents',
|
|
10
10
|
args: {
|
|
11
11
|
sprintId: tool.schema.number()
|
|
12
12
|
.optional()
|
|
@@ -49,7 +49,7 @@ export function createSprintGetTool(client: ForLoopAPIClient) {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
const lines = [
|
|
52
|
-
`📋
|
|
52
|
+
`📋 Space #${sprint.id}: ${sprint.title}`,
|
|
53
53
|
'',
|
|
54
54
|
`**Status**: ${sprint.status}`,
|
|
55
55
|
`**Period**: ${formatDate(sprint.startDate)} - ${formatDate(sprint.endDate)}`,
|
|
@@ -80,7 +80,7 @@ export function createSprintGetTool(client: ForLoopAPIClient) {
|
|
|
80
80
|
|
|
81
81
|
export function createSprintListTool(client: ForLoopAPIClient) {
|
|
82
82
|
return tool({
|
|
83
|
-
description: 'List all accessible
|
|
83
|
+
description: 'List all accessible spaces',
|
|
84
84
|
args: {
|
|
85
85
|
organizationId: tool.schema.number()
|
|
86
86
|
.optional()
|
|
@@ -106,10 +106,10 @@ export function createSprintListTool(client: ForLoopAPIClient) {
|
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
if (!sprints.length) {
|
|
109
|
-
return 'No
|
|
109
|
+
return 'No spaces found.';
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
const lines = ['📋
|
|
112
|
+
const lines = ['📋 Spaces:', ''];
|
|
113
113
|
for (const sprint of sprints) {
|
|
114
114
|
const statusIcon = getStatusIcon(sprint.status);
|
|
115
115
|
const orgInfo = sprint.organizationName ? ` (${sprint.organizationName})` : '';
|
|
@@ -155,7 +155,7 @@ function getStatusIcon(status: string): string {
|
|
|
155
155
|
|
|
156
156
|
export function createSprintCreateTool(client: ForLoopAPIClient) {
|
|
157
157
|
return tool({
|
|
158
|
-
description: 'Create a new
|
|
158
|
+
description: 'Create a new space with specified dates and settings',
|
|
159
159
|
args: {
|
|
160
160
|
title: tool.schema.string()
|
|
161
161
|
.describe('Sprint title'),
|
|
@@ -191,7 +191,7 @@ export function createSprintCreateTool(client: ForLoopAPIClient) {
|
|
|
191
191
|
});
|
|
192
192
|
|
|
193
193
|
const lines = [
|
|
194
|
-
'✅
|
|
194
|
+
'✅ Space created successfully!',
|
|
195
195
|
'',
|
|
196
196
|
`**#${sprint.id}**: ${sprint.title}`,
|
|
197
197
|
`**Period**: ${formatDate(sprint.startDate)} - ${formatDate(sprint.endDate)}`,
|
|
@@ -212,7 +212,7 @@ export function createSprintCreateTool(client: ForLoopAPIClient) {
|
|
|
212
212
|
|
|
213
213
|
export function createSprintUpdateTool(client: ForLoopAPIClient) {
|
|
214
214
|
return tool({
|
|
215
|
-
description: 'Update
|
|
215
|
+
description: 'Update space details',
|
|
216
216
|
args: {
|
|
217
217
|
sprintId: tool.schema.number()
|
|
218
218
|
.describe('Sprint ID to update'),
|
|
@@ -249,7 +249,7 @@ export function createSprintUpdateTool(client: ForLoopAPIClient) {
|
|
|
249
249
|
|
|
250
250
|
const sprint = await client.updateSprint(args.sprintId, updateData);
|
|
251
251
|
|
|
252
|
-
return `✅
|
|
252
|
+
return `✅ Space #${sprint.id} updated successfully!`;
|
|
253
253
|
} catch (error: any) {
|
|
254
254
|
return `❌ Error: ${error.message}`;
|
|
255
255
|
}
|
|
@@ -259,7 +259,7 @@ export function createSprintUpdateTool(client: ForLoopAPIClient) {
|
|
|
259
259
|
|
|
260
260
|
export function createSprintDeleteTool(client: ForLoopAPIClient) {
|
|
261
261
|
return tool({
|
|
262
|
-
description: 'Delete a
|
|
262
|
+
description: 'Delete a space (use with caution)',
|
|
263
263
|
args: {
|
|
264
264
|
sprintId: tool.schema.number()
|
|
265
265
|
.describe('Sprint ID to delete'),
|
|
@@ -276,7 +276,7 @@ export function createSprintDeleteTool(client: ForLoopAPIClient) {
|
|
|
276
276
|
|
|
277
277
|
if (!args.confirm) {
|
|
278
278
|
return [
|
|
279
|
-
'⚠️ Warning: This will permanently delete the
|
|
279
|
+
'⚠️ Warning: This will permanently delete the space and all its stories.',
|
|
280
280
|
'',
|
|
281
281
|
'Use --confirm true to proceed.',
|
|
282
282
|
].join('\n');
|
|
@@ -285,7 +285,7 @@ export function createSprintDeleteTool(client: ForLoopAPIClient) {
|
|
|
285
285
|
try {
|
|
286
286
|
await client.deleteSprint(args.sprintId);
|
|
287
287
|
|
|
288
|
-
return `✅
|
|
288
|
+
return `✅ Space #${args.sprintId} deleted successfully!`;
|
|
289
289
|
} catch (error: any) {
|
|
290
290
|
return `❌ Error: ${error.message}`;
|
|
291
291
|
}
|
|
@@ -295,7 +295,7 @@ export function createSprintDeleteTool(client: ForLoopAPIClient) {
|
|
|
295
295
|
|
|
296
296
|
export function createSubSprintListTool(client: ForLoopAPIClient) {
|
|
297
297
|
return tool({
|
|
298
|
-
description: 'List all iterations (sub-sprints) within a
|
|
298
|
+
description: 'List all iterations (sub-sprints) within a space',
|
|
299
299
|
args: {
|
|
300
300
|
sprintId: tool.schema.number()
|
|
301
301
|
.optional()
|
|
@@ -313,9 +313,9 @@ export function createSubSprintListTool(client: ForLoopAPIClient) {
|
|
|
313
313
|
try {
|
|
314
314
|
const subSprints = await client.getSubSprints(resolution.sprintId)
|
|
315
315
|
if (subSprints.length === 0) {
|
|
316
|
-
return `
|
|
316
|
+
return `Space #${resolution.sprintId} has no iterations yet.`
|
|
317
317
|
}
|
|
318
|
-
const lines = [`Iterations for
|
|
318
|
+
const lines = [`Iterations for space #${resolution.sprintId}:`, '']
|
|
319
319
|
for (const s of subSprints) {
|
|
320
320
|
const active = s.status === 'in_progress' ? ' ▶ ACTIVE' : ''
|
|
321
321
|
lines.push(
|
|
@@ -414,7 +414,7 @@ export function createSubSprintUpdateTool(client: ForLoopAPIClient) {
|
|
|
414
414
|
|
|
415
415
|
export function createSubSprintDeleteTool(client: ForLoopAPIClient) {
|
|
416
416
|
return tool({
|
|
417
|
-
description: 'Soft-delete an iteration (sub-sprint). Linked stories retain their subSprintId and will not appear in default
|
|
417
|
+
description: 'Soft-delete an iteration (sub-sprint). Linked stories retain their subSprintId and will not appear in default space views.',
|
|
418
418
|
args: {
|
|
419
419
|
subSprintId: tool.schema.number()
|
|
420
420
|
.describe('Sub-sprint ID to delete'),
|