spawnee 1.0.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/LICENSE +22 -0
- package/README.md +265 -0
- package/dist/core/orchestrator.d.ts +45 -0
- package/dist/core/orchestrator.js +240 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/task-queue.d.ts +49 -0
- package/dist/core/task-queue.js +113 -0
- package/dist/core/task-queue.js.map +1 -0
- package/dist/cursor/client.d.ts +20 -0
- package/dist/cursor/client.js +133 -0
- package/dist/cursor/client.js.map +1 -0
- package/dist/cursor/types.d.ts +60 -0
- package/dist/cursor/types.js +2 -0
- package/dist/cursor/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +274 -0
- package/dist/index.js.map +1 -0
- package/dist/parsers/index.d.ts +241 -0
- package/dist/parsers/index.js +119 -0
- package/dist/parsers/index.js.map +1 -0
- package/dist/storage/file-adapter.d.ts +10 -0
- package/dist/storage/file-adapter.js +46 -0
- package/dist/storage/file-adapter.js.map +1 -0
- package/dist/storage/state-store.d.ts +31 -0
- package/dist/storage/state-store.js +2 -0
- package/dist/storage/state-store.js.map +1 -0
- package/dist/utils/config.d.ts +42 -0
- package/dist/utils/config.js +74 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.js +47 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/retry.d.ts +8 -0
- package/dist/utils/retry.js +20 -0
- package/dist/utils/retry.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface RetryOptions {
|
|
2
|
+
maxAttempts?: number;
|
|
3
|
+
baseDelay?: number;
|
|
4
|
+
maxDelay?: number;
|
|
5
|
+
backoffMultiplier?: number;
|
|
6
|
+
onRetry?: (attempt: number, error: Error) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function retry<T>(fn: () => Promise<T>, options?: RetryOptions): Promise<T>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export async function retry(fn, options = {}) {
|
|
2
|
+
const { maxAttempts = 3, baseDelay = 1000, maxDelay = 30000, backoffMultiplier = 2, onRetry } = options;
|
|
3
|
+
let lastError;
|
|
4
|
+
let delay = baseDelay;
|
|
5
|
+
for (let attempt = 1; attempt <= maxAttempts; attempt++) {
|
|
6
|
+
try {
|
|
7
|
+
return await fn();
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
lastError = error;
|
|
11
|
+
if (attempt === maxAttempts)
|
|
12
|
+
break;
|
|
13
|
+
onRetry?.(attempt, lastError);
|
|
14
|
+
await new Promise(resolve => setTimeout(resolve, delay));
|
|
15
|
+
delay = Math.min(delay * backoffMultiplier, maxDelay);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
throw lastError;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/utils/retry.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,KAAK,UAAU,KAAK,CAAI,EAAoB,EAAE,UAAwB,EAAE;IAC7E,MAAM,EAAE,WAAW,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACxG,IAAI,SAA4B,CAAC;IACjC,IAAI,KAAK,GAAG,SAAS,CAAC;IAEtB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACxD,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS,GAAG,KAAc,CAAC;YAC3B,IAAI,OAAO,KAAK,WAAW;gBAAE,MAAM;YACnC,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAC9B,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;YACzD,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,MAAM,SAAS,CAAC;AAClB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "spawnee",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Spawn and orchestrate Cursor Cloud Agents from task templates",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"spawnee": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"start": "node dist/index.js",
|
|
19
|
+
"dev": "tsx src/index.ts",
|
|
20
|
+
"lint": "eslint src/**/*.ts",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"clean": "rm -rf dist"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"axios": "^1.7.0",
|
|
26
|
+
"chalk": "^5.3.0",
|
|
27
|
+
"commander": "^12.1.0",
|
|
28
|
+
"ora": "^8.1.0",
|
|
29
|
+
"yaml": "^2.5.0",
|
|
30
|
+
"zod": "^3.23.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^22.0.0",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
35
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
36
|
+
"eslint": "^9.0.0",
|
|
37
|
+
"tsx": "^4.19.0",
|
|
38
|
+
"typescript": "^5.6.0"
|
|
39
|
+
},
|
|
40
|
+
"engines": {
|
|
41
|
+
"node": ">=20.0.0"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"cursor",
|
|
45
|
+
"ai",
|
|
46
|
+
"agents",
|
|
47
|
+
"automation",
|
|
48
|
+
"orchestration",
|
|
49
|
+
"spawnee",
|
|
50
|
+
"task-runner",
|
|
51
|
+
"parallel"
|
|
52
|
+
],
|
|
53
|
+
"author": "spencech",
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/spencech/spawnee.git"
|
|
58
|
+
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/spencech/spawnee/issues"
|
|
61
|
+
},
|
|
62
|
+
"homepage": "https://github.com/spencech/spawnee#readme"
|
|
63
|
+
}
|