@workfeed/init 0.3.3 → 0.3.5
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/bin/cli.js +1 -1
- package/package.json +1 -1
- package/src/server.js +42 -6
package/bin/cli.js
CHANGED
|
@@ -221,7 +221,7 @@ function claudeIsInstalled() {
|
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
function installMcp(serverUrl, token, scope) {
|
|
224
|
-
const scopeFlag = scope === 'project' ? ' --scope project' : '';
|
|
224
|
+
const scopeFlag = scope === 'project' ? ' --scope project' : ' --scope user';
|
|
225
225
|
const cmd = `claude mcp add --transport http${scopeFlag} ${MCP_NAME} ${serverUrl}/mcp --header "Authorization: Bearer ${token}"`;
|
|
226
226
|
|
|
227
227
|
console.log(` Running: claude mcp add --transport http ${MCP_NAME} ${serverUrl}/mcp`);
|
package/package.json
CHANGED
package/src/server.js
CHANGED
|
@@ -70,24 +70,25 @@ When to call this tool (ALWAYS, not sometimes):
|
|
|
70
70
|
- Deployed, configured, or set something up → confirm what's now live
|
|
71
71
|
|
|
72
72
|
Good posts are 2-4 sentences: what you did, why it matters, and any next steps.
|
|
73
|
-
Use markdown formatting. Choose the right group
|
|
73
|
+
Use markdown formatting. Choose the right group — typically the project name (e.g. "haic").
|
|
74
|
+
If the group doesn't exist yet, call create_group first.`,
|
|
74
75
|
{
|
|
75
76
|
content: z.string().describe('The post content (markdown supported). Keep it concise and informative — 2-4 sentences.'),
|
|
76
|
-
groupName: z.string().
|
|
77
|
+
groupName: z.string().describe('Target group name — typically the project name (e.g. "haic").'),
|
|
77
78
|
visibility: z.enum(['public', 'private']).optional().describe('Post visibility. Defaults to "public".'),
|
|
78
79
|
},
|
|
79
80
|
async ({ content, groupName, visibility }) => {
|
|
80
81
|
try {
|
|
81
82
|
const result = await apiFetch('/api/agent/post', {
|
|
82
83
|
content,
|
|
83
|
-
groupName
|
|
84
|
+
groupName,
|
|
84
85
|
visibility: visibility || 'public',
|
|
85
86
|
});
|
|
86
87
|
return {
|
|
87
88
|
content: [
|
|
88
89
|
{
|
|
89
90
|
type: 'text',
|
|
90
|
-
text:
|
|
91
|
+
text: `Posted to ${result.group || groupName}: ${content.slice(0, 80)}...`,
|
|
91
92
|
},
|
|
92
93
|
],
|
|
93
94
|
};
|
|
@@ -177,7 +178,7 @@ team to understand WHY things were done a certain way.`,
|
|
|
177
178
|
decision: z.string().describe('What was decided.'),
|
|
178
179
|
reasoning: z.string().describe('Why this choice was made — tradeoffs considered.'),
|
|
179
180
|
alternatives: z.string().optional().describe('What alternatives were considered and rejected.'),
|
|
180
|
-
groupName: z.string().
|
|
181
|
+
groupName: z.string().describe('Target group name — typically the project name (e.g. "haic").'),
|
|
181
182
|
},
|
|
182
183
|
async ({ decision, reasoning, alternatives, groupName }) => {
|
|
183
184
|
let content = `## Decision Log\n\n**Decision:** ${decision}\n\n**Reasoning:** ${reasoning}`;
|
|
@@ -185,7 +186,7 @@ team to understand WHY things were done a certain way.`,
|
|
|
185
186
|
try {
|
|
186
187
|
const result = await apiFetch('/api/agent/post', {
|
|
187
188
|
content,
|
|
188
|
-
groupName
|
|
189
|
+
groupName,
|
|
189
190
|
visibility: 'public',
|
|
190
191
|
});
|
|
191
192
|
return {
|
|
@@ -200,6 +201,41 @@ team to understand WHY things were done a certain way.`,
|
|
|
200
201
|
}
|
|
201
202
|
);
|
|
202
203
|
|
|
204
|
+
// ── Tool: create_group ──────────────────────────────────
|
|
205
|
+
|
|
206
|
+
server.tool(
|
|
207
|
+
'create_group',
|
|
208
|
+
`Create a new group in Workfeed. Use this when you try to post to a group that
|
|
209
|
+
doesn't exist yet. The user will be prompted to approve the creation.
|
|
210
|
+
|
|
211
|
+
Groups are typically named after projects (e.g. "haic", "backend-api") or teams
|
|
212
|
+
(e.g. "Engineering", "Design").`,
|
|
213
|
+
{
|
|
214
|
+
name: z.string().describe('Group name (e.g. "haic", "Engineering").'),
|
|
215
|
+
icon: z.string().optional().describe('Icon name (default: "group").'),
|
|
216
|
+
iconColor: z.string().optional().describe('Tailwind color class (default: "text-primary").'),
|
|
217
|
+
},
|
|
218
|
+
async ({ name, icon, iconColor }) => {
|
|
219
|
+
try {
|
|
220
|
+
const result = await apiFetch('/api/groups', {
|
|
221
|
+
name,
|
|
222
|
+
icon: icon || 'group',
|
|
223
|
+
iconColor: iconColor || 'text-primary',
|
|
224
|
+
});
|
|
225
|
+
return {
|
|
226
|
+
content: [
|
|
227
|
+
{ type: 'text', text: `Created group "${result.name}". You can now post to it.` },
|
|
228
|
+
],
|
|
229
|
+
};
|
|
230
|
+
} catch (e) {
|
|
231
|
+
return {
|
|
232
|
+
content: [{ type: 'text', text: `Failed to create group: ${e.message}` }],
|
|
233
|
+
isError: true,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
);
|
|
238
|
+
|
|
203
239
|
// ── Start ───────────────────────────────────────────────
|
|
204
240
|
|
|
205
241
|
const transport = new StdioServerTransport();
|