akm-cli 0.9.0-rc.13 → 0.9.0-rc.14

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +117 -23
  2. package/dist/akm-migrate +3 -1
  3. package/dist/assets/hints/cli-hints-full.md +3 -4
  4. package/dist/assets/hints/cli-hints-short.md +5 -5
  5. package/dist/assets/workflows/workflow-template.md +4 -3
  6. package/dist/cli/invocation.js +3 -2
  7. package/dist/cli/retired-commands.js +3 -0
  8. package/dist/cli/unknown-flags.js +226 -0
  9. package/dist/cli.js +19 -35
  10. package/dist/commands/agent/contribute-cli.js +15 -3
  11. package/dist/commands/feedback-cli.js +6 -3
  12. package/dist/commands/improve/collapse-detector.js +2 -3
  13. package/dist/commands/lint/base-linter.js +4 -16
  14. package/dist/commands/lint/index.js +13 -13
  15. package/dist/commands/log.js +6 -1
  16. package/dist/commands/migration-tool.js +4 -5
  17. package/dist/commands/observability-cli.js +1 -1
  18. package/dist/commands/proposal/repository.js +5 -5
  19. package/dist/commands/read/knowledge.js +2 -0
  20. package/dist/commands/registry-cli.js +5 -3
  21. package/dist/commands/sources/add-cli.js +6 -6
  22. package/dist/commands/sources/self-update.js +30 -7
  23. package/dist/commands/sources/source-add.js +17 -2
  24. package/dist/commands/tasks/tasks.js +8 -3
  25. package/dist/commands/workflow-cli.js +142 -119
  26. package/dist/core/adapter/adapters/akm-lint.js +17 -13
  27. package/dist/core/adapter/adapters/akm-task-adapter.js +14 -11
  28. package/dist/core/asset/akm-markdown.js +41 -8
  29. package/dist/core/asset/frontmatter.js +22 -0
  30. package/dist/core/asset/resolve-ref.js +23 -3
  31. package/dist/core/common.js +45 -2
  32. package/dist/core/config/config-schema.js +8 -0
  33. package/dist/core/config/schema/experimental.js +5 -13
  34. package/dist/core/config/schema/sources-bundles.js +11 -0
  35. package/dist/core/config/schema/workflow.js +3 -1
  36. package/dist/core/errors.js +5 -0
  37. package/dist/core/logs-db.js +2 -1
  38. package/dist/core/parse.js +4 -1
  39. package/dist/core/state/migrations.js +11 -14
  40. package/dist/core/state-db.js +4 -6
  41. package/dist/core/subprocess.js +6 -4
  42. package/dist/core/type-presentation.js +1 -1
  43. package/dist/indexer/indexer.js +16 -1
  44. package/dist/indexer/search/search-source.js +1 -1
  45. package/dist/indexer/walk/matchers.js +3 -1
  46. package/dist/integrations/agent/config.js +2 -2
  47. package/dist/integrations/agent/detect.js +49 -19
  48. package/dist/integrations/agent/profiles.js +10 -0
  49. package/dist/integrations/agent/spawn.js +1 -2
  50. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +7 -3
  51. package/dist/integrations/lockfile.js +11 -56
  52. package/dist/output/shapes/passthrough.js +0 -4
  53. package/dist/output/text/command-format.js +3 -3
  54. package/dist/output/text/helpers.js +1 -1
  55. package/dist/output/text/show-directives.js +4 -6
  56. package/dist/output/text/workflow-format.js +7 -62
  57. package/dist/output/text/workflow.js +1 -5
  58. package/dist/scripts/akm-migrate-node.js +58773 -0
  59. package/dist/scripts/akm-migrate.js +33976 -11391
  60. package/dist/setup/detect.js +40 -15
  61. package/dist/setup/setup.js +1 -1
  62. package/dist/sources/providers/git-stash.js +4 -2
  63. package/dist/sources/providers/website.js +5 -0
  64. package/dist/sources/snapshot-fetchers/bluesky.js +146 -0
  65. package/dist/sources/snapshot-fetchers/content-extract.js +370 -0
  66. package/dist/sources/snapshot-fetchers/fetcher-util.js +40 -0
  67. package/dist/sources/snapshot-fetchers/host-guard.js +199 -0
  68. package/dist/sources/snapshot-fetchers/registry.js +10 -1
  69. package/dist/sources/snapshot-fetchers/robots.js +348 -0
  70. package/dist/sources/snapshot-fetchers/rss.js +279 -0
  71. package/dist/sources/snapshot-fetchers/secret-seam.js +42 -0
  72. package/dist/sources/snapshot-fetchers/website-ingest.js +488 -257
  73. package/dist/sources/snapshot-fetchers/x.js +193 -0
  74. package/dist/storage/engines/sqlite-migrations.js +22 -107
  75. package/dist/tasks/runner.js +19 -16
  76. package/dist/tasks/schema.js +24 -1
  77. package/dist/workflows/exec/brief.js +1 -1
  78. package/dist/workflows/exec/frozen-judge.js +28 -2
  79. package/dist/workflows/exec/native-executor.js +18 -1
  80. package/dist/workflows/exec/report.js +11 -4
  81. package/dist/workflows/exec/run-workflow.js +103 -44
  82. package/dist/workflows/exec/step-work.js +19 -18
  83. package/dist/workflows/exec/unit-dispatch.js +4 -0
  84. package/dist/workflows/exec/workflow-engine-gate.js +11 -13
  85. package/dist/workflows/ir/compile.js +2 -2
  86. package/dist/workflows/ir/freeze.js +16 -8
  87. package/dist/workflows/ir/params.js +134 -10
  88. package/dist/workflows/ir/plan-hash.js +1 -1
  89. package/dist/workflows/ir/schema.js +6 -2
  90. package/dist/workflows/renderer.js +2 -2
  91. package/dist/workflows/runtime/checkin.js +3 -3
  92. package/dist/workflows/runtime/runs.js +50 -29
  93. package/dist/workflows/validate-summary.js +30 -14
  94. package/docs/migration/release-notes/0.9.0.md +31 -4
  95. package/docs/migration/v0.8-to-v0.9.md +69 -100
  96. package/docs/reference/data-and-telemetry.md +5 -5
  97. package/package.json +6 -2
  98. package/schemas/akm-config.json +24 -0
  99. package/schemas/akm-workflow.json +1 -1
  100. package/dist/workflows/cli.js +0 -33
