@meridiona/meridian-darwin-arm64 1.31.3 → 1.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env.example CHANGED
@@ -68,18 +68,20 @@
68
68
  # PM_WORKLOG_SYNTH_TIMEOUT_S=300
69
69
 
70
70
  # ---------------------------------------------------------------------------
71
- # GitHub (GITHUB_TOKEN + GITHUB_ORG required to enable the GitHub connector)
72
- # Syncs the OPEN issues assigned to you under GITHUB_ORG; logs worklogs as
73
- # structured issue comments (GitHub has no native time tracking).
74
- # Token: Settings > Developer settings > Personal access tokens. A classic token
75
- # with the `repo` scope is simplest (works for personal + org issues); a
76
- # fine-grained token needs Issues: Read and write on the relevant repos.
77
- # GITHUB_ORG is the issue owner — an org slug OR your own username.
71
+ # GitHub (GITHUB_TOKEN required; GITHUB_PROJECT_IDS selects which Projects sync)
72
+ # Syncs the OPEN issues assigned to you from the listed GitHub Projects v2 (read
73
+ # via the GraphQL API); logs worklogs as structured issue comments (GitHub has no
74
+ # native time tracking).
75
+ # Token: easiest is the gh CLI `meridian setup` runs `gh auth token` and adds
76
+ # the read:project scope for you (no PAT). Otherwise create a classic PAT with
77
+ # the `repo`, `read:org`, `read:project` scopes (read:project reads Projects;
78
+ # repo posts worklog comments).
79
+ # GITHUB_PROJECT_IDS: comma-separated Projects v2 node IDs (PVT_xxx). Find them:
80
+ # gh api graphql -f query='{ viewer { projectsV2(first:10){nodes{id title}} } }'
78
81
  # ---------------------------------------------------------------------------
79
82
 
80
83
  # GITHUB_TOKEN=ghp_your_personal_access_token
81
- # GITHUB_ORG=your-org
82
- # GITHUB_REPOS=your-org/api,your-org/web # optional — comma-separated owner/repo; empty = all repos under the owner
84
+ # GITHUB_PROJECT_IDS=PVT_xxx,PVT_yyy
83
85
 
84
86
  # ---------------------------------------------------------------------------
85
87
  # Linear (LINEAR_API_KEY required to enable the Linear connector)
package/VERSION CHANGED
@@ -1 +1 @@
1
- 1.31.3
1
+ 1.32.0
package/bin/meridian CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridiona/meridian-darwin-arm64",
3
- "version": "1.31.3",
3
+ "version": "1.32.0",
4
4
  "description": "Prebuilt Meridian app for macOS arm64 (daemon binary + dashboard + Python services). Installed via @meridiona/meridian.",
5
5
  "homepage": "https://github.com/Meridiona/meridian",
