@uluops/setup 0.2.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.
Files changed (107) hide show
  1. package/README.md +178 -0
  2. package/assets/agents/api-contract-validator-agent.md +960 -0
  3. package/assets/agents/aristotle-analyst-agent.md +705 -0
  4. package/assets/agents/aristotle-explorer-agent.md +152 -0
  5. package/assets/agents/aristotle-forecaster-agent.md +666 -0
  6. package/assets/agents/aristotle-validator-agent.md +667 -0
  7. package/assets/agents/assumption-excavator-agent.md +1354 -0
  8. package/assets/agents/code-auditor-agent.md +1061 -0
  9. package/assets/agents/code-optimizer-agent.md +876 -0
  10. package/assets/agents/code-validator-agent.md +846 -0
  11. package/assets/agents/docs-validator-agent.md +490 -0
  12. package/assets/agents/frontend-validator-agent.md +844 -0
  13. package/assets/agents/mcp-validator-agent.md +827 -0
  14. package/assets/agents/pre-implementation-architect-agent.md +1036 -0
  15. package/assets/agents/prompt-engineer-agent.md +1158 -0
  16. package/assets/agents/prompt-pattern-analyzer-agent.md +907 -0
  17. package/assets/agents/prompt-quality-validator-agent.md +1018 -0
  18. package/assets/agents/public-interface-validator-agent.md +951 -0
  19. package/assets/agents/release-readiness-agent.md +482 -0
  20. package/assets/agents/security-analyst-agent.md +1093 -0
  21. package/assets/agents/test-architect-agent.md +861 -0
  22. package/assets/agents/type-safety-validator-agent.md +932 -0
  23. package/assets/agents/workflow-synthesis-agent.md +836 -0
  24. package/assets/commands/agents/api-contract.md +135 -0
  25. package/assets/commands/agents/architect.md +135 -0
  26. package/assets/commands/agents/aristotle-analyst.md +115 -0
  27. package/assets/commands/agents/aristotle-explorer.md +92 -0
  28. package/assets/commands/agents/aristotle-forecaster.md +114 -0
  29. package/assets/commands/agents/aristotle-validator.md +114 -0
  30. package/assets/commands/agents/assumption-excavator.md +114 -0
  31. package/assets/commands/agents/audit.md +136 -0
  32. package/assets/commands/agents/docs-validate.md +133 -0
  33. package/assets/commands/agents/frontend.md +135 -0
  34. package/assets/commands/agents/mcp-validate.md +136 -0
  35. package/assets/commands/agents/optimize.md +133 -0
  36. package/assets/commands/agents/pattern-analyzer.md +126 -0
  37. package/assets/commands/agents/prompt-quality.md +134 -0
  38. package/assets/commands/agents/prompt-validate.md +135 -0
  39. package/assets/commands/agents/public-interface.md +134 -0
  40. package/assets/commands/agents/release.md +135 -0
  41. package/assets/commands/agents/security.md +137 -0
  42. package/assets/commands/agents/test-review.md +136 -0
  43. package/assets/commands/agents/type-safety.md +135 -0
  44. package/assets/commands/agents/validate.md +134 -0
  45. package/assets/commands/agents/workflow-synthesis.md +101 -0
  46. package/assets/commands/workflows/aristotle.md +543 -0
  47. package/assets/commands/workflows/post-implementation.md +577 -0
  48. package/assets/commands/workflows/pre-implementation.md +670 -0
  49. package/assets/commands/workflows/prompt-audit.md +754 -0
  50. package/assets/commands/workflows/ship.md +721 -0
  51. package/dist/cli.d.ts +2 -0
  52. package/dist/cli.js +436 -0
  53. package/dist/lib/config-merger.d.ts +26 -0
  54. package/dist/lib/config-merger.js +63 -0
  55. package/dist/lib/file-ops.d.ts +23 -0
  56. package/dist/lib/file-ops.js +86 -0
  57. package/dist/lib/hash.d.ts +1 -0
  58. package/dist/lib/hash.js +4 -0
  59. package/dist/lib/manifest.d.ts +16 -0
  60. package/dist/lib/manifest.js +34 -0
  61. package/dist/lib/paths.d.ts +14 -0
  62. package/dist/lib/paths.js +49 -0
  63. package/dist/lib/settings-merger.d.ts +43 -0
  64. package/dist/lib/settings-merger.js +91 -0
  65. package/dist/steps/agents.d.ts +8 -0
  66. package/dist/steps/agents.js +14 -0
  67. package/dist/steps/auth.d.ts +12 -0
  68. package/dist/steps/auth.js +80 -0
  69. package/dist/steps/commands.d.ts +9 -0
  70. package/dist/steps/commands.js +69 -0
  71. package/dist/steps/detect.d.ts +9 -0
  72. package/dist/steps/detect.js +30 -0
  73. package/dist/steps/mcp.d.ts +6 -0
  74. package/dist/steps/mcp.js +40 -0
  75. package/dist/steps/metrics.d.ts +22 -0
  76. package/dist/steps/metrics.js +176 -0
  77. package/dist/steps/shell.d.ts +2 -0
  78. package/dist/steps/shell.js +48 -0
  79. package/dist/steps/signup.d.ts +13 -0
  80. package/dist/steps/signup.js +92 -0
  81. package/dist/steps/verify.d.ts +10 -0
  82. package/dist/steps/verify.js +184 -0
  83. package/dist/test/auth.test.d.ts +1 -0
  84. package/dist/test/auth.test.js +43 -0
  85. package/dist/test/config-io.test.d.ts +1 -0
  86. package/dist/test/config-io.test.js +56 -0
  87. package/dist/test/config-merger.test.d.ts +1 -0
  88. package/dist/test/config-merger.test.js +94 -0
  89. package/dist/test/detect.test.d.ts +1 -0
  90. package/dist/test/detect.test.js +25 -0
  91. package/dist/test/file-ops.test.d.ts +1 -0
  92. package/dist/test/file-ops.test.js +100 -0
  93. package/dist/test/hash.test.d.ts +1 -0
  94. package/dist/test/hash.test.js +14 -0
  95. package/dist/test/manifest.test.d.ts +1 -0
  96. package/dist/test/manifest.test.js +78 -0
  97. package/dist/test/paths.test.d.ts +1 -0
  98. package/dist/test/paths.test.js +30 -0
  99. package/dist/test/settings-merger.test.d.ts +1 -0
  100. package/dist/test/settings-merger.test.js +167 -0
  101. package/dist/test/shell-profile.test.d.ts +1 -0
  102. package/dist/test/shell-profile.test.js +40 -0
  103. package/dist/test/shell.test.d.ts +1 -0
  104. package/dist/test/shell.test.js +71 -0
  105. package/dist/test/signup.test.d.ts +1 -0
  106. package/dist/test/signup.test.js +83 -0
  107. package/package.json +36 -0
