@mingchuno/agent-workflows 0.2.0 → 0.3.0
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/README.md +6 -1
- package/dist/src/attribution.d.ts +9 -0
- package/dist/src/attribution.js +57 -0
- package/dist/src/cli.js +47 -13
- package/dist/src/config.d.ts +2 -8
- package/dist/src/config.js +1 -1
- package/dist/src/domain.d.ts +7 -0
- package/dist/src/invocation.d.ts +4 -3
- package/dist/src/invocation.js +6 -3
- package/dist/src/operations.d.ts +1 -0
- package/dist/src/operations.js +25 -3
- package/dist/src/runner.d.ts +2 -0
- package/dist/src/runner.js +28 -3
- package/dist/src/tui/data.d.ts +2 -1
- package/dist/src/tui/data.js +7 -2
- package/dist/src/tui/index.d.ts +1 -0
- package/dist/src/tui/index.js +1 -0
- package/dist/src/tui/layout.d.ts +1 -1
- package/dist/src/tui/layout.js +2 -2
- package/dist/src/tui/monitor.d.ts +3 -1
- package/dist/src/tui/monitor.js +93 -31
- package/dist/src/tui/notifications.d.ts +23 -0
- package/dist/src/tui/notifications.js +104 -0
- package/dist/src/tui/views.d.ts +10 -2
- package/dist/src/tui/views.js +272 -42
- package/dist/src/workspace.js +21 -8
- package/docs/api.md +15 -4
- package/docs/configuration.md +50 -9
- package/docs/operations.md +45 -5
- package/examples/config.ts +4 -4
- package/examples/run.ts +4 -1
- package/package.json +1 -1
package/docs/operations.md
CHANGED
|
@@ -15,7 +15,7 @@ All commands accept `--config PATH` before the subcommand.
|
|
|
15
15
|
| `stop RUN` | Queue cancellation; success means active local work has stopped |
|
|
16
16
|
| `recover RUN` | Continue a failed publication step using completed checkpoints |
|
|
17
17
|
| `retry RUN` | Queue an explicit new attempt after checkout validation |
|
|
18
|
-
| `monitor`
|
|
18
|
+
| `monitor [--notify]` | Attach an interactive terminal view; optionally alert on outcomes |
|
|
19
19
|
|
|
20
20
|
Control commands return a command ID and `pending`; inspect `status --json` or the monitor for success/failure. With no runner, commands stay pending. Run and monitor are separate processes. Closing the monitor never cancels work. Ctrl-C on the runner stops intake, cancels active work, waits for process termination and releases ownership. Queued issues remain durable for the next start.
|
|
21
21
|
|
|
@@ -27,10 +27,37 @@ prove that a runner is alive. Requires an interactive terminal of at least
|
|
|
27
27
|
compact terminals show the focused pane. Titles and identifiers are available
|
|
28
28
|
in full in scrollable details. `NO_COLOR=1` disables semantic colors.
|
|
29
29
|
|
|
30
|
+
`monitor --notify` emits one desktop notification when an Execution first
|
|
31
|
+
reaches `completed`, `failed`, `blocked`, `cancelled`, `no-change` or
|
|
32
|
+
`ineligible` during that monitor session. The initial snapshot is silent;
|
|
33
|
+
later terminal Executions are detected across every visible project, including
|
|
34
|
+
Executions first seen after a database reconnection. Delivery uses OSC 9 and is
|
|
35
|
+
best-effort: notifications are not persisted, retried or acknowledged, and a
|
|
36
|
+
terminal write failure does not affect monitoring or workflow state. Current
|
|
37
|
+
iTerm2, Kitty, WezTerm and Ghostty releases are supported; other OSC 9
|
|
38
|
+
implementations may work, while Windows Terminal is not supported in this
|
|
39
|
+
version. Terminal permissions and settings determine whether an alert appears,
|
|
40
|
+
including whether foreground alerts are suppressed.
|
|
41
|
+
|
|
42
|
+
The notification payload is display-only and contains only
|
|
43
|
+
`agent-workflows: <project> · <issue reference> · <outcome>`. It excludes issue
|
|
44
|
+
titles, diagnostics, paths and internal Run, Execution and session identifiers.
|
|
45
|
+
Under tmux, the monitor emits one layer of DCS passthrough wrapping. tmux 3.3
|
|
46
|
+
and later requires `set -g allow-passthrough on`; the CLI does not change tmux
|
|
47
|
+
configuration.
|
|
48
|
+
|
|
49
|
+
Run details is one responsive, vertically scrollable document. It leads with
|
|
50
|
+
the issue, outcome, phase, attempt, total elapsed time and branch, and adds an
|
|
51
|
+
attention summary only when operator action may be required. At 140 columns
|
|
52
|
+
and above, execution history appears beside validation and agent-session
|
|
53
|
+
evidence; narrower terminals stack those sections in the same reading order.
|
|
54
|
+
The primary design target is 160×48, with 80×24 retained as the functional
|
|
55
|
+
fallback. An overflowing document shows its visible line range in the heading.
|
|
56
|
+
|
|
30
57
|
| Context | Keys |
|
|
31
58
|
| --- | --- |
|
|
32
59
|
| Dashboard | Left/Right project; Tab/Shift+Tab pane; Up/Down selection or scroll |
|
|
33
|
-
| Details | Enter opens; Up/Down or PgUp/PgDn scroll; Esc returns |
|
|
60
|
+
| Details | Enter opens; Up/Down or PgUp/PgDn scroll; Esc returns; `l` opens the latest current-execution session, preferring a running session |
|
|
34
61
|
| Progress | `[`/`]` inspect step history; End follows latest event |
|
|
35
62
|
| Sessions | `a` focuses session list; Up/Down selects invocation; `l` opens log |
|
|
36
63
|
| Validation | `v` opens validation logs |
|
|
@@ -61,8 +88,10 @@ Execution duration includes eligibility, preparation and waits within one
|
|
|
61
88
|
execution. It excludes queue waiting and gaps before publication recovery.
|
|
62
89
|
Details show each execution, its queue wait and the run's total elapsed time.
|
|
63
90
|
Completed execution durations freeze at their first terminal outcome. Records
|
|
64
|
-
without timing evidence
|
|
65
|
-
|
|
91
|
+
without timing evidence use factual labels such as `not started`, `not recorded`
|
|
92
|
+
or `unavailable`. Noninteractive tools use `status --json` and `inspect`. Run
|
|
93
|
+
details keeps complete errors under Diagnostics and exact identifiers, paths,
|
|
94
|
+
profiles and ISO timestamps under Technical details.
|
|
66
95
|
|
|
67
96
|
## Observability Landscape
|
|
68
97
|
|
|
@@ -116,7 +145,14 @@ Git process journals live in `<git-directory>/agent-workflows-processes/`, indep
|
|
|
116
145
|
|
|
117
146
|
Startup and phase boundaries check ownership assumptions, branch/head and actual changes. Unfinished files are never reset, cleaned, stashed or discarded automatically. Dirty files, unresolved Git operations, branch collisions, unexpected mutations and ambiguous agent recovery become inspectable blocked states. Other eligible projects continue.
|
|
118
147
|
|
|
119
|
-
Publication effects have independent DBOS checkpoints. A task commit
|
|
148
|
+
Publication effects have independent DBOS checkpoints. A task commit preserves
|
|
149
|
+
publication trailers, carries exactly one `Agent-Workflows-Run`, and by default
|
|
150
|
+
adds co-author trailers for providers with retained writable contributions.
|
|
151
|
+
Commit reconciliation checks the expected parent, change set, finalized message,
|
|
152
|
+
and clean checkout. Push recovery checks the remote ref, request creation checks
|
|
153
|
+
the source branch, and review publication checks stable markers. Transient
|
|
154
|
+
publication failures use bounded retries and reconciliation. Interrupted agent
|
|
155
|
+
stages block rather than starting another writer.
|
|
120
156
|
|
|
121
157
|
## Publication recovery
|
|
122
158
|
|
|
@@ -156,6 +192,10 @@ A failed review after publication remains a failed automation attempt, even if i
|
|
|
156
192
|
|
|
157
193
|
Git hooks are disabled for application-authored task commits; configure required checks as validation commands. Changed symlinks and submodules require manual handling. Checkout checks detect boundary changes but do not sandbox custom adapters or prevent unrelated local tools from writing.
|
|
158
194
|
|
|
195
|
+
Git chooses author and committer through its normal configuration and environment
|
|
196
|
+
rules. Runner startup performs no identity preflight; missing identity fails at
|
|
197
|
+
the commit step before push or hosting publication.
|
|
198
|
+
|
|
159
199
|
Validation records say exactly which command ran, when, its exit code and artifact path. No-change work skips publication. Generated commit/request text is validated and saved before Git/API writes. Logs, prompts and errors redact configured credentials and recognized secret environment values; this does not sanitize arbitrary repository content or secrets unknown to the runner.
|
|
160
200
|
|
|
161
201
|
Back up both PostgreSQL and the state directory if history/artifacts matter. The checkout and runtime session stores are separate local state. Losing them cannot be repaired from DBOS checkpoints alone. Do not change a custom workflow's step order or rename projects while its runs are pending; use a new workflow version and finish or explicitly resolve existing runs first.
|
package/examples/config.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { configSchema } from "@mingchuno/agent-workflows";
|
|
2
2
|
|
|
3
|
-
/** Replace paths, repository
|
|
3
|
+
/** Replace paths, repository and model IDs with locally available values. */
|
|
4
4
|
export const configuration = configSchema.parse({
|
|
5
5
|
id: "local",
|
|
6
|
-
stateDirectory: "
|
|
6
|
+
stateDirectory: "../application.agent-workflows",
|
|
7
7
|
projects: [
|
|
8
8
|
{
|
|
9
9
|
id: "application",
|
|
10
|
-
checkout: "
|
|
10
|
+
checkout: ".",
|
|
11
11
|
hosting: {
|
|
12
12
|
provider: "gitlab",
|
|
13
13
|
origin: "https://git.example.com/gitlab",
|
|
@@ -17,7 +17,7 @@ export const configuration = configSchema.parse({
|
|
|
17
17
|
labels: ["ready-for-agent"],
|
|
18
18
|
baseBranch: "main",
|
|
19
19
|
branchTemplate: "agent/{issue}-{attempt}",
|
|
20
|
-
|
|
20
|
+
includeAgentCoAuthors: true,
|
|
21
21
|
agent: { provider: "codex" },
|
|
22
22
|
stages: {
|
|
23
23
|
implementation: {
|
package/examples/run.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
2
3
|
import {
|
|
3
4
|
configSchema,
|
|
4
5
|
createAgents,
|
|
@@ -7,13 +8,15 @@ import {
|
|
|
7
8
|
} from "@mingchuno/agent-workflows";
|
|
8
9
|
import { reportingWorkflow } from "./custom-workflow.js";
|
|
9
10
|
|
|
11
|
+
const configPath = resolve(process.argv[2] ?? "agent-workflows.json");
|
|
10
12
|
const config = configSchema.parse(
|
|
11
|
-
JSON.parse(await readFile(
|
|
13
|
+
JSON.parse(await readFile(configPath, "utf8")),
|
|
12
14
|
);
|
|
13
15
|
const databaseUrl = process.env[config.databaseUrlEnv];
|
|
14
16
|
if (!databaseUrl) throw new Error(`Set ${config.databaseUrlEnv}`);
|
|
15
17
|
const runner = new Runner({
|
|
16
18
|
config,
|
|
19
|
+
pathBaseDirectory: dirname(configPath),
|
|
17
20
|
databaseUrl,
|
|
18
21
|
hosting: createHosting,
|
|
19
22
|
agents: createAgents(),
|