6
6
  "repository": {
@@ -94,9 +94,16 @@ collect_credentials() {
94
94
  fi
95
95
  echo >&2
96
96
  if prompt_category "GitHub"; then
97
- prompt_env_var "GITHUB_TOKEN" "GitHub personal access token" 1 "$env_file"
98
- prompt_env_var "GITHUB_ORG" "GitHub organization (or your username)" 0 "$env_file"
99
- prompt_env_var "GITHUB_REPOS" "GitHub repos (optional, comma-sep owner/repo)" 0 "$env_file"
97
+ if ! _try_gh_token "$env_file"; then
98
+ echo >&2
99
+ echo " Alternatively, create a personal access token (classic) at:" >&2
100
+ echo " https://github.com/settings/tokens/new" >&2
101
+ echo " Required scopes: repo, read:org, read:project" >&2
102
+ echo " (read:project lets meridian read your GitHub Projects; repo posts worklog comments)" >&2
103
+ echo >&2
104
+ prompt_env_var "GITHUB_TOKEN" "GitHub personal access token" 1 "$env_file"
105
+ fi
106
+ _pick_github_projects "$env_file"
100
107
  fi
101
108
  echo >&2
102
109
  if prompt_category "Linear"; then
@@ -106,6 +113,9 @@ collect_credentials() {
106
113
  ok "Credential collection complete"
107
114
  }
108
115
 
116
+ # GitHub setup helpers — shared with install.sh.
117
+ source "${APP_ROOT}/scripts/lib-github-setup.sh"
118
+
109
119
  GUI_TARGET="gui/$(id -u)"
110
120
  LAUNCH_AGENTS="${HOME}/Library/LaunchAgents"
111
121
 
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env bash
2
+ # meridian — normalises screenpipe activity into structured app sessions
3
+ #
4
+ # Shared GitHub setup helpers, sourced by both install.sh (source installs) and
5
+ # scripts/install-from-bundle.sh (bundle installs). The sourcing script must
6
+ # already define: info, ok, warn, get_env_value, set_env_value (resolved at
7
+ # call time, so definition order across files does not matter).
8
+
9
+ # Obtain a GitHub token from the gh CLI — no PAT needed. meridian needs two
10
+ # scopes: `repo` (post worklog / task-update issue comments) and `read:project`
11
+ # (read Projects v2 via GraphQL). gh's default web-login grants repo + read:org
12
+ # but not read:project, so add whatever is missing through the same browser flow,
13
+ # then write the OAuth token to GITHUB_TOKEN. Returns non-zero if gh is missing,
14
+ # unauthenticated, or the scope refresh fails, so the caller can fall back to a
15
+ # manual PAT prompt. An existing GITHUB_TOKEN is kept untouched.
16
+ _try_gh_token() {
17
+ local env_file="$1"
18
+ [[ -n "$(get_env_value GITHUB_TOKEN "$env_file")" ]] && {
19
+ ok "GITHUB_TOKEN already set — keeping"; return 0
20
+ }
21
+ command -v gh >/dev/null 2>&1 || return 1
22
+ gh auth status >/dev/null 2>&1 || return 1
23
+
24
+ # Add any missing scope through gh's browser flow. `project` (write) satisfies
25
+ # the read:project requirement too, so accept either.
26
+ local status; status="$(gh auth status 2>&1)"
27
+ local want=()
28
+ grep -q "'repo'" <<< "$status" || want+=("repo")
29
+ grep -qE "'read:project'|'project'" <<< "$status" || want+=("read:project")
30
+ if (( ${#want[@]} > 0 )); then
31
+ local joined; printf -v joined '%s,' "${want[@]}"; joined="${joined%,}"
32
+ info " Granting the ${joined} scope(s) to your gh login (opens a browser)…"
33
+ gh auth refresh -h github.com -s "$joined" >&2 || {
34
+ warn " Could not extend gh scopes — use a personal access token instead"
35
+ return 1
36
+ }
37
+ fi
38
+
39
+ local token
40
+ token="$(gh auth token 2>/dev/null)" || return 1
41
+ [[ -z "$token" ]] && return 1
42
+ set_env_value GITHUB_TOKEN "$token" "$env_file"
43
+ ok "GITHUB_TOKEN set from gh CLI (no PAT needed)"
44
+ }
45
+
46
+ # Interactively pick GitHub Projects and write their node IDs to GITHUB_PROJECT_IDS.
47
+ # Lists both personal and org projects via GraphQL. No-op if already set or if
48
+ # the gh CLI is unavailable or unauthenticated.
49
+ _pick_github_projects() {
50
+ local env_file="$1"
51
+ [[ -n "$(get_env_value GITHUB_PROJECT_IDS "$env_file")" ]] && {
52
+ ok "GITHUB_PROJECT_IDS already set — keeping"; return 0
53
+ }
54
+ command -v gh >/dev/null 2>&1 || return 0
55
+ gh auth status >/dev/null 2>&1 || return 0
56
+
57
+ local raw
58
+ raw="$(gh api graphql -f query='
59
+ { viewer {
60
+ projectsV2(first: 20) { nodes { id title } }
61
+ organizations(first: 20) {
62
+ nodes { login projectsV2(first: 20) { nodes { id title } } }
63
+ }
64
+ } }' 2>/dev/null)" || {
65
+ warn "Could not list GitHub Projects — add GITHUB_PROJECT_IDS to the config manually if needed"
66
+ return 0
67
+ }
68
+
69
+ # One python3 pass emits "id<TAB>label" per project (personal + org). python3
70
+ # is always present on macOS.
71
+ local pairs_raw
72
+ pairs_raw="$(printf '%s' "$raw" | python3 -c "
73
+ import json, sys
74
+ d = json.load(sys.stdin).get('data', {}).get('viewer', {})
75
+ for n in d.get('projectsV2', {}).get('nodes', []):
76
+ print('%s\t%s' % (n['id'], n['title']))
77
+ for org in d.get('organizations', {}).get('nodes', []):
78
+ for n in org.get('projectsV2', {}).get('nodes', []):
79
+ print('%s\t%s / %s' % (n['id'], org['login'], n['title']))
80
+ " 2>/dev/null)" || true
81
+
82
+ # Split each "id<TAB>label" line into parallel arrays (bash 3.2 — no mapfile).
83
+ local _ids=() _labels=()
84
+ local _id _label
85
+ while IFS=$'\t' read -r _id _label; do
86
+ [[ -z "$_id" ]] && continue
87
+ _ids+=("$_id"); _labels+=("$_label")
88
+ done <<< "$pairs_raw"
89
+ local count=${#_ids[@]}
90
+ (( count == 0 )) && { warn "No GitHub Projects found for your account"; return 0; }
91
+
92
+ echo >&2
93
+ echo " Your GitHub Projects:" >&2
94
+ local i=0
95
+ while (( i < count )); do
96
+ printf " %d. %s\n" "$((i+1))" "${_labels[$i]}" >&2
97
+ i=$((i+1))
98
+ done
99
+ echo >&2
100
+
101
+ local selection
102
+ read -r -p " Enter project numbers (comma-sep, e.g. 1,2) or Enter to skip: " selection
103
+ [[ -z "$selection" ]] && { info " (skipped GITHUB_PROJECT_IDS)"; return 0; }
104
+
105
+ local selected_ids=()
106
+ local IFS_save="$IFS"
107
+ IFS=',' read -ra nums <<< "$selection"
108
+ IFS="$IFS_save"
109
+ local n
110
+ for n in "${nums[@]}"; do
111
+ n="${n//[[:space:]]/}"
112
+ if [[ "$n" =~ ^[0-9]+$ ]] && (( n >= 1 && n <= count )); then
113
+ selected_ids+=("${_ids[$((n-1))]}")
114
+ fi
115
+ done
116
+
117
+ if [[ ${#selected_ids[@]} -eq 0 ]]; then
118
+ info " (no valid selection — skipped GITHUB_PROJECT_IDS)"; return 0
119
+ fi
120
+
121
+ local joined
122
+ printf -v joined '%s,' "${selected_ids[@]}"
123
+ set_env_value GITHUB_PROJECT_IDS "${joined%,}" "$env_file"
124
+ ok "GITHUB_PROJECT_IDS set (${#selected_ids[@]} project(s))"
125
+ }
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meridian-agents"
7
- version = "1.31.3"
7
+ version = "1.32.0"
8
8
  description = "Meridian agents — hermes task linking and Jira progress updates for meridian.db"
9
9
  requires-python = ">=3.11"
10
10
  authors = [{ name = "Meridiona" }]
package/ui.tar.gz CHANGED
Binary file