agent-enderun 1.10.4 → 1.11.1

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 (210) hide show
  1. package/README.md +34 -45
  2. package/dist/framework-mcp/tests/tools/quality/check_lint.test.js +1 -1
  3. package/dist/framework-mcp/tests/tools/quality/check_lint.test.js.map +1 -1
  4. package/dist/src/cli/adapters/core.d.ts +1 -1
  5. package/dist/src/cli/adapters/core.js +0 -1
  6. package/dist/src/cli/adapters/core.js.map +1 -1
  7. package/dist/src/cli/adapters/index.d.ts +1 -0
  8. package/dist/src/cli/adapters/index.js +1 -0
  9. package/dist/src/cli/adapters/index.js.map +1 -1
  10. package/dist/src/cli/adapters/scaffold.d.ts +1 -1
  11. package/dist/src/cli/adapters/scaffold.js +13 -7
  12. package/dist/src/cli/adapters/scaffold.js.map +1 -1
  13. package/dist/src/cli/commands/init/scaffold-core.d.ts +5 -2
  14. package/dist/src/cli/commands/init/scaffold-core.js +28 -6
  15. package/dist/src/cli/commands/init/scaffold-core.js.map +1 -1
  16. package/dist/src/cli/commands/init.js +31 -4
  17. package/dist/src/cli/commands/init.js.map +1 -1
  18. package/dist/src/cli/commands/orchestrate.d.ts +9 -7
  19. package/dist/src/cli/commands/orchestrate.js +40 -4
  20. package/dist/src/cli/commands/orchestrate.js.map +1 -1
  21. package/dist/src/cli/commands/plan.d.ts +3 -1
  22. package/dist/src/cli/commands/plan.js +79 -22
  23. package/dist/src/cli/commands/plan.js.map +1 -1
  24. package/dist/src/cli/index.js +11 -15
  25. package/dist/src/cli/index.js.map +1 -1
  26. package/dist/src/cli/utils/compliance.js +0 -1
  27. package/dist/src/cli/utils/compliance.js.map +1 -1
  28. package/dist/src/cli/utils/config-schema.d.ts +7 -7
  29. package/dist/src/cli/utils/pkg.d.ts +19 -0
  30. package/dist/src/cli/utils/pkg.js +29 -5
  31. package/dist/src/cli/utils/pkg.js.map +1 -1
  32. package/dist/src/modules/adapters/definitions.js +1 -1
  33. package/dist/src/modules/adapters/definitions.js.map +1 -1
  34. package/dist/src/modules/adapters/shared.js +7 -4
  35. package/dist/src/modules/adapters/shared.js.map +1 -1
  36. package/dist/src/modules/agents/definitions.d.ts +1 -1
  37. package/dist/src/modules/agents/definitions.js +129 -69
  38. package/dist/src/modules/agents/definitions.js.map +1 -1
  39. package/dist/src/modules/agents/registry/analyst.js +5 -1
  40. package/dist/src/modules/agents/registry/analyst.js.map +1 -1
  41. package/dist/src/modules/agents/registry/backend.js +5 -4
  42. package/dist/src/modules/agents/registry/backend.js.map +1 -1
  43. package/dist/src/modules/agents/registry/database.js +2 -1
  44. package/dist/src/modules/agents/registry/database.js.map +1 -1
  45. package/dist/src/modules/agents/registry/devops.js +2 -0
  46. package/dist/src/modules/agents/registry/devops.js.map +1 -1
  47. package/dist/src/modules/agents/registry/explorer.js +1 -0
  48. package/dist/src/modules/agents/registry/explorer.js.map +1 -1
  49. package/dist/src/modules/agents/registry/git.js +3 -1
  50. package/dist/src/modules/agents/registry/git.js.map +1 -1
  51. package/dist/src/modules/agents/registry/manager.js +8 -2
  52. package/dist/src/modules/agents/registry/manager.js.map +1 -1
  53. package/dist/src/modules/agents/registry/native.js +5 -1
  54. package/dist/src/modules/agents/registry/native.js.map +1 -1
  55. package/dist/src/modules/agents/registry/security.js +1 -0
  56. package/dist/src/modules/agents/registry/security.js.map +1 -1
  57. package/dist/src/shared/constants.d.ts +1 -1
  58. package/dist/src/shared/constants.js +10 -9
  59. package/dist/src/shared/constants.js.map +1 -1
  60. package/dist/tests/approve.test.js +4 -9
  61. package/dist/tests/approve.test.js.map +1 -1
  62. package/dist/tests/integration/agent_flow.test.js +2 -2
  63. package/dist/tests/integration/agent_flow.test.js.map +1 -1
  64. package/dist/tests/orchestrate.test.js +2 -7
  65. package/dist/tests/orchestrate.test.js.map +1 -1
  66. package/framework-mcp/dist/constants.js +64 -0
  67. package/framework-mcp/dist/index.js +109 -0
  68. package/framework-mcp/dist/tools/control_plane/locking.js +64 -0
  69. package/framework-mcp/dist/tools/control_plane/registry.js +34 -0
  70. package/framework-mcp/dist/tools/dashboard/start_dashboard.js +29 -0
  71. package/framework-mcp/dist/tools/definitions.js +300 -0
  72. package/framework-mcp/dist/tools/file_system/batch_surgical_edit.js +59 -0
  73. package/framework-mcp/dist/tools/file_system/patch_file.js +25 -0
  74. package/framework-mcp/dist/tools/file_system/read_file.js +51 -0
  75. package/framework-mcp/dist/tools/file_system/replace_text.js +43 -0
  76. package/framework-mcp/dist/tools/file_system/write_file.js +38 -0
  77. package/framework-mcp/dist/tools/framework/audit_deps.js +41 -0
  78. package/framework-mcp/dist/tools/framework/get_status.js +5 -0
  79. package/framework-mcp/dist/tools/framework/orchestrate.js +5 -0
  80. package/framework-mcp/dist/tools/framework/run_tests.js +25 -0
  81. package/framework-mcp/dist/tools/framework/update_contract_hash.js +5 -0
  82. package/framework-mcp/dist/tools/framework/update_memory.js +8 -0
  83. package/framework-mcp/dist/tools/index.js +62 -0
  84. package/framework-mcp/dist/tools/memory/get_insights.js +34 -0
  85. package/framework-mcp/dist/tools/memory/read_memory.js +28 -0
  86. package/framework-mcp/dist/tools/messaging/log_action.js +22 -0
  87. package/framework-mcp/dist/tools/messaging/send_message.js +87 -0
  88. package/framework-mcp/dist/tools/observability/check_ports.js +26 -0
  89. package/framework-mcp/dist/tools/observability/get_health.js +19 -0
  90. package/framework-mcp/dist/tools/quality/check_lint.js +28 -0
  91. package/framework-mcp/dist/tools/search/get_gaps.js +48 -0
  92. package/framework-mcp/dist/tools/search/get_map.js +43 -0
  93. package/framework-mcp/dist/tools/search/grep_search.js +76 -0
  94. package/framework-mcp/dist/tools/search/list_dir.js +28 -0
  95. package/framework-mcp/dist/tools/shell/run_command.js +46 -0
  96. package/framework-mcp/dist/tools/types.js +1 -0
  97. package/framework-mcp/dist/utils/cli.js +20 -0
  98. package/framework-mcp/dist/utils/compliance.js +29 -0
  99. package/framework-mcp/dist/utils/fs.js +44 -0
  100. package/framework-mcp/dist/utils/metrics.js +56 -0
  101. package/framework-mcp/dist/utils/security.js +60 -0
  102. package/framework-mcp/package.json +19 -0
  103. package/framework-mcp/src/constants.ts +78 -0
  104. package/framework-mcp/src/declarations.d.ts +17 -0
  105. package/framework-mcp/src/index.ts +132 -0
  106. package/framework-mcp/src/tools/control_plane/locking.ts +71 -0
  107. package/framework-mcp/src/tools/control_plane/registry.ts +38 -0
  108. package/framework-mcp/src/tools/dashboard/start_dashboard.ts +33 -0
  109. package/framework-mcp/src/tools/definitions.ts +302 -0
  110. package/framework-mcp/src/tools/file_system/batch_surgical_edit.ts +79 -0
  111. package/framework-mcp/src/tools/file_system/patch_file.ts +33 -0
  112. package/framework-mcp/src/tools/file_system/read_file.ts +58 -0
  113. package/framework-mcp/src/tools/file_system/replace_text.ts +52 -0
  114. package/framework-mcp/src/tools/file_system/write_file.ts +45 -0
  115. package/framework-mcp/src/tools/framework/audit_deps.ts +49 -0
  116. package/framework-mcp/src/tools/framework/get_status.ts +7 -0
  117. package/framework-mcp/src/tools/framework/orchestrate.ts +7 -0
  118. package/framework-mcp/src/tools/framework/run_tests.ts +28 -0
  119. package/framework-mcp/src/tools/framework/update_contract_hash.ts +7 -0
  120. package/framework-mcp/src/tools/framework/update_memory.ts +10 -0
  121. package/framework-mcp/src/tools/index.ts +66 -0
  122. package/framework-mcp/src/tools/memory/get_insights.ts +41 -0
  123. package/framework-mcp/src/tools/memory/read_memory.ts +31 -0
  124. package/framework-mcp/src/tools/messaging/log_action.ts +28 -0
  125. package/framework-mcp/src/tools/messaging/send_message.ts +89 -0
  126. package/framework-mcp/src/tools/observability/check_ports.ts +30 -0
  127. package/framework-mcp/src/tools/observability/get_health.ts +24 -0
  128. package/framework-mcp/src/tools/quality/check_lint.ts +33 -0
  129. package/framework-mcp/src/tools/search/get_gaps.ts +54 -0
  130. package/framework-mcp/src/tools/search/get_map.ts +48 -0
  131. package/framework-mcp/src/tools/search/grep_search.ts +76 -0
  132. package/framework-mcp/src/tools/search/list_dir.ts +34 -0
  133. package/framework-mcp/src/tools/shell/run_command.ts +56 -0
  134. package/framework-mcp/src/tools/types.ts +89 -0
  135. package/framework-mcp/src/utils/cli.ts +20 -0
  136. package/framework-mcp/src/utils/compliance.ts +37 -0
  137. package/framework-mcp/src/utils/fs.ts +45 -0
  138. package/framework-mcp/src/utils/metrics.ts +73 -0
  139. package/framework-mcp/src/utils/security.ts +66 -0
  140. package/framework-mcp/tests/tools/file_system/file_system_tools.test.ts +212 -0
  141. package/framework-mcp/tests/tools/messaging/send_message.test.ts +136 -0
  142. package/framework-mcp/tests/tools/quality/check_lint.test.ts +46 -0
  143. package/framework-mcp/tests/tools/shell/run_command.test.ts +55 -0
  144. package/framework-mcp/tsconfig.json +14 -0
  145. package/package.json +5 -3
  146. package/src/cli/adapters/core.ts +2 -3
  147. package/src/cli/adapters/index.ts +1 -0
  148. package/src/cli/adapters/scaffold.ts +20 -7
  149. package/src/cli/commands/init/scaffold-core.ts +45 -6
  150. package/src/cli/commands/init.ts +31 -2
  151. package/src/cli/commands/orchestrate.ts +41 -4
  152. package/src/cli/commands/plan.ts +89 -23
  153. package/src/cli/index.ts +14 -19
  154. package/src/cli/utils/compliance.ts +8 -9
  155. package/src/cli/utils/pkg.ts +42 -13
  156. package/src/modules/adapters/definitions.ts +1 -1
  157. package/src/modules/adapters/shared.ts +7 -4
  158. package/src/modules/agents/definitions.ts +140 -73
  159. package/src/modules/agents/registry/analyst.ts +5 -1
  160. package/src/modules/agents/registry/backend.ts +5 -4
  161. package/src/modules/agents/registry/database.ts +2 -1
  162. package/src/modules/agents/registry/devops.ts +2 -0
  163. package/src/modules/agents/registry/explorer.ts +1 -0
  164. package/src/modules/agents/registry/git.ts +3 -1
  165. package/src/modules/agents/registry/manager.ts +8 -2
  166. package/src/modules/agents/registry/native.ts +5 -1
  167. package/src/modules/agents/registry/security.ts +1 -0
  168. package/src/shared/constants.ts +14 -13
  169. package/templates/prompts/bug-fix-recipe.md +20 -0
  170. package/templates/prompts/contract-design-recipe.md +21 -0
  171. package/templates/prompts/db-management-recipe.md +25 -0
  172. package/templates/prompts/deployment-recipe.md +23 -0
  173. package/templates/prompts/new-feature-recipe.md +19 -0
  174. package/templates/prompts/performance-optimization-recipe.md +23 -0
  175. package/templates/prompts/pull-request-template.md +21 -0
  176. package/templates/prompts/refactoring-recipe.md +21 -0
  177. package/templates/prompts/security-audit-recipe.md +20 -0
  178. package/templates/standards/architecture-standards.md +23 -0
  179. package/templates/standards/auth-standards.md +125 -0
  180. package/templates/standards/crud-governance.md +21 -0
  181. package/templates/standards/deployment-standards.md +21 -0
  182. package/templates/standards/frontend-standards.md +37 -0
  183. package/templates/standards/github-actions-standards.md +43 -0
  184. package/templates/standards/i18n-standards.md +17 -0
  185. package/templates/standards/kysely-standards.md +47 -0
  186. package/templates/standards/llm-governance.md +15 -0
  187. package/templates/standards/logging-and-secrets.md +34 -0
  188. package/templates/standards/mobile-standards.md +23 -0
  189. package/templates/standards/observability-standards.md +15 -0
  190. package/templates/standards/performance-standards.md +15 -0
  191. package/templates/standards/pino-standards.md +46 -0
  192. package/templates/standards/playwright-standards.md +54 -0
  193. package/templates/standards/quality-standards.md +31 -0
  194. package/templates/standards/react-query-standards.md +72 -0
  195. package/templates/standards/react-router-standards.md +62 -0
  196. package/templates/standards/security-audit-standards.md +16 -0
  197. package/templates/standards/security-standards.md +21 -0
  198. package/templates/standards/swagger-standards.md +50 -0
  199. package/templates/standards/tailwind-standards.md +20 -0
  200. package/templates/standards/testing-standards.md +31 -0
  201. package/templates/standards/typeorm-standards.md +49 -0
  202. package/templates/standards/vitest-standards.md +110 -0
  203. package/src/cli/commands/app.ts +0 -56
  204. package/src/cli/utils/app-backend.ts +0 -257
  205. package/src/cli/utils/app-docs.ts +0 -83
  206. package/src/cli/utils/app-frontend.ts +0 -263
  207. package/src/cli/utils/app-inferrer.ts +0 -63
  208. package/src/cli/utils/app-mobile.ts +0 -113
  209. package/src/cli/utils/app-types.ts +0 -248
  210. package/src/cli/utils/app.ts +0 -6
