- 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
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
import { debugId, toDebugString } from "../debug";
|
|
import { evaluateConditions } from "./evaluateConditions";
|
|
import { getEndpointHeaders } from "./getEndpointHeaders";
|
|
import { getEndpointProperties } from "./getEndpointProperties";
|
|
import { getEndpointUrl } from "./getEndpointUrl";
|
|
export const evaluateEndpointRule = (endpointRule, options) => {
|
|
const { conditions, endpoint } = endpointRule;
|
|
const { result, referenceRecord } = evaluateConditions(conditions, options);
|
|
if (!result) {
|
|
return;
|
|
}
|
|
const endpointRuleOptions = {
|
|
...options,
|
|
referenceRecord: { ...options.referenceRecord, ...referenceRecord },
|
|
};
|
|
const { url, properties, headers } = endpoint;
|
|
options.logger?.debug?.(`${debugId} Resolving endpoint from template: ${toDebugString(endpoint)}`);
|
|
return {
|
|
...(headers != undefined && {
|
|
headers: getEndpointHeaders(headers, endpointRuleOptions),
|
|
}),
|
|
...(properties != undefined && {
|
|
properties: getEndpointProperties(properties, endpointRuleOptions),
|
|
}),
|
|
url: getEndpointUrl(url, endpointRuleOptions),
|
|
};
|
|
};
|