- Implemented role parsing and loading functionality in roles.js, allowing for structured role definitions with metadata. - Added tests for role management to ensure correct parsing and loading of roles. - Created usage.js to track API usage metrics, including token counts and rate limits. - Developed tests for usage tracking to validate functionality and edge cases. - Enhanced overall code structure and documentation for clarity and maintainability.
39 lines
875 B
JavaScript
39 lines
875 B
JavaScript
export function section(title) {
|
||
console.log(`\n=== ${title} ===`);
|
||
}
|
||
|
||
export function step(stepName, title) {
|
||
console.log(`\n[${stepName}] ${title}`);
|
||
}
|
||
|
||
export function line(message) {
|
||
console.log(` - ${message}`);
|
||
}
|
||
|
||
/** 階段輸入:這個階段吃進什麼。 */
|
||
export function input(message) {
|
||
console.log(` ← 輸入:${message}`);
|
||
}
|
||
|
||
/** 階段輸出:這個階段產出什麼。 */
|
||
export function output(message) {
|
||
console.log(` → 輸出:${message}`);
|
||
}
|
||
|
||
/** 檢查/把關結果:明確標示成功或失敗。 */
|
||
export function result(passed, message) {
|
||
console.log(` ${passed ? '✅ 成功' : '❌ 失敗'}:${message}`);
|
||
}
|
||
|
||
export function ok(message) {
|
||
console.log(` ✓ ${message}`);
|
||
}
|
||
|
||
export function warn(message) {
|
||
console.warn(` ! ${message}`);
|
||
}
|
||
|
||
export function error(message) {
|
||
console.error(` x ${message}`);
|
||
}
|