@swarmdock/shared 0.3.0 → 0.4.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.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './types.js';
2
2
  export * from './schemas.js';
3
3
  export * from './constants.js';
4
+ export * from './skill-templates.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './types.js';
2
2
  export * from './schemas.js';
3
3
  export * from './constants.js';
4
+ export * from './skill-templates.js';
4
5
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,23 @@
1
+ export interface SkillTemplate {
2
+ skillId: string;
3
+ skillName: string;
4
+ description: string;
5
+ category: string;
6
+ tags: string[];
7
+ pricingModel: string;
8
+ basePrice: string;
9
+ examplePrompts: string[];
10
+ }
11
+ export declare const SkillTemplates: {
12
+ /** Return all available skill templates */
13
+ list(): SkillTemplate[];
14
+ /** Get a single template by skill ID, or undefined if not found */
15
+ get(id: string): SkillTemplate | undefined;
16
+ /** Return the list of unique categories across all templates */
17
+ categories(): string[];
18
+ /** Fuzzy search templates by matching query against name, description, category, and tags */
19
+ search(query: string): SkillTemplate[];
20
+ /** Return all template IDs */
21
+ ids(): string[];
22
+ };
23
+ //# sourceMappingURL=skill-templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-templates.d.ts","sourceRoot":"","sources":["../src/skill-templates.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAqGD,eAAO,MAAM,cAAc;IACzB,2CAA2C;YACnC,aAAa,EAAE;IAIvB,mEAAmE;YAC3D,MAAM,GAAG,aAAa,GAAG,SAAS;IAI1C,gEAAgE;kBAClD,MAAM,EAAE;IAQtB,6FAA6F;kBAC/E,MAAM,GAAG,aAAa,EAAE;IAYtC,8BAA8B;WACvB,MAAM,EAAE;CAGhB,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { PRICING_MODEL } from './constants.js';
2
+ const templates = {
3
+ 'data-analysis': {
4
+ skillId: 'data-analysis',
5
+ skillName: 'Data Analysis',
6
+ description: 'Statistical analysis, data visualization, trend detection, and ML model building from structured and unstructured datasets.',
7
+ category: 'data-science',
8
+ tags: ['statistics', 'ml', 'visualization', 'pandas', 'data'],
9
+ pricingModel: PRICING_MODEL.PER_TASK,
10
+ basePrice: '5000000',
11
+ examplePrompts: [
12
+ 'Analyze this CSV for trends and anomalies',
13
+ 'Build a regression model for sales forecasting',
14
+ 'Calculate correlation between user engagement metrics',
15
+ 'Create a visualization dashboard from this dataset',
16
+ 'Run A/B test analysis on these experiment results',
17
+ ],
18
+ },
19
+ 'coding': {
20
+ skillId: 'coding',
21
+ skillName: 'Software Development',
22
+ description: 'Write, review, debug, and refactor code across multiple languages and frameworks. Full-stack development capability.',
23
+ category: 'engineering',
24
+ tags: ['code', 'development', 'debugging', 'review', 'full-stack'],
25
+ pricingModel: PRICING_MODEL.PER_TASK,
26
+ basePrice: '10000000',
27
+ examplePrompts: [
28
+ 'Implement a REST API endpoint with authentication',
29
+ 'Debug this failing unit test and fix the root cause',
30
+ 'Refactor this module to use the repository pattern',
31
+ 'Write a TypeScript utility for parsing CSV files',
32
+ 'Review this pull request for security vulnerabilities',
33
+ ],
34
+ },
35
+ 'content-writing': {
36
+ skillId: 'content-writing',
37
+ skillName: 'Content Writing',
38
+ description: 'Create articles, documentation, marketing copy, technical writing, and other text content with SEO awareness.',
39
+ category: 'content',
40
+ tags: ['writing', 'copywriting', 'documentation', 'seo', 'articles'],
41
+ pricingModel: PRICING_MODEL.PER_TASK,
42
+ basePrice: '3000000',
43
+ examplePrompts: [
44
+ 'Write a blog post about the benefits of microservices',
45
+ 'Create API documentation for this endpoint',
46
+ 'Draft a product launch announcement email',
47
+ 'Write a technical tutorial for setting up CI/CD',
48
+ 'Create marketing copy for a SaaS landing page',
49
+ ],
50
+ },
51
+ 'research': {
52
+ skillId: 'research',
53
+ skillName: 'Research & Synthesis',
54
+ description: 'Web research, literature review, competitive analysis, and synthesis of findings into structured reports.',
55
+ category: 'research',
56
+ tags: ['research', 'analysis', 'synthesis', 'competitive-analysis', 'reports'],
57
+ pricingModel: PRICING_MODEL.PER_TASK,
58
+ basePrice: '4000000',
59
+ examplePrompts: [
60
+ 'Research the top 5 competitors in the AI agent space',
61
+ 'Summarize recent papers on retrieval-augmented generation',
62
+ 'Compile a market analysis for decentralized compute',
63
+ 'Find and compare pricing models for API marketplaces',
64
+ 'Create a technology landscape report for LLM frameworks',
65
+ ],
66
+ },
67
+ 'web-development': {
68
+ skillId: 'web-development',
69
+ skillName: 'Web Development',
70
+ description: 'Build and maintain web applications including frontend UI, backend services, databases, and deployment.',
71
+ category: 'engineering',
72
+ tags: ['web', 'frontend', 'backend', 'react', 'nextjs', 'html', 'css'],
73
+ pricingModel: PRICING_MODEL.PER_TASK,
74
+ basePrice: '12000000',
75
+ examplePrompts: [
76
+ 'Build a responsive dashboard page with React',
77
+ 'Create a Next.js API route with database integration',
78
+ 'Implement OAuth login flow with Google and GitHub',
79
+ 'Set up a PostgreSQL schema with Drizzle ORM',
80
+ 'Deploy a containerized app to Render with CI/CD',
81
+ ],
82
+ },
83
+ 'code-review': {
84
+ skillId: 'code-review',
85
+ skillName: 'Code Review',
86
+ description: 'Review code for bugs, security vulnerabilities, performance issues, and adherence to best practices.',
87
+ category: 'engineering',
88
+ tags: ['review', 'security', 'quality', 'best-practices', 'audit'],
89
+ pricingModel: PRICING_MODEL.PER_TASK,
90
+ basePrice: '6000000',
91
+ examplePrompts: [
92
+ 'Review this PR for security vulnerabilities',
93
+ 'Audit this authentication module for OWASP top 10',
94
+ 'Check this database query for N+1 problems',
95
+ 'Review this React component for performance issues',
96
+ 'Evaluate this API design against REST best practices',
97
+ ],
98
+ },
99
+ };
100
+ export const SkillTemplates = {
101
+ /** Return all available skill templates */
102
+ list() {
103
+ return Object.values(templates);
104
+ },
105
+ /** Get a single template by skill ID, or undefined if not found */
106
+ get(id) {
107
+ return templates[id];
108
+ },
109
+ /** Return the list of unique categories across all templates */
110
+ categories() {
111
+ const cats = new Set();
112
+ for (const t of Object.values(templates)) {
113
+ cats.add(t.category);
114
+ }
115
+ return [...cats];
116
+ },
117
+ /** Fuzzy search templates by matching query against name, description, category, and tags */
118
+ search(query) {
119
+ const q = query.toLowerCase();
120
+ return Object.values(templates).filter((t) => {
121
+ return (t.skillName.toLowerCase().includes(q) ||
122
+ t.description.toLowerCase().includes(q) ||
123
+ t.category.toLowerCase().includes(q) ||
124
+ t.tags.some((tag) => tag.toLowerCase().includes(q)));
125
+ });
126
+ },
127
+ /** Return all template IDs */
128
+ ids() {
129
+ return Object.keys(templates);
130
+ },
131
+ };
132
+ //# sourceMappingURL=skill-templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-templates.js","sourceRoot":"","sources":["../src/skill-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAa/C,MAAM,SAAS,GAAkC;IAC/C,eAAe,EAAE;QACf,OAAO,EAAE,eAAe;QACxB,SAAS,EAAE,eAAe;QAC1B,WAAW,EAAE,6HAA6H;QAC1I,QAAQ,EAAE,cAAc;QACxB,IAAI,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC;QAC7D,YAAY,EAAE,aAAa,CAAC,QAAQ;QACpC,SAAS,EAAE,SAAS;QACpB,cAAc,EAAE;YACd,2CAA2C;YAC3C,gDAAgD;YAChD,uDAAuD;YACvD,oDAAoD;YACpD,mDAAmD;SACpD;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,sBAAsB;QACjC,WAAW,EAAE,sHAAsH;QACnI,QAAQ,EAAE,aAAa;QACvB,IAAI,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC;QAClE,YAAY,EAAE,aAAa,CAAC,QAAQ;QACpC,SAAS,EAAE,UAAU;QACrB,cAAc,EAAE;YACd,mDAAmD;YACnD,qDAAqD;YACrD,oDAAoD;YACpD,kDAAkD;YAClD,uDAAuD;SACxD;KACF;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,iBAAiB;QAC1B,SAAS,EAAE,iBAAiB;QAC5B,WAAW,EAAE,+GAA+G;QAC5H,QAAQ,EAAE,SAAS;QACnB,IAAI,EAAE,CAAC,SAAS,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;IAED,8BAA8B;IAC9B,GAAG;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarmdock/shared",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,16 +13,16 @@
13
13
  "types": "./dist/index.d.ts"
14
14
  }
15
15
  },
16
- "scripts": {
17
- "type-check": "tsc --noEmit",
18
- "build": "tsc",
19
- "test": "node --import ./node_modules/tsx/dist/loader.mjs --test tests/**/*.test.ts"
20
- },
21
16
  "dependencies": {
22
17
  "zod": "^3.24.0"
23
18
  },
24
19
  "devDependencies": {
25
20
  "tsx": "^4.20.0",
26
21
  "typescript": "^5.8.0"
22
+ },
23
+ "scripts": {
24
+ "type-check": "tsc --noEmit",
25
+ "build": "tsc",
26
+ "test": "node --import ./node_modules/tsx/dist/loader.mjs --test tests/**/*.test.ts"
27
27
  }
28
- }
28
+ }