@@ -0,0 +1,83 @@
1
+ import { describe, it, expect, vi, afterEach } from "vitest";
2
+ import { validatePassword, validateEmail } from "../steps/signup.js";
3
+ describe("validatePassword", () => {
4
+ it("accepts a valid password", () => {
5
+ expect(validatePassword("GoodPass1")).toBe(true);
6
+ });
7
+ it("rejects passwords shorter than 8 chars", () => {
8
+ expect(validatePassword("Short1A")).toContain("at least 8");
9
+ });
10
+ it("rejects passwords longer than 128 chars", () => {
11
+ const long = "Aa1" + "x".repeat(126);
12
+ expect(validatePassword(long)).toContain("at most 128");
13
+ });
14
+ it("rejects passwords without lowercase", () => {
15
+ expect(validatePassword("ALLCAPS123")).toContain("lowercase");
16
+ });
17
+ it("rejects passwords without uppercase", () => {
18
+ expect(validatePassword("alllower123")).toContain("uppercase");
19
+ });
20
+ it("rejects passwords without number", () => {
21
+ expect(validatePassword("NoNumbersHere")).toContain("number");
22
+ });
23
+ });
24
+ describe("validateEmail", () => {
25
+ it("accepts a valid email", () => {
26
+ expect(validateEmail("user@example.com")).toBe(true);
27
+ });
28
+ it("rejects empty string", () => {
29
+ expect(validateEmail("")).toContain("required");
30
+ });
31
+ it("rejects missing @", () => {
32
+ expect(validateEmail("notanemail")).toContain("Invalid");
33
+ });
34
+ it("rejects missing domain", () => {
35
+ expect(validateEmail("user@")).toContain("Invalid");
36
+ });
37
+ });
38
+ describe("signup (network)", () => {
39
+ afterEach(() => {
40
+ vi.restoreAllMocks();
41
+ });
42
+ it("handles 409 conflict (duplicate email)", async () => {
43
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({
44
+ ok: false,
45
+ status: 409,
46
+ json: async () => ({ error: { message: "Email already exists" } }),
47
+ headers: new Headers(),
48
+ }));
49
+ const { signup } = await import("../steps/signup.js");
50
+ // Mock inquirer prompts
51
+ vi.mock("@inquirer/prompts", () => ({
52
+ input: vi.fn().mockResolvedValue("existing@example.com"),
53
+ password: vi.fn().mockResolvedValue("ValidPass1"),
54
+ }));
55
+ await expect(signup()).rejects.toThrow("already registered");
56
+ vi.unstubAllGlobals();
57
+ });
58
+ it("handles 429 rate limit", async () => {
59
+ vi.stubGlobal("fetch", vi.fn().mockResolvedValue({
60
+ ok: false,
61
+ status: 429,
62
+ json: async () => ({ error: { message: "Too many requests" } }),
63
+ headers: new Headers({ "Retry-After": "30" }),
64
+ }));
65
+ const { signup } = await import("../steps/signup.js");
66
+ vi.mock("@inquirer/prompts", () => ({
67
+ input: vi.fn().mockResolvedValue("user@example.com"),
68
+ password: vi.fn().mockResolvedValue("ValidPass1"),
69
+ }));
70
+ await expect(signup()).rejects.toThrow("Rate limited");
71
+ vi.unstubAllGlobals();
72
+ });
73
+ it("handles network failure", async () => {
74
+ vi.stubGlobal("fetch", vi.fn().mockRejectedValue(new TypeError("fetch failed")));
75
+ const { signup } = await import("../steps/signup.js");
76
+ vi.mock("@inquirer/prompts", () => ({
77
+ input: vi.fn().mockResolvedValue("user@example.com"),
78
+ password: vi.fn().mockResolvedValue("ValidPass1"),
79
+ }));
80
+ await expect(signup()).rejects.toThrow("Can't reach");
81
+ vi.unstubAllGlobals();
82
+ });
83
+ });
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@uluops/setup",
3
+ "version": "0.2.0",
4
+ "description": "Zero-friction installer for UluOps + Claude Code",
5
+ "type": "module",
6
+ "bin": {
7
+ "uluops-setup": "./dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "assets"
12
+ ],
13
+ "engines": {
14
+ "node": ">=18.0.0"
15
+ },
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "dev": "tsx src/cli.ts",
19
+ "typecheck": "tsc --noEmit",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest watch",
22
+ "prepublishOnly": "npm run build"
23
+ },
24
+ "dependencies": {
25
+ "@inquirer/prompts": "^7.0.0",
26
+ "@uluops/agent-metrics": "^0.2.0",
27
+ "chalk": "^5.0.0",
28
+ "commander": "^12.0.0"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^22.0.0",
32
+ "tsx": "^4.0.0",
33
+ "typescript": "^5.7.0",
34
+ "vitest": "^3.0.0"
35
+ }
36
+ }