shipwright-cli 2.1.2 → 2.2.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/.claude/agents/devops-engineer.md +14 -12
- package/.claude/agents/doc-fleet-agent.md +99 -0
- package/.claude/agents/test-specialist.md +5 -3
- package/README.md +48 -27
- package/claude-code/CLAUDE.md.shipwright +2 -2
- package/config/policy.json +73 -0
- package/config/policy.schema.json +75 -0
- package/docs/AGI-PLATFORM-PLAN.md +122 -0
- package/docs/AGI-WHATS-NEXT.md +69 -0
- package/docs/KNOWN-ISSUES.md +1 -23
- package/docs/PLATFORM-TODO-BACKLOG.md +41 -0
- package/docs/PLATFORM-TODO-TRIAGE.md +56 -0
- package/docs/README.md +83 -0
- package/docs/TIPS.md +39 -2
- package/docs/config-policy.md +40 -0
- package/docs/definition-of-done.example.md +2 -0
- package/docs/patterns/README.md +5 -0
- package/docs/strategy/02-mission-and-brand.md +3 -3
- package/docs/strategy/README.md +4 -3
- package/docs/tmux-research/TMUX-AUDIT.md +2 -0
- package/docs/tmux-research/TMUX-RESEARCH-INDEX.md +17 -0
- package/package.json +3 -2
- package/scripts/lib/daemon-health.sh +32 -0
- package/scripts/lib/pipeline-quality.sh +23 -0
- package/scripts/lib/policy.sh +32 -0
- package/scripts/sw +5 -1
- package/scripts/sw-activity.sh +35 -46
- package/scripts/sw-adaptive.sh +30 -39
- package/scripts/sw-adversarial.sh +30 -36
- package/scripts/sw-architecture-enforcer.sh +30 -33
- package/scripts/sw-auth.sh +30 -42
- package/scripts/sw-autonomous.sh +60 -40
- package/scripts/sw-changelog.sh +29 -30
- package/scripts/sw-checkpoint.sh +30 -18
- package/scripts/sw-ci.sh +30 -42
- package/scripts/sw-cleanup.sh +32 -15
- package/scripts/sw-code-review.sh +26 -32
- package/scripts/sw-connect.sh +30 -19
- package/scripts/sw-context.sh +30 -19
- package/scripts/sw-cost.sh +30 -40
- package/scripts/sw-daemon.sh +66 -36
- package/scripts/sw-dashboard.sh +31 -40
- package/scripts/sw-db.sh +30 -20
- package/scripts/sw-decompose.sh +30 -38
- package/scripts/sw-deps.sh +30 -41
- package/scripts/sw-developer-simulation.sh +30 -36
- package/scripts/sw-discovery.sh +36 -19
- package/scripts/sw-doc-fleet.sh +822 -0
- package/scripts/sw-docs-agent.sh +30 -36
- package/scripts/sw-docs.sh +29 -31
- package/scripts/sw-doctor.sh +52 -20
- package/scripts/sw-dora.sh +29 -34
- package/scripts/sw-durable.sh +30 -20
- package/scripts/sw-e2e-orchestrator.sh +36 -21
- package/scripts/sw-eventbus.sh +30 -17
- package/scripts/sw-feedback.sh +30 -41
- package/scripts/sw-fix.sh +30 -40
- package/scripts/sw-fleet-discover.sh +30 -41
- package/scripts/sw-fleet-viz.sh +30 -20
- package/scripts/sw-fleet.sh +30 -40
- package/scripts/sw-github-app.sh +30 -41
- package/scripts/sw-github-checks.sh +30 -41
- package/scripts/sw-github-deploy.sh +30 -41
- package/scripts/sw-github-graphql.sh +30 -38
- package/scripts/sw-guild.sh +30 -37
- package/scripts/sw-heartbeat.sh +30 -19
- package/scripts/sw-hygiene.sh +134 -42
- package/scripts/sw-incident.sh +30 -39
- package/scripts/sw-init.sh +31 -14
- package/scripts/sw-instrument.sh +30 -41
- package/scripts/sw-intelligence.sh +39 -44
- package/scripts/sw-jira.sh +31 -41
- package/scripts/sw-launchd.sh +30 -17
- package/scripts/sw-linear.sh +31 -41
- package/scripts/sw-logs.sh +32 -17
- package/scripts/sw-loop.sh +32 -19
- package/scripts/sw-memory.sh +32 -43
- package/scripts/sw-mission-control.sh +31 -40
- package/scripts/sw-model-router.sh +30 -20
- package/scripts/sw-otel.sh +30 -20
- package/scripts/sw-oversight.sh +30 -36
- package/scripts/sw-patrol-meta.sh +31 -0
- package/scripts/sw-pipeline-composer.sh +30 -39
- package/scripts/sw-pipeline-vitals.sh +30 -44
- package/scripts/sw-pipeline.sh +275 -6388
- package/scripts/sw-pm.sh +31 -41
- package/scripts/sw-pr-lifecycle.sh +30 -42
- package/scripts/sw-predictive.sh +32 -34
- package/scripts/sw-prep.sh +30 -19
- package/scripts/sw-ps.sh +32 -17
- package/scripts/sw-public-dashboard.sh +30 -40
- package/scripts/sw-quality.sh +42 -40
- package/scripts/sw-reaper.sh +32 -15
- package/scripts/sw-recruit.sh +428 -48
- package/scripts/sw-regression.sh +30 -38
- package/scripts/sw-release-manager.sh +30 -38
- package/scripts/sw-release.sh +29 -31
- package/scripts/sw-remote.sh +31 -40
- package/scripts/sw-replay.sh +30 -18
- package/scripts/sw-retro.sh +33 -42
- package/scripts/sw-scale.sh +41 -24
- package/scripts/sw-security-audit.sh +30 -20
- package/scripts/sw-self-optimize.sh +33 -37
- package/scripts/sw-session.sh +31 -15
- package/scripts/sw-setup.sh +30 -16
- package/scripts/sw-standup.sh +30 -20
- package/scripts/sw-status.sh +33 -13
- package/scripts/sw-strategic.sh +55 -43
- package/scripts/sw-stream.sh +33 -37
- package/scripts/sw-swarm.sh +30 -21
- package/scripts/sw-team-stages.sh +30 -38
- package/scripts/sw-templates.sh +31 -16
- package/scripts/sw-testgen.sh +30 -31
- package/scripts/sw-tmux-pipeline.sh +29 -31
- package/scripts/sw-tmux-role-color.sh +31 -0
- package/scripts/sw-tmux-status.sh +31 -0
- package/scripts/sw-tmux.sh +31 -15
- package/scripts/sw-trace.sh +30 -19
- package/scripts/sw-tracker-github.sh +31 -0
- package/scripts/sw-tracker-jira.sh +31 -0
- package/scripts/sw-tracker-linear.sh +31 -0
- package/scripts/sw-tracker.sh +30 -40
- package/scripts/sw-triage.sh +68 -61
- package/scripts/sw-upgrade.sh +30 -16
- package/scripts/sw-ux.sh +30 -35
- package/scripts/sw-webhook.sh +30 -25
- package/scripts/sw-widgets.sh +30 -19
- package/scripts/sw-worktree.sh +32 -15
- package/tmux/templates/doc-fleet.json +43 -0
package/scripts/sw-incident.sh
CHANGED
|
@@ -6,33 +6,42 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
23
|
-
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
|
-
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
16
|
+
# Canonical helpers (colors, output, events)
|
|
17
|
+
# shellcheck source=lib/helpers.sh
|
|
18
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
19
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
20
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
21
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
24
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
25
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
26
|
+
now_epoch() { date +%s; }
|
|
27
|
+
fi
|
|
28
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
29
|
+
emit_event() {
|
|
30
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
31
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
32
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
33
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
34
|
+
}
|
|
35
|
+
fi
|
|
36
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
37
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
38
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
39
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
40
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
41
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
42
|
+
DIM="${DIM:-\033[2m}"
|
|
43
|
+
BOLD="${BOLD:-\033[1m}"
|
|
44
|
+
RESET="${RESET:-\033[0m}"
|
|
36
45
|
|
|
37
46
|
format_duration() {
|
|
38
47
|
local secs="$1"
|
|
@@ -48,24 +57,6 @@ format_duration() {
|
|
|
48
57
|
# ─── Structured Event Log ──────────────────────────────────────────────────
|
|
49
58
|
EVENTS_FILE="${HOME}/.shipwright/events.jsonl"
|
|
50
59
|
|
|
51
|
-
emit_event() {
|
|
52
|
-
local event_type="$1"
|
|
53
|
-
shift
|
|
54
|
-
local json_fields=""
|
|
55
|
-
for kv in "$@"; do
|
|
56
|
-
local key="${kv%%=*}"
|
|
57
|
-
local val="${kv#*=}"
|
|
58
|
-
if [[ "$val" =~ ^-?[0-9]+\.?[0-9]*$ ]]; then
|
|
59
|
-
json_fields="${json_fields},\"${key}\":${val}"
|
|
60
|
-
else
|
|
61
|
-
val="${val//\"/\\\"}"
|
|
62
|
-
json_fields="${json_fields},\"${key}\":\"${val}\""
|
|
63
|
-
fi
|
|
64
|
-
done
|
|
65
|
-
mkdir -p "${HOME}/.shipwright"
|
|
66
|
-
echo "{\"ts\":\"$(now_iso)\",\"ts_epoch\":$(now_epoch),\"type\":\"${event_type}\"${json_fields}}" >> "$EVENTS_FILE"
|
|
67
|
-
}
|
|
68
|
-
|
|
69
60
|
# ─── State Directories ──────────────────────────────────────────────────────
|
|
70
61
|
INCIDENTS_DIR="${HOME}/.shipwright/incidents"
|
|
71
62
|
INCIDENT_CONFIG="${INCIDENTS_DIR}/config.json"
|
package/scripts/sw-init.sh
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
# ║ ║
|
|
9
9
|
# ║ --deploy Detect platform and generate deployed.json template ║
|
|
10
10
|
# ╚═══════════════════════════════════════════════════════════════════════════╝
|
|
11
|
-
VERSION="2.
|
|
11
|
+
VERSION="2.2.0"
|
|
12
12
|
set -euo pipefail
|
|
13
13
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
14
14
|
|
|
@@ -16,22 +16,39 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
16
16
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
17
17
|
ADAPTERS_DIR="$SCRIPT_DIR/adapters"
|
|
18
18
|
|
|
19
|
-
# ─── Colors ──────────────────────────────────────────────────────────────────
|
|
20
|
-
CYAN='\033[38;2;0;212;255m'
|
|
21
|
-
GREEN='\033[38;2;74;222;128m'
|
|
22
|
-
YELLOW='\033[38;2;250;204;21m'
|
|
23
|
-
RED='\033[38;2;248;113;113m'
|
|
24
|
-
DIM='\033[2m'
|
|
25
|
-
BOLD='\033[1m'
|
|
26
|
-
RESET='\033[0m'
|
|
27
|
-
|
|
28
19
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
29
20
|
# shellcheck source=lib/compat.sh
|
|
30
21
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
22
|
+
|
|
23
|
+
# Canonical helpers (colors, output, events)
|
|
24
|
+
# shellcheck source=lib/helpers.sh
|
|
25
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
26
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
27
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
28
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
29
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
30
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
31
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
32
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
33
|
+
now_epoch() { date +%s; }
|
|
34
|
+
fi
|
|
35
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
36
|
+
emit_event() {
|
|
37
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
38
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
39
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
40
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
41
|
+
}
|
|
42
|
+
fi
|
|
43
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
44
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
45
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
46
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
47
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
48
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
49
|
+
DIM="${DIM:-\033[2m}"
|
|
50
|
+
BOLD="${BOLD:-\033[1m}"
|
|
51
|
+
RESET="${RESET:-\033[0m}"
|
|
35
52
|
|
|
36
53
|
# ─── Flag parsing ───────────────────────────────────────────────────────────
|
|
37
54
|
DEPLOY_SETUP=false
|
package/scripts/sw-instrument.sh
CHANGED
|
@@ -6,33 +6,43 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
23
|
-
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
16
|
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
17
|
+
# Canonical helpers (colors, output, events)
|
|
18
|
+
# shellcheck source=lib/helpers.sh
|
|
19
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
20
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
21
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
24
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
25
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
26
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
27
|
+
now_epoch() { date +%s; }
|
|
28
|
+
fi
|
|
29
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
30
|
+
emit_event() {
|
|
31
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
32
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
33
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
34
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
38
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
39
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
40
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
41
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
42
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
43
|
+
DIM="${DIM:-\033[2m}"
|
|
44
|
+
BOLD="${BOLD:-\033[1m}"
|
|
45
|
+
RESET="${RESET:-\033[0m}"
|
|
36
46
|
|
|
37
47
|
format_duration() {
|
|
38
48
|
local secs="$1"
|
|
@@ -76,27 +86,6 @@ percent_delta() {
|
|
|
76
86
|
fi
|
|
77
87
|
}
|
|
78
88
|
|
|
79
|
-
# ─── Structured Event Log ──────────────────────────────────────────────────
|
|
80
|
-
EVENTS_FILE="${HOME}/.shipwright/events.jsonl"
|
|
81
|
-
|
|
82
|
-
emit_event() {
|
|
83
|
-
local event_type="$1"
|
|
84
|
-
shift
|
|
85
|
-
local json_fields=""
|
|
86
|
-
for kv in "$@"; do
|
|
87
|
-
local key="${kv%%=*}"
|
|
88
|
-
local val="${kv#*=}"
|
|
89
|
-
if [[ "$val" =~ ^-?[0-9]+\.?[0-9]*$ ]]; then
|
|
90
|
-
json_fields="${json_fields},\"${key}\":${val}"
|
|
91
|
-
else
|
|
92
|
-
val="${val//\"/\\\"}"
|
|
93
|
-
json_fields="${json_fields},\"${key}\":\"${val}\""
|
|
94
|
-
fi
|
|
95
|
-
done
|
|
96
|
-
mkdir -p "${HOME}/.shipwright"
|
|
97
|
-
echo "{\"ts\":\"$(now_iso)\",\"ts_epoch\":$(now_epoch),\"type\":\"${event_type}\"${json_fields}}" >> "$EVENTS_FILE"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
89
|
# ─── Instrumentation Storage ───────────────────────────────────────────────
|
|
101
90
|
INSTRUMENT_DIR="${HOME}/.shipwright/instrumentation"
|
|
102
91
|
INSTRUMENT_ACTIVE="${INSTRUMENT_DIR}/active"
|
|
@@ -6,54 +6,43 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
|
-
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
|
-
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
11
|
+
REPO_DIR="${REPO_DIR:-$(cd "$SCRIPT_DIR/.." && pwd)}"
|
|
23
12
|
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
16
|
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
emit_event
|
|
41
|
-
|
|
42
|
-
shift
|
|
43
|
-
local
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
17
|
+
# Canonical helpers (colors, output, events)
|
|
18
|
+
# shellcheck source=lib/helpers.sh
|
|
19
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
20
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
21
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
24
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
25
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
26
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
27
|
+
now_epoch() { date +%s; }
|
|
28
|
+
fi
|
|
29
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
30
|
+
emit_event() {
|
|
31
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
32
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
33
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
34
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
38
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
39
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
40
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
41
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
42
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
43
|
+
DIM="${DIM:-\033[2m}"
|
|
44
|
+
BOLD="${BOLD:-\033[1m}"
|
|
45
|
+
RESET="${RESET:-\033[0m}"
|
|
57
46
|
|
|
58
47
|
# ─── Intelligence Configuration ─────────────────────────────────────────────
|
|
59
48
|
INTELLIGENCE_CACHE="${REPO_DIR}/.claude/intelligence-cache.json"
|
|
@@ -254,9 +243,15 @@ _intelligence_call_claude() {
|
|
|
254
243
|
fi
|
|
255
244
|
|
|
256
245
|
# Call Claude (--print mode returns raw text response)
|
|
246
|
+
# Use timeout (gtimeout on macOS via coreutils, timeout on Linux) to prevent hangs
|
|
247
|
+
local _timeout_cmd=""
|
|
248
|
+
if command -v gtimeout &>/dev/null; then _timeout_cmd="gtimeout 60"
|
|
249
|
+
elif command -v timeout &>/dev/null; then _timeout_cmd="timeout 60"
|
|
250
|
+
fi
|
|
251
|
+
|
|
257
252
|
local response
|
|
258
|
-
if ! response=$(claude -p "$prompt" 2>/dev/null); then
|
|
259
|
-
error "Claude call failed"
|
|
253
|
+
if ! response=$($_timeout_cmd claude -p "$prompt" 2>/dev/null); then
|
|
254
|
+
error "Claude call failed or timed out"
|
|
260
255
|
echo '{"error":"claude_call_failed"}'
|
|
261
256
|
return 1
|
|
262
257
|
fi
|
package/scripts/sw-jira.sh
CHANGED
|
@@ -6,53 +6,43 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
23
|
-
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
local
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
16
|
+
|
|
17
|
+
# Canonical helpers (colors, output, events)
|
|
18
|
+
# shellcheck source=lib/helpers.sh
|
|
19
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
20
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
21
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
24
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
25
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
26
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
27
|
+
now_epoch() { date +%s; }
|
|
28
|
+
fi
|
|
29
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
30
|
+
emit_event() {
|
|
31
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
32
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
33
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
34
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
38
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
39
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
40
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
41
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
42
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
43
|
+
DIM="${DIM:-\033[2m}"
|
|
44
|
+
BOLD="${BOLD:-\033[1m}"
|
|
45
|
+
RESET="${RESET:-\033[0m}"
|
|
56
46
|
|
|
57
47
|
# ─── Configuration ─────────────────────────────────────────────────────────
|
|
58
48
|
CONFIG_DIR="${HOME}/.shipwright"
|
package/scripts/sw-launchd.sh
CHANGED
|
@@ -6,30 +6,43 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
23
|
-
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
16
|
|
|
28
|
-
#
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
# Canonical helpers (colors, output, events)
|
|
18
|
+
# shellcheck source=lib/helpers.sh
|
|
19
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
20
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
21
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
24
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
25
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
26
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
27
|
+
now_epoch() { date +%s; }
|
|
28
|
+
fi
|
|
29
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
30
|
+
emit_event() {
|
|
31
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
32
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
33
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
34
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
38
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
39
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
40
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
41
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
42
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
43
|
+
DIM="${DIM:-\033[2m}"
|
|
44
|
+
BOLD="${BOLD:-\033[1m}"
|
|
45
|
+
RESET="${RESET:-\033[0m}"
|
|
33
46
|
|
|
34
47
|
# ─── OS Detection ───────────────────────────────────────────────────────────
|
|
35
48
|
detect_os() {
|
package/scripts/sw-linear.sh
CHANGED
|
@@ -6,53 +6,43 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="2.
|
|
9
|
+
VERSION="2.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
13
|
-
# ─── Colors (matches Seth's tmux theme) ─────────────────────────────────────
|
|
14
|
-
CYAN='\033[38;2;0;212;255m' # #00d4ff — primary accent
|
|
15
|
-
PURPLE='\033[38;2;124;58;237m' # #7c3aed — secondary
|
|
16
|
-
BLUE='\033[38;2;0;102;255m' # #0066ff — tertiary
|
|
17
|
-
GREEN='\033[38;2;74;222;128m' # success
|
|
18
|
-
YELLOW='\033[38;2;250;204;21m' # warning
|
|
19
|
-
RED='\033[38;2;248;113;113m' # error
|
|
20
|
-
DIM='\033[2m'
|
|
21
|
-
BOLD='\033[1m'
|
|
22
|
-
RESET='\033[0m'
|
|
23
|
-
|
|
24
13
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
25
14
|
# shellcheck source=lib/compat.sh
|
|
26
15
|
[[ -f "$SCRIPT_DIR/lib/compat.sh" ]] && source "$SCRIPT_DIR/lib/compat.sh"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
local
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
16
|
+
|
|
17
|
+
# Canonical helpers (colors, output, events)
|
|
18
|
+
# shellcheck source=lib/helpers.sh
|
|
19
|
+
[[ -f "$SCRIPT_DIR/lib/helpers.sh" ]] && source "$SCRIPT_DIR/lib/helpers.sh"
|
|
20
|
+
# Fallbacks when helpers not loaded (e.g. test env with overridden SCRIPT_DIR)
|
|
21
|
+
[[ "$(type -t info 2>/dev/null)" == "function" ]] || info() { echo -e "\033[38;2;0;212;255m\033[1m▸\033[0m $*"; }
|
|
22
|
+
[[ "$(type -t success 2>/dev/null)" == "function" ]] || success() { echo -e "\033[38;2;74;222;128m\033[1m✓\033[0m $*"; }
|
|
23
|
+
[[ "$(type -t warn 2>/dev/null)" == "function" ]] || warn() { echo -e "\033[38;2;250;204;21m\033[1m⚠\033[0m $*"; }
|
|
24
|
+
[[ "$(type -t error 2>/dev/null)" == "function" ]] || error() { echo -e "\033[38;2;248;113;113m\033[1m✗\033[0m $*" >&2; }
|
|
25
|
+
if [[ "$(type -t now_iso 2>/dev/null)" != "function" ]]; then
|
|
26
|
+
now_iso() { date -u +"%Y-%m-%dT%H:%M:%SZ"; }
|
|
27
|
+
now_epoch() { date +%s; }
|
|
28
|
+
fi
|
|
29
|
+
if [[ "$(type -t emit_event 2>/dev/null)" != "function" ]]; then
|
|
30
|
+
emit_event() {
|
|
31
|
+
local event_type="$1"; shift; mkdir -p "${HOME}/.shipwright"
|
|
32
|
+
local payload="{\"ts\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"type\":\"$event_type\""
|
|
33
|
+
while [[ $# -gt 0 ]]; do local key="${1%%=*}" val="${1#*=}"; payload="${payload},\"${key}\":\"${val}\""; shift; done
|
|
34
|
+
echo "${payload}}" >> "${HOME}/.shipwright/events.jsonl"
|
|
35
|
+
}
|
|
36
|
+
fi
|
|
37
|
+
CYAN="${CYAN:-\033[38;2;0;212;255m}"
|
|
38
|
+
PURPLE="${PURPLE:-\033[38;2;124;58;237m}"
|
|
39
|
+
BLUE="${BLUE:-\033[38;2;0;102;255m}"
|
|
40
|
+
GREEN="${GREEN:-\033[38;2;74;222;128m}"
|
|
41
|
+
YELLOW="${YELLOW:-\033[38;2;250;204;21m}"
|
|
42
|
+
RED="${RED:-\033[38;2;248;113;113m}"
|
|
43
|
+
DIM="${DIM:-\033[2m}"
|
|
44
|
+
BOLD="${BOLD:-\033[1m}"
|
|
45
|
+
RESET="${RESET:-\033[0m}"
|
|
56
46
|
|
|
57
47
|
# ─── Configuration ─────────────────────────────────────────────────────────
|
|
58
48
|
CONFIG_DIR="${HOME}/.shipwright"
|