akm-cli 0.9.0-rc.13 → 0.9.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +162 -23
- package/dist/akm-migrate +3 -1
- package/dist/assets/hints/cli-hints-full.md +3 -4
- package/dist/assets/hints/cli-hints-short.md +5 -5
- package/dist/assets/workflows/workflow-template.md +4 -3
- package/dist/cli/invocation.js +3 -2
- package/dist/cli/retired-commands.js +5 -0
- package/dist/cli/unknown-flags.js +226 -0
- package/dist/cli.js +19 -35
- package/dist/commands/agent/agent-dispatch.js +7 -3
- package/dist/commands/agent/contribute-cli.js +15 -3
- package/dist/commands/feedback-cli.js +6 -3
- package/dist/commands/health/checks.js +6 -3
- package/dist/commands/improve/collapse-detector.js +2 -3
- package/dist/commands/improve/reflect.js +5 -3
- package/dist/commands/lint/base-linter.js +4 -16
- package/dist/commands/lint/index.js +13 -13
- package/dist/commands/log.js +6 -1
- package/dist/commands/migration-tool.js +4 -5
- package/dist/commands/observability-cli.js +1 -1
- package/dist/commands/proposal/propose.js +5 -3
- package/dist/commands/proposal/repository.js +5 -5
- package/dist/commands/read/knowledge.js +2 -0
- package/dist/commands/registry-cli.js +5 -3
- package/dist/commands/sources/add-cli.js +6 -6
- package/dist/commands/sources/init.js +1 -1
- package/dist/commands/sources/self-update.js +30 -7
- package/dist/commands/sources/source-add.js +17 -2
- package/dist/commands/tasks/tasks.js +10 -10
- package/dist/commands/workflow-cli.js +133 -259
- package/dist/core/adapter/adapters/akm-lint.js +17 -13
- package/dist/core/adapter/adapters/akm-task-adapter.js +14 -11
- package/dist/core/asset/akm-markdown.js +41 -8
- package/dist/core/asset/frontmatter.js +22 -0
- package/dist/core/asset/resolve-ref.js +23 -3
- package/dist/core/common.js +45 -2
- package/dist/core/config/config-schema.js +8 -0
- package/dist/core/config/schema/experimental.js +0 -17
- package/dist/core/config/schema/sources-bundles.js +11 -0
- package/dist/core/config/schema/workflow.js +3 -3
- package/dist/core/errors.js +5 -1
- package/dist/core/logs-db.js +2 -1
- package/dist/core/parse.js +4 -1
- package/dist/core/state/migrations.js +11 -14
- package/dist/core/state-db.js +4 -6
- package/dist/core/subprocess.js +6 -4
- package/dist/core/type-presentation.js +1 -1
- package/dist/indexer/indexer.js +16 -1
- package/dist/indexer/search/search-source.js +1 -1
- package/dist/indexer/walk/matchers.js +3 -1
- package/dist/integrations/agent/config.js +2 -2
- package/dist/integrations/agent/detect.js +49 -19
- package/dist/integrations/agent/engine-fallback.js +76 -0
- package/dist/integrations/agent/profiles.js +14 -0
- package/dist/integrations/agent/spawn.js +1 -2
- package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +13 -4
- package/dist/integrations/lockfile.js +11 -56
- package/dist/output/shapes/passthrough.js +0 -6
- package/dist/output/text/command-format.js +3 -3
- package/dist/output/text/helpers.js +1 -1
- package/dist/output/text/show-directives.js +4 -6
- package/dist/output/text/workflow-format.js +15 -181
- package/dist/output/text/workflow.js +1 -6
- package/dist/scripts/akm-migrate-node.js +58666 -0
- package/dist/scripts/akm-migrate.js +33976 -11498
- package/dist/setup/detect.js +42 -15
- package/dist/setup/setup.js +1 -1
- package/dist/sources/providers/git-stash.js +4 -2
- package/dist/sources/providers/website.js +5 -0
- package/dist/sources/snapshot-fetchers/bluesky.js +146 -0
- package/dist/sources/snapshot-fetchers/content-extract.js +370 -0
- package/dist/sources/snapshot-fetchers/fetcher-util.js +40 -0
- package/dist/sources/snapshot-fetchers/host-guard.js +199 -0
- package/dist/sources/snapshot-fetchers/registry.js +10 -1
- package/dist/sources/snapshot-fetchers/robots.js +348 -0
- package/dist/sources/snapshot-fetchers/rss.js +279 -0
- package/dist/sources/snapshot-fetchers/secret-seam.js +42 -0
- package/dist/sources/snapshot-fetchers/website-ingest.js +488 -257
- package/dist/sources/snapshot-fetchers/x.js +193 -0
- package/dist/storage/engines/sqlite-migrations.js +22 -107
- package/dist/storage/repositories/workflow-runs-repository.js +9 -23
- package/dist/tasks/runner.js +43 -19
- package/dist/tasks/schema.js +24 -1
- package/dist/tasks/validator.js +6 -2
- package/dist/workflows/exec/frozen-judge.js +28 -2
- package/dist/workflows/exec/native-executor.js +44 -28
- package/dist/workflows/exec/param-secrets.js +9 -9
- package/dist/workflows/exec/run-workflow.js +122 -60
- package/dist/workflows/exec/step-work.js +64 -175
- package/dist/workflows/exec/unit-dispatch.js +4 -0
- package/dist/workflows/ir/compile.js +2 -2
- package/dist/workflows/ir/freeze.js +29 -9
- package/dist/workflows/ir/params.js +135 -11
- package/dist/workflows/ir/plan-hash.js +1 -1
- package/dist/workflows/ir/schema.js +6 -2
- package/dist/workflows/renderer.js +2 -2
- package/dist/workflows/runtime/checkin.js +3 -3
- package/dist/workflows/runtime/runs.js +72 -92
- package/dist/workflows/runtime/unit-checkin.js +1 -1
- package/dist/workflows/runtime/unit-phases.js +2 -2
- package/dist/workflows/validate-summary.js +30 -14
- package/docs/migration/release-notes/0.9.0.md +31 -4
- package/docs/migration/v0.8-to-v0.9.md +70 -100
- package/docs/reference/data-and-telemetry.md +5 -5
- package/package.json +7 -3
- package/schemas/akm-config.json +24 -6
- package/schemas/akm-workflow.json +1 -1
- package/dist/workflows/cli.js +0 -33
- package/dist/workflows/exec/brief.js +0 -450
- package/dist/workflows/exec/report.js +0 -1460
- package/dist/workflows/exec/workflow-engine-gate.js +0 -67
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
-
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
-
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
4
|
-
/**
|
|
5
|
-
* The `akm workflow` engine gate (`experimental.workflowEngine`, Q-05).
|
|
6
|
-
*
|
|
7
|
-
* Mirrors the shape of `src/commands/improve/autonomy-gate.ts` (D8) for a
|
|
8
|
-
* different failure mode. `akm improve`'s gated lanes have a safe downgrade —
|
|
9
|
-
* skip the lane, keep the rest of the run going — but a workflow step either
|
|
10
|
-
* executes or it does not: there is no partial-execution fallback to degrade
|
|
11
|
-
* into. So this gate REFUSES outright rather than silently skipping: an
|
|
12
|
-
* ungated call throws a classified `ConfigError` naming the exact config key,
|
|
13
|
-
* which the CLI's JSON error envelope (`emitJsonError`, `src/cli/shared.ts`)
|
|
14
|
-
* always routes to stderr with a non-zero exit — in every `--format`, not
|
|
15
|
-
* just `json` — so the refusal is visible and never a silent no-op. (A
|
|
16
|
-
* second, plain-text `warn()` call alongside the throw was deliberately
|
|
17
|
-
* rejected: it would interleave non-JSON text with the JSON error envelope on
|
|
18
|
-
* the SAME stream, corrupting stderr for any `--json` caller — a real defect,
|
|
19
|
-
* not just a test inconvenience.)
|
|
20
|
-
*
|
|
21
|
-
* Gated surfaces:
|
|
22
|
-
* - `akm workflow run` — the native step-execution engine
|
|
23
|
-
* - `akm workflow brief` — the harness-neutral driver protocol (read half)
|
|
24
|
-
* - `akm workflow report` — the harness-neutral driver protocol (write half)
|
|
25
|
-
*
|
|
26
|
-
* Deliberately NOT gated: authoring/linting the unified markdown format and
|
|
27
|
-
* the manual workflow CLI contract (`start`, `next`, `complete`, `status`,
|
|
28
|
-
* `list`, `create`, `resume`, `abandon`) remain stable per STABILITY.md.
|
|
29
|
-
*/
|
|
30
|
-
import { ConfigError } from "../../core/errors.js";
|
|
31
|
-
/**
|
|
32
|
-
* The config key an operator sets to enable the workflow engine.
|
|
33
|
-
*
|
|
34
|
-
* Named rather than inlined because it is user-facing text: it goes into the
|
|
35
|
-
* thrown error's message and `akm task doctor`, and those must name the same
|
|
36
|
-
* key as the schema.
|
|
37
|
-
*/
|
|
38
|
-
export const WORKFLOW_ENGINE_CONFIG_KEY = "experimental.workflowEngine";
|
|
39
|
-
/**
|
|
40
|
-
* True only when the user has explicitly opted into the workflow engine.
|
|
41
|
-
* Absent, an absent `experimental` section, and an explicit `false` all read
|
|
42
|
-
* as off — the engine is never enabled by inference.
|
|
43
|
-
*/
|
|
44
|
-
export function isWorkflowEngineEnabled(config) {
|
|
45
|
-
return config?.experimental?.workflowEngine === true;
|
|
46
|
-
}
|
|
47
|
-
/** The message shown to the user AND matched by tests naming the config key. */
|
|
48
|
-
export function workflowEngineGateMessage(surface) {
|
|
49
|
-
return (`\`akm workflow ${surface}\` is EXPERIMENTAL and refuses to run until ` +
|
|
50
|
-
`\`${WORKFLOW_ENGINE_CONFIG_KEY}\` is set. Run \`akm config set ${WORKFLOW_ENGINE_CONFIG_KEY} true\` to enable it.`);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Refuse a gated workflow-engine surface unless the opt-in is set.
|
|
54
|
-
*
|
|
55
|
-
* `surface` is the human name of the subcommand/action being refused (e.g.
|
|
56
|
-
* `"run"`, `"brief"`, `"create <name>.yaml"`) — it is folded into the thrown
|
|
57
|
-
* error's message so the refusal names both the surface and the exact config
|
|
58
|
-
* key that would enable it. The throw alone is the whole mechanism: every
|
|
59
|
-
* command defined with `defineJsonCommand` routes an uncaught throw through
|
|
60
|
-
* `runWithJsonErrors`/`emitJsonError`, which prints the error to stderr and
|
|
61
|
-
* exits non-zero regardless of `--format` — so this is never a silent no-op.
|
|
62
|
-
*/
|
|
63
|
-
export function requireWorkflowEngineEnabled(config, surface) {
|
|
64
|
-
if (isWorkflowEngineEnabled(config))
|
|
65
|
-
return;
|
|
66
|
-
throw new ConfigError(workflowEngineGateMessage(surface), "WORKFLOW_ENGINE_NOT_ENABLED");
|
|
67
|
-
}
|