microfox 1.0.11

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 (91) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/README.md +114 -0
  3. package/dist/agent-template.txt +486 -0
  4. package/dist/background-agent/.gitignore.txt +22 -0
  5. package/dist/background-agent/eslint.config.js.txt +48 -0
  6. package/dist/background-agent/microfox.json.txt +4 -0
  7. package/dist/background-agent/openapi.md.txt +1 -0
  8. package/dist/background-agent/package.json.txt +47 -0
  9. package/dist/background-agent/serverless.yml.txt +123 -0
  10. package/dist/background-agent/src/functions/cron-paginate.ts.txt +135 -0
  11. package/dist/background-agent/src/functions/cron-populate.ts.txt +33 -0
  12. package/dist/background-agent/src/functions/route-trigger-index.ts.txt +157 -0
  13. package/dist/background-agent/src/functions/route-trigger-populate.ts.txt +0 -0
  14. package/dist/background-agent/src/functions/sqs-index.ts.txt +147 -0
  15. package/dist/background-agent/src/helpers/ragRedis.ts.txt +78 -0
  16. package/dist/background-agent/src/index.ts.txt +69 -0
  17. package/dist/background-agent/tsconfig.json.txt +33 -0
  18. package/dist/chunk-4HNHBA2H.mjs +104 -0
  19. package/dist/chunk-4HNHBA2H.mjs.map +1 -0
  20. package/dist/chunk-ARAHSYJI.mjs +263 -0
  21. package/dist/chunk-ARAHSYJI.mjs.map +1 -0
  22. package/dist/chunk-JGAX4PD6.mjs +290 -0
  23. package/dist/chunk-JGAX4PD6.mjs.map +1 -0
  24. package/dist/chunk-KPJJOO76.mjs +12 -0
  25. package/dist/chunk-KPJJOO76.mjs.map +1 -0
  26. package/dist/chunk-TZQZMKHP.mjs +11 -0
  27. package/dist/chunk-TZQZMKHP.mjs.map +1 -0
  28. package/dist/chunk-UFRGJMF4.mjs +154 -0
  29. package/dist/chunk-UFRGJMF4.mjs.map +1 -0
  30. package/dist/chunk-UHWJTQKW.mjs +139 -0
  31. package/dist/chunk-UHWJTQKW.mjs.map +1 -0
  32. package/dist/chunk-UYROVW53.mjs +89 -0
  33. package/dist/chunk-UYROVW53.mjs.map +1 -0
  34. package/dist/chunk-XGFSFWK3.mjs +113 -0
  35. package/dist/chunk-XGFSFWK3.mjs.map +1 -0
  36. package/dist/cli.d.mts +2 -0
  37. package/dist/cli.d.ts +2 -0
  38. package/dist/cli.js +1154 -0
  39. package/dist/cli.js.map +1 -0
  40. package/dist/cli.mjs +52 -0
  41. package/dist/cli.mjs.map +1 -0
  42. package/dist/commands/add.d.mts +5 -0
  43. package/dist/commands/add.d.ts +5 -0
  44. package/dist/commands/add.js +126 -0
  45. package/dist/commands/add.js.map +1 -0
  46. package/dist/commands/add.mjs +10 -0
  47. package/dist/commands/add.mjs.map +1 -0
  48. package/dist/commands/code.d.mts +5 -0
  49. package/dist/commands/code.d.ts +5 -0
  50. package/dist/commands/code.js +187 -0
  51. package/dist/commands/code.js.map +1 -0
  52. package/dist/commands/code.mjs +9 -0
  53. package/dist/commands/code.mjs.map +1 -0
  54. package/dist/commands/install.d.mts +5 -0
  55. package/dist/commands/install.d.ts +5 -0
  56. package/dist/commands/install.js +296 -0
  57. package/dist/commands/install.js.map +1 -0
  58. package/dist/commands/install.mjs +9 -0
  59. package/dist/commands/install.mjs.map +1 -0
  60. package/dist/commands/kickstart.d.mts +5 -0
  61. package/dist/commands/kickstart.d.ts +5 -0
  62. package/dist/commands/kickstart.js +322 -0
  63. package/dist/commands/kickstart.js.map +1 -0
  64. package/dist/commands/kickstart.mjs +10 -0
  65. package/dist/commands/kickstart.mjs.map +1 -0
  66. package/dist/commands/push.d.mts +5 -0
  67. package/dist/commands/push.d.ts +5 -0
  68. package/dist/commands/push.js +137 -0
  69. package/dist/commands/push.js.map +1 -0
  70. package/dist/commands/push.mjs +9 -0
  71. package/dist/commands/push.mjs.map +1 -0
  72. package/dist/commands/status.d.mts +7 -0
  73. package/dist/commands/status.d.ts +7 -0
  74. package/dist/commands/status.js +148 -0
  75. package/dist/commands/status.js.map +1 -0
  76. package/dist/commands/status.mjs +13 -0
  77. package/dist/commands/status.mjs.map +1 -0
  78. package/dist/commands/update.d.mts +5 -0
  79. package/dist/commands/update.d.ts +5 -0
  80. package/dist/commands/update.js +172 -0
  81. package/dist/commands/update.js.map +1 -0
  82. package/dist/commands/update.mjs +9 -0
  83. package/dist/commands/update.mjs.map +1 -0
  84. package/dist/index.d.mts +20 -0
  85. package/dist/index.d.ts +20 -0
  86. package/dist/index.js +406 -0
  87. package/dist/index.js.map +1 -0
  88. package/dist/index.mjs +14 -0
  89. package/dist/index.mjs.map +1 -0
  90. package/dist/package-template.txt +494 -0
  91. package/package.json +68 -0
