@ai-coders/context 0.3.0 → 0.4.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/README.md +32 -25
- package/dist/commands/shared/agents.d.ts +2 -0
- package/dist/commands/shared/agents.d.ts.map +1 -0
- package/dist/commands/shared/agents.js +15 -0
- package/dist/commands/shared/agents.js.map +1 -0
- package/dist/commands/shared/selection.d.ts +12 -0
- package/dist/commands/shared/selection.d.ts.map +1 -0
- package/dist/commands/shared/selection.js +95 -0
- package/dist/commands/shared/selection.js.map +1 -0
- package/dist/generators/agents/agentConfig.d.ts.map +1 -1
- package/dist/generators/agents/agentConfig.js +42 -0
- package/dist/generators/agents/agentConfig.js.map +1 -1
- package/dist/generators/agents/agentGenerator.d.ts +0 -1
- package/dist/generators/agents/agentGenerator.d.ts.map +1 -1
- package/dist/generators/agents/agentGenerator.js +7 -47
- package/dist/generators/agents/agentGenerator.js.map +1 -1
- package/dist/generators/agents/agentTypes.d.ts +1 -1
- package/dist/generators/agents/agentTypes.d.ts.map +1 -1
- package/dist/generators/agents/agentTypes.js +4 -1
- package/dist/generators/agents/agentTypes.js.map +1 -1
- package/dist/generators/agents/templates/indexTemplate.d.ts.map +1 -1
- package/dist/generators/agents/templates/indexTemplate.js +2 -1
- package/dist/generators/agents/templates/indexTemplate.js.map +1 -1
- package/dist/generators/agents/templates/playbookTemplate.d.ts.map +1 -1
- package/dist/generators/agents/templates/playbookTemplate.js +39 -3
- package/dist/generators/agents/templates/playbookTemplate.js.map +1 -1
- package/dist/generators/documentation/documentationGenerator.d.ts +3 -1
- package/dist/generators/documentation/documentationGenerator.d.ts.map +1 -1
- package/dist/generators/documentation/documentationGenerator.js +88 -15
- package/dist/generators/documentation/documentationGenerator.js.map +1 -1
- package/dist/generators/documentation/guideRegistry.js +8 -8
- package/dist/generators/documentation/guideRegistry.js.map +1 -1
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.js +490 -0
- package/dist/generators/documentation/templates/apiReferenceTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/architectureTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/architectureTemplate.js +27 -27
- package/dist/generators/documentation/templates/architectureTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/common.js +2 -2
- package/dist/generators/documentation/templates/common.js.map +1 -1
- package/dist/generators/documentation/templates/dataFlowTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/dataFlowTemplate.js +5 -20
- package/dist/generators/documentation/templates/dataFlowTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js +5 -20
- package/dist/generators/documentation/templates/developmentWorkflowTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/glossaryTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/glossaryTemplate.js +9 -23
- package/dist/generators/documentation/templates/glossaryTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/index.d.ts +4 -0
- package/dist/generators/documentation/templates/index.d.ts.map +1 -1
- package/dist/generators/documentation/templates/index.js +9 -1
- package/dist/generators/documentation/templates/index.js.map +1 -1
- package/dist/generators/documentation/templates/indexTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/indexTemplate.js +5 -19
- package/dist/generators/documentation/templates/indexTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/migrationTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/migrationTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/migrationTemplate.js +422 -0
- package/dist/generators/documentation/templates/migrationTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/onboardingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/onboardingTemplate.js +431 -0
- package/dist/generators/documentation/templates/onboardingTemplate.js.map +1 -0
- package/dist/generators/documentation/templates/projectOverviewTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/projectOverviewTemplate.js +22 -25
- package/dist/generators/documentation/templates/projectOverviewTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/securityTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/securityTemplate.js +5 -19
- package/dist/generators/documentation/templates/securityTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/testingTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/testingTemplate.js +5 -19
- package/dist/generators/documentation/templates/testingTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/toolingTemplate.d.ts.map +1 -1
- package/dist/generators/documentation/templates/toolingTemplate.js +6 -20
- package/dist/generators/documentation/templates/toolingTemplate.js.map +1 -1
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts +2 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.d.ts.map +1 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.js +292 -0
- package/dist/generators/documentation/templates/troubleshootingTemplate.js.map +1 -0
- package/dist/generators/plans/templates/indexTemplate.d.ts.map +1 -1
- package/dist/generators/plans/templates/indexTemplate.js +3 -2
- package/dist/generators/plans/templates/indexTemplate.js.map +1 -1
- package/dist/generators/plans/templates/planTemplate.d.ts.map +1 -1
- package/dist/generators/plans/templates/planTemplate.js +96 -13
- package/dist/generators/plans/templates/planTemplate.js.map +1 -1
- package/dist/generators/shared/generatorUtils.d.ts +1 -1
- package/dist/generators/shared/generatorUtils.d.ts.map +1 -1
- package/dist/generators/shared/generatorUtils.js +1 -1
- package/dist/generators/shared/generatorUtils.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +111 -1007
- package/dist/index.js.map +1 -1
- package/dist/prompts/defaults.d.ts +3 -0
- package/dist/prompts/defaults.d.ts.map +1 -0
- package/dist/prompts/defaults.js +95 -0
- package/dist/prompts/defaults.js.map +1 -0
- package/dist/services/baseLLMClient.d.ts +3 -3
- package/dist/services/baseLLMClient.d.ts.map +1 -1
- package/dist/services/baseLLMClient.js +44 -5
- package/dist/services/baseLLMClient.js.map +1 -1
- package/dist/services/fill/fillService.d.ts +46 -0
- package/dist/services/fill/fillService.d.ts.map +1 -0
- package/dist/services/fill/fillService.js +254 -0
- package/dist/services/fill/fillService.js.map +1 -0
- package/dist/services/init/initService.d.ts +37 -0
- package/dist/services/init/initService.d.ts.map +1 -0
- package/dist/services/init/initService.js +167 -0
- package/dist/services/init/initService.js.map +1 -0
- package/dist/services/llmClientFactory.d.ts +2 -8
- package/dist/services/llmClientFactory.d.ts.map +1 -1
- package/dist/services/llmClientFactory.js +10 -96
- package/dist/services/llmClientFactory.js.map +1 -1
- package/dist/services/openRouterClient.d.ts +0 -3
- package/dist/services/openRouterClient.d.ts.map +1 -1
- package/dist/services/openRouterClient.js +2 -49
- package/dist/services/openRouterClient.js.map +1 -1
- package/dist/services/plan/planService.d.ts +57 -0
- package/dist/services/plan/planService.d.ts.map +1 -0
- package/dist/services/plan/planService.js +334 -0
- package/dist/services/plan/planService.js.map +1 -0
- package/dist/services/shared/llmConfig.d.ts +22 -0
- package/dist/services/shared/llmConfig.d.ts.map +1 -0
- package/dist/services/shared/llmConfig.js +38 -0
- package/dist/services/shared/llmConfig.js.map +1 -0
- package/dist/types.d.ts +7 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/fileMapper.d.ts +1 -1
- package/dist/utils/fileMapper.d.ts.map +1 -1
- package/dist/utils/fileMapper.js +40 -19
- package/dist/utils/fileMapper.js.map +1 -1
- package/dist/utils/i18n.d.ts +23 -33
- package/dist/utils/i18n.d.ts.map +1 -1
- package/dist/utils/i18n.js +48 -68
- package/dist/utils/i18n.js.map +1 -1
- package/dist/utils/promptLoader.d.ts +12 -0
- package/dist/utils/promptLoader.d.ts.map +1 -0
- package/dist/utils/promptLoader.js +81 -0
- package/dist/utils/promptLoader.js.map +1 -0
- package/dist/utils/versionChecker.d.ts +15 -0
- package/dist/utils/versionChecker.d.ts.map +1 -0
- package/dist/utils/versionChecker.js +49 -0
- package/dist/utils/versionChecker.js.map +1 -0
- package/package.json +9 -10
- package/prompts/update_plan_prompt.md +4 -5
- package/prompts/update_scaffold_prompt.md +7 -8
- package/dist/generators/agents/contextUtils.d.ts +0 -8
- package/dist/generators/agents/contextUtils.d.ts.map +0 -1
- package/dist/generators/agents/contextUtils.js +0 -15
- package/dist/generators/agents/contextUtils.js.map +0 -1
- package/dist/generators/agents/promptFormatter.d.ts +0 -9
- package/dist/generators/agents/promptFormatter.d.ts.map +0 -1
- package/dist/generators/agents/promptFormatter.js +0 -84
- package/dist/generators/agents/promptFormatter.js.map +0 -1
- package/dist/generators/analyzers/codebaseAnalyzer.d.ts +0 -45
- package/dist/generators/analyzers/codebaseAnalyzer.d.ts.map +0 -1
- package/dist/generators/analyzers/codebaseAnalyzer.js +0 -293
- package/dist/generators/analyzers/codebaseAnalyzer.js.map +0 -1
- package/dist/generators/analyzers/index.d.ts +0 -3
- package/dist/generators/analyzers/index.d.ts.map +0 -1
- package/dist/generators/analyzers/index.js +0 -6
- package/dist/generators/analyzers/index.js.map +0 -1
- package/dist/generators/documentation/documentationTemplates.d.ts +0 -21
- package/dist/generators/documentation/documentationTemplates.d.ts.map +0 -1
- package/dist/generators/documentation/documentationTemplates.js +0 -359
- package/dist/generators/documentation/documentationTemplates.js.map +0 -1
- package/dist/generators/documentation/documentationTypes.d.ts +0 -11
- package/dist/generators/documentation/documentationTypes.d.ts.map +0 -1
- package/dist/generators/documentation/documentationTypes.js +0 -22
- package/dist/generators/documentation/documentationTypes.js.map +0 -1
- package/dist/generators/documentation/documentationUtils.d.ts +0 -7
- package/dist/generators/documentation/documentationUtils.d.ts.map +0 -1
- package/dist/generators/documentation/documentationUtils.js +0 -28
- package/dist/generators/documentation/documentationUtils.js.map +0 -1
- package/dist/generators/documentation/incrementalDocumentationGenerator.d.ts +0 -33
- package/dist/generators/documentation/incrementalDocumentationGenerator.d.ts.map +0 -1
- package/dist/generators/documentation/incrementalDocumentationGenerator.js +0 -400
- package/dist/generators/documentation/incrementalDocumentationGenerator.js.map +0 -1
- package/dist/generators/documentation/templates.d.ts +0 -31
- package/dist/generators/documentation/templates.d.ts.map +0 -1
- package/dist/generators/documentation/templates.js +0 -566
- package/dist/generators/documentation/templates.js.map +0 -1
- package/dist/generators/guidelines/agentIntegration.d.ts +0 -43
- package/dist/generators/guidelines/agentIntegration.d.ts.map +0 -1
- package/dist/generators/guidelines/agentIntegration.js +0 -157
- package/dist/generators/guidelines/agentIntegration.js.map +0 -1
- package/dist/generators/guidelines/guidelineTypes.d.ts +0 -40
- package/dist/generators/guidelines/guidelineTypes.d.ts.map +0 -1
- package/dist/generators/guidelines/guidelineTypes.js +0 -144
- package/dist/generators/guidelines/guidelineTypes.js.map +0 -1
- package/dist/generators/guidelines/guidelinesAnalyzer.d.ts +0 -30
- package/dist/generators/guidelines/guidelinesAnalyzer.d.ts.map +0 -1
- package/dist/generators/guidelines/guidelinesAnalyzer.js +0 -263
- package/dist/generators/guidelines/guidelinesAnalyzer.js.map +0 -1
- package/dist/generators/guidelines/guidelinesGenerator.d.ts +0 -30
- package/dist/generators/guidelines/guidelinesGenerator.d.ts.map +0 -1
- package/dist/generators/guidelines/guidelinesGenerator.js +0 -249
- package/dist/generators/guidelines/guidelinesGenerator.js.map +0 -1
- package/dist/generators/guidelines/guidelinesTemplates.d.ts +0 -23
- package/dist/generators/guidelines/guidelinesTemplates.d.ts.map +0 -1
- package/dist/generators/guidelines/guidelinesTemplates.js +0 -304
- package/dist/generators/guidelines/guidelinesTemplates.js.map +0 -1
- package/dist/generators/guidelines/index.d.ts +0 -6
- package/dist/generators/guidelines/index.d.ts.map +0 -1
- package/dist/generators/guidelines/index.js +0 -16
- package/dist/generators/guidelines/index.js.map +0 -1
- package/dist/generators/moduleGrouper.d.ts +0 -14
- package/dist/generators/moduleGrouper.d.ts.map +0 -1
- package/dist/generators/moduleGrouper.js +0 -82
- package/dist/generators/moduleGrouper.js.map +0 -1
- package/dist/generators/projectAnalyzer.d.ts +0 -14
- package/dist/generators/projectAnalyzer.d.ts.map +0 -1
- package/dist/generators/projectAnalyzer.js +0 -217
- package/dist/generators/projectAnalyzer.js.map +0 -1
- package/dist/services/changeAnalyzer.d.ts +0 -44
- package/dist/services/changeAnalyzer.d.ts.map +0 -1
- package/dist/services/changeAnalyzer.js +0 -344
- package/dist/services/changeAnalyzer.js.map +0 -1
- package/dist/utils/interactiveMode.d.ts +0 -21
- package/dist/utils/interactiveMode.d.ts.map +0 -1
- package/dist/utils/interactiveMode.js +0 -737
- package/dist/utils/interactiveMode.js.map +0 -1
- package/dist/utils/tokenEstimator.d.ts +0 -28
- package/dist/utils/tokenEstimator.d.ts.map +0 -1
- package/dist/utils/tokenEstimator.js +0 -134
- package/dist/utils/tokenEstimator.js.map +0 -1
|
@@ -0,0 +1,490 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.renderApiReference = renderApiReference;
|
|
4
|
+
function renderApiReference() {
|
|
5
|
+
return `<!-- agent-update:start:api-reference -->
|
|
6
|
+
# API Reference
|
|
7
|
+
|
|
8
|
+
**Purpose:** Enable AI agents to programmatically interact with all API endpoints.
|
|
9
|
+
|
|
10
|
+
**Agent Usage Instructions:**
|
|
11
|
+
- Use documented curl commands as templates for requests
|
|
12
|
+
- Verify expected response codes match actual responses
|
|
13
|
+
- Handle authentication token expiration automatically
|
|
14
|
+
- Parse error responses to determine retry strategy
|
|
15
|
+
- Log all API interactions for debugging
|
|
16
|
+
|
|
17
|
+
## Base URLs
|
|
18
|
+
|
|
19
|
+
**Agent Configuration:**
|
|
20
|
+
\`\`\`bash
|
|
21
|
+
# Set as environment variables for easier switching
|
|
22
|
+
export API_BASE_DEV="http://localhost:3000/api"
|
|
23
|
+
export API_BASE_STAGING="https://staging-api.example.com" # TODO: Update
|
|
24
|
+
export API_BASE_PROD="https://api.example.com" # TODO: Update
|
|
25
|
+
|
|
26
|
+
# Agent uses based on context
|
|
27
|
+
API_BASE=$API_BASE_STAGING # Change as needed
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
## Authentication
|
|
31
|
+
|
|
32
|
+
**Agent Authentication Flow:**
|
|
33
|
+
|
|
34
|
+
### Step 1: Obtain Token
|
|
35
|
+
\`\`\`bash
|
|
36
|
+
# Agent executes login
|
|
37
|
+
TOKEN_RESPONSE=$(curl -s -X POST "\${API_BASE}/auth/login" \\
|
|
38
|
+
-H "Content-Type: application/json" \\
|
|
39
|
+
-d '{
|
|
40
|
+
"email": "agent@example.com",
|
|
41
|
+
"password": "'\${AGENT_PASSWORD}'"
|
|
42
|
+
}')
|
|
43
|
+
|
|
44
|
+
# Agent extracts token
|
|
45
|
+
TOKEN=$(echo \$TOKEN_RESPONSE | jq -r '.token')
|
|
46
|
+
EXPIRES_IN=$(echo \$TOKEN_RESPONSE | jq -r '.expiresIn')
|
|
47
|
+
|
|
48
|
+
# Agent stores token with expiration
|
|
49
|
+
echo "\$TOKEN" > .api-token
|
|
50
|
+
echo \$((\$(date +%s) + \$EXPIRES_IN)) > .api-token-expires
|
|
51
|
+
|
|
52
|
+
# Expected response structure
|
|
53
|
+
# {
|
|
54
|
+
# "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
55
|
+
# "expiresIn": 3600,
|
|
56
|
+
# "refreshToken": "refresh_token_here",
|
|
57
|
+
# "user": {"id": "123", "email": "agent@example.com"}
|
|
58
|
+
# }
|
|
59
|
+
\`\`\`
|
|
60
|
+
|
|
61
|
+
### Step 2: Use Token in Requests
|
|
62
|
+
\`\`\`bash
|
|
63
|
+
# Agent includes token in all authenticated requests
|
|
64
|
+
curl -X GET "\${API_BASE}/resources" \\
|
|
65
|
+
-H "Authorization: Bearer \$TOKEN" \\
|
|
66
|
+
-H "Content-Type: application/json"
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
### Step 3: Handle Token Expiration
|
|
70
|
+
\`\`\`bash
|
|
71
|
+
# Agent checks token expiration before each request
|
|
72
|
+
function check_token() {
|
|
73
|
+
if [ ! -f .api-token ] || [ ! -f .api-token-expires ]; then
|
|
74
|
+
return 1 # Token missing, need to authenticate
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
EXPIRES=$(cat .api-token-expires)
|
|
78
|
+
NOW=$(date +%s)
|
|
79
|
+
|
|
80
|
+
if [ $NOW -ge $EXPIRES ]; then
|
|
81
|
+
return 1 # Token expired
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
return 0 # Token valid
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
# Agent refresh flow (if 401 received)
|
|
88
|
+
if ! check_token; then
|
|
89
|
+
echo "Token expired or missing, re-authenticating..."
|
|
90
|
+
# Re-run Step 1
|
|
91
|
+
fi
|
|
92
|
+
\`\`\`
|
|
93
|
+
|
|
94
|
+
**Agent Error Handling:**
|
|
95
|
+
- 401 response → Token invalid/expired, re-authenticate
|
|
96
|
+
- 403 response → Permission denied, check agent has required role
|
|
97
|
+
- 429 response → Rate limited, wait and retry (see Rate Limiting section)
|
|
98
|
+
|
|
99
|
+
### Authorization & Permissions
|
|
100
|
+
- Document role-based access control (RBAC) if applicable
|
|
101
|
+
- List permission levels and their capabilities
|
|
102
|
+
- Explain scope-based authorization for OAuth
|
|
103
|
+
|
|
104
|
+
## API Versioning
|
|
105
|
+
- **Current Version:** v1
|
|
106
|
+
- **Versioning Strategy:** TODO: URL path (/v1/), header, or query parameter
|
|
107
|
+
- **Deprecation Policy:** TODO: Document how versions are deprecated
|
|
108
|
+
|
|
109
|
+
## Rate Limiting
|
|
110
|
+
|
|
111
|
+
**Agent Must Implement:** Check rate limit headers and back off when necessary.
|
|
112
|
+
|
|
113
|
+
\`\`\`bash
|
|
114
|
+
# Agent rate limit handler
|
|
115
|
+
function make_api_request() {
|
|
116
|
+
local url=$1
|
|
117
|
+
local method=$2
|
|
118
|
+
local data=$3
|
|
119
|
+
|
|
120
|
+
RESPONSE=$(curl -i -X "$method" "$url" \\
|
|
121
|
+
-H "Authorization: Bearer $TOKEN" \\
|
|
122
|
+
-H "Content-Type: application/json" \\
|
|
123
|
+
-d "$data" 2>&1)
|
|
124
|
+
|
|
125
|
+
# Agent extracts rate limit headers
|
|
126
|
+
LIMIT=$(echo "$RESPONSE" | grep -i "x-ratelimit-limit" | cut -d: -f2 | tr -d ' \\r')
|
|
127
|
+
REMAINING=$(echo "$RESPONSE" | grep -i "x-ratelimit-remaining" | cut -d: -f2 | tr -d ' \\r')
|
|
128
|
+
RESET=$(echo "$RESPONSE" | grep -i "x-ratelimit-reset" | cut -d: -f2 | tr -d ' \\r')
|
|
129
|
+
|
|
130
|
+
# Agent checks if approaching limit
|
|
131
|
+
if [ "\$REMAINING" -lt "10" ]; then
|
|
132
|
+
NOW=$(date +%s)
|
|
133
|
+
WAIT=\$((RESET - NOW))
|
|
134
|
+
echo "Rate limit low (\$REMAINING remaining), waiting \${WAIT}s until reset..."
|
|
135
|
+
sleep \$WAIT
|
|
136
|
+
fi
|
|
137
|
+
|
|
138
|
+
# Agent handles 429 (rate limited)
|
|
139
|
+
HTTP_CODE=$(echo "\$RESPONSE" | grep "HTTP/" | awk '{print \$2}')
|
|
140
|
+
if [ "\$HTTP_CODE" == "429" ]; then
|
|
141
|
+
RETRY_AFTER=$(echo "\$RESPONSE" | grep -i "retry-after" | cut -d: -f2 | tr -d ' \\r')
|
|
142
|
+
echo "Rate limited, retrying after \${RETRY_AFTER}s..."
|
|
143
|
+
sleep "\$RETRY_AFTER"
|
|
144
|
+
make_api_request "\$url" "\$method" "\$data" # Retry
|
|
145
|
+
fi
|
|
146
|
+
|
|
147
|
+
echo "$RESPONSE"
|
|
148
|
+
}
|
|
149
|
+
\`\`\`
|
|
150
|
+
|
|
151
|
+
**Rate Limit:** TODO: e.g., 1000 requests per hour
|
|
152
|
+
**Headers Agent Should Monitor:**
|
|
153
|
+
- \`X-RateLimit-Limit\`: Maximum allowed
|
|
154
|
+
- \`X-RateLimit-Remaining\`: Remaining in window
|
|
155
|
+
- \`X-RateLimit-Reset\`: Reset time (Unix timestamp)
|
|
156
|
+
- \`Retry-After\`: Seconds to wait (when 429 received)
|
|
157
|
+
|
|
158
|
+
## Common Headers
|
|
159
|
+
### Request Headers
|
|
160
|
+
- \`Content-Type: application/json\` - Required for POST/PUT/PATCH
|
|
161
|
+
- \`Authorization: Bearer <token>\` - Authentication token
|
|
162
|
+
- \`X-Request-ID: <uuid>\` - Optional request tracking ID
|
|
163
|
+
|
|
164
|
+
### Response Headers
|
|
165
|
+
- \`Content-Type: application/json\`
|
|
166
|
+
- \`X-Request-ID: <uuid>\` - Echo of request ID for tracking
|
|
167
|
+
- \`X-Response-Time: <ms>\` - Server processing time
|
|
168
|
+
|
|
169
|
+
## Endpoints
|
|
170
|
+
|
|
171
|
+
### Authentication Endpoints
|
|
172
|
+
|
|
173
|
+
#### POST /auth/register
|
|
174
|
+
Register a new user account.
|
|
175
|
+
|
|
176
|
+
**Request:**
|
|
177
|
+
\`\`\`json
|
|
178
|
+
{
|
|
179
|
+
"email": "user@example.com",
|
|
180
|
+
"password": "securePassword123",
|
|
181
|
+
"name": "John Doe"
|
|
182
|
+
}
|
|
183
|
+
\`\`\`
|
|
184
|
+
|
|
185
|
+
**Response (201 Created):**
|
|
186
|
+
\`\`\`json
|
|
187
|
+
{
|
|
188
|
+
"id": "user_123",
|
|
189
|
+
"email": "user@example.com",
|
|
190
|
+
"name": "John Doe",
|
|
191
|
+
"createdAt": "2024-01-15T10:30:00Z"
|
|
192
|
+
}
|
|
193
|
+
\`\`\`
|
|
194
|
+
|
|
195
|
+
**Errors:**
|
|
196
|
+
- \`400\`: Validation error (invalid email, weak password)
|
|
197
|
+
- \`409\`: Email already registered
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
#### POST /auth/login
|
|
202
|
+
Authenticate user and receive access token.
|
|
203
|
+
|
|
204
|
+
**Request:**
|
|
205
|
+
\`\`\`json
|
|
206
|
+
{
|
|
207
|
+
"email": "user@example.com",
|
|
208
|
+
"password": "securePassword123"
|
|
209
|
+
}
|
|
210
|
+
\`\`\`
|
|
211
|
+
|
|
212
|
+
**Response (200 OK):**
|
|
213
|
+
\`\`\`json
|
|
214
|
+
{
|
|
215
|
+
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
|
|
216
|
+
"refreshToken": "refresh_token_here",
|
|
217
|
+
"expiresIn": 3600,
|
|
218
|
+
"user": {
|
|
219
|
+
"id": "user_123",
|
|
220
|
+
"email": "user@example.com",
|
|
221
|
+
"name": "John Doe"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
\`\`\`
|
|
225
|
+
|
|
226
|
+
**Errors:**
|
|
227
|
+
- \`401\`: Invalid credentials
|
|
228
|
+
- \`429\`: Too many failed attempts
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
### Resource Endpoints
|
|
233
|
+
|
|
234
|
+
#### GET /api/resources
|
|
235
|
+
List all resources with pagination.
|
|
236
|
+
|
|
237
|
+
**Query Parameters:**
|
|
238
|
+
- \`page\` (integer, default: 1): Page number
|
|
239
|
+
- \`limit\` (integer, default: 20, max: 100): Items per page
|
|
240
|
+
- \`sort\` (string): Sort field (e.g., "createdAt", "-name" for desc)
|
|
241
|
+
- \`filter\` (string): Filter criteria (implementation-specific)
|
|
242
|
+
|
|
243
|
+
**Response (200 OK):**
|
|
244
|
+
\`\`\`json
|
|
245
|
+
{
|
|
246
|
+
"data": [
|
|
247
|
+
{
|
|
248
|
+
"id": "res_123",
|
|
249
|
+
"name": "Resource Name",
|
|
250
|
+
"status": "active",
|
|
251
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
252
|
+
"updatedAt": "2024-01-15T10:30:00Z"
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
"pagination": {
|
|
256
|
+
"page": 1,
|
|
257
|
+
"limit": 20,
|
|
258
|
+
"total": 100,
|
|
259
|
+
"pages": 5
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
\`\`\`
|
|
263
|
+
|
|
264
|
+
**Errors:**
|
|
265
|
+
- \`401\`: Unauthorized (missing or invalid token)
|
|
266
|
+
- \`403\`: Forbidden (insufficient permissions)
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
#### GET /api/resources/:id
|
|
271
|
+
Get a specific resource by ID.
|
|
272
|
+
|
|
273
|
+
**Path Parameters:**
|
|
274
|
+
- \`id\` (string, required): Resource identifier
|
|
275
|
+
|
|
276
|
+
**Response (200 OK):**
|
|
277
|
+
\`\`\`json
|
|
278
|
+
{
|
|
279
|
+
"id": "res_123",
|
|
280
|
+
"name": "Resource Name",
|
|
281
|
+
"description": "Detailed description",
|
|
282
|
+
"status": "active",
|
|
283
|
+
"metadata": {
|
|
284
|
+
"key": "value"
|
|
285
|
+
},
|
|
286
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
287
|
+
"updatedAt": "2024-01-15T10:30:00Z"
|
|
288
|
+
}
|
|
289
|
+
\`\`\`
|
|
290
|
+
|
|
291
|
+
**Errors:**
|
|
292
|
+
- \`401\`: Unauthorized
|
|
293
|
+
- \`404\`: Resource not found
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
#### POST /api/resources
|
|
298
|
+
Create a new resource.
|
|
299
|
+
|
|
300
|
+
**Request:**
|
|
301
|
+
\`\`\`json
|
|
302
|
+
{
|
|
303
|
+
"name": "New Resource",
|
|
304
|
+
"description": "Resource description",
|
|
305
|
+
"status": "active",
|
|
306
|
+
"metadata": {
|
|
307
|
+
"key": "value"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
\`\`\`
|
|
311
|
+
|
|
312
|
+
**Response (201 Created):**
|
|
313
|
+
\`\`\`json
|
|
314
|
+
{
|
|
315
|
+
"id": "res_124",
|
|
316
|
+
"name": "New Resource",
|
|
317
|
+
"description": "Resource description",
|
|
318
|
+
"status": "active",
|
|
319
|
+
"metadata": {
|
|
320
|
+
"key": "value"
|
|
321
|
+
},
|
|
322
|
+
"createdAt": "2024-01-15T11:00:00Z",
|
|
323
|
+
"updatedAt": "2024-01-15T11:00:00Z"
|
|
324
|
+
}
|
|
325
|
+
\`\`\`
|
|
326
|
+
|
|
327
|
+
**Errors:**
|
|
328
|
+
- \`400\`: Validation error
|
|
329
|
+
- \`401\`: Unauthorized
|
|
330
|
+
- \`403\`: Forbidden
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
#### PUT /api/resources/:id
|
|
335
|
+
Update an existing resource (full replacement).
|
|
336
|
+
|
|
337
|
+
**Path Parameters:**
|
|
338
|
+
- \`id\` (string, required): Resource identifier
|
|
339
|
+
|
|
340
|
+
**Request:**
|
|
341
|
+
\`\`\`json
|
|
342
|
+
{
|
|
343
|
+
"name": "Updated Resource",
|
|
344
|
+
"description": "Updated description",
|
|
345
|
+
"status": "inactive",
|
|
346
|
+
"metadata": {
|
|
347
|
+
"key": "newValue"
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
\`\`\`
|
|
351
|
+
|
|
352
|
+
**Response (200 OK):**
|
|
353
|
+
Returns updated resource object.
|
|
354
|
+
|
|
355
|
+
**Errors:**
|
|
356
|
+
- \`400\`: Validation error
|
|
357
|
+
- \`401\`: Unauthorized
|
|
358
|
+
- \`404\`: Resource not found
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
#### PATCH /api/resources/:id
|
|
363
|
+
Partially update a resource.
|
|
364
|
+
|
|
365
|
+
**Path Parameters:**
|
|
366
|
+
- \`id\` (string, required): Resource identifier
|
|
367
|
+
|
|
368
|
+
**Request:**
|
|
369
|
+
\`\`\`json
|
|
370
|
+
{
|
|
371
|
+
"status": "inactive"
|
|
372
|
+
}
|
|
373
|
+
\`\`\`
|
|
374
|
+
|
|
375
|
+
**Response (200 OK):**
|
|
376
|
+
Returns updated resource object.
|
|
377
|
+
|
|
378
|
+
---
|
|
379
|
+
|
|
380
|
+
#### DELETE /api/resources/:id
|
|
381
|
+
Delete a resource.
|
|
382
|
+
|
|
383
|
+
**Path Parameters:**
|
|
384
|
+
- \`id\` (string, required): Resource identifier
|
|
385
|
+
|
|
386
|
+
**Response (204 No Content)**
|
|
387
|
+
|
|
388
|
+
**Errors:**
|
|
389
|
+
- \`401\`: Unauthorized
|
|
390
|
+
- \`404\`: Resource not found
|
|
391
|
+
- \`409\`: Conflict (resource has dependencies)
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Webhooks
|
|
396
|
+
### Registering Webhooks
|
|
397
|
+
Document webhook registration process if applicable.
|
|
398
|
+
|
|
399
|
+
### Webhook Events
|
|
400
|
+
- \`resource.created\` - Fired when a new resource is created
|
|
401
|
+
- \`resource.updated\` - Fired when a resource is updated
|
|
402
|
+
- \`resource.deleted\` - Fired when a resource is deleted
|
|
403
|
+
|
|
404
|
+
### Webhook Payload Example
|
|
405
|
+
\`\`\`json
|
|
406
|
+
{
|
|
407
|
+
"event": "resource.created",
|
|
408
|
+
"timestamp": "2024-01-15T11:00:00Z",
|
|
409
|
+
"data": {
|
|
410
|
+
"id": "res_124",
|
|
411
|
+
"name": "New Resource"
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
\`\`\`
|
|
415
|
+
|
|
416
|
+
### Webhook Security
|
|
417
|
+
- Document signature verification mechanism
|
|
418
|
+
- Explain retry logic for failed deliveries
|
|
419
|
+
|
|
420
|
+
## Error Responses
|
|
421
|
+
### Standard Error Format
|
|
422
|
+
\`\`\`json
|
|
423
|
+
{
|
|
424
|
+
"error": {
|
|
425
|
+
"code": "VALIDATION_ERROR",
|
|
426
|
+
"message": "Invalid input data",
|
|
427
|
+
"details": [
|
|
428
|
+
{
|
|
429
|
+
"field": "email",
|
|
430
|
+
"message": "Invalid email format"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"requestId": "req_abc123"
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
\`\`\`
|
|
437
|
+
|
|
438
|
+
### HTTP Status Codes
|
|
439
|
+
- \`200 OK\`: Successful request
|
|
440
|
+
- \`201 Created\`: Resource created successfully
|
|
441
|
+
- \`204 No Content\`: Successful deletion
|
|
442
|
+
- \`400 Bad Request\`: Invalid input or validation error
|
|
443
|
+
- \`401 Unauthorized\`: Missing or invalid authentication
|
|
444
|
+
- \`403 Forbidden\`: Insufficient permissions
|
|
445
|
+
- \`404 Not Found\`: Resource not found
|
|
446
|
+
- \`409 Conflict\`: Resource conflict (duplicate, dependencies)
|
|
447
|
+
- \`422 Unprocessable Entity\`: Valid syntax but semantic errors
|
|
448
|
+
- \`429 Too Many Requests\`: Rate limit exceeded
|
|
449
|
+
- \`500 Internal Server Error\`: Server error
|
|
450
|
+
- \`503 Service Unavailable\`: Service temporarily unavailable
|
|
451
|
+
|
|
452
|
+
### Common Error Codes
|
|
453
|
+
- \`VALIDATION_ERROR\`: Input validation failed
|
|
454
|
+
- \`AUTHENTICATION_REQUIRED\`: No authentication provided
|
|
455
|
+
- \`AUTHENTICATION_FAILED\`: Invalid credentials
|
|
456
|
+
- \`PERMISSION_DENIED\`: Insufficient permissions
|
|
457
|
+
- \`RESOURCE_NOT_FOUND\`: Requested resource doesn't exist
|
|
458
|
+
- \`RATE_LIMIT_EXCEEDED\`: Too many requests
|
|
459
|
+
- \`INTERNAL_ERROR\`: Server-side error
|
|
460
|
+
|
|
461
|
+
## SDK & Client Libraries
|
|
462
|
+
- Document available SDKs (JavaScript, Python, Ruby, etc.)
|
|
463
|
+
- Link to SDK documentation and examples
|
|
464
|
+
|
|
465
|
+
## Postman/OpenAPI Collection
|
|
466
|
+
- Link to Postman collection for easy testing
|
|
467
|
+
- Link to OpenAPI/Swagger specification if available
|
|
468
|
+
|
|
469
|
+
<!-- agent-readonly:guidance -->
|
|
470
|
+
## AI Update Checklist
|
|
471
|
+
1. Review route definitions and controller implementations for new or changed endpoints
|
|
472
|
+
2. Verify authentication flows match current implementation
|
|
473
|
+
3. Update rate limiting policies if thresholds changed
|
|
474
|
+
4. Document new error codes and response formats
|
|
475
|
+
5. Ensure all examples use realistic data and current API structure
|
|
476
|
+
6. Validate that webhook event types are current
|
|
477
|
+
7. Update SDK links and availability
|
|
478
|
+
|
|
479
|
+
<!-- agent-readonly:sources -->
|
|
480
|
+
## Acceptable Sources
|
|
481
|
+
- API route files and controller implementations
|
|
482
|
+
- Authentication middleware and JWT/OAuth configurations
|
|
483
|
+
- OpenAPI/Swagger specifications
|
|
484
|
+
- Integration tests that demonstrate API usage
|
|
485
|
+
- Postman collections or API testing suites
|
|
486
|
+
|
|
487
|
+
<!-- agent-update:end -->
|
|
488
|
+
`;
|
|
489
|
+
}
|
|
490
|
+
//# sourceMappingURL=apiReferenceTemplate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiReferenceTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/apiReferenceTemplate.ts"],"names":[],"mappings":";;AAAA,gDAqeC;AAreD,SAAgB,kBAAkB;IAChC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmeR,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architectureTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/architectureTemplate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"architectureTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/architectureTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAGvD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,4BAA4B,GAAG,MAAM,CA6DrF"}
|
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderArchitectureNotes = renderArchitectureNotes;
|
|
4
|
-
const frontMatter_1 = require("./frontMatter");
|
|
5
4
|
const common_1 = require("./common");
|
|
6
5
|
function renderArchitectureNotes(context) {
|
|
7
|
-
const frontMatter = (0, frontMatter_1.createFrontMatter)({
|
|
8
|
-
id: 'architecture-notes',
|
|
9
|
-
goal: 'Describe how the system is assembled, key trade-offs, and active constraints.',
|
|
10
|
-
requiredInputs: [
|
|
11
|
-
'Recent architectural decisions or ADRs',
|
|
12
|
-
'Observed service/module boundaries in the codebase',
|
|
13
|
-
'Dependency graphs or build tooling insights'
|
|
14
|
-
],
|
|
15
|
-
successCriteria: [
|
|
16
|
-
'Decision list covers the most influential trade-offs',
|
|
17
|
-
'Risks capture active constraints or technical debt',
|
|
18
|
-
'Links to diagrams or monitors are up to date'
|
|
19
|
-
],
|
|
20
|
-
relatedAgents: ['architect-specialist', 'backend-specialist']
|
|
21
|
-
});
|
|
22
|
-
const defaultSections = [
|
|
23
|
-
'System boundaries and integration points',
|
|
24
|
-
'Primary modules and their responsibilities',
|
|
25
|
-
'Data flow between major components',
|
|
26
|
-
'Dependencies worth highlighting'
|
|
27
|
-
];
|
|
28
6
|
const directorySnapshot = (0, common_1.formatDirectoryStats)(context.directoryStats);
|
|
29
|
-
|
|
30
|
-
|
|
7
|
+
const coreComponentsSection = directorySnapshot || '- *Add notes for each core component or module.*';
|
|
8
|
+
return `<!-- agent-update:start:architecture-notes -->
|
|
31
9
|
# Architecture Notes
|
|
32
10
|
|
|
33
11
|
> TODO: Describe how the system is assembled and why the current design exists.
|
|
34
12
|
|
|
35
|
-
##
|
|
36
|
-
|
|
13
|
+
## System Architecture Overview
|
|
14
|
+
- Summarize the top-level topology (monolith, modular service, microservices) and deployment model.
|
|
15
|
+
- Highlight how requests traverse the system and where control pivots between layers.
|
|
16
|
+
|
|
17
|
+
## Core System Components
|
|
18
|
+
${coreComponentsSection}
|
|
19
|
+
|
|
20
|
+
## Internal System Boundaries
|
|
21
|
+
- Document seams between domains, bounded contexts, or service ownership.
|
|
22
|
+
- Note data ownership, synchronization strategies, and shared contract enforcement.
|
|
23
|
+
|
|
24
|
+
## System Integration Points
|
|
25
|
+
- Map inbound interfaces (APIs, events, webhooks) and the modules that own them.
|
|
26
|
+
- Capture orchestration touchpoints where this system calls or coordinates other internal services.
|
|
27
|
+
|
|
28
|
+
## External Service Dependencies
|
|
29
|
+
- List SaaS platforms, third-party APIs, or infrastructure services the system relies on.
|
|
30
|
+
- Describe authentication methods, rate limits, and failure considerations for each dependency.
|
|
31
|
+
|
|
32
|
+
## Key Decisions & Trade-offs
|
|
33
|
+
- Summarize architectural decisions, experiments, or ADR outcomes that shape the current design.
|
|
34
|
+
- Reference supporting documents and explain why selected approaches won over alternatives.
|
|
37
35
|
|
|
38
36
|
## Diagrams
|
|
39
37
|
- Link architectural diagrams or add mermaid definitions here.
|
|
@@ -44,6 +42,7 @@ ${defaultSections.map(item => `- ${item}`).join('\n')}
|
|
|
44
42
|
## Top Directories Snapshot
|
|
45
43
|
${directorySnapshot}
|
|
46
44
|
|
|
45
|
+
<!-- agent-readonly:guidance -->
|
|
47
46
|
## AI Update Checklist
|
|
48
47
|
1. Review ADRs, design docs, or major PRs for architectural changes.
|
|
49
48
|
2. Verify that each documented decision still holds; mark superseded choices clearly.
|
|
@@ -51,6 +50,7 @@ ${directorySnapshot}
|
|
|
51
50
|
4. Update Risks & Constraints with active incident learnings or TODO debt.
|
|
52
51
|
5. Link any new diagrams or dashboards referenced in recent work.
|
|
53
52
|
|
|
53
|
+
<!-- agent-readonly:sources -->
|
|
54
54
|
## Acceptable Sources
|
|
55
55
|
- ADR folders, \`/docs/architecture\` notes, or RFC threads.
|
|
56
56
|
- Dependency visualisations from build tooling or scripts.
|
|
@@ -60,7 +60,7 @@ ${directorySnapshot}
|
|
|
60
60
|
- [Project Overview](./project-overview.md)
|
|
61
61
|
- Update [agents/README.md](../agents/README.md) when architecture changes.
|
|
62
62
|
|
|
63
|
-
<!--
|
|
63
|
+
<!-- agent-update:end -->
|
|
64
64
|
`;
|
|
65
65
|
}
|
|
66
66
|
//# sourceMappingURL=architectureTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"architectureTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/architectureTemplate.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"architectureTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/architectureTemplate.ts"],"names":[],"mappings":";;AAGA,0DA6DC;AA/DD,qCAAgD;AAEhD,SAAgB,uBAAuB,CAAC,OAAqC;IAC3E,MAAM,iBAAiB,GAAG,IAAA,6BAAoB,EAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IACvE,MAAM,qBAAqB,GAAG,iBAAiB,IAAI,kDAAkD,CAAC;IAEtG,OAAO;;;;;;;;;;EAUP,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;EAyBrB,iBAAiB;;;;;;;;;;;;;;;;;;;;;CAqBlB,CAAC;AACF,CAAC"}
|
|
@@ -27,13 +27,13 @@ function formatDirectoryList(context, includePlaceholders) {
|
|
|
27
27
|
return `- \`${dir}/\``;
|
|
28
28
|
}
|
|
29
29
|
const slotId = slugify(dir);
|
|
30
|
-
return `- <!--
|
|
30
|
+
return `- <!-- agent-fill:directory-${slotId} -->\`${dir}/\` — TODO: Describe the purpose of this directory.<!-- /agent-fill -->`;
|
|
31
31
|
})
|
|
32
32
|
.join('\n');
|
|
33
33
|
}
|
|
34
34
|
function buildDocumentMapTable(guides) {
|
|
35
35
|
const rows = guides.map(meta => `| ${meta.title} | \`${meta.file}\` | ${meta.marker} | ${meta.primaryInputs} |`);
|
|
36
|
-
return ['| Guide | File |
|
|
36
|
+
return ['| Guide | File | AI Marker | Primary Inputs |', '| --- | --- | --- | --- |', ...rows].join('\n');
|
|
37
37
|
}
|
|
38
38
|
function formatDirectoryStats(stats) {
|
|
39
39
|
if (!stats.length) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/common.ts"],"names":[],"mappings":";;AAWA,kDAuBC;AAED,sDAGC;AAED,oDAQC;AAED,8DAMC;AAED,0BAKC;AA9DD,MAAM,kBAAkB,GAA2B;IACjD,GAAG,EAAE,8CAA8C;IACnD,IAAI,EAAE,yDAAyD;IAC/D,IAAI,EAAE,6CAA6C;IACnD,MAAM,EAAE,iCAAiC;IACzC,KAAK,EAAE,+BAA+B;IACtC,QAAQ,EAAE,gCAAgC;CAC3C,CAAC;AAEF,SAAgB,mBAAmB,CACjC,OAAqC,EACrC,mBAA4B;IAE5B,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC,mBAAmB;SAC/B,GAAG,CAAC,GAAG,CAAC,EAAE;QACT,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,OAAO,GAAG,SAAS,WAAW,EAAE,CAAC;QAC1C,CAAC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/common.ts"],"names":[],"mappings":";;AAWA,kDAuBC;AAED,sDAGC;AAED,oDAQC;AAED,8DAMC;AAED,0BAKC;AA9DD,MAAM,kBAAkB,GAA2B;IACjD,GAAG,EAAE,8CAA8C;IACnD,IAAI,EAAE,yDAAyD;IAC/D,IAAI,EAAE,6CAA6C;IACnD,MAAM,EAAE,iCAAiC;IACzC,KAAK,EAAE,+BAA+B;IACtC,QAAQ,EAAE,gCAAgC;CAC3C,CAAC;AAEF,SAAgB,mBAAmB,CACjC,OAAqC,EACrC,mBAA4B;IAE5B,IAAI,OAAO,CAAC,mBAAmB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,OAAO,CAAC,mBAAmB;SAC/B,GAAG,CAAC,GAAG,CAAC,EAAE;QACT,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,WAAW,EAAE,CAAC;YAChB,OAAO,OAAO,GAAG,SAAS,WAAW,EAAE,CAAC;QAC1C,CAAC;QAED,IAAI,CAAC,mBAAmB,EAAE,CAAC;YACzB,OAAO,OAAO,GAAG,KAAK,CAAC;QACzB,CAAC;QAED,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,+BAA+B,MAAM,SAAS,GAAG,yEAAyE,CAAC;IACpI,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAgB,qBAAqB,CAAC,MAA8C;IAClF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,aAAa,IAAI,CAAC,CAAC;IACjH,OAAO,CAAC,+CAA+C,EAAE,2BAA2B,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5G,CAAC;AAED,SAAgB,oBAAoB,CAAC,KAAsB;IACzD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,OAAO,4BAA4B,CAAC;IACtC,CAAC;IAED,OAAO,KAAK;SACT,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,IAAI,CAAC,IAAI,uBAAuB,IAAI,CAAC,SAAS,QAAQ,CAAC;SAC1E,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,SAAgB,yBAAyB,CAAC,WAAqB;IAC7D,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK;SACT,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataFlowTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/dataFlowTemplate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataFlowTemplate.d.ts","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/dataFlowTemplate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAGvD,wBAAgB,cAAc,CAAC,OAAO,EAAE,4BAA4B,GAAG,MAAM,CAkC5E"}
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.renderDataFlow = renderDataFlow;
|
|
4
|
-
const frontMatter_1 = require("./frontMatter");
|
|
5
4
|
const common_1 = require("./common");
|
|
6
5
|
function renderDataFlow(context) {
|
|
7
|
-
|
|
8
|
-
id: 'data-flow',
|
|
9
|
-
goal: 'Describe how information moves through the system and where it integrates with external services.',
|
|
10
|
-
requiredInputs: [
|
|
11
|
-
'Architecture diagrams or sequence flows',
|
|
12
|
-
'Integration specs (APIs, queues, webhooks, third-party services)',
|
|
13
|
-
'Notes on batch jobs, schedulers, or ETL processes'
|
|
14
|
-
],
|
|
15
|
-
successCriteria: [
|
|
16
|
-
'Highlights inbound, internal, and outbound flows',
|
|
17
|
-
'Documents transformation points and trust boundaries',
|
|
18
|
-
'Identifies failure modes and retry/backoff behaviour'
|
|
19
|
-
],
|
|
20
|
-
relatedAgents: ['architect-specialist', 'backend-specialist']
|
|
21
|
-
});
|
|
22
|
-
return `${frontMatter}
|
|
23
|
-
<!-- ai-task:data-flow -->
|
|
6
|
+
return `<!-- agent-update:start:data-flow -->
|
|
24
7
|
# Data Flow & Integrations
|
|
25
8
|
|
|
26
9
|
Explain how data enters, moves through, and exits the system, including interactions with external services.
|
|
@@ -32,24 +15,26 @@ Explain how data enters, moves through, and exits the system, including interact
|
|
|
32
15
|
- Describe how modules within ${(0, common_1.formatInlineDirectoryList)(context.topLevelDirectories)} collaborate (queues, events, RPC calls, shared databases).
|
|
33
16
|
|
|
34
17
|
## External Integrations
|
|
35
|
-
- <!--
|
|
18
|
+
- <!-- agent-fill:integration -->**Integration** — Purpose, authentication, payload shapes, retry strategy.<!-- /agent-fill -->
|
|
36
19
|
|
|
37
20
|
## Observability & Failure Modes
|
|
38
21
|
- Metrics, traces, or logs that monitor the flow.
|
|
39
22
|
- Backoff, dead-letter, or compensating actions when downstream systems fail.
|
|
40
23
|
|
|
24
|
+
<!-- agent-readonly:guidance -->
|
|
41
25
|
## AI Update Checklist
|
|
42
26
|
1. Validate flows against the latest integration contracts or diagrams.
|
|
43
27
|
2. Update authentication, scopes, or rate limits when they change.
|
|
44
28
|
3. Capture recent incidents or lessons learned that influenced reliability.
|
|
45
29
|
4. Link to runbooks or dashboards used during triage.
|
|
46
30
|
|
|
31
|
+
<!-- agent-readonly:sources -->
|
|
47
32
|
## Acceptable Sources
|
|
48
33
|
- Architecture diagrams, ADRs, integration playbooks.
|
|
49
34
|
- API specs, queue/topic definitions, infrastructure code.
|
|
50
35
|
- Postmortems or incident reviews impacting data movement.
|
|
51
36
|
|
|
52
|
-
<!--
|
|
37
|
+
<!-- agent-update:end -->
|
|
53
38
|
`;
|
|
54
39
|
}
|
|
55
40
|
//# sourceMappingURL=dataFlowTemplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataFlowTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/dataFlowTemplate.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"dataFlowTemplate.js","sourceRoot":"","sources":["../../../../src/generators/documentation/templates/dataFlowTemplate.ts"],"names":[],"mappings":";;AAGA,wCAkCC;AApCD,qCAAqD;AAErD,SAAgB,cAAc,CAAC,OAAqC;IAClE,OAAO;;;;;;;;;gCASuB,IAAA,kCAAyB,EAAC,OAAO,CAAC,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuBrF,CAAC;AACF,CAAC"}
|