@agimon-ai/po-workflow 0.0.0-alpha.22 → 0.0.0-alpha.220
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/LICENSE +110 -149
- package/README.md +160 -53
- package/dist/apiContracts.cjs +302 -36
- package/dist/apiContracts.cjs.map +1 -1
- package/dist/apiContracts.d.mts +2 -2
- package/dist/apiContracts.d.mts.map +1 -1
- package/dist/apiContracts.mjs +302 -36
- package/dist/apiContracts.mjs.map +1 -1
- package/dist/contract-BpzJeyjh.mjs +33 -0
- package/dist/contract-BpzJeyjh.mjs.map +1 -0
- package/dist/contract-D80yV2d-.cjs +68 -0
- package/dist/contract-D80yV2d-.cjs.map +1 -0
- package/dist/extensions/native.mjs +5650 -1014
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +22406 -3636
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +22385 -3592
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +7100 -3260
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/index-DcA-Y9z0.d.mts +5220 -0
- package/dist/index-DcA-Y9z0.d.mts.map +1 -0
- package/dist/index.cjs +41 -3
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +104 -4
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +38 -1
- package/dist/index.mjs.map +1 -0
- package/dist/po-runtime-identity.json +1 -0
- package/dist/workflowHost-Bm3BR9lg.mjs +3974 -0
- package/dist/workflowHost-Bm3BR9lg.mjs.map +1 -0
- package/dist/workflowHost-RY0AYnyZ.cjs +4190 -0
- package/dist/workflowHost-RY0AYnyZ.cjs.map +1 -0
- package/dist/workflowHost.cjs +7 -0
- package/dist/workflowHost.d.mts +29 -0
- package/dist/workflowHost.d.mts.map +1 -0
- package/dist/workflowHost.mjs +3 -0
- package/dist/workflowServices-Cw8JTMgk.cjs +388 -0
- package/dist/workflowServices-Cw8JTMgk.cjs.map +1 -0
- package/dist/workflowServices-DcYbnXw0.mjs +287 -0
- package/dist/workflowServices-DcYbnXw0.mjs.map +1 -0
- package/llms.txt +8 -16
- package/locales/vi.json +621 -0
- package/locales/zh-CN.json +621 -0
- package/package.json +210 -26
- package/src/prompts/codemode-how-to-workflow/SKILL.md +70 -0
- package/src/prompts/help-how-to-workflow/SKILL.md +191 -0
- package/src/prompts/help-how-to-workflow-settings/SKILL.md +33 -0
- package/src/types/webWorkflowTerminal.ts +31 -0
- package/src/types/webWorkflows.ts +64 -4
- package/dist/workflowLaunchCommand-C69Nn3k5.cjs +0 -139
- package/dist/workflowLaunchCommand-C69Nn3k5.cjs.map +0 -1
- package/dist/workflowLaunchCommand-GGqimmTC.mjs +0 -122
- package/dist/workflowLaunchCommand-GGqimmTC.mjs.map +0 -1
- package/skills/workflow-recovery/SKILL.md +0 -85
- package/src/prompts/po-author-workflow/SKILL.md +0 -64
- package/src/prompts/po-use-workflow/SKILL.md +0 -21
package/LICENSE
CHANGED
|
@@ -1,149 +1,110 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
Terms
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
Any use of the Licensed Work in violation of this License will automatically
|
|
113
|
-
terminate your rights under this License for the current and all other
|
|
114
|
-
versions of the Licensed Work.
|
|
115
|
-
|
|
116
|
-
This License does not grant you any right in any trademark or logo of
|
|
117
|
-
Licensor or its affiliates (provided that you may use a trademark or logo of
|
|
118
|
-
Licensor as expressly required by this License).
|
|
119
|
-
|
|
120
|
-
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
|
|
121
|
-
AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
|
|
122
|
-
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
|
|
123
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
|
|
124
|
-
TITLE.
|
|
125
|
-
|
|
126
|
-
MariaDB hereby grants you permission to use this License’s text to license
|
|
127
|
-
your works, and to refer to it using the trademark “Business Source License”,
|
|
128
|
-
as long as you comply with the Covenants of Licensor below.
|
|
129
|
-
|
|
130
|
-
Covenants of Licensor
|
|
131
|
-
|
|
132
|
-
In consideration of the right to use this License’s text and the “Business
|
|
133
|
-
Source License” name and trademark, Licensor covenants to MariaDB, and to all
|
|
134
|
-
other recipients of the licensed work to be provided by Licensor:
|
|
135
|
-
|
|
136
|
-
1. To specify as the Change License the GPL Version 2.0 or any later version,
|
|
137
|
-
or a license that is compatible with GPL Version 2.0 or a later version,
|
|
138
|
-
where “compatible” means that software provided under the Change License can
|
|
139
|
-
be included in a program with software provided under GPL Version 2.0 or a
|
|
140
|
-
later version. Licensor may specify additional Change Licenses without
|
|
141
|
-
limitation.
|
|
142
|
-
|
|
143
|
-
2. To either: (a) specify an additional grant of rights to use that does not
|
|
144
|
-
impose any additional restriction on the right granted in this License, as
|
|
145
|
-
the Additional Use Grant; or (b) insert the text “None”.
|
|
146
|
-
|
|
147
|
-
3. To specify a Change Date.
|
|
148
|
-
|
|
149
|
-
4. Not to modify this License in any other way.
|
|
1
|
+
# Functional Source License, Version 1.1, MIT Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-MIT
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Agimon Pty Ltd
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the MIT license that is effective on the second anniversary of the date we make
|
|
91
|
+
the Software available. On or after that date, you may use the Software under
|
|
92
|
+
the MIT license, in which case the following will apply:
|
|
93
|
+
|
|
94
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
95
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
96
|
+
the Software without restriction, including without limitation the rights to
|
|
97
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
98
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
99
|
+
so, subject to the following conditions:
|
|
100
|
+
|
|
101
|
+
The above copyright notice and this permission notice shall be included in all
|
|
102
|
+
copies or substantial portions of the Software.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
105
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
106
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
107
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
108
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
109
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
110
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@ Discover, launch, monitor, control, and recover asynchronous Po workflows.
|
|
|
4
4
|
|
|
5
5
|
Part of the [Po distribution](https://www.npmjs.com/package/@agimon-ai/po).
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
host-executed steps, while Po provides session-scoped tools.
|
|
7
|
+
This package owns the workflow engine. Runs execute inside the Po host; there is no standalone CLI.
|
|
8
|
+
Workflow files describe job dependencies and host-executed steps, while Po provides session-scoped tools.
|
|
9
9
|
|
|
10
10
|
> **Alpha:** workflow and recovery contracts may change between releases.
|
|
11
11
|
|
|
@@ -15,8 +15,8 @@ host-executed steps, while Po provides session-scoped tools.
|
|
|
15
15
|
|
|
16
16
|
## Install
|
|
17
17
|
|
|
18
|
-
The seeded `
|
|
19
|
-
|
|
18
|
+
The seeded `presets.yaml` selects the `workflow` layer in `minimal`, `copilot` and `examples`.
|
|
19
|
+
Remove it from a preset to omit Workflow there. No mode activation is required.
|
|
20
20
|
|
|
21
21
|
## Define a workflow
|
|
22
22
|
|
|
@@ -31,47 +31,146 @@ jobs:
|
|
|
31
31
|
- name: Run tests
|
|
32
32
|
run: pnpm test
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
lint:
|
|
35
35
|
needs: test
|
|
36
36
|
steps:
|
|
37
|
-
- name:
|
|
38
|
-
run:
|
|
37
|
+
- name: Lint
|
|
38
|
+
run: pnpm lint
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`run` commands execute on the host with the workflow process's environment and privileges. There is
|
|
42
42
|
no VM, container, or sandbox. Review workflow files as executable code. Runner-specific
|
|
43
43
|
`interactiveRun` mappings are available for commands that require a TTY.
|
|
44
44
|
|
|
45
|
-
A step can also declare `runConfig` (
|
|
45
|
+
A step can also declare `runConfig` (preset, modes, profile, domains, model, thinking)
|
|
46
46
|
and `customRun` (a prompt). Launched from the Po server, a `customRun` step runs as a child
|
|
47
47
|
session of the launching session with those settings, until the agent has recorded what the step
|
|
48
48
|
needs, and `run` and `interactiveRun` steps each get their own RMUX pane. Each run keeps its engine
|
|
49
|
-
log in `engine.log` in its run directory. See
|
|
50
|
-
|
|
49
|
+
log in `engine.log` in its run directory. See [automation](https://github.com/AgiFlow/po/blob/main/docs/getting-started.md#automation) for the user workflow and the [maintenance guide](src/prompts/help-how-to-workflow/SKILL.md) for authoring details.
|
|
50
|
+
|
|
51
|
+
## Job-specific tools
|
|
52
|
+
|
|
53
|
+
Managed Po agent steps can receive a workflow-owned `jobTools` code-mode namespace and a pinned
|
|
54
|
+
`workflow-job-tools` skill. Select a folder at workflow level as a default, or override it per job:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
name: summarize
|
|
58
|
+
runConfig:
|
|
59
|
+
preset: copilot
|
|
60
|
+
tools: ./tools/shared
|
|
61
|
+
jobs:
|
|
62
|
+
report:
|
|
63
|
+
tools: ./tools/report
|
|
64
|
+
steps:
|
|
65
|
+
- name: Summarize
|
|
66
|
+
customRun: Read workflow-job-tools, discover jobTools, then summarize this job.
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
The folder must contain JavaScript `index.mjs` and a non-empty `SKILL.md`. Paths are resolved relative
|
|
70
|
+
to the YAML that declares them, before imports and job-template inheritance. Empty paths, control
|
|
71
|
+
characters and URL specifiers are rejected. Parsing, listing and inspection never execute the module.
|
|
72
|
+
A job's main steps, `preJob` and `postJob` use its selection or the workflow default. `repair.tools`
|
|
73
|
+
overrides the default for repair triage. Global phases use the workflow default.
|
|
74
|
+
|
|
75
|
+
Only trusted, managed Po `customRun` and in-process `interactiveRun` agent sessions receive these
|
|
76
|
+
tools, not shell steps, ordinary sessions, or external Claude/Codex CLI runners. Each session uses its
|
|
77
|
+
captured workflow config. Global `pre` can run before the worktree YAML is reparsed, so its tools are
|
|
78
|
+
not necessarily selected from that worktree. Step `cwd`, `WORKTREE_PATH` and environment variables do
|
|
79
|
+
not select or resolve the tools folder.
|
|
80
|
+
|
|
81
|
+
`index.mjs` default-exports a factory, called once per managed session with:
|
|
82
|
+
|
|
83
|
+
- `sessionId` and the admitted working directory `cwd`.
|
|
84
|
+
- `workflow`: the trusted `PoWorkflowContextService`, including the captured config, job/step identity,
|
|
85
|
+
admitted `jobEnvironment` and `stepEnvironment`, and workflow state reader.
|
|
86
|
+
- Injected `fs` and `shell` capabilities. Their methods take a call context as the last argument.
|
|
87
|
+
- `signal`: the session tools lifetime, aborted on session disposal or mounting failure.
|
|
88
|
+
- `context`: a call context for `fs` and `shell`, aborted with `signal`. Inside `bind(run)`, pass
|
|
89
|
+
`run.context` instead, which also aborts when that exec ends.
|
|
90
|
+
|
|
91
|
+
Return the existing `PoCodemodeNamespace` contract: name `jobTools`, a non-empty one-line `summary`
|
|
92
|
+
(maximum 600 characters), TypeScript `declarations` for discovery, and `bind(run)`. Bind returns flat
|
|
93
|
+
named async methods with JSON arguments and results. Each exec gets a fresh binding; keep per-session
|
|
94
|
+
state inside the factory, not at module scope. Validate method inputs and honour `run.signal` in long
|
|
95
|
+
operations. Use `run.onDispose` for exec-owned cleanup. The host refuses foreign sessions and calls
|
|
96
|
+
after cancellation/disposal, and detaches JSON values in both directions. Return `null`, not
|
|
97
|
+
`undefined`, for no output.
|
|
98
|
+
|
|
99
|
+
Agents read the selected folder's pinned skill, discover `jobTools`, then call its typed methods through `exec`. Keep usage judgment in `SKILL.md` and signatures in `declarations`; the maintenance guide covers authoring. Optional `approval` policies must name returned methods and use the existing approval path, never bypass it.
|
|
100
|
+
|
|
101
|
+
Tools are trusted workflow code running with the host's privileges, not sandboxed code. Review the
|
|
102
|
+
folder before launching. Native import caches modules by file URL; editing `index.mjs` at the same
|
|
103
|
+
path requires a host restart. There is no direct TypeScript loading, hot reload, or external CLI
|
|
104
|
+
bridge. A missing file or invalid factory fails the managed step session rather than silently
|
|
105
|
+
omitting its selected tools. The namespace and skill mount and dispose together; disposing them does
|
|
106
|
+
not stop the owning workflow or change its recovery rules.
|
|
107
|
+
|
|
108
|
+
## Step instructions
|
|
109
|
+
|
|
110
|
+
A workflow can give its managed Po agent steps their own instructions file:
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
instructions: ./AGENTS.md
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The file replaces the AGENTS.md files the step session would discover from its working directory; it
|
|
117
|
+
does not add to them. The path resolves relative to the declaring YAML and is inherited through
|
|
118
|
+
`imports` as a default, like `tools`. A missing or unreadable file fails the step session rather than
|
|
119
|
+
running it without instructions. Shell steps and external Claude/Codex CLI runners ignore it.
|
|
120
|
+
|
|
121
|
+
## Explicit role allocation
|
|
122
|
+
|
|
123
|
+
For a workflow declaring `identity.roles`, first call `workflow.requirements({ workflowPath })`, then
|
|
124
|
+
launch with an exact `assignments` map from every required role to a stable profile reference. Roles
|
|
125
|
+
used together by one job, reachable child or repair triage must select the same reference. Saved teams,
|
|
126
|
+
a launch profile, environment variables and workflow inputs never fill missing assignments.
|
|
127
|
+
|
|
128
|
+
The slash equivalent is `/workflow-launch <workflow> assign.writer=<stable-ref>`. Public tools and
|
|
129
|
+
code mode accept assignments only, never provider bindings or an allocation snapshot. The launch
|
|
130
|
+
freezes the effective definition and provider evidence; retries, child execution, reload, resume and
|
|
131
|
+
recovery revalidate that evidence without reallocating. Legacy role-bound runs without a snapshot
|
|
132
|
+
must be launched fresh or repaired through the existing approved revision-checked repair path.
|
|
133
|
+
|
|
134
|
+
Allocated agent steps require managed in-process execution and a compatible `po-profile` admission
|
|
135
|
+
capability. Help and external agent execution are refused. Roleless phases in an allocated graph run
|
|
136
|
+
with no profile. Allocations never grant product authority; the provider derives scope from trusted
|
|
137
|
+
host configuration.
|
|
51
138
|
|
|
52
139
|
## Launch and monitor
|
|
53
140
|
|
|
54
141
|
Core tools are:
|
|
55
142
|
|
|
56
143
|
- `list_workflows`: discover workflows.
|
|
144
|
+
- `workflow_requirements`: inspect required roles and eligible profiles for a workflow.
|
|
57
145
|
- `launch_workflow`: register and start an asynchronous run.
|
|
58
146
|
- `workflow_run`: inspect or control a run through supported actions.
|
|
59
147
|
- `workflow_tools` (server/web sessions): read failed-run recovery evidence or resume the existing run.
|
|
148
|
+
- `workflow_delete_definition`: delete a workflow definition file without deleting run history.
|
|
60
149
|
|
|
61
150
|
Launch returns after the run is registered, not after all jobs complete. Use status for progress
|
|
62
151
|
and wait for a completion notification.
|
|
63
152
|
|
|
153
|
+
## Dynamic workflows
|
|
154
|
+
|
|
155
|
+
The package also supplies the `dynamicWorkflow` code-mode namespace: tracked Mastra
|
|
156
|
+
workflows composed with `then`, `parallel`, `branch` and bounded `foreach`, with live
|
|
157
|
+
`team.run` transcripts. It is available when the `workflow` layer is selected, with no
|
|
158
|
+
mode gate. Inside a YAML run, a `customRun` step's agent can use it
|
|
159
|
+
for fan-out whose shape is only known at run time, and the run view shows those runs under
|
|
160
|
+
that step. See the [code-mode guide](src/prompts/codemode-how-to-workflow/SKILL.md).
|
|
161
|
+
Tracker state is in memory per session; it is not persisted with the run record.
|
|
162
|
+
|
|
163
|
+
Existing default-package entries still work and deduplicate with the layer. No configuration migration runs, and persisted `modes: [workflow]` has no effect.
|
|
164
|
+
|
|
64
165
|
## Storage, concurrency, and lifecycle
|
|
65
166
|
|
|
66
167
|
Registry data defaults to `$HOME/.workflow-mcp`; set `WORKFLOW_MCP_HOME` to relocate it. Persisted
|
|
67
168
|
records contain workflow and run identity, job and step state, ownership, output locations, and
|
|
68
169
|
recovery evidence. The default concurrency ceiling is five runs.
|
|
69
170
|
|
|
70
|
-
|
|
71
|
-
host such as tmux or cmux can have a different lifetime and remain manageable from the CLI. When
|
|
72
|
-
Team is loaded, Workflow contributes active session runs through Team's `po/background-work`
|
|
171
|
+
When Team is loaded, Workflow contributes active session runs through Team's `po/background-work`
|
|
73
172
|
service. That contribution reconnects after Team is replaced and is removed when Workflow unloads.
|
|
74
|
-
Reconciliation distinguishes stale registry records from live
|
|
173
|
+
Reconciliation distinguishes stale registry records from live runs; do not assume every run
|
|
75
174
|
outlives its parent session.
|
|
76
175
|
|
|
77
176
|
Each workflow or repair step can launch commands and model-backed agents, consuming provider quota
|
|
@@ -84,61 +183,69 @@ adopts the eligible failure, validates the evidence, and transfers ownership to
|
|
|
84
183
|
Live controls remain scoped to the owning session. Recovery does not launch a second copy beside a
|
|
85
184
|
still-running job and does not guarantee that parent-session work survives shutdown.
|
|
86
185
|
|
|
87
|
-
The
|
|
88
|
-
|
|
89
|
-
|
|
186
|
+
A run's owner may start three recoveries on its own. The count is stored on the run record
|
|
187
|
+
(`recoveries`), carried to each recovered generation, and never lowered by a recovery; a dry run,
|
|
188
|
+
a restart resume, an approval wake and a coordinator's replay are not counted. From the fourth,
|
|
189
|
+
`workflow.recover` needs the person's approval, also in Help mode. A recovery the owner starts
|
|
190
|
+
picks up an edited workflow file once, at its start, when the run has no role assignments and was
|
|
191
|
+
launched from that checkout; any other run adopts an edit only in Help mode. A record repair that
|
|
192
|
+
lowers `recoveries` needs Help mode, like `fixLoopCycle`.
|
|
193
|
+
|
|
194
|
+
The package ships three skills: pinned, ungated `codemode-how-to-workflow` for workflow code-mode
|
|
195
|
+
namespaces and selected job tools, unpinned Help-gated `help-how-to-workflow` for authoring and
|
|
196
|
+
maintenance, and unpinned Help-gated `help-how-to-workflow-settings` for the `workflowAdmin`
|
|
197
|
+
namespace (`workflows.recovery.checkEdits`). It also provides the live `workflow-session` context
|
|
198
|
+
resource for workflow sessions, and a selected tools folder supplies the managed session's pinned
|
|
199
|
+
`workflow-job-tools` skill.
|
|
90
200
|
|
|
91
201
|
## Workflow sessions
|
|
92
202
|
|
|
93
|
-
In a server (web cockpit) session, a launch
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
203
|
+
In a server (web cockpit) session, a launch runs in the session that asked for it. That session
|
|
204
|
+
owns the run (`PO_SESSION_ID`), its step sessions sit directly under it in the rail, and its agent
|
|
205
|
+
is told when the run ends. On success the notice lists the run directory and the outputs the
|
|
206
|
+
definition declares, and the agent decides what follows from them and its playbook. On failure it
|
|
207
|
+
diagnoses and recovers the run itself, within the allowance above.
|
|
208
|
+
|
|
209
|
+
A child **workflow session** (provenance `workflow-session`) is created only when a person launches
|
|
210
|
+
from the UI with required inputs missing: it collects them, then launches and owns the run. Its
|
|
211
|
+
environment carries `PO_WORKFLOW_LAUNCHER_SESSION_ID`, naming the launching session, which lists
|
|
212
|
+
the run in its Activity group, is told when it ends, and may read its status. Runs owned by
|
|
213
|
+
workflow sessions from earlier versions keep working the same way.
|
|
214
|
+
|
|
215
|
+
- Pass `sessionName` to name that input-collection session. It defaults to the workflow's name,
|
|
216
|
+
then its filename. `name` still names the run context directory.
|
|
217
|
+
- A workflow session's rail row shows the run (`workflow · build › test · 4m`, or a failure or
|
|
101
218
|
pause marked like a pending question) through the host's per-session activity line.
|
|
102
|
-
- Success is posted without starting a turn. Failure wakes
|
|
103
|
-
the
|
|
219
|
+
- Success is posted to it without starting a turn. Failure wakes its owner agent to diagnose and
|
|
220
|
+
recover within the allowance, then report to the launcher. The owner gets a live brief on every
|
|
221
|
+
turn.
|
|
104
222
|
- After a success, a workflow session nobody interacted with asks its launcher to release it, and it
|
|
105
223
|
becomes `stopped · open to wake`. A session whose run failed or paused, or whose agent you
|
|
106
224
|
prompted, stays live until you remove it. Removing or restarting a live workflow session stops its
|
|
107
225
|
run.
|
|
108
226
|
- Recovery is refused from any session other than the owner while the owner is live.
|
|
109
227
|
|
|
110
|
-
##
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
pnpm build
|
|
114
|
-
pnpm typecheck
|
|
115
|
-
pnpm test
|
|
116
|
-
pnpm lint
|
|
117
|
-
```
|
|
228
|
+
## Native execution contract
|
|
118
229
|
|
|
119
|
-
|
|
230
|
+
Agent steps require an effective `runConfig.preset`; collecting missing inputs in a workflow session requires `sessionConfig.preset` or top-level `runConfig.preset`. Selection projects preset, modes, profile and domains unchanged. `subagentModel` and `subagentThinking` set Team preferences independently of the step model.
|
|
120
231
|
|
|
121
|
-
|
|
232
|
+
The native host requires execution-state inspection before creating agent steps. After settlement it waits for idle, no pending messages and a known background snapshot without core holds or holding-provider errors before checking decisions. Unknown ownership waits closed without consuming reminders; stops interrupt reads and retry delays. Running commands stop holding an inline step after five idle minutes, but its decision gate still runs before session release.
|
|
122
233
|
|
|
123
|
-
The
|
|
124
|
-
Po web cockpit plugin: the `workflow` dock face beside Activity and Context (the owned run's
|
|
125
|
-
jobs, active steps and artifacts, each opening its own tab), the workflow catalog and launch
|
|
126
|
-
dialog in the overlay slot, the Activity group's run rows (a handed-off run opens its workflow
|
|
127
|
-
session), their stores, and the `workflow_runs` session channel, compiled into the cockpit bundle
|
|
128
|
-
by `po-web`'s build. Each surface keeps its components in a colocated `_components` folder and
|
|
129
|
-
its stores and helpers in `_lib`.
|
|
130
|
-
The hub-side data source ships behind the `./web-hub` subpath and reads the workflow registry
|
|
131
|
-
(run.json plus progress.ndjson) exactly as the engine writes it. Both halves are declared by the
|
|
132
|
-
`poWeb` block in package.json.
|
|
234
|
+
A success wakes the run's owner to continue its applicable playbook; in a workflow session it is informational there and wakes the launcher instead. Errors wake the owner through durable custom-message admission; a launcher that does not own the run receives an error notification, not a competing recovery turn. The owner checks evidence and recovers within its allowance. A parked run waits for the person's approval decision. User-requested stops do not trigger diagnosis or automatic restart.
|
|
133
235
|
|
|
134
|
-
##
|
|
236
|
+
## Development
|
|
135
237
|
|
|
136
|
-
|
|
238
|
+
```bash
|
|
239
|
+
pnpm exec nx run-many -t lint typecheck build test -p @agimon-ai/po-workflow
|
|
240
|
+
```
|
|
137
241
|
|
|
138
|
-
##
|
|
242
|
+
## Upgrading from the CLI releases
|
|
139
243
|
|
|
140
|
-
|
|
244
|
+
The `workflow-mcp` and `po-workflow-mcp` commands, `launch-command` and run-local launchers were
|
|
245
|
+
removed. A workflow that still declares `launch-command` or `launcher` is rejected; delete the key.
|
|
246
|
+
Storage paths and registry records are unchanged. Let runs started by a CLI release finish on that
|
|
247
|
+
release before upgrading, and remove any `.po/hooks.yaml` entry that points at the old CLI path.
|
|
141
248
|
|
|
142
|
-
|
|
249
|
+
## License
|
|
143
250
|
|
|
144
|
-
|
|
251
|
+
Functional Source License 1.1, MIT Future License (FSL-1.1-MIT): free for any purpose except a Competing Use; each version converts to MIT two years after release. See [LICENSE](LICENSE).
|