devflow-kit 3.0.1 → 3.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/CHANGELOG.md +49 -0
- package/README.md +1 -1
- package/dist/agents/git.md +2 -2
- package/dist/cli/agents-view/index.js +1 -1
- package/dist/cli/agents-view/render.js +71 -17
- package/dist/cli/agents-view/state.js +42 -16
- package/dist/cli/agents-view/terminal.js +5 -5
- package/dist/cli/commands/agents.js +142 -51
- package/dist/cli/commands/ambient.js +1 -1
- package/dist/cli/commands/attribution-prompts.js +8 -8
- package/dist/cli/commands/capture.js +1 -1
- package/dist/cli/commands/compliance-prompts.js +8 -8
- package/dist/cli/commands/compliance.js +8 -7
- package/dist/cli/commands/flags.js +33 -31
- package/dist/cli/commands/hud.js +1 -1
- package/dist/cli/commands/init-seed.js +9 -9
- package/dist/cli/commands/init.js +162 -85
- package/dist/cli/commands/install-report.js +10 -10
- package/dist/cli/commands/learning.js +302 -136
- package/dist/cli/commands/memory.js +36 -15
- package/dist/cli/commands/proxy.js +23 -23
- package/dist/cli/commands/rules.js +6 -5
- package/dist/cli/commands/tracker-prompts.js +6 -6
- package/dist/cli/commands/tracker.js +9 -9
- package/dist/cli/commands/uninstall.js +183 -59
- package/dist/cli/flags-view/render.js +5 -5
- package/dist/cli/flags-view/state.js +9 -9
- package/dist/cli/flags-view/terminal.js +4 -4
- package/dist/cli/tui/cells.js +1 -1
- package/dist/cli/tui/terminal.js +6 -6
- package/dist/commands/code-review.md +0 -2
- package/dist/commands/debug.md +14 -11
- package/dist/commands/dynamic-build.md +51 -47
- package/dist/commands/dynamic-plan.md +27 -7
- package/dist/commands/dynamic-profile.md +17 -3
- package/dist/commands/dynamic-tickets.md +18 -4
- package/dist/commands/explore.md +9 -3
- package/dist/commands/implement.md +20 -16
- package/dist/commands/plan.md +13 -9
- package/dist/commands/release.md +23 -3
- package/dist/commands/research.md +9 -3
- package/dist/commands/resolve.md +9 -12
- package/dist/commands/self-review.md +0 -2
- package/dist/core/agent-frontmatter.js +28 -3
- package/dist/core/agent-models.js +204 -42
- package/dist/core/agent-state.js +28 -6
- package/dist/core/ansi.js +2 -2
- package/dist/core/assets.js +1 -1
- package/dist/core/cache.js +7 -8
- package/dist/core/codex-auth-inspect.js +4 -4
- package/dist/core/compliance-compose.js +3 -3
- package/dist/core/compliance.js +3 -4
- package/dist/core/evidence-policy.js +14 -13
- package/dist/core/external-models.js +1 -1
- package/dist/core/feature-config.js +71 -13
- package/dist/core/feature-switch.js +3 -3
- package/dist/core/flags.js +49 -25
- package/dist/core/fs-atomic.js +6 -7
- package/dist/core/learning-queue-cleanup.js +16 -81
- package/dist/core/learning-store.js +61 -0
- package/dist/core/linked-path.js +46 -0
- package/dist/core/manifest.js +5 -5
- package/dist/core/mds-variants.js +13 -13
- package/dist/core/model-discovery.js +8 -8
- package/dist/core/observations.js +17 -101
- package/dist/core/orphan-sweep.js +4 -4
- package/dist/core/plugins.js +13 -8
- package/dist/core/project-paths.js +9 -13
- package/dist/core/proxy-log.js +8 -8
- package/dist/core/proxy-state.js +3 -3
- package/dist/core/queue-drain.js +31 -0
- package/dist/core/reference-sweep.js +6 -6
- package/dist/core/teammate-mode-cleanup.js +1 -1
- package/dist/core/tracker.js +14 -14
- package/dist/hud/colors.js +2 -2
- package/dist/hud/components/learning-counts.js +54 -22
- package/dist/hud/components/version-badge.js +1 -1
- package/dist/skills/git/references/pr/resolve-review-threads.md +2 -2
- package/dist/skills/git/references/tracker/github/create-release.md +2 -2
- package/dist/skills/git/references/tracker/jira/create-release.md +2 -2
- package/dist/skills/git/references/tracker/linear/create-release.md +2 -2
- package/dist/targets/claude-code/compliance-install.js +17 -15
- package/dist/targets/claude-code/hooks.js +2 -2
- package/dist/targets/claude-code/installer.js +59 -32
- package/dist/targets/claude-code/legacy.js +1 -1
- package/dist/targets/claude-code/post-install.js +135 -45
- package/dist/targets/claude-code/tracker-install.js +2 -2
- package/package.json +1 -1
- package/src/assets/agents/code.md +15 -21
- package/src/assets/agents/design.md +4 -2
- package/src/assets/agents/diagnose.md +3 -1
- package/src/assets/agents/evaluate.md +4 -0
- package/src/assets/agents/git.mds +2 -2
- package/src/assets/agents/knowledge.md +5 -3
- package/src/assets/agents/learning.md +281 -196
- package/src/assets/agents/research.md +3 -1
- package/src/assets/agents/review.md +5 -3
- package/src/assets/agents/scrutinize.md +5 -1
- package/src/assets/agents/simplify.md +4 -0
- package/src/assets/agents/skim.md +4 -2
- package/src/assets/agents/synthesize.md +6 -0
- package/src/assets/agents/test.md +18 -10
- package/src/assets/agents/triage.md +11 -9
- package/src/assets/agents/validate.md +14 -10
- package/src/assets/commands/_partials/_decisions.mds +8 -3
- package/src/assets/commands/_partials/_docs_root.mds +3 -3
- package/src/assets/commands/_partials/_engine.mds +16 -32
- package/src/assets/commands/_partials/_knowledge.mds +0 -2
- package/src/assets/commands/_partials/_preamble.mds +6 -2
- package/src/assets/commands/_partials/_settings.mds +2 -2
- package/src/assets/commands/_partials/_tracker.mds +1 -1
- package/src/assets/commands/code-review.mds +0 -2
- package/src/assets/commands/debug.mds +13 -8
- package/src/assets/commands/dynamic-build.mds +18 -12
- package/src/assets/commands/dynamic-plan.mds +10 -4
- package/src/assets/commands/dynamic-profile.mds +1 -1
- package/src/assets/commands/dynamic-tickets.mds +2 -2
- package/src/assets/commands/explore.mds +9 -1
- package/src/assets/commands/implement.mds +19 -13
- package/src/assets/commands/plan.mds +12 -8
- package/src/assets/commands/release.md +23 -3
- package/src/assets/commands/research.mds +9 -3
- package/src/assets/commands/resolve.mds +9 -10
- package/src/assets/mds/git/_pr.mds +3 -3
- package/src/assets/mds/tracker/_common.mds +1 -1
- package/src/assets/mds/tracker/_github.mds +3 -3
- package/src/assets/mds/tracker/_jira.mds +3 -3
- package/src/assets/mds/tracker/_linear.mds +3 -3
- package/src/assets/mds/tracker/_mcp.mds +6 -5
- package/src/assets/scripts/hooks/assets/orchestrator-charter.md +4 -2
- package/src/assets/scripts/hooks/background-memory-update +97 -33
- package/src/assets/scripts/hooks/capture-prompt +4 -3
- package/src/assets/scripts/hooks/capture-question +4 -3
- package/src/assets/scripts/hooks/capture-turn +5 -20
- package/src/assets/scripts/hooks/ensure-devflow-init +14 -2
- package/src/assets/scripts/hooks/ensure-proxy +5 -6
- package/src/assets/scripts/hooks/ensure-root-gitignore +123 -11
- package/src/assets/scripts/hooks/git-marker +71 -0
- package/src/assets/scripts/hooks/is-hex-sha +1 -1
- package/src/assets/scripts/hooks/json-helper.cjs +345 -944
- package/src/assets/scripts/hooks/json-parse +25 -129
- package/src/assets/scripts/hooks/lib/decisions-format.cjs +205 -156
- package/src/assets/scripts/hooks/lib/learning-store.cjs +3207 -0
- package/src/assets/scripts/hooks/lib/mkdir-lock.cjs +7 -5
- package/src/assets/scripts/hooks/lib/project-paths.cjs +13 -19
- package/src/assets/scripts/hooks/lib/render-decisions.cjs +253 -226
- package/src/assets/scripts/hooks/memory-worker +10 -0
- package/src/assets/scripts/hooks/pre-compact-memory +66 -14
- package/src/assets/scripts/hooks/preamble +9 -1
- package/src/assets/scripts/hooks/queue-append +55 -23
- package/src/assets/scripts/hooks/resolve-project-root +3 -4
- package/src/assets/scripts/hooks/session-start-context +146 -45
- package/src/assets/scripts/hooks/session-start-memory +33 -11
- package/src/assets/scripts/lib/project-config.cjs +2 -2
- package/src/assets/scripts/pr-evidence.cjs +3 -3
- package/src/assets/scripts/redact-secrets.cjs +20 -20
- package/src/assets/scripts/release-trace.cjs +1 -1
- package/src/assets/scripts/resolve-evidence-policy.cjs +3 -3
- package/src/assets/scripts/resolve-settings.cjs +3 -3
- package/src/assets/scripts/verify-evidence.cjs +2 -2
- package/src/assets/skills/apply-decisions/SKILL.md +37 -17
- package/src/assets/skills/docs-framework/SKILL.md +2 -2
- package/src/assets/skills/feature-knowledge/SKILL.md +6 -5
- package/src/assets/skills/test-driven-development/SKILL.md +6 -4
- package/dist/core/observation-io.js +0 -50
- package/src/assets/scripts/hooks/decisions-usage-scan.cjs +0 -131
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
# JSON parsing helper — tries jq, falls back to node json-helper.
|
|
3
|
+
# JSON parsing helper — tries jq, falls back to node json-helper.cjs
|
|
4
4
|
# Usage: source "$SCRIPT_DIR/json-parse"
|
|
5
5
|
#
|
|
6
6
|
# After sourcing, check $_JSON_AVAILABLE before using json_* functions.
|
|
7
7
|
# All functions read from stdin unless noted otherwise.
|
|
8
|
+
# Where a jq path discards stderr, its node fallback does too, so input that
|
|
9
|
+
# cannot be parsed fails silently on either backend.
|
|
8
10
|
|
|
9
11
|
_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
12
|
_JSON_HELPER="$_SCRIPT_DIR/json-helper.cjs"
|
|
@@ -28,133 +30,42 @@ json_field() {
|
|
|
28
30
|
if [ "$_HAS_JQ" = "true" ]; then
|
|
29
31
|
jq -r ".$field // \"$default\"" 2>/dev/null
|
|
30
32
|
else
|
|
31
|
-
node "$_JSON_HELPER" get-field "$field" "$default"
|
|
33
|
+
node "$_JSON_HELPER" get-field "$field" "$default" 2>/dev/null
|
|
32
34
|
fi
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
# Extract a field from a JSON file. Usage: json_field_file "/path/to/file.json" "field" "default"
|
|
36
38
|
# Note: uses if/then/else to preserve boolean false (jq // operator would replace false with default)
|
|
39
|
+
# The node fallback reads the file on stdin: json-helper takes no file path.
|
|
40
|
+
# Both paths are silent on stderr: an unparseable or missing file yields empty
|
|
41
|
+
# output and a failing status, as jq does with its errors discarded. The node
|
|
42
|
+
# path redirects stderr BEFORE stdin, so the shell's own error for a `< "$file"`
|
|
43
|
+
# that cannot open is discarded too.
|
|
37
44
|
json_field_file() {
|
|
38
45
|
local file="$1" field="$2" default="${3:-}"
|
|
39
46
|
if [ "$_HAS_JQ" = "true" ]; then
|
|
40
47
|
jq -r "if (.$field | type) == \"null\" then \"$default\" else (.$field | tostring) end" "$file" 2>/dev/null
|
|
41
48
|
else
|
|
42
|
-
node "$_JSON_HELPER" get-field
|
|
49
|
+
node "$_JSON_HELPER" get-field "$field" "$default" 2>/dev/null < "$file"
|
|
43
50
|
fi
|
|
44
51
|
}
|
|
45
52
|
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
# Compact stdin JSON to single line. Usage: echo '{ "k": "v" }' | json_compact
|
|
60
|
-
json_compact() {
|
|
61
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
62
|
-
jq -c '.' 2>/dev/null
|
|
63
|
-
else
|
|
64
|
-
node "$_JSON_HELPER" compact
|
|
65
|
-
fi
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
# --- Construction ---
|
|
69
|
-
|
|
70
|
-
# Build a JSON object from --arg/--argjson pairs.
|
|
71
|
-
# Usage: json_construct --arg key1 val1 --arg key2 val2
|
|
72
|
-
json_construct() {
|
|
73
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
74
|
-
# Build jq expression from args
|
|
75
|
-
local jq_args=()
|
|
76
|
-
local fields=""
|
|
77
|
-
local i=0
|
|
78
|
-
while [ $i -lt $# ]; do
|
|
79
|
-
local flag="${!((i+1))}"
|
|
80
|
-
if [ "$flag" = "--arg" ]; then
|
|
81
|
-
local name="${!((i+2))}"
|
|
82
|
-
local val="${!((i+3))}"
|
|
83
|
-
jq_args+=(--arg "$name" "$val")
|
|
84
|
-
if [ -n "$fields" ]; then fields="$fields, "; fi
|
|
85
|
-
fields="${fields}${name}: \$${name}"
|
|
86
|
-
i=$((i + 3))
|
|
87
|
-
elif [ "$flag" = "--argjson" ]; then
|
|
88
|
-
local name="${!((i+2))}"
|
|
89
|
-
local val="${!((i+3))}"
|
|
90
|
-
jq_args+=(--argjson "$name" "$val")
|
|
91
|
-
if [ -n "$fields" ]; then fields="$fields, "; fi
|
|
92
|
-
fields="${fields}${name}: \$${name}"
|
|
93
|
-
i=$((i + 3))
|
|
94
|
-
else
|
|
95
|
-
i=$((i + 1))
|
|
96
|
-
fi
|
|
97
|
-
done
|
|
98
|
-
jq -n -c "${jq_args[@]}" "{$fields}" 2>/dev/null
|
|
99
|
-
else
|
|
100
|
-
node "$_JSON_HELPER" construct "$@"
|
|
101
|
-
fi
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# --- Field updates ---
|
|
105
|
-
|
|
106
|
-
# Update a field on stdin JSON. Usage: echo '{"k":"v"}' | json_update_field "k" "new_v"
|
|
107
|
-
json_update_field() {
|
|
108
|
-
local field="$1" value="$2"
|
|
109
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
110
|
-
jq -c --arg v "$value" ".$field = \$v" 2>/dev/null
|
|
111
|
-
else
|
|
112
|
-
node "$_JSON_HELPER" update-field "$field" "$value"
|
|
113
|
-
fi
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
# Update a field with a JSON value. Usage: echo '{}' | json_update_field_json "k" '42'
|
|
117
|
-
json_update_field_json() {
|
|
118
|
-
local field="$1" value="$2"
|
|
53
|
+
# The typed read of a field from a JSON file. Usage: json_string_field_file "/path/to/file.json" "field"
|
|
54
|
+
# json_field_file stringifies, so the number 42 and the string "42" read the same;
|
|
55
|
+
# this prints the field only when it is a JSON string, and nothing for any other
|
|
56
|
+
# type (a number, boolean, object, array or null), an absent field, or a string
|
|
57
|
+
# holding a NUL, which no shell variable can carry. The string is printed
|
|
58
|
+
# byte-exact with no newline added, so a caller that must see the value's own
|
|
59
|
+
# trailing newline appends a sentinel before the command substitution strips it:
|
|
60
|
+
# v=$(json_string_field_file "$file" "k"; printf x); v=${v%x}
|
|
61
|
+
# Silent on stderr and failing on an unparseable or missing file, as json_field_file
|
|
62
|
+
# is, and read the same way on both backends (the node path reads the file on stdin).
|
|
63
|
+
json_string_field_file() {
|
|
64
|
+
local file="$1" field="$2"
|
|
119
65
|
if [ "$_HAS_JQ" = "true" ]; then
|
|
120
|
-
jq -
|
|
66
|
+
jq -j ".$field | select(type == \"string\" and all(explode[]; . != 0))" "$file" 2>/dev/null
|
|
121
67
|
else
|
|
122
|
-
node "$_JSON_HELPER"
|
|
123
|
-
fi
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
# --- Slurp operations ---
|
|
127
|
-
|
|
128
|
-
# Slurp JSONL file, sort by field desc, output as JSONL (one line per entry).
|
|
129
|
-
# Usage: json_slurp_cap "file.jsonl" "confidence" 100
|
|
130
|
-
json_slurp_cap() {
|
|
131
|
-
local file="$1" field="$2" limit="${3:-100}"
|
|
132
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
133
|
-
jq -c '.' "$file" | jq -s "sort_by(.$field) | reverse | .[0:$limit][]" 2>/dev/null
|
|
134
|
-
else
|
|
135
|
-
node "$_JSON_HELPER" slurp-cap "$file" "$field" "$limit"
|
|
136
|
-
fi
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
# --- Array operations ---
|
|
140
|
-
|
|
141
|
-
# Get length of array at path. Usage: echo '{"obs":[1,2]}' | json_array_length "observations"
|
|
142
|
-
json_array_length() {
|
|
143
|
-
local path="$1"
|
|
144
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
145
|
-
jq ".$path | length" 2>/dev/null
|
|
146
|
-
else
|
|
147
|
-
node "$_JSON_HELPER" array-length "$path"
|
|
148
|
-
fi
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
# Get item at index from array. Usage: echo '{"obs":[{},{}]}' | json_array_item "observations" 0
|
|
152
|
-
json_array_item() {
|
|
153
|
-
local path="$1" index="$2"
|
|
154
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
155
|
-
jq -c ".${path}[$index]" 2>/dev/null
|
|
156
|
-
else
|
|
157
|
-
node "$_JSON_HELPER" array-item "$path" "$index"
|
|
68
|
+
node "$_JSON_HELPER" get-string-field "$field" 2>/dev/null < "$file"
|
|
158
69
|
fi
|
|
159
70
|
}
|
|
160
71
|
|
|
@@ -175,7 +86,7 @@ json_extract_cwd_field() {
|
|
|
175
86
|
if [ "$_HAS_JQ" = "true" ]; then
|
|
176
87
|
jq -r --arg f "$field" '(.cwd // "") + "\u0001" + (.[$f] // "")' 2>/dev/null
|
|
177
88
|
else
|
|
178
|
-
node "$_JSON_HELPER" extract-cwd-field "$field"
|
|
89
|
+
node "$_JSON_HELPER" extract-cwd-field "$field" 2>/dev/null
|
|
179
90
|
fi
|
|
180
91
|
}
|
|
181
92
|
|
|
@@ -185,21 +96,6 @@ json_extract_cwd_prompt() {
|
|
|
185
96
|
json_extract_cwd_field "prompt"
|
|
186
97
|
}
|
|
187
98
|
|
|
188
|
-
# --- Transcript extraction ---
|
|
189
|
-
|
|
190
|
-
# Extract text messages from Claude message JSON. Usage: printf '%s\n' '{"message":...}' | json_extract_messages
|
|
191
|
-
json_extract_messages() {
|
|
192
|
-
if [ "$_HAS_JQ" = "true" ]; then
|
|
193
|
-
jq -r 'if .message.content then
|
|
194
|
-
if (.message.content | type) == "string" then .message.content
|
|
195
|
-
else [.message.content[] | select(.type == "text") | .text] | join("\n")
|
|
196
|
-
end
|
|
197
|
-
else "" end' 2>/dev/null
|
|
198
|
-
else
|
|
199
|
-
node "$_JSON_HELPER" extract-text-messages
|
|
200
|
-
fi
|
|
201
|
-
}
|
|
202
|
-
|
|
203
99
|
# --- Hook output envelopes ---
|
|
204
100
|
|
|
205
101
|
# Build SessionStart output. Usage: json_session_output "$CONTEXT"
|