@indigoai-us/hq-cli 5.345.118 → 5.345.119
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 +10 -0
- package/assets/scaffold/core/scripts/pipeline-conductor.sh +2671 -0
- package/assets/scaffold/core/scripts/pipeline-driver.sh +820 -0
- package/assets/scaffold/core/scripts/pipeline-envelope.sh +211 -0
- package/dist/command-catalog.generated.d.ts +34 -0
- package/dist/command-catalog.generated.js +40 -0
- package/dist/commands/core-checkpoint-native.d.ts +17 -3
- package/dist/commands/core-checkpoint-native.js +48 -8
- package/dist/commands/core-derive-trigger-facts-native.js +15 -7
- package/dist/commands/core-migrate-policy-triggers-native.js +3 -1
- package/dist/commands/core-pipeline-conductor-command.d.ts +5 -0
- package/dist/commands/core-pipeline-conductor-command.js +138 -0
- package/dist/commands/core-pipeline-conductor-native.d.ts +7 -0
- package/dist/commands/core-pipeline-conductor-native.js +2950 -0
- package/dist/commands/core-pipeline-driver-native.d.ts +24 -0
- package/dist/commands/core-pipeline-driver-native.js +843 -0
- package/dist/commands/core-pipeline-driver-process.d.ts +4 -0
- package/dist/commands/core-pipeline-driver-process.js +68 -0
- package/dist/commands/core-pipeline-envelope-native.d.ts +4 -0
- package/dist/commands/core-pipeline-envelope-native.js +87 -0
- package/dist/commands/core-policy.js +3 -0
- package/dist/commands/core-worker-lint-native.d.ts +0 -1
- package/dist/commands/core-worker-lint-native.js +0 -1
- package/dist/commands/core-worker-share-native.js +2 -2
- package/dist/commands/core-worker-skills-command.d.ts +1 -1
- package/dist/commands/core-worker-skills-command.js +3 -20
- package/dist/commands/core.d.ts +5 -1
- package/dist/commands/core.js +8 -9
- package/dist/commands/storage-gate.d.ts +4 -3
- package/dist/commands/storage-gate.js +4 -3
- package/dist/fast-scaffold.js +0 -2
- package/dist/lib/storage-feature-flag.d.ts +7 -7
- package/package.json +1 -1
- package/assets/scaffold/core/scripts/lint-shared-worker-skills.sh +0 -197
- package/assets/scaffold/core/scripts/share-worker-skill.sh +0 -178
- package/dist/commands/core-native-worker-skills-flag.d.ts +0 -4
- package/dist/commands/core-native-worker-skills-flag.js +0 -7
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# share-worker-skill.sh — convert duplicated worker-scoped skill copies into a
|
|
3
|
-
# single canonical file plus relative symlinks, the migration step for the
|
|
4
|
-
# shared-worker-skills convention (core/knowledge/public/hq-core/shared-worker-skills.md).
|
|
5
|
-
#
|
|
6
|
-
# This performs the ONLY mechanical move the design needs: it never edits any
|
|
7
|
-
# worker.yaml (the skill name still resolves to the same path — only the file
|
|
8
|
-
# type changes from regular file to symlink), and it never touches a skill
|
|
9
|
-
# resolver. `/run` reads {worker}/skills/{skill}.md and follows the symlink
|
|
10
|
-
# transparently, so the change is purely file-layout.
|
|
11
|
-
#
|
|
12
|
-
# Usage:
|
|
13
|
-
# share-worker-skill.sh <scope-dir> <skill-name> <worker-skill-path> [<worker-skill-path> ...]
|
|
14
|
-
#
|
|
15
|
-
# <scope-dir> The narrowest scope that contains EVERY sharing worker,
|
|
16
|
-
# e.g. core/workers, core/packages/<pack>/workers, or
|
|
17
|
-
# companies/<co>/workers. The canonical file is created at
|
|
18
|
-
# <scope-dir>/_shared-skills/<skill-name>.md.
|
|
19
|
-
# <skill-name> Bare skill name (no .md), e.g. e2e-testing.
|
|
20
|
-
# <worker-skill-path> Each worker's current copy, e.g.
|
|
21
|
-
# core/workers/foo/skills/e2e-testing.md
|
|
22
|
-
#
|
|
23
|
-
# Safety rails:
|
|
24
|
-
# * Every worker path MUST live under <scope-dir> (no cross-scope symlinks,
|
|
25
|
-
# which would break on pack install / hq-sync). Refuses otherwise.
|
|
26
|
-
# * If no canonical exists yet, the FIRST worker path is promoted to canonical.
|
|
27
|
-
# * A worker copy whose content DIFFERS from the canonical is a DRIFTED copy:
|
|
28
|
-
# the script refuses and tells you to reconcile by hand first (the human
|
|
29
|
-
# decision the design reserves — never a silent overwrite). Re-run after
|
|
30
|
-
# reconciling, or pass --force to accept the canonical for that copy.
|
|
31
|
-
# * Idempotent: a path already symlinked to the canonical is left alone.
|
|
32
|
-
# * DRY-RUN BY DEFAULT. Pass --apply to make changes.
|
|
33
|
-
|
|
34
|
-
set -euo pipefail
|
|
35
|
-
|
|
36
|
-
APPLY=0
|
|
37
|
-
FORCE=0
|
|
38
|
-
args=()
|
|
39
|
-
for a in "$@"; do
|
|
40
|
-
case "$a" in
|
|
41
|
-
--apply) APPLY=1 ;;
|
|
42
|
-
--force) FORCE=1 ;;
|
|
43
|
-
-*) echo "unknown flag: $a" >&2; exit 2 ;;
|
|
44
|
-
*) args+=("$a") ;;
|
|
45
|
-
esac
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
if [[ ${#args[@]} -lt 3 ]]; then
|
|
49
|
-
echo "usage: $0 [--apply] [--force] <scope-dir> <skill-name> <worker-skill-path>..." >&2
|
|
50
|
-
exit 2
|
|
51
|
-
fi
|
|
52
|
-
|
|
53
|
-
repo_root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
|
54
|
-
cd "$repo_root"
|
|
55
|
-
|
|
56
|
-
scope_dir="${args[0]%/}"
|
|
57
|
-
skill_name="${args[1]}"
|
|
58
|
-
worker_paths=("${args[@]:2}")
|
|
59
|
-
|
|
60
|
-
if [[ ! "$skill_name" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then
|
|
61
|
-
echo "error: skill-name '$skill_name' is not a bare skill name (no slashes, no .md)" >&2
|
|
62
|
-
exit 2
|
|
63
|
-
fi
|
|
64
|
-
if [[ ! -d "$scope_dir" ]]; then
|
|
65
|
-
echo "error: scope dir does not exist: $scope_dir" >&2
|
|
66
|
-
exit 2
|
|
67
|
-
fi
|
|
68
|
-
|
|
69
|
-
canonical="$scope_dir/_shared-skills/$skill_name.md"
|
|
70
|
-
|
|
71
|
-
note() { printf '%s\n' "$*"; }
|
|
72
|
-
would() { if [[ $APPLY -eq 1 ]]; then note " did: $*"; else note " would: $*"; fi; }
|
|
73
|
-
|
|
74
|
-
# Normalize a path to repo-relative without requiring GNU realpath (macOS-safe).
|
|
75
|
-
rel_under() { # rel_under <path> <dir> → 0 if <path> is inside <dir>
|
|
76
|
-
local p="${1#./}" d="${2#./}"
|
|
77
|
-
[[ "$p" == "$d/"* ]]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
# rel_path <from-dir> <to-file> → relative path from <from-dir> to <to-file>,
|
|
81
|
-
# computed purely from the two repo-relative strings (both already normalized,
|
|
82
|
-
# no `..` segments, no symlinks in the literal path). Portable: no python3, no
|
|
83
|
-
# GNU realpath --relative-to (macOS ships neither).
|
|
84
|
-
rel_path() {
|
|
85
|
-
local from="${1#./}" to="${2#./}"
|
|
86
|
-
local -a fa ta
|
|
87
|
-
IFS='/' read -r -a fa <<< "$from"
|
|
88
|
-
IFS='/' read -r -a ta <<< "$to"
|
|
89
|
-
local i=0
|
|
90
|
-
while [[ $i -lt ${#fa[@]} && $i -lt ${#ta[@]} && "${fa[$i]}" == "${ta[$i]}" ]]; do
|
|
91
|
-
i=$((i + 1))
|
|
92
|
-
done
|
|
93
|
-
local up="" j
|
|
94
|
-
for (( j=i; j<${#fa[@]}; j++ )); do up="../$up"; done
|
|
95
|
-
local down="" k
|
|
96
|
-
for (( k=i; k<${#ta[@]}; k++ )); do down="$down${ta[$k]}/"; done
|
|
97
|
-
down="${down%/}"
|
|
98
|
-
printf '%s%s' "$up" "$down"
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
# Every worker path must be inside the scope dir.
|
|
102
|
-
for wp in "${worker_paths[@]}"; do
|
|
103
|
-
wp="${wp#./}"
|
|
104
|
-
if ! rel_under "$wp" "$scope_dir"; then
|
|
105
|
-
echo "error: worker path '$wp' is not under scope dir '$scope_dir'" >&2
|
|
106
|
-
echo " canonical must live in the narrowest scope covering all sharers;" >&2
|
|
107
|
-
echo " cross-scope symlinks are disallowed. Aborting (no changes made)." >&2
|
|
108
|
-
exit 2
|
|
109
|
-
fi
|
|
110
|
-
done
|
|
111
|
-
|
|
112
|
-
note "Canonical: $canonical"
|
|
113
|
-
note "Scope: $scope_dir"
|
|
114
|
-
[[ $APPLY -eq 1 ]] || note "(dry run — pass --apply to make changes)"
|
|
115
|
-
|
|
116
|
-
# 1) Establish the canonical file.
|
|
117
|
-
if [[ -e "$canonical" && ! -L "$canonical" ]]; then
|
|
118
|
-
note "canonical already exists (regular file) — reusing it"
|
|
119
|
-
else
|
|
120
|
-
# Promote the first worker path that is a real (non-symlink) file.
|
|
121
|
-
seed=""
|
|
122
|
-
for wp in "${worker_paths[@]}"; do
|
|
123
|
-
if [[ -f "$wp" && ! -L "$wp" ]]; then seed="$wp"; break; fi
|
|
124
|
-
done
|
|
125
|
-
if [[ -z "$seed" ]]; then
|
|
126
|
-
echo "error: no canonical exists and no worker path is a regular file to seed it from" >&2
|
|
127
|
-
exit 2
|
|
128
|
-
fi
|
|
129
|
-
would "mkdir -p $scope_dir/_shared-skills"
|
|
130
|
-
would "git mv $seed $canonical (promote first copy to canonical)"
|
|
131
|
-
if [[ $APPLY -eq 1 ]]; then
|
|
132
|
-
mkdir -p "$scope_dir/_shared-skills"
|
|
133
|
-
git mv "$seed" "$canonical" 2>/dev/null || mv "$seed" "$canonical"
|
|
134
|
-
fi
|
|
135
|
-
fi
|
|
136
|
-
|
|
137
|
-
# 2) Point each worker path at the canonical via a relative symlink.
|
|
138
|
-
for wp in "${worker_paths[@]}"; do
|
|
139
|
-
wp="${wp#./}"
|
|
140
|
-
# Already the canonical file itself (post-promotion) → link it too so every
|
|
141
|
-
# worker slot is a symlink and the canonical lives only under _shared-skills.
|
|
142
|
-
target_dir="$(dirname "$wp")"
|
|
143
|
-
# Relative path from the worker's skills dir to the canonical (portable).
|
|
144
|
-
rel="$(rel_path "$target_dir" "$canonical")"
|
|
145
|
-
|
|
146
|
-
if [[ -L "$wp" ]]; then
|
|
147
|
-
cur="$(readlink "$wp")"
|
|
148
|
-
if [[ "$cur" == "$rel" ]]; then
|
|
149
|
-
note "ok: $wp already links to canonical"
|
|
150
|
-
continue
|
|
151
|
-
fi
|
|
152
|
-
would "relink $wp -> $rel (was: $cur)"
|
|
153
|
-
if [[ $APPLY -eq 1 ]]; then ln -sfn "$rel" "$wp"; fi
|
|
154
|
-
continue
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
if [[ -e "$wp" ]]; then
|
|
158
|
-
# Regular file present — must match canonical or be reconciled first.
|
|
159
|
-
if cmp -s "$wp" "$canonical"; then
|
|
160
|
-
would "replace identical copy $wp with symlink -> $rel"
|
|
161
|
-
if [[ $APPLY -eq 1 ]]; then rm -f "$wp"; ln -s "$rel" "$wp"; fi
|
|
162
|
-
else
|
|
163
|
-
if [[ $FORCE -eq 1 ]]; then
|
|
164
|
-
would "FORCE replace DRIFTED copy $wp with symlink -> $rel (content discarded)"
|
|
165
|
-
if [[ $APPLY -eq 1 ]]; then rm -f "$wp"; ln -s "$rel" "$wp"; fi
|
|
166
|
-
else
|
|
167
|
-
echo " DRIFT: $wp differs from canonical — reconcile by hand, then re-run" >&2
|
|
168
|
-
echo " (diff $wp $canonical), or pass --force to accept canonical." >&2
|
|
169
|
-
exit 3
|
|
170
|
-
fi
|
|
171
|
-
fi
|
|
172
|
-
else
|
|
173
|
-
would "create symlink $wp -> $rel"
|
|
174
|
-
if [[ $APPLY -eq 1 ]]; then mkdir -p "$target_dir"; ln -s "$rel" "$wp"; fi
|
|
175
|
-
fi
|
|
176
|
-
done
|
|
177
|
-
|
|
178
|
-
note "done."
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Default-off rollout gate for native worker-scoped skill commands. */
|
|
2
|
-
export declare const CORE_NATIVE_WORKER_SKILLS_FLAG = "core-native-worker-skills";
|
|
3
|
-
export declare function coreNativeWorkerSkillsEnabled(): Promise<boolean>;
|
|
4
|
-
//# sourceMappingURL=core-native-worker-skills-flag.d.ts.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** Default-off rollout gate for native worker-scoped skill commands. */
|
|
2
|
-
export const CORE_NATIVE_WORKER_SKILLS_FLAG = "core-native-worker-skills";
|
|
3
|
-
export async function coreNativeWorkerSkillsEnabled() {
|
|
4
|
-
const { resolveProcessFlagGate } = await import("../lib/flag-registry.js");
|
|
5
|
-
return resolveProcessFlagGate(CORE_NATIVE_WORKER_SKILLS_FLAG, { fallback: false }, () => false);
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=core-native-worker-skills-flag.js.map
|