@businesskit/agent 1.0.5 → 1.0.8

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 (83) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.cursor-plugin/plugin.json +1 -1
  4. package/.superconsole-plugin/plugin.json +61 -31
  5. package/AGENTS.md +33 -15
  6. package/README.md +101 -113
  7. package/bin/businesskit.js +47 -8
  8. package/commands/brief.md +12 -0
  9. package/commands/chase.md +12 -0
  10. package/commands/competitors.md +12 -0
  11. package/commands/create-page.md +43 -15
  12. package/commands/crm.md +13 -0
  13. package/commands/drafts.md +12 -0
  14. package/commands/followups.md +13 -0
  15. package/commands/inbox-rules.md +12 -0
  16. package/commands/inbox.md +13 -0
  17. package/commands/otp.md +12 -0
  18. package/commands/pipeline.md +13 -0
  19. package/commands/post.md +12 -0
  20. package/commands/reply.md +12 -0
  21. package/commands/repurpose.md +12 -0
  22. package/commands/social-analytics.md +12 -0
  23. package/commands/social-inbox.md +12 -0
  24. package/commands/social-reply.md +12 -0
  25. package/commands/social.md +12 -0
  26. package/commands/triage.md +12 -0
  27. package/commands/update-agent.md +33 -0
  28. package/commands/update-content.md +1 -0
  29. package/commands/update-page.md +3 -2
  30. package/commands/write-blog.md +4 -0
  31. package/commands/write-docs.md +6 -0
  32. package/commands/write-guide.md +5 -0
  33. package/commands/write-newsletter.md +4 -0
  34. package/dist/server.js +7513 -0
  35. package/mcp_config.json +6 -2
  36. package/package.json +25 -5
  37. package/plugin.json +1 -1
  38. package/scripts/release.js +200 -0
  39. package/scripts/setup.sh +70 -35
  40. package/scripts/setup.ts +58 -21
  41. package/scripts/update.sh +56 -0
  42. package/server.json +3 -3
  43. package/skills/README.md +3 -2
  44. package/skills/cms/SKILL.md +111 -0
  45. package/skills/cms/references/cms-hubs.md +84 -0
  46. package/skills/cms/references/html-blocks.md +177 -0
  47. package/skills/crm/SKILL.md +15 -29
  48. package/skills/docs/SKILL.md +65 -0
  49. package/skills/docs/references/how-to.md +155 -0
  50. package/skills/inbox/SKILL.md +32 -40
  51. package/skills/pages/SKILL.md +62 -17
  52. package/skills/pages/references/sections-catalog.json +377 -144
  53. package/skills/social/SKILL.md +83 -210
  54. package/skills/social/evals/evals.json +66 -0
  55. package/skills/social/evals/rubric.md +26 -0
  56. package/skills/social/examples/repurposing-blog-to-social.md +93 -0
  57. package/skills/social/examples/weekly-content-calendar.md +30 -0
  58. package/skills/social/linkedin/SKILL.md +107 -0
  59. package/skills/social/linkedin/evals/evals.json +106 -0
  60. package/skills/social/linkedin/evals/rubric.md +28 -0
  61. package/skills/social/linkedin/examples/gasp-weekly-sprint.md +24 -0
  62. package/skills/social/linkedin/examples/growth-posts-by-format.md +140 -0
  63. package/skills/social/linkedin/references/gasp-funnel-and-calibration.md +90 -0
  64. package/skills/social/linkedin/references/six-growth-formats.md +114 -0
  65. package/skills/social/references/platforms.md +76 -0
  66. package/skills/social/references/post-templates.md +105 -0
  67. package/skills/social/references/reverse-engineering.md +62 -0
  68. package/src/data/sections-catalog.json +950 -0
  69. package/src/db.ts +181 -0
  70. package/src/server.ts +119 -0
  71. package/src/tools/content.ts +326 -0
  72. package/src/tools/crm.ts +1416 -0
  73. package/src/tools/domains.ts +89 -0
  74. package/src/tools/inbox.ts +1400 -0
  75. package/src/tools/index.ts +138 -0
  76. package/src/tools/pages.ts +1217 -0
  77. package/src/tools/shop.ts +771 -0
  78. package/src/tools/social.ts +2131 -0
  79. package/src/tools/system.ts +96 -0
  80. package/src/tools/types.ts +17 -0
  81. package/src/worker-tick.ts +394 -0
  82. package/skills/docs-cms/SKILL.md +0 -53
  83. package/skills/docs-cms/references/how-to.md +0 -383
