Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/skills/sce-info/hooks/register.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions .opencode/plugins/sce-agent-trace.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions .opencode/plugins/sce-bash-policy.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 0 additions & 32 deletions .pi/extensions/sce/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ type PendingFileMutation = {
before: string | undefined;
};

/**
* Evaluate a bash command against SCE bash-tool policy by delegating to the
* Rust `sce policy bash` command. Returns the parsed JSON result, or null if
* the policy check could not be performed (fail-open).
*/
function evaluateBashCommandPolicy(command: string): JsonPolicyResult | null {
try {
const result = spawnSync(
Expand Down Expand Up @@ -134,11 +129,6 @@ function evaluateBashCommandPolicy(command: string): JsonPolicyResult | null {
}
}

/**
* Send a conversation-trace payload to `sce hooks conversation-trace`,
* fire-and-forget. Fail-open: stderr is ignored so that sce intake errors do
* not leak into the Pi TUI, and the returned promise never rejects.
*/
function runConversationTraceHook(
cwd: string,
payload: ConversationTracePayload,
Expand Down Expand Up @@ -228,12 +218,6 @@ function buildMessageEndConversationTracePayload(
return { tool_name: TOOL_NAME, payloads };
}

/**
* Resolve the installed Pi package version for diff-trace `tool_version`.
* The package's `exports` map does not expose `package.json`, so resolve the
* package entry point and read `package.json` from the package root instead.
* Returns null when resolution fails (normalized diff traces permit it).
*/
async function resolvePiToolVersion(): Promise<string | null> {
try {
const entryPath = fileURLToPath(
Expand All @@ -251,10 +235,6 @@ async function resolvePiToolVersion(): Promise<string | null> {
}
}

/**
* Send a diff-trace payload to `sce hooks diff-trace`, fire-and-forget.
* Fail-open: stderr is ignored and the returned promise never rejects.
*/
function runDiffTraceHook(
cwd: string,
payload: DiffTracePayload,
Expand Down Expand Up @@ -292,11 +272,6 @@ function diffLabelFor(cwd: string, absolutePath: string): string {
: absolutePath;
}

/**
* Rewrite temp-file path labels in git diff header lines to the repo-relative
* target path. Only header lines before the first `@@` hunk marker are
* touched so that content lines starting with `--- ` / `+++ ` are preserved.
*/
function rewriteDiffLabels(
diff: string,
label: string,
Expand All @@ -319,12 +294,6 @@ function rewriteDiffLabels(
return lines.join("\n");
}

/**
* Produce a unified diff between before/after contents by writing them to
* temp files and spawning `git diff --no-index --no-ext-diff` (exit status 1
* means "files differ"). Returns undefined for no-op diffs or any failure;
* temp files are always cleaned up.
*/
async function buildUnifiedDiff(
label: string,
before: string | undefined,
Expand Down Expand Up @@ -775,7 +744,6 @@ export default function sceExtension(pi: ExtensionAPI): void {

const policyResult = evaluateBashCommandPolicy(command);
if (!policyResult) {
// Fail open: if the policy check cannot be performed, allow the command.
return undefined;
}

Expand Down
2 changes: 2 additions & 0 deletions cli/assets/hooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -eu

# >>> sce managed block (do not edit) >>>
if ! command -v sce >/dev/null 2>&1; then
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')"
Expand All @@ -27,3 +28,4 @@ fi
sce hooks commit-msg "$@"
status=$?
exit "$status"
# <<< sce managed block <<<
2 changes: 2 additions & 0 deletions cli/assets/hooks/post-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -eu

# >>> sce managed block (do not edit) >>>
if ! command -v sce >/dev/null 2>&1; then
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')"
Expand Down Expand Up @@ -33,3 +34,4 @@ else
fi
status=$?
exit "$status"
# <<< sce managed block <<<
2 changes: 2 additions & 0 deletions cli/assets/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
set -eu

# >>> sce managed block (do not edit) >>>
if ! command -v sce >/dev/null 2>&1; then
if [ -t 2 ]; then
RED="$(printf '\033[38;2;220;38;38m')"
Expand All @@ -27,3 +28,4 @@ fi
sce hooks pre-commit "$@"
status=$?
exit "$status"
# <<< sce managed block <<<
Loading
Loading