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

36 lines (35 loc) • 1.68 kB
// 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/. /** * `workflow` settings (fan-out limits). */ import { z } from "zod"; import { positiveInt } from "./primitives.js"; /** * Workflow-engine settings (`workflow`). * * `maxConcurrency` is the engine-wide ceiling on concurrent units for native * fan-out (`akm workflow run`). It replaces the hard-coded `min(16, cores−2)` * cap (which matched Claude Code) with a user knob: * - UNSET → the CPU-derived default `min(16, max(1, cores−2))`. * - SET → the explicit positive integer, CLAMPED at read time to * `[1, WORKFLOW_MAX_CONCURRENCY_CEILING]` (64). Values above the ceiling * are clamped, not rejected, so a config shared across machines with wildly * different core counts never hard-fails validation. * * `defaultMapConcurrency` is the width a `map` step freezes when it declares no * `concurrency:` of its own: * - UNSET → `DEFAULT_MAP_CONCURRENCY` (4) from * `src/workflows/concurrency-policy.ts`. * - SET → the explicit positive integer, CLAMPED to `[1, 64]`. Setting it * to `1` makes every `map` step on this install serial by default. It is a floor for authoring only: it never * raises a step above `maxConcurrency`, the engine's concurrency, or the * host CPU cap, and it never overrides an authored `map.concurrency`. */ export const WorkflowConfigSchema = z .object({ maxConcurrency: positiveInt.optional(), defaultMapConcurrency: positiveInt.optional(), }) .passthrough();