Repository navigation
Releases
divide 0.12.0
divide 0.12.0 runs in a web browser too: divide --web serves the same divide, with the same menus, keys and windows, to a browser on your own computer, and each tab is its own divide. Underneath, divide is now built on TurboFrame, the framework its editor, explorer, search, Git windows and language servers came from, and that brings safer saving and a few changes you will notice.
Platforms: Linux and Windows are supported; macOS is experimental. This release has no macOS binaries and the Homebrew tap stays at 0.10.0. See Platforms below.
divide in a web browser
divide --web ~/sites/shop # 127.0.0.1:8000; the screen follows the browser window
divide --web 127.0.0.1:9090 --res 120x40 ~/sites/shopdivide prints an address with a secret token. Open it in your browser: the token leaves the address bar at once and a cookie keeps you in.
- This computer only. Only its own addresses are served (
127.0.0.1,localhost,::1). From another computer, forward the port over SSH. - Sizes.
--res 120x40keeps the screen at 120 columns by 40 rows and fits the font to the window;--res auto(the default) follows the window. - Tabs. Each tab is a separate divide, up to 4. Alt+X ends a tab's divide after asking about unsaved changes; closing a tab ends it too. Ctrl+C where you started
divide --webends every tab's divide and anything they started. - Keys and clipboard. The F-keys, Alt+letters, Ctrl+P and the mouse work as in a terminal, and F5 zooms the window instead of reloading the page. A browser keeps Ctrl+W, Ctrl+T and Ctrl+N for itself: use Alt+F3, Run > Data tree and Ctrl+Space. Copying in divide reaches your computer's clipboard.
- Security. The address opens once, within 10 minutes. The cookie lets that browser in for 12 hours; after that new tabs are refused, but open ones keep running until you close them or stop the server. Restarting the server shuts every browser out.
- It works from every way divide is installed: the packages and binaries below,
pipxandpip.--mcpdoes not go with--web.
See Web Mode.
Saving and opening files
- Saves are atomic: divide writes the new file beside the old one, then puts it in its place, so an interrupted save never leaves half a file. The file keeps its permissions.
- A file another program changed since divide read it (a
git checkout, another editor) is not overwritten without asking: Overwrite, or Cancel and keep your changes in the editor. - Save as asks before replacing a file, and refuses a file that is open in another window.
- Files keep their newlines: a file written with
\r\n(Windows) is saved with\r\n, lines you add included. A new file gets\n. - A file that cannot be edited as text is not opened, and divide says why: not a regular file, larger than 5 MB, binary, or not UTF-8.
Other changes you will notice
- Find wraps around: past the last match it goes on from the top, and says so.
- Find in files has limits, so a huge folder never blocks divide: the first 20,000 files, at most 2,000 matches, 20 seconds. It says when it reaches one, and skips compiled Python files.
- Go to file opens at once on a large project, and reads the folder's files meanwhile.
- Enter keeps the line's indentation in the editor.
- PHP: Ctrl+F1 shows what the language server knows in a box under the cursor, not in a dialog; a completion's documentation starts with its detail (a method's return type); Ctrl+Space with no answer from the server says so.
- Window > Tile arranges the windows beside the project window, which keeps its place at the left edge; the project window can now be zoomed.
- The project window hides a few more folders and files (
venv,.svn,.hg, compiled Python, editor swap files). - The debugger's Call stack says (not running) before a session.
- A setting that cannot be saved (a read-only home folder) applies for the session, without an error; Options > Language says when its choice cannot be kept.
Fixed
- Windows: Run > Parameters keeps quoted arguments together and drops the quotes, as the Windows command line does.
- A language server and its own child processes (node, PHP workers) end when divide ends.
- A PHP check that runs out of time is stopped and cleaned up, not left behind.
- The project window watches an empty folder you open, so files created in it from outside appear (#29).
- Diagnostics and marks (a PHP error, a blame line) are drawn as soon as they arrive, not after the next key.
- A menu opened right after a click on the desktop no longer closes at once.
- A key typed right after a dialog opens is no longer lost.
Also
- The help (English and Spanish) has a new Web Mode page and the section Opening and saving files (The Desktop); Installation, Language Servers, Finding Files and Commands, Editing Templates, Project Window and Debugging PHP say what changed.
- CI now also runs divide in a real browser on Linux and Windows, both from the installed
dividecommand and from the packaged binary, and a real PHP language server in a real terminal.
Platforms
- Linux and Windows are supported: every change is tested on them (Linux with Python 3.11 and 3.12, the acceptance journeys, the real terminal and the browser; Windows with Python 3.12 and the browser), and this release has their binaries and packages.
- macOS is experimental, as in 0.11.0: no macOS binaries, and the Homebrew tap stays at 0.10.0. On macOS, divide 0.12.0 runs from the source code (
tools/install.shorpipx, with Python 3.11 or newer).
Install
Ready to run, with nothing else to install:
- Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS (experimental): from the source code,
pipx install git+https://github.com/divengine/divide.git@v0.12.0
Requirements:
- Rendering and checking includes: PHP 8 and Div (
composer require divengine/div). - Template data providers: PHP 8.
- Runner Flows: Runner (
composer require divengine/runner, 0.3 or newer to simulate a Flow). - Mock Simulation: PHP 8.1 or newer, and Xdebug for the line trace.
- The Git menu: git.
- The web mode: a web browser.
divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.11.0
divide 0.11.0 lets a template take its data from a provider: a PHP script of your project that prints the data as JSON, the way your generator really builds it, so the template renders, traces and completes with that data instead of a hand-written file. It also remembers the data file you choose for a template, and divide's MCP server uses that choice.
Platforms: Linux and Windows are supported; macOS is experimental. This release has no macOS binaries and the Homebrew tap stays at 0.10.0. See Platforms below.
A provider is real PHP with real effects on your computer: it is not a sandbox. divide runs it only when you ask (Run > Refresh template data) and only after you trust it, and the trust question starts on Cancel.
Data from a provider
Set it in the project's .div/data-files.json, in place of the template's data file:
{"templates": {"templates/dto.tpl": {"provider": {"php": "tools/template-data.php", "args": ["model/package_info.json"], "timeout_seconds": 10}}}}phpis a script of the project; one that leads outside the project is not run.argsandtimeout_seconds(1 to 60, 10 by default) are optional.- divide runs
php SCRIPT ARGSin the project folder, with nothing on its input andDIVIDE_TEMPLATEandDIVIDE_DATA_PROVIDER=1in its environment. It must exit with 0 and print one JSON object, strict JSON (NaNandInfinityare refused). examples/generatorhas one:tools/template-data.php.
It runs only when you ask. Run > Refresh template data runs the active template's provider once, under a progress box; Esc stops it and ends PHP. Nothing else runs it: not opening the project or the template, typing, completion, Run > Check, the render trace, nor the MCP server. It has no key of its own.
- Trust. The first refresh names the script, its arguments, the folder and the limits, and asks. The answer is kept in your own settings, never in the project, for that project and that script with those arguments: another script or other arguments ask again. Trusting Run, a Flow or a Mock Simulation does not trust a provider.
- The snapshot. What the provider printed is kept in
.div/data-snapshots/, out of git, and Ctrl+F9, the render trace (F7) and completion use it. A snapshot made by another script or other arguments is never used. - No snapshot, no data. A template whose provider has no valid snapshot, or whose provider entry is not valid, is not rendered with Div's convention or another file instead: divide says so and offers Refresh now.
- The script that runs is the one you saw. divide reads it again just before starting PHP, and runs nothing if it changed; if it changes while PHP runs, the output is not kept. When the script changes, the snapshot is stale: it is still used, with a warning, and the next refresh first shows what changed.
- When a refresh fails (an exit code other than 0, output that is not one JSON object, the time limit, more than 5 MB of output, Esc, PHP that cannot be started, a snapshot that cannot be written), Messages says why, with PHP's errors at their place, and Output shows its standard error, which is never kept on disk. The last valid data is kept.
- Run > Template data provider shows the provider, its trust and its snapshot, and can Withdraw trust or Remove snapshot. Run > Edit data opens the script; Run > Data file replaces the provider with a data file.
The data file you choose is remembered
- Run > Data file keeps the choice in the project's
.div/data-files.json(two paths relative to the project), so it holds when you open the project again; the dialog's Default button goes back to Div's convention (page.tpltakespage.json). A template or data file outside the project is chosen for the session only. - The choice, and a provider's script, follow renames in the project window.
- divide's MCP server renders and traces a template with the chosen data file when the request names none and gives no data, or with its provider's snapshot (
data_file_fromsays which, andstalewhether the script changed since). The server never runs a provider: with no valid snapshot it refuses the request.
Fixed
- Closing divide just as it starts a process (such as the
php -lcheck after typing) no longer leaves it waiting forever on Python 3.11 and 3.12 (#30). - A line trace's time limit stops it on Python 3.11 too (#30).
- Project window: a folder read again during Ctrl+R's reload no longer starts a second reload that folds what was just unfolded (#16).
- Functions window: its narrow layout no longer waits for a resize (#33); the Mock Simulation playback is never shown empty before its first refresh (#33).
- Mock Simulation progress box: its Output row is the Function's output, not the PHP process's whole output (#39).
Also
- The help (English and Spanish) has the new section Data from a provider (Rendering), and the MCP Server and Project Window pages say what changed. The Spanish interface covers all of it.
- Acceptance tests of whole user journeys, in Pilot and in a real terminal, run in CI on Linux, and keep the screen at meaningful moments as evidence whether they pass or fail.
Platforms
- Linux and Windows are supported: every change is tested on them (Linux with Python 3.11 and 3.12, the acceptance journeys and the real terminal; Windows with Python 3.12), and this release has their binaries and packages.
- macOS is experimental, for now, because its UI tests fail intermittently on CI. It is still tested, in a workflow of its own whose result does not hold back a change or a release. This release has no macOS binaries, and the Homebrew tap stays at 0.10.0 (its formula needs the macOS archives). Earlier releases keep their macOS files. On macOS, divide 0.11.0 runs from the source code (
tools/install.shorpipx, with Python 3.11 or newer). - macOS comes back as supported after ten consecutive macOS CI runs pass with no manual rerun, the recurring UI failures are investigated, the Intel and Apple silicon packages build, and a smoke test of the packaged binary starts, edits, saves and exits cleanly.
Known limits
- Not a sandbox. A provider is your project's own trusted code. Files it includes or reads are not checked when its script is.
- PHP only. A provider is a PHP script run with the PHP divide uses.
Install
Ready to run, with nothing else to install:
- Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS (experimental): from the source code,
pipx install git+https://github.com/divengine/divide.git@v0.11.0
Requirements:
- Rendering and checking includes: PHP 8 and Div (
composer require divengine/div). - Template data providers: PHP 8.
- Runner Flows: Runner (
composer require divengine/runner, 0.3 or newer to simulate a Flow). - Mock Simulation: PHP 8.1 or newer, and Xdebug for the line trace.
- The Git menu: git.
divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.10.0
divide 0.10.0 adds a Mock Simulation of a single Runner Function. You give it a context and doubles for the dependencies it declares, divide runs the Function once and records every PHP line it executes, and you replay the run line by line in the Function's own code.
MOCK SIMULATION: real PHP runs; only declared dependencies are replaced. The Function's own PHP code runs for real, in a PHP process of its own. Only what it asks its context for is replaced: other Functions (
$context['_importer']), Runner's logger ($context['_logger']) and service objects under context keys. PHP's own functions (files, databases,curl,time()), the file's top-level code and, if you opt in, the project's Composer classes run for real. It is not a sandbox and not side-effect-free. Simulate only code you trust.
Not a Flow Simulation
Each way divide runs a Function does something different, and each keeps its own keys:
| What runs | What you get | |
|---|---|---|
| Run a Flow (Ctrl+F9) | the Flow and its Functions, for real | the context after it |
| Test Function (T, Ctrl+F9 in the Functions window) | one Function, for real, with its real dependencies | its report in Output |
| Debug (Test Function > Debug) | the same call, for real, under the debugger | breakpoints, F7 / F8, watches |
| Flow Simulation (Shift+F9) | Runner's simulation of the Flow: no Function code runs | the Flow's events on its board |
| Mock Simulation (Shift+T), new | one Function's real PHP, its declared dependencies doubled | its PHP lines, replayed in its code |
A Mock Simulation never reads or writes a Flow's checkpoints (.div/runner/) or a Flow simulation (.div/simulation/), and the Flow board never shows PHP lines.
Mock Simulation of a Function
Open it with:
- Shift+T on a Step in the Flow Designer: its activity, else its condition;
- Function... > Simulate... in the Step dialog;
- Alt+F10 > Simulate... in the Functions window;
- Run > Mock Simulation of a Function.
The dialog holds a scenario:
- Context: the JSON context the Function gets, by reference.
- Doubles:
importerfor other Functions andservicesfor objects under context keys. Each double is one of Runner's--simulateoutcomes:returns,throwsorsequence. - Expectations: an optional expected return and context keys.
- Limits: lines, seconds and output bytes.
- Options: the line trace, the pin, a tripwire and Composer autoload.
A scenario can be saved in .div/function-simulations/, for the team in Git.
The doubles are filled in for you. divide reads the Function's file, without running it, and finds what it asks its context for. Each dependency it finds gets a placeholder that answers null. Simulate and Save ask before a placeholder is used: Keep null when null is the answer you mean, or Back to give it a value.
Refused before anything runs. A scenario is refused, and nothing runs, when:
- a field is not valid JSON;
- an outcome is malformed;
- a limit is out of range;
- a dependency the file uses has no double.
A dependency with no double is never the real one: the simulation throws when the Function asks for it.
The pin. A new scenario is pinned to the SHA-256 of the Function's file.
- If the file changed since, the scenario is STALE and nothing runs. It is re-pinned only when you choose Re-pin, or Re-pin and simulate, and a saved scenario changes only when you Save it.
- A scenario without a pin is always labelled NOT pinned to a source version.
Opt-in. The first Mock Simulation in a project asks you to allow it, after saying what it runs. Your settings keep only that answer, the options and the last scenario's name, never the context or the doubles.
The playback
With Xdebug, divide steps through the Function with its own Xdebug session, separate from the debugger and your breakpoints. The playback opens the Function's file read-only with the line about to run marked. Beside it are:
- the line's locals and the context so far;
- what changed and what the doubles answered, written as calls:
mailer->send("a", 1) #1: returns; - the logs and the output;
- the result, with each expectation
[OK]or[!!].
| Key | Does |
|---|---|
| F7 / Shift+F7 | next / previous line |
| F8 / Shift+F8 | next / previous line at the same depth |
| F4 | the next time the cursor's line ran |
| Ctrl+Home / Ctrl+End | first / last line |
| X | the whole context before the line, in Output |
| S | save the run as a scenario |
Moving only moves a cursor: nothing runs again and no file changes. Traced runs are kept in .div/function-simulation/, ignored by Git, with the same retention as Flow simulations, and Replay reopens the last one without running PHP.
Without Xdebug, divide asks whether to simulate without the line trace. You then get the result and no lines, and the PHP still runs for real.
Also
- The help has a new page, Function Mock Simulation (F1 in its dialog or playback), in English and Spanish. The Keyboard Reference, Flow Designer, Flow Functions and Flow Simulation pages link it.
- The design, its protocols (
divide.function-simulationv1 scenarios,divide.function-tracev1 traces) and its limits are indocs/function-simulation.md. - The Spanish interface covers all of the above.
- The replace prompt's All button ends the prompt again.
Known limits
- Not a sandbox. The optional tripwire disables PHP's process, network and mail functions and the commonest file writes, and fences off files outside the project. Other side effects (
fopen, PDO, static state) still happen. Stronger isolation is a separate investigation (#24). - Only declared dependencies are doubled. A Function that opens files, makes
newservices or calls static methods itself runs those parts for real. - Not controlled:
time(),rand()anduniqid(). - Flow-driving Functions are out of scope. A Function that drives the Flow (
_flow_state,_update_context) belongs to Flow Simulation. - Speed. The line trace runs at about 2,000 lines a second, bounded by the scenario's line limit.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Requirements:
- Rendering and checking includes: PHP 8 and Div (
composer require divengine/div). - Runner Flows: Runner (
composer require divengine/runner, 0.3 or newer to simulate a Flow). - Mock Simulation: PHP 8.1 or newer, and Xdebug for the line trace. Runner is not needed for it.
- The Git menu: git.
divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.9.0
divide 0.9.0 simulates Runner Flows. Runner 0.3 runs the Flow with test doubles: every condition and activity is answered by a double you declare, and no Function of the project is loaded or called. divide then replays Runner's trace on the Flow's board, event by event, forwards and backwards. A paused simulation resumes in a new process, and the playback goes on.
Simulate a Flow
Open it with:
- Shift+F9 in a Flow's code, its Flow window or its board;
- Run > Simulate Flow with doubles;
- S on the Flow Designer's board.
The dialog:
- Initial context: a JSON file, or a JSON object typed in the field.
- Doubles: Runner's own
--simulatefile, by default.div/simulations/<flow>.doubles.json, a file the team can share. A double returns a value, throws, pauses, follows a sequence or runs a nested YAML Flow, and can merge keys into the context. - Keep error and log messages in the trace: off by default, because a message could hold a secret.
Before anything runs, the dialog lists the functions that still need a double, and refuses an incomplete or malformed file. Edit doubles writes a complete template, or adds the missing doubles, and opens the file. Replay reopens the last simulation without running PHP.
A modified Flow is simulated as it is in the editor, from a copy of its YAML. Your file is not saved or written.
The Simulation window
The Flow's board, read-only, with a mark on each Step's card:
| Mark | The Step |
|---|---|
► |
current |
√ |
visited |
- |
skipped |
» |
waiting for its call |
= |
paused |
X |
failed |
The call and jump lines taken are underlined. The marks are characters, so they read the same in every theme.
The panel shows the event: its Block.Step, a condition's result, a CALL that returns here or a JUMP that does not return, the RETURN and whether its frame came from the checkpoint, an activity's result or error, the context's changes, the logs, the calls waiting to return, and Runner's exact _flow_state and _flow_stack. At the bottom, it shows how the simulation ended, whether the trace was cut, and whether the Flow or its doubles changed since.
Keys:
| Key | Does |
|---|---|
| F7 / Shift+F7 | next / previous event |
| F8 / Shift+F8 | next / previous Step |
| Ctrl+Home / Ctrl+End | first / last event |
| F4, or Enter on a card | the selected Step's next event |
| F | follow the current Step |
| X | the context at the event, in Output |
| Ctrl+F2 | back to the first event |
| Ctrl+F9 | resume a paused simulation |
Moving through the events changes nothing: not the events, the context, the YAML or any file.
Pause and resume
A paused simulation resumes from Runner's simulation session, in a new PHP process, and its events are added to the same playback. If the Flow or its doubles changed, divide asks first, and the resume uses what the simulation started with. Runner refuses a changed nested Flow, and the simulation can still be resumed once it is restored.
Kept apart from a real run
- Ctrl+F9 is still the real Run. Its dialog now says REAL RUN, with side effects.
- Separate folders. Simulations live in
.div/simulation/, ignored by Git, with the newest 20 kept (up to 64 MiB). They never touch the real run's checkpoints in.div/runner/. - Older Runner. With Runner 0.2, Simulation says it needs 0.3.0 and runs nothing.
A simulation is not a sandbox: the YAML is still compiled by PHP, and Flows and doubles are trusted inputs.
Also
- The help has a new page, Flow Simulation, in English and Spanish, with the workflow as a GIF and screenshots. The Flow Designer, Running Flows, Flow Functions and Keyboard Reference pages link it.
examples/runnerrequires Runner^0.3and has its doubles ready: openflows/fulfil.ymland press Shift+F9.- The Spanish interface covers all of the above.
Known limits
- One Flow on the board. A nested Flow's events are in the playback, but its Steps are not drawn.
- Doubles for every function. Each function the YAML references needs a double, even on Steps the given context will not reach.
- YAML only. Only YAML Flows can be simulated.
- Flow events only. The simulation steps through the Flow's events, not PHP statements.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner, 0.3 or newer to simulate); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.8.0
divide 0.8.0 tests a single Runner Function. You give it a JSON context, and divide calls the Function alone, as Runner would, then shows what it returned, how it changed the context and what it printed. You can also debug the same call in the debugger. No Flow or Step runs.
Test Function
Open it with:
- T on a Step in the Flow Designer: its activity, else its condition;
- Ctrl+F9 on a Function in the Functions window;
- Function... > Test... in the Step dialog.
The Function is resolved by Runner's own importer, with the Flow's function root, its Module folders and .div/runner.json. That is the same file a run of the Flow would load. Inside a Module, nothing outside that Module's folder is tried. It is called as Runner calls it: $func($context), with the context passed by reference and _importer in it.
The dialog:
- Context: a JSON object. Edit... opens it as a tree or as JSON text. The last input of each Function is remembered in your own settings, never in the project.
- Scenario: Save writes the input to
.div/function-tests/<module>/<name>.json, a fixture the team can share. Down offers the saved ones. - Expected return and Expected context after (the keys the context must hold): optional checks, reported as
okorFAIL. - Time limit: 30 seconds by default. The test also has a memory limit.
- Run, or Debug.
PHP files with unsaved changes are saved first.
The report
The report goes to Output, with each part separate:
- the file loaded;
- how the call ended: returned, exception, fatal error,
exit(), not found, or time limit; - the expectations;
- the returned value as JSON, and its type. For a condition, the report also says what that value would do to a Step;
- an exception's class, message, place and trace;
- the context's changes, key by key (
+ ~ -), then the context before and after; - stdout and stderr, never mixed with the result.
An exception's or a fatal error's place, PHP's warnings and a failed expectation also go to Messages, where Enter opens the file at that line.
Debug a Function
Debug makes the same call under Xdebug.
- With no breakpoint in the Function's file, it stops at the Function's first line.
- Otherwise it runs to your breakpoints, in the Function or in any file it calls.
- From there, F7, F8, watches and the call stack work as for any PHP script. Ctrl+F9 goes on, and the same report appears when it ends.
Safety
A test runs the project's real PHP code in its own PHP process, with a time and a memory limit. It is not a sandbox: the Function may write files or use a database or the network. The dialog and the report say so.
Also
- The help page Flow Functions has a new section, Test a Function, in English and Spanish, with the workflow as a GIF and screenshots.
- The Spanish interface covers all of the above.
Known limits
- A test runs a Function once, for real. Simulating Functions with mocks, or simulating whole Flows, is separate work.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.7.0
divide 0.7.0 makes Runner's Modules and Functions part of the Flow Designer. You can see which Steps use each Function, make a Module or a Function from a template, attach it to a Step and open it in the PHP editor, without writing folders or return function (...) by hand.
The Functions window
F on the Flow Designer's board, or Run > Flow functions, opens the window.
- The function root, and where it comes from: the Run Flow dialog's
--root, the context's_root_folder, the project's.div/runner.json, or the project. - The Modules and the Functions in each. A Module mapped elsewhere shows its folder. A Module outside the project is shown read-only.
- The Steps that use each Function, in every Flow of the project. Open Flows count as they are in the editor, unsaved changes included.
- Imports: the Functions each one imports with
$context['_importer']('name', 'module'), when the name is written literally. A computed name shows as unknown, never as a problem. - References that resolve to nothing. Enter on one makes it.
| Key | What it does |
|---|---|
| Enter | open a Function in the PHP editor, at its return; go to a Step; make a missing Function |
| Ins | a new Function, in the Module under the cursor |
| Shift+Ins | a new Module |
| Alt+F10 | the window's menu, which also makes .div/runner.json |
| Ctrl+R | read the disk again |
Making Functions
- New Function asks for the Module (or the root), the name and the use, activity or condition. It says where the file goes and what a Step will say to use it.
- The file is a minimal, valid PHP 8.1 callable of the shared context. A condition returns
bool; an activity returnsmixed, which Runner keeps under the Step's id. It is a starting point: write any PHP there. - From a Step: in the Step dialog, Down offers the Modules and their Functions. Function... opens the Step's Function, or New... fills in
moduleandactivity(orcondition).- The Step dialog's OK writes the Step as one YAML edit (one Ctrl+Z) and makes the file.
- Cancel writes and makes nothing.
- What is never done:
- writing over a file that is already there;
- writing outside the project, in Composer's
vendorfolder or in a hidden folder; - running a Function's PHP to list or read it.
Checks on a Function
A Function's file is read with tree-sitter, never run. It is flagged at the Step that names it, on the board, in the code and in Messages, when it:
- returns nothing;
- returns a closure that needs more than one argument;
- returns a closure whose context is typed as something other than an array.
Any other callable is left alone, and existing Functions are never rewritten.
.div/runner.json
An optional project file, {"root": "functions", "modules": {...}}, gives the function root and the Module folders once, for everyone who clones the project.
- Precedence: the Flow's
--rootcomes first, then the context's_root_folderand_modules, then the file, then Runner's defaults. - A run passes what the file adds to Runner. Runner itself does not read the file.
examples/generatorhas one.
Also
- The help has a new page, Flow Functions, in English and Spanish, with the workflow as a GIF.
- The Spanish interface covers all of the above.
Known limits
- The window makes Modules and Functions; renaming, moving and deleting them is the Project window's.
- Running or debugging a single Function, and simulating Functions or Flows, are separate work.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.6.1
divide 0.6.1 gives the Flow Designer an example of what divide is for: a generator. The application itself is unchanged.
A generator to try the Flow Designer on
examples/generator is a small, independent generator project. Div templates turn a JSON model of a PHP class (a DTO) into the class's source code and its README. A Runner Flow orders the stages in four Blocks:
mainloads the model, validates it, checks whether the outputs are current, generates, verifies and writes a report.validatechecks the model's schema and identifiers. If the model is not valid, it ends the run before anything is written.generaterenders the class and the README with Div, and writes a manifest of hashes.qualityrunsphp -lon the class and checks that the outputs say what the model says.
main calls the other three Blocks. When nothing has changed since the last run, main.current jumps over generation.
The output is deterministic: the same inputs write the same bytes. Nothing is written outside build/.
cd examples/generator && composer install && divide .Open flows/generate_php_dto.yml and use Run > Flow designer. Ctrl+F9 runs it, with generate.json as the initial context and functions as the function root.
Runner is one way to order a generator's stages, not a requirement: a PHP script that renders with Div is a generator too.
Help
- Flow Designer, in English and Spanish, now shows and explains this example.
- Its screenshots were retaken on it at 80, 120 and 160 columns, along with choosing a jump's target, the Block dialog, a context and the Phosphor Green theme.
examples/runnerkeeps its Flows,fulfil.ymlamong them, as general Runner examples.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.6.0
divide 0.6.0 draws a Runner Flow as a board you design from the keyboard. Blocks are columns, Steps are cards, and every call and jump is a line between them. You create, connect, rename, reorder and delete Blocks and Steps without writing YAML, and the YAML file stays the Flow.
The Flow Designer
Run > Flow designer on a YAML Flow opens it as a board, in the code's place.
-
Blocks are columns. Each Block is a column from the top of the window to the bottom, side by side in their order. Neighbours alternate between two colours, neither of them the window's. The first column is marked
ENTRY. The titles stay in view while the cards scroll. -
Steps are cards, in the order they run. A card reads in Runner's order of a Step:
IF condition(),SET key: value,CALL block.step,DO module:function(),JUMP block.step,PAUSE. Each word has its own colour.- Marks on its top edge:
!Eand!Wfor diagnostics,ROfor a Step shown but not edited. - On its bottom edge,
◄2counts the calls and jumps that lead to it.
- Marks on its top edge:
-
Calls and jumps are lines, worked out from the YAML each time and never stored:
- a call is a single line and a jump a double one, so they are told apart without colour;
- a target the Flow does not have ends in
?; - lines never run over a card, and crossings are drawn as crossings.
-
The panel on the right holds:
- what is going on, such as choosing a target, in reverse video and only while it lasts;
- the inspector of the selected Block or Step;
- the Flow's summary;
- Runner's verdict.
Under 100 columns it goes under the board.
-
Keyboard first; the mouse is optional.
Key What it does arrows move from card to card and from column to column Tab the selected item's connections, one by one Enter follow a connection Backspace back to where you were C / J connect: choose the target on the board and press Enter, never typing block.stepB / Ins a new Block with its first Step / a new Step Enter edit a Step (now including its id) or a Block (its id and description) X the Step's context Ctrl+arrows reorder Steps and Blocks Del delete, or remove a connection Ctrl+D the Flow window's tree, at the same item Ctrl+T the code; Ctrl+T in the code reopens the last view Alt+F9 check the Flow Ctrl+F9 run it F2 save
See Flow Designer in the help.
Edits that change only what they must
Each operation is one edit of the code's buffer: one Ctrl+Z undoes it, and F2 saves it. divide reads the Flow back after each one and undoes it if anything else changed.
- Moving swaps two neighbouring Steps or Blocks text for text. Their comments go with them, and the blank lines between them stay.
- Renaming a Step or a Block also rewrites every
callandjumpthat names it (block.step,.step,block.). Each keeps its quoting and its comment. - Deleting says first:
- which Steps lead to the item, and removes their
callorjumpin the same edit; - how many comments go with it;
- when the Flow will start elsewhere.
- which Steps lead to the item, and removes their
- Asked before: changing the entry Block, or changing which Step
block.leads to. - Refused, with the reason, sending you to the code:
- a reference line with a comment on it;
- a change that would leave a Step with nothing to do, which Runner rejects;
- an id that is taken or that Runner does not allow;
- Steps written in flow style, whose references could not be followed.
- Broken YAML: the board keeps the last design that parsed, read-only, and never touches your unsaved text.
The context, as a tree or as JSON
X on a card, or Edit context... in the Step dialog, opens a Step's context as data:
- in the JSON editor's tree, with its item dialog (key, type, value): nested objects and lists, strings, numbers, booleans, null;
- or as JSON text, in the code editor.
The dialog works on a copy, and only OK writes the result. A context written one key per line keeps its order and comments.
Also
examples/runner/flows/fulfil.ymlis a Flow with four Blocks, calls between them and a jump that retries a Step.- The Spanish interface and the help in English and Spanish cover all of the above.
Known limits
- The Designer designs; it does not simulate a Flow or play it back. Running is Runner's, through Ctrl+F9.
- Steps move only within their Block, and a Block is created with its first Step.
- The layout follows the YAML's order, and nothing about the board is stored.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.5.0
divide 0.5.0 works with Divengine Runner's Flows. You can run, pause and resume them, and edit their Blocks and Steps from the keyboard. The project window now follows changes made outside divide, and five monochrome phosphor themes join the colour themes.
Runner Flows
- Run, pause and resume.
- Running: Ctrl+F9 on a YAML Flow opens Run Flow. You give it an initial context (a JSON file, or JSON typed there), a function root and the file the context is saved to. The fields are remembered per Flow.
- How it runs: Runner's own command line runs the Flow (
vendor/divengine/runner/bin/run.php, Runner 0.2.0 or newer, from the project's Composer installation). - What you see: the run ends done, paused, with an error, stopped or not run. The Output window shows Runner's log and the resulting context; Messages lists Runner's diagnostics and PHP's errors.
- Resuming: a paused run is saved, and Resume continues it in a new PHP process without repeating a Step. divide never starts a paused run over without asking. Esc stops a run and leaves the saved context as it was.
- Where the context goes: by default under
.div/runner/, one file per Flow, kept out of Git.
- The Flow window. Ctrl+T on a Flow shows its Blocks and Steps as a tree, next to the selected item's attributes, where its
callandjumplead, and which function file it uses.- Editing: Enter edits a Step (condition, activity, module, call, jump, context, pause), Ins adds one and Del deletes one.
- Going places: Ctrl+Enter goes to a target or opens a function file, and Ctrl+T goes back to the YAML line.
- Running: Ctrl+F9 runs the edited Flow.
- Only what you change is written. The YAML file stays the Flow. Each edit changes only its own characters or lines, and is checked by reading it back; one Ctrl+Z undoes it. Comments, key order and formatting stay as written. An edit that would remove a comment is refused and points you to the code.
- Checked by Runner's own compiler, without running anything. Problems show in the tree, under the code and in Messages (Alt+F9):
- unknown keys and wrong types;
callandjumptargets that are not in the Flow;- activity and condition files missing where Runner would look for them.
See Running Flows and Flow Structure in the help.
The project window follows outside changes
Files and folders that git, Composer, a generator or a shell creates, deletes, renames or moves show by themselves, usually within half a second. A move between two open folders shows on both sides.
- Nothing is polled. divide uses the system's own notifications (inotify, FSEvents, ReadDirectoryChangesW) on the project's folder and the folders you have open, one by one, up to 64.
- Bursts are gathered. A checkout or a
composer installis read once per folder. - Your place stays. The bar, open folders, scroll position and filter do not move.
- Open editors are never reloaded.
- Ctrl+R still refreshes, for network filesystems that send no notifications.
See Project Window.
Phosphor themes
Options > Colors and --palette have five new themes: Phosphor White, Phosphor Green, Phosphor Green Black, Phosphor Amber and Phosphor Amber Black. Each uses one hue in levels of light; the Black variants have a pure black screen.
They don't rely on hue, so divide tells states apart in other ways:
- reverse video for selections and bars;
- brightness: errors over warnings, the execution line over breakpoints;
- underlined warnings and hotkeys, struck-through deletions, italic comments;
- marks in the editor's margin:
►the line about to run,■a breakpoint,+-~Git's changes.
With 16 colours, a phosphor theme uses only black and its own hue's ANSI colours. The existing themes look exactly as before. See The Desktop.
Also
- Options > Colors shows the themes in two columns, and its buttons keep their shadow.
- The Spanish interface and the help in English and Spanish cover all of the above.
Known limits
- Runner: running and editing Flows need PHP 8.1 and Runner 0.2.0 or newer in the project. divide runs a Flow to its end or pause, with no stepping, simulation or breakpoints. Blocks are added and renamed in the code.
- Watched folders: at most 64 at a time. On Linux the inotify limits apply, and network filesystems may send no notifications; Ctrl+R refreshes in both cases.
- Monochrome themes: the default button is told from the others only by its colour.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); Runner Flows need Runner (composer require divengine/runner); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.
divide 0.4.1
divide 0.4.1 fixes divide --mcp (the MCP server over stdio): a client that sends its requests and closes stdin at once, as a script piping into it does, now gets its answers. Before, the requests still running when stdin closed were cancelled and nothing came back. Each call stays bounded by its timeout; then the server ends.
The MCP server over HTTP (Options > MCP server) is unchanged. See MCP Server in the help.
Install
Ready to run, with nothing else to install:
- macOS and Linux:
brew install divengine/tap/divide - Windows:
scoop install https://github.com/divengine/divide/releases/latest/download/divide.json, or the.msibelow - Linux: the
.deb,.rpm,.apkand Arch packages, the AppImage or the binary alone, below - macOS: the archive for Apple silicon or Intel, below
Rendering and checking includes need PHP 8 and Div (composer require divengine/div); the Git menu needs git. divide is free software under the GPL, version 3 or later. The binaries are not signed yet: see Installation.


