- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation
🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
26 lines
925 B
JavaScript
26 lines
925 B
JavaScript
import { EndpointError } from "../types";
|
|
export const getAttrPathList = (path) => {
|
|
const parts = path.split(".");
|
|
const pathList = [];
|
|
for (const part of parts) {
|
|
const squareBracketIndex = part.indexOf("[");
|
|
if (squareBracketIndex !== -1) {
|
|
if (part.indexOf("]") !== part.length - 1) {
|
|
throw new EndpointError(`Path: '${path}' does not end with ']'`);
|
|
}
|
|
const arrayIndex = part.slice(squareBracketIndex + 1, -1);
|
|
if (Number.isNaN(parseInt(arrayIndex))) {
|
|
throw new EndpointError(`Invalid array index: '${arrayIndex}' in path: '${path}'`);
|
|
}
|
|
if (squareBracketIndex !== 0) {
|
|
pathList.push(part.slice(0, squareBracketIndex));
|
|
}
|
|
pathList.push(arrayIndex);
|
|
}
|
|
else {
|
|
pathList.push(part);
|
|
}
|
|
}
|
|
return pathList;
|
|
};
|