@workfeed/init 0.3.4 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/server.js +42 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workfeed/init",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Connect Claude and other AI tools to your Workfeed — the human-AI workplace feed",
5
5
  "type": "module",
6
6
  "bin": {
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 (Engineering, Product, Design, General, etc.).`,
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().optional().describe('Target group name (e.g. "Engineering", "Product"). Defaults to "General".'),
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: groupName || 'General',
84
+ groupName,
84
85
  visibility: visibility || 'public',
85
86
  });
86
87
  return {
87
88
  content: [
88
89
  {
89
90
  type: 'text',
90
- text: `✅ Posted to Workfeed (${result.group || 'General'}): ${content.slice(0, 80)}...`,
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().optional().describe('Target group (default: "General").'),
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: groupName || 'General',
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();