diff --git a/README.md b/README.md index 49f2c97c..a2e0c42e 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Worth knowing before you script against the CLI: - **A session talks to the draft, what you are editing; `vf session start -v published` talks to the live version.** A new project is created with a first release already in place, so either works immediately — you do not have to publish anything first. - **vf remembers the current session** for each project and environment, so `send`, `get`, `update` and `end` need no ID, and a `send` with none going starts one. `-s ` names another. A session's ID is its conversation's user ID: `vf transcript search --session ` lists its transcripts, and `vf evaluation run --session ` evaluates its newest. `vf session run-script` runs a list of messages as a fresh session. At a terminal, `vf session start` goes on to a chat, a turn a line, until `/end`; Ctrl-D leaves the session going, and `vf session send` with no message goes back to it. (`vf conversation`, which took a user ID, a version and an action in JSON on every turn, still runs for the scripts that use it.) -- **A session with the draft runs your latest edits.** The draft runs as last compiled, so vf compiles it when a session starts (`session start`, `session run-script`, a `send` that starts one), and before a turn after vf itself edited the draft (`vf agent update`, `vf playbook update`, …). Other turns don't compile. A compile takes about half a second. If the draft won't compile, vf says why and sends nothing (`error_type` `compile_failed`, exit 1). An edit made elsewhere, or while a turn runs, can miss that turn; vf then compiles after it and warns, so the next turn runs it. A conversation already going can still be swayed by its earlier replies: to try an edit cleanly, start a new session. `--no-compile` talks to the last build as it is; the published version is never compiled. +- **A session with the draft runs your latest edits.** The draft runs as last compiled, so vf compiles it when a session starts (`session start`, `session run-script`, a `send` that starts one), and before a turn after vf itself edited the draft (`vf agent update`, `vf playbook update`, …). Other turns don't compile. A compile takes about half a second. If the draft won't compile, vf says why and sends nothing (`error_type` `compile_failed`, exit 1). An edit made elsewhere, or while a turn runs, can miss that turn; vf then compiles after it and warns, so the next turn runs it. A conversation already going can still be swayed by its earlier replies: to try an edit cleanly, start a new session. `--no-compile` talks to the last build as it is; the published version is never compiled. Clients outside vf that run the draft, such as the Dialog Manager API with the draft's version ID, run it as last compiled: after an edit, run `vf environment compile`, unless a vf session with the draft has started or taken a turn since. The web chat widget serves the published version by default, so an edit reaches it with `vf environment publish`. - **Pass `--output-format json` explicitly when piping.** Inside AI coding agents (`CLAUDECODE`, `CURSOR_AGENT`, …) the default output is TOON, not JSON. - **Capture values with `--jq`**: `ID=$(vf project create … --jq .project.id)`. A string result prints raw, as `jq -r` prints it; anything else prints as JSON. - **`vf whoami` is offline** — it shows which credential source is configured but does not validate the token. `vf workspace list` is the real check. diff --git a/docs/vf_session_run-script.md b/docs/vf_session_run-script.md index 457c1dc8..50f3442b 100644 --- a/docs/vf_session_run-script.md +++ b/docs/vf_session_run-script.md @@ -8,6 +8,8 @@ Run a list of user messages as one new conversation, and make it the current ses With the draft, vf compiles it first, so the script runs your latest edits. 'vf session send' goes on from the script's last turn; --end ends the session after the script instead, and finds its transcript, for 'vf evaluation run'. +-s reuses a session ID, such as a phone number the agent expects: as with 'vf session start -s', vf ends the conversation it had and clears its state first, so the script starts clean. + ``` vf session run-script [flags] ``` @@ -30,8 +32,8 @@ vf session run-script [flags] -m, --messages string The user messages to send, in order, after the launch. A message is typed text, as a string or { "text": "…" }, or a button press, as { "button": "