@locusai/sdk 0.4.6 → 0.4.10

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 (58) hide show
  1. package/dist/agent/worker.js +1271 -239
  2. package/dist/index-node.js +1601 -20
  3. package/dist/index.js +429 -121
  4. package/dist/orchestrator.d.ts.map +1 -1
  5. package/package.json +7 -19
  6. package/dist/agent/artifact-syncer.js +0 -77
  7. package/dist/agent/codebase-indexer-service.js +0 -55
  8. package/dist/agent/index.js +0 -5
  9. package/dist/agent/sprint-planner.js +0 -68
  10. package/dist/agent/task-executor.js +0 -60
  11. package/dist/ai/anthropic-client.js +0 -70
  12. package/dist/ai/claude-runner.js +0 -71
  13. package/dist/ai/index.js +0 -2
  14. package/dist/core/config.js +0 -15
  15. package/dist/core/index.js +0 -3
  16. package/dist/core/indexer.js +0 -113
  17. package/dist/core/prompt-builder.js +0 -83
  18. package/dist/events.js +0 -15
  19. package/dist/modules/auth.js +0 -23
  20. package/dist/modules/base.js +0 -8
  21. package/dist/modules/ci.js +0 -7
  22. package/dist/modules/docs.js +0 -38
  23. package/dist/modules/invitations.js +0 -22
  24. package/dist/modules/organizations.js +0 -39
  25. package/dist/modules/sprints.js +0 -34
  26. package/dist/modules/tasks.js +0 -56
  27. package/dist/modules/workspaces.js +0 -49
  28. package/dist/orchestrator.js +0 -356
  29. package/dist/utils/colors.js +0 -54
  30. package/dist/utils/retry.js +0 -37
  31. package/src/agent/artifact-syncer.ts +0 -111
  32. package/src/agent/codebase-indexer-service.ts +0 -71
  33. package/src/agent/index.ts +0 -5
  34. package/src/agent/sprint-planner.ts +0 -86
  35. package/src/agent/task-executor.ts +0 -85
  36. package/src/agent/worker.ts +0 -322
  37. package/src/ai/anthropic-client.ts +0 -93
  38. package/src/ai/claude-runner.ts +0 -86
  39. package/src/ai/index.ts +0 -2
  40. package/src/core/config.ts +0 -21
  41. package/src/core/index.ts +0 -3
  42. package/src/core/indexer.ts +0 -131
  43. package/src/core/prompt-builder.ts +0 -91
  44. package/src/events.ts +0 -35
  45. package/src/index-node.ts +0 -23
  46. package/src/index.ts +0 -159
  47. package/src/modules/auth.ts +0 -48
  48. package/src/modules/base.ts +0 -9
  49. package/src/modules/ci.ts +0 -12
  50. package/src/modules/docs.ts +0 -84
  51. package/src/modules/invitations.ts +0 -45
  52. package/src/modules/organizations.ts +0 -90
  53. package/src/modules/sprints.ts +0 -69
  54. package/src/modules/tasks.ts +0 -110
  55. package/src/modules/workspaces.ts +0 -94
  56. package/src/orchestrator.ts +0 -473
  57. package/src/utils/colors.ts +0 -63
  58. package/src/utils/retry.ts +0 -56
@@ -1,63 +0,0 @@
1
- /**
2
- * Simple ANSI color utility for terminal output
3
- * Dependency-free and works in Node.js/Bun environments
4
- */
5
-
6
- const ESC = "\u001b[";
7
- const RESET = `${ESC}0m`;
8
-
9
- const colors = {
10
- reset: RESET,
11
- bold: `${ESC}1m`,
12
- dim: `${ESC}2m`,
13
- italic: `${ESC}3m`,
14
- underline: `${ESC}4m`,
15
-
16
- // Foreground colors
17
- black: `${ESC}30m`,
18
- red: `${ESC}31m`,
19
- green: `${ESC}32m`,
20
- yellow: `${ESC}33m`,
21
- blue: `${ESC}34m`,
22
- magenta: `${ESC}35m`,
23
- cyan: `${ESC}36m`,
24
- white: `${ESC}37m`,
25
- gray: `${ESC}90m`,
26
-
27
- // Foreground bright colors
28
- brightRed: `${ESC}91m`,
29
- brightGreen: `${ESC}92m`,
30
- brightYellow: `${ESC}93m`,
31
- brightBlue: `${ESC}94m`,
32
- brightMagenta: `${ESC}95m`,
33
- brightCyan: `${ESC}96m`,
34
- brightWhite: `${ESC}97m`,
35
- };
36
-
37
- type ColorName = keyof typeof colors;
38
-
39
- export const c = {
40
- text: (text: string, ...colorNames: ColorName[]) => {
41
- const codes = colorNames.map((name) => colors[name]).join("");
42
- return `${codes}${text}${RESET}`;
43
- },
44
-
45
- // Shortcuts
46
- bold: (t: string) => c.text(t, "bold"),
47
- dim: (t: string) => c.text(t, "dim"),
48
- red: (t: string) => c.text(t, "red"),
49
- green: (t: string) => c.text(t, "green"),
50
- yellow: (t: string) => c.text(t, "yellow"),
51
- blue: (t: string) => c.text(t, "blue"),
52
- magenta: (t: string) => c.text(t, "magenta"),
53
- cyan: (t: string) => c.text(t, "cyan"),
54
- gray: (t: string) => c.text(t, "gray"),
55
-
56
- // Combinations
57
- success: (t: string) => c.text(t, "green", "bold"),
58
- error: (t: string) => c.text(t, "red", "bold"),
59
- warning: (t: string) => c.text(t, "yellow", "bold"),
60
- info: (t: string) => c.text(t, "cyan", "bold"),
61
- primary: (t: string) => c.text(t, "blue", "bold"),
62
- underline: (t: string) => c.text(t, "underline"),
63
- };
@@ -1,56 +0,0 @@
1
- import { isAxiosError } from "axios";
2
-
3
- export interface RetryOptions {
4
- maxRetries?: number;
5
- initialDelay?: number;
6
- maxDelay?: number;
7
- factor?: number;
8
- retryCondition?: (error: unknown) => boolean;
9
- }
10
-
11
- export const DEFAULT_RETRY_OPTIONS: Required<RetryOptions> = {
12
- maxRetries: 3,
13
- initialDelay: 1000,
14
- maxDelay: 5000,
15
- factor: 2,
16
- retryCondition: (error: unknown) => {
17
- // Retry on network errors or 5xx server errors
18
- if (isAxiosError(error)) {
19
- if (!error.response) return true; // Network error
20
- return error.response.status >= 500;
21
- }
22
- return true; // Retry on other unknown errors
23
- },
24
- };
25
-
26
- /**
27
- * Retries an async function with exponential backoff
28
- */
29
- export async function withRetry<T>(
30
- fn: () => Promise<T>,
31
- options: RetryOptions = {}
32
- ): Promise<T> {
33
- const config = { ...DEFAULT_RETRY_OPTIONS, ...options };
34
- let lastError: unknown;
35
-
36
- for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
37
- try {
38
- return await fn();
39
- } catch (error: unknown) {
40
- lastError = error;
41
-
42
- if (attempt === config.maxRetries || !config.retryCondition(error)) {
43
- throw error;
44
- }
45
-
46
- const delay = Math.min(
47
- config.initialDelay * Math.pow(config.factor, attempt),
48
- config.maxDelay
49
- );
50
-
51
- await new Promise((resolve) => setTimeout(resolve, delay));
52
- }
53
- }
54
-
55
- throw lastError;
56
- }