@astrosheep/keiyaku 2.9.3 → 2.9.5
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/build/.tsbuildinfo +1 -1
- package/build/agents/call-terms.js +14 -94
- package/build/agents/harness/activity-values.js +16 -0
- package/build/agents/harness/event-persistence.js +218 -0
- package/build/agents/harness/execution-handle.js +26 -222
- package/build/agents/harness/index.js +3 -1
- package/build/agents/harness/outcome.js +68 -5
- package/build/agents/harness/projection.js +179 -124
- package/build/agents/harness/provider-adapter.js +58 -0
- package/build/agents/harness/router.js +11 -187
- package/build/agents/harness/runtime.js +17 -4
- package/build/agents/harness/session.js +15 -0
- package/build/agents/launch-snapshot/model.js +15 -236
- package/build/agents/launch-snapshot/parse-helpers.js +114 -0
- package/build/agents/launch-snapshot/resolve.js +17 -43
- package/build/agents/opencode-sdk.js +45 -12
- package/build/agents/providers/claude-agent-sdk/adapter.js +6 -17
- package/build/agents/providers/claude-agent-sdk/registration.js +214 -0
- package/build/agents/providers/claude-agent-sdk/session-schema.js +2 -0
- package/build/agents/providers/codex-app-server/adapter.js +82 -53
- package/build/agents/providers/codex-app-server/events.js +90 -11
- package/build/agents/providers/codex-app-server/identity.js +1 -0
- package/build/agents/providers/codex-app-server/policy.js +29 -0
- package/build/agents/providers/codex-app-server/registration.js +248 -0
- package/build/agents/providers/codex-app-server/session-schema.js +6 -0
- package/build/agents/providers/codex-app-server/session.js +23 -17
- package/build/agents/providers/codex-app-server/terms.js +1 -0
- package/build/agents/providers/opencode-sdk/adapter.js +94 -50
- package/build/agents/providers/opencode-sdk/events.js +8 -4
- package/build/agents/providers/opencode-sdk/registration.js +135 -0
- package/build/agents/providers/opencode-sdk/session-schema.js +2 -0
- package/build/agents/providers/opencode-sdk/session.js +21 -14
- package/build/agents/providers/opencode-sdk/terms.js +1 -0
- package/build/agents/providers/pi/adapter.js +36 -30
- package/build/agents/providers/pi/events.js +4 -3
- package/build/agents/providers/pi/registration.js +145 -0
- package/build/agents/providers/pi/session-schema.js +6 -0
- package/build/agents/providers/pi/terms.js +1 -0
- package/build/agents/providers/registration.js +7 -0
- package/build/agents/providers/registry.js +76 -0
- package/build/agents/selector.js +2 -29
- package/build/agents/types.js +10 -0
- package/build/artifact-directories.js +22 -0
- package/build/cli/commands/akuma/akuma/handler.js +1 -1
- package/build/cli/commands/akuma/akuma/meta.js +1 -1
- package/build/cli/commands/akuma/list/meta-ls.js +1 -1
- package/build/cli/commands/akuma/view/handler.js +5 -4
- package/build/cli/commands/akuma/view/meta.js +1 -1
- package/build/cli/commands/akuma.js +6 -0
- package/build/cli/commands/contract/amend/handler.js +8 -2
- package/build/cli/commands/contract/amend/meta.js +4 -4
- package/build/cli/commands/contract/arc/handler.js +8 -2
- package/build/cli/commands/contract/arc/meta.js +4 -4
- package/build/cli/commands/contract/audit/handler.js +16 -0
- package/build/cli/commands/contract/audit/meta.js +16 -0
- package/build/cli/commands/contract/bind/handler.js +4 -3
- package/build/cli/commands/contract/bind/meta.js +44 -8
- package/build/cli/commands/contract/catalog.js +2 -0
- package/build/cli/commands/contract/forfeit/handler.js +4 -4
- package/build/cli/commands/contract/forfeit/meta.js +1 -1
- package/build/cli/commands/contract/log/handler.js +3 -3
- package/build/cli/commands/contract/log/meta.js +1 -1
- package/build/cli/commands/contract/petition/handler.js +5 -8
- package/build/cli/commands/contract/petition/meta.js +6 -6
- package/build/cli/commands/contract/renew/handler.js +20 -6
- package/build/cli/commands/contract/renew/meta.js +6 -5
- package/build/cli/commands/metadata.js +59 -0
- package/build/cli/commands/projection/call/handler.js +6 -5
- package/build/cli/commands/projection/call/meta.js +4 -1
- package/build/cli/commands/projection/kill/handler.js +16 -32
- package/build/cli/commands/projection/kill/meta.js +1 -1
- package/build/cli/commands/projection/revive/meta.js +4 -1
- package/build/cli/commands/projection/shared.js +28 -0
- package/build/cli/commands/projection/status/handler.js +1 -1
- package/build/cli/commands/projection/status/meta.js +1 -1
- package/build/cli/commands/projection/tell/handler.js +14 -30
- package/build/cli/commands/projection/tell/meta.js +4 -1
- package/build/cli/commands/projection/wait/handler.js +45 -22
- package/build/cli/commands/projection/wait/meta.js +8 -3
- package/build/cli/commands/registry.js +2 -54
- package/build/cli/commands/shared.js +10 -7
- package/build/cli/commands/skills/install/handler.js +2 -5
- package/build/cli/commands/skills/install/meta.js +1 -1
- package/build/cli/commands/skills/skills/handler.js +1 -1
- package/build/cli/commands/skills/skills/meta.js +1 -1
- package/build/cli/commands/system/completion/meta.js +1 -1
- package/build/cli/commands/system/dump-env/meta.js +1 -1
- package/build/cli/commands/system/guide/meta.js +1 -1
- package/build/cli/commands/task/add/handler.js +7 -15
- package/build/cli/commands/task/add/meta.js +4 -1
- package/build/cli/commands/task/catalog.js +2 -2
- package/build/cli/commands/task/doctor/meta.js +1 -1
- package/build/cli/commands/task/done/handler.js +4 -8
- package/build/cli/commands/task/done/meta.js +1 -1
- package/build/cli/commands/task/drop/handler.js +3 -6
- package/build/cli/commands/task/drop/meta.js +1 -1
- package/build/cli/commands/task/ls/handler.js +12 -8
- package/build/cli/commands/task/ls/meta.js +3 -3
- package/build/cli/commands/task/shared.js +14 -4
- package/build/cli/commands/task/{view → show}/handler.js +7 -8
- package/build/cli/commands/task/show/meta.js +8 -0
- package/build/cli/commands/task/start/handler.js +3 -6
- package/build/cli/commands/task/start/meta.js +1 -1
- package/build/cli/commands/task/stop/handler.js +4 -8
- package/build/cli/commands/task/stop/meta.js +1 -1
- package/build/cli/commands/task/task/handler.js +1 -1
- package/build/cli/commands/task/task/meta.js +1 -1
- package/build/cli/commands/task/update/handler.js +6 -11
- package/build/cli/commands/task/update/meta.js +4 -1
- package/build/cli/completion.js +1 -1
- package/build/cli/flags.js +37 -6
- package/build/cli/help.js +7 -14
- package/build/cli/index.js +112 -154
- package/build/cli/missing-subcommand.js +7 -0
- package/build/cli/output-stream-error-policy.js +19 -5
- package/build/cli/parse-flags.js +33 -7
- package/build/cli/parse-metadata.js +3 -9
- package/build/cli/parse-selectors.js +2 -1
- package/build/cli/parse.js +35 -5
- package/build/cli/projection-address.js +12 -12
- package/build/cli/render/address.js +41 -37
- package/build/cli/render/arc.js +24 -12
- package/build/cli/render/audit.js +121 -0
- package/build/cli/render/call.js +11 -5
- package/build/cli/render/errors.js +36 -1
- package/build/cli/render/format.js +4 -0
- package/build/cli/render/kanshi.js +6 -12
- package/build/cli/render/kill.js +9 -0
- package/build/cli/render/misc.js +58 -13
- package/build/cli/render/petition.js +20 -15
- package/build/cli/render/projection-activity.js +15 -6
- package/build/cli/render/shared.js +60 -21
- package/build/cli/render/skills.js +10 -0
- package/build/cli/render/status.js +56 -23
- package/build/cli/render/success-response.js +78 -0
- package/build/cli/render/task.js +66 -57
- package/build/cli/render/tell.js +5 -0
- package/build/cli/render/terminal-failure.js +63 -0
- package/build/cli/render/types.js +1 -0
- package/build/cli/render/wait.js +68 -38
- package/build/cli/types.js +1 -1
- package/build/config/akuma-loader.js +0 -5
- package/build/config/env-keys.js +3 -1
- package/build/config/env.js +3 -0
- package/build/config/provider-policy-ownership.js +3 -32
- package/build/config/settings/disease.js +8 -1
- package/build/config/settings/loader.js +11 -3
- package/build/config/settings/provider-instance-fields.js +51 -0
- package/build/config/settings/schema.js +6 -176
- package/build/core/addressing.js +66 -16
- package/build/core/amend.js +61 -18
- package/build/core/arc.js +33 -73
- package/build/core/audit.js +650 -0
- package/build/core/bind.js +82 -35
- package/build/core/call/call.js +15 -9
- package/build/core/call/context.js +6 -51
- package/build/core/call/execution.js +22 -22
- package/build/core/call/prompt.js +14 -1
- package/build/core/command-markdown.js +45 -0
- package/build/core/context.js +13 -7
- package/build/core/contract-view.js +22 -6
- package/build/core/draft.js +139 -19
- package/build/core/entry.js +3 -4
- package/build/core/forfeit.js +5 -2
- package/build/core/hints.js +1 -75
- package/build/core/identifier-slug.js +66 -0
- package/build/core/ids.js +25 -11
- package/build/core/ledger.js +20 -68
- package/build/core/markdown/lex.js +2 -1
- package/build/core/markdown/parser.js +0 -68
- package/build/core/markdown/render.js +68 -0
- package/build/core/markdown/sections.js +2 -1
- package/build/core/outcome-base.js +4 -0
- package/build/core/projection/generation/database.js +41 -52
- package/build/core/projection/generation/model.js +63 -2
- package/build/core/{projection-generation-continuation.js → projection/generation/projection-generation-continuation.js} +3 -3
- package/build/core/{projection-generation-execution.js → projection/generation/projection-generation-execution.js} +36 -53
- package/build/core/{projection-generation-identity.js → projection/generation/projection-generation-identity.js} +2 -2
- package/build/core/{projection-generation-launcher.js → projection/generation/projection-generation-launcher.js} +9 -7
- package/build/core/{projection-generation-process.js → projection/generation/projection-generation-process.js} +2 -1
- package/build/core/{projection-generation-runner.js → projection/generation/projection-generation-runner.js} +19 -3
- package/build/core/projection/generation/store.js +3 -3
- package/build/core/projection/generation/transitions.js +19 -3
- package/build/core/projection/index.js +27 -0
- package/build/core/{projection-activity.js → projection/projection-activity.js} +12 -0
- package/build/core/{projection-alias.js → projection/projection-alias.js} +13 -13
- package/build/core/projection/projection-coordinate.js +61 -0
- package/build/core/{projection-core.js → projection/projection-core.js} +9 -9
- package/build/core/{projection-execution-observer.js → projection/projection-execution-observer.js} +37 -78
- package/build/core/{projection-identity.js → projection/projection-identity.js} +1 -1
- package/build/core/{projection-kill.js → projection/projection-kill.js} +1 -1
- package/build/core/{projection-life-observer.js → projection/projection-life-observer.js} +16 -2
- package/build/core/{projection-mint.js → projection/projection-mint.js} +10 -10
- package/build/core/{projection-status.js → projection/projection-status.js} +163 -45
- package/build/core/projection/projection-terminal-failure.js +106 -0
- package/build/core/projection/projection-wait.js +275 -0
- package/build/core/projection/projection-wake.js +227 -0
- package/build/core/provider-loader-ports.js +4 -0
- package/build/core/ref-log.js +65 -40
- package/build/core/registry.js +63 -10
- package/build/core/renew-session.js +128 -0
- package/build/core/renew.js +448 -102
- package/build/core/scope.js +272 -68
- package/build/core/seal.js +165 -40
- package/build/core/{claim-delivery.js → settlement/claim-delivery.js} +8 -8
- package/build/core/{claim.js → settlement/claim.js} +32 -8
- package/build/core/settlement/index.js +19 -0
- package/build/core/{petition-claim-gates.js → settlement/petition-claim-gates.js} +24 -49
- package/build/core/{petition-forfeit.js → settlement/petition-forfeit.js} +2 -2
- package/build/core/{petition-head-guard.js → settlement/petition-head-guard.js} +2 -2
- package/build/core/settlement/petition-io.js +1 -0
- package/build/core/{petition-preview.js → settlement/petition-preview.js} +2 -2
- package/build/core/{petition.js → settlement/petition.js} +21 -12
- package/build/core/settlement/queue-read-model.js +143 -0
- package/build/core/settlement/queue-seat-allocation.js +156 -0
- package/build/core/settlement/queue.js +6 -0
- package/build/core/settlement/settlement.js +288 -0
- package/build/core/{verdict.js → settlement/verdict.js} +9 -37
- package/build/core/settlement/verification.js +59 -0
- package/build/core/status/board.js +62 -41
- package/build/core/status/ledger-batch.js +158 -0
- package/build/core/status/reconciliation.js +10 -4
- package/build/core/stored-agent-event.js +6 -2
- package/build/core/task/board.js +41 -4
- package/build/core/task/commands.js +45 -28
- package/build/core/task/document.js +5 -0
- package/build/core/task/index.js +12 -0
- package/build/core/task/model.js +8 -1
- package/build/core/task/query.js +172 -0
- package/build/core/task/settlement-git.js +265 -74
- package/build/core/task/settlement-policy.js +67 -29
- package/build/core/task/source-board.js +1 -0
- package/build/core/task/task-contract.js +444 -0
- package/build/core/{task-doctor.js → task/task-doctor.js} +1 -1
- package/build/core/{task-git-actor.js → task/task-git-actor.js} +5 -10
- package/build/core/{task-git-runtime.js → task/task-git-runtime.js} +3 -3
- package/build/core/{task-git-store.js → task/task-git-store.js} +90 -19
- package/build/core/task/task-repository.js +1 -0
- package/build/core/{task-store-repository.js → task/task-store-repository.js} +6 -4
- package/build/core/task/task-store.js +1 -0
- package/build/core/{task-worktree.js → task/task-worktree.js} +2 -1
- package/build/core/task/task.js +7 -0
- package/build/core/task/tree.js +37 -0
- package/build/core/task/validation.js +5 -2
- package/build/core/transcripts.js +15 -3
- package/build/core/worktree-path.js +43 -28
- package/build/flow-error.js +83 -39
- package/build/fs/path-coordinate.js +16 -0
- package/build/generated/version.js +3 -2
- package/build/git/branches.js +2 -1
- package/build/git/core.js +106 -2
- package/build/git/diff/parsers.js +23 -13
- package/build/git/diff/structured.js +127 -0
- package/build/git/path-coordinate.js +17 -0
- package/build/git/refs.js +57 -0
- package/build/git/streaming-batch.js +301 -0
- package/build/git/worktree.js +65 -0
- package/build/index.js +9 -9
- package/build/keiyaku.js +2 -36
- package/build/telemetry/logger.js +4 -2
- package/package.json +4 -10
- package/skills/keiyaku/SKILL.md +5 -4
- package/skills/keiyaku-akuma/SKILL.md +25 -11
- package/skills/keiyaku-task/SKILL.md +17 -8
- package/skills/keiyaku-workflow/SKILL.md +58 -9
- package/build/agents/providers/codex-sdk.js +0 -329
- package/build/cli/commands/task/view/meta.js +0 -8
- package/build/core/command-io.js +0 -174
- package/build/core/path-coordinate.js +0 -27
- package/build/core/petition-claim.js +0 -117
- package/build/core/petition-run.js +0 -83
- package/build/core/projection-coordinate.js +0 -63
- package/build/core/projection-wait.js +0 -165
- package/build/core/projection-wake.js +0 -136
- package/build/core/queue.js +0 -343
- package/build/core/task-contract.js +0 -237
- package/build/core/task.js +0 -4
- /package/build/{core/task-repository.js → agents/launch-snapshot/types.js} +0 -0
- /package/build/{core/task-store.js → agents/providers/claude-agent-sdk/terms.js} +0 -0
- /package/build/core/{projection-generation-runtime.js → projection/generation/projection-generation-runtime.js} +0 -0
- /package/build/core/{projection-life-protocol.js → projection/projection-life-protocol.js} +0 -0
- /package/build/core/{projection-runner-lock.js → projection/projection-runner-lock.js} +0 -0
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { textResponse } from "../../../render/shared.js";
|
|
5
|
-
import { effectiveDirectory } from "../../shared.js";
|
|
6
|
-
export const handler = async (_stdin, flags, _signal, positional) => textResponse(renderTaskMutationRow(await dropTask(await openTaskCommandRepository(effectiveDirectory(flags)), positional[0])));
|
|
1
|
+
import { dropTask } from "../../../../core/task/index.js";
|
|
2
|
+
import { runTaskMutationCommand } from "../shared.js";
|
|
3
|
+
export const handler = async (_stdin, flags, _signal, positional) => runTaskMutationCommand(flags, (repository) => dropTask(repository, positional[0]));
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { renderTaskList, renderTaskListJson } from "../../../render/task.js";
|
|
1
|
+
import { readTaskBoard, selectTaskList } from "../../../../core/task/index.js";
|
|
2
|
+
import { renderSelectedTaskList, renderSelectedTaskListJson } from "../../../render/task.js";
|
|
4
3
|
import { textResponse } from "../../../render/shared.js";
|
|
5
|
-
import {
|
|
6
|
-
import { taskJsonText, taskSelection } from "../shared.js";
|
|
4
|
+
import { taskJsonText, taskSelection, withTaskCommandRepository } from "../shared.js";
|
|
7
5
|
export const handler = async (_stdin, flags) => {
|
|
8
|
-
const board = await
|
|
6
|
+
const board = await withTaskCommandRepository(flags, (repository) => readTaskBoard(repository));
|
|
9
7
|
const selection = taskSelection(flags);
|
|
8
|
+
const tasks = selectTaskList(board.tasks, {
|
|
9
|
+
selection,
|
|
10
|
+
filters: flags.taskFilters,
|
|
11
|
+
sort: flags.taskSort,
|
|
12
|
+
nowMs: Date.now(),
|
|
13
|
+
});
|
|
10
14
|
return textResponse(flags.json
|
|
11
|
-
? taskJsonText(
|
|
12
|
-
:
|
|
15
|
+
? taskJsonText(renderSelectedTaskListJson(tasks))
|
|
16
|
+
: renderSelectedTaskList(tasks));
|
|
13
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const meta = {
|
|
2
2
|
command: "task ls",
|
|
3
3
|
summary: "List tasks",
|
|
4
|
-
usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--json]"],
|
|
5
|
-
stdin: "
|
|
6
|
-
flags: ["cwd", "all", "done", "json"],
|
|
4
|
+
usage: ["keiyaku task ls [-C|--cwd DIR] [--all|--done] [--filter EXPR] [--sort KEYS] [--json]"],
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
|
+
flags: ["cwd", "all", "done", "filter", "sort", "json"],
|
|
7
7
|
purpose: "List tasks from the working-tree board.",
|
|
8
8
|
};
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import * as path from "node:path";
|
|
2
2
|
import { FlowError } from "../../../flow-error.js";
|
|
3
|
-
import { readTaskDoctor, taskCommandContractId } from "../../../core/task
|
|
4
|
-
import { deriveTaskDisplay, renderTaskList, } from "../../render/task.js";
|
|
5
|
-
import {
|
|
3
|
+
import { isTaskId, openTaskCommandRepository, parseTaskDocument, readTaskDoctor, taskCommandContractId, } from "../../../core/task/index.js";
|
|
4
|
+
import { deriveTaskDisplay, renderTaskList, renderTaskMutationRow, } from "../../render/task.js";
|
|
5
|
+
import { textResponse } from "../../render/shared.js";
|
|
6
|
+
import { effectiveDirectory } from "../shared.js";
|
|
7
|
+
/** Open the task command repository for flags.cwd and run the verb. */
|
|
8
|
+
export async function withTaskCommandRepository(flags, run) {
|
|
9
|
+
const cwd = effectiveDirectory(flags);
|
|
10
|
+
return run(await openTaskCommandRepository(cwd), cwd);
|
|
11
|
+
}
|
|
12
|
+
/** Shared shell: open repository → mutate → renderTaskMutationRow receipt. */
|
|
13
|
+
export async function runTaskMutationCommand(flags, mutate) {
|
|
14
|
+
return textResponse(renderTaskMutationRow(await withTaskCommandRepository(flags, mutate)));
|
|
15
|
+
}
|
|
6
16
|
export function parseTaskAddInput(input) {
|
|
7
17
|
if (!input.trim())
|
|
8
18
|
throw new FlowError("EMPTY_PARAM", "task add input cannot be blank");
|
|
@@ -49,7 +59,7 @@ function renderTaskDiseaseRows(diseases, documents) {
|
|
|
49
59
|
for (const disease of diseases) {
|
|
50
60
|
if (disease.code === "invalid_document") {
|
|
51
61
|
const name = path.basename(disease.path).replace(/\.md$/, "");
|
|
52
|
-
if (
|
|
62
|
+
if (isTaskId(name))
|
|
53
63
|
rows.push(`! ${name} invalid front matter — quarantined`);
|
|
54
64
|
continue;
|
|
55
65
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { FlowError } from "../../../../flow-error.js";
|
|
2
|
-
import {
|
|
3
|
-
import { readTaskBoard, resolveTaskReadId } from "../../../../core/task.js";
|
|
2
|
+
import { buildTaskTree, readTaskBoard, resolveTaskReadId, } from "../../../../core/task/index.js";
|
|
4
3
|
import { renderTaskShow, renderTaskShowJson } from "../../../render/task.js";
|
|
5
4
|
import { textResponse } from "../../../render/shared.js";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const board = await readTaskBoard(await openTaskCommandRepository(effectiveDirectory(flags)));
|
|
5
|
+
import { taskJsonText, withTaskCommandRepository } from "../shared.js";
|
|
6
|
+
export const handler = async (_stdin, flags, _signal, positional) => withTaskCommandRepository(flags, async (repository) => {
|
|
7
|
+
const board = await readTaskBoard(repository);
|
|
10
8
|
const task = board.byId.get(resolveTaskReadId(board, positional[0]));
|
|
11
9
|
if (!task)
|
|
12
10
|
throw new FlowError("INTERNAL_STATE", "resolved task disappeared from the board");
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const tree = buildTaskTree(board, task.id);
|
|
12
|
+
return textResponse(flags.json ? taskJsonText(renderTaskShowJson(task, tree)) : renderTaskShow(task, tree));
|
|
13
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
command: "task show",
|
|
3
|
+
summary: "Show one task and its children tree",
|
|
4
|
+
usage: ["keiyaku task show [-C|--cwd DIR] ID [--json]"],
|
|
5
|
+
stdin: { mode: "argument" },
|
|
6
|
+
flags: ["cwd", "json"],
|
|
7
|
+
purpose: "Read one task and every descendant linked by parent edges.",
|
|
8
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { textResponse } from "../../../render/shared.js";
|
|
5
|
-
import { effectiveDirectory } from "../../shared.js";
|
|
6
|
-
export const handler = async (_stdin, flags, _signal, positional) => textResponse(renderTaskMutationRow(await startTask(await openTaskCommandRepository(effectiveDirectory(flags)), positional[0], new Date())));
|
|
1
|
+
import { startTask } from "../../../../core/task/index.js";
|
|
2
|
+
import { runTaskMutationCommand } from "../shared.js";
|
|
3
|
+
export const handler = async (_stdin, flags, _signal, positional) => runTaskMutationCommand(flags, (repository) => startTask(repository, positional[0], new Date()));
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { stopTask } from "../../../../core/task.js";
|
|
3
|
-
import { renderTaskMutationRow } from "../../../render/task.js";
|
|
4
|
-
import { textResponse } from "../../../render/shared.js";
|
|
1
|
+
import { stopTask } from "../../../../core/task/index.js";
|
|
5
2
|
import { effectiveDirectory } from "../../shared.js";
|
|
6
|
-
import { mutationSelectionMessage, rejectBareContractTaskState } from "../shared.js";
|
|
3
|
+
import { mutationSelectionMessage, rejectBareContractTaskState, runTaskMutationCommand } from "../shared.js";
|
|
7
4
|
export const handler = async (_stdin, flags, _signal, positional) => {
|
|
8
5
|
try {
|
|
9
|
-
const cwd = effectiveDirectory(flags);
|
|
10
6
|
if (positional[0] === undefined)
|
|
11
|
-
await rejectBareContractTaskState(
|
|
12
|
-
return
|
|
7
|
+
await rejectBareContractTaskState(effectiveDirectory(flags), "stop");
|
|
8
|
+
return await runTaskMutationCommand(flags, (repository) => stopTask(repository, positional[0]));
|
|
13
9
|
}
|
|
14
10
|
catch (error) {
|
|
15
11
|
return mutationSelectionMessage(error);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { missingSubcommandError } from "../../../
|
|
1
|
+
import { missingSubcommandError } from "../../../missing-subcommand.js";
|
|
2
2
|
import { TASK_SUBCOMMANDS } from "../../../types.js";
|
|
3
3
|
export const handler = async () => {
|
|
4
4
|
throw missingSubcommandError("task", TASK_SUBCOMMANDS);
|
|
@@ -3,7 +3,7 @@ export const meta = {
|
|
|
3
3
|
command: "task",
|
|
4
4
|
summary: "Manage lightweight repository tasks",
|
|
5
5
|
usage: ["keiyaku task <subcommand>"],
|
|
6
|
-
stdin: "
|
|
6
|
+
stdin: { mode: "argument" },
|
|
7
7
|
flags: [],
|
|
8
8
|
purpose: "Manage the file-backed task board.",
|
|
9
9
|
subcommands: TASK_SUBCOMMANDS,
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { effectiveDirectory } from "../../shared.js";
|
|
6
|
-
export const handler = async (stdin, flags, _signal, positional) => {
|
|
7
|
-
const body = flags.taskBody === "-" ? stdin : flags.taskBody;
|
|
8
|
-
const task = await updateTask(await openTaskCommandRepository(effectiveDirectory(flags)), positional[0], {
|
|
1
|
+
import { updateTask } from "../../../../core/task/index.js";
|
|
2
|
+
import { runTaskMutationCommand } from "../shared.js";
|
|
3
|
+
export const handler = async (_stdin, flags, _signal, positional) => {
|
|
4
|
+
return runTaskMutationCommand(flags, (repository) => updateTask(repository, positional[0], {
|
|
9
5
|
...(flags.taskTitle === undefined ? {} : { title: flags.taskTitle }),
|
|
10
|
-
...(
|
|
6
|
+
...(flags.taskBody === undefined ? {} : { body: flags.taskBody }),
|
|
11
7
|
...(flags.taskPri === undefined ? {} : { pri: flags.taskPri }),
|
|
12
8
|
...(flags.taskNeeds === undefined ? {} : { addNeeds: flags.taskNeeds }),
|
|
13
9
|
...(flags.taskDropNeeds === undefined ? {} : { dropNeeds: flags.taskDropNeeds }),
|
|
14
10
|
...(flags.taskParent !== undefined ? { parent: flags.taskParent } : flags.taskNoParent ? { parent: null } : {}),
|
|
15
11
|
...(flags.taskFrom === undefined ? {} : { from: flags.taskFrom }),
|
|
16
|
-
});
|
|
17
|
-
return textResponse(renderTaskMutationRow(task));
|
|
12
|
+
}));
|
|
18
13
|
};
|
|
@@ -2,7 +2,10 @@ export const meta = {
|
|
|
2
2
|
command: "task update",
|
|
3
3
|
summary: "Update task facts",
|
|
4
4
|
usage: ["keiyaku task update [-C|--cwd DIR] ID [--title TEXT] [--body TEXT|-] [--pri 0-3] [--needs ID] [--drop-needs ID] [--parent ID|--no-parent] [--from ID]"],
|
|
5
|
-
stdin:
|
|
5
|
+
stdin: {
|
|
6
|
+
mode: "argument",
|
|
7
|
+
selector: { kind: "flag", name: "taskBody", required: false, rejectBlank: false },
|
|
8
|
+
},
|
|
6
9
|
flags: ["cwd", "title", "body", "pri", "needs", "drop-needs", "parent", "no-parent", "from"],
|
|
7
10
|
purpose: "Change mutable task facts.",
|
|
8
11
|
};
|
package/build/cli/completion.js
CHANGED
|
@@ -2,7 +2,7 @@ import { assertSettingsKnobUsable } from "../config/settings/disease.js";
|
|
|
2
2
|
import { loadKeiyakuSettings } from "../config/settings/loader.js";
|
|
3
3
|
import { loadAkumaCatalog } from "../config/akuma-loader.js";
|
|
4
4
|
import { listContractIds } from "../core/ledger.js";
|
|
5
|
-
import { allCommandMetadata, getCommandMetadata } from "./commands/
|
|
5
|
+
import { allCommandMetadata, getCommandMetadata } from "./commands/metadata.js";
|
|
6
6
|
function topLevelCommands() {
|
|
7
7
|
return allCommandMetadata()
|
|
8
8
|
.filter((meta) => meta.completionRank !== undefined)
|
package/build/cli/flags.js
CHANGED
|
@@ -4,12 +4,12 @@ export const FLAG_SPECS = {
|
|
|
4
4
|
cwd: {
|
|
5
5
|
kind: "value",
|
|
6
6
|
placeholder: "DIR",
|
|
7
|
-
description: "Select the effective command directory (-C/--cwd). Defaults to the process working directory.",
|
|
7
|
+
description: "Select the effective command directory (-C/--cwd). Defaults to the process working directory; the repository is inferred from here unless --repo is set.",
|
|
8
8
|
},
|
|
9
9
|
repo: {
|
|
10
10
|
kind: "value",
|
|
11
11
|
placeholder: "DIR",
|
|
12
|
-
description: "
|
|
12
|
+
description: "Override the repository inferred from the effective directory. Needed only when the contract ledger lives in a different repository; the same value as -C is always redundant.",
|
|
13
13
|
},
|
|
14
14
|
contract: {
|
|
15
15
|
kind: "value",
|
|
@@ -46,6 +46,10 @@ export const FLAG_SPECS = {
|
|
|
46
46
|
placeholder: "DURATION",
|
|
47
47
|
description: "Wait at most a positive duration such as 45s, 5m, or 2h (maximum 24h).",
|
|
48
48
|
},
|
|
49
|
+
any: {
|
|
50
|
+
kind: "boolean",
|
|
51
|
+
description: "For a projection set, return when the first observed member reaches a terminal state.",
|
|
52
|
+
},
|
|
49
53
|
wait: {
|
|
50
54
|
kind: "value",
|
|
51
55
|
placeholder: "DURATION",
|
|
@@ -57,7 +61,7 @@ export const FLAG_SPECS = {
|
|
|
57
61
|
},
|
|
58
62
|
bare: {
|
|
59
63
|
kind: "boolean",
|
|
60
|
-
description: "
|
|
64
|
+
description: "Explicitly select standalone execution (also the default without --contract); history, sandbox, credentials, projection, and repository policy remain active.",
|
|
61
65
|
},
|
|
62
66
|
detach: {
|
|
63
67
|
kind: "boolean",
|
|
@@ -114,10 +118,22 @@ export const FLAG_SPECS = {
|
|
|
114
118
|
kind: "boolean",
|
|
115
119
|
description: "Preview bind input or petition preflight without mutation.",
|
|
116
120
|
},
|
|
117
|
-
|
|
121
|
+
"append-scope": {
|
|
118
122
|
kind: "value",
|
|
119
|
-
placeholder: "
|
|
120
|
-
description: "
|
|
123
|
+
placeholder: "PATTERN",
|
|
124
|
+
description: "Append one ordered scope pattern to the contract before audit. May be repeated.",
|
|
125
|
+
},
|
|
126
|
+
resolve: {
|
|
127
|
+
kind: "boolean",
|
|
128
|
+
description: "Open a durable Keiyaku-owned renew recovery session when the rewrite conflicts.",
|
|
129
|
+
},
|
|
130
|
+
continue: {
|
|
131
|
+
kind: "boolean",
|
|
132
|
+
description: "Continue the open Keiyaku-owned renew recovery session.",
|
|
133
|
+
},
|
|
134
|
+
abort: {
|
|
135
|
+
kind: "boolean",
|
|
136
|
+
description: "Restore and remove the open Keiyaku-owned renew recovery session.",
|
|
121
137
|
},
|
|
122
138
|
shell: {
|
|
123
139
|
kind: "value",
|
|
@@ -151,10 +167,25 @@ export const FLAG_SPECS = {
|
|
|
151
167
|
kind: "boolean",
|
|
152
168
|
description: "Render task data as JSON.",
|
|
153
169
|
},
|
|
170
|
+
"diff-budget": {
|
|
171
|
+
kind: "value",
|
|
172
|
+
placeholder: "BYTES",
|
|
173
|
+
description: "Set the audit raw-diff presentation budget in bytes.",
|
|
174
|
+
},
|
|
154
175
|
done: {
|
|
155
176
|
kind: "boolean",
|
|
156
177
|
description: "Show terminal tasks.",
|
|
157
178
|
},
|
|
179
|
+
filter: {
|
|
180
|
+
kind: "value",
|
|
181
|
+
placeholder: "FIELD OP VALUE",
|
|
182
|
+
description: "Filter structured task facts. Repeat for AND; comma-separated values are OR.",
|
|
183
|
+
},
|
|
184
|
+
sort: {
|
|
185
|
+
kind: "value",
|
|
186
|
+
placeholder: "KEY[,KEY...]",
|
|
187
|
+
description: "Sort by priority ascending, modified descending, or created descending.",
|
|
188
|
+
},
|
|
158
189
|
pri: {
|
|
159
190
|
kind: "value",
|
|
160
191
|
placeholder: "0-3",
|
package/build/cli/help.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export function formatSubcommandList(subcommands) {
|
|
4
|
-
return subcommands.length < 2 ? (subcommands[0] ?? "") : `${subcommands.slice(0, -1).join(", ")} or ${subcommands.at(-1)}`;
|
|
5
|
-
}
|
|
6
|
-
export function missingSubcommandError(name, subcommands) {
|
|
7
|
-
return new FlowError("EMPTY_PARAM", `${name} requires subcommand: ${formatSubcommandList(subcommands)}`);
|
|
8
|
-
}
|
|
1
|
+
import { CLI_COMMAND_METADATA, getCommandMetadata } from "./commands/metadata.js";
|
|
2
|
+
export { formatSubcommandList, missingSubcommandError } from "./missing-subcommand.js";
|
|
9
3
|
function indent(lines) {
|
|
10
4
|
return lines.map((line) => line ? ` ${line}` : "");
|
|
11
5
|
}
|
|
@@ -21,15 +15,14 @@ function flagUsage(name, specs) {
|
|
|
21
15
|
}
|
|
22
16
|
return spec?.kind === "value" ? `--${name} ${spec.placeholder ?? "VALUE"}` : `--${name}`;
|
|
23
17
|
}
|
|
24
|
-
|
|
25
|
-
export const CLI_COMMAND_METADATA = Object.fromEntries(allCommandMetadata().map((meta) => [meta.command, meta]));
|
|
18
|
+
export { CLI_COMMAND_METADATA };
|
|
26
19
|
export function renderCliCommandHelp(_command, spec, flagSpecs) {
|
|
27
20
|
const lines = ["Keiyaku command help", "", `${spec.command} - ${spec.summary}`, ""];
|
|
28
21
|
section(lines, "Usage:", spec.usage);
|
|
29
22
|
section(lines, "Purpose:", [spec.purpose]);
|
|
30
23
|
section(lines, "Subcommands:", spec.subcommands);
|
|
31
24
|
section(lines, "Input:", spec.input);
|
|
32
|
-
section(lines, "Options:", spec.flags.map((name) => `${flagUsage(name, flagSpecs)} ${flagSpecs[name]?.description ?? ""}`));
|
|
25
|
+
section(lines, "Options:", spec.flags.map((name) => `${flagUsage(name, flagSpecs)} ${spec.flagDescriptions?.[name] ?? flagSpecs[name]?.description ?? ""}`));
|
|
33
26
|
section(lines, "Notes:", spec.notes);
|
|
34
27
|
section(lines, "Examples:", spec.examples);
|
|
35
28
|
return lines.join("\n").trimEnd();
|
|
@@ -69,9 +62,9 @@ export function renderCliHelp(version) {
|
|
|
69
62
|
"",
|
|
70
63
|
"Input:",
|
|
71
64
|
" <> means required; [] means optional.",
|
|
72
|
-
" bind, arc, and
|
|
73
|
-
" call and tell require literal BODY or `-`;
|
|
74
|
-
" revive accepts an artifact plus optional BODY or `-`;
|
|
65
|
+
" bind, arc, amend, and petition read document stdin only when literal `-` selects it.",
|
|
66
|
+
" call and tell require literal BODY or `-`; literal `-` selects stdin.",
|
|
67
|
+
" revive accepts an artifact plus optional BODY or `-`; unselected stdin is ignored.",
|
|
75
68
|
"",
|
|
76
69
|
"Configuration:",
|
|
77
70
|
" Akuma profiles <KEIYAKU_HOME>/akuma/*.md or .keiyaku/akuma/*.md",
|