# =standup [days]: your work as a paste-ready update. Commits by your git user
# across the repos in your project folders (Bolt's project folders only; with
# none configured nothing is scanned and the sample offer is shown), plus your merged and open
# PRs via `gh pr list` when gh is installed and signed in (skipped otherwise,
# with a note). Default: since yesterday 00:00, today's work included (Monday covers the weekend). Fan-out: all
# repos are read in parallel. Read-only: only git log, git config --get and
# gh pr list run. First row holds the ready-to-copy markdown (Done / In
# progress / Blockers) plus commits-per-repo and per-day bars (text bars,
# because a chart pane cannot share the right-hand side with the detail pane).
#
# Sample data: `=standup demo` always shows a fabricated update. When you typed
# nothing and no real source can run (git missing, no project folders configured, no repos in them, no git user.email), the list opens with a "Try with sample data" row
# followed by the fabricated rows. Every sample row says SAMPLE DATA and the
# copyable update starts with a SAMPLE DATA line, so it cannot pass for your real
# work. A typed number of days that fails gets an honest error row. If your repos
# answer, only real rows are shown.
#
# There is deliberately no top-level `detect:` gate: it would hide the chip when
# git is missing, and then the sample-data offer could not be reached.
schema_version: 1
runtime: bridge
id: standup
chip: standup
title: Standup update
icon: git-commit
description: "Your commits and PRs since yesterday as a paste-ready standup, grouped by repo. Type a number for more days. =standup demo shows sample data"
placeholder_examples: ["3", "7", "demo"]
emits: Generic

args:
  - { name: days, from: "query.word(0)", default: "" }

dispatch:
  confirm_label: 'Build standup {{query}}'
  confirm_hint: "Press Enter to read your repos (read-only) · optional number of days · demo shows sample data"

bridge:
  command:
    macos: "python3 {{scripts_dir}}/bolt-standup.py {{days}}"
    linux: "python3 {{scripts_dir}}/bolt-standup.py {{days}}"
    windows: "python {{scripts_dir}}/bolt-standup.py {{days}}"
  parse: json
  env_passthrough: [GH_TOKEN, GITHUB_TOKEN, GH_HOST, GH_ENTERPRISE_TOKEN, GITHUB_ENTERPRISE_TOKEN, GH_CONFIG_DIR, HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, NO_PROXY]
  timeout_seconds: 40

presentation:
  widget: list
  title_field: title
  subtitle_field: subtitle
  searchable: true
  right_widget:
    kind: entity_preview
    mode: selected_row
    bind:
      title: "{{row.title}}"
      subtitle: "{{row.subtitle}}"
      fields:
        - { label: Kind, value: "{{row.kind}}", kind: badge }
        - { label: Commits, value: "{{row.count}}" }
        - { label: Data, value: "{{row.data}}" }
        - { label: PR, value: "{{row.url}}" }
      body: "{{row.body}}"
      actions: [copy-update, open-pr]

actions:
  - { id: copy-update, kind: composer, target: row, label: Copy text, insert: "{{row.value}}", primary: true }
  - { id: open-pr, kind: url, target: row, label: Open PR, url_template: "{{row.url}}" }
