@indigoai-us/hq-cli 5.289.0 → 5.290.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/CHANGELOG.md +18 -1
- package/assets/scaffold/core/scripts/handoff-finalize.sh +670 -0
- package/assets/scaffold/core/scripts/handoff-open-steps.sh +81 -0
- package/assets/scaffold/core/scripts/handoff-post.sh +187 -0
- package/assets/scaffold/core/scripts/qmd-reindex-bg.sh +40 -0
- package/dist/command-catalog.generated.d.ts +51 -0
- package/dist/command-catalog.generated.js +63 -0
- package/dist/commands/core-handoff.d.ts +22 -0
- package/dist/commands/core-handoff.js +1240 -0
- package/dist/commands/core-ontology.d.ts +6 -1
- package/dist/commands/core-ontology.js +42 -7
- package/dist/commands/core.js +8 -1
- package/dist/lib/checkpoint-ontology/entity-file.d.ts +21 -0
- package/dist/lib/checkpoint-ontology/entity-file.js +100 -0
- package/dist/lib/checkpoint-ontology/merge-copies.d.ts +34 -2
- package/dist/lib/checkpoint-ontology/merge-copies.js +541 -27
- package/dist/lib/lanes/store.d.ts +4 -2
- package/dist/lib/lanes/store.js +7 -3
- package/dist/utils/self-update.d.ts +3 -0
- package/dist/utils/self-update.js +232 -1
- package/package.json +1 -1
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# hq-core: public
|
|
3
|
+
# handoff-open-steps.sh — list and close next steps across handoff threads
|
|
4
|
+
# (2026-09-07).
|
|
5
|
+
#
|
|
6
|
+
# Handoff threads record next_steps; since 2026-09-07 each carries an `id`
|
|
7
|
+
# (`<thread_id>#<n>`) and a `status` (open|done|dropped). This script is the
|
|
8
|
+
# closure side: /startwork and /resumework list what is still open instead of
|
|
9
|
+
# re-copying it forward, and a session closes a step when it is actually done.
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# handoff-open-steps.sh list [--limit N] [--company <slug>] [--json]
|
|
13
|
+
# handoff-open-steps.sh close <step-id> [--as done|dropped] [--note "<why>"]
|
|
14
|
+
# handoff-open-steps.sh reopen <step-id>
|
|
15
|
+
#
|
|
16
|
+
# Threads live in workspace/threads/T-*.json (and archive/**). Closing edits
|
|
17
|
+
# the step in place inside its thread file (only `status`, `closed_at`,
|
|
18
|
+
# `closed_by`, `note`) and bumps `updated_at`; nothing else in the thread is
|
|
19
|
+
# touched. Legacy steps without an id are listed with a synthetic id and can be
|
|
20
|
+
# closed the same way (the id is written on first close).
|
|
21
|
+
set -uo pipefail
|
|
22
|
+
HQ_ROOT="${HQ_ROOT:-${CLAUDE_PROJECT_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}}"
|
|
23
|
+
THREADS="$HQ_ROOT/workspace/threads"
|
|
24
|
+
command -v jq >/dev/null 2>&1 || { echo "handoff-open-steps: jq required" >&2; exit 2; }
|
|
25
|
+
CMD="${1:-list}"; shift || true
|
|
26
|
+
|
|
27
|
+
thread_files() { # newest first, handoffs and checkpoints only
|
|
28
|
+
find "$THREADS" -name 'T-*.json' ! -name '*.changeset.json' ! -path '*/resume-locks/*' 2>/dev/null \
|
|
29
|
+
| while IFS= read -r f; do printf '%s\t%s\n' "$(stat -c %Y "$f" 2>/dev/null || stat -f %m "$f")" "$f"; done \
|
|
30
|
+
| sort -rn | cut -f2
|
|
31
|
+
}
|
|
32
|
+
normalize_thread() { # <file> -> ensure every step has id/status (in memory)
|
|
33
|
+
jq -c '.next_steps = ((.next_steps // []) | to_entries | map(.key as $k |
|
|
34
|
+
(if (.value|type)=="string" then {step:.value} else .value end)
|
|
35
|
+
| .id = (.id // (input_filename|split("/")|last|sub("\\.json$";"")) + "#" + (($k+1)|tostring))
|
|
36
|
+
| .status = (.status // "open")) | map(del(.key)))' "$1"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
case "$CMD" in
|
|
40
|
+
list)
|
|
41
|
+
LIMIT=20; CO=""; JSON=0
|
|
42
|
+
while [ $# -gt 0 ]; do case "$1" in --limit) LIMIT="$2"; shift 2;; --company) CO="$2"; shift 2;; --json) JSON=1; shift;; *) shift;; esac; done
|
|
43
|
+
n=0; rows=""
|
|
44
|
+
while IFS= read -r f; do
|
|
45
|
+
[ -n "$f" ] || continue
|
|
46
|
+
[ "$n" -ge "$LIMIT" ] && break
|
|
47
|
+
n=$((n+1))
|
|
48
|
+
t="$(normalize_thread "$f" 2>/dev/null)" || continue
|
|
49
|
+
if [ -n "$CO" ]; then
|
|
50
|
+
printf '%s' "$t" | jq -e --arg co "$CO" '(.metadata.company // []) | index($co) != null' >/dev/null 2>&1 || continue
|
|
51
|
+
fi
|
|
52
|
+
rows="$rows$(printf '%s' "$t" | jq -c '{thread: .thread_id, title: (.metadata.title // ""), created: .created_at} as $h | .next_steps[] | select(.status == "open") | $h + {id, step}')
|
|
53
|
+
"
|
|
54
|
+
done < <(thread_files)
|
|
55
|
+
if [ "$JSON" = 1 ]; then printf '%s' "$rows" | jq -s 'map(select(. != null))'; exit 0; fi
|
|
56
|
+
if [ -z "$(printf '%s' "$rows" | tr -d '[:space:]')" ]; then echo "No open handoff steps in the last $n thread(s)."; exit 0; fi
|
|
57
|
+
printf '%s' "$rows" | jq -r '"\(.id) \(.step) [\(.title)]"'
|
|
58
|
+
;;
|
|
59
|
+
close|reopen)
|
|
60
|
+
ID="${1:-}"; shift || true
|
|
61
|
+
[ -n "$ID" ] || { echo "usage: $CMD <step-id>" >&2; exit 2; }
|
|
62
|
+
AS="done"; NOTE=""
|
|
63
|
+
while [ $# -gt 0 ]; do case "$1" in --as) AS="$2"; shift 2;; --note) NOTE="$2"; shift 2;; *) shift;; esac; done
|
|
64
|
+
[ "$CMD" = reopen ] && AS="open"
|
|
65
|
+
case "$AS" in done|dropped|open) ;; *) echo "--as must be done|dropped" >&2; exit 2;; esac
|
|
66
|
+
tid="${ID%%#*}"
|
|
67
|
+
f="$(find "$THREADS" -name "$tid.json" ! -path '*/resume-locks/*' 2>/dev/null | head -1)"
|
|
68
|
+
[ -n "$f" ] || { echo "handoff-open-steps: thread $tid not found under $THREADS" >&2; exit 3; }
|
|
69
|
+
now="$(date -u +%Y-%m-%dT%H:%M:%SZ)"; by="${HQ_SESSION_ID:-${CLAUDE_SESSION_ID:-unknown-session}}"
|
|
70
|
+
normalize_thread "$f" | jq --arg id "$ID" --arg as "$AS" --arg now "$now" --arg by "$by" --arg note "$NOTE" '
|
|
71
|
+
if ([.next_steps[] | select(.id == $id)] | length) == 0 then error("step \($id) not in thread") else . end
|
|
72
|
+
| .next_steps = (.next_steps | map(if .id == $id then
|
|
73
|
+
(if $as == "open" then del(.closed_at, .closed_by) | .status = "open"
|
|
74
|
+
else .status = $as | .closed_at = $now | .closed_by = $by | (if $note != "" then .note = $note else . end) end)
|
|
75
|
+
else . end))
|
|
76
|
+
| .updated_at = $now' > "$f.tmp" 2>"$f.err" || { cat "$f.err" >&2; rm -f "$f.tmp" "$f.err"; exit 3; }
|
|
77
|
+
rm -f "$f.err"; mv "$f.tmp" "$f"
|
|
78
|
+
echo "handoff-open-steps: $ID -> $AS"
|
|
79
|
+
;;
|
|
80
|
+
*) sed -n 2,22p "$0"; exit 2 ;;
|
|
81
|
+
esac
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# handoff-post.sh — detached post-handoff orchestrator.
|
|
3
|
+
#
|
|
4
|
+
# Runs AFTER handoff-finalize.sh emits handoff.json. Does the mechanical work
|
|
5
|
+
# that used to burn foreground-session tokens:
|
|
6
|
+
# 1. Archive old threads (60d), then regen thread INDEX.md + recent.md (bash)
|
|
7
|
+
# 2. Regen orchestrator INDEX.md (bash)
|
|
8
|
+
# 3. qmd reindex via qmd-reindex-bg.sh (single-flight; agent boxes skip)
|
|
9
|
+
#
|
|
10
|
+
# Model work is intentionally not launched from this detached shell. /learn and
|
|
11
|
+
# /document-release follow-ups run from the handoff skill itself, so auth
|
|
12
|
+
# failures cannot disappear into /tmp logs.
|
|
13
|
+
#
|
|
14
|
+
# Usage (called by handoff skill as `nohup handoff-post.sh ... &`):
|
|
15
|
+
# core/scripts/handoff-post.sh <thread_path> [learnings_json_file]
|
|
16
|
+
|
|
17
|
+
set -euo pipefail
|
|
18
|
+
|
|
19
|
+
HQ_ROOT="${HQ_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
|
|
20
|
+
cd "$HQ_ROOT"
|
|
21
|
+
|
|
22
|
+
THREAD_PATH="${1:-}"
|
|
23
|
+
LEARNINGS_FILE="${2:-}"
|
|
24
|
+
|
|
25
|
+
LOG_DIR="${HANDOFF_LOG_DIR:-/tmp}"
|
|
26
|
+
LOG_MAIN="${LOG_DIR}/handoff-post.log"
|
|
27
|
+
LOG_QMD="${LOG_DIR}/qmd-handoff.log"
|
|
28
|
+
|
|
29
|
+
TS=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
30
|
+
|
|
31
|
+
log() { echo "[${TS}] $*" >> "$LOG_MAIN"; }
|
|
32
|
+
|
|
33
|
+
: > "$LOG_MAIN"
|
|
34
|
+
log "handoff-post starting (thread=${THREAD_PATH:-none}, learnings=${LEARNINGS_FILE:-none})"
|
|
35
|
+
|
|
36
|
+
# --- 1. Archive old threads (gated once per 24h) ---
|
|
37
|
+
if hq core archive-old-threads --gated >>"$LOG_MAIN" 2>&1; then
|
|
38
|
+
log "archive: ok"
|
|
39
|
+
else
|
|
40
|
+
log "archive: error (continuing)"
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# --- 2. Regen thread INDEX + recent (bash, no Claude) ---
|
|
44
|
+
if hq core rebuild-index threads --both >>"$LOG_MAIN" 2>&1; then
|
|
45
|
+
log "threads-index: ok"
|
|
46
|
+
else
|
|
47
|
+
log "threads-index: error (continuing)"
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# --- 3. Regen orchestrator INDEX (bash, no Claude) ---
|
|
51
|
+
if hq core rebuild-index orchestrator >>"$LOG_MAIN" 2>&1; then
|
|
52
|
+
log "orchestrator-index: ok"
|
|
53
|
+
else
|
|
54
|
+
log "orchestrator-index: error (continuing)"
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
if [[ -n "$LEARNINGS_FILE" && -s "$LEARNINGS_FILE" ]]; then
|
|
58
|
+
learning_count=$(jq 'if type == "array" then length else 0 end' "$LEARNINGS_FILE" 2>/dev/null || echo 0)
|
|
59
|
+
if [[ "${learning_count:-0}" -gt 0 ]]; then
|
|
60
|
+
log "learn: eligible and pending runtime dispatch by handoff skill (${learning_count} learning(s); no dispatch proof)"
|
|
61
|
+
else
|
|
62
|
+
log "learn: no learnings to dispatch"
|
|
63
|
+
fi
|
|
64
|
+
else
|
|
65
|
+
log "learn: no learnings file provided"
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if [[ -n "$THREAD_PATH" && -f "$THREAD_PATH" ]]; then
|
|
69
|
+
if scope_counts=$(jq -r '
|
|
70
|
+
(.files_touched // []) as $files
|
|
71
|
+
| (if ($files | type) == "array" then
|
|
72
|
+
[$files[] |
|
|
73
|
+
if type == "string" then .
|
|
74
|
+
elif type == "object" and (.path | type) == "string" then .path
|
|
75
|
+
else null
|
|
76
|
+
end]
|
|
77
|
+
else [] end) as $paths
|
|
78
|
+
| [
|
|
79
|
+
($paths | map(select(if type == "string" then test("^(companies|repos)/") else false end)) | length),
|
|
80
|
+
($paths | map(select(. == null)) | length)
|
|
81
|
+
]
|
|
82
|
+
| @tsv
|
|
83
|
+
' "$THREAD_PATH" 2>/dev/null); then
|
|
84
|
+
IFS=$'\t' read -r scope_match skipped_count <<< "$scope_counts"
|
|
85
|
+
else
|
|
86
|
+
scope_match=0
|
|
87
|
+
skipped_count=0
|
|
88
|
+
log "document-release: skipped (invalid thread JSON)"
|
|
89
|
+
fi
|
|
90
|
+
for ((skipped_index = 0; skipped_index < skipped_count; skipped_index++)); do
|
|
91
|
+
log "document-release: skipped unsupported files_touched entry"
|
|
92
|
+
done
|
|
93
|
+
if [[ "$scope_match" -gt 0 ]]; then
|
|
94
|
+
if bash "$HQ_ROOT/core/scripts/skill-installed.sh" document-release "${HQ_ACTIVE_COMPANY:-}" >/dev/null 2>>"$LOG_MAIN"; then
|
|
95
|
+
log "document-release: eligible and pending runtime dispatch by handoff skill ($scope_match scoped files; no dispatch proof)"
|
|
96
|
+
else
|
|
97
|
+
log "document-release: skipped (skill not installed)"
|
|
98
|
+
fi
|
|
99
|
+
else
|
|
100
|
+
log "document-release: skipped (no company/repo files in files_touched)"
|
|
101
|
+
fi
|
|
102
|
+
else
|
|
103
|
+
log "document-release: skipped (no thread path)"
|
|
104
|
+
fi
|
|
105
|
+
|
|
106
|
+
# --- 3b. Push company handoff mirrors promptly (best effort) ---
|
|
107
|
+
# Session snapshots are intentionally gitignored, so a completed mirror needs
|
|
108
|
+
# the sync client to make the handoff available to a second device. Trust only
|
|
109
|
+
# the finalizer's lowercase company-slug metadata before constructing a path.
|
|
110
|
+
if [[ -n "$THREAD_PATH" && -f "$THREAD_PATH" ]] && command -v hq >/dev/null 2>&1; then
|
|
111
|
+
while IFS= read -r company; do
|
|
112
|
+
[[ "$company" =~ ^[a-z][a-z0-9_-]*$ ]] || continue
|
|
113
|
+
[[ -d "$HQ_ROOT/companies/$company/workspace" ]] || continue
|
|
114
|
+
if hq sync push --company "$company" "companies/$company/workspace" >>"$LOG_MAIN" 2>&1; then
|
|
115
|
+
log "workspace-sync: pushed companies/$company/workspace"
|
|
116
|
+
else
|
|
117
|
+
log "workspace-sync: failed companies/$company/workspace"
|
|
118
|
+
fi
|
|
119
|
+
done < <(jq -r '.metadata.company // empty | if type == "array" then .[] else . end' "$THREAD_PATH" 2>/dev/null || true)
|
|
120
|
+
elif [[ -n "$THREAD_PATH" && -f "$THREAD_PATH" ]]; then
|
|
121
|
+
log "workspace-sync: skipped (hq CLI unavailable)"
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# --- 4. qmd reindex (agent: skip; laptop: single-flight) ---
|
|
125
|
+
# handoff-finalize may already have run the helper; agent boxes no-op
|
|
126
|
+
# (skipped-agent). Never dual-nohup raw cleanup+update+embed on agents.
|
|
127
|
+
# Never invoke managed index wrappers — handoff owns no agent freshness.
|
|
128
|
+
# Prefer Core US-001 helper; fleet binary only if Core file is missing.
|
|
129
|
+
# Lock acquisition runs BEFORE the US-010 session_end spawn so a detached
|
|
130
|
+
# session-end hook cannot delay or interleave with finalize+post single-flight.
|
|
131
|
+
_QMD_BG="$HQ_ROOT/core/scripts/qmd-reindex-bg.sh"
|
|
132
|
+
if [[ ! -f "$_QMD_BG" ]] && [[ -x /usr/local/bin/hq-agent-qmd-reindex-bg ]]; then
|
|
133
|
+
_QMD_BG=/usr/local/bin/hq-agent-qmd-reindex-bg
|
|
134
|
+
fi
|
|
135
|
+
if [[ -x "$_QMD_BG" ]] || [[ -f "$_QMD_BG" ]]; then
|
|
136
|
+
_qmd_out="$(bash "$_QMD_BG" --log "$LOG_QMD" 2>/dev/null || true)"
|
|
137
|
+
# Empty stdout is busy/dedupe quiet — never claim "ok".
|
|
138
|
+
log "qmd: reindex-bg → ${_qmd_out:-busy-or-quiet}"
|
|
139
|
+
elif [[ -d /var/lib/hq-agent ]]; then
|
|
140
|
+
log "qmd: skipped-agent (no helper; indexer owns freshness)"
|
|
141
|
+
else
|
|
142
|
+
log "qmd: skipped (helper missing)"
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
# --- 4b. Work Mesh Live: enqueue session_end (US-010) ---
|
|
146
|
+
# Detached + non-blocking. Presence ends via spool; daemon flushes.
|
|
147
|
+
# Same launch shape as the former work-mesh-close hook (nohup + disown).
|
|
148
|
+
# Runs AFTER qmd reindex so this path cannot perturb single-flight lock
|
|
149
|
+
# acquisition order or spawn count. Guarded: older checkouts skip quietly.
|
|
150
|
+
WM_END_HOOK="$HQ_ROOT/core/hooks/SessionEnd/35-work-mesh-session-end.sh"
|
|
151
|
+
if [[ -f "$WM_END_HOOK" ]]; then
|
|
152
|
+
sid=""
|
|
153
|
+
if [[ -f "$HQ_ROOT/workspace/sessions/.current" ]]; then
|
|
154
|
+
sid="$(tr -d '[:space:]' <"$HQ_ROOT/workspace/sessions/.current" 2>/dev/null || true)"
|
|
155
|
+
fi
|
|
156
|
+
if [[ -n "$sid" ]]; then
|
|
157
|
+
payload=$(printf '{"session_id":"%s"}' "$sid")
|
|
158
|
+
else
|
|
159
|
+
payload='{}'
|
|
160
|
+
fi
|
|
161
|
+
HQ_ROOT="$HQ_ROOT" CLAUDE_CODE_SESSION_ID="${sid:-}" \
|
|
162
|
+
nohup bash -c 'printf "%s\n" "$1" | bash "$2" SessionEnd' \
|
|
163
|
+
_ "$payload" "$WM_END_HOOK" \
|
|
164
|
+
>>"${LOG_DIR}/work-mesh-session-end.log" 2>&1 </dev/null &
|
|
165
|
+
disown 2>/dev/null || true
|
|
166
|
+
log "work-mesh-session-end: launched PID $!"
|
|
167
|
+
else
|
|
168
|
+
log "work-mesh-session-end: skipped (hook absent)"
|
|
169
|
+
fi
|
|
170
|
+
|
|
171
|
+
# --- 5. Worktree GC (gated once-per-24h, detached, fully fail-soft) ---
|
|
172
|
+
# HQ worktrees accumulate forever and can reach hundreds of GB. Opportunistically
|
|
173
|
+
# GC the provably-safe stale ones on every handoff. --gated caps this to once per
|
|
174
|
+
# 24h; --apply lets it actually remove (the script's own guards keep it to clean,
|
|
175
|
+
# old, branch-preserved, unreferenced worktrees only). Launched DETACHED because
|
|
176
|
+
# the safety check fetches from origin per repo — it must never block or fail the
|
|
177
|
+
# handoff. Guarded so an older checkout without the script simply skips it.
|
|
178
|
+
WT_GC="$HQ_ROOT/core/scripts/worktree-gc.sh"
|
|
179
|
+
if [[ -f "$WT_GC" ]]; then
|
|
180
|
+
HQ_ROOT="$HQ_ROOT" nohup bash "$WT_GC" --apply --gated >>"${LOG_DIR}/worktree-gc.log" 2>&1 </dev/null &
|
|
181
|
+
disown 2>/dev/null || true
|
|
182
|
+
log "worktree-gc: launched PID $! (--apply --gated)"
|
|
183
|
+
else
|
|
184
|
+
log "worktree-gc: skipped (script absent)"
|
|
185
|
+
fi
|
|
186
|
+
|
|
187
|
+
log "handoff-post complete"
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# FORWARDER — the implementation of this script now lives in the hq CLI.
|
|
3
|
+
#
|
|
4
|
+
# It runs as `hq index background`. This file stays behind so every existing
|
|
5
|
+
# caller — skills, other scripts, CI, and muscle memory — keeps working against
|
|
6
|
+
# the path it already knows.
|
|
7
|
+
#
|
|
8
|
+
# Why the implementation moved: the single-flight background reindex is a
|
|
9
|
+
# durable state machine (lock ownership, stale reclaim, completion stamps,
|
|
10
|
+
# signal cleanup) that belongs in tested code rather than 700 lines of shell.
|
|
11
|
+
#
|
|
12
|
+
# Equivalence is not assumed. hq-cli's e2e/qmd-background-differential.test.ts
|
|
13
|
+
# runs a byte-frozen copy of this script's pre-migration source against the CLI
|
|
14
|
+
# over identical injected worlds and compares exit status, stdout, the qmd argv
|
|
15
|
+
# sequence, and the resulting lock/stamp state: agent short-circuit before any
|
|
16
|
+
# qmd lookup or lock, empty-HOME silence, cleanup->update->embed ordering with a
|
|
17
|
+
# completion stamp, no stamp after a failed update, and no competing writer
|
|
18
|
+
# behind a held lock.
|
|
19
|
+
#
|
|
20
|
+
# ONE INTENDED DIVERGENCE: this script printed "skipped" when no qmd was on
|
|
21
|
+
# PATH. The CLI bundles qmd (@tobilu/qmd is a dependency, resolved via
|
|
22
|
+
# node_modules/.bin since hq-cli 5.94.1), so it proceeds instead of skipping.
|
|
23
|
+
# That is the point of bundling; see hq-cli#333.
|
|
24
|
+
#
|
|
25
|
+
# The ABI is otherwise preserved: arguments are forwarded unchanged, stdin is
|
|
26
|
+
# never read by this file, stdout and stderr are inherited untouched, and the
|
|
27
|
+
# child replaces this process so its exit code and signal disposition become the
|
|
28
|
+
# caller's.
|
|
29
|
+
|
|
30
|
+
set -euo pipefail
|
|
31
|
+
|
|
32
|
+
HQ_ROOT="${HQ_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)}"
|
|
33
|
+
|
|
34
|
+
if ! command -v hq >/dev/null 2>&1; then
|
|
35
|
+
echo "qmd-reindex-bg.sh: requires the hq CLI — this script's implementation now ships with it." >&2
|
|
36
|
+
echo "Install it with: npm install -g @indigoai-us/hq-cli" >&2
|
|
37
|
+
exit 127
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
exec hq index background --hq-root "$HQ_ROOT" "$@"
|
|
@@ -5208,6 +5208,9 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
5208
5208
|
}, {
|
|
5209
5209
|
readonly flags: "--only <file>";
|
|
5210
5210
|
readonly description: "handle only the copy -> original pairs listed in this JSON file";
|
|
5211
|
+
}, {
|
|
5212
|
+
readonly flags: "--rewrite-refs";
|
|
5213
|
+
readonly description: "also re-point signal refs, invoice, source and knowledge links to the survivor and carry external ids and web domains (checkpoint.ontology.merge-rewrite-refs)";
|
|
5211
5214
|
}, {
|
|
5212
5215
|
readonly flags: "--json";
|
|
5213
5216
|
readonly description: "print JSON";
|
|
@@ -5402,6 +5405,54 @@ export declare const COMMAND_CATALOG: readonly [{
|
|
|
5402
5405
|
readonly options: readonly [];
|
|
5403
5406
|
readonly subcommands: readonly [];
|
|
5404
5407
|
}];
|
|
5408
|
+
}, {
|
|
5409
|
+
readonly name: "handoff";
|
|
5410
|
+
readonly description: "Handoff session helpers";
|
|
5411
|
+
readonly aliases: readonly [];
|
|
5412
|
+
readonly hidden: false;
|
|
5413
|
+
readonly usage: "[options] [command]";
|
|
5414
|
+
readonly arguments: readonly [];
|
|
5415
|
+
readonly options: readonly [];
|
|
5416
|
+
readonly subcommands: readonly [{
|
|
5417
|
+
readonly name: "finalize";
|
|
5418
|
+
readonly description: "Write and commit the current session handoff";
|
|
5419
|
+
readonly aliases: readonly [];
|
|
5420
|
+
readonly hidden: false;
|
|
5421
|
+
readonly usage: "[args...]";
|
|
5422
|
+
readonly arguments: readonly [{
|
|
5423
|
+
readonly name: "args";
|
|
5424
|
+
readonly required: false;
|
|
5425
|
+
readonly variadic: true;
|
|
5426
|
+
}];
|
|
5427
|
+
readonly options: readonly [];
|
|
5428
|
+
readonly subcommands: readonly [];
|
|
5429
|
+
}, {
|
|
5430
|
+
readonly name: "post";
|
|
5431
|
+
readonly description: "Run best-effort post-handoff maintenance";
|
|
5432
|
+
readonly aliases: readonly [];
|
|
5433
|
+
readonly hidden: false;
|
|
5434
|
+
readonly usage: "[args...]";
|
|
5435
|
+
readonly arguments: readonly [{
|
|
5436
|
+
readonly name: "args";
|
|
5437
|
+
readonly required: false;
|
|
5438
|
+
readonly variadic: true;
|
|
5439
|
+
}];
|
|
5440
|
+
readonly options: readonly [];
|
|
5441
|
+
readonly subcommands: readonly [];
|
|
5442
|
+
}, {
|
|
5443
|
+
readonly name: "open-steps";
|
|
5444
|
+
readonly description: "List and update open handoff steps";
|
|
5445
|
+
readonly aliases: readonly [];
|
|
5446
|
+
readonly hidden: false;
|
|
5447
|
+
readonly usage: "[args...]";
|
|
5448
|
+
readonly arguments: readonly [{
|
|
5449
|
+
readonly name: "args";
|
|
5450
|
+
readonly required: false;
|
|
5451
|
+
readonly variadic: true;
|
|
5452
|
+
}];
|
|
5453
|
+
readonly options: readonly [];
|
|
5454
|
+
readonly subcommands: readonly [];
|
|
5455
|
+
}];
|
|
5405
5456
|
}, {
|
|
5406
5457
|
readonly name: "knowledge-prefs";
|
|
5407
5458
|
readonly description: "Resolve a company knowledge-store preference";
|
|
@@ -6734,6 +6734,10 @@ export const COMMAND_CATALOG = [
|
|
|
6734
6734
|
"flags": "--only <file>",
|
|
6735
6735
|
"description": "handle only the copy -> original pairs listed in this JSON file"
|
|
6736
6736
|
},
|
|
6737
|
+
{
|
|
6738
|
+
"flags": "--rewrite-refs",
|
|
6739
|
+
"description": "also re-point signal refs, invoice, source and knowledge links to the survivor and carry external ids and web domains (checkpoint.ontology.merge-rewrite-refs)"
|
|
6740
|
+
},
|
|
6737
6741
|
{
|
|
6738
6742
|
"flags": "--json",
|
|
6739
6743
|
"description": "print JSON"
|
|
@@ -6976,6 +6980,65 @@ export const COMMAND_CATALOG = [
|
|
|
6976
6980
|
}
|
|
6977
6981
|
]
|
|
6978
6982
|
},
|
|
6983
|
+
{
|
|
6984
|
+
"name": "handoff",
|
|
6985
|
+
"description": "Handoff session helpers",
|
|
6986
|
+
"aliases": [],
|
|
6987
|
+
"hidden": false,
|
|
6988
|
+
"usage": "[options] [command]",
|
|
6989
|
+
"arguments": [],
|
|
6990
|
+
"options": [],
|
|
6991
|
+
"subcommands": [
|
|
6992
|
+
{
|
|
6993
|
+
"name": "finalize",
|
|
6994
|
+
"description": "Write and commit the current session handoff",
|
|
6995
|
+
"aliases": [],
|
|
6996
|
+
"hidden": false,
|
|
6997
|
+
"usage": "[args...]",
|
|
6998
|
+
"arguments": [
|
|
6999
|
+
{
|
|
7000
|
+
"name": "args",
|
|
7001
|
+
"required": false,
|
|
7002
|
+
"variadic": true
|
|
7003
|
+
}
|
|
7004
|
+
],
|
|
7005
|
+
"options": [],
|
|
7006
|
+
"subcommands": []
|
|
7007
|
+
},
|
|
7008
|
+
{
|
|
7009
|
+
"name": "post",
|
|
7010
|
+
"description": "Run best-effort post-handoff maintenance",
|
|
7011
|
+
"aliases": [],
|
|
7012
|
+
"hidden": false,
|
|
7013
|
+
"usage": "[args...]",
|
|
7014
|
+
"arguments": [
|
|
7015
|
+
{
|
|
7016
|
+
"name": "args",
|
|
7017
|
+
"required": false,
|
|
7018
|
+
"variadic": true
|
|
7019
|
+
}
|
|
7020
|
+
],
|
|
7021
|
+
"options": [],
|
|
7022
|
+
"subcommands": []
|
|
7023
|
+
},
|
|
7024
|
+
{
|
|
7025
|
+
"name": "open-steps",
|
|
7026
|
+
"description": "List and update open handoff steps",
|
|
7027
|
+
"aliases": [],
|
|
7028
|
+
"hidden": false,
|
|
7029
|
+
"usage": "[args...]",
|
|
7030
|
+
"arguments": [
|
|
7031
|
+
{
|
|
7032
|
+
"name": "args",
|
|
7033
|
+
"required": false,
|
|
7034
|
+
"variadic": true
|
|
7035
|
+
}
|
|
7036
|
+
],
|
|
7037
|
+
"options": [],
|
|
7038
|
+
"subcommands": []
|
|
7039
|
+
}
|
|
7040
|
+
]
|
|
7041
|
+
},
|
|
6979
7042
|
{
|
|
6980
7043
|
"name": "knowledge-prefs",
|
|
6981
7044
|
"description": "Resolve a company knowledge-store preference",
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Native implementations of the handoff scaffold command family. */
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
type RunResult = {
|
|
4
|
+
code: number;
|
|
5
|
+
stdout: string;
|
|
6
|
+
stderr: string;
|
|
7
|
+
};
|
|
8
|
+
type HandoffContext = {
|
|
9
|
+
root: string;
|
|
10
|
+
cwd: string;
|
|
11
|
+
now?: () => Date;
|
|
12
|
+
/** Test-only override for the finalizer's historical fixed /tmp paths. */
|
|
13
|
+
tmpDir?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function runHandoffOpenSteps(args: string[], context: HandoffContext): RunResult;
|
|
16
|
+
export declare function runHandoffFinalize(args: string[], context: HandoffContext): RunResult;
|
|
17
|
+
export declare function runHandoffPost(args: string[], context: HandoffContext): RunResult | Promise<RunResult>;
|
|
18
|
+
export declare function runHandoffPostWorker(args: string[], context: HandoffContext): RunResult;
|
|
19
|
+
/** Register native handoff commands behind the shared default-off flag. */
|
|
20
|
+
export declare function registerCoreHandoffCommand(core: Command): void;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=core-handoff.d.ts.map
|