@@ -0,0 +1,494 @@
1
+ --- filename: package.json
2
+ {
3
+ "name": "@microfox/<%= packageName %>",
4
+ "version": "1.0.0",
5
+ "description": "<%= description %>",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "types": "./dist/index.d.ts",
9
+ "files": ["dist/**", "CHANGELOG.md"],
10
+ "scripts": {
11
+ "build": "tsup",
12
+ "build:watch": "tsup --watch",
13
+ "clean": "rm -rf dist",
14
+ "lint": "eslint \"./**/*.ts*\"",
15
+ "prettier-check": "prettier --check \"./**/*.ts*\"",
16
+ "test": "vitest run",
17
+ "test:watch": "vitest"
18
+ },
19
+ "exports": {
20
+ "./package.json": "./package.json",
21
+ ".": {
22
+ "import": "./dist/index.mjs",
23
+ "require": "./dist/index.js"
24
+ }
25
+ },
26
+ "dependencies": {
27
+ "zod": "^3.24.3"
28
+ },
29
+ "devDependencies": {
30
+ "@eslint/js": "latest",
31
+ "@types/node": "^18",
32
+ "@typescript-eslint/eslint-plugin": "latest",
33
+ "@typescript-eslint/parser": "latest",
34
+ "eslint": "^9.1.0",
35
+ "prettier": "^3.0.0",
36
+ "tsup": "^8",
37
+ "typescript": "^5.6.3",
38
+ "vitest": "^1.0.0"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "engines": {
44
+ "node": ">=18.0.0"
45
+ },
46
+ "keywords": ["<%= simpleName %>", "typescript", "api", "sdk"]
47
+ }
48
+ --- filename: package-info.json
49
+ {
50
+ "name": "@microfox/<%= packageName %>",
51
+ "title": "<%= titleName %> TypeScript SDK",
52
+ "description": "<%= description %>",
53
+ "platformType": "tool",
54
+ "path": ".",
55
+ "dependencies": ["zod"],
56
+ "status": "unstable",
57
+ "documentation": "https://www.npmjs.com/package/@microfox/<%= packageName %>",
58
+ "icon": "https://via.placeholder.com/64x64.png?text=<%= simpleName.charAt(0).toUpperCase() %>",
59
+ "constructors": [],
60
+ "extraInfo": [],
61
+ "authType": "none"
62
+ }
63
+ --- filename: tsconfig.json
64
+ {
65
+ "compilerOptions": {
66
+ "target": "ES2020",
67
+ "module": "ESNext",
68
+ "moduleResolution": "node",
69
+ "declaration": true,
70
+ "declarationMap": true,
71
+ "sourceMap": true,
72
+ "outDir": "./dist",
73
+ "rootDir": "./src",
74
+ "strict": true,
75
+ "esModuleInterop": true,
76
+ "skipLibCheck": true,
77
+ "forceConsistentCasingInFileNames": true,
78
+ "resolveJsonModule": true
79
+ },
80
+ "include": ["src/**/*"],
81
+ "exclude": ["node_modules", "dist", "**/*.test.ts"]
82
+ }
83
+ --- filename: tsup.config.ts
84
+ import { defineConfig } from 'tsup';
85
+
86
+ export default defineConfig({
87
+ entry: ['src/index.ts'],
88
+ format: ['cjs', 'esm'],
89
+ dts: true,
90
+ sourcemap: true,
91
+ clean: true,
92
+ });
93
+ --- filename: eslint.config.js
94
+ import js from '@eslint/js';
95
+ import tseslint from '@typescript-eslint/eslint-plugin';
96
+ import tsparser from '@typescript-eslint/parser';
97
+
98
+ export default [
99
+ js.configs.recommended,
100
+ {
101
+ files: ['**/*.ts', '**/*.tsx'],
102
+ languageOptions: {
103
+ parser: tsparser,
104
+ parserOptions: {
105
+ ecmaVersion: 2020,
106
+ sourceType: 'module',
107
+ ecmaFeatures: {
108
+ jsx: true,
109
+ },
110
+ },
111
+ globals: {
112
+ console: 'readonly',
113
+ process: 'readonly',
114
+ },
115
+ },
116
+ plugins: {
117
+ '@typescript-eslint': tseslint,
118
+ },
119
+ rules: {
120
+ ...tseslint.configs.recommended.rules,
121
+ 'no-unused-vars': 'off',
122
+ '@typescript-eslint/no-unused-vars': ['warn'],
123
+ 'no-console': 'warn',
124
+ 'react/prop-types': 'off',
125
+ 'no-case-declarations': 'off',
126
+ '@typescript-eslint/no-explicit-any': 'off',
127
+ '@typescript-eslint/ban-ts-comment': 'off',
128
+ '@typescript-eslint/no-empty-function': 'off',
129
+ },
130
+ },
131
+ {
132
+ ignores: [
133
+ 'dist/**',
134
+ 'node_modules/**',
135
+ '.turbo/**',
136
+ 'coverage/**',
137
+ '**/*.js',
138
+ '**/*.test.ts',
139
+ ],
140
+ },
141
+ ];
142
+ --- filename: .prettierrc
143
+ {
144
+ "semi": true,
145
+ "singleQuote": true,
146
+ "tabWidth": 2,
147
+ "trailingComma": "es5"
148
+ }
149
+ --- filename: vitest.config.ts
150
+ import { defineConfig } from 'vitest/config';
151
+
152
+ export default defineConfig({
153
+ test: {
154
+ environment: 'node',
155
+ },
156
+ });
157
+ --- filename: .gitignore
158
+ # Dependencies
159
+ node_modules/
160
+ npm-debug.log*
161
+ yarn-debug.log*
162
+ yarn-error.log*
163
+
164
+ # Build outputs
165
+ dist/
166
+ build/
167
+
168
+ # Environment variables
169
+ .env
170
+ .env.local
171
+ .env.*.local
172
+
173
+ # IDE
174
+ .vscode/
175
+ .idea/
176
+ *.swp
177
+ *.swo
178
+
179
+ # OS
180
+ .DS_Store
181
+ Thumbs.db
182
+
183
+ # Logs
184
+ logs
185
+ *.log
186
+
187
+ # Coverage
188
+ coverage/
189
+ .nyc_output
190
+
191
+ # Runtime
192
+ .cache/
193
+ --- filename: src/index.ts
194
+ // Main exports for <%= simpleName %>
195
+ export { <%= className %> } from './<%= simpleName %>Sdk';
196
+ export * from './schemas';
197
+
198
+ // Example usage:
199
+ // import { <%= className %> } from '@microfox/<%= packageName %>';
200
+ // const sdk = new <%= className %>({ apiKey: 'your-key' });
201
+ --- filename: src/<%= simpleName %>Sdk.ts
202
+ import { <%= className %>ConfigSchema } from './schemas';
203
+
204
+ /**
205
+ * Configuration options for the <%= className %>
206
+ */
207
+ export interface <%= className %>Config {
208
+ /** API key for authentication */
209
+ apiKey: string;
210
+ /** Base URL for the API (optional) */
211
+ baseUrl?: string;
212
+ /** SDK name identifier (optional) */
213
+ name?: string;
214
+ /** API version to use (optional) */
215
+ version?: string;
216
+ }
217
+
218
+ /**
219
+ * Standard response format for all SDK methods
220
+ */
221
+ export interface <%= className %>Response<T = any> {
222
+ /** The response data */
223
+ data: T;
224
+ /** Whether the request was successful */
225
+ success: boolean;
226
+ /** HTTP status code */
227
+ status: number;
228
+ /** Response message */
229
+ message: string;
230
+ /** Error object if the request failed */
231
+ error?: Error;
232
+ }
233
+
234
+ /**
235
+ * <%= className %> - A TypeScript SDK template
236
+ *
237
+ * @example
238
+ * \`\`\`typescript
239
+ * import { <%= className %> } from '@microfox/<%= packageName %>';
240
+ *
241
+ * const sdk = new <%= className %>({
242
+ * apiKey: 'your-api-key',
243
+ * baseUrl: 'https://api.example.com'
244
+ * });
245
+ *
246
+ * const result = await sdk.hello('World');
247
+ * console.log(result.data);
248
+ * \`\`\`
249
+ */
250
+ export class <%= className %> {
251
+ private config: <%= className %>Config;
252
+
253
+ /**
254
+ * Create a new <%= className %> instance
255
+ *
256
+ * @param config - Configuration for the SDK
257
+ */
258
+ constructor(config: <%= className %>Config) {
259
+ // Validate configuration using Zod schema
260
+ this.config = <%= className %>ConfigSchema.parse(config);
261
+ }
262
+
263
+ /**
264
+ * Get current configuration
265
+ *
266
+ * @returns Copy of the current config
267
+ */
268
+ getConfig(): <%= className %>Config {
269
+ return { ...this.config };
270
+ }
271
+
272
+ /**
273
+ * Example hello method - replace with your own methods
274
+ *
275
+ * @param name - Name to greet
276
+ * @returns Promise with greeting response
277
+ */
278
+ async hello(name: string): Promise<<%= className %>Response<string>> {
279
+ return {
280
+ data: `Hello, ${name}! Welcome to ${this.config.name || '<%= simpleName %>'} SDK.`,
281
+ success: true,
282
+ status: 200,
283
+ message: 'Success'
284
+ };
285
+ }
286
+
287
+ // TODO: Add your SDK methods here
288
+ // Example:
289
+ // async getData(id: string): Promise<<%= className %>Response<any>> {
290
+ // // Your implementation
291
+ // }
292
+
293
+ // async createItem(data: any): Promise<<%= className %>Response<any>> {
294
+ // // Your implementation
295
+ // }
296
+ }
297
+ --- filename: src/schemas/index.ts
298
+ import { z } from 'zod';
299
+
300
+ // Zod schemas for <%= simpleName %> SDK validation
301
+
302
+ /**
303
+ * Schema for <%= className %> configuration validation
304
+ */
305
+ export const <%= className %>ConfigSchema = z.object({
306
+ apiKey: z.string().min(1, 'API key is required'),
307
+ baseUrl: z.string().url().optional(),
308
+ name: z.string().optional(),
309
+ version: z.string().optional(),
310
+ });
311
+
312
+ /**
313
+ * Schema for API response validation
314
+ */
315
+ export const <%= className %>ResponseSchema = z.object({
316
+ data: z.any(),
317
+ success: z.boolean(),
318
+ status: z.number(),
319
+ message: z.string(),
320
+ error: z.instanceof(Error).optional(),
321
+ });
322
+
323
+ // TODO: Add your validation schemas here
324
+ // Example:
325
+ // export const UserSchema = z.object({
326
+ // id: z.string(),
327
+ // name: z.string().min(1, 'Name is required'),
328
+ // email: z.string().email('Invalid email format')
329
+ // });
330
+
331
+ // export const CreateUserSchema = z.object({
332
+ // name: z.string().min(1, 'Name is required'),
333
+ // email: z.string().email('Invalid email format')
334
+ // });
335
+ --- filename: src/__tests__/<%= simpleName %>.test.ts
336
+ import { describe, it, expect, beforeEach } from 'vitest';
337
+ import { <%= className %>, type <%= className %>Config } from '../<%= simpleName %>Sdk';
338
+
339
+ describe('<%= className %>', () => {
340
+ let config: <%= className %>Config;
341
+
342
+ beforeEach(() => {
343
+ config = {
344
+ apiKey: 'test-api-key',
345
+ baseUrl: 'https://api.test.com',
346
+ name: '<%= simpleName %>',
347
+ version: '1.0.0',
348
+ };
349
+ });
350
+
351
+ describe('Constructor', () => {
352
+ it('should create an instance with valid config', () => {
353
+ const sdk = new <%= className %>(config);
354
+ expect(sdk).toBeInstanceOf(<%= className %>);
355
+ });
356
+
357
+ it('should throw error with invalid config', () => {
358
+ const invalidConfig = { ...config, apiKey: '' };
359
+ expect(() => new <%= className %>(invalidConfig)).toThrow();
360
+ });
361
+ });
362
+
363
+ describe('Hello Method', () => {
364
+ it('should return a successful greeting response', async () => {
365
+ const sdk = new <%= className %>(config);
366
+ const result = await sdk.hello('World');
367
+
368
+ expect(result.success).toBe(true);
369
+ expect(result.status).toBe(200);
370
+ expect(result.data).toContain('Hello, World!');
371
+ expect(result.message).toBe('Success');
372
+ });
373
+ });
374
+
375
+ // TODO: Add your own tests here
376
+ // Example:
377
+ // describe('Your API Method', () => {
378
+ // it('should do something', async () => {
379
+ // const sdk = new <%= className %>(config);
380
+ // // Your test implementation
381
+ // });
382
+ // });
383
+ });
384
+ --- filename: README.md
385
+ # <%= titleName %>
386
+
387
+ <!-- Add your project description here -->
388
+ <%= description %>
389
+
390
+ ## Installation
391
+
392
+ \`\`\`bash
393
+ npm install @microfox/<%= packageName %>
394
+ \`\`\`
395
+
396
+ ## Quick Start
397
+
398
+ \`\`\`typescript
399
+ import { <%= className %> } from '@microfox/<%= packageName %>';
400
+
401
+ // Initialize the SDK
402
+ const sdk = new <%= className %>({
403
+ apiKey: 'your-api-key',
404
+ // Add other config options
405
+ });
406
+
407
+ // Example usage
408
+ const result = await sdk.hello('World');
409
+ console.log(result.data);
410
+ \`\`\`
411
+
412
+ ## Configuration
413
+
414
+ \`\`\`typescript
415
+ interface <%= className %>Config {
416
+ apiKey: string; // Required: Your API key
417
+ baseUrl?: string; // Optional: Custom base URL
418
+ name?: string; // Optional: SDK instance name
419
+ version?: string; // Optional: API version
420
+ }
421
+ \`\`\`
422
+
423
+ ## Methods
424
+
425
+ ### hello(name: string)
426
+
427
+ Example method - replace with your own API methods.
428
+
429
+ \`\`\`typescript
430
+ const result = await sdk.hello('World');
431
+ // Returns: { data: "Hello, World!", success: true, status: 200, message: "Success" }
432
+ \`\`\`
433
+
434
+ <!--
435
+ ## TODO: Add your API documentation here
436
+
437
+ ### getData(id: string)
438
+ \`\`\`typescript
439
+ const data = await sdk.getData('123');
440
+ \`\`\`
441
+
442
+ ### createItem(item: object)
443
+ \`\`\`typescript
444
+ const result = await sdk.createItem({ name: 'Example' });
445
+ \`\`\`
446
+ -->
447
+
448
+ ## Development
449
+
450
+ \`\`\`bash
451
+ # Install dependencies
452
+ npm install
453
+
454
+ # Build the project
455
+ npm run build
456
+
457
+ # Run tests
458
+ npm test
459
+
460
+ # Lint code
461
+ npm run lint
462
+ \`\`\`
463
+
464
+ ## License
465
+
466
+ MIT
467
+ --- filename: CHANGELOG.md
468
+ # Changelog
469
+
470
+ All notable changes to this project will be documented in this file.
471
+
472
+ ## [1.0.0] - <%= new Date().toISOString().split('T')[0] %>
473
+
474
+ ### Added
475
+ - Initial release
476
+ - Basic SDK structure
477
+ - TypeScript support
478
+
479
+ <!-- Add your changes here using this format:
480
+
481
+ ## [1.1.0] - YYYY-MM-DD
482
+
483
+ ### Added
484
+ - New feature
485
+
486
+ ### Changed
487
+ - Updated feature
488
+
489
+ ### Fixed
490
+ - Bug fix
491
+
492
+ ### Removed
493
+ - Deprecated feature
494
+ -->
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "microfox",
3
+ "version": "1.0.11",
4
+ "description": "Universal CLI tool for creating modern TypeScript packages with npm availability checking",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "microfox": "./dist/cli.js"
10
+ },
11
+ "files": [
12
+ "dist/**/*",
13
+ "CHANGELOG.md"
14
+ ],
15
+ "scripts": {
16
+ "build": "tsup",
17
+ "build:watch": "tsup --watch",
18
+ "clean": "rm -rf dist",
19
+ "lint": "eslint \"./**/*.ts*\"",
20
+ "prettier-check": "prettier --check \"./**/*.ts*\""
21
+ },
22
+ "exports": {
23
+ "./package.json": "./package.json",
24
+ ".": {
25
+ "import": "./dist/index.mjs",
26
+ "require": "./dist/index.js"
27
+ }
28
+ },
29
+ "dependencies": {
30
+ "@types/micromatch": "^4.0.9",
31
+ "axios": "^1.10.0",
32
+ "chalk": "^5.3.0",
33
+ "commander": "^14.0.0",
34
+ "inquirer": "^12.7.0",
35
+ "micromatch": "^4.0.8",
36
+ "readline-sync": "^1.4.10",
37
+ "zod": "^4.0.5"
38
+ },
39
+ "devDependencies": {
40
+ "@microfox/tsconfig": "*",
41
+ "@types/inquirer": "^9.0.8",
42
+ "@types/node": "^24.0.8",
43
+ "@types/readline-sync": "^1.4.8",
44
+ "tsup": "^8",
45
+ "typescript": "5.8.3"
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "engines": {
51
+ "node": ">=20.0.0"
52
+ },
53
+ "homepage": "https://github.com/microfox-ai/microfox",
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/microfox-ai/microfox.git"
57
+ },
58
+ "bugs": {
59
+ "url": "https://github.com/microfox-ai/microfox/issues"
60
+ },
61
+ "keywords": [
62
+ "microfox",
63
+ "cli",
64
+ "tool",
65
+ "package-management",
66
+ "typescript"
67
+ ]
68
+ }