···1717- Success output must tell an agent **what Prowl actually focused or opened**.
1818- Path fields must be normalized to **absolute paths** after CLI parsing.
1919- Success output must be stable enough for scripts; human-oriented prose belongs to non-JSON mode.
2020+- Human-visible success output for `open` should stay silent unless the caller asked for `--json`.
20212122## Success payload
2223···8788- `created_tab`: boolean.
8889 - `true` when the operation created a new tab as part of satisfying the request.
8990 - `false` when Prowl only focused an existing target.
9090-- `target`: object describing the final focused target.
9191+- `target`: object or `null`, describing the final focused target.
9292+ - May be `null` for bare `prowl` when Prowl was only brought to front and there is no resolvable visible surface yet.
91939294## `target` shape
9595+9696+When present, `target` has the following shape:
93979498### `target.worktree`
9599···150154151155- Success JSON should report the **resolved target**, not only the input path.
152156- `target.tab.cwd` and `target.pane.cwd` should be the exact directory the user lands in when available.
153153-- `created_tab` may be `false` for `exact-root` and `true` for `inside-root`; `new-root` may do either depending on implementation, so callers must trust the boolean instead of inferring it.
157157+- `created_tab` may be `false` for `exact-root` and `true` for `inside-root`; callers must trust the boolean instead of inferring it from `resolution`.
154158- `prowl` without arguments still returns `command: "open"`; it is the app-entry form of the same capability.
155159156160## Example: exact-root focus
···1111 /// Optional — handler derives a default if absent.
1212 public let invocation: String?
13131414- public init(path: String? = nil, invocation: String? = nil) {
1414+ /// `true` when the CLI had to launch Prowl before sending this command.
1515+ /// The handler copies this value into the response's `app_launched` field.
1616+ public let appLaunched: Bool
1717+1818+ public init(path: String? = nil, invocation: String? = nil, appLaunched: Bool = false) {
1519 self.path = path
1620 self.invocation = invocation
2121+ self.appLaunched = appLaunched
1722 }
1823}
1924
+8
supacode/CLIService/Shared/SocketConstants.swift
···77 /// Environment variable for overriding socket path.
88 public static let environmentKey = "PROWL_CLI_SOCKET"
991010+ /// Environment key used only by CLI process to pass the normalized open path
1111+ /// into app launch arguments during cold launch.
1212+ public static let cliOpenPathEnvironmentKey = "PROWL_CLI_OPEN_PATH"
1313+1414+ /// App launch argument used by CLI open flow to pass the requested path
1515+ /// during cold launch, so app startup can prefer CLI open behavior.
1616+ public static let cliOpenPathArgument = "--prowl-cli-open-path"
1717+1018 /// Default Unix domain socket path.
1119 /// Located in user's temporary directory to avoid permission issues.
1220 ///
+1
supacode/Clients/Terminal/TerminalClient.swift
···99 enum Command: Equatable {
1010 case createTab(Worktree, runSetupScriptIfNew: Bool)
1111 case createTabWithInput(Worktree, input: String, runSetupScriptIfNew: Bool)
1212+ case createTabInDirectory(Worktree, directory: URL)
1213 case ensureInitialTab(Worktree, runSetupScriptIfNew: Bool, focusing: Bool)
1314 case runScript(Worktree, script: String)
1415 case insertText(Worktree, text: String)
···11enum LaunchRestoreMode: Equatable, Sendable {
22 case lastFocusedWorktree
33 case restoreLayout
44- // case openWorktree(Worktree.ID) // future CLI support
44+ /// Cold-launch path passed from `prowl open`.
55+ /// When set, startup should avoid restoring last focused worktree first.
66+ case cliOpenPath(String)
57}