# metab notes --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab notes/README.md --present
exit: 0
--- stdout ---
delivered_to: app
open_in: auto (default)
bundle_id: io.github.jlevy.metabrowser.dev
bundle_path: <ROOT>/Applications/Metabrowser.app
kind: file
root: <ROOT>/notes
page: /view/README.md
handoff: <ROOT>/notes/README.md
confirmed: false
code: not_confirmed
reason: LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes/README.md
--- server ---
# metab notes --path docs/guide.md --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "file",
    "root": "<ROOT>/notes",
    "page": "/view/docs/guide.md",
    "handoff": [
      "<ROOT>/notes",
      "<ROOT>/notes/docs/guide.md"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes <ROOT>/notes/docs/guide.md
--- server ---
# metab https://github.com/octo/demo/pull/7/files --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "pull_request",
    "root": "https://github.com/octo/demo",
    "page": "/pull/7/files",
    "handoff": [
      "https://github.com/octo/demo/pull/7/files"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev https://github.com/octo/demo/pull/7/files
--- server ---
# metab https://raw.githubusercontent.com/Octo/Demo/main/docs/guide.md --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "file",
    "root": "https://github.com/octo/demo",
    "page": null,
    "handoff": [
      "https://github.com/octo/demo/blob/main/docs/guide.md"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev https://github.com/octo/demo/blob/main/docs/guide.md
--- server ---
# metab git@github.com:octo/demo.git --present
exit: 0
--- stdout ---
delivered_to: app
open_in: auto (default)
bundle_id: io.github.jlevy.metabrowser.dev
bundle_path: <ROOT>/Applications/Metabrowser.app
kind: repository
root: https://github.com/octo/demo
page: /view/
handoff: https://github.com/octo/demo
confirmed: false
code: not_confirmed
reason: LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev https://github.com/octo/demo
--- server ---
# metab notes --path docs --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/docs/",
    "handoff": null,
    "refusal": null
  },
  "confirmed": false,
  "code": "app_cannot_select_folder",
  "reason": "the app opens a folder in a window of its own and cannot select one inside another; present that folder itself, or ROOT without --path",
  "fallback": null
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# metab notes --path docs --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": "http://127.0.0.1:8413/view/",
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/docs/",
    "handoff": null,
    "refusal": null
  },
  "confirmed": false,
  "code": "server_started",
  "reason": "a metab server for the target runs detached at http://127.0.0.1:8413/view/, which answers as the target's, and opens it in a browser once the page answers; nothing confirms that a browser shows it. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": {
    "code": "app_cannot_select_folder",
    "reason": "the app opens a folder in a window of its own and cannot select one inside another; present that folder itself, or ROOT without --path"
  }
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
metab --path docs -- notes
# metab notes --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/apps/macos/build/dev/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "app_not_installed",
  "reason": "LaunchServices names the app at <ROOT>/apps/macos/build/dev/Metabrowser.app, which is not installed in an Applications folder; --present sends only to an app at /Applications/Metabrowser.app or ~/Applications/Metabrowser.app, so install the Metabrowser app at one of them",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/apps/macos/build/dev/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --open-in app
exit: 4
--- stdout ---
--- stderr ---
Error: not sent to the app: LaunchServices names the app at <ROOT>/apps/macos/build/dev/Metabrowser.app, which is not installed in an Applications folder; --present sends only to an app at /Applications/Metabrowser.app or ~/Applications/Metabrowser.app, so install the Metabrowser app at one of them (app_not_installed)
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/apps/macos/build/dev/Metabrowser.app
--- open ---
--- server ---
# METABROWSER_ALLOW_UNINSTALLED_APP=1 metab notes --present --open-in app
exit: 0
--- stdout ---
delivered_to: app
open_in: app (flag)
bundle_id: io.github.jlevy.metabrowser.dev
bundle_path: <ROOT>/apps/macos/build/dev/Metabrowser.app
kind: folder
root: <ROOT>/notes
page: /view/
handoff: <ROOT>/notes
confirmed: false
code: not_confirmed
reason: LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/apps/macos/build/dev/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab https://github.com/octo/demo --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/older-home/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "repository",
    "root": "https://github.com/octo/demo",
    "page": "/view/",
    "handoff": [
      "https://github.com/octo/demo"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "app_not_marked",
  "reason": "the app at <ROOT>/older-home/Applications/Metabrowser.app does not declare MetabrowserOpensURLs, so it is not a Metabrowser build that takes what --present sends; update it to a current build",
  "fallback": null
}
--- stderr ---
--- account_home ---
<ROOT>/older-home
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/older-home/Applications/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --open-in app
exit: 4
--- stdout ---
--- stderr ---
Error: not sent to the app: the app at <ROOT>/older-home/Applications/Metabrowser.app does not declare MetabrowserOpensURLs, so it is not a Metabrowser build that takes what --present sends; update it to a current build (app_not_marked)
--- account_home ---
<ROOT>/older-home
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/older-home/Applications/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser <ROOT>/notes
--- server ---
# metab notes --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> <ROOT>/apps/macos/build/dev/Metabrowser.app
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab notes --present --app-bundle-id org.example.metabrowser-fork --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "org.example.metabrowser-fork",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
org.example.metabrowser-fork -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b org.example.metabrowser-fork <ROOT>/notes
--- server ---
# METABROWSER_APP_BUNDLE_ID=org.example.metabrowser-fork metab https://github.com/octo/demo --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "org.example.metabrowser-fork",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "repository",
    "root": "https://github.com/octo/demo",
    "page": "/view/",
    "handoff": [
      "https://github.com/octo/demo"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
org.example.metabrowser-fork -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b org.example.metabrowser-fork https://github.com/octo/demo
--- server ---
# METABROWSER_APP_BUNDLE_ID=com.apple.Terminal metab notes/run-me.command --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": "com.apple.Terminal",
  "bundle_path": "<ROOT>/Utilities/Terminal.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "file",
    "root": "<ROOT>/notes",
    "page": "/view/run-me.command",
    "handoff": [
      "<ROOT>/notes/run-me.command"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "app_not_installed",
  "reason": "LaunchServices names the app at <ROOT>/Utilities/Terminal.app for com.apple.Terminal, which is not a Metabrowser app installed in an Applications folder; --present sends only to an app at /Applications/Metabrowser.app or ~/Applications/Metabrowser.app, so install the Metabrowser app at one of them",
  "fallback": null
}
--- stderr ---
--- launch_services ---
com.apple.Terminal -> <ROOT>/Utilities/Terminal.app
--- open ---
--- server ---
# metab notes/run-me.command --present --app-bundle-id com.apple.Terminal --open-in app
exit: 4
--- stdout ---
--- stderr ---
Error: not sent to the app: the app at <ROOT>/copy-home/Applications/Metabrowser.app is not named Metabrowser in its Info.plist, so it is not the Metabrowser app; install a current Metabrowser build (app_not_marked)
--- account_home ---
<ROOT>/copy-home
--- launch_services ---
com.apple.Terminal -> <ROOT>/copy-home/Applications/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "app_not_found",
  "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
# metab notes --present --open-in app
exit: 4
--- stdout ---
--- stderr ---
Error: not sent to the app: LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT (app_not_found)
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
# metab notes --present --format json
exit: 5
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "lookup_failed",
  "reason": "LaunchServices could not be asked (error -10661); serve the target with metab ROOT instead",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> error -10661
--- open ---
--- server ---
# OPEN_STAND_IN_FAIL=1 metab notes --present --format json
exit: 5
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "open_failed",
  "reason": "open exited with status 1: The application cannot be opened for an unexpected reason, error=-54; serve the target with metab ROOT instead",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab missing --present --format json
exit: 3
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": null,
    "root": null,
    "page": null,
    "handoff": null,
    "refusal": {
      "code": "not_found",
      "message": "nothing is at <ROOT>/missing; check the path"
    }
  },
  "confirmed": false,
  "code": "not_found",
  "reason": "nothing is at <ROOT>/missing; check the path",
  "fallback": null
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# metab https://github.com/octo/demo/issues/5 --present
exit: 3
--- stdout ---
--- stderr ---
Error: GitHub issues pages are not opened; open the repository at https://github.com/octo/demo (unsupported_github_url)
--- launch_services ---
--- open ---
--- server ---
# metab notes --present --dry-run --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "app",
    "open_in": "auto",
    "open_in_source": "default",
    "bundle_id": "io.github.jlevy.metabrowser.dev",
    "bundle_path": "<ROOT>/Applications/Metabrowser.app",
    "code": "app_found",
    "reason": "the app at <ROOT>/Applications/Metabrowser.app takes the target",
    "fallback": null
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --dry-run
exit: 0
--- stdout ---
kind: folder
root: <ROOT>/notes
page: /view/
handoff: <ROOT>/notes
open_in: auto (default)
delivers_to: app
code: app_found
reason: the app at <ROOT>/Applications/Metabrowser.app takes the target
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
--- server ---
# metab notes --present --dry-run --open-in browser --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "browser",
    "open_in": "browser",
    "open_in_source": "flag",
    "bundle_id": null,
    "bundle_path": null,
    "code": "browser_preferred",
    "reason": "open_in is browser, so --present looks for no app and starts a metab server for the target that opens it in a browser",
    "fallback": null
  }
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# metab notes --present --dry-run --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "browser",
    "open_in": "auto",
    "open_in_source": "default",
    "bundle_id": null,
    "bundle_path": null,
    "code": "browser_fallback",
    "reason": "no app takes the target, so under open_in auto --present starts a metab server for it that opens it in a browser",
    "fallback": {
      "code": "app_not_found",
      "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT"
    }
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
# metab notes --present --dry-run --open-in app --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "none",
    "open_in": "app",
    "open_in_source": "flag",
    "bundle_id": null,
    "bundle_path": null,
    "code": "app_not_found",
    "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT",
    "fallback": null
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
# metab notes --present --dry-run --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "none",
    "open_in": "auto",
    "open_in_source": "default",
    "bundle_id": null,
    "bundle_path": null,
    "code": "lookup_failed",
    "reason": "LaunchServices could not be asked (error -10661); serve the target with metab ROOT instead",
    "fallback": null
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> error -10661
--- open ---
--- server ---
# METABROWSER_OPEN_IN=sometimes metab notes --present --dry-run --format json
exit: 0
--- stdout ---
{
  "kind": "folder",
  "root": "<ROOT>/notes",
  "page": "/view/",
  "handoff": [
    "<ROOT>/notes"
  ],
  "refusal": null,
  "decision": {
    "delivers_to": "none",
    "open_in": null,
    "open_in_source": null,
    "bundle_id": null,
    "bundle_path": null,
    "code": "preference_unreadable",
    "reason": "METABROWSER_OPEN_IN is not auto, app, or browser; set it to one, or unset it",
    "fallback": null
  }
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# metab missing --present --dry-run --format json
exit: 3
--- stdout ---
{
  "kind": null,
  "root": null,
  "page": null,
  "handoff": null,
  "refusal": {
    "code": "not_found",
    "message": "nothing is at <ROOT>/missing; check the path"
  },
  "decision": null
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# metab --present notes --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab --present notes --path docs/guide.md --format json
exit: 0
--- stdout ---
{
  "delivered_to": "app",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "file",
    "root": "<ROOT>/notes",
    "page": "/view/docs/guide.md",
    "handoff": [
      "<ROOT>/notes",
      "<ROOT>/notes/docs/guide.md"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_confirmed",
  "reason": "LaunchServices took the target; the app does not reply yet, so nothing confirms that a window shows it",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes <ROOT>/notes/docs/guide.md
--- server ---
# metab --present missing --format json
exit: 3
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": null,
    "root": null,
    "page": null,
    "handoff": null,
    "refusal": {
      "code": "not_found",
      "message": "nothing is at <ROOT>/missing; check the path"
    }
  },
  "confirmed": false,
  "code": "not_found",
  "reason": "nothing is at <ROOT>/missing; check the path",
  "fallback": null
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
# OPEN_STAND_IN_FAIL=1 metab --present notes --format json
exit: 5
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": "io.github.jlevy.metabrowser.dev",
  "bundle_path": "<ROOT>/Applications/Metabrowser.app",
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "open_failed",
  "reason": "open exited with status 1: The application cannot be opened for an unexpected reason, error=-54; serve the target with metab ROOT instead",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> <ROOT>/Applications/Metabrowser.app
--- open ---
open -b io.github.jlevy.metabrowser.dev <ROOT>/notes
--- server ---
# metab --present notes --format json
exit: 5
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "lookup_failed",
  "reason": "LaunchServices could not be asked (error -10661); serve the target with metab ROOT instead",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> error -10661
--- open ---
--- server ---
# metab --present notes --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": "http://127.0.0.1:8413/view/",
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_started",
  "reason": "a metab server for the target runs detached at http://127.0.0.1:8413/view/, which answers as the target's, and opens it in a browser once the page answers; nothing confirms that a browser shows it. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": {
    "code": "app_not_found",
    "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT"
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
metab -- notes
# metab --present notes --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "app_not_found",
  "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT",
  "fallback": null
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
# metab --present notes --open-in browser --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "browser",
  "open_in_source": "flag",
  "bundle_id": null,
  "bundle_path": null,
  "url": "http://127.0.0.1:8413/view/",
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_started",
  "reason": "a metab server for the target runs detached at http://127.0.0.1:8413/view/, which answers as the target's, and opens it in a browser once the page answers; nothing confirms that a browser shows it. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": null
}
--- stderr ---
--- launch_services ---
--- open ---
--- server ---
metab -- notes
# metab --present notes --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_starting",
  "reason": "a metab server for the target runs detached and has not said where it serves after 0.5 s, as a first clone can take minutes; it opens the page in a browser once it answers. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": {
    "code": "app_not_found",
    "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT"
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
metab -- notes  [stand-in told to say nothing yet]
# metab --present notes --format json
exit: 1
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_failed",
  "reason": "the metab server for the target exited with status 1 before it said where it serves: Error: the stand-in server exits, as it was told to; its output is in <ROOT>/logs/metab-present-XXXXXXXX.log",
  "fallback": {
    "code": "app_not_found",
    "reason": "LaunchServices knows no app io.github.jlevy.metabrowser or io.github.jlevy.metabrowser.dev; install or build the Metabrowser app and open it once, or serve the target with metab ROOT"
  }
}
--- stderr ---
--- launch_services ---
io.github.jlevy.metabrowser -> none
io.github.jlevy.metabrowser.dev -> none
--- open ---
--- server ---
metab -- notes  [stand-in told to exit 1 first]
# metab notes --present --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": "http://127.0.0.1:8413/view/",
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_started",
  "reason": "a metab server for the target runs detached at http://127.0.0.1:8413/view/, which answers as the target's, and opens it in a browser once the page answers; nothing confirms that a browser shows it. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": {
    "code": "not_macos",
    "reason": "the Metabrowser app runs on macOS only; serve the target with metab ROOT"
  }
}
--- stderr ---
--- launch_services ---
no LaunchServices on this platform
--- open ---
--- server ---
metab -- notes
# metab notes --present --open-in app --format json
exit: 4
--- stdout ---
{
  "delivered_to": "none",
  "open_in": "app",
  "open_in_source": "flag",
  "bundle_id": null,
  "bundle_path": null,
  "url": null,
  "pid": null,
  "log": null,
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "not_macos",
  "reason": "the Metabrowser app runs on macOS only; serve the target with metab ROOT",
  "fallback": null
}
--- stderr ---
--- launch_services ---
no LaunchServices on this platform
--- open ---
--- server ---
# metab --present notes --format json
exit: 0
--- stdout ---
{
  "delivered_to": "browser",
  "open_in": "auto",
  "open_in_source": "default",
  "bundle_id": null,
  "bundle_path": null,
  "url": "http://127.0.0.1:8413/view/",
  "pid": 12345,
  "log": "<ROOT>/logs/metab-present-XXXXXXXX.log",
  "target": {
    "kind": "folder",
    "root": "<ROOT>/notes",
    "page": "/view/",
    "handoff": [
      "<ROOT>/notes"
    ],
    "refusal": null
  },
  "confirmed": false,
  "code": "server_started",
  "reason": "a metab server for the target runs detached at http://127.0.0.1:8413/view/, which answers as the target's, and opens it in a browser once the page answers; nothing confirms that a browser shows it. Its output is in <ROOT>/logs/metab-present-XXXXXXXX.log; stop it with kill 12345",
  "fallback": {
    "code": "not_macos",
    "reason": "the Metabrowser app runs on macOS only; serve the target with metab ROOT"
  }
}
--- stderr ---
--- launch_services ---
no LaunchServices on this platform
--- open ---
--- server ---
metab -- notes