@@ -0,0 +1,138 @@
1
+ // src/tools/index.ts
2
+ // Aggregated BusinessKit MCP Tool Registry
3
+
4
+ import { shopTools } from './shop.js';
5
+ import { crmTools } from './crm.js';
6
+ import { contentTools } from './content.js';
7
+ import { pagesTools } from './pages.js';
8
+ import { domainTools } from './domains.js';
9
+ import { inboxTools } from './inbox.js';
10
+ import { socialTools } from './social.js';
11
+ import { systemTools } from './system.js';
12
+ import { getActiveProfileId, isDbConfigured, isDbReadOnly } from '../db.js';
13
+ import type { ToolDefinition, ToolContext } from './types.js';
14
+
15
+ export * from './types.js';
16
+
17
+ export const allTools: ToolDefinition[] = [
18
+ ...shopTools,
19
+ ...crmTools,
20
+ ...contentTools,
21
+ ...pagesTools,
22
+ ...domainTools,
23
+ ...inboxTools,
24
+ ...socialTools,
25
+ ...systemTools,
26
+ ];
27
+
28
+ const toolMap = new Map<string, ToolDefinition>();
29
+ for (const tool of allTools) {
30
+ toolMap.set(tool.name, tool);
31
+ }
32
+
33
+ const WRITE_TOOLS = new Set([
34
+ 'inventory_receive_purchase_invoice',
35
+ 'product_update_pricing',
36
+ 'inventory_add_stock',
37
+ 'invoice_create',
38
+ 'invoice_send',
39
+ 'shop_create_new_bill',
40
+ 'contact_create',
41
+ 'contact_update',
42
+ 'crm_log_activity',
43
+ 'crm_add_note',
44
+ 'crm_create_task',
45
+ 'crm_add_tag',
46
+ 'crm_create_contact_from_mail',
47
+ 'crm_propose_deal',
48
+ 'crm_update_deal_stage',
49
+ 'crm_merge_contacts',
50
+ 'crm_create_proposal_draft',
51
+ 'crm_draft_followup',
52
+ 'crm_draft_payment_chase',
53
+ 'crm_set_stages',
54
+ 'crm_create_group',
55
+ 'crm_add_to_group',
56
+ 'crm_create_template',
57
+ 'blog_post_create',
58
+ 'content_update',
59
+ 'page_create',
60
+ 'page_update',
61
+ 'page_publish',
62
+ 'component_create',
63
+ 'domain_set_agent_notes',
64
+ 'inbox_tool_set_category',
65
+ 'inbox_tool_set_state',
66
+ 'inbox_tool_add_label',
67
+ 'inbox_tool_link_entity',
68
+ 'inbox_tool_draft_reply',
69
+ 'inbox_tool_schedule_send',
70
+ 'inbox_tool_archive',
71
+ 'inbox_tool_save_attachments',
72
+ 'inbox_tool_remove_label',
73
+ 'inbox_tool_mark_read',
74
+ 'inbox_tool_snooze',
75
+ 'inbox_tool_save_summary',
76
+ 'inbox_tool_compose_draft',
77
+ 'inbox_tool_propose_send',
78
+ 'inbox_tool_create_rule',
79
+ 'inbox_tool_add_address_rule',
80
+ 'inbox_tool_release_held',
81
+ 'inbox_tool_create_mailbox',
82
+ 'social_tool_label_post',
83
+ 'social_tool_tag_conversation',
84
+ 'social_tool_link_crm_contact',
85
+ 'social_tool_create_post_draft',
86
+ 'social_tool_repurpose',
87
+ 'social_tool_save_reply_draft',
88
+ 'social_tool_propose_action',
89
+ 'social_tool_manage_queue_slot',
90
+ 'social_tool_analyze_competitor',
91
+ 'social_tool_draft_broadcast',
92
+ 'profile_switch',
93
+ ]);
94
+
95
+ export function getToolDefinition(name: string): ToolDefinition | undefined {
96
+ return toolMap.get(name);
97
+ }
98
+
99
+ export function getAllToolDefinitions() {
100
+ return allTools.map((t) => ({
101
+ name: t.name,
102
+ description: t.description,
103
+ inputSchema: t.inputSchema,
104
+ }));
105
+ }
106
+
107
+ export async function dispatchTool(name: string, args: Record<string, any>): Promise<any> {
108
+ const tool = toolMap.get(name);
109
+ if (!tool) {
110
+ throw new Error(`Unknown tool: ${name}`);
111
+ }
112
+
113
+ // Tools that don't need database connection
114
+ const offlineTools = ['system_get_capabilities', 'page_get_section_schema'];
115
+ if (offlineTools.includes(name)) {
116
+ return await tool.handler(args, { profileId: 'system' });
117
+ }
118
+
119
+ if (!isDbConfigured()) {
120
+ throw new Error(
121
+ `Database connection not configured. To execute '${name}', please set TURSO_DATABASE_URL and TURSO_AUTH_TOKEN in your .env file or environment variables.`
122
+ );
123
+ }
124
+
125
+ // Enforce read-only token on write operations immediately
126
+ if (WRITE_TOOLS.has(name) && isDbReadOnly()) {
127
+ throw new Error(
128
+ `Operation rejected: Database is connected in read-only mode (read-only token). Write tool '${name}' is disabled.`
129
+ );
130
+ }
131
+
132
+ const profileId = await getActiveProfileId();
133
+ const ctx: ToolContext = {
134
+ profileId,
135
+ };
136
+
137
+ return await tool.handler(args, ctx);
138
+ }