@ericrisco/rsc 3.0.7 → 3.0.9
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/README.md +27 -12
- package/manifest.json +1 -1
- package/package.json +1 -1
- package/scripts/audit.js +11 -0
- package/scripts/doctor.js +69 -11
- package/scripts/install-apply.js +221 -18
- package/scripts/lib/constitution-draft.js +156 -0
- package/scripts/lib/onboarding-apply.js +31 -25
- package/scripts/lib/onboarding.js +26 -4
- package/scripts/lib/tools-skeleton.js +76 -0
- package/scripts/rsc.js +109 -14
- package/skills/constitution/SKILL.md +2 -0
- package/skills/ftd/SKILL.md +9 -0
- package/skills/sdd/SKILL.md +2 -2
- package/skills/specify/SKILL.md +1 -1
- package/skills/suggest/SKILL.md +5 -4
- package/targets/branch-guard.mjs +94 -26
- package/targets/claude.js +36 -6
- package/targets/clone-bootstrap.mjs +1 -1
- package/targets/danger-guard.mjs +80 -14
- package/targets/ftd-nudge.mjs +137 -0
- package/targets/gitmoji-guard.mjs +14 -1
- package/targets/knowledge-sync.mjs +490 -48
- package/targets/opt-outs.js +2 -0
- package/targets/sello.mjs +9 -2
- package/targets/session-memory-adapter.mjs +27 -3
- package/targets/session-memory-core.mjs +219 -36
- package/targets/session-start.mjs +40 -5
- package/targets/shell-unwrap.mjs +145 -0
- package/targets/ship-guard.mjs +40 -9
- package/targets/team-safe-start.mjs +76 -10
- package/targets/worktree-reaper.mjs +114 -4
|
@@ -143,7 +143,11 @@ const HAS_INLINE_M = /(?:^|\s)(?:-[a-zA-Z]*m|--message)(?:=|\s|$)/;
|
|
|
143
143
|
// `git` must be the command being RUN, not text inside someone else's argument —
|
|
144
144
|
// otherwise `echo "git commit -m x"` or `grep "git commit -m"` gets denied, and a guard
|
|
145
145
|
// that blocks the discussion of commits is exactly the kind that gets switched off.
|
|
146
|
-
const RUNS_GIT = /^\s*(?:sudo\s
|
|
146
|
+
const RUNS_GIT = /^\s*(?:(?:sudo|env|command|exec|nohup)\s+|[A-Za-z_][A-Za-z0-9_]*=\S*\s+)*git\b/;
|
|
147
|
+
|
|
148
|
+
// A commit handed to a shell as a string (`bash -c "git commit -m …"`, `eval …`) is read inside
|
|
149
|
+
// that string (E2E defect 15). shell-unwrap.mjs is a sibling under `.rsc/`; without it, as before.
|
|
150
|
+
const SH = await import(new URL('./shell-unwrap.mjs', import.meta.url)).catch(() => null);
|
|
147
151
|
|
|
148
152
|
const SEPARATORS = /&&|\|\||[;\n]/;
|
|
149
153
|
|
|
@@ -174,6 +178,15 @@ function inlineMessage(segment) {
|
|
|
174
178
|
export function commitMessages(command) {
|
|
175
179
|
const cmd = String(command ?? '');
|
|
176
180
|
if (!COMMIT.test(cmd)) return [];
|
|
181
|
+
const inner = SH ? SH.innerScripts(cmd) : [];
|
|
182
|
+
if (!inner.length) return directMessages(cmd);
|
|
183
|
+
// The wrapped strings are read on their own; the rest of the chain without them, so a commit is
|
|
184
|
+
// never read twice (once naively through the quotes, once unwrapped).
|
|
185
|
+
const rest = SH.segments(SH.withoutHeredocs(cmd)).filter((seg) => SH.unwrap(seg)?.inner === undefined).join('\n');
|
|
186
|
+
return [...directMessages(rest), ...inner.flatMap(commitMessages)];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function directMessages(cmd) {
|
|
177
190
|
|
|
178
191
|
// The heredoc form must be handled before any splitting: its body is the message and
|
|
179
192
|
// may legitimately contain && or ;. The command that owns it is whatever runs just
|