UNPKG

akm-cli

Version:

akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cur

21 lines (20 loc) • 944 B
// This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. /** * Build the default task-run provenance context: `eventSource` is always * `"task"` (D5-N1); `scheduled` carries the caller's own scheduled flag. */ export function createExecutionProvenanceContext(scheduled) { return Object.freeze({ eventSource: "task", scheduled }); } /** * Resolve the effective provenance for one `runTask()` call: an explicit * `RunTaskOptions.provenance` always wins; absent, this is the default * context (§5.2 "Threading") — what keeps every pre-P1b caller (and any * future in-repo caller that never sets `provenance`) byte-equivalent to * today's behavior. */ export function resolveProvenanceContext(explicit, scheduled) { return explicit ?? createExecutionProvenanceContext(scheduled); }