@@ -1,113 +0,0 @@
1
- import path from "path";
2
- import type { AppSpec } from "./app-inferrer.js";
3
- import { createBaseTypeFiles } from "./app-types.js";
4
- import { writeJsonFile, writeTextFile } from "./fs.js";
5
- import { getConfiguredPaths } from "./memory.js";
6
-
7
- const targetDir = process.cwd();
8
-
9
- export function createMobileFiles(spec: AppSpec): void {
10
- const pathsMap = getConfiguredPaths();
11
- // Defaulting mobile to apps/mobile if not configured
12
- const mobileDir = pathsMap.mobile || "apps/mobile";
13
-
14
- createBaseTypeFiles(path.join(targetDir, mobileDir, "src"));
15
-
16
- writeJsonFile(path.join(targetDir, mobileDir, "package.json"), {
17
- name: "@agent-enderun/mobile",
18
- version: "0.1.0",
19
- private: true,
20
- scripts: {
21
- "start": "expo start",
22
- "android": "expo start --android",
23
- "ios": "expo start --ios",
24
- "web": "expo start --web"
25
- },
26
- dependencies: {
27
- "expo": "~52.0.0",
28
- "expo-status-bar": "~2.0.0",
29
- "react": "18.3.1",
30
- "react-native": "0.76.0",
31
- "lucide-react-native": "^0.468.0"
32
- },
33
- devDependencies: {
34
- "@babel/core": "^7.25.2",
35
- "@types/react": "~18.3.12",
36
- "typescript": "^5.3.3"
37
- }
38
- });
39
-
40
- writeTextFile(path.join(targetDir, mobileDir, "App.tsx"), [
41
- "import React from 'react';",
42
- "import { StyleSheet, Text, View, SafeAreaView, ScrollView } from 'react-native';",
43
- "import { StatusBar } from 'expo-status-bar';",
44
- "import { BarChart3, Users, Shield } from 'lucide-react-native';",
45
- "",
46
- "export default function App() {",
47
- " return (",
48
- " <SafeAreaView style={styles.container}>",
49
- " <StatusBar style=\"auto\" />",
50
- " <View style={styles.header}>",
51
- " <Text style={styles.subtitle}>{'" + spec.domain + "'}</Text>",
52
- " <Text style={styles.title}>{'" + spec.title + "'}</Text>",
53
- " </View>",
54
- " <ScrollView style={styles.content}>",
55
- " <View style={styles.metricRow}>",
56
- " <View style={[styles.card, { borderLeftColor: '#49a078' }]}>",
57
- " <BarChart3 color=\"#49a078\" size={20} />",
58
- " <Text style={styles.cardLabel}>Pipeline</Text>",
59
- " <Text style={styles.cardValue}>$261K</Text>",
60
- " </View>",
61
- " <View style={[styles.card, { borderLeftColor: '#3f7cac' }]}>",
62
- " <Users color=\"#3f7cac\" size={20} />",
63
- " <Text style={styles.cardLabel}>Customers</Text>",
64
- " <Text style={styles.cardValue}>18</Text>",
65
- " </View>",
66
- " </View>",
67
- " <View style={styles.panel}>",
68
- " <Text style={styles.panelTitle}>Recent Activity</Text>",
69
- " <View style={styles.row}>",
70
- " <Text style={styles.rowText}>Northwind updated by Manager</Text>",
71
- " </View>",
72
- " <View style={styles.row}>",
73
- " <Text style={styles.rowText}>Acme Corp status changed to Lead</Text>",
74
- " </View>",
75
- " </View>",
76
- " </ScrollView>",
77
- " </SafeAreaView>",
78
- " );",
79
- "}",
80
- "",
81
- "const styles = StyleSheet.create({",
82
- " container: { flex: 1, backgroundColor: '#f4f7f6' },",
83
- " header: { padding: 24, backgroundColor: '#fff', borderBottomWidth: 1, borderBottomColor: '#d9e3e0' },",
84
- " subtitle: { fontSize: 14, color: '#58666a', marginBottom: 4 },",
85
- " title: { fontSize: 28, fontWeight: '800', color: '#172026' },",
86
- " content: { flex: 1, padding: 16 },",
87
- " metricRow: { flexDirection: 'row', gap: 12, marginBottom: 16 },",
88
- " card: { flex: 1, backgroundColor: '#fff', padding: 16, borderRadius: 12, borderLeftWidth: 4, elevation: 2, shadowColor: '#000', shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.1, shadowRadius: 2 },",
89
- " cardLabel: { fontSize: 12, color: '#58666a', marginVertical: 4 },",
90
- " cardValue: { fontSize: 20, fontWeight: '700', color: '#172026' },",
91
- " panel: { backgroundColor: '#fff', padding: 16, borderRadius: 12, borderWidth: 1, borderColor: '#d9e3e0' },",
92
- " panelTitle: { fontSize: 18, fontWeight: '700', color: '#172026', marginBottom: 12 },",
93
- " row: { paddingVertical: 12, borderBottomWidth: 1, borderBottomColor: '#f0f4f3' },",
94
- " rowText: { color: '#58666a' }",
95
- "});"
96
- ].join("\n"));
97
-
98
- writeTextFile(path.join(targetDir, mobileDir, ".env.example"), [
99
- "# Agent Enderun - Mobile Environment Variables",
100
- "EXPO_PUBLIC_API_URL=http://localhost:4000/api/v1",
101
- "EXPO_PUBLIC_APP_VARIANT=development",
102
- ].join("\n"));
103
-
104
- writeTextFile(path.join(targetDir, mobileDir, "README.md"), [
105
- `# ${spec.title} Mobile`,
106
- "",
107
- "Expo / React Native app generated by Agent Enderun.",
108
- "",
109
- "## Commands",
110
- "",
111
- "- `npx expo start`",
112
- ].join("\n"));
113
- }
@@ -1,248 +0,0 @@
1
- import fs from "fs";
2
- import path from "path";
3
- import { computeTypesHash, ensureDir, writeTextFile, writeJsonFile } from "./fs.js";
4
- import { getConfiguredPaths } from "./memory.js";
5
- import { UI } from "./ui.js";
6
-
7
- const targetDir = process.cwd();
8
-
9
- export function buildSharedTypesContent(existingContent: string): string {
10
- const marker = "// --- Generated Application Contract ---";
11
- const generated = [
12
- marker,
13
- "export type RoleID = Brand<string, \"RoleID\">;",
14
- "export type ReportID = Brand<string, \"ReportID\">;",
15
- "export type CustomerID = Brand<string, \"CustomerID\">;",
16
- "",
17
- "export interface AuthSession {",
18
- " user: User;",
19
- " token: string;",
20
- " expiresAt: string;",
21
- "}",
22
- "",
23
- "export interface Role {",
24
- " id: RoleID;",
25
- " name: string;",
26
- " permissions: string[];",
27
- "}",
28
- "",
29
- "export interface Customer {",
30
- " id: CustomerID;",
31
- " name: string;",
32
- " ownerId: UserID;",
33
- " status: \"LEAD\" | \"ACTIVE\" | \"AT_RISK\";",
34
- " annualValue: number;",
35
- " createdAt: string;",
36
- "}",
37
- "",
38
- "export interface ReportMetric {",
39
- " id: ReportID;",
40
- " label: string;",
41
- " value: number;",
42
- " trend: \"UP\" | \"DOWN\" | \"FLAT\";",
43
- "}",
44
- "",
45
- "export interface DashboardSummary {",
46
- " customers: Customer[];",
47
- " users: User[];",
48
- " roles: Role[];",
49
- " reports: ReportMetric[];",
50
- "}",
51
- ].join("\n");
52
-
53
- if (existingContent.includes(marker)) return existingContent;
54
- return `${existingContent.trim()}\n\n${generated}\n`;
55
- }
56
-
57
- export function updateContractHashFile(): void {
58
- const pathsMap = getConfiguredPaths();
59
- const sharedDir = path.join(targetDir, pathsMap.backend, "src/types");
60
- const contractPath = path.join(targetDir, pathsMap.backend, "contract.version.json");
61
- if (!fs.existsSync(sharedDir) || !fs.existsSync(contractPath)) return;
62
-
63
- const currentHash = computeTypesHash(targetDir, sharedDir);
64
-
65
- const contract = JSON.parse(fs.readFileSync(contractPath, "utf8"));
66
- contract.contract_hash = currentHash;
67
- contract.last_updated = new Date().toISOString();
68
- writeJsonFile(contractPath, contract);
69
- }
70
-
71
- export function createBaseTypeFiles(baseDir: string): void {
72
- const typesDir = path.join(baseDir, "types");
73
- ensureDir(typesDir);
74
-
75
- writeTextFile(path.join(typesDir, "api.ts"), `import { TraceID } from "./brands.js";
76
-
77
- /**
78
- * API Response Wrappers
79
- */
80
- export interface ApiResponse<T> {
81
- data: T;
82
- meta?: {
83
- requestId: TraceID;
84
- timestamp: string;
85
- };
86
- }
87
-
88
- export interface ApiError {
89
- error: {
90
- code: string;
91
- message: string;
92
- details?: unknown;
93
- };
94
- }
95
- `);
96
-
97
- writeTextFile(path.join(typesDir, "brands.ts"), `/**
98
- * Branded Type Utility
99
- */
100
- export type Brand<K, T> = K & { __brand: T };
101
-
102
- /**
103
- * Entity IDs (Branded)
104
- */
105
- export type TraceID = Brand<string, "TraceID">;
106
- export type AgentID = Brand<string, "AgentID">;
107
- export type ProjectID = Brand<string, "ProjectID">;
108
- export type UserID = Brand<string, "UserID">;
109
- `);
110
-
111
- writeTextFile(path.join(typesDir, "constants.ts"), `import { TraceID } from "./brands.js";
112
-
113
- /**
114
- * Project Phases
115
- */
116
- export const PROJECT_PHASES = ["PHASE_0", "PHASE_1", "PHASE_2", "PHASE_3", "PHASE_4"] as const;
117
- export type ProjectPhase = (typeof PROJECT_PHASES)[number];
118
-
119
- /**
120
- * Execution Profiles
121
- */
122
- export const EXECUTION_PROFILES = ["Lightweight", "Full"] as const;
123
- export type ExecutionProfile = (typeof EXECUTION_PROFILES)[number];
124
-
125
- /**
126
- * Task Priorities
127
- */
128
- export const TASK_PRIORITIES = ["P0", "P1", "P2", "P3"] as const;
129
- export type TaskPriority = (typeof TASK_PRIORITIES)[number];
130
-
131
- /**
132
- * Task Statuses
133
- */
134
- export const TASK_STATUSES = ["PENDING", "IN_PROGRESS", "BLOCKED", "COMPLETED", "FAILED"] as const;
135
- export type TaskStatus = (typeof TASK_STATUSES)[number];
136
-
137
- /**
138
- * Action Types & Status
139
- */
140
- export const ACTION_TYPES = ["CREATE", "MODIFY", "DELETE", "RESEARCH", "ORCHESTRATE"] as const;
141
- export type ActionType = (typeof ACTION_TYPES)[number];
142
-
143
- export const ACTION_STATUSES = ["SUCCESS", "FAILURE", "WAITING"] as const;
144
- export type ActionStatus = (typeof ACTION_STATUSES)[number];
145
- `);
146
-
147
- writeTextFile(path.join(typesDir, "index.ts"), `/**
148
- * Agent Enderun — App-Local Types (Modular)
149
- */
150
-
151
- export * from "./brands.js";
152
- export * from "./constants.js";
153
- export * from "./models.js";
154
- export * from "./api.js";
155
- export * from "./logs.js";
156
- `);
157
-
158
- writeTextFile(path.join(typesDir, "logs.ts"), `import { TraceID, AgentID } from "./brands.js";
159
- import { ActionType, ActionStatus } from "./constants.js";
160
-
161
- /**
162
- * Audit & Agent Logging Types
163
- */
164
- export interface AgentActionLog {
165
- timestamp: string;
166
- agent: AgentID;
167
- action: ActionType;
168
- requestId: TraceID | "—";
169
- status: ActionStatus;
170
- summary: string;
171
- files?: string[];
172
- details?: Record<string, unknown>;
173
- }
174
- `);
175
-
176
- const modelsPath = path.join(typesDir, "models.ts");
177
- const baseModelsContent = `import { UserID, TraceID, AgentID } from "./brands.js";
178
- import { ProjectPhase, ExecutionProfile, TaskPriority, TaskStatus } from "./constants.js";
179
-
180
- /**
181
- * Base Entity Fields
182
- */
183
- export interface BaseEntity {
184
- id: string; // Usually ULID
185
- createdAt: string;
186
- updatedAt: string;
187
- deletedAt?: string | null;
188
- }
189
-
190
- /**
191
- * Audit Log Model
192
- */
193
- export interface AuditLog extends BaseEntity {
194
- entityName: string;
195
- entityId: string;
196
- action: "CREATE" | "UPDATE" | "DELETE" | "RESTORE";
197
- userId: UserID;
198
- previousState?: Record<string, unknown> | null;
199
- newState?: Record<string, unknown> | null;
200
- traceId: TraceID;
201
- }
202
-
203
- /**
204
- * User Model
205
- */
206
- export interface User extends BaseEntity {
207
- id: UserID;
208
- email: string;
209
- fullName: string;
210
- role: "ADMIN" | "DEVELOPER" | "VIEWER";
211
- }
212
-
213
- export interface UserProfile extends User {
214
- avatarUrl?: string;
215
- bio?: string;
216
- preferences: Record<string, unknown>;
217
- }
218
-
219
- /**
220
- * Project Status
221
- */
222
- export interface ProjectStatus {
223
- phase: ProjectPhase;
224
- profile: ExecutionProfile;
225
- lastUpdate: string;
226
- activeTraceId: TraceID | null;
227
- blockers: string[];
228
- }
229
-
230
- /**
231
- * Task Model
232
- */
233
- export interface Task {
234
- id: TraceID;
235
- description: string;
236
- agent: AgentID;
237
- priority: TaskPriority;
238
- status: TaskStatus;
239
- createdAt: string;
240
- updatedAt: string;
241
- }
242
- `;
243
- // Append generated application contract types
244
- const finalModelsContent = buildSharedTypesContent(baseModelsContent);
245
- writeTextFile(modelsPath, finalModelsContent);
246
-
247
- UI.success(`Base types created in ${path.relative(targetDir, typesDir)}`);
248
- }
@@ -1,6 +0,0 @@
1
- export * from "./app-inferrer.js";
2
- export * from "./app-types.js";
3
- export * from "./app-backend.js";
4
- export * from "./app-frontend.js";
5
- export * from "./app-mobile.js";
6
- export * from "./app-docs.js";