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

24 lines (23 loc) • 936 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/. import { freezeEnvironment } from "../environment.js"; import { freezeExecSpec, } from "../step-values.js"; export function directShell(source, baseUnit, context) { const authoredExec = baseUnit.exec; if (!authoredExec) throw new Error(`workflow shell step ${source.id} has no argv`); const exec = freezeExecSpec(source, authoredExec, context); const environment = Object.freeze(freezeEnvironment(source, authoredExec)); const target = Object.freeze({ kind: "shell", contentHash: "", exec, }); return { target, environment, unit: { ...baseUnit, exec }, instructions: source.instructions ?? `Run ${authoredExec.command.join(" ")}.`, }; }