@@ -9,29 +9,10 @@
9
9
  * cohesive, self-contained cluster (they call only each other, never
10
10
  * formatters from other domains).
11
11
  */
12
- /**
13
- * Plain-text rendering for a step-completion that was rejected by the
14
- * summary-validation gate (#506): the step stays pending and the agent gets
15
- * corrective feedback on what to finish/fix.
16
- */
17
- export function formatWorkflowCompleteRejectedPlain(r) {
18
- const stepId = String(r.stepId ?? "?");
19
- const feedback = typeof r.feedback === "string" ? r.feedback : "";
20
- const missing = Array.isArray(r.missing) ? r.missing.map((m) => String(m)) : [];
21
- const lines = [`workflow complete: rejected — step "${stepId}" does not meet its completion criteria`];
22
- if (feedback)
23
- lines.push(` feedback: ${feedback}`);
24
- if (missing.length > 0) {
25
- lines.push(" outstanding:");
26
- for (const m of missing)
27
- lines.push(` - ${m}`);
28
- }
29
- return lines.join("\n");
30
- }
31
12
  export function formatWorkflowListPlain(result) {
32
13
  const runs = Array.isArray(result.runs) ? result.runs : [];
33
14
  if (runs.length === 0) {
34
- return "No workflow runs in the current working scope. Start one with `akm workflow next workflows/<name>` or author one with `akm workflow create <name>`.";
15
+ return "No workflow runs in the current working scope. Start one with `akm workflow run workflows/<name>` or author one with `akm workflow create <name>`.";
35
16
  }
36
17
  return runs
37
18
  .map((run) => {
@@ -117,7 +98,7 @@ export function formatWorkflowStatusPlain(result) {
117
98
  }
118
99
  /**
119
100
  * Render the stalled-run check-in directive (#506) when present on a
120
- * workflow-next/status result. Returns null when the run is healthy.
101
+ * workflow-status result. Returns null when the run is healthy.
121
102
  */
122
103
  function formatWorkflowCheckinLine(result) {
123
104
  const checkin = typeof result.checkin === "object" && result.checkin !== null
@@ -127,47 +108,6 @@ function formatWorkflowCheckinLine(result) {
127
108
  return null;
128
109
  return checkin.directive.trim();
129
110
  }
130
- export function formatWorkflowNextPlain(result) {
131
- const base = formatWorkflowStatusPlain(result);
132
- const step = typeof result.step === "object" && result.step !== null ? result.step : undefined;
133
- if (!step)
134
- return base;
135
- const lines = base ? [base, "", "next:"] : ["next:"];
136
- lines.push(` ${String(step.title ?? "Untitled step")} [${String(step.id ?? "unknown")}]`);
137
- if (typeof step.instructions === "string" && step.instructions.trim()) {
138
- const instrLines = step.instructions.trim().split("\n");
139
- lines.push(` instructions: ${instrLines[0]}`);
140
- for (const instrLine of instrLines.slice(1))
141
- lines.push(` ${instrLine}`);
142
- }
143
- const completion = Array.isArray(step.completionCriteria) ? step.completionCriteria : [];
144
- if (completion.length > 0) {
145
- lines.push(" completion:");
146
- for (const criterion of completion) {
147
- lines.push(` - ${String(criterion)}`);
148
- }
149
- }
150
- // T2-3: surface run-id as labeled field
151
- const run = typeof result.run === "object" && result.run !== null ? result.run : undefined;
152
- const runId = typeof run?.id === "string" ? run.id : null;
153
- const stepId = typeof step?.id === "string" ? step.id : null;
154
- if (runId) {
155
- lines.push("");
156
- lines.push(`runId: ${runId}`);
157
- }
158
- // T1-6: complete command
159
- if (runId && stepId) {
160
- lines.push("");
161
- lines.push("COMPLETE THIS STEP:");
162
- lines.push(` akm workflow complete '${runId}' --step '${stepId}'`);
163
- }
164
- else if (runId) {
165
- lines.push("");
166
- lines.push("COMPLETE THIS STEP:");
167
- lines.push(` akm workflow complete '${runId}' --step '<step-id>'`);
168
- }
169
- return lines.join("\n");
170
- }
171
111
  export function formatWorkflowRunPlain(result) {
172
112
  const run = typeof result.run === "object" && result.run !== null ? result.run : undefined;
173
113
  if (!run)
@@ -197,6 +137,11 @@ export function formatWorkflowRunPlain(result) {
197
137
  for (const item of missing)
198
138
  lines.push(` missing: ${String(item)}`);
199
139
  }
140
+ if (result.aborted === true) {
141
+ lines.push(result.timedOut === true
142
+ ? "workflow timed out; the run remains resumable."
143
+ : "workflow interrupted; the run remains resumable.");
144
+ }
200
145
  if (result.done === true)
201
146
  lines.push("workflow completed.");
202
147
  return lines.join("\n");
@@ -2,13 +2,9 @@
2
2
  // License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  // file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
4
  // Output text formatters for all `akm workflow *` commands.
5
- import { formatWorkflowBriefPlain, formatWorkflowCompleteRejectedPlain, formatWorkflowCreatePlain, formatWorkflowListPlain, formatWorkflowNextPlain, formatWorkflowResumePlain, formatWorkflowRunPlain, formatWorkflowStatusPlain, } from "./helpers.js";
5
+ import { formatWorkflowBriefPlain, formatWorkflowCreatePlain, formatWorkflowListPlain, formatWorkflowResumePlain, formatWorkflowRunPlain, formatWorkflowStatusPlain, } from "./helpers.js";
6
6
  export const workflowFormatters = [
7
- { command: "workflow-start", handler: (r) => formatWorkflowStatusPlain(r) },
8
7
  { command: "workflow-status", handler: (r) => formatWorkflowStatusPlain(r) },
9
- { command: "workflow-complete", handler: (r) => formatWorkflowStatusPlain(r) },
10
- { command: "workflow-complete-rejected", handler: (r) => formatWorkflowCompleteRejectedPlain(r) },
11
- { command: "workflow-next", handler: (r) => formatWorkflowNextPlain(r) },
12
8
  { command: "workflow-list", handler: (r) => formatWorkflowListPlain(r) },
13
9
  { command: "workflow-create", handler: (r) => formatWorkflowCreatePlain(r) },
14
10
  { command: "workflow-resume", handler: (r) => formatWorkflowResumePlain(r) },