feat: add role management and usage tracking modules
- 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.
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
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}`);
|
||||
}
|
||||
Reference in New Issue
Block a user