@fullchico/harness 0.1.5 → 0.1.6

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/install CHANGED
@@ -37,45 +37,71 @@ python3 -I "$HARNESS/plugin/bin/sync" "$ROOT" --version "$VERSION" $FORCE ${PROF
37
37
  PROFILE="$(sed -n 's/^PROFILE=//p' "$ROOT/harness.conf" | tr -d "\"'" | sed -n 1p)"
38
38
  PROFILE="${PROFILE:-fullstack-typescript}"
39
39
 
40
+ # Mostra em que ponto está: registrar plugins e baixar skills leva mais de um minuto, e em
41
+ # silêncio parece travado. Num terminal a linha é reescrita; fora dele sai uma linha por passo.
42
+ if [ -t 1 ]; then
43
+ progress() { printf '\r\033[K%s' "$1"; }
44
+ settle() { printf '\r\033[K%s\n' "$1"; }
45
+ else
46
+ progress() { echo "$1"; }
47
+ settle() { :; }
48
+ fi
49
+ echo "[1/3] Arquivos do harness gravados"
50
+
40
51
  if [ -z "${HARNESS_SKIP_PLUGIN:-}" ] && command -v claude >/dev/null 2>&1; then
41
- warn() { echo "install: não consegui $1; rode à mão: $2" >&2; }
52
+ warn() { [ -t 1 ] && printf '\r\033[K'; echo "install: não consegui $1; rode à mão: $2" >&2; }
42
53
  # Num clone do repositório, o marketplace é esta pasta (desenvolvimento do próprio harness).
43
54
  # Instalado pelo npm, a pasta é o cache do npx e some: vale o repositório publicado.
44
55
  if [ -d "$HARNESS/.git" ] || [ -f "$HARNESS/.git" ]; then MARKET="$HARNESS"; else MARKET="FullChico/fullchico-harness"; fi
45
56
  MARKET="${HARNESS_MARKETPLACE:-$MARKET}"
57
+ progress "[2/3] Plugins: registrando os marketplaces"
46
58
  claude plugin marketplace add "$MARKET" >/dev/null 2>&1 || warn "registrar o marketplace do harness" "claude plugin marketplace add $MARKET"
47
- python3 -I - "$ROOT/.claude/settings.json" <<'PY' | while IFS= read -r REPO; do
59
+ REPOS="$(python3 -I - "$ROOT/.claude/settings.json" <<'PY'
48
60
  import json, sys
49
61
  for name, entry in json.load(open(sys.argv[1])).get("extraKnownMarketplaces", {}).items():
50
62
  source = entry.get("source", {})
51
63
  if name != "fullchico" and source.get("source") == "github" and source.get("repo"):
52
64
  print(source["repo"])
53
65
  PY
66
+ )"
67
+ for REPO in $REPOS; do
54
68
  claude plugin marketplace add "$REPO" >/dev/null 2>&1 || warn "registrar o marketplace $REPO" "claude plugin marketplace add $REPO"
55
69
  done
56
70
  # Instalar é por projeto: o comando roda de dentro dele.
57
- python3 -I - "$ROOT/.claude/settings.json" <<'PY' | while IFS= read -r PLUGIN; do
71
+ PLUGINS="$(python3 -I - "$ROOT/.claude/settings.json" <<'PY'
58
72
  import json, sys
59
73
  for name, enabled in json.load(open(sys.argv[1])).get("enabledPlugins", {}).items():
60
74
  if enabled:
61
75
  print(name)
62
76
  PY
77
+ )"
78
+ TOTAL="$(printf '%s\n' $PLUGINS | grep -c .)" N=0
79
+ for PLUGIN in $PLUGINS; do
80
+ N=$((N + 1))
81
+ progress "[2/3] Plugins ($N/$TOTAL): $PLUGIN"
63
82
  (cd "$ROOT" && claude plugin install "$PLUGIN" --scope project >/dev/null 2>&1) || warn "instalar $PLUGIN" "claude plugin install $PLUGIN --scope project"
64
83
  done
84
+ settle "[2/3] Plugins instalados ($TOTAL)"
65
85
  else
66
86
  echo "install: sem o comando claude; os plugins ficam para depois." >&2
67
87
  fi
68
88
 
69
89
  # Skills de arquitetura, dos autores, copiadas para o projeto e fixadas no skills-lock.json.
70
90
  if [ -z "${HARNESS_SKIP_PLUGIN:-}" ] && command -v npx >/dev/null 2>&1; then
71
- python3 -I -c 'import json,sys
91
+ SKILLS="$(python3 -I -c 'import json,sys
72
92
  for s in json.load(open(sys.argv[1])).get("project_skills", []):
73
93
  if sys.argv[2] in s.get("profiles", []):
74
- print(s["repo"], s["skill"])' "$HARNESS/plugin/map.json" "$PROFILE" | while read -r REPO SKILL; do
94
+ print(s["repo"] + "|" + s["skill"])' "$HARNESS/plugin/map.json" "$PROFILE")"
95
+ TOTAL="$(printf '%s\n' $SKILLS | grep -c .)" N=0
96
+ for PAIR in $SKILLS; do
97
+ REPO="${PAIR%%|*}" SKILL="${PAIR##*|}"
98
+ N=$((N + 1))
99
+ progress "[3/3] Skills ($N/$TOTAL): $SKILL"
75
100
  [ -d "$ROOT/.claude/skills/$SKILL" ] && continue
76
101
  (cd "$ROOT" && npx -y skills add "$REPO" -s "$SKILL" -a claude-code -y --copy </dev/null >/dev/null 2>&1) \
77
- || echo "install: não instalei a skill $SKILL; rode à mão: npx skills add $REPO -s $SKILL -a claude-code -y --copy" >&2
102
+ || { [ -t 1 ] && printf '\r\033[K'; echo "install: não instalei a skill $SKILL; rode à mão: npx skills add $REPO -s $SKILL -a claude-code -y --copy" >&2; }
78
103
  done
104
+ [ "$TOTAL" -eq 0 ] || settle "[3/3] Skills instaladas ($TOTAL)"
79
105
  fi
80
106
 
81
107
  # Com o harness.conf já preenchido, deixa o worktree pronto: portas no .env e dependências.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullchico/harness",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Trilhos e portões para projetos desenvolvidos com agentes no Claude Code: orquestração por ticket, revisão independente presa ao commit, ambiente por feature.",
5
5
  "license": "MIT",
6
6
  "author": "FullChico",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harness",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Orquestração, guardrails e memória para projetos desenvolvidos com agentes.",
5
5
  "license": "MIT",
6
6
  "author": {