aiwg
Version:
Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo
50 lines • 1.42 kB
JavaScript
/**
* Activity Log Types
*
* Type definitions for `.aiwg/activity.log` entries. The wire format is
* frozen by the activity-log rule (`agentic/code/addons/aiwg-utils/rules/activity-log.md`):
*
* ## [YYYY-MM-DD HH:MM] <operation> | <summary>
*
* @issue #934
* @issue #964
*/
/**
* Valid operation tokens. The activity-log rule freezes this set;
* additions require updating the rule too.
*/
export const ACTIVITY_OPERATIONS = [
'ingest',
'create',
'update',
'delete',
'query',
'lint',
'deploy',
'archive',
'promote',
];
export function isActivityOperation(s) {
return ACTIVITY_OPERATIONS.includes(s);
}
/**
* Format an entry as the canonical wire line (no trailing newline).
*
* Wire format: `## [YYYY-MM-DD HH:MM] <operation> | <summary>`
*/
export function formatEntry(entry) {
const ts = formatUtcTimestamp(entry.timestamp);
return `## [${ts}] ${entry.operation} | ${entry.summary}`;
}
/**
* Format a Date as the canonical "YYYY-MM-DD HH:MM" UTC timestamp.
*/
export function formatUtcTimestamp(d) {
const yyyy = d.getUTCFullYear();
const mm = String(d.getUTCMonth() + 1).padStart(2, '0');
const dd = String(d.getUTCDate()).padStart(2, '0');
const HH = String(d.getUTCHours()).padStart(2, '0');
const MM = String(d.getUTCMinutes()).padStart(2, '0');
return `${yyyy}-${mm}-${dd} ${HH}:${MM}`;
}
//# sourceMappingURL=types.js.map